@diwauhris/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/lib/assets/ui.css +154 -0
- package/lib/index.cjs +183 -0
- package/lib/index.mjs +65 -0
- package/lib/index10.cjs +33 -0
- package/lib/index10.cjs.map +1 -0
- package/lib/index10.mjs +33 -0
- package/lib/index10.mjs.map +1 -0
- package/lib/index11.cjs +16 -0
- package/lib/index11.cjs.map +1 -0
- package/lib/index11.mjs +16 -0
- package/lib/index11.mjs.map +1 -0
- package/lib/index12.cjs +16 -0
- package/lib/index12.cjs.map +1 -0
- package/lib/index12.mjs +15 -0
- package/lib/index12.mjs.map +1 -0
- package/lib/index13.cjs +57 -0
- package/lib/index13.cjs.map +1 -0
- package/lib/index13.mjs +57 -0
- package/lib/index13.mjs.map +1 -0
- package/lib/index14.cjs +10 -0
- package/lib/index14.cjs.map +1 -0
- package/lib/index14.mjs +10 -0
- package/lib/index14.mjs.map +1 -0
- package/lib/index15.cjs +30 -0
- package/lib/index15.cjs.map +1 -0
- package/lib/index15.mjs +30 -0
- package/lib/index15.mjs.map +1 -0
- package/lib/index16.cjs +28 -0
- package/lib/index16.cjs.map +1 -0
- package/lib/index16.mjs +26 -0
- package/lib/index16.mjs.map +1 -0
- package/lib/index17.cjs +43 -0
- package/lib/index17.cjs.map +1 -0
- package/lib/index17.mjs +43 -0
- package/lib/index17.mjs.map +1 -0
- package/lib/index18.cjs +59 -0
- package/lib/index18.cjs.map +1 -0
- package/lib/index18.mjs +59 -0
- package/lib/index18.mjs.map +1 -0
- package/lib/index19.cjs +67 -0
- package/lib/index19.cjs.map +1 -0
- package/lib/index19.mjs +67 -0
- package/lib/index19.mjs.map +1 -0
- package/lib/index2.cjs +33 -0
- package/lib/index2.mjs +13 -0
- package/lib/index20.cjs +79 -0
- package/lib/index20.cjs.map +1 -0
- package/lib/index20.mjs +79 -0
- package/lib/index20.mjs.map +1 -0
- package/lib/index21.cjs +105 -0
- package/lib/index21.cjs.map +1 -0
- package/lib/index21.mjs +104 -0
- package/lib/index21.mjs.map +1 -0
- package/lib/index22.cjs +50 -0
- package/lib/index22.cjs.map +1 -0
- package/lib/index22.mjs +50 -0
- package/lib/index22.mjs.map +1 -0
- package/lib/index23.cjs +143 -0
- package/lib/index23.cjs.map +1 -0
- package/lib/index23.mjs +143 -0
- package/lib/index23.mjs.map +1 -0
- package/lib/index25.cjs +177 -0
- package/lib/index25.cjs.map +1 -0
- package/lib/index25.mjs +175 -0
- package/lib/index25.mjs.map +1 -0
- package/lib/index26.cjs +108 -0
- package/lib/index26.cjs.map +1 -0
- package/lib/index26.mjs +108 -0
- package/lib/index26.mjs.map +1 -0
- package/lib/index27.cjs +120 -0
- package/lib/index27.cjs.map +1 -0
- package/lib/index27.mjs +120 -0
- package/lib/index27.mjs.map +1 -0
- package/lib/index28.cjs +54 -0
- package/lib/index28.cjs.map +1 -0
- package/lib/index28.mjs +54 -0
- package/lib/index28.mjs.map +1 -0
- package/lib/index29.cjs +100 -0
- package/lib/index29.cjs.map +1 -0
- package/lib/index29.mjs +100 -0
- package/lib/index29.mjs.map +1 -0
- package/lib/index3.cjs +38 -0
- package/lib/index3.cjs.map +1 -0
- package/lib/index3.mjs +38 -0
- package/lib/index3.mjs.map +1 -0
- package/lib/index30.cjs +27 -0
- package/lib/index30.cjs.map +1 -0
- package/lib/index30.mjs +27 -0
- package/lib/index30.mjs.map +1 -0
- package/lib/index31.cjs +72 -0
- package/lib/index31.cjs.map +1 -0
- package/lib/index31.mjs +72 -0
- package/lib/index31.mjs.map +1 -0
- package/lib/index32.cjs +19 -0
- package/lib/index32.cjs.map +1 -0
- package/lib/index32.mjs +19 -0
- package/lib/index32.mjs.map +1 -0
- package/lib/index33.cjs +25 -0
- package/lib/index33.cjs.map +1 -0
- package/lib/index33.mjs +25 -0
- package/lib/index33.mjs.map +1 -0
- package/lib/index34.cjs +55 -0
- package/lib/index34.cjs.map +1 -0
- package/lib/index34.mjs +51 -0
- package/lib/index34.mjs.map +1 -0
- package/lib/index35.cjs +25 -0
- package/lib/index35.cjs.map +1 -0
- package/lib/index35.mjs +25 -0
- package/lib/index35.mjs.map +1 -0
- package/lib/index36.cjs +54 -0
- package/lib/index36.cjs.map +1 -0
- package/lib/index36.mjs +49 -0
- package/lib/index36.mjs.map +1 -0
- package/lib/index37.cjs +130 -0
- package/lib/index37.cjs.map +1 -0
- package/lib/index37.mjs +128 -0
- package/lib/index37.mjs.map +1 -0
- package/lib/index38.cjs +106 -0
- package/lib/index38.cjs.map +1 -0
- package/lib/index38.mjs +102 -0
- package/lib/index38.mjs.map +1 -0
- package/lib/index39.cjs +137 -0
- package/lib/index39.cjs.map +1 -0
- package/lib/index39.mjs +137 -0
- package/lib/index39.mjs.map +1 -0
- package/lib/index4.cjs +24 -0
- package/lib/index4.cjs.map +1 -0
- package/lib/index4.mjs +24 -0
- package/lib/index4.mjs.map +1 -0
- package/lib/index40.cjs +130 -0
- package/lib/index40.cjs.map +1 -0
- package/lib/index40.mjs +126 -0
- package/lib/index40.mjs.map +1 -0
- package/lib/index41.cjs +60 -0
- package/lib/index41.cjs.map +1 -0
- package/lib/index41.mjs +58 -0
- package/lib/index41.mjs.map +1 -0
- package/lib/index42.cjs +105 -0
- package/lib/index42.cjs.map +1 -0
- package/lib/index42.mjs +105 -0
- package/lib/index42.mjs.map +1 -0
- package/lib/index43.cjs +47 -0
- package/lib/index43.cjs.map +1 -0
- package/lib/index43.mjs +42 -0
- package/lib/index43.mjs.map +1 -0
- package/lib/index44.cjs +40 -0
- package/lib/index44.cjs.map +1 -0
- package/lib/index44.mjs +35 -0
- package/lib/index44.mjs.map +1 -0
- package/lib/index45.cjs +91 -0
- package/lib/index45.cjs.map +1 -0
- package/lib/index45.mjs +91 -0
- package/lib/index45.mjs.map +1 -0
- package/lib/index46.cjs +180 -0
- package/lib/index46.cjs.map +1 -0
- package/lib/index46.mjs +180 -0
- package/lib/index46.mjs.map +1 -0
- package/lib/index47.cjs +61 -0
- package/lib/index47.cjs.map +1 -0
- package/lib/index47.mjs +61 -0
- package/lib/index47.mjs.map +1 -0
- package/lib/index48.cjs +165 -0
- package/lib/index48.cjs.map +1 -0
- package/lib/index48.mjs +161 -0
- package/lib/index48.mjs.map +1 -0
- package/lib/index49.cjs +83 -0
- package/lib/index49.cjs.map +1 -0
- package/lib/index49.mjs +83 -0
- package/lib/index49.mjs.map +1 -0
- package/lib/index5.cjs +39 -0
- package/lib/index5.cjs.map +1 -0
- package/lib/index5.mjs +39 -0
- package/lib/index5.mjs.map +1 -0
- package/lib/index50.cjs +100 -0
- package/lib/index50.cjs.map +1 -0
- package/lib/index50.mjs +100 -0
- package/lib/index50.mjs.map +1 -0
- package/lib/index51.cjs +116 -0
- package/lib/index51.cjs.map +1 -0
- package/lib/index51.mjs +113 -0
- package/lib/index51.mjs.map +1 -0
- package/lib/index52.cjs +93 -0
- package/lib/index52.cjs.map +1 -0
- package/lib/index52.mjs +93 -0
- package/lib/index52.mjs.map +1 -0
- package/lib/index53.cjs +120 -0
- package/lib/index53.cjs.map +1 -0
- package/lib/index53.mjs +120 -0
- package/lib/index53.mjs.map +1 -0
- package/lib/index54.cjs +53 -0
- package/lib/index54.cjs.map +1 -0
- package/lib/index54.mjs +50 -0
- package/lib/index54.mjs.map +1 -0
- package/lib/index55.cjs +130 -0
- package/lib/index55.cjs.map +1 -0
- package/lib/index55.mjs +127 -0
- package/lib/index55.mjs.map +1 -0
- package/lib/index56.cjs +36 -0
- package/lib/index56.cjs.map +1 -0
- package/lib/index56.mjs +35 -0
- package/lib/index56.mjs.map +1 -0
- package/lib/index57.cjs +47 -0
- package/lib/index57.cjs.map +1 -0
- package/lib/index57.mjs +47 -0
- package/lib/index57.mjs.map +1 -0
- package/lib/index58.cjs +97 -0
- package/lib/index58.cjs.map +1 -0
- package/lib/index58.mjs +97 -0
- package/lib/index58.mjs.map +1 -0
- package/lib/index59.cjs +120 -0
- package/lib/index59.cjs.map +1 -0
- package/lib/index59.mjs +116 -0
- package/lib/index59.mjs.map +1 -0
- package/lib/index6.cjs +29 -0
- package/lib/index6.cjs.map +1 -0
- package/lib/index6.mjs +29 -0
- package/lib/index6.mjs.map +1 -0
- package/lib/index60.cjs +34 -0
- package/lib/index60.cjs.map +1 -0
- package/lib/index60.mjs +34 -0
- package/lib/index60.mjs.map +1 -0
- package/lib/index61.cjs +62 -0
- package/lib/index61.cjs.map +1 -0
- package/lib/index61.mjs +62 -0
- package/lib/index61.mjs.map +1 -0
- package/lib/index62.cjs +213 -0
- package/lib/index62.cjs.map +1 -0
- package/lib/index62.mjs +213 -0
- package/lib/index62.mjs.map +1 -0
- package/lib/index63.cjs +42 -0
- package/lib/index63.cjs.map +1 -0
- package/lib/index63.mjs +42 -0
- package/lib/index63.mjs.map +1 -0
- package/lib/index64.cjs +86 -0
- package/lib/index64.cjs.map +1 -0
- package/lib/index64.mjs +86 -0
- package/lib/index64.mjs.map +1 -0
- package/lib/index65.cjs +156 -0
- package/lib/index65.cjs.map +1 -0
- package/lib/index65.mjs +156 -0
- package/lib/index65.mjs.map +1 -0
- package/lib/index66.cjs +107 -0
- package/lib/index66.cjs.map +1 -0
- package/lib/index66.mjs +106 -0
- package/lib/index66.mjs.map +1 -0
- package/lib/index67.cjs +52 -0
- package/lib/index67.cjs.map +1 -0
- package/lib/index67.mjs +52 -0
- package/lib/index67.mjs.map +1 -0
- package/lib/index68.cjs +125 -0
- package/lib/index68.cjs.map +1 -0
- package/lib/index68.mjs +115 -0
- package/lib/index68.mjs.map +1 -0
- package/lib/index69.cjs +34 -0
- package/lib/index69.cjs.map +1 -0
- package/lib/index69.mjs +29 -0
- package/lib/index69.mjs.map +1 -0
- package/lib/index7.cjs +17 -0
- package/lib/index7.cjs.map +1 -0
- package/lib/index7.mjs +17 -0
- package/lib/index7.mjs.map +1 -0
- package/lib/index8.cjs +86 -0
- package/lib/index8.cjs.map +1 -0
- package/lib/index8.mjs +86 -0
- package/lib/index8.mjs.map +1 -0
- package/lib/index9.cjs +29 -0
- package/lib/index9.cjs.map +1 -0
- package/lib/index9.mjs +29 -0
- package/lib/index9.mjs.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +68 -0
package/lib/index66.cjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
2
|
+
//#region src/ui-library/gallery/charts/Charts.tsx
|
|
3
|
+
function BarChart({ data, height = 160, barColor = "#6366f1", "aria-label": ariaLabel, className = "" }) {
|
|
4
|
+
const max = Math.max(...data.map((d) => d.value), 1);
|
|
5
|
+
const w = 100 / data.length;
|
|
6
|
+
const gap = .4;
|
|
7
|
+
const bw = w - gap * 2;
|
|
8
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9
|
+
className: `space-y-2 ${className}`,
|
|
10
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
11
|
+
role: "img",
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
viewBox: `0 0 100 ${height}`,
|
|
14
|
+
preserveAspectRatio: "none",
|
|
15
|
+
className: "w-full",
|
|
16
|
+
style: { height },
|
|
17
|
+
children: [data.map((d, i) => {
|
|
18
|
+
const barH = d.value / max * (height - 24);
|
|
19
|
+
const x = i * w + gap;
|
|
20
|
+
const y = height - 20 - barH;
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("g", {
|
|
22
|
+
"aria-label": `${d.label}: ${d.value}`,
|
|
23
|
+
role: "img",
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
25
|
+
x,
|
|
26
|
+
y,
|
|
27
|
+
width: bw,
|
|
28
|
+
height: barH,
|
|
29
|
+
rx: "2",
|
|
30
|
+
fill: d.color ?? barColor,
|
|
31
|
+
opacity: .9
|
|
32
|
+
})
|
|
33
|
+
}, d.label);
|
|
34
|
+
}), data.map((d, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("text", {
|
|
35
|
+
x: i * w + w / 2,
|
|
36
|
+
y: height - 4,
|
|
37
|
+
textAnchor: "middle",
|
|
38
|
+
className: "fill-slate-500",
|
|
39
|
+
style: {
|
|
40
|
+
fontSize: "6px",
|
|
41
|
+
fontFamily: "inherit"
|
|
42
|
+
},
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: d.label
|
|
45
|
+
}, `lbl-${d.label}`))]
|
|
46
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47
|
+
className: "flex justify-around",
|
|
48
|
+
children: data.map((d) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49
|
+
className: "text-[10px] font-bold text-slate-600",
|
|
50
|
+
children: d.value
|
|
51
|
+
}, d.label))
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function LineChart({ data, height = 120, lineColor = "#6366f1", filled = true, "aria-label": ariaLabel, className = "" }) {
|
|
56
|
+
const max = Math.max(...data.map((d) => d.value), 1);
|
|
57
|
+
const n = data.length;
|
|
58
|
+
if (n < 2) return null;
|
|
59
|
+
const pad = 8;
|
|
60
|
+
const W = 100;
|
|
61
|
+
const H = height;
|
|
62
|
+
const px = (i) => pad + i / (n - 1) * 84;
|
|
63
|
+
const py = (v) => pad + (max - v) / max * (H - 16);
|
|
64
|
+
const points = data.map((d, i) => ({
|
|
65
|
+
x: px(i),
|
|
66
|
+
y: py(d.value),
|
|
67
|
+
label: d.label,
|
|
68
|
+
value: d.value
|
|
69
|
+
}));
|
|
70
|
+
const linePath = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`).join(" ");
|
|
71
|
+
const areaPath = `${linePath} L${points[n - 1].x},${H - pad} L${points[0].x},${H - pad} Z`;
|
|
72
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
73
|
+
role: "img",
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
viewBox: `0 0 ${W} ${H}`,
|
|
76
|
+
preserveAspectRatio: "none",
|
|
77
|
+
className: `w-full ${className}`,
|
|
78
|
+
style: { height },
|
|
79
|
+
children: [
|
|
80
|
+
filled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
81
|
+
d: areaPath,
|
|
82
|
+
fill: lineColor,
|
|
83
|
+
fillOpacity: .1
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
86
|
+
d: linePath,
|
|
87
|
+
fill: "none",
|
|
88
|
+
stroke: lineColor,
|
|
89
|
+
strokeWidth: "1.5",
|
|
90
|
+
strokeLinejoin: "round",
|
|
91
|
+
strokeLinecap: "round"
|
|
92
|
+
}),
|
|
93
|
+
points.map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
94
|
+
cx: p.x,
|
|
95
|
+
cy: p.y,
|
|
96
|
+
r: 2,
|
|
97
|
+
fill: lineColor,
|
|
98
|
+
"aria-label": `${p.label}: ${p.value}`
|
|
99
|
+
}, p.label))
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
exports.BarChart = BarChart;
|
|
105
|
+
exports.LineChart = LineChart;
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=index66.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index66.cjs","names":[],"sources":["../src/ui-library/gallery/charts/Charts.tsx"],"sourcesContent":["/**\n * Charts — Design System Components\n *\n * Lightweight SVG-native chart primitives. No charting library dependency.\n * Suitable for simple analytics/KPI displays.\n *\n * Components:\n * BarChart — vertical bar chart\n * LineChart — line/area chart (SVG path)\n *\n * Accessibility:\n * - role=\"img\" on the SVG with aria-label describing the chart\n * - Each bar/point has aria-label with value\n * - Summary table available via a visually-hidden caption (optional)\n */\n\n\n// ── Types ─────────────────────────────────────────────────────────────────\n\nexport interface ChartDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n// ── BarChart ──────────────────────────────────────────────────────────────\n\nexport interface BarChartProps {\n data: ChartDataPoint[];\n height?: number;\n barColor?: string;\n /** Accessible description of the entire chart */\n 'aria-label': string;\n className?: string;\n}\n\nexport function BarChart({\n data,\n height = 160,\n barColor = '#6366f1',\n 'aria-label': ariaLabel,\n className = '',\n}: BarChartProps) {\n const max = Math.max(...data.map((d) => d.value), 1);\n const w = 100 / data.length;\n const gap = 0.4;\n const bw = w - gap * 2;\n\n return (\n <div className={`space-y-2 ${className}`}>\n <svg\n role=\"img\"\n aria-label={ariaLabel}\n viewBox={`0 0 100 ${height}`}\n preserveAspectRatio=\"none\"\n className=\"w-full\"\n style={{ height }}\n >\n {data.map((d, i) => {\n const barH = (d.value / max) * (height - 24);\n const x = i * w + gap;\n const y = height - 20 - barH;\n return (\n <g key={d.label} aria-label={`${d.label}: ${d.value}`} role=\"img\">\n <rect\n x={x}\n y={y}\n width={bw}\n height={barH}\n rx=\"2\"\n fill={d.color ?? barColor}\n opacity={0.9}\n />\n </g>\n );\n })}\n {/* X-axis labels */}\n {data.map((d, i) => (\n <text\n key={`lbl-${d.label}`}\n x={i * w + w / 2}\n y={height - 4}\n textAnchor=\"middle\"\n className=\"fill-slate-500\"\n style={{ fontSize: '6px', fontFamily: 'inherit' }}\n aria-hidden=\"true\"\n >\n {d.label}\n </text>\n ))}\n </svg>\n {/* Value labels */}\n <div className=\"flex justify-around\">\n {data.map((d) => (\n <span key={d.label} className=\"text-[10px] font-bold text-slate-600\">\n {d.value}\n </span>\n ))}\n </div>\n </div>\n );\n}\n\n// ── LineChart ─────────────────────────────────────────────────────────────\n\nexport interface LineChartProps {\n data: ChartDataPoint[];\n height?: number;\n lineColor?: string;\n filled?: boolean;\n 'aria-label': string;\n className?: string;\n}\n\nexport function LineChart({\n data,\n height = 120,\n lineColor = '#6366f1',\n filled = true,\n 'aria-label': ariaLabel,\n className = '',\n}: LineChartProps) {\n const max = Math.max(...data.map((d) => d.value), 1);\n const n = data.length;\n if (n < 2) return null;\n\n const pad = 8;\n const W = 100;\n const H = height;\n\n const px = (i: number) => pad + (i / (n - 1)) * (W - pad * 2);\n const py = (v: number) => pad + ((max - v) / max) * (H - pad * 2);\n\n const points = data.map((d, i) => ({ x: px(i), y: py(d.value), label: d.label, value: d.value }));\n const linePath = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');\n const areaPath = `${linePath} L${points[n - 1]!.x},${H - pad} L${points[0]!.x},${H - pad} Z`;\n\n return (\n <svg\n role=\"img\"\n aria-label={ariaLabel}\n viewBox={`0 0 ${W} ${H}`}\n preserveAspectRatio=\"none\"\n className={`w-full ${className}`}\n style={{ height }}\n >\n {filled && (\n <path d={areaPath} fill={lineColor} fillOpacity={0.1} />\n )}\n <path d={linePath} fill=\"none\" stroke={lineColor} strokeWidth=\"1.5\" strokeLinejoin=\"round\" strokeLinecap=\"round\" />\n {points.map((p) => (\n <circle\n key={p.label}\n cx={p.x}\n cy={p.y}\n r={2}\n fill={lineColor}\n aria-label={`${p.label}: ${p.value}`}\n />\n ))}\n </svg>\n );\n}\n"],"mappings":"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"}
|
package/lib/index66.mjs
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/ui-library/gallery/charts/Charts.tsx
|
|
3
|
+
function BarChart({ data, height = 160, barColor = "#6366f1", "aria-label": ariaLabel, className = "" }) {
|
|
4
|
+
const max = Math.max(...data.map((d) => d.value), 1);
|
|
5
|
+
const w = 100 / data.length;
|
|
6
|
+
const gap = .4;
|
|
7
|
+
const bw = w - gap * 2;
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: `space-y-2 ${className}`,
|
|
10
|
+
children: [/* @__PURE__ */ jsxs("svg", {
|
|
11
|
+
role: "img",
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
viewBox: `0 0 100 ${height}`,
|
|
14
|
+
preserveAspectRatio: "none",
|
|
15
|
+
className: "w-full",
|
|
16
|
+
style: { height },
|
|
17
|
+
children: [data.map((d, i) => {
|
|
18
|
+
const barH = d.value / max * (height - 24);
|
|
19
|
+
const x = i * w + gap;
|
|
20
|
+
const y = height - 20 - barH;
|
|
21
|
+
return /* @__PURE__ */ jsx("g", {
|
|
22
|
+
"aria-label": `${d.label}: ${d.value}`,
|
|
23
|
+
role: "img",
|
|
24
|
+
children: /* @__PURE__ */ jsx("rect", {
|
|
25
|
+
x,
|
|
26
|
+
y,
|
|
27
|
+
width: bw,
|
|
28
|
+
height: barH,
|
|
29
|
+
rx: "2",
|
|
30
|
+
fill: d.color ?? barColor,
|
|
31
|
+
opacity: .9
|
|
32
|
+
})
|
|
33
|
+
}, d.label);
|
|
34
|
+
}), data.map((d, i) => /* @__PURE__ */ jsx("text", {
|
|
35
|
+
x: i * w + w / 2,
|
|
36
|
+
y: height - 4,
|
|
37
|
+
textAnchor: "middle",
|
|
38
|
+
className: "fill-slate-500",
|
|
39
|
+
style: {
|
|
40
|
+
fontSize: "6px",
|
|
41
|
+
fontFamily: "inherit"
|
|
42
|
+
},
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: d.label
|
|
45
|
+
}, `lbl-${d.label}`))]
|
|
46
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "flex justify-around",
|
|
48
|
+
children: data.map((d) => /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "text-[10px] font-bold text-slate-600",
|
|
50
|
+
children: d.value
|
|
51
|
+
}, d.label))
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function LineChart({ data, height = 120, lineColor = "#6366f1", filled = true, "aria-label": ariaLabel, className = "" }) {
|
|
56
|
+
const max = Math.max(...data.map((d) => d.value), 1);
|
|
57
|
+
const n = data.length;
|
|
58
|
+
if (n < 2) return null;
|
|
59
|
+
const pad = 8;
|
|
60
|
+
const W = 100;
|
|
61
|
+
const H = height;
|
|
62
|
+
const px = (i) => pad + i / (n - 1) * 84;
|
|
63
|
+
const py = (v) => pad + (max - v) / max * (H - 16);
|
|
64
|
+
const points = data.map((d, i) => ({
|
|
65
|
+
x: px(i),
|
|
66
|
+
y: py(d.value),
|
|
67
|
+
label: d.label,
|
|
68
|
+
value: d.value
|
|
69
|
+
}));
|
|
70
|
+
const linePath = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`).join(" ");
|
|
71
|
+
const areaPath = `${linePath} L${points[n - 1].x},${H - pad} L${points[0].x},${H - pad} Z`;
|
|
72
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
73
|
+
role: "img",
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
viewBox: `0 0 ${W} ${H}`,
|
|
76
|
+
preserveAspectRatio: "none",
|
|
77
|
+
className: `w-full ${className}`,
|
|
78
|
+
style: { height },
|
|
79
|
+
children: [
|
|
80
|
+
filled && /* @__PURE__ */ jsx("path", {
|
|
81
|
+
d: areaPath,
|
|
82
|
+
fill: lineColor,
|
|
83
|
+
fillOpacity: .1
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("path", {
|
|
86
|
+
d: linePath,
|
|
87
|
+
fill: "none",
|
|
88
|
+
stroke: lineColor,
|
|
89
|
+
strokeWidth: "1.5",
|
|
90
|
+
strokeLinejoin: "round",
|
|
91
|
+
strokeLinecap: "round"
|
|
92
|
+
}),
|
|
93
|
+
points.map((p) => /* @__PURE__ */ jsx("circle", {
|
|
94
|
+
cx: p.x,
|
|
95
|
+
cy: p.y,
|
|
96
|
+
r: 2,
|
|
97
|
+
fill: lineColor,
|
|
98
|
+
"aria-label": `${p.label}: ${p.value}`
|
|
99
|
+
}, p.label))
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { BarChart, LineChart };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=index66.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index66.mjs","names":[],"sources":["../src/ui-library/gallery/charts/Charts.tsx"],"sourcesContent":["/**\n * Charts — Design System Components\n *\n * Lightweight SVG-native chart primitives. No charting library dependency.\n * Suitable for simple analytics/KPI displays.\n *\n * Components:\n * BarChart — vertical bar chart\n * LineChart — line/area chart (SVG path)\n *\n * Accessibility:\n * - role=\"img\" on the SVG with aria-label describing the chart\n * - Each bar/point has aria-label with value\n * - Summary table available via a visually-hidden caption (optional)\n */\n\n\n// ── Types ─────────────────────────────────────────────────────────────────\n\nexport interface ChartDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n// ── BarChart ──────────────────────────────────────────────────────────────\n\nexport interface BarChartProps {\n data: ChartDataPoint[];\n height?: number;\n barColor?: string;\n /** Accessible description of the entire chart */\n 'aria-label': string;\n className?: string;\n}\n\nexport function BarChart({\n data,\n height = 160,\n barColor = '#6366f1',\n 'aria-label': ariaLabel,\n className = '',\n}: BarChartProps) {\n const max = Math.max(...data.map((d) => d.value), 1);\n const w = 100 / data.length;\n const gap = 0.4;\n const bw = w - gap * 2;\n\n return (\n <div className={`space-y-2 ${className}`}>\n <svg\n role=\"img\"\n aria-label={ariaLabel}\n viewBox={`0 0 100 ${height}`}\n preserveAspectRatio=\"none\"\n className=\"w-full\"\n style={{ height }}\n >\n {data.map((d, i) => {\n const barH = (d.value / max) * (height - 24);\n const x = i * w + gap;\n const y = height - 20 - barH;\n return (\n <g key={d.label} aria-label={`${d.label}: ${d.value}`} role=\"img\">\n <rect\n x={x}\n y={y}\n width={bw}\n height={barH}\n rx=\"2\"\n fill={d.color ?? barColor}\n opacity={0.9}\n />\n </g>\n );\n })}\n {/* X-axis labels */}\n {data.map((d, i) => (\n <text\n key={`lbl-${d.label}`}\n x={i * w + w / 2}\n y={height - 4}\n textAnchor=\"middle\"\n className=\"fill-slate-500\"\n style={{ fontSize: '6px', fontFamily: 'inherit' }}\n aria-hidden=\"true\"\n >\n {d.label}\n </text>\n ))}\n </svg>\n {/* Value labels */}\n <div className=\"flex justify-around\">\n {data.map((d) => (\n <span key={d.label} className=\"text-[10px] font-bold text-slate-600\">\n {d.value}\n </span>\n ))}\n </div>\n </div>\n );\n}\n\n// ── LineChart ─────────────────────────────────────────────────────────────\n\nexport interface LineChartProps {\n data: ChartDataPoint[];\n height?: number;\n lineColor?: string;\n filled?: boolean;\n 'aria-label': string;\n className?: string;\n}\n\nexport function LineChart({\n data,\n height = 120,\n lineColor = '#6366f1',\n filled = true,\n 'aria-label': ariaLabel,\n className = '',\n}: LineChartProps) {\n const max = Math.max(...data.map((d) => d.value), 1);\n const n = data.length;\n if (n < 2) return null;\n\n const pad = 8;\n const W = 100;\n const H = height;\n\n const px = (i: number) => pad + (i / (n - 1)) * (W - pad * 2);\n const py = (v: number) => pad + ((max - v) / max) * (H - pad * 2);\n\n const points = data.map((d, i) => ({ x: px(i), y: py(d.value), label: d.label, value: d.value }));\n const linePath = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');\n const areaPath = `${linePath} L${points[n - 1]!.x},${H - pad} L${points[0]!.x},${H - pad} Z`;\n\n return (\n <svg\n role=\"img\"\n aria-label={ariaLabel}\n viewBox={`0 0 ${W} ${H}`}\n preserveAspectRatio=\"none\"\n className={`w-full ${className}`}\n style={{ height }}\n >\n {filled && (\n <path d={areaPath} fill={lineColor} fillOpacity={0.1} />\n )}\n <path d={linePath} fill=\"none\" stroke={lineColor} strokeWidth=\"1.5\" strokeLinejoin=\"round\" strokeLinecap=\"round\" />\n {points.map((p) => (\n <circle\n key={p.label}\n cx={p.x}\n cy={p.y}\n r={2}\n fill={lineColor}\n aria-label={`${p.label}: ${p.value}`}\n />\n ))}\n </svg>\n );\n}\n"],"mappings":"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"}
|
package/lib/index67.cjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
let react = require("react");
|
|
2
|
+
let lucide_react = require("lucide-react");
|
|
3
|
+
//#region src/ui-library/gallery/status-actions/statusActions.ts
|
|
4
|
+
/**
|
|
5
|
+
* statusActions — Gallery-native lifecycle transition utilities.
|
|
6
|
+
* Copied from shared/components/statusActions.tsx.
|
|
7
|
+
* Updated to:
|
|
8
|
+
* - Define ActionMenuItem locally (instead of importing from ui.tsx)
|
|
9
|
+
* - Remove ActionMenu component import (not needed here)
|
|
10
|
+
* - Import only from react and lucide-react
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build lifecycle status-transition menu items for an entity.
|
|
14
|
+
*/
|
|
15
|
+
function statusMenuItems(current, isActive, onTransition, options = {}) {
|
|
16
|
+
const impactMessage = options.impactMessage ?? "Related records may be affected, including reporting links, assignments, pay profiles, payroll schedules, templates, components, or formulas.";
|
|
17
|
+
const status = (current ?? (isActive === false ? "inactive" : "active")).toLowerCase();
|
|
18
|
+
const items = [];
|
|
19
|
+
const confirmTransition = (next) => {
|
|
20
|
+
const verb = next === "active" ? "reactivate" : next === "inactive" ? "set inactive" : "archive";
|
|
21
|
+
if (options.requestConfirm) {
|
|
22
|
+
options.requestConfirm({
|
|
23
|
+
next,
|
|
24
|
+
verb,
|
|
25
|
+
impactMessage
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (window.confirm(`Confirm ${verb} status change?\n\n${impactMessage}`)) onTransition(next);
|
|
30
|
+
};
|
|
31
|
+
if (status !== "active") items.push({
|
|
32
|
+
label: status === "archived" ? "Restore to active" : "Set active",
|
|
33
|
+
icon: (0, react.createElement)(status === "archived" ? lucide_react.ArchiveRestore : lucide_react.CheckCircle2, { size: 14 }),
|
|
34
|
+
onClick: () => confirmTransition("active")
|
|
35
|
+
});
|
|
36
|
+
if (status === "active") items.push({
|
|
37
|
+
label: "Set inactive",
|
|
38
|
+
icon: (0, react.createElement)(lucide_react.Ban, { size: 14 }),
|
|
39
|
+
onClick: () => confirmTransition("inactive")
|
|
40
|
+
});
|
|
41
|
+
if (status !== "archived") items.push({
|
|
42
|
+
label: "Archive",
|
|
43
|
+
icon: (0, react.createElement)(lucide_react.Archive, { size: 14 }),
|
|
44
|
+
tone: "danger",
|
|
45
|
+
onClick: () => confirmTransition("archived")
|
|
46
|
+
});
|
|
47
|
+
return items;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.statusMenuItems = statusMenuItems;
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=index67.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index67.cjs","names":[],"sources":["../src/ui-library/gallery/status-actions/statusActions.ts"],"sourcesContent":["/**\n * statusActions — Gallery-native lifecycle transition utilities.\n * Copied from shared/components/statusActions.tsx.\n * Updated to:\n * - Define ActionMenuItem locally (instead of importing from ui.tsx)\n * - Remove ActionMenu component import (not needed here)\n * - Import only from react and lucide-react\n */\nimport { createElement } from 'react';\nimport { Archive, ArchiveRestore, Ban, CheckCircle2 } from 'lucide-react';\n\n// Inlined from shared/components/ui.tsx — only the subset needed here\nexport interface ActionMenuItem {\n label: string;\n icon?: React.ReactNode;\n onClick: () => void;\n tone?: 'default' | 'danger';\n disabled?: boolean;\n hidden?: boolean;\n}\n\nexport type Lifecycle = 'draft' | 'active' | 'inactive' | 'archived';\n\nexport interface StatusTransitionRequest {\n next: Lifecycle;\n verb: string;\n impactMessage: string;\n}\n\nexport interface StatusMenuOptions {\n impactMessage?: string;\n requestConfirm?: (request: StatusTransitionRequest) => void;\n}\n\n/**\n * Build lifecycle status-transition menu items for an entity.\n */\nexport function statusMenuItems(\n current: string | undefined,\n isActive: boolean | undefined,\n onTransition: (status: Lifecycle) => void,\n options: StatusMenuOptions = {},\n): ActionMenuItem[] {\n const impactMessage =\n options.impactMessage ??\n 'Related records may be affected, including reporting links, assignments, pay profiles, payroll schedules, templates, components, or formulas.';\n const status = (current ?? (isActive === false ? 'inactive' : 'active')).toLowerCase();\n const items: ActionMenuItem[] = [];\n const confirmTransition = (next: Lifecycle) => {\n const verb = next === 'active' ? 'reactivate' : next === 'inactive' ? 'set inactive' : 'archive';\n if (options.requestConfirm) {\n options.requestConfirm({ next, verb, impactMessage });\n return;\n }\n if (window.confirm(`Confirm ${verb} status change?\\n\\n${impactMessage}`)) onTransition(next);\n };\n\n if (status !== 'active') {\n items.push({\n label: status === 'archived' ? 'Restore to active' : 'Set active',\n icon: createElement(status === 'archived' ? ArchiveRestore : CheckCircle2, { size: 14 }),\n onClick: () => confirmTransition('active'),\n });\n }\n if (status === 'active') {\n items.push({ label: 'Set inactive', icon: createElement(Ban, { size: 14 }), onClick: () => confirmTransition('inactive') });\n }\n if (status !== 'archived') {\n items.push({ label: 'Archive', icon: createElement(Archive, { size: 14 }), tone: 'danger', onClick: () => confirmTransition('archived') });\n }\n return items;\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgB,gBACd,SACA,UACA,cACA,UAA6B,CAAC,GACZ;CAClB,MAAM,gBACJ,QAAQ,iBACR;CACF,MAAM,UAAU,YAAY,aAAa,QAAQ,aAAa,UAAA,CAAW,YAAY;CACrF,MAAM,QAA0B,CAAC;CACjC,MAAM,qBAAqB,SAAoB;EAC7C,MAAM,OAAO,SAAS,WAAW,eAAe,SAAS,aAAa,iBAAiB;EACvF,IAAI,QAAQ,gBAAgB;GAC1B,QAAQ,eAAe;IAAE;IAAM;IAAM;GAAc,CAAC;GACpD;EACF;EACA,IAAI,OAAO,QAAQ,WAAW,KAAK,qBAAqB,eAAe,GAAG,aAAa,IAAI;CAC7F;CAEA,IAAI,WAAW,UACb,MAAM,KAAK;EACT,OAAO,WAAW,aAAa,sBAAsB;EACrD,OAAA,GAAM,MAAA,cAAA,CAAc,WAAW,aAAa,aAAA,iBAAiB,aAAA,cAAc,EAAE,MAAM,GAAG,CAAC;EACvF,eAAe,kBAAkB,QAAQ;CAC3C,CAAC;CAEH,IAAI,WAAW,UACb,MAAM,KAAK;EAAE,OAAO;EAAgB,OAAA,GAAM,MAAA,cAAA,CAAc,aAAA,KAAK,EAAE,MAAM,GAAG,CAAC;EAAG,eAAe,kBAAkB,UAAU;CAAE,CAAC;CAE5H,IAAI,WAAW,YACb,MAAM,KAAK;EAAE,OAAO;EAAW,OAAA,GAAM,MAAA,cAAA,CAAc,aAAA,SAAS,EAAE,MAAM,GAAG,CAAC;EAAG,MAAM;EAAU,eAAe,kBAAkB,UAAU;CAAE,CAAC;CAE3I,OAAO;AACT"}
|
package/lib/index67.mjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import { Archive, ArchiveRestore, Ban, CheckCircle2 } from "lucide-react";
|
|
3
|
+
//#region src/ui-library/gallery/status-actions/statusActions.ts
|
|
4
|
+
/**
|
|
5
|
+
* statusActions — Gallery-native lifecycle transition utilities.
|
|
6
|
+
* Copied from shared/components/statusActions.tsx.
|
|
7
|
+
* Updated to:
|
|
8
|
+
* - Define ActionMenuItem locally (instead of importing from ui.tsx)
|
|
9
|
+
* - Remove ActionMenu component import (not needed here)
|
|
10
|
+
* - Import only from react and lucide-react
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build lifecycle status-transition menu items for an entity.
|
|
14
|
+
*/
|
|
15
|
+
function statusMenuItems(current, isActive, onTransition, options = {}) {
|
|
16
|
+
const impactMessage = options.impactMessage ?? "Related records may be affected, including reporting links, assignments, pay profiles, payroll schedules, templates, components, or formulas.";
|
|
17
|
+
const status = (current ?? (isActive === false ? "inactive" : "active")).toLowerCase();
|
|
18
|
+
const items = [];
|
|
19
|
+
const confirmTransition = (next) => {
|
|
20
|
+
const verb = next === "active" ? "reactivate" : next === "inactive" ? "set inactive" : "archive";
|
|
21
|
+
if (options.requestConfirm) {
|
|
22
|
+
options.requestConfirm({
|
|
23
|
+
next,
|
|
24
|
+
verb,
|
|
25
|
+
impactMessage
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (window.confirm(`Confirm ${verb} status change?\n\n${impactMessage}`)) onTransition(next);
|
|
30
|
+
};
|
|
31
|
+
if (status !== "active") items.push({
|
|
32
|
+
label: status === "archived" ? "Restore to active" : "Set active",
|
|
33
|
+
icon: createElement(status === "archived" ? ArchiveRestore : CheckCircle2, { size: 14 }),
|
|
34
|
+
onClick: () => confirmTransition("active")
|
|
35
|
+
});
|
|
36
|
+
if (status === "active") items.push({
|
|
37
|
+
label: "Set inactive",
|
|
38
|
+
icon: createElement(Ban, { size: 14 }),
|
|
39
|
+
onClick: () => confirmTransition("inactive")
|
|
40
|
+
});
|
|
41
|
+
if (status !== "archived") items.push({
|
|
42
|
+
label: "Archive",
|
|
43
|
+
icon: createElement(Archive, { size: 14 }),
|
|
44
|
+
tone: "danger",
|
|
45
|
+
onClick: () => confirmTransition("archived")
|
|
46
|
+
});
|
|
47
|
+
return items;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { statusMenuItems };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=index67.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index67.mjs","names":[],"sources":["../src/ui-library/gallery/status-actions/statusActions.ts"],"sourcesContent":["/**\n * statusActions — Gallery-native lifecycle transition utilities.\n * Copied from shared/components/statusActions.tsx.\n * Updated to:\n * - Define ActionMenuItem locally (instead of importing from ui.tsx)\n * - Remove ActionMenu component import (not needed here)\n * - Import only from react and lucide-react\n */\nimport { createElement } from 'react';\nimport { Archive, ArchiveRestore, Ban, CheckCircle2 } from 'lucide-react';\n\n// Inlined from shared/components/ui.tsx — only the subset needed here\nexport interface ActionMenuItem {\n label: string;\n icon?: React.ReactNode;\n onClick: () => void;\n tone?: 'default' | 'danger';\n disabled?: boolean;\n hidden?: boolean;\n}\n\nexport type Lifecycle = 'draft' | 'active' | 'inactive' | 'archived';\n\nexport interface StatusTransitionRequest {\n next: Lifecycle;\n verb: string;\n impactMessage: string;\n}\n\nexport interface StatusMenuOptions {\n impactMessage?: string;\n requestConfirm?: (request: StatusTransitionRequest) => void;\n}\n\n/**\n * Build lifecycle status-transition menu items for an entity.\n */\nexport function statusMenuItems(\n current: string | undefined,\n isActive: boolean | undefined,\n onTransition: (status: Lifecycle) => void,\n options: StatusMenuOptions = {},\n): ActionMenuItem[] {\n const impactMessage =\n options.impactMessage ??\n 'Related records may be affected, including reporting links, assignments, pay profiles, payroll schedules, templates, components, or formulas.';\n const status = (current ?? (isActive === false ? 'inactive' : 'active')).toLowerCase();\n const items: ActionMenuItem[] = [];\n const confirmTransition = (next: Lifecycle) => {\n const verb = next === 'active' ? 'reactivate' : next === 'inactive' ? 'set inactive' : 'archive';\n if (options.requestConfirm) {\n options.requestConfirm({ next, verb, impactMessage });\n return;\n }\n if (window.confirm(`Confirm ${verb} status change?\\n\\n${impactMessage}`)) onTransition(next);\n };\n\n if (status !== 'active') {\n items.push({\n label: status === 'archived' ? 'Restore to active' : 'Set active',\n icon: createElement(status === 'archived' ? ArchiveRestore : CheckCircle2, { size: 14 }),\n onClick: () => confirmTransition('active'),\n });\n }\n if (status === 'active') {\n items.push({ label: 'Set inactive', icon: createElement(Ban, { size: 14 }), onClick: () => confirmTransition('inactive') });\n }\n if (status !== 'archived') {\n items.push({ label: 'Archive', icon: createElement(Archive, { size: 14 }), tone: 'danger', onClick: () => confirmTransition('archived') });\n }\n return items;\n}\n"],"mappings":";;;;;;;;;;;;;;AAqCA,SAAgB,gBACd,SACA,UACA,cACA,UAA6B,CAAC,GACZ;CAClB,MAAM,gBACJ,QAAQ,iBACR;CACF,MAAM,UAAU,YAAY,aAAa,QAAQ,aAAa,UAAA,CAAW,YAAY;CACrF,MAAM,QAA0B,CAAC;CACjC,MAAM,qBAAqB,SAAoB;EAC7C,MAAM,OAAO,SAAS,WAAW,eAAe,SAAS,aAAa,iBAAiB;EACvF,IAAI,QAAQ,gBAAgB;GAC1B,QAAQ,eAAe;IAAE;IAAM;IAAM;GAAc,CAAC;GACpD;EACF;EACA,IAAI,OAAO,QAAQ,WAAW,KAAK,qBAAqB,eAAe,GAAG,aAAa,IAAI;CAC7F;CAEA,IAAI,WAAW,UACb,MAAM,KAAK;EACT,OAAO,WAAW,aAAa,sBAAsB;EACrD,MAAM,cAAc,WAAW,aAAa,iBAAiB,cAAc,EAAE,MAAM,GAAG,CAAC;EACvF,eAAe,kBAAkB,QAAQ;CAC3C,CAAC;CAEH,IAAI,WAAW,UACb,MAAM,KAAK;EAAE,OAAO;EAAgB,MAAM,cAAc,KAAK,EAAE,MAAM,GAAG,CAAC;EAAG,eAAe,kBAAkB,UAAU;CAAE,CAAC;CAE5H,IAAI,WAAW,YACb,MAAM,KAAK;EAAE,OAAO;EAAW,MAAM,cAAc,SAAS,EAAE,MAAM,GAAG,CAAC;EAAG,MAAM;EAAU,eAAe,kBAAkB,UAAU;CAAE,CAAC;CAE3I,OAAO;AACT"}
|
package/lib/index68.cjs
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//#region src/ui-library/tokens/colors.ts
|
|
2
|
+
var colors_exports = /* @__PURE__ */ require("./index2.cjs").__exportAll({
|
|
3
|
+
border: () => border,
|
|
4
|
+
focus: () => focus,
|
|
5
|
+
interactive: () => interactive,
|
|
6
|
+
surface: () => surface,
|
|
7
|
+
text: () => text,
|
|
8
|
+
tone: () => tone
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* DIWA Color Tokens
|
|
12
|
+
*
|
|
13
|
+
* Formalizes the color vocabulary identified in the Phase 9 audit.
|
|
14
|
+
* These are string constants that map to Tailwind utility class fragments.
|
|
15
|
+
*
|
|
16
|
+
* Rules:
|
|
17
|
+
* - All values are Tailwind class suffixes, not raw hex values.
|
|
18
|
+
* - Brand primitives (brand-navy, brand-blue, brand-sky) are defined in
|
|
19
|
+
* tailwind.config.js and are the single source of truth for hex values.
|
|
20
|
+
* - Semantic palette (slate, rose, emerald, amber, sky) uses standard Tailwind.
|
|
21
|
+
* - Do NOT introduce CSS custom properties here.
|
|
22
|
+
* - Do NOT import this at runtime inside components yet — this file is the
|
|
23
|
+
* reference foundation for future component customization.
|
|
24
|
+
*
|
|
25
|
+
* Usage (future):
|
|
26
|
+
* import { focus, border } from '@/ui-library/tokens/colors';
|
|
27
|
+
* className={`focus-visible:ring-2 focus-visible:ring-${focus.interactive}`}
|
|
28
|
+
*/
|
|
29
|
+
var interactive = {
|
|
30
|
+
/** Core interactive — brand-blue (#034EA2) */
|
|
31
|
+
default: "brand-blue",
|
|
32
|
+
/** Hover/deepen target — brand-navy (#00377B) */
|
|
33
|
+
hover: "brand-navy",
|
|
34
|
+
/** Lighter accent — brand-sky (#2D8ACA) */
|
|
35
|
+
accent: "brand-sky"
|
|
36
|
+
};
|
|
37
|
+
var surface = {
|
|
38
|
+
/**
|
|
39
|
+
* Page background — registered in tailwind.config.js as 'surface-page' (#f4f6f9).
|
|
40
|
+
* Use: bg-surface-page
|
|
41
|
+
*/
|
|
42
|
+
page: "surface-page",
|
|
43
|
+
/**
|
|
44
|
+
* All overlay backdrops (Modal, Dialog, Drawer).
|
|
45
|
+
* Use: bg-brand-navy/50 backdrop-blur-sm
|
|
46
|
+
*/
|
|
47
|
+
overlay: "brand-navy/50"
|
|
48
|
+
};
|
|
49
|
+
var border = {
|
|
50
|
+
/** Default border on inputs, cards, popovers — slate-200 */
|
|
51
|
+
base: "slate-200",
|
|
52
|
+
/** Header/footer separator lines — slate-100 */
|
|
53
|
+
separator: "slate-100"
|
|
54
|
+
};
|
|
55
|
+
var text = {
|
|
56
|
+
/** Primary body text — slate-900 */
|
|
57
|
+
body: "slate-900",
|
|
58
|
+
/** Secondary/label text — slate-500 */
|
|
59
|
+
secondary: "slate-500",
|
|
60
|
+
/** Muted/placeholder text — slate-400 */
|
|
61
|
+
muted: "slate-400",
|
|
62
|
+
/** Disabled text — slate-300 */
|
|
63
|
+
disabled: "slate-300"
|
|
64
|
+
};
|
|
65
|
+
var focus = {
|
|
66
|
+
/**
|
|
67
|
+
* Field wrapper focus ring.
|
|
68
|
+
* Applied via focus-within on Input/Select/Textarea wrappers.
|
|
69
|
+
* Intentionally lighter than interactive focus — it's a containing ring.
|
|
70
|
+
*/
|
|
71
|
+
field: "focus-within:ring-2 focus-within:ring-brand-blue/15",
|
|
72
|
+
/**
|
|
73
|
+
* Standard interactive focus ring.
|
|
74
|
+
* Applied via focus-visible on all buttons, links, and controls.
|
|
75
|
+
* Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30
|
|
76
|
+
*/
|
|
77
|
+
interactive: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30",
|
|
78
|
+
/**
|
|
79
|
+
* Danger interactive focus ring.
|
|
80
|
+
* Applied on destructive buttons.
|
|
81
|
+
* Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300
|
|
82
|
+
*/
|
|
83
|
+
danger: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300"
|
|
84
|
+
};
|
|
85
|
+
var tone = {
|
|
86
|
+
danger: {
|
|
87
|
+
bg: "rose-50",
|
|
88
|
+
border: "rose-200",
|
|
89
|
+
text: "rose-700",
|
|
90
|
+
icon: "rose-500"
|
|
91
|
+
},
|
|
92
|
+
success: {
|
|
93
|
+
bg: "emerald-50",
|
|
94
|
+
border: "emerald-200",
|
|
95
|
+
text: "emerald-700",
|
|
96
|
+
icon: "emerald-500"
|
|
97
|
+
},
|
|
98
|
+
warning: {
|
|
99
|
+
bg: "amber-50",
|
|
100
|
+
border: "amber-200",
|
|
101
|
+
text: "amber-700",
|
|
102
|
+
icon: "amber-500"
|
|
103
|
+
},
|
|
104
|
+
info: {
|
|
105
|
+
bg: "sky-50",
|
|
106
|
+
border: "sky-200",
|
|
107
|
+
text: "sky-700",
|
|
108
|
+
icon: "sky-500"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.border = border;
|
|
113
|
+
Object.defineProperty(exports, "colors_exports", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function() {
|
|
116
|
+
return colors_exports;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
exports.focus = focus;
|
|
120
|
+
exports.interactive = interactive;
|
|
121
|
+
exports.surface = surface;
|
|
122
|
+
exports.text = text;
|
|
123
|
+
exports.tone = tone;
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=index68.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index68.cjs","names":[],"sources":["../src/ui-library/tokens/colors.ts"],"sourcesContent":["/**\n * DIWA Color Tokens\n *\n * Formalizes the color vocabulary identified in the Phase 9 audit.\n * These are string constants that map to Tailwind utility class fragments.\n *\n * Rules:\n * - All values are Tailwind class suffixes, not raw hex values.\n * - Brand primitives (brand-navy, brand-blue, brand-sky) are defined in\n * tailwind.config.js and are the single source of truth for hex values.\n * - Semantic palette (slate, rose, emerald, amber, sky) uses standard Tailwind.\n * - Do NOT introduce CSS custom properties here.\n * - Do NOT import this at runtime inside components yet — this file is the\n * reference foundation for future component customization.\n *\n * Usage (future):\n * import { focus, border } from '@/ui-library/tokens/colors';\n * className={`focus-visible:ring-2 focus-visible:ring-${focus.interactive}`}\n */\n\n// ── Interactive ───────────────────────────────────────────────────────────────\n// Primary interactive color. Used for buttons, links, active indicators.\n\nexport const interactive = {\n /** Core interactive — brand-blue (#034EA2) */\n default: 'brand-blue',\n /** Hover/deepen target — brand-navy (#00377B) */\n hover: 'brand-navy',\n /** Lighter accent — brand-sky (#2D8ACA) */\n accent: 'brand-sky',\n} as const;\n\n// ── Surface ───────────────────────────────────────────────────────────────────\n// Page and overlay background colors.\n\nexport const surface = {\n /**\n * Page background — registered in tailwind.config.js as 'surface-page' (#f4f6f9).\n * Use: bg-surface-page\n */\n page: 'surface-page',\n /**\n * All overlay backdrops (Modal, Dialog, Drawer).\n * Use: bg-brand-navy/50 backdrop-blur-sm\n */\n overlay: 'brand-navy/50',\n} as const;\n\n// ── Border ────────────────────────────────────────────────────────────────────\n\nexport const border = {\n /** Default border on inputs, cards, popovers — slate-200 */\n base: 'slate-200',\n /** Header/footer separator lines — slate-100 */\n separator: 'slate-100',\n} as const;\n\n// ── Text ──────────────────────────────────────────────────────────────────────\n\nexport const text = {\n /** Primary body text — slate-900 */\n body: 'slate-900',\n /** Secondary/label text — slate-500 */\n secondary: 'slate-500',\n /** Muted/placeholder text — slate-400 */\n muted: 'slate-400',\n /** Disabled text — slate-300 */\n disabled: 'slate-300',\n} as const;\n\n// ── Focus rings ───────────────────────────────────────────────────────────────\n// Full Tailwind class strings — used directly in className.\n// Three distinct levels:\n// field — focus-within on form field wrappers (lightest, /15)\n// default — keyboard focus on all interactive elements (/30)\n// danger — keyboard focus on destructive elements (rose-300)\n\nexport const focus = {\n /**\n * Field wrapper focus ring.\n * Applied via focus-within on Input/Select/Textarea wrappers.\n * Intentionally lighter than interactive focus — it's a containing ring.\n */\n field: 'focus-within:ring-2 focus-within:ring-brand-blue/15',\n\n /**\n * Standard interactive focus ring.\n * Applied via focus-visible on all buttons, links, and controls.\n * Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30\n */\n interactive: 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30',\n\n /**\n * Danger interactive focus ring.\n * Applied on destructive buttons.\n * Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300\n */\n danger: 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300',\n} as const;\n\n// ── Semantic tones ────────────────────────────────────────────────────────────\n// Documented here as the canonical DIWA tone vocabulary.\n// Not intended to be used directly — components own their own tone maps.\n\nexport const tone = {\n danger: { bg: 'rose-50', border: 'rose-200', text: 'rose-700', icon: 'rose-500' },\n success: { bg: 'emerald-50', border: 'emerald-200', text: 'emerald-700', icon: 'emerald-500' },\n warning: { bg: 'amber-50', border: 'amber-200', text: 'amber-700', icon: 'amber-500' },\n info: { bg: 'sky-50', border: 'sky-200', text: 'sky-700', icon: 'sky-500' },\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,cAAc;;CAEzB,SAAU;;CAEV,OAAU;;CAEV,QAAU;AACZ;AAKA,IAAa,UAAU;;;;;CAKrB,MAAU;;;;;CAKV,SAAU;AACZ;AAIA,IAAa,SAAS;;CAEpB,MAAY;;CAEZ,WAAY;AACd;AAIA,IAAa,OAAO;;CAElB,MAAY;;CAEZ,WAAY;;CAEZ,OAAY;;CAEZ,UAAY;AACd;AASA,IAAa,QAAQ;;;;;;CAMnB,OAAa;;;;;;CAOb,aAAa;;;;;;CAOb,QAAa;AACf;AAMA,IAAa,OAAO;CAClB,QAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,SAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,SAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,MAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;AAC/F"}
|
package/lib/index68.mjs
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { __exportAll } from "./index2.mjs";
|
|
2
|
+
//#region src/ui-library/tokens/colors.ts
|
|
3
|
+
var colors_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
border: () => border,
|
|
5
|
+
focus: () => focus,
|
|
6
|
+
interactive: () => interactive,
|
|
7
|
+
surface: () => surface,
|
|
8
|
+
text: () => text,
|
|
9
|
+
tone: () => tone
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* DIWA Color Tokens
|
|
13
|
+
*
|
|
14
|
+
* Formalizes the color vocabulary identified in the Phase 9 audit.
|
|
15
|
+
* These are string constants that map to Tailwind utility class fragments.
|
|
16
|
+
*
|
|
17
|
+
* Rules:
|
|
18
|
+
* - All values are Tailwind class suffixes, not raw hex values.
|
|
19
|
+
* - Brand primitives (brand-navy, brand-blue, brand-sky) are defined in
|
|
20
|
+
* tailwind.config.js and are the single source of truth for hex values.
|
|
21
|
+
* - Semantic palette (slate, rose, emerald, amber, sky) uses standard Tailwind.
|
|
22
|
+
* - Do NOT introduce CSS custom properties here.
|
|
23
|
+
* - Do NOT import this at runtime inside components yet — this file is the
|
|
24
|
+
* reference foundation for future component customization.
|
|
25
|
+
*
|
|
26
|
+
* Usage (future):
|
|
27
|
+
* import { focus, border } from '@/ui-library/tokens/colors';
|
|
28
|
+
* className={`focus-visible:ring-2 focus-visible:ring-${focus.interactive}`}
|
|
29
|
+
*/
|
|
30
|
+
var interactive = {
|
|
31
|
+
/** Core interactive — brand-blue (#034EA2) */
|
|
32
|
+
default: "brand-blue",
|
|
33
|
+
/** Hover/deepen target — brand-navy (#00377B) */
|
|
34
|
+
hover: "brand-navy",
|
|
35
|
+
/** Lighter accent — brand-sky (#2D8ACA) */
|
|
36
|
+
accent: "brand-sky"
|
|
37
|
+
};
|
|
38
|
+
var surface = {
|
|
39
|
+
/**
|
|
40
|
+
* Page background — registered in tailwind.config.js as 'surface-page' (#f4f6f9).
|
|
41
|
+
* Use: bg-surface-page
|
|
42
|
+
*/
|
|
43
|
+
page: "surface-page",
|
|
44
|
+
/**
|
|
45
|
+
* All overlay backdrops (Modal, Dialog, Drawer).
|
|
46
|
+
* Use: bg-brand-navy/50 backdrop-blur-sm
|
|
47
|
+
*/
|
|
48
|
+
overlay: "brand-navy/50"
|
|
49
|
+
};
|
|
50
|
+
var border = {
|
|
51
|
+
/** Default border on inputs, cards, popovers — slate-200 */
|
|
52
|
+
base: "slate-200",
|
|
53
|
+
/** Header/footer separator lines — slate-100 */
|
|
54
|
+
separator: "slate-100"
|
|
55
|
+
};
|
|
56
|
+
var text = {
|
|
57
|
+
/** Primary body text — slate-900 */
|
|
58
|
+
body: "slate-900",
|
|
59
|
+
/** Secondary/label text — slate-500 */
|
|
60
|
+
secondary: "slate-500",
|
|
61
|
+
/** Muted/placeholder text — slate-400 */
|
|
62
|
+
muted: "slate-400",
|
|
63
|
+
/** Disabled text — slate-300 */
|
|
64
|
+
disabled: "slate-300"
|
|
65
|
+
};
|
|
66
|
+
var focus = {
|
|
67
|
+
/**
|
|
68
|
+
* Field wrapper focus ring.
|
|
69
|
+
* Applied via focus-within on Input/Select/Textarea wrappers.
|
|
70
|
+
* Intentionally lighter than interactive focus — it's a containing ring.
|
|
71
|
+
*/
|
|
72
|
+
field: "focus-within:ring-2 focus-within:ring-brand-blue/15",
|
|
73
|
+
/**
|
|
74
|
+
* Standard interactive focus ring.
|
|
75
|
+
* Applied via focus-visible on all buttons, links, and controls.
|
|
76
|
+
* Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30
|
|
77
|
+
*/
|
|
78
|
+
interactive: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30",
|
|
79
|
+
/**
|
|
80
|
+
* Danger interactive focus ring.
|
|
81
|
+
* Applied on destructive buttons.
|
|
82
|
+
* Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300
|
|
83
|
+
*/
|
|
84
|
+
danger: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300"
|
|
85
|
+
};
|
|
86
|
+
var tone = {
|
|
87
|
+
danger: {
|
|
88
|
+
bg: "rose-50",
|
|
89
|
+
border: "rose-200",
|
|
90
|
+
text: "rose-700",
|
|
91
|
+
icon: "rose-500"
|
|
92
|
+
},
|
|
93
|
+
success: {
|
|
94
|
+
bg: "emerald-50",
|
|
95
|
+
border: "emerald-200",
|
|
96
|
+
text: "emerald-700",
|
|
97
|
+
icon: "emerald-500"
|
|
98
|
+
},
|
|
99
|
+
warning: {
|
|
100
|
+
bg: "amber-50",
|
|
101
|
+
border: "amber-200",
|
|
102
|
+
text: "amber-700",
|
|
103
|
+
icon: "amber-500"
|
|
104
|
+
},
|
|
105
|
+
info: {
|
|
106
|
+
bg: "sky-50",
|
|
107
|
+
border: "sky-200",
|
|
108
|
+
text: "sky-700",
|
|
109
|
+
icon: "sky-500"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { border, colors_exports, focus, interactive, surface, text, tone };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=index68.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index68.mjs","names":[],"sources":["../src/ui-library/tokens/colors.ts"],"sourcesContent":["/**\n * DIWA Color Tokens\n *\n * Formalizes the color vocabulary identified in the Phase 9 audit.\n * These are string constants that map to Tailwind utility class fragments.\n *\n * Rules:\n * - All values are Tailwind class suffixes, not raw hex values.\n * - Brand primitives (brand-navy, brand-blue, brand-sky) are defined in\n * tailwind.config.js and are the single source of truth for hex values.\n * - Semantic palette (slate, rose, emerald, amber, sky) uses standard Tailwind.\n * - Do NOT introduce CSS custom properties here.\n * - Do NOT import this at runtime inside components yet — this file is the\n * reference foundation for future component customization.\n *\n * Usage (future):\n * import { focus, border } from '@/ui-library/tokens/colors';\n * className={`focus-visible:ring-2 focus-visible:ring-${focus.interactive}`}\n */\n\n// ── Interactive ───────────────────────────────────────────────────────────────\n// Primary interactive color. Used for buttons, links, active indicators.\n\nexport const interactive = {\n /** Core interactive — brand-blue (#034EA2) */\n default: 'brand-blue',\n /** Hover/deepen target — brand-navy (#00377B) */\n hover: 'brand-navy',\n /** Lighter accent — brand-sky (#2D8ACA) */\n accent: 'brand-sky',\n} as const;\n\n// ── Surface ───────────────────────────────────────────────────────────────────\n// Page and overlay background colors.\n\nexport const surface = {\n /**\n * Page background — registered in tailwind.config.js as 'surface-page' (#f4f6f9).\n * Use: bg-surface-page\n */\n page: 'surface-page',\n /**\n * All overlay backdrops (Modal, Dialog, Drawer).\n * Use: bg-brand-navy/50 backdrop-blur-sm\n */\n overlay: 'brand-navy/50',\n} as const;\n\n// ── Border ────────────────────────────────────────────────────────────────────\n\nexport const border = {\n /** Default border on inputs, cards, popovers — slate-200 */\n base: 'slate-200',\n /** Header/footer separator lines — slate-100 */\n separator: 'slate-100',\n} as const;\n\n// ── Text ──────────────────────────────────────────────────────────────────────\n\nexport const text = {\n /** Primary body text — slate-900 */\n body: 'slate-900',\n /** Secondary/label text — slate-500 */\n secondary: 'slate-500',\n /** Muted/placeholder text — slate-400 */\n muted: 'slate-400',\n /** Disabled text — slate-300 */\n disabled: 'slate-300',\n} as const;\n\n// ── Focus rings ───────────────────────────────────────────────────────────────\n// Full Tailwind class strings — used directly in className.\n// Three distinct levels:\n// field — focus-within on form field wrappers (lightest, /15)\n// default — keyboard focus on all interactive elements (/30)\n// danger — keyboard focus on destructive elements (rose-300)\n\nexport const focus = {\n /**\n * Field wrapper focus ring.\n * Applied via focus-within on Input/Select/Textarea wrappers.\n * Intentionally lighter than interactive focus — it's a containing ring.\n */\n field: 'focus-within:ring-2 focus-within:ring-brand-blue/15',\n\n /**\n * Standard interactive focus ring.\n * Applied via focus-visible on all buttons, links, and controls.\n * Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30\n */\n interactive: 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30',\n\n /**\n * Danger interactive focus ring.\n * Applied on destructive buttons.\n * Use: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300\n */\n danger: 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-300',\n} as const;\n\n// ── Semantic tones ────────────────────────────────────────────────────────────\n// Documented here as the canonical DIWA tone vocabulary.\n// Not intended to be used directly — components own their own tone maps.\n\nexport const tone = {\n danger: { bg: 'rose-50', border: 'rose-200', text: 'rose-700', icon: 'rose-500' },\n success: { bg: 'emerald-50', border: 'emerald-200', text: 'emerald-700', icon: 'emerald-500' },\n warning: { bg: 'amber-50', border: 'amber-200', text: 'amber-700', icon: 'amber-500' },\n info: { bg: 'sky-50', border: 'sky-200', text: 'sky-700', icon: 'sky-500' },\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,cAAc;;CAEzB,SAAU;;CAEV,OAAU;;CAEV,QAAU;AACZ;AAKA,IAAa,UAAU;;;;;CAKrB,MAAU;;;;;CAKV,SAAU;AACZ;AAIA,IAAa,SAAS;;CAEpB,MAAY;;CAEZ,WAAY;AACd;AAIA,IAAa,OAAO;;CAElB,MAAY;;CAEZ,WAAY;;CAEZ,OAAY;;CAEZ,UAAY;AACd;AASA,IAAa,QAAQ;;;;;;CAMnB,OAAa;;;;;;CAOb,aAAa;;;;;;CAOb,QAAa;AACf;AAMA,IAAa,OAAO;CAClB,QAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,SAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,SAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;CAC7F,MAAS;EAAE,IAAI;EAAc,QAAQ;EAAe,MAAM;EAAe,MAAM;CAAc;AAC/F"}
|