@jonmilner/ui 0.11.7 → 0.11.8

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 (54) hide show
  1. package/dist/Avatar/Avatar.css +1 -1
  2. package/dist/Badge/Badge.css +1 -1
  3. package/dist/Box/Box.css +1 -1
  4. package/dist/Button/Button.css +1 -1
  5. package/dist/Checkbox/Checkbox.css +1 -1
  6. package/dist/Chip/Chip.css +1 -1
  7. package/dist/Clickable/Clickable.css +1 -1
  8. package/dist/ColorField/ColorField.css +1 -1
  9. package/dist/Dialog/Dialog.css +1 -1
  10. package/dist/Field/Field.css +1 -1
  11. package/dist/Heading/Heading.css +1 -1
  12. package/dist/Icon/Icon.css +1 -1
  13. package/dist/IconButton/IconButton.css +1 -1
  14. package/dist/Inline/Inline.css +1 -1
  15. package/dist/Menu/Menu.css +1 -1
  16. package/dist/MultiSelect/MultiSelect.css +1 -1
  17. package/dist/MultiSelect/client.mjs +40 -111
  18. package/dist/MultiSelect/index.d.mts +2 -2
  19. package/dist/MultiSelect/index.mjs +38 -58
  20. package/dist/RadioGroup/RadioGroup.css +1 -1
  21. package/dist/SearchField/SearchField.css +1 -1
  22. package/dist/Select/Select.css +2 -0
  23. package/dist/Select/Select.css.mjs +7 -0
  24. package/dist/Select/client.mjs +33 -0
  25. package/dist/Select/index.d.mts +21 -0
  26. package/dist/Select/index.mjs +46 -0
  27. package/dist/Stack/Stack.css +1 -1
  28. package/dist/Switch/Switch.css +1 -1
  29. package/dist/Table/Table.css +1 -1
  30. package/dist/Tabs/Tabs.css +1 -1
  31. package/dist/Tag/Tag.css +1 -1
  32. package/dist/Text/Text.css +1 -1
  33. package/dist/TextField/TextField.css +1 -1
  34. package/dist/Textarea/Textarea.css +1 -1
  35. package/dist/Toast/Toast.css +1 -1
  36. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  37. package/dist/base.css +1 -1
  38. package/dist/docs/Field.md +2 -2
  39. package/dist/docs/Menu.md +1 -1
  40. package/dist/docs/MultiSelect.md +4 -4
  41. package/dist/docs/SearchField.md +1 -0
  42. package/dist/docs/Select.md +120 -0
  43. package/dist/docs/llms.txt +1 -0
  44. package/dist/docs/manifest.json +85 -2
  45. package/dist/index.d.mts +2 -1
  46. package/dist/index.mjs +14 -13
  47. package/dist/popup/listbox-options.d.mts +5 -0
  48. package/dist/popup/listbox-options.mjs +35 -0
  49. package/dist/popup/listbox.mjs +89 -0
  50. package/dist/styles/atoms.css +1 -1
  51. package/dist/styles/layers.css +1 -1
  52. package/dist/styles/responsive.css +1 -1
  53. package/package.json +5 -1
  54. package/dist/MultiSelect/client.d.mts +0 -8
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.tabs{.xowpd00{border-block-end:var(--space-1) solid var(--color-border)}.xowpd00[aria-orientation=vertical]{border-block-end:none;border-inline-end:var(--space-1) solid var(--color-border);flex-direction:column}.xowpd01{transition:color var(--duration-fast) var(--easing-standard)}.xowpd01[aria-selected=true]{color:var(--color-fg)}.xowpd01[aria-disabled=true]{opacity:.5}.xowpd02{border-block-end:var(--space-2) solid var(--color-accent);opacity:0;scale:calc(1 - var(--scale-lg)) 1;transition:opacity var(--duration-med) var(--easing-standard), scale var(--duration-med) var(--easing-standard);pointer-events:none;inset-block-end:calc(-1 * var(--space-1));inset-inline:0}[data-orientation=vertical]>.xowpd02{inset-inline:auto;border-block-end:none;border-inline-end:var(--space-2) solid var(--color-accent);scale:1 calc(1 - var(--scale-lg));inset-block:0;inset-inline-end:calc(-1 * var(--space-1))}[aria-selected=true]>.xowpd02{opacity:1;scale:1}.xowpd03:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.xowpd03[data-orientation=vertical]{flex-basis:0}@media (hover:hover){.xowpd01:not([aria-disabled=true]):hover{color:var(--color-fg)}}@media (forced-colors:active){.xowpd01[aria-disabled=true]{color:graytext}.xowpd02{border-color:highlight}}}
package/dist/Tag/Tag.css CHANGED
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.tag{._1jsyd8s0{border-width:var(--space-1);border-style:solid;border-color:#0000}._1jsyd8s1{overflow-wrap:anywhere}._1jsyd8s0:hover ._1jsyd8s1,._1jsyd8s0:focus-within ._1jsyd8s1{padding-block:var(--space-4);margin-block:0}._1jsyd8s2{text-decoration:underline}._1jsyd8s3:hover{background-color:var(--color-bg)}@media (forced-colors:active){._1jsyd8s0{color:canvastext;background-color:canvas;border-color:canvastext}}}
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(li)>._1mgdisq4{display:flow-root}:where(li)>._1mgdisq4:before,:where(li)>._1mgdisq4:after{display:block}:where(li:has(>._1mgdisq4))::marker{line-height:0}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq5{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq5:before,._1mgdisq5:after{content:none}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisqa{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqb{font-size:var(--font-size-xs)}._1mgdisqc{font-size:var(--font-size-sm)}._1mgdisqd{font-size:var(--font-size-med)}._1mgdisqe{font-size:var(--font-size-lg)}._1mgdisqf{font-size:var(--font-size-xl)}._1mgdisqg{font-size:var(--font-size-2xl)}._1mgdisqh{font-size:var(--font-size-3xl)}._1mgdisqi{font-size:var(--font-size-4xl)}._1mgdisqj{font-weight:var(--font-weight-regular)}._1mgdisqk{font-weight:var(--font-weight-medium)}._1mgdisql{font-weight:var(--font-weight-semibold)}._1mgdisqm{font-weight:var(--font-weight-bold)}._1mgdisqn{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqp{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqq{font-variant-numeric:tabular-nums}._1mgdisqr{white-space:nowrap}._1mgdisqs{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqt{white-space:pre}._1mgdisqu{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisqu{white-space:normal;text-overflow:clip}}
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.text-field{._20at410{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._20at411{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);padding-block:0}._20at411::placeholder{color:var(--color-fg-muted);opacity:1}._20at411:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._20at411:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._20at411[aria-invalid=true]{border-color:var(--color-danger)}._20at412{block-size:var(--size-xs);padding-inline:var(--space-6)}._20at413{block-size:var(--size-sm);padding-inline:var(--space-8)}._20at414{block-size:var(--size-med);padding-inline:var(--space-12)}@media (pointer:coarse){._20at411{font-size:var(--font-size-med)}}@media (forced-colors:active){._20at411:disabled{color:graytext;border-color:graytext}}}
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.textarea{._1kwv2lp0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kwv2lp1{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);resize:block;padding-block:0}._1kwv2lp1::placeholder{color:var(--color-fg-muted);opacity:1}._1kwv2lp1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kwv2lp1:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;resize:none;border-style:dashed}._1kwv2lp1[aria-invalid=true]{border-color:var(--color-danger)}._1kwv2lp2{min-block-size:var(--size-xs);padding-block:calc((var(--size-xs) - 2 * var(--space-1) - var(--font-size-xs) * var(--line-height-med)) / 2);padding-inline:var(--space-6)}._1kwv2lp3{min-block-size:var(--size-sm);padding-block:calc((var(--size-sm) - 2 * var(--space-1) - var(--font-size-sm) * var(--line-height-med)) / 2);padding-inline:var(--space-8)}._1kwv2lp4{min-block-size:var(--size-med);padding-block:calc((var(--size-med) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2);padding-inline:var(--space-12)}@media (pointer:coarse){._1kwv2lp1{font-size:var(--font-size-med)}._1kwv2lp2{min-block-size:max(var(--size-xs), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-xs) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}._1kwv2lp3{min-block-size:max(var(--size-sm), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-sm) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}._1kwv2lp4{min-block-size:max(var(--size-med), calc(2 * var(--space-1) + var(--font-size-med) * var(--line-height-med)));padding-block:max(var(--space-0), calc((var(--size-med) - 2 * var(--space-1) - var(--font-size-med) * var(--line-height-med)) / 2))}}@media (forced-colors:active){._1kwv2lp1:disabled{color:graytext;border-color:graytext}}}
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.toast{.hcnvsc1{inline-size:min(100% - 2 * var(--space-16), 6 * var(--space-64));inset-block-end:var(--space-16);inset-inline-end:var(--space-16);container:hcnvsc0/inline-size}.hcnvsc1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.hcnvsc2{gap:var(--space-8);margin:calc(-1 * var(--space-16));padding:var(--space-16);overscroll-behavior:contain;flex-direction:column;max-block-size:100dvh;margin-inline-start:calc(-1 * var(--space-24));padding-inline-start:var(--space-24);display:flex;overflow:hidden auto}.hcnvsc2:empty{padding:0}.hcnvsc2:has([data-swiping],[data-swipe-direction=down]){overflow-y:hidden}.hcnvsc3{border:var(--space-1) solid var(--color-border);transform:translate(var(--toast-swipe-movement-x,0), var(--toast-swipe-movement-y,0));transition:opacity var(--duration-med) var(--easing-standard), translate var(--duration-med) var(--easing-enter), transform var(--duration-med) var(--easing-enter)}.hcnvsc3:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.hcnvsc3[data-starting-style],.hcnvsc3[data-ending-style]{opacity:0;translate:0 var(--distance-med)}.hcnvsc3[data-swiping]{transition:none}.hcnvsc3[data-limited]{display:none}.hcnvsc4{overflow-wrap:anywhere}.hcnvsca{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;inset-block-start:0;inset-inline-start:0;overflow:hidden}@container hcnvsc0 (inline-size<16rem){.hcnvsc3{flex-wrap:wrap}.hcnvsc4{flex-basis:100%;order:1}.hcnvsc5{margin-inline-start:auto}}}
@@ -1,2 +1,2 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer components.visually-hidden{._1qk18b30{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}}
package/dist/base.css CHANGED
@@ -1,4 +1,4 @@
1
- @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
1
+ @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
2
2
  @layer tokens{:root{--space-0:0rem;--space-1:.0625rem;--space-2:.125rem;--space-4:.25rem;--space-6:.375rem;--space-8:.5rem;--space-12:.75rem;--space-16:1rem;--space-20:1.25rem;--space-24:1.5rem;--space-32:2rem;--space-40:2.5rem;--space-48:3rem;--space-64:4rem;--space-80:5rem;--space-96:6rem;--size-xs:1.5rem;--size-sm:2rem;--size-med:2.5rem;--size-lg:3rem;--size-xl:3.5rem;--container-prose:40rem;--container-page:64rem;--container-wide:80rem;--radius-none:0;--radius-sm:.25rem;--radius-med:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-full:9999px;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-med:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:1.875rem;--font-size-4xl:2.25rem;--font-weight-regular:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-sm:1.25;--line-height-med:1.5;--line-height-lg:1.75;--z-index-base:0;--z-index-raised:1;--z-index-dropdown:1000;--z-index-sticky:1100;--z-index-overlay:1200;--z-index-modal:1300;--z-index-popover:1400;--z-index-toast:1500;--z-index-tooltip:1600;--duration-fast:.12s;--duration-med:.2s;--duration-slow:.32s;--easing-standard:cubic-bezier(.2, 0, 0, 1);--easing-enter:cubic-bezier(0, 0, 0, 1);--easing-exit:cubic-bezier(.3, 0, 1, 1);--distance-sm:.25rem;--distance-med:.5rem;--distance-lg:1rem;--scale-sm:.02;--scale-med:.05;--scale-lg:.1}[data-brand]{--shadow-sm:0 1px 2px color-mix(in srgb, var(--color-shadow) 12%, transparent);--shadow-med:0 2px 8px color-mix(in srgb, var(--color-shadow) 14%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 8%, transparent);--shadow-lg:0 8px 24px color-mix(in srgb, var(--color-shadow) 16%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent)}[data-brand][data-mode=light]{color-scheme:light}[data-brand][data-mode=dark]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent);color-scheme:dark}[data-brand][data-mode=system]{color-scheme:light dark}:dir(ltr){--dir:1}:dir(rtl){--dir:-1}@media (prefers-color-scheme:dark){[data-brand][data-mode=system]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent)}}@media (prefers-reduced-motion:reduce){:root{--distance-sm:0rem;--distance-med:0rem;--distance-lg:0rem;--scale-sm:0;--scale-med:0;--scale-lg:0;--duration-fast:.12s;--duration-med:.12s;--duration-slow:.12s}}}
3
3
 
4
4
  @font-face{src:local(Arial),local(ArialMT);font-weight:400;font-style:normal;size-adjust:101.568%;ascent-override:95.3892%;descent-override:23.7511%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold),local(Arial-BoldMT);font-weight:700;font-style:normal;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Italic),local(Arial-ItalicMT);font-weight:400;font-style:italic;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold Italic),local(Arial-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:101.706%;ascent-override:95.2591%;descent-override:23.7187%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Menlo Regular),local(Menlo-Regular);font-weight:400;font-style:normal;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold),local(Menlo-Bold);font-weight:700;font-style:normal;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Italic),local(Menlo-Italic);font-weight:400;font-style:italic;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold Italic),local(Menlo-BoldItalic);font-weight:700;font-style:italic;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Consolas);font-weight:400;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold),local(Consolas-Bold);font-weight:700;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Italic),local(Consolas-Italic);font-weight:400;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold Italic),local(Consolas-BoldItalic);font-weight:700;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Courier New),local(CourierNewPSMT);font-weight:400;font-style:normal;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold),local(CourierNewPS-BoldMT);font-weight:700;font-style:normal;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Italic),local(CourierNewPS-ItalicMT);font-weight:400;font-style:italic;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold Italic),local(CourierNewPS-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@layer tokens{[data-brand=default]{--color-bg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-bg-muted:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .008 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .002 265));--color-fg-muted:light-dark(oklch(44.5% .014 265),oklch(71% .012 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .01 265));--color-border-strong:oklch(55.5% .014 265);--color-accent:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-accent-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-accent-fill:light-dark(oklch(54.6% .19 258),oklch(48.8% .18 258));--color-accent-fill-fg:oklch(100% 0 0);--color-danger:light-dark(oklch(56% .2 25),oklch(70.4% .17 25));--color-danger-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-success:light-dark(oklch(52% .135 150),oklch(76% .15 150));--color-success-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-warning:light-dark(oklch(53% .11 75),oklch(81% .145 75));--color-warning-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-done:light-dark(oklch(55% .2 295),oklch(72% .15 295));--color-done-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-neutral-subtle:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-neutral-subtle-fg:light-dark(oklch(37% .013 265),oklch(92.5% .006 265));--color-accent-subtle:light-dark(oklch(93.2% .032 258),oklch(28.2% .09 258));--color-accent-subtle-fg:light-dark(oklch(48.8% .18 258),oklch(80.9% .095 258));--color-success-subtle:light-dark(oklch(94.5% .04 150),oklch(26% .06 150));--color-success-subtle-fg:light-dark(oklch(46.5% .12 150),oklch(84% .115 150));--color-warning-subtle:light-dark(oklch(95.5% .03 75),oklch(27% .05 75));--color-warning-subtle-fg:light-dark(oklch(47.5% .1 75),oklch(86% .105 75));--color-danger-subtle:light-dark(oklch(93.6% .032 25),oklch(25.8% .085 25));--color-danger-subtle-fg:light-dark(oklch(50.5% .19 25),oklch(80.8% .105 25));--color-done-subtle:light-dark(oklch(93.8% .032 295),oklch(28% .095 295));--color-done-subtle-fg:light-dark(oklch(49% .19 295),oklch(81.5% .1 295));--color-focus:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-shadow:light-dark(oklch(14.5% .006 265),oklch(0% 0 0));--font-body:"Inter", "Inter Fallback Arial", sans-serif;--font-heading:"Inter", "Inter Fallback Arial", sans-serif;--font-display:"Inter", "Inter Fallback Arial", sans-serif;--font-label:"Inter", "Inter Fallback Arial", sans-serif;--font-mono:"JetBrains Mono", "JetBrains Mono Fallback Menlo", "JetBrains Mono Fallback Consolas", "JetBrains Mono Fallback Courier New", monospace;--font-trim-body-cap:.36377;--font-trim-body-baseline:.36377;--font-trim-heading-cap:.36377;--font-trim-heading-baseline:.36377;--font-trim-display-cap:.36377;--font-trim-display-baseline:.36377;--font-trim-label-cap:.36377;--font-trim-label-baseline:.36377;--font-trim-mono-cap:.37;--font-trim-mono-baseline:.36}@media (forced-colors:active){[data-brand][data-brand]{--color-bg:Canvas;--color-bg-muted:Canvas;--color-bg-raised:Canvas;--color-fg:CanvasText;--color-fg-muted:CanvasText;--color-border:CanvasText;--color-border-strong:CanvasText;--color-accent:LinkText;--color-accent-fg:Canvas;--color-accent-fill:LinkText;--color-accent-fill-fg:Canvas;--color-danger:CanvasText;--color-danger-fg:Canvas;--color-success:CanvasText;--color-success-fg:Canvas;--color-warning:CanvasText;--color-warning-fg:Canvas;--color-done:CanvasText;--color-done-fg:Canvas;--color-neutral-subtle:Canvas;--color-neutral-subtle-fg:CanvasText;--color-accent-subtle:Canvas;--color-accent-subtle-fg:CanvasText;--color-success-subtle:Canvas;--color-success-subtle-fg:CanvasText;--color-warning-subtle:Canvas;--color-warning-subtle-fg:CanvasText;--color-danger-subtle:Canvas;--color-danger-subtle-fg:CanvasText;--color-done-subtle:Canvas;--color-done-subtle-fg:CanvasText;--color-focus:Highlight;--color-shadow:CanvasText}}}
