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