@umriss-ui/core 0.35.0 → 0.36.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/dist/index.d.ts CHANGED
@@ -2386,11 +2386,13 @@ export declare interface UmrissProviderProps {
2386
2386
  */
2387
2387
  density?: Density;
2388
2388
  /**
2389
- * Where overlays portal to. A function is evaluated on every opening - a
2390
- * target that only enters the tree later cannot be given otherwise; `null`
2391
- * means "as before". The callers' own rules take precedence: the popover
2392
- * seam portals into the nearest `<dialog>` ancestor, because a portal at the
2393
- * body does not reach the top layer.
2389
+ * Where overlays portal to, unless an open dialog takes them. A function is
2390
+ * evaluated on every opening - a target that only enters the tree later
2391
+ * cannot be given otherwise; `null` means "as before".
2392
+ * The callers' own rules take precedence: the popover seam portals into the
2393
+ * nearest `<dialog>` ancestor, because a portal at the body does not reach
2394
+ * the top layer, and the toasts follow the topmost modal dialog, because a
2395
+ * toast outside it lies behind it and is inert.
2394
2396
  */
2395
2397
  portalTarget?: PortalTarget;
2396
2398
  /** The setting for toasts: the display duration where the individual toast
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/core 0.35.0
1
+ # @umriss-ui/core 0.36.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
 
@@ -2572,6 +2572,10 @@ export default function EverythingAtOnce() {
2572
2572
 
2573
2573
  The keys of [Button](#/button/keyboard-button), [Menu](#/menu/keyboard-menu) and [DatePicker](#/datepicker/keyboard-datepicker) apply here.
2574
2574
 
2575
+ #### Accessibility
2576
+
2577
+ Where a `ToastProvider` stands inside it, the toasts' two live regions stand where the overlays go: in the `portalTarget` before the first message, so that it is heard there, and inside the topmost modal dialog while one is open. [Toast](#/toast) describes them.
2578
+
2575
2579
  #### API
2576
2580
 
2577
2581
  ##### `UmrissProviderProps`
@@ -2579,7 +2583,7 @@ The keys of [Button](#/button/keyboard-button), [Menu](#/menu/keyboard-menu) and
2579
2583
  | Prop | Type | Default | Description |
2580
2584
  |---|---|---|---|
2581
2585
  | `density` | [`Density`](#type-Density)<br>`"comfortable" \| "compact"` | none - a component keeps its own density | The default for the `density` of every component that reads it with `useDensityFor` - in `@umriss-ui/table` `Table`, in `@umriss-ui/calculation` `Calculation` ("comfortable" means "regular").<br>Shown in: [Set up an application](#/umrissprovider/everything-at-once) |
2582
- | `portalTarget` | [`PortalTarget`](#type-PortalTarget) | `null` | Where overlays portal to. 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.<br>Shown in: [Open overlays inside a full-screen panel](#/umrissprovider/portal-target), [Set up an application](#/umrissprovider/everything-at-once) |
2586
+ | `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) |
2583
2587
  | `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 |
2584
2588
  | `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) |
2585
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 |
@@ -2981,7 +2985,7 @@ Continuous process. A spinner or a shimmer has no start and no end; it runs stea
2981
2985
 
2982
2986
  ##### Stacking order
2983
2987
 
2984
- Popovers portal into the nearest <dialog> ancestor, and this scale orders the rest.
2988
+ Popovers portal into the nearest <dialog> ancestor, and this scale orders the rest. The toasts also move into the topmost modal dialog. Inside a dialog the toasts and the tooltips stand in the top layer, which orders by the moment of showing and not by these numbers: a tooltip is shown after the toasts and lies above them, as the scale has it; popovers stay under the toasts.
2985
2989
 
2986
2990
  | Token | Light | Dark | Description |
2987
2991
  |---|---|---|---|
@@ -3100,7 +3104,7 @@ From `BadgeProps` — the full table stands on [Badge](#/badge/type-BadgeProps).
3100
3104
 
3101
3105
  - No theme object, no theme provider and no theme switch: a theme is a set of token overrides in your stylesheet, the mode is the page's `color-scheme` ([ADR-0021](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0021-the-styles-load-themselves-and-touch-nothing-else.md)).
3102
3106
  - 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.
3103
- - 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. Give [UmrissProvider](#/umrissprovider) a `portalTarget` inside the region, or override on `:root` - as for the toasts' distance from the window's edge, `--u-toast-inset-top` and `--u-toast-inset-bottom`.
3107
+ - 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, `--u-toast-inset-top` and `--u-toast-inset-bottom`.
3104
3108
 
3105
3109
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
3106
3110
 
@@ -6004,9 +6008,9 @@ export default function IncidentSummary() {
6004
6008
  | Prop | Type | Default | Description |
6005
6009
  |---|---|---|---|
6006
6010
  | `as` | `ElementType` | `"p"` | Element to render as.<br>Shown in: [Tones and weights](#/typography/tones-and-weights), [Set an incident summary](#/typography/incident-summary), [Use the language in your own components (Language)](#/language/own-components) and 17 more |
6007
- | `size` | [`TextSize`](#type-TextSize)<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` | Type size from the token set. It is independent of the element: a `p` may be small without becoming a different element.<br>Shown in: [Configurator](#/typography/configurator-typography), [Sizes](#/typography/sizes), [Tones and weights](#/typography/tones-and-weights) and 128 more |
6011
+ | `size` | [`TextSize`](#type-TextSize)<br>`"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` | Type size from the token set. It is independent of the element: a `p` may be small without becoming a different element.<br>Shown in: [Configurator](#/typography/configurator-typography), [Sizes](#/typography/sizes), [Tones and weights](#/typography/tones-and-weights) and 129 more |
6008
6012
  | `weight` | [`TextWeight`](#type-TextWeight)<br>`"regular" \| "medium" \| "semibold"` | `"regular"` | Font weight from the token set.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tones and weights](#/typography/tones-and-weights), [Tracking and leading](#/typography/tracking-and-leading) and 15 more |
6009
- | `tone` | [`TextTone`](#type-TextTone)<br>`"default" \| "secondary" \| "muted"` | `"default"` | How loud the text is. `secondary` and `muted` step back without falling below the contrast threshold.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tones and weights](#/typography/tones-and-weights), [Tracking and leading](#/typography/tracking-and-leading) and 93 more |
6013
+ | `tone` | [`TextTone`](#type-TextTone)<br>`"default" \| "secondary" \| "muted"` | `"default"` | How loud the text is. `secondary` and `muted` step back without falling below the contrast threshold.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tones and weights](#/typography/tones-and-weights), [Tracking and leading](#/typography/tracking-and-leading) and 94 more |
6010
6014
  | `mono` | `boolean` | `false` | Geist Mono with tabular figures – for numbers and identifiers.<br>Shown in: [Configurator](#/typography/configurator-typography), [Numbers and identifiers](#/typography/numbers), [Handle long values](#/typography/long-values) and 31 more |
6011
6015
  | `tracking` | [`TextTracking`](#type-TextTracking)<br>`"normal" \| "tight" \| "display" \| "caps"` | `"normal"` | Letter spacing from the token set. `caps` belongs with letterspaced capitals.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tracking and leading](#/typography/tracking-and-leading), [Set an incident summary](#/typography/incident-summary) |
6012
6016
  | `leading` | [`TextLeading`](#type-TextLeading)<br>`"normal" \| "tight"` | `"normal"` | Line spacing. `tight` for multi-line headings and key figures, where the normal spacing lets the lines fall apart.<br>Shown in: [Configurator](#/typography/configurator-typography), [Tracking and leading](#/typography/tracking-and-leading) |
@@ -6499,8 +6503,8 @@ Under forced colours every variant keeps an outline where its edge would lie, an
6499
6503
 
6500
6504
  | Prop | Type | Default | Description |
6501
6505
  |---|---|---|---|
6502
- | `variant` | [`ButtonVariant`](#type-ButtonVariant)<br>`"primary" \| "secondary" \| "ghost" \| "plain" \| "danger"` | `"secondary"` | How loud the button is. `primary` exactly once per surface - two main actions side by side are no longer a main action. `ghost` is quiet in the accent, `plain` quiet and neutral.<br>Shown in: [Configurator](#/button/configurator-button), [Variants](#/button/variants), [Sizes](#/button/sizes) and 51 more |
6503
- | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise.<br>Shown in: [Configurator](#/button/configurator-button), [Sizes](#/button/sizes), [Add an icon](#/button/with-an-icon) and 56 more |
6506
+ | `variant` | [`ButtonVariant`](#type-ButtonVariant)<br>`"primary" \| "secondary" \| "ghost" \| "plain" \| "danger"` | `"secondary"` | How loud the button is. `primary` exactly once per surface - two main actions side by side are no longer a main action. `ghost` is quiet in the accent, `plain` quiet and neutral.<br>Shown in: [Configurator](#/button/configurator-button), [Variants](#/button/variants), [Sizes](#/button/sizes) and 52 more |
6507
+ | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise.<br>Shown in: [Configurator](#/button/configurator-button), [Sizes](#/button/sizes), [Add an icon](#/button/with-an-icon) and 57 more |
6504
6508
  | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button.<br>Shown in: [Configurator](#/button/configurator-button), [Loading and disabled](#/button/loading-and-disabled), [Submit a form](#/button/submit-a-form) and 4 more |
6505
6509
  | `ref` | `Ref<HTMLButtonElement>` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#/sizes/a-row-that-holds-still), [An anchored surface (Popover)](#/popover/anchored-surface), [Take the width of the trigger (Popover)](#/popover/width-from-anchor) and 2 more |
6506
6510
 
@@ -6853,7 +6857,7 @@ export default function Toolbar() {
6853
6857
  |---|---|---|---|
6854
6858
  | `children` *required* | `ReactNode` | — | The icon: an SVG, a glyph of the set or an icon font's element. The button sets its size - `--u-icon-size`, `--u-icon-size-sm` at `sm`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Name the icon](#/iconbutton/name-the-icon), [Variants](#/iconbutton/variants) and 5 more |
6855
6859
  | `variant` | [`ButtonVariant`](#type-ButtonVariant)<br>`"primary" \| "secondary" \| "ghost" \| "plain" \| "danger"` | `"plain"` | How loud the button is; `plain` is quiet and neutral, and the rest mean what they mean on a `Button`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Variants](#/iconbutton/variants), [Sizes](#/iconbutton/sizes) and 3 more |
6856
- | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Sizes](#/iconbutton/sizes), [Build a toolbar](#/iconbutton/a-toolbar) and 56 more |
6860
+ | `size` | [`ButtonSize`](#type-ButtonSize)<br>`"sm" \| "md"` | the size of a `ControlSizeProvider` around it, else `"md"` | `sm` for buttons in header bars and table rows, `md` otherwise. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Sizes](#/iconbutton/sizes), [Build a toolbar](#/iconbutton/a-toolbar) and 57 more |
6857
6861
  | `loading` | `boolean` | `false` | Shows a loading indicator and locks the button. From `ButtonProps`.<br>Shown in: [Configurator](#/iconbutton/configurator-iconbutton), [Loading and disabled](#/iconbutton/loading-and-disabled), [Configurator (Button)](#/button/configurator-button) and 4 more |
6858
6862
  | `ref` | `Ref<HTMLButtonElement>` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#/sizes/a-row-that-holds-still), [An anchored surface (Popover)](#/popover/anchored-surface), [Take the width of the trigger (Popover)](#/popover/width-from-anchor) and 2 more |
6859
6863
 
@@ -7728,7 +7732,7 @@ The keys of [Input](#/input/keyboard-input), [NumberInput](#/numberinput/keyboar
7728
7732
 
7729
7733
  | Prop | Type | Default | Description |
7730
7734
  |---|---|---|---|
7731
- | `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 76 more |
7735
+ | `label` *required* | `ReactNode` | — | The label of the field. It is mandatory: a field without a name is a field without a question for a screen reader.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 77 more |
7732
7736
  | `hint` | `ReactNode` | — | Help text below the field. Replaced by `error`.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Label and hint](#/formfield/label-and-hint), [Show an error](#/formfield/show-an-error) and 33 more |
7733
7737
  | `error` | `ReactNode` | — | Error message; it marks the field as invalid at the same time.<br>Shown in: [Configurator](#/formfield/configurator-formfield), [Show an error](#/formfield/show-an-error), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 22 more |
7734
7738
  | `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/configurator-formfield), [Mark a field as required](#/formfield/mark-a-field-as-required), [Check an invoice on submit](#/formfield/check-an-invoice-on-submit) and 9 more |
@@ -11684,6 +11688,8 @@ Demo page: https://romanhaendler.github.io/umriss-ui/core/toast/
11684
11688
 
11685
11689
  [`useToast`](#/api/useToast) needs a `ToastProvider` around the application, once, at the root.
11686
11690
 
11691
+ Toasts stand above an open modal dialog and can be used there: they are seen, pressed and heard, and stay where they were while a dialog opens or closes.
11692
+
11687
11693
  A toast stays five seconds by default. Its clock stops while the deck is open – under the pointer, with the focus inside it – and runs on with the time that was left.
11688
11694
 
11689
11695
  The title says what has happened, in about one line: “Invoice not sent”. Why, and what to do next, go in the description.
@@ -12070,6 +12076,74 @@ export default function HowManyStand() {
12070
12076
  }
12071
12077
  ```
12072
12078
 
12079
+ ##### Inside a modal
12080
+
12081
+ A toast stands above an open modal dialog and can be pressed there: the dialog's "Save" fails, and the toast carries "Retry" next to the form it belongs to.
12082
+
12083
+ ```tsx
12084
+ import { useState } from "react";
12085
+ import { Button, FormField, Input, Modal, ModalBody, ModalFooter, ModalHeader, Select, Text, ToastProvider, Tooltip, useToast } from "@umriss-ui/core";
12086
+
12087
+ function Content() {
12088
+ const { toast } = useToast();
12089
+ const [open, setOpen] = useState(false);
12090
+
12091
+ const save = () =>
12092
+ toast({
12093
+ title: "Profile not saved",
12094
+ description: "The server did not answer.",
12095
+ tone: "danger",
12096
+ /* A failure stays until it is read. */
12097
+ duration: 0,
12098
+ action: { label: "Retry", onClick: save },
12099
+ });
12100
+
12101
+ return (
12102
+ <>
12103
+ <Button onClick={() => setOpen(true)}>Edit the profile</Button>
12104
+ <Modal open={open} onClose={() => setOpen(false)} size="sm">
12105
+ <ModalHeader title="Edit the profile" description="Changes are saved to the account." />
12106
+ <ModalBody>
12107
+ <FormField label="Display name">
12108
+ <Input defaultValue="Maya Lindgren" />
12109
+ </FormField>
12110
+ <FormField label="Language">
12111
+ <Select defaultValue="en">
12112
+ <option value="en">English</option>
12113
+ <option value="de">Deutsch</option>
12114
+ <option value="fr">Français</option>
12115
+ <option value="es">Español</option>
12116
+ </Select>
12117
+ </FormField>
12118
+ <Tooltip content="Shows the profile as colleagues see it.">
12119
+ <Button size="sm" variant="secondary">
12120
+ Preview
12121
+ </Button>
12122
+ </Tooltip>
12123
+ <Text size="xs" tone="muted">
12124
+ Nothing is kept until it is saved.
12125
+ </Text>
12126
+ </ModalBody>
12127
+ <ModalFooter>
12128
+ <Button onClick={() => setOpen(false)}>Cancel</Button>
12129
+ <Button variant="primary" onClick={save}>
12130
+ Save
12131
+ </Button>
12132
+ </ModalFooter>
12133
+ </Modal>
12134
+ </>
12135
+ );
12136
+ }
12137
+
12138
+ export default function InsideAModal() {
12139
+ return (
12140
+ <ToastProvider>
12141
+ <Content />
12142
+ </ToastProvider>
12143
+ );
12144
+ }
12145
+ ```
12146
+
12073
12147
  #### When to use something else
12074
12148
 
12075
12149
  - The reader must see it, or it stays true until something is done → Alert
@@ -12094,17 +12168,19 @@ The count on a deck of several is out of the tab order, since a focus on it woul
12094
12168
 
12095
12169
  With reduced motion toasts appear, stack and leave without movement.
12096
12170
 
12171
+ Inside a modal dialog the live regions move with the toasts, so a message is heard there as well as outside.
12172
+
12097
12173
  #### API
12098
12174
 
12099
12175
  ##### `ToastOptions`
12100
12176
 
12101
12177
  | Prop | Type | Default | Description |
12102
12178
  |---|---|---|---|
12103
- | `title` *required* | `string` | — | What has happened – short, about one line (some 45 characters), in the perfect tense and not a request: "Invoice not sent". Why, and what to do next, belong in the description. A longer title wraps; it is never cut.<br>Shown in: [Show a toast](#/toast/show-a-toast), [Tones](#/toast/tones), [Undo](#/toast/undo) and 11 more |
12104
- | `description` | `string` | — | One more sentence where the title alone is too little. Nothing the reader MUST read: the toast goes away by itself.<br>Shown in: [Show a toast](#/toast/show-a-toast), [Tones](#/toast/tones), [Undo](#/toast/undo) and 9 more |
12105
- | `tone` | [`ToastTone`](#type-ToastTone)<br>`"neutral" \| "success" \| "warning" \| "danger" \| "loading"` | — | How the message turns out. The tone is never the only information – the glyph beside it and the text say the same thing once more. `loading` shows a spinner, has no close button and does not leave by itself: turn it into its outcome with `update`.<br>Shown in: [Tones](#/toast/tones), [Keep it until it is closed](#/toast/until-closed), [Save, and say how it went](#/toast/save-with-loading) and 8 more |
12106
- | `duration` | `number` | the provider's `duration`, else `5000` | Display duration in ms; 0 = stays until closed by hand.<br>Shown in: [Keep it until it is closed](#/toast/until-closed) |
12107
- | `action` | [`ToastAction`](#type-ToastAction) | — | One action - "Undo". Never the only way to do what it offers: the toast leaves by itself, and not everybody reaches it in time. More than one action is a dialog.<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading) |
12179
+ | `title` *required* | `string` | — | What has happened – short, about one line (some 45 characters), in the perfect tense and not a request: "Invoice not sent". Why, and what to do next, belong in the description. A longer title wraps; it is never cut.<br>Shown in: [Show a toast](#/toast/show-a-toast), [Tones](#/toast/tones), [Undo](#/toast/undo) and 12 more |
12180
+ | `description` | `string` | — | One more sentence where the title alone is too little. Nothing the reader MUST read: the toast goes away by itself.<br>Shown in: [Show a toast](#/toast/show-a-toast), [Tones](#/toast/tones), [Undo](#/toast/undo) and 10 more |
12181
+ | `tone` | [`ToastTone`](#type-ToastTone)<br>`"neutral" \| "success" \| "warning" \| "danger" \| "loading"` | — | How the message turns out. The tone is never the only information – the glyph beside it and the text say the same thing once more. `loading` shows a spinner, has no close button and does not leave by itself: turn it into its outcome with `update`.<br>Shown in: [Tones](#/toast/tones), [Keep it until it is closed](#/toast/until-closed), [Save, and say how it went](#/toast/save-with-loading) and 9 more |
12182
+ | `duration` | `number` | the provider's `duration`, else `5000` | Display duration in ms; 0 = stays until closed by hand.<br>Shown in: [Keep it until it is closed](#/toast/until-closed), [Inside a modal](#/toast/inside-a-modal) |
12183
+ | `action` | [`ToastAction`](#type-ToastAction) | — | One action - "Undo". Never the only way to do what it offers: the toast leaves by itself, and not everybody reaches it in time. More than one action is a dialog.<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading), [Inside a modal](#/toast/inside-a-modal) |
12108
12184
 
12109
12185
  ###### Events
12110
12186
 
@@ -12116,13 +12192,13 @@ With reduced motion toasts appear, stack and leave without movement.
12116
12192
 
12117
12193
  | Prop | Type | Default | Description |
12118
12194
  |---|---|---|---|
12119
- | `label` *required* | `string` | — | A verb for what it does - "Undo", "Show".<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading) |
12195
+ | `label` *required* | `string` | — | A verb for what it does - "Undo", "Show".<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading), [Inside a modal](#/toast/inside-a-modal) |
12120
12196
 
12121
12197
  ###### Events
12122
12198
 
12123
12199
  | Prop | Type | Default | Description |
12124
12200
  |---|---|---|---|
12125
- | `onClick` *required* | `() => void` | — | Runs, and the toast goes with the reason `action`.<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading) |
12201
+ | `onClick` *required* | `() => void` | — | Runs, and the toast goes with the reason `action`.<br>Shown in: [Undo](#/toast/undo), [Save, and say how it went](#/toast/save-with-loading), [Inside a modal](#/toast/inside-a-modal) |
12126
12202
 
12127
12203
  ##### Types on this page
12128
12204
 
@@ -12148,6 +12224,7 @@ type ToastCloseReason = "timeout" | "dismiss" | "action";
12148
12224
  - 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).
12149
12225
  - One position for the whole application, set in the [UmrissProvider](#/umrissprovider); none per toast.
12150
12226
  - No queue: a toast over the limit pushes the oldest out rather than waiting.
12227
+ - 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.
12151
12228
 
12152
12229
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
12153
12230
 
@@ -12452,8 +12529,8 @@ export default function ACalculation() {
12452
12529
 
12453
12530
  | Prop | Type | Default | Description |
12454
12531
  |---|---|---|---|
12455
- | `content` *required* | `ReactNode` | — | Short help text; no interaction, no long content.<br>Shown in: [A tooltip](#/tooltip/a-tooltip), [Delay](#/tooltip/delay), [Explain an abbreviation](#/tooltip/an-abbreviation) and 1 more |
12456
- | `children` *required* | `ReactElement<Record<string, unknown>>` | — | Exactly one element that triggers the tooltip (must accept refs). Its own ref keeps its element: the tooltip holds the same one beside it.<br>Shown in: [A tooltip](#/tooltip/a-tooltip), [Delay](#/tooltip/delay), [Explain an abbreviation](#/tooltip/an-abbreviation) and 1 more |
12532
+ | `content` *required* | `ReactNode` | — | Short help text; no interaction, no long content.<br>Shown in: [A tooltip](#/tooltip/a-tooltip), [Delay](#/tooltip/delay), [Explain an abbreviation](#/tooltip/an-abbreviation) and 2 more |
12533
+ | `children` *required* | `ReactElement<Record<string, unknown>>` | — | Exactly one element that triggers the tooltip (must accept refs). Its own ref keeps its element: the tooltip holds the same one beside it.<br>Shown in: [A tooltip](#/tooltip/a-tooltip), [Delay](#/tooltip/delay), [Explain an abbreviation](#/tooltip/an-abbreviation) and 2 more |
12457
12534
  | `delay` | `number` | `300` | Delay in ms before the tooltip appears.<br>Shown in: [Delay](#/tooltip/delay) |
12458
12535
 
12459
12536
  #### Known limits
@@ -13424,8 +13501,8 @@ export default function MustBeAnswered() {
13424
13501
 
13425
13502
  | Prop | Type | Default | Description |
13426
13503
  |---|---|---|---|
13427
- | `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/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 9 more |
13428
- | `size` | [`ModalSize`](#type-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/sizes), [Scroll long content](#/modal/long-content), [Guard unsaved changes](#/modal/unsaved-changes) and 2 more |
13504
+ | `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/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 10 more |
13505
+ | `size` | [`ModalSize`](#type-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/sizes), [Scroll long content](#/modal/long-content), [Guard unsaved changes](#/modal/unsaved-changes) and 3 more |
13429
13506
  | `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop.<br>Shown in: [A window that must be answered](#/modal/must-be-answered) |
13430
13507
  | `ref` | `Ref<HTMLDialogElement>` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#/sizes/a-row-that-holds-still), [An anchored surface (Popover)](#/popover/anchored-surface), [Take the width of the trigger (Popover)](#/popover/width-from-anchor) and 2 more |
13431
13508
 
@@ -13433,7 +13510,7 @@ export default function MustBeAnswered() {
13433
13510
 
13434
13511
  | Prop | Type | Default | Description |
13435
13512
  |---|---|---|---|
13436
- | `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click.<br>Shown in: [A window that holds focus](#/modal/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 9 more |
13513
+ | `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click.<br>Shown in: [A window that holds focus](#/modal/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 10 more |
13437
13514
 
13438
13515
  Also takes every attribute of `<dialog>` – without `onClose`.
13439
13516
 
@@ -13441,8 +13518,8 @@ Also takes every attribute of `<dialog>` – without `onClose`.
13441
13518
 
13442
13519
  | Prop | Type | Default | Description |
13443
13520
  |---|---|---|---|
13444
- | `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/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 9 more |
13445
- | `description` | `ReactNode` | — | One sentence below the heading: what is to be decided here.<br>Shown in: [A window that holds focus](#/modal/a-window), [Scroll long content](#/modal/long-content), [Guard unsaved changes](#/modal/unsaved-changes) and 7 more |
13521
+ | `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/a-window), [Sizes](#/modal/sizes), [Scroll long content](#/modal/long-content) and 10 more |
13522
+ | `description` | `ReactNode` | — | One sentence below the heading: what is to be decided here.<br>Shown in: [A window that holds focus](#/modal/a-window), [Scroll long content](#/modal/long-content), [Guard unsaved changes](#/modal/unsaved-changes) and 8 more |
13446
13523
  | `hideClose` | `boolean` | `false` | Hides the close button.<br>Shown in: [A window that must be answered](#/modal/must-be-answered) |
13447
13524
  | `ref` | `Ref<HTMLDivElement>` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#/sizes/a-row-that-holds-still), [An anchored surface (Popover)](#/popover/anchored-surface), [Take the width of the trigger (Popover)](#/popover/width-from-anchor) and 2 more |
13448
13525
 
@@ -13762,7 +13839,7 @@ export default function BesideAServiceList() {
13762
13839
  | Prop | Type | Default | Description |
13763
13840
  |---|---|---|---|
13764
13841
  | `side` | `"right" \| "left"` | `"right"` | The edge the drawer stands at and enters from.<br>Shown in: [From the left, and wider](#/drawer/left-and-wider) |
13765
- | `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/a-detail-from-the-edge), [From the left, and wider](#/drawer/left-and-wider), [Open a service's detail from its list](#/drawer/beside-a-service-list) and 9 more |
13842
+ | `open` *required* | `boolean` | — | Whether the window stands. Controlled: the opening is the caller's decision, and only the caller knows whether something may be open. From `ModalProps`.<br>Shown in: [A detail from the edge](#/drawer/a-detail-from-the-edge), [From the left, and wider](#/drawer/left-and-wider), [Open a service's detail from its list](#/drawer/beside-a-service-list) and 10 more |
13766
13843
  | `closeOnBackdrop` | `boolean` | `true` | Closes on a click on the backdrop. From `ModalProps`.<br>Shown in: [A window that must be answered (Modal)](#/modal/must-be-answered) |
13767
13844
  | `ref` | `Ref<HTMLDialogElement>` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [A row that holds still (Sizes)](#/sizes/a-row-that-holds-still), [An anchored surface (Popover)](#/popover/anchored-surface), [Take the width of the trigger (Popover)](#/popover/width-from-anchor) and 2 more |
13768
13845
 
@@ -13770,7 +13847,7 @@ export default function BesideAServiceList() {
13770
13847
 
13771
13848
  | Prop | Type | Default | Description |
13772
13849
  |---|---|---|---|
13773
- | `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click. From `ModalProps`.<br>Shown in: [A detail from the edge](#/drawer/a-detail-from-the-edge), [From the left, and wider](#/drawer/left-and-wider), [Open a service's detail from its list](#/drawer/beside-a-service-list) and 9 more |
13850
+ | `onClose` *required* | `() => void` | — | Reports every wish to close – Escape, cross, backdrop click. From `ModalProps`.<br>Shown in: [A detail from the edge](#/drawer/a-detail-from-the-edge), [From the left, and wider](#/drawer/left-and-wider), [Open a service's detail from its list](#/drawer/beside-a-service-list) and 10 more |
13774
13851
 
13775
13852
  Also takes every attribute of `<dialog>` – without `onClose`.
13776
13853
 
@@ -18293,7 +18370,7 @@ Used on [Sizes](#/sizes) and [FileInput](#/fileinput).
18293
18370
 
18294
18371
  [FormField](#/formfield) – The frame around a field: its label, a hint below it and the error that replaces the hint. Wrap every field in one, so the question, the help and the problem are read out together.
18295
18372
 
18296
- Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Sizes](#/sizes), [Language](#/language), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [RadioGroup](#/radiogroup), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Alert](#/alert), [Modal](#/modal), [Breadcrumb](#/breadcrumb), [Accordion](#/accordion) and [TreeView](#/treeview).
18373
+ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider), [Sizes](#/sizes), [Language](#/language), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Textarea](#/textarea), [NumberInput](#/numberinput), [Slider](#/slider), [Checkbox](#/checkbox), [Switch](#/switch), [RadioGroup](#/radiogroup), [SegmentedControl](#/segmentedcontrol), [FileInput](#/fileinput), [Select](#/select), [Combobox](#/combobox), [MultiSelect](#/multiselect), [DatePicker](#/datepicker), [DateTimePicker](#/datetimepicker), [DateRangePicker](#/daterangepicker), [DateTimeRangePicker](#/datetimerangepicker), [Alert](#/alert), [Toast](#/toast), [Modal](#/modal), [Breadcrumb](#/breadcrumb), [Accordion](#/accordion) and [TreeView](#/treeview).
18297
18374
 
18298
18375
  ##### `FormFieldBoundary`
18299
18376
 
@@ -18353,7 +18430,7 @@ Used on [Button](#/button), [IconButton](#/iconbutton) and [Menu](#/menu).
18353
18430
 
18354
18431
  [Input](#/input) – A single line of text (text field, text box): names, references, addresses, search terms. Reach for it whenever the answer is short free text; for numbers take a [NumberInput](#/numberinput).
18355
18432
 
18356
- Used on [Sizes](#/sizes), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Alert](#/alert), [Modal](#/modal), [CommandPalette](#/commandpalette) and [Accordion](#/accordion).
18433
+ Used on [Sizes](#/sizes), [Button](#/button), [Input](#/input), [FormField](#/formfield), [Alert](#/alert), [Toast](#/toast), [Modal](#/modal), [CommandPalette](#/commandpalette) and [Accordion](#/accordion).
18357
18434
 
18358
18435
  ##### `LanguageProvider`
18359
18436
 
@@ -18425,7 +18502,7 @@ Used on [IconButton](#/iconbutton).
18425
18502
 
18426
18503
  [Modal](#/modal) – A window above the page that holds the focus until it is answered or closed (also called a dialog). Reach for it for a short task that interrupts the page: create an item, edit its settings, read a policy.
18427
18504
 
18428
- Used on [Scenarios](#/), [Sizes](#/sizes), [Modal](#/modal), [Drawer](#/drawer) and [CommandPalette](#/commandpalette).
18505
+ Used on [Scenarios](#/), [Sizes](#/sizes), [Toast](#/toast), [Modal](#/modal), [Drawer](#/drawer) and [CommandPalette](#/commandpalette).
18429
18506
 
18430
18507
  ##### `ModalBody`
18431
18508
 
@@ -18436,7 +18513,7 @@ foot stand fast.
18436
18513
  function ModalBody({ ref, className, children, ...rest }: HTMLAttributes<HTMLDivElement> & RefProp<HTMLDivElement>): import("react").JSX.Element;
18437
18514
  ```
18438
18515
 
18439
- Used on [Scenarios](#/), [Sizes](#/sizes), [Modal](#/modal) and [Drawer](#/drawer).
18516
+ Used on [Scenarios](#/), [Sizes](#/sizes), [Toast](#/toast), [Modal](#/modal) and [Drawer](#/drawer).
18440
18517
 
18441
18518
  ##### `ModalFooter`
18442
18519
 
@@ -18446,14 +18523,14 @@ The foot of a `Modal` or `Drawer`, for its buttons; they stand at the end.
18446
18523
  function ModalFooter({ ref, className, children, ...rest }: HTMLAttributes<HTMLDivElement> & RefProp<HTMLDivElement>): import("react").JSX.Element;
18447
18524
  ```
18448
18525
 
18449
- Used on [Scenarios](#/), [Sizes](#/sizes), [Modal](#/modal) and [Drawer](#/drawer).
18526
+ Used on [Scenarios](#/), [Sizes](#/sizes), [Toast](#/toast), [Modal](#/modal) and [Drawer](#/drawer).
18450
18527
 
18451
18528
  ##### `ModalHeader`
18452
18529
 
18453
18530
  [Modal](#/modal) – The head of a `Modal` or `Drawer`: its title, which names the dialog for a
18454
18531
  screen reader, an optional sentence below it, and the close cross.
18455
18532
 
18456
- Used on [Scenarios](#/), [Sizes](#/sizes), [Modal](#/modal) and [Drawer](#/drawer).
18533
+ Used on [Scenarios](#/), [Sizes](#/sizes), [Toast](#/toast), [Modal](#/modal) and [Drawer](#/drawer).
18457
18534
 
18458
18535
  ##### `MultiSelect`
18459
18536
 
@@ -18505,7 +18582,7 @@ Used on [Sizes](#/sizes) and [SegmentedControl](#/segmentedcontrol).
18505
18582
 
18506
18583
  [Select](#/select) – One choice from a short, known list (dropdown). Under a mouse and the keys it opens the Combobox's list; under a finger the system's picker, a wheel on the phone.
18507
18584
 
18508
- Used on [Scenarios](#/), [Sizes](#/sizes), [FormField](#/formfield), [SegmentedControl](#/segmentedcontrol), [Select](#/select), [Popover](#/popover), [Modal](#/modal), [CommandPalette](#/commandpalette), [Accordion](#/accordion) and [Tag](#/tag).
18585
+ Used on [Scenarios](#/), [Sizes](#/sizes), [FormField](#/formfield), [SegmentedControl](#/segmentedcontrol), [Select](#/select), [Toast](#/toast), [Popover](#/popover), [Modal](#/modal), [CommandPalette](#/commandpalette), [Accordion](#/accordion) and [Tag](#/tag).
18509
18586
 
18510
18587
  ##### `Skeleton`
18511
18588
 
@@ -18645,7 +18722,7 @@ Used on [Scenarios](#/), [UmrissProvider](#/umrissprovider) and [Toast](#/toast)
18645
18722
 
18646
18723
  [Tooltip](#/tooltip) – A sentence of explanation that appears while the pointer rests on an element or the keyboard focus is on it (also called a hint). Reach for it to explain an abbreviation or a control; an icon button names itself as an [IconButton](#/iconbutton).
18647
18724
 
18648
- Used on [Scenarios](#/), [IconButton](#/iconbutton), [Tooltip](#/tooltip), [Popover](#/popover) and [CommandPalette](#/commandpalette).
18725
+ Used on [Scenarios](#/), [IconButton](#/iconbutton), [Toast](#/toast), [Tooltip](#/tooltip), [Popover](#/popover) and [CommandPalette](#/commandpalette).
18649
18726
 
18650
18727
  ##### `TreeSearch`
18651
18728
 
@@ -19433,6 +19510,8 @@ A complete language: the formats for numbers and dates, and the wording.
19433
19510
  | `formats` *required* | [`Formats`](#type-Formats) | — | |
19434
19511
  | `wording` *required* | [`Wording`](#type-Wording) | — | |
19435
19512
 
19513
+ Used on [Toast](#/toast).
19514
+
19436
19515
  ##### `LanguageOptions`
19437
19516
 
19438
19517
  Its table stands on [Language](#/language/type-LanguageOptions).
@@ -20314,7 +20393,7 @@ Used on [UmrissProvider](#/umrissprovider) and [Language](#/language).
20314
20393
 
20315
20394
  | Prop | Type | Default | Description |
20316
20395
  |---|---|---|---|
20317
- | `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 11 more |
20396
+ | `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 12 more |
20318
20397
  | `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) |
20319
20398
  | `dismiss` *required* | `(id: number) => void` | — | Closes a toast, with the reason `dismiss`. |
20320
20399
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/core",
3
- "version": "0.35.0",
3
+ "version": "0.36.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",