@stagewise/ui 0.1.0 → 0.3.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.
Files changed (114) hide show
  1. package/README.md +9 -3
  2. package/package.json +9 -15
  3. package/src/components/ui/accordion.tsx +13 -15
  4. package/src/components/ui/alert-dialog.tsx +38 -38
  5. package/src/components/ui/alert.tsx +22 -22
  6. package/src/components/ui/aspect-ratio.tsx +6 -6
  7. package/src/components/ui/avatar.tsx +30 -30
  8. package/src/components/ui/badge.tsx +24 -22
  9. package/src/components/ui/breadcrumb.tsx +34 -37
  10. package/src/components/ui/bubble.tsx +48 -48
  11. package/src/components/ui/button-group.tsx +24 -24
  12. package/src/components/ui/button.tsx +24 -24
  13. package/src/components/ui/calendar.tsx +94 -81
  14. package/src/components/ui/card.tsx +30 -30
  15. package/src/components/ui/carousel.tsx +95 -92
  16. package/src/components/ui/chart.tsx +110 -110
  17. package/src/components/ui/checkbox.tsx +9 -10
  18. package/src/components/ui/collapsible.tsx +5 -5
  19. package/src/components/ui/combobox.tsx +51 -44
  20. package/src/components/ui/command.tsx +173 -190
  21. package/src/components/ui/context-menu.tsx +60 -50
  22. package/src/components/ui/dialog.tsx +33 -34
  23. package/src/components/ui/direction.tsx +1 -1
  24. package/src/components/ui/drawer.tsx +61 -61
  25. package/src/components/ui/dropdown-menu.tsx +54 -50
  26. package/src/components/ui/empty.tsx +30 -30
  27. package/src/components/ui/field.tsx +64 -64
  28. package/src/components/ui/hover-card.tsx +12 -12
  29. package/src/components/ui/input-group.tsx +54 -54
  30. package/src/components/ui/input-otp.tsx +24 -25
  31. package/src/components/ui/input.tsx +8 -8
  32. package/src/components/ui/item.tsx +64 -64
  33. package/src/components/ui/kbd.tsx +8 -8
  34. package/src/components/ui/klex-logo-combo.tsx +69 -0
  35. package/src/components/ui/klex-logo-text.tsx +70 -0
  36. package/src/components/ui/klex-logo.tsx +146 -0
  37. package/src/components/ui/label.tsx +8 -8
  38. package/src/components/ui/marker.tsx +25 -25
  39. package/src/components/ui/menubar.tsx +54 -50
  40. package/src/components/ui/message-scroller.tsx +130 -0
  41. package/src/components/ui/message.tsx +27 -27
  42. package/src/components/ui/native-select.tsx +22 -18
  43. package/src/components/ui/navigation-menu.tsx +37 -34
  44. package/src/components/ui/pagination.tsx +34 -31
  45. package/src/components/ui/popover.tsx +19 -19
  46. package/src/components/ui/progress.tsx +16 -16
  47. package/src/components/ui/questionnaire.tsx +72 -69
  48. package/src/components/ui/radio-group.tsx +9 -9
  49. package/src/components/ui/resizable.tsx +19 -12
  50. package/src/components/ui/scroll-area.tsx +10 -10
  51. package/src/components/ui/select.tsx +39 -34
  52. package/src/components/ui/separator.tsx +7 -7
  53. package/src/components/ui/sheet.tsx +31 -32
  54. package/src/components/ui/sidebar.tsx +244 -232
  55. package/src/components/ui/skeleton.tsx +5 -5
  56. package/src/components/ui/slider.tsx +11 -7
  57. package/src/components/ui/spinner.tsx +15 -6
  58. package/src/components/ui/stagewise-logo-combo.tsx +43 -0
  59. package/src/components/ui/stagewise-logo-text.tsx +30 -0
  60. package/src/components/ui/stagewise-logo.tsx +42 -0
  61. package/src/components/ui/switch.tsx +9 -9
  62. package/src/components/ui/table.tsx +31 -31
  63. package/src/components/ui/tabs.tsx +37 -26
  64. package/src/components/ui/textarea.tsx +7 -7
  65. package/src/components/ui/toast.tsx +70 -70
  66. package/src/components/ui/toggle-group.tsx +26 -26
  67. package/src/components/ui/toggle.tsx +15 -15
  68. package/src/components/ui/tooltip.tsx +13 -13
  69. package/src/hooks/use-mobile.ts +13 -11
  70. package/src/icons/custom/ui-outline-18/IconKlexOutline18.tsx +39 -0
  71. package/src/icons/custom/ui-outline-18/IconLaptop.tsx +35 -0
  72. package/src/icons/custom/ui-outline-18/IconSignOut.tsx +33 -0
  73. package/src/icons/custom/ui-outline-18/index.ts +4 -1
  74. package/src/icons/index.ts +43 -20
  75. package/src/icons/nucleo/social-media/IconMicrosoftEntraId.tsx +56 -0
  76. package/src/icons/nucleo/social-media/index.ts +1 -0
  77. package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +4 -3
  78. package/src/icons/nucleo/ui-outline-18/IconArrowTurnRightOutline18.tsx +32 -0
  79. package/src/icons/nucleo/ui-outline-18/IconArrowUpOutline18.tsx +35 -0
  80. package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +4 -3
  81. package/src/icons/nucleo/ui-outline-18/IconChevronMaximizeDiagonal2Outline18.tsx +33 -0
  82. package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +4 -3
  83. package/src/icons/nucleo/ui-outline-18/IconEmptyOutline18.tsx +41 -0
  84. package/src/icons/nucleo/ui-outline-18/IconEyeOffOutline18.tsx +18 -0
  85. package/src/icons/nucleo/ui-outline-18/IconLinkBrokenOutline18.tsx +66 -0
  86. package/src/icons/nucleo/ui-outline-18/IconLock18Outline.tsx +48 -0
  87. package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +4 -3
  88. package/src/icons/nucleo/ui-outline-18/IconMsgs2Outline18.tsx +32 -0
  89. package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +4 -3
  90. package/src/icons/nucleo/ui-outline-18/IconSidebarLeft2HideOutline18.tsx +63 -0
  91. package/src/icons/nucleo/ui-outline-18/IconSidebarRight2HideOutline18.tsx +63 -0
  92. package/src/icons/nucleo/ui-outline-18/index.ts +11 -1
  93. package/src/icons/provider/IconAnthropic.tsx +15 -0
  94. package/src/icons/provider/IconAttio.tsx +9 -0
  95. package/src/icons/provider/IconCodex.tsx +18 -0
  96. package/src/icons/provider/IconDiscord.tsx +17 -0
  97. package/src/icons/provider/IconGemini.tsx +152 -0
  98. package/src/icons/provider/IconLinear.tsx +9 -0
  99. package/src/icons/provider/IconOpenAI.tsx +15 -0
  100. package/src/icons/provider/IconOpenRouter.tsx +24 -0
  101. package/src/icons/provider/IconSlack.tsx +24 -0
  102. package/src/icons/provider/IconTelegram.tsx +29 -0
  103. package/src/icons/provider/IconWhatsapp.tsx +14 -0
  104. package/src/icons/provider/LICENSE +21 -0
  105. package/src/icons/provider/index.ts +11 -0
  106. package/src/index.ts +68 -61
  107. package/src/lib/utils.ts +3 -3
  108. package/src/styles/bridge.css +7 -3
  109. package/src/styles/derived-utilities.css +129 -50
  110. package/src/styles/index.css +17 -2
  111. package/src/styles/palette.css +266 -105
  112. package/src/styles/scroll-fade.css +116 -0
  113. package/src/styles/tailwind-tokens.css +3 -0
  114. package/src/styles/theme.css +57 -43
