@adea-ai/ui 0.162.16 → 0.162.18

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.
@@ -2,6 +2,7 @@ import {
2
2
  Brain as LucideBrain,
3
3
  Check as LucideCheck,
4
4
  ChevronsUpDown as LucideChevronsUpDown,
5
+ Sparkles as LucideSparkles,
5
6
  } from '@lucide/solid'
6
7
  import { createEffect, createMemo, createSignal, createUniqueId, For, Show } from 'solid-js'
7
8
  import { type JSX } from '@solidjs/web'
@@ -45,6 +46,7 @@ import { menuItem } from '../../../lib/overlay'
45
46
  const Brain = fastIcon(LucideBrain)
46
47
  const Check = fastIcon(LucideCheck)
47
48
  const ChevronsUpDown = fastIcon(LucideChevronsUpDown)
49
+ const Sparkles = fastIcon(LucideSparkles)
48
50
 
49
51
  /**
50
52
  * ModelSelector.
@@ -102,6 +104,20 @@ const ChevronsUpDown = fastIcon(LucideChevronsUpDown)
102
104
  * The searchable layouts trap focus while open: Tab and Shift+Tab move between
103
105
  * the tabs, the search box and the footer instead of leaving the popover, which
104
106
  * would close it.
107
+ *
108
+ * ## One scroll
109
+ *
110
+ * A searchable panel never scrolls and is never taller than the room on its
111
+ * side of the trigger: the tabs, the search box and the footer stay put, and
112
+ * the list is its only scroll, shrinking to what is left in a short window.
113
+ *
114
+ * ## Trigger
115
+ *
116
+ * With `providerIcon` (and always in the tabs layout) the trigger leads with a
117
+ * mark, as every composer pill leads with its icon: the selected model's
118
+ * provider, the footer's `icon` while the footer is chosen, else a generic
119
+ * model mark. A composer that folds its pills to their icons when narrow then
120
+ * folds this one too, whatever is selected.
105
121
  */
