@doscientos/ui 0.1.16 → 0.1.18
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.cjs +157 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -20
- package/dist/index.d.ts +35 -20
- package/dist/index.js +157 -131
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -202,6 +202,7 @@ __export(index_exports, {
|
|
|
202
202
|
ToolbarSpacer: () => ToolbarSpacer,
|
|
203
203
|
Tooltip: () => Tooltip,
|
|
204
204
|
TooltipTrigger: () => TooltipTrigger,
|
|
205
|
+
actionRipple: () => actionRipple,
|
|
205
206
|
alertVariants: () => alertVariants,
|
|
206
207
|
badgeVariants: () => badgeVariants,
|
|
207
208
|
buttonGroupVariants: () => buttonGroupVariants,
|
|
@@ -317,6 +318,12 @@ function useFormDirty() {
|
|
|
317
318
|
return { formRef, isDirty, markDirty: () => setIsDirty(true), reset };
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
// src/lib/action-ripple.ts
|
|
322
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
323
|
+
var actionRipple = (0, import_class_variance_authority.cva)(
|
|
324
|
+
"relative isolate overflow-hidden after:pointer-events-none after:absolute after:top-1/2 after:left-1/2 after:aspect-square after:w-full after:-translate-x-1/2 after:-translate-y-1/2 after:scale-0 after:rounded-full after:bg-current after:opacity-0 after:content-[''] after:transition-[scale,opacity] after:duration-300 after:ease-out active:after:scale-150 active:after:opacity-10 data-pressed:after:scale-150 data-pressed:after:opacity-10 motion-reduce:after:hidden"
|
|
325
|
+
);
|
|
326
|
+
|
|
320
327
|
// src/lib/cn.ts
|
|
321
328
|
var import_clsx = require("clsx");
|
|
322
329
|
var import_tailwind_merge = require("tailwind-merge");
|
|
@@ -449,9 +456,9 @@ function AccordionContent({
|
|
|
449
456
|
}
|
|
450
457
|
|
|
451
458
|
// src/ui/alert/alert.tsx
|
|
452
|
-
var
|
|
459
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
453
460
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
454
|
-
var alertVariants = (0,
|
|
461
|
+
var alertVariants = (0, import_class_variance_authority2.cva)(
|
|
455
462
|
"group/alert relative grid w-full gap-0.5 rounded-lg border border-border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
456
463
|
{
|
|
457
464
|
variants: {
|
|
@@ -624,10 +631,10 @@ function AvatarGroupCount({ className, ...props }) {
|
|
|
624
631
|
}
|
|
625
632
|
|
|
626
633
|
// src/ui/badge/badge.tsx
|
|
627
|
-
var
|
|
634
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
628
635
|
var import_react_aria_components2 = require("react-aria-components");
|
|
629
636
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
630
|
-
var badgeVariants = (0,
|
|
637
|
+
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
631
638
|
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
632
639
|
{
|
|
633
640
|
variants: {
|
|
@@ -690,78 +697,15 @@ function BreadcrumbSeparator({ children = "/", className, ...props }) {
|
|
|
690
697
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "data-slot": "breadcrumb-separator", "aria-hidden": "true", className: cn("text-muted-foreground/60", className), ...props, children });
|
|
691
698
|
}
|
|
692
699
|
|
|
693
|
-
// src/ui/button/button.tsx
|
|
694
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
695
|
-
var import_react_aria_components4 = require("react-aria-components");
|
|
696
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
697
|
-
var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
698
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
699
|
-
{
|
|
700
|
-
variants: {
|
|
701
|
-
variant: {
|
|
702
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
703
|
-
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
704
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
705
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
706
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
707
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
708
|
-
},
|
|
709
|
-
size: {
|
|
710
|
-
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
711
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
712
|
-
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
713
|
-
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
714
|
-
icon: "size-8",
|
|
715
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
716
|
-
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
717
|
-
"icon-lg": "size-9"
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
defaultVariants: {
|
|
721
|
-
variant: "default",
|
|
722
|
-
size: "default"
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
);
|
|
726
|
-
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
727
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
728
|
-
import_react_aria_components4.Button,
|
|
729
|
-
{
|
|
730
|
-
"data-slot": "button",
|
|
731
|
-
"data-variant": variant,
|
|
732
|
-
"data-size": size,
|
|
733
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
734
|
-
...props
|
|
735
|
-
}
|
|
736
|
-
);
|
|
737
|
-
}
|
|
738
|
-
function LinkButton({
|
|
739
|
-
className,
|
|
740
|
-
variant = "default",
|
|
741
|
-
size = "default",
|
|
742
|
-
...props
|
|
743
|
-
}) {
|
|
744
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
745
|
-
import_react_aria_components4.Link,
|
|
746
|
-
{
|
|
747
|
-
"data-slot": "button",
|
|
748
|
-
"data-variant": variant,
|
|
749
|
-
"data-size": size,
|
|
750
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
751
|
-
...props
|
|
752
|
-
}
|
|
753
|
-
);
|
|
754
|
-
}
|
|
755
|
-
|
|
756
700
|
// src/ui/button-group/button-group.tsx
|
|
757
701
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
758
702
|
|
|
759
703
|
// src/ui/separator/separator.tsx
|
|
760
|
-
var
|
|
761
|
-
var
|
|
704
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
705
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
762
706
|
function Separator({ className, orientation = "horizontal", ...props }) {
|
|
763
|
-
return /* @__PURE__ */ (0,
|
|
764
|
-
|
|
707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
708
|
+
import_react_aria_components4.Separator,
|
|
765
709
|
{
|
|
766
710
|
"data-slot": "separator",
|
|
767
711
|
orientation,
|
|
@@ -775,7 +719,7 @@ function Separator({ className, orientation = "horizontal", ...props }) {
|
|
|
775
719
|
}
|
|
776
720
|
|
|
777
721
|
// src/ui/button-group/button-group.tsx
|
|
778
|
-
var
|
|
722
|
+
var import_jsx_runtime8 = (
|
|
779
723
|
// biome-ignore lint/a11y/useSemanticElements: fieldset would impose form semantics on a generic action group.
|
|
780
724
|
require("react/jsx-runtime")
|
|
781
725
|
);
|
|
@@ -798,7 +742,7 @@ function ButtonGroup({
|
|
|
798
742
|
orientation,
|
|
799
743
|
...props
|
|
800
744
|
}) {
|
|
801
|
-
return /* @__PURE__ */ (0,
|
|
745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
802
746
|
"div",
|
|
803
747
|
{
|
|
804
748
|
role: "group",
|
|
@@ -825,7 +769,7 @@ function ButtonGroupText({
|
|
|
825
769
|
};
|
|
826
770
|
return render(renderProps);
|
|
827
771
|
}
|
|
828
|
-
return /* @__PURE__ */ (0,
|
|
772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
829
773
|
"div",
|
|
830
774
|
{
|
|
831
775
|
"data-slot": "button-group-text",
|
|
@@ -842,7 +786,7 @@ function ButtonGroupSeparator({
|
|
|
842
786
|
orientation = "vertical",
|
|
843
787
|
...props
|
|
844
788
|
}) {
|
|
845
|
-
return /* @__PURE__ */ (0,
|
|
789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
846
790
|
Separator,
|
|
847
791
|
{
|
|
848
792
|
"data-slot": "button-group-separator",
|
|
@@ -856,6 +800,72 @@ function ButtonGroupSeparator({
|
|
|
856
800
|
);
|
|
857
801
|
}
|
|
858
802
|
|
|
803
|
+
// src/ui/button/button.tsx
|
|
804
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
805
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
806
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
807
|
+
var buttonVariants = (0, import_class_variance_authority5.cva)(
|
|
808
|
+
cn(
|
|
809
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
810
|
+
actionRipple()
|
|
811
|
+
),
|
|
812
|
+
{
|
|
813
|
+
variants: {
|
|
814
|
+
variant: {
|
|
815
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
816
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
817
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
818
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
819
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
820
|
+
link: "text-primary underline-offset-4 hover:underline after:hidden"
|
|
821
|
+
},
|
|
822
|
+
size: {
|
|
823
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
824
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
825
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
826
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
827
|
+
icon: "size-8",
|
|
828
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
829
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
830
|
+
"icon-lg": "size-9"
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
defaultVariants: {
|
|
834
|
+
variant: "default",
|
|
835
|
+
size: "default"
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
);
|
|
839
|
+
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
841
|
+
import_react_aria_components5.Button,
|
|
842
|
+
{
|
|
843
|
+
"data-slot": "button",
|
|
844
|
+
"data-variant": variant,
|
|
845
|
+
"data-size": size,
|
|
846
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
847
|
+
...props
|
|
848
|
+
}
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
function LinkButton({
|
|
852
|
+
className,
|
|
853
|
+
variant = "default",
|
|
854
|
+
size = "default",
|
|
855
|
+
...props
|
|
856
|
+
}) {
|
|
857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
858
|
+
import_react_aria_components5.Link,
|
|
859
|
+
{
|
|
860
|
+
"data-slot": "button",
|
|
861
|
+
"data-variant": variant,
|
|
862
|
+
"data-size": size,
|
|
863
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
864
|
+
...props
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
|
|
859
869
|
// src/ui/card/card.tsx
|
|
860
870
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
861
871
|
function Card({ className, size = "default", ...props }) {
|
|
@@ -1177,7 +1187,7 @@ function DrawerDescription({ className, ...props }) {
|
|
|
1177
1187
|
|
|
1178
1188
|
// src/ui/dropdown-menu/dropdown-menu.tsx
|
|
1179
1189
|
var React2 = require("react");
|
|
1180
|
-
var
|
|
1190
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1181
1191
|
var import_lucide_react4 = require("lucide-react");
|
|
1182
1192
|
var import_react_aria_components11 = require("react-aria-components");
|
|
1183
1193
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -1237,7 +1247,7 @@ function DropdownMenuLabel({
|
|
|
1237
1247
|
}
|
|
1238
1248
|
);
|
|
1239
1249
|
}
|
|
1240
|
-
var dropdownMenuItemVariants = (0,
|
|
1250
|
+
var dropdownMenuItemVariants = (0, import_class_variance_authority6.cva)(
|
|
1241
1251
|
"group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1242
1252
|
{
|
|
1243
1253
|
variants: {
|
|
@@ -1364,7 +1374,7 @@ function DropdownMenuShortcut({
|
|
|
1364
1374
|
}
|
|
1365
1375
|
|
|
1366
1376
|
// src/ui/empty-state/empty-state.tsx
|
|
1367
|
-
var
|
|
1377
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1368
1378
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1369
1379
|
function EmptyState({ className, ...props }) {
|
|
1370
1380
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -1389,7 +1399,7 @@ function EmptyStateHeader({ className, ...props }) {
|
|
|
1389
1399
|
}
|
|
1390
1400
|
);
|
|
1391
1401
|
}
|
|
1392
|
-
var emptyStateMediaVariants = (0,
|
|
1402
|
+
var emptyStateMediaVariants = (0, import_class_variance_authority7.cva)(
|
|
1393
1403
|
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1394
1404
|
{
|
|
1395
1405
|
variants: {
|
|
@@ -1454,7 +1464,7 @@ function EmptyStateContent({ className, ...props }) {
|
|
|
1454
1464
|
}
|
|
1455
1465
|
|
|
1456
1466
|
// src/ui/field/field.tsx
|
|
1457
|
-
var
|
|
1467
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1458
1468
|
|
|
1459
1469
|
// src/ui/label/label.tsx
|
|
1460
1470
|
var import_react6 = require("react");
|
|
@@ -1500,7 +1510,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
1500
1510
|
}
|
|
1501
1511
|
);
|
|
1502
1512
|
}
|
|
1503
|
-
var fieldVariants = (0,
|
|
1513
|
+
var fieldVariants = (0, import_class_variance_authority8.cva)(
|
|
1504
1514
|
"group/field flex w-full gap-2 data-[invalid=true]:text-destructive",
|
|
1505
1515
|
{
|
|
1506
1516
|
variants: {
|
|
@@ -1780,6 +1790,9 @@ function IconButton({
|
|
|
1780
1790
|
] });
|
|
1781
1791
|
}
|
|
1782
1792
|
|
|
1793
|
+
// src/ui/input-group/input-group.tsx
|
|
1794
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1795
|
+
|
|
1783
1796
|
// src/ui/input/input.tsx
|
|
1784
1797
|
var import_react8 = require("react");
|
|
1785
1798
|
var import_react_aria_components15 = require("react-aria-components");
|
|
@@ -1789,9 +1802,6 @@ var InputImpl = (0, import_react8.forwardRef)(function Input2({ className, type,
|
|
|
1789
1802
|
});
|
|
1790
1803
|
var Input3 = InputImpl;
|
|
1791
1804
|
|
|
1792
|
-
// src/ui/input-group/input-group.tsx
|
|
1793
|
-
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1794
|
-
|
|
1795
1805
|
// src/ui/textarea/textarea.tsx
|
|
1796
1806
|
var import_react9 = require("react");
|
|
1797
1807
|
var import_react_aria_components16 = require("react-aria-components");
|
|
@@ -1820,7 +1830,7 @@ function InputGroup({ className, ...props }) {
|
|
|
1820
1830
|
}
|
|
1821
1831
|
);
|
|
1822
1832
|
}
|
|
1823
|
-
var inputGroupAddonVariants = (0,
|
|
1833
|
+
var inputGroupAddonVariants = (0, import_class_variance_authority9.cva)(
|
|
1824
1834
|
"flex cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none [&_svg:not([class*='size-'])]:size-4",
|
|
1825
1835
|
{
|
|
1826
1836
|
variants: {
|
|
@@ -1859,7 +1869,7 @@ function InputGroupAddon({
|
|
|
1859
1869
|
)
|
|
1860
1870
|
);
|
|
1861
1871
|
}
|
|
1862
|
-
var inputGroupButtonVariants = (0,
|
|
1872
|
+
var inputGroupButtonVariants = (0, import_class_variance_authority9.cva)("shrink-0 shadow-none", {
|
|
1863
1873
|
variants: {
|
|
1864
1874
|
size: { xs: "h-6 px-1.5 text-xs", sm: "h-7 px-2", "icon-xs": "size-6", "icon-sm": "size-7" }
|
|
1865
1875
|
},
|
|
@@ -2597,18 +2607,27 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
2597
2607
|
var switchSizes = {
|
|
2598
2608
|
sm: {
|
|
2599
2609
|
control: "h-4 w-[1.875rem] p-0.5",
|
|
2600
|
-
thumb: "h-3
|
|
2601
|
-
|
|
2610
|
+
thumb: "h-3",
|
|
2611
|
+
idleWidth: "0.75rem",
|
|
2612
|
+
activeWidth: "1rem",
|
|
2613
|
+
selectedOffset: "0.875rem",
|
|
2614
|
+
activeSelectedOffset: "0.625rem"
|
|
2602
2615
|
},
|
|
2603
2616
|
md: {
|
|
2604
2617
|
control: "h-5 w-9 p-0.5",
|
|
2605
|
-
thumb: "h-4
|
|
2606
|
-
|
|
2618
|
+
thumb: "h-4",
|
|
2619
|
+
idleWidth: "1rem",
|
|
2620
|
+
activeWidth: "1.25rem",
|
|
2621
|
+
selectedOffset: "1rem",
|
|
2622
|
+
activeSelectedOffset: "0.75rem"
|
|
2607
2623
|
},
|
|
2608
2624
|
lg: {
|
|
2609
2625
|
control: "h-6 w-11 p-0.5",
|
|
2610
|
-
thumb: "h-5
|
|
2611
|
-
|
|
2626
|
+
thumb: "h-5",
|
|
2627
|
+
idleWidth: "1.25rem",
|
|
2628
|
+
activeWidth: "1.5rem",
|
|
2629
|
+
selectedOffset: "1.25rem",
|
|
2630
|
+
activeSelectedOffset: "1rem"
|
|
2612
2631
|
}
|
|
2613
2632
|
};
|
|
2614
2633
|
function Switch({
|
|
@@ -2654,43 +2673,50 @@ function Switch({
|
|
|
2654
2673
|
className
|
|
2655
2674
|
),
|
|
2656
2675
|
...props,
|
|
2657
|
-
children: (state) =>
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
"
|
|
2663
|
-
|
|
2664
|
-
"
|
|
2665
|
-
"
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
"
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2676
|
+
children: (state) => {
|
|
2677
|
+
const isThumbActive = state.isHovered || state.isPressed;
|
|
2678
|
+
const thumbOffset = state.isSelected ? isThumbActive ? styles.activeSelectedOffset : styles.selectedOffset : "0";
|
|
2679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2681
|
+
"span",
|
|
2682
|
+
{
|
|
2683
|
+
"aria-hidden": "true",
|
|
2684
|
+
"data-slot": "switch-control",
|
|
2685
|
+
className: cn(
|
|
2686
|
+
"relative inline-flex shrink-0 items-center overflow-hidden rounded-full border border-border bg-input shadow-inner",
|
|
2687
|
+
"transition-[background-color,border-color,box-shadow] duration-200 ease-out motion-reduce:transition-none",
|
|
2688
|
+
"group-data-hovered/switch:bg-muted-foreground/25",
|
|
2689
|
+
"group-data-selected/switch:border-primary group-data-selected/switch:bg-primary",
|
|
2690
|
+
"group-data-selected/switch:group-data-hovered/switch:bg-primary/85",
|
|
2691
|
+
"group-data-focus-visible/switch:ring-3 group-data-focus-visible/switch:ring-ring/50",
|
|
2692
|
+
styles.control
|
|
2693
|
+
),
|
|
2694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2695
|
+
"span",
|
|
2696
|
+
{
|
|
2697
|
+
"data-slot": "switch-thumb",
|
|
2698
|
+
style: {
|
|
2699
|
+
transform: `translate3d(${thumbOffset}, 0, 0)`,
|
|
2700
|
+
width: isThumbActive ? styles.activeWidth : styles.idleWidth
|
|
2701
|
+
},
|
|
2702
|
+
className: cn(
|
|
2703
|
+
"grid shrink-0 place-items-center rounded-full border border-border/60 bg-background text-[0.625rem] text-muted-foreground shadow-sm",
|
|
2704
|
+
"will-change-[transform,width] transition-[transform,width,background-color,color,border-color] duration-[240ms] ease-[cubic-bezier(0.2,0.8,0.2,1)] motion-reduce:transition-none",
|
|
2705
|
+
"group-data-selected/switch:border-primary-foreground/20",
|
|
2706
|
+
"group-data-selected/switch:bg-primary-foreground group-data-selected/switch:text-primary",
|
|
2707
|
+
styles.thumb
|
|
2708
|
+
),
|
|
2709
|
+
children: state.isSelected ? selectedIcon ?? icon : icon
|
|
2710
|
+
}
|
|
2711
|
+
)
|
|
2712
|
+
}
|
|
2713
|
+
),
|
|
2714
|
+
children || description ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "grid gap-0.5 leading-tight", children: [
|
|
2715
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "data-slot": "switch-label", className: "font-medium", children: typeof children === "function" ? children(state) : children }) : null,
|
|
2716
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "data-slot": "switch-description", className: "text-xs font-normal text-muted-foreground", children: description }) : null
|
|
2717
|
+
] }) : null
|
|
2718
|
+
] });
|
|
2719
|
+
}
|
|
2694
2720
|
}
|
|
2695
2721
|
);
|
|
2696
2722
|
}
|
|
@@ -2844,7 +2870,7 @@ function ToastProvider({ children }) {
|
|
|
2844
2870
|
] });
|
|
2845
2871
|
}
|
|
2846
2872
|
function Toaster({ position }) {
|
|
2847
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_sileo.Toaster, { position });
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_sileo.Toaster, { position, options: { fill: "var(--ui-secondary)" } });
|
|
2848
2874
|
}
|
|
2849
2875
|
function ToastViewport({ position, visiblePosition, className }) {
|
|
2850
2876
|
void className;
|
|
@@ -3047,6 +3073,7 @@ function ToolbarSpacer({ className, ...props }) {
|
|
|
3047
3073
|
ToolbarSpacer,
|
|
3048
3074
|
Tooltip,
|
|
3049
3075
|
TooltipTrigger,
|
|
3076
|
+
actionRipple,
|
|
3050
3077
|
alertVariants,
|
|
3051
3078
|
badgeVariants,
|
|
3052
3079
|
buttonGroupVariants,
|