@codefast/ui 0.3.16-canary.2 → 0.4.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +28 -17
- package/dist/components/accordion.d.mts +7 -22
- package/dist/components/accordion.mjs +26 -29
- package/dist/components/alert-dialog.d.mts +27 -26
- package/dist/components/alert-dialog.mjs +53 -45
- package/dist/components/alert.d.mts +14 -14
- package/dist/components/alert.mjs +17 -28
- package/dist/components/aspect-ratio.d.mts +2 -2
- package/dist/components/aspect-ratio.mjs +2 -3
- package/dist/components/avatar.d.mts +41 -5
- package/dist/components/avatar.mjs +40 -10
- package/dist/components/badge.d.mts +3 -15
- package/dist/components/badge.mjs +6 -48
- package/dist/components/breadcrumb.d.mts +1 -0
- package/dist/components/breadcrumb.mjs +11 -10
- package/dist/components/button-group.d.mts +3 -13
- package/dist/components/button-group.mjs +9 -31
- package/dist/components/button.d.mts +3 -26
- package/dist/components/button.mjs +9 -79
- package/dist/components/calendar.d.mts +6 -2
- package/dist/components/calendar.mjs +41 -44
- package/dist/components/card.d.mts +4 -2
- package/dist/components/card.mjs +9 -9
- package/dist/components/carousel.d.mts +16 -5
- package/dist/components/carousel.mjs +24 -11
- package/dist/components/chart.d.mts +9 -6
- package/dist/components/chart.mjs +21 -15
- package/dist/components/checkbox-cards.mjs +4 -4
- package/dist/components/checkbox-group.mjs +3 -4
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/checkbox.mjs +6 -7
- package/dist/components/collapsible.d.mts +4 -4
- package/dist/components/collapsible.mjs +4 -5
- package/dist/components/command.d.mts +11 -1
- package/dist/components/command.mjs +35 -32
- package/dist/components/context-menu.d.mts +22 -15
- package/dist/components/context-menu.mjs +44 -39
- package/dist/components/dialog.d.mts +19 -23
- package/dist/components/dialog.mjs +48 -47
- package/dist/components/direction.d.mts +24 -0
- package/dist/components/direction.mjs +18 -0
- package/dist/components/drawer.d.mts +3 -21
- package/dist/components/drawer.mjs +19 -27
- package/dist/components/dropdown-menu.d.mts +22 -15
- package/dist/components/dropdown-menu.mjs +41 -37
- package/dist/components/empty.d.mts +3 -13
- package/dist/components/empty.mjs +8 -23
- package/dist/components/field.d.mts +3 -14
- package/dist/components/field.mjs +14 -44
- package/dist/components/form.d.mts +7 -10
- package/dist/components/form.mjs +6 -7
- package/dist/components/hover-card.d.mts +5 -5
- package/dist/components/hover-card.mjs +14 -12
- package/dist/components/input-group.d.mts +4 -31
- package/dist/components/input-group.mjs +14 -96
- package/dist/components/input-number.d.mts +3 -1
- package/dist/components/input-number.mjs +50 -28
- package/dist/components/input-otp.mjs +9 -7
- package/dist/components/input-password.mjs +1 -4
- package/dist/components/input-search.mjs +3 -5
- package/dist/components/input.mjs +1 -2
- package/dist/components/item.d.mts +4 -29
- package/dist/components/item.mjs +12 -65
- package/dist/components/kbd.mjs +1 -1
- package/dist/components/label.d.mts +2 -2
- package/dist/components/label.mjs +3 -4
- package/dist/components/menubar.d.mts +22 -16
- package/dist/components/menubar.mjs +54 -47
- package/dist/components/native-select.d.mts +5 -1
- package/dist/components/native-select.mjs +9 -6
- package/dist/components/navigation-menu.d.mts +30 -13
- package/dist/components/navigation-menu.mjs +35 -32
- package/dist/components/pagination.d.mts +7 -1
- package/dist/components/pagination.mjs +27 -12
- package/dist/components/popover.d.mts +40 -7
- package/dist/components/popover.mjs +46 -14
- package/dist/components/progress-circle.d.mts +3 -47
- package/dist/components/progress-circle.mjs +2 -48
- package/dist/components/progress.d.mts +2 -2
- package/dist/components/progress.mjs +5 -6
- package/dist/components/radio-cards.d.mts +3 -3
- package/dist/components/radio-cards.mjs +11 -11
- package/dist/components/radio-group.d.mts +3 -3
- package/dist/components/radio-group.mjs +9 -9
- package/dist/components/radio.mjs +2 -3
- package/dist/components/resizable.mjs +3 -8
- package/dist/components/scroll-area.d.mts +8 -24
- package/dist/components/scroll-area.mjs +16 -70
- package/dist/components/select.d.mts +14 -14
- package/dist/components/select.mjs +47 -47
- package/dist/components/separator.d.mts +4 -19
- package/dist/components/separator.mjs +6 -27
- package/dist/components/sheet.d.mts +18 -31
- package/dist/components/sheet.mjs +46 -87
- package/dist/components/sidebar.d.mts +3 -19
- package/dist/components/sidebar.mjs +48 -84
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/slider.d.mts +2 -2
- package/dist/components/slider.mjs +9 -11
- package/dist/components/sonner.mjs +11 -3
- package/dist/components/spinner.mjs +6 -7
- package/dist/components/switch.d.mts +5 -2
- package/dist/components/switch.mjs +7 -7
- package/dist/components/table.mjs +10 -10
- package/dist/components/tabs.d.mts +8 -5
- package/dist/components/tabs.mjs +18 -12
- package/dist/components/textarea.mjs +1 -1
- package/dist/components/toggle-group.d.mts +11 -7
- package/dist/components/toggle-group.mjs +20 -21
- package/dist/components/toggle.d.mts +4 -24
- package/dist/components/toggle.mjs +6 -45
- package/dist/components/tooltip.d.mts +7 -6
- package/dist/components/tooltip.mjs +19 -17
- package/dist/hooks/use-animated-value.mjs +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
- package/dist/hooks/use-is-mobile.mjs +0 -1
- package/dist/hooks/use-media-query.mjs +0 -1
- package/dist/hooks/use-mutation-observer.mjs +0 -1
- package/dist/hooks/use-pagination.mjs +0 -1
- package/dist/index.d.mts +38 -21
- package/dist/index.mjs +40 -23
- package/dist/lib/utils.d.mts +1 -12
- package/dist/lib/utils.mjs +1 -9
- package/dist/primitives/checkbox-group.d.mts +9 -11
- package/dist/primitives/checkbox-group.mjs +14 -19
- package/dist/primitives/input-number.d.mts +3 -4
- package/dist/primitives/input-number.mjs +3 -5
- package/dist/primitives/input.d.mts +4 -5
- package/dist/primitives/input.mjs +2 -3
- package/dist/primitives/progress-circle.d.mts +3 -4
- package/dist/primitives/progress-circle.mjs +2 -3
- package/dist/variants/alert.d.mts +18 -0
- package/dist/variants/alert.mjs +15 -0
- package/dist/variants/badge.d.mts +22 -0
- package/dist/variants/badge.mjs +19 -0
- package/dist/variants/button-group.d.mts +18 -0
- package/dist/variants/button-group.mjs +15 -0
- package/dist/variants/button.d.mts +32 -0
- package/dist/variants/button.mjs +34 -0
- package/dist/variants/empty.d.mts +18 -0
- package/dist/variants/empty.mjs +15 -0
- package/dist/variants/field.d.mts +19 -0
- package/dist/variants/field.mjs +16 -0
- package/dist/variants/input-group.d.mts +43 -0
- package/dist/variants/input-group.mjs +34 -0
- package/dist/variants/input-number.d.mts +45 -0
- package/dist/variants/input-number.mjs +40 -0
- package/dist/variants/item.d.mts +38 -0
- package/dist/variants/item.mjs +38 -0
- package/dist/variants/navigation-menu.d.mts +13 -0
- package/dist/variants/navigation-menu.mjs +8 -0
- package/dist/variants/progress-circle.d.mts +52 -0
- package/dist/variants/progress-circle.mjs +45 -0
- package/dist/variants/scroll-area.d.mts +24 -0
- package/dist/variants/scroll-area.mjs +58 -0
- package/dist/variants/separator.d.mts +23 -0
- package/dist/variants/separator.mjs +25 -0
- package/dist/variants/sheet.d.mts +20 -0
- package/dist/variants/sheet.mjs +17 -0
- package/dist/variants/sidebar.d.mts +23 -0
- package/dist/variants/sidebar.mjs +25 -0
- package/dist/variants/tabs.d.mts +18 -0
- package/dist/variants/tabs.mjs +15 -0
- package/dist/variants/toggle.d.mts +23 -0
- package/dist/variants/toggle.mjs +25 -0
- package/package.json +186 -55
- package/src/components/accordion.tsx +114 -0
- package/src/components/alert-dialog.tsx +298 -0
- package/src/components/alert.tsx +94 -0
- package/src/components/aspect-ratio.tsx +25 -0
- package/src/components/avatar.tsx +171 -0
- package/src/components/badge.tsx +35 -0
- package/src/components/breadcrumb.tsx +191 -0
- package/src/components/button-group.tsx +97 -0
- package/src/components/button.tsx +55 -0
- package/src/components/calendar.tsx +222 -0
- package/src/components/card.tsx +169 -0
- package/src/components/carousel.tsx +349 -0
- package/src/components/chart.tsx +536 -0
- package/src/components/checkbox-cards.tsx +72 -0
- package/src/components/checkbox-group.tsx +60 -0
- package/src/components/checkbox.tsx +44 -0
- package/src/components/collapsible.tsx +57 -0
- package/src/components/command.tsx +298 -0
- package/src/components/context-menu.tsx +410 -0
- package/src/components/dialog.tsx +243 -0
- package/src/components/direction.tsx +32 -0
- package/src/components/drawer.tsx +209 -0
- package/src/components/dropdown-menu.tsx +419 -0
- package/src/components/empty.tsx +155 -0
- package/src/components/field.tsx +329 -0
- package/src/components/form.tsx +258 -0
- package/src/components/hover-card.tsx +93 -0
- package/src/components/input-group.tsx +185 -0
- package/src/components/input-number.tsx +141 -0
- package/src/components/input-otp.tsx +132 -0
- package/src/components/input-password.tsx +50 -0
- package/src/components/input-search.tsx +81 -0
- package/src/components/input.tsx +36 -0
- package/src/components/item.tsx +266 -0
- package/src/components/kbd.tsx +47 -0
- package/src/components/label.tsx +36 -0
- package/src/components/menubar.tsx +440 -0
- package/src/components/native-select.tsx +87 -0
- package/src/components/navigation-menu.tsx +235 -0
- package/src/components/pagination.tsx +198 -0
- package/src/components/popover.tsx +170 -0
- package/src/components/progress-circle.tsx +185 -0
- package/src/components/progress.tsx +41 -0
- package/src/components/radio-cards.tsx +66 -0
- package/src/components/radio-group.tsx +59 -0
- package/src/components/radio.tsx +40 -0
- package/src/components/resizable.tsx +78 -0
- package/src/components/scroll-area.tsx +95 -0
- package/src/components/select.tsx +296 -0
- package/src/components/separator.tsx +60 -0
- package/src/components/sheet.tsx +241 -0
- package/src/components/sidebar.tsx +926 -0
- package/src/components/skeleton.tsx +35 -0
- package/src/components/slider.tsx +66 -0
- package/src/components/sonner.tsx +57 -0
- package/src/components/spinner.tsx +66 -0
- package/src/components/switch.tsx +44 -0
- package/src/components/table.tsx +183 -0
- package/src/components/tabs.tsx +110 -0
- package/src/components/textarea.tsx +35 -0
- package/src/components/toggle-group.tsx +137 -0
- package/src/components/toggle.tsx +30 -0
- package/src/components/tooltip.tsx +115 -0
- package/src/css/foundation/base.css +50 -0
- package/src/css/foundation/motion.css +36 -0
- package/src/css/foundation/source.css +3 -0
- package/src/css/foundation/tokens.css +71 -0
- package/src/css/foundation/variants.css +113 -0
- package/src/css/preset.css +5 -195
- package/src/css/style.css +1 -1
- package/src/css/{amber.css → themes/amber.css} +59 -22
- package/src/css/{blue.css → themes/blue.css} +59 -22
- package/src/css/{cyan.css → themes/cyan.css} +59 -22
- package/src/css/{emerald.css → themes/emerald.css} +59 -22
- package/src/css/{fuchsia.css → themes/fuchsia.css} +59 -22
- package/src/css/{gray.css → themes/gray.css} +59 -22
- package/src/css/{green.css → themes/green.css} +59 -22
- package/src/css/{indigo.css → themes/indigo.css} +59 -22
- package/src/css/{lime.css → themes/lime.css} +59 -22
- package/src/css/{neutral.css → themes/neutral.css} +59 -22
- package/src/css/{orange.css → themes/orange.css} +59 -22
- package/src/css/{pink.css → themes/pink.css} +59 -22
- package/src/css/{purple.css → themes/purple.css} +59 -22
- package/src/css/{red.css → themes/red.css} +59 -22
- package/src/css/{rose.css → themes/rose.css} +59 -22
- package/src/css/{sky.css → themes/sky.css} +59 -22
- package/src/css/{slate.css → themes/slate.css} +59 -22
- package/src/css/{stone.css → themes/stone.css} +59 -22
- package/src/css/{teal.css → themes/teal.css} +59 -22
- package/src/css/{violet.css → themes/violet.css} +59 -22
- package/src/css/{yellow.css → themes/yellow.css} +59 -22
- package/src/css/{zinc.css → themes/zinc.css} +59 -22
- package/src/hooks/use-animated-value.ts +91 -0
- package/src/hooks/use-copy-to-clipboard.ts +58 -0
- package/src/hooks/use-is-mobile.ts +25 -0
- package/src/hooks/use-media-query.ts +69 -0
- package/src/hooks/use-mutation-observer.ts +51 -0
- package/src/hooks/use-pagination.ts +164 -0
- package/src/index.ts +679 -0
- package/src/lib/utils.ts +5 -0
- package/src/primitives/checkbox-group.tsx +346 -0
- package/src/primitives/input-number.tsx +967 -0
- package/src/primitives/input.tsx +227 -0
- package/src/primitives/progress-circle.tsx +507 -0
- package/src/variants/alert.ts +34 -0
- package/src/variants/badge.ts +39 -0
- package/src/variants/button-group.ts +36 -0
- package/src/variants/button.ts +56 -0
- package/src/variants/empty.ts +34 -0
- package/src/variants/field.ts +37 -0
- package/src/variants/input-group.ts +80 -0
- package/src/variants/input-number.ts +65 -0
- package/src/variants/item.ts +68 -0
- package/src/variants/navigation-menu.ts +25 -0
- package/src/variants/progress-circle.ts +46 -0
- package/src/variants/scroll-area.ts +73 -0
- package/src/variants/separator.ts +40 -0
- package/src/variants/sheet.ts +37 -0
- package/src/variants/sidebar.ts +41 -0
- package/src/variants/tabs.ts +34 -0
- package/src/variants/toggle.ts +40 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +0 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Direction } from "radix-ui";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/direction.tsx
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.4.0-canary.4
|
|
6
|
+
*/
|
|
7
|
+
function DirectionProvider({ dir, direction, children }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Direction.DirectionProvider, {
|
|
9
|
+
dir: direction ?? dir,
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @since 0.4.0-canary.4
|
|
15
|
+
*/
|
|
16
|
+
const useDirection = Direction.useDirection;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DirectionProvider, useDirection };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
-
import { buttonVariants } from "
|
|
2
|
+
import { buttonVariants } from "../variants/button.mjs";
|
|
3
3
|
import { ComponentProps, JSX } from "react";
|
|
4
4
|
import { Drawer as Drawer$1 } from "vaul";
|
|
5
5
|
|
|
@@ -28,20 +28,13 @@ declare function DrawerTrigger({
|
|
|
28
28
|
/**
|
|
29
29
|
* @since 0.3.16-canary.0
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
classNames?: {
|
|
33
|
-
content?: string;
|
|
34
|
-
handle?: string;
|
|
35
|
-
overlay?: string;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
31
|
+
type DrawerContentProps = ComponentProps<typeof Drawer$1.Content>;
|
|
38
32
|
/**
|
|
39
33
|
* @since 0.3.16-canary.0
|
|
40
34
|
*/
|
|
41
35
|
declare function DrawerContent({
|
|
42
36
|
children,
|
|
43
37
|
className,
|
|
44
|
-
classNames,
|
|
45
38
|
...props
|
|
46
39
|
}: DrawerContentProps): JSX.Element;
|
|
47
40
|
/**
|
|
@@ -55,17 +48,6 @@ declare function DrawerHeader({
|
|
|
55
48
|
className,
|
|
56
49
|
...props
|
|
57
50
|
}: DrawerHeaderProps): JSX.Element;
|
|
58
|
-
/**
|
|
59
|
-
* @since 0.3.16-canary.0
|
|
60
|
-
*/
|
|
61
|
-
type DrawerBodyProps = ComponentProps<"div">;
|
|
62
|
-
/**
|
|
63
|
-
* @since 0.3.16-canary.0
|
|
64
|
-
*/
|
|
65
|
-
declare function DrawerBody({
|
|
66
|
-
className,
|
|
67
|
-
...props
|
|
68
|
-
}: DrawerBodyProps): JSX.Element;
|
|
69
51
|
/**
|
|
70
52
|
* @since 0.3.16-canary.0
|
|
71
53
|
*/
|
|
@@ -116,4 +98,4 @@ declare function DrawerClose({
|
|
|
116
98
|
...props
|
|
117
99
|
}: DrawerCloseProps): JSX.Element;
|
|
118
100
|
//#endregion
|
|
119
|
-
export { Drawer,
|
|
101
|
+
export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cn } from "../lib/utils.mjs";
|
|
3
|
-
import { buttonVariants } from "
|
|
2
|
+
import { buttonVariants } from "../variants/button.mjs";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { Drawer as Drawer$1 } from "vaul";
|
|
6
5
|
//#region src/components/drawer.tsx
|
|
@@ -26,23 +25,26 @@ function DrawerTrigger({ ...props }) {
|
|
|
26
25
|
/**
|
|
27
26
|
* @since 0.3.16-canary.0
|
|
28
27
|
*/
|
|
29
|
-
function DrawerContent({ children, className,
|
|
30
|
-
return /* @__PURE__ */ jsxs(Drawer$1.Portal, {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
function DrawerContent({ children, className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsxs(Drawer$1.Portal, {
|
|
30
|
+
"data-slot": "drawer-portal",
|
|
31
|
+
children: [/* @__PURE__ */ jsx(Drawer$1.Overlay, {
|
|
32
|
+
className: "fixed inset-0 z-50 bg-black/10 ease-gentle supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:animation-duration-panel-in data-open:fade-in-0 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-panel-out data-closed:fade-out-0",
|
|
33
|
+
"data-slot": "drawer-overlay"
|
|
34
|
+
}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
|
|
35
|
+
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground 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-xl data-[vaul-drawer-direction=bottom]:border-t 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=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r 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=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l 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-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", className),
|
|
36
|
+
"data-slot": "drawer-content",
|
|
37
|
+
...props,
|
|
38
|
+
children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 hidden h-1.5 w-25 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* @since 0.3.16-canary.0
|
|
42
44
|
*/
|
|
43
45
|
function DrawerHeader({ className, ...props }) {
|
|
44
46
|
return /* @__PURE__ */ jsx("div", {
|
|
45
|
-
className: cn("flex flex-col gap-
|
|
47
|
+
className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
|
|
46
48
|
"data-slot": "drawer-header",
|
|
47
49
|
...props
|
|
48
50
|
});
|
|
@@ -50,19 +52,9 @@ function DrawerHeader({ className, ...props }) {
|
|
|
50
52
|
/**
|
|
51
53
|
* @since 0.3.16-canary.0
|
|
52
54
|
*/
|
|
53
|
-
function DrawerBody({ className, ...props }) {
|
|
54
|
-
return /* @__PURE__ */ jsx("main", {
|
|
55
|
-
className: cn("overflow-auto", "px-6 py-2", className),
|
|
56
|
-
"data-slot": "drawer-body",
|
|
57
|
-
...props
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @since 0.3.16-canary.0
|
|
62
|
-
*/
|
|
63
55
|
function DrawerFooter({ className, ...props }) {
|
|
64
56
|
return /* @__PURE__ */ jsx("div", {
|
|
65
|
-
className: cn("flex flex-col gap-2
|
|
57
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
66
58
|
"data-slot": "drawer-footer",
|
|
67
59
|
...props
|
|
68
60
|
});
|
|
@@ -72,7 +64,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
72
64
|
*/
|
|
73
65
|
function DrawerTitle({ className, ...props }) {
|
|
74
66
|
return /* @__PURE__ */ jsx(Drawer$1.Title, {
|
|
75
|
-
className: cn("font-
|
|
67
|
+
className: cn("font-heading font-medium text-foreground", className),
|
|
76
68
|
"data-slot": "drawer-title",
|
|
77
69
|
...props
|
|
78
70
|
});
|
|
@@ -90,7 +82,7 @@ function DrawerDescription({ className, ...props }) {
|
|
|
90
82
|
/**
|
|
91
83
|
* @since 0.3.16-canary.0
|
|
92
84
|
*/
|
|
93
|
-
function DrawerClose({ className, size, variant
|
|
85
|
+
function DrawerClose({ className, size, variant, ...props }) {
|
|
94
86
|
return /* @__PURE__ */ jsx(Drawer$1.Close, {
|
|
95
87
|
className: buttonVariants({
|
|
96
88
|
className,
|
|
@@ -102,4 +94,4 @@ function DrawerClose({ className, size, variant = "outline", ...props }) {
|
|
|
102
94
|
});
|
|
103
95
|
}
|
|
104
96
|
//#endregion
|
|
105
|
-
export { Drawer,
|
|
97
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
1
2
|
import { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
3
|
|
|
4
4
|
//#region src/components/dropdown-menu.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* @since 0.3.16-canary.0
|
|
7
7
|
*/
|
|
8
|
-
type DropdownMenuProps = ComponentProps<typeof
|
|
8
|
+
type DropdownMenuProps = ComponentProps<typeof DropdownMenu$1.Root>;
|
|
9
9
|
/**
|
|
10
10
|
* @since 0.3.16-canary.0
|
|
11
11
|
*/
|
|
@@ -15,7 +15,7 @@ declare function DropdownMenu({
|
|
|
15
15
|
/**
|
|
16
16
|
* @since 0.3.16-canary.0
|
|
17
17
|
*/
|
|
18
|
-
type DropdownMenuTriggerProps = ComponentProps<typeof
|
|
18
|
+
type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenu$1.Trigger>;
|
|
19
19
|
/**
|
|
20
20
|
* @since 0.3.16-canary.0
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ declare function DropdownMenuTrigger({
|
|
|
25
25
|
/**
|
|
26
26
|
* @since 0.3.16-canary.0
|
|
27
27
|
*/
|
|
28
|
-
type DropdownMenuGroupProps = ComponentProps<typeof
|
|
28
|
+
type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenu$1.Group>;
|
|
29
29
|
/**
|
|
30
30
|
* @since 0.3.16-canary.0
|
|
31
31
|
*/
|
|
@@ -35,7 +35,7 @@ declare function DropdownMenuGroup({
|
|
|
35
35
|
/**
|
|
36
36
|
* @since 0.3.16-canary.0
|
|
37
37
|
*/
|
|
38
|
-
type DropdownMenuSubProps = ComponentProps<typeof
|
|
38
|
+
type DropdownMenuSubProps = ComponentProps<typeof DropdownMenu$1.Sub>;
|
|
39
39
|
/**
|
|
40
40
|
* @since 0.3.16-canary.0
|
|
41
41
|
*/
|
|
@@ -45,7 +45,7 @@ declare function DropdownMenuSub({
|
|
|
45
45
|
/**
|
|
46
46
|
* @since 0.3.16-canary.0
|
|
47
47
|
*/
|
|
48
|
-
type DropdownMenuRadioGroupProps = ComponentProps<typeof
|
|
48
|
+
type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenu$1.RadioGroup>;
|
|
49
49
|
/**
|
|
50
50
|
* @since 0.3.16-canary.0
|
|
51
51
|
*/
|
|
@@ -55,7 +55,7 @@ declare function DropdownMenuRadioGroup({
|
|
|
55
55
|
/**
|
|
56
56
|
* @since 0.3.16-canary.0
|
|
57
57
|
*/
|
|
58
|
-
interface DropdownMenuSubTriggerProps extends ComponentProps<typeof
|
|
58
|
+
interface DropdownMenuSubTriggerProps extends ComponentProps<typeof DropdownMenu$1.SubTrigger> {
|
|
59
59
|
inset?: boolean;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -70,7 +70,7 @@ declare function DropdownMenuSubTrigger({
|
|
|
70
70
|
/**
|
|
71
71
|
* @since 0.3.16-canary.0
|
|
72
72
|
*/
|
|
73
|
-
type DropdownMenuSubContentProps = ComponentProps<typeof
|
|
73
|
+
type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenu$1.SubContent>;
|
|
74
74
|
/**
|
|
75
75
|
* @since 0.3.16-canary.0
|
|
76
76
|
*/
|
|
@@ -81,11 +81,12 @@ declare function DropdownMenuSubContent({
|
|
|
81
81
|
/**
|
|
82
82
|
* @since 0.3.16-canary.0
|
|
83
83
|
*/
|
|
84
|
-
type DropdownMenuContentProps = ComponentProps<typeof
|
|
84
|
+
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenu$1.Content>;
|
|
85
85
|
/**
|
|
86
86
|
* @since 0.3.16-canary.0
|
|
87
87
|
*/
|
|
88
88
|
declare function DropdownMenuContent({
|
|
89
|
+
align,
|
|
89
90
|
className,
|
|
90
91
|
sideOffset,
|
|
91
92
|
...props
|
|
@@ -93,7 +94,7 @@ declare function DropdownMenuContent({
|
|
|
93
94
|
/**
|
|
94
95
|
* @since 0.3.16-canary.0
|
|
95
96
|
*/
|
|
96
|
-
interface DropdownMenuItemProps extends ComponentProps<typeof
|
|
97
|
+
interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenu$1.Item> {
|
|
97
98
|
inset?: boolean;
|
|
98
99
|
variant?: "default" | "destructive";
|
|
99
100
|
}
|
|
@@ -109,7 +110,9 @@ declare function DropdownMenuItem({
|
|
|
109
110
|
/**
|
|
110
111
|
* @since 0.3.16-canary.0
|
|
111
112
|
*/
|
|
112
|
-
|
|
113
|
+
interface DropdownMenuCheckboxItemProps extends ComponentProps<typeof DropdownMenu$1.CheckboxItem> {
|
|
114
|
+
inset?: boolean;
|
|
115
|
+
}
|
|
113
116
|
/**
|
|
114
117
|
* @since 0.3.16-canary.0
|
|
115
118
|
*/
|
|
@@ -117,24 +120,28 @@ declare function DropdownMenuCheckboxItem({
|
|
|
117
120
|
checked,
|
|
118
121
|
children,
|
|
119
122
|
className,
|
|
123
|
+
inset,
|
|
120
124
|
...props
|
|
121
125
|
}: DropdownMenuCheckboxItemProps): JSX.Element;
|
|
122
126
|
/**
|
|
123
127
|
* @since 0.3.16-canary.0
|
|
124
128
|
*/
|
|
125
|
-
|
|
129
|
+
interface DropdownMenuRadioItemProps extends ComponentProps<typeof DropdownMenu$1.RadioItem> {
|
|
130
|
+
inset?: boolean;
|
|
131
|
+
}
|
|
126
132
|
/**
|
|
127
133
|
* @since 0.3.16-canary.0
|
|
128
134
|
*/
|
|
129
135
|
declare function DropdownMenuRadioItem({
|
|
130
136
|
children,
|
|
131
137
|
className,
|
|
138
|
+
inset,
|
|
132
139
|
...props
|
|
133
140
|
}: DropdownMenuRadioItemProps): JSX.Element;
|
|
134
141
|
/**
|
|
135
142
|
* @since 0.3.16-canary.0
|
|
136
143
|
*/
|
|
137
|
-
interface DropdownMenuLabelProps extends ComponentProps<typeof
|
|
144
|
+
interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenu$1.Label> {
|
|
138
145
|
inset?: boolean;
|
|
139
146
|
}
|
|
140
147
|
/**
|
|
@@ -148,7 +155,7 @@ declare function DropdownMenuLabel({
|
|
|
148
155
|
/**
|
|
149
156
|
* @since 0.3.16-canary.0
|
|
150
157
|
*/
|
|
151
|
-
type DropdownMenuSeparatorProps = ComponentProps<typeof
|
|
158
|
+
type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenu$1.Separator>;
|
|
152
159
|
/**
|
|
153
160
|
* @since 0.3.16-canary.0
|
|
154
161
|
*/
|
|
@@ -170,7 +177,7 @@ declare function DropdownMenuShortcut({
|
|
|
170
177
|
/**
|
|
171
178
|
* @since 0.3.16-canary.0
|
|
172
179
|
*/
|
|
173
|
-
type DropdownMenuArrowProps = ComponentProps<typeof
|
|
180
|
+
type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenu$1.Arrow>;
|
|
174
181
|
/**
|
|
175
182
|
* @since 0.3.16-canary.0
|
|
176
183
|
*/
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cn } from "../lib/utils.mjs";
|
|
3
|
-
import { CheckIcon, ChevronRightIcon
|
|
2
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
3
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
6
5
|
//#region src/components/dropdown-menu.tsx
|
|
7
6
|
/**
|
|
8
7
|
* @since 0.3.16-canary.0
|
|
9
8
|
*/
|
|
10
9
|
function DropdownMenu({ ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Root, {
|
|
12
11
|
"data-slot": "dropdown-menu",
|
|
13
12
|
...props
|
|
14
13
|
});
|
|
@@ -17,7 +16,7 @@ function DropdownMenu({ ...props }) {
|
|
|
17
16
|
* @since 0.3.16-canary.0
|
|
18
17
|
*/
|
|
19
18
|
function DropdownMenuTrigger({ ...props }) {
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, {
|
|
21
20
|
"data-slot": "dropdown-menu-trigger",
|
|
22
21
|
...props
|
|
23
22
|
});
|
|
@@ -26,7 +25,7 @@ function DropdownMenuTrigger({ ...props }) {
|
|
|
26
25
|
* @since 0.3.16-canary.0
|
|
27
26
|
*/
|
|
28
27
|
function DropdownMenuGroup({ ...props }) {
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Group, {
|
|
30
29
|
"data-slot": "dropdown-menu-group",
|
|
31
30
|
...props
|
|
32
31
|
});
|
|
@@ -35,7 +34,7 @@ function DropdownMenuGroup({ ...props }) {
|
|
|
35
34
|
* @since 0.3.16-canary.0
|
|
36
35
|
*/
|
|
37
36
|
function DropdownMenuSub({ ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Sub, {
|
|
39
38
|
"data-slot": "dropdown-menu-sub",
|
|
40
39
|
...props
|
|
41
40
|
});
|
|
@@ -44,7 +43,7 @@ function DropdownMenuSub({ ...props }) {
|
|
|
44
43
|
* @since 0.3.16-canary.0
|
|
45
44
|
*/
|
|
46
45
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.RadioGroup, {
|
|
48
47
|
"data-slot": "dropdown-menu-radio-group",
|
|
49
48
|
...props
|
|
50
49
|
});
|
|
@@ -53,22 +52,22 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
53
52
|
* @since 0.3.16-canary.0
|
|
54
53
|
*/
|
|
55
54
|
function DropdownMenuSubTrigger({ children, className, inset, ...props }) {
|
|
56
|
-
return /* @__PURE__ */ jsxs(
|
|
57
|
-
className: cn("flex items-center gap-
|
|
55
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
56
|
+
className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
58
57
|
"data-inset": inset,
|
|
59
58
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
60
59
|
...props,
|
|
61
|
-
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className:
|
|
60
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto rtl:rotate-180" })]
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* @since 0.3.16-canary.0
|
|
66
65
|
*/
|
|
67
66
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
68
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
69
68
|
"data-slot": "dropdown-menu-portal",
|
|
70
|
-
children: /* @__PURE__ */ jsx(
|
|
71
|
-
className: cn("z-50
|
|
69
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
70
|
+
className: cn("z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 ease-snappy data-open:animate-in data-open:animation-duration-menu-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-menu-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:data-side-top:slide-out-to-bottom-2 data-closed:data-side-right:slide-out-to-left-2 data-closed:data-side-bottom:slide-out-to-top-2 data-closed:data-side-left:slide-out-to-right-2", className),
|
|
72
71
|
"data-slot": "dropdown-menu-sub-content",
|
|
73
72
|
...props
|
|
74
73
|
})
|
|
@@ -77,11 +76,12 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
77
76
|
/**
|
|
78
77
|
* @since 0.3.16-canary.0
|
|
79
78
|
*/
|
|
80
|
-
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
79
|
+
function DropdownMenuContent({ align = "start", className, sideOffset = 4, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
82
81
|
"data-slot": "dropdown-menu-portal",
|
|
83
|
-
children: /* @__PURE__ */ jsx(
|
|
84
|
-
|
|
82
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
83
|
+
align,
|
|
84
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 ease-snappy data-open:animate-in data-open:animation-duration-menu-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-menu-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:data-side-top:slide-out-to-bottom-2 data-closed:data-side-right:slide-out-to-left-2 data-closed:data-side-bottom:slide-out-to-top-2 data-closed:data-side-left:slide-out-to-right-2", className),
|
|
85
85
|
"data-slot": "dropdown-menu-content",
|
|
86
86
|
sideOffset,
|
|
87
87
|
...props
|
|
@@ -91,9 +91,9 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
91
91
|
/**
|
|
92
92
|
* @since 0.3.16-canary.0
|
|
93
93
|
*/
|
|
94
|
-
function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
95
|
-
return /* @__PURE__ */ jsx(
|
|
96
|
-
className: cn("group/dropdown-menu-item relative flex items-center gap-
|
|
94
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
96
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
97
97
|
"data-inset": inset,
|
|
98
98
|
"data-slot": "dropdown-menu-item",
|
|
99
99
|
"data-variant": variant,
|
|
@@ -103,29 +103,33 @@ function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
|
103
103
|
/**
|
|
104
104
|
* @since 0.3.16-canary.0
|
|
105
105
|
*/
|
|
106
|
-
function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
107
|
-
return /* @__PURE__ */ jsxs(
|
|
106
|
+
function DropdownMenuCheckboxItem({ checked, children, className, inset, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
108
108
|
checked,
|
|
109
|
-
className: cn("
|
|
109
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
110
|
+
"data-inset": inset,
|
|
110
111
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
111
112
|
...props,
|
|
112
113
|
children: [/* @__PURE__ */ jsx("span", {
|
|
113
|
-
className:
|
|
114
|
-
|
|
114
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
115
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
116
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
115
117
|
}), children]
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
121
|
* @since 0.3.16-canary.0
|
|
120
122
|
*/
|
|
121
|
-
function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
122
|
-
return /* @__PURE__ */ jsxs(
|
|
123
|
-
className: cn("
|
|
123
|
+
function DropdownMenuRadioItem({ children, className, inset, ...props }) {
|
|
124
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
125
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
126
|
+
"data-inset": inset,
|
|
124
127
|
"data-slot": "dropdown-menu-radio-item",
|
|
125
128
|
...props,
|
|
126
129
|
children: [/* @__PURE__ */ jsx("span", {
|
|
127
|
-
className:
|
|
128
|
-
|
|
130
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
131
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
132
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
129
133
|
}), children]
|
|
130
134
|
});
|
|
131
135
|
}
|
|
@@ -133,8 +137,8 @@ function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
|
133
137
|
* @since 0.3.16-canary.0
|
|
134
138
|
*/
|
|
135
139
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
136
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
-
className: cn("
|
|
140
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
141
|
+
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
138
142
|
"data-inset": inset,
|
|
139
143
|
"data-slot": "dropdown-menu-label",
|
|
140
144
|
...props
|
|
@@ -144,8 +148,8 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
144
148
|
* @since 0.3.16-canary.0
|
|
145
149
|
*/
|
|
146
150
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
-
className: cn("mx-
|
|
151
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
152
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
149
153
|
"data-slot": "dropdown-menu-separator",
|
|
150
154
|
...props
|
|
151
155
|
});
|
|
@@ -155,7 +159,7 @@ function DropdownMenuSeparator({ className, ...props }) {
|
|
|
155
159
|
*/
|
|
156
160
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
157
161
|
return /* @__PURE__ */ jsx("span", {
|
|
158
|
-
className: cn("ml-auto
|
|
162
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className),
|
|
159
163
|
"data-slot": "dropdown-menu-shortcut",
|
|
160
164
|
...props
|
|
161
165
|
});
|
|
@@ -164,7 +168,7 @@ function DropdownMenuShortcut({ className, ...props }) {
|
|
|
164
168
|
* @since 0.3.16-canary.0
|
|
165
169
|
*/
|
|
166
170
|
function DropdownMenuArrow({ className, ...props }) {
|
|
167
|
-
return /* @__PURE__ */ jsx(
|
|
171
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Arrow, {
|
|
168
172
|
className: cn("fill-popover", className),
|
|
169
173
|
"data-slot": "dropdown-menu-arrow",
|
|
170
174
|
...props
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
1
|
+
import { EmptyMediaVariants } from "../variants/empty.mjs";
|
|
3
2
|
import { ComponentProps, JSX } from "react";
|
|
4
3
|
|
|
5
4
|
//#region src/components/empty.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* @since 0.3.16-canary.0
|
|
8
|
-
*/
|
|
9
|
-
declare const emptyMediaVariants: _$_codefast_tailwind_variants0.VariantResolver<{
|
|
10
|
-
variant: {
|
|
11
|
-
default: string;
|
|
12
|
-
icon: string[];
|
|
13
|
-
};
|
|
14
|
-
}, Record<string, never>>;
|
|
15
5
|
/**
|
|
16
6
|
* @since 0.3.16-canary.0
|
|
17
7
|
*/
|
|
@@ -37,7 +27,7 @@ declare function EmptyHeader({
|
|
|
37
27
|
/**
|
|
38
28
|
* @since 0.3.16-canary.0
|
|
39
29
|
*/
|
|
40
|
-
type EmptyMediaProps = ComponentProps<"div"> &
|
|
30
|
+
type EmptyMediaProps = ComponentProps<"div"> & EmptyMediaVariants;
|
|
41
31
|
/**
|
|
42
32
|
* @since 0.3.16-canary.0
|
|
43
33
|
*/
|
|
@@ -80,4 +70,4 @@ declare function EmptyContent({
|
|
|
80
70
|
...props
|
|
81
71
|
}: EmptyContentProps): JSX.Element;
|
|
82
72
|
//#endregion
|
|
83
|
-
export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps
|
|
73
|
+
export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps };
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import { cn
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { emptyMediaVariants } from "../variants/empty.mjs";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/empty.tsx
|
|
4
5
|
/**
|
|
5
6
|
* @since 0.3.16-canary.0
|
|
6
7
|
*/
|
|
7
|
-
const emptyMediaVariants = tv({
|
|
8
|
-
base: ["mb-2 flex shrink-0 items-center justify-center", "[&_svg]:pointer-events-none [&_svg]:shrink-0"],
|
|
9
|
-
defaultVariants: { variant: "default" },
|
|
10
|
-
variants: { variant: {
|
|
11
|
-
default: "bg-transparent",
|
|
12
|
-
icon: [
|
|
13
|
-
"flex size-10 shrink-0 items-center justify-center",
|
|
14
|
-
"rounded-xl",
|
|
15
|
-
"bg-muted text-foreground",
|
|
16
|
-
"[&_svg:not([class*='size-'])]:size-6"
|
|
17
|
-
]
|
|
18
|
-
} }
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* @since 0.3.16-canary.0
|
|
22
|
-
*/
|
|
23
8
|
function Empty({ className, ...props }) {
|
|
24
9
|
return /* @__PURE__ */ jsx("div", {
|
|
25
|
-
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-
|
|
10
|
+
className: cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance", className),
|
|
26
11
|
"data-slot": "empty",
|
|
27
12
|
...props
|
|
28
13
|
});
|
|
@@ -32,7 +17,7 @@ function Empty({ className, ...props }) {
|
|
|
32
17
|
*/
|
|
33
18
|
function EmptyHeader({ className, ...props }) {
|
|
34
19
|
return /* @__PURE__ */ jsx("div", {
|
|
35
|
-
className: cn("flex max-w-sm flex-col items-center gap-2",
|
|
20
|
+
className: cn("flex max-w-sm flex-col items-center gap-2", className),
|
|
36
21
|
"data-slot": "empty-header",
|
|
37
22
|
...props
|
|
38
23
|
});
|
|
@@ -56,7 +41,7 @@ function EmptyMedia({ className, variant = "default", ...props }) {
|
|
|
56
41
|
*/
|
|
57
42
|
function EmptyTitle({ className, ...props }) {
|
|
58
43
|
return /* @__PURE__ */ jsx("div", {
|
|
59
|
-
className: cn("text-lg font-medium tracking-tight", className),
|
|
44
|
+
className: cn("font-heading text-lg font-medium tracking-tight", className),
|
|
60
45
|
"data-slot": "empty-title",
|
|
61
46
|
...props
|
|
62
47
|
});
|
|
@@ -66,7 +51,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
66
51
|
*/
|
|
67
52
|
function EmptyDescription({ className, ...props }) {
|
|
68
53
|
return /* @__PURE__ */ jsx("p", {
|
|
69
|
-
className: cn("text-sm/relaxed text-muted-foreground
|
|
54
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
70
55
|
"data-slot": "empty-description",
|
|
71
56
|
...props
|
|
72
57
|
});
|
|
@@ -76,10 +61,10 @@ function EmptyDescription({ className, ...props }) {
|
|
|
76
61
|
*/
|
|
77
62
|
function EmptyContent({ className, ...props }) {
|
|
78
63
|
return /* @__PURE__ */ jsx("div", {
|
|
79
|
-
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4
|
|
64
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
80
65
|
"data-slot": "empty-content",
|
|
81
66
|
...props
|
|
82
67
|
});
|
|
83
68
|
}
|
|
84
69
|
//#endregion
|
|
85
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle
|
|
70
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { VariantProps } from "../lib/utils.mjs";
|
|
2
1
|
import { Label } from "./label.mjs";
|
|
3
|
-
import
|
|
2
|
+
import { FieldVariants } from "../variants/field.mjs";
|
|
4
3
|
import { ComponentProps, JSX } from "react";
|
|
5
4
|
|
|
6
5
|
//#region src/components/field.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
declare const fieldVariants: _$_codefast_tailwind_variants0.VariantResolver<{
|
|
11
|
-
orientation: {
|
|
12
|
-
horizontal: string[];
|
|
13
|
-
responsive: string[];
|
|
14
|
-
vertical: string[];
|
|
15
|
-
};
|
|
16
|
-
}, Record<string, never>>;
|
|
17
6
|
/**
|
|
18
7
|
* @since 0.3.16-canary.0
|
|
19
8
|
*/
|
|
@@ -53,7 +42,7 @@ declare function FieldGroup({
|
|
|
53
42
|
/**
|
|
54
43
|
* @since 0.3.16-canary.0
|
|
55
44
|
*/
|
|
56
|
-
type FieldProps = ComponentProps<"div"> &
|
|
45
|
+
type FieldProps = ComponentProps<"div"> & FieldVariants;
|
|
57
46
|
/**
|
|
58
47
|
* @since 0.3.16-canary.0
|
|
59
48
|
*/
|
|
@@ -139,4 +128,4 @@ declare function FieldError({
|
|
|
139
128
|
...props
|
|
140
129
|
}: FieldErrorProps): JSX.Element | null;
|
|
141
130
|
//#endregion
|
|
142
|
-
export { Field, FieldContent, type FieldContentProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, FieldLabel, type FieldLabelProps, FieldLegend, type FieldLegendProps, type FieldProps, FieldSeparator, type FieldSeparatorProps, FieldSet, type FieldSetProps, FieldTitle, type FieldTitleProps
|
|
131
|
+
export { Field, FieldContent, type FieldContentProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldGroup, type FieldGroupProps, FieldLabel, type FieldLabelProps, FieldLegend, type FieldLegendProps, type FieldProps, FieldSeparator, type FieldSeparatorProps, FieldSet, type FieldSetProps, FieldTitle, type FieldTitleProps };
|