@umriss-ui/core 0.42.0 → 0.44.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/CHANGELOG.md CHANGED
@@ -27,6 +27,46 @@ 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.44.0 – The old names go, and server mode answers (Oct. 2026)
31
+
32
+ ### Added
33
+
34
+ - **New wording keys** for what the table's server mode and export say, in English and German: `tryAgain`, `exporting`, `exportFailed`, `selectedOnPage`, `selectAllMatching`, `allMatchingSelected`, `footerOfMatches` and `exportSheetName` (the Excel sheet's name). The table, schedule and calculation move with them.
35
+ - **A scenario, Mark a stretch,** on the control room page: a trend reports a range, the scenario holds it as one value, an alarm table takes it as a row filter and the trend draws it back as a band.
36
+
37
+ ### Changed
38
+
39
+ - **`ariaLabel` on `TreeView`, `Popover` and `ContextMenu` is removed** (ADR-0068); 0.43.0 renamed it `aria-label` and kept the old name for one minor.
40
+ - Migration: write `aria-label` (TypeScript flags every use of `ariaLabel`).
41
+ - **A wording written out in full needs the new keys** above, as it did for earlier additions; a wording built on the shipped English or German needs nothing.
42
+ - Migration: add the eight keys to a custom wording object, or spread the shipped one and override.
43
+
44
+ ## 0.43.0 – One root contract, and a finger as a pointer (Oct. 2026)
45
+
46
+ ### Added
47
+
48
+ - **`useContextMenuTrigger(open)`** opens a `ContextMenu` the same way on every device: on a right-click at the pointer, on the context-menu key or Shift+F10 at the target's box, and on a long press with a finger at the finger - the only way on iOS. Spread its result on the target; the click and the `contextmenu` that end a long press do not reach it.
49
+ - **A held finger shows a Tooltip.** A touch held 500 ms within 10 px shows an icon button's name, which hides 1.5 s after the lift; mouse and pen keep the hover delay (ADR-0070).
50
+ - **`createLongPress(onPress, onEnd?)`** - the long-press detector the Tooltip and `useContextMenuTrigger` use, a plain function over pointer events: it fires once, with the finger's point, when a touch pointer is held 500 ms within 10 px, and it swallows the click that ends the press.
51
+ - **A number format is Intl's options** (ADR-0069): `NumberFormat` is `"percent" | "count" | NumberOptions`, where `NumberOptions` are `Intl.NumberFormat`'s options plus `decimals`. `writeNumber(formats, n, format?)` writes a number by it, and `Formats.numberWith(options)` is cached by the options' content. `NumberInput` takes `grouping` (default `true`), so a year reads 2024.
52
+ - **A tab list with more tabs than room scrolls sideways** within its width, with no bar, and keeps the selected and the focused tab in view by its own scroll position, never the page's.
53
+ - **Clear of the safe area:** under `viewport-fit=cover` the toasts, a full-window Modal, the Drawer and the CommandPalette add each edge's hardware inset to their room. Without that viewport setting the insets are zero and nothing moves.
54
+ - **The CommandPalette shows a close cross under a finger**, and the on-screen keyboard is told what Enter does (`enterkeyhint`) in the palette, Combobox, MultiSelect's search and TreeSearch, with `autocomplete="off"`; a caller's own value wins where the field passes attributes through.
55
+ - **More contrast on request:** under `prefers-contrast: more` the secondary and muted text reach 7:1 and the edges and hairlines 3:1, in both themes.
56
+
57
+ ### Changed
58
+
59
+ - **`md` controls are 44 px under a coarse pointer** - a phone, a tablet, a touch kiosk (ADR-0070). A touch laptop with a trackpad stays at 32; `sm` and `xs` are unchanged.
60
+ - Migration: nothing to change; to keep 32 px under a finger, set `--u-control-height: 32px` in your own `@media (pointer: coarse)` block.
61
+ - **Under a finger nothing core draws is a target smaller than 24 px.** A box grows where a pad cannot reach: the free Checkbox and Switch, a radio option, the TreeView fold key, the Splitter strip, the Slider range and the NumberInput steps; a button is at least 24 px wide. The Tag remove, Alert close, FileInput remove, MultiSelect chips, Breadcrumb link, Card fold key, a SegmentedControl segment and the clear crosses take an invisible pad that changes no layout.
62
+ - Migration: nothing to change; under touch emulation or on a touch device, look at a layout that counted on those controls' size.
63
+ - **Combobox, MultiSelect, DatePicker, DateTimePicker, DateRangePicker and DateTimeRangePicker are fields** (ADR-0068): class and style stay on the wrapper, and the ref and the rest land on the control that takes the focus - an `HTMLInputElement` for Combobox, an `HTMLButtonElement` for the others. The clause that sent `aria-label`, `aria-labelledby` and `aria-describedby` there separately is gone. No old form is kept, since an attribute stands on one element.
64
+ - Migration: a ref typed `HTMLDivElement` or `HTMLSpanElement` is a type error - type it for the input or the button; a selector or test that found `data-*` or `id` on the wrapper finds it on the control.
65
+ - **`ariaLabel` on TreeView, Popover and ContextMenu is renamed `aria-label`** (ADR-0068). `ariaLabel` stays as a deprecated alias and warns once in development; 0.44.0 removes it.
66
+ - Migration: write `aria-label`.
67
+ - **The built-in number formats no longer write a negative zero:** -0.0004 at one place reads "0.0", not "-0.0".
68
+ - Migration: nothing to change; a test that expected "-0" reads "0".
69
+
30
70
  ## 0.42.0 – Tested in Vitest and Jest, themed from one file (Oct. 2026)
