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