@med-o/ui 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +424 -151
- package/dist/index.js +1405 -946
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +6 -7
- package/src/avatar/avatar.css +1 -1
- package/src/badge/badge.css +1 -1
- package/src/bottom-sheet/bottom-sheet.css +1 -1
- package/src/breadcrumbs/breadcrumbs.css +2 -2
- package/src/button/button.css +3 -3
- package/src/card/card.css +1 -1
- package/src/checkbox/choice.css +1 -1
- package/src/combobox/combobox.css +1 -1
- package/src/dialog/dialog.css +1 -1
- package/src/layout/layout.css +148 -0
- package/src/list/list.css +2 -2
- package/src/list-view/list-view.css +1 -1
- package/src/listbox/listbox.css +1 -1
- package/src/menu/menu.css +1 -1
- package/src/navigation/navigation.css +0 -1
- package/src/popover/popover.css +1 -1
- package/src/select/select.css +1 -1
- package/src/styles.css +49 -40
- package/src/switch/switch.css +1 -1
- package/src/table/table.css +11 -1
- package/src/tabs/tabs.css +1 -1
- package/src/tag/tag.css +1 -1
- package/src/text-field/input.css +1 -1
- package/src/toast/toast.css +1 -1
- package/src/toggle-button/toggle-button.css +1 -1
- package/src/tooltip/tooltip.css +1 -1
- package/src/upload/upload.css +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,66 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, CSSProperties,
|
|
2
|
+
import { HTMLAttributes, Ref, ReactNode, CSSProperties, ImgHTMLAttributes } from 'react';
|
|
3
3
|
import { ButtonProps as ButtonProps$1, TextFieldProps as TextFieldProps$1, CheckboxFieldProps, CheckboxGroupProps as CheckboxGroupProps$1, RadioFieldProps, RadioGroupProps as RadioGroupProps$1, SwitchFieldProps, ValidationResult, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps, TooltipProps as TooltipProps$1, TooltipTriggerComponentProps, ProgressBarProps as ProgressBarProps$1, ToggleButtonProps as ToggleButtonProps$1, ToggleButtonGroupProps as ToggleButtonGroupProps$1, ToolbarProps as ToolbarProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, SelectProps as SelectProps$1, Key, ModalOverlayProps, MenuProps as MenuProps$1, MenuItemProps as MenuItemProps$1, MenuTriggerProps as MenuTriggerProps$1, ComboBoxProps, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabsProps as TabsProps$1, PopoverProps as PopoverProps$1, DialogTrigger, PressEvent, LinkProps as LinkProps$1, GridListItemProps, GridListProps, SearchFieldProps as SearchFieldProps$1, DisclosureGroupProps, SliderProps as SliderProps$1, NumberFieldProps as NumberFieldProps$1, CellProps as CellProps$1, ColumnProps as ColumnProps$1, RowProps, TableProps as TableProps$1, TableBodyProps, TableHeaderProps, DateValue, CalendarProps as CalendarProps$1, RangeCalendarProps as RangeCalendarProps$1, DateFieldProps as DateFieldProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue, DatePickerProps as DatePickerProps$1, DateRangePickerProps as DateRangePickerProps$1 } from 'react-aria-components';
|
|
4
4
|
export { DateValue, DialogTrigger, TimeValue } from 'react-aria-components';
|
|
5
5
|
export { CalendarDate, CalendarDateTime, Time, ZonedDateTime, getLocalTimeZone, isToday, isWeekend, now, parseDate, parseDateTime, parseTime, parseZonedDateTime, today } from '@internationalized/date';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Spacing rules: every gap between elements comes from one of six rules. The values grow with the layout mode
|
|
9
|
+
* (mobile · tablet · desktop), so a layout needs no breakpoints for its spacing.
|
|
10
|
+
*
|
|
11
|
+
* inline 8 · content 16 · fields 16/24/24 · items 16/24/24 · group 32/40/48 · section 48/64/96 px
|
|
12
|
+
*/
|
|
13
|
+
type SpacingRule = 'inline' | 'content' | 'fields' | 'items' | 'group' | 'section';
|
|
14
|
+
/** Elements a layout component can render as. Choose the one that says what the content is. */
|
|
15
|
+
type LayoutElement = 'div' | 'section' | 'article' | 'aside' | 'main' | 'header' | 'footer' | 'nav' | 'ul' | 'ol' | 'li' | 'form' | 'fieldset';
|
|
16
|
+
interface LayoutProps extends HTMLAttributes<HTMLElement> {
|
|
17
|
+
/** HTML element, e.g. `ul` for a list of cards or `section` for a page section. Default: `div`. */
|
|
18
|
+
as?: LayoutElement;
|
|
19
|
+
ref?: Ref<HTMLElement>;
|
|
20
|
+
}
|
|
21
|
+
interface StackProps extends LayoutProps {
|
|
22
|
+
/** vertical (default) · horizontal. */
|
|
23
|
+
direction?: 'vertical' | 'horizontal';
|
|
24
|
+
/** Spacing rule. Default: `content` when vertical, `inline` when horizontal. */
|
|
25
|
+
gap?: SpacingRule;
|
|
26
|
+
/** Cross axis: start · center · end · stretch (default) · baseline. */
|
|
27
|
+
align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
28
|
+
/** Main axis: start · center · end · between. */
|
|
29
|
+
justify?: 'start' | 'center' | 'end' | 'between';
|
|
30
|
+
/** Horizontal only: wrap to the next line when space runs out. */
|
|
31
|
+
wrap?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Stack – elements below or next to each other with a spacing rule.
|
|
35
|
+
* Vertical uses the rule `content`, horizontal the rule `inline`; pass `gap` for another rule.
|
|
36
|
+
*/
|
|
37
|
+
declare function Stack({ as: Tag, direction, gap, align, justify, wrap, className, ...props }: StackProps): react.JSX.Element;
|
|
38
|
+
interface GridProps extends LayoutProps {
|
|
39
|
+
/**
|
|
40
|
+
* Columns. Without it: as many as fit, each at least `minItemSize` wide – no breakpoints needed.
|
|
41
|
+
* A number: that many equal columns. `layout`: the layout grid (4 · 8 · 12 columns), place children with `GridItem`.
|
|
42
|
+
*/
|
|
43
|
+
columns?: number | 'layout';
|
|
44
|
+
/** Without `columns`: the narrowest a column may get (CSS length). Default `16rem`. */
|
|
45
|
+
minItemSize?: string;
|
|
46
|
+
/** Spacing rule. Default: `items` (the layout gutter). */
|
|
47
|
+
gap?: SpacingRule;
|
|
48
|
+
}
|
|
49
|
+
/** Grid – cards, tiles and page areas in columns. The gap between items is always the rule `items` unless set. */
|
|
50
|
+
declare function Grid({ as: Tag, columns, minItemSize, gap, className, style, ...props }: GridProps): react.JSX.Element;
|
|
51
|
+
interface GridItemProps extends LayoutProps {
|
|
52
|
+
/** Columns to span, or `full`. Never more than there are: span 6 is full width on a phone (4 columns). */
|
|
53
|
+
span?: number | 'full';
|
|
54
|
+
}
|
|
55
|
+
/** GridItem – a child of `Grid` that spans several columns. */
|
|
56
|
+
declare function GridItem({ as: Tag, span, className, style, ...props }: GridItemProps): react.JSX.Element;
|
|
57
|
+
interface ContainerProps extends LayoutProps {
|
|
58
|
+
/** Width of the content: prose 680 (running text) · md 768 · lg 1024 · xl 1280 (default) · full. */
|
|
59
|
+
size?: 'prose' | 'md' | 'lg' | 'xl' | 'full';
|
|
60
|
+
}
|
|
61
|
+
/** Container – centres the content, limits its width and adds the page margin of the layout mode. */
|
|
62
|
+
declare function Container({ as: Tag, size, className, ...props }: ContainerProps): react.JSX.Element;
|
|
63
|
+
|
|
7
64
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'text' | 'ghost-danger';
|
|
8
65
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
9
66
|
interface ButtonProps extends Omit<ButtonProps$1, 'children' | 'className' | 'style'> {
|
|
@@ -23,7 +80,7 @@ interface ButtonProps extends Omit<ButtonProps$1, 'children' | 'className' | 'st
|
|
|
23
80
|
* Button – triggers an action. Built on React Aria: consistent press,
|
|
24
81
|
* hover and focus behaviour on mouse, touch, keyboard and screen readers.
|
|
25
82
|
* Use onPress instead of onClick and isDisabled instead of disabled.
|
|
26
|
-
* While saving, set isPending and change the label (
|
|
83
|
+
* While saving, set isPending and change the label (“Saving…”): the button keeps its look and size.
|
|
27
84
|
*/
|
|
28
85
|
declare function Button({ variant, size, startIcon, endIcon, className, children, ...props }: ButtonProps): react.JSX.Element;
|
|
29
86
|
interface ButtonGroupProps {
|
|
@@ -41,7 +98,7 @@ interface ButtonGroupProps {
|
|
|
41
98
|
declare function ButtonGroup({ context, children, destructive, className, ...props }: ButtonGroupProps): react.JSX.Element;
|
|
42
99
|
|
|
43
100
|
interface IconButtonProps extends Omit<ButtonProps$1, 'children' | 'className' | 'style'> {
|
|
44
|
-
/** Required: describes the action (
|
|
101
|
+
/** Required: describes the action (“Delete file”), because there is no visible label. */
|
|
45
102
|
'aria-label': string;
|
|
46
103
|
icon: ReactNode;
|
|
47
104
|
/**
|
|
@@ -57,9 +114,9 @@ interface IconButtonProps extends Omit<ButtonProps$1, 'children' | 'className' |
|
|
|
57
114
|
* Pass false to turn it off (e.g. when a visible label is next to the button).
|
|
58
115
|
*/
|
|
59
116
|
tooltip?: ReactNode | false;
|
|
60
|
-
/** Keyboard shortcut in aria-keyshortcuts syntax (e.g.
|
|
117
|
+
/** Keyboard shortcut in aria-keyshortcuts syntax (e.g. “Control+C”). Exposed to screen readers and shown in the tooltip. */
|
|
61
118
|
shortcut?: string;
|
|
62
|
-
/** Visible form of the shortcut. Default:
|
|
119
|
+
/** Visible form of the shortcut. Default: “Control+C” → “Ctrl C”, “Meta+C” → “⌘ C”. */
|
|
63
120
|
shortcutLabel?: string;
|
|
64
121
|
className?: string;
|
|
65
122
|
style?: CSSProperties;
|
|
@@ -69,8 +126,11 @@ declare function IconButton({ icon, variant, size, tooltip, shortcut, shortcutLa
|
|
|
69
126
|
|
|
70
127
|
type InputSize = 'sm' | 'md' | 'lg';
|
|
71
128
|
interface TextFieldProps extends Omit<TextFieldProps$1, 'children' | 'className' | 'style'> {
|
|
72
|
-
/**
|
|
73
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Visible label. Always set one – a placeholder is no label. Without it set `aria-label` – only where the
|
|
131
|
+
* context names the field (a table row, a filter bar), like Select and NumberField.
|
|
132
|
+
*/
|
|
133
|
+
label?: ReactNode;
|
|
74
134
|
/** Helper text below the field. Replaced by the error message when invalid. */
|
|
75
135
|
description?: ReactNode;
|
|
76
136
|
/** Error text shown when the field is invalid (isInvalid or failed validation). */
|
|
@@ -148,7 +208,7 @@ interface RadioGroupProps extends Omit<RadioGroupProps$1, 'children' | 'classNam
|
|
|
148
208
|
declare function RadioGroup({ label, description, errorMessage, size, children, className, ...props }: RadioGroupProps): react.JSX.Element;
|
|
149
209
|
|
|
150
210
|
interface SwitchProps extends Omit<SwitchFieldProps, 'children' | 'className' | 'style'> {
|
|
151
|
-
/** Label. Describes the setting, never the state (
|
|
211
|
+
/** Label. Describes the setting, never the state (“Notifications”, not “On”). */
|
|
152
212
|
children: ReactNode;
|
|
153
213
|
description?: ReactNode;
|
|
154
214
|
/** md (36 × 20) · lg (44 × 24, mobile). */
|
|
@@ -177,7 +237,7 @@ declare function FieldFooter({ description, errorMessage, children, }: {
|
|
|
177
237
|
|
|
178
238
|
type BadgeTone = 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';
|
|
179
239
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
180
|
-
/** Meaning: success, warning, danger, info. Brand for
|
|
240
|
+
/** Meaning: success, warning, danger, info. Brand for “New”, neutral for everything else. */
|
|
181
241
|
tone?: BadgeTone;
|
|
182
242
|
/** sm 20 px · md 24 px. */
|
|
183
243
|
size?: 'sm' | 'md';
|
|
@@ -195,14 +255,14 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
195
255
|
declare function Badge({ tone, size, dot, icon, className, children, ...props }: BadgeProps): react.JSX.Element;
|
|
196
256
|
interface BadgeCountProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
197
257
|
count: number;
|
|
198
|
-
/** Above this number the badge shows
|
|
258
|
+
/** Above this number the badge shows “99+”. */
|
|
199
259
|
max?: number;
|
|
200
260
|
tone?: 'danger' | 'brand' | 'neutral';
|
|
201
261
|
/** sm 16 px · md 20 px. */
|
|
202
262
|
size?: 'sm' | 'md';
|
|
203
263
|
/**
|
|
204
|
-
* Text for screen readers, e.g.
|
|
205
|
-
* Without it the number is hidden: then the parent names it (
|
|
264
|
+
* Text for screen readers, e.g. “3 unread messages”.
|
|
265
|
+
* Without it the number is hidden: then the parent names it (“Notifications, 3 unread”).
|
|
206
266
|
*/
|
|
207
267
|
label?: string;
|
|
208
268
|
}
|
|
@@ -210,7 +270,7 @@ interface BadgeCountProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'childre
|
|
|
210
270
|
declare function BadgeCount({ count, max, tone, size, label, className, ...props }: BadgeCountProps): react.JSX.Element | null;
|
|
211
271
|
interface BadgeDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
212
272
|
tone?: BadgeTone;
|
|
213
|
-
/** Text for screen readers (
|
|
273
|
+
/** Text for screen readers (“Unread”, “Online”). Without it the dot is decorative. */
|
|
214
274
|
label?: string;
|
|
215
275
|
}
|
|
216
276
|
/** Dot for unread or presence. Always pair it with text or a label. */
|
|
@@ -229,7 +289,7 @@ interface TagGroupProps<T> extends Omit<TagGroupProps$1, 'children' | 'className
|
|
|
229
289
|
items?: Iterable<T>;
|
|
230
290
|
/** Shown when there are no tags. */
|
|
231
291
|
renderEmptyState?: () => ReactNode;
|
|
232
|
-
/** Text announced after a removal. Default:
|
|
292
|
+
/** Text announced after a removal. Default: “{label} removed”. */
|
|
233
293
|
removedMessage?: (labels: string[]) => string;
|
|
234
294
|
className?: string;
|
|
235
295
|
}
|
|
@@ -241,7 +301,7 @@ interface TagGroupProps<T> extends Omit<TagGroupProps$1, 'children' | 'className
|
|
|
241
301
|
* - removable values: pass `onRemove`
|
|
242
302
|
* - filters: pass `selectionMode="multiple"` (or "single"). Click again to deselect.
|
|
243
303
|
*/
|
|
244
|
-
declare function TagGroup<T extends object>({ label, description, size, children, items, renderEmptyState, onRemove, removedMessage, className, ...props }: TagGroupProps<T>): react.JSX.Element;
|
|
304
|
+
declare function TagGroup<T extends object>({ label, description, size, children, items, renderEmptyState, onRemove, removedMessage: removedMessageProp, className, ...props }: TagGroupProps<T>): react.JSX.Element;
|
|
245
305
|
interface TagProps extends Omit<TagProps$1, 'children' | 'className'> {
|
|
246
306
|
/** Short label; long text is truncated at 200 px. */
|
|
247
307
|
children: ReactNode;
|
|
@@ -267,7 +327,7 @@ interface AvatarProps {
|
|
|
267
327
|
shape?: 'circle' | 'square';
|
|
268
328
|
/** Stable id (user id) for the initials colour, so it survives name changes. */
|
|
269
329
|
colorKey?: string;
|
|
270
|
-
/** Presence dot. Also added to the accessible name (
|
|
330
|
+
/** Presence dot. Also added to the accessible name (“Lea M., online”). */
|
|
271
331
|
status?: AvatarStatus;
|
|
272
332
|
/** Words for the status in the accessible name. */
|
|
273
333
|
statusLabels?: Partial<Record<AvatarStatus, string>>;
|
|
@@ -283,20 +343,20 @@ declare function Avatar({ name, src, size, shape, colorKey, status, statusLabels
|
|
|
283
343
|
interface AvatarGroupProps {
|
|
284
344
|
/** Avatars, most relevant first (owner, you). */
|
|
285
345
|
children: ReactNode;
|
|
286
|
-
/** Visible avatars before
|
|
346
|
+
/** Visible avatars before “+N”. */
|
|
287
347
|
max?: number;
|
|
288
348
|
/** xs · sm · md · lg. */
|
|
289
349
|
size?: Exclude<AvatarSize, 'xl' | '2xl'>;
|
|
290
|
-
/** Name of the group, e.g.
|
|
350
|
+
/** Name of the group, e.g. “Assignees”. */
|
|
291
351
|
'aria-label': string;
|
|
292
|
-
/** Opens the full list (e.g. a popover). Without it
|
|
352
|
+
/** Opens the full list (e.g. a popover). Without it “+N” is plain text. */
|
|
293
353
|
onMorePress?: () => void;
|
|
294
|
-
/** Accessible name of
|
|
354
|
+
/** Accessible name of “+N”. Default: “N more”. */
|
|
295
355
|
moreLabel?: (count: number) => string;
|
|
296
356
|
className?: string;
|
|
297
357
|
}
|
|
298
|
-
/** Overlapping avatars, max 4 +
|
|
299
|
-
declare function AvatarGroup({ children, max, size, onMorePress, moreLabel, className, ...props }: AvatarGroupProps): react.JSX.Element;
|
|
358
|
+
/** Overlapping avatars, max 4 + “+N”. */
|
|
359
|
+
declare function AvatarGroup({ children, max, size, onMorePress, moreLabel: moreLabelProp, className, ...props }: AvatarGroupProps): react.JSX.Element;
|
|
300
360
|
|
|
301
361
|
/**
|
|
302
362
|
* Wraps a focusable trigger (e.g. Button, IconButton) and its Tooltip.
|
|
@@ -307,7 +367,7 @@ declare function TooltipTrigger({ delay, closeDelay, ...props }: TooltipTriggerC
|
|
|
307
367
|
interface TooltipProps extends Omit<TooltipProps$1, 'children' | 'className'> {
|
|
308
368
|
/** A few words, at most one sentence. No links or buttons. */
|
|
309
369
|
children: ReactNode;
|
|
310
|
-
/** Keyboard shortcut, shown dimmed after the text (e.g.
|
|
370
|
+
/** Keyboard shortcut, shown dimmed after the text (e.g. “⌘C”). */
|
|
311
371
|
shortcut?: string;
|
|
312
372
|
className?: string;
|
|
313
373
|
}
|
|
@@ -321,7 +381,7 @@ interface SpinnerProps {
|
|
|
321
381
|
tone?: 'current' | 'brand' | 'neutral' | 'on-brand';
|
|
322
382
|
/** Name for screen readers. */
|
|
323
383
|
'aria-label'?: string;
|
|
324
|
-
/** Inside a control that already says what happens (
|
|
384
|
+
/** Inside a control that already says what happens (“Saving…”): hide the spinner from screen readers. */
|
|
325
385
|
decorative?: boolean;
|
|
326
386
|
className?: string;
|
|
327
387
|
style?: CSSProperties;
|
|
@@ -329,7 +389,7 @@ interface SpinnerProps {
|
|
|
329
389
|
/** Spinner – short wait of unknown length. */
|
|
330
390
|
declare function Spinner({ size, tone, decorative, className, style, ...props }: SpinnerProps): react.JSX.Element;
|
|
331
391
|
interface ProgressBarProps extends Omit<ProgressBarProps$1, 'children' | 'className' | 'style'> {
|
|
332
|
-
/** Visible label (
|
|
392
|
+
/** Visible label (“Uploading 3 files”). Without it, set aria-label. */
|
|
333
393
|
label?: ReactNode;
|
|
334
394
|
/** Helper below the bar: files, time left, or what to do after an error. */
|
|
335
395
|
description?: ReactNode;
|
|
@@ -337,14 +397,14 @@ interface ProgressBarProps extends Omit<ProgressBarProps$1, 'children' | 'classN
|
|
|
337
397
|
size?: 'sm' | 'md';
|
|
338
398
|
/** success when done, error when it failed. Announced politely. */
|
|
339
399
|
status?: 'default' | 'success' | 'error';
|
|
340
|
-
/** Show the value (
|
|
400
|
+
/** Show the value (“64 %”) next to the label. Hidden when indeterminate. */
|
|
341
401
|
showValue?: boolean;
|
|
342
402
|
className?: string;
|
|
343
403
|
style?: CSSProperties;
|
|
344
404
|
}
|
|
345
405
|
/**
|
|
346
406
|
* Progress bar – measurable or long work. Built on React Aria ProgressBar:
|
|
347
|
-
* role progressbar with value and value text. Use `valueLabel` for words (
|
|
407
|
+
* role progressbar with value and value text. Use `valueLabel` for words (“64 %, 2 of 3 files”).
|
|
348
408
|
*/
|
|
349
409
|
declare function ProgressBar({ label, description, size, status, showValue, className, style, ...props }: ProgressBarProps): react.JSX.Element;
|
|
350
410
|
interface SkeletonProps {
|
|
@@ -365,7 +425,7 @@ declare function Skeleton({ shape, lines, width, height, className }: SkeletonPr
|
|
|
365
425
|
|
|
366
426
|
type ToggleSize = 'sm' | 'md' | 'lg';
|
|
367
427
|
interface ToggleButtonProps extends Omit<ToggleButtonProps$1, 'children' | 'className' | 'style'> {
|
|
368
|
-
/** Visible label. It never changes with the state (
|
|
428
|
+
/** Visible label. It never changes with the state (“Bold” stays “Bold”). Leave out for icon only. */
|
|
369
429
|
children?: ReactNode;
|
|
370
430
|
/** Leading icon; alone it makes an icon-only toggle (then aria-label is required). */
|
|
371
431
|
icon?: ReactNode;
|
|
@@ -373,7 +433,7 @@ interface ToggleButtonProps extends Omit<ToggleButtonProps$1, 'children' | 'clas
|
|
|
373
433
|
size?: ToggleSize;
|
|
374
434
|
/** Icon only: tooltip text. Default: the aria-label. false turns it off. */
|
|
375
435
|
tooltip?: ReactNode | false;
|
|
376
|
-
/** Keyboard shortcut in aria-keyshortcuts syntax (e.g.
|
|
436
|
+
/** Keyboard shortcut in aria-keyshortcuts syntax (e.g. “Control+B”), shown in the tooltip. */
|
|
377
437
|
shortcut?: string;
|
|
378
438
|
className?: string;
|
|
379
439
|
style?: CSSProperties;
|
|
@@ -394,7 +454,7 @@ interface ToggleButtonGroupProps extends Omit<ToggleButtonGroupProps$1, 'childre
|
|
|
394
454
|
size?: 'md' | 'lg';
|
|
395
455
|
/** Segmented only: full width, items share the space (mobile). */
|
|
396
456
|
fullWidth?: boolean;
|
|
397
|
-
/** Required when there is no visible label: names the group (
|
|
457
|
+
/** Required when there is no visible label: names the group (“View”). */
|
|
398
458
|
'aria-label'?: string;
|
|
399
459
|
children: ReactNode;
|
|
400
460
|
className?: string;
|
|
@@ -406,7 +466,7 @@ interface ToggleButtonGroupProps extends Omit<ToggleButtonGroupProps$1, 'childre
|
|
|
406
466
|
*/
|
|
407
467
|
declare function ToggleButtonGroup({ variant, size, fullWidth, selectionMode, disallowEmptySelection, children, className, ...props }: ToggleButtonGroupProps): react.JSX.Element;
|
|
408
468
|
interface ToolbarProps extends Omit<ToolbarProps$1, 'className' | 'style'> {
|
|
409
|
-
/** Required: names the toolbar (
|
|
469
|
+
/** Required: names the toolbar (“Text formatting”). */
|
|
410
470
|
'aria-label': string;
|
|
411
471
|
className?: string;
|
|
412
472
|
style?: CSSProperties;
|
|
@@ -462,7 +522,6 @@ type SelectMode = 'single' | 'multiple';
|
|
|
462
522
|
type ValueOf<M extends SelectMode> = M extends 'multiple' ? Key[] : Key | null;
|
|
463
523
|
/** Where the options open. auto: popover on desktop; below 640 px native picker (single) or Bottom Sheet (multi). */
|
|
464
524
|
type SelectOverlay = 'auto' | 'popover' | 'sheet' | 'native';
|
|
465
|
-
|
|
466
525
|
interface SelectProps<T extends object, M extends SelectMode = 'single'> extends Omit<SelectProps$1<T, M>, 'children' | 'className' | 'style' | 'placeholder'> {
|
|
467
526
|
/** Visible label. Without it set `aria-label` – only where the context names the field (filter bars, toolbars). */
|
|
468
527
|
label?: ReactNode;
|
|
@@ -470,7 +529,7 @@ interface SelectProps<T extends object, M extends SelectMode = 'single'> extends
|
|
|
470
529
|
description?: ReactNode;
|
|
471
530
|
/** Error text shown when the field is invalid. Validate on submit or blur, not while open. */
|
|
472
531
|
errorMessage?: ReactNode;
|
|
473
|
-
/** A hint like
|
|
532
|
+
/** A hint like “Select…”. Never required information. */
|
|
474
533
|
placeholder?: string;
|
|
475
534
|
/** sm 32 · md 40 · lg 48 px. lg on mobile (opens the lg list). */
|
|
476
535
|
size?: InputSize;
|
|
@@ -493,7 +552,7 @@ interface SelectProps<T extends object, M extends SelectMode = 'single'> extends
|
|
|
493
552
|
commit?: 'live' | 'onClose';
|
|
494
553
|
/** commit="onClose": apply the selection (load results, write the URL …). */
|
|
495
554
|
onApply?: (value: ValueOf<M>) => void;
|
|
496
|
-
/** commit="onClose": label of the primary sheet button, ideally with the live result count (
|
|
555
|
+
/** commit="onClose": label of the primary sheet button, ideally with the live result count (“Show 128 results”). */
|
|
497
556
|
resultLabel?: (value: ValueOf<M>) => ReactNode;
|
|
498
557
|
className?: string;
|
|
499
558
|
}
|
|
@@ -502,7 +561,7 @@ interface SelectProps<T extends object, M extends SelectMode = 'single'> extends
|
|
|
502
561
|
* Built on React Aria Select with a hidden native select: forms, autofill and validation keep working.
|
|
503
562
|
* 2–4 options: Radio. 5–10: Select. More, or users know what to type: Combobox.
|
|
504
563
|
*/
|
|
505
|
-
declare function Select<T extends object, M extends SelectMode = 'single'>({ label, description, errorMessage, placeholder, size, leadingIcon, clearable, isReadOnly, items, children, overlay, commit, onApply, resultLabel, className, selectionMode, ...props }: SelectProps<T, M>): react.JSX.Element;
|
|
564
|
+
declare function Select<T extends object, M extends SelectMode = 'single'>({ label, description, errorMessage, placeholder: placeholderProp, size, leadingIcon, clearable, isReadOnly, items, children, overlay, commit, onApply, resultLabel: resultLabelProp, className, selectionMode, ...props }: SelectProps<T, M>): react.JSX.Element;
|
|
506
565
|
|
|
507
566
|
interface BottomSheetProps extends Omit<ModalOverlayProps, 'children' | 'className' | 'style'> {
|
|
508
567
|
/** Required: names the dialog (for a Select sheet: the field label). */
|
|
@@ -537,14 +596,14 @@ interface MenuTriggerProps extends Omit<MenuTriggerProps$1, 'children'> {
|
|
|
537
596
|
declare function MenuTrigger(props: MenuTriggerProps): react.JSX.Element;
|
|
538
597
|
/**
|
|
539
598
|
* Default trigger: ghost Icon Button with an ellipsis. The name includes the object
|
|
540
|
-
* (
|
|
599
|
+
* (“More actions for Q3-Report.pdf”); it looks pressed while the menu is open.
|
|
541
600
|
*/
|
|
542
601
|
declare function MenuButton({ 'aria-label': label, size }: {
|
|
543
602
|
'aria-label': string;
|
|
544
603
|
size?: 'sm' | 'md' | 'lg';
|
|
545
604
|
}): react.JSX.Element;
|
|
546
605
|
interface MenuProps<T> extends Omit<MenuProps$1<T>, 'className' | 'style'> {
|
|
547
|
-
/** Mobile sheet title: the object the actions apply to (
|
|
606
|
+
/** Mobile sheet title: the object the actions apply to (“Q3-Report.pdf”). */
|
|
548
607
|
title?: ReactNode;
|
|
549
608
|
/** auto: popover on desktop, Bottom Sheet below 640 px · popover · sheet. */
|
|
550
609
|
overlay?: 'auto' | 'popover' | 'sheet';
|
|
@@ -557,11 +616,11 @@ interface MenuProps<T> extends Omit<MenuProps$1<T>, 'className' | 'style'> {
|
|
|
557
616
|
*/
|
|
558
617
|
declare function Menu<T extends object>({ title, overlay, className, ...props }: MenuProps<T>): react.JSX.Element;
|
|
559
618
|
interface MenuItemProps extends Omit<MenuItemProps$1, 'children' | 'className' | 'style'> {
|
|
560
|
-
/** Label, starting with a verb (
|
|
619
|
+
/** Label, starting with a verb (“Duplicate”). “…” only when a dialog or second step follows. */
|
|
561
620
|
children: string;
|
|
562
621
|
/** Required: shows the action. Decorative for screen readers – the label carries the meaning. */
|
|
563
622
|
icon: ReactNode;
|
|
564
|
-
/** Keyboard shortcut in aria-keyshortcuts syntax;
|
|
623
|
+
/** Keyboard shortcut in aria-keyshortcuts syntax; “Mod” = ⌘ on Apple, Ctrl elsewhere. Desktop only. It must also work without the menu. */
|
|
565
624
|
shortcut?: string;
|
|
566
625
|
/** Destructive action: red, last in its own group. Irreversible actions open a confirmation dialog. */
|
|
567
626
|
variant?: 'default' | 'danger';
|
|
@@ -588,7 +647,7 @@ interface MenuSectionProps {
|
|
|
588
647
|
declare function MenuSection({ title, children, ...props }: MenuSectionProps): react.JSX.Element;
|
|
589
648
|
|
|
590
649
|
interface DialogAction {
|
|
591
|
-
/** Verb that says what happens (
|
|
650
|
+
/** Verb that says what happens (“Send invite”, “Delete”). Never “OK”, “Yes” or “Confirm”. */
|
|
592
651
|
label: string;
|
|
593
652
|
/**
|
|
594
653
|
* Runs on press, then the dialog closes. Return a promise to show the pending state until it
|
|
@@ -619,7 +678,7 @@ interface DialogDiscardText {
|
|
|
619
678
|
cancelLabel: string;
|
|
620
679
|
}
|
|
621
680
|
interface DialogProps extends OpenProps {
|
|
622
|
-
/** Required. Names the task (
|
|
681
|
+
/** Required. Names the task (“Invite member”). Screen readers announce it when the dialog opens. */
|
|
623
682
|
title: ReactNode;
|
|
624
683
|
/** One or two sentences under the title. */
|
|
625
684
|
description?: ReactNode;
|
|
@@ -636,10 +695,10 @@ interface DialogProps extends OpenProps {
|
|
|
636
695
|
showClose?: boolean;
|
|
637
696
|
/**
|
|
638
697
|
* Unsaved input. While true, a click on the scrim no longer closes, and X, Esc and Cancel
|
|
639
|
-
* first ask
|
|
698
|
+
* first ask “Discard changes?” (Alert dialog).
|
|
640
699
|
*/
|
|
641
700
|
isDirty?: boolean;
|
|
642
|
-
/** Text of the
|
|
701
|
+
/** Text of the “Discard changes?” Alert dialog. */
|
|
643
702
|
discardText?: Partial<DialogDiscardText>;
|
|
644
703
|
/** auto: dialog on desktop, `mobile` below 640 px · dialog · fullscreen · sheet. */
|
|
645
704
|
overlay?: 'auto' | 'dialog' | 'fullscreen' | 'sheet';
|
|
@@ -652,16 +711,16 @@ interface DialogProps extends OpenProps {
|
|
|
652
711
|
* Modal and Dialog: role dialog with aria-modal, the title names it, focus starts in the first field,
|
|
653
712
|
* stays inside and returns to the trigger; the page behind does not scroll. Use inside a DialogTrigger or with isOpen.
|
|
654
713
|
*/
|
|
655
|
-
declare function Dialog({ title, description, children, size, primaryAction, cancelLabel, closeLabel, showClose, isDirty, discardText, overlay, mobile, className, ...openProps }: DialogProps): react.JSX.Element;
|
|
714
|
+
declare function Dialog({ title, description, children, size, primaryAction, cancelLabel: cancelLabelProp, closeLabel: closeLabelProp, showClose, isDirty, discardText, overlay, mobile, className, ...openProps }: DialogProps): react.JSX.Element;
|
|
656
715
|
type AlertDialogTone = 'danger' | 'warning' | 'info';
|
|
657
716
|
interface AlertDialogProps extends OpenProps {
|
|
658
717
|
/** danger: irreversible or destructive · warning: risk of data loss · info: must be acknowledged. */
|
|
659
718
|
tone?: AlertDialogTone;
|
|
660
|
-
/** Required. A question (
|
|
719
|
+
/** Required. A question (“Delete Q3-Report.pdf?”). */
|
|
661
720
|
title: ReactNode;
|
|
662
|
-
/** The consequence (
|
|
721
|
+
/** The consequence (“This cannot be undone.”). */
|
|
663
722
|
children?: ReactNode;
|
|
664
|
-
/** Verb of the action (
|
|
723
|
+
/** Verb of the action (“Delete”). Danger tone: danger button, else primary. */
|
|
665
724
|
actionLabel: string;
|
|
666
725
|
/** Runs, then the dialog closes. A promise shows the pending state until it resolves. */
|
|
667
726
|
onAction?: () => void | Promise<unknown>;
|
|
@@ -673,7 +732,7 @@ interface AlertDialogProps extends OpenProps {
|
|
|
673
732
|
* role alertdialog, no X, a click on the scrim never closes, Esc = Cancel. Focus starts on Cancel,
|
|
674
733
|
* so an accidental Enter never deletes. Below 640 px: icon on top, buttons stacked (lg).
|
|
675
734
|
*/
|
|
676
|
-
declare function AlertDialog({ tone, title, children, actionLabel, onAction, cancelLabel, className, ...openProps }: AlertDialogProps): react.JSX.Element;
|
|
735
|
+
declare function AlertDialog({ tone, title, children, actionLabel, onAction, cancelLabel: cancelLabelProp, className, ...openProps }: AlertDialogProps): react.JSX.Element;
|
|
677
736
|
|
|
678
737
|
type ComboMode = 'single' | 'multiple';
|
|
679
738
|
interface ComboboxProps<T extends object, M extends ComboMode = 'single'> extends Omit<ComboBoxProps<T, M>, 'children' | 'className' | 'style' | 'placeholder' | 'menuTrigger'> {
|
|
@@ -683,7 +742,7 @@ interface ComboboxProps<T extends object, M extends ComboMode = 'single'> extend
|
|
|
683
742
|
description?: ReactNode;
|
|
684
743
|
/** Error text shown when the field is invalid. */
|
|
685
744
|
errorMessage?: ReactNode;
|
|
686
|
-
/** A hint like
|
|
745
|
+
/** A hint like “Search…”. */
|
|
687
746
|
placeholder?: string;
|
|
688
747
|
/** sm 32 · md 40 · lg 48 px. lg on mobile. */
|
|
689
748
|
size?: InputSize;
|
|
@@ -691,15 +750,15 @@ interface ComboboxProps<T extends object, M extends ComboMode = 'single'> extend
|
|
|
691
750
|
leadingIcon?: ReactNode;
|
|
692
751
|
/** Server search: shows a loading row (previous results stay) and marks the list busy. */
|
|
693
752
|
isLoading?: boolean;
|
|
694
|
-
/** Empty list text. Default:
|
|
753
|
+
/** Empty list text. Default: “No results for “…””. */
|
|
695
754
|
noResultsMessage?: (inputValue: string) => ReactNode;
|
|
696
|
-
/** Multi only: shows an
|
|
755
|
+
/** Multi only: shows an “Add …” row for text without an exact match. Return the key of the new item to select it. */
|
|
697
756
|
onCreate?: (text: string) => Key | void;
|
|
698
757
|
/** Option and ListBoxSection elements, or a render function with items / defaultItems. */
|
|
699
758
|
children: ReactNode | ((item: T) => ReactNode);
|
|
700
759
|
/** auto (default): popover on desktop, Bottom Sheet with search below 640 px · popover · sheet. */
|
|
701
760
|
overlay?: 'auto' | 'popover' | 'sheet';
|
|
702
|
-
/** Multi in the sheet: live (forms, footer
|
|
761
|
+
/** Multi in the sheet: live (forms, footer “Done”) · onClose (filters: onApply once when the sheet closes, if changed). */
|
|
703
762
|
commit?: 'live' | 'onClose';
|
|
704
763
|
/** commit="onClose": apply the selection (load results, write the URL …). */
|
|
705
764
|
onApply?: (value: Key[]) => void;
|
|
@@ -714,24 +773,24 @@ interface ComboboxProps<T extends object, M extends ComboMode = 'single'> extend
|
|
|
714
773
|
* Leaving without a selection restores the last valid value.
|
|
715
774
|
* Local data: `defaultItems` (filtered here). Server data: `items` + `inputValue` / `onInputChange` + `isLoading`.
|
|
716
775
|
*/
|
|
717
|
-
declare function Combobox<T extends object, M extends ComboMode = 'single'>({ label, description, errorMessage, placeholder, size, leadingIcon, isLoading, noResultsMessage, onCreate, children, overlay, commit, onApply, resultLabel, className, selectionMode, value: valueProp, defaultValue, onChange, onInputChange, ...props }: ComboboxProps<T, M>): react.JSX.Element;
|
|
776
|
+
declare function Combobox<T extends object, M extends ComboMode = 'single'>({ label, description, errorMessage, placeholder: placeholderProp, size, leadingIcon, isLoading, noResultsMessage: noResultsProp, onCreate, children, overlay, commit, onApply, resultLabel: resultLabelProp, className, selectionMode, value: valueProp, defaultValue, onChange, onInputChange, ...props }: ComboboxProps<T, M>): react.JSX.Element;
|
|
718
777
|
|
|
719
778
|
interface ToastAction {
|
|
720
|
-
/**
|
|
779
|
+
/** “Undo”, “View” or “Retry”. It must also be reachable elsewhere in the app. */
|
|
721
780
|
label: string;
|
|
722
781
|
onAction: () => void;
|
|
723
782
|
}
|
|
724
783
|
interface ToastOptions {
|
|
725
784
|
/** Max one action. Pressing it runs the action and closes the toast. */
|
|
726
785
|
action?: ToastAction;
|
|
727
|
-
/** Errors (
|
|
786
|
+
/** Errors (“Could not save”): stays until closed. Otherwise 5 s, with an action 8 s. */
|
|
728
787
|
persistent?: boolean;
|
|
729
788
|
/** Called when the toast closes (timeout, close button, Esc or action). */
|
|
730
789
|
onClose?: () => void;
|
|
731
790
|
}
|
|
732
791
|
/**
|
|
733
792
|
* Shows a toast: short, temporary feedback after an action.
|
|
734
|
-
* Write the result, not the process (
|
|
793
|
+
* Write the result, not the process (“Q3-Report.pdf deleted”), one line, max about 50 characters.
|
|
735
794
|
* Returns the key for `toast.close(key)`. The same message is never shown twice at once.
|
|
736
795
|
*/
|
|
737
796
|
declare function toast(message: string, { action, persistent, onClose }?: ToastOptions): string;
|
|
@@ -740,9 +799,9 @@ declare namespace toast {
|
|
|
740
799
|
var clear: () => void;
|
|
741
800
|
}
|
|
742
801
|
interface ToastRegionProps {
|
|
743
|
-
/** Accessible name of the landmark. Default:
|
|
802
|
+
/** Accessible name of the landmark. Default: “Notifications” (localized by React Aria). */
|
|
744
803
|
'aria-label'?: string;
|
|
745
|
-
/** Accessible name of the close buttons. Default:
|
|
804
|
+
/** Accessible name of the close buttons. Default: “Close” (localized by React Aria). */
|
|
746
805
|
closeLabel?: string;
|
|
747
806
|
}
|
|
748
807
|
/**
|
|
@@ -768,7 +827,7 @@ interface TabsProps extends Omit<TabsProps$1, 'className' | 'style' | 'orientati
|
|
|
768
827
|
*/
|
|
769
828
|
declare function Tabs({ size, fullWidth, className, ...props }: TabsProps): react.JSX.Element;
|
|
770
829
|
interface TabListProps<T> extends Omit<TabListProps$1<T>, 'className' | 'style'> {
|
|
771
|
-
/** Names the tabs when there is no visible heading (
|
|
830
|
+
/** Names the tabs when there is no visible heading (“Project”). */
|
|
772
831
|
'aria-label'?: string;
|
|
773
832
|
className?: string;
|
|
774
833
|
}
|
|
@@ -778,13 +837,13 @@ interface TabListProps<T> extends Omit<TabListProps$1<T>, 'className' | 'style'>
|
|
|
778
837
|
*/
|
|
779
838
|
declare function TabList<T extends object>({ className, ...props }: TabListProps<T>): react.JSX.Element;
|
|
780
839
|
interface TabProps extends Omit<TabProps$1, 'className' | 'style' | 'children'> {
|
|
781
|
-
/** Required. 1–2 words, a noun (
|
|
840
|
+
/** Required. 1–2 words, a noun (“Activity”). */
|
|
782
841
|
children: string;
|
|
783
842
|
/** Optional, then on all tabs. Decorative – the label carries the meaning. */
|
|
784
843
|
icon?: ReactNode;
|
|
785
844
|
/** Items waiting in the tab (Badge count, neutral). Hidden at 0. */
|
|
786
845
|
count?: number;
|
|
787
|
-
/** Screen-reader text of the count (
|
|
846
|
+
/** Screen-reader text of the count (“3 new”). Without it the number is read as part of the name. */
|
|
788
847
|
countLabel?: string;
|
|
789
848
|
}
|
|
790
849
|
/** One tab. The selected tab is a raised thumb that slides to the new tab with a snappy spring (no slide with reduced motion). */
|
|
@@ -827,9 +886,9 @@ interface PopoverProps {
|
|
|
827
886
|
* Opens on click, never on hover. Non-modal: the page stays usable; focus moves in, Esc or a click
|
|
828
887
|
* outside closes it and focus returns to the trigger. One topic per popover, one popover at a time.
|
|
829
888
|
*/
|
|
830
|
-
declare function Popover({ title, 'aria-label': ariaLabel, children, size, primaryAction, cancelLabel, closeLabel, overlay, placement, className, }: PopoverProps): react.JSX.Element;
|
|
889
|
+
declare function Popover({ title, 'aria-label': ariaLabel, children, size, primaryAction, cancelLabel: cancelLabelProp, closeLabel: closeLabelProp, overlay, placement, className, }: PopoverProps): react.JSX.Element;
|
|
831
890
|
interface ToggletipProps {
|
|
832
|
-
/** Required. Names the info button and the toggletip after the topic (
|
|
891
|
+
/** Required. Names the info button and the toggletip after the topic (“About billing email”). */
|
|
833
892
|
'aria-label': string;
|
|
834
893
|
/** One or two short sentences. Text only. */
|
|
835
894
|
children: ReactNode;
|
|
@@ -858,9 +917,9 @@ interface NavItemProps extends Omit<LinkProps$1, 'children' | 'className' | 'sty
|
|
|
858
917
|
isCurrent?: boolean;
|
|
859
918
|
/** Number in the item (Badge count, neutral). */
|
|
860
919
|
count?: number;
|
|
861
|
-
/** Screen-reader text of the count (
|
|
920
|
+
/** Screen-reader text of the count (“3 unread”, “12 projects”). */
|
|
862
921
|
countLabel?: string;
|
|
863
|
-
/** The count is new or unread: in the rail it turns into a dot. Plain totals (
|
|
922
|
+
/** The count is new or unread: in the rail it turns into a dot. Plain totals (“12 projects”) are hidden there. */
|
|
864
923
|
unread?: boolean;
|
|
865
924
|
}
|
|
866
925
|
/**
|
|
@@ -881,13 +940,13 @@ interface NavGroupProps {
|
|
|
881
940
|
/**
|
|
882
941
|
* A group of links behind a disclosure button (aria-expanded) – never a menu.
|
|
883
942
|
* Header: a dropdown panel on the popover surface; Tab moves through the links, Esc or a click outside closes.
|
|
884
|
-
* Sidebar and sheet: opens in place, one level. The parent shows
|
|
943
|
+
* Sidebar and sheet: opens in place, one level. The parent shows “current” only while it is closed.
|
|
885
944
|
*/
|
|
886
945
|
declare function NavGroup({ label, icon, children, defaultOpen }: NavGroupProps): react.JSX.Element;
|
|
887
946
|
interface NavListProps {
|
|
888
947
|
/** Form of the items: header (row) · sidebar · rail · sheet. */
|
|
889
948
|
variant?: NavVariant;
|
|
890
|
-
/** Name of the navigation region (
|
|
949
|
+
/** Name of the navigation region (“Footer”, “Account”). */
|
|
891
950
|
'aria-label': string;
|
|
892
951
|
children: ReactNode;
|
|
893
952
|
className?: string;
|
|
@@ -895,7 +954,7 @@ interface NavListProps {
|
|
|
895
954
|
/** A named navigation region with items of one form – for navigation outside the ready-made headers and bars. */
|
|
896
955
|
declare function NavList({ variant, 'aria-label': label, children, className }: NavListProps): react.JSX.Element;
|
|
897
956
|
interface NavSectionProps {
|
|
898
|
-
/** Overline heading (
|
|
957
|
+
/** Overline heading (“Workspace”). In the rail the section is divided by a line. */
|
|
899
958
|
title: string;
|
|
900
959
|
children: ReactNode;
|
|
901
960
|
}
|
|
@@ -906,18 +965,18 @@ interface SkipLinkProps {
|
|
|
906
965
|
href?: string;
|
|
907
966
|
children?: string;
|
|
908
967
|
}
|
|
909
|
-
/**
|
|
968
|
+
/** “Skip to content” – the first focusable element on every page (WCAG 2.4.1). Visible on focus only. */
|
|
910
969
|
declare function SkipLink({ href, children }: SkipLinkProps): react.JSX.Element;
|
|
911
970
|
interface NavAction {
|
|
912
971
|
label: string;
|
|
913
|
-
/** Usually a link (
|
|
972
|
+
/** Usually a link (“Log in”, “Get started”). */
|
|
914
973
|
href?: string;
|
|
915
974
|
onPress?: (e: PressEvent) => void;
|
|
916
975
|
/** primary: max one · secondary · ghost. */
|
|
917
976
|
variant?: 'primary' | 'secondary' | 'ghost';
|
|
918
977
|
}
|
|
919
978
|
interface SiteHeaderProps {
|
|
920
|
-
/** Logo link with a name (
|
|
979
|
+
/** Logo link with a name (“med.o home”). */
|
|
921
980
|
logo: ReactNode;
|
|
922
981
|
/** NavItems and NavGroups – max 5 links; more go into a group. */
|
|
923
982
|
children: ReactNode;
|
|
@@ -935,7 +994,7 @@ interface SiteHeaderProps {
|
|
|
935
994
|
* Website header: logo, links, actions. Sticky, with a divider once the page scrolls.
|
|
936
995
|
* Below 768 px only the logo, the primary action and a menu button remain; the menu opens fullscreen.
|
|
937
996
|
*/
|
|
938
|
-
declare function SiteHeader({ logo, children, actions, 'aria-label':
|
|
997
|
+
declare function SiteHeader({ logo, children, actions, 'aria-label': labelProp, menuLabel: menuLabelProp, closeLabel: closeLabelProp, layout }: SiteHeaderProps): react.JSX.Element;
|
|
939
998
|
interface AppHeaderProps {
|
|
940
999
|
/** Page title – the same name as the current nav item. */
|
|
941
1000
|
title: ReactNode;
|
|
@@ -980,7 +1039,7 @@ interface SideNavProps {
|
|
|
980
1039
|
* collapses to a 64 px rail with tooltips. 640–1023 px: always a rail; expanding opens the full navigation
|
|
981
1040
|
* as a Drawer on the left. Below 640 px it is hidden – use the BottomTabBar there.
|
|
982
1041
|
*/
|
|
983
|
-
declare function SideNav({ logo, logoMark, children, user, isCollapsed, defaultCollapsed, onCollapsedChange, 'aria-label':
|
|
1042
|
+
declare function SideNav({ logo, logoMark, children, user, isCollapsed, defaultCollapsed, onCollapsedChange, 'aria-label': labelProp, collapseLabel: collapseLabelProp, expandLabel: expandLabelProp, closeLabel: closeLabelProp, }: SideNavProps): react.JSX.Element;
|
|
984
1043
|
interface BottomTabBarProps {
|
|
985
1044
|
/** 3–5 TabBarItems; the last can be TabBarMore. */
|
|
986
1045
|
children: ReactNode;
|
|
@@ -990,9 +1049,9 @@ interface BottomTabBarProps {
|
|
|
990
1049
|
}
|
|
991
1050
|
/**
|
|
992
1051
|
* Bottom tab bar: the main destinations of an app on phones, in thumb reach.
|
|
993
|
-
* Max 4 destinations +
|
|
1052
|
+
* Max 4 destinations + “More”. Fixed to the bottom with the safe area; set `--medo-toast-offset` so toasts stay above it.
|
|
994
1053
|
*/
|
|
995
|
-
declare function BottomTabBar({ children, 'aria-label':
|
|
1054
|
+
declare function BottomTabBar({ children, 'aria-label': labelProp, display }: BottomTabBarProps): react.JSX.Element;
|
|
996
1055
|
interface TabBarItemProps extends Omit<LinkProps$1, 'children' | 'className' | 'style'> {
|
|
997
1056
|
/** Always visible – icons alone are ambiguous. */
|
|
998
1057
|
children: string;
|
|
@@ -1011,11 +1070,11 @@ interface TabBarMoreProps {
|
|
|
1011
1070
|
children: ReactNode;
|
|
1012
1071
|
closeLabel?: string;
|
|
1013
1072
|
}
|
|
1014
|
-
/**
|
|
1015
|
-
declare function TabBarMore({ label, children, closeLabel }: TabBarMoreProps): react.JSX.Element;
|
|
1073
|
+
/** “More”: opens the remaining destinations in the Nav sheet (Bottom Sheet). Shows “current” when one of them is. */
|
|
1074
|
+
declare function TabBarMore({ label: labelProp, children, closeLabel }: TabBarMoreProps): react.JSX.Element;
|
|
1016
1075
|
|
|
1017
1076
|
interface DrawerProps extends DirtyGuardProps {
|
|
1018
|
-
/** Says what it is (
|
|
1077
|
+
/** Says what it is (“Account”, “Filter”, “Invoice #1042”). Can be a logo for a navigation drawer – then set aria-label. */
|
|
1019
1078
|
title: ReactNode;
|
|
1020
1079
|
/** Name of the drawer when the title is not text (e.g. a logo). */
|
|
1021
1080
|
'aria-label'?: string;
|
|
@@ -1023,7 +1082,7 @@ interface DrawerProps extends DirtyGuardProps {
|
|
|
1023
1082
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
1024
1083
|
/**
|
|
1025
1084
|
* Only for decisions (Apply, Save) – usually a ButtonGroup. Links and switches act immediately.
|
|
1026
|
-
* A function gets `close` (after applying or saving, never asks) and `cancel` (asks
|
|
1085
|
+
* A function gets `close` (after applying or saving, never asks) and `cancel` (asks “Discard changes?” when isDirty).
|
|
1027
1086
|
*/
|
|
1028
1087
|
footer?: ReactNode | ((close: () => void, cancel: () => void) => ReactNode);
|
|
1029
1088
|
/** right: account, filters, details (default) · left: navigation only. */
|
|
@@ -1037,7 +1096,7 @@ interface DrawerProps extends DirtyGuardProps {
|
|
|
1037
1096
|
/**
|
|
1038
1097
|
* Drawer – a modal panel that slides in from the side. Same building blocks and behaviour
|
|
1039
1098
|
* as the Dialog (React Aria ModalOverlay + Modal + Dialog): scrim, focus trap, no page scroll, Esc and the close
|
|
1040
|
-
* button close it, focus returns to the trigger; `isDirty` asks
|
|
1099
|
+
* button close it, focus returns to the trigger; `isDirty` asks “Discard changes?”. Below 640 px it keeps its side,
|
|
1041
1100
|
* viewport − 56 px wide; a swipe towards the edge closes it. Use inside a DialogTrigger or with isOpen.
|
|
1042
1101
|
*/
|
|
1043
1102
|
declare function Drawer({ title, 'aria-label': ariaLabel, children, footer, side, size, closeLabel, isDirty, discardText, className, ...openProps }: DrawerProps): react.JSX.Element;
|
|
@@ -1056,12 +1115,12 @@ interface ListProps extends Omit<HTMLAttributes<HTMLUListElement | HTMLOListElem
|
|
|
1056
1115
|
/**
|
|
1057
1116
|
* List – a real list in running text: bullets, numbers or a feature list.
|
|
1058
1117
|
* Plain markup, no library needed. Markers are neutral (text/secondary) in their own column; long items
|
|
1059
|
-
* wrap flush with their first line. Level 2 (a List inside a ListItem) switches the marker: ring,
|
|
1118
|
+
* wrap flush with their first line. Level 2 (a List inside a ListItem) switches the marker: ring, “a.”.
|
|
1060
1119
|
*/
|
|
1061
1120
|
declare function List({ type, size, start, className, style, children, ...props }: ListProps): react.JSX.Element;
|
|
1062
1121
|
interface ListItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
1063
1122
|
children: ReactNode;
|
|
1064
|
-
/** Feature list: not included – cross, muted text and a hidden
|
|
1123
|
+
/** Feature list: not included – cross, muted text and a hidden “Not included:” for screen readers. */
|
|
1065
1124
|
excluded?: boolean;
|
|
1066
1125
|
/** Hidden prefix of excluded items. */
|
|
1067
1126
|
excludedLabel?: string;
|
|
@@ -1077,16 +1136,16 @@ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
1077
1136
|
/** Description list – term–value pairs for details of a record, an order or a profile. */
|
|
1078
1137
|
declare function DescriptionList({ layout, className, children, ...props }: DescriptionListProps): react.JSX.Element;
|
|
1079
1138
|
interface DescriptionItemProps {
|
|
1080
|
-
/** The term (
|
|
1139
|
+
/** The term (“Status”). */
|
|
1081
1140
|
term: ReactNode;
|
|
1082
|
-
/** The value (
|
|
1141
|
+
/** The value (“Active”). */
|
|
1083
1142
|
children: ReactNode;
|
|
1084
1143
|
}
|
|
1085
1144
|
/** One term–value pair (a div grouping dt and dd – valid inside dl). */
|
|
1086
1145
|
declare function DescriptionItem({ term, children }: DescriptionItemProps): react.JSX.Element;
|
|
1087
1146
|
|
|
1088
1147
|
interface ListViewProps<T> extends Omit<GridListProps<T>, 'className' | 'style' | 'layout' | 'keyboardNavigationBehavior'> {
|
|
1089
|
-
/** Required: names the list (
|
|
1148
|
+
/** Required: names the list (“Inbox”). */
|
|
1090
1149
|
'aria-label'?: string;
|
|
1091
1150
|
/** plain: full-page lists (inbox) · card: inside settings or dashboards (border, radius/lg) · cards: records on mobile (Table cards, use ListCard). */
|
|
1092
1151
|
variant?: 'plain' | 'card' | 'cards';
|
|
@@ -1101,7 +1160,7 @@ interface ListViewProps<T> extends Omit<GridListProps<T>, 'className' | 'style'
|
|
|
1101
1160
|
*. Built on React Aria GridList: ↑ ↓ move between rows, Enter opens a row, Tab reaches
|
|
1102
1161
|
* the controls inside a row (menu, switch, buttons). `selectionMode="multiple"` shows a checkbox per row and a click
|
|
1103
1162
|
* toggles the row – use it without `onAction` (React Aria would run the action on click instead).
|
|
1104
|
-
* Rows can have swipe actions on touch (`swipeActions`) – the same actions always sit in the row's
|
|
1163
|
+
* Rows can have swipe actions on touch (`swipeActions`) – the same actions always sit in the row's “…” menu.
|
|
1105
1164
|
*/
|
|
1106
1165
|
declare function ListView<T extends object>({ variant, isLoading, emptyState, className, children, items, ...props }: ListViewProps<T>): react.JSX.Element;
|
|
1107
1166
|
interface ListRowProps extends Omit<GridListItemProps, 'children' | 'className' | 'style' | 'textValue'> {
|
|
@@ -1115,17 +1174,17 @@ interface ListRowProps extends Omit<GridListItemProps, 'children' | 'className'
|
|
|
1115
1174
|
leading?: ReactNode;
|
|
1116
1175
|
/** Meta text (time, size) in caption. */
|
|
1117
1176
|
meta?: ReactNode;
|
|
1118
|
-
/** One trailing type per list: Badge, Menu (
|
|
1177
|
+
/** One trailing type per list: Badge, Menu (“…”), Switch or max 2 Button sm. With buttons the row has no action. */
|
|
1119
1178
|
trailing?: ReactNode;
|
|
1120
1179
|
/** The row navigates (href) – shows a chevron. */
|
|
1121
1180
|
chevron?: boolean;
|
|
1122
|
-
/** New or unread: title and excerpt strong, meta in brand, dot below the meta,
|
|
1181
|
+
/** New or unread: title and excerpt strong, meta in brand, dot below the meta, “Unread” for screen readers. */
|
|
1123
1182
|
unread?: boolean;
|
|
1124
1183
|
/** Screen-reader word for unread rows. */
|
|
1125
1184
|
unreadLabel?: string;
|
|
1126
1185
|
/**
|
|
1127
1186
|
* Touch only: end = swipe toward the start (left in LTR, e.g. Delete) · start = swipe toward the end (a safe action,
|
|
1128
|
-
* e.g. Archive). Always put the same actions into the row's
|
|
1187
|
+
* e.g. Archive). Always put the same actions into the row's “…” menu – swipe is a shortcut, never the only way.
|
|
1129
1188
|
*/
|
|
1130
1189
|
swipeActions?: {
|
|
1131
1190
|
start?: SwipeAction;
|
|
@@ -1133,10 +1192,10 @@ interface ListRowProps extends Omit<GridListItemProps, 'children' | 'className'
|
|
|
1133
1192
|
};
|
|
1134
1193
|
}
|
|
1135
1194
|
interface SwipeAction {
|
|
1136
|
-
/** Short verb (
|
|
1195
|
+
/** Short verb (“Delete”, “Archive”). */
|
|
1137
1196
|
label: string;
|
|
1138
1197
|
icon: ReactNode;
|
|
1139
|
-
/** Runs on a full swipe or a tap on the revealed action. Delete: remove at once and offer
|
|
1198
|
+
/** Runs on a full swipe or a tap on the revealed action. Delete: remove at once and offer “Undo” in a Toast. */
|
|
1140
1199
|
onAction: () => void;
|
|
1141
1200
|
/** danger: feedback/danger/solid (Delete) · primary: action/primary (Archive). */
|
|
1142
1201
|
tone?: 'danger' | 'primary';
|
|
@@ -1148,7 +1207,7 @@ declare function ListRowIcon({ children }: {
|
|
|
1148
1207
|
children: ReactNode;
|
|
1149
1208
|
}): react.JSX.Element;
|
|
1150
1209
|
interface ListCardProps extends Omit<GridListItemProps, 'children' | 'className' | 'style' | 'textValue'> {
|
|
1151
|
-
/** Required. The record (
|
|
1210
|
+
/** Required. The record (“INV-2026-0140”). Also the card's accessible name. */
|
|
1152
1211
|
title: string;
|
|
1153
1212
|
/** Key number on the right of the title (amount, count) – strong, never truncated. */
|
|
1154
1213
|
amount?: ReactNode;
|
|
@@ -1167,18 +1226,18 @@ interface ListCardProps extends Omit<GridListItemProps, 'children' | 'className'
|
|
|
1167
1226
|
declare function ListCard({ title, amount, description, meta, status, ...props }: ListCardProps): react.JSX.Element;
|
|
1168
1227
|
|
|
1169
1228
|
interface BulkAction {
|
|
1170
|
-
/** Verb (
|
|
1229
|
+
/** Verb (“Export”, “Archive”, “Delete”). */
|
|
1171
1230
|
label: string;
|
|
1172
1231
|
onAction: () => void;
|
|
1173
1232
|
/** danger: destructive – confirm it (Alert dialog) or offer Undo (Toast). Mobile: ghost danger. */
|
|
1174
1233
|
variant?: 'default' | 'danger';
|
|
1175
|
-
/** Icon for the
|
|
1234
|
+
/** Icon for the “…” menu (actions that do not fit in the bar). */
|
|
1176
1235
|
icon?: ReactNode;
|
|
1177
1236
|
}
|
|
1178
1237
|
interface BulkActionBarProps {
|
|
1179
1238
|
/** Number of selected items. 0 hides the bar. */
|
|
1180
1239
|
count: number;
|
|
1181
|
-
/**
|
|
1240
|
+
/** Desktop shows 3, mobile 2 (with more: 1 and “…”); the rest go into the “…” menu. Most important first, destructive last. */
|
|
1182
1241
|
actions: BulkAction[];
|
|
1183
1242
|
/** Clears the selection (× and Esc). */
|
|
1184
1243
|
onClear: () => void;
|
|
@@ -1196,16 +1255,16 @@ interface BulkActionBarProps {
|
|
|
1196
1255
|
* Appears with ≥ 1 selected item and floats, so selecting never shifts the layout. A toolbar: the count is
|
|
1197
1256
|
* announced, Esc or × clears the selection. Render it right after the list, so Tab reaches it next.
|
|
1198
1257
|
*/
|
|
1199
|
-
declare function BulkActionBar({ count, actions, onClear, variant, countLabel, clearLabel, moreLabel, 'aria-label':
|
|
1258
|
+
declare function BulkActionBar({ count, actions, onClear, variant, countLabel: countLabelProp, clearLabel: clearLabelProp, moreLabel: moreLabelProp, 'aria-label': ariaLabelProp, className, }: BulkActionBarProps): react.JSX.Element;
|
|
1200
1259
|
|
|
1201
1260
|
type EmptyStateType = 'first-use' | 'no-results' | 'error' | 'no-access' | 'all-done';
|
|
1202
1261
|
type EmptyStateSize = 'page' | 'section' | 'inline';
|
|
1203
1262
|
interface EmptyStateAction {
|
|
1204
|
-
/** Verb that says what happens (
|
|
1263
|
+
/** Verb that says what happens (“Create project”, “Clear filters”, “Try again”). */
|
|
1205
1264
|
label: string;
|
|
1206
1265
|
/** Runs the action. */
|
|
1207
1266
|
onPress?: () => void;
|
|
1208
|
-
/** Second action only: navigates – rendered as a Link (
|
|
1267
|
+
/** Second action only: navigates – rendered as a Link (“Learn more”, “View archive”). */
|
|
1209
1268
|
href?: string;
|
|
1210
1269
|
isDisabled?: boolean;
|
|
1211
1270
|
}
|
|
@@ -1214,11 +1273,11 @@ interface EmptyStateProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
|
1214
1273
|
type?: EmptyStateType;
|
|
1215
1274
|
/** page: a whole view · section: a card or panel · inline: inside a list or table (header stays). */
|
|
1216
1275
|
size?: EmptyStateSize;
|
|
1217
|
-
/** Required. The situation in plain words – never
|
|
1276
|
+
/** Required. The situation in plain words – never “No data”. */
|
|
1218
1277
|
title: ReactNode;
|
|
1219
1278
|
/** Why it is empty or what comes next, in one or two sentences. */
|
|
1220
1279
|
description?: ReactNode;
|
|
1221
|
-
/** Main action: primary for first use, secondary for all other types.
|
|
1280
|
+
/** Main action: primary for first use, secondary for all other types. “All done” needs none. */
|
|
1222
1281
|
action?: EmptyStateAction;
|
|
1223
1282
|
/** Second action as a text button, or a Link with `href`. */
|
|
1224
1283
|
secondaryAction?: EmptyStateAction;
|
|
@@ -1232,7 +1291,7 @@ interface EmptyStateProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
|
1232
1291
|
/**
|
|
1233
1292
|
* Empty state – what users see when there is nothing to show, and what they can do next.
|
|
1234
1293
|
* Page and section render a `<section>` named by its heading; inline renders a plain block, so it does not add
|
|
1235
|
-
* a landmark inside a list or table.
|
|
1294
|
+
* a landmark inside a list or table. “No results” puts its text in a polite status region; focus stays where it was.
|
|
1236
1295
|
*/
|
|
1237
1296
|
declare function EmptyState({ type, size, title, description, action, secondaryAction, icon, illustration, headingLevel, className, ...props }: EmptyStateProps): react.JSX.Element;
|
|
1238
1297
|
|
|
@@ -1243,15 +1302,15 @@ interface PaginationProps {
|
|
|
1243
1302
|
defaultPage?: number;
|
|
1244
1303
|
/** Called with the new page (apps). Not needed with `getPageHref`. */
|
|
1245
1304
|
onChange?: (page: number) => void;
|
|
1246
|
-
/** Websites: every page becomes a real link (
|
|
1305
|
+
/** Websites: every page becomes a real link (“?page=5”) – shareable, back button works. Works with RouterProvider. */
|
|
1247
1306
|
getPageHref?: (page: number) => string;
|
|
1248
1307
|
/** Number of pages. Default: totalItems / pageSize. With 1 page nothing is shown. */
|
|
1249
1308
|
totalPages?: number;
|
|
1250
|
-
/** Total count: shows the summary (
|
|
1309
|
+
/** Total count: shows the summary (“81–100 of 380”). */
|
|
1251
1310
|
totalItems?: number;
|
|
1252
1311
|
/** Rows per page. */
|
|
1253
1312
|
pageSize?: number;
|
|
1254
|
-
/** Shows
|
|
1313
|
+
/** Shows “Rows per page” (Select sm). */
|
|
1255
1314
|
onPageSizeChange?: (pageSize: number) => void;
|
|
1256
1315
|
pageSizeOptions?: number[];
|
|
1257
1316
|
/** auto: compact below 640 px · full: summary, rows per page and pages · compact: ‹ Page 5 of 19 › (narrow panels). */
|
|
@@ -1273,16 +1332,16 @@ interface PaginationProps {
|
|
|
1273
1332
|
/**
|
|
1274
1333
|
* Pagination – move through long lists page by page. A navigation region:
|
|
1275
1334
|
* buttons for apps (`onChange`) or real links for websites (`getPageHref`). Full on desktop, compact below 640 px.
|
|
1276
|
-
* After a change the app scrolls to the top of the list and focuses its heading.
|
|
1335
|
+
* After a change the app scrolls to the top of the list and focuses its heading. “Load more” is a Button, not a variant.
|
|
1277
1336
|
*/
|
|
1278
|
-
declare function Pagination({ page: pageProp, defaultPage, onChange, getPageHref, totalPages: totalPagesProp, totalItems, pageSize, onPageSizeChange, pageSizeOptions, variant, size, 'aria-label':
|
|
1337
|
+
declare function Pagination({ page: pageProp, defaultPage, onChange, getPageHref, totalPages: totalPagesProp, totalItems, pageSize, onPageSizeChange, pageSizeOptions, variant, size, 'aria-label': ariaLabelProp, summary: summaryProp, pageSizeLabel: pageSizeLabelProp, previousLabel: previousLabelProp, nextLabel: nextLabelProp, pageLabel: pageLabelProp, compactLabel: compactLabelProp, className, }: PaginationProps): react.JSX.Element | null;
|
|
1279
1338
|
|
|
1280
1339
|
interface SearchFieldProps extends Omit<SearchFieldProps$1, 'children' | 'className' | 'style'> {
|
|
1281
1340
|
/** Visible label. Without it set `aria-label` (e.g. in a table toolbar or the header). */
|
|
1282
1341
|
label?: ReactNode;
|
|
1283
1342
|
/** Helper text below the field. */
|
|
1284
1343
|
description?: ReactNode;
|
|
1285
|
-
/** A hint like
|
|
1344
|
+
/** A hint like “Search invoices”. Never the only label. */
|
|
1286
1345
|
placeholder?: string;
|
|
1287
1346
|
/** sm 32 (toolbars) · md 40 · lg 48 (search page, Quick search, mobile). */
|
|
1288
1347
|
size?: InputSize;
|
|
@@ -1308,13 +1367,13 @@ interface SearchResultProps {
|
|
|
1308
1367
|
href: string;
|
|
1309
1368
|
/** Search term: shown in bold in title and snippet (every match), never by colour alone. */
|
|
1310
1369
|
query?: string;
|
|
1311
|
-
/** Where it lives (
|
|
1370
|
+
/** Where it lives (“Help center › Billing”). */
|
|
1312
1371
|
path?: ReactNode;
|
|
1313
1372
|
/** Text around the match, max 2 lines. A string gets the highlight. */
|
|
1314
1373
|
snippet?: ReactNode;
|
|
1315
|
-
/** Type label as Badge sm (
|
|
1374
|
+
/** Type label as Badge sm (“Page”, “PDF”, “Video”). */
|
|
1316
1375
|
badge?: string;
|
|
1317
|
-
/** Meta text next to the badge (
|
|
1376
|
+
/** Meta text next to the badge (“Updated 3 days ago”). */
|
|
1318
1377
|
meta?: ReactNode;
|
|
1319
1378
|
/** Person: Avatar (sized lg automatically). Media: an image (4:3; 128 wide, 160 in aesthetic). Overrides the type icon. */
|
|
1320
1379
|
leading?: ReactNode;
|
|
@@ -1347,9 +1406,9 @@ interface QuickSearchProps<T extends object> {
|
|
|
1347
1406
|
items?: Iterable<T>;
|
|
1348
1407
|
/** Opens the highlighted hit (Enter or click). */
|
|
1349
1408
|
onAction?: (key: React.Key) => void;
|
|
1350
|
-
/**
|
|
1409
|
+
/** “All results”: the search page with the same term. */
|
|
1351
1410
|
allResultsHref?: (query: string) => string;
|
|
1352
|
-
/** Enter without a highlighted hit, and
|
|
1411
|
+
/** Enter without a highlighted hit, and “Search all content” when nothing matches. */
|
|
1353
1412
|
onSearch?: (query: string) => void;
|
|
1354
1413
|
/** Texts (localize). */
|
|
1355
1414
|
'aria-label'?: string;
|
|
@@ -1370,7 +1429,7 @@ interface QuickSearchProps<T extends object> {
|
|
|
1370
1429
|
* React Aria Autocomplete: focus stays in the field while ↑ ↓ move through the suggestions, Enter opens the
|
|
1371
1430
|
* highlighted hit, Esc closes and focus returns to the trigger. Desktop: overlay 640 wide · mobile: full screen with Cancel.
|
|
1372
1431
|
*/
|
|
1373
|
-
declare function QuickSearch<T extends object>({ isOpen, defaultOpen, onOpenChange, shortcut, inputValue, onInputChange, clientFilter, children, items, onAction, allResultsHref, onSearch, 'aria-label':
|
|
1432
|
+
declare function QuickSearch<T extends object>({ isOpen, defaultOpen, onOpenChange, shortcut, inputValue, onInputChange, clientFilter, children, items, onAction, allResultsHref, onSearch, 'aria-label': ariaLabelProp, placeholder: placeholderProp, cancelLabel: cancelLabelProp, suggestionsLabel: suggestionsLabelProp, allResultsLabel: allResultsLabelProp, noResultsLabel: noResultsLabelProp, searchAllLabel: searchAllLabelProp, hints: hintsProp, }: QuickSearchProps<T>): react.JSX.Element;
|
|
1374
1433
|
|
|
1375
1434
|
/** Shows the matching parts of a text in bold (`className` on each match). Visual only; screen readers read plain text. */
|
|
1376
1435
|
declare function Highlight({ text, query, all, as: Tag, className, }: {
|
|
@@ -1392,9 +1451,9 @@ interface BreadcrumbsProps {
|
|
|
1392
1451
|
items: BreadcrumbItem[];
|
|
1393
1452
|
/** sm: dense apps (caption, 24) · md: websites (body/sm, 28). */
|
|
1394
1453
|
size?: 'sm' | 'md';
|
|
1395
|
-
/** The first item shows a house icon; its label stays the accessible name (
|
|
1454
|
+
/** The first item shows a house icon; its label stays the accessible name (“Home”). */
|
|
1396
1455
|
homeIcon?: boolean;
|
|
1397
|
-
/** auto: full path, below 640 px only a link to the parent page · full · back. From 5 levels the middle collapses into
|
|
1456
|
+
/** auto: full path, below 640 px only a link to the parent page · full · back. From 5 levels the middle collapses into “…”. */
|
|
1398
1457
|
layout?: 'auto' | 'full' | 'back';
|
|
1399
1458
|
/** Texts (localize). */
|
|
1400
1459
|
'aria-label'?: string;
|
|
@@ -1406,7 +1465,7 @@ interface BreadcrumbsProps {
|
|
|
1406
1465
|
* Built on React Aria Breadcrumbs: a navigation region with an ordered list, the current page last with
|
|
1407
1466
|
* aria-current="page". Not on the start page; place it above the page title.
|
|
1408
1467
|
*/
|
|
1409
|
-
declare function Breadcrumbs({ items, size, homeIcon, layout, 'aria-label':
|
|
1468
|
+
declare function Breadcrumbs({ items, size, homeIcon, layout, 'aria-label': ariaLabelProp, moreLabel: moreLabelProp, className, }: BreadcrumbsProps): react.JSX.Element | null;
|
|
1410
1469
|
|
|
1411
1470
|
type AccordionSize = 'md' | 'lg';
|
|
1412
1471
|
interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'> {
|
|
@@ -1416,7 +1475,7 @@ interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style
|
|
|
1416
1475
|
headingLevel?: 2 | 3 | 4;
|
|
1417
1476
|
/** Several sections open at once (default). false: one at a time – only for short, mutually exclusive steps. */
|
|
1418
1477
|
allowsMultipleExpanded?: boolean;
|
|
1419
|
-
/**
|
|
1478
|
+
/** “Expand all” / “Collapse all” above groups with more than 6 sections (multiple only). */
|
|
1420
1479
|
expandAll?: boolean;
|
|
1421
1480
|
expandAllLabel?: string;
|
|
1422
1481
|
collapseAllLabel?: string;
|
|
@@ -1439,7 +1498,7 @@ interface AccordionItemProps {
|
|
|
1439
1498
|
description?: ReactNode;
|
|
1440
1499
|
/** Decorative icon before the title (20 md / 24 lg). */
|
|
1441
1500
|
icon?: ReactNode;
|
|
1442
|
-
/** Badge sm – part of the button name (
|
|
1501
|
+
/** Badge sm – part of the button name (“Billing, Payment failed”). */
|
|
1443
1502
|
badge?: ReactNode;
|
|
1444
1503
|
isDisabled?: boolean;
|
|
1445
1504
|
/** Panel content – text, a form or a list. No accordion inside. */
|
|
@@ -1452,7 +1511,7 @@ type Value = number | number[];
|
|
|
1452
1511
|
interface SliderProps<T extends Value = number> extends Omit<SliderProps$1<T>, 'children' | 'className' | 'style'> {
|
|
1453
1512
|
/** Visible label. Without it set `aria-label`. */
|
|
1454
1513
|
label?: ReactNode;
|
|
1455
|
-
/** Range: a name per thumb (
|
|
1514
|
+
/** Range: a name per thumb (“Minimum price”, “Maximum price”). Default: “Minimum” / “Maximum” + label. */
|
|
1456
1515
|
thumbLabels?: [string, string];
|
|
1457
1516
|
/** Tick marks for few fixed steps (≤ 10) – the thumb snaps to them. */
|
|
1458
1517
|
showTicks?: boolean;
|
|
@@ -1499,15 +1558,15 @@ interface NumberFieldProps extends Omit<NumberFieldProps$1, 'children' | 'classN
|
|
|
1499
1558
|
declare function NumberField({ label, description, errorMessage, placeholder, size, className, ...props }: NumberFieldProps): react.JSX.Element;
|
|
1500
1559
|
|
|
1501
1560
|
interface LinkProps extends Omit<LinkProps$1, 'children' | 'className'> {
|
|
1502
|
-
/** The text says where it goes (
|
|
1561
|
+
/** The text says where it goes (“Privacy policy”, not “click here”). */
|
|
1503
1562
|
children: ReactNode;
|
|
1504
1563
|
/** inline: inside running text, always underlined · standalone: own line, underline on hover. */
|
|
1505
1564
|
variant?: 'inline' | 'standalone';
|
|
1506
1565
|
/** Standalone only: sm (label/sm) · md (label/md). Inline links take the size of the surrounding text. */
|
|
1507
1566
|
size?: 'sm' | 'md';
|
|
1508
|
-
/** Another website: shows the external icon. With target="_blank" screen readers also hear
|
|
1567
|
+
/** Another website: shows the external icon. With target="_blank" screen readers also hear “opens in a new tab”. */
|
|
1509
1568
|
external?: boolean;
|
|
1510
|
-
/** Standalone only: arrow after the text (
|
|
1569
|
+
/** Standalone only: arrow after the text (“View all →”). */
|
|
1511
1570
|
arrow?: boolean;
|
|
1512
1571
|
/** Hidden text for links that open a new tab. */
|
|
1513
1572
|
newTabLabel?: string;
|
|
@@ -1525,7 +1584,7 @@ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
|
1525
1584
|
tone?: AlertTone;
|
|
1526
1585
|
/** inline: in the content · banner: full width above the header, for app-wide states. */
|
|
1527
1586
|
variant?: 'inline' | 'banner';
|
|
1528
|
-
/** Required. Says what happened (
|
|
1587
|
+
/** Required. Says what happened (“Your trial ends in 3 days”). */
|
|
1529
1588
|
title: ReactNode;
|
|
1530
1589
|
/** What to do next. */
|
|
1531
1590
|
children?: ReactNode;
|
|
@@ -1589,6 +1648,8 @@ interface StaticTableProps {
|
|
|
1589
1648
|
/**
|
|
1590
1649
|
* Static table – a native, non-interactive table with the Table look.
|
|
1591
1650
|
* For content and simple data. Numbers: add className="medo-table__cell--number".
|
|
1651
|
+
* When it is wider than its container it scrolls sideways; the container then takes the keyboard focus
|
|
1652
|
+
* (arrow keys scroll) and is announced as a region named by the caption.
|
|
1592
1653
|
*/
|
|
1593
1654
|
declare function StaticTable({ children, caption, captionHidden, density, striped, plain, className, style }: StaticTableProps): react.JSX.Element;
|
|
1594
1655
|
interface TableProps extends Omit<TableProps$1, 'className' | 'style'> {
|
|
@@ -1644,9 +1705,9 @@ interface ColumnsMenuProps {
|
|
|
1644
1705
|
* Columns menu – shows or hides table columns. A ghost button sm in the
|
|
1645
1706
|
* table toolbar opens a Popover sm with checkboxes; locked columns stay visible. Render only the visible columns.
|
|
1646
1707
|
*/
|
|
1647
|
-
declare function ColumnsMenu({ columns, visibleColumns, onVisibleColumnsChange, label, title }: ColumnsMenuProps): react.JSX.Element;
|
|
1708
|
+
declare function ColumnsMenu({ columns, visibleColumns, onVisibleColumnsChange, label: labelProp, title: titleProp }: ColumnsMenuProps): react.JSX.Element;
|
|
1648
1709
|
|
|
1649
|
-
/**
|
|
1710
|
+
/** “2.4 MB”, “860 kB” – decimal units like the operating systems' file dialogs. */
|
|
1650
1711
|
declare function formatBytes(bytes: number, locale?: string): string;
|
|
1651
1712
|
interface UploadFile {
|
|
1652
1713
|
/** Stable id (e.g. crypto.randomUUID() when the file is added). */
|
|
@@ -1659,11 +1720,11 @@ interface UploadFile {
|
|
|
1659
1720
|
status: 'uploading' | 'done' | 'error';
|
|
1660
1721
|
/** Uploaded bytes (ProgressEvent.loaded). Without it the bar is indeterminate. */
|
|
1661
1722
|
loaded?: number;
|
|
1662
|
-
/** What happened and how to fix it (
|
|
1723
|
+
/** What happened and how to fix it (“Upload interrupted. Check your connection and retry.”). No error codes. */
|
|
1663
1724
|
error?: string;
|
|
1664
1725
|
/** Thumbnail (URL.createObjectURL(file) or the server URL). */
|
|
1665
1726
|
previewUrl?: string;
|
|
1666
|
-
/** false hides
|
|
1727
|
+
/** false hides “Retry” (e.g. the server rejected the file). Default true. */
|
|
1667
1728
|
canRetry?: boolean;
|
|
1668
1729
|
}
|
|
1669
1730
|
interface UploadTexts {
|
|
@@ -1680,7 +1741,7 @@ interface UploadTexts {
|
|
|
1680
1741
|
retryShort: string;
|
|
1681
1742
|
/** Name of the progress bar. */
|
|
1682
1743
|
uploading: (name: string) => string;
|
|
1683
|
-
/**
|
|
1744
|
+
/** “1.6 of 2.4 MB · 64 %” */
|
|
1684
1745
|
progress: (loaded: string, total: string, percent: number) => string;
|
|
1685
1746
|
/** Validation. */
|
|
1686
1747
|
typeNotAllowed: (names: string, types: string) => string;
|
|
@@ -1690,6 +1751,7 @@ interface UploadTexts {
|
|
|
1690
1751
|
uploaded: (name: string) => string;
|
|
1691
1752
|
failed: (name: string, error: string) => string;
|
|
1692
1753
|
}
|
|
1754
|
+
/** English defaults. The components use the texts of the current language (see i18n). */
|
|
1693
1755
|
declare const defaultUploadTexts: UploadTexts;
|
|
1694
1756
|
interface ItemActions {
|
|
1695
1757
|
onRemove: (id: string) => void;
|
|
@@ -1716,11 +1778,11 @@ interface FileTileProps extends ItemActions {
|
|
|
1716
1778
|
*/
|
|
1717
1779
|
declare function FileTile({ file, onRemove, onCancel, onRetry, texts: own, className }: FileTileProps): react.JSX.Element;
|
|
1718
1780
|
interface PickerProps {
|
|
1719
|
-
/** Accepted types as for <input accept>: [
|
|
1781
|
+
/** Accepted types as for <input accept>: [“.pdf”, “image/*”]. Checked again before upload. */
|
|
1720
1782
|
acceptedFileTypes?: string[];
|
|
1721
1783
|
/** Several files at once. Default true. */
|
|
1722
1784
|
allowsMultiple?: boolean;
|
|
1723
|
-
/** Mobile: open the camera first (
|
|
1785
|
+
/** Mobile: open the camera first (“environment” = back camera). */
|
|
1724
1786
|
defaultCamera?: 'user' | 'environment';
|
|
1725
1787
|
isDisabled?: boolean;
|
|
1726
1788
|
/** Types, size and count – shown before the user picks a file. */
|
|
@@ -1743,7 +1805,7 @@ interface DropzoneProps extends PickerProps {
|
|
|
1743
1805
|
declare function Dropzone({ acceptedFileTypes, allowsMultiple, defaultCamera, isDisabled, hint, errorMessage, onSelect, texts: own, className, ...props }: DropzoneProps): react.JSX.Element;
|
|
1744
1806
|
interface FileTriggerProps extends PickerProps {
|
|
1745
1807
|
label?: ReactNode;
|
|
1746
|
-
/** Visual marker; check
|
|
1808
|
+
/** Visual marker; check “at least one file” on submit and pass `errorMessage`. */
|
|
1747
1809
|
isRequired?: boolean;
|
|
1748
1810
|
}
|
|
1749
1811
|
/**
|
|
@@ -1765,14 +1827,14 @@ interface UploadFieldProps extends Omit<ItemActions, 'texts'> {
|
|
|
1765
1827
|
*/
|
|
1766
1828
|
layout?: 'auto' | 'list' | 'compact' | 'grid';
|
|
1767
1829
|
acceptedFileTypes?: string[];
|
|
1768
|
-
/** Readable form of the types for hint and message (
|
|
1830
|
+
/** Readable form of the types for hint and message (“PDF, JPG or PNG”). */
|
|
1769
1831
|
typesLabel?: string;
|
|
1770
1832
|
/** Max size per file in bytes. */
|
|
1771
1833
|
maxSize?: number;
|
|
1772
1834
|
/** Max number of files. 1 = single file picker. */
|
|
1773
1835
|
maxFiles?: number;
|
|
1774
1836
|
defaultCamera?: 'user' | 'environment';
|
|
1775
|
-
/** Default:
|
|
1837
|
+
/** Default: “{typesLabel} · max. {maxSize} each”. */
|
|
1776
1838
|
hint?: ReactNode;
|
|
1777
1839
|
/** Field error from the app (e.g. required on submit). Wins over the built-in validation message. */
|
|
1778
1840
|
errorMessage?: ReactNode;
|
|
@@ -1795,11 +1857,12 @@ interface CalendarTexts {
|
|
|
1795
1857
|
nextYear: string;
|
|
1796
1858
|
previousYears: string;
|
|
1797
1859
|
nextYears: string;
|
|
1798
|
-
/** Name of the month-and-year button:
|
|
1860
|
+
/** Name of the month-and-year button: “October 2026 – choose month and year”. */
|
|
1799
1861
|
chooseMonth: (title: string) => string;
|
|
1800
1862
|
chooseYear: (year: string) => string;
|
|
1801
1863
|
weekNumber: string;
|
|
1802
1864
|
}
|
|
1865
|
+
/** English defaults. The components use the texts of the current language (see i18n). */
|
|
1803
1866
|
declare const defaultCalendarTexts: CalendarTexts;
|
|
1804
1867
|
interface SharedProps {
|
|
1805
1868
|
/** md: 40 px days for desktop popovers · lg: 48 px for touch (Bottom Sheet). */
|
|
@@ -1841,13 +1904,13 @@ interface DateFieldProps<T extends DateValue> extends Omit<DateFieldProps$1<T>,
|
|
|
1841
1904
|
}
|
|
1842
1905
|
/**
|
|
1843
1906
|
* Date field – type a date without a calendar. React Aria DateField: every segment is a
|
|
1844
|
-
* spinbutton (
|
|
1907
|
+
* spinbutton (“day”, “month”, “year”), ↑ ↓ change it, ← → move, Backspace clears, a pasted date fills all.
|
|
1845
1908
|
* `granularity="minute"` adds the time. For a calendar use DatePicker.
|
|
1846
1909
|
*/
|
|
1847
1910
|
declare function DateField<T extends DateValue>({ label, description, errorMessage, size, className, ...props }: DateFieldProps<T>): react.JSX.Element;
|
|
1848
1911
|
interface TimeSlot {
|
|
1849
1912
|
value: TimeValue;
|
|
1850
|
-
/** Booked slots stay visible, disabled, with the reason (
|
|
1913
|
+
/** Booked slots stay visible, disabled, with the reason (“Booked”). */
|
|
1851
1914
|
isDisabled?: boolean;
|
|
1852
1915
|
reason?: string;
|
|
1853
1916
|
}
|
|
@@ -1861,19 +1924,223 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, 'children' |
|
|
|
1861
1924
|
* Time field – type a time. HH:MM, 24 h in de – from the locale. Typing only;
|
|
1862
1925
|
* with `slots` a clock button opens a list of fixed times (bookings), booked ones disabled with a reason.
|
|
1863
1926
|
*/
|
|
1864
|
-
declare function TimeField({ label, description, errorMessage, size, slots, slotsLabel, className, defaultValue, onChange, ...props }: TimeFieldProps): react.JSX.Element;
|
|
1927
|
+
declare function TimeField({ label, description, errorMessage, size, slots, slotsLabel: slotsLabelProp, className, defaultValue, onChange, ...props }: TimeFieldProps): react.JSX.Element;
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* Built-in texts of the components: button labels, screen-reader names, announcements, validation messages.
|
|
1931
|
+
* One object per language (en.ts, de.ts). TypeScript checks that every language has every text with the
|
|
1932
|
+
* right parameters. A component prop (e.g. `closeLabel`) always wins over these defaults.
|
|
1933
|
+
*/
|
|
1934
|
+
interface Messages {
|
|
1935
|
+
common: {
|
|
1936
|
+
close: string;
|
|
1937
|
+
cancel: string;
|
|
1938
|
+
back: string;
|
|
1939
|
+
more: string;
|
|
1940
|
+
done: string;
|
|
1941
|
+
search: string;
|
|
1942
|
+
showResults: string;
|
|
1943
|
+
loading: string;
|
|
1944
|
+
clear: string;
|
|
1945
|
+
clearAll: string;
|
|
1946
|
+
noResults: string;
|
|
1947
|
+
noResultsFor: (query: string) => string;
|
|
1948
|
+
/** Name of a chosen value list: “Assignee: selected”. */
|
|
1949
|
+
selected: (name: string) => string;
|
|
1950
|
+
/** Announcement after removing values: “Design removed”. */
|
|
1951
|
+
removed: (labels: string[]) => string;
|
|
1952
|
+
/** Combobox: row that creates a new value. */
|
|
1953
|
+
add: (text: string) => string;
|
|
1954
|
+
create: string;
|
|
1955
|
+
reset: string;
|
|
1956
|
+
/** Sheet footer: “3 selected”. */
|
|
1957
|
+
countSelected: (count: number) => string;
|
|
1958
|
+
/** Fallback name of chosen values without a text label. */
|
|
1959
|
+
selectedValues: string;
|
|
1960
|
+
};
|
|
1961
|
+
/** Key names in shortcuts (⌘, ⇧ and Alt are the same everywhere). */
|
|
1962
|
+
keys: {
|
|
1963
|
+
control: string;
|
|
1964
|
+
};
|
|
1965
|
+
accordion: {
|
|
1966
|
+
expandAll: string;
|
|
1967
|
+
collapseAll: string;
|
|
1968
|
+
};
|
|
1969
|
+
alert: {
|
|
1970
|
+
dismiss: string;
|
|
1971
|
+
};
|
|
1972
|
+
avatar: {
|
|
1973
|
+
status: Record<'online' | 'away' | 'busy' | 'offline', string>;
|
|
1974
|
+
unknownPerson: string;
|
|
1975
|
+
unknownOrganization: string;
|
|
1976
|
+
more: (count: number) => string;
|
|
1977
|
+
};
|
|
1978
|
+
breadcrumbs: {
|
|
1979
|
+
label: string;
|
|
1980
|
+
more: (count: number) => string;
|
|
1981
|
+
};
|
|
1982
|
+
bulkActionBar: {
|
|
1983
|
+
label: string;
|
|
1984
|
+
count: (count: number) => string;
|
|
1985
|
+
clear: string;
|
|
1986
|
+
more: string;
|
|
1987
|
+
};
|
|
1988
|
+
calendar: {
|
|
1989
|
+
previousMonth: string;
|
|
1990
|
+
nextMonth: string;
|
|
1991
|
+
previousYear: string;
|
|
1992
|
+
nextYear: string;
|
|
1993
|
+
previousYears: string;
|
|
1994
|
+
nextYears: string;
|
|
1995
|
+
chooseMonth: (title: string) => string;
|
|
1996
|
+
chooseYear: (year: string) => string;
|
|
1997
|
+
weekNumber: string;
|
|
1998
|
+
};
|
|
1999
|
+
datePicker: {
|
|
2000
|
+
openCalendar: string;
|
|
2001
|
+
time: string;
|
|
2002
|
+
presets: string;
|
|
2003
|
+
beforeMin: (date: string) => string;
|
|
2004
|
+
afterMax: (date: string) => string;
|
|
2005
|
+
unavailable: string;
|
|
2006
|
+
reversed: string;
|
|
2007
|
+
today: string;
|
|
2008
|
+
yesterday: string;
|
|
2009
|
+
last7Days: string;
|
|
2010
|
+
last14Days: string;
|
|
2011
|
+
last30Days: string;
|
|
2012
|
+
thisMonth: string;
|
|
2013
|
+
lastMonth: string;
|
|
2014
|
+
availableTimes: string;
|
|
2015
|
+
};
|
|
2016
|
+
dialog: {
|
|
2017
|
+
discardTitle: string;
|
|
2018
|
+
discardDescription: string;
|
|
2019
|
+
discardAction: string;
|
|
2020
|
+
discardCancel: string;
|
|
2021
|
+
};
|
|
2022
|
+
embed: {
|
|
2023
|
+
video: EmbedMessages;
|
|
2024
|
+
map: EmbedMessages;
|
|
2025
|
+
generic: EmbedMessages;
|
|
2026
|
+
privacy: string;
|
|
2027
|
+
};
|
|
2028
|
+
list: {
|
|
2029
|
+
notIncluded: string;
|
|
2030
|
+
};
|
|
2031
|
+
listView: {
|
|
2032
|
+
unread: string;
|
|
2033
|
+
};
|
|
2034
|
+
navigation: {
|
|
2035
|
+
skipToContent: string;
|
|
2036
|
+
main: string;
|
|
2037
|
+
app: string;
|
|
2038
|
+
menu: string;
|
|
2039
|
+
collapse: string;
|
|
2040
|
+
expand: string;
|
|
2041
|
+
};
|
|
2042
|
+
pagination: {
|
|
2043
|
+
label: string;
|
|
2044
|
+
summary: (from: number, to: number, total: number) => string;
|
|
2045
|
+
pageSize: string;
|
|
2046
|
+
previous: string;
|
|
2047
|
+
next: string;
|
|
2048
|
+
page: (page: number) => string;
|
|
2049
|
+
pageOf: (page: number, total: number) => string;
|
|
2050
|
+
};
|
|
2051
|
+
quickSearch: {
|
|
2052
|
+
placeholder: string;
|
|
2053
|
+
suggestions: string;
|
|
2054
|
+
allResults: (query: string) => string;
|
|
2055
|
+
noResults: (query: string) => string;
|
|
2056
|
+
searchAll: (query: string) => string;
|
|
2057
|
+
navigate: string;
|
|
2058
|
+
open: string;
|
|
2059
|
+
};
|
|
2060
|
+
searchField: {
|
|
2061
|
+
clear: string;
|
|
2062
|
+
};
|
|
2063
|
+
select: {
|
|
2064
|
+
placeholder: string;
|
|
2065
|
+
clearSelection: string;
|
|
2066
|
+
};
|
|
2067
|
+
combobox: {
|
|
2068
|
+
placeholder: string;
|
|
2069
|
+
};
|
|
2070
|
+
slider: {
|
|
2071
|
+
minimum: (label: string) => string;
|
|
2072
|
+
maximum: (label: string) => string;
|
|
2073
|
+
};
|
|
2074
|
+
/** scrollRegion: name of a table that scrolls sideways and has no caption. */
|
|
2075
|
+
table: {
|
|
2076
|
+
columns: string;
|
|
2077
|
+
showColumns: string;
|
|
2078
|
+
scrollRegion: string;
|
|
2079
|
+
};
|
|
2080
|
+
textField: {
|
|
2081
|
+
counter: (count: number, limit: number) => string;
|
|
2082
|
+
tooMany: (over: number) => string;
|
|
2083
|
+
/** Announcement after a pause. */
|
|
2084
|
+
charactersLeft: (left: number) => string;
|
|
2085
|
+
charactersTooMany: (over: number) => string;
|
|
2086
|
+
};
|
|
2087
|
+
upload: {
|
|
2088
|
+
title: string;
|
|
2089
|
+
dropTitle: string;
|
|
2090
|
+
chooseFiles: string;
|
|
2091
|
+
chooseFile: string;
|
|
2092
|
+
listLabel: string;
|
|
2093
|
+
cancel: (name: string) => string;
|
|
2094
|
+
remove: (name: string) => string;
|
|
2095
|
+
retry: (name: string) => string;
|
|
2096
|
+
retryShort: string;
|
|
2097
|
+
uploading: (name: string) => string;
|
|
2098
|
+
progress: (loaded: string, total: string, percent: number) => string;
|
|
2099
|
+
typeNotAllowed: (names: string, types: string) => string;
|
|
2100
|
+
tooLarge: (size: string, max: string) => string;
|
|
2101
|
+
tooMany: (max: number) => string;
|
|
2102
|
+
uploaded: (name: string) => string;
|
|
2103
|
+
failed: (name: string, error: string) => string;
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
/** Texts of the Embed consent for one type. provider: the service (“Example Video”), to: who receives the data (“Example Inc.”). */
|
|
2107
|
+
interface EmbedMessages {
|
|
2108
|
+
title: string;
|
|
2109
|
+
body: (provider: string | undefined, to: string | undefined) => string;
|
|
2110
|
+
bodyCompact: (provider: string | undefined, company: string | undefined, to: string | undefined) => string;
|
|
2111
|
+
load: string;
|
|
2112
|
+
remember: (provider: string | undefined) => string;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
declare const de: Messages;
|
|
2116
|
+
|
|
2117
|
+
/** English (default and fallback). */
|
|
2118
|
+
declare const en: Messages;
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Own texts for all components below, e.g. another language or a different tone:
|
|
2122
|
+
* <MessagesProvider messages={{ ...enMessages, common: { ...enMessages.common, close: 'Fermer' } }}>
|
|
2123
|
+
* Wins over the built-in languages. Props of a single component still win over both.
|
|
2124
|
+
*/
|
|
2125
|
+
declare function MessagesProvider({ messages, children }: {
|
|
2126
|
+
messages: Messages;
|
|
2127
|
+
children: ReactNode;
|
|
2128
|
+
}): react.JSX.Element;
|
|
2129
|
+
/** The built-in texts for the current language. */
|
|
2130
|
+
declare function useMessages(): Messages;
|
|
1865
2131
|
|
|
1866
2132
|
interface DatePickerTexts extends CalendarTexts {
|
|
1867
2133
|
openCalendar: string;
|
|
1868
2134
|
done: string;
|
|
1869
2135
|
time: string;
|
|
1870
2136
|
presets: string;
|
|
1871
|
-
/** Validation – name the rule, never just
|
|
2137
|
+
/** Validation – name the rule, never just “invalid date”. */
|
|
1872
2138
|
beforeMin: (date: string) => string;
|
|
1873
2139
|
afterMax: (date: string) => string;
|
|
1874
2140
|
unavailable: string;
|
|
1875
2141
|
reversed: string;
|
|
1876
2142
|
}
|
|
2143
|
+
/** English defaults. The components use the texts of the current language (see i18n). */
|
|
1877
2144
|
declare const defaultDatePickerTexts: Omit<DatePickerTexts, keyof CalendarTexts>;
|
|
1878
2145
|
interface PickerBase {
|
|
1879
2146
|
label?: ReactNode;
|
|
@@ -1893,7 +2160,7 @@ interface DatePickerProps<T extends DateValue> extends Omit<DatePickerProps$1<T>
|
|
|
1893
2160
|
}
|
|
1894
2161
|
/**
|
|
1895
2162
|
* Date picker – type a date or pick it. The field is the main input, the calendar is a
|
|
1896
|
-
* helper: the button
|
|
2163
|
+
* helper: the button “Open calendar” (or Alt + ↓) opens it, picking a day closes it and focus returns to the
|
|
1897
2164
|
* field. `granularity="minute"` makes it a date + time picker with a time field in the panel.
|
|
1898
2165
|
*/
|
|
1899
2166
|
declare function DatePicker<T extends DateValue>({ label, description, errorMessage, size, overlay, showWeekNumbers, texts, className, ...props }: DatePickerProps<T>): react.JSX.Element;
|
|
@@ -1904,8 +2171,11 @@ interface DateRangePreset {
|
|
|
1904
2171
|
end: DateValue;
|
|
1905
2172
|
};
|
|
1906
2173
|
}
|
|
1907
|
-
/**
|
|
1908
|
-
|
|
2174
|
+
/**
|
|
2175
|
+
* The default presets (Today … Last month), relative to today in the local time zone.
|
|
2176
|
+
* Labels: own ones win, else those of `messages` (default English; the DateRangePicker passes the current language).
|
|
2177
|
+
*/
|
|
2178
|
+
declare function defaultDatePresets(labels?: Partial<Record<'today' | 'yesterday' | 'last7' | 'last14' | 'last30' | 'thisMonth' | 'lastMonth', string>>, messages?: Messages): DateRangePreset[];
|
|
1909
2179
|
interface DateRangePickerProps<T extends DateValue> extends Omit<DateRangePickerProps$1<T>, 'children' | 'className' | 'style'>, PickerBase {
|
|
1910
2180
|
/** true: the default presets (Today … Last month) · own list · none. Fits dashboards and filters. */
|
|
1911
2181
|
presets?: boolean | DateRangePreset[];
|
|
@@ -1968,7 +2238,7 @@ interface FigureProps {
|
|
|
1968
2238
|
children: ReactNode;
|
|
1969
2239
|
/** Describes what matters (adds to the image – never repeat the alt text). */
|
|
1970
2240
|
caption?: ReactNode;
|
|
1971
|
-
/** Names the source (
|
|
2241
|
+
/** Names the source (“© Photographer”). */
|
|
1972
2242
|
credit?: ReactNode;
|
|
1973
2243
|
className?: string;
|
|
1974
2244
|
}
|
|
@@ -1986,17 +2256,20 @@ interface EmbedTexts {
|
|
|
1986
2256
|
remember: string;
|
|
1987
2257
|
privacy: string;
|
|
1988
2258
|
}
|
|
1989
|
-
/**
|
|
1990
|
-
|
|
2259
|
+
/**
|
|
2260
|
+
* Texts per type. provider: the service (“Example Video”) · company: who runs it, when it differs (“Example Inc.”).
|
|
2261
|
+
* `messages`: the language (default English); the component passes the current one.
|
|
2262
|
+
*/
|
|
2263
|
+
declare function defaultEmbedTexts(type: EmbedType, provider?: string, company?: string, messages?: Messages): EmbedTexts;
|
|
1991
2264
|
interface EmbedConsentProps {
|
|
1992
2265
|
type?: EmbedType;
|
|
1993
|
-
/**
|
|
2266
|
+
/** Name of the service that provides the content (“Example Video”). */
|
|
1994
2267
|
provider?: string;
|
|
1995
|
-
/** Who receives the data, when it differs (
|
|
2268
|
+
/** Who receives the data, when it differs from the service (“Example Inc.”). */
|
|
1996
2269
|
company?: string;
|
|
1997
|
-
/** The embed URL – requested only after consent. Prefer privacy-friendly
|
|
2270
|
+
/** The embed URL – requested only after consent. Prefer the privacy-friendly embed URL of the service, if it offers one. */
|
|
1998
2271
|
src: string;
|
|
1999
|
-
/** Required: names the iframe (
|
|
2272
|
+
/** Required: names the iframe (“Video: Product tour”). */
|
|
2000
2273
|
title: string;
|
|
2001
2274
|
/** Ratio of the final embed. The placeholder may grow so text never clips. */
|
|
2002
2275
|
ratio?: Exclude<ImageRatio, 'original'>;
|
|
@@ -2004,9 +2277,9 @@ interface EmbedConsentProps {
|
|
|
2004
2277
|
privacyHref: string;
|
|
2005
2278
|
/** Stored consent from the consent manager – loads at once. */
|
|
2006
2279
|
isConsented?: boolean;
|
|
2007
|
-
/** The user clicked
|
|
2280
|
+
/** The user clicked “Load”; `remember` = “Always load …” checked – store it per provider in the consent manager. */
|
|
2008
2281
|
onConsent?: (remember: boolean) => void;
|
|
2009
|
-
/** iframe permissions, e.g.
|
|
2282
|
+
/** iframe permissions, e.g. “autoplay; encrypted-media; picture-in-picture; fullscreen”. */
|
|
2010
2283
|
allow?: string;
|
|
2011
2284
|
texts?: Partial<EmbedTexts>;
|
|
2012
2285
|
className?: string;
|
|
@@ -2018,4 +2291,4 @@ interface EmbedConsentProps {
|
|
|
2018
2291
|
*/
|
|
2019
2292
|
declare function EmbedConsent({ type, provider, company, src, title, ratio, privacyHref, isConsented, onConsent, allow, texts, className, }: EmbedConsentProps): react.JSX.Element;
|
|
2020
2293
|
|
|
2021
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertDialogTone, type AlertProps, type AlertTone, AppHeader, type AppHeaderProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, BadgeCount, type BadgeCountProps, BadgeDot, type BadgeDotProps, type BadgeProps, type BadgeTone, BottomSheet, type BottomSheetProps, BottomTabBar, type BottomTabBarProps, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BulkAction, BulkActionBar, type BulkActionBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, type CalendarTexts, Card, type CardProps, Cell, type CellProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceSize, Column, type ColumnOption, type ColumnProps, ColumnsMenu, type ColumnsMenuProps, Combobox, type ComboboxProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, type DatePickerTexts, DateRangePicker, type DateRangePickerProps, type DateRangePreset, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListProps, Dialog, type DialogAction, type DialogDiscardText, type DialogProps, Drawer, type DrawerProps, Dropzone, type DropzoneProps, EmbedConsent, type EmbedConsentProps, type EmbedTexts, type EmbedType, EmptyState, type EmptyStateAction, type EmptyStateProps, type EmptyStateSize, type EmptyStateType, FieldFooter, FieldLabel, Figure, type FigureProps, FileItem, type FileItemProps, FileTile, type FileTileProps, FileTrigger, type FileTriggerProps, Highlight, IconButton, type IconButtonProps, Image, type ImageProps, type ImageRatio, InputAction, type InputActionProps, type InputSize, Link, type LinkProps, List, ListBox, ListBoxMessage, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, type ListBoxSize, ListCard, type ListCardProps, ListItem, type ListItemProps, type ListProps, ListRow, ListRowIcon, type ListRowProps, type ListType, ListView, type ListViewProps, MediaPlayButton, type MediaPlayButtonProps, Menu, MenuButton, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerProps, type NavAction, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NavList, type NavListProps, NavSection, type NavSectionProps, type NavVariant, NumberField, type NumberFieldProps, Option, type OptionProps, Pagination, type PaginationProps, Popover, type PopoverProps, PopoverTrigger, ProgressBar, type ProgressBarProps, QuickSearch, type QuickSearchProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, Row, SearchField, type SearchFieldProps, SearchResult, type SearchResultProps, type SearchResultType, Select, type SelectOverlay, type SelectProps, SideNav, type SideNavProps, type SideNavUser, SiteHeader, type SiteHeaderProps, Skeleton, type SkeletonProps, SkipLink, type SkipLinkProps, Slider, SliderField, type SliderFieldProps, type SliderProps, Spinner, type SpinnerProps, StaticTable, type StaticTableProps, Submenu, type SubmenuProps, Switch, type SwitchProps, Tab, TabBarItem, type TabBarItemProps, TabBarMore, type TabBarMoreProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableHeader, type TableProps, Tabs, type TabsProps, Tag, TagGroup, type TagGroupProps, type TagProps, TextField, type TextFieldProps, TimeField, type TimeFieldProps, type TimeSlot, type ToastAction, type ToastOptions, ToastRegion, type ToastRegionProps, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Toggletip, type ToggletipProps, Toolbar, type ToolbarProps, ToolbarSeparator, Tooltip, type TooltipProps, TooltipTrigger, UploadField, type UploadFieldProps, type UploadFile, type UploadTexts, defaultCalendarTexts, defaultDatePickerTexts, defaultDatePresets, defaultEmbedTexts, defaultUploadTexts, formatBytes, initialsOf, toast };
|
|
2294
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertDialogTone, type AlertProps, type AlertTone, AppHeader, type AppHeaderProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, BadgeCount, type BadgeCountProps, BadgeDot, type BadgeDotProps, type BadgeProps, type BadgeTone, BottomSheet, type BottomSheetProps, BottomTabBar, type BottomTabBarProps, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BulkAction, BulkActionBar, type BulkActionBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, type CalendarTexts, Card, type CardProps, Cell, type CellProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceSize, Column, type ColumnOption, type ColumnProps, ColumnsMenu, type ColumnsMenuProps, Combobox, type ComboboxProps, Container, type ContainerProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, type DatePickerTexts, DateRangePicker, type DateRangePickerProps, type DateRangePreset, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListProps, Dialog, type DialogAction, type DialogDiscardText, type DialogProps, Drawer, type DrawerProps, Dropzone, type DropzoneProps, EmbedConsent, type EmbedConsentProps, type EmbedMessages, type EmbedTexts, type EmbedType, EmptyState, type EmptyStateAction, type EmptyStateProps, type EmptyStateSize, type EmptyStateType, FieldFooter, FieldLabel, Figure, type FigureProps, FileItem, type FileItemProps, FileTile, type FileTileProps, FileTrigger, type FileTriggerProps, Grid, GridItem, type GridItemProps, type GridProps, Highlight, IconButton, type IconButtonProps, Image, type ImageProps, type ImageRatio, InputAction, type InputActionProps, type InputSize, type LayoutElement, Link, type LinkProps, List, ListBox, ListBoxMessage, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, type ListBoxSize, ListCard, type ListCardProps, ListItem, type ListItemProps, type ListProps, ListRow, ListRowIcon, type ListRowProps, type ListType, ListView, type ListViewProps, MediaPlayButton, type MediaPlayButtonProps, Menu, MenuButton, MenuItem, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerProps, type Messages, MessagesProvider, type NavAction, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NavList, type NavListProps, NavSection, type NavSectionProps, type NavVariant, NumberField, type NumberFieldProps, Option, type OptionProps, Pagination, type PaginationProps, Popover, type PopoverProps, PopoverTrigger, ProgressBar, type ProgressBarProps, QuickSearch, type QuickSearchProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, Row, SearchField, type SearchFieldProps, SearchResult, type SearchResultProps, type SearchResultType, Select, type SelectOverlay, type SelectProps, SideNav, type SideNavProps, type SideNavUser, SiteHeader, type SiteHeaderProps, Skeleton, type SkeletonProps, SkipLink, type SkipLinkProps, Slider, SliderField, type SliderFieldProps, type SliderProps, type SpacingRule, Spinner, type SpinnerProps, Stack, type StackProps, StaticTable, type StaticTableProps, Submenu, type SubmenuProps, Switch, type SwitchProps, Tab, TabBarItem, type TabBarItemProps, TabBarMore, type TabBarMoreProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, TableHeader, type TableProps, Tabs, type TabsProps, Tag, TagGroup, type TagGroupProps, type TagProps, TextField, type TextFieldProps, TimeField, type TimeFieldProps, type TimeSlot, type ToastAction, type ToastOptions, ToastRegion, type ToastRegionProps, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Toggletip, type ToggletipProps, Toolbar, type ToolbarProps, ToolbarSeparator, Tooltip, type TooltipProps, TooltipTrigger, UploadField, type UploadFieldProps, type UploadFile, type UploadTexts, de as deMessages, defaultCalendarTexts, defaultDatePickerTexts, defaultDatePresets, defaultEmbedTexts, defaultUploadTexts, en as enMessages, formatBytes, initialsOf, toast, useMessages };
|