@adea-ai/ui 0.82.1 → 0.82.2

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 (43) hide show
  1. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  2. package/dist/components/composites/appearance-editor/appearance-choices.js +3 -3
  3. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  4. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  5. package/dist/components/composites/appearance-editor/appearance-rows.js +13 -2
  6. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  7. package/dist/components/layout/side-rail/side-rail.d.ts +1 -0
  8. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
  9. package/dist/components/layout/side-rail/side-rail.js +6 -2
  10. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  11. package/dist/components/ui/command/command.d.ts +5 -6
  12. package/dist/components/ui/command/command.d.ts.map +1 -1
  13. package/dist/components/ui/command/command.js +73 -15
  14. package/dist/components/ui/command/command.js.map +1 -1
  15. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -0
  16. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  17. package/dist/components/ui/dropdown-menu/dropdown-menu.js +7 -1
  18. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  19. package/dist/components/ui/status-chip/status-chip.d.ts +2 -0
  20. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  21. package/dist/components/ui/status-chip/status-chip.js +26 -17
  22. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/lib/overlay.js +1 -1
  25. package/dist/lib/overlay.js.map +1 -1
  26. package/dist/r/command.json +2 -0
  27. package/dist/r/registry.json +2 -0
  28. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
  29. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
  30. package/dist/r/src/components/layout/side-rail/side-rail.tsx +8 -3
  31. package/dist/r/src/components/ui/command/command.tsx +81 -29
  32. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
  33. package/dist/r/src/components/ui/status-chip/status-chip.tsx +11 -2
  34. package/dist/r/src/lib/overlay.ts +1 -1
  35. package/package.json +1 -1
  36. package/registry.json +2 -0
  37. package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
  38. package/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
  39. package/src/components/layout/side-rail/side-rail.tsx +8 -3
  40. package/src/components/ui/command/command.tsx +81 -29
  41. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
  42. package/src/components/ui/status-chip/status-chip.tsx +11 -2
  43. package/src/lib/overlay.ts +1 -1
@@ -10,17 +10,20 @@ import {
10
10
  CommandSeparator as CmdkSeparator,
11
11
  useCommandState,
12
12
  } from 'cmdk-solid'
13
+ import { Dialog as KobalteDialog } from '@kobalte/core/dialog'
13
14
  import { Search } from 'lucide-solid'
14
15
  import type { ComponentProps } from 'solid-js'
15
16
  import { createEffect, createSignal, splitProps } from 'solid-js'
17
+ import { createDialogFocusRestoration } from '../dialog/dialog'
16
18
  import { menuItem } from '../../../lib/overlay'
17
19
  import { cn } from '../../../lib/utils'
18
20
 
19
- // cmdk emits data-disabled="false" on enabled items; Kobalte omits it.
20
- // Presence selectors would dim and disable every command in an app palette.
21
+ // cmdk emits data-disabled="false" on enabled items, unlike the presence-only
22
+ // attributes Kobalte menu rows use. Apply those shared disabled styles only when
23
+ // cmdk's value is true.
21
24
  const commandItem = menuItem
22
25
  .replace('data-[disabled]:pointer-events-none', '')
23
- .replace('data-[disabled]:opacity-50', '')
26
+ .replace('data-[disabled]:text-muted-foreground', '')
24
27
 
