@duro-app/ui 0.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/LICENSE +21 -0
- package/dist/components/Alert/Alert.d.ts +9 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/Alert.stories.d.ts +11 -0
- package/dist/components/Alert/Alert.stories.d.ts.map +1 -0
- package/dist/components/Alert/styles.css.d.ts +32 -0
- package/dist/components/Alert/styles.css.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.stories.d.ts +13 -0
- package/dist/components/Badge/Badge.stories.d.ts.map +1 -0
- package/dist/components/Badge/styles.css.d.ts +48 -0
- package/dist/components/Badge/styles.css.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.stories.d.ts +14 -0
- package/dist/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/components/Button/styles.css.d.ts +69 -0
- package/dist/components/Button/styles.css.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.stories.d.ts +13 -0
- package/dist/components/Card/Card.stories.d.ts.map +1 -0
- package/dist/components/Card/styles.css.d.ts +51 -0
- package/dist/components/Card/styles.css.d.ts.map +1 -0
- package/dist/components/Field/Field.d.ts +26 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/Field.stories.d.ts +8 -0
- package/dist/components/Field/Field.stories.d.ts.map +1 -0
- package/dist/components/Field/FieldContext.d.ts +10 -0
- package/dist/components/Field/FieldContext.d.ts.map +1 -0
- package/dist/components/Field/styles.css.d.ts +22 -0
- package/dist/components/Field/styles.css.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +21 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.stories.d.ts +11 -0
- package/dist/components/Input/Input.stories.d.ts.map +1 -0
- package/dist/components/Input/styles.css.d.ts +32 -0
- package/dist/components/Input/styles.css.d.ts.map +1 -0
- package/dist/components/Menu/Menu.d.ts +32 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/Menu.stories.d.ts +8 -0
- package/dist/components/Menu/Menu.stories.d.ts.map +1 -0
- package/dist/components/Menu/MenuContext.d.ts +13 -0
- package/dist/components/Menu/MenuContext.d.ts.map +1 -0
- package/dist/components/Menu/styles.css.d.ts +79 -0
- package/dist/components/Menu/styles.css.d.ts.map +1 -0
- package/dist/components/Menu/useMenuRoot.d.ts +6 -0
- package/dist/components/Menu/useMenuRoot.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +33 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts +7 -0
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollAreaContext.d.ts +14 -0
- package/dist/components/ScrollArea/ScrollAreaContext.d.ts.map +1 -0
- package/dist/components/ScrollArea/styles.css.d.ts +74 -0
- package/dist/components/ScrollArea/styles.css.d.ts.map +1 -0
- package/dist/components/ScrollArea/useScrollAreaRoot.d.ts +3 -0
- package/dist/components/ScrollArea/useScrollAreaRoot.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +40 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/Select.stories.d.ts +8 -0
- package/dist/components/Select/Select.stories.d.ts.map +1 -0
- package/dist/components/Select/SelectContext.d.ts +17 -0
- package/dist/components/Select/SelectContext.d.ts.map +1 -0
- package/dist/components/Select/styles.css.d.ts +90 -0
- package/dist/components/Select/styles.css.d.ts.map +1 -0
- package/dist/components/Select/useSelectRoot.d.ts +12 -0
- package/dist/components/Select/useSelectRoot.d.ts.map +1 -0
- package/dist/components/SideNav/SideNav.d.ts +27 -0
- package/dist/components/SideNav/SideNav.d.ts.map +1 -0
- package/dist/components/SideNav/SideNavContext.d.ts +11 -0
- package/dist/components/SideNav/SideNavContext.d.ts.map +1 -0
- package/dist/components/SideNav/styles.css.d.ts +74 -0
- package/dist/components/SideNav/styles.css.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +35 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.stories.d.ts +10 -0
- package/dist/components/Table/Table.stories.d.ts.map +1 -0
- package/dist/components/Table/styles.css.d.ts +70 -0
- package/dist/components/Table/styles.css.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +32 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +9 -0
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/components/Tabs/TabsContext.d.ts +12 -0
- package/dist/components/Tabs/TabsContext.d.ts.map +1 -0
- package/dist/components/Tabs/styles.css.d.ts +80 -0
- package/dist/components/Tabs/styles.css.d.ts.map +1 -0
- package/dist/components/Tabs/useTabsRoot.d.ts +10 -0
- package/dist/components/Tabs/useTabsRoot.d.ts.map +1 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +9 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +1 -0
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +10 -0
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +19 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
- package/dist/components/Tooltip/styles.css.d.ts +52 -0
- package/dist/components/Tooltip/styles.css.d.ts.map +1 -0
- package/dist/hooks/useControllableValue.d.ts +2 -0
- package/dist/hooks/useControllableValue.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1850 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1850 @@
|
|
|
1
|
+
import { jsx as a, jsxs as U, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
+
import { css as F, html as g } from "react-strict-dom";
|
|
3
|
+
import { colors as o, typography as h, radii as D, spacing as i, shadows as Q, highContrastTheme as It, highContrastShadows as zt, lightTheme as Wt, lightShadows as Ht } from "@duro-app/tokens";
|
|
4
|
+
import { colors as Xe, highContrastShadows as je, highContrastTheme as Ge, lightShadows as Ye, lightTheme as Ue, radii as Ke, shadows as _e, spacing as qe, typography as Je } from "@duro-app/tokens";
|
|
5
|
+
import { useContext as $, createContext as V, useId as Y, useMemo as ht, useState as M, useRef as w, useCallback as B, useEffect as L, Children as mt } from "react";
|
|
6
|
+
const ft = F.create({
|
|
7
|
+
base: {
|
|
8
|
+
padding: i.md,
|
|
9
|
+
borderRadius: D.sm,
|
|
10
|
+
borderWidth: 1,
|
|
11
|
+
borderStyle: "solid",
|
|
12
|
+
fontSize: h.fontSizeSm,
|
|
13
|
+
lineHeight: h.lineHeight
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
backgroundColor: o.errorBg,
|
|
17
|
+
borderColor: o.errorBorder,
|
|
18
|
+
color: o.errorText
|
|
19
|
+
},
|
|
20
|
+
success: {
|
|
21
|
+
backgroundColor: o.successBg,
|
|
22
|
+
borderColor: o.successBorder,
|
|
23
|
+
color: o.successText
|
|
24
|
+
},
|
|
25
|
+
warning: {
|
|
26
|
+
backgroundColor: o.warningBg,
|
|
27
|
+
borderColor: o.warningBorder,
|
|
28
|
+
color: o.warningText
|
|
29
|
+
},
|
|
30
|
+
info: {
|
|
31
|
+
backgroundColor: o.infoBg,
|
|
32
|
+
borderColor: o.infoBorder,
|
|
33
|
+
color: o.infoText
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function Ie({
|
|
37
|
+
variant: t = "info",
|
|
38
|
+
children: e
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ a(g.div, { role: "alert", style: [ft.base, ft[t]], children: e });
|
|
41
|
+
}
|
|
42
|
+
const J = F.create({
|
|
43
|
+
base: {
|
|
44
|
+
display: "inline-flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
fontFamily: h.fontFamily,
|
|
48
|
+
fontWeight: h.fontWeightMedium,
|
|
49
|
+
lineHeight: 1,
|
|
50
|
+
borderRadius: D.full,
|
|
51
|
+
whiteSpace: "nowrap"
|
|
52
|
+
},
|
|
53
|
+
sizeMd: {
|
|
54
|
+
paddingTop: i.xs,
|
|
55
|
+
paddingBottom: i.xs,
|
|
56
|
+
paddingLeft: i.sm,
|
|
57
|
+
paddingRight: i.sm,
|
|
58
|
+
fontSize: h.fontSizeXs
|
|
59
|
+
},
|
|
60
|
+
sizeSm: {
|
|
61
|
+
paddingTop: 2,
|
|
62
|
+
paddingBottom: 2,
|
|
63
|
+
paddingLeft: i.xs,
|
|
64
|
+
paddingRight: i.xs,
|
|
65
|
+
fontSize: "0.625rem"
|
|
66
|
+
},
|
|
67
|
+
default: {
|
|
68
|
+
backgroundColor: o.bgCardHover,
|
|
69
|
+
color: o.textMuted
|
|
70
|
+
},
|
|
71
|
+
success: {
|
|
72
|
+
backgroundColor: o.successBg,
|
|
73
|
+
color: o.successText
|
|
74
|
+
},
|
|
75
|
+
warning: {
|
|
76
|
+
backgroundColor: o.warningBg,
|
|
77
|
+
color: o.warningText
|
|
78
|
+
},
|
|
79
|
+
error: {
|
|
80
|
+
backgroundColor: o.errorBg,
|
|
81
|
+
color: o.errorText
|
|
82
|
+
},
|
|
83
|
+
info: {
|
|
84
|
+
backgroundColor: o.infoBg,
|
|
85
|
+
color: o.infoText
|
|
86
|
+
}
|
|
87
|
+
}), Dt = {
|
|
88
|
+
sm: J.sizeSm,
|
|
89
|
+
md: J.sizeMd
|
|
90
|
+
};
|
|
91
|
+
function ze({
|
|
92
|
+
variant: t = "default",
|
|
93
|
+
size: e = "md",
|
|
94
|
+
children: r
|
|
95
|
+
}) {
|
|
96
|
+
return /* @__PURE__ */ a(g.span, { style: [J.base, Dt[e], J[t]], children: r });
|
|
97
|
+
}
|
|
98
|
+
const _ = F.create({
|
|
99
|
+
base: {
|
|
100
|
+
display: "inline-flex",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
gap: i.sm,
|
|
104
|
+
fontFamily: h.fontFamily,
|
|
105
|
+
fontSize: h.fontSizeSm,
|
|
106
|
+
fontWeight: h.fontWeightMedium,
|
|
107
|
+
lineHeight: h.lineHeight,
|
|
108
|
+
borderRadius: D.sm,
|
|
109
|
+
borderWidth: 1,
|
|
110
|
+
borderStyle: "solid",
|
|
111
|
+
cursor: "pointer",
|
|
112
|
+
transitionProperty: "background-color, border-color, color, opacity",
|
|
113
|
+
transitionDuration: "150ms",
|
|
114
|
+
transitionTimingFunction: "ease",
|
|
115
|
+
textDecoration: "none",
|
|
116
|
+
outlineWidth: {
|
|
117
|
+
default: 0,
|
|
118
|
+
":focus-visible": 2
|
|
119
|
+
},
|
|
120
|
+
outlineStyle: {
|
|
121
|
+
default: "none",
|
|
122
|
+
":focus-visible": "solid"
|
|
123
|
+
},
|
|
124
|
+
outlineColor: {
|
|
125
|
+
default: "transparent",
|
|
126
|
+
":focus-visible": o.accent
|
|
127
|
+
},
|
|
128
|
+
outlineOffset: {
|
|
129
|
+
default: 0,
|
|
130
|
+
":focus-visible": 2
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
sizeDefault: {
|
|
134
|
+
paddingTop: i.sm,
|
|
135
|
+
paddingBottom: i.sm,
|
|
136
|
+
paddingLeft: i.md,
|
|
137
|
+
paddingRight: i.md
|
|
138
|
+
},
|
|
139
|
+
sizeSmall: {
|
|
140
|
+
paddingTop: i.xs,
|
|
141
|
+
paddingBottom: i.xs,
|
|
142
|
+
paddingLeft: i.sm,
|
|
143
|
+
paddingRight: i.sm,
|
|
144
|
+
fontSize: h.fontSizeXs
|
|
145
|
+
},
|
|
146
|
+
primary: {
|
|
147
|
+
backgroundColor: {
|
|
148
|
+
default: o.accent,
|
|
149
|
+
":hover": o.accentHover,
|
|
150
|
+
":active": o.accentHover
|
|
151
|
+
},
|
|
152
|
+
borderColor: {
|
|
153
|
+
default: o.accent,
|
|
154
|
+
":hover": o.accentHover
|
|
155
|
+
},
|
|
156
|
+
color: o.accentContrast
|
|
157
|
+
},
|
|
158
|
+
secondary: {
|
|
159
|
+
backgroundColor: {
|
|
160
|
+
default: "transparent",
|
|
161
|
+
":hover": o.bgCardHover
|
|
162
|
+
},
|
|
163
|
+
borderColor: o.border,
|
|
164
|
+
color: o.textMuted
|
|
165
|
+
},
|
|
166
|
+
link: {
|
|
167
|
+
backgroundColor: "transparent",
|
|
168
|
+
borderColor: "transparent",
|
|
169
|
+
color: {
|
|
170
|
+
default: o.accent,
|
|
171
|
+
":hover": o.accentHover
|
|
172
|
+
},
|
|
173
|
+
textDecoration: {
|
|
174
|
+
default: "none",
|
|
175
|
+
":hover": "underline"
|
|
176
|
+
},
|
|
177
|
+
paddingLeft: 0,
|
|
178
|
+
paddingRight: 0
|
|
179
|
+
},
|
|
180
|
+
danger: {
|
|
181
|
+
backgroundColor: {
|
|
182
|
+
default: o.error,
|
|
183
|
+
":hover": o.errorHover,
|
|
184
|
+
":active": o.errorHover
|
|
185
|
+
},
|
|
186
|
+
borderColor: {
|
|
187
|
+
default: o.error,
|
|
188
|
+
":hover": o.errorHover
|
|
189
|
+
},
|
|
190
|
+
color: o.errorContrast
|
|
191
|
+
},
|
|
192
|
+
fullWidth: {
|
|
193
|
+
width: "100%"
|
|
194
|
+
},
|
|
195
|
+
disabled: {
|
|
196
|
+
opacity: 0.5,
|
|
197
|
+
cursor: "not-allowed"
|
|
198
|
+
}
|
|
199
|
+
}), Bt = {
|
|
200
|
+
default: _.sizeDefault,
|
|
201
|
+
small: _.sizeSmall
|
|
202
|
+
};
|
|
203
|
+
function We({
|
|
204
|
+
variant: t = "primary",
|
|
205
|
+
size: e = "default",
|
|
206
|
+
fullWidth: r = !1,
|
|
207
|
+
disabled: n = !1,
|
|
208
|
+
type: l = "button",
|
|
209
|
+
onClick: s,
|
|
210
|
+
children: d
|
|
211
|
+
}) {
|
|
212
|
+
return /* @__PURE__ */ a(g.button, { type: l, disabled: n, onClick: s, style: [_.base, Bt[e], _[t], r && _.fullWidth, n && _.disabled], children: d });
|
|
213
|
+
}
|
|
214
|
+
const q = F.create({
|
|
215
|
+
base: {
|
|
216
|
+
backgroundColor: o.bgCard,
|
|
217
|
+
color: o.text,
|
|
218
|
+
fontFamily: h.fontFamily
|
|
219
|
+
},
|
|
220
|
+
// Variants
|
|
221
|
+
elevated: {
|
|
222
|
+
borderRadius: D.lg,
|
|
223
|
+
borderWidth: 1,
|
|
224
|
+
borderStyle: "solid",
|
|
225
|
+
borderColor: o.border,
|
|
226
|
+
boxShadow: Q.md
|
|
227
|
+
},
|
|
228
|
+
outlined: {
|
|
229
|
+
borderRadius: D.md,
|
|
230
|
+
borderWidth: 1,
|
|
231
|
+
borderStyle: "solid",
|
|
232
|
+
borderColor: o.border
|
|
233
|
+
},
|
|
234
|
+
filled: {
|
|
235
|
+
borderRadius: D.md
|
|
236
|
+
},
|
|
237
|
+
interactive: {
|
|
238
|
+
borderRadius: D.md,
|
|
239
|
+
borderWidth: 1,
|
|
240
|
+
borderStyle: "solid",
|
|
241
|
+
borderColor: {
|
|
242
|
+
default: o.border,
|
|
243
|
+
":hover": o.accent
|
|
244
|
+
},
|
|
245
|
+
backgroundColor: {
|
|
246
|
+
default: o.bgCard,
|
|
247
|
+
":hover": o.bgCardHover
|
|
248
|
+
},
|
|
249
|
+
cursor: "pointer",
|
|
250
|
+
transitionProperty: "background-color, border-color, transform",
|
|
251
|
+
transitionDuration: "150ms",
|
|
252
|
+
transitionTimingFunction: "ease",
|
|
253
|
+
transform: {
|
|
254
|
+
default: "translateY(0)",
|
|
255
|
+
":hover": "translateY(-2px)"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
// Sizes (padding)
|
|
259
|
+
sizeDefault: {
|
|
260
|
+
padding: i.lg
|
|
261
|
+
},
|
|
262
|
+
sizeCompact: {
|
|
263
|
+
padding: i.md
|
|
264
|
+
},
|
|
265
|
+
sizeFull: {
|
|
266
|
+
padding: i.xl
|
|
267
|
+
},
|
|
268
|
+
// Header
|
|
269
|
+
header: {
|
|
270
|
+
fontSize: h.fontSizeLg,
|
|
271
|
+
fontWeight: h.fontWeightSemibold,
|
|
272
|
+
marginBottom: i.md
|
|
273
|
+
}
|
|
274
|
+
}), Lt = {
|
|
275
|
+
default: q.sizeDefault,
|
|
276
|
+
compact: q.sizeCompact,
|
|
277
|
+
full: q.sizeFull
|
|
278
|
+
};
|
|
279
|
+
function He({
|
|
280
|
+
variant: t = "outlined",
|
|
281
|
+
size: e = "default",
|
|
282
|
+
header: r,
|
|
283
|
+
onClick: n,
|
|
284
|
+
children: l
|
|
285
|
+
}) {
|
|
286
|
+
return /* @__PURE__ */ U(g.div, { onClick: n, style: [q.base, q[t], Lt[e]], children: [
|
|
287
|
+
r && /* @__PURE__ */ a(g.div, { style: q.header, children: r }),
|
|
288
|
+
l
|
|
289
|
+
] });
|
|
290
|
+
}
|
|
291
|
+
const bt = V(null);
|
|
292
|
+
function Z() {
|
|
293
|
+
return $(bt);
|
|
294
|
+
}
|
|
295
|
+
const tt = F.create({
|
|
296
|
+
root: {
|
|
297
|
+
display: "flex",
|
|
298
|
+
flexDirection: "column",
|
|
299
|
+
gap: i.xs
|
|
300
|
+
},
|
|
301
|
+
label: {
|
|
302
|
+
fontSize: h.fontSizeSm,
|
|
303
|
+
fontWeight: h.fontWeightMedium,
|
|
304
|
+
color: o.text
|
|
305
|
+
},
|
|
306
|
+
description: {
|
|
307
|
+
fontSize: h.fontSizeXs,
|
|
308
|
+
color: o.textMuted
|
|
309
|
+
},
|
|
310
|
+
error: {
|
|
311
|
+
fontSize: h.fontSizeXs,
|
|
312
|
+
color: o.error
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
function Pt({
|
|
316
|
+
invalid: t = !1,
|
|
317
|
+
children: e
|
|
318
|
+
}) {
|
|
319
|
+
const r = Y(), n = ht(() => ({
|
|
320
|
+
controlId: `${r}-control`,
|
|
321
|
+
descriptionId: `${r}-description`,
|
|
322
|
+
errorId: `${r}-error`,
|
|
323
|
+
invalid: t
|
|
324
|
+
}), [r, t]);
|
|
325
|
+
return /* @__PURE__ */ a(bt.Provider, { value: n, children: /* @__PURE__ */ a(g.div, { style: tt.root, children: e }) });
|
|
326
|
+
}
|
|
327
|
+
function Mt({
|
|
328
|
+
children: t
|
|
329
|
+
}) {
|
|
330
|
+
const e = Z();
|
|
331
|
+
return /* @__PURE__ */ a(g.label, { for: e?.controlId, style: tt.label, children: t });
|
|
332
|
+
}
|
|
333
|
+
function Ft({
|
|
334
|
+
children: t
|
|
335
|
+
}) {
|
|
336
|
+
const e = Z();
|
|
337
|
+
return /* @__PURE__ */ a(g.span, { id: e?.descriptionId, style: tt.description, children: t });
|
|
338
|
+
}
|
|
339
|
+
function Et({
|
|
340
|
+
children: t
|
|
341
|
+
}) {
|
|
342
|
+
const e = Z();
|
|
343
|
+
return !e?.invalid && !t ? null : /* @__PURE__ */ a(g.span, { id: e?.errorId, role: "alert", style: tt.error, children: t });
|
|
344
|
+
}
|
|
345
|
+
const De = {
|
|
346
|
+
Root: Pt,
|
|
347
|
+
Label: Mt,
|
|
348
|
+
Description: Ft,
|
|
349
|
+
Error: Et
|
|
350
|
+
}, gt = F.create({
|
|
351
|
+
base: {
|
|
352
|
+
width: "100%",
|
|
353
|
+
paddingTop: i.sm,
|
|
354
|
+
paddingBottom: i.sm,
|
|
355
|
+
paddingLeft: i.md,
|
|
356
|
+
paddingRight: i.md,
|
|
357
|
+
fontFamily: h.fontFamily,
|
|
358
|
+
fontSize: h.fontSizeSm,
|
|
359
|
+
lineHeight: h.lineHeight,
|
|
360
|
+
color: o.text,
|
|
361
|
+
backgroundColor: o.bg,
|
|
362
|
+
borderWidth: 1,
|
|
363
|
+
borderStyle: "solid",
|
|
364
|
+
borderRadius: D.sm,
|
|
365
|
+
transitionProperty: "border-color",
|
|
366
|
+
transitionDuration: "150ms",
|
|
367
|
+
transitionTimingFunction: "ease",
|
|
368
|
+
outlineWidth: {
|
|
369
|
+
default: 0,
|
|
370
|
+
":focus-visible": 2
|
|
371
|
+
},
|
|
372
|
+
outlineStyle: {
|
|
373
|
+
default: "none",
|
|
374
|
+
":focus-visible": "solid"
|
|
375
|
+
},
|
|
376
|
+
outlineColor: {
|
|
377
|
+
default: "transparent",
|
|
378
|
+
":focus-visible": o.accent
|
|
379
|
+
},
|
|
380
|
+
outlineOffset: {
|
|
381
|
+
default: 0,
|
|
382
|
+
":focus-visible": 1
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
default: {
|
|
386
|
+
borderColor: {
|
|
387
|
+
default: o.border,
|
|
388
|
+
":hover": o.textMuted,
|
|
389
|
+
":focus": o.accent
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
error: {
|
|
393
|
+
borderColor: {
|
|
394
|
+
default: o.error,
|
|
395
|
+
":focus": o.error
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
function Be({
|
|
400
|
+
variant: t = "default",
|
|
401
|
+
type: e = "text",
|
|
402
|
+
name: r,
|
|
403
|
+
placeholder: n,
|
|
404
|
+
required: l,
|
|
405
|
+
minLength: s,
|
|
406
|
+
pattern: d,
|
|
407
|
+
autoComplete: c,
|
|
408
|
+
value: m,
|
|
409
|
+
defaultValue: u,
|
|
410
|
+
disabled: f,
|
|
411
|
+
onChange: p
|
|
412
|
+
}) {
|
|
413
|
+
const S = Z(), R = d !== void 0 ? {
|
|
414
|
+
pattern: d
|
|
415
|
+
} : void 0;
|
|
416
|
+
return /* @__PURE__ */ a(g.input, { id: S?.controlId, type: e, name: r, placeholder: n, required: l, minLength: s, autoComplete: c, value: m, defaultValue: u, disabled: f, "aria-describedby": S ? `${S.descriptionId} ${S.invalid ? S.errorId : ""}`.trim() : void 0, "aria-invalid": S?.invalid || t === "error" || void 0, onChange: p, style: [gt.base, gt[t]], ...R });
|
|
417
|
+
}
|
|
418
|
+
const N = F.create({
|
|
419
|
+
root: {
|
|
420
|
+
position: "relative",
|
|
421
|
+
display: "inline-flex"
|
|
422
|
+
},
|
|
423
|
+
trigger: {
|
|
424
|
+
display: "inline-flex",
|
|
425
|
+
alignItems: "center",
|
|
426
|
+
gap: i.sm,
|
|
427
|
+
paddingTop: i.sm,
|
|
428
|
+
paddingBottom: i.sm,
|
|
429
|
+
paddingLeft: i.md,
|
|
430
|
+
paddingRight: i.md,
|
|
431
|
+
fontFamily: h.fontFamily,
|
|
432
|
+
fontSize: h.fontSizeSm,
|
|
433
|
+
color: o.text,
|
|
434
|
+
backgroundColor: {
|
|
435
|
+
default: "transparent",
|
|
436
|
+
":hover": o.bgCardHover
|
|
437
|
+
},
|
|
438
|
+
borderWidth: 1,
|
|
439
|
+
borderStyle: "solid",
|
|
440
|
+
borderColor: o.border,
|
|
441
|
+
borderRadius: D.sm,
|
|
442
|
+
cursor: "pointer",
|
|
443
|
+
transitionProperty: "background-color, border-color",
|
|
444
|
+
transitionDuration: "150ms"
|
|
445
|
+
},
|
|
446
|
+
backdrop: {
|
|
447
|
+
position: "fixed",
|
|
448
|
+
top: 0,
|
|
449
|
+
left: 0,
|
|
450
|
+
right: 0,
|
|
451
|
+
bottom: 0,
|
|
452
|
+
zIndex: 49
|
|
453
|
+
},
|
|
454
|
+
popup: {
|
|
455
|
+
position: "absolute",
|
|
456
|
+
top: "100%",
|
|
457
|
+
left: 0,
|
|
458
|
+
marginTop: i.xs,
|
|
459
|
+
backgroundColor: o.bgCard,
|
|
460
|
+
borderWidth: 1,
|
|
461
|
+
borderStyle: "solid",
|
|
462
|
+
borderColor: o.border,
|
|
463
|
+
borderRadius: D.sm,
|
|
464
|
+
boxShadow: Q.md,
|
|
465
|
+
paddingTop: i.xs,
|
|
466
|
+
paddingBottom: i.xs,
|
|
467
|
+
minWidth: 160,
|
|
468
|
+
zIndex: 50
|
|
469
|
+
},
|
|
470
|
+
popupEnd: {
|
|
471
|
+
left: "auto",
|
|
472
|
+
right: 0
|
|
473
|
+
},
|
|
474
|
+
item: {
|
|
475
|
+
display: "flex",
|
|
476
|
+
alignItems: "center",
|
|
477
|
+
paddingTop: i.sm,
|
|
478
|
+
paddingBottom: i.sm,
|
|
479
|
+
paddingLeft: i.md,
|
|
480
|
+
paddingRight: i.md,
|
|
481
|
+
fontSize: h.fontSizeSm,
|
|
482
|
+
fontFamily: h.fontFamily,
|
|
483
|
+
color: o.text,
|
|
484
|
+
borderRadius: D.sm,
|
|
485
|
+
cursor: "pointer",
|
|
486
|
+
backgroundColor: "transparent",
|
|
487
|
+
transitionProperty: "background-color",
|
|
488
|
+
transitionDuration: "150ms"
|
|
489
|
+
},
|
|
490
|
+
itemHighlighted: {
|
|
491
|
+
backgroundColor: o.bgCardHover
|
|
492
|
+
},
|
|
493
|
+
linkItem: {
|
|
494
|
+
textDecoration: "none",
|
|
495
|
+
color: {
|
|
496
|
+
default: o.text,
|
|
497
|
+
":hover": o.text
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}), vt = V(null);
|
|
501
|
+
function et() {
|
|
502
|
+
const t = $(vt);
|
|
503
|
+
if (!t) throw new Error("Menu compound components must be used within Menu.Root");
|
|
504
|
+
return t;
|
|
505
|
+
}
|
|
506
|
+
function $t() {
|
|
507
|
+
const [t, e] = M(!1), [r, n] = M(null), l = Y(), s = w(null), d = w(null), c = w(/* @__PURE__ */ new Map()), m = w([]), u = w(!1), f = B(() => {
|
|
508
|
+
e(!1), n(null), u.current = !1, d.current?.focus();
|
|
509
|
+
}, []), p = B(() => {
|
|
510
|
+
e((x) => (x ? (n(null), u.current = !1) : u.current = !0, !x));
|
|
511
|
+
}, []);
|
|
512
|
+
L(() => {
|
|
513
|
+
if (t && u.current) {
|
|
514
|
+
u.current = !1;
|
|
515
|
+
const x = m.current;
|
|
516
|
+
x.length > 0 && n(x[0]);
|
|
517
|
+
}
|
|
518
|
+
}, [t]);
|
|
519
|
+
const S = B((x, C) => {
|
|
520
|
+
c.current.set(x, C);
|
|
521
|
+
const v = c.current, y = [...v.keys()];
|
|
522
|
+
return y.sort((b, k) => {
|
|
523
|
+
const K = v.get(b), W = v.get(k);
|
|
524
|
+
return !K || !W ? 0 : K.compareDocumentPosition(W) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
525
|
+
}), m.current = y, () => {
|
|
526
|
+
c.current.delete(x), m.current = m.current.filter((b) => b !== x);
|
|
527
|
+
};
|
|
528
|
+
}, []);
|
|
529
|
+
return L(() => {
|
|
530
|
+
const x = s.current;
|
|
531
|
+
if (!x || !t) return;
|
|
532
|
+
function C(v) {
|
|
533
|
+
const y = m.current;
|
|
534
|
+
if (y.length !== 0)
|
|
535
|
+
switch (v.key) {
|
|
536
|
+
case "ArrowDown": {
|
|
537
|
+
v.preventDefault(), n((b) => {
|
|
538
|
+
const k = b ? y.indexOf(b) : -1;
|
|
539
|
+
return y[(k + 1) % y.length];
|
|
540
|
+
});
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
case "ArrowUp": {
|
|
544
|
+
v.preventDefault(), n((b) => {
|
|
545
|
+
const k = b ? y.indexOf(b) : 0;
|
|
546
|
+
return y[(k - 1 + y.length) % y.length];
|
|
547
|
+
});
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
case "Home": {
|
|
551
|
+
v.preventDefault(), n(y[0]);
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
case "End": {
|
|
555
|
+
v.preventDefault(), n(y[y.length - 1]);
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
case "Enter":
|
|
559
|
+
case " ": {
|
|
560
|
+
v.preventDefault();
|
|
561
|
+
const b = c.current;
|
|
562
|
+
n((k) => (k && b.get(k)?.click(), k));
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
case "Escape":
|
|
566
|
+
case "Tab": {
|
|
567
|
+
f();
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return x.addEventListener("keydown", C), () => x.removeEventListener("keydown", C);
|
|
573
|
+
}, [t, f]), {
|
|
574
|
+
ctx: {
|
|
575
|
+
open: t,
|
|
576
|
+
toggle: p,
|
|
577
|
+
close: f,
|
|
578
|
+
menuId: l,
|
|
579
|
+
highlightedId: r,
|
|
580
|
+
setHighlightedId: n,
|
|
581
|
+
registerItem: S,
|
|
582
|
+
triggerRef: d
|
|
583
|
+
},
|
|
584
|
+
rootRef: s
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function At({
|
|
588
|
+
children: t
|
|
589
|
+
}) {
|
|
590
|
+
const {
|
|
591
|
+
ctx: e,
|
|
592
|
+
rootRef: r
|
|
593
|
+
} = $t();
|
|
594
|
+
return /* @__PURE__ */ a(vt.Provider, { value: e, children: /* @__PURE__ */ a(g.div, { ref: r, style: N.root, children: t }) });
|
|
595
|
+
}
|
|
596
|
+
function Ot({
|
|
597
|
+
children: t
|
|
598
|
+
}) {
|
|
599
|
+
const {
|
|
600
|
+
open: e,
|
|
601
|
+
toggle: r,
|
|
602
|
+
menuId: n,
|
|
603
|
+
triggerRef: l
|
|
604
|
+
} = et(), s = w(null);
|
|
605
|
+
return L(() => {
|
|
606
|
+
l.current = s.current;
|
|
607
|
+
}), /* @__PURE__ */ a(g.button, { ref: s, type: "button", onClick: r, "aria-expanded": e, "aria-haspopup": "menu", "aria-controls": e ? n : void 0, style: N.trigger, children: t });
|
|
608
|
+
}
|
|
609
|
+
function Vt({
|
|
610
|
+
children: t,
|
|
611
|
+
align: e = "start"
|
|
612
|
+
}) {
|
|
613
|
+
const {
|
|
614
|
+
open: r,
|
|
615
|
+
close: n,
|
|
616
|
+
menuId: l,
|
|
617
|
+
highlightedId: s
|
|
618
|
+
} = et();
|
|
619
|
+
return r ? /* @__PURE__ */ U(pt, { children: [
|
|
620
|
+
/* @__PURE__ */ a(g.div, { style: N.backdrop, onClick: n }),
|
|
621
|
+
/* @__PURE__ */ a(g.div, { id: l, role: "menu", "aria-activedescendant": s ?? void 0, style: [N.popup, e === "end" && N.popupEnd], children: t })
|
|
622
|
+
] }) : null;
|
|
623
|
+
}
|
|
624
|
+
function Nt({
|
|
625
|
+
onClick: t,
|
|
626
|
+
children: e
|
|
627
|
+
}) {
|
|
628
|
+
const {
|
|
629
|
+
close: r,
|
|
630
|
+
highlightedId: n,
|
|
631
|
+
setHighlightedId: l,
|
|
632
|
+
registerItem: s
|
|
633
|
+
} = et(), d = Y(), c = w(null), m = n === d;
|
|
634
|
+
L(() => {
|
|
635
|
+
const f = c.current;
|
|
636
|
+
if (f)
|
|
637
|
+
return s(d, f);
|
|
638
|
+
}, [d, s]);
|
|
639
|
+
const u = () => {
|
|
640
|
+
t?.(), r();
|
|
641
|
+
};
|
|
642
|
+
return /* @__PURE__ */ a(g.div, { ref: c, id: d, role: "menuitem", onClick: u, onPointerEnter: () => l(d), style: [N.item, m && N.itemHighlighted], children: e });
|
|
643
|
+
}
|
|
644
|
+
function Xt({
|
|
645
|
+
href: t,
|
|
646
|
+
children: e
|
|
647
|
+
}) {
|
|
648
|
+
const {
|
|
649
|
+
close: r,
|
|
650
|
+
highlightedId: n,
|
|
651
|
+
setHighlightedId: l,
|
|
652
|
+
registerItem: s
|
|
653
|
+
} = et(), d = Y(), c = w(null), m = n === d;
|
|
654
|
+
return L(() => {
|
|
655
|
+
const u = c.current;
|
|
656
|
+
if (u)
|
|
657
|
+
return s(d, u);
|
|
658
|
+
}, [d, s]), /* @__PURE__ */ a(g.a, { ref: c, id: d, href: t, onClick: r, role: "menuitem", onPointerEnter: () => l(d), style: [N.item, N.linkItem, m && N.itemHighlighted], children: e });
|
|
659
|
+
}
|
|
660
|
+
const Le = {
|
|
661
|
+
Root: At,
|
|
662
|
+
Trigger: Ot,
|
|
663
|
+
Popup: Vt,
|
|
664
|
+
Item: Nt,
|
|
665
|
+
LinkItem: Xt
|
|
666
|
+
}, E = F.create({
|
|
667
|
+
root: {
|
|
668
|
+
position: "relative",
|
|
669
|
+
overflow: "hidden"
|
|
670
|
+
},
|
|
671
|
+
viewport: {
|
|
672
|
+
width: "100%",
|
|
673
|
+
height: "100%",
|
|
674
|
+
overflowX: "auto",
|
|
675
|
+
overflowY: "auto",
|
|
676
|
+
// Hide native scrollbar
|
|
677
|
+
scrollbarWidth: "none"
|
|
678
|
+
},
|
|
679
|
+
content: {
|
|
680
|
+
minWidth: "100%",
|
|
681
|
+
minHeight: "100%"
|
|
682
|
+
},
|
|
683
|
+
scrollbar: {
|
|
684
|
+
position: "absolute",
|
|
685
|
+
zIndex: 1,
|
|
686
|
+
display: "flex",
|
|
687
|
+
touchAction: "none",
|
|
688
|
+
userSelect: "none",
|
|
689
|
+
transitionProperty: "opacity",
|
|
690
|
+
transitionDuration: "200ms",
|
|
691
|
+
transitionTimingFunction: "ease"
|
|
692
|
+
},
|
|
693
|
+
scrollbarVertical: {
|
|
694
|
+
top: 0,
|
|
695
|
+
right: 0,
|
|
696
|
+
bottom: 0,
|
|
697
|
+
width: 8,
|
|
698
|
+
flexDirection: "column",
|
|
699
|
+
paddingTop: 2,
|
|
700
|
+
paddingBottom: 2,
|
|
701
|
+
paddingRight: 2
|
|
702
|
+
},
|
|
703
|
+
scrollbarHorizontal: {
|
|
704
|
+
left: 0,
|
|
705
|
+
right: 0,
|
|
706
|
+
bottom: 0,
|
|
707
|
+
height: 8,
|
|
708
|
+
flexDirection: "row",
|
|
709
|
+
paddingLeft: 2,
|
|
710
|
+
paddingRight: 2,
|
|
711
|
+
paddingBottom: 2
|
|
712
|
+
},
|
|
713
|
+
scrollbarHidden: {
|
|
714
|
+
opacity: 0
|
|
715
|
+
},
|
|
716
|
+
scrollbarVisible: {
|
|
717
|
+
opacity: 1
|
|
718
|
+
},
|
|
719
|
+
thumb: {
|
|
720
|
+
position: "relative",
|
|
721
|
+
flex: 1,
|
|
722
|
+
backgroundColor: {
|
|
723
|
+
default: o.border,
|
|
724
|
+
":hover": o.textMuted
|
|
725
|
+
},
|
|
726
|
+
borderRadius: D.full,
|
|
727
|
+
transitionProperty: "background-color",
|
|
728
|
+
transitionDuration: "150ms"
|
|
729
|
+
},
|
|
730
|
+
// Dynamic styles — simple identifier params only (StyleX constraint)
|
|
731
|
+
viewportMaxHeight: (t) => ({
|
|
732
|
+
maxHeight: t
|
|
733
|
+
}),
|
|
734
|
+
thumbVertical: (t, e) => ({
|
|
735
|
+
height: t,
|
|
736
|
+
transform: e
|
|
737
|
+
}),
|
|
738
|
+
thumbHorizontal: (t, e) => ({
|
|
739
|
+
width: t,
|
|
740
|
+
transform: e
|
|
741
|
+
})
|
|
742
|
+
}), xt = V(null);
|
|
743
|
+
function ot() {
|
|
744
|
+
const t = $(xt);
|
|
745
|
+
if (!t) throw new Error("ScrollArea compound components must be used within ScrollArea.Root");
|
|
746
|
+
return t;
|
|
747
|
+
}
|
|
748
|
+
function jt() {
|
|
749
|
+
const t = w(null), e = w(null), [r, n] = M(0), [l, s] = M(0), [d, c] = M(0), [m, u] = M(0), [f, p] = M(0), [S, R] = M(0), [x, C] = M(!1), v = w(null), y = B(() => {
|
|
750
|
+
const b = t.current;
|
|
751
|
+
b && (n(b.scrollTop), s(b.scrollLeft), c(b.scrollHeight), u(b.scrollWidth), p(b.clientHeight), R(b.clientWidth), C(!0), v.current && clearTimeout(v.current), v.current = setTimeout(() => C(!1), 1e3));
|
|
752
|
+
}, []);
|
|
753
|
+
return L(() => {
|
|
754
|
+
const b = t.current;
|
|
755
|
+
if (!b) return;
|
|
756
|
+
const k = new ResizeObserver(() => {
|
|
757
|
+
c(b.scrollHeight), u(b.scrollWidth), p(b.clientHeight), R(b.clientWidth);
|
|
758
|
+
});
|
|
759
|
+
return k.observe(b), c(b.scrollHeight), u(b.scrollWidth), p(b.clientHeight), R(b.clientWidth), () => k.disconnect();
|
|
760
|
+
}, []), L(() => {
|
|
761
|
+
const b = t.current;
|
|
762
|
+
if (b)
|
|
763
|
+
return b.addEventListener("scroll", y, {
|
|
764
|
+
passive: !0
|
|
765
|
+
}), () => b.removeEventListener("scroll", y);
|
|
766
|
+
}, [y]), {
|
|
767
|
+
viewportRef: t,
|
|
768
|
+
contentRef: e,
|
|
769
|
+
scrollTop: r,
|
|
770
|
+
scrollLeft: l,
|
|
771
|
+
scrollHeight: d,
|
|
772
|
+
scrollWidth: m,
|
|
773
|
+
clientHeight: f,
|
|
774
|
+
clientWidth: S,
|
|
775
|
+
scrolling: x
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
function Gt({
|
|
779
|
+
children: t
|
|
780
|
+
}) {
|
|
781
|
+
const e = jt();
|
|
782
|
+
return /* @__PURE__ */ a(xt.Provider, { value: e, children: /* @__PURE__ */ a(g.div, { style: E.root, children: t }) });
|
|
783
|
+
}
|
|
784
|
+
function Yt({
|
|
785
|
+
children: t,
|
|
786
|
+
maxHeight: e
|
|
787
|
+
}) {
|
|
788
|
+
const {
|
|
789
|
+
viewportRef: r
|
|
790
|
+
} = ot();
|
|
791
|
+
return /* @__PURE__ */ a(g.div, { ref: r, style: [E.viewport, e != null && E.viewportMaxHeight(e)], children: t });
|
|
792
|
+
}
|
|
793
|
+
function Ut({
|
|
794
|
+
children: t
|
|
795
|
+
}) {
|
|
796
|
+
const {
|
|
797
|
+
contentRef: e
|
|
798
|
+
} = ot();
|
|
799
|
+
return /* @__PURE__ */ a(g.div, { ref: e, style: E.content, children: t });
|
|
800
|
+
}
|
|
801
|
+
function Kt({
|
|
802
|
+
orientation: t = "vertical",
|
|
803
|
+
children: e
|
|
804
|
+
}) {
|
|
805
|
+
const {
|
|
806
|
+
scrolling: r,
|
|
807
|
+
scrollHeight: n,
|
|
808
|
+
scrollWidth: l,
|
|
809
|
+
clientHeight: s,
|
|
810
|
+
clientWidth: d
|
|
811
|
+
} = ot();
|
|
812
|
+
return (t === "vertical" ? n > s : l > d) ? /* @__PURE__ */ a(g.div, { style: [E.scrollbar, t === "vertical" ? E.scrollbarVertical : E.scrollbarHorizontal, r ? E.scrollbarVisible : E.scrollbarHidden], children: e }) : null;
|
|
813
|
+
}
|
|
814
|
+
function _t({
|
|
815
|
+
orientation: t = "vertical"
|
|
816
|
+
}) {
|
|
817
|
+
const {
|
|
818
|
+
viewportRef: e,
|
|
819
|
+
scrollTop: r,
|
|
820
|
+
scrollLeft: n,
|
|
821
|
+
scrollHeight: l,
|
|
822
|
+
scrollWidth: s,
|
|
823
|
+
clientHeight: d,
|
|
824
|
+
clientWidth: c
|
|
825
|
+
} = ot(), m = w(!1), u = w(0), f = w(0), p = t === "vertical", S = Math.max(p ? d / l * 100 : c / s * 100, 10), R = p ? l - d : s - c, x = p ? d : c, C = S / 100 * x, v = p ? r : n, y = R > 0 ? v / R * (x - C) : 0, b = p ? E.thumbVertical(`${S}%`, `translateY(${y}px)`) : E.thumbHorizontal(`${S}%`, `translateX(${y}px)`), k = B((H) => {
|
|
826
|
+
H.preventDefault(), m.current = !0, u.current = p ? H.clientY : H.clientX, f.current = p ? e.current?.scrollTop ?? 0 : e.current?.scrollLeft ?? 0, H.target.setPointerCapture(H.pointerId);
|
|
827
|
+
}, [p, e]), K = B((H) => {
|
|
828
|
+
if (!m.current) return;
|
|
829
|
+
const T = e.current;
|
|
830
|
+
if (!T) return;
|
|
831
|
+
const I = (p ? H.clientY : H.clientX) - u.current, X = R / (x - C), z = I * X;
|
|
832
|
+
p ? T.scrollTop = f.current + z : T.scrollLeft = f.current + z;
|
|
833
|
+
}, [p, R, x, C, e]), W = B(() => {
|
|
834
|
+
m.current = !1;
|
|
835
|
+
}, []);
|
|
836
|
+
return /* @__PURE__ */ a(g.div, { onPointerDown: k, onPointerMove: K, onPointerUp: W, style: [E.thumb, b] });
|
|
837
|
+
}
|
|
838
|
+
const Pe = {
|
|
839
|
+
Root: Gt,
|
|
840
|
+
Viewport: Yt,
|
|
841
|
+
Content: Ut,
|
|
842
|
+
Scrollbar: Kt,
|
|
843
|
+
Thumb: _t
|
|
844
|
+
}, O = F.create({
|
|
845
|
+
root: {
|
|
846
|
+
position: "relative",
|
|
847
|
+
display: "inline-flex"
|
|
848
|
+
},
|
|
849
|
+
trigger: {
|
|
850
|
+
display: "inline-flex",
|
|
851
|
+
alignItems: "center",
|
|
852
|
+
justifyContent: "space-between",
|
|
853
|
+
gap: i.sm,
|
|
854
|
+
paddingTop: i.sm,
|
|
855
|
+
paddingBottom: i.sm,
|
|
856
|
+
paddingLeft: i.md,
|
|
857
|
+
paddingRight: i.md,
|
|
858
|
+
fontFamily: h.fontFamily,
|
|
859
|
+
fontSize: h.fontSizeSm,
|
|
860
|
+
color: o.text,
|
|
861
|
+
backgroundColor: o.bgCard,
|
|
862
|
+
borderWidth: 1,
|
|
863
|
+
borderStyle: "solid",
|
|
864
|
+
borderColor: {
|
|
865
|
+
default: o.border,
|
|
866
|
+
":hover": o.accent
|
|
867
|
+
},
|
|
868
|
+
borderRadius: D.sm,
|
|
869
|
+
cursor: "pointer",
|
|
870
|
+
transitionProperty: "border-color",
|
|
871
|
+
transitionDuration: "150ms"
|
|
872
|
+
},
|
|
873
|
+
value: {
|
|
874
|
+
color: o.text
|
|
875
|
+
},
|
|
876
|
+
placeholder: {
|
|
877
|
+
color: o.textMuted
|
|
878
|
+
},
|
|
879
|
+
icon: {
|
|
880
|
+
display: "flex",
|
|
881
|
+
alignItems: "center",
|
|
882
|
+
color: o.textMuted
|
|
883
|
+
},
|
|
884
|
+
backdrop: {
|
|
885
|
+
position: "fixed",
|
|
886
|
+
top: 0,
|
|
887
|
+
left: 0,
|
|
888
|
+
right: 0,
|
|
889
|
+
bottom: 0,
|
|
890
|
+
zIndex: 49
|
|
891
|
+
},
|
|
892
|
+
popup: {
|
|
893
|
+
position: "absolute",
|
|
894
|
+
top: "100%",
|
|
895
|
+
left: 0,
|
|
896
|
+
marginTop: i.xs,
|
|
897
|
+
backgroundColor: o.bgCard,
|
|
898
|
+
borderWidth: 1,
|
|
899
|
+
borderStyle: "solid",
|
|
900
|
+
borderColor: o.border,
|
|
901
|
+
borderRadius: D.sm,
|
|
902
|
+
boxShadow: Q.md,
|
|
903
|
+
paddingTop: i.xs,
|
|
904
|
+
paddingBottom: i.xs,
|
|
905
|
+
minWidth: 120,
|
|
906
|
+
zIndex: 50
|
|
907
|
+
},
|
|
908
|
+
item: {
|
|
909
|
+
display: "flex",
|
|
910
|
+
alignItems: "center",
|
|
911
|
+
paddingTop: i.sm,
|
|
912
|
+
paddingBottom: i.sm,
|
|
913
|
+
paddingLeft: i.md,
|
|
914
|
+
paddingRight: i.md,
|
|
915
|
+
fontSize: h.fontSizeSm,
|
|
916
|
+
fontFamily: h.fontFamily,
|
|
917
|
+
color: o.text,
|
|
918
|
+
borderRadius: D.sm,
|
|
919
|
+
cursor: "pointer",
|
|
920
|
+
backgroundColor: "transparent",
|
|
921
|
+
transitionProperty: "background-color",
|
|
922
|
+
transitionDuration: "150ms"
|
|
923
|
+
},
|
|
924
|
+
itemSelected: {
|
|
925
|
+
color: o.accent,
|
|
926
|
+
fontWeight: h.fontWeightMedium
|
|
927
|
+
},
|
|
928
|
+
itemHighlighted: {
|
|
929
|
+
backgroundColor: o.bgCardHover
|
|
930
|
+
},
|
|
931
|
+
hidden: {
|
|
932
|
+
display: "none"
|
|
933
|
+
}
|
|
934
|
+
}), yt = V(null);
|
|
935
|
+
function rt() {
|
|
936
|
+
const t = $(yt);
|
|
937
|
+
if (!t) throw new Error("Select compound components must be used within Select.Root");
|
|
938
|
+
return t;
|
|
939
|
+
}
|
|
940
|
+
function lt(t, e, r) {
|
|
941
|
+
const [n, l] = M(e), s = t !== void 0 ? t : n, d = B((c) => {
|
|
942
|
+
t === void 0 && l(c), r?.(c);
|
|
943
|
+
}, [t, r]);
|
|
944
|
+
return [s, d];
|
|
945
|
+
}
|
|
946
|
+
function qt({
|
|
947
|
+
defaultValue: t,
|
|
948
|
+
value: e,
|
|
949
|
+
onValueChange: r
|
|
950
|
+
}) {
|
|
951
|
+
const [n, l] = lt(e, t ?? null, r), [s, d] = M(!1), [c, m] = M({}), [u, f] = M(null), p = Y(), S = w(null), R = w(null), x = w(/* @__PURE__ */ new Map()), C = w([]), v = B(() => {
|
|
952
|
+
d(!1), f(null), R.current?.focus();
|
|
953
|
+
}, []), y = B(() => {
|
|
954
|
+
d((W) => {
|
|
955
|
+
if (W)
|
|
956
|
+
f(null);
|
|
957
|
+
else {
|
|
958
|
+
const H = x.current, T = C.current;
|
|
959
|
+
let I = null;
|
|
960
|
+
for (const X of T) {
|
|
961
|
+
const z = H.get(X);
|
|
962
|
+
if (z && z.value === n) {
|
|
963
|
+
I = X;
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
f(I ?? (T.length > 0 ? T[0] : null));
|
|
968
|
+
}
|
|
969
|
+
return !W;
|
|
970
|
+
});
|
|
971
|
+
}, [n]), b = B((W, H) => {
|
|
972
|
+
m((T) => T[W] === H ? T : {
|
|
973
|
+
...T,
|
|
974
|
+
[W]: H
|
|
975
|
+
});
|
|
976
|
+
}, []), k = B((W, H, T) => {
|
|
977
|
+
x.current.set(W, {
|
|
978
|
+
value: H,
|
|
979
|
+
element: T
|
|
980
|
+
});
|
|
981
|
+
const I = x.current, X = [...I.keys()];
|
|
982
|
+
return X.sort((z, j) => {
|
|
983
|
+
const at = I.get(z)?.element, ut = I.get(j)?.element;
|
|
984
|
+
return !at || !ut ? 0 : at.compareDocumentPosition(ut) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
985
|
+
}), C.current = X, () => {
|
|
986
|
+
x.current.delete(W), C.current = C.current.filter((z) => z !== W);
|
|
987
|
+
};
|
|
988
|
+
}, []);
|
|
989
|
+
return L(() => {
|
|
990
|
+
const W = S.current;
|
|
991
|
+
if (!W || !s) return;
|
|
992
|
+
function H(T) {
|
|
993
|
+
const I = C.current, X = x.current;
|
|
994
|
+
if (I.length !== 0)
|
|
995
|
+
switch (T.key) {
|
|
996
|
+
case "ArrowDown": {
|
|
997
|
+
T.preventDefault(), f((z) => {
|
|
998
|
+
const j = z ? I.indexOf(z) : -1;
|
|
999
|
+
return I[(j + 1) % I.length];
|
|
1000
|
+
});
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
case "ArrowUp": {
|
|
1004
|
+
T.preventDefault(), f((z) => {
|
|
1005
|
+
const j = z ? I.indexOf(z) : 0;
|
|
1006
|
+
return I[(j - 1 + I.length) % I.length];
|
|
1007
|
+
});
|
|
1008
|
+
break;
|
|
1009
|
+
}
|
|
1010
|
+
case "Home": {
|
|
1011
|
+
T.preventDefault(), f(I[0]);
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
case "End": {
|
|
1015
|
+
T.preventDefault(), f(I[I.length - 1]);
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
case "Enter":
|
|
1019
|
+
case " ": {
|
|
1020
|
+
T.preventDefault(), f((z) => {
|
|
1021
|
+
if (z) {
|
|
1022
|
+
const j = X.get(z);
|
|
1023
|
+
j && (l(j.value), v());
|
|
1024
|
+
}
|
|
1025
|
+
return z;
|
|
1026
|
+
});
|
|
1027
|
+
break;
|
|
1028
|
+
}
|
|
1029
|
+
case "Escape":
|
|
1030
|
+
case "Tab": {
|
|
1031
|
+
v();
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
return W.addEventListener("keydown", H), () => W.removeEventListener("keydown", H);
|
|
1037
|
+
}, [s, v, l]), {
|
|
1038
|
+
ctx: ht(() => ({
|
|
1039
|
+
open: s,
|
|
1040
|
+
toggle: y,
|
|
1041
|
+
close: v,
|
|
1042
|
+
value: n,
|
|
1043
|
+
setValue: l,
|
|
1044
|
+
labels: c,
|
|
1045
|
+
registerLabel: b,
|
|
1046
|
+
listboxId: p,
|
|
1047
|
+
highlightedId: u,
|
|
1048
|
+
setHighlightedId: f,
|
|
1049
|
+
registerItem: k,
|
|
1050
|
+
triggerRef: R
|
|
1051
|
+
}), [s, y, v, n, l, c, b, p, u, f, k]),
|
|
1052
|
+
rootRef: S
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
function Jt({
|
|
1056
|
+
name: t,
|
|
1057
|
+
defaultValue: e,
|
|
1058
|
+
value: r,
|
|
1059
|
+
onValueChange: n,
|
|
1060
|
+
children: l
|
|
1061
|
+
}) {
|
|
1062
|
+
const {
|
|
1063
|
+
ctx: s,
|
|
1064
|
+
rootRef: d
|
|
1065
|
+
} = qt({
|
|
1066
|
+
defaultValue: e,
|
|
1067
|
+
value: r,
|
|
1068
|
+
onValueChange: n
|
|
1069
|
+
});
|
|
1070
|
+
return /* @__PURE__ */ a(yt.Provider, { value: s, children: /* @__PURE__ */ U(g.div, { ref: d, style: O.root, children: [
|
|
1071
|
+
t && /* @__PURE__ */ a(g.input, { type: "hidden", name: t, value: s.value ?? "" }),
|
|
1072
|
+
l
|
|
1073
|
+
] }) });
|
|
1074
|
+
}
|
|
1075
|
+
function Qt({
|
|
1076
|
+
children: t
|
|
1077
|
+
}) {
|
|
1078
|
+
const {
|
|
1079
|
+
open: e,
|
|
1080
|
+
toggle: r,
|
|
1081
|
+
listboxId: n,
|
|
1082
|
+
highlightedId: l,
|
|
1083
|
+
triggerRef: s
|
|
1084
|
+
} = rt(), d = w(null);
|
|
1085
|
+
return L(() => {
|
|
1086
|
+
s.current = d.current;
|
|
1087
|
+
}), /* @__PURE__ */ a(g.button, { ref: d, type: "button", role: "combobox", onClick: r, "aria-expanded": e, "aria-haspopup": "listbox", "aria-controls": e ? n : void 0, "aria-activedescendant": l ?? void 0, style: O.trigger, children: t });
|
|
1088
|
+
}
|
|
1089
|
+
function Zt({
|
|
1090
|
+
placeholder: t
|
|
1091
|
+
}) {
|
|
1092
|
+
const {
|
|
1093
|
+
value: e,
|
|
1094
|
+
labels: r
|
|
1095
|
+
} = rt(), n = e ? r[e] ?? e : null;
|
|
1096
|
+
return /* @__PURE__ */ a(g.span, { style: n ? O.value : O.placeholder, children: n ?? t });
|
|
1097
|
+
}
|
|
1098
|
+
function te({
|
|
1099
|
+
children: t
|
|
1100
|
+
}) {
|
|
1101
|
+
return /* @__PURE__ */ a(g.span, { style: O.icon, children: t ?? /* @__PURE__ */ a("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M6 9l6 6 6-6" }) }) });
|
|
1102
|
+
}
|
|
1103
|
+
function ee({
|
|
1104
|
+
children: t
|
|
1105
|
+
}) {
|
|
1106
|
+
const {
|
|
1107
|
+
open: e,
|
|
1108
|
+
close: r,
|
|
1109
|
+
listboxId: n
|
|
1110
|
+
} = rt();
|
|
1111
|
+
return /* @__PURE__ */ U(pt, { children: [
|
|
1112
|
+
e && /* @__PURE__ */ a(g.div, { style: O.backdrop, onClick: r }),
|
|
1113
|
+
/* @__PURE__ */ a(g.div, { id: n, role: "listbox", "aria-hidden": !e, style: [O.popup, !e && O.hidden], children: t })
|
|
1114
|
+
] });
|
|
1115
|
+
}
|
|
1116
|
+
function oe({
|
|
1117
|
+
value: t,
|
|
1118
|
+
children: e
|
|
1119
|
+
}) {
|
|
1120
|
+
const {
|
|
1121
|
+
value: r,
|
|
1122
|
+
setValue: n,
|
|
1123
|
+
close: l,
|
|
1124
|
+
registerLabel: s,
|
|
1125
|
+
highlightedId: d,
|
|
1126
|
+
setHighlightedId: c,
|
|
1127
|
+
registerItem: m
|
|
1128
|
+
} = rt(), u = Y(), f = w(null), p = r === t, S = d === u;
|
|
1129
|
+
L(() => {
|
|
1130
|
+
const x = f.current;
|
|
1131
|
+
if (!x) return;
|
|
1132
|
+
const C = x.textContent;
|
|
1133
|
+
C && s(t, C);
|
|
1134
|
+
}, [t, s]), L(() => {
|
|
1135
|
+
const x = f.current;
|
|
1136
|
+
if (x)
|
|
1137
|
+
return m(u, t, x);
|
|
1138
|
+
}, [u, t, m]);
|
|
1139
|
+
const R = () => {
|
|
1140
|
+
n(t), l();
|
|
1141
|
+
};
|
|
1142
|
+
return /* @__PURE__ */ a(g.div, { ref: f, id: u, role: "option", "aria-selected": p, onClick: R, onPointerEnter: () => c(u), style: [O.item, p && O.itemSelected, S && O.itemHighlighted], children: e });
|
|
1143
|
+
}
|
|
1144
|
+
function re({
|
|
1145
|
+
children: t
|
|
1146
|
+
}) {
|
|
1147
|
+
return /* @__PURE__ */ a(g.span, { children: t });
|
|
1148
|
+
}
|
|
1149
|
+
const Me = {
|
|
1150
|
+
Root: Jt,
|
|
1151
|
+
Trigger: Qt,
|
|
1152
|
+
Value: Zt,
|
|
1153
|
+
Icon: te,
|
|
1154
|
+
Popup: ee,
|
|
1155
|
+
Item: oe,
|
|
1156
|
+
ItemText: re
|
|
1157
|
+
}, G = F.create({
|
|
1158
|
+
root: {
|
|
1159
|
+
display: "flex",
|
|
1160
|
+
flexDirection: "column",
|
|
1161
|
+
gap: 0
|
|
1162
|
+
},
|
|
1163
|
+
group: {
|
|
1164
|
+
display: "flex",
|
|
1165
|
+
flexDirection: "column"
|
|
1166
|
+
},
|
|
1167
|
+
groupTrigger: {
|
|
1168
|
+
display: "flex",
|
|
1169
|
+
alignItems: "center",
|
|
1170
|
+
gap: i.xs,
|
|
1171
|
+
paddingTop: i.sm,
|
|
1172
|
+
paddingBottom: i.sm,
|
|
1173
|
+
paddingLeft: i.md,
|
|
1174
|
+
paddingRight: i.md,
|
|
1175
|
+
fontFamily: h.fontFamily,
|
|
1176
|
+
fontSize: h.fontSizeXs,
|
|
1177
|
+
fontWeight: h.fontWeightSemibold,
|
|
1178
|
+
textTransform: "uppercase",
|
|
1179
|
+
letterSpacing: "0.05em",
|
|
1180
|
+
color: {
|
|
1181
|
+
default: o.textMuted,
|
|
1182
|
+
":hover": o.text
|
|
1183
|
+
},
|
|
1184
|
+
backgroundColor: "transparent",
|
|
1185
|
+
borderWidth: 0,
|
|
1186
|
+
cursor: "pointer",
|
|
1187
|
+
transitionProperty: "color",
|
|
1188
|
+
transitionDuration: "150ms",
|
|
1189
|
+
transitionTimingFunction: "ease"
|
|
1190
|
+
},
|
|
1191
|
+
groupTriggerActive: {
|
|
1192
|
+
color: o.text
|
|
1193
|
+
},
|
|
1194
|
+
chevron: {
|
|
1195
|
+
display: "inline-flex",
|
|
1196
|
+
alignItems: "center",
|
|
1197
|
+
transitionProperty: "transform",
|
|
1198
|
+
transitionDuration: "150ms",
|
|
1199
|
+
transitionTimingFunction: "ease"
|
|
1200
|
+
},
|
|
1201
|
+
chevronOpen: {
|
|
1202
|
+
transform: "rotate(90deg)"
|
|
1203
|
+
},
|
|
1204
|
+
item: {
|
|
1205
|
+
display: "flex",
|
|
1206
|
+
alignItems: "center",
|
|
1207
|
+
paddingTop: "6px",
|
|
1208
|
+
paddingBottom: "6px",
|
|
1209
|
+
paddingLeft: i.lg,
|
|
1210
|
+
paddingRight: i.md,
|
|
1211
|
+
fontFamily: h.fontFamily,
|
|
1212
|
+
fontSize: h.fontSizeSm,
|
|
1213
|
+
fontWeight: h.fontWeightNormal,
|
|
1214
|
+
color: {
|
|
1215
|
+
default: o.textMuted,
|
|
1216
|
+
":hover": o.text
|
|
1217
|
+
},
|
|
1218
|
+
backgroundColor: {
|
|
1219
|
+
default: "transparent",
|
|
1220
|
+
":hover": o.bgCardHover
|
|
1221
|
+
},
|
|
1222
|
+
borderWidth: 0,
|
|
1223
|
+
borderRadius: D.sm,
|
|
1224
|
+
cursor: "pointer",
|
|
1225
|
+
transitionProperty: "color, background-color",
|
|
1226
|
+
transitionDuration: "150ms",
|
|
1227
|
+
transitionTimingFunction: "ease",
|
|
1228
|
+
textAlign: "left",
|
|
1229
|
+
outlineWidth: {
|
|
1230
|
+
default: 0,
|
|
1231
|
+
":focus-visible": 2
|
|
1232
|
+
},
|
|
1233
|
+
outlineStyle: {
|
|
1234
|
+
default: "none",
|
|
1235
|
+
":focus-visible": "solid"
|
|
1236
|
+
},
|
|
1237
|
+
outlineColor: {
|
|
1238
|
+
default: "transparent",
|
|
1239
|
+
":focus-visible": o.accent
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
itemActive: {
|
|
1243
|
+
color: o.accent,
|
|
1244
|
+
fontWeight: h.fontWeightMedium
|
|
1245
|
+
}
|
|
1246
|
+
}), Ct = V(null);
|
|
1247
|
+
function St() {
|
|
1248
|
+
const t = $(Ct);
|
|
1249
|
+
if (!t) throw new Error("SideNav compound components must be used within SideNav.Root");
|
|
1250
|
+
return t;
|
|
1251
|
+
}
|
|
1252
|
+
function ne({
|
|
1253
|
+
children: t,
|
|
1254
|
+
value: e,
|
|
1255
|
+
defaultValue: r,
|
|
1256
|
+
onValueChange: n
|
|
1257
|
+
}) {
|
|
1258
|
+
const [l, s] = lt(e, r ?? null, n ? (p) => {
|
|
1259
|
+
p !== null && n(p);
|
|
1260
|
+
} : void 0), [d, c] = M(/* @__PURE__ */ new Set()), m = w([]), u = B((p) => {
|
|
1261
|
+
c((S) => {
|
|
1262
|
+
const R = new Set(S);
|
|
1263
|
+
return R.has(p) ? R.delete(p) : R.add(p), R;
|
|
1264
|
+
});
|
|
1265
|
+
}, []), f = B((p) => (m.current.includes(p) || m.current.push(p), () => {
|
|
1266
|
+
m.current = m.current.filter((S) => S !== p);
|
|
1267
|
+
}), []);
|
|
1268
|
+
return L(() => {
|
|
1269
|
+
l && c((p) => p);
|
|
1270
|
+
}, [l]), /* @__PURE__ */ a(Ct.Provider, { value: {
|
|
1271
|
+
activeValue: l,
|
|
1272
|
+
onSelect: s,
|
|
1273
|
+
expandedGroups: d,
|
|
1274
|
+
toggleGroup: u,
|
|
1275
|
+
registerItem: f,
|
|
1276
|
+
orderRef: m
|
|
1277
|
+
}, children: /* @__PURE__ */ a(g.nav, { role: "navigation", style: G.root, children: t }) });
|
|
1278
|
+
}
|
|
1279
|
+
function ie({
|
|
1280
|
+
children: t,
|
|
1281
|
+
label: e,
|
|
1282
|
+
groupKey: r,
|
|
1283
|
+
defaultExpanded: n
|
|
1284
|
+
}) {
|
|
1285
|
+
const l = r ?? e, {
|
|
1286
|
+
expandedGroups: s,
|
|
1287
|
+
toggleGroup: d,
|
|
1288
|
+
activeValue: c
|
|
1289
|
+
} = St(), m = s.has(l), u = w(null);
|
|
1290
|
+
L(() => {
|
|
1291
|
+
if (!c || s.has(l)) return;
|
|
1292
|
+
const p = u.current;
|
|
1293
|
+
if (!p) return;
|
|
1294
|
+
p.querySelector(`[data-nav-value="${c}"]`) && d(l);
|
|
1295
|
+
}, [c, l, s, d]), L(() => {
|
|
1296
|
+
n && !s.has(l) && d(l);
|
|
1297
|
+
}, []);
|
|
1298
|
+
const f = !c || !u.current ? !1 : !!u.current.querySelector(`[data-nav-value="${c}"]`);
|
|
1299
|
+
return /* @__PURE__ */ U(g.div, { ref: u, style: G.group, children: [
|
|
1300
|
+
/* @__PURE__ */ U(g.button, { type: "button", onClick: () => d(l), style: [G.groupTrigger, f && G.groupTriggerActive], "aria-expanded": m, children: [
|
|
1301
|
+
/* @__PURE__ */ a(g.span, { style: [G.chevron, m && G.chevronOpen], children: /* @__PURE__ */ a("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M9 18l6-6-6-6" }) }) }),
|
|
1302
|
+
e
|
|
1303
|
+
] }),
|
|
1304
|
+
m && t
|
|
1305
|
+
] });
|
|
1306
|
+
}
|
|
1307
|
+
function le({
|
|
1308
|
+
value: t,
|
|
1309
|
+
children: e
|
|
1310
|
+
}) {
|
|
1311
|
+
const {
|
|
1312
|
+
activeValue: r,
|
|
1313
|
+
onSelect: n,
|
|
1314
|
+
registerItem: l
|
|
1315
|
+
} = St(), s = r === t;
|
|
1316
|
+
return L(() => l(t), [t, l]), /* @__PURE__ */ a(g.button, { type: "button", "data-nav-value": t, onClick: () => n(t), style: [G.item, s && G.itemActive], "aria-current": s ? "page" : void 0, children: e });
|
|
1317
|
+
}
|
|
1318
|
+
const Fe = {
|
|
1319
|
+
Root: ne,
|
|
1320
|
+
Group: ie,
|
|
1321
|
+
Item: le
|
|
1322
|
+
}, P = F.create({
|
|
1323
|
+
// Root
|
|
1324
|
+
root: {
|
|
1325
|
+
borderWidth: 1,
|
|
1326
|
+
borderStyle: "solid",
|
|
1327
|
+
borderColor: o.border,
|
|
1328
|
+
borderRadius: D.md,
|
|
1329
|
+
overflow: "hidden",
|
|
1330
|
+
backgroundColor: o.bgCard,
|
|
1331
|
+
fontFamily: h.fontFamily,
|
|
1332
|
+
color: o.text
|
|
1333
|
+
},
|
|
1334
|
+
// Header group
|
|
1335
|
+
header: {
|
|
1336
|
+
backgroundColor: o.bgCard
|
|
1337
|
+
},
|
|
1338
|
+
// Row
|
|
1339
|
+
row: {
|
|
1340
|
+
display: "grid",
|
|
1341
|
+
borderBottomWidth: 1,
|
|
1342
|
+
borderBottomStyle: "solid",
|
|
1343
|
+
borderBottomColor: o.border
|
|
1344
|
+
},
|
|
1345
|
+
rowLastChild: {
|
|
1346
|
+
borderBottomWidth: 0
|
|
1347
|
+
},
|
|
1348
|
+
bodyRow: {
|
|
1349
|
+
backgroundColor: {
|
|
1350
|
+
default: "transparent",
|
|
1351
|
+
":hover": o.bgCardHover
|
|
1352
|
+
},
|
|
1353
|
+
transitionProperty: "background-color",
|
|
1354
|
+
transitionDuration: "150ms",
|
|
1355
|
+
transitionTimingFunction: "ease"
|
|
1356
|
+
},
|
|
1357
|
+
// Header cell
|
|
1358
|
+
headerCell: {
|
|
1359
|
+
fontWeight: h.fontWeightSemibold,
|
|
1360
|
+
color: o.textMuted,
|
|
1361
|
+
textAlign: "start"
|
|
1362
|
+
},
|
|
1363
|
+
// Body cell
|
|
1364
|
+
cell: {
|
|
1365
|
+
color: o.text,
|
|
1366
|
+
display: "flex",
|
|
1367
|
+
alignItems: "center"
|
|
1368
|
+
},
|
|
1369
|
+
// Size: sm
|
|
1370
|
+
cellSm: {
|
|
1371
|
+
paddingTop: i.xs,
|
|
1372
|
+
paddingBottom: i.xs,
|
|
1373
|
+
paddingLeft: i.sm,
|
|
1374
|
+
paddingRight: i.sm,
|
|
1375
|
+
fontSize: h.fontSizeXs
|
|
1376
|
+
},
|
|
1377
|
+
// Size: md
|
|
1378
|
+
cellMd: {
|
|
1379
|
+
paddingTop: i.sm,
|
|
1380
|
+
paddingBottom: i.sm,
|
|
1381
|
+
paddingLeft: i.md,
|
|
1382
|
+
paddingRight: i.md,
|
|
1383
|
+
fontSize: h.fontSizeSm
|
|
1384
|
+
},
|
|
1385
|
+
// Variant: striped (even body rows)
|
|
1386
|
+
stripedEven: {
|
|
1387
|
+
backgroundColor: {
|
|
1388
|
+
default: o.bgCardHover,
|
|
1389
|
+
":hover": o.bgCardHover
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
// Variant: bordered (cells get side borders)
|
|
1393
|
+
borderedCell: {
|
|
1394
|
+
borderRightWidth: 1,
|
|
1395
|
+
borderRightStyle: "solid",
|
|
1396
|
+
borderRightColor: o.border
|
|
1397
|
+
},
|
|
1398
|
+
borderedCellLast: {
|
|
1399
|
+
borderRightWidth: 0
|
|
1400
|
+
},
|
|
1401
|
+
// Dynamic styles — simple identifier params only (StyleX constraint)
|
|
1402
|
+
gridColumns: (t) => ({
|
|
1403
|
+
gridTemplateColumns: `repeat(${t}, 1fr)`
|
|
1404
|
+
})
|
|
1405
|
+
}), wt = V(null);
|
|
1406
|
+
function nt() {
|
|
1407
|
+
const t = $(wt);
|
|
1408
|
+
if (!t) throw new Error("Table compound components must be used within Table.Root");
|
|
1409
|
+
return t;
|
|
1410
|
+
}
|
|
1411
|
+
const st = V(!1);
|
|
1412
|
+
function se({
|
|
1413
|
+
children: t,
|
|
1414
|
+
variant: e = "default",
|
|
1415
|
+
size: r = "md",
|
|
1416
|
+
columns: n
|
|
1417
|
+
}) {
|
|
1418
|
+
return /* @__PURE__ */ a(wt.Provider, { value: {
|
|
1419
|
+
variant: e,
|
|
1420
|
+
size: r,
|
|
1421
|
+
columns: n,
|
|
1422
|
+
isHeader: !1
|
|
1423
|
+
}, children: /* @__PURE__ */ a(g.div, { role: "table", style: P.root, children: t }) });
|
|
1424
|
+
}
|
|
1425
|
+
function de({
|
|
1426
|
+
children: t
|
|
1427
|
+
}) {
|
|
1428
|
+
return /* @__PURE__ */ a(st.Provider, { value: !0, children: /* @__PURE__ */ a(g.div, { role: "rowgroup", style: P.header, children: t }) });
|
|
1429
|
+
}
|
|
1430
|
+
function ce({
|
|
1431
|
+
children: t
|
|
1432
|
+
}) {
|
|
1433
|
+
const {
|
|
1434
|
+
variant: e
|
|
1435
|
+
} = nt(), r = mt.toArray(t);
|
|
1436
|
+
return /* @__PURE__ */ a(st.Provider, { value: !1, children: /* @__PURE__ */ a(g.div, { role: "rowgroup", children: r.map((n, l) => e === "striped" ? /* @__PURE__ */ a(Rt.Provider, { value: l, children: n }, l) : n) }) });
|
|
1437
|
+
}
|
|
1438
|
+
const Rt = V(-1);
|
|
1439
|
+
function ae({
|
|
1440
|
+
children: t
|
|
1441
|
+
}) {
|
|
1442
|
+
const {
|
|
1443
|
+
variant: e,
|
|
1444
|
+
columns: r
|
|
1445
|
+
} = nt(), n = $(st), l = $(Rt), s = l >= 0 && l % 2 === 1, d = mt.toArray(t);
|
|
1446
|
+
return /* @__PURE__ */ a(g.div, { role: "row", style: [P.row, P.gridColumns(r), !n && P.bodyRow, !n && e === "striped" && s && P.stripedEven], children: e === "bordered" ? d.map((c, m) => /* @__PURE__ */ a(dt.Provider, { value: {
|
|
1447
|
+
index: m,
|
|
1448
|
+
total: d.length
|
|
1449
|
+
}, children: c }, m)) : t });
|
|
1450
|
+
}
|
|
1451
|
+
const dt = V({
|
|
1452
|
+
index: 0,
|
|
1453
|
+
total: 0
|
|
1454
|
+
});
|
|
1455
|
+
function ue({
|
|
1456
|
+
children: t
|
|
1457
|
+
}) {
|
|
1458
|
+
const {
|
|
1459
|
+
size: e,
|
|
1460
|
+
variant: r
|
|
1461
|
+
} = nt(), {
|
|
1462
|
+
index: n,
|
|
1463
|
+
total: l
|
|
1464
|
+
} = $(dt), s = r === "bordered" && n === l - 1;
|
|
1465
|
+
return /* @__PURE__ */ a(g.div, { role: "columnheader", style: [P.headerCell, e === "sm" ? P.cellSm : P.cellMd, r === "bordered" && P.borderedCell, s && P.borderedCellLast], children: t });
|
|
1466
|
+
}
|
|
1467
|
+
function fe({
|
|
1468
|
+
children: t
|
|
1469
|
+
}) {
|
|
1470
|
+
const {
|
|
1471
|
+
size: e,
|
|
1472
|
+
variant: r
|
|
1473
|
+
} = nt(), {
|
|
1474
|
+
index: n,
|
|
1475
|
+
total: l
|
|
1476
|
+
} = $(dt), s = r === "bordered" && n === l - 1;
|
|
1477
|
+
return /* @__PURE__ */ a(g.div, { role: "cell", style: [P.cell, e === "sm" ? P.cellSm : P.cellMd, r === "bordered" && P.borderedCell, s && P.borderedCellLast], children: t });
|
|
1478
|
+
}
|
|
1479
|
+
const Ee = {
|
|
1480
|
+
Root: se,
|
|
1481
|
+
Header: de,
|
|
1482
|
+
Body: ce,
|
|
1483
|
+
Row: ae,
|
|
1484
|
+
HeaderCell: ue,
|
|
1485
|
+
Cell: fe
|
|
1486
|
+
}, A = F.create({
|
|
1487
|
+
root: {
|
|
1488
|
+
display: "flex",
|
|
1489
|
+
flexDirection: "column"
|
|
1490
|
+
},
|
|
1491
|
+
rootVertical: {
|
|
1492
|
+
flexDirection: "row"
|
|
1493
|
+
},
|
|
1494
|
+
list: {
|
|
1495
|
+
display: "flex",
|
|
1496
|
+
flexDirection: "row",
|
|
1497
|
+
borderBottomWidth: 1,
|
|
1498
|
+
borderBottomStyle: "solid",
|
|
1499
|
+
borderBottomColor: o.border,
|
|
1500
|
+
gap: i.xs
|
|
1501
|
+
},
|
|
1502
|
+
listVertical: {
|
|
1503
|
+
flexDirection: "column",
|
|
1504
|
+
borderBottomWidth: 0,
|
|
1505
|
+
borderRightWidth: 1,
|
|
1506
|
+
borderRightStyle: "solid",
|
|
1507
|
+
borderRightColor: o.border,
|
|
1508
|
+
gap: 0
|
|
1509
|
+
},
|
|
1510
|
+
tab: {
|
|
1511
|
+
display: "inline-flex",
|
|
1512
|
+
alignItems: "center",
|
|
1513
|
+
justifyContent: "center",
|
|
1514
|
+
paddingTop: i.sm,
|
|
1515
|
+
paddingBottom: i.sm,
|
|
1516
|
+
paddingLeft: i.md,
|
|
1517
|
+
paddingRight: i.md,
|
|
1518
|
+
fontFamily: h.fontFamily,
|
|
1519
|
+
fontSize: h.fontSizeSm,
|
|
1520
|
+
fontWeight: h.fontWeightMedium,
|
|
1521
|
+
color: {
|
|
1522
|
+
default: o.textMuted,
|
|
1523
|
+
":hover": o.text
|
|
1524
|
+
},
|
|
1525
|
+
backgroundColor: "transparent",
|
|
1526
|
+
borderWidth: 0,
|
|
1527
|
+
borderBottomWidth: 2,
|
|
1528
|
+
borderBottomStyle: "solid",
|
|
1529
|
+
borderBottomColor: "transparent",
|
|
1530
|
+
cursor: "pointer",
|
|
1531
|
+
transitionProperty: "color, border-color",
|
|
1532
|
+
transitionDuration: "150ms",
|
|
1533
|
+
transitionTimingFunction: "ease",
|
|
1534
|
+
outlineWidth: {
|
|
1535
|
+
default: 0,
|
|
1536
|
+
":focus-visible": 2
|
|
1537
|
+
},
|
|
1538
|
+
outlineStyle: {
|
|
1539
|
+
default: "none",
|
|
1540
|
+
":focus-visible": "solid"
|
|
1541
|
+
},
|
|
1542
|
+
outlineColor: {
|
|
1543
|
+
default: "transparent",
|
|
1544
|
+
":focus-visible": o.accent
|
|
1545
|
+
},
|
|
1546
|
+
outlineOffset: {
|
|
1547
|
+
default: 0,
|
|
1548
|
+
":focus-visible": -2
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
tabVertical: {
|
|
1552
|
+
justifyContent: "flex-start",
|
|
1553
|
+
borderBottomWidth: 0,
|
|
1554
|
+
borderRightWidth: 2,
|
|
1555
|
+
borderRightStyle: "solid",
|
|
1556
|
+
borderRightColor: "transparent"
|
|
1557
|
+
},
|
|
1558
|
+
tabActiveHorizontal: {
|
|
1559
|
+
color: o.text,
|
|
1560
|
+
borderBottomColor: o.accent
|
|
1561
|
+
},
|
|
1562
|
+
tabActiveVertical: {
|
|
1563
|
+
color: o.text,
|
|
1564
|
+
borderRightColor: o.accent
|
|
1565
|
+
},
|
|
1566
|
+
tabDisabled: {
|
|
1567
|
+
opacity: 0.5,
|
|
1568
|
+
cursor: "not-allowed",
|
|
1569
|
+
color: o.textMuted
|
|
1570
|
+
},
|
|
1571
|
+
panel: {
|
|
1572
|
+
paddingTop: i.md
|
|
1573
|
+
},
|
|
1574
|
+
panelVertical: {
|
|
1575
|
+
paddingTop: 0,
|
|
1576
|
+
paddingLeft: i.md
|
|
1577
|
+
}
|
|
1578
|
+
}), kt = V(null);
|
|
1579
|
+
function ct() {
|
|
1580
|
+
const t = $(kt);
|
|
1581
|
+
if (!t) throw new Error("Tabs compound components must be used within Tabs.Root");
|
|
1582
|
+
return t;
|
|
1583
|
+
}
|
|
1584
|
+
function ge({
|
|
1585
|
+
value: t,
|
|
1586
|
+
defaultValue: e,
|
|
1587
|
+
onValueChange: r,
|
|
1588
|
+
orientation: n = "horizontal"
|
|
1589
|
+
}) {
|
|
1590
|
+
const [l, s] = lt(t, e ?? null, r ? (u) => {
|
|
1591
|
+
u !== null && r(u);
|
|
1592
|
+
} : void 0), d = w(/* @__PURE__ */ new Map()), c = w([]), m = B((u, f) => (d.current.set(u, f), c.current.includes(u) || c.current.push(u), () => {
|
|
1593
|
+
d.current.delete(u), c.current = c.current.filter((p) => p !== u);
|
|
1594
|
+
}), []);
|
|
1595
|
+
return {
|
|
1596
|
+
activeValue: l,
|
|
1597
|
+
onSelect: s,
|
|
1598
|
+
orientation: n,
|
|
1599
|
+
registerTab: m,
|
|
1600
|
+
tabsRef: d,
|
|
1601
|
+
orderRef: c
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
function pe({
|
|
1605
|
+
children: t,
|
|
1606
|
+
value: e,
|
|
1607
|
+
defaultValue: r,
|
|
1608
|
+
onValueChange: n,
|
|
1609
|
+
orientation: l = "horizontal"
|
|
1610
|
+
}) {
|
|
1611
|
+
const s = ge({
|
|
1612
|
+
value: e,
|
|
1613
|
+
defaultValue: r,
|
|
1614
|
+
onValueChange: n,
|
|
1615
|
+
orientation: l
|
|
1616
|
+
});
|
|
1617
|
+
return /* @__PURE__ */ a(kt.Provider, { value: s, children: /* @__PURE__ */ a(g.div, { style: [A.root, l === "vertical" && A.rootVertical], children: t }) });
|
|
1618
|
+
}
|
|
1619
|
+
function he({
|
|
1620
|
+
children: t
|
|
1621
|
+
}) {
|
|
1622
|
+
const {
|
|
1623
|
+
orientation: e,
|
|
1624
|
+
activeValue: r,
|
|
1625
|
+
onSelect: n,
|
|
1626
|
+
tabsRef: l,
|
|
1627
|
+
orderRef: s
|
|
1628
|
+
} = ct(), d = w(null);
|
|
1629
|
+
return L(() => {
|
|
1630
|
+
const c = d.current;
|
|
1631
|
+
if (!c) return;
|
|
1632
|
+
function m(u) {
|
|
1633
|
+
const f = s.current, p = l.current;
|
|
1634
|
+
if (f.length === 0) return;
|
|
1635
|
+
const S = this, R = e === "horizontal" ? "ArrowLeft" : "ArrowUp", x = e === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
1636
|
+
let C = null;
|
|
1637
|
+
switch (u.key) {
|
|
1638
|
+
case x: {
|
|
1639
|
+
u.preventDefault();
|
|
1640
|
+
const v = r ? f.indexOf(r) : -1;
|
|
1641
|
+
for (let y = 1; y <= f.length; y++) {
|
|
1642
|
+
const b = (v + y) % f.length, k = f[b];
|
|
1643
|
+
if (!p.get(k)) {
|
|
1644
|
+
C = k;
|
|
1645
|
+
break;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1650
|
+
case R: {
|
|
1651
|
+
u.preventDefault();
|
|
1652
|
+
const v = r ? f.indexOf(r) : 0;
|
|
1653
|
+
for (let y = 1; y <= f.length; y++) {
|
|
1654
|
+
const b = (v - y + f.length) % f.length, k = f[b];
|
|
1655
|
+
if (!p.get(k)) {
|
|
1656
|
+
C = k;
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
break;
|
|
1661
|
+
}
|
|
1662
|
+
case "Home": {
|
|
1663
|
+
u.preventDefault();
|
|
1664
|
+
for (const v of f)
|
|
1665
|
+
if (!p.get(v)) {
|
|
1666
|
+
C = v;
|
|
1667
|
+
break;
|
|
1668
|
+
}
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
case "End": {
|
|
1672
|
+
u.preventDefault();
|
|
1673
|
+
for (let v = f.length - 1; v >= 0; v--)
|
|
1674
|
+
if (!p.get(f[v])) {
|
|
1675
|
+
C = f[v];
|
|
1676
|
+
break;
|
|
1677
|
+
}
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
C && (n(C), S.querySelector(`[data-tab-value="${C}"]`)?.focus());
|
|
1682
|
+
}
|
|
1683
|
+
return c.addEventListener("keydown", m), () => c.removeEventListener("keydown", m);
|
|
1684
|
+
}, [e, r, n, l, s]), /* @__PURE__ */ a(g.div, { ref: d, role: "tablist", "aria-orientation": e, style: [A.list, e === "vertical" && A.listVertical], children: t });
|
|
1685
|
+
}
|
|
1686
|
+
function me({
|
|
1687
|
+
value: t,
|
|
1688
|
+
disabled: e = !1,
|
|
1689
|
+
children: r
|
|
1690
|
+
}) {
|
|
1691
|
+
const {
|
|
1692
|
+
activeValue: n,
|
|
1693
|
+
onSelect: l,
|
|
1694
|
+
orientation: s,
|
|
1695
|
+
registerTab: d
|
|
1696
|
+
} = ct(), c = n === t, m = Y(), u = `${m}-panel`;
|
|
1697
|
+
L(() => d(t, e), [t, e, d]);
|
|
1698
|
+
const f = () => {
|
|
1699
|
+
e || l(t);
|
|
1700
|
+
};
|
|
1701
|
+
return /* @__PURE__ */ a(g.button, { type: "button", role: "tab", id: m, "aria-selected": c, "aria-controls": u, "aria-disabled": e || void 0, "data-tab-value": t, tabIndex: c ? 0 : -1, onClick: f, style: [A.tab, s === "vertical" && A.tabVertical, c && (s === "vertical" ? A.tabActiveVertical : A.tabActiveHorizontal), e && A.tabDisabled], children: r });
|
|
1702
|
+
}
|
|
1703
|
+
function be({
|
|
1704
|
+
value: t,
|
|
1705
|
+
children: e
|
|
1706
|
+
}) {
|
|
1707
|
+
const {
|
|
1708
|
+
activeValue: r,
|
|
1709
|
+
orientation: n
|
|
1710
|
+
} = ct();
|
|
1711
|
+
return r !== t ? null : /* @__PURE__ */ a(g.div, { role: "tabpanel", style: [A.panel, n === "vertical" && A.panelVertical], children: e });
|
|
1712
|
+
}
|
|
1713
|
+
const $e = {
|
|
1714
|
+
Root: pe,
|
|
1715
|
+
List: he,
|
|
1716
|
+
Tab: me,
|
|
1717
|
+
Panel: be
|
|
1718
|
+
}, ve = {
|
|
1719
|
+
light: [Wt, Ht],
|
|
1720
|
+
"high-contrast": [It, zt]
|
|
1721
|
+
}, xe = F.create({
|
|
1722
|
+
root: {
|
|
1723
|
+
display: "contents"
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
function Ae({
|
|
1727
|
+
theme: t = "dark",
|
|
1728
|
+
children: e
|
|
1729
|
+
}) {
|
|
1730
|
+
const r = ve[t], n = [r?.[0], r?.[1], xe.root];
|
|
1731
|
+
return /* @__PURE__ */ a(g.div, { style: n, children: e });
|
|
1732
|
+
}
|
|
1733
|
+
const it = F.create({
|
|
1734
|
+
root: {
|
|
1735
|
+
position: "relative",
|
|
1736
|
+
display: "inline-flex"
|
|
1737
|
+
},
|
|
1738
|
+
popup: {
|
|
1739
|
+
position: "absolute",
|
|
1740
|
+
zIndex: 50,
|
|
1741
|
+
paddingTop: i.xs,
|
|
1742
|
+
paddingBottom: i.xs,
|
|
1743
|
+
paddingLeft: i.sm,
|
|
1744
|
+
paddingRight: i.sm,
|
|
1745
|
+
backgroundColor: o.bgCard,
|
|
1746
|
+
color: o.text,
|
|
1747
|
+
fontFamily: h.fontFamily,
|
|
1748
|
+
fontSize: h.fontSizeXs,
|
|
1749
|
+
lineHeight: h.lineHeight,
|
|
1750
|
+
borderRadius: D.sm,
|
|
1751
|
+
borderWidth: 1,
|
|
1752
|
+
borderStyle: "solid",
|
|
1753
|
+
borderColor: o.border,
|
|
1754
|
+
boxShadow: Q.md,
|
|
1755
|
+
whiteSpace: "nowrap",
|
|
1756
|
+
pointerEvents: "none"
|
|
1757
|
+
},
|
|
1758
|
+
top: {
|
|
1759
|
+
bottom: "100%",
|
|
1760
|
+
left: "50%",
|
|
1761
|
+
transform: "translateX(-50%)",
|
|
1762
|
+
marginBottom: i.xs
|
|
1763
|
+
},
|
|
1764
|
+
bottom: {
|
|
1765
|
+
top: "100%",
|
|
1766
|
+
left: "50%",
|
|
1767
|
+
transform: "translateX(-50%)",
|
|
1768
|
+
marginTop: i.xs
|
|
1769
|
+
},
|
|
1770
|
+
left: {
|
|
1771
|
+
right: "100%",
|
|
1772
|
+
top: "50%",
|
|
1773
|
+
transform: "translateY(-50%)",
|
|
1774
|
+
marginRight: i.xs
|
|
1775
|
+
},
|
|
1776
|
+
right: {
|
|
1777
|
+
left: "100%",
|
|
1778
|
+
top: "50%",
|
|
1779
|
+
transform: "translateY(-50%)",
|
|
1780
|
+
marginLeft: i.xs
|
|
1781
|
+
}
|
|
1782
|
+
}), Tt = V(null);
|
|
1783
|
+
function ye() {
|
|
1784
|
+
const t = $(Tt);
|
|
1785
|
+
if (!t) throw new Error("Tooltip compound components must be used within Tooltip.Root");
|
|
1786
|
+
return t;
|
|
1787
|
+
}
|
|
1788
|
+
function Ce({
|
|
1789
|
+
children: t,
|
|
1790
|
+
content: e,
|
|
1791
|
+
placement: r = "top",
|
|
1792
|
+
delay: n = 300
|
|
1793
|
+
}) {
|
|
1794
|
+
const [l, s] = M(!1), d = Y(), c = w(null), m = B(() => {
|
|
1795
|
+
c.current && clearTimeout(c.current), c.current = setTimeout(() => s(!0), n);
|
|
1796
|
+
}, [n]), u = B(() => {
|
|
1797
|
+
c.current && clearTimeout(c.current), c.current = null, s(!1);
|
|
1798
|
+
}, []);
|
|
1799
|
+
return /* @__PURE__ */ a(Tt.Provider, { value: {
|
|
1800
|
+
open: l,
|
|
1801
|
+
show: m,
|
|
1802
|
+
hide: u,
|
|
1803
|
+
tooltipId: d,
|
|
1804
|
+
placement: r
|
|
1805
|
+
}, children: /* @__PURE__ */ U(g.div, { style: it.root, children: [
|
|
1806
|
+
t,
|
|
1807
|
+
l && /* @__PURE__ */ a(g.div, { id: d, role: "tooltip", style: [it.popup, it[r]], children: e })
|
|
1808
|
+
] }) });
|
|
1809
|
+
}
|
|
1810
|
+
function Se({
|
|
1811
|
+
children: t
|
|
1812
|
+
}) {
|
|
1813
|
+
const {
|
|
1814
|
+
open: e,
|
|
1815
|
+
show: r,
|
|
1816
|
+
hide: n,
|
|
1817
|
+
tooltipId: l
|
|
1818
|
+
} = ye();
|
|
1819
|
+
return /* @__PURE__ */ a(g.div, { onPointerEnter: r, onPointerLeave: n, onFocus: r, onBlur: n, "aria-describedby": e ? l : void 0, children: t });
|
|
1820
|
+
}
|
|
1821
|
+
const Oe = {
|
|
1822
|
+
Root: Ce,
|
|
1823
|
+
Trigger: Se
|
|
1824
|
+
};
|
|
1825
|
+
export {
|
|
1826
|
+
Ie as Alert,
|
|
1827
|
+
ze as Badge,
|
|
1828
|
+
We as Button,
|
|
1829
|
+
He as Card,
|
|
1830
|
+
De as Field,
|
|
1831
|
+
Be as Input,
|
|
1832
|
+
Le as Menu,
|
|
1833
|
+
Pe as ScrollArea,
|
|
1834
|
+
Me as Select,
|
|
1835
|
+
Fe as SideNav,
|
|
1836
|
+
Ee as Table,
|
|
1837
|
+
$e as Tabs,
|
|
1838
|
+
Ae as ThemeProvider,
|
|
1839
|
+
Oe as Tooltip,
|
|
1840
|
+
Xe as colors,
|
|
1841
|
+
je as highContrastShadows,
|
|
1842
|
+
Ge as highContrastTheme,
|
|
1843
|
+
Ye as lightShadows,
|
|
1844
|
+
Ue as lightTheme,
|
|
1845
|
+
Ke as radii,
|
|
1846
|
+
_e as shadows,
|
|
1847
|
+
qe as spacing,
|
|
1848
|
+
Je as typography
|
|
1849
|
+
};
|
|
1850
|
+
//# sourceMappingURL=index.js.map
|