@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.js
CHANGED
|
@@ -95,6 +95,12 @@ function useFormDirty() {
|
|
|
95
95
|
return { formRef, isDirty, markDirty: () => setIsDirty(true), reset };
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
// src/lib/action-ripple.ts
|
|
99
|
+
import { cva } from "class-variance-authority";
|
|
100
|
+
var actionRipple = cva(
|
|
101
|
+
"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"
|
|
102
|
+
);
|
|
103
|
+
|
|
98
104
|
// src/lib/cn.ts
|
|
99
105
|
import { clsx } from "clsx";
|
|
100
106
|
import { twMerge } from "tailwind-merge";
|
|
@@ -233,9 +239,9 @@ function AccordionContent({
|
|
|
233
239
|
}
|
|
234
240
|
|
|
235
241
|
// src/ui/alert/alert.tsx
|
|
236
|
-
import { cva } from "class-variance-authority";
|
|
242
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
237
243
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
238
|
-
var alertVariants =
|
|
244
|
+
var alertVariants = cva2(
|
|
239
245
|
"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",
|
|
240
246
|
{
|
|
241
247
|
variants: {
|
|
@@ -408,10 +414,10 @@ function AvatarGroupCount({ className, ...props }) {
|
|
|
408
414
|
}
|
|
409
415
|
|
|
410
416
|
// src/ui/badge/badge.tsx
|
|
411
|
-
import { cva as
|
|
417
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
412
418
|
import { Link } from "react-aria-components";
|
|
413
419
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
414
|
-
var badgeVariants =
|
|
420
|
+
var badgeVariants = cva3(
|
|
415
421
|
"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",
|
|
416
422
|
{
|
|
417
423
|
variants: {
|
|
@@ -474,80 +480,14 @@ function BreadcrumbSeparator({ children = "/", className, ...props }) {
|
|
|
474
480
|
return /* @__PURE__ */ jsx6("span", { "data-slot": "breadcrumb-separator", "aria-hidden": "true", className: cn("text-muted-foreground/60", className), ...props, children });
|
|
475
481
|
}
|
|
476
482
|
|
|
477
|
-
// src/ui/button/button.tsx
|
|
478
|
-
import { cva as cva3 } from "class-variance-authority";
|
|
479
|
-
import {
|
|
480
|
-
Button as ButtonPrimitive,
|
|
481
|
-
Link as LinkPrimitive
|
|
482
|
-
} from "react-aria-components";
|
|
483
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
484
|
-
var buttonVariants = cva3(
|
|
485
|
-
"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",
|
|
486
|
-
{
|
|
487
|
-
variants: {
|
|
488
|
-
variant: {
|
|
489
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
490
|
-
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",
|
|
491
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
492
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
493
|
-
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",
|
|
494
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
495
|
-
},
|
|
496
|
-
size: {
|
|
497
|
-
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
498
|
-
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",
|
|
499
|
-
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",
|
|
500
|
-
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
501
|
-
icon: "size-8",
|
|
502
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
503
|
-
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
504
|
-
"icon-lg": "size-9"
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
defaultVariants: {
|
|
508
|
-
variant: "default",
|
|
509
|
-
size: "default"
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
);
|
|
513
|
-
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
514
|
-
return /* @__PURE__ */ jsx7(
|
|
515
|
-
ButtonPrimitive,
|
|
516
|
-
{
|
|
517
|
-
"data-slot": "button",
|
|
518
|
-
"data-variant": variant,
|
|
519
|
-
"data-size": size,
|
|
520
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
521
|
-
...props
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
}
|
|
525
|
-
function LinkButton({
|
|
526
|
-
className,
|
|
527
|
-
variant = "default",
|
|
528
|
-
size = "default",
|
|
529
|
-
...props
|
|
530
|
-
}) {
|
|
531
|
-
return /* @__PURE__ */ jsx7(
|
|
532
|
-
LinkPrimitive,
|
|
533
|
-
{
|
|
534
|
-
"data-slot": "button",
|
|
535
|
-
"data-variant": variant,
|
|
536
|
-
"data-size": size,
|
|
537
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
538
|
-
...props
|
|
539
|
-
}
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
483
|
// src/ui/button-group/button-group.tsx
|
|
544
484
|
import { cva as cva4 } from "class-variance-authority";
|
|
545
485
|
|
|
546
486
|
// src/ui/separator/separator.tsx
|
|
547
487
|
import { Separator as SeparatorPrimitive } from "react-aria-components";
|
|
548
|
-
import { jsx as
|
|
488
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
549
489
|
function Separator({ className, orientation = "horizontal", ...props }) {
|
|
550
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx7(
|
|
551
491
|
SeparatorPrimitive,
|
|
552
492
|
{
|
|
553
493
|
"data-slot": "separator",
|
|
@@ -562,7 +502,7 @@ function Separator({ className, orientation = "horizontal", ...props }) {
|
|
|
562
502
|
}
|
|
563
503
|
|
|
564
504
|
// src/ui/button-group/button-group.tsx
|
|
565
|
-
import { jsx as
|
|
505
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
566
506
|
var buttonGroupVariants = cva4(
|
|
567
507
|
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
568
508
|
{
|
|
@@ -584,7 +524,7 @@ function ButtonGroup({
|
|
|
584
524
|
}) {
|
|
585
525
|
return (
|
|
586
526
|
// biome-ignore lint/a11y/useSemanticElements: fieldset would impose form semantics on a generic action group.
|
|
587
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ jsx8(
|
|
588
528
|
"div",
|
|
589
529
|
{
|
|
590
530
|
role: "group",
|
|
@@ -612,7 +552,7 @@ function ButtonGroupText({
|
|
|
612
552
|
};
|
|
613
553
|
return render(renderProps);
|
|
614
554
|
}
|
|
615
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ jsx8(
|
|
616
556
|
"div",
|
|
617
557
|
{
|
|
618
558
|
"data-slot": "button-group-text",
|
|
@@ -629,7 +569,7 @@ function ButtonGroupSeparator({
|
|
|
629
569
|
orientation = "vertical",
|
|
630
570
|
...props
|
|
631
571
|
}) {
|
|
632
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ jsx8(
|
|
633
573
|
Separator,
|
|
634
574
|
{
|
|
635
575
|
"data-slot": "button-group-separator",
|
|
@@ -643,6 +583,75 @@ function ButtonGroupSeparator({
|
|
|
643
583
|
);
|
|
644
584
|
}
|
|
645
585
|
|
|
586
|
+
// src/ui/button/button.tsx
|
|
587
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
588
|
+
import {
|
|
589
|
+
Button as ButtonPrimitive,
|
|
590
|
+
Link as LinkPrimitive
|
|
591
|
+
} from "react-aria-components";
|
|
592
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
593
|
+
var buttonVariants = cva5(
|
|
594
|
+
cn(
|
|
595
|
+
"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",
|
|
596
|
+
actionRipple()
|
|
597
|
+
),
|
|
598
|
+
{
|
|
599
|
+
variants: {
|
|
600
|
+
variant: {
|
|
601
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
602
|
+
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",
|
|
603
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
604
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
605
|
+
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",
|
|
606
|
+
link: "text-primary underline-offset-4 hover:underline after:hidden"
|
|
607
|
+
},
|
|
608
|
+
size: {
|
|
609
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
610
|
+
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",
|
|
611
|
+
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",
|
|
612
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
613
|
+
icon: "size-8",
|
|
614
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
615
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
616
|
+
"icon-lg": "size-9"
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
defaultVariants: {
|
|
620
|
+
variant: "default",
|
|
621
|
+
size: "default"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
626
|
+
return /* @__PURE__ */ jsx9(
|
|
627
|
+
ButtonPrimitive,
|
|
628
|
+
{
|
|
629
|
+
"data-slot": "button",
|
|
630
|
+
"data-variant": variant,
|
|
631
|
+
"data-size": size,
|
|
632
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
633
|
+
...props
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
function LinkButton({
|
|
638
|
+
className,
|
|
639
|
+
variant = "default",
|
|
640
|
+
size = "default",
|
|
641
|
+
...props
|
|
642
|
+
}) {
|
|
643
|
+
return /* @__PURE__ */ jsx9(
|
|
644
|
+
LinkPrimitive,
|
|
645
|
+
{
|
|
646
|
+
"data-slot": "button",
|
|
647
|
+
"data-variant": variant,
|
|
648
|
+
"data-size": size,
|
|
649
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
650
|
+
...props
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
|
|
646
655
|
// src/ui/card/card.tsx
|
|
647
656
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
648
657
|
function Card({ className, size = "default", ...props }) {
|
|
@@ -972,7 +981,7 @@ function DrawerDescription({ className, ...props }) {
|
|
|
972
981
|
|
|
973
982
|
// src/ui/dropdown-menu/dropdown-menu.tsx
|
|
974
983
|
import "react";
|
|
975
|
-
import { cva as
|
|
984
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
976
985
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
977
986
|
import {
|
|
978
987
|
composeRenderProps,
|
|
@@ -1042,7 +1051,7 @@ function DropdownMenuLabel({
|
|
|
1042
1051
|
}
|
|
1043
1052
|
);
|
|
1044
1053
|
}
|
|
1045
|
-
var dropdownMenuItemVariants =
|
|
1054
|
+
var dropdownMenuItemVariants = cva6(
|
|
1046
1055
|
"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",
|
|
1047
1056
|
{
|
|
1048
1057
|
variants: {
|
|
@@ -1169,7 +1178,7 @@ function DropdownMenuShortcut({
|
|
|
1169
1178
|
}
|
|
1170
1179
|
|
|
1171
1180
|
// src/ui/empty-state/empty-state.tsx
|
|
1172
|
-
import { cva as
|
|
1181
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
1173
1182
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1174
1183
|
function EmptyState({ className, ...props }) {
|
|
1175
1184
|
return /* @__PURE__ */ jsx18(
|
|
@@ -1194,7 +1203,7 @@ function EmptyStateHeader({ className, ...props }) {
|
|
|
1194
1203
|
}
|
|
1195
1204
|
);
|
|
1196
1205
|
}
|
|
1197
|
-
var emptyStateMediaVariants =
|
|
1206
|
+
var emptyStateMediaVariants = cva7(
|
|
1198
1207
|
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1199
1208
|
{
|
|
1200
1209
|
variants: {
|
|
@@ -1259,7 +1268,7 @@ function EmptyStateContent({ className, ...props }) {
|
|
|
1259
1268
|
}
|
|
1260
1269
|
|
|
1261
1270
|
// src/ui/field/field.tsx
|
|
1262
|
-
import { cva as
|
|
1271
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
1263
1272
|
|
|
1264
1273
|
// src/ui/label/label.tsx
|
|
1265
1274
|
import { forwardRef } from "react";
|
|
@@ -1305,7 +1314,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
1305
1314
|
}
|
|
1306
1315
|
);
|
|
1307
1316
|
}
|
|
1308
|
-
var fieldVariants =
|
|
1317
|
+
var fieldVariants = cva8(
|
|
1309
1318
|
"group/field flex w-full gap-2 data-[invalid=true]:text-destructive",
|
|
1310
1319
|
{
|
|
1311
1320
|
variants: {
|
|
@@ -1590,6 +1599,9 @@ function IconButton({
|
|
|
1590
1599
|
] });
|
|
1591
1600
|
}
|
|
1592
1601
|
|
|
1602
|
+
// src/ui/input-group/input-group.tsx
|
|
1603
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
1604
|
+
|
|
1593
1605
|
// src/ui/input/input.tsx
|
|
1594
1606
|
import { forwardRef as forwardRef2 } from "react";
|
|
1595
1607
|
import { Input as AriaInput2 } from "react-aria-components";
|
|
@@ -1599,9 +1611,6 @@ var InputImpl = forwardRef2(function Input2({ className, type, ...props }, ref)
|
|
|
1599
1611
|
});
|
|
1600
1612
|
var Input3 = InputImpl;
|
|
1601
1613
|
|
|
1602
|
-
// src/ui/input-group/input-group.tsx
|
|
1603
|
-
import { cva as cva8 } from "class-variance-authority";
|
|
1604
|
-
|
|
1605
1614
|
// src/ui/textarea/textarea.tsx
|
|
1606
1615
|
import { forwardRef as forwardRef3 } from "react";
|
|
1607
1616
|
import { TextArea as AriaTextArea } from "react-aria-components";
|
|
@@ -1630,7 +1639,7 @@ function InputGroup({ className, ...props }) {
|
|
|
1630
1639
|
)
|
|
1631
1640
|
);
|
|
1632
1641
|
}
|
|
1633
|
-
var inputGroupAddonVariants =
|
|
1642
|
+
var inputGroupAddonVariants = cva9(
|
|
1634
1643
|
"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",
|
|
1635
1644
|
{
|
|
1636
1645
|
variants: {
|
|
@@ -1669,7 +1678,7 @@ function InputGroupAddon({
|
|
|
1669
1678
|
)
|
|
1670
1679
|
);
|
|
1671
1680
|
}
|
|
1672
|
-
var inputGroupButtonVariants =
|
|
1681
|
+
var inputGroupButtonVariants = cva9("shrink-0 shadow-none", {
|
|
1673
1682
|
variants: {
|
|
1674
1683
|
size: { xs: "h-6 px-1.5 text-xs", sm: "h-7 px-2", "icon-xs": "size-6", "icon-sm": "size-7" }
|
|
1675
1684
|
},
|
|
@@ -2455,18 +2464,27 @@ import { Fragment as Fragment10, jsx as jsx42, jsxs as jsxs20 } from "react/jsx-
|
|
|
2455
2464
|
var switchSizes = {
|
|
2456
2465
|
sm: {
|
|
2457
2466
|
control: "h-4 w-[1.875rem] p-0.5",
|
|
2458
|
-
thumb: "h-3
|
|
2459
|
-
|
|
2467
|
+
thumb: "h-3",
|
|
2468
|
+
idleWidth: "0.75rem",
|
|
2469
|
+
activeWidth: "1rem",
|
|
2470
|
+
selectedOffset: "0.875rem",
|
|
2471
|
+
activeSelectedOffset: "0.625rem"
|
|
2460
2472
|
},
|
|
2461
2473
|
md: {
|
|
2462
2474
|
control: "h-5 w-9 p-0.5",
|
|
2463
|
-
thumb: "h-4
|
|
2464
|
-
|
|
2475
|
+
thumb: "h-4",
|
|
2476
|
+
idleWidth: "1rem",
|
|
2477
|
+
activeWidth: "1.25rem",
|
|
2478
|
+
selectedOffset: "1rem",
|
|
2479
|
+
activeSelectedOffset: "0.75rem"
|
|
2465
2480
|
},
|
|
2466
2481
|
lg: {
|
|
2467
2482
|
control: "h-6 w-11 p-0.5",
|
|
2468
|
-
thumb: "h-5
|
|
2469
|
-
|
|
2483
|
+
thumb: "h-5",
|
|
2484
|
+
idleWidth: "1.25rem",
|
|
2485
|
+
activeWidth: "1.5rem",
|
|
2486
|
+
selectedOffset: "1.25rem",
|
|
2487
|
+
activeSelectedOffset: "1rem"
|
|
2470
2488
|
}
|
|
2471
2489
|
};
|
|
2472
2490
|
function Switch({
|
|
@@ -2512,43 +2530,50 @@ function Switch({
|
|
|
2512
2530
|
className
|
|
2513
2531
|
),
|
|
2514
2532
|
...props,
|
|
2515
|
-
children: (state) =>
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
"
|
|
2521
|
-
|
|
2522
|
-
"
|
|
2523
|
-
"
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
"
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2533
|
+
children: (state) => {
|
|
2534
|
+
const isThumbActive = state.isHovered || state.isPressed;
|
|
2535
|
+
const thumbOffset = state.isSelected ? isThumbActive ? styles.activeSelectedOffset : styles.selectedOffset : "0";
|
|
2536
|
+
return /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
2537
|
+
/* @__PURE__ */ jsx42(
|
|
2538
|
+
"span",
|
|
2539
|
+
{
|
|
2540
|
+
"aria-hidden": "true",
|
|
2541
|
+
"data-slot": "switch-control",
|
|
2542
|
+
className: cn(
|
|
2543
|
+
"relative inline-flex shrink-0 items-center overflow-hidden rounded-full border border-border bg-input shadow-inner",
|
|
2544
|
+
"transition-[background-color,border-color,box-shadow] duration-200 ease-out motion-reduce:transition-none",
|
|
2545
|
+
"group-data-hovered/switch:bg-muted-foreground/25",
|
|
2546
|
+
"group-data-selected/switch:border-primary group-data-selected/switch:bg-primary",
|
|
2547
|
+
"group-data-selected/switch:group-data-hovered/switch:bg-primary/85",
|
|
2548
|
+
"group-data-focus-visible/switch:ring-3 group-data-focus-visible/switch:ring-ring/50",
|
|
2549
|
+
styles.control
|
|
2550
|
+
),
|
|
2551
|
+
children: /* @__PURE__ */ jsx42(
|
|
2552
|
+
"span",
|
|
2553
|
+
{
|
|
2554
|
+
"data-slot": "switch-thumb",
|
|
2555
|
+
style: {
|
|
2556
|
+
transform: `translate3d(${thumbOffset}, 0, 0)`,
|
|
2557
|
+
width: isThumbActive ? styles.activeWidth : styles.idleWidth
|
|
2558
|
+
},
|
|
2559
|
+
className: cn(
|
|
2560
|
+
"grid shrink-0 place-items-center rounded-full border border-border/60 bg-background text-[0.625rem] text-muted-foreground shadow-sm",
|
|
2561
|
+
"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",
|
|
2562
|
+
"group-data-selected/switch:border-primary-foreground/20",
|
|
2563
|
+
"group-data-selected/switch:bg-primary-foreground group-data-selected/switch:text-primary",
|
|
2564
|
+
styles.thumb
|
|
2565
|
+
),
|
|
2566
|
+
children: state.isSelected ? selectedIcon ?? icon : icon
|
|
2567
|
+
}
|
|
2568
|
+
)
|
|
2569
|
+
}
|
|
2570
|
+
),
|
|
2571
|
+
children || description ? /* @__PURE__ */ jsxs20("span", { className: "grid gap-0.5 leading-tight", children: [
|
|
2572
|
+
children ? /* @__PURE__ */ jsx42("span", { "data-slot": "switch-label", className: "font-medium", children: typeof children === "function" ? children(state) : children }) : null,
|
|
2573
|
+
description ? /* @__PURE__ */ jsx42("span", { "data-slot": "switch-description", className: "text-xs font-normal text-muted-foreground", children: description }) : null
|
|
2574
|
+
] }) : null
|
|
2575
|
+
] });
|
|
2576
|
+
}
|
|
2552
2577
|
}
|
|
2553
2578
|
);
|
|
2554
2579
|
}
|
|
@@ -2709,7 +2734,7 @@ function ToastProvider({ children }) {
|
|
|
2709
2734
|
] });
|
|
2710
2735
|
}
|
|
2711
2736
|
function Toaster({ position }) {
|
|
2712
|
-
return /* @__PURE__ */ jsx45(SileoToaster, { position });
|
|
2737
|
+
return /* @__PURE__ */ jsx45(SileoToaster, { position, options: { fill: "var(--ui-secondary)" } });
|
|
2713
2738
|
}
|
|
2714
2739
|
function ToastViewport({ position, visiblePosition, className }) {
|
|
2715
2740
|
void className;
|
|
@@ -2911,6 +2936,7 @@ export {
|
|
|
2911
2936
|
ToolbarSpacer,
|
|
2912
2937
|
Tooltip,
|
|
2913
2938
|
TooltipTrigger,
|
|
2939
|
+
actionRipple,
|
|
2914
2940
|
alertVariants,
|
|
2915
2941
|
badgeVariants,
|
|
2916
2942
|
buttonGroupVariants,
|