@codefast/ui 0.3.13-canary.3 → 0.3.13-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 +19 -0
- package/dist/components/accordion.d.mts +37 -0
- package/dist/components/accordion.mjs +53 -0
- package/dist/components/alert-dialog.d.mts +74 -0
- package/dist/components/alert-dialog.mjs +92 -0
- package/dist/components/alert.d.mts +30 -0
- package/dist/components/alert.mjs +49 -0
- package/dist/components/aspect-ratio.d.mts +10 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +21 -0
- package/dist/components/avatar.mjs +28 -0
- package/dist/components/badge.d.mts +24 -0
- package/dist/components/badge.mjs +56 -0
- package/dist/components/breadcrumb.d.mts +44 -0
- package/dist/components/breadcrumb.mjs +67 -0
- package/dist/components/button-group.d.mts +34 -0
- package/dist/components/button-group.mjs +53 -0
- package/dist/components/button.d.mts +38 -0
- package/dist/components/button.mjs +99 -0
- package/dist/components/calendar.d.mts +27 -0
- package/dist/components/calendar.mjs +114 -0
- package/dist/components/card.d.mts +41 -0
- package/dist/components/card.mjs +55 -0
- package/dist/components/carousel.d.mts +68 -0
- package/dist/components/carousel.mjs +135 -0
- package/dist/components/chart.d.mts +93 -0
- package/dist/components/chart.mjs +189 -0
- package/dist/components/checkbox-cards.d.mts +17 -0
- package/dist/components/checkbox-cards.mjs +30 -0
- package/dist/components/checkbox-group.d.mts +16 -0
- package/dist/components/checkbox-group.mjs +27 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +20 -0
- package/dist/components/collapsible.d.mts +18 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/command.d.mts +57 -0
- package/dist/components/command.mjs +92 -0
- package/dist/components/context-menu.d.mts +91 -0
- package/dist/components/context-menu.mjs +122 -0
- package/dist/components/dialog.d.mts +65 -0
- package/dist/components/dialog.mjs +93 -0
- package/dist/components/drawer.d.mts +65 -0
- package/dist/components/drawer.mjs +78 -0
- package/dist/components/dropdown-menu.d.mts +92 -0
- package/dist/components/dropdown-menu.mjs +129 -0
- package/dist/components/empty.d.mts +44 -0
- package/dist/components/empty.mjs +64 -0
- package/dist/components/field.d.mts +79 -0
- package/dist/components/field.mjs +132 -0
- package/dist/components/form.d.mts +48 -0
- package/dist/components/form.mjs +92 -0
- package/dist/components/hover-card.d.mts +26 -0
- package/dist/components/hover-card.mjs +35 -0
- package/dist/components/input-group.d.mts +61 -0
- package/dist/components/input-group.mjs +142 -0
- package/dist/components/input-number.d.mts +28 -0
- package/dist/components/input-number.mjs +61 -0
- package/dist/components/input-otp.d.mts +29 -0
- package/dist/components/input-otp.mjs +48 -0
- package/dist/components/input-password.d.mts +13 -0
- package/dist/components/input-password.mjs +38 -0
- package/dist/components/input-search.d.mts +20 -0
- package/dist/components/input-search.mjs +50 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +82 -0
- package/dist/components/item.mjs +137 -0
- package/dist/components/kbd.d.mts +15 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +14 -0
- package/dist/components/menubar.d.mts +100 -0
- package/dist/components/menubar.mjs +133 -0
- package/dist/components/native-select.d.mts +19 -0
- package/dist/components/native-select.mjs +34 -0
- package/dist/components/navigation-menu.d.mts +44 -0
- package/dist/components/navigation-menu.mjs +79 -0
- package/dist/components/pagination.d.mts +46 -0
- package/dist/components/pagination.mjs +71 -0
- package/dist/components/popover.d.mts +30 -0
- package/dist/components/popover.mjs +41 -0
- package/dist/components/progress-circle.d.mts +124 -0
- package/dist/components/progress-circle.mjs +120 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +19 -0
- package/dist/components/{radio-cards.d.ts → radio-cards.d.mts} +10 -5
- package/dist/components/radio-cards.mjs +29 -0
- package/dist/components/radio-group.d.mts +16 -0
- package/dist/components/radio-group.mjs +25 -0
- package/dist/components/radio.d.mts +14 -0
- package/dist/components/radio.mjs +16 -0
- package/dist/components/resizable.d.mts +23 -0
- package/dist/components/resizable.mjs +32 -0
- package/dist/components/scroll-area.d.mts +40 -0
- package/dist/components/scroll-area.mjs +101 -0
- package/dist/components/select.d.mts +62 -0
- package/dist/components/select.mjs +101 -0
- package/dist/components/separator.d.mts +32 -0
- package/dist/components/separator.mjs +45 -0
- package/dist/components/sheet.d.mts +75 -0
- package/dist/components/sheet.mjs +134 -0
- package/dist/components/sidebar.d.mts +195 -0
- package/dist/components/sidebar.mjs +375 -0
- package/dist/components/skeleton.d.mts +10 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +40 -0
- package/dist/components/sonner.d.mts +10 -0
- package/dist/components/sonner.mjs +21 -0
- package/dist/components/spinner.d.mts +14 -0
- package/dist/components/spinner.mjs +40 -0
- package/dist/components/switch.d.mts +11 -0
- package/dist/components/switch.mjs +18 -0
- package/dist/components/table.d.mts +45 -0
- package/dist/components/table.mjs +65 -0
- package/dist/components/tabs.d.mts +26 -0
- package/dist/components/tabs.mjs +35 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +12 -0
- package/dist/components/toggle-group.d.mts +30 -0
- package/dist/components/toggle-group.mjs +53 -0
- package/dist/components/toggle.d.mts +28 -0
- package/dist/components/toggle.mjs +53 -0
- package/dist/components/tooltip.d.mts +30 -0
- package/dist/components/tooltip.mjs +42 -0
- package/dist/hooks/{use-animated-value.d.ts → use-animated-value.d.mts} +4 -2
- package/dist/hooks/use-animated-value.mjs +62 -0
- package/dist/hooks/{use-copy-to-clipboard.d.ts → use-copy-to-clipboard.d.mts} +11 -6
- package/dist/hooks/use-copy-to-clipboard.mjs +43 -0
- package/dist/hooks/{use-is-mobile.d.ts → use-is-mobile.d.mts} +4 -2
- package/dist/hooks/use-is-mobile.mjs +26 -0
- package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +4 -2
- package/dist/hooks/use-media-query.mjs +50 -0
- package/dist/hooks/{use-mutation-observer.d.ts → use-mutation-observer.d.mts} +6 -3
- package/dist/hooks/use-mutation-observer.mjs +41 -0
- package/dist/hooks/use-pagination.d.mts +44 -0
- package/dist/hooks/use-pagination.mjs +107 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.mjs +69 -0
- package/dist/lib/utils.d.mts +13 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +6 -0
- package/dist/primitives/checkbox-group.d.mts +144 -0
- package/dist/primitives/checkbox-group.mjs +126 -0
- package/dist/primitives/input-number.d.mts +73 -0
- package/dist/primitives/input-number.mjs +514 -0
- package/dist/primitives/input.d.mts +72 -0
- package/dist/primitives/input.mjs +75 -0
- package/dist/primitives/progress-circle.d.mts +146 -0
- package/dist/primitives/progress-circle.mjs +178 -0
- package/package.json +164 -170
- package/dist/components/accordion.d.ts +0 -19
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -26
- package/dist/components/alert-dialog.d.ts +0 -39
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -39
- package/dist/components/alert.d.ts +0 -19
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -41
- package/dist/components/aspect-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio.d.ts.map +0 -1
- package/dist/components/aspect-ratio.js +0 -10
- package/dist/components/avatar.d.ts +0 -11
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -17
- package/dist/components/badge.d.ts +0 -18
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -59
- package/dist/components/breadcrumb.d.ts +0 -22
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb.js +0 -31
- package/dist/components/button-group.d.ts +0 -20
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -48
- package/dist/components/button.d.ts +0 -29
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -92
- package/dist/components/calendar.d.ts +0 -13
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/calendar.js +0 -104
- package/dist/components/card.d.ts +0 -18
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -27
- package/dist/components/carousel.d.ts +0 -38
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -103
- package/dist/components/chart.d.ts +0 -58
- package/dist/components/chart.d.ts.map +0 -1
- package/dist/components/chart.js +0 -198
- package/dist/components/checkbox-cards.d.ts +0 -11
- package/dist/components/checkbox-cards.d.ts.map +0 -1
- package/dist/components/checkbox-cards.js +0 -16
- package/dist/components/checkbox-group.d.ts +0 -9
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox-group.js +0 -15
- package/dist/components/checkbox.d.ts +0 -7
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox.js +0 -12
- package/dist/components/collapsible.d.ts +0 -11
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -16
- package/dist/components/command.d.ts +0 -26
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -41
- package/dist/components/context-menu.d.ts +0 -42
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -54
- package/dist/components/dialog.d.ts +0 -35
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -41
- package/dist/components/drawer.d.ts +0 -34
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -36
- package/dist/components/dropdown-menu.d.ts +0 -42
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -54
- package/dist/components/empty.d.ts +0 -23
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -47
- package/dist/components/field.d.ts +0 -42
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -85
- package/dist/components/form.d.ts +0 -27
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -76
- package/dist/components/hover-card.d.ts +0 -13
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -20
- package/dist/components/input-group.d.ts +0 -37
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -127
- package/dist/components/input-number.d.ts +0 -8
- package/dist/components/input-number.d.ts.map +0 -1
- package/dist/components/input-number.js +0 -20
- package/dist/components/input-otp.d.ts +0 -16
- package/dist/components/input-otp.d.ts.map +0 -1
- package/dist/components/input-otp.js +0 -25
- package/dist/components/input-password.d.ts +0 -7
- package/dist/components/input-password.d.ts.map +0 -1
- package/dist/components/input-password.js +0 -17
- package/dist/components/input-search.d.ts +0 -11
- package/dist/components/input-search.d.ts.map +0 -1
- package/dist/components/input-search.js +0 -22
- package/dist/components/input.d.ts +0 -6
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -10
- package/dist/components/item.d.ts +0 -46
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/item.js +0 -94
- package/dist/components/kbd.d.ts +0 -8
- package/dist/components/kbd.d.ts.map +0 -1
- package/dist/components/kbd.js +0 -12
- package/dist/components/label.d.ts +0 -7
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -11
- package/dist/components/menubar.d.ts +0 -44
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/menubar.js +0 -57
- package/dist/components/native-select.d.ts +0 -10
- package/dist/components/native-select.d.ts.map +0 -1
- package/dist/components/native-select.js +0 -16
- package/dist/components/navigation-menu.d.ts +0 -21
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/navigation-menu.js +0 -43
- package/dist/components/pagination.d.ts +0 -26
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -29
- package/dist/components/popover.d.ts +0 -15
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress-circle.d.ts +0 -107
- package/dist/components/progress-circle.d.ts.map +0 -1
- package/dist/components/progress-circle.js +0 -83
- package/dist/components/progress.d.ts +0 -7
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -13
- package/dist/components/radio-cards.d.ts.map +0 -1
- package/dist/components/radio-cards.js +0 -15
- package/dist/components/radio-group.d.ts +0 -9
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -14
- package/dist/components/radio.d.ts +0 -8
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/radio.js +0 -11
- package/dist/components/resizable.d.ts +0 -13
- package/dist/components/resizable.d.ts.map +0 -1
- package/dist/components/resizable.js +0 -18
- package/dist/components/scroll-area.d.ts +0 -28
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -77
- package/dist/components/select.d.ts +0 -29
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -49
- package/dist/components/separator.d.ts +0 -23
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -36
- package/dist/components/sheet.d.ts +0 -43
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -90
- package/dist/components/sidebar.d.ts +0 -102
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -241
- package/dist/components/skeleton.d.ts +0 -6
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -9
- package/dist/components/slider.d.ts +0 -7
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/slider.js +0 -18
- package/dist/components/sonner.d.ts +0 -8
- package/dist/components/sonner.d.ts.map +0 -1
- package/dist/components/sonner.js +0 -18
- package/dist/components/spinner.d.ts +0 -8
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -27
- package/dist/components/switch.d.ts +0 -7
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -11
- package/dist/components/table.d.ts +0 -20
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -30
- package/dist/components/tabs.d.ts +0 -13
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -20
- package/dist/components/textarea.d.ts +0 -6
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -9
- package/dist/components/toggle-group.d.ts +0 -16
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle-group.js +0 -35
- package/dist/components/toggle.d.ts +0 -21
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -49
- package/dist/components/tooltip.d.ts +0 -15
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -23
- package/dist/hooks/use-animated-value.d.ts.map +0 -1
- package/dist/hooks/use-animated-value.js +0 -71
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.js +0 -46
- package/dist/hooks/use-is-mobile.d.ts.map +0 -1
- package/dist/hooks/use-is-mobile.js +0 -23
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-media-query.js +0 -53
- package/dist/hooks/use-mutation-observer.d.ts.map +0 -1
- package/dist/hooks/use-mutation-observer.js +0 -40
- package/dist/hooks/use-pagination.d.ts +0 -37
- package/dist/hooks/use-pagination.d.ts.map +0 -1
- package/dist/hooks/use-pagination.js +0 -107
- package/dist/index.d.ts +0 -131
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -68
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -10
- package/dist/primitives/checkbox-group.d.ts +0 -123
- package/dist/primitives/checkbox-group.d.ts.map +0 -1
- package/dist/primitives/checkbox-group.js +0 -112
- package/dist/primitives/input-number.d.ts +0 -63
- package/dist/primitives/input-number.d.ts.map +0 -1
- package/dist/primitives/input-number.js +0 -458
- package/dist/primitives/input.d.ts +0 -67
- package/dist/primitives/input.d.ts.map +0 -1
- package/dist/primitives/input.js +0 -76
- package/dist/primitives/progress-circle.d.ts +0 -116
- package/dist/primitives/progress-circle.d.ts.map +0 -1
- package/dist/primitives/progress-circle.js +0 -163
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { cn, tv } from "../lib/utils.mjs";
|
|
2
|
+
import { Separator } from "./separator.mjs";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/item.tsx
|
|
6
|
+
const itemVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"group/item flex flex-wrap items-center",
|
|
9
|
+
"rounded-lg border border-transparent outline-hidden",
|
|
10
|
+
"text-sm",
|
|
11
|
+
"transition-colors duration-100",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
13
|
+
"[a]:transition-colors",
|
|
14
|
+
"[a]:hover:bg-accent/50"
|
|
15
|
+
],
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "default",
|
|
18
|
+
variant: "default"
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
default: ["gap-4", "p-4"],
|
|
23
|
+
sm: ["gap-2.5", "px-4 py-3"]
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
default: "bg-transparent",
|
|
27
|
+
muted: "bg-muted/50",
|
|
28
|
+
outline: "border-border"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const itemMediaVariants = tv({
|
|
33
|
+
base: [
|
|
34
|
+
"flex shrink-0 items-center justify-center gap-2",
|
|
35
|
+
"group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start",
|
|
36
|
+
"[&_svg]:pointer-events-none"
|
|
37
|
+
],
|
|
38
|
+
defaultVariants: { variant: "default" },
|
|
39
|
+
variants: { variant: {
|
|
40
|
+
default: "bg-transparent",
|
|
41
|
+
icon: [
|
|
42
|
+
"size-8 shrink-0",
|
|
43
|
+
"rounded-md border",
|
|
44
|
+
"bg-muted",
|
|
45
|
+
"[&_svg:not([class*='size-'])]:size-4"
|
|
46
|
+
],
|
|
47
|
+
image: [
|
|
48
|
+
"size-10 shrink-0 overflow-hidden",
|
|
49
|
+
"rounded-md",
|
|
50
|
+
"[&_img]:size-full [&_img]:object-cover"
|
|
51
|
+
]
|
|
52
|
+
} }
|
|
53
|
+
});
|
|
54
|
+
function ItemGroup({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: cn("group/item-group flex flex-col", className),
|
|
57
|
+
"data-slot": "item-group",
|
|
58
|
+
role: "list",
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function ItemSeparator({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
64
|
+
className: cn("my-0", className),
|
|
65
|
+
"data-slot": "item-separator",
|
|
66
|
+
orientation: "horizontal",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function Item({ asChild = false, className, size = "default", variant = "default", ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
72
|
+
className: itemVariants({
|
|
73
|
+
className,
|
|
74
|
+
size,
|
|
75
|
+
variant
|
|
76
|
+
}),
|
|
77
|
+
"data-size": size,
|
|
78
|
+
"data-slot": "item",
|
|
79
|
+
"data-variant": variant,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function ItemMedia({ className, variant = "default", ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: itemMediaVariants({
|
|
86
|
+
className,
|
|
87
|
+
variant
|
|
88
|
+
}),
|
|
89
|
+
"data-slot": "item-media",
|
|
90
|
+
"data-variant": variant,
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function ItemContent({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("div", {
|
|
96
|
+
className: cn("flex flex-1 flex-col gap-1", "[&+[data-slot=item-content]]:flex-none", className),
|
|
97
|
+
"data-slot": "item-content",
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function ItemTitle({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx("div", {
|
|
103
|
+
className: cn("flex w-fit items-center gap-2", "text-sm leading-snug font-medium", className),
|
|
104
|
+
"data-slot": "item-title",
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function ItemDescription({ className, ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx("p", {
|
|
110
|
+
className: cn("line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4", "[&>a:hover]:text-primary", className),
|
|
111
|
+
"data-slot": "item-description",
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function ItemActions({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx("div", {
|
|
117
|
+
className: cn("flex items-center gap-2", className),
|
|
118
|
+
"data-slot": "item-actions",
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function ItemHeader({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx("div", {
|
|
124
|
+
className: cn("flex basis-full items-center justify-between gap-2", className),
|
|
125
|
+
"data-slot": "item-header",
|
|
126
|
+
...props
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function ItemFooter({ className, ...props }) {
|
|
130
|
+
return /* @__PURE__ */ jsx("div", {
|
|
131
|
+
className: cn("flex basis-full items-center justify-between gap-2", className),
|
|
132
|
+
"data-slot": "item-footer",
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, itemMediaVariants, itemVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/kbd.d.ts
|
|
4
|
+
type KbdProps = ComponentProps<"kbd">;
|
|
5
|
+
declare function Kbd({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: KbdProps): JSX.Element;
|
|
9
|
+
type KbdGroupProps = ComponentProps<"kbd">;
|
|
10
|
+
declare function KbdGroup({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: KbdGroupProps): JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Kbd, KbdGroup, type KbdGroupProps, type KbdProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/kbd.tsx
|
|
4
|
+
function Kbd({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
6
|
+
className: cn("inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 px-1", "rounded-md", "bg-muted font-sans text-xs font-medium text-muted-foreground", "pointer-events-none 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", className),
|
|
7
|
+
"data-slot": "kbd",
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function KbdGroup({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
13
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
14
|
+
"data-slot": "kbd-group",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Kbd, KbdGroup };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
|
|
4
|
+
//#region src/components/label.d.ts
|
|
5
|
+
type LabelProps = ComponentProps<typeof LabelPrimitive.Root>;
|
|
6
|
+
declare function Label({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: LabelProps): JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Label, type LabelProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
+
//#region src/components/label.tsx
|
|
6
|
+
function Label({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
8
|
+
className: cn("inline-block", "text-sm leading-none font-medium", "group-data-disabled:opacity-50", "peer-disabled:opacity-50", "peer-aria-invalid:text-destructive", "peer-data-disabled:opacity-50", "data-invalid:text-destructive", className),
|
|
9
|
+
"data-slot": "label",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Label };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
3
|
+
|
|
4
|
+
//#region src/components/menubar.d.ts
|
|
5
|
+
type MenubarProps = ComponentProps<typeof MenubarPrimitive.Root>;
|
|
6
|
+
declare function Menubar({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: MenubarProps): JSX.Element;
|
|
10
|
+
type MenubarMenuProps = ComponentProps<typeof MenubarPrimitive.Menu>;
|
|
11
|
+
declare function MenubarMenu({
|
|
12
|
+
...props
|
|
13
|
+
}: MenubarMenuProps): JSX.Element;
|
|
14
|
+
type MenubarGroupProps = ComponentProps<typeof MenubarPrimitive.Group>;
|
|
15
|
+
declare function MenubarGroup({
|
|
16
|
+
...props
|
|
17
|
+
}: MenubarGroupProps): JSX.Element;
|
|
18
|
+
type MenubarSubProps = ComponentProps<typeof MenubarPrimitive.Sub>;
|
|
19
|
+
declare function MenubarSub({
|
|
20
|
+
...props
|
|
21
|
+
}: MenubarSubProps): JSX.Element;
|
|
22
|
+
type MenubarRadioGroupProps = ComponentProps<typeof MenubarPrimitive.RadioGroup>;
|
|
23
|
+
declare function MenubarRadioGroup({
|
|
24
|
+
...props
|
|
25
|
+
}: MenubarRadioGroupProps): JSX.Element;
|
|
26
|
+
type MenubarTriggerProps = ComponentProps<typeof MenubarPrimitive.Trigger>;
|
|
27
|
+
declare function MenubarTrigger({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: MenubarTriggerProps): JSX.Element;
|
|
31
|
+
interface MenubarSubTriggerProps extends ComponentProps<typeof MenubarPrimitive.SubTrigger> {
|
|
32
|
+
inset?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare function MenubarSubTrigger({
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
inset,
|
|
38
|
+
...props
|
|
39
|
+
}: MenubarSubTriggerProps): JSX.Element;
|
|
40
|
+
type MenubarSubContentProps = ComponentProps<typeof MenubarPrimitive.SubContent>;
|
|
41
|
+
declare function MenubarSubContent({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: MenubarSubContentProps): JSX.Element;
|
|
45
|
+
type MenubarContentProps = ComponentProps<typeof MenubarPrimitive.Content>;
|
|
46
|
+
declare function MenubarContent({
|
|
47
|
+
align,
|
|
48
|
+
alignOffset,
|
|
49
|
+
className,
|
|
50
|
+
sideOffset,
|
|
51
|
+
...props
|
|
52
|
+
}: MenubarContentProps): JSX.Element;
|
|
53
|
+
interface MenubarItemProps extends ComponentProps<typeof MenubarPrimitive.Item> {
|
|
54
|
+
inset?: boolean;
|
|
55
|
+
variant?: "default" | "destructive";
|
|
56
|
+
}
|
|
57
|
+
declare function MenubarItem({
|
|
58
|
+
className,
|
|
59
|
+
inset,
|
|
60
|
+
variant,
|
|
61
|
+
...props
|
|
62
|
+
}: MenubarItemProps): JSX.Element;
|
|
63
|
+
type MenubarCheckboxItemProps = ComponentProps<typeof MenubarPrimitive.CheckboxItem>;
|
|
64
|
+
declare function MenubarCheckboxItem({
|
|
65
|
+
checked,
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}: MenubarCheckboxItemProps): JSX.Element;
|
|
70
|
+
type MenubarRadioItemProps = ComponentProps<typeof MenubarPrimitive.RadioItem>;
|
|
71
|
+
declare function MenubarRadioItem({
|
|
72
|
+
children,
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}: MenubarRadioItemProps): JSX.Element;
|
|
76
|
+
interface MenubarLabelProps extends ComponentProps<typeof MenubarPrimitive.Label> {
|
|
77
|
+
inset?: boolean;
|
|
78
|
+
}
|
|
79
|
+
declare function MenubarLabel({
|
|
80
|
+
className,
|
|
81
|
+
inset,
|
|
82
|
+
...props
|
|
83
|
+
}: MenubarLabelProps): JSX.Element;
|
|
84
|
+
type MenubarSeparatorProps = ComponentProps<typeof MenubarPrimitive.Separator>;
|
|
85
|
+
declare function MenubarSeparator({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: MenubarSeparatorProps): JSX.Element;
|
|
89
|
+
type MenubarShortcutProps = ComponentProps<"span">;
|
|
90
|
+
declare function MenubarShortcut({
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}: MenubarShortcutProps): JSX.Element;
|
|
94
|
+
type MenubarArrowProps = ComponentProps<typeof MenubarPrimitive.Arrow>;
|
|
95
|
+
declare function MenubarArrow({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: MenubarArrowProps): JSX.Element;
|
|
99
|
+
//#endregion
|
|
100
|
+
export { Menubar, MenubarArrow, type MenubarArrowProps, MenubarCheckboxItem, type MenubarCheckboxItemProps, MenubarContent, type MenubarContentProps, MenubarGroup, type MenubarGroupProps, MenubarItem, type MenubarItemProps, MenubarLabel, type MenubarLabelProps, MenubarMenu, type MenubarMenuProps, type MenubarProps, MenubarRadioGroup, type MenubarRadioGroupProps, MenubarRadioItem, type MenubarRadioItemProps, MenubarSeparator, type MenubarSeparatorProps, MenubarShortcut, type MenubarShortcutProps, MenubarSub, MenubarSubContent, type MenubarSubContentProps, type MenubarSubProps, MenubarSubTrigger, type MenubarSubTriggerProps, MenubarTrigger, type MenubarTriggerProps };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
6
|
+
//#region src/components/menubar.tsx
|
|
7
|
+
function Menubar({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Root, {
|
|
9
|
+
className: cn("flex items-center space-x-1", "p-1", "rounded-lg border", "bg-background", className),
|
|
10
|
+
"data-slot": "menubar",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function MenubarMenu({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Menu, {
|
|
16
|
+
"data-slot": "menubar-menu",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function MenubarGroup({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Group, {
|
|
22
|
+
"data-slot": "menubar-group",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function MenubarSub({ ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Sub, {
|
|
28
|
+
"data-slot": "menubar-sub",
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function MenubarRadioGroup({ ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.RadioGroup, {
|
|
34
|
+
"data-slot": "menubar-radio-group",
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function MenubarTrigger({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Trigger, {
|
|
40
|
+
className: cn("flex items-center gap-x-2", "px-2 py-1.5", "rounded-sm outline-hidden", "text-sm font-medium", "select-none", "focus:bg-accent focus:text-accent-foreground", "data-open:bg-accent data-open:text-accent-foreground", className),
|
|
41
|
+
"data-slot": "menubar-trigger",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function MenubarSubTrigger({ children, className, inset, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsxs(MenubarPrimitive.SubTrigger, {
|
|
47
|
+
className: cn("flex items-center gap-x-2", "px-2 py-1.5", "rounded-sm outline-hidden", "text-sm", "cursor-default select-none", "focus:bg-accent focus:text-accent-foreground", "data-inset:pl-8", "data-open:bg-accent data-open:text-accent-foreground", className),
|
|
48
|
+
"data-inset": inset,
|
|
49
|
+
"data-slot": "menubar-sub-trigger",
|
|
50
|
+
...props,
|
|
51
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("size-4", "ml-auto") })]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function MenubarSubContent({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(MenubarPrimitive.SubContent, {
|
|
56
|
+
className: cn("z-50", "min-w-32 overflow-hidden p-1", "rounded-lg border", "bg-popover text-popover-foreground shadow-lg", "ease-ui data-open:animate-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: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", "origin-(--radix-menubar-content-transform-origin)", className),
|
|
57
|
+
"data-slot": "menubar-sub-content",
|
|
58
|
+
...props
|
|
59
|
+
}) });
|
|
60
|
+
}
|
|
61
|
+
function MenubarContent({ align = "start", alignOffset = -4, className, sideOffset = 4, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(MenubarPrimitive.Content, {
|
|
63
|
+
align,
|
|
64
|
+
alignOffset,
|
|
65
|
+
className: cn("z-50", "min-w-32 overflow-hidden p-1", "rounded-lg border", "bg-popover text-popover-foreground shadow-lg", "ease-ui data-open:animate-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", "origin-(--radix-menubar-content-transform-origin)", className),
|
|
66
|
+
"data-slot": "menubar-content",
|
|
67
|
+
sideOffset,
|
|
68
|
+
...props
|
|
69
|
+
}) });
|
|
70
|
+
}
|
|
71
|
+
function MenubarItem({ className, inset, variant, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Item, {
|
|
73
|
+
className: cn("group/menubar-item relative flex items-center gap-x-2", "px-2 py-1.5", "rounded-sm outline-hidden", "text-sm", "cursor-default select-none", "focus:bg-accent focus:text-accent-foreground", "aria-disabled:opacity-50", "data-inset:pl-8", "data-[variant=destructive]:text-destructive", "data-[variant=destructive]:focus:bg-destructive/10", "dark:data-[variant=destructive]:focus:bg-destructive/20", "data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "[&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
74
|
+
"data-inset": inset,
|
|
75
|
+
"data-slot": "menubar-item",
|
|
76
|
+
"data-variant": variant,
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function MenubarCheckboxItem({ checked, children, className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsxs(MenubarPrimitive.CheckboxItem, {
|
|
82
|
+
checked,
|
|
83
|
+
className: cn("group/menubar-item relative flex items-center gap-x-2", "py-1.5 pr-2 pl-8", "rounded-sm outline-hidden", "text-sm", "cursor-default select-none", "focus:bg-accent focus:text-accent-foreground", "aria-disabled:opacity-50", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
84
|
+
"data-slot": "menubar-checkbox-item",
|
|
85
|
+
...props,
|
|
86
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: cn("absolute flex items-center justify-center", "left-2"),
|
|
88
|
+
children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
89
|
+
}), children]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function MenubarRadioItem({ children, className, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsxs(MenubarPrimitive.RadioItem, {
|
|
94
|
+
className: cn("group/menubar-item relative flex items-center gap-x-2", "py-1.5 pr-2 pl-8", "rounded-sm outline-hidden", "text-sm", "cursor-default select-none", "focus:bg-accent focus:text-accent-foreground", "aria-disabled:opacity-50", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
95
|
+
"data-slot": "menubar-radio-item",
|
|
96
|
+
...props,
|
|
97
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: cn("absolute flex items-center justify-center", "left-2"),
|
|
99
|
+
children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotIcon, { className: cn("size-4", "fill-current") }) })
|
|
100
|
+
}), children]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function MenubarLabel({ className, inset, ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Label, {
|
|
105
|
+
className: cn("flex items-center gap-x-2", "px-2 py-1.5", "text-sm font-semibold", "data-inset:pl-8", className),
|
|
106
|
+
"data-inset": inset,
|
|
107
|
+
"data-slot": "menubar-label",
|
|
108
|
+
...props
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function MenubarSeparator({ className, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Separator, {
|
|
113
|
+
className: cn("mx-2 my-1 h-px", "bg-border", className),
|
|
114
|
+
"data-slot": "menubar-separator",
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function MenubarShortcut({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx("span", {
|
|
120
|
+
className: cn("ml-auto", "text-xs tracking-widest text-muted-foreground", "group-data-[variant=destructive]/menubar-item:text-destructive/80", className),
|
|
121
|
+
"data-slot": "menubar-shortcut",
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function MenubarArrow({ className, ...props }) {
|
|
126
|
+
return /* @__PURE__ */ jsx(MenubarPrimitive.Arrow, {
|
|
127
|
+
className: cn("fill-popover", className),
|
|
128
|
+
"data-slot": "menubar-arrow",
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
export { Menubar, MenubarArrow, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/native-select.d.ts
|
|
4
|
+
type NativeSelectProps = ComponentProps<"select">;
|
|
5
|
+
declare function NativeSelect({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: NativeSelectProps): JSX.Element;
|
|
9
|
+
type NativeSelectOptionProps = ComponentProps<"option">;
|
|
10
|
+
declare function NativeSelectOption({
|
|
11
|
+
...props
|
|
12
|
+
}: NativeSelectOptionProps): JSX.Element;
|
|
13
|
+
type NativeSelectOptGroupProps = ComponentProps<"optgroup">;
|
|
14
|
+
declare function NativeSelectOptGroup({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}: NativeSelectOptGroupProps): JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { NativeSelect, NativeSelectOptGroup, type NativeSelectOptGroupProps, NativeSelectOption, type NativeSelectOptionProps, type NativeSelectProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/native-select.tsx
|
|
5
|
+
function NativeSelect({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
+
className: cn("group/native-select relative", "w-fit", "has-[select:disabled]:opacity-50"),
|
|
8
|
+
"data-slot": "native-select-wrapper",
|
|
9
|
+
children: [/* @__PURE__ */ jsx("select", {
|
|
10
|
+
className: cn("h-9 w-full min-w-0 px-3 py-2 pr-9", "rounded-lg border border-input", "bg-transparent shadow-xs outline-none", "text-sm", "appearance-none transition-[color,box-shadow]", "selection:bg-primary selection:text-primary-foreground", "placeholder:text-muted-foreground", "disabled:pointer-events-none disabled:cursor-not-allowed", "dark:bg-input/30", "dark:hover:bg-input/50", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20", "dark:aria-invalid:ring-destructive/40", className),
|
|
11
|
+
"data-slot": "native-select",
|
|
12
|
+
...props
|
|
13
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
className: cn("absolute top-1/2 right-3.5", "size-4 text-muted-foreground", "-translate-y-1/2 opacity-50", "pointer-events-none select-none"),
|
|
16
|
+
"data-slot": "native-select-icon"
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function NativeSelectOption({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("option", {
|
|
22
|
+
"data-slot": "native-select-option",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function NativeSelectOptGroup({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("optgroup", {
|
|
28
|
+
className: cn(className),
|
|
29
|
+
"data-slot": "native-select-optgroup",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
2
|
+
import { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
4
|
+
|
|
5
|
+
//#region src/components/navigation-menu.d.ts
|
|
6
|
+
declare const navigationMenuTriggerVariants: _$_codefast_tailwind_variants0.VariantFunctionType<_$_codefast_tailwind_variants0.ConfigurationSchema, Record<string, never>>;
|
|
7
|
+
interface NavigationMenuProps extends ComponentProps<typeof NavigationMenuPrimitive.Root> {
|
|
8
|
+
viewport?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function NavigationMenu({
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
viewport,
|
|
14
|
+
...props
|
|
15
|
+
}: NavigationMenuProps): JSX.Element;
|
|
16
|
+
type NavigationMenuListProps = ComponentProps<typeof NavigationMenuPrimitive.List>;
|
|
17
|
+
declare function NavigationMenuList({
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: NavigationMenuListProps): JSX.Element;
|
|
22
|
+
type NavigationMenuItemProps = ComponentProps<typeof NavigationMenuPrimitive.Item>;
|
|
23
|
+
declare function NavigationMenuItem({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: NavigationMenuItemProps): JSX.Element;
|
|
27
|
+
type NavigationMenuTriggerProps = ComponentProps<typeof NavigationMenuPrimitive.Trigger>;
|
|
28
|
+
declare function NavigationMenuTrigger({
|
|
29
|
+
children,
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: NavigationMenuTriggerProps): JSX.Element;
|
|
33
|
+
type NavigationMenuContentProps = ComponentProps<typeof NavigationMenuPrimitive.Content>;
|
|
34
|
+
declare function NavigationMenuContent({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: NavigationMenuContentProps): JSX.Element;
|
|
38
|
+
type NavigationMenuLinkProps = ComponentProps<typeof NavigationMenuPrimitive.Link>;
|
|
39
|
+
declare function NavigationMenuLink({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: NavigationMenuLinkProps): JSX.Element;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, navigationMenuTriggerVariants };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { cn, tv } from "../lib/utils.mjs";
|
|
2
|
+
import { buttonVariants } from "./button.mjs";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
6
|
+
//#region src/components/navigation-menu.tsx
|
|
7
|
+
const navigationMenuTriggerVariants = tv({ base: buttonVariants({
|
|
8
|
+
className: "data-open:bg-secondary/50 data-open:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary",
|
|
9
|
+
variant: "ghost"
|
|
10
|
+
}) });
|
|
11
|
+
function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Root, {
|
|
13
|
+
className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
14
|
+
"data-slot": "navigation-menu",
|
|
15
|
+
"data-viewport": viewport,
|
|
16
|
+
...props,
|
|
17
|
+
children: [children, viewport ? /* @__PURE__ */ jsx(NavigationMenuViewport, {}) : null]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function NavigationMenuList({ children, className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(NavigationMenuPrimitive.List, {
|
|
22
|
+
className: cn("flex flex-1 items-center justify-center gap-1", "list-none", className),
|
|
23
|
+
"data-slot": "navigation-menu-list",
|
|
24
|
+
...props,
|
|
25
|
+
children: [children, /* @__PURE__ */ jsx(NavigationMenuIndicator, { className: "invisible" })]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Item, {
|
|
30
|
+
className: cn("group-data-[viewport=false]/navigation-menu:relative", className),
|
|
31
|
+
"data-slot": "navigation-menu-item",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function NavigationMenuTrigger({ children, className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Trigger, {
|
|
37
|
+
className: navigationMenuTriggerVariants({ className }),
|
|
38
|
+
"data-slot": "navigation-menu-trigger",
|
|
39
|
+
...props,
|
|
40
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
className: cn("relative top-px", "ml-1 size-3", "transition duration-300", "group-data-open/navigation-menu-trigger:rotate-180")
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Content, {
|
|
48
|
+
className: cn("top-0 left-0", "w-full", "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-2 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:p-1 group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow", "group-data-[viewport=true]/navigation-menu:p-2", "data-[motion=from-end]:slide-in-from-right-52", "data-[motion=from-start]:slide-in-from-left-52", "data-[motion=to-end]:slide-out-to-right-52", "data-[motion=to-start]:slide-out-to-left-52", "ease-ui data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in-0", "data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0", "md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95", "group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95", className),
|
|
49
|
+
"data-slot": "navigation-menu-content",
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Link, {
|
|
55
|
+
className: cn("flex flex-col gap-1", "p-2", "rounded-sm outline-hidden", "text-sm", "transition", "hover:bg-accent hover:text-accent-foreground", "focus:bg-accent focus:text-accent-foreground", "data-active:bg-accent/50 data-active:text-accent-foreground", "data-active:hover:bg-accent", "data-active:focus:bg-accent", "data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "[&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
56
|
+
"data-slot": "navigation-menu-link",
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: cn("absolute top-full left-0 z-30 flex justify-center", "perspective-distant"),
|
|
63
|
+
children: /* @__PURE__ */ jsx(NavigationMenuPrimitive.Viewport, {
|
|
64
|
+
className: cn("relative", "mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full overflow-hidden", "rounded-lg border", "bg-popover text-popover-foreground shadow-lg", "transition-[width,height] ease-ui", "sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]", "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-90", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "origin-[top_center]", className),
|
|
65
|
+
"data-slot": "navigation-menu-viewport",
|
|
66
|
+
...props
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Indicator, {
|
|
72
|
+
className: cn("top-full z-10 flex h-2 items-center justify-center overflow-hidden", "ease-ui data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0", "data-[state=visible]:animate-in data-[state=visible]:fade-in-0", className),
|
|
73
|
+
"data-slot": "navigation-menu-indicator",
|
|
74
|
+
...props,
|
|
75
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("relative top-[60%]", "size-2.5", "rounded-tl-xs", "bg-popover text-popover-foreground", "rotate-45") })
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerVariants };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
import { buttonVariants } from "./button.mjs";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/pagination.d.ts
|
|
6
|
+
type PaginationProps = ComponentProps<"nav">;
|
|
7
|
+
declare function Pagination({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: PaginationProps): JSX.Element;
|
|
11
|
+
type PaginationContentProps = ComponentProps<"ul">;
|
|
12
|
+
declare function PaginationContent({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: PaginationContentProps): JSX.Element;
|
|
16
|
+
type PaginationItemProps = ComponentProps<"li">;
|
|
17
|
+
declare function PaginationItem(props: PaginationItemProps): JSX.Element;
|
|
18
|
+
interface PaginationLinkProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
19
|
+
isActive?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare function PaginationLink({
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
isActive,
|
|
25
|
+
size,
|
|
26
|
+
...props
|
|
27
|
+
}: PaginationLinkProps): JSX.Element;
|
|
28
|
+
interface PaginationPreviousProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
29
|
+
isActive?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare function PaginationPrevious({
|
|
32
|
+
...props
|
|
33
|
+
}: PaginationPreviousProps): JSX.Element;
|
|
34
|
+
interface PaginationNextProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare function PaginationNext({
|
|
38
|
+
...props
|
|
39
|
+
}: PaginationNextProps): JSX.Element;
|
|
40
|
+
type PaginationEllipsisProps = ComponentProps<"span">;
|
|
41
|
+
declare function PaginationEllipsis({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: PaginationEllipsisProps): JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps };
|