@bison-lab/ui 0.18.1 → 0.18.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/dist/index.d.mts +8 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +154 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -396,15 +396,15 @@ function FormError({ message, className }) {
|
|
|
396
396
|
}
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/components/button.tsx
|
|
399
|
-
const buttonVariants = cva("relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-
|
|
399
|
+
const buttonVariants = cva("relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer", {
|
|
400
400
|
variants: {
|
|
401
401
|
variant: {
|
|
402
|
-
default: "bg-primary text-primary-foreground hover:bg-primary
|
|
403
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
404
|
-
accent: "bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent
|
|
405
|
-
highlight: "bg-highlight text-highlight-foreground hover:bg-highlight
|
|
406
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive
|
|
407
|
-
outline: "border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
402
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-700 hover:shadow-md",
|
|
403
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-700 hover:shadow-md",
|
|
404
|
+
accent: "bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600 hover:shadow-md",
|
|
405
|
+
highlight: "bg-highlight text-highlight-foreground hover:bg-highlight-600 hover:shadow-md",
|
|
406
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive-700 hover:shadow-md",
|
|
407
|
+
outline: "border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground hover:shadow-sm",
|
|
408
408
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
409
409
|
actionNeutral: actionNeutralToneClasses,
|
|
410
410
|
actionPositive: actionPositiveToneClasses,
|
|
@@ -472,11 +472,80 @@ const Button = React.forwardRef(({ className, variant, size, fullWidth, asChild
|
|
|
472
472
|
});
|
|
473
473
|
Button.displayName = "Button";
|
|
474
474
|
//#endregion
|
|
475
|
+
//#region src/lib/surface-classes.ts
|
|
476
|
+
/**
|
|
477
|
+
* Shared surface class strings extracted to a single source of truth.
|
|
478
|
+
*
|
|
479
|
+
* These patterns appear in multiple components that must stay in lockstep
|
|
480
|
+
* visually (same border, same focus ring, same scrim, etc.). When any of
|
|
481
|
+
* these visuals change, update here once — every consumer tracks.
|
|
482
|
+
*
|
|
483
|
+
* See components: input, textarea, password-input, currency-input,
|
|
484
|
+
* select, dropdown-menu, context-menu, command, dialog, alert-dialog,
|
|
485
|
+
* sheet, popover, tooltip.
|
|
486
|
+
*/
|
|
487
|
+
/**
|
|
488
|
+
* Common chrome for form input surfaces: border, background, ring-offset,
|
|
489
|
+
* placeholder color, disabled state. Does NOT include sizing or focus —
|
|
490
|
+
* consumers add `inputSizingClasses` (or their own) + `inputFocusClasses`.
|
|
491
|
+
*
|
|
492
|
+
* Used by: Input, Textarea, PasswordInput, CurrencyInput, Select Trigger,
|
|
493
|
+
* DatePicker trigger, DateRangePicker trigger.
|
|
494
|
+
*/
|
|
495
|
+
const inputSurfaceClasses = "flex w-full rounded-md border border-input bg-background text-base sm:text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50";
|
|
496
|
+
/**
|
|
497
|
+
* Focus-visible ring for input surfaces. Keyboard focus only (`focus-visible`)
|
|
498
|
+
* so mouse clicks don't show the ring — matches WAI-ARIA expectations.
|
|
499
|
+
*/
|
|
500
|
+
const inputFocusClasses = "focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0";
|
|
501
|
+
/**
|
|
502
|
+
* Standard single-line input sizing: md-density height + 12px padding-x + 8px padding-y.
|
|
503
|
+
* Textarea uses `min-h-[80px]` instead.
|
|
504
|
+
*/
|
|
505
|
+
const inputSizingClasses = "h-[var(--density-height-md)] px-3 py-2";
|
|
506
|
+
/**
|
|
507
|
+
* Menu surface chrome shared by floating menus and popovers:
|
|
508
|
+
* Select Content, DropdownMenu Content, ContextMenu Content, Command.
|
|
509
|
+
*
|
|
510
|
+
* Uses `--z-dropdown` (500 after z-index refactor) so menus open *above*
|
|
511
|
+
* modals they're triggered from — critical for Select inside a Dialog, etc.
|
|
512
|
+
*/
|
|
513
|
+
const menuSurfaceClasses = "z-[var(--z-dropdown)] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md";
|
|
514
|
+
/**
|
|
515
|
+
* Base menu item: focus styling, disabled state, selection-ready.
|
|
516
|
+
* Used by: Select Item, DropdownMenu Item, ContextMenu Item, Command Item.
|
|
517
|
+
*/
|
|
518
|
+
const menuItemClasses = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
519
|
+
/**
|
|
520
|
+
* Menu item variant with indicator gutter on the left (for checkbox/radio
|
|
521
|
+
* indicators on Select, DropdownMenu, ContextMenu).
|
|
522
|
+
*/
|
|
523
|
+
const menuItemWithIndicatorClasses = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
524
|
+
/**
|
|
525
|
+
* Menu separator: horizontal rule sitting between menu groups.
|
|
526
|
+
*/
|
|
527
|
+
const menuSeparatorClasses = "-mx-1 my-1 h-px bg-muted";
|
|
528
|
+
/**
|
|
529
|
+
* Radix state-driven animations for open/close + slide-in from side.
|
|
530
|
+
* Used by Select Content, DropdownMenu Content, ContextMenu Content,
|
|
531
|
+
* Popover Content, Tooltip Content, Command popovers.
|
|
532
|
+
*/
|
|
533
|
+
const floatingAnimationClasses = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
534
|
+
/**
|
|
535
|
+
* Scrim (backdrop) shared by Dialog, AlertDialog, Sheet.
|
|
536
|
+
*/
|
|
537
|
+
const overlayScrimClasses = "fixed inset-0 z-[var(--z-modal-backdrop)] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
|
|
538
|
+
/**
|
|
539
|
+
* Centered modal content positioning + chrome (Dialog, AlertDialog).
|
|
540
|
+
* Sheet has its own side-anchored variants in `sheet.tsx`.
|
|
541
|
+
*/
|
|
542
|
+
const centeredModalContentClasses = "fixed left-[50%] top-[50%] z-[var(--z-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-normal rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]";
|
|
543
|
+
//#endregion
|
|
475
544
|
//#region src/components/input.tsx
|
|
476
545
|
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
477
546
|
return /* @__PURE__ */ jsx("input", {
|
|
478
547
|
type,
|
|
479
|
-
className: cn(
|
|
548
|
+
className: cn(inputSurfaceClasses, inputSizingClasses, inputFocusClasses, "file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm", className),
|
|
480
549
|
ref,
|
|
481
550
|
...props
|
|
482
551
|
});
|
|
@@ -488,7 +557,7 @@ const PasswordInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
488
557
|
return /* @__PURE__ */ jsx(unstable_PasswordToggleField.Root, { children: /* @__PURE__ */ jsxs("div", {
|
|
489
558
|
className: "relative",
|
|
490
559
|
children: [/* @__PURE__ */ jsx(unstable_PasswordToggleField.Input, {
|
|
491
|
-
className: cn(
|
|
560
|
+
className: cn(inputSurfaceClasses, inputSizingClasses, inputFocusClasses, "pr-10 file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm", className),
|
|
492
561
|
ref,
|
|
493
562
|
...props
|
|
494
563
|
}), /* @__PURE__ */ jsx(unstable_PasswordToggleField.Toggle, {
|
|
@@ -618,7 +687,7 @@ const CurrencyInput = React.forwardRef(({ className, value, onChange, symbol = "
|
|
|
618
687
|
value: display,
|
|
619
688
|
onChange: handleChange,
|
|
620
689
|
onBlur: handleBlur,
|
|
621
|
-
className: cn(
|
|
690
|
+
className: cn(inputSurfaceClasses, inputSizingClasses, inputFocusClasses, "pl-7 pr-3 text-sm", className),
|
|
622
691
|
...props
|
|
623
692
|
})]
|
|
624
693
|
});
|
|
@@ -664,7 +733,7 @@ InputGroup.displayName = "InputGroup";
|
|
|
664
733
|
//#region src/components/textarea.tsx
|
|
665
734
|
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
666
735
|
return /* @__PURE__ */ jsx("textarea", {
|
|
667
|
-
className: cn("
|
|
736
|
+
className: cn(inputSurfaceClasses, "min-h-[80px] px-3 py-2", inputFocusClasses, className),
|
|
668
737
|
ref,
|
|
669
738
|
...props
|
|
670
739
|
});
|
|
@@ -677,7 +746,7 @@ const SelectGroup = Select$1.Group;
|
|
|
677
746
|
const SelectValue = Select$1.Value;
|
|
678
747
|
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
679
748
|
ref,
|
|
680
|
-
className: cn(
|
|
749
|
+
className: cn(inputSurfaceClasses, inputSizingClasses, inputFocusClasses, "items-center justify-between [&>span]:line-clamp-1", className),
|
|
681
750
|
...props,
|
|
682
751
|
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
|
|
683
752
|
asChild: true,
|
|
@@ -710,7 +779,7 @@ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) =
|
|
|
710
779
|
SelectScrollDownButton.displayName = Select$1.ScrollDownButton.displayName;
|
|
711
780
|
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsxs(Select$1.Content, {
|
|
712
781
|
ref,
|
|
713
|
-
className: cn("relative
|
|
782
|
+
className: cn(menuSurfaceClasses, floatingAnimationClasses, "relative max-h-96 p-0", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
714
783
|
position,
|
|
715
784
|
...props,
|
|
716
785
|
children: [
|
|
@@ -731,7 +800,7 @@ const SelectLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
731
800
|
SelectLabel.displayName = Select$1.Label.displayName;
|
|
732
801
|
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
733
802
|
ref,
|
|
734
|
-
className: cn("
|
|
803
|
+
className: cn(menuItemWithIndicatorClasses, "w-full", className),
|
|
735
804
|
...props,
|
|
736
805
|
children: [/* @__PURE__ */ jsx("span", {
|
|
737
806
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -744,7 +813,7 @@ const SelectItem = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
744
813
|
SelectItem.displayName = Select$1.Item.displayName;
|
|
745
814
|
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
746
815
|
ref,
|
|
747
|
-
className: cn(
|
|
816
|
+
className: cn(menuSeparatorClasses, className),
|
|
748
817
|
...props
|
|
749
818
|
}));
|
|
750
819
|
SelectSeparator.displayName = Select$1.Separator.displayName;
|
|
@@ -796,7 +865,7 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
|
|
|
796
865
|
ref,
|
|
797
866
|
align,
|
|
798
867
|
sideOffset,
|
|
799
|
-
className: cn("z-[var(--z-popover)] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none
|
|
868
|
+
className: cn("z-[var(--z-popover)] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none", floatingAnimationClasses, className),
|
|
800
869
|
...props
|
|
801
870
|
}) }));
|
|
802
871
|
PopoverContent.displayName = Popover$1.Content.displayName;
|
|
@@ -1040,7 +1109,7 @@ const TooltipTrigger = Tooltip$1.Trigger;
|
|
|
1040
1109
|
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Tooltip$1.Content, {
|
|
1041
1110
|
ref,
|
|
1042
1111
|
sideOffset,
|
|
1043
|
-
className: cn("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md
|
|
1112
|
+
className: cn("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md", floatingAnimationClasses, className),
|
|
1044
1113
|
...props
|
|
1045
1114
|
}));
|
|
1046
1115
|
TooltipContent.displayName = Tooltip$1.Content.displayName;
|
|
@@ -1439,7 +1508,7 @@ const alertVariants = cva("relative w-full rounded-[var(--radius-md)] border p-4
|
|
|
1439
1508
|
default: "bg-muted/50 text-foreground border-border [&_[data-alert-icon]]:text-muted-foreground dark:bg-muted/30 dark:border-border-strong",
|
|
1440
1509
|
destructive: "border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300",
|
|
1441
1510
|
success: "border-success-300 bg-success-50 text-success-900 [&_[data-alert-icon]]:text-success-600 dark:border-success-700 dark:bg-success-900/60 dark:text-success-100 dark:[&_[data-alert-icon]]:text-success-300",
|
|
1442
|
-
warning: "border-
|
|
1511
|
+
warning: "border-warning-300 bg-warning-50 text-warning-900 [&_[data-alert-icon]]:text-warning-600 dark:border-warning-700 dark:bg-warning-900/60 dark:text-warning-100 dark:[&_[data-alert-icon]]:text-warning-300",
|
|
1443
1512
|
danger: "border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300",
|
|
1444
1513
|
info: "border-primary-300 bg-primary-50 text-primary-900 [&_[data-alert-icon]]:text-primary-600 dark:border-primary-700 dark:bg-primary-900/60 dark:text-primary-100 dark:[&_[data-alert-icon]]:text-primary-300"
|
|
1445
1514
|
} },
|
|
@@ -1504,16 +1573,16 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
1504
1573
|
//#region src/components/badge.tsx
|
|
1505
1574
|
const badgeVariants = cva("inline-flex h-6 items-center justify-center rounded-[var(--radius-sm)] border px-2.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2", {
|
|
1506
1575
|
variants: { variant: {
|
|
1507
|
-
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary
|
|
1508
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary
|
|
1509
|
-
accent: "border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent
|
|
1510
|
-
highlight: "border-transparent bg-highlight text-highlight-foreground hover:bg-highlight
|
|
1511
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive
|
|
1576
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary-700",
|
|
1577
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-700",
|
|
1578
|
+
accent: "border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600",
|
|
1579
|
+
highlight: "border-transparent bg-highlight text-highlight-foreground hover:bg-highlight-600",
|
|
1580
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-700",
|
|
1512
1581
|
outline: "text-foreground",
|
|
1513
|
-
success: "border-
|
|
1514
|
-
warning: "border-
|
|
1515
|
-
error: "border-
|
|
1516
|
-
info: "border-
|
|
1582
|
+
success: "border-success-500/30 bg-success-500/10 text-success-700 dark:border-success-400/30 dark:bg-success-400/10 dark:text-success-400",
|
|
1583
|
+
warning: "border-warning-500/30 bg-warning-500/10 text-warning-700 dark:border-warning-400/30 dark:bg-warning-400/10 dark:text-warning-400",
|
|
1584
|
+
error: "border-destructive-500/30 bg-destructive-500/10 text-destructive-700 dark:border-destructive-400/30 dark:bg-destructive-400/10 dark:text-destructive-400",
|
|
1585
|
+
info: "border-primary-500/30 bg-primary-500/10 text-primary-700 dark:border-primary-400/30 dark:bg-primary-400/10 dark:text-primary-400"
|
|
1517
1586
|
} },
|
|
1518
1587
|
defaultVariants: { variant: "default" }
|
|
1519
1588
|
});
|
|
@@ -1559,13 +1628,13 @@ const DialogPortal = Dialog$1.Portal;
|
|
|
1559
1628
|
const DialogClose = Dialog$1.Close;
|
|
1560
1629
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Dialog$1.Overlay, {
|
|
1561
1630
|
ref,
|
|
1562
|
-
className: cn(
|
|
1631
|
+
className: cn(overlayScrimClasses, className),
|
|
1563
1632
|
...props
|
|
1564
1633
|
}));
|
|
1565
1634
|
DialogOverlay.displayName = Dialog$1.Overlay.displayName;
|
|
1566
1635
|
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
|
|
1567
1636
|
ref,
|
|
1568
|
-
className: cn(
|
|
1637
|
+
className: cn(centeredModalContentClasses, className),
|
|
1569
1638
|
...props,
|
|
1570
1639
|
children: [children, /* @__PURE__ */ jsxs(Dialog$1.Close, {
|
|
1571
1640
|
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
@@ -1607,14 +1676,14 @@ const AlertDialog = AlertDialog$1.Root;
|
|
|
1607
1676
|
const AlertDialogTrigger = AlertDialog$1.Trigger;
|
|
1608
1677
|
const AlertDialogPortal = AlertDialog$1.Portal;
|
|
1609
1678
|
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
|
|
1610
|
-
className: cn(
|
|
1679
|
+
className: cn(overlayScrimClasses, className),
|
|
1611
1680
|
...props,
|
|
1612
1681
|
ref
|
|
1613
1682
|
}));
|
|
1614
1683
|
AlertDialogOverlay.displayName = AlertDialog$1.Overlay.displayName;
|
|
1615
1684
|
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
|
|
1616
1685
|
ref,
|
|
1617
|
-
className: cn(
|
|
1686
|
+
className: cn(centeredModalContentClasses, className),
|
|
1618
1687
|
...props
|
|
1619
1688
|
})] }));
|
|
1620
1689
|
AlertDialogContent.displayName = AlertDialog$1.Content.displayName;
|
|
@@ -1657,7 +1726,7 @@ const SheetTrigger = Dialog$1.Trigger;
|
|
|
1657
1726
|
const SheetClose = Dialog$1.Close;
|
|
1658
1727
|
const SheetPortal = Dialog$1.Portal;
|
|
1659
1728
|
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Dialog$1.Overlay, {
|
|
1660
|
-
className: cn(
|
|
1729
|
+
className: cn(overlayScrimClasses, className),
|
|
1661
1730
|
...props,
|
|
1662
1731
|
ref
|
|
1663
1732
|
}));
|
|
@@ -1776,6 +1845,12 @@ const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1776
1845
|
SheetDescription.displayName = Dialog$1.Description.displayName;
|
|
1777
1846
|
//#endregion
|
|
1778
1847
|
//#region src/components/dropdown-menu.tsx
|
|
1848
|
+
/**
|
|
1849
|
+
* DropdownMenu — visually mirrored by `context-menu.tsx`. Both pull chrome
|
|
1850
|
+
* from `lib/surface-classes.ts` (menuSurfaceClasses, menuItemClasses, etc.)
|
|
1851
|
+
* so they stay in lockstep. Edit the shared classes file, not this one or
|
|
1852
|
+
* context-menu.tsx, when tweaking menu visuals.
|
|
1853
|
+
*/
|
|
1779
1854
|
const DropdownMenu = DropdownMenu$1.Root;
|
|
1780
1855
|
const DropdownMenuTrigger = DropdownMenu$1.Trigger;
|
|
1781
1856
|
const DropdownMenuGroup = DropdownMenu$1.Group;
|
|
@@ -1784,7 +1859,7 @@ const DropdownMenuSub = DropdownMenu$1.Sub;
|
|
|
1784
1859
|
const DropdownMenuRadioGroup = DropdownMenu$1.RadioGroup;
|
|
1785
1860
|
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
1786
1861
|
ref,
|
|
1787
|
-
className: cn("
|
|
1862
|
+
className: cn(menuItemClasses, "data-[state=open]:bg-accent", inset && "pl-8", className),
|
|
1788
1863
|
...props,
|
|
1789
1864
|
children: [children, /* @__PURE__ */ jsx(FontAwesomeIcon, {
|
|
1790
1865
|
icon: faChevronRight,
|
|
@@ -1794,26 +1869,26 @@ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, .
|
|
|
1794
1869
|
DropdownMenuSubTrigger.displayName = DropdownMenu$1.SubTrigger.displayName;
|
|
1795
1870
|
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
1796
1871
|
ref,
|
|
1797
|
-
className: cn(
|
|
1872
|
+
className: cn(menuSurfaceClasses, floatingAnimationClasses, "shadow-lg", className),
|
|
1798
1873
|
...props
|
|
1799
1874
|
}));
|
|
1800
1875
|
DropdownMenuSubContent.displayName = DropdownMenu$1.SubContent.displayName;
|
|
1801
1876
|
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenu$1.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
1802
1877
|
ref,
|
|
1803
1878
|
sideOffset,
|
|
1804
|
-
className: cn(
|
|
1879
|
+
className: cn(menuSurfaceClasses, floatingAnimationClasses, className),
|
|
1805
1880
|
...props
|
|
1806
1881
|
}) }));
|
|
1807
1882
|
DropdownMenuContent.displayName = DropdownMenu$1.Content.displayName;
|
|
1808
1883
|
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
1809
1884
|
ref,
|
|
1810
|
-
className: cn(
|
|
1885
|
+
className: cn(menuItemClasses, inset && "pl-8", className),
|
|
1811
1886
|
...props
|
|
1812
1887
|
}));
|
|
1813
1888
|
DropdownMenuItem.displayName = DropdownMenu$1.Item.displayName;
|
|
1814
1889
|
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
1815
1890
|
ref,
|
|
1816
|
-
className: cn(
|
|
1891
|
+
className: cn(menuItemWithIndicatorClasses, className),
|
|
1817
1892
|
checked,
|
|
1818
1893
|
...props,
|
|
1819
1894
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -1827,7 +1902,7 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
|
|
|
1827
1902
|
DropdownMenuCheckboxItem.displayName = DropdownMenu$1.CheckboxItem.displayName;
|
|
1828
1903
|
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
1829
1904
|
ref,
|
|
1830
|
-
className: cn(
|
|
1905
|
+
className: cn(menuItemWithIndicatorClasses, className),
|
|
1831
1906
|
...props,
|
|
1832
1907
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1833
1908
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -1846,7 +1921,7 @@ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1846
1921
|
DropdownMenuLabel.displayName = DropdownMenu$1.Label.displayName;
|
|
1847
1922
|
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
1848
1923
|
ref,
|
|
1849
|
-
className: cn(
|
|
1924
|
+
className: cn(menuSeparatorClasses, className),
|
|
1850
1925
|
...props
|
|
1851
1926
|
}));
|
|
1852
1927
|
DropdownMenuSeparator.displayName = DropdownMenu$1.Separator.displayName;
|
|
@@ -2298,10 +2373,10 @@ DataTable.displayName = "DataTable";
|
|
|
2298
2373
|
//#region src/components/progress.tsx
|
|
2299
2374
|
const Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(Progress$1.Root, {
|
|
2300
2375
|
ref,
|
|
2301
|
-
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-
|
|
2376
|
+
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-muted", className),
|
|
2302
2377
|
...props,
|
|
2303
2378
|
children: /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
2304
|
-
className: "h-full w-full flex-1 bg-
|
|
2379
|
+
className: "h-full w-full flex-1 bg-primary transition-all duration-normal ease-default",
|
|
2305
2380
|
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
2306
2381
|
})
|
|
2307
2382
|
}));
|
|
@@ -2318,7 +2393,7 @@ const progressBarVariants = cva("h-full rounded-full transition-all duration-nor
|
|
|
2318
2393
|
} },
|
|
2319
2394
|
defaultVariants: { color: "primary" }
|
|
2320
2395
|
});
|
|
2321
|
-
const progressBarTrackVariants = cva("relative w-full overflow-hidden rounded-full bg-
|
|
2396
|
+
const progressBarTrackVariants = cva("relative w-full overflow-hidden rounded-full bg-muted", {
|
|
2322
2397
|
variants: { size: {
|
|
2323
2398
|
sm: "h-1.5",
|
|
2324
2399
|
md: "h-2.5",
|
|
@@ -2529,6 +2604,16 @@ const SavedPing = React.forwardRef(({ pingCount, label = "Saved", className, "da
|
|
|
2529
2604
|
SavedPing.displayName = "SavedPing";
|
|
2530
2605
|
//#endregion
|
|
2531
2606
|
//#region src/components/context-menu.tsx
|
|
2607
|
+
/**
|
|
2608
|
+
* ContextMenu mirrors `dropdown-menu.tsx` visually — Radix UI ships them as
|
|
2609
|
+
* separate primitives because the trigger semantics differ (right-click vs
|
|
2610
|
+
* click), but the rendered chrome is identical. Both import from
|
|
2611
|
+
* `lib/surface-classes.ts` so any visual tweak updates both automatically.
|
|
2612
|
+
*
|
|
2613
|
+
* If you need to change the look of menus, edit `surface-classes.ts`
|
|
2614
|
+
* (the `menuSurfaceClasses` / `menuItemClasses` exports). Do NOT edit one
|
|
2615
|
+
* of these files without the other.
|
|
2616
|
+
*/
|
|
2532
2617
|
const ContextMenu = ContextMenu$1.Root;
|
|
2533
2618
|
const ContextMenuTrigger = ContextMenu$1.Trigger;
|
|
2534
2619
|
const ContextMenuGroup = ContextMenu$1.Group;
|
|
@@ -2537,7 +2622,7 @@ const ContextMenuSub = ContextMenu$1.Sub;
|
|
|
2537
2622
|
const ContextMenuRadioGroup = ContextMenu$1.RadioGroup;
|
|
2538
2623
|
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenu$1.SubTrigger, {
|
|
2539
2624
|
ref,
|
|
2540
|
-
className: cn("
|
|
2625
|
+
className: cn(menuItemClasses, "data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className),
|
|
2541
2626
|
...props,
|
|
2542
2627
|
children: [children, /* @__PURE__ */ jsx(FontAwesomeIcon, {
|
|
2543
2628
|
icon: faChevronRight,
|
|
@@ -2547,25 +2632,25 @@ const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ..
|
|
|
2547
2632
|
ContextMenuSubTrigger.displayName = ContextMenu$1.SubTrigger.displayName;
|
|
2548
2633
|
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenu$1.SubContent, {
|
|
2549
2634
|
ref,
|
|
2550
|
-
className: cn(
|
|
2635
|
+
className: cn(menuSurfaceClasses, floatingAnimationClasses, className),
|
|
2551
2636
|
...props
|
|
2552
2637
|
}));
|
|
2553
2638
|
ContextMenuSubContent.displayName = ContextMenu$1.SubContent.displayName;
|
|
2554
2639
|
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(ContextMenu$1.Content, {
|
|
2555
2640
|
ref,
|
|
2556
|
-
className: cn(
|
|
2641
|
+
className: cn(menuSurfaceClasses, floatingAnimationClasses, className),
|
|
2557
2642
|
...props
|
|
2558
2643
|
}) }));
|
|
2559
2644
|
ContextMenuContent.displayName = ContextMenu$1.Content.displayName;
|
|
2560
2645
|
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenu$1.Item, {
|
|
2561
2646
|
ref,
|
|
2562
|
-
className: cn(
|
|
2647
|
+
className: cn(menuItemClasses, inset && "pl-8", className),
|
|
2563
2648
|
...props
|
|
2564
2649
|
}));
|
|
2565
2650
|
ContextMenuItem.displayName = ContextMenu$1.Item.displayName;
|
|
2566
2651
|
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenu$1.CheckboxItem, {
|
|
2567
2652
|
ref,
|
|
2568
|
-
className: cn(
|
|
2653
|
+
className: cn(menuItemWithIndicatorClasses, className),
|
|
2569
2654
|
checked,
|
|
2570
2655
|
...props,
|
|
2571
2656
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -2579,7 +2664,7 @@ const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked
|
|
|
2579
2664
|
ContextMenuCheckboxItem.displayName = ContextMenu$1.CheckboxItem.displayName;
|
|
2580
2665
|
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenu$1.RadioItem, {
|
|
2581
2666
|
ref,
|
|
2582
|
-
className: cn(
|
|
2667
|
+
className: cn(menuItemWithIndicatorClasses, className),
|
|
2583
2668
|
...props,
|
|
2584
2669
|
children: [/* @__PURE__ */ jsx("span", {
|
|
2585
2670
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -2598,7 +2683,7 @@ const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2598
2683
|
ContextMenuLabel.displayName = ContextMenu$1.Label.displayName;
|
|
2599
2684
|
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenu$1.Separator, {
|
|
2600
2685
|
ref,
|
|
2601
|
-
className: cn(
|
|
2686
|
+
className: cn(menuSeparatorClasses, className),
|
|
2602
2687
|
...props
|
|
2603
2688
|
}));
|
|
2604
2689
|
ContextMenuSeparator.displayName = ContextMenu$1.Separator.displayName;
|
|
@@ -2842,7 +2927,7 @@ const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2842
2927
|
CommandSeparator.displayName = Command$1.Separator.displayName;
|
|
2843
2928
|
const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
2844
2929
|
ref,
|
|
2845
|
-
className: cn("
|
|
2930
|
+
className: cn(menuItemClasses, "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground", className),
|
|
2846
2931
|
...props
|
|
2847
2932
|
}));
|
|
2848
2933
|
CommandItem.displayName = Command$1.Item.displayName;
|
|
@@ -3527,14 +3612,14 @@ function PillTabs({ activeTab, onTabChange, otpLabel }) {
|
|
|
3527
3612
|
}, tab.value))
|
|
3528
3613
|
});
|
|
3529
3614
|
}
|
|
3530
|
-
function OtpForm({ onOtpRequest, onOtpVerify, loading = false, disabled = false
|
|
3615
|
+
function OtpForm({ onOtpRequest, onOtpVerify, loading = false, disabled = false }) {
|
|
3531
3616
|
const [step, setStep] = React.useState("email");
|
|
3532
3617
|
const [email, setEmail] = React.useState("");
|
|
3533
3618
|
const [session, setSession] = React.useState("");
|
|
3534
3619
|
const [otpLoading, setOtpLoading] = React.useState(false);
|
|
3535
3620
|
const [otpError, setOtpError] = React.useState();
|
|
3536
3621
|
const isLoading = loading || otpLoading;
|
|
3537
|
-
const displayError = otpError
|
|
3622
|
+
const displayError = otpError;
|
|
3538
3623
|
const handleEmailSubmit = async (e) => {
|
|
3539
3624
|
e.preventDefault();
|
|
3540
3625
|
const emailValue = new FormData(e.currentTarget).get("otp-email");
|
|
@@ -3612,9 +3697,22 @@ function OtpForm({ onOtpRequest, onOtpVerify, loading = false, disabled = false,
|
|
|
3612
3697
|
})]
|
|
3613
3698
|
})] });
|
|
3614
3699
|
}
|
|
3615
|
-
function SignInBlock({ onSubmit, onForgotPassword, onSocialLogin, socialProviders = [], loading = false, error, disabled = false, title = "Sign in", description = "Enter your credentials to access your account", signUpHref, onSignUp, className, children, onOtpRequest, onOtpVerify, otpLabel = "Email me a code" }) {
|
|
3700
|
+
function SignInBlock({ onSubmit, onForgotPassword, onSocialLogin, socialProviders = [], loading = false, error, disabled = false, title = "Sign in", description = "Enter your credentials to access your account", signUpHref, onSignUp, className, children, onOtpRequest, onOtpVerify, otpLabel = "Email me a code", onTabChange }) {
|
|
3616
3701
|
const [activeTab, setActiveTab] = React.useState(AUTH_TABS.PASSWORD);
|
|
3617
3702
|
const otpEnabled = Boolean(onOtpRequest && onOtpVerify);
|
|
3703
|
+
const handleTabChange = React.useCallback((tab) => {
|
|
3704
|
+
setActiveTab(tab);
|
|
3705
|
+
onTabChange?.(tab);
|
|
3706
|
+
}, [onTabChange]);
|
|
3707
|
+
const [errorTab, setErrorTab] = React.useState(error ? AUTH_TABS.PASSWORD : null);
|
|
3708
|
+
const previousErrorRef = React.useRef(error);
|
|
3709
|
+
React.useEffect(() => {
|
|
3710
|
+
if (error !== previousErrorRef.current) {
|
|
3711
|
+
previousErrorRef.current = error;
|
|
3712
|
+
setErrorTab(error ? activeTab : null);
|
|
3713
|
+
}
|
|
3714
|
+
}, [error, activeTab]);
|
|
3715
|
+
const visibleError = errorTab === activeTab ? error : void 0;
|
|
3618
3716
|
const handleSubmit = async (e) => {
|
|
3619
3717
|
e.preventDefault();
|
|
3620
3718
|
const formData = new FormData(e.currentTarget);
|
|
@@ -3623,7 +3721,7 @@ function SignInBlock({ onSubmit, onForgotPassword, onSocialLogin, socialProvider
|
|
|
3623
3721
|
password: formData.get("password")
|
|
3624
3722
|
});
|
|
3625
3723
|
};
|
|
3626
|
-
const passwordForm = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FormError, { message:
|
|
3724
|
+
const passwordForm = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FormError, { message: visibleError }), /* @__PURE__ */ jsxs("form", {
|
|
3627
3725
|
onSubmit: handleSubmit,
|
|
3628
3726
|
className: "space-y-4",
|
|
3629
3727
|
children: [
|
|
@@ -3715,7 +3813,7 @@ function SignInBlock({ onSubmit, onForgotPassword, onSocialLogin, socialProvider
|
|
|
3715
3813
|
children: [
|
|
3716
3814
|
children ? children : otpEnabled ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PillTabs, {
|
|
3717
3815
|
activeTab,
|
|
3718
|
-
onTabChange:
|
|
3816
|
+
onTabChange: handleTabChange,
|
|
3719
3817
|
otpLabel
|
|
3720
3818
|
}), /* @__PURE__ */ jsx(motion.div, {
|
|
3721
3819
|
layout: true,
|
|
@@ -3745,8 +3843,7 @@ function SignInBlock({ onSubmit, onForgotPassword, onSocialLogin, socialProvider
|
|
|
3745
3843
|
onOtpRequest,
|
|
3746
3844
|
onOtpVerify,
|
|
3747
3845
|
loading,
|
|
3748
|
-
disabled
|
|
3749
|
-
error
|
|
3846
|
+
disabled
|
|
3750
3847
|
})
|
|
3751
3848
|
}, "otp")
|
|
3752
3849
|
})
|