@@ -1,56 +1,78 @@
1
- "use client"
1
+ 'use client';
2
2
 
3
- import * as React from "react"
4
- import { Command as CommandPrimitive } from "cmdk"
3
+ import {
4
+ Command as CommandPrimitive,
5
+ defaultFilter as defaultCommandFilter,
6
+ useCommandState,
7
+ } from 'cmdk';
8
+ import type * as React from 'react';
5
9
 
6
- import { cn } from "../../lib/utils"
10
+ import {
11
+ IconCheckOutline18,
12
+ IconEarthSearchOutline18,
13
+ IconFolder5Outline18,
14
+ IconGear3Outline18,
15
+ IconMagnifierOutline18,
16
+ IconMsgWritingOutline18,
17
+ } from '../../icons';
18
+ import { cn } from '../../lib/utils';
7
19
  import {
8
20
  Dialog,
9
21
  DialogContent,
10
22
  DialogDescription,
11
23
  DialogHeader,
12
24
  DialogTitle,
13
- } from "./dialog"
14
- import { Kbd } from "./kbd"
15
- import {
16
- IconMagnifierOutline18,
17
- IconCheckOutline18,
18
- IconMsgWritingOutline18,
19
- IconEarthSearchOutline18,
20
- IconFolder5Outline18,
21
- IconGear3Outline18,
22
- } from "../../icons"
23
-
24
- /* -------------------------------------------------------------------------- */
25
- /* Types */
26
- /* -------------------------------------------------------------------------- */
25
+ } from './dialog';
26
+ import { InputGroup, InputGroupAddon } from './input-group';
27
+ import { Kbd } from './kbd';
28
+ import { Separator } from './separator';
29
+ import { ToggleGroup, ToggleGroupItem } from './toggle-group';
27
30
 
