@jonmilner/ui 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/Avatar/Avatar.css +1 -1
  2. package/dist/Badge/Badge.css +2 -2
  3. package/dist/Badge/Badge.css.mjs +6 -9
  4. package/dist/Badge/index.mjs +10 -3
  5. package/dist/Box/Box.css +1 -1
  6. package/dist/Button/Button.css +2 -2
  7. package/dist/Button/Button.css.mjs +1 -1
  8. package/dist/Button/index.d.mts +2 -1
  9. package/dist/Button/index.mjs +21 -21
  10. package/dist/Checkbox/Checkbox.css +1 -1
  11. package/dist/Chip/Chip.css +2 -2
  12. package/dist/Chip/Chip.css.mjs +7 -2
  13. package/dist/Chip/index.d.mts +3 -2
  14. package/dist/Chip/index.mjs +57 -39
  15. package/dist/Clickable/Clickable.css +1 -1
  16. package/dist/ColorField/ColorField.css +2 -2
  17. package/dist/ColorField/ColorField.css.mjs +28 -2
  18. package/dist/ColorField/client.d.mts +1 -1
  19. package/dist/ColorField/client.mjs +40 -35
  20. package/dist/ColorField/index.d.mts +3 -2
  21. package/dist/ColorField/index.mjs +39 -28
  22. package/dist/Combobox/Combobox.css +2 -2
  23. package/dist/Dialog/Dialog.css +1 -1
  24. package/dist/Field/Field.css +1 -1
  25. package/dist/Heading/Heading.css +1 -1
  26. package/dist/Icon/Icon.css +1 -1
  27. package/dist/IconButton/IconButton.css +2 -2
  28. package/dist/IconButton/IconButton.css.mjs +2 -2
  29. package/dist/IconButton/index.d.mts +1 -1
  30. package/dist/IconButton/index.mjs +5 -4
  31. package/dist/Inline/Inline.css +1 -1
  32. package/dist/Menu/Menu.css +2 -2
  33. package/dist/Menu/Menu.css.mjs +2 -2
  34. package/dist/Menu/client.d.mts +1 -0
  35. package/dist/Menu/client.mjs +45 -54
  36. package/dist/Menu/index.d.mts +5 -4
  37. package/dist/Menu/index.mjs +74 -85
  38. package/dist/Menu/item-row.mjs +52 -0
  39. package/dist/MultiSelect/MultiSelect.css +2 -2
  40. package/dist/MultiSelect/client.mjs +5 -4
  41. package/dist/MultiSelect/index.d.mts +3 -1
  42. package/dist/MultiSelect/index.mjs +16 -15
  43. package/dist/NavList/NavList.css +2 -2
  44. package/dist/NavList/NavList.css.mjs +2 -2
  45. package/dist/NavList/index.d.mts +3 -1
  46. package/dist/NavList/index.mjs +67 -63
  47. package/dist/NumberField/NumberField.css +1 -1
  48. package/dist/RadioGroup/RadioGroup.css +1 -1
  49. package/dist/SearchField/SearchField.css +2 -2
  50. package/dist/SearchField/SearchField.css.mjs +28 -11
  51. package/dist/SearchField/client.d.mts +1 -1
  52. package/dist/SearchField/client.mjs +27 -31
  53. package/dist/SearchField/index.d.mts +3 -2
  54. package/dist/SearchField/index.mjs +37 -28
  55. package/dist/Select/Select.css +2 -2
  56. package/dist/Select/client.mjs +5 -4
  57. package/dist/Select/index.d.mts +3 -1
  58. package/dist/Select/index.mjs +15 -14
  59. package/dist/Sidebar/Sidebar.css +1 -1
  60. package/dist/Sidebar/index.mjs +1 -2
  61. package/dist/SidebarLayout/SidebarLayout.css +1 -1
  62. package/dist/Stack/Stack.css +1 -1
  63. package/dist/Switch/Switch.css +1 -1
  64. package/dist/Table/Table.css +1 -1
  65. package/dist/Table/index.mjs +9 -9
  66. package/dist/Tabs/Tabs.css +1 -1
  67. package/dist/Tag/Tag.css +2 -2
  68. package/dist/Tag/Tag.css.mjs +48 -18
  69. package/dist/Tag/index.d.mts +2 -1
  70. package/dist/Tag/index.mjs +59 -46
  71. package/dist/Text/Text.css +1 -1
  72. package/dist/TextField/TextField.css +2 -2
  73. package/dist/TextField/TextField.css.mjs +28 -2
  74. package/dist/TextField/index.d.mts +3 -2
  75. package/dist/TextField/index.mjs +45 -33
  76. package/dist/Textarea/Textarea.css +1 -1
  77. package/dist/Toast/Toast.css +1 -1
  78. package/dist/Tooltip/Tooltip.css +1 -1
  79. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  80. package/dist/base.css +1 -1
  81. package/dist/contrast/contrast.d.mts +1 -1
  82. package/dist/contrast/contrast.mjs +3 -2
  83. package/dist/contrast/mixes.mjs +32 -22
  84. package/dist/docs/AlertDialog.md +1 -0
  85. package/dist/docs/Badge.md +2 -2
  86. package/dist/docs/Button.md +10 -8
  87. package/dist/docs/Chip.md +10 -3
  88. package/dist/docs/ColorField.md +7 -0
  89. package/dist/docs/Dialog.md +3 -1
  90. package/dist/docs/IconButton.md +5 -5
  91. package/dist/docs/Menu.md +27 -3
  92. package/dist/docs/MultiSelect.md +6 -0
  93. package/dist/docs/NavList.md +10 -7
  94. package/dist/docs/SearchField.md +6 -0
  95. package/dist/docs/Select.md +6 -0
  96. package/dist/docs/Sidebar.md +3 -3
  97. package/dist/docs/Tag.md +12 -3
  98. package/dist/docs/TextField.md +13 -1
  99. package/dist/docs/Tooltip.md +2 -1
  100. package/dist/docs/llms.txt +5 -5
  101. package/dist/docs/manifest.json +115 -1
  102. package/dist/docs/migrations/0.18.0.md +65 -0
  103. package/dist/docs/migrations/0.19.0.md +90 -0
  104. package/dist/docs/theming.md +1 -1
  105. package/dist/icon-slot/input-icons.mjs +23 -0
  106. package/dist/icon-slot/slot.mjs +17 -13
  107. package/dist/index.mjs +11 -11
  108. package/dist/popup/client.d.mts +1 -1
  109. package/dist/popup/client.mjs +6 -5
  110. package/dist/popup/listbox-base.mjs +3 -2
  111. package/dist/popup/listbox.mjs +5 -4
  112. package/dist/styles/atoms.css +1 -1
  113. package/dist/styles/button-fills.mjs +1 -1
  114. package/dist/styles/layers.css +1 -1
  115. package/dist/styles/responsive.css +1 -1
  116. package/dist/theme/define-theme.mjs +1 -1
  117. package/package.json +1 -1
