@ramme-io/ui 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -216,7 +216,7 @@ Props, variants and live examples are in Storybook (`pnpm run storybook`) and at
216
216
  | `KeyInjectionOverlay` | `@molecule/ai/key-injection-overlay` | Blocks the app and collects an AI provider key when the gateway reports one is missing or expired. |
217
217
  | `KpiGrid` | `@atom/templates-patterns/kpi-grid` | A framework-level abstraction that takes raw data and metric configurations to auto-calculate values and render a grid of StatCards. |
218
218
  | `Label` | `@molecule/form/label` | The accessible caption for a form control. |
219
- | `LineChart` | `@atom/charts/line-chart` | A theme-aware line chart component... |
219
+ | `LineChart` | `@atom/charts/line-chart` | A theme-aware line chart component for one or more series over a shared x-axis. |
220
220
  | `Loader` | `@molecule/ai/loader` | A compact, theme-aware animation for indicating AI processing states. |
221
221
  | `LoginPage` | `@atom/auth/login-page` | The standard sign-in screen — email and password, with inline error and loading states already wired. |
222
222
  | `Menu` | `@atom/primitive/menu` | A dropdown menu component, useful for navigation or contextual actions. |
@@ -7,14 +7,29 @@ export interface LineChartProps {
7
7
  lineKeys: string[];
8
8
  colors?: string[];
9
9
  connectNulls?: boolean;
10
+ /** Draw a dot on every point. Turn off for long or many series, where dots hide the lines. */
11
+ dot?: boolean;
12
+ /** Series keys to draw thicker than the rest: the line a reader should follow. */
13
+ emphasis?: string[];
14
+ /** Series keys drawn dotted: a reference level rather than a measurement, such as a long-run average. */
15
+ dashed?: string[];
10
16
  xAxisProps?: XAxisProps;
11
17
  yAxisProps?: YAxisProps;
12
18
  }
13
19
  /**
14
20
  * @wizard
15
21
  * @name LineChart
16
- * @description A theme-aware line chart component...
22
+ * @description A theme-aware line chart component for one or more series over a shared x-axis. Set `dot={false}` for long or many series, `emphasis` to draw the series a reader should follow thicker, and `dashed` for a reference level such as a long-run average.
17
23
  * @tags charts, data-visualization, rechart
24
+ * @param {any[]} data - One object per x value, with a key per series.
25
+ * @param {string} dataKeyX - The key holding the x value.
26
+ * @param {string[]} lineKeys - The keys of the series to draw.
27
+ * @param {string[]} colors - Stroke colours by series order; defaults to the theme's chart palette.
28
+ * @param {boolean} dot - Draw a dot on every point (default true).
29
+ * @param {string[]} emphasis - Series keys drawn thicker than the rest.
30
+ * @param {string[]} dashed - Series keys drawn dotted, for a reference level such as a long-run average.
31
+ * @param {XAxisProps} xAxisProps - Passed to the x-axis: label, domain, tick formatter.
32
+ * @param {YAxisProps} yAxisProps - Passed to the y-axis: label, domain, tick formatter.
18
33
  * @category charts
19
34
  * @id line-chart
20
35
  */
