@codefast/ui 0.3.9 → 0.3.10
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 +11 -0
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +126 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +74 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +12 -19
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +9 -9
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +8 -8
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +10 -12
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +10 -12
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +18 -1
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +8 -12
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +130 -131
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +385 -38
|
@@ -1,2 +1,154 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger } from "@radix-ui/react-menubar";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
|
|
6
|
+
function Menubar({ className, ...props }) {
|
|
7
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
8
|
+
className: cn('bg-background flex items-center space-x-1 rounded-lg border p-1', className),
|
|
9
|
+
"data-slot": "menubar",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function MenubarMenu({ ...props }) {
|
|
14
|
+
return /*#__PURE__*/ jsx(Menu, {
|
|
15
|
+
"data-slot": "menubar-menu",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function MenubarGroup({ ...props }) {
|
|
20
|
+
return /*#__PURE__*/ jsx(Group, {
|
|
21
|
+
"data-slot": "menubar-group",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function MenubarSub({ ...props }) {
|
|
26
|
+
return /*#__PURE__*/ jsx(Sub, {
|
|
27
|
+
"data-slot": "menubar-sub",
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function MenubarRadioGroup({ ...props }) {
|
|
32
|
+
return /*#__PURE__*/ jsx(RadioGroup, {
|
|
33
|
+
"data-slot": "menubar-radio-group",
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function MenubarTrigger({ className, ...props }) {
|
|
38
|
+
return /*#__PURE__*/ jsx(Trigger, {
|
|
39
|
+
className: cn('focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm font-medium outline-hidden select-none', className),
|
|
40
|
+
"data-slot": "menubar-trigger",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function MenubarSubTrigger({ children, className, inset, ...props }) {
|
|
45
|
+
return /*#__PURE__*/ jsxs(SubTrigger, {
|
|
46
|
+
className: cn('focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8', className),
|
|
47
|
+
"data-inset": inset,
|
|
48
|
+
"data-slot": "menubar-sub-trigger",
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
children,
|
|
52
|
+
/*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
53
|
+
className: "ml-auto size-4"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function MenubarSubContent({ className, ...props }) {
|
|
59
|
+
return /*#__PURE__*/ jsx(Portal, {
|
|
60
|
+
children: /*#__PURE__*/ jsx(SubContent, {
|
|
61
|
+
className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 ease-ui z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg', className),
|
|
62
|
+
"data-slot": "menubar-sub-content",
|
|
63
|
+
...props
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function MenubarContent({ align = 'start', alignOffset = -4, className, sideOffset = 4, ...props }) {
|
|
68
|
+
return /*#__PURE__*/ jsx(Portal, {
|
|
69
|
+
children: /*#__PURE__*/ jsx(Content, {
|
|
70
|
+
align: align,
|
|
71
|
+
alignOffset: alignOffset,
|
|
72
|
+
className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 ease-ui z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg', className),
|
|
73
|
+
"data-slot": "menubar-content",
|
|
74
|
+
sideOffset: sideOffset,
|
|
75
|
+
...props
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function MenubarItem({ className, inset, variant, ...props }) {
|
|
80
|
+
return /*#__PURE__*/ jsx(Item, {
|
|
81
|
+
className: cn("focus:bg-accent focus:text-accent-foreground group/menubar-item 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:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none aria-disabled:opacity-50 data-inset:pl-8 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
82
|
+
"data-inset": inset,
|
|
83
|
+
"data-slot": "menubar-item",
|
|
84
|
+
"data-variant": variant,
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function MenubarCheckboxItem({ checked, children, className, ...props }) {
|
|
89
|
+
return /*#__PURE__*/ jsxs(CheckboxItem, {
|
|
90
|
+
checked: checked,
|
|
91
|
+
className: cn("focus:bg-accent focus:text-accent-foreground group/menubar-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
92
|
+
"data-slot": "menubar-checkbox-item",
|
|
93
|
+
...props,
|
|
94
|
+
children: [
|
|
95
|
+
/*#__PURE__*/ jsx("span", {
|
|
96
|
+
className: "absolute left-2 flex items-center justify-center",
|
|
97
|
+
children: /*#__PURE__*/ jsx(ItemIndicator, {
|
|
98
|
+
children: /*#__PURE__*/ jsx(CheckIcon, {
|
|
99
|
+
className: "size-4"
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
children
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function MenubarRadioItem({ children, className, ...props }) {
|
|
108
|
+
return /*#__PURE__*/ jsxs(RadioItem, {
|
|
109
|
+
className: cn("focus:bg-accent focus:text-accent-foreground group/menubar-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
110
|
+
"data-slot": "menubar-radio-item",
|
|
111
|
+
...props,
|
|
112
|
+
children: [
|
|
113
|
+
/*#__PURE__*/ jsx("span", {
|
|
114
|
+
className: "absolute left-2 flex items-center justify-center",
|
|
115
|
+
children: /*#__PURE__*/ jsx(ItemIndicator, {
|
|
116
|
+
children: /*#__PURE__*/ jsx(DotIcon, {
|
|
117
|
+
className: "size-4 fill-current"
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
children
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function MenubarLabel({ className, inset, ...props }) {
|
|
126
|
+
return /*#__PURE__*/ jsx(Label, {
|
|
127
|
+
className: cn('flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8', className),
|
|
128
|
+
"data-inset": inset,
|
|
129
|
+
"data-slot": "menubar-label",
|
|
130
|
+
...props
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function MenubarSeparator({ className, ...props }) {
|
|
134
|
+
return /*#__PURE__*/ jsx(Separator, {
|
|
135
|
+
className: cn('bg-border mx-2 my-1 h-px', className),
|
|
136
|
+
"data-slot": "menubar-separator",
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function MenubarShortcut({ className, ...props }) {
|
|
141
|
+
return /*#__PURE__*/ jsx("span", {
|
|
142
|
+
className: cn('text-muted-foreground group-data-[variant=destructive]/menubar-item:text-destructive/80 ml-auto text-xs tracking-widest', className),
|
|
143
|
+
"data-slot": "menubar-shortcut",
|
|
144
|
+
...props
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function MenubarArrow({ className, ...props }) {
|
|
148
|
+
return /*#__PURE__*/ jsx(Arrow, {
|
|
149
|
+
className: cn('fill-popover', className),
|
|
150
|
+
"data-slot": "menubar-arrow",
|
|
151
|
+
...props
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
export { Menubar, MenubarArrow, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger };
|
|
@@ -1 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
NativeSelectOption: ()=>NativeSelectOption,
|
|
28
|
+
NativeSelect: ()=>NativeSelect,
|
|
29
|
+
NativeSelectOptGroup: ()=>NativeSelectOptGroup
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
34
|
+
function NativeSelect({ className, ...props }) {
|
|
35
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
36
|
+
className: "group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
37
|
+
"data-slot": "native-select-wrapper",
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("select", {
|
|
40
|
+
className: (0, tailwind_variants_namespaceObject.cn)('border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-lg border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3', 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive', className),
|
|
41
|
+
"data-slot": "native-select",
|
|
42
|
+
...props
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 opacity-50 select-none",
|
|
47
|
+
"data-slot": "native-select-icon"
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function NativeSelectOption({ ...props }) {
|
|
53
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("option", {
|
|
54
|
+
"data-slot": "native-select-option",
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function NativeSelectOptGroup({ className, ...props }) {
|
|
59
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("optgroup", {
|
|
60
|
+
className: (0, tailwind_variants_namespaceObject.cn)(className),
|
|
61
|
+
"data-slot": "native-select-optgroup",
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.NativeSelect = __webpack_exports__.NativeSelect;
|
|
66
|
+
exports.NativeSelectOptGroup = __webpack_exports__.NativeSelectOptGroup;
|
|
67
|
+
exports.NativeSelectOption = __webpack_exports__.NativeSelectOption;
|
|
68
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
69
|
+
"NativeSelect",
|
|
70
|
+
"NativeSelectOptGroup",
|
|
71
|
+
"NativeSelectOption"
|
|
72
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
73
|
+
Object.defineProperty(exports, '__esModule', {
|
|
74
|
+
value: true
|
|
75
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
type NativeSelectProps = ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
type NativeSelectProps = ComponentProps<'select'>;
|
|
3
3
|
declare function NativeSelect({ className, ...props }: NativeSelectProps): JSX.Element;
|
|
4
|
-
type NativeSelectOptionProps = ComponentProps<
|
|
4
|
+
type NativeSelectOptionProps = ComponentProps<'option'>;
|
|
5
5
|
declare function NativeSelectOption({ ...props }: NativeSelectOptionProps): JSX.Element;
|
|
6
|
-
type NativeSelectOptGroupProps = ComponentProps<
|
|
6
|
+
type NativeSelectOptGroupProps = ComponentProps<'optgroup'>;
|
|
7
7
|
declare function NativeSelectOptGroup({ className, ...props }: NativeSelectOptGroupProps): JSX.Element;
|
|
8
8
|
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
9
9
|
export type { NativeSelectOptGroupProps, NativeSelectOptionProps, NativeSelectProps };
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
function NativeSelect({ className, ...props }) {
|
|
5
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6
|
+
className: "group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
7
|
+
"data-slot": "native-select-wrapper",
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("select", {
|
|
10
|
+
className: cn('border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-lg border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3', 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive', className),
|
|
11
|
+
"data-slot": "native-select",
|
|
12
|
+
...props
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 opacity-50 select-none",
|
|
17
|
+
"data-slot": "native-select-icon"
|
|
18
|
+
})
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function NativeSelectOption({ ...props }) {
|
|
23
|
+
return /*#__PURE__*/ jsx("option", {
|
|
24
|
+
"data-slot": "native-select-option",
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function NativeSelectOptGroup({ className, ...props }) {
|
|
29
|
+
return /*#__PURE__*/ jsx("optgroup", {
|
|
30
|
+
className: cn(className),
|
|
31
|
+
"data-slot": "native-select-optgroup",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -1,2 +1,146 @@
|
|
|
1
|
-
"use
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
NavigationMenu: ()=>NavigationMenu,
|
|
28
|
+
NavigationMenuContent: ()=>NavigationMenuContent,
|
|
29
|
+
NavigationMenuLink: ()=>NavigationMenuLink,
|
|
30
|
+
NavigationMenuList: ()=>NavigationMenuList,
|
|
31
|
+
NavigationMenuTrigger: ()=>NavigationMenuTrigger,
|
|
32
|
+
navigationMenuTriggerVariants: ()=>navigationMenuTriggerVariants,
|
|
33
|
+
NavigationMenuItem: ()=>NavigationMenuItem
|
|
34
|
+
});
|
|
35
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
36
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
37
|
+
const react_navigation_menu_namespaceObject = require("@radix-ui/react-navigation-menu");
|
|
38
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
39
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
40
|
+
const navigationMenuTriggerVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
41
|
+
base: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
42
|
+
className: 'data-[state=open]:bg-secondary/50 data-[state=open]:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary',
|
|
43
|
+
variant: 'ghost'
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
47
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.Root, {
|
|
48
|
+
className: (0, tailwind_variants_namespaceObject.cn)('group/navigation-menu relative flex max-w-max flex-1 items-center justify-center', className),
|
|
49
|
+
"data-slot": "navigation-menu",
|
|
50
|
+
"data-viewport": viewport,
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
children,
|
|
54
|
+
viewport ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NavigationMenuViewport, {}) : null
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function NavigationMenuList({ children, className, ...props }) {
|
|
59
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.List, {
|
|
60
|
+
className: (0, tailwind_variants_namespaceObject.cn)('flex flex-1 list-none items-center justify-center gap-1', className),
|
|
61
|
+
"data-slot": "navigation-menu-list",
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
children,
|
|
65
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NavigationMenuIndicator, {
|
|
66
|
+
className: "invisible"
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
72
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Item, {
|
|
73
|
+
className: (0, tailwind_variants_namespaceObject.cn)('group-data-[viewport=false]/navigation-menu:relative', className),
|
|
74
|
+
"data-slot": "navigation-menu-item",
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function NavigationMenuTrigger({ children, className, ...props }) {
|
|
79
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.Trigger, {
|
|
80
|
+
className: navigationMenuTriggerVariants({
|
|
81
|
+
className
|
|
82
|
+
}),
|
|
83
|
+
"data-slot": "navigation-menu-trigger",
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
children,
|
|
87
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]/navigation-menu-trigger:rotate-180"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
95
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Content, {
|
|
96
|
+
className: (0, tailwind_variants_namespaceObject.cn)('data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 ease-ui 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:p-1 group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=true]/navigation-menu:p-2 md:absolute md:w-auto', className),
|
|
97
|
+
"data-slot": "navigation-menu-content",
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
102
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Link, {
|
|
103
|
+
className: (0, tailwind_variants_namespaceObject.cn)("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm outline-hidden transition [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
104
|
+
"data-slot": "navigation-menu-link",
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
109
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
110
|
+
className: "absolute top-full left-0 z-30 flex justify-center perspective-distant",
|
|
111
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Viewport, {
|
|
112
|
+
className: (0, tailwind_variants_namespaceObject.cn)('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 ease-ui relative mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full origin-[top_center] overflow-hidden rounded-lg border shadow-lg transition-[width,height] sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]', className),
|
|
113
|
+
"data-slot": "navigation-menu-viewport",
|
|
114
|
+
...props
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
119
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Indicator, {
|
|
120
|
+
className: (0, tailwind_variants_namespaceObject.cn)('data-[state=visible]:fade-in-0 ease-ui data-[state=visible]:animate-in data-[state=hidden]:fade-out-0 data-[state=hidden]:animate-out top-full z-10 flex h-2 items-center justify-center overflow-hidden', className),
|
|
121
|
+
"data-slot": "navigation-menu-indicator",
|
|
122
|
+
...props,
|
|
123
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
124
|
+
className: "bg-popover text-popover-foreground relative top-[60%] size-2.5 rotate-45 rounded-tl-xs"
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
exports.NavigationMenu = __webpack_exports__.NavigationMenu;
|
|
129
|
+
exports.NavigationMenuContent = __webpack_exports__.NavigationMenuContent;
|
|
130
|
+
exports.NavigationMenuItem = __webpack_exports__.NavigationMenuItem;
|
|
131
|
+
exports.NavigationMenuLink = __webpack_exports__.NavigationMenuLink;
|
|
132
|
+
exports.NavigationMenuList = __webpack_exports__.NavigationMenuList;
|
|
133
|
+
exports.NavigationMenuTrigger = __webpack_exports__.NavigationMenuTrigger;
|
|
134
|
+
exports.navigationMenuTriggerVariants = __webpack_exports__.navigationMenuTriggerVariants;
|
|
135
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
136
|
+
"NavigationMenu",
|
|
137
|
+
"NavigationMenuContent",
|
|
138
|
+
"NavigationMenuItem",
|
|
139
|
+
"NavigationMenuLink",
|
|
140
|
+
"NavigationMenuList",
|
|
141
|
+
"NavigationMenuTrigger",
|
|
142
|
+
"navigationMenuTriggerVariants"
|
|
143
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
144
|
+
Object.defineProperty(exports, '__esModule', {
|
|
145
|
+
value: true
|
|
146
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as NavigationMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
3
|
declare const navigationMenuTriggerVariants: import("@codefast/tailwind-variants").VariantFunctionType<import("@codefast/tailwind-variants").ConfigurationSchema, Record<string, never>>;
|
|
4
4
|
interface NavigationMenuProps extends ComponentProps<typeof NavigationMenuPrimitive.Root> {
|
|
5
5
|
viewport?: boolean;
|
|
@@ -1,2 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
import{
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, tv } from "@codefast/tailwind-variants";
|
|
3
|
+
import { Content, Indicator, Item, Link, List, Root, Trigger, Viewport } from "@radix-ui/react-navigation-menu";
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
import { buttonVariants } from "./button.js";
|
|
6
|
+
const navigationMenuTriggerVariants = tv({
|
|
7
|
+
base: buttonVariants({
|
|
8
|
+
className: 'data-[state=open]:bg-secondary/50 data-[state=open]:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary',
|
|
9
|
+
variant: 'ghost'
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
13
|
+
return /*#__PURE__*/ jsxs(Root, {
|
|
14
|
+
className: cn('group/navigation-menu relative flex max-w-max flex-1 items-center justify-center', className),
|
|
15
|
+
"data-slot": "navigation-menu",
|
|
16
|
+
"data-viewport": viewport,
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
children,
|
|
20
|
+
viewport ? /*#__PURE__*/ jsx(NavigationMenuViewport, {}) : null
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function NavigationMenuList({ children, className, ...props }) {
|
|
25
|
+
return /*#__PURE__*/ jsxs(List, {
|
|
26
|
+
className: cn('flex flex-1 list-none items-center justify-center gap-1', className),
|
|
27
|
+
"data-slot": "navigation-menu-list",
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
/*#__PURE__*/ jsx(NavigationMenuIndicator, {
|
|
32
|
+
className: "invisible"
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
38
|
+
return /*#__PURE__*/ jsx(Item, {
|
|
39
|
+
className: cn('group-data-[viewport=false]/navigation-menu:relative', className),
|
|
40
|
+
"data-slot": "navigation-menu-item",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function NavigationMenuTrigger({ children, className, ...props }) {
|
|
45
|
+
return /*#__PURE__*/ jsxs(Trigger, {
|
|
46
|
+
className: navigationMenuTriggerVariants({
|
|
47
|
+
className
|
|
48
|
+
}),
|
|
49
|
+
"data-slot": "navigation-menu-trigger",
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
children,
|
|
53
|
+
/*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]/navigation-menu-trigger:rotate-180"
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
61
|
+
return /*#__PURE__*/ jsx(Content, {
|
|
62
|
+
className: cn('data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 ease-ui 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:p-1 group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=true]/navigation-menu:p-2 md:absolute md:w-auto', className),
|
|
63
|
+
"data-slot": "navigation-menu-content",
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
68
|
+
return /*#__PURE__*/ jsx(Link, {
|
|
69
|
+
className: cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm outline-hidden transition [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
70
|
+
"data-slot": "navigation-menu-link",
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
75
|
+
return /*#__PURE__*/ jsx("div", {
|
|
76
|
+
className: "absolute top-full left-0 z-30 flex justify-center perspective-distant",
|
|
77
|
+
children: /*#__PURE__*/ jsx(Viewport, {
|
|
78
|
+
className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 ease-ui relative mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full origin-[top_center] overflow-hidden rounded-lg border shadow-lg transition-[width,height] sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]', className),
|
|
79
|
+
"data-slot": "navigation-menu-viewport",
|
|
80
|
+
...props
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
85
|
+
return /*#__PURE__*/ jsx(Indicator, {
|
|
86
|
+
className: cn('data-[state=visible]:fade-in-0 ease-ui data-[state=visible]:animate-in data-[state=hidden]:fade-out-0 data-[state=hidden]:animate-out top-full z-10 flex h-2 items-center justify-center overflow-hidden', className),
|
|
87
|
+
"data-slot": "navigation-menu-indicator",
|
|
88
|
+
...props,
|
|
89
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
90
|
+
className: "bg-popover text-popover-foreground relative top-[60%] size-2.5 rotate-45 rounded-tl-xs"
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerVariants };
|