@@ -6,7 +6,7 @@ Wires one form control to its label, description and error: ids, `htmlFor`, `ari
6
6
 
7
7
  ## When to use
8
8
 
9
- - Any form control that needs a visible label, help text or an error, including a control a component builds (Checkbox, MultiSelect, Switch build on Field rather than their own wiring).
9
+ - Any form control that needs a visible label, help text or an error, including a control a component builds (Checkbox, MultiSelect, Select, Switch build on Field rather than their own wiring).
10
10
  - Showing a server validation error next to its control. The app's action or submit handler returns it; set `invalid` and put the message in `Field.Error` (a props control such as `TextField` takes it as `error` instead; ADR 0133).
11
11
 
12
12
  ## When not to use
@@ -14,7 +14,7 @@ Wires one form control to its label, description and error: ids, `htmlFor`, `ari
14
14
  - An error about the whole form (a failed save, a network error): put it in a reserved slot at the form level, not on one field.
15
15
  - The result of submitting the form ("Profile saved"): use `Toast`; the field's message is for that one input.
16
16
  - A group of controls with one legend: a public `Fieldset` is not planned (ADR 0133). For checkboxes, write a native `fieldset` and `legend` with one Field per Checkbox. For one choice among a few, `RadioGroup` carries its own legend.
17
- - A single line of text, several lines, a search, a colour or a choice from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField` or `MultiSelect`, which build on this Field.
17
+ - A single line of text, several lines, a search, a colour, or one or several values from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField`, `Select` or `MultiSelect`, which build on this Field.
18
18
 
