wimui 0.24.4 → 0.26.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.
Files changed (88) hide show
  1. package/dist/components/_internal/ChartDataTable.cjs +2 -0
  2. package/dist/components/_internal/ChartDataTable.d.ts +43 -0
  3. package/dist/components/_internal/ChartDataTable.js +20 -0
  4. package/dist/components/_internal/chart-data-table.module.cjs +2 -0
  5. package/dist/components/_internal/chart-data-table.module.js +5 -0
  6. package/dist/components/_internal/chartTableData.cjs +0 -0
  7. package/dist/components/_internal/chartTableData.d.ts +53 -0
  8. package/dist/components/_internal/chartTableData.js +0 -0
  9. package/dist/components/ai/AgentStatus/agent-status.module.cjs +1 -1
  10. package/dist/components/ai/AgentStatus/agent-status.module.js +3 -3
  11. package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
  12. package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
  13. package/dist/components/ai/InteractiveGraph/interactive-graph.module.cjs +1 -1
  14. package/dist/components/ai/InteractiveGraph/interactive-graph.module.js +1 -1
  15. package/dist/components/charts/AreaChart/AreaChart.cjs +1 -1
  16. package/dist/components/charts/AreaChart/AreaChart.d.ts +7 -1
  17. package/dist/components/charts/AreaChart/AreaChart.js +85 -68
  18. package/dist/components/charts/BarChart/BarChart.cjs +1 -1
  19. package/dist/components/charts/BarChart/BarChart.d.ts +7 -1
  20. package/dist/components/charts/BarChart/BarChart.js +90 -73
  21. package/dist/components/charts/FunnelChart/FunnelChart.cjs +1 -1
  22. package/dist/components/charts/FunnelChart/FunnelChart.d.ts +7 -1
  23. package/dist/components/charts/FunnelChart/FunnelChart.js +60 -43
  24. package/dist/components/charts/GanttChart/gantt-chart.module.cjs +1 -1
  25. package/dist/components/charts/GanttChart/gantt-chart.module.js +1 -1
  26. package/dist/components/charts/GaugeChart/GaugeChart.cjs +1 -1
  27. package/dist/components/charts/GaugeChart/GaugeChart.d.ts +7 -1
  28. package/dist/components/charts/GaugeChart/GaugeChart.js +6 -4
  29. package/dist/components/charts/Heatmap/Heatmap.cjs +1 -1
  30. package/dist/components/charts/Heatmap/Heatmap.d.ts +7 -1
  31. package/dist/components/charts/Heatmap/Heatmap.js +101 -87
  32. package/dist/components/charts/LineChart/LineChart.cjs +1 -1
  33. package/dist/components/charts/LineChart/LineChart.d.ts +7 -1
  34. package/dist/components/charts/LineChart/LineChart.js +87 -70
  35. package/dist/components/charts/PieChart/PieChart.cjs +1 -1
  36. package/dist/components/charts/PieChart/PieChart.d.ts +7 -1
  37. package/dist/components/charts/PieChart/PieChart.js +65 -45
  38. package/dist/components/charts/RadarChart/RadarChart.cjs +1 -1
  39. package/dist/components/charts/RadarChart/RadarChart.d.ts +7 -1
  40. package/dist/components/charts/RadarChart/RadarChart.js +73 -56
  41. package/dist/components/charts/ScatterChart/ScatterChart.cjs +1 -1
  42. package/dist/components/charts/ScatterChart/ScatterChart.d.ts +7 -1
  43. package/dist/components/charts/ScatterChart/ScatterChart.js +85 -68
  44. package/dist/components/charts/Sparkline/Sparkline.cjs +1 -1
  45. package/dist/components/charts/Sparkline/Sparkline.js +52 -54
  46. package/dist/components/charts/Treemap/Treemap.cjs +1 -1
  47. package/dist/components/charts/Treemap/Treemap.d.ts +7 -1
  48. package/dist/components/charts/Treemap/Treemap.js +75 -61
  49. package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.cjs +1 -1
  50. package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.js +1 -1
  51. package/dist/components/data-display/Kanban/kanban.module.cjs +1 -1
  52. package/dist/components/data-display/Kanban/kanban.module.js +1 -1
  53. package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
  54. package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
  55. package/dist/components/feedback/Alert/alert.module.cjs +1 -1
  56. package/dist/components/feedback/Alert/alert.module.js +5 -5
  57. package/dist/components/feedback/ProgressRing/ProgressRing.d.ts +6 -1
  58. package/dist/components/feedback/Toast/toast.module.cjs +1 -1
  59. package/dist/components/feedback/Toast/toast.module.js +11 -11
  60. package/dist/components/form/FieldTemplate/field-template.module.cjs +1 -1
  61. package/dist/components/form/FieldTemplate/field-template.module.js +1 -1
  62. package/dist/components/helpers.cjs +1 -1
  63. package/dist/components/helpers.d.ts +18 -0
  64. package/dist/components/helpers.js +4 -1
  65. package/dist/components/layout/Footer/Footer.cjs +1 -1
  66. package/dist/components/layout/Footer/Footer.d.ts +15 -0
  67. package/dist/components/layout/Footer/Footer.js +15 -12
  68. package/dist/components/media/Gallery/gallery.module.cjs +1 -1
  69. package/dist/components/media/Gallery/gallery.module.js +11 -11
  70. package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.cjs +1 -1
  71. package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.d.ts +22 -0
  72. package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.js +31 -28
  73. package/dist/components/navigation/SpeedDial/SpeedDial.d.ts +24 -2
  74. package/dist/i18n/generated/keys.d.ts +1 -1
  75. package/dist/llms-full.txt +104 -11
  76. package/dist/llms.txt +1 -1
  77. package/dist/locales/en/common.json +1 -49
  78. package/dist/locales/en/form.json +1 -20
  79. package/dist/locales/ja/common.json +1 -49
  80. package/dist/locales/ja/form.json +1 -20
  81. package/dist/locales/pt/common.json +1 -49
  82. package/dist/locales/pt/form.json +1 -20
  83. package/dist/robots.txt +5 -0
  84. package/dist/styles.css +2 -2
  85. package/dist/types/generated-tokens.d.ts +1 -1
  86. package/dist/wimui.umd.css +1 -1
  87. package/dist/wimui.umd.js +3 -3
  88. package/package.json +35 -21
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./pie-chart.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=({data:e,height:i=300,width:s=`100%`,title:c,donut:l=!1,animated:u=!1})=>(0,a.jsxs)(`div`,{className:`wim-pie-chart ${r.default.root}`,style:{width:s},children:[c&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:c}),(0,a.jsx)(`div`,{className:r.default.container,style:{height:i},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsxs)(o.PieChart,{children:[(0,a.jsx)(o.Pie,{data:e,cx:`50%`,cy:`50%`,labelLine:!1,innerRadius:l?`60%`:0,outerRadius:`80%`,paddingAngle:0,dataKey:`value`,isAnimationActive:u,children:e.map((e,t)=>(0,a.jsx)(o.Cell,{fill:n.CHART_COLORS[t%n.CHART_COLORS.length],stroke:`var(--wim-color-surface)`,strokeWidth:2},`cell-${t}`))}),(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,a.jsx)(o.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend})]})})})]});exports.PieChart=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./pie-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,height:o=300,width:l=`100%`,title:u,donut:d=!1,animated:f=!1,"aria-label":p})=>{let m=p??u,h=i.pairTable(e,`name`,`value`);return(0,s.jsxs)(`div`,{className:`wim-pie-chart ${a.default.root}`,style:{width:l},role:m?`figure`:void 0,"aria-label":m,children:[u&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:u}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:o},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.PieChart,{...n.CHART_HIDDEN_A11Y_PROPS,children:[(0,s.jsx)(c.Pie,{rootTabIndex:-1,data:e,cx:`50%`,cy:`50%`,labelLine:!1,innerRadius:d?`60%`:0,outerRadius:`80%`,paddingAngle:0,dataKey:`value`,isAnimationActive:f,children:e.map((e,t)=>(0,s.jsx)(c.Cell,{fill:n.CHART_COLORS[t%n.CHART_COLORS.length],stroke:`var(--wim-color-surface)`,strokeWidth:2},`cell-${t}`))}),(0,s.jsx)(c.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend})]})})}),(0,s.jsx)(r.ChartDataTable,{caption:m,columns:h.columns,rows:h.rows})]})};exports.PieChart=l;
@@ -31,5 +31,11 @@ export type PieChartProps = {
31
31
  * @default false
32
32
  */
33
33
  animated?: boolean;
34
+ /**
35
+ * Accessible name for the chart. Defaults to `title` when omitted; pass this
36
+ * when the chart has no visible title, or when the title is not descriptive
37
+ * enough on its own.
38
+ */
39
+ "aria-label"?: string;
34
40
  };
