@umriss-ui/core 0.51.0 → 0.52.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.
- package/API.md +1415 -0
- package/CHANGELOG.md +59 -0
- package/README.md +82 -6
- package/dist/core.css +1 -1
- package/dist/core.js +4993 -4255
- package/dist/de.d.ts +36 -4
- package/dist/formats--E1bx2-N.js +104 -0
- package/dist/index.d.ts +353 -90
- package/dist/wording/de.js +23 -6
- package/docs/llms-full.md +5667 -4748
- package/package.json +2 -16
- package/dist/formats-dd9LbvXt.js +0 -102
package/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,65 @@ package stood at `0.1.0` the whole time, because it had exactly one caller and t
|
|
|
27
27
|
caller lay in the same repository — and are grouped by unit of delivery, not by
|
|
28
28
|
commit.
|
|
29
29
|
|
|
30
|
+
## 0.52.0 – A form field says what it did: `onValueChange` everywhere, printing, a server table with groups (Oct. 2026)
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **`onValueChange`** on Input, Textarea, NumberInput, Select, Combobox, MultiSelect, SegmentedControl, RadioGroup, Slider, the four date pickers and FileInput; **`onCheckedChange`** on Checkbox and Switch. `defaultValue` on NumberInput, Combobox, MultiSelect, the four pickers and FileInput (uncontrolled use); `name` and `formValue` on Combobox, MultiSelect, NumberInput and the pickers post the value to a form, `startName` and `endName` on the range pickers post `<name>Start` and `<name>End`.
|
|
35
|
+
- **`RangeSlider`** - a lower and an upper end on one track, posted as `<name>Start` and `<name>End`.
|
|
36
|
+
- **`TimeInput`** - a time of day as hour, minute and optional second fields, the value as the text `HH:mm`.
|
|
37
|
+
- **`Avatar`** - a round mark for a person or a team, a picture or initials, sizes `sm` and `md`.
|
|
38
|
+
- **Input `start` and `end` slots** - a unit as text, an icon or an IconButton inside the field's frame.
|
|
39
|
+
- **Combobox `creatable` and `onCreate`** - typed text as the value for string values (`createOption` in the wording).
|
|
40
|
+
- **Menu and RowActions** open on ArrowDown/ArrowUp from the trigger and have typeahead; `MenuItem` takes a `role` of `menuitem`, `menuitemradio` or `menuitemcheckbox`; the Alert shows its tone by a glyph (`ToneGlyph`).
|
|
41
|
+
- **Checkbox** takes `invalid` and reads FormField's error; **Popover** takes `onBlur`, `closeOnTabOut` and `role="none"`; `useCommandPaletteShortcut` takes a target window (an iframe's) and reads the real target inside a shadow root.
|
|
42
|
+
- **Print styles**: overlays, toasts and the skip link do not print; cards and overlays print with a hard edge; a dark application prints in the light theme.
|
|
43
|
+
- **`resetAnnouncer()`** is exported; call it in `afterEach` (README Testing). `API.md` ships in the package.
|
|
44
|
+
- **The date pickers announce the pick**: the picked date, time or range is the trigger's description and is announced in the wording's language (`pickerPicked`).
|
|
45
|
+
- **Wording** (English and German): `branchLoading`, `calculationMissingAll`, `dashboardHeadHint`, `ofSelected` ("2 of 3"), `selectionCount`, `toastShortcutHint`, `sortedAscending`, `sortedDescending`, `sortRemoved`, `groupFolded`, `groupOpened`, `exportDone`, `filterTerm`, `pickerPicked`, `createOption`.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **Every field reports its value through `onValueChange`, and Checkbox and Switch through `onCheckedChange`** (ADR-0081). `onChange(value)` on NumberInput, Combobox, MultiSelect, SegmentedControl, RadioGroup, Slider, the four date pickers and FileInput is deprecated and warns once in development; the docs, examples and README show the new names. A `value` of `undefined` reads as empty on every field, and a field switched between controlled and uncontrolled warns in development.
|
|
50
|
+
- Migration: replace `onChange={(value) => ...}` with `onValueChange={(value) => ...}` (and the value form of `onChange` with `onCheckedChange` on Checkbox and Switch) - the old name works in 0.52.0 and is removed in 0.53.0; on Slider `onChange` later becomes the native event handler.
|
|
51
|
+
- **Select, Combobox, MultiSelect, SegmentedControl and RadioGroup take number values**; Select's `onValueChange` returns a number for an option written with one.
|
|
52
|
+
- Migration: nothing changes for string values; type your handler for the value type you write.
|
|
53
|
+
- **Button `loading` sets `aria-disabled` and `aria-busy`, not `disabled`**, and keeps focus; a disabled button is repainted, not faded.
|
|
54
|
+
- Migration: `toBeDisabled()` and `:disabled` no longer match a loading button; test `aria-busy` instead.
|
|
55
|
+
- **Badge wraps its text in a span** (`.text`) so that it ends in an ellipsis in a narrow parent.
|
|
56
|
+
- Migration: a direct-child selector on Badge may need the span.
|
|
57
|
+
- **A Modal without `autoFocus` focuses its first tab stop other than the header's cross**, else the dialog; Modal and Drawer lock the page's scroll while open (inline `overflow` and `padding-right` on `<html>`, no padding under `scrollbar-gutter: stable`).
|
|
58
|
+
- Migration: a test that expected the focus on Close finds it on the first field; code that sets `overflow` on `<html>` while a dialog is open is overwritten.
|
|
59
|
+
- **A Checkbox or Switch inside a FormField** has one accessible name, its own label.
|
|
60
|
+
- Migration: a test that found it by the FormField's label finds it by the Checkbox's own.
|
|
61
|
+
- **Wording**: `toastDeckCount` reads "1 / n, show all messages"; the MultiSelect scope button reads "View all" (`optionScopeAll`); a toast's close button is named "<`closeToast`>: <title>"; `filteredOfTotal` takes the count of rows as a third argument for the noun's plural ("… entries"); `dashboardSizeEntry` ignores its `current` flag (still accepted) and writes no check mark - the size choice is a `menuitemradio` and draws its own.
|
|
62
|
+
- Migration: an application that overrides these entries adjusts `filteredOfTotal` (third argument) and drops the check mark from its `dashboardSizeEntry`; a test that found the buttons by the old text finds them by the new.
|
|
63
|
+
- **Popover is a dialog named by its anchor by default**; its anchor gets `aria-expanded` and `aria-controls` where it has none, and it closes when its anchor scrolls out of a clipping box.
|
|
64
|
+
- Migration: set `role` to `none` or another role where the surface is not a dialog; a test that found the surface by another role finds it by `dialog`.
|
|
65
|
+
- **`formats` writes dates in the Gregorian calendar for every locale**; search and `filterOptions` fold case and diacritics ("muller" finds "Müller", "strasse" finds "Straße").
|
|
66
|
+
- Migration: affects `fa` (Persian-calendar output is gone) and any test that expected a diacritic search to miss.
|
|
67
|
+
- **The MultiSelect's options are a listbox of options** with `aria-selected` (`aria-multiselectable`), one Tab stop and roving focus, instead of a group of checkboxes; its panel and the date pickers' dialogs are named after their field and keep the focus where it was.
|
|
68
|
+
- Migration: a test that found the options as checkboxes finds them as options.
|
|
69
|
+
- **A Combobox with a value selects its text on focus**, so typing replaces it.
|
|
70
|
+
- Migration: nothing to change; look at tests that type into a focused Combobox with a value.
|
|
71
|
+
- **The muted text token reaches 4.5:1** on its grounds in light and dark; controls take `touch-action: manipulation`; field text follows a raised root size on touch; new tokens `--u-focus-row-color` and `--u-shadow-float`.
|
|
72
|
+
- Migration: an application that relied on the old, lighter muted grey sees darker text; nothing to change in code.
|
|
73
|
+
- **`Tooltip.children` and `Menu.trigger` are typed** by their ref and attributes.
|
|
74
|
+
- Migration: a child or trigger that does not accept a ref and DOM attributes fails to compile; wrap it in an element that does.
|
|
75
|
+
- **The published `package.json` carries no `scripts`.**
|
|
76
|
+
- Migration: nothing changes for a caller; a tool that read the package's scripts from `node_modules` finds none.
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- Modal, Drawer, ConfirmDialog and CommandPalette: one inside a Modal or Drawer closes only itself; a Modal hidden by Activity or a re-suspending Suspense closes its dialog and reopens it; focus returns to the opener when an open Modal unmounts, after a mouse press and after a nested dialog, also in WebKit; a synthetic Escape closes a Modal; `ModalHeader` with children renders them as the heading (`title` is optional); a closed CommandPalette mounts nothing; ConfirmDialog calls `onConfirm` once per opening, can be confirmed again after a promise settles with the dialog open, and locks Escape and the backdrop while `loading`.
|
|
81
|
+
- A Popover opened inside a Modal stays open when its container clips; Popover, Menu, ContextMenu and Tooltip open inside a foreign modal dialog instead of behind it, and Escape closes only the top layer; overlays, the announcer and their listeners stay in the shadow root or iframe of their anchor; on a pinch-zoomed page panels fit the visual viewport.
|
|
82
|
+
- Toasts: a bottom toast no longer covers a Drawer's footer buttons; closing a toast by its action after Tab no longer drops focus to the body.
|
|
83
|
+
- Fields: `value={undefined}` with a `defaultValue` is uncontrolled in Input, Textarea, Select and every field; a form's reset restores NumberInput, Combobox, MultiSelect, the four date pickers, RadioGroup, SegmentedControl, Slider, FileInput and Textarea's count and reports it through `onValueChange`; `onBlur` of MultiSelect and the pickers fires only when focus leaves the whole field; `ref.focus()` on RadioGroup and SegmentedControl focuses the checked option; RadioGroup draws the error look; a clearable Combobox emptied by hand gives `null`.
|
|
84
|
+
- NumberInput reads its own output in es, sv, nb, hr, fi and for tiny values, refuses "0 5" where the group separator is a space, steps and rounds exactly (0.2 + 0.1, -2.5, 1.005), keeps an unreadable paste marked, follows a value set while focused, shows NaN and Infinity as empty and names its unit as a description; its declarations compile for a strict consumer.
|
|
85
|
+
- Date pickers keep the focus on the active day across months, Tab out of an open panel closes it, an Invalid Date shows the field empty with a DEV warning, pasting into the hour or minute field sets it, the time fields are spinbuttons, typed dates are read in Arabic-Indic and Persian digits, a 30-minute daylight-saving change is flagged ambiguous, and the weekday heads stay apart at a large root font size.
|
|
86
|
+
- Slider snaps on the grid from `min` with the decimals of `min` and `step`; TreeView checking under a filter touches only what the filter shows; Link and Breadcrumb no longer write an `href` with a `javascript:`, `vbscript:` or `data:` scheme (a DEV warning says so).
|
|
87
|
+
- Looks: an Alert inside a centred place aligns its text to the start beside its glyph; disabled buttons reach 3:1 in both themes and a danger button's focus ring too; Radios draw as circles; Splitter's line holds 3:1; FileInput's crosses line up and its rows stand apart under a finger; Sparkline's `aria-label` sits on an img; VisuallyHidden causes no overflow in a non-positioned scroller; the skip link shows the library's focus ring; the Select's panel is as wide as its field and the MultiSelect panel has one scroll container at 320x256; a Stat as a dashboard widget's content is not a card in a card, and a Stat's ISO-string `asOf` warns in development.
|
|
88
|
+
|
|
30
89
|
## 0.51.0 – A page is what its frame holds: a table fills its pane, the pager says the range (Oct. 2026)
|
|
31
90
|
|
|
32
91
|
### Added
|
package/README.md
CHANGED
|
@@ -93,6 +93,56 @@ holds the first of them under 1.5 kB in every package.
|
|
|
93
93
|
|
|
94
94
|
umriss writes no HTML into the document and runs under `require-trusted-types-for 'script'`: the visual suite opens every demo page of every package under that policy, and an HTML sink reached while a page renders fails it.
|
|
95
95
|
|
|
96
|
+
### Forms
|
|
97
|
+
|
|
98
|
+
Every field takes `value` or `defaultValue` and reports its finished value through `onValueChange(value)`
|
|
99
|
+
(Checkbox and Switch: `checked`, `defaultChecked` and `onCheckedChange(boolean)`). With `name`, a field
|
|
100
|
+
posts its value into a `<form>` as a native control would: the Combobox its value, not its label, and
|
|
101
|
+
`""` when it is empty. A form's `reset` restores every field. `onChange(event)` stays on Input, Textarea,
|
|
102
|
+
Checkbox, Switch and Slider, the fields a library such as `register` reads.
|
|
103
|
+
|
|
104
|
+
A native form with a React 19 `action` needs no library:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<form action={(data) => save(data.get("centre"), data.get("amount"))}>
|
|
108
|
+
<FormField label="Cost centre">
|
|
109
|
+
<Combobox name="centre" options={CENTRES} defaultValue="CC-2200" />
|
|
110
|
+
</FormField>
|
|
111
|
+
<FormField label="Amount">
|
|
112
|
+
<NumberInput name="amount" defaultValue={4860.5} decimals={2} />
|
|
113
|
+
</FormField>
|
|
114
|
+
<Button type="submit">Send</Button>
|
|
115
|
+
</form>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
With react-hook-form, the value fields go through `Controller`, and `Input` through `register`:
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
const { control, register, handleSubmit, formState: { errors } } = useForm<Booking>({
|
|
122
|
+
defaultValues: { name: "", centre: null, amount: null },
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
<form onSubmit={handleSubmit(save)}>
|
|
126
|
+
<FormField label="Name" error={errors.name?.message}>
|
|
127
|
+
<Input {...register("name", { required: "Required" })} />
|
|
128
|
+
</FormField>
|
|
129
|
+
<FormField label="Cost centre">
|
|
130
|
+
<Controller control={control} name="centre" render={({ field }) => (
|
|
131
|
+
<Combobox ref={field.ref} options={CENTRES} value={field.value} onValueChange={field.onChange} />
|
|
132
|
+
)} />
|
|
133
|
+
</FormField>
|
|
134
|
+
<FormField label="Amount">
|
|
135
|
+
<Controller control={control} name="amount" render={({ field }) => (
|
|
136
|
+
<NumberInput ref={field.ref} value={field.value} onValueChange={field.onChange} decimals={2} />
|
|
137
|
+
)} />
|
|
138
|
+
</FormField>
|
|
139
|
+
<Button type="submit">Send</Button>
|
|
140
|
+
</form>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Empty is `null` for a choice or a number (`""` for text), so the form's defaults say so. The demo's "Post to a form"
|
|
144
|
+
example shows what the posted entries look like.
|
|
145
|
+
|
|
96
146
|
## Styles
|
|
97
147
|
|
|
98
148
|
**They load themselves.** `dist/core.js` imports its stylesheet, and the
|
|
@@ -120,6 +170,25 @@ Each component carries what it needs itself: its type, `box-sizing` on its own
|
|
|
120
170
|
elements, a focus ring on what it makes focusable. A caller's content inside
|
|
121
171
|
`Stack` or `Grid` keeps the caller's type.
|
|
122
172
|
|
|
173
|
+
**Other libraries' dialogs, shadow roots and iframes.** A `Popover`, `Menu`,
|
|
174
|
+
`Tooltip` and `ContextMenu` opened inside a modal `role="dialog"` with
|
|
175
|
+
`aria-modal="true"` (Radix, Headless UI) open inside it, above and clickable,
|
|
176
|
+
and Escape closes the topmost layer only. Inside a shadow root the surfaces and
|
|
177
|
+
the announcer stay in that root, inside an iframe in the frame's document, and
|
|
178
|
+
their listeners bind to the anchor's own document. Two things are yours:
|
|
179
|
+
|
|
180
|
+
- The stylesheet must be in the root or frame: a `<link rel="stylesheet">` to
|
|
181
|
+
`@umriss-ui/core/styles.css` (or its text in a `<style>`), as the shadow
|
|
182
|
+
root's first child. The tokens inherit through the host; in an iframe copy
|
|
183
|
+
your token overrides too.
|
|
184
|
+
- The toast region has no anchor: give the provider a container that stands in
|
|
185
|
+
the root or frame, `<UmrissProvider portalTarget={() => container}>`.
|
|
186
|
+
|
|
187
|
+
`useCommandPaletteShortcut(onOpen, { target: iframe.contentWindow })` binds the
|
|
188
|
+
keys to a frame's window; a "/" typed in a shadow root's input never opens the
|
|
189
|
+
palette. On a pinch-zoomed page the panels fit the visual viewport, and the
|
|
190
|
+
toasts, `Modal` and `Drawer` stand against it.
|
|
191
|
+
|
|
123
192
|
**Everything can be overridden.** The library's rules lie in three cascade
|
|
124
193
|
layers, `umriss.tokens`, `umriss.base` and `umriss.components`, and CSS written
|
|
125
194
|
outside a layer wins over all of them, whatever the order of loading:
|
|
@@ -263,6 +332,10 @@ module.exports = {
|
|
|
263
332
|
**Next.js** with `next/jest`: put the umriss packages in `transpilePackages`; the preset stubs the
|
|
264
333
|
stylesheets and compiles the packages itself.
|
|
265
334
|
|
|
335
|
+
**The announcer** (`announce`, the polite live region that speaks for lists and counts) keeps its
|
|
336
|
+
region and a 150 ms timer between tests. Call `resetAnnouncer()` from `@umriss-ui/core` in
|
|
337
|
+
`afterEach`: it drops a waiting announcement and empties every region.
|
|
338
|
+
|
|
266
339
|
**The setup file** gives jsdom the five browser APIs that core's components use. It is the same file
|
|
267
340
|
for both runners:
|
|
268
341
|
|
|
@@ -399,7 +472,7 @@ The table is not part of this package. It lives in
|
|
|
399
472
|
| `Divider` | a dividing line beside Stack and Grid: horizontal/vertical, two weights, optionally with a label |
|
|
400
473
|
| `VisuallyHidden` | text for the screen reader only; `focusable` turns it into a skip link |
|
|
401
474
|
| `ButtonGroup` / `SplitButton` | connected buttons; a main action plus variants through the existing menu |
|
|
402
|
-
| `Text` / `Heading` / `Link` | typography on the token scale; for `Heading`, level and size are independent |
|
|
475
|
+
| `Text` / `Heading` / `Link` | typography on the token scale; for `Heading`, level and size are independent; `Link` (and `Breadcrumb`) drop an `href` that is not `http:`, `https:`, `mailto:`, `tel:` or relative - `javascript:`, `vbscript:` and `data:` do nothing, with a DEV warning |
|
|
403
476
|
| `Input` / `Select` / `Checkbox` | form elements; `Input numeric` in Geist Mono, `Input clearable` with a softly fading-in × button (clears without losing focus); `Select` a native `<select>` that opens the Combobox's list under a mouse and the keys and the system's picker under a finger (ADR-0043); `Checkbox indeterminate`; every field fills its place or is its natural width, never what it shows, and takes `chars` for a width in characters (ADR-0041) |
|
|
404
477
|
| `Modal` / `ModalHeader` / `ModalBody` / `ModalFooter` | dialogs built on `<dialog>`; free space is distributed in the golden ratio (38 : 62) above and below the surface – small modals sit in the upper third, long ones use the full height, and only the body scrolls while head and foot stay put |
|
|
405
478
|
| `ConfirmDialog` | a compact confirmation dialog, `tone="danger"` for destructive actions, loading state |
|
|
@@ -413,9 +486,11 @@ The table is not part of this package. It lives in
|
|
|
413
486
|
| `Stack` / `Grid` | layout primitives with token spacing (a 4 px step), `Grid` with a fixed count, a width per column (`columns={[140, "fill"]}`) or responsive via `minItemWidth` |
|
|
414
487
|
| `DatePicker` | calendar selection: weeks from Monday, arrow keys across the month, today/clear, the date in Geist Mono |
|
|
415
488
|
| `DateTimePicker` | date plus time: two-digit fields that advance automatically, visible up/down steppers and arrow-key counting; after the day is chosen the focus jumps into the time, `withSeconds`, "now"; the clock change is handled honestly – a missing hour (the start of summer time) is detected and corrected forwards with a note, a duplicated hour (the start of winter time) offers the choice between both occurrences including the UTC offset |
|
|
489
|
+
| `TimeInput` | a time of day without a day: the date-time picker's hour, minute and (`withSeconds`) second fields standing alone - they type themselves onwards, arrows count round the clock, a pasted `14:30` is split; the value is the text `HH:mm` (`HH:mm:ss`), `null` while empty, and the same text is posted |
|
|
416
490
|
| `Combobox` | a searchable select field (listbox panel, arrow keys, `aria-activedescendant`), optionally `clearable`; `Input`'s two sizes |
|
|
417
491
|
| `MultiSelect` | multiple selection: the field always stays on one line and measures the space (as many chips as fit, the rest as "+N"); chips are remove buttons (hover shows ×, a click deletes, backspace deletes the last, roving tabindex with arrow keys), and the "+N" counter opens the selected view directly; a panel with a search field (autofocus, Enter toggles the first hit), a view switch "all \| selected (N)" (the list always in natural order, deselected rows stay visible in the selected view until the view changes), and all/none/invert acting on the filtered set of the active view; optionally `clearable`, a × that empties what "none" would, its room kept in the field's width; `Input`'s two sizes |
|
|
418
492
|
| `Card` / `CardHeader` / `CardBody` | panels with an eyebrow, actions, optionally collapsible; `flush` for borderless tables; a dividing line under the head only through `divider` (for borderless data) – otherwise white space carries the hierarchy |
|
|
493
|
+
| `Avatar` | a round mark for a person or a team: a picture (initials when it fails), or initials derived from the name; `sm` for a cell, `md` for a lane's header |
|
|
419
494
|
| `Badge` | a status label with a dot, five tones; slightly rounded by default, `pill` for counters |
|
|
420
495
|
| `NumberInput` | numeric input in the notation the formats seam provides (group separators on leaving the field; it reads back what it writes, whatever the notation), `decimals` (0 = whole numbers), `min`/`max`, arrow keys with Shift ×10, an integrated spinner column at the right inner edge, `prefix`/`suffix` adornments (€, %); it asks for the text keyboard while a negative value is allowed, so `min={0}` keeps the number pad on a phone |
|
|
421
496
|
| `Meter` | a narrow fill bar (0–1) with a mono percentage label, five tones – for utilisation in cells; `label` names what is being measured |
|
|
@@ -428,11 +503,12 @@ The table is not part of this package. It lives in
|
|
|
428
503
|
| `TreeView` / `TreeSearch` / `useTree` | a tree with exactly one active node and optional ticking (cascade, indeterminate, locked, unloaded); arrow keys, type to jump, range selection, virtualisation. The search keeps its term in the tree |
|
|
429
504
|
| `Stat` | a metric: one value, read against its limits – the verdict as a word and a colour, the deviation from the target value, history, freshness and the source's quality |
|
|
430
505
|
| `CommandPalette` / `useCommandPaletteShortcut` | a command palette: subsequence search with rank and highlighted finds, groups, keywords a candidate is found by, at most `maxFinds` finds with a line for the rest, a populated resting state; opens on Ctrl/⌘+K and `/` (`slash: false` switches the single key off, WCAG 2.1.4; neither opens inside a modal dialog) |
|
|
431
|
-
| `CrossGlyph` / `PlusGlyph` / `MinusGlyph` / `AngleGlyph` / `EndGlyph` / `CalendarGlyph` / `ClockGlyph` / `GripGlyph` / `GridGlyph` / `MeasureGlyph`
|
|
506
|
+
| `CrossGlyph` / `PlusGlyph` / `MinusGlyph` / `AngleGlyph` / `EndGlyph` / `CalendarGlyph` / `ClockGlyph` / `GripGlyph` / `GridGlyph` / `MeasureGlyph` / `MoreGlyph` / `ToneGlyph` | the shared character set, one stroke width at one nominal size; specification in `docs/glyphs.md` |
|
|
432
507
|
| `Sparkline` | a miniature history line with an area gradient and an accent end point – for trends in cells |
|
|
433
508
|
| `Spinner` | a functional loading indicator |
|
|
434
509
|
| `Switch` | on or off, taking effect at once: a native checkbox under `role="switch"`, the label beside it, two sizes, invalid through `FormField`; the thumb travels on the path transition |
|
|
435
510
|
| `Slider` | one value between two bounds on the native range input, drawn with tokens: `min`/`max`/`step`, marks with optional words, `format` for the mono readout and `aria-valuetext`; arrows, PageUp/PageDown by a tenth, Home/End - the same on every engine |
|
|
511
|
+
| `RangeSlider` | a lower and an upper end on one track, two native range inputs over one drawn groove: `[from, to]` through `value`/`defaultValue`/`onValueChange`, on the step grid from `min`, the ends never cross; each thumb a slider of its own, posted as `<name>Start`/`<name>End`; a press on the bare track moves the nearer thumb |
|
|
436
512
|
| `Drawer` | the `Modal`'s dialog entering from an edge (`side="right" \| "left"`): focus trap, Escape and focus return from the browser, `ModalHeader`/`ModalBody`/`ModalFooter` inside, its width the token `--u-drawer-width`; modal only |
|
|
437
513
|
| `ProgressBar` | how far a task has come (`role="progressbar"`), determinate from 0 to 1 or indeterminate without a value; `valueText` for a count; no tone, because progress is no verdict - that is the `Meter` |
|
|
438
514
|
| `Accordion` / `AccordionItem` | sections behind headers that are buttons with `aria-expanded`: `type="single" \| "multiple"`, controlled or uncontrolled, arrow keys between the headers; the height animates as the card's collapse does |
|
|
@@ -469,10 +545,10 @@ The table is not part of this package. It lives in
|
|
|
469
545
|
The component's own `role`, the `aria-*` it computes and its handlers are not
|
|
470
546
|
replaced by `rest`: a caller's handler runs first and can `preventDefault`.
|
|
471
547
|
Held by `tests-unit/passthrough.test.tsx`, which renders every export.
|
|
472
|
-
2. Support controlled **and** uncontrolled use (`value`/`defaultValue`)
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
548
|
+
2. Support controlled **and** uncontrolled use (`value`/`defaultValue`), with
|
|
549
|
+
the callback named for the state (`onValueChange`, `onCheckedChange`; ADR-0081).
|
|
550
|
+
Every field does both. `Modal`, `Drawer` and `CommandPalette` are controlled
|
|
551
|
+
only, because opening is the caller's decision.
|
|
476
552
|
3. Keyboard operation and `aria` attributes are part of the definition of done.
|
|
477
553
|
4. No business logic: a mapping such as "status X is green" is the application's
|
|
478
554
|
to make.
|