@codefast/ui 0.3.10 → 0.3.11-canary.0
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/README.md +277 -167
- package/dist/components/accordion.cjs +5 -5
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.cjs +9 -9
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.cjs +5 -5
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.cjs +3 -3
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.cjs +7 -7
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.cjs +6 -8
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.cjs +8 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.cjs +17 -17
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.cjs +35 -35
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.cjs +7 -7
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.cjs +20 -20
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.cjs +42 -42
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.cjs +2 -2
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.cjs +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.cjs +10 -10
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.cjs +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.cjs +12 -12
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.cjs +9 -9
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.cjs +10 -10
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.cjs +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.cjs +17 -17
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.cjs +8 -8
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.cjs +3 -3
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.cjs +20 -20
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.cjs +7 -7
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.cjs +4 -4
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.cjs +6 -6
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.cjs +4 -4
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.cjs +23 -23
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.cjs +2 -2
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.cjs +13 -13
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.cjs +2 -2
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.cjs +10 -10
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.cjs +6 -6
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.cjs +3 -3
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.cjs +22 -22
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.cjs +2 -2
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.cjs +3 -3
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.cjs +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.cjs +3 -3
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.cjs +31 -31
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.cjs +9 -9
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.cjs +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.cjs +17 -17
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.cjs +65 -65
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.cjs +4 -4
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.cjs +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.cjs +5 -5
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.cjs +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.cjs +8 -8
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.cjs +4 -4
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.cjs +5 -5
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.cjs +8 -8
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.cjs +2 -2
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.cjs +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.cjs +3 -3
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.cjs +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.cjs +3 -3
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.cjs +46 -46
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.cjs +7 -7
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.cjs +8 -8
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +38 -42
|
@@ -77,7 +77,7 @@ function ContextMenuRadioGroup({ ...props }) {
|
|
|
77
77
|
}
|
|
78
78
|
function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
79
79
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_context_menu_namespaceObject.SubTrigger, {
|
|
80
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
80
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
81
81
|
"data-inset": inset,
|
|
82
82
|
"data-slot": "context-menu-sub-trigger",
|
|
83
83
|
...props,
|
|
@@ -92,7 +92,7 @@ function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
|
92
92
|
function ContextMenuSubContent({ className, ...props }) {
|
|
93
93
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Portal, {
|
|
94
94
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.SubContent, {
|
|
95
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
95
|
+
className: (0, tailwind_variants_namespaceObject.cn)("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
96
96
|
"data-slot": "context-menu-sub-content",
|
|
97
97
|
...props
|
|
98
98
|
})
|
|
@@ -101,7 +101,7 @@ function ContextMenuSubContent({ className, ...props }) {
|
|
|
101
101
|
function ContextMenuContent({ className, ...props }) {
|
|
102
102
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Portal, {
|
|
103
103
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Content, {
|
|
104
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
104
|
+
className: (0, tailwind_variants_namespaceObject.cn)("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
105
105
|
"data-slot": "context-menu-content",
|
|
106
106
|
...props
|
|
107
107
|
})
|
|
@@ -109,7 +109,7 @@ function ContextMenuContent({ className, ...props }) {
|
|
|
109
109
|
}
|
|
110
110
|
function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
111
111
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Item, {
|
|
112
|
-
className: (0, tailwind_variants_namespaceObject.cn)("focus:bg-accent focus:text-accent-foreground
|
|
112
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/context-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden 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 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
|
|
113
113
|
"data-inset": inset,
|
|
114
114
|
"data-slot": "context-menu-item",
|
|
115
115
|
"data-variant": variant,
|
|
@@ -119,7 +119,7 @@ function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
|
119
119
|
function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
120
120
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_context_menu_namespaceObject.CheckboxItem, {
|
|
121
121
|
checked: checked,
|
|
122
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
122
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/context-menu-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 focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
123
123
|
"data-slot": "context-menu-checkbox-item",
|
|
124
124
|
...props,
|
|
125
125
|
children: [
|
|
@@ -137,7 +137,7 @@ function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
137
137
|
}
|
|
138
138
|
function ContextMenuRadioItem({ children, className, ...props }) {
|
|
139
139
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_context_menu_namespaceObject.RadioItem, {
|
|
140
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
140
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/context-menu-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 focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
141
141
|
"data-slot": "context-menu-radio-item",
|
|
142
142
|
...props,
|
|
143
143
|
children: [
|
|
@@ -155,7 +155,7 @@ function ContextMenuRadioItem({ children, className, ...props }) {
|
|
|
155
155
|
}
|
|
156
156
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
157
157
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Label, {
|
|
158
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
158
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
159
159
|
"data-inset": inset,
|
|
160
160
|
"data-slot": "context-menu-label",
|
|
161
161
|
...props
|
|
@@ -163,21 +163,21 @@ function ContextMenuLabel({ className, inset, ...props }) {
|
|
|
163
163
|
}
|
|
164
164
|
function ContextMenuSeparator({ className, ...props }) {
|
|
165
165
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Separator, {
|
|
166
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
166
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mx-2 my-1 h-px bg-border", className),
|
|
167
167
|
"data-slot": "context-menu-separator",
|
|
168
168
|
...props
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
function ContextMenuShortcut({ className, ...props }) {
|
|
172
172
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
173
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
173
|
+
className: (0, tailwind_variants_namespaceObject.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/context-menu-item:text-destructive/80", className),
|
|
174
174
|
"data-slot": "context-menu-shortcut",
|
|
175
175
|
...props
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
function ContextMenuArrow({ className, ...props }) {
|
|
179
179
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_context_menu_namespaceObject.Arrow, {
|
|
180
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
180
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fill-popover", className),
|
|
181
181
|
"data-slot": "context-menu-arrow",
|
|
182
182
|
...props
|
|
183
183
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as ContextMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
3
3
|
type ContextMenuProps = ComponentProps<typeof ContextMenuPrimitive.Root>;
|
|
4
4
|
declare function ContextMenu({ ...props }: ContextMenuProps): JSX.Element;
|
|
5
5
|
type ContextMenuTriggerProps = ComponentProps<typeof ContextMenuPrimitive.Trigger>;
|
|
@@ -20,7 +20,7 @@ type ContextMenuContentProps = ComponentProps<typeof ContextMenuPrimitive.Conten
|
|
|
20
20
|
declare function ContextMenuContent({ className, ...props }: ContextMenuContentProps): JSX.Element;
|
|
21
21
|
interface ContextMenuItemProps extends ComponentProps<typeof ContextMenuPrimitive.Item> {
|
|
22
22
|
inset?: boolean;
|
|
23
|
-
variant?:
|
|
23
|
+
variant?: "default" | "destructive";
|
|
24
24
|
}
|
|
25
25
|
declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenuItemProps): JSX.Element;
|
|
26
26
|
type ContextMenuCheckboxItemProps = ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>;
|
|
@@ -33,7 +33,7 @@ interface ContextMenuLabelProps extends ComponentProps<typeof ContextMenuPrimiti
|
|
|
33
33
|
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps): JSX.Element;
|
|
34
34
|
type ContextMenuSeparatorProps = ComponentProps<typeof ContextMenuPrimitive.Separator>;
|
|
35
35
|
declare function ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps): JSX.Element;
|
|
36
|
-
type ContextMenuShortcutProps = ComponentProps<
|
|
36
|
+
type ContextMenuShortcutProps = ComponentProps<"span">;
|
|
37
37
|
declare function ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): JSX.Element;
|
|
38
38
|
type ContextMenuArrowProps = ComponentProps<typeof ContextMenuPrimitive.Arrow>;
|
|
39
39
|
declare function ContextMenuArrow({ className, ...props }: ContextMenuArrowProps): JSX.Element;
|
|
@@ -35,7 +35,7 @@ function ContextMenuRadioGroup({ ...props }) {
|
|
|
35
35
|
}
|
|
36
36
|
function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsxs(SubTrigger, {
|
|
38
|
-
className: cn("
|
|
38
|
+
className: cn("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
39
39
|
"data-inset": inset,
|
|
40
40
|
"data-slot": "context-menu-sub-trigger",
|
|
41
41
|
...props,
|
|
@@ -50,7 +50,7 @@ function ContextMenuSubTrigger({ children, className, inset, ...props }) {
|
|
|
50
50
|
function ContextMenuSubContent({ className, ...props }) {
|
|
51
51
|
return /*#__PURE__*/ jsx(Portal, {
|
|
52
52
|
children: /*#__PURE__*/ jsx(SubContent, {
|
|
53
|
-
className: cn(
|
|
53
|
+
className: cn("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
54
54
|
"data-slot": "context-menu-sub-content",
|
|
55
55
|
...props
|
|
56
56
|
})
|
|
@@ -59,7 +59,7 @@ function ContextMenuSubContent({ className, ...props }) {
|
|
|
59
59
|
function ContextMenuContent({ className, ...props }) {
|
|
60
60
|
return /*#__PURE__*/ jsx(Portal, {
|
|
61
61
|
children: /*#__PURE__*/ jsx(Content, {
|
|
62
|
-
className: cn(
|
|
62
|
+
className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
63
63
|
"data-slot": "context-menu-content",
|
|
64
64
|
...props
|
|
65
65
|
})
|
|
@@ -67,7 +67,7 @@ function ContextMenuContent({ className, ...props }) {
|
|
|
67
67
|
}
|
|
68
68
|
function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Item, {
|
|
70
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
70
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden 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 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
|
|
71
71
|
"data-inset": inset,
|
|
72
72
|
"data-slot": "context-menu-item",
|
|
73
73
|
"data-variant": variant,
|
|
@@ -77,7 +77,7 @@ function ContextMenuItem({ className, inset, variant, ...props }) {
|
|
|
77
77
|
function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
78
78
|
return /*#__PURE__*/ jsxs(CheckboxItem, {
|
|
79
79
|
checked: checked,
|
|
80
|
-
className: cn("
|
|
80
|
+
className: cn("group/context-menu-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 focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
81
81
|
"data-slot": "context-menu-checkbox-item",
|
|
82
82
|
...props,
|
|
83
83
|
children: [
|
|
@@ -95,7 +95,7 @@ function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
95
95
|
}
|
|
96
96
|
function ContextMenuRadioItem({ children, className, ...props }) {
|
|
97
97
|
return /*#__PURE__*/ jsxs(RadioItem, {
|
|
98
|
-
className: cn("
|
|
98
|
+
className: cn("group/context-menu-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 focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
99
99
|
"data-slot": "context-menu-radio-item",
|
|
100
100
|
...props,
|
|
101
101
|
children: [
|
|
@@ -113,7 +113,7 @@ function ContextMenuRadioItem({ children, className, ...props }) {
|
|
|
113
113
|
}
|
|
114
114
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
115
115
|
return /*#__PURE__*/ jsx(Label, {
|
|
116
|
-
className: cn(
|
|
116
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
117
117
|
"data-inset": inset,
|
|
118
118
|
"data-slot": "context-menu-label",
|
|
119
119
|
...props
|
|
@@ -121,21 +121,21 @@ function ContextMenuLabel({ className, inset, ...props }) {
|
|
|
121
121
|
}
|
|
122
122
|
function ContextMenuSeparator({ className, ...props }) {
|
|
123
123
|
return /*#__PURE__*/ jsx(Separator, {
|
|
124
|
-
className: cn(
|
|
124
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
125
125
|
"data-slot": "context-menu-separator",
|
|
126
126
|
...props
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
function ContextMenuShortcut({ className, ...props }) {
|
|
130
130
|
return /*#__PURE__*/ jsx("span", {
|
|
131
|
-
className: cn(
|
|
131
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/context-menu-item:text-destructive/80", className),
|
|
132
132
|
"data-slot": "context-menu-shortcut",
|
|
133
133
|
...props
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
function ContextMenuArrow({ className, ...props }) {
|
|
137
137
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
138
|
-
className: cn(
|
|
138
|
+
className: cn("fill-popover", className),
|
|
139
139
|
"data-slot": "context-menu-arrow",
|
|
140
140
|
...props
|
|
141
141
|
});
|
|
@@ -56,26 +56,26 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
56
56
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Portal, {
|
|
57
57
|
children: [
|
|
58
58
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Overlay, {
|
|
59
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
59
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
|
|
60
60
|
"data-slot": "dialog-overlay"
|
|
61
61
|
}),
|
|
62
62
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Content, {
|
|
63
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
63
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto ease-ui data-[state=closed]:animate-out data-[state=open]:animate-in max-sm:data-[state=closed]:animation-duration-500 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:animation-duration-500 max-sm:data-[state=open]:slide-in-from-bottom sm:grid-rows-[1fr_auto_3fr] sm:p-4 sm:data-[state=closed]:fade-out-0 sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:fade-in-0 sm:data-[state=open]:zoom-in-95", classNames?.wrapper),
|
|
64
64
|
"data-slot": "dialog-content-wrapper",
|
|
65
65
|
...props,
|
|
66
66
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
67
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
67
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative row-start-2 flex w-full flex-col rounded-t-2xl border bg-popover text-popover-foreground shadow-lg sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
|
|
68
68
|
"data-slot": "dialog-content",
|
|
69
69
|
children: [
|
|
70
70
|
children,
|
|
71
71
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Close, {
|
|
72
72
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
73
73
|
className: [
|
|
74
|
-
|
|
74
|
+
"absolute top-2.5 right-2.5 size-7",
|
|
75
75
|
classNames?.close
|
|
76
76
|
],
|
|
77
|
-
size:
|
|
78
|
-
variant:
|
|
77
|
+
size: "icon",
|
|
78
|
+
variant: "ghost"
|
|
79
79
|
}),
|
|
80
80
|
"data-slot": "dialog-close",
|
|
81
81
|
children: [
|
|
@@ -96,40 +96,40 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
96
96
|
}
|
|
97
97
|
function DialogHeader({ className, ...props }) {
|
|
98
98
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("header", {
|
|
99
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
99
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center sm:text-left", className),
|
|
100
100
|
"data-slot": "dialog-header",
|
|
101
101
|
...props
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
function DialogBody({ className, ...props }) {
|
|
105
105
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
106
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
106
|
+
className: (0, tailwind_variants_namespaceObject.cn)("overflow-auto px-6 py-2", className),
|
|
107
107
|
"data-slot": "dialog-body",
|
|
108
108
|
...props
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
function DialogFooter({ className, ...props }) {
|
|
112
112
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("footer", {
|
|
113
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
113
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6 sm:flex-row sm:justify-end", className),
|
|
114
114
|
"data-slot": "dialog-footer",
|
|
115
115
|
...props
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
function DialogTitle({ className, ...props }) {
|
|
119
119
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Title, {
|
|
120
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
120
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-lg leading-none font-semibold tracking-tight", className),
|
|
121
121
|
"data-slot": "dialog-title",
|
|
122
122
|
...props
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
function DialogDescription({ className, ...props }) {
|
|
126
126
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Description, {
|
|
127
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
127
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm text-muted-foreground", className),
|
|
128
128
|
"data-slot": "dialog-description",
|
|
129
129
|
...props
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function DialogClose({ className, size, variant =
|
|
132
|
+
function DialogClose({ className, size, variant = "outline", ...props }) {
|
|
133
133
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Close, {
|
|
134
134
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
135
135
|
className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as DialogPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type DialogProps = ComponentProps<typeof DialogPrimitive.Root>;
|
|
6
6
|
declare function Dialog({ ...props }: DialogProps): JSX.Element;
|
|
7
7
|
type DialogTriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
@@ -15,19 +15,19 @@ interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Conte
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
declare function DialogContent({ children, className, classNames, ...props }: DialogContentProps): JSX.Element;
|
|
18
|
-
type DialogHeaderProps = ComponentProps<
|
|
18
|
+
type DialogHeaderProps = ComponentProps<"div">;
|
|
19
19
|
declare function DialogHeader({ className, ...props }: DialogHeaderProps): JSX.Element;
|
|
20
|
-
type DialogBodyProps = ComponentProps<
|
|
20
|
+
type DialogBodyProps = ComponentProps<"div">;
|
|
21
21
|
declare function DialogBody({ className, ...props }: DialogBodyProps): JSX.Element;
|
|
22
|
-
type DialogFooterProps = ComponentProps<
|
|
22
|
+
type DialogFooterProps = ComponentProps<"div">;
|
|
23
23
|
declare function DialogFooter({ className, ...props }: DialogFooterProps): JSX.Element;
|
|
24
24
|
type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
|
|
25
25
|
declare function DialogTitle({ className, ...props }: DialogTitleProps): JSX.Element;
|
|
26
26
|
type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
27
27
|
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): JSX.Element;
|
|
28
|
-
interface DialogCloseProps extends Omit<ComponentProps<typeof DialogPrimitive.Close>,
|
|
29
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
30
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
28
|
+
interface DialogCloseProps extends Omit<ComponentProps<typeof DialogPrimitive.Close>, "ref"> {
|
|
29
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
30
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
31
31
|
}
|
|
32
32
|
declare function DialogClose({ className, size, variant, ...props }: DialogCloseProps): JSX.Element;
|
|
33
33
|
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
|
|
@@ -20,26 +20,26 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
20
20
|
return /*#__PURE__*/ jsxs(Portal, {
|
|
21
21
|
children: [
|
|
22
22
|
/*#__PURE__*/ jsx(Overlay, {
|
|
23
|
-
className: cn(
|
|
23
|
+
className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
|
|
24
24
|
"data-slot": "dialog-overlay"
|
|
25
25
|
}),
|
|
26
26
|
/*#__PURE__*/ jsx(Content, {
|
|
27
|
-
className: cn(
|
|
27
|
+
className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto ease-ui data-[state=closed]:animate-out data-[state=open]:animate-in max-sm:data-[state=closed]:animation-duration-500 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:animation-duration-500 max-sm:data-[state=open]:slide-in-from-bottom sm:grid-rows-[1fr_auto_3fr] sm:p-4 sm:data-[state=closed]:fade-out-0 sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:fade-in-0 sm:data-[state=open]:zoom-in-95", classNames?.wrapper),
|
|
28
28
|
"data-slot": "dialog-content-wrapper",
|
|
29
29
|
...props,
|
|
30
30
|
children: /*#__PURE__*/ jsxs("div", {
|
|
31
|
-
className: cn(
|
|
31
|
+
className: cn("relative row-start-2 flex w-full flex-col rounded-t-2xl border bg-popover text-popover-foreground shadow-lg sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
|
|
32
32
|
"data-slot": "dialog-content",
|
|
33
33
|
children: [
|
|
34
34
|
children,
|
|
35
35
|
/*#__PURE__*/ jsxs(Close, {
|
|
36
36
|
className: buttonVariants({
|
|
37
37
|
className: [
|
|
38
|
-
|
|
38
|
+
"absolute top-2.5 right-2.5 size-7",
|
|
39
39
|
classNames?.close
|
|
40
40
|
],
|
|
41
|
-
size:
|
|
42
|
-
variant:
|
|
41
|
+
size: "icon",
|
|
42
|
+
variant: "ghost"
|
|
43
43
|
}),
|
|
44
44
|
"data-slot": "dialog-close",
|
|
45
45
|
children: [
|
|
@@ -60,40 +60,40 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
60
60
|
}
|
|
61
61
|
function DialogHeader({ className, ...props }) {
|
|
62
62
|
return /*#__PURE__*/ jsx("header", {
|
|
63
|
-
className: cn(
|
|
63
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center sm:text-left", className),
|
|
64
64
|
"data-slot": "dialog-header",
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function DialogBody({ className, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx("main", {
|
|
70
|
-
className: cn(
|
|
70
|
+
className: cn("overflow-auto px-6 py-2", className),
|
|
71
71
|
"data-slot": "dialog-body",
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function DialogFooter({ className, ...props }) {
|
|
76
76
|
return /*#__PURE__*/ jsx("footer", {
|
|
77
|
-
className: cn(
|
|
77
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6 sm:flex-row sm:justify-end", className),
|
|
78
78
|
"data-slot": "dialog-footer",
|
|
79
79
|
...props
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
function DialogTitle({ className, ...props }) {
|
|
83
83
|
return /*#__PURE__*/ jsx(Title, {
|
|
84
|
-
className: cn(
|
|
84
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
85
85
|
"data-slot": "dialog-title",
|
|
86
86
|
...props
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
function DialogDescription({ className, ...props }) {
|
|
90
90
|
return /*#__PURE__*/ jsx(Description, {
|
|
91
|
-
className: cn(
|
|
91
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
92
92
|
"data-slot": "dialog-description",
|
|
93
93
|
...props
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function DialogClose({ className, size, variant =
|
|
96
|
+
function DialogClose({ className, size, variant = "outline", ...props }) {
|
|
97
97
|
return /*#__PURE__*/ jsx(Close, {
|
|
98
98
|
className: buttonVariants({
|
|
99
99
|
className,
|
|
@@ -56,16 +56,16 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
56
56
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_vaul_namespaceObject.Drawer.Portal, {
|
|
57
57
|
children: [
|
|
58
58
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_vaul_namespaceObject.Drawer.Overlay, {
|
|
59
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
59
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
|
|
60
60
|
"data-slot": "drawer-overlay"
|
|
61
61
|
}),
|
|
62
62
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_vaul_namespaceObject.Drawer.Content, {
|
|
63
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
63
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/drawer-content fixed z-50 flex h-auto flex-col bg-background data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
|
|
64
64
|
"data-slot": "drawer-content",
|
|
65
65
|
...props,
|
|
66
66
|
children: [
|
|
67
67
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
68
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle)
|
|
69
69
|
}),
|
|
70
70
|
children
|
|
71
71
|
]
|
|
@@ -75,40 +75,40 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
75
75
|
}
|
|
76
76
|
function DrawerHeader({ className, ...props }) {
|
|
77
77
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
78
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
78
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-1.5 p-4", className),
|
|
79
79
|
"data-slot": "drawer-header",
|
|
80
80
|
...props
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
function DrawerBody({ className, ...props }) {
|
|
84
84
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
85
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
85
|
+
className: (0, tailwind_variants_namespaceObject.cn)("overflow-auto px-4 py-2", className),
|
|
86
86
|
"data-slot": "drawer-body",
|
|
87
87
|
...props
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
function DrawerFooter({ className, ...props }) {
|
|
91
91
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
92
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
92
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mt-auto flex flex-col gap-2 p-4", className),
|
|
93
93
|
"data-slot": "drawer-footer",
|
|
94
94
|
...props
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
function DrawerTitle({ className, ...props }) {
|
|
98
98
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_vaul_namespaceObject.Drawer.Title, {
|
|
99
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
99
|
+
className: (0, tailwind_variants_namespaceObject.cn)("font-semibold text-foreground", className),
|
|
100
100
|
"data-slot": "drawer-title",
|
|
101
101
|
...props
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
function DrawerDescription({ className, ...props }) {
|
|
105
105
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_vaul_namespaceObject.Drawer.Description, {
|
|
106
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
106
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm text-muted-foreground", className),
|
|
107
107
|
"data-slot": "drawer-description",
|
|
108
108
|
...props
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function DrawerClose({ className, size, variant =
|
|
111
|
+
function DrawerClose({ className, size, variant = "outline", ...props }) {
|
|
112
112
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_vaul_namespaceObject.Drawer.Close, {
|
|
113
113
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
114
114
|
className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Drawer as DrawerPrimitive } from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type DrawerProps = ComponentProps<typeof DrawerPrimitive.Root>;
|
|
6
6
|
declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): JSX.Element;
|
|
7
7
|
type DrawerTriggerProps = ComponentProps<typeof DrawerPrimitive.Trigger>;
|
|
@@ -14,19 +14,19 @@ interface DrawerContentProps extends ComponentProps<typeof DrawerPrimitive.Conte
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
declare function DrawerContent({ children, className, classNames, ...props }: DrawerContentProps): JSX.Element;
|
|
17
|
-
type DrawerHeaderProps = ComponentProps<
|
|
17
|
+
type DrawerHeaderProps = ComponentProps<"div">;
|
|
18
18
|
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): JSX.Element;
|
|
19
|
-
type DrawerBodyProps = ComponentProps<
|
|
19
|
+
type DrawerBodyProps = ComponentProps<"div">;
|
|
20
20
|
declare function DrawerBody({ className, ...props }: DrawerBodyProps): JSX.Element;
|
|
21
|
-
type DrawerFooterProps = ComponentProps<
|
|
21
|
+
type DrawerFooterProps = ComponentProps<"div">;
|
|
22
22
|
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): JSX.Element;
|
|
23
23
|
type DrawerTitleProps = ComponentProps<typeof DrawerPrimitive.Title>;
|
|
24
24
|
declare function DrawerTitle({ className, ...props }: DrawerTitleProps): JSX.Element;
|
|
25
25
|
type DrawerDescriptionProps = ComponentProps<typeof DrawerPrimitive.Description>;
|
|
26
26
|
declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): JSX.Element;
|
|
27
27
|
interface DrawerCloseProps extends ComponentProps<typeof DrawerPrimitive.Close> {
|
|
28
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
29
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
28
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
29
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
30
30
|
}
|
|
31
31
|
declare function DrawerClose({ className, size, variant, ...props }: DrawerCloseProps): JSX.Element;
|
|
32
32
|
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, };
|
|
@@ -20,16 +20,16 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
20
20
|
return /*#__PURE__*/ jsxs(Drawer.Portal, {
|
|
21
21
|
children: [
|
|
22
22
|
/*#__PURE__*/ jsx(Drawer.Overlay, {
|
|
23
|
-
className: cn(
|
|
23
|
+
className: cn("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
|
|
24
24
|
"data-slot": "drawer-overlay"
|
|
25
25
|
}),
|
|
26
26
|
/*#__PURE__*/ jsxs(Drawer.Content, {
|
|
27
|
-
className: cn(
|
|
27
|
+
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
|
|
28
28
|
"data-slot": "drawer-content",
|
|
29
29
|
...props,
|
|
30
30
|
children: [
|
|
31
31
|
/*#__PURE__*/ jsx("div", {
|
|
32
|
-
className: cn(
|
|
32
|
+
className: cn("mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle)
|
|
33
33
|
}),
|
|
34
34
|
children
|
|
35
35
|
]
|
|
@@ -39,40 +39,40 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
function DrawerHeader({ className, ...props }) {
|
|
41
41
|
return /*#__PURE__*/ jsx("div", {
|
|
42
|
-
className: cn(
|
|
42
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
43
43
|
"data-slot": "drawer-header",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function DrawerBody({ className, ...props }) {
|
|
48
48
|
return /*#__PURE__*/ jsx("main", {
|
|
49
|
-
className: cn(
|
|
49
|
+
className: cn("overflow-auto px-4 py-2", className),
|
|
50
50
|
"data-slot": "drawer-body",
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function DrawerFooter({ className, ...props }) {
|
|
55
55
|
return /*#__PURE__*/ jsx("div", {
|
|
56
|
-
className: cn(
|
|
56
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
57
57
|
"data-slot": "drawer-footer",
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function DrawerTitle({ className, ...props }) {
|
|
62
62
|
return /*#__PURE__*/ jsx(Drawer.Title, {
|
|
63
|
-
className: cn(
|
|
63
|
+
className: cn("font-semibold text-foreground", className),
|
|
64
64
|
"data-slot": "drawer-title",
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function DrawerDescription({ className, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Drawer.Description, {
|
|
70
|
-
className: cn(
|
|
70
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
71
71
|
"data-slot": "drawer-description",
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
function DrawerClose({ className, size, variant =
|
|
75
|
+
function DrawerClose({ className, size, variant = "outline", ...props }) {
|
|
76
76
|
return /*#__PURE__*/ jsx(Drawer.Close, {
|
|
77
77
|
className: buttonVariants({
|
|
78
78
|
className,
|