25
28
  /**
26
29
  * Command.
@@ -52,26 +55,76 @@ export function Command(props: ComponentProps<typeof CmdkRoot>) {
52
55
  )
53
56
  }
54
57
 
55
- export function CommandDialog(props: ComponentProps<typeof CmdkDialog>) {
56
- // cmdk's Dialog splits `contentClassName` onto the role="dialog" content
57
- // element and routes every other prop (including `class`) to the inner
58
- // Command. The surface must live on the content: a `class` here styles the
59
- // Command (fixed, so visible) while the dialog element itself renders as an
60
- // unstyled zero-height wrapper at the end of body — invisible to role
61
- // queries and axe.
62
- const [local, rest] = splitProps(props, ['class'])
58
+ type CommandDialogProps = ComponentProps<typeof CmdkDialog> &
59
+ Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>
60
+
61
+ export function CommandDialog(props: CommandDialogProps) {
62
+ // cmdk-solid's Dialog does not forward Content autofocus props: unknown
63
+ // props fall through to its Command root. Compose Kobalte's dialog surface
64
+ // here so Escape and other close paths can restore focus to the real opener.
65
+ // Preserve the shared wrapper's `class` contract on the dialog surface;
66
+ // `contentClassName` adds to it, while the nested Command keeps its own API.
67
+ const [local, dialogProps, commandProps] = splitProps(
68
+ props,
69
+ [
70
+ 'class',
71
+ 'contentClassName',
72
+ 'overlayClassName',
73
+ 'container',
74
+ 'onCloseAutoFocus',
75
+ 'onOpenAutoFocus',
76
+ ],
77
+ [
78
+ 'open',
79
+ 'defaultOpen',
80
+ 'onOpenChange',
81
+ 'id',
82
+ 'modal',
83
+ 'preventScroll',
84
+ 'forceMount',
85
+ 'translations',
86
+ ]
87
+ )
88
+ const [isOpen, setIsOpen] = createSignal(dialogProps.open ?? dialogProps.defaultOpen ?? false)
89
+
90
+ createEffect(() => {
91
+ if (dialogProps.open !== undefined) setIsOpen(dialogProps.open)
92
+ })
93
+
94
+ const focus = createDialogFocusRestoration({
95
+ open: isOpen,
96
+ onCloseAutoFocus: local.onCloseAutoFocus,
97
+ onOpenAutoFocus: local.onOpenAutoFocus,
98
+ })
63
99
 
64
100
  return (
65
- <CmdkDialog
66
- contentClassName={cn(
67
- 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
68
- 'overflow-hidden rounded-xl border border-border shadow-xl',
69
- 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
70
- 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
71
- local.class
72
- )}
73
- {...rest}
74
- />
101
+ <KobalteDialog
102
+ {...dialogProps}
103
+ onOpenChange={(open) => {
104
+ setIsOpen(open)
105
+ dialogProps.onOpenChange?.(open)
106
+ }}
107
+ >
108
+ <KobalteDialog.Portal mount={local.container}>
109
+ <KobalteDialog.Overlay cmdk-overlay="" class={local.overlayClassName} />
110
+ <KobalteDialog.Content
111
+ aria-label={commandProps.label}
112
+ cmdk-dialog=""
113
+ class={cn(
114
+ 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
115
+ 'overflow-hidden rounded-xl border border-border shadow-xl',
116
+ 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
117
+ 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
118
+ local.class,
119
+ local.contentClassName
120
+ )}
121
+ onOpenAutoFocus={focus.onOpenAutoFocus}
122
+ onCloseAutoFocus={focus.onCloseAutoFocus}
123
+ >
124
+ <Command {...commandProps} />
125
+ </KobalteDialog.Content>
126
+ </KobalteDialog.Portal>
127
+ </KobalteDialog>
75
128
  )
76
129
  }
77
130
 
@@ -188,8 +241,8 @@ export function CommandItem(props: ComponentProps<typeof CmdkItem>) {
188
241
  <CmdkItem
189
242
  class={cn(
190
243
  commandItem,
191
- 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',
192
- 'text-popover-foreground data-[selected=true]:bg-surface-hover data-[selected=true]:text-popover-foreground',
244
+ 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',
245
+ 'group/command-item text-popover-foreground data-[selected=true]:bg-card data-[selected=true]:text-popover-foreground',
193
246
  local.class
194
247
  )}
195
248
  {...rest}
@@ -212,18 +265,17 @@ export function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {
212
265
  )
213
266
  }
214
267
 
215
- /**
216
- * The keyboard hint a palette item usually carries.
217
- * Muted canvas text can fail contrast on a raised or selected command row;
218
- * hierarchy comes from its size and monospace face, with the row's readable ink.
219
- */
268
+ /** The keyboard hint a palette item usually carries. */
220
269
  export function CommandShortcut(props: {
221
270
  class?: string
222
271
  children?: ComponentProps<'span'>['children']
223
272
  }) {
224
273
  return (
225
274
  <span
226
- class={cn('text-popover-foreground ms-auto font-mono text-2xs tracking-widest', props.class)}
275
+ class={cn(
276
+ 'text-muted-foreground ms-auto font-mono text-2xs tracking-widest group-data-[selected=true]/command-item:text-foreground',
277
+ props.class
278
+ )}
227
279
  >
228
280
  {props.children}
229
281
  </span>
@@ -25,13 +25,17 @@ import { cn } from '../../../lib/utils'
25
25
  * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving
26
26
  * highlight, Escape to close and return focus — which is exactly what a
27
27
  * hand-rolled `div` with click handlers gets wrong.
28
+ * Menus are nonmodal by default so their generated focus guards do not become
29
+ * invalid direct children of the ARIA menu. Set `modal` explicitly when the
30
+ * surrounding interaction needs modal containment.
28
31
  *
29
32
  * The `destructive` variant marks the row with a status-coloured edge and
30
33
  * highlighted tint while keeping its label on the body foreground. Pairing it
31
34
  * with an AlertDialog is the caller's job.
32
35
  */
33
36
  export function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {
34
- return <KobalteDropdownMenu {...props} />
37
+ const [local, rest] = splitProps(props, ['modal'])
38
+ return <KobalteDropdownMenu modal={local.modal ?? false} {...rest} />
35
39
  }
36
40
 
37
41
  export function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {
@@ -59,6 +59,8 @@ export type StatusTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info' |
59
59
  export type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {
60
60
  tone?: StatusTone
61
61
  label: string
62
+ /** Visually hide the text while preserving it for assistive technology. */
63
+ compact?: boolean
62
64
  /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */
63
65
  detail?: string
64
66
  /** A trailing slot: a timestamp, a retry affordance, a count. */
@@ -66,7 +68,14 @@ export type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {
66
68
  }
67
69
 
68
70
  export function StatusChip(props: StatusChipProps) {
69
- const [local, rest] = splitProps(props, ['tone', 'label', 'detail', 'trailing', 'class'])
71
+ const [local, rest] = splitProps(props, [
72
+ 'tone',
73
+ 'label',
74
+ 'compact',
75
+ 'detail',
76
+ 'trailing',
77
+ 'class',
78
+ ])
70
79
 
71
80
  const chip = (
72
81
  <span
@@ -78,7 +87,7 @@ export function StatusChip(props: StatusChipProps) {
78
87
  {...rest}
79
88
  >
80
89
  <span class={statusDotVariants({ tone: local.tone })} aria-hidden="true" />
81
- {local.label}
90
+ <span class={cn(local.compact && 'sr-only')}>{local.label}</span>
82
91
  {local.trailing}
83
92
  </span>
84
93
  )
@@ -54,7 +54,7 @@ export const menuItem = [
54
54
  'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none',
55
55
  'transition-colors ease-out',
56
56
  'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground',
57
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
57
+ 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground',
58
58
  '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',
59
59
  '[&_svg:not([class*=text-])]:text-muted-foreground',
60
60
  ].join(' ')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.82.1",
3
+ "version": "0.82.2",
4
4
  "description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
package/registry.json CHANGED
@@ -442,10 +442,12 @@
442
442
  "title": "Command",
443
443
  "description": "",
444
444
  "dependencies": [
445
+ "@kobalte/core@^0.13.14",
445
446
  "cmdk-solid@^1.2.0",
446
447
  "lucide-solid@^1.48.0"
447
448
  ],
448
449
  "registryDependencies": [
450
+ "@adea-ai/ui/dialog",
449
451
  "lib"
450
452
  ],
451
453
  "files": [
@@ -93,9 +93,7 @@ export function AccentChoices(props: AppearanceEditorProps) {
93
93
  disabled={props.saving}
94
94
  orientation="horizontal"
95
95
  aria-label="Accent"
96
- /* Narrow hosts wrap the swatches into a three-column grid so the row
97
- control stays beside its label; wide hosts keep one inline row. */
98
- class="grid grid-cols-3 items-center gap-2 sm:flex sm:flex-wrap sm:justify-end"
96
+ class="flex flex-wrap items-center gap-2"
99
97
  onChange={(accent) =>
100
98
  props.onChange({
101
99
  accent: accent === 'custom' ? (props.customAccentValue ?? '') : accent,
@@ -104,11 +102,11 @@ export function AccentChoices(props: AppearanceEditorProps) {
104
102
  >
105
103
  <Radio.Item value="theme">
106
104
  <Radio.ItemInput />
107
- <Radio.ItemLabel class="flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary">
105
+ <Radio.ItemLabel class="flex h-7 cursor-pointer items-center rounded-md border px-2 text-xs whitespace-nowrap data-[checked]:border-primary data-[checked]:ring-1 data-[checked]:ring-primary">
108
106
  Theme default
109
107
  </Radio.ItemLabel>
110
108
  </Radio.Item>
111
- <div class="col-span-3 grid grid-cols-3 gap-2 sm:col-span-1 sm:flex sm:gap-2">
109
+ <div class="flex max-w-full flex-wrap gap-2">
112
110
  <For each={props.accentOptions}>
113
111
  {(option) => (
114
112
  <Radio.Item
@@ -60,9 +60,15 @@ export function SettingsRow(props: {
60
60
  }) {
61
61
  return (
62
62
  <section
63
- class={cn('flex flex-col gap-3 px-4 py-4', { 'sm:flex-row sm:items-center': !props.stacked })}
63
+ class={cn('flex gap-3 px-4 py-4', {
64
+ 'flex-col': props.stacked,
65
+ 'flex-wrap items-center': !props.stacked,
66
+ })}
64
67
  >
65
- <div class="flex min-w-0 flex-1 items-center gap-3">
68
+ {/* Reserve readable copy before choosing a side-by-side control row.
69
+ Wrapping follows the actual host width and enlarged text, rather
70
+ than a viewport breakpoint that also matches a narrow popover. */}
71
+ <div class={cn('flex min-w-0 flex-1 items-center gap-3', { 'basis-48': !props.stacked })}>
66
72
  <span
67
73
  class="flex size-9 shrink-0 items-center justify-center rounded-lg border bg-foreground/5 text-muted-foreground [&_svg]:size-4"
68
74
  aria-hidden="true"
@@ -76,7 +82,7 @@ export function SettingsRow(props: {
76
82
  </Show>
77
83
  </div>
78
84
  </div>
79
- <div class="min-w-0 shrink-0">{props.children}</div>
85
+ <div class="min-w-0 max-w-full shrink-0">{props.children}</div>
80
86
  </section>
81
87
  )
82
88
  }
@@ -329,9 +329,13 @@ export function SideRailItem<T extends ValidComponent = 'a'>(props: SideRailItem
329
329
 
330
330
  /** A non-navigating rail control: a collapse toggle, a "new" action. */
331
331
  export function SideRailButton(
332
- props: Omit<ComponentProps<'button'>, 'type'> & { label: string; shortcut?: string }
332
+ props: Omit<ComponentProps<'button'>, 'type'> & {
333
+ label: string
334
+ shortcut?: string
335
+ active?: boolean
336
+ }
333
337
  ) {
334
- const [local, rest] = splitProps(props, ['class', 'label', 'shortcut', 'children'])
338
+ const [local, rest] = splitProps(props, ['class', 'label', 'shortcut', 'children', 'active'])
335
339
  const [row, setRow] = createSignal<HTMLElement>()
336
340
  const [tip, setTip] = createSignal<{ top: number; left: number; height: number } | null>(null)
337
341
 
@@ -351,13 +355,14 @@ export function SideRailButton(
351
355
  type="button"
352
356
  ref={setRow}
353
357
  aria-label={local.label}
358
+ data-active={local.active ? 'true' : undefined}
354
359
  onPointerEnter={showTip}
355
360
  onPointerLeave={() => setTip(null)}
356
361
  onFocus={showTip}
357
362
  onBlur={() => setTip(null)}
358
363
  class={cn(
359
364
  sideRailItemClass,
360
- sideRailItemStateClass.idle,
365
+ local.active ? sideRailItemStateClass.active : sideRailItemStateClass.idle,
361
366
  'disabled:pointer-events-none disabled:opacity-50',
362
367
  local.class
363
368
  )}
@@ -10,17 +10,20 @@ import {
10
10
  CommandSeparator as CmdkSeparator,
11
11
  useCommandState,
12
12
  } from 'cmdk-solid'
13
+ import { Dialog as KobalteDialog } from '@kobalte/core/dialog'
13
14
  import { Search } from 'lucide-solid'
14
15
  import type { ComponentProps } from 'solid-js'
15
16
  import { createEffect, createSignal, splitProps } from 'solid-js'
17
+ import { createDialogFocusRestoration } from '../dialog/dialog'
16
18
  import { menuItem } from '#lib/overlay'
17
19
  import { cn } from '#lib/utils'
18
20
 
19
- // cmdk emits data-disabled="false" on enabled items; Kobalte omits it.
20
- // Presence selectors would dim and disable every command in an app palette.
21
+ // cmdk emits data-disabled="false" on enabled items, unlike the presence-only
22
+ // attributes Kobalte menu rows use. Apply those shared disabled styles only when
23
+ // cmdk's value is true.
21
24
  const commandItem = menuItem
22
25
  .replace('data-[disabled]:pointer-events-none', '')
23
- .replace('data-[disabled]:opacity-50', '')
26
+ .replace('data-[disabled]:text-muted-foreground', '')
24
27
 
25
28
  /**
26
29
  * Command.
@@ -52,26 +55,76 @@ export function Command(props: ComponentProps<typeof CmdkRoot>) {
52
55
  )
53
56
  }
54
57
 
55
- export function CommandDialog(props: ComponentProps<typeof CmdkDialog>) {
56
- // cmdk's Dialog splits `contentClassName` onto the role="dialog" content
57
- // element and routes every other prop (including `class`) to the inner
58
- // Command. The surface must live on the content: a `class` here styles the
59
- // Command (fixed, so visible) while the dialog element itself renders as an
60
- // unstyled zero-height wrapper at the end of body — invisible to role
61
- // queries and axe.
62
- const [local, rest] = splitProps(props, ['class'])
58
+ type CommandDialogProps = ComponentProps<typeof CmdkDialog> &
59
+ Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>
60
+
61
+ export function CommandDialog(props: CommandDialogProps) {
62
+ // cmdk-solid's Dialog does not forward Content autofocus props: unknown
63
+ // props fall through to its Command root. Compose Kobalte's dialog surface
64
+ // here so Escape and other close paths can restore focus to the real opener.
65
+ // Preserve the shared wrapper's `class` contract on the dialog surface;
66
+ // `contentClassName` adds to it, while the nested Command keeps its own API.
67
+ const [local, dialogProps, commandProps] = splitProps(
68
+ props,
69
+ [
70
+ 'class',
71
+ 'contentClassName',
72
+ 'overlayClassName',
73
+ 'container',
74
+ 'onCloseAutoFocus',
75
+ 'onOpenAutoFocus',
76
+ ],
77
+ [
78
+ 'open',
79
+ 'defaultOpen',
80
+ 'onOpenChange',
81
+ 'id',
82
+ 'modal',
83
+ 'preventScroll',
84
+ 'forceMount',
85
+ 'translations',
86
+ ]
87
+ )
88
+ const [isOpen, setIsOpen] = createSignal(dialogProps.open ?? dialogProps.defaultOpen ?? false)
89
+
90
+ createEffect(() => {
91
+ if (dialogProps.open !== undefined) setIsOpen(dialogProps.open)
92
+ })
93
+
94
+ const focus = createDialogFocusRestoration({
95
+ open: isOpen,
96
+ onCloseAutoFocus: local.onCloseAutoFocus,
97
+ onOpenAutoFocus: local.onOpenAutoFocus,
98
+ })
63
99
 
64
100
  return (
65
- <CmdkDialog
66
- contentClassName={cn(
67
- 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
68
- 'overflow-hidden rounded-xl border border-border shadow-xl',
69
- 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
70
- 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
71
- local.class
72
- )}
73
- {...rest}
74
- />
101
+ <KobalteDialog
102
+ {...dialogProps}
103
+ onOpenChange={(open) => {
104
+ setIsOpen(open)
105
+ dialogProps.onOpenChange?.(open)
106
+ }}
107
+ >
108
+ <KobalteDialog.Portal mount={local.container}>
109
+ <KobalteDialog.Overlay cmdk-overlay="" class={local.overlayClassName} />
110
+ <KobalteDialog.Content
111
+ aria-label={commandProps.label}
112
+ cmdk-dialog=""
113
+ class={cn(
114
+ 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',
115
+ 'overflow-hidden rounded-xl border border-border shadow-xl',
116
+ 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
117
+ 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
118
+ local.class,
119
+ local.contentClassName
120
+ )}
121
+ onOpenAutoFocus={focus.onOpenAutoFocus}
122
+ onCloseAutoFocus={focus.onCloseAutoFocus}
123
+ >
124
+ <Command {...commandProps} />
125
+ </KobalteDialog.Content>
126
+ </KobalteDialog.Portal>
127
+ </KobalteDialog>
75
128
  )
76
129
  }
77
130
 
@@ -188,8 +241,8 @@ export function CommandItem(props: ComponentProps<typeof CmdkItem>) {
188
241
  <CmdkItem
189
242
  class={cn(
190
243
  commandItem,
191
- 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',
192
- 'text-popover-foreground data-[selected=true]:bg-surface-hover data-[selected=true]:text-popover-foreground',
244
+ 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',
245
+ 'group/command-item text-popover-foreground data-[selected=true]:bg-card data-[selected=true]:text-popover-foreground',
193
246
  local.class
194
247
  )}
195
248
  {...rest}
@@ -212,18 +265,17 @@ export function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {
212
265
  )
213
266
  }
214
267
 
215
- /**
216
- * The keyboard hint a palette item usually carries.
217
- * Muted canvas text can fail contrast on a raised or selected command row;
218
- * hierarchy comes from its size and monospace face, with the row's readable ink.
219
- */
268
+ /** The keyboard hint a palette item usually carries. */
220
269
  export function CommandShortcut(props: {
221
270
  class?: string
222
271
  children?: ComponentProps<'span'>['children']
223
272
  }) {
224
273
  return (
225
274
  <span
226
- class={cn('text-popover-foreground ms-auto font-mono text-2xs tracking-widest', props.class)}
275
+ class={cn(
276
+ 'text-muted-foreground ms-auto font-mono text-2xs tracking-widest group-data-[selected=true]/command-item:text-foreground',
277
+ props.class
278
+ )}
227
279
  >
228
280
  {props.children}
229
281
  </span>
@@ -25,13 +25,17 @@ import { cn } from '#lib/utils'
25
25
  * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving
26
26
  * highlight, Escape to close and return focus — which is exactly what a
27
27
  * hand-rolled `div` with click handlers gets wrong.
28
+ * Menus are nonmodal by default so their generated focus guards do not become
29
+ * invalid direct children of the ARIA menu. Set `modal` explicitly when the
30
+ * surrounding interaction needs modal containment.
28
31
  *
29
32
  * The `destructive` variant marks the row with a status-coloured edge and
30
33
  * highlighted tint while keeping its label on the body foreground. Pairing it
31
34
  * with an AlertDialog is the caller's job.
32
35
  */
33
36
  export function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {
34
- return <KobalteDropdownMenu {...props} />
37
+ const [local, rest] = splitProps(props, ['modal'])
38
+ return <KobalteDropdownMenu modal={local.modal ?? false} {...rest} />
35
39
  }
36
40
 
37
41
  export function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {
@@ -59,6 +59,8 @@ export type StatusTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info' |
59
59
  export type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {
60
60
  tone?: StatusTone
61
61
  label: string
62
+ /** Visually hide the text while preserving it for assistive technology. */
63
+ compact?: boolean
62
64
  /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */
63
65
  detail?: string
64
66
  /** A trailing slot: a timestamp, a retry affordance, a count. */
@@ -66,7 +68,14 @@ export type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {
66
68
  }
67
69
 
68
70
  export function StatusChip(props: StatusChipProps) {
69
- const [local, rest] = splitProps(props, ['tone', 'label', 'detail', 'trailing', 'class'])
71
+ const [local, rest] = splitProps(props, [
72
+ 'tone',
73
+ 'label',
74
+ 'compact',
75
+ 'detail',
76
+ 'trailing',
77
+ 'class',
78
+ ])
70
79
 
71
80
  const chip = (
72
81
  <span
@@ -78,7 +87,7 @@ export function StatusChip(props: StatusChipProps) {
78
87
  {...rest}
79
88
  >
80
89
  <span class={statusDotVariants({ tone: local.tone })} aria-hidden="true" />
81
- {local.label}
90
+ <span class={cn(local.compact && 'sr-only')}>{local.label}</span>
82
91
  {local.trailing}
83
92
  </span>
84
93
  )
@@ -54,7 +54,7 @@ export const menuItem = [
54
54
  'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none',
55
55
  'transition-colors ease-out',
56
56
  'data-[highlighted]:bg-surface-hover data-[highlighted]:text-foreground',
57
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
57
+ 'data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground',
58
58
  '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',
59
59
  '[&_svg:not([class*=text-])]:text-muted-foreground',
60
60
  ].join(' ')