@adea-ai/ui 0.72.1 → 0.72.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.
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,EAC/C,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,kCAGhE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAgBpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAahF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAoBpF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAqBpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,kCAW9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAGpF;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,kCAkB3E"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,EAC/C,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,kCAGhE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAgBpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAahF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAoBpF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAsBpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,kCAW9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAGpF;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,kCAkB3E"}
@@ -50,12 +50,16 @@ function ComboboxContent(props) {
50
50
  return createComponent(Combobox.Content, mergeProps({ get ["class"]() {
51
51
  return cn("bg-popover text-popover-foreground rounded-xl border border-border shadow-lg", "z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", local.class);
52
52
  } }, rest, { get children() {
53
- return [createComponent(Combobox.Listbox, { get ["class"]() {
54
- return cn("max-h-72 overflow-y-auto", "p-1");
55
- } }), createComponent(Combobox.Arrow, {
56
- "aria-hidden": "true",
57
- "class": popoverArrow
58
- })];
53
+ return [
54
+ createComponent(Combobox.Listbox, { get ["class"]() {
55
+ return cn("max-h-72 overflow-y-auto", "p-1");
56
+ } }),
57
+ memo(() => local.children),
58
+ createComponent(Combobox.Arrow, {
59
+ "aria-hidden": "true",
60
+ "class": popoverArrow
61
+ })
62
+ ];
59
63
  } }));
60
64
  } });
61
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Input\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button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,MAAI;EAAA,IAACoC,OAAI;GAAA,OAAE9B,MAAM6B;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINjC,MAAM6B,QAAQ;GAACK,OAAAH,MAAA5B,gBAQ7BX,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAA2C,aAAAC,UAAAL,MAPKhC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAAsB;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Input\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBA,WACdY,OACA;CACA,OAAAG,gB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AAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINjC,MAAM6B,QAAQ;GAACK,OAAAH,MAAA5B,gBAQ7BX,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAA2C,aAAAC,UAAAL,MAPKhC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAAsB;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
@@ -9,9 +9,13 @@ import type { ComponentProps } from 'solid-js';
9
9
  * nobody can set exactly.
10
10
  *
11
11
  * Kobalte handles pointer capture, keyboard stepping and the ARIA value
12
- * wiring; this paints the track, fill and thumb.
12
+ * wiring; this paints the track, fill and one thumb per value. Each thumb
13
+ * contains a form-native input, hidden from accessibility because the visible
14
+ * thumb already exposes the slider role.
13
15
  */
