@jonmilner/ui 0.15.1 → 0.16.1

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 (61) 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/Combobox/Combobox.css +2 -2
  10. package/dist/Dialog/Dialog.css +1 -1
  11. package/dist/Field/Field.css +1 -1
  12. package/dist/Heading/Heading.css +1 -1
  13. package/dist/Icon/Icon.css +1 -1
  14. package/dist/IconButton/IconButton.css +1 -1
  15. package/dist/Inline/Inline.css +1 -1
  16. package/dist/Menu/Menu.css +1 -1
  17. package/dist/MultiSelect/MultiSelect.css +2 -2
  18. package/dist/NavList/NavList.css +1 -1
  19. package/dist/NumberField/NumberField.css +2 -0
  20. package/dist/NumberField/NumberField.css.mjs +17 -0
  21. package/dist/NumberField/index.d.mts +28 -0
  22. package/dist/NumberField/index.mjs +78 -0
  23. package/dist/RadioGroup/RadioGroup.css +1 -1
  24. package/dist/SearchField/SearchField.css +1 -1
  25. package/dist/SearchField/client.mjs +21 -26
  26. package/dist/Select/Select.css +1 -1
  27. package/dist/Sidebar/Sidebar.css +1 -1
  28. package/dist/SidebarLayout/SidebarLayout.css +1 -1
  29. package/dist/Stack/Stack.css +1 -1
  30. package/dist/Switch/Switch.css +1 -1
  31. package/dist/Table/Table.css +1 -1
  32. package/dist/Tabs/Tabs.css +1 -1
  33. package/dist/Tag/Tag.css +1 -1
  34. package/dist/Text/Text.css +2 -2
  35. package/dist/Text/Text.css.mjs +30 -30
  36. package/dist/Text/index.mjs +5 -4
  37. package/dist/TextField/TextField.css +1 -1
  38. package/dist/Textarea/Textarea.css +1 -1
  39. package/dist/Toast/Toast.css +1 -1
  40. package/dist/Tooltip/Tooltip.css +1 -1
  41. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  42. package/dist/base.css +1 -1
  43. package/dist/docs/Field.md +1 -1
  44. package/dist/docs/Icon.md +1 -0
  45. package/dist/docs/NumberField.md +105 -0
  46. package/dist/docs/Text.md +8 -7
  47. package/dist/docs/TextField.md +1 -1
  48. package/dist/docs/llms.txt +2 -1
  49. package/dist/docs/manifest.json +115 -1
  50. package/dist/docs/migrations/0.16.0.md +57 -0
  51. package/dist/icons/MinusIcon.d.mts +2 -0
  52. package/dist/icons/MinusIcon.mjs +10 -0
  53. package/dist/icons/index.d.mts +3 -2
  54. package/dist/icons/index.mjs +31 -30
  55. package/dist/index.d.mts +2 -1
  56. package/dist/index.mjs +20 -19
  57. package/dist/styles/atoms.css +1 -1
  58. package/dist/styles/control-size.mjs +5 -1
  59. package/dist/styles/layers.css +1 -1
  60. package/dist/styles/responsive.css +1 -1
  61. package/package.json +8 -2