package/dist/docs/Menu.md CHANGED
@@ -21,8 +21,8 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
21
21
 
22
22
  - Compose the parts: `Menu` > `Menu.Trigger` + `Menu.Popup` > `Menu.Item`, `Menu.LinkItem`, `Menu.Separator`, `Menu.Group`. `Menu` holds the open state and renders no element, so it takes no `className` or `style`; every other part does, plus style props.
23
23
  - `Menu.Trigger` is a bare `Clickable`: give it its look with style props (or your own class), and an accessible name.
24
- - For an icon-only trigger ("More actions"), pass `icon` and `label`: it renders an `IconButton`, the same square as one at each `size` (`sm`, `med`, `lg`; `med` by default), named by `label`, with IconButton's `variant` (`secondary` by default) and the open look below. It takes no children, `iconStart`, `iconEnd` or `aria-label` (ADR 0123). Never build one from `iconStart` and `aria-label`: Button's padding makes it wider than the IconButtons beside it.
25
- - For a trigger that reads as a button ("Actions", "New"), pass Button's `variant`, `size`, `iconStart` or `iconEnd` (a `ChevronDownIcon` for "Actions ▾"): it renders a `Button`, with its fill, border and height, and keeps the trigger's behavior and `aria-disabled`. While the menu is open it shows Button's open look, a held tint and an inset ring (ADR 0063); a bare trigger has none, so style it yourself off `aria-expanded`. Style props still override the defaults.
24
+ - For an icon-only trigger ("More actions"), pass `icon` and `label`: it renders an `IconButton`, the same square as one at each `size` (`sm`, `med`, `lg`; `med` by default), named by `label`, with IconButton's `variant` (the muted `ghost` by default, ADR 0163) and the open look below. It takes no children, `iconStart`, `iconEnd` or `aria-label` (ADR 0123). Never build one from `iconStart` and `aria-label`: Button's padding makes it wider than the IconButtons beside it.
25
+ - For a trigger that reads as a button ("Actions", "New"), pass Button's `variant`, `size`, `iconStart`, `iconEnd` or `uppercase` (a `ChevronDownIcon` for "Actions ▾"): it renders a `Button`, with its fill, border and height, and keeps the trigger's behavior and `aria-disabled`. While the menu is open it shows Button's open look, a held tint and an inset ring (ADR 0063); a bare trigger has none, so style it yourself off `aria-expanded`. Style props still override the defaults.
26
26
  - `Menu.Item` runs its `onClick` on click, Enter and Space, then the menu closes. Pass `closeOnClick={false}` to keep it open.
27
27
  - `Menu.LinkItem` is a real `<a role="menuitem">` for an entry that goes somewhere. `href` is required; `target`, `rel` and `download` pass through. Hover shows the URL, Cmd/Ctrl-click and middle-click open a new tab, and a click, Enter or Space follows it and closes the menu. Never navigate from a `Menu.Item`'s `onClick` (`location.assign`, a router's `navigate`): it loses all of that. Router-aware (client-side) links are not offered. It takes no `variant`.
28
28
  - `variant="danger"` marks a destructive item. It still runs on one click, so open a confirm dialog from it (Cancel focused first) before anything irreversible happens.
@@ -31,7 +31,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
31
31
  - `Menu.Group` takes a `label` that is shown and names the group. Separate groups with `Menu.Separator`.
32
32
  - `Menu.Separator` draws a line inside its own padding (`paddingBlock="4"`, `paddingInline="8"`) and sets no margin. Change its spacing with `paddingBlock` and `paddingInline` (the `padding` shorthand loses to these defaults, decision 0065); a `margin*` prop adds space outside the padding. `style={{ borderBlockStartColor }}` recolours the line.
33
33
  - 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`, or the popup is clipped or drawn under siblings. It sits on `zIndex` `popover`. A menu opened only through `open`, with no `Menu.Trigger`, has no provider to find and portals to `<body>`.
34
- - Item and link item text is wrapped in `Text` for you; an `Icon` beside it is spaced by the item's `gap`.
34
+ - Item and link item text is wrapped in `Text` (`label`, `sm`) for you. `iconStart` and `iconEnd` take an icon component (`iconStart={PencilIcon}`), rendered at the label's size, 4px from it and centred on its cap height, as on Button, Badge and Tag (ADR 0152); the item is as tall as without them. With a `description` they stay on the label's line. Never put an icon in the children: they are the label only.
35
35
  - `side` (`bottom` by default) and `align` (`start`) place the popup against the trigger; it flips when it would overflow the viewport.
36
36
  - Never add key handlers or `tabIndex` to the parts; Base UI handles the keyboard.
37
37
  - The module has no hooks, so a server component can render the parts; `onClick` and other functions must come from a client component.
@@ -86,6 +86,17 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
86
86
  </Menu>
87
87
  ```
88
88
 