19
19
  ## Rules
20
20
 
package/dist/docs/Menu.md CHANGED
@@ -12,7 +12,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
12
12
 
13
13
  ## When not to use
14
14
 
15
- - Picking a value for a form field: a single `Select` or `RadioGroup` (a few options, all shown); for several values from a long list, use `MultiSelect`.
15
+ - Picking a value for a form field: use `Select` for one value from a long list, `RadioGroup` for one of a few (all shown) and `MultiSelect` for several.
16
16
  - Navigation between pages: a menu that is only links is still navigation, so show the links on the page or in a nav. Link items are for a menu that mixes actions and links.
17
17
  - One or two actions: show them as buttons.
18
18
  - Content a user reads, or anything interactive inside the list (fields, toggles): use a popover or a dialog.
@@ -14,8 +14,8 @@ A form field for picking any number of values from a list too long to show at on
14
14
  - A few options, all visible on the page: use `ChipGroup multiple`.
15
15
  - A short list shown inline, each with its own label: use a group of `Checkbox`es, one `Field` each, in a native `fieldset` with a `legend`.
16
16
  - Actions: use `Menu`; a multi-select picks values and runs nothing.
17
- - One choice out of several: use `RadioGroup` for a few, a single select for a long list.
18
- - Search, filtering or async options: wait for `Select` and `Combobox` (planned).
17
+ - One value from a long list: use `Select`; from a few shown at once, `RadioGroup`.
18
+ - Search, filtering or async options: wait for `Combobox` (planned).
19
19
  - Users who need to see every selected value at once: use `Chip` or `ChipGroup`, or show the selection beside the field.