35
- export declare const PieChart: ({ data, height, width, title, donut, animated, }: PieChartProps) => React.JSX.Element;
41
+ export declare const PieChart: ({ data, height, width, title, donut, animated, "aria-label": ariaLabel, }: PieChartProps) => React.JSX.Element;
@@ -1,51 +1,71 @@
1
1
  "use client";
2
2
  import { Title as e } from "../../typography/Title/Title.js";
3
- import { CHART_COLORS as t, CHART_THEME as n } from "../../helpers.js";
4
- import r from "./pie-chart.module.js";
3
+ import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
4
+ import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
5
+ import { pairTable as a } from "../../_internal/chartTableData.js";
6
+ import o from "./pie-chart.module.js";
5
7
  import "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { Cell as o, Legend as s, Pie as c, PieChart as l, ResponsiveContainer as u, Tooltip as d } from "recharts";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import { Cell as l, Legend as u, Pie as d, PieChart as f, ResponsiveContainer as p, Tooltip as m } from "recharts";
8
10
  //#region src/components/charts/PieChart/PieChart.tsx
9
- var f = ({ data: f, height: p = 300, width: m = "100%", title: h, donut: g = !1, animated: _ = !1 }) => /* @__PURE__ */ a("div", {
10
- className: `wim-pie-chart ${r.root}`,
11
- style: { width: m },
12
- children: [h && /* @__PURE__ */ i(e, {
13
- tag: "h3",
14
- size: "md",
15
- style: { marginBottom: "var(--wim-spacing-md)" },
16
- children: h
17
- }), /* @__PURE__ */ i("div", {
18
- className: r.container,
19
- style: { height: p },
20
- children: /* @__PURE__ */ i(u, {
21
- width: "100%",
22
- height: "100%",
23
- children: /* @__PURE__ */ a(l, { children: [
24
- /* @__PURE__ */ i(c, {
25
- data: f,
26
- cx: "50%",
27
- cy: "50%",
28
- labelLine: !1,
29
- innerRadius: g ? "60%" : 0,
30
- outerRadius: "80%",
31
- paddingAngle: 0,
32
- dataKey: "value",
33
- isAnimationActive: _,
34
- children: f.map((e, n) => /* @__PURE__ */ i(o, {
35
- fill: t[n % t.length],
36
- stroke: "var(--wim-color-surface)",
37
- strokeWidth: 2
38
- }, `cell-${n}`))
39
- }),
40
- /* @__PURE__ */ i(d, { contentStyle: n.tooltip.contentStyle }),
41
- /* @__PURE__ */ i(s, {
42
- verticalAlign: "top",
43
- height: 36,
44
- ...n.legend
11
+ var h = ({ data: h, height: g = 300, width: _ = "100%", title: v, donut: y = !1, animated: b = !1, "aria-label": x }) => {
12
+ let S = x ?? v, C = a(h, "name", "value");
13
+ return /* @__PURE__ */ c("div", {
14
+ className: `wim-pie-chart ${o.root}`,
15
+ style: { width: _ },
16
+ role: S ? "figure" : void 0,
17
+ "aria-label": S,
18
+ children: [
19
+ v && /* @__PURE__ */ s(e, {
20
+ tag: "h3",
21
+ size: "md",
22
+ style: { marginBottom: "var(--wim-spacing-md)" },
23
+ children: v
24
+ }),
25
+ /* @__PURE__ */ s("div", {
26
+ className: o.container,
27
+ style: { height: g },
28
+ "aria-hidden": "true",
29
+ children: /* @__PURE__ */ s(p, {
30
+ width: "100%",
31
+ height: "100%",
32
+ children: /* @__PURE__ */ c(f, {
33
+ ...n,
34
+ children: [
35
+ /* @__PURE__ */ s(d, {
36
+ rootTabIndex: -1,
37
+ data: h,
38
+ cx: "50%",
39
+ cy: "50%",
40
+ labelLine: !1,
41
+ innerRadius: y ? "60%" : 0,
42
+ outerRadius: "80%",
43
+ paddingAngle: 0,
44
+ dataKey: "value",
45
+ isAnimationActive: b,
46
+ children: h.map((e, n) => /* @__PURE__ */ s(l, {
47
+ fill: t[n % t.length],
48
+ stroke: "var(--wim-color-surface)",
49
+ strokeWidth: 2
50
+ }, `cell-${n}`))
51
+ }),
52
+ /* @__PURE__ */ s(m, { contentStyle: r.tooltip.contentStyle }),
53
+ /* @__PURE__ */ s(u, {
54
+ verticalAlign: "top",
55
+ height: 36,
56
+ ...r.legend
57
+ })
58
+ ]
59
+ })
45
60
  })
46
- ] })
47
- })
48
- })]
49
- });
61
+ }),
62
+ /* @__PURE__ */ s(i, {
63
+ caption: S,
64
+ columns: C.columns,
65
+ rows: C.rows
66
+ })
67
+ ]
68
+ });
69
+ };
50
70
  //#endregion
51
- export { f as PieChart };
71
+ export { h as PieChart };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./radar-chart.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=({data:e,keys:i,indexKey:s,height:c=300,width:l=`100%`,title:u,animated:d=!1})=>(0,a.jsxs)(`div`,{className:`wim-radar-chart ${r.default.root}`,style:{width:l},children:[u&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:u}),(0,a.jsx)(`div`,{className:r.default.container,style:{height:c},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsxs)(o.RadarChart,{cx:`50%`,cy:`50%`,outerRadius:`80%`,data:e,children:[(0,a.jsx)(o.PolarGrid,{stroke:n.CHART_THEME.grid.stroke}),(0,a.jsx)(o.PolarAngleAxis,{dataKey:s,...n.CHART_THEME.axis}),(0,a.jsx)(o.PolarRadiusAxis,{tick:!1,axisLine:!1}),(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,cursor:n.CHART_THEME.tooltip.cursor}),(0,a.jsx)(o.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),i.map((e,t)=>(0,a.jsx)(o.Radar,{name:e,dataKey:e,stroke:n.CHART_COLORS[t%n.CHART_COLORS.length],fill:n.CHART_COLORS[t%n.CHART_COLORS.length],strokeWidth:2,fillOpacity:.18,isAnimationActive:d},e))]})})})]});exports.RadarChart=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./radar-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,keys:o,indexKey:l,height:u=300,width:d=`100%`,title:f,animated:p=!1,"aria-label":m})=>{let h=m??f,g=i.seriesTable(e,l,o);return(0,s.jsxs)(`div`,{className:`wim-radar-chart ${a.default.root}`,style:{width:d},role:h?`figure`:void 0,"aria-label":h,children:[f&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:f}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:u},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.RadarChart,{...n.CHART_HIDDEN_A11Y_PROPS,cx:`50%`,cy:`50%`,outerRadius:`80%`,data:e,children:[(0,s.jsx)(c.PolarGrid,{stroke:n.CHART_THEME.grid.stroke}),(0,s.jsx)(c.PolarAngleAxis,{dataKey:l,...n.CHART_THEME.axis}),(0,s.jsx)(c.PolarRadiusAxis,{tick:!1,axisLine:!1}),(0,s.jsx)(c.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,cursor:n.CHART_THEME.tooltip.cursor}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),o.map((e,t)=>(0,s.jsx)(c.Radar,{name:e,dataKey:e,stroke:n.CHART_COLORS[t%n.CHART_COLORS.length],fill:n.CHART_COLORS[t%n.CHART_COLORS.length],strokeWidth:2,fillOpacity:.18,isAnimationActive:p},e))]})})}),(0,s.jsx)(r.ChartDataTable,{caption:h,columns:g.columns,rows:g.rows})]})};exports.RadarChart=l;
@@ -32,5 +32,11 @@ export type RadarChartProps = {
32
32
  * @default false
33
33
  */
34
34
  animated?: boolean;
35
+ /**
36
+ * Accessible name for the chart. Defaults to `title` when omitted; pass this
37
+ * when the chart has no visible title, or when the title is not descriptive
38
+ * enough on its own.
39
+ */
40
+ "aria-label"?: string;
35
41
  };
