@fea-ui/react 0.0.0-canary.2
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 +3 -0
- package/dist/index.cjs +2356 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2887 -0
- package/dist/index.d.mts +2887 -0
- package/dist/index.mjs +2251 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +69 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2251 @@
|
|
|
1
|
+
import { cn, cn as cn$1, tv } from "tailwind-variants";
|
|
2
|
+
import { Accordion, AlertDialog, Avatar, Button, Checkbox, CheckboxGroup, Dialog, Field, Fieldset, Form, Input, Menu, Meter, Popover, Progress, Radio, RadioGroup, Separator, Slider, Switch, Tabs, Toggle } from "@base-ui/react";
|
|
3
|
+
import { LucideAlertTriangle, LucideCheck, LucideCheckCircle, LucideChevronDown, LucideChevronUp, LucideInfo, LucideMenu, LucidePanelLeftClose, LucidePanelLeftOpen, LucideX, LucideXCircle } from "lucide-react";
|
|
4
|
+
import React, { createContext, useCallback, useContext, useId, useMemo, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
+
|
|
8
|
+
//#region src/components/accordion/accordion.context.ts
|
|
9
|
+
const AccordionContext = createContext(null);
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/accordion/accordion.variants.ts
|
|
13
|
+
const accordionVariants = tv({ slots: {
|
|
14
|
+
content: "accordion__content",
|
|
15
|
+
header: "accordion__header",
|
|
16
|
+
item: "accordion__item",
|
|
17
|
+
panel: "accordion__panel",
|
|
18
|
+
root: "accordion",
|
|
19
|
+
trigger: "accordion__trigger",
|
|
20
|
+
triggerIcon: "accordion__trigger-icon"
|
|
21
|
+
} });
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/accordion/use-accordion.ts
|
|
25
|
+
const useAccordion = () => {
|
|
26
|
+
const context = useContext(AccordionContext);
|
|
27
|
+
if (!context) throw new Error("useAccordion must be used within a AccordionProvider");
|
|
28
|
+
return context;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/accordion/accordion.tsx
|
|
33
|
+
const Accordion$1 = ({ className, ...props }) => {
|
|
34
|
+
const slots = useMemo(() => accordionVariants({}), []);
|
|
35
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, {
|
|
36
|
+
value: { slots },
|
|
37
|
+
children: /* @__PURE__ */ jsx(Accordion.Root, {
|
|
38
|
+
className: cn$1(className, slots.root()),
|
|
39
|
+
...props
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const AccordionItem = ({ className, ...props }) => {
|
|
44
|
+
const { slots } = useAccordion();
|
|
45
|
+
return /* @__PURE__ */ jsx(Accordion.Item, {
|
|
46
|
+
className: cn$1(className, slots.item()),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const AccordionHeader = ({ className, ...props }) => {
|
|
51
|
+
const { slots } = useAccordion();
|
|
52
|
+
return /* @__PURE__ */ jsx(Accordion.Header, {
|
|
53
|
+
className: cn$1(className, slots.header()),
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const AccordionTrigger = ({ className, ...props }) => {
|
|
58
|
+
const { slots } = useAccordion();
|
|
59
|
+
return /* @__PURE__ */ jsx(Accordion.Trigger, {
|
|
60
|
+
className: cn$1(className, slots.trigger()),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const AccordionTriggerIcon = ({ className, ...props }) => {
|
|
65
|
+
const { slots } = useAccordion();
|
|
66
|
+
return /* @__PURE__ */ jsx(LucideChevronDown, {
|
|
67
|
+
className: cn$1(className, slots.triggerIcon()),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const AccordionPanel = ({ className, ...props }) => {
|
|
72
|
+
const { slots } = useAccordion();
|
|
73
|
+
return /* @__PURE__ */ jsx(Accordion.Panel, {
|
|
74
|
+
className: cn$1(className, slots.panel()),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const AccordionContent = ({ className, ...props }) => {
|
|
79
|
+
const { slots } = useAccordion();
|
|
80
|
+
return /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: cn$1(className, slots.content()),
|
|
82
|
+
...props
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
var accordion_default = Object.assign(Accordion$1, {
|
|
86
|
+
Content: AccordionContent,
|
|
87
|
+
Header: AccordionHeader,
|
|
88
|
+
Item: AccordionItem,
|
|
89
|
+
Panel: AccordionPanel,
|
|
90
|
+
Root: Accordion$1,
|
|
91
|
+
Trigger: AccordionTrigger,
|
|
92
|
+
TriggerIcon: AccordionTriggerIcon
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/alert/alert.context.ts
|
|
97
|
+
const AlertContext = createContext(null);
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/alert/alert.variants.ts
|
|
101
|
+
const alertVariants = tv({
|
|
102
|
+
defaultVariants: { variant: "info" },
|
|
103
|
+
slots: {
|
|
104
|
+
content: "alert__content",
|
|
105
|
+
description: "alert__description",
|
|
106
|
+
indicator: "alert__indicator",
|
|
107
|
+
root: "alert",
|
|
108
|
+
title: "alert__title"
|
|
109
|
+
},
|
|
110
|
+
variants: { variant: {
|
|
111
|
+
danger: { root: "alert--danger" },
|
|
112
|
+
info: { root: "alert--info" },
|
|
113
|
+
primary: { root: "alert--primary" },
|
|
114
|
+
success: { root: "alert--success" },
|
|
115
|
+
warning: { root: "alert--warning" }
|
|
116
|
+
} }
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/components/alert/use-alert.ts
|
|
121
|
+
const useAlert = () => {
|
|
122
|
+
const context = useContext(AlertContext);
|
|
123
|
+
if (!context) throw new Error("useAlert must be used within a AlertProvider");
|
|
124
|
+
return context;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/components/alert/alert.tsx
|
|
129
|
+
const Alert = ({ className, variant, ...props }) => {
|
|
130
|
+
const slots = useMemo(() => alertVariants({
|
|
131
|
+
className,
|
|
132
|
+
variant
|
|
133
|
+
}), [className, variant]);
|
|
134
|
+
return /* @__PURE__ */ jsx(AlertContext, {
|
|
135
|
+
value: {
|
|
136
|
+
slots,
|
|
137
|
+
variant
|
|
138
|
+
},
|
|
139
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: cn$1(className, slots.root()),
|
|
141
|
+
...props
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
const AlertIndicator = ({ className, children, ...props }) => {
|
|
146
|
+
const { slots, variant } = useAlert();
|
|
147
|
+
const IndicatorIcon = ({ children: children$1 }) => {
|
|
148
|
+
if (children$1) return children$1;
|
|
149
|
+
switch (variant) {
|
|
150
|
+
case "danger": return /* @__PURE__ */ jsx(LucideXCircle, {});
|
|
151
|
+
case "success": return /* @__PURE__ */ jsx(LucideCheckCircle, {});
|
|
152
|
+
case "warning": return /* @__PURE__ */ jsx(LucideAlertTriangle, {});
|
|
153
|
+
default: return /* @__PURE__ */ jsx(LucideInfo, {});
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return /* @__PURE__ */ jsx("div", {
|
|
157
|
+
className: cn$1(className, slots.indicator()),
|
|
158
|
+
...props,
|
|
159
|
+
children: /* @__PURE__ */ jsx(IndicatorIcon, { children })
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
const AlertContent = ({ className, ...props }) => {
|
|
163
|
+
const { slots } = useAlert();
|
|
164
|
+
return /* @__PURE__ */ jsx("div", {
|
|
165
|
+
className: cn$1(className, slots.content()),
|
|
166
|
+
...props
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
const AlertTitle = ({ className, ...props }) => {
|
|
170
|
+
const { slots } = useAlert();
|
|
171
|
+
return /* @__PURE__ */ jsx("div", {
|
|
172
|
+
className: cn$1(className, slots.title()),
|
|
173
|
+
...props
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
const AlertDescription = ({ className, ...props }) => {
|
|
177
|
+
const { slots } = useAlert();
|
|
178
|
+
return /* @__PURE__ */ jsx("div", {
|
|
179
|
+
className: cn$1(className, slots.description()),
|
|
180
|
+
...props
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
var alert_default = Object.assign(Alert, {
|
|
184
|
+
Content: AlertContent,
|
|
185
|
+
Description: AlertDescription,
|
|
186
|
+
Indicator: AlertIndicator,
|
|
187
|
+
Root: Alert,
|
|
188
|
+
Title: AlertTitle
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/components/alert-dialog/alert-dialog.context.ts
|
|
193
|
+
const AlertDialogContext = createContext(null);
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/components/alert-dialog/alert-dialog.variants.ts
|
|
197
|
+
const alertDialogVariants = tv({ slots: {
|
|
198
|
+
backdrop: "alert-dialog__backdrop",
|
|
199
|
+
close: "alert-dialog__close",
|
|
200
|
+
description: "alert-dialog__description",
|
|
201
|
+
popup: "alert-dialog__popup",
|
|
202
|
+
portal: "alert-dialog__portal",
|
|
203
|
+
root: "alert-dialog",
|
|
204
|
+
title: "alert-dialog__title",
|
|
205
|
+
trigger: "alert-dialog__trigger",
|
|
206
|
+
viewport: "alert-dialog__viewport"
|
|
207
|
+
} });
|
|
208
|
+
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/components/alert-dialog/use-alert-dialog.ts
|
|
211
|
+
const useAlertDialog = () => {
|
|
212
|
+
const context = useContext(AlertDialogContext);
|
|
213
|
+
if (!context) throw new Error("useAlertDialog must be used within a AlertDialogProvider");
|
|
214
|
+
return context;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/components/alert-dialog/alert-dialog.tsx
|
|
219
|
+
const AlertDialog$1 = ({ ...props }) => {
|
|
220
|
+
return /* @__PURE__ */ jsx(AlertDialogContext, {
|
|
221
|
+
value: { slots: useMemo(() => alertDialogVariants(), []) },
|
|
222
|
+
children: /* @__PURE__ */ jsx(AlertDialog.Root, { ...props })
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
const AlertDialogTrigger = ({ className, ...props }) => {
|
|
226
|
+
const { slots } = useAlertDialog();
|
|
227
|
+
return /* @__PURE__ */ jsx(AlertDialog.Trigger, {
|
|
228
|
+
className: cn$1(slots.trigger(), className),
|
|
229
|
+
...props
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
const AlertDialogPortal = ({ className, ...props }) => {
|
|
233
|
+
const { slots } = useAlertDialog();
|
|
234
|
+
return /* @__PURE__ */ jsx(AlertDialog.Portal, {
|
|
235
|
+
className: cn$1(slots.portal(), className),
|
|
236
|
+
...props
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
const AlertDialogBackdrop = ({ className, ...props }) => {
|
|
240
|
+
const { slots } = useAlertDialog();
|
|
241
|
+
return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
|
|
242
|
+
className: cn$1(slots.backdrop(), className),
|
|
243
|
+
...props
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
const AlertDialogViewport = ({ className, ...props }) => {
|
|
247
|
+
const { slots } = useAlertDialog();
|
|
248
|
+
return /* @__PURE__ */ jsx(AlertDialog.Viewport, {
|
|
249
|
+
className: cn$1(slots.viewport(), className),
|
|
250
|
+
...props
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
const AlertDialogPopup = ({ className, ...props }) => {
|
|
254
|
+
const { slots } = useAlertDialog();
|
|
255
|
+
return /* @__PURE__ */ jsx(AlertDialog.Popup, {
|
|
256
|
+
className: cn$1(slots.popup(), className),
|
|
257
|
+
...props
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
const AlertDialogTitle = ({ className, ...props }) => {
|
|
261
|
+
const { slots } = useAlertDialog();
|
|
262
|
+
return /* @__PURE__ */ jsx(AlertDialog.Title, {
|
|
263
|
+
className: cn$1(slots.title(), className),
|
|
264
|
+
...props
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
const AlertDialogDescription = ({ className, ...props }) => {
|
|
268
|
+
const { slots } = useAlertDialog();
|
|
269
|
+
return /* @__PURE__ */ jsx(AlertDialog.Description, {
|
|
270
|
+
className: cn$1(slots.description(), className),
|
|
271
|
+
...props
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
const AlertDialogClose = ({ className, children, ...props }) => {
|
|
275
|
+
const { slots } = useAlertDialog();
|
|
276
|
+
return /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
277
|
+
className: cn$1(slots.close(), className),
|
|
278
|
+
...props,
|
|
279
|
+
children: children ?? /* @__PURE__ */ jsx(LucideX, {})
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
var alert_dialog_default = Object.assign(AlertDialog$1, {
|
|
283
|
+
Backdrop: AlertDialogBackdrop,
|
|
284
|
+
Close: AlertDialogClose,
|
|
285
|
+
Description: AlertDialogDescription,
|
|
286
|
+
Popup: AlertDialogPopup,
|
|
287
|
+
Portal: AlertDialogPortal,
|
|
288
|
+
Root: AlertDialog$1,
|
|
289
|
+
Title: AlertDialogTitle,
|
|
290
|
+
Trigger: AlertDialogTrigger,
|
|
291
|
+
Viewport: AlertDialogViewport
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/components/avatar/avatar.context.ts
|
|
296
|
+
const AvatarContext = createContext(null);
|
|
297
|
+
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/components/avatar/avatar.variants.ts
|
|
300
|
+
const avatarVariants = tv({
|
|
301
|
+
defaultVariants: { size: "md" },
|
|
302
|
+
slots: {
|
|
303
|
+
fallback: "avatar__fallback",
|
|
304
|
+
image: "avatar__image",
|
|
305
|
+
root: "avatar"
|
|
306
|
+
},
|
|
307
|
+
variants: { size: {
|
|
308
|
+
lg: { root: "avatar--lg" },
|
|
309
|
+
md: { root: "avatar--md" },
|
|
310
|
+
sm: { root: "avatar--sm" }
|
|
311
|
+
} }
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/components/avatar/use-avatar.ts
|
|
316
|
+
const useAvatar = () => {
|
|
317
|
+
const ctx = useContext(AvatarContext);
|
|
318
|
+
if (!ctx) throw new Error("useAvatar must be used within the Avatar component.");
|
|
319
|
+
return ctx;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/components/avatar/avatar.tsx
|
|
324
|
+
const Avatar$1 = ({ className, size, ...props }) => {
|
|
325
|
+
const slots = useMemo(() => avatarVariants({ size }), [size]);
|
|
326
|
+
return /* @__PURE__ */ jsx(AvatarContext.Provider, {
|
|
327
|
+
value: { slots },
|
|
328
|
+
children: /* @__PURE__ */ jsx(Avatar.Root, {
|
|
329
|
+
className: cn$1(className, slots.root()),
|
|
330
|
+
...props
|
|
331
|
+
})
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
const AvatarImage = ({ className, ...props }) => {
|
|
335
|
+
const { slots } = useAvatar();
|
|
336
|
+
return /* @__PURE__ */ jsx(Avatar.Image, {
|
|
337
|
+
className: cn$1(className, slots.image()),
|
|
338
|
+
...props
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
const AvatarFallback = ({ className, ...props }) => {
|
|
342
|
+
const { slots } = useAvatar();
|
|
343
|
+
return /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
344
|
+
className: cn$1(className, slots.fallback()),
|
|
345
|
+
...props
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
var avatar_default = Object.assign(Avatar$1, {
|
|
349
|
+
Fallback: AvatarFallback,
|
|
350
|
+
Image: AvatarImage,
|
|
351
|
+
Root: Avatar$1
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/components/button/button.variants.ts
|
|
356
|
+
const buttonVariants = tv({
|
|
357
|
+
base: "button",
|
|
358
|
+
defaultVariants: {
|
|
359
|
+
isIconOnly: false,
|
|
360
|
+
size: "md",
|
|
361
|
+
variant: "primary"
|
|
362
|
+
},
|
|
363
|
+
variants: {
|
|
364
|
+
isIconOnly: { true: "button--icon-only" },
|
|
365
|
+
size: {
|
|
366
|
+
lg: "button--lg",
|
|
367
|
+
md: "button--md",
|
|
368
|
+
sm: "button--sm"
|
|
369
|
+
},
|
|
370
|
+
variant: {
|
|
371
|
+
danger: "button--danger",
|
|
372
|
+
ghost: "button--ghost",
|
|
373
|
+
outline: "button--outline",
|
|
374
|
+
primary: "button--primary",
|
|
375
|
+
secondary: "button--secondary"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/components/button/button.tsx
|
|
382
|
+
const Button$1 = ({ className, variant, size, isIconOnly, ...props }) => {
|
|
383
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
384
|
+
className: cn$1(buttonVariants({
|
|
385
|
+
isIconOnly,
|
|
386
|
+
size,
|
|
387
|
+
variant
|
|
388
|
+
}), className),
|
|
389
|
+
...props
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
var button_default = Button$1;
|
|
393
|
+
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/components/button-group/button-group.variants.ts
|
|
396
|
+
const buttonGroupVariants = tv({ base: "button-group" });
|
|
397
|
+
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/components/button-group/button-group.tsx
|
|
400
|
+
const ButtonGroup = ({ className, ...props }) => {
|
|
401
|
+
return /* @__PURE__ */ jsx("div", {
|
|
402
|
+
className: cn$1(className, buttonGroupVariants()),
|
|
403
|
+
...props
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
var button_group_default = ButtonGroup;
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/components/card/card.context.ts
|
|
410
|
+
const CardContext = createContext(null);
|
|
411
|
+
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/components/card/card.variants.ts
|
|
414
|
+
const cardVariants = tv({
|
|
415
|
+
defaultVariants: { variant: "default" },
|
|
416
|
+
slots: {
|
|
417
|
+
body: "card__body",
|
|
418
|
+
description: "card__description",
|
|
419
|
+
footer: "card__footer",
|
|
420
|
+
header: "card__header",
|
|
421
|
+
root: "card",
|
|
422
|
+
title: "card__title"
|
|
423
|
+
},
|
|
424
|
+
variants: { variant: {
|
|
425
|
+
default: { root: "card--default" },
|
|
426
|
+
transparent: { root: "card--transparent" }
|
|
427
|
+
} }
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/components/card/use-card.ts
|
|
432
|
+
const useCard = () => {
|
|
433
|
+
const ctx = useContext(CardContext);
|
|
434
|
+
if (!ctx) throw new Error("CardContext must be used with in the Card component.");
|
|
435
|
+
return ctx;
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/components/card/card.tsx
|
|
440
|
+
const Card = ({ className, variant, ...props }) => {
|
|
441
|
+
const slots = useMemo(() => cardVariants({ variant }), [variant]);
|
|
442
|
+
console.log(slots);
|
|
443
|
+
return /* @__PURE__ */ jsx(CardContext.Provider, {
|
|
444
|
+
value: { slots },
|
|
445
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
446
|
+
className: cn$1(className, slots.root()),
|
|
447
|
+
...props
|
|
448
|
+
})
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
const CardHeader = ({ className, ...props }) => {
|
|
452
|
+
const { slots } = useCard();
|
|
453
|
+
return /* @__PURE__ */ jsx("div", {
|
|
454
|
+
className: cn$1(className, slots.header()),
|
|
455
|
+
...props
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
const CardBody = ({ className, ...props }) => {
|
|
459
|
+
const { slots } = useCard();
|
|
460
|
+
return /* @__PURE__ */ jsx("div", {
|
|
461
|
+
className: cn$1(className, slots.body()),
|
|
462
|
+
...props
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
const CardFooter = ({ className, ...props }) => {
|
|
466
|
+
const { slots } = useCard();
|
|
467
|
+
return /* @__PURE__ */ jsx("div", {
|
|
468
|
+
className: cn$1(className, slots.footer()),
|
|
469
|
+
...props
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
const CardTitle = ({ className, ...props }) => {
|
|
473
|
+
const { slots } = useCard();
|
|
474
|
+
return /* @__PURE__ */ jsx("h2", {
|
|
475
|
+
className: cn$1(className, slots.title()),
|
|
476
|
+
...props
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
const CardDescription = ({ className, ...props }) => {
|
|
480
|
+
const { slots } = useCard();
|
|
481
|
+
return /* @__PURE__ */ jsx("p", {
|
|
482
|
+
className: cn$1(className, slots.description()),
|
|
483
|
+
...props
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
/** Exports */
|
|
487
|
+
var card_default = Object.assign(Card, {
|
|
488
|
+
Body: CardBody,
|
|
489
|
+
Description: CardDescription,
|
|
490
|
+
Footer: CardFooter,
|
|
491
|
+
Header: CardHeader,
|
|
492
|
+
Root: Card,
|
|
493
|
+
Title: CardTitle
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/components/checkbox/checkbox.context.ts
|
|
498
|
+
const CheckboxContext = createContext(null);
|
|
499
|
+
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/components/checkbox/checkbox.variants.ts
|
|
502
|
+
const checkboxVariants = tv({ slots: {
|
|
503
|
+
indicator: "checkbox__indicator",
|
|
504
|
+
root: "checkbox"
|
|
505
|
+
} });
|
|
506
|
+
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/components/checkbox/use-checkbox.ts
|
|
509
|
+
const useCheckbox = () => {
|
|
510
|
+
const context = useContext(CheckboxContext);
|
|
511
|
+
if (!context) throw new Error("useCheckbox must be used within a CheckboxProvider");
|
|
512
|
+
return context;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/components/checkbox/checkbox.tsx
|
|
517
|
+
const Checkbox$1 = ({ className, ...props }) => {
|
|
518
|
+
const slots = useMemo(() => checkboxVariants({}), []);
|
|
519
|
+
return /* @__PURE__ */ jsx(CheckboxContext, {
|
|
520
|
+
value: { slots },
|
|
521
|
+
children: /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
522
|
+
className: cn$1(className, slots.root()),
|
|
523
|
+
...props
|
|
524
|
+
})
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
const CheckboxIndicator = ({ className, children, ...props }) => {
|
|
528
|
+
const { slots } = useCheckbox();
|
|
529
|
+
return /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
530
|
+
className: cn$1(className, slots.indicator()),
|
|
531
|
+
...props,
|
|
532
|
+
children: children ?? /* @__PURE__ */ jsx(LucideCheck, {})
|
|
533
|
+
});
|
|
534
|
+
};
|
|
535
|
+
var checkbox_default = Object.assign(Checkbox$1, {
|
|
536
|
+
Indicator: CheckboxIndicator,
|
|
537
|
+
Root: Checkbox$1
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/components/checkbox-group/checkbox-group.variants.ts
|
|
542
|
+
const checkboxGroupVariants = tv({ base: "checkbox-group" });
|
|
543
|
+
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/components/checkbox-group/checkbox-group.tsx
|
|
546
|
+
const CheckboxGroup$1 = ({ className, ...props }) => {
|
|
547
|
+
return /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
548
|
+
className: cn$1(className, checkboxGroupVariants()),
|
|
549
|
+
...props
|
|
550
|
+
});
|
|
551
|
+
};
|
|
552
|
+
var checkbox_group_default = CheckboxGroup$1;
|
|
553
|
+
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/components/chip/chip.variants.ts
|
|
556
|
+
const chipVariants = tv({
|
|
557
|
+
base: "chip",
|
|
558
|
+
defaultVariants: {
|
|
559
|
+
size: "md",
|
|
560
|
+
variant: "primary"
|
|
561
|
+
},
|
|
562
|
+
variants: {
|
|
563
|
+
size: {
|
|
564
|
+
lg: "chip--lg",
|
|
565
|
+
md: "chip--md",
|
|
566
|
+
sm: "chip--sm"
|
|
567
|
+
},
|
|
568
|
+
variant: {
|
|
569
|
+
danger: "chip--danger",
|
|
570
|
+
outline: "chip--outline",
|
|
571
|
+
primary: "chip--primary",
|
|
572
|
+
secondary: "chip--secondary",
|
|
573
|
+
success: "chip--success"
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/components/chip/chip.tsx
|
|
580
|
+
const Chip = ({ className, variant, size, ...props }) => {
|
|
581
|
+
return /* @__PURE__ */ jsx("span", {
|
|
582
|
+
className: cn$1(className, chipVariants({
|
|
583
|
+
size,
|
|
584
|
+
variant
|
|
585
|
+
})),
|
|
586
|
+
...props
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
var chip_default = Chip;
|
|
590
|
+
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region src/components/container/container.variants.ts
|
|
593
|
+
const containerVariants = tv({ base: "container" });
|
|
594
|
+
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/components/container/container.tsx
|
|
597
|
+
const Container = ({ className, ...props }) => {
|
|
598
|
+
return /* @__PURE__ */ jsx("div", {
|
|
599
|
+
className: cn$1(className, containerVariants()),
|
|
600
|
+
...props
|
|
601
|
+
});
|
|
602
|
+
};
|
|
603
|
+
var container_default = Container;
|
|
604
|
+
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region src/components/dialog/dialog.context.ts
|
|
607
|
+
const DialogContext = createContext(null);
|
|
608
|
+
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/components/dialog/dialog.variants.ts
|
|
611
|
+
const dialogVariants = tv({ slots: {
|
|
612
|
+
backdrop: "dialog__backdrop",
|
|
613
|
+
close: "dialog__close",
|
|
614
|
+
description: "dialog__description",
|
|
615
|
+
popup: "dialog__popup",
|
|
616
|
+
portal: "dialog__portal",
|
|
617
|
+
root: "dialog",
|
|
618
|
+
title: "dialog__title",
|
|
619
|
+
trigger: "dialog__trigger",
|
|
620
|
+
viewport: "dialog__viewport"
|
|
621
|
+
} });
|
|
622
|
+
|
|
623
|
+
//#endregion
|
|
624
|
+
//#region src/components/dialog/use-dialog.ts
|
|
625
|
+
const useDialog = () => {
|
|
626
|
+
const context = useContext(DialogContext);
|
|
627
|
+
if (!context) throw new Error("useDialog must be used within a DialogProvider");
|
|
628
|
+
return context;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/components/dialog/dialog.tsx
|
|
633
|
+
const Dialog$1 = ({ ...props }) => {
|
|
634
|
+
const slots = useMemo(() => dialogVariants(), []);
|
|
635
|
+
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
636
|
+
value: { slots },
|
|
637
|
+
children: /* @__PURE__ */ jsx(Dialog.Root, { ...props })
|
|
638
|
+
});
|
|
639
|
+
};
|
|
640
|
+
const DialogTrigger = ({ className, ...props }) => {
|
|
641
|
+
const { slots } = useDialog();
|
|
642
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
643
|
+
className: cn$1(slots.trigger(), className),
|
|
644
|
+
...props
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
const DialogPortal = ({ className, ...props }) => {
|
|
648
|
+
const { slots } = useDialog();
|
|
649
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
650
|
+
className: cn$1(slots.portal(), className),
|
|
651
|
+
...props
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
const DialogBackdrop = ({ className, ...props }) => {
|
|
655
|
+
const { slots } = useDialog();
|
|
656
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
657
|
+
className: cn$1(slots.backdrop(), className),
|
|
658
|
+
...props
|
|
659
|
+
});
|
|
660
|
+
};
|
|
661
|
+
const DialogViewport = ({ className, ...props }) => {
|
|
662
|
+
const { slots } = useDialog();
|
|
663
|
+
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
664
|
+
className: cn$1(slots.viewport(), className),
|
|
665
|
+
...props
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
const DialogPopup = ({ className, ...props }) => {
|
|
669
|
+
const { slots } = useDialog();
|
|
670
|
+
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
671
|
+
className: cn$1(slots.popup(), className),
|
|
672
|
+
...props
|
|
673
|
+
});
|
|
674
|
+
};
|
|
675
|
+
const DialogTitle = ({ className, ...props }) => {
|
|
676
|
+
const { slots } = useDialog();
|
|
677
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
678
|
+
className: cn$1(slots.title(), className),
|
|
679
|
+
...props
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
const DialogDescription = ({ className, ...props }) => {
|
|
683
|
+
const { slots } = useDialog();
|
|
684
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
685
|
+
className: cn$1(slots.description(), className),
|
|
686
|
+
...props
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
const DialogClose = ({ className, ...props }) => {
|
|
690
|
+
const { slots } = useDialog();
|
|
691
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
692
|
+
className: cn$1(slots.close(), className),
|
|
693
|
+
...props,
|
|
694
|
+
children: /* @__PURE__ */ jsx(LucideX, {})
|
|
695
|
+
});
|
|
696
|
+
};
|
|
697
|
+
var dialog_default = Object.assign(Dialog$1, {
|
|
698
|
+
Backdrop: DialogBackdrop,
|
|
699
|
+
Close: DialogClose,
|
|
700
|
+
Description: DialogDescription,
|
|
701
|
+
Popup: DialogPopup,
|
|
702
|
+
Portal: DialogPortal,
|
|
703
|
+
Root: Dialog$1,
|
|
704
|
+
Title: DialogTitle,
|
|
705
|
+
Trigger: DialogTrigger,
|
|
706
|
+
Viewport: DialogViewport
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region src/components/drawer/drawer.context.ts
|
|
711
|
+
const DrawerContext = createContext(null);
|
|
712
|
+
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region src/components/drawer/drawer.variants.ts
|
|
715
|
+
const drawerVariants = tv({
|
|
716
|
+
defaultVariants: { position: "left" },
|
|
717
|
+
slots: {
|
|
718
|
+
backdrop: "drawer__backdrop",
|
|
719
|
+
close: "drawer__close",
|
|
720
|
+
description: "drawer__description",
|
|
721
|
+
popup: "drawer__popup",
|
|
722
|
+
portal: "drawer__portal",
|
|
723
|
+
root: "drawer",
|
|
724
|
+
title: "drawer__title",
|
|
725
|
+
trigger: "drawer__trigger",
|
|
726
|
+
viewport: "drawer__viewport"
|
|
727
|
+
},
|
|
728
|
+
variants: { position: {
|
|
729
|
+
bottom: { popup: "drawer--bottom" },
|
|
730
|
+
left: { popup: "drawer--left" },
|
|
731
|
+
right: { popup: "drawer--right" },
|
|
732
|
+
top: { popup: "drawer--top" }
|
|
733
|
+
} }
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/components/drawer/use-drawer.ts
|
|
738
|
+
const useDrawer = () => {
|
|
739
|
+
const context = useContext(DrawerContext);
|
|
740
|
+
if (!context) throw new Error("useDrawer must be used within a DrawerProvider");
|
|
741
|
+
return context;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/components/drawer/drawer.tsx
|
|
746
|
+
const Drawer = ({ position, ...props }) => {
|
|
747
|
+
return /* @__PURE__ */ jsx(DrawerContext, {
|
|
748
|
+
value: { slots: useMemo(() => drawerVariants({ position }), [position]) },
|
|
749
|
+
children: /* @__PURE__ */ jsx(Dialog.Root, { ...props })
|
|
750
|
+
});
|
|
751
|
+
};
|
|
752
|
+
const DrawerTrigger = ({ className, ...props }) => {
|
|
753
|
+
const { slots } = useDrawer();
|
|
754
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
755
|
+
className: cn$1(slots.trigger(), className),
|
|
756
|
+
...props
|
|
757
|
+
});
|
|
758
|
+
};
|
|
759
|
+
const DrawerPortal = ({ className, ...props }) => {
|
|
760
|
+
const { slots } = useDrawer();
|
|
761
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
762
|
+
className: cn$1(slots.portal(), className),
|
|
763
|
+
...props
|
|
764
|
+
});
|
|
765
|
+
};
|
|
766
|
+
const DrawerBackdrop = ({ className, ...props }) => {
|
|
767
|
+
const { slots } = useDrawer();
|
|
768
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
769
|
+
className: cn$1(slots.backdrop(), className),
|
|
770
|
+
...props
|
|
771
|
+
});
|
|
772
|
+
};
|
|
773
|
+
const DrawerViewport = ({ className, ...props }) => {
|
|
774
|
+
const { slots } = useDrawer();
|
|
775
|
+
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
776
|
+
className: cn$1(slots.viewport(), className),
|
|
777
|
+
...props
|
|
778
|
+
});
|
|
779
|
+
};
|
|
780
|
+
const DrawerPopup = ({ className, ...props }) => {
|
|
781
|
+
const { slots } = useDrawer();
|
|
782
|
+
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
783
|
+
className: cn$1(slots.popup(), className),
|
|
784
|
+
...props
|
|
785
|
+
});
|
|
786
|
+
};
|
|
787
|
+
const DrawerTitle = ({ className, ...props }) => {
|
|
788
|
+
const { slots } = useDrawer();
|
|
789
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
790
|
+
className: cn$1(slots.title(), className),
|
|
791
|
+
...props
|
|
792
|
+
});
|
|
793
|
+
};
|
|
794
|
+
const DrawerDescription = ({ className, ...props }) => {
|
|
795
|
+
const { slots } = useDrawer();
|
|
796
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
797
|
+
className: cn$1(slots.description(), className),
|
|
798
|
+
...props
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
const DrawerClose = ({ className, children, ...props }) => {
|
|
802
|
+
const { slots } = useDrawer();
|
|
803
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
804
|
+
className: cn$1(slots.close(), className),
|
|
805
|
+
...props,
|
|
806
|
+
children: children ?? /* @__PURE__ */ jsx(LucideX, {})
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
var drawer_default = Object.assign(Drawer, {
|
|
810
|
+
Backdrop: DrawerBackdrop,
|
|
811
|
+
Close: DrawerClose,
|
|
812
|
+
Description: DrawerDescription,
|
|
813
|
+
Popup: DrawerPopup,
|
|
814
|
+
Portal: DrawerPortal,
|
|
815
|
+
Root: Drawer,
|
|
816
|
+
Title: DrawerTitle,
|
|
817
|
+
Trigger: DrawerTrigger,
|
|
818
|
+
Viewport: DrawerViewport
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
//#endregion
|
|
822
|
+
//#region src/components/field/field.context.ts
|
|
823
|
+
const FieldContext = createContext(null);
|
|
824
|
+
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region src/components/field/field.variants.ts
|
|
827
|
+
const fieldVariants = tv({ slots: {
|
|
828
|
+
control: "input field__control",
|
|
829
|
+
description: "field__description",
|
|
830
|
+
error: "field__error",
|
|
831
|
+
label: "label field__label",
|
|
832
|
+
root: "field"
|
|
833
|
+
} });
|
|
834
|
+
|
|
835
|
+
//#endregion
|
|
836
|
+
//#region src/components/field/use-field.ts
|
|
837
|
+
const useField = () => {
|
|
838
|
+
const context = useContext(FieldContext);
|
|
839
|
+
if (!context) throw new Error("useField must be used within a FieldProvider");
|
|
840
|
+
return context;
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
//#endregion
|
|
844
|
+
//#region src/components/field/field.tsx
|
|
845
|
+
const FieldRoot = ({ className, required, ...props }) => {
|
|
846
|
+
const slots = useMemo(() => fieldVariants({}), []);
|
|
847
|
+
return /* @__PURE__ */ jsx(FieldContext, {
|
|
848
|
+
value: {
|
|
849
|
+
required,
|
|
850
|
+
slots
|
|
851
|
+
},
|
|
852
|
+
children: /* @__PURE__ */ jsx(Field.Root, {
|
|
853
|
+
className: cn$1(className, slots.root()),
|
|
854
|
+
"data-required": required,
|
|
855
|
+
...props
|
|
856
|
+
})
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
const FieldLabel = ({ className, ...props }) => {
|
|
860
|
+
const { slots } = useField();
|
|
861
|
+
return /* @__PURE__ */ jsx(Field.Label, {
|
|
862
|
+
className: cn$1(className, slots.label()),
|
|
863
|
+
...props
|
|
864
|
+
});
|
|
865
|
+
};
|
|
866
|
+
const FieldControl = ({ className, ...props }) => {
|
|
867
|
+
const { slots, required } = useField();
|
|
868
|
+
return /* @__PURE__ */ jsx(Field.Control, {
|
|
869
|
+
className: cn$1(className, slots.control()),
|
|
870
|
+
required,
|
|
871
|
+
...props
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
const FieldDescription = ({ className, ...props }) => {
|
|
875
|
+
const { slots } = useField();
|
|
876
|
+
return /* @__PURE__ */ jsx(Field.Description, {
|
|
877
|
+
className: cn$1(className, slots.description()),
|
|
878
|
+
...props
|
|
879
|
+
});
|
|
880
|
+
};
|
|
881
|
+
const FieldError = ({ className, ...props }) => {
|
|
882
|
+
const { slots } = useField();
|
|
883
|
+
return /* @__PURE__ */ jsx(Field.Error, {
|
|
884
|
+
className: cn$1(className, slots.error()),
|
|
885
|
+
...props
|
|
886
|
+
});
|
|
887
|
+
};
|
|
888
|
+
var field_default = Object.assign(FieldRoot, {
|
|
889
|
+
Control: FieldControl,
|
|
890
|
+
Description: FieldDescription,
|
|
891
|
+
Error: FieldError,
|
|
892
|
+
Label: FieldLabel,
|
|
893
|
+
Root: FieldRoot
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
//#endregion
|
|
897
|
+
//#region src/components/fieldset/fieldset.context.ts
|
|
898
|
+
const FieldsetContext = createContext(null);
|
|
899
|
+
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region src/components/fieldset/fieldset.variants.ts
|
|
902
|
+
const fieldsetVariants = tv({ slots: {
|
|
903
|
+
legend: "fieldset__legend",
|
|
904
|
+
root: "fieldset"
|
|
905
|
+
} });
|
|
906
|
+
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region src/components/fieldset/use-fieldset.ts
|
|
909
|
+
const useFieldset = () => {
|
|
910
|
+
const context = useContext(FieldsetContext);
|
|
911
|
+
if (!context) throw new Error("useFieldset must be used within a FieldsetProvider");
|
|
912
|
+
return context;
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region src/components/fieldset/fieldset.tsx
|
|
917
|
+
const Fieldset$1 = ({ className, ...props }) => {
|
|
918
|
+
const slots = useMemo(() => fieldsetVariants(), []);
|
|
919
|
+
return /* @__PURE__ */ jsx(FieldsetContext, {
|
|
920
|
+
value: { slots },
|
|
921
|
+
children: /* @__PURE__ */ jsx(Fieldset.Root, {
|
|
922
|
+
className: cn$1(className, slots.root()),
|
|
923
|
+
...props
|
|
924
|
+
})
|
|
925
|
+
});
|
|
926
|
+
};
|
|
927
|
+
const FieldsetLegend = ({ className, ...props }) => {
|
|
928
|
+
const { slots } = useFieldset();
|
|
929
|
+
return /* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
930
|
+
className: cn$1(slots.legend(), className),
|
|
931
|
+
...props
|
|
932
|
+
});
|
|
933
|
+
};
|
|
934
|
+
var fieldset_default = Object.assign(Fieldset$1, {
|
|
935
|
+
Legend: FieldsetLegend,
|
|
936
|
+
Root: Fieldset$1
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/components/form/form.variants.ts
|
|
941
|
+
const formVariants = tv({ base: "form" });
|
|
942
|
+
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/components/form/form.tsx
|
|
945
|
+
const Form$1 = ({ className, ...props }) => {
|
|
946
|
+
return /* @__PURE__ */ jsx(Form, {
|
|
947
|
+
className: cn$1(className, formVariants()),
|
|
948
|
+
...props
|
|
949
|
+
});
|
|
950
|
+
};
|
|
951
|
+
var form_default = Form$1;
|
|
952
|
+
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region src/components/icon-button/icon-button.variants.ts
|
|
955
|
+
const iconButtonVariants = tv({
|
|
956
|
+
base: "icon-button",
|
|
957
|
+
defaultVariants: { isIconOnly: true },
|
|
958
|
+
extend: buttonVariants
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region src/components/icon-button/icon-button.tsx
|
|
963
|
+
const IconButton = ({ className, variant, size, isIconOnly, ...props }) => {
|
|
964
|
+
return /* @__PURE__ */ jsx(button_default, {
|
|
965
|
+
className: cn$1(className, iconButtonVariants({
|
|
966
|
+
isIconOnly,
|
|
967
|
+
size,
|
|
968
|
+
variant
|
|
969
|
+
})),
|
|
970
|
+
...props
|
|
971
|
+
});
|
|
972
|
+
};
|
|
973
|
+
var icon_button_default = IconButton;
|
|
974
|
+
|
|
975
|
+
//#endregion
|
|
976
|
+
//#region src/components/input/input.variants.ts
|
|
977
|
+
const inputVariants = tv({ base: "input" });
|
|
978
|
+
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/components/input/input.tsx
|
|
981
|
+
const Input$1 = ({ className, ...props }) => {
|
|
982
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
983
|
+
className: cn$1(className, inputVariants()),
|
|
984
|
+
...props
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
var input_default = Input$1;
|
|
988
|
+
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/components/label/label.variants.ts
|
|
991
|
+
const labelVariants = tv({ base: "label" });
|
|
992
|
+
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/components/label/label.tsx
|
|
995
|
+
const Label = ({ className, ...props }) => {
|
|
996
|
+
return /* @__PURE__ */ jsx("label", {
|
|
997
|
+
className: cn$1(className, labelVariants()),
|
|
998
|
+
...props
|
|
999
|
+
});
|
|
1000
|
+
};
|
|
1001
|
+
var label_default = Label;
|
|
1002
|
+
|
|
1003
|
+
//#endregion
|
|
1004
|
+
//#region src/components/link/link.variants.ts
|
|
1005
|
+
const linkVariants = tv({
|
|
1006
|
+
base: "link",
|
|
1007
|
+
defaultVariants: { variant: "no-underline" },
|
|
1008
|
+
variants: { variant: {
|
|
1009
|
+
"no-underline": "link--no-underline",
|
|
1010
|
+
underline: "link--underline"
|
|
1011
|
+
} }
|
|
1012
|
+
});
|
|
1013
|
+
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/components/link/link.tsx
|
|
1016
|
+
const Link = ({ className, variant, ...props }) => {
|
|
1017
|
+
return /* @__PURE__ */ jsx("a", {
|
|
1018
|
+
className: cn$1(className, linkVariants({ variant })),
|
|
1019
|
+
...props
|
|
1020
|
+
});
|
|
1021
|
+
};
|
|
1022
|
+
var link_default = Link;
|
|
1023
|
+
|
|
1024
|
+
//#endregion
|
|
1025
|
+
//#region src/components/list/list.context.ts
|
|
1026
|
+
const ListContext = createContext(null);
|
|
1027
|
+
|
|
1028
|
+
//#endregion
|
|
1029
|
+
//#region src/components/list/list.variants.ts
|
|
1030
|
+
const listVariants = tv({ slots: {
|
|
1031
|
+
item: "list__item",
|
|
1032
|
+
root: "list"
|
|
1033
|
+
} });
|
|
1034
|
+
|
|
1035
|
+
//#endregion
|
|
1036
|
+
//#region src/components/list/use-list.ts
|
|
1037
|
+
const useList = () => {
|
|
1038
|
+
const context = useContext(ListContext);
|
|
1039
|
+
if (!context) throw new Error("useList must be used within a ListProvider");
|
|
1040
|
+
return context;
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region src/components/list/list.tsx
|
|
1045
|
+
const List = ({ className, ...props }) => {
|
|
1046
|
+
const slots = useMemo(() => listVariants(), []);
|
|
1047
|
+
return /* @__PURE__ */ jsx(ListContext.Provider, {
|
|
1048
|
+
value: { slots },
|
|
1049
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
1050
|
+
className: cn$1(className, slots.root()),
|
|
1051
|
+
...props
|
|
1052
|
+
})
|
|
1053
|
+
});
|
|
1054
|
+
};
|
|
1055
|
+
const ListItem = ({ className, ...props }) => {
|
|
1056
|
+
const { slots } = useList();
|
|
1057
|
+
return /* @__PURE__ */ jsx("li", {
|
|
1058
|
+
className: cn$1(className, slots.item()),
|
|
1059
|
+
...props
|
|
1060
|
+
});
|
|
1061
|
+
};
|
|
1062
|
+
var list_default = Object.assign(List, {
|
|
1063
|
+
Item: ListItem,
|
|
1064
|
+
Root: List
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1067
|
+
//#endregion
|
|
1068
|
+
//#region src/components/menu/menu.context.ts
|
|
1069
|
+
const MenuContext = createContext(null);
|
|
1070
|
+
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region src/components/menu/menu.variants.ts
|
|
1073
|
+
const menuVariants = tv({ slots: {
|
|
1074
|
+
arrow: "menu__arrow",
|
|
1075
|
+
backdrop: "menu__backdrop",
|
|
1076
|
+
checkboxItem: "menu__checkbox-item",
|
|
1077
|
+
group: "menu__group",
|
|
1078
|
+
groupLabel: "menu__group-label",
|
|
1079
|
+
item: "menu__item",
|
|
1080
|
+
popup: "menu__popup",
|
|
1081
|
+
portal: "menu__portal",
|
|
1082
|
+
positioner: "menu__positioner",
|
|
1083
|
+
radioGroup: "menu__radio-group",
|
|
1084
|
+
radioItem: "menu__radio-item",
|
|
1085
|
+
root: "menu",
|
|
1086
|
+
separator: "menu__separator",
|
|
1087
|
+
submenu: "menu__submenu",
|
|
1088
|
+
submenuTrigger: "menu__submenu__trigger",
|
|
1089
|
+
trigger: "menu__trigger"
|
|
1090
|
+
} });
|
|
1091
|
+
|
|
1092
|
+
//#endregion
|
|
1093
|
+
//#region src/components/menu/use-menu.ts
|
|
1094
|
+
const useMenu = () => {
|
|
1095
|
+
const context = useContext(MenuContext);
|
|
1096
|
+
if (!context) throw new Error("useMenu must be used within a MenuProvider");
|
|
1097
|
+
return context;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
//#endregion
|
|
1101
|
+
//#region src/components/menu/menu.tsx
|
|
1102
|
+
const Menu$1 = ({ ...props }) => {
|
|
1103
|
+
const slots = useMemo(() => menuVariants(), []);
|
|
1104
|
+
return /* @__PURE__ */ jsx(MenuContext.Provider, {
|
|
1105
|
+
value: { slots },
|
|
1106
|
+
children: /* @__PURE__ */ jsx(Menu.Root, { ...props })
|
|
1107
|
+
});
|
|
1108
|
+
};
|
|
1109
|
+
const MenuTrigger = ({ className, ...props }) => {
|
|
1110
|
+
const { slots } = useMenu();
|
|
1111
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
1112
|
+
className: cn$1(slots.trigger(), className),
|
|
1113
|
+
...props
|
|
1114
|
+
});
|
|
1115
|
+
};
|
|
1116
|
+
const MenuPortal = ({ className, ...props }) => {
|
|
1117
|
+
const { slots } = useMenu();
|
|
1118
|
+
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
1119
|
+
className: cn$1(slots.portal(), className),
|
|
1120
|
+
...props
|
|
1121
|
+
});
|
|
1122
|
+
};
|
|
1123
|
+
const MenuBackdrop = ({ className, ...props }) => {
|
|
1124
|
+
const { slots } = useMenu();
|
|
1125
|
+
return /* @__PURE__ */ jsx(Menu.Backdrop, {
|
|
1126
|
+
className: cn$1(slots.backdrop(), className),
|
|
1127
|
+
...props
|
|
1128
|
+
});
|
|
1129
|
+
};
|
|
1130
|
+
const MenuPositioner = ({ className, ...props }) => {
|
|
1131
|
+
const { slots } = useMenu();
|
|
1132
|
+
return /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
1133
|
+
className: cn$1(slots.positioner(), className),
|
|
1134
|
+
...props
|
|
1135
|
+
});
|
|
1136
|
+
};
|
|
1137
|
+
const MenuPopup = ({ className, ...props }) => {
|
|
1138
|
+
const { slots } = useMenu();
|
|
1139
|
+
return /* @__PURE__ */ jsx(Menu.Popup, {
|
|
1140
|
+
className: cn$1(slots.popup(), className),
|
|
1141
|
+
...props
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
const MenuArrow = ({ className, children, ...props }) => {
|
|
1145
|
+
const { slots } = useMenu();
|
|
1146
|
+
return /* @__PURE__ */ jsx(Menu.Arrow, {
|
|
1147
|
+
className: cn$1(slots.arrow(), className),
|
|
1148
|
+
...props,
|
|
1149
|
+
children: children ?? /* @__PURE__ */ jsx(LucideChevronUp, {})
|
|
1150
|
+
});
|
|
1151
|
+
};
|
|
1152
|
+
const MenuItem = ({ className, ...props }) => {
|
|
1153
|
+
const { slots } = useMenu();
|
|
1154
|
+
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
1155
|
+
className: cn$1(slots.item(), className),
|
|
1156
|
+
...props
|
|
1157
|
+
});
|
|
1158
|
+
};
|
|
1159
|
+
const MenuSeparator = ({ className, ...props }) => {
|
|
1160
|
+
const { slots } = useMenu();
|
|
1161
|
+
return /* @__PURE__ */ jsx(Menu.Separator, {
|
|
1162
|
+
className: cn$1(slots.separator(), className),
|
|
1163
|
+
...props
|
|
1164
|
+
});
|
|
1165
|
+
};
|
|
1166
|
+
const MenuGroup = ({ className, ...props }) => {
|
|
1167
|
+
const { slots } = useMenu();
|
|
1168
|
+
return /* @__PURE__ */ jsx(Menu.Group, {
|
|
1169
|
+
className: cn$1(slots.group(), className),
|
|
1170
|
+
...props
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
const MenuGroupLabel = ({ className, ...props }) => {
|
|
1174
|
+
const { slots } = useMenu();
|
|
1175
|
+
return /* @__PURE__ */ jsx(Menu.GroupLabel, {
|
|
1176
|
+
className: cn$1(slots.groupLabel(), className),
|
|
1177
|
+
...props
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
const MenuRadioGroup = ({ className, ...props }) => {
|
|
1181
|
+
const { slots } = useMenu();
|
|
1182
|
+
return /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
1183
|
+
className: cn$1(slots.radioGroup(), className),
|
|
1184
|
+
...props
|
|
1185
|
+
});
|
|
1186
|
+
};
|
|
1187
|
+
const MenuRadioItem = ({ className, ...props }) => {
|
|
1188
|
+
const { slots } = useMenu();
|
|
1189
|
+
return /* @__PURE__ */ jsx(Menu.RadioItem, {
|
|
1190
|
+
className: cn$1(slots.radioItem(), className),
|
|
1191
|
+
...props
|
|
1192
|
+
});
|
|
1193
|
+
};
|
|
1194
|
+
const MenuCheckboxItem = ({ className, ...props }) => {
|
|
1195
|
+
const { slots } = useMenu();
|
|
1196
|
+
return /* @__PURE__ */ jsx(Menu.CheckboxItem, {
|
|
1197
|
+
className: cn$1(slots.checkboxItem(), className),
|
|
1198
|
+
...props
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1201
|
+
const MenuSubmenu = ({ ...props }) => {
|
|
1202
|
+
return /* @__PURE__ */ jsx(Menu.SubmenuRoot, { ...props });
|
|
1203
|
+
};
|
|
1204
|
+
const MenuSubmenuTrigger = ({ className, ...props }) => {
|
|
1205
|
+
const { slots } = useMenu();
|
|
1206
|
+
return /* @__PURE__ */ jsx(Menu.SubmenuTrigger, {
|
|
1207
|
+
className: cn$1(slots.submenuTrigger(), className),
|
|
1208
|
+
...props
|
|
1209
|
+
});
|
|
1210
|
+
};
|
|
1211
|
+
var menu_default = Object.assign(Menu$1, {
|
|
1212
|
+
Arrow: MenuArrow,
|
|
1213
|
+
Backdrop: MenuBackdrop,
|
|
1214
|
+
CheckboxItem: MenuCheckboxItem,
|
|
1215
|
+
Group: MenuGroup,
|
|
1216
|
+
GroupLabel: MenuGroupLabel,
|
|
1217
|
+
Item: MenuItem,
|
|
1218
|
+
Popup: MenuPopup,
|
|
1219
|
+
Portal: MenuPortal,
|
|
1220
|
+
Positioner: MenuPositioner,
|
|
1221
|
+
RadioGroup: MenuRadioGroup,
|
|
1222
|
+
RadioItem: MenuRadioItem,
|
|
1223
|
+
Root: Menu$1,
|
|
1224
|
+
Separator: MenuSeparator,
|
|
1225
|
+
Submenu: MenuSubmenu,
|
|
1226
|
+
SubmenuTrigger: MenuSubmenuTrigger,
|
|
1227
|
+
Trigger: MenuTrigger
|
|
1228
|
+
});
|
|
1229
|
+
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/components/meter/meter.context.ts
|
|
1232
|
+
const MeterContext = createContext(void 0);
|
|
1233
|
+
|
|
1234
|
+
//#endregion
|
|
1235
|
+
//#region src/components/meter/meter.variants.ts
|
|
1236
|
+
const meterVariants = tv({
|
|
1237
|
+
slots: {
|
|
1238
|
+
indicator: "meter__indicator",
|
|
1239
|
+
label: "meter__label",
|
|
1240
|
+
root: "meter",
|
|
1241
|
+
track: "meter__track",
|
|
1242
|
+
value: "meter__value"
|
|
1243
|
+
},
|
|
1244
|
+
variants: {
|
|
1245
|
+
size: {
|
|
1246
|
+
lg: { root: "meter--lg" },
|
|
1247
|
+
md: { root: "meter--md" },
|
|
1248
|
+
sm: { root: "meter--sm" }
|
|
1249
|
+
},
|
|
1250
|
+
variant: {
|
|
1251
|
+
danger: { root: "meter--danger" },
|
|
1252
|
+
primary: { root: "meter--primary" },
|
|
1253
|
+
secondary: { root: "meter--secondary" },
|
|
1254
|
+
success: { root: "meter--success" }
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
//#endregion
|
|
1260
|
+
//#region src/components/meter/use-meter.ts
|
|
1261
|
+
const useMeter = () => {
|
|
1262
|
+
const context = useContext(MeterContext);
|
|
1263
|
+
if (!context) throw new Error("useMeter must be used within a MeterProvider");
|
|
1264
|
+
return context;
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region src/components/meter/meter.tsx
|
|
1269
|
+
const Meter$1 = ({ className, size, variant, ...props }) => {
|
|
1270
|
+
const slots = useMemo(() => meterVariants({
|
|
1271
|
+
size,
|
|
1272
|
+
variant
|
|
1273
|
+
}), [size, variant]);
|
|
1274
|
+
return /* @__PURE__ */ jsx(MeterContext, {
|
|
1275
|
+
value: { slots },
|
|
1276
|
+
children: /* @__PURE__ */ jsx(Meter.Root, {
|
|
1277
|
+
className: cn$1(className, slots.root()),
|
|
1278
|
+
...props
|
|
1279
|
+
})
|
|
1280
|
+
});
|
|
1281
|
+
};
|
|
1282
|
+
const MeterLabel = ({ className, ...props }) => {
|
|
1283
|
+
const { slots } = useMeter();
|
|
1284
|
+
return /* @__PURE__ */ jsx(Meter.Label, {
|
|
1285
|
+
className: cn$1(className, slots.label()),
|
|
1286
|
+
...props
|
|
1287
|
+
});
|
|
1288
|
+
};
|
|
1289
|
+
const MeterValue = ({ className, ...props }) => {
|
|
1290
|
+
const { slots } = useMeter();
|
|
1291
|
+
return /* @__PURE__ */ jsx(Meter.Value, {
|
|
1292
|
+
className: cn$1(className, slots.value()),
|
|
1293
|
+
...props
|
|
1294
|
+
});
|
|
1295
|
+
};
|
|
1296
|
+
const MeterTrack = ({ className, ...props }) => {
|
|
1297
|
+
const { slots } = useMeter();
|
|
1298
|
+
return /* @__PURE__ */ jsx(Meter.Track, {
|
|
1299
|
+
className: cn$1(className, slots.track()),
|
|
1300
|
+
...props
|
|
1301
|
+
});
|
|
1302
|
+
};
|
|
1303
|
+
const MeterIndicator = ({ className, ...props }) => {
|
|
1304
|
+
const { slots } = useMeter();
|
|
1305
|
+
return /* @__PURE__ */ jsx(Meter.Indicator, {
|
|
1306
|
+
className: cn$1(className, slots.indicator()),
|
|
1307
|
+
...props
|
|
1308
|
+
});
|
|
1309
|
+
};
|
|
1310
|
+
var meter_default = Object.assign(Meter$1, {
|
|
1311
|
+
Indicator: MeterIndicator,
|
|
1312
|
+
Label: MeterLabel,
|
|
1313
|
+
Root: Meter$1,
|
|
1314
|
+
Track: MeterTrack,
|
|
1315
|
+
Value: MeterValue
|
|
1316
|
+
});
|
|
1317
|
+
|
|
1318
|
+
//#endregion
|
|
1319
|
+
//#region src/components/separator/separator.variants.ts
|
|
1320
|
+
const separatorVariants = tv({
|
|
1321
|
+
base: "separator",
|
|
1322
|
+
defaultVariants: { orientation: "horizontal" },
|
|
1323
|
+
variants: { orientation: {
|
|
1324
|
+
horizontal: "separator--horizontal",
|
|
1325
|
+
vertical: "separator--vertical"
|
|
1326
|
+
} }
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1329
|
+
//#endregion
|
|
1330
|
+
//#region src/components/separator/separator.tsx
|
|
1331
|
+
const Separator$1 = ({ className, orientation, ...props }) => {
|
|
1332
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
1333
|
+
className: cn$1(className, separatorVariants({ orientation })),
|
|
1334
|
+
...props
|
|
1335
|
+
});
|
|
1336
|
+
};
|
|
1337
|
+
var separator_default = Separator$1;
|
|
1338
|
+
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region src/components/navbar/navbar.context.ts
|
|
1341
|
+
const NavbarContext = createContext(null);
|
|
1342
|
+
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region src/components/navbar/navbar.variants.ts
|
|
1345
|
+
const navbarVariants = tv({ slots: {
|
|
1346
|
+
container: "navbar__container",
|
|
1347
|
+
content: "navbar__content",
|
|
1348
|
+
list: "navbar__list",
|
|
1349
|
+
listItem: "navbar__list-item",
|
|
1350
|
+
menu: "navbar__menu",
|
|
1351
|
+
menuItem: "navbar__menu-item",
|
|
1352
|
+
root: "navbar",
|
|
1353
|
+
toggle: "navbar__toggle"
|
|
1354
|
+
} });
|
|
1355
|
+
|
|
1356
|
+
//#endregion
|
|
1357
|
+
//#region src/components/navbar/use-navbar.ts
|
|
1358
|
+
const useNavbar = () => {
|
|
1359
|
+
const context = React.useContext(NavbarContext);
|
|
1360
|
+
if (!context) throw new Error("useNavbar must be used within a NavbarProvider");
|
|
1361
|
+
return context;
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
//#endregion
|
|
1365
|
+
//#region src/components/navbar/navbar.tsx
|
|
1366
|
+
const Navbar = ({ className, isOpen, onOpenChange, ...props }) => {
|
|
1367
|
+
const slots = useMemo(() => navbarVariants(), []);
|
|
1368
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
1369
|
+
const open = isOpen ?? internalOpen;
|
|
1370
|
+
const handleOpenChange = useCallback((next) => {
|
|
1371
|
+
if (isOpen === void 0) setInternalOpen(next);
|
|
1372
|
+
onOpenChange?.(next);
|
|
1373
|
+
}, [isOpen, onOpenChange]);
|
|
1374
|
+
return /* @__PURE__ */ jsx(NavbarContext.Provider, {
|
|
1375
|
+
value: {
|
|
1376
|
+
isOpen: open,
|
|
1377
|
+
onOpenChange: handleOpenChange,
|
|
1378
|
+
slots
|
|
1379
|
+
},
|
|
1380
|
+
children: /* @__PURE__ */ jsx("header", {
|
|
1381
|
+
className: cn$1(slots.root(), className),
|
|
1382
|
+
...props
|
|
1383
|
+
})
|
|
1384
|
+
});
|
|
1385
|
+
};
|
|
1386
|
+
const NavbarContainer = ({ className, ...props }) => {
|
|
1387
|
+
const { slots } = useNavbar();
|
|
1388
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
1389
|
+
className: cn$1(slots.container(), className),
|
|
1390
|
+
...props
|
|
1391
|
+
});
|
|
1392
|
+
};
|
|
1393
|
+
const NavbarContent = ({ className, ...props }) => {
|
|
1394
|
+
const { slots } = useNavbar();
|
|
1395
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1396
|
+
className: cn$1(slots.content(), className),
|
|
1397
|
+
...props
|
|
1398
|
+
});
|
|
1399
|
+
};
|
|
1400
|
+
const NavbarList = ({ className, ...props }) => {
|
|
1401
|
+
const { slots } = useNavbar();
|
|
1402
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
1403
|
+
className: cn$1(slots.list(), className),
|
|
1404
|
+
...props
|
|
1405
|
+
});
|
|
1406
|
+
};
|
|
1407
|
+
const NavbarListItem = ({ className, ...props }) => {
|
|
1408
|
+
const { slots } = useNavbar();
|
|
1409
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
1410
|
+
className: cn$1(slots.listItem(), className),
|
|
1411
|
+
...props
|
|
1412
|
+
});
|
|
1413
|
+
};
|
|
1414
|
+
const NavbarToggle = ({ className, ...props }) => {
|
|
1415
|
+
const { slots, isOpen, onOpenChange } = useNavbar();
|
|
1416
|
+
const Icon = isOpen ? LucideX : LucideMenu;
|
|
1417
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1418
|
+
className: cn$1(className, slots.toggle()),
|
|
1419
|
+
onClick: () => onOpenChange(!isOpen),
|
|
1420
|
+
...props,
|
|
1421
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "size-5" })
|
|
1422
|
+
});
|
|
1423
|
+
};
|
|
1424
|
+
const NavbarMenu = ({ className, header, ...props }) => {
|
|
1425
|
+
const { slots, isOpen, onOpenChange } = useNavbar();
|
|
1426
|
+
return /* @__PURE__ */ jsx(drawer_default, {
|
|
1427
|
+
onOpenChange,
|
|
1428
|
+
open: isOpen,
|
|
1429
|
+
children: /* @__PURE__ */ jsxs(drawer_default.Portal, { children: [/* @__PURE__ */ jsx(drawer_default.Backdrop, {}), /* @__PURE__ */ jsx(drawer_default.Viewport, { children: /* @__PURE__ */ jsxs(drawer_default.Popup, { children: [
|
|
1430
|
+
header,
|
|
1431
|
+
/* @__PURE__ */ jsx(drawer_default.Close, {}),
|
|
1432
|
+
/* @__PURE__ */ jsx(separator_default, {}),
|
|
1433
|
+
/* @__PURE__ */ jsx("ul", {
|
|
1434
|
+
className: cn$1(slots.menu(), className),
|
|
1435
|
+
...props
|
|
1436
|
+
})
|
|
1437
|
+
] }) })] })
|
|
1438
|
+
});
|
|
1439
|
+
};
|
|
1440
|
+
const NavbarMenuItem = ({ className, ...props }) => {
|
|
1441
|
+
const { slots } = useNavbar();
|
|
1442
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
1443
|
+
className: cn$1(slots.menuItem(), className),
|
|
1444
|
+
...props
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1447
|
+
var navbar_default = Object.assign(Navbar, {
|
|
1448
|
+
Container: NavbarContainer,
|
|
1449
|
+
Content: NavbarContent,
|
|
1450
|
+
List: NavbarList,
|
|
1451
|
+
ListItem: NavbarListItem,
|
|
1452
|
+
Menu: NavbarMenu,
|
|
1453
|
+
MenuItem: NavbarMenuItem,
|
|
1454
|
+
Root: Navbar,
|
|
1455
|
+
Toggle: NavbarToggle
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
//#endregion
|
|
1459
|
+
//#region src/components/popover/popover.context.ts
|
|
1460
|
+
const PopoverContext = createContext(null);
|
|
1461
|
+
|
|
1462
|
+
//#endregion
|
|
1463
|
+
//#region src/components/popover/popover.variants.ts
|
|
1464
|
+
const popoverVariants = tv({ slots: {
|
|
1465
|
+
arrow: "popover__arrow",
|
|
1466
|
+
backdrop: "popover__backdrop",
|
|
1467
|
+
close: "popover__close",
|
|
1468
|
+
content: "popover__content",
|
|
1469
|
+
description: "popover__description",
|
|
1470
|
+
popup: "popover__popup",
|
|
1471
|
+
portal: "popover__portal",
|
|
1472
|
+
positioner: "popover__positioner",
|
|
1473
|
+
root: "popover",
|
|
1474
|
+
title: "popover__title",
|
|
1475
|
+
trigger: "popover__trigger",
|
|
1476
|
+
viewport: "popover__viewport"
|
|
1477
|
+
} });
|
|
1478
|
+
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/components/popover/use-popover.ts
|
|
1481
|
+
const usePopover = () => {
|
|
1482
|
+
const context = useContext(PopoverContext);
|
|
1483
|
+
if (!context) throw new Error("usePopover must be used within a PopoverProvider");
|
|
1484
|
+
return context;
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region src/components/popover/popover.tsx
|
|
1489
|
+
const Popover$1 = ({ ...props }) => {
|
|
1490
|
+
return /* @__PURE__ */ jsx(PopoverContext, {
|
|
1491
|
+
value: { slots: useMemo(() => popoverVariants({}), []) },
|
|
1492
|
+
children: /* @__PURE__ */ jsx(Popover.Root, { ...props })
|
|
1493
|
+
});
|
|
1494
|
+
};
|
|
1495
|
+
const PopoverTrigger = ({ className, ...props }) => {
|
|
1496
|
+
const { slots } = usePopover();
|
|
1497
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
1498
|
+
className: cn$1(className, slots.trigger()),
|
|
1499
|
+
...props
|
|
1500
|
+
});
|
|
1501
|
+
};
|
|
1502
|
+
const PopoverPortal = ({ className, ...props }) => {
|
|
1503
|
+
const { slots } = usePopover();
|
|
1504
|
+
return /* @__PURE__ */ jsx(Popover.Portal, {
|
|
1505
|
+
className: cn$1(className, slots.portal()),
|
|
1506
|
+
...props
|
|
1507
|
+
});
|
|
1508
|
+
};
|
|
1509
|
+
const PopoverBackdrop = ({ className, ...props }) => {
|
|
1510
|
+
const { slots } = usePopover();
|
|
1511
|
+
return /* @__PURE__ */ jsx(Popover.Backdrop, {
|
|
1512
|
+
className: cn$1(className, slots.backdrop()),
|
|
1513
|
+
...props
|
|
1514
|
+
});
|
|
1515
|
+
};
|
|
1516
|
+
const PopoverPositioner = ({ className, ...props }) => {
|
|
1517
|
+
const { slots } = usePopover();
|
|
1518
|
+
return /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
1519
|
+
className: cn$1(className, slots.positioner()),
|
|
1520
|
+
...props
|
|
1521
|
+
});
|
|
1522
|
+
};
|
|
1523
|
+
const PopoverPopup = ({ className, ...props }) => {
|
|
1524
|
+
const { slots } = usePopover();
|
|
1525
|
+
return /* @__PURE__ */ jsx(Popover.Popup, {
|
|
1526
|
+
className: cn$1(className, slots.popup()),
|
|
1527
|
+
...props
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
const PopoverArrow = ({ className, ...props }) => {
|
|
1531
|
+
const { slots } = usePopover();
|
|
1532
|
+
return /* @__PURE__ */ jsx(Popover.Arrow, {
|
|
1533
|
+
className: cn$1(className, slots.arrow()),
|
|
1534
|
+
...props
|
|
1535
|
+
});
|
|
1536
|
+
};
|
|
1537
|
+
const PopoverViewport = ({ className, ...props }) => {
|
|
1538
|
+
const { slots } = usePopover();
|
|
1539
|
+
return /* @__PURE__ */ jsx(Popover.Viewport, {
|
|
1540
|
+
className: cn$1(className, slots.viewport()),
|
|
1541
|
+
...props
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
const PopoverTitle = ({ className, ...props }) => {
|
|
1545
|
+
const { slots } = usePopover();
|
|
1546
|
+
return /* @__PURE__ */ jsx(Popover.Title, {
|
|
1547
|
+
className: cn$1(className, slots.title()),
|
|
1548
|
+
...props
|
|
1549
|
+
});
|
|
1550
|
+
};
|
|
1551
|
+
const PopoverDescription = ({ className, ...props }) => {
|
|
1552
|
+
const { slots } = usePopover();
|
|
1553
|
+
return /* @__PURE__ */ jsx(Popover.Description, {
|
|
1554
|
+
className: cn$1(className, slots.description()),
|
|
1555
|
+
...props
|
|
1556
|
+
});
|
|
1557
|
+
};
|
|
1558
|
+
const PopoverClose = ({ className, children, ...props }) => {
|
|
1559
|
+
const { slots } = usePopover();
|
|
1560
|
+
return /* @__PURE__ */ jsx(Popover.Close, {
|
|
1561
|
+
className: cn$1(className, slots.close()),
|
|
1562
|
+
...props,
|
|
1563
|
+
children: children ?? /* @__PURE__ */ jsx(LucideX, {})
|
|
1564
|
+
});
|
|
1565
|
+
};
|
|
1566
|
+
var popover_default = Object.assign(Popover$1, {
|
|
1567
|
+
Arrow: PopoverArrow,
|
|
1568
|
+
Backdrop: PopoverBackdrop,
|
|
1569
|
+
Close: PopoverClose,
|
|
1570
|
+
Description: PopoverDescription,
|
|
1571
|
+
Popup: PopoverPopup,
|
|
1572
|
+
Portal: PopoverPortal,
|
|
1573
|
+
Positioner: PopoverPositioner,
|
|
1574
|
+
Root: Popover$1,
|
|
1575
|
+
Title: PopoverTitle,
|
|
1576
|
+
Trigger: PopoverTrigger,
|
|
1577
|
+
Viewport: PopoverViewport
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
//#endregion
|
|
1581
|
+
//#region src/components/progress/progress.context.ts
|
|
1582
|
+
const ProgressContext = createContext(null);
|
|
1583
|
+
|
|
1584
|
+
//#endregion
|
|
1585
|
+
//#region src/components/progress/progress.variants.ts
|
|
1586
|
+
const progressVariants = tv({
|
|
1587
|
+
defaultVariants: {
|
|
1588
|
+
size: "md",
|
|
1589
|
+
variant: "primary"
|
|
1590
|
+
},
|
|
1591
|
+
slots: {
|
|
1592
|
+
indicator: "progress__indicator",
|
|
1593
|
+
label: "progress__label",
|
|
1594
|
+
root: "progress",
|
|
1595
|
+
track: "progress__track",
|
|
1596
|
+
value: "progress__value"
|
|
1597
|
+
},
|
|
1598
|
+
variants: {
|
|
1599
|
+
size: {
|
|
1600
|
+
lg: { root: "progress--lg" },
|
|
1601
|
+
md: { root: "progress--md" },
|
|
1602
|
+
sm: { root: "progress--sm" }
|
|
1603
|
+
},
|
|
1604
|
+
variant: {
|
|
1605
|
+
danger: { root: "progress--danger" },
|
|
1606
|
+
primary: { root: "progress--primary" },
|
|
1607
|
+
secondary: { root: "progress--secondary" },
|
|
1608
|
+
success: { root: "progress--success" }
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
//#endregion
|
|
1614
|
+
//#region src/components/progress/use-progress.ts
|
|
1615
|
+
const useProgress = () => {
|
|
1616
|
+
const context = useContext(ProgressContext);
|
|
1617
|
+
if (!context) throw new Error("useProgress must be used within a ProgressProvider");
|
|
1618
|
+
return context;
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1621
|
+
//#endregion
|
|
1622
|
+
//#region src/components/progress/progress.tsx
|
|
1623
|
+
const Progress$1 = ({ className, variant, size, ...props }) => {
|
|
1624
|
+
const slots = useMemo(() => progressVariants({
|
|
1625
|
+
size,
|
|
1626
|
+
variant
|
|
1627
|
+
}), [variant, size]);
|
|
1628
|
+
return /* @__PURE__ */ jsx(ProgressContext, {
|
|
1629
|
+
value: { slots },
|
|
1630
|
+
children: /* @__PURE__ */ jsx(Progress.Root, {
|
|
1631
|
+
className: cn$1(className, slots.root()),
|
|
1632
|
+
...props
|
|
1633
|
+
})
|
|
1634
|
+
});
|
|
1635
|
+
};
|
|
1636
|
+
const ProgressLabel = ({ className, ...props }) => {
|
|
1637
|
+
const { slots } = useProgress();
|
|
1638
|
+
return /* @__PURE__ */ jsx(Progress.Label, {
|
|
1639
|
+
className: cn$1(className, slots.label()),
|
|
1640
|
+
...props
|
|
1641
|
+
});
|
|
1642
|
+
};
|
|
1643
|
+
const ProgressValue = ({ className, ...props }) => {
|
|
1644
|
+
const { slots } = useProgress();
|
|
1645
|
+
return /* @__PURE__ */ jsx(Progress.Value, {
|
|
1646
|
+
className: cn$1(className, slots.value()),
|
|
1647
|
+
...props
|
|
1648
|
+
});
|
|
1649
|
+
};
|
|
1650
|
+
const ProgressTrack = ({ className, ...props }) => {
|
|
1651
|
+
const { slots } = useProgress();
|
|
1652
|
+
return /* @__PURE__ */ jsx(Progress.Track, {
|
|
1653
|
+
className: cn$1(className, slots.track()),
|
|
1654
|
+
...props
|
|
1655
|
+
});
|
|
1656
|
+
};
|
|
1657
|
+
const ProgressIndicator = ({ className, ...props }) => {
|
|
1658
|
+
const { slots } = useProgress();
|
|
1659
|
+
return /* @__PURE__ */ jsx(Progress.Indicator, {
|
|
1660
|
+
className: cn$1(className, slots.indicator()),
|
|
1661
|
+
...props
|
|
1662
|
+
});
|
|
1663
|
+
};
|
|
1664
|
+
var progress_default = Object.assign(Progress$1, {
|
|
1665
|
+
Indicator: ProgressIndicator,
|
|
1666
|
+
Label: ProgressLabel,
|
|
1667
|
+
Root: Progress$1,
|
|
1668
|
+
Track: ProgressTrack,
|
|
1669
|
+
Value: ProgressValue
|
|
1670
|
+
});
|
|
1671
|
+
|
|
1672
|
+
//#endregion
|
|
1673
|
+
//#region src/components/radio/radio.context.ts
|
|
1674
|
+
const RadioContext = createContext(null);
|
|
1675
|
+
|
|
1676
|
+
//#endregion
|
|
1677
|
+
//#region src/components/radio/radio.variants.ts
|
|
1678
|
+
const radioVariants = tv({ slots: {
|
|
1679
|
+
indicator: "radio__indicator",
|
|
1680
|
+
root: "radio"
|
|
1681
|
+
} });
|
|
1682
|
+
|
|
1683
|
+
//#endregion
|
|
1684
|
+
//#region src/components/radio/use-radio.ts
|
|
1685
|
+
const useRadio = () => {
|
|
1686
|
+
const context = useContext(RadioContext);
|
|
1687
|
+
if (!context) throw new Error("useRadio must be used within a RadioProvider");
|
|
1688
|
+
return context;
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
//#endregion
|
|
1692
|
+
//#region src/components/radio/radio.tsx
|
|
1693
|
+
const Radio$1 = ({ className, ...props }) => {
|
|
1694
|
+
const slots = useMemo(() => radioVariants({}), []);
|
|
1695
|
+
return /* @__PURE__ */ jsx(RadioContext, {
|
|
1696
|
+
value: { slots },
|
|
1697
|
+
children: /* @__PURE__ */ jsx(Radio.Root, {
|
|
1698
|
+
className: cn$1(slots.root(), className),
|
|
1699
|
+
...props
|
|
1700
|
+
})
|
|
1701
|
+
});
|
|
1702
|
+
};
|
|
1703
|
+
const RadioIndicator = ({ className, ...props }) => {
|
|
1704
|
+
const { slots } = useRadio();
|
|
1705
|
+
return /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
1706
|
+
className: cn$1(slots.indicator(), className),
|
|
1707
|
+
...props
|
|
1708
|
+
});
|
|
1709
|
+
};
|
|
1710
|
+
var radio_default = Object.assign(Radio$1, {
|
|
1711
|
+
Indicator: RadioIndicator,
|
|
1712
|
+
Root: Radio$1
|
|
1713
|
+
});
|
|
1714
|
+
|
|
1715
|
+
//#endregion
|
|
1716
|
+
//#region src/components/radio-group/radio-group.variants.ts
|
|
1717
|
+
const radioGroupVariants = tv({ base: "radio-group" });
|
|
1718
|
+
|
|
1719
|
+
//#endregion
|
|
1720
|
+
//#region src/components/radio-group/radio-group.tsx
|
|
1721
|
+
const RadioGroup$1 = ({ className, ...props }) => {
|
|
1722
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
1723
|
+
className: cn$1(className, useMemo(() => radioGroupVariants(), [])),
|
|
1724
|
+
...props
|
|
1725
|
+
});
|
|
1726
|
+
};
|
|
1727
|
+
var radio_group_default = RadioGroup$1;
|
|
1728
|
+
|
|
1729
|
+
//#endregion
|
|
1730
|
+
//#region src/components/select/select.context.ts
|
|
1731
|
+
const SelectContext = createContext(null);
|
|
1732
|
+
|
|
1733
|
+
//#endregion
|
|
1734
|
+
//#region src/components/select/select.variants.ts
|
|
1735
|
+
const selectVariants = tv({ slots: {
|
|
1736
|
+
control: "select__control",
|
|
1737
|
+
description: "select__description",
|
|
1738
|
+
error: "select__error",
|
|
1739
|
+
label: "select__label",
|
|
1740
|
+
option: "select__option",
|
|
1741
|
+
root: "select"
|
|
1742
|
+
} });
|
|
1743
|
+
|
|
1744
|
+
//#endregion
|
|
1745
|
+
//#region src/components/select/use-select.ts
|
|
1746
|
+
const useSelect = () => {
|
|
1747
|
+
const context = useContext(SelectContext);
|
|
1748
|
+
if (!context) throw new Error("useSelect must be used within a SelectProvider");
|
|
1749
|
+
return context;
|
|
1750
|
+
};
|
|
1751
|
+
|
|
1752
|
+
//#endregion
|
|
1753
|
+
//#region src/components/select/select.tsx
|
|
1754
|
+
const Select = ({ className, ...props }) => {
|
|
1755
|
+
const slots = useMemo(() => selectVariants(), []);
|
|
1756
|
+
const generatedId = useId();
|
|
1757
|
+
const inputId = props.id || generatedId;
|
|
1758
|
+
return /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
1759
|
+
value: {
|
|
1760
|
+
id: inputId,
|
|
1761
|
+
slots
|
|
1762
|
+
},
|
|
1763
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1764
|
+
className: cn$1(className, slots.root()),
|
|
1765
|
+
...props
|
|
1766
|
+
})
|
|
1767
|
+
});
|
|
1768
|
+
};
|
|
1769
|
+
const SelectLabel = ({ className, ...props }) => {
|
|
1770
|
+
const { slots, id } = useSelect();
|
|
1771
|
+
return /* @__PURE__ */ jsx("label", {
|
|
1772
|
+
className: cn$1(className, slots.label()),
|
|
1773
|
+
htmlFor: id,
|
|
1774
|
+
...props
|
|
1775
|
+
});
|
|
1776
|
+
};
|
|
1777
|
+
const SelectControl = ({ className, ...props }) => {
|
|
1778
|
+
const { slots, id } = useSelect();
|
|
1779
|
+
return /* @__PURE__ */ jsx("select", {
|
|
1780
|
+
className: cn$1(className, slots.control()),
|
|
1781
|
+
id,
|
|
1782
|
+
...props
|
|
1783
|
+
});
|
|
1784
|
+
};
|
|
1785
|
+
const SelectOption = ({ className, ...props }) => {
|
|
1786
|
+
const { slots } = useSelect();
|
|
1787
|
+
return /* @__PURE__ */ jsx("option", {
|
|
1788
|
+
className: cn$1(className, slots.option()),
|
|
1789
|
+
...props
|
|
1790
|
+
});
|
|
1791
|
+
};
|
|
1792
|
+
const SelectDescription = ({ className, ...props }) => {
|
|
1793
|
+
const { slots } = useSelect();
|
|
1794
|
+
return /* @__PURE__ */ jsx("p", {
|
|
1795
|
+
className: cn$1(className, slots.description()),
|
|
1796
|
+
...props
|
|
1797
|
+
});
|
|
1798
|
+
};
|
|
1799
|
+
const SelectError = ({ className, ...props }) => {
|
|
1800
|
+
const { slots } = useSelect();
|
|
1801
|
+
return /* @__PURE__ */ jsx("p", {
|
|
1802
|
+
className: cn$1(className, slots.error()),
|
|
1803
|
+
...props
|
|
1804
|
+
});
|
|
1805
|
+
};
|
|
1806
|
+
var select_default = Object.assign(Select, {
|
|
1807
|
+
Control: SelectControl,
|
|
1808
|
+
Description: SelectDescription,
|
|
1809
|
+
Error: SelectError,
|
|
1810
|
+
Label: SelectLabel,
|
|
1811
|
+
Option: SelectOption,
|
|
1812
|
+
Root: Select
|
|
1813
|
+
});
|
|
1814
|
+
|
|
1815
|
+
//#endregion
|
|
1816
|
+
//#region src/components/sidebar/sidebar.context.ts
|
|
1817
|
+
const SidebarContext = createContext(null);
|
|
1818
|
+
|
|
1819
|
+
//#endregion
|
|
1820
|
+
//#region src/components/sidebar/sidebar.variants.ts
|
|
1821
|
+
const sidebarVariants = tv({ slots: {
|
|
1822
|
+
content: "sidebar__content",
|
|
1823
|
+
footer: "sidebar__footer",
|
|
1824
|
+
header: "sidebar__header",
|
|
1825
|
+
menu: "sidebar__menu",
|
|
1826
|
+
menuItem: "sidebar__menu-item",
|
|
1827
|
+
menuLabel: "sidebar__menu-label",
|
|
1828
|
+
outlet: "sidebar__outlet",
|
|
1829
|
+
panel: "sidebar__panel",
|
|
1830
|
+
root: "sidebar",
|
|
1831
|
+
trigger: "sidebar__trigger"
|
|
1832
|
+
} });
|
|
1833
|
+
|
|
1834
|
+
//#endregion
|
|
1835
|
+
//#region src/components/sidebar/use-sidebar.ts
|
|
1836
|
+
const useSidebar = () => {
|
|
1837
|
+
const context = useContext(SidebarContext);
|
|
1838
|
+
if (!context) throw new Error("useSidebar must be used within a SidebarProvider");
|
|
1839
|
+
return context;
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
//#endregion
|
|
1843
|
+
//#region src/components/sidebar/sidebar.tsx
|
|
1844
|
+
const Sidebar = ({ className, isOpen, onOpenChange, ...props }) => {
|
|
1845
|
+
const [internalIsOpen, setInternalIsOpen] = React.useState(false);
|
|
1846
|
+
const isOpenState = isOpen !== void 0 ? isOpen : internalIsOpen;
|
|
1847
|
+
const handleOpenChange = onOpenChange || setInternalIsOpen;
|
|
1848
|
+
const slots = useMemo(() => sidebarVariants({ className }), [className]);
|
|
1849
|
+
return /* @__PURE__ */ jsx(SidebarContext, {
|
|
1850
|
+
value: {
|
|
1851
|
+
isOpen: isOpenState,
|
|
1852
|
+
onOpenChange: handleOpenChange,
|
|
1853
|
+
slots
|
|
1854
|
+
},
|
|
1855
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1856
|
+
className: slots.root(),
|
|
1857
|
+
"data-open": isOpenState,
|
|
1858
|
+
...props
|
|
1859
|
+
})
|
|
1860
|
+
});
|
|
1861
|
+
};
|
|
1862
|
+
const SidebarPanel = ({ className, ...props }) => {
|
|
1863
|
+
const { slots } = useSidebar();
|
|
1864
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
1865
|
+
className: cn$1(slots.panel(), className),
|
|
1866
|
+
...props
|
|
1867
|
+
});
|
|
1868
|
+
};
|
|
1869
|
+
const SidebarHeader = ({ className, ...props }) => {
|
|
1870
|
+
const { slots } = useSidebar();
|
|
1871
|
+
return /* @__PURE__ */ jsx("header", {
|
|
1872
|
+
className: cn$1(slots.header(), className),
|
|
1873
|
+
...props
|
|
1874
|
+
});
|
|
1875
|
+
};
|
|
1876
|
+
const SidebarContent = ({ className, ...props }) => {
|
|
1877
|
+
const { slots } = useSidebar();
|
|
1878
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1879
|
+
className: cn$1(slots.content(), className),
|
|
1880
|
+
...props
|
|
1881
|
+
});
|
|
1882
|
+
};
|
|
1883
|
+
const SidebarFooter = ({ className, ...props }) => {
|
|
1884
|
+
const { slots } = useSidebar();
|
|
1885
|
+
return /* @__PURE__ */ jsx("footer", {
|
|
1886
|
+
className: cn$1(slots.footer(), className),
|
|
1887
|
+
...props
|
|
1888
|
+
});
|
|
1889
|
+
};
|
|
1890
|
+
const SidebarTrigger = ({ className, children, ...props }) => {
|
|
1891
|
+
const { slots, isOpen, onOpenChange } = useSidebar();
|
|
1892
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1893
|
+
"aria-expanded": isOpen,
|
|
1894
|
+
className: cn$1(slots.trigger(), className),
|
|
1895
|
+
onClick: () => onOpenChange(!isOpen),
|
|
1896
|
+
...props,
|
|
1897
|
+
children: children ?? (isOpen ? /* @__PURE__ */ jsx(LucidePanelLeftClose, {}) : /* @__PURE__ */ jsx(LucidePanelLeftOpen, {}))
|
|
1898
|
+
});
|
|
1899
|
+
};
|
|
1900
|
+
const SidebarOutlet = ({ className, ...props }) => {
|
|
1901
|
+
const { slots } = useSidebar();
|
|
1902
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1903
|
+
className: cn$1(slots.outlet(), className),
|
|
1904
|
+
...props
|
|
1905
|
+
});
|
|
1906
|
+
};
|
|
1907
|
+
const SidebarMenu = ({ className, ...props }) => {
|
|
1908
|
+
const { slots } = useSidebar();
|
|
1909
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
1910
|
+
className: cn$1(slots.menu(), className),
|
|
1911
|
+
...props
|
|
1912
|
+
});
|
|
1913
|
+
};
|
|
1914
|
+
const SidebarMenuItem = ({ className, ...props }) => {
|
|
1915
|
+
const { slots } = useSidebar();
|
|
1916
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
1917
|
+
className: cn$1(slots.menuItem(), className),
|
|
1918
|
+
...props
|
|
1919
|
+
});
|
|
1920
|
+
};
|
|
1921
|
+
const SidebarMenuLabel = ({ className, ...props }) => {
|
|
1922
|
+
const { slots } = useSidebar();
|
|
1923
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1924
|
+
className: cn$1(slots.menuLabel(), className),
|
|
1925
|
+
...props
|
|
1926
|
+
});
|
|
1927
|
+
};
|
|
1928
|
+
var sidebar_default = Object.assign(Sidebar, {
|
|
1929
|
+
Content: SidebarContent,
|
|
1930
|
+
Footer: SidebarFooter,
|
|
1931
|
+
Header: SidebarHeader,
|
|
1932
|
+
Menu: SidebarMenu,
|
|
1933
|
+
MenuItem: SidebarMenuItem,
|
|
1934
|
+
MenuLabel: SidebarMenuLabel,
|
|
1935
|
+
Outlet: SidebarOutlet,
|
|
1936
|
+
Panel: SidebarPanel,
|
|
1937
|
+
Root: Sidebar,
|
|
1938
|
+
Trigger: SidebarTrigger
|
|
1939
|
+
});
|
|
1940
|
+
|
|
1941
|
+
//#endregion
|
|
1942
|
+
//#region src/components/slider/slider.context.ts
|
|
1943
|
+
const SliderContext = createContext(null);
|
|
1944
|
+
|
|
1945
|
+
//#endregion
|
|
1946
|
+
//#region src/components/slider/slider.variants.ts
|
|
1947
|
+
const sliderVariants = tv({ slots: {
|
|
1948
|
+
control: "slider__control",
|
|
1949
|
+
indicator: "slider__indicator",
|
|
1950
|
+
root: "slider",
|
|
1951
|
+
thumb: "slider__thumb",
|
|
1952
|
+
track: "slider__track",
|
|
1953
|
+
value: "slider__value"
|
|
1954
|
+
} });
|
|
1955
|
+
|
|
1956
|
+
//#endregion
|
|
1957
|
+
//#region src/components/slider/use-slider.tsx
|
|
1958
|
+
const useSlider = () => {
|
|
1959
|
+
const context = useContext(SliderContext);
|
|
1960
|
+
if (!context) throw new Error("useSlider must be used within a SliderProvider");
|
|
1961
|
+
return context;
|
|
1962
|
+
};
|
|
1963
|
+
|
|
1964
|
+
//#endregion
|
|
1965
|
+
//#region src/components/slider/slider.tsx
|
|
1966
|
+
const Slider$1 = ({ className, ...props }) => {
|
|
1967
|
+
const slots = useMemo(() => sliderVariants(), []);
|
|
1968
|
+
return /* @__PURE__ */ jsx(SliderContext, {
|
|
1969
|
+
value: { slots },
|
|
1970
|
+
children: /* @__PURE__ */ jsx(Slider.Root, {
|
|
1971
|
+
className: cn$1(className, slots.root()),
|
|
1972
|
+
...props
|
|
1973
|
+
})
|
|
1974
|
+
});
|
|
1975
|
+
};
|
|
1976
|
+
const SliderValue = ({ className, ...props }) => {
|
|
1977
|
+
const { slots } = useSlider();
|
|
1978
|
+
return /* @__PURE__ */ jsx(Slider.Value, {
|
|
1979
|
+
className: cn$1(className, slots.value()),
|
|
1980
|
+
...props
|
|
1981
|
+
});
|
|
1982
|
+
};
|
|
1983
|
+
const SliderControl = ({ className, ...props }) => {
|
|
1984
|
+
const { slots } = useSlider();
|
|
1985
|
+
return /* @__PURE__ */ jsx(Slider.Control, {
|
|
1986
|
+
className: cn$1(className, slots.control()),
|
|
1987
|
+
...props
|
|
1988
|
+
});
|
|
1989
|
+
};
|
|
1990
|
+
const SliderTrack = ({ className, ...props }) => {
|
|
1991
|
+
const { slots } = useSlider();
|
|
1992
|
+
return /* @__PURE__ */ jsx(Slider.Track, {
|
|
1993
|
+
className: cn$1(className, slots.track()),
|
|
1994
|
+
...props
|
|
1995
|
+
});
|
|
1996
|
+
};
|
|
1997
|
+
const SliderIndicator = ({ className, ...props }) => {
|
|
1998
|
+
const { slots } = useSlider();
|
|
1999
|
+
return /* @__PURE__ */ jsx(Slider.Indicator, {
|
|
2000
|
+
className: cn$1(className, slots.indicator()),
|
|
2001
|
+
...props
|
|
2002
|
+
});
|
|
2003
|
+
};
|
|
2004
|
+
const SliderThumb = ({ className, ...props }) => {
|
|
2005
|
+
const { slots } = useSlider();
|
|
2006
|
+
return /* @__PURE__ */ jsx(Slider.Thumb, {
|
|
2007
|
+
className: cn$1(className, slots.thumb()),
|
|
2008
|
+
...props
|
|
2009
|
+
});
|
|
2010
|
+
};
|
|
2011
|
+
var slider_default = Object.assign(Slider$1, {
|
|
2012
|
+
Control: SliderControl,
|
|
2013
|
+
Indicator: SliderIndicator,
|
|
2014
|
+
Root: Slider$1,
|
|
2015
|
+
Thumb: SliderThumb,
|
|
2016
|
+
Track: SliderTrack,
|
|
2017
|
+
Value: SliderValue
|
|
2018
|
+
});
|
|
2019
|
+
|
|
2020
|
+
//#endregion
|
|
2021
|
+
//#region src/components/switch/switch.context.ts
|
|
2022
|
+
const SwitchContext = createContext(null);
|
|
2023
|
+
|
|
2024
|
+
//#endregion
|
|
2025
|
+
//#region src/components/switch/switch.variants.ts
|
|
2026
|
+
const switchVariants = tv({
|
|
2027
|
+
defaultVariants: { size: "md" },
|
|
2028
|
+
slots: {
|
|
2029
|
+
root: "switch",
|
|
2030
|
+
thumb: "switch__thumb"
|
|
2031
|
+
},
|
|
2032
|
+
variants: { size: {
|
|
2033
|
+
lg: { root: "switch--lg" },
|
|
2034
|
+
md: { root: "switch--md" },
|
|
2035
|
+
sm: { root: "switch--sm" }
|
|
2036
|
+
} }
|
|
2037
|
+
});
|
|
2038
|
+
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region src/components/switch/use-switch.ts
|
|
2041
|
+
const useSwitch = () => {
|
|
2042
|
+
const context = useContext(SwitchContext);
|
|
2043
|
+
if (!context) throw new Error("useSwitch must be used within a SwitchProvider");
|
|
2044
|
+
return context;
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
//#endregion
|
|
2048
|
+
//#region src/components/switch/switch.tsx
|
|
2049
|
+
const Switch$1 = ({ className, size, ...props }) => {
|
|
2050
|
+
const slots = useMemo(() => switchVariants({ size }), [size]);
|
|
2051
|
+
return /* @__PURE__ */ jsx(SwitchContext.Provider, {
|
|
2052
|
+
value: { slots },
|
|
2053
|
+
children: /* @__PURE__ */ jsx(Switch.Root, {
|
|
2054
|
+
className: cn$1(className, slots.root()),
|
|
2055
|
+
...props
|
|
2056
|
+
})
|
|
2057
|
+
});
|
|
2058
|
+
};
|
|
2059
|
+
const SwitchThumb = ({ className, ...props }) => {
|
|
2060
|
+
const { slots } = useSwitch();
|
|
2061
|
+
return /* @__PURE__ */ jsx(Switch.Thumb, {
|
|
2062
|
+
className: cn$1(className, slots.thumb()),
|
|
2063
|
+
...props
|
|
2064
|
+
});
|
|
2065
|
+
};
|
|
2066
|
+
var switch_default = Object.assign(Switch$1, {
|
|
2067
|
+
Root: Switch$1,
|
|
2068
|
+
Thumb: SwitchThumb
|
|
2069
|
+
});
|
|
2070
|
+
|
|
2071
|
+
//#endregion
|
|
2072
|
+
//#region src/components/table/table.context.ts
|
|
2073
|
+
const TableContext = createContext(null);
|
|
2074
|
+
|
|
2075
|
+
//#endregion
|
|
2076
|
+
//#region src/components/table/table.variants.ts
|
|
2077
|
+
const tableVariants = tv({ slots: {
|
|
2078
|
+
root: "table",
|
|
2079
|
+
tbody: "table__tbody",
|
|
2080
|
+
td: "table__td",
|
|
2081
|
+
tfoot: "table__tfoot",
|
|
2082
|
+
th: "table__th",
|
|
2083
|
+
thead: "table__thead",
|
|
2084
|
+
tr: "table__tr"
|
|
2085
|
+
} });
|
|
2086
|
+
|
|
2087
|
+
//#endregion
|
|
2088
|
+
//#region src/components/table/use-table.ts
|
|
2089
|
+
const useTable = () => {
|
|
2090
|
+
const context = useContext(TableContext);
|
|
2091
|
+
if (!context) throw new Error("useTable must be used within a TableProvider");
|
|
2092
|
+
return context;
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
//#endregion
|
|
2096
|
+
//#region src/components/table/table.tsx
|
|
2097
|
+
const Table = ({ className, ...props }) => {
|
|
2098
|
+
const slots = useMemo(() => tableVariants(), []);
|
|
2099
|
+
return /* @__PURE__ */ jsx(TableContext, {
|
|
2100
|
+
value: { slots },
|
|
2101
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
2102
|
+
className: cn$1(className, slots.root()),
|
|
2103
|
+
...props
|
|
2104
|
+
})
|
|
2105
|
+
});
|
|
2106
|
+
};
|
|
2107
|
+
const TableHead = ({ className, ...props }) => {
|
|
2108
|
+
const { slots } = useTable();
|
|
2109
|
+
return /* @__PURE__ */ jsx("thead", {
|
|
2110
|
+
className: cn$1(className, slots.thead()),
|
|
2111
|
+
...props
|
|
2112
|
+
});
|
|
2113
|
+
};
|
|
2114
|
+
const TableRow = ({ className, ...props }) => {
|
|
2115
|
+
const { slots } = useTable();
|
|
2116
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
2117
|
+
className: cn$1(className, slots.tr()),
|
|
2118
|
+
...props
|
|
2119
|
+
});
|
|
2120
|
+
};
|
|
2121
|
+
const TableHeaderCell = ({ className, ...props }) => {
|
|
2122
|
+
const { slots } = useTable();
|
|
2123
|
+
return /* @__PURE__ */ jsx("th", {
|
|
2124
|
+
className: cn$1(className, slots.th()),
|
|
2125
|
+
...props
|
|
2126
|
+
});
|
|
2127
|
+
};
|
|
2128
|
+
const TableBody = ({ className, ...props }) => {
|
|
2129
|
+
const { slots } = useTable();
|
|
2130
|
+
return /* @__PURE__ */ jsx("tbody", {
|
|
2131
|
+
className: cn$1(className, slots.tbody()),
|
|
2132
|
+
...props
|
|
2133
|
+
});
|
|
2134
|
+
};
|
|
2135
|
+
const TableDataCell = ({ className, ...props }) => {
|
|
2136
|
+
const { slots } = useTable();
|
|
2137
|
+
return /* @__PURE__ */ jsx("td", {
|
|
2138
|
+
className: cn$1(className, slots.td()),
|
|
2139
|
+
...props
|
|
2140
|
+
});
|
|
2141
|
+
};
|
|
2142
|
+
const TableFooter = ({ className, ...props }) => {
|
|
2143
|
+
const { slots } = useTable();
|
|
2144
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
2145
|
+
className: cn$1(className, slots.tfoot()),
|
|
2146
|
+
...props
|
|
2147
|
+
});
|
|
2148
|
+
};
|
|
2149
|
+
var table_default = Object.assign(Table, {
|
|
2150
|
+
Body: TableBody,
|
|
2151
|
+
DataCell: TableDataCell,
|
|
2152
|
+
Footer: TableFooter,
|
|
2153
|
+
Head: TableHead,
|
|
2154
|
+
HeaderCell: TableHeaderCell,
|
|
2155
|
+
Root: Table,
|
|
2156
|
+
Row: TableRow
|
|
2157
|
+
});
|
|
2158
|
+
|
|
2159
|
+
//#endregion
|
|
2160
|
+
//#region src/components/tabs/tabs.context.ts
|
|
2161
|
+
const TabsContext = createContext(null);
|
|
2162
|
+
|
|
2163
|
+
//#endregion
|
|
2164
|
+
//#region src/components/tabs/tabs.variants.ts
|
|
2165
|
+
const tabsVariants = tv({ slots: {
|
|
2166
|
+
indicator: "tabs__indicator",
|
|
2167
|
+
list: "tabs__list",
|
|
2168
|
+
panel: "tabs__panel",
|
|
2169
|
+
root: "tabs",
|
|
2170
|
+
tab: "tabs__tab"
|
|
2171
|
+
} });
|
|
2172
|
+
|
|
2173
|
+
//#endregion
|
|
2174
|
+
//#region src/components/tabs/use-tabs.ts
|
|
2175
|
+
const useTabs = () => {
|
|
2176
|
+
const context = useContext(TabsContext);
|
|
2177
|
+
if (!context) throw new Error("useTabs must be used within a TabsProvider");
|
|
2178
|
+
return context;
|
|
2179
|
+
};
|
|
2180
|
+
|
|
2181
|
+
//#endregion
|
|
2182
|
+
//#region src/components/tabs/tabs.tsx
|
|
2183
|
+
const Tabs$1 = ({ className, ...props }) => {
|
|
2184
|
+
const slots = useMemo(() => tabsVariants(), []);
|
|
2185
|
+
return /* @__PURE__ */ jsx(TabsContext.Provider, {
|
|
2186
|
+
value: { slots },
|
|
2187
|
+
children: /* @__PURE__ */ jsx(Tabs.Root, {
|
|
2188
|
+
className: cn$1(className, slots.root()),
|
|
2189
|
+
...props
|
|
2190
|
+
})
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
const TabsList = ({ className, ...props }) => {
|
|
2194
|
+
const { slots } = useTabs();
|
|
2195
|
+
return /* @__PURE__ */ jsx(Tabs.List, {
|
|
2196
|
+
className: cn$1(slots.list(), className),
|
|
2197
|
+
...props
|
|
2198
|
+
});
|
|
2199
|
+
};
|
|
2200
|
+
const TabsTab = ({ className, ...props }) => {
|
|
2201
|
+
const { slots } = useTabs();
|
|
2202
|
+
return /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
2203
|
+
className: cn$1(slots.tab(), className),
|
|
2204
|
+
...props
|
|
2205
|
+
});
|
|
2206
|
+
};
|
|
2207
|
+
const TabsIndicator = ({ className, ...props }) => {
|
|
2208
|
+
const { slots } = useTabs();
|
|
2209
|
+
return /* @__PURE__ */ jsx(Tabs.Indicator, {
|
|
2210
|
+
className: cn$1(slots.indicator(), className),
|
|
2211
|
+
...props
|
|
2212
|
+
});
|
|
2213
|
+
};
|
|
2214
|
+
const TabsPanel = ({ className, ...props }) => {
|
|
2215
|
+
const { slots } = useTabs();
|
|
2216
|
+
return /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
2217
|
+
className: cn$1(slots.panel(), className),
|
|
2218
|
+
...props
|
|
2219
|
+
});
|
|
2220
|
+
};
|
|
2221
|
+
var tabs_default = Object.assign(Tabs$1, {
|
|
2222
|
+
Indicator: TabsIndicator,
|
|
2223
|
+
List: TabsList,
|
|
2224
|
+
Panel: TabsPanel,
|
|
2225
|
+
Root: Tabs$1,
|
|
2226
|
+
Tab: TabsTab
|
|
2227
|
+
});
|
|
2228
|
+
|
|
2229
|
+
//#endregion
|
|
2230
|
+
//#region src/components/toggle-button/toggle-button.variants.ts
|
|
2231
|
+
const toggleButtonVariants = tv({
|
|
2232
|
+
base: "toggle-button",
|
|
2233
|
+
extend: buttonVariants
|
|
2234
|
+
});
|
|
2235
|
+
|
|
2236
|
+
//#endregion
|
|
2237
|
+
//#region src/components/toggle-button/toggle-button.tsx
|
|
2238
|
+
const ToggleButton = ({ className, variant, size, ...props }) => {
|
|
2239
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
2240
|
+
className: cn$1(className, toggleButtonVariants({
|
|
2241
|
+
size,
|
|
2242
|
+
variant
|
|
2243
|
+
})),
|
|
2244
|
+
...props
|
|
2245
|
+
});
|
|
2246
|
+
};
|
|
2247
|
+
var toggle_button_default = ToggleButton;
|
|
2248
|
+
|
|
2249
|
+
//#endregion
|
|
2250
|
+
export { accordion_default as Accordion, alert_default as Alert, alert_dialog_default as AlertDialog, avatar_default as Avatar, button_default as Button, button_group_default as ButtonGroup, card_default as Card, checkbox_default as Checkbox, checkbox_group_default as CheckboxGroup, chip_default as Chip, container_default as Container, dialog_default as Dialog, drawer_default as Drawer, field_default as Field, fieldset_default as Fieldset, form_default as Form, icon_button_default as IconButton, input_default as Input, label_default as Label, link_default as Link, list_default as List, menu_default as Menu, meter_default as Meter, navbar_default as Navbar, popover_default as Popover, progress_default as Progress, radio_default as Radio, radio_group_default as RadioGroup, select_default as Select, separator_default as Separator, sidebar_default as Sidebar, slider_default as Slider, switch_default as Switch, table_default as Table, tabs_default as Tabs, toggle_button_default as ToggleButton, accordionVariants, alertDialogVariants, alertVariants, avatarVariants, buttonGroupVariants, buttonVariants, cardVariants, checkboxGroupVariants, checkboxVariants, chipVariants, cn, containerVariants, dialogVariants, drawerVariants, fieldVariants, fieldsetVariants, formVariants, iconButtonVariants, inputVariants, labelVariants, linkVariants, listVariants, menuVariants, meterVariants, navbarVariants, popoverVariants, progressVariants, radioGroupVariants, radioVariants, selectVariants, separatorVariants, sidebarVariants, sliderVariants, switchVariants, tableVariants, tabsVariants, toggleButtonVariants };
|
|
2251
|
+
//# sourceMappingURL=index.mjs.map
|