20
20
 
21
21
  ## Rules
@@ -89,7 +89,7 @@ A form field for picking any number of values from a list too long to show at on
89
89
 
90
90
  ## Accessibility
91
91
 
92
- - The trigger is a button with `aria-haspopup="listbox"` and `aria-expanded`, labelled by the `Field` label and described by the description and error. The popup is `role="listbox"` with `aria-multiselectable="true"`, options are `role="option"` with `aria-selected`.
92
+ - The trigger is a button with `role="combobox"`, `aria-haspopup="listbox"` and `aria-expanded`, labelled by the `Field` label and described by the description and error. The popup is `role="listbox"` with `aria-multiselectable="true"`, options are `role="option"` with `aria-selected`.
93
93
  - Opening from the keyboard focuses an option; focus stays in the list until it closes. Choosing an option toggles it and leaves the list open, so several can be picked in one visit. Closed by Esc or the trigger, focus returns at once to the trigger, so a Tab pressed while the list fades goes on to the next control. A press outside or a Tab out leaves focus to Base UI.
94
94
  - A closed list stays on the page while it fades out, but is `inert` and `aria-hidden` from the moment it closes, so a list opened during the fade (the next filter's) is the only one a screen reader or a role query finds, and nothing in the fading one takes focus or a click (ADR 0113).
95
95
  - Selection is a check mark on the option as well as its highlight, so it is not color alone. The check sits at the end of the row; its space is always kept, so the labels start at the option's padding and never shift.
@@ -113,7 +113,7 @@ Generated from the TypeScript types.
113
113
  | `label` | `ReactNode` | yes | |
114
114
  | `name` | `string` | no | |
115
115
  | `onValueChange` | `((value: string[]) => void)` | no | |
116
- | `options` | `readonly Option[]` | yes | |
116
+ | `options` | `readonly ListboxOption[]` | yes | |
117
117
  | `placeholder` | `string` | no | |
118
118
  | `required` | `boolean` | no | |
119
119
  | `size` | `"lg" \| "med" \| "sm"` | no | |
@@ -13,6 +13,7 @@ A form field for a search query: an `<input type="search">` (role `searchbox`) w
13
13
 
14
14
  - Any other single-line text: use `TextField`; a search field announces itself as a search.
15
15
  - Picking from a known list as the user types: wait for `Combobox` (planned).
16
+ - Picking one value from a list without typing: use `Select`.
16
17
  - Picking several values from a list: use `MultiSelect` or `ChipGroup`.
17
18
  - A colour: use `ColorField`.
18
19
 
@@ -0,0 +1,120 @@
1
+ # Select
2
+
3
+ ## Purpose
4
+
5
+ A form field for picking one value from a list too long to show as radios, with no typing. A trigger drawn as a field opens a listbox of options; the selected option shows a check mark, and the trigger shows its label on one line, truncated. Built on Base UI's `Select` in single mode (ADR 0003), which owns the keyboard and focus: Enter, Space and the arrow keys open it, arrow keys, Home and End move through the options, typing jumps to a match, Enter picks, Esc and an outside click close it, and focus returns to the trigger. It shares MultiSelect's trigger, popup and option rows (ADR 0134) and composes `Field` for its label, description and error (ADR 0026).
6
+
7
+ ## When to use
8
+
9
+ - Choosing one value from a list of roughly more than five to seven plain-text options in a form or a filter ("Country", "Time zone", "Status").
10
+ - A field where the list is too long to lay out as radios and the user knows the value by name.
11
+
12
+ ## When not to use
13
+
14
+ - A few options, all visible on the page: `RadioGroup` or `ChipGroup`.
15
+ - Several values: use `MultiSelect`.
16
+ - A long list the user narrows by typing, or async options: wait for `Combobox` (planned).
17
+ - Actions: use `Menu`; a select picks a value and runs nothing.
18
+ - Free text: use `TextField`.
19
+
20
+ ## Rules
21
+
22
+ - `label` is required and names the field. `description` and `error` render below the trigger through `Field`; a non-empty `error` marks the field invalid and joins the trigger's `aria-describedby`.
23
+ - `options` is a list of `{ value, label, disabled? }`. `label` is plain text: it is shown in the list and in the trigger.
24
+ - `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. Both are an option value or `null` for none (`""` counts as none too), and `onValueChange` gets the new value.
25
+ - A `value` that no option holds still shows in the trigger, as the raw value, so a stale or unknown value is seen rather than read as empty.
26
+ - `name` makes the selected value submit as one `name=value` pair, as a `<select>` does. Nothing selected submits an empty value.
27
+ - `placeholder` (`"Select"`) shows while nothing is selected, and for the value `""`. Translate it. To let the user clear the choice, add an option whose value is `""`: picking it shows the placeholder again.
28
+ - `size` (`sm`, `med`, `lg`; default `med`) is the trigger's, as Button's: it matches a SearchField, TextField, MultiSelect or Button of the same size in height (24, 32 and 40 px, ADR 0124). A long label truncates; the trigger never grows. The list's options do not change size.
29
+ - `disabled` takes the trigger out of the tab order and mutes the label. `required` sets `aria-required` on the trigger; report a missing value through `error`.
30
+ - The trigger and the open listbox are both named by `label`.
31
+ - Style props, `className` and `style` go to the `Field` around the label, trigger and messages, not to the trigger or the popup.
32
+ - The popup portals into the trigger's nearest `ThemeProvider`, so it keeps the brand and mode. That provider must not clip or stack its content: wrap the app root, and keep a nested provider off elements with `overflow: hidden`, a `transform` or their own `z-index`. It sits on `zIndex` `popover`, below the trigger by default, and flips when it would overflow the viewport.
33
+ - Never add key handlers or `tabIndex`; Base UI handles the keyboard.
34
+ - The module has no hooks, so a server component can render it; `onValueChange` must come from a client component.
35
+
36
+ ## Do
37
+
38
+ ```tsx
39
+ <Select
40
+ label="Region"
41
+ name="region"
42
+ options={[
43
+ { value: "eu-west", label: "Europe West" },
44
+ { value: "us-east", label: "US East" },
45
+ { value: "ap-south", label: "Asia Pacific South" },
46
+ ]}
47
+ defaultValue="eu-west"
48
+ />
49
+ ```
50
+
51
+ ```tsx
52
+ <Select
53
+ label="Status"
54
+ options={statuses}
55
+ value={status}
56
+ onValueChange={setStatus}
57
+ placeholder="Any status"
58
+ />
59
+ ```
60
+
61
+ ```tsx
62
+ <Select
63
+ label="Time zone"
64
+ name="tz"
65
+ options={zones}
66
+ required
67
+ error={missing ? "Pick a time zone." : undefined}
68
+ />
69
+ ```
70
+
71
+ ## Don't
72
+
73
+ ```tsx
74
+ // Three options fit on screen: radios show every choice without a click.
75
+ <Select label="Plan" options={[free, pro, team]} />
76
+ ```
77
+
78
+ ```tsx
79
+ // Several values belong in a MultiSelect.
80
+ <Select label="Labels" options={labels} onValueChange={(v) => setLabels([...labels, v])} />
81
+ ```
82
+
83
+ ```tsx
84
+ // A menu runs actions; Select keeps a value.
85
+ <Select label="Actions" options={[{ value: "delete", label: "Delete" }]} />
86
+ ```
87
+
88
+ ## Accessibility
89
+
90
+ - The trigger is a button with `role="combobox"`, `aria-haspopup="listbox"` and `aria-expanded`, labelled by the `Field` label and described by the description and error. The popup is `role="listbox"`, options are `role="option"` with `aria-selected`.
91
+ - Opening from the keyboard focuses the selected option, or the first; focus stays in the list until it closes. Choosing an option closes the list and returns focus to the trigger. Closed by Esc, focus returns at once to the trigger, so a Tab pressed while the list fades goes on to the next control. A press outside or a Tab out leaves focus to Base UI.
92
+ - A closed list stays on the page while it fades out, but is `inert` and `aria-hidden` from the moment it closes, so a list opened during the fade is the only one a screen reader or a role query finds (ADR 0113).
93
+ - Selection is a check mark on the option as well as the trigger's text, so it is not color alone. The check sits at the end of the row; its space is always kept, so labels never shift.
94
+ - The trigger's value is text; a truncated label keeps its full text for assistive technology.
95
+ - The shared focus ring shows on the trigger and, from the keyboard, on the highlighted option, drawn inset so the popup's edge does not crowd or clip it (ADR 0122). Under forced colors the pointer's highlighted option is `Highlight` with `HighlightText`; a keyboard-focused one keeps `Canvas` so the `Highlight` ring shows, and the popup keeps its border.
96
+
97
+ ## Props
98
+
99
+ Generated from the TypeScript types.
100
+
101
+ ### Select
102
+
103
+ | Prop | Type | Required | Description |
104
+ | --- | --- | --- | --- |
105
+ | `className` | `string` | no | |
106
+ | `defaultValue` | `string` | no | |
107
+ | `description` | `ReactNode` | no | |
108
+ | `disabled` | `boolean` | no | |
109
+ | `error` | `ReactNode` | no | |
110
+ | `label` | `ReactNode` | yes | |
111
+ | `name` | `string` | no | |
112
+ | `onValueChange` | `((value: string \| null) => void)` | no | |
113
+ | `options` | `readonly ListboxOption[]` | yes | |
114
+ | `placeholder` | `string` | no | |
115
+ | `required` | `boolean` | no | |
116
+ | `size` | `"lg" \| "med" \| "sm"` | no | |
117
+ | `style` | `CSSProperties` | no | |
118
+ | `value` | `string` | no | |
119
+
120
+ Also accepts the style props (see `manifest.json` `styleProps`).
@@ -30,6 +30,7 @@
30
30
  - [MultiSelect](MultiSelect.md): A form field for picking any number of values from a list too long to show at once. A trigger styled as Button's secondary look opens a listbox of options; each selected option shows a check mark, and the trigger summarises the selection as the joined labels, or a count ("3 selected") once the labels would not fit. Built on Base UI's `Select` in multiple mode (ADR 0003), which owns the keyboard and focus: arrow keys, Home and End move through the options, typing jumps to a match, Esc and an outside click close it, and focus returns to the trigger. It composes `Field` for its label, description and error (ADR 0026).
31
31
  - [RadioGroup](RadioGroup.md): One choice among a few options, all shown at once. A form field built on Base UI `RadioGroup` and `Radio` (ADR 0003, 0046) inside a `Fieldset`: a `radiogroup` named by its legend, with a `radio` per option. Each option is a 24 by 24 CSS px target (WCAG 2.2) with the shared focus ring; the 16px circle inside shows a dot when checked. It composes `Field` for the group's description and error and for each option's label and description (ADR 0026, 0133).
32
32
  - [SearchField](SearchField.md): A form field for a search query: an `<input type="search">` (role `searchbox`) with a search icon at its inline start and, while it holds a value, a clear button at its inline end. Escape empties a field that has a value, and the clear button empties it and puts focus back in the input, so a keyboard user never loses their place (ADR 0087). Built on Base UI's `Input` (ADR 0003); it composes `Field` for its label, description and error (ADR 0026). Three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124); the clear button is 24px, or 32px in `lg`.
33
+ - [Select](Select.md): A form field for picking one value from a list too long to show as radios, with no typing. A trigger drawn as a field opens a listbox of options; the selected option shows a check mark, and the trigger shows its label on one line, truncated. Built on Base UI's `Select` in single mode (ADR 0003), which owns the keyboard and focus: Enter, Space and the arrow keys open it, arrow keys, Home and End move through the options, typing jumps to a match, Enter picks, Esc and an outside click close it, and focus returns to the trigger. It shares MultiSelect's trigger, popup and option rows (ADR 0134) and composes `Field` for its label, description and error (ADR 0026).
33
34
  - [Stack](Stack.md): A vertical column of children with even space between them. `Stack` is a `Box` with `display="flex"` and `flexDirection="column"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
34
35
  - [Switch](Switch.md): Turns one setting on or off, and the change applies the moment it flips. Built on Base UI `Switch` (ADR 0003, 0137): a `span` with `role="switch"` and `aria-checked`, plus a hidden checkbox input that submits with a form. The span is a 24 px target with the shared focus ring around a pill track: off is an outlined track with the thumb at the start, on a filled `accent` track with the thumb at the end. It composes `Field` for its label, description and error (ADR 0026), with the label after the switch.
35
36
  - [Table](Table.md): Records in rows that share named columns, so a reader can scan and compare them: transactions, members, invoices. A native `table` with parts for each element (`Table.Head`, `Table.Body`, `Table.Foot`, `Table.Row`, `Table.HeaderCell`, `Table.Cell`, `Table.ColumnGroup`, `Table.Column`). It has no `grid` role and no roving focus: a link, `Checkbox` or `Menu` in a cell keeps the page's tab order, and a screen reader's table commands work as on any table.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.11.7",
4
+ "version": "0.11.8",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -1668,7 +1668,7 @@
1668
1668
  },
