@directo-ui/web 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Autocomplete.d.ts +17 -0
- package/dist/components/DataTable.d.ts +49 -0
- package/dist/components/DateRangePicker.d.ts +33 -0
- package/dist/components/Drawer.d.ts +23 -0
- package/dist/components/FileUpload.d.ts +26 -0
- package/dist/components/FilterBar.d.ts +27 -0
- package/dist/components/Sidebar.d.ts +32 -0
- package/dist/components/Timeline.d.ts +24 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/core/files.d.ts +27 -0
- package/dist/figma-components-directo.js +831 -297
- package/dist/figma-components-directo.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import { CaretDown as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "@radix-ui/react-tabs";
|
|
4
|
+
import * as p from "@radix-ui/react-select";
|
|
5
|
+
import { CaretDown as m, CaretLeft as h, CaretRight as g, Check as _, CheckCircle as v, Info as y, MagnifyingGlass as b, SquaresFour as x, Tray as S, Warning as C, WarningCircle as w, X as T } from "phosphor-react";
|
|
6
|
+
import * as E from "@radix-ui/react-dialog";
|
|
7
|
+
import * as D from "@radix-ui/react-checkbox";
|
|
8
|
+
import * as O from "@radix-ui/react-radio-group";
|
|
9
|
+
import * as k from "@radix-ui/react-switch";
|
|
10
|
+
import * as A from "@radix-ui/react-tooltip";
|
|
11
|
+
import * as j from "@radix-ui/react-dropdown-menu";
|
|
12
12
|
//#region src/components/Button.tsx
|
|
13
|
-
var
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
var M = t(function({ variant: e = "primary", size: t = "md", disabled: n = !1, loading: r = !1, fullWidth: i = !1, leftIcon: a, rightIcon: o, children: s, type: c = "button", className: l = "", ...f }, p) {
|
|
14
|
+
return /* @__PURE__ */ d("button", {
|
|
15
15
|
...f,
|
|
16
16
|
ref: p,
|
|
17
17
|
type: c,
|
|
@@ -20,26 +20,26 @@ var j = t(function({ variant: e = "primary", size: t = "md", disabled: n = !1, l
|
|
|
20
20
|
"data-variant": e,
|
|
21
21
|
"data-size": t,
|
|
22
22
|
"data-full-width": i || void 0,
|
|
23
|
-
className: `ds-button ${
|
|
23
|
+
className: `ds-button ${l}`.trim(),
|
|
24
24
|
children: [
|
|
25
|
-
r ? /* @__PURE__ */
|
|
25
|
+
r ? /* @__PURE__ */ u("span", {
|
|
26
26
|
className: "ds-spinner",
|
|
27
27
|
"data-size": "sm",
|
|
28
28
|
"aria-hidden": "true"
|
|
29
|
-
}) : a && /* @__PURE__ */
|
|
29
|
+
}) : a && /* @__PURE__ */ u("span", {
|
|
30
30
|
className: "ds-button-icon",
|
|
31
31
|
"aria-hidden": "true",
|
|
32
32
|
children: a
|
|
33
33
|
}),
|
|
34
34
|
s,
|
|
35
|
-
o && !r && /* @__PURE__ */
|
|
35
|
+
o && !r && /* @__PURE__ */ u("span", {
|
|
36
36
|
className: "ds-button-icon",
|
|
37
37
|
"aria-hidden": "true",
|
|
38
38
|
children: o
|
|
39
39
|
})
|
|
40
40
|
]
|
|
41
41
|
});
|
|
42
|
-
}),
|
|
42
|
+
}), N = /* @__PURE__ */ d("svg", {
|
|
43
43
|
width: "20",
|
|
44
44
|
height: "20",
|
|
45
45
|
viewBox: "0 0 24 24",
|
|
@@ -48,27 +48,27 @@ var j = t(function({ variant: e = "primary", size: t = "md", disabled: n = !1, l
|
|
|
48
48
|
strokeWidth: "2",
|
|
49
49
|
strokeLinecap: "round",
|
|
50
50
|
strokeLinejoin: "round",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ u("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }), /* @__PURE__ */ u("circle", {
|
|
52
52
|
cx: "12",
|
|
53
53
|
cy: "10",
|
|
54
54
|
r: "3"
|
|
55
55
|
})]
|
|
56
|
-
}),
|
|
57
|
-
return /* @__PURE__ */
|
|
56
|
+
}), P = t(function({ variant: e = "primary", size: t = "md", disabled: n = !1, icon: r, ariaLabel: i, type: a = "button", className: o = "", children: s, ...c }, l) {
|
|
57
|
+
return /* @__PURE__ */ u("button", {
|
|
58
58
|
...c,
|
|
59
|
-
ref:
|
|
59
|
+
ref: l,
|
|
60
60
|
type: a,
|
|
61
61
|
disabled: n,
|
|
62
62
|
className: `ds-icon-button ${o}`.trim(),
|
|
63
63
|
"data-variant": e,
|
|
64
64
|
"data-size": t,
|
|
65
65
|
"aria-label": i ?? c["aria-label"] ?? "Acción",
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ u("span", {
|
|
67
67
|
"aria-hidden": "true",
|
|
68
|
-
children: r ?? s ??
|
|
68
|
+
children: r ?? s ?? N
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
|
-
}),
|
|
71
|
+
}), F = {
|
|
72
72
|
default: {
|
|
73
73
|
background: "var(--ds-color-neutral-800)",
|
|
74
74
|
handle: "var(--ds-color-primary-500)",
|
|
@@ -90,8 +90,8 @@ var j = t(function({ variant: e = "primary", size: t = "md", disabled: n = !1, l
|
|
|
90
90
|
label: "Desactivar mi sesión"
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
function
|
|
94
|
-
let [a, o] = c(0), [
|
|
93
|
+
function I({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }) {
|
|
94
|
+
let [a, o] = c(0), [l, f] = c(!1), [p, m] = c(!1), h = s(null), g = s(0), _ = s(0), v = s(null), y = s(!1), b = F[e] ?? F.default, x = n ?? b.label, S = () => Math.max(0, (h.current?.clientWidth ?? 64) - 64);
|
|
95
95
|
function C() {
|
|
96
96
|
t || y.current || (y.current = !0, m(!0), o(S()), r?.());
|
|
97
97
|
}
|
|
@@ -104,7 +104,7 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
104
104
|
y.current = !1, _.current = 0, o(0), m(!1);
|
|
105
105
|
}, 1500);
|
|
106
106
|
return () => clearTimeout(e);
|
|
107
|
-
}, [p]), /* @__PURE__ */
|
|
107
|
+
}, [p]), /* @__PURE__ */ d("div", {
|
|
108
108
|
ref: h,
|
|
109
109
|
className: "ds-slide",
|
|
110
110
|
style: {
|
|
@@ -112,12 +112,12 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
112
112
|
opacity: t ? .5 : 1
|
|
113
113
|
},
|
|
114
114
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ u("span", {
|
|
116
116
|
className: "ds-slide-progress",
|
|
117
117
|
"aria-hidden": "true",
|
|
118
118
|
style: { width: p ? "100%" : a ? `${a + 56}px` : 0 }
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ u("button", {
|
|
121
121
|
type: "button",
|
|
122
122
|
"aria-label": x,
|
|
123
123
|
title: "Desliza o pulsa Enter para confirmar",
|
|
@@ -126,7 +126,7 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
126
126
|
style: {
|
|
127
127
|
background: b.handle,
|
|
128
128
|
transform: `translateX(${a}px)`,
|
|
129
|
-
transition:
|
|
129
|
+
transition: l ? "none" : void 0
|
|
130
130
|
},
|
|
131
131
|
onClick: (e) => {
|
|
132
132
|
e.detail === 0 && C();
|
|
@@ -150,7 +150,7 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
150
150
|
onLostPointerCapture: () => {
|
|
151
151
|
v.current !== null && w();
|
|
152
152
|
},
|
|
153
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ u("svg", {
|
|
154
154
|
"aria-hidden": "true",
|
|
155
155
|
width: "24",
|
|
156
156
|
height: "24",
|
|
@@ -158,16 +158,16 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
158
158
|
fill: "none",
|
|
159
159
|
stroke: "currentColor",
|
|
160
160
|
strokeWidth: "2",
|
|
161
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ u("path", { d: "M5 12h14M12 5l7 7-7 7" })
|
|
162
162
|
})
|
|
163
163
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ u("span", {
|
|
165
165
|
className: "ds-slide-label",
|
|
166
166
|
"aria-hidden": "true",
|
|
167
167
|
style: { opacity: p ? 0 : Math.max(0, 1 - a / 140) },
|
|
168
168
|
children: x
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ u("span", {
|
|
171
171
|
role: "status",
|
|
172
172
|
className: "ds-slide-status",
|
|
173
173
|
children: p ? "Confirmado" : ""
|
|
@@ -177,8 +177,8 @@ function F({ variant: e = "default", disabled: t = !1, label: n, onComplete: r }
|
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region src/components/Tabs.tsx
|
|
180
|
-
function
|
|
181
|
-
return /* @__PURE__ */
|
|
180
|
+
function L({ defaultValue: e, value: t, onValueChange: n, orientation: r = "horizontal", children: i }) {
|
|
181
|
+
return /* @__PURE__ */ u(f.Root, {
|
|
182
182
|
className: "ds-tabs",
|
|
183
183
|
defaultValue: e,
|
|
184
184
|
value: t,
|
|
@@ -187,23 +187,23 @@ function I({ defaultValue: e, value: t, onValueChange: n, orientation: r = "hori
|
|
|
187
187
|
children: i
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return /* @__PURE__ */
|
|
190
|
+
function R({ variant: e = "default", children: t }) {
|
|
191
|
+
return /* @__PURE__ */ u(f.List, {
|
|
192
192
|
className: "ds-tabs-list",
|
|
193
193
|
"data-variant": e,
|
|
194
194
|
children: t
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return /* @__PURE__ */
|
|
197
|
+
function z({ value: e, disabled: t, children: n }) {
|
|
198
|
+
return /* @__PURE__ */ u(f.Trigger, {
|
|
199
199
|
value: e,
|
|
200
200
|
disabled: t,
|
|
201
201
|
className: "ds-tab",
|
|
202
202
|
children: n
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return /* @__PURE__ */
|
|
205
|
+
function B({ value: e, children: t }) {
|
|
206
|
+
return /* @__PURE__ */ u(f.Content, {
|
|
207
207
|
value: e,
|
|
208
208
|
className: "ds-tab-panel",
|
|
209
209
|
children: t
|
|
@@ -211,57 +211,57 @@ function z({ value: e, children: t }) {
|
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/components/Select.tsx
|
|
214
|
-
function
|
|
215
|
-
let g = a(), _ = o ?? g, v = `${_}-hint`, y = /* @__PURE__ */
|
|
214
|
+
function V({ value: e, onValueChange: t, placeholder: n = "Seleccionar…", disabled: r, children: i, id: o, ariaLabel: s, label: c, supportingText: l, error: f = !1, ...h }) {
|
|
215
|
+
let g = a(), _ = o ?? g, v = `${_}-hint`, y = /* @__PURE__ */ d(p.Root, {
|
|
216
216
|
...h,
|
|
217
217
|
value: e,
|
|
218
218
|
onValueChange: t,
|
|
219
219
|
disabled: r,
|
|
220
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ d(p.Trigger, {
|
|
221
221
|
id: _,
|
|
222
222
|
"aria-label": c ? void 0 : s,
|
|
223
|
-
"aria-invalid":
|
|
224
|
-
"aria-describedby":
|
|
223
|
+
"aria-invalid": f || void 0,
|
|
224
|
+
"aria-describedby": l ? v : void 0,
|
|
225
225
|
className: "ds-select-trigger",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ u(p.Value, { placeholder: n }), /* @__PURE__ */ u(p.Icon, { children: /* @__PURE__ */ u(m, {
|
|
227
227
|
size: 16,
|
|
228
228
|
"aria-hidden": "true"
|
|
229
229
|
}) })]
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ u(p.Portal, { children: /* @__PURE__ */ u(p.Content, {
|
|
231
231
|
position: "popper",
|
|
232
232
|
sideOffset: 6,
|
|
233
233
|
className: "ds-select-content",
|
|
234
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ u(p.Viewport, {
|
|
235
235
|
className: "ds-select-viewport",
|
|
236
236
|
children: i
|
|
237
237
|
})
|
|
238
238
|
}) })]
|
|
239
239
|
});
|
|
240
|
-
return !c && !
|
|
240
|
+
return !c && !l ? y : /* @__PURE__ */ d("div", {
|
|
241
241
|
className: "ds-input",
|
|
242
|
-
"data-error":
|
|
242
|
+
"data-error": f,
|
|
243
243
|
"data-disabled": r,
|
|
244
244
|
children: [
|
|
245
|
-
c && /* @__PURE__ */
|
|
245
|
+
c && /* @__PURE__ */ u("label", {
|
|
246
246
|
htmlFor: _,
|
|
247
247
|
children: c
|
|
248
248
|
}),
|
|
249
249
|
y,
|
|
250
|
-
|
|
250
|
+
l && /* @__PURE__ */ u("small", {
|
|
251
251
|
id: v,
|
|
252
|
-
children:
|
|
252
|
+
children: l
|
|
253
253
|
})
|
|
254
254
|
]
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
return /* @__PURE__ */
|
|
257
|
+
function H({ value: e, disabled: t, children: n }) {
|
|
258
|
+
return /* @__PURE__ */ d(p.Item, {
|
|
259
259
|
value: e,
|
|
260
260
|
disabled: t,
|
|
261
261
|
className: "ds-select-item",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ u(p.ItemText, { children: n }), /* @__PURE__ */ u(p.ItemIndicator, {
|
|
263
263
|
className: "ds-select-check",
|
|
264
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ u(_, {
|
|
265
265
|
size: 16,
|
|
266
266
|
"aria-hidden": "true"
|
|
267
267
|
})
|
|
@@ -270,102 +270,102 @@ function V({ value: e, disabled: t, children: n }) {
|
|
|
270
270
|
}
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region src/components/Dialog.tsx
|
|
273
|
-
function
|
|
274
|
-
return /* @__PURE__ */
|
|
273
|
+
function ee({ open: e, onOpenChange: t, children: n, ...r }) {
|
|
274
|
+
return /* @__PURE__ */ u(E.Root, {
|
|
275
275
|
...r,
|
|
276
276
|
open: e,
|
|
277
277
|
onOpenChange: t,
|
|
278
278
|
children: n
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return t ? /* @__PURE__ */
|
|
281
|
+
function te({ children: e, asChild: t }) {
|
|
282
|
+
return t ? /* @__PURE__ */ u(E.Trigger, {
|
|
283
283
|
asChild: !0,
|
|
284
284
|
children: e
|
|
285
|
-
}) : /* @__PURE__ */
|
|
285
|
+
}) : /* @__PURE__ */ u(E.Trigger, {
|
|
286
286
|
className: "ds-button",
|
|
287
287
|
"data-variant": "primary",
|
|
288
288
|
"data-size": "md",
|
|
289
289
|
children: e
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return /* @__PURE__ */
|
|
292
|
+
function ne({ children: e, className: t = "", size: n = "md", showClose: r = !0, ...i }) {
|
|
293
|
+
return /* @__PURE__ */ d(E.Portal, { children: [/* @__PURE__ */ u(E.Overlay, { className: "ds-modal-overlay" }), /* @__PURE__ */ d(E.Content, {
|
|
294
294
|
...i,
|
|
295
295
|
"data-size": n,
|
|
296
296
|
className: `ds-modal-content ${t}`.trim(),
|
|
297
|
-
children: [e, r && /* @__PURE__ */
|
|
297
|
+
children: [e, r && /* @__PURE__ */ u(E.Close, {
|
|
298
298
|
"aria-label": "Cerrar diálogo",
|
|
299
299
|
className: "ds-modal-close",
|
|
300
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ u(T, {
|
|
301
301
|
size: 18,
|
|
302
302
|
"aria-hidden": "true"
|
|
303
303
|
})
|
|
304
304
|
})]
|
|
305
305
|
})] });
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
return /* @__PURE__ */
|
|
307
|
+
function re({ children: e }) {
|
|
308
|
+
return /* @__PURE__ */ u("div", {
|
|
309
309
|
className: "ds-modal-header",
|
|
310
310
|
children: e
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
return /* @__PURE__ */
|
|
313
|
+
function ie({ children: e }) {
|
|
314
|
+
return /* @__PURE__ */ u(E.Title, {
|
|
315
315
|
className: "ds-modal-title",
|
|
316
316
|
children: e
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return /* @__PURE__ */
|
|
319
|
+
function ae({ children: e }) {
|
|
320
|
+
return /* @__PURE__ */ u(E.Description, {
|
|
321
321
|
className: "ds-modal-description",
|
|
322
322
|
children: e
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
return /* @__PURE__ */
|
|
325
|
+
function oe({ children: e }) {
|
|
326
|
+
return /* @__PURE__ */ u("div", {
|
|
327
327
|
className: "ds-modal-body",
|
|
328
328
|
children: e
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return /* @__PURE__ */
|
|
331
|
+
function se({ children: e }) {
|
|
332
|
+
return /* @__PURE__ */ u("div", {
|
|
333
333
|
className: "ds-modal-footer",
|
|
334
334
|
children: e
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
return /* @__PURE__ */
|
|
337
|
+
function ce({ children: e }) {
|
|
338
|
+
return /* @__PURE__ */ u(E.Close, {
|
|
339
339
|
asChild: !0,
|
|
340
340
|
children: e
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region src/components/Checkbox.tsx
|
|
345
|
-
function
|
|
345
|
+
function le({ checked: e, onCheckedChange: t, disabled: n, label: r, id: i, ...o }) {
|
|
346
346
|
let s = a(), c = i ?? s;
|
|
347
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ d("label", {
|
|
348
348
|
htmlFor: c,
|
|
349
349
|
className: "ds-react-choice",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ u(D.Root, {
|
|
351
351
|
...o,
|
|
352
352
|
id: c,
|
|
353
353
|
checked: e,
|
|
354
354
|
onCheckedChange: t,
|
|
355
355
|
disabled: n,
|
|
356
356
|
className: "ds-react-checkbox",
|
|
357
|
-
children: /* @__PURE__ */
|
|
357
|
+
children: /* @__PURE__ */ u(D.Indicator, { children: /* @__PURE__ */ u(_, {
|
|
358
358
|
size: 14,
|
|
359
359
|
weight: "bold",
|
|
360
360
|
"aria-hidden": "true"
|
|
361
361
|
}) })
|
|
362
|
-
}), r && /* @__PURE__ */
|
|
362
|
+
}), r && /* @__PURE__ */ u("span", { children: r })]
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/RadioGroup.tsx
|
|
367
|
-
function
|
|
368
|
-
return /* @__PURE__ */
|
|
367
|
+
function ue({ value: e, defaultValue: t, name: n, onValueChange: r, disabled: i, ariaLabel: a, orientation: o = "vertical", children: s }) {
|
|
368
|
+
return /* @__PURE__ */ u(O.Root, {
|
|
369
369
|
value: e,
|
|
370
370
|
defaultValue: t,
|
|
371
371
|
name: n,
|
|
@@ -377,84 +377,84 @@ function le({ value: e, defaultValue: t, name: n, onValueChange: r, disabled: i,
|
|
|
377
377
|
children: s
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function de({ value: e, disabled: t, label: n, id: r }) {
|
|
381
381
|
let i = a(), o = r ?? i;
|
|
382
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ d("label", {
|
|
383
383
|
htmlFor: o,
|
|
384
384
|
className: "ds-react-choice",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ u(O.Item, {
|
|
386
386
|
id: o,
|
|
387
387
|
value: e,
|
|
388
388
|
disabled: t,
|
|
389
389
|
className: "ds-react-radio",
|
|
390
|
-
children: /* @__PURE__ */
|
|
391
|
-
}), n && /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ u(O.Indicator, { className: "ds-react-radio-indicator" })
|
|
391
|
+
}), n && /* @__PURE__ */ u("span", { children: n })]
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/components/Switch.tsx
|
|
396
|
-
function
|
|
396
|
+
function fe({ checked: e, onCheckedChange: t, disabled: n, label: r, id: i, ...o }) {
|
|
397
397
|
let s = a(), c = i ?? s;
|
|
398
|
-
return /* @__PURE__ */
|
|
398
|
+
return /* @__PURE__ */ d("label", {
|
|
399
399
|
htmlFor: c,
|
|
400
400
|
className: "ds-react-choice",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ u(k.Root, {
|
|
402
402
|
...o,
|
|
403
403
|
id: c,
|
|
404
404
|
checked: e,
|
|
405
405
|
onCheckedChange: t,
|
|
406
406
|
disabled: n,
|
|
407
407
|
className: "ds-react-switch",
|
|
408
|
-
children: /* @__PURE__ */
|
|
409
|
-
}), r && /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ u(k.Thumb, { className: "ds-react-switch-thumb" })
|
|
409
|
+
}), r && /* @__PURE__ */ u("span", { children: r })]
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
//#endregion
|
|
413
413
|
//#region src/components/Alert.tsx
|
|
414
|
-
var
|
|
415
|
-
info: /* @__PURE__ */
|
|
416
|
-
success: /* @__PURE__ */
|
|
417
|
-
warning: /* @__PURE__ */
|
|
418
|
-
error: /* @__PURE__ */
|
|
414
|
+
var pe = {
|
|
415
|
+
info: /* @__PURE__ */ u(y, { weight: "fill" }),
|
|
416
|
+
success: /* @__PURE__ */ u(v, { weight: "fill" }),
|
|
417
|
+
warning: /* @__PURE__ */ u(C, { weight: "fill" }),
|
|
418
|
+
error: /* @__PURE__ */ u(w, { weight: "fill" })
|
|
419
419
|
};
|
|
420
|
-
function
|
|
421
|
-
let [
|
|
422
|
-
return
|
|
420
|
+
function me({ variant: e = "info", title: t, description: n, dismissible: r = !1, icon: i, actions: a, onClose: o, children: s }) {
|
|
421
|
+
let [l, f] = c(!0);
|
|
422
|
+
return l ? /* @__PURE__ */ d("div", {
|
|
423
423
|
className: "ds-alert",
|
|
424
424
|
"data-variant": e,
|
|
425
425
|
role: e === "error" ? "alert" : "status",
|
|
426
426
|
children: [
|
|
427
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ u("span", {
|
|
428
428
|
className: "ds-alert-icon",
|
|
429
429
|
"aria-hidden": "true",
|
|
430
|
-
children: i ??
|
|
430
|
+
children: i ?? pe[e]
|
|
431
431
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ d("div", {
|
|
433
433
|
className: "ds-alert-content",
|
|
434
434
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ u("p", {
|
|
436
436
|
className: "ds-alert-title",
|
|
437
437
|
children: t
|
|
438
438
|
}),
|
|
439
|
-
n && /* @__PURE__ */
|
|
439
|
+
n && /* @__PURE__ */ u("div", {
|
|
440
440
|
className: "ds-alert-description",
|
|
441
441
|
children: n
|
|
442
442
|
}),
|
|
443
443
|
s,
|
|
444
|
-
a && /* @__PURE__ */
|
|
444
|
+
a && /* @__PURE__ */ u("div", {
|
|
445
445
|
className: "ds-alert-actions",
|
|
446
446
|
children: a
|
|
447
447
|
})
|
|
448
448
|
]
|
|
449
449
|
}),
|
|
450
|
-
r && /* @__PURE__ */
|
|
450
|
+
r && /* @__PURE__ */ u("button", {
|
|
451
451
|
type: "button",
|
|
452
452
|
className: "ds-alert-close",
|
|
453
453
|
"aria-label": "Cerrar alerta",
|
|
454
454
|
onClick: () => {
|
|
455
455
|
f(!1), o?.();
|
|
456
456
|
},
|
|
457
|
-
children: /* @__PURE__ */
|
|
457
|
+
children: /* @__PURE__ */ u(T, {
|
|
458
458
|
size: 16,
|
|
459
459
|
"aria-hidden": "true"
|
|
460
460
|
})
|
|
@@ -464,40 +464,40 @@ function pe({ variant: e = "info", title: t, description: n, dismissible: r = !1
|
|
|
464
464
|
}
|
|
465
465
|
//#endregion
|
|
466
466
|
//#region src/components/Avatar.tsx
|
|
467
|
-
var
|
|
467
|
+
var he = {
|
|
468
468
|
online: "En línea",
|
|
469
469
|
offline: "Desconectado",
|
|
470
470
|
away: "Ausente",
|
|
471
471
|
busy: "Ocupado"
|
|
472
472
|
};
|
|
473
|
-
function
|
|
473
|
+
function ge(e) {
|
|
474
474
|
return (e ?? "").trim().split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e.charAt(0).toUpperCase()).join("") || "?";
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
let [o, s] = c(),
|
|
478
|
-
return /* @__PURE__ */
|
|
476
|
+
function _e({ src: e, alt: t, size: n = "md", fallback: r, status: i, shape: a = "circle" }) {
|
|
477
|
+
let [o, s] = c(), l = !e || o === e, f = [t || r || "Usuario", i ? he[i] : null].filter(Boolean).join(", ");
|
|
478
|
+
return /* @__PURE__ */ d("span", {
|
|
479
479
|
className: "ds-avatar",
|
|
480
480
|
"data-size": n,
|
|
481
481
|
"data-shape": a,
|
|
482
482
|
role: "img",
|
|
483
483
|
"aria-label": f,
|
|
484
|
-
children: [
|
|
484
|
+
children: [l ? /* @__PURE__ */ u("span", {
|
|
485
485
|
className: "ds-avatar-fallback",
|
|
486
486
|
"aria-hidden": "true",
|
|
487
|
-
children: r ||
|
|
488
|
-
}) : /* @__PURE__ */
|
|
487
|
+
children: r || ge(t)
|
|
488
|
+
}) : /* @__PURE__ */ u("img", {
|
|
489
489
|
src: e,
|
|
490
490
|
alt: "",
|
|
491
491
|
onError: () => s(e)
|
|
492
|
-
}), i && /* @__PURE__ */
|
|
492
|
+
}), i && /* @__PURE__ */ u("span", {
|
|
493
493
|
className: "ds-avatar-status",
|
|
494
494
|
"data-status": i,
|
|
495
495
|
"aria-hidden": "true"
|
|
496
496
|
})]
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
return /* @__PURE__ */
|
|
499
|
+
function ve({ children: e, label: t }) {
|
|
500
|
+
return /* @__PURE__ */ u("span", {
|
|
501
501
|
className: "ds-avatar-group",
|
|
502
502
|
role: "group",
|
|
503
503
|
"aria-label": t,
|
|
@@ -506,23 +506,23 @@ function _e({ children: e, label: t }) {
|
|
|
506
506
|
}
|
|
507
507
|
//#endregion
|
|
508
508
|
//#region src/components/Badge.tsx
|
|
509
|
-
function
|
|
510
|
-
return /* @__PURE__ */
|
|
509
|
+
function ye({ variant: e = "primary", size: t = "md", dot: n = !1, removable: r = !1, removeLabel: i = "Quitar etiqueta", onRemove: a, children: o }) {
|
|
510
|
+
return /* @__PURE__ */ d("span", {
|
|
511
511
|
className: "ds-badge",
|
|
512
512
|
"data-variant": e,
|
|
513
513
|
"data-size": t,
|
|
514
514
|
children: [
|
|
515
|
-
n && /* @__PURE__ */
|
|
515
|
+
n && /* @__PURE__ */ u("span", {
|
|
516
516
|
className: "ds-badge-dot",
|
|
517
517
|
"aria-hidden": "true"
|
|
518
518
|
}),
|
|
519
519
|
o,
|
|
520
|
-
r && a && /* @__PURE__ */
|
|
520
|
+
r && a && /* @__PURE__ */ u("button", {
|
|
521
521
|
type: "button",
|
|
522
522
|
className: "ds-badge-remove",
|
|
523
523
|
onClick: a,
|
|
524
524
|
"aria-label": i,
|
|
525
|
-
children: /* @__PURE__ */
|
|
525
|
+
children: /* @__PURE__ */ u(T, {
|
|
526
526
|
size: 12,
|
|
527
527
|
weight: "bold",
|
|
528
528
|
"aria-hidden": "true"
|
|
@@ -533,8 +533,8 @@ function ve({ variant: e = "primary", size: t = "md", dot: n = !1, removable: r
|
|
|
533
533
|
}
|
|
534
534
|
//#endregion
|
|
535
535
|
//#region src/components/Card.tsx
|
|
536
|
-
function
|
|
537
|
-
return /* @__PURE__ */
|
|
536
|
+
function be({ variant: e = "default", padding: t = "md", selected: n = !1, onClick: r, header: i, title: a, description: o, footer: s, className: c = "", children: l }) {
|
|
537
|
+
return /* @__PURE__ */ d("div", {
|
|
538
538
|
className: `ds-card ${c}`.trim(),
|
|
539
539
|
"data-variant": e,
|
|
540
540
|
"data-padding": t,
|
|
@@ -550,25 +550,25 @@ function ye({ variant: e = "default", padding: t = "md", selected: n = !1, onCli
|
|
|
550
550
|
r && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
|
|
551
551
|
} : void 0,
|
|
552
552
|
children: [
|
|
553
|
-
i && /* @__PURE__ */
|
|
553
|
+
i && /* @__PURE__ */ u("div", {
|
|
554
554
|
className: "ds-card-header",
|
|
555
555
|
children: i
|
|
556
556
|
}),
|
|
557
|
-
(a || o) && /* @__PURE__ */
|
|
557
|
+
(a || o) && /* @__PURE__ */ d("div", {
|
|
558
558
|
className: "ds-card-header",
|
|
559
|
-
children: [a && /* @__PURE__ */
|
|
559
|
+
children: [a && /* @__PURE__ */ u("h3", {
|
|
560
560
|
className: "ds-card-title",
|
|
561
561
|
children: a
|
|
562
|
-
}), o && /* @__PURE__ */
|
|
562
|
+
}), o && /* @__PURE__ */ u("p", {
|
|
563
563
|
className: "ds-card-description",
|
|
564
564
|
children: o
|
|
565
565
|
})]
|
|
566
566
|
}),
|
|
567
|
-
|
|
567
|
+
l !== void 0 && /* @__PURE__ */ u("div", {
|
|
568
568
|
className: "ds-card-content",
|
|
569
|
-
children:
|
|
569
|
+
children: l
|
|
570
570
|
}),
|
|
571
|
-
s && /* @__PURE__ */
|
|
571
|
+
s && /* @__PURE__ */ u("div", {
|
|
572
572
|
className: "ds-card-footer",
|
|
573
573
|
children: s
|
|
574
574
|
})
|
|
@@ -577,59 +577,59 @@ function ye({ variant: e = "default", padding: t = "md", selected: n = !1, onCli
|
|
|
577
577
|
}
|
|
578
578
|
//#endregion
|
|
579
579
|
//#region src/components/Tooltip.tsx
|
|
580
|
-
function
|
|
581
|
-
return /* @__PURE__ */
|
|
580
|
+
function xe({ content: e, position: t = "top", delay: n = 300, children: r }) {
|
|
581
|
+
return /* @__PURE__ */ u(A.Provider, {
|
|
582
582
|
delayDuration: n,
|
|
583
|
-
children: /* @__PURE__ */
|
|
583
|
+
children: /* @__PURE__ */ d(A.Root, { children: [/* @__PURE__ */ u(A.Trigger, {
|
|
584
584
|
asChild: !0,
|
|
585
585
|
children: r
|
|
586
|
-
}), /* @__PURE__ */
|
|
586
|
+
}), /* @__PURE__ */ u(A.Portal, { children: /* @__PURE__ */ d(A.Content, {
|
|
587
587
|
side: t,
|
|
588
588
|
sideOffset: 8,
|
|
589
589
|
className: "ds-tooltip",
|
|
590
|
-
children: [e, /* @__PURE__ */
|
|
590
|
+
children: [e, /* @__PURE__ */ u(A.Arrow, { className: "ds-tooltip-arrow" })]
|
|
591
591
|
}) })] })
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region src/components/Loading.tsx
|
|
596
|
-
function
|
|
597
|
-
return e === "spinner" ? /* @__PURE__ */
|
|
596
|
+
function Se({ variant: e = "spinner", size: t = "md", label: n, progress: r }) {
|
|
597
|
+
return e === "spinner" ? /* @__PURE__ */ u(U, {
|
|
598
598
|
size: t,
|
|
599
599
|
label: n,
|
|
600
600
|
showLabel: !!n
|
|
601
|
-
}) : e === "dots" ? /* @__PURE__ */
|
|
601
|
+
}) : e === "dots" ? /* @__PURE__ */ u("span", {
|
|
602
602
|
className: "ds-loading",
|
|
603
603
|
role: "status",
|
|
604
604
|
"aria-label": n || "Cargando",
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ d("span", {
|
|
606
606
|
className: "ds-loading-dots",
|
|
607
607
|
"aria-hidden": "true",
|
|
608
608
|
children: [
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ u("span", {}),
|
|
610
|
+
/* @__PURE__ */ u("span", {}),
|
|
611
|
+
/* @__PURE__ */ u("span", {})
|
|
612
612
|
]
|
|
613
613
|
})
|
|
614
|
-
}) : e === "skeleton" ? /* @__PURE__ */
|
|
614
|
+
}) : e === "skeleton" ? /* @__PURE__ */ u(W, { label: n }) : /* @__PURE__ */ u(G, {
|
|
615
615
|
value: r ?? 0,
|
|
616
616
|
label: n
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
619
|
function U({ size: e = "md", label: t = "Cargando", showLabel: n = !1 }) {
|
|
620
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ d("span", {
|
|
621
621
|
className: "ds-loading",
|
|
622
622
|
role: "status",
|
|
623
623
|
"aria-label": n ? void 0 : t,
|
|
624
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ u("span", {
|
|
625
625
|
className: "ds-spinner",
|
|
626
626
|
"data-size": e,
|
|
627
627
|
"aria-hidden": "true"
|
|
628
|
-
}), n && /* @__PURE__ */
|
|
628
|
+
}), n && /* @__PURE__ */ u("span", { children: t })]
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
function W({ lines: e = 3, avatar: t = !1, label: n = "Cargando contenido" }) {
|
|
632
|
-
return /* @__PURE__ */
|
|
632
|
+
return /* @__PURE__ */ d("div", {
|
|
633
633
|
role: "status",
|
|
634
634
|
"aria-label": n,
|
|
635
635
|
style: t ? {
|
|
@@ -637,19 +637,19 @@ function W({ lines: e = 3, avatar: t = !1, label: n = "Cargando contenido" }) {
|
|
|
637
637
|
gap: 12,
|
|
638
638
|
alignItems: "flex-start"
|
|
639
639
|
} : void 0,
|
|
640
|
-
children: [t && /* @__PURE__ */
|
|
640
|
+
children: [t && /* @__PURE__ */ u("span", {
|
|
641
641
|
className: "ds-skeleton-circle",
|
|
642
642
|
"aria-hidden": "true"
|
|
643
|
-
}), /* @__PURE__ */
|
|
643
|
+
}), /* @__PURE__ */ u("span", {
|
|
644
644
|
className: "ds-skeleton",
|
|
645
645
|
"aria-hidden": "true",
|
|
646
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
646
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("span", {}, t))
|
|
647
647
|
})]
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
function G({ value: e = 0, max: t = 100, label: n, showValue: r = !0, size: i = "md", variant: a = "primary", indeterminate: o = !1 }) {
|
|
651
651
|
let s = t > 0 ? t : 100, c = Math.round(Math.min(100, Math.max(0, (Number.isFinite(e) ? e : 0) / s * 100)));
|
|
652
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ d("div", {
|
|
653
653
|
className: "ds-progress",
|
|
654
654
|
"data-size": i,
|
|
655
655
|
"data-variant": a,
|
|
@@ -659,13 +659,13 @@ function G({ value: e = 0, max: t = 100, label: n, showValue: r = !0, size: i =
|
|
|
659
659
|
"aria-valuemin": 0,
|
|
660
660
|
"aria-valuemax": 100,
|
|
661
661
|
"aria-valuenow": o ? void 0 : c,
|
|
662
|
-
children: [n && /* @__PURE__ */
|
|
662
|
+
children: [n && /* @__PURE__ */ d("span", {
|
|
663
663
|
className: "ds-progress-header",
|
|
664
|
-
children: [/* @__PURE__ */
|
|
665
|
-
}), /* @__PURE__ */
|
|
664
|
+
children: [/* @__PURE__ */ u("span", { children: n }), r && !o && /* @__PURE__ */ d("span", { children: [c, "%"] })]
|
|
665
|
+
}), /* @__PURE__ */ u("span", {
|
|
666
666
|
className: "ds-progress-track",
|
|
667
667
|
"aria-hidden": "true",
|
|
668
|
-
children: /* @__PURE__ */
|
|
668
|
+
children: /* @__PURE__ */ u("span", {
|
|
669
669
|
className: "ds-progress-value",
|
|
670
670
|
style: { width: `${c}%` }
|
|
671
671
|
})
|
|
@@ -674,25 +674,25 @@ function G({ value: e = 0, max: t = 100, label: n, showValue: r = !0, size: i =
|
|
|
674
674
|
}
|
|
675
675
|
//#endregion
|
|
676
676
|
//#region src/components/EmptyState.tsx
|
|
677
|
-
var
|
|
678
|
-
default: /* @__PURE__ */
|
|
679
|
-
"no-data": /* @__PURE__ */
|
|
680
|
-
error: /* @__PURE__ */
|
|
681
|
-
"no-results": /* @__PURE__ */
|
|
677
|
+
var Ce = {
|
|
678
|
+
default: /* @__PURE__ */ u(x, {}),
|
|
679
|
+
"no-data": /* @__PURE__ */ u(S, {}),
|
|
680
|
+
error: /* @__PURE__ */ u(w, {}),
|
|
681
|
+
"no-results": /* @__PURE__ */ u(b, {})
|
|
682
682
|
};
|
|
683
|
-
function
|
|
684
|
-
return /* @__PURE__ */
|
|
683
|
+
function we({ variant: e = "default", title: t, description: n, action: r, icon: i }) {
|
|
684
|
+
return /* @__PURE__ */ d("div", {
|
|
685
685
|
className: "ds-empty-state",
|
|
686
686
|
"data-variant": e,
|
|
687
687
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ u("div", {
|
|
689
689
|
className: "ds-empty-state-icon",
|
|
690
690
|
"aria-hidden": "true",
|
|
691
|
-
children: i ??
|
|
691
|
+
children: i ?? Ce[e]
|
|
692
692
|
}),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
n && /* @__PURE__ */
|
|
695
|
-
r && /* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ u("h3", { children: t }),
|
|
694
|
+
n && /* @__PURE__ */ u("p", { children: n }),
|
|
695
|
+
r && /* @__PURE__ */ u("div", {
|
|
696
696
|
className: "ds-empty-state-action",
|
|
697
697
|
children: r
|
|
698
698
|
})
|
|
@@ -701,32 +701,32 @@ function Ce({ variant: e = "default", title: t, description: n, action: r, icon:
|
|
|
701
701
|
}
|
|
702
702
|
//#endregion
|
|
703
703
|
//#region src/components/BottomSheet.tsx
|
|
704
|
-
function
|
|
705
|
-
return /* @__PURE__ */
|
|
704
|
+
function Te({ isOpen: e, onClose: t, title: n, children: r }) {
|
|
705
|
+
return /* @__PURE__ */ u(E.Root, {
|
|
706
706
|
open: e,
|
|
707
707
|
onOpenChange: (e) => {
|
|
708
708
|
e || t();
|
|
709
709
|
},
|
|
710
|
-
children: /* @__PURE__ */
|
|
710
|
+
children: /* @__PURE__ */ d(E.Portal, { children: [/* @__PURE__ */ u(E.Overlay, { className: "ds-sheet-overlay" }), /* @__PURE__ */ d(E.Content, {
|
|
711
711
|
className: "ds-sheet",
|
|
712
712
|
"aria-describedby": void 0,
|
|
713
713
|
children: [
|
|
714
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ u("div", {
|
|
715
715
|
className: "ds-sheet-handle",
|
|
716
716
|
"aria-hidden": "true"
|
|
717
717
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ d("header", {
|
|
719
719
|
className: "ds-sheet-header",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
720
|
+
children: [/* @__PURE__ */ u(E.Title, { children: n ?? "Información" }), /* @__PURE__ */ u(E.Close, {
|
|
721
721
|
"aria-label": "Cerrar panel",
|
|
722
722
|
className: "ds-sheet-close",
|
|
723
|
-
children: /* @__PURE__ */
|
|
723
|
+
children: /* @__PURE__ */ u(T, {
|
|
724
724
|
size: 20,
|
|
725
725
|
"aria-hidden": "true"
|
|
726
726
|
})
|
|
727
727
|
})]
|
|
728
728
|
}),
|
|
729
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ u("div", {
|
|
730
730
|
className: "ds-sheet-body",
|
|
731
731
|
children: r
|
|
732
732
|
})
|
|
@@ -736,30 +736,30 @@ function we({ isOpen: e, onClose: t, title: n, children: r }) {
|
|
|
736
736
|
}
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/components/Dropdown.tsx
|
|
739
|
-
function
|
|
740
|
-
return /* @__PURE__ */
|
|
739
|
+
function Ee({ trigger: e, items: t, onSelect: n, label: r, align: i = "start" }) {
|
|
740
|
+
return /* @__PURE__ */ d(j.Root, { children: [/* @__PURE__ */ u(j.Trigger, {
|
|
741
741
|
asChild: !0,
|
|
742
742
|
children: e
|
|
743
|
-
}), /* @__PURE__ */
|
|
743
|
+
}), /* @__PURE__ */ u(j.Portal, { children: /* @__PURE__ */ d(j.Content, {
|
|
744
744
|
sideOffset: 6,
|
|
745
745
|
align: i,
|
|
746
746
|
className: "ds-dropdown",
|
|
747
|
-
children: [r && /* @__PURE__ */
|
|
747
|
+
children: [r && /* @__PURE__ */ u(j.Label, {
|
|
748
748
|
className: "ds-dropdown-label",
|
|
749
749
|
children: r
|
|
750
|
-
}), t.map((e) => e.divider ? /* @__PURE__ */
|
|
750
|
+
}), t.map((e) => e.divider ? /* @__PURE__ */ u(j.Separator, { className: "ds-dropdown-separator" }, e.id) : /* @__PURE__ */ d(j.Item, {
|
|
751
751
|
disabled: e.disabled,
|
|
752
752
|
onSelect: () => n(e.id),
|
|
753
753
|
className: "ds-dropdown-item",
|
|
754
754
|
"data-variant": e.danger ? "danger" : void 0,
|
|
755
755
|
children: [
|
|
756
|
-
e.icon && /* @__PURE__ */
|
|
756
|
+
e.icon && /* @__PURE__ */ u("span", {
|
|
757
757
|
className: "ds-dropdown-item-icon",
|
|
758
758
|
"aria-hidden": "true",
|
|
759
759
|
children: e.icon
|
|
760
760
|
}),
|
|
761
761
|
e.label,
|
|
762
|
-
e.shortcut && /* @__PURE__ */
|
|
762
|
+
e.shortcut && /* @__PURE__ */ u("span", {
|
|
763
763
|
className: "ds-dropdown-shortcut",
|
|
764
764
|
children: e.shortcut
|
|
765
765
|
})
|
|
@@ -769,30 +769,30 @@ function Te({ trigger: e, items: t, onSelect: n, label: r, align: i = "start" })
|
|
|
769
769
|
}
|
|
770
770
|
//#endregion
|
|
771
771
|
//#region src/components/TextField.tsx
|
|
772
|
-
var
|
|
773
|
-
let _ = a(), v =
|
|
774
|
-
return /* @__PURE__ */
|
|
772
|
+
var K = t(function({ label: e, supportingText: t, error: n = !1, disabled: r = !1, size: i = "md", leftIcon: o, rightIcon: s, onChange: c, id: l, type: f = "text", required: p, "aria-describedby": m, ...h }, g) {
|
|
773
|
+
let _ = a(), v = l ?? _, y = `${v}-hint`;
|
|
774
|
+
return /* @__PURE__ */ d("div", {
|
|
775
775
|
className: "ds-input",
|
|
776
776
|
"data-error": n,
|
|
777
777
|
"data-disabled": r,
|
|
778
778
|
"data-size": i,
|
|
779
779
|
children: [
|
|
780
|
-
e && /* @__PURE__ */
|
|
780
|
+
e && /* @__PURE__ */ d("label", {
|
|
781
781
|
htmlFor: v,
|
|
782
|
-
children: [e, p && /* @__PURE__ */
|
|
782
|
+
children: [e, p && /* @__PURE__ */ u("span", {
|
|
783
783
|
className: "ds-input-required",
|
|
784
784
|
"aria-hidden": "true",
|
|
785
785
|
children: "*"
|
|
786
786
|
})]
|
|
787
787
|
}),
|
|
788
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ d("div", {
|
|
789
789
|
className: "ds-input-shell",
|
|
790
790
|
children: [
|
|
791
|
-
o && /* @__PURE__ */
|
|
791
|
+
o && /* @__PURE__ */ u("span", {
|
|
792
792
|
"aria-hidden": "true",
|
|
793
793
|
children: o
|
|
794
794
|
}),
|
|
795
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ u("input", {
|
|
796
796
|
...h,
|
|
797
797
|
ref: g,
|
|
798
798
|
id: v,
|
|
@@ -803,41 +803,41 @@ var Ee = t(function({ label: e, supportingText: t, error: n = !1, disabled: r =
|
|
|
803
803
|
"aria-describedby": [m, t ? y : null].filter(Boolean).join(" ") || void 0,
|
|
804
804
|
onChange: (e) => c?.(e.target.value)
|
|
805
805
|
}),
|
|
806
|
-
s && /* @__PURE__ */
|
|
806
|
+
s && /* @__PURE__ */ u("span", {
|
|
807
807
|
"aria-hidden": "true",
|
|
808
808
|
children: s
|
|
809
809
|
})
|
|
810
810
|
]
|
|
811
811
|
}),
|
|
812
|
-
t && /* @__PURE__ */
|
|
812
|
+
t && /* @__PURE__ */ u("small", {
|
|
813
813
|
id: y,
|
|
814
814
|
children: t
|
|
815
815
|
})
|
|
816
816
|
]
|
|
817
817
|
});
|
|
818
|
-
}), De = t(function({ label: e, supportingText: t, error: n = !1, disabled: r = !1, showCount: i = !1, onChange: o, id: s, rows:
|
|
818
|
+
}), De = t(function({ label: e, supportingText: t, error: n = !1, disabled: r = !1, showCount: i = !1, onChange: o, id: s, rows: l = 4, value: f, defaultValue: p, maxLength: m, required: h, "aria-describedby": g, ..._ }, v) {
|
|
819
819
|
let y = a(), b = s ?? y, x = `${b}-hint`, [S, C] = c(String(p ?? "")), w = String(f ?? S).length;
|
|
820
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ d("div", {
|
|
821
821
|
className: "ds-input",
|
|
822
822
|
"data-multiline": "true",
|
|
823
823
|
"data-error": n,
|
|
824
824
|
"data-disabled": r,
|
|
825
825
|
children: [
|
|
826
|
-
e && /* @__PURE__ */
|
|
826
|
+
e && /* @__PURE__ */ d("label", {
|
|
827
827
|
htmlFor: b,
|
|
828
|
-
children: [e, h && /* @__PURE__ */
|
|
828
|
+
children: [e, h && /* @__PURE__ */ u("span", {
|
|
829
829
|
className: "ds-input-required",
|
|
830
830
|
"aria-hidden": "true",
|
|
831
831
|
children: "*"
|
|
832
832
|
})]
|
|
833
833
|
}),
|
|
834
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ u("div", {
|
|
835
835
|
className: "ds-input-shell",
|
|
836
|
-
children: /* @__PURE__ */
|
|
836
|
+
children: /* @__PURE__ */ u("textarea", {
|
|
837
837
|
..._,
|
|
838
838
|
ref: v,
|
|
839
839
|
id: b,
|
|
840
|
-
rows:
|
|
840
|
+
rows: l,
|
|
841
841
|
disabled: r,
|
|
842
842
|
required: h,
|
|
843
843
|
value: f,
|
|
@@ -850,16 +850,16 @@ var Ee = t(function({ label: e, supportingText: t, error: n = !1, disabled: r =
|
|
|
850
850
|
}
|
|
851
851
|
})
|
|
852
852
|
}),
|
|
853
|
-
(t || i && m) && /* @__PURE__ */
|
|
853
|
+
(t || i && m) && /* @__PURE__ */ d("span", {
|
|
854
854
|
style: {
|
|
855
855
|
display: "flex",
|
|
856
856
|
gap: 12,
|
|
857
857
|
justifyContent: "space-between"
|
|
858
858
|
},
|
|
859
|
-
children: [t ? /* @__PURE__ */
|
|
859
|
+
children: [t ? /* @__PURE__ */ u("small", {
|
|
860
860
|
id: x,
|
|
861
861
|
children: t
|
|
862
|
-
}) : /* @__PURE__ */
|
|
862
|
+
}) : /* @__PURE__ */ u("span", {}), i && m && /* @__PURE__ */ d("span", {
|
|
863
863
|
className: "ds-input-counter",
|
|
864
864
|
children: [
|
|
865
865
|
w,
|
|
@@ -873,26 +873,26 @@ var Ee = t(function({ label: e, supportingText: t, error: n = !1, disabled: r =
|
|
|
873
873
|
});
|
|
874
874
|
//#endregion
|
|
875
875
|
//#region src/core/dates.ts
|
|
876
|
-
function
|
|
876
|
+
function q(e) {
|
|
877
877
|
return e instanceof Date && Number.isFinite(e.getTime());
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function J(e) {
|
|
880
880
|
return `${e.getFullYear().toString().padStart(4, "0")}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${e.getDate().toString().padStart(2, "0")}`;
|
|
881
881
|
}
|
|
882
882
|
function Oe(e) {
|
|
883
883
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7;
|
|
884
884
|
return Array.from({ length: 42 }, (e, r) => new Date(t.getFullYear(), t.getMonth(), 1 - n + r));
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Y(e, t) {
|
|
887
887
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function X(e, t) {
|
|
890
890
|
let n = new Date(e.getFullYear(), e.getMonth() + t, 1), r = new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate();
|
|
891
891
|
return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
let r =
|
|
895
|
-
return (!
|
|
893
|
+
function Z(e, t, n) {
|
|
894
|
+
let r = J(e);
|
|
895
|
+
return (!q(t) || r >= J(t)) && (!q(n) || r <= J(n));
|
|
896
896
|
}
|
|
897
897
|
//#endregion
|
|
898
898
|
//#region src/components/DatePicker.tsx
|
|
@@ -905,8 +905,8 @@ var ke = [
|
|
|
905
905
|
"Sábado",
|
|
906
906
|
"Domingo"
|
|
907
907
|
];
|
|
908
|
-
function Ae({ value: e, defaultValue: t, onChange: r, placeholder: o = "Seleccionar fecha", disabled:
|
|
909
|
-
let [v, y] = c(t), b = e ?? v, [x, S] = c(!1), [C, w] = c(() =>
|
|
908
|
+
function Ae({ value: e, defaultValue: t, onChange: r, placeholder: o = "Seleccionar fecha", disabled: l = !1, format: f = "dd/MM/yyyy", name: p, id: m, label: h, min: g, max: _ }) {
|
|
909
|
+
let [v, y] = c(t), b = e ?? v, [x, S] = c(!1), [C, w] = c(() => q(b) ? b : /* @__PURE__ */ new Date()), [T, D] = c({
|
|
910
910
|
left: 8,
|
|
911
911
|
top: 8
|
|
912
912
|
}), O = s(null), k = s(null), A = s(!1), j = a(), M = m ?? j, N = `${M}-calendar`, P = n(() => {
|
|
@@ -924,105 +924,105 @@ function Ae({ value: e, defaultValue: t, onChange: r, placeholder: o = "Seleccio
|
|
|
924
924
|
x && A.current && (k.current?.querySelector("[data-calendar-focus=\"true\"]")?.focus(), A.current = !1);
|
|
925
925
|
}, [C, x]);
|
|
926
926
|
function F(e) {
|
|
927
|
-
return
|
|
927
|
+
return q(g) && J(e) < J(g) ? new Date(g.getFullYear(), g.getMonth(), g.getDate()) : q(_) && J(e) > J(_) ? new Date(_.getFullYear(), _.getMonth(), _.getDate()) : e;
|
|
928
928
|
}
|
|
929
929
|
let I = C.toLocaleDateString("es-PE", {
|
|
930
930
|
month: "long",
|
|
931
931
|
year: "numeric"
|
|
932
|
-
}), L =
|
|
932
|
+
}), L = q(b) ? f === "yyyy-MM-dd" ? J(b) : `${String(b.getDate()).padStart(2, "0")}/${String(b.getMonth() + 1).padStart(2, "0")}/${b.getFullYear()}` : "", R = Oe(C), z = J(/* @__PURE__ */ new Date()), B = !q(g) || J(new Date(C.getFullYear(), C.getMonth(), 0)) >= J(g), V = !q(_) || J(new Date(C.getFullYear(), C.getMonth() + 1, 1)) <= J(_);
|
|
933
933
|
function H(t) {
|
|
934
|
-
!
|
|
934
|
+
!l && Z(t, g, _) && (e === void 0 && y(t), r?.(t), S(!1));
|
|
935
935
|
}
|
|
936
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ d("div", {
|
|
937
937
|
className: "ds-date-field",
|
|
938
938
|
children: [
|
|
939
|
-
h && /* @__PURE__ */
|
|
939
|
+
h && /* @__PURE__ */ u("label", {
|
|
940
940
|
htmlFor: M,
|
|
941
941
|
children: h
|
|
942
942
|
}),
|
|
943
|
-
p && /* @__PURE__ */
|
|
943
|
+
p && /* @__PURE__ */ u("input", {
|
|
944
944
|
type: "hidden",
|
|
945
945
|
name: p,
|
|
946
|
-
value:
|
|
947
|
-
disabled:
|
|
946
|
+
value: q(b) ? J(b) : "",
|
|
947
|
+
disabled: l
|
|
948
948
|
}),
|
|
949
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ d(E.Root, {
|
|
950
950
|
modal: !1,
|
|
951
951
|
open: x,
|
|
952
952
|
onOpenChange: (e) => {
|
|
953
|
-
e &&
|
|
953
|
+
e && l || (e && (w(F(q(b) ? b : /* @__PURE__ */ new Date())), P()), S(e));
|
|
954
954
|
},
|
|
955
|
-
children: [/* @__PURE__ */
|
|
955
|
+
children: [/* @__PURE__ */ u(E.Trigger, {
|
|
956
956
|
asChild: !0,
|
|
957
|
-
children: /* @__PURE__ */
|
|
957
|
+
children: /* @__PURE__ */ u("button", {
|
|
958
958
|
ref: O,
|
|
959
959
|
id: M,
|
|
960
960
|
type: "button",
|
|
961
|
-
disabled:
|
|
961
|
+
disabled: l,
|
|
962
962
|
"aria-label": `${h ?? o}${L ? ": " + L : ""}`,
|
|
963
963
|
className: "ds-date-trigger",
|
|
964
964
|
children: L || o
|
|
965
965
|
})
|
|
966
|
-
}), /* @__PURE__ */
|
|
966
|
+
}), /* @__PURE__ */ u(E.Portal, { children: /* @__PURE__ */ d(E.Content, {
|
|
967
967
|
ref: k,
|
|
968
968
|
className: "ds-calendar",
|
|
969
|
-
style:
|
|
969
|
+
style: T,
|
|
970
970
|
"aria-labelledby": N,
|
|
971
971
|
"aria-describedby": void 0,
|
|
972
972
|
onOpenAutoFocus: (e) => {
|
|
973
973
|
e.preventDefault(), k.current?.querySelector("[data-calendar-focus=\"true\"]")?.focus();
|
|
974
974
|
},
|
|
975
975
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ d("header", {
|
|
977
977
|
className: "ds-calendar-header",
|
|
978
978
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ u("button", {
|
|
980
980
|
type: "button",
|
|
981
|
-
disabled:
|
|
981
|
+
disabled: l || !B,
|
|
982
982
|
"aria-label": "Mes anterior",
|
|
983
|
-
onClick: () => w(F(
|
|
983
|
+
onClick: () => w(F(X(C, -1))),
|
|
984
984
|
children: "‹"
|
|
985
985
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ u(E.Title, {
|
|
987
987
|
id: N,
|
|
988
988
|
"aria-live": "polite",
|
|
989
989
|
children: I
|
|
990
990
|
}),
|
|
991
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ u("button", {
|
|
992
992
|
type: "button",
|
|
993
|
-
disabled:
|
|
993
|
+
disabled: l || !V,
|
|
994
994
|
"aria-label": "Mes siguiente",
|
|
995
|
-
onClick: () => w(F(
|
|
995
|
+
onClick: () => w(F(X(C, 1))),
|
|
996
996
|
children: "›"
|
|
997
997
|
})
|
|
998
998
|
]
|
|
999
999
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ d("table", {
|
|
1001
1001
|
role: "grid",
|
|
1002
1002
|
"aria-labelledby": N,
|
|
1003
1003
|
className: "ds-calendar-grid",
|
|
1004
1004
|
onKeyDown: (e) => {
|
|
1005
1005
|
let t;
|
|
1006
|
-
e.key === "ArrowRight" && (t =
|
|
1006
|
+
e.key === "ArrowRight" && (t = Y(C, 1)), e.key === "ArrowLeft" && (t = Y(C, -1)), e.key === "ArrowDown" && (t = Y(C, 7)), e.key === "ArrowUp" && (t = Y(C, -7)), e.key === "Home" && (t = Y(C, -((C.getDay() + 6) % 7))), e.key === "End" && (t = Y(C, 6 - (C.getDay() + 6) % 7)), e.key === "PageUp" && (t = X(C, e.shiftKey ? -12 : -1)), e.key === "PageDown" && (t = X(C, e.shiftKey ? 12 : 1)), t && (e.preventDefault(), A.current = !0, w(F(t)));
|
|
1007
1007
|
},
|
|
1008
|
-
children: [/* @__PURE__ */
|
|
1008
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: ke.map((e) => /* @__PURE__ */ u("th", {
|
|
1009
1009
|
scope: "col",
|
|
1010
|
-
children: /* @__PURE__ */
|
|
1010
|
+
children: /* @__PURE__ */ u("abbr", {
|
|
1011
1011
|
title: e,
|
|
1012
1012
|
children: e.slice(0, 2)
|
|
1013
1013
|
})
|
|
1014
|
-
}, e)) }) }), /* @__PURE__ */
|
|
1015
|
-
let t =
|
|
1016
|
-
return /* @__PURE__ */
|
|
1014
|
+
}, e)) }) }), /* @__PURE__ */ u("tbody", { children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ u("tr", { children: R.slice(t * 7, t * 7 + 7).map((e) => {
|
|
1015
|
+
let t = J(e), n = t === J(C), r = q(b) && t === J(b);
|
|
1016
|
+
return /* @__PURE__ */ u("td", {
|
|
1017
1017
|
"aria-selected": r,
|
|
1018
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ u("button", {
|
|
1019
1019
|
type: "button",
|
|
1020
1020
|
className: "ds-calendar-day",
|
|
1021
1021
|
"data-other-month": e.getMonth() !== C.getMonth(),
|
|
1022
1022
|
"data-selected": r,
|
|
1023
1023
|
"data-calendar-focus": n,
|
|
1024
1024
|
tabIndex: n ? 0 : -1,
|
|
1025
|
-
disabled:
|
|
1025
|
+
disabled: l || !Z(e, g, _),
|
|
1026
1026
|
"aria-label": e.toLocaleDateString("es-PE", {
|
|
1027
1027
|
weekday: "long",
|
|
1028
1028
|
day: "numeric",
|
|
@@ -1036,7 +1036,7 @@ function Ae({ value: e, defaultValue: t, onChange: r, placeholder: o = "Seleccio
|
|
|
1036
1036
|
}, t);
|
|
1037
1037
|
}) }, t)) })]
|
|
1038
1038
|
}),
|
|
1039
|
-
/* @__PURE__ */
|
|
1039
|
+
/* @__PURE__ */ u(E.Close, {
|
|
1040
1040
|
className: "ds-button",
|
|
1041
1041
|
"aria-label": "Cerrar calendario",
|
|
1042
1042
|
children: "Cerrar"
|
|
@@ -1050,14 +1050,14 @@ function Ae({ value: e, defaultValue: t, onChange: r, placeholder: o = "Seleccio
|
|
|
1050
1050
|
//#endregion
|
|
1051
1051
|
//#region src/components/Accordion.tsx
|
|
1052
1052
|
function je({ variant: e = "default", children: t }) {
|
|
1053
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ u("div", {
|
|
1054
1054
|
className: "ds-accordion",
|
|
1055
1055
|
"data-variant": e,
|
|
1056
1056
|
children: t
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
1059
1059
|
function Me({ title: e, defaultOpen: t = !1, disabled: n = !1, name: r, children: i }) {
|
|
1060
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ d("details", {
|
|
1061
1061
|
className: "ds-accordion-item",
|
|
1062
1062
|
open: t || void 0,
|
|
1063
1063
|
"aria-disabled": n || void 0,
|
|
@@ -1065,11 +1065,11 @@ function Me({ title: e, defaultOpen: t = !1, disabled: n = !1, name: r, children
|
|
|
1065
1065
|
onToggle: (e) => {
|
|
1066
1066
|
n && e.currentTarget.open && (e.currentTarget.open = !1);
|
|
1067
1067
|
},
|
|
1068
|
-
children: [/* @__PURE__ */
|
|
1068
|
+
children: [/* @__PURE__ */ u("summary", {
|
|
1069
1069
|
className: "ds-accordion-trigger",
|
|
1070
1070
|
tabIndex: n ? -1 : void 0,
|
|
1071
1071
|
children: e
|
|
1072
|
-
}), /* @__PURE__ */
|
|
1072
|
+
}), /* @__PURE__ */ u("div", {
|
|
1073
1073
|
className: "ds-accordion-content",
|
|
1074
1074
|
children: i
|
|
1075
1075
|
})]
|
|
@@ -1077,17 +1077,17 @@ function Me({ title: e, defaultOpen: t = !1, disabled: n = !1, name: r, children
|
|
|
1077
1077
|
}
|
|
1078
1078
|
//#endregion
|
|
1079
1079
|
//#region src/components/Breadcrumb.tsx
|
|
1080
|
-
function
|
|
1081
|
-
return /* @__PURE__ */
|
|
1080
|
+
function Ne({ items: e, separator: t = "chevron", label: n = "Ruta de navegación", renderLink: r }) {
|
|
1081
|
+
return /* @__PURE__ */ u("nav", {
|
|
1082
1082
|
className: "ds-breadcrumb",
|
|
1083
1083
|
"aria-label": n,
|
|
1084
1084
|
"data-separator": t,
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ u("ol", { children: e.map((t, n) => {
|
|
1086
1086
|
let i = n === e.length - 1;
|
|
1087
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ u("li", { children: i || !t.href ? /* @__PURE__ */ u("span", {
|
|
1088
1088
|
"aria-current": i ? "page" : void 0,
|
|
1089
1089
|
children: t.label
|
|
1090
|
-
}) : r ? r(t) : /* @__PURE__ */
|
|
1090
|
+
}) : r ? r(t) : /* @__PURE__ */ u("a", {
|
|
1091
1091
|
href: t.href,
|
|
1092
1092
|
onClick: t.onClick,
|
|
1093
1093
|
children: t.label
|
|
@@ -1119,45 +1119,45 @@ function Q(e, t, n = 1) {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
//#endregion
|
|
1121
1121
|
//#region src/components/Pagination.tsx
|
|
1122
|
-
function
|
|
1122
|
+
function Pe({ page: e, totalPages: t, onPageChange: n, siblings: r = 1, variant: i = "default", label: a = "Paginación" }) {
|
|
1123
1123
|
let o = Math.max(1, t), s = (t) => {
|
|
1124
1124
|
t >= 1 && t <= o && t !== e && n(t);
|
|
1125
1125
|
};
|
|
1126
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ u("nav", {
|
|
1127
1127
|
className: "ds-pagination",
|
|
1128
1128
|
"aria-label": a,
|
|
1129
1129
|
"data-variant": i,
|
|
1130
|
-
children: /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1130
|
+
children: /* @__PURE__ */ d("ul", { children: [
|
|
1131
|
+
/* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
|
|
1132
1132
|
type: "button",
|
|
1133
1133
|
className: "ds-page",
|
|
1134
1134
|
onClick: () => s(e - 1),
|
|
1135
1135
|
disabled: e <= 1,
|
|
1136
1136
|
"aria-label": "Página anterior",
|
|
1137
|
-
children: /* @__PURE__ */
|
|
1137
|
+
children: /* @__PURE__ */ u(h, {
|
|
1138
1138
|
size: 16,
|
|
1139
1139
|
"aria-hidden": "true"
|
|
1140
1140
|
})
|
|
1141
1141
|
}) }),
|
|
1142
|
-
Q(e, o, r).map((t) => typeof t == "number" ? /* @__PURE__ */
|
|
1142
|
+
Q(e, o, r).map((t) => typeof t == "number" ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
|
|
1143
1143
|
type: "button",
|
|
1144
1144
|
className: "ds-page",
|
|
1145
1145
|
"aria-current": t === e ? "page" : void 0,
|
|
1146
1146
|
"aria-label": `Página ${t}`,
|
|
1147
1147
|
onClick: () => s(t),
|
|
1148
1148
|
children: t
|
|
1149
|
-
}) }, t) : /* @__PURE__ */
|
|
1149
|
+
}) }, t) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("span", {
|
|
1150
1150
|
className: "ds-page-ellipsis",
|
|
1151
1151
|
"aria-hidden": "true",
|
|
1152
1152
|
children: "…"
|
|
1153
1153
|
}) }, t)),
|
|
1154
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
|
|
1155
1155
|
type: "button",
|
|
1156
1156
|
className: "ds-page",
|
|
1157
1157
|
onClick: () => s(e + 1),
|
|
1158
1158
|
disabled: e >= o,
|
|
1159
1159
|
"aria-label": "Página siguiente",
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1160
|
+
children: /* @__PURE__ */ u(g, {
|
|
1161
1161
|
size: 16,
|
|
1162
1162
|
"aria-hidden": "true"
|
|
1163
1163
|
})
|
|
@@ -1167,13 +1167,13 @@ function Ne({ page: e, totalPages: t, onPageChange: n, siblings: r = 1, variant:
|
|
|
1167
1167
|
}
|
|
1168
1168
|
//#endregion
|
|
1169
1169
|
//#region src/components/Divider.tsx
|
|
1170
|
-
function
|
|
1171
|
-
return t ? /* @__PURE__ */
|
|
1170
|
+
function Fe({ orientation: e = "horizontal", label: t }) {
|
|
1171
|
+
return t ? /* @__PURE__ */ u("div", {
|
|
1172
1172
|
className: "ds-divider",
|
|
1173
1173
|
role: "separator",
|
|
1174
1174
|
"data-label": t,
|
|
1175
1175
|
children: t
|
|
1176
|
-
}) : /* @__PURE__ */
|
|
1176
|
+
}) : /* @__PURE__ */ u("div", {
|
|
1177
1177
|
className: "ds-divider",
|
|
1178
1178
|
role: "separator",
|
|
1179
1179
|
"aria-orientation": e,
|
|
@@ -1182,28 +1182,28 @@ function Pe({ orientation: e = "horizontal", label: t }) {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
//#endregion
|
|
1184
1184
|
//#region src/core/toast.ts
|
|
1185
|
-
var
|
|
1186
|
-
function
|
|
1187
|
-
let e = r(
|
|
1185
|
+
var Ie = e(null);
|
|
1186
|
+
function Le() {
|
|
1187
|
+
let e = r(Ie);
|
|
1188
1188
|
if (!e) throw Error("useToast debe usarse dentro de <ToastProvider>.");
|
|
1189
1189
|
return e;
|
|
1190
1190
|
}
|
|
1191
1191
|
//#endregion
|
|
1192
1192
|
//#region src/components/Toast.tsx
|
|
1193
|
-
var
|
|
1194
|
-
info: /* @__PURE__ */
|
|
1195
|
-
success: /* @__PURE__ */
|
|
1196
|
-
warning: /* @__PURE__ */
|
|
1197
|
-
error: /* @__PURE__ */
|
|
1193
|
+
var Re = {
|
|
1194
|
+
info: /* @__PURE__ */ u(y, { weight: "fill" }),
|
|
1195
|
+
success: /* @__PURE__ */ u(v, { weight: "fill" }),
|
|
1196
|
+
warning: /* @__PURE__ */ u(C, { weight: "fill" }),
|
|
1197
|
+
error: /* @__PURE__ */ u(w, { weight: "fill" })
|
|
1198
1198
|
};
|
|
1199
|
-
function
|
|
1200
|
-
let [r, a] = c([]),
|
|
1199
|
+
function ze({ children: e, position: t = "bottom-right" }) {
|
|
1200
|
+
let [r, a] = c([]), l = s(0), f = s(/* @__PURE__ */ new Map()), p = n((e) => {
|
|
1201
1201
|
clearTimeout(f.current.get(e)), f.current.delete(e), a((t) => t.map((t) => t.id === e ? {
|
|
1202
1202
|
...t,
|
|
1203
1203
|
closing: !0
|
|
1204
1204
|
} : t)), setTimeout(() => a((t) => t.filter((t) => t.id !== e)), 180);
|
|
1205
1205
|
}, []), m = n((e) => {
|
|
1206
|
-
let t = ++
|
|
1206
|
+
let t = ++l.current;
|
|
1207
1207
|
a((n) => [...n.slice(-4), {
|
|
1208
1208
|
variant: "info",
|
|
1209
1209
|
...e,
|
|
@@ -1223,38 +1223,38 @@ function Le({ children: e, position: t = "bottom-right" }) {
|
|
|
1223
1223
|
toast: m,
|
|
1224
1224
|
dismiss: p
|
|
1225
1225
|
}), [m, p]);
|
|
1226
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ d(Ie.Provider, {
|
|
1227
1227
|
value: h,
|
|
1228
|
-
children: [e, /* @__PURE__ */
|
|
1228
|
+
children: [e, /* @__PURE__ */ u("ol", {
|
|
1229
1229
|
className: "ds-toaster",
|
|
1230
1230
|
"data-position": t,
|
|
1231
1231
|
"aria-label": "Notificaciones",
|
|
1232
|
-
children: r.map((e) => /* @__PURE__ */
|
|
1232
|
+
children: r.map((e) => /* @__PURE__ */ d("li", {
|
|
1233
1233
|
className: "ds-toast",
|
|
1234
1234
|
"data-variant": e.variant,
|
|
1235
1235
|
"data-state": e.closing ? "closing" : "open",
|
|
1236
1236
|
role: e.variant === "error" ? "alert" : "status",
|
|
1237
1237
|
"aria-atomic": "true",
|
|
1238
1238
|
children: [
|
|
1239
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ u("span", {
|
|
1240
1240
|
className: "ds-toast-icon",
|
|
1241
1241
|
"aria-hidden": "true",
|
|
1242
|
-
children:
|
|
1242
|
+
children: Re[e.variant ?? "info"]
|
|
1243
1243
|
}),
|
|
1244
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ d("div", {
|
|
1245
1245
|
className: "ds-toast-content",
|
|
1246
1246
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ u("span", {
|
|
1248
1248
|
className: "ds-toast-title",
|
|
1249
1249
|
children: e.title
|
|
1250
1250
|
}),
|
|
1251
|
-
e.description && /* @__PURE__ */
|
|
1251
|
+
e.description && /* @__PURE__ */ u("p", {
|
|
1252
1252
|
className: "ds-toast-description",
|
|
1253
1253
|
children: e.description
|
|
1254
1254
|
}),
|
|
1255
|
-
e.action && /* @__PURE__ */
|
|
1255
|
+
e.action && /* @__PURE__ */ u("div", {
|
|
1256
1256
|
className: "ds-toast-action",
|
|
1257
|
-
children: /* @__PURE__ */
|
|
1257
|
+
children: /* @__PURE__ */ u("button", {
|
|
1258
1258
|
type: "button",
|
|
1259
1259
|
className: "ds-button",
|
|
1260
1260
|
"data-variant": "text",
|
|
@@ -1267,12 +1267,12 @@ function Le({ children: e, position: t = "bottom-right" }) {
|
|
|
1267
1267
|
})
|
|
1268
1268
|
]
|
|
1269
1269
|
}),
|
|
1270
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ u("button", {
|
|
1271
1271
|
type: "button",
|
|
1272
1272
|
className: "ds-toast-close",
|
|
1273
1273
|
"aria-label": "Cerrar notificación",
|
|
1274
1274
|
onClick: () => p(e.id),
|
|
1275
|
-
children: /* @__PURE__ */
|
|
1275
|
+
children: /* @__PURE__ */ u(T, {
|
|
1276
1276
|
size: 14,
|
|
1277
1277
|
"aria-hidden": "true"
|
|
1278
1278
|
})
|
|
@@ -1283,6 +1283,540 @@ function Le({ children: e, position: t = "bottom-right" }) {
|
|
|
1283
1283
|
});
|
|
1284
1284
|
}
|
|
1285
1285
|
//#endregion
|
|
1286
|
-
|
|
1286
|
+
//#region src/components/DataTable.tsx
|
|
1287
|
+
var Be = new Intl.Collator("es", {
|
|
1288
|
+
numeric: !0,
|
|
1289
|
+
sensitivity: "base"
|
|
1290
|
+
}), Ve = "a, button, input, select, textarea, label, [role=\"button\"], [contenteditable=\"true\"]";
|
|
1291
|
+
function He({ caption: e, columns: t, rows: n, rowKey: r, loading: i = !1, loadingMessage: a = "Cargando registros…", emptyMessage: o = "No hay resultados.", pagination: s, sort: l, defaultSort: f, onSortChange: p, manualSort: m = !1, onRowClick: h, density: g = "comfortable", stickyHeader: _ = !1, id: v, className: y }) {
|
|
1292
|
+
let [b, x] = c(f), S = l === void 0 ? b : l ?? void 0, C = t.find((e) => e.id === S?.id)?.sortValue, w = !m && C && S ? [...n].sort((e, t) => {
|
|
1293
|
+
let n = C(e), r = C(t), i = typeof n == "number" && typeof r == "number" ? n - r : Be.compare(String(n), String(r));
|
|
1294
|
+
return S.direction === "ascending" ? i : -i;
|
|
1295
|
+
}) : n, T = s?.pageSize ? Math.max(1, Math.floor(s.pageSize)) : void 0, E = T ? Math.ceil(n.length / T) : s?.totalPages ?? 1, D = Math.min(Math.max(1, s?.page ?? 1), Math.max(1, E)), O = T ? w.slice((D - 1) * T, D * T) : w;
|
|
1296
|
+
function k(e, t) {
|
|
1297
|
+
let n = {
|
|
1298
|
+
id: e.id,
|
|
1299
|
+
direction: t === "ascending" ? "descending" : "ascending"
|
|
1300
|
+
};
|
|
1301
|
+
x(n), p?.(n), T && D !== 1 && s?.onPageChange(1);
|
|
1302
|
+
}
|
|
1303
|
+
function A(e, t) {
|
|
1304
|
+
let n = t.target instanceof Element ? t.target.closest(Ve) : null;
|
|
1305
|
+
n && t.currentTarget.contains(n) || h?.(e, t);
|
|
1306
|
+
}
|
|
1307
|
+
return /* @__PURE__ */ d("div", {
|
|
1308
|
+
id: v,
|
|
1309
|
+
className: ["ds-data-table", y].filter(Boolean).join(" "),
|
|
1310
|
+
"data-density": g,
|
|
1311
|
+
"data-sticky-header": _ || void 0,
|
|
1312
|
+
children: [/* @__PURE__ */ u("div", {
|
|
1313
|
+
className: "ds-data-scroll",
|
|
1314
|
+
role: "region",
|
|
1315
|
+
"aria-label": e,
|
|
1316
|
+
tabIndex: 0,
|
|
1317
|
+
children: /* @__PURE__ */ d("table", {
|
|
1318
|
+
"aria-busy": i,
|
|
1319
|
+
children: [
|
|
1320
|
+
/* @__PURE__ */ u("caption", { children: e }),
|
|
1321
|
+
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: t.map((e) => {
|
|
1322
|
+
let t = S?.id === e.id ? S.direction : void 0;
|
|
1323
|
+
return /* @__PURE__ */ u("th", {
|
|
1324
|
+
scope: "col",
|
|
1325
|
+
"data-align": e.align,
|
|
1326
|
+
"aria-sort": e.sortValue ? t : void 0,
|
|
1327
|
+
children: e.sortValue ? /* @__PURE__ */ d("button", {
|
|
1328
|
+
type: "button",
|
|
1329
|
+
className: "ds-sort-button",
|
|
1330
|
+
onClick: () => k(e, t),
|
|
1331
|
+
children: [
|
|
1332
|
+
e.label,
|
|
1333
|
+
" ",
|
|
1334
|
+
/* @__PURE__ */ u("span", {
|
|
1335
|
+
"aria-hidden": "true",
|
|
1336
|
+
children: t === "ascending" ? "↑" : t === "descending" ? "↓" : "↕"
|
|
1337
|
+
})
|
|
1338
|
+
]
|
|
1339
|
+
}) : e.label
|
|
1340
|
+
}, e.id);
|
|
1341
|
+
}) }) }),
|
|
1342
|
+
/* @__PURE__ */ u("tbody", { children: i || !w.length ? /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
1343
|
+
colSpan: Math.max(1, t.length),
|
|
1344
|
+
children: /* @__PURE__ */ u("span", {
|
|
1345
|
+
role: "status",
|
|
1346
|
+
children: i ? a : o
|
|
1347
|
+
})
|
|
1348
|
+
}) }) : O.map((e) => /* @__PURE__ */ u("tr", {
|
|
1349
|
+
...h ? {
|
|
1350
|
+
tabIndex: 0,
|
|
1351
|
+
"data-clickable": !0,
|
|
1352
|
+
onClick: (t) => A(e, t),
|
|
1353
|
+
onKeyDown: (t) => {
|
|
1354
|
+
t.target !== t.currentTarget || t.key !== "Enter" && t.key !== " " || (t.preventDefault(), A(e, t));
|
|
1355
|
+
}
|
|
1356
|
+
} : {},
|
|
1357
|
+
children: t.map((t) => /* @__PURE__ */ u("td", {
|
|
1358
|
+
"data-align": t.align,
|
|
1359
|
+
children: t.cell(e)
|
|
1360
|
+
}, t.id))
|
|
1361
|
+
}, r(e))) })
|
|
1362
|
+
]
|
|
1363
|
+
})
|
|
1364
|
+
}), s && E > 1 && /* @__PURE__ */ u(Pe, {
|
|
1365
|
+
page: D,
|
|
1366
|
+
totalPages: E,
|
|
1367
|
+
onPageChange: s.onPageChange
|
|
1368
|
+
})]
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region src/components/FilterBar.tsx
|
|
1373
|
+
var Ue = (e) => `${e} resultado${e === 1 ? "" : "s"}`;
|
|
1374
|
+
function We({ label: e = "Filtros", children: t, activeFilters: n = [], onFilterRemove: r, onClear: i, clearLabel: a = "Limpiar filtros", resultCount: o, resultLabel: s = Ue, onSubmit: c, actions: f, id: p, className: m }) {
|
|
1375
|
+
let h = /* @__PURE__ */ d(l, { children: [
|
|
1376
|
+
/* @__PURE__ */ u("div", {
|
|
1377
|
+
className: "ds-filter-fields",
|
|
1378
|
+
children: t
|
|
1379
|
+
}),
|
|
1380
|
+
f && /* @__PURE__ */ u("div", {
|
|
1381
|
+
className: "ds-filter-actions",
|
|
1382
|
+
children: f
|
|
1383
|
+
}),
|
|
1384
|
+
(n.length > 0 || o !== void 0) && /* @__PURE__ */ d("div", {
|
|
1385
|
+
className: "ds-filter-active",
|
|
1386
|
+
children: [
|
|
1387
|
+
o !== void 0 && /* @__PURE__ */ u("span", {
|
|
1388
|
+
className: "ds-filter-count",
|
|
1389
|
+
role: "status",
|
|
1390
|
+
children: s(o)
|
|
1391
|
+
}),
|
|
1392
|
+
n.map((e) => /* @__PURE__ */ d("button", {
|
|
1393
|
+
className: "ds-filter-chip",
|
|
1394
|
+
type: "button",
|
|
1395
|
+
"aria-label": `Quitar filtro: ${e.label}`,
|
|
1396
|
+
onClick: () => {
|
|
1397
|
+
e.onRemove?.(), r?.(e.id);
|
|
1398
|
+
},
|
|
1399
|
+
children: [
|
|
1400
|
+
e.label,
|
|
1401
|
+
" ",
|
|
1402
|
+
/* @__PURE__ */ u("span", {
|
|
1403
|
+
"aria-hidden": "true",
|
|
1404
|
+
children: "×"
|
|
1405
|
+
})
|
|
1406
|
+
]
|
|
1407
|
+
}, e.id)),
|
|
1408
|
+
i && n.length > 0 && /* @__PURE__ */ u("button", {
|
|
1409
|
+
className: "ds-button",
|
|
1410
|
+
"data-variant": "text",
|
|
1411
|
+
"data-size": "sm",
|
|
1412
|
+
type: "button",
|
|
1413
|
+
onClick: i,
|
|
1414
|
+
children: a
|
|
1415
|
+
})
|
|
1416
|
+
]
|
|
1417
|
+
})
|
|
1418
|
+
] }), g = ["ds-filter-bar", m].filter(Boolean).join(" ");
|
|
1419
|
+
return c ? /* @__PURE__ */ u("form", {
|
|
1420
|
+
id: p,
|
|
1421
|
+
className: g,
|
|
1422
|
+
role: "search",
|
|
1423
|
+
"aria-label": e,
|
|
1424
|
+
onSubmit: (e) => {
|
|
1425
|
+
e.preventDefault(), c(new FormData(e.currentTarget), e);
|
|
1426
|
+
},
|
|
1427
|
+
children: h
|
|
1428
|
+
}) : /* @__PURE__ */ u("div", {
|
|
1429
|
+
id: p,
|
|
1430
|
+
className: g,
|
|
1431
|
+
role: "group",
|
|
1432
|
+
"aria-label": e,
|
|
1433
|
+
children: h
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
//#endregion
|
|
1437
|
+
//#region src/components/Drawer.tsx
|
|
1438
|
+
function Ge({ title: e, description: t, open: n, defaultOpen: r = !1, onOpenChange: i, side: a = "end", size: o = "md", trigger: l, footer: f, closeOnBackdrop: p = !0, closeOnEscape: m = !0, closeLabel: h = "Cerrar panel", className: g, children: _ }) {
|
|
1439
|
+
let v = s(null), [y, b] = c(r), x = n ?? y;
|
|
1440
|
+
return /* @__PURE__ */ d(E.Root, {
|
|
1441
|
+
open: x,
|
|
1442
|
+
onOpenChange: (e) => {
|
|
1443
|
+
b(e), i?.(e);
|
|
1444
|
+
},
|
|
1445
|
+
children: [l && /* @__PURE__ */ u(E.Trigger, {
|
|
1446
|
+
asChild: !0,
|
|
1447
|
+
children: l
|
|
1448
|
+
}), /* @__PURE__ */ d(E.Portal, { children: [/* @__PURE__ */ u(E.Overlay, { className: "ds-drawer-overlay" }), /* @__PURE__ */ d(E.Content, {
|
|
1449
|
+
className: ["ds-drawer", g].filter(Boolean).join(" "),
|
|
1450
|
+
"data-side": a,
|
|
1451
|
+
"data-size": o,
|
|
1452
|
+
...t ? {} : { "aria-describedby": void 0 },
|
|
1453
|
+
onEscapeKeyDown: (e) => {
|
|
1454
|
+
m || e.preventDefault();
|
|
1455
|
+
},
|
|
1456
|
+
onPointerDownOutside: (e) => {
|
|
1457
|
+
p || e.preventDefault();
|
|
1458
|
+
},
|
|
1459
|
+
onInteractOutside: (e) => {
|
|
1460
|
+
p || e.preventDefault();
|
|
1461
|
+
},
|
|
1462
|
+
onOpenAutoFocus: () => {
|
|
1463
|
+
let e = document.activeElement;
|
|
1464
|
+
v.current = e instanceof HTMLElement && e !== document.body ? e : null;
|
|
1465
|
+
},
|
|
1466
|
+
onCloseAutoFocus: (e) => {
|
|
1467
|
+
v.current?.isConnected && (e.preventDefault(), v.current.focus({ preventScroll: !0 }));
|
|
1468
|
+
},
|
|
1469
|
+
children: [
|
|
1470
|
+
/* @__PURE__ */ d("header", {
|
|
1471
|
+
className: "ds-drawer-header",
|
|
1472
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(E.Title, { children: e }), t && /* @__PURE__ */ u(E.Description, {
|
|
1473
|
+
className: "ds-drawer-description",
|
|
1474
|
+
children: t
|
|
1475
|
+
})] }), /* @__PURE__ */ u(E.Close, {
|
|
1476
|
+
className: "ds-sheet-close",
|
|
1477
|
+
"aria-label": h,
|
|
1478
|
+
children: "×"
|
|
1479
|
+
})]
|
|
1480
|
+
}),
|
|
1481
|
+
/* @__PURE__ */ u("div", {
|
|
1482
|
+
className: "ds-drawer-body",
|
|
1483
|
+
children: _
|
|
1484
|
+
}),
|
|
1485
|
+
f && /* @__PURE__ */ u("footer", {
|
|
1486
|
+
className: "ds-drawer-footer",
|
|
1487
|
+
children: f
|
|
1488
|
+
})
|
|
1489
|
+
]
|
|
1490
|
+
})] })]
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
//#endregion
|
|
1494
|
+
//#region src/core/files.ts
|
|
1495
|
+
function $(e) {
|
|
1496
|
+
if (!Number.isFinite(e) || e < 1024) return `${Math.max(0, Math.round(e || 0))} B`;
|
|
1497
|
+
let t = [
|
|
1498
|
+
"KB",
|
|
1499
|
+
"MB",
|
|
1500
|
+
"GB"
|
|
1501
|
+
], n = e / 1024, r = 0;
|
|
1502
|
+
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
|
|
1503
|
+
return `${Number(n.toFixed(+(n < 10)))} ${t[r]}`;
|
|
1504
|
+
}
|
|
1505
|
+
function Ke(e, t) {
|
|
1506
|
+
let n = t?.toLowerCase().split(",").map((e) => e.trim()).filter(Boolean) ?? [];
|
|
1507
|
+
if (!n.length) return !0;
|
|
1508
|
+
let r = e.type.toLowerCase(), i = e.name.toLowerCase();
|
|
1509
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r === e);
|
|
1510
|
+
}
|
|
1511
|
+
var qe = (e, t) => e.name === t.name && e.size === t.size && e.lastModified === t.lastModified;
|
|
1512
|
+
function Je(e, t, n = {}) {
|
|
1513
|
+
let r = [], i = n.multiple ? [...e] : [], a = n.multiple ? n.maxFiles && n.maxFiles > 0 ? Math.floor(n.maxFiles) : Infinity : 1;
|
|
1514
|
+
for (let e of t) if (!Ke(e, n.accept)) r.push({
|
|
1515
|
+
file: e,
|
|
1516
|
+
reason: "type",
|
|
1517
|
+
message: `${e.name}: formato no admitido.`
|
|
1518
|
+
});
|
|
1519
|
+
else if (n.maxBytes !== void 0 && e.size > n.maxBytes) r.push({
|
|
1520
|
+
file: e,
|
|
1521
|
+
reason: "size",
|
|
1522
|
+
message: `${e.name}: supera el tamaño máximo (${$(n.maxBytes)}).`
|
|
1523
|
+
});
|
|
1524
|
+
else if (i.some((t) => qe(t, e))) continue;
|
|
1525
|
+
else i.length >= a ? r.push({
|
|
1526
|
+
file: e,
|
|
1527
|
+
reason: "count",
|
|
1528
|
+
message: `${e.name}: solo se permiten ${a} archivo${a === 1 ? "" : "s"}.`
|
|
1529
|
+
}) : i.push(e);
|
|
1530
|
+
return {
|
|
1531
|
+
files: i,
|
|
1532
|
+
rejections: r
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
//#endregion
|
|
1536
|
+
//#region src/components/FileUpload.tsx
|
|
1537
|
+
function Ye({ file: e }) {
|
|
1538
|
+
let t = s(null);
|
|
1539
|
+
return i(() => {
|
|
1540
|
+
if (!t.current) return;
|
|
1541
|
+
let n = URL.createObjectURL(e);
|
|
1542
|
+
return t.current.src = n, () => URL.revokeObjectURL(n);
|
|
1543
|
+
}, [e]), e.type.startsWith("image/") ? /* @__PURE__ */ u("img", {
|
|
1544
|
+
ref: t,
|
|
1545
|
+
alt: ""
|
|
1546
|
+
}) : null;
|
|
1547
|
+
}
|
|
1548
|
+
function Xe({ label: e, name: t, accept: n, multiple: r = !1, maxBytes: i, maxFiles: o, required: l, disabled: f = !1, supportingText: p, dropzone: m = !0, id: h, className: g, onFilesChange: _, onReject: v, onFileRemove: y }) {
|
|
1549
|
+
let b = a(), x = h ?? b, S = s(null), [C, w] = c([]), [T, E] = c(""), [D, O] = c(!1);
|
|
1550
|
+
function k(e) {
|
|
1551
|
+
let t = new DataTransfer();
|
|
1552
|
+
e.forEach((e) => t.items.add(e)), S.current && (S.current.files = t.files), w(e), (e.length !== C.length || e.some((e, t) => e !== C[t])) && _?.(e);
|
|
1553
|
+
}
|
|
1554
|
+
function A(e) {
|
|
1555
|
+
let t = Je(C, e, {
|
|
1556
|
+
accept: n,
|
|
1557
|
+
maxBytes: i,
|
|
1558
|
+
maxFiles: o,
|
|
1559
|
+
multiple: r
|
|
1560
|
+
});
|
|
1561
|
+
E(t.rejections.map((e) => e.message).join(" ")), k(t.files), t.rejections.length && v?.(t.rejections);
|
|
1562
|
+
}
|
|
1563
|
+
function j(e) {
|
|
1564
|
+
m && !f && (e.preventDefault(), O(!1), A(Array.from(e.dataTransfer.files)));
|
|
1565
|
+
}
|
|
1566
|
+
let M = [p ? `${x}-hint` : "", `${x}-error`].filter(Boolean).join(" ");
|
|
1567
|
+
return /* @__PURE__ */ d("div", {
|
|
1568
|
+
className: ["ds-file-upload", g].filter(Boolean).join(" "),
|
|
1569
|
+
"data-dragging": D || void 0,
|
|
1570
|
+
"data-disabled": f || void 0,
|
|
1571
|
+
onDragOver: (e) => {
|
|
1572
|
+
m && !f && (e.preventDefault(), O(!0));
|
|
1573
|
+
},
|
|
1574
|
+
onDragLeave: (e) => {
|
|
1575
|
+
e.currentTarget.contains(e.relatedTarget) || O(!1);
|
|
1576
|
+
},
|
|
1577
|
+
onDrop: j,
|
|
1578
|
+
children: [
|
|
1579
|
+
/* @__PURE__ */ d("label", {
|
|
1580
|
+
htmlFor: x,
|
|
1581
|
+
children: [e, l && /* @__PURE__ */ u("span", {
|
|
1582
|
+
className: "ds-input-required",
|
|
1583
|
+
"aria-hidden": "true",
|
|
1584
|
+
children: "*"
|
|
1585
|
+
})]
|
|
1586
|
+
}),
|
|
1587
|
+
p && /* @__PURE__ */ u("small", {
|
|
1588
|
+
id: `${x}-hint`,
|
|
1589
|
+
children: p
|
|
1590
|
+
}),
|
|
1591
|
+
/* @__PURE__ */ u("input", {
|
|
1592
|
+
ref: S,
|
|
1593
|
+
id: x,
|
|
1594
|
+
type: "file",
|
|
1595
|
+
name: t,
|
|
1596
|
+
accept: n,
|
|
1597
|
+
multiple: r,
|
|
1598
|
+
required: l && !C.length,
|
|
1599
|
+
disabled: f,
|
|
1600
|
+
"aria-describedby": M,
|
|
1601
|
+
"aria-invalid": T ? !0 : void 0,
|
|
1602
|
+
onChange: (e) => A(Array.from(e.currentTarget.files ?? []))
|
|
1603
|
+
}),
|
|
1604
|
+
/* @__PURE__ */ u("div", {
|
|
1605
|
+
id: `${x}-error`,
|
|
1606
|
+
role: "status",
|
|
1607
|
+
children: T
|
|
1608
|
+
}),
|
|
1609
|
+
!!C.length && /* @__PURE__ */ u("ul", { children: C.map((e, t) => /* @__PURE__ */ d("li", { children: [
|
|
1610
|
+
/* @__PURE__ */ u(Ye, { file: e }),
|
|
1611
|
+
/* @__PURE__ */ u("span", { children: e.name }),
|
|
1612
|
+
/* @__PURE__ */ u("small", { children: $(e.size) }),
|
|
1613
|
+
/* @__PURE__ */ u("button", {
|
|
1614
|
+
className: "ds-button",
|
|
1615
|
+
"data-variant": "text",
|
|
1616
|
+
"data-size": "sm",
|
|
1617
|
+
type: "button",
|
|
1618
|
+
"aria-label": `Quitar ${e.name}`,
|
|
1619
|
+
disabled: f,
|
|
1620
|
+
onClick: () => {
|
|
1621
|
+
E(""), k(C.filter((e, n) => n !== t)), y?.(e), S.current?.focus();
|
|
1622
|
+
},
|
|
1623
|
+
children: "Quitar"
|
|
1624
|
+
})
|
|
1625
|
+
] }, `${e.name}-${e.lastModified}-${t}`)) })
|
|
1626
|
+
]
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
//#endregion
|
|
1630
|
+
//#region src/components/Timeline.tsx
|
|
1631
|
+
function Ze({ items: e, label: t = "Historial", emptyMessage: n = "Sin eventos registrados.", density: r = "comfortable", id: i, className: a }) {
|
|
1632
|
+
let o = ["ds-timeline", a].filter(Boolean).join(" ");
|
|
1633
|
+
return e.length ? /* @__PURE__ */ u("ol", {
|
|
1634
|
+
id: i,
|
|
1635
|
+
className: o,
|
|
1636
|
+
"aria-label": t,
|
|
1637
|
+
"data-density": r,
|
|
1638
|
+
children: e.map((e) => /* @__PURE__ */ d("li", {
|
|
1639
|
+
"data-variant": e.variant && e.variant !== "default" ? e.variant : void 0,
|
|
1640
|
+
"aria-current": e.current ? "step" : void 0,
|
|
1641
|
+
children: [
|
|
1642
|
+
/* @__PURE__ */ u("strong", { children: e.title }),
|
|
1643
|
+
e.dateTime && /* @__PURE__ */ u("time", {
|
|
1644
|
+
dateTime: e.dateTime,
|
|
1645
|
+
children: e.dateLabel ?? e.dateTime
|
|
1646
|
+
}),
|
|
1647
|
+
e.actor && /* @__PURE__ */ u("span", { children: e.actor }),
|
|
1648
|
+
e.description && /* @__PURE__ */ u("div", { children: e.description })
|
|
1649
|
+
]
|
|
1650
|
+
}, e.id))
|
|
1651
|
+
}) : /* @__PURE__ */ u("p", {
|
|
1652
|
+
id: i,
|
|
1653
|
+
className: o,
|
|
1654
|
+
"data-empty": "true",
|
|
1655
|
+
children: n
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region src/components/DateRangePicker.tsx
|
|
1660
|
+
var Qe = {
|
|
1661
|
+
start: "",
|
|
1662
|
+
end: ""
|
|
1663
|
+
}, $e = (e) => !!e.start && !!e.end && e.start <= e.end;
|
|
1664
|
+
function et({ label: e = "Rango de fechas", startLabel: t = "Desde", endLabel: n = "Hasta", value: r, defaultValue: i = Qe, onChange: o, onComplete: s, min: l, max: f, startName: p, endName: m, required: h, disabled: g, error: _, presets: v = [], id: y, className: b }) {
|
|
1665
|
+
let x = a(), S = y ?? x, [C, w] = c(i), T = r ?? C, E = T.end && (!f || T.end < f) ? T.end : f, D = T.start && (!l || T.start > l) ? T.start : l, O = _ ?? (T.start && T.end && T.end < T.start ? "La fecha final no puede ser anterior a la inicial." : "");
|
|
1666
|
+
function k(e) {
|
|
1667
|
+
w(e), o?.(e), $e(e) && s?.(e);
|
|
1668
|
+
}
|
|
1669
|
+
return /* @__PURE__ */ d("fieldset", {
|
|
1670
|
+
id: S,
|
|
1671
|
+
className: ["ds-date-range", b].filter(Boolean).join(" "),
|
|
1672
|
+
disabled: g,
|
|
1673
|
+
"aria-describedby": O ? `${S}-error` : void 0,
|
|
1674
|
+
children: [
|
|
1675
|
+
/* @__PURE__ */ d("legend", { children: [e, h && /* @__PURE__ */ u("span", {
|
|
1676
|
+
className: "ds-input-required",
|
|
1677
|
+
"aria-hidden": "true",
|
|
1678
|
+
children: "*"
|
|
1679
|
+
})] }),
|
|
1680
|
+
v.length > 0 && /* @__PURE__ */ u("div", {
|
|
1681
|
+
className: "ds-date-range-presets",
|
|
1682
|
+
children: v.map((e) => {
|
|
1683
|
+
let t = e.range.start === T.start && e.range.end === T.end;
|
|
1684
|
+
return /* @__PURE__ */ u("button", {
|
|
1685
|
+
type: "button",
|
|
1686
|
+
className: "ds-filter-chip",
|
|
1687
|
+
"aria-pressed": t,
|
|
1688
|
+
onClick: () => k(e.range),
|
|
1689
|
+
children: e.label
|
|
1690
|
+
}, e.label);
|
|
1691
|
+
})
|
|
1692
|
+
}),
|
|
1693
|
+
/* @__PURE__ */ d("div", {
|
|
1694
|
+
className: "ds-date-range-fields",
|
|
1695
|
+
children: [/* @__PURE__ */ u(K, {
|
|
1696
|
+
id: `${S}-start`,
|
|
1697
|
+
type: "date",
|
|
1698
|
+
label: t,
|
|
1699
|
+
name: p,
|
|
1700
|
+
value: T.start,
|
|
1701
|
+
min: l,
|
|
1702
|
+
max: E,
|
|
1703
|
+
required: h,
|
|
1704
|
+
error: !!O,
|
|
1705
|
+
onChange: (e) => k({
|
|
1706
|
+
...T,
|
|
1707
|
+
start: e
|
|
1708
|
+
})
|
|
1709
|
+
}), /* @__PURE__ */ u(K, {
|
|
1710
|
+
id: `${S}-end`,
|
|
1711
|
+
type: "date",
|
|
1712
|
+
label: n,
|
|
1713
|
+
name: m,
|
|
1714
|
+
value: T.end,
|
|
1715
|
+
min: D,
|
|
1716
|
+
max: f,
|
|
1717
|
+
required: h,
|
|
1718
|
+
error: !!O,
|
|
1719
|
+
onChange: (e) => k({
|
|
1720
|
+
...T,
|
|
1721
|
+
end: e
|
|
1722
|
+
})
|
|
1723
|
+
})]
|
|
1724
|
+
}),
|
|
1725
|
+
/* @__PURE__ */ u("p", {
|
|
1726
|
+
id: `${S}-error`,
|
|
1727
|
+
className: "ds-date-range-error",
|
|
1728
|
+
role: "status",
|
|
1729
|
+
children: O
|
|
1730
|
+
})
|
|
1731
|
+
]
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
//#endregion
|
|
1735
|
+
//#region src/components/Autocomplete.tsx
|
|
1736
|
+
function tt({ options: e, onSelect: t, onSearch: n, debounceMs: r = 250, minChars: o = 1, loading: f = !1, loadingText: p = "Buscando…", allowCustomValue: m = !0, invalidMessage: h = "Elige una opción de la lista.", onChange: g, onBlur: _, error: v, supportingText: y, ...b }) {
|
|
1737
|
+
let x = a(), S = s(void 0), [C, w] = c(!1), T = [...new Set(e)];
|
|
1738
|
+
i(() => () => clearTimeout(S.current), []);
|
|
1739
|
+
function E(e) {
|
|
1740
|
+
if (w(!1), g?.(e), T.includes(e) && t?.(e), !n) return;
|
|
1741
|
+
clearTimeout(S.current);
|
|
1742
|
+
let i = e.trim();
|
|
1743
|
+
i.length >= o && (S.current = setTimeout(() => n(i), Math.max(0, r)));
|
|
1744
|
+
}
|
|
1745
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(K, {
|
|
1746
|
+
...b,
|
|
1747
|
+
type: "text",
|
|
1748
|
+
list: x,
|
|
1749
|
+
autoComplete: "off",
|
|
1750
|
+
"aria-busy": f || void 0,
|
|
1751
|
+
error: v || C,
|
|
1752
|
+
supportingText: C ? h : f ? p : y,
|
|
1753
|
+
onChange: E,
|
|
1754
|
+
onBlur: (e) => {
|
|
1755
|
+
let t = e.currentTarget.value;
|
|
1756
|
+
m || w(!!t && !T.includes(t)), _?.(e);
|
|
1757
|
+
}
|
|
1758
|
+
}), /* @__PURE__ */ u("datalist", {
|
|
1759
|
+
id: x,
|
|
1760
|
+
children: T.map((e) => /* @__PURE__ */ u("option", { value: e }, e))
|
|
1761
|
+
})] });
|
|
1762
|
+
}
|
|
1763
|
+
//#endregion
|
|
1764
|
+
//#region src/components/Sidebar.tsx
|
|
1765
|
+
function nt({ groups: e, activeHref: t, label: n = "Navegación", onNavigate: r, header: i, footer: a, id: o, className: s }) {
|
|
1766
|
+
let c = (e) => e.disabled ? /* @__PURE__ */ u("span", {
|
|
1767
|
+
className: "ds-sidebar-link",
|
|
1768
|
+
"aria-disabled": "true",
|
|
1769
|
+
children: rt(e)
|
|
1770
|
+
}) : /* @__PURE__ */ u("a", {
|
|
1771
|
+
className: "ds-sidebar-link",
|
|
1772
|
+
href: e.href,
|
|
1773
|
+
"aria-current": t === e.href ? "page" : void 0,
|
|
1774
|
+
onClick: (t) => r?.(e, t),
|
|
1775
|
+
children: rt(e)
|
|
1776
|
+
}), l = (e) => /* @__PURE__ */ u("ul", { children: e.items.map((e) => /* @__PURE__ */ d("li", { children: [c(e), !!e.children?.length && /* @__PURE__ */ u("ul", { children: e.children.map((e) => /* @__PURE__ */ u("li", { children: c(e) }, e.href)) })] }, e.href)) });
|
|
1777
|
+
return /* @__PURE__ */ d("nav", {
|
|
1778
|
+
id: o,
|
|
1779
|
+
className: ["ds-sidebar", s].filter(Boolean).join(" "),
|
|
1780
|
+
"aria-label": n,
|
|
1781
|
+
children: [
|
|
1782
|
+
i && /* @__PURE__ */ u("div", {
|
|
1783
|
+
className: "ds-sidebar-header",
|
|
1784
|
+
children: i
|
|
1785
|
+
}),
|
|
1786
|
+
e.map((e) => e.collapsible ? /* @__PURE__ */ d("details", {
|
|
1787
|
+
className: "ds-sidebar-group",
|
|
1788
|
+
open: e.defaultOpen ?? !0,
|
|
1789
|
+
children: [/* @__PURE__ */ u("summary", { children: e.label }), l(e)]
|
|
1790
|
+
}, e.label) : /* @__PURE__ */ d("section", {
|
|
1791
|
+
className: "ds-sidebar-group",
|
|
1792
|
+
"aria-label": e.label,
|
|
1793
|
+
children: [/* @__PURE__ */ u("p", { children: e.label }), l(e)]
|
|
1794
|
+
}, e.label)),
|
|
1795
|
+
a && /* @__PURE__ */ u("div", {
|
|
1796
|
+
className: "ds-sidebar-footer",
|
|
1797
|
+
children: a
|
|
1798
|
+
})
|
|
1799
|
+
]
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
function rt(e) {
|
|
1803
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
1804
|
+
e.icon && /* @__PURE__ */ u("span", {
|
|
1805
|
+
className: "ds-sidebar-icon",
|
|
1806
|
+
"aria-hidden": "true",
|
|
1807
|
+
children: e.icon
|
|
1808
|
+
}),
|
|
1809
|
+
/* @__PURE__ */ u("span", {
|
|
1810
|
+
className: "ds-sidebar-text",
|
|
1811
|
+
children: e.label
|
|
1812
|
+
}),
|
|
1813
|
+
e.badge !== void 0 && e.badge !== "" && /* @__PURE__ */ u("span", {
|
|
1814
|
+
className: "ds-sidebar-badge",
|
|
1815
|
+
children: e.badge
|
|
1816
|
+
})
|
|
1817
|
+
] });
|
|
1818
|
+
}
|
|
1819
|
+
//#endregion
|
|
1820
|
+
export { je as Accordion, Me as AccordionItem, me as Alert, tt as Autocomplete, _e as Avatar, ve as AvatarGroup, ye as Badge, Te as BottomSheet, Ne as Breadcrumb, M as Button, be as Card, le as Checkbox, D as CheckboxPrimitive, He as DataTable, Ae as DatePicker, et as DateRangePicker, ee as Dialog, oe as DialogBody, ce as DialogClose, ne as DialogContent, ae as DialogDescription, se as DialogFooter, re as DialogHeader, E as DialogPrimitive, ie as DialogTitle, te as DialogTrigger, Fe as Divider, Ge as Drawer, Ee as Dropdown, we as EmptyState, Xe as FileUpload, We as FilterBar, P as IconButton, Se as Loading, Pe as Pagination, G as Progress, ue as RadioGroup, O as RadioGroupPrimitive, de as RadioItem, V as Select, H as SelectItem, p as SelectPrimitive, nt as Sidebar, W as Skeleton, I as SlidingButton, U as Spinner, fe as Switch, k as SwitchPrimitive, z as Tab, R as TabList, B as TabPanel, L as Tabs, K as TextField, De as Textarea, Ze as Timeline, ze as ToastProvider, xe as Tooltip, Ke as acceptsFile, $ as formatBytes, Q as paginationRange, Je as selectFiles, Le as useToast };
|
|
1287
1821
|
|
|
1288
1822
|
//# sourceMappingURL=figma-components-directo.js.map
|