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.
- package/dist/components/_internal/ChartDataTable.cjs +2 -0
- package/dist/components/_internal/ChartDataTable.d.ts +43 -0
- package/dist/components/_internal/ChartDataTable.js +20 -0
- package/dist/components/_internal/chart-data-table.module.cjs +2 -0
- package/dist/components/_internal/chart-data-table.module.js +5 -0
- package/dist/components/_internal/chartTableData.cjs +0 -0
- package/dist/components/_internal/chartTableData.d.ts +53 -0
- package/dist/components/_internal/chartTableData.js +0 -0
- package/dist/components/ai/AgentStatus/agent-status.module.cjs +1 -1
- package/dist/components/ai/AgentStatus/agent-status.module.js +3 -3
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.cjs +1 -1
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.cjs +1 -1
- package/dist/components/charts/AreaChart/AreaChart.d.ts +7 -1
- package/dist/components/charts/AreaChart/AreaChart.js +85 -68
- package/dist/components/charts/BarChart/BarChart.cjs +1 -1
- package/dist/components/charts/BarChart/BarChart.d.ts +7 -1
- package/dist/components/charts/BarChart/BarChart.js +90 -73
- package/dist/components/charts/FunnelChart/FunnelChart.cjs +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +7 -1
- package/dist/components/charts/FunnelChart/FunnelChart.js +60 -43
- package/dist/components/charts/GanttChart/gantt-chart.module.cjs +1 -1
- package/dist/components/charts/GanttChart/gantt-chart.module.js +1 -1
- package/dist/components/charts/GaugeChart/GaugeChart.cjs +1 -1
- package/dist/components/charts/GaugeChart/GaugeChart.d.ts +7 -1
- package/dist/components/charts/GaugeChart/GaugeChart.js +6 -4
- package/dist/components/charts/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/charts/Heatmap/Heatmap.d.ts +7 -1
- package/dist/components/charts/Heatmap/Heatmap.js +101 -87
- package/dist/components/charts/LineChart/LineChart.cjs +1 -1
- package/dist/components/charts/LineChart/LineChart.d.ts +7 -1
- package/dist/components/charts/LineChart/LineChart.js +87 -70
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.d.ts +7 -1
- package/dist/components/charts/PieChart/PieChart.js +65 -45
- package/dist/components/charts/RadarChart/RadarChart.cjs +1 -1
- package/dist/components/charts/RadarChart/RadarChart.d.ts +7 -1
- package/dist/components/charts/RadarChart/RadarChart.js +73 -56
- package/dist/components/charts/ScatterChart/ScatterChart.cjs +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.d.ts +7 -1
- package/dist/components/charts/ScatterChart/ScatterChart.js +85 -68
- package/dist/components/charts/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/charts/Sparkline/Sparkline.js +52 -54
- package/dist/components/charts/Treemap/Treemap.cjs +1 -1
- package/dist/components/charts/Treemap/Treemap.d.ts +7 -1
- package/dist/components/charts/Treemap/Treemap.js +75 -61
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.js +1 -1
- package/dist/components/data-display/Kanban/kanban.module.cjs +1 -1
- package/dist/components/data-display/Kanban/kanban.module.js +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
- package/dist/components/feedback/Alert/alert.module.cjs +1 -1
- package/dist/components/feedback/Alert/alert.module.js +5 -5
- package/dist/components/feedback/ProgressRing/ProgressRing.d.ts +6 -1
- package/dist/components/feedback/Toast/toast.module.cjs +1 -1
- package/dist/components/feedback/Toast/toast.module.js +11 -11
- package/dist/components/form/FieldTemplate/field-template.module.cjs +1 -1
- package/dist/components/form/FieldTemplate/field-template.module.js +1 -1
- package/dist/components/helpers.cjs +1 -1
- package/dist/components/helpers.d.ts +18 -0
- package/dist/components/helpers.js +4 -1
- package/dist/components/layout/Footer/Footer.cjs +1 -1
- package/dist/components/layout/Footer/Footer.d.ts +15 -0
- package/dist/components/layout/Footer/Footer.js +15 -12
- package/dist/components/media/Gallery/gallery.module.cjs +1 -1
- package/dist/components/media/Gallery/gallery.module.js +11 -11
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.cjs +1 -1
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.d.ts +22 -0
- package/dist/components/navigation/KeyboardShortcuts/KeyboardShortcuts.js +31 -28
- package/dist/components/navigation/SpeedDial/SpeedDial.d.ts +24 -2
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/llms-full.txt +104 -11
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +1 -49
- package/dist/locales/en/form.json +1 -20
- package/dist/locales/ja/common.json +1 -49
- package/dist/locales/ja/form.json +1 -20
- package/dist/locales/pt/common.json +1 -49
- package/dist/locales/pt/form.json +1 -20
- package/dist/robots.txt +5 -0
- package/dist/styles.css +2 -2
- package/dist/types/generated-tokens.d.ts +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +3 -3
- package/package.json +35 -21
|
@@ -32,5 +32,11 @@ export type FunnelChartProps = {
|
|
|
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 FunnelChart: ({ data, dataKey, nameKey, height, width, title, animated, }: FunnelChartProps) => React.JSX.Element;
|
|
42
|
+
export declare const FunnelChart: ({ data, dataKey, nameKey, height, width, title, animated, "aria-label": ariaLabel, }: FunnelChartProps) => React.JSX.Element;
|
|
@@ -1,49 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { CHART_HIDDEN_A11Y_PROPS as t, CHART_THEME as n } from "../../helpers.js";
|
|
4
|
+
import { ChartDataTable as r } from "../../_internal/ChartDataTable.js";
|
|
5
|
+
import { pairTable as i } from "../../_internal/chartTableData.js";
|
|
6
|
+
import a from "./funnel-chart.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Cell as
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import { Cell as c, Funnel as l, FunnelChart as u, LabelList as d, ResponsiveContainer as f, Tooltip as p } from "recharts";
|
|
8
10
|
//#region src/components/charts/FunnelChart/FunnelChart.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
11
|
+
var m = ({ data: m, dataKey: h, nameKey: g, height: _ = 300, width: v = "100%", title: y, animated: b = !1, "aria-label": x }) => {
|
|
12
|
+
let S = x ?? y, C = i(m, g, h);
|
|
13
|
+
return /* @__PURE__ */ s("div", {
|
|
14
|
+
className: `wim-funnel-chart ${a.root}`,
|
|
15
|
+
style: { width: v },
|
|
16
|
+
role: S ? "figure" : void 0,
|
|
17
|
+
"aria-label": S,
|
|
18
|
+
children: [
|
|
19
|
+
y && /* @__PURE__ */ o(e, {
|
|
20
|
+
tag: "h3",
|
|
21
|
+
size: "md",
|
|
22
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
23
|
+
children: y
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ o("div", {
|
|
26
|
+
className: a.container,
|
|
27
|
+
style: { height: _ },
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: /* @__PURE__ */ o(f, {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
children: /* @__PURE__ */ s(u, {
|
|
33
|
+
...t,
|
|
34
|
+
margin: {
|
|
35
|
+
top: 8,
|
|
36
|
+
right: 88,
|
|
37
|
+
bottom: 8,
|
|
38
|
+
left: 88
|
|
39
|
+
},
|
|
40
|
+
children: [/* @__PURE__ */ o(p, {
|
|
41
|
+
contentStyle: n.tooltip.contentStyle,
|
|
42
|
+
cursor: n.tooltip.cursor
|
|
43
|
+
}), /* @__PURE__ */ s(l, {
|
|
44
|
+
dataKey: h,
|
|
45
|
+
data: m,
|
|
46
|
+
isAnimationActive: b,
|
|
47
|
+
children: [/* @__PURE__ */ o(d, {
|
|
48
|
+
position: "right",
|
|
49
|
+
fill: "var(--wim-color-text-secondary)",
|
|
50
|
+
dataKey: g,
|
|
51
|
+
stroke: "none"
|
|
52
|
+
}), m.map((e, t) => /* @__PURE__ */ o(c, { fill: `color-mix(in oklch, var(--wim-color-chart-primary) ${100 - Math.round(t / Math.max(m.length - 1, 1) * 55)}%, var(--wim-color-surface))` }, `cell-${t}`))]
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ o(r, {
|
|
58
|
+
caption: S,
|
|
59
|
+
columns: C.columns,
|
|
60
|
+
rows: C.rows
|
|
44
61
|
})
|
|
45
|
-
|
|
46
|
-
})
|
|
47
|
-
}
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
48
65
|
//#endregion
|
|
49
|
-
export {
|
|
66
|
+
export { m as FunnelChart };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1pxp3_4`,t=`_layout_1pxp3_23`,n=`_labelPanel_1pxp3_28`,r=`_labelRow_1pxp3_40`,i=`_labelText_1pxp3_49`,a=`_timelineScroll_1pxp3_55`,o=`_header_1pxp3_74`,s=`_headerCell_1pxp3_81`,c=`_body_1pxp3_103`,l=`_row_1pxp3_110`,u=`_bar_1pxp3_116`,d=`_clickable_1pxp3_130`,f=`_progress_1pxp3_139`,p={root:e,layout:t,labelPanel:n,labelRow:r,labelText:i,timelineScroll:a,header:o,headerCell:s,body:c,row:l,bar:u,clickable:d,progress:f};exports.bar=u,exports.body=c,exports.clickable=d,exports.default=p,exports.header=o,exports.headerCell=s,exports.labelPanel=n,exports.labelRow=r,exports.labelText=i,exports.layout=t,exports.progress=f,exports.root=e,exports.row=l,exports.timelineScroll=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/charts/GanttChart/gantt-chart.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1pxp3_4", t = "_layout_1pxp3_23", n = "_labelPanel_1pxp3_28", r = "_labelRow_1pxp3_40", i = "_labelText_1pxp3_49", a = "_timelineScroll_1pxp3_55", o = "_header_1pxp3_74", s = "_headerCell_1pxp3_81", c = "_body_1pxp3_103", l = "_row_1pxp3_110", u = "_bar_1pxp3_116", d = "_clickable_1pxp3_130", f = "_progress_1pxp3_139", p = {
|
|
4
4
|
root: e,
|
|
5
5
|
layout: t,
|
|
6
6
|
labelPanel: n,
|
|
@@ -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("./gauge-chart.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime"),s=require("recharts");var c=({value:e,min:i=0,max:c=100,height:l=200,width:u=`100%`,title:d,label:f,color:p,animated:m=!1})=>{let h=Math.max(i,Math.min(c,e)),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./gauge-chart.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime"),s=require("recharts");var c=({value:e,min:i=0,max:c=100,height:l=200,width:u=`100%`,title:d,label:f,color:p,animated:m=!1,"aria-label":h})=>{let g=h??d,_=Math.max(i,Math.min(c,e)),v=[{value:_-i},{value:c-_}],y=p||n.CHART_COLORS[0];return(0,o.jsxs)(`div`,{className:(0,a.default)(`wim-gauge-chart`,r.default.root),style:{width:u},role:g?`figure`:void 0,"aria-label":g,children:[d&&(0,o.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:d}),(0,o.jsxs)(`div`,{className:r.default.container,style:{height:l},children:[(0,o.jsx)(s.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,o.jsx)(s.PieChart,{children:(0,o.jsxs)(s.Pie,{data:v,cx:`50%`,cy:`80%`,startAngle:180,endAngle:0,innerRadius:`60%`,outerRadius:`80%`,paddingAngle:0,dataKey:`value`,stroke:`none`,isAnimationActive:m,children:[(0,o.jsx)(s.Cell,{fill:y}),(0,o.jsx)(s.Cell,{fill:`var(--wim-color-surface-variant)`})]})})}),(0,o.jsx)(`div`,{className:r.default.gaugeLabel,children:f||e})]})]})};exports.GaugeChart=c;
|
|
@@ -41,5 +41,11 @@ export type GaugeChartProps = {
|
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
43
43
|
animated?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
46
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
47
|
+
* enough on its own.
|
|
48
|
+
*/
|
|
49
|
+
"aria-label"?: string;
|
|
44
50
|
};
|
|
45
|
-
export declare const GaugeChart: ({ value, min, max, height, width, title, label, color, animated, }: GaugeChartProps) => React.JSX.Element;
|
|
51
|
+
export declare const GaugeChart: ({ value, min, max, height, width, title, label, color, animated, "aria-label": ariaLabel, }: GaugeChartProps) => React.JSX.Element;
|
|
@@ -7,11 +7,13 @@ import r from "classnames";
|
|
|
7
7
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
8
|
import { Cell as o, Pie as s, PieChart as c, ResponsiveContainer as l } from "recharts";
|
|
9
9
|
//#region src/components/charts/GaugeChart/GaugeChart.tsx
|
|
10
|
-
var u = ({ value: u, min: d = 0, max: f = 100, height: p = 200, width: m = "100%", title: h, label: g, color: _, animated: v = !1 }) => {
|
|
11
|
-
let y = Math.max(d, Math.min(f, u)),
|
|
10
|
+
var u = ({ value: u, min: d = 0, max: f = 100, height: p = 200, width: m = "100%", title: h, label: g, color: _, animated: v = !1, "aria-label": y }) => {
|
|
11
|
+
let b = y ?? h, x = Math.max(d, Math.min(f, u)), S = [{ value: x - d }, { value: f - x }], C = _ || t[0];
|
|
12
12
|
return /* @__PURE__ */ a("div", {
|
|
13
13
|
className: r("wim-gauge-chart", n.root),
|
|
14
14
|
style: { width: m },
|
|
15
|
+
role: b ? "figure" : void 0,
|
|
16
|
+
"aria-label": b,
|
|
15
17
|
children: [h && /* @__PURE__ */ i(e, {
|
|
16
18
|
tag: "h3",
|
|
17
19
|
size: "md",
|
|
@@ -24,7 +26,7 @@ var u = ({ value: u, min: d = 0, max: f = 100, height: p = 200, width: m = "100%
|
|
|
24
26
|
width: "100%",
|
|
25
27
|
height: "100%",
|
|
26
28
|
children: /* @__PURE__ */ i(c, { children: /* @__PURE__ */ a(s, {
|
|
27
|
-
data:
|
|
29
|
+
data: S,
|
|
28
30
|
cx: "50%",
|
|
29
31
|
cy: "80%",
|
|
30
32
|
startAngle: 180,
|
|
@@ -35,7 +37,7 @@ var u = ({ value: u, min: d = 0, max: f = 100, height: p = 200, width: m = "100%
|
|
|
35
37
|
dataKey: "value",
|
|
36
38
|
stroke: "none",
|
|
37
39
|
isAnimationActive: v,
|
|
38
|
-
children: [/* @__PURE__ */ i(o, { fill:
|
|
40
|
+
children: [/* @__PURE__ */ i(o, { fill: C }), /* @__PURE__ */ i(o, { fill: "var(--wim-color-surface-variant)" })]
|
|
39
41
|
}) })
|
|
40
42
|
}), /* @__PURE__ */ i("div", {
|
|
41
43
|
className: n.gaugeLabel,
|
|
@@ -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("./heatmap.module.cjs");let
|
|
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("./heatmap.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("recharts");var l=({data:e,xAxisKey:o,yAxisKey:l,height:u=300,width:d=`100%`,title:f,colorRange:p=[`var(--wim-color-surface-variant)`,`var(--wim-color-chart-primary)`],animated:m=!1,"aria-label":h})=>{let g=h??f,_=i.matrixTable(e,o,l),v=e.map(e=>({x:o.indexOf(e.x),y:l.indexOf(e.y),value:e.value,labelX:e.x,labelY:e.y})),y=e.map(e=>e.value),b=Math.max(...y),x=Math.min(...y),S=e=>{let t=b-x,n=t===0?1:(e-x)/t,r=Math.round(n*100);return`color-mix(in oklch, ${p[1]} ${r}%, ${p[0]})`};return(0,s.jsxs)(`div`,{className:`wim-heatmap ${a.default.root}`,style:{width:d},role:g?`figure`:void 0,"aria-label":g,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.ScatterChart,{...n.CHART_HIDDEN_A11Y_PROPS,margin:{top:20,right:4,left:8,bottom:20},children:[(0,s.jsx)(c.XAxis,{type:`number`,dataKey:`x`,ticks:Array.from({length:o.length},(e,t)=>t),tickFormatter:e=>o[e],padding:{left:20,right:20},...n.CHART_THEME.axis}),(0,s.jsx)(c.YAxis,{type:`number`,dataKey:`y`,ticks:Array.from({length:l.length},(e,t)=>t),tickFormatter:e=>l[e],...n.CHART_THEME.axis}),(0,s.jsx)(c.ZAxis,{type:`number`,dataKey:`value`,range:[400,400]}),(0,s.jsx)(c.Tooltip,{cursor:n.CHART_THEME.tooltip.cursor,content:({active:e,payload:t})=>{if(e&&t&&t.length){let e=t[0].payload;return(0,s.jsxs)(`div`,{style:{...n.CHART_THEME.tooltip.contentStyle,padding:`8px`},children:[(0,s.jsxs)(`div`,{children:[e.labelX,` / `,e.labelY]}),(0,s.jsxs)(`div`,{style:{fontWeight:`bold`},children:[`Value: `,e.value]})]})}return null}}),(0,s.jsx)(c.Scatter,{data:v,shape:`square`,isAnimationActive:m,children:v.map((e,t)=>(0,s.jsx)(c.Cell,{fill:S(e.value)},`cell-${t}`))})]})})}),(0,s.jsx)(r.ChartDataTable,{caption:g,columns:_.columns,rows:_.rows})]})};exports.Heatmap=l;
|
|
@@ -40,5 +40,11 @@ export type HeatmapProps = {
|
|
|
40
40
|
* @default false
|
|
41
41
|
*/
|
|
42
42
|
animated?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
45
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
46
|
+
* enough on its own.
|
|
47
|
+
*/
|
|
48
|
+
"aria-label"?: string;
|
|
43
49
|
};
|
|
44
|
-
export declare const Heatmap: ({ data, xAxisKey, yAxisKey, height, width, title, colorRange, animated, }: HeatmapProps) => React.JSX.Element;
|
|
50
|
+
export declare const Heatmap: ({ data, xAxisKey, yAxisKey, height, width, title, colorRange, animated, "aria-label": ariaLabel, }: HeatmapProps) => React.JSX.Element;
|
|
@@ -1,101 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { CHART_HIDDEN_A11Y_PROPS as t, CHART_THEME as n } from "../../helpers.js";
|
|
4
|
+
import { ChartDataTable as r } from "../../_internal/ChartDataTable.js";
|
|
5
|
+
import { matrixTable as i } from "../../_internal/chartTableData.js";
|
|
6
|
+
import a from "./heatmap.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Cell as
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import { Cell as c, ResponsiveContainer as l, Scatter as u, ScatterChart as d, Tooltip as f, XAxis as p, YAxis as m, ZAxis as h } from "recharts";
|
|
8
10
|
//#region src/components/charts/Heatmap/Heatmap.tsx
|
|
9
|
-
var
|
|
10
|
-
let x =
|
|
11
|
-
x:
|
|
12
|
-
y:
|
|
11
|
+
var g = ({ data: g, xAxisKey: _, yAxisKey: v, height: y = 300, width: b = "100%", title: x, colorRange: S = ["var(--wim-color-surface-variant)", "var(--wim-color-chart-primary)"], animated: C = !1, "aria-label": w }) => {
|
|
12
|
+
let T = w ?? x, E = i(g, _, v), D = g.map((e) => ({
|
|
13
|
+
x: _.indexOf(e.x),
|
|
14
|
+
y: v.indexOf(e.y),
|
|
13
15
|
value: e.value,
|
|
14
16
|
labelX: e.x,
|
|
15
17
|
labelY: e.y
|
|
16
|
-
})),
|
|
17
|
-
let t =
|
|
18
|
-
return `color-mix(in oklch, ${
|
|
18
|
+
})), O = g.map((e) => e.value), k = Math.max(...O), A = Math.min(...O), j = (e) => {
|
|
19
|
+
let t = k - A, n = t === 0 ? 1 : (e - A) / t, r = Math.round(n * 100);
|
|
20
|
+
return `color-mix(in oklch, ${S[1]} ${r}%, ${S[0]})`;
|
|
19
21
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
className: `wim-heatmap ${
|
|
22
|
-
style: { width:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children: [
|
|
82
|
-
|
|
83
|
-
|
|
22
|
+
return /* @__PURE__ */ s("div", {
|
|
23
|
+
className: `wim-heatmap ${a.root}`,
|
|
24
|
+
style: { width: b },
|
|
25
|
+
role: T ? "figure" : void 0,
|
|
26
|
+
"aria-label": T,
|
|
27
|
+
children: [
|
|
28
|
+
x && /* @__PURE__ */ o(e, {
|
|
29
|
+
tag: "h3",
|
|
30
|
+
size: "md",
|
|
31
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
32
|
+
children: x
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ o("div", {
|
|
35
|
+
className: a.container,
|
|
36
|
+
style: { height: y },
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
children: /* @__PURE__ */ o(l, {
|
|
39
|
+
width: "100%",
|
|
40
|
+
height: "100%",
|
|
41
|
+
children: /* @__PURE__ */ s(d, {
|
|
42
|
+
...t,
|
|
43
|
+
margin: {
|
|
44
|
+
top: 20,
|
|
45
|
+
right: 4,
|
|
46
|
+
left: 8,
|
|
47
|
+
bottom: 20
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ o(p, {
|
|
51
|
+
type: "number",
|
|
52
|
+
dataKey: "x",
|
|
53
|
+
ticks: Array.from({ length: _.length }, (e, t) => t),
|
|
54
|
+
tickFormatter: (e) => _[e],
|
|
55
|
+
padding: {
|
|
56
|
+
left: 20,
|
|
57
|
+
right: 20
|
|
58
|
+
},
|
|
59
|
+
...n.axis
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ o(m, {
|
|
62
|
+
type: "number",
|
|
63
|
+
dataKey: "y",
|
|
64
|
+
ticks: Array.from({ length: v.length }, (e, t) => t),
|
|
65
|
+
tickFormatter: (e) => v[e],
|
|
66
|
+
...n.axis
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ o(h, {
|
|
69
|
+
type: "number",
|
|
70
|
+
dataKey: "value",
|
|
71
|
+
range: [400, 400]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ o(f, {
|
|
74
|
+
cursor: n.tooltip.cursor,
|
|
75
|
+
content: ({ active: e, payload: t }) => {
|
|
76
|
+
if (e && t && t.length) {
|
|
77
|
+
let e = t[0].payload;
|
|
78
|
+
return /* @__PURE__ */ s("div", {
|
|
79
|
+
style: {
|
|
80
|
+
...n.tooltip.contentStyle,
|
|
81
|
+
padding: "8px"
|
|
82
|
+
},
|
|
83
|
+
children: [/* @__PURE__ */ s("div", { children: [
|
|
84
|
+
e.labelX,
|
|
85
|
+
" / ",
|
|
86
|
+
e.labelY
|
|
87
|
+
] }), /* @__PURE__ */ s("div", {
|
|
88
|
+
style: { fontWeight: "bold" },
|
|
89
|
+
children: ["Value: ", e.value]
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
84
94
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ o(u, {
|
|
97
|
+
data: D,
|
|
98
|
+
shape: "square",
|
|
99
|
+
isAnimationActive: C,
|
|
100
|
+
children: D.map((e, t) => /* @__PURE__ */ o(c, { fill: j(e.value) }, `cell-${t}`))
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
})
|
|
95
104
|
})
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ o(r, {
|
|
107
|
+
caption: T,
|
|
108
|
+
columns: E.columns,
|
|
109
|
+
rows: E.rows
|
|
96
110
|
})
|
|
97
|
-
|
|
111
|
+
]
|
|
98
112
|
});
|
|
99
113
|
};
|
|
100
114
|
//#endregion
|
|
101
|
-
export {
|
|
115
|
+
export { g as Heatmap };
|
|
@@ -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("./line-chart.module.cjs");let
|
|
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("./line-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,xAxisKey:l,height:u=300,width:d=`100%`,title:f,smooth:p=!1,yDomain:m=[0,`auto`],animated:h=!1,"aria-label":g})=>{let _=g??f,v=i.seriesTable(e,l,o);return(0,s.jsxs)(`div`,{className:`wim-line-chart ${a.default.root}`,style:{width:d},role:_?`figure`:void 0,"aria-label":_,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.LineChart,{...n.CHART_HIDDEN_A11Y_PROPS,data:e,margin:{top:5,right:30,left:0,bottom:5},children:[(0,s.jsx)(c.CartesianGrid,{...n.CHART_THEME.grid,vertical:!1}),(0,s.jsx)(c.XAxis,{dataKey:l,...n.CHART_THEME.axis,tickLine:!1,axisLine:!1}),(0,s.jsx)(c.YAxis,{width:44,domain:m,...n.CHART_THEME.axis,tickLine:!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.Line,{type:p?`monotone`:`linear`,dataKey:e,stroke:n.CHART_COLORS[t%n.CHART_COLORS.length],strokeWidth:2,dot:{r:4,strokeWidth:2,fill:`var(--wim-color-primary-fill)`},activeDot:{r:6},isAnimationActive:h},e))]})})}),(0,s.jsx)(r.ChartDataTable,{caption:_,columns:v.columns,rows:v.rows})]})};exports.LineChart=l;
|
|
@@ -44,5 +44,11 @@ export type LineChartProps = {
|
|
|
44
44
|
* @default false
|
|
45
45
|
*/
|
|
46
46
|
animated?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Accessible name for the chart. Defaults to `title` when omitted; pass this
|
|
49
|
+
* when the chart has no visible title, or when the title is not descriptive
|
|
50
|
+
* enough on its own.
|
|
51
|
+
*/
|
|
52
|
+
"aria-label"?: string;
|
|
47
53
|
};
|
|
48
|
-
export declare const LineChart: ({ data, keys, xAxisKey, height, width, title, smooth, yDomain, animated, }: LineChartProps) => React.JSX.Element;
|
|
54
|
+
export declare const LineChart: ({ data, keys, xAxisKey, height, width, title, smooth, yDomain, animated, "aria-label": ariaLabel, }: LineChartProps) => React.JSX.Element;
|
|
@@ -1,77 +1,94 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import { CHART_COLORS as t,
|
|
4
|
-
import
|
|
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 "./line-chart.module.js";
|
|
5
7
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { CartesianGrid as
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { CartesianGrid as l, Legend as u, Line as d, LineChart as f, ResponsiveContainer as p, Tooltip as m, XAxis as h, YAxis as g } from "recharts";
|
|
8
10
|
//#region src/components/charts/LineChart/LineChart.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...n.axis,
|
|
39
|
-
tickLine: !1,
|
|
40
|
-
axisLine: !1
|
|
41
|
-
}),
|
|
42
|
-
/* @__PURE__ */ i(p, {
|
|
43
|
-
width: 44,
|
|
44
|
-
domain: x,
|
|
45
|
-
...n.axis,
|
|
46
|
-
tickLine: !1,
|
|
47
|
-
axisLine: !1
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ i(d, {
|
|
50
|
-
contentStyle: n.tooltip.contentStyle,
|
|
51
|
-
cursor: n.tooltip.cursor
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ i(s, {
|
|
54
|
-
verticalAlign: "top",
|
|
55
|
-
height: 36,
|
|
56
|
-
...n.legend
|
|
57
|
-
}),
|
|
58
|
-
h.map((e, n) => /* @__PURE__ */ i(c, {
|
|
59
|
-
type: b ? "monotone" : "linear",
|
|
60
|
-
dataKey: e,
|
|
61
|
-
stroke: t[n % t.length],
|
|
62
|
-
strokeWidth: 2,
|
|
63
|
-
dot: {
|
|
64
|
-
r: 4,
|
|
65
|
-
strokeWidth: 2,
|
|
66
|
-
fill: "var(--wim-color-primary-fill)"
|
|
11
|
+
var _ = ({ data: _, keys: v, xAxisKey: y, height: b = 300, width: x = "100%", title: S, smooth: C = !1, yDomain: w = [0, "auto"], animated: T = !1, "aria-label": E }) => {
|
|
12
|
+
let D = E ?? S, O = a(_, y, v);
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: `wim-line-chart ${o.root}`,
|
|
15
|
+
style: { width: x },
|
|
16
|
+
role: D ? "figure" : void 0,
|
|
17
|
+
"aria-label": D,
|
|
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(p, {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
children: /* @__PURE__ */ c(f, {
|
|
33
|
+
...n,
|
|
34
|
+
data: _,
|
|
35
|
+
margin: {
|
|
36
|
+
top: 5,
|
|
37
|
+
right: 30,
|
|
38
|
+
left: 0,
|
|
39
|
+
bottom: 5
|
|
67
40
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ s(l, {
|
|
43
|
+
...r.grid,
|
|
44
|
+
vertical: !1
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ s(h, {
|
|
47
|
+
dataKey: y,
|
|
48
|
+
...r.axis,
|
|
49
|
+
tickLine: !1,
|
|
50
|
+
axisLine: !1
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ s(g, {
|
|
53
|
+
width: 44,
|
|
54
|
+
domain: w,
|
|
55
|
+
...r.axis,
|
|
56
|
+
tickLine: !1,
|
|
57
|
+
axisLine: !1
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ s(m, {
|
|
60
|
+
contentStyle: r.tooltip.contentStyle,
|
|
61
|
+
cursor: r.tooltip.cursor
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ s(u, {
|
|
64
|
+
verticalAlign: "top",
|
|
65
|
+
height: 36,
|
|
66
|
+
...r.legend
|
|
67
|
+
}),
|
|
68
|
+
v.map((e, n) => /* @__PURE__ */ s(d, {
|
|
69
|
+
type: C ? "monotone" : "linear",
|
|
70
|
+
dataKey: e,
|
|
71
|
+
stroke: t[n % t.length],
|
|
72
|
+
strokeWidth: 2,
|
|
73
|
+
dot: {
|
|
74
|
+
r: 4,
|
|
75
|
+
strokeWidth: 2,
|
|
76
|
+
fill: "var(--wim-color-primary-fill)"
|
|
77
|
+
},
|
|
78
|
+
activeDot: { r: 6 },
|
|
79
|
+
isAnimationActive: T
|
|
80
|
+
}, e))
|
|
81
|
+
]
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ s(i, {
|
|
86
|
+
caption: D,
|
|
87
|
+
columns: O.columns,
|
|
88
|
+
rows: O.rows
|
|
72
89
|
})
|
|
73
|
-
|
|
74
|
-
})
|
|
75
|
-
}
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
76
93
|
//#endregion
|
|
77
|
-
export {
|
|
94
|
+
export { _ as LineChart };
|