1669
1669
  {
1670
1670
  "name": "options",
1671
- "type": "readonly Option[]",
1671
+ "type": "readonly ListboxOption[]",
1672
1672
  "required": true
1673
1673
  },
1674
1674
  {
@@ -1885,6 +1885,89 @@
1885
1885
  "parts": [],
1886
1886
  "exports": []
1887
1887
  },
1888
+ {
1889
+ "name": "Select",
1890
+ "styleProps": true,
1891
+ "props": [
1892
+ {
1893
+ "name": "className",
1894
+ "type": "string",
1895
+ "required": false
1896
+ },
1897
+ {
1898
+ "name": "defaultValue",
1899
+ "type": "string",
1900
+ "required": false
1901
+ },
1902
+ {
1903
+ "name": "description",
1904
+ "type": "ReactNode",
1905
+ "required": false
1906
+ },
1907
+ {
1908
+ "name": "disabled",
1909
+ "type": "boolean",
1910
+ "required": false
1911
+ },
1912
+ {
1913
+ "name": "error",
1914
+ "type": "ReactNode",
1915
+ "required": false
1916
+ },
1917
+ {
1918
+ "name": "label",
1919
+ "type": "ReactNode",
1920
+ "required": true
1921
+ },
1922
+ {
1923
+ "name": "name",
1924
+ "type": "string",
1925
+ "required": false
1926
+ },
1927
+ {
1928
+ "name": "onValueChange",
1929
+ "type": "((value: string | null) => void)",
1930
+ "required": false
1931
+ },
1932
+ {
1933
+ "name": "options",
1934
+ "type": "readonly ListboxOption[]",
1935
+ "required": true
1936
+ },
1937
+ {
1938
+ "name": "placeholder",
1939
+ "type": "string",
1940
+ "required": false
1941
+ },
1942
+ {
1943
+ "name": "required",
1944
+ "type": "boolean",
1945
+ "required": false
1946
+ },
1947
+ {
1948
+ "name": "size",
1949
+ "type": "\"lg\" | \"med\" | \"sm\"",
1950
+ "required": false,
1951
+ "values": [
1952
+ "lg",
1953
+ "med",
1954
+ "sm"
1955
+ ]
1956
+ },
1957
+ {
1958
+ "name": "style",
1959
+ "type": "CSSProperties",
1960
+ "required": false
1961
+ },
1962
+ {
1963
+ "name": "value",
1964
+ "type": "string",
1965
+ "required": false
1966
+ }
1967
+ ],
1968
+ "parts": [],
1969
+ "exports": []
1970
+ },
1888
1971
  {
1889
1972
  "name": "Stack",
1890
1973
  "styleProps": true,
package/dist/index.d.mts CHANGED
@@ -23,6 +23,7 @@ import { MenuTriggerProps } from "./Menu/client.mjs";
23
23
  import { Menu, MenuGroupProps, MenuItemProps, MenuLinkItemProps, MenuPopupProps, MenuProps, MenuSeparatorProps } from "./Menu/index.mjs";
24
24
  import { MultiSelect, MultiSelectOption, MultiSelectProps } from "./MultiSelect/index.mjs";
25
25
  import { RadioGroup, RadioGroupOption, RadioGroupProps } from "./RadioGroup/index.mjs";
26
+ import { Select, SelectOption, SelectProps } from "./Select/index.mjs";
26
27
  import { Stack, StackProps } from "./Stack/index.mjs";
27
28
  import { Switch, SwitchProps } from "./Switch/index.mjs";
28
29
  import { Table, TableBodyProps, TableCellProps, TableColumnGroupProps, TableColumnProps, TableFootProps, TableHeadProps, TableHeaderCellProps, TableProps, TableRowProps, TableSortDirection } from "./Table/index.mjs";
@@ -35,4 +36,4 @@ import { Toast } from "./Toast/index.mjs";
35
36
  import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/index.mjs";
36
37
  import { Theme, defineTheme } from "./theme/define-theme.mjs";
37
38
  import { ThemeProvider, ThemeProviderProps } from "./theme/ThemeProvider.mjs";
38
- export { AlertDialog, type AlertDialogProps, type AlertDialogTriggerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Clickable, type ClickableProps, ColorField, type ColorFieldInputProps, type ColorFieldProps, Dialog, type DialogActionsProps, type DialogBodyProps, type DialogCloseProps, type DialogPopupProps, type DialogProps, type DialogTriggerProps, Field, type FieldDescriptionProps, type FieldErrorProps, type FieldLabelProps, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Icon, IconButton, type IconButtonProps, type IconProps, Inline, type InlineProps, Menu, type MenuGroupProps, type MenuItemProps, type MenuLinkItemProps, type MenuPopupProps, type MenuProps, type MenuSeparatorProps, type MenuTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, SearchField, type SearchFieldInputProps, type SearchFieldProps, Stack, type StackProps, type StyleProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnGroupProps, type TableColumnProps, type TableFootProps, type TableHeadProps, type TableHeaderCellProps, type TableProps, type TableRowProps, type TableSortDirection, Tabs, type TabsListProps, type TabsPanelProps, type TabsProps, type TabsTabProps, Tag, type TagProps, Text, TextField, type TextFieldInputProps, type TextFieldProps, type TextProps, Textarea, type TextareaInputProps, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, type ToastOptions, type ToastProviderProps, type ToastVariant, VisuallyHidden, type VisuallyHiddenProps, defineTheme, useToast };
39
+ export { AlertDialog, type AlertDialogProps, type AlertDialogTriggerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Clickable, type ClickableProps, ColorField, type ColorFieldInputProps, type ColorFieldProps, Dialog, type DialogActionsProps, type DialogBodyProps, type DialogCloseProps, type DialogPopupProps, type DialogProps, type DialogTriggerProps, Field, type FieldDescriptionProps, type FieldErrorProps, type FieldLabelProps, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Icon, IconButton, type IconButtonProps, type IconProps, Inline, type InlineProps, Menu, type MenuGroupProps, type MenuItemProps, type MenuLinkItemProps, type MenuPopupProps, type MenuProps, type MenuSeparatorProps, type MenuTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, SearchField, type SearchFieldInputProps, type SearchFieldProps, Select, type SelectOption, type SelectProps, Stack, type StackProps, type StyleProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnGroupProps, type TableColumnProps, type TableFootProps, type TableHeadProps, type TableHeaderCellProps, type TableProps, type TableRowProps, type TableSortDirection, Tabs, type TabsListProps, type TabsPanelProps, type TabsProps, type TabsTabProps, Tag, type TagProps, Text, TextField, type TextFieldInputProps, type TextFieldProps, type TextProps, Textarea, type TextareaInputProps, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, type ToastOptions, type ToastProviderProps, type ToastVariant, VisuallyHidden, type VisuallyHiddenProps, defineTheme, useToast };
package/dist/index.mjs CHANGED
@@ -18,16 +18,17 @@ import { Menu as _ } from "./Menu/index.mjs";
18
18
  import { MultiSelect as v } from "./MultiSelect/index.mjs";
19
19
  import { RadioGroup as y } from "./RadioGroup/index.mjs";
20
20
  import { SearchField as b } from "./SearchField/index.mjs";
21
- import { Stack as x } from "./Stack/index.mjs";
22
- import { Switch as S } from "./Switch/index.mjs";
23
- import { VisuallyHidden as C } from "./VisuallyHidden/index.mjs";
24
- import { Table as w } from "./Table/index.mjs";
25
- import { Tabs as T } from "./Tabs/index.mjs";
26
- import { Tag as E } from "./Tag/index.mjs";
27
- import { Textarea as D } from "./Textarea/index.mjs";
28
- import { TextField as O } from "./TextField/index.mjs";
29
- import { defineTheme as k } from "./theme/define-theme.mjs";
30
- import { ThemeProvider as A } from "./theme/ThemeProvider.mjs";
31
- import { useToast as j } from "./Toast/client.mjs";
32
- import { Toast as M } from "./Toast/index.mjs";
33
- export { o as AlertDialog, s as Avatar, c as Badge, l as Box, r as Button, u as Checkbox, d as Chip, f as ChipGroup, e as Clickable, m as ColorField, a as Dialog, p as Field, i as Heading, t as Icon, h as IconButton, g as Inline, _ as Menu, v as MultiSelect, y as RadioGroup, b as SearchField, x as Stack, S as Switch, w as Table, T as Tabs, E as Tag, n as Text, O as TextField, D as Textarea, A as ThemeProvider, M as Toast, C as VisuallyHidden, k as defineTheme, j as useToast };
21
+ import { Select as x } from "./Select/index.mjs";
22
+ import { Stack as S } from "./Stack/index.mjs";
23
+ import { Switch as C } from "./Switch/index.mjs";
24
+ import { VisuallyHidden as w } from "./VisuallyHidden/index.mjs";
25
+ import { Table as T } from "./Table/index.mjs";
26
+ import { Tabs as E } from "./Tabs/index.mjs";
27
+ import { Tag as D } from "./Tag/index.mjs";
28
+ import { Textarea as O } from "./Textarea/index.mjs";
29
+ import { TextField as k } from "./TextField/index.mjs";
30
+ import { defineTheme as A } from "./theme/define-theme.mjs";
31
+ import { ThemeProvider as j } from "./theme/ThemeProvider.mjs";
32
+ import { useToast as M } from "./Toast/client.mjs";
33
+ import { Toast as N } from "./Toast/index.mjs";
34
+ export { o as AlertDialog, s as Avatar, c as Badge, l as Box, r as Button, u as Checkbox, d as Chip, f as ChipGroup, e as Clickable, m as ColorField, a as Dialog, p as Field, i as Heading, t as Icon, h as IconButton, g as Inline, _ as Menu, v as MultiSelect, y as RadioGroup, b as SearchField, x as Select, S as Stack, C as Switch, T as Table, E as Tabs, D as Tag, n as Text, k as TextField, O as Textarea, j as ThemeProvider, N as Toast, w as VisuallyHidden, A as defineTheme, M as useToast };
@@ -0,0 +1,5 @@
1
+ export type ListboxOption = {
2
+ disabled?: boolean;
3
+ label: string;
4
+ value: string;
5
+ };
@@ -0,0 +1,35 @@
1
+ import { Box as e } from "../Box/base.mjs";
2
+ import { Text as t } from "../Text/index.mjs";
3
+ import { CheckIcon as n } from "../icons/CheckIcon.mjs";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { Select as a } from "@base-ui/react/select";
6
+ // src/popup/listbox-options.tsx
7
+ function o({ checkClassName: o, itemClassName: s, options: c }) {
8
+ return c.map((c) => /* @__PURE__ */ i(a.Item, {
9
+ disabled: c.disabled,
10
+ label: c.label,
11
+ render: /* @__PURE__ */ r(e, {
12
+ alignItems: "center",
13
+ borderRadius: "sm",
14
+ className: s,
15
+ display: "flex",
16
+ gap: "8",
17
+ justifyContent: "space-between",
18
+ minBlockSize: "sm",
19
+ paddingInline: "12"
20
+ }),
21
+ value: c.value,
22
+ children: [/* @__PURE__ */ r(a.ItemText, {
23
+ render: /* @__PURE__ */ r(t, {
24
+ as: "span",
25
+ font: "label",
26
+ size: "sm"
27
+ }),
28
+ children: c.label
29
+ }), /* @__PURE__ */ r(n, {
30
+ className: o,
31
+ size: "sm"
32
+ })]
33
+ }, c.value));
34
+ }
35
+ export { o as ListboxOptions };
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ import { splitStyleProps as e } from "../styles/split-style-props.mjs";
3
+ import { Box as t } from "../Box/base.mjs";
4
+ import { PopupScope as n, triggerElement as r, useClosingRule as i, usePopupScope as a } from "./client.mjs";
5
+ import { Field as o } from "../Field/index.mjs";
6
+ import { ChevronDownIcon as s } from "../icons/ChevronDownIcon.mjs";
7
+ import { createContext as c, use as l, useId as u } from "react";
8
+ import { jsx as d } from "react/jsx-runtime";
9
+ import { Select as f } from "@base-ui/react/select";
10
+ // src/popup/listbox.tsx
11
+ var p = c(void 0);
12
+ function m({ children: e }) {
13
+ return /* @__PURE__ */ d(n, { children: /* @__PURE__ */ d(p, {
14
+ value: u(),
15
+ children: e
16
+ }) });
17
+ }
18
+ function h({ children: e }) {
19
+ return /* @__PURE__ */ d(o.Label, {
20
+ id: l(p),
21
+ nativeLabel: !1,
22
+ children: e
23
+ });
24
+ }
25
+ function g({ children: e, className: t, disabled: n, size: i }) {
26
+ let { ref: o } = a();
27
+ return /* @__PURE__ */ d(f.Trigger, {
28
+ disabled: n,
29
+ ref: o,
30
+ render: r({
31
+ variant: "secondary",
32
+ size: i,
33
+ backgroundColor: "bg",
34
+ borderRadius: "med",
35
+ color: "fg",
36
+ iconEnd: s,
37
+ className: t,
38
+ children: e
39
+ })
40
+ });
41
+ }
42
+ function _({ children: e, className: n }) {
43
+ return /* @__PURE__ */ d(f.Popup, {
44
+ "aria-labelledby": l(p),
45
+ render: /* @__PURE__ */ d(t, {
46
+ backgroundColor: "bgRaised",
47
+ borderRadius: "med",
48
+ boxShadow: "med",
49
+ className: n,
50
+ padding: "4"
51
+ }),
52
+ children: e
53
+ });
54
+ }
55
+ function v({ children: e }) {
56
+ let { container: t } = a();
57
+ return /* @__PURE__ */ d(f.Portal, {
58
+ container: t,
59
+ children: e
60
+ });
61
+ }
62
+ function y({ children: t }) {
63
+ return /* @__PURE__ */ d(f.Positioner, {
64
+ align: "start",
65
+ alignItemWithTrigger: !1,
66
+ collisionPadding: 8,
67
+ render: (t, { open: n }) => {
68
+ let [, r] = e(t);
69
+ return /* @__PURE__ */ d(b, {
70
+ ...r,
71
+ open: n
72
+ });
73
+ },
74
+ side: "bottom",
75
+ sideOffset: 4,
76
+ children: t
77
+ });
78
+ }
79
+ function b({ open: e, ref: n, ...r }) {
80
+ return /* @__PURE__ */ d(t, {
81
+ ...r,
82
+ ...i(n, {
83
+ finalFocus: !1,
84
+ open: e
85
+ }),
86
+ zIndex: "popover"
87
+ });
88
+ }
89
+ export { h as ListboxLabel, _ as ListboxPopup, v as ListboxPortal, y as ListboxPositioner, m as ListboxScope, g as ListboxTrigger };