@badnpm/ui 0.0.0 → 0.0.1
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/README.md +11 -11
- package/dist/cjs/components/accordion.cjs +24 -0
- package/dist/cjs/components/alert-dialog.cjs +56 -0
- package/dist/cjs/components/alert.cjs +34 -0
- package/dist/cjs/components/aspect-ratio.cjs +12 -0
- package/dist/cjs/components/attachment.cjs +80 -0
- package/dist/cjs/components/avatar.cjs +31 -0
- package/dist/cjs/components/badge.cjs +38 -0
- package/dist/cjs/components/breadcrumb.cjs +46 -0
- package/dist/cjs/components/bubble.cjs +66 -0
- package/dist/cjs/components/button-group.cjs +43 -0
- package/dist/cjs/components/calendar.cjs +100 -0
- package/dist/cjs/components/card.cjs +34 -0
- package/dist/cjs/components/carousel.cjs +113 -0
- package/dist/cjs/components/chart.cjs +160 -0
- package/dist/cjs/components/checkbox.cjs +13 -0
- package/dist/cjs/components/code-block.cjs +110 -0
- package/dist/cjs/components/collapsible.cjs +18 -0
- package/dist/cjs/components/combobox.cjs +96 -0
- package/dist/cjs/components/command.cjs +46 -0
- package/dist/cjs/components/context-menu.cjs +69 -0
- package/dist/cjs/components/dialog.cjs +50 -0
- package/dist/cjs/components/drawer.cjs +108 -0
- package/dist/cjs/components/dropdown-menu.cjs +68 -0
- package/dist/cjs/components/empty.cjs +42 -0
- package/dist/cjs/components/field.cjs +80 -0
- package/dist/cjs/components/hover-card.cjs +20 -0
- package/dist/cjs/components/input-group.cjs +66 -0
- package/dist/cjs/components/input-otp.cjs +46 -0
- package/dist/cjs/components/item.cjs +91 -0
- package/dist/cjs/components/kbd.cjs +14 -0
- package/dist/cjs/components/label.cjs +11 -0
- package/dist/cjs/components/marker.cjs +41 -0
- package/dist/cjs/components/menubar.cjs +75 -0
- package/dist/cjs/components/message-scroller.cjs +45 -0
- package/dist/cjs/components/message.cjs +30 -0
- package/dist/cjs/components/native-select.cjs +19 -0
- package/dist/cjs/components/navigation-menu.cjs +43 -0
- package/dist/cjs/components/pagination.cjs +36 -0
- package/dist/cjs/components/popover.cjs +31 -0
- package/dist/cjs/components/progress.cjs +28 -0
- package/dist/cjs/components/questionnaire.cjs +70 -0
- package/dist/cjs/components/radio-group.cjs +16 -0
- package/dist/cjs/components/resizable.cjs +39 -0
- package/dist/cjs/components/scroll-area.cjs +15 -0
- package/dist/cjs/components/select.cjs +47 -0
- package/dist/cjs/components/separator.cjs +11 -0
- package/dist/cjs/components/sheet.cjs +47 -0
- package/dist/cjs/components/sidebar.cjs +301 -0
- package/dist/cjs/components/skeleton.cjs +10 -0
- package/dist/cjs/components/slider.cjs +16 -0
- package/dist/cjs/components/spinner.cjs +11 -0
- package/dist/cjs/components/switch.cjs +12 -0
- package/dist/cjs/components/table.cjs +38 -0
- package/dist/cjs/components/tabs.cjs +37 -0
- package/dist/cjs/components/textarea.cjs +10 -0
- package/dist/cjs/components/toast.cjs +82 -0
- package/dist/cjs/components/toggle-group.cjs +47 -0
- package/dist/cjs/components/toggle.cjs +30 -0
- package/dist/cjs/components/tooltip.cjs +24 -0
- package/dist/cjs/components/trace.cjs +40 -0
- package/dist/cjs/hooks/use-highlighted-code.cjs +73 -0
- package/dist/cjs/hooks/use-hydrated.cjs +2 -2
- package/dist/cjs/hooks/use-mobile.cjs +36 -0
- package/dist/cjs/index.cjs +467 -0
- package/dist/cjs/lib/highlighter.cjs +96 -0
- package/dist/cjs/providers/preference-provider.cjs +13 -13
- package/dist/cjs/providers/theme-provider.cjs +10 -10
- package/dist/cjs/types/components/accordion.d.ts +9 -0
- package/dist/cjs/types/components/alert-dialog.d.ts +20 -0
- package/dist/cjs/types/components/alert.d.ts +13 -0
- package/dist/cjs/types/components/aspect-ratio.d.ts +7 -0
- package/dist/cjs/types/components/attachment.d.ts +26 -0
- package/dist/cjs/types/components/avatar.d.ts +13 -0
- package/dist/cjs/types/components/badge.d.ts +11 -0
- package/dist/cjs/types/components/breadcrumb.d.ts +12 -0
- package/dist/cjs/types/components/bubble.d.ts +19 -0
- package/dist/cjs/types/components/button-group.d.ts +14 -0
- package/dist/cjs/types/components/button.d.ts +4 -4
- package/dist/cjs/types/components/calendar.d.ts +12 -0
- package/dist/cjs/types/components/card.d.ts +13 -0
- package/dist/cjs/types/components/carousel.d.ts +31 -0
- package/dist/cjs/types/components/chart.d.ts +47 -0
- package/dist/cjs/types/components/checkbox.d.ts +6 -0
- package/dist/cjs/types/components/code-block.d.ts +29 -0
- package/dist/cjs/types/components/collapsible.d.ts +8 -0
- package/dist/cjs/types/components/combobox.d.ts +26 -0
- package/dist/cjs/types/components/command.d.ts +21 -0
- package/dist/cjs/types/components/context-menu.d.ts +31 -0
- package/dist/cjs/types/components/dialog.d.ts +19 -0
- package/dist/cjs/types/components/direction.d.ts +1 -0
- package/dist/cjs/types/components/drawer.d.ts +18 -0
- package/dist/cjs/types/components/dropdown-menu.d.ts +31 -0
- package/dist/cjs/types/components/empty.d.ts +15 -0
- package/dist/cjs/types/components/field.d.ts +28 -0
- package/dist/cjs/types/components/hover-card.d.ts +8 -0
- package/dist/cjs/types/components/index.d.ts +62 -0
- package/dist/cjs/types/components/input-group.d.ts +21 -0
- package/dist/cjs/types/components/input-otp.d.ts +13 -0
- package/dist/cjs/types/components/input.d.ts +2 -2
- package/dist/cjs/types/components/item.d.ts +25 -0
- package/dist/cjs/types/components/kbd.d.ts +6 -0
- package/dist/cjs/types/components/label.d.ts +5 -0
- package/dist/cjs/types/components/marker.d.ts +13 -0
- package/dist/cjs/types/components/menubar.d.ts +31 -0
- package/dist/cjs/types/components/message-scroller.d.ts +13 -0
- package/dist/cjs/types/components/message.d.ts +12 -0
- package/dist/cjs/types/components/native-select.d.ts +10 -0
- package/dist/cjs/types/components/navigation-menu.d.ts +15 -0
- package/dist/cjs/types/components/pagination.d.ts +19 -0
- package/dist/cjs/types/components/popover.d.ts +11 -0
- package/dist/cjs/types/components/progress.d.ts +10 -0
- package/dist/cjs/types/components/questionnaire.d.ts +21 -0
- package/dist/cjs/types/components/radio-group.d.ts +8 -0
- package/dist/cjs/types/components/resizable.d.ts +10 -0
- package/dist/cjs/types/components/scroll-area.d.ts +7 -0
- package/dist/cjs/types/components/select.d.ts +17 -0
- package/dist/cjs/types/components/separator.d.ts +6 -0
- package/dist/cjs/types/components/sheet.d.ts +16 -0
- package/dist/cjs/types/components/sidebar.d.ts +66 -0
- package/dist/cjs/types/components/skeleton.d.ts +5 -0
- package/dist/cjs/types/components/slider.d.ts +6 -0
- package/dist/cjs/types/components/spinner.d.ts +5 -0
- package/dist/cjs/types/components/switch.d.ts +8 -0
- package/dist/cjs/types/components/table.d.ts +12 -0
- package/dist/cjs/types/components/tabs.d.ts +14 -0
- package/dist/cjs/types/components/textarea.d.ts +5 -0
- package/dist/cjs/types/components/theme-toggle.d.ts +2 -2
- package/dist/cjs/types/components/toast.d.ts +19 -0
- package/dist/cjs/types/components/toggle-group.d.ts +13 -0
- package/dist/cjs/types/components/toggle.d.ts +12 -0
- package/dist/cjs/types/components/tooltip.d.ts +9 -0
- package/dist/cjs/types/components/trace.d.ts +20 -0
- package/dist/cjs/types/hooks/index.d.ts +2 -0
- package/dist/cjs/types/hooks/use-highlighted-code.d.ts +3 -0
- package/dist/cjs/types/hooks/use-mobile.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +65 -0
- package/dist/cjs/types/lib/highlighter.d.ts +11 -0
- package/dist/cjs/types/lib/index.d.ts +1 -0
- package/dist/cjs/types/providers/preference-provider.d.ts +2 -2
- package/dist/cjs/types/providers/theme-provider.d.ts +2 -2
- package/dist/esm/components/accordion.js +19 -0
- package/dist/esm/components/alert-dialog.js +43 -0
- package/dist/esm/components/alert.js +29 -0
- package/dist/esm/components/aspect-ratio.js +10 -0
- package/dist/esm/components/attachment.js +70 -0
- package/dist/esm/components/avatar.js +24 -0
- package/dist/esm/components/badge.js +35 -0
- package/dist/esm/components/breadcrumb.js +38 -0
- package/dist/esm/components/bubble.js +61 -0
- package/dist/esm/components/button-group.js +38 -0
- package/dist/esm/components/calendar.js +78 -0
- package/dist/esm/components/card.js +26 -0
- package/dist/esm/components/carousel.js +87 -0
- package/dist/esm/components/chart.js +133 -0
- package/dist/esm/components/checkbox.js +11 -0
- package/dist/esm/components/code-block.js +82 -0
- package/dist/esm/components/collapsible.js +14 -0
- package/dist/esm/components/combobox.js +60 -0
- package/dist/esm/components/command.js +36 -0
- package/dist/esm/components/context-menu.js +53 -0
- package/dist/esm/components/dialog.js +39 -0
- package/dist/esm/components/drawer.js +77 -0
- package/dist/esm/components/dropdown-menu.js +52 -0
- package/dist/esm/components/empty.js +35 -0
- package/dist/esm/components/field.js +69 -0
- package/dist/esm/components/hover-card.js +16 -0
- package/dist/esm/components/input-group.js +59 -0
- package/dist/esm/components/input-otp.js +22 -0
- package/dist/esm/components/item.js +80 -0
- package/dist/esm/components/kbd.js +11 -0
- package/dist/esm/components/label.js +9 -0
- package/dist/esm/components/marker.js +36 -0
- package/dist/esm/components/menubar.js +58 -0
- package/dist/esm/components/message-scroller.js +27 -0
- package/dist/esm/components/message.js +23 -0
- package/dist/esm/components/native-select.js +15 -0
- package/dist/esm/components/navigation-menu.js +33 -0
- package/dist/esm/components/pagination.js +28 -0
- package/dist/esm/components/popover.js +24 -0
- package/dist/esm/components/progress.js +22 -0
- package/dist/esm/components/questionnaire.js +54 -0
- package/dist/esm/components/radio-group.js +13 -0
- package/dist/esm/components/resizable.js +16 -0
- package/dist/esm/components/scroll-area.js +12 -0
- package/dist/esm/components/select.js +36 -0
- package/dist/esm/components/separator.js +9 -0
- package/dist/esm/components/sheet.js +38 -0
- package/dist/esm/components/sidebar.js +257 -0
- package/dist/esm/components/skeleton.js +8 -0
- package/dist/esm/components/slider.js +14 -0
- package/dist/esm/components/spinner.js +9 -0
- package/dist/esm/components/switch.js +10 -0
- package/dist/esm/components/table.js +29 -0
- package/dist/esm/components/tabs.js +31 -0
- package/dist/esm/components/textarea.js +8 -0
- package/dist/esm/components/toast.js +68 -0
- package/dist/esm/components/toggle-group.js +25 -0
- package/dist/esm/components/toggle.js +27 -0
- package/dist/esm/components/tooltip.js +19 -0
- package/dist/esm/components/trace.js +31 -0
- package/dist/esm/hooks/use-highlighted-code.js +52 -0
- package/dist/esm/hooks/use-mobile.js +15 -0
- package/dist/esm/index.js +65 -0
- package/dist/esm/lib/highlighter.js +93 -0
- package/dist/styles/custom.css +2 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/components/accordion.d.ts +9 -0
- package/dist/types/components/alert-dialog.d.ts +20 -0
- package/dist/types/components/alert.d.ts +13 -0
- package/dist/types/components/aspect-ratio.d.ts +7 -0
- package/dist/types/components/attachment.d.ts +26 -0
- package/dist/types/components/avatar.d.ts +13 -0
- package/dist/types/components/badge.d.ts +11 -0
- package/dist/types/components/breadcrumb.d.ts +12 -0
- package/dist/types/components/bubble.d.ts +19 -0
- package/dist/types/components/button-group.d.ts +14 -0
- package/dist/types/components/button.d.ts +4 -4
- package/dist/types/components/calendar.d.ts +12 -0
- package/dist/types/components/card.d.ts +13 -0
- package/dist/types/components/carousel.d.ts +31 -0
- package/dist/types/components/chart.d.ts +47 -0
- package/dist/types/components/checkbox.d.ts +6 -0
- package/dist/types/components/code-block.d.ts +29 -0
- package/dist/types/components/collapsible.d.ts +8 -0
- package/dist/types/components/combobox.d.ts +26 -0
- package/dist/types/components/command.d.ts +21 -0
- package/dist/types/components/context-menu.d.ts +31 -0
- package/dist/types/components/dialog.d.ts +19 -0
- package/dist/types/components/direction.d.ts +1 -0
- package/dist/types/components/drawer.d.ts +18 -0
- package/dist/types/components/dropdown-menu.d.ts +31 -0
- package/dist/types/components/empty.d.ts +15 -0
- package/dist/types/components/field.d.ts +28 -0
- package/dist/types/components/hover-card.d.ts +8 -0
- package/dist/types/components/index.d.ts +62 -0
- package/dist/types/components/input-group.d.ts +21 -0
- package/dist/types/components/input-otp.d.ts +13 -0
- package/dist/types/components/input.d.ts +2 -2
- package/dist/types/components/item.d.ts +25 -0
- package/dist/types/components/kbd.d.ts +6 -0
- package/dist/types/components/label.d.ts +5 -0
- package/dist/types/components/marker.d.ts +13 -0
- package/dist/types/components/menubar.d.ts +31 -0
- package/dist/types/components/message-scroller.d.ts +13 -0
- package/dist/types/components/message.d.ts +12 -0
- package/dist/types/components/native-select.d.ts +10 -0
- package/dist/types/components/navigation-menu.d.ts +15 -0
- package/dist/types/components/pagination.d.ts +19 -0
- package/dist/types/components/popover.d.ts +11 -0
- package/dist/types/components/progress.d.ts +10 -0
- package/dist/types/components/questionnaire.d.ts +21 -0
- package/dist/types/components/radio-group.d.ts +8 -0
- package/dist/types/components/resizable.d.ts +10 -0
- package/dist/types/components/scroll-area.d.ts +7 -0
- package/dist/types/components/select.d.ts +17 -0
- package/dist/types/components/separator.d.ts +6 -0
- package/dist/types/components/sheet.d.ts +16 -0
- package/dist/types/components/sidebar.d.ts +66 -0
- package/dist/types/components/skeleton.d.ts +5 -0
- package/dist/types/components/slider.d.ts +6 -0
- package/dist/types/components/spinner.d.ts +5 -0
- package/dist/types/components/switch.d.ts +8 -0
- package/dist/types/components/table.d.ts +12 -0
- package/dist/types/components/tabs.d.ts +14 -0
- package/dist/types/components/textarea.d.ts +5 -0
- package/dist/types/components/theme-toggle.d.ts +2 -2
- package/dist/types/components/toast.d.ts +19 -0
- package/dist/types/components/toggle-group.d.ts +13 -0
- package/dist/types/components/toggle.d.ts +12 -0
- package/dist/types/components/tooltip.d.ts +9 -0
- package/dist/types/components/trace.d.ts +20 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/use-highlighted-code.d.ts +3 -0
- package/dist/types/hooks/use-mobile.d.ts +3 -0
- package/dist/types/index.d.ts +65 -0
- package/dist/types/lib/highlighter.d.ts +11 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/providers/preference-provider.d.ts +2 -2
- package/dist/types/providers/theme-provider.d.ts +2 -2
- package/dist/umd/index.js +86764 -3487
- package/package.json +39 -4
- package/dist/styles/body.css +0 -7
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var contextMenu = require('@base-ui/react/context-menu');
|
|
6
|
+
var cn = require('cn');
|
|
7
|
+
var lucideReact = require('lucide-react');
|
|
8
|
+
|
|
9
|
+
function ContextMenu({ ...props }) {
|
|
10
|
+
return jsxRuntime.jsx(contextMenu.ContextMenu.Root, { "data-slot": "context-menu", ...props });
|
|
11
|
+
}
|
|
12
|
+
function ContextMenuPortal({ ...props }) {
|
|
13
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Portal, { "data-slot": "context-menu-portal", ...props }));
|
|
14
|
+
}
|
|
15
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
16
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Trigger, { "data-slot": "context-menu-trigger", className: cn.cn("select-none", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
|
|
19
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Portal, { children: jsxRuntime.jsx(contextMenu.ContextMenu.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: jsxRuntime.jsx(contextMenu.ContextMenu.Popup, { "data-slot": "context-menu-content", className: cn.cn("z-50 max-h-(--available-height) min-w-36 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:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
20
|
+
}
|
|
21
|
+
function ContextMenuGroup({ ...props }) {
|
|
22
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Group, { "data-slot": "context-menu-group", ...props }));
|
|
23
|
+
}
|
|
24
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
25
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.GroupLabel, { "data-slot": "context-menu-label", "data-inset": inset, className: cn.cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
28
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn.cn("group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function ContextMenuSub({ ...props }) {
|
|
31
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.SubmenuRoot, { "data-slot": "context-menu-sub", ...props }));
|
|
32
|
+
}
|
|
33
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
34
|
+
return (jsxRuntime.jsxs(contextMenu.ContextMenu.SubmenuTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn.cn("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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto" })] }));
|
|
35
|
+
}
|
|
36
|
+
function ContextMenuSubContent({ ...props }) {
|
|
37
|
+
return (jsxRuntime.jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "shadow-lg", side: "right", ...props }));
|
|
38
|
+
}
|
|
39
|
+
function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
40
|
+
return (jsxRuntime.jsxs(contextMenu.ContextMenu.CheckboxItem, { "data-slot": "context-menu-checkbox-item", "data-inset": inset, className: cn.cn("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 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", className), checked: checked, ...props, children: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2", children: jsxRuntime.jsx(contextMenu.ContextMenu.CheckboxItemIndicator, { children: jsxRuntime.jsx(lucideReact.CheckIcon, {}) }) }), children] }));
|
|
41
|
+
}
|
|
42
|
+
function ContextMenuRadioGroup({ ...props }) {
|
|
43
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.RadioGroup, { "data-slot": "context-menu-radio-group", ...props }));
|
|
44
|
+
}
|
|
45
|
+
function ContextMenuRadioItem({ className, children, inset, ...props }) {
|
|
46
|
+
return (jsxRuntime.jsxs(contextMenu.ContextMenu.RadioItem, { "data-slot": "context-menu-radio-item", "data-inset": inset, className: cn.cn("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 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", className), ...props, children: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2", children: jsxRuntime.jsx(contextMenu.ContextMenu.RadioItemIndicator, { children: jsxRuntime.jsx(lucideReact.CheckIcon, {}) }) }), children] }));
|
|
47
|
+
}
|
|
48
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
49
|
+
return (jsxRuntime.jsx(contextMenu.ContextMenu.Separator, { "data-slot": "context-menu-separator", className: cn.cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
52
|
+
return (jsxRuntime.jsx("span", { "data-slot": "context-menu-shortcut", className: cn.cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.ContextMenu = ContextMenu;
|
|
56
|
+
exports.ContextMenuCheckboxItem = ContextMenuCheckboxItem;
|
|
57
|
+
exports.ContextMenuContent = ContextMenuContent;
|
|
58
|
+
exports.ContextMenuGroup = ContextMenuGroup;
|
|
59
|
+
exports.ContextMenuItem = ContextMenuItem;
|
|
60
|
+
exports.ContextMenuLabel = ContextMenuLabel;
|
|
61
|
+
exports.ContextMenuPortal = ContextMenuPortal;
|
|
62
|
+
exports.ContextMenuRadioGroup = ContextMenuRadioGroup;
|
|
63
|
+
exports.ContextMenuRadioItem = ContextMenuRadioItem;
|
|
64
|
+
exports.ContextMenuSeparator = ContextMenuSeparator;
|
|
65
|
+
exports.ContextMenuShortcut = ContextMenuShortcut;
|
|
66
|
+
exports.ContextMenuSub = ContextMenuSub;
|
|
67
|
+
exports.ContextMenuSubContent = ContextMenuSubContent;
|
|
68
|
+
exports.ContextMenuSubTrigger = ContextMenuSubTrigger;
|
|
69
|
+
exports.ContextMenuTrigger = ContextMenuTrigger;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var dialog = require('@base-ui/react/dialog');
|
|
6
|
+
var cn = require('cn');
|
|
7
|
+
var button = require('./button.cjs');
|
|
8
|
+
var lucideReact = require('lucide-react');
|
|
9
|
+
|
|
10
|
+
function Dialog({ ...props }) {
|
|
11
|
+
return jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
12
|
+
}
|
|
13
|
+
function DialogTrigger({ ...props }) {
|
|
14
|
+
return jsxRuntime.jsx(dialog.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
15
|
+
}
|
|
16
|
+
function DialogPortal({ ...props }) {
|
|
17
|
+
return jsxRuntime.jsx(dialog.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
|
|
18
|
+
}
|
|
19
|
+
function DialogClose({ ...props }) {
|
|
20
|
+
return jsxRuntime.jsx(dialog.Dialog.Close, { "data-slot": "dialog-close", ...props });
|
|
21
|
+
}
|
|
22
|
+
function DialogOverlay({ className, ...props }) {
|
|
23
|
+
return (jsxRuntime.jsx(dialog.Dialog.Backdrop, { "data-slot": "dialog-overlay", className: cn.cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
26
|
+
return (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx(DialogOverlay, {}), jsxRuntime.jsxs(dialog.Dialog.Popup, { "data-slot": "dialog-content", className: cn.cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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", className), ...props, children: [children, showCloseButton && (jsxRuntime.jsxs(dialog.Dialog.Close, { "data-slot": "dialog-close", render: jsxRuntime.jsx(button.Button, { variant: "ghost", className: "absolute top-2 right-2", size: "icon-sm" }), children: [jsxRuntime.jsx(lucideReact.XIcon, {}), jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
27
|
+
}
|
|
28
|
+
function DialogHeader({ className, ...props }) {
|
|
29
|
+
return (jsxRuntime.jsx("div", { "data-slot": "dialog-header", className: cn.cn("flex flex-col gap-2", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
32
|
+
return (jsxRuntime.jsxs("div", { "data-slot": "dialog-footer", className: cn.cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (jsxRuntime.jsx(dialog.Dialog.Close, { render: jsxRuntime.jsx(button.Button, { variant: "outline" }), children: "Close" }))] }));
|
|
33
|
+
}
|
|
34
|
+
function DialogTitle({ className, ...props }) {
|
|
35
|
+
return (jsxRuntime.jsx(dialog.Dialog.Title, { "data-slot": "dialog-title", className: cn.cn("font-heading text-base leading-none font-medium", className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
function DialogDescription({ className, ...props }) {
|
|
38
|
+
return (jsxRuntime.jsx(dialog.Dialog.Description, { "data-slot": "dialog-description", className: cn.cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.Dialog = Dialog;
|
|
42
|
+
exports.DialogClose = DialogClose;
|
|
43
|
+
exports.DialogContent = DialogContent;
|
|
44
|
+
exports.DialogDescription = DialogDescription;
|
|
45
|
+
exports.DialogFooter = DialogFooter;
|
|
46
|
+
exports.DialogHeader = DialogHeader;
|
|
47
|
+
exports.DialogOverlay = DialogOverlay;
|
|
48
|
+
exports.DialogPortal = DialogPortal;
|
|
49
|
+
exports.DialogTitle = DialogTitle;
|
|
50
|
+
exports.DialogTrigger = DialogTrigger;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var drawer = require('@base-ui/react/drawer');
|
|
7
|
+
var cn = require('cn');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
|
+
|
|
28
|
+
const DrawerContext = React__namespace.createContext(null);
|
|
29
|
+
function useDrawer() {
|
|
30
|
+
const context = React__namespace.useContext(DrawerContext);
|
|
31
|
+
if (!context) {
|
|
32
|
+
throw new Error("useDrawer must be used within a Drawer.");
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
}
|
|
36
|
+
function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
|
|
37
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
38
|
+
const contextValue = React__namespace.useMemo(() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [hasSnapPoints, modal, showSwipeHandle, swipeDirection]);
|
|
39
|
+
return (jsxRuntime.jsx(DrawerContext.Provider, { value: contextValue, children: jsxRuntime.jsx(drawer.Drawer.Root, { "data-slot": "drawer", modal: modal, snapPoints: snapPoints, swipeDirection: swipeDirection, ...props }) }));
|
|
40
|
+
}
|
|
41
|
+
function DrawerTrigger({ ...props }) {
|
|
42
|
+
return jsxRuntime.jsx(drawer.Drawer.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
43
|
+
}
|
|
44
|
+
function DrawerPortal({ ...props }) {
|
|
45
|
+
return jsxRuntime.jsx(drawer.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
|
|
46
|
+
}
|
|
47
|
+
function DrawerClose({ ...props }) {
|
|
48
|
+
return jsxRuntime.jsx(drawer.Drawer.Close, { "data-slot": "drawer-close", ...props });
|
|
49
|
+
}
|
|
50
|
+
function DrawerOverlay({ className, ...props }) {
|
|
51
|
+
return (jsxRuntime.jsx(drawer.Drawer.Backdrop, { "data-slot": "drawer-overlay", className: cn.cn("fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className), ...props }));
|
|
52
|
+
}
|
|
53
|
+
function DrawerSwipeHandle({ className, ...props }) {
|
|
54
|
+
return (jsxRuntime.jsx("div", { "data-slot": "drawer-swipe-handle", "aria-hidden": "true", className: cn.cn("relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing", className), ...props }));
|
|
55
|
+
}
|
|
56
|
+
function DrawerContent({ className, children, ...props }) {
|
|
57
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
58
|
+
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
59
|
+
return (jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [modal === true && (jsxRuntime.jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : undefined })), jsxRuntime.jsx(drawer.Drawer.Viewport, { "data-slot": "drawer-viewport", "data-modal": modal, className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto", children: jsxRuntime.jsxs(drawer.Drawer.Popup, { "data-slot": "drawer-popup", "data-swipe-axis": swipeAxis, "data-snap-points": hasSnapPoints ? "" : undefined, className: cn.cn(
|
|
60
|
+
// Base.
|
|
61
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
|
|
62
|
+
// Nested.
|
|
63
|
+
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
64
|
+
// Bleed.
|
|
65
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
|
|
66
|
+
// Sizing.
|
|
67
|
+
"[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
|
|
68
|
+
// Stack.
|
|
69
|
+
"[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
|
|
70
|
+
// Transitions.
|
|
71
|
+
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
|
|
72
|
+
// Axis: y.
|
|
73
|
+
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
74
|
+
// Axis: x.
|
|
75
|
+
"data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
|
|
76
|
+
// Direction: down.
|
|
77
|
+
"data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
|
|
78
|
+
// Direction: up.
|
|
79
|
+
"data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
|
|
80
|
+
// Direction: left.
|
|
81
|
+
"data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
|
|
82
|
+
// Direction: right.
|
|
83
|
+
"data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]", className), ...props, children: [showSwipeHandle && jsxRuntime.jsx(DrawerSwipeHandle, {}), jsxRuntime.jsx(drawer.Drawer.Content, { "data-slot": "drawer-content", className: cn.cn("flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"), children: children })] }) })] }));
|
|
84
|
+
}
|
|
85
|
+
function DrawerHeader({ className, ...props }) {
|
|
86
|
+
return (jsxRuntime.jsx("div", { "data-slot": "drawer-header", className: cn.cn("flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left", className), ...props }));
|
|
87
|
+
}
|
|
88
|
+
function DrawerFooter({ className, ...props }) {
|
|
89
|
+
return (jsxRuntime.jsx("div", { "data-slot": "drawer-footer", className: cn.cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className), ...props }));
|
|
90
|
+
}
|
|
91
|
+
function DrawerTitle({ className, ...props }) {
|
|
92
|
+
return (jsxRuntime.jsx(drawer.Drawer.Title, { "data-slot": "drawer-title", className: cn.cn("font-heading text-base font-medium text-foreground", className), ...props }));
|
|
93
|
+
}
|
|
94
|
+
function DrawerDescription({ className, ...props }) {
|
|
95
|
+
return (jsxRuntime.jsx(drawer.Drawer.Description, { "data-slot": "drawer-description", className: cn.cn("text-sm text-balance text-muted-foreground", className), ...props }));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
exports.Drawer = Drawer;
|
|
99
|
+
exports.DrawerClose = DrawerClose;
|
|
100
|
+
exports.DrawerContent = DrawerContent;
|
|
101
|
+
exports.DrawerDescription = DrawerDescription;
|
|
102
|
+
exports.DrawerFooter = DrawerFooter;
|
|
103
|
+
exports.DrawerHeader = DrawerHeader;
|
|
104
|
+
exports.DrawerOverlay = DrawerOverlay;
|
|
105
|
+
exports.DrawerPortal = DrawerPortal;
|
|
106
|
+
exports.DrawerSwipeHandle = DrawerSwipeHandle;
|
|
107
|
+
exports.DrawerTitle = DrawerTitle;
|
|
108
|
+
exports.DrawerTrigger = DrawerTrigger;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var menu = require('@base-ui/react/menu');
|
|
5
|
+
var cn = require('cn');
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
|
+
|
|
8
|
+
function DropdownMenu({ ...props }) {
|
|
9
|
+
return jsxRuntime.jsx(menu.Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DropdownMenuPortal({ ...props }) {
|
|
12
|
+
return jsxRuntime.jsx(menu.Menu.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
15
|
+
return jsxRuntime.jsx(menu.Menu.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
|
|
18
|
+
return (jsxRuntime.jsx(menu.Menu.Portal, { children: jsxRuntime.jsx(menu.Menu.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: jsxRuntime.jsx(menu.Menu.Popup, { "data-slot": "dropdown-menu-content", className: cn.cn("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", className), ...props }) }) }));
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuGroup({ ...props }) {
|
|
21
|
+
return jsxRuntime.jsx(menu.Menu.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
22
|
+
}
|
|
23
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
24
|
+
return (jsxRuntime.jsx(menu.Menu.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn.cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
27
|
+
return (jsxRuntime.jsx(menu.Menu.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn.cn("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", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DropdownMenuSub({ ...props }) {
|
|
30
|
+
return jsxRuntime.jsx(menu.Menu.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
|
|
31
|
+
}
|
|
32
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
33
|
+
return (jsxRuntime.jsxs(menu.Menu.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn.cn("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", className), ...props, children: [children, jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto" })] }));
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
|
|
36
|
+
return (jsxRuntime.jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn.cn("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", className), align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props }));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
39
|
+
return (jsxRuntime.jsxs(menu.Menu.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn.cn("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", className), checked: checked, ...props, children: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: jsxRuntime.jsx(menu.Menu.CheckboxItemIndicator, { children: jsxRuntime.jsx(lucideReact.CheckIcon, {}) }) }), children] }));
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
42
|
+
return (jsxRuntime.jsx(menu.Menu.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
43
|
+
}
|
|
44
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
45
|
+
return (jsxRuntime.jsxs(menu.Menu.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn.cn("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", className), ...props, children: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: jsxRuntime.jsx(menu.Menu.RadioItemIndicator, { children: jsxRuntime.jsx(lucideReact.CheckIcon, {}) }) }), children] }));
|
|
46
|
+
}
|
|
47
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
48
|
+
return (jsxRuntime.jsx(menu.Menu.Separator, { "data-slot": "dropdown-menu-separator", className: cn.cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
51
|
+
return (jsxRuntime.jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn.cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className), ...props }));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.DropdownMenu = DropdownMenu;
|
|
55
|
+
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
56
|
+
exports.DropdownMenuContent = DropdownMenuContent;
|
|
57
|
+
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
58
|
+
exports.DropdownMenuItem = DropdownMenuItem;
|
|
59
|
+
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
60
|
+
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
61
|
+
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
62
|
+
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
63
|
+
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
64
|
+
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
65
|
+
exports.DropdownMenuSub = DropdownMenuSub;
|
|
66
|
+
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
67
|
+
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
68
|
+
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
var cn = require('cn');
|
|
6
|
+
|
|
7
|
+
function Empty({ className, ...props }) {
|
|
8
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty", className: cn.cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function EmptyHeader({ className, ...props }) {
|
|
11
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty-header", className: cn.cn("flex max-w-sm flex-col items-center gap-2", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
const emptyMediaVariants = classVarianceAuthority.cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
default: "bg-transparent",
|
|
17
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
25
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn.cn(emptyMediaVariants({ variant, className })), ...props }));
|
|
26
|
+
}
|
|
27
|
+
function EmptyTitle({ className, ...props }) {
|
|
28
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty-title", className: cn.cn("font-heading text-sm font-medium tracking-tight", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function EmptyDescription({ className, ...props }) {
|
|
31
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty-description", className: cn.cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
function EmptyContent({ className, ...props }) {
|
|
34
|
+
return (jsxRuntime.jsx("div", { "data-slot": "empty-content", className: cn.cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance", className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.Empty = Empty;
|
|
38
|
+
exports.EmptyContent = EmptyContent;
|
|
39
|
+
exports.EmptyDescription = EmptyDescription;
|
|
40
|
+
exports.EmptyHeader = EmptyHeader;
|
|
41
|
+
exports.EmptyMedia = EmptyMedia;
|
|
42
|
+
exports.EmptyTitle = EmptyTitle;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var cn = require('cn');
|
|
7
|
+
var label = require('./label.cjs');
|
|
8
|
+
var separator = require('./separator.cjs');
|
|
9
|
+
|
|
10
|
+
function FieldSet({ className, ...props }) {
|
|
11
|
+
return (jsxRuntime.jsx("fieldset", { "data-slot": "field-set", className: cn.cn("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
14
|
+
return (jsxRuntime.jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn.cn("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function FieldGroup({ className, ...props }) {
|
|
17
|
+
return (jsxRuntime.jsx("div", { "data-slot": "field-group", className: cn.cn("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
const fieldVariants = classVarianceAuthority.cva("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
20
|
+
variants: {
|
|
21
|
+
orientation: {
|
|
22
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
23
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
24
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
orientation: "vertical",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
32
|
+
return (jsxRuntime.jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn.cn(fieldVariants({ orientation }), className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
function FieldContent({ className, ...props }) {
|
|
35
|
+
return (jsxRuntime.jsx("div", { "data-slot": "field-content", className: cn.cn("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
function FieldLabel({ className, ...props }) {
|
|
38
|
+
return (jsxRuntime.jsx(label.Label, { "data-slot": "field-label", className: cn.cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
function FieldTitle({ className, ...props }) {
|
|
41
|
+
return (jsxRuntime.jsx("div", { "data-slot": "field-label", className: cn.cn("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
|
|
42
|
+
}
|
|
43
|
+
function FieldDescription({ className, ...props }) {
|
|
44
|
+
return (jsxRuntime.jsx("p", { "data-slot": "field-description", className: cn.cn("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
|
|
45
|
+
}
|
|
46
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
47
|
+
return (jsxRuntime.jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn.cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [jsxRuntime.jsx(separator.Separator, { className: "absolute inset-0 top-1/2" }), children && (jsxRuntime.jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
|
|
48
|
+
}
|
|
49
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
50
|
+
const content = React.useMemo(() => {
|
|
51
|
+
if (children) {
|
|
52
|
+
return children;
|
|
53
|
+
}
|
|
54
|
+
if (!errors?.length) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const uniqueErrors = [
|
|
58
|
+
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
59
|
+
];
|
|
60
|
+
if (uniqueErrors?.length == 1) {
|
|
61
|
+
return uniqueErrors[0]?.message;
|
|
62
|
+
}
|
|
63
|
+
return (jsxRuntime.jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map((error, index) => error?.message && jsxRuntime.jsx("li", { children: error.message }, index)) }));
|
|
64
|
+
}, [children, errors]);
|
|
65
|
+
if (!content) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return (jsxRuntime.jsx("div", { role: "alert", "data-slot": "field-error", className: cn.cn("text-sm font-normal text-destructive", className), ...props, children: content }));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exports.Field = Field;
|
|
72
|
+
exports.FieldContent = FieldContent;
|
|
73
|
+
exports.FieldDescription = FieldDescription;
|
|
74
|
+
exports.FieldError = FieldError;
|
|
75
|
+
exports.FieldGroup = FieldGroup;
|
|
76
|
+
exports.FieldLabel = FieldLabel;
|
|
77
|
+
exports.FieldLegend = FieldLegend;
|
|
78
|
+
exports.FieldSeparator = FieldSeparator;
|
|
79
|
+
exports.FieldSet = FieldSet;
|
|
80
|
+
exports.FieldTitle = FieldTitle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var previewCard = require('@base-ui/react/preview-card');
|
|
6
|
+
var cn = require('cn');
|
|
7
|
+
|
|
8
|
+
function HoverCard({ ...props }) {
|
|
9
|
+
return jsxRuntime.jsx(previewCard.PreviewCard.Root, { "data-slot": "hover-card", ...props });
|
|
10
|
+
}
|
|
11
|
+
function HoverCardTrigger({ ...props }) {
|
|
12
|
+
return (jsxRuntime.jsx(previewCard.PreviewCard.Trigger, { "data-slot": "hover-card-trigger", ...props }));
|
|
13
|
+
}
|
|
14
|
+
function HoverCardContent({ className, side = "bottom", sideOffset = 4, align = "center", alignOffset = 4, ...props }) {
|
|
15
|
+
return (jsxRuntime.jsx(previewCard.PreviewCard.Portal, { "data-slot": "hover-card-portal", children: jsxRuntime.jsx(previewCard.PreviewCard.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: jsxRuntime.jsx(previewCard.PreviewCard.Popup, { "data-slot": "hover-card-content", className: cn.cn("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.HoverCard = HoverCard;
|
|
19
|
+
exports.HoverCardContent = HoverCardContent;
|
|
20
|
+
exports.HoverCardTrigger = HoverCardTrigger;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var cn = require('cn');
|
|
7
|
+
var button = require('./button.cjs');
|
|
8
|
+
var input = require('./input.cjs');
|
|
9
|
+
var textarea = require('./textarea.cjs');
|
|
10
|
+
|
|
11
|
+
function InputGroup({ className, ...props }) {
|
|
12
|
+
return (jsxRuntime.jsx("div", { "data-slot": "input-group", role: "group", className: cn.cn("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
const inputGroupAddonVariants = classVarianceAuthority.cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
15
|
+
variants: {
|
|
16
|
+
align: {
|
|
17
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
18
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
19
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
20
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
align: "inline-start",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
28
|
+
return (jsxRuntime.jsx("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, className: cn.cn(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
29
|
+
if (e.target.closest("button")) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
33
|
+
}, ...props }));
|
|
34
|
+
}
|
|
35
|
+
const inputGroupButtonVariants = classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none", {
|
|
36
|
+
variants: {
|
|
37
|
+
size: {
|
|
38
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
39
|
+
sm: "",
|
|
40
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
41
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
size: "xs",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
49
|
+
return (jsxRuntime.jsx(button.Button, { type: type, "data-size": size, variant: variant, className: cn.cn(inputGroupButtonVariants({ size }), className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function InputGroupText({ className, ...props }) {
|
|
52
|
+
return (jsxRuntime.jsx("span", { className: cn.cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
function InputGroupInput({ className, ...props }) {
|
|
55
|
+
return (jsxRuntime.jsx(input.Input, { "data-slot": "input-group-control", className: cn.cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), ...props }));
|
|
56
|
+
}
|
|
57
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
58
|
+
return (jsxRuntime.jsx(textarea.Textarea, { "data-slot": "input-group-control", className: cn.cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), ...props }));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.InputGroup = InputGroup;
|
|
62
|
+
exports.InputGroupAddon = InputGroupAddon;
|
|
63
|
+
exports.InputGroupButton = InputGroupButton;
|
|
64
|
+
exports.InputGroupInput = InputGroupInput;
|
|
65
|
+
exports.InputGroupText = InputGroupText;
|
|
66
|
+
exports.InputGroupTextarea = InputGroupTextarea;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var cn = require('cn');
|
|
6
|
+
var inputOtp = require('input-otp');
|
|
7
|
+
var lucideReact = require('lucide-react');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
|
+
|
|
28
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
29
|
+
return (jsxRuntime.jsx(inputOtp.OTPInput, { "data-slot": "input-otp", containerClassName: cn.cn("cn-input-otp flex items-center has-disabled:opacity-50", containerClassName), spellCheck: false, className: cn.cn("disabled:cursor-not-allowed", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function InputOTPGroup({ className, ...props }) {
|
|
32
|
+
return (jsxRuntime.jsx("div", { "data-slot": "input-otp-group", className: cn.cn("flex items-center rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
35
|
+
const inputOTPContext = React__namespace.useContext(inputOtp.OTPInputContext);
|
|
36
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
37
|
+
return (jsxRuntime.jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn.cn("relative flex size-8 items-center justify-center border-y border-r border-input text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className), ...props, children: [char, hasFakeCaret && (jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: jsxRuntime.jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) }))] }));
|
|
38
|
+
}
|
|
39
|
+
function InputOTPSeparator({ ...props }) {
|
|
40
|
+
return (jsxRuntime.jsx("div", { "data-slot": "input-otp-separator", className: "flex items-center [&_svg:not([class*='size-'])]:size-4", role: "separator", ...props, children: jsxRuntime.jsx(lucideReact.MinusIcon, {}) }));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.InputOTP = InputOTP;
|
|
44
|
+
exports.InputOTPGroup = InputOTPGroup;
|
|
45
|
+
exports.InputOTPSeparator = InputOTPSeparator;
|
|
46
|
+
exports.InputOTPSlot = InputOTPSlot;
|