@@ -3,35 +3,35 @@ import "./Text.css";
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  // src/Text/Text.css.ts
6
- var e = "_1mgdisq4", t = "_1mgdisq5", n = "_1mgdisq6", r = {
7
- body: "_1mgdisq7",
8
- heading: "_1mgdisq8",
9
- display: "_1mgdisq9",
10
- label: "_1mgdisqa",
11
- mono: "_1mgdisqb"
12
- }, i = {
13
- xs: "_1mgdisqc",
14
- sm: "_1mgdisqd",
15
- med: "_1mgdisqe",
16
- lg: "_1mgdisqf",
17
- xl: "_1mgdisqg",
18
- "2xl": "_1mgdisqh",
19
- "3xl": "_1mgdisqi",
20
- "4xl": "_1mgdisqj"
6
+ var e = "_1mgdisq4", t = "_1mgdisq5", n = "_1mgdisq6", r = "_1mgdisq7", i = {
7
+ body: "_1mgdisq8",
8
+ heading: "_1mgdisq9",
9
+ display: "_1mgdisqa",
10
+ label: "_1mgdisqb",
11
+ mono: "_1mgdisqc"
21
12
  }, a = {
22
- regular: "_1mgdisqk",
23
- medium: "_1mgdisql",
24
- semibold: "_1mgdisqm",
25
- bold: "_1mgdisqn"
13
+ xs: "_1mgdisqd",
14
+ sm: "_1mgdisqe",
15
+ med: "_1mgdisqf",
16
+ lg: "_1mgdisqg",
17
+ xl: "_1mgdisqh",
18
+ "2xl": "_1mgdisqi",
19
+ "3xl": "_1mgdisqj",
20
+ "4xl": "_1mgdisqk"
26
21
  }, o = {
27
- sm: "_1mgdisqo",
28
- meta: "_1mgdisqp",
29
- body: "_1mgdisqq",
30
- med: "_1mgdisqr",
31
- lg: "_1mgdisqs"
32
- }, s = "_1mgdisqt", c = {
33
- nowrap: "_1mgdisqu",
34
- "pre-wrap": "_1mgdisqv",
35
- pre: "_1mgdisqw"
36
- }, l = "_1mgdisqx";
37
- export { t as block, r as font, o as leading, e as root, i as size, s as tabularNums, l as truncate, n as truncateBox, a as weight, c as wrap };
22
+ regular: "_1mgdisql",
23
+ medium: "_1mgdisqm",
24
+ semibold: "_1mgdisqn",
25
+ bold: "_1mgdisqo"
26
+ }, s = {
27
+ sm: "_1mgdisqp",
28
+ meta: "_1mgdisqq",
29
+ body: "_1mgdisqr",
30
+ med: "_1mgdisqs",
31
+ lg: "_1mgdisqt"
32
+ }, c = "_1mgdisqu", l = {
33
+ nowrap: "_1mgdisqv",
34
+ "pre-wrap": "_1mgdisqw",
35
+ pre: "_1mgdisqx"
36
+ }, u = "_1mgdisqy";
37
+ export { t as block, i as font, s as leading, e as root, n as scrollContainer, a as size, c as tabularNums, u as truncate, r as truncateBox, o as weight, l as wrap };
@@ -3,18 +3,19 @@ import { Box as t } from "../Box/base.mjs";
3
3
  import { font as n, leading as r, root as i, size as a, weight as o, wrap as s } from "./Text.css.mjs";
4
4
  import { jsx as c } from "react/jsx-runtime";
5
5
  // src/Text/index.tsx
