@umriss-ui/core 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +162 -0
- package/README.md +19 -6
- package/dist/core.css +1 -1
- package/dist/core.js +3628 -3505
- package/dist/de.d.ts +7 -5
- package/dist/index.d.ts +472 -108
- package/dist/wording/de.js +3 -2
- package/docs/llms-full.md +12842 -8114
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -19,10 +19,15 @@ import { SVGAttributes } from 'react';
|
|
|
19
19
|
import { SVGProps } from 'react';
|
|
20
20
|
import { TextareaHTMLAttributes } from 'react';
|
|
21
21
|
|
|
22
|
+
/** Sections behind headers that open and close: one at a time (`single`) or
|
|
23
|
+
any number (`multiple`). The arrow keys move between the headers. */
|
|
22
24
|
export declare const Accordion: ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>>;
|
|
23
25
|
|
|
26
|
+
/** One section of an `Accordion`: its header and the content it opens. */
|
|
24
27
|
export declare const AccordionItem: ForwardRefExoticComponent<AccordionItemProps & RefAttributes<HTMLDivElement>>;
|
|
25
28
|
|
|
29
|
+
/** The props of `AccordionItem`: a div's attributes, with `title` taking the
|
|
30
|
+
header's node instead of the HTML attribute. */
|
|
26
31
|
export declare interface AccordionItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
27
32
|
/** What names the section in the accordion's `value`. */
|
|
28
33
|
value: string;
|
|
@@ -32,9 +37,9 @@ export declare interface AccordionItemProps extends Omit<HTMLAttributes<HTMLDivE
|
|
|
32
37
|
disabled?: boolean;
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
/** The props of `Accordion`. */
|
|
35
41
|
export declare interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
36
|
-
/** `single` keeps at most one section open, `multiple` any number.
|
|
37
|
-
Default: `single` */
|
|
42
|
+
/** `single` keeps at most one section open, `multiple` any number. */
|
|
38
43
|
type?: "single" | "multiple";
|
|
39
44
|
/** Controlled: the values of the open sections. A list for both types, so
|
|
40
45
|
that switching the type changes nothing else. */
|
|
@@ -45,7 +50,7 @@ export declare interface AccordionProps extends Omit<HTMLAttributes<HTMLDivEleme
|
|
|
45
50
|
accordion follows once `value` does; uncontrolled it is a message. */
|
|
46
51
|
onChange?: (value: string[]) => void;
|
|
47
52
|
/** The level of the heading each header stands in - the one that fits the
|
|
48
|
-
page's outline.
|
|
53
|
+
page's outline. */
|
|
49
54
|
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
50
55
|
}
|
|
51
56
|
|
|
@@ -61,8 +66,13 @@ export declare interface AccordionProps extends Omit<HTMLAttributes<HTMLDivEleme
|
|
|
61
66
|
*/
|
|
62
67
|
export declare function age(asOf: Instant, now: Instant): number | null;
|
|
63
68
|
|
|
69
|
+
/** A message that stays put in the page - for what a toast would carry away
|
|
70
|
+
too soon. Warning and danger interrupt the screen reader, the other tones
|
|
71
|
+
report politely. */
|
|
64
72
|
export declare const Alert: ForwardRefExoticComponent<AlertProps & RefAttributes<HTMLDivElement>>;
|
|
65
73
|
|
|
74
|
+
/** The props of `Alert`: a div's attributes, with `title` taking a heading
|
|
75
|
+
node instead of the HTML attribute. */
|
|
66
76
|
export declare interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
67
77
|
/** How urgent the message is. Only `warning` and `danger` interrupt the
|
|
68
78
|
screen reader - the other two report politely. */
|
|
@@ -73,19 +83,25 @@ export declare interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
73
83
|
actions?: ReactNode;
|
|
74
84
|
/** Shows a dismiss cross and calls this. */
|
|
75
85
|
onDismiss?: () => void;
|
|
76
|
-
/** Label of the dismiss cross
|
|
86
|
+
/** Label of the dismiss cross.
|
|
87
|
+
@default the wording's "Close message" */
|
|
77
88
|
dismissLabel?: string;
|
|
78
89
|
}
|
|
79
90
|
|
|
91
|
+
/** How urgent an alert is; it also decides whether a screen reader is
|
|
92
|
+
interrupted. */
|
|
80
93
|
export declare type AlertTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
/** Where the panel lines up with its anchor along the side it stands on. */
|
|
96
|
+
export declare type Align = "start" | "end" | "center";
|
|
83
97
|
|
|
84
98
|
/** Every loaded branch with content. Empty ones stay out because expanding
|
|
85
99
|
them showed nothing; unloaded ones stay out because one click would
|
|
86
100
|
otherwise trigger a thousand requests (ADR-0005). */
|
|
87
101
|
export declare function allBranches<K, S extends Key = string>(roots: readonly K[], reader: NodeReader<K, S>): S[];
|
|
88
102
|
|
|
103
|
+
/** The chevron that expands and collapses a branch. Drawn pointing right;
|
|
104
|
+
rotate it by 90 degrees for an open branch. */
|
|
89
105
|
export declare const AngleGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
90
106
|
|
|
91
107
|
/**
|
|
@@ -126,6 +142,7 @@ export declare interface Assessment {
|
|
|
126
142
|
/** Compact status label; as a `pill` for counters. */
|
|
127
143
|
export declare const Badge: ForwardRefExoticComponent<BadgeProps & RefAttributes<HTMLSpanElement>>;
|
|
128
144
|
|
|
145
|
+
/** The props of `Badge`. */
|
|
129
146
|
export declare interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
130
147
|
/** What the badge stands for. There is always a word beside it: a colour on
|
|
131
148
|
its own is not a statement. */
|
|
@@ -135,8 +152,12 @@ export declare interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
135
152
|
pill?: boolean;
|
|
136
153
|
}
|
|
137
154
|
|
|
155
|
+
/** What a badge stands for - never the only statement, a word stands beside
|
|
156
|
+
it. */
|
|
138
157
|
export declare type BadgeTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
139
158
|
|
|
159
|
+
/** Where a page stands: the trail from the root to the current page. Where it
|
|
160
|
+
is wider than its place, the middle levels fold into a menu. */
|
|
140
161
|
export declare const Breadcrumb: ForwardRefExoticComponent<BreadcrumbProps & RefAttributes<HTMLElement>>;
|
|
141
162
|
|
|
142
163
|
/** One level of the trail. */
|
|
@@ -154,30 +175,38 @@ export declare interface BreadcrumbEntry {
|
|
|
154
175
|
onSelect?: () => void;
|
|
155
176
|
}
|
|
156
177
|
|
|
178
|
+
/** The props of `Breadcrumb`. */
|
|
157
179
|
export declare interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
158
180
|
/** The trail from the root to the current page; the last is the page. */
|
|
159
181
|
items: readonly BreadcrumbEntry[];
|
|
160
182
|
}
|
|
161
183
|
|
|
184
|
+
/** A button with a label. `primary` once per surface; `loading` shows a
|
|
185
|
+
spinner and locks it. `type` is `button` unless you say otherwise. */
|
|
162
186
|
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
163
187
|
|
|
188
|
+
/** Buttons standing side by side as one control: square inside, rounded
|
|
189
|
+
outside, a hairline between them. `size` sets one height for all. */
|
|
164
190
|
export declare const ButtonGroup: ForwardRefExoticComponent<ButtonGroupProps & RefAttributes<HTMLDivElement>>;
|
|
165
191
|
|
|
192
|
+
/** The props of `ButtonGroup`. */
|
|
166
193
|
export declare interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
167
194
|
/** Label of the group for the screen reader. */
|
|
168
195
|
"aria-label"?: string;
|
|
169
196
|
/** The size of the buttons in it that do not say their own - one group,
|
|
170
|
-
one height.
|
|
197
|
+
one height.
|
|
198
|
+
@default the size around it, else `"md"` */
|
|
171
199
|
size?: ButtonSize;
|
|
172
200
|
}
|
|
173
201
|
|
|
202
|
+
/** The props of `Button`: a native button's attributes and its look. */
|
|
174
203
|
export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
175
204
|
/** How loud the button is. `primary` exactly once per surface - two main
|
|
176
205
|
actions side by side are no longer a main action. `ghost` is quiet in the
|
|
177
206
|
accent, `plain` quiet and neutral. */
|
|
178
207
|
variant?: ButtonVariant;
|
|
179
|
-
/** `sm` for buttons in header bars and table rows, `md` otherwise.
|
|
180
|
-
the size of a `ControlSizeProvider` around it, else `md
|
|
208
|
+
/** `sm` for buttons in header bars and table rows, `md` otherwise.
|
|
209
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
181
210
|
size?: ButtonSize;
|
|
182
211
|
/** Shows a loading indicator and locks the button. */
|
|
183
212
|
loading?: boolean;
|
|
@@ -186,6 +215,9 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
186
215
|
/** A button's two heights - the controls' (`ControlSize`). */
|
|
187
216
|
export declare type ButtonSize = ControlSize;
|
|
188
217
|
|
|
218
|
+
/** How loud a button is: `primary` for the one main action, `secondary` by
|
|
219
|
+
default, `ghost` quiet in the accent, `plain` quiet and neutral, `danger`
|
|
220
|
+
for a destructive action. */
|
|
189
221
|
export declare type ButtonVariant = "primary" | "secondary" | "ghost" | "plain" | "danger";
|
|
190
222
|
|
|
191
223
|
/**
|
|
@@ -209,17 +241,27 @@ export declare const CalendarGlyph: ForwardRefExoticComponent<Omit<GlyphProps &
|
|
|
209
241
|
range?: boolean;
|
|
210
242
|
}, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
211
243
|
|
|
244
|
+
/** A surface that groups content under a head: `CardHeader` and `CardBody`
|
|
245
|
+
inside a `section`. With `collapsible` the header gets a key that folds the
|
|
246
|
+
body away. */
|
|
212
247
|
export declare const Card: ForwardRefExoticComponent<CardProps & RefAttributes<HTMLElement>>;
|
|
213
248
|
|
|
249
|
+
/** The content of a `Card`; the part that folds away in a collapsible card.
|
|
250
|
+
`flush` removes the padding for a table or a log. */
|
|
214
251
|
export declare const CardBody: ForwardRefExoticComponent<CardBodyProps & RefAttributes<HTMLDivElement>>;
|
|
215
252
|
|
|
253
|
+
/** The props of `CardBody`. */
|
|
216
254
|
export declare interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
217
255
|
/** Removes the inner padding, e.g. for flush tables. */
|
|
218
256
|
flush?: boolean;
|
|
219
257
|
}
|
|
220
258
|
|
|
259
|
+
/** The head of a `Card`: title, an optional eyebrow and actions on the right.
|
|
260
|
+
In a collapsible card it carries the fold key. */
|
|
221
261
|
export declare const CardHeader: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
222
262
|
|
|
263
|
+
/** The props of `CardHeader`: a div's attributes, with `title` taking a node
|
|
264
|
+
instead of the HTML attribute. */
|
|
223
265
|
export declare interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
224
266
|
/** The heading of the card. A node and not merely text, so that an
|
|
225
267
|
identifier with markup can stand in it too. */
|
|
@@ -236,6 +278,7 @@ export declare interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElem
|
|
|
236
278
|
divider?: boolean;
|
|
237
279
|
}
|
|
238
280
|
|
|
281
|
+
/** The props of `Card`. */
|
|
239
282
|
export declare interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
240
283
|
/** Allows collapsing and expanding the body through the header. */
|
|
241
284
|
collapsible?: boolean;
|
|
@@ -251,8 +294,11 @@ export declare interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
|
251
294
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
252
295
|
}
|
|
253
296
|
|
|
297
|
+
/** A native checkbox with its label beside it; `indeterminate` shows the mixed
|
|
298
|
+
state. Inside a `FormField` it takes the field's id and description. */
|
|
254
299
|
export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
255
300
|
|
|
301
|
+
/** The props of `Checkbox`: a native checkbox's attributes and its label. */
|
|
256
302
|
export declare interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
257
303
|
/** Label to the right of the checkbox. */
|
|
258
304
|
label?: ReactNode;
|
|
@@ -274,6 +320,7 @@ export declare const clampedHeight: (measured: number, lineHeight: number, maxRo
|
|
|
274
320
|
/** A clock face at a quarter past - the time pickers' character. */
|
|
275
321
|
export declare const ClockGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
276
322
|
|
|
323
|
+
/** Closes a branch. Returns the same snapshot where it is closed already. */
|
|
277
324
|
export declare function collapse<S extends Key>(snapshot: TreeSnapshot<S>, key: S): TreeSnapshot<S>;
|
|
278
325
|
|
|
279
326
|
/** A searchable select field (the combobox pattern with a listbox panel). */
|
|
@@ -281,6 +328,8 @@ export declare const Combobox: <T extends string = string>(props: ComboboxProps<
|
|
|
281
328
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
282
329
|
}) => ReactElement;
|
|
283
330
|
|
|
331
|
+
/** One possibility of a `Combobox`: the value it stands for and the label it
|
|
332
|
+
is found by. */
|
|
284
333
|
export declare interface ComboboxOption<T extends string = string> {
|
|
285
334
|
/** What comes back when this row is chosen. */
|
|
286
335
|
value: T;
|
|
@@ -291,6 +340,7 @@ export declare interface ComboboxOption<T extends string = string> {
|
|
|
291
340
|
disabled?: boolean;
|
|
292
341
|
}
|
|
293
342
|
|
|
343
|
+
/** The props of `Combobox`. */
|
|
294
344
|
export declare interface ComboboxProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
295
345
|
/** The possibilities, in their natural order. Filtered while typing; never
|
|
296
346
|
reordered. */
|
|
@@ -303,8 +353,8 @@ export declare interface ComboboxProps<T extends string = string> extends Omit<H
|
|
|
303
353
|
onChange: (value: T | null) => void;
|
|
304
354
|
/** What stands in the empty field. */
|
|
305
355
|
placeholder?: string;
|
|
306
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
307
|
-
`ControlSizeProvider` around it, else `md
|
|
356
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
357
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
308
358
|
size?: "sm" | "md";
|
|
309
359
|
/** The width in characters - room for the typed text and the chosen
|
|
310
360
|
option; the field adds its own padding, chevron and cross. Given, the
|
|
@@ -324,6 +374,9 @@ export declare interface ComboboxProps<T extends string = string> extends Omit<H
|
|
|
324
374
|
clearable?: boolean;
|
|
325
375
|
}
|
|
326
376
|
|
|
377
|
+
/** A window above the application in which one types and finds: it searches
|
|
378
|
+
`items` by subsequence, ranks and marks the matches, and reports the chosen
|
|
379
|
+
candidate's `id` to `onChoose`. Controlled through `open` and `onClose`. */
|
|
327
380
|
export declare const CommandPalette: ForwardRefExoticComponent<CommandPaletteProps & RefAttributes<HTMLDialogElement>>;
|
|
328
381
|
|
|
329
382
|
/** A candidate the palette can find - the outside of the term CONTEXT.md lists
|
|
@@ -335,6 +388,14 @@ export declare interface CommandPaletteItem {
|
|
|
335
388
|
label: string;
|
|
336
389
|
/** The heading the candidate stands under. It is searched as well. */
|
|
337
390
|
group?: string;
|
|
391
|
+
/**
|
|
392
|
+
* The part of `group` that is searched, where not all of it should be: a
|
|
393
|
+
* prefix every candidate of a set shares - `core · ` before `core · Inputs` -
|
|
394
|
+
* would otherwise let its few letters find the whole set.
|
|
395
|
+
*
|
|
396
|
+
* @default the whole `group`
|
|
397
|
+
*/
|
|
398
|
+
searchedGroup?: string;
|
|
338
399
|
/** Optional glyph on the left of the row. */
|
|
339
400
|
icon?: ReactNode;
|
|
340
401
|
/**
|
|
@@ -342,8 +403,17 @@ export declare interface CommandPaletteItem {
|
|
|
342
403
|
* library deliberately keeps no memory for that.
|
|
343
404
|
*/
|
|
344
405
|
weight?: number;
|
|
406
|
+
/**
|
|
407
|
+
* More words the candidate is found by, such as synonyms - searched but never
|
|
408
|
+
* shown. Only when neither `label` nor `group` matched, only for a query of
|
|
409
|
+
* three characters or more, and as a contiguous run, not as a subsequence. A
|
|
410
|
+
* find through them stands behind every find in a label or a group and marks
|
|
411
|
+
* nothing.
|
|
412
|
+
*/
|
|
413
|
+
keywords?: readonly string[];
|
|
345
414
|
}
|
|
346
415
|
|
|
416
|
+
/** The props of `CommandPalette`. */
|
|
347
417
|
export declare interface CommandPaletteProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "open" | "onClose" | "children"> {
|
|
348
418
|
/** Controlled like the modal: opening is the caller's decision. */
|
|
349
419
|
open: boolean;
|
|
@@ -372,11 +442,21 @@ export declare interface CommandPaletteProps extends Omit<DialogHTMLAttributes<H
|
|
|
372
442
|
* the order belongs to the caller.
|
|
373
443
|
*/
|
|
374
444
|
restingItems?: readonly CommandPaletteItem[];
|
|
445
|
+
/**
|
|
446
|
+
* The most finds that stand at once - the best by rank. A last line says how
|
|
447
|
+
* many more there are, and typing on narrows them. For a long list of
|
|
448
|
+
* candidates, where a single letter finds hundreds and drawing them all
|
|
449
|
+
* would make every keystroke wait.
|
|
450
|
+
*
|
|
451
|
+
* @default every find
|
|
452
|
+
*/
|
|
453
|
+
maxFinds?: number;
|
|
375
454
|
}
|
|
376
455
|
|
|
377
456
|
/** Compact confirmation dialog on the basis of Modal. */
|
|
378
457
|
export declare const ConfirmDialog: ForwardRefExoticComponent<ConfirmDialogProps & RefAttributes<HTMLDialogElement>>;
|
|
379
458
|
|
|
459
|
+
/** The props of `ConfirmDialog`. */
|
|
380
460
|
export declare interface ConfirmDialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "open" | "onClose" | "title" | "children"> {
|
|
381
461
|
/** Whether the query stands. */
|
|
382
462
|
open: boolean;
|
|
@@ -390,11 +470,12 @@ export declare interface ConfirmDialogProps extends Omit<DialogHTMLAttributes<HT
|
|
|
390
470
|
/** What about it cannot be taken back. The most important line of the
|
|
391
471
|
dialog. */
|
|
392
472
|
description?: ReactNode;
|
|
393
|
-
/** Label of the agreeing button
|
|
394
|
-
|
|
395
|
-
|
|
473
|
+
/** Label of the agreeing button. Better is the verb of the action:
|
|
474
|
+
"Delete" says what is about to happen.
|
|
475
|
+
@default the wording's "Confirm" */
|
|
396
476
|
confirmLabel?: string;
|
|
397
|
-
/** Label of the cancelling button
|
|
477
|
+
/** Label of the cancelling button.
|
|
478
|
+
@default the wording's "Cancel" */
|
|
398
479
|
cancelLabel?: string;
|
|
399
480
|
/** "danger" for destructive actions. */
|
|
400
481
|
tone?: "primary" | "danger";
|
|
@@ -412,6 +493,7 @@ export declare interface ConfirmDialogProps extends Omit<DialogHTMLAttributes<HT
|
|
|
412
493
|
*/
|
|
413
494
|
export declare function ContextMenu({ open, onOpenChange, position, ariaLabel, children }: ContextMenuProps): JSX.Element;
|
|
414
495
|
|
|
496
|
+
/** The props of `ContextMenu`. */
|
|
415
497
|
export declare interface ContextMenuProps {
|
|
416
498
|
/** Whether the menu stands. Controlled, like `Popover`: a right-click
|
|
417
499
|
opens it only because the caller says so. */
|
|
@@ -442,6 +524,7 @@ export declare type ControlSize = "sm" | "md";
|
|
|
442
524
|
starts without it. */
|
|
443
525
|
export declare function ControlSizeProvider({ size, children }: ControlSizeProviderProps): JSX.Element;
|
|
444
526
|
|
|
527
|
+
/** The props of `ControlSizeProvider`. */
|
|
445
528
|
export declare interface ControlSizeProviderProps {
|
|
446
529
|
/** The size of every control inside that does not say its own. */
|
|
447
530
|
size: ControlSize;
|
|
@@ -475,8 +558,8 @@ export declare interface DatePickerProps extends Omit<HTMLAttributes<HTMLSpanEle
|
|
|
475
558
|
/** Marks the field as invalid. `FormField` sets it itself as soon as it
|
|
476
559
|
carries an `error` - by hand only necessary without `FormField`. */
|
|
477
560
|
invalid?: boolean;
|
|
478
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
479
|
-
`ControlSizeProvider` around it, else `md
|
|
561
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
562
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
480
563
|
size?: "sm" | "md";
|
|
481
564
|
/** The width in characters - room for the value; the field adds its own
|
|
482
565
|
padding, glyph and cross. Given, the field is that wide wherever it
|
|
@@ -489,6 +572,8 @@ export declare interface DatePickerProps extends Omit<HTMLAttributes<HTMLSpanEle
|
|
|
489
572
|
clearable?: boolean;
|
|
490
573
|
}
|
|
491
574
|
|
|
575
|
+
/** A span between two dates, both ends included - the value of
|
|
576
|
+
`DateRangePicker` and `DateTimeRangePicker`. */
|
|
492
577
|
export declare interface DateRange {
|
|
493
578
|
from: Date;
|
|
494
579
|
to: Date;
|
|
@@ -532,8 +617,8 @@ export declare interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLSp
|
|
|
532
617
|
/** Marks the field as invalid. `FormField` sets it itself as soon as it
|
|
533
618
|
carries an `error` - by hand only necessary without `FormField`. */
|
|
534
619
|
invalid?: boolean;
|
|
535
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
536
|
-
`ControlSizeProvider` around it, else `md
|
|
620
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
621
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
537
622
|
size?: "sm" | "md";
|
|
538
623
|
/** The width in characters - room for the value; the field adds its own
|
|
539
624
|
padding, glyph and cross. Given, the field is that wide wherever it
|
|
@@ -545,12 +630,17 @@ export declare interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLSp
|
|
|
545
630
|
clears the value. */
|
|
546
631
|
clearable?: boolean;
|
|
547
632
|
/**
|
|
548
|
-
* The quick-select column in the panel.
|
|
549
|
-
*
|
|
633
|
+
* The quick-select column in the panel. An empty array hides the column.
|
|
634
|
+
*
|
|
635
|
+
* @default `DEFAULT_PRESETS`, in the wording's labels
|
|
550
636
|
*/
|
|
551
637
|
presets?: RangePreset[];
|
|
552
638
|
}
|
|
553
639
|
|
|
640
|
+
/** A date and a time of day in one field, with a calendar panel. The value is
|
|
641
|
+
an exact instant and is reported only on "Apply", "Now" or "Clear"; the
|
|
642
|
+
missing and doubled hours of a daylight-saving change are asked about, not
|
|
643
|
+
guessed. */
|
|
554
644
|
export declare const DateTimePicker: ForwardRefExoticComponent<DateTimePickerProps & RefAttributes<HTMLSpanElement>>;
|
|
555
645
|
|
|
556
646
|
/**
|
|
@@ -568,14 +658,14 @@ export declare interface DateTimePickerProps extends Omit<HTMLAttributes<HTMLSpa
|
|
|
568
658
|
the click on a day: a day without a time would be a half-set value here,
|
|
569
659
|
and a half value is no value. */
|
|
570
660
|
onChange: (date: Date | null) => void;
|
|
571
|
-
/** Show the seconds field
|
|
661
|
+
/** Show the seconds field. */
|
|
572
662
|
withSeconds?: boolean;
|
|
573
663
|
/** What stands in the empty field. */
|
|
574
664
|
placeholder?: string;
|
|
575
665
|
/** Locks the field and the panel. */
|
|
576
666
|
disabled?: boolean;
|
|
577
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
578
|
-
`ControlSizeProvider` around it, else `md
|
|
667
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
668
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
579
669
|
size?: "sm" | "md";
|
|
580
670
|
/** The width in characters - room for the value; the field adds its own
|
|
581
671
|
padding, glyph and cross. Given, the field is that wide wherever it
|
|
@@ -627,7 +717,7 @@ export declare interface DateTimeRangePickerProps extends Omit<HTMLAttributes<HT
|
|
|
627
717
|
clicks. If the end lies before the start, both swap on applying - there is
|
|
628
718
|
no error state. */
|
|
629
719
|
onChange: (range: DateRange | null) => void;
|
|
630
|
-
/** Show the seconds fields
|
|
720
|
+
/** Show the seconds fields. */
|
|
631
721
|
withSeconds?: boolean;
|
|
632
722
|
/** What stands in the empty field. */
|
|
633
723
|
placeholder?: string;
|
|
@@ -636,8 +726,8 @@ export declare interface DateTimeRangePickerProps extends Omit<HTMLAttributes<HT
|
|
|
636
726
|
/** Marks the field as invalid. `FormField` sets it itself as soon as it
|
|
637
727
|
carries an `error` - by hand only necessary without `FormField`. */
|
|
638
728
|
invalid?: boolean;
|
|
639
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
640
|
-
`ControlSizeProvider` around it, else `md
|
|
729
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
730
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
641
731
|
size?: "sm" | "md";
|
|
642
732
|
/** The width in characters - room for the value; the field adds its own
|
|
643
733
|
padding, glyph and cross. Given, the field is that wide wherever it
|
|
@@ -650,8 +740,9 @@ export declare interface DateTimeRangePickerProps extends Omit<HTMLAttributes<HT
|
|
|
650
740
|
clearable?: boolean;
|
|
651
741
|
/**
|
|
652
742
|
* The quick-select column in the panel; presets apply for the whole day and
|
|
653
|
-
* close immediately.
|
|
654
|
-
*
|
|
743
|
+
* close immediately. An empty array hides the column.
|
|
744
|
+
*
|
|
745
|
+
* @default `DEFAULT_PRESETS`, in the wording's labels
|
|
655
746
|
*/
|
|
656
747
|
presets?: RangePreset[];
|
|
657
748
|
}
|
|
@@ -660,6 +751,8 @@ export declare interface DateTimeRangePickerProps extends Omit<HTMLAttributes<HT
|
|
|
660
751
|
(ADR-0024). German is `GERMAN_FORMATS` in `@umriss-ui/core/wording/de`. */
|
|
661
752
|
export declare const DEFAULT_FORMATS: Formats;
|
|
662
753
|
|
|
754
|
+
/** English formats and English wording - what every component uses without a
|
|
755
|
+
`LanguageProvider`. */
|
|
663
756
|
export declare const DEFAULT_LANGUAGE: Language;
|
|
664
757
|
|
|
665
758
|
/** The same time spans with the preset labels. */
|
|
@@ -678,10 +771,14 @@ export declare const DEFAULT_WORDING: Wording;
|
|
|
678
771
|
exists only with work package B.13. */
|
|
679
772
|
export declare type Density = "comfortable" | "compact";
|
|
680
773
|
|
|
774
|
+
/** Where the active node moves: up and down the visible rows, in and out of a
|
|
775
|
+
branch, to the first or the last row. */
|
|
681
776
|
export declare type Direction = "up" | "down" | "in" | "out" | "start" | "end";
|
|
682
777
|
|
|
778
|
+
/** A line between rows or columns; with `label` a named separator. */
|
|
683
779
|
export declare const Divider: ForwardRefExoticComponent<DividerProps & RefAttributes<HTMLDivElement>>;
|
|
684
780
|
|
|
781
|
+
/** The props of `Divider`. */
|
|
685
782
|
export declare interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
686
783
|
/** Horizontally it separates rows, vertically it separates columns. */
|
|
687
784
|
orientation?: "horizontal" | "vertical";
|
|
@@ -691,11 +788,17 @@ export declare interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
691
788
|
label?: ReactNode;
|
|
692
789
|
}
|
|
693
790
|
|
|
791
|
+
/** A strip of tools that lies at an edge of one surface and carries the
|
|
792
|
+
actions for it. It moves to another edge by pointer or keyboard and reports
|
|
793
|
+
the place through `onPlaceChange`; at a side edge it stands upright, where
|
|
794
|
+
there is room. */
|
|
694
795
|
export declare const Dock: ForwardRefExoticComponent<DockProps & RefAttributes<HTMLDivElement>>;
|
|
695
796
|
|
|
696
|
-
/** The outside of the resting place.
|
|
697
|
-
|
|
797
|
+
/** The outside of the resting place: one of the four edges of the host.
|
|
798
|
+
There is no fifth and no corner. */
|
|
799
|
+
export declare type DockPlace = "top" | "right" | "bottom" | "left";
|
|
698
800
|
|
|
801
|
+
/** The props of `Dock`. */
|
|
699
802
|
export declare interface DockProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
700
803
|
/**
|
|
701
804
|
* The tools - a property and expressly not children.
|
|
@@ -729,7 +832,8 @@ export declare interface DockProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
729
832
|
onModeChange?: (id: string) => void;
|
|
730
833
|
/** A tool was taken. */
|
|
731
834
|
onUse?: (id: string) => void;
|
|
732
|
-
/** The accessible name of the dock.
|
|
835
|
+
/** The accessible name of the dock.
|
|
836
|
+
@default the wording's "Tools" */
|
|
733
837
|
label?: string;
|
|
734
838
|
}
|
|
735
839
|
|
|
@@ -750,10 +854,14 @@ export declare interface DockTool {
|
|
|
750
854
|
disabled?: boolean;
|
|
751
855
|
}
|
|
752
856
|
|
|
857
|
+
/** A `Modal` that stands at an edge of the window and enters from it - the
|
|
858
|
+
same dialog with the same head, body and foot. Its width is the token
|
|
859
|
+
`--u-drawer-width`. */
|
|
753
860
|
export declare const Drawer: ForwardRefExoticComponent<DrawerProps & RefAttributes<HTMLDialogElement>>;
|
|
754
861
|
|
|
862
|
+
/** The props of `Drawer`: a `Modal`'s, with `side` in place of `size`. */
|
|
755
863
|
export declare interface DrawerProps extends Omit<ModalProps, "size"> {
|
|
756
|
-
/** The edge the drawer stands at and enters from.
|
|
864
|
+
/** The edge the drawer stands at and enters from. */
|
|
757
865
|
side?: "right" | "left";
|
|
758
866
|
}
|
|
759
867
|
|
|
@@ -765,6 +873,8 @@ export declare function duplicateKey<K, S extends Key = string>(roots: readonly
|
|
|
765
873
|
/** An empty surface as an invitation to act - not as a dead end. */
|
|
766
874
|
export declare const EmptyState: ForwardRefExoticComponent<EmptyStateProps & RefAttributes<HTMLDivElement>>;
|
|
767
875
|
|
|
876
|
+
/** The props of `EmptyState`: a div's attributes, with `title` taking a node
|
|
877
|
+
instead of the HTML attribute. */
|
|
768
878
|
export declare interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
769
879
|
/** What is missing here - as a statement, not as an apology. */
|
|
770
880
|
title: ReactNode;
|
|
@@ -776,10 +886,15 @@ export declare interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElem
|
|
|
776
886
|
icon?: ReactNode;
|
|
777
887
|
}
|
|
778
888
|
|
|
889
|
+
/** Opens a branch. Returns the same snapshot where it is open already. */
|
|
779
890
|
export declare function expand<S extends Key>(snapshot: TreeSnapshot<S>, key: S): TreeSnapshot<S>;
|
|
780
891
|
|
|
892
|
+
/** A file field with a drop zone: choose or drop files, and remove them from
|
|
893
|
+
the list again. Nothing is uploaded - that is the application's. */
|
|
781
894
|
export declare const FileInput: ForwardRefExoticComponent<FileInputProps & RefAttributes<HTMLInputElement>>;
|
|
782
895
|
|
|
896
|
+
/** The props of `FileInput`: a native file input's attributes, with the files
|
|
897
|
+
as the value. */
|
|
783
898
|
export declare interface FileInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "size"> {
|
|
784
899
|
/** Controlled: the chosen files. Uncontrolled, the input keeps its own and
|
|
785
900
|
starts empty. */
|
|
@@ -792,6 +907,9 @@ export declare interface FileInputProps extends Omit<InputHTMLAttributes<HTMLInp
|
|
|
792
907
|
invalid?: boolean;
|
|
793
908
|
}
|
|
794
909
|
|
|
910
|
+
/** One visible node of a tree, with everything a row needs to be drawn and
|
|
911
|
+
read out: level, branch or leaf, check state, search state and position
|
|
912
|
+
among its siblings. */
|
|
795
913
|
export declare interface FlatteningEntry<K, S extends Key = string> {
|
|
796
914
|
node: K;
|
|
797
915
|
key: S;
|
|
@@ -850,8 +968,8 @@ export declare interface Formats {
|
|
|
850
968
|
number: (n: number, decimals?: number) => string;
|
|
851
969
|
/**
|
|
852
970
|
* A count. Kept apart from `number` because it makes a different promise: a
|
|
853
|
-
* count is whole, and Intl's
|
|
854
|
-
* for it and wrong for a measurement.
|
|
971
|
+
* count is whole, and Intl's own rounding (at most three decimal places) is
|
|
972
|
+
* right for it and wrong for a measurement.
|
|
855
973
|
*/
|
|
856
974
|
count: (n: number) => string;
|
|
857
975
|
/** A share from 0 to 1 as whole per cent: 74 % */
|
|
@@ -863,6 +981,9 @@ export declare interface Formats {
|
|
|
863
981
|
relative: (ms: number) => string;
|
|
864
982
|
}
|
|
865
983
|
|
|
984
|
+
/** A label, a hint or error and the control they belong to. The control
|
|
985
|
+
inside takes the field's id, description, required and invalid state by
|
|
986
|
+
itself - no wiring by hand. */
|
|
866
987
|
export declare const FormField: ForwardRefExoticComponent<FormFieldProps & RefAttributes<HTMLDivElement>>;
|
|
867
988
|
|
|
868
989
|
/**
|
|
@@ -878,6 +999,10 @@ export declare function FormFieldBoundary({ children }: {
|
|
|
878
999
|
|
|
879
1000
|
declare interface FormFieldContextValue {
|
|
880
1001
|
id: string;
|
|
1002
|
+
/** The label's own id. `label htmlFor` names only what HTML can label -
|
|
1003
|
+
an input, a select, a button; a group (`role="radiogroup"`) is named
|
|
1004
|
+
through `aria-labelledby` with this. */
|
|
1005
|
+
labelId: string;
|
|
881
1006
|
describedBy?: string;
|
|
882
1007
|
invalid: boolean;
|
|
883
1008
|
/** A required field. Every field whose role carries it turns this into
|
|
@@ -886,6 +1011,7 @@ declare interface FormFieldContextValue {
|
|
|
886
1011
|
required: boolean;
|
|
887
1012
|
}
|
|
888
1013
|
|
|
1014
|
+
/** The props of `FormField`. */
|
|
889
1015
|
export declare interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
890
1016
|
/** The label of the field. It is mandatory: a field without a name is a
|
|
891
1017
|
field without a question for a screen reader. */
|
|
@@ -939,6 +1065,8 @@ export declare interface FreshnessAges {
|
|
|
939
1065
|
lost: number;
|
|
940
1066
|
}
|
|
941
1067
|
|
|
1068
|
+
/** What `useFreshness` returns: how fresh the value is, how old, and the time
|
|
1069
|
+
the reading was taken at. */
|
|
942
1070
|
export declare interface FreshnessReading {
|
|
943
1071
|
/** `fresh`, `stale` or `lost` - never a verdict. */
|
|
944
1072
|
freshness: Freshness;
|
|
@@ -948,6 +1076,7 @@ export declare interface FreshnessReading {
|
|
|
948
1076
|
now: number;
|
|
949
1077
|
}
|
|
950
1078
|
|
|
1079
|
+
/** The props of a glyph: an SVG's attributes and its edge length. */
|
|
951
1080
|
export declare interface GlyphProps extends Omit<SVGProps<SVGSVGElement>, "viewBox" | "children"> {
|
|
952
1081
|
/**
|
|
953
1082
|
* Edge length in pixels. The default is the size the glyph is already drawn
|
|
@@ -956,12 +1085,15 @@ export declare interface GlyphProps extends Omit<SVGProps<SVGSVGElement>, "viewB
|
|
|
956
1085
|
size?: number;
|
|
957
1086
|
}
|
|
958
1087
|
|
|
1088
|
+
/** Children in a grid: a fixed number of columns, or as many as fit at
|
|
1089
|
+
`minItemWidth`. */
|
|
959
1090
|
export declare const Grid: ForwardRefExoticComponent<GridProps & RefAttributes<HTMLDivElement>>;
|
|
960
1091
|
|
|
961
1092
|
/** The grid laid over an area. Two by two lines; the frame is missing on
|
|
962
1093
|
purpose, otherwise it would be a window. */
|
|
963
1094
|
export declare const GridGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
964
1095
|
|
|
1096
|
+
/** The props of `Grid`. */
|
|
965
1097
|
export declare interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
966
1098
|
/** Fixed column count; overridden by minItemWidth. */
|
|
967
1099
|
columns?: number;
|
|
@@ -983,14 +1115,18 @@ export declare interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
983
1115
|
the change. */
|
|
984
1116
|
export declare const GripGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
985
1117
|
|
|
1118
|
+
/** A heading whose level and size are independent: a small heading can still
|
|
1119
|
+
be the second level of the page. */
|
|
986
1120
|
export declare const Heading: ForwardRefExoticComponent<HeadingProps & RefAttributes<HTMLHeadingElement>>;
|
|
987
1121
|
|
|
1122
|
+
/** The props of `Heading`. */
|
|
988
1123
|
export declare interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
989
|
-
/** The page's outline level (h1–h6).
|
|
1124
|
+
/** The page's outline level (h1–h6). */
|
|
990
1125
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
991
|
-
/** Optical size; independent of the level.
|
|
1126
|
+
/** Optical size; independent of the level.
|
|
1127
|
+
@default the size matching the level */
|
|
992
1128
|
size?: TextSize;
|
|
993
|
-
/** Font weight from the token set.
|
|
1129
|
+
/** Font weight from the token set. */
|
|
994
1130
|
weight?: TextWeight;
|
|
995
1131
|
/** How loud the heading is. */
|
|
996
1132
|
tone?: TextTone;
|
|
@@ -1000,6 +1136,8 @@ export declare interface HeadingProps extends HTMLAttributes<HTMLHeadingElement>
|
|
|
1000
1136
|
that name shown as a tooltip. Everything else is a `Button`'s. */
|
|
1001
1137
|
export declare const IconButton: ForwardRefExoticComponent<IconButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
1002
1138
|
|
|
1139
|
+
/** The props of `IconButton`: a `Button`'s, with a required `aria-label` and
|
|
1140
|
+
the icon as its only child. */
|
|
1003
1141
|
export declare interface IconButtonProps extends Omit<ButtonProps, "aria-label" | "aria-labelledby" | "title" | "children"> {
|
|
1004
1142
|
/** The name: what a screen reader announces and the tooltip shows. Required -
|
|
1005
1143
|
an icon alone names nothing. */
|
|
@@ -1008,15 +1146,20 @@ export declare interface IconButtonProps extends Omit<ButtonProps, "aria-label"
|
|
|
1008
1146
|
button sets its size - `--u-icon-size`, `--u-icon-size-sm` at `sm`. */
|
|
1009
1147
|
children: ReactNode;
|
|
1010
1148
|
/** How loud the button is; `plain` is quiet and neutral, and the rest mean
|
|
1011
|
-
what they mean on a `Button`.
|
|
1149
|
+
what they mean on a `Button`. */
|
|
1012
1150
|
variant?: ButtonVariant;
|
|
1013
1151
|
}
|
|
1014
1152
|
|
|
1153
|
+
/** A one-line text field. `chars` sets its width in characters, `numeric`
|
|
1154
|
+
sets figures right-aligned and tabular, `clearable` offers a cross. Inside
|
|
1155
|
+
a `FormField` it takes the field's id, description and invalid state. */
|
|
1015
1156
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
1016
1157
|
|
|
1158
|
+
/** The props of `Input`: a native input's attributes, with `size` meaning the
|
|
1159
|
+
control's height. */
|
|
1017
1160
|
export declare interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
1018
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1019
|
-
`ControlSizeProvider` around it, else `md
|
|
1161
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1162
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1020
1163
|
size?: "sm" | "md";
|
|
1021
1164
|
/** The width in characters - room for the value; the field adds its own
|
|
1022
1165
|
padding and cross. Given, the field is that wide wherever it stands, and
|
|
@@ -1041,6 +1184,7 @@ export declare interface InputProps extends Omit<InputHTMLAttributes<HTMLInputEl
|
|
|
1041
1184
|
/** What may come in as an as-of time or a reference time. */
|
|
1042
1185
|
declare type Instant = Date | number | null | undefined;
|
|
1043
1186
|
|
|
1187
|
+
/** A node's key, as `reader.key` returns it. */
|
|
1044
1188
|
export declare type Key = string | number;
|
|
1045
1189
|
|
|
1046
1190
|
/** The checkable keys between two visible nodes, both ends included and
|
|
@@ -1048,6 +1192,7 @@ export declare type Key = string | number;
|
|
|
1048
1192
|
gesture does what it can instead of nothing. */
|
|
1049
1193
|
export declare function keysBetween<K, S extends Key = string>(flattening: readonly FlatteningEntry<K, S>[], from: S, to: S): S[];
|
|
1050
1194
|
|
|
1195
|
+
/** A complete language: the formats for numbers and dates, and the wording. */
|
|
1051
1196
|
export declare interface Language {
|
|
1052
1197
|
formats: Formats;
|
|
1053
1198
|
wording: Wording;
|
|
@@ -1072,6 +1217,8 @@ export declare interface LanguageOptions {
|
|
|
1072
1217
|
*/
|
|
1073
1218
|
export declare function LanguageProvider({ formats, wording, children }: LanguageProviderProps): JSX.Element;
|
|
1074
1219
|
|
|
1220
|
+
/** The props of `LanguageProvider`: the parts of the formats and the wording
|
|
1221
|
+
that differ from the default. */
|
|
1075
1222
|
export declare interface LanguageProviderProps extends LanguageOptions {
|
|
1076
1223
|
children: ReactNode;
|
|
1077
1224
|
}
|
|
@@ -1099,8 +1246,11 @@ export declare interface LimitSet {
|
|
|
1099
1246
|
target?: number;
|
|
1100
1247
|
}
|
|
1101
1248
|
|
|
1249
|
+
/** A link in the size of its text; `external` opens it in a new tab with the
|
|
1250
|
+
protective attributes set. */
|
|
1102
1251
|
export declare const Link: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
|
|
1103
1252
|
|
|
1253
|
+
/** The props of `Link`. */
|
|
1104
1254
|
export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
1105
1255
|
/** Size from the token set – a link has to match its body text. */
|
|
1106
1256
|
size?: TextSize;
|
|
@@ -1112,10 +1262,17 @@ export declare interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
1112
1262
|
would be a grey stripe at ten nominal units. */
|
|
1113
1263
|
export declare const MeasureGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
1114
1264
|
|
|
1265
|
+
/** A dropdown menu: `trigger` opens a panel of `MenuItem`s below it. The arrow
|
|
1266
|
+
keys, Home and End move between the entries; Escape and an outside click
|
|
1267
|
+
close it. */
|
|
1115
1268
|
export declare function Menu({ trigger, children, align }: MenuProps): JSX.Element;
|
|
1116
1269
|
|
|
1270
|
+
/** An entry of a `Menu` or a `ContextMenu`. It runs `onSelect` and closes the
|
|
1271
|
+
menu. */
|
|
1117
1272
|
export declare const MenuItem: ForwardRefExoticComponent<MenuItemProps & RefAttributes<HTMLButtonElement>>;
|
|
1118
1273
|
|
|
1274
|
+
/** The props of `MenuItem`: a button's attributes, with `onSelect` for what
|
|
1275
|
+
the entry does. */
|
|
1119
1276
|
export declare interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
1120
1277
|
/** What the entry does. The menu closes afterwards by itself: a menu that
|
|
1121
1278
|
stays open after something has happened hides the result. */
|
|
@@ -1124,6 +1281,7 @@ export declare interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLBut
|
|
|
1124
1281
|
tone?: "default" | "danger";
|
|
1125
1282
|
}
|
|
1126
1283
|
|
|
1284
|
+
/** The props of `Menu`. */
|
|
1127
1285
|
export declare interface MenuProps {
|
|
1128
1286
|
/** Trigger, e.g. a <Button>; must accept refs. Its own ref keeps its
|
|
1129
1287
|
element: the menu holds the same one beside it. */
|
|
@@ -1143,6 +1301,7 @@ export declare function mergeLanguage(optionen: LanguageOptions | undefined): La
|
|
|
1143
1301
|
/** A narrow fill-level bar, e.g. for utilisation in table cells. */
|
|
1144
1302
|
export declare const Meter: ForwardRefExoticComponent<MeterProps & RefAttributes<HTMLSpanElement>>;
|
|
1145
1303
|
|
|
1304
|
+
/** The props of `Meter`. */
|
|
1146
1305
|
export declare interface MeterProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1147
1306
|
/** Fill level from 0 to 1. */
|
|
1148
1307
|
value: number;
|
|
@@ -1157,24 +1316,39 @@ export declare interface MeterProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
1157
1316
|
*
|
|
1158
1317
|
* A role of `meter` needs a name from the author - the visible percentage
|
|
1159
1318
|
* inside it does not count for that, and neither does the column heading
|
|
1160
|
-
* beside it.
|
|
1161
|
-
*
|
|
1319
|
+
* beside it. Whoever knows what the bar measures says it better than the
|
|
1320
|
+
* general term.
|
|
1321
|
+
*
|
|
1322
|
+
* @default the wording's "Fill level"
|
|
1162
1323
|
*/
|
|
1163
1324
|
label?: string;
|
|
1164
1325
|
}
|
|
1165
1326
|
|
|
1327
|
+
/** The colour of a meter's bar - an assessment, never the only statement. */
|
|
1166
1328
|
export declare type MeterTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
1167
1329
|
|
|
1330
|
+
/** The minus of `NumberInput`'s step buttons. */
|
|
1168
1331
|
export declare const MinusGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
1169
1332
|
|
|
1333
|
+
/** A dialog window in the middle of the screen, on the native `<dialog>`:
|
|
1334
|
+
focus trap, Escape and scroll lock come from the browser. Controlled through
|
|
1335
|
+
`open` and `onClose`; inside it stand `ModalHeader`, `ModalBody` and
|
|
1336
|
+
`ModalFooter`. */
|
|
1170
1337
|
export declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDialogElement>>;
|
|
1171
1338
|
|
|
1339
|
+
/** The content of a `Modal` or `Drawer` - the part that scrolls while head and
|
|
1340
|
+
foot stand fast. */
|
|
1172
1341
|
export declare const ModalBody: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
|
|
1173
1342
|
|
|
1343
|
+
/** The foot of a `Modal` or `Drawer`, for its buttons; they stand at the end. */
|
|
1174
1344
|
export declare const ModalFooter: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
|
|
1175
1345
|
|
|
1346
|
+
/** The head of a `Modal` or `Drawer`: its title, which names the dialog for a
|
|
1347
|
+
screen reader, an optional sentence below it, and the close cross. */
|
|
1176
1348
|
export declare const ModalHeader: ForwardRefExoticComponent<ModalHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
1177
1349
|
|
|
1350
|
+
/** The props of `ModalHeader`: a div's attributes, with `title` taking a node
|
|
1351
|
+
instead of the HTML attribute. */
|
|
1178
1352
|
export declare interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1179
1353
|
/** The heading of the window. It names it for the screen reader at the same
|
|
1180
1354
|
time – a dialog without a name says only "dialog". */
|
|
@@ -1185,6 +1359,8 @@ export declare interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivEle
|
|
|
1185
1359
|
hideClose?: boolean;
|
|
1186
1360
|
}
|
|
1187
1361
|
|
|
1362
|
+
/** The props of `Modal`: a native dialog's attributes, controlled through
|
|
1363
|
+
`open` and `onClose`. */
|
|
1188
1364
|
export declare interface ModalProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "onClose"> {
|
|
1189
1365
|
/** Whether the window stands. Controlled: the opening is the caller's
|
|
1190
1366
|
decision, and only the caller knows whether something may be open. */
|
|
@@ -1194,10 +1370,11 @@ export declare interface ModalProps extends Omit<DialogHTMLAttributes<HTMLDialog
|
|
|
1194
1370
|
/** The width of the window. The height comes from the content; only the
|
|
1195
1371
|
body scrolls, header and footer stand fast. */
|
|
1196
1372
|
size?: ModalSize;
|
|
1197
|
-
/** Closes on a click on the backdrop.
|
|
1373
|
+
/** Closes on a click on the backdrop. */
|
|
1198
1374
|
closeOnBackdrop?: boolean;
|
|
1199
1375
|
}
|
|
1200
1376
|
|
|
1377
|
+
/** The width of a `Modal`. */
|
|
1201
1378
|
export declare type ModalSize = "sm" | "md" | "lg";
|
|
1202
1379
|
|
|
1203
1380
|
/**
|
|
@@ -1227,6 +1404,7 @@ export declare const MultiSelect: <T extends string = string>(props: MultiSelect
|
|
|
1227
1404
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
1228
1405
|
}) => ReactElement;
|
|
1229
1406
|
|
|
1407
|
+
/** One possibility of a `MultiSelect`: the value it stands for and its label. */
|
|
1230
1408
|
export declare interface MultiSelectOption<T extends string = string> {
|
|
1231
1409
|
/** What stands in `value` when this row is ticked. */
|
|
1232
1410
|
value: T;
|
|
@@ -1237,6 +1415,7 @@ export declare interface MultiSelectOption<T extends string = string> {
|
|
|
1237
1415
|
disabled?: boolean;
|
|
1238
1416
|
}
|
|
1239
1417
|
|
|
1418
|
+
/** The props of `MultiSelect`. */
|
|
1240
1419
|
export declare interface MultiSelectProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
1241
1420
|
/** The possibilities, in their natural order. The list never re-sorts –
|
|
1242
1421
|
not even in the "selected" scope. */
|
|
@@ -1252,8 +1431,8 @@ export declare interface MultiSelectProps<T extends string = string> extends Omi
|
|
|
1252
1431
|
searchPlaceholder?: string;
|
|
1253
1432
|
/** Text when the search finds nothing. */
|
|
1254
1433
|
emptyText?: string;
|
|
1255
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1256
|
-
`ControlSizeProvider` around it, else `md
|
|
1434
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1435
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1257
1436
|
size?: "sm" | "md";
|
|
1258
1437
|
/** The width in characters - room for the chips; the field adds its own
|
|
1259
1438
|
padding and chevron. Given, the field is that wide wherever it stands,
|
|
@@ -1309,6 +1488,8 @@ export declare interface NodeReader<K, S extends Key = string> {
|
|
|
1309
1488
|
*/
|
|
1310
1489
|
export declare const NumberInput: ForwardRefExoticComponent<NumberInputProps & RefAttributes<HTMLInputElement>>;
|
|
1311
1490
|
|
|
1491
|
+
/** The props of `NumberInput`: a native input's attributes, with the value a
|
|
1492
|
+
number or `null`. */
|
|
1312
1493
|
export declare interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "size" | "prefix" | "type"> {
|
|
1313
1494
|
/** The number, or `null` for "not stated". An empty field is not zero:
|
|
1314
1495
|
a quantity that was not measured is not a quantity of zero. */
|
|
@@ -1325,7 +1506,7 @@ export declare interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLI
|
|
|
1325
1506
|
/** Upper bound. Every reported value is clamped; the text in the field
|
|
1326
1507
|
follows on leaving. */
|
|
1327
1508
|
max?: number;
|
|
1328
|
-
/** Step size for the arrow keys; Shift multiplies it by ten.
|
|
1509
|
+
/** Step size for the arrow keys; Shift multiplies it by ten. */
|
|
1329
1510
|
step?: number;
|
|
1330
1511
|
/** Fixed decimal places; 0 = whole numbers, undefined = free. */
|
|
1331
1512
|
decimals?: number;
|
|
@@ -1333,8 +1514,8 @@ export declare interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLI
|
|
|
1333
1514
|
prefix?: ReactNode;
|
|
1334
1515
|
/** Adornment after the number, e.g. "€" or "%". */
|
|
1335
1516
|
suffix?: ReactNode;
|
|
1336
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1337
|
-
`ControlSizeProvider` around it, else `md
|
|
1517
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1518
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1338
1519
|
size?: "sm" | "md";
|
|
1339
1520
|
/** The width in characters - room for the number; the field adds its own
|
|
1340
1521
|
padding and steppers, and the room for a `prefix` and `suffix` given as
|
|
@@ -1351,9 +1532,7 @@ export declare interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLI
|
|
|
1351
1532
|
the key does not exist in the data. */
|
|
1352
1533
|
export declare function pathTo<K, S extends Key = string>(roots: readonly K[], reader: NodeReader<K, S>, key: S): S[] | null;
|
|
1353
1534
|
|
|
1354
|
-
/**
|
|
1355
|
-
declare type Place = "top" | "right" | "bottom" | "left";
|
|
1356
|
-
|
|
1535
|
+
/** The plus of `NumberInput`'s step buttons. */
|
|
1357
1536
|
export declare const PlusGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
1358
1537
|
|
|
1359
1538
|
/**
|
|
@@ -1374,6 +1553,7 @@ export declare const PlusGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"
|
|
|
1374
1553
|
*/
|
|
1375
1554
|
export declare function Popover({ open, onOpenChange, anchorRef, focusRef, insideRefs, align, offset, width, minWidth, restoreFocus, hideOnScroll, role, ariaLabel, id, className, children, }: PopoverProps): ReactPortal | null;
|
|
1376
1555
|
|
|
1556
|
+
/** The props of `Popover`. */
|
|
1377
1557
|
export declare interface PopoverProps {
|
|
1378
1558
|
/** Whether the surface stands. Controlled: the popover never opens itself. */
|
|
1379
1559
|
open: boolean;
|
|
@@ -1383,9 +1563,10 @@ export declare interface PopoverProps {
|
|
|
1383
1563
|
/** Trigger the panel hangs from (the reference for the position). */
|
|
1384
1564
|
anchorRef: RefObject<HTMLElement | null>;
|
|
1385
1565
|
/**
|
|
1386
|
-
* Element that receives the focus on closing.
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1566
|
+
* Element that receives the focus on closing. Needed where the anchor is
|
|
1567
|
+
* a non-focusable shell and the actual trigger sits inside it.
|
|
1568
|
+
*
|
|
1569
|
+
* @default anchorRef
|
|
1389
1570
|
*/
|
|
1390
1571
|
focusRef?: RefObject<HTMLElement | null>;
|
|
1391
1572
|
/** Further elements whose click does not count as an outside click (e.g. the clear ×). */
|
|
@@ -1425,15 +1606,20 @@ export declare interface PopoverProps {
|
|
|
1425
1606
|
*/
|
|
1426
1607
|
export declare type PortalTarget = HTMLElement | (() => HTMLElement | null) | null;
|
|
1427
1608
|
|
|
1609
|
+
/** How far a task has come, from 0 to 1 - or, without a value, that it runs.
|
|
1610
|
+
It has no tone: a measured value judged against limits is a `Meter`. */
|
|
1428
1611
|
export declare const ProgressBar: ForwardRefExoticComponent<ProgressBarProps & RefAttributes<HTMLDivElement>>;
|
|
1429
1612
|
|
|
1613
|
+
/** The props of `ProgressBar`. */
|
|
1430
1614
|
export declare interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
1431
1615
|
/** How far the task has come, from 0 to 1. Left out, the bar is
|
|
1432
1616
|
indeterminate: the task runs, and nobody knows how far it is. */
|
|
1433
1617
|
value?: number;
|
|
1434
1618
|
/**
|
|
1435
1619
|
* What is progressing, e.g. "Import of the invoice records". A progress bar
|
|
1436
|
-
* needs a name from the author
|
|
1620
|
+
* needs a name from the author.
|
|
1621
|
+
*
|
|
1622
|
+
* @default the wording's "Progress"
|
|
1437
1623
|
*/
|
|
1438
1624
|
label?: string;
|
|
1439
1625
|
/** What a screen reader says instead of the percentage, where a count says
|
|
@@ -1444,10 +1630,14 @@ export declare interface ProgressBarProps extends HTMLAttributes<HTMLDivElement>
|
|
|
1444
1630
|
showLabel?: boolean;
|
|
1445
1631
|
}
|
|
1446
1632
|
|
|
1633
|
+
/** One choice out of a few possibilities, all of them visible. Controlled
|
|
1634
|
+
through `value` and `onChange`, or uncontrolled from `defaultValue`; the
|
|
1635
|
+
arrow keys move between the possibilities. */
|
|
1447
1636
|
export declare const RadioGroup: <T extends string>(props: RadioGroupProps<T> & {
|
|
1448
1637
|
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
1449
1638
|
}) => React.ReactElement;
|
|
1450
1639
|
|
|
1640
|
+
/** The props of `RadioGroup`. */
|
|
1451
1641
|
export declare interface RadioGroupProps<T extends string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
1452
1642
|
/** The possibilities, in the order in which they are meant to stand. */
|
|
1453
1643
|
options: readonly RadioOption<T>[];
|
|
@@ -1458,18 +1648,21 @@ export declare interface RadioGroupProps<T extends string> extends Omit<HTMLAttr
|
|
|
1458
1648
|
defaultValue?: T | null;
|
|
1459
1649
|
/** Runs on every choice – on the one made with the arrow keys as well. */
|
|
1460
1650
|
onChange?: (value: T) => void;
|
|
1461
|
-
/** Arrangement
|
|
1651
|
+
/** Arrangement: one below the other, or side by side. */
|
|
1462
1652
|
orientation?: "vertical" | "horizontal";
|
|
1463
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1464
|
-
`ControlSizeProvider` around it, else `md
|
|
1653
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1654
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1465
1655
|
size?: "sm" | "md";
|
|
1466
1656
|
/** Disables the whole group. `RadioOption` disables single
|
|
1467
1657
|
possibilities. */
|
|
1468
1658
|
disabled?: boolean;
|
|
1469
|
-
/** Name of the radio group within the form
|
|
1659
|
+
/** Name of the radio group within the form.
|
|
1660
|
+
@default a generated one */
|
|
1470
1661
|
name?: string;
|
|
1471
1662
|
}
|
|
1472
1663
|
|
|
1664
|
+
/** One possibility of a `RadioGroup`: its value, its label and an optional
|
|
1665
|
+
line of explanation. */
|
|
1473
1666
|
export declare interface RadioOption<T extends string> {
|
|
1474
1667
|
/** What comes back when this possibility is chosen. */
|
|
1475
1668
|
value: T;
|
|
@@ -1490,6 +1683,9 @@ export declare interface RadioOption<T extends string> {
|
|
|
1490
1683
|
*/
|
|
1491
1684
|
export declare const rangeDays: (from: Date, to: Date) => number;
|
|
1492
1685
|
|
|
1686
|
+
/** A shortcut in a range picker's panel: its label, and a function that
|
|
1687
|
+
computes the range when it is chosen - so that "Last 7 days" is counted from
|
|
1688
|
+
the moment of the click. */
|
|
1493
1689
|
export declare interface RangePreset {
|
|
1494
1690
|
label: string;
|
|
1495
1691
|
range: () => DateRange;
|
|
@@ -1522,6 +1718,7 @@ export declare function revealPath<K, S extends Key = string>(roots: readonly K[
|
|
|
1522
1718
|
reached: S | null;
|
|
1523
1719
|
};
|
|
1524
1720
|
|
|
1721
|
+
/** What `scrollForRow` needs to know about a scroll area. */
|
|
1525
1722
|
export declare interface RowPlacement {
|
|
1526
1723
|
rowHeight: number;
|
|
1527
1724
|
scrollTop: number;
|
|
@@ -1530,6 +1727,8 @@ export declare interface RowPlacement {
|
|
|
1530
1727
|
headerHeight?: number;
|
|
1531
1728
|
}
|
|
1532
1729
|
|
|
1730
|
+
/** The rows to render - `from` up to, not including, `to` - and the heights
|
|
1731
|
+
of the filler rows that stand for the rest. */
|
|
1533
1732
|
export declare interface RowWindow {
|
|
1534
1733
|
/** First rendered index. */
|
|
1535
1734
|
from: number;
|
|
@@ -1553,6 +1752,46 @@ export declare interface RowWindow {
|
|
|
1553
1752
|
*/
|
|
1554
1753
|
export declare function scrollForRow(index: number, { rowHeight, scrollTop, viewportHeight, headerHeight }: RowPlacement): number | null;
|
|
1555
1754
|
|
|
1755
|
+
/** One choice out of a few short possibilities, drawn as one field with a
|
|
1756
|
+
segment for each - a radio group in what it says and how the keys move.
|
|
1757
|
+
Controlled through `value` and `onChange`, or uncontrolled from
|
|
1758
|
+
`defaultValue`. */
|
|
1759
|
+
export declare const SegmentedControl: <T extends string>(props: SegmentedControlProps<T> & {
|
|
1760
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
1761
|
+
}) => React.ReactElement;
|
|
1762
|
+
|
|
1763
|
+
/** The props of `SegmentedControl`. */
|
|
1764
|
+
export declare interface SegmentedControlProps<T extends string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
1765
|
+
/** The possibilities, two to four, in the order in which they stand. */
|
|
1766
|
+
options: readonly SegmentedOption<T>[];
|
|
1767
|
+
/** The chosen possibility; `null` means: none yet. Together with
|
|
1768
|
+
`onChange` the control is controlled. */
|
|
1769
|
+
value?: T | null;
|
|
1770
|
+
/** Initial value of an uncontrolled control. Not together with `value`. */
|
|
1771
|
+
defaultValue?: T | null;
|
|
1772
|
+
/** Runs on every choice – on the one made with the arrow keys as well. */
|
|
1773
|
+
onChange?: (value: T) => void;
|
|
1774
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1775
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1776
|
+
size?: "sm" | "md";
|
|
1777
|
+
/** Disables the whole control. `SegmentedOption` disables single
|
|
1778
|
+
possibilities. */
|
|
1779
|
+
disabled?: boolean;
|
|
1780
|
+
/** Name of the radio group within the form.
|
|
1781
|
+
@default a generated one */
|
|
1782
|
+
name?: string;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
/** One possibility of a `SegmentedControl`: its value and its short label. */
|
|
1786
|
+
export declare interface SegmentedOption<T extends string> {
|
|
1787
|
+
/** What comes back when this possibility is chosen. */
|
|
1788
|
+
value: T;
|
|
1789
|
+
/** The segment's word - a short one; a long label ends in an ellipsis. */
|
|
1790
|
+
label: ReactNode;
|
|
1791
|
+
/** Takes the possibility out of the choice but leaves it visible. */
|
|
1792
|
+
disabled?: boolean;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1556
1795
|
/**
|
|
1557
1796
|
* The select field. The `<select>` holds the value, the form and the keys;
|
|
1558
1797
|
* under a mouse, a pen and the keyboard it opens the library's own list - the
|
|
@@ -1561,9 +1800,11 @@ export declare function scrollForRow(index: number, { rowHeight, scrollTop, view
|
|
|
1561
1800
|
*/
|
|
1562
1801
|
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLSelectElement>>;
|
|
1563
1802
|
|
|
1803
|
+
/** The props of `Select`: a native select's attributes, with `size` meaning
|
|
1804
|
+
the control's height. */
|
|
1564
1805
|
export declare interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
1565
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1566
|
-
`ControlSizeProvider` around it, else `md
|
|
1806
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1807
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1567
1808
|
size?: "sm" | "md";
|
|
1568
1809
|
/** The width in characters - room for the chosen option; the field adds
|
|
1569
1810
|
its own padding, chevron and cross. Given, the field is that wide
|
|
@@ -1603,8 +1844,12 @@ export declare interface Separators {
|
|
|
1603
1844
|
punctuation. */
|
|
1604
1845
|
export declare function separatorsOf(formats: Formats): Separators;
|
|
1605
1846
|
|
|
1847
|
+
/** Sets the active node; `null` for none. Returns the same snapshot where
|
|
1848
|
+
nothing changes. */
|
|
1606
1849
|
export declare function setActive<S extends Key>(snapshot: TreeSnapshot<S>, key: S | null): TreeSnapshot<S>;
|
|
1607
1850
|
|
|
1851
|
+
/** Sets the node a range selection spans from; `null` for none. Returns the
|
|
1852
|
+
same snapshot where nothing changes. */
|
|
1608
1853
|
export declare function setAnchor<S extends Key>(snapshot: TreeSnapshot<S>, key: S | null): TreeSnapshot<S>;
|
|
1609
1854
|
|
|
1610
1855
|
/**
|
|
@@ -1630,15 +1875,20 @@ export declare type Side = "upper" | "lower";
|
|
|
1630
1875
|
/** Loading placeholder with a restrained pulse; respects prefers-reduced-motion. */
|
|
1631
1876
|
export declare const Skeleton: ForwardRefExoticComponent<SkeletonProps & RefAttributes<HTMLSpanElement>>;
|
|
1632
1877
|
|
|
1878
|
+
/** The props of `Skeleton`. */
|
|
1633
1879
|
export declare interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1634
|
-
/** Width, e.g. "120px" or "60%".
|
|
1880
|
+
/** Width, e.g. "120px" or "60%".
|
|
1881
|
+
@default "100%" */
|
|
1635
1882
|
width?: string | number;
|
|
1636
|
-
/** Height,
|
|
1883
|
+
/** Height, e.g. "12px" or 16.
|
|
1884
|
+
@default "12px" */
|
|
1637
1885
|
height?: string | number;
|
|
1638
1886
|
/** Circular shape, e.g. for an avatar placeholder. */
|
|
1639
1887
|
circle?: boolean;
|
|
1640
1888
|
}
|
|
1641
1889
|
|
|
1890
|
+
/** One value on a track between `min` and `max`, on the native range input;
|
|
1891
|
+
`marks` set labelled points on the track. */
|
|
1642
1892
|
export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLInputElement>>;
|
|
1643
1893
|
|
|
1644
1894
|
/** A mark on the track: a value, or a value with the word beneath it. */
|
|
@@ -1647,43 +1897,49 @@ export declare type SliderMark = number | {
|
|
|
1647
1897
|
label?: ReactNode;
|
|
1648
1898
|
};
|
|
1649
1899
|
|
|
1900
|
+
/** The props of `Slider`. */
|
|
1650
1901
|
export declare interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> {
|
|
1651
1902
|
/** Controlled: the value. */
|
|
1652
1903
|
value?: number;
|
|
1653
|
-
/** Uncontrolled: the value to start at.
|
|
1904
|
+
/** Uncontrolled: the value to start at.
|
|
1905
|
+
@default min */
|
|
1654
1906
|
defaultValue?: number;
|
|
1655
1907
|
/** Reports every change, by pointer or key, as a number on the step. */
|
|
1656
1908
|
onChange?: (value: number) => void;
|
|
1657
|
-
/**
|
|
1909
|
+
/** The smallest value. */
|
|
1658
1910
|
min?: number;
|
|
1659
|
-
/**
|
|
1911
|
+
/** The largest value. */
|
|
1660
1912
|
max?: number;
|
|
1661
|
-
/**
|
|
1913
|
+
/** The step the value moves by, by pointer or key. */
|
|
1662
1914
|
step?: number;
|
|
1663
1915
|
/** Values marked on the track; an object with a `label` writes the word
|
|
1664
1916
|
beneath its mark. A mark shows a value, it does not catch the thumb. */
|
|
1665
1917
|
marks?: readonly SliderMark[];
|
|
1666
1918
|
/** The value as text: for the readout and for the screen reader
|
|
1667
|
-
(`aria-valuetext`).
|
|
1668
|
-
|
|
1919
|
+
(`aria-valuetext`).
|
|
1920
|
+
@default the number in the formats' notation, with as many decimals as
|
|
1921
|
+
the step has */
|
|
1669
1922
|
format?: (value: number) => string;
|
|
1670
|
-
/** The value in mono beside the track.
|
|
1923
|
+
/** The value in mono beside the track. */
|
|
1671
1924
|
showValue?: boolean;
|
|
1672
1925
|
}
|
|
1673
1926
|
|
|
1927
|
+
/** A step of the spacing scale, from 1 (4 px) to 8 (40 px) - the tokens
|
|
1928
|
+
`--u-space-1` to `--u-space-8`. */
|
|
1674
1929
|
export declare type SpaceStep = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
1675
1930
|
|
|
1676
1931
|
/** A miniature trend line for table cells; the end point carries the accent. */
|
|
1677
1932
|
export declare const Sparkline: ForwardRefExoticComponent<SparklineProps & RefAttributes<HTMLSpanElement>>;
|
|
1678
1933
|
|
|
1934
|
+
/** The props of `Sparkline`. */
|
|
1679
1935
|
export declare interface SparklineProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1680
1936
|
/** Values in chronological order; at least two. */
|
|
1681
1937
|
data: readonly number[];
|
|
1682
|
-
/** Width in pixels
|
|
1938
|
+
/** Width in pixels; the default is a row width, not a chart width. `"fill"`
|
|
1683
1939
|
takes the width of its container, as a tile's history does; the line
|
|
1684
1940
|
keeps its stroke and the end point stays round. */
|
|
1685
1941
|
width?: number | "fill";
|
|
1686
|
-
/** Height in pixels
|
|
1942
|
+
/** Height in pixels; the default is as high as a table row. With `width`
|
|
1687
1943
|
`"fill"` a stylesheet may set the height instead: the drawing follows
|
|
1688
1944
|
its box. */
|
|
1689
1945
|
height?: number;
|
|
@@ -1695,13 +1951,19 @@ export declare interface SparklineProps extends HTMLAttributes<HTMLSpanElement>
|
|
|
1695
1951
|
/** Restrained loading indicator; inherits the text colour of its context. */
|
|
1696
1952
|
export declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<SVGSVGElement>>;
|
|
1697
1953
|
|
|
1954
|
+
/** The props of `Spinner`. */
|
|
1698
1955
|
export declare interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
|
|
1699
1956
|
/** Edge length in pixels. */
|
|
1700
1957
|
size?: number;
|
|
1701
1958
|
}
|
|
1702
1959
|
|
|
1960
|
+
/** A main action with a menu of its variants: the button on the left runs
|
|
1961
|
+
`onClick`, the arrow on the right opens `menu`. The ref goes to the main
|
|
1962
|
+
button. */
|
|
1703
1963
|
export declare const SplitButton: ForwardRefExoticComponent<SplitButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
1704
1964
|
|
|
1965
|
+
/** The props of `SplitButton`: a `Button`'s for the main action, plus the
|
|
1966
|
+
menu's entries. */
|
|
1705
1967
|
export declare interface SplitButtonProps extends Omit<ButtonProps, "children" | "size" | "variant"> {
|
|
1706
1968
|
/** Label of the main action. */
|
|
1707
1969
|
children: ReactNode;
|
|
@@ -1711,46 +1973,52 @@ export declare interface SplitButtonProps extends Omit<ButtonProps, "children" |
|
|
|
1711
1973
|
menu: ReactNode;
|
|
1712
1974
|
/** How loud the main action is; the trigger beside it follows suit. */
|
|
1713
1975
|
variant?: ButtonVariant;
|
|
1714
|
-
/** `sm` for buttons in header bars and table rows, `md` otherwise.
|
|
1715
|
-
the size around it, else `md
|
|
1976
|
+
/** `sm` for buttons in header bars and table rows, `md` otherwise.
|
|
1977
|
+
@default the size around it, else `"md"` */
|
|
1716
1978
|
size?: ButtonSize;
|
|
1717
|
-
/** Label of the trigger
|
|
1979
|
+
/** Label of the trigger.
|
|
1980
|
+
@default the wording's "More actions" */
|
|
1718
1981
|
menuLabel?: string;
|
|
1719
1982
|
/** Alignment of the menu relative to the trigger. */
|
|
1720
1983
|
align?: "start" | "end";
|
|
1721
1984
|
}
|
|
1722
1985
|
|
|
1986
|
+
/** Two panes and the line between them. The line can be dragged, moved with
|
|
1987
|
+
the arrow keys, and Enter collapses the first pane and brings it back. */
|
|
1723
1988
|
export declare const Splitter: ForwardRefExoticComponent<SplitterProps & RefAttributes<HTMLDivElement>>;
|
|
1724
1989
|
|
|
1990
|
+
/** The props of `Splitter`. */
|
|
1725
1991
|
export declare interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children"> {
|
|
1726
1992
|
/** How the two panes stand: `horizontal` side by side, `vertical` one
|
|
1727
|
-
above the other - a trend above, its alarms below.
|
|
1993
|
+
above the other - a trend above, its alarms below. */
|
|
1728
1994
|
orientation?: "horizontal" | "vertical";
|
|
1729
1995
|
/** Controlled: the first pane's share of the room, in per cent. */
|
|
1730
1996
|
value?: number;
|
|
1731
|
-
/** Uncontrolled: the share to start at.
|
|
1997
|
+
/** Uncontrolled: the share to start at. */
|
|
1732
1998
|
defaultValue?: number;
|
|
1733
1999
|
/** Reports every move, by pointer or key, as the first pane's share. */
|
|
1734
2000
|
onChange?: (value: number) => void;
|
|
1735
|
-
/** The smallest share of the first pane, and where Enter collapses it to.
|
|
1736
|
-
Default: 0 */
|
|
2001
|
+
/** The smallest share of the first pane, and where Enter collapses it to. */
|
|
1737
2002
|
min?: number;
|
|
1738
|
-
/** The largest share of the first pane.
|
|
2003
|
+
/** The largest share of the first pane. */
|
|
1739
2004
|
max?: number;
|
|
1740
|
-
/** How far an arrow key moves the separator, in per cent.
|
|
2005
|
+
/** How far an arrow key moves the separator, in per cent. */
|
|
1741
2006
|
step?: number;
|
|
1742
|
-
/** The separator's name. The APG names it after the first pane ("Trend")
|
|
1743
|
-
|
|
2007
|
+
/** The separator's name. The APG names it after the first pane ("Trend").
|
|
2008
|
+
@default the wording's "Resize the panes" */
|
|
1744
2009
|
separatorLabel?: string;
|
|
1745
2010
|
/** The first pane and the second, in this order. */
|
|
1746
2011
|
children: [ReactNode, ReactNode];
|
|
1747
2012
|
}
|
|
1748
2013
|
|
|
2014
|
+
/** Children below or beside one another, spaced by a step of the spacing
|
|
2015
|
+
scale. */
|
|
1749
2016
|
export declare const Stack: ForwardRefExoticComponent<StackProps & RefAttributes<HTMLDivElement>>;
|
|
1750
2017
|
|
|
2018
|
+
/** The props of `Stack`. */
|
|
1751
2019
|
export declare interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
1752
|
-
/** Below one another or beside one another.
|
|
1753
|
-
|
|
2020
|
+
/** Below one another or beside one another. Below is the direction content
|
|
2021
|
+
stands in anyway, without being asked. */
|
|
1754
2022
|
direction?: "row" | "column";
|
|
1755
2023
|
/** Spacing as a step of the 4 px spacing steps (1–8). */
|
|
1756
2024
|
gap?: SpaceStep;
|
|
@@ -1765,6 +2033,7 @@ export declare interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1765
2033
|
/** Metric tile: one value, read against its limits. */
|
|
1766
2034
|
export declare const Stat: ForwardRefExoticComponent<StatProps & RefAttributes<HTMLDivElement>>;
|
|
1767
2035
|
|
|
2036
|
+
/** The props of `Stat`. */
|
|
1768
2037
|
export declare interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1769
2038
|
/** What is being measured. */
|
|
1770
2039
|
label: string;
|
|
@@ -1788,8 +2057,11 @@ export declare interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
1788
2057
|
ages?: FreshnessAges;
|
|
1789
2058
|
}
|
|
1790
2059
|
|
|
2060
|
+
/** Where a procedure stands: its steps in order, done, current, upcoming or
|
|
2061
|
+
failed. Moving on is yours - `current` is a prop. */
|
|
1791
2062
|
export declare const Stepper: ForwardRefExoticComponent<StepperProps & RefAttributes<HTMLOListElement>>;
|
|
1792
2063
|
|
|
2064
|
+
/** The props of `Stepper`. */
|
|
1793
2065
|
export declare interface StepperProps extends HTMLAttributes<HTMLOListElement> {
|
|
1794
2066
|
/** The steps in the order they are walked. */
|
|
1795
2067
|
steps: readonly StepperStep[];
|
|
@@ -1797,7 +2069,7 @@ export declare interface StepperProps extends HTMLAttributes<HTMLOListElement> {
|
|
|
1797
2069
|
the ones after it upcoming; past the last step, every step is done. */
|
|
1798
2070
|
current: number;
|
|
1799
2071
|
/** `horizontal` in a row, `vertical` in a column for steps with longer
|
|
1800
|
-
descriptions.
|
|
2072
|
+
descriptions. */
|
|
1801
2073
|
orientation?: "horizontal" | "vertical";
|
|
1802
2074
|
}
|
|
1803
2075
|
|
|
@@ -1812,25 +2084,35 @@ export declare interface StepperStep {
|
|
|
1812
2084
|
failed?: boolean;
|
|
1813
2085
|
}
|
|
1814
2086
|
|
|
2087
|
+
/** An on/off switch that takes effect at once - a native checkbox with
|
|
2088
|
+
`role="switch"`. Where the choice waits for a Save button, use `Checkbox`. */
|
|
1815
2089
|
export declare const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLInputElement>>;
|
|
1816
2090
|
|
|
2091
|
+
/** The props of `Switch`: a native checkbox's attributes and its label. */
|
|
1817
2092
|
export declare interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "role"> {
|
|
1818
2093
|
/** Label to the right of the switch. */
|
|
1819
2094
|
label?: ReactNode;
|
|
1820
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1821
|
-
`ControlSizeProvider` around it, else `md
|
|
2095
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
2096
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1822
2097
|
size?: "sm" | "md";
|
|
1823
2098
|
/** Marks the switch as invalid. `FormField` sets it itself as soon as it
|
|
1824
2099
|
carries an `error` - by hand only necessary without `FormField`. */
|
|
1825
2100
|
invalid?: boolean;
|
|
1826
2101
|
}
|
|
1827
2102
|
|
|
2103
|
+
/** One tab of a `TabList`; choosing it shows the `TabPanel` of the same
|
|
2104
|
+
`value`. */
|
|
1828
2105
|
export declare const Tab: ForwardRefExoticComponent<TabProps & RefAttributes<HTMLButtonElement>>;
|
|
1829
2106
|
|
|
2107
|
+
/** The row of `Tab`s inside `Tabs`. The arrow keys, Home and End move
|
|
2108
|
+
between the tabs and choose them. */
|
|
1830
2109
|
export declare const TabList: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
|
|
1831
2110
|
|
|
2111
|
+
/** The content of one tab. Only the panel whose `value` is chosen stands in
|
|
2112
|
+
the document. */
|
|
1832
2113
|
export declare const TabPanel: ForwardRefExoticComponent<TabPanelProps & RefAttributes<HTMLDivElement>>;
|
|
1833
2114
|
|
|
2115
|
+
/** The props of `TabPanel`. */
|
|
1834
2116
|
export declare interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
1835
2117
|
/** The value of the tab this panel belongs to. Only the matching panel
|
|
1836
2118
|
stands in the document – a hidden panel would keep focus, scroll
|
|
@@ -1838,13 +2120,17 @@ export declare interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1838
2120
|
value: string;
|
|
1839
2121
|
}
|
|
1840
2122
|
|
|
2123
|
+
/** The props of `Tab`. */
|
|
1841
2124
|
export declare interface TabProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1842
2125
|
/** The value this tab reports – and under which its panel stands. */
|
|
1843
2126
|
value: string;
|
|
1844
2127
|
}
|
|
1845
2128
|
|
|
2129
|
+
/** Tabs: a `TabList` of `Tab`s and one `TabPanel` per value. Controlled
|
|
2130
|
+
through `value` and `onChange`, or uncontrolled from `defaultValue`. */
|
|
1846
2131
|
export declare const Tabs: ForwardRefExoticComponent<TabsProps & RefAttributes<HTMLDivElement>>;
|
|
1847
2132
|
|
|
2133
|
+
/** The props of `Tabs`. */
|
|
1848
2134
|
export declare interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
1849
2135
|
/** The value of the visible tab. Controlled, `Tabs` remember nothing, so
|
|
1850
2136
|
that the tab can come out of an address. */
|
|
@@ -1857,15 +2143,22 @@ export declare interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
1857
2143
|
onChange?: (value: string) => void;
|
|
1858
2144
|
}
|
|
1859
2145
|
|
|
2146
|
+
/** A short label with a tone; with `onRemove` it carries a cross that removes
|
|
2147
|
+
it. Inside a `TagGroup` it is a list entry, and Delete or Backspace remove
|
|
2148
|
+
it too. */
|
|
1860
2149
|
export declare const Tag: ForwardRefExoticComponent<TagProps & RefAttributes<HTMLSpanElement>>;
|
|
1861
2150
|
|
|
2151
|
+
/** A list of `Tag`s with one tab stop: the arrow keys move between them, and
|
|
2152
|
+
the focus stays in the group when one is removed. */
|
|
1862
2153
|
export declare const TagGroup: ForwardRefExoticComponent<TagGroupProps & RefAttributes<HTMLDivElement>>;
|
|
1863
2154
|
|
|
2155
|
+
/** The props of `TagGroup`: a div's attributes, with a required name. */
|
|
1864
2156
|
export declare interface TagGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
1865
2157
|
/** Label of the group for the screen reader. */
|
|
1866
2158
|
"aria-label": string;
|
|
1867
2159
|
}
|
|
1868
2160
|
|
|
2161
|
+
/** The props of `Tag`. */
|
|
1869
2162
|
export declare interface TagProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onRemove"> {
|
|
1870
2163
|
/** What the label stands for. The tone is never the only information: the
|
|
1871
2164
|
text beside it says the same thing once more. */
|
|
@@ -1884,16 +2177,25 @@ export declare interface TagProps extends Omit<HTMLAttributes<HTMLSpanElement>,
|
|
|
1884
2177
|
disabled?: boolean;
|
|
1885
2178
|
}
|
|
1886
2179
|
|
|
2180
|
+
/** What a tag stands for - never the only statement, its text says it too. */
|
|
1887
2181
|
export declare type TagTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
1888
2182
|
|
|
2183
|
+
/** Body text from the token set; `as` chooses the element, independent of the
|
|
2184
|
+
size. */
|
|
1889
2185
|
declare const Text_2: ForwardRefExoticComponent<TextProps & RefAttributes<HTMLElement>>;
|
|
1890
2186
|
export { Text_2 as Text }
|
|
1891
2187
|
|
|
2188
|
+
/** A text field for several lines. `chars` sets the length of a line,
|
|
2189
|
+
`autoGrow` lets it grow with its content up to `maxRows`, `showCount` counts
|
|
2190
|
+
against `maxLength`. Inside a `FormField` it takes the field's id,
|
|
2191
|
+
description and invalid state. */
|
|
1892
2192
|
export declare const Textarea: ForwardRefExoticComponent<TextareaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
1893
2193
|
|
|
2194
|
+
/** The props of `Textarea`: a native textarea's attributes, with `chars` in
|
|
2195
|
+
place of `cols`. */
|
|
1894
2196
|
export declare interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "cols"> {
|
|
1895
|
-
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
1896
|
-
`ControlSizeProvider` around it, else `md
|
|
2197
|
+
/** `sm` for a toolbar and dense forms, `md` otherwise.
|
|
2198
|
+
@default the size of a `ControlSizeProvider` around it, else `"md"` */
|
|
1897
2199
|
size?: "sm" | "md";
|
|
1898
2200
|
/** The width in characters - the length of a line; the field adds its own
|
|
1899
2201
|
padding. Given, the field is that wide wherever it stands, and never
|
|
@@ -1910,15 +2212,17 @@ export declare interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLT
|
|
|
1910
2212
|
/** Shows at the bottom right how many characters still fit.
|
|
1911
2213
|
Needs `maxLength`. */
|
|
1912
2214
|
showCount?: boolean;
|
|
1913
|
-
/** Whether the browser's handle for dragging is offered.
|
|
1914
|
-
|
|
2215
|
+
/** Whether the browser's handle for dragging is offered.
|
|
2216
|
+
@default `"none"` while the field grows by itself, else `"vertical"` */
|
|
1915
2217
|
resize?: "none" | "vertical";
|
|
1916
2218
|
}
|
|
1917
2219
|
|
|
1918
|
-
|
|
2220
|
+
/** The line height of the token set. */
|
|
2221
|
+
export declare type TextLeading = "normal" | "tight";
|
|
1919
2222
|
|
|
2223
|
+
/** The props of `Text`. */
|
|
1920
2224
|
export declare interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
1921
|
-
/** Element to render as.
|
|
2225
|
+
/** Element to render as. */
|
|
1922
2226
|
as?: ElementType;
|
|
1923
2227
|
/** Type size from the token set. It is independent of the element: a `p`
|
|
1924
2228
|
may be small without becoming a different element. */
|
|
@@ -1938,14 +2242,20 @@ export declare interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
|
1938
2242
|
leading?: TextLeading;
|
|
1939
2243
|
}
|
|
1940
2244
|
|
|
2245
|
+
/** A type size of the token set. */
|
|
1941
2246
|
export declare type TextSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
1942
2247
|
|
|
2248
|
+
/** How loud a text is; `secondary` and `muted` step back without falling below
|
|
2249
|
+
the contrast threshold. */
|
|
1943
2250
|
export declare type TextTone = "default" | "secondary" | "muted";
|
|
1944
2251
|
|
|
1945
|
-
|
|
2252
|
+
/** The letter spacing of the token set. */
|
|
2253
|
+
export declare type TextTracking = "normal" | "tight" | "display" | "caps";
|
|
1946
2254
|
|
|
2255
|
+
/** A font weight of the token set. */
|
|
1947
2256
|
export declare type TextWeight = "regular" | "medium" | "semibold";
|
|
1948
2257
|
|
|
2258
|
+
/** The one action a toast may carry, e.g. "Undo". */
|
|
1949
2259
|
export declare interface ToastAction {
|
|
1950
2260
|
/** A verb for what it does - "Undo", "Show". */
|
|
1951
2261
|
label: string;
|
|
@@ -1957,14 +2267,18 @@ export declare interface ToastAction {
|
|
|
1957
2267
|
one), or its action was taken. */
|
|
1958
2268
|
export declare type ToastCloseReason = "timeout" | "dismiss" | "action";
|
|
1959
2269
|
|
|
2270
|
+
/** The defaults for every toast, set on `UmrissProvider`'s `toast`. */
|
|
1960
2271
|
export declare interface ToastConfig {
|
|
1961
|
-
/** Display duration in ms, where the individual toast names none.
|
|
2272
|
+
/** Display duration in ms, where the individual toast names none.
|
|
2273
|
+
@default 5000 */
|
|
1962
2274
|
duration?: number;
|
|
1963
|
-
/** Where the toasts stand.
|
|
1964
|
-
|
|
2275
|
+
/** Where the toasts stand. There is no position per toast - toasts that
|
|
2276
|
+
stand in different places are not read as one.
|
|
2277
|
+
@default "bottom-end" */
|
|
1965
2278
|
position?: ToastPosition;
|
|
1966
2279
|
/** How many toasts stand at once; the oldest gives way to a new one, as if
|
|
1967
|
-
it had been closed.
|
|
2280
|
+
it had been closed.
|
|
2281
|
+
@default 3 */
|
|
1968
2282
|
limit?: number;
|
|
1969
2283
|
}
|
|
1970
2284
|
|
|
@@ -1980,6 +2294,8 @@ declare interface ToastContextValue {
|
|
|
1980
2294
|
dismiss: (id: number) => void;
|
|
1981
2295
|
}
|
|
1982
2296
|
|
|
2297
|
+
/** What a toast says and how - what `toast()` and `update()` from `useToast`
|
|
2298
|
+
take. */
|
|
1983
2299
|
export declare interface ToastOptions {
|
|
1984
2300
|
/** What has happened – short, about one line (some 45 characters), in the
|
|
1985
2301
|
perfect tense and not a request: "Invoice not sent". Why, and
|
|
@@ -1994,7 +2310,8 @@ export declare interface ToastOptions {
|
|
|
1994
2310
|
shows a spinner, has no close button and does not leave by itself: turn
|
|
1995
2311
|
it into its outcome with `update`. */
|
|
1996
2312
|
tone?: ToastTone;
|
|
1997
|
-
/** Display duration in ms; 0 = stays until closed by hand.
|
|
2313
|
+
/** Display duration in ms; 0 = stays until closed by hand.
|
|
2314
|
+
@default the provider's `duration`, else `5000` */
|
|
1998
2315
|
duration?: number;
|
|
1999
2316
|
/** One action - "Undo". Never the only way to do what it offers: the toast
|
|
2000
2317
|
leaves by itself, and not everybody reaches it in time. More than one
|
|
@@ -2008,6 +2325,9 @@ export declare interface ToastOptions {
|
|
|
2008
2325
|
phone they take the width of the window, and only the edge counts. */
|
|
2009
2326
|
export declare type ToastPosition = "top-start" | "top-center" | "top-end" | "bottom-start" | "bottom-center" | "bottom-end";
|
|
2010
2327
|
|
|
2328
|
+
/** Holds the toasts and draws them; `useToast` works only below it. Put it
|
|
2329
|
+
once at the root of the application. Duration, position and limit come from
|
|
2330
|
+
`UmrissProvider`'s `toast` where one stands around it. */
|
|
2011
2331
|
export declare function ToastProvider({ children }: {
|
|
2012
2332
|
children: ReactNode;
|
|
2013
2333
|
}): JSX.Element;
|
|
@@ -2031,6 +2351,7 @@ export declare function toggleCheck<K, S extends Key = string>(roots: readonly K
|
|
|
2031
2351
|
/** Appears on hover and keyboard focus; purely descriptive (role="tooltip"). */
|
|
2032
2352
|
export declare function Tooltip({ content, children, delay }: TooltipProps): JSX.Element;
|
|
2033
2353
|
|
|
2354
|
+
/** The props of `Tooltip`. */
|
|
2034
2355
|
export declare interface TooltipProps {
|
|
2035
2356
|
/** Short help text; no interaction, no long content. */
|
|
2036
2357
|
content: ReactNode;
|
|
@@ -2041,6 +2362,8 @@ export declare interface TooltipProps {
|
|
|
2041
2362
|
delay?: number;
|
|
2042
2363
|
}
|
|
2043
2364
|
|
|
2365
|
+
/** What `useTree` returns: the visible nodes and the gestures on them. Hand it
|
|
2366
|
+
to `TreeView` and `TreeSearch`. */
|
|
2044
2367
|
export declare interface Tree<K, S extends Key = string> {
|
|
2045
2368
|
/** The visible nodes – complete, even where only a window of them is
|
|
2046
2369
|
rendered. Positions and sibling counts come from here and never from
|
|
@@ -2102,6 +2425,8 @@ export declare interface Tree<K, S extends Key = string> {
|
|
|
2102
2425
|
*/
|
|
2103
2426
|
export declare function treeModel<K, S extends Key = string>(roots: readonly K[], reader: NodeReader<K, S>, snapshot: TreeSnapshot<S>): readonly FlatteningEntry<K, S>[];
|
|
2104
2427
|
|
|
2428
|
+
/** The options of `useTree`: how a node is read, and each of its values
|
|
2429
|
+
either uncontrolled (`default…`) or controlled with its `on…` handler. */
|
|
2105
2430
|
export declare interface TreeOptions<K, S extends Key = string> {
|
|
2106
2431
|
reader: NodeReader<K, S>;
|
|
2107
2432
|
/** Initial values, where the tree holds its own state. */
|
|
@@ -2138,16 +2463,23 @@ export declare interface TreeOptions<K, S extends Key = string> {
|
|
|
2138
2463
|
virtual?: VirtualOptions;
|
|
2139
2464
|
}
|
|
2140
2465
|
|
|
2466
|
+
/** The search field of a tree: an `Input` that writes into the tree's search
|
|
2467
|
+
text, so that the `TreeView` filters on it. */
|
|
2141
2468
|
export declare const TreeSearch: <K, S extends Key = string>(props: TreeSearchProps<K, S> & {
|
|
2142
2469
|
ref?: ForwardedRef<HTMLInputElement>;
|
|
2143
2470
|
}) => ReactNode;
|
|
2144
2471
|
|
|
2472
|
+
/** The props of `TreeSearch`: an `Input`'s, with the tree in place of `value`
|
|
2473
|
+
and `onChange`. */
|
|
2145
2474
|
export declare interface TreeSearchProps<K, S extends Key = string> extends Omit<InputProps, "value" | "onChange" | "type"> {
|
|
2146
2475
|
/** The same tree as the view's. The field does not hold the text itself –
|
|
2147
2476
|
it belongs to the tree, because the flattening depends on it. */
|
|
2148
2477
|
tree: Tree<K, S>;
|
|
2149
2478
|
}
|
|
2150
2479
|
|
|
2480
|
+
/** The whole state of a tree, as plain values: the open branches, the checked
|
|
2481
|
+
nodes, the active node, the anchor and the search text. The transitions take
|
|
2482
|
+
one and return the next. */
|
|
2151
2483
|
export declare interface TreeSnapshot<S extends Key = string> {
|
|
2152
2484
|
expanded: ReadonlySet<S>;
|
|
2153
2485
|
checked: ReadonlySet<S>;
|
|
@@ -2159,10 +2491,14 @@ export declare interface TreeSnapshot<S extends Key = string> {
|
|
|
2159
2491
|
search: string;
|
|
2160
2492
|
}
|
|
2161
2493
|
|
|
2494
|
+
/** The tree as a control: draws the nodes of a `Tree` from `useTree` as a
|
|
2495
|
+
`tree` with keyboard navigation, typeahead and, with `checkable`, ticks.
|
|
2496
|
+
What a node says is yours - `children` renders it. */
|
|
2162
2497
|
export declare const TreeView: <K, S extends Key = string>(props: TreeViewProps<K, S> & {
|
|
2163
2498
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
2164
2499
|
}) => ReactNode;
|
|
2165
2500
|
|
|
2501
|
+
/** The props of `TreeView`. */
|
|
2166
2502
|
export declare interface TreeViewProps<K, S extends Key = string> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2167
2503
|
/** The tree from `useTree`. It is the whole state: flattening, active node,
|
|
2168
2504
|
checks, anchor. The view holds nothing beside it. */
|
|
@@ -2190,6 +2526,8 @@ export declare interface TreeViewProps<K, S extends Key = string> extends Omit<H
|
|
|
2190
2526
|
*/
|
|
2191
2527
|
export declare function typeaheadTarget<K, S extends Key = string>(flattening: readonly FlatteningEntry<K, S>[], prefix: string, active: S | null): S | null;
|
|
2192
2528
|
|
|
2529
|
+
/** The settings of `UmrissProvider` as the components read them, every value
|
|
2530
|
+
filled in. */
|
|
2193
2531
|
export declare interface UmrissConfig {
|
|
2194
2532
|
density: Density;
|
|
2195
2533
|
portalTarget: PortalTarget;
|
|
@@ -2205,12 +2543,14 @@ export declare interface UmrissConfig {
|
|
|
2205
2543
|
*/
|
|
2206
2544
|
export declare function UmrissProvider({ density, portalTarget, toast, language, children, }: UmrissProviderProps): JSX.Element;
|
|
2207
2545
|
|
|
2546
|
+
/** The props of `UmrissProvider`. */
|
|
2208
2547
|
export declare interface UmrissProviderProps {
|
|
2209
2548
|
/**
|
|
2210
2549
|
* The default for the `density` of every component that reads it with
|
|
2211
2550
|
* `useDensityFor` - in `@umriss-ui/table` `Table` and `AlarmList`
|
|
2212
|
-
* ("comfortable" means "regular").
|
|
2213
|
-
*
|
|
2551
|
+
* ("comfortable" means "regular").
|
|
2552
|
+
*
|
|
2553
|
+
* @default none - a component keeps its own density
|
|
2214
2554
|
*/
|
|
2215
2555
|
density?: Density;
|
|
2216
2556
|
/**
|
|
@@ -2224,7 +2564,11 @@ export declare interface UmrissProviderProps {
|
|
|
2224
2564
|
/** The setting for toasts: the display duration where the individual toast
|
|
2225
2565
|
names none, where they stand, and how many stand at once. */
|
|
2226
2566
|
toast?: ToastConfig;
|
|
2227
|
-
/**
|
|
2567
|
+
/**
|
|
2568
|
+
* Formats and wording, entry by entry - see [Language](#/language).
|
|
2569
|
+
*
|
|
2570
|
+
* @default none - the surrounding language holds, English at the root
|
|
2571
|
+
*/
|
|
2228
2572
|
language?: LanguageOptions;
|
|
2229
2573
|
/** The subtree the settings apply to. */
|
|
2230
2574
|
children: ReactNode;
|
|
@@ -2286,6 +2630,14 @@ export declare function useToast(): ToastContextValue;
|
|
|
2286
2630
|
/** The setting for toasts; without a provider, empty. */
|
|
2287
2631
|
export declare const useToastConfig: () => ToastConfig;
|
|
2288
2632
|
|
|
2633
|
+
/** The state of a tree - which branches are open, which nodes are checked,
|
|
2634
|
+
the active node, the anchor and the search text - and the gestures on it.
|
|
2635
|
+
Each of these can be controlled from outside, so that a tree can be
|
|
2636
|
+
restored from a link.
|
|
2637
|
+
@param roots The top-level nodes, in your own type.
|
|
2638
|
+
@param options How a node is read, and the initial or controlled state with
|
|
2639
|
+
its change handlers.
|
|
2640
|
+
@returns The tree to hand to `TreeView` and `TreeSearch`. */
|
|
2289
2641
|
export declare function useTree<K, S extends Key = string>(roots: readonly K[], options: TreeOptions<K, S>): Tree<K, S>;
|
|
2290
2642
|
|
|
2291
2643
|
/** The whole configuration; without a provider, the defaults. */
|
|
@@ -2318,6 +2670,7 @@ export declare type Verdict = "ok" | "unknown" | "warning" | "alarm";
|
|
|
2318
2670
|
reinvented at every call site. */
|
|
2319
2671
|
export declare function verdictWeight(verdict: Verdict): number;
|
|
2320
2672
|
|
|
2673
|
+
/** The options of `useVirtual`. */
|
|
2321
2674
|
export declare interface VirtualOptions {
|
|
2322
2675
|
/**
|
|
2323
2676
|
* Expected row height in pixels. It is re-measured on a real row after the
|
|
@@ -2325,10 +2678,13 @@ export declare interface VirtualOptions {
|
|
|
2325
2678
|
* window is not empty.
|
|
2326
2679
|
*/
|
|
2327
2680
|
rowHeight: number;
|
|
2328
|
-
/** Rows above and below the visible area.
|
|
2681
|
+
/** Rows above and below the visible area.
|
|
2682
|
+
@default 4 */
|
|
2329
2683
|
overscan?: number;
|
|
2330
2684
|
}
|
|
2331
2685
|
|
|
2686
|
+
/** What `useVirtual` returns: the ref for the scroll area, the window of rows
|
|
2687
|
+
to render and the heights of the filler rows around it. */
|
|
2332
2688
|
export declare interface VirtualRows {
|
|
2333
2689
|
/** Goes on the scroll area - in @umriss-ui/table on the table's frame; hangs
|
|
2334
2690
|
the ref and the scroll listener on it. */
|
|
@@ -2357,17 +2713,23 @@ export declare interface VirtualRows {
|
|
|
2357
2713
|
*/
|
|
2358
2714
|
export declare function visibleWindow({ count, rowHeight, scrollTop, viewportHeight, overscan, }: WindowInput): RowWindow;
|
|
2359
2715
|
|
|
2716
|
+
/** Content for the screen reader only: out of sight, but read out. With
|
|
2717
|
+
`focusable` it shows once it has the focus - a skip link. */
|
|
2360
2718
|
export declare const VisuallyHidden: <E extends ElementType = "span">(props: VisuallyHiddenProps<E> & {
|
|
2361
2719
|
ref?: ForwardedRef<HTMLElement>;
|
|
2362
2720
|
}) => React.ReactElement;
|
|
2363
2721
|
|
|
2722
|
+
/** The props of `VisuallyHidden`: those of the element `as` names, `span` by
|
|
2723
|
+
default. */
|
|
2364
2724
|
export declare type VisuallyHiddenProps<E extends ElementType = "span"> = {
|
|
2365
|
-
/** Element to render as.
|
|
2725
|
+
/** Element to render as.
|
|
2726
|
+
@default "span" */
|
|
2366
2727
|
as?: E;
|
|
2367
2728
|
/** Becomes visible as soon as the content receives the focus (skip link). */
|
|
2368
2729
|
focusable?: boolean;
|
|
2369
2730
|
} & Omit<ComponentPropsWithoutRef<E>, "as">;
|
|
2370
2731
|
|
|
2732
|
+
/** What `visibleWindow` needs to know about a scroll area and its rows. */
|
|
2371
2733
|
export declare interface WindowInput {
|
|
2372
2734
|
/** Rows in total, not only the rendered ones. */
|
|
2373
2735
|
count: number;
|
|
@@ -2448,6 +2810,8 @@ export declare interface Wording {
|
|
|
2448
2810
|
paletteNoFinds: string;
|
|
2449
2811
|
/** What the screen reader hears when the number of finds changes. */
|
|
2450
2812
|
paletteFindCount: (count: number) => string;
|
|
2813
|
+
/** The last line when more finds exist than `maxFinds` lets stand. */
|
|
2814
|
+
paletteMoreFinds: (count: number) => string;
|
|
2451
2815
|
/** The three key hints in the footer, each the text beside the key. */
|
|
2452
2816
|
paletteHintMove: string;
|
|
2453
2817
|
paletteHintChoose: string;
|
|
@@ -2460,7 +2824,7 @@ export declare interface Wording {
|
|
|
2460
2824
|
dockTools: string;
|
|
2461
2825
|
/** Accessible name of the grip - it says what it does, not what it is. */
|
|
2462
2826
|
dockGrip: string;
|
|
2463
|
-
/** The four resting places, named. The keys are the `
|
|
2827
|
+
/** The four resting places, named. The keys are the `DockPlace` type's, and a
|
|
2464
2828
|
register translates them: the German one answers "oben" where the
|
|
2465
2829
|
English one answers "top". */
|
|
2466
2830
|
dockPlace: (place: "top" | "right" | "bottom" | "left") => string;
|
|
@@ -2587,7 +2951,7 @@ export declare interface Wording {
|
|
|
2587
2951
|
unpinHint: string;
|
|
2588
2952
|
/** The export button. */
|
|
2589
2953
|
exportLabel: string;
|
|
2590
|
-
/** The export button of a table in
|
|
2954
|
+
/** The export button of a table in server mode, which holds and writes one page. */
|
|
2591
2955
|
exportPageLabel: string;
|
|
2592
2956
|
/** The export's file name, where the application names none. */
|
|
2593
2957
|
exportFileName: string;
|
|
@@ -2602,7 +2966,7 @@ export declare interface Wording {
|
|
|
2602
2966
|
selectRow: (row: string) => string;
|
|
2603
2967
|
/** The selection of every row in the filtered set. */
|
|
2604
2968
|
selectAllRows: string;
|
|
2605
|
-
/** The same checkbox in
|
|
2969
|
+
/** The same checkbox in server mode, where the table holds one page of a server's. */
|
|
2606
2970
|
selectAllOnPage: string;
|
|
2607
2971
|
/** The expand button, named after the row header. */
|
|
2608
2972
|
expandRowNamed: (row: string) => string;
|