89
+ ```tsx
90
+ <Menu.Popup>
91
+ <Menu.Item iconStart={PencilIcon} onClick={edit}>
92
+ Edit
93
+ </Menu.Item>
94
+ <Menu.LinkItem href={`/invoices/${id}`} iconEnd={ArrowRightIcon}>
95
+ Open invoice
96
+ </Menu.LinkItem>
97
+ </Menu.Popup>
98
+ ```
99
+
89
100
  ```tsx
90
101
  // Actions and links on one invoice: the links are real anchors.
91
102
  <Menu.Popup>
@@ -120,6 +131,14 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
120
131
  </Menu.Item>
121
132
  ```
122
133
 
134
+ ```tsx
135
+ // An icon in the children skips the shared size, gap and centring. Use iconStart={PencilIcon}.
136
+ <Menu.Item>
137
+ <PencilIcon size="sm" />
138
+ Edit
139
+ </Menu.Item>
140
+ ```
141
+
123
142
  ```tsx
124
143
  // Base UI already moves focus with the arrow keys; this fights it.
125
144
  <Menu.Item onKeyDown={(event) => event.key === "ArrowDown" && next()}>Edit</Menu.Item>
@@ -184,6 +203,8 @@ Also accepts the style props (see `manifest.json` `styleProps`).
184
203
  | `closeOnClick` | `boolean` | no | Whether to close the menu when the item is clicked. |
185
204
  | `description` | `ReactNode` | no | |
186
205
  | `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
206
+ | `iconEnd` | `ComponentType` | no | |
207
+ | `iconStart` | `ComponentType` | no | |
187
208
  | `id` | `string` | no | |
188
209
  | `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
189
210
  | `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
@@ -202,6 +223,8 @@ Also accepts the style props (see `manifest.json` `styleProps`).
202
223
  | `description` | `ReactNode` | no | |
203
224
  | `disabled` | `boolean` | no | |
204
225
  | `href` | `string` | yes | |
226
+ | `iconEnd` | `ComponentType` | no | |
227
+ | `iconStart` | `ComponentType` | no | |
205
228
  | `id` | `string` | no | |
206
229
  | `label` | `string` | no | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. |
207
230
  | `style` | `CSSProperties` | no | |
@@ -250,6 +273,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
250
273
  | `openOnHover` | `boolean` | no | Whether the menu should also open when the trigger is hovered. |
251
274
  | `payload` | `unknown` | no | A payload to pass to the menu when it is opened. |
252
275
  | `size` | `"lg" \| "med" \| "sm"` | no | |
276
+ | `uppercase` | `boolean` | no | |
253
277
  | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
254
278
 
255
279
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -27,6 +27,7 @@ A form field for picking any number of values from a list too long to show at on
27
27
  - `name` makes each selected value submit as its own `name=value` pair, as a `<select multiple>` does; read them with `formData.getAll(name)`. Nothing selected submits nothing.
28
28
  - `placeholder` (`"Select"`) shows while nothing is selected. `countLabel` (`"{count} selected"`) is the summary once the joined labels do not fit; `{count}` is replaced with the number selected. Translate both. One selected label that does not fit is truncated, not replaced by a count.
29
29
  - `size` (`sm`, `med`, `lg`; default `med`) is the trigger's, as Button's: it matches a SearchField, TextField or Button of the same size in height (24, 32 and 40 px, ADR 0124). The list's options do not change size.
