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