6
- function l({ as: l, size: u, font: d, weight: f, leading: p, tabularNums: m, truncate: h, wrap: g, display: _ = "block", overflow: v = h ? "hidden" : void 0, className: y, ...b }) {
6
+ function l({ as: l, size: u, font: d, weight: f, leading: p, tabularNums: m, truncate: h, wrap: g, display: _ = "block", overflow: v = h ? "clip" : void 0, className: y, ...b }) {
7
7
  let x = [
8
8
  i,
9
9
  _ === "block" && "_1mgdisq5",
10
- h === "box" && "_1mgdisq6",
10
+ h === "box" && "_1mgdisq7",
11
+ h !== "box" && (v === "hidden" || v === "auto") && "_1mgdisq6",
11
12
  d && n[d],
12
13
  u && a[u],
13
14
  f && o[f],
14
15
  p && r[p],
15
- m && "_1mgdisqt",
16
+ m && "_1mgdisqu",
16
17
  g && !h && s[g],
17
- h === !0 && "_1mgdisqx",
18
+ h === !0 && "_1mgdisqy",
18
19
  y
19
20
  ];
20
21
  return /* @__PURE__ */ c(t, {
@@ -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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, components.visually-hidden, components.table;
2
2
  @layer components.tooltip{.ivrt881{border:var(--space-1) solid var(--color-border);max-inline-size:var(--available-width);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter)}.ivrt881[data-starting-style],.ivrt881[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}.ivrt881[data-instant]{transition:none}}
@@ -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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, 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.tooltip, components.nav-list, 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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.nav-list, 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-sidebar:15rem;--container-rail: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-meta:1.3334;--line-height-body:1.4286;--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% .006 265),oklch(27% .006 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .006 265));--color-bg-panel:light-dark(oklch(98.5% .006 265),oklch(17.7% .006 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .006 265));--color-fg-muted:light-dark(oklch(44.5% .006 265),oklch(71% .006 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .006 265));--color-border-strong:oklch(55.5% .006 265);--color-hover:light-dark(oklch(14.5% .006 265/.04),oklch(98.5% .006 265/.04));--color-control-fill:light-dark(oklch(14.5% .006 265/.05),oklch(98.5% .006 265/.05));--color-selected:light-dark(oklch(14.5% .006 265/.07),oklch(98.5% .006 265/.07));--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% .006 265),oklch(27% .006 265));--color-neutral-subtle-fg:light-dark(oklch(37% .006 265),oklch(87% .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;--font-tracking-body:-.006em;--font-tracking-heading:-.006em;--font-tracking-display:-.006em;--font-tracking-label:-.006em;--font-tracking-mono:normal;--font-features-body:"cv11", "ss03";--font-features-heading:"cv11", "ss03";--font-features-display:"cv11", "ss03";--font-features-label:"cv11", "ss03";--font-features-mono:normal}@media (forced-colors:active){[data-brand][data-brand]{--color-bg:Canvas;--color-bg-muted:Canvas;--color-bg-raised:Canvas;--color-bg-panel:Canvas;--color-fg:CanvasText;--color-fg-muted:CanvasText;--color-border:CanvasText;--color-border-strong:CanvasText;--color-hover:Highlight;--color-control-fill:ButtonFace;--color-selected:Highlight;--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}}}
@@ -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 one or several values from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField`, `Select` or `MultiSelect`, which build on this Field.
17
+ - A single line of text, several lines, a search, a colour, a bounded number, or one or several values from a list: use `TextField`, `Textarea`, `SearchField`, `ColorField`, `NumberField`, `Select` or `MultiSelect`, which build on this Field.
18
18
 
19
19
  ## Rules
20
20
 
package/dist/docs/Icon.md CHANGED
@@ -92,6 +92,7 @@ Generated from `src/icons/svg/` and exported from `@jonmilner/ui/icons`; each ta
92
92
  - `InfoIcon` (`info.svg`)
93
93
  - `LoaderCircleIcon` (`loader-circle.svg`)
94
94
  - `LockOpenIcon` (`lock-open.svg`)
95
+ - `MinusIcon` (`minus.svg`)
95
96
  - `PanelLeftCloseIcon` (`panel-left-close.svg`)
96
97
  - `PanelLeftOpenIcon` (`panel-left-open.svg`)
97
98
  - `PencilIcon` (`pencil.svg`)
@@ -0,0 +1,105 @@
1
+ # NumberField
2
+
3
+ ## Purpose
4
+
5
+ A form field for a bounded number: a text input between a decrement button (inline start) and an increment button (inline end), with the number centred between them. Built on Base UI's `NumberField` (ADR 0003, 0161); 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 input fills the Field's width.
6
+
7
+ ## When to use
8
+
9
+ - A small count with a known range that the user nudges up or down: a cap (1 to 20), a number of slots (1 to 10), a retry limit, a quantity.
10
+ - A settings form whose fields line up with a `TextField` or `Select`: they share the heights and the border.
11
+
12
+ ## When not to use
13
+
14
+ - Free text, or a number nobody steps (a phone number, a postcode, an account number, a year typed in full): use `TextField` with `inputMode` in `inputProps`.
15
+ - One of a few named options ("Low", "Medium", "High"), or a fixed list of values: use `Select` or `RadioGroup`.
16
+ - A value picked by dragging along a range: a slider is not in the library.
17
+ - Money or a percentage that needs a formatter: NumberField shows a plain number.
18
+
19
+ ## Rules
20
+
21
+ - `label` is required and names the input, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight. Never pass an empty label, and never let `placeholder` stand in for one.
22
+ - `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. `onValueChange` gets the number, or `null` when the input is emptied.
23
+ - `min` and `max` bound the value. The buttons and the arrow keys stop at them, and each button is disabled at its bound. A typed value outside them is clamped as it is typed: `onValueChange` gets the bound at once, and the input shows it when it loses focus.
24
+ - `step` (default 1) is how far a button press or an arrow key moves the value; Shift with an arrow moves ten steps, and Home and End jump to `min` and `max` when they are set. A whole-number `step` keeps the value whole: a typed fraction rounds to the nearest whole number.
25
+ - With a `name` and a `step` above 1, keep `max` a whole number of steps from `min` (`min={5} max={50} step={5}`, not `min={1} max={20} step={5}`): the submitted input checks the value against the steps, and a value between them, the clamped `max` included, blocks the form's submission. A typed value is kept as typed, not snapped to a step: with `min={5} step={5}`, a typed 7 stays 7 and blocks submission until the user steps or retypes it.
26
+ - `description` and `error` render below the input through `Field`; a non-empty `error` marks the field invalid (`aria-invalid`, a danger border) and joins the input's `aria-describedby`.
27
+ - `disabled` disables the input and both buttons: the input leaves the tab order and does not submit, with a dashed border. `required` sets the native `required` on the submitted input.
28
+ - `name` submits the number with its form, through a hidden native number input that carries the bounds and step.
29
+ - `incrementLabel` and `decrementLabel` name the buttons ("Increase" and "Decrease"); pass translated strings in another language.
30
+ - Style props, `className` and `style` go to the `Field` around the label, control and messages, not to the input.
31
+ - `inputProps` reach the input: `ref`, `id`, `autoFocus`, `enterKeyHint`, `onKeyDown`, and only the `aria-*` valid on a text box that Base UI does not set (ADR 0110, 0154): `aria-controls`, `aria-details`, `aria-keyshortcuts`, `aria-owns`, `aria-flowto`, `aria-current`, `aria-busy`, `aria-live`, `aria-atomic` and `aria-relevant`. Base UI sets `inputMode`, `autoComplete`, `spellCheck` and `aria-roledescription`, and filters the characters typed, so those and `maxLength` are not among them; `min`, `max` and `step` are the field's own props. The type closes the set; nothing strips another prop at runtime.
32
+ - A consumer `onKeyDown` runs before the field's own arrow-key stepping.
33
+ - A consumer `ref` gets the input. A consumer `id` takes over from Field's generated one at hydration, and the label follows it.
34
+ - The module has no hooks, so a server component can render it; `onValueChange`, and an `inputProps` `ref` or `onKeyDown`, must come from a client component.
35
+
36
+ ## Do
37
+
38
+ ```tsx
39
+ <NumberField label="Attention cap" name="attentionCap" min={1} max={20} defaultValue={5} />
40
+ ```
41
+
42
+ ```tsx
43
+ <NumberField
44
+ label="Session slots"
45
+ description="How many sessions run at once."
46
+ min={1}
47
+ max={10}
48
+ value={slots}
49
+ onValueChange={(next) => setSlots(next ?? 1)}
50
+ />
51
+ ```
52
+
53
+ ## Don't
54
+
55
+ ```tsx
56
+ // A number nobody steps: a postcode or phone number is text.
57
+ <NumberField label="Phone" />
58
+ ```
59
+
60
+ ```tsx
61
+ // Named options: pick them from a list.
62
+ <NumberField label="Priority" min={1} max={3} />
63
+ ```
64
+
65
+ ```tsx
66
+ // No bounds on a count that has them: the buttons never disable and any value submits.
67
+ <NumberField label="Session slots" />
68
+ ```
69
+
70
+ ## Accessibility
71
+
72
+ - The input is a text box named by its label, announced as a "Number field" (`aria-roledescription`), with a numeric keypad on touch devices. On iOS Base UI asks for the decimal pad when `min` is 0 or more, and the full keyboard otherwise, since neither iOS pad has a minus key. Base UI does not give it the `spinbutton` role (ADR 0161); the arrow keys still step it.
73
+ - The buttons are named "Decrease" and "Increase", are out of the tab order (the arrow keys do their job) and keep focus in the input when pressed. At a bound the button is `aria-disabled` and takes IconButton's disabled look, a dashed border on a muted fill, so the state is not colour alone.
74
+ - Every size is at least 24 px tall, and at `sm` each button is a 24 px square target. Invalid adds a danger border and the error message with its icon, never colour alone; disabled adds a dashed border. Under forced colors the border, text, buttons and disabled state use system colors. On a coarse pointer the input text is 16px at every size, so iOS Safari does not zoom the page when the field takes focus.
75
+
76
+ ## Props
77
+
78
+ Generated from the TypeScript types.
79
+
80
+ ### NumberField
81
+
82
+ | Prop | Type | Required | Description |
83
+ | --- | --- | --- | --- |
84
+ | `className` | `string` | no | |
85
+ | `decrementLabel` | `string` | no | |
86
+ | `defaultValue` | `number` | no | |
87
+ | `description` | `ReactNode` | no | |
88
+ | `disabled` | `boolean` | no | |
89
+ | `error` | `ReactNode` | no | |
90
+ | `hideLabel` | `boolean` | no | |
91
+ | `incrementLabel` | `string` | no | |
92
+ | `inputProps` | `NumberFieldInputProps` | no | |
93
+ | `label` | `ReactNode` | yes | |
94
+ | `max` | `number` | no | |
95
+ | `min` | `number` | no | |
96
+ | `name` | `string` | no | |
97
+ | `onValueChange` | `((value: number \| null) => void)` | no | |
98
+ | `placeholder` | `string` | no | |
99
+ | `required` | `boolean` | no | |
100
+ | `size` | `"lg" \| "med" \| "sm"` | no | |
101
+ | `step` | `number` | no | |
102
+ | `style` | `CSSProperties` | no | |
103
+ | `value` | `number` | no | |
104
+
105
+ Also accepts the style props (see `manifest.json` `styleProps`).
package/dist/docs/Text.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
5
+ The base of all visible text, and the primitive every text component builds on. Its box is trimmed to the cap height and the baseline, so the gap around text is the visible space and text sits centred in a padded control. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
6
6
 
