@codefast/ui 0.3.16-canary.3 → 0.4.0-canary.5
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/CHANGELOG.md +112 -0
- package/README.md +27 -16
- package/dist/components/accordion.d.mts +7 -22
- package/dist/components/accordion.mjs +26 -29
- package/dist/components/alert-dialog.d.mts +27 -26
- package/dist/components/alert-dialog.mjs +53 -45
- package/dist/components/alert.d.mts +12 -2
- package/dist/components/alert.mjs +15 -6
- package/dist/components/aspect-ratio.d.mts +2 -2
- package/dist/components/aspect-ratio.mjs +2 -3
- package/dist/components/avatar.d.mts +41 -5
- package/dist/components/avatar.mjs +40 -10
- package/dist/components/badge.mjs +4 -4
- package/dist/components/breadcrumb.d.mts +1 -0
- package/dist/components/breadcrumb.mjs +11 -10
- package/dist/components/button-group.d.mts +1 -1
- package/dist/components/button-group.mjs +6 -7
- package/dist/components/button.d.mts +0 -1
- package/dist/components/button.mjs +7 -7
- package/dist/components/calendar.d.mts +6 -2
- package/dist/components/calendar.mjs +39 -43
- package/dist/components/card.d.mts +4 -2
- package/dist/components/card.mjs +9 -9
- package/dist/components/carousel.d.mts +16 -4
- package/dist/components/carousel.mjs +25 -12
- package/dist/components/chart.d.mts +8 -3
- package/dist/components/chart.mjs +21 -15
- package/dist/components/checkbox-cards.mjs +6 -6
- package/dist/components/checkbox-group.mjs +6 -7
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/checkbox.mjs +8 -9
- package/dist/components/collapsible.d.mts +4 -4
- package/dist/components/collapsible.mjs +4 -5
- package/dist/components/command.d.mts +11 -1
- package/dist/components/command.mjs +35 -32
- package/dist/components/context-menu.d.mts +22 -15
- package/dist/components/context-menu.mjs +44 -39
- package/dist/components/dialog.d.mts +19 -23
- package/dist/components/dialog.mjs +48 -47
- package/dist/components/direction.d.mts +24 -0
- package/dist/components/direction.mjs +18 -0
- package/dist/components/drawer.d.mts +2 -20
- package/dist/components/drawer.mjs +17 -25
- package/dist/components/dropdown-menu.d.mts +22 -15
- package/dist/components/dropdown-menu.mjs +41 -37
- package/dist/components/empty.mjs +5 -5
- package/dist/components/field.d.mts +1 -1
- package/dist/components/field.mjs +11 -12
- package/dist/components/form.d.mts +6 -7
- package/dist/components/form.mjs +6 -7
- package/dist/components/hover-card.d.mts +5 -5
- package/dist/components/hover-card.mjs +14 -12
- package/dist/components/input-group.d.mts +1 -1
- package/dist/components/input-group.mjs +12 -7
- package/dist/components/input-number.d.mts +3 -1
- package/dist/components/input-number.mjs +49 -27
- package/dist/components/input-otp.mjs +9 -7
- package/dist/components/input-password.mjs +1 -4
- package/dist/components/input-search.mjs +3 -5
- package/dist/components/input.mjs +1 -2
- package/dist/components/item.mjs +9 -9
- package/dist/components/kbd.mjs +1 -1
- package/dist/components/label.d.mts +2 -2
- package/dist/components/label.mjs +3 -4
- package/dist/components/menubar.d.mts +22 -16
- package/dist/components/menubar.mjs +54 -47
- package/dist/components/native-select.d.mts +5 -1
- package/dist/components/native-select.mjs +9 -6
- package/dist/components/navigation-menu.d.mts +30 -8
- package/dist/components/navigation-menu.mjs +33 -23
- package/dist/components/pagination.d.mts +6 -0
- package/dist/components/pagination.mjs +26 -11
- package/dist/components/popover.d.mts +40 -7
- package/dist/components/popover.mjs +46 -14
- package/dist/components/progress-circle.d.mts +1 -1
- package/dist/components/progress-circle.mjs +1 -2
- package/dist/components/progress.d.mts +2 -2
- package/dist/components/progress.mjs +5 -6
- package/dist/components/radio-cards.d.mts +3 -3
- package/dist/components/radio-cards.mjs +11 -11
- package/dist/components/radio-group.d.mts +3 -3
- package/dist/components/radio-group.mjs +9 -9
- package/dist/components/radio.mjs +2 -3
- package/dist/components/resizable.mjs +3 -8
- package/dist/components/scroll-area.d.mts +5 -5
- package/dist/components/scroll-area.mjs +13 -10
- package/dist/components/select.d.mts +14 -14
- package/dist/components/select.mjs +47 -47
- package/dist/components/separator.d.mts +2 -2
- package/dist/components/separator.mjs +3 -4
- package/dist/components/sheet.d.mts +13 -14
- package/dist/components/sheet.mjs +41 -39
- package/dist/components/sidebar.d.mts +2 -3
- package/dist/components/sidebar.mjs +46 -46
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/slider.d.mts +2 -2
- package/dist/components/slider.mjs +9 -11
- package/dist/components/sonner.mjs +11 -3
- package/dist/components/spinner.mjs +6 -7
- package/dist/components/switch.d.mts +5 -2
- package/dist/components/switch.mjs +7 -7
- package/dist/components/table.mjs +10 -10
- package/dist/components/tabs.d.mts +8 -5
- package/dist/components/tabs.mjs +18 -12
- package/dist/components/textarea.mjs +1 -1
- package/dist/components/toggle-group.d.mts +9 -6
- package/dist/components/toggle-group.mjs +19 -20
- package/dist/components/toggle.d.mts +2 -3
- package/dist/components/toggle.mjs +4 -6
- package/dist/components/tooltip.d.mts +7 -6
- package/dist/components/tooltip.mjs +19 -17
- package/dist/hooks/use-animated-value.mjs +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
- package/dist/hooks/use-is-mobile.mjs +0 -1
- package/dist/hooks/use-media-query.mjs +0 -1
- package/dist/hooks/use-mutation-observer.mjs +0 -1
- package/dist/hooks/use-pagination.mjs +0 -1
- package/dist/index.d.mts +15 -13
- package/dist/index.mjs +18 -16
- package/dist/primitives/checkbox-group.d.mts +9 -10
- package/dist/primitives/checkbox-group.mjs +14 -19
- package/dist/primitives/input-number.d.mts +3 -3
- package/dist/primitives/input-number.mjs +3 -5
- package/dist/primitives/input.d.mts +4 -4
- package/dist/primitives/input.mjs +2 -3
- package/dist/primitives/progress-circle.d.mts +3 -3
- package/dist/primitives/progress-circle.mjs +2 -3
- package/dist/variants/alert.d.mts +1 -1
- package/dist/variants/alert.mjs +3 -13
- package/dist/variants/badge.d.mts +6 -4
- package/dist/variants/badge.mjs +7 -34
- package/dist/variants/button-group.d.mts +2 -2
- package/dist/variants/button-group.mjs +3 -14
- package/dist/variants/button.d.mts +12 -10
- package/dist/variants/button.mjs +15 -57
- package/dist/variants/empty.d.mts +1 -1
- package/dist/variants/empty.mjs +2 -7
- package/dist/variants/field.d.mts +3 -3
- package/dist/variants/field.mjs +4 -22
- package/dist/variants/input-group.d.mts +9 -9
- package/dist/variants/input-group.mjs +11 -70
- package/dist/variants/input-number.d.mts +45 -0
- package/dist/variants/input-number.mjs +40 -0
- package/dist/variants/item.d.mts +5 -4
- package/dist/variants/item.mjs +9 -31
- package/dist/variants/navigation-menu.d.mts +1 -1
- package/dist/variants/navigation-menu.mjs +1 -5
- package/dist/variants/progress-circle.d.mts +1 -1
- package/dist/variants/progress-circle.mjs +1 -5
- package/dist/variants/scroll-area.d.mts +2 -2
- package/dist/variants/scroll-area.mjs +3 -8
- package/dist/variants/separator.mjs +6 -6
- package/dist/variants/sheet.d.mts +4 -4
- package/dist/variants/sheet.mjs +5 -38
- package/dist/variants/sidebar.d.mts +4 -4
- package/dist/variants/sidebar.mjs +6 -23
- package/dist/variants/tabs.d.mts +18 -0
- package/dist/variants/tabs.mjs +15 -0
- package/dist/variants/toggle.d.mts +4 -4
- package/dist/variants/toggle.mjs +9 -27
- package/package.json +27 -44
- package/src/components/accordion.tsx +26 -68
- package/src/components/alert-dialog.tsx +70 -86
- package/src/components/alert.tsx +27 -19
- package/src/components/aspect-ratio.tsx +1 -4
- package/src/components/avatar.tsx +99 -12
- package/src/components/badge.tsx +5 -8
- package/src/components/breadcrumb.tsx +18 -24
- package/src/components/button-group.tsx +10 -20
- package/src/components/button.tsx +8 -19
- package/src/components/calendar.tsx +77 -132
- package/src/components/card.tsx +16 -22
- package/src/components/carousel.tsx +40 -58
- package/src/components/chart.tsx +41 -92
- package/src/components/checkbox-cards.tsx +11 -30
- package/src/components/checkbox-group.tsx +6 -28
- package/src/components/checkbox.tsx +6 -26
- package/src/components/collapsible.tsx +1 -4
- package/src/components/command.tsx +52 -65
- package/src/components/context-menu.tsx +46 -125
- package/src/components/dialog.tsx +49 -101
- package/src/components/direction.tsx +32 -0
- package/src/components/drawer.tsx +17 -79
- package/src/components/dropdown-menu.tsx +39 -118
- package/src/components/empty.tsx +6 -20
- package/src/components/field.tsx +19 -52
- package/src/components/form.tsx +19 -61
- package/src/components/hover-card.tsx +4 -27
- package/src/components/input-group.tsx +13 -52
- package/src/components/input-number.tsx +55 -75
- package/src/components/input-otp.tsx +19 -38
- package/src/components/input-password.tsx +5 -29
- package/src/components/input-search.tsx +6 -23
- package/src/components/input.tsx +1 -17
- package/src/components/item.tsx +17 -31
- package/src/components/kbd.tsx +2 -14
- package/src/components/label.tsx +2 -10
- package/src/components/menubar.tsx +34 -125
- package/src/components/native-select.tsx +21 -30
- package/src/components/navigation-menu.tsx +34 -94
- package/src/components/pagination.tsx +28 -34
- package/src/components/popover.tsx +66 -35
- package/src/components/progress-circle.tsx +7 -25
- package/src/components/progress.tsx +3 -16
- package/src/components/radio-cards.tsx +8 -27
- package/src/components/radio-group.tsx +7 -27
- package/src/components/radio.tsx +3 -24
- package/src/components/resizable.tsx +5 -26
- package/src/components/scroll-area.tsx +12 -32
- package/src/components/select.tsx +37 -60
- package/src/components/separator.tsx +4 -18
- package/src/components/sheet.tsx +37 -74
- package/src/components/sidebar.tsx +47 -177
- package/src/components/skeleton.tsx +1 -3
- package/src/components/slider.tsx +7 -36
- package/src/components/sonner.tsx +16 -6
- package/src/components/spinner.tsx +6 -15
- package/src/components/switch.tsx +8 -30
- package/src/components/table.tsx +18 -35
- package/src/components/tabs.tsx +16 -34
- package/src/components/textarea.tsx +1 -15
- package/src/components/toggle-group.tsx +34 -38
- package/src/components/toggle.tsx +4 -13
- package/src/components/tooltip.tsx +11 -37
- package/src/css/foundation/base.css +74 -0
- package/src/css/foundation/motion.css +69 -0
- package/src/css/foundation/source.css +10 -0
- package/src/css/foundation/tokens.css +107 -0
- package/src/css/foundation/variants.css +121 -0
- package/src/css/preset.css +13 -214
- package/src/css/style.css +9 -1
- package/src/css/{amber.css → themes/amber.css} +29 -0
- package/src/css/{blue.css → themes/blue.css} +29 -0
- package/src/css/{cyan.css → themes/cyan.css} +29 -0
- package/src/css/{emerald.css → themes/emerald.css} +29 -0
- package/src/css/{fuchsia.css → themes/fuchsia.css} +29 -0
- package/src/css/{gray.css → themes/gray.css} +29 -0
- package/src/css/{green.css → themes/green.css} +29 -0
- package/src/css/{indigo.css → themes/indigo.css} +29 -0
- package/src/css/{lime.css → themes/lime.css} +29 -0
- package/src/css/{neutral.css → themes/neutral.css} +29 -0
- package/src/css/{orange.css → themes/orange.css} +29 -0
- package/src/css/{pink.css → themes/pink.css} +29 -0
- package/src/css/{purple.css → themes/purple.css} +29 -0
- package/src/css/{red.css → themes/red.css} +29 -0
- package/src/css/{rose.css → themes/rose.css} +29 -0
- package/src/css/{sky.css → themes/sky.css} +29 -0
- package/src/css/{slate.css → themes/slate.css} +29 -0
- package/src/css/{stone.css → themes/stone.css} +29 -0
- package/src/css/{teal.css → themes/teal.css} +29 -0
- package/src/css/{violet.css → themes/violet.css} +29 -0
- package/src/css/{yellow.css → themes/yellow.css} +29 -0
- package/src/css/{zinc.css → themes/zinc.css} +29 -0
- package/src/hooks/use-animated-value.ts +1 -7
- package/src/hooks/use-copy-to-clipboard.ts +1 -6
- package/src/hooks/use-is-mobile.ts +0 -2
- package/src/hooks/use-media-query.ts +0 -2
- package/src/hooks/use-mutation-observer.ts +0 -3
- package/src/hooks/use-pagination.ts +0 -2
- package/src/index.ts +39 -80
- package/src/primitives/checkbox-group.tsx +25 -39
- package/src/primitives/input-number.tsx +17 -63
- package/src/primitives/input.tsx +8 -24
- package/src/primitives/progress-circle.tsx +13 -43
- package/src/variants/alert.ts +3 -14
- package/src/variants/badge.ts +8 -35
- package/src/variants/button-group.ts +5 -18
- package/src/variants/button.ts +21 -58
- package/src/variants/empty.ts +2 -11
- package/src/variants/field.ts +6 -19
- package/src/variants/input-group.ts +12 -64
- package/src/variants/input-number.ts +65 -0
- package/src/variants/item.ts +10 -32
- package/src/variants/navigation-menu.ts +1 -8
- package/src/variants/progress-circle.ts +1 -2
- package/src/variants/scroll-area.ts +3 -9
- package/src/variants/separator.ts +6 -7
- package/src/variants/sheet.ts +6 -39
- package/src/variants/sidebar.ts +7 -27
- package/src/variants/tabs.ts +34 -0
- package/src/variants/toggle.ts +9 -28
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { VariantProps } from "#/lib/utils";
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
4
2
|
import type { ComponentProps, JSX } from "react";
|
|
5
3
|
|
|
4
|
+
import { Button } from "#/components/button";
|
|
5
|
+
import type { ButtonProps } from "#/components/button";
|
|
6
6
|
import { cn } from "#/lib/utils";
|
|
7
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
8
|
-
|
|
9
|
-
import { buttonVariants } from "#/variants/button";
|
|
10
7
|
|
|
11
8
|
/* -----------------------------------------------------------------------------
|
|
12
9
|
* Component: AlertDialog
|
|
@@ -48,60 +45,30 @@ function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): JSX.Element
|
|
|
48
45
|
* @since 0.3.16-canary.0
|
|
49
46
|
*/
|
|
50
47
|
interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
|
|
51
|
-
|
|
52
|
-
content?: string;
|
|
53
|
-
overlay?: string;
|
|
54
|
-
wrapper?: string;
|
|
55
|
-
};
|
|
48
|
+
size?: "default" | "sm";
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
/**
|
|
59
52
|
* @since 0.3.16-canary.0
|
|
60
53
|
*/
|
|
61
|
-
function AlertDialogContent({
|
|
62
|
-
children,
|
|
63
|
-
className,
|
|
64
|
-
classNames,
|
|
65
|
-
...props
|
|
66
|
-
}: AlertDialogContentProps): JSX.Element {
|
|
54
|
+
function AlertDialogContent({ className, size = "default", ...props }: AlertDialogContentProps): JSX.Element {
|
|
67
55
|
return (
|
|
68
|
-
<AlertDialogPrimitive.Portal>
|
|
56
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal">
|
|
69
57
|
<AlertDialogPrimitive.Overlay
|
|
70
|
-
className={
|
|
71
|
-
"fixed inset-0 z-50"
|
|
72
|
-
|
|
73
|
-
"ease-ui data-open:animate-in data-open:fade-in-0",
|
|
74
|
-
"data-closed:animate-out data-closed:fade-out-0",
|
|
75
|
-
"motion-reduce:animate-none motion-reduce:transition-none",
|
|
76
|
-
classNames?.overlay,
|
|
77
|
-
)}
|
|
58
|
+
className={
|
|
59
|
+
"fixed inset-0 z-50 bg-black/10 ease-gentle supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:animation-duration-overlay-in data-open:fade-in-0 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-overlay-out data-closed:fade-out-0"
|
|
60
|
+
}
|
|
78
61
|
data-slot="alert-dialog-overlay"
|
|
79
62
|
/>
|
|
80
63
|
<AlertDialogPrimitive.Content
|
|
81
64
|
className={cn(
|
|
82
|
-
"fixed
|
|
83
|
-
|
|
84
|
-
"ease-ui data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
85
|
-
"data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
86
|
-
"motion-reduce:animate-none motion-reduce:transition-none",
|
|
87
|
-
classNames?.wrapper,
|
|
65
|
+
"group/alert-dialog-content fixed start-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-y-auto rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 ease-ui outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg rtl:translate-x-1/2 data-open:animate-in data-open:animation-duration-overlay-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-overlay-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
66
|
+
className,
|
|
88
67
|
)}
|
|
89
|
-
data-
|
|
68
|
+
data-size={size}
|
|
69
|
+
data-slot="alert-dialog-content"
|
|
90
70
|
{...props}
|
|
91
|
-
|
|
92
|
-
<div
|
|
93
|
-
className={cn(
|
|
94
|
-
"relative row-start-2 flex w-full max-w-lg flex-col",
|
|
95
|
-
"rounded-2xl border",
|
|
96
|
-
"bg-popover text-popover-foreground shadow-lg",
|
|
97
|
-
classNames?.content,
|
|
98
|
-
className,
|
|
99
|
-
)}
|
|
100
|
-
data-slot="alert-dialog-content"
|
|
101
|
-
>
|
|
102
|
-
{children}
|
|
103
|
-
</div>
|
|
104
|
-
</AlertDialogPrimitive.Content>
|
|
71
|
+
/>
|
|
105
72
|
</AlertDialogPrimitive.Portal>
|
|
106
73
|
);
|
|
107
74
|
}
|
|
@@ -122,8 +89,7 @@ function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): JSX
|
|
|
122
89
|
return (
|
|
123
90
|
<div
|
|
124
91
|
className={cn(
|
|
125
|
-
"
|
|
126
|
-
"sm:text-left",
|
|
92
|
+
"grid shrink-0 grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
127
93
|
className,
|
|
128
94
|
)}
|
|
129
95
|
data-slot="alert-dialog-header"
|
|
@@ -133,10 +99,39 @@ function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): JSX
|
|
|
133
99
|
}
|
|
134
100
|
|
|
135
101
|
/* -----------------------------------------------------------------------------
|
|
136
|
-
* Component:
|
|
102
|
+
* Component: AlertDialogMedia
|
|
103
|
+
* -------------------------------------------------------------------------- */
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @since 0.3.16-canary.0
|
|
107
|
+
*/
|
|
108
|
+
type AlertDialogMediaProps = ComponentProps<"div">;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @since 0.3.16-canary.0
|
|
112
|
+
*/
|
|
113
|
+
function AlertDialogMedia({ className, ...props }: AlertDialogMediaProps): JSX.Element {
|
|
114
|
+
return (
|
|
115
|
+
<div
|
|
116
|
+
className={cn(
|
|
117
|
+
"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
118
|
+
className,
|
|
119
|
+
)}
|
|
120
|
+
data-slot="alert-dialog-media"
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* -----------------------------------------------------------------------------
|
|
127
|
+
* Component: AlertDialogBody
|
|
137
128
|
* -------------------------------------------------------------------------- */
|
|
138
129
|
|
|
139
130
|
/**
|
|
131
|
+
* Optional scrollable region for long content. When used, the Header and Footer
|
|
132
|
+
* stay pinned (shrink-0) and only this body scrolls; without it, the whole
|
|
133
|
+
* Content scrolls via its own max-height. A codefast enhancement over radix-vega.
|
|
134
|
+
*
|
|
140
135
|
* @since 0.3.16-canary.0
|
|
141
136
|
*/
|
|
142
137
|
type AlertDialogBodyProps = ComponentProps<"div">;
|
|
@@ -146,8 +141,8 @@ type AlertDialogBodyProps = ComponentProps<"div">;
|
|
|
146
141
|
*/
|
|
147
142
|
function AlertDialogBody({ className, ...props }: AlertDialogBodyProps): JSX.Element {
|
|
148
143
|
return (
|
|
149
|
-
<
|
|
150
|
-
className={cn("overflow-auto
|
|
144
|
+
<div
|
|
145
|
+
className={cn("-mx-6 min-h-0 flex-1 overflow-y-auto px-6", className)}
|
|
151
146
|
data-slot="alert-dialog-body"
|
|
152
147
|
{...props}
|
|
153
148
|
/>
|
|
@@ -170,8 +165,7 @@ function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): JSX
|
|
|
170
165
|
return (
|
|
171
166
|
<div
|
|
172
167
|
className={cn(
|
|
173
|
-
"flex shrink-0 flex-col-reverse gap-2
|
|
174
|
-
"sm:flex-row sm:justify-end",
|
|
168
|
+
"flex shrink-0 flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
175
169
|
className,
|
|
176
170
|
)}
|
|
177
171
|
data-slot="alert-dialog-footer"
|
|
@@ -195,7 +189,10 @@ type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
|
195
189
|
function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): JSX.Element {
|
|
196
190
|
return (
|
|
197
191
|
<AlertDialogPrimitive.Title
|
|
198
|
-
className={cn(
|
|
192
|
+
className={cn(
|
|
193
|
+
"font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
194
|
+
className,
|
|
195
|
+
)}
|
|
199
196
|
data-slot="alert-dialog-title"
|
|
200
197
|
{...props}
|
|
201
198
|
/>
|
|
@@ -217,7 +214,10 @@ type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.De
|
|
|
217
214
|
function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): JSX.Element {
|
|
218
215
|
return (
|
|
219
216
|
<AlertDialogPrimitive.Description
|
|
220
|
-
className={cn(
|
|
217
|
+
className={cn(
|
|
218
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
219
|
+
className,
|
|
220
|
+
)}
|
|
221
221
|
data-slot="alert-dialog-description"
|
|
222
222
|
{...props}
|
|
223
223
|
/>
|
|
@@ -231,26 +231,17 @@ function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionP
|
|
|
231
231
|
/**
|
|
232
232
|
* @since 0.3.16-canary.0
|
|
233
233
|
*/
|
|
234
|
-
interface AlertDialogActionProps
|
|
235
|
-
|
|
236
|
-
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
237
|
-
}
|
|
234
|
+
interface AlertDialogActionProps
|
|
235
|
+
extends ComponentProps<typeof AlertDialogPrimitive.Action>, Pick<ButtonProps, "size" | "variant"> {}
|
|
238
236
|
|
|
239
237
|
/**
|
|
240
238
|
* @since 0.3.16-canary.0
|
|
241
239
|
*/
|
|
242
|
-
function AlertDialogAction({
|
|
243
|
-
className,
|
|
244
|
-
size,
|
|
245
|
-
variant,
|
|
246
|
-
...props
|
|
247
|
-
}: AlertDialogActionProps): JSX.Element {
|
|
240
|
+
function AlertDialogAction({ size = "default", variant = "default", ...props }: AlertDialogActionProps): JSX.Element {
|
|
248
241
|
return (
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{...props}
|
|
253
|
-
/>
|
|
242
|
+
<Button asChild size={size} variant={variant}>
|
|
243
|
+
<AlertDialogPrimitive.Action data-slot="alert-dialog-action" {...props} />
|
|
244
|
+
</Button>
|
|
254
245
|
);
|
|
255
246
|
}
|
|
256
247
|
|
|
@@ -261,26 +252,17 @@ function AlertDialogAction({
|
|
|
261
252
|
/**
|
|
262
253
|
* @since 0.3.16-canary.0
|
|
263
254
|
*/
|
|
264
|
-
interface AlertDialogCancelProps
|
|
265
|
-
|
|
266
|
-
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
267
|
-
}
|
|
255
|
+
interface AlertDialogCancelProps
|
|
256
|
+
extends ComponentProps<typeof AlertDialogPrimitive.Cancel>, Pick<ButtonProps, "size" | "variant"> {}
|
|
268
257
|
|
|
269
258
|
/**
|
|
270
259
|
* @since 0.3.16-canary.0
|
|
271
260
|
*/
|
|
272
|
-
function AlertDialogCancel({
|
|
273
|
-
className,
|
|
274
|
-
size,
|
|
275
|
-
variant,
|
|
276
|
-
...props
|
|
277
|
-
}: AlertDialogCancelProps): JSX.Element {
|
|
261
|
+
function AlertDialogCancel({ size = "default", variant = "outline", ...props }: AlertDialogCancelProps): JSX.Element {
|
|
278
262
|
return (
|
|
279
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
{...props}
|
|
283
|
-
/>
|
|
263
|
+
<Button asChild size={size} variant={variant}>
|
|
264
|
+
<AlertDialogPrimitive.Cancel data-slot="alert-dialog-cancel" {...props} />
|
|
265
|
+
</Button>
|
|
284
266
|
);
|
|
285
267
|
}
|
|
286
268
|
|
|
@@ -297,6 +279,7 @@ export {
|
|
|
297
279
|
AlertDialogDescription,
|
|
298
280
|
AlertDialogFooter,
|
|
299
281
|
AlertDialogHeader,
|
|
282
|
+
AlertDialogMedia,
|
|
300
283
|
AlertDialogTitle,
|
|
301
284
|
AlertDialogTrigger,
|
|
302
285
|
};
|
|
@@ -308,6 +291,7 @@ export type {
|
|
|
308
291
|
AlertDialogDescriptionProps,
|
|
309
292
|
AlertDialogFooterProps,
|
|
310
293
|
AlertDialogHeaderProps,
|
|
294
|
+
AlertDialogMediaProps,
|
|
311
295
|
AlertDialogProps,
|
|
312
296
|
AlertDialogTitleProps,
|
|
313
297
|
AlertDialogTriggerProps,
|
package/src/components/alert.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { AlertVariants } from "#/variants/alert";
|
|
2
1
|
import type { ComponentProps, JSX } from "react";
|
|
3
2
|
|
|
4
3
|
import { cn } from "#/lib/utils";
|
|
5
|
-
|
|
4
|
+
import type { AlertVariants } from "#/variants/alert";
|
|
6
5
|
import { alertVariants } from "#/variants/alert";
|
|
7
6
|
|
|
8
7
|
/* -----------------------------------------------------------------------------
|
|
@@ -18,14 +17,7 @@ interface AlertProps extends ComponentProps<"div">, AlertVariants {}
|
|
|
18
17
|
* @since 0.3.16-canary.0
|
|
19
18
|
*/
|
|
20
19
|
function Alert({ className, variant, ...props }: AlertProps): JSX.Element {
|
|
21
|
-
return (
|
|
22
|
-
<div
|
|
23
|
-
className={alertVariants({ className, variant })}
|
|
24
|
-
data-slot="alert"
|
|
25
|
-
role="alert"
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
20
|
+
return <div className={alertVariants({ className, variant })} data-slot="alert" role="alert" {...props} />;
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
/* -----------------------------------------------------------------------------
|
|
@@ -40,15 +32,16 @@ type AlertTitleProps = ComponentProps<"div">;
|
|
|
40
32
|
/**
|
|
41
33
|
* @since 0.3.16-canary.0
|
|
42
34
|
*/
|
|
43
|
-
function AlertTitle({
|
|
35
|
+
function AlertTitle({ className, ...props }: AlertTitleProps): JSX.Element {
|
|
44
36
|
return (
|
|
45
37
|
<div
|
|
46
|
-
className={cn(
|
|
38
|
+
className={cn(
|
|
39
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
47
42
|
data-slot="alert-title"
|
|
48
43
|
{...props}
|
|
49
|
-
|
|
50
|
-
{children}
|
|
51
|
-
</div>
|
|
44
|
+
/>
|
|
52
45
|
);
|
|
53
46
|
}
|
|
54
47
|
|
|
@@ -68,8 +61,7 @@ function AlertDescription({ className, ...props }: AlertDescriptionProps): JSX.E
|
|
|
68
61
|
return (
|
|
69
62
|
<div
|
|
70
63
|
className={cn(
|
|
71
|
-
"
|
|
72
|
-
"[&_p]:leading-relaxed",
|
|
64
|
+
"text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
73
65
|
className,
|
|
74
66
|
)}
|
|
75
67
|
data-slot="alert-description"
|
|
@@ -78,9 +70,25 @@ function AlertDescription({ className, ...props }: AlertDescriptionProps): JSX.E
|
|
|
78
70
|
);
|
|
79
71
|
}
|
|
80
72
|
|
|
73
|
+
/* -----------------------------------------------------------------------------
|
|
74
|
+
* Component: AlertAction
|
|
75
|
+
* -------------------------------------------------------------------------- */
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @since 0.3.16-canary.0
|
|
79
|
+
*/
|
|
80
|
+
type AlertActionProps = ComponentProps<"div">;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @since 0.3.16-canary.0
|
|
84
|
+
*/
|
|
85
|
+
function AlertAction({ className, ...props }: AlertActionProps): JSX.Element {
|
|
86
|
+
return <div className={cn("absolute end-3 top-2.5", className)} data-slot="alert-action" {...props} />;
|
|
87
|
+
}
|
|
88
|
+
|
|
81
89
|
/* -----------------------------------------------------------------------------
|
|
82
90
|
* Exports
|
|
83
91
|
* -------------------------------------------------------------------------- */
|
|
84
92
|
|
|
85
|
-
export { Alert, AlertDescription, AlertTitle };
|
|
86
|
-
export type { AlertDescriptionProps, AlertProps, AlertTitleProps };
|
|
93
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
94
|
+
export type { AlertActionProps, AlertDescriptionProps, AlertProps, AlertTitleProps };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { AspectRatio as AspectRatioPrimitive } from "radix-ui";
|
|
3
2
|
import type { ComponentProps, JSX } from "react";
|
|
4
3
|
|
|
5
|
-
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
6
|
-
|
|
7
4
|
/* -----------------------------------------------------------------------------
|
|
8
5
|
* Component: AspectRatio
|
|
9
6
|
* -------------------------------------------------------------------------- */
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
3
2
|
import type { ComponentProps, JSX } from "react";
|
|
4
3
|
|
|
5
4
|
import { cn } from "#/lib/utils";
|
|
6
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
7
5
|
|
|
8
6
|
/* -----------------------------------------------------------------------------
|
|
9
7
|
* Component: Avatar
|
|
@@ -12,15 +10,21 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
|
12
10
|
/**
|
|
13
11
|
* @since 0.3.16-canary.0
|
|
14
12
|
*/
|
|
15
|
-
type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root
|
|
13
|
+
type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
14
|
+
size?: "default" | "sm" | "lg";
|
|
15
|
+
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @since 0.3.16-canary.0
|
|
19
19
|
*/
|
|
20
|
-
function Avatar({ className, ...props }: AvatarProps): JSX.Element {
|
|
20
|
+
function Avatar({ className, size = "default", ...props }: AvatarProps): JSX.Element {
|
|
21
21
|
return (
|
|
22
22
|
<AvatarPrimitive.Root
|
|
23
|
-
className={cn(
|
|
23
|
+
className={cn(
|
|
24
|
+
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
data-size={size}
|
|
24
28
|
data-slot="avatar"
|
|
25
29
|
{...props}
|
|
26
30
|
/>
|
|
@@ -42,7 +46,7 @@ type AvatarImageProps = ComponentProps<typeof AvatarPrimitive.Image>;
|
|
|
42
46
|
function AvatarImage({ className, ...props }: AvatarImageProps): JSX.Element {
|
|
43
47
|
return (
|
|
44
48
|
<AvatarPrimitive.Image
|
|
45
|
-
className={cn("aspect-square size-full", className)}
|
|
49
|
+
className={cn("aspect-square size-full rounded-full object-cover", className)}
|
|
46
50
|
data-slot="avatar-image"
|
|
47
51
|
{...props}
|
|
48
52
|
/>
|
|
@@ -65,9 +69,7 @@ function AvatarFallback({ className, ...props }: AvatarFallbackProps): JSX.Eleme
|
|
|
65
69
|
return (
|
|
66
70
|
<AvatarPrimitive.Fallback
|
|
67
71
|
className={cn(
|
|
68
|
-
"flex size-full items-center justify-center",
|
|
69
|
-
"rounded-full",
|
|
70
|
-
"bg-muted",
|
|
72
|
+
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
71
73
|
className,
|
|
72
74
|
)}
|
|
73
75
|
data-slot="avatar-fallback"
|
|
@@ -76,9 +78,94 @@ function AvatarFallback({ className, ...props }: AvatarFallbackProps): JSX.Eleme
|
|
|
76
78
|
);
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
/* -----------------------------------------------------------------------------
|
|
82
|
+
* Component: AvatarBadge
|
|
83
|
+
* -------------------------------------------------------------------------- */
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @since 0.3.16-canary.0
|
|
87
|
+
*/
|
|
88
|
+
type AvatarBadgeProps = ComponentProps<"span">;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @since 0.3.16-canary.0
|
|
92
|
+
*/
|
|
93
|
+
function AvatarBadge({ className, ...props }: AvatarBadgeProps): JSX.Element {
|
|
94
|
+
return (
|
|
95
|
+
<span
|
|
96
|
+
className={cn(
|
|
97
|
+
"absolute end-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
98
|
+
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
99
|
+
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
100
|
+
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
101
|
+
className,
|
|
102
|
+
)}
|
|
103
|
+
data-slot="avatar-badge"
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* -----------------------------------------------------------------------------
|
|
110
|
+
* Component: AvatarGroup
|
|
111
|
+
* -------------------------------------------------------------------------- */
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @since 0.3.16-canary.0
|
|
115
|
+
*/
|
|
116
|
+
type AvatarGroupProps = ComponentProps<"div">;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @since 0.3.16-canary.0
|
|
120
|
+
*/
|
|
121
|
+
function AvatarGroup({ className, ...props }: AvatarGroupProps): JSX.Element {
|
|
122
|
+
return (
|
|
123
|
+
<div
|
|
124
|
+
className={cn(
|
|
125
|
+
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
126
|
+
className,
|
|
127
|
+
)}
|
|
128
|
+
data-slot="avatar-group"
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* -----------------------------------------------------------------------------
|
|
135
|
+
* Component: AvatarGroupCount
|
|
136
|
+
* -------------------------------------------------------------------------- */
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @since 0.3.16-canary.0
|
|
140
|
+
*/
|
|
141
|
+
type AvatarGroupCountProps = ComponentProps<"div">;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @since 0.3.16-canary.0
|
|
145
|
+
*/
|
|
146
|
+
function AvatarGroupCount({ className, ...props }: AvatarGroupCountProps): JSX.Element {
|
|
147
|
+
return (
|
|
148
|
+
<div
|
|
149
|
+
className={cn(
|
|
150
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
151
|
+
className,
|
|
152
|
+
)}
|
|
153
|
+
data-slot="avatar-group-count"
|
|
154
|
+
{...props}
|
|
155
|
+
/>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
79
159
|
/* -----------------------------------------------------------------------------
|
|
80
160
|
* Exports
|
|
81
161
|
* -------------------------------------------------------------------------- */
|
|
82
162
|
|
|
83
|
-
export { Avatar, AvatarFallback, AvatarImage };
|
|
84
|
-
export type {
|
|
163
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
|
|
164
|
+
export type {
|
|
165
|
+
AvatarBadgeProps,
|
|
166
|
+
AvatarFallbackProps,
|
|
167
|
+
AvatarGroupCountProps,
|
|
168
|
+
AvatarGroupProps,
|
|
169
|
+
AvatarImageProps,
|
|
170
|
+
AvatarProps,
|
|
171
|
+
};
|
package/src/components/badge.tsx
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { BadgeVariants } from "#/variants/badge";
|
|
1
|
+
import { Slot } from "radix-ui";
|
|
4
2
|
import type { ComponentProps, JSX } from "react";
|
|
5
3
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import type { BadgeVariants } from "#/variants/badge";
|
|
8
5
|
import { badgeVariants } from "#/variants/badge";
|
|
9
6
|
|
|
10
7
|
/* -----------------------------------------------------------------------------
|
|
@@ -21,11 +18,11 @@ interface BadgeProps extends ComponentProps<"span">, BadgeVariants {
|
|
|
21
18
|
/**
|
|
22
19
|
* @since 0.3.16-canary.0
|
|
23
20
|
*/
|
|
24
|
-
function Badge({ asChild, className, variant, ...props }: BadgeProps): JSX.Element {
|
|
25
|
-
const Component = asChild ? Slot : "span";
|
|
21
|
+
function Badge({ asChild = false, className, variant = "default", ...props }: BadgeProps): JSX.Element {
|
|
22
|
+
const Component = asChild ? Slot.Root : "span";
|
|
26
23
|
|
|
27
24
|
return (
|
|
28
|
-
<Component className={badgeVariants({ className, variant })} data-slot="badge" {...props} />
|
|
25
|
+
<Component className={badgeVariants({ className, variant })} data-slot="badge" data-variant={variant} {...props} />
|
|
29
26
|
);
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
3
|
import type { ComponentProps, JSX, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
import { cn } from "#/lib/utils";
|
|
6
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
-
import { ChevronRightIcon, EllipsisIcon } from "lucide-react";
|
|
8
6
|
|
|
9
7
|
/* -----------------------------------------------------------------------------
|
|
10
8
|
* Component: Breadcrumb
|
|
@@ -40,8 +38,7 @@ function BreadcrumbList({ className, ...props }: BreadcrumbListProps): JSX.Eleme
|
|
|
40
38
|
return (
|
|
41
39
|
<ol
|
|
42
40
|
className={cn(
|
|
43
|
-
"flex flex-wrap items-center gap-1.5 text-sm break-
|
|
44
|
-
"sm:gap-2",
|
|
41
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
|
|
45
42
|
className,
|
|
46
43
|
)}
|
|
47
44
|
data-slot="breadcrumb-list"
|
|
@@ -63,13 +60,7 @@ type BreadcrumbItemProps = ComponentProps<"li">;
|
|
|
63
60
|
* @since 0.3.16-canary.0
|
|
64
61
|
*/
|
|
65
62
|
function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps): JSX.Element {
|
|
66
|
-
return (
|
|
67
|
-
<li
|
|
68
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
69
|
-
data-slot="breadcrumb-item"
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
63
|
+
return <li className={cn("inline-flex items-center gap-1.5", className)} data-slot="breadcrumb-item" {...props} />;
|
|
73
64
|
}
|
|
74
65
|
|
|
75
66
|
/* -----------------------------------------------------------------------------
|
|
@@ -87,15 +78,11 @@ interface BreadcrumbLinkProps extends ComponentProps<"a"> {
|
|
|
87
78
|
* @since 0.3.16-canary.0
|
|
88
79
|
*/
|
|
89
80
|
function BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps): JSX.Element {
|
|
90
|
-
const Component = asChild ? Slot : "a";
|
|
81
|
+
const Component = asChild ? Slot.Root : "a";
|
|
91
82
|
|
|
92
83
|
return (
|
|
93
84
|
<Component
|
|
94
|
-
className={cn(
|
|
95
|
-
"transition-colors motion-reduce:transition-none",
|
|
96
|
-
"hover:text-foreground",
|
|
97
|
-
className,
|
|
98
|
-
)}
|
|
85
|
+
className={cn("transition-colors hover:text-foreground", className)}
|
|
99
86
|
data-slot="breadcrumb-link"
|
|
100
87
|
{...props}
|
|
101
88
|
/>
|
|
@@ -121,6 +108,7 @@ function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps): JSX.Eleme
|
|
|
121
108
|
aria-disabled="true"
|
|
122
109
|
className={cn("font-normal text-foreground", className)}
|
|
123
110
|
data-slot="breadcrumb-page"
|
|
111
|
+
role="link"
|
|
124
112
|
{...props}
|
|
125
113
|
/>
|
|
126
114
|
);
|
|
@@ -138,10 +126,16 @@ type BreadcrumbSeparatorProps = ComponentProps<"li">;
|
|
|
138
126
|
/**
|
|
139
127
|
* @since 0.3.16-canary.0
|
|
140
128
|
*/
|
|
141
|
-
function BreadcrumbSeparator({ children, ...props }: BreadcrumbSeparatorProps): JSX.Element {
|
|
129
|
+
function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): JSX.Element {
|
|
142
130
|
return (
|
|
143
|
-
<li
|
|
144
|
-
|
|
131
|
+
<li
|
|
132
|
+
aria-hidden="true"
|
|
133
|
+
className={cn("[&>svg]:size-3.5", className)}
|
|
134
|
+
data-slot="breadcrumb-separator"
|
|
135
|
+
role="presentation"
|
|
136
|
+
{...props}
|
|
137
|
+
>
|
|
138
|
+
{children ?? <ChevronRightIcon className="rtl:rotate-180" />}
|
|
145
139
|
</li>
|
|
146
140
|
);
|
|
147
141
|
}
|
|
@@ -162,12 +156,12 @@ function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): J
|
|
|
162
156
|
return (
|
|
163
157
|
<span
|
|
164
158
|
aria-hidden="true"
|
|
165
|
-
className={cn("flex size-
|
|
159
|
+
className={cn("flex size-5 items-center justify-center [&>svg]:size-4", className)}
|
|
166
160
|
data-slot="breadcrumb-ellipsis"
|
|
167
161
|
role="presentation"
|
|
168
162
|
{...props}
|
|
169
163
|
>
|
|
170
|
-
<
|
|
164
|
+
<MoreHorizontalIcon />
|
|
171
165
|
<span className="sr-only">More</span>
|
|
172
166
|
</span>
|
|
173
167
|
);
|