14
16
  export type SliderProps = ComponentProps<typeof KobalteSlider> & {
17
+ /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */
18
+ thumbLabels?: readonly string[];
15
19
  trackClass?: string;
16
20
  rangeClass?: string;
17
21
  thumbClass?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/slider/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,GAAG;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,kCAwDxC"}
1
+ {"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/slider/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,GAAG;IAC/D,gGAAgG;IAChG,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,kCAgFxC"}
@@ -1,14 +1,16 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { createComponent, memo, mergeProps } from "solid-js/web";
3
- import { Show, splitProps } from "solid-js";
3
+ import { For, Show, createRenderEffect, createUniqueId, splitProps } from "solid-js";
4
4
  import { Slider } from "@kobalte/core/slider";
5
5
  //#region src/components/ui/slider/slider.tsx
6
6
  function Slider$1(props) {
7
+ const inputId = createUniqueId();
7
8
  const [local, rest] = splitProps(props, [
8
9
  "class",
9
10
  "trackClass",
10
11
  "rangeClass",
11
12
  "thumbClass",
13
+ "thumbLabels",
12
14
  "valueLabel",
13
15
  "children",
14
16
  "aria-label",
@@ -29,26 +31,40 @@ function Slider$1(props) {
29
31
  }
30
32
  }),
31
33
  memo(() => local.children),
32
- createComponent(Slider.Thumb, {
33
- get ["aria-label"]() {
34
- return local["aria-label"];
34
+ createComponent(For, {
35
+ get each() {
36
+ return Array.from({ length: (props.value ?? props.defaultValue ?? [0]).length }, (_, index) => index);
35
37
  },
36
- get ["aria-labelledby"]() {
37
- return local["aria-labelledby"];
38
- },
39
- get ["class"]() {
40
- return cn("border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs", "transition-[color,box-shadow] ease-out outline-none", "hover:ring-4 hover:ring-primary-subtle", "focus-visible:ring-4 focus-visible:ring-primary-subtle", local.thumbClass);
41
- },
42
- get children() {
43
- return createComponent(Show, {
44
- get when() {
45
- return local.valueLabel;
46
- },
47
- get children() {
48
- return createComponent(Slider.ValueLabel, { "class": "bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" });
49
- }
50
- });
51
- }
38
+ children: (index) => createComponent(Slider.Thumb, {
39
+ get ["aria-label"]() {
40
+ return local.thumbLabels?.[index] ?? local["aria-label"];
41
+ },
42
+ get ["aria-labelledby"]() {
43
+ return memo(() => !!local.thumbLabels?.[index])() ? void 0 : local["aria-labelledby"];
44
+ },
45
+ get ["class"]() {
46
+ return cn("border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs", "transition-[color,box-shadow] ease-out outline-none", "hover:ring-4 hover:ring-primary-subtle", "focus-visible:ring-4 focus-visible:ring-primary-subtle", local.thumbClass);
47
+ },
48
+ get children() {
49
+ return [createComponent(Slider.Input, {
50
+ id: `slider-${inputId}-${index}`,
51
+ ref: (input) => {
52
+ createRenderEffect(() => {
53
+ input.defaultValue = String(props.defaultValue?.[index] ?? props.value?.[index] ?? props.minValue ?? 0);
54
+ });
55
+ },
56
+ hidden: true,
57
+ "aria-hidden": "true"
58
+ }), createComponent(Show, {
59
+ get when() {
60
+ return local.valueLabel;
61
+ },
62
+ get children() {
63
+ return createComponent(Slider.ValueLabel, { "class": "bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" });
64
+ }
65
+ })];
66
+ }
67
+ })
52
68
  })
53
69
  ];
54
70
  } }));
