@codefast/ui 0.3.16-canary.3 → 0.4.0-canary.4
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 +60 -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 +24 -11
- package/dist/components/chart.d.mts +8 -3
- package/dist/components/chart.mjs +21 -15
- package/dist/components/checkbox-cards.mjs +4 -4
- package/dist/components/checkbox-group.mjs +3 -4
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/checkbox.mjs +6 -7
- 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 +38 -56
- package/src/components/chart.tsx +41 -92
- package/src/components/checkbox-cards.tsx +10 -30
- package/src/components/checkbox-group.tsx +5 -28
- package/src/components/checkbox.tsx +5 -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 +36 -59
- 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 +50 -0
- package/src/css/foundation/motion.css +36 -0
- package/src/css/foundation/source.css +3 -0
- package/src/css/foundation/tokens.css +71 -0
- package/src/css/foundation/variants.css +113 -0
- package/src/css/preset.css +5 -214
- package/src/css/style.css +1 -1
- 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
- /package/src/css/{amber.css → themes/amber.css} +0 -0
- /package/src/css/{blue.css → themes/blue.css} +0 -0
- /package/src/css/{cyan.css → themes/cyan.css} +0 -0
- /package/src/css/{emerald.css → themes/emerald.css} +0 -0
- /package/src/css/{fuchsia.css → themes/fuchsia.css} +0 -0
- /package/src/css/{gray.css → themes/gray.css} +0 -0
- /package/src/css/{green.css → themes/green.css} +0 -0
- /package/src/css/{indigo.css → themes/indigo.css} +0 -0
- /package/src/css/{lime.css → themes/lime.css} +0 -0
- /package/src/css/{neutral.css → themes/neutral.css} +0 -0
- /package/src/css/{orange.css → themes/orange.css} +0 -0
- /package/src/css/{pink.css → themes/pink.css} +0 -0
- /package/src/css/{purple.css → themes/purple.css} +0 -0
- /package/src/css/{red.css → themes/red.css} +0 -0
- /package/src/css/{rose.css → themes/rose.css} +0 -0
- /package/src/css/{sky.css → themes/sky.css} +0 -0
- /package/src/css/{slate.css → themes/slate.css} +0 -0
- /package/src/css/{stone.css → themes/stone.css} +0 -0
- /package/src/css/{teal.css → themes/teal.css} +0 -0
- /package/src/css/{violet.css → themes/violet.css} +0 -0
- /package/src/css/{yellow.css → themes/yellow.css} +0 -0
- /package/src/css/{zinc.css → themes/zinc.css} +0 -0
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "#/lib/utils";
|
|
4
|
-
import type { ComponentProps, JSX } from "react";
|
|
5
|
-
|
|
6
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
7
1
|
import { SearchIcon, XIcon } from "lucide-react";
|
|
2
|
+
import { useControllableState } from "radix-ui/internal";
|
|
3
|
+
import type { ComponentProps, JSX } from "react";
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
InputGroup,
|
|
11
|
-
InputGroupAddon,
|
|
12
|
-
InputGroupButton,
|
|
13
|
-
InputGroupInput,
|
|
14
|
-
} from "#/components/input-group";
|
|
5
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "#/components/input-group";
|
|
15
6
|
|
|
16
7
|
/* -----------------------------------------------------------------------------
|
|
17
8
|
* Component: InputSearch
|
|
@@ -48,16 +39,11 @@ function InputSearch({
|
|
|
48
39
|
});
|
|
49
40
|
|
|
50
41
|
return (
|
|
51
|
-
<InputGroup
|
|
52
|
-
className={className}
|
|
53
|
-
data-disabled={disabled ? "true" : undefined}
|
|
54
|
-
data-slot="input-search"
|
|
55
|
-
>
|
|
42
|
+
<InputGroup className={className} data-disabled={disabled ? "true" : undefined} data-slot="input-search">
|
|
56
43
|
<InputGroupAddon align="inline-start">
|
|
57
44
|
<SearchIcon />
|
|
58
45
|
</InputGroupAddon>
|
|
59
46
|
<InputGroupInput
|
|
60
|
-
data-slot="input-search-item"
|
|
61
47
|
disabled={disabled}
|
|
62
48
|
readOnly={readOnly}
|
|
63
49
|
type="search"
|
|
@@ -70,14 +56,11 @@ function InputSearch({
|
|
|
70
56
|
{value ? (
|
|
71
57
|
<InputGroupButton
|
|
72
58
|
aria-label="Clear search"
|
|
73
|
-
className=
|
|
74
|
-
"rounded-full",
|
|
75
|
-
"focus-visible:ring-0",
|
|
76
|
-
"focus-visible:not-disabled:bg-input",
|
|
77
|
-
)}
|
|
59
|
+
className="rounded-full"
|
|
78
60
|
data-slot="input-search-clear"
|
|
79
61
|
disabled={disabled ?? readOnly}
|
|
80
62
|
size="icon-sm"
|
|
63
|
+
type="button"
|
|
81
64
|
variant="ghost"
|
|
82
65
|
onClick={() => {
|
|
83
66
|
setValue("");
|
package/src/components/input.tsx
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import type { ComponentProps, JSX } from "react";
|
|
4
2
|
|
|
5
3
|
import { cn } from "#/lib/utils";
|
|
@@ -20,21 +18,7 @@ function Input({ className, type, ...props }: InputProps): JSX.Element {
|
|
|
20
18
|
return (
|
|
21
19
|
<input
|
|
22
20
|
className={cn(
|
|
23
|
-
"h-9 w-full min-w-0 px-
|
|
24
|
-
"rounded-lg border border-input",
|
|
25
|
-
"bg-transparent shadow-xs outline-none",
|
|
26
|
-
"text-base",
|
|
27
|
-
"transition-[color,box-shadow] duration-150 ease-snappy",
|
|
28
|
-
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
29
|
-
"selection:bg-primary selection:text-primary-foreground",
|
|
30
|
-
"file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
31
|
-
"placeholder:text-muted-foreground",
|
|
32
|
-
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
33
|
-
"md:text-sm",
|
|
34
|
-
"dark:bg-input/30",
|
|
35
|
-
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
36
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
37
|
-
"dark:aria-invalid:ring-destructive/40",
|
|
21
|
+
"h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
38
22
|
className,
|
|
39
23
|
)}
|
|
40
24
|
data-slot="input"
|
package/src/components/item.tsx
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Slot } from "radix-ui";
|
|
2
2
|
import type { ComponentProps, JSX } from "react";
|
|
3
3
|
|
|
4
|
+
import { Separator } from "#/components/separator";
|
|
4
5
|
import { cn } from "#/lib/utils";
|
|
5
|
-
|
|
6
|
+
import type { ItemMediaVariants, ItemVariants } from "#/variants/item";
|
|
6
7
|
import { itemMediaVariants, itemVariants } from "#/variants/item";
|
|
7
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
-
|
|
9
|
-
import { Separator } from "#/components/separator";
|
|
10
8
|
|
|
11
9
|
/* -----------------------------------------------------------------------------
|
|
12
10
|
* Component: ItemGroup
|
|
@@ -23,7 +21,10 @@ type ItemGroupProps = ComponentProps<"div">;
|
|
|
23
21
|
function ItemGroup({ className, ...props }: ItemGroupProps): JSX.Element {
|
|
24
22
|
return (
|
|
25
23
|
<div
|
|
26
|
-
className={cn(
|
|
24
|
+
className={cn(
|
|
25
|
+
"group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
27
28
|
data-slot="item-group"
|
|
28
29
|
role="list"
|
|
29
30
|
{...props}
|
|
@@ -44,14 +45,7 @@ type ItemSeparatorProps = ComponentProps<typeof Separator>;
|
|
|
44
45
|
* @since 0.3.16-canary.0
|
|
45
46
|
*/
|
|
46
47
|
function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX.Element {
|
|
47
|
-
return (
|
|
48
|
-
<Separator
|
|
49
|
-
className={cn("my-0", className)}
|
|
50
|
-
data-slot="item-separator"
|
|
51
|
-
orientation="horizontal"
|
|
52
|
-
{...props}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
48
|
+
return <Separator className={cn("my-2", className)} data-slot="item-separator" orientation="horizontal" {...props} />;
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
/* -----------------------------------------------------------------------------
|
|
@@ -69,14 +63,8 @@ type ItemProps = ComponentProps<"div"> &
|
|
|
69
63
|
/**
|
|
70
64
|
* @since 0.3.16-canary.0
|
|
71
65
|
*/
|
|
72
|
-
function Item({
|
|
73
|
-
|
|
74
|
-
className,
|
|
75
|
-
size = "default",
|
|
76
|
-
variant = "default",
|
|
77
|
-
...props
|
|
78
|
-
}: ItemProps): JSX.Element {
|
|
79
|
-
const Component = asChild ? Slot : "div";
|
|
66
|
+
function Item({ asChild = false, className, size = "default", variant = "default", ...props }: ItemProps): JSX.Element {
|
|
67
|
+
const Component = asChild ? Slot.Root : "div";
|
|
80
68
|
|
|
81
69
|
return (
|
|
82
70
|
<Component
|
|
@@ -128,8 +116,7 @@ function ItemContent({ className, ...props }: ItemContentProps): JSX.Element {
|
|
|
128
116
|
return (
|
|
129
117
|
<div
|
|
130
118
|
className={cn(
|
|
131
|
-
"flex flex-1 flex-col gap-1",
|
|
132
|
-
"[&+[data-slot=item-content]]:flex-none",
|
|
119
|
+
"flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
|
|
133
120
|
className,
|
|
134
121
|
)}
|
|
135
122
|
data-slot="item-content"
|
|
@@ -153,7 +140,10 @@ type ItemTitleProps = ComponentProps<"div">;
|
|
|
153
140
|
function ItemTitle({ className, ...props }: ItemTitleProps): JSX.Element {
|
|
154
141
|
return (
|
|
155
142
|
<div
|
|
156
|
-
className={cn(
|
|
143
|
+
className={cn(
|
|
144
|
+
"line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",
|
|
145
|
+
className,
|
|
146
|
+
)}
|
|
157
147
|
data-slot="item-title"
|
|
158
148
|
{...props}
|
|
159
149
|
/>
|
|
@@ -176,9 +166,7 @@ function ItemDescription({ className, ...props }: ItemDescriptionProps): JSX.Ele
|
|
|
176
166
|
return (
|
|
177
167
|
<p
|
|
178
168
|
className={cn(
|
|
179
|
-
"line-clamp-2 text-sm leading-normal font-normal text-
|
|
180
|
-
"[&>a]:underline [&>a]:underline-offset-4",
|
|
181
|
-
"[&>a:hover]:text-primary",
|
|
169
|
+
"line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
182
170
|
className,
|
|
183
171
|
)}
|
|
184
172
|
data-slot="item-description"
|
|
@@ -200,9 +188,7 @@ type ItemActionsProps = ComponentProps<"div">;
|
|
|
200
188
|
* @since 0.3.16-canary.0
|
|
201
189
|
*/
|
|
202
190
|
function ItemActions({ className, ...props }: ItemActionsProps): JSX.Element {
|
|
203
|
-
return (
|
|
204
|
-
<div className={cn("flex items-center gap-2", className)} data-slot="item-actions" {...props} />
|
|
205
|
-
);
|
|
191
|
+
return <div className={cn("flex items-center gap-2", className)} data-slot="item-actions" {...props} />;
|
|
206
192
|
}
|
|
207
193
|
|
|
208
194
|
/* -----------------------------------------------------------------------------
|
package/src/components/kbd.tsx
CHANGED
|
@@ -18,13 +18,7 @@ function Kbd({ className, ...props }: KbdProps): JSX.Element {
|
|
|
18
18
|
return (
|
|
19
19
|
<kbd
|
|
20
20
|
className={cn(
|
|
21
|
-
"inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 px-1",
|
|
22
|
-
"rounded-md",
|
|
23
|
-
"bg-muted font-sans text-xs font-medium text-muted-foreground",
|
|
24
|
-
"pointer-events-none select-none",
|
|
25
|
-
"in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background",
|
|
26
|
-
"dark:in-data-[slot=tooltip-content]:bg-background/10",
|
|
27
|
-
"[&_svg:not([class*='size-'])]:size-3",
|
|
21
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
28
22
|
className,
|
|
29
23
|
)}
|
|
30
24
|
data-slot="kbd"
|
|
@@ -42,13 +36,7 @@ type KbdGroupProps = ComponentProps<"kbd">;
|
|
|
42
36
|
* @since 0.3.16-canary.0
|
|
43
37
|
*/
|
|
44
38
|
function KbdGroup({ className, ...props }: KbdGroupProps): JSX.Element {
|
|
45
|
-
return (
|
|
46
|
-
<kbd
|
|
47
|
-
className={cn("inline-flex items-center gap-1", className)}
|
|
48
|
-
data-slot="kbd-group"
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
39
|
+
return <kbd className={cn("inline-flex items-center gap-1", className)} data-slot="kbd-group" {...props} />;
|
|
52
40
|
}
|
|
53
41
|
|
|
54
42
|
/* -----------------------------------------------------------------------------
|
package/src/components/label.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
3
2
|
import type { ComponentProps, JSX } from "react";
|
|
4
3
|
|
|
5
4
|
import { cn } from "#/lib/utils";
|
|
6
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7
5
|
|
|
8
6
|
/* -----------------------------------------------------------------------------
|
|
9
7
|
* Component: Label
|
|
@@ -21,13 +19,7 @@ function Label({ className, ...props }: LabelProps): JSX.Element {
|
|
|
21
19
|
return (
|
|
22
20
|
<LabelPrimitive.Root
|
|
23
21
|
className={cn(
|
|
24
|
-
"
|
|
25
|
-
"text-sm leading-none font-medium",
|
|
26
|
-
"group-data-disabled:opacity-50",
|
|
27
|
-
"peer-disabled:opacity-50",
|
|
28
|
-
"peer-aria-invalid:text-destructive",
|
|
29
|
-
"peer-data-disabled:opacity-50",
|
|
30
|
-
"data-invalid:text-destructive",
|
|
22
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-disabled:pointer-events-none group-data-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-aria-invalid:text-destructive peer-data-disabled:opacity-50 data-invalid:text-destructive",
|
|
31
23
|
className,
|
|
32
24
|
)}
|
|
33
25
|
data-slot="label"
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
2
|
+
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
3
3
|
import type { ComponentProps, JSX } from "react";
|
|
4
4
|
|
|
5
5
|
import { cn } from "#/lib/utils";
|
|
6
|
-
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
7
|
-
import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
|
|
8
6
|
|
|
9
7
|
/* -----------------------------------------------------------------------------
|
|
10
8
|
* Component: Menubar
|
|
@@ -21,13 +19,7 @@ type MenubarProps = ComponentProps<typeof MenubarPrimitive.Root>;
|
|
|
21
19
|
function Menubar({ className, ...props }: MenubarProps): JSX.Element {
|
|
22
20
|
return (
|
|
23
21
|
<MenubarPrimitive.Root
|
|
24
|
-
className={cn(
|
|
25
|
-
"flex items-center space-x-1",
|
|
26
|
-
"p-1",
|
|
27
|
-
"rounded-lg border",
|
|
28
|
-
"bg-background",
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
22
|
+
className={cn("flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className)}
|
|
31
23
|
data-slot="menubar"
|
|
32
24
|
{...props}
|
|
33
25
|
/>
|
|
@@ -114,13 +106,7 @@ function MenubarTrigger({ className, ...props }: MenubarTriggerProps): JSX.Eleme
|
|
|
114
106
|
return (
|
|
115
107
|
<MenubarPrimitive.Trigger
|
|
116
108
|
className={cn(
|
|
117
|
-
"flex items-center
|
|
118
|
-
"px-2 py-1.5",
|
|
119
|
-
"rounded-sm outline-hidden",
|
|
120
|
-
"text-sm font-medium",
|
|
121
|
-
"select-none",
|
|
122
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
123
|
-
"data-open:bg-accent data-open:text-accent-foreground",
|
|
109
|
+
"flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted",
|
|
124
110
|
className,
|
|
125
111
|
)}
|
|
126
112
|
data-slot="menubar-trigger"
|
|
@@ -143,23 +129,11 @@ interface MenubarSubTriggerProps extends ComponentProps<typeof MenubarPrimitive.
|
|
|
143
129
|
/**
|
|
144
130
|
* @since 0.3.16-canary.0
|
|
145
131
|
*/
|
|
146
|
-
function MenubarSubTrigger({
|
|
147
|
-
children,
|
|
148
|
-
className,
|
|
149
|
-
inset,
|
|
150
|
-
...props
|
|
151
|
-
}: MenubarSubTriggerProps): JSX.Element {
|
|
132
|
+
function MenubarSubTrigger({ children, className, inset, ...props }: MenubarSubTriggerProps): JSX.Element {
|
|
152
133
|
return (
|
|
153
134
|
<MenubarPrimitive.SubTrigger
|
|
154
135
|
className={cn(
|
|
155
|
-
"flex items-center gap-
|
|
156
|
-
"px-2 py-1.5",
|
|
157
|
-
"rounded-sm outline-hidden",
|
|
158
|
-
"text-sm",
|
|
159
|
-
"cursor-default select-none",
|
|
160
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
161
|
-
"data-inset:pl-8",
|
|
162
|
-
"data-open:bg-accent data-open:text-accent-foreground",
|
|
136
|
+
"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
163
137
|
className,
|
|
164
138
|
)}
|
|
165
139
|
data-inset={inset}
|
|
@@ -167,7 +141,7 @@ function MenubarSubTrigger({
|
|
|
167
141
|
{...props}
|
|
168
142
|
>
|
|
169
143
|
{children}
|
|
170
|
-
<ChevronRightIcon className=
|
|
144
|
+
<ChevronRightIcon className="ml-auto size-4 rtl:rotate-180" />
|
|
171
145
|
</MenubarPrimitive.SubTrigger>
|
|
172
146
|
);
|
|
173
147
|
}
|
|
@@ -186,25 +160,10 @@ type MenubarSubContentProps = ComponentProps<typeof MenubarPrimitive.SubContent>
|
|
|
186
160
|
*/
|
|
187
161
|
function MenubarSubContent({ className, ...props }: MenubarSubContentProps): JSX.Element {
|
|
188
162
|
return (
|
|
189
|
-
<MenubarPrimitive.Portal>
|
|
163
|
+
<MenubarPrimitive.Portal data-slot="menubar-portal">
|
|
190
164
|
<MenubarPrimitive.SubContent
|
|
191
165
|
className={cn(
|
|
192
|
-
"z-50",
|
|
193
|
-
"min-w-32 overflow-hidden p-1",
|
|
194
|
-
"rounded-lg border",
|
|
195
|
-
"bg-popover text-popover-foreground shadow-lg",
|
|
196
|
-
"ease-snappy data-open:animate-in data-open:duration-200 data-open:fade-in-0 data-open:zoom-in-95",
|
|
197
|
-
"data-open:data-side-top:slide-in-from-bottom-2",
|
|
198
|
-
"data-open:data-side-right:slide-in-from-left-2",
|
|
199
|
-
"data-open:data-side-bottom:slide-in-from-top-2",
|
|
200
|
-
"data-open:data-side-left:slide-in-from-right-2",
|
|
201
|
-
"data-closed:animate-out data-closed:duration-150 data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
202
|
-
"data-closed:data-side-top:slide-out-to-bottom-2",
|
|
203
|
-
"data-closed:data-side-right:slide-out-to-left-2",
|
|
204
|
-
"data-closed:data-side-bottom:slide-out-to-top-2",
|
|
205
|
-
"data-closed:data-side-left:slide-out-to-right-2",
|
|
206
|
-
"motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0",
|
|
207
|
-
"origin-(--radix-menubar-content-transform-origin)",
|
|
166
|
+
"z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 ease-snappy data-open:animate-in data-open:animation-duration-menu-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-menu-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:data-side-top:slide-out-to-bottom-2 data-closed:data-side-right:slide-out-to-left-2 data-closed:data-side-bottom:slide-out-to-top-2 data-closed:data-side-left:slide-out-to-right-2",
|
|
208
167
|
className,
|
|
209
168
|
)}
|
|
210
169
|
data-slot="menubar-sub-content"
|
|
@@ -230,26 +189,16 @@ function MenubarContent({
|
|
|
230
189
|
align = "start",
|
|
231
190
|
alignOffset = -4,
|
|
232
191
|
className,
|
|
233
|
-
sideOffset =
|
|
192
|
+
sideOffset = 8,
|
|
234
193
|
...props
|
|
235
194
|
}: MenubarContentProps): JSX.Element {
|
|
236
195
|
return (
|
|
237
|
-
<MenubarPrimitive.Portal>
|
|
196
|
+
<MenubarPrimitive.Portal data-slot="menubar-portal">
|
|
238
197
|
<MenubarPrimitive.Content
|
|
239
198
|
align={align}
|
|
240
199
|
alignOffset={alignOffset}
|
|
241
200
|
className={cn(
|
|
242
|
-
"z-50",
|
|
243
|
-
"min-w-32 overflow-hidden p-1",
|
|
244
|
-
"rounded-lg border",
|
|
245
|
-
"bg-popover text-popover-foreground shadow-lg",
|
|
246
|
-
"ease-snappy data-open:animate-in data-open:duration-200 data-open:fade-in-0 data-open:zoom-in-95",
|
|
247
|
-
"data-open:data-side-top:slide-in-from-bottom-2",
|
|
248
|
-
"data-open:data-side-right:slide-in-from-left-2",
|
|
249
|
-
"data-open:data-side-bottom:slide-in-from-top-2",
|
|
250
|
-
"data-open:data-side-left:slide-in-from-right-2",
|
|
251
|
-
"motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0",
|
|
252
|
-
"origin-(--radix-menubar-content-transform-origin)",
|
|
201
|
+
"z-50 min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 ease-snappy data-open:animate-in data-open:animation-duration-menu-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:ease-exit",
|
|
253
202
|
className,
|
|
254
203
|
)}
|
|
255
204
|
data-slot="menubar-content"
|
|
@@ -275,24 +224,11 @@ interface MenubarItemProps extends ComponentProps<typeof MenubarPrimitive.Item>
|
|
|
275
224
|
/**
|
|
276
225
|
* @since 0.3.16-canary.0
|
|
277
226
|
*/
|
|
278
|
-
function MenubarItem({ className, inset, variant, ...props }: MenubarItemProps): JSX.Element {
|
|
227
|
+
function MenubarItem({ className, inset, variant = "default", ...props }: MenubarItemProps): JSX.Element {
|
|
279
228
|
return (
|
|
280
229
|
<MenubarPrimitive.Item
|
|
281
230
|
className={cn(
|
|
282
|
-
"group/menubar-item relative flex items-center gap-
|
|
283
|
-
"px-2 py-1.5",
|
|
284
|
-
"rounded-sm outline-hidden",
|
|
285
|
-
"text-sm",
|
|
286
|
-
"cursor-default select-none",
|
|
287
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
288
|
-
"aria-disabled:opacity-50",
|
|
289
|
-
"data-inset:pl-8",
|
|
290
|
-
"data-[variant=destructive]:text-destructive",
|
|
291
|
-
"data-[variant=destructive]:focus:bg-destructive/10",
|
|
292
|
-
"dark:data-[variant=destructive]:focus:bg-destructive/20",
|
|
293
|
-
"data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80",
|
|
294
|
-
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
295
|
-
"[&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
231
|
+
"group/menubar-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
296
232
|
className,
|
|
297
233
|
)}
|
|
298
234
|
data-inset={inset}
|
|
@@ -310,37 +246,28 @@ function MenubarItem({ className, inset, variant, ...props }: MenubarItemProps):
|
|
|
310
246
|
/**
|
|
311
247
|
* @since 0.3.16-canary.0
|
|
312
248
|
*/
|
|
313
|
-
|
|
249
|
+
interface MenubarCheckboxItemProps extends ComponentProps<typeof MenubarPrimitive.CheckboxItem> {
|
|
250
|
+
inset?: boolean;
|
|
251
|
+
}
|
|
314
252
|
|
|
315
253
|
/**
|
|
316
254
|
* @since 0.3.16-canary.0
|
|
317
255
|
*/
|
|
318
|
-
function MenubarCheckboxItem({
|
|
319
|
-
checked,
|
|
320
|
-
children,
|
|
321
|
-
className,
|
|
322
|
-
...props
|
|
323
|
-
}: MenubarCheckboxItemProps): JSX.Element {
|
|
256
|
+
function MenubarCheckboxItem({ checked, children, className, inset, ...props }: MenubarCheckboxItemProps): JSX.Element {
|
|
324
257
|
return (
|
|
325
258
|
<MenubarPrimitive.CheckboxItem
|
|
326
259
|
checked={checked}
|
|
327
260
|
className={cn(
|
|
328
|
-
"
|
|
329
|
-
"py-1.5 pr-2 pl-8",
|
|
330
|
-
"rounded-sm outline-hidden",
|
|
331
|
-
"text-sm",
|
|
332
|
-
"cursor-default select-none",
|
|
333
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
334
|
-
"aria-disabled:opacity-50",
|
|
335
|
-
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
261
|
+
"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
336
262
|
className,
|
|
337
263
|
)}
|
|
264
|
+
data-inset={inset}
|
|
338
265
|
data-slot="menubar-checkbox-item"
|
|
339
266
|
{...props}
|
|
340
267
|
>
|
|
341
|
-
<span className=
|
|
268
|
+
<span className="pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
342
269
|
<MenubarPrimitive.ItemIndicator>
|
|
343
|
-
<CheckIcon
|
|
270
|
+
<CheckIcon />
|
|
344
271
|
</MenubarPrimitive.ItemIndicator>
|
|
345
272
|
</span>
|
|
346
273
|
{children}
|
|
@@ -355,31 +282,27 @@ function MenubarCheckboxItem({
|
|
|
355
282
|
/**
|
|
356
283
|
* @since 0.3.16-canary.0
|
|
357
284
|
*/
|
|
358
|
-
|
|
285
|
+
interface MenubarRadioItemProps extends ComponentProps<typeof MenubarPrimitive.RadioItem> {
|
|
286
|
+
inset?: boolean;
|
|
287
|
+
}
|
|
359
288
|
|
|
360
289
|
/**
|
|
361
290
|
* @since 0.3.16-canary.0
|
|
362
291
|
*/
|
|
363
|
-
function MenubarRadioItem({ children, className, ...props }: MenubarRadioItemProps): JSX.Element {
|
|
292
|
+
function MenubarRadioItem({ children, className, inset, ...props }: MenubarRadioItemProps): JSX.Element {
|
|
364
293
|
return (
|
|
365
294
|
<MenubarPrimitive.RadioItem
|
|
366
295
|
className={cn(
|
|
367
|
-
"
|
|
368
|
-
"py-1.5 pr-2 pl-8",
|
|
369
|
-
"rounded-sm outline-hidden",
|
|
370
|
-
"text-sm",
|
|
371
|
-
"cursor-default select-none",
|
|
372
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
373
|
-
"aria-disabled:opacity-50",
|
|
374
|
-
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
296
|
+
"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
375
297
|
className,
|
|
376
298
|
)}
|
|
299
|
+
data-inset={inset}
|
|
377
300
|
data-slot="menubar-radio-item"
|
|
378
301
|
{...props}
|
|
379
302
|
>
|
|
380
|
-
<span className=
|
|
303
|
+
<span className="pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
381
304
|
<MenubarPrimitive.ItemIndicator>
|
|
382
|
-
<
|
|
305
|
+
<CheckIcon />
|
|
383
306
|
</MenubarPrimitive.ItemIndicator>
|
|
384
307
|
</span>
|
|
385
308
|
{children}
|
|
@@ -404,13 +327,7 @@ interface MenubarLabelProps extends ComponentProps<typeof MenubarPrimitive.Label
|
|
|
404
327
|
function MenubarLabel({ className, inset, ...props }: MenubarLabelProps): JSX.Element {
|
|
405
328
|
return (
|
|
406
329
|
<MenubarPrimitive.Label
|
|
407
|
-
className={cn(
|
|
408
|
-
"flex items-center gap-x-2",
|
|
409
|
-
"px-2 py-1.5",
|
|
410
|
-
"text-sm font-semibold",
|
|
411
|
-
"data-inset:pl-8",
|
|
412
|
-
className,
|
|
413
|
-
)}
|
|
330
|
+
className={cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className)}
|
|
414
331
|
data-inset={inset}
|
|
415
332
|
data-slot="menubar-label"
|
|
416
333
|
{...props}
|
|
@@ -433,7 +350,7 @@ type MenubarSeparatorProps = ComponentProps<typeof MenubarPrimitive.Separator>;
|
|
|
433
350
|
function MenubarSeparator({ className, ...props }: MenubarSeparatorProps): JSX.Element {
|
|
434
351
|
return (
|
|
435
352
|
<MenubarPrimitive.Separator
|
|
436
|
-
className={cn("mx-
|
|
353
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
437
354
|
data-slot="menubar-separator"
|
|
438
355
|
{...props}
|
|
439
356
|
/>
|
|
@@ -456,9 +373,7 @@ function MenubarShortcut({ className, ...props }: MenubarShortcutProps): JSX.Ele
|
|
|
456
373
|
return (
|
|
457
374
|
<span
|
|
458
375
|
className={cn(
|
|
459
|
-
"ml-auto",
|
|
460
|
-
"text-xs tracking-widest text-muted-foreground",
|
|
461
|
-
"group-data-[variant=destructive]/menubar-item:text-destructive/80",
|
|
376
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground",
|
|
462
377
|
className,
|
|
463
378
|
)}
|
|
464
379
|
data-slot="menubar-shortcut"
|
|
@@ -480,13 +395,7 @@ type MenubarArrowProps = ComponentProps<typeof MenubarPrimitive.Arrow>;
|
|
|
480
395
|
* @since 0.3.16-canary.0
|
|
481
396
|
*/
|
|
482
397
|
function MenubarArrow({ className, ...props }: MenubarArrowProps): JSX.Element {
|
|
483
|
-
return (
|
|
484
|
-
<MenubarPrimitive.Arrow
|
|
485
|
-
className={cn("fill-popover", className)}
|
|
486
|
-
data-slot="menubar-arrow"
|
|
487
|
-
{...props}
|
|
488
|
-
/>
|
|
489
|
-
);
|
|
398
|
+
return <MenubarPrimitive.Arrow className={cn("fill-popover", className)} data-slot="menubar-arrow" {...props} />;
|
|
490
399
|
}
|
|
491
400
|
|
|
492
401
|
/* -----------------------------------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
1
2
|
import type { ComponentProps, JSX } from "react";
|
|
2
3
|
|
|
3
4
|
import { cn } from "#/lib/utils";
|
|
4
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
5
5
|
|
|
6
6
|
/* -----------------------------------------------------------------------------
|
|
7
7
|
* Component: NativeSelect
|
|
@@ -10,46 +10,29 @@ import { ChevronDownIcon } from "lucide-react";
|
|
|
10
10
|
/**
|
|
11
11
|
* @since 0.3.16-canary.0
|
|
12
12
|
*/
|
|
13
|
-
type NativeSelectProps = ComponentProps<"select"
|
|
13
|
+
type NativeSelectProps = Omit<ComponentProps<"select">, "size"> & {
|
|
14
|
+
size?: "default" | "sm";
|
|
15
|
+
};
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* @since 0.3.16-canary.0
|
|
17
19
|
*/
|
|
18
|
-
function NativeSelect({ className, ...props }: NativeSelectProps): JSX.Element {
|
|
20
|
+
function NativeSelect({ className, size = "default", ...props }: NativeSelectProps): JSX.Element {
|
|
19
21
|
return (
|
|
20
22
|
<div
|
|
21
|
-
className={cn("group/native-select relative
|
|
23
|
+
className={cn("group/native-select relative w-fit has-[select:disabled]:opacity-50", className)}
|
|
24
|
+
data-size={size}
|
|
22
25
|
data-slot="native-select-wrapper"
|
|
23
26
|
>
|
|
24
27
|
<select
|
|
25
|
-
className=
|
|
26
|
-
|
|
27
|
-
"rounded-lg border border-input",
|
|
28
|
-
"bg-transparent shadow-xs outline-none",
|
|
29
|
-
"text-sm",
|
|
30
|
-
"appearance-none transition-[color,box-shadow]",
|
|
31
|
-
"motion-reduce:transition-none",
|
|
32
|
-
"selection:bg-primary selection:text-primary-foreground",
|
|
33
|
-
"placeholder:text-muted-foreground",
|
|
34
|
-
"disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
35
|
-
"dark:bg-input/30",
|
|
36
|
-
"dark:hover:bg-input/50",
|
|
37
|
-
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
38
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
39
|
-
"dark:aria-invalid:ring-destructive/40",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
28
|
+
className="h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-8 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
|
|
29
|
+
data-size={size}
|
|
42
30
|
data-slot="native-select"
|
|
43
31
|
{...props}
|
|
44
32
|
/>
|
|
45
33
|
<ChevronDownIcon
|
|
46
34
|
aria-hidden="true"
|
|
47
|
-
className=
|
|
48
|
-
"absolute top-1/2 right-3.5",
|
|
49
|
-
"size-4 text-muted-foreground",
|
|
50
|
-
"-translate-y-1/2 opacity-50",
|
|
51
|
-
"pointer-events-none select-none",
|
|
52
|
-
)}
|
|
35
|
+
className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"
|
|
53
36
|
data-slot="native-select-icon"
|
|
54
37
|
/>
|
|
55
38
|
</div>
|
|
@@ -68,8 +51,10 @@ type NativeSelectOptionProps = ComponentProps<"option">;
|
|
|
68
51
|
/**
|
|
69
52
|
* @since 0.3.16-canary.0
|
|
70
53
|
*/
|
|
71
|
-
function NativeSelectOption({ ...props }: NativeSelectOptionProps): JSX.Element {
|
|
72
|
-
return
|
|
54
|
+
function NativeSelectOption({ className, ...props }: NativeSelectOptionProps): JSX.Element {
|
|
55
|
+
return (
|
|
56
|
+
<option className={cn("bg-[Canvas] text-[CanvasText]", className)} data-slot="native-select-option" {...props} />
|
|
57
|
+
);
|
|
73
58
|
}
|
|
74
59
|
|
|
75
60
|
/* -----------------------------------------------------------------------------
|
|
@@ -85,7 +70,13 @@ type NativeSelectOptGroupProps = ComponentProps<"optgroup">;
|
|
|
85
70
|
* @since 0.3.16-canary.0
|
|
86
71
|
*/
|
|
87
72
|
function NativeSelectOptGroup({ className, ...props }: NativeSelectOptGroupProps): JSX.Element {
|
|
88
|
-
return
|
|
73
|
+
return (
|
|
74
|
+
<optgroup
|
|
75
|
+
className={cn("bg-[Canvas] text-[CanvasText]", className)}
|
|
76
|
+
data-slot="native-select-optgroup"
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
89
80
|
}
|
|
90
81
|
|
|
91
82
|
/* -----------------------------------------------------------------------------
|