@umriss-ui/core 0.44.0 → 0.45.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 +38 -0
- package/README.md +46 -8
- package/dist/core.css +1 -1
- package/dist/core.js +4503 -4047
- package/dist/de.d.ts +26 -0
- package/dist/formats-Bo0qM01D.js +97 -0
- package/dist/index.d.ts +170 -28
- package/dist/wording/de.js +10 -2
- package/docs/llms-full.md +1050 -264
- package/package.json +1 -1
- package/dist/formats-BccAYWgq.js +0 -80
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/core 0.
|
|
1
|
+
# @umriss-ui/core 0.45.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
|
|
|
@@ -1602,6 +1602,7 @@ A line lead at Brenholt Tile Works keeps this control room open through the shif
|
|
|
1602
1602
|
4. The alarm the kiln raised stands in the table; acknowledging it records who knew when and changes nothing else on the screen.
|
|
1603
1603
|
5. Choosing a batch in the plan and opening its details shows what the kiln has fired of it so far, in a drawer.
|
|
1604
1604
|
6. The OEE shows its working, down to the counts it is made of, so the scrap from the excursion can be traced back.
|
|
1605
|
+
7. The plant runs in Berlin time. From another zone the trend, the alarm table and the plan name the zone once; Your time shows every time in the reader's zone instead. The switch is the formats' `timeZone`, the recipe for an application that wants one.
|
|
1605
1606
|
|
|
1606
1607
|
Built from: Stat, Card, ProgressBar, Drawer, Line, ControlChart, Table, Schedule, Calculation.
|
|
1607
1608
|
|
|
@@ -1616,14 +1617,20 @@ import {
|
|
|
1616
1617
|
CardHeader,
|
|
1617
1618
|
Drawer,
|
|
1618
1619
|
Grid,
|
|
1620
|
+
LanguageProvider,
|
|
1619
1621
|
Link,
|
|
1620
1622
|
ModalBody,
|
|
1621
1623
|
ModalFooter,
|
|
1622
1624
|
ModalHeader,
|
|
1623
1625
|
ProgressBar,
|
|
1626
|
+
SegmentedControl,
|
|
1624
1627
|
Stack,
|
|
1625
1628
|
Stat,
|
|
1626
1629
|
Text,
|
|
1630
|
+
useFormats,
|
|
1631
|
+
useLanguage,
|
|
1632
|
+
zoneFields,
|
|
1633
|
+
zoneInstant,
|
|
1627
1634
|
} from "@umriss-ui/core";
|
|
1628
1635
|
import type { FreshnessAges, LimitSet } from "@umriss-ui/core";
|
|
1629
1636
|
import { ControlChart, DataTable, LimitBand, LimitLine, Tooltip, useChart } from "@umriss-ui/charts";
|
|
@@ -1955,7 +1962,16 @@ const LAST = SHIFT_MINUTES - 1;
|
|
|
1955
1962
|
const SECOND = 1000;
|
|
1956
1963
|
const MIN = 60_000;
|
|
1957
1964
|
/* The shift begins at 06:00 today; everything below counts from there. */
|
|
1958
|
-
|
|
1965
|
+
/** The plant's zone: its shift starts at 06:00 here, whoever reads the page. */
|
|
1966
|
+
const PLANT_ZONE = "Europe/Berlin";
|
|
1967
|
+
|
|
1968
|
+
/** Today's 06:00 in the plant's zone, as an instant. */
|
|
1969
|
+
function plantSix(): number {
|
|
1970
|
+
const { year, month, day } = zoneFields(new Date(), PLANT_ZONE);
|
|
1971
|
+
return zoneInstant({ year, month, day, hours: 6 }, PLANT_ZONE).getTime();
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
const START = plantSix();
|
|
1959
1975
|
const at = (minute: number) => START + minute * MIN;
|
|
1960
1976
|
|
|
1961
1977
|
const AGES: FreshnessAges = { stale: 5 * MIN, lost: 30 * MIN };
|
|
@@ -2101,8 +2117,6 @@ function skipTo(event: MouseEvent<HTMLAnchorElement>, id: string) {
|
|
|
2101
2117
|
region?.scrollIntoView({ block: "start" });
|
|
2102
2118
|
}
|
|
2103
2119
|
|
|
2104
|
-
const clock = (t: number) => new Date(t).toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
2105
|
-
|
|
2106
2120
|
const RANK = { high: 0, medium: 1, low: 2 } as const;
|
|
2107
2121
|
|
|
2108
2122
|
/** Worst first: by priority, then what nobody has acknowledged, then the newest. */
|
|
@@ -2112,7 +2126,36 @@ const WORST_FIRST = [
|
|
|
2112
2126
|
{ column: "raised", direction: "desc" },
|
|
2113
2127
|
] as const;
|
|
2114
2128
|
|
|
2129
|
+
/* The switch between the plant's time and the reader's is the recipe for an
|
|
2130
|
+
application that wants one: it changes the zone in the formats, and every
|
|
2131
|
+
time below - the formats' texts, the charts through `Chart`'s `timeZone`, the
|
|
2132
|
+
table, the schedule - follows at once. */
|
|
2115
2133
|
export default function ControlRoom() {
|
|
2134
|
+
const [plantTime, setPlantTime] = useState(true);
|
|
2135
|
+
const parent = useLanguage().formats;
|
|
2136
|
+
const formats = useMemo(() => (plantTime ? { ...parent, timeZone: PLANT_ZONE } : parent), [parent, plantTime]);
|
|
2137
|
+
return (
|
|
2138
|
+
<LanguageProvider formats={formats}>
|
|
2139
|
+
<Stack gap={4}>
|
|
2140
|
+
<SegmentedControl
|
|
2141
|
+
data-callout="7"
|
|
2142
|
+
aria-label="Time shown in"
|
|
2143
|
+
value={plantTime ? "plant" : "reader"}
|
|
2144
|
+
onChange={(value) => setPlantTime(value === "plant")}
|
|
2145
|
+
options={[
|
|
2146
|
+
{ value: "plant", label: "Plant time" },
|
|
2147
|
+
{ value: "reader", label: "Your time" },
|
|
2148
|
+
]}
|
|
2149
|
+
/>
|
|
2150
|
+
<ControlRoomBody />
|
|
2151
|
+
</Stack>
|
|
2152
|
+
</LanguageProvider>
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
function ControlRoomBody() {
|
|
2157
|
+
const { timeZone, time } = useFormats();
|
|
2158
|
+
const clock = (t: number) => time(new Date(t), false);
|
|
2116
2159
|
const { Schedule, Lane, Subtasks } = useSchedule({ initialView: { domain: PLAN_DOMAIN } });
|
|
2117
2160
|
const { minute, wall, running, setRunning } = usePlantMinute();
|
|
2118
2161
|
const now = at(minute);
|
|
@@ -2139,7 +2182,7 @@ export default function ControlRoom() {
|
|
|
2139
2182
|
const ended = one.resolved === undefined ? "Active" : "Resolved";
|
|
2140
2183
|
return {
|
|
2141
2184
|
id: one.id,
|
|
2142
|
-
raised: one.raised,
|
|
2185
|
+
raised: new Date(one.raised),
|
|
2143
2186
|
priority: type.priority,
|
|
2144
2187
|
message: type.label,
|
|
2145
2188
|
state: one.availability === "suppressed" || one.availability === "disabled" ? `${ended}, ${one.availability}` : ended,
|
|
@@ -2167,7 +2210,7 @@ export default function ControlRoom() {
|
|
|
2167
2210
|
<Stack gap={4}>
|
|
2168
2211
|
<Stack direction="row" gap={4} align="center" wrap>
|
|
2169
2212
|
<Text mono>
|
|
2170
|
-
{
|
|
2213
|
+
{clock(now)}
|
|
2171
2214
|
</Text>
|
|
2172
2215
|
<Button size="sm" data-callout="1" disabled={minute === LAST} onClick={() => setRunning(!running)}>
|
|
2173
2216
|
{running ? "Pause the shift" : "Run the shift"}
|
|
@@ -2223,7 +2266,7 @@ export default function ControlRoom() {
|
|
|
2223
2266
|
</Region>
|
|
2224
2267
|
|
|
2225
2268
|
<Region id="room-trend" title="Kiln trend" callout="3">
|
|
2226
|
-
<kilnTrend.Chart height={240} aria-label="Kiln K1, zone 3, over the shift">
|
|
2269
|
+
<kilnTrend.Chart height={240} timeZone={timeZone} aria-label="Kiln K1, zone 3, over the shift">
|
|
2227
2270
|
<kilnTrend.XAxis value="t" domain={[at(0), at(LAST)]} time />
|
|
2228
2271
|
<kilnTrend.YAxis domain={[1170, 1250]} label="°C" />
|
|
2229
2272
|
<LimitBand from={KILN.tolerance[0]} to={KILN.tolerance[1]} severity="warning" label="Tolerance" />
|
|
@@ -2237,9 +2280,7 @@ export default function ControlRoom() {
|
|
|
2237
2280
|
<Region id="room-alarms" title="Alarms" quiet callout="4">
|
|
2238
2281
|
<Stack gap={2}>
|
|
2239
2282
|
<Table selectable aria-label="Alarms">
|
|
2240
|
-
<Column value="raised" label="Raised"
|
|
2241
|
-
{(raised) => clock(raised)}
|
|
2242
|
-
</Column>
|
|
2283
|
+
<Column value="raised" label="Raised" format="time" />
|
|
2243
2284
|
<Column value="priority" label="Priority" sortValue={(priority) => RANK[priority]}>
|
|
2244
2285
|
{(priority) => <Badge tone={priority === "high" ? "danger" : priority === "medium" ? "warning" : "neutral"}>{priority}</Badge>}
|
|
2245
2286
|
</Column>
|
|
@@ -2291,7 +2332,7 @@ export default function ControlRoom() {
|
|
|
2291
2332
|
|
|
2292
2333
|
<Grid columns={2} gap={4}>
|
|
2293
2334
|
<Region id="room-quality" title="Tile length">
|
|
2294
|
-
<tileLength.Chart aria-label="Tile length after firing, individuals chart">
|
|
2335
|
+
<tileLength.Chart timeZone={timeZone} aria-label="Tile length after firing, individuals chart">
|
|
2295
2336
|
<tileLength.XAxis value="t" domain={[at(0), at(LAST)]} time />
|
|
2296
2337
|
<tileLength.YAxis domain={[597, 602]} label="mm" />
|
|
2297
2338
|
<LimitLine value={601.5} severity="alarm" label="USL" />
|
|
@@ -2347,7 +2388,8 @@ function BatchDetails({ batch, minute, onClose }: { batch: Batch; minute: number
|
|
|
2347
2388
|
const fired = upTo(SHIFT.readings, minute).filter((one) => batch.kiln[0] <= one.minute && one.minute < batch.kiln[1]);
|
|
2348
2389
|
const total = fired.reduce((sum, one) => sum + one.fired, 0);
|
|
2349
2390
|
const good = fired.reduce((sum, one) => sum + one.good, 0);
|
|
2350
|
-
const
|
|
2391
|
+
const formats = useFormats();
|
|
2392
|
+
const time = (m: number) => formats.time(new Date(at(m)), false);
|
|
2351
2393
|
|
|
2352
2394
|
return (
|
|
2353
2395
|
<>
|
|
@@ -2683,7 +2725,7 @@ From `ButtonProps` — the full table stands on [Button](#button).
|
|
|
2683
2725
|
- No font is loaded or bundled.
|
|
2684
2726
|
- Chrome 123, Firefox 120 and Safari 17.5 or newer; an older browser discards the tokens and shows the components unstyled.
|
|
2685
2727
|
|
|
2686
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
2728
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
2687
2729
|
|
|
2688
2730
|
### UmrissProvider
|
|
2689
2731
|
|
|
@@ -2894,7 +2936,7 @@ type ToastPosition = "top-start" | "top-center" | "top-end" | "bottom-start" | "
|
|
|
2894
2936
|
|
|
2895
2937
|
- No theme and no default variants for components: a component is configured by its own props.
|
|
2896
2938
|
|
|
2897
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
2939
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
2898
2940
|
|
|
2899
2941
|
## Customising
|
|
2900
2942
|
|
|
@@ -3130,6 +3172,7 @@ One look for every component. A soft glow would read as a second, shadowy border
|
|
|
3130
3172
|
| `--u-text-2xl` | `1.5rem` | same | — |
|
|
3131
3173
|
| `--u-text-mono` | `0.75rem` | same | Figures in Geist Mono inside a control or a cell, beside --u-text-sm set in Sans. The mono cut runs wider and taller, so one step down reads as the same size. It serves as a role: the date picker's value, days and time fields, the numeric field and input, the table's numeric cells. |
|
|
3132
3174
|
| `--u-label-size` | `var(`--u-text-sm`)` | same | The size of a FormField's label. The controls keep their own text size (--u-text-sm), so a label can be set apart from the field's text. |
|
|
3175
|
+
| `--u-label-width` | `10rem` | same | The width of the label column of a FormField with `labelPlacement="start"`; the field takes the rest of the row. |
|
|
3133
3176
|
| `--u-leading-none` | `1` | same | A box as tall as its type: a badge, a tag, a count, a glyph. The height comes from the control or the padding, and the line adds no leading. |
|
|
3134
3177
|
| `--u-leading-tight` | `1.3` | same | — |
|
|
3135
3178
|
| `--u-leading-normal` | `1.5` | same | — |
|
|
@@ -3367,7 +3410,7 @@ From `BadgeProps` — the full table stands on [Badge](#badge).
|
|
|
3367
3410
|
- A token that names another resolves where it is declared: set `--u-color-accent` on a region, and `--u-focus-ring`, which names it on `:root`, still draws the application's accent there. Set the naming token in the region too.
|
|
3368
3411
|
- A panel opened in a portal - a popover, a tooltip, a toast - takes the tokens and the `color-scheme` of the place it lands, not of the region it was opened from; inside a dialog the toasts take the tokens of the dialog's place. Give [UmrissProvider](#umrissprovider) a `portalTarget` inside the region, or override on `:root` - as for the toasts' distance from the window's edge and its sides, `--u-toast-inset-top`, `--u-toast-inset-bottom`, `--u-toast-inset-start` and `--u-toast-inset-end`.
|
|
3369
3412
|
|
|
3370
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
3413
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3371
3414
|
|
|
3372
3415
|
### Sizes
|
|
3373
3416
|
|
|
@@ -3785,7 +3828,7 @@ type ControlSize = "sm" | "md";
|
|
|
3785
3828
|
- A field does not grow to fill a row: give it room with the row's own layout (`flex: 1` on its FormField, or a grid).
|
|
3786
3829
|
- A place that sizes itself by its content and has no width to stop at - an `auto` grid track, an inline block, a row that does not wrap - gives a field at least its natural width, as it gives a native input its own; on a narrow screen let such a row wrap, or size the track with `minmax(0, auto)`.
|
|
3787
3830
|
|
|
3788
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
3831
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3789
3832
|
|
|
3790
3833
|
### Language
|
|
3791
3834
|
|
|
@@ -4099,6 +4142,9 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4099
4142
|
| `datePlaceholder` | Select date | Datum wählen | — |
|
|
4100
4143
|
| `datePanel` | Select date | Datum wählen | Accessible name of the panel. Deliberately kept apart from the placeholder: whoever labels the field differently does not thereby rename the dialog. |
|
|
4101
4144
|
| `dateClear` | Clear date | Datum leeren | — |
|
|
4145
|
+
| `typeDate` | Type a date | Datum eingeben | The name of the DatePicker panel's typed field. |
|
|
4146
|
+
| `notADate` | Not a date | Kein gültiges Datum | Announced when the typed text is no date. |
|
|
4147
|
+
| `dateOutOfRange(min, max)` | `` min && max ? `Not between ${min} and ${max}` : min ? `Not before ${min}` : `Not after ${max}` `` | `` min && max ? `Nicht zwischen ${min} und ${max}` : min ? `Nicht vor ${min}` : `Nicht nach ${max}` `` | Announced when the typed date lies outside `min` and `max`; each bound is written in the formats in use, `null` where there is none. |
|
|
4102
4148
|
| `dateTimePlaceholder` | Select date and time | Datum und Zeit wählen | — |
|
|
4103
4149
|
| `dateTimePanel` | Select date and time | Datum und Zeit wählen | — |
|
|
4104
4150
|
| `dateTimeClear` | Clear date and time | Datum und Zeit leeren | — |
|
|
@@ -4109,6 +4155,8 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4109
4155
|
| `dateTimeRangeClear` | Clear range with time | Zeitraum mit Uhrzeit leeren | The clearing x of the range with time - kept apart from the range without, so that an application can call the two differently. |
|
|
4110
4156
|
| `previousMonth` | Previous month | Voriger Monat | — |
|
|
4111
4157
|
| `nextMonth` | Next month | Nächster Monat | — |
|
|
4158
|
+
| `monthSelect` | Month | Monat | Name of the calendar head's month list. |
|
|
4159
|
+
| `yearSelect` | Year | Jahr | Name of the calendar head's year list. |
|
|
4112
4160
|
| `quickSelect` | Quick select | Schnellwahl | Group name of the preset column. |
|
|
4113
4161
|
| `today` | Today | Heute | — |
|
|
4114
4162
|
| `now` | Now | Jetzt | — |
|
|
@@ -4281,6 +4329,9 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4281
4329
|
| `freshnessFresh` | Fresh | Aktuell | The three freshness states. They are a DIFFERENT axis from the verdict: a stale value keeps its verdict ([ADR-0010](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0010-a-stale-value-keeps-its-verdict.md)). |
|
|
4282
4330
|
| `freshnessStale` | Stale | Veraltet | — |
|
|
4283
4331
|
| `freshnessDisconnected` | No connection | Keine Verbindung | — |
|
|
4332
|
+
| `qualityGood` | Good quality | Qualität gut | The three quality levels ([ADR-0077](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0077-a-bad-value-keeps-its-verdict.md)) - the THIRD axis, beside the verdict and the freshness: how far the value's source vouches for it. A bad value keeps its verdict and its age. |
|
|
4333
|
+
| `qualityUncertain` | Uncertain quality | Qualität unsicher | — |
|
|
4334
|
+
| `qualityBad` | Bad quality | Qualität schlecht | — |
|
|
4284
4335
|
| `asOfAgo(duration)` | `` `As of: ${duration}` `` | `` `Stand: ${duration}` `` | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
4285
4336
|
|
|
4286
4337
|
##### Overlays and states
|
|
@@ -4467,9 +4518,13 @@ Every entry of `Formats`: `DEFAULT_FORMATS` beside `GERMAN_FORMATS`. Each set as
|
|
|
4467
4518
|
|
|
4468
4519
|
| Key | English | German | Description |
|
|
4469
4520
|
|---|---|---|---|
|
|
4521
|
+
| `locale` | en-GB | de-DE | The language tag the set was built in: "en-GB". |
|
|
4522
|
+
| `timeZone` | none: the reader's own | none: the reader's own | The IANA name of the time zone instants are written in, or `undefined` for the reader's own. |
|
|
4523
|
+
| `timeZoneName(d)` | CET | MEZ | The zone's generic name in the set's locale: "Central European Time". Empty until the page has hydrated where no zone is named. |
|
|
4470
4524
|
| `date(d)` | 17/03/2026 | 17.03.2026 | Date as displayed: 17/03/2026 |
|
|
4471
4525
|
| `dateShort(d)` | 17/03 | 17.03. | Short form without the year, in the range footer: 17/03 |
|
|
4472
4526
|
| `month(d)` | March 2026 | März 2026 | The calendar's month header: March 2026 |
|
|
4527
|
+
| `monthName(d)` | March | März | The month alone, in the calendar head's month list: March |
|
|
4473
4528
|
| `dateLong(d)` | Tuesday, 17 March 2026 | Dienstag, 17. März 2026 | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
4474
4529
|
| `time(d, withSeconds)` | 09:05 | 09:05 | Time of day, optionally with seconds: 09:05 or 09:05:03 |
|
|
4475
4530
|
| `dateTime(d, withSeconds)` | 17/03/2026, 09:05 | 17.03.2026, 09:05 | Date and time together: 17/03/2026, 09:05 |
|
|
@@ -4495,7 +4550,7 @@ The keys of [Button](#button), [NumberInput](#numberinput), [Combobox](#combobox
|
|
|
4495
4550
|
|
|
4496
4551
|
| Prop | Type | Default | Description |
|
|
4497
4552
|
|---|---|---|---|
|
|
4498
|
-
| `formats` | `Partial<``Formats``>` | — | How numbers, dates and durations are written. Overridden entry by entry; what is left out keeps writing as `DEFAULT_FORMATS` does - in English notation, whatever the wording says ([ADR-0024](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0024-the-formats-are-english-german-is-freight.md)).<br>Shown in: [German](#language), [English and German side by side](#language), [Write numbers in your own notation](#language) and
|
|
4553
|
+
| `formats` | `Partial<``Formats``>` | — | How numbers, dates and durations are written. Overridden entry by entry; what is left out keeps writing as `DEFAULT_FORMATS` does - in English notation, whatever the wording says ([ADR-0024](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0024-the-formats-are-english-german-is-freight.md)).<br>Shown in: [German](#language), [English and German side by side](#language), [Write numbers in your own notation](#language) and 3 more |
|
|
4499
4554
|
| `wording` | `Partial<Omit<``Wording``, "presets">> & { presets?: Partial<``Wording``["presets"]> }` | — | The presets are a register of their own and are likewise overridden entry by entry.<br>Shown in: [German](#language), [English and German side by side](#language), [Replace single entries](#language) and 2 more |
|
|
4500
4555
|
|
|
4501
4556
|
##### Types on this page
|
|
@@ -4506,11 +4561,15 @@ Everything the library knows about formatting.
|
|
|
4506
4561
|
|
|
4507
4562
|
| Prop | Type | Default | Description |
|
|
4508
4563
|
|---|---|---|---|
|
|
4564
|
+
| `locale` *required* | `string` | — | The language tag the set was built in: "en-GB". |
|
|
4565
|
+
| `timeZone` *required* | `string \| undefined` | — | The IANA name of the time zone instants are written in, or `undefined` for the reader's own.<br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
4566
|
+
| `timeZoneName` *required* | `(d: Date) => string` | — | The zone's generic name in the set's locale: "Central European Time". Empty until the page has hydrated where no zone is named. |
|
|
4509
4567
|
| `date` *required* | `(d: Date) => string` | — | Date as displayed: 17/03/2026<br>Shown in: [A span of days (DateRangePicker)](#daterangepicker) |
|
|
4510
4568
|
| `dateShort` *required* | `(d: Date) => string` | — | Short form without the year, in the range footer: 17/03 |
|
|
4511
4569
|
| `month` *required* | `(d: Date) => string` | — | The calendar's month header: March 2026 |
|
|
4570
|
+
| `monthName` *required* | `(d: Date) => string` | — | The month alone, in the calendar head's month list: March |
|
|
4512
4571
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
4513
|
-
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03 |
|
|
4572
|
+
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03<br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
4514
4573
|
| `dateTime` *required* | `(d: Date, withSeconds: boolean) => string` | — | Date and time together: 17/03/2026, 09:05<br>Shown in: [Use the language in your own components](#language), [Pick a day (DatePicker)](#datepicker), [Set an instant (DateTimePicker)](#datetimepicker) and 1 more |
|
|
4515
4574
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2<br>Shown in: [Set an instant (DateTimePicker)](#datetimepicker) |
|
|
4516
4575
|
| `number` *required* | `(n: number, decimals?: number) => string` | — | A number in the set's notation. Without a digit count the value stands to the tenth decimal place, and a non-zero value that would read 0 there is written in scientific notation; with one it is padded and rounded to exactly that many places.<br>Shown in: [Write numbers in your own notation](#language), [Price an invoice line (NumberInput)](#numberinput), [Split a budget (Slider)](#slider) |
|
|
@@ -4564,6 +4623,9 @@ Everything the library puts out as text.
|
|
|
4564
4623
|
| `datePlaceholder` *required* | `string` | — | |
|
|
4565
4624
|
| `datePanel` *required* | `string` | — | Accessible name of the panel. Deliberately kept apart from the placeholder: whoever labels the field differently does not thereby rename the dialog. |
|
|
4566
4625
|
| `dateClear` *required* | `string` | — | |
|
|
4626
|
+
| `typeDate` *required* | `string` | — | The name of the DatePicker panel's typed field. |
|
|
4627
|
+
| `notADate` *required* | `string` | — | Announced when the typed text is no date. |
|
|
4628
|
+
| `dateOutOfRange` *required* | `(min: string \| null, max: string \| null) => string` | — | Announced when the typed date lies outside `min` and `max`; each bound is written in the formats in use, `null` where there is none. |
|
|
4567
4629
|
| `dateTimePlaceholder` *required* | `string` | — | |
|
|
4568
4630
|
| `dateTimePanel` *required* | `string` | — | |
|
|
4569
4631
|
| `dateTimeClear` *required* | `string` | — | |
|
|
@@ -4574,6 +4636,8 @@ Everything the library puts out as text.
|
|
|
4574
4636
|
| `dateTimeRangeClear` *required* | `string` | — | The clearing x of the range with time - kept apart from the range without, so that an application can call the two differently. |
|
|
4575
4637
|
| `previousMonth` *required* | `string` | — | |
|
|
4576
4638
|
| `nextMonth` *required* | `string` | — | |
|
|
4639
|
+
| `monthSelect` *required* | `string` | — | Name of the calendar head's month list. |
|
|
4640
|
+
| `yearSelect` *required* | `string` | — | Name of the calendar head's year list. |
|
|
4577
4641
|
| `quickSelect` *required* | `string` | — | Group name of the preset column. |
|
|
4578
4642
|
| `today` *required* | `string` | — | <br>Shown in: [Use the language in your own components](#language) |
|
|
4579
4643
|
| `now` *required* | `string` | — | |
|
|
@@ -4724,6 +4788,9 @@ Everything the library puts out as text.
|
|
|
4724
4788
|
| `freshnessFresh` *required* | `string` | — | The three freshness states. They are a DIFFERENT axis from the verdict: a stale value keeps its verdict ([ADR-0010](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0010-a-stale-value-keeps-its-verdict.md)). |
|
|
4725
4789
|
| `freshnessStale` *required* | `string` | — | |
|
|
4726
4790
|
| `freshnessDisconnected` *required* | `string` | — | |
|
|
4791
|
+
| `qualityGood` *required* | `string` | — | The three quality levels ([ADR-0077](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0077-a-bad-value-keeps-its-verdict.md)) - the THIRD axis, beside the verdict and the freshness: how far the value's source vouches for it. A bad value keeps its verdict and its age. |
|
|
4792
|
+
| `qualityUncertain` *required* | `string` | — | |
|
|
4793
|
+
| `qualityBad` *required* | `string` | — | |
|
|
4727
4794
|
| `asOfAgo` *required* | `(duration: string) => string` | — | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
4728
4795
|
| `close` *required* | `string` | — | |
|
|
4729
4796
|
| `closeToast` *required* | `string` | — | |
|
|
@@ -4839,10 +4906,10 @@ Everything the library puts out as text.
|
|
|
4839
4906
|
|
|
4840
4907
|
#### Known limits
|
|
4841
4908
|
|
|
4842
|
-
- Two languages ship; a third is a `Wording` object of your own. No right-to-left ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
4909
|
+
- Two languages ship; a third is a `Wording` object of your own. No right-to-left ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
4843
4910
|
- It holds only what the components say themselves; your labels, titles and data are yours to translate.
|
|
4844
4911
|
|
|
4845
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
4912
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
4846
4913
|
|
|
4847
4914
|
## Layout
|
|
4848
4915
|
|
|
@@ -5144,12 +5211,12 @@ The keys of [Button](#button) apply here.
|
|
|
5144
5211
|
|
|
5145
5212
|
| Prop | Type | Default | Description |
|
|
5146
5213
|
|---|---|---|---|
|
|
5147
|
-
| `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), [Gaps](#stack-and-grid), [Wrapping](#stack-and-grid) and
|
|
5148
|
-
| `gap` | `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 row](#stack-and-grid), [Gaps](#stack-and-grid) and
|
|
5149
|
-
| `align` | `CSSProperties["alignItems"]` | — | Alignment across the direction – `alignItems` unchanged.<br>Shown in: [A row](#stack-and-grid), [Gaps](#stack-and-grid), [A tour summary](#stack-and-grid) and
|
|
5214
|
+
| `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), [Gaps](#stack-and-grid), [Wrapping](#stack-and-grid) and 71 more |
|
|
5215
|
+
| `gap` | `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 row](#stack-and-grid), [Gaps](#stack-and-grid) and 172 more |
|
|
5216
|
+
| `align` | `CSSProperties["alignItems"]` | — | Alignment across the direction – `alignItems` unchanged.<br>Shown in: [A row](#stack-and-grid), [Gaps](#stack-and-grid), [A tour summary](#stack-and-grid) and 80 more |
|
|
5150
5217
|
| `justify` | `CSSProperties["justifyContent"]` | — | Distribution along the direction – `justifyContent` unchanged.<br>Shown in: [A row](#stack-and-grid), [A tour summary](#stack-and-grid), [Name the same action in every row (VisuallyHidden)](#visuallyhidden) and 9 more |
|
|
5151
5218
|
| `wrap` | `boolean` | `false` | Lets the children wrap when the line does not suffice.<br>Shown in: [Gaps](#stack-and-grid), [Wrapping](#stack-and-grid), [Sized to the value (Sizes)](#sizes) and 33 more |
|
|
5152
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5219
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5153
5220
|
|
|
5154
5221
|
Also takes every attribute of `<div>`.
|
|
5155
5222
|
|
|
@@ -5158,9 +5225,9 @@ Also takes every attribute of `<div>`.
|
|
|
5158
5225
|
| Prop | Type | Default | Description |
|
|
5159
5226
|
|---|---|---|---|
|
|
5160
5227
|
| `columns` | `number \| readonly ``GridColumnWidth``[]` | `2` | How many columns, all of one width - or a list with one width per column: a number in pixels, or `"fill"` for a share of what is left. Overridden by minItemWidth.<br>Shown in: [Fixed columns](#stack-and-grid), [Columns of their own widths](#stack-and-grid), [A token for one region (Theming)](#theming) and 5 more |
|
|
5161
|
-
| `minItemWidth` | `string` | — | Responsive: as many columns as fit at this minimum width; wins over `columns`, a list included.<br>Shown in: [Columns by width](#stack-and-grid), [A tour summary](#stack-and-grid), [A dark region (Theming)](#theming) and
|
|
5162
|
-
| `gap` | `SpaceStep`<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `4` | Spacing as a step of the 4 px spacing steps (1–8); applies in both directions.<br>Shown in: [Fixed columns](#stack-and-grid), [Columns by width](#stack-and-grid), [Columns of their own widths](#stack-and-grid) and
|
|
5163
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5228
|
+
| `minItemWidth` | `string` | — | Responsive: as many columns as fit at this minimum width; wins over `columns`, a list included.<br>Shown in: [Columns by width](#stack-and-grid), [A tour summary](#stack-and-grid), [A dark region (Theming)](#theming) and 52 more |
|
|
5229
|
+
| `gap` | `SpaceStep`<br>`1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | `4` | Spacing as a step of the 4 px spacing steps (1–8); applies in both directions.<br>Shown in: [Fixed columns](#stack-and-grid), [Columns by width](#stack-and-grid), [Columns of their own widths](#stack-and-grid) and 59 more |
|
|
5230
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5164
5231
|
|
|
5165
5232
|
Also takes every attribute of `<div>`.
|
|
5166
5233
|
|
|
@@ -5189,7 +5256,7 @@ type GridColumnWidth = number | "fill";
|
|
|
5189
5256
|
- No breakpoints and no responsive props: a grid follows the width through `minItemWidth`, anything else is your stylesheet's.
|
|
5190
5257
|
- Tiles are not arranged by the user: for a dashboard the reader arranges, see `@umriss-ui/dashboard` ([ADR-0064](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0064-a-dashboard-a-user-arranges-is-a-sequence-on-fixed-columns.md)).
|
|
5191
5258
|
|
|
5192
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
5259
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
5193
5260
|
|
|
5194
5261
|
### Divider
|
|
5195
5262
|
|
|
@@ -5291,7 +5358,7 @@ The keys of [Button](#button) apply here.
|
|
|
5291
5358
|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Horizontally it separates rows, vertically it separates columns.<br>Shown in: [Configurator](#divider), [Upright in a bar](#divider) |
|
|
5292
5359
|
| `strong` | `boolean` | `false` | A stronger line - for section boundaries rather than row separation.<br>Shown in: [Configurator](#divider), [Strength and label](#divider), [Upright in a bar](#divider) |
|
|
5293
5360
|
| `label` | `ReactNode` | — | A label in the middle. It makes the line a named separator.<br>Shown in: [Configurator](#divider), [Strength and label](#divider) |
|
|
5294
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5361
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5295
5362
|
|
|
5296
5363
|
Also takes every attribute of `<div>`.
|
|
5297
5364
|
|
|
@@ -5561,7 +5628,7 @@ The keys of [Button](#button) apply here.
|
|
|
5561
5628
|
| `defaultCollapsed` | `boolean` | `false` | Initial state of the collapse mechanism; afterwards it belongs to the card. Only effective together with `collapsible`.<br>Shown in: [Fold the body](#card) |
|
|
5562
5629
|
| `collapsed` | `boolean` | — | Controlled: whether the body is folded away - for a card folded from outside, or one whose state is kept in an address. Only effective together with `collapsible`.<br>Shown in: [Fold from outside](#card) |
|
|
5563
5630
|
| `onCollapsedChange` | `(collapsed: boolean) => void` | — | Reports the wish of the header's button. Controlled, the card folds only once `collapsed` follows; uncontrolled it is merely a message.<br>Shown in: [Fold from outside](#card) |
|
|
5564
|
-
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5631
|
+
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5565
5632
|
|
|
5566
5633
|
Also takes every attribute of the rendered element.
|
|
5567
5634
|
|
|
@@ -5573,7 +5640,7 @@ Also takes every attribute of the rendered element.
|
|
|
5573
5640
|
| `eyebrow` | `ReactNode` | — | Small all-caps label above the title, e.g. a category.<br>Shown in: [Eyebrow and actions](#card), [A flush body](#card), [Fold the body](#card) and 17 more |
|
|
5574
5641
|
| `actions` | `ReactNode` | — | Right-aligned area, e.g. buttons or badges.<br>Shown in: [Eyebrow and actions](#card), [Fold the body](#card), [Cards on a dashboard](#card) and 13 more |
|
|
5575
5642
|
| `divider` | `boolean` | `false` | A dividing line below the head. Only set it where the body needs it - typically with flush data (flush tables, logs). With normal content the white space carries the hierarchy on its own.<br>Shown in: [A flush body](#card) |
|
|
5576
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5643
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5577
5644
|
|
|
5578
5645
|
Also takes every attribute of `<div>` – without `title`.
|
|
5579
5646
|
|
|
@@ -5582,7 +5649,7 @@ Also takes every attribute of `<div>` – without `title`.
|
|
|
5582
5649
|
| Prop | Type | Default | Description |
|
|
5583
5650
|
|---|---|---|---|
|
|
5584
5651
|
| `flush` | `boolean` | `false` | Removes the inner padding, e.g. for flush tables.<br>Shown in: [A flush body](#card) |
|
|
5585
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
5652
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
5586
5653
|
|
|
5587
5654
|
Also takes every attribute of `<div>`.
|
|
5588
5655
|
|
|
@@ -5999,7 +6066,7 @@ export default function ThreePanes() {
|
|
|
5999
6066
|
| `step` | `number` | `5` | How far an arrow key moves the separator, in per cent.<br>Shown in: [Keep the share](#splitter) |
|
|
6000
6067
|
| `separatorLabel` | `string` | the wording's "Resize the panes" | The separator's name. The APG names it after the first pane ("Trend").<br>Shown in: [One above the other](#splitter), [Keep the share](#splitter), [Three panes](#splitter) |
|
|
6001
6068
|
| `children` *required* | `[ReactNode, ReactNode]` | — | The first pane and the second, in this order.<br>Shown in: [Two panes](#splitter), [One above the other](#splitter), [Keep the share](#splitter) and 1 more |
|
|
6002
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6069
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6003
6070
|
|
|
6004
6071
|
###### Events
|
|
6005
6072
|
|
|
@@ -6014,7 +6081,7 @@ Also takes every attribute of `<div>` – without `children`, `defaultValue`, `o
|
|
|
6014
6081
|
- Two panes per splitter, no more. Tiles are not arranged by the user: for a dashboard the reader arranges, see `@umriss-ui/dashboard` ([ADR-0064](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0064-a-dashboard-a-user-arranges-is-a-sequence-on-fixed-columns.md)).
|
|
6015
6082
|
- It does not remember the share beyond its own life; keep it in the user's settings through `value` and `onChange`.
|
|
6016
6083
|
|
|
6017
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
6084
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6018
6085
|
|
|
6019
6086
|
## Typography
|
|
6020
6087
|
|
|
@@ -6371,14 +6438,14 @@ export default function IncidentSummary() {
|
|
|
6371
6438
|
|
|
6372
6439
|
| Prop | Type | Default | Description |
|
|
6373
6440
|
|---|---|---|---|
|
|
6374
|
-
| `as` | `ElementType` | `"p"` | Element to render as.<br>Shown in: [Tones and weights](#typography-2), [Set an incident summary](#typography-2), [Use the language in your own components (Language)](#language) and
|
|
6375
|
-
| `size` | `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-2), [Sizes](#typography-2), [Tones and weights](#typography-2) and
|
|
6376
|
-
| `weight` | `TextWeight`<br>`"regular" \| "medium" \| "semibold"` | `"regular"` | Font weight from the token set.<br>Shown in: [Configurator](#typography-2), [Tones and weights](#typography-2), [Tracking and leading](#typography-2) and
|
|
6377
|
-
| `tone` | `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-2), [Tones and weights](#typography-2), [Tracking and leading](#typography-2) and
|
|
6378
|
-
| `mono` | `boolean` | `false` | Geist Mono with tabular figures – for numbers and identifiers.<br>Shown in: [Configurator](#typography-2), [Numbers and identifiers](#typography-2), [Handle long values](#typography-2) and
|
|
6441
|
+
| `as` | `ElementType` | `"p"` | Element to render as.<br>Shown in: [Tones and weights](#typography-2), [Set an incident summary](#typography-2), [Use the language in your own components (Language)](#language) and 20 more |
|
|
6442
|
+
| `size` | `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-2), [Sizes](#typography-2), [Tones and weights](#typography-2) and 136 more |
|
|
6443
|
+
| `weight` | `TextWeight`<br>`"regular" \| "medium" \| "semibold"` | `"regular"` | Font weight from the token set.<br>Shown in: [Configurator](#typography-2), [Tones and weights](#typography-2), [Tracking and leading](#typography-2) and 18 more |
|
|
6444
|
+
| `tone` | `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-2), [Tones and weights](#typography-2), [Tracking and leading](#typography-2) and 99 more |
|
|
6445
|
+
| `mono` | `boolean` | `false` | Geist Mono with tabular figures – for numbers and identifiers.<br>Shown in: [Configurator](#typography-2), [Numbers and identifiers](#typography-2), [Handle long values](#typography-2) and 34 more |
|
|
6379
6446
|
| `tracking` | `TextTracking`<br>`"normal" \| "tight" \| "display" \| "caps"` | `"normal"` | Letter spacing from the token set. `caps` belongs with letterspaced capitals.<br>Shown in: [Configurator](#typography-2), [Tracking and leading](#typography-2), [Set an incident summary](#typography-2) |
|
|
6380
6447
|
| `leading` | `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-2), [Tracking and leading](#typography-2) |
|
|
6381
|
-
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6448
|
+
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6382
6449
|
|
|
6383
6450
|
Also takes every attribute of the rendered element.
|
|
6384
6451
|
|
|
@@ -6390,7 +6457,7 @@ Also takes every attribute of the rendered element.
|
|
|
6390
6457
|
| `size` | `TextSize`<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | the size matching the level | Optical size; independent of the level.<br>Shown in: [Tones and weights](#typography-2), [Choose the level apart from the size](#typography-2), [Set an incident summary](#typography-2) and 4 more |
|
|
6391
6458
|
| `weight` | `TextWeight`<br>`"regular" \| "medium" \| "semibold"` | `"semibold"` | Font weight from the token set.<br>Shown in: [Tones and weights](#typography-2) |
|
|
6392
6459
|
| `tone` | `TextTone`<br>`"default" \| "secondary" \| "muted"` | `"default"` | How loud the heading is.<br>Shown in: [Choose the level apart from the size](#typography-2) |
|
|
6393
|
-
| `ref` | `Ref<HTMLHeadingElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6460
|
+
| `ref` | `Ref<HTMLHeadingElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6394
6461
|
|
|
6395
6462
|
Also takes every attribute of the heading.
|
|
6396
6463
|
|
|
@@ -6400,7 +6467,7 @@ Also takes every attribute of the heading.
|
|
|
6400
6467
|
|---|---|---|---|
|
|
6401
6468
|
| `size` | `TextSize`<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` | Size from the token set – a link has to match its body text.<br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
6402
6469
|
| `external` | `boolean` | `false` | Opens in a new tab and sets the necessary protective attributes.<br>Shown in: [Link out of the application](#typography-2), [Set an incident summary](#typography-2) |
|
|
6403
|
-
| `ref` | `Ref<HTMLAnchorElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6470
|
+
| `ref` | `Ref<HTMLAnchorElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6404
6471
|
|
|
6405
6472
|
Also takes every attribute of `<a>`.
|
|
6406
6473
|
|
|
@@ -6450,10 +6517,10 @@ type TextLeading = "normal" | "tight";
|
|
|
6450
6517
|
#### Known limits
|
|
6451
6518
|
|
|
6452
6519
|
- No truncation and no line length: both depend on the column, which only the application knows.
|
|
6453
|
-
- No prose styles for lists, quotes or rich text ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
6520
|
+
- No prose styles for lists, quotes or rich text ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
6454
6521
|
- `Link` renders a plain `a` and knows no router; pass it the address your router resolves.
|
|
6455
6522
|
|
|
6456
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
6523
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6457
6524
|
|
|
6458
6525
|
### VisuallyHidden
|
|
6459
6526
|
|
|
@@ -6569,7 +6636,7 @@ export default function ActionsInRows() {
|
|
|
6569
6636
|
|---|---|---|---|
|
|
6570
6637
|
| `as` | `E` | `"span"` | Element to render as.<br>Shown in: [Add a skip link](#visuallyhidden) |
|
|
6571
6638
|
| `focusable` | `boolean` | `false` | Becomes visible as soon as the content receives the focus (skip link).<br>Shown in: [Add a skip link](#visuallyhidden) |
|
|
6572
|
-
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6639
|
+
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6573
6640
|
|
|
6574
6641
|
Also takes every attribute of the chosen element – without `as`, `ref`.
|
|
6575
6642
|
|
|
@@ -6577,7 +6644,7 @@ Also takes every attribute of the chosen element – without `as`, `ref`.
|
|
|
6577
6644
|
|
|
6578
6645
|
- It hides from the eye only; to hide something from everyone, do not render it.
|
|
6579
6646
|
|
|
6580
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
6647
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6581
6648
|
|
|
6582
6649
|
## Actions
|
|
6583
6650
|
|
|
@@ -6863,10 +6930,10 @@ Under forced colours every variant keeps an outline where its edge would lie, an
|
|
|
6863
6930
|
|
|
6864
6931
|
| Prop | Type | Default | Description |
|
|
6865
6932
|
|---|---|---|---|
|
|
6866
|
-
| `variant` | `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), [Variants](#button), [Sizes](#button) and
|
|
6867
|
-
| `size` | `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), [Sizes](#button), [Add an icon](#button) and
|
|
6933
|
+
| `variant` | `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), [Variants](#button), [Sizes](#button) and 55 more |
|
|
6934
|
+
| `size` | `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), [Sizes](#button), [Add an icon](#button) and 60 more |
|
|
6868
6935
|
| `loading` | `boolean` | `false` | Shows a loading indicator and locks the button.<br>Shown in: [Configurator](#button), [Loading and disabled](#button), [Submit a form](#button) and 4 more |
|
|
6869
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
6936
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
6870
6937
|
|
|
6871
6938
|
Also takes every attribute of `<button>`.
|
|
6872
6939
|
|
|
@@ -6906,7 +6973,7 @@ type ControlSize = "sm" | "md";
|
|
|
6906
6973
|
- The label stays on one line; keep it short rather than let it wrap.
|
|
6907
6974
|
- No icon slot: an icon goes among the children, before the label, and the button sets its size.
|
|
6908
6975
|
|
|
6909
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
6976
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6910
6977
|
|
|
6911
6978
|
### IconButton
|
|
6912
6979
|
|
|
@@ -7129,7 +7196,7 @@ Plain buttons for the bar, a group for the pair that belongs together, a menu fo
|
|
|
7129
7196
|
|
|
7130
7197
|
```tsx
|
|
7131
7198
|
import { useState } from "react";
|
|
7132
|
-
import { ButtonGroup, IconButton, Menu, MenuItem, MenuSeparator, MinusGlyph, PlusGlyph, Stack, Text } from "@umriss-ui/core";
|
|
7199
|
+
import { ButtonGroup, IconButton, Menu, MenuItem, MenuSeparator, MinusGlyph, MoreGlyph, PlusGlyph, Stack, Text } from "@umriss-ui/core";
|
|
7133
7200
|
|
|
7134
7201
|
const ZOOM = [50, 75, 100, 150, 200];
|
|
7135
7202
|
|
|
@@ -7179,7 +7246,7 @@ export default function Toolbar() {
|
|
|
7179
7246
|
align="end"
|
|
7180
7247
|
trigger={
|
|
7181
7248
|
<IconButton size="sm" aria-label="More actions for the tours">
|
|
7182
|
-
|
|
7249
|
+
<MoreGlyph />
|
|
7183
7250
|
</IconButton>
|
|
7184
7251
|
}
|
|
7185
7252
|
>
|
|
@@ -7213,17 +7280,17 @@ export default function Toolbar() {
|
|
|
7213
7280
|
|
|
7214
7281
|
| Prop | Type | Default | Description |
|
|
7215
7282
|
|---|---|---|---|
|
|
7216
|
-
| `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), [Name the icon](#iconbutton), [Variants](#iconbutton) and
|
|
7283
|
+
| `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), [Name the icon](#iconbutton), [Variants](#iconbutton) and 6 more |
|
|
7217
7284
|
| `variant` | `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), [Variants](#iconbutton), [Sizes](#iconbutton) and 3 more |
|
|
7218
|
-
| `size` | `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), [Sizes](#iconbutton), [Build a toolbar](#iconbutton) and
|
|
7285
|
+
| `size` | `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), [Sizes](#iconbutton), [Build a toolbar](#iconbutton) and 60 more |
|
|
7219
7286
|
| `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator](#iconbutton), [Loading and disabled](#iconbutton), [Configurator (Button)](#button) and 4 more |
|
|
7220
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
7287
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
7221
7288
|
|
|
7222
7289
|
###### Accessibility
|
|
7223
7290
|
|
|
7224
7291
|
| Prop | Type | Default | Description |
|
|
7225
7292
|
|---|---|---|---|
|
|
7226
|
-
| `aria-label` *required* | `string` | — | The name: what a screen reader announces and the tooltip shows. Required - an icon alone names nothing.<br>Shown in: [Configurator](#iconbutton), [Name the icon](#iconbutton), [Variants](#iconbutton) and
|
|
7293
|
+
| `aria-label` *required* | `string` | — | The name: what a screen reader announces and the tooltip shows. Required - an icon alone names nothing.<br>Shown in: [Configurator](#iconbutton), [Name the icon](#iconbutton), [Variants](#iconbutton) and 6 more |
|
|
7227
7294
|
|
|
7228
7295
|
Also takes every attribute of `<button>`.
|
|
7229
7296
|
|
|
@@ -7263,7 +7330,7 @@ type ControlSize = "sm" | "md";
|
|
|
7263
7330
|
- The tooltip always shows the name; a hint that says more than the name is a `Tooltip` around a `Button`.
|
|
7264
7331
|
- A touch screen shows no tooltip: choose icons whose meaning is common, or a `Button` with a label.
|
|
7265
7332
|
|
|
7266
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
7333
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7267
7334
|
|
|
7268
7335
|
### ButtonGroup
|
|
7269
7336
|
|
|
@@ -7557,7 +7624,7 @@ export default function InvoiceToolbar() {
|
|
|
7557
7624
|
| Prop | Type | Default | Description |
|
|
7558
7625
|
|---|---|---|---|
|
|
7559
7626
|
| `size` | `ButtonSize`<br>`"sm" \| "md"` | the size around it, else `"md"` | The size of the buttons in it that do not say their own - one group, one height.<br>Shown in: [Variants and sizes](#buttongroup) |
|
|
7560
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
7627
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
7561
7628
|
|
|
7562
7629
|
###### Accessibility
|
|
7563
7630
|
|
|
@@ -7578,7 +7645,7 @@ Also takes every attribute of `<div>`.
|
|
|
7578
7645
|
| `menuLabel` | `string` | the wording's "More actions" | Label of the trigger. |
|
|
7579
7646
|
| `align` | `"start" \| "end"` | `"end"` | Alignment of the menu relative to the trigger.<br>Shown in: [Offer variants of the main action](#buttongroup) |
|
|
7580
7647
|
| `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator (Button)](#button), [Loading and disabled (Button)](#button), [Submit a form (Button)](#button) and 4 more |
|
|
7581
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
7648
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
7582
7649
|
|
|
7583
7650
|
###### Events
|
|
7584
7651
|
|
|
@@ -7623,7 +7690,7 @@ type ControlSize = "sm" | "md";
|
|
|
7623
7690
|
|
|
7624
7691
|
- No toggle or segmented state; a choice that stays is a radio group.
|
|
7625
7692
|
|
|
7626
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
7693
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7627
7694
|
|
|
7628
7695
|
## Forms
|
|
7629
7696
|
|
|
@@ -7868,6 +7935,42 @@ export default function TakeADeliveryAddress() {
|
|
|
7868
7935
|
}
|
|
7869
7936
|
```
|
|
7870
7937
|
|
|
7938
|
+
##### Reveal a secret
|
|
7939
|
+
|
|
7940
|
+
`Input` has no end slot, because `chars` counts the field's own chrome; the eye is your application's button beside it, and `type` is your state.
|
|
7941
|
+
|
|
7942
|
+
```tsx
|
|
7943
|
+
import { useState } from "react";
|
|
7944
|
+
import { FormField, IconButton, Input, Stack } from "@umriss-ui/core";
|
|
7945
|
+
|
|
7946
|
+
/* Stands for the application's own icon set. */
|
|
7947
|
+
function Eye({ crossed }: { crossed: boolean }) {
|
|
7948
|
+
return (
|
|
7949
|
+
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
|
|
7950
|
+
<path d="M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round" />
|
|
7951
|
+
<circle cx="8" cy="8" r="2" fill="none" stroke="currentColor" strokeWidth="1.4" />
|
|
7952
|
+
{crossed && <path d="M2.5 13.5l11-11" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" />}
|
|
7953
|
+
</svg>
|
|
7954
|
+
);
|
|
7955
|
+
}
|
|
7956
|
+
|
|
7957
|
+
export default function RevealASecret() {
|
|
7958
|
+
const [token, setToken] = useState("sk_live_7f3a91c2d0b4");
|
|
7959
|
+
const [shown, setShown] = useState(false);
|
|
7960
|
+
|
|
7961
|
+
return (
|
|
7962
|
+
<Stack direction="row" gap={2} align="flex-end" style={{ maxWidth: 420 }}>
|
|
7963
|
+
<FormField label="API token" style={{ flex: 1 }}>
|
|
7964
|
+
<Input type={shown ? "text" : "password"} autoComplete="off" value={token} onChange={(event) => setToken(event.target.value)} />
|
|
7965
|
+
</FormField>
|
|
7966
|
+
<IconButton aria-label="Show the token" aria-pressed={shown} onClick={() => setShown(!shown)}>
|
|
7967
|
+
<Eye crossed={shown} />
|
|
7968
|
+
</IconButton>
|
|
7969
|
+
</Stack>
|
|
7970
|
+
);
|
|
7971
|
+
}
|
|
7972
|
+
```
|
|
7973
|
+
|
|
7871
7974
|
#### When to use something else
|
|
7872
7975
|
|
|
7873
7976
|
- A figure that is calculated with, with a unit and a range → NumberInput
|
|
@@ -7892,7 +7995,7 @@ export default function TakeADeliveryAddress() {
|
|
|
7892
7995
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#input), [With an error](#input), [With an error (TreeView)](#treeview) |
|
|
7893
7996
|
| `numeric` | `boolean` | `false` | Right-aligned tabular figures in Geist Mono, e.g. for key figures.<br>Shown in: [Configurator](#input), [Align reference numbers](#input), [Take a delivery address](#input) and 2 more |
|
|
7894
7997
|
| `clearable` | `boolean` | `false` | Shows a gently appearing cross where there is content, which clears the input. Requires a controlled field (value) and onClear.<br>Shown in: [Clear the field](#input), [A row that holds still (Sizes)](#sizes) |
|
|
7895
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
7998
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
7896
7999
|
|
|
7897
8000
|
###### Events
|
|
7898
8001
|
|
|
@@ -7907,7 +8010,7 @@ Also takes every attribute of `<input>` – without `size`.
|
|
|
7907
8010
|
- No input masks or formatting while typing; check the value on leave or on submit.
|
|
7908
8011
|
- No validation of its own: the error is the application's, handed to the `FormField`.
|
|
7909
8012
|
|
|
7910
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
8013
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7911
8014
|
|
|
7912
8015
|
### FormField
|
|
7913
8016
|
|
|
@@ -7996,16 +8099,16 @@ export default function MarkAFieldAsRequired() {
|
|
|
7996
8099
|
|
|
7997
8100
|
##### Check an invoice on submit
|
|
7998
8101
|
|
|
7999
|
-
Hold the values, check them all on submit, and give each `FormField` its own message; the
|
|
8102
|
+
Hold the values, check them all on submit, and give each `FormField` its own message; the summary, the announcement and the focus are the application's, since only it knows its form.
|
|
8000
8103
|
|
|
8001
8104
|
```tsx
|
|
8002
|
-
import { useState } from "react";
|
|
8105
|
+
import { useRef, useState } from "react";
|
|
8003
8106
|
import type { FormEvent } from "react";
|
|
8004
|
-
import { Button, DatePicker, FormField, Grid, Input, NumberInput,
|
|
8107
|
+
import { Button, Combobox, DatePicker, FormField, Grid, Input, NumberInput, Stack, Text, announce } from "@umriss-ui/core";
|
|
8005
8108
|
|
|
8006
8109
|
interface Invoice {
|
|
8007
8110
|
number: string;
|
|
8008
|
-
centre: string;
|
|
8111
|
+
centre: string | null;
|
|
8009
8112
|
amount: number | null;
|
|
8010
8113
|
due: Date | null;
|
|
8011
8114
|
}
|
|
@@ -8015,16 +8118,30 @@ type Errors = Partial<Record<keyof Invoice, string>>;
|
|
|
8015
8118
|
function check(invoice: Invoice): Errors {
|
|
8016
8119
|
const errors: Errors = {};
|
|
8017
8120
|
if (!/^INV-\d{4}$/.test(invoice.number)) errors.number = "An invoice number reads INV- and four digits.";
|
|
8018
|
-
if (invoice.centre ===
|
|
8121
|
+
if (invoice.centre === null) errors.centre = "Choose the cost centre the invoice is booked on.";
|
|
8019
8122
|
if (invoice.amount === null || invoice.amount <= 0) errors.amount = "Give the net amount.";
|
|
8020
8123
|
if (invoice.due === null) errors.due = "Give the due date from the invoice.";
|
|
8021
8124
|
return errors;
|
|
8022
8125
|
}
|
|
8023
8126
|
|
|
8127
|
+
const CENTRES = [
|
|
8128
|
+
{ value: "CC-1200", label: "CC-1200 Marketing" },
|
|
8129
|
+
{ value: "CC-2200", label: "CC-2200 Design" },
|
|
8130
|
+
{ value: "CC-4300", label: "CC-4300 IT" },
|
|
8131
|
+
];
|
|
8132
|
+
|
|
8133
|
+
const KEYS = ["number", "centre", "amount", "due"] as const;
|
|
8134
|
+
|
|
8024
8135
|
export default function CheckAnInvoiceOnSubmit() {
|
|
8025
|
-
const [invoice, setInvoice] = useState<Invoice>({ number: "INV-31", centre:
|
|
8136
|
+
const [invoice, setInvoice] = useState<Invoice>({ number: "INV-31", centre: null, amount: 4860, due: null });
|
|
8026
8137
|
const [errors, setErrors] = useState<Errors>({});
|
|
8027
8138
|
const [booked, setBooked] = useState(false);
|
|
8139
|
+
/* Every focus goes through the control's own ref; a DatePicker's is its trigger. */
|
|
8140
|
+
const numberRef = useRef<HTMLInputElement>(null);
|
|
8141
|
+
const centreRef = useRef<HTMLInputElement>(null);
|
|
8142
|
+
const amountRef = useRef<HTMLInputElement>(null);
|
|
8143
|
+
const dueRef = useRef<HTMLButtonElement>(null);
|
|
8144
|
+
const focus = (key: (typeof KEYS)[number]) => ({ number: numberRef, centre: centreRef, amount: amountRef, due: dueRef })[key].current?.focus();
|
|
8028
8145
|
const set = (patch: Partial<Invoice>) => setInvoice((previous) => ({ ...previous, ...patch }));
|
|
8029
8146
|
|
|
8030
8147
|
const submit = (event: FormEvent) => {
|
|
@@ -8032,30 +8149,52 @@ export default function CheckAnInvoiceOnSubmit() {
|
|
|
8032
8149
|
const next = check(invoice);
|
|
8033
8150
|
setErrors(next);
|
|
8034
8151
|
setBooked(Object.keys(next).length === 0);
|
|
8152
|
+
const failed = KEYS.filter((key) => next[key] !== undefined);
|
|
8153
|
+
if (failed.length === 0) return;
|
|
8154
|
+
announce(failed.length === 1 ? "1 problem with the invoice." : `${failed.length} problems with the invoice.`);
|
|
8155
|
+
focus(failed[0]!);
|
|
8035
8156
|
};
|
|
8036
8157
|
|
|
8158
|
+
const problems = KEYS.filter((key) => errors[key] !== undefined);
|
|
8159
|
+
|
|
8037
8160
|
return (
|
|
8038
8161
|
<form onSubmit={submit} noValidate style={{ maxWidth: 560 }}>
|
|
8039
8162
|
<Stack gap={4}>
|
|
8163
|
+
{problems.length > 0 && (
|
|
8164
|
+
<section aria-labelledby="invoice-problems" style={{ border: "1px solid var(--u-color-danger)", borderRadius: 6, padding: "var(--u-space-3) var(--u-space-4)" }}>
|
|
8165
|
+
<Text as="h3" id="invoice-problems" size="md" weight="semibold">
|
|
8166
|
+
{problems.length === 1 ? "There is 1 problem" : `There are ${problems.length} problems`}
|
|
8167
|
+
</Text>
|
|
8168
|
+
<Text as="ul" size="sm" style={{ margin: 0, paddingInlineStart: "var(--u-space-4)" }}>
|
|
8169
|
+
{problems.map((key) => (
|
|
8170
|
+
<li key={key}>
|
|
8171
|
+
<a
|
|
8172
|
+
href="#"
|
|
8173
|
+
style={{ color: "var(--u-color-danger)" }}
|
|
8174
|
+
onClick={(event) => {
|
|
8175
|
+
event.preventDefault();
|
|
8176
|
+
focus(key);
|
|
8177
|
+
}}
|
|
8178
|
+
>
|
|
8179
|
+
{errors[key]}
|
|
8180
|
+
</a>
|
|
8181
|
+
</li>
|
|
8182
|
+
))}
|
|
8183
|
+
</Text>
|
|
8184
|
+
</section>
|
|
8185
|
+
)}
|
|
8040
8186
|
<Grid minItemWidth="220px" gap={4}>
|
|
8041
8187
|
<FormField label="Invoice number" required error={errors.number}>
|
|
8042
|
-
<Input numeric value={invoice.number} onChange={(event) => set({ number: event.target.value })} />
|
|
8188
|
+
<Input ref={numberRef} numeric value={invoice.number} onChange={(event) => set({ number: event.target.value })} />
|
|
8043
8189
|
</FormField>
|
|
8044
8190
|
<FormField label="Cost centre" required error={errors.centre}>
|
|
8045
|
-
<
|
|
8046
|
-
<option value="" disabled>
|
|
8047
|
-
Choose a cost centre
|
|
8048
|
-
</option>
|
|
8049
|
-
<option value="CC-1200">CC-1200 Marketing</option>
|
|
8050
|
-
<option value="CC-2200">CC-2200 Design</option>
|
|
8051
|
-
<option value="CC-4300">CC-4300 IT</option>
|
|
8052
|
-
</Select>
|
|
8191
|
+
<Combobox ref={centreRef} options={CENTRES} value={invoice.centre} onChange={(centre) => set({ centre })} placeholder="Choose a cost centre" />
|
|
8053
8192
|
</FormField>
|
|
8054
8193
|
<FormField label="Net amount" required error={errors.amount}>
|
|
8055
|
-
<NumberInput value={invoice.amount} onChange={(amount) => set({ amount })} min={0} decimals={2} suffix="€" />
|
|
8194
|
+
<NumberInput ref={amountRef} value={invoice.amount} onChange={(amount) => set({ amount })} min={0} decimals={2} suffix="€" />
|
|
8056
8195
|
</FormField>
|
|
8057
8196
|
<FormField label="Due" required error={errors.due}>
|
|
8058
|
-
<DatePicker value={invoice.due} onChange={(due) => set({ due })} clearable />
|
|
8197
|
+
<DatePicker ref={dueRef} value={invoice.due} onChange={(due) => set({ due })} clearable />
|
|
8059
8198
|
</FormField>
|
|
8060
8199
|
</Grid>
|
|
8061
8200
|
<Stack direction="row" gap={3} align="center">
|
|
@@ -8074,6 +8213,44 @@ export default function CheckAnInvoiceOnSubmit() {
|
|
|
8074
8213
|
}
|
|
8075
8214
|
```
|
|
8076
8215
|
|
|
8216
|
+
##### Put the labels in a column
|
|
8217
|
+
|
|
8218
|
+
Set `labelPlacement="start"` on each field of a property panel; the labels stand in a column as wide as `--u-label-width`, and a narrow place puts each field under its label.
|
|
8219
|
+
|
|
8220
|
+
```tsx
|
|
8221
|
+
import { useState } from "react";
|
|
8222
|
+
import { Checkbox, FormField, Input, NumberInput, Select, Stack, Switch } from "@umriss-ui/core";
|
|
8223
|
+
|
|
8224
|
+
export default function PutTheLabelsInAColumn() {
|
|
8225
|
+
const [budget, setBudget] = useState<number | null>(0);
|
|
8226
|
+
return (
|
|
8227
|
+
<Stack gap={3} style={{ maxWidth: 560 }}>
|
|
8228
|
+
<FormField label="Name" labelPlacement="start" required>
|
|
8229
|
+
<Input defaultValue="Invoice review" />
|
|
8230
|
+
</FormField>
|
|
8231
|
+
<FormField label="Cost centre" labelPlacement="start" hint="As on the budget sheet, for example CC-2100.">
|
|
8232
|
+
<Input defaultValue="CC-2100" />
|
|
8233
|
+
</FormField>
|
|
8234
|
+
<FormField label="Budget" labelPlacement="start" error="The budget must be above zero.">
|
|
8235
|
+
<NumberInput value={budget} onChange={setBudget} />
|
|
8236
|
+
</FormField>
|
|
8237
|
+
<FormField label="Owner" labelPlacement="start">
|
|
8238
|
+
<Select defaultValue="finance">
|
|
8239
|
+
<option value="finance">Finance</option>
|
|
8240
|
+
<option value="sales">Sales</option>
|
|
8241
|
+
</Select>
|
|
8242
|
+
</FormField>
|
|
8243
|
+
<FormField label="Archived" labelPlacement="start">
|
|
8244
|
+
<Switch label="Hide from the overview" />
|
|
8245
|
+
</FormField>
|
|
8246
|
+
<FormField label="Approval" labelPlacement="start">
|
|
8247
|
+
<Checkbox label="Checked by a second person" />
|
|
8248
|
+
</FormField>
|
|
8249
|
+
</Stack>
|
|
8250
|
+
);
|
|
8251
|
+
}
|
|
8252
|
+
```
|
|
8253
|
+
|
|
8077
8254
|
#### Keyboard
|
|
8078
8255
|
|
|
8079
8256
|
The keys of [Input](#input), [NumberInput](#numberinput), [Checkbox](#checkbox), [Select](#select), [DatePicker](#datepicker) and [Button](#button) apply here.
|
|
@@ -8084,12 +8261,13 @@ The keys of [Input](#input), [NumberInput](#numberinput), [Checkbox](#checkbox),
|
|
|
8084
8261
|
|
|
8085
8262
|
| Prop | Type | Default | Description |
|
|
8086
8263
|
|---|---|---|---|
|
|
8087
|
-
| `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), [Label and hint](#formfield), [Show an error](#formfield) and
|
|
8088
|
-
| `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#formfield), [Label and hint](#formfield), [Show an error](#formfield) and
|
|
8089
|
-
| `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#formfield), [Show an error](#formfield), [Check an invoice on submit](#formfield) and
|
|
8090
|
-
| `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 ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).<br>Shown in: [Configurator](#formfield), [Mark a field as required](#formfield), [Check an invoice on submit](#formfield) and
|
|
8264
|
+
| `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), [Label and hint](#formfield), [Show an error](#formfield) and 87 more |
|
|
8265
|
+
| `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#formfield), [Label and hint](#formfield), [Show an error](#formfield) and 37 more |
|
|
8266
|
+
| `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#formfield), [Show an error](#formfield), [Check an invoice on submit](#formfield) and 23 more |
|
|
8267
|
+
| `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 ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).<br>Shown in: [Configurator](#formfield), [Mark a field as required](#formfield), [Check an invoice on submit](#formfield) and 10 more |
|
|
8091
8268
|
| `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) |
|
|
8092
|
-
| `
|
|
8269
|
+
| `labelPlacement` | `"top" \| "start"` | `"top"` | Where the label stands: `"top"` above the field (the default) or `"start"` beside it, in a column as wide as `--u-label-width`, level on the first baseline. `"start"` is for a column of fields and fills its place; where the row cannot hold the label and 12rem of field, the field wraps under the label. A `Grid` of fields keeps `"top"`.<br>Shown in: [Put the labels in a column](#formfield) |
|
|
8270
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [Check an invoice on submit](#formfield), [A row that holds still (Sizes)](#sizes), [An anchored surface (Popover)](#popover) and 4 more |
|
|
8093
8271
|
|
|
8094
8272
|
Also takes every attribute of `<div>`.
|
|
8095
8273
|
|
|
@@ -8098,7 +8276,7 @@ Also takes every attribute of `<div>`.
|
|
|
8098
8276
|
- No validation: the caller's form library decides; pass `error` ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)). No form state and no submit handling either.
|
|
8099
8277
|
- One field per `FormField`; a group of fields that share one label is a fieldset of your own.
|
|
8100
8278
|
|
|
8101
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
8279
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8102
8280
|
|
|
8103
8281
|
### Textarea
|
|
8104
8282
|
|
|
@@ -8278,7 +8456,7 @@ With `showCount` the characters left stand in a polite live region: a screen rea
|
|
|
8278
8456
|
| `maxRows` | `number` | — | Upper bound for `autoGrow` in rows; beyond it the field scrolls.<br>Shown in: [Grow with the text](#textarea), [Resolve an incident (Scenarios)](#resolve-an-incident), [Approve spending against a budget (Scenarios)](#approve-spending-against-a-budget) |
|
|
8279
8457
|
| `showCount` | `boolean` | `false` | Shows at the bottom right how many characters still fit. Needs `maxLength`.<br>Shown in: [Count the characters](#textarea) |
|
|
8280
8458
|
| `resize` | `"none" \| "vertical"` | `"none"` while the field grows by itself, else `"vertical"` | Whether the browser's handle for dragging is offered.<br>Shown in: [Configurator](#textarea) |
|
|
8281
|
-
| `ref` | `Ref<HTMLTextAreaElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
8459
|
+
| `ref` | `Ref<HTMLTextAreaElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
8282
8460
|
|
|
8283
8461
|
Also takes every attribute of `<textarea>` – without `cols`.
|
|
8284
8462
|
|
|
@@ -8286,7 +8464,7 @@ Also takes every attribute of `<textarea>` – without `cols`.
|
|
|
8286
8464
|
|
|
8287
8465
|
- Plain text only: no formatting, mentions or rich text.
|
|
8288
8466
|
|
|
8289
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
8467
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8290
8468
|
|
|
8291
8469
|
### NumberInput
|
|
8292
8470
|
|
|
@@ -8522,7 +8700,7 @@ export default function YearWithoutGrouping() {
|
|
|
8522
8700
|
|
|
8523
8701
|
| Prop | Type | Default | Description |
|
|
8524
8702
|
|---|---|---|---|
|
|
8525
|
-
| `value` *required* | `number \| null` | — | The number, or `null` for "not stated". An empty field is not zero: a quantity that was not measured is not a quantity of zero.<br>Shown in: [Configurator](#numberinput), [Number field](#numberinput), [Units and decimals](#numberinput) and
|
|
8703
|
+
| `value` *required* | `number \| null` | — | The number, or `null` for "not stated". An empty field is not zero: a quantity that was not measured is not a quantity of zero.<br>Shown in: [Configurator](#numberinput), [Number field](#numberinput), [Units and decimals](#numberinput) and 15 more |
|
|
8526
8704
|
| `min` | `number` | — | Lower bound. Every reported value is clamped; the text in the field follows on leaving.<br>Shown in: [Configurator](#numberinput), [Number field](#numberinput), [Units and decimals](#numberinput) and 12 more |
|
|
8527
8705
|
| `max` | `number` | — | Upper bound. Every reported value is clamped; the text in the field follows on leaving.<br>Shown in: [Configurator](#numberinput), [Units and decimals](#numberinput), [Keep a value in range](#numberinput) and 6 more |
|
|
8528
8706
|
| `step` | `number` | `1` | Step size for the arrow keys; Shift multiplies it by ten.<br>Shown in: [Configurator](#numberinput), [Units and decimals](#numberinput), [Keep a value in range](#numberinput) and 3 more |
|
|
@@ -8533,13 +8711,13 @@ export default function YearWithoutGrouping() {
|
|
|
8533
8711
|
| `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](#numberinput), [States](#numberinput), [Set up a team (Scenarios)](#set-up-a-team) |
|
|
8534
8712
|
| `chars` | `number` | — | The width in characters - room for the number; the field adds its own padding and steppers, and the room for a `prefix` and `suffix` given as text. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and is 10 characters wide where the place asks - in a toolbar or a row.<br>Shown in: [Configurator](#numberinput), [Sized to the value (Sizes)](#sizes) |
|
|
8535
8713
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` – by hand only needed without `FormField`.<br>Shown in: [Configurator](#numberinput), [With an error](#numberinput) |
|
|
8536
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
8714
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
8537
8715
|
|
|
8538
8716
|
###### Events
|
|
8539
8717
|
|
|
8540
8718
|
| Prop | Type | Default | Description |
|
|
8541
8719
|
|---|---|---|---|
|
|
8542
|
-
| `onChange` *required* | `(value: number \| null) => void` | — | Runs on every valid input, with `null` for the emptied field – and always clamped: what goes out lies between `min` and `max`, by every route, while typing included. Only the text in the field may still stand outside while typing; on leaving it is set to the clamped value.<br>Shown in: [Configurator](#numberinput), [Number field](#numberinput), [Units and decimals](#numberinput) and
|
|
8720
|
+
| `onChange` *required* | `(value: number \| null) => void` | — | Runs on every valid input, with `null` for the emptied field – and always clamped: what goes out lies between `min` and `max`, by every route, while typing included. Only the text in the field may still stand outside while typing; on leaving it is set to the clamped value.<br>Shown in: [Configurator](#numberinput), [Number field](#numberinput), [Units and decimals](#numberinput) and 15 more |
|
|
8543
8721
|
|
|
8544
8722
|
Also takes every attribute of `<input>` – without `onChange`, `prefix`, `size`, `type`, `value`.
|
|
8545
8723
|
|
|
@@ -8548,7 +8726,7 @@ Also takes every attribute of `<input>` – without `onChange`, `prefix`, `size`
|
|
|
8548
8726
|
- No expressions: “12*4” is not calculated.
|
|
8549
8727
|
- No currency conversion; the unit is a label.
|
|
8550
8728
|
|
|
8551
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
8729
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8552
8730
|
|
|
8553
8731
|
### Slider
|
|
8554
8732
|
|
|
@@ -8716,7 +8894,7 @@ export default function SplitABudget() {
|
|
|
8716
8894
|
| `marks` | `readonly ``SliderMark``[]` | — | Values marked on the track; an object with a `label` writes the word beneath its mark. A mark shows a value, it does not catch the thumb.<br>Shown in: [Units and marks](#slider), [Set roughly, then exactly](#slider), [Split a budget](#slider) and 1 more |
|
|
8717
8895
|
| `format` | `(value: number) => string` | the number in the formats' notation, with as many decimals as the step has | The value as text: for the readout and for the screen reader (`aria-valuetext`).<br>Shown in: [Units and marks](#slider), [Set roughly, then exactly](#slider), [Split a budget](#slider) and 3 more |
|
|
8718
8896
|
| `showValue` | `boolean` | `true` | The value in mono beside the track.<br>Shown in: [Configurator](#slider), [Units and marks](#slider), [Set roughly, then exactly](#slider) and 1 more |
|
|
8719
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
8897
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
8720
8898
|
|
|
8721
8899
|
###### Events
|
|
8722
8900
|
|
|
@@ -8741,7 +8919,7 @@ type SliderMark = number | { value: number; label?: ReactNode };
|
|
|
8741
8919
|
- One thumb: no range with two ends.
|
|
8742
8920
|
- Marks show values; they do not catch the thumb.
|
|
8743
8921
|
|
|
8744
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
8922
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8745
8923
|
|
|
8746
8924
|
### Checkbox
|
|
8747
8925
|
|
|
@@ -8855,9 +9033,9 @@ export default function SelectAllWithAMixedState() {
|
|
|
8855
9033
|
|
|
8856
9034
|
| Prop | Type | Default | Description |
|
|
8857
9035
|
|---|---|---|---|
|
|
8858
|
-
| `label` | `ReactNode` | — | Label to the right of the checkbox.<br>Shown in: [Configurator](#checkbox), [Checkbox](#checkbox), [States](#checkbox) and
|
|
9036
|
+
| `label` | `ReactNode` | — | Label to the right of the checkbox.<br>Shown in: [Configurator](#checkbox), [Checkbox](#checkbox), [States](#checkbox) and 11 more |
|
|
8859
9037
|
| `indeterminate` | `boolean` | `false` | Partially checked (e.g. "select all" with a mixed selection).<br>Shown in: [Configurator](#checkbox), [States](#checkbox), [Select all with a mixed state](#checkbox) |
|
|
8860
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
9038
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
8861
9039
|
|
|
8862
9040
|
Also takes every attribute of `<input>` – without `size`, `type`.
|
|
8863
9041
|
|
|
@@ -9058,10 +9236,10 @@ export default function SettingsOfAService() {
|
|
|
9058
9236
|
|
|
9059
9237
|
| Prop | Type | Default | Description |
|
|
9060
9238
|
|---|---|---|---|
|
|
9061
|
-
| `label` | `ReactNode` | — | Label to the right of the switch.<br>Shown in: [Configurator](#switch), [On and off](#switch), [States and sizes](#switch) and
|
|
9239
|
+
| `label` | `ReactNode` | — | Label to the right of the switch.<br>Shown in: [Configurator](#switch), [On and off](#switch), [States and sizes](#switch) and 15 more |
|
|
9062
9240
|
| `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), [States and sizes](#switch) |
|
|
9063
9241
|
| `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), [With an error](#switch) |
|
|
9064
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
9242
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
9065
9243
|
|
|
9066
9244
|
Also takes every attribute of `<input>` – without `role`, `size`, `type`.
|
|
9067
9245
|
|
|
@@ -9069,7 +9247,7 @@ Also takes every attribute of `<input>` – without `role`, `size`, `type`.
|
|
|
9069
9247
|
|
|
9070
9248
|
- No pending or loading state; while your application applies the change, disable the switch or say so beside it.
|
|
9071
9249
|
|
|
9072
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
9250
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9073
9251
|
|
|
9074
9252
|
### RadioGroup
|
|
9075
9253
|
|
|
@@ -9224,7 +9402,7 @@ export default function States() {
|
|
|
9224
9402
|
| `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), [States](#radiogroup) |
|
|
9225
9403
|
| `disabled` | `boolean` | `false` | Disables the whole group. `RadioOption` disables single possibilities.<br>Shown in: [Configurator](#radiogroup), [States](#radiogroup) |
|
|
9226
9404
|
| `name` | `string` | a generated one | Name of the radio group within the form. |
|
|
9227
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
9405
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
9228
9406
|
|
|
9229
9407
|
###### Events
|
|
9230
9408
|
|
|
@@ -9501,21 +9679,21 @@ export default function DrawnAsAField() {
|
|
|
9501
9679
|
|
|
9502
9680
|
| Prop | Type | Default | Description |
|
|
9503
9681
|
|---|---|---|---|
|
|
9504
|
-
| `options` *required* | `readonly ``SegmentedOption``<T>[]` | — | The possibilities, two to four, in the order in which they stand.<br>Shown in: [Configurator](#segmentedcontrol), [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol) and
|
|
9682
|
+
| `options` *required* | `readonly ``SegmentedOption``<T>[]` | — | The possibilities, two to four, in the order in which they stand.<br>Shown in: [Configurator](#segmentedcontrol), [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol) and 6 more |
|
|
9505
9683
|
| `defaultValue` | `T \| null` | — | Initial value of an uncontrolled control. Not together with `value`.<br>Shown in: [Configurator](#segmentedcontrol), [States and sizes](#segmentedcontrol), [Long words in a narrow place](#segmentedcontrol) and 3 more |
|
|
9506
|
-
| `value` | `T \| null` | — | The chosen possibility; `null` means: none yet. Together with `onChange` the control is controlled.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol) |
|
|
9684
|
+
| `value` | `T \| null` | — | The chosen possibility; `null` means: none yet. Together with `onChange` the control is controlled.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
9507
9685
|
| `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), [States and sizes](#segmentedcontrol) |
|
|
9508
9686
|
| `variant` | `"field" \| "inset"` | `"inset"` | How it is drawn. `inset`: a sunken track without an edge, the choice a surface lifted out of it. `field`: a field's edge, the choice filled with ink - for a row whose fields it should match box for box.<br>Shown in: [Configurator](#segmentedcontrol), [Drawn as a field](#segmentedcontrol) |
|
|
9509
9687
|
| `fill` | `boolean` | `false` | Takes the whole width its place gives it, as a field in a column does, and shares it equally between the segments. Without it the control is as wide as its words.<br>Shown in: [Configurator](#segmentedcontrol), [A theme switch](#segmentedcontrol) |
|
|
9510
9688
|
| `disabled` | `boolean` | `false` | Disables the whole control. `SegmentedOption` disables single possibilities.<br>Shown in: [Configurator](#segmentedcontrol), [States and sizes](#segmentedcontrol) |
|
|
9511
9689
|
| `name` | `string` | a generated one | Name of the radio group within the form. |
|
|
9512
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
9690
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
9513
9691
|
|
|
9514
9692
|
###### Events
|
|
9515
9693
|
|
|
9516
9694
|
| Prop | Type | Default | Description |
|
|
9517
9695
|
|---|---|---|---|
|
|
9518
|
-
| `onChange` | `(value: T) => void` | — | Runs on every choice – on the one made with the arrow keys as well.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol) |
|
|
9696
|
+
| `onChange` | `(value: T) => void` | — | Runs on every choice – on the one made with the arrow keys as well.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
9519
9697
|
|
|
9520
9698
|
Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
9521
9699
|
|
|
@@ -9523,8 +9701,8 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9523
9701
|
|
|
9524
9702
|
| Prop | Type | Default | Description |
|
|
9525
9703
|
|---|---|---|---|
|
|
9526
|
-
| `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [States and sizes](#segmentedcontrol) and
|
|
9527
|
-
| `label` *required* | `ReactNode` | — | The segment's word - a short one; a long label ends in an ellipsis.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [States and sizes](#segmentedcontrol) and
|
|
9704
|
+
| `value` *required* | `T` | — | What comes back when this possibility is chosen.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [States and sizes](#segmentedcontrol) and 5 more |
|
|
9705
|
+
| `label` *required* | `ReactNode` | — | The segment's word - a short one; a long label ends in an ellipsis.<br>Shown in: [Segmented control](#segmentedcontrol), [In a field](#segmentedcontrol), [States and sizes](#segmentedcontrol) and 5 more |
|
|
9528
9706
|
| `icon` | `ReactNode` | — | An icon before the word: an SVG, a glyph of the set or an icon font's element. The control sets its size - `--u-icon-size`, `--u-icon-size-sm` at `sm` - and hides it from assistive technology: the word names the possibility.<br>Shown in: [A theme switch](#segmentedcontrol) |
|
|
9529
9707
|
| `disabled` | `boolean` | — | Takes the possibility out of the choice but leaves it visible.<br>Shown in: [States and sizes](#segmentedcontrol) |
|
|
9530
9708
|
|
|
@@ -9533,7 +9711,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9533
9711
|
- Two to four short possibilities: a word that does not fit its place ends in an ellipsis.
|
|
9534
9712
|
- No icons and no line of explanation in a segment; several chosen at once is not this control.
|
|
9535
9713
|
|
|
9536
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
9714
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9537
9715
|
|
|
9538
9716
|
### FileInput
|
|
9539
9717
|
|
|
@@ -9754,6 +9932,102 @@ export default function ImportBudgets() {
|
|
|
9754
9932
|
}
|
|
9755
9933
|
```
|
|
9756
9934
|
|
|
9935
|
+
##### Progress and thumbnails
|
|
9936
|
+
|
|
9937
|
+
The field only chooses, so the files, their progress and their thumbnails are your state: `value={[]}` keeps it a drop zone, and a phone offers its camera for `capture`.
|
|
9938
|
+
|
|
9939
|
+
```tsx
|
|
9940
|
+
import { useEffect, useRef, useState } from "react";
|
|
9941
|
+
import { Button, FileInput, FormField, ProgressBar, Stack, Text, VisuallyHidden } from "@umriss-ui/core";
|
|
9942
|
+
|
|
9943
|
+
type Phase = "waiting" | "sending" | "done" | "failed";
|
|
9944
|
+
|
|
9945
|
+
interface Entry {
|
|
9946
|
+
id: number;
|
|
9947
|
+
file: File;
|
|
9948
|
+
phase: Phase;
|
|
9949
|
+
progress: number;
|
|
9950
|
+
/** An object URL for an image; revoked when the entry leaves the list. */
|
|
9951
|
+
thumbnail: string | null;
|
|
9952
|
+
}
|
|
9953
|
+
|
|
9954
|
+
const WORDS: Record<Phase, string> = { waiting: "Waiting", sending: "Sending", done: "Done", failed: "Failed - remove it and try again" };
|
|
9955
|
+
|
|
9956
|
+
export default function ProgressAndThumbnails() {
|
|
9957
|
+
const [entries, setEntries] = useState<Entry[]>([]);
|
|
9958
|
+
const counter = useRef(1);
|
|
9959
|
+
const live = useRef(entries);
|
|
9960
|
+
useEffect(() => {
|
|
9961
|
+
live.current = entries;
|
|
9962
|
+
});
|
|
9963
|
+
|
|
9964
|
+
/* A simulated upload: one file at a time, a quarter every 300 ms; every second file fails at half. */
|
|
9965
|
+
const active = entries.find((entry) => entry.phase === "sending") ?? entries.find((entry) => entry.phase === "waiting");
|
|
9966
|
+
useEffect(() => {
|
|
9967
|
+
if (!active) return;
|
|
9968
|
+
const timer = setTimeout(() => {
|
|
9969
|
+
const progress = active.phase === "waiting" ? 0 : Math.min(1, active.progress + 0.25);
|
|
9970
|
+
const phase: Phase = active.id % 2 === 0 && progress >= 0.5 ? "failed" : progress >= 1 ? "done" : "sending";
|
|
9971
|
+
setEntries((all) => all.map((one) => (one.id === active.id ? { ...one, progress, phase } : one)));
|
|
9972
|
+
}, 300);
|
|
9973
|
+
return () => clearTimeout(timer);
|
|
9974
|
+
}, [active]);
|
|
9975
|
+
|
|
9976
|
+
/* What is left when the example goes. */
|
|
9977
|
+
useEffect(() => () => live.current.forEach((entry) => entry.thumbnail && URL.revokeObjectURL(entry.thumbnail)), []);
|
|
9978
|
+
|
|
9979
|
+
const add = (files: File[]) => {
|
|
9980
|
+
const added = files.map((file) => ({
|
|
9981
|
+
id: counter.current++,
|
|
9982
|
+
file,
|
|
9983
|
+
phase: "waiting" as Phase,
|
|
9984
|
+
progress: 0,
|
|
9985
|
+
thumbnail: file.type.startsWith("image/") ? URL.createObjectURL(file) : null,
|
|
9986
|
+
}));
|
|
9987
|
+
setEntries((all) => [...all, ...added]);
|
|
9988
|
+
};
|
|
9989
|
+
|
|
9990
|
+
const remove = (entry: Entry) => {
|
|
9991
|
+
if (entry.thumbnail) URL.revokeObjectURL(entry.thumbnail);
|
|
9992
|
+
setEntries((all) => all.filter((one) => one.id !== entry.id));
|
|
9993
|
+
};
|
|
9994
|
+
|
|
9995
|
+
return (
|
|
9996
|
+
<Stack gap={4} style={{ maxWidth: 480 }}>
|
|
9997
|
+
<FormField label="Photos of the damage" hint="Choose, drop or take a photo. The third file fails, to show that state.">
|
|
9998
|
+
<FileInput multiple accept="image/*" capture="environment" value={[]} onChange={add} />
|
|
9999
|
+
</FormField>
|
|
10000
|
+
{entries.length > 0 && (
|
|
10001
|
+
<ul aria-label="Files to send" style={{ listStyle: "none", margin: 0, padding: 0, display: "grid", gap: "var(--u-space-3)" }}>
|
|
10002
|
+
{entries.map((entry) => (
|
|
10003
|
+
<li key={entry.id} style={{ display: "flex", gap: "var(--u-space-3)", alignItems: "center" }}>
|
|
10004
|
+
{entry.thumbnail ? (
|
|
10005
|
+
<img src={entry.thumbnail} alt="" width={40} height={40} style={{ objectFit: "cover", borderRadius: 4, flex: "none" }} />
|
|
10006
|
+
) : (
|
|
10007
|
+
<span style={{ width: 40, height: 40, flex: "none" }} />
|
|
10008
|
+
)}
|
|
10009
|
+
<Stack gap={1} style={{ flex: 1, minWidth: 0 }}>
|
|
10010
|
+
<Text size="sm" style={{ overflowWrap: "anywhere" }}>
|
|
10011
|
+
{entry.file.name}
|
|
10012
|
+
</Text>
|
|
10013
|
+
<ProgressBar label={entry.file.name} value={entry.progress} valueText={WORDS[entry.phase]} />
|
|
10014
|
+
<Text size="xs" tone="muted" style={entry.phase === "failed" ? { color: "var(--u-color-danger)" } : undefined}>
|
|
10015
|
+
{WORDS[entry.phase]}
|
|
10016
|
+
</Text>
|
|
10017
|
+
</Stack>
|
|
10018
|
+
<Button size="sm" variant="secondary" onClick={() => remove(entry)}>
|
|
10019
|
+
Remove
|
|
10020
|
+
<VisuallyHidden> {entry.file.name}</VisuallyHidden>
|
|
10021
|
+
</Button>
|
|
10022
|
+
</li>
|
|
10023
|
+
))}
|
|
10024
|
+
</ul>
|
|
10025
|
+
)}
|
|
10026
|
+
</Stack>
|
|
10027
|
+
);
|
|
10028
|
+
}
|
|
10029
|
+
```
|
|
10030
|
+
|
|
9757
10031
|
#### Keyboard
|
|
9758
10032
|
|
|
9759
10033
|
| Key | Action |
|
|
@@ -9766,15 +10040,15 @@ export default function ImportBudgets() {
|
|
|
9766
10040
|
|
|
9767
10041
|
| Prop | Type | Default | Description |
|
|
9768
10042
|
|---|---|---|---|
|
|
9769
|
-
| `value` | `readonly File[]` | — | Controlled: the chosen files. Uncontrolled, the input keeps its own and starts empty.<br>Shown in: [Several files](#fileinput), [With an error](#fileinput), [Require a file before sending](#fileinput) and
|
|
10043
|
+
| `value` | `readonly File[]` | — | Controlled: the chosen files. Uncontrolled, the input keeps its own and starts empty.<br>Shown in: [Several files](#fileinput), [With an error](#fileinput), [Require a file before sending](#fileinput) and 2 more |
|
|
9770
10044
|
| `invalid` | `boolean` | — | Marks the input as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [With an error](#fileinput) |
|
|
9771
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
10045
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
9772
10046
|
|
|
9773
10047
|
###### Events
|
|
9774
10048
|
|
|
9775
10049
|
| Prop | Type | Default | Description |
|
|
9776
10050
|
|---|---|---|---|
|
|
9777
|
-
| `onChange` | `(files: File[]) => void` | — | Reports the files after a choice, a drop or a removal - only those `accept` takes, and one where the input takes one.<br>Shown in: [Several files](#fileinput), [With an error](#fileinput), [Require a file before sending](#fileinput) and
|
|
10051
|
+
| `onChange` | `(files: File[]) => void` | — | Reports the files after a choice, a drop or a removal - only those `accept` takes, and one where the input takes one.<br>Shown in: [Several files](#fileinput), [With an error](#fileinput), [Require a file before sending](#fileinput) and 2 more |
|
|
9778
10052
|
|
|
9779
10053
|
Also takes every attribute of `<input>` – without `defaultValue`, `onChange`, `size`, `type`, `value`.
|
|
9780
10054
|
|
|
@@ -9782,7 +10056,7 @@ Also takes every attribute of `<input>` – without `defaultValue`, `onChange`,
|
|
|
9782
10056
|
|
|
9783
10057
|
- No upload, no progress and no size limit of its own; those belong to the application sending the files.
|
|
9784
10058
|
|
|
9785
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
10059
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9786
10060
|
|
|
9787
10061
|
## Choosing
|
|
9788
10062
|
|
|
@@ -9964,7 +10238,7 @@ export default function ClearTheChoice() {
|
|
|
9964
10238
|
| `chars` | `number` | — | The width in characters - room for the chosen option; the field adds its own padding, chevron and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and is 20 characters wide where the place asks - never as wide as its longest option.<br>Shown in: [Configurator](#select), [A row of fields (Sizes)](#sizes) |
|
|
9965
10239
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` – by hand only necessary without `FormField`.<br>Shown in: [Configurator](#select), [With an error](#select) |
|
|
9966
10240
|
| `clearable` | `boolean` | `false` | Shows a × once a selection has been made, which fades in on hover/focus and empties the selection. Requires a controlled field (value) and onClear; sensible for optional selects with a placeholder option.<br>Shown in: [Clear the choice](#select) |
|
|
9967
|
-
| `ref` | `Ref<HTMLSelectElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
10241
|
+
| `ref` | `Ref<HTMLSelectElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
9968
10242
|
|
|
9969
10243
|
###### Events
|
|
9970
10244
|
|
|
@@ -9978,7 +10252,7 @@ Also takes every attribute of `<select>` – without `size`.
|
|
|
9978
10252
|
|
|
9979
10253
|
- The list shows the options' text: no icons, descriptions or search inside it - the Combobox searches.
|
|
9980
10254
|
|
|
9981
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
10255
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9982
10256
|
|
|
9983
10257
|
### Combobox
|
|
9984
10258
|
|
|
@@ -10193,6 +10467,120 @@ export default function AssignAnIncident() {
|
|
|
10193
10467
|
}
|
|
10194
10468
|
```
|
|
10195
10469
|
|
|
10470
|
+
##### Thousands of cost centres
|
|
10471
|
+
|
|
10472
|
+
A list of more than 500 options draws only the options in view; a shorter one is drawn whole. Press End in the open list for the last cost centre.
|
|
10473
|
+
|
|
10474
|
+
```tsx
|
|
10475
|
+
import { useState } from "react";
|
|
10476
|
+
import { Combobox, FormField, Stack, Text } from "@umriss-ui/core";
|
|
10477
|
+
|
|
10478
|
+
const CENTRES = Array.from({ length: 5000 }, (_, index) => ({
|
|
10479
|
+
value: `cc-${index + 1}`,
|
|
10480
|
+
label: `CC-${String(index + 1).padStart(4, "0")} ${["Sales", "Marketing", "Engineering", "Design", "Support"][index % 5]}`,
|
|
10481
|
+
}));
|
|
10482
|
+
|
|
10483
|
+
export default function ThousandsOfCostCentres() {
|
|
10484
|
+
const [centre, setCentre] = useState<string | null>(null);
|
|
10485
|
+
|
|
10486
|
+
return (
|
|
10487
|
+
<Stack gap={3} style={{ maxWidth: 320 }}>
|
|
10488
|
+
<FormField label="Cost centre">
|
|
10489
|
+
<Combobox value={centre} onChange={setCentre} clearable options={CENTRES} placeholder="Type a number or a name" />
|
|
10490
|
+
</FormField>
|
|
10491
|
+
<Text size="xs" tone="muted" mono>
|
|
10492
|
+
value: {centre === null ? "null" : `"${centre}"`}
|
|
10493
|
+
</Text>
|
|
10494
|
+
</Stack>
|
|
10495
|
+
);
|
|
10496
|
+
}
|
|
10497
|
+
```
|
|
10498
|
+
|
|
10499
|
+
##### Search with the server
|
|
10500
|
+
|
|
10501
|
+
The field reports what is typed and shows the results as given. The debounce and the cancelling of a stale request are the application's: here 250 ms of rest and an AbortController. Type “err” for a failed request.
|
|
10502
|
+
|
|
10503
|
+
```tsx
|
|
10504
|
+
import { useEffect, useState } from "react";
|
|
10505
|
+
import { Alert, Combobox, FormField, Stack, Text } from "@umriss-ui/core";
|
|
10506
|
+
|
|
10507
|
+
interface Customer {
|
|
10508
|
+
value: string;
|
|
10509
|
+
label: string;
|
|
10510
|
+
}
|
|
10511
|
+
|
|
10512
|
+
const NAMES = ["Acme Logistics", "Acorn Foods", "Alder Mills", "Birch Freight", "Cobalt Marine", "Delta Tools", "Ember Works", "Fjord Energy"];
|
|
10513
|
+
const CUSTOMERS: readonly Customer[] = NAMES.map((label, index) => ({ value: `c-${index + 1}`, label }));
|
|
10514
|
+
|
|
10515
|
+
/* A server that answers after 400 ms, and stops answering when it is aborted. */
|
|
10516
|
+
function searchCustomers(text: string, signal: AbortSignal): Promise<Customer[]> {
|
|
10517
|
+
return new Promise((resolve, reject) => {
|
|
10518
|
+
const timer = setTimeout(() => {
|
|
10519
|
+
if (text.toLowerCase().includes("err")) reject(new Error("The server did not answer."));
|
|
10520
|
+
else resolve(CUSTOMERS.filter((customer) => customer.label.toLowerCase().includes(text.toLowerCase())));
|
|
10521
|
+
}, 400);
|
|
10522
|
+
signal.addEventListener("abort", () => {
|
|
10523
|
+
clearTimeout(timer);
|
|
10524
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
10525
|
+
});
|
|
10526
|
+
});
|
|
10527
|
+
}
|
|
10528
|
+
|
|
10529
|
+
export default function SearchWithTheServer() {
|
|
10530
|
+
const [customer, setCustomer] = useState<string | null>(null);
|
|
10531
|
+
const [options, setOptions] = useState<readonly Customer[]>(CUSTOMERS);
|
|
10532
|
+
const [loading, setLoading] = useState(false);
|
|
10533
|
+
const [failed, setFailed] = useState(false);
|
|
10534
|
+
const [text, setText] = useState("");
|
|
10535
|
+
|
|
10536
|
+
// The debounce: a request starts once the typing rests, and the stale one is aborted.
|
|
10537
|
+
useEffect(() => {
|
|
10538
|
+
const controller = new AbortController();
|
|
10539
|
+
const timer = setTimeout(() => {
|
|
10540
|
+
setLoading(true);
|
|
10541
|
+
setFailed(false);
|
|
10542
|
+
searchCustomers(text, controller.signal).then(
|
|
10543
|
+
(found) => {
|
|
10544
|
+
setOptions(found);
|
|
10545
|
+
setLoading(false);
|
|
10546
|
+
},
|
|
10547
|
+
(error: unknown) => {
|
|
10548
|
+
if (error instanceof DOMException && error.name === "AbortError") return;
|
|
10549
|
+
setOptions([]);
|
|
10550
|
+
setFailed(true);
|
|
10551
|
+
setLoading(false);
|
|
10552
|
+
},
|
|
10553
|
+
);
|
|
10554
|
+
}, 250);
|
|
10555
|
+
return () => {
|
|
10556
|
+
clearTimeout(timer);
|
|
10557
|
+
controller.abort();
|
|
10558
|
+
};
|
|
10559
|
+
}, [text]);
|
|
10560
|
+
|
|
10561
|
+
return (
|
|
10562
|
+
<Stack gap={3} style={{ maxWidth: 320 }}>
|
|
10563
|
+
<FormField label="Customer">
|
|
10564
|
+
<Combobox
|
|
10565
|
+
value={customer}
|
|
10566
|
+
onChange={setCustomer}
|
|
10567
|
+
options={options}
|
|
10568
|
+
filter={false}
|
|
10569
|
+
loading={loading}
|
|
10570
|
+
onSearch={setText}
|
|
10571
|
+
clearable
|
|
10572
|
+
placeholder="Search customers"
|
|
10573
|
+
/>
|
|
10574
|
+
</FormField>
|
|
10575
|
+
{failed && <Alert tone="danger" title="The search failed" />}
|
|
10576
|
+
<Text size="xs" tone="muted" mono>
|
|
10577
|
+
value: {customer === null ? "null" : `"${customer}"`}
|
|
10578
|
+
</Text>
|
|
10579
|
+
</Stack>
|
|
10580
|
+
);
|
|
10581
|
+
}
|
|
10582
|
+
```
|
|
10583
|
+
|
|
10196
10584
|
#### When to use something else
|
|
10197
10585
|
|
|
10198
10586
|
- A short list that needs no search, with the system's picker under a finger → Select
|
|
@@ -10203,6 +10591,7 @@ export default function AssignAnIncident() {
|
|
|
10203
10591
|
| Key | Action |
|
|
10204
10592
|
|---|---|
|
|
10205
10593
|
| `Arrow Down / Arrow Up` | Opens the list, then moves through the rows. |
|
|
10594
|
+
| `Home / End` | In a list of more than 500 options, moves to the first or last row; in a shorter one they move the caret. |
|
|
10206
10595
|
| `Enter` | Chooses the active row. |
|
|
10207
10596
|
| `Escape` | Closes the list. |
|
|
10208
10597
|
|
|
@@ -10212,22 +10601,25 @@ export default function AssignAnIncident() {
|
|
|
10212
10601
|
|
|
10213
10602
|
| Prop | Type | Default | Description |
|
|
10214
10603
|
|---|---|---|---|
|
|
10215
|
-
| `options` *required* | `readonly ``ComboboxOption``<T>[]` | — | The possibilities, in their natural order. Filtered while typing; never reordered.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and
|
|
10216
|
-
| `value` *required* | `T \| null` | — | The chosen value; `null` means none. Always controlled - the field keeps no second state beside the caller's.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and
|
|
10217
|
-
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Combobox](#combobox), [States](#combobox), [With an error](#combobox) and
|
|
10604
|
+
| `options` *required* | `readonly ``ComboboxOption``<T>[]` | — | The possibilities, in their natural order. Filtered while typing; never reordered.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and 8 more |
|
|
10605
|
+
| `value` *required* | `T \| null` | — | The chosen value; `null` means none. Always controlled - the field keeps no second state beside the caller's.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and 8 more |
|
|
10606
|
+
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Combobox](#combobox), [States](#combobox), [With an error](#combobox) and 6 more |
|
|
10218
10607
|
| `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](#combobox) |
|
|
10219
10608
|
| `chars` | `number` | — | The width in characters - room for the typed text and the chosen option; the field adds its own padding, chevron and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and is 20 characters wide where the place asks - in a toolbar or a row. The panel is never narrower than the field.<br>Shown in: [Configurator](#combobox) |
|
|
10220
10609
|
| `disabled` | `boolean` | `false` | Locks field and panel.<br>Shown in: [Configurator](#combobox), [States](#combobox), [Dispatch a tour (Scenarios)](#dispatch-a-tour) |
|
|
10221
10610
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#combobox), [With an error](#combobox) |
|
|
10222
10611
|
| `emptyText` | `string` | — | Text shown for an empty search result.<br>Shown in: [States](#combobox) |
|
|
10223
|
-
| `clearable` | `boolean` | `false` | Shows a cross on selection or input that clears field and selection.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [Assign an incident](#combobox) and
|
|
10224
|
-
| `
|
|
10612
|
+
| `clearable` | `boolean` | `false` | Shows a cross on selection or input that clears field and selection.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [Assign an incident](#combobox) and 4 more |
|
|
10613
|
+
| `filter` | `boolean` | `true` | With `false` the field filters nothing: `options` are shown as given, in their order - the server's ranking. The active option returns to the first when they change while the panel is open.<br>Shown in: [Search with the server](#combobox) |
|
|
10614
|
+
| `loading` | `boolean` | `false` | Results are on their way: the list shows the wording's "Loading" line where it would show the empty text, below any `options` given, and is `aria-busy`.<br>Shown in: [Search with the server](#combobox) |
|
|
10615
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
10225
10616
|
|
|
10226
10617
|
###### Events
|
|
10227
10618
|
|
|
10228
10619
|
| Prop | Type | Default | Description |
|
|
10229
10620
|
|---|---|---|---|
|
|
10230
|
-
| `onChange` *required* | `(value: T \| null) => void` | — | Runs on choosing and on clearing (`null`). Not while typing: what is typed is a search term and not yet a value.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and
|
|
10621
|
+
| `onChange` *required* | `(value: T \| null) => void` | — | Runs on choosing and on clearing (`null`). Not while typing: what is typed is a search term and not yet a value.<br>Shown in: [Configurator](#combobox), [Combobox](#combobox), [States](#combobox) and 8 more |
|
|
10622
|
+
| `onSearch` | `(text: string) => void` | — | Runs on every change of the typed text - the clearing cross's too, with `""` - and not on opening or closing. For an application that fetches the matches itself: debounce and cancelling stale requests are yours.<br>Shown in: [Search with the server](#combobox) |
|
|
10231
10623
|
|
|
10232
10624
|
Also takes every attribute of `<input>` – without `defaultValue`, `onChange`.
|
|
10233
10625
|
|
|
@@ -10242,9 +10634,9 @@ Also takes every attribute of `<input>` – without `defaultValue`, `onChange`.
|
|
|
10242
10634
|
#### Known limits
|
|
10243
10635
|
|
|
10244
10636
|
- No free text as a value: only an option can be chosen.
|
|
10245
|
-
- No
|
|
10637
|
+
- No request of its own: `onSearch` reports the typed text and you fetch, debounce and cancel; `filter={false}` shows what you return.
|
|
10246
10638
|
|
|
10247
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
10639
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10248
10640
|
|
|
10249
10641
|
### MultiSelect
|
|
10250
10642
|
|
|
@@ -10468,6 +10860,36 @@ export default function FilterIncidentsByService() {
|
|
|
10468
10860
|
}
|
|
10469
10861
|
```
|
|
10470
10862
|
|
|
10863
|
+
##### Thousands of assets
|
|
10864
|
+
|
|
10865
|
+
A list of more than 500 options draws only the checkboxes in view; All, None and Invert still act on every match of the search. Press End in the list for the last asset.
|
|
10866
|
+
|
|
10867
|
+
```tsx
|
|
10868
|
+
import { useState } from "react";
|
|
10869
|
+
import { FormField, MultiSelect, Stack, Text } from "@umriss-ui/core";
|
|
10870
|
+
|
|
10871
|
+
const KINDS = ["Pump", "Valve", "Sensor", "Motor", "Gearbox"];
|
|
10872
|
+
const ASSETS = Array.from({ length: 3000 }, (_, index) => ({
|
|
10873
|
+
value: `asset-${index + 1}`,
|
|
10874
|
+
label: `A-${String(index + 1).padStart(4, "0")} ${KINDS[index % KINDS.length]}`,
|
|
10875
|
+
}));
|
|
10876
|
+
|
|
10877
|
+
export default function ThousandsOfAssets() {
|
|
10878
|
+
const [assets, setAssets] = useState<string[]>([]);
|
|
10879
|
+
|
|
10880
|
+
return (
|
|
10881
|
+
<Stack gap={3} style={{ maxWidth: 320 }}>
|
|
10882
|
+
<FormField label="Assets">
|
|
10883
|
+
<MultiSelect value={assets} onChange={setAssets} options={ASSETS} clearable placeholder="Choose assets" searchPlaceholder="Search assets" />
|
|
10884
|
+
</FormField>
|
|
10885
|
+
<Text size="xs" tone="muted" mono>
|
|
10886
|
+
chosen: {assets.length}
|
|
10887
|
+
</Text>
|
|
10888
|
+
</Stack>
|
|
10889
|
+
);
|
|
10890
|
+
}
|
|
10891
|
+
```
|
|
10892
|
+
|
|
10471
10893
|
#### When to use something else
|
|
10472
10894
|
|
|
10473
10895
|
- Exactly one value → Combobox
|
|
@@ -10490,23 +10912,23 @@ export default function FilterIncidentsByService() {
|
|
|
10490
10912
|
|
|
10491
10913
|
| Prop | Type | Default | Description |
|
|
10492
10914
|
|---|---|---|---|
|
|
10493
|
-
| `options` *required* | `readonly ``MultiSelectOption``<T>[]` | — | The possibilities, in their natural order. The list never re-sorts – not even in the "selected" scope.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and
|
|
10494
|
-
| `value` *required* | `readonly T[]` | — | The chosen values. Always controlled.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and
|
|
10495
|
-
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Chips in the field](#multiselect), [States](#multiselect), [With an error](#multiselect) and
|
|
10496
|
-
| `searchPlaceholder` | `string` | — | What stands in the panel's search field.<br>Shown in: [Filter incidents by service](#multiselect) |
|
|
10915
|
+
| `options` *required* | `readonly ``MultiSelectOption``<T>[]` | — | The possibilities, in their natural order. The list never re-sorts – not even in the "selected" scope.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and 6 more |
|
|
10916
|
+
| `value` *required* | `readonly T[]` | — | The chosen values. Always controlled.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and 6 more |
|
|
10917
|
+
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Chips in the field](#multiselect), [States](#multiselect), [With an error](#multiselect) and 4 more |
|
|
10918
|
+
| `searchPlaceholder` | `string` | — | What stands in the panel's search field.<br>Shown in: [Filter incidents by service](#multiselect), [Thousands of assets](#multiselect) |
|
|
10497
10919
|
| `emptyText` | `string` | — | Text when the search finds nothing.<br>Shown in: [States](#multiselect) |
|
|
10498
10920
|
| `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](#multiselect) |
|
|
10499
10921
|
| `chars` | `number` | — | The width in characters - room for the chips; the field adds its own padding and chevron. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and is 20 characters wide where the place asks - in a toolbar or a row, room for two short chips and the counter. Either way, choosing and removing values never moves it: the chips that do not fit stand as "+N".<br>Shown in: [Configurator](#multiselect) |
|
|
10500
10922
|
| `disabled` | `boolean` | `false` | Locks field and panel.<br>Shown in: [Configurator](#multiselect), [States](#multiselect), [Dispatch a tour (Scenarios)](#dispatch-a-tour) |
|
|
10501
10923
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` – by hand only necessary without `FormField`.<br>Shown in: [Configurator](#multiselect), [With an error](#multiselect) |
|
|
10502
|
-
| `clearable` | `boolean` | `false` | Shows a cross beside the chips that empties the selection, as "Select none" does: a chosen value whose option is disabled stays. The field keeps room for it, chosen values or none, so that it never moves.<br>Shown in: [Configurator](#multiselect), [Filter incidents by service](#multiselect), [
|
|
10503
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
10924
|
+
| `clearable` | `boolean` | `false` | Shows a cross beside the chips that empties the selection, as "Select none" does: a chosen value whose option is disabled stays. The field keeps room for it, chosen values or none, so that it never moves.<br>Shown in: [Configurator](#multiselect), [Filter incidents by service](#multiselect), [Thousands of assets](#multiselect) and 1 more |
|
|
10925
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
10504
10926
|
|
|
10505
10927
|
###### Events
|
|
10506
10928
|
|
|
10507
10929
|
| Prop | Type | Default | Description |
|
|
10508
10930
|
|---|---|---|---|
|
|
10509
|
-
| `onChange` *required* | `(value: T[]) => void` | — | Runs on every change of the selection, with the complete new list – not with the one value that moved.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and
|
|
10931
|
+
| `onChange` *required* | `(value: T[]) => void` | — | Runs on every change of the selection, with the complete new list – not with the one value that moved.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and 6 more |
|
|
10510
10932
|
|
|
10511
10933
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
10512
10934
|
|
|
@@ -10538,7 +10960,7 @@ The value contract of the four pickers stands here. `DatePicker` hands out a `Da
|
|
|
10538
10960
|
|
|
10539
10961
|
##### Pick a day
|
|
10540
10962
|
|
|
10541
|
-
The value is a `Date` at local midnight or `null`; `onChange` runs as soon as a day is chosen.
|
|
10963
|
+
The value is a `Date` at local midnight or `null`; `onChange` runs as soon as a day is chosen. In the panel a known date is typed: `17.03.1985` and Enter, or a digit on the grid to start.
|
|
10542
10964
|
|
|
10543
10965
|
```tsx
|
|
10544
10966
|
import { useState } from "react";
|
|
@@ -10657,6 +11079,27 @@ export default function CheckADueDate() {
|
|
|
10657
11079
|
}
|
|
10658
11080
|
```
|
|
10659
11081
|
|
|
11082
|
+
##### From the first reading to today
|
|
11083
|
+
|
|
11084
|
+
`min` and `max` are inclusive, by day: the year list, the month list, the arrows, the grid, Today and the typed date all keep to them.
|
|
11085
|
+
|
|
11086
|
+
```tsx
|
|
11087
|
+
import { useState } from "react";
|
|
11088
|
+
import { DatePicker, FormField } from "@umriss-ui/core";
|
|
11089
|
+
|
|
11090
|
+
export default function FromTheFirstReadingToToday() {
|
|
11091
|
+
const [day, setDay] = useState<Date | null>(null);
|
|
11092
|
+
|
|
11093
|
+
return (
|
|
11094
|
+
<div style={{ maxWidth: 320 }}>
|
|
11095
|
+
<FormField label="Reading" hint="From 1 March 2020 to today.">
|
|
11096
|
+
<DatePicker value={day} onChange={setDay} min={new Date(2020, 2, 1)} max={new Date()} clearable />
|
|
11097
|
+
</FormField>
|
|
11098
|
+
</div>
|
|
11099
|
+
);
|
|
11100
|
+
}
|
|
11101
|
+
```
|
|
11102
|
+
|
|
10660
11103
|
#### When to use something else
|
|
10661
11104
|
|
|
10662
11105
|
- A day and a time of day → DateTimePicker
|
|
@@ -10677,20 +11120,22 @@ export default function CheckADueDate() {
|
|
|
10677
11120
|
|
|
10678
11121
|
| Prop | Type | Default | Description |
|
|
10679
11122
|
|---|---|---|---|
|
|
10680
|
-
| `value` *required* | `Date \| null` | — | The day, as a `Date` on
|
|
11123
|
+
| `value` *required* | `Date \| null` | — | The day, as a `Date` on midnight in the formats' zone (the reader's, unless the application names one); `null` means none.<br>Shown in: [Configurator](#datepicker), [Pick a day](#datepicker), [States](#datepicker) and 10 more |
|
|
10681
11124
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datepicker) |
|
|
10682
11125
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datepicker), [States](#datepicker) |
|
|
10683
11126
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#datepicker), [With an error](#datepicker) |
|
|
10684
11127
|
| `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](#datepicker), [States](#datepicker) |
|
|
10685
11128
|
| `chars` | `number` | — | The width in characters - room for the value; the field adds its own padding, glyph and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and where the place asks - in a toolbar or a row - it is as wide as its longest value in the formats in use, so a date never truncates.<br>Shown in: [Configurator](#datepicker) |
|
|
10686
|
-
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value.<br>Shown in: [Configurator](#datepicker), [Pick a day](#datepicker), [States](#datepicker) and
|
|
10687
|
-
| `
|
|
11129
|
+
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value, and the open panel offers Clear. Without it no way to empty the value is offered.<br>Shown in: [Configurator](#datepicker), [Pick a day](#datepicker), [States](#datepicker) and 6 more |
|
|
11130
|
+
| `min` | `Date` | — | The earliest day the picker offers, inclusive. Only its calendar day counts - in the formats' zone, when one is named - not its time of day. A value given outside is shown as given.<br>Shown in: [From the first reading to today](#datepicker) |
|
|
11131
|
+
| `max` | `Date` | — | The latest day the picker offers, inclusive; read as `min` is.<br>Shown in: [From the first reading to today](#datepicker) |
|
|
11132
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
10688
11133
|
|
|
10689
11134
|
###### Events
|
|
10690
11135
|
|
|
10691
11136
|
| Prop | Type | Default | Description |
|
|
10692
11137
|
|---|---|---|---|
|
|
10693
|
-
| `onChange` *required* | `(date: Date \| null) => void` | — | Runs as soon as a day is settled - on a click in the grid, on "Today" and on clearing (`null`). Every one of these ways hands out
|
|
11138
|
+
| `onChange` *required* | `(date: Date \| null) => void` | — | Runs as soon as a day is settled - on a click in the grid, on "Today" and on clearing (`null`). Every one of these ways hands out midnight in the formats' zone; there is none that delivers a time along with it.<br>Shown in: [Configurator](#datepicker), [Pick a day](#datepicker), [States](#datepicker) and 10 more |
|
|
10694
11139
|
|
|
10695
11140
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
10696
11141
|
|
|
@@ -10699,7 +11144,7 @@ Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
|
10699
11144
|
- No typing of a date into the field.
|
|
10700
11145
|
- umriss shows the reader's time ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).
|
|
10701
11146
|
|
|
10702
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
11147
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10703
11148
|
|
|
10704
11149
|
### DateTimePicker
|
|
10705
11150
|
|
|
@@ -10846,15 +11291,17 @@ export default function WithAnError() {
|
|
|
10846
11291
|
|
|
10847
11292
|
| Prop | Type | Default | Description |
|
|
10848
11293
|
|---|---|---|---|
|
|
10849
|
-
| `value` *required* | `Date \| null` | — | The instant; `null` means none.<br>Shown in: [Configurator](#datetimepicker), [Set an instant](#datetimepicker), [With seconds](#datetimepicker) and 3 more |
|
|
11294
|
+
| `value` *required* | `Date \| null` | — | The instant; `null` means none. The panel reads and sets its day and wall clock in the formats' zone (the reader's, unless the application names one).<br>Shown in: [Configurator](#datetimepicker), [Set an instant](#datetimepicker), [With seconds](#datetimepicker) and 3 more |
|
|
10850
11295
|
| `withSeconds` | `boolean` | `false` | Show the seconds field.<br>Shown in: [Configurator](#datetimepicker), [With seconds](#datetimepicker) |
|
|
10851
11296
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datetimepicker) |
|
|
10852
11297
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datetimepicker), [States](#datetimepicker) |
|
|
10853
11298
|
| `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](#datetimepicker), [States](#datetimepicker) |
|
|
10854
11299
|
| `chars` | `number` | — | The width in characters - room for the value; the field adds its own padding, glyph and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and where the place asks - in a toolbar or a row - it is as wide as its longest value in the formats in use, so a date never truncates.<br>Shown in: [Configurator](#datetimepicker) |
|
|
10855
11300
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#datetimepicker), [With an error](#datetimepicker) |
|
|
10856
|
-
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value.<br>Shown in: [Configurator](#datetimepicker), [Set an instant](#datetimepicker), [States](#datetimepicker) |
|
|
10857
|
-
| `
|
|
11301
|
+
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value, and the open panel offers Clear. Without it no way to empty the value is offered.<br>Shown in: [Configurator](#datetimepicker), [Set an instant](#datetimepicker), [States](#datetimepicker) |
|
|
11302
|
+
| `min` | `Date` | — | The earliest day the picker offers, inclusive. Only its calendar day counts - in the formats' zone, when one is named - not its time of day. A value given outside is shown as given. |
|
|
11303
|
+
| `max` | `Date` | — | The latest day the picker offers, inclusive; read as `min` is. |
|
|
11304
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
10858
11305
|
|
|
10859
11306
|
###### Events
|
|
10860
11307
|
|
|
@@ -10868,7 +11315,7 @@ Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
|
10868
11315
|
|
|
10869
11316
|
- umriss shows the reader's time ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).
|
|
10870
11317
|
|
|
10871
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
11318
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10872
11319
|
|
|
10873
11320
|
### DateRangePicker
|
|
10874
11321
|
|
|
@@ -11022,6 +11469,29 @@ export default function WithAnError() {
|
|
|
11022
11469
|
}
|
|
11023
11470
|
```
|
|
11024
11471
|
|
|
11472
|
+
##### Presets cut to a bound
|
|
11473
|
+
|
|
11474
|
+
A preset that overlaps `min` or `max` is cut to the range, and one wholly outside is disabled: with `min` the first of this month and `max` today, "Previous month" is disabled and "This month" ends today.
|
|
11475
|
+
|
|
11476
|
+
```tsx
|
|
11477
|
+
import { useState } from "react";
|
|
11478
|
+
import { DateRangePicker, FormField } from "@umriss-ui/core";
|
|
11479
|
+
import type { DateRange } from "@umriss-ui/core";
|
|
11480
|
+
|
|
11481
|
+
export default function PresetsCutToABound() {
|
|
11482
|
+
const [report, setReport] = useState<DateRange | null>(null);
|
|
11483
|
+
const today = new Date();
|
|
11484
|
+
|
|
11485
|
+
return (
|
|
11486
|
+
<div style={{ maxWidth: 320 }}>
|
|
11487
|
+
<FormField label="Report" hint="This month, up to today.">
|
|
11488
|
+
<DateRangePicker value={report} onChange={setReport} min={new Date(today.getFullYear(), today.getMonth(), 1)} max={today} clearable />
|
|
11489
|
+
</FormField>
|
|
11490
|
+
</div>
|
|
11491
|
+
);
|
|
11492
|
+
}
|
|
11493
|
+
```
|
|
11494
|
+
|
|
11025
11495
|
#### When to use something else
|
|
11026
11496
|
|
|
11027
11497
|
- A span with times at both ends → DateTimeRangePicker
|
|
@@ -11041,21 +11511,23 @@ export default function WithAnError() {
|
|
|
11041
11511
|
|
|
11042
11512
|
| Prop | Type | Default | Description |
|
|
11043
11513
|
|---|---|---|---|
|
|
11044
|
-
| `value` *required* | `DateRange`` \| null` | — | The time span, both ends on
|
|
11514
|
+
| `value` *required* | `DateRange`` \| null` | — | The time span, both ends on midnight in the formats' zone (the reader's, unless the application names one) and both inclusive; `null` means none.<br>Shown in: [Configurator](#daterangepicker), [A span of days](#daterangepicker), [Presets](#daterangepicker) and 4 more |
|
|
11045
11515
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Presets](#daterangepicker) |
|
|
11046
11516
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#daterangepicker), [States](#daterangepicker) |
|
|
11047
11517
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#daterangepicker), [With an error](#daterangepicker) |
|
|
11048
11518
|
| `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](#daterangepicker), [States](#daterangepicker) |
|
|
11049
11519
|
| `chars` | `number` | — | The width in characters - room for the value; the field adds its own padding, glyph and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and where the place asks - in a toolbar or a row - it is as wide as its longest value in the formats in use, so a date never truncates.<br>Shown in: [Configurator](#daterangepicker) |
|
|
11050
|
-
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value.<br>Shown in: [Configurator](#daterangepicker), [A span of days](#daterangepicker), [Presets](#daterangepicker) and
|
|
11520
|
+
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value, and the open panel offers Clear. Without it no way to empty the value is offered.<br>Shown in: [Configurator](#daterangepicker), [A span of days](#daterangepicker), [Presets](#daterangepicker) and 3 more |
|
|
11051
11521
|
| `presets` | `RangePreset``[]` | `DEFAULT_PRESETS`, in the wording's labels | The quick-select column in the panel. An empty array hides the column.<br>Shown in: [Presets](#daterangepicker) |
|
|
11052
|
-
| `
|
|
11522
|
+
| `min` | `Date` | — | The earliest day the picker offers, inclusive. Only its calendar day counts - in the formats' zone, when one is named - not its time of day. A value given outside is shown as given.<br>Shown in: [Presets cut to a bound](#daterangepicker) |
|
|
11523
|
+
| `max` | `Date` | — | The latest day the picker offers, inclusive; read as `min` is.<br>Shown in: [Presets cut to a bound](#daterangepicker) |
|
|
11524
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11053
11525
|
|
|
11054
11526
|
###### Events
|
|
11055
11527
|
|
|
11056
11528
|
| Prop | Type | Default | Description |
|
|
11057
11529
|
|---|---|---|---|
|
|
11058
|
-
| `onChange` *required* | `(range: ``DateRange`` \| null) => void` | — | Runs as soon as both ends are settled - after the second click, on a preset and on clearing (`null`). Ends dragged backwards swap silently; there is no error state to handle.<br>Shown in: [Configurator](#daterangepicker), [A span of days](#daterangepicker), [Presets](#daterangepicker) and
|
|
11530
|
+
| `onChange` *required* | `(range: ``DateRange`` \| null) => void` | — | Runs as soon as both ends are settled - after the second click, on a preset and on clearing (`null`). Ends dragged backwards swap silently; there is no error state to handle.<br>Shown in: [Configurator](#daterangepicker), [A span of days](#daterangepicker), [Presets](#daterangepicker) and 4 more |
|
|
11059
11531
|
|
|
11060
11532
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
11061
11533
|
|
|
@@ -11086,7 +11558,7 @@ the moment of the click.
|
|
|
11086
11558
|
|
|
11087
11559
|
- One span; no list of separate days.
|
|
11088
11560
|
|
|
11089
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
11561
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11090
11562
|
|
|
11091
11563
|
### DateTimeRangePicker
|
|
11092
11564
|
|
|
@@ -11253,16 +11725,18 @@ export default function WithAnError() {
|
|
|
11253
11725
|
|
|
11254
11726
|
| Prop | Type | Default | Description |
|
|
11255
11727
|
|---|---|---|---|
|
|
11256
|
-
| `value` *required* | `DateRange`` \| null` | — | The time span with times at both ends; `null` means none.<br>Shown in: [Configurator](#datetimerangepicker), [A downtime window](#datetimerangepicker), [With seconds](#datetimerangepicker) and 3 more |
|
|
11728
|
+
| `value` *required* | `DateRange`` \| null` | — | The time span with times at both ends; `null` means none. The panel reads and sets days and wall clocks in the formats' zone (the reader's, unless the application names one).<br>Shown in: [Configurator](#datetimerangepicker), [A downtime window](#datetimerangepicker), [With seconds](#datetimerangepicker) and 3 more |
|
|
11257
11729
|
| `withSeconds` | `boolean` | `false` | Show the seconds fields.<br>Shown in: [Configurator](#datetimerangepicker), [With seconds](#datetimerangepicker) |
|
|
11258
11730
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datetimerangepicker) |
|
|
11259
11731
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datetimerangepicker), [States](#datetimerangepicker) |
|
|
11260
11732
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`.<br>Shown in: [Configurator](#datetimerangepicker), [With an error](#datetimerangepicker) |
|
|
11261
11733
|
| `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](#datetimerangepicker), [States](#datetimerangepicker) |
|
|
11262
11734
|
| `chars` | `number` | — | The width in characters - room for the value; the field adds its own padding, glyph and cross. Given, the field is that wide wherever it stands, and never wider than its place. Without it the field fills its place, and where the place asks - in a toolbar or a row - it is as wide as its longest value in the formats in use, so a date never truncates.<br>Shown in: [Configurator](#datetimerangepicker) |
|
|
11263
|
-
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value.<br>Shown in: [Configurator](#datetimerangepicker), [A downtime window](#datetimerangepicker), [States](#datetimerangepicker) |
|
|
11735
|
+
| `clearable` | `boolean` | `false` | Shows a cross where a value is set, which fades in on hover/focus and clears the value, and the open panel offers Clear. Without it no way to empty the value is offered.<br>Shown in: [Configurator](#datetimerangepicker), [A downtime window](#datetimerangepicker), [States](#datetimerangepicker) |
|
|
11264
11736
|
| `presets` | `RangePreset``[]` | `DEFAULT_PRESETS`, in the wording's labels | The quick-select column in the panel; presets apply for the whole day and close immediately. An empty array hides the column.<br>Shown in: [With seconds](#datetimerangepicker) |
|
|
11265
|
-
| `
|
|
11737
|
+
| `min` | `Date` | — | The earliest day the picker offers, inclusive. Only its calendar day counts - in the formats' zone, when one is named - not its time of day. A value given outside is shown as given. |
|
|
11738
|
+
| `max` | `Date` | — | The latest day the picker offers, inclusive; read as `min` is. |
|
|
11739
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11266
11740
|
|
|
11267
11741
|
###### Events
|
|
11268
11742
|
|
|
@@ -11300,7 +11774,7 @@ the moment of the click.
|
|
|
11300
11774
|
- umriss shows the reader's time ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).
|
|
11301
11775
|
- No recurring windows.
|
|
11302
11776
|
|
|
11303
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
11777
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11304
11778
|
|
|
11305
11779
|
## Feedback
|
|
11306
11780
|
|
|
@@ -11442,7 +11916,7 @@ With reduced motion it turns at less than half its speed instead of stopping, so
|
|
|
11442
11916
|
| Prop | Type | Default | Description |
|
|
11443
11917
|
|---|---|---|---|
|
|
11444
11918
|
| `size` | `number` | `14` | Edge length in pixels.<br>Shown in: [Sizes](#spinner), [Colour](#spinner) |
|
|
11445
|
-
| `ref` | `Ref<SVGSVGElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
11919
|
+
| `ref` | `Ref<SVGSVGElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11446
11920
|
|
|
11447
11921
|
Also takes every attribute of `<svg>`.
|
|
11448
11922
|
|
|
@@ -11450,7 +11924,7 @@ Also takes every attribute of `<svg>`.
|
|
|
11450
11924
|
|
|
11451
11925
|
- One shape and no figure: for how far a job has come, use a [ProgressBar](#progressbar).
|
|
11452
11926
|
|
|
11453
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
11927
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11454
11928
|
|
|
11455
11929
|
### ProgressBar
|
|
11456
11930
|
|
|
@@ -11621,11 +12095,11 @@ Under forced colours the track takes an edge and the fill the system's selection
|
|
|
11621
12095
|
|
|
11622
12096
|
| Prop | Type | Default | Description |
|
|
11623
12097
|
|---|---|---|---|
|
|
11624
|
-
| `value` | `number` | — | How far the task has come, from 0 to 1. Left out, the bar is indeterminate: the task runs, and nobody knows how far it is.<br>Shown in: [Configurator](#progressbar), [How far a job has come](#progressbar), [Count instead of a share](#progressbar) and
|
|
11625
|
-
| `label` | `string` | the wording's "Progress" | What is progressing, e.g. "Import of the invoice records". A progress bar needs a name from the author.<br>Shown in: [How far a job has come](#progressbar), [Count instead of a share](#progressbar), [Run without a known end](#progressbar) and
|
|
11626
|
-
| `valueText` | `string` | — | What a screen reader says instead of the percentage, where a count says it better - "3 of 12 files".<br>Shown in: [Count instead of a share](#progressbar), [Follow a job through its steps](#progressbar), [
|
|
12098
|
+
| `value` | `number` | — | How far the task has come, from 0 to 1. Left out, the bar is indeterminate: the task runs, and nobody knows how far it is.<br>Shown in: [Configurator](#progressbar), [How far a job has come](#progressbar), [Count instead of a share](#progressbar) and 4 more |
|
|
12099
|
+
| `label` | `string` | the wording's "Progress" | What is progressing, e.g. "Import of the invoice records". A progress bar needs a name from the author.<br>Shown in: [How far a job has come](#progressbar), [Count instead of a share](#progressbar), [Run without a known end](#progressbar) and 4 more |
|
|
12100
|
+
| `valueText` | `string` | — | What a screen reader says instead of the percentage, where a count says it better - "3 of 12 files".<br>Shown in: [Count instead of a share](#progressbar), [Follow a job through its steps](#progressbar), [Progress and thumbnails (FileInput)](#fileinput) and 1 more |
|
|
11627
12101
|
| `showLabel` | `boolean` | `false` | The percentage beside the bar (Geist Mono). Never for an indeterminate bar - it has no figure to show.<br>Shown in: [Configurator](#progressbar), [How far a job has come](#progressbar), [Follow a job through its steps](#progressbar) and 1 more |
|
|
11628
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
12102
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11629
12103
|
|
|
11630
12104
|
Also takes every attribute of `<div>`.
|
|
11631
12105
|
|
|
@@ -11633,7 +12107,7 @@ Also takes every attribute of `<div>`.
|
|
|
11633
12107
|
|
|
11634
12108
|
- No colour of verdict and no steps of its own; for a job in steps, stack one bar per step.
|
|
11635
12109
|
|
|
11636
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
12110
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11637
12111
|
|
|
11638
12112
|
### Skeleton
|
|
11639
12113
|
|
|
@@ -11782,7 +12256,7 @@ With reduced motion the shimmer stops, and the shape stands in a still, faint gr
|
|
|
11782
12256
|
| `width` | `string \| number` | `"100%"` | Width, e.g. "120px" or "60%".<br>Shown in: [Configurator](#skeleton), [Lines of text to come](#skeleton), [Shapes](#skeleton) and 2 more |
|
|
11783
12257
|
| `height` | `string \| number` | `"12px"` | Height, e.g. "12px" or 16.<br>Shown in: [Configurator](#skeleton), [Shapes](#skeleton), [Hold a list's place while it loads](#skeleton) |
|
|
11784
12258
|
| `circle` | `boolean` | `false` | Circular shape, e.g. for an avatar placeholder.<br>Shown in: [Configurator](#skeleton), [Shapes](#skeleton), [Hold a list's place while it loads](#skeleton) |
|
|
11785
|
-
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
12259
|
+
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11786
12260
|
|
|
11787
12261
|
Also takes every attribute of `<span>`.
|
|
11788
12262
|
|
|
@@ -11790,7 +12264,7 @@ Also takes every attribute of `<span>`.
|
|
|
11790
12264
|
|
|
11791
12265
|
- It draws a shape and nothing else; the rows, cards and layout it stands in for are yours.
|
|
11792
12266
|
|
|
11793
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
12267
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11794
12268
|
|
|
11795
12269
|
### Alert
|
|
11796
12270
|
|
|
@@ -11978,11 +12452,11 @@ The title is a paragraph, not a heading, so an alert does not enter the page's o
|
|
|
11978
12452
|
|
|
11979
12453
|
| Prop | Type | Default | Description |
|
|
11980
12454
|
|---|---|---|---|
|
|
11981
|
-
| `tone` | `AlertTone`<br>`"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | `"neutral"` | How urgent the message is. Only `warning` and `danger` interrupt the screen reader - the other two report politely.<br>Shown in: [Configurator](#alert), [Tones](#alert), [Offer the way forward](#alert) and
|
|
11982
|
-
| `title` | `ReactNode` | — | Heading; without it the body text carries the message on its own.<br>Shown in: [A message](#alert), [Tones](#alert), [Offer the way forward](#alert) and
|
|
12455
|
+
| `tone` | `AlertTone`<br>`"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | `"neutral"` | How urgent the message is. Only `warning` and `danger` interrupt the screen reader - the other two report politely.<br>Shown in: [Configurator](#alert), [Tones](#alert), [Offer the way forward](#alert) and 6 more |
|
|
12456
|
+
| `title` | `ReactNode` | — | Heading; without it the body text carries the message on its own.<br>Shown in: [A message](#alert), [Tones](#alert), [Offer the way forward](#alert) and 6 more |
|
|
11983
12457
|
| `actions` | `ReactNode` | — | Actions below the text, e.g. "Try again".<br>Shown in: [Offer the way forward](#alert), [Sum up a form's errors](#alert), [A deployment (Stepper)](#stepper) |
|
|
11984
12458
|
| `dismissLabel` | `string` | the wording's "Close message" | Label of the dismiss cross. |
|
|
11985
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
12459
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
11986
12460
|
|
|
11987
12461
|
###### Events
|
|
11988
12462
|
|
|
@@ -12008,7 +12482,7 @@ type AlertTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
12008
12482
|
- No timer: an alert stays until you remove it. A message that goes by itself is a toast.
|
|
12009
12483
|
- No stack or queue of messages; place each alert where its matter is.
|
|
12010
12484
|
|
|
12011
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
12485
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12012
12486
|
|
|
12013
12487
|
### Toast
|
|
12014
12488
|
|
|
@@ -12566,7 +13040,7 @@ type ToastCloseReason = "timeout" | "dismiss" | "action";
|
|
|
12566
13040
|
- No queue: a toast over the limit pushes the oldest timed one out rather than waiting. Lasting and `loading` toasts are not capped: the deck holds every one of them beside the timed ones.
|
|
12567
13041
|
- Without the Popover API the deck moves with a dialog that transforms itself: inside a dialog the toasts stand in the top layer only where the browser has it, and elsewhere they are a fixed box in the dialog.
|
|
12568
13042
|
|
|
12569
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
13043
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12570
13044
|
|
|
12571
13045
|
### EmptyState
|
|
12572
13046
|
|
|
@@ -12701,7 +13175,7 @@ The keys of [Button](#button) and [Tag](#tag) apply here.
|
|
|
12701
13175
|
| `description` | `ReactNode` | — | One sentence on why nothing is here and what would put something here.<br>Shown in: [Nothing yet](#emptystate), [Say why a filter found nothing](#emptystate), [Mark good news in a panel](#emptystate) and 3 more |
|
|
12702
13176
|
| `action` | `ReactNode` | — | The way into the next action, e.g. a button.<br>Shown in: [Nothing yet](#emptystate), [Say why a filter found nothing](#emptystate), [Cards on a dashboard (Card)](#card) and 1 more |
|
|
12703
13177
|
| `icon` | `ReactNode` | — | Optional symbol above the title.<br>Shown in: [Mark good news in a panel](#emptystate) |
|
|
12704
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
13178
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
12705
13179
|
|
|
12706
13180
|
Also takes every attribute of `<div>` – without `title`.
|
|
12707
13181
|
|
|
@@ -12874,7 +13348,7 @@ export default function ACalculation() {
|
|
|
12874
13348
|
- No interactive content and no rich layout inside: it is read, never used.
|
|
12875
13349
|
- No placement option: it stands above its element and flips below where there is no room.
|
|
12876
13350
|
|
|
12877
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
13351
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12878
13352
|
|
|
12879
13353
|
### Popover
|
|
12880
13354
|
|
|
@@ -13129,7 +13603,7 @@ type Align = "start" | "end" | "center";
|
|
|
13129
13603
|
- No padding and no inner layout: it brings the overlay's surface - ground, corners, shadow - and the rest is yours. A `className` restates the surface where one needs another.
|
|
13130
13604
|
- It does not trap focus; a surface the user must answer is a [Modal](#modal).
|
|
13131
13605
|
|
|
13132
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
13606
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
13133
13607
|
|
|
13134
13608
|
### Menu
|
|
13135
13609
|
|
|
@@ -13221,7 +13695,7 @@ One menu per row keeps a list quiet; the trigger's name says which row it acts o
|
|
|
13221
13695
|
|
|
13222
13696
|
```tsx
|
|
13223
13697
|
import { useState } from "react";
|
|
13224
|
-
import { Badge, IconButton, Menu, MenuItem, MenuSeparator, Stack, Text } from "@umriss-ui/core";
|
|
13698
|
+
import { Badge, IconButton, Menu, MenuItem, MenuSeparator, MoreGlyph, Stack, Text } from "@umriss-ui/core";
|
|
13225
13699
|
|
|
13226
13700
|
interface Incident {
|
|
13227
13701
|
id: string;
|
|
@@ -13261,7 +13735,7 @@ export default function PerRow() {
|
|
|
13261
13735
|
align="end"
|
|
13262
13736
|
trigger={
|
|
13263
13737
|
<IconButton size="sm" aria-label={`Actions for ${incident.id}`}>
|
|
13264
|
-
|
|
13738
|
+
<MoreGlyph />
|
|
13265
13739
|
</IconButton>
|
|
13266
13740
|
}
|
|
13267
13741
|
>
|
|
@@ -13316,7 +13790,7 @@ export default function PerRow() {
|
|
|
13316
13790
|
| Prop | Type | Default | Description |
|
|
13317
13791
|
|---|---|---|---|
|
|
13318
13792
|
| `tone` | `"default" \| "danger"` | `"default"` | "danger" for destructive actions.<br>Shown in: [Run actions from a trigger](#menu), [Disable an entry, mark a destructive one](#menu), [Act on a row](#menu) and 5 more |
|
|
13319
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
13793
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
13320
13794
|
|
|
13321
13795
|
###### Events
|
|
13322
13796
|
|
|
@@ -13330,7 +13804,7 @@ Also takes every attribute of `<button>` – without `onSelect`.
|
|
|
13330
13804
|
|
|
13331
13805
|
- No submenus, no checkable entries and no type-ahead.
|
|
13332
13806
|
|
|
13333
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
13807
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
13334
13808
|
|
|
13335
13809
|
### ContextMenu
|
|
13336
13810
|
|
|
@@ -13547,7 +14021,7 @@ export default function OnARow() {
|
|
|
13547
14021
|
- It listens to no right-click itself: the element and the point are yours, through the hook.
|
|
13548
14022
|
- No submenus, no checkable entries and no type-ahead, as in the menu.
|
|
13549
14023
|
|
|
13550
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
14024
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
13551
14025
|
|
|
13552
14026
|
### Modal
|
|
13553
14027
|
|
|
@@ -13820,6 +14294,39 @@ export default function MustBeAnswered() {
|
|
|
13820
14294
|
}
|
|
13821
14295
|
```
|
|
13822
14296
|
|
|
14297
|
+
##### A date in a window
|
|
14298
|
+
|
|
14299
|
+
A picker's panel and the lists inside it open within the window: a pick in the month list keeps the panel, and Escape closes the list, then the panel, then the window.
|
|
14300
|
+
|
|
14301
|
+
```tsx
|
|
14302
|
+
import { useState } from "react";
|
|
14303
|
+
import { Button, DatePicker, FormField, Modal, ModalBody, ModalFooter, ModalHeader } from "@umriss-ui/core";
|
|
14304
|
+
|
|
14305
|
+
export default function ADateInAWindow() {
|
|
14306
|
+
const [open, setOpen] = useState(false);
|
|
14307
|
+
const [due, setDue] = useState<Date | null>(null);
|
|
14308
|
+
|
|
14309
|
+
return (
|
|
14310
|
+
<>
|
|
14311
|
+
<Button onClick={() => setOpen(true)}>Set the due date</Button>
|
|
14312
|
+
<Modal open={open} onClose={() => setOpen(false)}>
|
|
14313
|
+
<ModalHeader title="Due date" />
|
|
14314
|
+
<ModalBody>
|
|
14315
|
+
<FormField label="Due">
|
|
14316
|
+
<DatePicker value={due} onChange={setDue} clearable />
|
|
14317
|
+
</FormField>
|
|
14318
|
+
</ModalBody>
|
|
14319
|
+
<ModalFooter>
|
|
14320
|
+
<Button variant="primary" onClick={() => setOpen(false)}>
|
|
14321
|
+
Done
|
|
14322
|
+
</Button>
|
|
14323
|
+
</ModalFooter>
|
|
14324
|
+
</Modal>
|
|
14325
|
+
</>
|
|
14326
|
+
);
|
|
14327
|
+
}
|
|
14328
|
+
```
|
|
14329
|
+
|
|
13823
14330
|
#### When to use something else
|
|
13824
14331
|
|
|
13825
14332
|
- A detail beside the list the user came from → Drawer
|
|
@@ -13839,16 +14346,16 @@ export default function MustBeAnswered() {
|
|
|
13839
14346
|
|
|
13840
14347
|
| Prop | Type | Default | Description |
|
|
13841
14348
|
|---|---|---|---|
|
|
13842
|
-
| `open` *required* | `boolean` | — | Whether the window stands. Controlled: the opening is the caller's decision, and only the caller knows whether something may be open.<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and
|
|
14349
|
+
| `open` *required* | `boolean` | — | Whether the window stands. Controlled: the opening is the caller's decision, and only the caller knows whether something may be open.<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and 12 more |
|
|
13843
14350
|
| `size` | `ModalSize`<br>`"sm" \| "md" \| "lg"` | `"md"` | The width of the window. The height comes from the content; only the body scrolls, header and footer stand fast.<br>Shown in: [Sizes](#modal), [Scroll long content](#modal), [Guard unsaved changes](#modal) and 3 more |
|
|
13844
14351
|
| `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop.<br>Shown in: [A window that must be answered](#modal) |
|
|
13845
|
-
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
14352
|
+
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
13846
14353
|
|
|
13847
14354
|
###### Events
|
|
13848
14355
|
|
|
13849
14356
|
| Prop | Type | Default | Description |
|
|
13850
14357
|
|---|---|---|---|
|
|
13851
|
-
| `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click.<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and
|
|
14358
|
+
| `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click.<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and 12 more |
|
|
13852
14359
|
|
|
13853
14360
|
Also takes every attribute of `<dialog>` – without `onClose`.
|
|
13854
14361
|
|
|
@@ -13856,10 +14363,10 @@ Also takes every attribute of `<dialog>` – without `onClose`.
|
|
|
13856
14363
|
|
|
13857
14364
|
| Prop | Type | Default | Description |
|
|
13858
14365
|
|---|---|---|---|
|
|
13859
|
-
| `title` *required* | `ReactNode` | — | The heading of the window. It names it for the screen reader at the same time – a dialog without a name says only "dialog".<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and
|
|
14366
|
+
| `title` *required* | `ReactNode` | — | The heading of the window. It names it for the screen reader at the same time – a dialog without a name says only "dialog".<br>Shown in: [A window that holds focus](#modal), [Sizes](#modal), [Scroll long content](#modal) and 12 more |
|
|
13860
14367
|
| `description` | `ReactNode` | — | One sentence below the heading: what is to be decided here.<br>Shown in: [A window that holds focus](#modal), [Scroll long content](#modal), [Guard unsaved changes](#modal) and 8 more |
|
|
13861
14368
|
| `hideClose` | `boolean` | `false` | Hides the close button.<br>Shown in: [A window that must be answered](#modal) |
|
|
13862
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
14369
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
13863
14370
|
|
|
13864
14371
|
Also takes every attribute of `<div>` – without `title`.
|
|
13865
14372
|
|
|
@@ -13877,7 +14384,7 @@ type ModalSize = "sm" | "md" | "lg";
|
|
|
13877
14384
|
|
|
13878
14385
|
- No non-modal window and no dragging or resizing: a panel that leaves the page usable is layout – a [Splitter](#splitter).
|
|
13879
14386
|
|
|
13880
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
14387
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
13881
14388
|
|
|
13882
14389
|
### Drawer
|
|
13883
14390
|
|
|
@@ -14156,6 +14663,89 @@ export default function BesideAServiceList() {
|
|
|
14156
14663
|
}
|
|
14157
14664
|
```
|
|
14158
14665
|
|
|
14666
|
+
##### An app shell
|
|
14667
|
+
|
|
14668
|
+
A frame is layout, so it is your application's: the same links stand in a side column or in a drawer, and your router's own link (react-router's `NavLink` sets `aria-current` itself) replaces core's `Link`.
|
|
14669
|
+
|
|
14670
|
+
```tsx
|
|
14671
|
+
import { useState, useSyncExternalStore } from "react";
|
|
14672
|
+
import { Button, Drawer, Link, ModalBody, ModalHeader, Text } from "@umriss-ui/core";
|
|
14673
|
+
|
|
14674
|
+
const PAGES = ["Overview", "Shipments", "Tours", "Settings"];
|
|
14675
|
+
const NARROW = "(max-width: 719px)";
|
|
14676
|
+
|
|
14677
|
+
/* A few lines of `matchMedia`: core has no media hook. */
|
|
14678
|
+
function useNarrow(): boolean {
|
|
14679
|
+
return useSyncExternalStore(
|
|
14680
|
+
(notify) => {
|
|
14681
|
+
const query = window.matchMedia(NARROW);
|
|
14682
|
+
query.addEventListener("change", notify);
|
|
14683
|
+
return () => query.removeEventListener("change", notify);
|
|
14684
|
+
},
|
|
14685
|
+
() => window.matchMedia(NARROW).matches,
|
|
14686
|
+
() => false,
|
|
14687
|
+
);
|
|
14688
|
+
}
|
|
14689
|
+
|
|
14690
|
+
export default function AnAppShell() {
|
|
14691
|
+
const narrow = useNarrow();
|
|
14692
|
+
const [page, setPage] = useState("Overview");
|
|
14693
|
+
const [open, setOpen] = useState(false);
|
|
14694
|
+
|
|
14695
|
+
const links = (
|
|
14696
|
+
<nav aria-label="Main">
|
|
14697
|
+
<ul style={{ listStyle: "none", margin: 0, padding: 0, display: "grid", gap: "var(--u-space-1)" }}>
|
|
14698
|
+
{PAGES.map((name) => (
|
|
14699
|
+
<li key={name}>
|
|
14700
|
+
<Text as="span" weight={name === page ? "semibold" : "regular"}>
|
|
14701
|
+
<Link
|
|
14702
|
+
href="#"
|
|
14703
|
+
aria-current={name === page ? "page" : undefined}
|
|
14704
|
+
onClick={(event) => {
|
|
14705
|
+
event.preventDefault();
|
|
14706
|
+
setPage(name);
|
|
14707
|
+
setOpen(false);
|
|
14708
|
+
}}
|
|
14709
|
+
style={{ display: "block", padding: "var(--u-space-2) var(--u-space-3)", fontWeight: "inherit" }}
|
|
14710
|
+
>
|
|
14711
|
+
{name}
|
|
14712
|
+
</Link>
|
|
14713
|
+
</Text>
|
|
14714
|
+
</li>
|
|
14715
|
+
))}
|
|
14716
|
+
</ul>
|
|
14717
|
+
</nav>
|
|
14718
|
+
);
|
|
14719
|
+
|
|
14720
|
+
return (
|
|
14721
|
+
<div style={{ border: "1px solid var(--u-hairline)", borderRadius: 8, overflow: "hidden" }}>
|
|
14722
|
+
<header
|
|
14723
|
+
style={{ display: "flex", alignItems: "center", gap: "var(--u-space-3)", padding: "var(--u-space-3) var(--u-space-4)", borderBottom: "1px solid var(--u-hairline)" }}
|
|
14724
|
+
>
|
|
14725
|
+
{narrow && (
|
|
14726
|
+
<Button size="sm" variant="secondary" aria-haspopup="dialog" onClick={() => setOpen(true)}>
|
|
14727
|
+
Menu
|
|
14728
|
+
</Button>
|
|
14729
|
+
)}
|
|
14730
|
+
<Text weight="semibold">Fleet Planner</Text>
|
|
14731
|
+
</header>
|
|
14732
|
+
<div style={{ display: "flex", minHeight: 200 }}>
|
|
14733
|
+
{!narrow && <div style={{ width: 200, padding: "var(--u-space-3)", borderInlineEnd: "1px solid var(--u-hairline)" }}>{links}</div>}
|
|
14734
|
+
<main style={{ flex: 1, minWidth: 0, padding: "var(--u-space-4)" }}>
|
|
14735
|
+
<Text as="h3" size="lg" weight="semibold">
|
|
14736
|
+
{page}
|
|
14737
|
+
</Text>
|
|
14738
|
+
</main>
|
|
14739
|
+
</div>
|
|
14740
|
+
<Drawer side="left" open={narrow && open} onClose={() => setOpen(false)}>
|
|
14741
|
+
<ModalHeader title="Fleet Planner" />
|
|
14742
|
+
<ModalBody>{links}</ModalBody>
|
|
14743
|
+
</Drawer>
|
|
14744
|
+
</div>
|
|
14745
|
+
);
|
|
14746
|
+
}
|
|
14747
|
+
```
|
|
14748
|
+
|
|
14159
14749
|
#### When to use something else
|
|
14160
14750
|
|
|
14161
14751
|
- A task that has nothing to do with what lies behind it → Modal
|
|
@@ -14174,16 +14764,16 @@ export default function BesideAServiceList() {
|
|
|
14174
14764
|
|
|
14175
14765
|
| Prop | Type | Default | Description |
|
|
14176
14766
|
|---|---|---|---|
|
|
14177
|
-
| `side` | `"right" \| "left"` | `"right"` | The edge the drawer stands at and enters from.<br>Shown in: [From the left, and wider](#drawer) |
|
|
14178
|
-
| `open` *required* | `boolean` | — | Whether the window stands. Controlled: the opening is the caller's decision, and only the caller knows whether something may be open. From `ModalProps`.<br>Shown in: [A detail from the edge](#drawer), [From the left, and wider](#drawer), [Open a service's detail from its list](#drawer) and
|
|
14767
|
+
| `side` | `"right" \| "left"` | `"right"` | The edge the drawer stands at and enters from.<br>Shown in: [From the left, and wider](#drawer), [An app shell](#drawer) |
|
|
14768
|
+
| `open` *required* | `boolean` | — | Whether the window stands. Controlled: the opening is the caller's decision, and only the caller knows whether something may be open. From `ModalProps`.<br>Shown in: [A detail from the edge](#drawer), [From the left, and wider](#drawer), [Open a service's detail from its list](#drawer) and 12 more |
|
|
14179
14769
|
| `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop. From `ModalProps`.<br>Shown in: [A window that must be answered (Modal)](#modal) |
|
|
14180
|
-
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
14770
|
+
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
14181
14771
|
|
|
14182
14772
|
###### Events
|
|
14183
14773
|
|
|
14184
14774
|
| Prop | Type | Default | Description |
|
|
14185
14775
|
|---|---|---|---|
|
|
14186
|
-
| `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click. From `ModalProps`.<br>Shown in: [A detail from the edge](#drawer), [From the left, and wider](#drawer), [Open a service's detail from its list](#drawer) and
|
|
14776
|
+
| `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click. From `ModalProps`.<br>Shown in: [A detail from the edge](#drawer), [From the left, and wider](#drawer), [Open a service's detail from its list](#drawer) and 12 more |
|
|
14187
14777
|
|
|
14188
14778
|
Also takes every attribute of `<dialog>` – without `onClose`.
|
|
14189
14779
|
|
|
@@ -14192,7 +14782,7 @@ Also takes every attribute of `<dialog>` – without `onClose`.
|
|
|
14192
14782
|
- Modal on purpose, with no non-modal mode: a panel beside a page the user keeps working in is layout, not an overlay.
|
|
14193
14783
|
- Only the left and right edges; nothing slides in from the top or bottom.
|
|
14194
14784
|
|
|
14195
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
14785
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
14196
14786
|
|
|
14197
14787
|
### ConfirmDialog
|
|
14198
14788
|
|
|
@@ -14354,7 +14944,7 @@ export default function WhileItRuns() {
|
|
|
14354
14944
|
| `cancelLabel` | `string` | the wording's "Cancel" | Label of the cancelling button.<br>Shown in: [Guard unsaved changes (Modal)](#modal) |
|
|
14355
14945
|
| `tone` | `"primary" \| "danger"` | `"primary"` | "danger" for destructive actions.<br>Shown in: [The one question](#confirmdialog), [Ask before a commitment](#confirmdialog), [Stay open while it runs](#confirmdialog) and 2 more |
|
|
14356
14946
|
| `loading` | `boolean` | `false` | Locks the actions while the confirmation is running.<br>Shown in: [Stay open while it runs](#confirmdialog) |
|
|
14357
|
-
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
14947
|
+
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
14358
14948
|
|
|
14359
14949
|
###### Events
|
|
14360
14950
|
|
|
@@ -14369,7 +14959,7 @@ Also takes every attribute of `<dialog>` – without `children`, `onClose`, `ope
|
|
|
14369
14959
|
|
|
14370
14960
|
- A title, a description and two buttons, nothing more: fields belong in a [Modal](#modal).
|
|
14371
14961
|
|
|
14372
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
14962
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
14373
14963
|
|
|
14374
14964
|
### CommandPalette
|
|
14375
14965
|
|
|
@@ -14479,11 +15069,11 @@ export default function RecentFirst() {
|
|
|
14479
15069
|
|
|
14480
15070
|
##### Open it with a shortcut
|
|
14481
15071
|
|
|
14482
|
-
[`useCommandPaletteShortcut`](#api-index-1) binds Cmd-K or Ctrl-K and “/” – except inside a text field, where a slash stays a slash.
|
|
15072
|
+
[`useCommandPaletteShortcut`](#api-index-1) binds Cmd-K or Ctrl-K and “/” – except inside a text field, where a slash stays a slash. An application setting turns the single-key “/” off (WCAG 2.1.4).
|
|
14483
15073
|
|
|
14484
15074
|
```tsx
|
|
14485
15075
|
import { useCallback, useState } from "react";
|
|
14486
|
-
import { CommandPalette, Input, Stack, Text, useCommandPaletteShortcut } from "@umriss-ui/core";
|
|
15076
|
+
import { CommandPalette, Input, Stack, Switch, Text, useCommandPaletteShortcut } from "@umriss-ui/core";
|
|
14487
15077
|
|
|
14488
15078
|
const PROJECTS = [
|
|
14489
15079
|
{ id: "shop", label: "Online shop relaunch", group: "Pembury Home" },
|
|
@@ -14496,14 +15086,16 @@ export default function Shortcut() {
|
|
|
14496
15086
|
const [open, setOpen] = useState(false);
|
|
14497
15087
|
const [text, setText] = useState("");
|
|
14498
15088
|
const [project, setProject] = useState("-");
|
|
15089
|
+
const [slash, setSlash] = useState(true);
|
|
14499
15090
|
|
|
14500
|
-
useCommandPaletteShortcut(useCallback(() => setOpen(true), []));
|
|
15091
|
+
useCommandPaletteShortcut(useCallback(() => setOpen(true), []), { slash });
|
|
14501
15092
|
|
|
14502
15093
|
return (
|
|
14503
15094
|
<Stack gap={3} align="flex-start">
|
|
14504
15095
|
<Text size="sm" tone="secondary">
|
|
14505
15096
|
Press Cmd-K, Ctrl-K or “/” to jump to a project. Current: {project}
|
|
14506
15097
|
</Text>
|
|
15098
|
+
<Switch label="“/” opens the palette" checked={slash} onChange={(event) => setSlash(event.target.checked)} />
|
|
14507
15099
|
<Input
|
|
14508
15100
|
size="sm"
|
|
14509
15101
|
aria-label="Here a slash stays a slash"
|
|
@@ -14641,7 +15233,7 @@ export default function SearchHundredsOfPages() {
|
|
|
14641
15233
|
| `items` *required* | `readonly ``CommandPaletteItem``[]` | — | The candidates that are searched. They belong to the caller: the palette keeps no memory and does not reorder them.<br>Shown in: [Run a command](#commandpalette), [Show recent choices first](#commandpalette), [Open it with a shortcut](#commandpalette) and 2 more |
|
|
14642
15234
|
| `restingItems` | `readonly ``CommandPaletteItem``[]` | — | What stands there as long as nothing is typed. Without a value: nothing, and the window is only the field. A LIST and not a switch, because the interesting question is not "all or none" but "which". Whoever really wants to show everything passes `restingItems={items}`; whoever wants to show the five most recently used passes those - and a switch cannot do that. With long lists "all" is also exactly the state this component did away with: a list that is already full can only shrink. The rows stand in THIS order and without marks: without a query there is no rank and nothing to mark. Rank and weight therefore play no part here; the order belongs to the caller.<br>Shown in: [Run a command](#commandpalette), [Show recent choices first](#commandpalette) |
|
|
14643
15235
|
| `maxFinds` | `number` | every find | The most finds that stand at once - the best by rank. A last line says how many more there are, and typing on narrows them. For a long list of candidates, where a single letter finds hundreds and drawing them all would make every keystroke wait.<br>Shown in: [Search hundreds of pages](#commandpalette) |
|
|
14644
|
-
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
15236
|
+
| `ref` | `Ref<HTMLDialogElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
14645
15237
|
|
|
14646
15238
|
###### Events
|
|
14647
15239
|
|
|
@@ -14669,7 +15261,7 @@ Also takes every attribute of `<dialog>` – without `children`, `onClose`, `ope
|
|
|
14669
15261
|
- No memory of past choices and no ranking of its own beyond the match: recency and frequency are weights you keep.
|
|
14670
15262
|
- No nested steps or arguments: a command that needs input opens your own form after it is chosen.
|
|
14671
15263
|
|
|
14672
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
15264
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
14673
15265
|
|
|
14674
15266
|
## Navigation
|
|
14675
15267
|
|
|
@@ -14968,7 +15560,7 @@ export default function BrowseDownAndBackUp() {
|
|
|
14968
15560
|
| Prop | Type | Default | Description |
|
|
14969
15561
|
|---|---|---|---|
|
|
14970
15562
|
| `items` *required* | `readonly ``BreadcrumbEntry``[]` | — | The trail from the root to the current page; the last is the page.<br>Shown in: [A trail](#breadcrumb), [Route it yourself](#breadcrumb), [Fold when narrow](#breadcrumb) and 3 more |
|
|
14971
|
-
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
15563
|
+
| `ref` | `Ref<HTMLElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
14972
15564
|
|
|
14973
15565
|
Also takes every attribute of the rendered element.
|
|
14974
15566
|
|
|
@@ -14989,7 +15581,7 @@ Also takes every attribute of the rendered element.
|
|
|
14989
15581
|
|
|
14990
15582
|
- It neither routes nor reads the address: the trail is what you pass.
|
|
14991
15583
|
|
|
14992
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
15584
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
14993
15585
|
|
|
14994
15586
|
### Tabs
|
|
14995
15587
|
|
|
@@ -15327,7 +15919,7 @@ export default function MoreTabsThanRoom() {
|
|
|
15327
15919
|
|---|---|---|---|
|
|
15328
15920
|
| `defaultValue` | `string` | — | Uncontrolled: the tab that stands first. Afterwards the choice belongs to the tabs - for a switch no address and no handler needs to know.<br>Shown in: [One view at a time](#tabs), [Loading and empty panels](#tabs), [An invoice in tabs](#tabs) and 2 more |
|
|
15329
15921
|
| `value` | `string` | — | The value of the visible tab. Controlled, `Tabs` remember nothing, so that the tab can come out of an address.<br>Shown in: [Keep the tab in the address](#tabs) |
|
|
15330
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
15922
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
15331
15923
|
|
|
15332
15924
|
###### Events
|
|
15333
15925
|
|
|
@@ -15342,7 +15934,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
15342
15934
|
| Prop | Type | Default | Description |
|
|
15343
15935
|
|---|---|---|---|
|
|
15344
15936
|
| `value` *required* | `string` | — | The value this tab reports – and under which its panel stands.<br>Shown in: [One view at a time](#tabs), [Keep the tab in the address](#tabs), [Loading and empty panels](#tabs) and 3 more |
|
|
15345
|
-
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
15937
|
+
| `ref` | `Ref<HTMLButtonElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
15346
15938
|
|
|
15347
15939
|
Also takes every attribute of `<button>`.
|
|
15348
15940
|
|
|
@@ -15351,7 +15943,7 @@ Also takes every attribute of `<button>`.
|
|
|
15351
15943
|
| Prop | Type | Default | Description |
|
|
15352
15944
|
|---|---|---|---|
|
|
15353
15945
|
| `value` *required* | `string` | — | The value of the tab this panel belongs to. Only the matching panel stands in the document – a hidden panel would keep focus, scroll position and live regions that nobody sees.<br>Shown in: [One view at a time](#tabs), [Keep the tab in the address](#tabs), [Loading and empty panels](#tabs) and 3 more |
|
|
15354
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
15946
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
15355
15947
|
|
|
15356
15948
|
Also takes every attribute of `<div>`.
|
|
15357
15949
|
|
|
@@ -15359,7 +15951,7 @@ Also takes every attribute of `<div>`.
|
|
|
15359
15951
|
|
|
15360
15952
|
- More tabs than fit scroll sideways within the list; there is no overflow menu, and no closing or reordering of tabs.
|
|
15361
15953
|
|
|
15362
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
15954
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
15363
15955
|
|
|
15364
15956
|
### Accordion
|
|
15365
15957
|
|
|
@@ -15583,7 +16175,7 @@ export default function LongSettingsInSections() {
|
|
|
15583
16175
|
| `defaultValue` | `readonly string[]` | `[]` | Uncontrolled: the sections open at the start.<br>Shown in: [One section at a time](#accordion), [Several open, one locked](#accordion), [Long settings in sections](#accordion) |
|
|
15584
16176
|
| `value` | `readonly string[]` | — | Controlled: the values of the open sections. A list for both types, so that switching the type changes nothing else.<br>Shown in: [Open and fold all](#accordion) |
|
|
15585
16177
|
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | `3` | The level of the heading each header stands in - the one that fits the page's outline.<br>Shown in: [Several open, one locked](#accordion), [Long settings in sections](#accordion) |
|
|
15586
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
16178
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
15587
16179
|
|
|
15588
16180
|
###### Events
|
|
15589
16181
|
|
|
@@ -15600,7 +16192,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
15600
16192
|
| `value` *required* | `string` | — | What names the section in the accordion's `value`.<br>Shown in: [One section at a time](#accordion), [Several open, one locked](#accordion), [Open and fold all](#accordion) and 1 more |
|
|
15601
16193
|
| `title` *required* | `ReactNode` | — | The header's text. It names the section's region too.<br>Shown in: [One section at a time](#accordion), [Several open, one locked](#accordion), [Open and fold all](#accordion) and 1 more |
|
|
15602
16194
|
| `disabled` | `boolean` | `false` | A section that cannot be opened now; its header stays in the list.<br>Shown in: [Several open, one locked](#accordion) |
|
|
15603
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
16195
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
15604
16196
|
|
|
15605
16197
|
Also takes every attribute of `<div>` – without `title`.
|
|
15606
16198
|
|
|
@@ -15608,7 +16200,7 @@ Also takes every attribute of `<div>` – without `title`.
|
|
|
15608
16200
|
|
|
15609
16201
|
- A folded section's content stays rendered; for heavy content, render it only while its section is open.
|
|
15610
16202
|
|
|
15611
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
16203
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
15612
16204
|
|
|
15613
16205
|
### Stepper
|
|
15614
16206
|
|
|
@@ -15688,26 +16280,49 @@ export default function AFailedStep() {
|
|
|
15688
16280
|
|
|
15689
16281
|
##### Move on yourself
|
|
15690
16282
|
|
|
15691
|
-
The stepper has no keys of its own: your application sets `current
|
|
16283
|
+
The stepper has no keys or clicks of its own: your application sets `current`, behind two buttons or a done step's label, and moves the focus to the new step's heading.
|
|
15692
16284
|
|
|
15693
16285
|
```tsx
|
|
15694
|
-
import { useState } from "react";
|
|
15695
|
-
import { Button, Stack, Stepper } from "@umriss-ui/core";
|
|
16286
|
+
import { useEffect, useRef, useState } from "react";
|
|
16287
|
+
import { Button, Stack, Stepper, Text } from "@umriss-ui/core";
|
|
15696
16288
|
|
|
15697
|
-
const
|
|
16289
|
+
const LABELS = ["Choose people", "Set capacity", "Plan leave", "Confirm"];
|
|
15698
16290
|
|
|
15699
16291
|
export default function MoveOnYourself() {
|
|
15700
|
-
const [current, setCurrent] = useState(
|
|
16292
|
+
const [current, setCurrent] = useState(2);
|
|
16293
|
+
const heading = useRef<HTMLHeadingElement>(null);
|
|
16294
|
+
const moved = useRef(false);
|
|
16295
|
+
|
|
16296
|
+
/* Not on the first render: the focus moves because a step changed. */
|
|
16297
|
+
useEffect(() => {
|
|
16298
|
+
if (moved.current) heading.current?.focus();
|
|
16299
|
+
moved.current = true;
|
|
16300
|
+
}, [current]);
|
|
16301
|
+
|
|
16302
|
+
/* A done step's label is a button that goes back to it. */
|
|
16303
|
+
const steps = LABELS.map((label, index) => ({
|
|
16304
|
+
label:
|
|
16305
|
+
index < current ? (
|
|
16306
|
+
<Button size="sm" variant="plain" onClick={() => setCurrent(index)}>
|
|
16307
|
+
{label}
|
|
16308
|
+
</Button>
|
|
16309
|
+
) : (
|
|
16310
|
+
label
|
|
16311
|
+
),
|
|
16312
|
+
}));
|
|
15701
16313
|
|
|
15702
16314
|
return (
|
|
15703
16315
|
<Stack gap={4} style={{ maxWidth: 560 }}>
|
|
15704
|
-
<Stepper aria-label="Set up sprint 15" steps={
|
|
16316
|
+
<Stepper aria-label="Set up sprint 15" steps={steps} current={current} />
|
|
16317
|
+
<Text as="h3" size="lg" weight="semibold" ref={heading} tabIndex={-1} style={{ outline: "none" }}>
|
|
16318
|
+
{LABELS[current] ?? "Sprint 15 is running"}
|
|
16319
|
+
</Text>
|
|
15705
16320
|
<Stack direction="row" gap={2}>
|
|
15706
16321
|
<Button size="sm" variant="secondary" disabled={current === 0} onClick={() => setCurrent(current - 1)}>
|
|
15707
16322
|
Back
|
|
15708
16323
|
</Button>
|
|
15709
|
-
<Button size="sm" variant="primary" disabled={current ===
|
|
15710
|
-
{current >=
|
|
16324
|
+
<Button size="sm" variant="primary" disabled={current === LABELS.length} onClick={() => setCurrent(current + 1)}>
|
|
16325
|
+
{current >= LABELS.length - 1 ? "Start the sprint" : "Next"}
|
|
15711
16326
|
</Button>
|
|
15712
16327
|
</Stack>
|
|
15713
16328
|
</Stack>
|
|
@@ -15801,7 +16416,7 @@ Under forced colours the lines between the steps take the system's text colour,
|
|
|
15801
16416
|
| `steps` *required* | `readonly ``StepperStep``[]` | — | The steps in the order they are walked.<br>Shown in: [Where a procedure stands](#stepper), [Steps in a column](#stepper), [A failed step](#stepper) and 6 more |
|
|
15802
16417
|
| `current` *required* | `number` | — | The index of the step being worked on. The steps before it are done, the ones after it upcoming; past the last step, every step is done.<br>Shown in: [Where a procedure stands](#stepper), [Steps in a column](#stepper), [A failed step](#stepper) and 6 more |
|
|
15803
16418
|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | `horizontal` in a row, `vertical` in a column for steps with longer descriptions.<br>Shown in: [Steps in a column](#stepper), [A failed step](#stepper), [An invoice in tabs (Tabs)](#tabs) |
|
|
15804
|
-
| `ref` | `Ref<HTMLOListElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
16419
|
+
| `ref` | `Ref<HTMLOListElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [Move on yourself](#stepper), [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield) and 4 more |
|
|
15805
16420
|
|
|
15806
16421
|
Also takes every attribute of the rendered element.
|
|
15807
16422
|
|
|
@@ -15815,10 +16430,10 @@ Also takes every attribute of the rendered element.
|
|
|
15815
16430
|
|
|
15816
16431
|
#### Known limits
|
|
15817
16432
|
|
|
15818
|
-
- The steps are read, not navigated: no keys, no clicks, and no next or back of its own. Moving on is your application's decision.
|
|
16433
|
+
- The steps are read, not navigated: no keys, no clicks, and no next or back of its own. Moving on is your application's decision, by a done step's label as a button or by buttons of its own.
|
|
15819
16434
|
- No branching or optional steps; pass the steps that apply.
|
|
15820
16435
|
|
|
15821
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
16436
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
15822
16437
|
|
|
15823
16438
|
### TreeView
|
|
15824
16439
|
|
|
@@ -16378,7 +16993,7 @@ export default function SearchCheckAndReveal() {
|
|
|
16378
16993
|
| `tree` *required* | `Tree``<K, S>` | — | The tree from `useTree`. It is the whole state: flattening, active node, checks, anchor. The view holds nothing beside it.<br>Shown in: [A tree](#treeview), [Tick a selection](#treeview), [Load branches on demand](#treeview) and 5 more |
|
|
16379
16994
|
| `checkable` | `boolean` | `false` | Show ticks. Without them a tree remains that knows only an active node - and no space is kept free for them.<br>Shown in: [Tick a selection](#treeview), [With an error](#treeview), [Search, check and reveal in a large tree](#treeview) |
|
|
16380
16995
|
| `children` *required* | `(entry: ``FlatteningEntry``<K, S>) => ReactNode` | — | What the node says.<br>Shown in: [A tree](#treeview), [Tick a selection](#treeview), [Load branches on demand](#treeview) and 5 more |
|
|
16381
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
16996
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
16382
16997
|
|
|
16383
16998
|
###### Accessibility
|
|
16384
16999
|
|
|
@@ -16398,7 +17013,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
16398
17013
|
| `invalid` | `boolean` | — | Marks the field as invalid. `FormField` sets it itself as soon as it carries an `error` - by hand only necessary without `FormField`. From `InputProps`.<br>Shown in: [With an error](#treeview), [Configurator (Input)](#input), [With an error (Input)](#input) |
|
|
16399
17014
|
| `numeric` | `boolean` | `false` | Right-aligned tabular figures in Geist Mono, e.g. for key figures. From `InputProps`.<br>Shown in: [Configurator (Input)](#input), [Align reference numbers (Input)](#input), [Take a delivery address (Input)](#input) and 2 more |
|
|
16400
17015
|
| `clearable` | `boolean` | `false` | Shows a gently appearing cross where there is content, which clears the input. Requires a controlled field (value) and onClear. From `InputProps`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Clear the field (Input)](#input) |
|
|
16401
|
-
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
17016
|
+
| `ref` | `Ref<HTMLInputElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
16402
17017
|
|
|
16403
17018
|
###### Events
|
|
16404
17019
|
|
|
@@ -16496,7 +17111,7 @@ to render and the heights of the filler rows around it.
|
|
|
16496
17111
|
- No dragging nodes to rearrange them.
|
|
16497
17112
|
- It fetches nothing and handles no loading errors: retries and messages stay in your application ([ADR-0005](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0005-what-cannot-be-checked.md)).
|
|
16498
17113
|
|
|
16499
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
17114
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
16500
17115
|
|
|
16501
17116
|
### Benchmark
|
|
16502
17117
|
|
|
@@ -16953,7 +17568,7 @@ The keys of [Button](#button) apply here.
|
|
|
16953
17568
|
|---|---|---|---|
|
|
16954
17569
|
| `tone` | `BadgeTone`<br>`"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | `"neutral"` | What the badge stands for. There is always a word beside it: a colour on its own is not a statement.<br>Shown in: [Configurator](#badge), [Tones](#badge), [Counters](#badge) and 20 more |
|
|
16955
17570
|
| `pill` | `boolean` | `false` | Fully rounded pill shape - for counters and key figures. The default is the slightly rounded badge shape for status labels.<br>Shown in: [Configurator](#badge), [Counters](#badge), [Fold the body (Card)](#card) and 1 more |
|
|
16956
|
-
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
17571
|
+
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
16957
17572
|
|
|
16958
17573
|
Also takes every attribute of `<span>`.
|
|
16959
17574
|
|
|
@@ -16973,7 +17588,7 @@ type BadgeTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
16973
17588
|
- It cannot be clicked or removed; a label the user acts on is a [Tag](#tag).
|
|
16974
17589
|
- It counts nothing itself: capping at “99+” is yours.
|
|
16975
17590
|
|
|
16976
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
17591
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
16977
17592
|
|
|
16978
17593
|
### Tag
|
|
16979
17594
|
|
|
@@ -17201,7 +17816,7 @@ export default function AFilterBar() {
|
|
|
17201
17816
|
| `children` *required* | `ReactNode` | — | The text of the label – short enough to stand on one line.<br>Shown in: [Configurator](#tag), [A tag](#tag), [Tones](#tag) and 5 more |
|
|
17202
17817
|
| `removeLabel` | `string` | — | Label of the remove key. Needed as soon as the content is not text – no sentence can be formed out of a node.<br>Shown in: [Remove tags from a group](#tag) |
|
|
17203
17818
|
| `disabled` | `boolean` | `false` | Takes the remove key away from the tag without hiding it: disabled is a statement about the key and not about the label.<br>Shown in: [Configurator](#tag), [Remove tags from a group](#tag) |
|
|
17204
|
-
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
17819
|
+
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
17205
17820
|
|
|
17206
17821
|
###### Events
|
|
17207
17822
|
|
|
@@ -17215,7 +17830,7 @@ Also takes every attribute of `<span>` – without `onRemove`.
|
|
|
17215
17830
|
|
|
17216
17831
|
| Prop | Type | Default | Description |
|
|
17217
17832
|
|---|---|---|---|
|
|
17218
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
17833
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
17219
17834
|
|
|
17220
17835
|
###### Accessibility
|
|
17221
17836
|
|
|
@@ -17240,7 +17855,7 @@ type TagTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
17240
17855
|
- No field for typing new tags: a tag input is a [MultiSelect](#multiselect).
|
|
17241
17856
|
- Tags are not toggles: a set of choices to switch on and off is a group of [Checkbox](#checkbox) or a [ButtonGroup](#buttongroup).
|
|
17242
17857
|
|
|
17243
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
17858
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
17244
17859
|
|
|
17245
17860
|
### Stat
|
|
17246
17861
|
|
|
@@ -17981,6 +18596,49 @@ export default function AServiceOverview() {
|
|
|
17981
18596
|
}
|
|
17982
18597
|
```
|
|
17983
18598
|
|
|
18599
|
+
##### Say how far the source vouches for a value
|
|
18600
|
+
|
|
18601
|
+
Pass `quality` – `good`, `uncertain` or `bad`, the severities of an OPC UA status code – and the tile says so in a word and a line under the figure. The number and the verdict stay; mapping a status code to a level is the application's.
|
|
18602
|
+
|
|
18603
|
+
```tsx
|
|
18604
|
+
import { Grid, Stat } from "@umriss-ui/core";
|
|
18605
|
+
import type { FreshnessAges, LimitSet } from "@umriss-ui/core";
|
|
18606
|
+
|
|
18607
|
+
/* Distances from the moment the page loaded, so the tiles always read the same. */
|
|
18608
|
+
const LOADED = Date.now();
|
|
18609
|
+
const MIN = 60_000;
|
|
18610
|
+
|
|
18611
|
+
const AGES: FreshnessAges = { stale: 2 * MIN, lost: 10 * MIN };
|
|
18612
|
+
|
|
18613
|
+
/** The same limits for every tile: warn from 820 °C, alarm from 860 °C. */
|
|
18614
|
+
const FURNACE: LimitSet = {
|
|
18615
|
+
limits: [
|
|
18616
|
+
{ value: 820, side: "upper", severity: "warning" },
|
|
18617
|
+
{ value: 860, side: "upper", severity: "alarm" },
|
|
18618
|
+
],
|
|
18619
|
+
};
|
|
18620
|
+
|
|
18621
|
+
export default function SourceQuality() {
|
|
18622
|
+
return (
|
|
18623
|
+
<Grid minItemWidth="200px" gap={4}>
|
|
18624
|
+
<Stat label="Furnace 1" value={805} unit="°C" decimals={0} limits={FURNACE} quality="good" />
|
|
18625
|
+
<Stat label="Furnace 2" value={812} unit="°C" decimals={0} limits={FURNACE} quality="uncertain" />
|
|
18626
|
+
<Stat label="Furnace 3" value={905} unit="°C" decimals={0} limits={FURNACE} quality="bad" />
|
|
18627
|
+
<Stat
|
|
18628
|
+
label="Furnace 4"
|
|
18629
|
+
value={841}
|
|
18630
|
+
unit="°C"
|
|
18631
|
+
decimals={0}
|
|
18632
|
+
limits={FURNACE}
|
|
18633
|
+
quality="bad"
|
|
18634
|
+
asOf={LOADED - 4 * MIN}
|
|
18635
|
+
ages={AGES}
|
|
18636
|
+
/>
|
|
18637
|
+
</Grid>
|
|
18638
|
+
);
|
|
18639
|
+
}
|
|
18640
|
+
```
|
|
18641
|
+
|
|
17984
18642
|
#### When to use something else
|
|
17985
18643
|
|
|
17986
18644
|
- A share of a whole, drawn as a bar → Meter
|
|
@@ -17999,15 +18657,16 @@ It announces nothing: a value that changes or a verdict that turns is read when
|
|
|
17999
18657
|
|
|
18000
18658
|
| Prop | Type | Default | Description |
|
|
18001
18659
|
|---|---|---|---|
|
|
18002
|
-
| `label` *required* | `string` | — | What is being measured.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and
|
|
18003
|
-
| `value` *required* | `number \| null \| undefined` | — | The measured value. Absent or non-finite gives the verdict `unknown` – and the tile says so, instead of showing a zero or an empty bar.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and
|
|
18004
|
-
| `unit` | `string` | — | The unit as it stands behind the value – „ms", „%", „GB".<br>Shown in: [Configurator](#stat), [Read a value against its limits](#stat), [Show a value nobody has](#stat) and
|
|
18005
|
-
| `decimals` | `number` | — | Fixed number of decimal places. Without it the notation decides; a metric whose number of digits jumps reads as a jump in the value.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and
|
|
18006
|
-
| `limits` | `LimitSet` | — | The rule the value is read against. Without it the tile is neutral – the honest display of a number for which nobody has named a rule.<br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
18660
|
+
| `label` *required* | `string` | — | What is being measured.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and 16 more |
|
|
18661
|
+
| `value` *required* | `number \| null \| undefined` | — | The measured value. Absent or non-finite gives the verdict `unknown` – and the tile says so, instead of showing a zero or an empty bar.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and 16 more |
|
|
18662
|
+
| `unit` | `string` | — | The unit as it stands behind the value – „ms", „%", „GB".<br>Shown in: [Configurator](#stat), [Read a value against its limits](#stat), [Show a value nobody has](#stat) and 15 more |
|
|
18663
|
+
| `decimals` | `number` | — | Fixed number of decimal places. Without it the notation decides; a metric whose number of digits jumps reads as a jump in the value.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and 13 more |
|
|
18664
|
+
| `limits` | `LimitSet` | — | The rule the value is read against. Without it the tile is neutral – the honest display of a number for which nobody has named a rule.<br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and 13 more |
|
|
18007
18665
|
| `history` | `readonly number[]` | — | Values in chronological order; yields the history line, across the tile beneath the figures, or beside them in a tile of 380 px and more.<br>Shown in: [Add a history](#stat), [Give the history room](#stat), [Watch a kiln zone](#stat) and 4 more |
|
|
18008
|
-
| `asOf` | `Date \| number \| null` | — | When the value was true – not when it was fetched.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [
|
|
18009
|
-
| `ages` | `FreshnessAges` | — | Without ages there is no freshness display and no cadence.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [
|
|
18010
|
-
| `
|
|
18666
|
+
| `asOf` | `Date \| number \| null` | — | When the value was true – not when it was fetched.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [Say how far the source vouches for a value](#stat) and 1 more |
|
|
18667
|
+
| `ages` | `FreshnessAges` | — | Without ages there is no freshness display and no cadence.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [Say how far the source vouches for a value](#stat) and 1 more |
|
|
18668
|
+
| `quality` | `Quality`<br>`"good" \| "uncertain" \| "bad"` | — | How far the value's source vouches for it. Absent and `good` show nothing; `uncertain` and `bad` say so in a word, in the tile's name and in a line under the figure. The verdict and the freshness stay.<br>Shown in: [Say how far the source vouches for a value](#stat) |
|
|
18669
|
+
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
18011
18670
|
|
|
18012
18671
|
Also takes every attribute of `<div>` – without `children`.
|
|
18013
18672
|
|
|
@@ -18022,7 +18681,7 @@ violated, and it is never the edge of a region.
|
|
|
18022
18681
|
|
|
18023
18682
|
| Prop | Type | Default | Description |
|
|
18024
18683
|
|---|---|---|---|
|
|
18025
|
-
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
18684
|
+
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and 13 more |
|
|
18026
18685
|
| `target` | `number` | — | <br>Shown in: [Measure against a target](#stat), [Watch a kiln zone](#stat), [English and German side by side (Language)](#language) and 3 more |
|
|
18027
18686
|
|
|
18028
18687
|
###### `FreshnessAges`
|
|
@@ -18036,8 +18695,17 @@ harder statement still wins - the middle state simply falls away.
|
|
|
18036
18695
|
|
|
18037
18696
|
| Prop | Type | Default | Description |
|
|
18038
18697
|
|---|---|---|---|
|
|
18039
|
-
| `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [
|
|
18040
|
-
| `lost` *required* | `number` | — | From this age on the connection counts as disconnected.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [
|
|
18698
|
+
| `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [Say how far the source vouches for a value](#stat) and 1 more |
|
|
18699
|
+
| `lost` *required* | `number` | — | From this age on the connection counts as disconnected.<br>Shown in: [Show how fresh a value is](#stat), [Watch the services that page at night](#stat), [Say how far the source vouches for a value](#stat) and 1 more |
|
|
18700
|
+
|
|
18701
|
+
###### `Quality`
|
|
18702
|
+
|
|
18703
|
+
How far a value's source vouches for it - independently of how the value is judged and how old it is.
|
|
18704
|
+
The levels are the severities of an OPC UA status code; mapping a code (or another protocol's quality) to a level is the application's.
|
|
18705
|
+
|
|
18706
|
+
```ts
|
|
18707
|
+
type Quality = "good" | "uncertain" | "bad";
|
|
18708
|
+
```
|
|
18041
18709
|
|
|
18042
18710
|
###### `Limit`
|
|
18043
18711
|
|
|
@@ -18049,9 +18717,9 @@ force a `null` on one edge in the one-sided case.
|
|
|
18049
18717
|
|
|
18050
18718
|
| Prop | Type | Default | Description |
|
|
18051
18719
|
|---|---|---|---|
|
|
18052
|
-
| `value` *required* | `number` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
18053
|
-
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
18054
|
-
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
18720
|
+
| `value` *required* | `number` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and 13 more |
|
|
18721
|
+
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and 13 more |
|
|
18722
|
+
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and 13 more |
|
|
18055
18723
|
|
|
18056
18724
|
###### `Side`
|
|
18057
18725
|
|
|
@@ -18076,7 +18744,7 @@ type Severity = "warning" | "alarm";
|
|
|
18076
18744
|
- No trend arrow: a direction from two noisy points is read as information it does not carry; the history line shows the shape.
|
|
18077
18745
|
- It fetches and polls nothing: freshness is judged from the `asOf` you give it.
|
|
18078
18746
|
|
|
18079
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
18747
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
18080
18748
|
|
|
18081
18749
|
### Meter
|
|
18082
18750
|
|
|
@@ -18228,7 +18896,7 @@ It is no live region: a new value is read when a reader reaches the bar. Under f
|
|
|
18228
18896
|
| `tone` | `MeterTone`<br>`"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | `"accent"` | The colour of the bar. It comes from an assessment and not from taste: beside the bar there is always the number or a word, so that the colour is never the only statement.<br>Shown in: [Configurator](#meter), [Tones](#meter), [Compare a team's capacity](#meter) and 2 more |
|
|
18229
18897
|
| `showLabel` | `boolean` | `true` | The percentage to the right of the bar (Geist Mono).<br>Shown in: [Configurator](#meter), [A share](#meter), [Compare a team's capacity](#meter) and 2 more |
|
|
18230
18898
|
| `label` | `string` | the wording's "Fill level" | What is being measured, e.g. "Utilisation". A role of `meter` needs a name from the author - the visible percentage inside it does not count for that, and neither does the column heading beside it. Whoever knows what the bar measures says it better than the general term.<br>Shown in: [A share](#meter), [Tones](#meter), [Compare a team's capacity](#meter) and 2 more |
|
|
18231
|
-
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
18899
|
+
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
18232
18900
|
|
|
18233
18901
|
Also takes every attribute of `<span>`.
|
|
18234
18902
|
|
|
@@ -18246,7 +18914,7 @@ type MeterTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
18246
18914
|
|
|
18247
18915
|
- No limit marks, target tick or scale on the bar; for a value against limits use a [Stat](#stat).
|
|
18248
18916
|
|
|
18249
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
18917
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
18250
18918
|
|
|
18251
18919
|
### Sparkline
|
|
18252
18920
|
|
|
@@ -18496,7 +19164,7 @@ export default function InATable() {
|
|
|
18496
19164
|
| `width` | `number \| "fill"` | `96` | Width in pixels; the default is a row width, not a chart width. `"fill"` takes the width of its container, as a tile's history does; the line keeps its stroke and the end point stays round.<br>Shown in: [Configurator](#sparkline), [Size and tone](#sparkline), [One above the other (Splitter)](#splitter) and 1 more |
|
|
18497
19165
|
| `height` | `number` | `28` | Height in pixels; the default is as high as a table row. With `width` `"fill"` a stylesheet may set the height instead: the drawing follows its box.<br>Shown in: [Configurator](#sparkline), [Size and tone](#sparkline), [One above the other (Splitter)](#splitter) and 1 more |
|
|
18498
19166
|
| `tone` | `"ink" \| "accent"` | `"ink"` | The line is ink, not meaning: `accent` only where exactly one line among several is to be emphasised.<br>Shown in: [Configurator](#sparkline), [Size and tone](#sparkline) |
|
|
18499
|
-
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
19167
|
+
| `ref` | `Ref<HTMLSpanElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
18500
19168
|
|
|
18501
19169
|
Also takes every attribute of `<span>`.
|
|
18502
19170
|
|
|
@@ -18504,7 +19172,7 @@ Also takes every attribute of `<span>`.
|
|
|
18504
19172
|
|
|
18505
19173
|
- No axes, labels, tooltip or points to hover: the value stands beside it.
|
|
18506
19174
|
|
|
18507
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.
|
|
19175
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/core-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
|
|
18508
19176
|
|
|
18509
19177
|
## API index
|
|
18510
19178
|
|
|
@@ -18532,7 +19200,7 @@ Used on [Accordion](#accordion).
|
|
|
18532
19200
|
|
|
18533
19201
|
[Alert](#alert) – A message that stays in the page until its matter is settled (also called a banner or callout). Reach for it when the reader must notice something here: a failed import, an approval waiting, a form that did not save.
|
|
18534
19202
|
|
|
18535
|
-
Used on [Scenarios](#scenarios), [Splitter](#splitter), [Textarea](#textarea), [Slider](#slider), [FileInput](#fileinput), [DateTimePicker](#datetimepicker), [Alert](#alert) and [Stepper](#stepper).
|
|
19203
|
+
Used on [Scenarios](#scenarios), [Splitter](#splitter), [Textarea](#textarea), [Slider](#slider), [FileInput](#fileinput), [Combobox](#combobox), [DateTimePicker](#datetimepicker), [Alert](#alert) and [Stepper](#stepper).
|
|
18536
19204
|
|
|
18537
19205
|
##### `AngleGlyph`
|
|
18538
19206
|
|
|
@@ -18618,7 +19286,7 @@ function ClockGlyph({ ref, size, ...rest }: GlyphProps): import("react").JSX.Ele
|
|
|
18618
19286
|
|
|
18619
19287
|
[Combobox](#combobox) – One choice from a long list, found by typing (autocomplete, typeahead, searchable select): a driver, a service, an account. The list filters along while the value stays exactly one.
|
|
18620
19288
|
|
|
18621
|
-
Used on [Scenarios](#scenarios), [Language](#language), [Combobox](#combobox), [Popover](#popover) and [CommandPalette](#commandpalette).
|
|
19289
|
+
Used on [Scenarios](#scenarios), [Language](#language), [FormField](#formfield), [Combobox](#combobox), [Popover](#popover) and [CommandPalette](#commandpalette).
|
|
18622
19290
|
|
|
18623
19291
|
##### `CommandPalette`
|
|
18624
19292
|
|
|
@@ -18661,7 +19329,7 @@ Used on [IconButton](#iconbutton).
|
|
|
18661
19329
|
|
|
18662
19330
|
[DatePicker](#datepicker) – One day, picked in a calendar (date field): a delivery date, a due date. Weeks begin on Monday.
|
|
18663
19331
|
|
|
18664
|
-
Used on [Scenarios](#scenarios), [UmrissProvider](#umrissprovider), [Sizes](#sizes), [Language](#language), [FormField](#formfield)
|
|
19332
|
+
Used on [Scenarios](#scenarios), [UmrissProvider](#umrissprovider), [Sizes](#sizes), [Language](#language), [FormField](#formfield), [DatePicker](#datepicker) and [Modal](#modal).
|
|
18665
19333
|
|
|
18666
19334
|
##### `DateRangePicker`
|
|
18667
19335
|
|
|
@@ -18763,7 +19431,7 @@ Used on [Scenarios](#scenarios), [Stack and Grid](#stack-and-grid), [Typography]
|
|
|
18763
19431
|
|
|
18764
19432
|
[IconButton](#iconbutton) – A square button that shows only an icon (also called an icon-only button): refresh, export, close, the actions of a row. Reach for it where the icon is known well enough to stand alone; its name is required and shows as a tooltip.
|
|
18765
19433
|
|
|
18766
|
-
Used on [Button](#button), [IconButton](#iconbutton) and [Menu](#menu).
|
|
19434
|
+
Used on [Button](#button), [IconButton](#iconbutton), [Input](#input) and [Menu](#menu).
|
|
18767
19435
|
|
|
18768
19436
|
##### `Input`
|
|
18769
19437
|
|
|
@@ -18780,14 +19448,14 @@ and usable directly for a section as well.
|
|
|
18780
19448
|
function LanguageProvider({ formats, wording, children }: LanguageProviderProps): import("react").JSX.Element;
|
|
18781
19449
|
```
|
|
18782
19450
|
|
|
18783
|
-
Used on [Language](#language).
|
|
19451
|
+
Used on [Scenarios](#scenarios) and [Language](#language).
|
|
18784
19452
|
|
|
18785
19453
|
##### `Link`
|
|
18786
19454
|
|
|
18787
19455
|
[Typography](#typography-2) – A link in the size of its text; `external` opens it in a new tab with the
|
|
18788
19456
|
protective attributes set.
|
|
18789
19457
|
|
|
18790
|
-
Used on [Scenarios](#scenarios), [Theming](#theming), [Typography](#typography-2)
|
|
19458
|
+
Used on [Scenarios](#scenarios), [Theming](#theming), [Typography](#typography-2), [Menu](#menu) and [Drawer](#drawer).
|
|
18791
19459
|
|
|
18792
19460
|
##### `MeasureGlyph`
|
|
18793
19461
|
|
|
@@ -18802,7 +19470,7 @@ function MeasureGlyph({ ref, size, ...rest }: GlyphProps): import("react").JSX.E
|
|
|
18802
19470
|
|
|
18803
19471
|
[Menu](#menu) – A list of actions that opens under a button (also called a dropdown menu). Reach for it when a place has more actions than room for buttons, or for the actions of each row in a list.
|
|
18804
19472
|
|
|
18805
|
-
Used on [Scenarios](#scenarios), [UmrissProvider](#umrissprovider), [IconButton](#iconbutton), [Popover](#popover), [Menu](#menu) and [CommandPalette](#commandpalette).
|
|
19473
|
+
Used on [Scenarios](#scenarios), [UmrissProvider](#umrissprovider), [IconButton](#iconbutton), [Popover](#popover), [Menu](#menu), [Drawer](#drawer) and [CommandPalette](#commandpalette).
|
|
18806
19474
|
|
|
18807
19475
|
##### `MenuItem`
|
|
18808
19476
|
|
|
@@ -18871,6 +19539,17 @@ screen reader, an optional sentence below it, and the close cross.
|
|
|
18871
19539
|
|
|
18872
19540
|
Used on [Scenarios](#scenarios), [Sizes](#sizes), [Toast](#toast-1), [Modal](#modal) and [Drawer](#drawer).
|
|
18873
19541
|
|
|
19542
|
+
##### `MoreGlyph`
|
|
19543
|
+
|
|
19544
|
+
The "more" of a menu trigger: three dots. Each is a zero-length stroke, which
|
|
19545
|
+
a round cap draws as a dot.
|
|
19546
|
+
|
|
19547
|
+
```ts
|
|
19548
|
+
function MoreGlyph({ ref, size, ...rest }: GlyphProps): import("react").JSX.Element;
|
|
19549
|
+
```
|
|
19550
|
+
|
|
19551
|
+
Used on [IconButton](#iconbutton) and [Menu](#menu).
|
|
19552
|
+
|
|
18874
19553
|
##### `MultiSelect`
|
|
18875
19554
|
|
|
18876
19555
|
[MultiSelect](#multiselect) – Several values from a list (multi-select, tag picker): a project team, services to filter by. The chosen ones stand as chips in the field, with a view in the panel that shows only them.
|
|
@@ -18903,7 +19582,7 @@ Used on [Popover](#popover) and [CommandPalette](#commandpalette).
|
|
|
18903
19582
|
|
|
18904
19583
|
[ProgressBar](#progressbar) – A bar that shows how far a job has come, or that it runs while nobody knows how far (also called a progress indicator). Reach for it for imports, uploads and anything else that counts towards an end.
|
|
18905
19584
|
|
|
18906
|
-
Used on [Scenarios](#scenarios), [ProgressBar](#progressbar) and [Stepper](#stepper).
|
|
19585
|
+
Used on [Scenarios](#scenarios), [FileInput](#fileinput), [ProgressBar](#progressbar) and [Stepper](#stepper).
|
|
18907
19586
|
|
|
18908
19587
|
##### `RadioGroup`
|
|
18909
19588
|
|
|
@@ -18915,7 +19594,7 @@ Used on [Scenarios](#scenarios), [Sizes](#sizes) and [RadioGroup](#radiogroup).
|
|
|
18915
19594
|
|
|
18916
19595
|
[SegmentedControl](#segmentedcontrol) – One choice out of a few short possibilities, drawn as one control with a segment for each (segmented button, button toggle): a sunken track, the choice lifted out of it. As tall as a select, so it stands in a row of fields too.
|
|
18917
19596
|
|
|
18918
|
-
Used on [Sizes](#sizes) and [SegmentedControl](#segmentedcontrol).
|
|
19597
|
+
Used on [Scenarios](#scenarios), [Sizes](#sizes) and [SegmentedControl](#segmentedcontrol).
|
|
18919
19598
|
|
|
18920
19599
|
##### `Select`
|
|
18921
19600
|
|
|
@@ -18984,7 +19663,7 @@ Used on [Scenarios](#scenarios), [FileInput](#fileinput), [Tabs](#tabs) and [Ste
|
|
|
18984
19663
|
|
|
18985
19664
|
[Switch](#switch) – On or off, taking effect at once (toggle): paging at night, autoscaling, a feature for one service. A screen reader announces it as a switch, on or off.
|
|
18986
19665
|
|
|
18987
|
-
Used on [Scenarios](#scenarios), [Theming](#theming), [Sizes](#sizes), [Switch](#switch), [Toast](#toast-1), [Drawer](#drawer), [CommandPalette](#commandpalette) and [Accordion](#accordion).
|
|
19666
|
+
Used on [Scenarios](#scenarios), [Theming](#theming), [Sizes](#sizes), [FormField](#formfield), [Switch](#switch), [Toast](#toast-1), [Drawer](#drawer), [CommandPalette](#commandpalette) and [Accordion](#accordion).
|
|
18988
19667
|
|
|
18989
19668
|
##### `Tab`
|
|
18990
19669
|
|
|
@@ -19085,19 +19764,19 @@ Used on [UmrissProvider](#umrissprovider) and [Toast](#toast-1).
|
|
|
19085
19764
|
|
|
19086
19765
|
[VisuallyHidden](#visuallyhidden) – Text a screen reader announces but the eye does not see (also called screen-reader-only or sr-only). Reach for it when a visible label is clear from its surroundings but not on its own, and for a skip link.
|
|
19087
19766
|
|
|
19088
|
-
Used on [VisuallyHidden](#visuallyhidden).
|
|
19767
|
+
Used on [VisuallyHidden](#visuallyhidden) and [FileInput](#fileinput).
|
|
19089
19768
|
|
|
19090
19769
|
#### Hooks
|
|
19091
19770
|
|
|
19092
19771
|
##### `useCommandPaletteShortcut`
|
|
19093
19772
|
|
|
19094
|
-
Binds Cmd+K/Ctrl+K and "/" to the opening of a palette.
|
|
19773
|
+
Binds Cmd+K/Ctrl+K and "/" to the opening of a palette. To remap a key, call the same `onOpen` from your own listener.
|
|
19095
19774
|
|
|
19096
|
-
`onOpen` may be new on every render: the hook remembers the
|
|
19097
|
-
rather than unsubscribing and resubscribing the listener each time.
|
|
19775
|
+
`onOpen` and `options` may be new on every render: the hook remembers the
|
|
19776
|
+
current version rather than unsubscribing and resubscribing the listener each time.
|
|
19098
19777
|
|
|
19099
19778
|
```ts
|
|
19100
|
-
function useCommandPaletteShortcut(onOpen: () => void): void;
|
|
19779
|
+
function useCommandPaletteShortcut(onOpen: () => void, options?: CommandPaletteShortcutOptions): void;
|
|
19101
19780
|
```
|
|
19102
19781
|
|
|
19103
19782
|
Used on [CommandPalette](#commandpalette).
|
|
@@ -19143,13 +19822,15 @@ function useDensityFor(own: "regular" | "compact" | undefined, fallback: "regula
|
|
|
19143
19822
|
|
|
19144
19823
|
##### `useFormats`
|
|
19145
19824
|
|
|
19146
|
-
Only the formatting.
|
|
19825
|
+
Only the formatting. Without a named zone, dates and times are empty until
|
|
19826
|
+
the page has hydrated. A named zone does not depend on the reader, so the
|
|
19827
|
+
server writes every instant with it.
|
|
19147
19828
|
|
|
19148
19829
|
```ts
|
|
19149
19830
|
function useFormats(): Formats;
|
|
19150
19831
|
```
|
|
19151
19832
|
|
|
19152
|
-
Used on [Language](#language), [NumberInput](#numberinput), [Slider](#slider), [DatePicker](#datepicker), [DateTimePicker](#datetimepicker), [DateRangePicker](#daterangepicker) and [DateTimeRangePicker](#datetimerangepicker).
|
|
19833
|
+
Used on [Scenarios](#scenarios), [Language](#language), [NumberInput](#numberinput), [Slider](#slider), [DatePicker](#datepicker), [DateTimePicker](#datetimepicker), [DateRangePicker](#daterangepicker) and [DateTimeRangePicker](#datetimerangepicker).
|
|
19153
19834
|
|
|
19154
19835
|
##### `useFormField`
|
|
19155
19836
|
|
|
@@ -19184,6 +19865,8 @@ Formatting and wording together; without a provider, the defaults.
|
|
|
19184
19865
|
const useLanguage: () => Language;
|
|
19185
19866
|
```
|
|
19186
19867
|
|
|
19868
|
+
Used on [Scenarios](#scenarios).
|
|
19869
|
+
|
|
19187
19870
|
##### `usePortalTarget`
|
|
19188
19871
|
|
|
19189
19872
|
Resolves the configured portal target.
|
|
@@ -19198,6 +19881,17 @@ would be invisible.
|
|
|
19198
19881
|
function usePortalTarget(): () => HTMLElement | null;
|
|
19199
19882
|
```
|
|
19200
19883
|
|
|
19884
|
+
##### `useTimeZoneLabel`
|
|
19885
|
+
|
|
19886
|
+
The name of the formats' time zone, for a view that shows instants: set when
|
|
19887
|
+
the formats name a zone, the page has hydrated, and the reader's own zone is
|
|
19888
|
+
another; `null` otherwise. The reader's zone is known only in the browser,
|
|
19889
|
+
so the server never writes it.
|
|
19890
|
+
|
|
19891
|
+
```ts
|
|
19892
|
+
function useTimeZoneLabel(): string | null;
|
|
19893
|
+
```
|
|
19894
|
+
|
|
19201
19895
|
##### `useToast`
|
|
19202
19896
|
|
|
19203
19897
|
Access to `toast()`, `update()` and `dismiss()`; requires a ToastProvider.
|
|
@@ -19314,7 +20008,7 @@ a surface is laid out, and a region is laid out nowhere.
|
|
|
19314
20008
|
function announce(text: string, at?: Element | null): void;
|
|
19315
20009
|
```
|
|
19316
20010
|
|
|
19317
|
-
Used on [VisuallyHidden](#visuallyhidden) and [CommandPalette](#commandpalette).
|
|
20011
|
+
Used on [VisuallyHidden](#visuallyhidden), [FormField](#formfield) and [CommandPalette](#commandpalette).
|
|
19318
20012
|
|
|
19319
20013
|
##### `assess`
|
|
19320
20014
|
|
|
@@ -19490,6 +20184,37 @@ object is `numberWith`.
|
|
|
19490
20184
|
function writeNumber(formats: Formats, n: number, format?: NumberFormat): string;
|
|
19491
20185
|
```
|
|
19492
20186
|
|
|
20187
|
+
##### `zoneDayStart`
|
|
20188
|
+
|
|
20189
|
+
The instant at which the zone's day containing `instant` begins; `undefined`
|
|
20190
|
+
is the reader's zone.
|
|
20191
|
+
|
|
20192
|
+
```ts
|
|
20193
|
+
function zoneDayStart(instant: Date | number, timeZone: string | undefined): Date;
|
|
20194
|
+
```
|
|
20195
|
+
|
|
20196
|
+
##### `zoneFields`
|
|
20197
|
+
|
|
20198
|
+
The wall-clock fields of an instant in a zone; `undefined` is the reader's.
|
|
20199
|
+
|
|
20200
|
+
```ts
|
|
20201
|
+
function zoneFields(instant: Date | number, timeZone: string | undefined): ZoneFields;
|
|
20202
|
+
```
|
|
20203
|
+
|
|
20204
|
+
Used on [Scenarios](#scenarios).
|
|
20205
|
+
|
|
20206
|
+
##### `zoneInstant`
|
|
20207
|
+
|
|
20208
|
+
The instant at which a zone's clock shows the given fields; `undefined` is
|
|
20209
|
+
the reader's zone. A time the clock skips moves forward, as the Date does,
|
|
20210
|
+
and a doubled one takes the earlier occurrence.
|
|
20211
|
+
|
|
20212
|
+
```ts
|
|
20213
|
+
function zoneInstant(clock: ZoneClock, timeZone: string | undefined): Date;
|
|
20214
|
+
```
|
|
20215
|
+
|
|
20216
|
+
Used on [Scenarios](#scenarios).
|
|
20217
|
+
|
|
19493
20218
|
#### Constants
|
|
19494
20219
|
|
|
19495
20220
|
##### `DEFAULT_FORMATS`
|
|
@@ -19668,6 +20393,14 @@ Used on [CommandPalette](#commandpalette).
|
|
|
19668
20393
|
|
|
19669
20394
|
Its table stands on [CommandPalette](#commandpalette).
|
|
19670
20395
|
|
|
20396
|
+
##### `CommandPaletteShortcutOptions`
|
|
20397
|
+
|
|
20398
|
+
Options of `useCommandPaletteShortcut`.
|
|
20399
|
+
|
|
20400
|
+
| Prop | Type | Default | Description |
|
|
20401
|
+
|---|---|---|---|
|
|
20402
|
+
| `slash` | `boolean` | `true` | Whether "/" opens the palette (WCAG 2.1.4: offer the user a way to turn a single-key shortcut off). Cmd+K / Ctrl+K is unaffected.<br>Shown in: [Open it with a shortcut (CommandPalette)](#commandpalette) |
|
|
20403
|
+
|
|
19671
20404
|
##### `ConfirmDialogProps`
|
|
19672
20405
|
|
|
19673
20406
|
Its table stands on [ConfirmDialog](#confirmdialog).
|
|
@@ -19788,11 +20521,15 @@ Everything the library knows about formatting.
|
|
|
19788
20521
|
|
|
19789
20522
|
| Prop | Type | Default | Description |
|
|
19790
20523
|
|---|---|---|---|
|
|
20524
|
+
| `locale` *required* | `string` | — | The language tag the set was built in: "en-GB". |
|
|
20525
|
+
| `timeZone` *required* | `string \| undefined` | — | The IANA name of the time zone instants are written in, or `undefined` for the reader's own.<br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
20526
|
+
| `timeZoneName` *required* | `(d: Date) => string` | — | The zone's generic name in the set's locale: "Central European Time". Empty until the page has hydrated where no zone is named. |
|
|
19791
20527
|
| `date` *required* | `(d: Date) => string` | — | Date as displayed: 17/03/2026<br>Shown in: [A span of days (DateRangePicker)](#daterangepicker) |
|
|
19792
20528
|
| `dateShort` *required* | `(d: Date) => string` | — | Short form without the year, in the range footer: 17/03 |
|
|
19793
20529
|
| `month` *required* | `(d: Date) => string` | — | The calendar's month header: March 2026 |
|
|
20530
|
+
| `monthName` *required* | `(d: Date) => string` | — | The month alone, in the calendar head's month list: March |
|
|
19794
20531
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
19795
|
-
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03 |
|
|
20532
|
+
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03<br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
19796
20533
|
| `dateTime` *required* | `(d: Date, withSeconds: boolean) => string` | — | Date and time together: 17/03/2026, 09:05<br>Shown in: [Use the language in your own components (Language)](#language), [Pick a day (DatePicker)](#datepicker), [Set an instant (DateTimePicker)](#datetimepicker) and 1 more |
|
|
19797
20534
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2<br>Shown in: [Set an instant (DateTimePicker)](#datetimepicker) |
|
|
19798
20535
|
| `number` *required* | `(n: number, decimals?: number) => string` | — | A number in the set's notation. Without a digit count the value stands to the tenth decimal place, and a non-zero value that would read 0 there is written in scientific notation; with one it is padded and rounded to exactly that many places.<br>Shown in: [Write numbers in your own notation (Language)](#language), [Price an invoice line (NumberInput)](#numberinput), [Split a budget (Slider)](#slider) |
|
|
@@ -19820,7 +20557,7 @@ Its table stands on [FormField](#formfield).
|
|
|
19820
20557
|
|
|
19821
20558
|
##### `Freshness`
|
|
19822
20559
|
|
|
19823
|
-
How
|
|
20560
|
+
How old a value is right now - independently of how it is judged and how far its source vouches for it.
|
|
19824
20561
|
|
|
19825
20562
|
```ts
|
|
19826
20563
|
type Freshness = "fresh" | "stale" | "lost";
|
|
@@ -19839,8 +20576,8 @@ harder statement still wins - the middle state simply falls away.
|
|
|
19839
20576
|
|
|
19840
20577
|
| Prop | Type | Default | Description |
|
|
19841
20578
|
|---|---|---|---|
|
|
19842
|
-
| `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict.<br>Shown in: [Show how fresh a value is (Stat)](#stat), [Watch the services that page at night (Stat)](#stat), [
|
|
19843
|
-
| `lost` *required* | `number` | — | From this age on the connection counts as disconnected.<br>Shown in: [Show how fresh a value is (Stat)](#stat), [Watch the services that page at night (Stat)](#stat), [
|
|
20579
|
+
| `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict.<br>Shown in: [Show how fresh a value is (Stat)](#stat), [Watch the services that page at night (Stat)](#stat), [Say how far the source vouches for a value (Stat)](#stat) and 1 more |
|
|
20580
|
+
| `lost` *required* | `number` | — | From this age on the connection counts as disconnected.<br>Shown in: [Show how fresh a value is (Stat)](#stat), [Watch the services that page at night (Stat)](#stat), [Say how far the source vouches for a value (Stat)](#stat) and 1 more |
|
|
19844
20581
|
|
|
19845
20582
|
Used on [Scenarios](#scenarios) and [Stat](#stat).
|
|
19846
20583
|
|
|
@@ -19870,7 +20607,7 @@ The props of a glyph: an SVG's attributes and its edge length.
|
|
|
19870
20607
|
| Prop | Type | Default | Description |
|
|
19871
20608
|
|---|---|---|---|
|
|
19872
20609
|
| `size` | `number` | `12` | Edge length in pixels. The default is the size the glyph is drawn at in the components. |
|
|
19873
|
-
| `ref` | `Ref<SVGSVGElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
20610
|
+
| `ref` | `Ref<SVGSVGElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
19874
20611
|
|
|
19875
20612
|
Also takes every attribute of `<svg>` – without `children`, `viewBox`.
|
|
19876
20613
|
|
|
@@ -19913,7 +20650,7 @@ A complete language: the formats for numbers and dates, and the wording.
|
|
|
19913
20650
|
|
|
19914
20651
|
| Prop | Type | Default | Description |
|
|
19915
20652
|
|---|---|---|---|
|
|
19916
|
-
| `formats` *required* | `Formats` | — |
|
|
20653
|
+
| `formats` *required* | `Formats` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
19917
20654
|
| `wording` *required* | `Wording` | — | |
|
|
19918
20655
|
|
|
19919
20656
|
Used on [Toast](#toast-1).
|
|
@@ -19931,8 +20668,8 @@ that differ from the default.
|
|
|
19931
20668
|
|
|
19932
20669
|
| Prop | Type | Default | Description |
|
|
19933
20670
|
|---|---|---|---|
|
|
19934
|
-
| `children` *required* | `ReactNode` | — | <br>Shown in: [German (Language)](#language), [English and German side by side (Language)](#language), [Replace single entries (Language)](#language) and
|
|
19935
|
-
| `formats` | `Partial<``Formats``>` | — | How numbers, dates and durations are written. Overridden entry by entry; what is left out keeps writing as `DEFAULT_FORMATS` does - in English notation, whatever the wording says ([ADR-0024](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0024-the-formats-are-english-german-is-freight.md)). From `LanguageOptions`.<br>Shown in: [Set up an application (UmrissProvider)](#umrissprovider), [German (Language)](#language), [English and German side by side (Language)](#language) and
|
|
20671
|
+
| `children` *required* | `ReactNode` | — | <br>Shown in: [German (Language)](#language), [English and German side by side (Language)](#language), [Replace single entries (Language)](#language) and 3 more |
|
|
20672
|
+
| `formats` | `Partial<``Formats``>` | — | How numbers, dates and durations are written. Overridden entry by entry; what is left out keeps writing as `DEFAULT_FORMATS` does - in English notation, whatever the wording says ([ADR-0024](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0024-the-formats-are-english-german-is-freight.md)). From `LanguageOptions`.<br>Shown in: [Set up an application (UmrissProvider)](#umrissprovider), [German (Language)](#language), [English and German side by side (Language)](#language) and 3 more |
|
|
19936
20673
|
| `wording` | `Partial<Omit<``Wording``, "presets">> & { presets?: Partial<``Wording``["presets"]> }` | — | The presets are a register of their own and are likewise overridden entry by entry. From `LanguageOptions`.<br>Shown in: [Set up an application (UmrissProvider)](#umrissprovider), [German (Language)](#language), [English and German side by side (Language)](#language) and 2 more |
|
|
19937
20674
|
|
|
19938
20675
|
##### `Limit`
|
|
@@ -19945,9 +20682,9 @@ force a `null` on one edge in the one-sided case.
|
|
|
19945
20682
|
|
|
19946
20683
|
| Prop | Type | Default | Description |
|
|
19947
20684
|
|---|---|---|---|
|
|
19948
|
-
| `value` *required* | `number` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and
|
|
19949
|
-
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and
|
|
19950
|
-
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and
|
|
20685
|
+
| `value` *required* | `number` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and 13 more |
|
|
20686
|
+
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and 13 more |
|
|
20687
|
+
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and 13 more |
|
|
19951
20688
|
|
|
19952
20689
|
##### `LimitSet`
|
|
19953
20690
|
|
|
@@ -19958,7 +20695,7 @@ violated, and it is never the edge of a region.
|
|
|
19958
20695
|
|
|
19959
20696
|
| Prop | Type | Default | Description |
|
|
19960
20697
|
|---|---|---|---|
|
|
19961
|
-
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and
|
|
20698
|
+
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and 13 more |
|
|
19962
20699
|
| `target` | `number` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Measure against a target (Stat)](#stat) and 3 more |
|
|
19963
20700
|
|
|
19964
20701
|
Used on [Scenarios](#scenarios), [Language](#language), [Drawer](#drawer) and [Stat](#stat).
|
|
@@ -20123,6 +20860,17 @@ What the detector reads of a pointer event - a DOM or a React one fits.
|
|
|
20123
20860
|
|
|
20124
20861
|
Its table stands on [ProgressBar](#progressbar).
|
|
20125
20862
|
|
|
20863
|
+
##### `Quality`
|
|
20864
|
+
|
|
20865
|
+
How far a value's source vouches for it - independently of how the value is judged and how old it is.
|
|
20866
|
+
The levels are the severities of an OPC UA status code; mapping a code (or another protocol's quality) to a level is the application's.
|
|
20867
|
+
|
|
20868
|
+
```ts
|
|
20869
|
+
type Quality = "good" | "uncertain" | "bad";
|
|
20870
|
+
```
|
|
20871
|
+
|
|
20872
|
+
Used on [Scenarios](#scenarios).
|
|
20873
|
+
|
|
20126
20874
|
##### `RadioGroupProps`
|
|
20127
20875
|
|
|
20128
20876
|
Its table stands on [RadioGroup](#radiogroup).
|
|
@@ -20148,7 +20896,7 @@ The `ref` of a component: the element it renders at its root.
|
|
|
20148
20896
|
|
|
20149
20897
|
| Prop | Type | Default | Description |
|
|
20150
20898
|
|---|---|---|---|
|
|
20151
|
-
| `ref` | `Ref<E> \| undefined` | — | Receives the component's root element.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
20899
|
+
| `ref` | `Ref<E> \| undefined` | — | Receives the component's root element.<br>Shown in: [A row that holds still (Sizes)](#sizes), [Check an invoice on submit (FormField)](#formfield), [An anchored surface (Popover)](#popover) and 4 more |
|
|
20152
20900
|
|
|
20153
20901
|
##### `RowPlacement`
|
|
20154
20902
|
|
|
@@ -20614,6 +21362,9 @@ Everything the library puts out as text.
|
|
|
20614
21362
|
| `datePlaceholder` *required* | `string` | — | |
|
|
20615
21363
|
| `datePanel` *required* | `string` | — | Accessible name of the panel. Deliberately kept apart from the placeholder: whoever labels the field differently does not thereby rename the dialog. |
|
|
20616
21364
|
| `dateClear` *required* | `string` | — | |
|
|
21365
|
+
| `typeDate` *required* | `string` | — | The name of the DatePicker panel's typed field. |
|
|
21366
|
+
| `notADate` *required* | `string` | — | Announced when the typed text is no date. |
|
|
21367
|
+
| `dateOutOfRange` *required* | `(min: string \| null, max: string \| null) => string` | — | Announced when the typed date lies outside `min` and `max`; each bound is written in the formats in use, `null` where there is none. |
|
|
20617
21368
|
| `dateTimePlaceholder` *required* | `string` | — | |
|
|
20618
21369
|
| `dateTimePanel` *required* | `string` | — | |
|
|
20619
21370
|
| `dateTimeClear` *required* | `string` | — | |
|
|
@@ -20624,6 +21375,8 @@ Everything the library puts out as text.
|
|
|
20624
21375
|
| `dateTimeRangeClear` *required* | `string` | — | The clearing x of the range with time - kept apart from the range without, so that an application can call the two differently. |
|
|
20625
21376
|
| `previousMonth` *required* | `string` | — | |
|
|
20626
21377
|
| `nextMonth` *required* | `string` | — | |
|
|
21378
|
+
| `monthSelect` *required* | `string` | — | Name of the calendar head's month list. |
|
|
21379
|
+
| `yearSelect` *required* | `string` | — | Name of the calendar head's year list. |
|
|
20627
21380
|
| `quickSelect` *required* | `string` | — | Group name of the preset column. |
|
|
20628
21381
|
| `today` *required* | `string` | — | <br>Shown in: [Use the language in your own components (Language)](#language) |
|
|
20629
21382
|
| `now` *required* | `string` | — | |
|
|
@@ -20774,6 +21527,9 @@ Everything the library puts out as text.
|
|
|
20774
21527
|
| `freshnessFresh` *required* | `string` | — | The three freshness states. They are a DIFFERENT axis from the verdict: a stale value keeps its verdict ([ADR-0010](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0010-a-stale-value-keeps-its-verdict.md)). |
|
|
20775
21528
|
| `freshnessStale` *required* | `string` | — | |
|
|
20776
21529
|
| `freshnessDisconnected` *required* | `string` | — | |
|
|
21530
|
+
| `qualityGood` *required* | `string` | — | The three quality levels ([ADR-0077](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0077-a-bad-value-keeps-its-verdict.md)) - the THIRD axis, beside the verdict and the freshness: how far the value's source vouches for it. A bad value keeps its verdict and its age. |
|
|
21531
|
+
| `qualityUncertain` *required* | `string` | — | |
|
|
21532
|
+
| `qualityBad` *required* | `string` | — | |
|
|
20777
21533
|
| `asOfAgo` *required* | `(duration: string) => string` | — | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
20778
21534
|
| `close` *required* | `string` | — | |
|
|
20779
21535
|
| `closeToast` *required* | `string` | — | |
|
|
@@ -20889,6 +21645,36 @@ Everything the library puts out as text.
|
|
|
20889
21645
|
|
|
20890
21646
|
Used on [Language](#language).
|
|
20891
21647
|
|
|
21648
|
+
##### `ZoneClock`
|
|
21649
|
+
|
|
21650
|
+
The fields a wall clock shows. Time of day defaults to midnight; a field
|
|
21651
|
+
out of range carries over, as `new Date(y, m, d)` does.
|
|
21652
|
+
|
|
21653
|
+
| Prop | Type | Default | Description |
|
|
21654
|
+
|---|---|---|---|
|
|
21655
|
+
| `year` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21656
|
+
| `month` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21657
|
+
| `day` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21658
|
+
| `hours` | `number` | `0` | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21659
|
+
| `minutes` | `number` | `0` | |
|
|
21660
|
+
| `seconds` | `number` | `0` | |
|
|
21661
|
+
| `milliseconds` | `number` | `0` | |
|
|
21662
|
+
|
|
21663
|
+
##### `ZoneFields`
|
|
21664
|
+
|
|
21665
|
+
The wall-clock fields of an instant. `month` counts from 0 and `weekday`
|
|
21666
|
+
from Sunday = 0, as the Date's own getters do.
|
|
21667
|
+
|
|
21668
|
+
| Prop | Type | Default | Description |
|
|
21669
|
+
|---|---|---|---|
|
|
21670
|
+
| `year` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21671
|
+
| `month` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21672
|
+
| `day` *required* | `number` | — | <br>Shown in: [Watch a kiln line over a shift (Scenarios)](#watch-a-kiln-line-over-a-shift) |
|
|
21673
|
+
| `hours` *required* | `number` | — | |
|
|
21674
|
+
| `minutes` *required* | `number` | — | |
|
|
21675
|
+
| `seconds` *required* | `number` | — | |
|
|
21676
|
+
| `weekday` *required* | `number` | — | |
|
|
21677
|
+
|
|
20892
21678
|
#### @umriss-ui/core/wording/de
|
|
20893
21679
|
|
|
20894
21680
|
##### `GERMAN_FORMATS`
|