@openconsole/shadcn 0.2.4 → 0.2.5

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.
Files changed (117) hide show
  1. package/README.md +460 -380
  2. package/components/ai-elements/agent.tsx +141 -0
  3. package/components/ai-elements/artifact.tsx +148 -0
  4. package/components/ai-elements/attachments.tsx +426 -0
  5. package/components/ai-elements/audio-player.tsx +231 -0
  6. package/components/ai-elements/canvas.tsx +26 -0
  7. package/components/ai-elements/chain-of-thought.tsx +222 -0
  8. package/components/ai-elements/checkpoint.tsx +71 -0
  9. package/components/ai-elements/code-block.tsx +562 -0
  10. package/components/ai-elements/commit.tsx +458 -0
  11. package/components/ai-elements/confirmation.tsx +174 -0
  12. package/components/ai-elements/connection.tsx +28 -0
  13. package/components/ai-elements/context.tsx +409 -0
  14. package/components/ai-elements/controls.tsx +18 -0
  15. package/components/ai-elements/conversation.tsx +168 -0
  16. package/components/ai-elements/edge.tsx +143 -0
  17. package/components/ai-elements/environment-variables.tsx +324 -0
  18. package/components/ai-elements/file-tree.tsx +304 -0
  19. package/components/ai-elements/image.tsx +24 -0
  20. package/components/ai-elements/index.ts +51 -0
  21. package/components/ai-elements/inline-citation.tsx +296 -0
  22. package/components/ai-elements/jsx-preview.tsx +310 -0
  23. package/components/ai-elements/message.tsx +360 -0
  24. package/components/ai-elements/mic-selector.tsx +375 -0
  25. package/components/ai-elements/model-selector.tsx +213 -0
  26. package/components/ai-elements/node.tsx +71 -0
  27. package/components/ai-elements/open-in-chat.tsx +370 -0
  28. package/components/ai-elements/package-info.tsx +239 -0
  29. package/components/ai-elements/panel.tsx +15 -0
  30. package/components/ai-elements/persona.tsx +306 -0
  31. package/components/ai-elements/plan.tsx +147 -0
  32. package/components/ai-elements/prompt-input.tsx +1463 -0
  33. package/components/ai-elements/queue.tsx +274 -0
  34. package/components/ai-elements/reasoning.tsx +228 -0
  35. package/components/ai-elements/sandbox.tsx +132 -0
  36. package/components/ai-elements/schema-display.tsx +471 -0
  37. package/components/ai-elements/shimmer.tsx +77 -0
  38. package/components/ai-elements/snippet.tsx +145 -0
  39. package/components/ai-elements/sources.tsx +77 -0
  40. package/components/ai-elements/speech-input.tsx +323 -0
  41. package/components/ai-elements/stack-trace.tsx +528 -0
  42. package/components/ai-elements/suggestion.tsx +57 -0
  43. package/components/ai-elements/task.tsx +87 -0
  44. package/components/ai-elements/terminal.tsx +273 -0
  45. package/components/ai-elements/test-results.tsx +496 -0
  46. package/components/ai-elements/tool.tsx +173 -0
  47. package/components/ai-elements/toolbar.tsx +16 -0
  48. package/components/ai-elements/transcription.tsx +125 -0
  49. package/components/ai-elements/voice-selector.tsx +524 -0
  50. package/components/ai-elements/web-preview.tsx +281 -0
  51. package/components/index.ts +3 -0
  52. package/{accordion.tsx → components/ui/accordion.tsx} +66 -66
  53. package/{alert-dialog.tsx → components/ui/alert-dialog.tsx} +196 -196
  54. package/{alert.tsx → components/ui/alert.tsx} +66 -66
  55. package/{aspect-ratio.tsx → components/ui/aspect-ratio.tsx} +11 -11
  56. package/{avatar.tsx → components/ui/avatar.tsx} +53 -53
  57. package/{badge.tsx → components/ui/badge.tsx} +46 -46
  58. package/{breadcrumb.tsx → components/ui/breadcrumb.tsx} +109 -109
  59. package/{button-group.tsx → components/ui/button-group.tsx} +83 -83
  60. package/{button.tsx → components/ui/button.tsx} +60 -60
  61. package/{calendar.tsx → components/ui/calendar.tsx} +219 -219
  62. package/{card.tsx → components/ui/card.tsx} +92 -92
  63. package/{carousel.tsx → components/ui/carousel.tsx} +241 -241
  64. package/{chart.tsx → components/ui/chart.tsx} +374 -374
  65. package/{checkbox.tsx → components/ui/checkbox.tsx} +32 -32
  66. package/{collapsible.tsx → components/ui/collapsible.tsx} +33 -33
  67. package/{command.tsx → components/ui/command.tsx} +184 -184
  68. package/{context-menu.tsx → components/ui/context-menu.tsx} +252 -252
  69. package/{dialog.tsx → components/ui/dialog.tsx} +143 -143
  70. package/{direction.tsx → components/ui/direction.tsx} +22 -22
  71. package/{drawer.tsx → components/ui/drawer.tsx} +135 -135
  72. package/{dropdown-menu.tsx → components/ui/dropdown-menu.tsx} +257 -257
  73. package/{empty.tsx → components/ui/empty.tsx} +104 -104
  74. package/{field.tsx → components/ui/field.tsx} +248 -248
  75. package/{form.tsx → components/ui/form.tsx} +167 -167
  76. package/{hover-card.tsx → components/ui/hover-card.tsx} +44 -44
  77. package/{icon.tsx → components/ui/icon.tsx} +55 -55
  78. package/components/ui/index.ts +59 -0
  79. package/{input-group.tsx → components/ui/input-group.tsx} +170 -170
  80. package/{input-otp.tsx → components/ui/input-otp.tsx} +77 -77
  81. package/{input.tsx → components/ui/input.tsx} +21 -21
  82. package/{item.tsx → components/ui/item.tsx} +193 -193
  83. package/{kbd.tsx → components/ui/kbd.tsx} +28 -28
  84. package/{label.tsx → components/ui/label.tsx} +24 -24
  85. package/{menubar.tsx → components/ui/menubar.tsx} +276 -276
  86. package/{native-select.tsx → components/ui/native-select.tsx} +62 -62
  87. package/{navigation-menu.tsx → components/ui/navigation-menu.tsx} +168 -168
  88. package/{pagination.tsx → components/ui/pagination.tsx} +127 -127
  89. package/{popover.tsx → components/ui/popover.tsx} +89 -89
  90. package/{progress.tsx → components/ui/progress.tsx} +31 -31
  91. package/{radio-group.tsx → components/ui/radio-group.tsx} +45 -45
  92. package/{resizable.tsx → components/ui/resizable.tsx} +53 -53
  93. package/{scroll-area.tsx → components/ui/scroll-area.tsx} +58 -58
  94. package/{select.tsx → components/ui/select.tsx} +187 -187
  95. package/{separator.tsx → components/ui/separator.tsx} +28 -28
  96. package/{sheet.tsx → components/ui/sheet.tsx} +139 -139
  97. package/{sidebar.tsx → components/ui/sidebar.tsx} +724 -724
  98. package/{skeleton.tsx → components/ui/skeleton.tsx} +13 -13
  99. package/{slider.tsx → components/ui/slider.tsx} +63 -63
  100. package/{sonner.tsx → components/ui/sonner.tsx} +40 -40
  101. package/{spinner.tsx → components/ui/spinner.tsx} +16 -16
  102. package/{switch.tsx → components/ui/switch.tsx} +35 -35
  103. package/{table.tsx → components/ui/table.tsx} +116 -116
  104. package/{tabs.tsx → components/ui/tabs.tsx} +66 -66
  105. package/{textarea.tsx → components/ui/textarea.tsx} +18 -18
  106. package/{toggle-group.tsx → components/ui/toggle-group.tsx} +83 -83
  107. package/{toggle.tsx → components/ui/toggle.tsx} +47 -47
  108. package/{tooltip.tsx → components/ui/tooltip.tsx} +61 -61
  109. package/hooks/index.ts +1 -1
  110. package/hooks/use-mobile.ts +19 -19
  111. package/index.ts +3 -59
  112. package/lib/index.ts +1 -1
  113. package/lib/utils.ts +6 -6
  114. package/package.json +79 -1
  115. package/styles.css +124 -124
  116. package/tsconfig.json +0 -12
  117. package/tsconfig.tsbuildinfo +0 -1