30
+ - `iconStart` takes an icon component (a generated `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. It sits inside the trigger before the value or summary, at the trigger's text step, spaced by the shared icon gap and centred on the text's cap height, so the trigger keeps its height at every size (ADR 0152). There is no `iconEnd`: the chevron is the end icon. The icon is decorative (`aria-hidden`); the label still names the field.
30
31
  - `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`.
31
32
  - The trigger and the open listbox are both named by `label`.
32
33
  - Style props, `className` and `style` go to the `Field` around the label, trigger and messages, not to the trigger or the popup.
@@ -71,6 +72,10 @@ A form field for picking any number of values from a list too long to show at on
71
72
  />
72
73
  ```
73
74
 
75
+ ```tsx
76
+ <MultiSelect label="Label" options={labels} iconStart={InboxIcon} />
77
+ ```
78
+
74
79
  ## Don't
75
80
 
76
81
  ```tsx
@@ -112,6 +117,7 @@ Generated from the TypeScript types.
112
117
  | `disabled` | `boolean` | no | |
113
118
  | `error` | `ReactNode` | no | |
114
119
  | `hideLabel` | `boolean` | no | |
120
+ | `iconStart` | `ComponentType` | no | |
115
121
  | `label` | `ReactNode` | yes | |
116
122
  | `name` | `string` | no | |
117
123
  | `onValueChange` | `((value: string[]) => void)` | no | |
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- 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.
5
+ 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, live dot 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.
6
6
 
7
7
  ## When to use
8
8
 
@@ -23,13 +23,14 @@ A column of links to an app's pages, with the current page marked: a sidebar's o
23
23
  - `NavList` needs a name, and its type requires one: `aria-label` ("Main", "Settings") or `aria-labelledby` when a visible heading names it. A page with two navs tells them apart by these names.
24
24
  - Children are `NavList.Item` and `NavList.Group`, in any mix. `NavList.Group` takes `label`, a string: its heading's text, and its list's name. The heading is `h2` by default; set `headingLevel` to fit the page's outline. A group after another item or group gets `16` of room above it, and so does an item after a group.
25
25
  - `NavList.Item` is an `<a>` by default: pass `href`. With `as={Link}`, it takes the router's props instead (`to`, `prefetch`) and its type checks them. Every other prop, `ref` and the style props included, lands on the link; the `li` around it is bare. A custom `as` component must pass its props and `ref` on to the element it renders: the rail tooltip opens from the event handlers and `ref` it adds there. Use the router's plain `Link`, not a `NavLink` that sets `aria-current` itself: NavList draws the current item from `current`, so the two would disagree.
26
- - `current` marks the link to the page on screen: `aria-current="page"`, an `accentSubtle` fill with `accentSubtleFg` text, a semibold label and an accent bar at the inline-start edge. Set it on one item at most. It is the only way to set `aria-current`: the type omits the raw attribute.
26
+ - `current` marks the link to the page on screen: `aria-current="page"`, the `selected` fill under `fg` text and a medium label, with no bar (ADR 0167). Set it on one item at most. It is the only way to set `aria-current`: the type omits the raw attribute.
27
27
  - `icon` takes an icon component (`icon={InboxIcon}`), drawn at `sm` before the label and hidden from assistive tech: the label names the link.
28
28
  - `avatar` takes an avatar in place of the icon, for a row that stands for a person, a team or a repository: `avatar={<Avatar initials="UI" label="" size="sm" />}`. It is hidden from assistive tech like the icon, so give the Avatar an empty `label`. An item takes `icon` or `avatar`, never both; the type rejects the pair.
29
29
  - Inside a `Sidebar` rail (`collapsed`), group headings, labels and counts are visually hidden and each item is a 40px square around its icon or avatar, centered. Their text stays in the accessible names. Every item in a rail needs an icon or an avatar. In a SidebarLayout stacked below 48em a collapsed Sidebar is no rail: the items show open (ADR 0156). In the rail, hover or keyboard focus on an item shows its label and count in a tooltip past its inline end (right, or left right to left); Esc, blur and pointer leave close it, and the pointer can move onto it. Items in one NavList share the tooltip delay: once one has opened, the next opens at once. Outside a rail no tooltip shows (ADR 0159). The tooltip repeats the item's children, so keep them to text and a count: content with an `id` would repeat it.
30
30
  - `count` is a trailing subtle `Badge` at `xs`. It is part of the link's accessible name, read after the label, so a bare number says nothing ("Issues 12"). Give it its meaning with `VisuallyHidden`: `count={<>12<VisuallyHidden> open issues</VisuallyHidden></>}`. A nullish or empty count renders nothing.
31
+ - `live` marks a page with something running behind it now (a job, a session, a sync): a 6px `success` dot with a soft halo before the count, or at the end of the row with no count. It is read after the label as `liveLabel`, "live" by default; give it the app's meaning (`liveLabel="session running"`) or its language. In the rail the inline dot hides and a dot sits on the icon's or avatar's top inline-end corner, ringed in `bgPanel`; the rail tooltip shows no dot. `count` is separate and unchanged.
31
32
  - Labels wrap onto a second line in a narrow column, breaking a long word if they must; they never truncate.
32
- - Items are `sm` text in `fg`, with `6` block and `8` inline padding, an `xs` radius and at least the `xs` (24px) block size, as default style props; the consumer's win. Hover tints a non-current item where hover is real (`(hover: hover)`).
33
+ - Items are `sm` text in `fg`, with `6` block and `8` inline padding, an `xs` radius and at least the `sm` (32px) block size, as default style props; the consumer's win. Hover tints a non-current item where hover is real (`(hover: hover)`).
33
34
  - A server component can render the whole list, router `Link` included. `NavList` and `NavList.Group` have no hooks; each `NavList.Item` renders its link inside a client part, the rail tooltip (ADR 0159).
34
35
 
35
36
  ## Do
@@ -98,10 +99,10 @@ A column of links to an app's pages, with the current page marked: a sidebar's o
98
99
 
99
100
  - A `nav` landmark named by its `aria-label` or `aria-labelledby`, around a native list: screen readers announce the landmark and the number of links, and their landmark commands reach it (WAI-ARIA landmarks).
100
101
  - Each group's list is named by its heading's text, and the heading is in the page's outline, so heading navigation reaches it.
101
- - The current item has `aria-current="page"`, announced as "current page". Its fill, bar and heavier label show it without color alone (WCAG 1.4.1); under forced colors the fill is gone and the bar turns `Highlight`.
102
- - The current item's text is `accentSubtleFg` on `accentSubtle`, a checked pair (4.5:1, light and dark). Other items are `fg` on the page's surface; under the hover tint, `fg` over `bg`, `bgMuted` and `bgRaised` is checked in `contrast/mixes.ts` (the ghost Button's tint).
103
- - Links are in the tab order in reading order and show the shared focus ring. Every item is at least 24px high (WCAG 2.5.8, ADR 0124).
104
- - The icon or avatar is hidden; the label and the count, with its meaning, make the link's name, in a Sidebar rail too, where they are only visually hidden. The rail tooltip repeats that name for sight only: it is `aria-hidden` and not the link's description, so the name is read once and there is no `aria-describedby`.
102
+ - The current item has `aria-current="page"`, announced as "current page". Its fill and medium label show it without color alone (WCAG 1.4.1). Under forced colors it is a solid `Highlight` fill with `HighlightText`, and a hovered item's tint is dropped, so the two never look alike.
103
+ - The current item's text is `fg` on the `selected` overlay, a checked pair over `bg`, `bgMuted`, `bgRaised` and `bgPanel` (4.5:1, light and dark, ADR 0155). Other items are `fg` on the page's surface; under the hover tint, `fg` over `bg`, `bgMuted` and `bgRaised` is checked in `contrast/mixes.ts` (the ghost Button's tint).
104
+ - Links are in the tab order in reading order and show the shared focus ring. Every item is at least 32px high, 40px square in the rail (WCAG 2.5.8, ADR 0124).
105
+ - The icon or avatar is hidden; the label and the count, with its meaning, make the link's name, with the live label between them when `live` is set, in a Sidebar rail too, where they are only visually hidden. The rail tooltip repeats the label and count for sight only (the live state shows as the corner dot): it is `aria-hidden` and not the link's description, so the name is read once and there is no `aria-describedby`.
105
106
 
106
107
  ## Props
107
108
 
@@ -134,5 +135,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
134
135
  | `count` | `ReactNode` | no | |
135
136
  | `current` | `boolean` | no | |
136
137
  | `icon` | `ComponentType` | no | |
138
+ | `live` | `boolean` | no | |
139
+ | `liveLabel` | `string` | no | |
137
140
 
138
141
  Also accepts every `<a>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
@@ -22,6 +22,7 @@ A form field for a search query: an `<input type="search">` (role `searchbox`) w
22
22
  - `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.
23
23
  - `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. `onValueChange` gets the new string on each keystroke, on Escape and on clear. Debounce a slow search in the consumer.
24
24
  - Escape on a field with a value empties it and goes no further, so a surrounding `Dialog` stays open; a second Escape on the empty field reaches the Dialog. Escape during IME composition belongs to the IME.
25
+ - `iconStart` takes an icon component (a generated `SearchIcon` is the default; pass another such as `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. It sits inside the field's border before the value, at the value's text step, spaced from it by the shared icon gap and centred on its cap height, so the field keeps its height (ADR 0152, 0165). There is no `iconEnd`: the clear button holds the inline end. The icon is decorative and a click on it reaches the input.
25
26
  - The clear button shows only while the field holds a value and is not disabled. Its name is `clearLabel` (`"Clear search"`); translate it. The input always reserves its room, so the first keystroke moves nothing.
26
27
  - `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
28
  - `disabled` uses the native `disabled`: the input leaves the tab order and does not submit, with a dashed border. `required` sets the native `required`.
@@ -48,6 +49,10 @@ A form field for a search query: an `<input type="search">` (role `searchbox`) w
48
49
  />
49
50
  ```
50
51
 
52
+ ```tsx
53
+ <SearchField label="Filter labels" iconStart={InboxIcon} />
54
+ ```
55
+
51
56
  ```tsx
52
57
  <search>
53
58
  <form action="/search">
@@ -116,6 +121,7 @@ Generated from the TypeScript types.
116
121
  | `disabled` | `boolean` | no | |
117
122
  | `error` | `ReactNode` | no | |
118
123
  | `hideLabel` | `boolean` | no | |
124
+ | `iconStart` | `ComponentType` | no | |
119
125
  | `inputProps` | `SearchFieldInputProps` | no | |
120
126
  | `label` | `ReactNode` | yes | |
121
127
  | `name` | `string` | no | |
@@ -27,6 +27,7 @@ A form field for picking one value from a list too long to show as radios, with
27
27
  - `name` makes the selected value submit as one `name=value` pair, as a `<select>` does. Nothing selected submits an empty value.
28
28
  - `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.
29
29
  - `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.
30
+ - `iconStart` takes an icon component (a generated `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. It sits inside the trigger before the value, at the trigger's text step, spaced by the shared icon gap and centred on the text's cap height, so the trigger keeps its height at every size (ADR 0152). There is no `iconEnd`: the chevron is the end icon. The icon is decorative (`aria-hidden`); the label still names the field.
30
31
  - `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`.
31
32
  - The trigger and the open listbox are both named by `label`.
32
33
  - Style props, `className` and `style` go to the `Field` around the label, trigger and messages, not to the trigger or the popup.
@@ -69,6 +70,10 @@ A form field for picking one value from a list too long to show as radios, with
69
70
  />
70
71
  ```
71
72
 
73
+ ```tsx
74
+ <Select label="Label" options={labels} iconStart={InboxIcon} />
75
+ ```
76
+
72
77
  ## Don't
73
78
 
74
79
  ```tsx
@@ -109,6 +114,7 @@ Generated from the TypeScript types.
109
114
  | `disabled` | `boolean` | no | |
110
115
  | `error` | `ReactNode` | no | |
111
116
  | `hideLabel` | `boolean` | no | |
117
+ | `iconStart` | `ComponentType` | no | |
112
118
  | `label` | `ReactNode` | yes | |
113
119
  | `name` | `string` | no | |
114
120
  | `onValueChange` | `((value: string \| null) => void)` | no | |
@@ -21,8 +21,8 @@ An app's sidebar: a named `aside` on the `bgPanel` surface, with a header row, t
21
21
  - Place it in `SidebarLayout.Sidebar` with `inlineSize="auto"`, so the column follows the sidebar's own width, open or collapsed. `padding` stays at its default of none on that column.
22
22
  - The rail is for a wide layout. Stacked, below the layout's 48em, a collapsed sidebar shows open, labels and all, and the toggle changes nothing on screen there; it still flips `collapsed` and `aria-expanded`, so the rail returns when the layout widens (ADR 0156). Header and footer content you pick from `collapsed` (a brand without its name) still follows it there. The layout queries match the nearest SidebarLayout, so a Sidebar in an outer layout's `Main` shows open whenever that layout stacks: keep it in a `SidebarLayout.Sidebar`.
23
23
  - `collapsed` switches to the rail. The app keeps the state (and any persistence or shortcut): `collapsed={collapsed} onCollapsedChange={setCollapsed}`. Without `onCollapsedChange` there is no toggle, and `collapsed` alone draws a fixed rail.
24
- - The toggle is a ghost `sm` `IconButton` at the header's inline end, named `toggleLabel` ("Toggle sidebar" by default). Its name stays the same in both states and `aria-expanded` says which is on. Its panel icon points at the sidebar's edge, mirrored in a right-to-left page.
25
- - `header` sits before the toggle (a brand); `footer` sits after a rule at the bottom (theme, account). In the rail both stack in a column and center: pass what fits 40px (a mark, icon-only controls).
24
+ - The toggle is a `sm` `IconButton` in its default look, with no style of its own: the muted ghost (`fgMuted` at rest, `fg` on hover and focus) in the rail; open, its `aria-expanded="true"` gives it the open look every expanded button shows (ADR 0063). It sits at the header's inline end, named `toggleLabel` ("Toggle sidebar" by default). Its name stays the same in both states and `aria-expanded` says which is on. Its panel icon points at the sidebar's edge, mirrored in a right-to-left page.
25
+ - `header` sits before the toggle (a brand); `footer` sits after a rule at the bottom (theme, account), its children in a row. In the rail both stack in a column and center: pass what fits 40px (a mark, icon-only controls). `sm` IconButtons in their default muted ghost match the toggle in the rail; each keeps its `label` as its name in both states. Anything wider (an account's name) is yours to swap for an icon when `collapsed`.
26
26
  - In the rail, every `NavList.Item` needs an `icon` or an `avatar`: it is the one part left in sight. Group headings, labels and counts are visually hidden, never removed.
27
27
  - In a wide SidebarLayout the sidebar fills the viewport's height, so the footer sits at the bottom; stacked, it takes the whole row and its own height, with its rule below it. Outside a SidebarLayout it is the width above and its content's height: size it yourself.
28
28
  - Its width is CSS keyed to the layout's container query, not a default style prop, and component CSS outranks style props: another width goes in your own `className`. In the rail the sidebar is a size container, so a rail width of your own must be a fixed length, never `max-content`; it is also the containing block for its fixed and absolute descendants and a stacking context, so a popup inside it should portal out, as the library's do. `backgroundColor` (`bgPanel`), `display` and `flexDirection` are default style props; the consumer's win.
@@ -38,7 +38,7 @@ const [collapsed, setCollapsed] = useState(false);
38
38
  <Sidebar
39
39
  aria-label="Sidebar"
40
40
  collapsed={collapsed}
41
- footer={<IconButton icon={SettingsIcon} label="Settings" variant="ghost" />}
41
+ footer={<IconButton icon={SettingsIcon} label="Settings" size="sm" />}
42
42
  header={<Logo />}
43
43
  onCollapsedChange={setCollapsed}
44
44
  >
package/dist/docs/Tag.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- 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.
5
+ 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 `xs` (4px) radius (a small mark's step in `docs/shape.md`, so wrapped lines stay inside the fill) around a `Text` in the `label` font. It can be read-only, a link, or removable. `appearance="outline"` swaps the fill for a 1px border, a `med` (8px) radius and a small dot in the tone's color, for a quieter label among dense content.
6
6
 
7
7
  ## When to use
8
8
 
@@ -20,9 +20,10 @@ A label that puts content in a category: a topic, a label, a user-made category.
20
20
 
21
21
  ## Rules
22
22
 
23
- - `size`: `sm` or `med` (default), the label's `fontSize` step.
23
+ - `size`: `sm` or `med` (default). `sm` sets meta text, a 12/16 medium label with 6px inline padding (ADR 0157, 0164), for dense lists and beside meta text; `med` is a 16px label with 8px inline padding. Both are 24px tall on one line.
24
24
  - `iconStart` and `iconEnd` take an icon component (a generated `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. Tag renders it inline in the label (inside the link, with `href`) at the label's text step, spaced from the words and centred on their cap height, so the tag keeps the height it has without one (ADR 0044, 0152). The icons are decorative (`aria-hidden`): they are not in the link's or the remove button's name. A truncated label keeps its end icon in view after the ellipsis.
25
- - `variant`: the tone's subtle fill, `<variant>SubtleFg` on `<variant>Subtle`. `neutral` (default) for most categories; `accent`, `success`, `warning`, `danger` and `done` only where the category has a meaning those colors already carry in the app, as Badge's variants do. Tag has no solid fills: a category label stays calm (ADR 0121). The tone is never the only cue: the label names the category.
25
+ - `appearance`: `subtle` (default) or `outline` (ADR 0166). `subtle` is the tone fill below. `outline` is `fg` text on no fill, with a 1px `border` outline, a `med` (8px) radius (the outlined label chip's step in `docs/shape.md`), and a round dot before the label (and before `iconStart`): 6px at `sm`, 8px at `med`, centred on the label's cap height, in the tone's text color (`fgMuted` for `neutral`, else the role, such as `accent`). Use it where many tags sit in a row of content and solid fills would crowd it; keep one appearance within a list. The dot is decorative (`aria-hidden`), so the label still names the category. Read-only, link, removable, icons, wrapping and truncation work as they do for `subtle`.
26
+ - `variant`: the tone's subtle fill, `<variant>SubtleFg` on `<variant>Subtle`; with `appearance="outline"` it colors only the dot, and the text stays `fg`. `neutral` (default) for most categories; `accent`, `success`, `warning`, `danger` and `done` only where the category has a meaning those colors already carry in the app, as Badge's variants do. Tag has no solid fills: a category label stays calm (ADR 0121). The tone is never the only cue: the label names the category.
26
27
  - Read-only is the default. `href` makes the label a link (a `Clickable` `<a>` around the text, underlined). The tag itself stays a `span`, so a remove button never nests in the link.
27
28
  - `onRemove` adds a native `<button>` after the label with an `x` icon. Its name is "Remove <label>" from a string or number label; set `removeLabel` for any other label. Enter and Space activate it; the click calls `onRemove`. Tag handles no keys, so Backspace and Delete do nothing (ADR 0003, 0055).
28
29
  - Wrapping: an uncapped label wraps to the width it has, so a tag never overflows a narrow container or a 320px viewport at large text sizes. Every line stays inside the fill and its rounded corners, and inside the outline under forced colors.
@@ -64,6 +65,12 @@ Tell screen reader users the tag is gone, with the owner's live region or by nam
64
65
  </Tag>
65
66
  ```
66
67
 
68
+ ```tsx
69
+ <Tag appearance="outline" variant="accent">
70
+ Frontend
71
+ </Tag>
72
+ ```
73
+
67
74
  ```tsx
68
75
  <Tag variant="done" href="/labels/shipped">
69
76
  Shipped
@@ -96,6 +103,7 @@ Tell screen reader users the tag is gone, with the owner's live region or by nam
96
103
  - The `x` icon is `aria-hidden`; the button's `aria-label` names it. The link and the button each get the shared focus ring and a 24px target.
97
104
  - Each variant's text passes 4.5:1 on its fill and 3:1 on `bg`, and the focus ring 3:1 on the fill, in light and dark mode; the pairs are in `contrastPairs`.
98
105
  - Under forced colors every variant is `CanvasText` on `Canvas` with a `CanvasText` outline, as Badge is, and the link and the button keep the `Highlight` focus ring.
106
+ - Outline: the text is `fg` on the surface, the dot passes 3:1 (its tone's text role, 4.5:1) on every surface, and the remove button's hover fill is the `hover` overlay. The border is decorative, since the label names the category. Under forced colors the border is `CanvasText` and the dot keeps a `CanvasText` fill (`forced-color-adjust: none`), so it stays visible; it carries no meaning the label lacks.
99
107
 
100
108
  ## Props
101
109
 
@@ -105,6 +113,7 @@ Generated from the TypeScript types.
105
113
 
106
114
  | Prop | Type | Required | Description |
107
115
  | --- | --- | --- | --- |
116
+ | `appearance` | `"outline" \| "subtle"` | no | |
108
117
  | `href` | `string` | no | |
109
118
  | `iconEnd` | `ComponentType` | no | |
110
119
  | `iconStart` | `ComponentType` | no | |
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- 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).
5
+ A form field for one line of text that is not a search: an `<input>` (role `textbox`) with SearchField's look and no button over it; optional icons sit inside the field. `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).
6
6
 
7
7
  ## When to use
8
8
 
@@ -29,6 +29,7 @@ A form field for one line of text that is not a search: an `<input>` (role `text
29
29
  - `name` submits the value with its form. A native form reset puts an uncontrolled field back to its `defaultValue` but fires no change, so `onValueChange` misses it; control the field if the form resets and you track the value.
30
30
  - Style props, `className` and `style` go to the `Field` around the label, input and messages, not to the input.
31
31
  - `inputProps` reach the input: `ref`, `id`, `autoFocus`, `autoComplete`, `spellCheck`, `enterKeyHint`, `inputMode`, `maxLength`, `minLength`, `pattern`, `onKeyDown`, and only the `aria-*` valid on a text box (ADR 0110, 0154): `aria-controls`, `aria-activedescendant`, `aria-autocomplete`, `aria-details`, `aria-keyshortcuts`, `aria-owns`, `aria-flowto`, `aria-current`, `aria-roledescription`, `aria-busy`, `aria-live`, `aria-atomic` and `aria-relevant`. `label` owns the name, Field owns `aria-invalid`, `aria-describedby` and `aria-errormessage`, and `disabled` and `required` own their state, so those, `aria-readonly`, `aria-hidden` and the single-line input's `aria-multiline` are not among them. Neither is `aria-placeholder`: hint with `placeholder`, since the input has a native placeholder and ARIA says not to set both. The type closes the set, so an object literal with another `aria-*` is a type error; nothing strips one at runtime.
32
+ - `iconStart` and `iconEnd` take an icon component (a generated `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. Each sits inside the field's border, before or after the value, at the value's text step, spaced from it by the shared icon gap and centred on its cap height, so the field keeps its height (ADR 0152, 0165). The value's padding makes room, so text never runs under an icon. The icons are decorative (`aria-hidden`) and a click on one reaches the input; the label still names the field.
32
33
  - The field handles no keys; a consumer `onKeyDown` is passed straight through.
33
34
  - A consumer `ref` gets the input. A consumer `id` takes over from Field's generated one at hydration, and the label follows it.
34
35
  - 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.
@@ -50,6 +51,15 @@ A form field for one line of text that is not a search: an `<input>` (role `text
50
51
  />
51
52
  ```
52
53
 
54
+ ```tsx
55
+ <TextField
56
+ label="Email"
57
+ type="email"
58
+ iconStart={InboxIcon}
59
+ inputProps={{ autoComplete: "email" }}
60
+ />
61
+ ```
62
+
53
63
  ```tsx
54
64
  <TextField
55
65
  label="Postcode"
@@ -96,6 +106,8 @@ Generated from the TypeScript types.
96
106
  | `disabled` | `boolean` | no | |
97
107
  | `error` | `ReactNode` | no | |
98
108
  | `hideLabel` | `boolean` | no | |
109
+ | `iconEnd` | `ComponentType` | no | |
110
+ | `iconStart` | `ComponentType` | no | |
99
111
  | `inputProps` | `TextFieldInputProps` | no | |
100
112
  | `label` | `ReactNode` | yes | |
101
113
  | `name` | `string` | no | |
@@ -22,7 +22,7 @@ A short hint about a control that shows on hover after a delay and at once on ke
22
22
 
23
23
  - Compose the parts: `Tooltip` > `Tooltip.Trigger` + `Tooltip.Popup`. `Tooltip` holds the open state (`open`, `defaultOpen`, `onOpenChange`, `disabled`) and renders no element, so it takes no `className` or `style`; the trigger and popup take both, plus style props.
24
24
  - `disabled` on `Tooltip` switches the tooltip off: it never opens, and the trigger drops its `aria-describedby`, so a screen reader hears no description a sighted user cannot open.
25
- - `Tooltip.Trigger` is a bare `Clickable`, a `<button>` around your content: style it with style props or your own class. A button holds only inline content, so give a `Text` in it `as="span"`. With Button's `variant`, `size`, `iconStart` or `iconEnd` it renders a `Button`. It needs its own accessible name (its text, or `aria-label`); the tooltip is its description, never its name.
25
+ - `Tooltip.Trigger` is a bare `Clickable`, a `<button>` around your content: style it with style props or your own class. A button holds only inline content, so give a `Text` in it `as="span"`. With Button's `variant`, `size`, `iconStart`, `iconEnd` or `uppercase` it renders a `Button`. It needs its own accessible name (its text, or `aria-label`); the tooltip is its description, never its name.
26
26
  - `disabled` on the trigger renders `aria-disabled`: it stays focusable and its tooltip still shows, so it can say why the control is disabled.
27
27
  - `delay` (600ms by default) and `closeDelay` on the trigger change the hover timing. Focus always opens it at once.
28
28
  - The trigger's `aria-describedby` names the popup first, then any you pass. The popup's `id` and `role` are the Tooltip's own, not props.
@@ -170,6 +170,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
170
170
  | `iconEnd` | `ComponentType` | no | |
171
171
  | `iconStart` | `ComponentType` | no | |
172
172
  | `size` | `"lg" \| "med" \| "sm"` | no | |
173
+ | `uppercase` | `boolean` | no | |
173
174
  | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
174
175
 
175
176
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -15,7 +15,7 @@
15
15
  - [Avatar](Avatar.md): Identifies a person, project or account by one or two letters in a circle, tinted by a hue or filled with a colour of the consumer's choosing, or on a neutral fill. A `span` with `role="img"`, named by `label`, around a `Text` in the `label` font. It is never focusable.
16
16
  - [Badge](Badge.md): A static label that states the status of, or a short fact about, the thing beside it: "Draft", "Failed", "Beta". A `span` with a fill from the color roles around a `Text` in the `label` font. It has no role and is never focusable.
17
17
  - [Box](Box.md): The base element every component builds on: one element, chosen with `as`, styled with style props. Style props are the token-backed classes from `@layer atoms`: layout (`display`, flex, `gap`, logical padding, margin and sizing), color roles, `borderRadius`, `boxShadow`, `position`, `zIndex`, `overflow` and `textAlign`.
18
- - [Button](Button.md): The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Four variants (`primary`, `secondary`, `ghost`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It is a pill (`full` radius) with a bold uppercase label and a soft glow in its variant's color (ADR 0131). It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
18
+ - [Button](Button.md): The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Four variants (`primary`, `secondary`, `ghost`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It takes the control radius (`sm`, 6px, ADR 0162) and a sentence-case label at weight 500; only `primary` glows, softly in its fill (ADR 0131, 0163). It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
19
19
  - [Checkbox](Checkbox.md): A two-state choice, with a third mixed state for a "select all" over a partly selected list. Built on Base UI `Checkbox` (ADR 0003, 0046): a `span` with `role="checkbox"` and `aria-checked`, plus a hidden `<input type="checkbox">` that submits with the form. The span is a 24 by 24 CSS px target (WCAG 2.2) with the shared focus ring; the 16px box inside fills and shows a tick when checked, a dash when mixed. It composes `Field` for its label, description and error (ADR 0026).
20
20
  - [Chip](Chip.md): A toggle that filters content or picks an option: "Unread", "Starred", "Medium". A `<button>` with `aria-pressed` on `Clickable`, built on Base UI `Toggle`; `ChipGroup` is a Base UI `ToggleGroup` of chips that share one state. If it changes state when clicked, it's a chip.
21
21
  - [Clickable](Clickable.md): The low-level base for everything a user presses: a `<button type="button">` by default, or a link with `as="a"` (or a router's link component). It brings the shared focus ring, a 24 by 24 CSS px minimum target (WCAG 2.2), `disabled` and `busy` states as ARIA attributes, and no look of its own: the button and link chrome is stripped. `Button`, `IconButton` and link components are built on it.
@@ -25,11 +25,11 @@
25
25
  - [Field](Field.md): Wires one form control to its label, description and error: ids, `htmlFor`, `aria-describedby` and `aria-invalid`. It is input-agnostic: the control inside is Base UI's `Field.Control` or a Base UI control (Checkbox, Combobox), and Base UI does the wiring. The parts are `Field` (the root, a flex column), `Field.Label`, `Field.Description` and `Field.Error`. Built on Base UI `Field` (ADR 0003, 0026, 0046); `@base-ui/react` is a peer dependency, so the app's Base UI controls and Field share one copy of its contexts.
26
26
  - [Heading](Heading.md): Section and page headings. A `Text` with heading defaults: the `heading` font role, `semibold`, `sm` leading, and balanced line wrapping. The level (`as`) and the look (`size`) are separate, so the outline stays right whatever the design calls for.
27
27
  - [Icon](Icon.md): The base for every icon: an `<svg>` on a 24-unit grid that draws its children with round 2-unit strokes in `currentColor`. Generated icons from `@jonmilner/ui/icons` (`ArrowRightIcon`, …) wrap it and take the same props, less `children` and `viewBox`. `size` takes a `fontSize` step, so an icon matches the `Text` beside it; `color` takes a color role.
28
- - [IconButton](IconButton.md): A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Three variants from Button's fills (`primary`, `secondary`, `ghost`), each a circle with Button's glow (ADR 0131), and three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
28
+ - [IconButton](IconButton.md): A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Three variants from Button's fills (`ghost`, the default, `secondary` and `primary`), each a square at the control radius (`sm`, 6px, ADR 0162), with Button's glow on `primary` only (ADR 0131, 0163), and three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
29
29
  - [Inline](Inline.md): A horizontal row of children that wraps onto new lines, with even space between them on both axes. `Inline` is a `Box` with `display="flex"`, `flexDirection="row"`, `flexWrap="wrap"` and `alignItems="center"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
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
- - [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.
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, live dot 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
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.
34
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).
35
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`.
@@ -40,9 +40,9 @@
40
40
  - [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.
41
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.
42
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).
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
+ - [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 `xs` (4px) radius (a small mark's step in `docs/shape.md`, so wrapped lines stay inside the fill) around a `Text` in the `label` font. It can be read-only, a link, or removable. `appearance="outline"` swaps the fill for a 1px border, a `med` (8px) radius and a small dot in the tone's color, for a quieter label among dense content.
44
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`.
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
+ - [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 button over it; optional icons sit inside the field. `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).
46
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).
47
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.
48
48
  - [Tooltip](Tooltip.md): A short hint about a control that shows on hover after a delay and at once on keyboard focus: a status pill's reason ("2 of 5 checks failed"), why a button is disabled, a few label and value rows. Built on Base UI's Tooltip, which owns the behavior: the hover delay, opening on focus, Esc, blur and pointer leave closing it, and keeping it open while the pointer is over the popup. The parts add the look, a small raised surface with a border and shadow, and link the popup to its trigger as its description (`role="tooltip"`, `aria-describedby`), which Base UI leaves out.