7
7
  ## When to use
8
8
 
@@ -20,7 +20,7 @@ The base of all visible text, and the primitive every text component builds on.
20
20
  - `as` defaults to `p`, so a run inside a paragraph must set an inline element: `as="span"`, `"strong"`, `"em"`, `"code"`, `"time"`. A `p` inside a `p` is invalid HTML and breaks hydration.
21
21
  - A run inherits the outer weight, so `<Text as="strong">` is not bold until it sets `weight="bold"` (or `semibold`).
22
22
  - A run is inline whatever its `display` prop, and `truncate` gives it no ellipsis; truncate a block Text instead.
23
- - `display="flex"` or `"grid"` makes the trim pseudo-elements flex or grid items, so `gap` adds space around them; wrap the text in a Box for layout instead. A block element (`p`, `div`, `h2`) or a Text inside a `Box` inside a Text keeps its own trimmed box.
23
+ - Do not set `display="flex"` or `"grid"`: natively the box is not trimmed, and on the fallback the trim pseudo-elements become flex or grid items that `gap` spaces. Wrap the text in a Box for layout instead. A block element (`p`, `div`, `h2`) or a Text inside a `Box` inside a Text keeps its own trimmed box.
24
24
  - `size` takes a `fontSize` step: `xs`, `sm`, `med`, `lg`, `xl`, `2xl`, `3xl`, `4xl`. The top-level default is `med`.
