Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/figma/compositions/DashboardBarChart.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
import figma from "@figma/code-connect";
import {
DashboardBarChart,
GraphHeader,
GraphVisualisation,
} from "compositions";

figma.connect(
DashboardBarChart,
"https://www.figma.com/design/RunXbtjgAaAIsNgvyEndOD/MCP-Design-System?node-id=6-513&m=dev",
{
example: () => (
<DashboardBarChart
header={{
title: "Gross Pay Ins",
aiButtons: [{ label: "Analyse" }],
}}
visualisation={{
keys: [{ label: "Key Label" }, { label: "Key Label" }, { label: "Key Label" }],
dates: [{ label: "01 Aug" }, { label: "07 Aug" }],
}}
/>
),
},
);

figma.connect(
GraphHeader,
"https://www.figma.com/design/RunXbtjgAaAIsNgvyEndOD/MCP-Design-System?node-id=3-143&m=dev",
Expand Down
30 changes: 30 additions & 0 deletions src/ui/compositions/DashboardBarChart/DashboardBarChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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 graph header */
header: GraphHeaderProps;
/** Props for the graph visualisation */
visualisation?: GraphVisualisationProps;
/** Additional CSS class names */
className?: string;
};

/**
* A complete dashboard bar chart card combining a GraphHeader
* and GraphVisualisation in a styled card container.
*/
export function DashboardBarChart({
header,
visualisation,
className,
}: DashboardBarChartProps) {
return (
<div className={clsx("dashboard-bar-chart", className)}>
<GraphHeader {...header} />
<GraphVisualisation {...visualisation} />
</div>
);
}
11 changes: 11 additions & 0 deletions src/ui/compositions/DashboardBarChart/dashboard-bar-chart.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.dashboard-bar-chart {
display: flex;
flex-direction: column;
align-items: flex-start;
overflow: clip;
position: relative;
width: 560px;
background: var(--mcp-color-surface-primary-light);
border-radius: var(--sds-size-radius-400);
box-shadow: var(--sds-effects-shadows-drop-shadow-600);
}
1 change: 1 addition & 0 deletions src/ui/compositions/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./DashboardBarChart/DashboardBarChart";
export * from "./DashboardBarChart/GraphHeader";
export * from "./DashboardBarChart/GraphVisualisation";