@foundrykit/primitives 2.0.8 → 2.0.10
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-D4X2ZO5T.js → chunk-2SBGU5XA.js} +2 -2
- package/dist/chunk-3NQR7JZR.js +128 -0
- package/dist/{chunk-3MEIDBWZ.js → chunk-3QUMCM5K.js} +2 -2
- package/dist/chunk-B5YCE3UP.js +57 -0
- package/dist/chunk-F2TEA6ER.js +138 -0
- package/dist/{chunk-5OSYIETI.js → chunk-FRIOQFPE.js} +1 -1
- package/dist/{chunk-EDKSYP4L.js → chunk-G2YBCHWR.js} +1 -1
- package/dist/{chunk-DKBMAFIR.js → chunk-GKCBSG2W.js} +2 -0
- package/dist/chunk-HS46TIMU.js +75 -0
- package/dist/{chunk-R3IEOV2B.js → chunk-P5KEJOBH.js} +1 -1
- package/dist/{chunk-FIRYLO5W.js → chunk-SDYKJVXX.js} +2 -2
- package/dist/chunk-SIQHWNPH.js +45 -0
- package/dist/{chunk-2PXD7LAX.js → chunk-U7JIOR7A.js} +3 -3
- package/dist/{chunk-VA4MKQN7.js → chunk-W4XY3SNY.js} +1 -1
- package/dist/chunk-XCPGTXEJ.js +23 -0
- package/dist/components/alert-dialog/index.cjs +1 -1
- package/dist/components/alert-dialog/index.js +1 -1
- package/dist/components/card/index.cjs +63 -61
- package/dist/components/card/index.d.cts +8 -7
- package/dist/components/card/index.d.ts +8 -7
- package/dist/components/card/index.js +1 -1
- package/dist/components/context-menu/index.cjs +2 -2
- package/dist/components/context-menu/index.js +1 -1
- package/dist/components/dialog/index.cjs +182 -0
- package/dist/components/dialog/index.d.cts +38 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +25 -0
- package/dist/components/dropdown/index.cjs +2 -2
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/hover-card/index.cjs +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.cjs +16 -28
- package/dist/components/input/index.d.cts +6 -5
- package/dist/components/input/index.d.ts +6 -5
- package/dist/components/input/index.js +1 -1
- package/dist/components/input-group/index.cjs +270 -0
- package/dist/components/input-group/index.d.cts +44 -0
- package/dist/components/input-group/index.d.ts +44 -0
- package/dist/components/input-group/index.js +153 -0
- package/dist/components/menubar/index.cjs +2 -2
- package/dist/components/menubar/index.js +1 -1
- package/dist/components/navigation-menu/index.cjs +3 -3
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.cjs +170 -0
- package/dist/components/sheet/index.d.cts +31 -0
- package/dist/components/sheet/index.d.ts +31 -0
- package/dist/components/sheet/index.js +21 -0
- package/dist/components/slider/index.cjs +2 -0
- package/dist/components/slider/index.d.cts +3 -2
- package/dist/components/slider/index.d.ts +3 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/toggle/index.cjs +81 -0
- package/dist/components/toggle/index.d.cts +26 -0
- package/dist/components/toggle/index.d.ts +26 -0
- package/dist/components/toggle/index.js +9 -0
- package/dist/components/tooltip/index.cjs +95 -0
- package/dist/components/tooltip/index.d.cts +25 -0
- package/dist/components/tooltip/index.d.ts +25 -0
- package/dist/components/tooltip/index.js +13 -0
- package/dist/index.cjs +107 -95
- package/dist/index.d.cts +11 -105
- package/dist/index.d.ts +11 -105
- package/dist/index.js +108 -414
- package/package.json +200 -8
- package/.turbo/turbo-build.log +0 -235
- package/.turbo/turbo-type-check.log +0 -4
- package/CHANGELOG.md +0 -224
- package/dist/chunk-DFGLEAZI.js +0 -63
- package/dist/chunk-RDQF3IQE.js +0 -25
- package/postcss.config.mjs +0 -6
- package/registry.json +0 -64
- package/src/components/accordion/config.ts +0 -28
- package/src/components/accordion/index.tsx +0 -80
- package/src/components/alert/config.ts +0 -40
- package/src/components/alert/index.tsx +0 -80
- package/src/components/alert-dialog/config.ts +0 -28
- package/src/components/alert-dialog/index.tsx +0 -188
- package/src/components/aspect-ratio/config.ts +0 -27
- package/src/components/aspect-ratio/index.tsx +0 -24
- package/src/components/avatar/config.ts +0 -46
- package/src/components/avatar/index.tsx +0 -67
- package/src/components/badge/config.ts +0 -56
- package/src/components/badge/index.tsx +0 -56
- package/src/components/breadcrumb/config.ts +0 -121
- package/src/components/breadcrumb/index.tsx +0 -127
- package/src/components/button/config.ts +0 -97
- package/src/components/button/index.tsx +0 -86
- package/src/components/button-group/config.ts +0 -39
- package/src/components/button-group/index.tsx +0 -99
- package/src/components/card/config.ts +0 -89
- package/src/components/card/index.tsx +0 -98
- package/src/components/checkbox/config.ts +0 -46
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/collapsible/config.ts +0 -27
- package/src/components/collapsible/index.tsx +0 -47
- package/src/components/context-menu/config.ts +0 -28
- package/src/components/context-menu/index.tsx +0 -271
- package/src/components/dialog/config.ts +0 -582
- package/src/components/dialog/index.tsx +0 -162
- package/src/components/direction/config.ts +0 -28
- package/src/components/direction/index.tsx +0 -27
- package/src/components/drawer/config.ts +0 -28
- package/src/components/drawer/index.tsx +0 -153
- package/src/components/dropdown/config.ts +0 -262
- package/src/components/dropdown/index.tsx +0 -280
- package/src/components/empty/config.ts +0 -38
- package/src/components/empty/index.tsx +0 -127
- package/src/components/field/config.ts +0 -40
- package/src/components/field/index.tsx +0 -252
- package/src/components/hover-card/config.ts +0 -27
- package/src/components/hover-card/index.tsx +0 -56
- package/src/components/input/config.ts +0 -64
- package/src/components/input/index.tsx +0 -33
- package/src/components/input-group/config.ts +0 -209
- package/src/components/input-group/index.tsx +0 -177
- package/src/components/item/config.ts +0 -52
- package/src/components/item/index.tsx +0 -215
- package/src/components/kbd/config.ts +0 -38
- package/src/components/kbd/index.tsx +0 -40
- package/src/components/label/config.ts +0 -72
- package/src/components/label/index.tsx +0 -32
- package/src/components/menubar/config.ts +0 -28
- package/src/components/menubar/index.tsx +0 -295
- package/src/components/native-select/config.ts +0 -40
- package/src/components/native-select/index.tsx +0 -40
- package/src/components/navigation-menu/config.ts +0 -32
- package/src/components/navigation-menu/index.tsx +0 -188
- package/src/components/popover/config.ts +0 -222
- package/src/components/popover/index.tsx +0 -60
- package/src/components/progress/config.ts +0 -42
- package/src/components/progress/index.tsx +0 -39
- package/src/components/radio-group/config.ts +0 -303
- package/src/components/radio-group/index.tsx +0 -58
- package/src/components/resizable/config.ts +0 -28
- package/src/components/resizable/index.tsx +0 -67
- package/src/components/scroll-area/config.ts +0 -17
- package/src/components/scroll-area/index.tsx +0 -70
- package/src/components/select/config.ts +0 -277
- package/src/components/select/index.tsx +0 -202
- package/src/components/separator/config.ts +0 -63
- package/src/components/separator/index.tsx +0 -38
- package/src/components/sheet/config.ts +0 -16
- package/src/components/sheet/index.tsx +0 -153
- package/src/components/skeleton/config.ts +0 -77
- package/src/components/skeleton/index.tsx +0 -22
- package/src/components/slider/config.ts +0 -46
- package/src/components/slider/index.tsx +0 -73
- package/src/components/sonner/config.ts +0 -27
- package/src/components/sonner/index.tsx +0 -37
- package/src/components/spinner/config.ts +0 -40
- package/src/components/spinner/index.tsx +0 -30
- package/src/components/switch/config.ts +0 -171
- package/src/components/switch/index.tsx +0 -40
- package/src/components/table/config.ts +0 -38
- package/src/components/table/index.tsx +0 -135
- package/src/components/tabs/config.ts +0 -335
- package/src/components/tabs/index.tsx +0 -82
- package/src/components/textarea/config.ts +0 -117
- package/src/components/textarea/index.tsx +0 -26
- package/src/components/toggle/config.ts +0 -67
- package/src/components/toggle/index.tsx +0 -59
- package/src/components/toggle-group/config.ts +0 -46
- package/src/components/toggle-group/index.tsx +0 -106
- package/src/components/tooltip/config.ts +0 -16
- package/src/components/tooltip/index.tsx +0 -75
- package/src/components/typography/config.ts +0 -38
- package/src/components/typography/index.tsx +0 -172
- package/src/index.ts +0 -291
- package/tsconfig.json +0 -9
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -55
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@foundrykit/utils';
|
|
4
|
-
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
6
|
-
import type * as React from 'react';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Horizontal menu bar built on Radix `Menubar.Root`. Compose with
|
|
10
|
-
* {@link MenubarMenu}, {@link MenubarTrigger}, {@link MenubarContent} and items
|
|
11
|
-
* such as {@link MenubarItem}, {@link MenubarCheckboxItem},
|
|
12
|
-
* {@link MenubarRadioItem}, {@link MenubarLabel}, {@link MenubarSeparator},
|
|
13
|
-
* {@link MenubarShortcut} and submenus ({@link MenubarSub},
|
|
14
|
-
* {@link MenubarSubTrigger}, {@link MenubarSubContent}).
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Menubar>
|
|
19
|
-
* <MenubarMenu>
|
|
20
|
-
* <MenubarTrigger>File</MenubarTrigger>
|
|
21
|
-
* <MenubarContent>
|
|
22
|
-
* <MenubarItem>New Tab</MenubarItem>
|
|
23
|
-
* </MenubarContent>
|
|
24
|
-
* </MenubarMenu>
|
|
25
|
-
* </Menubar>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function Menubar({
|
|
29
|
-
className,
|
|
30
|
-
...props
|
|
31
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
32
|
-
return (
|
|
33
|
-
<MenubarPrimitive.Root
|
|
34
|
-
data-slot='menubar'
|
|
35
|
-
className={cn(
|
|
36
|
-
'bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs',
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function MenubarMenu({
|
|
45
|
-
...props
|
|
46
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
47
|
-
return <MenubarPrimitive.Menu data-slot='menubar-menu' {...props} />;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function MenubarGroup({
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
53
|
-
return <MenubarPrimitive.Group data-slot='menubar-group' {...props} />;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function MenubarPortal({
|
|
57
|
-
...props
|
|
58
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
59
|
-
return <MenubarPrimitive.Portal data-slot='menubar-portal' {...props} />;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function MenubarRadioGroup({
|
|
63
|
-
...props
|
|
64
|
-
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
65
|
-
return (
|
|
66
|
-
<MenubarPrimitive.RadioGroup data-slot='menubar-radio-group' {...props} />
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function MenubarTrigger({
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
74
|
-
return (
|
|
75
|
-
<MenubarPrimitive.Trigger
|
|
76
|
-
data-slot='menubar-trigger'
|
|
77
|
-
className={cn(
|
|
78
|
-
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none',
|
|
79
|
-
className
|
|
80
|
-
)}
|
|
81
|
-
{...props}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function MenubarContent({
|
|
87
|
-
className,
|
|
88
|
-
align = 'start',
|
|
89
|
-
alignOffset = -4,
|
|
90
|
-
sideOffset = 8,
|
|
91
|
-
...props
|
|
92
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
93
|
-
return (
|
|
94
|
-
<MenubarPrimitive.Portal>
|
|
95
|
-
<MenubarPrimitive.Content
|
|
96
|
-
data-slot='menubar-content'
|
|
97
|
-
align={align}
|
|
98
|
-
alignOffset={alignOffset}
|
|
99
|
-
sideOffset={sideOffset}
|
|
100
|
-
className={cn(
|
|
101
|
-
'bg-popover text-popover-foreground 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 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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md',
|
|
102
|
-
className
|
|
103
|
-
)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
</MenubarPrimitive.Portal>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function MenubarItem({
|
|
111
|
-
className,
|
|
112
|
-
inset,
|
|
113
|
-
variant = 'default',
|
|
114
|
-
...props
|
|
115
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
116
|
-
inset?: boolean;
|
|
117
|
-
variant?: 'default' | 'destructive';
|
|
118
|
-
}) {
|
|
119
|
-
return (
|
|
120
|
-
<MenubarPrimitive.Item
|
|
121
|
-
data-slot='menubar-item'
|
|
122
|
-
data-inset={inset}
|
|
123
|
-
data-variant={variant}
|
|
124
|
-
className={cn(
|
|
125
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
126
|
-
className
|
|
127
|
-
)}
|
|
128
|
-
{...props}
|
|
129
|
-
/>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function MenubarCheckboxItem({
|
|
134
|
-
className,
|
|
135
|
-
children,
|
|
136
|
-
checked,
|
|
137
|
-
...props
|
|
138
|
-
}: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
|
|
139
|
-
return (
|
|
140
|
-
<MenubarPrimitive.CheckboxItem
|
|
141
|
-
data-slot='menubar-checkbox-item'
|
|
142
|
-
className={cn(
|
|
143
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
144
|
-
className
|
|
145
|
-
)}
|
|
146
|
-
checked={checked}
|
|
147
|
-
{...props}
|
|
148
|
-
>
|
|
149
|
-
<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>
|
|
150
|
-
<MenubarPrimitive.ItemIndicator>
|
|
151
|
-
<CheckIcon className='size-4' />
|
|
152
|
-
</MenubarPrimitive.ItemIndicator>
|
|
153
|
-
</span>
|
|
154
|
-
{children}
|
|
155
|
-
</MenubarPrimitive.CheckboxItem>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function MenubarRadioItem({
|
|
160
|
-
className,
|
|
161
|
-
children,
|
|
162
|
-
...props
|
|
163
|
-
}: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
|
|
164
|
-
return (
|
|
165
|
-
<MenubarPrimitive.RadioItem
|
|
166
|
-
data-slot='menubar-radio-item'
|
|
167
|
-
className={cn(
|
|
168
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
-
className
|
|
170
|
-
)}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>
|
|
174
|
-
<MenubarPrimitive.ItemIndicator>
|
|
175
|
-
<CircleIcon className='size-2 fill-current' />
|
|
176
|
-
</MenubarPrimitive.ItemIndicator>
|
|
177
|
-
</span>
|
|
178
|
-
{children}
|
|
179
|
-
</MenubarPrimitive.RadioItem>
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function MenubarLabel({
|
|
184
|
-
className,
|
|
185
|
-
inset,
|
|
186
|
-
...props
|
|
187
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
188
|
-
inset?: boolean;
|
|
189
|
-
}) {
|
|
190
|
-
return (
|
|
191
|
-
<MenubarPrimitive.Label
|
|
192
|
-
data-slot='menubar-label'
|
|
193
|
-
data-inset={inset}
|
|
194
|
-
className={cn(
|
|
195
|
-
'px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
|
|
196
|
-
className
|
|
197
|
-
)}
|
|
198
|
-
{...props}
|
|
199
|
-
/>
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function MenubarSeparator({
|
|
204
|
-
className,
|
|
205
|
-
...props
|
|
206
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
207
|
-
return (
|
|
208
|
-
<MenubarPrimitive.Separator
|
|
209
|
-
data-slot='menubar-separator'
|
|
210
|
-
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
211
|
-
{...props}
|
|
212
|
-
/>
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function MenubarShortcut({
|
|
217
|
-
className,
|
|
218
|
-
...props
|
|
219
|
-
}: React.ComponentProps<'span'>) {
|
|
220
|
-
return (
|
|
221
|
-
<span
|
|
222
|
-
data-slot='menubar-shortcut'
|
|
223
|
-
className={cn(
|
|
224
|
-
'text-muted-foreground ml-auto text-xs tracking-widest',
|
|
225
|
-
className
|
|
226
|
-
)}
|
|
227
|
-
{...props}
|
|
228
|
-
/>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function MenubarSub({
|
|
233
|
-
...props
|
|
234
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
235
|
-
return <MenubarPrimitive.Sub data-slot='menubar-sub' {...props} />;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function MenubarSubTrigger({
|
|
239
|
-
className,
|
|
240
|
-
inset,
|
|
241
|
-
children,
|
|
242
|
-
...props
|
|
243
|
-
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
244
|
-
inset?: boolean;
|
|
245
|
-
}) {
|
|
246
|
-
return (
|
|
247
|
-
<MenubarPrimitive.SubTrigger
|
|
248
|
-
data-slot='menubar-sub-trigger'
|
|
249
|
-
data-inset={inset}
|
|
250
|
-
className={cn(
|
|
251
|
-
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',
|
|
252
|
-
className
|
|
253
|
-
)}
|
|
254
|
-
{...props}
|
|
255
|
-
>
|
|
256
|
-
{children}
|
|
257
|
-
<ChevronRightIcon className='ml-auto size-4' />
|
|
258
|
-
</MenubarPrimitive.SubTrigger>
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function MenubarSubContent({
|
|
263
|
-
className,
|
|
264
|
-
...props
|
|
265
|
-
}: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
266
|
-
return (
|
|
267
|
-
<MenubarPrimitive.SubContent
|
|
268
|
-
data-slot='menubar-sub-content'
|
|
269
|
-
className={cn(
|
|
270
|
-
'bg-popover 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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
|
271
|
-
className
|
|
272
|
-
)}
|
|
273
|
-
{...props}
|
|
274
|
-
/>
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export {
|
|
279
|
-
Menubar,
|
|
280
|
-
MenubarCheckboxItem,
|
|
281
|
-
MenubarContent,
|
|
282
|
-
MenubarGroup,
|
|
283
|
-
MenubarItem,
|
|
284
|
-
MenubarLabel,
|
|
285
|
-
MenubarMenu,
|
|
286
|
-
MenubarPortal,
|
|
287
|
-
MenubarRadioGroup,
|
|
288
|
-
MenubarRadioItem,
|
|
289
|
-
MenubarSeparator,
|
|
290
|
-
MenubarShortcut,
|
|
291
|
-
MenubarSub,
|
|
292
|
-
MenubarSubContent,
|
|
293
|
-
MenubarSubTrigger,
|
|
294
|
-
MenubarTrigger,
|
|
295
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const NativeSelectConfig: ComponentConfig = {
|
|
4
|
-
name: 'Native Select',
|
|
5
|
-
description:
|
|
6
|
-
'A styled wrapper around the native select element with a chevron overlay.',
|
|
7
|
-
category: 'primitives',
|
|
8
|
-
tags: ['native-select', 'form', 'input'],
|
|
9
|
-
preview: {
|
|
10
|
-
type: 'static',
|
|
11
|
-
html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex h-9 w-full max-w-xs items-center justify-between rounded-md border border-gray-300 bg-white px-3"><span class="text-sm text-gray-600">Select an option</span><span class="text-gray-400">▾</span></div></div>',
|
|
12
|
-
},
|
|
13
|
-
variants: [
|
|
14
|
-
{
|
|
15
|
-
name: 'Default',
|
|
16
|
-
description: 'Default native select',
|
|
17
|
-
code: '<NativeSelect><option>Apple</option><option>Banana</option></NativeSelect>',
|
|
18
|
-
preview: {
|
|
19
|
-
type: 'component',
|
|
20
|
-
component: 'NativeSelect',
|
|
21
|
-
props: {},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Disabled',
|
|
26
|
-
description: 'Disabled native select',
|
|
27
|
-
code: '<NativeSelect disabled><option>Apple</option></NativeSelect>',
|
|
28
|
-
preview: {
|
|
29
|
-
type: 'component',
|
|
30
|
-
component: 'NativeSelect',
|
|
31
|
-
props: {
|
|
32
|
-
disabled: true,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
dependencies: ['utils'],
|
|
38
|
-
packageDependencies: ['lucide-react'],
|
|
39
|
-
files: ['components/primitives/native-select/index.tsx'],
|
|
40
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { cn } from '@foundrykit/utils';
|
|
2
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
3
|
-
import type * as React from 'react';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Styled wrapper around the native `<select>` element, adding the design
|
|
7
|
-
* system's field styling and a decorative chevron overlay while keeping full
|
|
8
|
-
* native behaviour and accessibility. Accepts all standard `<select>` props.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <NativeSelect defaultValue="apple">
|
|
13
|
-
* <option value="apple">Apple</option>
|
|
14
|
-
* <option value="banana">Banana</option>
|
|
15
|
-
* </NativeSelect>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function NativeSelect({
|
|
19
|
-
className,
|
|
20
|
-
children,
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<'select'>) {
|
|
23
|
-
return (
|
|
24
|
-
<div data-slot='native-select-wrapper' className='relative w-full'>
|
|
25
|
-
<select
|
|
26
|
-
data-slot='native-select'
|
|
27
|
-
className={cn(
|
|
28
|
-
'border-input text-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 [&>option]:text-foreground flex h-9 w-full appearance-none items-center rounded-md border bg-transparent py-2 pr-8 pl-3 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
29
|
-
className
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</select>
|
|
35
|
-
<ChevronDownIcon className='text-muted-foreground pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 opacity-50' />
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { NativeSelect };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const NavigationMenuConfig: ComponentConfig = {
|
|
4
|
-
name: 'Navigation Menu',
|
|
5
|
-
description:
|
|
6
|
-
'A collection of links and dropdown panels for navigating between sections of a site.',
|
|
7
|
-
category: 'primitives',
|
|
8
|
-
tags: ['navigation-menu', 'navigation', 'menu'],
|
|
9
|
-
preview: {
|
|
10
|
-
type: 'static',
|
|
11
|
-
html: '<div class="flex h-9 w-full items-center gap-1 rounded-md border border-gray-300 bg-gray-100 px-2"><span class="rounded-md px-4 py-2 text-sm text-gray-600">Home</span><span class="rounded-md px-4 py-2 text-sm text-gray-600">Products</span><span class="rounded-md px-4 py-2 text-sm text-gray-600">About</span></div>',
|
|
12
|
-
},
|
|
13
|
-
variants: [
|
|
14
|
-
{
|
|
15
|
-
name: 'Default',
|
|
16
|
-
description: 'Default navigation menu',
|
|
17
|
-
code: '<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuTrigger>Home</NavigationMenuTrigger></NavigationMenuItem></NavigationMenuList></NavigationMenu>',
|
|
18
|
-
preview: {
|
|
19
|
-
type: 'component',
|
|
20
|
-
component: 'NavigationMenu',
|
|
21
|
-
props: {},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
dependencies: ['utils'],
|
|
26
|
-
packageDependencies: [
|
|
27
|
-
'@radix-ui/react-navigation-menu',
|
|
28
|
-
'class-variance-authority',
|
|
29
|
-
'lucide-react',
|
|
30
|
-
],
|
|
31
|
-
files: ['components/primitives/navigation-menu/index.tsx'],
|
|
32
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@foundrykit/utils';
|
|
4
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
7
|
-
import type * as React from 'react';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Navigation menu built on Radix `NavigationMenu.Root`. Compose with
|
|
11
|
-
* {@link NavigationMenuList}, {@link NavigationMenuItem},
|
|
12
|
-
* {@link NavigationMenuTrigger}, {@link NavigationMenuContent} and
|
|
13
|
-
* {@link NavigationMenuLink}. Use {@link navigationMenuTriggerStyle} to style
|
|
14
|
-
* link triggers so they match menu triggers.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <NavigationMenu>
|
|
19
|
-
* <NavigationMenuList>
|
|
20
|
-
* <NavigationMenuItem>
|
|
21
|
-
* <NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
22
|
-
* <NavigationMenuContent>...</NavigationMenuContent>
|
|
23
|
-
* </NavigationMenuItem>
|
|
24
|
-
* </NavigationMenuList>
|
|
25
|
-
* </NavigationMenu>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function NavigationMenu({
|
|
29
|
-
className,
|
|
30
|
-
children,
|
|
31
|
-
viewport = true,
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
34
|
-
viewport?: boolean;
|
|
35
|
-
}) {
|
|
36
|
-
return (
|
|
37
|
-
<NavigationMenuPrimitive.Root
|
|
38
|
-
data-slot='navigation-menu'
|
|
39
|
-
data-viewport={viewport}
|
|
40
|
-
className={cn(
|
|
41
|
-
'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
{viewport && <NavigationMenuViewport />}
|
|
48
|
-
</NavigationMenuPrimitive.Root>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function NavigationMenuList({
|
|
53
|
-
className,
|
|
54
|
-
...props
|
|
55
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
56
|
-
return (
|
|
57
|
-
<NavigationMenuPrimitive.List
|
|
58
|
-
data-slot='navigation-menu-list'
|
|
59
|
-
className={cn(
|
|
60
|
-
'group flex flex-1 list-none items-center justify-center gap-1',
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function NavigationMenuItem({
|
|
69
|
-
className,
|
|
70
|
-
...props
|
|
71
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
72
|
-
return (
|
|
73
|
-
<NavigationMenuPrimitive.Item
|
|
74
|
-
data-slot='navigation-menu-item'
|
|
75
|
-
className={cn('relative', className)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const navigationMenuTriggerStyle = cva(
|
|
82
|
-
'group bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50'
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
function NavigationMenuTrigger({
|
|
86
|
-
className,
|
|
87
|
-
children,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
90
|
-
return (
|
|
91
|
-
<NavigationMenuPrimitive.Trigger
|
|
92
|
-
data-slot='navigation-menu-trigger'
|
|
93
|
-
className={cn(navigationMenuTriggerStyle(), 'group', className)}
|
|
94
|
-
{...props}
|
|
95
|
-
>
|
|
96
|
-
{children}{' '}
|
|
97
|
-
<ChevronDownIcon
|
|
98
|
-
className='relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180'
|
|
99
|
-
aria-hidden='true'
|
|
100
|
-
/>
|
|
101
|
-
</NavigationMenuPrimitive.Trigger>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function NavigationMenuContent({
|
|
106
|
-
className,
|
|
107
|
-
...props
|
|
108
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
109
|
-
return (
|
|
110
|
-
<NavigationMenuPrimitive.Content
|
|
111
|
-
data-slot='navigation-menu-content'
|
|
112
|
-
className={cn(
|
|
113
|
-
'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto',
|
|
114
|
-
'group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none',
|
|
115
|
-
className
|
|
116
|
-
)}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function NavigationMenuViewport({
|
|
123
|
-
className,
|
|
124
|
-
...props
|
|
125
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
126
|
-
return (
|
|
127
|
-
<div
|
|
128
|
-
className={cn(
|
|
129
|
-
'absolute top-full left-0 isolate z-50 flex justify-center'
|
|
130
|
-
)}
|
|
131
|
-
>
|
|
132
|
-
<NavigationMenuPrimitive.Viewport
|
|
133
|
-
data-slot='navigation-menu-viewport'
|
|
134
|
-
className={cn(
|
|
135
|
-
'origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
136
|
-
className
|
|
137
|
-
)}
|
|
138
|
-
{...props}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function NavigationMenuLink({
|
|
145
|
-
className,
|
|
146
|
-
...props
|
|
147
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
148
|
-
return (
|
|
149
|
-
<NavigationMenuPrimitive.Link
|
|
150
|
-
data-slot='navigation-menu-link'
|
|
151
|
-
className={cn(
|
|
152
|
-
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
153
|
-
className
|
|
154
|
-
)}
|
|
155
|
-
{...props}
|
|
156
|
-
/>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function NavigationMenuIndicator({
|
|
161
|
-
className,
|
|
162
|
-
...props
|
|
163
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
164
|
-
return (
|
|
165
|
-
<NavigationMenuPrimitive.Indicator
|
|
166
|
-
data-slot='navigation-menu-indicator'
|
|
167
|
-
className={cn(
|
|
168
|
-
'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden',
|
|
169
|
-
className
|
|
170
|
-
)}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<div className='bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md' />
|
|
174
|
-
</NavigationMenuPrimitive.Indicator>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export {
|
|
179
|
-
NavigationMenu,
|
|
180
|
-
NavigationMenuContent,
|
|
181
|
-
NavigationMenuIndicator,
|
|
182
|
-
NavigationMenuItem,
|
|
183
|
-
NavigationMenuLink,
|
|
184
|
-
NavigationMenuList,
|
|
185
|
-
NavigationMenuTrigger,
|
|
186
|
-
NavigationMenuViewport,
|
|
187
|
-
navigationMenuTriggerStyle,
|
|
188
|
-
};
|