106
122
  export type ModelSelectorFooter = {
107
123
  label: string
@@ -289,15 +305,28 @@ function ModelTrigger(props: {
289
305
  value?: string
290
306
  footer?: ModelSelectorFooter
291
307
  empty: boolean
292
- /** The list layouts' trigger mark: the selected model's provider, when the host draws marks. */
308
+ /** Lead with a mark whatever is selected: the layouts that draw provider marks. */
309
+ marked: boolean
310
+ /** The provider's mark; without it a provider is drawn as its initial. */
293
311
  providerIcon?: (provider: string) => JSX.Element
294
312
  }) {
313
+ const footerIcon = () => (props.footer?.selected ? props.footer.icon : undefined)
314
+ const provider = () => (props.footer?.selected ? undefined : props.selected?.provider)
295
315
  return (
296
316
  <>
297
- <Show when={props.providerIcon && !props.footer?.selected && props.selected?.provider}>
298
- {(provider) => <ProviderGlyph provider={provider()} icon={props.providerIcon} />}
299
- </Show>
300
- <Show when={props.footer?.selected && props.footer.icon}>
317
+ <Show
318
+ when={footerIcon()}
319
+ fallback={
320
+ <Show when={props.marked}>
321
+ <Show
322
+ when={provider()}
323
+ fallback={<Sparkles aria-hidden="true" data-slot="model-selector-mark" />}
324
+ >
325
+ {(name) => <ProviderGlyph provider={name()} icon={props.providerIcon} />}
326
+ </Show>
327
+ </Show>
328
+ }
329
+ >
301
330
  {(icon) => (
302
331
  <span aria-hidden="true" class="inline-flex size-4 shrink-0 items-center justify-center">
303
332
  {icon()}
@@ -342,6 +371,7 @@ function ModelMenu(props: PickerProps) {
342
371
  value={props.value}
343
372
  footer={props.footer}
344
373
  empty={props.models.length === 0}
374
+ marked={props.providerIcon !== undefined}
345
375
  providerIcon={props.providerIcon}
346
376
  />
347
377
  </DropdownMenuTrigger>
@@ -425,7 +455,7 @@ function PaletteFooter(props: {
425
455
  onDone: () => void
426
456
  }) {
427
457
  return (
428
- <div data-slot="model-selector-footer" class="border-t border-border p-1">
458
+ <div data-slot="model-selector-footer" class="shrink-0 border-t border-border p-1">
429
459
  <button
430
460
  type="button"
431
461
  aria-pressed={props.footer.selected ? 'true' : 'false'}
@@ -447,6 +477,12 @@ function PaletteFooter(props: {
447
477
  )
448
478
  }
449
479
 
480
+ /**
481
+ * A searchable picker's panel: a column that clips, no taller than the room on its side of the
482
+ * trigger (`--available-height`, which the positioning writes), so its list is the one scroll.
483
+ */
484
+ const palettePanel = 'flex max-h-(--available-height) w-80 max-w-full flex-col overflow-hidden'
485
+
450
486
  function ModelSearch(props: PickerProps) {
451
487
  const [open, setOpen] = createSignal(false)
452
488
  const groups = createMemo(() => groupModels(props.models))
@@ -481,19 +517,22 @@ function ModelSearch(props: PickerProps) {
481
517
  value={props.value}
482
518
  footer={props.footer}
483
519
  empty={false}
520
+ marked={props.providerIcon !== undefined}
484
521
  providerIcon={props.providerIcon}
485
522
  />
486
523
  </PopoverTrigger>
487
524
  {/* One scroll, the list's: the panel is a column that clips instead of scrolling (its arrow
488
- hung below it and gave it a second scrollbar), and the list shrinks to the room left. */}
489
- <PopoverContent hideArrow class="flex w-80 max-w-full flex-col overflow-hidden">
525
+ hung below it and gave it a second scrollbar). It is no taller than the room on its side
526
+ of the trigger, and the list shrinks to what is left, so the search box stays in view. */}
527
+ <PopoverContent hideArrow class={palettePanel}>
490
528
  <Command
529
+ class="min-h-0"
491
530
  label="Choose a model"
492
531
  defaultValue={props.selected ? modelSearchValue(props.selected).trim() : undefined}
493
532
  >
494
533
  <CommandInput placeholder="Search models" />
495
534
  <CommandEmpty>No model matches.</CommandEmpty>
496
- <CommandList>
535
+ <CommandList class="min-h-0">
497
536
  <For each={groups()}>
498
537
  {(group) => (
499
538
  <CommandGroup heading={group.provider}>
@@ -604,20 +643,19 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
604
643
  aria-disabled={inert() ? 'true' : undefined}
605
644
  aria-describedby={props.describedBy}
606
645
  >
607
- <Show when={!props.footer?.selected && groupOf(props.selected)}>
608
- {(provider) => <ProviderGlyph provider={provider()} icon={props.providerIcon} />}
609
- </Show>
610
646
  <ModelTrigger
611
647
  selected={props.selected}
612
648
  value={props.value}
613
649
  footer={props.footer}
614
650
  empty={props.models.length === 0}
651
+ marked
652
+ providerIcon={props.providerIcon}
615
653
  />
616
654
  </PopoverTrigger>
617
655
  <PopoverContent
618
656
  ref={(element: HTMLDivElement) => (content = element)}
619
657
  hideArrow
620
- class="flex w-80 max-w-full flex-col overflow-hidden p-0"
658
+ class={cn(palettePanel, 'p-0')}
621
659
  onOpenAutoFocus={(event: Event) => {
622
660
  event.preventDefault()
623
661
  focusSearch()
@@ -629,7 +667,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
629
667
  setTab(next)
630
668
  focusSearch()
631
669
  }}
632
- class="gap-0"
670
+ class="min-h-0 gap-0"
633
671
  >
634
672
  <TabsList fill scrollable aria-label="Providers" class="px-1.5 pt-1">
635
673
  <For each={groups()}>
@@ -649,6 +687,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
649
687
  {(group) => (
650
688
  <TabsContent value={group.provider} class="flex flex-col">
651
689
  <Command
690
+ class="min-h-0"
652
691
  label={`${group.provider} models`}
653
692
  defaultValue={
654
693
  props.selected && group.models.includes(props.selected)
@@ -658,7 +697,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
658
697
  >
659
698
  <CommandInput placeholder="Search models" />
660
699
  <CommandEmpty>No model matches.</CommandEmpty>
661
- <CommandList>
700
+ <CommandList class="min-h-0">
662
701
  <For each={group.models}>
663
702
  {(model) => (
664
703
  <CommandItem
@@ -259,7 +259,9 @@ export function MessageComposer(props: MessageComposerProps) {
259
259
  <PromptInputTools>
260
260
  <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>
261
261
  </PromptInputTools>
262
- <PromptInputTools>
262
+ {/* The send control never gives way: when the row runs out of room the leading tools (a
263
+ host's pills) truncate, while the trailing ones keep their size. */}
264
+ <PromptInputTools class="shrink-0">
263
265
  <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>
264
266
  <PromptInputSubmit
265
267
  status={sending() ? 'submitted' : 'ready'}
@@ -334,7 +334,7 @@ export function CommandInput(props: CommandInputProps) {
334
334
  return (
335
335
  <div
336
336
  data-slot="command-input-wrapper"
337
- class="flex h-11 items-center gap-2 border-b border-border px-3"
337
+ class="flex h-11 shrink-0 items-center gap-2 border-b border-border px-3"
338
338
  >
339
339
  <Search class="size-4 shrink-0 text-muted-foreground" aria-hidden="true" />
340
340
  <CommandInputPrimitive
@@ -107,10 +107,12 @@ export const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-clo
107
107
  export const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`
108
108
 
109
109
  /** Popover-style motion: no zoom, so a panel anchored to a control does not
110
- * appear to breathe away from it. */
110
+ * appear to breathe away from it. The duration is animation-only: `duration-*`
111
+ * also transitions every property, so a panel that settles after its first
112
+ * position would slide from the stale one instead of appearing at the anchor. */
111
113
  export const popoverMotion =
112
114
  'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +
113
- 'data-expanded:duration-150 data-closed:duration-100'
115
+ 'data-expanded:animation-duration-150 data-closed:animation-duration-100'
114
116
 
115
117
  /** The popper arrow. Sized in the component; coloured here. */
116
118
  export const popoverArrow = 'fill-popover stroke-border'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.162.16",
3
+ "version": "0.162.18",
4
4
  "description": "The Adea design system: ui-sdk-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
@@ -2,6 +2,7 @@ import {
2
2
  Brain as LucideBrain,
3
3
  Check as LucideCheck,
4
4
  ChevronsUpDown as LucideChevronsUpDown,
5
+ Sparkles as LucideSparkles,
5
6
  } from '@lucide/solid'
6
7
  import { createEffect, createMemo, createSignal, createUniqueId, For, Show } from 'solid-js'
7
8
  import { type JSX } from '@solidjs/web'
@@ -45,6 +46,7 @@ import { menuItem } from '#lib/overlay'
45
46
  const Brain = fastIcon(LucideBrain)
46
47
  const Check = fastIcon(LucideCheck)
47
48
  const ChevronsUpDown = fastIcon(LucideChevronsUpDown)
49
+ const Sparkles = fastIcon(LucideSparkles)
48
50
 
49
51
  /**
50
52
  * ModelSelector.
@@ -102,6 +104,20 @@ const ChevronsUpDown = fastIcon(LucideChevronsUpDown)
102
104
  * The searchable layouts trap focus while open: Tab and Shift+Tab move between
103
105
  * the tabs, the search box and the footer instead of leaving the popover, which
104
106
  * would close it.
107
+ *
108
+ * ## One scroll
109
+ *
110
+ * A searchable panel never scrolls and is never taller than the room on its
111
+ * side of the trigger: the tabs, the search box and the footer stay put, and
112
+ * the list is its only scroll, shrinking to what is left in a short window.
113
+ *
114
+ * ## Trigger
115
+ *
116
+ * With `providerIcon` (and always in the tabs layout) the trigger leads with a
117
+ * mark, as every composer pill leads with its icon: the selected model's
118
+ * provider, the footer's `icon` while the footer is chosen, else a generic
119
+ * model mark. A composer that folds its pills to their icons when narrow then
120
+ * folds this one too, whatever is selected.
105
121
  */
106
122
  export type ModelSelectorFooter = {
107
123
  label: string
@@ -289,15 +305,28 @@ function ModelTrigger(props: {
289
305
  value?: string
290
306
  footer?: ModelSelectorFooter
291
307
  empty: boolean
292
- /** The list layouts' trigger mark: the selected model's provider, when the host draws marks. */
308
+ /** Lead with a mark whatever is selected: the layouts that draw provider marks. */
309
+ marked: boolean
310
+ /** The provider's mark; without it a provider is drawn as its initial. */
293
311
  providerIcon?: (provider: string) => JSX.Element
294
312
  }) {
313
+ const footerIcon = () => (props.footer?.selected ? props.footer.icon : undefined)
314
+ const provider = () => (props.footer?.selected ? undefined : props.selected?.provider)
295
315
  return (
296
316
  <>
297
- <Show when={props.providerIcon && !props.footer?.selected && props.selected?.provider}>
298
- {(provider) => <ProviderGlyph provider={provider()} icon={props.providerIcon} />}
299
- </Show>
300
- <Show when={props.footer?.selected && props.footer.icon}>
317
+ <Show
318
+ when={footerIcon()}
319
+ fallback={
320
+ <Show when={props.marked}>
321
+ <Show
322
+ when={provider()}
323
+ fallback={<Sparkles aria-hidden="true" data-slot="model-selector-mark" />}
324
+ >
325
+ {(name) => <ProviderGlyph provider={name()} icon={props.providerIcon} />}
326
+ </Show>
327
+ </Show>
328
+ }
329
+ >
301
330
  {(icon) => (
302
331
  <span aria-hidden="true" class="inline-flex size-4 shrink-0 items-center justify-center">
303
332
  {icon()}
@@ -342,6 +371,7 @@ function ModelMenu(props: PickerProps) {
342
371
  value={props.value}
343
372
  footer={props.footer}
344
373
  empty={props.models.length === 0}
374
+ marked={props.providerIcon !== undefined}
345
375
  providerIcon={props.providerIcon}
346
376
  />
347
377
  </DropdownMenuTrigger>
@@ -425,7 +455,7 @@ function PaletteFooter(props: {
425
455
  onDone: () => void
426
456
  }) {
427
457
  return (
428
- <div data-slot="model-selector-footer" class="border-t border-border p-1">
458
+ <div data-slot="model-selector-footer" class="shrink-0 border-t border-border p-1">
429
459
  <button
430
460
  type="button"
431
461
  aria-pressed={props.footer.selected ? 'true' : 'false'}
@@ -447,6 +477,12 @@ function PaletteFooter(props: {
447
477
  )
448
478
  }
449
479
 
480
+ /**
481
+ * A searchable picker's panel: a column that clips, no taller than the room on its side of the
482
+ * trigger (`--available-height`, which the positioning writes), so its list is the one scroll.
483
+ */
484
+ const palettePanel = 'flex max-h-(--available-height) w-80 max-w-full flex-col overflow-hidden'
485
+
450
486
  function ModelSearch(props: PickerProps) {
451
487
  const [open, setOpen] = createSignal(false)
452
488
  const groups = createMemo(() => groupModels(props.models))
@@ -481,19 +517,22 @@ function ModelSearch(props: PickerProps) {
481
517
  value={props.value}
482
518
  footer={props.footer}
483
519
  empty={false}
520
+ marked={props.providerIcon !== undefined}
484
521
  providerIcon={props.providerIcon}
485
522
  />
486
523
  </PopoverTrigger>
487
524
  {/* One scroll, the list's: the panel is a column that clips instead of scrolling (its arrow
488
- hung below it and gave it a second scrollbar), and the list shrinks to the room left. */}
489
- <PopoverContent hideArrow class="flex w-80 max-w-full flex-col overflow-hidden">
525
+ hung below it and gave it a second scrollbar). It is no taller than the room on its side
526
+ of the trigger, and the list shrinks to what is left, so the search box stays in view. */}
527
+ <PopoverContent hideArrow class={palettePanel}>
490
528
  <Command
529
+ class="min-h-0"
491
530
  label="Choose a model"
492
531
  defaultValue={props.selected ? modelSearchValue(props.selected).trim() : undefined}
493
532
  >
494
533
  <CommandInput placeholder="Search models" />
495
534
  <CommandEmpty>No model matches.</CommandEmpty>
496
- <CommandList>
535
+ <CommandList class="min-h-0">
497
536
  <For each={groups()}>
498
537
  {(group) => (
499
538
  <CommandGroup heading={group.provider}>
@@ -604,20 +643,19 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
604
643
  aria-disabled={inert() ? 'true' : undefined}
605
644
  aria-describedby={props.describedBy}
606
645
  >
607
- <Show when={!props.footer?.selected && groupOf(props.selected)}>
608
- {(provider) => <ProviderGlyph provider={provider()} icon={props.providerIcon} />}
609
- </Show>
610
646
  <ModelTrigger
611
647
  selected={props.selected}
612
648
  value={props.value}
613
649
  footer={props.footer}
614
650
  empty={props.models.length === 0}
651
+ marked
652
+ providerIcon={props.providerIcon}
615
653
  />
616
654
  </PopoverTrigger>
617
655
  <PopoverContent
618
656
  ref={(element: HTMLDivElement) => (content = element)}
619
657
  hideArrow
620
- class="flex w-80 max-w-full flex-col overflow-hidden p-0"
658
+ class={cn(palettePanel, 'p-0')}
621
659
  onOpenAutoFocus={(event: Event) => {
622
660
  event.preventDefault()
623
661
  focusSearch()
@@ -629,7 +667,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
629
667
  setTab(next)
630
668
  focusSearch()
631
669
  }}
632
- class="gap-0"
670
+ class="min-h-0 gap-0"
633
671
  >
634
672
  <TabsList fill scrollable aria-label="Providers" class="px-1.5 pt-1">
635
673
  <For each={groups()}>
@@ -649,6 +687,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
649
687
  {(group) => (
650
688
  <TabsContent value={group.provider} class="flex flex-col">
651
689
  <Command
690
+ class="min-h-0"
652
691
  label={`${group.provider} models`}
653
692
  defaultValue={
654
693
  props.selected && group.models.includes(props.selected)
@@ -658,7 +697,7 @@ function ModelTabs(props: PickerProps & { providerIcon?: (provider: string) => J
658
697
  >
659
698
  <CommandInput placeholder="Search models" />
660
699
  <CommandEmpty>No model matches.</CommandEmpty>
661
- <CommandList>
700
+ <CommandList class="min-h-0">
662
701
  <For each={group.models}>
663
702
  {(model) => (
664
703
  <CommandItem
@@ -259,7 +259,9 @@ export function MessageComposer(props: MessageComposerProps) {
259
259
  <PromptInputTools>
260
260
  <Show when={local.leading}>{(leadingSlot) => <>{leadingSlot()}</>}</Show>
261
261
  </PromptInputTools>
262
- <PromptInputTools>
262
+ {/* The send control never gives way: when the row runs out of room the leading tools (a
263
+ host's pills) truncate, while the trailing ones keep their size. */}
264
+ <PromptInputTools class="shrink-0">
263
265
  <Show when={local.trailing}>{(trailingSlot) => <>{trailingSlot()}</>}</Show>
264
266
  <PromptInputSubmit
265
267
  status={sending() ? 'submitted' : 'ready'}
@@ -334,7 +334,7 @@ export function CommandInput(props: CommandInputProps) {
334
334
  return (
335
335
  <div
336
336
  data-slot="command-input-wrapper"
337
- class="flex h-11 items-center gap-2 border-b border-border px-3"
337
+ class="flex h-11 shrink-0 items-center gap-2 border-b border-border px-3"
338
338
  >
339
339
  <Search class="size-4 shrink-0 text-muted-foreground" aria-hidden="true" />
340
340
  <CommandInputPrimitive
@@ -107,10 +107,12 @@ export const overlayMotion = `${overlayZoom} data-expanded:duration-200 data-clo
107
107
  export const tooltipMotion = `${overlayZoom} data-expanded:duration-150 data-closed:duration-100`
108
108
 
109
109
  /** Popover-style motion: no zoom, so a panel anchored to a control does not
110
- * appear to breathe away from it. */
110
+ * appear to breathe away from it. The duration is animation-only: `duration-*`
111
+ * also transitions every property, so a panel that settles after its first
112
+ * position would slide from the stale one instead of appearing at the anchor. */
111
113
  export const popoverMotion =
112
114
  'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0 ' +
113
- 'data-expanded:duration-150 data-closed:duration-100'
115
+ 'data-expanded:animation-duration-150 data-closed:animation-duration-100'
114
116
 
115
117
  /** The popper arrow. Sized in the component; coloured here. */
116
118
  export const popoverArrow = 'fill-popover stroke-border'