25
25
  - `font` takes a font role: `body` (default), `heading`, `display`, `label`, `mono`. The brand maps roles to fonts.
26
26
  - `weight` takes `regular` (default), `medium`, `semibold` or `bold`.
@@ -28,16 +28,17 @@ The base of all visible text, and the primitive every text component builds on.
28
28
  - `font` also sets the brand's tracking and font features for the role (the `default` brand tightens Inter by `-0.006em` and turns on `cv11` and `ss03`); a run inherits the outer Text's.
29
29
  - `tabularNums` gives every digit the same width, so figures in a column or a ticking count line up: amounts, durations, counts in a table. Prose numbers keep the font's own figures.
30
30
  - `color` takes a color role (`fg`, `fgMuted`, `accent`, …), never a raw color. Unset, it inherits.
31
- - `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It sets the block margins, so do not combine it with margin props.
32
- - `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run.
31
+ - `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It clips with `overflow: clip` and a zero minimum size, so it shrinks in a flex or grid row; that minimum beats a `minInlineSize` or `minBlockSize` prop, so put a minimum on a wrapping Box. It sets the block margins, so do not combine it with margin props.
32
+ - `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run. A block one is a line of the outer Text like any other, so the outer trim cuts it where it is the first or last line; it clips only across, so no glyph is cut. Put it directly in the outer Text or in a block, not in an inline element (Safari trims a block inside an inline wrongly) nor a grid or flex item (where `text-box` is supported, the outer trim does not reach one, so its line stays untrimmed).
33
33
  - `wrap="nowrap"` keeps the text on one line, uncut: a short label that must never break. A long string overflows its box, so cap it with `truncate` instead.
34
34
  - `wrap="pre-wrap"` keeps newlines and runs of spaces and wraps, breaking a long unbroken string (a path, a URL, a hash) anywhere so it stays in its box: logs, commit messages, user-entered text.
35
- - `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Text is not a scroll container; where the box cannot grow, use `pre-wrap`.
35
+ - `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Where the box cannot grow, use `pre-wrap`.
36
36
  - `truncate` wins over `wrap`: a Text with both keeps one line, collapses whitespace and ignores `wrap`.
37
37
  - Plain wrapped text with a long unbroken string and no whitespace to keep has no `wrap` value; its component sets `overflow-wrap` in its own styles.
38
38
  - A list item's text is a Text directly inside the `li`: `<li><Text>…</Text></li>`. At its default `display`, that Text keeps the marker on its first line at the trimmed height; with another `display` it does not. Do not render the Text as the `li` itself. Trimmed items touch, so space them with the list's `gap`: `<Stack as="ul" gap="8">`. The marker takes the body font, whatever the `li` or the Text's `font` sets; to change it, style `li::marker`.
