wimui 0.20.0 → 0.22.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/charts/AreaChart/AreaChart.cjs +1 -1
- package/dist/components/charts/AreaChart/AreaChart.d.ts +9 -2
- package/dist/components/charts/AreaChart/AreaChart.js +13 -29
- package/dist/components/charts/AreaChart/area-chart.module.cjs +1 -1
- package/dist/components/charts/AreaChart/area-chart.module.js +1 -1
- package/dist/components/charts/BarChart/BarChart.cjs +1 -1
- package/dist/components/charts/BarChart/BarChart.d.ts +9 -2
- package/dist/components/charts/BarChart/BarChart.js +12 -7
- package/dist/components/charts/BarChart/bar-chart.module.cjs +1 -1
- package/dist/components/charts/BarChart/bar-chart.module.js +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.cjs +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.js +36 -28
- package/dist/components/charts/FunnelChart/funnel-chart.module.cjs +1 -1
- package/dist/components/charts/FunnelChart/funnel-chart.module.js +1 -1
- package/dist/components/charts/GaugeChart/gauge-chart.module.cjs +1 -1
- package/dist/components/charts/GaugeChart/gauge-chart.module.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +11 -4
- package/dist/components/charts/Heatmap/heatmap.module.cjs +1 -1
- package/dist/components/charts/Heatmap/heatmap.module.js +1 -1
- package/dist/components/charts/LineChart/LineChart.cjs +1 -1
- package/dist/components/charts/LineChart/LineChart.d.ts +9 -2
- package/dist/components/charts/LineChart/LineChart.js +5 -3
- package/dist/components/charts/LineChart/line-chart.module.cjs +1 -1
- package/dist/components/charts/LineChart/line-chart.module.js +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.js +3 -2
- package/dist/components/charts/PieChart/pie-chart.module.cjs +1 -1
- package/dist/components/charts/PieChart/pie-chart.module.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.cjs +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +6 -2
- package/dist/components/charts/RadarChart/radar-chart.module.cjs +1 -1
- package/dist/components/charts/RadarChart/radar-chart.module.js +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.cjs +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.d.ts +12 -1
- package/dist/components/charts/ScatterChart/ScatterChart.js +10 -7
- package/dist/components/charts/ScatterChart/scatter-chart.module.cjs +1 -1
- package/dist/components/charts/ScatterChart/scatter-chart.module.js +1 -1
- package/dist/components/charts/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/charts/Sparkline/Sparkline.js +62 -80
- package/dist/components/charts/Sparkline/sparkline.module.cjs +1 -1
- package/dist/components/charts/Sparkline/sparkline.module.js +1 -1
- package/dist/components/charts/Treemap/Treemap.cjs +1 -1
- package/dist/components/charts/Treemap/Treemap.js +107 -59
- package/dist/components/form/Rating/rating.module.cjs +1 -1
- package/dist/components/form/Rating/rating.module.js +1 -1
- package/dist/components/form/SignaturePad/signature-pad.module.cjs +1 -1
- package/dist/components/form/SignaturePad/signature-pad.module.js +6 -6
- package/dist/components/helpers.cjs +1 -1
- package/dist/components/helpers.d.ts +9 -0
- package/dist/components/helpers.js +2 -11
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.d.ts +8 -0
- package/dist/components/layout/Dashboard/Dashboard.js +47 -42
- package/dist/components/layout/Dashboard/dashboard.module.cjs +1 -1
- package/dist/components/layout/Dashboard/dashboard.module.js +13 -13
- package/dist/llms-full.txt +22 -3
- package/dist/llms.txt +1 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +1 -1
- package/package.json +8 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ChartAxisDomain } from '../../helpers';
|
|
2
3
|
export type ScatterChartProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Points to plot. `z` optionally controls the point size.
|
|
@@ -19,6 +20,16 @@ export type ScatterChartProps = {
|
|
|
19
20
|
* @default "Y"
|
|
20
21
|
*/
|
|
21
22
|
yAxisName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Range of the X axis.
|
|
25
|
+
* @default ["auto", "auto"]
|
|
26
|
+
*/
|
|
27
|
+
xDomain?: ChartAxisDomain;
|
|
28
|
+
/**
|
|
29
|
+
* Range of the Y axis.
|
|
30
|
+
* @default ["auto", "auto"]
|
|
31
|
+
*/
|
|
32
|
+
yDomain?: ChartAxisDomain;
|
|
22
33
|
/**
|
|
23
34
|
* The height of the chart in pixels.
|
|
24
35
|
* @default 300
|
|
@@ -39,4 +50,4 @@ export type ScatterChartProps = {
|
|
|
39
50
|
*/
|
|
40
51
|
animated?: boolean;
|
|
41
52
|
};
|
|
42
|
-
export declare const ScatterChart: ({ data, xAxisName, yAxisName, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
|
|
53
|
+
export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
|
|
@@ -6,17 +6,17 @@ import "react";
|
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
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
8
|
//#region src/components/charts/ScatterChart/ScatterChart.tsx
|
|
9
|
-
var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y",
|
|
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
10
|
className: `wim-scatter-chart ${r.root}`,
|
|
11
|
-
style: { width:
|
|
12
|
-
children: [
|
|
11
|
+
style: { width: x },
|
|
12
|
+
children: [S && /* @__PURE__ */ i(e, {
|
|
13
13
|
tag: "h3",
|
|
14
14
|
size: "md",
|
|
15
15
|
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
16
|
-
children:
|
|
16
|
+
children: S
|
|
17
17
|
}), /* @__PURE__ */ i("div", {
|
|
18
18
|
className: r.container,
|
|
19
|
-
style: { height:
|
|
19
|
+
style: { height: b },
|
|
20
20
|
children: /* @__PURE__ */ i(c, {
|
|
21
21
|
width: "100%",
|
|
22
22
|
height: "100%",
|
|
@@ -25,7 +25,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
25
25
|
top: 20,
|
|
26
26
|
right: 20,
|
|
27
27
|
bottom: 20,
|
|
28
|
-
left:
|
|
28
|
+
left: 0
|
|
29
29
|
},
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ i(o, { ...n.grid }),
|
|
@@ -34,6 +34,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
34
34
|
dataKey: "x",
|
|
35
35
|
name: g,
|
|
36
36
|
unit: "",
|
|
37
|
+
domain: v,
|
|
37
38
|
...n.axis
|
|
38
39
|
}),
|
|
39
40
|
/* @__PURE__ */ i(p, {
|
|
@@ -41,6 +42,8 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
41
42
|
dataKey: "y",
|
|
42
43
|
name: _,
|
|
43
44
|
unit: "",
|
|
45
|
+
domain: y,
|
|
46
|
+
width: 44,
|
|
44
47
|
...n.axis
|
|
45
48
|
}),
|
|
46
49
|
/* @__PURE__ */ i(m, {
|
|
@@ -60,7 +63,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
60
63
|
name: "Data Points",
|
|
61
64
|
data: h,
|
|
62
65
|
fill: t[0],
|
|
63
|
-
isAnimationActive:
|
|
66
|
+
isAnimationActive: C
|
|
64
67
|
})
|
|
65
68
|
]
|
|
66
69
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_pxnwr_4`,t=`_container_pxnwr_9`,n={root:e,container:t};exports.container=t,exports.default=n,exports.root=e;
|
|
@@ -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:
|
|
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;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e from "./sparkline.module.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { Area as
|
|
3
|
+
import "react";
|
|
4
|
+
import t from "classnames";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { Area as i, AreaChart as a, Bar as o, BarChart as s, Line as c, LineChart as l, ResponsiveContainer as u, YAxis as d } from "recharts";
|
|
7
7
|
//#region src/components/charts/Sparkline/Sparkline.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
8
|
+
var f = "var(--wim-color-chart-primary)", p = ({ data: p, type: m = "line", width: h = "100%", height: g = 24, color: _ = f, strokeWidth: v = 2, showLastDot: y = !1, min: b, max: x, ariaLabel: S, className: C }) => {
|
|
9
|
+
let w = p.map((e, t) => ({
|
|
10
10
|
index: t,
|
|
11
11
|
value: e
|
|
12
|
-
})),
|
|
13
|
-
let { cx: t, cy:
|
|
14
|
-
return !
|
|
12
|
+
})), T = [b ?? "auto", x ?? "auto"], E = p.length - 1, D = typeof window < "u" && !!window.__VRT__, O = typeof h == "number" ? h : null, k = g ?? 24, A = (e) => {
|
|
13
|
+
let { cx: t, cy: r, index: i } = e;
|
|
14
|
+
return !y || i !== E || t == null || r == null ? /* @__PURE__ */ n("g", {}, i) : /* @__PURE__ */ n("circle", {
|
|
15
15
|
cx: t,
|
|
16
|
-
cy:
|
|
17
|
-
r:
|
|
18
|
-
fill:
|
|
16
|
+
cy: r,
|
|
17
|
+
r: v + 1,
|
|
18
|
+
fill: _
|
|
19
19
|
}, i);
|
|
20
|
-
},
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
-
} : {},
|
|
20
|
+
}, j = D && O !== null ? {
|
|
21
|
+
width: O,
|
|
22
|
+
height: k
|
|
23
|
+
} : {}, M = {
|
|
24
24
|
accessibilityLayer: !1,
|
|
25
25
|
tabIndex: -1
|
|
26
|
-
},
|
|
27
|
-
...
|
|
28
|
-
...
|
|
29
|
-
data:
|
|
26
|
+
}, N = () => m === "bar" ? /* @__PURE__ */ r(s, {
|
|
27
|
+
...j,
|
|
28
|
+
...M,
|
|
29
|
+
data: w,
|
|
30
30
|
margin: {
|
|
31
31
|
top: 2,
|
|
32
32
|
right: 2,
|
|
33
33
|
bottom: 2,
|
|
34
34
|
left: 2
|
|
35
35
|
},
|
|
36
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ n(d, {
|
|
37
37
|
hide: !0,
|
|
38
|
-
domain:
|
|
39
|
-
}), /* @__PURE__ */
|
|
38
|
+
domain: T
|
|
39
|
+
}), /* @__PURE__ */ n(o, {
|
|
40
40
|
dataKey: "value",
|
|
41
|
-
fill:
|
|
41
|
+
fill: _,
|
|
42
42
|
radius: [
|
|
43
43
|
2,
|
|
44
44
|
2,
|
|
@@ -47,85 +47,67 @@ var p = "var(--wim-color-chart-primary)", m = ({ data: m, type: h = "line", widt
|
|
|
47
47
|
],
|
|
48
48
|
isAnimationActive: !1
|
|
49
49
|
})]
|
|
50
|
-
}) :
|
|
51
|
-
...
|
|
52
|
-
...
|
|
53
|
-
data:
|
|
50
|
+
}) : m === "area" ? /* @__PURE__ */ r(a, {
|
|
51
|
+
...j,
|
|
52
|
+
...M,
|
|
53
|
+
data: w,
|
|
54
54
|
margin: {
|
|
55
55
|
top: 2,
|
|
56
56
|
right: 2,
|
|
57
57
|
bottom: 2,
|
|
58
58
|
left: 2
|
|
59
59
|
},
|
|
60
|
-
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */ r(f, {
|
|
78
|
-
hide: !0,
|
|
79
|
-
domain: D
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ r(a, {
|
|
82
|
-
type: "monotone",
|
|
83
|
-
dataKey: "value",
|
|
84
|
-
stroke: v,
|
|
85
|
-
strokeWidth: y,
|
|
86
|
-
fill: `url(#${T})`,
|
|
87
|
-
dot: b ? M : !1,
|
|
88
|
-
isAnimationActive: !1
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
}) : /* @__PURE__ */ i(u, {
|
|
92
|
-
...N,
|
|
93
|
-
...P,
|
|
94
|
-
data: E,
|
|
60
|
+
children: [/* @__PURE__ */ n(d, {
|
|
61
|
+
hide: !0,
|
|
62
|
+
domain: T
|
|
63
|
+
}), /* @__PURE__ */ n(i, {
|
|
64
|
+
type: "monotone",
|
|
65
|
+
dataKey: "value",
|
|
66
|
+
stroke: _,
|
|
67
|
+
strokeWidth: v,
|
|
68
|
+
fill: _,
|
|
69
|
+
fillOpacity: .15,
|
|
70
|
+
dot: y ? A : !1,
|
|
71
|
+
isAnimationActive: !1
|
|
72
|
+
})]
|
|
73
|
+
}) : /* @__PURE__ */ r(l, {
|
|
74
|
+
...j,
|
|
75
|
+
...M,
|
|
76
|
+
data: w,
|
|
95
77
|
margin: {
|
|
96
78
|
top: 2,
|
|
97
79
|
right: 2,
|
|
98
80
|
bottom: 2,
|
|
99
81
|
left: 2
|
|
100
82
|
},
|
|
101
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ n(d, {
|
|
102
84
|
hide: !0,
|
|
103
|
-
domain:
|
|
104
|
-
}), /* @__PURE__ */
|
|
85
|
+
domain: T
|
|
86
|
+
}), /* @__PURE__ */ n(c, {
|
|
105
87
|
type: "monotone",
|
|
106
88
|
dataKey: "value",
|
|
107
|
-
stroke:
|
|
108
|
-
strokeWidth:
|
|
109
|
-
dot:
|
|
89
|
+
stroke: _,
|
|
90
|
+
strokeWidth: v,
|
|
91
|
+
dot: y ? A : !1,
|
|
110
92
|
isAnimationActive: !1
|
|
111
93
|
})]
|
|
112
94
|
});
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
className:
|
|
95
|
+
return /* @__PURE__ */ n("div", {
|
|
96
|
+
className: t("wim-sparkline", e.root, C),
|
|
115
97
|
style: {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
98
|
+
width: h,
|
|
99
|
+
height: g
|
|
118
100
|
},
|
|
119
|
-
role:
|
|
120
|
-
"aria-label":
|
|
121
|
-
"aria-hidden":
|
|
122
|
-
children:
|
|
101
|
+
role: S ? "img" : void 0,
|
|
102
|
+
"aria-label": S,
|
|
103
|
+
"aria-hidden": S ? void 0 : !0,
|
|
104
|
+
children: D && O !== null ? N() : /* @__PURE__ */ n(u, {
|
|
123
105
|
width: "100%",
|
|
124
106
|
height: "100%",
|
|
125
|
-
children:
|
|
107
|
+
children: N()
|
|
126
108
|
})
|
|
127
109
|
});
|
|
128
110
|
};
|
|
129
|
-
|
|
111
|
+
p.displayName = "Sparkline";
|
|
130
112
|
//#endregion
|
|
131
|
-
export {
|
|
113
|
+
export { p as Sparkline };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1p9uf_4`,t={root:e};exports.default=t,exports.root=e;
|
|
@@ -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("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=({x:e,y:t,width:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=2,c=8,l=2,u=(e,t,n)=>{let r=n-t,i=r===0?1:Math.min(1,Math.max(0,(e-t)/r));return`color-mix(in oklch, var(--wim-color-chart-primary) ${20+Math.round(i*40)}%, var(--wim-color-surface))`},d=(0,i.createContext)({min:0,max:1}),f=({x:e,y:t,width:n,height:r,name:o,value:f,depth:p,children:m})=>{let{min:h,max:g}=(0,i.useContext)(d),_=o??``,v=(0,i.useCallback)(e=>{if(!e)return;let t=()=>{let t=Math.min(c,n*.12),r=Math.floor(n-t*2),i=()=>Math.ceil(e.getComputedTextLength())<=r;if(e.textContent=_,i()){e.style.visibility=``;return}let a=e.getComputedTextLength()/Math.max(1,_.length),o=Math.min(Math.floor(r/a)-1,_.length-1);for(;o>=l;){if(e.textContent=`${_.slice(0,o).trimEnd()}…`,i()){e.style.visibility=``;return}--o}e.textContent=_,e.style.visibility=`hidden`};t();let r=()=>{e.isConnected&&t()};return document.fonts?.addEventListener?.(`loadingdone`,r),()=>document.fonts?.removeEventListener?.(`loadingdone`,r)},[n,_]);return p===0||Array.isArray(m)&&m.length>0?(0,a.jsx)(`g`,{}):(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:e+s/2,y:t+s/2,width:Math.max(0,n-s),height:Math.max(0,r-s),style:{fill:u(f,h,g),stroke:`none`}}),n>30&&r>20&&(0,a.jsx)(`text`,{ref:v,x:e+n/2,y:t+r/2,textAnchor:`middle`,dominantBaseline:`central`,style:{fill:`var(--wim-color-text-primary)`,fontSize:`var(--wim-font-size-lg)`,fontWeight:`var(--wim-font-weight-bold)`,stroke:`none`,strokeWidth:0,pointerEvents:`none`,userSelect:`none`},children:_})]})},p=({data:e,dataKey:s,aspectRatio:c=4/3,height:l=300,width:u=`100%`,title:p})=>{let m=(0,i.useMemo)(()=>{let t=e=>e.flatMap(e=>Array.isArray(e.children)?t(e.children):[e]),n=t(e??[]).map(e=>Number(e[s])||0);return n.length?{min:Math.min(...n),max:Math.max(...n)}:{min:0,max:1}},[e,s]);return!e||e.length===0?null:(0,a.jsx)(d.Provider,{value:m,children:(0,a.jsxs)(`div`,{className:`wim-treemap ${r.default.root} wim-treemap__root`,style:{width:u},children:[p&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:p}),(0,a.jsx)(`div`,{className:`${r.default.container} wim-treemap__container`,style:{height:l,minWidth:0,minHeight:0},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsx)(o.Treemap,{data:e,dataKey:s,aspectRatio:c,stroke:`none`,content:f,isAnimationActive:!1,children:(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,formatter:(e,t)=>[e,t]})})})})]})})};exports.Treemap=p;
|
|
@@ -1,67 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { ResponsiveContainer as
|
|
3
|
+
import { CHART_THEME as t } from "../../helpers.js";
|
|
4
|
+
import n from "./treemap.module.js";
|
|
5
|
+
import { createContext as r, useCallback as i, useContext as a, useMemo as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { ResponsiveContainer as l, Tooltip as u, Treemap as d } from "recharts";
|
|
8
8
|
//#region src/components/charts/Treemap/Treemap.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
9
|
+
var f = 2, p = 8, m = 2, h = (e, t, n) => {
|
|
10
|
+
let r = n - t, i = r === 0 ? 1 : Math.min(1, Math.max(0, (e - t) / r));
|
|
11
|
+
return `color-mix(in oklch, var(--wim-color-chart-primary) ${20 + Math.round(i * 40)}%, var(--wim-color-surface))`;
|
|
12
|
+
}, g = r({
|
|
13
|
+
min: 0,
|
|
14
|
+
max: 1
|
|
15
|
+
}), _ = ({ x: e, y: t, width: n, height: r, name: o, value: l, depth: u, children: d }) => {
|
|
16
|
+
let { min: _, max: v } = a(g), y = o ?? "", b = i((e) => {
|
|
17
|
+
if (!e) return;
|
|
18
|
+
let t = () => {
|
|
19
|
+
let t = Math.min(p, n * .12), r = Math.floor(n - t * 2), i = () => Math.ceil(e.getComputedTextLength()) <= r;
|
|
20
|
+
if (e.textContent = y, i()) {
|
|
21
|
+
e.style.visibility = "";
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let a = e.getComputedTextLength() / Math.max(1, y.length), o = Math.min(Math.floor(r / a) - 1, y.length - 1);
|
|
25
|
+
for (; o >= m;) {
|
|
26
|
+
if (e.textContent = `${y.slice(0, o).trimEnd()}…`, i()) {
|
|
27
|
+
e.style.visibility = "";
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
--o;
|
|
31
|
+
}
|
|
32
|
+
e.textContent = y, e.style.visibility = "hidden";
|
|
33
|
+
};
|
|
34
|
+
t();
|
|
35
|
+
let r = () => {
|
|
36
|
+
e.isConnected && t();
|
|
37
|
+
};
|
|
38
|
+
return document.fonts?.addEventListener?.("loadingdone", r), () => document.fonts?.removeEventListener?.("loadingdone", r);
|
|
39
|
+
}, [n, y]);
|
|
40
|
+
return u === 0 || Array.isArray(d) && d.length > 0 ? /* @__PURE__ */ s("g", {}) : /* @__PURE__ */ c("g", { children: [/* @__PURE__ */ s("rect", {
|
|
41
|
+
x: e + f / 2,
|
|
42
|
+
y: t + f / 2,
|
|
43
|
+
width: Math.max(0, n - f),
|
|
44
|
+
height: Math.max(0, r - f),
|
|
43
45
|
style: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
fill: h(l, _, v),
|
|
47
|
+
stroke: "none"
|
|
48
|
+
}
|
|
49
|
+
}), n > 30 && r > 20 && /* @__PURE__ */ s("text", {
|
|
50
|
+
ref: b,
|
|
51
|
+
x: e + n / 2,
|
|
52
|
+
y: t + r / 2,
|
|
53
|
+
textAnchor: "middle",
|
|
54
|
+
dominantBaseline: "central",
|
|
55
|
+
style: {
|
|
56
|
+
fill: "var(--wim-color-text-primary)",
|
|
57
|
+
fontSize: "var(--wim-font-size-lg)",
|
|
58
|
+
fontWeight: "var(--wim-font-weight-bold)",
|
|
59
|
+
stroke: "none",
|
|
60
|
+
strokeWidth: 0,
|
|
61
|
+
pointerEvents: "none",
|
|
62
|
+
userSelect: "none"
|
|
47
63
|
},
|
|
48
|
-
children:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
children: y
|
|
65
|
+
})] });
|
|
66
|
+
}, v = ({ data: r, dataKey: i, aspectRatio: a = 4 / 3, height: f = 300, width: p = "100%", title: m }) => {
|
|
67
|
+
let h = o(() => {
|
|
68
|
+
let e = (t) => t.flatMap((t) => Array.isArray(t.children) ? e(t.children) : [t]), t = e(r ?? []).map((e) => Number(e[i]) || 0);
|
|
69
|
+
return t.length ? {
|
|
70
|
+
min: Math.min(...t),
|
|
71
|
+
max: Math.max(...t)
|
|
72
|
+
} : {
|
|
73
|
+
min: 0,
|
|
74
|
+
max: 1
|
|
75
|
+
};
|
|
76
|
+
}, [r, i]);
|
|
77
|
+
return !r || r.length === 0 ? null : /* @__PURE__ */ s(g.Provider, {
|
|
78
|
+
value: h,
|
|
79
|
+
children: /* @__PURE__ */ c("div", {
|
|
80
|
+
className: `wim-treemap ${n.root} wim-treemap__root`,
|
|
81
|
+
style: { width: p },
|
|
82
|
+
children: [m && /* @__PURE__ */ s(e, {
|
|
83
|
+
tag: "h3",
|
|
84
|
+
size: "md",
|
|
85
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
86
|
+
children: m
|
|
87
|
+
}), /* @__PURE__ */ s("div", {
|
|
88
|
+
className: `${n.container} wim-treemap__container`,
|
|
89
|
+
style: {
|
|
90
|
+
height: f,
|
|
91
|
+
minWidth: 0,
|
|
92
|
+
minHeight: 0
|
|
93
|
+
},
|
|
94
|
+
children: /* @__PURE__ */ s(l, {
|
|
95
|
+
width: "100%",
|
|
96
|
+
height: "100%",
|
|
97
|
+
children: /* @__PURE__ */ s(d, {
|
|
98
|
+
data: r,
|
|
99
|
+
dataKey: i,
|
|
100
|
+
aspectRatio: a,
|
|
101
|
+
stroke: "none",
|
|
102
|
+
content: _,
|
|
103
|
+
isAnimationActive: !1,
|
|
104
|
+
children: /* @__PURE__ */ s(u, {
|
|
105
|
+
contentStyle: t.tooltip.contentStyle,
|
|
106
|
+
formatter: (e, t) => [e, t]
|
|
107
|
+
})
|
|
108
|
+
})
|
|
61
109
|
})
|
|
62
|
-
})
|
|
110
|
+
})]
|
|
63
111
|
})
|
|
64
|
-
})
|
|
65
|
-
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
66
114
|
//#endregion
|
|
67
|
-
export {
|
|
115
|
+
export { v as Treemap };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1acjf_3`,t=`_sm_1acjf_17`,n=`_md_1acjf_21`,r=`_lg_1acjf_25`,i=`_disabled_1acjf_29`,a=`_star_1acjf_32`,o=`_foreground_1acjf_35`,s=`_full_1acjf_55`,c=`_half_1acjf_58`,l=`_background_1acjf_61`,u=`_icon_1acjf_64`,d={root:e,sm:t,md:n,lg:r,disabled:i,star:a,foreground:o,full:s,half:c,background:l,icon:u};exports.background=l,exports.default=d,exports.disabled=i,exports.foreground=o,exports.full=s,exports.half=c,exports.icon=u,exports.lg=r,exports.md=n,exports.root=e,exports.sm=t,exports.star=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/Rating/rating.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1acjf_3", t = "_sm_1acjf_17", n = "_md_1acjf_21", r = "_lg_1acjf_25", i = "_disabled_1acjf_29", a = "_star_1acjf_32", o = "_foreground_1acjf_35", s = "_full_1acjf_55", c = "_half_1acjf_58", l = "_background_1acjf_61", u = "_icon_1acjf_64", d = {
|
|
4
4
|
root: e,
|
|
5
5
|
sm: t,
|
|
6
6
|
md: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1hhrf_295`,t=`_disabled_1hhrf_313`,n=`_canvasContainer_1hhrf_317`,r=`_danger_1hhrf_286`,i=`_canvas_1hhrf_317`,a=`_footer_1hhrf_341`,o={"wim-docs-container":`_wim-docs-container_1hhrf_87`,"wim-t":`_wim-t_1hhrf_250`,"react-flow":`_react-flow_1hhrf_273`,"react-flow__edges":`_react-flow__edges_1hhrf_274`,"react-flow__connectionline":`_react-flow__connectionline_1hhrf_275`,root:e,disabled:t,canvasContainer:n,danger:r,canvas:i,footer:a};exports.canvas=i,exports.canvasContainer=n,exports.danger=r,exports.default=o,exports.disabled=t,exports.footer=a,exports.root=e;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/SignaturePad/signature-pad.module.scss
|
|
3
|
-
var e = "
|
|
4
|
-
"wim-docs-container": "_wim-docs-
|
|
5
|
-
"wim-t": "_wim-
|
|
6
|
-
"react-flow": "_react-
|
|
7
|
-
"react-flow__edges": "_react-
|
|
8
|
-
"react-flow__connectionline": "_react-
|
|
3
|
+
var e = "_root_1hhrf_295", t = "_disabled_1hhrf_313", n = "_canvasContainer_1hhrf_317", r = "_danger_1hhrf_286", i = "_canvas_1hhrf_317", a = "_footer_1hhrf_341", o = {
|
|
4
|
+
"wim-docs-container": "_wim-docs-container_1hhrf_87",
|
|
5
|
+
"wim-t": "_wim-t_1hhrf_250",
|
|
6
|
+
"react-flow": "_react-flow_1hhrf_273",
|
|
7
|
+
"react-flow__edges": "_react-flow__edges_1hhrf_274",
|
|
8
|
+
"react-flow__connectionline": "_react-flow__connectionline_1hhrf_275",
|
|
9
9
|
root: e,
|
|
10
10
|
disabled: t,
|
|
11
11
|
canvasContainer: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=[`var(--wim-color-chart-primary)`,`var(--wim-color-chart-info)`,`var(--wim-color-chart-success)`,`var(--wim-color-chart-warning)`,`var(--wim-color-chart-danger)`,`var(--wim-color-chart-secondary)`,`var(--wim-color-text-tertiary)`,`var(--wim-color-disabled)`],t=
|
|
2
|
+
var e=[`var(--wim-color-chart-primary)`,`var(--wim-color-chart-info)`,`var(--wim-color-chart-success)`,`var(--wim-color-chart-warning)`,`var(--wim-color-chart-danger)`,`var(--wim-color-chart-secondary)`,`var(--wim-color-text-tertiary)`,`var(--wim-color-disabled)`],t={axis:{stroke:`var(--wim-color-text-disabled)`,fontSize:12},grid:{stroke:`var(--wim-color-border-secondary)`,strokeDasharray:`3 3`},tooltip:{contentStyle:{backgroundColor:`var(--wim-color-glass-bg)`,border:`1px solid var(--wim-color-glass-border)`,borderRadius:`var(--wim-radius-md)`,fontSize:`var(--wim-font-size-sm)`,backdropFilter:`blur(8px)`,color:`var(--wim-color-text-primary)`},cursor:{fill:`var(--wim-color-text-primary)`,stroke:`var(--wim-color-border)`,strokeWidth:1,fillOpacity:.05,strokeOpacity:.5}}};exports.CHART_COLORS=e,exports.CHART_THEME=t;
|
|
@@ -33,3 +33,12 @@ export declare const CHART_THEME: {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* 軸の範囲(recharts の domain と同じ書き方)。T134 で追加。
|
|
38
|
+
* 0 起点が要るのは面積で比べる図(棒)だけで、折れ線や散布図は
|
|
39
|
+
* データに合わせたほうが差が読める。
|
|
40
|
+
*/
|
|
41
|
+
export type ChartAxisDomain = [
|
|
42
|
+
number | "auto" | "dataMin" | (string & {}),
|
|
43
|
+
number | "auto" | "dataMax" | (string & {})
|
|
44
|
+
];
|
|
@@ -9,16 +9,7 @@ var e = [
|
|
|
9
9
|
"var(--wim-color-chart-secondary)",
|
|
10
10
|
"var(--wim-color-text-tertiary)",
|
|
11
11
|
"var(--wim-color-disabled)"
|
|
12
|
-
], t =
|
|
13
|
-
"var(--wim-color-text-on-chart-primary)",
|
|
14
|
-
"var(--wim-color-text-on-chart-info)",
|
|
15
|
-
"var(--wim-color-text-on-chart-success)",
|
|
16
|
-
"var(--wim-color-text-on-chart-warning)",
|
|
17
|
-
"var(--wim-color-text-on-chart-danger)",
|
|
18
|
-
"var(--wim-color-text-on-chart-secondary)",
|
|
19
|
-
"var(--wim-color-text-primary)",
|
|
20
|
-
"var(--wim-color-text-primary)"
|
|
21
|
-
], n = {
|
|
12
|
+
], t = {
|
|
22
13
|
axis: {
|
|
23
14
|
stroke: "var(--wim-color-text-disabled)",
|
|
24
15
|
fontSize: 12
|
|
@@ -46,4 +37,4 @@ var e = [
|
|
|
46
37
|
}
|
|
47
38
|
};
|
|
48
39
|
//#endregion
|
|
49
|
-
export { e as CHART_COLORS, t as
|
|
40
|
+
export { e as CHART_COLORS, t as CHART_THEME };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/close.cjs"),r=require("../../../icon/edit.cjs"),i=require("../../../icon/plus.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../data-display/Card/Card.cjs"),s=require("../../form/Button/Button.cjs"),c=require("./dashboard.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=(0,l.createContext)(null),p=()=>{let e=(0,l.useContext)(f);if(!e)throw Error(`Dashboard subcomponents must be used within Dashboard`);return e},m=l.default.forwardRef(({widgets:e,editable:n,defaultEditable:o=!1,onEditChange:p,onRemove:m,onAdd:g,columns:_=3,gap:v=`md`,showEditToggle:y
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/close.cjs"),r=require("../../../icon/edit.cjs"),i=require("../../../icon/plus.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../data-display/Card/Card.cjs"),s=require("../../form/Button/Button.cjs"),c=require("./dashboard.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=(0,l.createContext)(null),p=()=>{let e=(0,l.useContext)(f);if(!e)throw Error(`Dashboard subcomponents must be used within Dashboard`);return e},m=l.default.forwardRef(({widgets:e,editable:n,defaultEditable:o=!1,onEditChange:p,onRemove:m,onAdd:g,columns:_=3,gap:v=`md`,showEditToggle:y,titleLevel:b=3,label:x,className:S,style:C,children:w,...T},E)=>{let{t:D}=t.useWimTranslation(`components`),O=n!==void 0,[k,A]=(0,l.useState)(o),j=O?n:k,M=(0,l.useCallback)(()=>{let e=!j;O||A(e),p?.(e)},[j,O,p]),N={"--dashboard-columns":_,...C},P=y??(n!==void 0||o||m!==void 0||g!==void 0),F=(0,l.useMemo)(()=>({editable:j??!1,onRemove:m,titleLevel:b}),[j,m,b]);return(0,d.jsx)(f.Provider,{value:F,children:(0,d.jsxs)(`div`,{ref:E,className:(0,u.default)(`wim-dashboard`,c.default.root,S),"aria-label":x??D(`dashboard_widget.label`),...T,children:[(x||P)&&(0,d.jsxs)(`div`,{className:c.default.header,children:[x&&(0,d.jsx)(`h2`,{className:c.default.heading,children:x}),P&&(0,d.jsx)(s.Button,{size:`sm`,variant:j?`solid`:`outline`,intent:`default`,className:void 0,onClick:M,"aria-pressed":j,"aria-label":D(j?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`),icon:(0,d.jsx)(a.Icon,{component:r.default,size:`sm`}),children:D(j?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`)})]}),(0,d.jsxs)(`div`,{className:(0,u.default)(c.default.grid,c.default[`gap-${v}`]),style:N,role:`region`,"aria-label":D(`dashboard_widget.grid_label`),children:[e?e.map(e=>(0,d.jsx)(h,{widget:e},e.id)):w,j&&g&&(0,d.jsx)(s.Button,{asChild:!0,className:c.default.addButton,onClick:g,"aria-label":D(`dashboard_widget.add_widget`),children:(0,d.jsxs)(`button`,{type:`button`,children:[(0,d.jsx)(a.Icon,{component:i.default,size:`md`}),(0,d.jsx)(`span`,{children:D(`dashboard_widget.add_widget`)})]})})]})]})})});m.displayName=`Dashboard`;var h=({widget:e,className:r,...i})=>{let{editable:l,onRemove:f,titleLevel:m}=p(),h=`h${m}`,{t:g}=t.useWimTranslation(`components`),{id:_,title:v,description:y,content:b,span:x=1,rowSpan:S=1}=e;return(0,d.jsxs)(o.Card,{variant:`outline`,padding:`md`,radius:`md`,className:(0,u.default)(c.default.widget,c.default[`span-${x}`],c.default[`row-${S}`],{[c.default.editMode]:l},r),style:{"--widget-span":x,"--widget-row-span":S},...i,children:[(0,d.jsxs)(`div`,{className:c.default.widgetHeader,children:[(0,d.jsxs)(`div`,{className:c.default.widgetMeta,children:[(0,d.jsx)(h,{className:c.default.widgetTitle,children:v}),y&&(0,d.jsx)(`p`,{className:c.default.widgetDescription,children:y})]}),l&&f&&(0,d.jsx)(s.Button,{size:`sm`,variant:`ghost`,intent:`danger`,className:c.default.removeButton,onClick:()=>f(_),"aria-label":g(`dashboard_widget.remove_widget`,{title:v}),icon:(0,d.jsx)(a.Icon,{component:n.default,size:`sm`})})]}),(0,d.jsx)(`div`,{className:c.default.widgetContent,children:b})]})};h.displayName=`DashboardWidgetCard`,exports.Dashboard=m,exports.DashboardWidgetCard=h;
|