28
- export type CommandFilterMode = string
31
+ export type CommandFilterMode = string;
29
32
 
30
33
  export type CommandFilterTab = {
31
- /** Unique mode identifier (e.g. "global", "agents", "files"). */
32
- mode: CommandFilterMode
33
- /** Short label shown in the filter bar. */
34
- label: string
35
- /** Optional icon component to render before the label. */
36
- Icon?: React.ComponentType<{ className?: string }>
37
- }
38
-
39
- /* -------------------------------------------------------------------------- */
40
- /* Default filter tabs (matches stagewise command center) */
41
- /* -------------------------------------------------------------------------- */
34
+ mode: CommandFilterMode;
35
+ label: string;
36
+ Icon?: React.ComponentType<{
37
+ className?: string;
38
+ 'data-icon'?: 'inline-start' | 'inline-end';
39
+ }>;
40
+ };
42
41
 
43
42
  const DEFAULT_FILTER_TABS: CommandFilterTab[] = [
44
- { mode: "global", label: "All" },
45
- { mode: "agents", label: "Agents", Icon: IconMsgWritingOutline18 },
46
- { mode: "browser", label: "Browser", Icon: IconEarthSearchOutline18 },
47
- { mode: "files", label: "Files", Icon: IconFolder5Outline18 },
48
- { mode: "settings", label: "Settings", Icon: IconGear3Outline18 },
49
- ]
43
+ { mode: 'global', label: 'All' },
44
+ { mode: 'agents', label: 'Agents', Icon: IconMsgWritingOutline18 },
45
+ { mode: 'browser', label: 'Browser', Icon: IconEarthSearchOutline18 },
46
+ { mode: 'files', label: 'Files', Icon: IconFolder5Outline18 },
47
+ { mode: 'settings', label: 'Settings', Icon: IconGear3Outline18 },
48
+ ];
49
+
50
+ function handleFilterKeyDown(event: React.KeyboardEvent<HTMLButtonElement>) {
51
+ if (event.key === 'Enter' || event.key === ' ') {
52
+ event.stopPropagation();
53
+ return;
54
+ }
55
+
56
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
50
57
 
51
- /* -------------------------------------------------------------------------- */
52
- /* Command */
53
- /* -------------------------------------------------------------------------- */
58
+ if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
59
+ event.currentTarget
60
+ .closest('[data-slot="command"]')
61
+ ?.querySelector<HTMLInputElement>('[data-slot="command-input"]')
62
+ ?.focus();
63
+ return;
64
+ }
65
+
66
+ if (
67
+ event.key === 'ArrowLeft' ||
68
+ event.key === 'ArrowRight' ||
69
+ event.key === 'Home' ||
70
+ event.key === 'End'
71
+ ) {
72
+ event.preventDefault();
73
+ event.stopPropagation();
74
+ }
75
+ }
54
76
 
