@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.cjs
CHANGED
|
@@ -52,10 +52,8 @@ var index_exports = {};
|
|
|
52
52
|
__export(index_exports, {
|
|
53
53
|
Accordion: () => Accordion_default,
|
|
54
54
|
Alert: () => Alert_default,
|
|
55
|
-
AreaChart: () => AreaChart_default,
|
|
56
55
|
Avatar: () => Avatar_default,
|
|
57
56
|
Badge: () => Badge_default,
|
|
58
|
-
BarChart: () => BarChart_default,
|
|
59
57
|
Breadcrumb: () => Breadcrumb_default,
|
|
60
58
|
Button: () => Button_default,
|
|
61
59
|
Card: () => Card,
|
|
@@ -69,9 +67,7 @@ __export(index_exports, {
|
|
|
69
67
|
FileUpload: () => FileUpload_default,
|
|
70
68
|
Input: () => Input_default,
|
|
71
69
|
Label: () => Label_default,
|
|
72
|
-
LineChart: () => LineChart_default,
|
|
73
70
|
PasswordInput: () => PasswordInput_default,
|
|
74
|
-
PieChart: () => PieChart_default,
|
|
75
71
|
Progress: () => Progress_default,
|
|
76
72
|
RadioGroup: () => RadioGroup_default,
|
|
77
73
|
Select: () => Select_default,
|
|
@@ -110,272 +106,17 @@ var useTheme = () => {
|
|
|
110
106
|
return ctx;
|
|
111
107
|
};
|
|
112
108
|
|
|
113
|
-
// src/components/Charts/LineChart.tsx
|
|
114
|
-
var import_react2 = require("react");
|
|
115
|
-
var import_recharts = require("recharts");
|
|
116
|
-
|
|
117
|
-
// src/components/Charts/chartUtils.ts
|
|
118
|
-
var CHART_COLORS = [
|
|
119
|
-
"#3b82f6",
|
|
120
|
-
// blue
|
|
121
|
-
"#22c55e",
|
|
122
|
-
// green
|
|
123
|
-
"#f59e0b",
|
|
124
|
-
// amber
|
|
125
|
-
"#ef4444",
|
|
126
|
-
// red
|
|
127
|
-
"#8b5cf6",
|
|
128
|
-
// violet
|
|
129
|
-
"#06b6d4",
|
|
130
|
-
// cyan
|
|
131
|
-
"#f97316",
|
|
132
|
-
// orange
|
|
133
|
-
"#ec4899"
|
|
134
|
-
// pink
|
|
135
|
-
];
|
|
136
|
-
function getChartTheme(theme) {
|
|
137
|
-
const isDark = theme === "dark";
|
|
138
|
-
return {
|
|
139
|
-
gridColor: isDark ? "#334155" : "#e2e8f0",
|
|
140
|
-
axisStroke: isDark ? "#94a3b8" : "#64748b",
|
|
141
|
-
axisTick: { fill: isDark ? "#94a3b8" : "#64748b", fontSize: 12 },
|
|
142
|
-
primaryColor: isDark ? "#60a5fa" : "#3b82f6",
|
|
143
|
-
tooltipStyle: {
|
|
144
|
-
backgroundColor: isDark ? "#1e293b" : "#ffffff",
|
|
145
|
-
border: `1px solid ${isDark ? "#334155" : "#e2e8f0"}`,
|
|
146
|
-
borderRadius: "6px",
|
|
147
|
-
color: isDark ? "#f1f5f9" : "#0f172a",
|
|
148
|
-
fontSize: "0.8125rem"
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// src/components/Charts/LineChart.tsx
|
|
154
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
155
|
-
var LineChart = ({
|
|
156
|
-
data,
|
|
157
|
-
xKey,
|
|
158
|
-
lines,
|
|
159
|
-
height = 250,
|
|
160
|
-
legend = false,
|
|
161
|
-
grid = true,
|
|
162
|
-
theme = "light",
|
|
163
|
-
className,
|
|
164
|
-
style
|
|
165
|
-
}) => {
|
|
166
|
-
const containerRef = (0, import_react2.useRef)(null);
|
|
167
|
-
const [width, setWidth] = (0, import_react2.useState)(0);
|
|
168
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
169
|
-
(0, import_react2.useEffect)(() => {
|
|
170
|
-
if (!containerRef.current) return;
|
|
171
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
172
|
-
measure();
|
|
173
|
-
const ro = new ResizeObserver(measure);
|
|
174
|
-
ro.observe(containerRef.current);
|
|
175
|
-
return () => ro.disconnect();
|
|
176
|
-
}, []);
|
|
177
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_recharts.LineChart, { width, height, data, children: [
|
|
178
|
-
grid && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
179
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts.XAxis, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
180
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts.YAxis, { stroke: axisStroke, tick: axisTick }),
|
|
181
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts.Tooltip, { contentStyle: tooltipStyle }),
|
|
182
|
-
legend && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts.Legend, {}),
|
|
183
|
-
lines.map((line, i) => {
|
|
184
|
-
var _a, _b;
|
|
185
|
-
const color = (_a = line.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
186
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
187
|
-
import_recharts.Line,
|
|
188
|
-
{
|
|
189
|
-
type: "monotone",
|
|
190
|
-
dataKey: line.dataKey,
|
|
191
|
-
name: (_b = line.label) != null ? _b : line.dataKey,
|
|
192
|
-
stroke: color,
|
|
193
|
-
strokeWidth: 2,
|
|
194
|
-
dot: { fill: color, r: 4 },
|
|
195
|
-
activeDot: { r: 6 },
|
|
196
|
-
isAnimationActive: false
|
|
197
|
-
},
|
|
198
|
-
line.dataKey
|
|
199
|
-
);
|
|
200
|
-
})
|
|
201
|
-
] }) });
|
|
202
|
-
};
|
|
203
|
-
var LineChart_default = LineChart;
|
|
204
|
-
|
|
205
|
-
// src/components/Charts/BarChart.tsx
|
|
206
|
-
var import_react3 = require("react");
|
|
207
|
-
var import_recharts2 = require("recharts");
|
|
208
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
209
|
-
var BarChart = ({
|
|
210
|
-
data,
|
|
211
|
-
xKey,
|
|
212
|
-
bars,
|
|
213
|
-
height = 250,
|
|
214
|
-
legend = false,
|
|
215
|
-
grid = true,
|
|
216
|
-
theme = "light",
|
|
217
|
-
className,
|
|
218
|
-
style
|
|
219
|
-
}) => {
|
|
220
|
-
const containerRef = (0, import_react3.useRef)(null);
|
|
221
|
-
const [width, setWidth] = (0, import_react3.useState)(0);
|
|
222
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
223
|
-
(0, import_react3.useEffect)(() => {
|
|
224
|
-
if (!containerRef.current) return;
|
|
225
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
226
|
-
measure();
|
|
227
|
-
const ro = new ResizeObserver(measure);
|
|
228
|
-
ro.observe(containerRef.current);
|
|
229
|
-
return () => ro.disconnect();
|
|
230
|
-
}, []);
|
|
231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_recharts2.BarChart, { width, height, data, children: [
|
|
232
|
-
grid && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts2.CartesianGrid, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
233
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts2.XAxis, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
234
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts2.YAxis, { stroke: axisStroke, tick: axisTick }),
|
|
235
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts2.Tooltip, { contentStyle: tooltipStyle }),
|
|
236
|
-
legend && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts2.Legend, {}),
|
|
237
|
-
bars.map((bar, i) => {
|
|
238
|
-
var _a, _b;
|
|
239
|
-
const color = (_a = bar.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
240
|
-
const isLast = i === bars.length - 1;
|
|
241
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
242
|
-
import_recharts2.Bar,
|
|
243
|
-
{
|
|
244
|
-
dataKey: bar.dataKey,
|
|
245
|
-
name: (_b = bar.label) != null ? _b : bar.dataKey,
|
|
246
|
-
fill: color,
|
|
247
|
-
stackId: bar.stackId,
|
|
248
|
-
radius: bar.stackId && !isLast ? [0, 0, 0, 0] : [4, 4, 0, 0],
|
|
249
|
-
isAnimationActive: false
|
|
250
|
-
},
|
|
251
|
-
bar.dataKey
|
|
252
|
-
);
|
|
253
|
-
})
|
|
254
|
-
] }) });
|
|
255
|
-
};
|
|
256
|
-
var BarChart_default = BarChart;
|
|
257
|
-
|
|
258
|
-
// src/components/Charts/AreaChart.tsx
|
|
259
|
-
var import_react4 = require("react");
|
|
260
|
-
var import_recharts3 = require("recharts");
|
|
261
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
262
|
-
var AreaChart = ({
|
|
263
|
-
data,
|
|
264
|
-
xKey,
|
|
265
|
-
areas,
|
|
266
|
-
height = 250,
|
|
267
|
-
legend = false,
|
|
268
|
-
grid = true,
|
|
269
|
-
theme = "light",
|
|
270
|
-
className,
|
|
271
|
-
style
|
|
272
|
-
}) => {
|
|
273
|
-
const containerRef = (0, import_react4.useRef)(null);
|
|
274
|
-
const [width, setWidth] = (0, import_react4.useState)(0);
|
|
275
|
-
const { gridColor, axisStroke, axisTick, tooltipStyle } = getChartTheme(theme);
|
|
276
|
-
(0, import_react4.useEffect)(() => {
|
|
277
|
-
if (!containerRef.current) return;
|
|
278
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
279
|
-
measure();
|
|
280
|
-
const ro = new ResizeObserver(measure);
|
|
281
|
-
ro.observe(containerRef.current);
|
|
282
|
-
return () => ro.disconnect();
|
|
283
|
-
}, []);
|
|
284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_recharts3.AreaChart, { width, height, data, children: [
|
|
285
|
-
grid && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts3.CartesianGrid, { strokeDasharray: "3 3", stroke: gridColor }),
|
|
286
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts3.XAxis, { dataKey: xKey, stroke: axisStroke, tick: axisTick }),
|
|
287
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts3.YAxis, { stroke: axisStroke, tick: axisTick }),
|
|
288
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts3.Tooltip, { contentStyle: tooltipStyle }),
|
|
289
|
-
legend && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts3.Legend, {}),
|
|
290
|
-
areas.map((area, i) => {
|
|
291
|
-
var _a, _b, _c;
|
|
292
|
-
const color = (_a = area.color) != null ? _a : CHART_COLORS[i % CHART_COLORS.length];
|
|
293
|
-
const opacity = (_b = area.fillOpacity) != null ? _b : area.stackId ? 0.4 : 0.15;
|
|
294
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
295
|
-
import_recharts3.Area,
|
|
296
|
-
{
|
|
297
|
-
type: "monotone",
|
|
298
|
-
dataKey: area.dataKey,
|
|
299
|
-
name: (_c = area.label) != null ? _c : area.dataKey,
|
|
300
|
-
stroke: color,
|
|
301
|
-
fill: color,
|
|
302
|
-
fillOpacity: opacity,
|
|
303
|
-
strokeWidth: 2,
|
|
304
|
-
stackId: area.stackId,
|
|
305
|
-
isAnimationActive: false
|
|
306
|
-
},
|
|
307
|
-
area.dataKey
|
|
308
|
-
);
|
|
309
|
-
})
|
|
310
|
-
] }) });
|
|
311
|
-
};
|
|
312
|
-
var AreaChart_default = AreaChart;
|
|
313
|
-
|
|
314
|
-
// src/components/Charts/PieChart.tsx
|
|
315
|
-
var import_react5 = require("react");
|
|
316
|
-
var import_recharts4 = require("recharts");
|
|
317
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
318
|
-
var PieChart = ({
|
|
319
|
-
data,
|
|
320
|
-
height = 250,
|
|
321
|
-
donut = false,
|
|
322
|
-
legend = false,
|
|
323
|
-
label = false,
|
|
324
|
-
theme = "light",
|
|
325
|
-
className,
|
|
326
|
-
style
|
|
327
|
-
}) => {
|
|
328
|
-
const containerRef = (0, import_react5.useRef)(null);
|
|
329
|
-
const [width, setWidth] = (0, import_react5.useState)(0);
|
|
330
|
-
const { tooltipStyle } = getChartTheme(theme);
|
|
331
|
-
(0, import_react5.useEffect)(() => {
|
|
332
|
-
if (!containerRef.current) return;
|
|
333
|
-
const measure = () => setWidth(containerRef.current.offsetWidth);
|
|
334
|
-
measure();
|
|
335
|
-
const ro = new ResizeObserver(measure);
|
|
336
|
-
ro.observe(containerRef.current);
|
|
337
|
-
return () => ro.disconnect();
|
|
338
|
-
}, []);
|
|
339
|
-
const dataWithColors = data.map((item, i) => {
|
|
340
|
-
var _a;
|
|
341
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
342
|
-
fill: (_a = item.fill) != null ? _a : CHART_COLORS[i % CHART_COLORS.length]
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
const outerRadius = 90;
|
|
346
|
-
const innerRadius = donut ? 55 : 0;
|
|
347
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: containerRef, className, style: __spreadValues({ minWidth: 250, width: "100%" }, style), children: width > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_recharts4.PieChart, { width, height, children: [
|
|
348
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
349
|
-
import_recharts4.Pie,
|
|
350
|
-
{
|
|
351
|
-
data: dataWithColors,
|
|
352
|
-
cx: "50%",
|
|
353
|
-
cy: "50%",
|
|
354
|
-
outerRadius,
|
|
355
|
-
innerRadius,
|
|
356
|
-
dataKey: "value",
|
|
357
|
-
label: label ? ({ name, percent }) => `${name} ${((percent != null ? percent : 0) * 100).toFixed(0)}%` : void 0,
|
|
358
|
-
labelLine: label,
|
|
359
|
-
isAnimationActive: false
|
|
360
|
-
}
|
|
361
|
-
),
|
|
362
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_recharts4.Tooltip, { contentStyle: tooltipStyle }),
|
|
363
|
-
legend && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_recharts4.Legend, {})
|
|
364
|
-
] }) });
|
|
365
|
-
};
|
|
366
|
-
var PieChart_default = PieChart;
|
|
367
|
-
|
|
368
109
|
// src/components/Accordion/Accordion.tsx
|
|
369
|
-
var
|
|
110
|
+
var import_react2 = require("react");
|
|
370
111
|
var import_lucide_react = require("lucide-react");
|
|
371
|
-
var
|
|
112
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
372
113
|
var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
373
|
-
const [open, setOpen] = (0,
|
|
114
|
+
const [open, setOpen] = (0, import_react2.useState)(() => {
|
|
374
115
|
if (!defaultValue) return /* @__PURE__ */ new Set();
|
|
375
116
|
if (Array.isArray(defaultValue)) return new Set(defaultValue);
|
|
376
117
|
return /* @__PURE__ */ new Set([defaultValue]);
|
|
377
118
|
});
|
|
378
|
-
const [hovered, setHovered] = (0,
|
|
119
|
+
const [hovered, setHovered] = (0, import_react2.useState)(null);
|
|
379
120
|
const toggle = (value) => {
|
|
380
121
|
setOpen((prev) => {
|
|
381
122
|
const next = new Set(prev);
|
|
@@ -388,7 +129,7 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
388
129
|
return next;
|
|
389
130
|
});
|
|
390
131
|
};
|
|
391
|
-
return /* @__PURE__ */ (0,
|
|
132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: {
|
|
392
133
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
393
134
|
borderRadius: "0.5rem",
|
|
394
135
|
overflow: "hidden"
|
|
@@ -396,14 +137,14 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
396
137
|
const isOpen = open.has(item.value);
|
|
397
138
|
const isHovered = hovered === item.value;
|
|
398
139
|
const isLast = index === items.length - 1;
|
|
399
|
-
return /* @__PURE__ */ (0,
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
400
141
|
"div",
|
|
401
142
|
{
|
|
402
143
|
style: {
|
|
403
144
|
borderBottom: isLast ? "none" : "1px solid var(--ds-border, #e2e8f0)"
|
|
404
145
|
},
|
|
405
146
|
children: [
|
|
406
|
-
/* @__PURE__ */ (0,
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
407
148
|
"button",
|
|
408
149
|
{
|
|
409
150
|
style: {
|
|
@@ -426,8 +167,8 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
426
167
|
onMouseLeave: () => setHovered(null),
|
|
427
168
|
"aria-expanded": isOpen,
|
|
428
169
|
children: [
|
|
429
|
-
/* @__PURE__ */ (0,
|
|
430
|
-
/* @__PURE__ */ (0,
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: item.trigger }),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
431
172
|
import_lucide_react.ChevronDown,
|
|
432
173
|
{
|
|
433
174
|
size: 16,
|
|
@@ -442,11 +183,11 @@ var Accordion = ({ items, defaultValue, multiple = false }) => {
|
|
|
442
183
|
]
|
|
443
184
|
}
|
|
444
185
|
),
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: {
|
|
446
187
|
maxHeight: isOpen ? "300px" : "0",
|
|
447
188
|
overflow: "hidden",
|
|
448
189
|
transition: "max-height 0.25s ease"
|
|
449
|
-
}, children: /* @__PURE__ */ (0,
|
|
190
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: {
|
|
450
191
|
padding: "0 1rem 1rem",
|
|
451
192
|
fontSize: "0.875rem",
|
|
452
193
|
color: "var(--ds-text-secondary, #64748b)"
|
|
@@ -461,7 +202,7 @@ var Accordion_default = Accordion;
|
|
|
461
202
|
|
|
462
203
|
// src/components/Alert/Alert.tsx
|
|
463
204
|
var import_lucide_react2 = require("lucide-react");
|
|
464
|
-
var
|
|
205
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
465
206
|
var variantMap = {
|
|
466
207
|
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)" },
|
|
467
208
|
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)" },
|
|
@@ -469,14 +210,14 @@ var variantMap = {
|
|
|
469
210
|
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)" }
|
|
470
211
|
};
|
|
471
212
|
var icons = {
|
|
472
|
-
info: /* @__PURE__ */ (0,
|
|
473
|
-
success: /* @__PURE__ */ (0,
|
|
474
|
-
warning: /* @__PURE__ */ (0,
|
|
475
|
-
danger: /* @__PURE__ */ (0,
|
|
213
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.Info, { size: 16 }),
|
|
214
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.CheckCircle2, { size: 16 }),
|
|
215
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.AlertTriangle, { size: 16 }),
|
|
216
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.AlertCircle, { size: 16 })
|
|
476
217
|
};
|
|
477
218
|
var Alert = ({ variant = "info", title, description }) => {
|
|
478
219
|
const v = variantMap[variant];
|
|
479
|
-
return /* @__PURE__ */ (0,
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "alert", style: {
|
|
480
221
|
display: "flex",
|
|
481
222
|
gap: "0.75rem",
|
|
482
223
|
padding: "1rem",
|
|
@@ -484,23 +225,23 @@ var Alert = ({ variant = "info", title, description }) => {
|
|
|
484
225
|
borderLeft: `4px solid ${v.border}`,
|
|
485
226
|
backgroundColor: v.bg
|
|
486
227
|
}, children: [
|
|
487
|
-
/* @__PURE__ */ (0,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
489
|
-
/* @__PURE__ */ (0,
|
|
490
|
-
/* @__PURE__ */ (0,
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { flexShrink: 0, marginTop: "0.125rem", color: v.icon }, children: icons[variant] }),
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { flex: 1 }, children: [
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: { fontWeight: 600, fontSize: "0.875rem", marginBottom: "0.25rem", marginTop: 0, color: v.title }, children: title }),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: { fontSize: "0.875rem", margin: 0, color: v.desc }, children: description })
|
|
491
232
|
] })
|
|
492
233
|
] });
|
|
493
234
|
};
|
|
494
235
|
var Alert_default = Alert;
|
|
495
236
|
|
|
496
237
|
// src/components/Avatar/Avatar.tsx
|
|
497
|
-
var
|
|
238
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
498
239
|
var sizeMap = {
|
|
499
240
|
sm: { width: "2rem", height: "2rem", fontSize: "0.625rem" },
|
|
500
241
|
md: { width: "2.5rem", height: "2.5rem", fontSize: "0.875rem" },
|
|
501
242
|
lg: { width: "4rem", height: "4rem", fontSize: "1.25rem" }
|
|
502
243
|
};
|
|
503
|
-
var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */ (0,
|
|
244
|
+
var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
504
245
|
"div",
|
|
505
246
|
{
|
|
506
247
|
className,
|
|
@@ -522,7 +263,7 @@ var Avatar = ({ fallback, size = "md", style, className }) => /* @__PURE__ */ (0
|
|
|
522
263
|
var Avatar_default = Avatar;
|
|
523
264
|
|
|
524
265
|
// src/components/Badge/Badge.tsx
|
|
525
|
-
var
|
|
266
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
526
267
|
var variantMap2 = {
|
|
527
268
|
default: { backgroundColor: "var(--ds-primary, #3b82f6)", color: "#fff" },
|
|
528
269
|
secondary: { backgroundColor: "var(--ds-muted, #f1f5f9)", color: "var(--ds-text-secondary, #64748b)" },
|
|
@@ -537,7 +278,7 @@ var sizeMap2 = {
|
|
|
537
278
|
md: { padding: "0.25rem 0.625rem", fontSize: "0.75rem" },
|
|
538
279
|
lg: { padding: "0.375rem 0.875rem", fontSize: "0.875rem" }
|
|
539
280
|
};
|
|
540
|
-
var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PURE__ */ (0,
|
|
281
|
+
var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: __spreadValues(__spreadValues(__spreadValues({
|
|
541
282
|
display: "inline-flex",
|
|
542
283
|
alignItems: "center",
|
|
543
284
|
gap: "0.25rem",
|
|
@@ -548,12 +289,12 @@ var Badge = ({ variant = "default", size = "md", children, style }) => /* @__PUR
|
|
|
548
289
|
var Badge_default = Badge;
|
|
549
290
|
|
|
550
291
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
551
|
-
var
|
|
292
|
+
var import_react3 = require("react");
|
|
552
293
|
var import_lucide_react3 = require("lucide-react");
|
|
553
|
-
var
|
|
294
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
554
295
|
var Breadcrumb = ({ items }) => {
|
|
555
|
-
const [hovered, setHovered] = (0,
|
|
556
|
-
return /* @__PURE__ */ (0,
|
|
296
|
+
const [hovered, setHovered] = (0, import_react3.useState)(null);
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ol", { style: {
|
|
557
298
|
display: "flex",
|
|
558
299
|
flexWrap: "wrap",
|
|
559
300
|
alignItems: "center",
|
|
@@ -564,8 +305,8 @@ var Breadcrumb = ({ items }) => {
|
|
|
564
305
|
}, children: items.map((item, i) => {
|
|
565
306
|
const isLast = i === items.length - 1;
|
|
566
307
|
const isHovered = hovered === item.label;
|
|
567
|
-
return /* @__PURE__ */ (0,
|
|
568
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { style: { display: "flex", alignItems: "center" }, children: [
|
|
309
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
569
310
|
import_lucide_react3.ChevronRight,
|
|
570
311
|
{
|
|
571
312
|
size: 14,
|
|
@@ -573,11 +314,11 @@ var Breadcrumb = ({ items }) => {
|
|
|
573
314
|
style: { color: "var(--ds-text-secondary, #64748b)", margin: "0 0.25rem", flexShrink: 0 }
|
|
574
315
|
}
|
|
575
316
|
),
|
|
576
|
-
isLast || !item.href ? /* @__PURE__ */ (0,
|
|
317
|
+
isLast || !item.href ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: {
|
|
577
318
|
color: isLast ? "var(--ds-text-primary, #0f172a)" : "var(--ds-text-secondary, #64748b)",
|
|
578
319
|
fontWeight: isLast ? 500 : void 0,
|
|
579
320
|
cursor: isLast ? "default" : void 0
|
|
580
|
-
}, children: item.label }) : /* @__PURE__ */ (0,
|
|
321
|
+
}, children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
581
322
|
"a",
|
|
582
323
|
{
|
|
583
324
|
href: item.href,
|
|
@@ -598,8 +339,8 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
598
339
|
|
|
599
340
|
// src/components/Button/Button.tsx
|
|
600
341
|
var import_lucide_react4 = require("lucide-react");
|
|
601
|
-
var
|
|
602
|
-
var
|
|
342
|
+
var import_react4 = require("react");
|
|
343
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
603
344
|
var variantStyles = {
|
|
604
345
|
solid: { backgroundColor: "var(--ds-primary, #3b82f6)", color: "#fff", borderColor: "transparent" },
|
|
605
346
|
outline: { backgroundColor: "transparent", color: "var(--ds-primary, #3b82f6)", borderColor: "var(--ds-primary, #3b82f6)" },
|
|
@@ -661,7 +402,7 @@ var Button = (_a) => {
|
|
|
661
402
|
"size",
|
|
662
403
|
"style"
|
|
663
404
|
]);
|
|
664
|
-
const [hovered, setHovered] = (0,
|
|
405
|
+
const [hovered, setHovered] = (0, import_react4.useState)(false);
|
|
665
406
|
const resolvedVariant = variant != null ? variant : danger ? "danger" : warning ? "warning" : info ? "info" : success ? "success" : ghost ? "ghost" : outline ? "outline" : "solid";
|
|
666
407
|
const resolvedSize = size != null ? size : small ? "sm" : large ? "lg" : "md";
|
|
667
408
|
const isDisabled = disabled || loading;
|
|
@@ -679,9 +420,9 @@ var Button = (_a) => {
|
|
|
679
420
|
opacity: isDisabled ? 0.5 : 1,
|
|
680
421
|
pointerEvents: loading ? "none" : void 0
|
|
681
422
|
}, variantStyles[resolvedVariant]), sizeStyles[resolvedSize]), hovered && !isDisabled ? variantHoverStyles[resolvedVariant] : {}), styleProp);
|
|
682
|
-
return /* @__PURE__ */ (0,
|
|
683
|
-
/* @__PURE__ */ (0,
|
|
684
|
-
/* @__PURE__ */ (0,
|
|
423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("style", { href: "ds-spin", precedence: "low", children: `@keyframes ds-spin { to { transform: rotate(360deg); } }` }),
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
685
426
|
"button",
|
|
686
427
|
__spreadProps(__spreadValues({
|
|
687
428
|
disabled: isDisabled,
|
|
@@ -690,7 +431,7 @@ var Button = (_a) => {
|
|
|
690
431
|
onMouseLeave: () => setHovered(false)
|
|
691
432
|
}, props), {
|
|
692
433
|
children: [
|
|
693
|
-
loading ? /* @__PURE__ */ (0,
|
|
434
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
694
435
|
import_lucide_react4.LoaderCircle,
|
|
695
436
|
{
|
|
696
437
|
"aria-hidden": true,
|
|
@@ -708,10 +449,10 @@ var Button = (_a) => {
|
|
|
708
449
|
var Button_default = Button;
|
|
709
450
|
|
|
710
451
|
// src/components/Card/Card.tsx
|
|
711
|
-
var
|
|
452
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
712
453
|
var Card = (_a) => {
|
|
713
454
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
714
|
-
return /* @__PURE__ */ (0,
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadValues({ style: __spreadValues({
|
|
715
456
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
716
457
|
borderRadius: "0.5rem",
|
|
717
458
|
backgroundColor: "var(--ds-card, #ffffff)"
|
|
@@ -719,7 +460,7 @@ var Card = (_a) => {
|
|
|
719
460
|
};
|
|
720
461
|
var CardHeader = (_a) => {
|
|
721
462
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
722
|
-
return /* @__PURE__ */ (0,
|
|
463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadValues({ style: __spreadValues({
|
|
723
464
|
display: "flex",
|
|
724
465
|
flexDirection: "column",
|
|
725
466
|
gap: "0.375rem",
|
|
@@ -728,7 +469,7 @@ var CardHeader = (_a) => {
|
|
|
728
469
|
};
|
|
729
470
|
var CardTitle = (_a) => {
|
|
730
471
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
731
|
-
return /* @__PURE__ */ (0,
|
|
472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", __spreadValues({ style: __spreadValues({
|
|
732
473
|
fontSize: "1rem",
|
|
733
474
|
fontWeight: 600,
|
|
734
475
|
color: "var(--ds-text-primary, #0f172a)",
|
|
@@ -738,7 +479,7 @@ var CardTitle = (_a) => {
|
|
|
738
479
|
};
|
|
739
480
|
var CardDescription = (_a) => {
|
|
740
481
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
741
|
-
return /* @__PURE__ */ (0,
|
|
482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", __spreadValues({ style: __spreadValues({
|
|
742
483
|
fontSize: "0.875rem",
|
|
743
484
|
color: "var(--ds-text-secondary, #64748b)",
|
|
744
485
|
margin: 0
|
|
@@ -746,11 +487,11 @@ var CardDescription = (_a) => {
|
|
|
746
487
|
};
|
|
747
488
|
var CardContent = (_a) => {
|
|
748
489
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadValues({ style: __spreadValues({ padding: "1.5rem" }, style) }, props));
|
|
750
491
|
};
|
|
751
492
|
var CardFooter = (_a) => {
|
|
752
493
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
753
|
-
return /* @__PURE__ */ (0,
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", __spreadValues({ style: __spreadValues({
|
|
754
495
|
display: "flex",
|
|
755
496
|
alignItems: "center",
|
|
756
497
|
padding: "0 1.5rem 1.5rem"
|
|
@@ -758,8 +499,8 @@ var CardFooter = (_a) => {
|
|
|
758
499
|
};
|
|
759
500
|
|
|
760
501
|
// src/components/Checkbox/Checkbox.tsx
|
|
761
|
-
var
|
|
762
|
-
var
|
|
502
|
+
var import_react5 = require("react");
|
|
503
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
763
504
|
var Checkbox = ({
|
|
764
505
|
label,
|
|
765
506
|
checked,
|
|
@@ -768,7 +509,7 @@ var Checkbox = ({
|
|
|
768
509
|
id,
|
|
769
510
|
onChange
|
|
770
511
|
}) => {
|
|
771
|
-
const [internal, setInternal] = (0,
|
|
512
|
+
const [internal, setInternal] = (0, import_react5.useState)(defaultChecked);
|
|
772
513
|
const isChecked = checked !== void 0 ? checked : internal;
|
|
773
514
|
const handleChange = () => {
|
|
774
515
|
if (disabled) return;
|
|
@@ -776,7 +517,7 @@ var Checkbox = ({
|
|
|
776
517
|
setInternal(next);
|
|
777
518
|
onChange == null ? void 0 : onChange(next);
|
|
778
519
|
};
|
|
779
|
-
return /* @__PURE__ */ (0,
|
|
520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { htmlFor: id, style: {
|
|
780
521
|
display: "inline-flex",
|
|
781
522
|
alignItems: "center",
|
|
782
523
|
gap: "0.5rem",
|
|
@@ -784,7 +525,7 @@ var Checkbox = ({
|
|
|
784
525
|
userSelect: "none",
|
|
785
526
|
opacity: disabled ? 0.5 : 1
|
|
786
527
|
}, children: [
|
|
787
|
-
/* @__PURE__ */ (0,
|
|
528
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
788
529
|
"input",
|
|
789
530
|
{
|
|
790
531
|
type: "checkbox",
|
|
@@ -795,7 +536,7 @@ var Checkbox = ({
|
|
|
795
536
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
796
537
|
}
|
|
797
538
|
),
|
|
798
|
-
/* @__PURE__ */ (0,
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: {
|
|
799
540
|
width: "1.125rem",
|
|
800
541
|
height: "1.125rem",
|
|
801
542
|
border: `2px solid ${isChecked ? "var(--ds-primary, #3b82f6)" : "var(--ds-border, #e2e8f0)"}`,
|
|
@@ -806,25 +547,25 @@ var Checkbox = ({
|
|
|
806
547
|
flexShrink: 0,
|
|
807
548
|
transition: "background-color 0.15s, border-color 0.15s",
|
|
808
549
|
backgroundColor: isChecked ? "var(--ds-primary, #3b82f6)" : "var(--ds-card, #fff)"
|
|
809
|
-
}, children: isChecked && /* @__PURE__ */ (0,
|
|
810
|
-
label && /* @__PURE__ */ (0,
|
|
550
|
+
}, children: isChecked && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { viewBox: "0 0 12 10", fill: "none", style: { width: "0.625rem", height: "0.625rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M1 5l3.5 3.5L11 1", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
551
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: label })
|
|
811
552
|
] });
|
|
812
553
|
};
|
|
813
554
|
var Checkbox_default = Checkbox;
|
|
814
555
|
|
|
815
556
|
// src/components/CopyButton/CopyButton.tsx
|
|
816
557
|
var import_lucide_react5 = require("lucide-react");
|
|
817
|
-
var
|
|
818
|
-
var
|
|
558
|
+
var import_react6 = require("react");
|
|
559
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
819
560
|
var CopyButton = ({ text }) => {
|
|
820
|
-
const [copied, setCopied] = (0,
|
|
821
|
-
const [hovered, setHovered] = (0,
|
|
561
|
+
const [copied, setCopied] = (0, import_react6.useState)(false);
|
|
562
|
+
const [hovered, setHovered] = (0, import_react6.useState)(false);
|
|
822
563
|
const handleCopy = () => {
|
|
823
564
|
navigator.clipboard.writeText(text);
|
|
824
565
|
setCopied(true);
|
|
825
566
|
setTimeout(() => setCopied(false), 2e3);
|
|
826
567
|
};
|
|
827
|
-
return /* @__PURE__ */ (0,
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
828
569
|
"button",
|
|
829
570
|
{
|
|
830
571
|
onClick: handleCopy,
|
|
@@ -843,7 +584,7 @@ var CopyButton = ({ text }) => {
|
|
|
843
584
|
cursor: "pointer",
|
|
844
585
|
transition: "background-color 0.15s, color 0.15s"
|
|
845
586
|
},
|
|
846
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
587
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.Check, { style: { width: "1rem", height: "1rem" } }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.Copy, { style: { width: "1rem", height: "1rem" } })
|
|
847
588
|
}
|
|
848
589
|
);
|
|
849
590
|
};
|
|
@@ -851,19 +592,19 @@ var CopyButton_default = CopyButton;
|
|
|
851
592
|
|
|
852
593
|
// src/components/FileUpload/FileUpload.tsx
|
|
853
594
|
var import_lucide_react6 = require("lucide-react");
|
|
854
|
-
var
|
|
855
|
-
var
|
|
595
|
+
var import_react7 = require("react");
|
|
596
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
856
597
|
var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
857
|
-
const [isDragging, setIsDragging] = (0,
|
|
858
|
-
const [isHovered, setIsHovered] = (0,
|
|
859
|
-
const [fileNames, setFileNames] = (0,
|
|
860
|
-
const inputRef = (0,
|
|
598
|
+
const [isDragging, setIsDragging] = (0, import_react7.useState)(false);
|
|
599
|
+
const [isHovered, setIsHovered] = (0, import_react7.useState)(false);
|
|
600
|
+
const [fileNames, setFileNames] = (0, import_react7.useState)([]);
|
|
601
|
+
const inputRef = (0, import_react7.useRef)(null);
|
|
861
602
|
const handleFiles = (list) => {
|
|
862
603
|
setFileNames(Array.from(list).map((f) => f.name));
|
|
863
604
|
onFileSelect == null ? void 0 : onFileSelect(list);
|
|
864
605
|
};
|
|
865
606
|
const isActive = isDragging || isHovered;
|
|
866
|
-
return /* @__PURE__ */ (0,
|
|
607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
867
608
|
"div",
|
|
868
609
|
{
|
|
869
610
|
onClick: () => {
|
|
@@ -897,7 +638,7 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
897
638
|
opacity: disabled ? 0.5 : 1
|
|
898
639
|
},
|
|
899
640
|
children: [
|
|
900
|
-
/* @__PURE__ */ (0,
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
901
642
|
"input",
|
|
902
643
|
{
|
|
903
644
|
ref: inputRef,
|
|
@@ -909,9 +650,9 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
909
650
|
onChange: (e) => e.target.files && handleFiles(e.target.files)
|
|
910
651
|
}
|
|
911
652
|
),
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
913
|
-
fileNames.length > 0 ? /* @__PURE__ */ (0,
|
|
914
|
-
/* @__PURE__ */ (0,
|
|
653
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.Upload, { size: 32, style: { color: "var(--ds-text-secondary, #64748b)" } }),
|
|
654
|
+
fileNames.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: { fontSize: "0.875rem", color: "var(--ds-primary, #3b82f6)", fontWeight: 500, margin: 0 }, children: fileNames.join(", ") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: { fontSize: "0.875rem", color: "var(--ds-text-secondary, #64748b)", margin: 0 }, children: [
|
|
655
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Click to upload" }),
|
|
915
656
|
" or drag and drop"
|
|
916
657
|
] })
|
|
917
658
|
]
|
|
@@ -921,7 +662,7 @@ var FileUpload = ({ accept, multiple, disabled, onFileSelect }) => {
|
|
|
921
662
|
var FileUpload_default = FileUpload;
|
|
922
663
|
|
|
923
664
|
// src/components/Input/Input.tsx
|
|
924
|
-
var
|
|
665
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
925
666
|
var inputCSS = `
|
|
926
667
|
[data-ds-input]::placeholder { color: var(--ds-text-secondary, #64748b); }
|
|
927
668
|
[data-ds-input]:focus { outline: none; border-color: var(--ds-primary, #3b82f6); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }
|
|
@@ -931,10 +672,10 @@ var inputCSS = `
|
|
|
931
672
|
`;
|
|
932
673
|
var Input = (_a) => {
|
|
933
674
|
var _b = _a, { error, success, leftIcon, rightIcon, style } = _b, props = __objRest(_b, ["error", "success", "leftIcon", "rightIcon", "style"]);
|
|
934
|
-
return /* @__PURE__ */ (0,
|
|
935
|
-
/* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
937
|
-
leftIcon && /* @__PURE__ */ (0,
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
676
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("style", { href: "ds-input", precedence: "low", children: inputCSS }),
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { position: "relative", display: "flex", alignItems: "center", width: "100%" }, children: [
|
|
678
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
938
679
|
position: "absolute",
|
|
939
680
|
left: "0.625rem",
|
|
940
681
|
display: "flex",
|
|
@@ -942,7 +683,7 @@ var Input = (_a) => {
|
|
|
942
683
|
color: "var(--ds-text-secondary, #64748b)",
|
|
943
684
|
pointerEvents: "none"
|
|
944
685
|
}, children: leftIcon }),
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
946
687
|
"input",
|
|
947
688
|
__spreadValues({
|
|
948
689
|
"data-ds-input": "",
|
|
@@ -965,7 +706,7 @@ var Input = (_a) => {
|
|
|
965
706
|
}, style)
|
|
966
707
|
}, props)
|
|
967
708
|
),
|
|
968
|
-
rightIcon && /* @__PURE__ */ (0,
|
|
709
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
969
710
|
position: "absolute",
|
|
970
711
|
right: "0.625rem",
|
|
971
712
|
display: "flex",
|
|
@@ -979,10 +720,10 @@ var Input = (_a) => {
|
|
|
979
720
|
var Input_default = Input;
|
|
980
721
|
|
|
981
722
|
// src/components/Label/Label.tsx
|
|
982
|
-
var
|
|
723
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
983
724
|
var Label = (_a) => {
|
|
984
725
|
var _b = _a, { children, required, style } = _b, props = __objRest(_b, ["children", "required", "style"]);
|
|
985
|
-
return /* @__PURE__ */ (0,
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", __spreadProps(__spreadValues({ style: __spreadValues({
|
|
986
727
|
display: "block",
|
|
987
728
|
fontSize: "0.875rem",
|
|
988
729
|
fontWeight: 500,
|
|
@@ -990,29 +731,29 @@ var Label = (_a) => {
|
|
|
990
731
|
marginBottom: "0.375rem"
|
|
991
732
|
}, style) }, props), { children: [
|
|
992
733
|
children,
|
|
993
|
-
required && /* @__PURE__ */ (0,
|
|
734
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { color: "var(--ds-danger, #ef4444)", marginLeft: "0.25rem" }, children: "*" })
|
|
994
735
|
] }));
|
|
995
736
|
};
|
|
996
737
|
var Label_default = Label;
|
|
997
738
|
|
|
998
739
|
// src/components/PasswordInput/PasswordInput.tsx
|
|
999
740
|
var import_lucide_react7 = require("lucide-react");
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
741
|
+
var import_react8 = require("react");
|
|
742
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1002
743
|
var PasswordInput = (props) => {
|
|
1003
|
-
const [visible, setVisible] = (0,
|
|
1004
|
-
return /* @__PURE__ */ (0,
|
|
744
|
+
const [visible, setVisible] = (0, import_react8.useState)(false);
|
|
745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1005
746
|
Input_default,
|
|
1006
747
|
__spreadProps(__spreadValues({}, props), {
|
|
1007
748
|
type: visible ? "text" : "password",
|
|
1008
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
749
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1009
750
|
"button",
|
|
1010
751
|
{
|
|
1011
752
|
type: "button",
|
|
1012
753
|
onClick: () => setVisible((v) => !v),
|
|
1013
754
|
style: { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", pointerEvents: "all" },
|
|
1014
755
|
tabIndex: -1,
|
|
1015
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
756
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.EyeOff, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.Eye, { size: 16 })
|
|
1016
757
|
}
|
|
1017
758
|
)
|
|
1018
759
|
})
|
|
@@ -1021,10 +762,10 @@ var PasswordInput = (props) => {
|
|
|
1021
762
|
var PasswordInput_default = PasswordInput;
|
|
1022
763
|
|
|
1023
764
|
// src/components/Progress/Progress.tsx
|
|
1024
|
-
var
|
|
765
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1025
766
|
var Progress = ({ value = 0 }) => {
|
|
1026
767
|
const pct = Math.min(100, Math.max(0, value));
|
|
1027
|
-
return /* @__PURE__ */ (0,
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1028
769
|
"div",
|
|
1029
770
|
{
|
|
1030
771
|
role: "progressbar",
|
|
@@ -1038,7 +779,7 @@ var Progress = ({ value = 0 }) => {
|
|
|
1038
779
|
borderRadius: "9999px",
|
|
1039
780
|
overflow: "hidden"
|
|
1040
781
|
},
|
|
1041
|
-
children: /* @__PURE__ */ (0,
|
|
782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: {
|
|
1042
783
|
height: "100%",
|
|
1043
784
|
width: `${pct}%`,
|
|
1044
785
|
backgroundColor: "var(--ds-primary, #3b82f6)",
|
|
@@ -1051,8 +792,8 @@ var Progress = ({ value = 0 }) => {
|
|
|
1051
792
|
var Progress_default = Progress;
|
|
1052
793
|
|
|
1053
794
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
1054
|
-
var
|
|
1055
|
-
var
|
|
795
|
+
var import_react9 = require("react");
|
|
796
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1056
797
|
var RadioGroup = ({
|
|
1057
798
|
options,
|
|
1058
799
|
name,
|
|
@@ -1061,16 +802,16 @@ var RadioGroup = ({
|
|
|
1061
802
|
disabled,
|
|
1062
803
|
onChange
|
|
1063
804
|
}) => {
|
|
1064
|
-
const [internal, setInternal] = (0,
|
|
805
|
+
const [internal, setInternal] = (0, import_react9.useState)(defaultValue);
|
|
1065
806
|
const selected = value !== void 0 ? value : internal;
|
|
1066
807
|
const handleChange = (val) => {
|
|
1067
808
|
if (disabled) return;
|
|
1068
809
|
setInternal(val);
|
|
1069
810
|
onChange == null ? void 0 : onChange(val);
|
|
1070
811
|
};
|
|
1071
|
-
return /* @__PURE__ */ (0,
|
|
812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem" }, children: options.map((option) => {
|
|
1072
813
|
const isSelected = selected === option.value;
|
|
1073
|
-
return /* @__PURE__ */ (0,
|
|
814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { style: {
|
|
1074
815
|
display: "inline-flex",
|
|
1075
816
|
alignItems: "center",
|
|
1076
817
|
gap: "0.5rem",
|
|
@@ -1078,7 +819,7 @@ var RadioGroup = ({
|
|
|
1078
819
|
userSelect: "none",
|
|
1079
820
|
opacity: disabled ? 0.5 : 1
|
|
1080
821
|
}, children: [
|
|
1081
|
-
/* @__PURE__ */ (0,
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1082
823
|
"input",
|
|
1083
824
|
{
|
|
1084
825
|
type: "radio",
|
|
@@ -1090,7 +831,7 @@ var RadioGroup = ({
|
|
|
1090
831
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
1091
832
|
}
|
|
1092
833
|
),
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: {
|
|
1094
835
|
width: "1.125rem",
|
|
1095
836
|
height: "1.125rem",
|
|
1096
837
|
borderRadius: "9999px",
|
|
@@ -1101,13 +842,13 @@ var RadioGroup = ({
|
|
|
1101
842
|
flexShrink: 0,
|
|
1102
843
|
backgroundColor: "var(--ds-card, #fff)",
|
|
1103
844
|
transition: "border-color 0.15s"
|
|
1104
|
-
}, children: isSelected && /* @__PURE__ */ (0,
|
|
845
|
+
}, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: {
|
|
1105
846
|
width: "0.5rem",
|
|
1106
847
|
height: "0.5rem",
|
|
1107
848
|
borderRadius: "9999px",
|
|
1108
849
|
backgroundColor: "var(--ds-primary, #3b82f6)"
|
|
1109
850
|
} }) }),
|
|
1110
|
-
/* @__PURE__ */ (0,
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: option.label })
|
|
1111
852
|
] }, option.value);
|
|
1112
853
|
}) });
|
|
1113
854
|
};
|
|
@@ -1115,8 +856,8 @@ var RadioGroup_default = RadioGroup;
|
|
|
1115
856
|
|
|
1116
857
|
// src/components/Select/Select.tsx
|
|
1117
858
|
var import_lucide_react8 = require("lucide-react");
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
859
|
+
var import_react10 = require("react");
|
|
860
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1120
861
|
var selectCSS = `
|
|
1121
862
|
[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); }
|
|
1122
863
|
`;
|
|
@@ -1129,10 +870,10 @@ var Select = ({
|
|
|
1129
870
|
onChange
|
|
1130
871
|
}) => {
|
|
1131
872
|
var _a;
|
|
1132
|
-
const [internal, setInternal] = (0,
|
|
1133
|
-
const [open, setOpen] = (0,
|
|
1134
|
-
const [hoveredOption, setHoveredOption] = (0,
|
|
1135
|
-
const ref = (0,
|
|
873
|
+
const [internal, setInternal] = (0, import_react10.useState)(defaultValue);
|
|
874
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
875
|
+
const [hoveredOption, setHoveredOption] = (0, import_react10.useState)(null);
|
|
876
|
+
const ref = (0, import_react10.useRef)(null);
|
|
1136
877
|
const selected = value !== void 0 ? value : internal;
|
|
1137
878
|
const selectedLabel = (_a = options.find((o) => o.value === selected)) == null ? void 0 : _a.label;
|
|
1138
879
|
const handleSelect = (val) => {
|
|
@@ -1140,22 +881,22 @@ var Select = ({
|
|
|
1140
881
|
setOpen(false);
|
|
1141
882
|
onChange == null ? void 0 : onChange(val);
|
|
1142
883
|
};
|
|
1143
|
-
(0,
|
|
884
|
+
(0, import_react10.useEffect)(() => {
|
|
1144
885
|
const handleOutside = (e) => {
|
|
1145
886
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
1146
887
|
};
|
|
1147
888
|
document.addEventListener("mousedown", handleOutside);
|
|
1148
889
|
return () => document.removeEventListener("mousedown", handleOutside);
|
|
1149
890
|
}, []);
|
|
1150
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { href: "ds-select", precedence: "low", children: selectCSS }),
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref, style: {
|
|
1153
894
|
position: "relative",
|
|
1154
895
|
width: "100%",
|
|
1155
896
|
opacity: disabled ? 0.5 : 1,
|
|
1156
897
|
pointerEvents: disabled ? "none" : void 0
|
|
1157
898
|
}, children: [
|
|
1158
|
-
/* @__PURE__ */ (0,
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1159
900
|
"button",
|
|
1160
901
|
{
|
|
1161
902
|
type: "button",
|
|
@@ -1181,8 +922,8 @@ var Select = ({
|
|
|
1181
922
|
fontFamily: "inherit"
|
|
1182
923
|
},
|
|
1183
924
|
children: [
|
|
1184
|
-
/* @__PURE__ */ (0,
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: selectedLabel ? "var(--ds-text-primary, #0f172a)" : "var(--ds-text-secondary, #64748b)" }, children: selectedLabel != null ? selectedLabel : placeholder }),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1186
927
|
import_lucide_react8.ChevronDown,
|
|
1187
928
|
{
|
|
1188
929
|
size: 16,
|
|
@@ -1197,7 +938,7 @@ var Select = ({
|
|
|
1197
938
|
]
|
|
1198
939
|
}
|
|
1199
940
|
),
|
|
1200
|
-
open && /* @__PURE__ */ (0,
|
|
941
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: {
|
|
1201
942
|
position: "absolute",
|
|
1202
943
|
top: "calc(100% + 0.25rem)",
|
|
1203
944
|
left: 0,
|
|
@@ -1211,7 +952,7 @@ var Select = ({
|
|
|
1211
952
|
}, children: options.map((option) => {
|
|
1212
953
|
const isSelected = selected === option.value;
|
|
1213
954
|
const isHovered = hoveredOption === option.value;
|
|
1214
|
-
return /* @__PURE__ */ (0,
|
|
955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1215
956
|
"div",
|
|
1216
957
|
{
|
|
1217
958
|
onClick: () => handleSelect(option.value),
|
|
@@ -1230,7 +971,7 @@ var Select = ({
|
|
|
1230
971
|
transition: "background-color 0.1s"
|
|
1231
972
|
},
|
|
1232
973
|
children: [
|
|
1233
|
-
isSelected ? /* @__PURE__ */ (0,
|
|
974
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react8.Check, { size: 14, style: { color: "var(--ds-primary, #3b82f6)", flexShrink: 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { width: 14, flexShrink: 0 } }),
|
|
1234
975
|
option.label
|
|
1235
976
|
]
|
|
1236
977
|
},
|
|
@@ -1243,13 +984,13 @@ var Select = ({
|
|
|
1243
984
|
var Select_default = Select;
|
|
1244
985
|
|
|
1245
986
|
// src/components/Skeleton/Skeleton.tsx
|
|
1246
|
-
var
|
|
1247
|
-
var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PURE__ */ (0,
|
|
1248
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
988
|
+
var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("style", { href: "ds-skeleton", precedence: "low", children: `
|
|
1249
990
|
@keyframes ds-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
|
|
1250
991
|
[data-ds-skeleton] { animation: ds-pulse 1.5s ease-in-out infinite; }
|
|
1251
992
|
` }),
|
|
1252
|
-
/* @__PURE__ */ (0,
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1253
994
|
"div",
|
|
1254
995
|
{
|
|
1255
996
|
"data-ds-skeleton": "",
|
|
@@ -1266,8 +1007,8 @@ var Skeleton = ({ height = "1rem", width = "100%", circle = false }) => /* @__PU
|
|
|
1266
1007
|
var Skeleton_default = Skeleton;
|
|
1267
1008
|
|
|
1268
1009
|
// src/components/Slider/Slider.tsx
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1010
|
+
var import_react11 = require("react");
|
|
1011
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1271
1012
|
var sliderCSS = `
|
|
1272
1013
|
[data-ds-slider] {
|
|
1273
1014
|
-webkit-appearance: none;
|
|
@@ -1318,7 +1059,7 @@ var Slider = ({
|
|
|
1318
1059
|
disabled,
|
|
1319
1060
|
onChange
|
|
1320
1061
|
}) => {
|
|
1321
|
-
const [internal, setInternal] = (0,
|
|
1062
|
+
const [internal, setInternal] = (0, import_react11.useState)(defaultValue);
|
|
1322
1063
|
const current = value !== void 0 ? value : internal;
|
|
1323
1064
|
const fill = `${(current - min) / (max - min) * 100}%`;
|
|
1324
1065
|
const handleChange = (e) => {
|
|
@@ -1326,13 +1067,13 @@ var Slider = ({
|
|
|
1326
1067
|
setInternal(val);
|
|
1327
1068
|
onChange == null ? void 0 : onChange(val);
|
|
1328
1069
|
};
|
|
1329
|
-
return /* @__PURE__ */ (0,
|
|
1330
|
-
/* @__PURE__ */ (0,
|
|
1331
|
-
/* @__PURE__ */ (0,
|
|
1070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("style", { href: "ds-slider", precedence: "low", children: sliderCSS }),
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: {
|
|
1332
1073
|
width: "100%",
|
|
1333
1074
|
padding: "0.25rem 0",
|
|
1334
1075
|
opacity: disabled ? 0.5 : 1
|
|
1335
|
-
}, children: /* @__PURE__ */ (0,
|
|
1076
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1336
1077
|
"input",
|
|
1337
1078
|
{
|
|
1338
1079
|
type: "range",
|
|
@@ -1352,11 +1093,11 @@ var Slider_default = Slider;
|
|
|
1352
1093
|
|
|
1353
1094
|
// src/components/Spinner/Spinner.tsx
|
|
1354
1095
|
var import_lucide_react9 = require("lucide-react");
|
|
1355
|
-
var
|
|
1096
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1356
1097
|
var sizePx = { sm: 16, md: 24, lg: 32 };
|
|
1357
|
-
var Spinner = ({ size = "md" }) => /* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1098
|
+
var Spinner = ({ size = "md" }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("style", { href: "ds-spin", precedence: "low", children: `@keyframes ds-spin { to { transform: rotate(360deg); } }` }),
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1360
1101
|
import_lucide_react9.Loader2,
|
|
1361
1102
|
{
|
|
1362
1103
|
size: sizePx[size],
|
|
@@ -1368,8 +1109,8 @@ var Spinner = ({ size = "md" }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs
|
|
|
1368
1109
|
var Spinner_default = Spinner;
|
|
1369
1110
|
|
|
1370
1111
|
// src/components/Switch/Switch.tsx
|
|
1371
|
-
var
|
|
1372
|
-
var
|
|
1112
|
+
var import_react12 = require("react");
|
|
1113
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1373
1114
|
var Switch = ({
|
|
1374
1115
|
label,
|
|
1375
1116
|
checked,
|
|
@@ -1378,7 +1119,7 @@ var Switch = ({
|
|
|
1378
1119
|
id,
|
|
1379
1120
|
onChange
|
|
1380
1121
|
}) => {
|
|
1381
|
-
const [internal, setInternal] = (0,
|
|
1122
|
+
const [internal, setInternal] = (0, import_react12.useState)(defaultChecked);
|
|
1382
1123
|
const isOn = checked !== void 0 ? checked : internal;
|
|
1383
1124
|
const handleToggle = () => {
|
|
1384
1125
|
if (disabled) return;
|
|
@@ -1386,7 +1127,7 @@ var Switch = ({
|
|
|
1386
1127
|
setInternal(next);
|
|
1387
1128
|
onChange == null ? void 0 : onChange(next);
|
|
1388
1129
|
};
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { htmlFor: id, style: {
|
|
1390
1131
|
display: "inline-flex",
|
|
1391
1132
|
alignItems: "center",
|
|
1392
1133
|
gap: "0.625rem",
|
|
@@ -1394,7 +1135,7 @@ var Switch = ({
|
|
|
1394
1135
|
userSelect: "none",
|
|
1395
1136
|
opacity: disabled ? 0.5 : 1
|
|
1396
1137
|
}, children: [
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1398
1139
|
"input",
|
|
1399
1140
|
{
|
|
1400
1141
|
type: "checkbox",
|
|
@@ -1405,7 +1146,7 @@ var Switch = ({
|
|
|
1405
1146
|
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
1406
1147
|
}
|
|
1407
1148
|
),
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: {
|
|
1409
1150
|
width: "2.75rem",
|
|
1410
1151
|
height: "1.5rem",
|
|
1411
1152
|
borderRadius: "9999px",
|
|
@@ -1413,7 +1154,7 @@ var Switch = ({
|
|
|
1413
1154
|
position: "relative",
|
|
1414
1155
|
transition: "background-color 0.2s",
|
|
1415
1156
|
flexShrink: 0
|
|
1416
|
-
}, children: /* @__PURE__ */ (0,
|
|
1157
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: {
|
|
1417
1158
|
position: "absolute",
|
|
1418
1159
|
top: "0.175rem",
|
|
1419
1160
|
left: "0.175rem",
|
|
@@ -1425,41 +1166,41 @@ var Switch = ({
|
|
|
1425
1166
|
transition: "transform 0.2s",
|
|
1426
1167
|
transform: isOn ? "translateX(1.25rem)" : "translateX(0)"
|
|
1427
1168
|
} }) }),
|
|
1428
|
-
label && /* @__PURE__ */ (0,
|
|
1169
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { fontSize: "0.875rem", color: "var(--ds-text-primary, #0f172a)" }, children: label })
|
|
1429
1170
|
] });
|
|
1430
1171
|
};
|
|
1431
1172
|
var Switch_default = Switch;
|
|
1432
1173
|
|
|
1433
1174
|
// src/components/Table/Table.tsx
|
|
1434
|
-
var
|
|
1175
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1435
1176
|
var tableCSS = `
|
|
1436
1177
|
[data-ds-table-row]:hover [data-ds-table-cell] { background-color: var(--ds-muted, #f1f5f9); }
|
|
1437
1178
|
`;
|
|
1438
1179
|
var Table = (_a) => {
|
|
1439
1180
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1440
|
-
return /* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("style", { href: "ds-table", precedence: "low", children: tableCSS }),
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: {
|
|
1443
1184
|
width: "100%",
|
|
1444
1185
|
overflowX: "auto",
|
|
1445
1186
|
border: "1px solid var(--ds-border, #e2e8f0)",
|
|
1446
1187
|
borderRadius: "0.5rem"
|
|
1447
|
-
}, children: /* @__PURE__ */ (0,
|
|
1188
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("table", __spreadValues({ style: __spreadValues({
|
|
1448
1189
|
width: "100%",
|
|
1449
1190
|
borderCollapse: "collapse",
|
|
1450
1191
|
fontSize: "0.875rem"
|
|
1451
1192
|
}, style) }, props)) })
|
|
1452
1193
|
] });
|
|
1453
1194
|
};
|
|
1454
|
-
var TableHead = (props) => /* @__PURE__ */ (0,
|
|
1455
|
-
var TableBody = (props) => /* @__PURE__ */ (0,
|
|
1195
|
+
var TableHead = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", __spreadValues({}, props));
|
|
1196
|
+
var TableBody = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", __spreadValues({}, props));
|
|
1456
1197
|
var TableRow = (_a) => {
|
|
1457
1198
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", __spreadValues({ "data-ds-table-row": "", style }, props));
|
|
1459
1200
|
};
|
|
1460
1201
|
var TableHeader = (_a) => {
|
|
1461
1202
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", __spreadValues({ style: __spreadValues({
|
|
1463
1204
|
padding: "0.75rem 1rem",
|
|
1464
1205
|
textAlign: "left",
|
|
1465
1206
|
fontWeight: 500,
|
|
@@ -1471,7 +1212,7 @@ var TableHeader = (_a) => {
|
|
|
1471
1212
|
};
|
|
1472
1213
|
var TableCell = (_a) => {
|
|
1473
1214
|
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1475
1216
|
"td",
|
|
1476
1217
|
__spreadValues({
|
|
1477
1218
|
"data-ds-table-cell": "",
|
|
@@ -1486,15 +1227,15 @@ var TableCell = (_a) => {
|
|
|
1486
1227
|
};
|
|
1487
1228
|
|
|
1488
1229
|
// src/components/Tabs/Tabs.tsx
|
|
1489
|
-
var
|
|
1490
|
-
var
|
|
1230
|
+
var import_react13 = require("react");
|
|
1231
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1491
1232
|
var Tabs = ({ tabs, defaultValue }) => {
|
|
1492
1233
|
var _a, _b;
|
|
1493
|
-
const [active, setActive] = (0,
|
|
1494
|
-
const [hovered, setHovered] = (0,
|
|
1234
|
+
const [active, setActive] = (0, import_react13.useState)((_b = defaultValue != null ? defaultValue : (_a = tabs[0]) == null ? void 0 : _a.value) != null ? _b : "");
|
|
1235
|
+
const [hovered, setHovered] = (0, import_react13.useState)(null);
|
|
1495
1236
|
const activeTab = tabs.find((t) => t.value === active);
|
|
1496
|
-
return /* @__PURE__ */ (0,
|
|
1497
|
-
/* @__PURE__ */ (0,
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { role: "tablist", style: {
|
|
1498
1239
|
display: "inline-flex",
|
|
1499
1240
|
backgroundColor: "var(--ds-muted, #f1f5f9)",
|
|
1500
1241
|
borderRadius: "0.5rem",
|
|
@@ -1503,7 +1244,7 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1503
1244
|
}, children: tabs.map((tab) => {
|
|
1504
1245
|
const isActive = active === tab.value;
|
|
1505
1246
|
const isHovered = hovered === tab.value;
|
|
1506
|
-
return /* @__PURE__ */ (0,
|
|
1247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1507
1248
|
"button",
|
|
1508
1249
|
{
|
|
1509
1250
|
role: "tab",
|
|
@@ -1528,14 +1269,14 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1528
1269
|
whiteSpace: "nowrap"
|
|
1529
1270
|
},
|
|
1530
1271
|
children: [
|
|
1531
|
-
tab.icon && /* @__PURE__ */ (0,
|
|
1272
|
+
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: tab.icon }),
|
|
1532
1273
|
tab.label
|
|
1533
1274
|
]
|
|
1534
1275
|
},
|
|
1535
1276
|
tab.value
|
|
1536
1277
|
);
|
|
1537
1278
|
}) }),
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { role: "tabpanel", style: {
|
|
1539
1280
|
paddingTop: "1rem",
|
|
1540
1281
|
fontSize: "0.875rem",
|
|
1541
1282
|
color: "var(--ds-text-secondary, #64748b)"
|
|
@@ -1545,7 +1286,7 @@ var Tabs = ({ tabs, defaultValue }) => {
|
|
|
1545
1286
|
var Tabs_default = Tabs;
|
|
1546
1287
|
|
|
1547
1288
|
// src/components/Textarea/Textarea.tsx
|
|
1548
|
-
var
|
|
1289
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1549
1290
|
var textareaCSS = `
|
|
1550
1291
|
[data-ds-textarea]::placeholder { color: var(--ds-text-secondary, #64748b); }
|
|
1551
1292
|
[data-ds-textarea]:focus { outline: none; border-color: var(--ds-primary, #3b82f6); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }
|
|
@@ -1555,9 +1296,9 @@ var textareaCSS = `
|
|
|
1555
1296
|
`;
|
|
1556
1297
|
var Textarea = (_a) => {
|
|
1557
1298
|
var _b = _a, { error, style } = _b, props = __objRest(_b, ["error", "style"]);
|
|
1558
|
-
return /* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { href: "ds-textarea", precedence: "low", children: textareaCSS }),
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1561
1302
|
"textarea",
|
|
1562
1303
|
__spreadValues({
|
|
1563
1304
|
"data-ds-textarea": "",
|
|
@@ -1583,8 +1324,8 @@ var Textarea = (_a) => {
|
|
|
1583
1324
|
var Textarea_default = Textarea;
|
|
1584
1325
|
|
|
1585
1326
|
// src/components/Tooltip/Tooltip.tsx
|
|
1586
|
-
var
|
|
1587
|
-
var
|
|
1327
|
+
var import_react14 = require("react");
|
|
1328
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1588
1329
|
var positionStyle = {
|
|
1589
1330
|
top: { bottom: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" },
|
|
1590
1331
|
bottom: { top: "calc(100% + 8px)", left: "50%", transform: "translateX(-50%)" },
|
|
@@ -1602,11 +1343,11 @@ var tooltipCSS = `
|
|
|
1602
1343
|
[data-ds-tt="left"]::before { left: 100%; top: 50%; transform: translateY(-50%); border-left-color: var(--ds-tooltip-bg, #0f172a); }
|
|
1603
1344
|
[data-ds-tt="right"]::before { right: 100%; top: 50%; transform: translateY(-50%); border-right-color: var(--ds-tooltip-bg, #0f172a); }
|
|
1604
1345
|
`;
|
|
1605
|
-
var
|
|
1606
|
-
const [visible, setVisible] = (0,
|
|
1607
|
-
return /* @__PURE__ */ (0,
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1346
|
+
var Tooltip = ({ content, children, position = "top" }) => {
|
|
1347
|
+
const [visible, setVisible] = (0, import_react14.useState)(false);
|
|
1348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("style", { href: "ds-tooltip", precedence: "low", children: tooltipCSS }),
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1610
1351
|
"span",
|
|
1611
1352
|
{
|
|
1612
1353
|
style: { position: "relative", display: "inline-flex" },
|
|
@@ -1616,7 +1357,7 @@ var Tooltip5 = ({ content, children, position = "top" }) => {
|
|
|
1616
1357
|
onBlur: () => setVisible(false),
|
|
1617
1358
|
children: [
|
|
1618
1359
|
children,
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1620
1361
|
"span",
|
|
1621
1362
|
{
|
|
1622
1363
|
role: "tooltip",
|
|
@@ -1643,15 +1384,13 @@ var Tooltip5 = ({ content, children, position = "top" }) => {
|
|
|
1643
1384
|
)
|
|
1644
1385
|
] });
|
|
1645
1386
|
};
|
|
1646
|
-
var Tooltip_default =
|
|
1387
|
+
var Tooltip_default = Tooltip;
|
|
1647
1388
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1648
1389
|
0 && (module.exports = {
|
|
1649
1390
|
Accordion,
|
|
1650
1391
|
Alert,
|
|
1651
|
-
AreaChart,
|
|
1652
1392
|
Avatar,
|
|
1653
1393
|
Badge,
|
|
1654
|
-
BarChart,
|
|
1655
1394
|
Breadcrumb,
|
|
1656
1395
|
Button,
|
|
1657
1396
|
Card,
|
|
@@ -1665,9 +1404,7 @@ var Tooltip_default = Tooltip5;
|
|
|
1665
1404
|
FileUpload,
|
|
1666
1405
|
Input,
|
|
1667
1406
|
Label,
|
|
1668
|
-
LineChart,
|
|
1669
1407
|
PasswordInput,
|
|
1670
|
-
PieChart,
|
|
1671
1408
|
Progress,
|
|
1672
1409
|
RadioGroup,
|
|
1673
1410
|
Select,
|