@blips/ui 0.0.1 → 2.0.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/index.cjs +4308 -2010
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +435 -411
- package/dist/index.d.ts +435 -411
- package/dist/index.js +4244 -2008
- package/dist/index.js.map +1 -1
- package/package.json +18 -4
- package/src/components/accordion.tsx +58 -48
- package/src/components/alert-dialog.tsx +170 -112
- package/src/components/alert.tsx +49 -42
- package/src/components/aspect-ratio.tsx +9 -3
- package/src/components/avatar.tsx +109 -50
- package/src/components/badge.tsx +29 -17
- package/src/components/breadcrumb.tsx +81 -87
- package/src/components/button-group.tsx +83 -0
- package/src/components/button.tsx +40 -32
- package/src/components/calendar.tsx +49 -45
- package/src/components/card.tsx +77 -71
- package/src/components/carousel.tsx +150 -168
- package/src/components/chart.tsx +357 -0
- package/src/components/checkbox.tsx +28 -24
- package/src/components/collapsible.tsx +28 -6
- package/src/components/command.tsx +144 -110
- package/src/components/context-menu.tsx +220 -166
- package/src/components/dialog.tsx +131 -95
- package/src/components/drawer.tsx +105 -86
- package/src/components/dropdown-menu.tsx +234 -177
- package/src/components/form.tsx +167 -0
- package/src/components/hover-card.tsx +39 -22
- package/src/components/input-group.tsx +175 -0
- package/src/components/input-otp.tsx +56 -48
- package/src/components/input.tsx +18 -19
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +20 -22
- package/src/components/menubar.tsx +221 -199
- package/src/components/navigation-menu.tsx +144 -102
- package/src/components/pagination.tsx +102 -91
- package/src/components/popover.tsx +86 -26
- package/src/components/progress.tsx +27 -24
- package/src/components/radio-group.tsx +28 -25
- package/src/components/resizable.tsx +42 -34
- package/src/components/scroll-area.tsx +54 -42
- package/src/components/select.tsx +165 -135
- package/src/components/separator.tsx +16 -17
- package/src/components/sheet.tsx +116 -113
- package/src/components/sidebar.tsx +726 -0
- package/src/components/skeleton.tsx +6 -8
- package/src/components/slider.tsx +60 -23
- package/src/components/sonner.tsx +25 -30
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +30 -22
- package/src/components/table.tsx +96 -97
- package/src/components/tabs.tsx +91 -53
- package/src/components/textarea.tsx +8 -12
- package/src/components/toggle-group.tsx +60 -37
- package/src/components/toggle.tsx +28 -24
- package/src/components/tooltip.tsx +50 -23
- package/src/globals.css +230 -68
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +105 -6
|
@@ -1,254 +1,276 @@
|
|
|
1
|
-
|
|
2
|
-
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
3
|
-
import * as React from "react";
|
|
1
|
+
"use client"
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Check, CaretRight, Circle } from "@phosphor-icons/react"
|
|
5
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
8
|
+
|
|
9
|
+
function Menubar({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<MenubarPrimitive.Root
|
|
15
|
+
data-slot="menubar"
|
|
16
|
+
className={cn(
|
|
17
|
+
"flex h-9 items-center gap-1 rounded-md border bg-background p-1 shadow-xs",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
6
24
|
|
|
7
25
|
function MenubarMenu({
|
|
8
26
|
...props
|
|
9
27
|
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
10
|
-
return <MenubarPrimitive.Menu {...props}
|
|
28
|
+
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
|
|
11
29
|
}
|
|
12
30
|
|
|
13
31
|
function MenubarGroup({
|
|
14
32
|
...props
|
|
15
33
|
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
16
|
-
return <MenubarPrimitive.Group {...props}
|
|
34
|
+
return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
|
|
17
35
|
}
|
|
18
36
|
|
|
19
37
|
function MenubarPortal({
|
|
20
38
|
...props
|
|
21
39
|
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
22
|
-
return <MenubarPrimitive.Portal {...props}
|
|
40
|
+
return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
|
|
23
41
|
}
|
|
24
42
|
|
|
25
43
|
function MenubarRadioGroup({
|
|
26
44
|
...props
|
|
27
45
|
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
28
|
-
return
|
|
46
|
+
return (
|
|
47
|
+
<MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
|
|
48
|
+
)
|
|
29
49
|
}
|
|
30
50
|
|
|
31
|
-
function
|
|
51
|
+
function MenubarTrigger({
|
|
52
|
+
className,
|
|
32
53
|
...props
|
|
33
|
-
}: React.ComponentProps<typeof MenubarPrimitive.
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>(({ className, ...props }, ref) => (
|
|
56
|
-
<MenubarPrimitive.Trigger
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn(
|
|
59
|
-
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
));
|
|
65
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
66
|
-
|
|
67
|
-
const MenubarSubTrigger = React.forwardRef<
|
|
68
|
-
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
69
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
70
|
-
inset?: boolean;
|
|
71
|
-
}
|
|
72
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
73
|
-
<MenubarPrimitive.SubTrigger
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn(
|
|
76
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
77
|
-
inset && "pl-8",
|
|
78
|
-
className
|
|
79
|
-
)}
|
|
80
|
-
{...props}
|
|
81
|
-
>
|
|
82
|
-
{children}
|
|
83
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
84
|
-
</MenubarPrimitive.SubTrigger>
|
|
85
|
-
));
|
|
86
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
87
|
-
|
|
88
|
-
const MenubarSubContent = React.forwardRef<
|
|
89
|
-
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
90
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
91
|
-
>(({ className, ...props }, ref) => (
|
|
92
|
-
<MenubarPrimitive.SubContent
|
|
93
|
-
ref={ref}
|
|
94
|
-
className={cn(
|
|
95
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-menubar-content-transform-origin]",
|
|
96
|
-
className
|
|
97
|
-
)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
));
|
|
101
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
102
|
-
|
|
103
|
-
const MenubarContent = React.forwardRef<
|
|
104
|
-
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
105
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
106
|
-
>(
|
|
107
|
-
(
|
|
108
|
-
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
109
|
-
ref
|
|
110
|
-
) => (
|
|
111
|
-
<MenubarPrimitive.Portal>
|
|
54
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
55
|
+
return (
|
|
56
|
+
<MenubarPrimitive.Trigger
|
|
57
|
+
data-slot="menubar-trigger"
|
|
58
|
+
className={cn(
|
|
59
|
+
"flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function MenubarContent({
|
|
68
|
+
className,
|
|
69
|
+
align = "start",
|
|
70
|
+
alignOffset = -4,
|
|
71
|
+
sideOffset = 8,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
74
|
+
return (
|
|
75
|
+
<MenubarPortal>
|
|
112
76
|
<MenubarPrimitive.Content
|
|
113
|
-
|
|
77
|
+
data-slot="menubar-content"
|
|
114
78
|
align={align}
|
|
115
79
|
alignOffset={alignOffset}
|
|
116
80
|
sideOffset={sideOffset}
|
|
117
81
|
className={cn(
|
|
118
|
-
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[
|
|
82
|
+
"z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
119
83
|
className
|
|
120
84
|
)}
|
|
121
85
|
{...props}
|
|
122
86
|
/>
|
|
123
|
-
</
|
|
87
|
+
</MenubarPortal>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function MenubarItem({
|
|
92
|
+
className,
|
|
93
|
+
inset,
|
|
94
|
+
variant = "default",
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
97
|
+
inset?: boolean
|
|
98
|
+
variant?: "default" | "destructive"
|
|
99
|
+
}) {
|
|
100
|
+
return (
|
|
101
|
+
<MenubarPrimitive.Item
|
|
102
|
+
data-slot="menubar-item"
|
|
103
|
+
data-inset={inset}
|
|
104
|
+
data-variant={variant}
|
|
105
|
+
className={cn(
|
|
106
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
107
|
+
className
|
|
108
|
+
)}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function MenubarCheckboxItem({
|
|
115
|
+
className,
|
|
116
|
+
children,
|
|
117
|
+
checked,
|
|
118
|
+
...props
|
|
119
|
+
}: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
|
|
120
|
+
return (
|
|
121
|
+
<MenubarPrimitive.CheckboxItem
|
|
122
|
+
data-slot="menubar-checkbox-item"
|
|
123
|
+
className={cn(
|
|
124
|
+
"relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
checked={checked}
|
|
128
|
+
{...props}
|
|
129
|
+
>
|
|
130
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
131
|
+
<MenubarPrimitive.ItemIndicator>
|
|
132
|
+
<Check className="size-4" />
|
|
133
|
+
</MenubarPrimitive.ItemIndicator>
|
|
134
|
+
</span>
|
|
135
|
+
{children}
|
|
136
|
+
</MenubarPrimitive.CheckboxItem>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function MenubarRadioItem({
|
|
141
|
+
className,
|
|
142
|
+
children,
|
|
143
|
+
...props
|
|
144
|
+
}: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
|
|
145
|
+
return (
|
|
146
|
+
<MenubarPrimitive.RadioItem
|
|
147
|
+
data-slot="menubar-radio-item"
|
|
148
|
+
className={cn(
|
|
149
|
+
"relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
150
|
+
className
|
|
151
|
+
)}
|
|
152
|
+
{...props}
|
|
153
|
+
>
|
|
154
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
155
|
+
<MenubarPrimitive.ItemIndicator>
|
|
156
|
+
<Circle className="size-2 fill-current" />
|
|
157
|
+
</MenubarPrimitive.ItemIndicator>
|
|
158
|
+
</span>
|
|
159
|
+
{children}
|
|
160
|
+
</MenubarPrimitive.RadioItem>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function MenubarLabel({
|
|
165
|
+
className,
|
|
166
|
+
inset,
|
|
167
|
+
...props
|
|
168
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
169
|
+
inset?: boolean
|
|
170
|
+
}) {
|
|
171
|
+
return (
|
|
172
|
+
<MenubarPrimitive.Label
|
|
173
|
+
data-slot="menubar-label"
|
|
174
|
+
data-inset={inset}
|
|
175
|
+
className={cn(
|
|
176
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
177
|
+
className
|
|
178
|
+
)}
|
|
179
|
+
{...props}
|
|
180
|
+
/>
|
|
124
181
|
)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const MenubarItem = React.forwardRef<
|
|
129
|
-
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
130
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
131
|
-
inset?: boolean;
|
|
132
|
-
}
|
|
133
|
-
>(({ className, inset, ...props }, ref) => (
|
|
134
|
-
<MenubarPrimitive.Item
|
|
135
|
-
ref={ref}
|
|
136
|
-
className={cn(
|
|
137
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
138
|
-
inset && "pl-8",
|
|
139
|
-
className
|
|
140
|
-
)}
|
|
141
|
-
{...props}
|
|
142
|
-
/>
|
|
143
|
-
));
|
|
144
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
145
|
-
|
|
146
|
-
const MenubarCheckboxItem = React.forwardRef<
|
|
147
|
-
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
148
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
149
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
150
|
-
<MenubarPrimitive.CheckboxItem
|
|
151
|
-
ref={ref}
|
|
152
|
-
className={cn(
|
|
153
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
154
|
-
className
|
|
155
|
-
)}
|
|
156
|
-
checked={checked}
|
|
157
|
-
{...props}
|
|
158
|
-
>
|
|
159
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
160
|
-
<MenubarPrimitive.ItemIndicator>
|
|
161
|
-
<Check className="h-4 w-4" />
|
|
162
|
-
</MenubarPrimitive.ItemIndicator>
|
|
163
|
-
</span>
|
|
164
|
-
{children}
|
|
165
|
-
</MenubarPrimitive.CheckboxItem>
|
|
166
|
-
));
|
|
167
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
168
|
-
|
|
169
|
-
const MenubarRadioItem = React.forwardRef<
|
|
170
|
-
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
171
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
172
|
-
>(({ className, children, ...props }, ref) => (
|
|
173
|
-
<MenubarPrimitive.RadioItem
|
|
174
|
-
ref={ref}
|
|
175
|
-
className={cn(
|
|
176
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
177
|
-
className
|
|
178
|
-
)}
|
|
179
|
-
{...props}
|
|
180
|
-
>
|
|
181
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
182
|
-
<MenubarPrimitive.ItemIndicator>
|
|
183
|
-
<Circle className="h-2 w-2 fill-current" />
|
|
184
|
-
</MenubarPrimitive.ItemIndicator>
|
|
185
|
-
</span>
|
|
186
|
-
{children}
|
|
187
|
-
</MenubarPrimitive.RadioItem>
|
|
188
|
-
));
|
|
189
|
-
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
190
|
-
|
|
191
|
-
const MenubarLabel = React.forwardRef<
|
|
192
|
-
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
193
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
194
|
-
inset?: boolean;
|
|
195
|
-
}
|
|
196
|
-
>(({ className, inset, ...props }, ref) => (
|
|
197
|
-
<MenubarPrimitive.Label
|
|
198
|
-
ref={ref}
|
|
199
|
-
className={cn(
|
|
200
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
201
|
-
inset && "pl-8",
|
|
202
|
-
className
|
|
203
|
-
)}
|
|
204
|
-
{...props}
|
|
205
|
-
/>
|
|
206
|
-
));
|
|
207
|
-
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
208
|
-
|
|
209
|
-
const MenubarSeparator = React.forwardRef<
|
|
210
|
-
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
211
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
212
|
-
>(({ className, ...props }, ref) => (
|
|
213
|
-
<MenubarPrimitive.Separator
|
|
214
|
-
ref={ref}
|
|
215
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
216
|
-
{...props}
|
|
217
|
-
/>
|
|
218
|
-
));
|
|
219
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
220
|
-
|
|
221
|
-
const MenubarShortcut = ({
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function MenubarSeparator({
|
|
222
185
|
className,
|
|
223
186
|
...props
|
|
224
|
-
}: React.
|
|
187
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
188
|
+
return (
|
|
189
|
+
<MenubarPrimitive.Separator
|
|
190
|
+
data-slot="menubar-separator"
|
|
191
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
192
|
+
{...props}
|
|
193
|
+
/>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function MenubarShortcut({
|
|
198
|
+
className,
|
|
199
|
+
...props
|
|
200
|
+
}: React.ComponentProps<"span">) {
|
|
225
201
|
return (
|
|
226
202
|
<span
|
|
203
|
+
data-slot="menubar-shortcut"
|
|
227
204
|
className={cn(
|
|
228
205
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
229
206
|
className
|
|
230
207
|
)}
|
|
231
208
|
{...props}
|
|
232
209
|
/>
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function MenubarSub({
|
|
214
|
+
...props
|
|
215
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
216
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function MenubarSubTrigger({
|
|
220
|
+
className,
|
|
221
|
+
inset,
|
|
222
|
+
children,
|
|
223
|
+
...props
|
|
224
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
225
|
+
inset?: boolean
|
|
226
|
+
}) {
|
|
227
|
+
return (
|
|
228
|
+
<MenubarPrimitive.SubTrigger
|
|
229
|
+
data-slot="menubar-sub-trigger"
|
|
230
|
+
data-inset={inset}
|
|
231
|
+
className={cn(
|
|
232
|
+
"flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
233
|
+
className
|
|
234
|
+
)}
|
|
235
|
+
{...props}
|
|
236
|
+
>
|
|
237
|
+
{children}
|
|
238
|
+
<CaretRight className="ml-auto h-4 w-4" />
|
|
239
|
+
</MenubarPrimitive.SubTrigger>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function MenubarSubContent({
|
|
244
|
+
className,
|
|
245
|
+
...props
|
|
246
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
247
|
+
return (
|
|
248
|
+
<MenubarPrimitive.SubContent
|
|
249
|
+
data-slot="menubar-sub-content"
|
|
250
|
+
className={cn(
|
|
251
|
+
"z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
252
|
+
className
|
|
253
|
+
)}
|
|
254
|
+
{...props}
|
|
255
|
+
/>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
236
258
|
|
|
237
259
|
export {
|
|
238
260
|
Menubar,
|
|
261
|
+
MenubarPortal,
|
|
239
262
|
MenubarMenu,
|
|
240
263
|
MenubarTrigger,
|
|
241
264
|
MenubarContent,
|
|
242
|
-
|
|
265
|
+
MenubarGroup,
|
|
243
266
|
MenubarSeparator,
|
|
244
267
|
MenubarLabel,
|
|
268
|
+
MenubarItem,
|
|
269
|
+
MenubarShortcut,
|
|
245
270
|
MenubarCheckboxItem,
|
|
246
271
|
MenubarRadioGroup,
|
|
247
272
|
MenubarRadioItem,
|
|
248
|
-
MenubarPortal,
|
|
249
|
-
MenubarSubContent,
|
|
250
|
-
MenubarSubTrigger,
|
|
251
|
-
MenubarGroup,
|
|
252
273
|
MenubarSub,
|
|
253
|
-
|
|
254
|
-
|
|
274
|
+
MenubarSubTrigger,
|
|
275
|
+
MenubarSubContent,
|
|
276
|
+
}
|