@umriss-ui/core 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/core 0.38.0
1
+ # @umriss-ui/core 0.40.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
 
@@ -506,7 +506,6 @@ import {
506
506
  Stack,
507
507
  Switch,
508
508
  Text,
509
- ToastProvider,
510
509
  TreeView,
511
510
  useToast,
512
511
  useTree,
@@ -848,11 +847,7 @@ function Content() {
848
847
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
849
848
  one provider serves every screen. */
850
849
  export default function DispatchATour() {
851
- return (
852
- <ToastProvider>
853
- <Content />
854
- </ToastProvider>
855
- );
850
+ return <Content />;
856
851
  }
857
852
  ```
858
853
 
@@ -2450,13 +2445,14 @@ Wrap the application once; here `toast` keeps every toast on screen for eight se
2450
2445
  ```tsx
2451
2446
  import { Button, ToastProvider, UmrissProvider, useToast, type ToastConfig } from "@umriss-ui/core";
2452
2447
 
2448
+ type ToastFn = ReturnType<typeof useToast>["toast"];
2449
+
2450
+ const deploy = (toast: ToastFn) => toast({ title: "Checkout 4.12.0 deployed", description: "Rolled out to all regions.", tone: "success" });
2451
+
2453
2452
  function DeployButton() {
2454
2453
  const { toast } = useToast();
2455
2454
  return (
2456
- <Button
2457
- variant="primary"
2458
- onClick={() => toast({ title: "Checkout 4.12.0 deployed", description: "Rolled out to all regions.", tone: "success" })}
2459
- >
2455
+ <Button variant="primary" onClick={() => deploy(toast)}>
2460
2456
  Deploy Checkout
2461
2457
  </Button>
2462
2458
  );
@@ -2534,15 +2530,20 @@ import { GERMAN_FORMATS, GERMAN_WORDING } from "@umriss-ui/core/wording/de";
2534
2530
  const LANGUAGE: UmrissProviderProps["language"] = { wording: GERMAN_WORDING, formats: GERMAN_FORMATS };
2535
2531
  const TOAST: ToastConfig = { duration: 3000 };
2536
2532
 
2533
+ type ToastFn = ReturnType<typeof useToast>["toast"];
2534
+
2535
+ const rebook = (toast: ToastFn) => toast({ title: "Shipment SH-1042 rebooked" });
2536
+
2537
2537
  function DeliveryDate() {
2538
2538
  const { toast } = useToast();
2539
+ const rebookNow = () => rebook(toast);
2539
2540
  const [date, setDate] = useState<Date | null>(new Date(2026, 2, 18));
2540
2541
  return (
2541
2542
  <Stack gap={3} align="flex-start">
2542
2543
  <FormField label="Delivery date">
2543
2544
  <DatePicker value={date} onChange={setDate} clearable />
2544
2545
  </FormField>
2545
- <Button size="sm" disabled={date === null} onClick={() => toast({ title: "Shipment SH-1042 rebooked" })}>
2546
+ <Button size="sm" disabled={date === null} onClick={rebookNow}>
2546
2547
  Rebook
2547
2548
  </Button>
2548
2549
  </Stack>
@@ -2586,7 +2587,7 @@ Where a `ToastProvider` stands inside it, the toasts' two live regions stand whe
2586
2587
  | `portalTarget` | [`PortalTarget`](#type-PortalTarget) | `null` | Where overlays portal to, unless an open dialog takes them. A function is evaluated on every opening - a target that only enters the tree later cannot be given otherwise; `null` means "as before". The callers' own rules take precedence: the popover seam portals into the nearest `<dialog>` ancestor, because a portal at the body does not reach the top layer, and the toasts follow the topmost modal dialog, because a toast outside it lies behind it and is inert.<br>Shown in: [Open overlays inside a full-screen panel](#/umrissprovider/portal-target), [Set up an application](#/umrissprovider/everything-at-once) |
2587
2588
  | `toast` | [`ToastConfig`](#type-ToastConfig) | — | The setting for toasts: the display duration where the individual toast names none, where they stand, and how many stand at once.<br>Shown in: [At the root](#/umrissprovider/at-the-root), [Set up an application](#/umrissprovider/everything-at-once), [Where they stand (Toast)](#/toast/where-they-stand) and 1 more |
2588
2589
  | `language` | [`LanguageOptions`](#/language/type-LanguageOptions) | none - the surrounding language holds, English at the root | Formats and wording, entry by entry - see [Language](#/language).<br>Shown in: [Set up an application](#/umrissprovider/everything-at-once) |
2589
- | `children` *required* | `ReactNode` | — | The subtree the settings apply to.<br>Shown in: [At the root](#/umrissprovider/at-the-root), [Open overlays inside a full-screen panel](#/umrissprovider/portal-target), [Set up an application](#/umrissprovider/everything-at-once) and 2 more |
2590
+ | `children` *required* | `ReactNode` | — | The subtree the settings apply to.<br>Shown in: [Open overlays inside a full-screen panel](#/umrissprovider/portal-target), [Set up an application](#/umrissprovider/everything-at-once) |
2590
2591
 
2591
2592
  ##### `ToastConfig`
2592
2593
 
@@ -2594,7 +2595,7 @@ Where a `ToastProvider` stands inside it, the toasts' two live regions stand whe
2594
2595
  |---|---|---|---|
2595
2596
  | `duration` | `number` | `5000` | Display duration in ms, where the individual toast names none.<br>Shown in: [At the root](#/umrissprovider/at-the-root), [Set up an application](#/umrissprovider/everything-at-once) |
2596
2597
  | `position` | [`ToastPosition`](#type-ToastPosition)<br>`"top-start" \| "top-center" \| "top-end" \| "bottom-start" \| "bottom-center" \| "bottom-end"` | `"bottom-end"` | Where the toasts stand. There is no position per toast - toasts that stand in different places are not read as one.<br>Shown in: [Where they stand (Toast)](#/toast/where-they-stand) |
2597
- | `limit` | `number` | `3` | How many toasts stand at once; the oldest gives way to a new one, as if it had been closed.<br>Shown in: [How many stand at once (Toast)](#/toast/how-many-stand) |
2598
+ | `limit` | `number` | `3` | How many toasts that leave by themselves stand at once; the oldest of them gives way to a new one, as if it had been closed. A toast that stays (`duration: 0`) or is still at work (`loading`) neither counts nor gives way.<br>Shown in: [How many stand at once (Toast)](#/toast/how-many-stand) |
2598
2599
 
2599
2600
  ##### Types on this page
2600
2601
 
@@ -4076,6 +4077,59 @@ Every entry of `Wording`: the English of `DEFAULT_WORDING` beside the German of
4076
4077
  | `scheduleSummary(summary)` | `` `${lanes === 1 ? "1 lane" : `${lanes} lanes`}, ${subtasks === 1 ? "1 subtask" : `${subtasks} subtasks`} in view from ${from} to ${to}. ` + `${overlaps === 1 ? "1 overlap" : `${overlaps} overlaps`}, ${violated === 1 ? "1 violated dependency" : `${violated} violated dependencies`}` + (blocked === 0 ? "." : `, ${blocked === 1 ? "1 subtask" : `${blocked} subtasks`} in blocked time.`) + (milestones === 0 ? "" : ` ${milestones === 1 ? "1 milestone" : `${milestones} milestones`}.`) `` | `` `${lanes === 1 ? "1 Bahn" : `${lanes} Bahnen`}, ${subtasks === 1 ? "1 Teilaufgabe" : `${subtasks} Teilaufgaben`} im Blick von ${from} bis ${to}. ` + `${overlaps === 1 ? "1 Überschneidung" : `${overlaps} Überschneidungen`}, ${violated === 1 ? "1 verletzte Abhängigkeit" : `${violated} verletzte Abhängigkeiten`}` + (blocked === 0 ? "." : `, ${blocked === 1 ? "1 Teilaufgabe in einer Sperrzeit" : `${blocked} Teilaufgaben in Sperrzeiten`}.`) + (milestones === 0 ? "" : ` ${milestones === 1 ? "1 Meilenstein" : `${milestones} Meilensteine`}.`) `` | The plot's description (S6): the lanes, the subtasks in view, the visible span with both ends formatted, and the findings of the plan by kind. |
4077
4078
  | `scheduleKeyHelp` | Left and right arrows move along the lane, up and down change the lane, Home and End go to its first and last, Page Up and Page Down jump a tenth of the view. Right bracket or T follows a dependency out, left bracket or Shift and T goes back. Space or Enter selects. Alt with left or right proposes a move, Alt and Shift a new end. Escape clears. | Pfeil links und rechts gehen die Bahn entlang, Pfeil hoch und runter wechseln die Bahn, Pos1 und Ende springen zur ersten und letzten Teilaufgabe, Bild auf und Bild ab springen ein Zehntel der Ansicht. Schließende eckige Klammer oder T folgt einer Abhängigkeit hinaus, öffnende eckige Klammer oder Umschalt und T geht zurück. Leertaste oder Eingabe wählt aus. Alt mit Pfeil links oder rechts schlägt eine Verschiebung vor, Alt und Umschalt ein neues Ende. Escape lässt die aktive Teilaufgabe los. | The keys that walk the plot, select and edit - read after the summary. |
4078
4079
 
4080
+ ##### @umriss-ui/dashboard
4081
+
4082
+ | Key | English | German | Description |
4083
+ |---|---|---|---|
4084
+ | `dashboardEdit` | Edit | Bearbeiten | The editing bar's buttons and the label that says the mode is on. |
4085
+ | `dashboardEditing` | Editing the dashboard | Dashboard wird bearbeitet | — |
4086
+ | `dashboardCancel` | Cancel | Abbrechen | — |
4087
+ | `dashboardDone` | Done | Fertig | — |
4088
+ | `dashboardUndo` | Undo | Rückgängig | — |
4089
+ | `dashboardRedo` | Redo | Wiederholen | — |
4090
+ | `dashboardReset` | Reset | Zurücksetzen | — |
4091
+ | `dashboardMenu(title)` | `` `Actions for ${title}` `` | `` `Aktionen für ${title}` `` | The name of a widget's menu button: the widget's title is the thing. |
4092
+ | `dashboardPlace(place, of)` | `` `Place ${place} of ${of}` `` | `` `Platz ${place} von ${of}` `` | At the top of the menu, and in the name of a head the arrow keys move. |
4093
+ | `dashboardHead(title, place, of)` | `` `${title}, place ${place} of ${of}` `` | `` `${title}, Platz ${place} von ${of}` `` | — |
4094
+ | `dashboardMoveStart` | Move to start | An den Anfang | — |
4095
+ | `dashboardMoveEarlier` | Move earlier | Weiter nach vorn | — |
4096
+ | `dashboardMoveLater` | Move later | Weiter nach hinten | — |
4097
+ | `dashboardMoveEnd` | Move to end | Ans Ende | — |
4098
+ | `dashboardRemove` | Remove | Entfernen | — |
4099
+ | `dashboardSizes.small` | Small | Klein | The closed set of size names, worded once for every widget type. |
4100
+ | `dashboardSizes.medium` | Medium | Mittel | The closed set of size names, worded once for every widget type. |
4101
+ | `dashboardSizes.wide` | Wide | Breit | The closed set of size names, worded once for every widget type. |
4102
+ | `dashboardSizes.tall` | Tall | Hoch | The closed set of size names, worded once for every widget type. |
4103
+ | `dashboardSizes.large` | Large | Groß | The closed set of size names, worded once for every widget type. |
4104
+ | `dashboardSizes.full` | Full width | Volle Breite | The closed set of size names, worded once for every widget type. |
4105
+ | `dashboardSizeEntry(size, share, current)` | `` `${current ? "✓ " : ""}${size}${share ? `, ${share} wide` : ""}` `` | `` `${current ? "✓ " : ""}${size}${share ? `, ${share} breit` : ""}` `` | A size's entry in a widget's menu: its name and its share of the width (`share` is "¼" or "5/12", empty for the whole width); `current` marks the size the widget stands at. |
4106
+ | `dashboardHeadingLabel` | Heading | Überschrift | The built-in heading type: its name, its sentence in the catalogue, the text a new heading starts with and the label of its text field. |
4107
+ | `dashboardHeadingSentence` | A title across the full width. | Ein Titel über die volle Breite. | — |
4108
+ | `dashboardHeadingText` | New section | Neuer Abschnitt | — |
4109
+ | `dashboardHeadingField` | Text | Text | — |
4110
+ | `dashboardLeft` | Editing ended | Bearbeiten beendet | Said when "Done" leaves the mode and nothing was changed. |
4111
+ | `dashboardMoved(title, from, to, of)` | `` `${title}: moved from place ${from} to place ${to} of ${of}` `` | `` `${title}: von Platz ${from} auf Platz ${to} von ${of} verschoben` `` | What is spoken after a change. |
4112
+ | `dashboardDragCancelled(title)` | `` `${title}: move cancelled` `` | `` `${title}: Verschieben abgebrochen` `` | — |
4113
+ | `dashboardResized(title, size)` | `` `${title}: size ${size}` `` | `` `${title}: Größe ${size}` `` | — |
4114
+ | `dashboardRemoved(title)` | `` `${title} removed. Undo brings it back.` `` | `` `${title} entfernt. „Rückgängig“ holt es zurück.` `` | — |
4115
+ | `dashboardKept` | Changes kept | Änderungen übernommen | — |
4116
+ | `dashboardCancelled` | Changes discarded | Änderungen verworfen | — |
4117
+ | `dashboardAddWidget` | Add widget | Widget hinzufügen | The catalogue and the options. |
4118
+ | `dashboardCatalogue` | Add a widget | Widget hinzufügen | — |
4119
+ | `dashboardCatalogueSentence` | Each widget is added at the end. | Jedes Widget wird am Ende eingefügt. | — |
4120
+ | `dashboardAdd` | Add | Hinzufügen | — |
4121
+ | `dashboardAddType(label)` | `` `Add ${label}` `` | `` `${label} hinzufügen` `` | — |
4122
+ | `dashboardFootprint(columns, rows)` | `` `${columns} of 12 columns, ${rows} rows` `` | `` `${columns} von 12 Spalten, ${rows} Zeilen` `` | — |
4123
+ | `dashboardAdded(title, place, of)` | `` `${title} added, place ${place} of ${of}` `` | `` `${title} hinzugefügt, Platz ${place} von ${of}` `` | — |
4124
+ | `dashboardOptions` | Options | Optionen | — |
4125
+ | `dashboardOptionsChanged(title)` | `` `${title}: options changed` `` | `` `${title}: Optionen geändert` `` | — |
4126
+ | `dashboardEmpty` | This dashboard is empty. | Dieses Dashboard ist leer. | — |
4127
+ | `dashboardEmptyEditing` | This dashboard is empty. Choose Add widget to begin. | Dieses Dashboard ist leer. Wählen Sie „Widget hinzufügen“, um zu beginnen. | — |
4128
+ | `dashboardFailed` | This widget cannot show anything. | Dieses Widget kann nichts anzeigen. | — |
4129
+ | `dashboardUndone` | Undone | Rückgängig gemacht | — |
4130
+ | `dashboardRedone` | Redone | Wiederholt | — |
4131
+ | `dashboardResetDone` | Reset to the default | Auf die Vorgabe zurückgesetzt | — |
4132
+
4079
4133
  ##### @umriss-ui/calculation
4080
4134
 
4081
4135
  | Key | English | German | Description |
@@ -4442,6 +4496,49 @@ Everything the library puts out as text.
4442
4496
  | `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
4443
4497
  | `scheduleSummary` *required* | `(summary: { lanes: number; subtasks: number; from: string; to: string; overlaps: number; violated: number; /** Subtasks in blocked time; said only where there are any. */ blocked: number; /** Milestones of the plan; said only where there are any. */ milestones: number; }) => string` | — | The plot's description (S6): the lanes, the subtasks in view, the visible span with both ends formatted, and the findings of the plan by kind. |
4444
4498
  | `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
4499
+ | `dashboardEdit` *required* | `string` | — | The editing bar's buttons and the label that says the mode is on. |
4500
+ | `dashboardEditing` *required* | `string` | — | |
4501
+ | `dashboardCancel` *required* | `string` | — | |
4502
+ | `dashboardDone` *required* | `string` | — | |
4503
+ | `dashboardUndo` *required* | `string` | — | |
4504
+ | `dashboardRedo` *required* | `string` | — | |
4505
+ | `dashboardReset` *required* | `string` | — | |
4506
+ | `dashboardMenu` *required* | `(title: string) => string` | — | The name of a widget's menu button: the widget's title is the thing. |
4507
+ | `dashboardPlace` *required* | `(place: number, of: number) => string` | — | At the top of the menu, and in the name of a head the arrow keys move. |
4508
+ | `dashboardHead` *required* | `(title: string, place: number, of: number) => string` | — | |
4509
+ | `dashboardMoveStart` *required* | `string` | — | |
4510
+ | `dashboardMoveEarlier` *required* | `string` | — | |
4511
+ | `dashboardMoveLater` *required* | `string` | — | |
4512
+ | `dashboardMoveEnd` *required* | `string` | — | |
4513
+ | `dashboardRemove` *required* | `string` | — | |
4514
+ | `dashboardSizes` *required* | `{ small: string; medium: string; wide: string; tall: string; large: string; full: string }` | — | The closed set of size names, worded once for every widget type. |
4515
+ | `dashboardSizeEntry` *required* | `(size: string, share: string, current: boolean) => string` | — | A size's entry in a widget's menu: its name and its share of the width (`share` is "¼" or "5/12", empty for the whole width); `current` marks the size the widget stands at. |
4516
+ | `dashboardHeadingLabel` *required* | `string` | — | The built-in heading type: its name, its sentence in the catalogue, the text a new heading starts with and the label of its text field. |
4517
+ | `dashboardHeadingSentence` *required* | `string` | — | |
4518
+ | `dashboardHeadingText` *required* | `string` | — | |
4519
+ | `dashboardHeadingField` *required* | `string` | — | |
4520
+ | `dashboardLeft` *required* | `string` | — | Said when "Done" leaves the mode and nothing was changed. |
4521
+ | `dashboardMoved` *required* | `(title: string, from: number, to: number, of: number) => string` | — | What is spoken after a change. |
4522
+ | `dashboardDragCancelled` *required* | `(title: string) => string` | — | |
4523
+ | `dashboardResized` *required* | `(title: string, size: string) => string` | — | |
4524
+ | `dashboardRemoved` *required* | `(title: string) => string` | — | |
4525
+ | `dashboardKept` *required* | `string` | — | |
4526
+ | `dashboardCancelled` *required* | `string` | — | |
4527
+ | `dashboardAddWidget` *required* | `string` | — | The catalogue and the options. |
4528
+ | `dashboardCatalogue` *required* | `string` | — | |
4529
+ | `dashboardCatalogueSentence` *required* | `string` | — | |
4530
+ | `dashboardAdd` *required* | `string` | — | |
4531
+ | `dashboardAddType` *required* | `(label: string) => string` | — | |
4532
+ | `dashboardFootprint` *required* | `(columns: number, rows: number) => string` | — | |
4533
+ | `dashboardAdded` *required* | `(title: string, place: number, of: number) => string` | — | |
4534
+ | `dashboardOptions` *required* | `string` | — | |
4535
+ | `dashboardOptionsChanged` *required* | `(title: string) => string` | — | |
4536
+ | `dashboardEmpty` *required* | `string` | — | |
4537
+ | `dashboardEmptyEditing` *required* | `string` | — | |
4538
+ | `dashboardFailed` *required* | `string` | — | |
4539
+ | `dashboardUndone` *required* | `string` | — | |
4540
+ | `dashboardRedone` *required* | `string` | — | |
4541
+ | `dashboardResetDone` *required* | `string` | — | |
4445
4542
  | `calculationSumSymbol` *required* | `string` | — | The four operators as symbols in a formula line. |
4446
4543
  | `calculationDifferenceSymbol` *required* | `string` | — | |
4447
4544
  | `calculationProductSymbol` *required* | `string` | — | |
@@ -4818,7 +4915,7 @@ type GridColumnWidth = number | "fill";
4818
4915
  #### Known limits
4819
4916
 
4820
4917
  - No breakpoints and no responsive props: a grid follows the width through `minItemWidth`, anything else is your stylesheet's.
4821
- - Tiles are not arranged by the user: no dragging, no resizing, no stored layout ([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)).
4918
+ - 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)).
4822
4919
 
4823
4920
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
4824
4921
 
@@ -5648,7 +5745,7 @@ Also takes every attribute of `<div>` – without `children`, `defaultValue`, `o
5648
5745
 
5649
5746
  #### Known limits
5650
5747
 
5651
- - Two panes per splitter, no more. Tiles are not arranged by the user ([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)).
5748
+ - 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)).
5652
5749
  - It does not remember the share beyond its own life; keep it in the user's settings through `value` and `onChange`.
5653
5750
 
5654
5751
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
@@ -11703,7 +11800,7 @@ Nothing that must be read goes in a toast: whoever looked elsewhere has missed i
11703
11800
 
11704
11801
  Several toasts stand as a deck: the newest in front, a count on it, two edges behind it. It opens under the pointer, on the count, with the focus inside it, or with Alt+T; Escape gives the focus back.
11705
11802
 
11706
- At most three stand at once (`toast.limit` in the [UmrissProvider](#/umrissprovider)); the oldest gives way to a new one, as if closed.
11803
+ At most three that leave by themselves stand at once (`toast.limit` in the [UmrissProvider](#/umrissprovider)); the oldest of them gives way to a new one, as if closed. A toast with `duration: 0` and a `loading` toast never give way and do not count.
11707
11804
 
11708
11805
  #### Examples
11709
11806
 
@@ -11712,7 +11809,7 @@ At most three stand at once (`toast.limit` in the [UmrissProvider](#/umrissprovi
11712
11809
  Call `toast()` from [`useToast`](#/api/useToast) with what has happened; a `ToastProvider` at the root of the application holds them.
11713
11810
 
11714
11811
  ```tsx
11715
- import { Button, ToastProvider, useToast } from "@umriss-ui/core";
11812
+ import { Button, useToast } from "@umriss-ui/core";
11716
11813
 
11717
11814
  function Content() {
11718
11815
  const { toast } = useToast();
@@ -11727,11 +11824,7 @@ function Content() {
11727
11824
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11728
11825
  one provider serves every screen. */
11729
11826
  export default function ShowAToast() {
11730
- return (
11731
- <ToastProvider>
11732
- <Content />
11733
- </ToastProvider>
11734
- );
11827
+ return <Content />;
11735
11828
  }
11736
11829
  ```
11737
11830
 
@@ -11740,7 +11833,7 @@ export default function ShowAToast() {
11740
11833
  The `tone` says how it turned out; a symbol and the words say the same, so the colour is never alone.
11741
11834
 
11742
11835
  ```tsx
11743
- import { Button, Stack, ToastProvider, useToast } from "@umriss-ui/core";
11836
+ import { Button, Stack, useToast } from "@umriss-ui/core";
11744
11837
 
11745
11838
  function Content() {
11746
11839
  const { toast } = useToast();
@@ -11763,11 +11856,7 @@ function Content() {
11763
11856
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11764
11857
  one provider serves every screen. */
11765
11858
  export default function Tones() {
11766
- return (
11767
- <ToastProvider>
11768
- <Content />
11769
- </ToastProvider>
11770
- );
11859
+ return <Content />;
11771
11860
  }
11772
11861
  ```
11773
11862
 
@@ -11777,7 +11866,7 @@ One `action` reverses what just happened; `onClose` says whether the time ran ou
11777
11866
 
11778
11867
  ```tsx
11779
11868
  import { useState } from "react";
11780
- import { Button, Stack, Text, ToastProvider, useToast } from "@umriss-ui/core";
11869
+ import { Button, Stack, Text, useToast } from "@umriss-ui/core";
11781
11870
  import type { ToastCloseReason } from "@umriss-ui/core";
11782
11871
 
11783
11872
  const BOOKINGS = ["Room 2.14 · Tue 10:00 · Design review", "Room 3.02 · Tue 14:00 · Quarterly planning", "Room 1.05 · Wed 09:30 · Onboarding"];
@@ -11828,11 +11917,7 @@ function Content() {
11828
11917
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11829
11918
  one provider serves every screen. */
11830
11919
  export default function Undo() {
11831
- return (
11832
- <ToastProvider>
11833
- <Content />
11834
- </ToastProvider>
11835
- );
11920
+ return <Content />;
11836
11921
  }
11837
11922
  ```
11838
11923
 
@@ -11841,7 +11926,7 @@ export default function Undo() {
11841
11926
  `duration: 0` keeps a toast until the reader closes it – for the rare message whose loss costs something.
11842
11927
 
11843
11928
  ```tsx
11844
- import { Button, ToastProvider, useToast } from "@umriss-ui/core";
11929
+ import { Button, useToast } from "@umriss-ui/core";
11845
11930
 
11846
11931
  function Content() {
11847
11932
  const { toast } = useToast();
@@ -11865,11 +11950,7 @@ function Content() {
11865
11950
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11866
11951
  one provider serves every screen. */
11867
11952
  export default function UntilClosed() {
11868
- return (
11869
- <ToastProvider>
11870
- <Content />
11871
- </ToastProvider>
11872
- );
11953
+ return <Content />;
11873
11954
  }
11874
11955
  ```
11875
11956
 
@@ -11879,7 +11960,7 @@ A `loading` toast shows a spinner, has no close button and does not leave by its
11879
11960
 
11880
11961
  ```tsx
11881
11962
  import { useEffect, useRef, useState } from "react";
11882
- import { Button, Stack, Switch, ToastProvider, useToast } from "@umriss-ui/core";
11963
+ import { Button, Stack, Switch, useToast } from "@umriss-ui/core";
11883
11964
 
11884
11965
  function Content() {
11885
11966
  const { toast, update } = useToast();
@@ -11921,11 +12002,7 @@ function Content() {
11921
12002
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11922
12003
  one provider serves every screen. */
11923
12004
  export default function SaveWithLoading() {
11924
- return (
11925
- <ToastProvider>
11926
- <Content />
11927
- </ToastProvider>
11928
- );
12005
+ return <Content />;
11929
12006
  }
11930
12007
  ```
11931
12008
 
@@ -11935,7 +12012,7 @@ The row changes where the reader looks; the toast confirms it in passing, so a s
11935
12012
 
11936
12013
  ```tsx
11937
12014
  import { useState } from "react";
11938
- import { Badge, Button, Stack, Text, ToastProvider, useToast } from "@umriss-ui/core";
12015
+ import { Badge, Button, Stack, Text, useToast } from "@umriss-ui/core";
11939
12016
 
11940
12017
  const INVOICES = [
11941
12018
  { id: "INV-26-0318", supplier: "Brandlow Office Supply", amount: "€ 1,965.84" },
@@ -11984,11 +12061,7 @@ function Content() {
11984
12061
  /* `useToast` needs a `ToastProvider` above it; at the root of an application
11985
12062
  one provider serves every screen. */
11986
12063
  export default function AfterAnAction() {
11987
- return (
11988
- <ToastProvider>
11989
- <Content />
11990
- </ToastProvider>
11991
- );
12064
+ return <Content />;
11992
12065
  }
11993
12066
  ```
11994
12067
 
@@ -12047,20 +12120,23 @@ export default function WhereTheyStand() {
12047
12120
 
12048
12121
  ##### How many stand at once
12049
12122
 
12050
- `toast.limit` in the `UmrissProvider` caps the deck: here two stand, and each new toast pushes out the oldest as if it had been closed. Scan four parcels in a row and only the last two remain.
12123
+ `toast.limit` in the `UmrissProvider` caps the toasts that leave by themselves: here two stand, and each new one pushes out the oldest of them as if it had been closed. Scan four parcels in a row and only the last two remain.
12051
12124
 
12052
12125
  ```tsx
12053
12126
  import { Button, ToastProvider, UmrissProvider, useToast, type ToastConfig } from "@umriss-ui/core";
12054
12127
 
12128
+ type ToastFn = ReturnType<typeof useToast>["toast"];
12129
+
12055
12130
  const PARCELS = ["FP-2081", "FP-2082", "FP-2083", "FP-2084"];
12056
12131
 
12132
+ function scan(toast: ToastFn) {
12133
+ PARCELS.forEach((parcel) => toast({ title: `Parcel ${parcel} scanned`, description: "Loaded onto tour T-03.", tone: "success" }));
12134
+ }
12135
+
12057
12136
  function ScanButton() {
12058
12137
  const { toast } = useToast();
12059
12138
  return (
12060
- <Button
12061
- variant="primary"
12062
- onClick={() => PARCELS.forEach((parcel) => toast({ title: `Parcel ${parcel} scanned`, description: "Loaded onto tour T-03.", tone: "success" }))}
12063
- >
12139
+ <Button variant="primary" onClick={() => scan(toast)}>
12064
12140
  Scan four parcels
12065
12141
  </Button>
12066
12142
  );
@@ -12087,7 +12163,7 @@ A toast stands above an open modal dialog and can be pressed there: the dialog's
12087
12163
 
12088
12164
  ```tsx
12089
12165
  import { useState } from "react";
12090
- import { Button, FormField, Input, Modal, ModalBody, ModalFooter, ModalHeader, Select, Text, ToastProvider, Tooltip, useToast } from "@umriss-ui/core";
12166
+ import { Button, FormField, Input, Modal, ModalBody, ModalFooter, ModalHeader, Select, Text, Tooltip, useToast } from "@umriss-ui/core";
12091
12167
 
12092
12168
  function Content() {
12093
12169
  const { toast } = useToast();
@@ -12141,11 +12217,7 @@ function Content() {
12141
12217
  }
12142
12218
 
12143
12219
  export default function InsideAModal() {
12144
- return (
12145
- <ToastProvider>
12146
- <Content />
12147
- </ToastProvider>
12148
- );
12220
+ return <Content />;
12149
12221
  }
12150
12222
  ```
12151
12223
 
@@ -12258,7 +12330,8 @@ type ToastCloseReason = "timeout" | "dismiss" | "action";
12258
12330
 
12259
12331
  - One action at most, and never the only way to what it offers: the toast leaves by itself. What needs a decision needs an [Alert](#/alert) or a [ConfirmDialog](#/confirmdialog).
12260
12332
  - One position for the whole application, set in the [UmrissProvider](#/umrissprovider); none per toast.
12261
- - No queue: a toast over the limit pushes the oldest out rather than waiting.
12333
+ - One `ToastProvider` per application, at its root. A second one in the same document draws a second deck at the same place and the two lie on each other; in development it is reported on the console.
12334
+ - 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.
12262
12335
  - 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.
12263
12336
 
12264
12337
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
@@ -18742,8 +18815,9 @@ Used on [Scenarios](#/), [Sizes](#/sizes), [Textarea](#/textarea) and [CommandPa
18742
18815
  ##### `ToastProvider`
18743
18816
 
18744
18817
  Holds the toasts and draws them; [`useToast`](#/api/useToast) works only below it. Put it
18745
- once at the root of the application. Duration, position and limit come from
18746
- `UmrissProvider`'s `toast` where one stands around it.
18818
+ once at the root of the application: a second one draws a second deck at
18819
+ the same place, and the two lie on each other. Duration, position and limit
18820
+ come from `UmrissProvider`'s `toast` where one stands around it.
18747
18821
 
18748
18822
  ```ts
18749
18823
  function ToastProvider({ children, held }: ToastProviderProps): import("react").JSX.Element;
@@ -19955,7 +20029,7 @@ The props of `ToastProvider`.
19955
20029
 
19956
20030
  | Prop | Type | Default | Description |
19957
20031
  |---|---|---|---|
19958
- | `children` *required* | `ReactNode` | — | <br>Shown in: [At the root (UmrissProvider)](#/umrissprovider/at-the-root), [Set up an application (UmrissProvider)](#/umrissprovider/everything-at-once), [Show a toast (Toast)](#/toast/show-a-toast) and 13 more |
20032
+ | `children` *required* | `ReactNode` | — | <br>Shown in: [Resolve an incident (Scenarios)](#/scenarios/resolve-an-incident), [Approve spending against a budget (Scenarios)](#/scenarios/approve-spending), [Set up a team (Scenarios)](#/scenarios/set-up-a-team) |
19959
20033
  | `held` | `boolean` | `false` | While true, the toasts are held back: none is seen or heard, no time runs out, and a new one waits. When false again they come back with the time they had left. For a surface the toasts must not cover for a while, where there is no room beside it: nothing is lost, as it would be by dismissing.<br>Shown in: [Hold the toasts (Toast)](#/toast/hold-the-toasts) |
19960
20034
 
19961
20035
  ##### `ToastTone`
@@ -20365,6 +20439,49 @@ Everything the library puts out as text.
20365
20439
  | `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
20366
20440
  | `scheduleSummary` *required* | `(summary: { lanes: number; subtasks: number; from: string; to: string; overlaps: number; violated: number; /** Subtasks in blocked time; said only where there are any. */ blocked: number; /** Milestones of the plan; said only where there are any. */ milestones: number; }) => string` | — | The plot's description (S6): the lanes, the subtasks in view, the visible span with both ends formatted, and the findings of the plan by kind. |
20367
20441
  | `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
20442
+ | `dashboardEdit` *required* | `string` | — | The editing bar's buttons and the label that says the mode is on. |
20443
+ | `dashboardEditing` *required* | `string` | — | |
20444
+ | `dashboardCancel` *required* | `string` | — | |
20445
+ | `dashboardDone` *required* | `string` | — | |
20446
+ | `dashboardUndo` *required* | `string` | — | |
20447
+ | `dashboardRedo` *required* | `string` | — | |
20448
+ | `dashboardReset` *required* | `string` | — | |
20449
+ | `dashboardMenu` *required* | `(title: string) => string` | — | The name of a widget's menu button: the widget's title is the thing. |
20450
+ | `dashboardPlace` *required* | `(place: number, of: number) => string` | — | At the top of the menu, and in the name of a head the arrow keys move. |
20451
+ | `dashboardHead` *required* | `(title: string, place: number, of: number) => string` | — | |
20452
+ | `dashboardMoveStart` *required* | `string` | — | |
20453
+ | `dashboardMoveEarlier` *required* | `string` | — | |
20454
+ | `dashboardMoveLater` *required* | `string` | — | |
20455
+ | `dashboardMoveEnd` *required* | `string` | — | |
20456
+ | `dashboardRemove` *required* | `string` | — | |
20457
+ | `dashboardSizes` *required* | `{ small: string; medium: string; wide: string; tall: string; large: string; full: string }` | — | The closed set of size names, worded once for every widget type. |
20458
+ | `dashboardSizeEntry` *required* | `(size: string, share: string, current: boolean) => string` | — | A size's entry in a widget's menu: its name and its share of the width (`share` is "¼" or "5/12", empty for the whole width); `current` marks the size the widget stands at. |
20459
+ | `dashboardHeadingLabel` *required* | `string` | — | The built-in heading type: its name, its sentence in the catalogue, the text a new heading starts with and the label of its text field. |
20460
+ | `dashboardHeadingSentence` *required* | `string` | — | |
20461
+ | `dashboardHeadingText` *required* | `string` | — | |
20462
+ | `dashboardHeadingField` *required* | `string` | — | |
20463
+ | `dashboardLeft` *required* | `string` | — | Said when "Done" leaves the mode and nothing was changed. |
20464
+ | `dashboardMoved` *required* | `(title: string, from: number, to: number, of: number) => string` | — | What is spoken after a change. |
20465
+ | `dashboardDragCancelled` *required* | `(title: string) => string` | — | |
20466
+ | `dashboardResized` *required* | `(title: string, size: string) => string` | — | |
20467
+ | `dashboardRemoved` *required* | `(title: string) => string` | — | |
20468
+ | `dashboardKept` *required* | `string` | — | |
20469
+ | `dashboardCancelled` *required* | `string` | — | |
20470
+ | `dashboardAddWidget` *required* | `string` | — | The catalogue and the options. |
20471
+ | `dashboardCatalogue` *required* | `string` | — | |
20472
+ | `dashboardCatalogueSentence` *required* | `string` | — | |
20473
+ | `dashboardAdd` *required* | `string` | — | |
20474
+ | `dashboardAddType` *required* | `(label: string) => string` | — | |
20475
+ | `dashboardFootprint` *required* | `(columns: number, rows: number) => string` | — | |
20476
+ | `dashboardAdded` *required* | `(title: string, place: number, of: number) => string` | — | |
20477
+ | `dashboardOptions` *required* | `string` | — | |
20478
+ | `dashboardOptionsChanged` *required* | `(title: string) => string` | — | |
20479
+ | `dashboardEmpty` *required* | `string` | — | |
20480
+ | `dashboardEmptyEditing` *required* | `string` | — | |
20481
+ | `dashboardFailed` *required* | `string` | — | |
20482
+ | `dashboardUndone` *required* | `string` | — | |
20483
+ | `dashboardRedone` *required* | `string` | — | |
20484
+ | `dashboardResetDone` *required* | `string` | — | |
20368
20485
  | `calculationSumSymbol` *required* | `string` | — | The four operators as symbols in a formula line. |
20369
20486
  | `calculationDifferenceSymbol` *required* | `string` | — | |
20370
20487
  | `calculationProductSymbol` *required* | `string` | — | |
@@ -20435,8 +20552,8 @@ Used on [UmrissProvider](#/umrissprovider) and [Language](#/language).
20435
20552
 
20436
20553
  | Prop | Type | Default | Description |
20437
20554
  |---|---|---|---|
20438
- | `toast` *required* | `(options: `[`ToastOptions`](#/toast/type-ToastOptions)`) => number` | — | Shows a toast and returns its id.<br>Shown in: [At the root (UmrissProvider)](#/umrissprovider/at-the-root), [Set up an application (UmrissProvider)](#/umrissprovider/everything-at-once), [Show a toast (Toast)](#/toast/show-a-toast) and 13 more |
20439
- | `update` *required* | `(id: number, options: Partial<`[`ToastOptions`](#/toast/type-ToastOptions)`>) => void` | — | Changes a standing toast. A new tone or a new `duration` starts its time afresh - so a `loading` toast turned into `success` begins to count then. An id that no longer stands is ignored: a toast that gave way to newer ones - a `loading` one too - has said so through `onClose`.<br>Shown in: [Save, and say how it went (Toast)](#/toast/save-with-loading) |
20555
+ | `toast` *required* | `(options: `[`ToastOptions`](#/toast/type-ToastOptions)`) => number` | — | Shows a toast and returns its id.<br>Shown in: [Show a toast (Toast)](#/toast/show-a-toast), [Tones (Toast)](#/toast/tones), [Undo (Toast)](#/toast/undo) and 10 more |
20556
+ | `update` *required* | `(id: number, options: Partial<`[`ToastOptions`](#/toast/type-ToastOptions)`>) => void` | — | Changes a standing toast. A new tone or a new `duration` starts its time afresh - so a `loading` toast turned into `success` begins to count then. An id that no longer stands is ignored: a timed toast that gave way to newer ones has said so through `onClose`. A `loading` toast turned into its outcome counts toward the limit from the next arrival on; `update` itself pushes nothing out.<br>Shown in: [Save, and say how it went (Toast)](#/toast/save-with-loading) |
20440
20557
  | `dismiss` *required* | `(id: number) => void` | — | Closes a toast, with the reason `dismiss`. |
20441
20558
 
20442
20559
  ##### `Instant`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/core",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "React component library for data-dense dashboards and tools - forms, date pickers, overlays, a tree view and a command palette. Precise, quiet, professional.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",