@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 DropdownMenuRadioGroup({ ...props }) {
|
|
|
77
77
|
}
|
|
78
78
|
function DropdownMenuSubTrigger({ children, className, inset, ...props }) {
|
|
79
79
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dropdown_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", className),
|
|
81
81
|
"data-inset": inset,
|
|
82
82
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
83
83
|
...props,
|
|
@@ -93,7 +93,7 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
93
93
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Portal, {
|
|
94
94
|
"data-slot": "dropdown-menu-portal",
|
|
95
95
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.SubContent, {
|
|
96
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
96
|
+
className: (0, tailwind_variants_namespaceObject.cn)("z-50 min-w-32 origin-(--radix-dropdown-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),
|
|
97
97
|
"data-slot": "dropdown-menu-sub-content",
|
|
98
98
|
...props
|
|
99
99
|
})
|
|
@@ -103,7 +103,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
103
103
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Portal, {
|
|
104
104
|
"data-slot": "dropdown-menu-portal",
|
|
105
105
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Content, {
|
|
106
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
106
|
+
className: (0, tailwind_variants_namespaceObject.cn)("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-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=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),
|
|
107
107
|
"data-slot": "dropdown-menu-content",
|
|
108
108
|
sideOffset: sideOffset,
|
|
109
109
|
...props
|
|
@@ -112,7 +112,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
112
112
|
}
|
|
113
113
|
function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
114
114
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Item, {
|
|
115
|
-
className: (0, tailwind_variants_namespaceObject.cn)("focus:bg-accent focus:text-accent-foreground
|
|
115
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/dropdown-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),
|
|
116
116
|
"data-inset": inset,
|
|
117
117
|
"data-slot": "dropdown-menu-item",
|
|
118
118
|
"data-variant": variant,
|
|
@@ -122,7 +122,7 @@ function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
|
122
122
|
function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
123
123
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dropdown_menu_namespaceObject.CheckboxItem, {
|
|
124
124
|
checked: checked,
|
|
125
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
125
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/dropdown-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),
|
|
126
126
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
127
127
|
...props,
|
|
128
128
|
children: [
|
|
@@ -140,7 +140,7 @@ function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
140
140
|
}
|
|
141
141
|
function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
142
142
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dropdown_menu_namespaceObject.RadioItem, {
|
|
143
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
143
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/dropdown-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),
|
|
144
144
|
"data-slot": "dropdown-menu-radio-item",
|
|
145
145
|
...props,
|
|
146
146
|
children: [
|
|
@@ -158,7 +158,7 @@ function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
|
158
158
|
}
|
|
159
159
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
160
160
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Label, {
|
|
161
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
161
|
+
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),
|
|
162
162
|
"data-inset": inset,
|
|
163
163
|
"data-slot": "dropdown-menu-label",
|
|
164
164
|
...props
|
|
@@ -166,21 +166,21 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
166
166
|
}
|
|
167
167
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
168
168
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Separator, {
|
|
169
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
169
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mx-2 my-1 h-px bg-border", className),
|
|
170
170
|
"data-slot": "dropdown-menu-separator",
|
|
171
171
|
...props
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
175
175
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
176
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
176
|
+
className: (0, tailwind_variants_namespaceObject.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
|
|
177
177
|
"data-slot": "dropdown-menu-shortcut",
|
|
178
178
|
...props
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
function DropdownMenuArrow({ className, ...props }) {
|
|
182
182
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Arrow, {
|
|
183
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
183
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fill-popover", className),
|
|
184
184
|
"data-slot": "dropdown-menu-arrow",
|
|
185
185
|
...props
|
|
186
186
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as DropdownMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
3
|
type DropdownMenuProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
4
4
|
declare function DropdownMenu({ ...props }: DropdownMenuProps): JSX.Element;
|
|
5
5
|
type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
@@ -20,7 +20,7 @@ type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Cont
|
|
|
20
20
|
declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): JSX.Element;
|
|
21
21
|
interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {
|
|
22
22
|
inset?: boolean;
|
|
23
|
-
variant?:
|
|
23
|
+
variant?: "default" | "destructive";
|
|
24
24
|
}
|
|
25
25
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): JSX.Element;
|
|
26
26
|
type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
@@ -33,7 +33,7 @@ interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenuPrimi
|
|
|
33
33
|
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): JSX.Element;
|
|
34
34
|
type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
35
35
|
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): JSX.Element;
|
|
36
|
-
type DropdownMenuShortcutProps = ComponentProps<
|
|
36
|
+
type DropdownMenuShortcutProps = ComponentProps<"span">;
|
|
37
37
|
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): JSX.Element;
|
|
38
38
|
type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenuPrimitive.Arrow>;
|
|
39
39
|
declare function DropdownMenuArrow({ className, ...props }: DropdownMenuArrowProps): JSX.Element;
|
|
@@ -35,7 +35,7 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
35
35
|
}
|
|
36
36
|
function DropdownMenuSubTrigger({ 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", className),
|
|
39
39
|
"data-inset": inset,
|
|
40
40
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
41
41
|
...props,
|
|
@@ -51,7 +51,7 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
51
51
|
return /*#__PURE__*/ jsx(Portal, {
|
|
52
52
|
"data-slot": "dropdown-menu-portal",
|
|
53
53
|
children: /*#__PURE__*/ jsx(SubContent, {
|
|
54
|
-
className: cn(
|
|
54
|
+
className: cn("z-50 min-w-32 origin-(--radix-dropdown-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),
|
|
55
55
|
"data-slot": "dropdown-menu-sub-content",
|
|
56
56
|
...props
|
|
57
57
|
})
|
|
@@ -61,7 +61,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
61
61
|
return /*#__PURE__*/ jsx(Portal, {
|
|
62
62
|
"data-slot": "dropdown-menu-portal",
|
|
63
63
|
children: /*#__PURE__*/ jsx(Content, {
|
|
64
|
-
className: cn(
|
|
64
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-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=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),
|
|
65
65
|
"data-slot": "dropdown-menu-content",
|
|
66
66
|
sideOffset: sideOffset,
|
|
67
67
|
...props
|
|
@@ -70,7 +70,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
70
70
|
}
|
|
71
71
|
function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
72
72
|
return /*#__PURE__*/ jsx(Item, {
|
|
73
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
73
|
+
className: cn("group/dropdown-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),
|
|
74
74
|
"data-inset": inset,
|
|
75
75
|
"data-slot": "dropdown-menu-item",
|
|
76
76
|
"data-variant": variant,
|
|
@@ -80,7 +80,7 @@ function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
|
80
80
|
function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
81
81
|
return /*#__PURE__*/ jsxs(CheckboxItem, {
|
|
82
82
|
checked: checked,
|
|
83
|
-
className: cn("
|
|
83
|
+
className: cn("group/dropdown-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),
|
|
84
84
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
85
85
|
...props,
|
|
86
86
|
children: [
|
|
@@ -98,7 +98,7 @@ function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
98
98
|
}
|
|
99
99
|
function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
100
100
|
return /*#__PURE__*/ jsxs(RadioItem, {
|
|
101
|
-
className: cn("
|
|
101
|
+
className: cn("group/dropdown-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),
|
|
102
102
|
"data-slot": "dropdown-menu-radio-item",
|
|
103
103
|
...props,
|
|
104
104
|
children: [
|
|
@@ -116,7 +116,7 @@ function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
|
116
116
|
}
|
|
117
117
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
118
118
|
return /*#__PURE__*/ jsx(Label, {
|
|
119
|
-
className: cn(
|
|
119
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
120
120
|
"data-inset": inset,
|
|
121
121
|
"data-slot": "dropdown-menu-label",
|
|
122
122
|
...props
|
|
@@ -124,21 +124,21 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
124
124
|
}
|
|
125
125
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
126
126
|
return /*#__PURE__*/ jsx(Separator, {
|
|
127
|
-
className: cn(
|
|
127
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
128
128
|
"data-slot": "dropdown-menu-separator",
|
|
129
129
|
...props
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
133
133
|
return /*#__PURE__*/ jsx("span", {
|
|
134
|
-
className: cn(
|
|
134
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
|
|
135
135
|
"data-slot": "dropdown-menu-shortcut",
|
|
136
136
|
...props
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
function DropdownMenuArrow({ className, ...props }) {
|
|
140
140
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
141
|
-
className: cn(
|
|
141
|
+
className: cn("fill-popover", className),
|
|
142
142
|
"data-slot": "dropdown-menu-arrow",
|
|
143
143
|
...props
|
|
144
144
|
});
|
|
@@ -35,32 +35,32 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
35
35
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
36
36
|
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
37
37
|
const emptyMediaVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
38
|
-
base:
|
|
38
|
+
base: "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
39
39
|
defaultVariants: {
|
|
40
|
-
variant:
|
|
40
|
+
variant: "default"
|
|
41
41
|
},
|
|
42
42
|
variants: {
|
|
43
43
|
variant: {
|
|
44
|
-
default:
|
|
45
|
-
icon: "
|
|
44
|
+
default: "bg-transparent",
|
|
45
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
function Empty({ className, ...props }) {
|
|
50
50
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
51
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
51
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12", className),
|
|
52
52
|
"data-slot": "empty",
|
|
53
53
|
...props
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
function EmptyHeader({ className, ...props }) {
|
|
57
57
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
58
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
58
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
59
59
|
"data-slot": "empty-header",
|
|
60
60
|
...props
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
function EmptyMedia({ className, variant =
|
|
63
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
64
64
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
65
65
|
className: emptyMediaVariants({
|
|
66
66
|
className,
|
|
@@ -73,21 +73,21 @@ function EmptyMedia({ className, variant = 'default', ...props }) {
|
|
|
73
73
|
}
|
|
74
74
|
function EmptyTitle({ className, ...props }) {
|
|
75
75
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
76
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
76
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-lg font-medium tracking-tight", className),
|
|
77
77
|
"data-slot": "empty-title",
|
|
78
78
|
...props
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
function EmptyDescription({ className, ...props }) {
|
|
82
82
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
83
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
83
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
84
84
|
"data-slot": "empty-description",
|
|
85
85
|
...props
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
function EmptyContent({ className, ...props }) {
|
|
89
89
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
90
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
90
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
91
91
|
"data-slot": "empty-content",
|
|
92
92
|
...props
|
|
93
93
|
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
3
|
declare const emptyMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
variant: {
|
|
5
5
|
default: string;
|
|
6
6
|
icon: string;
|
|
7
7
|
};
|
|
8
8
|
}, Record<string, never>>;
|
|
9
|
-
type EmptyProps = ComponentProps<
|
|
9
|
+
type EmptyProps = ComponentProps<"div">;
|
|
10
10
|
declare function Empty({ className, ...props }: EmptyProps): JSX.Element;
|
|
11
|
-
type EmptyHeaderProps = ComponentProps<
|
|
11
|
+
type EmptyHeaderProps = ComponentProps<"div">;
|
|
12
12
|
declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): JSX.Element;
|
|
13
|
-
type EmptyMediaProps = ComponentProps<
|
|
13
|
+
type EmptyMediaProps = ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
|
|
14
14
|
declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): JSX.Element;
|
|
15
|
-
type EmptyTitleProps = ComponentProps<
|
|
15
|
+
type EmptyTitleProps = ComponentProps<"div">;
|
|
16
16
|
declare function EmptyTitle({ className, ...props }: EmptyTitleProps): JSX.Element;
|
|
17
|
-
type EmptyDescriptionProps = ComponentProps<
|
|
17
|
+
type EmptyDescriptionProps = ComponentProps<"p">;
|
|
18
18
|
declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): JSX.Element;
|
|
19
|
-
type EmptyContentProps = ComponentProps<
|
|
19
|
+
type EmptyContentProps = ComponentProps<"div">;
|
|
20
20
|
declare function EmptyContent({ className, ...props }: EmptyContentProps): JSX.Element;
|
|
21
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle };
|
|
21
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle, };
|
|
22
22
|
export type { EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps, };
|
package/dist/components/empty.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
3
3
|
const emptyMediaVariants = tv({
|
|
4
|
-
base:
|
|
4
|
+
base: "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
5
5
|
defaultVariants: {
|
|
6
|
-
variant:
|
|
6
|
+
variant: "default"
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default:
|
|
11
|
-
icon: "
|
|
10
|
+
default: "bg-transparent",
|
|
11
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
function Empty({ className, ...props }) {
|
|
16
16
|
return /*#__PURE__*/ jsx("div", {
|
|
17
|
-
className: cn(
|
|
17
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12", className),
|
|
18
18
|
"data-slot": "empty",
|
|
19
19
|
...props
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
function EmptyHeader({ className, ...props }) {
|
|
23
23
|
return /*#__PURE__*/ jsx("div", {
|
|
24
|
-
className: cn(
|
|
24
|
+
className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
25
25
|
"data-slot": "empty-header",
|
|
26
26
|
...props
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
function EmptyMedia({ className, variant =
|
|
29
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
30
30
|
return /*#__PURE__*/ jsx("div", {
|
|
31
31
|
className: emptyMediaVariants({
|
|
32
32
|
className,
|
|
@@ -39,21 +39,21 @@ function EmptyMedia({ className, variant = 'default', ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
function EmptyTitle({ className, ...props }) {
|
|
41
41
|
return /*#__PURE__*/ jsx("div", {
|
|
42
|
-
className: cn(
|
|
42
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
43
43
|
"data-slot": "empty-title",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function EmptyDescription({ className, ...props }) {
|
|
48
48
|
return /*#__PURE__*/ jsx("p", {
|
|
49
|
-
className: cn(
|
|
49
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
50
50
|
"data-slot": "empty-description",
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function EmptyContent({ className, ...props }) {
|
|
55
55
|
return /*#__PURE__*/ jsx("div", {
|
|
56
|
-
className: cn(
|
|
56
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
57
57
|
"data-slot": "empty-content",
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
@@ -43,28 +43,28 @@ const external_react_namespaceObject = require("react");
|
|
|
43
43
|
const external_label_cjs_namespaceObject = require("./label.cjs");
|
|
44
44
|
const external_separator_cjs_namespaceObject = require("./separator.cjs");
|
|
45
45
|
const fieldVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
46
|
-
base:
|
|
46
|
+
base: "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
47
47
|
defaultVariants: {
|
|
48
|
-
orientation:
|
|
48
|
+
orientation: "vertical"
|
|
49
49
|
},
|
|
50
50
|
variants: {
|
|
51
51
|
orientation: {
|
|
52
|
-
horizontal: (0, tailwind_variants_namespaceObject.cn)(
|
|
53
|
-
responsive: (0, tailwind_variants_namespaceObject.cn)(
|
|
54
|
-
vertical:
|
|
52
|
+
horizontal: (0, tailwind_variants_namespaceObject.cn)("flex-row items-center", "[&>[data-slot=field-label]]:flex-auto", "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),
|
|
53
|
+
responsive: (0, tailwind_variants_namespaceObject.cn)("flex-col [&>*]:w-full [&>.sr-only]:w-auto", "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto", "@md/field-group:[&>[data-slot=field-label]]:flex-auto", "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),
|
|
54
|
+
vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
function FieldSet({ className, ...props }) {
|
|
59
59
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("fieldset", {
|
|
60
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
60
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
61
61
|
"data-slot": "field-set",
|
|
62
62
|
...props
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function FieldLegend({ className, variant =
|
|
65
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
66
66
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("legend", {
|
|
67
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
67
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mb-3 text-base font-medium", "data-[variant=label]:text-sm", className),
|
|
68
68
|
"data-slot": "field-legend",
|
|
69
69
|
"data-variant": variant,
|
|
70
70
|
...props
|
|
@@ -72,12 +72,12 @@ function FieldLegend({ className, variant = 'legend', ...props }) {
|
|
|
72
72
|
}
|
|
73
73
|
function FieldGroup({ className, ...props }) {
|
|
74
74
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
75
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
75
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className),
|
|
76
76
|
"data-slot": "field-group",
|
|
77
77
|
...props
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
function Field({ className, orientation =
|
|
80
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
81
81
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
82
82
|
className: fieldVariants({
|
|
83
83
|
className,
|
|
@@ -91,28 +91,28 @@ function Field({ className, orientation = 'vertical', ...props }) {
|
|
|
91
91
|
}
|
|
92
92
|
function FieldContent({ className, ...props }) {
|
|
93
93
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
94
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
94
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
95
95
|
"data-slot": "field-content",
|
|
96
96
|
...props
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function FieldLabel({ className, ...props }) {
|
|
100
100
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.Label, {
|
|
101
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
101
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className),
|
|
102
102
|
"data-slot": "field-label",
|
|
103
103
|
...props
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function FieldTitle({ className, ...props }) {
|
|
107
107
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
108
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
108
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
109
109
|
"data-slot": "field-label",
|
|
110
110
|
...props
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
function FieldDescription({ className, ...props }) {
|
|
114
114
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
115
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
115
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
116
116
|
"data-slot": "field-description",
|
|
117
117
|
...props
|
|
118
118
|
});
|
|
@@ -120,7 +120,7 @@ function FieldDescription({ className, ...props }) {
|
|
|
120
120
|
function FieldSeparator({ children, className, ...props }) {
|
|
121
121
|
const hasContent = Boolean(children);
|
|
122
122
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
123
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
123
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
124
124
|
"data-content": hasContent,
|
|
125
125
|
"data-slot": "field-separator",
|
|
126
126
|
...props,
|
|
@@ -129,7 +129,7 @@ function FieldSeparator({ children, className, ...props }) {
|
|
|
129
129
|
className: "absolute inset-0 top-1/2"
|
|
130
130
|
}),
|
|
131
131
|
hasContent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
132
|
-
className: "
|
|
132
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
133
133
|
"data-slot": "field-separator-content",
|
|
134
134
|
children: children
|
|
135
135
|
}) : null
|
|
@@ -158,7 +158,7 @@ function FieldError({ children, className, errors, ...props }) {
|
|
|
158
158
|
const content = children ?? fallbackContent;
|
|
159
159
|
if (null == content || false === content) return null;
|
|
160
160
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
161
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
161
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm font-normal text-destructive", className),
|
|
162
162
|
"data-slot": "field-error",
|
|
163
163
|
role: "alert",
|
|
164
164
|
...props,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Label } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Label } from "./label";
|
|
4
4
|
declare const fieldVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
orientation: {
|
|
6
6
|
horizontal: string;
|
|
@@ -8,32 +8,32 @@ declare const fieldVariants: import("@codefast/tailwind-variants").VariantFuncti
|
|
|
8
8
|
vertical: string;
|
|
9
9
|
};
|
|
10
10
|
}, Record<string, never>>;
|
|
11
|
-
type FieldSetProps = ComponentProps<
|
|
11
|
+
type FieldSetProps = ComponentProps<"fieldset">;
|
|
12
12
|
declare function FieldSet({ className, ...props }: FieldSetProps): JSX.Element;
|
|
13
|
-
type FieldLegendProps = ComponentProps<
|
|
14
|
-
variant?:
|
|
13
|
+
type FieldLegendProps = ComponentProps<"legend"> & {
|
|
14
|
+
variant?: "label" | "legend";
|
|
15
15
|
};
|
|
16
16
|
declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): JSX.Element;
|
|
17
|
-
type FieldGroupProps = ComponentProps<
|
|
17
|
+
type FieldGroupProps = ComponentProps<"div">;
|
|
18
18
|
declare function FieldGroup({ className, ...props }: FieldGroupProps): JSX.Element;
|
|
19
|
-
type FieldProps = ComponentProps<
|
|
19
|
+
type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants>;
|
|
20
20
|
declare function Field({ className, orientation, ...props }: FieldProps): JSX.Element;
|
|
21
|
-
type FieldContentProps = ComponentProps<
|
|
21
|
+
type FieldContentProps = ComponentProps<"div">;
|
|
22
22
|
declare function FieldContent({ className, ...props }: FieldContentProps): JSX.Element;
|
|
23
23
|
type FieldLabelProps = ComponentProps<typeof Label>;
|
|
24
24
|
declare function FieldLabel({ className, ...props }: FieldLabelProps): JSX.Element;
|
|
25
|
-
type FieldTitleProps = ComponentProps<
|
|
25
|
+
type FieldTitleProps = ComponentProps<"div">;
|
|
26
26
|
declare function FieldTitle({ className, ...props }: FieldTitleProps): JSX.Element;
|
|
27
|
-
type FieldDescriptionProps = ComponentProps<
|
|
27
|
+
type FieldDescriptionProps = ComponentProps<"p">;
|
|
28
28
|
declare function FieldDescription({ className, ...props }: FieldDescriptionProps): JSX.Element;
|
|
29
|
-
type FieldSeparatorProps = ComponentProps<
|
|
30
|
-
children?: ComponentProps<
|
|
29
|
+
type FieldSeparatorProps = ComponentProps<"div"> & {
|
|
30
|
+
children?: ComponentProps<"span">["children"];
|
|
31
31
|
};
|
|
32
32
|
declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): JSX.Element;
|
|
33
33
|
interface FieldErrorMessage {
|
|
34
34
|
message?: string;
|
|
35
35
|
}
|
|
36
|
-
interface FieldErrorProps extends ComponentProps<
|
|
36
|
+
interface FieldErrorProps extends ComponentProps<"div"> {
|
|
37
37
|
errors?: (FieldErrorMessage | undefined)[];
|
|
38
38
|
}
|
|
39
39
|
declare function FieldError({ children, className, errors, ...props }: FieldErrorProps): JSX.Element | null;
|