36
- export declare const RadarChart: ({ data, keys, indexKey, height, width, title, animated, }: RadarChartProps) => React.JSX.Element;
42
+ export declare const RadarChart: ({ data, keys, indexKey, height, width, title, animated, "aria-label": ariaLabel, }: RadarChartProps) => React.JSX.Element;
@@ -1,62 +1,79 @@
1
1
  "use client";
2
2
  import { Title as e } from "../../typography/Title/Title.js";
3
- import { CHART_COLORS as t, CHART_THEME as n } from "../../helpers.js";
4
- import r from "./radar-chart.module.js";
3
+ import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
4
+ import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
5
+ import { seriesTable as a } from "../../_internal/chartTableData.js";
6
+ import o from "./radar-chart.module.js";
5
7
  import "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { Legend as o, PolarAngleAxis as s, PolarGrid as c, PolarRadiusAxis as l, Radar as u, RadarChart as d, ResponsiveContainer as f, Tooltip as p } from "recharts";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import { Legend as l, PolarAngleAxis as u, PolarGrid as d, PolarRadiusAxis as f, Radar as p, RadarChart as m, ResponsiveContainer as h, Tooltip as g } from "recharts";
8
10
  //#region src/components/charts/RadarChart/RadarChart.tsx
9
- var m = ({ data: m, keys: h, indexKey: g, height: _ = 300, width: v = "100%", title: y, animated: b = !1 }) => /* @__PURE__ */ a("div", {
10
- className: `wim-radar-chart ${r.root}`,
11
- style: { width: v },
12
- children: [y && /* @__PURE__ */ i(e, {
13
- tag: "h3",
14
- size: "md",
15
- style: { marginBottom: "var(--wim-spacing-md)" },
16
- children: y
17
- }), /* @__PURE__ */ i("div", {
18
- className: r.container,
19
- style: { height: _ },
20
- children: /* @__PURE__ */ i(f, {
21
- width: "100%",
22
- height: "100%",
23
- children: /* @__PURE__ */ a(d, {
24
- cx: "50%",
25
- cy: "50%",
26
- outerRadius: "80%",
27
- data: m,
28
- children: [
29
- /* @__PURE__ */ i(c, { stroke: n.grid.stroke }),
30
- /* @__PURE__ */ i(s, {
31
- dataKey: g,
32
- ...n.axis
33
- }),
34
- /* @__PURE__ */ i(l, {
35
- tick: !1,
36
- axisLine: !1
37
- }),
38
- /* @__PURE__ */ i(p, {
39
- contentStyle: n.tooltip.contentStyle,
40
- cursor: n.tooltip.cursor
41
- }),
42
- /* @__PURE__ */ i(o, {
43
- verticalAlign: "top",
44
- height: 36,
45
- ...n.legend
46
- }),
47
- h.map((e, n) => /* @__PURE__ */ i(u, {
48
- name: e,
49
- dataKey: e,
50
- stroke: t[n % t.length],
51
- fill: t[n % t.length],
52
- strokeWidth: 2,
53
- fillOpacity: .18,
54
- isAnimationActive: b
55
- }, e))
56
- ]
11
+ var _ = ({ data: _, keys: v, indexKey: y, height: b = 300, width: x = "100%", title: S, animated: C = !1, "aria-label": w }) => {
12
+ let T = w ?? S, E = a(_, y, v);
13
+ return /* @__PURE__ */ c("div", {
14
+ className: `wim-radar-chart ${o.root}`,
15
+ style: { width: x },
16
+ role: T ? "figure" : void 0,
17
+ "aria-label": T,
18
+ children: [
19
+ S && /* @__PURE__ */ s(e, {
20
+ tag: "h3",
21
+ size: "md",
22
+ style: { marginBottom: "var(--wim-spacing-md)" },
23
+ children: S
24
+ }),
25
+ /* @__PURE__ */ s("div", {
26
+ className: o.container,
27
+ style: { height: b },
28
+ "aria-hidden": "true",
29
+ children: /* @__PURE__ */ s(h, {
30
+ width: "100%",
31
+ height: "100%",
32
+ children: /* @__PURE__ */ c(m, {
33
+ ...n,
34
+ cx: "50%",
35
+ cy: "50%",
36
+ outerRadius: "80%",
37
+ data: _,
38
+ children: [
39
+ /* @__PURE__ */ s(d, { stroke: r.grid.stroke }),
40
+ /* @__PURE__ */ s(u, {
41
+ dataKey: y,
42
+ ...r.axis
43
+ }),
44
+ /* @__PURE__ */ s(f, {
45
+ tick: !1,
46
+ axisLine: !1
47
+ }),
48
+ /* @__PURE__ */ s(g, {
49
+ contentStyle: r.tooltip.contentStyle,
50
+ cursor: r.tooltip.cursor
51
+ }),
52
+ /* @__PURE__ */ s(l, {
53
+ verticalAlign: "top",
54
+ height: 36,
55
+ ...r.legend
56
+ }),
57
+ v.map((e, n) => /* @__PURE__ */ s(p, {
58
+ name: e,
59
+ dataKey: e,
60
+ stroke: t[n % t.length],
61
+ fill: t[n % t.length],
62
+ strokeWidth: 2,
63
+ fillOpacity: .18,
64
+ isAnimationActive: C
65
+ }, e))
66
+ ]
67
+ })
68
+ })
69
+ }),
70
+ /* @__PURE__ */ s(i, {
71
+ caption: T,
72
+ columns: E.columns,
73
+ rows: E.rows
57
74
  })
58
- })
59
- })]
60
- });
75
+ ]
76
+ });
77
+ };
61
78
  //#endregion
62
- export { m as RadarChart };
79
+ export { _ as RadarChart };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./scatter-chart.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=({data:e,xAxisName:i=`X`,yAxisName:s=`Y`,xDomain:c=[`auto`,`auto`],yDomain:l=[`auto`,`auto`],height:u=300,width:d=`100%`,title:f,animated:p=!1})=>(0,a.jsxs)(`div`,{className:`wim-scatter-chart ${r.default.root}`,style:{width:d},children:[f&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:f}),(0,a.jsx)(`div`,{className:r.default.container,style:{height:u},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsxs)(o.ScatterChart,{margin:{top:20,right:20,bottom:20,left:0},children:[(0,a.jsx)(o.CartesianGrid,{...n.CHART_THEME.grid}),(0,a.jsx)(o.XAxis,{type:`number`,dataKey:`x`,name:i,unit:``,domain:c,...n.CHART_THEME.axis}),(0,a.jsx)(o.YAxis,{type:`number`,dataKey:`y`,name:s,unit:``,domain:l,width:44,...n.CHART_THEME.axis}),(0,a.jsx)(o.ZAxis,{type:`number`,dataKey:`z`,range:[60,400]}),(0,a.jsx)(o.Tooltip,{cursor:n.CHART_THEME.tooltip.cursor,contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,a.jsx)(o.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),(0,a.jsx)(o.Scatter,{name:`Data Points`,data:e,fill:n.CHART_COLORS[0],isAnimationActive:p})]})})})]});exports.ScatterChart=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("../../_internal/ChartDataTable.cjs"),i=require("../../_internal/chartTableData.cjs"),a=require("./scatter-chart.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,xAxisName:o=`X`,yAxisName:l=`Y`,xDomain:u=[`auto`,`auto`],yDomain:d=[`auto`,`auto`],height:f=300,width:p=`100%`,title:m,animated:h=!1,"aria-label":g})=>{let _=g??m,v=i.pointTable(e,o,l,`Z`);return(0,s.jsxs)(`div`,{className:`wim-scatter-chart ${a.default.root}`,style:{width:p},role:_?`figure`:void 0,"aria-label":_,children:[m&&(0,s.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:m}),(0,s.jsx)(`div`,{className:a.default.container,style:{height:f},"aria-hidden":`true`,children:(0,s.jsx)(c.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,s.jsxs)(c.ScatterChart,{...n.CHART_HIDDEN_A11Y_PROPS,margin:{top:20,right:20,bottom:20,left:0},children:[(0,s.jsx)(c.CartesianGrid,{...n.CHART_THEME.grid}),(0,s.jsx)(c.XAxis,{type:`number`,dataKey:`x`,name:o,unit:``,domain:u,...n.CHART_THEME.axis}),(0,s.jsx)(c.YAxis,{type:`number`,dataKey:`y`,name:l,unit:``,domain:d,width:44,...n.CHART_THEME.axis}),(0,s.jsx)(c.ZAxis,{type:`number`,dataKey:`z`,range:[60,400]}),(0,s.jsx)(c.Tooltip,{cursor:n.CHART_THEME.tooltip.cursor,contentStyle:n.CHART_THEME.tooltip.contentStyle}),(0,s.jsx)(c.Legend,{verticalAlign:`top`,height:36,...n.CHART_THEME.legend}),(0,s.jsx)(c.Scatter,{name:`Data Points`,data:e,fill:n.CHART_COLORS[0],isAnimationActive:h})]})})}),(0,s.jsx)(r.ChartDataTable,{caption:_,columns:v.columns,rows:v.rows})]})};exports.ScatterChart=l;
@@ -49,5 +49,11 @@ export type ScatterChartProps = {
49
49
  * @default false
50
50
  */
51
51
  animated?: boolean;
52
+ /**
53
+ * Accessible name for the chart. Defaults to `title` when omitted; pass this
54
+ * when the chart has no visible title, or when the title is not descriptive
55
+ * enough on its own.
56
+ */
57
+ "aria-label"?: string;
52
58
  };
53
- export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
59
+ export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, "aria-label": ariaLabel, }: ScatterChartProps) => React.JSX.Element;
@@ -1,75 +1,92 @@
1
1
  "use client";
