@umriss-ui/core 0.25.0 → 0.26.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/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/core 0.25.0
1
+ # @umriss-ui/core 0.26.0
2
2
 
3
3
  > React component library for data-dense dashboards and tools - forms, date pickers, overlays, a tree view and a command palette. Precise, quiet, professional.
4
4
 
@@ -56,7 +56,7 @@ import {
56
56
  useToast,
57
57
  } from "@umriss-ui/core";
58
58
  import type { LimitSet } from "@umriss-ui/core";
59
- import { Chart, LimitLine, Line, Tooltip, XAxis, YAxis } from "@umriss-ui/charts";
59
+ import { LimitLine, Tooltip, useChart } from "@umriss-ui/charts";
60
60
  import { AlarmList, alarmModel, useTableSelection } from "@umriss-ui/table";
61
61
 
62
62
  /* Data from the operations world, written out here so the example runs on its own. */
@@ -279,6 +279,7 @@ const OWN = new Set(["checkout-latency", "checkout-errors"]);
279
279
 
280
280
  function Content() {
281
281
  const { toast } = useToast();
282
+ const { Chart, XAxis, YAxis, Line } = useChart(TODAY);
282
283
  const [alerts, setAlerts] = useState<readonly Alert[]>(() => ALERTS.filter((one) => OWN.has(one.type)));
283
284
  const [resolved, setResolved] = useState<number | null>(null);
284
285
  const [resolving, setResolving] = useState(false);
@@ -388,11 +389,11 @@ function Content() {
388
389
  <Card data-callout="3">
389
390
  <CardHeader title="p95 latency since 08:00" />
390
391
  <CardBody>
391
- <Chart data={TODAY} height={200} ariaLabel={`${SERVICE.name}, p95 latency since 08:00`}>
392
- <XAxis accessor={(d: MetricPoint) => d.t} time />
393
- <YAxis accessor={(d: MetricPoint) => d.p95} domain={[0, 700]} label="ms" />
392
+ <Chart height={200} ariaLabel={`${SERVICE.name}, p95 latency since 08:00`}>
393
+ <XAxis value="t" time />
394
+ <YAxis domain={[0, 700]} label="ms" />
394
395
  <LimitLine value={SERVICE.latencySlo} severity="alarm" label="Objective" />
395
- <Line accessor={(d: MetricPoint) => d.p95} name="p95" format={(v) => `${Math.round(v)} ms`} />
396
+ <Line value="p95" name="p95" format={(v) => `${Math.round(v)} ms`} />
396
397
  <Tooltip mode="x" />
397
398
  </Chart>
398
399
  </CardBody>
@@ -1632,9 +1633,9 @@ import {
1632
1633
  Text,
1633
1634
  } from "@umriss-ui/core";
1634
1635
  import type { FreshnessAges, LimitSet } from "@umriss-ui/core";
1635
- import { Chart, ControlChart, DataTable, LimitBand, LimitLine, Line, Tooltip, XAxis, YAxis } from "@umriss-ui/charts";
1636
+ import { ControlChart, DataTable, LimitBand, LimitLine, Tooltip, useChart } from "@umriss-ui/charts";
1636
1637
  import { AlarmList, alarmModel, isHidden, useTableSelection } from "@umriss-ui/table";
1637
- import { Lane, Schedule, Subtasks } from "@umriss-ui/schedule";
1638
+ import { useSchedule } from "@umriss-ui/schedule";
1638
1639
  import type { Subtask, Task } from "@umriss-ui/schedule";
1639
1640
  import { Calculation, Difference, Given, Product, Quotient, Ref } from "@umriss-ui/calculation";
1640
1641
 
@@ -2111,6 +2112,7 @@ function skipTo(event: MouseEvent<HTMLAnchorElement>, id: string) {
2111
2112
  }
2112
2113
 
2113
2114
  export default function ControlRoom() {
2115
+ const { Schedule, Lane, Subtasks } = useSchedule({ initialView: { domain: PLAN_DOMAIN } });
2114
2116
  const { minute, wall, running, setRunning } = usePlantMinute();
2115
2117
  const now = at(minute);
2116
2118
  const reading = SHIFT.readings[minute]!;
@@ -2128,6 +2130,8 @@ export default function ControlRoom() {
2128
2130
  () => upTo(SHIFT.samples, minute).map((one) => ({ ...one, t: at(one.minute) })),
2129
2131
  [minute],
2130
2132
  );
2133
+ const kilnTrend = useChart(trend);
2134
+ const tileLength = useChart(measured);
2131
2135
  const alarms = useMemo(
2132
2136
  () =>
2133
2137
  alarmModel(
@@ -2210,15 +2214,15 @@ export default function ControlRoom() {
2210
2214
  </Region>
2211
2215
 
2212
2216
  <Region id="room-trend" title="Kiln trend" callout="3">
2213
- <Chart data={trend} height={240} ariaLabel="Kiln K1, zone 3, over the shift">
2214
- <XAxis accessor={(d: Point) => d.t} domain={[at(0), at(LAST)]} time />
2215
- <YAxis accessor={(d: Point) => d.kiln} domain={[1170, 1250]} label="°C" />
2217
+ <kilnTrend.Chart height={240} ariaLabel="Kiln K1, zone 3, over the shift">
2218
+ <kilnTrend.XAxis value="t" domain={[at(0), at(LAST)]} time />
2219
+ <kilnTrend.YAxis domain={[1170, 1250]} label="°C" />
2216
2220
  <LimitBand from={KILN.tolerance[0]} to={KILN.tolerance[1]} severity="warning" label="Tolerance" />
2217
2221
  <LimitLine value={KILN.alarm} severity="alarm" label="Alarm limit" />
2218
- <Line accessor={(d: Point) => d.kiln} name="Zone 3" format={(v) => `${v.toFixed(1)} °C`} />
2222
+ <kilnTrend.Line value="kiln" name="Zone 3" format={(v) => `${v.toFixed(1)} °C`} />
2219
2223
  <Tooltip mode="x" />
2220
2224
  <DataTable />
2221
- </Chart>
2225
+ </kilnTrend.Chart>
2222
2226
  </Region>
2223
2227
 
2224
2228
  <Region id="room-alarms" title="Alarms" quiet callout="4">
@@ -2236,13 +2240,13 @@ export default function ControlRoom() {
2236
2240
  </Region>
2237
2241
 
2238
2242
  <Region id="room-quality" title="Tile length">
2239
- <Chart data={measured} height={220} ariaLabel="Tile length after firing, individuals chart">
2240
- <XAxis accessor={(d: Measured) => d.t} domain={[at(0), at(LAST)]} time />
2241
- <YAxis accessor={(d: Measured) => d.length} domain={[597, 602]} label="mm" />
2243
+ <tileLength.Chart height={220} ariaLabel="Tile length after firing, individuals chart">
2244
+ <tileLength.XAxis value="t" domain={[at(0), at(LAST)]} time />
2245
+ <tileLength.YAxis domain={[597, 602]} label="mm" />
2242
2246
  <LimitLine value={601.5} severity="alarm" label="USL" />
2243
2247
  <LimitLine value={598.5} severity="alarm" label="LSL" />
2244
2248
  <ControlChart
2245
- accessor={(d: Measured) => d.length}
2249
+ value="length"
2246
2250
  data={measured}
2247
2251
  origin={REFERENCE}
2248
2252
  name="Length"
@@ -2251,7 +2255,7 @@ export default function ControlRoom() {
2251
2255
  violationName="Length - rule violation"
2252
2256
  />
2253
2257
  <Tooltip mode="x" />
2254
- </Chart>
2258
+ </tileLength.Chart>
2255
2259
  </Region>
2256
2260
 
2257
2261
  <Region
@@ -2266,7 +2270,6 @@ export default function ControlRoom() {
2266
2270
  >
2267
2271
  <Schedule
2268
2272
  ariaLabel="Plan of the early shift: press, dryer and kiln"
2269
- initialDomain={PLAN_DOMAIN}
2270
2273
  height={196}
2271
2274
  now={now}
2272
2275
  selectedTask={batch}
@@ -3000,6 +3003,10 @@ The charts' own tokens, set on a chart's root. A token whose value names a core
3000
3003
  | `--uc-color-pressed` | `var(`[--u-color-surface-pressed](#token-u-color-surface-pressed)`, #e9e9eb)` | same | — |
3001
3004
  | `--uc-transition-state` | `var(`[--u-transition](#token-u-transition)`, 120ms cubic-bezier(0.22, 1, 0.36, 1))` | same | — |
3002
3005
  | `--uc-transition` | `80ms var(`[--u-ease-out](#token-u-ease-out)`, cubic-bezier(0.22, 1, 0.36, 1))` | same | The tooltip's fade: its own short duration - it follows the pointer and must not lag behind it - on core's curve where core is loaded. |
3006
+ | `--uc-delay-stale` | `var(`[--u-delay-stale](#token-u-delay-stale)`, 200ms)` | same | A course being reloaded dims as the table's rows do ([ADR-0042](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0042-a-rows-height-never-follows-what-it-shows.md)): only after this delay, so that a quick answer never flickers. |
3007
+ | `--uc-silhouette` | `color-mix(in srgb, var(`[--u-color-text](#token-u-color-text)`, #18181b) 10%, transparent)` | same | The shapes of the silhouette a chart shows while it waits for its rows (chart-loading 03): faint in the text colour, as the table's placeholders. |
3008
+ | `--uc-ease-swell` | `var(`[--u-ease-swell](#token-u-ease-swell)`, ease-in-out)` | same | The easing of the band that sweeps the silhouette: it swells as the table's shimmer does. |
3009
+ | `--uc-fade` | `var(`[--u-duration-medium](#token-u-duration-medium)`, 240ms) var(`[--u-ease-out](#token-u-ease-out)`, cubic-bezier(0.22, 1, 0.36, 1))` | same | The silhouette fading out and the course in, once the rows are there: core's motion for a layout change. |
3003
3010
 
3004
3011
  #### Keyboard
3005
3012
 
@@ -3337,6 +3344,72 @@ export default function NarrowPlaces() {
3337
3344
  }
3338
3345
  ```
3339
3346
 
3347
+ ##### A row of fields
3348
+
3349
+ Fields side by side share one line: their labels on one line, their boxes on one height, their words on the line the select's value stands on. A segmented control is a field itself; a horizontal radio group is as tall as a control, and so are a checkbox and a switch in a field, so their words stand on that line too - at either size.
3350
+
3351
+ ```tsx
3352
+ import { Checkbox, ControlSizeProvider, FormField, RadioGroup, SegmentedControl, Select, Stack, Switch } from "@umriss-ui/core";
3353
+ import type { ControlSize } from "@umriss-ui/core";
3354
+
3355
+ function Row({ size }: { size: ControlSize }) {
3356
+ return (
3357
+ <Stack role="group" aria-label={size === "sm" ? "Small" : "Medium"} direction="row" gap={3} wrap>
3358
+ <FormField label="Caster">
3359
+ <Select defaultValue="">
3360
+ <option value="">Every caster</option>
3361
+ <option>Caster 1</option>
3362
+ <option>Caster 2</option>
3363
+ </Select>
3364
+ </FormField>
3365
+ <FormField label="Strand">
3366
+ <Select defaultValue="">
3367
+ <option value="">Every strand</option>
3368
+ <option>Strand 1</option>
3369
+ <option>Strand 2</option>
3370
+ </Select>
3371
+ </FormField>
3372
+ <FormField label="State of the data">
3373
+ <RadioGroup
3374
+ orientation="horizontal"
3375
+ defaultValue="raw"
3376
+ options={[
3377
+ { value: "raw", label: "Raw" },
3378
+ { value: "cleaned", label: "Cleaned" },
3379
+ ]}
3380
+ />
3381
+ </FormField>
3382
+ <FormField label="Values">
3383
+ <SegmentedControl
3384
+ defaultValue="measured"
3385
+ options={[
3386
+ { value: "measured", label: "Measured" },
3387
+ { value: "forecast", label: "Forecast" },
3388
+ ]}
3389
+ />
3390
+ </FormField>
3391
+ <FormField label="Archive">
3392
+ <Checkbox label="Show archived" />
3393
+ </FormField>
3394
+ <FormField label="Updates">
3395
+ <Switch label="Live" defaultChecked />
3396
+ </FormField>
3397
+ </Stack>
3398
+ );
3399
+ }
3400
+
3401
+ export default function ARowOfFields() {
3402
+ return (
3403
+ <Stack gap={5}>
3404
+ <Row size="md" />
3405
+ <ControlSizeProvider size="sm">
3406
+ <Row size="sm" />
3407
+ </ControlSizeProvider>
3408
+ </Stack>
3409
+ );
3410
+ }
3411
+ ```
3412
+
3340
3413
  #### When to use something else
3341
3414
 
3342
3415
  - A width the layout decides - two columns, a field beside a button → Stack and Grid
@@ -3352,8 +3425,8 @@ The keys of [Button](#/button/keyboard-button), [ButtonGroup](#/buttongroup/keyb
3352
3425
 
3353
3426
  | Prop | Type | Default | Description |
3354
3427
  |---|---|---|---|
3355
- | `size` *required* | [`ControlSize`](#type-ControlSize)<br>`"sm" \| "md"` | — | The size of every control inside that does not say its own.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place) |
3356
- | `children` *required* | `ReactNode` | — | The place the size holds for.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place) |
3428
+ | `size` *required* | [`ControlSize`](#type-ControlSize)<br>`"sm" \| "md"` | — | The size of every control inside that does not say its own.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields) |
3429
+ | `children` *required* | `ReactNode` | — | The place the size holds for.<br>Shown in: [One size for a place](#/sizes/one-size-for-a-place), [A row of fields](#/sizes/a-row-of-fields) |
3357
3430
 
3358
3431
  ##### Types on this page
3359
3432
 
@@ -3784,7 +3857,7 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
3784
3857
  | `pinToEndHint` | Pin to end | Am Ende fixieren | — |
3785
3858
  | `unpinHint` | Unpin | Fixierung lösen | — |
3786
3859
  | `exportLabel` | Export | Exportieren | The export button. |
3787
- | `exportPageLabel` | Export page | Seite exportieren | The export button of a table in manual mode, which holds and writes one page. |
3860
+ | `exportPageLabel` | Export page | Seite exportieren | The export button of a table in server mode, which holds and writes one page. |
3788
3861
  | `exportFileName` | table.csv | tabelle.csv | The export's file name, where the application names none. |
3789
3862
  | `tableSearchPlaceholder` | Search … | Suchen … | Placeholder and accessible name of the search field. |
3790
3863
  | `tableSearchLabel` | Search table | Tabelle durchsuchen | — |
@@ -3792,7 +3865,7 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
3792
3865
  | `filterHint` | Filter | Filtern | The tooltip over that button. |
3793
3866
  | `selectRow(row)` | `` `Select ${row}` `` | `` `${row} auswählen` `` | The selection of one row, named after its row header. |
3794
3867
  | `selectAllRows` | Select all | Alle auswählen | The selection of every row in the filtered set. |
3795
- | `selectAllOnPage` | Select all on this page | Alle auf dieser Seite auswählen | The same checkbox in manual mode, where the table holds one page of a server's. |
3868
+ | `selectAllOnPage` | Select all on this page | Alle auf dieser Seite auswählen | The same checkbox in server mode, where the table holds one page of a server's. |
3796
3869
  | `expandRowNamed(row)` | `` `Expand ${row}` `` | `` `${row} aufklappen` `` | The expand button, named after the row header. |
3797
3870
  | `collapseRowNamed(row)` | `` `Collapse ${row}` `` | `` `${row} zuklappen` `` | — |
3798
3871
  | `rowActions` | Actions | Aktionen | Header of the actions column - for the screen reader, not visible. |
@@ -4003,7 +4076,10 @@ Every entry of `ChartsWording` from `@umriss-ui/charts`, which a chart takes thr
4003
4076
  | `stackTotal` | Total | Summe | The last row of a stack in the tooltip and the readout: the sum of its members at the point (charts-stacking K4). |
4004
4077
  | `percent(value)` | `` `${value}%` `` | `` `${value} %` `` | A share in a normalised stack, its number already formatted (K5). |
4005
4078
  | `walkHelp` | Left and right arrows move through the values, up and down change the series, Home and End go to the first and the last, Escape clears. | Pfeil links und rechts gehen durch die Werte, Pfeil hoch und runter wechseln die Serie, Pos1 und Ende springen zum ersten und letzten Wert, Escape hebt die Markierung auf. | The keys that walk the chart. |
4006
- | `zoomHelp` | Plus and minus zoom, Shift with left or right pans, 0 shows everything. | Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 zeigt alles. | The keys that zoom and pan it - only where the chart can be zoomed. |
4079
+ | `zoomHelp` | Plus and minus zoom, Shift with left or right pans, 0 goes back to the axis' own span. | Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 kehrt zum eigenen Bereich der Achse zurück. | The keys that zoom and pan it - only where the chart can be zoomed. |
4080
+ | `legendHelp` | In the legend, Enter hides or shows a series, Shift+Enter shows only it. | In der Legende blendet Enter eine Serie aus oder ein, Umschalt+Enter zeigt nur sie. | The keys of the legend's entries - only where it has one to press. |
4081
+ | `allShown` | Nothing would be left to see, so every series is shown. | Sonst wäre nichts mehr zu sehen, darum werden alle Serien gezeigt. | Read out where hiding would leave nothing to see, and every series is shown instead. |
4082
+ | `showAll` | Show all | Alles zeigen | The control over a zoomed plot that brings every zoomed axis back to its own domain (component-view 04). |
4007
4083
  | `showData` | Show data | Daten zeigen | The data table's disclosure key, closed and open (charts-alternatives C1). |
4008
4084
  | `hideData` | Hide data | Daten verbergen | — |
4009
4085
  | `positionColumn` | Position | Position | The heading of the table's x column where its axis has no `label`, and of a matrix' row column where its y axis has none. |
@@ -4195,7 +4271,7 @@ Everything the library puts out as text.
4195
4271
  | `pinToEndHint` *required* | `string` | — | |
4196
4272
  | `unpinHint` *required* | `string` | — | |
4197
4273
  | `exportLabel` *required* | `string` | — | The export button. |
4198
- | `exportPageLabel` *required* | `string` | — | The export button of a table in manual mode, which holds and writes one page. |
4274
+ | `exportPageLabel` *required* | `string` | — | The export button of a table in server mode, which holds and writes one page. |
4199
4275
  | `exportFileName` *required* | `string` | — | The export's file name, where the application names none. |
4200
4276
  | `tableSearchPlaceholder` *required* | `string` | — | Placeholder and accessible name of the search field. |
4201
4277
  | `tableSearchLabel` *required* | `string` | — | |
@@ -4203,7 +4279,7 @@ Everything the library puts out as text.
4203
4279
  | `filterHint` *required* | `string` | — | The tooltip over that button. |
4204
4280
  | `selectRow` *required* | `(row: string) => string` | — | The selection of one row, named after its row header. |
4205
4281
  | `selectAllRows` *required* | `string` | — | The selection of every row in the filtered set. |
4206
- | `selectAllOnPage` *required* | `string` | — | The same checkbox in manual mode, where the table holds one page of a server's. |
4282
+ | `selectAllOnPage` *required* | `string` | — | The same checkbox in server mode, where the table holds one page of a server's. |
4207
4283
  | `expandRowNamed` *required* | `(row: string) => string` | — | The expand button, named after the row header. |
4208
4284
  | `collapseRowNamed` *required* | `(row: string) => string` | — | |
4209
4285
  | `rowActions` *required* | `string` | — | Header of the actions column - for the screen reader, not visible. |
@@ -4649,11 +4725,11 @@ The keys of [Button](#/button/keyboard-button) apply here.
4649
4725
 
4650
4726
  | Prop | Type | Default | Description |
4651
4727
  |---|---|---|---|
4652
- | `direction` | `"row" \| "column"` | `"column"` | Below one another or beside one another. Below is the direction content stands in anyway, without being asked.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping) and 66 more |
4653
- | `gap` | [`SpaceStep`](#type-SpaceStep)<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `3` | Spacing as a step of the 4 px spacing steps (1–8).<br>Shown in: [A column](#/stack-and-grid/a-column), [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps) and 161 more |
4728
+ | `direction` | `"row" \| "column"` | `"column"` | Below one another or beside one another. Below is the direction content stands in anyway, without being asked.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping) and 67 more |
4729
+ | `gap` | [`SpaceStep`](#type-SpaceStep)<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `3` | Spacing as a step of the 4 px spacing steps (1–8).<br>Shown in: [A column](#/stack-and-grid/a-column), [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps) and 164 more |
4654
4730
  | `align` | `CSSProperties["alignItems"]` | — | Alignment across the direction – `alignItems` unchanged.<br>Shown in: [A row](#/stack-and-grid/a-row), [Gaps](#/stack-and-grid/gaps), [A tour summary](#/stack-and-grid/a-tour-summary) and 77 more |
4655
4731
  | `justify` | `CSSProperties["justifyContent"]` | — | Distribution along the direction – `justifyContent` unchanged.<br>Shown in: [A row](#/stack-and-grid/a-row), [A tour summary](#/stack-and-grid/a-tour-summary), [Name the same action in every row (VisuallyHidden)](#/visuallyhidden/actions-in-rows) and 9 more |
4656
- | `wrap` | `boolean` | `false` | Lets the children wrap when the line does not suffice.<br>Shown in: [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping), [Sized to the value (Sizes)](#/sizes/sized-to-the-value) and 29 more |
4732
+ | `wrap` | `boolean` | `false` | Lets the children wrap when the line does not suffice.<br>Shown in: [Gaps](#/stack-and-grid/gaps), [Wrapping](#/stack-and-grid/wrapping), [Sized to the value (Sizes)](#/sizes/sized-to-the-value) and 31 more |
4657
4733
 
4658
4734
  Also takes every attribute of `<div>`.
4659
4735
 
@@ -6264,11 +6340,11 @@ export default function IncidentSummary() {
6264
6340
 
6265
6341
  | Prop | Type | Default | Description |
6266
6342
  |---|---|---|---|
6267
- | `as` | `ElementType` | `"p"` | Element to render as.<br>Shown in: [Tones and weights](#/typography/tones-and-weights), [Set an incident summary](#/typography/incident-summary), [Use the language in your own components (Language)](#/language/own-components) and 17 more |
6268
- | `size` | [`TextSize`](#type-TextSize)<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` | Type size from the token set. It is independent of the element: a `p` may be small without becoming a different element.<br>Shown in: [Configurator](#/typography/configurator-typography), [Sizes](#/typography/sizes), [Tones and weights](#/typography/tones-and-weights) and 128 more |
6343
+ | `as` | `ElementType` | `"p"` | Element to render as.<br>Shown in: [Tones and weights](#/typography/tones-and-weights), [Set an incident summary](#/typography/incident-summary), [Use the language in your own components (Language)](#/language/own-components) and 16 more |
6344
+ | `size` | [`TextSize`](#type-TextSize)<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` | Type size from the token set. It is independent of the element: a `p` may be small without becoming a different element.<br>Shown in: [Configurator](#/typography/configurator-typography), [Sizes](#/typography/sizes), [Tones and weights](#/typography/tones-and-weights) and 129 more |
6269
6345
  | `weight` | [`TextWeight`](#type-TextWeight)<br>`"regular" \| "medium" \| "semibold"` | `"regular"` | Font weight from the token set.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tones and weights](#/typography/tones-and-weights), [Tracking and leading](#/typography/tracking-and-leading) and 16 more |
6270
6346
  | `tone` | [`TextTone`](#type-TextTone)<br>`"default" \| "secondary" \| "muted"` | `"default"` | How loud the text is. `secondary` and `muted` step back without falling below the contrast threshold.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tones and weights](#/typography/tones-and-weights), [Tracking and leading](#/typography/tracking-and-leading) and 94 more |
6271
- | `mono` | `boolean` | `false` | Geist Mono with tabular figures – for numbers and identifiers.<br>Shown in: [Configurator](#/typography/configurator-typography), [Numbers and identifiers](#/typography/numbers), [Handle long values](#/typography/long-values) and 29 more |
6347
+ | `mono` | `boolean` | `false` | Geist Mono with tabular figures – for numbers and identifiers.<br>Shown in: [Configurator](#/typography/configurator-typography), [Numbers and identifiers](#/typography/numbers), [Handle long values](#/typography/long-values) and 30 more |
6272
6348
  | `tracking` | [`TextTracking`](#type-TextTracking)<br>`"normal" \| "tight" \| "display" \| "caps"` | `"normal"` | Letter spacing from the token set. `caps` belongs with letterspaced capitals.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tracking and leading](#/typography/tracking-and-leading), [Set an incident summary](#/typography/incident-summary) |
6273
6349
  | `leading` | [`TextLeading`](#type-TextLeading)<br>`"normal" \| "tight"` | `"normal"` | Line spacing. `tight` for multi-line headings and key figures, where the normal spacing lets the lines fall apart.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tracking and leading](#/typography/tracking-and-leading) |
6274
6350
 
@@ -6758,7 +6834,7 @@ Under forced colours every variant keeps an outline where its edge would lie, an
6758
6834
  |---|---|---|---|
6759
6835
  | `variant` | [`ButtonVariant`](#type-ButtonVariant)<br>`"primary" \| "secondary" \| "ghost" \| "plain" \| "danger"` | `"secondary"` | How loud the button is. `primary` exactly once per surface - two main actions side by side are no longer a main action. `ghost` is quiet in the accent, `plain` quiet and neutral.<br>Shown in: [Configurator](#/button/configurator-button), [Variants](#/button/variants), [Sizes](#/button/sizes) and 51 more |
6760
6836
  | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise.<br>Shown in: [Configurator](#/button/configurator-button), [Sizes](#/button/sizes), [Add an icon](#/button/with-an-icon) and 55 more |
6761
- | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button.<br>Shown in: [Configurator](#/button/configurator-button), [Loading and disabled](#/button/loading-and-disabled), [Submit a form](#/button/submit-a-form) and 3 more |
6837
+ | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button.<br>Shown in: [Configurator](#/button/configurator-button), [Loading and disabled](#/button/loading-and-disabled), [Submit a form](#/button/submit-a-form) and 4 more |
6762
6838
 
6763
6839
  Also takes every attribute of `<button>`.
6764
6840
 
@@ -7111,7 +7187,7 @@ export default function Toolbar() {
7111
7187
  | `children` *required* | `ReactNode` | — | The icon: an SVG, a glyph of the set or an icon font's element. The button sets its size - `--u-icon-size`, `--u-icon-size-sm` at `sm`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Name the icon](#/iconbutton/name-the-icon), [Variants](#/iconbutton/variants) and 5 more |
7112
7188
  | `variant` | [`ButtonVariant`](#type-ButtonVariant)<br>`"primary" \| "secondary" \| "ghost" \| "plain" \| "danger"` | `"plain"` | How loud the button is; `plain` is quiet and neutral, and the rest mean what they mean on a `Button`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Variants](#/iconbutton/variants), [Sizes](#/iconbutton/sizes) and 3 more |
7113
7189
  | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Sizes](#/iconbutton/sizes), [Build a toolbar](#/iconbutton/a-toolbar) and 55 more |
7114
- | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Loading and disabled](#/iconbutton/loading-and-disabled), [Configurator (Button)](#/button/configurator-button) and 3 more |
7190
+ | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Loading and disabled](#/iconbutton/loading-and-disabled), [Configurator (Button)](#/button/configurator-button) and 4 more |
7115
7191
 
7116
7192
  ###### Accessibility
7117
7193
 
@@ -7472,7 +7548,7 @@ Also takes every attribute of `<div>`.
7472
7548
  | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise.<br>Shown in: [Disable while nothing is selected](#/buttongroup/disabled-until-selected), [Build an invoice toolbar](#/buttongroup/invoice-toolbar) |
7473
7549
  | `menuLabel` | `string` | the wording's "More actions" | Label of the trigger. |
7474
7550
  | `align` | `"start" \| "end"` | `"end"` | Alignment of the menu relative to the trigger.<br>Shown in: [Offer variants of the main action](#/buttongroup/split-button) |
7475
- | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator (Button)](#/button/configurator-button), [Loading and disabled (Button)](#/button/loading-and-disabled), [Submit a form (Button)](#/button/submit-a-form) and 3 more |
7551
+ | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator (Button)](#/button/configurator-button), [Loading and disabled (Button)](#/button/loading-and-disabled), [Submit a form (Button)](#/button/submit-a-form) and 4 more |
7476
7552
 
7477
7553
  ###### Events
7478
7554
 
@@ -7981,10 +8057,10 @@ The keys of [Input](#/input/keyboard-input), [NumberInput](#/numberinput/keyboar
7981
8057
 
7982
8058
  | Prop | Type | Default | Description |
7983
8059
  |---|---|---|---|
7984
- | `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 70 more |
7985
- | `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 32 more |
7986
- | `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Show an error](#/formfield/show-an-error), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 21 more |
7987
- | `required` | `boolean` | `false` | Sets the required mark on the label and `aria-required` on the field - on Input, Select, Textarea, NumberInput, Combobox, RadioGroup and Checkbox. The triggers of the pickers and of the MultiSelect are buttons, on which `aria-required` is not a permitted attribute; there the mark carries it alone. It validates nothing - validation belongs to the caller.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Mark a field as required](#/formfield/mark-a-field-as-required), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 8 more |
8060
+ | `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 74 more |
8061
+ | `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 33 more |
8062
+ | `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Show an error](#/formfield/show-an-error), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 22 more |
8063
+ | `required` | `boolean` | `false` | Sets the required mark on the label and `aria-required` on the field - on Input, Select, Textarea, NumberInput, Combobox, RadioGroup and Checkbox. The triggers of the pickers and of the MultiSelect are buttons, on which `aria-required` is not a permitted attribute; there the mark carries it alone. It validates nothing - validation belongs to the caller.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Mark a field as required](#/formfield/mark-a-field-as-required), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 9 more |
7988
8064
  | `fieldId` | `string` | — | Optional: a fixed id for the input element (instead of a generated one).<br>Shown in: [Sum up a form's errors (Alert)](#/alert/above-a-form) |
7989
8065
 
7990
8066
  Also takes every attribute of `<div>`.
@@ -8736,7 +8812,7 @@ export default function SelectAllWithAMixedState() {
8736
8812
 
8737
8813
  | Prop | Type | Default | Description |
8738
8814
  |---|---|---|---|
8739
- | `label` | `ReactNode` | — | Label to the right of the checkbox.<br>Shown in: [Configurator](#/checkbox/configurator-checkbox), [Checkbox](#/checkbox/checkbox), [States](#/checkbox/states) and 9 more |
8815
+ | `label` | `ReactNode` | — | Label to the right of the checkbox.<br>Shown in: [Configurator](#/checkbox/configurator-checkbox), [Checkbox](#/checkbox/checkbox), [States](#/checkbox/states) and 10 more |
8740
8816
  | `indeterminate` | `boolean` | `false` | Partially checked (e.g. "select all" with a mixed selection).<br>Shown in: [Configurator](#/checkbox/configurator-checkbox), [States](#/checkbox/states), [Select all with a mixed state](#/checkbox/select-all-with-a-mixed-state) |
8741
8817
 
8742
8818
  Also takes every attribute of `<input>` – without `size`, `type`.
@@ -8940,7 +9016,7 @@ export default function SettingsOfAService() {
8940
9016
 
8941
9017
  | Prop | Type | Default | Description |
8942
9018
  |---|---|---|---|
8943
- | `label` | `ReactNode` | — | Label to the right of the switch.<br>Shown in: [Configurator](#/switch/configurator-switch), [On and off](#/switch/on-and-off), [States and sizes](#/switch/states-and-sizes) and 11 more |
9019
+ | `label` | `ReactNode` | — | Label to the right of the switch.<br>Shown in: [Configurator](#/switch/configurator-switch), [On and off](#/switch/on-and-off), [States and sizes](#/switch/states-and-sizes) and 12 more |
8944
9020
  | `size` | `"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for a toolbar and dense forms, `md` otherwise.<br>Shown in: [Configurator](#/switch/configurator-switch), [States and sizes](#/switch/states-and-sizes) |
8945
9021
  | `invalid` | `boolean` | — | Marks the switch as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#/switch/configurator-switch), [With an error](#/switch/with-an-error) |
8946
9022
 
@@ -9081,6 +9157,7 @@ export default function States() {
9081
9157
 
9082
9158
  #### When to use something else
9083
9159
 
9160
+ - Two to four short options without explanations, standing among fields → SegmentedControl
9084
9161
  - More than about five options, or options that need no explanation → Select
9085
9162
  - A single yes or no → Checkbox
9086
9163
  - Several options at once → MultiSelect
@@ -9099,10 +9176,10 @@ export default function States() {
9099
9176
 
9100
9177
  | Prop | Type | Default | Description |
9101
9178
  |---|---|---|---|
9102
- | `options` *required* | `readonly `[`RadioOption`](#type-RadioOption)`<T>[]` | — | The possibilities, in the order in which they are meant to stand.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions) and 4 more |
9103
- | `defaultValue` | `T \| null` | — | Initial value of an uncontrolled group. Not together with `value`.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [States](#/radiogroup/states) |
9179
+ | `options` *required* | `readonly `[`RadioOption`](#type-RadioOption)`<T>[]` | — | The possibilities, in the order in which they are meant to stand.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions) and 5 more |
9180
+ | `defaultValue` | `T \| null` | — | Initial value of an uncontrolled group. Not together with `value`.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [States](#/radiogroup/states), [A row of fields (Sizes)](#/sizes/a-row-of-fields) |
9104
9181
  | `value` | `T \| null` | — | The chosen possibility; `null` means: none yet. Together with `onChange` the group is controlled.<br>Shown in: [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions), [Side by side](#/radiogroup/side-by-side) and 2 more |
9105
- | `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Arrangement: one below the other, or side by side.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [Side by side](#/radiogroup/side-by-side) |
9182
+ | `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Arrangement: one below the other, or side by side.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [Side by side](#/radiogroup/side-by-side), [A row of fields (Sizes)](#/sizes/a-row-of-fields) |
9106
9183
  | `size` | `"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for a toolbar and dense forms, `md` otherwise.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [States](#/radiogroup/states) |
9107
9184
  | `disabled` | `boolean` | `false` | Disables the whole group. `RadioOption` disables single possibilities.<br>Shown in: [Configurator](#/radiogroup/configurator-radiogroup), [States](#/radiogroup/states) |
9108
9185
  | `name` | `string` | a generated one | Name of the radio group within the form. |
@@ -9119,11 +9196,199 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
9119
9196
 
9120
9197
  | Prop | Type | Default | Description |
9121
9198
  |---|---|---|---|
9122
- | `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions), [Side by side](#/radiogroup/side-by-side) and 2 more |
9123
- | `label` *required* | `ReactNode` | — | What stands beside it.<br>Shown in: [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions), [Side by side](#/radiogroup/side-by-side) and 2 more |
9199
+ | `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions), [Side by side](#/radiogroup/side-by-side) and 3 more |
9200
+ | `label` *required* | `ReactNode` | — | What stands beside it.<br>Shown in: [Radio group](#/radiogroup/radio-group), [Descriptions](#/radiogroup/descriptions), [Side by side](#/radiogroup/side-by-side) and 3 more |
9124
9201
  | `description` | `ReactNode` | — | Line of explanation under the label; it is read out as well.<br>Shown in: [Descriptions](#/radiogroup/descriptions), [Approve spending against a budget (Scenarios)](#/scenarios/approve-spending), [Set up a team (Scenarios)](#/scenarios/set-up-a-team) |
9125
9202
  | `disabled` | `boolean` | — | Takes the possibility out of the choice but leaves it visible: a choice that does not exist is a different statement from one that may not be made.<br>Shown in: [Descriptions](#/radiogroup/descriptions), [Approve spending against a budget (Scenarios)](#/scenarios/approve-spending) |
9126
9203
 
9204
+ ### SegmentedControl
9205
+
9206
+ One choice out of a few short possibilities, drawn as one field with a segment for each (segmented button, button toggle). It stands in a row of fields as one of them: as tall, as edged and as rounded as a select.
9207
+
9208
+ ```ts
9209
+ import { SegmentedControl } from "@umriss-ui/core";
9210
+ ```
9211
+
9212
+ Demo page: https://romanhaendler.github.io/umriss-ui/core/segmentedcontrol/
9213
+
9214
+ A screen reader hears a radio group, each segment a radio with its position and whether it is chosen; the control is one tab stop, and the arrow keys move and choose at once, skipping disabled possibilities.
9215
+
9216
+ Each segment is as wide as its word, and the chosen one is filled with ink. The width never follows the choice.
9217
+
9218
+ #### Examples
9219
+
9220
+ ##### Segmented control
9221
+
9222
+ Pass `options`, `value` and `onChange`; `value` is `null` until something is chosen.
9223
+
9224
+ ```tsx
9225
+ import { useState } from "react";
9226
+ import { SegmentedControl, Text, Stack } from "@umriss-ui/core";
9227
+
9228
+ export default function SegmentedControlExample() {
9229
+ const [period, setPeriod] = useState<"hour" | "day" | "week" | null>("day");
9230
+
9231
+ return (
9232
+ <Stack gap={3} align="flex-start">
9233
+ <SegmentedControl
9234
+ aria-label="Period"
9235
+ value={period}
9236
+ onChange={setPeriod}
9237
+ options={[
9238
+ { value: "hour", label: "Hour" },
9239
+ { value: "day", label: "Day" },
9240
+ { value: "week", label: "Week" },
9241
+ ]}
9242
+ />
9243
+ <Text size="xs" tone="muted" mono>
9244
+ period: {period ?? "none"}
9245
+ </Text>
9246
+ </Stack>
9247
+ );
9248
+ }
9249
+ ```
9250
+
9251
+ ##### In a field
9252
+
9253
+ Inside a `FormField` the control is named by the field's label and takes its hint or error, required and invalid state by itself.
9254
+
9255
+ ```tsx
9256
+ import { useState } from "react";
9257
+ import { FormField, SegmentedControl } from "@umriss-ui/core";
9258
+
9259
+ export default function InAField() {
9260
+ const [state, setState] = useState<"raw" | "cleaned">("raw");
9261
+
9262
+ return (
9263
+ <FormField
9264
+ label="State of the data"
9265
+ required
9266
+ error={state === "raw" ? "A report is drawn from cleaned data." : undefined}
9267
+ >
9268
+ <SegmentedControl
9269
+ value={state}
9270
+ onChange={setState}
9271
+ options={[
9272
+ { value: "raw", label: "Raw data" },
9273
+ { value: "cleaned", label: "Cleaned data" },
9274
+ ]}
9275
+ />
9276
+ </FormField>
9277
+ );
9278
+ }
9279
+ ```
9280
+
9281
+ ##### States and sizes
9282
+
9283
+ `size` is `md` or `sm`; a `ControlSizeProvider` sets it for a place. `disabled` closes the whole control, `disabled` on an option closes that possibility and leaves it in view - the arrow keys skip it.
9284
+
9285
+ ```tsx
9286
+ import { FormField, SegmentedControl, Stack } from "@umriss-ui/core";
9287
+
9288
+ const PERIODS = [
9289
+ { value: "hour", label: "Hour" },
9290
+ { value: "day", label: "Day" },
9291
+ { value: "week", label: "Week" },
9292
+ ] as const;
9293
+
9294
+ export default function StatesAndSizes() {
9295
+ return (
9296
+ <Stack direction="row" gap={5} wrap>
9297
+ <FormField label="Medium">
9298
+ <SegmentedControl defaultValue="day" options={PERIODS} />
9299
+ </FormField>
9300
+ <FormField label="Small">
9301
+ <SegmentedControl size="sm" defaultValue="day" options={PERIODS} />
9302
+ </FormField>
9303
+ <FormField label="Disabled">
9304
+ <SegmentedControl disabled defaultValue="day" options={PERIODS} />
9305
+ </FormField>
9306
+ <FormField label="One possibility closed" hint="No forecast for this line yet.">
9307
+ <SegmentedControl
9308
+ defaultValue="measured"
9309
+ options={[
9310
+ { value: "measured", label: "Measured" },
9311
+ { value: "forecast", label: "Forecast", disabled: true },
9312
+ ]}
9313
+ />
9314
+ </FormField>
9315
+ </Stack>
9316
+ );
9317
+ }
9318
+ ```
9319
+
9320
+ ##### Long words in a narrow place
9321
+
9322
+ The control is as wide as its words and never wider than its place: on a phone, words that do not fit end in an ellipsis. Short words are the form's strength - past three or four of them, a Select is the better choice.
9323
+
9324
+ ```tsx
9325
+ import { FormField, SegmentedControl } from "@umriss-ui/core";
9326
+
9327
+ export default function LongWordsInANarrowPlace() {
9328
+ return (
9329
+ <FormField label="Readings">
9330
+ <SegmentedControl
9331
+ defaultValue="raw"
9332
+ options={[
9333
+ { value: "raw", label: "Raw readings from the sensors" },
9334
+ { value: "cleaned", label: "Cleaned and validated readings" },
9335
+ ]}
9336
+ />
9337
+ </FormField>
9338
+ );
9339
+ }
9340
+ ```
9341
+
9342
+ #### When to use something else
9343
+
9344
+ - Possibilities that need a line of explanation each → RadioGroup
9345
+ - More than about four possibilities, or long ones → Select
9346
+ - A single yes or no → Switch
9347
+
9348
+ #### Keyboard
9349
+
9350
+ | Key | Action |
9351
+ |---|---|
9352
+ | `Tab` | Moves into the control, onto the chosen segment, and out again. |
9353
+ | `Arrow Right / Arrow Down` | Chooses the next segment, wrapping at the end. |
9354
+ | `Arrow Left / Arrow Up` | Chooses the previous segment. |
9355
+
9356
+ #### API
9357
+
9358
+ ##### `SegmentedControlProps<T extends string>`
9359
+
9360
+ | Prop | Type | Default | Description |
9361
+ |---|---|---|---|
9362
+ | `options` *required* | `readonly `[`SegmentedOption`](#type-SegmentedOption)`<T>[]` | — | The possibilities, two to four, in the order in which they stand.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) and 3 more |
9363
+ | `defaultValue` | `T \| null` | — | Initial value of an uncontrolled control. Not together with `value`.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes), [Long words in a narrow place](#/segmentedcontrol/long-words-in-a-narrow-place) and 1 more |
9364
+ | `value` | `T \| null` | — | The chosen possibility; `null` means: none yet. Together with `onChange` the control is controlled.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) |
9365
+ | `size` | `"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for a toolbar and dense forms, `md` otherwise.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes) |
9366
+ | `disabled` | `boolean` | `false` | Disables the whole control. `SegmentedOption` disables single possibilities.<br>Shown in: [Configurator](#/segmentedcontrol/configurator-segmentedcontrol), [States and sizes](#/segmentedcontrol/states-and-sizes) |
9367
+ | `name` | `string` | a generated one | Name of the radio group within the form. |
9368
+
9369
+ ###### Events
9370
+
9371
+ | Prop | Type | Default | Description |
9372
+ |---|---|---|---|
9373
+ | `onChange` | `(value: T) => void` | — | Runs on every choice – on the one made with the arrow keys as well.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field) |
9374
+
9375
+ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
9376
+
9377
+ ##### `SegmentedOption<T extends string>`
9378
+
9379
+ | Prop | Type | Default | Description |
9380
+ |---|---|---|---|
9381
+ | `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and 2 more |
9382
+ | `label` *required* | `ReactNode` | — | The segment's word - a short one; a long label ends in an ellipsis.<br>Shown in: [Segmented control](#/segmentedcontrol/segmented-control), [In a field](#/segmentedcontrol/in-a-field), [States and sizes](#/segmentedcontrol/states-and-sizes) and 2 more |
9383
+ | `disabled` | `boolean` | — | Takes the possibility out of the choice but leaves it visible.<br>Shown in: [States and sizes](#/segmentedcontrol/states-and-sizes) |
9384
+
9385
+ #### Known limits
9386
+
9387
+ - Two to four short possibilities: a word that does not fit its place ends in an ellipsis.
9388
+ - No icons and no line of explanation in a segment; several chosen at once is not this control.
9389
+
9390
+ What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
9391
+
9127
9392
  ### FileInput
9128
9393
 
9129
9394
  Choose files from the system's dialog or drop them on the zone (file picker, upload field). The chosen files are listed with their size and can be removed one by one.
@@ -10982,11 +11247,11 @@ export default function Colour() {
10982
11247
 
10983
11248
  ##### Refresh a panel in place
10984
11249
 
10985
- While a panel reloads, a spinner in its head says so and the old figures stay readable below it.
11250
+ While a panel reloads, the button that started it carries the spinner - `loading` on a `Button` - and the old figures stay readable below it. The button stays, so the head keeps its height.
10986
11251
 
10987
11252
  ```tsx
10988
11253
  import { useEffect, useState } from "react";
10989
- import { Button, Card, CardBody, CardHeader, Spinner, Stack, Text } from "@umriss-ui/core";
11254
+ import { Button, Card, CardBody, CardHeader, Stack, Text } from "@umriss-ui/core";
10990
11255
 
10991
11256
  export default function APanelRefreshing() {
10992
11257
  const [loading, setLoading] = useState(false);
@@ -11002,18 +11267,9 @@ export default function APanelRefreshing() {
11002
11267
  <CardHeader
11003
11268
  title="Open incidents"
11004
11269
  actions={
11005
- loading ? (
11006
- <Stack direction="row" gap={2} align="center">
11007
- <Spinner size={12} aria-label="Refreshing the incidents" />
11008
- <Text as="span" size="xs" tone="muted">
11009
- Refreshing
11010
- </Text>
11011
- </Stack>
11012
- ) : (
11013
- <Button size="sm" variant="ghost" onClick={() => setLoading(true)}>
11014
- Refresh
11015
- </Button>
11016
- )
11270
+ <Button size="sm" variant="ghost" loading={loading} onClick={() => setLoading(true)}>
11271
+ Refresh
11272
+ </Button>
11017
11273
  }
11018
11274
  />
11019
11275
  <CardBody>
@@ -11049,7 +11305,7 @@ With reduced motion it turns at less than half its speed instead of stopping, so
11049
11305
 
11050
11306
  | Prop | Type | Default | Description |
11051
11307
  |---|---|---|---|
11052
- | `size` | `number` | `14` | Edge length in pixels.<br>Shown in: [Sizes](#/spinner/sizes), [Colour](#/spinner/colour), [Refresh a panel in place](#/spinner/a-panel-refreshing) |
11308
+ | `size` | `number` | `14` | Edge length in pixels.<br>Shown in: [Sizes](#/spinner/sizes), [Colour](#/spinner/colour) |
11053
11309
 
11054
11310
  Also takes every attribute of `<svg>`.
11055
11311
 
@@ -17829,7 +18085,7 @@ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming
17829
18085
 
17830
18086
  [Checkbox](#/checkbox) – A yes or no that counts when the form is saved (tick box). It also shows the mixed state of a parent whose children are partly checked.
17831
18087
 
17832
- Used on [Scenarios](#/), [Theming](#/theming), [ButtonGroup](#/buttongroup), [FormField](#/formfield), [Checkbox](#/checkbox), [Popover](#/popover), [Drawer](#/drawer) and [CommandPalette](#/commandpalette).
18088
+ Used on [Scenarios](#/), [Theming](#/theming), [Sizes](#/sizes), [ButtonGroup](#/buttongroup), [FormField](#/formfield), [Checkbox](#/checkbox), [Popover](#/popover), [Drawer](#/drawer) and [CommandPalette](#/commandpalette).
17833
18089
 
17834
18090
  ##### `ClockGlyph`
17835
18091
 
@@ -17869,7 +18125,7 @@ Used on [ContextMenu](#/contextmenu).
17869
18125
  it unless it says its own. A popover, dialog or tooltip opened from inside
17870
18126
  starts without it.
17871
18127
 
17872
- Used on [Sizes](#/sizes).
18128
+ Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
17873
18129
 
17874
18130
  ##### `CrossGlyph`
17875
18131
 
@@ -17940,7 +18196,7 @@ Used on [Sizes](#/sizes) and [FileInput](#/fileinput).
17940
18196
 
17941
18197
  [FormField](#/formfield) – The frame around a field: its label, a hint below it and the error that replaces the hint. Wrap every field in one, so the question, the help and the problem are read out together.
17942
18198
 
17943
- Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Sizes](#/sizes), [Language](#/language), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [RadioGroup](#/radiogroup), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Alert](#/alert), [Modal](#/modal), [Breadcrumb](#/breadcrumb), [Accordion](#/accordion) and [TreeView](#/treeview).
18199
+ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Sizes](#/sizes), [Language](#/language), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [RadioGroup](#/radiogroup), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Alert](#/alert), [Modal](#/modal), [Breadcrumb](#/breadcrumb), [Accordion](#/accordion) and [TreeView](#/treeview).
17944
18200
 
17945
18201
  ##### `FormFieldBoundary`
17946
18202
 
@@ -18149,7 +18405,13 @@ Used on [Scenarios](#/), [ProgressBar](#/progressbar) and [Stepper](#/stepper).
18149
18405
 
18150
18406
  [RadioGroup](#/radiogroup) – One choice out of a few that all stay in view (radio buttons, option group). Each option may carry a sentence that explains it.
18151
18407
 
18152
- Used on [Scenarios](#/) and [RadioGroup](#/radiogroup).
18408
+ Used on [Scenarios](#/), [Sizes](#/sizes) and [RadioGroup](#/radiogroup).
18409
+
18410
+ ##### `SegmentedControl`
18411
+
18412
+ [SegmentedControl](#/segmentedcontrol) – One choice out of a few short possibilities, drawn as one field with a segment for each (segmented button, button toggle). It stands in a row of fields as one of them: as tall, as edged and as rounded as a select.
18413
+
18414
+ Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
18153
18415
 
18154
18416
  ##### `Select`
18155
18417
 
@@ -18200,7 +18462,7 @@ Used on [Splitter](#/splitter) and [CommandPalette](#/commandpalette).
18200
18462
  [Stack and Grid](#/stack-and-grid) – Children below or beside one another, spaced by a step of the spacing
18201
18463
  scale.
18202
18464
 
18203
- Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Language](#/language), [Stack and Grid](#/stack-and-grid), [Divider](#/divider), [Card](#/card), [Splitter](#/splitter), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Spinner](#/spinner), [ProgressBar](#/progressbar), [Skeleton](#/skeleton), [Alert](#/alert), [Toast](#/toast), [EmptyState](#/emptystate), [Tooltip](#/tooltip), [Popover](#/popover), [Menu](#/menu), [ContextMenu](#/contextmenu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper), [TreeView](#/treeview), [Badge](#/badge), [Tag](#/tag), [Stat](#/stat), [Meter](#/meter) and [Sparkline](#/sparkline).
18465
+ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Language](#/language), [Stack and Grid](#/stack-and-grid), [Divider](#/divider), [Card](#/card), [Splitter](#/splitter), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Spinner](#/spinner), [ProgressBar](#/progressbar), [Skeleton](#/skeleton), [Alert](#/alert), [Toast](#/toast), [EmptyState](#/emptystate), [Tooltip](#/tooltip), [Popover](#/popover), [Menu](#/menu), [ContextMenu](#/contextmenu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper), [TreeView](#/treeview), [Badge](#/badge), [Tag](#/tag), [Stat](#/stat), [Meter](#/meter) and [Sparkline](#/sparkline).
18204
18466
 
18205
18467
  ##### `Stat`
18206
18468
 
@@ -18225,7 +18487,7 @@ Used on [Scenarios](#/), [Theming](#/theming), [Sizes](#/sizes), [Switch](#/swit
18225
18487
  [Tabs](#/tabs) – One tab of a `TabList`; choosing it shows the `TabPanel` of the same
18226
18488
  `value`.
18227
18489
 
18228
- Used on [Scenarios](#/), [Card](#/card), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [Textarea](#/textarea), [RadioGroup](#/radiogroup), [Select](#/select), [Alert](#/alert), [Toast](#/toast), [Tooltip](#/tooltip), [Menu](#/menu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion) and [Tag](#/tag).
18490
+ Used on [Scenarios](#/), [Card](#/card), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [Textarea](#/textarea), [RadioGroup](#/radiogroup), [SegmentedControl](#/segmentedcontrol), [Select](#/select), [Alert](#/alert), [Toast](#/toast), [Tooltip](#/tooltip), [Menu](#/menu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion) and [Tag](#/tag).
18229
18491
 
18230
18492
  ##### `TabList`
18231
18493
 
@@ -18269,7 +18531,7 @@ Used on [Scenarios](#/), [EmptyState](#/emptystate) and [Tag](#/tag).
18269
18531
  [Typography](#/typography) – Body text from the token set; `as` chooses the element, independent of the
18270
18532
  size.
18271
18533
 
18272
- Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Language](#/language), [Stack and Grid](#/stack-and-grid), [Divider](#/divider), [Card](#/card), [Splitter](#/splitter), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Spinner](#/spinner), [ProgressBar](#/progressbar), [Skeleton](#/skeleton), [Toast](#/toast), [EmptyState](#/emptystate), [Tooltip](#/tooltip), [Popover](#/popover), [Menu](#/menu), [ContextMenu](#/contextmenu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper), [TreeView](#/treeview), [Badge](#/badge), [Tag](#/tag), [Stat](#/stat), [Meter](#/meter) and [Sparkline](#/sparkline).
18534
+ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Theming](#/theming), [Sizes](#/sizes), [Language](#/language), [Stack and Grid](#/stack-and-grid), [Divider](#/divider), [Card](#/card), [Splitter](#/splitter), [Dock](#/dock), [Typography](#/typography), [VisuallyHidden](#/visuallyhidden), [Button](#/button), [IconButton](#/iconbutton), [ButtonGroup](#/buttongroup), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Switch](#/switch), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Spinner](#/spinner), [ProgressBar](#/progressbar), [Skeleton](#/skeleton), [Toast](#/toast), [EmptyState](#/emptystate), [Tooltip](#/tooltip), [Popover](#/popover), [Menu](#/menu), [ContextMenu](#/contextmenu), [Modal](#/modal), [Drawer](#/drawer), [ConfirmDialog](#/confirmdialog), [CommandPalette](#/commandpalette), [Breadcrumb](#/breadcrumb), [Tabs](#/tabs), [Accordion](#/accordion), [Stepper](#/stepper), [TreeView](#/treeview), [Badge](#/badge), [Tag](#/tag), [Stat](#/stat), [Meter](#/meter) and [Sparkline](#/sparkline).
18273
18535
 
18274
18536
  ##### `Textarea`
18275
18537
 
@@ -19036,6 +19298,8 @@ otherwise.
19036
19298
  type ControlSize = "sm" | "md";
19037
19299
  ```
19038
19300
 
19301
+ Used on [Sizes](#/sizes).
19302
+
19039
19303
  ##### `ControlSizeProviderProps`
19040
19304
 
19041
19305
  Its table stands on [Sizes](#/sizes/type-ControlSizeProviderProps).
@@ -19436,6 +19700,14 @@ of the filler rows that stand for the rest.
19436
19700
  | `before` *required* | `number` | — | Height of the filler row above, in pixels. |
19437
19701
  | `after` *required* | `number` | — | Height of the filler row below, in pixels. |
19438
19702
 
19703
+ ##### `SegmentedControlProps`
19704
+
19705
+ Its table stands on [SegmentedControl](#/segmentedcontrol/type-SegmentedControlProps).
19706
+
19707
+ ##### `SegmentedOption`
19708
+
19709
+ Its table stands on [SegmentedControl](#/segmentedcontrol/type-SegmentedOption).
19710
+
19439
19711
  ##### `SelectProps`
19440
19712
 
19441
19713
  Its table stands on [Select](#/select/type-SelectProps).
@@ -19925,7 +20197,7 @@ Everything the library puts out as text.
19925
20197
  | `pinToEndHint` *required* | `string` | — | |
19926
20198
  | `unpinHint` *required* | `string` | — | |
19927
20199
  | `exportLabel` *required* | `string` | — | The export button. |
19928
- | `exportPageLabel` *required* | `string` | — | The export button of a table in manual mode, which holds and writes one page. |
20200
+ | `exportPageLabel` *required* | `string` | — | The export button of a table in server mode, which holds and writes one page. |
19929
20201
  | `exportFileName` *required* | `string` | — | The export's file name, where the application names none. |
19930
20202
  | `tableSearchPlaceholder` *required* | `string` | — | Placeholder and accessible name of the search field. |
19931
20203
  | `tableSearchLabel` *required* | `string` | — | |
@@ -19933,7 +20205,7 @@ Everything the library puts out as text.
19933
20205
  | `filterHint` *required* | `string` | — | The tooltip over that button. |
19934
20206
  | `selectRow` *required* | `(row: string) => string` | — | The selection of one row, named after its row header. |
19935
20207
  | `selectAllRows` *required* | `string` | — | The selection of every row in the filtered set. |
19936
- | `selectAllOnPage` *required* | `string` | — | The same checkbox in manual mode, where the table holds one page of a server's. |
20208
+ | `selectAllOnPage` *required* | `string` | — | The same checkbox in server mode, where the table holds one page of a server's. |
19937
20209
  | `expandRowNamed` *required* | `(row: string) => string` | — | The expand button, named after the row header. |
19938
20210
  | `collapseRowNamed` *required* | `(row: string) => string` | — | |
19939
20211
  | `rowActions` *required* | `string` | — | Header of the actions column - for the screen reader, not visible. |
@@ -20141,6 +20413,7 @@ Used on [UmrissProvider](#/umrissprovider) and [Language](#/language).
20141
20413
  | Prop | Type | Default | Description |
20142
20414
  |---|---|---|---|
20143
20415
  | `id` *required* | `string` | — | |
20416
+ | `labelId` *required* | `string` | — | The label's own id. `label htmlFor` names only what HTML can label - an input, a select, a button; a group (`role="radiogroup"`) is named through `aria-labelledby` with this. |
20144
20417
  | `describedBy` | `string` | — | |
20145
20418
  | `invalid` *required* | `boolean` | — | |
20146
20419
  | `required` *required* | `boolean` | — | A required field. Every field whose role carries it turns this into `aria-required` - just as it does with `aria-describedby` and `aria-invalid`. |