55
77
  function Command({
56
78
  className,
@@ -60,31 +82,27 @@ function Command({
60
82
  <CommandPrimitive
61
83
  data-slot="command"
62
84
  className={cn(
63
- "flex size-full flex-col overflow-hidden rounded-xl! bg-popover text-popover-foreground",
64
- className
85
+ 'flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground',
86
+ className,
65
87
  )}
66
88
  {...props}
67
89
  />
68
- )
90
+ );
69
91
  }
70
92
 
71
- /* -------------------------------------------------------------------------- */
72
- /* CommandDialog */
73
- /* -------------------------------------------------------------------------- */
74
-
75
93
  function CommandDialog({
76
- title = "Command Palette",
77
- description = "Search for a command to run...",
94
+ title = 'Command Palette',
95
+ description = 'Search for a command to run...',
78
96
  children,
79
97
  className,
80
98
  showCloseButton = false,
81
99
  ...props
82
- }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
83
- title?: string
84
- description?: string
85
- className?: string
86
- showCloseButton?: boolean
87
- children: React.ReactNode
100
+ }: Omit<React.ComponentProps<typeof Dialog>, 'children'> & {
101
+ title?: string;
102
+ description?: string;
103
+ className?: string;
104
+ showCloseButton?: boolean;
105
+ children: React.ReactNode;
88
106
  }) {
89
107
  return (
90
108
  <Dialog {...props}>
@@ -94,121 +112,115 @@ function CommandDialog({
94
112
  </DialogHeader>
95
113
  <DialogContent
96
114
  className={cn(
97
- "top-1/3 max-w-2xl translate-y-0 overflow-hidden rounded-xl! p-0 sm:max-w-2xl",
98
- className
115
+ 'top-[min(180px,25dvh)] max-h-[calc(100dvh-min(180px,25dvh)-1rem)] grid-rows-1 translate-y-0 overflow-hidden rounded-xl! p-0 sm:max-w-2xl',
116
+ className,
99
117
  )}
100
118
  showCloseButton={showCloseButton}
101
119
  >
102
- <Command>{children}</Command>
120
+ {children}
103
121
  </DialogContent>
104
122
  </Dialog>
105
- )
123
+ );
106
124
  }
107
125
 
108
- /* -------------------------------------------------------------------------- */
109
- /* CommandInput */
110
- /* -------------------------------------------------------------------------- */
111
-
112
126
  function CommandInput({
113
127
  className,
114
128
  children,
129
+ variant = 'default',
115
130
  ...props
116
131
  }: React.ComponentProps<typeof CommandPrimitive.Input> & {
117
- /** Optional content rendered after the input (e.g. CommandFilterTabs). */
118
- children?: React.ReactNode
132
+ children?: React.ReactNode;
133
+ variant?: 'default' | 'plain';
119
134
  }) {
135
+ const input = (
136
+ <CommandPrimitive.Input
137
+ data-slot="command-input"
138
+ className={cn(
139
+ 'min-w-0 flex-1 bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
140
+ className,
141
+ )}
142
+ {...props}
143
+ />
144
+ );
145
+
146
+ if (variant === 'plain') {
147
+ return (
148
+ <>
149
+ <div
150
+ data-slot="command-input-wrapper"
151
+ className="flex shrink-0 items-center gap-2 px-3 py-2.5"
152
+ >
153
+ <IconMagnifierOutline18 className="size-4 shrink-0 text-muted-foreground" />
154
+ {input}
155
+ {children}
156
+ </div>
157
+ <Separator />
158
+ </>
159
+ );
160
+ }
161
+
120
162
  return (
121
- <div
122
- data-slot="command-input-wrapper"
123
- className="flex items-center gap-2 px-3 py-2.5"
124
- >
125
- <IconMagnifierOutline18 className="size-4 shrink-0 text-muted-foreground" />
126
- <CommandPrimitive.Input
127
- data-slot="command-input"
128
- className={cn(
129
- "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-subtle-foreground disabled:cursor-not-allowed disabled:opacity-50",
130
- className
131
- )}
132
- {...props}
133
- />
134
- {children}
163
+ <div data-slot="command-input-wrapper" className="p-1 pb-0">
164
+ <InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
165
+ {input}
166
+ <InputGroupAddon>
167
+ <IconMagnifierOutline18 className="size-4 shrink-0 opacity-50" />
168
+ </InputGroupAddon>
169
+ {children}
170
+ </InputGroup>
135
171
  </div>
136
- )
172
+ );
137
173
  }
138
174
 