@@ -1 +1 @@
1
- {"version":3,"file":"slider.js","names":["Slider","KobalteSlider","ComponentProps","Show","splitProps","cn","SliderProps","trackClass","rangeClass","thumbClass","valueLabel","props","local","rest","_$createComponent","_$mergeProps","class","children","Track","Fill","_$memo","Thumb","aria-label","aria-labelledby","when","ValueLabel","Slider","_$createComponent","KobalteSlider","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/slider/slider.tsx"],"sourcesContent":["import { Slider as KobalteSlider } from '@kobalte/core/slider'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Slider.\n *\n * For a value on a continuum where position matters more than precision — a\n * zoom, a volume, a threshold. When the number matters, pass `valueLabel` so\n * the value is both adjustable *and* readable; a bare slider is a control\n * nobody can set exactly.\n *\n * Kobalte handles pointer capture, keyboard stepping and the ARIA value\n * wiring; this paints the track, fill and thumb.\n */\nexport type SliderProps = ComponentProps<typeof KobalteSlider> & {\n trackClass?: string\n rangeClass?: string\n thumbClass?: string\n /** Show the current value beside the thumb while dragging. */\n valueLabel?: boolean\n}\n\nexport function Slider(props: SliderProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'trackClass',\n 'rangeClass',\n 'thumbClass',\n 'valueLabel',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n ])\n\n return (\n <KobalteSlider\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n >\n <KobalteSlider.Track\n class={cn(\n 'bg-input relative grow overflow-hidden rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n local.trackClass\n )}\n >\n <KobalteSlider.Fill\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n local.rangeClass\n )}\n />\n </KobalteSlider.Track>\n {local.children}\n <KobalteSlider.Thumb\n aria-label={local['aria-label']}\n aria-labelledby={local['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'focus-visible:ring-4 focus-visible:ring-primary-subtle',\n local.thumbClass\n )}\n >\n <Show when={local.valueLabel}>\n <KobalteSlider.ValueLabel class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\" />\n </Show>\n </KobalteSlider.Thumb>\n </KobalteSlider>\n )\n}\n"],"mappings":";;;;;AAwBA,SAAgBA,SAAOW,OAAoB;CACzC,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAiB,CAClB;CAED,OAAAG,gBACGb,QAAac,WAAA,EAAA,KAAA,WAAA;EAAA,OACLV,GACL,gEACA,2GACA,8BACAO,MAAMI,KACR;CAAC,EAAA,GACGH,MAAI,EAAA,IAAAI,WAAA;EAAA,OAAA;GAAAH,gBAEPb,OAAciB,OAAK;IAAA,KAAA,WAAA;KAAA,OACXb,GACL,uDACA,4EACA,wEACAO,MAAML,UACR;IAAC;IAAA,IAAAU,WAAA;KAAA,OAAAH,gBAEAb,OAAckB,MAAI,EAAA,KAAA,WAAA;MAAA,OACVd,GACL,oCACA,2EACAO,MAAMJ,UACR;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;GAAAY,WAGJR,MAAMK,QAAQ;GAAAH,gBACdb,OAAcoB,OAAK;IAAA,KAAA,gBAAA;KAAA,OACNT,MAAM;IAAa;IAAA,KAAA,qBAAA;KAAA,OACdA,MAAM;IAAkB;IAAA,KAAA,WAAA;KAAA,OAClCP,GACL,sFACA,uDACA,0CACA,0DACAO,MAAMH,UACR;IAAC;IAAA,IAAAQ,WAAA;KAAA,OAAAH,gBAEAX,MAAI;MAAA,IAACqB,OAAI;OAAA,OAAEZ,MAAMF;MAAU;MAAA,IAAAO,WAAA;OAAA,OAAAH,gBACzBb,OAAcwB,YAAU,EAAA,SAAA,0IAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAKnC"}
1
+ {"version":3,"file":"slider.js","names":["Slider","KobalteSlider","ComponentProps","For","Show","createUniqueId","createRenderEffect","splitProps","cn","SliderProps","thumbLabels","trackClass","rangeClass","thumbClass","valueLabel","props","inputId","local","rest","_$createComponent","_$mergeProps","class","children","Track","Fill","_$memo","each","Array","from","length","value","defaultValue","_","index","Thumb","aria-label","aria-labelledby","undefined","Input","id","ref","input","String","minValue","hidden","when","ValueLabel","Slider","_$createComponent","KobalteSlider","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/slider/slider.tsx"],"sourcesContent":["import { Slider as KobalteSlider } from '@kobalte/core/slider'\nimport type { ComponentProps } from 'solid-js'\nimport { For, Show, createUniqueId, createRenderEffect, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Slider.\n *\n * For a value on a continuum where position matters more than precision — a\n * zoom, a volume, a threshold. When the number matters, pass `valueLabel` so\n * the value is both adjustable *and* readable; a bare slider is a control\n * nobody can set exactly.\n *\n * Kobalte handles pointer capture, keyboard stepping and the ARIA value\n * wiring; this paints the track, fill and one thumb per value. Each thumb\n * contains a form-native input, hidden from accessibility because the visible\n * thumb already exposes the slider role.\n */\nexport type SliderProps = ComponentProps<typeof KobalteSlider> & {\n /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */\n thumbLabels?: readonly string[]\n trackClass?: string\n rangeClass?: string\n thumbClass?: string\n /** Show the current value beside the thumb while dragging. */\n valueLabel?: boolean\n}\n\nexport function Slider(props: SliderProps) {\n const inputId = createUniqueId()\n const [local, rest] = splitProps(props, [\n 'class',\n 'trackClass',\n 'rangeClass',\n 'thumbClass',\n 'thumbLabels',\n 'valueLabel',\n 'children',\n 'aria-label',\n 'aria-labelledby',\n ])\n\n return (\n <KobalteSlider\n class={cn(\n 'relative flex touch-none flex-col justify-center select-none',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=horizontal]:w-full',\n 'data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n >\n <KobalteSlider.Track\n class={cn(\n 'bg-input relative grow overflow-hidden rounded-full',\n 'data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full',\n 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',\n local.trackClass\n )}\n >\n <KobalteSlider.Fill\n class={cn(\n 'bg-primary absolute rounded-full',\n 'data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',\n local.rangeClass\n )}\n />\n </KobalteSlider.Track>\n {local.children}\n <For\n each={Array.from(\n { length: (props.value ?? props.defaultValue ?? [0]).length },\n (_, index) => index\n )}\n >\n {(index) => (\n <KobalteSlider.Thumb\n aria-label={local.thumbLabels?.[index] ?? local['aria-label']}\n aria-labelledby={local.thumbLabels?.[index] ? undefined : local['aria-labelledby']}\n class={cn(\n 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',\n 'transition-[color,box-shadow] ease-out outline-none',\n 'hover:ring-4 hover:ring-primary-subtle',\n 'focus-visible:ring-4 focus-visible:ring-primary-subtle',\n local.thumbClass\n )}\n >\n {/* Native reset uses the value property’s default, not an HTML defaultValue attribute. */}\n <KobalteSlider.Input\n id={`slider-${inputId}-${index}`}\n ref={(input) => {\n createRenderEffect(() => {\n input.defaultValue = String(\n props.defaultValue?.[index] ?? props.value?.[index] ?? props.minValue ?? 0\n )\n })\n }}\n hidden\n aria-hidden=\"true\"\n />\n <Show when={local.valueLabel}>\n <KobalteSlider.ValueLabel class=\"bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums\" />\n </Show>\n </KobalteSlider.Thumb>\n )}\n </For>\n </KobalteSlider>\n )\n}\n"],"mappings":";;;;;AA4BA,SAA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AMV,eAAeW,OACnB3B,MAAMgB,eAAeE,UAAUlB,MAAMe,QAAQG,UAAUlB,MAAM4B,YAAY,CAC3E;QACF,CAAC;OACH;OACAC,QAAM;OAAA,eAAA;MAAA,CAAA,GAAAzB,gBAGPf,MAAI;OAAA,IAACyC,OAAI;QAAA,OAAE5B,MAAMH;OAAU;OAAA,IAAAQ,WAAA;QAAA,OAAAH,gBACzBlB,OAAc6C,YAAU,EAAA,SAAA,0IAAA,CAAA;OAAA;MAAA,CAAA,CAAA;KAAA;IAAA,CAAA;GAG9B,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAIT"}
@@ -96,6 +96,7 @@ export function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Con
96
96
  {...rest}