@@ -1,276 +1,276 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
5
- import { Menubar as MenubarPrimitive } from "radix-ui"
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
- }
24
-
25
- function MenubarMenu({
26
- ...props
27
- }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
28
- return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
29
- }
30
-
31
- function MenubarGroup({
32
- ...props
33
- }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
34
- return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
35
- }
36
-
37
- function MenubarPortal({
38
- ...props
39
- }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
40
- return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
41
- }
42
-
43
- function MenubarRadioGroup({
44
- ...props
45
- }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
46
- return (
47
- <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
48
- )
49
- }
50
-
51
- function MenubarTrigger({
52
- className,
53
- ...props
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>
76
- <MenubarPrimitive.Content
77
- data-slot="menubar-content"
78
- align={align}
79
- alignOffset={alignOffset}
80
- sideOffset={sideOffset}
81
- className={cn(
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",
83
- className
84
- )}
85
- {...props}
86
- />
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
- <CheckIcon 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
- <CircleIcon 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
- />
181
- )
182
- }
183
-
184
- function MenubarSeparator({
185
- className,
186
- ...props
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">) {
201
- return (
202
- <span
203
- data-slot="menubar-shortcut"
204
- className={cn(
205
- "ml-auto text-xs tracking-widest text-muted-foreground",
206
- className
207
- )}
208
- {...props}
209
- />
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
- <ChevronRightIcon 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
- }
258
-
259
- export {
260
- Menubar,
261
- MenubarPortal,
262
- MenubarMenu,
263
- MenubarTrigger,
264
- MenubarContent,
265
- MenubarGroup,
266
- MenubarSeparator,
267
- MenubarLabel,
268
- MenubarItem,
269
- MenubarShortcut,
270
- MenubarCheckboxItem,
271
- MenubarRadioGroup,
272
- MenubarRadioItem,
273
- MenubarSub,
274
- MenubarSubTrigger,
275
- MenubarSubContent,
276
- }
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
5
+ import { Menubar as MenubarPrimitive } from "radix-ui"
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
+ }
24
+
25
+ function MenubarMenu({
26
+ ...props
27
+ }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
28
+ return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
29
+ }
30
+
31
+ function MenubarGroup({
32
+ ...props
33
+ }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
34
+ return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
35
+ }
36
+
37
+ function MenubarPortal({
38
+ ...props
39
+ }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
40
+ return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
41
+ }
42
+
43
+ function MenubarRadioGroup({
44
+ ...props
45
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
46
+ return (
47
+ <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
48
+ )
49
+ }
50
+
51
+ function MenubarTrigger({
52
+ className,
53
+ ...props
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>
76
+ <MenubarPrimitive.Content
77
+ data-slot="menubar-content"
78
+ align={align}
79
+ alignOffset={alignOffset}
80
+ sideOffset={sideOffset}
81
+ className={cn(
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",
83
+ className
84
+ )}
85
+ {...props}
86
+ />
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
+ <CheckIcon 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
+ <CircleIcon 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
+ />
181
+ )
182
+ }
183
+
184
+ function MenubarSeparator({
185
+ className,
186
+ ...props
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">) {
201
+ return (
202
+ <span
203
+ data-slot="menubar-shortcut"
204
+ className={cn(
205
+ "ml-auto text-xs tracking-widest text-muted-foreground",
206
+ className
207
+ )}
208
+ {...props}
209
+ />
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
+ <ChevronRightIcon 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
+ }
258
+
259
+ export {
260
+ Menubar,
261
+ MenubarPortal,
262
+ MenubarMenu,
263
+ MenubarTrigger,
264
+ MenubarContent,
265
+ MenubarGroup,
266
+ MenubarSeparator,
267
+ MenubarLabel,
268
+ MenubarItem,
269
+ MenubarShortcut,
270
+ MenubarCheckboxItem,
271
+ MenubarRadioGroup,
272
+ MenubarRadioItem,
273
+ MenubarSub,
274
+ MenubarSubTrigger,
275
+ MenubarSubContent,
276
+ }
@@ -1,62 +1,62 @@
1
- import * as React from "react"
2
- import { ChevronDownIcon } from "lucide-react"
3
-
4
- import { cn } from "./lib/utils"
5
-
6
- function NativeSelect({
7
- className,
8
- size = "default",
9
- ...props
10
- }: Omit<React.ComponentProps<"select">, "size"> & { size?: "sm" | "default" }) {
11
- return (
12
- <div
13
- className="group/native-select relative w-fit has-[select:disabled]:opacity-50"
14
- data-slot="native-select-wrapper"
15
- >
16
- <select
17
- data-slot="native-select"
18
- data-size={size}
19
- className={cn(
20
- "h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 dark:bg-input/30 dark:hover:bg-input/50",
21
- "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
22
- "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
23
- className
24
- )}
25
- {...props}
26
- />
27
- <ChevronDownIcon
28
- className="pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 text-muted-foreground opacity-50 select-none"
29
- aria-hidden="true"
30
- data-slot="native-select-icon"
31
- />
32
- </div>
33
- )
34
- }
35
-
36
- function NativeSelectOption({
37
- className,
38
- ...props
39
- }: React.ComponentProps<"option">) {
40
- return (
41
- <option
42
- data-slot="native-select-option"
43
- className={cn("bg-[Canvas] text-[CanvasText]", className)}
44
- {...props}
45
- />
46
- )
47
- }
48
-
49
- function NativeSelectOptGroup({
50
- className,
51
- ...props
52
- }: React.ComponentProps<"optgroup">) {
53
- return (
54
- <optgroup
55
- data-slot="native-select-optgroup"
56
- className={cn("bg-[Canvas] text-[CanvasText]", className)}
57
- {...props}
58
- />
59
- )
60
- }
61
-
62
- export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
1
+ import * as React from "react"
2
+ import { ChevronDownIcon } from "lucide-react"
3
+
4
+ import { cn } from "../../lib/utils"
5
+
6
+ function NativeSelect({
7
+ className,
8
+ size = "default",
9
+ ...props
10
+ }: Omit<React.ComponentProps<"select">, "size"> & { size?: "sm" | "default" }) {
11
+ return (
12
+ <div
13
+ className="group/native-select relative w-fit has-[select:disabled]:opacity-50"
14
+ data-slot="native-select-wrapper"
15
+ >
16
+ <select
17
+ data-slot="native-select"
18
+ data-size={size}
19
+ className={cn(
20
+ "h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 dark:bg-input/30 dark:hover:bg-input/50",
21
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
22
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ <ChevronDownIcon
28
+ className="pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 text-muted-foreground opacity-50 select-none"
29
+ aria-hidden="true"
30
+ data-slot="native-select-icon"
31
+ />
32
+ </div>
33
+ )
34
+ }
35
+
36
+ function NativeSelectOption({
37
+ className,
38
+ ...props
39
+ }: React.ComponentProps<"option">) {
40
+ return (
41
+ <option
42
+ data-slot="native-select-option"
43
+ className={cn("bg-[Canvas] text-[CanvasText]", className)}
44
+ {...props}
45
+ />
46
+ )
47
+ }
48
+
49
+ function NativeSelectOptGroup({
50
+ className,
51
+ ...props
52
+ }: React.ComponentProps<"optgroup">) {
53
+ return (
54
+ <optgroup
55
+ data-slot="native-select-optgroup"
56
+ className={cn("bg-[Canvas] text-[CanvasText]", className)}
57
+ {...props}
58
+ />
59
+ )
60
+ }
61
+
62
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }