@majapisoftwares/ui 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +27 -27
- package/README.md +79 -79
- package/THIRD_PARTY_NOTICES.md +39 -39
- package/components.json +25 -25
- package/docs/MIGRATION-0.2.md +20 -20
- package/docs/MIGRATION-6.0.md +33 -33
- package/docs/NEXT-STARTER-VALIDATION.md +14 -14
- package/docs/STANDARDS.md +41 -41
- package/docs/VALIDATION.md +11 -11
- package/docs/VERSIONING.md +28 -28
- package/docs/validation/preference-titles.md +22 -0
- package/package.json +88 -84
- package/scripts/check-standards.mjs +41 -41
- package/src/components/ui/accordion.tsx +82 -82
- package/src/components/ui/alert-dialog.tsx +187 -187
- package/src/components/ui/alert.tsx +77 -77
- package/src/components/ui/avatar.tsx +108 -108
- package/src/components/ui/badge.tsx +55 -55
- package/src/components/ui/breadcrumb.tsx +125 -125
- package/src/components/ui/button-group.tsx +89 -89
- package/src/components/ui/button.tsx +59 -59
- package/src/components/ui/card.tsx +101 -101
- package/src/components/ui/checkbox.tsx +27 -27
- package/src/components/ui/collapsible.tsx +21 -21
- package/src/components/ui/context-menu.tsx +271 -271
- package/src/components/ui/dialog.tsx +161 -161
- package/src/components/ui/dropdown-menu.tsx +271 -271
- package/src/components/ui/empty.tsx +105 -105
- package/src/components/ui/field.tsx +238 -238
- package/src/components/ui/hover-card.tsx +50 -50
- package/src/components/ui/input-group.tsx +155 -155
- package/src/components/ui/input.tsx +21 -21
- package/src/components/ui/kbd.tsx +28 -28
- package/src/components/ui/label.tsx +19 -19
- package/src/components/ui/orb.css +1002 -1002
- package/src/components/ui/orb.tsx +752 -752
- package/src/components/ui/popover.tsx +89 -89
- package/src/components/ui/progress.tsx +82 -82
- package/src/components/ui/radio-group.tsx +37 -37
- package/src/components/ui/scroll-area.tsx +54 -54
- package/src/components/ui/select.tsx +204 -204
- package/src/components/ui/separator.tsx +24 -24
- package/src/components/ui/sheet.tsx +139 -139
- package/src/components/ui/sidebar.tsx +1039 -1035
- package/src/components/ui/skeleton.tsx +15 -15
- package/src/components/ui/slider.tsx +53 -53
- package/src/components/ui/sonner.tsx +44 -44
- package/src/components/ui/spinner.tsx +32 -32
- package/src/components/ui/switch.tsx +31 -31
- package/src/components/ui/table.tsx +121 -121
- package/src/components/ui/tabs.tsx +81 -81
- package/src/components/ui/textarea.tsx +19 -19
- package/src/components/ui/toggle-group.tsx +89 -89
- package/src/components/ui/toggle.tsx +44 -44
- package/src/components/ui/tooltip.tsx +65 -65
- package/src/hooks/use-mobile.ts +20 -20
- package/src/lib/i18n.tsx +109 -109
- package/src/lib/utils.ts +1 -1
- package/src/patterns/app-shell.tsx +177 -179
- package/src/patterns/data-table.tsx +2486 -2486
- package/src/patterns/details-sheet.tsx +54 -54
- package/src/patterns/filter-tabs.tsx +53 -53
- package/src/patterns/majapi-logo.tsx +32 -32
- package/src/patterns/page-header.tsx +62 -62
- package/src/patterns/preferences.tsx +15 -7
- package/src/patterns/status-badge.tsx +24 -24
- package/src/patterns/user-menu.tsx +218 -218
- package/src/patterns/workspace-switcher.tsx +176 -173
- package/src/styles.css +165 -165
- package/src/templates/admin-dashboard.tsx +44 -44
- package/src/templates/auth-layout.tsx +30 -30
- package/src/templates/login-form.tsx +129 -129
- package/src/templates/signup-form.tsx +177 -177
|
@@ -1,271 +1,271 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
5
|
-
import { cn } from "cn";
|
|
6
|
-
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
7
|
-
|
|
8
|
-
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
9
|
-
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
13
|
-
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
17
|
-
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function DropdownMenuContent({
|
|
21
|
-
align = "start",
|
|
22
|
-
alignOffset = 0,
|
|
23
|
-
side = "bottom",
|
|
24
|
-
sideOffset = 4,
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
}: MenuPrimitive.Popup.Props &
|
|
28
|
-
Pick<
|
|
29
|
-
MenuPrimitive.Positioner.Props,
|
|
30
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
31
|
-
>) {
|
|
32
|
-
return (
|
|
33
|
-
<MenuPrimitive.Portal>
|
|
34
|
-
<MenuPrimitive.Positioner
|
|
35
|
-
className="isolate z-50 outline-none"
|
|
36
|
-
align={align}
|
|
37
|
-
alignOffset={alignOffset}
|
|
38
|
-
side={side}
|
|
39
|
-
sideOffset={sideOffset}
|
|
40
|
-
>
|
|
41
|
-
<MenuPrimitive.Popup
|
|
42
|
-
data-slot="dropdown-menu-content"
|
|
43
|
-
className={cn(
|
|
44
|
-
"z-50 max-h-(--available-height) w-(--anchor-width) min-w-48 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 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 dark:ring-foreground/10 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",
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
</MenuPrimitive.Positioner>
|
|
50
|
-
</MenuPrimitive.Portal>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
55
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function DropdownMenuLabel({
|
|
59
|
-
className,
|
|
60
|
-
inset,
|
|
61
|
-
...props
|
|
62
|
-
}: MenuPrimitive.GroupLabel.Props & {
|
|
63
|
-
inset?: boolean;
|
|
64
|
-
}) {
|
|
65
|
-
return (
|
|
66
|
-
<MenuPrimitive.GroupLabel
|
|
67
|
-
data-slot="dropdown-menu-label"
|
|
68
|
-
data-inset={inset}
|
|
69
|
-
className={cn(
|
|
70
|
-
"px-3 py-2.5 text-xs text-muted-foreground data-inset:pl-9.5",
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function DropdownMenuItem({
|
|
79
|
-
className,
|
|
80
|
-
inset,
|
|
81
|
-
variant = "default",
|
|
82
|
-
...props
|
|
83
|
-
}: MenuPrimitive.Item.Props & {
|
|
84
|
-
inset?: boolean;
|
|
85
|
-
variant?: "default" | "destructive";
|
|
86
|
-
}) {
|
|
87
|
-
return (
|
|
88
|
-
<MenuPrimitive.Item
|
|
89
|
-
data-slot="dropdown-menu-item"
|
|
90
|
-
data-inset={inset}
|
|
91
|
-
data-variant={variant}
|
|
92
|
-
className={cn(
|
|
93
|
-
"group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 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",
|
|
94
|
-
className,
|
|
95
|
-
)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
102
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function DropdownMenuSubTrigger({
|
|
106
|
-
className,
|
|
107
|
-
inset,
|
|
108
|
-
children,
|
|
109
|
-
...props
|
|
110
|
-
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
111
|
-
inset?: boolean;
|
|
112
|
-
}) {
|
|
113
|
-
return (
|
|
114
|
-
<MenuPrimitive.SubmenuTrigger
|
|
115
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
116
|
-
data-inset={inset}
|
|
117
|
-
className={cn(
|
|
118
|
-
"flex cursor-default items-center gap-2 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 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",
|
|
119
|
-
className,
|
|
120
|
-
)}
|
|
121
|
-
{...props}
|
|
122
|
-
>
|
|
123
|
-
{children}
|
|
124
|
-
<ChevronRightIcon className="ml-auto" />
|
|
125
|
-
</MenuPrimitive.SubmenuTrigger>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function DropdownMenuSubContent({
|
|
130
|
-
align = "start",
|
|
131
|
-
alignOffset = -3,
|
|
132
|
-
side = "right",
|
|
133
|
-
sideOffset = 0,
|
|
134
|
-
className,
|
|
135
|
-
...props
|
|
136
|
-
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
137
|
-
return (
|
|
138
|
-
<DropdownMenuContent
|
|
139
|
-
data-slot="dropdown-menu-sub-content"
|
|
140
|
-
className={cn(
|
|
141
|
-
"w-auto min-w-36 rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 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 dark:ring-foreground/10 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",
|
|
142
|
-
className,
|
|
143
|
-
)}
|
|
144
|
-
align={align}
|
|
145
|
-
alignOffset={alignOffset}
|
|
146
|
-
side={side}
|
|
147
|
-
sideOffset={sideOffset}
|
|
148
|
-
{...props}
|
|
149
|
-
/>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function DropdownMenuCheckboxItem({
|
|
154
|
-
className,
|
|
155
|
-
children,
|
|
156
|
-
checked,
|
|
157
|
-
inset,
|
|
158
|
-
...props
|
|
159
|
-
}: MenuPrimitive.CheckboxItem.Props & {
|
|
160
|
-
inset?: boolean;
|
|
161
|
-
}) {
|
|
162
|
-
return (
|
|
163
|
-
<MenuPrimitive.CheckboxItem
|
|
164
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
165
|
-
data-inset={inset}
|
|
166
|
-
className={cn(
|
|
167
|
-
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
168
|
-
className,
|
|
169
|
-
)}
|
|
170
|
-
checked={checked}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<span
|
|
174
|
-
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
175
|
-
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
176
|
-
>
|
|
177
|
-
<MenuPrimitive.CheckboxItemIndicator>
|
|
178
|
-
<CheckIcon />
|
|
179
|
-
</MenuPrimitive.CheckboxItemIndicator>
|
|
180
|
-
</span>
|
|
181
|
-
{children}
|
|
182
|
-
</MenuPrimitive.CheckboxItem>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
187
|
-
return (
|
|
188
|
-
<MenuPrimitive.RadioGroup
|
|
189
|
-
data-slot="dropdown-menu-radio-group"
|
|
190
|
-
{...props}
|
|
191
|
-
/>
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function DropdownMenuRadioItem({
|
|
196
|
-
className,
|
|
197
|
-
children,
|
|
198
|
-
inset,
|
|
199
|
-
...props
|
|
200
|
-
}: MenuPrimitive.RadioItem.Props & {
|
|
201
|
-
inset?: boolean;
|
|
202
|
-
}) {
|
|
203
|
-
return (
|
|
204
|
-
<MenuPrimitive.RadioItem
|
|
205
|
-
data-slot="dropdown-menu-radio-item"
|
|
206
|
-
data-inset={inset}
|
|
207
|
-
className={cn(
|
|
208
|
-
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
209
|
-
className,
|
|
210
|
-
)}
|
|
211
|
-
{...props}
|
|
212
|
-
>
|
|
213
|
-
<span
|
|
214
|
-
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
215
|
-
data-slot="dropdown-menu-radio-item-indicator"
|
|
216
|
-
>
|
|
217
|
-
<MenuPrimitive.RadioItemIndicator>
|
|
218
|
-
<CheckIcon />
|
|
219
|
-
</MenuPrimitive.RadioItemIndicator>
|
|
220
|
-
</span>
|
|
221
|
-
{children}
|
|
222
|
-
</MenuPrimitive.RadioItem>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function DropdownMenuSeparator({
|
|
227
|
-
className,
|
|
228
|
-
...props
|
|
229
|
-
}: MenuPrimitive.Separator.Props) {
|
|
230
|
-
return (
|
|
231
|
-
<MenuPrimitive.Separator
|
|
232
|
-
data-slot="dropdown-menu-separator"
|
|
233
|
-
className={cn("-mx-1.5 my-1.5 h-px bg-border/50", className)}
|
|
234
|
-
{...props}
|
|
235
|
-
/>
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function DropdownMenuShortcut({
|
|
240
|
-
className,
|
|
241
|
-
...props
|
|
242
|
-
}: React.ComponentProps<"span">) {
|
|
243
|
-
return (
|
|
244
|
-
<span
|
|
245
|
-
data-slot="dropdown-menu-shortcut"
|
|
246
|
-
className={cn(
|
|
247
|
-
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
248
|
-
className,
|
|
249
|
-
)}
|
|
250
|
-
{...props}
|
|
251
|
-
/>
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export {
|
|
256
|
-
DropdownMenu,
|
|
257
|
-
DropdownMenuPortal,
|
|
258
|
-
DropdownMenuTrigger,
|
|
259
|
-
DropdownMenuContent,
|
|
260
|
-
DropdownMenuGroup,
|
|
261
|
-
DropdownMenuLabel,
|
|
262
|
-
DropdownMenuItem,
|
|
263
|
-
DropdownMenuCheckboxItem,
|
|
264
|
-
DropdownMenuRadioGroup,
|
|
265
|
-
DropdownMenuRadioItem,
|
|
266
|
-
DropdownMenuSeparator,
|
|
267
|
-
DropdownMenuShortcut,
|
|
268
|
-
DropdownMenuSub,
|
|
269
|
-
DropdownMenuSubTrigger,
|
|
270
|
-
DropdownMenuSubContent,
|
|
271
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
9
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
13
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
17
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function DropdownMenuContent({
|
|
21
|
+
align = "start",
|
|
22
|
+
alignOffset = 0,
|
|
23
|
+
side = "bottom",
|
|
24
|
+
sideOffset = 4,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: MenuPrimitive.Popup.Props &
|
|
28
|
+
Pick<
|
|
29
|
+
MenuPrimitive.Positioner.Props,
|
|
30
|
+
"align" | "alignOffset" | "side" | "sideOffset"
|
|
31
|
+
>) {
|
|
32
|
+
return (
|
|
33
|
+
<MenuPrimitive.Portal>
|
|
34
|
+
<MenuPrimitive.Positioner
|
|
35
|
+
className="isolate z-50 outline-none"
|
|
36
|
+
align={align}
|
|
37
|
+
alignOffset={alignOffset}
|
|
38
|
+
side={side}
|
|
39
|
+
sideOffset={sideOffset}
|
|
40
|
+
>
|
|
41
|
+
<MenuPrimitive.Popup
|
|
42
|
+
data-slot="dropdown-menu-content"
|
|
43
|
+
className={cn(
|
|
44
|
+
"z-50 max-h-(--available-height) w-(--anchor-width) min-w-48 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 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 dark:ring-foreground/10 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",
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
</MenuPrimitive.Positioner>
|
|
50
|
+
</MenuPrimitive.Portal>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
55
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function DropdownMenuLabel({
|
|
59
|
+
className,
|
|
60
|
+
inset,
|
|
61
|
+
...props
|
|
62
|
+
}: MenuPrimitive.GroupLabel.Props & {
|
|
63
|
+
inset?: boolean;
|
|
64
|
+
}) {
|
|
65
|
+
return (
|
|
66
|
+
<MenuPrimitive.GroupLabel
|
|
67
|
+
data-slot="dropdown-menu-label"
|
|
68
|
+
data-inset={inset}
|
|
69
|
+
className={cn(
|
|
70
|
+
"px-3 py-2.5 text-xs text-muted-foreground data-inset:pl-9.5",
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function DropdownMenuItem({
|
|
79
|
+
className,
|
|
80
|
+
inset,
|
|
81
|
+
variant = "default",
|
|
82
|
+
...props
|
|
83
|
+
}: MenuPrimitive.Item.Props & {
|
|
84
|
+
inset?: boolean;
|
|
85
|
+
variant?: "default" | "destructive";
|
|
86
|
+
}) {
|
|
87
|
+
return (
|
|
88
|
+
<MenuPrimitive.Item
|
|
89
|
+
data-slot="dropdown-menu-item"
|
|
90
|
+
data-inset={inset}
|
|
91
|
+
data-variant={variant}
|
|
92
|
+
className={cn(
|
|
93
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 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",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
102
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function DropdownMenuSubTrigger({
|
|
106
|
+
className,
|
|
107
|
+
inset,
|
|
108
|
+
children,
|
|
109
|
+
...props
|
|
110
|
+
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
111
|
+
inset?: boolean;
|
|
112
|
+
}) {
|
|
113
|
+
return (
|
|
114
|
+
<MenuPrimitive.SubmenuTrigger
|
|
115
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
116
|
+
data-inset={inset}
|
|
117
|
+
className={cn(
|
|
118
|
+
"flex cursor-default items-center gap-2 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 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",
|
|
119
|
+
className,
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
>
|
|
123
|
+
{children}
|
|
124
|
+
<ChevronRightIcon className="ml-auto" />
|
|
125
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function DropdownMenuSubContent({
|
|
130
|
+
align = "start",
|
|
131
|
+
alignOffset = -3,
|
|
132
|
+
side = "right",
|
|
133
|
+
sideOffset = 0,
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
137
|
+
return (
|
|
138
|
+
<DropdownMenuContent
|
|
139
|
+
data-slot="dropdown-menu-sub-content"
|
|
140
|
+
className={cn(
|
|
141
|
+
"w-auto min-w-36 rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 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 dark:ring-foreground/10 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",
|
|
142
|
+
className,
|
|
143
|
+
)}
|
|
144
|
+
align={align}
|
|
145
|
+
alignOffset={alignOffset}
|
|
146
|
+
side={side}
|
|
147
|
+
sideOffset={sideOffset}
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function DropdownMenuCheckboxItem({
|
|
154
|
+
className,
|
|
155
|
+
children,
|
|
156
|
+
checked,
|
|
157
|
+
inset,
|
|
158
|
+
...props
|
|
159
|
+
}: MenuPrimitive.CheckboxItem.Props & {
|
|
160
|
+
inset?: boolean;
|
|
161
|
+
}) {
|
|
162
|
+
return (
|
|
163
|
+
<MenuPrimitive.CheckboxItem
|
|
164
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
165
|
+
data-inset={inset}
|
|
166
|
+
className={cn(
|
|
167
|
+
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
168
|
+
className,
|
|
169
|
+
)}
|
|
170
|
+
checked={checked}
|
|
171
|
+
{...props}
|
|
172
|
+
>
|
|
173
|
+
<span
|
|
174
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
175
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
176
|
+
>
|
|
177
|
+
<MenuPrimitive.CheckboxItemIndicator>
|
|
178
|
+
<CheckIcon />
|
|
179
|
+
</MenuPrimitive.CheckboxItemIndicator>
|
|
180
|
+
</span>
|
|
181
|
+
{children}
|
|
182
|
+
</MenuPrimitive.CheckboxItem>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
187
|
+
return (
|
|
188
|
+
<MenuPrimitive.RadioGroup
|
|
189
|
+
data-slot="dropdown-menu-radio-group"
|
|
190
|
+
{...props}
|
|
191
|
+
/>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function DropdownMenuRadioItem({
|
|
196
|
+
className,
|
|
197
|
+
children,
|
|
198
|
+
inset,
|
|
199
|
+
...props
|
|
200
|
+
}: MenuPrimitive.RadioItem.Props & {
|
|
201
|
+
inset?: boolean;
|
|
202
|
+
}) {
|
|
203
|
+
return (
|
|
204
|
+
<MenuPrimitive.RadioItem
|
|
205
|
+
data-slot="dropdown-menu-radio-item"
|
|
206
|
+
data-inset={inset}
|
|
207
|
+
className={cn(
|
|
208
|
+
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
209
|
+
className,
|
|
210
|
+
)}
|
|
211
|
+
{...props}
|
|
212
|
+
>
|
|
213
|
+
<span
|
|
214
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
215
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
216
|
+
>
|
|
217
|
+
<MenuPrimitive.RadioItemIndicator>
|
|
218
|
+
<CheckIcon />
|
|
219
|
+
</MenuPrimitive.RadioItemIndicator>
|
|
220
|
+
</span>
|
|
221
|
+
{children}
|
|
222
|
+
</MenuPrimitive.RadioItem>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function DropdownMenuSeparator({
|
|
227
|
+
className,
|
|
228
|
+
...props
|
|
229
|
+
}: MenuPrimitive.Separator.Props) {
|
|
230
|
+
return (
|
|
231
|
+
<MenuPrimitive.Separator
|
|
232
|
+
data-slot="dropdown-menu-separator"
|
|
233
|
+
className={cn("-mx-1.5 my-1.5 h-px bg-border/50", className)}
|
|
234
|
+
{...props}
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function DropdownMenuShortcut({
|
|
240
|
+
className,
|
|
241
|
+
...props
|
|
242
|
+
}: React.ComponentProps<"span">) {
|
|
243
|
+
return (
|
|
244
|
+
<span
|
|
245
|
+
data-slot="dropdown-menu-shortcut"
|
|
246
|
+
className={cn(
|
|
247
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
248
|
+
className,
|
|
249
|
+
)}
|
|
250
|
+
{...props}
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export {
|
|
256
|
+
DropdownMenu,
|
|
257
|
+
DropdownMenuPortal,
|
|
258
|
+
DropdownMenuTrigger,
|
|
259
|
+
DropdownMenuContent,
|
|
260
|
+
DropdownMenuGroup,
|
|
261
|
+
DropdownMenuLabel,
|
|
262
|
+
DropdownMenuItem,
|
|
263
|
+
DropdownMenuCheckboxItem,
|
|
264
|
+
DropdownMenuRadioGroup,
|
|
265
|
+
DropdownMenuRadioItem,
|
|
266
|
+
DropdownMenuSeparator,
|
|
267
|
+
DropdownMenuShortcut,
|
|
268
|
+
DropdownMenuSub,
|
|
269
|
+
DropdownMenuSubTrigger,
|
|
270
|
+
DropdownMenuSubContent,
|
|
271
|
+
};
|