139
- /* -------------------------------------------------------------------------- */
140
- /* CommandFilterTabs (optional, tabbable mode filter) */
141
- /* -------------------------------------------------------------------------- */
142
-
143
175
  function CommandFilterTabs({
144
176
  tabs = DEFAULT_FILTER_TABS,
145
177
  activeMode,
146
178
  onModeChange,
147
179
  className,
148
180
  }: {
149
- tabs?: CommandFilterTab[]
150
- activeMode: CommandFilterMode
151
- onModeChange: (mode: CommandFilterMode) => void
152
- className?: string
181
+ tabs?: CommandFilterTab[];
182
+ activeMode: CommandFilterMode;
183
+ onModeChange: (mode: CommandFilterMode) => void;
184
+ className?: string;
153
185
  }) {
154
186
  return (
155
- <div
156
- data-slot="command-filter-tabs"
157
- className={cn(
158
- "flex shrink-0 items-center gap-2.5 text-xs",
159
- className
160
- )}
161
- >
162
- {tabs.map(({ mode, label, Icon }) => {
163
- const isActive = mode === activeMode
164
- return (
165
- <button
187
+ <div className={cn('flex shrink-0 items-center gap-2.5', className)}>
188
+ <ToggleGroup
189
+ aria-label="Command mode"
190
+ value={[activeMode]}
191
+ onValueChange={(modes) => {
192
+ if (modes[0]) onModeChange(modes[0]);
193
+ }}
194
+ spacing={2.5}
195
+ >
196
+ {tabs.map(({ mode, label, Icon }) => (
197
+ <ToggleGroupItem
166
198
  key={mode}
167
- type="button"
168
- aria-label={`Switch to ${label} mode`}
169
- aria-pressed={isActive}
170
- onClick={() => onModeChange(mode)}
171
- className={cn(
172
- "relative flex cursor-default items-center overflow-visible rounded-sm bg-popover p-0 outline-none transition-colors duration-150 ease-out",
173
- "hover:text-foreground focus-visible:text-foreground",
174
- isActive ? "text-foreground" : "text-subtle-foreground",
175
- )}
199
+ value={mode}
200
+ tabIndex={0}
201
+ onKeyDown={handleFilterKeyDown}
202
+ aria-label={label}
203
+ title={label}
204
+ className="h-5 min-w-0 gap-0 rounded-sm bg-transparent p-0 text-xs font-normal text-subtle-foreground transition-colors duration-150 hover:bg-transparent aria-pressed:bg-transparent aria-pressed:text-foreground"
176
205
  >
177
206
  {Icon ? (
178
- <span className="relative z-10 flex size-4 shrink-0 items-center justify-center bg-popover">
179
- <Icon className="size-4" />
180
- </span>
207
+ <>
208
+ <Icon />
209
+ <span className="inline-grid grid-cols-[0fr] overflow-hidden transition-[grid-template-columns,margin] duration-150 ease-out group-aria-pressed/toggle:ml-1 group-aria-pressed/toggle:grid-cols-[1fr] motion-reduce:transition-none">
210
+ <span className="min-w-0 overflow-hidden">{label}</span>
211
+ </span>
212
+ </>
181
213
  ) : (
182
- <span className="relative z-10 shrink-0 bg-popover px-1">
183
- {label}
184
- </span>
185
- )}
186
- {Icon && (
187
- <span
188
- className={cn(
189
- "relative z-0 ml-1 inline-grid overflow-hidden whitespace-nowrap transition-[grid-template-columns] duration-150 ease-out",
190
- isActive
191
- ? "grid-cols-[1fr]"
192
- : "grid-cols-[0fr]",
193
- )}
194
- >
195
- <span className="min-w-0 overflow-hidden">{label}</span>
196
- </span>
214
+ <span className="px-1">{label}</span>
197
215
  )}
198
- </button>
199
- )
200
- })}
201
- <Kbd className="shrink-0" aria-label="Press Tab to cycle filter modes">
202
- Tab
203
- </Kbd>
216
+ </ToggleGroupItem>
217
+ ))}
218
+ </ToggleGroup>
219
+ <Kbd aria-label="Press Tab to cycle filter modes">Tab</Kbd>
204
220
  </div>
205
- )
221
+ );
206
222
  }
207
223
 
