@codefast/ui 0.3.11-canary.1 → 0.3.11
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 +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
|
@@ -1,86 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { Drawer } from "vaul";
|
|
5
2
|
import { buttonVariants } from "./button.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Drawer as Drawer$1 } from "vaul";
|
|
6
|
+
//#region src/components/drawer.tsx
|
|
7
|
+
function Drawer({ shouldScaleBackground = true, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, {
|
|
9
|
+
"data-slot": "drawer",
|
|
10
|
+
shouldScaleBackground,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
12
13
|
}
|
|
13
14
|
function DrawerTrigger({ ...props }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
|
|
16
|
+
"data-slot": "drawer-trigger",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
18
19
|
}
|
|
19
20
|
function DrawerContent({ children, className, classNames, ...props }) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...props,
|
|
30
|
-
children: [
|
|
31
|
-
/*#__PURE__*/ jsx("div", {
|
|
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
|
-
}),
|
|
34
|
-
children
|
|
35
|
-
]
|
|
36
|
-
})
|
|
37
|
-
]
|
|
38
|
-
});
|
|
21
|
+
return /* @__PURE__ */ jsxs(Drawer$1.Portal, { children: [/* @__PURE__ */ jsx(Drawer$1.Overlay, {
|
|
22
|
+
className: cn("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
|
|
23
|
+
"data-slot": "drawer-overlay"
|
|
24
|
+
}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
|
|
25
|
+
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),
|
|
26
|
+
"data-slot": "drawer-content",
|
|
27
|
+
...props,
|
|
28
|
+
children: [/* @__PURE__ */ jsx("div", { 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) }), children]
|
|
29
|
+
})] });
|
|
39
30
|
}
|
|
40
31
|
function DrawerHeader({ className, ...props }) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
34
|
+
"data-slot": "drawer-header",
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
46
37
|
}
|
|
47
38
|
function DrawerBody({ className, ...props }) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
return /* @__PURE__ */ jsx("main", {
|
|
40
|
+
className: cn("overflow-auto px-4 py-2", className),
|
|
41
|
+
"data-slot": "drawer-body",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
53
44
|
}
|
|
54
45
|
function DrawerFooter({ className, ...props }) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
48
|
+
"data-slot": "drawer-footer",
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
60
51
|
}
|
|
61
52
|
function DrawerTitle({ className, ...props }) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
return /* @__PURE__ */ jsx(Drawer$1.Title, {
|
|
54
|
+
className: cn("font-semibold text-foreground", className),
|
|
55
|
+
"data-slot": "drawer-title",
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
67
58
|
}
|
|
68
59
|
function DrawerDescription({ className, ...props }) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
return /* @__PURE__ */ jsx(Drawer$1.Description, {
|
|
61
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
62
|
+
"data-slot": "drawer-description",
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
74
65
|
}
|
|
75
66
|
function DrawerClose({ className, size, variant = "outline", ...props }) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, {
|
|
68
|
+
className: buttonVariants({
|
|
69
|
+
className,
|
|
70
|
+
size,
|
|
71
|
+
variant
|
|
72
|
+
}),
|
|
73
|
+
"data-slot": "drawer-close",
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
85
76
|
}
|
|
86
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
|
@@ -1,41 +1,92 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dropdown-menu.d.ts
|
|
3
5
|
type DropdownMenuProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
4
|
-
declare function DropdownMenu({
|
|
6
|
+
declare function DropdownMenu({
|
|
7
|
+
...props
|
|
8
|
+
}: DropdownMenuProps): JSX.Element;
|
|
5
9
|
type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
6
|
-
declare function DropdownMenuTrigger({
|
|
10
|
+
declare function DropdownMenuTrigger({
|
|
11
|
+
...props
|
|
12
|
+
}: DropdownMenuTriggerProps): JSX.Element;
|
|
7
13
|
type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenuPrimitive.Group>;
|
|
8
|
-
declare function DropdownMenuGroup({
|
|
14
|
+
declare function DropdownMenuGroup({
|
|
15
|
+
...props
|
|
16
|
+
}: DropdownMenuGroupProps): JSX.Element;
|
|
9
17
|
type DropdownMenuSubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub>;
|
|
10
|
-
declare function DropdownMenuSub({
|
|
18
|
+
declare function DropdownMenuSub({
|
|
19
|
+
...props
|
|
20
|
+
}: DropdownMenuSubProps): JSX.Element;
|
|
11
21
|
type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
|
|
12
|
-
declare function DropdownMenuRadioGroup({
|
|
22
|
+
declare function DropdownMenuRadioGroup({
|
|
23
|
+
...props
|
|
24
|
+
}: DropdownMenuRadioGroupProps): JSX.Element;
|
|
13
25
|
interface DropdownMenuSubTriggerProps extends ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> {
|
|
14
|
-
|
|
26
|
+
inset?: boolean;
|
|
15
27
|
}
|
|
16
|
-
declare function DropdownMenuSubTrigger({
|
|
28
|
+
declare function DropdownMenuSubTrigger({
|
|
29
|
+
children,
|
|
30
|
+
className,
|
|
31
|
+
inset,
|
|
32
|
+
...props
|
|
33
|
+
}: DropdownMenuSubTriggerProps): JSX.Element;
|
|
17
34
|
type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
|
|
18
|
-
declare function DropdownMenuSubContent({
|
|
35
|
+
declare function DropdownMenuSubContent({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: DropdownMenuSubContentProps): JSX.Element;
|
|
19
39
|
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content>;
|
|
20
|
-
declare function DropdownMenuContent({
|
|
40
|
+
declare function DropdownMenuContent({
|
|
41
|
+
className,
|
|
42
|
+
sideOffset,
|
|
43
|
+
...props
|
|
44
|
+
}: DropdownMenuContentProps): JSX.Element;
|
|
21
45
|
interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
inset?: boolean;
|
|
47
|
+
variant?: "default" | "destructive";
|
|
24
48
|
}
|
|
25
|
-
declare function DropdownMenuItem({
|
|
49
|
+
declare function DropdownMenuItem({
|
|
50
|
+
className,
|
|
51
|
+
inset,
|
|
52
|
+
variant,
|
|
53
|
+
...props
|
|
54
|
+
}: DropdownMenuItemProps): JSX.Element;
|
|
26
55
|
type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
27
|
-
declare function DropdownMenuCheckboxItem({
|
|
56
|
+
declare function DropdownMenuCheckboxItem({
|
|
57
|
+
checked,
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
|
+
}: DropdownMenuCheckboxItemProps): JSX.Element;
|
|
28
62
|
type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;
|
|
29
|
-
declare function DropdownMenuRadioItem({
|
|
63
|
+
declare function DropdownMenuRadioItem({
|
|
64
|
+
children,
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}: DropdownMenuRadioItemProps): JSX.Element;
|
|
30
68
|
interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenuPrimitive.Label> {
|
|
31
|
-
|
|
69
|
+
inset?: boolean;
|
|
32
70
|
}
|
|
33
|
-
declare function DropdownMenuLabel({
|
|
71
|
+
declare function DropdownMenuLabel({
|
|
72
|
+
className,
|
|
73
|
+
inset,
|
|
74
|
+
...props
|
|
75
|
+
}: DropdownMenuLabelProps): JSX.Element;
|
|
34
76
|
type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
35
|
-
declare function DropdownMenuSeparator({
|
|
77
|
+
declare function DropdownMenuSeparator({
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: DropdownMenuSeparatorProps): JSX.Element;
|
|
36
81
|
type DropdownMenuShortcutProps = ComponentProps<"span">;
|
|
37
|
-
declare function DropdownMenuShortcut({
|
|
82
|
+
declare function DropdownMenuShortcut({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: DropdownMenuShortcutProps): JSX.Element;
|
|
38
86
|
type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenuPrimitive.Arrow>;
|
|
39
|
-
declare function DropdownMenuArrow({
|
|
40
|
-
|
|
41
|
-
|
|
87
|
+
declare function DropdownMenuArrow({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}: DropdownMenuArrowProps): JSX.Element;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -1,146 +1,129 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
5
3
|
import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
6
|
+
//#region src/components/dropdown-menu.tsx
|
|
6
7
|
function DropdownMenu({ ...props }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, {
|
|
9
|
+
"data-slot": "dropdown-menu",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
11
12
|
}
|
|
12
13
|
function DropdownMenuTrigger({ ...props }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, {
|
|
15
|
+
"data-slot": "dropdown-menu-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
19
|
function DropdownMenuGroup({ ...props }) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, {
|
|
21
|
+
"data-slot": "dropdown-menu-group",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
23
24
|
}
|
|
24
25
|
function DropdownMenuSub({ ...props }) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, {
|
|
27
|
+
"data-slot": "dropdown-menu-sub",
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
29
30
|
}
|
|
30
31
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, {
|
|
33
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
35
36
|
}
|
|
36
37
|
function DropdownMenuSubTrigger({ children, className, inset, ...props }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
45
|
-
className: "ml-auto size-4"
|
|
46
|
-
})
|
|
47
|
-
]
|
|
48
|
-
});
|
|
38
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
39
|
+
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),
|
|
40
|
+
"data-inset": inset,
|
|
41
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
42
|
+
...props,
|
|
43
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
44
|
+
});
|
|
49
45
|
}
|
|
50
46
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
|
|
48
|
+
"data-slot": "dropdown-menu-portal",
|
|
49
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
50
|
+
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),
|
|
51
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
52
|
+
...props
|
|
53
|
+
})
|
|
54
|
+
});
|
|
59
55
|
}
|
|
60
56
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
|
|
58
|
+
"data-slot": "dropdown-menu-portal",
|
|
59
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
60
|
+
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),
|
|
61
|
+
"data-slot": "dropdown-menu-content",
|
|
62
|
+
sideOffset,
|
|
63
|
+
...props
|
|
64
|
+
})
|
|
65
|
+
});
|
|
70
66
|
}
|
|
71
67
|
function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
69
|
+
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),
|
|
70
|
+
"data-inset": inset,
|
|
71
|
+
"data-slot": "dropdown-menu-item",
|
|
72
|
+
"data-variant": variant,
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
79
75
|
}
|
|
80
76
|
function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
className: "size-4"
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
}),
|
|
95
|
-
children
|
|
96
|
-
]
|
|
97
|
-
});
|
|
77
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
78
|
+
checked,
|
|
79
|
+
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),
|
|
80
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
81
|
+
...props,
|
|
82
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: "absolute left-2 flex items-center justify-center",
|
|
84
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
85
|
+
}), children]
|
|
86
|
+
});
|
|
98
87
|
}
|
|
99
88
|
function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
className: "size-4 fill-current"
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
}),
|
|
113
|
-
children
|
|
114
|
-
]
|
|
115
|
-
});
|
|
89
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
90
|
+
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),
|
|
91
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
92
|
+
...props,
|
|
93
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "absolute left-2 flex items-center justify-center",
|
|
95
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotIcon, { className: "size-4 fill-current" }) })
|
|
96
|
+
}), children]
|
|
97
|
+
});
|
|
116
98
|
}
|
|
117
99
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
100
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
|
|
101
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
102
|
+
"data-inset": inset,
|
|
103
|
+
"data-slot": "dropdown-menu-label",
|
|
104
|
+
...props
|
|
105
|
+
});
|
|
124
106
|
}
|
|
125
107
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
108
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
|
|
109
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
110
|
+
"data-slot": "dropdown-menu-separator",
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
131
113
|
}
|
|
132
114
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
115
|
+
return /* @__PURE__ */ jsx("span", {
|
|
116
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
|
|
117
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
138
120
|
}
|
|
139
121
|
function DropdownMenuArrow({ className, ...props }) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
122
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Arrow, {
|
|
123
|
+
className: cn("fill-popover", className),
|
|
124
|
+
"data-slot": "dropdown-menu-arrow",
|
|
125
|
+
...props
|
|
126
|
+
});
|
|
145
127
|
}
|
|
128
|
+
//#endregion
|
|
146
129
|
export { DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/empty.d.ts
|
|
6
|
+
declare const emptyMediaVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
7
|
+
variant: {
|
|
8
|
+
default: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
};
|
|
8
11
|
}, Record<string, never>>;
|
|
9
12
|
type EmptyProps = ComponentProps<"div">;
|
|
10
|
-
declare function Empty({
|
|
13
|
+
declare function Empty({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: EmptyProps): JSX.Element;
|
|
11
17
|
type EmptyHeaderProps = ComponentProps<"div">;
|
|
12
|
-
declare function EmptyHeader({
|
|
18
|
+
declare function EmptyHeader({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: EmptyHeaderProps): JSX.Element;
|
|
13
22
|
type EmptyMediaProps = ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
|
|
14
|
-
declare function EmptyMedia({
|
|
23
|
+
declare function EmptyMedia({
|
|
24
|
+
className,
|
|
25
|
+
variant,
|
|
26
|
+
...props
|
|
27
|
+
}: EmptyMediaProps): JSX.Element;
|
|
15
28
|
type EmptyTitleProps = ComponentProps<"div">;
|
|
16
|
-
declare function EmptyTitle({
|
|
29
|
+
declare function EmptyTitle({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: EmptyTitleProps): JSX.Element;
|
|
17
33
|
type EmptyDescriptionProps = ComponentProps<"p">;
|
|
18
|
-
declare function EmptyDescription({
|
|
34
|
+
declare function EmptyDescription({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: EmptyDescriptionProps): JSX.Element;
|
|
19
38
|
type EmptyContentProps = ComponentProps<"div">;
|
|
20
|
-
declare function EmptyContent({
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
declare function EmptyContent({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: EmptyContentProps): JSX.Element;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps, emptyMediaVariants };
|