@codefast/ui 0.0.3 → 0.0.5
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/accordion.d.mts +9 -0
- package/dist/accordion.d.ts +9 -0
- package/dist/accordion.js +53 -0
- package/dist/accordion.js.map +1 -0
- package/dist/accordion.mjs +53 -0
- package/dist/accordion.mjs.map +1 -0
- package/dist/alert-dialog.d.mts +14 -0
- package/dist/alert-dialog.d.ts +14 -0
- package/dist/alert-dialog.js +107 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/alert-dialog.mjs +107 -0
- package/dist/alert-dialog.mjs.map +1 -0
- package/dist/alert.d.mts +64 -0
- package/dist/alert.d.ts +64 -0
- package/dist/alert.js +55 -0
- package/dist/alert.js.map +1 -0
- package/dist/alert.mjs +55 -0
- package/dist/alert.mjs.map +1 -0
- package/dist/aspect-ratio.d.mts +6 -0
- package/dist/aspect-ratio.d.ts +6 -0
- package/dist/aspect-ratio.js +9 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/aspect-ratio.mjs +9 -0
- package/dist/aspect-ratio.mjs.map +1 -0
- package/dist/avatar.d.mts +8 -0
- package/dist/avatar.d.ts +8 -0
- package/dist/avatar.js +48 -0
- package/dist/avatar.js.map +1 -0
- package/dist/avatar.mjs +48 -0
- package/dist/avatar.mjs.map +1 -0
- package/dist/badge.d.mts +62 -0
- package/dist/badge.d.ts +62 -0
- package/dist/badge.js +31 -0
- package/dist/badge.js.map +1 -0
- package/dist/badge.mjs +31 -0
- package/dist/badge.mjs.map +1 -0
- package/dist/breadcrumb.d.mts +15 -0
- package/dist/breadcrumb.d.ts +15 -0
- package/dist/breadcrumb.js +100 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/breadcrumb.mjs +100 -0
- package/dist/breadcrumb.mjs.map +1 -0
- package/dist/button.d.mts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +9 -1
- package/dist/button.js.map +1 -1
- package/dist/button.mjs +9 -1
- package/dist/button.mjs.map +1 -1
- package/dist/calendar.d.mts +7 -0
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +83 -0
- package/dist/calendar.js.map +1 -0
- package/dist/calendar.mjs +83 -0
- package/dist/calendar.mjs.map +1 -0
- package/dist/card.d.mts +9 -7
- package/dist/card.d.ts +9 -7
- package/dist/card.js +66 -1
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +66 -1
- package/dist/card.mjs.map +1 -1
- package/dist/carousel.d.mts +22 -0
- package/dist/carousel.d.ts +22 -0
- package/dist/carousel.js +194 -0
- package/dist/carousel.js.map +1 -0
- package/dist/carousel.mjs +194 -0
- package/dist/carousel.mjs.map +1 -0
- package/dist/checkbox.d.mts +6 -0
- package/dist/checkbox.d.ts +6 -0
- package/dist/checkbox.js +27 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/checkbox.mjs +27 -0
- package/dist/checkbox.mjs.map +1 -0
- package/dist/chunk-4K26QLS2.js +52 -0
- package/dist/chunk-4K26QLS2.js.map +1 -0
- package/dist/chunk-5GHZ6EXI.js +41 -0
- package/dist/chunk-5GHZ6EXI.js.map +1 -0
- package/dist/chunk-EIHWTXQ4.mjs +112 -0
- package/dist/chunk-EIHWTXQ4.mjs.map +1 -0
- package/dist/chunk-G3NP7M2N.js +19 -0
- package/dist/chunk-G3NP7M2N.js.map +1 -0
- package/dist/chunk-LDYBRDAY.js +112 -0
- package/dist/chunk-LDYBRDAY.js.map +1 -0
- package/dist/chunk-PTD4AMHI.mjs +25 -0
- package/dist/chunk-PTD4AMHI.mjs.map +1 -0
- package/dist/chunk-RTKEO347.js +25 -0
- package/dist/chunk-RTKEO347.js.map +1 -0
- package/dist/chunk-T52N6ZBP.mjs +41 -0
- package/dist/chunk-T52N6ZBP.mjs.map +1 -0
- package/dist/chunk-UG3URV2Z.mjs +19 -0
- package/dist/chunk-UG3URV2Z.mjs.map +1 -0
- package/dist/chunk-Z524G4RY.mjs +52 -0
- package/dist/chunk-Z524G4RY.mjs.map +1 -0
- package/dist/collapsible.d.mts +8 -0
- package/dist/collapsible.d.ts +8 -0
- package/dist/collapsible.js +13 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/collapsible.mjs +13 -0
- package/dist/collapsible.mjs.map +1 -0
- package/dist/command.d.mts +89 -0
- package/dist/command.d.ts +89 -0
- package/dist/command.js +132 -0
- package/dist/command.js.map +1 -0
- package/dist/command.mjs +132 -0
- package/dist/command.mjs.map +1 -0
- package/dist/context-menu.d.mts +26 -0
- package/dist/context-menu.d.ts +26 -0
- package/dist/context-menu.js +170 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/context-menu.mjs +170 -0
- package/dist/context-menu.mjs.map +1 -0
- package/dist/dialog.d.mts +13 -0
- package/dist/dialog.d.ts +13 -0
- package/dist/dialog.js +23 -0
- package/dist/dialog.mjs +23 -0
- package/dist/drawer.d.mts +16 -0
- package/dist/drawer.d.ts +16 -0
- package/dist/drawer.js +98 -0
- package/dist/drawer.js.map +1 -0
- package/dist/drawer.mjs +98 -0
- package/dist/drawer.mjs.map +1 -0
- package/dist/dropdown-menu.d.mts +25 -0
- package/dist/dropdown-menu.d.ts +25 -0
- package/dist/dropdown-menu.js +158 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/dropdown-menu.mjs +158 -0
- package/dist/dropdown-menu.mjs.map +1 -0
- package/dist/form.d.mts +27 -0
- package/dist/form.d.ts +27 -0
- package/dist/form.js +118 -0
- package/dist/form.js.map +1 -0
- package/dist/form.mjs +118 -0
- package/dist/form.mjs.map +1 -0
- package/dist/hover-card.d.mts +8 -0
- package/dist/hover-card.d.ts +8 -0
- package/dist/hover-card.js +31 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/hover-card.mjs +31 -0
- package/dist/hover-card.mjs.map +1 -0
- package/dist/input-otp.d.mts +36 -0
- package/dist/input-otp.d.ts +36 -0
- package/dist/input-otp.js +60 -0
- package/dist/input-otp.js.map +1 -0
- package/dist/input-otp.mjs +60 -0
- package/dist/input-otp.mjs.map +1 -0
- package/dist/input.d.mts +5 -0
- package/dist/input.d.ts +5 -0
- package/dist/input.js +26 -0
- package/dist/input.js.map +1 -0
- package/dist/input.mjs +26 -0
- package/dist/input.mjs.map +1 -0
- package/dist/label.d.mts +6 -0
- package/dist/label.d.ts +6 -0
- package/dist/label.js +9 -0
- package/dist/label.js.map +1 -0
- package/dist/label.mjs +9 -0
- package/dist/label.mjs.map +1 -0
- package/dist/menubar.d.mts +29 -0
- package/dist/menubar.d.ts +29 -0
- package/dist/menubar.js +189 -0
- package/dist/menubar.js.map +1 -0
- package/dist/menubar.mjs +189 -0
- package/dist/menubar.mjs.map +1 -0
- package/dist/navigation-menu.d.mts +68 -0
- package/dist/navigation-menu.d.ts +68 -0
- package/dist/navigation-menu.js +125 -0
- package/dist/navigation-menu.js.map +1 -0
- package/dist/navigation-menu.mjs +125 -0
- package/dist/navigation-menu.mjs.map +1 -0
- package/dist/pagination.d.mts +16 -0
- package/dist/pagination.d.ts +16 -0
- package/dist/pagination.js +124 -0
- package/dist/pagination.js.map +1 -0
- package/dist/pagination.mjs +124 -0
- package/dist/pagination.mjs.map +1 -0
- package/dist/popover.d.mts +10 -0
- package/dist/popover.d.ts +10 -0
- package/dist/popover.js +43 -0
- package/dist/popover.js.map +1 -0
- package/dist/popover.mjs +43 -0
- package/dist/popover.mjs.map +1 -0
- package/dist/progress.d.mts +6 -0
- package/dist/progress.d.ts +6 -0
- package/dist/progress.js +34 -0
- package/dist/progress.js.map +1 -0
- package/dist/progress.mjs +34 -0
- package/dist/progress.mjs.map +1 -0
- package/dist/radio-group.d.mts +7 -0
- package/dist/radio-group.d.ts +7 -0
- package/dist/radio-group.js +47 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio-group.mjs +47 -0
- package/dist/radio-group.mjs.map +1 -0
- package/dist/resizable.d.mts +26 -0
- package/dist/resizable.d.ts +26 -0
- package/dist/resizable.js +48 -0
- package/dist/resizable.js.map +1 -0
- package/dist/resizable.mjs +48 -0
- package/dist/resizable.mjs.map +1 -0
- package/dist/scroll-area.d.mts +7 -0
- package/dist/scroll-area.d.ts +7 -0
- package/dist/scroll-area.js +45 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/scroll-area.mjs +45 -0
- package/dist/scroll-area.mjs.map +1 -0
- package/dist/select.d.mts +15 -0
- package/dist/select.d.ts +15 -0
- package/dist/select.js +135 -0
- package/dist/select.js.map +1 -0
- package/dist/select.mjs +135 -0
- package/dist/select.mjs.map +1 -0
- package/dist/separator.d.mts +6 -0
- package/dist/separator.d.ts +6 -0
- package/dist/separator.js +30 -0
- package/dist/separator.js.map +1 -0
- package/dist/separator.mjs +30 -0
- package/dist/separator.mjs.map +1 -0
- package/dist/sheet.d.mts +73 -0
- package/dist/sheet.d.ts +73 -0
- package/dist/sheet.js +122 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sheet.mjs +122 -0
- package/dist/sheet.mjs.map +1 -0
- package/dist/skeleton.d.mts +5 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +22 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/skeleton.mjs +22 -0
- package/dist/skeleton.mjs.map +1 -0
- package/dist/slider.d.mts +6 -0
- package/dist/slider.d.ts +6 -0
- package/dist/slider.js +29 -0
- package/dist/slider.js.map +1 -0
- package/dist/slider.mjs +29 -0
- package/dist/slider.mjs.map +1 -0
- package/dist/sonner.d.mts +8 -0
- package/dist/sonner.d.ts +8 -0
- package/dist/sonner.js +35 -0
- package/dist/sonner.js.map +1 -0
- package/dist/sonner.mjs +35 -0
- package/dist/sonner.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/switch.d.mts +6 -0
- package/dist/switch.d.ts +6 -0
- package/dist/switch.js +26 -0
- package/dist/switch.js.map +1 -0
- package/dist/switch.mjs +26 -0
- package/dist/switch.mjs.map +1 -0
- package/dist/table.d.mts +12 -0
- package/dist/table.d.ts +12 -0
- package/dist/table.js +95 -0
- package/dist/table.js.map +1 -0
- package/dist/table.mjs +95 -0
- package/dist/table.mjs.map +1 -0
- package/dist/tabs.d.mts +9 -0
- package/dist/tabs.d.ts +9 -0
- package/dist/tabs.js +53 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tabs.mjs +53 -0
- package/dist/tabs.mjs.map +1 -0
- package/dist/textarea.d.mts +5 -0
- package/dist/textarea.d.ts +5 -0
- package/dist/textarea.js +25 -0
- package/dist/textarea.js.map +1 -0
- package/dist/textarea.mjs +25 -0
- package/dist/textarea.mjs.map +1 -0
- package/dist/toggle-group.d.mts +10 -0
- package/dist/toggle-group.d.ts +10 -0
- package/dist/toggle-group.js +50 -0
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle-group.mjs +50 -0
- package/dist/toggle-group.mjs.map +1 -0
- package/dist/toggle.d.mts +66 -0
- package/dist/toggle.d.ts +66 -0
- package/dist/toggle.js +11 -0
- package/dist/toggle.js.map +1 -0
- package/dist/toggle.mjs +11 -0
- package/dist/toggle.mjs.map +1 -0
- package/dist/tooltip.d.mts +10 -0
- package/dist/tooltip.d.ts +10 -0
- package/dist/tooltip.js +42 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tooltip.mjs +42 -0
- package/dist/tooltip.mjs.map +1 -0
- package/dist/{cva.d.mts → utils.d.mts} +2 -2
- package/dist/{cva.d.ts → utils.d.ts} +2 -2
- package/dist/utils.js +11 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +11 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +260 -19
- package/src/accordion.tsx +76 -0
- package/src/alert-dialog.tsx +159 -0
- package/src/alert.tsx +78 -0
- package/src/aspect-ratio.tsx +15 -0
- package/src/avatar.tsx +65 -0
- package/src/badge.tsx +43 -0
- package/src/breadcrumb.tsx +148 -0
- package/src/button.tsx +7 -7
- package/src/calendar.tsx +94 -0
- package/src/card.tsx +112 -25
- package/src/carousel.tsx +281 -0
- package/src/checkbox.tsx +35 -0
- package/src/collapsible.tsx +27 -0
- package/src/command.tsx +203 -0
- package/src/context-menu.tsx +278 -0
- package/src/dialog.tsx +148 -0
- package/src/drawer.tsx +140 -0
- package/src/dropdown-menu.tsx +261 -0
- package/src/form.tsx +224 -0
- package/src/hover-card.tsx +46 -0
- package/src/input-otp.tsx +100 -0
- package/src/input.tsx +30 -0
- package/src/label.tsx +29 -0
- package/src/menubar.tsx +301 -0
- package/src/navigation-menu.tsx +176 -0
- package/src/pagination.tsx +160 -0
- package/src/popover.tsx +68 -0
- package/src/progress.tsx +37 -0
- package/src/radio-group.tsx +56 -0
- package/src/resizable.tsx +64 -0
- package/src/scroll-area.tsx +60 -0
- package/src/select.tsx +207 -0
- package/src/separator.tsx +38 -0
- package/src/sheet.tsx +165 -0
- package/src/skeleton.tsx +24 -0
- package/src/slider.tsx +35 -0
- package/src/sonner.tsx +43 -0
- package/src/switch.tsx +32 -0
- package/src/table.tsx +155 -0
- package/src/tabs.tsx +74 -0
- package/src/textarea.tsx +29 -0
- package/src/toggle-group.tsx +70 -0
- package/src/toggle.tsx +53 -0
- package/src/tooltip.tsx +73 -0
- package/src/{cva.ts → utils.ts} +5 -1
- package/tailwind.config.ts +39 -70
- package/dist/chunk-33V4YP7I.js +0 -2
- package/dist/chunk-33V4YP7I.js.map +0 -1
- package/dist/chunk-JVQ3OM5P.mjs +0 -2
- package/dist/chunk-JVQ3OM5P.mjs.map +0 -1
- package/dist/code.d.mts +0 -3
- package/dist/code.d.ts +0 -3
- package/dist/code.js +0 -2
- package/dist/code.js.map +0 -1
- package/dist/code.mjs +0 -2
- package/dist/code.mjs.map +0 -1
- package/dist/cva.js +0 -2
- package/dist/cva.mjs +0 -2
- package/src/code.tsx +0 -5
- /package/dist/{cva.js.map → dialog.js.map} +0 -0
- /package/dist/{cva.mjs.map → dialog.mjs.map} +0 -0
package/dist/drawer.mjs
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-UG3URV2Z.mjs";
|
|
5
|
+
|
|
6
|
+
// src/drawer.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function Drawer({
|
|
11
|
+
shouldScaleBackground = true,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
DrawerPrimitive.Root,
|
|
16
|
+
{
|
|
17
|
+
shouldScaleBackground,
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
23
|
+
var DrawerClose = DrawerPrimitive.Close;
|
|
24
|
+
var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPrimitive.Portal, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(DrawerPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
26
|
+
/* @__PURE__ */ jsxs(
|
|
27
|
+
DrawerPrimitive.Content,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
className: cn(
|
|
31
|
+
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full" }),
|
|
37
|
+
children
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }));
|
|
42
|
+
DrawerContent.displayName = "DrawerContent";
|
|
43
|
+
function DrawerHeader({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function DrawerFooter({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
68
|
+
DrawerPrimitive.Title,
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
className: cn(
|
|
72
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
));
|
|
78
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
79
|
+
var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
80
|
+
DrawerPrimitive.Description,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
));
|
|
87
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
88
|
+
export {
|
|
89
|
+
Drawer,
|
|
90
|
+
DrawerClose,
|
|
91
|
+
DrawerContent,
|
|
92
|
+
DrawerDescription,
|
|
93
|
+
DrawerFooter,
|
|
94
|
+
DrawerHeader,
|
|
95
|
+
DrawerTitle,
|
|
96
|
+
DrawerTrigger
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=drawer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\nfunction DrawerHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\nfunction DrawerFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAYtC,cA6BA,YA7BA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,gBAAgB,gBAAgB;AAMtC,IAAM,cAAc,gBAAgB;AAMpC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,sBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,EACpE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAI,WAAU,oDAAmD;AAAA,QACjE;AAAA;AAAA;AAAA,EACH;AAAA,GACF,CACD;AACD,cAAc,cAAc;AAM5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,cAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,MAAM;AAMhD,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
|
|
4
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
5
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {
|
|
10
|
+
inset?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuItemProps & {
|
|
15
|
+
inset?: boolean | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuLabelProps & {
|
|
20
|
+
inset?: boolean | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
|
|
4
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
5
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {
|
|
10
|
+
inset?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuItemProps & {
|
|
15
|
+
inset?: boolean | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuLabelProps & {
|
|
20
|
+
inset?: boolean | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
|
|
5
|
+
|
|
6
|
+
// src/dropdown-menu.tsx
|
|
7
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
8
|
+
var _reactdropdownmenu = require('@radix-ui/react-dropdown-menu'); var DropdownMenuPrimitive = _interopRequireWildcard(_reactdropdownmenu);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _reacticons = require('@radix-ui/react-icons');
|
|
14
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
15
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
16
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
17
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
18
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
19
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
20
|
+
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
21
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
25
|
+
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",
|
|
26
|
+
inset && "pl-8",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
children,
|
|
32
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon, { className: "ml-auto size-4" })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
37
|
+
var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
+
DropdownMenuPrimitive.SubContent,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
42
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
) }));
|
|
48
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
49
|
+
var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
50
|
+
DropdownMenuPrimitive.Content,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
sideOffset,
|
|
54
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
55
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
) }));
|
|
61
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
62
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
63
|
+
DropdownMenuPrimitive.Item,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
67
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
68
|
+
inset && "pl-8",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
75
|
+
var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
76
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
80
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
81
|
+
className
|
|
82
|
+
),
|
|
83
|
+
checked,
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CheckIcon, { className: "size-4" }) }) }),
|
|
87
|
+
children
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
92
|
+
var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
93
|
+
DropdownMenuPrimitive.RadioItem,
|
|
94
|
+
{
|
|
95
|
+
ref,
|
|
96
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
97
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
...props,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon, { className: "size-4 fill-current" }) }) }),
|
|
103
|
+
children
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
));
|
|
107
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
108
|
+
var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
109
|
+
DropdownMenuPrimitive.Label,
|
|
110
|
+
{
|
|
111
|
+
ref,
|
|
112
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
113
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
114
|
+
inset && "pl-8",
|
|
115
|
+
className
|
|
116
|
+
),
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
));
|
|
120
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
121
|
+
var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
122
|
+
DropdownMenuPrimitive.Separator,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "bg-muted -mx-1 my-1 h-px", className),
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
));
|
|
129
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
130
|
+
function DropdownMenuShortcut({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "ml-auto text-xs tracking-widest opacity-60", className),
|
|
138
|
+
...props
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
exports.DropdownMenu = DropdownMenu; exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem; exports.DropdownMenuContent = DropdownMenuContent; exports.DropdownMenuGroup = DropdownMenuGroup; exports.DropdownMenuItem = DropdownMenuItem; exports.DropdownMenuLabel = DropdownMenuLabel; exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = DropdownMenuRadioItem; exports.DropdownMenuSeparator = DropdownMenuSeparator; exports.DropdownMenuShortcut = DropdownMenuShortcut; exports.DropdownMenuSub = DropdownMenuSub; exports.DropdownMenuSubContent = DropdownMenuSubContent; exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger; exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
158
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dropdown-menu.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuPrimitive.DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuPrimitive.DropdownMenuContentProps\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuPrimitive.DropdownMenuItemProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuPrimitive.DropdownMenuCheckboxItemProps\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuPrimitive.DropdownMenuRadioItemProps\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuPrimitive.DropdownMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuPrimitive.DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-muted -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-UG3URV2Z.mjs";
|
|
5
|
+
|
|
6
|
+
// src/dropdown-menu.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
9
|
+
import {
|
|
10
|
+
CheckIcon,
|
|
11
|
+
ChevronRightIcon,
|
|
12
|
+
DotFilledIcon
|
|
13
|
+
} from "@radix-ui/react-icons";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
16
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
17
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
18
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
19
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
20
|
+
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
21
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: cn(
|
|
25
|
+
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",
|
|
26
|
+
inset && "pl-8",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
children,
|
|
32
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
37
|
+
var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
38
|
+
DropdownMenuPrimitive.SubContent,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn(
|
|
42
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
) }));
|
|
48
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
49
|
+
var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
50
|
+
DropdownMenuPrimitive.Content,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
sideOffset,
|
|
54
|
+
className: cn(
|
|
55
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
) }));
|
|
61
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
62
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
63
|
+
DropdownMenuPrimitive.Item,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
className: cn(
|
|
67
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
68
|
+
inset && "pl-8",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
75
|
+
var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
76
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: cn(
|
|
80
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
81
|
+
className
|
|
82
|
+
),
|
|
83
|
+
checked,
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
87
|
+
children
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
92
|
+
var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
93
|
+
DropdownMenuPrimitive.RadioItem,
|
|
94
|
+
{
|
|
95
|
+
ref,
|
|
96
|
+
className: cn(
|
|
97
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
...props,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotFilledIcon, { className: "size-4 fill-current" }) }) }),
|
|
103
|
+
children
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
));
|
|
107
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
108
|
+
var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
109
|
+
DropdownMenuPrimitive.Label,
|
|
110
|
+
{
|
|
111
|
+
ref,
|
|
112
|
+
className: cn(
|
|
113
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
114
|
+
inset && "pl-8",
|
|
115
|
+
className
|
|
116
|
+
),
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
));
|
|
120
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
121
|
+
var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
122
|
+
DropdownMenuPrimitive.Separator,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: cn("bg-muted -mx-1 my-1 h-px", className),
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
));
|
|
129
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
130
|
+
function DropdownMenuShortcut({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
138
|
+
...props
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
DropdownMenu,
|
|
144
|
+
DropdownMenuCheckboxItem,
|
|
145
|
+
DropdownMenuContent,
|
|
146
|
+
DropdownMenuGroup,
|
|
147
|
+
DropdownMenuItem,
|
|
148
|
+
DropdownMenuLabel,
|
|
149
|
+
DropdownMenuRadioGroup,
|
|
150
|
+
DropdownMenuRadioItem,
|
|
151
|
+
DropdownMenuSeparator,
|
|
152
|
+
DropdownMenuShortcut,
|
|
153
|
+
DropdownMenuSub,
|
|
154
|
+
DropdownMenuSubContent,
|
|
155
|
+
DropdownMenuSubTrigger,
|
|
156
|
+
DropdownMenuTrigger
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=dropdown-menu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuPrimitive.DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuPrimitive.DropdownMenuContentProps\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuPrimitive.DropdownMenuItemProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuPrimitive.DropdownMenuCheckboxItemProps\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuPrimitive.DropdownMenuRadioItemProps\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuPrimitive.DropdownMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuPrimitive.DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-muted -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"mappings":"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","names":[]}
|
package/dist/form.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
2
|
+
import * as react_hook_form from 'react-hook-form';
|
|
3
|
+
import { FieldError, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
|
|
7
|
+
declare const useFormField: () => {
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
isTouched: boolean;
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
error?: FieldError | undefined;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
formItemId: string;
|
|
16
|
+
formDescriptionId: string;
|
|
17
|
+
formMessageId: string;
|
|
18
|
+
};
|
|
19
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
20
|
+
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): React.JSX.Element;
|
|
21
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
23
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
24
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
26
|
+
|
|
27
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
package/dist/form.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
2
|
+
import * as react_hook_form from 'react-hook-form';
|
|
3
|
+
import { FieldError, FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
|
|
7
|
+
declare const useFormField: () => {
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
isTouched: boolean;
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
error?: FieldError | undefined;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
formItemId: string;
|
|
16
|
+
formDescriptionId: string;
|
|
17
|
+
formMessageId: string;
|
|
18
|
+
};
|
|
19
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
20
|
+
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): React.JSX.Element;
|
|
21
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
23
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
24
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
26
|
+
|
|
27
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|