@umriss-ui/core 0.43.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 +52 -0
- package/README.md +49 -11
- package/dist/core.css +1 -1
- package/dist/core.js +4593 -4139
- package/dist/de.d.ts +42 -0
- package/dist/formats-Bo0qM01D.js +97 -0
- package/dist/index.d.ts +197 -51
- package/dist/wording/de.js +18 -2
- package/docs/llms-full.md +1238 -303
- 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
|
<>
|
|
@@ -2501,6 +2543,141 @@ export default function TraceABatch() {
|
|
|
2501
2543
|
}
|
|
2502
2544
|
```
|
|
2503
2545
|
|
|
2546
|
+
### Mark a stretch of the shift
|
|
2547
|
+
|
|
2548
|
+
A line lead looks at the kiln's trend over the shift, marks the stretch where it ran hot, and the table below shows the alarms of that stretch.
|
|
2549
|
+
|
|
2550
|
+
1. A drag over the trend marks a stretch, and so do Space, a walk with the arrow keys and Space again once the trend has focus. The chart reports the stretch once, when the reader lets go.
|
|
2551
|
+
2. The table shows only the alarms raised inside the stretch, both ends included.
|
|
2552
|
+
3. The count says how many of the shift's alarms the stretch holds and from when to when.
|
|
2553
|
+
4. Clear the stretch brings every alarm back. The chart and the table know nothing of each other: the stretch is one value in this scenario's state, and the band in the trend is drawn from it.
|
|
2554
|
+
|
|
2555
|
+
Built from: Line, LimitBand, Table.
|
|
2556
|
+
|
|
2557
|
+
```tsx
|
|
2558
|
+
import { useState } from "react";
|
|
2559
|
+
import { Badge, Button, Card, CardBody, CardHeader, Stack, Text } from "@umriss-ui/core";
|
|
2560
|
+
import { LimitBand, LimitLine, Tooltip, useChart } from "@umriss-ui/charts";
|
|
2561
|
+
import type { ChartRange } from "@umriss-ui/charts";
|
|
2562
|
+
import { rowFilter, useTable } from "@umriss-ui/table";
|
|
2563
|
+
|
|
2564
|
+
/* Data from the plant world, written out here so the example runs on its own. */
|
|
2565
|
+
|
|
2566
|
+
/** The early shift begins at 06:00 on a day of its own, so the page is the same on every run. */
|
|
2567
|
+
const START = new Date(2026, 2, 17, 6, 0).getTime();
|
|
2568
|
+
const MIN = 60_000;
|
|
2569
|
+
const at = (minute: number) => START + minute * MIN;
|
|
2570
|
+
const SHIFT_MINUTES = 480;
|
|
2571
|
+
|
|
2572
|
+
/** One alarm of the shift. */
|
|
2573
|
+
export interface Alarm {
|
|
2574
|
+
id: string;
|
|
2575
|
+
/** The instant it was raised, in milliseconds. */
|
|
2576
|
+
raised: number;
|
|
2577
|
+
priority: "high" | "medium" | "low";
|
|
2578
|
+
message: string;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
const ALARMS: readonly Alarm[] = [
|
|
2582
|
+
{ id: "a-1", raised: at(12), priority: "low", message: "Dryer D1 · fan vibration high" },
|
|
2583
|
+
{ id: "a-2", raised: at(48), priority: "medium", message: "Kiln K1 · belt empty" },
|
|
2584
|
+
{ id: "a-3", raised: at(95), priority: "medium", message: "Kiln K1 · exit pyrometer sends nothing" },
|
|
2585
|
+
{ id: "a-4", raised: at(150), priority: "high", message: "Kiln K1 · zone 3 above alarm limit" },
|
|
2586
|
+
{ id: "a-5", raised: at(172), priority: "medium", message: "Kiln K1 · belt empty" },
|
|
2587
|
+
{ id: "a-6", raised: at(205), priority: "low", message: "Dryer D1 · fan vibration high" },
|
|
2588
|
+
{ id: "a-7", raised: at(250), priority: "high", message: "Kiln K1 · zone 3 above alarm limit" },
|
|
2589
|
+
{ id: "a-8", raised: at(288), priority: "medium", message: "Kiln K1 · exit pyrometer sends nothing" },
|
|
2590
|
+
{ id: "a-9", raised: at(340), priority: "low", message: "Dryer D1 · fan vibration high" },
|
|
2591
|
+
{ id: "a-10", raised: at(401), priority: "medium", message: "Kiln K1 · belt empty" },
|
|
2592
|
+
{ id: "a-11", raised: at(455), priority: "high", message: "Kiln K1 · zone 3 above alarm limit" },
|
|
2593
|
+
];
|
|
2594
|
+
|
|
2595
|
+
/** Zone 3 of the kiln every five minutes, in °C; it runs hot around the high alarms of the shift. */
|
|
2596
|
+
const TREND = Array.from({ length: SHIFT_MINUTES / 5 + 1 }, (_, i) => {
|
|
2597
|
+
const near = ALARMS.some((alarm) => alarm.priority === "high" && Math.abs(alarm.raised - at(i * 5)) <= 15 * MIN);
|
|
2598
|
+
return { t: at(i * 5), kiln: Math.round((1200 + 6 * Math.sin(i / 3) + (near ? 24 : 0)) * 10) / 10 };
|
|
2599
|
+
});
|
|
2600
|
+
|
|
2601
|
+
/** A stretch of the shift, in milliseconds. */
|
|
2602
|
+
export type Stretch = Pick<ChartRange<number>, "from" | "to">;
|
|
2603
|
+
|
|
2604
|
+
/** Whether the instant lies in the stretch; both ends belong to it. */
|
|
2605
|
+
export function within(instant: number, stretch: Stretch): boolean {
|
|
2606
|
+
return stretch.from <= instant && instant <= stretch.to;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
/** The alarms the stretch holds; no stretch holds them all. */
|
|
2610
|
+
export function alarmsIn(alarms: readonly Alarm[], stretch: Stretch | null): readonly Alarm[] {
|
|
2611
|
+
return stretch === null ? alarms : alarms.filter((alarm) => within(alarm.raised, stretch));
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
/* A condition from outside the table: the table keeps the stretch like a
|
|
2615
|
+
filter of its own and shows only the rows it admits. */
|
|
2616
|
+
const IN_STRETCH = rowFilter<Alarm, Stretch>({
|
|
2617
|
+
id: "stretch",
|
|
2618
|
+
label: "Stretch",
|
|
2619
|
+
matches: (alarm, stretch) => within(alarm.raised, stretch),
|
|
2620
|
+
});
|
|
2621
|
+
|
|
2622
|
+
const clock = (instant: number) => new Date(instant).toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
2623
|
+
|
|
2624
|
+
export default function MarkAStretch() {
|
|
2625
|
+
const [stretch, setStretch] = useState<Stretch | null>(null);
|
|
2626
|
+
const t = useTable(ALARMS, { rowKey: (a) => a.id, rowFilters: [IN_STRETCH] });
|
|
2627
|
+
const { Table, Column } = t;
|
|
2628
|
+
|
|
2629
|
+
const mark = (next: Stretch | null) => {
|
|
2630
|
+
setStretch(next);
|
|
2631
|
+
t.setFilter(IN_STRETCH, next);
|
|
2632
|
+
};
|
|
2633
|
+
const trend = useChart(TREND, { onRange: ({ from, to }) => mark({ from, to }) });
|
|
2634
|
+
|
|
2635
|
+
return (
|
|
2636
|
+
<Stack gap={4}>
|
|
2637
|
+
<Stack direction="row" gap={4} align="center" wrap>
|
|
2638
|
+
<Text data-callout="3">
|
|
2639
|
+
{stretch === null
|
|
2640
|
+
? `All ${ALARMS.length} alarms of the shift`
|
|
2641
|
+
: `${alarmsIn(ALARMS, stretch).length} of ${ALARMS.length} alarms between ${clock(stretch.from)} and ${clock(stretch.to)}`}
|
|
2642
|
+
</Text>
|
|
2643
|
+
<Button size="sm" data-callout="4" disabled={stretch === null} onClick={() => mark(null)}>
|
|
2644
|
+
Clear the stretch
|
|
2645
|
+
</Button>
|
|
2646
|
+
</Stack>
|
|
2647
|
+
|
|
2648
|
+
<Card data-callout="1">
|
|
2649
|
+
<CardHeader title="Kiln trend" />
|
|
2650
|
+
<CardBody>
|
|
2651
|
+
<trend.Chart height={240} aria-label="Kiln K1, zone 3, over the shift">
|
|
2652
|
+
<trend.XAxis value="t" domain={[at(0), at(SHIFT_MINUTES)]} time />
|
|
2653
|
+
<trend.YAxis domain={[1180, 1250]} label="°C" />
|
|
2654
|
+
<LimitLine value={1215} severity="warning" label="Warning limit" />
|
|
2655
|
+
{stretch !== null && <LimitBand orientation="x" from={stretch.from} to={stretch.to} label="Stretch" />}
|
|
2656
|
+
<trend.Line value="kiln" name="Zone 3" format={(v) => `${v.toFixed(1)} °C`} />
|
|
2657
|
+
<Tooltip mode="x" />
|
|
2658
|
+
</trend.Chart>
|
|
2659
|
+
</CardBody>
|
|
2660
|
+
</Card>
|
|
2661
|
+
|
|
2662
|
+
<Card data-callout="2">
|
|
2663
|
+
<CardHeader title="Alarms" />
|
|
2664
|
+
<CardBody>
|
|
2665
|
+
<Table aria-label="Alarms of the early shift">
|
|
2666
|
+
<Column value="raised" label="Raised" numeric>
|
|
2667
|
+
{(raised) => clock(raised)}
|
|
2668
|
+
</Column>
|
|
2669
|
+
<Column value="priority" label="Priority">
|
|
2670
|
+
{(priority) => <Badge tone={priority === "high" ? "danger" : priority === "medium" ? "warning" : "neutral"}>{priority}</Badge>}
|
|
2671
|
+
</Column>
|
|
2672
|
+
<Column value="message" label="Alarm" rowHeader />
|
|
2673
|
+
</Table>
|
|
2674
|
+
</CardBody>
|
|
2675
|
+
</Card>
|
|
2676
|
+
</Stack>
|
|
2677
|
+
);
|
|
2678
|
+
}
|
|
2679
|
+
```
|
|
2680
|
+
|
|
2504
2681
|
## Getting started
|
|
2505
2682
|
|
|
2506
2683
|
What an application sets up once, before the first component.
|
|
@@ -2548,7 +2725,7 @@ From `ButtonProps` — the full table stands on [Button](#button).
|
|
|
2548
2725
|
- No font is loaded or bundled.
|
|
2549
2726
|
- Chrome 123, Firefox 120 and Safari 17.5 or newer; an older browser discards the tokens and shows the components unstyled.
|
|
2550
2727
|
|
|
2551
|
-
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).
|
|
2552
2729
|
|
|
2553
2730
|
### UmrissProvider
|
|
2554
2731
|
|
|
@@ -2759,7 +2936,7 @@ type ToastPosition = "top-start" | "top-center" | "top-end" | "bottom-start" | "
|
|
|
2759
2936
|
|
|
2760
2937
|
- No theme and no default variants for components: a component is configured by its own props.
|
|
2761
2938
|
|
|
2762
|
-
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).
|
|
2763
2940
|
|
|
2764
2941
|
## Customising
|
|
2765
2942
|
|
|
@@ -2995,6 +3172,7 @@ One look for every component. A soft glow would read as a second, shadowy border
|
|
|
2995
3172
|
| `--u-text-2xl` | `1.5rem` | same | — |
|
|
2996
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. |
|
|
2997
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. |
|
|
2998
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. |
|
|
2999
3177
|
| `--u-leading-tight` | `1.3` | same | — |
|
|
3000
3178
|
| `--u-leading-normal` | `1.5` | same | — |
|
|
@@ -3232,7 +3410,7 @@ From `BadgeProps` — the full table stands on [Badge](#badge).
|
|
|
3232
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.
|
|
3233
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`.
|
|
3234
3412
|
|
|
3235
|
-
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).
|
|
3236
3414
|
|
|
3237
3415
|
### Sizes
|
|
3238
3416
|
|
|
@@ -3650,7 +3828,7 @@ type ControlSize = "sm" | "md";
|
|
|
3650
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).
|
|
3651
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)`.
|
|
3652
3830
|
|
|
3653
|
-
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).
|
|
3654
3832
|
|
|
3655
3833
|
### Language
|
|
3656
3834
|
|
|
@@ -3964,6 +4142,9 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
3964
4142
|
| `datePlaceholder` | Select date | Datum wählen | — |
|
|
3965
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. |
|
|
3966
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. |
|
|
3967
4148
|
| `dateTimePlaceholder` | Select date and time | Datum und Zeit wählen | — |
|
|
3968
4149
|
| `dateTimePanel` | Select date and time | Datum und Zeit wählen | — |
|
|
3969
4150
|
| `dateTimeClear` | Clear date and time | Datum und Zeit leeren | — |
|
|
@@ -3974,6 +4155,8 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
3974
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. |
|
|
3975
4156
|
| `previousMonth` | Previous month | Voriger Monat | — |
|
|
3976
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. |
|
|
3977
4160
|
| `quickSelect` | Quick select | Schnellwahl | Group name of the preset column. |
|
|
3978
4161
|
| `today` | Today | Heute | — |
|
|
3979
4162
|
| `now` | Now | Jetzt | — |
|
|
@@ -4050,7 +4233,10 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4050
4233
|
| `unpinHint` | Unpin | Fixierung lösen | — |
|
|
4051
4234
|
| `exportLabel` | Export | Exportieren | The export button. |
|
|
4052
4235
|
| `exportPageLabel` | Export page | Seite exportieren | The export button of a table in server mode, which holds and writes one page. |
|
|
4236
|
+
| `exporting` | Preparing the export | Export wird vorbereitet | The status while the application prepares an export of every match. |
|
|
4237
|
+
| `exportFailed` | The export failed | Der Export ist fehlgeschlagen | The alert beside the export button when preparing the export failed without a message. |
|
|
4053
4238
|
| `exportFileName` | table.csv | tabelle.csv | The export's file name, where the application names none. |
|
|
4239
|
+
| `exportSheetName` | Table | Tabelle | The name of the sheet an XLSX export holds. |
|
|
4054
4240
|
| `tableSearchPlaceholder` | Search … | Suchen … | Placeholder and accessible name of the search field. |
|
|
4055
4241
|
| `tableSearchLabel` | Search table | Tabelle durchsuchen | — |
|
|
4056
4242
|
| `filterColumn(column)` | `` `Filter ${column}` `` | `` `${column} filtern` `` | The filter button of a column: "Filter Region". |
|
|
@@ -4098,10 +4284,14 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4098
4284
|
| `levelColumn` | Level | Ebene | The first column of a tree's export. |
|
|
4099
4285
|
| `pathRow` | on the path to a match | auf dem Weg zu einem Treffer | A row shown only because a descendant matches the search or a filter. |
|
|
4100
4286
|
| `footerTopLevel` | Top level only | Nur oberste Ebene | The footer of a tree: it sums the top level, since a parent holds its children. |
|
|
4287
|
+
| `footerOfMatches` | All matches | Alle Treffer | The footer of a server-mode table: its sums come from the server and cover every match, not the page. Read out only. |
|
|
4101
4288
|
| `selectGroup(name)` | `` `Select ${name}` `` | `` `${name} auswählen` `` | The box that selects every row of a group. |
|
|
4102
4289
|
| `calendarWeek(week, year)` | `` `Week ${week}, ${year}` `` | `` `KW ${week}/${year}` `` | A group of the week key: "Week 42, 2026". |
|
|
4103
4290
|
| `entries(count, formatted)` | `` (count === 1 ? "1 entry" : `${formatted} entries`) `` | `` (count === 1 ? "1 Eintrag" : `${formatted} Einträge`) `` | "128 entries" in the pagination bar; the plural belongs to the language. |
|
|
4104
4291
|
| `selectedCount(count, formatted)` | `` `${formatted} selected` `` | `` `${formatted} ausgewählt` `` | "3 selected" in the pagination bar and the table toolbar. |
|
|
4292
|
+
| `selectedOnPage(count, formatted)` | `` `All ${formatted} on this page are selected.` `` | `` (count === 1 ? "Die 1 Zeile dieser Seite ist ausgewählt." : `Alle ${formatted} Zeilen dieser Seite sind ausgewählt.`) `` | The first sentence of the offer in a server-mode table, once the page is ticked: "All 50 on this page are selected." |
|
|
4293
|
+
| `selectAllMatching(count, formatted)` | `` `Select all ${formatted} that match` `` | `` `Alle ${formatted} Treffer auswählen` `` | The button after it, for the rows the server holds: "Select all 12,400 that match". |
|
|
4294
|
+
| `allMatchingSelected(count, formatted)` | `` `All ${formatted} that match are selected.` `` | `` `Alle ${formatted} Treffer sind ausgewählt.` `` | The line once they are selected: "All 12,400 that match are selected." |
|
|
4105
4295
|
| `copiedRows(count, formatted)` | `` (count === 1 ? "1 row copied" : `${formatted} rows copied`) `` | `` (count === 1 ? "1 Zeile kopiert" : `${formatted} Zeilen kopiert`) `` | Said to a screen reader after Ctrl+C copied rows: "3 rows copied". |
|
|
4106
4296
|
| `copiedCell` | Cell copied | Zelle kopiert | Said after Ctrl+C copied the active cell of a grid. |
|
|
4107
4297
|
| `copyFailed` | Could not copy | Kopieren nicht möglich | Said when the clipboard refused or is not there. |
|
|
@@ -4120,6 +4310,7 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4120
4310
|
| `rangeTo(to)` | `` `to ${to}` `` | `` `bis ${to}` `` | — |
|
|
4121
4311
|
| `rangeInvalid` | “From” lies after “To”. | „Von“ liegt hinter „Bis“. | When "From" lies behind "To". The condition stays the last valid one. |
|
|
4122
4312
|
| `resetAll` | Reset | Zurücksetzen | Clears search and conditions - in the table toolbar and in the empty body. |
|
|
4313
|
+
| `tryAgain` | Try again | Erneut versuchen | The button under a server-mode table's error that sends the request once more. |
|
|
4123
4314
|
| `filteredOfTotal(matches, total)` | `` `${matches} of ${total}` `` | `` `${matches} von ${total}` `` | "43 of 1.204" - the numbers come from the formats. |
|
|
4124
4315
|
|
|
4125
4316
|
##### Stat, verdict, freshness
|
|
@@ -4138,6 +4329,9 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
|
|
|
4138
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)). |
|
|
4139
4330
|
| `freshnessStale` | Stale | Veraltet | — |
|
|
4140
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 | — |
|
|
4141
4335
|
| `asOfAgo(duration)` | `` `As of: ${duration}` `` | `` `Stand: ${duration}` `` | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
4142
4336
|
|
|
4143
4337
|
##### Overlays and states
|
|
@@ -4294,6 +4488,9 @@ Every entry of `ChartsWording` from `@umriss-ui/charts`, which a chart takes thr
|
|
|
4294
4488
|
| `percent(value)` | `` `${value}%` `` | `` `${value} %` `` | A share in a normalised stack, its number already formatted. |
|
|
4295
4489
|
| `walkHelp` | Left and right arrows move through the values, up and down change the series, Home and End go to the first and the last, Escape clears. | Pfeil links und rechts gehen durch die Werte, Pfeil hoch und runter wechseln die Serie, Pos1 und Ende springen zum ersten und letzten Wert, Escape hebt die Markierung auf. | The keys that walk the chart. |
|
|
4296
4490
|
| `selectHelp` | Enter chooses the point. | Enter wählt den Punkt. | The key that reports the Active point - only where `onSelect` is given. |
|
|
4491
|
+
| `rangeStarted(from)` | `` `Range from ${from} started.` `` | `` `Bereich ab ${from} begonnen.` `` | Said when the keyboard sets the start of a range; the x value is written in the axis' format. |
|
|
4492
|
+
| `rangeMade(from, to)` | `` `Range from ${from} to ${to}.` `` | `` `Bereich von ${from} bis ${to}.` `` | Said when the keyboard sets the end of a range. |
|
|
4493
|
+
| `rangeHelp` | Space sets the start and the end of a range, Escape cancels it. | Leertaste setzt Anfang und Ende eines Bereichs, Escape bricht ab. | The key that marks a range - only where `onRange` is given and a tooltip stands. |
|
|
4297
4494
|
| `zoomHelp` | Plus and minus zoom, Shift with left or right pans, 0 goes back to the axis' own span. | Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 kehrt zum eigenen Bereich der Achse zurück. | The keys that zoom and pan it - only where the chart can be zoomed. |
|
|
4298
4495
|
| `legendHelp` | In the legend, Enter hides or shows a series, Shift+Enter shows only it. | In der Legende blendet Enter eine Serie aus oder ein, Umschalt+Enter zeigt nur sie. | The keys of the legend's entries - only where it has one to press. |
|
|
4299
4496
|
| `allShown` | Nothing would be left to see, so every series is shown. | Sonst wäre nichts mehr zu sehen, darum werden alle Serien gezeigt. | Read out where hiding would leave nothing to see, and every series is shown instead. |
|
|
@@ -4321,9 +4518,13 @@ Every entry of `Formats`: `DEFAULT_FORMATS` beside `GERMAN_FORMATS`. Each set as
|
|
|
4321
4518
|
|
|
4322
4519
|
| Key | English | German | Description |
|
|
4323
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. |
|
|
4324
4524
|
| `date(d)` | 17/03/2026 | 17.03.2026 | Date as displayed: 17/03/2026 |
|
|
4325
4525
|
| `dateShort(d)` | 17/03 | 17.03. | Short form without the year, in the range footer: 17/03 |
|
|
4326
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 |
|
|
4327
4528
|
| `dateLong(d)` | Tuesday, 17 March 2026 | Dienstag, 17. März 2026 | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
4328
4529
|
| `time(d, withSeconds)` | 09:05 | 09:05 | Time of day, optionally with seconds: 09:05 or 09:05:03 |
|
|
4329
4530
|
| `dateTime(d, withSeconds)` | 17/03/2026, 09:05 | 17.03.2026, 09:05 | Date and time together: 17/03/2026, 09:05 |
|
|
@@ -4349,7 +4550,7 @@ The keys of [Button](#button), [NumberInput](#numberinput), [Combobox](#combobox
|
|
|
4349
4550
|
|
|
4350
4551
|
| Prop | Type | Default | Description |
|
|
4351
4552
|
|---|---|---|---|
|
|
4352
|
-
| `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 |
|
|
4353
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 |
|
|
4354
4555
|
|
|
4355
4556
|
##### Types on this page
|
|
@@ -4360,11 +4561,15 @@ Everything the library knows about formatting.
|
|
|
4360
4561
|
|
|
4361
4562
|
| Prop | Type | Default | Description |
|
|
4362
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. |
|
|
4363
4567
|
| `date` *required* | `(d: Date) => string` | — | Date as displayed: 17/03/2026<br>Shown in: [A span of days (DateRangePicker)](#daterangepicker) |
|
|
4364
4568
|
| `dateShort` *required* | `(d: Date) => string` | — | Short form without the year, in the range footer: 17/03 |
|
|
4365
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 |
|
|
4366
4571
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
4367
|
-
| `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) |
|
|
4368
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 |
|
|
4369
4574
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2<br>Shown in: [Set an instant (DateTimePicker)](#datetimepicker) |
|
|
4370
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) |
|
|
@@ -4418,6 +4623,9 @@ Everything the library puts out as text.
|
|
|
4418
4623
|
| `datePlaceholder` *required* | `string` | — | |
|
|
4419
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. |
|
|
4420
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. |
|
|
4421
4629
|
| `dateTimePlaceholder` *required* | `string` | — | |
|
|
4422
4630
|
| `dateTimePanel` *required* | `string` | — | |
|
|
4423
4631
|
| `dateTimeClear` *required* | `string` | — | |
|
|
@@ -4428,6 +4636,8 @@ Everything the library puts out as text.
|
|
|
4428
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. |
|
|
4429
4637
|
| `previousMonth` *required* | `string` | — | |
|
|
4430
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. |
|
|
4431
4641
|
| `quickSelect` *required* | `string` | — | Group name of the preset column. |
|
|
4432
4642
|
| `today` *required* | `string` | — | <br>Shown in: [Use the language in your own components](#language) |
|
|
4433
4643
|
| `now` *required* | `string` | — | |
|
|
@@ -4487,7 +4697,10 @@ Everything the library puts out as text.
|
|
|
4487
4697
|
| `unpinHint` *required* | `string` | — | |
|
|
4488
4698
|
| `exportLabel` *required* | `string` | — | The export button. |
|
|
4489
4699
|
| `exportPageLabel` *required* | `string` | — | The export button of a table in server mode, which holds and writes one page. |
|
|
4700
|
+
| `exporting` *required* | `string` | — | The status while the application prepares an export of every match. |
|
|
4701
|
+
| `exportFailed` *required* | `string` | — | The alert beside the export button when preparing the export failed without a message. |
|
|
4490
4702
|
| `exportFileName` *required* | `string` | — | The export's file name, where the application names none. |
|
|
4703
|
+
| `exportSheetName` *required* | `string` | — | The name of the sheet an XLSX export holds. |
|
|
4491
4704
|
| `tableSearchPlaceholder` *required* | `string` | — | Placeholder and accessible name of the search field. |
|
|
4492
4705
|
| `tableSearchLabel` *required* | `string` | — | |
|
|
4493
4706
|
| `filterColumn` *required* | `(column: string) => string` | — | The filter button of a column: "Filter Region". |
|
|
@@ -4535,10 +4748,14 @@ Everything the library puts out as text.
|
|
|
4535
4748
|
| `levelColumn` *required* | `string` | — | The first column of a tree's export. |
|
|
4536
4749
|
| `pathRow` *required* | `string` | — | A row shown only because a descendant matches the search or a filter. |
|
|
4537
4750
|
| `footerTopLevel` *required* | `string` | — | The footer of a tree: it sums the top level, since a parent holds its children. |
|
|
4751
|
+
| `footerOfMatches` *required* | `string` | — | The footer of a server-mode table: its sums come from the server and cover every match, not the page. Read out only. |
|
|
4538
4752
|
| `selectGroup` *required* | `(name: string) => string` | — | The box that selects every row of a group. |
|
|
4539
4753
|
| `calendarWeek` *required* | `(week: number, year: number) => string` | — | A group of the week key: "Week 42, 2026". |
|
|
4540
4754
|
| `entries` *required* | `(count: number, formatted: string) => string` | — | "128 entries" in the pagination bar; the plural belongs to the language. |
|
|
4541
4755
|
| `selectedCount` *required* | `(count: number, formatted: string) => string` | — | "3 selected" in the pagination bar and the table toolbar. |
|
|
4756
|
+
| `selectedOnPage` *required* | `(count: number, formatted: string) => string` | — | The first sentence of the offer in a server-mode table, once the page is ticked: "All 50 on this page are selected." |
|
|
4757
|
+
| `selectAllMatching` *required* | `(count: number, formatted: string) => string` | — | The button after it, for the rows the server holds: "Select all 12,400 that match". |
|
|
4758
|
+
| `allMatchingSelected` *required* | `(count: number, formatted: string) => string` | — | The line once they are selected: "All 12,400 that match are selected." |
|
|
4542
4759
|
| `copiedRows` *required* | `(count: number, formatted: string) => string` | — | Said to a screen reader after Ctrl+C copied rows: "3 rows copied". |
|
|
4543
4760
|
| `copiedCell` *required* | `string` | — | Said after Ctrl+C copied the active cell of a grid. |
|
|
4544
4761
|
| `copyFailed` *required* | `string` | — | Said when the clipboard refused or is not there. |
|
|
@@ -4557,6 +4774,7 @@ Everything the library puts out as text.
|
|
|
4557
4774
|
| `rangeTo` *required* | `(to: string) => string` | — | |
|
|
4558
4775
|
| `rangeInvalid` *required* | `string` | — | When "From" lies behind "To". The condition stays the last valid one. |
|
|
4559
4776
|
| `resetAll` *required* | `string` | — | Clears search and conditions - in the table toolbar and in the empty body. |
|
|
4777
|
+
| `tryAgain` *required* | `string` | — | The button under a server-mode table's error that sends the request once more. |
|
|
4560
4778
|
| `filteredOfTotal` *required* | `(matches: string, total: string) => string` | — | "43 of 1.204" - the numbers come from the formats. |
|
|
4561
4779
|
| `verdictOk` *required* | `string` | — | The four outcomes of an assessment, as a word beside the value. Colour alone carries no meaning - the word stands here for that reason.<br>Shown in: [Replace single entries](#language) |
|
|
4562
4780
|
| `verdictWarning` *required* | `string` | — | <br>Shown in: [Replace single entries](#language) |
|
|
@@ -4570,6 +4788,9 @@ Everything the library puts out as text.
|
|
|
4570
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)). |
|
|
4571
4789
|
| `freshnessStale` *required* | `string` | — | |
|
|
4572
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` | — | |
|
|
4573
4794
|
| `asOfAgo` *required* | `(duration: string) => string` | — | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
4574
4795
|
| `close` *required* | `string` | — | |
|
|
4575
4796
|
| `closeToast` *required* | `string` | — | |
|
|
@@ -4685,10 +4906,10 @@ Everything the library puts out as text.
|
|
|
4685
4906
|
|
|
4686
4907
|
#### Known limits
|
|
4687
4908
|
|
|
4688
|
-
- 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)).
|
|
4689
4910
|
- It holds only what the components say themselves; your labels, titles and data are yours to translate.
|
|
4690
4911
|
|
|
4691
|
-
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).
|
|
4692
4913
|
|
|
4693
4914
|
## Layout
|
|
4694
4915
|
|
|
@@ -4990,12 +5211,12 @@ The keys of [Button](#button) apply here.
|
|
|
4990
5211
|
|
|
4991
5212
|
| Prop | Type | Default | Description |
|
|
4992
5213
|
|---|---|---|---|
|
|
4993
|
-
| `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
|
|
4994
|
-
| `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
|
|
4995
|
-
| `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 |
|
|
4996
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 |
|
|
4997
|
-
| `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
|
|
4998
|
-
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#sizes), [
|
|
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 |
|
|
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 |
|
|
4999
5220
|
|
|
5000
5221
|
Also takes every attribute of `<div>`.
|
|
5001
5222
|
|
|
@@ -5004,9 +5225,9 @@ Also takes every attribute of `<div>`.
|
|
|
5004
5225
|
| Prop | Type | Default | Description |
|
|
5005
5226
|
|---|---|---|---|
|
|
5006
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 |
|
|
5007
|
-
| `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
|
|
5008
|
-
| `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
|
|
5009
|
-
| `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 |
|
|
5010
5231
|
|
|
5011
5232
|
Also takes every attribute of `<div>`.
|
|
5012
5233
|
|
|
@@ -5035,7 +5256,7 @@ type GridColumnWidth = number | "fill";
|
|
|
5035
5256
|
- No breakpoints and no responsive props: a grid follows the width through `minItemWidth`, anything else is your stylesheet's.
|
|
5036
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)).
|
|
5037
5258
|
|
|
5038
|
-
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).
|
|
5039
5260
|
|
|
5040
5261
|
### Divider
|
|
5041
5262
|
|
|
@@ -5137,7 +5358,7 @@ The keys of [Button](#button) apply here.
|
|
|
5137
5358
|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Horizontally it separates rows, vertically it separates columns.<br>Shown in: [Configurator](#divider), [Upright in a bar](#divider) |
|
|
5138
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) |
|
|
5139
5360
|
| `label` | `ReactNode` | — | A label in the middle. It makes the line a named separator.<br>Shown in: [Configurator](#divider), [Strength and label](#divider) |
|
|
5140
|
-
| `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 |
|
|
5141
5362
|
|
|
5142
5363
|
Also takes every attribute of `<div>`.
|
|
5143
5364
|
|
|
@@ -5407,7 +5628,7 @@ The keys of [Button](#button) apply here.
|
|
|
5407
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) |
|
|
5408
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) |
|
|
5409
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) |
|
|
5410
|
-
| `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 |
|
|
5411
5632
|
|
|
5412
5633
|
Also takes every attribute of the rendered element.
|
|
5413
5634
|
|
|
@@ -5415,11 +5636,11 @@ Also takes every attribute of the rendered element.
|
|
|
5415
5636
|
|
|
5416
5637
|
| Prop | Type | Default | Description |
|
|
5417
5638
|
|---|---|---|---|
|
|
5418
|
-
| `title` *required* | `ReactNode` | — | The heading of the card. A node and not merely text, so that an identifier with markup can stand in it too.<br>Shown in: [Head and body](#card), [Eyebrow and actions](#card), [A flush body](#card) and
|
|
5639
|
+
| `title` *required* | `ReactNode` | — | The heading of the card. A node and not merely text, so that an identifier with markup can stand in it too.<br>Shown in: [Head and body](#card), [Eyebrow and actions](#card), [A flush body](#card) and 29 more |
|
|
5419
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 |
|
|
5420
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 |
|
|
5421
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) |
|
|
5422
|
-
| `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 |
|
|
5423
5644
|
|
|
5424
5645
|
Also takes every attribute of `<div>` – without `title`.
|
|
5425
5646
|
|
|
@@ -5428,7 +5649,7 @@ Also takes every attribute of `<div>` – without `title`.
|
|
|
5428
5649
|
| Prop | Type | Default | Description |
|
|
5429
5650
|
|---|---|---|---|
|
|
5430
5651
|
| `flush` | `boolean` | `false` | Removes the inner padding, e.g. for flush tables.<br>Shown in: [A flush body](#card) |
|
|
5431
|
-
| `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 |
|
|
5432
5653
|
|
|
5433
5654
|
Also takes every attribute of `<div>`.
|
|
5434
5655
|
|
|
@@ -5845,7 +6066,7 @@ export default function ThreePanes() {
|
|
|
5845
6066
|
| `step` | `number` | `5` | How far an arrow key moves the separator, in per cent.<br>Shown in: [Keep the share](#splitter) |
|
|
5846
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) |
|
|
5847
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 |
|
|
5848
|
-
| `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 |
|
|
5849
6070
|
|
|
5850
6071
|
###### Events
|
|
5851
6072
|
|
|
@@ -5860,7 +6081,7 @@ Also takes every attribute of `<div>` – without `children`, `defaultValue`, `o
|
|
|
5860
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)).
|
|
5861
6082
|
- It does not remember the share beyond its own life; keep it in the user's settings through `value` and `onChange`.
|
|
5862
6083
|
|
|
5863
|
-
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).
|
|
5864
6085
|
|
|
5865
6086
|
## Typography
|
|
5866
6087
|
|
|
@@ -6217,14 +6438,14 @@ export default function IncidentSummary() {
|
|
|
6217
6438
|
|
|
6218
6439
|
| Prop | Type | Default | Description |
|
|
6219
6440
|
|---|---|---|---|
|
|
6220
|
-
| `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
|
|
6221
|
-
| `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
|
|
6222
|
-
| `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
|
|
6223
|
-
| `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
|
|
6224
|
-
| `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 |
|
|
6225
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) |
|
|
6226
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) |
|
|
6227
|
-
| `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 |
|
|
6228
6449
|
|
|
6229
6450
|
Also takes every attribute of the rendered element.
|
|
6230
6451
|
|
|
@@ -6236,7 +6457,7 @@ Also takes every attribute of the rendered element.
|
|
|
6236
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 |
|
|
6237
6458
|
| `weight` | `TextWeight`<br>`"regular" \| "medium" \| "semibold"` | `"semibold"` | Font weight from the token set.<br>Shown in: [Tones and weights](#typography-2) |
|
|
6238
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) |
|
|
6239
|
-
| `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 |
|
|
6240
6461
|
|
|
6241
6462
|
Also takes every attribute of the heading.
|
|
6242
6463
|
|
|
@@ -6246,7 +6467,7 @@ Also takes every attribute of the heading.
|
|
|
6246
6467
|
|---|---|---|---|
|
|
6247
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) |
|
|
6248
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) |
|
|
6249
|
-
| `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 |
|
|
6250
6471
|
|
|
6251
6472
|
Also takes every attribute of `<a>`.
|
|
6252
6473
|
|
|
@@ -6296,10 +6517,10 @@ type TextLeading = "normal" | "tight";
|
|
|
6296
6517
|
#### Known limits
|
|
6297
6518
|
|
|
6298
6519
|
- No truncation and no line length: both depend on the column, which only the application knows.
|
|
6299
|
-
- 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)).
|
|
6300
6521
|
- `Link` renders a plain `a` and knows no router; pass it the address your router resolves.
|
|
6301
6522
|
|
|
6302
|
-
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).
|
|
6303
6524
|
|
|
6304
6525
|
### VisuallyHidden
|
|
6305
6526
|
|
|
@@ -6415,7 +6636,7 @@ export default function ActionsInRows() {
|
|
|
6415
6636
|
|---|---|---|---|
|
|
6416
6637
|
| `as` | `E` | `"span"` | Element to render as.<br>Shown in: [Add a skip link](#visuallyhidden) |
|
|
6417
6638
|
| `focusable` | `boolean` | `false` | Becomes visible as soon as the content receives the focus (skip link).<br>Shown in: [Add a skip link](#visuallyhidden) |
|
|
6418
|
-
| `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 |
|
|
6419
6640
|
|
|
6420
6641
|
Also takes every attribute of the chosen element – without `as`, `ref`.
|
|
6421
6642
|
|
|
@@ -6423,7 +6644,7 @@ Also takes every attribute of the chosen element – without `as`, `ref`.
|
|
|
6423
6644
|
|
|
6424
6645
|
- It hides from the eye only; to hide something from everyone, do not render it.
|
|
6425
6646
|
|
|
6426
|
-
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).
|
|
6427
6648
|
|
|
6428
6649
|
## Actions
|
|
6429
6650
|
|
|
@@ -6709,10 +6930,10 @@ Under forced colours every variant keeps an outline where its edge would lie, an
|
|
|
6709
6930
|
|
|
6710
6931
|
| Prop | Type | Default | Description |
|
|
6711
6932
|
|---|---|---|---|
|
|
6712
|
-
| `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
|
|
6713
|
-
| `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 |
|
|
6714
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 |
|
|
6715
|
-
| `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 |
|
|
6716
6937
|
|
|
6717
6938
|
Also takes every attribute of `<button>`.
|
|
6718
6939
|
|
|
@@ -6752,7 +6973,7 @@ type ControlSize = "sm" | "md";
|
|
|
6752
6973
|
- The label stays on one line; keep it short rather than let it wrap.
|
|
6753
6974
|
- No icon slot: an icon goes among the children, before the label, and the button sets its size.
|
|
6754
6975
|
|
|
6755
|
-
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).
|
|
6756
6977
|
|
|
6757
6978
|
### IconButton
|
|
6758
6979
|
|
|
@@ -6975,7 +7196,7 @@ Plain buttons for the bar, a group for the pair that belongs together, a menu fo
|
|
|
6975
7196
|
|
|
6976
7197
|
```tsx
|
|
6977
7198
|
import { useState } from "react";
|
|
6978
|
-
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";
|
|
6979
7200
|
|
|
6980
7201
|
const ZOOM = [50, 75, 100, 150, 200];
|
|
6981
7202
|
|
|
@@ -7025,7 +7246,7 @@ export default function Toolbar() {
|
|
|
7025
7246
|
align="end"
|
|
7026
7247
|
trigger={
|
|
7027
7248
|
<IconButton size="sm" aria-label="More actions for the tours">
|
|
7028
|
-
|
|
7249
|
+
<MoreGlyph />
|
|
7029
7250
|
</IconButton>
|
|
7030
7251
|
}
|
|
7031
7252
|
>
|
|
@@ -7059,17 +7280,17 @@ export default function Toolbar() {
|
|
|
7059
7280
|
|
|
7060
7281
|
| Prop | Type | Default | Description |
|
|
7061
7282
|
|---|---|---|---|
|
|
7062
|
-
| `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 |
|
|
7063
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 |
|
|
7064
|
-
| `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 |
|
|
7065
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 |
|
|
7066
|
-
| `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 |
|
|
7067
7288
|
|
|
7068
7289
|
###### Accessibility
|
|
7069
7290
|
|
|
7070
7291
|
| Prop | Type | Default | Description |
|
|
7071
7292
|
|---|---|---|---|
|
|
7072
|
-
| `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 |
|
|
7073
7294
|
|
|
7074
7295
|
Also takes every attribute of `<button>`.
|
|
7075
7296
|
|
|
@@ -7109,7 +7330,7 @@ type ControlSize = "sm" | "md";
|
|
|
7109
7330
|
- The tooltip always shows the name; a hint that says more than the name is a `Tooltip` around a `Button`.
|
|
7110
7331
|
- A touch screen shows no tooltip: choose icons whose meaning is common, or a `Button` with a label.
|
|
7111
7332
|
|
|
7112
|
-
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).
|
|
7113
7334
|
|
|
7114
7335
|
### ButtonGroup
|
|
7115
7336
|
|
|
@@ -7403,7 +7624,7 @@ export default function InvoiceToolbar() {
|
|
|
7403
7624
|
| Prop | Type | Default | Description |
|
|
7404
7625
|
|---|---|---|---|
|
|
7405
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) |
|
|
7406
|
-
| `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 |
|
|
7407
7628
|
|
|
7408
7629
|
###### Accessibility
|
|
7409
7630
|
|
|
@@ -7424,7 +7645,7 @@ Also takes every attribute of `<div>`.
|
|
|
7424
7645
|
| `menuLabel` | `string` | the wording's "More actions" | Label of the trigger. |
|
|
7425
7646
|
| `align` | `"start" \| "end"` | `"end"` | Alignment of the menu relative to the trigger.<br>Shown in: [Offer variants of the main action](#buttongroup) |
|
|
7426
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 |
|
|
7427
|
-
| `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 |
|
|
7428
7649
|
|
|
7429
7650
|
###### Events
|
|
7430
7651
|
|
|
@@ -7469,7 +7690,7 @@ type ControlSize = "sm" | "md";
|
|
|
7469
7690
|
|
|
7470
7691
|
- No toggle or segmented state; a choice that stays is a radio group.
|
|
7471
7692
|
|
|
7472
|
-
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).
|
|
7473
7694
|
|
|
7474
7695
|
## Forms
|
|
7475
7696
|
|
|
@@ -7714,6 +7935,42 @@ export default function TakeADeliveryAddress() {
|
|
|
7714
7935
|
}
|
|
7715
7936
|
```
|
|
7716
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
|
+
|
|
7717
7974
|
#### When to use something else
|
|
7718
7975
|
|
|
7719
7976
|
- A figure that is calculated with, with a unit and a range → NumberInput
|
|
@@ -7738,7 +7995,7 @@ export default function TakeADeliveryAddress() {
|
|
|
7738
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) |
|
|
7739
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 |
|
|
7740
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) |
|
|
7741
|
-
| `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 |
|
|
7742
7999
|
|
|
7743
8000
|
###### Events
|
|
7744
8001
|
|
|
@@ -7753,7 +8010,7 @@ Also takes every attribute of `<input>` – without `size`.
|
|
|
7753
8010
|
- No input masks or formatting while typing; check the value on leave or on submit.
|
|
7754
8011
|
- No validation of its own: the error is the application's, handed to the `FormField`.
|
|
7755
8012
|
|
|
7756
|
-
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).
|
|
7757
8014
|
|
|
7758
8015
|
### FormField
|
|
7759
8016
|
|
|
@@ -7842,16 +8099,16 @@ export default function MarkAFieldAsRequired() {
|
|
|
7842
8099
|
|
|
7843
8100
|
##### Check an invoice on submit
|
|
7844
8101
|
|
|
7845
|
-
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.
|
|
7846
8103
|
|
|
7847
8104
|
```tsx
|
|
7848
|
-
import { useState } from "react";
|
|
8105
|
+
import { useRef, useState } from "react";
|
|
7849
8106
|
import type { FormEvent } from "react";
|
|
7850
|
-
import { Button, DatePicker, FormField, Grid, Input, NumberInput,
|
|
8107
|
+
import { Button, Combobox, DatePicker, FormField, Grid, Input, NumberInput, Stack, Text, announce } from "@umriss-ui/core";
|
|
7851
8108
|
|
|
7852
8109
|
interface Invoice {
|
|
7853
8110
|
number: string;
|
|
7854
|
-
centre: string;
|
|
8111
|
+
centre: string | null;
|
|
7855
8112
|
amount: number | null;
|
|
7856
8113
|
due: Date | null;
|
|
7857
8114
|
}
|
|
@@ -7861,16 +8118,30 @@ type Errors = Partial<Record<keyof Invoice, string>>;
|
|
|
7861
8118
|
function check(invoice: Invoice): Errors {
|
|
7862
8119
|
const errors: Errors = {};
|
|
7863
8120
|
if (!/^INV-\d{4}$/.test(invoice.number)) errors.number = "An invoice number reads INV- and four digits.";
|
|
7864
|
-
if (invoice.centre ===
|
|
8121
|
+
if (invoice.centre === null) errors.centre = "Choose the cost centre the invoice is booked on.";
|
|
7865
8122
|
if (invoice.amount === null || invoice.amount <= 0) errors.amount = "Give the net amount.";
|
|
7866
8123
|
if (invoice.due === null) errors.due = "Give the due date from the invoice.";
|
|
7867
8124
|
return errors;
|
|
7868
8125
|
}
|
|
7869
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
|
+
|
|
7870
8135
|
export default function CheckAnInvoiceOnSubmit() {
|
|
7871
|
-
const [invoice, setInvoice] = useState<Invoice>({ number: "INV-31", centre:
|
|
8136
|
+
const [invoice, setInvoice] = useState<Invoice>({ number: "INV-31", centre: null, amount: 4860, due: null });
|
|
7872
8137
|
const [errors, setErrors] = useState<Errors>({});
|
|
7873
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();
|
|
7874
8145
|
const set = (patch: Partial<Invoice>) => setInvoice((previous) => ({ ...previous, ...patch }));
|
|
7875
8146
|
|
|
7876
8147
|
const submit = (event: FormEvent) => {
|
|
@@ -7878,30 +8149,52 @@ export default function CheckAnInvoiceOnSubmit() {
|
|
|
7878
8149
|
const next = check(invoice);
|
|
7879
8150
|
setErrors(next);
|
|
7880
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]!);
|
|
7881
8156
|
};
|
|
7882
8157
|
|
|
8158
|
+
const problems = KEYS.filter((key) => errors[key] !== undefined);
|
|
8159
|
+
|
|
7883
8160
|
return (
|
|
7884
8161
|
<form onSubmit={submit} noValidate style={{ maxWidth: 560 }}>
|
|
7885
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
|
+
)}
|
|
7886
8186
|
<Grid minItemWidth="220px" gap={4}>
|
|
7887
8187
|
<FormField label="Invoice number" required error={errors.number}>
|
|
7888
|
-
<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 })} />
|
|
7889
8189
|
</FormField>
|
|
7890
8190
|
<FormField label="Cost centre" required error={errors.centre}>
|
|
7891
|
-
<
|
|
7892
|
-
<option value="" disabled>
|
|
7893
|
-
Choose a cost centre
|
|
7894
|
-
</option>
|
|
7895
|
-
<option value="CC-1200">CC-1200 Marketing</option>
|
|
7896
|
-
<option value="CC-2200">CC-2200 Design</option>
|
|
7897
|
-
<option value="CC-4300">CC-4300 IT</option>
|
|
7898
|
-
</Select>
|
|
8191
|
+
<Combobox ref={centreRef} options={CENTRES} value={invoice.centre} onChange={(centre) => set({ centre })} placeholder="Choose a cost centre" />
|
|
7899
8192
|
</FormField>
|
|
7900
8193
|
<FormField label="Net amount" required error={errors.amount}>
|
|
7901
|
-
<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="€" />
|
|
7902
8195
|
</FormField>
|
|
7903
8196
|
<FormField label="Due" required error={errors.due}>
|
|
7904
|
-
<DatePicker value={invoice.due} onChange={(due) => set({ due })} clearable />
|
|
8197
|
+
<DatePicker ref={dueRef} value={invoice.due} onChange={(due) => set({ due })} clearable />
|
|
7905
8198
|
</FormField>
|
|
7906
8199
|
</Grid>
|
|
7907
8200
|
<Stack direction="row" gap={3} align="center">
|
|
@@ -7920,6 +8213,44 @@ export default function CheckAnInvoiceOnSubmit() {
|
|
|
7920
8213
|
}
|
|
7921
8214
|
```
|
|
7922
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
|
+
|
|
7923
8254
|
#### Keyboard
|
|
7924
8255
|
|
|
7925
8256
|
The keys of [Input](#input), [NumberInput](#numberinput), [Checkbox](#checkbox), [Select](#select), [DatePicker](#datepicker) and [Button](#button) apply here.
|
|
@@ -7930,12 +8261,13 @@ The keys of [Input](#input), [NumberInput](#numberinput), [Checkbox](#checkbox),
|
|
|
7930
8261
|
|
|
7931
8262
|
| Prop | Type | Default | Description |
|
|
7932
8263
|
|---|---|---|---|
|
|
7933
|
-
| `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
|
|
7934
|
-
| `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#formfield), [Label and hint](#formfield), [Show an error](#formfield) and
|
|
7935
|
-
| `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
|
|
7936
|
-
| `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 |
|
|
7937
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) |
|
|
7938
|
-
| `
|
|
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 |
|
|
7939
8271
|
|
|
7940
8272
|
Also takes every attribute of `<div>`.
|
|
7941
8273
|
|
|
@@ -7944,7 +8276,7 @@ Also takes every attribute of `<div>`.
|
|
|
7944
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.
|
|
7945
8277
|
- One field per `FormField`; a group of fields that share one label is a fieldset of your own.
|
|
7946
8278
|
|
|
7947
|
-
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).
|
|
7948
8280
|
|
|
7949
8281
|
### Textarea
|
|
7950
8282
|
|
|
@@ -8124,7 +8456,7 @@ With `showCount` the characters left stand in a polite live region: a screen rea
|
|
|
8124
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) |
|
|
8125
8457
|
| `showCount` | `boolean` | `false` | Shows at the bottom right how many characters still fit. Needs `maxLength`.<br>Shown in: [Count the characters](#textarea) |
|
|
8126
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) |
|
|
8127
|
-
| `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 |
|
|
8128
8460
|
|
|
8129
8461
|
Also takes every attribute of `<textarea>` – without `cols`.
|
|
8130
8462
|
|
|
@@ -8132,7 +8464,7 @@ Also takes every attribute of `<textarea>` – without `cols`.
|
|
|
8132
8464
|
|
|
8133
8465
|
- Plain text only: no formatting, mentions or rich text.
|
|
8134
8466
|
|
|
8135
|
-
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).
|
|
8136
8468
|
|
|
8137
8469
|
### NumberInput
|
|
8138
8470
|
|
|
@@ -8368,7 +8700,7 @@ export default function YearWithoutGrouping() {
|
|
|
8368
8700
|
|
|
8369
8701
|
| Prop | Type | Default | Description |
|
|
8370
8702
|
|---|---|---|---|
|
|
8371
|
-
| `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 |
|
|
8372
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 |
|
|
8373
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 |
|
|
8374
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 |
|
|
@@ -8379,13 +8711,13 @@ export default function YearWithoutGrouping() {
|
|
|
8379
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) |
|
|
8380
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) |
|
|
8381
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) |
|
|
8382
|
-
| `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 |
|
|
8383
8715
|
|
|
8384
8716
|
###### Events
|
|
8385
8717
|
|
|
8386
8718
|
| Prop | Type | Default | Description |
|
|
8387
8719
|
|---|---|---|---|
|
|
8388
|
-
| `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 |
|
|
8389
8721
|
|
|
8390
8722
|
Also takes every attribute of `<input>` – without `onChange`, `prefix`, `size`, `type`, `value`.
|
|
8391
8723
|
|
|
@@ -8394,7 +8726,7 @@ Also takes every attribute of `<input>` – without `onChange`, `prefix`, `size`
|
|
|
8394
8726
|
- No expressions: “12*4” is not calculated.
|
|
8395
8727
|
- No currency conversion; the unit is a label.
|
|
8396
8728
|
|
|
8397
|
-
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).
|
|
8398
8730
|
|
|
8399
8731
|
### Slider
|
|
8400
8732
|
|
|
@@ -8562,7 +8894,7 @@ export default function SplitABudget() {
|
|
|
8562
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 |
|
|
8563
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 |
|
|
8564
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 |
|
|
8565
|
-
| `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 |
|
|
8566
8898
|
|
|
8567
8899
|
###### Events
|
|
8568
8900
|
|
|
@@ -8587,7 +8919,7 @@ type SliderMark = number | { value: number; label?: ReactNode };
|
|
|
8587
8919
|
- One thumb: no range with two ends.
|
|
8588
8920
|
- Marks show values; they do not catch the thumb.
|
|
8589
8921
|
|
|
8590
|
-
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).
|
|
8591
8923
|
|
|
8592
8924
|
### Checkbox
|
|
8593
8925
|
|
|
@@ -8701,9 +9033,9 @@ export default function SelectAllWithAMixedState() {
|
|
|
8701
9033
|
|
|
8702
9034
|
| Prop | Type | Default | Description |
|
|
8703
9035
|
|---|---|---|---|
|
|
8704
|
-
| `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 |
|
|
8705
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) |
|
|
8706
|
-
| `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 |
|
|
8707
9039
|
|
|
8708
9040
|
Also takes every attribute of `<input>` – without `size`, `type`.
|
|
8709
9041
|
|
|
@@ -8904,10 +9236,10 @@ export default function SettingsOfAService() {
|
|
|
8904
9236
|
|
|
8905
9237
|
| Prop | Type | Default | Description |
|
|
8906
9238
|
|---|---|---|---|
|
|
8907
|
-
| `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 |
|
|
8908
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) |
|
|
8909
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) |
|
|
8910
|
-
| `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 |
|
|
8911
9243
|
|
|
8912
9244
|
Also takes every attribute of `<input>` – without `role`, `size`, `type`.
|
|
8913
9245
|
|
|
@@ -8915,7 +9247,7 @@ Also takes every attribute of `<input>` – without `role`, `size`, `type`.
|
|
|
8915
9247
|
|
|
8916
9248
|
- No pending or loading state; while your application applies the change, disable the switch or say so beside it.
|
|
8917
9249
|
|
|
8918
|
-
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).
|
|
8919
9251
|
|
|
8920
9252
|
### RadioGroup
|
|
8921
9253
|
|
|
@@ -9070,7 +9402,7 @@ export default function States() {
|
|
|
9070
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) |
|
|
9071
9403
|
| `disabled` | `boolean` | `false` | Disables the whole group. `RadioOption` disables single possibilities.<br>Shown in: [Configurator](#radiogroup), [States](#radiogroup) |
|
|
9072
9404
|
| `name` | `string` | a generated one | Name of the radio group within the form. |
|
|
9073
|
-
| `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 |
|
|
9074
9406
|
|
|
9075
9407
|
###### Events
|
|
9076
9408
|
|
|
@@ -9347,21 +9679,21 @@ export default function DrawnAsAField() {
|
|
|
9347
9679
|
|
|
9348
9680
|
| Prop | Type | Default | Description |
|
|
9349
9681
|
|---|---|---|---|
|
|
9350
|
-
| `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 |
|
|
9351
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 |
|
|
9352
|
-
| `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) |
|
|
9353
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) |
|
|
9354
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) |
|
|
9355
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) |
|
|
9356
9688
|
| `disabled` | `boolean` | `false` | Disables the whole control. `SegmentedOption` disables single possibilities.<br>Shown in: [Configurator](#segmentedcontrol), [States and sizes](#segmentedcontrol) |
|
|
9357
9689
|
| `name` | `string` | a generated one | Name of the radio group within the form. |
|
|
9358
|
-
| `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 |
|
|
9359
9691
|
|
|
9360
9692
|
###### Events
|
|
9361
9693
|
|
|
9362
9694
|
| Prop | Type | Default | Description |
|
|
9363
9695
|
|---|---|---|---|
|
|
9364
|
-
| `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) |
|
|
9365
9697
|
|
|
9366
9698
|
Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
9367
9699
|
|
|
@@ -9369,8 +9701,8 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9369
9701
|
|
|
9370
9702
|
| Prop | Type | Default | Description |
|
|
9371
9703
|
|---|---|---|---|
|
|
9372
|
-
| `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
|
|
9373
|
-
| `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 |
|
|
9374
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) |
|
|
9375
9707
|
| `disabled` | `boolean` | — | Takes the possibility out of the choice but leaves it visible.<br>Shown in: [States and sizes](#segmentedcontrol) |
|
|
9376
9708
|
|
|
@@ -9379,7 +9711,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
9379
9711
|
- Two to four short possibilities: a word that does not fit its place ends in an ellipsis.
|
|
9380
9712
|
- No icons and no line of explanation in a segment; several chosen at once is not this control.
|
|
9381
9713
|
|
|
9382
|
-
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).
|
|
9383
9715
|
|
|
9384
9716
|
### FileInput
|
|
9385
9717
|
|
|
@@ -9600,6 +9932,102 @@ export default function ImportBudgets() {
|
|
|
9600
9932
|
}
|
|
9601
9933
|
```
|
|
9602
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
|
+
|
|
9603
10031
|
#### Keyboard
|
|
9604
10032
|
|
|
9605
10033
|
| Key | Action |
|
|
@@ -9612,15 +10040,15 @@ export default function ImportBudgets() {
|
|
|
9612
10040
|
|
|
9613
10041
|
| Prop | Type | Default | Description |
|
|
9614
10042
|
|---|---|---|---|
|
|
9615
|
-
| `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 |
|
|
9616
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) |
|
|
9617
|
-
| `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 |
|
|
9618
10046
|
|
|
9619
10047
|
###### Events
|
|
9620
10048
|
|
|
9621
10049
|
| Prop | Type | Default | Description |
|
|
9622
10050
|
|---|---|---|---|
|
|
9623
|
-
| `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 |
|
|
9624
10052
|
|
|
9625
10053
|
Also takes every attribute of `<input>` – without `defaultValue`, `onChange`, `size`, `type`, `value`.
|
|
9626
10054
|
|
|
@@ -9628,7 +10056,7 @@ Also takes every attribute of `<input>` – without `defaultValue`, `onChange`,
|
|
|
9628
10056
|
|
|
9629
10057
|
- No upload, no progress and no size limit of its own; those belong to the application sending the files.
|
|
9630
10058
|
|
|
9631
|
-
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).
|
|
9632
10060
|
|
|
9633
10061
|
## Choosing
|
|
9634
10062
|
|
|
@@ -9810,7 +10238,7 @@ export default function ClearTheChoice() {
|
|
|
9810
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) |
|
|
9811
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) |
|
|
9812
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) |
|
|
9813
|
-
| `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 |
|
|
9814
10242
|
|
|
9815
10243
|
###### Events
|
|
9816
10244
|
|
|
@@ -9824,7 +10252,7 @@ Also takes every attribute of `<select>` – without `size`.
|
|
|
9824
10252
|
|
|
9825
10253
|
- The list shows the options' text: no icons, descriptions or search inside it - the Combobox searches.
|
|
9826
10254
|
|
|
9827
|
-
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).
|
|
9828
10256
|
|
|
9829
10257
|
### Combobox
|
|
9830
10258
|
|
|
@@ -10039,6 +10467,120 @@ export default function AssignAnIncident() {
|
|
|
10039
10467
|
}
|
|
10040
10468
|
```
|
|
10041
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
|
+
|
|
10042
10584
|
#### When to use something else
|
|
10043
10585
|
|
|
10044
10586
|
- A short list that needs no search, with the system's picker under a finger → Select
|
|
@@ -10049,6 +10591,7 @@ export default function AssignAnIncident() {
|
|
|
10049
10591
|
| Key | Action |
|
|
10050
10592
|
|---|---|
|
|
10051
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. |
|
|
10052
10595
|
| `Enter` | Chooses the active row. |
|
|
10053
10596
|
| `Escape` | Closes the list. |
|
|
10054
10597
|
|
|
@@ -10058,22 +10601,25 @@ export default function AssignAnIncident() {
|
|
|
10058
10601
|
|
|
10059
10602
|
| Prop | Type | Default | Description |
|
|
10060
10603
|
|---|---|---|---|
|
|
10061
|
-
| `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
|
|
10062
|
-
| `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
|
|
10063
|
-
| `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 |
|
|
10064
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) |
|
|
10065
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) |
|
|
10066
10609
|
| `disabled` | `boolean` | `false` | Locks field and panel.<br>Shown in: [Configurator](#combobox), [States](#combobox), [Dispatch a tour (Scenarios)](#dispatch-a-tour) |
|
|
10067
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) |
|
|
10068
10611
|
| `emptyText` | `string` | — | Text shown for an empty search result.<br>Shown in: [States](#combobox) |
|
|
10069
|
-
| `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
|
|
10070
|
-
| `
|
|
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 |
|
|
10071
10616
|
|
|
10072
10617
|
###### Events
|
|
10073
10618
|
|
|
10074
10619
|
| Prop | Type | Default | Description |
|
|
10075
10620
|
|---|---|---|---|
|
|
10076
|
-
| `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) |
|
|
10077
10623
|
|
|
10078
10624
|
Also takes every attribute of `<input>` – without `defaultValue`, `onChange`.
|
|
10079
10625
|
|
|
@@ -10088,9 +10634,9 @@ Also takes every attribute of `<input>` – without `defaultValue`, `onChange`.
|
|
|
10088
10634
|
#### Known limits
|
|
10089
10635
|
|
|
10090
10636
|
- No free text as a value: only an option can be chosen.
|
|
10091
|
-
- No
|
|
10637
|
+
- No request of its own: `onSearch` reports the typed text and you fetch, debounce and cancel; `filter={false}` shows what you return.
|
|
10092
10638
|
|
|
10093
|
-
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).
|
|
10094
10640
|
|
|
10095
10641
|
### MultiSelect
|
|
10096
10642
|
|
|
@@ -10314,6 +10860,36 @@ export default function FilterIncidentsByService() {
|
|
|
10314
10860
|
}
|
|
10315
10861
|
```
|
|
10316
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
|
+
|
|
10317
10893
|
#### When to use something else
|
|
10318
10894
|
|
|
10319
10895
|
- Exactly one value → Combobox
|
|
@@ -10336,23 +10912,23 @@ export default function FilterIncidentsByService() {
|
|
|
10336
10912
|
|
|
10337
10913
|
| Prop | Type | Default | Description |
|
|
10338
10914
|
|---|---|---|---|
|
|
10339
|
-
| `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
|
|
10340
|
-
| `value` *required* | `readonly T[]` | — | The chosen values. Always controlled.<br>Shown in: [Configurator](#multiselect), [Chips in the field](#multiselect), [States](#multiselect) and
|
|
10341
|
-
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Chips in the field](#multiselect), [States](#multiselect), [With an error](#multiselect) and
|
|
10342
|
-
| `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) |
|
|
10343
10919
|
| `emptyText` | `string` | — | Text when the search finds nothing.<br>Shown in: [States](#multiselect) |
|
|
10344
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) |
|
|
10345
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) |
|
|
10346
10922
|
| `disabled` | `boolean` | `false` | Locks field and panel.<br>Shown in: [Configurator](#multiselect), [States](#multiselect), [Dispatch a tour (Scenarios)](#dispatch-a-tour) |
|
|
10347
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) |
|
|
10348
|
-
| `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), [
|
|
10349
|
-
| `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 |
|
|
10350
10926
|
|
|
10351
10927
|
###### Events
|
|
10352
10928
|
|
|
10353
10929
|
| Prop | Type | Default | Description |
|
|
10354
10930
|
|---|---|---|---|
|
|
10355
|
-
| `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 |
|
|
10356
10932
|
|
|
10357
10933
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
10358
10934
|
|
|
@@ -10384,7 +10960,7 @@ The value contract of the four pickers stands here. `DatePicker` hands out a `Da
|
|
|
10384
10960
|
|
|
10385
10961
|
##### Pick a day
|
|
10386
10962
|
|
|
10387
|
-
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.
|
|
10388
10964
|
|
|
10389
10965
|
```tsx
|
|
10390
10966
|
import { useState } from "react";
|
|
@@ -10503,6 +11079,27 @@ export default function CheckADueDate() {
|
|
|
10503
11079
|
}
|
|
10504
11080
|
```
|
|
10505
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
|
+
|
|
10506
11103
|
#### When to use something else
|
|
10507
11104
|
|
|
10508
11105
|
- A day and a time of day → DateTimePicker
|
|
@@ -10523,20 +11120,22 @@ export default function CheckADueDate() {
|
|
|
10523
11120
|
|
|
10524
11121
|
| Prop | Type | Default | Description |
|
|
10525
11122
|
|---|---|---|---|
|
|
10526
|
-
| `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 |
|
|
10527
11124
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datepicker) |
|
|
10528
11125
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datepicker), [States](#datepicker) |
|
|
10529
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) |
|
|
10530
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) |
|
|
10531
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) |
|
|
10532
|
-
| `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
|
|
10533
|
-
| `
|
|
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 |
|
|
10534
11133
|
|
|
10535
11134
|
###### Events
|
|
10536
11135
|
|
|
10537
11136
|
| Prop | Type | Default | Description |
|
|
10538
11137
|
|---|---|---|---|
|
|
10539
|
-
| `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 |
|
|
10540
11139
|
|
|
10541
11140
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
10542
11141
|
|
|
@@ -10545,7 +11144,7 @@ Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
|
10545
11144
|
- No typing of a date into the field.
|
|
10546
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)).
|
|
10547
11146
|
|
|
10548
|
-
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).
|
|
10549
11148
|
|
|
10550
11149
|
### DateTimePicker
|
|
10551
11150
|
|
|
@@ -10692,15 +11291,17 @@ export default function WithAnError() {
|
|
|
10692
11291
|
|
|
10693
11292
|
| Prop | Type | Default | Description |
|
|
10694
11293
|
|---|---|---|---|
|
|
10695
|
-
| `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 |
|
|
10696
11295
|
| `withSeconds` | `boolean` | `false` | Show the seconds field.<br>Shown in: [Configurator](#datetimepicker), [With seconds](#datetimepicker) |
|
|
10697
11296
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datetimepicker) |
|
|
10698
11297
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datetimepicker), [States](#datetimepicker) |
|
|
10699
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) |
|
|
10700
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) |
|
|
10701
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) |
|
|
10702
|
-
| `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) |
|
|
10703
|
-
| `
|
|
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 |
|
|
10704
11305
|
|
|
10705
11306
|
###### Events
|
|
10706
11307
|
|
|
@@ -10714,7 +11315,7 @@ Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
|
10714
11315
|
|
|
10715
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)).
|
|
10716
11317
|
|
|
10717
|
-
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).
|
|
10718
11319
|
|
|
10719
11320
|
### DateRangePicker
|
|
10720
11321
|
|
|
@@ -10868,6 +11469,29 @@ export default function WithAnError() {
|
|
|
10868
11469
|
}
|
|
10869
11470
|
```
|
|
10870
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
|
+
|
|
10871
11495
|
#### When to use something else
|
|
10872
11496
|
|
|
10873
11497
|
- A span with times at both ends → DateTimeRangePicker
|
|
@@ -10887,21 +11511,23 @@ export default function WithAnError() {
|
|
|
10887
11511
|
|
|
10888
11512
|
| Prop | Type | Default | Description |
|
|
10889
11513
|
|---|---|---|---|
|
|
10890
|
-
| `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 |
|
|
10891
11515
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [Presets](#daterangepicker) |
|
|
10892
11516
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#daterangepicker), [States](#daterangepicker) |
|
|
10893
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) |
|
|
10894
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) |
|
|
10895
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) |
|
|
10896
|
-
| `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 |
|
|
10897
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) |
|
|
10898
|
-
| `
|
|
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 |
|
|
10899
11525
|
|
|
10900
11526
|
###### Events
|
|
10901
11527
|
|
|
10902
11528
|
| Prop | Type | Default | Description |
|
|
10903
11529
|
|---|---|---|---|
|
|
10904
|
-
| `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 |
|
|
10905
11531
|
|
|
10906
11532
|
Also takes every attribute of `<button>` – without `defaultValue`, `onChange`.
|
|
10907
11533
|
|
|
@@ -10932,7 +11558,7 @@ the moment of the click.
|
|
|
10932
11558
|
|
|
10933
11559
|
- One span; no list of separate days.
|
|
10934
11560
|
|
|
10935
|
-
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).
|
|
10936
11562
|
|
|
10937
11563
|
### DateTimeRangePicker
|
|
10938
11564
|
|
|
@@ -11099,16 +11725,18 @@ export default function WithAnError() {
|
|
|
11099
11725
|
|
|
11100
11726
|
| Prop | Type | Default | Description |
|
|
11101
11727
|
|---|---|---|---|
|
|
11102
|
-
| `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 |
|
|
11103
11729
|
| `withSeconds` | `boolean` | `false` | Show the seconds fields.<br>Shown in: [Configurator](#datetimerangepicker), [With seconds](#datetimerangepicker) |
|
|
11104
11730
|
| `placeholder` | `string` | — | What stands in the empty field.<br>Shown in: [States](#datetimerangepicker) |
|
|
11105
11731
|
| `disabled` | `boolean` | `false` | Locks the field and the panel.<br>Shown in: [Configurator](#datetimerangepicker), [States](#datetimerangepicker) |
|
|
11106
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) |
|
|
11107
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) |
|
|
11108
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) |
|
|
11109
|
-
| `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) |
|
|
11110
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) |
|
|
11111
|
-
| `
|
|
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 |
|
|
11112
11740
|
|
|
11113
11741
|
###### Events
|
|
11114
11742
|
|
|
@@ -11146,7 +11774,7 @@ the moment of the click.
|
|
|
11146
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)).
|
|
11147
11775
|
- No recurring windows.
|
|
11148
11776
|
|
|
11149
|
-
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).
|
|
11150
11778
|
|
|
11151
11779
|
## Feedback
|
|
11152
11780
|
|
|
@@ -11288,7 +11916,7 @@ With reduced motion it turns at less than half its speed instead of stopping, so
|
|
|
11288
11916
|
| Prop | Type | Default | Description |
|
|
11289
11917
|
|---|---|---|---|
|
|
11290
11918
|
| `size` | `number` | `14` | Edge length in pixels.<br>Shown in: [Sizes](#spinner), [Colour](#spinner) |
|
|
11291
|
-
| `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 |
|
|
11292
11920
|
|
|
11293
11921
|
Also takes every attribute of `<svg>`.
|
|
11294
11922
|
|
|
@@ -11296,7 +11924,7 @@ Also takes every attribute of `<svg>`.
|
|
|
11296
11924
|
|
|
11297
11925
|
- One shape and no figure: for how far a job has come, use a [ProgressBar](#progressbar).
|
|
11298
11926
|
|
|
11299
|
-
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).
|
|
11300
11928
|
|
|
11301
11929
|
### ProgressBar
|
|
11302
11930
|
|
|
@@ -11467,11 +12095,11 @@ Under forced colours the track takes an edge and the fill the system's selection
|
|
|
11467
12095
|
|
|
11468
12096
|
| Prop | Type | Default | Description |
|
|
11469
12097
|
|---|---|---|---|
|
|
11470
|
-
| `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
|
|
11471
|
-
| `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
|
|
11472
|
-
| `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 |
|
|
11473
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 |
|
|
11474
|
-
| `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 |
|
|
11475
12103
|
|
|
11476
12104
|
Also takes every attribute of `<div>`.
|
|
11477
12105
|
|
|
@@ -11479,7 +12107,7 @@ Also takes every attribute of `<div>`.
|
|
|
11479
12107
|
|
|
11480
12108
|
- No colour of verdict and no steps of its own; for a job in steps, stack one bar per step.
|
|
11481
12109
|
|
|
11482
|
-
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).
|
|
11483
12111
|
|
|
11484
12112
|
### Skeleton
|
|
11485
12113
|
|
|
@@ -11628,7 +12256,7 @@ With reduced motion the shimmer stops, and the shape stands in a still, faint gr
|
|
|
11628
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 |
|
|
11629
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) |
|
|
11630
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) |
|
|
11631
|
-
| `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 |
|
|
11632
12260
|
|
|
11633
12261
|
Also takes every attribute of `<span>`.
|
|
11634
12262
|
|
|
@@ -11636,7 +12264,7 @@ Also takes every attribute of `<span>`.
|
|
|
11636
12264
|
|
|
11637
12265
|
- It draws a shape and nothing else; the rows, cards and layout it stands in for are yours.
|
|
11638
12266
|
|
|
11639
|
-
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).
|
|
11640
12268
|
|
|
11641
12269
|
### Alert
|
|
11642
12270
|
|
|
@@ -11824,11 +12452,11 @@ The title is a paragraph, not a heading, so an alert does not enter the page's o
|
|
|
11824
12452
|
|
|
11825
12453
|
| Prop | Type | Default | Description |
|
|
11826
12454
|
|---|---|---|---|
|
|
11827
|
-
| `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
|
|
11828
|
-
| `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 |
|
|
11829
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) |
|
|
11830
12458
|
| `dismissLabel` | `string` | the wording's "Close message" | Label of the dismiss cross. |
|
|
11831
|
-
| `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 |
|
|
11832
12460
|
|
|
11833
12461
|
###### Events
|
|
11834
12462
|
|
|
@@ -11854,7 +12482,7 @@ type AlertTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
11854
12482
|
- No timer: an alert stays until you remove it. A message that goes by itself is a toast.
|
|
11855
12483
|
- No stack or queue of messages; place each alert where its matter is.
|
|
11856
12484
|
|
|
11857
|
-
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).
|
|
11858
12486
|
|
|
11859
12487
|
### Toast
|
|
11860
12488
|
|
|
@@ -12412,7 +13040,7 @@ type ToastCloseReason = "timeout" | "dismiss" | "action";
|
|
|
12412
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.
|
|
12413
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.
|
|
12414
13042
|
|
|
12415
|
-
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).
|
|
12416
13044
|
|
|
12417
13045
|
### EmptyState
|
|
12418
13046
|
|
|
@@ -12547,7 +13175,7 @@ The keys of [Button](#button) and [Tag](#tag) apply here.
|
|
|
12547
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 |
|
|
12548
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 |
|
|
12549
13177
|
| `icon` | `ReactNode` | — | Optional symbol above the title.<br>Shown in: [Mark good news in a panel](#emptystate) |
|
|
12550
|
-
| `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 |
|
|
12551
13179
|
|
|
12552
13180
|
Also takes every attribute of `<div>` – without `title`.
|
|
12553
13181
|
|
|
@@ -12720,7 +13348,7 @@ export default function ACalculation() {
|
|
|
12720
13348
|
- No interactive content and no rich layout inside: it is read, never used.
|
|
12721
13349
|
- No placement option: it stands above its element and flips below where there is no room.
|
|
12722
13350
|
|
|
12723
|
-
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).
|
|
12724
13352
|
|
|
12725
13353
|
### Popover
|
|
12726
13354
|
|
|
@@ -12953,7 +13581,6 @@ export default function ACardAtTheEdge() {
|
|
|
12953
13581
|
|---|---|---|---|
|
|
12954
13582
|
| `role` | `"dialog" \| "listbox" \| "menu" \| "tooltip"` | — | Role of the surface. Omit where an inner element carries it.<br>Shown in: [An anchored surface](#popover), [Take the width of the trigger](#popover), [Filter a list from a panel](#popover) and 1 more |
|
|
12955
13583
|
| `aria-label` | `string` | — | Accessible name of the surface. Needed as soon as it carries a `role`: a named role without a name is a riddle for a screen reader.<br>Shown in: [An anchored surface](#popover), [Take the width of the trigger](#popover), [Filter a list from a panel](#popover) and 1 more |
|
|
12956
|
-
| `ariaLabel` | `string` | — | *Deprecated* since 0.43 - use `aria-label`. The old spelling of `aria-label`; both work for one further minor. |
|
|
12957
13584
|
|
|
12958
13585
|
###### Styling
|
|
12959
13586
|
|
|
@@ -12976,7 +13603,7 @@ type Align = "start" | "end" | "center";
|
|
|
12976
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.
|
|
12977
13604
|
- It does not trap focus; a surface the user must answer is a [Modal](#modal).
|
|
12978
13605
|
|
|
12979
|
-
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).
|
|
12980
13607
|
|
|
12981
13608
|
### Menu
|
|
12982
13609
|
|
|
@@ -13068,7 +13695,7 @@ One menu per row keeps a list quiet; the trigger's name says which row it acts o
|
|
|
13068
13695
|
|
|
13069
13696
|
```tsx
|
|
13070
13697
|
import { useState } from "react";
|
|
13071
|
-
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";
|
|
13072
13699
|
|
|
13073
13700
|
interface Incident {
|
|
13074
13701
|
id: string;
|
|
@@ -13108,7 +13735,7 @@ export default function PerRow() {
|
|
|
13108
13735
|
align="end"
|
|
13109
13736
|
trigger={
|
|
13110
13737
|
<IconButton size="sm" aria-label={`Actions for ${incident.id}`}>
|
|
13111
|
-
|
|
13738
|
+
<MoreGlyph />
|
|
13112
13739
|
</IconButton>
|
|
13113
13740
|
}
|
|
13114
13741
|
>
|
|
@@ -13163,7 +13790,7 @@ export default function PerRow() {
|
|
|
13163
13790
|
| Prop | Type | Default | Description |
|
|
13164
13791
|
|---|---|---|---|
|
|
13165
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 |
|
|
13166
|
-
| `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 |
|
|
13167
13794
|
|
|
13168
13795
|
###### Events
|
|
13169
13796
|
|
|
@@ -13177,7 +13804,7 @@ Also takes every attribute of `<button>` – without `onSelect`.
|
|
|
13177
13804
|
|
|
13178
13805
|
- No submenus, no checkable entries and no type-ahead.
|
|
13179
13806
|
|
|
13180
|
-
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).
|
|
13181
13808
|
|
|
13182
13809
|
### ContextMenu
|
|
13183
13810
|
|
|
@@ -13368,7 +13995,6 @@ export default function OnARow() {
|
|
|
13368
13995
|
| Prop | Type | Default | Description |
|
|
13369
13996
|
|---|---|---|---|
|
|
13370
13997
|
| `aria-label` | `string` | — | Accessible name of the menu: what it acts on. A context menu has no trigger whose label could name it.<br>Shown in: [Open it at the pointer](#contextmenu), [Open it on a row, by pointer, finger or keyboard](#contextmenu) |
|
|
13371
|
-
| `ariaLabel` | `string` | — | *Deprecated* since 0.43 - use `aria-label`. The old spelling of `aria-label`; both work for one further minor. |
|
|
13372
13998
|
|
|
13373
13999
|
##### `ContextMenuTriggerProps`
|
|
13374
14000
|
|
|
@@ -13395,7 +14021,7 @@ export default function OnARow() {
|
|
|
13395
14021
|
- It listens to no right-click itself: the element and the point are yours, through the hook.
|
|
13396
14022
|
- No submenus, no checkable entries and no type-ahead, as in the menu.
|
|
13397
14023
|
|
|
13398
|
-
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).
|
|
13399
14025
|
|
|
13400
14026
|
### Modal
|
|
13401
14027
|
|
|
@@ -13668,6 +14294,39 @@ export default function MustBeAnswered() {
|
|
|
13668
14294
|
}
|
|
13669
14295
|
```
|
|
13670
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
|
+
|
|
13671
14330
|
#### When to use something else
|
|
13672
14331
|
|
|
13673
14332
|
- A detail beside the list the user came from → Drawer
|
|
@@ -13687,16 +14346,16 @@ export default function MustBeAnswered() {
|
|
|
13687
14346
|
|
|
13688
14347
|
| Prop | Type | Default | Description |
|
|
13689
14348
|
|---|---|---|---|
|
|
13690
|
-
| `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 |
|
|
13691
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 |
|
|
13692
14351
|
| `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop.<br>Shown in: [A window that must be answered](#modal) |
|
|
13693
|
-
| `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 |
|
|
13694
14353
|
|
|
13695
14354
|
###### Events
|
|
13696
14355
|
|
|
13697
14356
|
| Prop | Type | Default | Description |
|
|
13698
14357
|
|---|---|---|---|
|
|
13699
|
-
| `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 |
|
|
13700
14359
|
|
|
13701
14360
|
Also takes every attribute of `<dialog>` – without `onClose`.
|
|
13702
14361
|
|
|
@@ -13704,10 +14363,10 @@ Also takes every attribute of `<dialog>` – without `onClose`.
|
|
|
13704
14363
|
|
|
13705
14364
|
| Prop | Type | Default | Description |
|
|
13706
14365
|
|---|---|---|---|
|
|
13707
|
-
| `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 |
|
|
13708
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 |
|
|
13709
14368
|
| `hideClose` | `boolean` | `false` | Hides the close button.<br>Shown in: [A window that must be answered](#modal) |
|
|
13710
|
-
| `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 |
|
|
13711
14370
|
|
|
13712
14371
|
Also takes every attribute of `<div>` – without `title`.
|
|
13713
14372
|
|
|
@@ -13725,7 +14384,7 @@ type ModalSize = "sm" | "md" | "lg";
|
|
|
13725
14384
|
|
|
13726
14385
|
- No non-modal window and no dragging or resizing: a panel that leaves the page usable is layout – a [Splitter](#splitter).
|
|
13727
14386
|
|
|
13728
|
-
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).
|
|
13729
14388
|
|
|
13730
14389
|
### Drawer
|
|
13731
14390
|
|
|
@@ -14004,6 +14663,89 @@ export default function BesideAServiceList() {
|
|
|
14004
14663
|
}
|
|
14005
14664
|
```
|
|
14006
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
|
+
|
|
14007
14749
|
#### When to use something else
|
|
14008
14750
|
|
|
14009
14751
|
- A task that has nothing to do with what lies behind it → Modal
|
|
@@ -14022,16 +14764,16 @@ export default function BesideAServiceList() {
|
|
|
14022
14764
|
|
|
14023
14765
|
| Prop | Type | Default | Description |
|
|
14024
14766
|
|---|---|---|---|
|
|
14025
|
-
| `side` | `"right" \| "left"` | `"right"` | The edge the drawer stands at and enters from.<br>Shown in: [From the left, and wider](#drawer) |
|
|
14026
|
-
| `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 |
|
|
14027
14769
|
| `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop. From `ModalProps`.<br>Shown in: [A window that must be answered (Modal)](#modal) |
|
|
14028
|
-
| `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 |
|
|
14029
14771
|
|
|
14030
14772
|
###### Events
|
|
14031
14773
|
|
|
14032
14774
|
| Prop | Type | Default | Description |
|
|
14033
14775
|
|---|---|---|---|
|
|
14034
|
-
| `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 |
|
|
14035
14777
|
|
|
14036
14778
|
Also takes every attribute of `<dialog>` – without `onClose`.
|
|
14037
14779
|
|
|
@@ -14040,7 +14782,7 @@ Also takes every attribute of `<dialog>` – without `onClose`.
|
|
|
14040
14782
|
- Modal on purpose, with no non-modal mode: a panel beside a page the user keeps working in is layout, not an overlay.
|
|
14041
14783
|
- Only the left and right edges; nothing slides in from the top or bottom.
|
|
14042
14784
|
|
|
14043
|
-
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).
|
|
14044
14786
|
|
|
14045
14787
|
### ConfirmDialog
|
|
14046
14788
|
|
|
@@ -14202,7 +14944,7 @@ export default function WhileItRuns() {
|
|
|
14202
14944
|
| `cancelLabel` | `string` | the wording's "Cancel" | Label of the cancelling button.<br>Shown in: [Guard unsaved changes (Modal)](#modal) |
|
|
14203
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 |
|
|
14204
14946
|
| `loading` | `boolean` | `false` | Locks the actions while the confirmation is running.<br>Shown in: [Stay open while it runs](#confirmdialog) |
|
|
14205
|
-
| `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 |
|
|
14206
14948
|
|
|
14207
14949
|
###### Events
|
|
14208
14950
|
|
|
@@ -14217,7 +14959,7 @@ Also takes every attribute of `<dialog>` – without `children`, `onClose`, `ope
|
|
|
14217
14959
|
|
|
14218
14960
|
- A title, a description and two buttons, nothing more: fields belong in a [Modal](#modal).
|
|
14219
14961
|
|
|
14220
|
-
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).
|
|
14221
14963
|
|
|
14222
14964
|
### CommandPalette
|
|
14223
14965
|
|
|
@@ -14327,11 +15069,11 @@ export default function RecentFirst() {
|
|
|
14327
15069
|
|
|
14328
15070
|
##### Open it with a shortcut
|
|
14329
15071
|
|
|
14330
|
-
[`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).
|
|
14331
15073
|
|
|
14332
15074
|
```tsx
|
|
14333
15075
|
import { useCallback, useState } from "react";
|
|
14334
|
-
import { CommandPalette, Input, Stack, Text, useCommandPaletteShortcut } from "@umriss-ui/core";
|
|
15076
|
+
import { CommandPalette, Input, Stack, Switch, Text, useCommandPaletteShortcut } from "@umriss-ui/core";
|
|
14335
15077
|
|
|
14336
15078
|
const PROJECTS = [
|
|
14337
15079
|
{ id: "shop", label: "Online shop relaunch", group: "Pembury Home" },
|
|
@@ -14344,14 +15086,16 @@ export default function Shortcut() {
|
|
|
14344
15086
|
const [open, setOpen] = useState(false);
|
|
14345
15087
|
const [text, setText] = useState("");
|
|
14346
15088
|
const [project, setProject] = useState("-");
|
|
15089
|
+
const [slash, setSlash] = useState(true);
|
|
14347
15090
|
|
|
14348
|
-
useCommandPaletteShortcut(useCallback(() => setOpen(true), []));
|
|
15091
|
+
useCommandPaletteShortcut(useCallback(() => setOpen(true), []), { slash });
|
|
14349
15092
|
|
|
14350
15093
|
return (
|
|
14351
15094
|
<Stack gap={3} align="flex-start">
|
|
14352
15095
|
<Text size="sm" tone="secondary">
|
|
14353
15096
|
Press Cmd-K, Ctrl-K or “/” to jump to a project. Current: {project}
|
|
14354
15097
|
</Text>
|
|
15098
|
+
<Switch label="“/” opens the palette" checked={slash} onChange={(event) => setSlash(event.target.checked)} />
|
|
14355
15099
|
<Input
|
|
14356
15100
|
size="sm"
|
|
14357
15101
|
aria-label="Here a slash stays a slash"
|
|
@@ -14489,7 +15233,7 @@ export default function SearchHundredsOfPages() {
|
|
|
14489
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 |
|
|
14490
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) |
|
|
14491
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) |
|
|
14492
|
-
| `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 |
|
|
14493
15237
|
|
|
14494
15238
|
###### Events
|
|
14495
15239
|
|
|
@@ -14517,7 +15261,7 @@ Also takes every attribute of `<dialog>` – without `children`, `onClose`, `ope
|
|
|
14517
15261
|
- No memory of past choices and no ranking of its own beyond the match: recency and frequency are weights you keep.
|
|
14518
15262
|
- No nested steps or arguments: a command that needs input opens your own form after it is chosen.
|
|
14519
15263
|
|
|
14520
|
-
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).
|
|
14521
15265
|
|
|
14522
15266
|
## Navigation
|
|
14523
15267
|
|
|
@@ -14816,7 +15560,7 @@ export default function BrowseDownAndBackUp() {
|
|
|
14816
15560
|
| Prop | Type | Default | Description |
|
|
14817
15561
|
|---|---|---|---|
|
|
14818
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 |
|
|
14819
|
-
| `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 |
|
|
14820
15564
|
|
|
14821
15565
|
Also takes every attribute of the rendered element.
|
|
14822
15566
|
|
|
@@ -14837,7 +15581,7 @@ Also takes every attribute of the rendered element.
|
|
|
14837
15581
|
|
|
14838
15582
|
- It neither routes nor reads the address: the trail is what you pass.
|
|
14839
15583
|
|
|
14840
|
-
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).
|
|
14841
15585
|
|
|
14842
15586
|
### Tabs
|
|
14843
15587
|
|
|
@@ -15175,7 +15919,7 @@ export default function MoreTabsThanRoom() {
|
|
|
15175
15919
|
|---|---|---|---|
|
|
15176
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 |
|
|
15177
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) |
|
|
15178
|
-
| `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 |
|
|
15179
15923
|
|
|
15180
15924
|
###### Events
|
|
15181
15925
|
|
|
@@ -15190,7 +15934,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
15190
15934
|
| Prop | Type | Default | Description |
|
|
15191
15935
|
|---|---|---|---|
|
|
15192
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 |
|
|
15193
|
-
| `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 |
|
|
15194
15938
|
|
|
15195
15939
|
Also takes every attribute of `<button>`.
|
|
15196
15940
|
|
|
@@ -15199,7 +15943,7 @@ Also takes every attribute of `<button>`.
|
|
|
15199
15943
|
| Prop | Type | Default | Description |
|
|
15200
15944
|
|---|---|---|---|
|
|
15201
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 |
|
|
15202
|
-
| `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 |
|
|
15203
15947
|
|
|
15204
15948
|
Also takes every attribute of `<div>`.
|
|
15205
15949
|
|
|
@@ -15207,7 +15951,7 @@ Also takes every attribute of `<div>`.
|
|
|
15207
15951
|
|
|
15208
15952
|
- More tabs than fit scroll sideways within the list; there is no overflow menu, and no closing or reordering of tabs.
|
|
15209
15953
|
|
|
15210
|
-
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).
|
|
15211
15955
|
|
|
15212
15956
|
### Accordion
|
|
15213
15957
|
|
|
@@ -15431,7 +16175,7 @@ export default function LongSettingsInSections() {
|
|
|
15431
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) |
|
|
15432
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) |
|
|
15433
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) |
|
|
15434
|
-
| `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 |
|
|
15435
16179
|
|
|
15436
16180
|
###### Events
|
|
15437
16181
|
|
|
@@ -15448,7 +16192,7 @@ Also takes every attribute of `<div>` – without `defaultValue`, `onChange`.
|
|
|
15448
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 |
|
|
15449
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 |
|
|
15450
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) |
|
|
15451
|
-
| `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 |
|
|
15452
16196
|
|
|
15453
16197
|
Also takes every attribute of `<div>` – without `title`.
|
|
15454
16198
|
|
|
@@ -15456,7 +16200,7 @@ Also takes every attribute of `<div>` – without `title`.
|
|
|
15456
16200
|
|
|
15457
16201
|
- A folded section's content stays rendered; for heavy content, render it only while its section is open.
|
|
15458
16202
|
|
|
15459
|
-
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).
|
|
15460
16204
|
|
|
15461
16205
|
### Stepper
|
|
15462
16206
|
|
|
@@ -15536,26 +16280,49 @@ export default function AFailedStep() {
|
|
|
15536
16280
|
|
|
15537
16281
|
##### Move on yourself
|
|
15538
16282
|
|
|
15539
|
-
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.
|
|
15540
16284
|
|
|
15541
16285
|
```tsx
|
|
15542
|
-
import { useState } from "react";
|
|
15543
|
-
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";
|
|
15544
16288
|
|
|
15545
|
-
const
|
|
16289
|
+
const LABELS = ["Choose people", "Set capacity", "Plan leave", "Confirm"];
|
|
15546
16290
|
|
|
15547
16291
|
export default function MoveOnYourself() {
|
|
15548
|
-
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
|
+
}));
|
|
15549
16313
|
|
|
15550
16314
|
return (
|
|
15551
16315
|
<Stack gap={4} style={{ maxWidth: 560 }}>
|
|
15552
|
-
<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>
|
|
15553
16320
|
<Stack direction="row" gap={2}>
|
|
15554
16321
|
<Button size="sm" variant="secondary" disabled={current === 0} onClick={() => setCurrent(current - 1)}>
|
|
15555
16322
|
Back
|
|
15556
16323
|
</Button>
|
|
15557
|
-
<Button size="sm" variant="primary" disabled={current ===
|
|
15558
|
-
{current >=
|
|
16324
|
+
<Button size="sm" variant="primary" disabled={current === LABELS.length} onClick={() => setCurrent(current + 1)}>
|
|
16325
|
+
{current >= LABELS.length - 1 ? "Start the sprint" : "Next"}
|
|
15559
16326
|
</Button>
|
|
15560
16327
|
</Stack>
|
|
15561
16328
|
</Stack>
|
|
@@ -15649,7 +16416,7 @@ Under forced colours the lines between the steps take the system's text colour,
|
|
|
15649
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 |
|
|
15650
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 |
|
|
15651
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) |
|
|
15652
|
-
| `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 |
|
|
15653
16420
|
|
|
15654
16421
|
Also takes every attribute of the rendered element.
|
|
15655
16422
|
|
|
@@ -15663,10 +16430,10 @@ Also takes every attribute of the rendered element.
|
|
|
15663
16430
|
|
|
15664
16431
|
#### Known limits
|
|
15665
16432
|
|
|
15666
|
-
- 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.
|
|
15667
16434
|
- No branching or optional steps; pass the steps that apply.
|
|
15668
16435
|
|
|
15669
|
-
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).
|
|
15670
16437
|
|
|
15671
16438
|
### TreeView
|
|
15672
16439
|
|
|
@@ -16226,13 +16993,13 @@ export default function SearchCheckAndReveal() {
|
|
|
16226
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 |
|
|
16227
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) |
|
|
16228
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 |
|
|
16229
|
-
| `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 |
|
|
16230
16997
|
|
|
16231
16998
|
###### Accessibility
|
|
16232
16999
|
|
|
16233
17000
|
| Prop | Type | Default | Description |
|
|
16234
17001
|
|---|---|---|---|
|
|
16235
|
-
| `
|
|
17002
|
+
| `aria-label` *required* | `string` | — | Accessible name of the tree.<br>Shown in: [A tree](#treeview), [Tick a selection](#treeview), [Load branches on demand](#treeview) and 5 more |
|
|
16236
17003
|
|
|
16237
17004
|
Also takes every attribute of `<div>` – without `children`.
|
|
16238
17005
|
|
|
@@ -16246,7 +17013,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
16246
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) |
|
|
16247
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 |
|
|
16248
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) |
|
|
16249
|
-
| `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 |
|
|
16250
17017
|
|
|
16251
17018
|
###### Events
|
|
16252
17019
|
|
|
@@ -16344,7 +17111,7 @@ to render and the heights of the filler rows around it.
|
|
|
16344
17111
|
- No dragging nodes to rearrange them.
|
|
16345
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)).
|
|
16346
17113
|
|
|
16347
|
-
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).
|
|
16348
17115
|
|
|
16349
17116
|
### Benchmark
|
|
16350
17117
|
|
|
@@ -16623,6 +17390,12 @@ From `TreeViewProps` — the full table stands on [TreeView](#treeview).
|
|
|
16623
17390
|
| [`tree`](#treeview) *required* | [`Tree`](#treeview)`<K, S>` | — | The tree from `useTree`. It is the whole state: flattening, active node, checks, anchor. The view holds nothing beside it. |
|
|
16624
17391
|
| [`children`](#treeview) *required* | `(entry: `[`FlatteningEntry`](#treeview)`<K, S>) => ReactNode` | — | What the node says. |
|
|
16625
17392
|
|
|
17393
|
+
###### Accessibility
|
|
17394
|
+
|
|
17395
|
+
| Prop | Type | Default | Description |
|
|
17396
|
+
|---|---|---|---|
|
|
17397
|
+
| [`aria-label`](#treeview) *required* | `string` | — | Accessible name of the tree. |
|
|
17398
|
+
|
|
16626
17399
|
## Data display
|
|
16627
17400
|
|
|
16628
17401
|
Single values and labels, read at a glance.
|
|
@@ -16793,9 +17566,9 @@ The keys of [Button](#button) apply here.
|
|
|
16793
17566
|
|
|
16794
17567
|
| Prop | Type | Default | Description |
|
|
16795
17568
|
|---|---|---|---|
|
|
16796
|
-
| `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
|
|
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 |
|
|
16797
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 |
|
|
16798
|
-
| `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 |
|
|
16799
17572
|
|
|
16800
17573
|
Also takes every attribute of `<span>`.
|
|
16801
17574
|
|
|
@@ -16815,7 +17588,7 @@ type BadgeTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
16815
17588
|
- It cannot be clicked or removed; a label the user acts on is a [Tag](#tag).
|
|
16816
17589
|
- It counts nothing itself: capping at “99+” is yours.
|
|
16817
17590
|
|
|
16818
|
-
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).
|
|
16819
17592
|
|
|
16820
17593
|
### Tag
|
|
16821
17594
|
|
|
@@ -17043,7 +17816,7 @@ export default function AFilterBar() {
|
|
|
17043
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 |
|
|
17044
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) |
|
|
17045
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) |
|
|
17046
|
-
| `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 |
|
|
17047
17820
|
|
|
17048
17821
|
###### Events
|
|
17049
17822
|
|
|
@@ -17057,7 +17830,7 @@ Also takes every attribute of `<span>` – without `onRemove`.
|
|
|
17057
17830
|
|
|
17058
17831
|
| Prop | Type | Default | Description |
|
|
17059
17832
|
|---|---|---|---|
|
|
17060
|
-
| `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 |
|
|
17061
17834
|
|
|
17062
17835
|
###### Accessibility
|
|
17063
17836
|
|
|
@@ -17082,7 +17855,7 @@ type TagTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
17082
17855
|
- No field for typing new tags: a tag input is a [MultiSelect](#multiselect).
|
|
17083
17856
|
- Tags are not toggles: a set of choices to switch on and off is a group of [Checkbox](#checkbox) or a [ButtonGroup](#buttongroup).
|
|
17084
17857
|
|
|
17085
|
-
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).
|
|
17086
17859
|
|
|
17087
17860
|
### Stat
|
|
17088
17861
|
|
|
@@ -17823,6 +18596,49 @@ export default function AServiceOverview() {
|
|
|
17823
18596
|
}
|
|
17824
18597
|
```
|
|
17825
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
|
+
|
|
17826
18642
|
#### When to use something else
|
|
17827
18643
|
|
|
17828
18644
|
- A share of a whole, drawn as a bar → Meter
|
|
@@ -17841,15 +18657,16 @@ It announces nothing: a value that changes or a verdict that turns is read when
|
|
|
17841
18657
|
|
|
17842
18658
|
| Prop | Type | Default | Description |
|
|
17843
18659
|
|---|---|---|---|
|
|
17844
|
-
| `label` *required* | `string` | — | What is being measured.<br>Shown in: [Configurator](#stat), [A figure](#stat), [Read a value against its limits](#stat) and
|
|
17845
|
-
| `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
|
|
17846
|
-
| `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
|
|
17847
|
-
| `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
|
|
17848
|
-
| `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 |
|
|
17849
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 |
|
|
17850
|
-
| `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), [
|
|
17851
|
-
| `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), [
|
|
17852
|
-
| `
|
|
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 |
|
|
17853
18670
|
|
|
17854
18671
|
Also takes every attribute of `<div>` – without `children`.
|
|
17855
18672
|
|
|
@@ -17864,7 +18681,7 @@ violated, and it is never the edge of a region.
|
|
|
17864
18681
|
|
|
17865
18682
|
| Prop | Type | Default | Description |
|
|
17866
18683
|
|---|---|---|---|
|
|
17867
|
-
| `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 |
|
|
17868
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 |
|
|
17869
18686
|
|
|
17870
18687
|
###### `FreshnessAges`
|
|
@@ -17878,8 +18695,17 @@ harder statement still wins - the middle state simply falls away.
|
|
|
17878
18695
|
|
|
17879
18696
|
| Prop | Type | Default | Description |
|
|
17880
18697
|
|---|---|---|---|
|
|
17881
|
-
| `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), [
|
|
17882
|
-
| `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
|
+
```
|
|
17883
18709
|
|
|
17884
18710
|
###### `Limit`
|
|
17885
18711
|
|
|
@@ -17891,9 +18717,9 @@ force a `null` on one edge in the one-sided case.
|
|
|
17891
18717
|
|
|
17892
18718
|
| Prop | Type | Default | Description |
|
|
17893
18719
|
|---|---|---|---|
|
|
17894
|
-
| `value` *required* | `number` | — | <br>Shown in: [Read a value against its limits](#stat), [Show a value nobody has](#stat), [Add a history](#stat) and
|
|
17895
|
-
| `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
|
|
17896
|
-
| `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 |
|
|
17897
18723
|
|
|
17898
18724
|
###### `Side`
|
|
17899
18725
|
|
|
@@ -17918,7 +18744,7 @@ type Severity = "warning" | "alarm";
|
|
|
17918
18744
|
- No trend arrow: a direction from two noisy points is read as information it does not carry; the history line shows the shape.
|
|
17919
18745
|
- It fetches and polls nothing: freshness is judged from the `asOf` you give it.
|
|
17920
18746
|
|
|
17921
|
-
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).
|
|
17922
18748
|
|
|
17923
18749
|
### Meter
|
|
17924
18750
|
|
|
@@ -18070,7 +18896,7 @@ It is no live region: a new value is read when a reader reaches the bar. Under f
|
|
|
18070
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 |
|
|
18071
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 |
|
|
18072
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 |
|
|
18073
|
-
| `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 |
|
|
18074
18900
|
|
|
18075
18901
|
Also takes every attribute of `<span>`.
|
|
18076
18902
|
|
|
@@ -18088,7 +18914,7 @@ type MeterTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
|
18088
18914
|
|
|
18089
18915
|
- No limit marks, target tick or scale on the bar; for a value against limits use a [Stat](#stat).
|
|
18090
18916
|
|
|
18091
|
-
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).
|
|
18092
18918
|
|
|
18093
18919
|
### Sparkline
|
|
18094
18920
|
|
|
@@ -18338,7 +19164,7 @@ export default function InATable() {
|
|
|
18338
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 |
|
|
18339
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 |
|
|
18340
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) |
|
|
18341
|
-
| `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 |
|
|
18342
19168
|
|
|
18343
19169
|
Also takes every attribute of `<span>`.
|
|
18344
19170
|
|
|
@@ -18346,7 +19172,7 @@ Also takes every attribute of `<span>`.
|
|
|
18346
19172
|
|
|
18347
19173
|
- No axes, labels, tooltip or points to hover: the value stands beside it.
|
|
18348
19174
|
|
|
18349
|
-
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).
|
|
18350
19176
|
|
|
18351
19177
|
## API index
|
|
18352
19178
|
|
|
@@ -18374,7 +19200,7 @@ Used on [Accordion](#accordion).
|
|
|
18374
19200
|
|
|
18375
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.
|
|
18376
19202
|
|
|
18377
|
-
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).
|
|
18378
19204
|
|
|
18379
19205
|
##### `AngleGlyph`
|
|
18380
19206
|
|
|
@@ -18460,7 +19286,7 @@ function ClockGlyph({ ref, size, ...rest }: GlyphProps): import("react").JSX.Ele
|
|
|
18460
19286
|
|
|
18461
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.
|
|
18462
19288
|
|
|
18463
|
-
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).
|
|
18464
19290
|
|
|
18465
19291
|
##### `CommandPalette`
|
|
18466
19292
|
|
|
@@ -18474,6 +19300,12 @@ Used on [CommandPalette](#commandpalette).
|
|
|
18474
19300
|
|
|
18475
19301
|
Used on [Scenarios](#scenarios), [Modal](#modal) and [ConfirmDialog](#confirmdialog).
|
|
18476
19302
|
|
|
19303
|
+
##### `ContextMenu`
|
|
19304
|
+
|
|
19305
|
+
[ContextMenu](#contextmenu) – A menu that opens at a point, for a right-click on something that is not a button: a row, a canvas, a bar in a schedule (also called a right-click menu). The entries and the keyboard are those of the menu.
|
|
19306
|
+
|
|
19307
|
+
Used on [ContextMenu](#contextmenu).
|
|
19308
|
+
|
|
18477
19309
|
##### `ControlSizeProvider`
|
|
18478
19310
|
|
|
18479
19311
|
[Sizes](#sizes) – Sets the size of the controls inside it - every control with `size` takes
|
|
@@ -18497,7 +19329,7 @@ Used on [IconButton](#iconbutton).
|
|
|
18497
19329
|
|
|
18498
19330
|
[DatePicker](#datepicker) – One day, picked in a calendar (date field): a delivery date, a due date. Weeks begin on Monday.
|
|
18499
19331
|
|
|
18500
|
-
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).
|
|
18501
19333
|
|
|
18502
19334
|
##### `DateRangePicker`
|
|
18503
19335
|
|
|
@@ -18599,7 +19431,7 @@ Used on [Scenarios](#scenarios), [Stack and Grid](#stack-and-grid), [Typography]
|
|
|
18599
19431
|
|
|
18600
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.
|
|
18601
19433
|
|
|
18602
|
-
Used on [Button](#button), [IconButton](#iconbutton) and [Menu](#menu).
|
|
19434
|
+
Used on [Button](#button), [IconButton](#iconbutton), [Input](#input) and [Menu](#menu).
|
|
18603
19435
|
|
|
18604
19436
|
##### `Input`
|
|
18605
19437
|
|
|
@@ -18616,14 +19448,14 @@ and usable directly for a section as well.
|
|
|
18616
19448
|
function LanguageProvider({ formats, wording, children }: LanguageProviderProps): import("react").JSX.Element;
|
|
18617
19449
|
```
|
|
18618
19450
|
|
|
18619
|
-
Used on [Language](#language).
|
|
19451
|
+
Used on [Scenarios](#scenarios) and [Language](#language).
|
|
18620
19452
|
|
|
18621
19453
|
##### `Link`
|
|
18622
19454
|
|
|
18623
19455
|
[Typography](#typography-2) – A link in the size of its text; `external` opens it in a new tab with the
|
|
18624
19456
|
protective attributes set.
|
|
18625
19457
|
|
|
18626
|
-
Used on [Scenarios](#scenarios), [Theming](#theming), [Typography](#typography-2)
|
|
19458
|
+
Used on [Scenarios](#scenarios), [Theming](#theming), [Typography](#typography-2), [Menu](#menu) and [Drawer](#drawer).
|
|
18627
19459
|
|
|
18628
19460
|
##### `MeasureGlyph`
|
|
18629
19461
|
|
|
@@ -18638,11 +19470,11 @@ function MeasureGlyph({ ref, size, ...rest }: GlyphProps): import("react").JSX.E
|
|
|
18638
19470
|
|
|
18639
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.
|
|
18640
19472
|
|
|
18641
|
-
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).
|
|
18642
19474
|
|
|
18643
19475
|
##### `MenuItem`
|
|
18644
19476
|
|
|
18645
|
-
[Menu](#menu) – An entry of a `Menu` or a
|
|
19477
|
+
[Menu](#menu) – An entry of a `Menu` or a `ContextMenu`. It runs `onSelect` and closes the
|
|
18646
19478
|
menu.
|
|
18647
19479
|
|
|
18648
19480
|
Used on [Scenarios](#scenarios), [UmrissProvider](#umrissprovider), [IconButton](#iconbutton), [ButtonGroup](#buttongroup), [Menu](#menu) and [ContextMenu](#contextmenu).
|
|
@@ -18707,6 +19539,17 @@ screen reader, an optional sentence below it, and the close cross.
|
|
|
18707
19539
|
|
|
18708
19540
|
Used on [Scenarios](#scenarios), [Sizes](#sizes), [Toast](#toast-1), [Modal](#modal) and [Drawer](#drawer).
|
|
18709
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
|
+
|
|
18710
19553
|
##### `MultiSelect`
|
|
18711
19554
|
|
|
18712
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.
|
|
@@ -18739,7 +19582,7 @@ Used on [Popover](#popover) and [CommandPalette](#commandpalette).
|
|
|
18739
19582
|
|
|
18740
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.
|
|
18741
19584
|
|
|
18742
|
-
Used on [Scenarios](#scenarios), [ProgressBar](#progressbar) and [Stepper](#stepper).
|
|
19585
|
+
Used on [Scenarios](#scenarios), [FileInput](#fileinput), [ProgressBar](#progressbar) and [Stepper](#stepper).
|
|
18743
19586
|
|
|
18744
19587
|
##### `RadioGroup`
|
|
18745
19588
|
|
|
@@ -18751,7 +19594,7 @@ Used on [Scenarios](#scenarios), [Sizes](#sizes) and [RadioGroup](#radiogroup).
|
|
|
18751
19594
|
|
|
18752
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.
|
|
18753
19596
|
|
|
18754
|
-
Used on [Sizes](#sizes) and [SegmentedControl](#segmentedcontrol).
|
|
19597
|
+
Used on [Scenarios](#scenarios), [Sizes](#sizes) and [SegmentedControl](#segmentedcontrol).
|
|
18755
19598
|
|
|
18756
19599
|
##### `Select`
|
|
18757
19600
|
|
|
@@ -18820,7 +19663,7 @@ Used on [Scenarios](#scenarios), [FileInput](#fileinput), [Tabs](#tabs) and [Ste
|
|
|
18820
19663
|
|
|
18821
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.
|
|
18822
19665
|
|
|
18823
|
-
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).
|
|
18824
19667
|
|
|
18825
19668
|
##### `Tab`
|
|
18826
19669
|
|
|
@@ -18901,10 +19744,16 @@ Used on [Scenarios](#scenarios), [IconButton](#iconbutton), [Toast](#toast-1), [
|
|
|
18901
19744
|
##### `TreeSearch`
|
|
18902
19745
|
|
|
18903
19746
|
[TreeView](#treeview) – The search field of a tree: an `Input` that writes into the tree's search
|
|
18904
|
-
text, so that the
|
|
19747
|
+
text, so that the `TreeView` filters on it.
|
|
18905
19748
|
|
|
18906
19749
|
Used on [TreeView](#treeview).
|
|
18907
19750
|
|
|
19751
|
+
##### `TreeView`
|
|
19752
|
+
|
|
19753
|
+
[TreeView](#treeview) – A hierarchy the user expands, walks with the keys and optionally ticks (also called a tree or outline). Reach for it for folders, teams and cost-centre structures; large trees stay quick because only the visible rows are drawn.
|
|
19754
|
+
|
|
19755
|
+
Used on [Scenarios](#scenarios), [TreeView](#treeview) and [Benchmark](#benchmark).
|
|
19756
|
+
|
|
18908
19757
|
##### `UmrissProvider`
|
|
18909
19758
|
|
|
18910
19759
|
[UmrissProvider](#umrissprovider) – Sets once, at the root, what an application shares: the density of its tables, where overlays open, how long toasts stay and where they stand, and the language. It is optional; every component works the same without it.
|
|
@@ -18915,26 +19764,26 @@ Used on [UmrissProvider](#umrissprovider) and [Toast](#toast-1).
|
|
|
18915
19764
|
|
|
18916
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.
|
|
18917
19766
|
|
|
18918
|
-
Used on [VisuallyHidden](#visuallyhidden).
|
|
19767
|
+
Used on [VisuallyHidden](#visuallyhidden) and [FileInput](#fileinput).
|
|
18919
19768
|
|
|
18920
19769
|
#### Hooks
|
|
18921
19770
|
|
|
18922
19771
|
##### `useCommandPaletteShortcut`
|
|
18923
19772
|
|
|
18924
|
-
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.
|
|
18925
19774
|
|
|
18926
|
-
`onOpen` may be new on every render: the hook remembers the
|
|
18927
|
-
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.
|
|
18928
19777
|
|
|
18929
19778
|
```ts
|
|
18930
|
-
function useCommandPaletteShortcut(onOpen: () => void): void;
|
|
19779
|
+
function useCommandPaletteShortcut(onOpen: () => void, options?: CommandPaletteShortcutOptions): void;
|
|
18931
19780
|
```
|
|
18932
19781
|
|
|
18933
19782
|
Used on [CommandPalette](#commandpalette).
|
|
18934
19783
|
|
|
18935
19784
|
##### `useContextMenuTrigger`
|
|
18936
19785
|
|
|
18937
|
-
Opens a
|
|
19786
|
+
Opens a `ContextMenu` the same way on every device: on a right-click (at the
|
|
18938
19787
|
pointer), on the context-menu key or Shift+F10 (at the target's box) and on
|
|
18939
19788
|
a long press with a finger (at the finger), which is the only way on iOS.
|
|
18940
19789
|
`open` receives the point to pass on as the menu's `position`.
|
|
@@ -18973,13 +19822,15 @@ function useDensityFor(own: "regular" | "compact" | undefined, fallback: "regula
|
|
|
18973
19822
|
|
|
18974
19823
|
##### `useFormats`
|
|
18975
19824
|
|
|
18976
|
-
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.
|
|
18977
19828
|
|
|
18978
19829
|
```ts
|
|
18979
19830
|
function useFormats(): Formats;
|
|
18980
19831
|
```
|
|
18981
19832
|
|
|
18982
|
-
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).
|
|
18983
19834
|
|
|
18984
19835
|
##### `useFormField`
|
|
18985
19836
|
|
|
@@ -19014,6 +19865,8 @@ Formatting and wording together; without a provider, the defaults.
|
|
|
19014
19865
|
const useLanguage: () => Language;
|
|
19015
19866
|
```
|
|
19016
19867
|
|
|
19868
|
+
Used on [Scenarios](#scenarios).
|
|
19869
|
+
|
|
19017
19870
|
##### `usePortalTarget`
|
|
19018
19871
|
|
|
19019
19872
|
Resolves the configured portal target.
|
|
@@ -19028,6 +19881,17 @@ would be invisible.
|
|
|
19028
19881
|
function usePortalTarget(): () => HTMLElement | null;
|
|
19029
19882
|
```
|
|
19030
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
|
+
|
|
19031
19895
|
##### `useToast`
|
|
19032
19896
|
|
|
19033
19897
|
Access to `toast()`, `update()` and `dismiss()`; requires a ToastProvider.
|
|
@@ -19055,7 +19919,7 @@ restored from a link.
|
|
|
19055
19919
|
|
|
19056
19920
|
- `roots` – The top-level nodes, in your own type.
|
|
19057
19921
|
- `options` – How a node is read, and the initial or controlled state with its change handlers.
|
|
19058
|
-
- Returns The tree to hand to
|
|
19922
|
+
- Returns The tree to hand to `TreeView` and `TreeSearch`.
|
|
19059
19923
|
|
|
19060
19924
|
```ts
|
|
19061
19925
|
function useTree<K, S extends Key = string>(roots: readonly K[], options: TreeOptions<K, S>): Tree<K, S>;
|
|
@@ -19144,7 +20008,7 @@ a surface is laid out, and a region is laid out nowhere.
|
|
|
19144
20008
|
function announce(text: string, at?: Element | null): void;
|
|
19145
20009
|
```
|
|
19146
20010
|
|
|
19147
|
-
Used on [VisuallyHidden](#visuallyhidden) and [CommandPalette](#commandpalette).
|
|
20011
|
+
Used on [VisuallyHidden](#visuallyhidden), [FormField](#formfield) and [CommandPalette](#commandpalette).
|
|
19148
20012
|
|
|
19149
20013
|
##### `assess`
|
|
19150
20014
|
|
|
@@ -19182,23 +20046,6 @@ is then enough.
|
|
|
19182
20046
|
function cadence(ages: FreshnessAges): number;
|
|
19183
20047
|
```
|
|
19184
20048
|
|
|
19185
|
-
##### `ContextMenu`
|
|
19186
|
-
|
|
19187
|
-
A menu that opens at a point instead of under a trigger – for a right-click
|
|
19188
|
-
on something that is not a button: a canvas, a row, a subtask. Open it with
|
|
19189
|
-
[`useContextMenuTrigger`](#api-index-1), which also covers the context-menu key and a long
|
|
19190
|
-
press, the only way on iOS.
|
|
19191
|
-
|
|
19192
|
-
It hangs from an invisible anchor that stands at the point, so the one
|
|
19193
|
-
popover does the placing, the dismissal and the portal. The focus goes to
|
|
19194
|
-
the first entry and, on closing, back to where it was when the menu opened.
|
|
19195
|
-
|
|
19196
|
-
```ts
|
|
19197
|
-
function ContextMenu({ open, onOpenChange, position, ariaLabel, "aria-label": name, children }: ContextMenuProps): import("react").JSX.Element;
|
|
19198
|
-
```
|
|
19199
|
-
|
|
19200
|
-
Used on [ContextMenu](#contextmenu).
|
|
19201
|
-
|
|
19202
20049
|
##### `createLongPress`
|
|
19203
20050
|
|
|
19204
20051
|
The one long-press detector, a plain function over pointer events so that
|
|
@@ -19304,18 +20151,6 @@ actually expanded.
|
|
|
19304
20151
|
function treeModel<K, S extends Key = string>(roots: readonly K[], reader: NodeReader<K, S>, snapshot: TreeSnapshot<S>): readonly FlatteningEntry<K, S>[];
|
|
19305
20152
|
```
|
|
19306
20153
|
|
|
19307
|
-
##### `TreeView`
|
|
19308
|
-
|
|
19309
|
-
The tree as a control: draws the nodes of a `Tree` from [`useTree`](#api-index-1) as a
|
|
19310
|
-
`tree` with keyboard navigation, typeahead and, with `checkable`, ticks.
|
|
19311
|
-
What a node says is yours - `children` renders it.
|
|
19312
|
-
|
|
19313
|
-
```ts
|
|
19314
|
-
function TreeView<K, S extends Key = string>({ ref, tree, ariaLabel, "aria-label": name, checkable, children, className, onKeyDown, onFocus, onBlur, onScroll, ...rest }: TreeViewProps<K, S>): import("react").JSX.Element;
|
|
19315
|
-
```
|
|
19316
|
-
|
|
19317
|
-
Used on [Scenarios](#scenarios), [TreeView](#treeview) and [Benchmark](#benchmark).
|
|
19318
|
-
|
|
19319
20154
|
##### `verdictWeight`
|
|
19320
20155
|
|
|
19321
20156
|
How heavily a verdict weighs - for sorting and comparing, as when a matrix
|
|
@@ -19349,6 +20184,37 @@ object is `numberWith`.
|
|
|
19349
20184
|
function writeNumber(formats: Formats, n: number, format?: NumberFormat): string;
|
|
19350
20185
|
```
|
|
19351
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
|
+
|
|
19352
20218
|
#### Constants
|
|
19353
20219
|
|
|
19354
20220
|
##### `DEFAULT_FORMATS`
|
|
@@ -19527,6 +20393,14 @@ Used on [CommandPalette](#commandpalette).
|
|
|
19527
20393
|
|
|
19528
20394
|
Its table stands on [CommandPalette](#commandpalette).
|
|
19529
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
|
+
|
|
19530
20404
|
##### `ConfirmDialogProps`
|
|
19531
20405
|
|
|
19532
20406
|
Its table stands on [ConfirmDialog](#confirmdialog).
|
|
@@ -19647,11 +20521,15 @@ Everything the library knows about formatting.
|
|
|
19647
20521
|
|
|
19648
20522
|
| Prop | Type | Default | Description |
|
|
19649
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. |
|
|
19650
20527
|
| `date` *required* | `(d: Date) => string` | — | Date as displayed: 17/03/2026<br>Shown in: [A span of days (DateRangePicker)](#daterangepicker) |
|
|
19651
20528
|
| `dateShort` *required* | `(d: Date) => string` | — | Short form without the year, in the range footer: 17/03 |
|
|
19652
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 |
|
|
19653
20531
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
19654
|
-
| `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) |
|
|
19655
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 |
|
|
19656
20534
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2<br>Shown in: [Set an instant (DateTimePicker)](#datetimepicker) |
|
|
19657
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) |
|
|
@@ -19679,7 +20557,7 @@ Its table stands on [FormField](#formfield).
|
|
|
19679
20557
|
|
|
19680
20558
|
##### `Freshness`
|
|
19681
20559
|
|
|
19682
|
-
How
|
|
20560
|
+
How old a value is right now - independently of how it is judged and how far its source vouches for it.
|
|
19683
20561
|
|
|
19684
20562
|
```ts
|
|
19685
20563
|
type Freshness = "fresh" | "stale" | "lost";
|
|
@@ -19698,8 +20576,8 @@ harder statement still wins - the middle state simply falls away.
|
|
|
19698
20576
|
|
|
19699
20577
|
| Prop | Type | Default | Description |
|
|
19700
20578
|
|---|---|---|---|
|
|
19701
|
-
| `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), [
|
|
19702
|
-
| `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 |
|
|
19703
20581
|
|
|
19704
20582
|
Used on [Scenarios](#scenarios) and [Stat](#stat).
|
|
19705
20583
|
|
|
@@ -19729,7 +20607,7 @@ The props of a glyph: an SVG's attributes and its edge length.
|
|
|
19729
20607
|
| Prop | Type | Default | Description |
|
|
19730
20608
|
|---|---|---|---|
|
|
19731
20609
|
| `size` | `number` | `12` | Edge length in pixels. The default is the size the glyph is drawn at in the components. |
|
|
19732
|
-
| `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 |
|
|
19733
20611
|
|
|
19734
20612
|
Also takes every attribute of `<svg>` – without `children`, `viewBox`.
|
|
19735
20613
|
|
|
@@ -19772,7 +20650,7 @@ A complete language: the formats for numbers and dates, and the wording.
|
|
|
19772
20650
|
|
|
19773
20651
|
| Prop | Type | Default | Description |
|
|
19774
20652
|
|---|---|---|---|
|
|
19775
|
-
| `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) |
|
|
19776
20654
|
| `wording` *required* | `Wording` | — | |
|
|
19777
20655
|
|
|
19778
20656
|
Used on [Toast](#toast-1).
|
|
@@ -19790,8 +20668,8 @@ that differ from the default.
|
|
|
19790
20668
|
|
|
19791
20669
|
| Prop | Type | Default | Description |
|
|
19792
20670
|
|---|---|---|---|
|
|
19793
|
-
| `children` *required* | `ReactNode` | — | <br>Shown in: [German (Language)](#language), [English and German side by side (Language)](#language), [Replace single entries (Language)](#language) and
|
|
19794
|
-
| `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 |
|
|
19795
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 |
|
|
19796
20674
|
|
|
19797
20675
|
##### `Limit`
|
|
@@ -19804,9 +20682,9 @@ force a `null` on one edge in the one-sided case.
|
|
|
19804
20682
|
|
|
19805
20683
|
| Prop | Type | Default | Description |
|
|
19806
20684
|
|---|---|---|---|
|
|
19807
|
-
| `value` *required* | `number` | — | <br>Shown in: [English and German side by side (Language)](#language), [Replace single entries (Language)](#language), [Three panes (Splitter)](#splitter) and
|
|
19808
|
-
| `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
|
|
19809
|
-
| `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 |
|
|
19810
20688
|
|
|
19811
20689
|
##### `LimitSet`
|
|
19812
20690
|
|
|
@@ -19817,7 +20695,7 @@ violated, and it is never the edge of a region.
|
|
|
19817
20695
|
|
|
19818
20696
|
| Prop | Type | Default | Description |
|
|
19819
20697
|
|---|---|---|---|
|
|
19820
|
-
| `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 |
|
|
19821
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 |
|
|
19822
20700
|
|
|
19823
20701
|
Used on [Scenarios](#scenarios), [Language](#language), [Drawer](#drawer) and [Stat](#stat).
|
|
@@ -19982,6 +20860,17 @@ What the detector reads of a pointer event - a DOM or a React one fits.
|
|
|
19982
20860
|
|
|
19983
20861
|
Its table stands on [ProgressBar](#progressbar).
|
|
19984
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
|
+
|
|
19985
20874
|
##### `RadioGroupProps`
|
|
19986
20875
|
|
|
19987
20876
|
Its table stands on [RadioGroup](#radiogroup).
|
|
@@ -20007,7 +20896,7 @@ The `ref` of a component: the element it renders at its root.
|
|
|
20007
20896
|
|
|
20008
20897
|
| Prop | Type | Default | Description |
|
|
20009
20898
|
|---|---|---|---|
|
|
20010
|
-
| `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 |
|
|
20011
20900
|
|
|
20012
20901
|
##### `RowPlacement`
|
|
20013
20902
|
|
|
@@ -20473,6 +21362,9 @@ Everything the library puts out as text.
|
|
|
20473
21362
|
| `datePlaceholder` *required* | `string` | — | |
|
|
20474
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. |
|
|
20475
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. |
|
|
20476
21368
|
| `dateTimePlaceholder` *required* | `string` | — | |
|
|
20477
21369
|
| `dateTimePanel` *required* | `string` | — | |
|
|
20478
21370
|
| `dateTimeClear` *required* | `string` | — | |
|
|
@@ -20483,6 +21375,8 @@ Everything the library puts out as text.
|
|
|
20483
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. |
|
|
20484
21376
|
| `previousMonth` *required* | `string` | — | |
|
|
20485
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. |
|
|
20486
21380
|
| `quickSelect` *required* | `string` | — | Group name of the preset column. |
|
|
20487
21381
|
| `today` *required* | `string` | — | <br>Shown in: [Use the language in your own components (Language)](#language) |
|
|
20488
21382
|
| `now` *required* | `string` | — | |
|
|
@@ -20542,7 +21436,10 @@ Everything the library puts out as text.
|
|
|
20542
21436
|
| `unpinHint` *required* | `string` | — | |
|
|
20543
21437
|
| `exportLabel` *required* | `string` | — | The export button. |
|
|
20544
21438
|
| `exportPageLabel` *required* | `string` | — | The export button of a table in server mode, which holds and writes one page. |
|
|
21439
|
+
| `exporting` *required* | `string` | — | The status while the application prepares an export of every match. |
|
|
21440
|
+
| `exportFailed` *required* | `string` | — | The alert beside the export button when preparing the export failed without a message. |
|
|
20545
21441
|
| `exportFileName` *required* | `string` | — | The export's file name, where the application names none. |
|
|
21442
|
+
| `exportSheetName` *required* | `string` | — | The name of the sheet an XLSX export holds. |
|
|
20546
21443
|
| `tableSearchPlaceholder` *required* | `string` | — | Placeholder and accessible name of the search field. |
|
|
20547
21444
|
| `tableSearchLabel` *required* | `string` | — | |
|
|
20548
21445
|
| `filterColumn` *required* | `(column: string) => string` | — | The filter button of a column: "Filter Region". |
|
|
@@ -20590,10 +21487,14 @@ Everything the library puts out as text.
|
|
|
20590
21487
|
| `levelColumn` *required* | `string` | — | The first column of a tree's export. |
|
|
20591
21488
|
| `pathRow` *required* | `string` | — | A row shown only because a descendant matches the search or a filter. |
|
|
20592
21489
|
| `footerTopLevel` *required* | `string` | — | The footer of a tree: it sums the top level, since a parent holds its children. |
|
|
21490
|
+
| `footerOfMatches` *required* | `string` | — | The footer of a server-mode table: its sums come from the server and cover every match, not the page. Read out only. |
|
|
20593
21491
|
| `selectGroup` *required* | `(name: string) => string` | — | The box that selects every row of a group. |
|
|
20594
21492
|
| `calendarWeek` *required* | `(week: number, year: number) => string` | — | A group of the week key: "Week 42, 2026". |
|
|
20595
21493
|
| `entries` *required* | `(count: number, formatted: string) => string` | — | "128 entries" in the pagination bar; the plural belongs to the language. |
|
|
20596
21494
|
| `selectedCount` *required* | `(count: number, formatted: string) => string` | — | "3 selected" in the pagination bar and the table toolbar. |
|
|
21495
|
+
| `selectedOnPage` *required* | `(count: number, formatted: string) => string` | — | The first sentence of the offer in a server-mode table, once the page is ticked: "All 50 on this page are selected." |
|
|
21496
|
+
| `selectAllMatching` *required* | `(count: number, formatted: string) => string` | — | The button after it, for the rows the server holds: "Select all 12,400 that match". |
|
|
21497
|
+
| `allMatchingSelected` *required* | `(count: number, formatted: string) => string` | — | The line once they are selected: "All 12,400 that match are selected." |
|
|
20597
21498
|
| `copiedRows` *required* | `(count: number, formatted: string) => string` | — | Said to a screen reader after Ctrl+C copied rows: "3 rows copied". |
|
|
20598
21499
|
| `copiedCell` *required* | `string` | — | Said after Ctrl+C copied the active cell of a grid. |
|
|
20599
21500
|
| `copyFailed` *required* | `string` | — | Said when the clipboard refused or is not there. |
|
|
@@ -20612,6 +21513,7 @@ Everything the library puts out as text.
|
|
|
20612
21513
|
| `rangeTo` *required* | `(to: string) => string` | — | |
|
|
20613
21514
|
| `rangeInvalid` *required* | `string` | — | When "From" lies behind "To". The condition stays the last valid one. |
|
|
20614
21515
|
| `resetAll` *required* | `string` | — | Clears search and conditions - in the table toolbar and in the empty body. |
|
|
21516
|
+
| `tryAgain` *required* | `string` | — | The button under a server-mode table's error that sends the request once more. |
|
|
20615
21517
|
| `filteredOfTotal` *required* | `(matches: string, total: string) => string` | — | "43 of 1.204" - the numbers come from the formats. |
|
|
20616
21518
|
| `verdictOk` *required* | `string` | — | The four outcomes of an assessment, as a word beside the value. Colour alone carries no meaning - the word stands here for that reason.<br>Shown in: [Replace single entries (Language)](#language) |
|
|
20617
21519
|
| `verdictWarning` *required* | `string` | — | <br>Shown in: [Replace single entries (Language)](#language) |
|
|
@@ -20625,6 +21527,9 @@ Everything the library puts out as text.
|
|
|
20625
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)). |
|
|
20626
21528
|
| `freshnessStale` *required* | `string` | — | |
|
|
20627
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` | — | |
|
|
20628
21533
|
| `asOfAgo` *required* | `(duration: string) => string` | — | "As of: 3 minutes ago", where the duration comes from the formats. |
|
|
20629
21534
|
| `close` *required* | `string` | — | |
|
|
20630
21535
|
| `closeToast` *required* | `string` | — | |
|
|
@@ -20740,6 +21645,36 @@ Everything the library puts out as text.
|
|
|
20740
21645
|
|
|
20741
21646
|
Used on [Language](#language).
|
|
20742
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
|
+
|
|
20743
21678
|
#### @umriss-ui/core/wording/de
|
|
20744
21679
|
|
|
20745
21680
|
##### `GERMAN_FORMATS`
|