@adea-ai/ui 0.110.1 → 0.111.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 (88) hide show
  1. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +17 -2
  2. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
  3. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +47 -122
  4. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  6. package/dist/components/composites/appearance-editor/appearance-choices.js +0 -4
  7. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-editor.js +1 -1
  9. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  10. package/dist/components/composites/appearance-editor/font-settings-group.js +60 -68
  11. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/index.js +1 -1
  13. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  14. package/dist/components/theme/appearance-panel.js +0 -3
  15. package/dist/components/theme/appearance-panel.js.map +1 -1
  16. package/dist/components/ui/alert-dialog/alert-dialog.js +2 -2
  17. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  18. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  19. package/dist/components/ui/combobox/combobox.js +1 -1
  20. package/dist/components/ui/combobox/combobox.js.map +1 -1
  21. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
  22. package/dist/components/ui/context-menu/context-menu.js +2 -2
  23. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  24. package/dist/components/ui/dialog/dialog.js +2 -2
  25. package/dist/components/ui/dialog/dialog.js.map +1 -1
  26. package/dist/components/ui/drawer/drawer.js +1 -1
  27. package/dist/components/ui/drawer/drawer.js.map +1 -1
  28. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +22 -2
  29. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  30. package/dist/components/ui/dropdown-menu/dropdown-menu.js +79 -30
  31. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  32. package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
  33. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  34. package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
  35. package/dist/components/ui/menubar/menubar.js +2 -2
  36. package/dist/components/ui/menubar/menubar.js.map +1 -1
  37. package/dist/components/ui/select/index.d.ts +1 -0
  38. package/dist/components/ui/select/index.d.ts.map +1 -1
  39. package/dist/components/ui/select/select.d.ts +7 -1
  40. package/dist/components/ui/select/select.d.ts.map +1 -1
  41. package/dist/components/ui/select/select.js +34 -20
  42. package/dist/components/ui/select/select.js.map +1 -1
  43. package/dist/components/ui/sheet/sheet.js +1 -1
  44. package/dist/components/ui/sheet/sheet.js.map +1 -1
  45. package/dist/components/ui/tooltip/tooltip.d.ts +16 -6
  46. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  47. package/dist/components/ui/tooltip/tooltip.js +15 -4
  48. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/lib/overlay.d.ts +30 -1
  51. package/dist/lib/overlay.d.ts.map +1 -1
  52. package/dist/lib/overlay.js +37 -2
  53. package/dist/lib/overlay.js.map +1 -1
  54. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  55. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  56. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  57. package/dist/r/src/components/theme/appearance-panel.tsx +0 -1
  58. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  59. package/dist/r/src/components/ui/combobox/combobox.tsx +3 -1
  60. package/dist/r/src/components/ui/context-menu/context-menu.tsx +6 -2
  61. package/dist/r/src/components/ui/dialog/dialog.tsx +2 -2
  62. package/dist/r/src/components/ui/drawer/drawer.tsx +1 -1
  63. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  64. package/dist/r/src/components/ui/dropdown-menu/index.ts +1 -0
  65. package/dist/r/src/components/ui/menubar/menubar.tsx +6 -2
  66. package/dist/r/src/components/ui/select/index.ts +1 -0
  67. package/dist/r/src/components/ui/select/select.tsx +31 -6
  68. package/dist/r/src/components/ui/sheet/sheet.tsx +1 -1
  69. package/dist/r/src/components/ui/tooltip/tooltip.tsx +28 -2
  70. package/dist/r/src/lib/overlay.ts +45 -1
  71. package/package.json +1 -1
  72. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +33 -86
  73. package/src/components/composites/appearance-editor/appearance-choices.tsx +0 -3
  74. package/src/components/composites/appearance-editor/font-settings-group.tsx +20 -7
  75. package/src/components/theme/appearance-panel.tsx +0 -1
  76. package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -2
  77. package/src/components/ui/combobox/combobox.tsx +3 -1
  78. package/src/components/ui/context-menu/context-menu.tsx +6 -2
  79. package/src/components/ui/dialog/dialog.tsx +2 -2
  80. package/src/components/ui/drawer/drawer.tsx +1 -1
  81. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +44 -6
  82. package/src/components/ui/dropdown-menu/index.ts +1 -0
  83. package/src/components/ui/menubar/menubar.tsx +6 -2
  84. package/src/components/ui/select/index.ts +1 -0
  85. package/src/components/ui/select/select.tsx +31 -6
  86. package/src/components/ui/sheet/sheet.tsx +1 -1
  87. package/src/components/ui/tooltip/tooltip.tsx +28 -2
  88. package/src/lib/overlay.ts +45 -1
