sonance-brand-mcp 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/alert-dialog.stories.tsx +142 -0
- package/dist/assets/components/alert-dialog.tsx +142 -0
- package/dist/assets/components/aspect-ratio.stories.tsx +67 -0
- package/dist/assets/components/aspect-ratio.tsx +8 -0
- package/dist/assets/components/avatar.tsx +64 -20
- package/dist/assets/components/carousel.stories.tsx +158 -0
- package/dist/assets/components/carousel.tsx +262 -0
- package/dist/assets/components/chart.stories.tsx +376 -0
- package/dist/assets/components/chart.tsx +384 -0
- package/dist/assets/components/checkbox.tsx +12 -2
- package/dist/assets/components/code.tsx +22 -20
- package/dist/assets/components/collapsible.stories.tsx +128 -0
- package/dist/assets/components/collapsible.tsx +10 -0
- package/dist/assets/components/command.stories.tsx +183 -0
- package/dist/assets/components/command.tsx +170 -0
- package/dist/assets/components/context-menu.stories.tsx +159 -0
- package/dist/assets/components/context-menu.tsx +218 -0
- package/dist/assets/components/divider.tsx +38 -35
- package/dist/assets/components/dropdown-menu.tsx +217 -0
- package/dist/assets/components/hover-card.stories.tsx +113 -0
- package/dist/assets/components/hover-card.tsx +35 -0
- package/dist/assets/components/kbd.tsx +6 -6
- package/dist/assets/components/menubar.stories.tsx +208 -0
- package/dist/assets/components/menubar.tsx +251 -0
- package/dist/assets/components/navigation-menu.stories.tsx +237 -0
- package/dist/assets/components/navigation-menu.tsx +135 -0
- package/dist/assets/components/resizable.stories.tsx +197 -0
- package/dist/assets/components/resizable.tsx +47 -0
- package/dist/assets/components/scroll-area.stories.tsx +123 -0
- package/dist/assets/components/scroll-area.tsx +48 -0
- package/dist/assets/components/scroll-shadow.tsx +29 -7
- package/dist/assets/components/separator.tsx +32 -0
- package/dist/assets/components/sheet.tsx +141 -0
- package/dist/assets/components/sidebar.stories.tsx +351 -0
- package/dist/assets/components/sidebar.tsx +760 -0
- package/dist/assets/components/toggle-group.stories.tsx +153 -0
- package/dist/assets/components/toggle-group.tsx +61 -0
- package/dist/assets/components/toggle.stories.tsx +77 -0
- package/dist/assets/components/toggle.tsx +46 -0
- package/dist/assets/components/tooltip.tsx +23 -90
- package/dist/assets/globals.css +30 -0
- package/dist/assets/logos/40th-anniversary/Sonance_40_Logo_CMYK_BEAM_BLUE_40_AND_BEAM_DARK.png +0 -0
- package/dist/assets/logos/Sonance logo dark mode.png +0 -0
- package/dist/assets/logos/Sonance logo light mode.png +0 -0
- package/dist/assets/logos/blaze/BlazeBySonance_Logo_Lockup_2C_Light_RGB_05162025.png +0 -0
- package/dist/assets/logos/blaze/BlazeBySonance_Logo_Lockup_3C_Dark_RGB_05162025.png +0 -0
- package/dist/assets/logos/blaze/BlazeBySonance_Logo_Lockup_White_RGB_05162025.png +0 -0
- package/dist/assets/logos/iport/IPORT_Sonance_LockUp_2C_Dark_RGB.png +0 -0
- package/dist/assets/logos/iport/IPORT_Sonance_LockUp_2C_Light_RGB.png +0 -0
- package/dist/assets/logos/james/James_Logo_Black_CMYK.png +0 -0
- package/dist/assets/logos/james/James_Logo_Black_RGB.png +0 -0
- package/dist/assets/logos/james/James_Logo_LtGray_CMYK.png +0 -0
- package/dist/assets/logos/james/James_Logo_LtGray_RGB.png +0 -0
- package/dist/assets/logos/james/James_Logo_Polished_RGB.png +0 -0
- package/dist/assets/logos/james/James_Logo_Reverse_CMYK.png +0 -0
- package/dist/assets/logos/james/James_Logo_Reverse_RGB.png +0 -0
- package/dist/assets/logos/james/James_Logo_White_CMYK.png +0 -0
- package/dist/assets/logos/life-is-better/Sonance_LifeisBetter_Dark_RGB.png +0 -0
- package/dist/assets/logos/life-is-better/Sonance_LifeisBetter_Light_RGB.png +0 -0
- package/dist/assets/logos/my-sonance/My.Sonance_Logo_2C_Dark_RGB.png +0 -0
- package/dist/assets/logos/my-sonance/My.Sonance_Logo_2C_Light_RGB.png +0 -0
- package/dist/assets/logos/my-sonance/My.Sonance_Logo_2C_Reverse_RGB.png +0 -0
- package/dist/assets/logos/my-sonance/My.Sonance_Logo_Black_RGB.png +0 -0
- package/dist/assets/logos/my-sonance/My.Sonance_Logo_Reverse_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_2C_Dark_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_2C_Light_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_2C_Reverse_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_Black_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_Grayscale_RGB.png +0 -0
- package/dist/assets/logos/sonance/Sonance_Logo_Reverse_RGB.png +0 -0
- package/dist/assets/logos/sonance-academy/SonanceAcademy_Logo_Dark_CMYK.png +0 -0
- package/dist/assets/logos/sonance-academy/SonanceAcademy_Logo_Light_CMYK.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_3C_Dark_RGB.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_3C_Light_RGB.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_3C_Reverse_RGB.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_Black_RGB.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_Grayscale_RGB.png +0 -0
- package/dist/assets/logos/sonance-iport/Sonance_IPORT_LockUp_Reverse_RGB.png +0 -0
- package/dist/assets/logos/sonance-james/Sonance_James_Lockup_Dark.png +0 -0
- package/dist/assets/logos/sonance-james/Sonance_James_Lockup_Light.png +0 -0
- package/dist/assets/logos/sonance-james-iport/Sonance_James_IPORT_LockupStacked_Dark.png +0 -0
- package/dist/assets/logos/sonance-james-iport/Sonance_James_IPORT_LockupStacked_Light.png +0 -0
- package/dist/assets/logos/sonance-james-iport/Sonance_James_IPORT_Lockup_Dark.png +0 -0
- package/dist/assets/logos/sonance-james-iport/Sonance_James_IPORT_Lockup_Light.png +0 -0
- package/dist/assets/logos/trufig/TrufigLogo_Black.png +0 -0
- package/dist/assets/logos/trufig/TrufigLogo_Light.png +0 -0
- package/dist/assets/logos/trufig/TrufigWatermark_Black.png +0 -0
- package/dist/assets/logos/trufig/TrufigWatermark_Light.png +0 -0
- package/dist/index.js +416 -17
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { cn } from "@/lib/utils";
|
|
4
4
|
|
|
5
5
|
const kbdVariants = cva(
|
|
6
|
-
"inline-flex items-center justify-center font-mono font-medium border",
|
|
6
|
+
"inline-flex items-center justify-center font-mono font-medium border transition-all",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -12,9 +12,9 @@ const kbdVariants = cva(
|
|
|
12
12
|
flat: "bg-background-tertiary border-transparent text-foreground-muted",
|
|
13
13
|
},
|
|
14
14
|
size: {
|
|
15
|
-
sm: "h-5 min-w-5 px-1 text-[10px] rounded-sm",
|
|
16
|
-
md: "h-6 min-w-6 px-1.5 text-xs rounded-sm",
|
|
17
|
-
lg: "h-7 min-w-7 px-2 text-sm rounded",
|
|
15
|
+
sm: "h-4 sm:h-5 min-w-4 sm:min-w-5 px-0.5 sm:px-1 text-[9px] sm:text-[10px] rounded-sm",
|
|
16
|
+
md: "h-5 sm:h-6 min-w-5 sm:min-w-6 px-1 sm:px-1.5 text-[10px] sm:text-xs rounded-sm",
|
|
17
|
+
lg: "h-6 sm:h-7 min-w-6 sm:min-w-7 px-1.5 sm:px-2 text-xs sm:text-sm rounded",
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
@@ -103,8 +103,8 @@ interface KeyboardShortcutProps {
|
|
|
103
103
|
|
|
104
104
|
export function KeyboardShortcut({ keys, label, className }: KeyboardShortcutProps) {
|
|
105
105
|
return (
|
|
106
|
-
<span className={cn("inline-flex items-center gap-2", className)}>
|
|
107
|
-
{label && <span className="text-sm text-foreground-muted">{label}</span>}
|
|
106
|
+
<span className={cn("inline-flex items-center gap-1.5 sm:gap-2 flex-wrap", className)}>
|
|
107
|
+
{label && <span className="text-xs sm:text-sm text-foreground-muted">{label}</span>}
|
|
108
108
|
<Kbd keys={keys} />
|
|
109
109
|
</span>
|
|
110
110
|
);
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import {
|
|
6
|
+
Menubar,
|
|
7
|
+
MenubarCheckboxItem,
|
|
8
|
+
MenubarContent,
|
|
9
|
+
MenubarItem,
|
|
10
|
+
MenubarMenu,
|
|
11
|
+
MenubarRadioGroup,
|
|
12
|
+
MenubarRadioItem,
|
|
13
|
+
MenubarSeparator,
|
|
14
|
+
MenubarShortcut,
|
|
15
|
+
MenubarSub,
|
|
16
|
+
MenubarSubContent,
|
|
17
|
+
MenubarSubTrigger,
|
|
18
|
+
MenubarTrigger,
|
|
19
|
+
} from "./menubar";
|
|
20
|
+
|
|
21
|
+
const meta: Meta<typeof Menubar> = {
|
|
22
|
+
title: "Components/Navigation/Menubar",
|
|
23
|
+
component: Menubar,
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: "centered",
|
|
26
|
+
},
|
|
27
|
+
tags: ["autodocs"],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof Menubar>;
|
|
32
|
+
|
|
33
|
+
export const Default: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<Menubar>
|
|
36
|
+
<MenubarMenu>
|
|
37
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
38
|
+
<MenubarContent>
|
|
39
|
+
<MenubarItem>
|
|
40
|
+
New Tab <MenubarShortcut>⌘T</MenubarShortcut>
|
|
41
|
+
</MenubarItem>
|
|
42
|
+
<MenubarItem>
|
|
43
|
+
New Window <MenubarShortcut>⌘N</MenubarShortcut>
|
|
44
|
+
</MenubarItem>
|
|
45
|
+
<MenubarItem disabled>New Incognito Window</MenubarItem>
|
|
46
|
+
<MenubarSeparator />
|
|
47
|
+
<MenubarSub>
|
|
48
|
+
<MenubarSubTrigger>Share</MenubarSubTrigger>
|
|
49
|
+
<MenubarSubContent>
|
|
50
|
+
<MenubarItem>Email link</MenubarItem>
|
|
51
|
+
<MenubarItem>Messages</MenubarItem>
|
|
52
|
+
<MenubarItem>Notes</MenubarItem>
|
|
53
|
+
</MenubarSubContent>
|
|
54
|
+
</MenubarSub>
|
|
55
|
+
<MenubarSeparator />
|
|
56
|
+
<MenubarItem>
|
|
57
|
+
Print... <MenubarShortcut>⌘P</MenubarShortcut>
|
|
58
|
+
</MenubarItem>
|
|
59
|
+
</MenubarContent>
|
|
60
|
+
</MenubarMenu>
|
|
61
|
+
<MenubarMenu>
|
|
62
|
+
<MenubarTrigger>Edit</MenubarTrigger>
|
|
63
|
+
<MenubarContent>
|
|
64
|
+
<MenubarItem>
|
|
65
|
+
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
66
|
+
</MenubarItem>
|
|
67
|
+
<MenubarItem>
|
|
68
|
+
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
69
|
+
</MenubarItem>
|
|
70
|
+
<MenubarSeparator />
|
|
71
|
+
<MenubarSub>
|
|
72
|
+
<MenubarSubTrigger>Find</MenubarSubTrigger>
|
|
73
|
+
<MenubarSubContent>
|
|
74
|
+
<MenubarItem>Search the web</MenubarItem>
|
|
75
|
+
<MenubarSeparator />
|
|
76
|
+
<MenubarItem>Find...</MenubarItem>
|
|
77
|
+
<MenubarItem>Find Next</MenubarItem>
|
|
78
|
+
<MenubarItem>Find Previous</MenubarItem>
|
|
79
|
+
</MenubarSubContent>
|
|
80
|
+
</MenubarSub>
|
|
81
|
+
<MenubarSeparator />
|
|
82
|
+
<MenubarItem>Cut</MenubarItem>
|
|
83
|
+
<MenubarItem>Copy</MenubarItem>
|
|
84
|
+
<MenubarItem>Paste</MenubarItem>
|
|
85
|
+
</MenubarContent>
|
|
86
|
+
</MenubarMenu>
|
|
87
|
+
<MenubarMenu>
|
|
88
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
89
|
+
<MenubarContent>
|
|
90
|
+
<MenubarCheckboxItem>Always Show Bookmarks Bar</MenubarCheckboxItem>
|
|
91
|
+
<MenubarCheckboxItem checked>
|
|
92
|
+
Always Show Full URLs
|
|
93
|
+
</MenubarCheckboxItem>
|
|
94
|
+
<MenubarSeparator />
|
|
95
|
+
<MenubarItem inset>
|
|
96
|
+
Reload <MenubarShortcut>⌘R</MenubarShortcut>
|
|
97
|
+
</MenubarItem>
|
|
98
|
+
<MenubarItem disabled inset>
|
|
99
|
+
Force Reload <MenubarShortcut>⇧⌘R</MenubarShortcut>
|
|
100
|
+
</MenubarItem>
|
|
101
|
+
<MenubarSeparator />
|
|
102
|
+
<MenubarItem inset>Toggle Fullscreen</MenubarItem>
|
|
103
|
+
<MenubarSeparator />
|
|
104
|
+
<MenubarItem inset>Hide Sidebar</MenubarItem>
|
|
105
|
+
</MenubarContent>
|
|
106
|
+
</MenubarMenu>
|
|
107
|
+
<MenubarMenu>
|
|
108
|
+
<MenubarTrigger>Profiles</MenubarTrigger>
|
|
109
|
+
<MenubarContent>
|
|
110
|
+
<MenubarRadioGroup value="benoit">
|
|
111
|
+
<MenubarRadioItem value="andy">Andy</MenubarRadioItem>
|
|
112
|
+
<MenubarRadioItem value="benoit">Benoit</MenubarRadioItem>
|
|
113
|
+
<MenubarRadioItem value="luis">Luis</MenubarRadioItem>
|
|
114
|
+
</MenubarRadioGroup>
|
|
115
|
+
<MenubarSeparator />
|
|
116
|
+
<MenubarItem inset>Edit...</MenubarItem>
|
|
117
|
+
<MenubarSeparator />
|
|
118
|
+
<MenubarItem inset>Add Profile...</MenubarItem>
|
|
119
|
+
</MenubarContent>
|
|
120
|
+
</MenubarMenu>
|
|
121
|
+
</Menubar>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
function MenubarWithStateDemo() {
|
|
126
|
+
const [showBookmarks, setShowBookmarks] = useState(false);
|
|
127
|
+
const [showUrls, setShowUrls] = useState(true);
|
|
128
|
+
const [profile, setProfile] = useState("benoit");
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<Menubar>
|
|
132
|
+
<MenubarMenu>
|
|
133
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
134
|
+
<MenubarContent>
|
|
135
|
+
<MenubarItem>New File</MenubarItem>
|
|
136
|
+
<MenubarItem>Open...</MenubarItem>
|
|
137
|
+
<MenubarSeparator />
|
|
138
|
+
<MenubarItem>Save</MenubarItem>
|
|
139
|
+
<MenubarItem>Save As...</MenubarItem>
|
|
140
|
+
</MenubarContent>
|
|
141
|
+
</MenubarMenu>
|
|
142
|
+
<MenubarMenu>
|
|
143
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
144
|
+
<MenubarContent>
|
|
145
|
+
<MenubarCheckboxItem
|
|
146
|
+
checked={showBookmarks}
|
|
147
|
+
onCheckedChange={setShowBookmarks}
|
|
148
|
+
>
|
|
149
|
+
Show Bookmarks
|
|
150
|
+
</MenubarCheckboxItem>
|
|
151
|
+
<MenubarCheckboxItem
|
|
152
|
+
checked={showUrls}
|
|
153
|
+
onCheckedChange={setShowUrls}
|
|
154
|
+
>
|
|
155
|
+
Show Full URLs
|
|
156
|
+
</MenubarCheckboxItem>
|
|
157
|
+
</MenubarContent>
|
|
158
|
+
</MenubarMenu>
|
|
159
|
+
<MenubarMenu>
|
|
160
|
+
<MenubarTrigger>Profiles</MenubarTrigger>
|
|
161
|
+
<MenubarContent>
|
|
162
|
+
<MenubarRadioGroup value={profile} onValueChange={setProfile}>
|
|
163
|
+
<MenubarRadioItem value="andy">Andy</MenubarRadioItem>
|
|
164
|
+
<MenubarRadioItem value="benoit">Benoit</MenubarRadioItem>
|
|
165
|
+
<MenubarRadioItem value="luis">Luis</MenubarRadioItem>
|
|
166
|
+
</MenubarRadioGroup>
|
|
167
|
+
</MenubarContent>
|
|
168
|
+
</MenubarMenu>
|
|
169
|
+
</Menubar>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const WithState: Story = {
|
|
174
|
+
render: () => <MenubarWithStateDemo />,
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const Simple: Story = {
|
|
178
|
+
render: () => (
|
|
179
|
+
<Menubar>
|
|
180
|
+
<MenubarMenu>
|
|
181
|
+
<MenubarTrigger>Products</MenubarTrigger>
|
|
182
|
+
<MenubarContent>
|
|
183
|
+
<MenubarItem>Architectural Speakers</MenubarItem>
|
|
184
|
+
<MenubarItem>Outdoor Speakers</MenubarItem>
|
|
185
|
+
<MenubarItem>Subwoofers</MenubarItem>
|
|
186
|
+
<MenubarItem>Amplifiers</MenubarItem>
|
|
187
|
+
</MenubarContent>
|
|
188
|
+
</MenubarMenu>
|
|
189
|
+
<MenubarMenu>
|
|
190
|
+
<MenubarTrigger>Support</MenubarTrigger>
|
|
191
|
+
<MenubarContent>
|
|
192
|
+
<MenubarItem>Documentation</MenubarItem>
|
|
193
|
+
<MenubarItem>Tutorials</MenubarItem>
|
|
194
|
+
<MenubarItem>Contact Support</MenubarItem>
|
|
195
|
+
</MenubarContent>
|
|
196
|
+
</MenubarMenu>
|
|
197
|
+
<MenubarMenu>
|
|
198
|
+
<MenubarTrigger>About</MenubarTrigger>
|
|
199
|
+
<MenubarContent>
|
|
200
|
+
<MenubarItem>Company</MenubarItem>
|
|
201
|
+
<MenubarItem>Careers</MenubarItem>
|
|
202
|
+
<MenubarItem>Press</MenubarItem>
|
|
203
|
+
</MenubarContent>
|
|
204
|
+
</MenubarMenu>
|
|
205
|
+
</Menubar>
|
|
206
|
+
),
|
|
207
|
+
};
|
|
208
|
+
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
const MenubarMenu = MenubarPrimitive.Menu;
|
|
9
|
+
const MenubarGroup = MenubarPrimitive.Group;
|
|
10
|
+
const MenubarPortal = MenubarPrimitive.Portal;
|
|
11
|
+
const MenubarSub = MenubarPrimitive.Sub;
|
|
12
|
+
const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
13
|
+
|
|
14
|
+
const Menubar = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof MenubarPrimitive.Root>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
|
17
|
+
>(({ className, ...props }, ref) => (
|
|
18
|
+
<MenubarPrimitive.Root
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex h-10 items-center space-x-1 rounded-sm border border-border bg-background p-1",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
));
|
|
27
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
const MenubarTrigger = React.forwardRef<
|
|
30
|
+
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
32
|
+
>(({ className, ...props }, ref) => (
|
|
33
|
+
<MenubarPrimitive.Trigger
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none",
|
|
37
|
+
"focus:bg-secondary-hover focus:text-foreground",
|
|
38
|
+
"data-[state=open]:bg-secondary-hover data-[state=open]:text-foreground",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
));
|
|
44
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
45
|
+
|
|
46
|
+
const MenubarSubTrigger = React.forwardRef<
|
|
47
|
+
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
48
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
49
|
+
inset?: boolean;
|
|
50
|
+
}
|
|
51
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
52
|
+
<MenubarPrimitive.SubTrigger
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn(
|
|
55
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
56
|
+
"focus:bg-secondary-hover focus:text-foreground",
|
|
57
|
+
"data-[state=open]:bg-secondary-hover data-[state=open]:text-foreground",
|
|
58
|
+
inset && "pl-8",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
<ChevronRight className="ml-auto h-4 w-4" />
|
|
65
|
+
</MenubarPrimitive.SubTrigger>
|
|
66
|
+
));
|
|
67
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
68
|
+
|
|
69
|
+
const MenubarSubContent = React.forwardRef<
|
|
70
|
+
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
71
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
72
|
+
>(({ className, ...props }, ref) => (
|
|
73
|
+
<MenubarPrimitive.SubContent
|
|
74
|
+
ref={ref}
|
|
75
|
+
className={cn(
|
|
76
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-sm border border-border bg-card p-1 text-foreground shadow-md",
|
|
77
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
78
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
79
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
80
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
81
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
82
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
83
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
84
|
+
className
|
|
85
|
+
)}
|
|
86
|
+
{...props}
|
|
87
|
+
/>
|
|
88
|
+
));
|
|
89
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
90
|
+
|
|
91
|
+
const MenubarContent = React.forwardRef<
|
|
92
|
+
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
93
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
94
|
+
>(
|
|
95
|
+
(
|
|
96
|
+
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
97
|
+
ref
|
|
98
|
+
) => (
|
|
99
|
+
<MenubarPrimitive.Portal>
|
|
100
|
+
<MenubarPrimitive.Content
|
|
101
|
+
ref={ref}
|
|
102
|
+
align={align}
|
|
103
|
+
alignOffset={alignOffset}
|
|
104
|
+
sideOffset={sideOffset}
|
|
105
|
+
className={cn(
|
|
106
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-sm border border-border bg-card p-1 text-foreground shadow-md",
|
|
107
|
+
"data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
108
|
+
"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",
|
|
109
|
+
className
|
|
110
|
+
)}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
</MenubarPrimitive.Portal>
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
117
|
+
|
|
118
|
+
const MenubarItem = React.forwardRef<
|
|
119
|
+
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
120
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
121
|
+
inset?: boolean;
|
|
122
|
+
}
|
|
123
|
+
>(({ className, inset, ...props }, ref) => (
|
|
124
|
+
<MenubarPrimitive.Item
|
|
125
|
+
ref={ref}
|
|
126
|
+
className={cn(
|
|
127
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
128
|
+
"focus:bg-secondary-hover focus:text-foreground",
|
|
129
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
130
|
+
inset && "pl-8",
|
|
131
|
+
className
|
|
132
|
+
)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
));
|
|
136
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
137
|
+
|
|
138
|
+
const MenubarCheckboxItem = React.forwardRef<
|
|
139
|
+
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
140
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
141
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
142
|
+
<MenubarPrimitive.CheckboxItem
|
|
143
|
+
ref={ref}
|
|
144
|
+
className={cn(
|
|
145
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
146
|
+
"focus:bg-secondary-hover focus:text-foreground",
|
|
147
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
148
|
+
className
|
|
149
|
+
)}
|
|
150
|
+
checked={checked}
|
|
151
|
+
{...props}
|
|
152
|
+
>
|
|
153
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
154
|
+
<MenubarPrimitive.ItemIndicator>
|
|
155
|
+
<Check className="h-4 w-4" />
|
|
156
|
+
</MenubarPrimitive.ItemIndicator>
|
|
157
|
+
</span>
|
|
158
|
+
{children}
|
|
159
|
+
</MenubarPrimitive.CheckboxItem>
|
|
160
|
+
));
|
|
161
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
162
|
+
|
|
163
|
+
const MenubarRadioItem = React.forwardRef<
|
|
164
|
+
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
165
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
166
|
+
>(({ className, children, ...props }, ref) => (
|
|
167
|
+
<MenubarPrimitive.RadioItem
|
|
168
|
+
ref={ref}
|
|
169
|
+
className={cn(
|
|
170
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
171
|
+
"focus:bg-secondary-hover focus:text-foreground",
|
|
172
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
173
|
+
className
|
|
174
|
+
)}
|
|
175
|
+
{...props}
|
|
176
|
+
>
|
|
177
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
178
|
+
<MenubarPrimitive.ItemIndicator>
|
|
179
|
+
<Circle className="h-2 w-2 fill-current" />
|
|
180
|
+
</MenubarPrimitive.ItemIndicator>
|
|
181
|
+
</span>
|
|
182
|
+
{children}
|
|
183
|
+
</MenubarPrimitive.RadioItem>
|
|
184
|
+
));
|
|
185
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
186
|
+
|
|
187
|
+
const MenubarLabel = React.forwardRef<
|
|
188
|
+
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
189
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
190
|
+
inset?: boolean;
|
|
191
|
+
}
|
|
192
|
+
>(({ className, inset, ...props }, ref) => (
|
|
193
|
+
<MenubarPrimitive.Label
|
|
194
|
+
ref={ref}
|
|
195
|
+
className={cn(
|
|
196
|
+
"px-2 py-1.5 text-xs font-medium uppercase tracking-widest text-foreground-muted",
|
|
197
|
+
inset && "pl-8",
|
|
198
|
+
className
|
|
199
|
+
)}
|
|
200
|
+
{...props}
|
|
201
|
+
/>
|
|
202
|
+
));
|
|
203
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
204
|
+
|
|
205
|
+
const MenubarSeparator = React.forwardRef<
|
|
206
|
+
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
207
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
208
|
+
>(({ className, ...props }, ref) => (
|
|
209
|
+
<MenubarPrimitive.Separator
|
|
210
|
+
ref={ref}
|
|
211
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
212
|
+
{...props}
|
|
213
|
+
/>
|
|
214
|
+
));
|
|
215
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
216
|
+
|
|
217
|
+
const MenubarShortcut = ({
|
|
218
|
+
className,
|
|
219
|
+
...props
|
|
220
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
221
|
+
return (
|
|
222
|
+
<span
|
|
223
|
+
className={cn(
|
|
224
|
+
"ml-auto text-xs tracking-widest text-foreground-muted",
|
|
225
|
+
className
|
|
226
|
+
)}
|
|
227
|
+
{...props}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
MenubarShortcut.displayname = "MenubarShortcut";
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
Menubar,
|
|
235
|
+
MenubarMenu,
|
|
236
|
+
MenubarTrigger,
|
|
237
|
+
MenubarContent,
|
|
238
|
+
MenubarItem,
|
|
239
|
+
MenubarSeparator,
|
|
240
|
+
MenubarLabel,
|
|
241
|
+
MenubarCheckboxItem,
|
|
242
|
+
MenubarRadioGroup,
|
|
243
|
+
MenubarRadioItem,
|
|
244
|
+
MenubarPortal,
|
|
245
|
+
MenubarSubContent,
|
|
246
|
+
MenubarSubTrigger,
|
|
247
|
+
MenubarGroup,
|
|
248
|
+
MenubarSub,
|
|
249
|
+
MenubarShortcut,
|
|
250
|
+
};
|
|
251
|
+
|