@betfin/ui 0.1.0
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/chunk-3CAXHUAL.js +23 -0
- package/dist/chunk-3CAXHUAL.js.map +1 -0
- package/dist/chunk-3YCD2QLS.js +113 -0
- package/dist/chunk-3YCD2QLS.js.map +1 -0
- package/dist/chunk-5CXIFF6J.js +46 -0
- package/dist/chunk-5CXIFF6J.js.map +1 -0
- package/dist/chunk-EP6DYU4N.js +26 -0
- package/dist/chunk-EP6DYU4N.js.map +1 -0
- package/dist/chunk-FHYW2QBY.js +21 -0
- package/dist/chunk-FHYW2QBY.js.map +1 -0
- package/dist/chunk-HRFMTZ55.js +49 -0
- package/dist/chunk-HRFMTZ55.js.map +1 -0
- package/dist/chunk-ILNHKDYA.js +107 -0
- package/dist/chunk-ILNHKDYA.js.map +1 -0
- package/dist/chunk-JTVU6ANA.js +37 -0
- package/dist/chunk-JTVU6ANA.js.map +1 -0
- package/dist/chunk-K7JWN6NH.js +21 -0
- package/dist/chunk-K7JWN6NH.js.map +1 -0
- package/dist/chunk-QZIKXMHP.js +131 -0
- package/dist/chunk-QZIKXMHP.js.map +1 -0
- package/dist/chunk-SSC2M625.js +24 -0
- package/dist/chunk-SSC2M625.js.map +1 -0
- package/dist/chunk-TLULUIYC.js +14 -0
- package/dist/chunk-TLULUIYC.js.map +1 -0
- package/dist/chunk-VJ6P5FFS.js +90 -0
- package/dist/chunk-VJ6P5FFS.js.map +1 -0
- package/dist/chunk-Y2TKUANL.js +11 -0
- package/dist/chunk-Y2TKUANL.js.map +1 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +59 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +144 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/app-header.d.ts +19 -0
- package/dist/components/app-header.js +17 -0
- package/dist/components/app-header.js.map +1 -0
- package/dist/components/badge.d.ts +7 -0
- package/dist/components/badge.js +47 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/bet-value.d.ts +49 -0
- package/dist/components/bet-value.js +12 -0
- package/dist/components/bet-value.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumb.js +65 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +8 -0
- package/dist/components/button.js +10 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +10 -0
- package/dist/components/calendar.js +145 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +153 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +39 -0
- package/dist/components/chart.js +219 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +3 -0
- package/dist/components/checkbox.js +26 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +20 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +19 -0
- package/dist/components/command.js +130 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +186 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +28 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +16 -0
- package/dist/components/drawer.js +164 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +207 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/input-group.d.ts +18 -0
- package/dist/components/input-group.js +22 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +8 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/loading.d.ts +9 -0
- package/dist/components/loading.js +26 -0
- package/dist/components/loading.js.map +1 -0
- package/dist/components/member-profile.d.ts +79 -0
- package/dist/components/member-profile.js +342 -0
- package/dist/components/member-profile.js.map +1 -0
- package/dist/components/popover.d.ts +9 -0
- package/dist/components/popover.js +52 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/progress.js +40 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +31 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +4 -0
- package/dist/components/scroll-area.js +42 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +136 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +23 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +63 -0
- package/dist/components/sidebar.js +536 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +8 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +3 -0
- package/dist/components/slider.js +45 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.js +39 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.js +36 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +56 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +10 -0
- package/dist/components/tabs.js +63 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +8 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +11 -0
- package/dist/components/toggle-group.js +80 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +8 -0
- package/dist/components/toggle.js +11 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +6 -0
- package/dist/components/tooltip.js +14 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +7 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/date.d.ts +14 -0
- package/dist/lib/date.js +24 -0
- package/dist/lib/date.js.map +1 -0
- package/dist/lib/format.d.ts +16 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +71 -0
- package/src/styles/globals.css +151 -0
- package/src/styles/theme.css +144 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../chunk-Y2TKUANL.js";
|
|
4
|
+
|
|
5
|
+
// src/components/context-menu.tsx
|
|
6
|
+
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
7
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function ContextMenu({ ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
11
|
+
}
|
|
12
|
+
function ContextMenuPortal({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
|
|
14
|
+
}
|
|
15
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...props });
|
|
17
|
+
}
|
|
18
|
+
function ContextMenuContent({
|
|
19
|
+
className,
|
|
20
|
+
align = "start",
|
|
21
|
+
alignOffset = 4,
|
|
22
|
+
side = "right",
|
|
23
|
+
sideOffset = 0,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align, alignOffset, side, sideOffset, children: /* @__PURE__ */ jsx(
|
|
27
|
+
ContextMenuPrimitive.Popup,
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "context-menu-content",
|
|
30
|
+
className: cn(
|
|
31
|
+
"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:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
) }) });
|
|
37
|
+
}
|
|
38
|
+
function ContextMenuGroup({ ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
|
|
40
|
+
}
|
|
41
|
+
function ContextMenuLabel({
|
|
42
|
+
className,
|
|
43
|
+
inset,
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
ContextMenuPrimitive.GroupLabel,
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "context-menu-label",
|
|
50
|
+
"data-inset": inset,
|
|
51
|
+
className: cn("px-1.5 py-1 font-medium text-muted-foreground text-xs data-inset:pl-7", className),
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function ContextMenuItem({
|
|
57
|
+
className,
|
|
58
|
+
inset,
|
|
59
|
+
variant = "default",
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
ContextMenuPrimitive.Item,
|
|
64
|
+
{
|
|
65
|
+
"data-slot": "context-menu-item",
|
|
66
|
+
"data-inset": inset,
|
|
67
|
+
"data-variant": variant,
|
|
68
|
+
className: cn(
|
|
69
|
+
"group/context-menu-item relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
70
|
+
className
|
|
71
|
+
),
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function ContextMenuSub({ ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.SubmenuRoot, { "data-slot": "context-menu-sub", ...props });
|
|
78
|
+
}
|
|
79
|
+
function ContextMenuSubTrigger({
|
|
80
|
+
className,
|
|
81
|
+
inset,
|
|
82
|
+
children,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
ContextMenuPrimitive.SubmenuTrigger,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "context-menu-sub-trigger",
|
|
89
|
+
"data-inset": inset,
|
|
90
|
+
className: cn(
|
|
91
|
+
"flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-inset:pl-7 data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
...props,
|
|
95
|
+
children: [
|
|
96
|
+
children,
|
|
97
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function ContextMenuSubContent({ ...props }) {
|
|
103
|
+
return /* @__PURE__ */ jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "shadow-lg", side: "right", ...props });
|
|
104
|
+
}
|
|
105
|
+
function ContextMenuCheckboxItem({
|
|
106
|
+
className,
|
|
107
|
+
children,
|
|
108
|
+
checked,
|
|
109
|
+
inset,
|
|
110
|
+
...props
|
|
111
|
+
}) {
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
114
|
+
{
|
|
115
|
+
"data-slot": "context-menu-checkbox-item",
|
|
116
|
+
"data-inset": inset,
|
|
117
|
+
className: cn(
|
|
118
|
+
"relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
119
|
+
className
|
|
120
|
+
),
|
|
121
|
+
checked,
|
|
122
|
+
...props,
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) }) }),
|
|
125
|
+
children
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function ContextMenuRadioGroup({ ...props }) {
|
|
131
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props });
|
|
132
|
+
}
|
|
133
|
+
function ContextMenuRadioItem({
|
|
134
|
+
className,
|
|
135
|
+
children,
|
|
136
|
+
inset,
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ jsxs(
|
|
140
|
+
ContextMenuPrimitive.RadioItem,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "context-menu-radio-item",
|
|
143
|
+
"data-inset": inset,
|
|
144
|
+
className: cn(
|
|
145
|
+
"relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
146
|
+
className
|
|
147
|
+
),
|
|
148
|
+
...props,
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) }) }),
|
|
151
|
+
children
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
157
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, { "data-slot": "context-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props });
|
|
158
|
+
}
|
|
159
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "context-menu-shortcut",
|
|
164
|
+
className: cn("ml-auto text-muted-foreground text-xs tracking-widest group-focus/context-menu-item:text-accent-foreground", className),
|
|
165
|
+
...props
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
ContextMenu,
|
|
171
|
+
ContextMenuCheckboxItem,
|
|
172
|
+
ContextMenuContent,
|
|
173
|
+
ContextMenuGroup,
|
|
174
|
+
ContextMenuItem,
|
|
175
|
+
ContextMenuLabel,
|
|
176
|
+
ContextMenuPortal,
|
|
177
|
+
ContextMenuRadioGroup,
|
|
178
|
+
ContextMenuRadioItem,
|
|
179
|
+
ContextMenuSeparator,
|
|
180
|
+
ContextMenuShortcut,
|
|
181
|
+
ContextMenuSub,
|
|
182
|
+
ContextMenuSubContent,
|
|
183
|
+
ContextMenuSubTrigger,
|
|
184
|
+
ContextMenuTrigger
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/context-menu.tsx"],"sourcesContent":["import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';\nimport { cn } from '@betfin/ui/lib/utils';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport type * as React from 'react';\n\nfunction ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {\n\treturn <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {\n\treturn <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: ContextMenuPrimitive.Trigger.Props) {\n\treturn <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" className={cn('select-none', className)} {...props} />;\n}\n\nfunction ContextMenuContent({\n\tclassName,\n\talign = 'start',\n\talignOffset = 4,\n\tside = 'right',\n\tsideOffset = 0,\n\t...props\n}: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {\n\treturn (\n\t\t<ContextMenuPrimitive.Portal>\n\t\t\t<ContextMenuPrimitive.Positioner className=\"isolate z-50 outline-none\" align={align} alignOffset={alignOffset} side={side} sideOffset={sideOffset}>\n\t\t\t\t<ContextMenuPrimitive.Popup\n\t\t\t\t\tdata-slot=\"context-menu-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'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:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</ContextMenuPrimitive.Positioner>\n\t\t</ContextMenuPrimitive.Portal>\n\t);\n}\n\nfunction ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {\n\treturn <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuLabel({\n\tclassName,\n\tinset,\n\t...props\n}: ContextMenuPrimitive.GroupLabel.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<ContextMenuPrimitive.GroupLabel\n\t\t\tdata-slot=\"context-menu-label\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn('px-1.5 py-1 font-medium text-muted-foreground text-xs data-inset:pl-7', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ContextMenuItem({\n\tclassName,\n\tinset,\n\tvariant = 'default',\n\t...props\n}: ContextMenuPrimitive.Item.Props & {\n\tinset?: boolean;\n\tvariant?: 'default' | 'destructive';\n}) {\n\treturn (\n\t\t<ContextMenuPrimitive.Item\n\t\t\tdata-slot=\"context-menu-item\"\n\t\t\tdata-inset={inset}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t\"group/context-menu-item relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {\n\treturn <ContextMenuPrimitive.SubmenuRoot data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: ContextMenuPrimitive.SubmenuTrigger.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<ContextMenuPrimitive.SubmenuTrigger\n\t\t\tdata-slot=\"context-menu-sub-trigger\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-inset:pl-7 data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</ContextMenuPrimitive.SubmenuTrigger>\n\t);\n}\n\nfunction ContextMenuSubContent({ ...props }: React.ComponentProps<typeof ContextMenuContent>) {\n\treturn <ContextMenuContent data-slot=\"context-menu-sub-content\" className=\"shadow-lg\" side=\"right\" {...props} />;\n}\n\nfunction ContextMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tinset,\n\t...props\n}: ContextMenuPrimitive.CheckboxItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<ContextMenuPrimitive.CheckboxItem\n\t\t\tdata-slot=\"context-menu-checkbox-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"pointer-events-none absolute right-2\">\n\t\t\t\t<ContextMenuPrimitive.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</ContextMenuPrimitive.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</ContextMenuPrimitive.CheckboxItem>\n\t);\n}\n\nfunction ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Props) {\n\treturn <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuRadioItem({\n\tclassName,\n\tchildren,\n\tinset,\n\t...props\n}: ContextMenuPrimitive.RadioItem.Props & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<ContextMenuPrimitive.RadioItem\n\t\t\tdata-slot=\"context-menu-radio-item\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"pointer-events-none absolute right-2\">\n\t\t\t\t<ContextMenuPrimitive.RadioItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</ContextMenuPrimitive.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</ContextMenuPrimitive.RadioItem>\n\t);\n}\n\nfunction ContextMenuSeparator({ className, ...props }: ContextMenuPrimitive.Separator.Props) {\n\treturn <ContextMenuPrimitive.Separator data-slot=\"context-menu-separator\" className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />;\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"context-menu-shortcut\"\n\t\t\tclassName={cn('ml-auto text-muted-foreground text-xs tracking-widest group-focus/context-menu-item:text-accent-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tContextMenu,\n\tContextMenuCheckboxItem,\n\tContextMenuContent,\n\tContextMenuGroup,\n\tContextMenuItem,\n\tContextMenuLabel,\n\tContextMenuPortal,\n\tContextMenuRadioGroup,\n\tContextMenuRadioItem,\n\tContextMenuSeparator,\n\tContextMenuShortcut,\n\tContextMenuSub,\n\tContextMenuSubContent,\n\tContextMenuSubTrigger,\n\tContextMenuTrigger,\n};\n"],"mappings":";;;;;AAAA,SAAS,eAAe,4BAA4B;AAEpD,SAAS,WAAW,wB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aAAU,4BAA4B,GAAG,OAAO;AACzF;AAEA,SAAS,qBAAqB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAEG;AACF,SACC;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACA,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,UAAK,WAAU,wCACf,8BAAC,qBAAqB,oBAArB,EACA,8BAAC,aAAU,GACZ,GACD;AAAA,QACC;AAAA;AAAA;AAAA,EACF;AAEF;AAEA,SAAS,qBAAqB,EAAE,WAAW,GAAG,MAAM,GAAyC;AAC5F,SAAO,oBAAC,qBAAqB,WAArB,EAA+B,aAAU,0BAAyB,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAAO;AAC7I;AAEA,SAAS,oBAAoB,EAAE,WAAW,GAAG,MAAM,GAAiC;AACnF,SACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,8GAA8G,SAAS;AAAA,MACpI,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<'div'> & {
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
|
|
16
|
+
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
|
|
17
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogOverlay,
|
|
10
|
+
DialogPortal,
|
|
11
|
+
DialogTitle,
|
|
12
|
+
DialogTrigger
|
|
13
|
+
} from "../chunk-3YCD2QLS.js";
|
|
14
|
+
import "../chunk-5CXIFF6J.js";
|
|
15
|
+
import "../chunk-Y2TKUANL.js";
|
|
16
|
+
export {
|
|
17
|
+
Dialog,
|
|
18
|
+
DialogClose,
|
|
19
|
+
DialogContent,
|
|
20
|
+
DialogDescription,
|
|
21
|
+
DialogFooter,
|
|
22
|
+
DialogHeader,
|
|
23
|
+
DialogOverlay,
|
|
24
|
+
DialogPortal,
|
|
25
|
+
DialogTitle,
|
|
26
|
+
DialogTrigger
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Drawer as DrawerPrimitive } from '@base-ui/react/drawer';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Drawer({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }: DrawerPrimitive.Root.Props & {
|
|
4
|
+
showSwipeHandle?: boolean;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props): React.JSX.Element;
|
|
7
|
+
declare function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props): React.JSX.Element;
|
|
8
|
+
declare function DrawerClose({ ...props }: DrawerPrimitive.Close.Props): React.JSX.Element;
|
|
9
|
+
declare function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props): React.JSX.Element;
|
|
10
|
+
declare function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
declare function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props): React.JSX.Element;
|
|
12
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
13
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
14
|
+
declare function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props): React.JSX.Element;
|
|
15
|
+
declare function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props): React.JSX.Element;
|
|
16
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "../chunk-Y2TKUANL.js";
|
|
5
|
+
|
|
6
|
+
// src/components/drawer.tsx
|
|
7
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var DrawerContext = React.createContext(null);
|
|
11
|
+
function useDrawer() {
|
|
12
|
+
const context = React.use(DrawerContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error("useDrawer must be used within a Drawer.");
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
function Drawer({
|
|
19
|
+
modal = true,
|
|
20
|
+
showSwipeHandle = false,
|
|
21
|
+
snapPoints,
|
|
22
|
+
swipeDirection = "down",
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
26
|
+
const contextValue = React.useMemo(
|
|
27
|
+
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
28
|
+
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal, snapPoints, swipeDirection, ...props }) });
|
|
31
|
+
}
|
|
32
|
+
function DrawerTrigger({ ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
34
|
+
}
|
|
35
|
+
function DrawerPortal({ ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
37
|
+
}
|
|
38
|
+
function DrawerClose({ ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
40
|
+
}
|
|
41
|
+
function DrawerOverlay({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
DrawerPrimitive.Backdrop,
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "drawer-overlay",
|
|
46
|
+
className: cn(
|
|
47
|
+
"fixed inset-0 z-50 min-h-dvh select-none 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)] data-ending-style:pointer-events-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-swiping:duration-0 supports-[-webkit-touch-callout:none]:absolute supports-backdrop-filter:backdrop-blur-xs data-snap-points:[--drawer-overlay-min-opacity:0.5]",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function DrawerSwipeHandle({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "drawer-swipe-handle",
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
className: cn(
|
|
61
|
+
"relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 after:block after:shrink-0 after:rounded-full after:bg-muted active:cursor-grabbing group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-direction=up]/drawer-popup:items-start group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-axis=y]/drawer-popup:justify-center 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:after:h-24 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function DrawerContent({ className, children, ...props }) {
|
|
69
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
70
|
+
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
71
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
72
|
+
modal === true && /* @__PURE__ */ jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : void 0 }),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
DrawerPrimitive.Viewport,
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "drawer-viewport",
|
|
77
|
+
"data-modal": modal,
|
|
78
|
+
className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto",
|
|
79
|
+
children: /* @__PURE__ */ jsxs(
|
|
80
|
+
DrawerPrimitive.Popup,
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "drawer-popup",
|
|
83
|
+
"data-swipe-axis": swipeAxis,
|
|
84
|
+
"data-snap-points": hasSnapPoints ? "" : void 0,
|
|
85
|
+
className: cn(
|
|
86
|
+
// Base.
|
|
87
|
+
"group/drawer-popup transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] 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) select-none flex-col bg-popover text-popover-foreground text-sm outline-none transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:border-r data-[swipe-direction=up]:border-b data-[swipe-direction=right]:border-l",
|
|
88
|
+
// Nested.
|
|
89
|
+
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
90
|
+
// Bleed.
|
|
91
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=x]:after:inset-y-0 data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=up]:after:bottom-full data-[swipe-direction=right]:after:left-full data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-axis=x]:after:w-(--bleed)",
|
|
92
|
+
// Sizing.
|
|
93
|
+
"[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
|
|
94
|
+
// Stack.
|
|
95
|
+
"[--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]",
|
|
96
|
+
// Transitions.
|
|
97
|
+
"data-ending-style:transform-(--closed-transform) data-starting-style:transform-(--closed-transform) data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-swiping:duration-0",
|
|
98
|
+
// Axis: y.
|
|
99
|
+
"data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height) data-[swipe-axis=y]:inset-x-0",
|
|
100
|
+
// Axis: x.
|
|
101
|
+
"data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
|
|
102
|
+
// Direction: down.
|
|
103
|
+
"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)))]",
|
|
104
|
+
// Direction: up.
|
|
105
|
+
"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)))]",
|
|
106
|
+
// Direction: left.
|
|
107
|
+
"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%))]",
|
|
108
|
+
// Direction: right.
|
|
109
|
+
"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%))]",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
...props,
|
|
113
|
+
children: [
|
|
114
|
+
showSwipeHandle && /* @__PURE__ */ jsx(DrawerSwipeHandle, {}),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
DrawerPrimitive.Content,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "drawer-content",
|
|
119
|
+
className: cn(
|
|
120
|
+
"flex min-h-0 flex-1 select-text flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] group-data-swiping/drawer-popup:select-none group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100"
|
|
121
|
+
),
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
function DrawerHeader({ className, ...props }) {
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
"data-slot": "drawer-header",
|
|
137
|
+
className: 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),
|
|
138
|
+
...props
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
function DrawerFooter({ className, ...props }) {
|
|
143
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className), ...props });
|
|
144
|
+
}
|
|
145
|
+
function DrawerTitle({ className, ...props }) {
|
|
146
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("font-heading font-medium text-base text-foreground", className), ...props });
|
|
147
|
+
}
|
|
148
|
+
function DrawerDescription({ className, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-balance text-muted-foreground text-sm", className), ...props });
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
Drawer,
|
|
153
|
+
DrawerClose,
|
|
154
|
+
DrawerContent,
|
|
155
|
+
DrawerDescription,
|
|
156
|
+
DrawerFooter,
|
|
157
|
+
DrawerHeader,
|
|
158
|
+
DrawerOverlay,
|
|
159
|
+
DrawerPortal,
|
|
160
|
+
DrawerSwipeHandle,
|
|
161
|
+
DrawerTitle,
|
|
162
|
+
DrawerTrigger
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/drawer.tsx"],"sourcesContent":["'use client';\n\nimport { Drawer as DrawerPrimitive } from '@base-ui/react/drawer';\nimport { cn } from '@betfin/ui/lib/utils';\nimport * as React from 'react';\n\ntype DrawerContextProps = {\n\thasSnapPoints: boolean;\n\tmodal: DrawerPrimitive.Root.Props['modal'];\n\tshowSwipeHandle: boolean;\n\tswipeDirection: NonNullable<DrawerPrimitive.Root.Props['swipeDirection']>;\n};\n\nconst DrawerContext = React.createContext<DrawerContextProps | null>(null);\n\nfunction useDrawer() {\n\tconst context = React.use(DrawerContext);\n\n\tif (!context) {\n\t\tthrow new Error('useDrawer must be used within a Drawer.');\n\t}\n\n\treturn context;\n}\n\nfunction Drawer({\n\tmodal = true,\n\tshowSwipeHandle = false,\n\tsnapPoints,\n\tswipeDirection = 'down',\n\t...props\n}: DrawerPrimitive.Root.Props & {\n\tshowSwipeHandle?: boolean;\n}) {\n\tconst hasSnapPoints = snapPoints != null && snapPoints.length > 0;\n\tconst contextValue = React.useMemo(\n\t\t() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n\t\t[hasSnapPoints, modal, showSwipeHandle, swipeDirection],\n\t);\n\n\treturn (\n\t\t<DrawerContext.Provider value={contextValue}>\n\t\t\t<DrawerPrimitive.Root data-slot=\"drawer\" modal={modal} snapPoints={snapPoints} swipeDirection={swipeDirection} {...props} />\n\t\t</DrawerContext.Provider>\n\t);\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n\treturn <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n\treturn <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n\treturn <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props) {\n\treturn (\n\t\t<DrawerPrimitive.Backdrop\n\t\t\tdata-slot=\"drawer-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t'fixed inset-0 z-50 min-h-dvh select-none 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)] data-ending-style:pointer-events-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-swiping:duration-0 supports-[-webkit-touch-callout:none]:absolute supports-backdrop-filter:backdrop-blur-xs data-snap-points:[--drawer-overlay-min-opacity:0.5]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerSwipeHandle({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"drawer-swipe-handle\"\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t'relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 after:block after:shrink-0 after:rounded-full after:bg-muted active:cursor-grabbing group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-direction=up]/drawer-popup:items-start group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-axis=y]/drawer-popup:justify-center 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:after:h-24 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props) {\n\tconst { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();\n\tconst swipeAxis = swipeDirection === 'down' || swipeDirection === 'up' ? 'y' : 'x';\n\n\treturn (\n\t\t<DrawerPortal data-slot=\"drawer-portal\">\n\t\t\t{modal === true && <DrawerOverlay data-snap-points={hasSnapPoints ? '' : undefined} />}\n\t\t\t<DrawerPrimitive.Viewport\n\t\t\t\tdata-slot=\"drawer-viewport\"\n\t\t\t\tdata-modal={modal}\n\t\t\t\tclassName=\"pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto\"\n\t\t\t>\n\t\t\t\t<DrawerPrimitive.Popup\n\t\t\t\t\tdata-slot=\"drawer-popup\"\n\t\t\t\t\tdata-swipe-axis={swipeAxis}\n\t\t\t\t\tdata-snap-points={hasSnapPoints ? '' : undefined}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t// Base.\n\t\t\t\t\t\t'group/drawer-popup transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] 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) select-none flex-col bg-popover text-popover-foreground text-sm outline-none transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:border-r data-[swipe-direction=up]:border-b data-[swipe-direction=right]:border-l',\n\t\t\t\t\t\t// Nested.\n\t\t\t\t\t\t'data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95',\n\t\t\t\t\t\t// Bleed.\n\t\t\t\t\t\t'after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=x]:after:inset-y-0 data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=up]:after:bottom-full data-[swipe-direction=right]:after:left-full data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-axis=x]:after:w-(--bleed)',\n\t\t\t\t\t\t// Sizing.\n\t\t\t\t\t\t'[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]',\n\t\t\t\t\t\t// Stack.\n\t\t\t\t\t\t'[--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]',\n\t\t\t\t\t\t// Transitions.\n\t\t\t\t\t\t'data-ending-style:transform-(--closed-transform) data-starting-style:transform-(--closed-transform) data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-swiping:duration-0',\n\t\t\t\t\t\t// Axis: y.\n\t\t\t\t\t\t'data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height) data-[swipe-axis=y]:inset-x-0',\n\t\t\t\t\t\t// Axis: x.\n\t\t\t\t\t\t'data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row',\n\t\t\t\t\t\t// Direction: down.\n\t\t\t\t\t\t'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)))]',\n\t\t\t\t\t\t// Direction: up.\n\t\t\t\t\t\t'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)))]',\n\t\t\t\t\t\t// Direction: left.\n\t\t\t\t\t\t'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%))]',\n\t\t\t\t\t\t// Direction: right.\n\t\t\t\t\t\t'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%))]',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{showSwipeHandle && <DrawerSwipeHandle />}\n\t\t\t\t\t<DrawerPrimitive.Content\n\t\t\t\t\t\tdata-slot=\"drawer-content\"\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex min-h-0 flex-1 select-text flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] group-data-swiping/drawer-popup:select-none group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</DrawerPrimitive.Content>\n\t\t\t\t</DrawerPrimitive.Popup>\n\t\t\t</DrawerPrimitive.Viewport>\n\t\t</DrawerPortal>\n\t);\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"drawer-header\"\n\t\t\tclassName={cn('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)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn <div data-slot=\"drawer-footer\" className={cn('mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0', className)} {...props} />;\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n\treturn <DrawerPrimitive.Title data-slot=\"drawer-title\" className={cn('font-heading font-medium text-base text-foreground', className)} {...props} />;\n}\n\nfunction DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props) {\n\treturn <DrawerPrimitive.Description data-slot=\"drawer-description\" className={cn('text-balance text-muted-foreground text-sm', className)} {...props} />;\n}\n\nexport {\n\tDrawer,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerDescription,\n\tDrawerFooter,\n\tDrawerHeader,\n\tDrawerOverlay,\n\tDrawerPortal,\n\tDrawerSwipeHandle,\n\tDrawerTitle,\n\tDrawerTrigger,\n};\n"],"mappings":";;;;;;AAEA,SAAS,UAAU,uBAAuB;AAE1C,YAAY,WAAW;AAsCpB,cAwDC,YAxDD;AA7BH,IAAM,gBAAsB,oBAAyC,IAAI;AAEzE,SAAS,YAAY;AACpB,QAAM,UAAgB,UAAI,aAAa;AAEvC,MAAI,CAAC,SAAS;AACb,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC1D;AAEA,SAAO;AACR;AAEA,SAAS,OAAO;AAAA,EACf,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB;AAAA,EACA,iBAAiB;AAAA,EACjB,GAAG;AACJ,GAEG;AACF,QAAM,gBAAgB,cAAc,QAAQ,WAAW,SAAS;AAChE,QAAM,eAAqB;AAAA,IAC1B,OAAO,EAAE,eAAe,OAAO,iBAAiB,eAAe;AAAA,IAC/D,CAAC,eAAe,OAAO,iBAAiB,cAAc;AAAA,EACvD;AAEA,SACC,oBAAC,cAAc,UAAd,EAAuB,OAAO,cAC9B,8BAAC,gBAAgB,MAAhB,EAAqB,aAAU,UAAS,OAAc,YAAwB,gBAAiC,GAAG,OAAO,GAC3H;AAEF;AAEA,SAAS,cAAc,EAAE,GAAG,MAAM,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3
|
+
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
|
|
25
|
+
inset?: boolean;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|