97
97
  >
98
98
  <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />
99
+ {local.children}
99
100
  <KobalteCombobox.Arrow aria-hidden="true" class={popoverArrow} />
100
101
  </KobalteCombobox.Content>
101
102
  </KobalteCombobox.Portal>
@@ -1,6 +1,6 @@
1
1
  import { Slider as KobalteSlider } from '@kobalte/core/slider'
2
2
  import type { ComponentProps } from 'solid-js'
3
- import { Show, splitProps } from 'solid-js'
3
+ import { For, Show, createUniqueId, createRenderEffect, splitProps } from 'solid-js'
4
4
  import { cn } from '../../../lib/utils'
5
5
 
6
6
  /**
@@ -12,9 +12,13 @@ import { cn } from '../../../lib/utils'
12
12
  * nobody can set exactly.
13
13
  *
14
14
  * Kobalte handles pointer capture, keyboard stepping and the ARIA value
15
- * wiring; this paints the track, fill and thumb.
15
+ * wiring; this paints the track, fill and one thumb per value. Each thumb
16
+ * contains a form-native input, hidden from accessibility because the visible
17
+ * thumb already exposes the slider role.
16
18
  */
17
19
  export type SliderProps = ComponentProps<typeof KobalteSlider> & {
20
+ /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */
21
+ thumbLabels?: readonly string[]
18
22
  trackClass?: string
19
23
  rangeClass?: string
20
24
  thumbClass?: string
@@ -23,11 +27,13 @@ export type SliderProps = ComponentProps<typeof KobalteSlider> & {
23
27
  }
24
28
 
25
29
  export function Slider(props: SliderProps) {
30
+ const inputId = createUniqueId()
26
31
  const [local, rest] = splitProps(props, [
27
32
  'class',
28
33
  'trackClass',
29
34
  'rangeClass',
30
35
  'thumbClass',
36
+ 'thumbLabels',
31
37
  'valueLabel',
32
38
  'children',
33
39
  'aria-label',
@@ -61,21 +67,43 @@ export function Slider(props: SliderProps) {
61
67
  />
62
68
  </KobalteSlider.Track>
63
69
  {local.children}
64
- <KobalteSlider.Thumb
65
- aria-label={local['aria-label']}
66
- aria-labelledby={local['aria-labelledby']}
67
- class={cn(
68
- 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',
69
- 'transition-[color,box-shadow] ease-out outline-none',
70
- 'hover:ring-4 hover:ring-primary-subtle',
71
- 'focus-visible:ring-4 focus-visible:ring-primary-subtle',
72
- local.thumbClass
70
+ <For
71
+ each={Array.from(
72
+ { length: (props.value ?? props.defaultValue ?? [0]).length },
73
+ (_, index) => index
73
74
  )}
74
75
  >
75
- <Show when={local.valueLabel}>
76
- <KobalteSlider.ValueLabel class="bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" />
77
- </Show>
78
- </KobalteSlider.Thumb>
76
+ {(index) => (
77
+ <KobalteSlider.Thumb
78
+ aria-label={local.thumbLabels?.[index] ?? local['aria-label']}
79
+ aria-labelledby={local.thumbLabels?.[index] ? undefined : local['aria-labelledby']}
80
+ class={cn(
81
+ 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',
82
+ 'transition-[color,box-shadow] ease-out outline-none',
83
+ 'hover:ring-4 hover:ring-primary-subtle',
84
+ 'focus-visible:ring-4 focus-visible:ring-primary-subtle',
85
+ local.thumbClass
86
+ )}
87
+ >
88
+ {/* Native reset uses the value property’s default, not an HTML defaultValue attribute. */}
89
+ <KobalteSlider.Input
90
+ id={`slider-${inputId}-${index}`}
91
+ ref={(input) => {
92
+ createRenderEffect(() => {
93
+ input.defaultValue = String(
94
+ props.defaultValue?.[index] ?? props.value?.[index] ?? props.minValue ?? 0
95
+ )
96
+ })
97
+ }}
98
+ hidden
99
+ aria-hidden="true"
100
+ />
101
+ <Show when={local.valueLabel}>
102
+ <KobalteSlider.ValueLabel class="bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" />
103
+ </Show>
104
+ </KobalteSlider.Thumb>
105
+ )}
106
+ </For>
79
107
  </KobalteSlider>
80
108
  )
81
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.72.1",
3
+ "version": "0.72.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",
@@ -96,6 +96,7 @@ export function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Con
96
96
  {...rest}
97
97
  >
98
98
  <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />
99
+ {local.children}
99
100
  <KobalteCombobox.Arrow aria-hidden="true" class={popoverArrow} />
100
101
  </KobalteCombobox.Content>
101
102
  </KobalteCombobox.Portal>
@@ -1,6 +1,6 @@
1
1
  import { Slider as KobalteSlider } from '@kobalte/core/slider'
2
2
  import type { ComponentProps } from 'solid-js'
3
- import { Show, splitProps } from 'solid-js'
3
+ import { For, Show, createUniqueId, createRenderEffect, splitProps } from 'solid-js'
4
4
  import { cn } from '#lib/utils'
5
5
 
6
6
  /**
@@ -12,9 +12,13 @@ import { cn } from '#lib/utils'
12
12
  * nobody can set exactly.
13
13
  *
14
14
  * Kobalte handles pointer capture, keyboard stepping and the ARIA value
15
- * wiring; this paints the track, fill and thumb.
15
+ * wiring; this paints the track, fill and one thumb per value. Each thumb
16
+ * contains a form-native input, hidden from accessibility because the visible
17
+ * thumb already exposes the slider role.
16
18
  */
17
19
  export type SliderProps = ComponentProps<typeof KobalteSlider> & {
20
+ /** Accessible names for individual thumbs, in value order (for example minimum and maximum). */
21
+ thumbLabels?: readonly string[]
18
22
  trackClass?: string
19
23
  rangeClass?: string
20
24
  thumbClass?: string
@@ -23,11 +27,13 @@ export type SliderProps = ComponentProps<typeof KobalteSlider> & {
23
27
  }
24
28
 
25
29
  export function Slider(props: SliderProps) {
30
+ const inputId = createUniqueId()
26
31
  const [local, rest] = splitProps(props, [
27
32
  'class',
28
33
  'trackClass',
29
34
  'rangeClass',
30
35
  'thumbClass',
36
+ 'thumbLabels',
31
37
  'valueLabel',
32
38
  'children',
33
39
  'aria-label',
@@ -61,21 +67,43 @@ export function Slider(props: SliderProps) {
61
67
  />
62
68
  </KobalteSlider.Track>
63
69
  {local.children}
64
- <KobalteSlider.Thumb
65
- aria-label={local['aria-label']}
66
- aria-labelledby={local['aria-labelledby']}
67
- class={cn(
68
- 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',
69
- 'transition-[color,box-shadow] ease-out outline-none',
70
- 'hover:ring-4 hover:ring-primary-subtle',
71
- 'focus-visible:ring-4 focus-visible:ring-primary-subtle',
72
- local.thumbClass
70
+ <For
71
+ each={Array.from(
72
+ { length: (props.value ?? props.defaultValue ?? [0]).length },
73
+ (_, index) => index
73
74
  )}
74
75
  >
75
- <Show when={local.valueLabel}>
76
- <KobalteSlider.ValueLabel class="bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" />
77
- </Show>
78
- </KobalteSlider.Thumb>
76
+ {(index) => (
77
+ <KobalteSlider.Thumb
78
+ aria-label={local.thumbLabels?.[index] ?? local['aria-label']}
79
+ aria-labelledby={local.thumbLabels?.[index] ? undefined : local['aria-labelledby']}
80
+ class={cn(
81
+ 'border-primary bg-background block size-4 shrink-0 rounded-full border-2 shadow-xs',
82
+ 'transition-[color,box-shadow] ease-out outline-none',
83
+ 'hover:ring-4 hover:ring-primary-subtle',
84
+ 'focus-visible:ring-4 focus-visible:ring-primary-subtle',
85
+ local.thumbClass
86
+ )}
87
+ >
88
+ {/* Native reset uses the value property’s default, not an HTML defaultValue attribute. */}
89
+ <KobalteSlider.Input
90
+ id={`slider-${inputId}-${index}`}
91
+ ref={(input) => {
92
+ createRenderEffect(() => {
93
+ input.defaultValue = String(
94
+ props.defaultValue?.[index] ?? props.value?.[index] ?? props.minValue ?? 0
95
+ )
96
+ })
97
+ }}
98
+ hidden
99
+ aria-hidden="true"
100
+ />
101
+ <Show when={local.valueLabel}>
102
+ <KobalteSlider.ValueLabel class="bg-popover text-popover-foreground absolute -top-6 left-1/2 -translate-x-1/2 rounded-sm border border-border px-1 text-2xs tabular-nums" />
103
+ </Show>
104
+ </KobalteSlider.Thumb>
105
+ )}
106
+ </For>
79
107
  </KobalteSlider>
80
108
  )
81
109
  }