@@ -2,7 +2,13 @@ import { Select as KobalteSelect } from '@kobalte/core/select'
2
2
  import { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'
3
3
  import type { ComponentProps } from 'solid-js'
4
4
  import { Show, splitProps } from 'solid-js'
5
- import { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'
5
+ import {
6
+ menuContentPadding,
7
+ menuItem,
8
+ menuSwatchTone,
9
+ type MenuSwatchTone,
10
+ topLayerProps,
11
+ } from '#lib/overlay'
6
12
  import { cn } from '#lib/utils'
7
13
 
8
14
  /**
@@ -21,7 +27,12 @@ import { cn } from '#lib/utils'
21
27
  export function Select<Option, OptGroup = never>(
22
28
  props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>
23
29
  ) {
24
- return <KobalteSelect {...props} />
30
+ // Kobalte's own default gutter is 8px; without the arrow (removed below) the
31
+ // popper no longer folds half an arrow box into that offset, and 8px read as
32
+ // a detached list. Four pixels is shadcn's `sideOffset` — attached, with
33
+ // room for the trigger's own border.
34
+ const [local, rest] = splitProps(props, ['gutter'])
35
+ return <KobalteSelect gutter={local.gutter ?? 4} {...rest} />
25
36
  }
26
37
 
27
38
  export type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {
@@ -153,20 +164,34 @@ export function SelectContent(props: SelectContentProps) {
153
164
  {...rest}
154
165
  >
155
166
  {local.children}
167
+ {/* No arrow: the list is the trigger's own value opened up, and Kobalte
168
+ reserves half the arrow's 30px box as popper gutter, which is where
169
+ the reported gap between a form trigger and its options came from. */}
156
170
  <KobalteSelect.Listbox class="flex flex-col" />
157
- <KobalteSelect.Arrow aria-hidden="true" class={popoverArrow} />
158
171
  </KobalteSelect.Content>
159
172
  </KobalteSelect.Portal>
160
173
  )
161
174
  }
162
175
 