2
2
  import { Title as e } from "../../typography/Title/Title.js";
3
- import { CHART_COLORS as t, CHART_THEME as n } from "../../helpers.js";
4
- import r from "./scatter-chart.module.js";
3
+ import { CHART_COLORS as t, CHART_HIDDEN_A11Y_PROPS as n, CHART_THEME as r } from "../../helpers.js";
4
+ import { ChartDataTable as i } from "../../_internal/ChartDataTable.js";
5
+ import { pointTable as a } from "../../_internal/chartTableData.js";
6
+ import o from "./scatter-chart.module.js";
5
7
  import "react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { CartesianGrid as o, Legend as s, ResponsiveContainer as c, Scatter as l, ScatterChart as u, Tooltip as d, XAxis as f, YAxis as p, ZAxis as m } from "recharts";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import { CartesianGrid as l, Legend as u, ResponsiveContainer as d, Scatter as f, ScatterChart as p, Tooltip as m, XAxis as h, YAxis as g, ZAxis as _ } from "recharts";
8
10
  //#region src/components/charts/ScatterChart/ScatterChart.tsx
9
- var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", xDomain: v = ["auto", "auto"], yDomain: y = ["auto", "auto"], height: b = 300, width: x = "100%", title: S, animated: C = !1 }) => /* @__PURE__ */ a("div", {
10
- className: `wim-scatter-chart ${r.root}`,
11
- style: { width: x },
12
- children: [S && /* @__PURE__ */ i(e, {
13
- tag: "h3",
14
- size: "md",
15
- style: { marginBottom: "var(--wim-spacing-md)" },
16
- children: S
17
- }), /* @__PURE__ */ i("div", {
18
- className: r.container,
19
- style: { height: b },
20
- children: /* @__PURE__ */ i(c, {
21
- width: "100%",
22
- height: "100%",
23
- children: /* @__PURE__ */ a(u, {
24
- margin: {
25
- top: 20,
26
- right: 20,
27
- bottom: 20,
28
- left: 0
29
- },
30
- children: [
31
- /* @__PURE__ */ i(o, { ...n.grid }),
32
- /* @__PURE__ */ i(f, {
33
- type: "number",
34
- dataKey: "x",
35
- name: g,
36
- unit: "",
37
- domain: v,
38
- ...n.axis
39
- }),
40
- /* @__PURE__ */ i(p, {
41
- type: "number",
42
- dataKey: "y",
43
- name: _,
44
- unit: "",
45
- domain: y,
46
- width: 44,
47
- ...n.axis
48
- }),
49
- /* @__PURE__ */ i(m, {
50
- type: "number",
51
- dataKey: "z",
52
- range: [60, 400]
53
- }),
54
- /* @__PURE__ */ i(d, {
55
- cursor: n.tooltip.cursor,
56
- contentStyle: n.tooltip.contentStyle
57
- }),
58
- /* @__PURE__ */ i(s, {
59
- verticalAlign: "top",
60
- height: 36,
61
- ...n.legend
62
- }),
63
- /* @__PURE__ */ i(l, {
64
- name: "Data Points",
65
- data: h,
66
- fill: t[0],
67
- isAnimationActive: C
11
+ var v = ({ data: v, xAxisName: y = "X", yAxisName: b = "Y", xDomain: x = ["auto", "auto"], yDomain: S = ["auto", "auto"], height: C = 300, width: w = "100%", title: T, animated: E = !1, "aria-label": D }) => {
12
+ let O = D ?? T, k = a(v, y, b, "Z");
13
+ return /* @__PURE__ */ c("div", {
14
+ className: `wim-scatter-chart ${o.root}`,
15
+ style: { width: w },
16
+ role: O ? "figure" : void 0,
17
+ "aria-label": O,
18
+ children: [
19
+ T && /* @__PURE__ */ s(e, {
20
+ tag: "h3",
21
+ size: "md",
22
+ style: { marginBottom: "var(--wim-spacing-md)" },
23
+ children: T
24
+ }),
25
+ /* @__PURE__ */ s("div", {
26
+ className: o.container,
27
+ style: { height: C },
28
+ "aria-hidden": "true",
29
+ children: /* @__PURE__ */ s(d, {
30
+ width: "100%",
31
+ height: "100%",
32
+ children: /* @__PURE__ */ c(p, {
33
+ ...n,
34
+ margin: {
35
+ top: 20,
36
+ right: 20,
37
+ bottom: 20,
38
+ left: 0
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ s(l, { ...r.grid }),
42
+ /* @__PURE__ */ s(h, {
43
+ type: "number",
44
+ dataKey: "x",
45
+ name: y,
46
+ unit: "",
47
+ domain: x,
48
+ ...r.axis
49
+ }),
50
+ /* @__PURE__ */ s(g, {
51
+ type: "number",
52
+ dataKey: "y",
53
+ name: b,
54
+ unit: "",
55
+ domain: S,
56
+ width: 44,
57
+ ...r.axis
58
+ }),
59
+ /* @__PURE__ */ s(_, {
60
+ type: "number",
61
+ dataKey: "z",
62
+ range: [60, 400]
63
+ }),
64
+ /* @__PURE__ */ s(m, {
65
+ cursor: r.tooltip.cursor,
66
+ contentStyle: r.tooltip.contentStyle
67
+ }),
68
+ /* @__PURE__ */ s(u, {
69
+ verticalAlign: "top",
70
+ height: 36,
71
+ ...r.legend
72
+ }),
73
+ /* @__PURE__ */ s(f, {
74
+ name: "Data Points",
75
+ data: v,
76
+ fill: t[0],
77
+ isAnimationActive: E
78
+ })
79
+ ]
68
80
  })
69
- ]
81
+ })
82
+ }),
83
+ /* @__PURE__ */ s(i, {
84
+ caption: O,
85
+ columns: k.columns,
86
+ rows: k.rows
70
87
  })
71
- })
72
- })]
73
- });
88
+ ]
89
+ });
90
+ };
74
91
  //#endregion
75
- export { h as ScatterChart };
92
+ export { v as ScatterChart };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./sparkline.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("recharts");var o=`var(--wim-color-chart-primary)`,s=({data:e,type:n=`line`,width:s=`100%`,height:c=24,color:l=o,strokeWidth:u=2,showLastDot:d=!1,min:f,max:p,ariaLabel:m,className:h})=>{let g=e.map((e,t)=>({index:t,value:e})),_=[f??`auto`,p??`auto`],v=e.length-1,y=typeof window<`u`&&!!window.__VRT__,b=typeof s==`number`?s:null,x=c??24,S=e=>{let{cx:t,cy:n,index:r}=e;return!d||r!==v||t==null||n==null?(0,i.jsx)(`g`,{},r):(0,i.jsx)(`circle`,{cx:t,cy:n,r:u+1,fill:l},r)},C=y&&b!==null?{width:b,height:x}:{},w={accessibilityLayer:!1,tabIndex:-1},T=()=>n===`bar`?(0,i.jsxs)(a.BarChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Bar,{dataKey:`value`,fill:l,radius:[2,2,0,0],isAnimationActive:!1})]}):n===`area`?(0,i.jsxs)(a.AreaChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Area,{type:`monotone`,dataKey:`value`,stroke:l,strokeWidth:u,fill:l,fillOpacity:.15,dot:d?S:!1,isAnimationActive:!1})]}):(0,i.jsxs)(a.LineChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Line,{type:`monotone`,dataKey:`value`,stroke:l,strokeWidth:u,dot:d?S:!1,isAnimationActive:!1})]});return(0,i.jsx)(`div`,{className:(0,r.default)(`wim-sparkline`,t.default.root,h),style:{width:s,height:c},role:m?`img`:void 0,"aria-label":m,"aria-hidden":m?void 0:!0,children:y&&b!==null?T():(0,i.jsx)(a.ResponsiveContainer,{width:`100%`,height:`100%`,children:T()})})};s.displayName=`Sparkline`,exports.Sparkline=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../helpers.cjs"),n=require("./sparkline.module.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=`var(--wim-color-chart-primary)`,c=({data:e,type:r=`line`,width:c=`100%`,height:l=24,color:u=s,strokeWidth:d=2,showLastDot:f=!1,min:p,max:m,ariaLabel:h,className:g})=>{let _=e.map((e,t)=>({index:t,value:e})),v=[p??`auto`,m??`auto`],y=e.length-1,b=typeof window<`u`&&!!window.__VRT__,x=typeof c==`number`?c:null,S=l??24,C=e=>{let{cx:t,cy:n,index:r}=e;return!f||r!==y||t==null||n==null?(0,a.jsx)(`g`,{},r):(0,a.jsx)(`circle`,{cx:t,cy:n,r:d+1,fill:u},r)},w=b&&x!==null?{width:x,height:S}:{},T=()=>r===`bar`?(0,a.jsxs)(o.BarChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Bar,{dataKey:`value`,fill:u,radius:[2,2,0,0],isAnimationActive:!1})]}):r===`area`?(0,a.jsxs)(o.AreaChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Area,{type:`monotone`,dataKey:`value`,stroke:u,strokeWidth:d,fill:u,fillOpacity:.15,dot:f?C:!1,isAnimationActive:!1})]}):(0,a.jsxs)(o.LineChart,{...w,...t.CHART_HIDDEN_A11Y_PROPS,data:_,margin:{top:2,right:2,bottom:2,left:2},children:[(0,a.jsx)(o.YAxis,{hide:!0,domain:v}),(0,a.jsx)(o.Line,{type:`monotone`,dataKey:`value`,stroke:u,strokeWidth:d,dot:f?C:!1,isAnimationActive:!1})]});return(0,a.jsx)(`div`,{className:(0,i.default)(`wim-sparkline`,n.default.root,g),style:{width:c,height:l},role:h?`img`:void 0,"aria-label":h,"aria-hidden":h?void 0:!0,children:b&&x!==null?T():(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:T()})})};c.displayName=`Sparkline`,exports.Sparkline=c;