@pos-360/horizon 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BYICEALC.mjs → chunk-HJPQ6TOR.mjs} +272 -110
- package/dist/chunk-HJPQ6TOR.mjs.map +1 -0
- package/dist/{chunk-FOXFMLET.js → chunk-S2A3IDOX.js} +282 -112
- package/dist/chunk-S2A3IDOX.js.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +118 -86
- package/dist/index.mjs +1 -1
- package/dist/primitives.d.mts +56 -14
- package/dist/primitives.d.ts +56 -14
- package/dist/primitives.js +118 -86
- package/dist/primitives.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-BYICEALC.mjs.map +0 -1
- package/dist/chunk-FOXFMLET.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { cn } from './chunk-TDRL2RCT.mjs';
|
|
2
2
|
import { cva } from 'class-variance-authority';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import * as
|
|
4
|
+
import * as React7 from 'react';
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
7
|
import { Check, X, ChevronRight, Circle, ChevronDown, ChevronUp } from 'lucide-react';
|
|
8
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
9
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
10
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
11
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
11
12
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
12
13
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
13
14
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
14
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
15
15
|
|
|
16
16
|
var badgeVariants = cva(
|
|
17
17
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",
|
|
@@ -62,7 +62,7 @@ var buttonVariants = cva(
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
var Button =
|
|
65
|
+
var Button = React7.forwardRef(
|
|
66
66
|
({
|
|
67
67
|
className,
|
|
68
68
|
variant,
|
|
@@ -102,7 +102,7 @@ var Button = React9.forwardRef(
|
|
|
102
102
|
}
|
|
103
103
|
);
|
|
104
104
|
Button.displayName = "Button";
|
|
105
|
-
var Card =
|
|
105
|
+
var Card = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
ref,
|
|
@@ -114,7 +114,7 @@ var Card = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
114
114
|
}
|
|
115
115
|
));
|
|
116
116
|
Card.displayName = "Card";
|
|
117
|
-
var CardHeader =
|
|
117
|
+
var CardHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
120
|
ref,
|
|
@@ -123,7 +123,7 @@ var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
123
123
|
}
|
|
124
124
|
));
|
|
125
125
|
CardHeader.displayName = "CardHeader";
|
|
126
|
-
var CardTitle =
|
|
126
|
+
var CardTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
129
|
ref,
|
|
@@ -132,7 +132,7 @@ var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
132
132
|
}
|
|
133
133
|
));
|
|
134
134
|
CardTitle.displayName = "CardTitle";
|
|
135
|
-
var CardDescription =
|
|
135
|
+
var CardDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
138
|
ref,
|
|
@@ -141,7 +141,7 @@ var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
141
141
|
}
|
|
142
142
|
));
|
|
143
143
|
CardDescription.displayName = "CardDescription";
|
|
144
|
-
var CardContent =
|
|
144
|
+
var CardContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
145
145
|
"div",
|
|
146
146
|
{
|
|
147
147
|
ref,
|
|
@@ -150,7 +150,7 @@ var CardContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
150
150
|
}
|
|
151
151
|
));
|
|
152
152
|
CardContent.displayName = "CardContent";
|
|
153
|
-
var CardFooter =
|
|
153
|
+
var CardFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
154
154
|
"div",
|
|
155
155
|
{
|
|
156
156
|
ref,
|
|
@@ -159,7 +159,7 @@ var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
159
159
|
}
|
|
160
160
|
));
|
|
161
161
|
CardFooter.displayName = "CardFooter";
|
|
162
|
-
var Checkbox =
|
|
162
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
163
163
|
CheckboxPrimitive.Root,
|
|
164
164
|
{
|
|
165
165
|
ref,
|
|
@@ -182,7 +182,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
182
182
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
183
183
|
var DialogPortal = DialogPrimitive.Portal;
|
|
184
184
|
var DialogClose = DialogPrimitive.Close;
|
|
185
|
-
var DialogOverlay =
|
|
185
|
+
var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
186
186
|
DialogPrimitive.Overlay,
|
|
187
187
|
{
|
|
188
188
|
ref,
|
|
@@ -194,7 +194,7 @@ var DialogOverlay = React9.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
194
194
|
}
|
|
195
195
|
));
|
|
196
196
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
197
|
-
var DialogContent =
|
|
197
|
+
var DialogContent = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
198
198
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
199
199
|
/* @__PURE__ */ jsxs(
|
|
200
200
|
DialogPrimitive.Content,
|
|
@@ -244,7 +244,7 @@ var DialogFooter = ({
|
|
|
244
244
|
}
|
|
245
245
|
);
|
|
246
246
|
DialogFooter.displayName = "DialogFooter";
|
|
247
|
-
var DialogTitle =
|
|
247
|
+
var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
248
248
|
DialogPrimitive.Title,
|
|
249
249
|
{
|
|
250
250
|
ref,
|
|
@@ -256,7 +256,7 @@ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
256
256
|
}
|
|
257
257
|
));
|
|
258
258
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
259
|
-
var DialogDescription =
|
|
259
|
+
var DialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
260
260
|
DialogPrimitive.Description,
|
|
261
261
|
{
|
|
262
262
|
ref,
|
|
@@ -271,7 +271,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
271
271
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
272
272
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
273
273
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
274
|
-
var DropdownMenuSubTrigger =
|
|
274
|
+
var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
275
275
|
DropdownMenuPrimitive.SubTrigger,
|
|
276
276
|
{
|
|
277
277
|
ref,
|
|
@@ -288,7 +288,7 @@ var DropdownMenuSubTrigger = React9.forwardRef(({ className, inset, children, ..
|
|
|
288
288
|
}
|
|
289
289
|
));
|
|
290
290
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
291
|
-
var DropdownMenuSubContent =
|
|
291
|
+
var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
292
292
|
DropdownMenuPrimitive.SubContent,
|
|
293
293
|
{
|
|
294
294
|
ref,
|
|
@@ -300,7 +300,7 @@ var DropdownMenuSubContent = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
300
300
|
}
|
|
301
301
|
));
|
|
302
302
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
303
|
-
var DropdownMenuContent =
|
|
303
|
+
var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
304
304
|
DropdownMenuPrimitive.Content,
|
|
305
305
|
{
|
|
306
306
|
ref,
|
|
@@ -314,7 +314,7 @@ var DropdownMenuContent = React9.forwardRef(({ className, sideOffset = 4, ...pro
|
|
|
314
314
|
}
|
|
315
315
|
) }));
|
|
316
316
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
317
|
-
var DropdownMenuItem =
|
|
317
|
+
var DropdownMenuItem = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
318
318
|
DropdownMenuPrimitive.Item,
|
|
319
319
|
{
|
|
320
320
|
ref,
|
|
@@ -327,7 +327,7 @@ var DropdownMenuItem = React9.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
327
327
|
}
|
|
328
328
|
));
|
|
329
329
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
330
|
-
var DropdownMenuCheckboxItem =
|
|
330
|
+
var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
331
331
|
DropdownMenuPrimitive.CheckboxItem,
|
|
332
332
|
{
|
|
333
333
|
ref,
|
|
@@ -344,7 +344,7 @@ var DropdownMenuCheckboxItem = React9.forwardRef(({ className, children, checked
|
|
|
344
344
|
}
|
|
345
345
|
));
|
|
346
346
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
347
|
-
var DropdownMenuRadioItem =
|
|
347
|
+
var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
348
348
|
DropdownMenuPrimitive.RadioItem,
|
|
349
349
|
{
|
|
350
350
|
ref,
|
|
@@ -360,7 +360,7 @@ var DropdownMenuRadioItem = React9.forwardRef(({ className, children, ...props }
|
|
|
360
360
|
}
|
|
361
361
|
));
|
|
362
362
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
363
|
-
var DropdownMenuLabel =
|
|
363
|
+
var DropdownMenuLabel = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
364
364
|
DropdownMenuPrimitive.Label,
|
|
365
365
|
{
|
|
366
366
|
ref,
|
|
@@ -373,7 +373,7 @@ var DropdownMenuLabel = React9.forwardRef(({ className, inset, ...props }, ref)
|
|
|
373
373
|
}
|
|
374
374
|
));
|
|
375
375
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
376
|
-
var DropdownMenuSeparator =
|
|
376
|
+
var DropdownMenuSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
377
377
|
DropdownMenuPrimitive.Separator,
|
|
378
378
|
{
|
|
379
379
|
ref,
|
|
@@ -395,14 +395,218 @@ var DropdownMenuShortcut = ({
|
|
|
395
395
|
);
|
|
396
396
|
};
|
|
397
397
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
398
|
-
var
|
|
398
|
+
var labelVariants = cva(
|
|
399
|
+
"font-bricolage font-medium text-neutral-900 dark:text-neutral-100 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
400
|
+
{
|
|
401
|
+
variants: {
|
|
402
|
+
variant: {
|
|
403
|
+
default: "",
|
|
404
|
+
eyebrow: "uppercase tracking-[0.2em]"
|
|
405
|
+
},
|
|
406
|
+
size: {
|
|
407
|
+
xs: "text-[10px] leading-3",
|
|
408
|
+
sm: "text-xs leading-4",
|
|
409
|
+
base: "text-sm leading-5",
|
|
410
|
+
lg: "text-base leading-6",
|
|
411
|
+
xl: "text-lg leading-7"
|
|
412
|
+
},
|
|
413
|
+
weight: {
|
|
414
|
+
medium: "font-medium",
|
|
415
|
+
semibold: "font-semibold",
|
|
416
|
+
bold: "font-bold"
|
|
417
|
+
},
|
|
418
|
+
required: {
|
|
419
|
+
true: "after:content-['*'] after:ml-0.5 after:text-red-500",
|
|
420
|
+
false: ""
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
defaultVariants: {
|
|
424
|
+
variant: "default",
|
|
425
|
+
size: "base",
|
|
426
|
+
weight: "medium",
|
|
427
|
+
required: false
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
var Label2 = React7.forwardRef(({ className, variant, size, weight, required, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
432
|
+
LabelPrimitive.Root,
|
|
433
|
+
{
|
|
434
|
+
ref,
|
|
435
|
+
className: cn(labelVariants({ variant, size, weight, required, className })),
|
|
436
|
+
...props
|
|
437
|
+
}
|
|
438
|
+
));
|
|
439
|
+
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
440
|
+
var FormContext = React7.createContext(null);
|
|
441
|
+
function useFormContext() {
|
|
442
|
+
const context = React7.useContext(FormContext);
|
|
443
|
+
if (!context) {
|
|
444
|
+
throw new Error("useFormContext must be used within a Form component");
|
|
445
|
+
}
|
|
446
|
+
return context;
|
|
447
|
+
}
|
|
448
|
+
var FormFieldContext = React7.createContext(
|
|
449
|
+
null
|
|
450
|
+
);
|
|
451
|
+
function useFormFieldContext() {
|
|
452
|
+
const context = React7.useContext(FormFieldContext);
|
|
453
|
+
if (!context) {
|
|
454
|
+
throw new Error(
|
|
455
|
+
"useFormFieldContext must be used within a FormField component"
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
return context;
|
|
459
|
+
}
|
|
460
|
+
var Form = React7.forwardRef(
|
|
461
|
+
({ className, children, onFormSubmit, ...props }, ref) => {
|
|
462
|
+
const [errors, setErrors] = React7.useState({});
|
|
463
|
+
const [isSubmitting, setIsSubmitting] = React7.useState(false);
|
|
464
|
+
const setError = React7.useCallback(
|
|
465
|
+
(name, message) => {
|
|
466
|
+
setErrors((prev) => ({ ...prev, [name]: message }));
|
|
467
|
+
},
|
|
468
|
+
[]
|
|
469
|
+
);
|
|
470
|
+
const clearError = React7.useCallback((name) => {
|
|
471
|
+
setErrors((prev) => {
|
|
472
|
+
const next = { ...prev };
|
|
473
|
+
delete next[name];
|
|
474
|
+
return next;
|
|
475
|
+
});
|
|
476
|
+
}, []);
|
|
477
|
+
const clearAllErrors = React7.useCallback(() => {
|
|
478
|
+
setErrors({});
|
|
479
|
+
}, []);
|
|
480
|
+
const isValid = Object.keys(errors).length === 0;
|
|
481
|
+
const handleSubmit = async (e) => {
|
|
482
|
+
e.preventDefault();
|
|
483
|
+
if (onFormSubmit) {
|
|
484
|
+
setIsSubmitting(true);
|
|
485
|
+
try {
|
|
486
|
+
await onFormSubmit(e, {
|
|
487
|
+
setError: (name, message) => setError(name, message),
|
|
488
|
+
clearErrors: clearAllErrors,
|
|
489
|
+
setSubmitting: setIsSubmitting
|
|
490
|
+
});
|
|
491
|
+
} finally {
|
|
492
|
+
setIsSubmitting(false);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
const contextValue = React7.useMemo(
|
|
497
|
+
() => ({
|
|
498
|
+
errors,
|
|
499
|
+
setError,
|
|
500
|
+
clearError,
|
|
501
|
+
clearAllErrors,
|
|
502
|
+
isSubmitting,
|
|
503
|
+
isValid
|
|
504
|
+
}),
|
|
505
|
+
[errors, setError, clearError, clearAllErrors, isSubmitting, isValid]
|
|
506
|
+
);
|
|
507
|
+
return /* @__PURE__ */ jsx(FormContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
508
|
+
"form",
|
|
509
|
+
{
|
|
510
|
+
ref,
|
|
511
|
+
className: cn("space-y-6", className),
|
|
512
|
+
onSubmit: handleSubmit,
|
|
513
|
+
...props,
|
|
514
|
+
children
|
|
515
|
+
}
|
|
516
|
+
) });
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
Form.displayName = "Form";
|
|
520
|
+
var FormField = React7.forwardRef(
|
|
521
|
+
({ className, name, children, ...props }, ref) => {
|
|
522
|
+
const { errors } = useFormContext();
|
|
523
|
+
const id = React7.useId();
|
|
524
|
+
const error = errors[name];
|
|
525
|
+
const contextValue = React7.useMemo(
|
|
526
|
+
() => ({ name, error, id }),
|
|
527
|
+
[name, error, id]
|
|
528
|
+
);
|
|
529
|
+
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { ref, className: cn("space-y-2", className), ...props, children }) });
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
FormField.displayName = "FormField";
|
|
533
|
+
var FormLabel = React7.forwardRef(({ className, ...props }, ref) => {
|
|
534
|
+
const { id, error } = useFormFieldContext();
|
|
535
|
+
return /* @__PURE__ */ jsx(
|
|
536
|
+
Label2,
|
|
537
|
+
{
|
|
538
|
+
ref,
|
|
539
|
+
htmlFor: id,
|
|
540
|
+
className: cn(error && "text-red-500 dark:text-red-400", className),
|
|
541
|
+
...props
|
|
542
|
+
}
|
|
543
|
+
);
|
|
544
|
+
});
|
|
545
|
+
FormLabel.displayName = "FormLabel";
|
|
546
|
+
var FormControl = React7.forwardRef(
|
|
547
|
+
({ children, ...props }, ref) => {
|
|
548
|
+
const { id, error, name } = useFormFieldContext();
|
|
549
|
+
const child = React7.cloneElement(children, {
|
|
550
|
+
id,
|
|
551
|
+
name,
|
|
552
|
+
"aria-invalid": !!error,
|
|
553
|
+
"aria-describedby": error ? `${id}-error` : void 0,
|
|
554
|
+
...children.props
|
|
555
|
+
});
|
|
556
|
+
return /* @__PURE__ */ jsx("div", { ref, ...props, children: child });
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
FormControl.displayName = "FormControl";
|
|
560
|
+
var FormDescription = React7.forwardRef(
|
|
561
|
+
({ className, ...props }, ref) => {
|
|
562
|
+
return /* @__PURE__ */ jsx(
|
|
563
|
+
"span",
|
|
564
|
+
{
|
|
565
|
+
ref,
|
|
566
|
+
className: cn(
|
|
567
|
+
"block text-sm text-neutral-500 dark:text-neutral-400",
|
|
568
|
+
className
|
|
569
|
+
),
|
|
570
|
+
...props
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
FormDescription.displayName = "FormDescription";
|
|
576
|
+
var FormMessage = React7.forwardRef(
|
|
577
|
+
({ className, children, error: errorProp, ...props }, ref) => {
|
|
578
|
+
const fieldContext = React7.useContext(FormFieldContext);
|
|
579
|
+
const error = errorProp ?? fieldContext?.error;
|
|
580
|
+
const id = fieldContext?.id;
|
|
581
|
+
if (!error && !children) {
|
|
582
|
+
return null;
|
|
583
|
+
}
|
|
584
|
+
return /* @__PURE__ */ jsx(
|
|
585
|
+
"p",
|
|
586
|
+
{
|
|
587
|
+
ref,
|
|
588
|
+
id: id ? `${id}-error` : void 0,
|
|
589
|
+
className: cn(
|
|
590
|
+
"text-sm font-medium",
|
|
591
|
+
error ? "text-red-500 dark:text-red-400" : "text-neutral-600 dark:text-neutral-400",
|
|
592
|
+
className
|
|
593
|
+
),
|
|
594
|
+
role: error ? "alert" : void 0,
|
|
595
|
+
...props,
|
|
596
|
+
children: error || children
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
FormMessage.displayName = "FormMessage";
|
|
602
|
+
var PopoverContext = React7.createContext({ open: false });
|
|
399
603
|
var Popover = ({
|
|
400
604
|
children,
|
|
401
605
|
open: controlledOpen,
|
|
402
606
|
onOpenChange,
|
|
403
607
|
...props
|
|
404
608
|
}) => {
|
|
405
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
609
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React7.useState(false);
|
|
406
610
|
const isControlled = controlledOpen !== void 0;
|
|
407
611
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
408
612
|
const handleOpenChange = (newOpen) => {
|
|
@@ -423,8 +627,8 @@ var Popover = ({
|
|
|
423
627
|
};
|
|
424
628
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
425
629
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
426
|
-
var PopoverContent =
|
|
427
|
-
const { open } =
|
|
630
|
+
var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, children, ...props }, ref) => {
|
|
631
|
+
const { open } = React7.useContext(PopoverContext);
|
|
428
632
|
const {
|
|
429
633
|
onOpenAutoFocus,
|
|
430
634
|
onCloseAutoFocus,
|
|
@@ -484,14 +688,14 @@ var PopoverContent = React9.forwardRef(({ className, align = "center", sideOffse
|
|
|
484
688
|
) }) });
|
|
485
689
|
});
|
|
486
690
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
487
|
-
var SelectContext =
|
|
691
|
+
var SelectContext = React7.createContext({ open: false });
|
|
488
692
|
var Select = ({
|
|
489
693
|
children,
|
|
490
694
|
open: controlledOpen,
|
|
491
695
|
onOpenChange,
|
|
492
696
|
...props
|
|
493
697
|
}) => {
|
|
494
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
698
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React7.useState(false);
|
|
495
699
|
const isControlled = controlledOpen !== void 0;
|
|
496
700
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
497
701
|
const handleOpenChange = (newOpen) => {
|
|
@@ -512,7 +716,7 @@ var Select = ({
|
|
|
512
716
|
};
|
|
513
717
|
var SelectGroup = SelectPrimitive.Group;
|
|
514
718
|
var SelectValue = SelectPrimitive.Value;
|
|
515
|
-
var SelectTrigger =
|
|
719
|
+
var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
516
720
|
SelectPrimitive.Trigger,
|
|
517
721
|
{
|
|
518
722
|
ref,
|
|
@@ -528,7 +732,7 @@ var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) =
|
|
|
528
732
|
}
|
|
529
733
|
));
|
|
530
734
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
531
|
-
var SelectScrollUpButton =
|
|
735
|
+
var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
532
736
|
SelectPrimitive.ScrollUpButton,
|
|
533
737
|
{
|
|
534
738
|
ref,
|
|
@@ -541,7 +745,7 @@ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /
|
|
|
541
745
|
}
|
|
542
746
|
));
|
|
543
747
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
544
|
-
var SelectScrollDownButton =
|
|
748
|
+
var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
545
749
|
SelectPrimitive.ScrollDownButton,
|
|
546
750
|
{
|
|
547
751
|
ref,
|
|
@@ -554,8 +758,8 @@ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
554
758
|
}
|
|
555
759
|
));
|
|
556
760
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
557
|
-
var SelectContent =
|
|
558
|
-
const { open } =
|
|
761
|
+
var SelectContent = React7.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
|
|
762
|
+
const { open } = React7.useContext(SelectContext);
|
|
559
763
|
const {
|
|
560
764
|
onCloseAutoFocus,
|
|
561
765
|
onEscapeKeyDown,
|
|
@@ -627,7 +831,7 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
627
831
|
) }) });
|
|
628
832
|
});
|
|
629
833
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
630
|
-
var SelectLabel =
|
|
834
|
+
var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
631
835
|
SelectPrimitive.Label,
|
|
632
836
|
{
|
|
633
837
|
ref,
|
|
@@ -636,7 +840,7 @@ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
636
840
|
}
|
|
637
841
|
));
|
|
638
842
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
639
|
-
var SelectItem =
|
|
843
|
+
var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
640
844
|
SelectPrimitive.Item,
|
|
641
845
|
{
|
|
642
846
|
ref,
|
|
@@ -652,7 +856,7 @@ var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
652
856
|
}
|
|
653
857
|
));
|
|
654
858
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
655
|
-
var SelectSeparator =
|
|
859
|
+
var SelectSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
656
860
|
SelectPrimitive.Separator,
|
|
657
861
|
{
|
|
658
862
|
ref,
|
|
@@ -728,7 +932,7 @@ function SkeletonCard({ className }) {
|
|
|
728
932
|
}
|
|
729
933
|
);
|
|
730
934
|
}
|
|
731
|
-
var Table =
|
|
935
|
+
var Table = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
732
936
|
"table",
|
|
733
937
|
{
|
|
734
938
|
ref,
|
|
@@ -737,7 +941,7 @@ var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
737
941
|
}
|
|
738
942
|
) }));
|
|
739
943
|
Table.displayName = "Table";
|
|
740
|
-
var TableHeader =
|
|
944
|
+
var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
741
945
|
"thead",
|
|
742
946
|
{
|
|
743
947
|
ref,
|
|
@@ -746,7 +950,7 @@ var TableHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
746
950
|
}
|
|
747
951
|
));
|
|
748
952
|
TableHeader.displayName = "TableHeader";
|
|
749
|
-
var TableBody =
|
|
953
|
+
var TableBody = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
750
954
|
"tbody",
|
|
751
955
|
{
|
|
752
956
|
ref,
|
|
@@ -755,7 +959,7 @@ var TableBody = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
755
959
|
}
|
|
756
960
|
));
|
|
757
961
|
TableBody.displayName = "TableBody";
|
|
758
|
-
var TableFooter =
|
|
962
|
+
var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
759
963
|
"tfoot",
|
|
760
964
|
{
|
|
761
965
|
ref,
|
|
@@ -767,7 +971,7 @@ var TableFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
767
971
|
}
|
|
768
972
|
));
|
|
769
973
|
TableFooter.displayName = "TableFooter";
|
|
770
|
-
var TableRow =
|
|
974
|
+
var TableRow = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
771
975
|
"tr",
|
|
772
976
|
{
|
|
773
977
|
ref,
|
|
@@ -779,7 +983,7 @@ var TableRow = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
779
983
|
}
|
|
780
984
|
));
|
|
781
985
|
TableRow.displayName = "TableRow";
|
|
782
|
-
var TableHead =
|
|
986
|
+
var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
783
987
|
"th",
|
|
784
988
|
{
|
|
785
989
|
ref,
|
|
@@ -791,7 +995,7 @@ var TableHead = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
791
995
|
}
|
|
792
996
|
));
|
|
793
997
|
TableHead.displayName = "TableHead";
|
|
794
|
-
var TableCell =
|
|
998
|
+
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
795
999
|
"td",
|
|
796
1000
|
{
|
|
797
1001
|
ref,
|
|
@@ -800,7 +1004,7 @@ var TableCell = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
800
1004
|
}
|
|
801
1005
|
));
|
|
802
1006
|
TableCell.displayName = "TableCell";
|
|
803
|
-
var TableCaption =
|
|
1007
|
+
var TableCaption = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
804
1008
|
"caption",
|
|
805
1009
|
{
|
|
806
1010
|
ref,
|
|
@@ -809,31 +1013,31 @@ var TableCaption = React9.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
809
1013
|
}
|
|
810
1014
|
));
|
|
811
1015
|
TableCaption.displayName = "TableCaption";
|
|
812
|
-
var TabsContext =
|
|
1016
|
+
var TabsContext = React7.createContext(null);
|
|
813
1017
|
var useTabsContext = () => {
|
|
814
|
-
const context =
|
|
1018
|
+
const context = React7.useContext(TabsContext);
|
|
815
1019
|
if (!context) {
|
|
816
1020
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
817
1021
|
}
|
|
818
1022
|
return context;
|
|
819
1023
|
};
|
|
820
|
-
var Tabs =
|
|
821
|
-
const [activeTab, setActiveTabState] =
|
|
822
|
-
const tabRefs =
|
|
823
|
-
const listRef =
|
|
824
|
-
const setActiveTab =
|
|
1024
|
+
var Tabs = React7.forwardRef(({ defaultValue, value, onValueChange, children, ...props }, ref) => {
|
|
1025
|
+
const [activeTab, setActiveTabState] = React7.useState(value ?? defaultValue);
|
|
1026
|
+
const tabRefs = React7.useRef(/* @__PURE__ */ new Map()).current;
|
|
1027
|
+
const listRef = React7.useRef(null);
|
|
1028
|
+
const setActiveTab = React7.useCallback(
|
|
825
1029
|
(newValue) => {
|
|
826
1030
|
setActiveTabState(newValue);
|
|
827
1031
|
onValueChange?.(newValue);
|
|
828
1032
|
},
|
|
829
1033
|
[onValueChange]
|
|
830
1034
|
);
|
|
831
|
-
|
|
1035
|
+
React7.useEffect(() => {
|
|
832
1036
|
if (value !== void 0) {
|
|
833
1037
|
setActiveTabState(value);
|
|
834
1038
|
}
|
|
835
1039
|
}, [value]);
|
|
836
|
-
const registerTab =
|
|
1040
|
+
const registerTab = React7.useCallback(
|
|
837
1041
|
(tabValue, element) => {
|
|
838
1042
|
tabRefs.set(tabValue, element);
|
|
839
1043
|
},
|
|
@@ -858,10 +1062,10 @@ var Tabs = React9.forwardRef(({ defaultValue, value, onValueChange, children, ..
|
|
|
858
1062
|
);
|
|
859
1063
|
});
|
|
860
1064
|
Tabs.displayName = "Tabs";
|
|
861
|
-
var TabsList =
|
|
1065
|
+
var TabsList = React7.forwardRef(({ className, children, ...props }, ref) => {
|
|
862
1066
|
const { activeTab, tabRefs, listRef } = useTabsContext();
|
|
863
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
864
|
-
|
|
1067
|
+
const [indicatorStyle, setIndicatorStyle] = React7.useState(null);
|
|
1068
|
+
React7.useEffect(() => {
|
|
865
1069
|
const updateIndicator = () => {
|
|
866
1070
|
if (!activeTab || !listRef.current) return;
|
|
867
1071
|
const activeElement = tabRefs.get(activeTab);
|
|
@@ -913,10 +1117,10 @@ var TabsList = React9.forwardRef(({ className, children, ...props }, ref) => {
|
|
|
913
1117
|
);
|
|
914
1118
|
});
|
|
915
1119
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
916
|
-
var TabsTrigger =
|
|
1120
|
+
var TabsTrigger = React7.forwardRef(({ className, value, ...props }, ref) => {
|
|
917
1121
|
const { registerTab, activeTab } = useTabsContext();
|
|
918
|
-
const triggerRef =
|
|
919
|
-
|
|
1122
|
+
const triggerRef = React7.useRef(null);
|
|
1123
|
+
React7.useEffect(() => {
|
|
920
1124
|
registerTab(value, triggerRef.current);
|
|
921
1125
|
return () => registerTab(value, null);
|
|
922
1126
|
}, [value, registerTab]);
|
|
@@ -940,7 +1144,7 @@ var TabsTrigger = React9.forwardRef(({ className, value, ...props }, ref) => {
|
|
|
940
1144
|
);
|
|
941
1145
|
});
|
|
942
1146
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
943
|
-
var TabsContent =
|
|
1147
|
+
var TabsContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
944
1148
|
TabsPrimitive.Content,
|
|
945
1149
|
{
|
|
946
1150
|
ref,
|
|
@@ -952,7 +1156,7 @@ var TabsContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
952
1156
|
}
|
|
953
1157
|
));
|
|
954
1158
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
955
|
-
var Textarea =
|
|
1159
|
+
var Textarea = React7.forwardRef(
|
|
956
1160
|
({ className, ...props }, ref) => {
|
|
957
1161
|
return /* @__PURE__ */ jsx(
|
|
958
1162
|
"textarea",
|
|
@@ -999,7 +1203,7 @@ var headingVariants = cva(
|
|
|
999
1203
|
}
|
|
1000
1204
|
}
|
|
1001
1205
|
);
|
|
1002
|
-
var Heading =
|
|
1206
|
+
var Heading = React7.forwardRef(
|
|
1003
1207
|
({ className, level = 1, weight, align, as, children, ...props }, ref) => {
|
|
1004
1208
|
const Tag = as || `h${level}`;
|
|
1005
1209
|
return /* @__PURE__ */ jsx(
|
|
@@ -1053,7 +1257,7 @@ var textVariants = cva("font-bricolage text-neutral-700 dark:text-neutral-300",
|
|
|
1053
1257
|
color: "default"
|
|
1054
1258
|
}
|
|
1055
1259
|
});
|
|
1056
|
-
var Text =
|
|
1260
|
+
var Text = React7.forwardRef(
|
|
1057
1261
|
({ className, size, weight, align, color, asChild = false, as = "p", children, ...props }, ref) => {
|
|
1058
1262
|
const Comp = asChild ? Slot : as;
|
|
1059
1263
|
return /* @__PURE__ */ jsx(
|
|
@@ -1068,48 +1272,6 @@ var Text = React9.forwardRef(
|
|
|
1068
1272
|
}
|
|
1069
1273
|
);
|
|
1070
1274
|
Text.displayName = "Text";
|
|
1071
|
-
var labelVariants = cva(
|
|
1072
|
-
"font-bricolage font-medium text-neutral-900 dark:text-neutral-100 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1073
|
-
{
|
|
1074
|
-
variants: {
|
|
1075
|
-
variant: {
|
|
1076
|
-
default: "",
|
|
1077
|
-
eyebrow: "uppercase tracking-[0.2em]"
|
|
1078
|
-
},
|
|
1079
|
-
size: {
|
|
1080
|
-
xs: "text-[10px] leading-3",
|
|
1081
|
-
sm: "text-xs leading-4",
|
|
1082
|
-
base: "text-sm leading-5",
|
|
1083
|
-
lg: "text-base leading-6",
|
|
1084
|
-
xl: "text-lg leading-7"
|
|
1085
|
-
},
|
|
1086
|
-
weight: {
|
|
1087
|
-
medium: "font-medium",
|
|
1088
|
-
semibold: "font-semibold",
|
|
1089
|
-
bold: "font-bold"
|
|
1090
|
-
},
|
|
1091
|
-
required: {
|
|
1092
|
-
true: "after:content-['*'] after:ml-0.5 after:text-red-500",
|
|
1093
|
-
false: ""
|
|
1094
|
-
}
|
|
1095
|
-
},
|
|
1096
|
-
defaultVariants: {
|
|
1097
|
-
variant: "default",
|
|
1098
|
-
size: "base",
|
|
1099
|
-
weight: "medium",
|
|
1100
|
-
required: false
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
);
|
|
1104
|
-
var Label3 = React9.forwardRef(({ className, variant, size, weight, required, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1105
|
-
LabelPrimitive.Root,
|
|
1106
|
-
{
|
|
1107
|
-
ref,
|
|
1108
|
-
className: cn(labelVariants({ variant, size, weight, required, className })),
|
|
1109
|
-
...props
|
|
1110
|
-
}
|
|
1111
|
-
));
|
|
1112
|
-
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
1113
1275
|
var captionVariants = cva(
|
|
1114
1276
|
"font-bricolage text-xs leading-4 text-neutral-500 dark:text-neutral-400",
|
|
1115
1277
|
{
|
|
@@ -1139,7 +1301,7 @@ var captionVariants = cva(
|
|
|
1139
1301
|
}
|
|
1140
1302
|
}
|
|
1141
1303
|
);
|
|
1142
|
-
var Caption =
|
|
1304
|
+
var Caption = React7.forwardRef(
|
|
1143
1305
|
({ className, weight, align, color, children, ...props }, ref) => {
|
|
1144
1306
|
return /* @__PURE__ */ jsx(
|
|
1145
1307
|
"span",
|
|
@@ -1179,7 +1341,7 @@ var codeVariants = cva("font-mono", {
|
|
|
1179
1341
|
color: "default"
|
|
1180
1342
|
}
|
|
1181
1343
|
});
|
|
1182
|
-
var Code =
|
|
1344
|
+
var Code = React7.forwardRef(
|
|
1183
1345
|
({ className, variant, color, children, ...props }, ref) => {
|
|
1184
1346
|
const isBlock = variant === "block";
|
|
1185
1347
|
if (isBlock) {
|
|
@@ -1206,6 +1368,6 @@ var Code = React9.forwardRef(
|
|
|
1206
1368
|
);
|
|
1207
1369
|
Code.displayName = "Code";
|
|
1208
1370
|
|
|
1209
|
-
export { Badge, Button, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Heading,
|
|
1210
|
-
//# sourceMappingURL=chunk-
|
|
1211
|
-
//# sourceMappingURL=chunk-
|
|
1371
|
+
export { Badge, Button, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormLabel, FormMessage, Heading, Label2 as Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, badgeVariants, buttonVariants, captionVariants, codeVariants, headingVariants, labelVariants, textVariants, useFormContext, useFormFieldContext };
|
|
1372
|
+
//# sourceMappingURL=chunk-HJPQ6TOR.mjs.map
|
|
1373
|
+
//# sourceMappingURL=chunk-HJPQ6TOR.mjs.map
|