@efiche/design 0.2.12 → 0.2.14
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 +0 -115
- package/dist/index.cjs +171 -434
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -77
- package/dist/index.d.ts +1 -77
- package/dist/index.js +171 -459
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -48,301 +48,17 @@ var useTheme = () => {
|
|
|
48
48
|
return ctx;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// src/components/Charts/LineChart.tsx
|
|
52
|
-
import { useEffect, useRef, useState as useState2 } from "react";
|
|
53
|
-
import {
|
|
54
|
-
LineChart as RechartsLineChart,
|
|
55
|
-
Line,
|
|
56
|
-
XAxis,
|
|
57
|
-
YAxis,
|
|
58
|
-
CartesianGrid,
|
|
59
|
-
Tooltip,
|
|
60
|
-
Legend
|
|
61
|
-
} from "recharts";
|
|
62
|
-
|
|
63
|
-
// src/components/Charts/chartUtils.ts
|
|
64
|
-
var CHART_COLORS = [
|
|
65
|
-
"#3b82f6",
|
|
66
|
-
// blue
|
|
67
|
-
"#22c55e",
|
|
68
|
-
// green
|
|
69
|
-
"#f59e0b",
|
|
70
|
-
// amber
|
|
71
|
-
"#ef4444",
|
|
72
|
-
// red
|
|
73
|
-
"#8b5cf6",
|
|
74
|
-
// violet
|
|
75
|
-
"#06b6d4",
|
|
76
|
-
// cyan
|
|
77
|
-
"#f97316",
|
|
78
|
-
// orange
|
|
79
|
-
"#ec4899"
|
|
80
|
-
// pink
|
|
81
|
-
];
|
|
82
|
-
function getChartTheme(theme) {
|
|
83
|
-
const isDark = theme === "dark";
|
|
84
|
-
return {
|
|
85
|
-
gridColor: isDark ? "#334155" : "#e2e8f0",
|
|
86
|
-
axisStroke: isDark ? "#94a3b8" : "#64748b",
|
|
87
|
-
axisTick: { fill: isDark ? "#94a3b8" : "#64748b", fontSize: 12 },
|
|
88
|
-
primaryColor: isDark ? "#60a5fa" : "#3b82f6",
|
|
89
|
-
tooltipStyle: {
|
|
90
|
-
backgroundColor: isDark ? "#1e293b" : "#ffffff",
|
|
91
|
-
border: `1px solid ${isDark ? "#334155" : "#e2e8f0"}`,
|
|
92
|
-
borderRadius: "6px",
|
|
93
|
-
color: isDark ? "#f1f5f9" : "#0f172a",
|
|
94
|
-
fontSize: "0.8125rem"
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// src/components/Charts/LineChart.tsx
|
|
100
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
101
|
-
var LineChart = ({
|
|
102
|
-
data,
|
|
103
|
-
xKey,
|
|
104
|
-
lines,
|
|
105
|
-
height = 250,
|
|
106
|
-
legend = false,
|
|
107
|
-
grid = true,
|
|
108
|
-
theme = "light",
|
|
109
|
-
className,
|
|
110
|
-
style
|
|
111
|
-
}) => {
|
|
112
|
-
const containerRef = useRef(null);
|
|
113
|
-
const [width, setWidth] = useState2(0);
|
|
114
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
if (!containerRef.current) return;
|
|
117
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
118
|
-
measure();
|
|
119
|
-
const ro = new ResizeObserver(measure);
|
|
120
|
-
ro.observe(containerRef.current);
|
|
121
|
-
return () => ro.disconnect();
|
|
122
|
-
}, []);
|
|
123
|
-
return /* @__PURE__ */ jsx2("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ jsxs(RechartsLineChart, { width, height, data, children: [
|
|
124
|
-
grid && /* @__PURE__ */ jsx2(CartesianGrid, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
125
|
-
/* @__PURE__ */ jsx2(XAxis, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
126
|
-
/* @__PURE__ */ jsx2(YAxis, { stroke: axisStroke, tick: axisTick }),
|
|
127
|
-
/* @__PURE__ */ jsx2(Tooltip, { contentStyle: tooltipStyle }),
|
|
128
|
-
legend && /* @__PURE__ */ jsx2(Legend, {}),
|
|
129
|
-
lines.map((line, i) => {
|
|
130
|
-
var _a, _b;
|
|
131
|
-
const color = (_a = line.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
132
|
-
return /* @__PURE__ */ jsx2(
|
|
133
|
-
Line,
|
|
134
|
-
{
|
|
135
|
-
type: "monotone",
|
|
136
|
-
dataKey: line.dataKey,
|
|
137
|
-
name: (_b = line.label) != null ? _b : line.dataKey,
|
|
138
|
-
stroke: color,
|
|
139
|
-
strokeWidth: 2,
|
|
140
|
-
dot: { fill: color, r: 4 },
|
|
141
|
-
activeDot: { r: 6 },
|
|
142
|
-
isAnimationActive: false
|
|
143
|
-
},
|
|
144
|
-
line.dataKey
|
|
145
|
-
);
|
|
146
|
-
})
|
|
147
|
-
] }) });
|
|
148
|
-
};
|
|
149
|
-
var LineChart_default = LineChart;
|
|
150
|
-
|
|
151
|
-
// src/components/Charts/BarChart.tsx
|
|
152
|
-
import { useEffect as useEffect2, useRef as useRef2, useState as useState3 } from "react";
|
|
153
|
-
import {
|
|
154
|
-
BarChart as RechartsBarChart,
|
|
155
|
-
Bar,
|
|
156
|
-
XAxis as XAxis2,
|
|
157
|
-
YAxis as YAxis2,
|
|
158
|
-
CartesianGrid as CartesianGrid2,
|
|
159
|
-
Tooltip as Tooltip2,
|
|
160
|
-
Legend as Legend2
|
|
161
|
-
} from "recharts";
|
|
162
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
163
|
-
var BarChart = ({
|
|
164
|
-
data,
|
|
165
|
-
xKey,
|
|
166
|
-
bars,
|
|
167
|
-
height = 250,
|
|
168
|
-
legend = false,
|
|
169
|
-
grid = true,
|
|
170
|
-
theme = "light",
|
|
171
|
-
className,
|
|
172
|
-
style
|
|
173
|
-
}) => {
|
|
174
|
-
const containerRef = useRef2(null);
|
|
175
|
-
const [width, setWidth] = useState3(0);
|
|
176
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
177
|
-
useEffect2(() => {
|
|
178
|
-
if (!containerRef.current) return;
|
|
179
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
180
|
-
measure();
|
|
181
|
-
const ro = new ResizeObserver(measure);
|
|
182
|
-
ro.observe(containerRef.current);
|
|
183
|
-
return () => ro.disconnect();
|
|
184
|
-
}, []);
|
|
185
|
-
return /* @__PURE__ */ jsx3("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ jsxs2(RechartsBarChart, { width, height, data, children: [
|
|
186
|
-
grid && /* @__PURE__ */ jsx3(CartesianGrid2, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
187
|
-
/* @__PURE__ */ jsx3(XAxis2, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
188
|
-
/* @__PURE__ */ jsx3(YAxis2, { stroke: axisStroke, tick: axisTick }),
|
|
189
|
-
/* @__PURE__ */ jsx3(Tooltip2, { contentStyle: tooltipStyle }),
|
|
190
|
-
legend && /* @__PURE__ */ jsx3(Legend2, {}),
|
|
191
|
-
bars.map((bar, i) => {
|
|
192
|
-
var _a, _b;
|
|
193
|
-
const color = (_a = bar.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
194
|
-
const isLast = i === bars.length - 1;
|
|
195
|
-
return /* @__PURE__ */ jsx3(
|
|
196
|
-
Bar,
|
|
197
|
-
{
|
|
198
|
-
dataKey: bar.dataKey,
|
|
199
|
-
name: (_b = bar.label) != null ? _b : bar.dataKey,
|
|
200
|
-
fill: color,
|
|
201
|
-
stackId: bar.stackId,
|
|
202
|
-
radius: bar.stackId && !isLast ? [0, 0, 0, 0] : [4, 4, 0, 0],
|
|
203
|
-
isAnimationActive: false
|
|
204
|
-
},
|
|
205
|
-
bar.dataKey
|
|
206
|
-
);
|
|
207
|
-
})
|
|
208
|
-
] }) });
|
|
209
|
-
};
|
|
210
|
-
var BarChart_default = BarChart;
|
|
211
|
-
|
|
212
|
-
// src/components/Charts/AreaChart.tsx
|
|
213
|
-
import { useEffect as useEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
214
|
-
import {
|
|
215
|
-
AreaChart as RechartsAreaChart,
|
|
216
|
-
Area,
|
|
217
|
-
XAxis as XAxis3,
|
|
218
|
-
YAxis as YAxis3,
|
|
219
|
-
CartesianGrid as CartesianGrid3,
|
|
220
|
-
Tooltip as Tooltip3,
|
|
221
|
-
Legend as Legend3
|
|
222
|
-
} from "recharts";
|
|
223
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
224
|
-
var AreaChart = ({
|
|
225
|
-
data,
|
|
226
|
-
xKey,
|
|
227
|
-
areas,
|
|
228
|
-
height = 250,
|
|
229
|
-
legend = false,
|
|
230
|
-
grid = true,
|
|
231
|
-
theme = "light",
|
|
232
|
-
className,
|
|
233
|
-
style
|
|
234
|
-
}) => {
|
|
235
|
-
const containerRef = useRef3(null);
|
|
236
|
-
const [width, setWidth] = useState4(0);
|
|
237
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
238
|
-
useEffect3(() => {
|
|
239
|
-
if (!containerRef.current) return;
|
|
240
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
241
|
-
measure();
|
|
242
|
-
const ro = new ResizeObserver(measure);
|
|
243
|
-
ro.observe(containerRef.current);
|
|
244
|
-
return () => ro.disconnect();
|
|
245
|
-
}, []);
|
|
246
|
-
return /* @__PURE__ */ jsx4("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ jsxs3(RechartsAreaChart, { width, height, data, children: [
|
|
247
|
-
grid && /* @__PURE__ */ jsx4(CartesianGrid3, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
248
|
-
/* @__PURE__ */ jsx4(XAxis3, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
249
|
-
/* @__PURE__ */ jsx4(YAxis3, { stroke: axisStroke, tick: axisTick }),
|
|
250
|
-
/* @__PURE__ */ jsx4(Tooltip3, { contentStyle: tooltipStyle }),
|
|
251
|
-
legend && /* @__PURE__ */ jsx4(Legend3, {}),
|
|
252
|
-
areas.map((area, i) => {
|
|
253
|
-
var _a, _b, _c;
|
|
254
|
-
const color = (_a = area.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
255
|
-
const opacity = (_b = area.fillOpacity) != null ? _b : area.stackId ? 0.4 : 0.15;
|
|
256
|
-
return /* @__PURE__ */ jsx4(
|
|
257
|
-
Area,
|
|
258
|
-
{
|
|
259
|
-
type: "monotone",
|
|
260
|
-
dataKey: area.dataKey,
|
|
261
|
-
name: (_c = area.label) != null ? _c : area.dataKey,
|
|
262
|
-
stroke: color,
|
|
263
|
-
fill: color,
|
|
264
|
-
fillOpacity: opacity,
|
|
265
|
-
strokeWidth: 2,
|
|
266
|
-
stackId: area.stackId,
|
|
267
|
-
isAnimationActive: false
|
|
268
|
-
},
|
|
269
|
-
area.dataKey
|
|
270
|
-
);
|
|
271
|
-
})
|
|
272
|
-
] }) });
|
|
273
|
-
};
|
|
274
|
-
var AreaChart_default = AreaChart;
|
|
275
|
-
|
|
276
|
-
// src/components/Charts/PieChart.tsx
|
|
277
|
-
import { useEffect as useEffect4, useRef as useRef4, useState as useState5 } from "react";
|
|
278
|
-
import {
|
|
279
|
-
PieChart as RechartsPieChart,
|
|
280
|
-
Pie,
|
|
281
|
-
Tooltip as Tooltip4,
|
|
282
|
-
Legend as Legend4
|
|
283
|
-
} from "recharts";
|
|
284
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
285
|
-
var PieChart = ({
|
|
286
|
-
data,
|
|
287
|
-
height = 250,
|
|
288
|
-
donut = false,
|
|
289
|
-
legend = false,
|
|
290
|
-
label = false,
|
|
291
|
-
theme = "light",
|
|
292
|
-
className,
|
|
293
|
-
style
|
|
294
|
-
}) => {
|
|
295
|
-
const containerRef = useRef4(null);
|
|
296
|
-
const [width, setWidth] = useState5(0);
|
|
297
|
-
const { tooltipStyle } = getChartTheme(theme);
|
|
298
|
-
useEffect4(() => {
|
|
299
|
-
if (!containerRef.current) return;
|
|
300
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
301
|
-
measure();
|
|
302
|
-
const ro = new ResizeObserver(measure);
|
|
303
|
-
ro.observe(containerRef.current);
|
|
304
|
-
return () => ro.disconnect();
|
|
305
|
-
}, []);
|
|
306
|
-
const dataWithColors = data.map((item, i) => {
|
|
307
|
-
var _a;
|
|
308
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
309
|
-
fill: (_a = item.fill) != null ? _a : CHART_COLORS[i % CHART_COLORS.length]
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
const outerRadius = 90;
|
|
313
|
-
const innerRadius = donut ? 55 : 0;
|
|
314
|
-
return /* @__PURE__ */ jsx5("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ jsxs4(RechartsPieChart, { width, height, children: [
|
|
315
|
-
/* @__PURE__ */ jsx5(
|
|
316
|
-
Pie,
|
|
317
|
-
{
|
|
318
|
-
data: dataWithColors,
|
|
319
|
-
cx: "50%",
|
|
320
|
-
cy: "50%",
|
|
321
|
-
outerRadius,
|
|
322
|
-
innerRadius,
|
|
323
|
-
dataKey: "value",
|
|
324
|
-
label: label ? ({ name, percent }) => `${name} ${((percent != null ? percent : 0) * 100).toFixed(0)}%` : void 0,
|
|
325
|
-
labelLine: label,
|
|
326
|
-
isAnimationActive: false
|
|
327
|
-
}
|
|
328
|
-
),
|
|
329
|
-
/* @__PURE__ */ jsx5(Tooltip4, { contentStyle: tooltipStyle }),
|
|
330
|
-
legend && /* @__PURE__ */ jsx5(Legend4, {})
|
|
331
|
-
] }) });
|
|
332
|
-
};
|
|
333
|
-
var PieChart_default = PieChart;
|
|
334
|
-
|
|
335
51
|
// src/components/Accordion/Accordion.tsx
|
|
336
|
-
import { useState as
|
|
52
|
+
import { useState as useState2 } from "react";
|
|
337
53
|
import { ChevronDown } from "lucide-react";
|
|
338
|
-
import { jsx as
|
|
54
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
339
55
|
var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
340
|
-
const [open, setOpen] =
|
|
56
|
+
const [open, setOpen] = useState2(() => {
|
|
341
57
|
if (!defaultValue) return /* @__PURE__ */ new Set();
|
|
342
58
|
if (Array.isArray(defaultValue)) return new Set(defaultValue);
|
|
343
59
|
return /* @__PURE__ */ new Set([defaultValue]);
|
|
344
60
|
});
|
|
345
|
-
const [hovered, setHovered] =
|
|
61
|
+
const [hovered, setHovered] = useState2(null);
|
|
346
62
|
const toggle = (value) => {
|
|
347
63
|
setOpen((prev) => {
|
|
348
64
|
const next = new Set(prev);
|
|
@@ -355,7 +71,7 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
355
71
|
return next;
|
|
356
72
|
});
|
|
357
73
|
};
|
|
358
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ jsx2("div", { style: {
|
|
359
75
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
360
76
|
borderRadius: "0.5rem",
|
|
361
77
|
overflow: "hidden"
|
|
@@ -363,14 +79,14 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
363
79
|
const isOpen = open.has(item.value);
|
|
364
80
|
const isHovered = hovered === item.value;
|
|
365
81
|
const isLast = index === items.length - 1;
|
|
366
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
367
83
|
"div",
|
|
368
84
|
{
|
|
369
85
|
style: {
|
|
370
86
|
borderBottom: isLast ? "none" : "1px solid var(--ds-border, #e2e8f0)"
|
|
371
87
|
},
|
|
372
88
|
children: [
|
|
373
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ jsxs(
|
|
374
90
|
"button",
|
|
375
91
|
{
|
|
376
92
|
style: {
|
|
@@ -393,8 +109,8 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
393
109
|
onMouseLeave: () => setHovered(null),
|
|
394
110
|
"aria-expanded": isOpen,
|
|
395
111
|
children: [
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ jsx2("span", { children: item.trigger }),
|
|
113
|
+
/* @__PURE__ */ jsx2(
|
|
398
114
|
ChevronDown,
|
|
399
115
|
{
|
|
400
116
|
size: 16,
|
|
@@ -409,11 +125,11 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
409
125
|
]
|
|
410
126
|
}
|
|
411
127
|
),
|
|
412
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ jsx2("div", { style: {
|
|
413
129
|
maxHeight: isOpen ? "300px" : "0",
|
|
414
130
|
overflow: "hidden",
|
|
415
131
|
transition: "max-height 0.25s ease"
|
|
416
|
-
}, children: /* @__PURE__ */
|
|
132
|
+
}, children: /* @__PURE__ */ jsx2("div", { style: {
|
|
417
133
|
padding: "0 1rem 1rem",
|
|
418
134
|
fontSize: "0.875rem",
|
|
419
135
|
color: "var(--ds-text-secondary, #64748b)"
|
|
@@ -428,7 +144,7 @@ var Accordion_default = Accordion;
|
|
|
428
144
|
|
|
429
145
|
// src/components/Alert/Alert.tsx
|
|
430
146
|
import { Info, CheckCircle2, AlertTriangle, AlertCircle } from "lucide-react";
|
|
431
|
-
import { jsx as
|
|
147
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
432
148
|
var variantMap = {
|
|
433
149
|
info: { bg: "var(--ds-info-bg, #eff6ff)", border: "var(--ds-info, #3b82f6)", icon: "var(--ds-info, #3b82f6)", title: "var(--ds-info-title, #1e3a8a)", desc: "var(--ds-info-desc, #1e40af)" },
|
|
434
150
|
success: { bg: "var(--ds-success-bg, #f0fdf4)", border: "var(--ds-success, #22c55e)", icon: "var(--ds-success, #22c55e)", title: "var(--ds-success-title, #14532d)", desc: "var(--ds-success-desc, #166534)" },
|
|
@@ -436,14 +152,14 @@ var variantMap = {
|
|
|
436
152
|
danger: { bg: "var(--ds-danger-bg, #fef2f2)", border: "var(--ds-danger, #ef4444)", icon: "var(--ds-danger, #ef4444)", title: "var(--ds-danger-title, #7f1d1d)", desc: "var(--ds-danger-desc, #991b1b)" }
|
|
437
153
|
};
|
|
438
154
|
var icons = {
|
|
439
|
-
info: /* @__PURE__ */
|
|
440
|
-
success: /* @__PURE__ */
|
|
441
|
-
warning: /* @__PURE__ */
|
|
442
|
-
danger: /* @__PURE__ */
|
|
155
|
+
info: /* @__PURE__ */ jsx3(Info, { size: 16 }),
|
|
156
|
+
success: /* @__PURE__ */ jsx3(CheckCircle2, { size: 16 }),
|
|
157
|
+
warning: /* @__PURE__ */ jsx3(AlertTriangle, { size: 16 }),
|
|
158
|
+
danger: /* @__PURE__ */ jsx3(AlertCircle, { size: 16 })
|
|
443
159
|
};
|
|
444
160
|
var Alert = ({ variant = "info", title, description }) => {
|
|
445
161
|
const v = variantMap[variant];
|
|
446
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ jsxs2("div", { role: "alert", style: {
|
|
447
163
|
display: "flex",
|
|
448
164
|
gap: "0.75rem",
|
|
449
165
|
padding: "1rem",
|
|
@@ -451,23 +167,23 @@ var Alert = ({ variant = "info", title, description }) => {
|
|
|
451
167
|
borderLeft: `4px solid ${v.border}`,
|
|
452
168
|
backgroundColor: v.bg
|
|
453
169
|
}, children: [
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ jsx3("span", { style: { flexShrink: 0, marginTop: "0.125rem", color: v.icon }, children: icons[variant] }),
|
|
171
|
+
/* @__PURE__ */ jsxs2("div", { style: { flex: 1 }, children: [
|
|
172
|
+
/* @__PURE__ */ jsx3("p", { style: { fontWeight: 600, fontSize: "0.875rem", marginBottom: "0.25rem", marginTop: 0, color: v.title }, children: title }),
|
|
173
|
+
/* @__PURE__ */ jsx3("p", { style: { fontSize: "0.875rem", margin: 0, color: v.desc }, children: description })
|
|
458
174
|
] })
|
|
459
175
|
] });
|
|
460
176
|
};
|
|
461
177
|
var Alert_default = Alert;
|
|
462
178
|
|
|
463
179
|
// src/components/Avatar/Avatar.tsx
|
|
464
|
-
import { jsx as
|
|
180
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
465
181
|
var sizeMap = {
|
|
466
182
|
sm: { width: "2rem", height: "2rem", fontSize: "0.625rem" },
|
|
467
183
|
md: { width: "2.5rem", height: "2.5rem", fontSize: "0.875rem" },
|
|
468
184
|
lg: { width: "4rem", height: "4rem", fontSize: "1.25rem" }
|
|
469
185
|
};
|
|
470
|
-
var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */
|
|
186
|
+
var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */ jsx4(
|
|
471
187
|
"div",
|
|
472
188
|
{
|
|
473
189
|
className,
|
|
@@ -489,7 +205,7 @@ var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */ js
|
|
|
489
205
|
var Avatar_default = Avatar;
|
|
490
206
|
|
|
491
207
|
// src/components/Badge/Badge.tsx
|
|
492
|
-
import { jsx as
|
|
208
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
493
209
|
var variantMap2 = {
|
|
494
210
|
default: { backgroundColor: "var(--ds-primary, #3b82f6)", color: "#fff" },
|
|
495
211
|
secondary: { backgroundColor: "var(--ds-muted, #f1f5f9)", color: "var(--ds-text-secondary, #64748b)" },
|
|
@@ -504,7 +220,7 @@ var sizeMap2 = {
|
|
|
504
220
|
md: { padding: "0.25rem 0.625rem", fontSize: "0.75rem" },
|
|
505
221
|
lg: { padding: "0.375rem 0.875rem", fontSize: "0.875rem" }
|
|
506
222
|
};
|
|
507
|
-
var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PURE__ */
|
|
223
|
+
var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PURE__ */ jsx5("span", { style: __spreadValues(__spreadValues(__spreadValues({
|
|
508
224
|
display: "inline-flex",
|
|
509
225
|
alignItems: "center",
|
|
510
226
|
gap: "0.25rem",
|
|
@@ -515,12 +231,12 @@ var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PUR
|
|
|
515
231
|
var Badge_default = Badge;
|
|
516
232
|
|
|
517
233
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
518
|
-
import { useState as
|
|
234
|
+
import { useState as useState3 } from "react";
|
|
519
235
|
import { ChevronRight } from "lucide-react";
|
|
520
|
-
import { jsx as
|
|
236
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
521
237
|
var Breadcrumb = ({ items }) => {
|
|
522
|
-
const [hovered, setHovered] =
|
|
523
|
-
return /* @__PURE__ */
|
|
238
|
+
const [hovered, setHovered] = useState3(null);
|
|
239
|
+
return /* @__PURE__ */ jsx6("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx6("ol", { style: {
|
|
524
240
|
display: "flex",
|
|
525
241
|
flexWrap: "wrap",
|
|
526
242
|
alignItems: "center",
|
|
@@ -531,8 +247,8 @@ var Breadcrumb = ({ items }) => {
|
|
|
531
247
|
}, children: items.map((item, i) => {
|
|
532
248
|
const isLast = i === items.length - 1;
|
|
533
249
|
const isHovered = hovered === item.label;
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
i > 0 && /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ jsxs3("li", { style: { display: "flex", alignItems: "center" }, children: [
|
|
251
|
+
i > 0 && /* @__PURE__ */ jsx6(
|
|
536
252
|
ChevronRight,
|
|
537
253
|
{
|
|
538
254
|
size: 14,
|
|
@@ -540,11 +256,11 @@ var Breadcrumb = ({ items }) => {
|
|
|
540
256
|
style: { color: "var(--ds-text-secondary, #64748b)", margin: "0 0.25rem", flexShrink: 0 }
|
|
541
257
|
}
|
|
542
258
|
),
|
|
543
|
-
isLast || !item.href ? /* @__PURE__ */
|
|
259
|
+
isLast || !item.href ? /* @__PURE__ */ jsx6("span", { style: {
|
|
544
260
|
color: isLast ? "var(--ds-text-primary, #0f172a)" : "var(--ds-text-secondary, #64748b)",
|
|
545
261
|
fontWeight: isLast ? 500 : void 0,
|
|
546
262
|
cursor: isLast ? "default" : void 0
|
|
547
|
-
}, children: item.label }) : /* @__PURE__ */
|
|
263
|
+
}, children: item.label }) : /* @__PURE__ */ jsx6(
|
|
548
264
|
"a",
|
|
549
265
|
{
|
|
550
266
|
href: item.href,
|
|
@@ -565,8 +281,8 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
565
281
|
|
|
566
282
|
// src/components/Button/Button.tsx
|
|
567
283
|
import { LoaderCircle } from "lucide-react";
|
|
568
|
-
import { useState as
|
|
569
|
-
import { Fragment, jsx as
|
|
284
|
+
import { useState as useState4 } from "react";
|
|
285
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
570
286
|
var variantStyles = {
|
|
571
287
|
solid: { backgroundColor: "var(--ds-primary, #3b82f6)", color: "#fff", borderColor: "transparent" },
|
|
572
288
|
outline: { backgroundColor: "transparent", color: "var(--ds-primary, #3b82f6)", borderColor: "var(--ds-primary, #3b82f6)" },
|
|
@@ -628,7 +344,7 @@ var Button = (_a) => {
|
|
|
628
344
|
"size",
|
|
629
345
|
"style"
|
|
630
346
|
]);
|
|
631
|
-
const [hovered, setHovered] =
|
|
347
|
+
const [hovered, setHovered] = useState4(false);
|
|
632
348
|
const resolvedVariant = variant != null ? variant : danger ? "danger" : warning ? "warning" : info ? "info" : success ? "success" : ghost ? "ghost" : outline ? "outline" : "solid";
|
|
633
349
|
const resolvedSize = size != null ? size : small ? "sm" : large ? "lg" : "md";
|
|
634
350
|
const isDisabled = disabled || loading;
|
|
@@ -646,9 +362,9 @@ var Button = (_a) => {
|
|
|
646
362
|
opacity: isDisabled ? 0.5 : 1,
|
|
647
363
|
pointerEvents: loading ? "none" : void 0
|
|
648
364
|
}, variantStyles[resolvedVariant]), sizeStyles[resolvedSize]), hovered && !isDisabled ? variantHoverStyles[resolvedVariant] : {}), styleProp);
|
|
649
|
-
return /* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
366
|
+
/* @__PURE__ */ jsx7("style", { href: "ds-spin", precedence: "low", children: `@keyframes ds-spin { to { transform: rotate(360deg); } }` }),
|
|
367
|
+
/* @__PURE__ */ jsxs4(
|
|
652
368
|
"button",
|
|
653
369
|
__spreadProps(__spreadValues({
|
|
654
370
|
disabled: isDisabled,
|
|
@@ -657,7 +373,7 @@ var Button = (_a) => {
|
|
|
657
373
|
onMouseLeave: () => setHovered(false)
|
|
658
374
|
}, props), {
|
|
659
375
|
children: [
|
|
660
|
-
loading ? /* @__PURE__ */
|
|
376
|
+
loading ? /* @__PURE__ */ jsx7(
|
|
661
377
|
LoaderCircle,
|
|
662
378
|
{
|
|
663
379
|
"aria-hidden": true,
|
|
@@ -675,10 +391,10 @@ var Button = (_a) => {
|
|
|
675
391
|
var Button_default = Button;
|
|
676
392
|
|
|
677
393
|
// src/components/Card/Card.tsx
|
|
678
|
-
import { jsx as
|
|
394
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
679
395
|
var Card = (_a) => {
|
|
680
396
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
681
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsx8("div", __spreadValues({ style: __spreadValues({
|
|
682
398
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
683
399
|
borderRadius: "0.5rem",
|
|
684
400
|
backgroundColor: "var(--ds-card, #ffffff)"
|
|
@@ -686,7 +402,7 @@ var Card = (_a) => {
|
|
|
686
402
|
};
|
|
687
403
|
var CardHeader = (_a) => {
|
|
688
404
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
689
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ jsx8("div", __spreadValues({ style: __spreadValues({
|
|
690
406
|
display: "flex",
|
|
691
407
|
flexDirection: "column",
|
|
692
408
|
gap: "0.375rem",
|
|
@@ -695,7 +411,7 @@ var CardHeader = (_a) => {
|
|
|
695
411
|
};
|
|
696
412
|
var CardTitle = (_a) => {
|
|
697
413
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
698
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ jsx8("h3", __spreadValues({ style: __spreadValues({
|
|
699
415
|
fontSize: "1rem",
|
|
700
416
|
fontWeight: 600,
|
|
701
417
|
color: "var(--ds-text-primary, #0f172a)",
|
|
@@ -705,7 +421,7 @@ var CardTitle = (_a) => {
|
|
|
705
421
|
};
|
|
706
422
|
var CardDescription = (_a) => {
|
|
707
423
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
708
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ jsx8("p", __spreadValues({ style: __spreadValues({
|
|
709
425
|
fontSize: "0.875rem",
|
|
710
426
|
color: "var(--ds-text-secondary, #64748b)",
|
|
711
427
|
margin: 0
|
|
@@ -713,11 +429,11 @@ var CardDescription = (_a) => {
|
|
|
713
429
|
};
|
|
714
430
|
var CardContent = (_a) => {
|
|
715
431
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
716
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ jsx8("div", __spreadValues({ style: __spreadValues({ padding: "1.5rem" }, style) }, props));
|
|
717
433
|
};
|
|
718
434
|
var CardFooter = (_a) => {
|
|
719
435
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
720
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ jsx8("div", __spreadValues({ style: __spreadValues({
|
|
721
437
|
display: "flex",
|
|
722
438
|
alignItems: "center",
|
|
723
439
|
padding: "0 1.5rem 1.5rem"
|
|
@@ -725,8 +441,8 @@ var CardFooter = (_a) => {
|
|
|
725
441
|
};
|
|
726
442
|
|
|
727
443
|
// src/components/Checkbox/Checkbox.tsx
|
|
728
|
-
import { useState as
|
|
729
|
-
import { jsx as
|
|
444
|
+
import { useState as useState5 } from "react";
|
|
445
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
730
446
|
var Checkbox = ({
|
|
731
447
|
label,
|
|
732
448
|
checked,
|
|
@@ -735,7 +451,7 @@ var Checkbox = ({
|
|
|
735
451
|
id,
|
|
736
452
|
onChange
|
|
737
453
|
}) => {
|
|
738
|
-
const [internal, setInternal] =
|
|
454
|
+
const [internal, setInternal] = useState5(defaultChecked);
|
|
739
455
|
const isChecked = checked !== void 0 ? checked : internal;
|
|
740
456
|
const handleChange = () => {
|
|
741
457
|
if (disabled) return;
|
|
@@ -743,7 +459,7 @@ var Checkbox = ({
|
|
|
743
459
|
setInternal(next);
|
|
744
460
|
onChange == null ? void 0 : onChange(next);
|
|
745
461
|
};
|
|
746
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsxs5("label", { htmlFor: id, style: {
|
|
747
463
|
display: "inline-flex",
|
|
748
464
|
alignItems: "center",
|
|
749
465
|
gap: "0.5rem",
|
|
@@ -751,7 +467,7 @@ var Checkbox = ({
|
|
|
751
467
|
userSelect: "none",
|
|
752
468
|
opacity: disabled ? 0.5 : 1
|
|
753
469
|
}, children: [
|
|
754
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ jsx9(
|
|
755
471
|
"input",
|
|
756
472
|
{
|
|
757
473
|
type: "checkbox",
|
|
@@ -762,7 +478,7 @@ var Checkbox = ({
|
|
|
762
478
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
763
479
|
}
|
|
764
480
|
),
|
|
765
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ jsx9("span", { style: {
|
|
766
482
|
width: "1.125rem",
|
|
767
483
|
height: "1.125rem",
|
|
768
484
|
border: `2px solid ${isChecked ? "var(--ds-primary, #3b82f6)" : "var(--ds-border, #e2e8f0)"}`,
|
|
@@ -773,25 +489,25 @@ var Checkbox = ({
|
|
|
773
489
|
flexShrink: 0,
|
|
774
490
|
transition: "background-color 0.15s, border-color 0.15s",
|
|
775
491
|
backgroundColor: isChecked ? "var(--ds-primary, #3b82f6)" : "var(--ds-card, #fff)"
|
|
776
|
-
}, children: isChecked && /* @__PURE__ */
|
|
777
|
-
label && /* @__PURE__ */
|
|
492
|
+
}, children: isChecked && /* @__PURE__ */ jsx9("svg", { viewBox: "0 0 12 10", fill: "none", style: { width: "0.625rem", height: "0.625rem" }, children: /* @__PURE__ */ jsx9("path", { d: "M1 5l3.5 3.5L11 1", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
493
|
+
label && /* @__PURE__ */ jsx9("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: label })
|
|
778
494
|
] });
|
|
779
495
|
};
|
|
780
496
|
var Checkbox_default = Checkbox;
|
|
781
497
|
|
|
782
498
|
// src/components/CopyButton/CopyButton.tsx
|
|
783
499
|
import { Check, Copy } from "lucide-react";
|
|
784
|
-
import { useState as
|
|
785
|
-
import { jsx as
|
|
500
|
+
import { useState as useState6 } from "react";
|
|
501
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
786
502
|
var CopyButton = ({ text }) => {
|
|
787
|
-
const [copied, setCopied] =
|
|
788
|
-
const [hovered, setHovered] =
|
|
503
|
+
const [copied, setCopied] = useState6(false);
|
|
504
|
+
const [hovered, setHovered] = useState6(false);
|
|
789
505
|
const handleCopy = () => {
|
|
790
506
|
navigator.clipboard.writeText(text);
|
|
791
507
|
setCopied(true);
|
|
792
508
|
setTimeout(() => setCopied(false), 2e3);
|
|
793
509
|
};
|
|
794
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ jsx10(
|
|
795
511
|
"button",
|
|
796
512
|
{
|
|
797
513
|
onClick: handleCopy,
|
|
@@ -810,7 +526,7 @@ var CopyButton = ({ text }) => {
|
|
|
810
526
|
cursor: "pointer",
|
|
811
527
|
transition: "background-color 0.15s, color 0.15s"
|
|
812
528
|
},
|
|
813
|
-
children: copied ? /* @__PURE__ */
|
|
529
|
+
children: copied ? /* @__PURE__ */ jsx10(Check, { style: { width: "1rem", height: "1rem" } }) : /* @__PURE__ */ jsx10(Copy, { style: { width: "1rem", height: "1rem" } })
|
|
814
530
|
}
|
|
815
531
|
);
|
|
816
532
|
};
|
|
@@ -818,19 +534,19 @@ var CopyButton_default = CopyButton;
|
|
|
818
534
|
|
|
819
535
|
// src/components/FileUpload/FileUpload.tsx
|
|
820
536
|
import { Upload } from "lucide-react";
|
|
821
|
-
import { useRef
|
|
822
|
-
import { jsx as
|
|
537
|
+
import { useRef, useState as useState7 } from "react";
|
|
538
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
823
539
|
var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
824
|
-
const [isDragging, setIsDragging] =
|
|
825
|
-
const [isHovered, setIsHovered] =
|
|
826
|
-
const [fileNames, setFileNames] =
|
|
827
|
-
const inputRef =
|
|
540
|
+
const [isDragging, setIsDragging] = useState7(false);
|
|
541
|
+
const [isHovered, setIsHovered] = useState7(false);
|
|
542
|
+
const [fileNames, setFileNames] = useState7([]);
|
|
543
|
+
const inputRef = useRef(null);
|
|
828
544
|
const handleFiles = (list) => {
|
|
829
545
|
setFileNames(Array.from(list).map((f) => f.name));
|
|
830
546
|
onFileSelect == null ? void 0 : onFileSelect(list);
|
|
831
547
|
};
|
|
832
548
|
const isActive = isDragging || isHovered;
|
|
833
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ jsxs6(
|
|
834
550
|
"div",
|
|
835
551
|
{
|
|
836
552
|
onClick: () => {
|
|
@@ -864,7 +580,7 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
864
580
|
opacity: disabled ? 0.5 : 1
|
|
865
581
|
},
|
|
866
582
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ jsx11(
|
|
868
584
|
"input",
|
|
869
585
|
{
|
|
870
586
|
ref: inputRef,
|
|
@@ -876,9 +592,9 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
876
592
|
onChange: (e) => e.target.files && handleFiles(e.target.files)
|
|
877
593
|
}
|
|
878
594
|
),
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
fileNames.length > 0 ? /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ jsx11(Upload, { size: 32, style: { color: "var(--ds-text-secondary, #64748b)" } }),
|
|
596
|
+
fileNames.length > 0 ? /* @__PURE__ */ jsx11("p", { style: { fontSize: "0.875rem", color: "var(--ds-primary, #3b82f6)", fontWeight: 500, margin: 0 }, children: fileNames.join(", ") }) : /* @__PURE__ */ jsxs6("p", { style: { fontSize: "0.875rem", color: "var(--ds-text-secondary, #64748b)", margin: 0 }, children: [
|
|
597
|
+
/* @__PURE__ */ jsx11("strong", { children: "Click to upload" }),
|
|
882
598
|
" or drag and drop"
|
|
883
599
|
] })
|
|
884
600
|
]
|
|
@@ -888,7 +604,7 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
888
604
|
var FileUpload_default = FileUpload;
|
|
889
605
|
|
|
890
606
|
// src/components/Input/Input.tsx
|
|
891
|
-
import { Fragment as Fragment2, jsx as
|
|
607
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
892
608
|
var inputCSS = `
|
|
893
609
|
[data-ds-input]::placeholder { color: var(--ds-text-secondary, #64748b); }
|
|
894
610
|
[data-ds-input]:focus { outline: none; border-color: var(--ds-primary, #3b82f6); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }
|
|
@@ -898,10 +614,10 @@ var inputCSS = `
|
|
|
898
614
|
`;
|
|
899
615
|
var Input = (_a) => {
|
|
900
616
|
var _b = _a, { error, success, leftIcon, rightIcon, style } = _b, props = __objRest(_b, ["error", "success", "leftIcon", "rightIcon", "style"]);
|
|
901
|
-
return /* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
leftIcon && /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
618
|
+
/* @__PURE__ */ jsx12("style", { href: "ds-input", precedence: "low", children: inputCSS }),
|
|
619
|
+
/* @__PURE__ */ jsxs7("div", { style: { position: "relative", display: "flex", alignItems: "center", width: "100%" }, children: [
|
|
620
|
+
leftIcon && /* @__PURE__ */ jsx12("span", { style: {
|
|
905
621
|
position: "absolute",
|
|
906
622
|
left: "0.625rem",
|
|
907
623
|
display: "flex",
|
|
@@ -909,7 +625,7 @@ var Input = (_a) => {
|
|
|
909
625
|
color: "var(--ds-text-secondary, #64748b)",
|
|
910
626
|
pointerEvents: "none"
|
|
911
627
|
}, children: leftIcon }),
|
|
912
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsx12(
|
|
913
629
|
"input",
|
|
914
630
|
__spreadValues({
|
|
915
631
|
"data-ds-input": "",
|
|
@@ -932,7 +648,7 @@ var Input = (_a) => {
|
|
|
932
648
|
}, style)
|
|
933
649
|
}, props)
|
|
934
650
|
),
|
|
935
|
-
rightIcon && /* @__PURE__ */
|
|
651
|
+
rightIcon && /* @__PURE__ */ jsx12("span", { style: {
|
|
936
652
|
position: "absolute",
|
|
937
653
|
right: "0.625rem",
|
|
938
654
|
display: "flex",
|
|
@@ -946,10 +662,10 @@ var Input = (_a) => {
|
|
|
946
662
|
var Input_default = Input;
|
|
947
663
|
|
|
948
664
|
// src/components/Label/Label.tsx
|
|
949
|
-
import { jsx as
|
|
665
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
950
666
|
var Label = (_a) => {
|
|
951
667
|
var _b = _a, { children, required, style } = _b, props = __objRest(_b, ["children", "required", "style"]);
|
|
952
|
-
return /* @__PURE__ */
|
|
668
|
+
return /* @__PURE__ */ jsxs8("label", __spreadProps(__spreadValues({ style: __spreadValues({
|
|
953
669
|
display: "block",
|
|
954
670
|
fontSize: "0.875rem",
|
|
955
671
|
fontWeight: 500,
|
|
@@ -957,29 +673,29 @@ var Label = (_a) => {
|
|
|
957
673
|
marginBottom: "0.375rem"
|
|
958
674
|
}, style) }, props), { children: [
|
|
959
675
|
children,
|
|
960
|
-
required && /* @__PURE__ */
|
|
676
|
+
required && /* @__PURE__ */ jsx13("span", { style: { color: "var(--ds-danger, #ef4444)", marginLeft: "0.25rem" }, children: "*" })
|
|
961
677
|
] }));
|
|
962
678
|
};
|
|
963
679
|
var Label_default = Label;
|
|
964
680
|
|
|
965
681
|
// src/components/PasswordInput/PasswordInput.tsx
|
|
966
682
|
import { Eye, EyeOff } from "lucide-react";
|
|
967
|
-
import { useState as
|
|
968
|
-
import { jsx as
|
|
683
|
+
import { useState as useState8 } from "react";
|
|
684
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
969
685
|
var PasswordInput = (props) => {
|
|
970
|
-
const [visible, setVisible] =
|
|
971
|
-
return /* @__PURE__ */
|
|
686
|
+
const [visible, setVisible] = useState8(false);
|
|
687
|
+
return /* @__PURE__ */ jsx14(
|
|
972
688
|
Input_default,
|
|
973
689
|
__spreadProps(__spreadValues({}, props), {
|
|
974
690
|
type: visible ? "text" : "password",
|
|
975
|
-
rightIcon: /* @__PURE__ */
|
|
691
|
+
rightIcon: /* @__PURE__ */ jsx14(
|
|
976
692
|
"button",
|
|
977
693
|
{
|
|
978
694
|
type: "button",
|
|
979
695
|
onClick: () => setVisible((v) => !v),
|
|
980
696
|
style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", pointerEvents: "all" },
|
|
981
697
|
tabIndex: -1,
|
|
982
|
-
children: visible ? /* @__PURE__ */
|
|
698
|
+
children: visible ? /* @__PURE__ */ jsx14(EyeOff, { size: 16 }) : /* @__PURE__ */ jsx14(Eye, { size: 16 })
|
|
983
699
|
}
|
|
984
700
|
)
|
|
985
701
|
})
|
|
@@ -988,10 +704,10 @@ var PasswordInput = (props) => {
|
|
|
988
704
|
var PasswordInput_default = PasswordInput;
|
|
989
705
|
|
|
990
706
|
// src/components/Progress/Progress.tsx
|
|
991
|
-
import { jsx as
|
|
707
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
992
708
|
var Progress = ({ value = 0 }) => {
|
|
993
709
|
const pct = Math.min(100, Math.max(0, value));
|
|
994
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ jsx15(
|
|
995
711
|
"div",
|
|
996
712
|
{
|
|
997
713
|
role: "progressbar",
|
|
@@ -1005,7 +721,7 @@ var Progress = ({ value = 0 }) => {
|
|
|
1005
721
|
borderRadius: "9999px",
|
|
1006
722
|
overflow: "hidden"
|
|
1007
723
|
},
|
|
1008
|
-
children: /* @__PURE__ */
|
|
724
|
+
children: /* @__PURE__ */ jsx15("div", { style: {
|
|
1009
725
|
height: "100%",
|
|
1010
726
|
width: `${pct}%`,
|
|
1011
727
|
backgroundColor: "var(--ds-primary, #3b82f6)",
|
|
@@ -1018,8 +734,8 @@ var Progress = ({ value = 0 }) => {
|
|
|
1018
734
|
var Progress_default = Progress;
|
|
1019
735
|
|
|
1020
736
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
1021
|
-
import { useState as
|
|
1022
|
-
import { jsx as
|
|
737
|
+
import { useState as useState9 } from "react";
|
|
738
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1023
739
|
var RadioGroup = ({
|
|
1024
740
|
options,
|
|
1025
741
|
name,
|
|
@@ -1028,16 +744,16 @@ var RadioGroup = ({
|
|
|
1028
744
|
disabled,
|
|
1029
745
|
onChange
|
|
1030
746
|
}) => {
|
|
1031
|
-
const [internal, setInternal] =
|
|
747
|
+
const [internal, setInternal] = useState9(defaultValue);
|
|
1032
748
|
const selected = value !== void 0 ? value : internal;
|
|
1033
749
|
const handleChange = (val) => {
|
|
1034
750
|
if (disabled) return;
|
|
1035
751
|
setInternal(val);
|
|
1036
752
|
onChange == null ? void 0 : onChange(val);
|
|
1037
753
|
};
|
|
1038
|
-
return /* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ jsx16("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem" }, children: options.map((option) => {
|
|
1039
755
|
const isSelected = selected === option.value;
|
|
1040
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ jsxs9("label", { style: {
|
|
1041
757
|
display: "inline-flex",
|
|
1042
758
|
alignItems: "center",
|
|
1043
759
|
gap: "0.5rem",
|
|
@@ -1045,7 +761,7 @@ var RadioGroup = ({
|
|
|
1045
761
|
userSelect: "none",
|
|
1046
762
|
opacity: disabled ? 0.5 : 1
|
|
1047
763
|
}, children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx16(
|
|
1049
765
|
"input",
|
|
1050
766
|
{
|
|
1051
767
|
type: "radio",
|
|
@@ -1057,7 +773,7 @@ var RadioGroup = ({
|
|
|
1057
773
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
1058
774
|
}
|
|
1059
775
|
),
|
|
1060
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsx16("span", { style: {
|
|
1061
777
|
width: "1.125rem",
|
|
1062
778
|
height: "1.125rem",
|
|
1063
779
|
borderRadius: "9999px",
|
|
@@ -1068,13 +784,13 @@ var RadioGroup = ({
|
|
|
1068
784
|
flexShrink: 0,
|
|
1069
785
|
backgroundColor: "var(--ds-card, #fff)",
|
|
1070
786
|
transition: "border-color 0.15s"
|
|
1071
|
-
}, children: isSelected && /* @__PURE__ */
|
|
787
|
+
}, children: isSelected && /* @__PURE__ */ jsx16("span", { style: {
|
|
1072
788
|
width: "0.5rem",
|
|
1073
789
|
height: "0.5rem",
|
|
1074
790
|
borderRadius: "9999px",
|
|
1075
791
|
backgroundColor: "var(--ds-primary, #3b82f6)"
|
|
1076
792
|
} }) }),
|
|
1077
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ jsx16("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: option.label })
|
|
1078
794
|
] }, option.value);
|
|
1079
795
|
}) });
|
|
1080
796
|
};
|
|
@@ -1082,8 +798,8 @@ var RadioGroup_default = RadioGroup;
|
|
|
1082
798
|
|
|
1083
799
|
// src/components/Select/Select.tsx
|
|
1084
800
|
import { Check as Check2, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
1085
|
-
import { useEffect
|
|
1086
|
-
import { Fragment as Fragment3, jsx as
|
|
801
|
+
import { useEffect, useRef as useRef2, useState as useState10 } from "react";
|
|
802
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1087
803
|
var selectCSS = `
|
|
1088
804
|
[data-ds-select-trigger]:focus { outline: none; border-color: var(--ds-primary, #3b82f6); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }
|
|
1089
805
|
`;
|
|
@@ -1096,10 +812,10 @@ var Select = ({
|
|
|
1096
812
|
onChange
|
|
1097
813
|
}) => {
|
|
1098
814
|
var _a;
|
|
1099
|
-
const [internal, setInternal] =
|
|
1100
|
-
const [open, setOpen] =
|
|
1101
|
-
const [hoveredOption, setHoveredOption] =
|
|
1102
|
-
const ref =
|
|
815
|
+
const [internal, setInternal] = useState10(defaultValue);
|
|
816
|
+
const [open, setOpen] = useState10(false);
|
|
817
|
+
const [hoveredOption, setHoveredOption] = useState10(null);
|
|
818
|
+
const ref = useRef2(null);
|
|
1103
819
|
const selected = value !== void 0 ? value : internal;
|
|
1104
820
|
const selectedLabel = (_a = options.find((o) => o.value === selected)) == null ? void 0 : _a.label;
|
|
1105
821
|
const handleSelect = (val) => {
|
|
@@ -1107,22 +823,22 @@ var Select = ({
|
|
|
1107
823
|
setOpen(false);
|
|
1108
824
|
onChange == null ? void 0 : onChange(val);
|
|
1109
825
|
};
|
|
1110
|
-
|
|
826
|
+
useEffect(() => {
|
|
1111
827
|
const handleOutside = (e) => {
|
|
1112
828
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
1113
829
|
};
|
|
1114
830
|
document.addEventListener("mousedown", handleOutside);
|
|
1115
831
|
return () => document.removeEventListener("mousedown", handleOutside);
|
|
1116
832
|
}, []);
|
|
1117
|
-
return /* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
834
|
+
/* @__PURE__ */ jsx17("style", { href: "ds-select", precedence: "low", children: selectCSS }),
|
|
835
|
+
/* @__PURE__ */ jsxs10("div", { ref, style: {
|
|
1120
836
|
position: "relative",
|
|
1121
837
|
width: "100%",
|
|
1122
838
|
opacity: disabled ? 0.5 : 1,
|
|
1123
839
|
pointerEvents: disabled ? "none" : void 0
|
|
1124
840
|
}, children: [
|
|
1125
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ jsxs10(
|
|
1126
842
|
"button",
|
|
1127
843
|
{
|
|
1128
844
|
type: "button",
|
|
@@ -1148,8 +864,8 @@ var Select = ({
|
|
|
1148
864
|
fontFamily: "inherit"
|
|
1149
865
|
},
|
|
1150
866
|
children: [
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ jsx17("span", { style: { color: selectedLabel ? "var(--ds-text-primary, #0f172a)" : "var(--ds-text-secondary, #64748b)" }, children: selectedLabel != null ? selectedLabel : placeholder }),
|
|
868
|
+
/* @__PURE__ */ jsx17(
|
|
1153
869
|
ChevronDown2,
|
|
1154
870
|
{
|
|
1155
871
|
size: 16,
|
|
@@ -1164,7 +880,7 @@ var Select = ({
|
|
|
1164
880
|
]
|
|
1165
881
|
}
|
|
1166
882
|
),
|
|
1167
|
-
open && /* @__PURE__ */
|
|
883
|
+
open && /* @__PURE__ */ jsx17("div", { style: {
|
|
1168
884
|
position: "absolute",
|
|
1169
885
|
top: "calc(100% + 0.25rem)",
|
|
1170
886
|
left: 0,
|
|
@@ -1178,7 +894,7 @@ var Select = ({
|
|
|
1178
894
|
}, children: options.map((option) => {
|
|
1179
895
|
const isSelected = selected === option.value;
|
|
1180
896
|
const isHovered = hoveredOption === option.value;
|
|
1181
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ jsxs10(
|
|
1182
898
|
"div",
|
|
1183
899
|
{
|
|
1184
900
|
onClick: () => handleSelect(option.value),
|
|
@@ -1197,7 +913,7 @@ var Select = ({
|
|
|
1197
913
|
transition: "background-color 0.1s"
|
|
1198
914
|
},
|
|
1199
915
|
children: [
|
|
1200
|
-
isSelected ? /* @__PURE__ */
|
|
916
|
+
isSelected ? /* @__PURE__ */ jsx17(Check2, { size: 14, style: { color: "var(--ds-primary, #3b82f6)", flexShrink: 0 } }) : /* @__PURE__ */ jsx17("span", { style: { width: 14, flexShrink: 0 } }),
|
|
1201
917
|
option.label
|
|
1202
918
|
]
|
|
1203
919
|
},
|
|
@@ -1210,13 +926,13 @@ var Select = ({
|
|
|
1210
926
|
var Select_default = Select;
|
|
1211
927
|
|
|
1212
928
|
// src/components/Skeleton/Skeleton.tsx
|
|
1213
|
-
import { Fragment as Fragment4, jsx as
|
|
1214
|
-
var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
929
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
930
|
+
var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
931
|
+
/* @__PURE__ */ jsx18("style", { href: "ds-skeleton", precedence: "low", children: `
|
|
1216
932
|
@keyframes ds-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
|
|
1217
933
|
[data-ds-skeleton] { animation: ds-pulse 1.5s ease-in-out infinite; }
|
|
1218
934
|
` }),
|
|
1219
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ jsx18(
|
|
1220
936
|
"div",
|
|
1221
937
|
{
|
|
1222
938
|
"data-ds-skeleton": "",
|
|
@@ -1233,8 +949,8 @@ var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PU
|
|
|
1233
949
|
var Skeleton_default = Skeleton;
|
|
1234
950
|
|
|
1235
951
|
// src/components/Slider/Slider.tsx
|
|
1236
|
-
import { useState as
|
|
1237
|
-
import { Fragment as Fragment5, jsx as
|
|
952
|
+
import { useState as useState11 } from "react";
|
|
953
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1238
954
|
var sliderCSS = `
|
|
1239
955
|
[data-ds-slider] {
|
|
1240
956
|
-webkit-appearance: none;
|
|
@@ -1285,7 +1001,7 @@ var Slider = ({
|
|
|
1285
1001
|
disabled,
|
|
1286
1002
|
onChange
|
|
1287
1003
|
}) => {
|
|
1288
|
-
const [internal, setInternal] =
|
|
1004
|
+
const [internal, setInternal] = useState11(defaultValue);
|
|
1289
1005
|
const current = value !== void 0 ? value : internal;
|
|
1290
1006
|
const fill = `${(current - min) / (max - min) * 100}%`;
|
|
1291
1007
|
const handleChange = (e) => {
|
|
@@ -1293,13 +1009,13 @@ var Slider = ({
|
|
|
1293
1009
|
setInternal(val);
|
|
1294
1010
|
onChange == null ? void 0 : onChange(val);
|
|
1295
1011
|
};
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1012
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
1013
|
+
/* @__PURE__ */ jsx19("style", { href: "ds-slider", precedence: "low", children: sliderCSS }),
|
|
1014
|
+
/* @__PURE__ */ jsx19("div", { style: {
|
|
1299
1015
|
width: "100%",
|
|
1300
1016
|
padding: "0.25rem 0",
|
|
1301
1017
|
opacity: disabled ? 0.5 : 1
|
|
1302
|
-
}, children: /* @__PURE__ */
|
|
1018
|
+
}, children: /* @__PURE__ */ jsx19(
|
|
1303
1019
|
"input",
|
|
1304
1020
|
{
|
|
1305
1021
|
type: "range",
|
|
@@ -1319,11 +1035,11 @@ var Slider_default = Slider;
|
|
|
1319
1035
|
|
|
1320
1036
|
// src/components/Spinner/Spinner.tsx
|
|
1321
1037
|
import { Loader2 } from "lucide-react";
|
|
1322
|
-
import { Fragment as Fragment6, jsx as
|
|
1038
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1323
1039
|
var sizePx = { sm: 16, md: 24, lg: 32 };
|
|
1324
|
-
var Spinner = ({ size = "md" }) => /* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1040
|
+
var Spinner = ({ size = "md" }) => /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
1041
|
+
/* @__PURE__ */ jsx20("style", { href: "ds-spin", precedence: "low", children: `@keyframes ds-spin { to { transform: rotate(360deg); } }` }),
|
|
1042
|
+
/* @__PURE__ */ jsx20(
|
|
1327
1043
|
Loader2,
|
|
1328
1044
|
{
|
|
1329
1045
|
size: sizePx[size],
|
|
@@ -1335,8 +1051,8 @@ var Spinner = ({ size = "md" }) => /* @__PURE__ */ jsxs17(Fragment6, { children:
|
|
|
1335
1051
|
var Spinner_default = Spinner;
|
|
1336
1052
|
|
|
1337
1053
|
// src/components/Switch/Switch.tsx
|
|
1338
|
-
import { useState as
|
|
1339
|
-
import { jsx as
|
|
1054
|
+
import { useState as useState12 } from "react";
|
|
1055
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1340
1056
|
var Switch = ({
|
|
1341
1057
|
label,
|
|
1342
1058
|
checked,
|
|
@@ -1345,7 +1061,7 @@ var Switch = ({
|
|
|
1345
1061
|
id,
|
|
1346
1062
|
onChange
|
|
1347
1063
|
}) => {
|
|
1348
|
-
const [internal, setInternal] =
|
|
1064
|
+
const [internal, setInternal] = useState12(defaultChecked);
|
|
1349
1065
|
const isOn = checked !== void 0 ? checked : internal;
|
|
1350
1066
|
const handleToggle = () => {
|
|
1351
1067
|
if (disabled) return;
|
|
@@ -1353,7 +1069,7 @@ var Switch = ({
|
|
|
1353
1069
|
setInternal(next);
|
|
1354
1070
|
onChange == null ? void 0 : onChange(next);
|
|
1355
1071
|
};
|
|
1356
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ jsxs14("label", { htmlFor: id, style: {
|
|
1357
1073
|
display: "inline-flex",
|
|
1358
1074
|
alignItems: "center",
|
|
1359
1075
|
gap: "0.625rem",
|
|
@@ -1361,7 +1077,7 @@ var Switch = ({
|
|
|
1361
1077
|
userSelect: "none",
|
|
1362
1078
|
opacity: disabled ? 0.5 : 1
|
|
1363
1079
|
}, children: [
|
|
1364
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ jsx21(
|
|
1365
1081
|
"input",
|
|
1366
1082
|
{
|
|
1367
1083
|
type: "checkbox",
|
|
@@ -1372,7 +1088,7 @@ var Switch = ({
|
|
|
1372
1088
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
1373
1089
|
}
|
|
1374
1090
|
),
|
|
1375
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx21("span", { style: {
|
|
1376
1092
|
width: "2.75rem",
|
|
1377
1093
|
height: "1.5rem",
|
|
1378
1094
|
borderRadius: "9999px",
|
|
@@ -1380,7 +1096,7 @@ var Switch = ({
|
|
|
1380
1096
|
position: "relative",
|
|
1381
1097
|
transition: "background-color 0.2s",
|
|
1382
1098
|
flexShrink: 0
|
|
1383
|
-
}, children: /* @__PURE__ */
|
|
1099
|
+
}, children: /* @__PURE__ */ jsx21("span", { style: {
|
|
1384
1100
|
position: "absolute",
|
|
1385
1101
|
top: "0.175rem",
|
|
1386
1102
|
left: "0.175rem",
|
|
@@ -1392,41 +1108,41 @@ var Switch = ({
|
|
|
1392
1108
|
transition: "transform 0.2s",
|
|
1393
1109
|
transform: isOn ? "translateX(1.25rem)" : "translateX(0)"
|
|
1394
1110
|
} }) }),
|
|
1395
|
-
label && /* @__PURE__ */
|
|
1111
|
+
label && /* @__PURE__ */ jsx21("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: label })
|
|
1396
1112
|
] });
|
|
1397
1113
|
};
|
|
1398
1114
|
var Switch_default = Switch;
|
|
1399
1115
|
|
|
1400
1116
|
// src/components/Table/Table.tsx
|
|
1401
|
-
import { Fragment as Fragment7, jsx as
|
|
1117
|
+
import { Fragment as Fragment7, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1402
1118
|
var tableCSS = `
|
|
1403
1119
|
[data-ds-table-row]:hover [data-ds-table-cell] { background-color: var(--ds-muted, #f1f5f9); }
|
|
1404
1120
|
`;
|
|
1405
1121
|
var Table = (_a) => {
|
|
1406
1122
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1407
|
-
return /* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
1124
|
+
/* @__PURE__ */ jsx22("style", { href: "ds-table", precedence: "low", children: tableCSS }),
|
|
1125
|
+
/* @__PURE__ */ jsx22("div", { style: {
|
|
1410
1126
|
width: "100%",
|
|
1411
1127
|
overflowX: "auto",
|
|
1412
1128
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
1413
1129
|
borderRadius: "0.5rem"
|
|
1414
|
-
}, children: /* @__PURE__ */
|
|
1130
|
+
}, children: /* @__PURE__ */ jsx22("table", __spreadValues({ style: __spreadValues({
|
|
1415
1131
|
width: "100%",
|
|
1416
1132
|
borderCollapse: "collapse",
|
|
1417
1133
|
fontSize: "0.875rem"
|
|
1418
1134
|
}, style) }, props)) })
|
|
1419
1135
|
] });
|
|
1420
1136
|
};
|
|
1421
|
-
var TableHead = (props) => /* @__PURE__ */
|
|
1422
|
-
var TableBody = (props) => /* @__PURE__ */
|
|
1137
|
+
var TableHead = (props) => /* @__PURE__ */ jsx22("thead", __spreadValues({}, props));
|
|
1138
|
+
var TableBody = (props) => /* @__PURE__ */ jsx22("tbody", __spreadValues({}, props));
|
|
1423
1139
|
var TableRow = (_a) => {
|
|
1424
1140
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsx22("tr", __spreadValues({ "data-ds-table-row": "", style }, props));
|
|
1426
1142
|
};
|
|
1427
1143
|
var TableHeader = (_a) => {
|
|
1428
1144
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1429
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ jsx22("th", __spreadValues({ style: __spreadValues({
|
|
1430
1146
|
padding: "0.75rem 1rem",
|
|
1431
1147
|
textAlign: "left",
|
|
1432
1148
|
fontWeight: 500,
|
|
@@ -1438,7 +1154,7 @@ var TableHeader = (_a) => {
|
|
|
1438
1154
|
};
|
|
1439
1155
|
var TableCell = (_a) => {
|
|
1440
1156
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1441
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsx22(
|
|
1442
1158
|
"td",
|
|
1443
1159
|
__spreadValues({
|
|
1444
1160
|
"data-ds-table-cell": "",
|
|
@@ -1453,15 +1169,15 @@ var TableCell = (_a) => {
|
|
|
1453
1169
|
};
|
|
1454
1170
|
|
|
1455
1171
|
// src/components/Tabs/Tabs.tsx
|
|
1456
|
-
import { useState as
|
|
1457
|
-
import { jsx as
|
|
1172
|
+
import { useState as useState13 } from "react";
|
|
1173
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1458
1174
|
var Tabs = ({ tabs, defaultValue }) => {
|
|
1459
1175
|
var _a, _b;
|
|
1460
|
-
const [active, setActive] =
|
|
1461
|
-
const [hovered, setHovered] =
|
|
1176
|
+
const [active, setActive] = useState13((_b = defaultValue != null ? defaultValue : (_a = tabs[0]) == null ? void 0 : _a.value) != null ? _b : "");
|
|
1177
|
+
const [hovered, setHovered] = useState13(null);
|
|
1462
1178
|
const activeTab = tabs.find((t) => t.value === active);
|
|
1463
|
-
return /* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ jsxs16("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
1180
|
+
/* @__PURE__ */ jsx23("div", { role: "tablist", style: {
|
|
1465
1181
|
display: "inline-flex",
|
|
1466
1182
|
backgroundColor: "var(--ds-muted, #f1f5f9)",
|
|
1467
1183
|
borderRadius: "0.5rem",
|
|
@@ -1470,7 +1186,7 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1470
1186
|
}, children: tabs.map((tab) => {
|
|
1471
1187
|
const isActive = active === tab.value;
|
|
1472
1188
|
const isHovered = hovered === tab.value;
|
|
1473
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ jsxs16(
|
|
1474
1190
|
"button",
|
|
1475
1191
|
{
|
|
1476
1192
|
role: "tab",
|
|
@@ -1495,14 +1211,14 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1495
1211
|
whiteSpace: "nowrap"
|
|
1496
1212
|
},
|
|
1497
1213
|
children: [
|
|
1498
|
-
tab.icon && /* @__PURE__ */
|
|
1214
|
+
tab.icon && /* @__PURE__ */ jsx23("span", { style: { display: "flex", alignItems: "center" }, children: tab.icon }),
|
|
1499
1215
|
tab.label
|
|
1500
1216
|
]
|
|
1501
1217
|
},
|
|
1502
1218
|
tab.value
|
|
1503
1219
|
);
|
|
1504
1220
|
}) }),
|
|
1505
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ jsx23("div", { role: "tabpanel", style: {
|
|
1506
1222
|
paddingTop: "1rem",
|
|
1507
1223
|
fontSize: "0.875rem",
|
|
1508
1224
|
color: "var(--ds-text-secondary, #64748b)"
|
|
@@ -1512,7 +1228,7 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1512
1228
|
var Tabs_default = Tabs;
|
|
1513
1229
|
|
|
1514
1230
|
// src/components/Textarea/Textarea.tsx
|
|
1515
|
-
import { Fragment as Fragment8, jsx as
|
|
1231
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1516
1232
|
var textareaCSS = `
|
|
1517
1233
|
[data-ds-textarea]::placeholder { color: var(--ds-text-secondary, #64748b); }
|
|
1518
1234
|
[data-ds-textarea]:focus { outline: none; border-color: var(--ds-primary, #3b82f6); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }
|
|
@@ -1522,9 +1238,9 @@ var textareaCSS = `
|
|
|
1522
1238
|
`;
|
|
1523
1239
|
var Textarea = (_a) => {
|
|
1524
1240
|
var _b = _a, { error, style } = _b, props = __objRest(_b, ["error", "style"]);
|
|
1525
|
-
return /* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
1242
|
+
/* @__PURE__ */ jsx24("style", { href: "ds-textarea", precedence: "low", children: textareaCSS }),
|
|
1243
|
+
/* @__PURE__ */ jsx24(
|
|
1528
1244
|
"textarea",
|
|
1529
1245
|
__spreadValues({
|
|
1530
1246
|
"data-ds-textarea": "",
|
|
@@ -1550,8 +1266,8 @@ var Textarea = (_a) => {
|
|
|
1550
1266
|
var Textarea_default = Textarea;
|
|
1551
1267
|
|
|
1552
1268
|
// src/components/Tooltip/Tooltip.tsx
|
|
1553
|
-
import { useState as
|
|
1554
|
-
import { Fragment as Fragment9, jsx as
|
|
1269
|
+
import { useState as useState14 } from "react";
|
|
1270
|
+
import { Fragment as Fragment9, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1555
1271
|
var positionStyle = {
|
|
1556
1272
|
top: { bottom: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" },
|
|
1557
1273
|
bottom: { top: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" },
|
|
@@ -1569,11 +1285,11 @@ var tooltipCSS = `
|
|
|
1569
1285
|
[data-ds-tt="left"]::before { left: 100%; top: 50%; transform: translateY(-50%); border-left-color: var(--ds-tooltip-bg, #0f172a); }
|
|
1570
1286
|
[data-ds-tt="right"]::before { right: 100%; top: 50%; transform: translateY(-50%); border-right-color: var(--ds-tooltip-bg, #0f172a); }
|
|
1571
1287
|
`;
|
|
1572
|
-
var
|
|
1573
|
-
const [visible, setVisible] =
|
|
1574
|
-
return /* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1288
|
+
var Tooltip = ({ content, children, position = "top" }) => {
|
|
1289
|
+
const [visible, setVisible] = useState14(false);
|
|
1290
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
1291
|
+
/* @__PURE__ */ jsx25("style", { href: "ds-tooltip", precedence: "low", children: tooltipCSS }),
|
|
1292
|
+
/* @__PURE__ */ jsxs18(
|
|
1577
1293
|
"span",
|
|
1578
1294
|
{
|
|
1579
1295
|
style: { position: "relative", display: "inline-flex" },
|
|
@@ -1583,7 +1299,7 @@ var Tooltip5 = ({ content, children, position = "top" }) => {
|
|
|
1583
1299
|
onBlur: () => setVisible(false),
|
|
1584
1300
|
children: [
|
|
1585
1301
|
children,
|
|
1586
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ jsx25(
|
|
1587
1303
|
"span",
|
|
1588
1304
|
{
|
|
1589
1305
|
role: "tooltip",
|
|
@@ -1610,14 +1326,12 @@ var Tooltip5 = ({ content, children, position = "top" }) => {
|
|
|
1610
1326
|
)
|
|
1611
1327
|
] });
|
|
1612
1328
|
};
|
|
1613
|
-
var Tooltip_default =
|
|
1329
|
+
var Tooltip_default = Tooltip;
|
|
1614
1330
|
export {
|
|
1615
1331
|
Accordion_default as Accordion,
|
|
1616
1332
|
Alert_default as Alert,
|
|
1617
|
-
AreaChart_default as AreaChart,
|
|
1618
1333
|
Avatar_default as Avatar,
|
|
1619
1334
|
Badge_default as Badge,
|
|
1620
|
-
BarChart_default as BarChart,
|
|
1621
1335
|
Breadcrumb_default as Breadcrumb,
|
|
1622
1336
|
Button_default as Button,
|
|
1623
1337
|
Card,
|
|
@@ -1631,9 +1345,7 @@ export {
|
|
|
1631
1345
|
FileUpload_default as FileUpload,
|
|
1632
1346
|
Input_default as Input,
|
|
1633
1347
|
Label_default as Label,
|
|
1634
|
-
LineChart_default as LineChart,
|
|
1635
1348
|
PasswordInput_default as PasswordInput,
|
|
1636
|
-
PieChart_default as PieChart,
|
|
1637
1349
|
Progress_default as Progress,
|
|
1638
1350
|
RadioGroup_default as RadioGroup,
|
|
1639
1351
|
Select_default as Select,
|