@@ -1,58 +1,63 @@
1
- import { jsx as t, jsxs as g } from "react/jsx-runtime";
2
- import { ResponsiveContainer as u, LineChart as C, CartesianGrid as x, XAxis as k, YAxis as y, Tooltip as b, Legend as L, Line as v } from "recharts";
3
- import { useChartTheme as S } from "../../lib/hooks/useChartTheme.js";
4
- const A = ({
5
- data: r,
6
- dataKeyX: s,
7
- lineKeys: i,
8
- colors: o,
9
- connectNulls: h = !0,
10
- xAxisProps: d,
11
- yAxisProps: c
1
+ import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
+ import { ResponsiveContainer as k, LineChart as y, CartesianGrid as b, XAxis as v, YAxis as L, Tooltip as S, Legend as j, Line as w } from "recharts";
3
+ import { useChartTheme as D } from "../../lib/hooks/useChartTheme.js";
4
+ const T = ({
5
+ data: o,
6
+ dataKeyX: h,
7
+ lineKeys: l,
8
+ colors: i,
9
+ connectNulls: d = !0,
10
+ dot: n = !0,
11
+ emphasis: c = [],
12
+ dashed: m = [],
13
+ xAxisProps: p,
14
+ yAxisProps: u
12
15
  }) => {
13
- const { textColor: e, gridColor: l, tooltipBg: m, palette: p } = S(), n = o && o.length > 0 ? o : p;
14
- return !r || r.length === 0 ? /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No data to display" }) }) : /* @__PURE__ */ t(u, { width: "100%", height: "100%", children: /* @__PURE__ */ g(C, { data: r, margin: { top: 5, right: 20, left: 0, bottom: 5 }, children: [
15
- /* @__PURE__ */ t(x, { strokeDasharray: "3 3", stroke: l }),
16
+ const { textColor: e, gridColor: a, tooltipBg: f, palette: g } = D(), s = i && i.length > 0 ? i : g;
17
+ return !o || o.length === 0 ? /* @__PURE__ */ t("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No data to display" }) }) : /* @__PURE__ */ t(k, { width: "100%", height: "100%", children: /* @__PURE__ */ x(y, { data: o, margin: { top: 5, right: 20, left: 0, bottom: 5 }, children: [
18
+ /* @__PURE__ */ t(b, { strokeDasharray: "3 3", stroke: a }),
16
19
  /* @__PURE__ */ t(
17
- k,
20
+ v,
18
21
  {
19
- dataKey: s,
22
+ dataKey: h,
20
23
  stroke: e,
21
24
  tick: { fill: e },
22
- ...d
25
+ ...p
23
26
  }
24
27
  ),
25
28
  /* @__PURE__ */ t(
26
- y,
29
+ L,
27
30
  {
28
31
  stroke: e,
29
32
  tick: { fill: e },
30
- ...c
33
+ ...u
31
34
  }
32
35
  ),
33
36
  /* @__PURE__ */ t(
34
- b,
37
+ S,
35
38
  {
36
- contentStyle: { backgroundColor: m, borderColor: l, borderRadius: "0.5rem" },
39
+ contentStyle: { backgroundColor: f, borderColor: a, borderRadius: "0.5rem" },
37
40
  itemStyle: { color: e },
38
41
  labelStyle: { color: e, fontWeight: "bold" }
39
42
  }
40
43
  ),
41
- i.length > 1 && /* @__PURE__ */ t(L, { wrapperStyle: { color: e } }),
42
- i.map((a, f) => /* @__PURE__ */ t(
43
- v,
44
+ l.length > 1 && /* @__PURE__ */ t(j, { wrapperStyle: { color: e } }),
45
+ l.map((r, C) => /* @__PURE__ */ t(
46
+ w,
44
47
  {
45
48
  type: "monotone",
46
- dataKey: a,
47
- stroke: n[f % n.length],
48
- strokeWidth: 2,
49
- activeDot: { r: 8 },
50
- connectNulls: h
49
+ dataKey: r,
50
+ stroke: s[C % s.length],
51
+ strokeWidth: c.includes(r) ? 3.5 : 2,
52
+ strokeDasharray: m.includes(r) ? "2 4" : void 0,
53
+ dot: n,
54
+ activeDot: { r: n ? 8 : 4 },
55
+ connectNulls: d
51
56
  },
52
- a
57
+ r
53
58
  ))
54
59
  ] }) });
55
60
  };
56
61
  export {
57
- A as LineChart
62
+ T as LineChart
58
63
  };
@@ -930,20 +930,66 @@ const e = {
930
930
  {
931
931
  id: "line-chart",
932
932
  name: "LineChart",
933
- version: "1.0.0",
934
- description: "A theme-aware line chart component...",
933
+ version: "1.0.2",
934
+ description: "A theme-aware line chart component for one or more series over a shared x-axis. Set `dot={false}` for long or many series, `emphasis` to draw the series a reader should follow thicker, and `dashed` for a reference level such as a long-run average.",
935
935
  tags: [
936
936
  "charts",
937
937
  "data-visualization",
938
938
  "rechart"
939
939
  ],
940
940
  category: "charts",
941
- props: [],
941
+ props: [
942
+ {
943
+ name: "data",
944
+ type: "Array<any>",
945
+ description: "One object per x value, with a key per series."
946
+ },
947
+ {
948
+ name: "dataKeyX",
949
+ type: "string",
950
+ description: "The key holding the x value."
951
+ },
952
+ {
953
+ name: "lineKeys",
954
+ type: "Array<string>",
955
+ description: "The keys of the series to draw."
956
+ },
957
+ {
958
+ name: "colors",
959
+ type: "Array<string>",
960
+ description: "Stroke colours by series order; defaults to the theme's chart palette."
961
+ },
962
+ {
963
+ name: "dot",
964
+ type: "boolean",
965
+ description: "Draw a dot on every point (default true)."
966
+ },
967
+ {
968
+ name: "emphasis",
969
+ type: "Array<string>",
970
+ description: "Series keys drawn thicker than the rest."
971
+ },
972
+ {
973
+ name: "dashed",
974
+ type: "Array<string>",
975
+ description: "Series keys drawn dotted, for a reference level such as a long-run average."
976
+ },
977
+ {
978
+ name: "xAxisProps",
979
+ type: "XAxisProps",
980
+ description: "Passed to the x-axis: label, domain, tick formatter."
981
+ },
982
+ {
983
+ name: "yAxisProps",
984
+ type: "YAxisProps",
985
+ description: "Passed to the y-axis: label, domain, tick formatter."
986
+ }
987
+ ],
942
988
  importPath: "./components/data-display/LineChart",
943
989
  filePath: "src/components/data-display/LineChart.tsx",
944
990
  sku: "@atom/charts/line-chart",
945
991
  humanLabel: "LineChart",
946
- humanDescription: "A theme-aware line chart component..."
992
+ humanDescription: "A theme-aware line chart component for one or more series over a shared x-axis. Set `dot={false}` for long or many series, `emphasis` to draw the series a reader should follow thicker, and `dashed` for a reference level such as a long-run average."
947
993
  },
948
994
  {
949
995
  id: "pie-chart",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramme-io/ui",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "The structural component library for the Ramme Framework.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -934,20 +934,66 @@ export const wizardManifest: WizardManifest = {
934
934
  {
935
935
  "id": "line-chart",
936
936
  "name": "LineChart",
937
- "version": "1.0.0",
938
- "description": "A theme-aware line chart component...",
937
+ "version": "1.0.2",
938
+ "description": "A theme-aware line chart component for one or more series over a shared x-axis. Set `dot={false}` for long or many series, `emphasis` to draw the series a reader should follow thicker, and `dashed` for a reference level such as a long-run average.",
939
939
  "tags": [
940
940
  "charts",
941
941
  "data-visualization",
942
942
  "rechart"
943
943
  ],
944
944
  "category": "charts",
945
- "props": [],
945
+ "props": [
946
+ {
947
+ "name": "data",
948
+ "type": "Array<any>",
949
+ "description": "One object per x value, with a key per series."
950
+ },
951
+ {
952
+ "name": "dataKeyX",
953
+ "type": "string",
954
+ "description": "The key holding the x value."
955
+ },
956
+ {
957
+ "name": "lineKeys",
958
+ "type": "Array<string>",
959
+ "description": "The keys of the series to draw."
960
+ },
961
+ {
962
+ "name": "colors",
963
+ "type": "Array<string>",
964
+ "description": "Stroke colours by series order; defaults to the theme's chart palette."
965
+ },
966
+ {
967
+ "name": "dot",
968
+ "type": "boolean",
969
+ "description": "Draw a dot on every point (default true)."
970
+ },
971
+ {
972
+ "name": "emphasis",
973
+ "type": "Array<string>",
974
+ "description": "Series keys drawn thicker than the rest."
975
+ },
976
+ {
977
+ "name": "dashed",
978
+ "type": "Array<string>",
979
+ "description": "Series keys drawn dotted, for a reference level such as a long-run average."
980
+ },
981
+ {
982
+ "name": "xAxisProps",
983
+ "type": "XAxisProps",
984
+ "description": "Passed to the x-axis: label, domain, tick formatter."
985
+ },
986
+ {
987
+ "name": "yAxisProps",
988
+ "type": "YAxisProps",
989
+ "description": "Passed to the y-axis: label, domain, tick formatter."
990
+ }
991
+ ],
946
992
  "importPath": "./components/data-display/LineChart",
947
993
  "filePath": "src/components/data-display/LineChart.tsx",
948
994
  "sku": "@atom/charts/line-chart",
949
995
  "humanLabel": "LineChart",
950
- "humanDescription": "A theme-aware line chart component..."
996
+ "humanDescription": "A theme-aware line chart component for one or more series over a shared x-axis. Set `dot={false}` for long or many series, `emphasis` to draw the series a reader should follow thicker, and `dashed` for a reference level such as a long-run average."
951
997
  },
952
998
  {
953
999
  "id": "pie-chart",