31
71
 
32
72
  ### Added
package/README.md CHANGED
@@ -65,7 +65,7 @@ export function OrdersTable({ rows }: { rows: Order[] }) {
65
65
  const { Table, Column } = useTable(rows, { rowKey: (o) => o.number });
66
66
 
67
67
  return (
68
- <Table ariaLabel="Orders">
68
+ <Table aria-label="Orders">
69
69
  <Column value="number" label="Order" rowHeader />
70
70
  <Column value="customer" label="Customer" />
71
71
  <Column value="quantity" label="Quantity" />
@@ -98,6 +98,11 @@ manifest marks CSS as a side effect, so a bundler keeps it. The stylesheet stays
98
98
  exported as `@umriss-ui/core/styles.css` for setups that link stylesheets by
99
99
  hand; nobody has to import it.
100
100
 
101
+ **On a phone the safe area is honoured.** Under `viewport-fit=cover` the toasts,
102
+ a full-window `Modal`, a `Drawer` and the `CommandPalette` keep clear of a notch
103
+ and a home indicator, each edge's inset added to its room. Without
104
+ `viewport-fit=cover` nothing moves.
105
+
101
106
  **They touch nothing else** (ADR-0021). No rule selects `html`, `body`, `*` or a
102
107
  native element of the page, and the only rules on `:root` declare the tokens.
103
108
  Each component carries what it needs itself: its type, `box-sizing` on its own
@@ -192,7 +197,8 @@ token away.
192
197
 
193
198
  **Browsers:** Chrome 123, Firefox 120, Safari 17.5 or newer. `light-dark()` is
194
199
  older nowhere; an older browser discards the tokens and shows the interface
195
- unstyled.
200
+ unstyled. An application checks the floor itself with
201
+ `CSS.supports("color", "light-dark(red, red)")`.
196
202
 
197
203
  ## Testing
198
204
 
@@ -389,23 +395,32 @@ The table is not part of this package. It lives in
389
395
 
390
396
  ## Principles for new components
391
397
 
392
- 1. Pass `ref`, `className` and `...rest` through to the root element –
393
- every component that renders a root element. Excepted are the wrappers that
394
- have none: `Popover` renders into a portal, `Tooltip` around the caller's
395
- child, `Menu`, `ContextMenu` and `ToastProvider` are composed of other
396
- parts, and the providers render no element at all. The ref goes
397
- to the element a caller lays out: the `<dialog>` of `Modal`, `Drawer`,
398
- `ConfirmDialog` and `CommandPalette`, the field's wrapper of the pickers
399
- and the combobox family, the `role="tree"` list of `TreeView`. The native
400
- fields that wear a wrapper (`Checkbox`, `Switch`, `Slider`, `NumberInput`,
401
- `Select`, `FileInput`, `Input`, `Textarea`) put the class and the style on
402
- the wrapper - what a caller dresses and sizes - and ref and rest on the
403
- control (ADR-0041). The pickers and the combobox family take a caller's
404
- `aria-label`, `aria-labelledby` and `aria-describedby` out of the rest and
405
- put them on the field that has the focus. The component's own
406
- `role`, the `aria-*` it computes and its handlers are not replaced by
407
- `rest`: a caller's handler runs first and can `preventDefault`. Held by
408
- `tests-unit/passthrough.test.tsx`, which renders every export.
398
+ 1. Every component has one of four shapes (ADR-0068), and `ref` is always an
399
+ element - never a handle. The other packages follow the same contract.
400
+ - **An element**: `ref`, `className`, `style` and the rest reach the root
401
+ element. Most of core: `Button`, `Card`, `Stack`, `Stat`, `TreeView` (its
402
+ `role="tree"` list), the `<dialog>` of `Modal`, `Drawer`, `ConfirmDialog`
403
+ and `CommandPalette`, and the rest that render a root.
404
+ - **A field**: the class and the style reach the wrapper, which a caller
405
+ dresses and sizes (ADR-0041); `ref` and the rest reach the control that
406
+ takes the focus. In core: `Checkbox`, `Switch`, `Slider`, `NumberInput`,
407
+ `Select`, `FileInput`, `Input`, `Textarea` and `TreeSearch` (the native
408
+ control), `Combobox` (its input), and `MultiSelect`, `DatePicker`,
409
+ `DateTimePicker`, `DateRangePicker` and `DateTimeRangePicker` (the trigger
410
+ button). So `data-testid` on a `Combobox` finds the input, and a
411
+ `<label htmlFor>` names a picker. `SplitButton` keeps its class on the
412
+ group and its style and rest on the main action.
413
+ - **A composite** - a frame that holds several parts, with the name routed to
414
+ the part that carries the role: core has none; the table, the chart, the
415
+ schedule and the calculation are the ones.
416
+ - **No element of its own**, each with its reason: `Popover` renders into a
417
+ portal, `Tooltip` wraps the caller's child, `Menu` and `ContextMenu` are
418
+ composed of other parts, `ToastProvider` is a context with a portal, and the
419
+ providers render no element at all.
420
+
421
+ The component's own `role`, the `aria-*` it computes and its handlers are not
422
+ replaced by `rest`: a caller's handler runs first and can `preventDefault`.
423
+ Held by `tests-unit/passthrough.test.tsx`, which renders every export.
409
424
  2. Support controlled **and** uncontrolled use (`value`/`defaultValue`).
410
425
  Deliberately controlled only: `Combobox` and `MultiSelect` – the field keeps
411
426
  no second state beside the caller's – as well as `Modal`, `Drawer` and
@@ -417,9 +432,8 @@ The table is not part of this package. It lives in
417
432
  selector reaches beyond the component's own elements, and every rule lies in
418
433
  a layer (ADR-0021; the guards in `tests-unit/stylesheets.test.ts` hold it).
419
434
  6. Everything is English – identifiers, props and prose (ADR-0018, which
420
- reversed ADR-0015). What still stands from ADR-0015 is the spelling of the
421
- accessible name: it is `aria-label` where it names the root element, and
422
- `ariaLabel` only where it does not.
435
+ reversed ADR-0015). The accessible name is spelled `aria-label` everywhere
436
+ (ADR-0068).
423
437
  7. A field's root composes `extent` from `#own-styles`: it fills the place
424
438
  that gives it a width, is its natural width where the place asks, and is
425
439
  never wider than its place; what it shows never moves it (ADR-0041). A field
@@ -439,7 +453,8 @@ The table is not part of this package. It lives in
439
453
  The core scope is complete, and so are the command palette, the
440
454
  danger text tone, the pass-through of rules 1 and 2 above, the six basic
441
455
  components and the layout extras, forced colours, the listbox
442
- announcements, and the fields' widths and sizes (ADR-0041).
456
+ announcements, the fields' widths and sizes (ADR-0041), the four shapes of a
457
+ root (ADR-0068) and the targets under a finger (ADR-0070).
443
458
 
444
459
  What core will not build at all stands in
445
460
  [ADR-0032](../../docs/adr/0032-what-umriss-is-not.md). Validation is the