From 6946ae807ea88409b84e7eb1b992402097d212bb Mon Sep 17 00:00:00 2001 From: George Wiggin Date: Fri, 13 Feb 2026 17:27:40 +0000 Subject: [PATCH] Figma sync: design update (node 6:513) --- .../compositions/DashboardBarChart.figma.tsx | 20 ++++++++++++ .../DashboardBarChart.stories.tsx | 28 ++++++++++++++++- .../DashboardBarChart/DashboardBarChart.tsx | 31 +++++++++++++++++++ .../DashboardBarChart/dashboard-bar-chart.css | 10 ++++++ src/ui/compositions/index.ts | 1 + 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/ui/compositions/DashboardBarChart/DashboardBarChart.tsx create mode 100644 src/ui/compositions/DashboardBarChart/dashboard-bar-chart.css diff --git a/src/figma/compositions/DashboardBarChart.figma.tsx b/src/figma/compositions/DashboardBarChart.figma.tsx index bc5d852d..76ff68a2 100644 --- a/src/figma/compositions/DashboardBarChart.figma.tsx +++ b/src/figma/compositions/DashboardBarChart.figma.tsx @@ -1,5 +1,6 @@ import figma from "@figma/code-connect"; import { + DashboardBarChart, GraphHeader, GraphVisualisation, } from "compositions"; @@ -33,3 +34,22 @@ figma.connect( ), }, ); + +figma.connect( + DashboardBarChart, + "https://www.figma.com/design/RunXbtjgAaAIsNgvyEndOD/MCP-Design-System?node-id=6-513&m=dev", + { + example: () => ( + + ), + }, +); diff --git a/src/stories/compositions/DashboardBarChart.stories.tsx b/src/stories/compositions/DashboardBarChart.stories.tsx index 2fc86a09..690311af 100644 --- a/src/stories/compositions/DashboardBarChart.stories.tsx +++ b/src/stories/compositions/DashboardBarChart.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { GraphHeader } from "compositions"; +import { DashboardBarChart, GraphHeader } from "compositions"; const meta: Meta = { component: GraphHeader, @@ -58,3 +58,29 @@ export const StoryGraphHeaderWithoutAI: StoryObj = { ), }; + +export const StoryDashboardBarChart: StoryObj = { + name: "Complete Dashboard Bar Chart", + args: { + header: { + title: "Gross Pay Ins", + aiButtonLabel: "Analyse", + }, + visualisation: { + keys: [ + { label: "Key Label" }, + { label: "Key Label" }, + { label: "Key Label" }, + ], + dates: [ + { label: "01 Aug" }, + { label: "07 Aug" }, + ], + }, + }, + render: (args) => ( +
+ +
+ ), +}; diff --git a/src/ui/compositions/DashboardBarChart/DashboardBarChart.tsx b/src/ui/compositions/DashboardBarChart/DashboardBarChart.tsx new file mode 100644 index 00000000..19bca0c9 --- /dev/null +++ b/src/ui/compositions/DashboardBarChart/DashboardBarChart.tsx @@ -0,0 +1,31 @@ +import { clsx } from "clsx"; +import { GraphHeader, type GraphHeaderProps } from "./GraphHeader"; +import { GraphVisualisation, type GraphVisualisationProps } from "./GraphVisualisation"; +import "./dashboard-bar-chart.css"; + +export type DashboardBarChartProps = { + /** Props for the GraphHeader component */ + header?: GraphHeaderProps; + /** Props for the GraphVisualisation component */ + visualisation?: GraphVisualisationProps; + /** Additional CSS class names */ + className?: string; +}; + +/** + * A dashboard bar chart card that combines a header with title and AI buttons, + * and a graph visualisation with keys and dates. Displays as a white card with + * rounded corners and shadow. + */ +export function DashboardBarChart({ + header, + visualisation, + className, +}: DashboardBarChartProps) { + return ( +
+ {header && } + {visualisation && } +
+ ); +} diff --git a/src/ui/compositions/DashboardBarChart/dashboard-bar-chart.css b/src/ui/compositions/DashboardBarChart/dashboard-bar-chart.css new file mode 100644 index 00000000..2e55dc0e --- /dev/null +++ b/src/ui/compositions/DashboardBarChart/dashboard-bar-chart.css @@ -0,0 +1,10 @@ +.dashboard-bar-chart { + display: flex; + flex-direction: column; + align-items: flex-start; + width: 100%; + background: var(--mcp-color-surface-primary-light); + border-radius: var(--sds-size-radius-400); + box-shadow: var(--sds-effects-shadows-drop-shadow-600); + overflow: hidden; +} diff --git a/src/ui/compositions/index.ts b/src/ui/compositions/index.ts index b2893f9b..4fb8cd89 100644 --- a/src/ui/compositions/index.ts +++ b/src/ui/compositions/index.ts @@ -1,2 +1,3 @@ +export * from "./DashboardBarChart/DashboardBarChart"; export * from "./DashboardBarChart/GraphHeader"; export * from "./DashboardBarChart/GraphVisualisation";