@minimalstuff/ui 5.1.0 → 5.2.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/index.d.ts +19 -1
- package/dist/minimalstuff-ui.css +1 -1
- package/dist/minimalstuff-ui.js +797 -788
- package/package.json +1 -1
package/dist/minimalstuff-ui.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import { cloneElement as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l,
|
|
4
|
-
import { arrow as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { create as
|
|
7
|
-
import { createCallable as
|
|
3
|
+
import { cloneElement as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useEffectEvent as u, useId as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
4
|
+
import { arrow as g, autoUpdate as _, flip as v, offset as y, shift as b, useFloating as x } from "@floating-ui/react-dom";
|
|
5
|
+
import { createPortal as S } from "react-dom";
|
|
6
|
+
import { create as C } from "zustand";
|
|
7
|
+
import { createCallable as w } from "react-call";
|
|
8
8
|
// src/components/shared/surface_tokens.ts
|
|
9
|
-
var
|
|
10
|
-
`${
|
|
9
|
+
var T = "border-gray-300 dark:border-gray-600", E = "bg-white dark:bg-gray-800", D = "border-gray-200 dark:border-gray-700", O = "bg-white dark:bg-gray-900", k = "[scrollbar-color:theme(colors.gray.300)_transparent] hover:[scrollbar-color:theme(colors.gray.400)_transparent] dark:[scrollbar-color:theme(colors.gray.600)_transparent] dark:hover:[scrollbar-color:theme(colors.gray.500)_transparent]", A = `[scrollbar-width:thin] ${k}`;
|
|
10
|
+
`${k}`;
|
|
11
11
|
// src/components/app_bar/app_bar.tsx
|
|
12
|
-
var
|
|
13
|
-
function
|
|
12
|
+
var j = e("grid min-h-8 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b text-xs", "pl-[max(0.75rem,env(safe-area-inset-left))] pr-[max(0.75rem,env(safe-area-inset-right))]", "text-gray-700 dark:text-gray-300", O, D);
|
|
13
|
+
function M(t) {
|
|
14
14
|
let { start: i, title: a, end: o, startClassName: s, titleClassName: c, endClassName: l, unstyled: u = !1, className: d, ...f } = t;
|
|
15
15
|
return /* @__PURE__ */ r("header", {
|
|
16
16
|
...f,
|
|
17
|
-
className: e(!u &&
|
|
17
|
+
className: e(!u && j, d),
|
|
18
18
|
children: [
|
|
19
19
|
/* @__PURE__ */ n("div", {
|
|
20
20
|
className: e("flex min-w-0 items-center justify-start", s),
|
|
@@ -32,7 +32,7 @@ function j(t) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
// src/components/shared/focus_styles.ts
|
|
35
|
-
var
|
|
35
|
+
var N = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", P = "focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:border-transparent", F = "has-[:focus-visible]:outline-hidden has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", I = "has-[:focus-visible]:ring-blue-500", L = "has-[:focus-visible]:ring-red-500", R = "outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400", z = {
|
|
36
36
|
primary: {
|
|
37
37
|
solid: "border-transparent bg-blue-600 text-white interactive:hover:bg-blue-700 interactive:active:bg-blue-800",
|
|
38
38
|
outline: "border-blue-300 bg-transparent text-blue-700 interactive:hover:bg-blue-50 interactive:active:bg-blue-100 dark:border-blue-800 dark:text-blue-400 dark:interactive:hover:bg-blue-950/40 dark:interactive:active:bg-blue-950/60",
|
|
@@ -73,68 +73,68 @@ var M = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
|
73
73
|
pressedSolid: "border-transparent bg-yellow-900 text-white ring-2 ring-inset ring-white interactive:hover:bg-yellow-950 interactive:active:bg-yellow-950",
|
|
74
74
|
focusOutline: "focus-visible:outline-yellow-700 dark:focus-visible:outline-yellow-500"
|
|
75
75
|
}
|
|
76
|
-
},
|
|
77
|
-
function
|
|
78
|
-
let r =
|
|
76
|
+
}, B = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:cursor-not-allowed", V = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 interactive:active:duration-75 ms-button-press ${N}`;
|
|
77
|
+
function H(e, t, n) {
|
|
78
|
+
let r = z[e];
|
|
79
79
|
return n ? r.pressedSolid : r[t];
|
|
80
80
|
}
|
|
81
81
|
// src/components/shared/radius.ts
|
|
82
|
-
var
|
|
82
|
+
var U = {
|
|
83
83
|
none: "rounded-none",
|
|
84
84
|
sm: "rounded-sm",
|
|
85
85
|
md: "rounded-md",
|
|
86
86
|
lg: "rounded-lg",
|
|
87
87
|
xl: "rounded-xl",
|
|
88
88
|
full: "rounded-full"
|
|
89
|
-
},
|
|
90
|
-
...
|
|
91
|
-
full:
|
|
89
|
+
}, ee = {
|
|
90
|
+
...U,
|
|
91
|
+
full: U.lg
|
|
92
92
|
}, W = {
|
|
93
93
|
xs: "h-6 w-6 text-xs",
|
|
94
94
|
sm: "h-8 w-8 text-sm",
|
|
95
95
|
md: "h-10 w-10 text-base",
|
|
96
96
|
lg: "h-12 w-12 text-xl"
|
|
97
|
-
},
|
|
98
|
-
function
|
|
97
|
+
}, te = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
98
|
+
function ne(e) {
|
|
99
99
|
let t = e.trim();
|
|
100
100
|
if (t.length === 0) return "";
|
|
101
|
-
let [n] =
|
|
101
|
+
let [n] = te.segment(t);
|
|
102
102
|
return n.segment.toUpperCase();
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
let [l, u] =
|
|
104
|
+
function re({ name: t, src: r, size: i = "sm", color: a = "primary", radius: o = "full", unstyled: s = !1, className: c }) {
|
|
105
|
+
let [l, u] = h(null), d = r !== void 0 && r !== l, f = t.trim().length > 0, p = d ? /* @__PURE__ */ n("img", {
|
|
106
106
|
src: r,
|
|
107
107
|
alt: "",
|
|
108
108
|
onError: () => u(r ?? null),
|
|
109
109
|
className: "h-full w-full object-cover"
|
|
110
110
|
}) : /* @__PURE__ */ n("span", {
|
|
111
111
|
"aria-hidden": "true",
|
|
112
|
-
children:
|
|
112
|
+
children: ne(t)
|
|
113
113
|
});
|
|
114
114
|
return /* @__PURE__ */ n("span", {
|
|
115
115
|
role: f ? "img" : void 0,
|
|
116
116
|
"aria-label": f ? t : void 0,
|
|
117
117
|
"aria-hidden": !f || void 0,
|
|
118
|
-
className: e("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", W[i], !s &&
|
|
118
|
+
className: e("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", W[i], !s && U[o], !s && !d && ["border font-semibold", z[a].solid], c),
|
|
119
119
|
children: p
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
// src/components/badge/badge.tsx
|
|
123
|
-
var
|
|
123
|
+
var ie = {
|
|
124
124
|
xs: "px-1.5 py-0.5 text-xs",
|
|
125
125
|
sm: "px-2.5 py-1 text-sm",
|
|
126
126
|
md: "px-3 py-1 text-base",
|
|
127
127
|
lg: "px-3.5 py-1.5 text-lg"
|
|
128
|
-
},
|
|
128
|
+
}, ae = ({ children: t, color: r = "primary", variant: i = "subtle", size: a = "sm", radius: o = "md", unstyled: s = !1, className: c, ...l }) => /* @__PURE__ */ n("span", {
|
|
129
129
|
className: e("inline-flex items-center", !s && [
|
|
130
130
|
"gap-1 border",
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
U[o],
|
|
132
|
+
ie[a],
|
|
133
|
+
z[r][i]
|
|
134
134
|
], c),
|
|
135
135
|
...l,
|
|
136
136
|
children: t
|
|
137
|
-
}),
|
|
137
|
+
}), G = {
|
|
138
138
|
xs: "px-2 py-1 text-xs",
|
|
139
139
|
sm: "px-3 py-1.5 text-sm",
|
|
140
140
|
md: "px-4 py-2 text-sm",
|
|
@@ -142,13 +142,13 @@ var ne = {
|
|
|
142
142
|
};
|
|
143
143
|
function K(t = {}) {
|
|
144
144
|
let { variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", fullWidth: o = !1, pressed: s = !1, unstyled: c = !1, className: l } = t;
|
|
145
|
-
return e(
|
|
146
|
-
|
|
145
|
+
return e(B, !c && [
|
|
146
|
+
V,
|
|
147
147
|
"gap-2 font-medium border",
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
U[a],
|
|
149
|
+
G[i],
|
|
150
|
+
H(r, n, s),
|
|
151
|
+
z[r].focusOutline
|
|
152
152
|
], o && "w-full", l);
|
|
153
153
|
}
|
|
154
154
|
var q = a({
|
|
@@ -174,14 +174,14 @@ function J() {
|
|
|
174
174
|
return c(q);
|
|
175
175
|
}
|
|
176
176
|
// src/components/button/button.tsx
|
|
177
|
-
var
|
|
177
|
+
var oe = {
|
|
178
178
|
xs: "w-3.5 h-3.5",
|
|
179
179
|
sm: "w-4 h-4",
|
|
180
180
|
md: "w-4 h-4",
|
|
181
181
|
lg: "w-5 h-5"
|
|
182
182
|
};
|
|
183
183
|
function Y(t) {
|
|
184
|
-
let { unstyled: i = !1, variant: a = "solid", color: o = "primary", size: s = "md", radius: c = "md", children: l, className: u, fullWidth: d = !1, loading: f = !1, pressed: p, startIcon: m, endIcon: h, disabled: g, onClick: _, "aria-label": v, ...y } = t, b = J(), x = v !== void 0, S = f && x ? `${v} ${b.loading}` : v, C =
|
|
184
|
+
let { unstyled: i = !1, variant: a = "solid", color: o = "primary", size: s = "md", radius: c = "md", children: l, className: u, fullWidth: d = !1, loading: f = !1, pressed: p, startIcon: m, endIcon: h, disabled: g, onClick: _, "aria-label": v, ...y } = t, b = J(), x = v !== void 0, S = f && x ? `${v} ${b.loading}` : v, C = oe[s], w = (e) => {
|
|
185
185
|
f ? e.preventDefault() : _?.(e);
|
|
186
186
|
};
|
|
187
187
|
return /* @__PURE__ */ r("button", {
|
|
@@ -225,13 +225,13 @@ function Y(t) {
|
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
// src/components/card/card_header.tsx
|
|
228
|
-
var
|
|
228
|
+
var X = {
|
|
229
229
|
2: "h2",
|
|
230
230
|
3: "h3",
|
|
231
231
|
4: "h4"
|
|
232
232
|
};
|
|
233
|
-
function
|
|
234
|
-
let s =
|
|
233
|
+
function se({ title: e, titleId: t, level: i, description: a, actions: o }) {
|
|
234
|
+
let s = X[i];
|
|
235
235
|
return /* @__PURE__ */ r("div", {
|
|
236
236
|
className: "mb-4",
|
|
237
237
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -248,25 +248,25 @@ function X({ title: e, titleId: t, level: i, description: a, actions: o }) {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
// src/components/card/card.tsx
|
|
251
|
-
var
|
|
251
|
+
var ce = {
|
|
252
252
|
none: "",
|
|
253
253
|
sm: "p-4",
|
|
254
254
|
md: "p-6",
|
|
255
255
|
lg: "p-8"
|
|
256
256
|
};
|
|
257
|
-
function
|
|
258
|
-
let p =
|
|
257
|
+
function le({ children: t, title: i, description: a, actions: o, headingLevel: s = 2, padding: c = "md", radius: l = "lg", unstyled: u = !1, className: f }) {
|
|
258
|
+
let p = d(), m = !!i;
|
|
259
259
|
return /* @__PURE__ */ r("div", {
|
|
260
260
|
role: m ? "region" : void 0,
|
|
261
261
|
"aria-labelledby": m ? p : void 0,
|
|
262
|
-
className: e(!
|
|
262
|
+
className: e(!u && [
|
|
263
263
|
"border",
|
|
264
264
|
"bg-white dark:bg-gray-800",
|
|
265
265
|
"border-gray-200 dark:border-gray-700",
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
U[l],
|
|
267
|
+
ce[c]
|
|
268
268
|
], f),
|
|
269
|
-
children: [m && /* @__PURE__ */ n(
|
|
269
|
+
children: [m && /* @__PURE__ */ n(se, {
|
|
270
270
|
title: i,
|
|
271
271
|
titleId: p,
|
|
272
272
|
level: s,
|
|
@@ -276,21 +276,21 @@ function ce({ children: t, title: i, description: a, actions: o, headingLevel: s
|
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
// src/components/character_count/character_count.tsx
|
|
279
|
-
var
|
|
280
|
-
function
|
|
279
|
+
var ue = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right", de = .1;
|
|
280
|
+
function fe(e, t) {
|
|
281
281
|
if (t === void 0) return "ok";
|
|
282
282
|
let n = t - e;
|
|
283
|
-
return n <= 0 ? "empty" : n <= Math.max(1, Math.ceil(t *
|
|
283
|
+
return n <= 0 ? "empty" : n <= Math.max(1, Math.ceil(t * de)) ? "low" : "ok";
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Z(e, t) {
|
|
286
286
|
return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-700 dark:text-amber-400" : "";
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
let f = J(), p =
|
|
288
|
+
function pe({ current: i, min: a, max: o, showMin: s, showMax: c, unstyled: l = !1, id: u, className: d }) {
|
|
289
|
+
let f = J(), p = fe(i, o), [m, g] = h({
|
|
290
290
|
zone: p,
|
|
291
291
|
message: ""
|
|
292
292
|
});
|
|
293
|
-
if (
|
|
293
|
+
if (m.zone !== p) {
|
|
294
294
|
let e = Math.max(0, (o ?? 0) - i);
|
|
295
295
|
g({
|
|
296
296
|
zone: p,
|
|
@@ -300,34 +300,34 @@ function Z({ current: i, min: a, max: o, showMin: s, showMax: c, unstyled: l = !
|
|
|
300
300
|
let _ = s === !0 || c === !0, v = a !== void 0 && i <= a ? "atLimit" : "ok", y = o !== void 0 && i > o ? "overLimit" : o !== void 0 && i >= o ? "atLimit" : "ok", b = _ ? `${i}/${a} min` : `${i} (min ${a})`, x = _ ? `${i}/${o} max` : `${i}/${o}`;
|
|
301
301
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
302
302
|
id: u,
|
|
303
|
-
className: e(!l &&
|
|
303
|
+
className: e(!l && ue, d),
|
|
304
304
|
children: [
|
|
305
305
|
s && a !== void 0 && /* @__PURE__ */ n("span", {
|
|
306
|
-
className:
|
|
306
|
+
className: Z(v, l),
|
|
307
307
|
children: b
|
|
308
308
|
}),
|
|
309
309
|
s && c && " · ",
|
|
310
310
|
c && o !== void 0 && /* @__PURE__ */ n("span", {
|
|
311
|
-
className:
|
|
311
|
+
className: Z(y, l),
|
|
312
312
|
children: x
|
|
313
313
|
}),
|
|
314
314
|
!s && !c && o !== void 0 && /* @__PURE__ */ n("span", {
|
|
315
|
-
className:
|
|
315
|
+
className: Z(y, l),
|
|
316
316
|
children: x
|
|
317
317
|
}),
|
|
318
318
|
!s && !c && a !== void 0 && o === void 0 && /* @__PURE__ */ n("span", {
|
|
319
|
-
className:
|
|
319
|
+
className: Z(v, l),
|
|
320
320
|
children: b
|
|
321
321
|
})
|
|
322
322
|
]
|
|
323
323
|
}), /* @__PURE__ */ n("span", {
|
|
324
324
|
"aria-live": "polite",
|
|
325
325
|
className: "sr-only",
|
|
326
|
-
children:
|
|
326
|
+
children: m.message
|
|
327
327
|
})] });
|
|
328
328
|
}
|
|
329
329
|
// src/components/shared/checkmark_icon.tsx
|
|
330
|
-
function
|
|
330
|
+
function me() {
|
|
331
331
|
return /* @__PURE__ */ n("svg", {
|
|
332
332
|
className: "h-3 w-3 text-white",
|
|
333
333
|
viewBox: "0 0 12 12",
|
|
@@ -340,7 +340,7 @@ function pe() {
|
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
342
|
// src/components/shared/dash_icon.tsx
|
|
343
|
-
function
|
|
343
|
+
function he() {
|
|
344
344
|
return /* @__PURE__ */ n("svg", {
|
|
345
345
|
className: "h-3 w-3 text-white",
|
|
346
346
|
viewBox: "0 0 12 12",
|
|
@@ -356,24 +356,24 @@ function me() {
|
|
|
356
356
|
})
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
var
|
|
359
|
+
var ge = `w-full border ${T} ${E} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${P} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, _e = "text-sm font-medium text-gray-700 dark:text-gray-300", ve = "text-red-500 dark:text-red-400 ml-1", ye = "text-xs text-gray-600 dark:text-gray-400", be = "text-xs text-red-600 dark:text-red-400", xe = "border-red-500 dark:border-red-400", Se = ({ id: t, description: r, className: i }) => r ? typeof r == "string" ? /* @__PURE__ */ n("p", {
|
|
360
360
|
id: t,
|
|
361
|
-
className: e(
|
|
361
|
+
className: e(ye, i),
|
|
362
362
|
children: r
|
|
363
363
|
}) : /* @__PURE__ */ n("span", {
|
|
364
364
|
id: t,
|
|
365
|
-
className: e(
|
|
365
|
+
className: e(ye, "block", i),
|
|
366
366
|
children: r
|
|
367
|
-
}) : null,
|
|
368
|
-
function
|
|
369
|
-
return c(
|
|
367
|
+
}) : null, Ce = a(!0);
|
|
368
|
+
function we() {
|
|
369
|
+
return c(Ce);
|
|
370
370
|
}
|
|
371
371
|
// src/components/shared/field_error.tsx
|
|
372
|
-
var
|
|
373
|
-
let a =
|
|
372
|
+
var Te = ({ id: t, error: r, className: i }) => {
|
|
373
|
+
let a = we();
|
|
374
374
|
return r ? /* @__PURE__ */ n("p", {
|
|
375
375
|
id: t,
|
|
376
|
-
className: e(
|
|
376
|
+
className: e(be, i),
|
|
377
377
|
role: a ? "alert" : void 0,
|
|
378
378
|
children: r
|
|
379
379
|
}) : null;
|
|
@@ -383,36 +383,36 @@ function Q(...e) {
|
|
|
383
383
|
return e.filter(Boolean).join(" ") || void 0;
|
|
384
384
|
}
|
|
385
385
|
// src/components/shared/option_card_styles.ts
|
|
386
|
-
function
|
|
386
|
+
function Ee(t) {
|
|
387
387
|
let { isSelected: n, isError: r, isDisabled: i, radius: a, unstyled: o } = t;
|
|
388
|
-
return e("relative flex cursor-pointer items-start gap-3 transition-colors duration-150",
|
|
389
|
-
|
|
388
|
+
return e("relative flex cursor-pointer items-start gap-3 transition-colors duration-150", F, r ? L : I, !o && [
|
|
389
|
+
U[a],
|
|
390
390
|
"border px-3 py-2.5",
|
|
391
391
|
n ? r ? e("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : r ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : e("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
|
|
392
392
|
], i && "cursor-not-allowed opacity-50");
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function De(e) {
|
|
395
395
|
let { isSelected: t, isError: n } = e;
|
|
396
|
-
return t ? n ?
|
|
396
|
+
return t ? n ? xe : "border-blue-600 dark:border-blue-500" : n ? "border-red-400 dark:border-red-600" : T;
|
|
397
397
|
}
|
|
398
398
|
// src/components/shared/required_mark.tsx
|
|
399
|
-
function
|
|
399
|
+
function Oe() {
|
|
400
400
|
return /* @__PURE__ */ n("span", {
|
|
401
|
-
className:
|
|
401
|
+
className: ve,
|
|
402
402
|
"aria-hidden": "true",
|
|
403
403
|
children: "*"
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
// src/components/shared/use_controlled_state.ts
|
|
407
|
-
function
|
|
408
|
-
let [n, r] =
|
|
407
|
+
function ke(e, t) {
|
|
408
|
+
let [n, r] = h(t), i = e !== void 0, a = s((e) => {
|
|
409
409
|
i || r(e);
|
|
410
410
|
}, [i]);
|
|
411
411
|
return [i ? e : n, a];
|
|
412
412
|
}
|
|
413
413
|
// src/components/shared/use_field_ids.ts
|
|
414
414
|
function $(e) {
|
|
415
|
-
let t =
|
|
415
|
+
let t = d(), n = e ?? t;
|
|
416
416
|
return {
|
|
417
417
|
fieldId: n,
|
|
418
418
|
errorId: `${n}-error`,
|
|
@@ -422,8 +422,8 @@ function $(e) {
|
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
424
|
// src/components/shared/use_warn_unnamed.ts
|
|
425
|
-
var
|
|
426
|
-
function
|
|
425
|
+
var Ae = "needs an accessible name. Provide a `label`, `aria-label` or `aria-labelledby` prop.";
|
|
426
|
+
function je(e, t, n = Ae) {
|
|
427
427
|
l(() => {
|
|
428
428
|
process.env.NODE_ENV === "production" || t || console.warn(`${e}: ${n}`);
|
|
429
429
|
}, [
|
|
@@ -433,34 +433,34 @@ function Ae(e, t, n = ke) {
|
|
|
433
433
|
]);
|
|
434
434
|
}
|
|
435
435
|
// src/lib/merge_refs.ts
|
|
436
|
-
function
|
|
436
|
+
function Me(...e) {
|
|
437
437
|
return (t) => {
|
|
438
438
|
for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
441
|
// src/components/checkbox/checkbox.tsx
|
|
442
|
-
function
|
|
442
|
+
function Ne(e, i, a) {
|
|
443
443
|
return e === void 0 ? null : typeof e == "string" ? /* @__PURE__ */ r("span", {
|
|
444
444
|
className: i,
|
|
445
|
-
children: [e, a && /* @__PURE__ */ n(
|
|
446
|
-
}) : /* @__PURE__ */ r(t, { children: [e, a && /* @__PURE__ */ n(
|
|
445
|
+
children: [e, a && /* @__PURE__ */ n(Oe, {})]
|
|
446
|
+
}) : /* @__PURE__ */ r(t, { children: [e, a && /* @__PURE__ */ n(Oe, {})] });
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
let { fieldId: T, errorId: E, descriptionId: D } = $(y), [O, k] =
|
|
450
|
-
|
|
451
|
-
let P =
|
|
448
|
+
function Pe({ label: t, indeterminate: i = !1, description: a, error: o, radius: s = "sm", unstyled: c = !1, fullWidth: u = !1, variant: d = "inline", className: f, wrapperClassName: h, checked: g, defaultChecked: _ = !1, onChange: v, id: y, "aria-describedby": b, "aria-label": x, "aria-labelledby": S, ref: C, ...w }) {
|
|
449
|
+
let { fieldId: T, errorId: E, descriptionId: D } = $(y), [O, k] = ke(g, _), A = m(null), j = d === "card", M = O || i, N = Q(b, !!a && D, o && E);
|
|
450
|
+
je("Checkbox", !!t || !!x?.trim() || !!S?.trim());
|
|
451
|
+
let P = p(() => Me(A, C), [C]);
|
|
452
452
|
l(() => {
|
|
453
453
|
A.current && (A.current.indeterminate = i);
|
|
454
454
|
});
|
|
455
455
|
let F = (e) => {
|
|
456
456
|
e.target.indeterminate = i, k(e.target.checked), v?.(e);
|
|
457
|
-
}, I = j ?
|
|
457
|
+
}, I = j ? Ee({
|
|
458
458
|
isSelected: M,
|
|
459
459
|
isError: !!o,
|
|
460
460
|
isDisabled: w.disabled === !0,
|
|
461
461
|
radius: s,
|
|
462
462
|
unstyled: c
|
|
463
|
-
}) : e("flex items-start gap-3 cursor-pointer", w.disabled && "cursor-not-allowed opacity-50"), L = j ? e("select-none text-sm font-medium", M ? o ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300") : e(
|
|
463
|
+
}) : e("flex items-start gap-3 cursor-pointer", w.disabled && "cursor-not-allowed opacity-50"), L = j ? e("select-none text-sm font-medium", M ? o ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300") : e(_e, "select-none"), R = e("relative shrink-0", U[s], !j && ["has-[:focus-visible]:outline-hidden has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", o ? "has-[:focus-visible]:ring-red-500" : "has-[:focus-visible]:ring-blue-500"]), z = Ne(t, L, w.required === !0);
|
|
464
464
|
return /* @__PURE__ */ r("div", {
|
|
465
465
|
className: e(u ? "w-full" : "w-fit", h),
|
|
466
466
|
children: [
|
|
@@ -483,13 +483,13 @@ function Ne({ label: t, indeterminate: i = !1, description: a, error: o, radius:
|
|
|
483
483
|
...w
|
|
484
484
|
}), /* @__PURE__ */ n("span", {
|
|
485
485
|
className: e("flex h-5 w-5 items-center justify-center transition-all duration-200", !c && [
|
|
486
|
-
|
|
486
|
+
U[s],
|
|
487
487
|
"border-2",
|
|
488
488
|
M ? e("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : e("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
|
|
489
489
|
o && "border-red-500 dark:border-red-400"
|
|
490
|
-
],
|
|
490
|
+
], f),
|
|
491
491
|
"aria-hidden": !0,
|
|
492
|
-
children: i ? /* @__PURE__ */ n(
|
|
492
|
+
children: i ? /* @__PURE__ */ n(he, {}) : O && /* @__PURE__ */ n(me, {})
|
|
493
493
|
})]
|
|
494
494
|
}), j ? /* @__PURE__ */ r("span", {
|
|
495
495
|
className: "flex min-w-0 flex-col",
|
|
@@ -501,12 +501,12 @@ function Ne({ label: t, indeterminate: i = !1, description: a, error: o, radius:
|
|
|
501
501
|
})]
|
|
502
502
|
}) : z]
|
|
503
503
|
}),
|
|
504
|
-
!j && /* @__PURE__ */ n(
|
|
504
|
+
!j && /* @__PURE__ */ n(Se, {
|
|
505
505
|
id: D,
|
|
506
506
|
description: a,
|
|
507
507
|
className: "mt-1 ml-8"
|
|
508
508
|
}),
|
|
509
|
-
/* @__PURE__ */ n(
|
|
509
|
+
/* @__PURE__ */ n(Te, {
|
|
510
510
|
id: E,
|
|
511
511
|
error: o,
|
|
512
512
|
className: j ? "mt-1" : "mt-1 ml-8"
|
|
@@ -515,10 +515,10 @@ function Ne({ label: t, indeterminate: i = !1, description: a, error: o, radius:
|
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
// src/components/shared/option_row.tsx
|
|
518
|
-
function
|
|
518
|
+
function Fe({ item: t, htmlFor: i, descriptionId: a, orientation: o, isSelected: s, isDisabled: c, isError: l, radius: u, unstyled: d, className: f, control: p, indicator: m }) {
|
|
519
519
|
return /* @__PURE__ */ r("label", {
|
|
520
520
|
htmlFor: i,
|
|
521
|
-
className: e(
|
|
521
|
+
className: e(Ee({
|
|
522
522
|
isSelected: s,
|
|
523
523
|
isError: l,
|
|
524
524
|
isDisabled: c,
|
|
@@ -550,9 +550,9 @@ function Pe({ item: t, htmlFor: i, descriptionId: a, orientation: o, isSelected:
|
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
552
|
// src/components/checkbox_options/checkbox_option_row.tsx
|
|
553
|
-
function
|
|
553
|
+
function Ie({ option: t, optionId: r, descriptionId: i, name: a, orientation: o, isSelected: s, isDisabled: c, error: l, radius: u, unstyled: d, className: f, onToggle: p }) {
|
|
554
554
|
let m = !!l;
|
|
555
|
-
return /* @__PURE__ */ n(
|
|
555
|
+
return /* @__PURE__ */ n(Fe, {
|
|
556
556
|
item: t,
|
|
557
557
|
htmlFor: r,
|
|
558
558
|
descriptionId: i,
|
|
@@ -576,26 +576,26 @@ function Fe({ option: t, optionId: r, descriptionId: i, name: a, orientation: o,
|
|
|
576
576
|
className: "sr-only"
|
|
577
577
|
}),
|
|
578
578
|
indicator: /* @__PURE__ */ n("span", {
|
|
579
|
-
className: e("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border-2 transition-colors duration-150",
|
|
579
|
+
className: e("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border-2 transition-colors duration-150", U.sm, De({
|
|
580
580
|
isSelected: s,
|
|
581
581
|
isError: m
|
|
582
582
|
}), s && (m ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500")),
|
|
583
583
|
"aria-hidden": !0,
|
|
584
|
-
children: s && /* @__PURE__ */ n(
|
|
584
|
+
children: s && /* @__PURE__ */ n(me, {})
|
|
585
585
|
})
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
588
|
// src/components/checkbox_options/checkbox_options.tsx
|
|
589
|
-
function
|
|
589
|
+
function Le(e, t, n) {
|
|
590
590
|
let r = t.includes(n) ? t.filter((e) => e !== n) : [...t, n];
|
|
591
591
|
return e.map((e) => e.value).filter((e) => r.includes(e));
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
let S = J(), { fieldId: C, errorId: w } = $(y), T = l ?? C, [E, D] =
|
|
593
|
+
function Re({ options: i, orientation: a = "vertical", values: o, defaultValues: s, onChange: c, name: l, label: u, error: d, required: f, requiredLabel: p, disabled: m, radius: h = "lg", unstyled: g = !1, className: _, wrapperClassName: v, id: y, "aria-describedby": b, ...x }) {
|
|
594
|
+
let S = J(), { fieldId: C, errorId: w } = $(y), T = l ?? C, [E, D] = ke(o, s ?? []), O = i.map((e) => typeof e == "string" ? {
|
|
595
595
|
value: e,
|
|
596
596
|
label: e
|
|
597
597
|
} : e), k = (e) => {
|
|
598
|
-
let t =
|
|
598
|
+
let t = Le(O, E, e);
|
|
599
599
|
D(t), c?.(t);
|
|
600
600
|
};
|
|
601
601
|
return /* @__PURE__ */ r("fieldset", {
|
|
@@ -606,14 +606,14 @@ function Le({ options: i, orientation: a = "vertical", values: o, defaultValues:
|
|
|
606
606
|
children: [
|
|
607
607
|
u && /* @__PURE__ */ r("legend", {
|
|
608
608
|
className: e("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
|
|
609
|
-
children: [u, f && /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(
|
|
609
|
+
children: [u, f && /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(Oe, {}), /* @__PURE__ */ n("span", {
|
|
610
610
|
className: "sr-only",
|
|
611
611
|
children: ` (${p ?? S.required})`
|
|
612
612
|
})] })]
|
|
613
613
|
}),
|
|
614
614
|
/* @__PURE__ */ n("div", {
|
|
615
615
|
className: e(a === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
|
|
616
|
-
children: O.map((e, t) => /* @__PURE__ */ n(
|
|
616
|
+
children: O.map((e, t) => /* @__PURE__ */ n(Ie, {
|
|
617
617
|
option: e,
|
|
618
618
|
optionId: `${C}-${t}`,
|
|
619
619
|
descriptionId: `${C}-${t}-desc`,
|
|
@@ -628,7 +628,7 @@ function Le({ options: i, orientation: a = "vertical", values: o, defaultValues:
|
|
|
628
628
|
onToggle: k
|
|
629
629
|
}, e.value))
|
|
630
630
|
}),
|
|
631
|
-
/* @__PURE__ */ n(
|
|
631
|
+
/* @__PURE__ */ n(Te, {
|
|
632
632
|
id: w,
|
|
633
633
|
error: d,
|
|
634
634
|
className: "mt-2"
|
|
@@ -637,8 +637,8 @@ function Le({ options: i, orientation: a = "vertical", values: o, defaultValues:
|
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
639
|
// src/hooks/use_is_client/use_is_client.tsx
|
|
640
|
-
var
|
|
641
|
-
let [e, t] =
|
|
640
|
+
var ze = () => {
|
|
641
|
+
let [e, t] = h(!1);
|
|
642
642
|
return l(() => {
|
|
643
643
|
let e = requestAnimationFrame(() => {
|
|
644
644
|
t(!0);
|
|
@@ -649,11 +649,11 @@ var Re = () => {
|
|
|
649
649
|
}, []), e;
|
|
650
650
|
};
|
|
651
651
|
// src/components/client_only/client_only.tsx
|
|
652
|
-
function
|
|
653
|
-
return
|
|
652
|
+
function Be({ children: e, fallback: r }) {
|
|
653
|
+
return ze() ? /* @__PURE__ */ n(t, { children: e }) : r ?? null;
|
|
654
654
|
}
|
|
655
655
|
// src/components/shared/field.tsx
|
|
656
|
-
var
|
|
656
|
+
var Ve = ({ fieldId: t, errorId: i, descriptionId: a, label: o, description: s, error: c, required: l = !1, wrapperClassName: u, children: d }) => /* @__PURE__ */ r("div", {
|
|
657
657
|
className: e("w-full", u),
|
|
658
658
|
children: [
|
|
659
659
|
!!o && (typeof o == "string" ? /* @__PURE__ */ r("label", {
|
|
@@ -674,12 +674,12 @@ var Be = ({ fieldId: t, errorId: i, descriptionId: a, label: o, description: s,
|
|
|
674
674
|
})]
|
|
675
675
|
})),
|
|
676
676
|
d,
|
|
677
|
-
a && /* @__PURE__ */ n(
|
|
677
|
+
a && /* @__PURE__ */ n(Se, {
|
|
678
678
|
id: a,
|
|
679
679
|
description: s,
|
|
680
680
|
className: "mt-1"
|
|
681
681
|
}),
|
|
682
|
-
/* @__PURE__ */ n(
|
|
682
|
+
/* @__PURE__ */ n(Te, {
|
|
683
683
|
id: i,
|
|
684
684
|
error: c,
|
|
685
685
|
className: "mt-1"
|
|
@@ -687,18 +687,18 @@ var Be = ({ fieldId: t, errorId: i, descriptionId: a, label: o, description: s,
|
|
|
687
687
|
]
|
|
688
688
|
});
|
|
689
689
|
// src/components/shared/resolve_node_labelled_by.ts
|
|
690
|
-
function
|
|
690
|
+
function He(e, t, n) {
|
|
691
691
|
if (e && typeof e != "string" && !n) return t;
|
|
692
692
|
}
|
|
693
693
|
// src/components/shared/use_active_option.ts
|
|
694
|
-
var
|
|
695
|
-
function
|
|
696
|
-
return e >= 0 && e < t ? e :
|
|
694
|
+
var Ue = -1;
|
|
695
|
+
function We(e, t) {
|
|
696
|
+
return e >= 0 && e < t ? e : Ue;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
let [r, i] =
|
|
698
|
+
function Ge({ optionCount: e, getOptionId: t, isOpen: n }) {
|
|
699
|
+
let [r, i] = h(Ue), a = We(r, e), o = s((t) => {
|
|
700
700
|
e !== 0 && i((n) => {
|
|
701
|
-
let r =
|
|
701
|
+
let r = We(n, e) + t;
|
|
702
702
|
return r < 0 ? e - 1 : r >= e ? 0 : r;
|
|
703
703
|
});
|
|
704
704
|
}, [e]), c = s(() => {
|
|
@@ -706,7 +706,7 @@ function We({ optionCount: e, getOptionId: t, isOpen: n }) {
|
|
|
706
706
|
}, []), u = s(() => {
|
|
707
707
|
i(e - 1);
|
|
708
708
|
}, [e]), d = s(() => {
|
|
709
|
-
i(
|
|
709
|
+
i(Ue);
|
|
710
710
|
}, []), f = n && a >= 0 ? t(a) : void 0;
|
|
711
711
|
return l(() => {
|
|
712
712
|
f !== void 0 && document.getElementById(f)?.scrollIntoView?.({ block: "nearest" });
|
|
@@ -720,43 +720,43 @@ function We({ optionCount: e, getOptionId: t, isOpen: n }) {
|
|
|
720
720
|
};
|
|
721
721
|
}
|
|
722
722
|
// src/components/combobox/combobox.tsx
|
|
723
|
-
function
|
|
723
|
+
function Ke(e, t) {
|
|
724
724
|
return e.label.toLowerCase().includes(t.toLowerCase());
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
let T = J(), { fieldId: E, errorId: D, descriptionId: O, labelId: k } = $(w), A = `${E}-listbox`, j =
|
|
726
|
+
function qe({ options: t, filterOption: i = Ke, label: a, description: o, "aria-label": s, error: c, placeholder: l, noResultsText: u, clearLabel: d, radius: f = "md", unstyled: g = !1, disabled: _ = !1, required: v = !1, className: y, wrapperClassName: b, value: x, defaultValue: S = "", onChange: C, id: w }) {
|
|
727
|
+
let T = J(), { fieldId: E, errorId: D, descriptionId: O, labelId: k } = $(w), A = `${E}-listbox`, j = m(null), [M, N] = ke(x, S), P = t.find((e) => e.value === M), [F, I] = h(""), [L, R] = h(!1), [B, V] = h(!1), H = p(() => L ? t.filter((e) => i(e, F)) : t, [
|
|
728
728
|
t,
|
|
729
729
|
i,
|
|
730
730
|
L,
|
|
731
731
|
F
|
|
732
|
-
]), { activeIndex:
|
|
733
|
-
optionCount:
|
|
732
|
+
]), { activeIndex: ee, activeOptionId: W, move: te, first: ne, last: re, reset: ie } = Ge({
|
|
733
|
+
optionCount: H.length,
|
|
734
734
|
getOptionId: (e) => `${A}-option-${e}`,
|
|
735
735
|
isOpen: B
|
|
736
|
-
}),
|
|
737
|
-
_ || (I(P?.label ?? ""),
|
|
738
|
-
},
|
|
739
|
-
V(!1),
|
|
740
|
-
},
|
|
741
|
-
N(e.value), C?.(e.value),
|
|
742
|
-
},
|
|
736
|
+
}), ae = B ? F : P?.label ?? "", G = () => {
|
|
737
|
+
_ || (I(P?.label ?? ""), R(!1), V(!0), ie());
|
|
738
|
+
}, K = () => {
|
|
739
|
+
V(!1), R(!1), ie();
|
|
740
|
+
}, q = (e) => {
|
|
741
|
+
N(e.value), C?.(e.value), K();
|
|
742
|
+
}, oe = () => {
|
|
743
743
|
N(""), C?.(""), I(""), j.current?.focus();
|
|
744
|
-
},
|
|
745
|
-
I(e.target.value),
|
|
744
|
+
}, Y = (e) => {
|
|
745
|
+
I(e.target.value), R(!0), V(!0), ne();
|
|
746
746
|
}, X = () => {
|
|
747
|
-
B ||
|
|
747
|
+
B || G();
|
|
748
748
|
}, se = (e) => {
|
|
749
|
-
e.preventDefault(), e.altKey ? B ||
|
|
749
|
+
e.preventDefault(), e.altKey ? B || G() : B ? te(1) : (G(), ne());
|
|
750
750
|
}, ce = (e) => {
|
|
751
|
-
e.preventDefault(), e.altKey ? B &&
|
|
751
|
+
e.preventDefault(), e.altKey ? B && K() : B ? te(-1) : (G(), re());
|
|
752
752
|
}, le = (e) => {
|
|
753
753
|
if (!B) return;
|
|
754
|
-
let t =
|
|
755
|
-
t ? (e.preventDefault(),
|
|
754
|
+
let t = H[ee];
|
|
755
|
+
t ? (e.preventDefault(), q(t)) : K();
|
|
756
756
|
}, ue = (e) => {
|
|
757
|
-
B && (e.preventDefault(),
|
|
757
|
+
B && (e.preventDefault(), K());
|
|
758
758
|
};
|
|
759
|
-
return /* @__PURE__ */ n(
|
|
759
|
+
return /* @__PURE__ */ n(Ve, {
|
|
760
760
|
fieldId: E,
|
|
761
761
|
errorId: D,
|
|
762
762
|
descriptionId: O,
|
|
@@ -780,10 +780,10 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
780
780
|
autoComplete: "off",
|
|
781
781
|
disabled: _,
|
|
782
782
|
placeholder: l,
|
|
783
|
-
value:
|
|
784
|
-
onChange:
|
|
783
|
+
value: ae,
|
|
784
|
+
onChange: Y,
|
|
785
785
|
onClick: X,
|
|
786
|
-
onBlur:
|
|
786
|
+
onBlur: K,
|
|
787
787
|
onKeyDown: (e) => {
|
|
788
788
|
if (e.key === "ArrowDown") return se(e);
|
|
789
789
|
if (e.key === "ArrowUp") return ce(e);
|
|
@@ -794,14 +794,14 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
794
794
|
"aria-controls": A,
|
|
795
795
|
"aria-autocomplete": "list",
|
|
796
796
|
"aria-label": s,
|
|
797
|
-
"aria-labelledby":
|
|
798
|
-
"aria-activedescendant":
|
|
797
|
+
"aria-labelledby": He(a, k, s),
|
|
798
|
+
"aria-activedescendant": W,
|
|
799
799
|
"aria-invalid": !!c,
|
|
800
800
|
"aria-required": v || void 0,
|
|
801
801
|
"aria-describedby": Q(!!o && O, c && D),
|
|
802
802
|
className: e("w-full disabled:opacity-50 disabled:cursor-not-allowed", !g && [
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
ge,
|
|
804
|
+
U[f],
|
|
805
805
|
"pl-9 pr-8 py-2 text-sm"
|
|
806
806
|
], !g && c && e("border-red-500 dark:border-red-400", "focus:ring-red-500"), y)
|
|
807
807
|
}),
|
|
@@ -811,8 +811,8 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
811
811
|
onMouseDown: (e) => {
|
|
812
812
|
e.preventDefault();
|
|
813
813
|
},
|
|
814
|
-
onClick:
|
|
815
|
-
className: e("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 before:content-[''] before:absolute before:-inset-[4px]", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
814
|
+
onClick: oe,
|
|
815
|
+
className: e("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 before:content-[''] before:absolute before:-inset-[4px]", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", z.primary.focusOutline),
|
|
816
816
|
children: /* @__PURE__ */ n("span", {
|
|
817
817
|
className: "i-mdi-close block w-4 h-4",
|
|
818
818
|
"aria-hidden": !0
|
|
@@ -823,7 +823,7 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
823
823
|
"border",
|
|
824
824
|
"bg-white dark:bg-gray-900",
|
|
825
825
|
"border-gray-100 dark:border-gray-800",
|
|
826
|
-
|
|
826
|
+
U[f]
|
|
827
827
|
]),
|
|
828
828
|
children: [/* @__PURE__ */ n("ul", {
|
|
829
829
|
id: A,
|
|
@@ -831,19 +831,19 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
831
831
|
"aria-labelledby": a && !s ? k : void 0,
|
|
832
832
|
"aria-label": s,
|
|
833
833
|
className: e("max-h-60 overflow-auto py-1", "[scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] hover:[scrollbar-color:theme(colors.gray.400)_transparent] dark:[scrollbar-color:theme(colors.gray.600)_transparent] dark:hover:[scrollbar-color:theme(colors.gray.500)_transparent]"),
|
|
834
|
-
children:
|
|
834
|
+
children: H.map((t, r) => /* @__PURE__ */ n("li", {
|
|
835
835
|
id: `${A}-option-${r}`,
|
|
836
836
|
role: "option",
|
|
837
837
|
"aria-selected": t.value === M,
|
|
838
838
|
onMouseDown: (e) => e.preventDefault(),
|
|
839
|
-
onClick: () =>
|
|
840
|
-
className: e("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", r ===
|
|
839
|
+
onClick: () => q(t),
|
|
840
|
+
className: e("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", r === ee ? e("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : "hover:bg-gray-50 dark:hover:bg-gray-800/60", t.value === M && "font-medium"),
|
|
841
841
|
children: t.label
|
|
842
842
|
}, t.value))
|
|
843
843
|
}), /* @__PURE__ */ n("div", {
|
|
844
844
|
role: "status",
|
|
845
|
-
className:
|
|
846
|
-
children:
|
|
845
|
+
className: H.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
|
|
846
|
+
children: H.length === 0 ? u ?? T.noResults : ""
|
|
847
847
|
})]
|
|
848
848
|
})
|
|
849
849
|
]
|
|
@@ -851,53 +851,53 @@ function Ke({ options: t, filterOption: i = Ge, label: a, description: o, "aria-
|
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
853
|
// src/components/menu/find_typeahead_index.ts
|
|
854
|
-
var
|
|
855
|
-
function
|
|
854
|
+
var Je = -1;
|
|
855
|
+
function Ye(e, t, n) {
|
|
856
856
|
let r = n.toLowerCase(), i = e.length;
|
|
857
857
|
for (let n = 1; n <= i; n += 1) {
|
|
858
858
|
let a = (t + n + i) % i;
|
|
859
859
|
if (e[a]?.toLowerCase().startsWith(r)) return a;
|
|
860
860
|
}
|
|
861
|
-
return
|
|
861
|
+
return Je;
|
|
862
862
|
}
|
|
863
863
|
// src/components/menu/menu_context.ts
|
|
864
|
-
var
|
|
865
|
-
function
|
|
866
|
-
return c(
|
|
864
|
+
var Xe = a(null);
|
|
865
|
+
function Ze() {
|
|
866
|
+
return c(Xe);
|
|
867
867
|
}
|
|
868
868
|
// src/components/menu/menu_surface.tsx
|
|
869
|
-
var
|
|
870
|
-
function
|
|
871
|
-
return Array.from(e.querySelectorAll(
|
|
869
|
+
var Qe = ":not(:disabled):not([aria-disabled=\"true\"])", $e = `[role="menuitem"]${Qe}, [role="menuitemradio"]${Qe}`;
|
|
870
|
+
function et(e) {
|
|
871
|
+
return Array.from(e.querySelectorAll($e));
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
let n =
|
|
873
|
+
function tt(e, t) {
|
|
874
|
+
let n = et(e);
|
|
875
875
|
n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
if (e.key === "ArrowDown")
|
|
879
|
-
else if (e.key === "ArrowUp")
|
|
880
|
-
else if (e.key === "Home")
|
|
881
|
-
else if (e.key === "End")
|
|
877
|
+
function nt(e, t, n, r) {
|
|
878
|
+
if (e.key === "ArrowDown") tt(t, r + 1);
|
|
879
|
+
else if (e.key === "ArrowUp") tt(t, r - 1);
|
|
880
|
+
else if (e.key === "Home") tt(t, 0);
|
|
881
|
+
else if (e.key === "End") tt(t, n.length - 1);
|
|
882
882
|
else return !1;
|
|
883
883
|
return e.preventDefault(), !0;
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function rt(e) {
|
|
886
886
|
return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
let i =
|
|
890
|
-
i !== -1 &&
|
|
888
|
+
function it(e, t, n, r) {
|
|
889
|
+
let i = Ye(t.map((e) => e.textContent?.trim() ?? ""), n, r);
|
|
890
|
+
i !== -1 && tt(e, i);
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let b =
|
|
892
|
+
function at({ setFloating: i, floatingStyles: a, isVisible: o, isPositioned: s, radius: c, unstyled: u = !1, panelClassName: d, onClose: f, children: p, id: h, labelledBy: g, "aria-label": _, initialFocus: v = "first", portalTarget: y = document.body }) {
|
|
893
|
+
let b = m(null);
|
|
894
894
|
return l(() => {
|
|
895
895
|
if (!s) return;
|
|
896
896
|
let e = b.current;
|
|
897
897
|
if (!e) return;
|
|
898
|
-
let t =
|
|
898
|
+
let t = et(e);
|
|
899
899
|
(v === "last" ? t[t.length - 1] : t[0])?.focus({ preventScroll: !0 });
|
|
900
|
-
}, [s, v]),
|
|
900
|
+
}, [s, v]), S(/* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("div", {
|
|
901
901
|
className: "fixed inset-0 z-40",
|
|
902
902
|
onClick: f,
|
|
903
903
|
"aria-hidden": "true"
|
|
@@ -916,8 +916,8 @@ function it({ setFloating: i, floatingStyles: a, isVisible: o, isPositioned: s,
|
|
|
916
916
|
onKeyDown: (e) => {
|
|
917
917
|
let t = b.current;
|
|
918
918
|
if (!t) return;
|
|
919
|
-
let n =
|
|
920
|
-
|
|
919
|
+
let n = et(t), r = n.indexOf(document.activeElement);
|
|
920
|
+
nt(e, t, n, r) ? e.stopPropagation() : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), f()) : e.key === "Tab" ? f() : rt(e) && (e.stopPropagation(), it(t, n, r, e.key));
|
|
921
921
|
},
|
|
922
922
|
className: e("w-max", !u && [
|
|
923
923
|
"min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm",
|
|
@@ -925,24 +925,24 @@ function it({ setFloating: i, floatingStyles: a, isVisible: o, isPositioned: s,
|
|
|
925
925
|
o ? "scale-100 opacity-100" : "ms-menu-surface-closed",
|
|
926
926
|
"bg-white dark:bg-gray-900",
|
|
927
927
|
"border-gray-100 dark:border-gray-800",
|
|
928
|
-
|
|
928
|
+
U[c]
|
|
929
929
|
], d),
|
|
930
930
|
onClick: (e) => e.stopPropagation(),
|
|
931
|
-
children: /* @__PURE__ */ n(
|
|
931
|
+
children: /* @__PURE__ */ n(Xe.Provider, {
|
|
932
932
|
value: f,
|
|
933
|
-
children:
|
|
933
|
+
children: p
|
|
934
934
|
})
|
|
935
935
|
})
|
|
936
936
|
})] }), y);
|
|
937
937
|
}
|
|
938
938
|
// src/components/shared/dialog_portal_target.ts
|
|
939
|
-
var
|
|
940
|
-
function
|
|
941
|
-
return e?.closest(
|
|
939
|
+
var ot = "dialog, [role=dialog], [role=alertdialog]";
|
|
940
|
+
function st(e) {
|
|
941
|
+
return e?.closest(ot) ?? (e?.ownerDocument ?? document).body;
|
|
942
942
|
}
|
|
943
943
|
// src/components/shared/use_overlay_state.ts
|
|
944
|
-
function
|
|
945
|
-
let [e, t] =
|
|
944
|
+
function ct() {
|
|
945
|
+
let [e, t] = h(!1), [n, r] = h(!1), i = m(void 0);
|
|
946
946
|
return l(() => () => clearTimeout(i.current), []), {
|
|
947
947
|
isMounted: e,
|
|
948
948
|
isVisible: n,
|
|
@@ -955,7 +955,7 @@ function st() {
|
|
|
955
955
|
}, [])
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function lt(e, t, n) {
|
|
959
959
|
l(() => {
|
|
960
960
|
if (!e || !t) return;
|
|
961
961
|
let r = requestAnimationFrame(() => n(!0));
|
|
@@ -967,8 +967,8 @@ function ct(e, t, n) {
|
|
|
967
967
|
]);
|
|
968
968
|
}
|
|
969
969
|
// src/components/context_menu/context_menu.tsx
|
|
970
|
-
var
|
|
971
|
-
function
|
|
970
|
+
var ut = 2;
|
|
971
|
+
function dt(e, t) {
|
|
972
972
|
return { getBoundingClientRect: () => ({
|
|
973
973
|
width: 0,
|
|
974
974
|
height: 0,
|
|
@@ -980,7 +980,7 @@ function ut(e, t) {
|
|
|
980
980
|
bottom: t
|
|
981
981
|
}) };
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function ft(e) {
|
|
984
984
|
if (e.clientX !== 0 || e.clientY !== 0) return {
|
|
985
985
|
x: e.clientX,
|
|
986
986
|
y: e.clientY
|
|
@@ -994,31 +994,31 @@ function dt(e) {
|
|
|
994
994
|
y: 0
|
|
995
995
|
};
|
|
996
996
|
}
|
|
997
|
-
function
|
|
998
|
-
let d =
|
|
997
|
+
function pt({ children: e, items: t, radius: i = "md", unstyled: a = !1, panelClassName: o, className: c, ref: l, "aria-label": u }) {
|
|
998
|
+
let d = m(null), [f, p] = h(null), { isMounted: g, isVisible: S, setIsVisible: C, open: w, close: T } = ct(), { refs: E, floatingStyles: D, isPositioned: O } = x({
|
|
999
999
|
placement: "bottom-start",
|
|
1000
1000
|
strategy: "fixed",
|
|
1001
|
-
open:
|
|
1002
|
-
whileElementsMounted:
|
|
1001
|
+
open: g,
|
|
1002
|
+
whileElementsMounted: _,
|
|
1003
1003
|
middleware: [
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1004
|
+
y(ut),
|
|
1005
|
+
v(),
|
|
1006
|
+
b({ padding: 8 })
|
|
1007
1007
|
]
|
|
1008
1008
|
});
|
|
1009
|
-
|
|
1010
|
-
let k = s((e) =>
|
|
1009
|
+
lt(g, O, C);
|
|
1010
|
+
let k = s((e) => Me(p, l)(e), [l]), A = s(() => {
|
|
1011
1011
|
T(), d.current?.focus({ preventScroll: !0 });
|
|
1012
1012
|
}, [T]);
|
|
1013
1013
|
return /* @__PURE__ */ r("div", {
|
|
1014
1014
|
ref: k,
|
|
1015
1015
|
className: c,
|
|
1016
1016
|
onContextMenu: (e) => {
|
|
1017
|
-
e.preventDefault(),
|
|
1018
|
-
let { x: t, y: n } =
|
|
1019
|
-
E.setReference(
|
|
1017
|
+
e.preventDefault(), g || (d.current = document.activeElement);
|
|
1018
|
+
let { x: t, y: n } = ft(e);
|
|
1019
|
+
E.setReference(dt(t, n)), w(!1);
|
|
1020
1020
|
},
|
|
1021
|
-
children: [e,
|
|
1021
|
+
children: [e, g && /* @__PURE__ */ n(at, {
|
|
1022
1022
|
"aria-label": u,
|
|
1023
1023
|
setFloating: E.setFloating,
|
|
1024
1024
|
floatingStyles: D,
|
|
@@ -1028,62 +1028,62 @@ function ft({ children: e, items: t, radius: i = "md", unstyled: a = !1, panelCl
|
|
|
1028
1028
|
unstyled: a,
|
|
1029
1029
|
panelClassName: o,
|
|
1030
1030
|
onClose: A,
|
|
1031
|
-
portalTarget:
|
|
1031
|
+
portalTarget: st(f),
|
|
1032
1032
|
children: t
|
|
1033
1033
|
})]
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
1036
|
// src/components/shared/accessible_name.ts
|
|
1037
|
-
function
|
|
1037
|
+
function mt(e) {
|
|
1038
1038
|
return (e ?? "").replace(/\s+/g, " ").trim();
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function ht(e, t) {
|
|
1041
1041
|
return t.split(/\s+/).map((t) => e.ownerDocument.getElementById(t)?.textContent).join(" ");
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let t =
|
|
1043
|
+
function gt(e) {
|
|
1044
|
+
let t = mt(e.getAttribute("aria-label"));
|
|
1045
1045
|
if (t) return t;
|
|
1046
1046
|
let n = e.getAttribute("aria-labelledby");
|
|
1047
|
-
return (n ?
|
|
1047
|
+
return (n ? mt(ht(e, n)) : "") || mt(e.textContent);
|
|
1048
1048
|
}
|
|
1049
1049
|
// src/components/shared/portal_target.ts
|
|
1050
|
-
var
|
|
1051
|
-
function
|
|
1052
|
-
return e?.closest(
|
|
1050
|
+
var _t = "main, nav, aside, header, footer, form[aria-label], form[aria-labelledby], section[aria-label], section[aria-labelledby], [role=main], [role=navigation], [role=complementary], [role=banner], [role=contentinfo], [role=region], [role=search], [role=form], dialog, [role=dialog], [role=alertdialog]";
|
|
1051
|
+
function vt(e) {
|
|
1052
|
+
return e?.closest(_t) ?? (e?.ownerDocument ?? document).body;
|
|
1053
1053
|
}
|
|
1054
1054
|
// src/components/tooltip/tooltip.tsx
|
|
1055
|
-
var
|
|
1055
|
+
var yt = 8, bt = 8, xt = 100, St = {
|
|
1056
1056
|
top: "ms-tooltip-enter-top",
|
|
1057
1057
|
bottom: "ms-tooltip-enter-bottom",
|
|
1058
1058
|
left: "ms-tooltip-enter-left",
|
|
1059
1059
|
right: "ms-tooltip-enter-right"
|
|
1060
|
-
},
|
|
1060
|
+
}, Ct = {
|
|
1061
1061
|
top: "bottom",
|
|
1062
1062
|
bottom: "top",
|
|
1063
1063
|
left: "right",
|
|
1064
1064
|
right: "left"
|
|
1065
1065
|
};
|
|
1066
|
-
function
|
|
1067
|
-
let { isMounted: F, isVisible: I, setIsVisible: L, open: R, close: z } =
|
|
1068
|
-
placement:
|
|
1066
|
+
function wt({ content: a, children: c, position: u = "top", showOnClick: p = !1, temporaryContent: C, temporaryDuration: w = 2e3, disabled: T = !1, radius: E = "lg", unstyled: D = !1, panelClassName: O, onTemporaryShow: k, className: A, describeChild: j, hoverable: M = !1, portalContainer: N, ref: P }) {
|
|
1067
|
+
let { isMounted: F, isVisible: I, setIsVisible: L, open: R, close: z } = ct(), [B, V] = h(!1), H = d(), ee = m(null), [W, te] = h(null), [ne, re] = h(null), [ie, ae] = h(null), G = m(void 0), K = m(void 0), { refs: q, floatingStyles: J, placement: oe, middlewareData: Y, isPositioned: X } = x({
|
|
1068
|
+
placement: u,
|
|
1069
1069
|
strategy: "fixed",
|
|
1070
1070
|
open: F,
|
|
1071
|
-
whileElementsMounted:
|
|
1071
|
+
whileElementsMounted: _,
|
|
1072
1072
|
middleware: [
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1073
|
+
y(yt),
|
|
1074
|
+
v(),
|
|
1075
|
+
b({ padding: 8 }),
|
|
1076
|
+
g({ element: ee })
|
|
1077
1077
|
]
|
|
1078
|
-
}), se =
|
|
1079
|
-
|
|
1080
|
-
let ce = s((e) =>
|
|
1081
|
-
|
|
1082
|
-
let e =
|
|
1083
|
-
|
|
1078
|
+
}), se = oe.split("-")[0];
|
|
1079
|
+
lt(F, X, L);
|
|
1080
|
+
let ce = s((e) => Me(q.setReference, te, P)(e), [q, P]), le = s((e) => Me(q.setFloating, re)(e), [q]);
|
|
1081
|
+
f(() => {
|
|
1082
|
+
let e = W?.firstElementChild;
|
|
1083
|
+
ae(ne && e ? mt(ne.textContent) === gt(e) : null);
|
|
1084
1084
|
}, [
|
|
1085
|
-
|
|
1086
|
-
|
|
1085
|
+
W,
|
|
1086
|
+
ne,
|
|
1087
1087
|
a,
|
|
1088
1088
|
C,
|
|
1089
1089
|
B
|
|
@@ -1091,15 +1091,15 @@ function Ct({ content: a, children: c, position: f = "top", showOnClick: S = !1,
|
|
|
1091
1091
|
let ue = s(() => {
|
|
1092
1092
|
V(!1), z();
|
|
1093
1093
|
}, [z]), de = () => {
|
|
1094
|
-
!T && C && (V(!0), R(X), clearTimeout(
|
|
1094
|
+
!T && C && (V(!0), R(X), clearTimeout(G.current), G.current = setTimeout(ue, w), k?.());
|
|
1095
1095
|
}, fe = () => {
|
|
1096
1096
|
T || R(X);
|
|
1097
1097
|
}, Z = s(() => {
|
|
1098
|
-
clearTimeout(
|
|
1098
|
+
clearTimeout(G.current), clearTimeout(K.current), ue();
|
|
1099
1099
|
}, [ue]), pe = () => {
|
|
1100
|
-
clearTimeout(
|
|
1100
|
+
clearTimeout(K.current);
|
|
1101
1101
|
}, me = () => {
|
|
1102
|
-
clearTimeout(
|
|
1102
|
+
clearTimeout(K.current), K.current = setTimeout(Z, xt);
|
|
1103
1103
|
}, he = (e) => {
|
|
1104
1104
|
e.target.matches(":focus-visible") && fe();
|
|
1105
1105
|
}, ge = (e) => {
|
|
@@ -1110,7 +1110,7 @@ function Ct({ content: a, children: c, position: f = "top", showOnClick: S = !1,
|
|
|
1110
1110
|
e.pointerType !== "touch" && pe();
|
|
1111
1111
|
};
|
|
1112
1112
|
l(() => () => {
|
|
1113
|
-
clearTimeout(
|
|
1113
|
+
clearTimeout(G.current), clearTimeout(K.current);
|
|
1114
1114
|
}, []), l(() => {
|
|
1115
1115
|
if (!I || T) return;
|
|
1116
1116
|
let e = (e) => {
|
|
@@ -1124,10 +1124,10 @@ function Ct({ content: a, children: c, position: f = "top", showOnClick: S = !1,
|
|
|
1124
1124
|
]);
|
|
1125
1125
|
let ye = F && !T, be = B && C ? C : a, xe = {
|
|
1126
1126
|
onClick: (e) => {
|
|
1127
|
-
|
|
1127
|
+
p && C && de(), o(c) && c.props.onClick?.(e);
|
|
1128
1128
|
},
|
|
1129
|
-
"aria-describedby": Q(o(c) ? c.props["aria-describedby"] : void 0, ye && (j ?? (
|
|
1130
|
-
}, Se = o(c) ? i(c, xe) : c, Ce =
|
|
1129
|
+
"aria-describedby": Q(o(c) ? c.props["aria-describedby"] : void 0, ye && (j ?? (ie !== null && !ie)) && H)
|
|
1130
|
+
}, Se = o(c) ? i(c, xe) : c, Ce = Y.arrow?.x, we = Y.arrow?.y, Te = Ct[se];
|
|
1131
1131
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("span", {
|
|
1132
1132
|
ref: ce,
|
|
1133
1133
|
className: e("inline-flex", A),
|
|
@@ -1140,14 +1140,14 @@ function Ct({ content: a, children: c, position: f = "top", showOnClick: S = !1,
|
|
|
1140
1140
|
className: "sr-only",
|
|
1141
1141
|
children: B ? C : null
|
|
1142
1142
|
})]
|
|
1143
|
-
}), ye &&
|
|
1143
|
+
}), ye && S(/* @__PURE__ */ n("div", {
|
|
1144
1144
|
ref: le,
|
|
1145
|
-
style:
|
|
1145
|
+
style: J,
|
|
1146
1146
|
className: e("z-50 inline-block", !M && "pointer-events-none"),
|
|
1147
1147
|
onPointerEnter: M ? ve : void 0,
|
|
1148
1148
|
onPointerLeave: M ? _e : void 0,
|
|
1149
1149
|
children: /* @__PURE__ */ r("div", {
|
|
1150
|
-
id:
|
|
1150
|
+
id: H,
|
|
1151
1151
|
role: "tooltip",
|
|
1152
1152
|
"data-state": I ? "open" : "closed",
|
|
1153
1153
|
className: e("whitespace-nowrap", !D && [
|
|
@@ -1155,59 +1155,59 @@ function Ct({ content: a, children: c, position: f = "top", showOnClick: S = !1,
|
|
|
1155
1155
|
"text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg",
|
|
1156
1156
|
"transition-[opacity,transform] duration-150 ease-out",
|
|
1157
1157
|
I ? "opacity-100" : "opacity-0",
|
|
1158
|
-
|
|
1159
|
-
|
|
1158
|
+
St[se],
|
|
1159
|
+
U[E]
|
|
1160
1160
|
], O),
|
|
1161
1161
|
children: [be, !D && /* @__PURE__ */ n("div", {
|
|
1162
|
-
ref:
|
|
1162
|
+
ref: ee,
|
|
1163
1163
|
style: {
|
|
1164
1164
|
position: "absolute",
|
|
1165
|
-
width: `${
|
|
1166
|
-
height: `${
|
|
1165
|
+
width: `${bt}px`,
|
|
1166
|
+
height: `${bt}px`,
|
|
1167
1167
|
left: Ce === void 0 ? void 0 : `${Ce}px`,
|
|
1168
1168
|
top: we === void 0 ? void 0 : `${we}px`,
|
|
1169
|
-
[Te]: `-${
|
|
1169
|
+
[Te]: `-${bt / 2}px`
|
|
1170
1170
|
},
|
|
1171
1171
|
className: "rotate-45 bg-gray-900 dark:bg-gray-100"
|
|
1172
1172
|
})]
|
|
1173
1173
|
})
|
|
1174
|
-
}), N ??
|
|
1174
|
+
}), N ?? vt(W))] });
|
|
1175
1175
|
}
|
|
1176
1176
|
// src/components/icon_button/icon_button.tsx
|
|
1177
|
-
var
|
|
1177
|
+
var Tt = {
|
|
1178
1178
|
xs: "p-1",
|
|
1179
1179
|
sm: "p-2",
|
|
1180
1180
|
md: "p-2",
|
|
1181
1181
|
lg: "p-3"
|
|
1182
|
-
},
|
|
1182
|
+
}, Et = {
|
|
1183
1183
|
xs: "w-4 h-4",
|
|
1184
1184
|
sm: "w-4 h-4",
|
|
1185
1185
|
md: "w-5 h-5",
|
|
1186
1186
|
lg: "w-6 h-6"
|
|
1187
1187
|
};
|
|
1188
|
-
function
|
|
1188
|
+
function Dt(e) {
|
|
1189
1189
|
if (e) return e === !0 ? {} : typeof e == "string" ? { position: e } : e;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
let { icon: i, "aria-label": a, unstyled: o = !1, variant: s = "outline", color: c = "neutral", size: l = "md", radius: u = "md", className: d, children: f, tooltip: p, pressed: m, ref: h, ...g } = t, _ =
|
|
1191
|
+
function Ot(t) {
|
|
1192
|
+
let { icon: i, "aria-label": a, unstyled: o = !1, variant: s = "outline", color: c = "neutral", size: l = "md", radius: u = "md", className: d, children: f, tooltip: p, pressed: m, ref: h, ...g } = t, _ = z[c], v = Dt(p), y = /* @__PURE__ */ r("button", {
|
|
1193
1193
|
ref: h,
|
|
1194
1194
|
type: "button",
|
|
1195
1195
|
"aria-label": a,
|
|
1196
1196
|
"aria-pressed": m,
|
|
1197
|
-
className: e(
|
|
1198
|
-
|
|
1197
|
+
className: e(B, !o && [
|
|
1198
|
+
V,
|
|
1199
1199
|
"border",
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1200
|
+
U[u],
|
|
1201
|
+
Tt[l],
|
|
1202
|
+
H(c, s, m ?? !1),
|
|
1203
1203
|
_.focusOutline
|
|
1204
1204
|
], d),
|
|
1205
1205
|
...g,
|
|
1206
|
-
children: [/* @__PURE__ */ n("span", { className: e(i,
|
|
1206
|
+
children: [/* @__PURE__ */ n("span", { className: e(i, Et[l], f && "mr-1") }), f]
|
|
1207
1207
|
});
|
|
1208
1208
|
if (!v) return y;
|
|
1209
1209
|
let b = v.content !== void 0;
|
|
1210
|
-
return /* @__PURE__ */ n(
|
|
1210
|
+
return /* @__PURE__ */ n(wt, {
|
|
1211
1211
|
content: b ? v.content : a,
|
|
1212
1212
|
position: v.position,
|
|
1213
1213
|
describeChild: b ? void 0 : !1,
|
|
@@ -1215,32 +1215,32 @@ function Dt(t) {
|
|
|
1215
1215
|
});
|
|
1216
1216
|
}
|
|
1217
1217
|
// src/lib/surface_error.ts
|
|
1218
|
-
function
|
|
1218
|
+
function kt(e, t) {
|
|
1219
1219
|
t ? t(e) : queueMicrotask(() => {
|
|
1220
1220
|
throw e;
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
// src/components/copy_button/copy_button.tsx
|
|
1224
|
-
var
|
|
1225
|
-
function
|
|
1226
|
-
let s = J(), [c, u] =
|
|
1224
|
+
var At = 2e3, jt = 0;
|
|
1225
|
+
function Mt({ value: e, children: i, label: a, onError: o }) {
|
|
1226
|
+
let s = J(), [c, u] = h(!1), [d, f] = h(""), p = m(void 0), g = m(void 0);
|
|
1227
1227
|
l(() => () => {
|
|
1228
|
-
clearTimeout(
|
|
1228
|
+
clearTimeout(p.current), clearTimeout(g.current);
|
|
1229
1229
|
}, []);
|
|
1230
1230
|
let _ = () => {
|
|
1231
|
-
clearTimeout(g.current), f(""), g.current = setTimeout(() => f(s.copied),
|
|
1231
|
+
clearTimeout(g.current), f(""), g.current = setTimeout(() => f(s.copied), jt);
|
|
1232
1232
|
}, v = async () => {
|
|
1233
1233
|
try {
|
|
1234
|
-
await navigator.clipboard.writeText(e), u(!0), _(), clearTimeout(
|
|
1234
|
+
await navigator.clipboard.writeText(e), u(!0), _(), clearTimeout(p.current), p.current = setTimeout(() => {
|
|
1235
1235
|
u(!1), f("");
|
|
1236
|
-
},
|
|
1236
|
+
}, At);
|
|
1237
1237
|
} catch (e) {
|
|
1238
|
-
|
|
1238
|
+
kt(e, o);
|
|
1239
1239
|
}
|
|
1240
1240
|
}, y = i?.({
|
|
1241
1241
|
copied: c,
|
|
1242
1242
|
copy: v
|
|
1243
|
-
}) ?? (i ? null : /* @__PURE__ */ n(
|
|
1243
|
+
}) ?? (i ? null : /* @__PURE__ */ n(Ot, {
|
|
1244
1244
|
icon: c ? "i-mdi-check" : "i-mdi-content-copy",
|
|
1245
1245
|
"aria-label": a ?? s.copy ?? "Copy",
|
|
1246
1246
|
onClick: () => void v()
|
|
@@ -1252,7 +1252,7 @@ function jt({ value: e, children: i, label: a, onError: o }) {
|
|
|
1252
1252
|
})] });
|
|
1253
1253
|
}
|
|
1254
1254
|
// src/lib/split_into_highlight_segments.ts
|
|
1255
|
-
function
|
|
1255
|
+
function Nt(e, t) {
|
|
1256
1256
|
if (t.length === 0) return [{
|
|
1257
1257
|
text: e,
|
|
1258
1258
|
isMatch: !1
|
|
@@ -1274,8 +1274,8 @@ function Mt(e, t) {
|
|
|
1274
1274
|
}), n;
|
|
1275
1275
|
}
|
|
1276
1276
|
// src/components/highlight/highlight.tsx
|
|
1277
|
-
var
|
|
1278
|
-
function
|
|
1277
|
+
var Pt = "bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100";
|
|
1278
|
+
function Ft(e) {
|
|
1279
1279
|
let t = 0;
|
|
1280
1280
|
return e.map((e) => {
|
|
1281
1281
|
let n = t;
|
|
@@ -1285,25 +1285,25 @@ function Pt(e) {
|
|
|
1285
1285
|
};
|
|
1286
1286
|
});
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let c =
|
|
1288
|
+
function It({ text: r, ranges: i, radius: a = "sm", unstyled: o = !1, markClassName: s }) {
|
|
1289
|
+
let c = Ft(Nt(r, i));
|
|
1290
1290
|
return /* @__PURE__ */ n(t, { children: c.map((t) => t.isMatch ? /* @__PURE__ */ n("mark", {
|
|
1291
|
-
className: e(!o && [
|
|
1291
|
+
className: e(!o && [U[a], Pt], s),
|
|
1292
1292
|
children: t.text
|
|
1293
1293
|
}, t.start) : /* @__PURE__ */ n("span", { children: t.text }, t.start)) });
|
|
1294
1294
|
}
|
|
1295
1295
|
// src/components/drawer/drawer_styles.ts
|
|
1296
|
-
var
|
|
1296
|
+
var Lt = {
|
|
1297
1297
|
sm: "ms-drawer-width-sm",
|
|
1298
1298
|
md: "ms-drawer-width-md",
|
|
1299
1299
|
lg: "ms-drawer-width-lg"
|
|
1300
|
-
},
|
|
1300
|
+
}, Rt = {
|
|
1301
1301
|
right: "right-0",
|
|
1302
1302
|
left: "left-0"
|
|
1303
|
-
},
|
|
1303
|
+
}, zt = {
|
|
1304
1304
|
right: "ms-drawer-offscreen-right",
|
|
1305
1305
|
left: "ms-drawer-offscreen-left"
|
|
1306
|
-
},
|
|
1306
|
+
}, Bt = {
|
|
1307
1307
|
right: {
|
|
1308
1308
|
none: "rounded-l-none",
|
|
1309
1309
|
sm: "rounded-l-sm",
|
|
@@ -1320,9 +1320,9 @@ var It = {
|
|
|
1320
1320
|
xl: "rounded-r-xl",
|
|
1321
1321
|
full: "rounded-r-lg"
|
|
1322
1322
|
}
|
|
1323
|
-
},
|
|
1323
|
+
}, Vt = a(null);
|
|
1324
1324
|
// src/components/modal/modal_footer_slot.tsx
|
|
1325
|
-
function
|
|
1325
|
+
function Ht({ onSlotChange: t, children: r, unstyled: i = !1 }) {
|
|
1326
1326
|
return /* @__PURE__ */ n("div", {
|
|
1327
1327
|
ref: t,
|
|
1328
1328
|
className: e("flex items-center justify-end flex-shrink-0 empty:hidden", !i && ["gap-3 px-6 py-4 border-t", "border-gray-100 dark:border-gray-800"]),
|
|
@@ -1330,9 +1330,9 @@ function Vt({ onSlotChange: t, children: r, unstyled: i = !1 }) {
|
|
|
1330
1330
|
});
|
|
1331
1331
|
}
|
|
1332
1332
|
// src/components/modal/modal_footer_slot_context.ts
|
|
1333
|
-
var
|
|
1333
|
+
var Ut = a(null);
|
|
1334
1334
|
// src/components/modal/modal_header.tsx
|
|
1335
|
-
function
|
|
1335
|
+
function Wt({ titleId: t, title: i, onDismiss: a, dismissible: o, closeLabel: s, unstyled: c = !1 }) {
|
|
1336
1336
|
let l = J(), u = s ?? l.close;
|
|
1337
1337
|
return /* @__PURE__ */ r("div", {
|
|
1338
1338
|
className: e("flex items-center justify-between flex-shrink-0", !c && "gap-4 px-6 pt-5 pb-4"),
|
|
@@ -1342,14 +1342,14 @@ function Ut({ titleId: t, title: i, onDismiss: a, dismissible: o, closeLabel: s,
|
|
|
1342
1342
|
className: e(!c && "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100"),
|
|
1343
1343
|
children: i
|
|
1344
1344
|
}),
|
|
1345
|
-
o && c && /* @__PURE__ */ n(
|
|
1345
|
+
o && c && /* @__PURE__ */ n(Ot, {
|
|
1346
1346
|
icon: "i-mdi-close",
|
|
1347
1347
|
onClick: a,
|
|
1348
1348
|
"aria-label": u,
|
|
1349
1349
|
className: "min-h-6 min-w-6",
|
|
1350
1350
|
unstyled: !0
|
|
1351
1351
|
}),
|
|
1352
|
-
o && !c && /* @__PURE__ */ n(
|
|
1352
|
+
o && !c && /* @__PURE__ */ n(Ot, {
|
|
1353
1353
|
icon: "i-mdi-close",
|
|
1354
1354
|
onClick: a,
|
|
1355
1355
|
"aria-label": u,
|
|
@@ -1362,25 +1362,25 @@ function Ut({ titleId: t, title: i, onDismiss: a, dismissible: o, closeLabel: s,
|
|
|
1362
1362
|
});
|
|
1363
1363
|
}
|
|
1364
1364
|
// src/components/modal/use_guarded_dismiss.ts
|
|
1365
|
-
function
|
|
1365
|
+
function Gt(e) {
|
|
1366
1366
|
try {
|
|
1367
1367
|
return e();
|
|
1368
1368
|
} catch (e) {
|
|
1369
|
-
return
|
|
1369
|
+
return kt(e), null;
|
|
1370
1370
|
}
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let n =
|
|
1374
|
-
|
|
1372
|
+
function Kt({ onDismiss: e, isEnded: t }) {
|
|
1373
|
+
let n = m(e), r = m(t), i = m([]), a = m(!1);
|
|
1374
|
+
f(() => {
|
|
1375
1375
|
n.current = e, r.current = t;
|
|
1376
1376
|
});
|
|
1377
|
-
let [o] =
|
|
1377
|
+
let [o] = h(() => ({ register: (e) => (i.current = [...i.current, e], () => {
|
|
1378
1378
|
i.current = i.current.filter((t) => t !== e);
|
|
1379
1379
|
}) })), c = s((e) => {
|
|
1380
1380
|
a.current = !0, e.then((e) => {
|
|
1381
1381
|
a.current = !1, e && !r.current && n.current();
|
|
1382
1382
|
}, (e) => {
|
|
1383
|
-
a.current = !1,
|
|
1383
|
+
a.current = !1, kt(e);
|
|
1384
1384
|
});
|
|
1385
1385
|
}, []);
|
|
1386
1386
|
return {
|
|
@@ -1391,36 +1391,36 @@ function Gt({ onDismiss: e, isEnded: t }) {
|
|
|
1391
1391
|
n.current();
|
|
1392
1392
|
return;
|
|
1393
1393
|
}
|
|
1394
|
-
let t =
|
|
1394
|
+
let t = Gt(e.current);
|
|
1395
1395
|
t !== null && (typeof t == "boolean" ? t && n.current() : c(t));
|
|
1396
1396
|
}, [c]),
|
|
1397
1397
|
registry: o
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
// src/components/modal/keyboard_scroll_region_attribute.ts
|
|
1401
|
-
var
|
|
1402
|
-
function Jt(e) {
|
|
1403
|
-
return e.matches(":disabled");
|
|
1404
|
-
}
|
|
1401
|
+
var qt = "data-keyboard-scroll-region", Jt = "a[href], button, input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]";
|
|
1405
1402
|
function Yt(e) {
|
|
1406
|
-
return e.
|
|
1403
|
+
return e.matches(":disabled");
|
|
1407
1404
|
}
|
|
1408
1405
|
function Xt(e) {
|
|
1409
|
-
return e.
|
|
1406
|
+
return e.getAttribute("tabindex") === "-1";
|
|
1410
1407
|
}
|
|
1411
1408
|
function Zt(e) {
|
|
1412
|
-
return e.
|
|
1409
|
+
return e.matches("input[type=\"hidden\"]");
|
|
1413
1410
|
}
|
|
1414
1411
|
function Qt(e) {
|
|
1415
|
-
return
|
|
1412
|
+
return e.closest("[inert]") !== null;
|
|
1416
1413
|
}
|
|
1417
1414
|
function $t(e) {
|
|
1418
|
-
return
|
|
1415
|
+
return typeof e.checkVisibility != "function" || e.checkVisibility();
|
|
1419
1416
|
}
|
|
1420
1417
|
function en(e) {
|
|
1421
|
-
return e
|
|
1418
|
+
return !Yt(e) && !Xt(e) && !Zt(e) && !Qt(e) && $t(e);
|
|
1422
1419
|
}
|
|
1423
1420
|
function tn(e) {
|
|
1421
|
+
return e instanceof HTMLInputElement && e.type === "radio" && e.name !== "";
|
|
1422
|
+
}
|
|
1423
|
+
function nn(e) {
|
|
1424
1424
|
let t = /* @__PURE__ */ new Map();
|
|
1425
1425
|
for (let n of e) {
|
|
1426
1426
|
let e = t.get(n.form) ?? /* @__PURE__ */ new Map();
|
|
@@ -1430,24 +1430,24 @@ function tn(e) {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
return Array.from(t.values()).flatMap((e) => Array.from(e.values()));
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function rn(e) {
|
|
1434
1434
|
return e.find((e) => e.checked) ?? e[0];
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
let t = Array.from(e.querySelectorAll(
|
|
1438
|
-
return t.filter((e) => !
|
|
1436
|
+
function an(e) {
|
|
1437
|
+
let t = Array.from(e.querySelectorAll(Jt)).filter(en), n = t.filter(tn), r = new Set(nn(n).map(rn));
|
|
1438
|
+
return t.filter((e) => !tn(e) || r.has(e));
|
|
1439
1439
|
}
|
|
1440
1440
|
// src/components/modal/use_keyboard_scrollable.ts
|
|
1441
|
-
var
|
|
1442
|
-
function
|
|
1443
|
-
return e.scrollHeight > e.clientHeight &&
|
|
1441
|
+
var on = {};
|
|
1442
|
+
function sn(e) {
|
|
1443
|
+
return e.scrollHeight > e.clientHeight && an(e).length === 0;
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
let [r, i] =
|
|
1445
|
+
function cn(e, { labelledBy: t, label: n }) {
|
|
1446
|
+
let [r, i] = h(!1);
|
|
1447
1447
|
return l(() => {
|
|
1448
1448
|
let t = e.current;
|
|
1449
1449
|
if (!t) return;
|
|
1450
|
-
let n = () => i(
|
|
1450
|
+
let n = () => i(sn(t));
|
|
1451
1451
|
n();
|
|
1452
1452
|
let r = new MutationObserver(n);
|
|
1453
1453
|
r.observe(t, {
|
|
@@ -1458,77 +1458,84 @@ function sn(e, { labelledBy: t, label: n }) {
|
|
|
1458
1458
|
return a?.observe(t), () => {
|
|
1459
1459
|
r.disconnect(), a?.disconnect();
|
|
1460
1460
|
};
|
|
1461
|
-
}, [e]), !r || !(t || n) ?
|
|
1461
|
+
}, [e]), !r || !(t || n) ? on : {
|
|
1462
1462
|
tabIndex: 0,
|
|
1463
1463
|
role: "region",
|
|
1464
|
-
[
|
|
1464
|
+
[qt]: !0,
|
|
1465
1465
|
"aria-labelledby": t,
|
|
1466
1466
|
"aria-label": t ? void 0 : n,
|
|
1467
|
-
focusClassName:
|
|
1467
|
+
focusClassName: R
|
|
1468
1468
|
};
|
|
1469
1469
|
}
|
|
1470
1470
|
// src/components/modal/body_scroll_lock.ts
|
|
1471
|
-
var
|
|
1472
|
-
function
|
|
1471
|
+
var ln = "--scrollbar-compensation", un = 0, dn;
|
|
1472
|
+
function fn() {
|
|
1473
1473
|
let { style: e } = document.documentElement;
|
|
1474
1474
|
return {
|
|
1475
1475
|
overflow: e.overflow,
|
|
1476
1476
|
overflowX: e.overflowX,
|
|
1477
1477
|
overflowY: e.overflowY,
|
|
1478
1478
|
paddingRight: e.paddingRight,
|
|
1479
|
-
scrollbarCompensation: e.getPropertyValue(
|
|
1479
|
+
scrollbarCompensation: e.getPropertyValue(ln)
|
|
1480
1480
|
};
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function pn(e) {
|
|
1483
1483
|
let { style: t } = document.documentElement;
|
|
1484
|
-
t.overflow = e.overflow, t.overflowX = e.overflowX, t.overflowY = e.overflowY, t.paddingRight = e.paddingRight, e.scrollbarCompensation === "" ? t.removeProperty(
|
|
1484
|
+
t.overflow = e.overflow, t.overflowX = e.overflowX, t.overflowY = e.overflowY, t.paddingRight = e.paddingRight, e.scrollbarCompensation === "" ? t.removeProperty(ln) : t.setProperty(ln, e.scrollbarCompensation);
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function mn(e, t) {
|
|
1487
1487
|
let { style: n } = document.documentElement;
|
|
1488
|
-
n.paddingRight = `${t + e}px`, n.setProperty(
|
|
1488
|
+
n.paddingRight = `${t + e}px`, n.setProperty(ln, `${e}px`);
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1491
|
-
if (
|
|
1490
|
+
function hn() {
|
|
1491
|
+
if (un === 0) {
|
|
1492
1492
|
let e = document.documentElement;
|
|
1493
|
-
|
|
1493
|
+
dn = fn();
|
|
1494
1494
|
let t = Number.parseFloat(getComputedStyle(e).paddingRight) || 0, n = e.clientWidth;
|
|
1495
1495
|
e.style.overflow = "hidden";
|
|
1496
1496
|
let r = e.clientWidth - n;
|
|
1497
|
-
r > 0 &&
|
|
1497
|
+
r > 0 && mn(r, t);
|
|
1498
1498
|
}
|
|
1499
|
-
|
|
1500
|
-
}
|
|
1501
|
-
function hn() {
|
|
1502
|
-
--ln, ln === 0 && un && (fn(un), un = void 0);
|
|
1499
|
+
un += 1;
|
|
1503
1500
|
}
|
|
1504
1501
|
function gn() {
|
|
1505
|
-
|
|
1502
|
+
--un, un === 0 && dn && (pn(dn), dn = void 0);
|
|
1503
|
+
}
|
|
1504
|
+
function _n() {
|
|
1505
|
+
l(() => (hn(), gn), []);
|
|
1506
1506
|
}
|
|
1507
1507
|
// src/components/modal/modal_stack.ts
|
|
1508
|
-
var
|
|
1509
|
-
function
|
|
1510
|
-
return
|
|
1511
|
-
|
|
1512
|
-
|
|
1508
|
+
var vn = [];
|
|
1509
|
+
function yn(e, t) {
|
|
1510
|
+
return vn.push({
|
|
1511
|
+
token: e,
|
|
1512
|
+
requestDismiss: t
|
|
1513
|
+
}), () => {
|
|
1514
|
+
let t = vn.findIndex((t) => t.token === e);
|
|
1515
|
+
t !== -1 && vn.splice(t, 1);
|
|
1513
1516
|
};
|
|
1514
1517
|
}
|
|
1515
|
-
function yn(e) {
|
|
1516
|
-
return _n[_n.length - 1] === e;
|
|
1517
|
-
}
|
|
1518
|
-
// src/components/modal/use_modal_dialog.ts
|
|
1519
1518
|
function bn(e) {
|
|
1520
|
-
return
|
|
1519
|
+
return vn.at(-1)?.token === e;
|
|
1521
1520
|
}
|
|
1522
|
-
function xn(
|
|
1523
|
-
let
|
|
1524
|
-
return
|
|
1521
|
+
function xn() {
|
|
1522
|
+
let e = vn.at(-1);
|
|
1523
|
+
return e ? (e.requestDismiss(), !0) : !1;
|
|
1525
1524
|
}
|
|
1525
|
+
// src/components/modal/use_modal_dialog.ts
|
|
1526
1526
|
function Sn(e) {
|
|
1527
|
-
|
|
1527
|
+
return an(e).filter((e) => !e.hasAttribute(qt));
|
|
1528
|
+
}
|
|
1529
|
+
function Cn({ dialog: e, content: t, fallbackScope: n }) {
|
|
1530
|
+
let r = t ? Sn(t)[0] : void 0;
|
|
1531
|
+
return r || n === "content" ? r : e ? Sn(e)[0] : void 0;
|
|
1532
|
+
}
|
|
1533
|
+
function wn(e) {
|
|
1534
|
+
let t = Cn(e);
|
|
1528
1535
|
(e.initialFocusRef?.current ?? t ?? e.dialog)?.focus();
|
|
1529
1536
|
}
|
|
1530
|
-
function
|
|
1531
|
-
let n =
|
|
1537
|
+
function Tn(e, t) {
|
|
1538
|
+
let n = an(t);
|
|
1532
1539
|
if (n.length === 0) {
|
|
1533
1540
|
e.preventDefault(), t.focus();
|
|
1534
1541
|
return;
|
|
@@ -1536,11 +1543,11 @@ function Cn(e, t) {
|
|
|
1536
1543
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
1537
1544
|
(a instanceof HTMLElement ? n.indexOf(a) : -1) === -1 ? (e.preventDefault(), (e.shiftKey ? i : r).focus()) : e.shiftKey && a === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
1538
1545
|
}
|
|
1539
|
-
function
|
|
1546
|
+
function En() {
|
|
1540
1547
|
return typeof document > "u" ? null : document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
1541
1548
|
}
|
|
1542
|
-
function
|
|
1543
|
-
let [e, t] =
|
|
1549
|
+
function Dn() {
|
|
1550
|
+
let [e, t] = h(!1);
|
|
1544
1551
|
return l(() => {
|
|
1545
1552
|
let e = requestAnimationFrame(() => {
|
|
1546
1553
|
requestAnimationFrame(() => t(!0));
|
|
@@ -1548,56 +1555,56 @@ function Tn() {
|
|
|
1548
1555
|
return () => cancelAnimationFrame(e);
|
|
1549
1556
|
}, []), e;
|
|
1550
1557
|
}
|
|
1551
|
-
function
|
|
1558
|
+
function On(e, { isEnded: t, modalToken: n }) {
|
|
1552
1559
|
l(() => {
|
|
1553
1560
|
if (t) return;
|
|
1554
|
-
let
|
|
1555
|
-
if (
|
|
1561
|
+
let r = (t) => {
|
|
1562
|
+
if (bn(n)) {
|
|
1556
1563
|
if (t.key === "Escape") {
|
|
1557
1564
|
if (t.defaultPrevented) return;
|
|
1558
|
-
t.preventDefault(),
|
|
1559
|
-
} else t.key === "Tab" && e.current &&
|
|
1565
|
+
t.preventDefault(), xn();
|
|
1566
|
+
} else t.key === "Tab" && e.current && Tn(t, e.current);
|
|
1560
1567
|
}
|
|
1561
1568
|
};
|
|
1562
|
-
return document.addEventListener("keydown",
|
|
1569
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
1563
1570
|
}, [
|
|
1564
1571
|
t,
|
|
1565
1572
|
n,
|
|
1566
|
-
r,
|
|
1567
|
-
i,
|
|
1568
1573
|
e
|
|
1569
1574
|
]);
|
|
1570
1575
|
}
|
|
1571
|
-
function
|
|
1572
|
-
let [o] =
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1576
|
+
function kn({ isEnded: e, onDismiss: t, dismissible: n, initialFocusRef: r, initialFocusFallbackScope: i = "dialog", getFocusFallback: a }) {
|
|
1577
|
+
let [o] = h(() => Symbol("modal")), [s, c] = h(null), u = m(null), d = m(null), [p] = h(En), g = m(() => {});
|
|
1578
|
+
f(() => {
|
|
1579
|
+
g.current = () => {
|
|
1580
|
+
n && t();
|
|
1581
|
+
};
|
|
1582
|
+
}), l(() => {
|
|
1583
|
+
if (!e) return yn(o, () => g.current());
|
|
1584
|
+
}, [e, o]), _n();
|
|
1585
|
+
let _ = Dn();
|
|
1577
1586
|
return l(() => {
|
|
1578
|
-
s && !e &&
|
|
1587
|
+
s && !e && wn({
|
|
1579
1588
|
dialog: u.current,
|
|
1580
1589
|
content: d.current,
|
|
1581
1590
|
initialFocusRef: r,
|
|
1582
1591
|
fallbackScope: i
|
|
1583
1592
|
});
|
|
1584
1593
|
}, [s, e]), l(() => {
|
|
1585
|
-
e && (
|
|
1594
|
+
e && (p?.isConnected ? p : a?.())?.focus({ preventScroll: !0 });
|
|
1586
1595
|
}, [
|
|
1587
1596
|
e,
|
|
1588
|
-
|
|
1597
|
+
p,
|
|
1589
1598
|
a
|
|
1590
|
-
]),
|
|
1599
|
+
]), On(u, {
|
|
1591
1600
|
isEnded: e,
|
|
1592
|
-
onDismiss: t,
|
|
1593
|
-
dismissible: n,
|
|
1594
1601
|
modalToken: o
|
|
1595
1602
|
}), {
|
|
1596
1603
|
dialogRef: u,
|
|
1597
1604
|
contentRef: d,
|
|
1598
1605
|
footerSlot: s,
|
|
1599
1606
|
setFooterSlot: c,
|
|
1600
|
-
isVisible:
|
|
1607
|
+
isVisible: _ && !e,
|
|
1601
1608
|
handleBackdropClick: () => {
|
|
1602
1609
|
!e && n && t();
|
|
1603
1610
|
},
|
|
@@ -1608,36 +1615,36 @@ function Dn({ isEnded: e, onDismiss: t, dismissible: n, initialFocusRef: r, init
|
|
|
1608
1615
|
};
|
|
1609
1616
|
}
|
|
1610
1617
|
// src/stores/global_hotkeys_store/global_hotkeys_store.ts
|
|
1611
|
-
var
|
|
1618
|
+
var An = C((e) => ({
|
|
1612
1619
|
globalHotkeysEnabled: !0,
|
|
1613
1620
|
setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
|
|
1614
|
-
})),
|
|
1615
|
-
function
|
|
1616
|
-
l(() => (
|
|
1617
|
-
--
|
|
1621
|
+
})), jn = 0;
|
|
1622
|
+
function Mn() {
|
|
1623
|
+
l(() => (jn += 1, jn === 1 && An.getState().setGlobalHotkeysEnabled(!1), () => {
|
|
1624
|
+
--jn, jn === 0 && An.getState().setGlobalHotkeysEnabled(!0);
|
|
1618
1625
|
}), []);
|
|
1619
1626
|
}
|
|
1620
1627
|
// src/components/drawer/drawer.tsx
|
|
1621
|
-
function
|
|
1628
|
+
function Nn() {
|
|
1622
1629
|
let e = document.querySelector("main");
|
|
1623
1630
|
return e && !e.hasAttribute("tabindex") && (e.tabIndex = -1), e;
|
|
1624
1631
|
}
|
|
1625
|
-
function
|
|
1626
|
-
|
|
1627
|
-
let y =
|
|
1632
|
+
function Pn({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size: c, side: l, radius: u, className: f, panelClassName: p, backdropClassName: m, unstyled: h = !1, dismissible: g, closeLabel: _, initialFocusRef: v }) {
|
|
1633
|
+
Mn();
|
|
1634
|
+
let y = d(), { dismiss: b, registry: x } = Kt({
|
|
1628
1635
|
onDismiss: i,
|
|
1629
1636
|
isEnded: t
|
|
1630
|
-
}), { dialogRef: C, contentRef: w, footerSlot: T, setFooterSlot: E, isVisible: D, handleBackdropClick: O, handleBackdropMouseDown: k } =
|
|
1637
|
+
}), { dialogRef: C, contentRef: w, footerSlot: T, setFooterSlot: E, isVisible: D, handleBackdropClick: O, handleBackdropMouseDown: k } = kn({
|
|
1631
1638
|
isEnded: t,
|
|
1632
1639
|
onDismiss: b,
|
|
1633
1640
|
dismissible: g,
|
|
1634
1641
|
initialFocusRef: v,
|
|
1635
1642
|
initialFocusFallbackScope: "content",
|
|
1636
|
-
getFocusFallback:
|
|
1637
|
-
}), { focusClassName: A, ...j } =
|
|
1638
|
-
return /* @__PURE__ */ n(
|
|
1639
|
-
value:
|
|
1640
|
-
children:
|
|
1643
|
+
getFocusFallback: Nn
|
|
1644
|
+
}), { focusClassName: A, ...j } = cn(w, { labelledBy: y });
|
|
1645
|
+
return /* @__PURE__ */ n(Vt.Provider, {
|
|
1646
|
+
value: x,
|
|
1647
|
+
children: S(/* @__PURE__ */ r("div", {
|
|
1641
1648
|
className: e("fixed inset-0 z-50", !h && "transition-opacity duration-200 ease-out", D ? "opacity-100" : "opacity-0"),
|
|
1642
1649
|
onClick: O,
|
|
1643
1650
|
onMouseDown: k,
|
|
@@ -1652,16 +1659,16 @@ function Mn({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
1652
1659
|
tabIndex: -1,
|
|
1653
1660
|
"data-state": D ? "open" : "closed",
|
|
1654
1661
|
inert: t,
|
|
1655
|
-
className: e("fixed inset-y-0 h-full flex flex-col overflow-hidden",
|
|
1662
|
+
className: e("fixed inset-y-0 h-full flex flex-col overflow-hidden", Rt[l], Lt[c], "focus:outline-none", !h && [
|
|
1656
1663
|
"bg-white dark:bg-gray-900",
|
|
1657
1664
|
"[&,&_*]:[scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] hover:[scrollbar-color:theme(colors.gray.400)_transparent] dark:[scrollbar-color:theme(colors.gray.600)_transparent] dark:hover:[scrollbar-color:theme(colors.gray.500)_transparent]",
|
|
1658
1665
|
"shadow-2xl",
|
|
1659
|
-
|
|
1666
|
+
Bt[l][u],
|
|
1660
1667
|
"ms-drawer-transition"
|
|
1661
|
-
], !D &&
|
|
1668
|
+
], !D && zt[l], p),
|
|
1662
1669
|
onClick: (e) => e.stopPropagation(),
|
|
1663
1670
|
children: [
|
|
1664
|
-
/* @__PURE__ */ n(
|
|
1671
|
+
/* @__PURE__ */ n(Wt, {
|
|
1665
1672
|
titleId: y,
|
|
1666
1673
|
title: a,
|
|
1667
1674
|
onDismiss: b,
|
|
@@ -1673,12 +1680,12 @@ function Mn({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
1673
1680
|
ref: w,
|
|
1674
1681
|
...j,
|
|
1675
1682
|
className: e("flex-1 overflow-y-auto min-h-0", !h && "px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400", A, f),
|
|
1676
|
-
children: /* @__PURE__ */ n(
|
|
1683
|
+
children: /* @__PURE__ */ n(Ut.Provider, {
|
|
1677
1684
|
value: T,
|
|
1678
1685
|
children: o
|
|
1679
1686
|
})
|
|
1680
1687
|
}),
|
|
1681
|
-
/* @__PURE__ */ n(
|
|
1688
|
+
/* @__PURE__ */ n(Ht, {
|
|
1682
1689
|
onSlotChange: E,
|
|
1683
1690
|
unstyled: h,
|
|
1684
1691
|
children: s
|
|
@@ -1688,17 +1695,19 @@ function Mn({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
1688
1695
|
}), document.body)
|
|
1689
1696
|
});
|
|
1690
1697
|
}
|
|
1691
|
-
function
|
|
1692
|
-
let [
|
|
1693
|
-
return e &&
|
|
1694
|
-
if (e) return;
|
|
1695
|
-
let t = setTimeout(() =>
|
|
1698
|
+
function Fn(e, t) {
|
|
1699
|
+
let [n, r] = h(!e), i = u(() => t?.());
|
|
1700
|
+
return e && n && r(!1), l(() => {
|
|
1701
|
+
if (e || n) return;
|
|
1702
|
+
let t = setTimeout(() => {
|
|
1703
|
+
r(!0), i();
|
|
1704
|
+
}, 200);
|
|
1696
1705
|
return () => clearTimeout(t);
|
|
1697
|
-
}, [e]), e || !
|
|
1706
|
+
}, [e, n]), e || !n;
|
|
1698
1707
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return
|
|
1701
|
-
...
|
|
1708
|
+
function In({ isOpen: e, onClose: t, size: r = "md", side: i = "right", radius: a = "none", dismissible: o = !0, onExited: s, ...c }) {
|
|
1709
|
+
return Fn(e, s) ? /* @__PURE__ */ n(Pn, {
|
|
1710
|
+
...c,
|
|
1702
1711
|
isEnded: !e,
|
|
1703
1712
|
onDismiss: t,
|
|
1704
1713
|
size: r,
|
|
@@ -1708,24 +1717,24 @@ function Pn({ isOpen: e, onClose: t, size: r = "md", side: i = "right", radius:
|
|
|
1708
1717
|
}) : null;
|
|
1709
1718
|
}
|
|
1710
1719
|
// src/components/shared/use_controlled_length.ts
|
|
1711
|
-
function
|
|
1720
|
+
function Ln(e) {
|
|
1712
1721
|
return typeof e == "string" ? e.length : 0;
|
|
1713
1722
|
}
|
|
1714
|
-
function
|
|
1715
|
-
let [n, r] =
|
|
1723
|
+
function Rn(e, t) {
|
|
1724
|
+
let [n, r] = h(Ln(t)), i = e !== void 0;
|
|
1716
1725
|
return {
|
|
1717
|
-
length: i ?
|
|
1726
|
+
length: i ? Ln(e) : n,
|
|
1718
1727
|
trackLength: (e) => {
|
|
1719
1728
|
i || r(e.length);
|
|
1720
1729
|
}
|
|
1721
1730
|
};
|
|
1722
1731
|
}
|
|
1723
1732
|
// src/components/input/input.tsx
|
|
1724
|
-
function
|
|
1725
|
-
let { fieldId: b, errorId: x, descriptionId: S, labelId: C, characterCountId: w } = $(g), { length: T, trackLength: E } =
|
|
1733
|
+
function zn({ label: t, description: i, error: a, showCharCount: o = !1, minLength: s, maxLength: c, radius: l = "md", unstyled: u = !1, className: d, wrapperClassName: f, value: p, defaultValue: m, onChange: h, id: g, "aria-describedby": _, "aria-label": v, ...y }) {
|
|
1734
|
+
let { fieldId: b, errorId: x, descriptionId: S, labelId: C, characterCountId: w } = $(g), { length: T, trackLength: E } = Rn(p, m), D = o && (s !== void 0 || c !== void 0), O = (e) => {
|
|
1726
1735
|
E(e.target.value), h?.(e);
|
|
1727
1736
|
};
|
|
1728
|
-
return /* @__PURE__ */ r(
|
|
1737
|
+
return /* @__PURE__ */ r(Ve, {
|
|
1729
1738
|
fieldId: b,
|
|
1730
1739
|
errorId: x,
|
|
1731
1740
|
descriptionId: S,
|
|
@@ -1737,8 +1746,8 @@ function Ln({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
1737
1746
|
children: [/* @__PURE__ */ n("input", {
|
|
1738
1747
|
id: b,
|
|
1739
1748
|
className: e("w-full disabled:opacity-50 disabled:cursor-not-allowed", !u && [
|
|
1740
|
-
|
|
1741
|
-
|
|
1749
|
+
ge,
|
|
1750
|
+
U[l],
|
|
1742
1751
|
"px-3 py-2 text-sm"
|
|
1743
1752
|
], !u && a && e("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
|
|
1744
1753
|
...p === void 0 ? { defaultValue: m } : { value: p },
|
|
@@ -1747,10 +1756,10 @@ function Ln({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
1747
1756
|
onChange: O,
|
|
1748
1757
|
"aria-invalid": !!a,
|
|
1749
1758
|
"aria-label": v,
|
|
1750
|
-
"aria-labelledby":
|
|
1759
|
+
"aria-labelledby": He(t, C, v),
|
|
1751
1760
|
"aria-describedby": Q(_, !!i && S, a && x, D && w),
|
|
1752
1761
|
...y
|
|
1753
|
-
}), D && /* @__PURE__ */ n(
|
|
1762
|
+
}), D && /* @__PURE__ */ n(pe, {
|
|
1754
1763
|
id: w,
|
|
1755
1764
|
current: T,
|
|
1756
1765
|
min: s,
|
|
@@ -1761,40 +1770,40 @@ function Ln({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
1761
1770
|
});
|
|
1762
1771
|
}
|
|
1763
1772
|
// src/components/kbd/kbd.tsx
|
|
1764
|
-
var
|
|
1773
|
+
var Bn = {
|
|
1765
1774
|
xs: "px-1.5 py-0.5 text-xs",
|
|
1766
1775
|
sm: "px-2 py-0.5 text-xs",
|
|
1767
1776
|
md: "px-2.5 py-1 text-sm",
|
|
1768
1777
|
lg: "px-3 py-1 text-base"
|
|
1769
|
-
},
|
|
1770
|
-
className: e("inline-flex items-center",
|
|
1778
|
+
}, Vn = ({ children: t, size: r = "sm", radius: i = "sm", unstyled: a = !1, className: o }) => /* @__PURE__ */ n("kbd", {
|
|
1779
|
+
className: e("inline-flex items-center", Bn[r], !a && [
|
|
1771
1780
|
"border font-semibold uppercase",
|
|
1772
1781
|
"text-gray-600 dark:text-gray-300",
|
|
1773
1782
|
"bg-gray-100 dark:bg-gray-700",
|
|
1774
1783
|
"border-gray-200 dark:border-gray-600",
|
|
1775
|
-
|
|
1784
|
+
U[i]
|
|
1776
1785
|
], o),
|
|
1777
1786
|
children: t
|
|
1778
|
-
}),
|
|
1779
|
-
function
|
|
1787
|
+
}), Hn = 4;
|
|
1788
|
+
function Un(e, t) {
|
|
1780
1789
|
return t === "center" ? e : `${e}-${t}`;
|
|
1781
1790
|
}
|
|
1782
|
-
function
|
|
1783
|
-
let T =
|
|
1784
|
-
placement:
|
|
1791
|
+
function Wn({ trigger: t, children: a, side: c = "bottom", align: u = "start", radius: f = "md", unstyled: p = !1, panelClassName: g, className: S, disabled: C = !1, ref: w }) {
|
|
1792
|
+
let T = m(null), [E, D] = h(null), [O, k] = h("first"), { isMounted: A, isVisible: j, setIsVisible: M, open: N, close: P } = ct(), { refs: F, floatingStyles: I, isPositioned: L } = x({
|
|
1793
|
+
placement: Un(c, u),
|
|
1785
1794
|
strategy: "fixed",
|
|
1786
1795
|
open: A,
|
|
1787
|
-
whileElementsMounted:
|
|
1796
|
+
whileElementsMounted: _,
|
|
1788
1797
|
middleware: [
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1798
|
+
y(Hn),
|
|
1799
|
+
v(),
|
|
1800
|
+
b({ padding: 8 })
|
|
1792
1801
|
]
|
|
1793
1802
|
});
|
|
1794
|
-
|
|
1795
|
-
let R =
|
|
1803
|
+
lt(A, L, M);
|
|
1804
|
+
let R = d(), z = (o(t) ? t.props.id : void 0) ?? R, B = `${z}-menu`, V = s(() => {
|
|
1796
1805
|
P(), T.current?.querySelector("button, [href], [tabindex]")?.focus({ preventScroll: !0 });
|
|
1797
|
-
}, [P]), H = s((e) =>
|
|
1806
|
+
}, [P]), H = s((e) => Me(F.setReference, T, D, w)(e), [F, w]);
|
|
1798
1807
|
l(() => {
|
|
1799
1808
|
C && A && P();
|
|
1800
1809
|
}, [
|
|
@@ -1813,11 +1822,11 @@ function Hn({ trigger: t, children: a, side: c = "bottom", align: d = "start", r
|
|
|
1813
1822
|
"aria-haspopup": "menu",
|
|
1814
1823
|
"aria-expanded": A,
|
|
1815
1824
|
"aria-controls": A ? B : void 0
|
|
1816
|
-
},
|
|
1825
|
+
}, ee = o(t) ? i(t, U) : t;
|
|
1817
1826
|
return /* @__PURE__ */ r("span", {
|
|
1818
1827
|
ref: H,
|
|
1819
1828
|
className: e("inline-flex", S),
|
|
1820
|
-
children: [
|
|
1829
|
+
children: [ee, A && /* @__PURE__ */ n(at, {
|
|
1821
1830
|
id: B,
|
|
1822
1831
|
labelledBy: z,
|
|
1823
1832
|
setFloating: F.setFloating,
|
|
@@ -1825,18 +1834,18 @@ function Hn({ trigger: t, children: a, side: c = "bottom", align: d = "start", r
|
|
|
1825
1834
|
isVisible: j,
|
|
1826
1835
|
isPositioned: L,
|
|
1827
1836
|
radius: f,
|
|
1828
|
-
unstyled:
|
|
1829
|
-
panelClassName:
|
|
1837
|
+
unstyled: p,
|
|
1838
|
+
panelClassName: g,
|
|
1830
1839
|
onClose: V,
|
|
1831
1840
|
initialFocus: O,
|
|
1832
|
-
portalTarget:
|
|
1841
|
+
portalTarget: st(E),
|
|
1833
1842
|
children: a
|
|
1834
1843
|
})]
|
|
1835
1844
|
});
|
|
1836
1845
|
}
|
|
1837
1846
|
// src/components/menu_group/menu_group.tsx
|
|
1838
|
-
function
|
|
1839
|
-
let c =
|
|
1847
|
+
function Gn({ label: t, children: i, unstyled: a = !1, className: o, wrapperClassName: s }) {
|
|
1848
|
+
let c = d();
|
|
1840
1849
|
return /* @__PURE__ */ r("div", {
|
|
1841
1850
|
role: "group",
|
|
1842
1851
|
"aria-labelledby": c,
|
|
@@ -1850,12 +1859,12 @@ function Un({ label: t, children: i, unstyled: a = !1, className: o, wrapperClas
|
|
|
1850
1859
|
});
|
|
1851
1860
|
}
|
|
1852
1861
|
// src/components/menu_item/menu_item_content.tsx
|
|
1853
|
-
var
|
|
1862
|
+
var Kn = ({ icon: i, danger: a = !1, unstyled: o = !1, children: s }) => /* @__PURE__ */ r(t, { children: [i && /* @__PURE__ */ n("span", {
|
|
1854
1863
|
className: e(i, "h-4 w-4 flex-shrink-0", !a && !o && "text-gray-500 dark:text-gray-400"),
|
|
1855
1864
|
"aria-hidden": "true"
|
|
1856
1865
|
}), s] });
|
|
1857
1866
|
// src/components/menu_item/menu_item_end.tsx
|
|
1858
|
-
function
|
|
1867
|
+
function qn({ trailing: t, selected: i, unstyled: a = !1 }) {
|
|
1859
1868
|
let o = i !== void 0;
|
|
1860
1869
|
return !t && !o ? null : /* @__PURE__ */ r("span", {
|
|
1861
1870
|
className: "ml-auto flex flex-shrink-0 items-center gap-2 pl-2",
|
|
@@ -1869,27 +1878,27 @@ function Gn({ trailing: t, selected: i, unstyled: a = !1 }) {
|
|
|
1869
1878
|
});
|
|
1870
1879
|
}
|
|
1871
1880
|
// src/components/menu_item/menu_item_styles.ts
|
|
1872
|
-
var
|
|
1881
|
+
var Jn = "flex w-full cursor-pointer items-center whitespace-nowrap text-left", Yn = "gap-2 px-3 py-2 text-sm transition-colors", Xn = {
|
|
1873
1882
|
default: "text-gray-900 dark:text-gray-100 focus-visible:bg-blue-50 dark:focus-visible:bg-blue-900/40",
|
|
1874
1883
|
danger: "text-red-700 dark:text-red-400 focus-visible:bg-red-50 dark:focus-visible:bg-red-950/40"
|
|
1875
1884
|
};
|
|
1876
|
-
function
|
|
1885
|
+
function Zn({ hoverClasses: t, stateClasses: n, danger: r, unstyled: i, radius: a, className: o }) {
|
|
1877
1886
|
let s = r ? "danger" : "default";
|
|
1878
|
-
return e(
|
|
1887
|
+
return e(Jn, !i && [
|
|
1879
1888
|
"outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400",
|
|
1880
|
-
|
|
1881
|
-
|
|
1889
|
+
Yn,
|
|
1890
|
+
Xn[s],
|
|
1882
1891
|
t[s],
|
|
1883
|
-
a &&
|
|
1892
|
+
a && U[a]
|
|
1884
1893
|
], n, o);
|
|
1885
1894
|
}
|
|
1886
1895
|
// src/components/menu_item/menu_item_button.tsx
|
|
1887
|
-
var
|
|
1896
|
+
var Qn = {
|
|
1888
1897
|
default: "hover:enabled:bg-gray-50 dark:hover:enabled:bg-gray-800/60",
|
|
1889
1898
|
danger: "hover:enabled:bg-red-50 dark:hover:enabled:bg-red-950/40"
|
|
1890
|
-
},
|
|
1891
|
-
function
|
|
1892
|
-
let p =
|
|
1899
|
+
}, $n = ["disabled:cursor-not-allowed disabled:opacity-50"];
|
|
1900
|
+
function er({ icon: e, trailing: t, onClick: i, selected: a, danger: o = !1, disabled: s = !1, children: c, radius: l, unstyled: u = !1, className: d, ref: f }) {
|
|
1901
|
+
let p = Ze();
|
|
1893
1902
|
return /* @__PURE__ */ r("button", {
|
|
1894
1903
|
ref: f,
|
|
1895
1904
|
type: "button",
|
|
@@ -1900,20 +1909,20 @@ function Qn({ icon: e, trailing: t, onClick: i, selected: a, danger: o = !1, dis
|
|
|
1900
1909
|
e.stopPropagation(), i(e), p?.();
|
|
1901
1910
|
},
|
|
1902
1911
|
disabled: s,
|
|
1903
|
-
className:
|
|
1904
|
-
hoverClasses:
|
|
1905
|
-
stateClasses:
|
|
1912
|
+
className: Zn({
|
|
1913
|
+
hoverClasses: Qn,
|
|
1914
|
+
stateClasses: $n,
|
|
1906
1915
|
danger: o,
|
|
1907
1916
|
unstyled: u,
|
|
1908
1917
|
radius: l,
|
|
1909
1918
|
className: d
|
|
1910
1919
|
}),
|
|
1911
|
-
children: [/* @__PURE__ */ n(
|
|
1920
|
+
children: [/* @__PURE__ */ n(Kn, {
|
|
1912
1921
|
icon: e,
|
|
1913
1922
|
danger: o,
|
|
1914
1923
|
unstyled: u,
|
|
1915
1924
|
children: c
|
|
1916
|
-
}), /* @__PURE__ */ n(
|
|
1925
|
+
}), /* @__PURE__ */ n(qn, {
|
|
1917
1926
|
trailing: t,
|
|
1918
1927
|
selected: a,
|
|
1919
1928
|
unstyled: u
|
|
@@ -1921,95 +1930,95 @@ function Qn({ icon: e, trailing: t, onClick: i, selected: a, danger: o = !1, dis
|
|
|
1921
1930
|
});
|
|
1922
1931
|
}
|
|
1923
1932
|
// src/components/menu_item/menu_item_link.tsx
|
|
1924
|
-
var
|
|
1933
|
+
var tr = "_blank", nr = "noopener noreferrer", rr = {
|
|
1925
1934
|
default: "hover:bg-gray-50 dark:hover:bg-gray-800/60",
|
|
1926
1935
|
danger: "hover:bg-red-50 dark:hover:bg-red-950/40"
|
|
1927
|
-
},
|
|
1928
|
-
function
|
|
1929
|
-
let m =
|
|
1936
|
+
}, ir = ["no-underline", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
|
|
1937
|
+
function ar({ icon: e, trailing: t, href: i, target: a, rel: o, danger: s = !1, disabled: c = !1, children: l, radius: u, unstyled: d = !1, className: f, ref: p }) {
|
|
1938
|
+
let m = Ze();
|
|
1930
1939
|
return /* @__PURE__ */ r("a", {
|
|
1931
1940
|
ref: p,
|
|
1932
1941
|
role: "menuitem",
|
|
1933
1942
|
tabIndex: -1,
|
|
1934
1943
|
href: c ? void 0 : i,
|
|
1935
1944
|
target: a,
|
|
1936
|
-
rel: o ?? (a ===
|
|
1945
|
+
rel: o ?? (a === tr ? nr : void 0),
|
|
1937
1946
|
"aria-disabled": c || void 0,
|
|
1938
1947
|
onClick: (e) => {
|
|
1939
1948
|
e.stopPropagation(), m?.();
|
|
1940
1949
|
},
|
|
1941
|
-
className:
|
|
1942
|
-
hoverClasses:
|
|
1943
|
-
stateClasses:
|
|
1950
|
+
className: Zn({
|
|
1951
|
+
hoverClasses: rr,
|
|
1952
|
+
stateClasses: ir,
|
|
1944
1953
|
danger: s,
|
|
1945
1954
|
unstyled: d,
|
|
1946
1955
|
radius: u,
|
|
1947
1956
|
className: f
|
|
1948
1957
|
}),
|
|
1949
|
-
children: [/* @__PURE__ */ n(
|
|
1958
|
+
children: [/* @__PURE__ */ n(Kn, {
|
|
1950
1959
|
icon: e,
|
|
1951
1960
|
danger: s,
|
|
1952
1961
|
unstyled: d,
|
|
1953
1962
|
children: l
|
|
1954
|
-
}), /* @__PURE__ */ n(
|
|
1963
|
+
}), /* @__PURE__ */ n(qn, {
|
|
1955
1964
|
trailing: t,
|
|
1956
1965
|
unstyled: d
|
|
1957
1966
|
})]
|
|
1958
1967
|
});
|
|
1959
1968
|
}
|
|
1960
1969
|
// src/components/menu_item/menu_item.tsx
|
|
1961
|
-
function
|
|
1962
|
-
return e.href === void 0 ? /* @__PURE__ */ n(
|
|
1970
|
+
function or(e) {
|
|
1971
|
+
return e.href === void 0 ? /* @__PURE__ */ n(er, { ...e }) : /* @__PURE__ */ n(ar, { ...e });
|
|
1963
1972
|
}
|
|
1964
1973
|
// src/components/menu_separator/menu_separator.tsx
|
|
1965
|
-
var
|
|
1974
|
+
var sr = ({ unstyled: t = !1, className: r }) => /* @__PURE__ */ n("hr", {
|
|
1966
1975
|
"aria-orientation": "horizontal",
|
|
1967
1976
|
className: e("w-full", !t && ["my-1 border-0 border-t", "border-gray-100 dark:border-gray-800"], r)
|
|
1968
|
-
}),
|
|
1977
|
+
}), cr = {
|
|
1969
1978
|
danger: "i-mdi-alert-circle",
|
|
1970
1979
|
primary: "i-mdi-help-circle",
|
|
1971
1980
|
success: "i-mdi-check-circle"
|
|
1972
|
-
},
|
|
1981
|
+
}, lr = {
|
|
1973
1982
|
danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
|
|
1974
1983
|
primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
|
|
1975
1984
|
success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
|
|
1976
1985
|
};
|
|
1977
|
-
function
|
|
1986
|
+
function ur({ title: t, color: i }) {
|
|
1978
1987
|
return /* @__PURE__ */ r("div", {
|
|
1979
1988
|
className: "flex items-center gap-3",
|
|
1980
1989
|
children: [/* @__PURE__ */ n("span", {
|
|
1981
|
-
className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-full",
|
|
1990
|
+
className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", lr[i]),
|
|
1982
1991
|
"aria-hidden": "true",
|
|
1983
|
-
children: /* @__PURE__ */ n("span", { className: e(
|
|
1992
|
+
children: /* @__PURE__ */ n("span", { className: e(cr[i], "h-5 w-5") })
|
|
1984
1993
|
}), t]
|
|
1985
1994
|
});
|
|
1986
1995
|
}
|
|
1987
1996
|
// src/components/modal/modal_shell.tsx
|
|
1988
|
-
var
|
|
1997
|
+
var dr = "a dialog needs an accessible name. Provide a non-empty `title` or `aria-label` prop.", fr = {
|
|
1989
1998
|
sm: "max-w-md",
|
|
1990
1999
|
md: "max-w-lg",
|
|
1991
2000
|
lg: "max-w-2xl",
|
|
1992
2001
|
xl: "max-w-4xl"
|
|
1993
|
-
},
|
|
2002
|
+
}, pr = {
|
|
1994
2003
|
auto: "",
|
|
1995
2004
|
fixed: "ms-modal-height-fixed"
|
|
1996
|
-
},
|
|
2005
|
+
}, mr = {
|
|
1997
2006
|
auto: "overflow-y-auto",
|
|
1998
2007
|
fixed: "overflow-hidden flex flex-col"
|
|
1999
2008
|
};
|
|
2000
|
-
function
|
|
2001
|
-
let
|
|
2009
|
+
function hr({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size: c = "md", height: l = "auto", radius: u = "xl", className: f, panelClassName: p, backdropClassName: m, unstyled: h = !1, dismissible: g = !0, closeLabel: _, role: v = "dialog", initialFocusRef: y, "aria-label": b }) {
|
|
2010
|
+
let x = d(), C = d(), { dialogRef: w, contentRef: T, footerSlot: E, setFooterSlot: D, isVisible: O, handleBackdropClick: k, handleBackdropMouseDown: A } = kn({
|
|
2002
2011
|
isEnded: t,
|
|
2003
2012
|
onDismiss: i,
|
|
2004
2013
|
dismissible: g,
|
|
2005
2014
|
initialFocusRef: y
|
|
2006
2015
|
});
|
|
2007
|
-
|
|
2008
|
-
let { focusClassName: j, ...M } =
|
|
2009
|
-
labelledBy: a ?
|
|
2016
|
+
je("Modal", !!a || !!b?.trim(), dr);
|
|
2017
|
+
let { focusClassName: j, ...M } = cn(T, {
|
|
2018
|
+
labelledBy: a ? x : void 0,
|
|
2010
2019
|
label: b
|
|
2011
2020
|
}), N = l === "auto", P = v === "alertdialog" && !!o;
|
|
2012
|
-
return
|
|
2021
|
+
return S(/* @__PURE__ */ r("div", {
|
|
2013
2022
|
className: e("fixed inset-0 z-50 flex items-start justify-center", "ms-modal-backdrop-padding", !h && "transition-opacity duration-200 ease-out", O ? "opacity-100" : "opacity-0"),
|
|
2014
2023
|
onClick: k,
|
|
2015
2024
|
onMouseDown: A,
|
|
@@ -2024,23 +2033,23 @@ function pr({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
2024
2033
|
ref: w,
|
|
2025
2034
|
role: v,
|
|
2026
2035
|
"aria-modal": "true",
|
|
2027
|
-
"aria-labelledby": a ?
|
|
2036
|
+
"aria-labelledby": a ? x : void 0,
|
|
2028
2037
|
"aria-label": a ? void 0 : b,
|
|
2029
2038
|
"aria-describedby": P ? C : void 0,
|
|
2030
2039
|
tabIndex: -1,
|
|
2031
2040
|
"data-state": O ? "open" : "closed",
|
|
2032
|
-
className: e("relative w-full",
|
|
2041
|
+
className: e("relative w-full", fr[c], pr[l], "ms-modal-max-height overflow-hidden flex flex-col", "focus:outline-none", !h && [
|
|
2033
2042
|
"bg-white dark:bg-gray-900",
|
|
2034
2043
|
"[&,&_*]:[scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] hover:[scrollbar-color:theme(colors.gray.400)_transparent] dark:[scrollbar-color:theme(colors.gray.600)_transparent] dark:hover:[scrollbar-color:theme(colors.gray.500)_transparent]",
|
|
2035
2044
|
"shadow-2xl",
|
|
2036
|
-
|
|
2045
|
+
U[u],
|
|
2037
2046
|
"transition-all duration-200 ease-out",
|
|
2038
2047
|
O ? "opacity-100" : "ms-modal-panel-closed"
|
|
2039
2048
|
], p),
|
|
2040
2049
|
onClick: (e) => e.stopPropagation(),
|
|
2041
2050
|
children: [
|
|
2042
|
-
a && /* @__PURE__ */ n(
|
|
2043
|
-
titleId:
|
|
2051
|
+
a && /* @__PURE__ */ n(Wt, {
|
|
2052
|
+
titleId: x,
|
|
2044
2053
|
title: a,
|
|
2045
2054
|
onDismiss: i,
|
|
2046
2055
|
dismissible: g,
|
|
@@ -2051,13 +2060,13 @@ function pr({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
2051
2060
|
ref: T,
|
|
2052
2061
|
id: P ? C : void 0,
|
|
2053
2062
|
...N ? M : void 0,
|
|
2054
|
-
className: e("flex-1 min-h-0", !h && "px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400",
|
|
2055
|
-
children: /* @__PURE__ */ n(
|
|
2063
|
+
className: e("flex-1 min-h-0", !h && "px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400", mr[l], !h && !a && "pt-6", N && j, f),
|
|
2064
|
+
children: /* @__PURE__ */ n(Ut.Provider, {
|
|
2056
2065
|
value: E,
|
|
2057
2066
|
children: o
|
|
2058
2067
|
})
|
|
2059
2068
|
}),
|
|
2060
|
-
/* @__PURE__ */ n(
|
|
2069
|
+
/* @__PURE__ */ n(Ht, {
|
|
2061
2070
|
onSlotChange: D,
|
|
2062
2071
|
unstyled: h,
|
|
2063
2072
|
children: s
|
|
@@ -2067,23 +2076,23 @@ function pr({ isEnded: t, onDismiss: i, title: a, children: o, footer: s, size:
|
|
|
2067
2076
|
}), document.body);
|
|
2068
2077
|
}
|
|
2069
2078
|
// src/components/modal/confirm_modal.tsx
|
|
2070
|
-
var
|
|
2071
|
-
|
|
2072
|
-
let [
|
|
2079
|
+
var gr = w(({ call: e, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, closeLabel: u, onConfirm: d, onError: f }) => {
|
|
2080
|
+
Mn();
|
|
2081
|
+
let [p, g] = h(!1), _ = m(null), v = () => e.end(!1), y = async () => {
|
|
2073
2082
|
if (!d) e.end(!0);
|
|
2074
2083
|
else {
|
|
2075
2084
|
g(!0);
|
|
2076
2085
|
try {
|
|
2077
2086
|
await d(), e.end(!0);
|
|
2078
2087
|
} catch (e) {
|
|
2079
|
-
g(!1),
|
|
2088
|
+
g(!1), kt(e, f);
|
|
2080
2089
|
}
|
|
2081
2090
|
}
|
|
2082
2091
|
}, b = J(), x = o ?? b.confirm, S = s ?? b.cancel, C = c ?? "primary";
|
|
2083
|
-
return /* @__PURE__ */ n(
|
|
2092
|
+
return /* @__PURE__ */ n(hr, {
|
|
2084
2093
|
isEnded: e.ended,
|
|
2085
2094
|
onDismiss: v,
|
|
2086
|
-
title: /* @__PURE__ */ n(
|
|
2095
|
+
title: /* @__PURE__ */ n(ur, {
|
|
2087
2096
|
title: i,
|
|
2088
2097
|
color: C
|
|
2089
2098
|
}),
|
|
@@ -2097,7 +2106,7 @@ var mr = C(({ call: e, title: i, children: a, confirmLabel: o, cancelLabel: s, c
|
|
|
2097
2106
|
variant: "outline",
|
|
2098
2107
|
color: "neutral",
|
|
2099
2108
|
onClick: v,
|
|
2100
|
-
disabled:
|
|
2109
|
+
disabled: p,
|
|
2101
2110
|
size: "sm",
|
|
2102
2111
|
children: S
|
|
2103
2112
|
}), /* @__PURE__ */ n(Y, {
|
|
@@ -2105,7 +2114,7 @@ var mr = C(({ call: e, title: i, children: a, confirmLabel: o, cancelLabel: s, c
|
|
|
2105
2114
|
onClick: () => {
|
|
2106
2115
|
y();
|
|
2107
2116
|
},
|
|
2108
|
-
loading:
|
|
2117
|
+
loading: p,
|
|
2109
2118
|
size: "sm",
|
|
2110
2119
|
children: x
|
|
2111
2120
|
})] }),
|
|
@@ -2113,18 +2122,18 @@ var mr = C(({ call: e, title: i, children: a, confirmLabel: o, cancelLabel: s, c
|
|
|
2113
2122
|
});
|
|
2114
2123
|
}, 200);
|
|
2115
2124
|
// src/components/modal/modal.tsx
|
|
2116
|
-
function
|
|
2125
|
+
function _r(e, t) {
|
|
2117
2126
|
return typeof e == "function" ? e(t) : e;
|
|
2118
2127
|
}
|
|
2119
|
-
var
|
|
2120
|
-
|
|
2121
|
-
let { dismiss: g, registry: _ } =
|
|
2128
|
+
var vr = w(({ call: e, title: t, children: r, size: i, height: a, radius: o, className: s, panelClassName: c, backdropClassName: l, unstyled: u, dismissible: d, closeLabel: f, role: p, initialFocusRef: m, "aria-label": h }) => {
|
|
2129
|
+
Mn();
|
|
2130
|
+
let { dismiss: g, registry: _ } = Kt({
|
|
2122
2131
|
onDismiss: () => e.end(),
|
|
2123
2132
|
isEnded: e.ended
|
|
2124
2133
|
});
|
|
2125
|
-
return /* @__PURE__ */ n(
|
|
2134
|
+
return /* @__PURE__ */ n(Vt.Provider, {
|
|
2126
2135
|
value: _,
|
|
2127
|
-
children: /* @__PURE__ */ n(
|
|
2136
|
+
children: /* @__PURE__ */ n(hr, {
|
|
2128
2137
|
isEnded: e.ended,
|
|
2129
2138
|
onDismiss: g,
|
|
2130
2139
|
title: t,
|
|
@@ -2140,37 +2149,37 @@ var gr = C(({ call: e, title: t, children: r, size: i, height: a, radius: o, cla
|
|
|
2140
2149
|
role: p,
|
|
2141
2150
|
initialFocusRef: m,
|
|
2142
2151
|
"aria-label": h,
|
|
2143
|
-
children:
|
|
2152
|
+
children: _r(r, g)
|
|
2144
2153
|
})
|
|
2145
2154
|
});
|
|
2146
2155
|
}, 200);
|
|
2147
2156
|
// src/components/modal/modal_footer.tsx
|
|
2148
|
-
function
|
|
2149
|
-
let t = c(
|
|
2150
|
-
return t ?
|
|
2157
|
+
function yr({ children: e }) {
|
|
2158
|
+
let t = c(Ut);
|
|
2159
|
+
return t ? S(e, t) : null;
|
|
2151
2160
|
}
|
|
2152
2161
|
// src/components/modal/use_dismiss_guard.ts
|
|
2153
|
-
function
|
|
2154
|
-
let n = c(
|
|
2155
|
-
if (
|
|
2162
|
+
function br(e, t = !0) {
|
|
2163
|
+
let n = c(Vt), r = m(e);
|
|
2164
|
+
if (f(() => {
|
|
2156
2165
|
r.current = e;
|
|
2157
2166
|
}), l(() => {
|
|
2158
2167
|
if (n && t) return n.register(r);
|
|
2159
2168
|
}, [n, t]), !n) throw Error("useDismissGuard must be used inside a Modal or a Drawer");
|
|
2160
2169
|
}
|
|
2161
2170
|
// src/components/modal_provider/modal_provider.tsx
|
|
2162
|
-
function
|
|
2163
|
-
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(
|
|
2171
|
+
function xr() {
|
|
2172
|
+
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(vr, {}), /* @__PURE__ */ n(gr, {})] });
|
|
2164
2173
|
}
|
|
2165
2174
|
// src/components/multi_combobox/multi_combobox.tsx
|
|
2166
|
-
var
|
|
2167
|
-
function
|
|
2175
|
+
var Sr = 2;
|
|
2176
|
+
function Cr(e, t, n, r) {
|
|
2168
2177
|
return r?.(e, t) ? !0 : n === void 0 || t.includes(e) ? !1 : t.length >= n;
|
|
2169
2178
|
}
|
|
2170
|
-
function
|
|
2179
|
+
function wr(e, t) {
|
|
2171
2180
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
2172
2181
|
}
|
|
2173
|
-
function
|
|
2182
|
+
function Tr(e, t) {
|
|
2174
2183
|
if (e.length <= t) return {
|
|
2175
2184
|
visibleOptions: e,
|
|
2176
2185
|
hiddenCount: 0
|
|
@@ -2181,47 +2190,47 @@ function Cr(e, t) {
|
|
|
2181
2190
|
hiddenCount: e.length - n
|
|
2182
2191
|
};
|
|
2183
2192
|
}
|
|
2184
|
-
function
|
|
2193
|
+
function Er(e, t, n) {
|
|
2185
2194
|
return typeof e == "string" ? `${e}, ${n}` : t ? `${t}, ${n}` : n;
|
|
2186
2195
|
}
|
|
2187
|
-
function
|
|
2196
|
+
function Dr(e, t) {
|
|
2188
2197
|
return e.label.toLowerCase().includes(t.trim().toLowerCase());
|
|
2189
2198
|
}
|
|
2190
|
-
var
|
|
2191
|
-
function
|
|
2192
|
-
let L = J(), { fieldId:
|
|
2199
|
+
var Or = "inline-flex items-center rounded-full bg-gray-200 dark:bg-gray-700 px-2 py-0.5 text-xs text-gray-900 dark:text-gray-100";
|
|
2200
|
+
function kr({ options: i, filterOption: a = Dr, label: o, description: c, "aria-label": u, error: d, placeholder: f, searchPlaceholder: g, noResultsText: _, clearLabel: v, clearText: y, maxSelectedValues: b, isOptionDisabled: x, maxDisplayedValues: S = Sr, formatOverflowCount: C, formatSelectedCount: w, formatMaxSelectedHint: T, radius: E = "sm", unstyled: D = !1, disabled: O = !1, required: k = !1, className: A, wrapperClassName: j, values: M, defaultValues: N = [], onChange: P, onDropdownClose: F, id: I }) {
|
|
2201
|
+
let L = J(), { fieldId: R, errorId: B, descriptionId: V, labelId: H } = $(I), W = `${R}-listbox`, te = `${R}-max-hint`, ne = `${R}-selection`, re = o !== void 0 || !!u, ie = m(null), ae = m(null), G = m(null), [K, q] = ke(M, N), [oe, Y] = h(""), [X, se] = h(!1), ce = p(() => oe.trim() ? i.filter((e) => a(e, oe)) : i, [
|
|
2193
2202
|
i,
|
|
2194
2203
|
a,
|
|
2195
|
-
|
|
2196
|
-
]), { activeIndex: le, activeOptionId: ue, move: de, first: fe, last: Z, reset: pe } =
|
|
2204
|
+
oe
|
|
2205
|
+
]), { activeIndex: le, activeOptionId: ue, move: de, first: fe, last: Z, reset: pe } = Ge({
|
|
2197
2206
|
optionCount: ce.length,
|
|
2198
|
-
getOptionId: (e) => `${
|
|
2207
|
+
getOptionId: (e) => `${W}-option-${e}`,
|
|
2199
2208
|
isOpen: X
|
|
2200
|
-
}), me =
|
|
2209
|
+
}), me = p(() => i.filter((e) => K.includes(e.value)), [i, K]), he = re && me.length > 0, { visibleOptions: _e, hiddenCount: ve } = Tr(me, S), ye = () => {
|
|
2201
2210
|
O || se(!0);
|
|
2202
2211
|
}, be = s(() => {
|
|
2203
|
-
se(!1),
|
|
2212
|
+
se(!1), Y(""), pe(), F?.(K);
|
|
2204
2213
|
}, [
|
|
2205
2214
|
pe,
|
|
2206
2215
|
F,
|
|
2207
|
-
|
|
2216
|
+
K
|
|
2208
2217
|
]), xe = () => {
|
|
2209
2218
|
X ? be() : ye();
|
|
2210
2219
|
}, Se = (e) => {
|
|
2211
|
-
if (
|
|
2212
|
-
let t =
|
|
2213
|
-
|
|
2220
|
+
if (Cr(e, K, b, x)) return;
|
|
2221
|
+
let t = wr(K, e);
|
|
2222
|
+
q(t), P?.(t);
|
|
2214
2223
|
}, Ce = () => {
|
|
2215
|
-
|
|
2224
|
+
q([]), P?.([]);
|
|
2216
2225
|
}, we = (e) => {
|
|
2217
|
-
e.stopPropagation(), Ce(), X || F?.([]),
|
|
2226
|
+
e.stopPropagation(), Ce(), X || F?.([]), ie.current?.focus();
|
|
2218
2227
|
}, Te = () => {
|
|
2219
|
-
Ce(),
|
|
2228
|
+
Ce(), G.current?.focus();
|
|
2220
2229
|
}, Ee = () => {
|
|
2221
2230
|
O || xe();
|
|
2222
2231
|
}, De = (e) => {
|
|
2223
|
-
|
|
2224
|
-
},
|
|
2232
|
+
Y(e.target.value), pe();
|
|
2233
|
+
}, Oe = (e) => {
|
|
2225
2234
|
e.preventDefault(), X ? de(1) : (ye(), fe());
|
|
2226
2235
|
}, Ae = (e) => {
|
|
2227
2236
|
e.preventDefault(), X ? de(-1) : (ye(), Z());
|
|
@@ -2231,9 +2240,9 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2231
2240
|
let t = ce[le];
|
|
2232
2241
|
t && Se(t.value);
|
|
2233
2242
|
}, Me = (e) => {
|
|
2234
|
-
X && (e.preventDefault(), be(),
|
|
2243
|
+
X && (e.preventDefault(), be(), ie.current?.focus());
|
|
2235
2244
|
}, Ne = (e) => {
|
|
2236
|
-
if (e.key === "ArrowDown") return
|
|
2245
|
+
if (e.key === "ArrowDown") return Oe(e);
|
|
2237
2246
|
if (e.key === "ArrowUp") return Ae(e);
|
|
2238
2247
|
if (e.key === "Enter") return je(e);
|
|
2239
2248
|
if (e.key === "Escape") return Me(e);
|
|
@@ -2241,11 +2250,11 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2241
2250
|
return l(() => {
|
|
2242
2251
|
if (!X) return;
|
|
2243
2252
|
let e = (e) => {
|
|
2244
|
-
|
|
2253
|
+
ae.current && !ae.current.contains(e.target) && be();
|
|
2245
2254
|
};
|
|
2246
2255
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2247
|
-
}, [X, be]), /* @__PURE__ */ n(
|
|
2248
|
-
fieldId:
|
|
2256
|
+
}, [X, be]), /* @__PURE__ */ n(Ve, {
|
|
2257
|
+
fieldId: R,
|
|
2249
2258
|
errorId: B,
|
|
2250
2259
|
descriptionId: V,
|
|
2251
2260
|
label: o,
|
|
@@ -2254,57 +2263,57 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2254
2263
|
required: k,
|
|
2255
2264
|
wrapperClassName: j,
|
|
2256
2265
|
children: /* @__PURE__ */ r("div", {
|
|
2257
|
-
ref:
|
|
2266
|
+
ref: ae,
|
|
2258
2267
|
className: "relative",
|
|
2259
2268
|
onBlur: (e) => {
|
|
2260
2269
|
if (!X) return;
|
|
2261
2270
|
let t = e.relatedTarget;
|
|
2262
|
-
t instanceof Node &&
|
|
2271
|
+
t instanceof Node && ae.current?.contains(t) || be();
|
|
2263
2272
|
},
|
|
2264
2273
|
children: [
|
|
2265
|
-
|
|
2266
|
-
id:
|
|
2274
|
+
he && /* @__PURE__ */ n("span", {
|
|
2275
|
+
id: ne,
|
|
2267
2276
|
className: "sr-only",
|
|
2268
2277
|
children: me.map((e) => e.label).join(", ")
|
|
2269
2278
|
}),
|
|
2270
2279
|
/* @__PURE__ */ n("button", {
|
|
2271
|
-
ref:
|
|
2280
|
+
ref: ie,
|
|
2272
2281
|
type: "button",
|
|
2273
|
-
id:
|
|
2282
|
+
id: R,
|
|
2274
2283
|
role: "combobox",
|
|
2275
2284
|
disabled: O,
|
|
2276
2285
|
"aria-expanded": X,
|
|
2277
|
-
"aria-controls":
|
|
2286
|
+
"aria-controls": W,
|
|
2278
2287
|
"aria-haspopup": "listbox",
|
|
2279
2288
|
"aria-invalid": !!d,
|
|
2280
2289
|
"aria-required": k || void 0,
|
|
2281
|
-
"aria-describedby": Q(
|
|
2282
|
-
"aria-labelledby": o && !u ?
|
|
2290
|
+
"aria-describedby": Q(he && ne, !!c && V, d && B),
|
|
2291
|
+
"aria-labelledby": o && !u ? H : void 0,
|
|
2283
2292
|
"aria-label": u,
|
|
2284
2293
|
onClick: Ee,
|
|
2285
2294
|
onKeyDown: Ne,
|
|
2286
2295
|
className: e("w-full flex flex-wrap items-center gap-1 text-left disabled:opacity-50 disabled:cursor-not-allowed", !D && [
|
|
2287
|
-
|
|
2288
|
-
|
|
2296
|
+
ge,
|
|
2297
|
+
U[E],
|
|
2289
2298
|
"pl-3 pr-8 py-2 text-sm min-h-10"
|
|
2290
2299
|
], !D && d && e("border-red-500 dark:border-red-400", "focus:ring-red-500"), A),
|
|
2291
2300
|
children: me.length === 0 ? /* @__PURE__ */ n("span", {
|
|
2292
2301
|
className: e(!D && "text-gray-500 dark:text-gray-400"),
|
|
2293
|
-
children:
|
|
2302
|
+
children: f
|
|
2294
2303
|
}) : /* @__PURE__ */ r(t, { children: [_e.map((t) => /* @__PURE__ */ n("span", {
|
|
2295
|
-
className: e(!D &&
|
|
2304
|
+
className: e(!D && Or),
|
|
2296
2305
|
children: t.label
|
|
2297
2306
|
}, t.value)), ve > 0 && /* @__PURE__ */ n("span", {
|
|
2298
|
-
className: e(!D &&
|
|
2307
|
+
className: e(!D && Or),
|
|
2299
2308
|
children: (C ?? L.overflowCount)(ve)
|
|
2300
2309
|
})] })
|
|
2301
2310
|
}),
|
|
2302
|
-
!D &&
|
|
2311
|
+
!D && K.length > 0 && !O && /* @__PURE__ */ n("button", {
|
|
2303
2312
|
type: "button",
|
|
2304
2313
|
"aria-label": v ?? L.clearSelection,
|
|
2305
2314
|
onMouseDown: (e) => e.preventDefault(),
|
|
2306
2315
|
onClick: we,
|
|
2307
|
-
className: e("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 before:content-[''] before:absolute before:-inset-[4px]", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2316
|
+
className: e("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 before:content-[''] before:absolute before:-inset-[4px]", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", z.primary.focusOutline),
|
|
2308
2317
|
children: /* @__PURE__ */ n("span", {
|
|
2309
2318
|
className: "i-mdi-close block w-4 h-4",
|
|
2310
2319
|
"aria-hidden": !0
|
|
@@ -2312,17 +2321,17 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2312
2321
|
}),
|
|
2313
2322
|
X && /* @__PURE__ */ r("div", {
|
|
2314
2323
|
onMouseDown: (e) => {
|
|
2315
|
-
e.target !==
|
|
2324
|
+
e.target !== G.current && e.preventDefault();
|
|
2316
2325
|
},
|
|
2317
2326
|
className: e("absolute z-10 mt-1 w-full text-sm shadow-lg", !D && [
|
|
2318
2327
|
"border overflow-hidden",
|
|
2319
2328
|
"bg-white dark:bg-gray-900",
|
|
2320
2329
|
"border-gray-100 dark:border-gray-800",
|
|
2321
|
-
|
|
2330
|
+
ee[E]
|
|
2322
2331
|
]),
|
|
2323
2332
|
children: [
|
|
2324
2333
|
/* @__PURE__ */ n("input", {
|
|
2325
|
-
ref:
|
|
2334
|
+
ref: G,
|
|
2326
2335
|
type: "text",
|
|
2327
2336
|
autoFocus: !0,
|
|
2328
2337
|
role: "combobox",
|
|
@@ -2330,14 +2339,14 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2330
2339
|
"aria-autocomplete": "list",
|
|
2331
2340
|
"aria-haspopup": "listbox",
|
|
2332
2341
|
autoComplete: "off",
|
|
2333
|
-
value:
|
|
2342
|
+
value: oe,
|
|
2334
2343
|
onChange: De,
|
|
2335
2344
|
onKeyDown: Ne,
|
|
2336
2345
|
placeholder: g ?? L.search,
|
|
2337
|
-
"aria-label":
|
|
2338
|
-
"aria-controls":
|
|
2346
|
+
"aria-label": Er(o, u, g ?? L.search),
|
|
2347
|
+
"aria-controls": W,
|
|
2339
2348
|
"aria-activedescendant": ue,
|
|
2340
|
-
"aria-describedby": b === void 0 ? void 0 :
|
|
2349
|
+
"aria-describedby": b === void 0 ? void 0 : te,
|
|
2341
2350
|
className: e("w-full", !D && [
|
|
2342
2351
|
"px-3 py-2 border-b bg-transparent",
|
|
2343
2352
|
"outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400",
|
|
@@ -2346,21 +2355,21 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2346
2355
|
])
|
|
2347
2356
|
}),
|
|
2348
2357
|
b !== void 0 && /* @__PURE__ */ n("div", {
|
|
2349
|
-
id:
|
|
2358
|
+
id: te,
|
|
2350
2359
|
className: e("px-3 py-1 text-xs", !D && ["border-b", "border-gray-100 dark:border-gray-800"], !D && "text-gray-500 dark:text-gray-400"),
|
|
2351
2360
|
children: (T ?? L.maxSelectedHint)(b)
|
|
2352
2361
|
}),
|
|
2353
2362
|
/* @__PURE__ */ n("ul", {
|
|
2354
|
-
id:
|
|
2363
|
+
id: W,
|
|
2355
2364
|
role: "listbox",
|
|
2356
|
-
"aria-labelledby": o && !u ?
|
|
2365
|
+
"aria-labelledby": o && !u ? H : void 0,
|
|
2357
2366
|
"aria-label": u,
|
|
2358
2367
|
"aria-multiselectable": !0,
|
|
2359
2368
|
className: e("max-h-60 overflow-auto py-1", "[scrollbar-width:thin] [scrollbar-color:theme(colors.gray.300)_transparent] hover:[scrollbar-color:theme(colors.gray.400)_transparent] dark:[scrollbar-color:theme(colors.gray.600)_transparent] dark:hover:[scrollbar-color:theme(colors.gray.500)_transparent]"),
|
|
2360
2369
|
children: ce.map((t, i) => {
|
|
2361
|
-
let a =
|
|
2370
|
+
let a = K.includes(t.value), o = Cr(t.value, K, b, x);
|
|
2362
2371
|
return /* @__PURE__ */ r("li", {
|
|
2363
|
-
id: `${
|
|
2372
|
+
id: `${W}-option-${i}`,
|
|
2364
2373
|
role: "option",
|
|
2365
2374
|
"aria-selected": a,
|
|
2366
2375
|
"aria-disabled": o,
|
|
@@ -2370,7 +2379,7 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2370
2379
|
"aria-hidden": !0,
|
|
2371
2380
|
className: e("flex h-4 w-4 shrink-0 items-center justify-center", !D && [
|
|
2372
2381
|
"border-2",
|
|
2373
|
-
|
|
2382
|
+
U[E],
|
|
2374
2383
|
a ? e("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : e("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800")
|
|
2375
2384
|
]),
|
|
2376
2385
|
children: a && /* @__PURE__ */ n("svg", {
|
|
@@ -2396,10 +2405,10 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2396
2405
|
className: e("flex items-center justify-between px-3 py-2", !D && ["border-t", "border-gray-100 dark:border-gray-800"]),
|
|
2397
2406
|
children: [/* @__PURE__ */ n("span", {
|
|
2398
2407
|
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
2399
|
-
children: (w ?? L.selectedCount)(
|
|
2408
|
+
children: (w ?? L.selectedCount)(K.length)
|
|
2400
2409
|
}), /* @__PURE__ */ n("button", {
|
|
2401
2410
|
type: "button",
|
|
2402
|
-
disabled:
|
|
2411
|
+
disabled: K.length === 0,
|
|
2403
2412
|
onClick: Te,
|
|
2404
2413
|
className: "text-xs font-medium text-blue-600 hover:text-blue-700 disabled:opacity-50 disabled:cursor-not-allowed dark:text-blue-400 dark:hover:text-blue-300",
|
|
2405
2414
|
children: y ?? L.clear
|
|
@@ -2412,9 +2421,9 @@ function Dr({ options: i, filterOption: a = Tr, label: o, description: c, "aria-
|
|
|
2412
2421
|
});
|
|
2413
2422
|
}
|
|
2414
2423
|
// src/components/radio_options/radio_option_row.tsx
|
|
2415
|
-
function
|
|
2424
|
+
function Ar({ option: t, optionId: r, descriptionId: i, name: a, orientation: o, isSelected: s, isDisabled: c, isFirstOption: l, required: u, error: d, radius: f, unstyled: p, className: m, onSelect: h }) {
|
|
2416
2425
|
let g = !!d;
|
|
2417
|
-
return /* @__PURE__ */ n(
|
|
2426
|
+
return /* @__PURE__ */ n(Fe, {
|
|
2418
2427
|
item: t,
|
|
2419
2428
|
htmlFor: r,
|
|
2420
2429
|
descriptionId: i,
|
|
@@ -2438,7 +2447,7 @@ function Or({ option: t, optionId: r, descriptionId: i, name: a, orientation: o,
|
|
|
2438
2447
|
className: "sr-only"
|
|
2439
2448
|
}),
|
|
2440
2449
|
indicator: /* @__PURE__ */ n("span", {
|
|
2441
|
-
className: e("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150",
|
|
2450
|
+
className: e("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", De({
|
|
2442
2451
|
isSelected: s,
|
|
2443
2452
|
isError: g
|
|
2444
2453
|
})),
|
|
@@ -2448,8 +2457,8 @@ function Or({ option: t, optionId: r, descriptionId: i, name: a, orientation: o,
|
|
|
2448
2457
|
});
|
|
2449
2458
|
}
|
|
2450
2459
|
// src/components/radio_options/radio_options.tsx
|
|
2451
|
-
function
|
|
2452
|
-
let { fieldId: b, errorId: x } = $(_), S = c ?? b, [C, w] =
|
|
2460
|
+
function jr({ options: t, orientation: i = "vertical", value: a, defaultValue: o, onChange: s, name: c, label: l, error: u, required: d, disabled: f, radius: p = "lg", unstyled: m = !1, className: h, wrapperClassName: g, id: _, "aria-describedby": v, ...y }) {
|
|
2461
|
+
let { fieldId: b, errorId: x } = $(_), S = c ?? b, [C, w] = ke(a, o ?? ""), T = t.map((e) => typeof e == "string" ? {
|
|
2453
2462
|
value: e,
|
|
2454
2463
|
label: e
|
|
2455
2464
|
} : e), E = (e) => {
|
|
@@ -2465,11 +2474,11 @@ function kr({ options: t, orientation: i = "vertical", value: a, defaultValue: o
|
|
|
2465
2474
|
children: [
|
|
2466
2475
|
l && /* @__PURE__ */ r("legend", {
|
|
2467
2476
|
className: e("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
|
|
2468
|
-
children: [l, d && /* @__PURE__ */ n(
|
|
2477
|
+
children: [l, d && /* @__PURE__ */ n(Oe, {})]
|
|
2469
2478
|
}),
|
|
2470
2479
|
/* @__PURE__ */ n("div", {
|
|
2471
2480
|
className: e(i === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
|
|
2472
|
-
children: T.map((e, t) => /* @__PURE__ */ n(
|
|
2481
|
+
children: T.map((e, t) => /* @__PURE__ */ n(Ar, {
|
|
2473
2482
|
option: e,
|
|
2474
2483
|
optionId: `${b}-${t}`,
|
|
2475
2484
|
descriptionId: `${b}-${t}-desc`,
|
|
@@ -2486,7 +2495,7 @@ function kr({ options: t, orientation: i = "vertical", value: a, defaultValue: o
|
|
|
2486
2495
|
onSelect: E
|
|
2487
2496
|
}, e.value))
|
|
2488
2497
|
}),
|
|
2489
|
-
/* @__PURE__ */ n(
|
|
2498
|
+
/* @__PURE__ */ n(Te, {
|
|
2490
2499
|
id: x,
|
|
2491
2500
|
error: u,
|
|
2492
2501
|
className: "mt-2"
|
|
@@ -2495,9 +2504,9 @@ function kr({ options: t, orientation: i = "vertical", value: a, defaultValue: o
|
|
|
2495
2504
|
});
|
|
2496
2505
|
}
|
|
2497
2506
|
// src/components/select/select.tsx
|
|
2498
|
-
function
|
|
2507
|
+
function Mr({ options: t, label: i, description: a, error: o, placeholder: s, radius: c = "md", unstyled: l = !1, className: u, wrapperClassName: d, value: f, defaultValue: p, onChange: m, id: h, "aria-describedby": g, "aria-label": _, ...v }) {
|
|
2499
2508
|
let { fieldId: y, errorId: b, descriptionId: x, labelId: S } = $(h);
|
|
2500
|
-
return /* @__PURE__ */ n(
|
|
2509
|
+
return /* @__PURE__ */ n(Ve, {
|
|
2501
2510
|
fieldId: y,
|
|
2502
2511
|
errorId: b,
|
|
2503
2512
|
descriptionId: x,
|
|
@@ -2509,8 +2518,8 @@ function Ar({ options: t, label: i, description: a, error: o, placeholder: s, ra
|
|
|
2509
2518
|
children: /* @__PURE__ */ r("select", {
|
|
2510
2519
|
id: y,
|
|
2511
2520
|
className: e("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
|
|
2512
|
-
|
|
2513
|
-
|
|
2521
|
+
ge,
|
|
2522
|
+
U[c],
|
|
2514
2523
|
"pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
|
|
2515
2524
|
"bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
|
|
2516
2525
|
], !l && o && e("border-red-500 dark:border-red-400", "focus:ring-red-500"), u),
|
|
@@ -2518,7 +2527,7 @@ function Ar({ options: t, label: i, description: a, error: o, placeholder: s, ra
|
|
|
2518
2527
|
onChange: m,
|
|
2519
2528
|
"aria-invalid": !!o,
|
|
2520
2529
|
"aria-label": _,
|
|
2521
|
-
"aria-labelledby":
|
|
2530
|
+
"aria-labelledby": He(i, S, _),
|
|
2522
2531
|
"aria-describedby": Q(g, !!a && x, o && b),
|
|
2523
2532
|
...v,
|
|
2524
2533
|
children: [s !== void 0 && /* @__PURE__ */ n("option", {
|
|
@@ -2531,30 +2540,30 @@ function Ar({ options: t, label: i, description: a, error: o, placeholder: s, ra
|
|
|
2531
2540
|
})
|
|
2532
2541
|
});
|
|
2533
2542
|
}
|
|
2534
|
-
var
|
|
2543
|
+
var Nr = "!rounded-l-none border-l", Pr = {
|
|
2535
2544
|
solid: "!border-l-white/40",
|
|
2536
2545
|
outline: "!border-l-0",
|
|
2537
2546
|
ghost: "!border-l-current/25",
|
|
2538
2547
|
subtle: "!border-l-current/25"
|
|
2539
|
-
},
|
|
2540
|
-
function
|
|
2541
|
-
return [
|
|
2548
|
+
}, Fr = "!border-l-gray-400";
|
|
2549
|
+
function Ir(e, t) {
|
|
2550
|
+
return [Nr, e === "solid" && t === "neutral" ? Fr : Pr[e]];
|
|
2542
2551
|
}
|
|
2543
2552
|
// src/components/split_button/split_button.tsx
|
|
2544
|
-
var
|
|
2545
|
-
function
|
|
2546
|
-
let { children: i, onClick: a, menu: o, menuLabel: s, menuIcon: c =
|
|
2553
|
+
var Lr = "i-mdi-chevron-down";
|
|
2554
|
+
function Rr(t) {
|
|
2555
|
+
let { children: i, onClick: a, menu: o, menuLabel: s, menuIcon: c = Lr, menuAlign: l = "end", startIcon: u, size: d = "md", loading: f = !1, disabled: p = !1, "aria-label": m, "aria-labelledby": h, className: g, ref: _, unstyled: v = !1, variant: y = "solid", color: b = "primary", radius: x = "md" } = t, S = v ? { unstyled: !0 } : {
|
|
2547
2556
|
variant: y,
|
|
2548
2557
|
color: b,
|
|
2549
2558
|
radius: x
|
|
2550
|
-
}, C = /* @__PURE__ */ n(
|
|
2559
|
+
}, C = /* @__PURE__ */ n(Ot, {
|
|
2551
2560
|
icon: c,
|
|
2552
2561
|
"aria-label": s,
|
|
2553
2562
|
tooltip: !0,
|
|
2554
2563
|
size: d,
|
|
2555
2564
|
disabled: p,
|
|
2556
2565
|
"aria-disabled": f && !p || void 0,
|
|
2557
|
-
className: e(!v && ["relative focus-visible:z-10",
|
|
2566
|
+
className: e(!v && ["relative focus-visible:z-10", Ir(y, b)]),
|
|
2558
2567
|
...S
|
|
2559
2568
|
});
|
|
2560
2569
|
return /* @__PURE__ */ r("div", {
|
|
@@ -2572,7 +2581,7 @@ function Ir(t) {
|
|
|
2572
2581
|
className: e(!v && ["relative focus-visible:z-10", "!rounded-r-none"]),
|
|
2573
2582
|
...S,
|
|
2574
2583
|
children: i
|
|
2575
|
-
}), /* @__PURE__ */ n(
|
|
2584
|
+
}), /* @__PURE__ */ n(Wn, {
|
|
2576
2585
|
trigger: C,
|
|
2577
2586
|
align: l,
|
|
2578
2587
|
radius: x,
|
|
@@ -2582,28 +2591,28 @@ function Ir(t) {
|
|
|
2582
2591
|
});
|
|
2583
2592
|
}
|
|
2584
2593
|
// src/components/spinner/spinner.tsx
|
|
2585
|
-
var
|
|
2594
|
+
var zr = 0, Br = "inline-flex items-center gap-2", Vr = {
|
|
2586
2595
|
xs: "text-xs",
|
|
2587
2596
|
sm: "text-sm",
|
|
2588
2597
|
md: "text-sm",
|
|
2589
2598
|
lg: "text-base"
|
|
2590
|
-
},
|
|
2599
|
+
}, Hr = {
|
|
2591
2600
|
xs: "w-3.5 h-3.5",
|
|
2592
2601
|
sm: "w-4 h-4",
|
|
2593
2602
|
md: "w-5 h-5",
|
|
2594
2603
|
lg: "w-6 h-6"
|
|
2595
2604
|
};
|
|
2596
|
-
function
|
|
2597
|
-
let { size: i = "md", label: a, unstyled: o = !1, className: s, iconClassName: c, labelClassName: u, ...d } = t, f = J(), [p,
|
|
2605
|
+
function Ur(t) {
|
|
2606
|
+
let { size: i = "md", label: a, unstyled: o = !1, className: s, iconClassName: c, labelClassName: u, ...d } = t, f = J(), [p, m] = h(!1);
|
|
2598
2607
|
l(() => {
|
|
2599
|
-
let e = setTimeout(() =>
|
|
2608
|
+
let e = setTimeout(() => m(!0), zr);
|
|
2600
2609
|
return () => clearTimeout(e);
|
|
2601
2610
|
}, []);
|
|
2602
|
-
let g = a ?? f.loading, _ = e(!o &&
|
|
2611
|
+
let g = a ?? f.loading, _ = e(!o && Hr[i], c);
|
|
2603
2612
|
return /* @__PURE__ */ r("span", {
|
|
2604
2613
|
role: "status",
|
|
2605
2614
|
...d,
|
|
2606
|
-
className: e(!o && [
|
|
2615
|
+
className: e(!o && [Br, Vr[i]], s),
|
|
2607
2616
|
children: [
|
|
2608
2617
|
/* @__PURE__ */ n("span", {
|
|
2609
2618
|
className: e("i-svg-spinners-3-dots-fade ms-spinner-animated", _),
|
|
@@ -2621,16 +2630,16 @@ function Vr(t) {
|
|
|
2621
2630
|
});
|
|
2622
2631
|
}
|
|
2623
2632
|
// src/components/switch/switch.tsx
|
|
2624
|
-
function
|
|
2625
|
-
let { fieldId: y, errorId: b, descriptionId: x } = $(m), [S, C] =
|
|
2626
|
-
return
|
|
2633
|
+
function Wr({ label: i, description: a, error: o, unstyled: s = !1, fullWidth: c = !1, className: l, wrapperClassName: u, checked: d, defaultChecked: f = !1, onChange: p, id: m, "aria-describedby": h, "aria-label": g, "aria-labelledby": _, ...v }) {
|
|
2634
|
+
let { fieldId: y, errorId: b, descriptionId: x } = $(m), [S, C] = ke(d, f), w = Q(h, !!a && x, o && b);
|
|
2635
|
+
return je("Switch", !!i || !!g?.trim() || !!_?.trim()), /* @__PURE__ */ r("div", {
|
|
2627
2636
|
className: e(c ? "w-full" : "w-fit", u),
|
|
2628
2637
|
children: [
|
|
2629
2638
|
/* @__PURE__ */ r("label", {
|
|
2630
2639
|
htmlFor: y,
|
|
2631
2640
|
className: e("flex items-center gap-3 cursor-pointer", v.disabled && "cursor-not-allowed opacity-50"),
|
|
2632
2641
|
children: [/* @__PURE__ */ r("span", {
|
|
2633
|
-
className: e("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out",
|
|
2642
|
+
className: e("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", F, I, !s && [
|
|
2634
2643
|
"rounded-full border-2 border-transparent",
|
|
2635
2644
|
S ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
|
|
2636
2645
|
o && "ring-2 ring-red-500 dark:ring-red-400"
|
|
@@ -2655,15 +2664,15 @@ function Hr({ label: i, description: a, error: o, unstyled: s = !1, fullWidth: c
|
|
|
2655
2664
|
})]
|
|
2656
2665
|
}), i && /* @__PURE__ */ n(t, { children: typeof i == "string" ? /* @__PURE__ */ r("span", {
|
|
2657
2666
|
className: e("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
|
|
2658
|
-
children: [i, v.required && /* @__PURE__ */ n(
|
|
2659
|
-
}) : /* @__PURE__ */ r(t, { children: [i, v.required && /* @__PURE__ */ n(
|
|
2667
|
+
children: [i, v.required && /* @__PURE__ */ n(Oe, {})]
|
|
2668
|
+
}) : /* @__PURE__ */ r(t, { children: [i, v.required && /* @__PURE__ */ n(Oe, {})] }) })]
|
|
2660
2669
|
}),
|
|
2661
|
-
/* @__PURE__ */ n(
|
|
2670
|
+
/* @__PURE__ */ n(Se, {
|
|
2662
2671
|
id: x,
|
|
2663
2672
|
description: a,
|
|
2664
2673
|
className: "mt-1 ml-14"
|
|
2665
2674
|
}),
|
|
2666
|
-
/* @__PURE__ */ n(
|
|
2675
|
+
/* @__PURE__ */ n(Te, {
|
|
2667
2676
|
id: b,
|
|
2668
2677
|
error: o,
|
|
2669
2678
|
className: "mt-1 ml-14"
|
|
@@ -2672,23 +2681,23 @@ function Hr({ label: i, description: a, error: o, unstyled: s = !1, fullWidth: c
|
|
|
2672
2681
|
});
|
|
2673
2682
|
}
|
|
2674
2683
|
// src/components/tabs/tabs_styles.ts
|
|
2675
|
-
var
|
|
2684
|
+
var Gr = {
|
|
2676
2685
|
list: "gap-1 p-1 bg-gray-100 dark:bg-gray-800/50",
|
|
2677
2686
|
tab: "",
|
|
2678
|
-
indicator: `absolute inset-0 ${
|
|
2679
|
-
},
|
|
2687
|
+
indicator: `absolute inset-0 ${E} border border-gray-200 dark:border-gray-700`
|
|
2688
|
+
}, Kr = {
|
|
2680
2689
|
line: {
|
|
2681
2690
|
activeTab: "border-transparent text-gray-900 dark:text-gray-100",
|
|
2682
2691
|
idleTab: "border-transparent text-gray-500 dark:text-gray-400",
|
|
2683
2692
|
idleHover: "hover:text-gray-900 hover:border-gray-300 dark:hover:text-gray-100 dark:hover:border-gray-600",
|
|
2684
2693
|
byOrientation: {
|
|
2685
2694
|
horizontal: {
|
|
2686
|
-
list: `gap-1 border-b ${
|
|
2695
|
+
list: `gap-1 border-b ${D}`,
|
|
2687
2696
|
tab: "-mb-px border-b-2",
|
|
2688
2697
|
indicator: "absolute inset-x-0 -bottom-0.5 h-0.5 bg-blue-600 dark:bg-blue-400"
|
|
2689
2698
|
},
|
|
2690
2699
|
vertical: {
|
|
2691
|
-
list: `gap-1 border-r ${
|
|
2700
|
+
list: `gap-1 border-r ${D}`,
|
|
2692
2701
|
tab: "border-r-2",
|
|
2693
2702
|
indicator: "absolute inset-y-0 -right-0.5 w-0.5 bg-blue-600 dark:bg-blue-400"
|
|
2694
2703
|
}
|
|
@@ -2699,52 +2708,52 @@ var Ur = {
|
|
|
2699
2708
|
idleTab: "text-gray-600 dark:text-gray-400",
|
|
2700
2709
|
idleHover: "hover:text-gray-900 dark:hover:text-gray-100",
|
|
2701
2710
|
byOrientation: {
|
|
2702
|
-
horizontal:
|
|
2703
|
-
vertical:
|
|
2711
|
+
horizontal: Gr,
|
|
2712
|
+
vertical: Gr
|
|
2704
2713
|
}
|
|
2705
2714
|
}
|
|
2706
|
-
},
|
|
2715
|
+
}, qr = {
|
|
2707
2716
|
xs: "px-2 py-1 text-xs",
|
|
2708
2717
|
sm: "px-3 py-1.5 text-sm",
|
|
2709
2718
|
md: "px-4 py-2.5 text-sm",
|
|
2710
2719
|
lg: "px-5 py-3 text-base"
|
|
2711
|
-
},
|
|
2720
|
+
}, Jr = {
|
|
2712
2721
|
xs: "w-3.5 h-3.5",
|
|
2713
2722
|
sm: "w-4 h-4",
|
|
2714
2723
|
md: "w-4 h-4",
|
|
2715
2724
|
lg: "w-5 h-5"
|
|
2716
|
-
},
|
|
2717
|
-
horizontal: e(
|
|
2718
|
-
vertical: e("outline-hidden focus-visible:outline-2", "focus-visible:-outline-offset-2",
|
|
2719
|
-
},
|
|
2720
|
-
function
|
|
2721
|
-
return e("w-full", t === "vertical" &&
|
|
2725
|
+
}, Yr = {
|
|
2726
|
+
horizontal: e(N, z.primary.focusOutline),
|
|
2727
|
+
vertical: e("outline-hidden focus-visible:outline-2", "focus-visible:-outline-offset-2", z.primary.focusOutline)
|
|
2728
|
+
}, Xr = "items-center", Zr = e("flex-col items-stretch min-h-0 overflow-y-auto overflow-x-hidden", A), Qr = "w-48 shrink-0", $r = "justify-start text-left whitespace-normal", ei = "whitespace-nowrap", ti = "flex min-h-0", ni = e("flex-1 min-w-0 min-h-0 overflow-y-auto", A), ri = "ml-6", ii = "mt-4";
|
|
2729
|
+
function ai(t, n) {
|
|
2730
|
+
return e("w-full", t === "vertical" && ti, n);
|
|
2722
2731
|
}
|
|
2723
|
-
function
|
|
2732
|
+
function oi(t) {
|
|
2724
2733
|
let { orientation: n, unstyled: r, className: i } = t, a = n === "vertical";
|
|
2725
|
-
return e(a &&
|
|
2734
|
+
return e(a && ni, !r && [a ? ri : ii, Yr[n]], i);
|
|
2726
2735
|
}
|
|
2727
|
-
function
|
|
2736
|
+
function si(t) {
|
|
2728
2737
|
let { variant: n, orientation: r, radius: i, unstyled: a, isFullWidth: o, className: s } = t, c = r === "vertical";
|
|
2729
|
-
return e("flex", c ?
|
|
2738
|
+
return e("flex", c ? Zr : Xr, !c && o && "w-full", !a && c && Qr, !a && Kr[n].byOrientation[r].list, !a && n === "segmented" && U[i], s);
|
|
2730
2739
|
}
|
|
2731
|
-
function
|
|
2732
|
-
let { variant: n, orientation: r, size: i, radius: a, unstyled: o, isActive: s, isDisabled: c, isFullWidth: l, className: u } = t, d = r === "vertical", f =
|
|
2733
|
-
return e("relative flex items-center gap-2", d ?
|
|
2740
|
+
function ci(t) {
|
|
2741
|
+
let { variant: n, orientation: r, size: i, radius: a, unstyled: o, isActive: s, isDisabled: c, isFullWidth: l, className: u } = t, d = r === "vertical", f = Kr[n];
|
|
2742
|
+
return e("relative flex items-center gap-2", d ? $r : ei, !d && l && "flex-1 justify-center", c ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !o && [
|
|
2734
2743
|
"font-medium transition-colors duration-200",
|
|
2735
|
-
|
|
2744
|
+
qr[i],
|
|
2736
2745
|
f.byOrientation[r].tab,
|
|
2737
2746
|
s ? f.activeTab : [f.idleTab, !c && f.idleHover],
|
|
2738
|
-
n === "segmented" &&
|
|
2739
|
-
|
|
2747
|
+
n === "segmented" && U[a],
|
|
2748
|
+
Yr[r]
|
|
2740
2749
|
], u);
|
|
2741
2750
|
}
|
|
2742
|
-
function
|
|
2751
|
+
function li(t) {
|
|
2743
2752
|
let { variant: n, orientation: r, radius: i } = t;
|
|
2744
|
-
return e("tabs-indicator pointer-events-none",
|
|
2753
|
+
return e("tabs-indicator pointer-events-none", Kr[n].byOrientation[r].indicator, n === "segmented" && U[i]);
|
|
2745
2754
|
}
|
|
2746
2755
|
// src/components/tabs/tab_button.tsx
|
|
2747
|
-
function
|
|
2756
|
+
function ui({ item: i, isActive: a, hasMountedPanel: o, isTabStop: s, isFullWidth: c, variant: l, orientation: u, size: d, radius: f, unstyled: p, tabId: m, panelId: h, onSelect: g, onKeyDown: _, ref: v, indicatorRef: y }) {
|
|
2748
2757
|
let b = !!i.disabled;
|
|
2749
2758
|
return /* @__PURE__ */ r("button", {
|
|
2750
2759
|
ref: v,
|
|
@@ -2758,7 +2767,7 @@ function ci({ item: i, isActive: a, hasMountedPanel: o, isTabStop: s, isFullWidt
|
|
|
2758
2767
|
disabled: i.disabled,
|
|
2759
2768
|
onClick: g,
|
|
2760
2769
|
onKeyDown: _,
|
|
2761
|
-
className:
|
|
2770
|
+
className: ci({
|
|
2762
2771
|
variant: l,
|
|
2763
2772
|
orientation: u,
|
|
2764
2773
|
size: d,
|
|
@@ -2772,7 +2781,7 @@ function ci({ item: i, isActive: a, hasMountedPanel: o, isTabStop: s, isFullWidt
|
|
|
2772
2781
|
a && !p && /* @__PURE__ */ n("span", {
|
|
2773
2782
|
ref: y,
|
|
2774
2783
|
"aria-hidden": "true",
|
|
2775
|
-
className:
|
|
2784
|
+
className: li({
|
|
2776
2785
|
variant: l,
|
|
2777
2786
|
orientation: u,
|
|
2778
2787
|
radius: f
|
|
@@ -2780,7 +2789,7 @@ function ci({ item: i, isActive: a, hasMountedPanel: o, isTabStop: s, isFullWidt
|
|
|
2780
2789
|
}),
|
|
2781
2790
|
i.icon && /* @__PURE__ */ n("span", {
|
|
2782
2791
|
"aria-hidden": "true",
|
|
2783
|
-
className: e("relative shrink-0",
|
|
2792
|
+
className: e("relative shrink-0", Jr[d], i.icon)
|
|
2784
2793
|
}),
|
|
2785
2794
|
/* @__PURE__ */ n("span", {
|
|
2786
2795
|
className: "relative",
|
|
@@ -2791,7 +2800,7 @@ function ci({ item: i, isActive: a, hasMountedPanel: o, isTabStop: s, isFullWidt
|
|
|
2791
2800
|
});
|
|
2792
2801
|
}
|
|
2793
2802
|
// src/components/tabs/tab_panel.tsx
|
|
2794
|
-
function
|
|
2803
|
+
function di({ panelId: t, tabId: r, isHidden: i, isAnimated: a, className: o, contentKey: s, children: c }) {
|
|
2795
2804
|
return /* @__PURE__ */ n("div", {
|
|
2796
2805
|
role: "tabpanel",
|
|
2797
2806
|
id: t,
|
|
@@ -2806,11 +2815,11 @@ function li({ panelId: t, tabId: r, isHidden: i, isAnimated: a, className: o, co
|
|
|
2806
2815
|
});
|
|
2807
2816
|
}
|
|
2808
2817
|
// src/components/tabs/use_tab_indicator_transition.ts
|
|
2809
|
-
var
|
|
2810
|
-
function
|
|
2811
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(
|
|
2818
|
+
var fi = 200, pi = "ease-out", mi = "(prefers-reduced-motion: reduce)";
|
|
2819
|
+
function hi() {
|
|
2820
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(mi).matches;
|
|
2812
2821
|
}
|
|
2813
|
-
function
|
|
2822
|
+
function gi(e, t, n) {
|
|
2814
2823
|
return e === "vertical" ? [{
|
|
2815
2824
|
transform: `translateY(${t.top - n.top}px)`,
|
|
2816
2825
|
height: `${t.height}px`
|
|
@@ -2825,25 +2834,25 @@ function mi(e, t, n) {
|
|
|
2825
2834
|
width: `${n.width}px`
|
|
2826
2835
|
}];
|
|
2827
2836
|
}
|
|
2828
|
-
function
|
|
2829
|
-
e.animate(
|
|
2830
|
-
duration:
|
|
2831
|
-
easing:
|
|
2837
|
+
function _i(e, t, n, r) {
|
|
2838
|
+
e.animate(gi(t, n, r), {
|
|
2839
|
+
duration: fi,
|
|
2840
|
+
easing: pi
|
|
2832
2841
|
});
|
|
2833
2842
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return !e || !t || !n ? !1 : !
|
|
2843
|
+
function vi(e, t, n) {
|
|
2844
|
+
return !e || !t || !n ? !1 : !hi();
|
|
2836
2845
|
}
|
|
2837
|
-
function
|
|
2838
|
-
let { activeIndex: t, indicatorRef: n, isAnimated: r, orientation: i } = e, a =
|
|
2839
|
-
|
|
2846
|
+
function yi(e) {
|
|
2847
|
+
let { activeIndex: t, indicatorRef: n, isAnimated: r, orientation: i } = e, a = m(null);
|
|
2848
|
+
f(() => {
|
|
2840
2849
|
let e = n.current;
|
|
2841
2850
|
if (!e) {
|
|
2842
2851
|
a.current = null;
|
|
2843
2852
|
return;
|
|
2844
2853
|
}
|
|
2845
2854
|
let t = e.getBoundingClientRect(), o = typeof e.animate == "function";
|
|
2846
|
-
|
|
2855
|
+
vi(a.current, r, o) && _i(e, i, a.current, t), a.current = t;
|
|
2847
2856
|
}, [
|
|
2848
2857
|
t,
|
|
2849
2858
|
n,
|
|
@@ -2852,34 +2861,34 @@ function _i(e) {
|
|
|
2852
2861
|
]);
|
|
2853
2862
|
}
|
|
2854
2863
|
// src/components/tabs/use_tabs_keyboard_navigation.ts
|
|
2855
|
-
var
|
|
2864
|
+
var bi = {
|
|
2856
2865
|
Home: () => 0,
|
|
2857
2866
|
End: (e, t) => t - 1
|
|
2858
|
-
},
|
|
2867
|
+
}, xi = (e, t) => (e + 1) % t, Si = (e, t) => (e - 1 + t) % t, Ci = {
|
|
2859
2868
|
horizontal: {
|
|
2860
|
-
...
|
|
2861
|
-
ArrowRight:
|
|
2862
|
-
ArrowLeft:
|
|
2869
|
+
...bi,
|
|
2870
|
+
ArrowRight: xi,
|
|
2871
|
+
ArrowLeft: Si
|
|
2863
2872
|
},
|
|
2864
2873
|
vertical: {
|
|
2865
|
-
...
|
|
2866
|
-
ArrowDown:
|
|
2867
|
-
ArrowUp:
|
|
2874
|
+
...bi,
|
|
2875
|
+
ArrowDown: xi,
|
|
2876
|
+
ArrowUp: Si
|
|
2868
2877
|
}
|
|
2869
2878
|
};
|
|
2870
|
-
function
|
|
2879
|
+
function wi(e) {
|
|
2871
2880
|
return e.flatMap((e, t) => e.disabled ? [] : [t]);
|
|
2872
2881
|
}
|
|
2873
|
-
function
|
|
2882
|
+
function Ti(e, t) {
|
|
2874
2883
|
let n = e[t];
|
|
2875
|
-
return n && !n.disabled ? t :
|
|
2884
|
+
return n && !n.disabled ? t : wi(e)[0] ?? -1;
|
|
2876
2885
|
}
|
|
2877
|
-
function
|
|
2886
|
+
function Ei(e) {
|
|
2878
2887
|
let { items: t, activeIndex: n, orientation: r, onNavigate: i } = e;
|
|
2879
2888
|
return (e) => {
|
|
2880
|
-
let a =
|
|
2889
|
+
let a = Ci[r][e.key];
|
|
2881
2890
|
if (!a) return;
|
|
2882
|
-
let o =
|
|
2891
|
+
let o = wi(t);
|
|
2883
2892
|
if (o.length === 0) return;
|
|
2884
2893
|
e.preventDefault();
|
|
2885
2894
|
let s = a(o.indexOf(n), o.length);
|
|
@@ -2887,69 +2896,69 @@ function wi(e) {
|
|
|
2887
2896
|
};
|
|
2888
2897
|
}
|
|
2889
2898
|
// src/components/tabs/tabs.tsx
|
|
2890
|
-
function
|
|
2891
|
-
let [x, S] =
|
|
2899
|
+
function Di({ items: e, value: t, defaultIndex: i = 0, variant: a = "line", orientation: o = "horizontal", size: s = "md", radius: c = "md", fullWidth: l = !1, unstyled: u = !1, animated: f = !0, keepMounted: p = !1, "aria-label": h, "aria-labelledby": g, className: _, tabListClassName: v, panelClassName: y, onChange: b }) {
|
|
2900
|
+
let [x, S] = ke(t, i), C = d(), w = m([]), T = m(null), E = (t) => {
|
|
2892
2901
|
e[t]?.disabled || (S(t), b?.(t));
|
|
2893
2902
|
}, D = (e) => {
|
|
2894
2903
|
w.current[e]?.focus(), E(e);
|
|
2895
|
-
}, O =
|
|
2904
|
+
}, O = Ti(e, x), k = Ei({
|
|
2896
2905
|
items: e,
|
|
2897
2906
|
activeIndex: O,
|
|
2898
2907
|
orientation: o,
|
|
2899
2908
|
onNavigate: D
|
|
2900
|
-
}), A =
|
|
2909
|
+
}), A = oi({
|
|
2901
2910
|
orientation: o,
|
|
2902
|
-
unstyled:
|
|
2911
|
+
unstyled: u,
|
|
2903
2912
|
className: y
|
|
2904
|
-
}), j = f && !
|
|
2905
|
-
return
|
|
2913
|
+
}), j = f && !u;
|
|
2914
|
+
return yi({
|
|
2906
2915
|
activeIndex: x,
|
|
2907
2916
|
indicatorRef: T,
|
|
2908
2917
|
isAnimated: f,
|
|
2909
2918
|
orientation: o
|
|
2910
2919
|
}), /* @__PURE__ */ r("div", {
|
|
2911
|
-
className:
|
|
2920
|
+
className: ai(o, _),
|
|
2912
2921
|
children: [/* @__PURE__ */ n("div", {
|
|
2913
2922
|
role: "tablist",
|
|
2914
2923
|
"aria-label": h,
|
|
2915
2924
|
"aria-labelledby": g,
|
|
2916
2925
|
"aria-orientation": o,
|
|
2917
|
-
className:
|
|
2926
|
+
className: si({
|
|
2918
2927
|
variant: a,
|
|
2919
2928
|
orientation: o,
|
|
2920
2929
|
radius: c,
|
|
2921
|
-
unstyled:
|
|
2930
|
+
unstyled: u,
|
|
2922
2931
|
isFullWidth: l,
|
|
2923
2932
|
className: v
|
|
2924
2933
|
}),
|
|
2925
|
-
children: e.map((e, t) => /* @__PURE__ */ n(
|
|
2934
|
+
children: e.map((e, t) => /* @__PURE__ */ n(ui, {
|
|
2926
2935
|
ref: (e) => {
|
|
2927
2936
|
w.current[t] = e;
|
|
2928
2937
|
},
|
|
2929
2938
|
indicatorRef: T,
|
|
2930
2939
|
item: e,
|
|
2931
2940
|
isActive: x === t,
|
|
2932
|
-
hasMountedPanel:
|
|
2941
|
+
hasMountedPanel: p || x === t,
|
|
2933
2942
|
isTabStop: O === t,
|
|
2934
2943
|
isFullWidth: l,
|
|
2935
2944
|
variant: a,
|
|
2936
2945
|
orientation: o,
|
|
2937
2946
|
size: s,
|
|
2938
2947
|
radius: c,
|
|
2939
|
-
unstyled:
|
|
2948
|
+
unstyled: u,
|
|
2940
2949
|
tabId: `${C}-tab-${t}`,
|
|
2941
2950
|
panelId: `${C}-panel-${t}`,
|
|
2942
2951
|
onSelect: () => E(t),
|
|
2943
2952
|
onKeyDown: k
|
|
2944
2953
|
}, e.title))
|
|
2945
|
-
}),
|
|
2954
|
+
}), p ? e.map((e, t) => /* @__PURE__ */ n(di, {
|
|
2946
2955
|
panelId: `${C}-panel-${t}`,
|
|
2947
2956
|
tabId: `${C}-tab-${t}`,
|
|
2948
2957
|
isHidden: t !== x,
|
|
2949
2958
|
isAnimated: j,
|
|
2950
2959
|
className: A,
|
|
2951
2960
|
children: e.content
|
|
2952
|
-
}, e.title)) : /* @__PURE__ */ n(
|
|
2961
|
+
}, e.title)) : /* @__PURE__ */ n(di, {
|
|
2953
2962
|
panelId: `${C}-panel-${x}`,
|
|
2954
2963
|
tabId: `${C}-tab-${x}`,
|
|
2955
2964
|
isHidden: !1,
|
|
@@ -2961,11 +2970,11 @@ function Ti({ items: e, value: t, defaultIndex: i = 0, variant: a = "line", orie
|
|
|
2961
2970
|
});
|
|
2962
2971
|
}
|
|
2963
2972
|
// src/components/textarea/textarea.tsx
|
|
2964
|
-
function
|
|
2965
|
-
let { fieldId: b, errorId: x, descriptionId: S, labelId: C, characterCountId: w } = $(g), { length: T, trackLength: E } =
|
|
2973
|
+
function Oi({ label: t, description: i, error: a, showCharCount: o = !1, minLength: s, maxLength: c, radius: l = "md", unstyled: u = !1, className: d, wrapperClassName: f, value: p, defaultValue: m, onChange: h, id: g, "aria-describedby": _, "aria-label": v, ...y }) {
|
|
2974
|
+
let { fieldId: b, errorId: x, descriptionId: S, labelId: C, characterCountId: w } = $(g), { length: T, trackLength: E } = Rn(p, m), D = o && (s !== void 0 || c !== void 0), O = (e) => {
|
|
2966
2975
|
E(e.target.value), h?.(e);
|
|
2967
2976
|
};
|
|
2968
|
-
return /* @__PURE__ */ r(
|
|
2977
|
+
return /* @__PURE__ */ r(Ve, {
|
|
2969
2978
|
fieldId: b,
|
|
2970
2979
|
errorId: x,
|
|
2971
2980
|
descriptionId: S,
|
|
@@ -2977,8 +2986,8 @@ function Ei({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
2977
2986
|
children: [/* @__PURE__ */ n("textarea", {
|
|
2978
2987
|
id: b,
|
|
2979
2988
|
className: e("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !u && [
|
|
2980
|
-
|
|
2981
|
-
|
|
2989
|
+
ge,
|
|
2990
|
+
U[l],
|
|
2982
2991
|
"px-3 py-2 text-sm"
|
|
2983
2992
|
], !u && a && e("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
|
|
2984
2993
|
...p === void 0 ? { defaultValue: m } : { value: p },
|
|
@@ -2987,10 +2996,10 @@ function Ei({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
2987
2996
|
onChange: O,
|
|
2988
2997
|
"aria-invalid": !!a,
|
|
2989
2998
|
"aria-label": v,
|
|
2990
|
-
"aria-labelledby":
|
|
2999
|
+
"aria-labelledby": He(t, C, v),
|
|
2991
3000
|
"aria-describedby": Q(_, !!i && S, a && x, D && w),
|
|
2992
3001
|
...y
|
|
2993
|
-
}), D && /* @__PURE__ */ n(
|
|
3002
|
+
}), D && /* @__PURE__ */ n(pe, {
|
|
2994
3003
|
id: w,
|
|
2995
3004
|
current: T,
|
|
2996
3005
|
min: s,
|
|
@@ -3001,7 +3010,7 @@ function Ei({ label: t, description: i, error: a, showCharCount: o = !1, minLeng
|
|
|
3001
3010
|
});
|
|
3002
3011
|
}
|
|
3003
3012
|
// src/lib/is_webkit_gtk.ts
|
|
3004
|
-
var
|
|
3013
|
+
var ki = "AppleWebKit", Ai = ["Linux", "X11"], ji = [
|
|
3005
3014
|
"Chrome",
|
|
3006
3015
|
"Chromium",
|
|
3007
3016
|
"Edg",
|
|
@@ -3009,12 +3018,12 @@ var Di = "AppleWebKit", Oi = ["Linux", "X11"], ki = [
|
|
|
3009
3018
|
"CriOS",
|
|
3010
3019
|
"FxiOS"
|
|
3011
3020
|
];
|
|
3012
|
-
function
|
|
3013
|
-
return !e.includes(
|
|
3021
|
+
function Mi(e) {
|
|
3022
|
+
return !e.includes(ki) || !Ai.some((t) => e.includes(t)) ? !1 : !ji.some((t) => e.includes(t));
|
|
3014
3023
|
}
|
|
3015
3024
|
// src/lib/theme_transition.ts
|
|
3016
|
-
var
|
|
3017
|
-
async function
|
|
3025
|
+
var Ni = 750, Pi = "ease-in-out";
|
|
3026
|
+
async function Fi({ theme: e, element: t, transitionDuration: n = Ni, transitionEasing: r = Pi, applyThemeCallback: i }) {
|
|
3018
3027
|
if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3019
3028
|
i(e);
|
|
3020
3029
|
return;
|
|
@@ -3028,76 +3037,76 @@ async function Ni({ theme: e, element: t, transitionDuration: n = ji, transition
|
|
|
3028
3037
|
pseudoElement: "::view-transition-new(root)"
|
|
3029
3038
|
});
|
|
3030
3039
|
}
|
|
3031
|
-
function
|
|
3040
|
+
function Ii(e) {
|
|
3032
3041
|
return e === "light" ? "dark" : e === "dark" ? "system" : "light";
|
|
3033
3042
|
}
|
|
3034
3043
|
// src/stores/theme_store/theme_storage_key.ts
|
|
3035
|
-
var
|
|
3044
|
+
var Li = "theme";
|
|
3036
3045
|
// src/stores/theme_store/theme_store.ts
|
|
3037
|
-
function
|
|
3046
|
+
function Ri(e) {
|
|
3038
3047
|
return e === "light" || e === "dark" || e === "system";
|
|
3039
3048
|
}
|
|
3040
|
-
function
|
|
3049
|
+
function zi() {
|
|
3041
3050
|
return globalThis.window !== void 0 && globalThis.document !== void 0;
|
|
3042
3051
|
}
|
|
3043
|
-
function
|
|
3052
|
+
function Bi(e) {
|
|
3044
3053
|
let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
|
|
3045
3054
|
document.documentElement.classList.toggle("dark", n);
|
|
3046
3055
|
}
|
|
3047
|
-
function
|
|
3048
|
-
if (!
|
|
3056
|
+
function Vi() {
|
|
3057
|
+
if (!zi()) return "system";
|
|
3049
3058
|
try {
|
|
3050
|
-
let e = globalThis.localStorage.getItem(
|
|
3051
|
-
return
|
|
3059
|
+
let e = globalThis.localStorage.getItem(Li);
|
|
3060
|
+
return Ri(e) ? e : "system";
|
|
3052
3061
|
} catch {
|
|
3053
3062
|
return "system";
|
|
3054
3063
|
}
|
|
3055
3064
|
}
|
|
3056
|
-
function
|
|
3057
|
-
if (
|
|
3058
|
-
globalThis.localStorage.setItem(
|
|
3065
|
+
function Hi(e) {
|
|
3066
|
+
if (zi()) try {
|
|
3067
|
+
globalThis.localStorage.setItem(Li, e);
|
|
3059
3068
|
} catch {
|
|
3060
3069
|
return;
|
|
3061
3070
|
}
|
|
3062
3071
|
}
|
|
3063
|
-
var
|
|
3064
|
-
|
|
3065
|
-
var
|
|
3066
|
-
theme:
|
|
3072
|
+
var Ui = Vi();
|
|
3073
|
+
zi() && Bi(Ui);
|
|
3074
|
+
var Wi = C((e) => ({
|
|
3075
|
+
theme: Ui,
|
|
3067
3076
|
setTheme: (t) => {
|
|
3068
|
-
|
|
3077
|
+
Bi(t), Hi(t), e({ theme: t });
|
|
3069
3078
|
}
|
|
3070
3079
|
}));
|
|
3071
|
-
|
|
3080
|
+
zi() && (globalThis.addEventListener("storage", (e) => {
|
|
3072
3081
|
if (e.key !== "theme") return;
|
|
3073
|
-
let t =
|
|
3074
|
-
|
|
3082
|
+
let t = Ri(e.newValue) ? e.newValue : "system";
|
|
3083
|
+
Bi(t), Wi.setState({ theme: t });
|
|
3075
3084
|
}), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
3076
|
-
|
|
3085
|
+
Wi.getState().theme === "system" && Bi("system");
|
|
3077
3086
|
}));
|
|
3078
3087
|
// src/components/theme_toggle/theme_toggle.tsx
|
|
3079
|
-
var
|
|
3088
|
+
var Gi = {
|
|
3080
3089
|
light: "i-tabler-sun text-yellow-500",
|
|
3081
3090
|
dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
|
|
3082
3091
|
system: "i-tabler-device-desktop text-blue-500"
|
|
3083
|
-
},
|
|
3092
|
+
}, Ki = {
|
|
3084
3093
|
light: "i-tabler-sun",
|
|
3085
3094
|
dark: "i-tabler-moon-stars",
|
|
3086
3095
|
system: "i-tabler-device-desktop"
|
|
3087
|
-
},
|
|
3088
|
-
function
|
|
3096
|
+
}, qi = "i-tabler-device-desktop text-gray-400", Ji = "i-tabler-device-desktop";
|
|
3097
|
+
function Yi(e, t, n) {
|
|
3089
3098
|
return e ? { unstyled: !0 } : {
|
|
3090
3099
|
radius: t,
|
|
3091
3100
|
variant: n
|
|
3092
3101
|
};
|
|
3093
3102
|
}
|
|
3094
|
-
function
|
|
3095
|
-
return n ? t ?
|
|
3103
|
+
function Xi(e, t, n) {
|
|
3104
|
+
return n ? t ? Ki[e] : Ji : t ? Gi[e] : qi;
|
|
3096
3105
|
}
|
|
3097
|
-
function
|
|
3098
|
-
let d =
|
|
3099
|
-
let n =
|
|
3100
|
-
i && a ? await
|
|
3106
|
+
function Zi({ isTransitionEnabled: e, transitionDuration: t, transitionEasing: r, size: i = "md", unstyled: a = !1, radius: o, variant: c, getAriaLabel: l, tooltip: u }) {
|
|
3107
|
+
let d = Wi((e) => e.theme), f = Wi((e) => e.setTheme), p = J(), h = ze(), g = m(null), _ = s(async () => {
|
|
3108
|
+
let n = Ii(d), i = g.current, a = e ?? !Mi(navigator.userAgent);
|
|
3109
|
+
i && a ? await Fi({
|
|
3101
3110
|
theme: n,
|
|
3102
3111
|
element: i,
|
|
3103
3112
|
transitionDuration: t,
|
|
@@ -3110,11 +3119,11 @@ function Yi({ isTransitionEnabled: e, transitionDuration: t, transitionEasing: r
|
|
|
3110
3119
|
t,
|
|
3111
3120
|
r,
|
|
3112
3121
|
f
|
|
3113
|
-
]), v =
|
|
3114
|
-
return /* @__PURE__ */ n(
|
|
3122
|
+
]), v = Xi(d, h, a), y = Yi(a, o, c);
|
|
3123
|
+
return /* @__PURE__ */ n(Ot, {
|
|
3115
3124
|
ref: g,
|
|
3116
3125
|
icon: v,
|
|
3117
|
-
"aria-label": (l ??
|
|
3126
|
+
"aria-label": (l ?? p.currentTheme)(d),
|
|
3118
3127
|
size: i,
|
|
3119
3128
|
...y,
|
|
3120
3129
|
tooltip: u,
|
|
@@ -3124,7 +3133,7 @@ function Yi({ isTransitionEnabled: e, transitionDuration: t, transitionEasing: r
|
|
|
3124
3133
|
});
|
|
3125
3134
|
}
|
|
3126
3135
|
// src/components/toolbar/toolbar_items.ts
|
|
3127
|
-
var
|
|
3136
|
+
var Qi = "a[href], button, input:not([type=\"hidden\"]), select, textarea, summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex]", $i = [
|
|
3128
3137
|
"textarea",
|
|
3129
3138
|
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
3130
3139
|
`input:not(${[
|
|
@@ -3138,46 +3147,46 @@ var Xi = "a[href], button, input:not([type=\"hidden\"]), select, textarea, summa
|
|
|
3138
3147
|
"reset",
|
|
3139
3148
|
"submit"
|
|
3140
3149
|
].map((e) => `[type="${e}"]`).join(", ")})`
|
|
3141
|
-
].join(", "),
|
|
3142
|
-
function
|
|
3150
|
+
].join(", "), ea = "select, input[type=\"range\"], input[type=\"radio\"]";
|
|
3151
|
+
function ta(e) {
|
|
3143
3152
|
return e.matches(":disabled, [aria-disabled=\"true\"]");
|
|
3144
3153
|
}
|
|
3145
|
-
function
|
|
3146
|
-
return Array.from(e.querySelectorAll(
|
|
3154
|
+
function na(e) {
|
|
3155
|
+
return Array.from(e.querySelectorAll(Qi));
|
|
3147
3156
|
}
|
|
3148
|
-
function
|
|
3149
|
-
return
|
|
3157
|
+
function ra(e) {
|
|
3158
|
+
return na(e).filter((e) => !ta(e));
|
|
3150
3159
|
}
|
|
3151
|
-
function
|
|
3152
|
-
return e instanceof HTMLElement && e.matches(`${
|
|
3160
|
+
function ia(e) {
|
|
3161
|
+
return e instanceof HTMLElement && e.matches(`${$i}, ${ea}`);
|
|
3153
3162
|
}
|
|
3154
3163
|
// src/components/toolbar/toolbar_navigation.ts
|
|
3155
|
-
var
|
|
3164
|
+
var aa = (e, t) => (e + 1) % t, oa = (e, t) => (e - 1 + t) % t, sa = () => 0, ca = (e, t) => t - 1, la = {
|
|
3156
3165
|
horizontal: {
|
|
3157
|
-
ArrowRight:
|
|
3158
|
-
ArrowLeft:
|
|
3159
|
-
Home:
|
|
3160
|
-
End:
|
|
3166
|
+
ArrowRight: aa,
|
|
3167
|
+
ArrowLeft: oa,
|
|
3168
|
+
Home: sa,
|
|
3169
|
+
End: ca
|
|
3161
3170
|
},
|
|
3162
3171
|
vertical: {
|
|
3163
|
-
ArrowDown:
|
|
3164
|
-
ArrowUp:
|
|
3165
|
-
Home:
|
|
3166
|
-
End:
|
|
3172
|
+
ArrowDown: aa,
|
|
3173
|
+
ArrowUp: oa,
|
|
3174
|
+
Home: sa,
|
|
3175
|
+
End: ca
|
|
3167
3176
|
}
|
|
3168
3177
|
};
|
|
3169
|
-
function
|
|
3170
|
-
let { key: t, orientation: n, currentPosition: r, itemCount: i } = e, a =
|
|
3178
|
+
function ua(e) {
|
|
3179
|
+
let { key: t, orientation: n, currentPosition: r, itemCount: i } = e, a = la[n][t];
|
|
3171
3180
|
if (a && i !== 0) return a(r, i);
|
|
3172
3181
|
}
|
|
3173
3182
|
// src/components/toolbar/use_toolbar_roving_focus.ts
|
|
3174
|
-
var
|
|
3175
|
-
function
|
|
3176
|
-
let n =
|
|
3183
|
+
var da = ["disabled", "aria-disabled"];
|
|
3184
|
+
function fa(e, t) {
|
|
3185
|
+
let n = m(null), r = s(() => {
|
|
3177
3186
|
let t = e.current;
|
|
3178
3187
|
if (!t) return;
|
|
3179
|
-
let r =
|
|
3180
|
-
for (let e of
|
|
3188
|
+
let r = ra(t), i = n.current, a = i && r.includes(i) ? i : r[0];
|
|
3189
|
+
for (let e of na(t)) e.tabIndex = e === a ? 0 : -1;
|
|
3181
3190
|
}, [e]);
|
|
3182
3191
|
return l(() => {
|
|
3183
3192
|
let t = e.current;
|
|
@@ -3188,19 +3197,19 @@ function ua(e, t) {
|
|
|
3188
3197
|
subtree: !0,
|
|
3189
3198
|
childList: !0,
|
|
3190
3199
|
attributes: !0,
|
|
3191
|
-
attributeFilter:
|
|
3200
|
+
attributeFilter: da
|
|
3192
3201
|
}), () => n.disconnect();
|
|
3193
3202
|
}, [e, r]), {
|
|
3194
3203
|
handleFocus: (t) => {
|
|
3195
3204
|
let i = e.current;
|
|
3196
3205
|
if (!i) return;
|
|
3197
|
-
let a =
|
|
3206
|
+
let a = ra(i).find((e) => e === t.target);
|
|
3198
3207
|
a && (n.current = a, r());
|
|
3199
3208
|
},
|
|
3200
3209
|
handleKeyDown: (n) => {
|
|
3201
3210
|
let r = e.current;
|
|
3202
|
-
if (!r || !r.contains(n.target) ||
|
|
3203
|
-
let i =
|
|
3211
|
+
if (!r || !r.contains(n.target) || ia(n.target)) return;
|
|
3212
|
+
let i = ra(r), a = ua({
|
|
3204
3213
|
key: n.key,
|
|
3205
3214
|
orientation: t,
|
|
3206
3215
|
currentPosition: i.findIndex((e) => e === n.target),
|
|
@@ -3211,18 +3220,18 @@ function ua(e, t) {
|
|
|
3211
3220
|
};
|
|
3212
3221
|
}
|
|
3213
3222
|
// src/components/toolbar/toolbar.tsx
|
|
3214
|
-
var
|
|
3223
|
+
var pa = {
|
|
3215
3224
|
horizontal: "flex items-center gap-1",
|
|
3216
3225
|
vertical: "flex flex-col items-stretch gap-1"
|
|
3217
3226
|
};
|
|
3218
|
-
function
|
|
3219
|
-
let { orientation: r = "horizontal", unstyled: i = !1, className: a, ref: o, onFocus: s, onKeyDown: c, ...l } = t, u =
|
|
3227
|
+
function ma(t) {
|
|
3228
|
+
let { orientation: r = "horizontal", unstyled: i = !1, className: a, ref: o, onFocus: s, onKeyDown: c, ...l } = t, u = m(null), { handleFocus: d, handleKeyDown: f } = fa(u, r);
|
|
3220
3229
|
return /* @__PURE__ */ n("div", {
|
|
3221
3230
|
...l,
|
|
3222
|
-
ref:
|
|
3231
|
+
ref: Me(u, o),
|
|
3223
3232
|
role: "toolbar",
|
|
3224
3233
|
"aria-orientation": r,
|
|
3225
|
-
className: e(!i &&
|
|
3234
|
+
className: e(!i && pa[r], a),
|
|
3226
3235
|
onFocus: (e) => {
|
|
3227
3236
|
d(e), s?.(e);
|
|
3228
3237
|
},
|
|
@@ -3232,11 +3241,11 @@ function fa(t) {
|
|
|
3232
3241
|
});
|
|
3233
3242
|
}
|
|
3234
3243
|
// src/components/ui_provider/french_ui_labels.ts
|
|
3235
|
-
var
|
|
3244
|
+
var ha = {
|
|
3236
3245
|
light: "clair",
|
|
3237
3246
|
dark: "sombre",
|
|
3238
3247
|
system: "système"
|
|
3239
|
-
},
|
|
3248
|
+
}, ga = {
|
|
3240
3249
|
close: "Fermer",
|
|
3241
3250
|
confirm: "Confirmer",
|
|
3242
3251
|
cancel: "Annuler",
|
|
@@ -3249,33 +3258,33 @@ var pa = {
|
|
|
3249
3258
|
loading: "Chargement",
|
|
3250
3259
|
copy: "Copier",
|
|
3251
3260
|
charactersRemaining: (e) => `${e} ${e > 1 ? "caractères restants" : "caractère restant"}`,
|
|
3252
|
-
currentTheme: (e) => `Thème actuel : ${
|
|
3261
|
+
currentTheme: (e) => `Thème actuel : ${ha[e]}`,
|
|
3253
3262
|
overflowCount: (e) => `+${e} ${e > 1 ? "autres" : "autre"}`,
|
|
3254
3263
|
selectedCount: (e) => `${e} ${e > 1 ? "sélectionnés" : "sélectionné"}`,
|
|
3255
3264
|
maxSelectedHint: (e) => `Vous pouvez sélectionner jusqu'à ${e} ${e > 1 ? "éléments" : "élément"}`
|
|
3256
3265
|
};
|
|
3257
3266
|
// src/components/ui_provider/ui_provider.tsx
|
|
3258
|
-
function
|
|
3267
|
+
function _a(e = {}) {
|
|
3259
3268
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
3260
3269
|
}
|
|
3261
|
-
function
|
|
3262
|
-
let i = c(q), a =
|
|
3270
|
+
function va({ labels: e, announceFieldErrors: t, children: r }) {
|
|
3271
|
+
let i = c(q), a = we(), o = p(() => ({
|
|
3263
3272
|
...i,
|
|
3264
|
-
...
|
|
3273
|
+
..._a(e)
|
|
3265
3274
|
}), [i, e]);
|
|
3266
3275
|
return /* @__PURE__ */ n(q.Provider, {
|
|
3267
3276
|
value: o,
|
|
3268
|
-
children: /* @__PURE__ */ n(
|
|
3277
|
+
children: /* @__PURE__ */ n(Ce.Provider, {
|
|
3269
3278
|
value: t ?? a,
|
|
3270
3279
|
children: r
|
|
3271
3280
|
})
|
|
3272
3281
|
});
|
|
3273
3282
|
}
|
|
3274
3283
|
// src/hooks/use_is_client/with_client_only.tsx
|
|
3275
|
-
var
|
|
3284
|
+
var ya = (e) => {
|
|
3276
3285
|
function t(t) {
|
|
3277
|
-
return
|
|
3286
|
+
return ze() ? /* @__PURE__ */ n(e, { ...t }) : null;
|
|
3278
3287
|
}
|
|
3279
3288
|
return t;
|
|
3280
|
-
},
|
|
3281
|
-
export {
|
|
3289
|
+
}, ba = `(function(){var t=null;try{t=localStorage.getItem(${JSON.stringify(Li)})}catch(e){}var d=t==="dark"||(t!=="light"&&matchMedia("(prefers-color-scheme: dark)").matches);document.documentElement.classList.toggle("dark",d)})()`;
|
|
3290
|
+
export { M as AppBar, re as Avatar, ge as BASE_INPUT_STYLES, ae as Badge, Y as Button, le as Card, pe as CharacterCount, Pe as Checkbox, Re as CheckboxOptions, Be as ClientOnly, qe as Combobox, gr as ConfirmModal, pt as ContextMenu, Mt as CopyButton, In as Drawer, ga as FRENCH_UI_LABELS, It as Highlight, Ot as IconButton, zn as Input, Vn as Kbd, Wn as Menu, Gn as MenuGroup, or as MenuItem, sr as MenuSeparator, vr as Modal, yr as ModalFooter, xr as ModalProvider, kr as MultiCombobox, jr as RadioOptions, Mr as Select, Ur as Spinner, Rr as SplitButton, Wr as Switch, ba as THEME_INIT_SCRIPT, Di as Tabs, Oi as Textarea, Zi as ThemeToggle, ma as Toolbar, wt as Tooltip, va as UIProvider, K as buttonClassName, xn as dismissTopmostModal, Nt as splitIntoHighlightSegments, Mn as useDisableHotkeysWhileMounted, br as useDismissGuard, An as useGlobalHotkeysStore, ze as useIsClient, Wi as useThemeStore, ya as withClientOnly };
|