@yenio-pld/blocks 0.0.0 → 1.0.0-rc.2
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/dist/index.cjs +361 -855
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +223 -697
- package/dist/index.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +9 -3
- package/dist/ui/alert-dialog.js +11 -3
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/drawer.d.ts +15 -0
- package/dist/ui/drawer.js +126 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +9 -3
- package/dist/ui/dropdown-menu.js +9 -2
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/empty.d.ts +15 -0
- package/dist/ui/empty.js +104 -0
- package/dist/ui/empty.js.map +1 -0
- package/dist/ui/select.d.ts +5 -0
- package/dist/ui/select.js +25 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/slider.d.ts +6 -0
- package/dist/ui/slider.js +70 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.d.ts +1 -0
- package/dist/ui/sonner.js +1 -0
- package/dist/ui/sonner.js.map +1 -1
- package/dist/ui/textarea.d.ts +5 -0
- package/dist/ui/textarea.js +25 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toggle.d.ts +12 -0
- package/dist/ui/toggle.js +49 -0
- package/dist/ui/toggle.js.map +1 -0
- package/package.json +25 -1
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { buttonVariants } from './button.js';
|
|
6
|
+
import 'class-variance-authority/types';
|
|
7
|
+
import '@base-ui/react/button';
|
|
4
8
|
|
|
5
9
|
declare function AlertDialog({ ...props }: ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
6
10
|
declare function AlertDialogTrigger({ ...props }: ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
7
|
-
declare function AlertDialogContent({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Content>
|
|
11
|
+
declare function AlertDialogContent({ className, size, ...props }: ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
12
|
+
size?: "default" | "sm";
|
|
13
|
+
}): React.JSX.Element;
|
|
8
14
|
declare function AlertDialogHeader({ className, ...props }: ComponentProps<"div">): React.JSX.Element;
|
|
9
15
|
declare function AlertDialogFooter({ className, ...props }: ComponentProps<"div">): React.JSX.Element;
|
|
10
16
|
declare function AlertDialogTitle({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
11
17
|
declare function AlertDialogDescription({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
12
|
-
declare function AlertDialogAction({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Action>): React.JSX.Element;
|
|
13
|
-
declare function AlertDialogCancel({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
|
|
18
|
+
declare function AlertDialogAction({ className, variant, size, ...props }: ComponentProps<typeof AlertDialogPrimitive.Action> & VariantProps<typeof buttonVariants>): React.JSX.Element;
|
|
19
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: ComponentProps<typeof AlertDialogPrimitive.Cancel> & VariantProps<typeof buttonVariants>): React.JSX.Element;
|
|
14
20
|
|
|
15
21
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger };
|
package/dist/ui/alert-dialog.js
CHANGED
|
@@ -41,6 +41,7 @@ function AlertDialogOverlay({
|
|
|
41
41
|
}
|
|
42
42
|
function AlertDialogContent({
|
|
43
43
|
className,
|
|
44
|
+
size = "default",
|
|
44
45
|
...props
|
|
45
46
|
}) {
|
|
46
47
|
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
@@ -49,8 +50,9 @@ function AlertDialogContent({
|
|
|
49
50
|
AlertDialogPrimitive.Content,
|
|
50
51
|
{
|
|
51
52
|
"data-slot": "alert-dialog-content",
|
|
53
|
+
"data-size": size,
|
|
52
54
|
className: cn(
|
|
53
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
55
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs",
|
|
54
56
|
className
|
|
55
57
|
),
|
|
56
58
|
...props
|
|
@@ -109,24 +111,30 @@ function AlertDialogDescription({
|
|
|
109
111
|
}
|
|
110
112
|
function AlertDialogAction({
|
|
111
113
|
className,
|
|
114
|
+
variant = "default",
|
|
115
|
+
size = "default",
|
|
112
116
|
...props
|
|
113
117
|
}) {
|
|
114
118
|
return /* @__PURE__ */ jsx(
|
|
115
119
|
AlertDialogPrimitive.Action,
|
|
116
120
|
{
|
|
117
|
-
|
|
121
|
+
"data-slot": "alert-dialog-action",
|
|
122
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
118
123
|
...props
|
|
119
124
|
}
|
|
120
125
|
);
|
|
121
126
|
}
|
|
122
127
|
function AlertDialogCancel({
|
|
123
128
|
className,
|
|
129
|
+
variant = "outline",
|
|
130
|
+
size = "default",
|
|
124
131
|
...props
|
|
125
132
|
}) {
|
|
126
133
|
return /* @__PURE__ */ jsx(
|
|
127
134
|
AlertDialogPrimitive.Cancel,
|
|
128
135
|
{
|
|
129
|
-
|
|
136
|
+
"data-slot": "alert-dialog-cancel",
|
|
137
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
130
138
|
...props
|
|
131
139
|
}
|
|
132
140
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert-dialog.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert-dialog.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACGA,SAAS,WAAA,CAAY;AAAA,EACpB,GAAG;AACJ,CAAA,EAAqD;AACpD,EAAA,2BAA6B,oBAAA,CAAA,IAAA,EAArB,EAA0B,WAAA,EAAU,cAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACvE;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,2BACuB,oBAAA,CAAA,OAAA,EAArB,EAA6B,WAAA,EAAU,sBAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAE5E;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,GAAG;AACJ,CAAA,EAAuD;AACtD,EAAA,2BACuB,oBAAA,CAAA,MAAA,EAArB,EAA4B,WAAA,E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AAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF","file":"alert-dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport type { ComponentProps } from \"react\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nfunction AlertDialog({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n\t);\n}\n\nfunction AlertDialogPortal({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n\t);\n}\n\nfunction AlertDialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tdata-slot=\"alert-dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({\n\tclassName,\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Content> & {\n\tsize?: \"default\" | \"sm\";\n}) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tdata-slot=\"alert-dialog-content\"\n\t\t\t\tdata-size={size}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot=\"alert-dialog-title\"\n\t\t\tclassName={cn(\"text-lg font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot=\"alert-dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogAction({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Action> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Action\n\t\t\tdata-slot=\"alert-dialog-action\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogCancel({\n\tclassName,\n\tvariant = \"outline\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tdata-slot=\"alert-dialog-cancel\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"]}
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
7
|
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
8
|
-
size?: "default" | "
|
|
8
|
+
size?: "default" | "sm" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): React.JSX.Element;
|
|
11
11
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
3
|
+
|
|
4
|
+
declare function Drawer({ ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
|
|
5
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof Drawer$1.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof Drawer$1.Portal>): React.JSX.Element;
|
|
7
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof Drawer$1.Close>): React.JSX.Element;
|
|
8
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof Drawer$1.Overlay>): React.JSX.Element;
|
|
9
|
+
declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof Drawer$1.Content>): React.JSX.Element;
|
|
10
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof Drawer$1.Title>): React.JSX.Element;
|
|
13
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof Drawer$1.Description>): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
function Drawer({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, { "data-slot": "drawer", ...props });
|
|
14
|
+
}
|
|
15
|
+
function DrawerTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
19
|
+
}
|
|
20
|
+
function DrawerPortal({
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
|
|
24
|
+
}
|
|
25
|
+
function DrawerClose({
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
|
|
29
|
+
}
|
|
30
|
+
function DrawerOverlay({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Drawer$1.Overlay,
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "drawer-overlay",
|
|
38
|
+
className: cn(
|
|
39
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function DrawerContent({
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
...props
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
Drawer$1.Content,
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "drawer-content",
|
|
57
|
+
className: cn(
|
|
58
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
59
|
+
"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-lg data-[vaul-drawer-direction=top]:border-b",
|
|
60
|
+
"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-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
61
|
+
"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]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
62
|
+
"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]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
...props,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
68
|
+
children
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
function DrawerHeader({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
"data-slot": "drawer-header",
|
|
79
|
+
className: cn(
|
|
80
|
+
"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",
|
|
81
|
+
className
|
|
82
|
+
),
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function DrawerFooter({ className, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
"data-slot": "drawer-footer",
|
|
92
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function DrawerTitle({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
Drawer$1.Title,
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "drawer-title",
|
|
105
|
+
className: cn("text-foreground font-semibold", className),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function DrawerDescription({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsx(
|
|
115
|
+
Drawer$1.Description,
|
|
116
|
+
{
|
|
117
|
+
"data-slot": "drawer-description",
|
|
118
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
125
|
+
//# sourceMappingURL=drawer.js.map
|
|
126
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/drawer.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EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAA6D;AAC5D,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF","file":"drawer.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Drawer({\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n\treturn <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n\treturn <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n\treturn <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n\treturn <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n\treturn (\n\t\t<DrawerPrimitive.Overlay\n\t\t\tdata-slot=\"drawer-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerContent({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n\treturn (\n\t\t<DrawerPortal data-slot=\"drawer-portal\">\n\t\t\t<DrawerOverlay />\n\t\t\t<DrawerPrimitive.Content\n\t\t\t\tdata-slot=\"drawer-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n\t\t\t\t\t\"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-lg data-[vaul-drawer-direction=top]:border-b\",\n\t\t\t\t\t\"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-lg data-[vaul-drawer-direction=bottom]:border-t\",\n\t\t\t\t\t\"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]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n\t\t\t\t\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]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n\t\t\t\t{children}\n\t\t\t</DrawerPrimitive.Content>\n\t\t</DrawerPortal>\n\t);\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"drawer-header\"\n\t\t\tclassName={cn(\n\t\t\t\t\"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\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"drawer-footer\"\n\t\t\tclassName={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n\treturn (\n\t\t<DrawerPrimitive.Title\n\t\t\tdata-slot=\"drawer-title\"\n\t\t\tclassName={cn(\"text-foreground font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n\treturn (\n\t\t<DrawerPrimitive.Description\n\t\t\tdata-slot=\"drawer-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDrawer,\n\tDrawerPortal,\n\tDrawerOverlay,\n\tDrawerTrigger,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerHeader,\n\tDrawerFooter,\n\tDrawerTitle,\n\tDrawerDescription,\n};\n"]}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Menu } from '@base-ui/react/menu';
|
|
3
3
|
|
|
4
|
+
/** Unclamped menu surface for compact header switchers (theme, language). */
|
|
5
|
+
declare const miniMenuContentClassName = "max-h-none overflow-x-visible overflow-y-visible";
|
|
6
|
+
declare const miniMenuContentDefaults: {
|
|
7
|
+
readonly sideOffset: 8;
|
|
8
|
+
readonly collisionPadding: 12;
|
|
9
|
+
};
|
|
4
10
|
declare function DropdownMenu({ ...props }: Menu.Root.Props): React.JSX.Element;
|
|
5
11
|
declare function DropdownMenuPortal({ ...props }: Menu.Portal.Props): React.JSX.Element;
|
|
6
12
|
declare function DropdownMenuTrigger({ ...props }: Menu.Trigger.Props): React.JSX.Element;
|
|
7
|
-
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
13
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, collisionPadding, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "collisionPadding">): React.JSX.Element;
|
|
8
14
|
declare function DropdownMenuGroup({ ...props }: Menu.Group.Props): React.JSX.Element;
|
|
9
|
-
declare function DropdownMenuLabel({ className, inset, ...props }:
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<"div"> & {
|
|
10
16
|
inset?: boolean;
|
|
11
17
|
}): React.JSX.Element;
|
|
12
18
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: Menu.Item.Props & {
|
|
@@ -28,4 +34,4 @@ declare function DropdownMenuRadioItem({ className, children, inset, ...props }:
|
|
|
28
34
|
declare function DropdownMenuSeparator({ className, ...props }: Menu.Separator.Props): React.JSX.Element;
|
|
29
35
|
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
30
36
|
|
|
31
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
37
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, miniMenuContentClassName, miniMenuContentDefaults };
|
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -8,6 +8,11 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
8
8
|
function cn(...inputs) {
|
|
9
9
|
return twMerge(clsx(inputs));
|
|
10
10
|
}
|
|
11
|
+
var miniMenuContentClassName = "max-h-none overflow-x-visible overflow-y-visible";
|
|
12
|
+
var miniMenuContentDefaults = {
|
|
13
|
+
sideOffset: 8,
|
|
14
|
+
collisionPadding: 12
|
|
15
|
+
};
|
|
11
16
|
function DropdownMenu({ ...props }) {
|
|
12
17
|
return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
13
18
|
}
|
|
@@ -22,6 +27,7 @@ function DropdownMenuContent({
|
|
|
22
27
|
alignOffset = 0,
|
|
23
28
|
side = "bottom",
|
|
24
29
|
sideOffset = 4,
|
|
30
|
+
collisionPadding,
|
|
25
31
|
className,
|
|
26
32
|
...props
|
|
27
33
|
}) {
|
|
@@ -33,6 +39,7 @@ function DropdownMenuContent({
|
|
|
33
39
|
alignOffset,
|
|
34
40
|
side,
|
|
35
41
|
sideOffset,
|
|
42
|
+
collisionPadding,
|
|
36
43
|
children: /* @__PURE__ */ jsx(
|
|
37
44
|
Menu.Popup,
|
|
38
45
|
{
|
|
@@ -56,7 +63,7 @@ function DropdownMenuLabel({
|
|
|
56
63
|
...props
|
|
57
64
|
}) {
|
|
58
65
|
return /* @__PURE__ */ jsx(
|
|
59
|
-
|
|
66
|
+
"div",
|
|
60
67
|
{
|
|
61
68
|
"data-slot": "dropdown-menu-label",
|
|
62
69
|
"data-inset": inset,
|
|
@@ -239,6 +246,6 @@ function DropdownMenuShortcut({
|
|
|
239
246
|
);
|
|
240
247
|
}
|
|
241
248
|
|
|
242
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
249
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, miniMenuContentClassName, miniMenuContentDefaults };
|
|
243
250
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
244
251
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/dropdown-menu.tsx"],"names":["MenuPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACGA,SAAS,YAAA,CAAa,EAAE,GAAG,KAAA,EAAM,EAA6B;AAC7D,EAAA,2BAAQA,IAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACjE;AAEA,SAAS,kBAAA,CAAmB,EAAE,GAAG,KAAA,EAAM,EAA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-menu.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\";\n\nimport { cn } from \"../lib/utils\";\nimport { ChevronRightIcon, CheckIcon } from \"lucide-react\";\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n\treturn <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n\treturn <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {\n\treturn <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n\talign = \"start\",\n\talignOffset = 0,\n\tside = \"bottom\",\n\tsideOffset = 4,\n\tclassName,\n\t...props\n}: MenuPrimitive.Popup.Props &\n\tPick<\n\t\tMenuPrimitive.Positioner.Props,\n\t\t\"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n\t>) {\n\treturn (\n\t\t<MenuPrimitive.Portal>\n\t\t\t<MenuPrimitive.Positioner\n\t\t\t\tclassName=\"isolate z-50 outline-none\"\n\t\t\t\talign={align}\n\t\t\t\talignOffset={alignOffset}\n\t\t\t\tside={side}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t>\n\t\t\t\t<MenuPrimitive.Popup\n\t\t\t\t\tdata-slot=\"dropdown-menu-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</MenuPrimitive.Positioner>\n\t\t</MenuPrimitive.Portal>\n\t);\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n\treturn <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\t...props\n}: MenuPrimitive.GroupLabel.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.GroupLabel\n\t\t\tdata-slot=\"dropdown-menu-label\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tvariant = \"default\",\n\t...props\n}: MenuPrimitive.Item.Props & {\n\tinset?: boolean;\n\tvariant?: \"default\" | \"destructive\";\n}) {\n\treturn (\n\t\t<MenuPrimitive.Item\n\t\t\tdata-slot=\"dropdown-menu-item\"\n\t\t\tdata-inset={inset}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t\"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 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\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n\treturn <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.SubmenuTrigger\n\t\t\tdata-slot=\"dropdown-menu-sub-trigger\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</MenuPrimitive.SubmenuTrigger>\n\t);\n}\n\nfunction DropdownMenuSubContent({\n\talign = \"start\",\n\talignOffset = -3,\n\tside = \"right\",\n\tsideOffset = 0,\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n\treturn (\n\t\t<DropdownMenuContent\n\t\t\tdata-slot=\"dropdown-menu-sub-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\talign={align}\n\t\t\talignOffset={alignOffset}\n\t\t\tside={side}\n\t\t\tsideOffset={sideOffset}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tinset,\n\t...props\n}: MenuPrimitive.CheckboxItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.CheckboxItem\n\t\t\tdata-slot=\"dropdown-menu-checkbox-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-checkbox-item-indicator\"\n\t\t\t>\n\t\t\t\t<MenuPrimitive.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</MenuPrimitive.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.CheckboxItem>\n\t);\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n\treturn (\n\t\t<MenuPrimitive.RadioGroup\n\t\t\tdata-slot=\"dropdown-menu-radio-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tinset,\n\t...props\n}: MenuPrimitive.RadioItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.RadioItem\n\t\t\tdata-slot=\"dropdown-menu-radio-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-radio-item-indicator\"\n\t\t\t>\n\t\t\t\t<MenuPrimitive.RadioItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</MenuPrimitive.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.RadioItem>\n\t);\n}\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\t...props\n}: MenuPrimitive.Separator.Props) {\n\treturn (\n\t\t<MenuPrimitive.Separator\n\t\t\tdata-slot=\"dropdown-menu-separator\"\n\t\t\tclassName={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"dropdown-menu-shortcut\"\n\t\t\tclassName={cn(\n\t\t\t\t\"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuPortal,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuLabel,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuSubContent,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/dropdown-menu.tsx"],"names":["MenuPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACIO,IAAM,wBAAA,GACZ;AAEM,IAAM,uBAAA,GAA0B;AAAA,EACtC,UAAA,EAAY,CAAA;AAAA,EACZ,gBAAA,EAAkB;AACnB;AAEA,SAAS,YAAA,CAAa,EAAE,GAAG,KAAA,EAAM,EAA6B;AAC7D,EAAA,2BAAQA,IAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACjE;AAEA,SAAS,kBAAA,CAAmB,EAAE,GAAG,KAAA,EAAM,EAA+B;AACrE,EAAA,2BAAQA,IAAA,CAAc,MAAA,EAAd,EAAqB,WAAA,EAAU,sBAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAC1E;AAEA,SAAS,mBAAA,CAAoB,EAAE,GAAG,KAAA,EAAM,EAAgC;AACvE,EAAA,2BAAQA,IAAA,CAAc,OAAA,EAAd,EAAsB,WAAA,EAAU,uBAAA,EAAyB,GAAG,KAAA,EAAO,CAAA;AAC5E;AAEA,SAAS,mBAAA,CAAoB;A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Y,KAAA;AAAA,MACZ,SAAA,EAAW,EAAA;AAAA,QACV,4VAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACA,SAAA,EAAU,uEAAA;AAAA,YACV,WAAA,EAAU,oCAAA;AAAA,YAEV,8BAACA,IAAA,CAAc,kBAAA,EAAd,EACA,QAAA,kBAAA,GAAA,CAAC,aAAU,CAAA,EACZ;AAAA;AAAA,SACD;AAAA,QACC;AAAA;AAAA;AAAA,GACF;AAEF;AAEA,SAAS,qBAAA,CAAsB;AAAA,EAC9B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAkC;AACjC,EAAA,uBACC,GAAA;AAAA,IAACA,IAAA,CAAc,SAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,yBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,2BAAA,EAA6B,SAAS,CAAA;AAAA,MACnD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,oBAAA,CAAqB;AAAA,EAC7B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAiC;AAChC,EAAA,uBACC,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,wBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,6GAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"dropdown-menu.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\";\n\nimport { cn } from \"../lib/utils\";\nimport { ChevronRightIcon, CheckIcon } from \"lucide-react\";\n\n/** Unclamped menu surface for compact header switchers (theme, language). */\nexport const miniMenuContentClassName =\n\t\"max-h-none overflow-x-visible overflow-y-visible\";\n\nexport const miniMenuContentDefaults = {\n\tsideOffset: 8,\n\tcollisionPadding: 12,\n} as const;\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n\treturn <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n\treturn <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {\n\treturn <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n\talign = \"start\",\n\talignOffset = 0,\n\tside = \"bottom\",\n\tsideOffset = 4,\n\tcollisionPadding,\n\tclassName,\n\t...props\n}: MenuPrimitive.Popup.Props &\n\tPick<\n\t\tMenuPrimitive.Positioner.Props,\n\t\t\"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"collisionPadding\"\n\t>) {\n\treturn (\n\t\t<MenuPrimitive.Portal>\n\t\t\t<MenuPrimitive.Positioner\n\t\t\t\tclassName=\"isolate z-50 outline-none\"\n\t\t\t\talign={align}\n\t\t\t\talignOffset={alignOffset}\n\t\t\t\tside={side}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tcollisionPadding={collisionPadding}\n\t\t\t>\n\t\t\t\t<MenuPrimitive.Popup\n\t\t\t\t\tdata-slot=\"dropdown-menu-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</MenuPrimitive.Positioner>\n\t\t</MenuPrimitive.Portal>\n\t);\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n\treturn <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dropdown-menu-label\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tvariant = \"default\",\n\t...props\n}: MenuPrimitive.Item.Props & {\n\tinset?: boolean;\n\tvariant?: \"default\" | \"destructive\";\n}) {\n\treturn (\n\t\t<MenuPrimitive.Item\n\t\t\tdata-slot=\"dropdown-menu-item\"\n\t\t\tdata-inset={inset}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t\"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 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\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n\treturn <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.SubmenuTrigger\n\t\t\tdata-slot=\"dropdown-menu-sub-trigger\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</MenuPrimitive.SubmenuTrigger>\n\t);\n}\n\nfunction DropdownMenuSubContent({\n\talign = \"start\",\n\talignOffset = -3,\n\tside = \"right\",\n\tsideOffset = 0,\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n\treturn (\n\t\t<DropdownMenuContent\n\t\t\tdata-slot=\"dropdown-menu-sub-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\talign={align}\n\t\t\talignOffset={alignOffset}\n\t\t\tside={side}\n\t\t\tsideOffset={sideOffset}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tinset,\n\t...props\n}: MenuPrimitive.CheckboxItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.CheckboxItem\n\t\t\tdata-slot=\"dropdown-menu-checkbox-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-checkbox-item-indicator\"\n\t\t\t>\n\t\t\t\t<MenuPrimitive.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</MenuPrimitive.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.CheckboxItem>\n\t);\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n\treturn (\n\t\t<MenuPrimitive.RadioGroup\n\t\t\tdata-slot=\"dropdown-menu-radio-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tinset,\n\t...props\n}: MenuPrimitive.RadioItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.RadioItem\n\t\t\tdata-slot=\"dropdown-menu-radio-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-radio-item-indicator\"\n\t\t\t>\n\t\t\t\t<MenuPrimitive.RadioItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</MenuPrimitive.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.RadioItem>\n\t);\n}\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\t...props\n}: MenuPrimitive.Separator.Props) {\n\treturn (\n\t\t<MenuPrimitive.Separator\n\t\t\tdata-slot=\"dropdown-menu-separator\"\n\t\t\tclassName={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"dropdown-menu-shortcut\"\n\t\t\tclassName={cn(\n\t\t\t\t\"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuPortal,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuLabel,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuSubContent,\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare const emptyMediaVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "icon" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): React.JSX.Element;
|
|
11
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
13
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
package/dist/ui/empty.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
function Empty({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "empty",
|
|
15
|
+
className: cn(
|
|
16
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg p-6 text-center text-balance md:p-12",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function EmptyHeader({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "empty-header",
|
|
28
|
+
className: cn(
|
|
29
|
+
"flex max-w-sm flex-col items-center gap-2 text-center",
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
var emptyMediaVariants = cva(
|
|
37
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: "bg-transparent",
|
|
42
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: "default"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
function EmptyMedia({
|
|
51
|
+
className,
|
|
52
|
+
variant = "default",
|
|
53
|
+
...props
|
|
54
|
+
}) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "empty-icon",
|
|
59
|
+
"data-variant": variant,
|
|
60
|
+
className: cn(emptyMediaVariants({ variant, className })),
|
|
61
|
+
...props
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function EmptyTitle({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
"data-slot": "empty-title",
|
|
70
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function EmptyDescription({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "empty-description",
|
|
80
|
+
className: cn(
|
|
81
|
+
"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function EmptyContent({ className, ...props }) {
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "empty-content",
|
|
93
|
+
className: cn(
|
|
94
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
95
|
+
className
|
|
96
|
+
),
|
|
97
|
+
...props
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
103
|
+
//# sourceMappingURL=empty.js.map
|
|
104
|
+
//# sourceMappingURL=empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/empty.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AA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zE,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,gBAAA,CAAiB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA8B;AAC7E,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,mBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,yGAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AAC3E,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,+EAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"empty.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Empty({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg p-6 text-center text-balance md:p-12\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-header\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex max-w-sm flex-col items-center gap-2 text-center\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst emptyMediaVariants = cva(\n\t\"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\ticon: \"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nfunction EmptyMedia({\n\tclassName,\n\tvariant = \"default\",\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-icon\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(emptyMediaVariants({ variant, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-title\"\n\t\t\tclassName={cn(\"text-lg font-medium tracking-tight\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"empty-content\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tEmpty,\n\tEmptyHeader,\n\tEmptyTitle,\n\tEmptyDescription,\n\tEmptyContent,\n\tEmptyMedia,\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
function Select({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"select",
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "select",
|
|
14
|
+
className: cn(
|
|
15
|
+
"h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Select };
|
|
24
|
+
//# sourceMappingURL=select.js.map
|
|
25
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/select.tsx"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACCA,SAAS,MAAA,CAAO,EAAE,SAAA,EAAW,GAAG,OAAM,EAAmC;AACxE,EAAA,uBACC,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,4fAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"select.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Select({ className, ...props }: React.ComponentProps<\"select\">) {\n\treturn (\n\t\t<select\n\t\t\tdata-slot=\"select\"\n\t\t\tclassName={cn(\n\t\t\t\t\"h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Select };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
|
|
4
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
|
|
6
|
+
export { Slider };
|