208
- /* -------------------------------------------------------------------------- */
209
- /* CommandList */
210
- /* -------------------------------------------------------------------------- */
211
-
212
224
  function CommandList({
213
225
  className,
214
226
  ...props
@@ -217,18 +229,14 @@ function CommandList({
217
229
  <CommandPrimitive.List
218
230
  data-slot="command-list"
219
231
  className={cn(
220
- "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
221
- className
232
+ 'no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none',
233
+ className,
222
234
  )}
223
235
  {...props}
224
236
  />
225
- )
237
+ );
226
238
  }
227
239
 
228
- /* -------------------------------------------------------------------------- */
229
- /* CommandEmpty */
230
- /* -------------------------------------------------------------------------- */
231
-
232
240
  function CommandEmpty({
233
241
  className,
234
242
  ...props
@@ -236,16 +244,12 @@ function CommandEmpty({
236
244
  return (
237
245
  <CommandPrimitive.Empty
238
246
  data-slot="command-empty"
239
- className={cn("py-6 text-center text-xs text-muted-foreground", className)}
247
+ className={cn('py-6 text-center text-sm', className)}
240
248
  {...props}
241
249
  />
242
- )
250
+ );
243
251
  }
244
252
 
245
- /* -------------------------------------------------------------------------- */
246
- /* CommandGroup */
247
- /* -------------------------------------------------------------------------- */
248
-
249
253
  function CommandGroup({
250
254
  className,
251
255
  ...props
@@ -254,18 +258,14 @@ function CommandGroup({
254
258
  <CommandPrimitive.Group
255
259
  data-slot="command-group"
256
260
  className={cn(
257
- "overflow-hidden p-1.5 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-2 **:[[cmdk-group-heading]]:pb-1 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-semibold **:[[cmdk-group-heading]]:text-subtle-foreground",
258
- className
261
+ 'overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground',
262
+ className,
259
263
  )}
260
264
  {...props}
261
265
  />
262
- )
266
+ );
263
267
  }
264
268
 
265
- /* -------------------------------------------------------------------------- */
266
- /* CommandSeparator */
267
- /* -------------------------------------------------------------------------- */
268
-
269
269
  function CommandSeparator({
270
270
  className,
271
271
  ...props
@@ -273,16 +273,12 @@ function CommandSeparator({
273
273
  return (
274
274
  <CommandPrimitive.Separator
275
275
  data-slot="command-separator"
276
- className={cn("-mx-1 h-px border-derived-subtle border-t", className)}
276
+ className={cn('-mx-1 h-px bg-border', className)}
277
277
  {...props}
278
278
  />
279
- )
279
+ );
280
280
  }
281
281
 
282
- /* -------------------------------------------------------------------------- */
283
- /* CommandItem */
284
- /* -------------------------------------------------------------------------- */
285
-
286
282
  function CommandItem({
287
283
  className,
288
284
  children,
@@ -292,57 +288,44 @@ function CommandItem({
292
288
  <CommandPrimitive.Item
293
289
  data-slot="command-item"
294
290
  className={cn(
295
- "group/command-item relative flex cursor-default items-center gap-2 rounded-md bg-popover px-2 py-1.5 text-left text-sm outline-none transition-colors duration-150 ease-out select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-surface-1 data-[selected=true]:text-foreground hover:bg-hover-derived [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground",
296
- className
291
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground",
292
+ className,
297
293
  )}
298
294
  {...props}
299
295
  >
300
296
  {children}
301
297
  <IconCheckOutline18 className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
302
298
  </CommandPrimitive.Item>
303
- )
299
+ );
304
300
  }
305
301
 
306
- /* -------------------------------------------------------------------------- */
307
- /* CommandShortcut */
308
- /* -------------------------------------------------------------------------- */
309
-
310
302
  function CommandShortcut({
311
303
  className,
312
- children,
313
304
  ...props
314
- }: React.ComponentProps<"span"> & { children: React.ReactNode }) {
305
+ }: React.ComponentProps<'span'>) {
315
306
  return (
316
307
  <span
317
308
  data-slot="command-shortcut"
318
309
  className={cn(
319
- "ml-auto text-xs tracking-widest text-muted-foreground group-data-[selected=true]/command-item:text-foreground",
320
- className
310
+ 'ml-auto text-xs tracking-widest text-muted-foreground group-data-[selected=true]/command-item:text-foreground',
311
+ className,
321
312
  )}
322
313
  {...props}
323
- >
324
- {typeof children === "string" ? (
325
- <Kbd className="shrink-0">{children}</Kbd>
326
- ) : (
327
- children
328
- )}
329
- </span>
330
- )
314
+ />
315
+ );
331
316
  }
332
317
 
333
- /* -------------------------------------------------------------------------- */
334
- /* Exports */
335
- /* -------------------------------------------------------------------------- */
336
-
337
318
  export {
338
319
  Command,
339
320
  CommandDialog,
340
- CommandInput,
341
- CommandFilterTabs,
342
- CommandList,
343
321
  CommandEmpty,
322
+ CommandFilterTabs,
344
323
  CommandGroup,
324
+ CommandInput,
345
325
  CommandItem,
346
- CommandShortcut,
326
+ CommandList,
347
327
  CommandSeparator,
348
- }
328
+ CommandShortcut,
329
+ defaultCommandFilter,
330
+ useCommandState,
331
+ };