39
- - The trim is two pseudo-elements; do not style `::before` or `::after` on a Text.
40
- - No native `text-box`; capsize only (ADR 0016).
39
+ - The trim has two paths (ADR 0160). Where the browser supports `text-box: trim-both cap alphabetic`, Text uses it, exact at the engine's own glyph positions. Elsewhere capsize trims with two pseudo-elements from the brand's font metrics, which can sit up to 0.8px off centre. Both give the same box height, so layout does not change between them.
40
+ - Do not style `::before` or `::after` on a Text: the fallback path uses them.
41
+ - To clip a Text, use `truncate` or `overflow="clip"`. At `overflow="hidden"` or `"auto"` it is a scroll container, which Firefox does not trim natively, so Text trims it with the pseudo-elements on both paths; set those through the `overflow` prop, never a class or `style`.
41
42
 
42
43
  ## Do
43
44
 
@@ -13,7 +13,7 @@ A form field for one line of text that is not a search: an `<input>` (role `text
13
13
 
14
14
  - A query that searches or filters: use `SearchField`; it is announced as a search and has a clear button.
15
15
  - Several lines of text (a reply, a note, a description): use `Textarea`.
16
- - A number with steppers or a range: a number field is not planned (ADR 0133); use `TextField` with `inputMode` in `inputProps` and validate in the app.
16
+ - A bounded number the user steps up or down (a cap, a count, a quantity): use `NumberField`. A number nobody steps (a postcode, a phone number) stays a `TextField` with `inputMode` in `inputProps`.
17
17
  - Picking from a known list as the user types: use `Combobox`.
18
18
  - Picking one or several values from a list: use `MultiSelect` or `ChipGroup`.
19
19
  - A colour: use `ColorField`; it pairs the hex with the browser's colour picker.
@@ -30,6 +30,7 @@
30
30
  - [Menu](Menu.md): A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a toolbar's overflow. It may mix in links ("Open invoice", "Download PDF") as `Menu.LinkItem`, real anchors that keep the browser's link behavior. Built on Base UI's Menu, which owns the keyboard and focus: arrow keys, Home and End move through the items, typing jumps to a matching item, Esc and an outside click close it, and focus returns to the trigger. The parts add the look: a raised surface with a border and shadow, a highlighted item, a zoom-and-fade that is a plain fade under reduced motion.
31
31
  - [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).
32
32
  - [NavList](NavList.md): A column of links to an app's pages, with the current page marked: a sidebar's or a settings page's navigation. The parts are `NavList` (a named `nav` around a list), `NavList.Group` (a heading over a run of items) and `NavList.Item` (one link, with an optional leading icon and trailing count). Items are links, not buttons: an `<a>` by default, or a router's `Link` through `as`, which keeps the router's props typed (ADR 0149). The app says which item is current; NavList reads nothing from the URL.
33
+ - [NumberField](NumberField.md): A form field for a bounded number: a text input between a decrement button (inline start) and an increment button (inline end), with the number centred between them. Built on Base UI's `NumberField` (ADR 0003, 0161); 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 input fills the Field's width.
33
34
  - [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).
34
35
  - [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`.
35
36
  - [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).
@@ -40,7 +41,7 @@
40
41
  - [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`), and `Table.ScrollArea` for a table wider than its container. 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.
41
42
  - [Tabs](Tabs.md): Switches between views that share one place on the page. The parts are `Tabs` (the root, a flex column; a row when vertical), `Tabs.List` (the `tablist`), `Tabs.Tab` (a `tab` button on `Clickable`) and `Tabs.Panel` (the `tabpanel`). Built on Base UI `Tabs` (ADR 0003, 0046): it owns the selection, one tab stop with arrow-key roving, `aria-selected`, and the ids that tie each tab to its panel. The selected tab shows an accent bar that fades and grows in (ADR 0049).
42
43
  - [Tag](Tag.md): A label that puts content in a category: a topic, a label, a user-made category. A `span` with a subtle tone fill (gray by default) and an `lg` radius (half a one-line tag's height, so one line reads as a pill and wrapped lines stay inside the fill) around a `Text` in the `label` font. It can be read-only, a link, or removable.
43
- - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
44
+ - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Its box is trimmed to the cap height and the baseline, so the gap around text is the visible space and text sits centred in a padded control. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
44
45
  - [TextField](TextField.md): A form field for one line of text that is not a search: an `<input>` (role `textbox`) with SearchField's look and no icon or button over it. `type` picks `text`, `email`, `url` or `tel`. Built on Base UI's `Input` (ADR 0003); it composes `Field` for its label, description and error (ADR 0026, 0110). Three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
45
46
  - [Textarea](Textarea.md): A form field for several lines of free text: a `<textarea>` (role `textbox`, multi-line) with TextField's look. Built on Base UI's `Input` rendered as a textarea (ADR 0003); it composes `Field` for its label, description and error (ADR 0026, 0136). `rows` sets its starting height, three by default, and the user can drag it taller or shorter. Three sizes (`sm`, `med`, `lg`) set TextField's text size and padding, so the first line sits where a TextField's text does (ADR 0124).
46
47
  - [Toast](Toast.md): Tells the user briefly about the result of an action without interrupting them: "Changes saved", "Message sent", "Couldn't upload the file". Material calls it a snackbar and Atlassian a flag. Built on Base UI's Toast, which owns the queue, the timers and swipe-to-dismiss. The parts add the look: a raised card in a stack at the bottom end corner, an icon per variant, a close button, and a slide-up-and-fade that is a plain fade under reduced motion. A toast never takes focus and moves nothing on the page.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.15.1",
4
+ "version": "0.16.1",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -1920,6 +1920,119 @@
1920
1920
  ],
1921
1921
  "exports": []
1922
1922
  },
1923
+ {
1924
+ "name": "NumberField",
1925
+ "styleProps": true,
1926
+ "props": [
1927
+ {
1928
+ "name": "className",
1929
+ "type": "string",
1930
+ "required": false
1931
+ },
1932
+ {
1933
+ "name": "decrementLabel",
1934
+ "type": "string",
1935
+ "required": false
1936
+ },
1937
+ {
1938
+ "name": "defaultValue",
1939
+ "type": "number",
1940
+ "required": false
1941
+ },
1942
+ {
1943
+ "name": "description",
1944
+ "type": "ReactNode",
1945
+ "required": false
1946
+ },
1947
+ {
1948
+ "name": "disabled",
1949
+ "type": "boolean",
1950
+ "required": false
1951
+ },
1952
+ {
1953
+ "name": "error",
1954
+ "type": "ReactNode",
1955
+ "required": false
1956
+ },
1957
+ {
1958
+ "name": "hideLabel",
1959
+ "type": "boolean",
1960
+ "required": false
1961
+ },
1962
+ {
1963
+ "name": "incrementLabel",
1964
+ "type": "string",
1965
+ "required": false
1966
+ },
1967
+ {
1968
+ "name": "inputProps",
1969
+ "type": "NumberFieldInputProps",
1970
+ "required": false
1971
+ },
1972
+ {
1973
+ "name": "label",
1974
+ "type": "ReactNode",
1975
+ "required": true
1976
+ },
1977
+ {
1978
+ "name": "max",
1979
+ "type": "number",
1980
+ "required": false
1981
+ },
1982
+ {
1983
+ "name": "min",
1984
+ "type": "number",
1985
+ "required": false
1986
+ },
1987
+ {
1988
+ "name": "name",
1989
+ "type": "string",
1990
+ "required": false
1991
+ },
1992
+ {
1993
+ "name": "onValueChange",
1994
+ "type": "((value: number | null) => void)",
1995
+ "required": false
1996
+ },
1997
+ {
1998
+ "name": "placeholder",
1999
+ "type": "string",
2000
+ "required": false
2001
+ },
2002
+ {
2003
+ "name": "required",
2004
+ "type": "boolean",
2005
+ "required": false
2006
+ },
2007
+ {
2008
+ "name": "size",
2009
+ "type": "\"lg\" | \"med\" | \"sm\"",
2010
+ "required": false,
2011
+ "values": [
2012
+ "lg",
2013
+ "med",
2014
+ "sm"
2015
+ ]
2016
+ },
2017
+ {
2018
+ "name": "step",
2019
+ "type": "number",
2020
+ "required": false
2021
+ },
2022
+ {
2023
+ "name": "style",
2024
+ "type": "CSSProperties",
2025
+ "required": false
2026
+ },
2027
+ {
2028
+ "name": "value",
2029
+ "type": "number",
2030
+ "required": false
2031
+ }
2032
+ ],
2033
+ "parts": [],
2034
+ "exports": []
2035
+ },
1923
2036
  {
1924
2037
  "name": "RadioGroup",
1925
2038
  "styleProps": true,
@@ -4144,6 +4257,7 @@
4144
4257
  "InfoIcon",
4145
4258
  "LoaderCircleIcon",
4146
4259
  "LockOpenIcon",
4260
+ "MinusIcon",
4147
4261
  "PanelLeftCloseIcon",
4148
4262
  "PanelLeftOpenIcon",
4149
4263
  "PencilIcon",
@@ -0,0 +1,57 @@
1
+ # 0.16.0
2
+
3
+ Text now trims with native `text-box: trim-both cap alphabetic` where the browser supports it and with capsize's `::before`/`::after` only where it does not (decision 0160), so labels sit exactly centred; `truncate` clips with `overflow: clip` instead of `hidden`. Most apps change nothing. The trim no longer reaches a flex or grid Text natively, a Text's pseudo-elements exist only on the fallback, and a Text placed inside an inline element mis-trims in WebKit.
4
+
5
+ ## Find
6
+
7
+ In the app's source (`*.tsx`):
8
+
9
+ - A Text laid out as a flex or grid container: regex `<(Text|Heading)\b[^>]*display=["{]["']?(inline-)?(flex|grid)`.
10
+ - A Text given a clipping overflow through a class or `style` instead of the `overflow` prop: regex `<(Text|Heading)\b[^>]*style=\{\{[^}]*overflow`.
11
+ - A truncating Text given a minimum size, which its own zero minimum now overrides: regex `<(Text|Heading)\b[^>]*\btruncate\b[^>]*min(Inline|Block)Size` and `<(Text|Heading)\b[^>]*min(Inline|Block)Size[^>]*\btruncate\b`.
12
+
13
+ In the app's styles (`*.css`, `*.css.ts`):
14
+
15
+ - Rules on a Text's pseudo-elements or its trim: regex `::?(before|after)|text-box`, kept where the selector targets a Text or Heading.
16
+
17
+ ## Replace
18
+
19
+ Move a flex or grid layout off the Text onto a Box around it:
20
+
21
+ ```tsx
22
+ // before
23
+ <Text display="flex" gap="1">
24
+ <CheckIcon /> Saved
25
+ </Text>
26
+ // after
27
+ <Box display="flex" gap="1">
28
+ <CheckIcon />
29
+ <Text>Saved</Text>
30
+ </Box>
31
+ ```
32
+
33
+ Pass a clipping or scrolling overflow as the prop, which keeps the trim in every engine:
34
+
35
+ ```tsx
36
+ // before
37
+ <Text style={{ overflow: "hidden" }}>{summary}</Text>
38
+ // after
39
+ <Text overflow="hidden">{summary}</Text>
40
+ ```
41
+
42
+ Move a truncating Text's minimum size onto a Box around it:
43
+
44
+ ```tsx
45
+ // before
46
+ <Text minInlineSize="xs" truncate>{name}</Text>
47
+ // after
48
+ <Box minInlineSize="xs">
49
+ <Text truncate>{name}</Text>
50
+ </Box>
51
+ ```
52
+
53
+ Delete styles on a Text's `::before` or `::after`, and any `text-box` override on a Text; put decoration on a wrapping Box instead.
54
+
55
+ ## Verify
56
+
57
+ The Find regexes match nothing. Then update the app's visual baselines: text moves by under a pixel inside padded controls (up to 0.8px in Chromium), and box heights stay the same.
@@ -0,0 +1,2 @@
1
+ import { IconProps } from "../Icon/index.mjs";
2
+ export declare function MinusIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Icon as e } from "../Icon/index.mjs";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/icons/MinusIcon.tsx
4
+ function n(n) {
5
+ return /* @__PURE__ */ t(e, {
6
+ ...n,
7
+ children: /* @__PURE__ */ t("path", { d: "M5 12h14" })
8
+ });
9
+ }
10
+ export { n as MinusIcon };
@@ -18,6 +18,7 @@ import { GitPullRequestIcon } from "./GitPullRequestIcon.mjs";
18
18
  import { InboxIcon } from "./InboxIcon.mjs";
19
19
  import { LoaderCircleIcon } from "./LoaderCircleIcon.mjs";
20
20
  import { LockOpenIcon } from "./LockOpenIcon.mjs";
21
+ import { MinusIcon } from "./MinusIcon.mjs";
21
22
  import { PanelLeftCloseIcon } from "./PanelLeftCloseIcon.mjs";
22
23
  import { PanelLeftOpenIcon } from "./PanelLeftOpenIcon.mjs";
23
24
  import { PencilIcon } from "./PencilIcon.mjs";
@@ -29,6 +30,6 @@ import { SearchIcon } from "./SearchIcon.mjs";
29
30
  import { SettingsIcon } from "./SettingsIcon.mjs";
30
31
  import { Trash2Icon } from "./Trash2Icon.mjs";
31
32
  import { XIcon } from "./XIcon.mjs";
32
- export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "XIcon"];
33
+ export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "MinusIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "XIcon"];
33
34
  export type IconName = (typeof iconNames)[number];
34
- export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, XIcon };
35
+ export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, MinusIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, XIcon };