163
- export function SelectItem(props: ComponentProps<typeof KobalteSelect.Item>) {
164
- const [local, rest] = splitProps(props, ['class', 'children'])
176
+ export function SelectItem(
177
+ props: ComponentProps<typeof KobalteSelect.Item> & {
178
+ /** Draw a leading colour dot from the shared tone ladder — the accent or
179
+ * status role the option's card badge carries. `aria-hidden`; the label
180
+ * carries the meaning. */
181
+ swatch?: MenuSwatchTone
182
+ }
183
+ ) {
184
+ const [local, rest] = splitProps(props, ['class', 'children', 'swatch'])
165
185
 
166
186
  return (
167
187
  <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>
188
+ <Show when={local.swatch}>
189
+ <span aria-hidden="true" class={menuSwatchTone({ tone: local.swatch })} />
190
+ </Show>
168
191
  <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>
169
- <KobalteSelect.ItemIndicator class="absolute end-2 flex size-4 items-center justify-center">
192
+ {/* The indicator reads in the accent, like every other selected state in
193
+ the system — the row's own foreground reads as decoration. */}
194
+ <KobalteSelect.ItemIndicator class="absolute end-2 flex size-4 items-center justify-center text-primary">
170
195
  <Check class="size-4" />
171
196
  </KobalteSelect.ItemIndicator>
172
197
  </KobalteSelect.Item>
@@ -46,7 +46,7 @@ import { createDialogFocusRestoration, DialogOverlay } from '../dialog/dialog'
46
46
  // scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the
47
47
  // pinned footer out of view. Only SheetBody scrolls.
48
48
  const sheetVariants = cva(
49
- 'bg-popover text-popover-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',
49
+ 'bg-background text-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',
50
50
  {
51
51
  variants: {
52
52
  side: {
@@ -1,11 +1,12 @@
1
1
  import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'
2
- import type { ComponentProps } from 'solid-js'
2
+ import type { ComponentProps, JSX } from 'solid-js'
3
3
  import {
4
4
  createContext,
5
5
  createEffect,
6
6
  createSignal,
7
7
  createUniqueId,
8
8
  onCleanup,
9
+ Show,
9
10
  splitProps,
10
11
  useContext,
11
12
  } from 'solid-js'
@@ -349,13 +350,24 @@ export function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigg
349
350
  )
350
351
  }
351
352
 
352
- export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content>
353
+ export type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {
354
+ /**
355
+ * A leading icon, repeating the trigger's glyph inside the tip — the side
356
+ * rail's icon+label treatment, offered so a toolbar or rail tooltip does not
357
+ * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`
358
+ * while closed and never the accessible name, so the icon must not be the
359
+ * only carrier of meaning. Size it by leaving the svg bare; the slot fixes
360
+ * it to the system's control size.
361
+ */
362
+ icon?: JSX.Element
363
+ }
353
364
 
354
365
  export function TooltipContent(props: TooltipContentProps) {
355
366
  const interaction = useContext(TooltipInteractionContext)
356
367
  const [local, rest] = splitProps(props, [
357
368
  'class',
358
369
  'children',
370
+ 'icon',
359
371
  'aria-hidden',
360
372
  'onEscapeKeyDown',
361
373
  'onPointerDownOutside',
@@ -380,6 +392,9 @@ export function TooltipContent(props: TooltipContentProps) {
380
392
  'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',
381
393
  'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
382
394
  'data-expanded:duration-150 data-closed:duration-100',
395
+ // An icon+label tip is one row that reads as a unit, so the label
396
+ // never wraps under the glyph.
397
+ { 'flex items-center gap-2 whitespace-nowrap': !!local.icon },
383
398
  local.class
384
399
  )}
385
400
  // A tooltip is never interactive: the content is plain text, and the
@@ -404,6 +419,17 @@ export function TooltipContent(props: TooltipContentProps) {
404
419
  {...topLayerProps}
405
420
  {...rest}
406
421
  >
422
+ <Show when={local.icon}>
423
+ {(icon) => (
424
+ <span
425
+ data-slot="tooltip-icon"
426
+ aria-hidden="true"
427
+ class="flex size-4 shrink-0 items-center justify-center [&_svg]:size-4"
428
+ >
429
+ {icon()}
430
+ </span>
431
+ )}
432
+ </Show>
407
433
  {local.children}
408
434
  </KobalteTooltip.Content>
409
435
  </KobalteTooltip.Portal>
@@ -10,10 +10,29 @@
10
10
  * "an overlay looks like this" a fact rather than a convention.
11
11
  */
12
12
 
13
- /** The panel itself: fill, hairline edge, radius, elevation. */
13
+ import { cva, type VariantProps } from '#lib/variants'
14
+
15
+ /** The panel itself: fill, hairline edge, radius, elevation. Menus, popovers
16
+ * and the command palette float on the elevated overlay rung (`--popover`). */
14
17
  export const overlaySurface =
15
18
  'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg'
16
19
 
20
+ /**
21
+ * The modal panel: the same hairline edge, radius and elevation, painted on the
22
+ * *neutral* theme surface instead of the elevated overlay rung.
23
+ *
24
+ * `--popover` is the catalogue's `surfaceElevated`, whose derivation amplifies
25
+ * the canvas hue's chroma on the elevated step. On the dark default's violet
26
+ * canvas that makes the dialog the most chromatic surface in the ladder —
27
+ * `oklch(0.2406 0.0088 300.91)`, red above green in sRGB — and on a full dialog
28
+ * panel that cast reads as a warm tint the canvas never has. shadcn's own
29
+ * convention already splits the two: a Dialog paints `bg-background`, menus and
30
+ * popovers paint `bg-popover`. The veil, the hairline and the elevation shadow
31
+ * carry the separation the lighter fill no longer provides.
32
+ */
33
+ export const dialogSurface =
34
+ 'bg-background text-foreground rounded-xl border border-border shadow-lg'
35
+
17
36
  /**
18
37
  * Overlay titles have one fixed typography role. Keep this small recipe shared
19
38
  * without loading the configurable Heading component into every dialog.
@@ -85,6 +104,31 @@ export const menuLabel =
85
104
  /** The rule between menu groups. */
86
105
  export const menuSeparator = 'bg-border -mx-1 my-1 h-px'
87
106
 
107
+ /**
108
+ * A leading colour swatch on a menu or select row: the sanctioned way to carry
109
+ * a card-tone colour into a list of options. The tones are the system's accent
110
+ * and status roles — the vocabulary a Badge already speaks — so the colour an
111
+ * option shows in a menu is the colour its badge carries on a card, and a
112
+ * caller never passes a raw colour into a list. The dot is `aria-hidden`; the
113
+ * label carries the meaning, so a tone is never the only signal.
114
+ */
115
+ export const menuSwatchTone = cva('size-2 shrink-0 rounded-full', {
116
+ variants: {
117
+ tone: {
118
+ neutral: 'bg-muted-foreground',
119
+ primary: 'bg-primary',
120
+ success: 'bg-success',
121
+ warning: 'bg-warning',
122
+ destructive: 'bg-destructive',
123
+ info: 'bg-info',
124
+ },
125
+ },
126
+ defaultVariants: { tone: 'neutral' },
127
+ })
128
+
129
+ /** The tones a menu row's swatch can take. */
130
+ export type MenuSwatchTone = NonNullable<VariantProps<typeof menuSwatchTone>['tone']>
131
+
88
132
  /** Padding shared by every menu-list surface. */
89
133
  export const menuContentPadding = 'p-1'
90
134