@mortenbrudvik/waveui 0.12.0 → 0.14.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/README.md +362 -60
- package/dist/components/data-display/Avatar.cjs +1 -1
- package/dist/components/data-display/Avatar.cjs.map +1 -1
- package/dist/components/data-display/Avatar.colors.cjs +2 -0
- package/dist/components/data-display/Avatar.colors.cjs.map +1 -0
- package/dist/components/data-display/Avatar.colors.mjs +45 -0
- package/dist/components/data-display/Avatar.colors.mjs.map +1 -0
- package/dist/components/data-display/Avatar.context.cjs +1 -1
- package/dist/components/data-display/Avatar.context.cjs.map +1 -1
- package/dist/components/data-display/Avatar.context.mjs +4 -2
- package/dist/components/data-display/Avatar.context.mjs.map +1 -1
- package/dist/components/data-display/Avatar.mjs +103 -96
- package/dist/components/data-display/Avatar.mjs.map +1 -1
- package/dist/components/data-display/Avatar.sizes.cjs +2 -0
- package/dist/components/data-display/Avatar.sizes.cjs.map +1 -0
- package/dist/components/data-display/Avatar.sizes.mjs +41 -0
- package/dist/components/data-display/Avatar.sizes.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.cjs +1 -1
- package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
- package/dist/components/data-display/AvatarGroup.context.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.context.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.context.mjs +9 -0
- package/dist/components/data-display/AvatarGroup.context.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.mjs +65 -122
- package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
- package/dist/components/data-display/AvatarGroup.partition.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.partition.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.partition.mjs +14 -0
- package/dist/components/data-display/AvatarGroup.partition.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.parts.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.parts.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.parts.mjs +178 -0
- package/dist/components/data-display/AvatarGroup.parts.mjs.map +1 -0
- package/dist/components/data-display/InteractionTag.cjs +1 -1
- package/dist/components/data-display/InteractionTag.cjs.map +1 -1
- package/dist/components/data-display/InteractionTag.mjs +36 -33
- package/dist/components/data-display/InteractionTag.mjs.map +1 -1
- package/dist/components/data-display/List.cjs +1 -1
- package/dist/components/data-display/List.cjs.map +1 -1
- package/dist/components/data-display/List.mjs +245 -195
- package/dist/components/data-display/List.mjs.map +1 -1
- package/dist/components/data-display/List.registry.cjs.map +1 -1
- package/dist/components/data-display/List.registry.mjs.map +1 -1
- package/dist/components/data-display/Persona.cjs +1 -1
- package/dist/components/data-display/Persona.cjs.map +1 -1
- package/dist/components/data-display/Persona.mjs +96 -37
- package/dist/components/data-display/Persona.mjs.map +1 -1
- package/dist/components/data-display/PresenceBadge.cjs +1 -1
- package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
- package/dist/components/data-display/PresenceBadge.mjs +42 -28
- package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
- package/dist/components/data-display/Tag.cjs +1 -1
- package/dist/components/data-display/Tag.cjs.map +1 -1
- package/dist/components/data-display/Tag.mjs +111 -108
- package/dist/components/data-display/Tag.mjs.map +1 -1
- package/dist/components/layout/Card.cjs +1 -1
- package/dist/components/layout/Card.cjs.map +1 -1
- package/dist/components/layout/Card.context.cjs +2 -0
- package/dist/components/layout/Card.context.cjs.map +1 -0
- package/dist/components/layout/Card.context.mjs +14 -0
- package/dist/components/layout/Card.context.mjs.map +1 -0
- package/dist/components/layout/Card.mjs +138 -92
- package/dist/components/layout/Card.mjs.map +1 -1
- package/dist/components/layout/Card.preview.cjs +2 -0
- package/dist/components/layout/Card.preview.cjs.map +1 -0
- package/dist/components/layout/Card.preview.mjs +22 -0
- package/dist/components/layout/Card.preview.mjs.map +1 -0
- package/dist/components/layout/Carousel.button.cjs +2 -0
- package/dist/components/layout/Carousel.button.cjs.map +1 -0
- package/dist/components/layout/Carousel.button.mjs +34 -0
- package/dist/components/layout/Carousel.button.mjs.map +1 -0
- package/dist/components/layout/Carousel.cjs +1 -1
- package/dist/components/layout/Carousel.cjs.map +1 -1
- package/dist/components/layout/Carousel.context.cjs +2 -0
- package/dist/components/layout/Carousel.context.cjs.map +1 -0
- package/dist/components/layout/Carousel.context.mjs +24 -0
- package/dist/components/layout/Carousel.context.mjs.map +1 -0
- package/dist/components/layout/Carousel.drag.cjs +2 -0
- package/dist/components/layout/Carousel.drag.cjs.map +1 -0
- package/dist/components/layout/Carousel.drag.mjs +79 -0
- package/dist/components/layout/Carousel.drag.mjs.map +1 -0
- package/dist/components/layout/Carousel.groups.cjs +2 -0
- package/dist/components/layout/Carousel.groups.cjs.map +1 -0
- package/dist/components/layout/Carousel.groups.mjs +23 -0
- package/dist/components/layout/Carousel.groups.mjs.map +1 -0
- package/dist/components/layout/Carousel.mjs +288 -150
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/Carousel.styles.cjs +2 -0
- package/dist/components/layout/Carousel.styles.cjs.map +1 -0
- package/dist/components/layout/Carousel.styles.mjs +30 -0
- package/dist/components/layout/Carousel.styles.mjs.map +1 -0
- package/dist/components/layout/Overflow.cjs +1 -1
- package/dist/components/layout/Overflow.cjs.map +1 -1
- package/dist/components/layout/Overflow.mjs +240 -192
- package/dist/components/layout/Overflow.mjs.map +1 -1
- package/dist/components/layout/Overflow.store.cjs +2 -0
- package/dist/components/layout/Overflow.store.cjs.map +1 -0
- package/dist/components/layout/Overflow.store.mjs +209 -0
- package/dist/components/layout/Overflow.store.mjs.map +1 -0
- package/dist/components/layout/TabList.cjs +1 -1
- package/dist/components/layout/TabList.cjs.map +1 -1
- package/dist/components/layout/TabList.mjs +163 -124
- package/dist/components/layout/TabList.mjs.map +1 -1
- package/dist/components/navigation/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
- package/dist/components/navigation/Breadcrumb.mjs +239 -84
- package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.cjs +1 -1
- package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.mjs +19 -15
- package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.context.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.context.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.context.mjs +51 -0
- package/dist/components/overlays/TeachingPopover.context.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.mjs +15 -185
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.parts.mjs +398 -0
- package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.root.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.root.mjs +150 -0
- package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.stack.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.stack.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.stack.mjs +86 -0
- package/dist/components/overlays/TeachingPopover.stack.mjs.map +1 -0
- package/dist/components/table/DataGrid.cjs +1 -1
- package/dist/components/table/DataGrid.cjs.map +1 -1
- package/dist/components/table/DataGrid.mjs +540 -311
- package/dist/components/table/DataGrid.mjs.map +1 -1
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.mjs +183 -60
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/Table.shared.cjs +2 -0
- package/dist/components/table/Table.shared.cjs.map +1 -0
- package/dist/components/table/Table.shared.mjs +65 -0
- package/dist/components/table/Table.shared.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2299 -213
- package/dist/index.d.ts +2299 -213
- package/dist/index.mjs +135 -127
- package/dist/lib/breadcrumb.cjs +2 -0
- package/dist/lib/breadcrumb.cjs.map +1 -0
- package/dist/lib/breadcrumb.mjs +26 -0
- package/dist/lib/breadcrumb.mjs.map +1 -0
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +143 -95
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/events.cjs +1 -1
- package/dist/lib/events.cjs.map +1 -1
- package/dist/lib/events.mjs +35 -8
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/icons.cjs +1 -1
- package/dist/lib/icons.cjs.map +1 -1
- package/dist/lib/icons.mjs +34 -20
- package/dist/lib/icons.mjs.map +1 -1
- package/dist/lib/initials.cjs +2 -0
- package/dist/lib/initials.cjs.map +1 -0
- package/dist/lib/initials.mjs +21 -0
- package/dist/lib/initials.mjs.map +1 -0
- package/dist/lib/table.cjs +2 -0
- package/dist/lib/table.cjs.map +1 -0
- package/dist/lib/table.mjs +16 -0
- package/dist/lib/table.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/tokens.css +102 -0
package/dist/index.d.cts
CHANGED
|
@@ -306,7 +306,7 @@ export declare type Appearance = 'primary' | 'outline' | 'subtle' | 'transparent
|
|
|
306
306
|
* <Avatar name="Jane Doe" src="/jane.jpg" badge={<PresenceBadge status="available" />} />
|
|
307
307
|
*/
|
|
308
308
|
export declare const Avatar: {
|
|
309
|
-
({ src, name, size: sizeProp, icon, image, badge, decorative, className, ref, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-description": ariaDescription, "aria-details": ariaDetails, ...rest }: AvatarProps): React_2.JSX.Element;
|
|
309
|
+
({ src, name, size: sizeProp, shape: shapeProp, color: colorProp, idForColor, active, activeAppearance, initials: initialsSlot, icon, image, badge, decorative, className, ref, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-description": ariaDescription, "aria-details": ariaDetails, ...rest }: AvatarProps): React_2.JSX.Element;
|
|
310
310
|
displayName: string;
|
|
311
311
|
};
|
|
312
312
|
|
|
@@ -325,30 +325,48 @@ export declare const avatarClassNames: {
|
|
|
325
325
|
readonly badge: "wave-avatar__badge";
|
|
326
326
|
};
|
|
327
327
|
|
|
328
|
+
/** The color of an Avatar that shows initials: a look, `colorful` (hashed), or a named color. */
|
|
329
|
+
export declare type AvatarColor = 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
330
|
+
|
|
328
331
|
/**
|
|
329
|
-
* A row of
|
|
332
|
+
* A row of avatars (`role="group"`; name it with `aria-label`), laid out as a `stack` (overlapping),
|
|
333
|
+
* `spread` or `pie` (`layout`). `size` reaches the members.
|
|
330
334
|
*
|
|
331
335
|
* With `max`, the avatars beyond the limit are replaced by an overflow `<button>` ("+3", named
|
|
332
|
-
* "3 more", see `overflowLabel`
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
336
|
+
* "3 more", see `overflowLabel`; `overflowIndicator="icon"` shows an icon, and a count above 99
|
|
337
|
+
* reads "99+"). It toggles a popup that lists the hidden members: an `AvatarGroup.Item` as a row
|
|
338
|
+
* with its avatar and name, an `Avatar` by its `aria-label` or `name` prop, text as it is. Other
|
|
339
|
+
* members, such as an `Avatar` inside a link or one labelled by `aria-labelledby`, are rendered as
|
|
340
|
+
* they are, and an `Avatar` or text with no accessible name is listed as `unnamedMemberLabel` with
|
|
341
|
+
* a development warning. Focus moves into the popup; Escape, a press outside or the button close
|
|
342
|
+
* it and focus returns to the button (`open`, `defaultOpen` and `onOpenChange(open, details)`
|
|
343
|
+
* control it). Tab and Shift+Tab move through the popup's own tab stops (links in rendered
|
|
338
344
|
* members); Tab from the last one closes the popup and moves on to the element after the button,
|
|
339
345
|
* Shift+Tab from the first one closes it and returns to the button. When the button is the last
|
|
340
346
|
* tab stop (of the page, or of the Wave layer the group is in, such as a dialog), Tab is left to
|
|
341
347
|
* the browser or the enclosing focus trap.
|
|
342
348
|
*
|
|
349
|
+
* To split the members yourself, render `AvatarGroup.Item`s and an `AvatarGroup.Popover` holding
|
|
350
|
+
* the overflow items (see `partitionAvatarGroupItems`).
|
|
351
|
+
*
|
|
343
352
|
* @example
|
|
344
353
|
* <AvatarGroup aria-label="Project team" max={3}>
|
|
345
|
-
* <
|
|
346
|
-
* <
|
|
354
|
+
* <AvatarGroup.Item name="Ada Lovelace" />
|
|
355
|
+
* <AvatarGroup.Item name="Alan Turing" />
|
|
347
356
|
* </AvatarGroup>
|
|
348
357
|
*/
|
|
349
358
|
export declare const AvatarGroup: {
|
|
350
|
-
({ max, size, overflowLabel, unnamedMemberLabel, className, children, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: AvatarGroupProps): React_2.JSX.Element;
|
|
359
|
+
({ max, size, layout, overflowIndicator, overflowLabel, unnamedMemberLabel, open, defaultOpen, onOpenChange, className, children, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: AvatarGroupProps): React_2.JSX.Element;
|
|
351
360
|
displayName: string;
|
|
361
|
+
} & {
|
|
362
|
+
Item: {
|
|
363
|
+
({ className, ...props }: AvatarGroupItemProps): React_2.JSX.Element;
|
|
364
|
+
displayName: string;
|
|
365
|
+
};
|
|
366
|
+
Popover: {
|
|
367
|
+
({ children, indicator, count, label: labelProp, unnamedMemberLabel, open: openProp, defaultOpen, onOpenChange, className, ref, }: AvatarGroupPopoverProps): React_2.JSX.Element;
|
|
368
|
+
displayName: string;
|
|
369
|
+
};
|
|
352
370
|
};
|
|
353
371
|
|
|
354
372
|
/**
|
|
@@ -360,24 +378,120 @@ export declare const avatarGroupClassNames: {
|
|
|
360
378
|
readonly root: "wave-avatar-group";
|
|
361
379
|
readonly item: "wave-avatar-group__item";
|
|
362
380
|
readonly overflowButton: "wave-avatar-group__overflow-button";
|
|
381
|
+
readonly pie: "wave-avatar-group__pie";
|
|
363
382
|
readonly surface: "wave-avatar-group__surface";
|
|
364
383
|
readonly list: "wave-avatar-group__list";
|
|
365
384
|
readonly listItem: "wave-avatar-group__list-item";
|
|
366
385
|
};
|
|
367
386
|
|
|
387
|
+
/**
|
|
388
|
+
* A member of an AvatarGroup. In the group it renders as an `Avatar`; in the overflow list of the
|
|
389
|
+
* popup it renders as a row with the avatar and the name. It takes the props of an `Avatar`.
|
|
390
|
+
*/
|
|
391
|
+
export declare const AvatarGroupItem: {
|
|
392
|
+
({ className, ...props }: AvatarGroupItemProps): React_2.JSX.Element;
|
|
393
|
+
displayName: string;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* AvatarGroup.Item: `root` on the avatar it renders in the group, and on the row (avatar and name)
|
|
398
|
+
* it renders in the overflow list; `name` on the name text of that row.
|
|
399
|
+
*/
|
|
400
|
+
export declare const avatarGroupItemClassNames: {
|
|
401
|
+
readonly root: "wave-avatar-group-item";
|
|
402
|
+
readonly name: "wave-avatar-group-item__name";
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/** Properties for the AvatarGroup.Item sub-component: the props of an Avatar. */
|
|
406
|
+
export declare type AvatarGroupItemProps = AvatarProps;
|
|
407
|
+
|
|
408
|
+
/** The layouts of an AvatarGroup. */
|
|
409
|
+
export declare type AvatarGroupLayout = 'stack' | 'spread' | 'pie';
|
|
410
|
+
|
|
411
|
+
/** Why the popup of an AvatarGroup opens or closes: its trigger, or a dismissal. */
|
|
412
|
+
export declare type AvatarGroupOpenChangeDetails = OpenChangeDetails<DismissReason | 'trigger'>;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The overflow of an AvatarGroup, written by hand: a "+N" button that opens a popup listing its
|
|
416
|
+
* children (`AvatarGroup.Item`s, `Avatar`s, text or other elements). Write it as a child of the
|
|
417
|
+
* group to replace the overflow that `max` makes; its `count`, `indicator`, `label`, `open` and
|
|
418
|
+
* `onOpenChange` take over what `max` would have derived. Tab leaves the popup from the button.
|
|
419
|
+
*/
|
|
420
|
+
export declare const AvatarGroupPopover: {
|
|
421
|
+
({ children, indicator, count, label: labelProp, unnamedMemberLabel, open: openProp, defaultOpen, onOpenChange, className, ref, }: AvatarGroupPopoverProps): React_2.JSX.Element;
|
|
422
|
+
displayName: string;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/** AvatarGroup.Popover: `root` on the overflow button (which also carries the group's button class). */
|
|
426
|
+
export declare const avatarGroupPopoverClassNames: {
|
|
427
|
+
readonly root: "wave-avatar-group-popover";
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/** Properties for the AvatarGroup.Popover sub-component. */
|
|
431
|
+
export declare interface AvatarGroupPopoverProps {
|
|
432
|
+
/** The overflow members: `AvatarGroup.Item`s, `Avatar`s, text or other elements. */
|
|
433
|
+
children?: React_2.ReactNode;
|
|
434
|
+
/**
|
|
435
|
+
* What the overflow button shows: the number of hidden members (`+3`, capped at `99+`), or an
|
|
436
|
+
* icon.
|
|
437
|
+
* @default 'count'
|
|
438
|
+
*/
|
|
439
|
+
indicator?: 'count' | 'icon';
|
|
440
|
+
/** The number of hidden members. @default the number of `children` */
|
|
441
|
+
count?: number;
|
|
442
|
+
/**
|
|
443
|
+
* Accessible name of the overflow button and its popup. A function receives the number of hidden
|
|
444
|
+
* members.
|
|
445
|
+
* @default (count) => `${count} more`
|
|
446
|
+
*/
|
|
447
|
+
label?: string | ((count: number) => string);
|
|
448
|
+
/**
|
|
449
|
+
* Text listed in the overflow popup for a hidden member that has no accessible name.
|
|
450
|
+
* @default 'Unnamed member'
|
|
451
|
+
*/
|
|
452
|
+
unnamedMemberLabel?: string;
|
|
453
|
+
/** Whether the popup is open (controlled). */
|
|
454
|
+
open?: boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Whether the popup starts open (uncontrolled).
|
|
457
|
+
* @default false
|
|
458
|
+
*/
|
|
459
|
+
defaultOpen?: boolean;
|
|
460
|
+
/** Called when the popup asks to open or close, with the reason (`trigger`, `escape`, …). */
|
|
461
|
+
onOpenChange?: (open: boolean, details?: AvatarGroupOpenChangeDetails) => void;
|
|
462
|
+
/** Extra classes for the overflow button. */
|
|
463
|
+
className?: string;
|
|
464
|
+
/** Ref to the overflow `<button>`. */
|
|
465
|
+
ref?: React_2.Ref<HTMLButtonElement>;
|
|
466
|
+
}
|
|
467
|
+
|
|
368
468
|
/** Properties for the AvatarGroup component. */
|
|
369
469
|
export declare interface AvatarGroupProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
370
470
|
/**
|
|
371
471
|
* Maximum number of avatars to display. The others are replaced by an overflow button that
|
|
372
472
|
* lists their names. `0` or a negative value shows only the overflow button, a fraction is
|
|
373
473
|
* rounded down, and `NaN` shows every member (as without `max`). The members of a Fragment
|
|
374
|
-
* count one by one.
|
|
474
|
+
* count one by one. A `pie` shows at most three.
|
|
375
475
|
*/
|
|
376
476
|
max?: number;
|
|
377
|
-
/**
|
|
378
|
-
*
|
|
477
|
+
/**
|
|
478
|
+
* Size of the avatars. It reaches the members that set no `size` of their own, and the overflow
|
|
479
|
+
* button.
|
|
480
|
+
* @default 'medium' ('large' in a `pie`)
|
|
379
481
|
*/
|
|
380
|
-
size?:
|
|
482
|
+
size?: AvatarSize;
|
|
483
|
+
/**
|
|
484
|
+
* How the members are laid out: `stack` overlaps them, `spread` puts them side by side, `pie`
|
|
485
|
+
* draws up to three of them as the wedges of one circle (the group's name is then the only name).
|
|
486
|
+
* @default 'stack'
|
|
487
|
+
*/
|
|
488
|
+
layout?: AvatarGroupLayout;
|
|
489
|
+
/**
|
|
490
|
+
* What the overflow button shows: the number of hidden members (`+3`, capped at `99+`), or an
|
|
491
|
+
* icon.
|
|
492
|
+
* @default 'count'
|
|
493
|
+
*/
|
|
494
|
+
overflowIndicator?: 'count' | 'icon';
|
|
381
495
|
/**
|
|
382
496
|
* Accessible name of the overflow button (and its popup). A function receives the number of
|
|
383
497
|
* hidden members. Localise it here.
|
|
@@ -391,10 +505,31 @@ export declare interface AvatarGroupProps extends React_2.HTMLAttributes<HTMLDiv
|
|
|
391
505
|
* @default 'Unnamed member'
|
|
392
506
|
*/
|
|
393
507
|
unnamedMemberLabel?: string;
|
|
508
|
+
/** Whether the overflow popup is open (controlled). */
|
|
509
|
+
open?: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Whether the overflow popup starts open (uncontrolled).
|
|
512
|
+
* @default false
|
|
513
|
+
*/
|
|
514
|
+
defaultOpen?: boolean;
|
|
515
|
+
/**
|
|
516
|
+
* Called when the overflow popup asks to open or close, with the reason: `trigger` (the button),
|
|
517
|
+
* `escape`, `outside-press` or `focus-outside`.
|
|
518
|
+
*/
|
|
519
|
+
onOpenChange?: (open: boolean, details?: AvatarGroupOpenChangeDetails) => void;
|
|
394
520
|
/** Ref to the root `<div>`. */
|
|
395
521
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
396
522
|
}
|
|
397
523
|
|
|
524
|
+
/** The named colors of an Avatar: the persona palette (`--wave-palette-<name>` tokens). */
|
|
525
|
+
export declare type AvatarNamedColor = 'red' | 'pumpkin' | 'gold' | 'forest' | 'teal' | 'blue' | 'navy' | 'lavender' | 'purple' | 'magenta' | 'brown' | 'steel';
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The numeric sizes of an Avatar, in pixels (Fluent's 14 sizes). A literal union: Tailwind can only
|
|
529
|
+
* generate the classes of {@link avatarBoxClasses}.
|
|
530
|
+
*/
|
|
531
|
+
export declare type AvatarNumericSize = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
532
|
+
|
|
398
533
|
/** Properties for the Avatar component. */
|
|
399
534
|
export declare interface AvatarProps extends React_2.HTMLAttributes<HTMLSpanElement> {
|
|
400
535
|
/**
|
|
@@ -409,11 +544,49 @@ export declare interface AvatarProps extends React_2.HTMLAttributes<HTMLSpanElem
|
|
|
409
544
|
*/
|
|
410
545
|
name?: string;
|
|
411
546
|
/**
|
|
412
|
-
* Size of the avatar
|
|
413
|
-
* the
|
|
547
|
+
* Size of the avatar: a named size (`extra-small` 24px to `extra-large` 56px) or a pixel size from
|
|
548
|
+
* 16 to 128. Without it, an Avatar in the `media` of a tag (Tag, InteractionTag) takes the tag's
|
|
549
|
+
* media box instead: 24, 20 or 16px by the tag's size.
|
|
414
550
|
* @default 'medium'
|
|
415
551
|
*/
|
|
416
|
-
size?:
|
|
552
|
+
size?: AvatarSize;
|
|
553
|
+
/**
|
|
554
|
+
* Shape of the avatar. Without it, an Avatar in the `media` of a rounded tag is square.
|
|
555
|
+
* @default 'circular'
|
|
556
|
+
*/
|
|
557
|
+
shape?: 'circular' | 'square';
|
|
558
|
+
/**
|
|
559
|
+
* Color of the avatar when it shows initials: `brand` (the primary color), `neutral` (muted),
|
|
560
|
+
* `colorful` (one of the named colors, chosen from `idForColor`, else from `name`; `brand`
|
|
561
|
+
* without either) or a named color of the persona palette. An image, or an icon, keeps its own
|
|
562
|
+
* look.
|
|
563
|
+
* @default 'brand'
|
|
564
|
+
*/
|
|
565
|
+
color?: AvatarColor;
|
|
566
|
+
/**
|
|
567
|
+
* Whether the person is active: `active` draws the `activeAppearance` around the avatar, `inactive`
|
|
568
|
+
* dims it, `unset` shows neither.
|
|
569
|
+
* @default 'unset'
|
|
570
|
+
*/
|
|
571
|
+
active?: 'active' | 'inactive' | 'unset';
|
|
572
|
+
/**
|
|
573
|
+
* How an `active` avatar is marked: a `ring`, a `shadow`, both (`ring-shadow`) or a `glow` in the
|
|
574
|
+
* primary color.
|
|
575
|
+
* @default 'ring'
|
|
576
|
+
*/
|
|
577
|
+
activeAppearance?: 'ring' | 'ring-shadow' | 'shadow' | 'glow';
|
|
578
|
+
/**
|
|
579
|
+
* A stable id (a user id, say) that picks the color of `color="colorful"`, so the same person has
|
|
580
|
+
* the same color wherever they are shown, whatever their name looks like.
|
|
581
|
+
*/
|
|
582
|
+
idForColor?: string;
|
|
583
|
+
/**
|
|
584
|
+
* The initials shown when there is no image and no icon, instead of the ones computed from
|
|
585
|
+
* `name` (see `getInitials`): a string, an element or an object of `<span>` attributes. A value
|
|
586
|
+
* that renders nothing (`''`, `[]`) keeps the computed initials. Rendered in an `aria-hidden`
|
|
587
|
+
* `<span>`.
|
|
588
|
+
*/
|
|
589
|
+
initials?: Slot<'span'>;
|
|
417
590
|
/**
|
|
418
591
|
* Icon shown instead of the initials when there is no image. Rendered in an `aria-hidden`
|
|
419
592
|
* `<span>` (a slot object can override its attributes). A falsy value (`null`, `false`, `''`,
|
|
@@ -455,6 +628,9 @@ export declare interface AvatarProps extends React_2.HTMLAttributes<HTMLSpanElem
|
|
|
455
628
|
ref?: React_2.Ref<HTMLSpanElement>;
|
|
456
629
|
}
|
|
457
630
|
|
|
631
|
+
/** The size of an Avatar: a named size (24 to 56px) or one of the {@link AvatarNumericSize}s. */
|
|
632
|
+
export declare type AvatarSize = Size | AvatarNumericSize;
|
|
633
|
+
|
|
458
634
|
/** How a modal surface's backdrop paints the page: `dimmed`, or `transparent` (a modal over another). */
|
|
459
635
|
export declare type BackdropAppearance = 'dimmed' | 'transparent';
|
|
460
636
|
|
|
@@ -515,7 +691,12 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLSpanEleme
|
|
|
515
691
|
* A breadcrumb trail: a `<nav aria-label="Breadcrumb">` landmark with an ordered list. Each child
|
|
516
692
|
* is placed in its own list item (Fragments are opened, so each of their items gets one too); from
|
|
517
693
|
* the second one on, the item begins with a decorative separator chevron that is mirrored in
|
|
518
|
-
* right-to-left layouts.
|
|
694
|
+
* right-to-left layouts (`divider` replaces or hides it).
|
|
695
|
+
*
|
|
696
|
+
* `maxDisplayedItems` collapses the middle of a long trail into a "…" menu button, and
|
|
697
|
+
* `overflow="auto"` collapses it to the room it has instead (a "…" menu button stands in for the
|
|
698
|
+
* hidden middle items); `size` sets the text step and `focusMode="arrow"` makes the trail one Tab
|
|
699
|
+
* stop with arrow-key navigation.
|
|
519
700
|
*
|
|
520
701
|
* `Breadcrumb.Item` is also exported as `BreadcrumbItem`: React Server Components import the flat
|
|
521
702
|
* name, because dotted access needs a client file.
|
|
@@ -527,21 +708,26 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLSpanEleme
|
|
|
527
708
|
* </Breadcrumb>
|
|
528
709
|
*/
|
|
529
710
|
export declare const Breadcrumb: {
|
|
530
|
-
({ children, className, ref, ...rest }: BreadcrumbProps): React_2.JSX.Element;
|
|
711
|
+
({ children, maxDisplayedItems, overflowIndex, overflow, overflowLabel, size, focusMode, divider, className, onKeyDown, onFocus, ref, ...rest }: BreadcrumbProps): React_2.JSX.Element;
|
|
531
712
|
displayName: string;
|
|
532
713
|
} & {
|
|
533
714
|
Item: typeof BreadcrumbItem;
|
|
534
715
|
};
|
|
535
716
|
|
|
536
717
|
/**
|
|
537
|
-
* Breadcrumb: `root` on the `<nav>`; `list` on
|
|
538
|
-
* on each
|
|
718
|
+
* Breadcrumb: `root` on the `<nav>`; `list` on the trail's list element (its `<ol>`, or with
|
|
719
|
+
* `overflow="auto"` the Overflow's `role="list"` element); `listItem` on each `<li>`; `divider` on
|
|
720
|
+
* each separator (the default chevron `<svg>`, or the `<span>` of a custom `divider`);
|
|
721
|
+
* `overflowButton` on the "…" `<button>` that opens the menu of the collapsed items, with
|
|
722
|
+
* `maxDisplayedItems` and with `overflow="auto"`. With `overflow="auto"` the "…" list item is the
|
|
723
|
+
* Overflow's button wrapper, not an `<li>`, so it carries no `listItem` class.
|
|
539
724
|
*/
|
|
540
725
|
export declare const breadcrumbClassNames: {
|
|
541
726
|
readonly root: "wave-breadcrumb";
|
|
542
727
|
readonly list: "wave-breadcrumb__list";
|
|
543
728
|
readonly listItem: "wave-breadcrumb__list-item";
|
|
544
729
|
readonly divider: "wave-breadcrumb__divider";
|
|
730
|
+
readonly overflowButton: "wave-breadcrumb__overflow-button";
|
|
545
731
|
};
|
|
546
732
|
|
|
547
733
|
/**
|
|
@@ -676,6 +862,58 @@ export declare interface BreadcrumbProps extends React_2.HTMLAttributes<HTMLElem
|
|
|
676
862
|
* the items of a conditional group (`{isAdmin && <>…</>}`) each get their own list item too.
|
|
677
863
|
*/
|
|
678
864
|
children: React_2.ReactNode;
|
|
865
|
+
/**
|
|
866
|
+
* The most items the trail shows, the overflow button not counted. A longer trail collapses its
|
|
867
|
+
* middle items, from `overflowIndex`, into a "…" button that opens a menu of them (a link item
|
|
868
|
+
* becomes a `Menu.ItemLink`, an `asChild` element of a component (a router link) a
|
|
869
|
+
* `Menu.ItemLink` rendered by that component with the element's own props, its `as` included,
|
|
870
|
+
* a button item a `Menu.Item`). The first item and the last `current` item are never hidden.
|
|
871
|
+
* Without it the whole trail is shown.
|
|
872
|
+
* A value below 1 means 6, as in `partitionBreadcrumbItems`. Ignored with `overflow="auto"`.
|
|
873
|
+
*/
|
|
874
|
+
maxDisplayedItems?: number;
|
|
875
|
+
/**
|
|
876
|
+
* The index of the first collapsed item (with `maxDisplayedItems`). It is at least 1, so the
|
|
877
|
+
* first item stays, and at most `maxDisplayedItems - 1`. Ignored with `overflow="auto"`.
|
|
878
|
+
* @default 1
|
|
879
|
+
*/
|
|
880
|
+
overflowIndex?: number;
|
|
881
|
+
/**
|
|
882
|
+
* `'auto'` fits the trail to its room: the middle items that do not fit are hidden, from the
|
|
883
|
+
* start of the trail; the first item and the last `current` item never are. A "…" list item
|
|
884
|
+
* with its own separator then stands just before the first hidden item (so the trail reads
|
|
885
|
+
* "Home › … › Parent › Page"), and its button (`overflowLabel`) opens a menu of the hidden
|
|
886
|
+
* items, in trail order. When even the first and the current item do not fit, the button covers
|
|
887
|
+
* the end of the trail. The room decides alone: `maxDisplayedItems` and `overflowIndex` do not
|
|
888
|
+
* apply. The trail list is then an `Overflow` (a `role="list"` element with the `wave-overflow`
|
|
889
|
+
* class and 4px of padding) that measures with `ResizeObserver`. `'none'` shows the trail as
|
|
890
|
+
* the other props say.
|
|
891
|
+
* @default 'none'
|
|
892
|
+
*/
|
|
893
|
+
overflow?: 'none' | 'auto';
|
|
894
|
+
/**
|
|
895
|
+
* Accessible name of the overflow button (with `maxDisplayedItems` or `overflow="auto"`).
|
|
896
|
+
* @default "More items"
|
|
897
|
+
*/
|
|
898
|
+
overflowLabel?: string;
|
|
899
|
+
/**
|
|
900
|
+
* Text and divider size.
|
|
901
|
+
* @default 'medium'
|
|
902
|
+
*/
|
|
903
|
+
size?: CoreSize;
|
|
904
|
+
/**
|
|
905
|
+
* `'tab'`: every link is a Tab stop. `'arrow'`: the trail is one Tab stop (the last focused link
|
|
906
|
+
* or button, at first the first one) and the arrow keys (mirrored in right-to-left layouts),
|
|
907
|
+
* Home and End move between its links and the overflow button.
|
|
908
|
+
* @default 'tab'
|
|
909
|
+
*/
|
|
910
|
+
focusMode?: FocusMode;
|
|
911
|
+
/**
|
|
912
|
+
* The separator between items; a decorative `<span>`. `null` or `undefined` keep the chevron
|
|
913
|
+
* (mirrored in right-to-left layouts); `false`, or content that renders nothing, hides the
|
|
914
|
+
* separators. A custom divider is not mirrored.
|
|
915
|
+
*/
|
|
916
|
+
divider?: Slot<'span'>;
|
|
679
917
|
/** Ref to the `<nav>` element. */
|
|
680
918
|
ref?: React_2.Ref<HTMLElement>;
|
|
681
919
|
}
|
|
@@ -1071,7 +1309,8 @@ export declare interface CalendarValueChangeDetails {
|
|
|
1071
1309
|
}
|
|
1072
1310
|
|
|
1073
1311
|
/**
|
|
1074
|
-
* A surface that groups related content, with `Card.Header`, `Card.Body` and
|
|
1312
|
+
* A surface that groups related content, with `Card.Header`, `Card.Preview`, `Card.Body` and
|
|
1313
|
+
* `Card.Footer`.
|
|
1075
1314
|
*
|
|
1076
1315
|
* **Selectable cards** (`onSelect`) come in two patterns:
|
|
1077
1316
|
* - A card without interactive content is itself the control (`selectionControl="card"`, the
|
|
@@ -1088,7 +1327,7 @@ export declare interface CalendarValueChangeDetails {
|
|
|
1088
1327
|
* the selected look only; its state is not exposed to assistive technology.
|
|
1089
1328
|
*
|
|
1090
1329
|
* React Server Components cannot dot into a client module: import the flat names `CardHeader`,
|
|
1091
|
-
* `CardBody` and `CardFooter` there; `Card.Header` etc. work in client files.
|
|
1330
|
+
* `CardPreview`, `CardBody` and `CardFooter` there; `Card.Header` etc. work in client files.
|
|
1092
1331
|
*
|
|
1093
1332
|
* @example
|
|
1094
1333
|
* <Card onSelect={toggle} selected={selected}>
|
|
@@ -1102,10 +1341,14 @@ export declare interface CalendarValueChangeDetails {
|
|
|
1102
1341
|
*/
|
|
1103
1342
|
export declare const Card: PolymorphicComponent<"div", CardOwnProps> & {
|
|
1104
1343
|
Header: PolymorphicComponent<"div", CardHeaderOwnProps>;
|
|
1344
|
+
Preview: PolymorphicComponent<"div", CardPreviewOwnProps>;
|
|
1105
1345
|
Body: PolymorphicComponent<"div", CardBodyOwnProps>;
|
|
1106
1346
|
Footer: PolymorphicComponent<"div", CardFooterOwnProps>;
|
|
1107
1347
|
};
|
|
1108
1348
|
|
|
1349
|
+
/** The look of a Card: a filled surface with a shadow, a muted fill, an outline, or no surface. */
|
|
1350
|
+
export declare type CardAppearance = 'filled' | 'filled-alternative' | 'outline' | 'subtle';
|
|
1351
|
+
|
|
1109
1352
|
/**
|
|
1110
1353
|
* The main content of a {@link Card}. Flat export for React Server Components (`Card.Body` in
|
|
1111
1354
|
* client files).
|
|
@@ -1131,6 +1374,7 @@ export declare const cardClassNames: {
|
|
|
1131
1374
|
readonly root: "wave-card";
|
|
1132
1375
|
readonly checkbox: "wave-card__checkbox";
|
|
1133
1376
|
readonly checkmark: "wave-card__checkmark";
|
|
1377
|
+
readonly floatingAction: "wave-card__floating-action";
|
|
1134
1378
|
};
|
|
1135
1379
|
|
|
1136
1380
|
/**
|
|
@@ -1160,8 +1404,11 @@ export declare const CardHeader: PolymorphicComponent<'div', CardHeaderOwnProps>
|
|
|
1160
1404
|
/** Card.Header: `root` on the rendered element; `title` on the title; `subtitle` on the subtitle. */
|
|
1161
1405
|
export declare const cardHeaderClassNames: {
|
|
1162
1406
|
readonly root: "wave-card-header";
|
|
1407
|
+
readonly image: "wave-card-header__image";
|
|
1408
|
+
readonly text: "wave-card-header__text";
|
|
1163
1409
|
readonly title: "wave-card-header__title";
|
|
1164
1410
|
readonly subtitle: "wave-card-header__subtitle";
|
|
1411
|
+
readonly action: "wave-card-header__action";
|
|
1165
1412
|
};
|
|
1166
1413
|
|
|
1167
1414
|
/** The Card.Header's own props (component-specific props only). */
|
|
@@ -1174,6 +1421,16 @@ export declare interface CardHeaderOwnProps {
|
|
|
1174
1421
|
title?: React_2.ReactNode;
|
|
1175
1422
|
/** Subtitle content displayed below the title (none when it renders nothing, as `title`). */
|
|
1176
1423
|
subtitle?: React_2.ReactNode;
|
|
1424
|
+
/**
|
|
1425
|
+
* An image beside the text, at the start: an `Avatar`, an icon, a logo. A value that renders
|
|
1426
|
+
* nothing renders no element.
|
|
1427
|
+
*/
|
|
1428
|
+
image?: Slot<'span'>;
|
|
1429
|
+
/**
|
|
1430
|
+
* An action beside the text, at the end: a menu button, say. A value that renders nothing
|
|
1431
|
+
* renders no element.
|
|
1432
|
+
*/
|
|
1433
|
+
action?: Slot<'span'>;
|
|
1177
1434
|
}
|
|
1178
1435
|
|
|
1179
1436
|
/** Props of {@link CardHeader} rendered as `C` (default `'div'`), including `ref`. */
|
|
@@ -1184,6 +1441,25 @@ export declare type CardHeaderProps<C extends React_2.ElementType = 'div'> = Pol
|
|
|
1184
1441
|
* Every other prop comes from the rendered element (`as`).
|
|
1185
1442
|
*/
|
|
1186
1443
|
export declare interface CardOwnProps {
|
|
1444
|
+
/**
|
|
1445
|
+
* Look of the card: `filled` (a surface with a border and a shadow), `filled-alternative` (a
|
|
1446
|
+
* muted fill), `outline` (a border only) or `subtle` (no surface until hovered or selected). A
|
|
1447
|
+
* selectable card gets a hover and pressed look for its appearance; the selected look is the
|
|
1448
|
+
* same in every appearance.
|
|
1449
|
+
* @default 'filled'
|
|
1450
|
+
*/
|
|
1451
|
+
appearance?: CardAppearance;
|
|
1452
|
+
/**
|
|
1453
|
+
* Padding of the card's parts: `small` 0.75rem, `medium` 1rem, `large` 1.25rem.
|
|
1454
|
+
* @default 'medium'
|
|
1455
|
+
*/
|
|
1456
|
+
size?: CoreSize;
|
|
1457
|
+
/**
|
|
1458
|
+
* Layout of the card's parts: `vertical` stacks them, `horizontal` puts them in a row (put the
|
|
1459
|
+
* text parts in one wrapper element to keep them stacked beside a `Card.Preview`).
|
|
1460
|
+
* @default 'vertical'
|
|
1461
|
+
*/
|
|
1462
|
+
orientation?: Orientation;
|
|
1187
1463
|
/**
|
|
1188
1464
|
* Whether the card is selected. Shown with the selected colors plus non-color cues: a 2px primary
|
|
1189
1465
|
* border (a 1px border plus an inset 1px ring), a Highlight outline in forced-colors mode, and a
|
|
@@ -1225,8 +1501,54 @@ export declare interface CardOwnProps {
|
|
|
1225
1501
|
* `Card.Header` title, which the checkbox references with `aria-labelledby`.
|
|
1226
1502
|
*/
|
|
1227
1503
|
selectLabel?: string;
|
|
1504
|
+
/**
|
|
1505
|
+
* The built-in checkbox of `selectionControl="checkbox"`: an object of `<input>` attributes is
|
|
1506
|
+
* merged onto it (a class, `aria-describedby`, `name`; its type, checked state and change
|
|
1507
|
+
* handling stay the card's), an element replaces it (give that control its own name and call
|
|
1508
|
+
* `onSelect` from it), and `null` or `false` removes it, for a control you render elsewhere.
|
|
1509
|
+
* Ignored with the default `selectionControl`.
|
|
1510
|
+
*/
|
|
1511
|
+
checkbox?: Slot<'input'>;
|
|
1512
|
+
/**
|
|
1513
|
+
* An action over the top end corner of the card (a menu button, say). A card with one is
|
|
1514
|
+
* positioned; with `selectionControl="checkbox"` the built-in checkbox then moves to the top
|
|
1515
|
+
* start corner. Content that renders nothing renders no element.
|
|
1516
|
+
*/
|
|
1517
|
+
floatingAction?: Slot<'span'>;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Edge-to-edge media of a {@link Card} (an image, a video, a map), with an optional `logo` over its
|
|
1522
|
+
* bottom start corner. It has no padding: in a vertical card it fills the width, in a horizontal
|
|
1523
|
+
* one it is the full-height block at the start. Flat export for React Server Components
|
|
1524
|
+
* (`Card.Preview` in client files).
|
|
1525
|
+
*
|
|
1526
|
+
* @example
|
|
1527
|
+
* <Card>
|
|
1528
|
+
* <Card.Preview logo={<img alt="Contoso" src="/logo.svg" />}><img alt="" src="/cover.jpg" /></Card.Preview>
|
|
1529
|
+
* <Card.Header title="Contoso" />
|
|
1530
|
+
* </Card>
|
|
1531
|
+
*/
|
|
1532
|
+
export declare const CardPreview: PolymorphicComponent<'div', CardPreviewOwnProps>;
|
|
1533
|
+
|
|
1534
|
+
/** Card.Preview: `root` on the rendered element; `logo` on the logo over its bottom start corner. */
|
|
1535
|
+
export declare const cardPreviewClassNames: {
|
|
1536
|
+
readonly root: "wave-card-preview";
|
|
1537
|
+
readonly logo: "wave-card-preview__logo";
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
/** The Card.Preview's own props (component-specific props only). */
|
|
1541
|
+
export declare interface CardPreviewOwnProps {
|
|
1542
|
+
/**
|
|
1543
|
+
* A logo placed over the bottom start corner of the preview: a string, an element or an object
|
|
1544
|
+
* of `<span>` attributes. A value that renders nothing renders no element.
|
|
1545
|
+
*/
|
|
1546
|
+
logo?: Slot<'span'>;
|
|
1228
1547
|
}
|
|
1229
1548
|
|
|
1549
|
+
/** Props of {@link CardPreview} rendered as `C` (default `'div'`), including `ref`. */
|
|
1550
|
+
export declare type CardPreviewProps<C extends React_2.ElementType = 'div'> = PolymorphicProps<C, CardPreviewOwnProps>;
|
|
1551
|
+
|
|
1230
1552
|
/**
|
|
1231
1553
|
* Props of {@link Card} rendered as `C` (default `'div'`). `CardProps` without a type argument is
|
|
1232
1554
|
* the 0.4 name: the props of a Card rendered as a `<div>`, including `ref`.
|
|
@@ -1261,19 +1583,32 @@ export declare type CardProps<C extends React_2.ElementType = 'div'> = Polymorph
|
|
|
1261
1583
|
* - The controls are layered over the slides inside the carousel's own stacking context, so they
|
|
1262
1584
|
* never paint over page headers that stay in view while the page scrolls.
|
|
1263
1585
|
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1586
|
+
* - `groupSize` shows several slides per page, `draggable` lets the pointer drag them, and a
|
|
1587
|
+
* `thumbnail` on a `Carousel.Item` turns the picker into a row of thumbnails.
|
|
1588
|
+
* - `controlsLayout` places the Previous and Next buttons over the slides (`overlay`,
|
|
1589
|
+
* `overlay-wide`) or beside them (`inline`, `inline-wide`); `Carousel.Button` replaces the
|
|
1590
|
+
* built-in button of its `direction` with one of your own glyph.
|
|
1591
|
+
*
|
|
1592
|
+
* Compound access (`Carousel.Item`, `Carousel.Button`) needs a client module; React Server
|
|
1593
|
+
* Components import the flat names `CarouselItem` and `CarouselButton` instead.
|
|
1266
1594
|
*/
|
|
1267
1595
|
export declare const Carousel: {
|
|
1268
|
-
({ value: controlledValue, defaultValue, onValueChange, autoPlay, autoPlayInterval, autoPlayLabels, labels, loop, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: CarouselProps): React_2.JSX.Element;
|
|
1596
|
+
({ value: controlledValue, defaultValue, onValueChange, autoPlay, autoPlayInterval, autoPlayLabels, labels, loop, groupSize, align, draggable, controlsLayout, appearance, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: CarouselProps): React_2.JSX.Element;
|
|
1269
1597
|
displayName: string;
|
|
1270
1598
|
} & {
|
|
1271
1599
|
Item: {
|
|
1272
|
-
({ className, children, ref, ...rest }: CarouselItemProps): React_2.JSX.Element;
|
|
1600
|
+
({ thumbnail: _thumbnail, className, children, ref, ...rest }: CarouselItemProps): React_2.JSX.Element;
|
|
1601
|
+
displayName: string;
|
|
1602
|
+
};
|
|
1603
|
+
Button: {
|
|
1604
|
+
({ direction, onClick, className, children, ref, ...rest }: CarouselButtonProps): React_2.JSX.Element;
|
|
1273
1605
|
displayName: string;
|
|
1274
1606
|
};
|
|
1275
1607
|
};
|
|
1276
1608
|
|
|
1609
|
+
/** How a Carousel is drawn: `flat`, or `elevated` with rounded corners and a shadow. */
|
|
1610
|
+
export declare type CarouselAppearance = 'flat' | 'elevated';
|
|
1611
|
+
|
|
1277
1612
|
/** Accessible names of the rotation control shown while `autoPlay` is on. */
|
|
1278
1613
|
export declare interface CarouselAutoPlayLabels {
|
|
1279
1614
|
/** Name of the control while slides rotate (activating it stops the rotation).
|
|
@@ -1286,15 +1621,42 @@ export declare interface CarouselAutoPlayLabels {
|
|
|
1286
1621
|
play?: string;
|
|
1287
1622
|
}
|
|
1288
1623
|
|
|
1624
|
+
/**
|
|
1625
|
+
* A Previous or Next button written in a {@link Carousel}, for a glyph or look of your own.
|
|
1626
|
+
* Write it as a direct child of the Carousel: it replaces the built-in button of its
|
|
1627
|
+
* `direction`, takes its place in the layout and is named, disabled and wired to the slides the
|
|
1628
|
+
* same way (`labels.previous`/`labels.next`, `aria-controls`, `aria-disabled` at the ends
|
|
1629
|
+
* without `loop`, which keeps it focusable). Its children replace the chevron, which mirrors in
|
|
1630
|
+
* right-to-left layouts; `aria-label` replaces the name.
|
|
1631
|
+
*/
|
|
1632
|
+
export declare const CarouselButton: {
|
|
1633
|
+
({ direction, onClick, className, children, ref, ...rest }: CarouselButtonProps): React_2.JSX.Element;
|
|
1634
|
+
displayName: string;
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
/** Carousel.Button: `root` on the button element. */
|
|
1638
|
+
export declare const carouselButtonClassNames: {
|
|
1639
|
+
readonly root: "wave-carousel-button";
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
/** Properties for the CarouselButton sub-component. */
|
|
1643
|
+
export declare interface CarouselButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1644
|
+
/** Which way the button moves the carousel. */
|
|
1645
|
+
direction: 'previous' | 'next';
|
|
1646
|
+
ref?: React_2.Ref<HTMLButtonElement>;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1289
1649
|
/**
|
|
1290
1650
|
* Carousel: `root` on the `role="region"` element; `autoPlayButton` on the pause and start
|
|
1291
|
-
* button; `
|
|
1651
|
+
* button; `viewport` on the clipping element around the track; `track` on the moving element
|
|
1652
|
+
* around the slides; `slide` on each slide wrapper;
|
|
1292
1653
|
* `previousButton` and `nextButton` on the arrow buttons; `picker` on the `role="group"` of
|
|
1293
1654
|
* picker buttons; `pickerButton` on each of them; `pickerIndicator` on each button's dot.
|
|
1294
1655
|
*/
|
|
1295
1656
|
export declare const carouselClassNames: {
|
|
1296
1657
|
readonly root: "wave-carousel";
|
|
1297
1658
|
readonly autoPlayButton: "wave-carousel__auto-play-button";
|
|
1659
|
+
readonly viewport: "wave-carousel__viewport";
|
|
1298
1660
|
readonly track: "wave-carousel__track";
|
|
1299
1661
|
readonly slide: "wave-carousel__slide";
|
|
1300
1662
|
readonly previousButton: "wave-carousel__previous-button";
|
|
@@ -1304,23 +1666,35 @@ export declare const carouselClassNames: {
|
|
|
1304
1666
|
readonly pickerIndicator: "wave-carousel__picker-indicator";
|
|
1305
1667
|
};
|
|
1306
1668
|
|
|
1669
|
+
/** Where a Carousel puts its Previous and Next buttons. */
|
|
1670
|
+
export declare type CarouselControlsLayout = 'overlay' | 'inline' | 'overlay-wide' | 'inline-wide';
|
|
1671
|
+
|
|
1307
1672
|
/**
|
|
1308
1673
|
* One slide of a {@link Carousel}. Write it in the Carousel, directly or in a Fragment: a component
|
|
1309
1674
|
* that renders `Carousel.Item` itself is not recognised as a slide (put that component inside the
|
|
1310
1675
|
* `Carousel.Item` instead).
|
|
1311
1676
|
*/
|
|
1312
1677
|
export declare const CarouselItem: {
|
|
1313
|
-
({ className, children, ref, ...rest }: CarouselItemProps): React_2.JSX.Element;
|
|
1678
|
+
({ thumbnail: _thumbnail, className, children, ref, ...rest }: CarouselItemProps): React_2.JSX.Element;
|
|
1314
1679
|
displayName: string;
|
|
1315
1680
|
};
|
|
1316
1681
|
|
|
1317
|
-
/** Carousel.Item: `root` on the item element. */
|
|
1682
|
+
/** Carousel.Item: `root` on the item element; `thumbnail` on the image in its picker button. */
|
|
1318
1683
|
export declare const carouselItemClassNames: {
|
|
1319
1684
|
readonly root: "wave-carousel-item";
|
|
1685
|
+
readonly thumbnail: "wave-carousel-item__thumbnail";
|
|
1320
1686
|
};
|
|
1321
1687
|
|
|
1322
1688
|
/** Properties for the CarouselItem sub-component. */
|
|
1323
1689
|
export declare interface CarouselItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1690
|
+
/**
|
|
1691
|
+
* An image for this slide's button in the picker, in place of the dot. A string is the image
|
|
1692
|
+
* `src`; an object sets the `<img>`'s attributes. The button keeps its slide-label name, so the
|
|
1693
|
+
* image is decorative (`alt=""`). When any slide has one, the picker becomes a row of
|
|
1694
|
+
* thumbnails below the slides; a slide without one keeps its dot. With `groupSize` above 1, a
|
|
1695
|
+
* page shows the thumbnail of its first slide.
|
|
1696
|
+
*/
|
|
1697
|
+
thumbnail?: Slot<'img'>;
|
|
1324
1698
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
1325
1699
|
}
|
|
1326
1700
|
|
|
@@ -1350,6 +1724,13 @@ export declare interface CarouselLabels {
|
|
|
1350
1724
|
* @default (index, total) => `Slide ${index + 1} of ${total}`
|
|
1351
1725
|
*/
|
|
1352
1726
|
slide?: (index: number, total: number) => string;
|
|
1727
|
+
/**
|
|
1728
|
+
* Name of a page of several slides, from the one-based number of its first and last slide, out
|
|
1729
|
+
* of `total` slides (`groupSize` above 1). It names the page's picker button and is announced
|
|
1730
|
+
* by the live region when the page is shown. A page of one slide uses `slide`.
|
|
1731
|
+
* @default (start, end, total) => `Slides ${start} to ${end} of ${total}`
|
|
1732
|
+
*/
|
|
1733
|
+
slides?: (start: number, end: number, total: number) => string;
|
|
1353
1734
|
/** How assistive technology announces the carousel region (`aria-roledescription`).
|
|
1354
1735
|
* @default 'carousel'
|
|
1355
1736
|
*/
|
|
@@ -1362,14 +1743,57 @@ export declare interface CarouselLabels {
|
|
|
1362
1743
|
|
|
1363
1744
|
/** Properties for the Carousel component. */
|
|
1364
1745
|
export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1365
|
-
/**
|
|
1746
|
+
/**
|
|
1747
|
+
* Controlled index of the active slide: with `groupSize` above 1, the first slide of the shown
|
|
1748
|
+
* page. A value in the middle of a page shows that page and out-of-range values show the
|
|
1749
|
+
* nearest one.
|
|
1750
|
+
*/
|
|
1366
1751
|
value?: number;
|
|
1367
1752
|
/** Default active slide index for uncontrolled usage.
|
|
1368
1753
|
* @default 0
|
|
1369
1754
|
*/
|
|
1370
1755
|
defaultValue?: number;
|
|
1371
|
-
/**
|
|
1756
|
+
/**
|
|
1757
|
+
* Called with the new index when the active slide changes (not when it stays the same): the
|
|
1758
|
+
* first slide of the new page when `groupSize` is above 1.
|
|
1759
|
+
*/
|
|
1372
1760
|
onValueChange?: (index: number) => void;
|
|
1761
|
+
/**
|
|
1762
|
+
* How many slides one page shows: a number, or `'auto'` to show as many as fit the width of the
|
|
1763
|
+
* carousel (the slides keep their own width, which must be equal). Previous, Next, the picker
|
|
1764
|
+
* (one button per page), looping and autoplay move by page, and the slides of the shown page
|
|
1765
|
+
* form one arrow-key focus group. With `1` each slide fills the width, as before.
|
|
1766
|
+
* @default 1
|
|
1767
|
+
*/
|
|
1768
|
+
groupSize?: number | 'auto';
|
|
1769
|
+
/**
|
|
1770
|
+
* With `groupSize="auto"`, where the shown page sits when its slides do not fill the width.
|
|
1771
|
+
* @default 'start'
|
|
1772
|
+
*/
|
|
1773
|
+
align?: 'start' | 'center' | 'end';
|
|
1774
|
+
/**
|
|
1775
|
+
* Lets the pointer drag the slides (mouse, touch and pen). The track follows the pointer and,
|
|
1776
|
+
* on release, the page changes when the drag passed a quarter of the width or left fast, else
|
|
1777
|
+
* it snaps back; the direction follows the carousel's. The click that ends a drag is not
|
|
1778
|
+
* delivered to the slide, and a vertical swipe still scrolls the page. Dragging pauses
|
|
1779
|
+
* autoplay like the pointer over the carousel does. The buttons and the keyboard stay the way
|
|
1780
|
+
* to operate the carousel without a pointer.
|
|
1781
|
+
* @default false
|
|
1782
|
+
*/
|
|
1783
|
+
draggable?: boolean;
|
|
1784
|
+
/**
|
|
1785
|
+
* Where the Previous and Next buttons go. `overlay` floats round buttons over the slides;
|
|
1786
|
+
* `overlay-wide` makes them full-height strips at the edges; `inline` puts them in a row with
|
|
1787
|
+
* the slides, outside them; `inline-wide` is `inline` with full-height buttons. The rotation
|
|
1788
|
+
* control stays the first focusable element at the start corner in every layout.
|
|
1789
|
+
* @default 'overlay'
|
|
1790
|
+
*/
|
|
1791
|
+
controlsLayout?: CarouselControlsLayout;
|
|
1792
|
+
/**
|
|
1793
|
+
* `elevated` rounds the corners and adds a shadow.
|
|
1794
|
+
* @default 'flat'
|
|
1795
|
+
*/
|
|
1796
|
+
appearance?: CarouselAppearance;
|
|
1373
1797
|
/**
|
|
1374
1798
|
* Rotates the slides automatically. A Pause/Start control is rendered as the first focusable
|
|
1375
1799
|
* element. Rotation pauses while focus is anywhere inside the carousel (the control included;
|
|
@@ -2677,6 +3101,46 @@ export declare interface CounterBadgeProps extends React_2.HTMLAttributes<HTMLSp
|
|
|
2677
3101
|
ref?: React_2.Ref<HTMLSpanElement>;
|
|
2678
3102
|
}
|
|
2679
3103
|
|
|
3104
|
+
/**
|
|
3105
|
+
* Creates a column for DataGrid's `columns`, typed by the grid's items, with `sortable` resolved
|
|
3106
|
+
* (`true` when the column has `compare`, unless `sortable` says otherwise). Returns a new object
|
|
3107
|
+
* with every member of {@link CreateTableColumnOptions}; the options are not changed. The
|
|
3108
|
+
* function is pure and server-safe.
|
|
3109
|
+
*
|
|
3110
|
+
* @example
|
|
3111
|
+
* const columns = [
|
|
3112
|
+
* createTableColumn<Person>({
|
|
3113
|
+
* columnId: 'name',
|
|
3114
|
+
* label: 'Name',
|
|
3115
|
+
* compare: (a, b) => a.name.localeCompare(b.name),
|
|
3116
|
+
* renderCell: (person) => person.name,
|
|
3117
|
+
* }),
|
|
3118
|
+
* ];
|
|
3119
|
+
*/
|
|
3120
|
+
export declare function createTableColumn<T>(options: CreateTableColumnOptions<T>): DataGridColumn<T>;
|
|
3121
|
+
|
|
3122
|
+
/** Options of {@link createTableColumn}: a DataGrid column, with `columnId` required. */
|
|
3123
|
+
export declare interface CreateTableColumnOptions<T> {
|
|
3124
|
+
/** The column's id: the header cell's `columnId` and the `columnId` of the grid's sort. */
|
|
3125
|
+
columnId: string;
|
|
3126
|
+
/** The header content, unless `renderHeaderCell` is given. */
|
|
3127
|
+
label?: React_2.ReactNode;
|
|
3128
|
+
/**
|
|
3129
|
+
* Orders two items of the column, as `Array.prototype.sort` does (negative: `a` first). Makes the
|
|
3130
|
+
* column sortable unless `sortable` is `false`.
|
|
3131
|
+
*/
|
|
3132
|
+
compare?: (a: T, b: T) => number;
|
|
3133
|
+
/** Renders the column's cell content for one item. Without it, the column's cells are empty. */
|
|
3134
|
+
renderCell?: (item: T) => React_2.ReactNode;
|
|
3135
|
+
/** Renders the header content in place of `label`. */
|
|
3136
|
+
renderHeaderCell?: () => React_2.ReactNode;
|
|
3137
|
+
/**
|
|
3138
|
+
* Whether the header is a sort button.
|
|
3139
|
+
* @default compare !== undefined
|
|
3140
|
+
*/
|
|
3141
|
+
sortable?: boolean;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
2680
3144
|
/**
|
|
2681
3145
|
* Creates a handle. It touches no DOM, so a module-scope handle is safe during server rendering;
|
|
2682
3146
|
* a dispatch on the server does nothing (it returns the id), so no toast is carried from one
|
|
@@ -2702,49 +3166,71 @@ export declare function createToaster(): ToasterHandle;
|
|
|
2702
3166
|
* the visual column, so a grouped header with spanning cells works), Enter/F2 to interact with a
|
|
2703
3167
|
* cell's widgets and Escape to return to the cell. A composite widget in a cell (a Toolbar,
|
|
2704
3168
|
* RadioGroup, TabList, …) is entered with Enter/F2 like a text field; it manages its own tab
|
|
2705
|
-
* indexes, so it keeps its own Tab stop. Supports sortable columns (
|
|
2706
|
-
*
|
|
2707
|
-
* row selection with a select-all header checkbox.
|
|
3169
|
+
* indexes, so it keeps its own Tab stop. Supports sortable columns (`onSortChange` reports the new
|
|
3170
|
+
* sort; a grid with `items` orders its rows by the sorted column's `compare`, otherwise the consumer
|
|
3171
|
+
* orders them) and single or multiple row selection with a select-all header checkbox.
|
|
3172
|
+
*
|
|
3173
|
+
* Selection is made with the row's control, Space on a cell, and, with `selectOnRowClick`, a
|
|
3174
|
+
* click on the row. `selectionAppearance` picks the fill of a selected row, `subtleSelection`
|
|
3175
|
+
* hides the unchecked controls until their row (or, for select-all, the grid) is hovered or holds
|
|
3176
|
+
* focus, and a row's `selectionCellProps` disables, hides or names its control. The selection
|
|
3177
|
+
* column comes first; a `DataGrid.SelectionCell` places it elsewhere in a row.
|
|
3178
|
+
*
|
|
3179
|
+
* The grid is composed from its parts, or rendered from data: with `items` and typed `columns`
|
|
3180
|
+
* (`DataGridColumn<T>`, see `createTableColumn`) it renders the header, the rows and the cells
|
|
3181
|
+
* itself, and `DataGrid.Body` also takes a render function that returns each item's row. Rows
|
|
3182
|
+
* rendered from `items` take their `rowId` from `getRowId` (by default the item's index).
|
|
2708
3183
|
*
|
|
2709
3184
|
* Sub-components are available as `DataGrid.Header`, `DataGrid.HeaderCell`, `DataGrid.Body`,
|
|
2710
|
-
* `DataGrid.Row` and `DataGrid.
|
|
2711
|
-
* `DataGridHeader`, `DataGridHeaderCell`, `DataGridBody`, `DataGridRow
|
|
2712
|
-
* form React Server Components can import).
|
|
3185
|
+
* `DataGrid.Row`, `DataGrid.Cell` and `DataGrid.SelectionCell` in client components, and as the
|
|
3186
|
+
* flat exports `DataGridHeader`, `DataGridHeaderCell`, `DataGridBody`, `DataGridRow`,
|
|
3187
|
+
* `DataGridCell` and `DataGridSelectionCell` (the form React Server Components can import).
|
|
2713
3188
|
*/
|
|
2714
|
-
export declare const DataGrid: {
|
|
2715
|
-
(props: DataGridProps): React_2.JSX.Element;
|
|
2716
|
-
displayName: string;
|
|
2717
|
-
} & {
|
|
3189
|
+
export declare const DataGrid: typeof DataGridRoot & {
|
|
2718
3190
|
Header: {
|
|
2719
3191
|
({ children, className, ref, ...rest }: DataGridHeaderProps): React_2.JSX.Element;
|
|
2720
3192
|
displayName: string;
|
|
2721
3193
|
};
|
|
2722
3194
|
HeaderCell: {
|
|
2723
|
-
({ columnId, sortable, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3195
|
+
({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
2724
3196
|
displayName: string;
|
|
2725
3197
|
};
|
|
2726
3198
|
Body: {
|
|
2727
|
-
({ children, className, ref, ...rest }: DataGridBodyProps): React_2.JSX.Element;
|
|
3199
|
+
<T>({ children, className, ref, ...rest }: DataGridBodyProps<T>): React_2.JSX.Element;
|
|
2728
3200
|
displayName: string;
|
|
2729
3201
|
};
|
|
2730
3202
|
Row: {
|
|
2731
|
-
({ rowId, selectionLabel, children, className, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3203
|
+
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
2732
3204
|
displayName: string;
|
|
2733
3205
|
};
|
|
2734
3206
|
Cell: {
|
|
2735
3207
|
({ children, className, ref, ...rest }: DataGridCellProps): React_2.JSX.Element;
|
|
2736
3208
|
displayName: string;
|
|
2737
3209
|
};
|
|
3210
|
+
SelectionCell: {
|
|
3211
|
+
({ disabled, invisible, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, controlRef, ref, ...rest }: DataGridSelectionCellProps): React_2.JSX.Element | null;
|
|
3212
|
+
displayName: string;
|
|
3213
|
+
};
|
|
2738
3214
|
};
|
|
2739
3215
|
|
|
2740
|
-
/** Props of every DataGrid, whatever sort API it uses. */
|
|
2741
|
-
export declare interface DataGridBaseProps extends React_2.HTMLAttributes<HTMLTableElement> {
|
|
3216
|
+
/** Props of every DataGrid, whatever sort API it uses. `T` is the type of its `items`. */
|
|
3217
|
+
export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttributes<HTMLTableElement> {
|
|
3218
|
+
/**
|
|
3219
|
+
* The row id of an item: the `rowId` of its row (for selection), for rows rendered from `items`.
|
|
3220
|
+
* A row's own `rowId` wins. Ids must be unique (a duplicate warns in development).
|
|
3221
|
+
* @default the item's index in `items`, as a string
|
|
3222
|
+
*/
|
|
3223
|
+
getRowId?: (item: T) => string;
|
|
2742
3224
|
/**
|
|
2743
3225
|
* Column definitions. When given and no `DataGrid.Header` child is present, the header row
|
|
2744
|
-
* (including the selection column) is rendered from them: `
|
|
2745
|
-
* `columnId`, `label` its content, `sortable`
|
|
3226
|
+
* (including the selection column) is rendered from them: `columnId` becomes the header cell's
|
|
3227
|
+
* `columnId`, `renderHeaderCell()` (else `label`) its content, and `sortable` (by default, having
|
|
3228
|
+
* `compare`) makes it a sort button. With `items` and no `DataGrid.Body` child, the body rows are
|
|
3229
|
+
* rendered from them too: one `DataGrid.Cell` per column, filled by `renderCell`. Those rows
|
|
3230
|
+
* render again whenever the array changes, so keep it stable (defined outside the component, or
|
|
3231
|
+
* memoised).
|
|
2746
3232
|
*/
|
|
2747
|
-
columns?: readonly DataGridColumn[];
|
|
3233
|
+
columns?: readonly DataGridColumn<T>[];
|
|
2748
3234
|
/**
|
|
2749
3235
|
* Row selection mode. `'multiple'` adds a checkbox column with a "Select all rows" header
|
|
2750
3236
|
* checkbox; `'single'` adds a radio column (its header reads "Selection" to assistive
|
|
@@ -2758,6 +3244,33 @@ export declare interface DataGridBaseProps extends React_2.HTMLAttributes<HTMLTa
|
|
|
2758
3244
|
* `selectionLabel`.
|
|
2759
3245
|
*/
|
|
2760
3246
|
labels?: DataGridLabels;
|
|
3247
|
+
/**
|
|
3248
|
+
* Whether a click on a body row toggles its selection in a selectable grid (single mode: selects
|
|
3249
|
+
* the row alone, or clears it). The row's own `onClick` runs first; calling `preventDefault()`
|
|
3250
|
+
* in it keeps the selection. A click never toggles when it lands on an interactive element in
|
|
3251
|
+
* the row (a link, a button, an input, a label, an element with `tabindex` or a widget role, the
|
|
3252
|
+
* selection control included), comes from a popup portaled from the row (a Menu, a Popover), or
|
|
3253
|
+
* ends a text selection in the row (a drag across its text); nor does a click on a header row
|
|
3254
|
+
* or on a row whose selection is disabled (`selectionCellProps.disabled`). Space on a cell
|
|
3255
|
+
* toggles the row either way.
|
|
3256
|
+
* @default false
|
|
3257
|
+
*/
|
|
3258
|
+
selectOnRowClick?: boolean;
|
|
3259
|
+
/**
|
|
3260
|
+
* How a selected row is filled: `'brand'` with the selected token, `'neutral'` with the subtle
|
|
3261
|
+
* selected token, `'none'` not at all (the selection control, `aria-selected` and, in forced
|
|
3262
|
+
* colors, the row's outline still show it). Rendered as `data-selection-appearance` on the grid.
|
|
3263
|
+
* @default 'brand'
|
|
3264
|
+
*/
|
|
3265
|
+
selectionAppearance?: DataGridSelectionAppearance;
|
|
3266
|
+
/**
|
|
3267
|
+
* Subtle selection controls: a row's control is transparent while the row is not selected, until
|
|
3268
|
+
* the row is hovered or holds focus, and the select-all checkbox while no row is selected, until
|
|
3269
|
+
* the grid is hovered or holds focus. Forced colors and a coarse pointer (touch) always draw
|
|
3270
|
+
* them; they stay focusable and named. Rendered as `data-subtle-selection` on the grid.
|
|
3271
|
+
* @default false
|
|
3272
|
+
*/
|
|
3273
|
+
subtleSelection?: boolean;
|
|
2761
3274
|
/**
|
|
2762
3275
|
* Controlled selected row ids (`DataGrid.Row` `rowId`). In single mode pass at most one id: with
|
|
2763
3276
|
* several, only the first one whose row is rendered is selected (a development warning says so).
|
|
@@ -2766,12 +3279,13 @@ export declare interface DataGridBaseProps extends React_2.HTMLAttributes<HTMLTa
|
|
|
2766
3279
|
/** Initially selected row ids (uncontrolled). In single mode, at most one (see `selectedItems`). */
|
|
2767
3280
|
defaultSelectedItems?: readonly string[];
|
|
2768
3281
|
/**
|
|
2769
|
-
* Called with the new selected row ids when the selection changes
|
|
2770
|
-
*
|
|
2771
|
-
*
|
|
2772
|
-
* re-added with the same `rowId` before
|
|
3282
|
+
* Called with the new selected row ids when the selection changes, then `details` (`{ event }`,
|
|
3283
|
+
* the click or key press behind the change). Ids of rows that are not rendered are left out of
|
|
3284
|
+
* the reported selection and of the select-all state, so the next change drops them. Until that
|
|
3285
|
+
* change an uncontrolled grid still holds such an id: a row re-added with the same `rowId` before
|
|
3286
|
+
* then is shown selected again.
|
|
2773
3287
|
*/
|
|
2774
|
-
onSelectedItemsChange?: (selectedItems: string[]) => void;
|
|
3288
|
+
onSelectedItemsChange?: (selectedItems: string[], details?: DataGridSelectedItemsChangeDetails) => void;
|
|
2775
3289
|
/** @deprecated Use `selectedItems` (an array). A `Set` or an array is accepted. */
|
|
2776
3290
|
selectedKeys?: ReadonlySet<string> | readonly string[];
|
|
2777
3291
|
/** @deprecated Use `defaultSelectedItems` (an array). A `Set` or an array is accepted. */
|
|
@@ -2786,15 +3300,22 @@ export declare interface DataGridBaseProps extends React_2.HTMLAttributes<HTMLTa
|
|
|
2786
3300
|
* without one they are dropped with a development warning. Name the grid with `aria-label`.
|
|
2787
3301
|
*/
|
|
2788
3302
|
containerProps?: Omit<React_2.ComponentPropsWithRef<'div'>, 'children'>;
|
|
2789
|
-
/**
|
|
2790
|
-
|
|
3303
|
+
/**
|
|
3304
|
+
* DataGrid header, body, and row elements. Optional when `items` and `columns` render the grid;
|
|
3305
|
+
* a generated body is placed after the header and before a `<tfoot>` child.
|
|
3306
|
+
*/
|
|
3307
|
+
children?: React_2.ReactNode;
|
|
2791
3308
|
/** Ref to the `<table role="grid">` element. */
|
|
2792
3309
|
ref?: React_2.Ref<HTMLTableElement>;
|
|
2793
3310
|
}
|
|
2794
3311
|
|
|
2795
|
-
/**
|
|
3312
|
+
/**
|
|
3313
|
+
* The grid's `<tbody>`. Its child can also be a render function, called with each item of the
|
|
3314
|
+
* grid's `items` (and its index there) to render the item's row; without children, a grid with
|
|
3315
|
+
* `items` and `columns` renders the rows from the columns.
|
|
3316
|
+
*/
|
|
2796
3317
|
export declare const DataGridBody: {
|
|
2797
|
-
({ children, className, ref, ...rest }: DataGridBodyProps): React_2.JSX.Element;
|
|
3318
|
+
<T>({ children, className, ref, ...rest }: DataGridBodyProps<T>): React_2.JSX.Element;
|
|
2798
3319
|
displayName: string;
|
|
2799
3320
|
};
|
|
2800
3321
|
|
|
@@ -2803,15 +3324,27 @@ export declare const dataGridBodyClassNames: {
|
|
|
2803
3324
|
readonly root: "wave-data-grid-body";
|
|
2804
3325
|
};
|
|
2805
3326
|
|
|
2806
|
-
/** Properties for the DataGridBody sub-component
|
|
2807
|
-
export declare interface DataGridBodyProps extends React_2.HTMLAttributes<HTMLTableSectionElement> {
|
|
2808
|
-
/**
|
|
2809
|
-
|
|
3327
|
+
/** Properties for the DataGridBody sub-component, in a grid whose `items` are of type `T`. */
|
|
3328
|
+
export declare interface DataGridBodyProps<T = unknown> extends Omit<React_2.HTMLAttributes<HTMLTableSectionElement>, 'children'> {
|
|
3329
|
+
/**
|
|
3330
|
+
* The body rows: `DataGrid.Row` elements, or a render function called with each item of the
|
|
3331
|
+
* grid's `items` (in the grid's sort order) and the item's index in `items` (its position there,
|
|
3332
|
+
* whatever the sort), which returns the item's `DataGrid.Row`. The grid keys each returned row
|
|
3333
|
+
* by its row id and gives it that id as `rowId` (from `getRowId`), and renders it again only
|
|
3334
|
+
* when its item, its index or the function change (a sort moves the rows). Type the function
|
|
3335
|
+
* by annotating its item parameter (`(person: Person) => …`) or with `DataGrid.Body<Person>`.
|
|
3336
|
+
* Without children, a grid with `items` and `columns` renders the rows from the columns; empty
|
|
3337
|
+
* children are no rows.
|
|
3338
|
+
*/
|
|
3339
|
+
children?: React_2.ReactNode | ((item: T, index: number) => React_2.ReactNode);
|
|
2810
3340
|
/** Ref to the `<tbody>` element. */
|
|
2811
3341
|
ref?: React_2.Ref<HTMLTableSectionElement>;
|
|
2812
3342
|
}
|
|
2813
3343
|
|
|
2814
|
-
/**
|
|
3344
|
+
/**
|
|
3345
|
+
* A grid cell (`<td>`), focusable through the grid's keyboard navigation. It is the positioning
|
|
3346
|
+
* box of a `Table.CellActions` inside it.
|
|
3347
|
+
*/
|
|
2815
3348
|
export declare const DataGridCell: {
|
|
2816
3349
|
({ children, className, ref, ...rest }: DataGridCellProps): React_2.JSX.Element;
|
|
2817
3350
|
displayName: string;
|
|
@@ -2836,36 +3369,71 @@ export declare const dataGridClassNames: {
|
|
|
2836
3369
|
readonly container: "wave-data-grid__container";
|
|
2837
3370
|
};
|
|
2838
3371
|
|
|
2839
|
-
/**
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
3372
|
+
/**
|
|
3373
|
+
* Defines a column of the DataGrid, typed by the grid's items (`T`): the header cell it renders
|
|
3374
|
+
* and, with `items`, the cell of each row. `createTableColumn` builds one with `sortable` resolved.
|
|
3375
|
+
* A column with functions (`compare`, `renderCell`, `renderHeaderCell`) cannot be passed from a
|
|
3376
|
+
* Server Component to the DataGrid, since functions are not serializable: define such columns in a
|
|
3377
|
+
* client component.
|
|
3378
|
+
*/
|
|
3379
|
+
export declare interface DataGridColumn<T = unknown> {
|
|
3380
|
+
/**
|
|
3381
|
+
* Unique identifier of the column: the `columnId` of its header cell (and of the grid's sort) and
|
|
3382
|
+
* the React key of its cells. Required in practice: a column without it (and without the
|
|
3383
|
+
* deprecated `id`) cannot sort, with a development warning.
|
|
3384
|
+
*/
|
|
3385
|
+
columnId?: string;
|
|
3386
|
+
/**
|
|
3387
|
+
* @deprecated Use `columnId`. Read only when `columnId` is not given, with a development
|
|
3388
|
+
* warning.
|
|
3389
|
+
*/
|
|
3390
|
+
id?: string;
|
|
3391
|
+
/** The header content (text or any React node), unless `renderHeaderCell` is given. */
|
|
3392
|
+
label: React_2.ReactNode;
|
|
3393
|
+
/**
|
|
3394
|
+
* Orders two items of the column, as for `Array.prototype.sort` (negative: `a` first). A column
|
|
3395
|
+
* with `compare` is sortable unless `sortable` is `false`. While the grid's sort names the column
|
|
3396
|
+
* (its own sort, or a controlled `sort`), a grid with `items` renders its rows in this order: a
|
|
3397
|
+
* stable sort of a copy of `items`, so items that compare equal keep their order in `items`,
|
|
3398
|
+
* in both directions (descending negates `compare`). Without `compare` the grid never reorders
|
|
3399
|
+
* the rows: leave it out when the rows arrive sorted (a server-sorted grid).
|
|
3400
|
+
*/
|
|
3401
|
+
compare?: (a: T, b: T) => number;
|
|
3402
|
+
/**
|
|
3403
|
+
* Renders the content of the column's cell for one item (rows rendered from `items`). Without
|
|
3404
|
+
* it, the column's cells are empty.
|
|
3405
|
+
*/
|
|
3406
|
+
renderCell?: (item: T) => React_2.ReactNode;
|
|
3407
|
+
/** Renders the header content, in place of `label`. */
|
|
3408
|
+
renderHeaderCell?: () => React_2.ReactNode;
|
|
3409
|
+
/**
|
|
3410
|
+
* Whether the column's header is a sort button (the header cell carries `aria-sort`).
|
|
3411
|
+
* @default compare !== undefined
|
|
3412
|
+
*/
|
|
2846
3413
|
sortable?: boolean;
|
|
2847
3414
|
}
|
|
2848
3415
|
|
|
2849
|
-
/** The 0.5 sort API, controlled: `sort` + `onSortChange(sort)`. */
|
|
3416
|
+
/** The 0.5 sort API, controlled: `sort` + `onSortChange(sort, details)`. */
|
|
2850
3417
|
export declare interface DataGridControlledSortProps extends NoDeprecatedSortProps {
|
|
2851
3418
|
/** The controlled sort, or `null` for an unsorted grid. */
|
|
2852
3419
|
sort: DataGridSort | null;
|
|
2853
3420
|
/** Initial sort while `sort` is not given yet. */
|
|
2854
3421
|
defaultSort?: DataGridSort | null;
|
|
2855
3422
|
/**
|
|
2856
|
-
* Called with the new sort when a sortable header is activated
|
|
2857
|
-
*
|
|
3423
|
+
* Called with the new sort when a sortable header is activated, then `details` (`{ event }`).
|
|
3424
|
+
* With `items`, the grid orders its rows by the sorted column's `compare` (see
|
|
3425
|
+
* `DataGridColumn.compare`), also while `sort` is controlled; otherwise the consumer orders them.
|
|
2858
3426
|
*/
|
|
2859
|
-
onSortChange?: (sort: DataGridSort) => void;
|
|
3427
|
+
onSortChange?: (sort: DataGridSort, details?: DataGridSortChangeDetails) => void;
|
|
2860
3428
|
}
|
|
2861
3429
|
|
|
2862
3430
|
/**
|
|
2863
3431
|
* The grid's `<thead>`. When the grid is selectable, it prepends the selection column's header
|
|
2864
|
-
* cell to each `<tr>` child, also inside a Fragment
|
|
2865
|
-
*
|
|
2866
|
-
*
|
|
2867
|
-
*
|
|
2868
|
-
* which adds the cell itself.
|
|
3432
|
+
* cell to each `<tr>` child, also inside a Fragment, unless the row holds a
|
|
3433
|
+
* `DataGrid.SelectionCell`: the first header row gets the "Select all rows" checkbox (multiple
|
|
3434
|
+
* mode) or the "Selection" header (single mode; DataGrid's `labels` localizes both), later rows of
|
|
3435
|
+
* a grouped header an empty cell. A header row rendered by another component cannot get it (a
|
|
3436
|
+
* development warning says so): use `DataGrid.Row` for such a row, which adds the cell itself.
|
|
2869
3437
|
*/
|
|
2870
3438
|
export declare const DataGridHeader: {
|
|
2871
3439
|
({ children, className, ref, ...rest }: DataGridHeaderProps): React_2.JSX.Element;
|
|
@@ -2874,18 +3442,19 @@ export declare const DataGridHeader: {
|
|
|
2874
3442
|
|
|
2875
3443
|
/**
|
|
2876
3444
|
* A column header cell. A `sortable` header (with a `columnId`) renders its content inside a
|
|
2877
|
-
* `<button type="button">` that toggles the sort
|
|
2878
|
-
*
|
|
2879
|
-
* sort (
|
|
3445
|
+
* `<button type="button">` that toggles the sort, followed by the direction glyph (`sortIcon`)
|
|
3446
|
+
* while its column is sorted; the `<th>` carries `aria-sort`. A consumer `onClick` (on the `<th>`)
|
|
3447
|
+
* runs before the sort, and calling `preventDefault()` in it cancels the sort (also for
|
|
3448
|
+
* Enter/Space on the button, which click it).
|
|
2880
3449
|
*/
|
|
2881
3450
|
export declare const DataGridHeaderCell: {
|
|
2882
|
-
({ columnId, sortable, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3451
|
+
({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
2883
3452
|
displayName: string;
|
|
2884
3453
|
};
|
|
2885
3454
|
|
|
2886
3455
|
/**
|
|
2887
3456
|
* DataGrid.HeaderCell: `root` on the `<th>`; `button` on the sort button; `sortIcon` on its
|
|
2888
|
-
* direction `<svg
|
|
3457
|
+
* direction glyph (the default arrow `<svg>`, or the `<span>` of a `sortIcon` slot).
|
|
2889
3458
|
*/
|
|
2890
3459
|
export declare const dataGridHeaderCellClassNames: {
|
|
2891
3460
|
readonly root: "wave-data-grid-header-cell";
|
|
@@ -2903,6 +3472,16 @@ export declare interface DataGridHeaderCellProps extends React_2.ThHTMLAttribute
|
|
|
2903
3472
|
* @default false
|
|
2904
3473
|
*/
|
|
2905
3474
|
sortable?: boolean;
|
|
3475
|
+
/**
|
|
3476
|
+
* The glyph a sortable header shows after its content while its column is sorted, in place of
|
|
3477
|
+
* the default arrow (up for ascending, down for descending). It is decorative (`aria-hidden`:
|
|
3478
|
+
* `aria-sort` on the header tells the direction) and carries `data-direction` (`ascending` or
|
|
3479
|
+
* `descending`), so one glyph can be turned by a selector on it. `null` and `undefined` keep the
|
|
3480
|
+
* arrow; `false`, or any value that renders nothing, shows no glyph. A `<button>` or `Button`
|
|
3481
|
+
* element (or a slot object whose `as` is one) is not nested in the sort button: its children
|
|
3482
|
+
* become the glyph and its props are dropped, with a development warning.
|
|
3483
|
+
*/
|
|
3484
|
+
sortIcon?: Slot<'span'>;
|
|
2906
3485
|
/** Header cell content. */
|
|
2907
3486
|
children: React_2.ReactNode;
|
|
2908
3487
|
/** Ref to the `<th>` element. */
|
|
@@ -2923,15 +3502,53 @@ export declare const dataGridHeaderClassNames: {
|
|
|
2923
3502
|
export declare interface DataGridHeaderProps extends React_2.HTMLAttributes<HTMLTableSectionElement> {
|
|
2924
3503
|
/**
|
|
2925
3504
|
* Header row elements. Each `<tr>` child (also inside a Fragment) gets the selection column's
|
|
2926
|
-
* header cell prepended when the grid is selectable
|
|
2927
|
-
*
|
|
2928
|
-
*
|
|
3505
|
+
* header cell prepended when the grid is selectable, unless the row holds a
|
|
3506
|
+
* `DataGrid.SelectionCell` (which then is that cell, where it stands); a header row rendered by
|
|
3507
|
+
* another component should be a `DataGrid.Row`, which adds the cell itself. With several header
|
|
3508
|
+
* rows (a grouped header), only the first one gets the "Select all rows" control; later rows get
|
|
3509
|
+
* an empty cell.
|
|
2929
3510
|
*/
|
|
2930
3511
|
children: React_2.ReactNode;
|
|
2931
3512
|
/** Ref to the `<thead>` element. */
|
|
2932
3513
|
ref?: React_2.Ref<HTMLTableSectionElement>;
|
|
2933
3514
|
}
|
|
2934
3515
|
|
|
3516
|
+
/**
|
|
3517
|
+
* The `items` prop of a DataGrid that renders its rows from data, part of every sort form of
|
|
3518
|
+
* `DataGridProps` but the 0.4 one. `T` is the type of the items.
|
|
3519
|
+
*/
|
|
3520
|
+
export declare interface DataGridItemsProps<T = unknown> {
|
|
3521
|
+
/**
|
|
3522
|
+
* The grid's data, one body row per item, in this order unless the sorted column has `compare`
|
|
3523
|
+
* (see `DataGridColumn.compare`). With `columns` and no `DataGrid.Body` child (or one without
|
|
3524
|
+
* children), the grid renders the rows and cells from the columns; a `DataGrid.Body` whose child
|
|
3525
|
+
* is a render function renders the row of each item. Each row's `rowId` comes from `getRowId`.
|
|
3526
|
+
* The grid reads the array and never changes it. With `items`, `onSortChange` receives a
|
|
3527
|
+
* `DataGridSort` object and `details`, never the 0.4 arguments. `items` may not be `undefined`
|
|
3528
|
+
* unless `sort` or `defaultSort` is given; pass `items={data ?? []}` while loading.
|
|
3529
|
+
*/
|
|
3530
|
+
items?: readonly T[];
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* The sort props of a grid with `items`: the 0.5 sort API, whether or not `sort` or `defaultSort`
|
|
3535
|
+
* is given (unsorted at first without them). The 0.4 positional `onSortChange` and the deprecated
|
|
3536
|
+
* sort props do not apply to such a grid.
|
|
3537
|
+
*/
|
|
3538
|
+
export declare interface DataGridItemsSortProps<T = unknown> extends DataGridItemsProps<T>, NoDeprecatedSortProps {
|
|
3539
|
+
/** The grid's data (see `DataGridItemsProps.items`). */
|
|
3540
|
+
items: readonly T[];
|
|
3541
|
+
/** The controlled sort, or `null` for an unsorted grid; `undefined` leaves the sort to the grid. */
|
|
3542
|
+
sort?: DataGridSort | null;
|
|
3543
|
+
/** The initial sort while `sort` is not given. */
|
|
3544
|
+
defaultSort?: DataGridSort | null;
|
|
3545
|
+
/**
|
|
3546
|
+
* Called with the new sort when a sortable header is activated, then `details` (`{ event }`).
|
|
3547
|
+
* The grid orders its rows by the sorted column's `compare` (see `DataGridColumn.compare`).
|
|
3548
|
+
*/
|
|
3549
|
+
onSortChange?: (sort: DataGridSort, details?: DataGridSortChangeDetails) => void;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
2935
3552
|
/** The built-in text of a DataGrid, for localization (see `DataGridBaseProps.labels`). */
|
|
2936
3553
|
export declare interface DataGridLabels {
|
|
2937
3554
|
/** Accessible name of the select-all checkbox in the header (`selectionMode="multiple"`).
|
|
@@ -2948,11 +3565,14 @@ export declare interface DataGridLabels {
|
|
|
2948
3565
|
|
|
2949
3566
|
/**
|
|
2950
3567
|
* The 0.4 sort API: `onSortChange(columnId, direction)` and the deprecated `sortColumn`/
|
|
2951
|
-
* `sortDirection` props. It applies whenever
|
|
2952
|
-
* the column and the direction can be controlled independently: the half that is not
|
|
2953
|
-
* kept internally and follows every sort request (mixed control, warned in
|
|
3568
|
+
* `sortDirection` props. It applies whenever none of `items`, `sort` and `defaultSort` is given.
|
|
3569
|
+
* As in 0.4, the column and the direction can be controlled independently: the half that is not
|
|
3570
|
+
* controlled is kept internally and follows every sort request (mixed control, warned in
|
|
3571
|
+
* development).
|
|
2954
3572
|
*/
|
|
2955
3573
|
export declare interface DataGridLegacySortProps {
|
|
3574
|
+
/** A grid with `items` uses the 0.5 sort API (`DataGridItemsSortProps`). */
|
|
3575
|
+
items?: undefined;
|
|
2956
3576
|
sort?: undefined;
|
|
2957
3577
|
defaultSort?: undefined;
|
|
2958
3578
|
/**
|
|
@@ -2970,10 +3590,10 @@ export declare interface DataGridLegacySortProps {
|
|
|
2970
3590
|
/** @deprecated Use `defaultSort`. */
|
|
2971
3591
|
defaultSortDirection?: SortDirection;
|
|
2972
3592
|
/**
|
|
2973
|
-
* Called when a sortable header is activated, with the 0.4 arguments. Pass `sort` or
|
|
2974
|
-
* `defaultSort` to receive a `DataGridSort` object
|
|
2975
|
-
* object form on for an initially unsorted grid. A `sort` that is
|
|
2976
|
-
* data loads) does not: pass `sort={sort ?? null}`.
|
|
3593
|
+
* Called when a sortable header is activated, with the 0.4 arguments. Pass `items`, `sort` or
|
|
3594
|
+
* `defaultSort` to receive a `DataGridSort` object (and `details`) instead:
|
|
3595
|
+
* `defaultSort={null}` turns the object form on for an initially unsorted grid. A `sort` that is
|
|
3596
|
+
* still `undefined` (e.g. while data loads) does not: pass `sort={sort ?? null}`.
|
|
2977
3597
|
*
|
|
2978
3598
|
* @example
|
|
2979
3599
|
* <DataGrid defaultSort={null} onSortChange={(sort) => setSort(sort)}>…</DataGrid>
|
|
@@ -2982,19 +3602,36 @@ export declare interface DataGridLegacySortProps {
|
|
|
2982
3602
|
}
|
|
2983
3603
|
|
|
2984
3604
|
/**
|
|
2985
|
-
* Properties for the DataGrid component
|
|
2986
|
-
* `onSortChange(sort)` (0.5
|
|
2987
|
-
*
|
|
2988
|
-
*
|
|
3605
|
+
* Properties for the DataGrid component, whose `items` are of type `T`. The sort props form a
|
|
3606
|
+
* union: `sort`/`defaultSort` with `onSortChange(sort, details)` (0.5, also the form of every grid
|
|
3607
|
+
* with `items`), or the 0.4 form `onSortChange(columnId, direction)` with the deprecated
|
|
3608
|
+
* `sortColumn`/`sortDirection`/`defaultSortColumn`/`defaultSortDirection`, for a grid without
|
|
3609
|
+
* `items`. The two cannot be mixed.
|
|
2989
3610
|
*/
|
|
2990
|
-
export declare type DataGridProps = DataGridBaseProps & (DataGridControlledSortProps | DataGridUncontrolledSortProps | DataGridLegacySortProps);
|
|
3611
|
+
export declare type DataGridProps<T = unknown> = DataGridBaseProps<T> & ((DataGridItemsProps<T> & DataGridControlledSortProps) | (DataGridItemsProps<T> & DataGridUncontrolledSortProps) | DataGridItemsSortProps<T> | DataGridLegacySortProps);
|
|
3612
|
+
|
|
3613
|
+
declare function DataGridRoot<T>(props: DataGridBaseProps<T> & DataGridItemsSortProps<T>): React_2.JSX.Element;
|
|
3614
|
+
|
|
3615
|
+
declare function DataGridRoot<T = unknown>(props: DataGridProps<T>): React_2.JSX.Element;
|
|
3616
|
+
|
|
3617
|
+
declare namespace DataGridRoot {
|
|
3618
|
+
var displayName: string;
|
|
3619
|
+
}
|
|
2991
3620
|
|
|
2992
3621
|
/**
|
|
2993
3622
|
* A grid row. In a selectable grid it starts with a selection cell (checkbox or radio) named
|
|
2994
|
-
* after the row's first cell (or `selectionLabel`)
|
|
3623
|
+
* after the row's first cell (or `selectionLabel`), unless a `DataGrid.SelectionCell` child is
|
|
3624
|
+
* its selection cell; Space on one of its cells toggles the row, and so does a click on the row
|
|
3625
|
+
* with the grid's `selectOnRowClick`.
|
|
3626
|
+
*
|
|
3627
|
+
* The row is the `group/table-row` group whose hover or focus draws a subtle selection control
|
|
3628
|
+
* (`subtleSelection`) and the `Table.CellActions` of its cells. A group is matched by any
|
|
3629
|
+
* ancestor, so the rows of a grid nested in a cell
|
|
3630
|
+
* share it: hovering the outer row also draws the subtle controls of the nested grid (a limit of
|
|
3631
|
+
* CSS groups). A Tree in a cell keeps its own rows' group.
|
|
2995
3632
|
*/
|
|
2996
3633
|
export declare const DataGridRow: {
|
|
2997
|
-
({ rowId, selectionLabel, children, className, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3634
|
+
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
2998
3635
|
displayName: string;
|
|
2999
3636
|
};
|
|
3000
3637
|
|
|
@@ -3013,22 +3650,119 @@ export declare interface DataGridRowProps extends React_2.HTMLAttributes<HTMLTab
|
|
|
3013
3650
|
/**
|
|
3014
3651
|
* Unique identifier for this row, used for selection (rows that share one are selected together;
|
|
3015
3652
|
* a duplicate warns in development). A selectable grid renders no selection control (and warns
|
|
3016
|
-
* in development) for a row without it.
|
|
3653
|
+
* in development) for a row without it. A row rendered from the grid's `items` (by
|
|
3654
|
+
* `DataGrid.Body`'s render function or from `columns`) defaults to the item's row id
|
|
3655
|
+
* (`getRowId`).
|
|
3017
3656
|
*/
|
|
3018
3657
|
rowId?: string;
|
|
3019
3658
|
/**
|
|
3020
3659
|
* Accessible name of the row's selection control. Defaults to the row's first child that is a
|
|
3021
3660
|
* `DataGrid.Cell`, `<td>` or `<th>` element (`aria-labelledby`); a cell that another component
|
|
3022
3661
|
* renders is not seen, so pass `selectionLabel` when the row's first cell is one. Without such a
|
|
3023
|
-
* child the control is named "Select row" (with a development warning).
|
|
3662
|
+
* child the control is named "Select row" (with a development warning). The selection cell's
|
|
3663
|
+
* `aria-label` (`selectionCellProps`, or a `DataGrid.SelectionCell` child's) wins over it.
|
|
3024
3664
|
*/
|
|
3025
3665
|
selectionLabel?: string;
|
|
3026
|
-
/**
|
|
3666
|
+
/**
|
|
3667
|
+
* Props of the row's selection cell (`disabled`, `invisible`, `className`, `aria-label`): the
|
|
3668
|
+
* cell the row adds first in a selectable grid, or a `DataGrid.SelectionCell` child, whose own
|
|
3669
|
+
* props win (their classes are merged). In a header row they apply to the select-all cell.
|
|
3670
|
+
*/
|
|
3671
|
+
selectionCellProps?: DataGridRowSelectionCellProps;
|
|
3672
|
+
/**
|
|
3673
|
+
* DataGrid cell elements. A `DataGrid.SelectionCell` child (also inside a Fragment) is the row's
|
|
3674
|
+
* selection cell, where it stands: the row then adds none.
|
|
3675
|
+
*/
|
|
3027
3676
|
children: React_2.ReactNode;
|
|
3028
3677
|
/** Ref to the `<tr>` element. */
|
|
3029
3678
|
ref?: React_2.Ref<HTMLTableRowElement>;
|
|
3030
3679
|
}
|
|
3031
3680
|
|
|
3681
|
+
/**
|
|
3682
|
+
* The props of a row's selection cell (`DataGrid.Row` `selectionCellProps`), the automatic cell or
|
|
3683
|
+
* a `DataGrid.SelectionCell` child (whose own props win).
|
|
3684
|
+
*/
|
|
3685
|
+
export declare interface DataGridRowSelectionCellProps {
|
|
3686
|
+
/**
|
|
3687
|
+
* Disables the row's selection control natively. The control is then no focus target of the grid
|
|
3688
|
+
* (the cell takes focus), and neither a row click (`selectOnRowClick`), Space on a cell nor
|
|
3689
|
+
* select-all changes the row's selection: select-all skips it, keeps it as it is, and tells its
|
|
3690
|
+
* state from the other rows. In a header row it disables the select-all checkbox.
|
|
3691
|
+
* @default false
|
|
3692
|
+
*/
|
|
3693
|
+
disabled?: boolean;
|
|
3694
|
+
/**
|
|
3695
|
+
* Hides the selection control (it keeps its space and cannot be focused). The row is still
|
|
3696
|
+
* selected by a row click and Space, and tells its state with `aria-selected`.
|
|
3697
|
+
* @default false
|
|
3698
|
+
*/
|
|
3699
|
+
invisible?: boolean;
|
|
3700
|
+
/** Class of the selection cell (`<td>`, or the `<th>` of a header row). */
|
|
3701
|
+
className?: string;
|
|
3702
|
+
/**
|
|
3703
|
+
* Accessible name of the selection control, in place of `selectionLabel` and the name taken from
|
|
3704
|
+
* the row's first cell; in a header row, the name of the select-all checkbox.
|
|
3705
|
+
*/
|
|
3706
|
+
'aria-label'?: string;
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
/** Second argument of `onSelectedItemsChange`: the event behind the change. */
|
|
3710
|
+
export declare interface DataGridSelectedItemsChangeDetails {
|
|
3711
|
+
/**
|
|
3712
|
+
* The DOM event behind the change: the click of a selection control (the select-all checkbox
|
|
3713
|
+
* included), or the key press of Space on a row.
|
|
3714
|
+
*/
|
|
3715
|
+
event: Event;
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
/**
|
|
3719
|
+
* How a selected row of a DataGrid is filled (`selectionAppearance`): `'brand'` with the selected
|
|
3720
|
+
* token, `'neutral'` with the subtle selected token, `'none'` not at all.
|
|
3721
|
+
*/
|
|
3722
|
+
export declare type DataGridSelectionAppearance = 'brand' | 'neutral' | 'none';
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* The selection cell of a row, rendered where it stands among the row's cells (the row and the
|
|
3726
|
+
* header then add none of their own). In a header row it is the select-all checkbox (multiple
|
|
3727
|
+
* mode; the "Selection" header text in single mode), the first header row's only, as the
|
|
3728
|
+
* automatic cell; in a body row (a `DataGrid.Row`) the row's checkbox or radio. It takes the
|
|
3729
|
+
* selection cell props of its row (`selectionCellProps`), its own winning. `aria-label`,
|
|
3730
|
+
* `aria-labelledby` and `aria-describedby` go to the control; the other props, `className` and
|
|
3731
|
+
* `ref` to the cell. In a grid without selection it renders nothing (with a development warning).
|
|
3732
|
+
*/
|
|
3733
|
+
export declare const DataGridSelectionCell: {
|
|
3734
|
+
({ disabled, invisible, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, controlRef, ref, ...rest }: DataGridSelectionCellProps): React_2.JSX.Element | null;
|
|
3735
|
+
displayName: string;
|
|
3736
|
+
};
|
|
3737
|
+
|
|
3738
|
+
/**
|
|
3739
|
+
* DataGrid.SelectionCell: `root` on the cell, which also carries the selection cell part of its
|
|
3740
|
+
* row (`dataGridRowClassNames.selectionCell`) or header (`dataGridHeaderClassNames.selectionCell`);
|
|
3741
|
+
* its control carries `dataGridRowClassNames.selectionControl` or
|
|
3742
|
+
* `dataGridHeaderClassNames.selectAllCheckbox`.
|
|
3743
|
+
*/
|
|
3744
|
+
export declare const dataGridSelectionCellClassNames: {
|
|
3745
|
+
readonly root: "wave-data-grid-selection-cell";
|
|
3746
|
+
};
|
|
3747
|
+
|
|
3748
|
+
/** Properties for the DataGridSelectionCell sub-component. */
|
|
3749
|
+
export declare interface DataGridSelectionCellProps extends Omit<React_2.TdHTMLAttributes<HTMLTableCellElement>, 'children'>, DataGridRowSelectionCellProps {
|
|
3750
|
+
/**
|
|
3751
|
+
* The cell holds no content of its own: the grid renders the selection control (or, in a
|
|
3752
|
+
* single-mode header row, the hidden "Selection" header text).
|
|
3753
|
+
*/
|
|
3754
|
+
children?: never;
|
|
3755
|
+
/**
|
|
3756
|
+
* Accessible name of the control, in place of `aria-label` and the row's `selectionLabel`.
|
|
3757
|
+
* Routed to the control, as `aria-label` and `aria-describedby` are.
|
|
3758
|
+
*/
|
|
3759
|
+
'aria-labelledby'?: string;
|
|
3760
|
+
/** Ref to the selection control (`<input type="checkbox">` or `<input type="radio">`). */
|
|
3761
|
+
controlRef?: React_2.Ref<HTMLInputElement>;
|
|
3762
|
+
/** Ref to the cell element (`<td>`, or the `<th>` of a header row's select-all). */
|
|
3763
|
+
ref?: React_2.Ref<HTMLTableCellElement>;
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3032
3766
|
/** The sort state of a DataGrid: the sorted column and its direction. */
|
|
3033
3767
|
export declare interface DataGridSort {
|
|
3034
3768
|
/** The `columnId` of the sorted column. */
|
|
@@ -3037,16 +3771,23 @@ export declare interface DataGridSort {
|
|
|
3037
3771
|
direction: SortDirection;
|
|
3038
3772
|
}
|
|
3039
3773
|
|
|
3040
|
-
/**
|
|
3774
|
+
/** Second argument of `onSortChange` (the `DataGridSort` form): the event behind the sort. */
|
|
3775
|
+
export declare interface DataGridSortChangeDetails {
|
|
3776
|
+
/** The DOM event behind the sort: the click of the sort button (Enter and Space click it). */
|
|
3777
|
+
event: Event;
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
/** The 0.5 sort API, uncontrolled: `defaultSort` (`null` for none) + `onSortChange(sort, details)`. */
|
|
3041
3781
|
export declare interface DataGridUncontrolledSortProps extends NoDeprecatedSortProps {
|
|
3042
3782
|
sort?: undefined;
|
|
3043
3783
|
/** The initial sort, or `null` for an initially unsorted grid. */
|
|
3044
3784
|
defaultSort: DataGridSort | null;
|
|
3045
3785
|
/**
|
|
3046
|
-
* Called with the new sort when a sortable header is activated
|
|
3047
|
-
*
|
|
3786
|
+
* Called with the new sort when a sortable header is activated, then `details` (`{ event }`).
|
|
3787
|
+
* With `items`, the grid orders its rows by the sorted column's `compare` (see
|
|
3788
|
+
* `DataGridColumn.compare`); otherwise the consumer orders them.
|
|
3048
3789
|
*/
|
|
3049
|
-
onSortChange?: (sort: DataGridSort) => void;
|
|
3790
|
+
onSortChange?: (sort: DataGridSort, details?: DataGridSortChangeDetails) => void;
|
|
3050
3791
|
}
|
|
3051
3792
|
|
|
3052
3793
|
/**
|
|
@@ -3387,6 +4128,12 @@ export declare interface DatePickerProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
3387
4128
|
/** A day of the week, as `Date.prototype.getDay()` numbers them: 0 is Sunday, 6 is Saturday. */
|
|
3388
4129
|
export declare type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3389
4130
|
|
|
4131
|
+
/**
|
|
4132
|
+
* The 0.5 spellings of two presence statuses. They still work and warn once in development; use
|
|
4133
|
+
* `'do-not-disturb'` and `'out-of-office'` instead. Removed in 1.0.
|
|
4134
|
+
*/
|
|
4135
|
+
export declare type DeprecatedPresenceStatus = 'dnd' | 'oof';
|
|
4136
|
+
|
|
3390
4137
|
/**
|
|
3391
4138
|
* A dialog (Fluent UI v2 style), modal by default: `Dialog` holds the open state; `Dialog.Trigger`
|
|
3392
4139
|
* opens and closes it and `Dialog.Content` renders the surface in a portal while open (and, with
|
|
@@ -5258,6 +6005,38 @@ export declare function getFirstTabbable(container: Element, options?: {
|
|
|
5258
6005
|
includeContainer?: boolean;
|
|
5259
6006
|
}): HTMLElement | null;
|
|
5260
6007
|
|
|
6008
|
+
/**
|
|
6009
|
+
* The initials of a person's name, for an avatar: the first letter of the first and, with two or
|
|
6010
|
+
* more words, of the last word, upper-cased.
|
|
6011
|
+
*
|
|
6012
|
+
* Text in `()`, `[]`, `{}` and `<>` and all punctuation are ignored (`'Jane Doe (Contoso)'` gives
|
|
6013
|
+
* `'JD'`). A name with no letters (a phone number, an emoji) or with letters of a script without
|
|
6014
|
+
* letter initials (Han, Hiragana, Katakana, Hangul, Thai, Lao, Khmer, Myanmar, Tibetan) gives
|
|
6015
|
+
* `''`, so an avatar falls back to its person glyph. Server-safe.
|
|
6016
|
+
*
|
|
6017
|
+
* @example
|
|
6018
|
+
* getInitials('Jane Doe (Contoso)'); // 'JD'
|
|
6019
|
+
* getInitials('Jane Doe', { dir: 'rtl' }); // 'DJ'
|
|
6020
|
+
* getInitials('+1 (555) 010-0000'); // ''
|
|
6021
|
+
*/
|
|
6022
|
+
export declare function getInitials(name: string, options?: GetInitialsOptions): string;
|
|
6023
|
+
|
|
6024
|
+
/** Options of {@link getInitials}. */
|
|
6025
|
+
export declare interface GetInitialsOptions {
|
|
6026
|
+
/**
|
|
6027
|
+
* Text direction of the place the initials are shown. In `'rtl'` the first and last initial of a
|
|
6028
|
+
* left-to-right script swap, so they read in the order of the name on screen; a Hebrew or Arabic
|
|
6029
|
+
* name keeps its order, which the text direction already mirrors.
|
|
6030
|
+
* @default 'ltr'
|
|
6031
|
+
*/
|
|
6032
|
+
dir?: 'ltr' | 'rtl';
|
|
6033
|
+
/**
|
|
6034
|
+
* Keep only the first initial, also for a name of several words.
|
|
6035
|
+
* @default false
|
|
6036
|
+
*/
|
|
6037
|
+
firstInitialOnly?: boolean;
|
|
6038
|
+
}
|
|
6039
|
+
|
|
5261
6040
|
/** The last tabbable element inside `container`, or `null`. */
|
|
5262
6041
|
export declare function getLastTabbable(container: Element, options?: {
|
|
5263
6042
|
includeContainer?: boolean;
|
|
@@ -6092,6 +6871,13 @@ export declare interface InteractionTagSecondaryProps extends React_2.ButtonHTML
|
|
|
6092
6871
|
/** Whether both dates are on the same calendar day (time of day ignored); `false` when either is missing. */
|
|
6093
6872
|
export declare function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean;
|
|
6094
6873
|
|
|
6874
|
+
/**
|
|
6875
|
+
* Whether breadcrumb text is longer than `maxLength` characters, so that
|
|
6876
|
+
* {@link truncateBreadcrumbLongName} or {@link truncateBreadcrumbLongTooltip} would cut it. Text of
|
|
6877
|
+
* exactly `maxLength` characters is not truncatable.
|
|
6878
|
+
*/
|
|
6879
|
+
export declare function isTruncatableBreadcrumbContent(content: string, maxLength: number): boolean;
|
|
6880
|
+
|
|
6095
6881
|
/**
|
|
6096
6882
|
* A text label for a form control (`htmlFor`), on the Fluent type ramp. The optional required
|
|
6097
6883
|
* indicator is decorative (`aria-hidden`). `Field` renders its own label; use `Label` for custom
|
|
@@ -6246,16 +7032,28 @@ export declare type LinkVariant = LinkAppearance;
|
|
|
6246
7032
|
* a text-entry widget takes focus itself: Enter/F2 enter the widget, Escape returns to the cell.
|
|
6247
7033
|
* Clicks and keys that start inside an action, or inside a popup it opens (a Popover, a Menu),
|
|
6248
7034
|
* never toggle selection.
|
|
7035
|
+
* - **Navigation without selection** (`navigationMode`): `'items'` makes the items of a plain list
|
|
7036
|
+
* one Tab stop (the item that last had focus) with the listbox's arrow keys, Home/End and
|
|
7037
|
+
* typeahead, keeping `role="list"`; `'composite'` renders the grid above from the first render,
|
|
7038
|
+
* for a selectable list too, so the items never remount when actions appear. The items of a
|
|
7039
|
+
* list without selection carry no `aria-selected`. The resolved mode is `data-navigation-mode`.
|
|
7040
|
+
* - **Actions on the item itself** (`List.Item onAction`): clicks and Enter run it, and Space on
|
|
7041
|
+
* an item that cannot be selected; in a selectable item it runs before the selection toggles,
|
|
7042
|
+
* and its `preventDefault()` keeps the selection. `List.Item disabledSelection` keeps an item's
|
|
7043
|
+
* selection as it is while the item stays focusable and in the arrow-key order.
|
|
7044
|
+
* - **Check marks** (`checkmark`, opt-in): a decorative check at the start of every item of a
|
|
7045
|
+
* selectable list, shown while the item is selected; `List.Item checkmark` replaces or hides it.
|
|
6249
7046
|
* - **Switching semantics remounts the items.** Listbox/list and grid use different elements
|
|
6250
7047
|
* (`ul`/`li` and `div`), so when a selectable list gains its first item action, loses its last
|
|
6251
|
-
* one, or `selectable`
|
|
6252
|
-
* content: state inside them (an inline rename input's draft, an uncontrolled checkbox) is
|
|
6253
|
-
* Focus that is on an item or inside it when the list switches moves to the same item (by
|
|
6254
|
-
* `value`, else by position; the next item when the focused one was removed),
|
|
6255
|
-
*
|
|
6256
|
-
*
|
|
6257
|
-
*
|
|
6258
|
-
*
|
|
7048
|
+
* one, or `selectable` or `navigationMode` changes the structure, React remounts the items and
|
|
7049
|
+
* their content: state inside them (an inline rename input's draft, an uncontrolled checkbox) is
|
|
7050
|
+
* reset. Focus that is on an item or inside it when the list switches moves to the same item (by
|
|
7051
|
+
* `value`, else by position; the next item when the focused one was removed), or to its first
|
|
7052
|
+
* focusable content when the item is no Tab stop any more, so the switch never drops it to
|
|
7053
|
+
* `<body>`. This includes focus inside the last action when that action removes itself (an
|
|
7054
|
+
* inline rename input that unmounts on Enter). An action that removes itself while focused
|
|
7055
|
+
* without causing a switch drops focus, like any removed element. When the list may switch,
|
|
7056
|
+
* keep such state in the parent, or pin the grid with `navigationMode="composite"`.
|
|
6259
7057
|
* - Selection: `selectionMode` `'single'` (default) or `'multiple'`; controlled with
|
|
6260
7058
|
* `selectedItems` (or `selectedItem` in single mode) or uncontrolled with the `default*` props.
|
|
6261
7059
|
* Values of items that are no longer rendered are dropped from the reported selection.
|
|
@@ -6266,13 +7064,19 @@ export declare type LinkVariant = LinkAppearance;
|
|
|
6266
7064
|
* <List.Item value="apple">Apple</List.Item>
|
|
6267
7065
|
* <List.Item value="banana">Banana</List.Item>
|
|
6268
7066
|
* </List>
|
|
7067
|
+
*
|
|
7068
|
+
* @example
|
|
7069
|
+
* <List navigationMode="items" aria-label="Recent files">
|
|
7070
|
+
* <List.Item value="report" onAction={() => open('report')}>Report</List.Item>
|
|
7071
|
+
* <List.Item value="budget" onAction={() => open('budget')}>Budget</List.Item>
|
|
7072
|
+
* </List>
|
|
6269
7073
|
*/
|
|
6270
7074
|
export declare const List: {
|
|
6271
7075
|
<M extends ListSelectionMode = "single">(props: ListProps<M>): React_2.ReactNode;
|
|
6272
7076
|
displayName: string;
|
|
6273
7077
|
} & {
|
|
6274
7078
|
Item: {
|
|
6275
|
-
({ value, action, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
7079
|
+
({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
6276
7080
|
displayName: string;
|
|
6277
7081
|
};
|
|
6278
7082
|
};
|
|
@@ -6770,26 +7574,32 @@ export declare const listClassNames: {
|
|
|
6770
7574
|
|
|
6771
7575
|
/**
|
|
6772
7576
|
* An item of a {@link List} (also available as `List.Item`). Renders an `<li>` (`listitem`, or
|
|
6773
|
-
* `option` in a selectable list), or a `<div role="row">` in a selectable list with
|
|
6774
|
-
* selectable list, Enter and Space toggle the
|
|
6775
|
-
* pointer clicks
|
|
7577
|
+
* `option` in a selectable list), or a `<div role="row">` in a grid (a selectable list with
|
|
7578
|
+
* actions, or `navigationMode="composite"`). In a selectable list, Enter and Space toggle the
|
|
7579
|
+
* selection without calling `onClick`, which receives pointer clicks; `onAction` runs on clicks
|
|
7580
|
+
* and Enter (and Space where the item cannot be selected), before the selection toggles.
|
|
6776
7581
|
*
|
|
6777
7582
|
* Exported under the flat name `ListItem` so React Server Components can import it; `List.Item`
|
|
6778
7583
|
* (dotted access) needs a client module.
|
|
6779
7584
|
*/
|
|
6780
7585
|
export declare const ListItem: {
|
|
6781
|
-
({ value, action, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
7586
|
+
({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
6782
7587
|
displayName: string;
|
|
6783
7588
|
};
|
|
6784
7589
|
|
|
7590
|
+
/** The event that activated a list item: a click, or Enter or Space on the focused item. */
|
|
7591
|
+
export declare type ListItemActionEvent = React_2.MouseEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement>;
|
|
7592
|
+
|
|
6785
7593
|
/**
|
|
6786
|
-
* List.Item: `root` on the `<li>` (the `role="row"` element of a list
|
|
6787
|
-
*
|
|
7594
|
+
* List.Item: `root` on the `<li>` (the `role="row"` element of a grid list); `content` on the
|
|
7595
|
+
* content element; `action` on the action cell; `checkmark` on the check mark element of an item
|
|
7596
|
+
* of a selectable list (the List's `checkmark`, or the item's own).
|
|
6788
7597
|
*/
|
|
6789
7598
|
export declare const listItemClassNames: {
|
|
6790
7599
|
readonly root: "wave-list-item";
|
|
6791
7600
|
readonly content: "wave-list-item__content";
|
|
6792
7601
|
readonly action: "wave-list-item__action";
|
|
7602
|
+
readonly checkmark: "wave-list-item__checkmark";
|
|
6793
7603
|
};
|
|
6794
7604
|
|
|
6795
7605
|
/** Properties for the ListItem component. */
|
|
@@ -6808,13 +7618,47 @@ export declare interface ListItemProps extends React_2.HTMLAttributes<HTMLLIElem
|
|
|
6808
7618
|
* with the arrow keys, and their focusable elements (also ones added later) get
|
|
6809
7619
|
* `tabindex="-1"`, except inside a nested composite widget such as a Toolbar, which keeps its own
|
|
6810
7620
|
* Tab stop. When the first action appears or the last one disappears, the items remount (see
|
|
6811
|
-
* {@link List}).
|
|
7621
|
+
* {@link List}), unless the List's `navigationMode="composite"` keeps the grid.
|
|
6812
7622
|
*/
|
|
6813
7623
|
action?: React_2.ReactNode;
|
|
7624
|
+
/**
|
|
7625
|
+
* Called when the item is activated: a click on it, or Enter on the focused item, and Space on
|
|
7626
|
+
* an item that cannot be selected (in a list without selection, or without a `value`); in a
|
|
7627
|
+
* selectable item Space only toggles the selection. Clicks and keys that start in an action or
|
|
7628
|
+
* in interactive content never run it. It runs after the item's `onClick` (whose
|
|
7629
|
+
* `preventDefault()` skips it) and before the selection toggles: call `event.preventDefault()`
|
|
7630
|
+
* to keep the selection as it is. Fires on every activation. The items of a list that does not
|
|
7631
|
+
* navigate them (`navigationMode` `'none'`, not selectable) cannot be reached with the keyboard:
|
|
7632
|
+
* there it runs on clicks only, and a development warning says so.
|
|
7633
|
+
*/
|
|
7634
|
+
onAction?: (event: ListItemActionEvent) => void;
|
|
7635
|
+
/**
|
|
7636
|
+
* In a selectable list: the item's selection cannot be toggled (click, Enter or Space; a
|
|
7637
|
+
* selected item stays selected). The item stays focusable and in the arrow-key order and renders
|
|
7638
|
+
* `data-disabled-selection`. Without `onAction` it is also `aria-disabled` (with `data-disabled`
|
|
7639
|
+
* and `data-disabled-focusable`); with `onAction`, clicks and Enter still run the action, while
|
|
7640
|
+
* Space, the selection key, does nothing. The item's `onClick` runs either way.
|
|
7641
|
+
* @default false
|
|
7642
|
+
*/
|
|
7643
|
+
disabledSelection?: boolean;
|
|
7644
|
+
/**
|
|
7645
|
+
* The item's check mark in a selectable list, a decorative `<span>` at the start of the item
|
|
7646
|
+
* shown while it is selected. `null` and `undefined` follow the List's `checkmark` (the default
|
|
7647
|
+
* check, or none); content replaces the glyph, also when the List draws none; `false`, or
|
|
7648
|
+
* content that renders nothing, hides it.
|
|
7649
|
+
*/
|
|
7650
|
+
checkmark?: Slot<'span'>;
|
|
6814
7651
|
/** Ref to the item element: an `<li>`, or a `<div role="row">` in grid mode. */
|
|
6815
7652
|
ref?: React_2.Ref<HTMLLIElement | HTMLDivElement>;
|
|
6816
7653
|
}
|
|
6817
7654
|
|
|
7655
|
+
/**
|
|
7656
|
+
* How the keyboard reaches the items of a {@link List} (Fluent's `navigationMode`): `'none'`, no
|
|
7657
|
+
* item is a Tab stop; `'items'`, the items are one Tab stop moved with the arrow keys; `'composite'`,
|
|
7658
|
+
* a grid whose rows are moved with Up/Down and whose actions are reached with Right/Left.
|
|
7659
|
+
*/
|
|
7660
|
+
export declare type ListNavigationMode = 'none' | 'items' | 'composite';
|
|
7661
|
+
|
|
6818
7662
|
/**
|
|
6819
7663
|
* Properties for the List component.
|
|
6820
7664
|
*
|
|
@@ -6850,9 +7694,39 @@ export declare interface ListProps<M extends ListSelectionMode = ListSelectionMo
|
|
|
6850
7694
|
defaultSelectedItem?: M extends 'single' ? string | null : never;
|
|
6851
7695
|
/** Single mode: called with the newly selected value, or `null` when it was deselected. */
|
|
6852
7696
|
onSelectedItemChange?: M extends 'single' ? (item: string | null) => void : never;
|
|
7697
|
+
/**
|
|
7698
|
+
* How the keyboard reaches the items. Unset, the list picks the mode itself: `'none'` for a plain
|
|
7699
|
+
* list, `'items'` for a selectable one (a listbox) and `'composite'` (a grid) for a selectable
|
|
7700
|
+
* list whose items have actions, which remounts the items when the first action appears or the
|
|
7701
|
+
* last one disappears. An explicit value pins the structure:
|
|
7702
|
+
*
|
|
7703
|
+
* - `'none'`: a plain list; its items are no Tab stops (their actions stay in the Tab order). A
|
|
7704
|
+
* selectable list always navigates its items: there `'none'` is ignored, with a development
|
|
7705
|
+
* warning.
|
|
7706
|
+
* - `'items'`: the items are one Tab stop (the first selected item, else the first item; in a
|
|
7707
|
+
* list without selection the item that last had focus), moved with ArrowUp/ArrowDown (wrapping)
|
|
7708
|
+
* and Home/End, with typeahead for more than 7 items. A plain list keeps `role="list"` and its
|
|
7709
|
+
* items carry no `aria-selected`; their actions stay in the Tab order. A selectable list whose
|
|
7710
|
+
* items have actions acts as `'composite'`, with a development warning.
|
|
7711
|
+
* - `'composite'`: a grid (`role="grid"`, `row`s and `gridcell`s) from the first render, so the
|
|
7712
|
+
* items never remount when actions appear. One Tab stop; Up/Down move between the rows and
|
|
7713
|
+
* Right/Left (mirrored in right-to-left layouts) into and out of their actions, which leave
|
|
7714
|
+
* the Tab order. The rows of a list without selection carry no `aria-selected`.
|
|
7715
|
+
*
|
|
7716
|
+
* The resolved mode is rendered as `data-navigation-mode`. Changing it while mounted can switch
|
|
7717
|
+
* between `ul`/`li` and `div` elements, which remounts the items (see {@link List}).
|
|
7718
|
+
*/
|
|
7719
|
+
navigationMode?: ListNavigationMode;
|
|
7720
|
+
/**
|
|
7721
|
+
* Draws a check mark at the start of every item of a selectable list, shown while the item is
|
|
7722
|
+
* selected (decorative: `aria-selected` carries the state). An item's own `checkmark` replaces
|
|
7723
|
+
* or hides it. Renders `data-checkmark` on the list while it draws them.
|
|
7724
|
+
* @default false
|
|
7725
|
+
*/
|
|
7726
|
+
checkmark?: boolean;
|
|
6853
7727
|
/**
|
|
6854
7728
|
* Ref to the root element: a `<ul>`, or a `<div role="grid">` for a selectable list whose items
|
|
6855
|
-
* have actions
|
|
7729
|
+
* have actions and for `navigationMode="composite"`.
|
|
6856
7730
|
*/
|
|
6857
7731
|
ref?: React_2.Ref<HTMLUListElement | HTMLDivElement>;
|
|
6858
7732
|
}
|
|
@@ -8959,19 +9833,36 @@ export declare interface OptionProps extends Omit<React_2.LiHTMLAttributes<HTMLL
|
|
|
8959
9833
|
export declare type Orientation = 'horizontal' | 'vertical';
|
|
8960
9834
|
|
|
8961
9835
|
/**
|
|
8962
|
-
* A single row that hides the items which do not fit and shows an overflow button
|
|
8963
|
-
*
|
|
8964
|
-
*
|
|
8965
|
-
*
|
|
8966
|
-
* (
|
|
8967
|
-
*
|
|
8968
|
-
*
|
|
8969
|
-
*
|
|
8970
|
-
*
|
|
8971
|
-
*
|
|
8972
|
-
*
|
|
8973
|
-
*
|
|
8974
|
-
*
|
|
9836
|
+
* A single row (or column) that hides the items which do not fit and shows an overflow button
|
|
9837
|
+
* instead.
|
|
9838
|
+
*
|
|
9839
|
+
* Wrap each entry in {@link OverflowItem} with a unique `itemId`; the row holds only items and
|
|
9840
|
+
* {@link OverflowDivider}s (other content is not measured, see `children`). Items are measured
|
|
9841
|
+
* while visible and hidden while they do not fit: by ascending `priority` (equal priorities from
|
|
9842
|
+
* the end of the DOM order, or from its start with `overflowDirection="start"`), never a `pinned`
|
|
9843
|
+
* item and never below `minimumVisible`. Until an item sets `priority` or `pinned`, the first item
|
|
9844
|
+
* (`end`) or the last one (`start`) always stays, as in 0.13. `orientation="vertical"` lays the
|
|
9845
|
+
* items out in a column and measures heights; the column needs a definite height. The room is the
|
|
9846
|
+
* row's own box, so it must not depend on the items shown: in a container as wide as its content,
|
|
9847
|
+
* such as a Toolbar at its default width, the row narrows as items hide and never gets the room
|
|
9848
|
+
* back to show them again; give the Overflow a width of its own, or put it in a row that takes its
|
|
9849
|
+
* width from its parent and let it fill that row.
|
|
9850
|
+
*
|
|
9851
|
+
* Items with the same `groupId` form a group that is `'visible'`, `'hidden'` or `'overflow'` (some
|
|
9852
|
+
* members hidden): a divider with that `groupId` hides with a hidden group,
|
|
9853
|
+
* {@link useIsOverflowGroupVisible} reads a group and {@link useHasHiddenItems} whether anything
|
|
9854
|
+
* is hidden. `onOverflowChange` reports the hidden `itemId`s and the group visibility when the
|
|
9855
|
+
* hidden items change. Hidden items get `data-overflow-hidden`, an inline `display: none`,
|
|
9856
|
+
* `aria-hidden` and `inert`. Reordered items (for example a keyed sort) are re-measured in their
|
|
9857
|
+
* new order. `overflowButton(count, hiddenIds)` renders the button after the visible items, or
|
|
9858
|
+
* just before the first hidden item with `buttonPosition="before-hidden"` (its measured size is
|
|
9859
|
+
* reserved); components inside it can use {@link useOverflowMenu} to list the
|
|
9860
|
+
* hidden items (e.g. in a Menu), and {@link useIsOverflowItemVisible} reports a single item. In a
|
|
9861
|
+
* horizontal row the button sticks to the inline end, so a first item wider than the room beside
|
|
9862
|
+
* it cannot push it out of view: it then covers the end of that item and gets
|
|
9863
|
+
* `data-overflow-pinned`, with the `background` token behind it (a vertical column sticks it to
|
|
9864
|
+
* the bottom). (In a right-to-left row, WebKit stops the pinned button short of the end, still
|
|
9865
|
+
* inside the row.)
|
|
8975
9866
|
*
|
|
8976
9867
|
* The row clips what does not fit. So that the focus indicators of its items are not cut off, it
|
|
8977
9868
|
* has a 4px padding: the items sit 4px in from its edges, and the row is 8px taller than they are.
|
|
@@ -8985,19 +9876,36 @@ export declare type Orientation = 'horizontal' | 'vertical';
|
|
|
8985
9876
|
* Works without `ResizeObserver` (jsdom, old browsers): it then re-measures on window resize and
|
|
8986
9877
|
* when items mount, unmount or move.
|
|
8987
9878
|
*
|
|
8988
|
-
* The item is also `Overflow.Item
|
|
8989
|
-
*
|
|
9879
|
+
* The item is also `Overflow.Item` and the divider `Overflow.Divider`. The same components are
|
|
9880
|
+
* exported as `OverflowItem` and `OverflowDivider`; React Server Components import those flat names
|
|
9881
|
+
* (dotted access needs a client file).
|
|
8990
9882
|
*/
|
|
8991
9883
|
export declare const Overflow: {
|
|
8992
|
-
({ overflowButton, children, className, ref, ...rest }: OverflowProps): React_2.JSX.Element;
|
|
9884
|
+
({ overflowButton, buttonPosition, overflowDirection, orientation, minimumVisible, hasHiddenItems, onOverflowChange, children, className, ref, ...rest }: OverflowProps): React_2.JSX.Element;
|
|
8993
9885
|
displayName: string;
|
|
8994
9886
|
} & {
|
|
8995
9887
|
Item: {
|
|
8996
|
-
({ itemId, children, className, style, ref, "aria-hidden": ariaHidden, inert, ...rest }: OverflowItemProps): React_2.JSX.Element;
|
|
9888
|
+
({ itemId, priority, pinned, groupId, asChild, children, className, style, ref, "aria-hidden": ariaHidden, inert, ...rest }: OverflowItemProps): React_2.JSX.Element;
|
|
9889
|
+
displayName: string;
|
|
9890
|
+
};
|
|
9891
|
+
Divider: {
|
|
9892
|
+
({ groupId, children, className, style, ref, "aria-hidden": ariaHidden, inert, ...rest }: OverflowDividerProps): React_2.JSX.Element;
|
|
8997
9893
|
displayName: string;
|
|
8998
9894
|
};
|
|
8999
9895
|
};
|
|
9000
9896
|
|
|
9897
|
+
/** What {@link OverflowProps.onOverflowChange} reports besides the hidden ids. */
|
|
9898
|
+
export declare interface OverflowChangeDetails {
|
|
9899
|
+
/** `itemId`s of the shown items, in DOM order. */
|
|
9900
|
+
visibleItems: string[];
|
|
9901
|
+
/**
|
|
9902
|
+
* The visibility of each item group, by `groupId` (only groups with an item; a record without a
|
|
9903
|
+
* prototype): `'visible'` when every member is shown, `'hidden'` when none is, `'overflow'` for
|
|
9904
|
+
* a mix.
|
|
9905
|
+
*/
|
|
9906
|
+
groupVisibility: Record<string, OverflowGroupVisibility>;
|
|
9907
|
+
}
|
|
9908
|
+
|
|
9001
9909
|
/**
|
|
9002
9910
|
* Overflow: `root` on the overflow element; `overflowButton` on the element around what
|
|
9003
9911
|
* `overflowButton` renders.
|
|
@@ -9008,52 +9916,186 @@ export declare const overflowClassNames: {
|
|
|
9008
9916
|
};
|
|
9009
9917
|
|
|
9010
9918
|
/**
|
|
9011
|
-
*
|
|
9012
|
-
*
|
|
9013
|
-
* `aria-hidden` and `inert`. The inline style wins over the consumer's `style.display` and over
|
|
9014
|
-
* display utilities in any cascade layer (a prefixed Tailwind app's `tw:flex` included), so a
|
|
9015
|
-
* hidden item is never shown while it is counted in "+N". Must be rendered inside `Overflow`.
|
|
9919
|
+
* Which end of the row overflows first: `'end'` hides the last items in DOM order first, `'start'`
|
|
9920
|
+
* the first ones. Equal priorities follow it.
|
|
9016
9921
|
*/
|
|
9017
|
-
export declare
|
|
9018
|
-
|
|
9922
|
+
export declare type OverflowDirection = 'end' | 'start';
|
|
9923
|
+
|
|
9924
|
+
/**
|
|
9925
|
+
* A divider between item groups of an {@link Overflow}, drawn by its children (for example a
|
|
9926
|
+
* vertical `Divider` or a `Toolbar.Divider`). It renders a `<div>` that stretches across the row
|
|
9927
|
+
* (to the row's height, or to a vertical column's width) and lays out its child on that axis, so
|
|
9928
|
+
* a child that stretches itself, such as `Toolbar.Divider`, spans the row; an explicitly sized
|
|
9929
|
+
* child is centred in a row and kept at the start of a column. It is measured like an item and
|
|
9930
|
+
* hidden, with `data-overflow-hidden`, an inline `display: none`, `aria-hidden` and `inert`, while
|
|
9931
|
+
* the group `groupId` is `'hidden'` (none of its items is shown). Must be rendered inside
|
|
9932
|
+
* `Overflow`.
|
|
9933
|
+
*/
|
|
9934
|
+
export declare const OverflowDivider: {
|
|
9935
|
+
({ groupId, children, className, style, ref, "aria-hidden": ariaHidden, inert, ...rest }: OverflowDividerProps): React_2.JSX.Element;
|
|
9019
9936
|
displayName: string;
|
|
9020
9937
|
};
|
|
9021
9938
|
|
|
9022
|
-
/** Overflow.
|
|
9023
|
-
export declare const
|
|
9024
|
-
readonly root: "wave-overflow-
|
|
9939
|
+
/** Overflow.Divider: `root` on the divider element. */
|
|
9940
|
+
export declare const overflowDividerClassNames: {
|
|
9941
|
+
readonly root: "wave-overflow-divider";
|
|
9025
9942
|
};
|
|
9026
9943
|
|
|
9027
|
-
/** Properties for the
|
|
9028
|
-
export declare interface
|
|
9944
|
+
/** Properties for the OverflowDivider sub-component. */
|
|
9945
|
+
export declare interface OverflowDividerProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
9946
|
+
/**
|
|
9947
|
+
* The group the divider belongs to: it is hidden while that group is `'hidden'` and takes room
|
|
9948
|
+
* in the row otherwise. A group without items counts as visible.
|
|
9949
|
+
*/
|
|
9950
|
+
groupId: string;
|
|
9951
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
9952
|
+
}
|
|
9953
|
+
|
|
9954
|
+
/**
|
|
9955
|
+
* How much of an item group is shown: `'visible'` (every member), `'hidden'` (none) or `'overflow'`
|
|
9956
|
+
* (some).
|
|
9957
|
+
*/
|
|
9958
|
+
export declare type OverflowGroupVisibility = 'visible' | 'hidden' | 'overflow';
|
|
9959
|
+
|
|
9960
|
+
/**
|
|
9961
|
+
* One entry of an {@link Overflow}. `priority` (higher overflows later, default 0) or `pinned`
|
|
9962
|
+
* (never overflows) decide when it hides; setting either on any item makes every item without
|
|
9963
|
+
* `pinned` hidable, the first one included. `groupId` puts it in a group that an
|
|
9964
|
+
* {@link OverflowDivider} and {@link useIsOverflowGroupVisible} follow. While it does not fit it
|
|
9965
|
+
* stays mounted but is hidden (`data-overflow-hidden` and an inline `display: none` placed after
|
|
9966
|
+
* the consumer's own `style`), `aria-hidden` and `inert`. The inline style wins over the
|
|
9967
|
+
* consumer's `style.display` and over display utilities in any cascade layer (a prefixed Tailwind
|
|
9968
|
+
* app's `tw:flex` included), so a hidden item is never shown while it is counted in "+N". With
|
|
9969
|
+
* `asChild` the item renders no wrapper: its props are merged onto its single element child.
|
|
9970
|
+
* Must be rendered inside `Overflow`.
|
|
9971
|
+
*/
|
|
9972
|
+
export declare const OverflowItem: {
|
|
9973
|
+
({ itemId, priority, pinned, groupId, asChild, children, className, style, ref, "aria-hidden": ariaHidden, inert, ...rest }: OverflowItemProps): React_2.JSX.Element;
|
|
9974
|
+
displayName: string;
|
|
9975
|
+
};
|
|
9976
|
+
|
|
9977
|
+
/** The props of an {@link OverflowItem} besides `priority` and `pinned`. */
|
|
9978
|
+
export declare interface OverflowItemBaseProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
9029
9979
|
/**
|
|
9030
9980
|
* Identifier for tracking this item's overflow visibility, unique within the Overflow (a
|
|
9031
9981
|
* duplicate warns in development: items that share one are hidden and shown together).
|
|
9032
9982
|
*/
|
|
9033
9983
|
itemId: string;
|
|
9034
|
-
/**
|
|
9984
|
+
/**
|
|
9985
|
+
* The group the item belongs to. A group is `'visible'`, `'hidden'` or `'overflow'` (some members
|
|
9986
|
+
* hidden); an {@link OverflowDivider} with the same `groupId` hides with a hidden group, and
|
|
9987
|
+
* {@link useIsOverflowGroupVisible} reads it.
|
|
9988
|
+
*/
|
|
9989
|
+
groupId?: string;
|
|
9990
|
+
/**
|
|
9991
|
+
* Puts the item's props on its single element child (an `<li>`, a Toolbar button) instead of on
|
|
9992
|
+
* a wrapper `<div>`: handlers and refs are composed with the child's, classes and styles merged,
|
|
9993
|
+
* and the hidden state (`data-overflow-hidden`, `display: none`, `aria-hidden`, `inert`) wins
|
|
9994
|
+
* over the child's own. A child that is not a single element (text, several elements) renders in
|
|
9995
|
+
* the wrapper `<div>` and warns in development.
|
|
9996
|
+
* @default false
|
|
9997
|
+
*/
|
|
9998
|
+
asChild?: boolean;
|
|
9999
|
+
/** Content of the overflow item: with `asChild`, the single element that takes its props. */
|
|
9035
10000
|
children: React_2.ReactNode;
|
|
9036
10001
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
9037
10002
|
}
|
|
9038
10003
|
|
|
10004
|
+
/** Overflow.Item: `root` on the item element. */
|
|
10005
|
+
export declare const overflowItemClassNames: {
|
|
10006
|
+
readonly root: "wave-overflow-item";
|
|
10007
|
+
};
|
|
10008
|
+
|
|
10009
|
+
/**
|
|
10010
|
+
* An item hides in ascending `priority` (higher overflows later, default 0), or it is `pinned` and
|
|
10011
|
+
* never hides: `priority` or `pinned`, never both.
|
|
10012
|
+
*/
|
|
10013
|
+
export declare type OverflowItemPriorityProps = {
|
|
10014
|
+
/**
|
|
10015
|
+
* Items with a lower priority overflow first; equal priorities follow the direction.
|
|
10016
|
+
* @default 0
|
|
10017
|
+
*/
|
|
10018
|
+
priority?: number;
|
|
10019
|
+
pinned?: never;
|
|
10020
|
+
} | {
|
|
10021
|
+
/**
|
|
10022
|
+
* The item never overflows. Pinning any item drops the 0.13 protection of the first item for
|
|
10023
|
+
* the whole row; `pinned={false}` alone keeps it.
|
|
10024
|
+
* @default false
|
|
10025
|
+
*/
|
|
10026
|
+
pinned?: boolean;
|
|
10027
|
+
priority?: never;
|
|
10028
|
+
};
|
|
10029
|
+
|
|
10030
|
+
/** Properties for the OverflowItem sub-component. */
|
|
10031
|
+
export declare type OverflowItemProps = OverflowItemBaseProps & OverflowItemPriorityProps;
|
|
10032
|
+
|
|
9039
10033
|
/** Properties for the Overflow component. */
|
|
9040
10034
|
export declare interface OverflowProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
9041
10035
|
/**
|
|
9042
10036
|
* Renders the overflow button (for example a "+3" menu trigger) while at least one item is
|
|
9043
10037
|
* hidden. Receives the number of hidden items and their `itemId`s in DOM order, so the button
|
|
9044
10038
|
* can open a menu of the hidden items. `hiddenIds` is the button's own array (sorting it in
|
|
9045
|
-
* place affects nobody else). Its width
|
|
10039
|
+
* place affects nobody else). Its size on the row's axis (width, or height for a vertical row)
|
|
10040
|
+
* is measured and reserved when items overflow. In a list row (`role="list"`, with `asChild`
|
|
10041
|
+
* `<li>` items) the button's wrapper is a list item (`role="listitem"`).
|
|
9046
10042
|
* Components rendered by it can also read the hidden items with {@link useOverflowMenu}.
|
|
9047
10043
|
*/
|
|
9048
10044
|
overflowButton?: (count: number, hiddenIds: string[]) => React_2.ReactNode;
|
|
9049
10045
|
/**
|
|
9050
|
-
* The {@link OverflowItem}s to lay out in one row
|
|
9051
|
-
* measured: the container's whole content box
|
|
9052
|
-
* the row is not accounted for and could clip
|
|
9053
|
-
* content outside the Overflow (for example in a
|
|
9054
|
-
* `OverflowItem`
|
|
10046
|
+
* The {@link OverflowItem}s (and {@link OverflowDivider}s) to lay out in one row or column.
|
|
10047
|
+
* Only items, dividers and the overflow button are measured: the container's whole content box
|
|
10048
|
+
* is the room for them, so other content placed in the row is not accounted for and could clip
|
|
10049
|
+
* items that still count as visible. Keep fixed content outside the Overflow (for example in a
|
|
10050
|
+
* surrounding flex row), or wrap it in an `OverflowItem` and pin it with `pinned`.
|
|
9055
10051
|
*/
|
|
9056
10052
|
children: React_2.ReactNode;
|
|
10053
|
+
/**
|
|
10054
|
+
* Which end of the row overflows first (`start` is the start of the DOM order, so the right side
|
|
10055
|
+
* of a right-to-left row). While no item sets `priority` or `pinned` (`pinned={false}` does not
|
|
10056
|
+
* count) the first item (`end`) or the last one (`start`) is never hidden, as in 0.13; once any
|
|
10057
|
+
* item pins itself or sets a priority, only `pinned` items are protected, the first one included.
|
|
10058
|
+
* @default 'end'
|
|
10059
|
+
*/
|
|
10060
|
+
overflowDirection?: OverflowDirection;
|
|
10061
|
+
/**
|
|
10062
|
+
* Where the overflow button goes while items are hidden: `'end'` after every item, sticking to
|
|
10063
|
+
* the end of the axis; `'before-hidden'` just before the first hidden item in DOM order, so it
|
|
10064
|
+
* stands in for the hidden items (a breadcrumb trail), and takes the row's gap as the items do.
|
|
10065
|
+
* With `'before-hidden'` the items must be children of the Overflow (Fragments and arrays are
|
|
10066
|
+
* opened): when the first hidden item is rendered by another component the button stays at the
|
|
10067
|
+
* end, with a development warning. The button moves without remounting. While nothing is
|
|
10068
|
+
* hidden there is no button, except the one `hasHiddenItems` reserves, at the end.
|
|
10069
|
+
* @default 'end'
|
|
10070
|
+
*/
|
|
10071
|
+
buttonPosition?: 'end' | 'before-hidden';
|
|
10072
|
+
/**
|
|
10073
|
+
* The axis items are laid out on. `'vertical'` stacks them in a column and measures heights
|
|
10074
|
+
* (Fluent's `overflowAxis`); the column needs a definite height (a `height`, or a flex or grid
|
|
10075
|
+
* cell with one), since it has no room to measure otherwise.
|
|
10076
|
+
* @default 'horizontal'
|
|
10077
|
+
*/
|
|
10078
|
+
orientation?: Orientation;
|
|
10079
|
+
/**
|
|
10080
|
+
* The number of items that stay visible however little room there is (pinned items count).
|
|
10081
|
+
* @default 0
|
|
10082
|
+
*/
|
|
10083
|
+
minimumVisible?: number;
|
|
10084
|
+
/**
|
|
10085
|
+
* Renders the overflow button before the first measurement (for example in the server HTML) so
|
|
10086
|
+
* the row reserves its room; `overflowButton` then receives `0` and `[]`. It goes away after the
|
|
10087
|
+
* first measurement when every item fits.
|
|
10088
|
+
* @default false
|
|
10089
|
+
*/
|
|
10090
|
+
hasHiddenItems?: boolean;
|
|
10091
|
+
/**
|
|
10092
|
+
* Called, from an effect, when the set of hidden items changes (not for the initial, empty set),
|
|
10093
|
+
* with the hidden `itemId`s in DOM order and the {@link OverflowChangeDetails}. Called once per
|
|
10094
|
+
* change in StrictMode, and only for a set that has been rendered. The Overflow always passes
|
|
10095
|
+
* `details`; it is typed optional until 1.0, as the second argument of every callback is, so a
|
|
10096
|
+
* handler of the hidden ids alone fits.
|
|
10097
|
+
*/
|
|
10098
|
+
onOverflowChange?: (hiddenItems: string[], details?: OverflowChangeDetails) => void;
|
|
9057
10099
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
9058
10100
|
}
|
|
9059
10101
|
|
|
@@ -9157,17 +10199,96 @@ export declare interface PaginationProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
9157
10199
|
}
|
|
9158
10200
|
|
|
9159
10201
|
/**
|
|
9160
|
-
*
|
|
9161
|
-
*
|
|
10202
|
+
* Splits the items of an AvatarGroup into the ones shown inline and the ones in the overflow list.
|
|
10203
|
+
* `AvatarGroup` uses it for `max`; use it yourself to render `AvatarGroup.Item`s and
|
|
10204
|
+
* `AvatarGroup.Popover` from your own list. Server-safe: it imports nothing.
|
|
10205
|
+
*
|
|
10206
|
+
* @example
|
|
10207
|
+
* const { inlineItems, overflowItems } = partitionAvatarGroupItems({ items: people, maxInlineItems: 4 });
|
|
10208
|
+
*/
|
|
10209
|
+
export declare function partitionAvatarGroupItems<T>({ items, maxInlineItems, layout, }: PartitionAvatarGroupItemsOptions<T>): PartitionAvatarGroupItemsResult<T>;
|
|
10210
|
+
|
|
10211
|
+
/** Options of {@link partitionAvatarGroupItems}. */
|
|
10212
|
+
export declare interface PartitionAvatarGroupItemsOptions<T> {
|
|
10213
|
+
/** All the items of the group. */
|
|
10214
|
+
items: readonly T[];
|
|
10215
|
+
/**
|
|
10216
|
+
* How many items are shown inline; the rest go to the overflow. A fraction is rounded down, `0`
|
|
10217
|
+
* or a negative value shows none, and `undefined` or `NaN` shows all (up to the layout's cap).
|
|
10218
|
+
*/
|
|
10219
|
+
maxInlineItems?: number;
|
|
10220
|
+
/**
|
|
10221
|
+
* The layout of the group. A `pie` shows at most three items inline.
|
|
10222
|
+
* @default 'stack'
|
|
10223
|
+
*/
|
|
10224
|
+
layout?: AvatarGroupLayout;
|
|
10225
|
+
}
|
|
10226
|
+
|
|
10227
|
+
/** Result of {@link partitionAvatarGroupItems}. */
|
|
10228
|
+
export declare interface PartitionAvatarGroupItemsResult<T> {
|
|
10229
|
+
/** The items shown inline, in order. */
|
|
10230
|
+
inlineItems: T[];
|
|
10231
|
+
/** The items in the overflow list, in order; `undefined` when nothing overflows. */
|
|
10232
|
+
overflowItems: T[] | undefined;
|
|
10233
|
+
}
|
|
10234
|
+
|
|
10235
|
+
/**
|
|
10236
|
+
* Splits a breadcrumb trail into the items shown before a collapse button, the items it hides and
|
|
10237
|
+
* the items shown after it, with the rules of Fluent UI's `partitionBreadcrumbItems`: it hides
|
|
10238
|
+
* `items.length - maxDisplayedItems` items starting at `overflowIndex`. A trail with no more items
|
|
10239
|
+
* than `maxDisplayedItems` is not split: all items are in `startDisplayedItems`, and the other two
|
|
10240
|
+
* lists are absent. The function is pure and server-safe.
|
|
10241
|
+
*
|
|
10242
|
+
* @example
|
|
10243
|
+
* const { startDisplayedItems, overflowItems, endDisplayedItems } = partitionBreadcrumbItems({
|
|
10244
|
+
* items: crumbs,
|
|
10245
|
+
* maxDisplayedItems: 4,
|
|
10246
|
+
* });
|
|
10247
|
+
*/
|
|
10248
|
+
export declare function partitionBreadcrumbItems<T>(options: PartitionBreadcrumbItemsOptions<T>): PartitionBreadcrumbItemsResult<T>;
|
|
10249
|
+
|
|
10250
|
+
/** Options of {@link partitionBreadcrumbItems}. */
|
|
10251
|
+
export declare interface PartitionBreadcrumbItemsOptions<T> {
|
|
10252
|
+
/** The trail, in order. Not changed. */
|
|
10253
|
+
items: readonly T[];
|
|
10254
|
+
/**
|
|
10255
|
+
* The most items shown, the collapse button not counted. A missing, zero, negative or non-numeric
|
|
10256
|
+
* value falls back to 6.
|
|
10257
|
+
* @default 6
|
|
10258
|
+
*/
|
|
10259
|
+
maxDisplayedItems?: number;
|
|
10260
|
+
/**
|
|
10261
|
+
* The index of the first hidden item. An index at or past `maxDisplayedItems` becomes
|
|
10262
|
+
* `maxDisplayedItems - 1`; a negative index becomes 0.
|
|
10263
|
+
* @default 1
|
|
10264
|
+
*/
|
|
10265
|
+
overflowIndex?: number;
|
|
10266
|
+
}
|
|
10267
|
+
|
|
10268
|
+
/** The result of {@link partitionBreadcrumbItems}. */
|
|
10269
|
+
export declare interface PartitionBreadcrumbItemsResult<T> {
|
|
10270
|
+
/** The items before the collapsed ones; the whole trail when nothing is hidden. */
|
|
10271
|
+
startDisplayedItems: T[];
|
|
10272
|
+
/** The hidden items, in order. Absent when the trail fits. */
|
|
10273
|
+
overflowItems?: T[];
|
|
10274
|
+
/** The items after the collapsed ones. Absent when the trail fits. */
|
|
10275
|
+
endDisplayedItems?: T[];
|
|
10276
|
+
}
|
|
10277
|
+
|
|
10278
|
+
/**
|
|
10279
|
+
* A person's avatar next to their name and up to three more text lines (job title, location,
|
|
10280
|
+
* status), with an optional presence badge. The text can sit after, before or below the avatar
|
|
10281
|
+
* (`textPosition`), `presenceOnly` swaps the avatar for the presence badge, and the text scales with
|
|
10282
|
+
* `size` up to `huge`.
|
|
9162
10283
|
*
|
|
9163
10284
|
* The built-in avatar is decorative (`<Avatar decorative>`): the visible name is announced once,
|
|
9164
10285
|
* not a second time as the avatar's image name. The presence badge stays exposed as a named image.
|
|
9165
10286
|
*
|
|
9166
10287
|
* @example
|
|
9167
|
-
* <Persona name="Jane Doe" secondaryText="Designer" status="available" />
|
|
10288
|
+
* <Persona name="Jane Doe" secondaryText="Designer" tertiaryText="Oslo" status="available" />
|
|
9168
10289
|
*/
|
|
9169
10290
|
export declare const Persona: {
|
|
9170
|
-
({ name, secondaryText, src, size, status, avatar, badge, className, ref, ...props }: PersonaProps): React_2.JSX.Element;
|
|
10291
|
+
({ name, primaryText, secondaryText, tertiaryText, quaternaryText, textPosition, textAlignment, presenceOnly, src, size, status, avatar, badge, className, ref, ...props }: PersonaProps): React_2.JSX.Element;
|
|
9171
10292
|
displayName: string;
|
|
9172
10293
|
};
|
|
9173
10294
|
|
|
@@ -9182,20 +10303,52 @@ export declare const personaClassNames: {
|
|
|
9182
10303
|
readonly badge: "wave-persona__badge";
|
|
9183
10304
|
readonly primaryText: "wave-persona__primary-text";
|
|
9184
10305
|
readonly secondaryText: "wave-persona__secondary-text";
|
|
10306
|
+
readonly tertiaryText: "wave-persona__tertiary-text";
|
|
10307
|
+
readonly quaternaryText: "wave-persona__quaternary-text";
|
|
9185
10308
|
};
|
|
9186
10309
|
|
|
9187
10310
|
/** Properties for the Persona component. */
|
|
9188
10311
|
export declare interface PersonaProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
9189
|
-
/**
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
10312
|
+
/**
|
|
10313
|
+
* Display name of the person. It gives the avatar its initials and the first text line its text
|
|
10314
|
+
* (unless `primaryText` is given). A persona with neither `name` nor `primaryText` warns in
|
|
10315
|
+
* development.
|
|
10316
|
+
*/
|
|
10317
|
+
name?: string;
|
|
10318
|
+
/**
|
|
10319
|
+
* The first text line (the name). A string, an element or an object of `<span>` attributes.
|
|
10320
|
+
* @default the `name`
|
|
10321
|
+
*/
|
|
10322
|
+
primaryText?: Slot<'span'>;
|
|
10323
|
+
/** The second text line, such as a job title or email. */
|
|
10324
|
+
secondaryText?: Slot<'span'>;
|
|
10325
|
+
/** The third text line, such as a location. */
|
|
10326
|
+
tertiaryText?: Slot<'span'>;
|
|
10327
|
+
/** The fourth text line, such as a status message. */
|
|
10328
|
+
quaternaryText?: Slot<'span'>;
|
|
10329
|
+
/**
|
|
10330
|
+
* Where the text sits relative to the avatar, in reading order: after it, before it, or below it.
|
|
10331
|
+
* @default 'after'
|
|
10332
|
+
*/
|
|
10333
|
+
textPosition?: 'after' | 'before' | 'below';
|
|
10334
|
+
/**
|
|
10335
|
+
* How the text lines align with each other.
|
|
10336
|
+
* @default 'start' ('center' when the text is below the avatar)
|
|
10337
|
+
*/
|
|
10338
|
+
textAlignment?: 'start' | 'center';
|
|
10339
|
+
/**
|
|
10340
|
+
* Shows only the presence badge (from `status` or `badge`) in place of the avatar. The text
|
|
10341
|
+
* stays.
|
|
10342
|
+
* @default false
|
|
10343
|
+
*/
|
|
10344
|
+
presenceOnly?: boolean;
|
|
9193
10345
|
/** URL of the person's avatar image. */
|
|
9194
10346
|
src?: string;
|
|
9195
|
-
/**
|
|
10347
|
+
/**
|
|
10348
|
+
* Size of the persona: its avatar and its text.
|
|
9196
10349
|
* @default 'medium'
|
|
9197
10350
|
*/
|
|
9198
|
-
size?:
|
|
10351
|
+
size?: PersonaSize;
|
|
9199
10352
|
/** Presence status shown as a badge on the avatar. Ignored when a `badge` is given. */
|
|
9200
10353
|
status?: PresenceStatus;
|
|
9201
10354
|
/**
|
|
@@ -9215,6 +10368,9 @@ export declare interface PersonaProps extends React_2.HTMLAttributes<HTMLDivElem
|
|
|
9215
10368
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
9216
10369
|
}
|
|
9217
10370
|
|
|
10371
|
+
/** The size of a Persona: the Avatar sizes, and `huge` (a 72px avatar). */
|
|
10372
|
+
export declare type PersonaSize = Size | 'huge';
|
|
10373
|
+
|
|
9218
10374
|
/** How urgently assistive technology should read a message. */
|
|
9219
10375
|
export declare type Politeness = 'polite' | 'assertive';
|
|
9220
10376
|
|
|
@@ -9737,9 +10893,10 @@ export declare interface PresenceAttributes {
|
|
|
9737
10893
|
*
|
|
9738
10894
|
* @example
|
|
9739
10895
|
* <PresenceBadge status="busy" />
|
|
10896
|
+
* <PresenceBadge status="do-not-disturb" />
|
|
9740
10897
|
*/
|
|
9741
10898
|
export declare const PresenceBadge: {
|
|
9742
|
-
({ status, size, className, ref, ...props }: PresenceBadgeProps): React_2.JSX.Element;
|
|
10899
|
+
({ status: statusProp, size: sizeProp, className, ref, ...props }: PresenceBadgeProps): React_2.JSX.Element;
|
|
9743
10900
|
displayName: string;
|
|
9744
10901
|
};
|
|
9745
10902
|
|
|
@@ -9751,9 +10908,14 @@ export declare const presenceBadgeClassNames: {
|
|
|
9751
10908
|
|
|
9752
10909
|
/** Properties for the PresenceBadge component. */
|
|
9753
10910
|
export declare interface PresenceBadgeProps extends React_2.HTMLAttributes<HTMLSpanElement> {
|
|
9754
|
-
/**
|
|
9755
|
-
|
|
9756
|
-
|
|
10911
|
+
/**
|
|
10912
|
+
* Presence status to display. `'dnd'` and `'oof'` are deprecated aliases of `'do-not-disturb'`
|
|
10913
|
+
* and `'out-of-office'`: they render the same and warn once in development (removed in 1.0).
|
|
10914
|
+
* @default 'available'
|
|
10915
|
+
*/
|
|
10916
|
+
status?: PresenceStatus;
|
|
10917
|
+
/**
|
|
10918
|
+
* Size of the presence indicator. In the `badge` slot of an Avatar it is sized from the avatar.
|
|
9757
10919
|
* @default 'medium'
|
|
9758
10920
|
*/
|
|
9759
10921
|
size?: Size;
|
|
@@ -9779,8 +10941,11 @@ export declare interface PresenceProps extends UsePresenceOptions {
|
|
|
9779
10941
|
children: React_2.ReactElement | ((presence: UsePresenceResult) => React_2.ReactNode);
|
|
9780
10942
|
}
|
|
9781
10943
|
|
|
9782
|
-
/**
|
|
9783
|
-
|
|
10944
|
+
/**
|
|
10945
|
+
* User presence status for Avatar and Persona components. `'dnd'` and `'oof'` are deprecated
|
|
10946
|
+
* aliases of `'do-not-disturb'` and `'out-of-office'` ({@link DeprecatedPresenceStatus}).
|
|
10947
|
+
*/
|
|
10948
|
+
export declare type PresenceStatus = 'available' | 'busy' | 'away' | 'offline' | 'do-not-disturb' | 'out-of-office' | DeprecatedPresenceStatus;
|
|
9784
10949
|
|
|
9785
10950
|
/**
|
|
9786
10951
|
* Shows the progress of a task, or that a task is running (indeterminate, `value` omitted).
|
|
@@ -10836,6 +12001,7 @@ export declare type SlotObject<T extends React_2.ElementType = 'span'> = {
|
|
|
10836
12001
|
[dataAttribute: `data-${string}`]: unknown;
|
|
10837
12002
|
} & Omit<React_2.ComponentPropsWithoutRef<T>, 'children' | 'className' | 'style'>;
|
|
10838
12003
|
|
|
12004
|
+
/** The direction of a sorted column. */
|
|
10839
12005
|
export declare type SortDirection = 'ascending' | 'descending';
|
|
10840
12006
|
|
|
10841
12007
|
/**
|
|
@@ -11815,10 +12981,17 @@ export declare type SwitchSize = Extract<Size, 'small' | 'medium'>;
|
|
|
11815
12981
|
* scrollable wrapper; while it scrolls, the wrapper is a focusable region (named by
|
|
11816
12982
|
* `containerProps` or the `<caption>`) so keyboard users can scroll it.
|
|
11817
12983
|
*
|
|
11818
|
-
*
|
|
11819
|
-
*
|
|
11820
|
-
*
|
|
11821
|
-
*
|
|
12984
|
+
* The table keeps no state: a sortable `Table.HeaderCell` reports its clicks, and a
|
|
12985
|
+
* `Table.SelectionCell` (a native checkbox or radio) its changes, for your state to sort and
|
|
12986
|
+
* select the rows. `Table.CellLayout` lays out a cell's media, text and description, and
|
|
12987
|
+
* `Table.CellActions` shows a cell's actions while its row is hovered or holds focus.
|
|
12988
|
+
*
|
|
12989
|
+
* Sub-components are available as `Table.Header`, `Table.HeaderCell`, `Table.Body`, `Table.Row`,
|
|
12990
|
+
* `Table.Cell`, `Table.SelectionCell`, `Table.CellLayout` and `Table.CellActions` in client
|
|
12991
|
+
* components, and as the flat exports `TableHeader`, `TableHeaderCell`, `TableBody`, `TableRow`,
|
|
12992
|
+
* `TableCell`, `TableSelectionCell`, `TableCellLayout` and `TableCellActions` (the form React
|
|
12993
|
+
* Server Components can import). `Table.Head`/`Table.HeadCell` (`TableHead`/`TableHeadCell`) are
|
|
12994
|
+
* deprecated aliases.
|
|
11822
12995
|
*/
|
|
11823
12996
|
export declare const Table: {
|
|
11824
12997
|
({ striped, containerProps, children, className, ref, ...props }: TableProps): React_2.JSX.Element;
|
|
@@ -11829,7 +13002,7 @@ export declare const Table: {
|
|
|
11829
13002
|
displayName: string;
|
|
11830
13003
|
};
|
|
11831
13004
|
HeaderCell: {
|
|
11832
|
-
({ children, className, ref, ...props }: TableHeaderCellProps): React_2.JSX.Element;
|
|
13005
|
+
({ sortable, sortDirection, onSortClick, sortIcon, aside, children, className, ref, ...props }: TableHeaderCellProps): React_2.JSX.Element;
|
|
11833
13006
|
displayName: string;
|
|
11834
13007
|
};
|
|
11835
13008
|
/** @deprecated Use `Table.Header`. */
|
|
@@ -11854,6 +13027,18 @@ export declare const Table: {
|
|
|
11854
13027
|
({ children, className, ref, ...props }: TableCellProps): React_2.JSX.Element;
|
|
11855
13028
|
displayName: string;
|
|
11856
13029
|
};
|
|
13030
|
+
SelectionCell: {
|
|
13031
|
+
({ type, checked: checkedProp, defaultChecked, onCheckedChange, onChange, name, value, form, disabled, required, subtle, invisible, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, autoFocus, tabIndex, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, ref, ...rest }: TableSelectionCellProps): React_2.JSX.Element;
|
|
13032
|
+
displayName: string;
|
|
13033
|
+
};
|
|
13034
|
+
CellLayout: {
|
|
13035
|
+
({ media, description, truncate, appearance, children, className, ref, ...rest }: TableCellLayoutProps): React_2.JSX.Element;
|
|
13036
|
+
displayName: string;
|
|
13037
|
+
};
|
|
13038
|
+
CellActions: {
|
|
13039
|
+
({ visible, className, ref, ...rest }: TableCellActionsProps): React_2.JSX.Element;
|
|
13040
|
+
displayName: string;
|
|
13041
|
+
};
|
|
11857
13042
|
};
|
|
11858
13043
|
|
|
11859
13044
|
/** The table's `<tbody>`. */
|
|
@@ -11875,17 +13060,100 @@ export declare interface TableBodyProps extends React_2.HTMLAttributes<HTMLTable
|
|
|
11875
13060
|
ref?: React_2.Ref<HTMLTableSectionElement>;
|
|
11876
13061
|
}
|
|
11877
13062
|
|
|
11878
|
-
/** A data cell (`<td>`). */
|
|
13063
|
+
/** A data cell (`<td>`), the positioning box of a `Table.CellActions` inside it. */
|
|
11879
13064
|
export declare const TableCell: {
|
|
11880
13065
|
({ children, className, ref, ...props }: TableCellProps): React_2.JSX.Element;
|
|
11881
13066
|
displayName: string;
|
|
11882
13067
|
};
|
|
11883
13068
|
|
|
13069
|
+
/**
|
|
13070
|
+
* Actions of a cell (buttons, a menu button), shown over the end of the cell while its row is
|
|
13071
|
+
* hovered or holds focus, and always in forced colors and on a coarse pointer (touch); `visible`
|
|
13072
|
+
* keeps them shown. They stay in the tab order while hidden, and Tab into them shows them. Place
|
|
13073
|
+
* them in a `Table.Cell` or `DataGrid.Cell`, whose row (`Table.Row`, `DataGrid.Row`) is the group
|
|
13074
|
+
* that shows them. Their opaque background follows the row's (hover, a striped table's stripe, a
|
|
13075
|
+
* DataGrid's selected row); a row with a background of its own needs the same class on its
|
|
13076
|
+
* actions. The element carries `data-visible` while `visible` is set.
|
|
13077
|
+
*/
|
|
13078
|
+
export declare const TableCellActions: {
|
|
13079
|
+
({ visible, className, ref, ...rest }: TableCellActionsProps): React_2.JSX.Element;
|
|
13080
|
+
displayName: string;
|
|
13081
|
+
};
|
|
13082
|
+
|
|
13083
|
+
/** Table.CellActions: `root` on the element that holds the actions. */
|
|
13084
|
+
export declare const tableCellActionsClassNames: {
|
|
13085
|
+
readonly root: "wave-table-cell-actions";
|
|
13086
|
+
};
|
|
13087
|
+
|
|
13088
|
+
/** Properties for the TableCellActions sub-component. */
|
|
13089
|
+
export declare interface TableCellActionsProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
13090
|
+
/**
|
|
13091
|
+
* Keeps the actions shown, also while the row is neither hovered nor focused: for example while
|
|
13092
|
+
* a menu opened from one of them is open.
|
|
13093
|
+
* @default false
|
|
13094
|
+
*/
|
|
13095
|
+
visible?: boolean;
|
|
13096
|
+
/** The actions: buttons, a menu button. */
|
|
13097
|
+
children?: React_2.ReactNode;
|
|
13098
|
+
/** Ref to the `<div>` that holds the actions. */
|
|
13099
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
13100
|
+
}
|
|
13101
|
+
|
|
11884
13102
|
/** Table.Cell: `root` on the `<td>`. */
|
|
11885
13103
|
export declare const tableCellClassNames: {
|
|
11886
13104
|
readonly root: "wave-table-cell";
|
|
11887
13105
|
};
|
|
11888
13106
|
|
|
13107
|
+
/**
|
|
13108
|
+
* Lays out a cell's content: `media` (an icon or an Avatar), then the main text (children) with
|
|
13109
|
+
* an optional `description` under it. `truncate` keeps both lines to one line each with an
|
|
13110
|
+
* ellipsis; `appearance="primary"` draws the main text semibold, for the cell that names the row.
|
|
13111
|
+
*/
|
|
13112
|
+
export declare const TableCellLayout: {
|
|
13113
|
+
({ media, description, truncate, appearance, children, className, ref, ...rest }: TableCellLayoutProps): React_2.JSX.Element;
|
|
13114
|
+
displayName: string;
|
|
13115
|
+
};
|
|
13116
|
+
|
|
13117
|
+
/**
|
|
13118
|
+
* Table.CellLayout: `root` on the layout element; `media` on the media `<span>`; `content` on the
|
|
13119
|
+
* column that holds the text; `main` on the main text; `description` on the description line.
|
|
13120
|
+
*/
|
|
13121
|
+
export declare const tableCellLayoutClassNames: {
|
|
13122
|
+
readonly root: "wave-table-cell-layout";
|
|
13123
|
+
readonly media: "wave-table-cell-layout__media";
|
|
13124
|
+
readonly content: "wave-table-cell-layout__content";
|
|
13125
|
+
readonly main: "wave-table-cell-layout__main";
|
|
13126
|
+
readonly description: "wave-table-cell-layout__description";
|
|
13127
|
+
};
|
|
13128
|
+
|
|
13129
|
+
/** Properties for the TableCellLayout sub-component. */
|
|
13130
|
+
export declare interface TableCellLayoutProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
13131
|
+
/**
|
|
13132
|
+
* A picture before the text: an icon (drawn at 20px, 24px with the primary appearance) or an
|
|
13133
|
+
* Avatar, which takes a 32px box when it sets no `size` of its own. It is content, not hidden
|
|
13134
|
+
* from assistive technology: make an Avatar beside the person's name decorative.
|
|
13135
|
+
*/
|
|
13136
|
+
media?: Slot<'span'>;
|
|
13137
|
+
/** A second line under the main text, in the caption size and the muted color. */
|
|
13138
|
+
description?: Slot<'span'>;
|
|
13139
|
+
/**
|
|
13140
|
+
* Keeps the main text and the description on one line each, ending in an ellipsis where they do
|
|
13141
|
+
* not fit. It takes effect where the column's width is bounded (a width on the column, or a
|
|
13142
|
+
* table layout that does not widen columns to fit their content).
|
|
13143
|
+
* @default false
|
|
13144
|
+
*/
|
|
13145
|
+
truncate?: boolean;
|
|
13146
|
+
/**
|
|
13147
|
+
* `'primary'` draws the main text semibold and the media icon larger: the cell that names the
|
|
13148
|
+
* row. Rendered as `data-appearance` while set.
|
|
13149
|
+
*/
|
|
13150
|
+
appearance?: 'primary';
|
|
13151
|
+
/** The main text. */
|
|
13152
|
+
children?: React_2.ReactNode;
|
|
13153
|
+
/** Ref to the layout `<div>`. */
|
|
13154
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
13155
|
+
}
|
|
13156
|
+
|
|
11889
13157
|
/** Properties for the TableCell sub-component. */
|
|
11890
13158
|
export declare interface TableCellProps extends React_2.TdHTMLAttributes<HTMLTableCellElement> {
|
|
11891
13159
|
/** Cell content. */
|
|
@@ -11923,24 +13191,62 @@ export declare const TableHeader: {
|
|
|
11923
13191
|
|
|
11924
13192
|
/** A column header cell (`<th scope="col">`). */
|
|
11925
13193
|
export declare const TableHeaderCell: {
|
|
11926
|
-
({ children, className, ref, ...props }: TableHeaderCellProps): React_2.JSX.Element;
|
|
13194
|
+
({ sortable, sortDirection, onSortClick, sortIcon, aside, children, className, ref, ...props }: TableHeaderCellProps): React_2.JSX.Element;
|
|
11927
13195
|
displayName: string;
|
|
11928
13196
|
};
|
|
11929
13197
|
|
|
11930
|
-
/**
|
|
13198
|
+
/**
|
|
13199
|
+
* Table.HeaderCell (and the deprecated Table.HeadCell): `root` on the `<th>`; `button` on the sort
|
|
13200
|
+
* button of a sortable header; `sortIcon` on its direction glyph (the default arrow `<svg>`, or the
|
|
13201
|
+
* `<span>` of a `sortIcon` slot); `aside` on the aside `<span>`, outside the button.
|
|
13202
|
+
*/
|
|
11931
13203
|
export declare const tableHeaderCellClassNames: {
|
|
11932
13204
|
readonly root: "wave-table-header-cell";
|
|
13205
|
+
readonly button: "wave-table-header-cell__button";
|
|
13206
|
+
readonly sortIcon: "wave-table-header-cell__sort-icon";
|
|
13207
|
+
readonly aside: "wave-table-header-cell__aside";
|
|
11933
13208
|
};
|
|
11934
13209
|
|
|
11935
13210
|
/** Properties for the TableHeaderCell sub-component. */
|
|
11936
13211
|
export declare interface TableHeaderCellProps extends React_2.ThHTMLAttributes<HTMLTableCellElement> {
|
|
11937
|
-
/**
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
13212
|
+
/**
|
|
13213
|
+
* Makes the column header a sort control: the content is wrapped in a `<button>` that fills the
|
|
13214
|
+
* cell, and the cell carries `aria-sort` (`"none"` while `sortDirection` is not set). The table
|
|
13215
|
+
* does not sort or track the direction; keep it in your state, set `sortDirection` and sort the
|
|
13216
|
+
* rows in `onSortClick`. The table keeps no grid semantics.
|
|
13217
|
+
* @default false
|
|
13218
|
+
*/
|
|
13219
|
+
sortable?: boolean;
|
|
13220
|
+
/**
|
|
13221
|
+
* The direction the column is sorted in, shown as `aria-sort` and as the glyph of a sortable
|
|
13222
|
+
* header. Absent means the column is not sorted. Without `sortable` it has no effect.
|
|
13223
|
+
*/
|
|
13224
|
+
sortDirection?: SortDirection;
|
|
13225
|
+
/**
|
|
13226
|
+
* Called with the click event when the sort button is activated (click, Enter or Space).
|
|
13227
|
+
* Fluent's `onSortClick`.
|
|
13228
|
+
*/
|
|
13229
|
+
onSortClick?: React_2.MouseEventHandler<HTMLButtonElement>;
|
|
13230
|
+
/**
|
|
13231
|
+
* The glyph that shows the direction, only while `sortDirection` is set. It is decorative
|
|
13232
|
+
* (`aria-hidden`) and carries `data-direction`. `null` and `undefined` keep the default arrow
|
|
13233
|
+
* (up for ascending, down for descending); `false` or anything that renders nothing hides it. A
|
|
13234
|
+
* `<button>` or `Button` passed here is not nested: its children become the glyph.
|
|
13235
|
+
*/
|
|
13236
|
+
sortIcon?: Slot<'span'>;
|
|
13237
|
+
/**
|
|
13238
|
+
* Content beside the header content, outside the sort button (a filter button, an info
|
|
13239
|
+
* button), so it is not part of the button's name. Nothing renders for content that renders
|
|
13240
|
+
* nothing.
|
|
13241
|
+
*/
|
|
13242
|
+
aside?: Slot<'span'>;
|
|
13243
|
+
/** Header cell content. */
|
|
13244
|
+
children: React_2.ReactNode;
|
|
13245
|
+
/** Ref to the `<th>` element. */
|
|
13246
|
+
ref?: React_2.Ref<HTMLTableCellElement>;
|
|
13247
|
+
}
|
|
13248
|
+
|
|
13249
|
+
/** Table.Header (and the deprecated Table.Head): `root` on the `<thead>`. */
|
|
11944
13250
|
export declare const tableHeaderClassNames: {
|
|
11945
13251
|
readonly root: "wave-table-header";
|
|
11946
13252
|
};
|
|
@@ -11980,7 +13286,11 @@ export declare interface TableProps extends React_2.HTMLAttributes<HTMLTableElem
|
|
|
11980
13286
|
ref?: React_2.Ref<HTMLTableElement>;
|
|
11981
13287
|
}
|
|
11982
13288
|
|
|
11983
|
-
/**
|
|
13289
|
+
/**
|
|
13290
|
+
* A table row. Striping comes from the table (`striped`), so rows need no context. The row is the
|
|
13291
|
+
* `group/table-row` group whose hover or focus draws the subtle selection controls and the cell
|
|
13292
|
+
* actions inside it (Tree's rows keep their own group).
|
|
13293
|
+
*/
|
|
11984
13294
|
export declare const TableRow: {
|
|
11985
13295
|
({ children, className, ref, ...props }: TableRowProps): React_2.JSX.Element;
|
|
11986
13296
|
displayName: string;
|
|
@@ -11999,6 +13309,111 @@ export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableR
|
|
|
11999
13309
|
ref?: React_2.Ref<HTMLTableRowElement>;
|
|
12000
13310
|
}
|
|
12001
13311
|
|
|
13312
|
+
/**
|
|
13313
|
+
* A selection cell: a `<td>` with a native checkbox or radio (`type`), drawn as the DataGrid's.
|
|
13314
|
+
* The table keeps no selection, so the cell is usually controlled (`checked`, `onCheckedChange`)
|
|
13315
|
+
* from your rows' state; `checked="mixed"` draws a header select-all whose rows are partly
|
|
13316
|
+
* selected. `id`, `aria-label`, `aria-labelledby`, `aria-describedby`, the other ARIA state
|
|
13317
|
+
* props, `autoFocus`, `tabIndex`, the focus, key and change handlers and `name`, `value`, `form`,
|
|
13318
|
+
* `disabled` and `required` go to the control (`controlRef`); `className`, `style`, `data-*`, the
|
|
13319
|
+
* other handlers and `ref` stay on the cell, which carries `data-type`. Name the control with
|
|
13320
|
+
* `aria-label` or `aria-labelledby` (the row's first cell); a development warning reports a
|
|
13321
|
+
* control without a name.
|
|
13322
|
+
*/
|
|
13323
|
+
export declare const TableSelectionCell: {
|
|
13324
|
+
({ type, checked: checkedProp, defaultChecked, onCheckedChange, onChange, name, value, form, disabled, required, subtle, invisible, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-errormessage": ariaErrorMessage, "aria-details": ariaDetails, autoFocus, tabIndex, onFocus, onBlur, onKeyDown, onKeyUp, controlRef, className, ref, ...rest }: TableSelectionCellProps): React_2.JSX.Element;
|
|
13325
|
+
displayName: string;
|
|
13326
|
+
};
|
|
13327
|
+
|
|
13328
|
+
/** Second argument of `Table.SelectionCell`'s `onCheckedChange`: the event behind the change. */
|
|
13329
|
+
export declare interface TableSelectionCellCheckedChangeDetails {
|
|
13330
|
+
/**
|
|
13331
|
+
* The DOM event behind the change: the click of the control (Space clicks it too), or, for an
|
|
13332
|
+
* uncontrolled radio, the click that checked another radio of its group.
|
|
13333
|
+
*/
|
|
13334
|
+
event: Event;
|
|
13335
|
+
}
|
|
13336
|
+
|
|
13337
|
+
/** Table.SelectionCell: `root` on the `<td>`; `control` on its checkbox or radio. */
|
|
13338
|
+
export declare const tableSelectionCellClassNames: {
|
|
13339
|
+
readonly root: "wave-table-selection-cell";
|
|
13340
|
+
readonly control: "wave-table-selection-cell__control";
|
|
13341
|
+
};
|
|
13342
|
+
|
|
13343
|
+
/**
|
|
13344
|
+
* Properties for the TableSelectionCell sub-component. The focus, key and change handlers are the
|
|
13345
|
+
* control's (C-ROUTING), so they replace the cell's.
|
|
13346
|
+
*/
|
|
13347
|
+
export declare interface TableSelectionCellProps extends Omit<React_2.TdHTMLAttributes<HTMLTableCellElement>, 'children' | 'defaultChecked' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp'> {
|
|
13348
|
+
/**
|
|
13349
|
+
* The control: a checkbox (multiple selection, or a select-all in the header) or a radio (single
|
|
13350
|
+
* selection).
|
|
13351
|
+
* @default 'checkbox'
|
|
13352
|
+
*/
|
|
13353
|
+
type?: 'checkbox' | 'radio';
|
|
13354
|
+
/**
|
|
13355
|
+
* Controlled checked state. `'mixed'` draws an indeterminate checkbox (a select-all whose rows
|
|
13356
|
+
* are partly selected); a click on it checks it. `'mixed'` is for checkboxes only: on a radio it
|
|
13357
|
+
* has no effect (the radio is drawn unchecked).
|
|
13358
|
+
*/
|
|
13359
|
+
checked?: boolean | 'mixed';
|
|
13360
|
+
/**
|
|
13361
|
+
* Initial checked state for uncontrolled usage, also the state a form reset restores.
|
|
13362
|
+
* Uncontrolled radios that share a `name` uncheck each other, as a native radio group does.
|
|
13363
|
+
* @default false
|
|
13364
|
+
*/
|
|
13365
|
+
defaultChecked?: boolean | 'mixed';
|
|
13366
|
+
/**
|
|
13367
|
+
* Called with the new checked state when the user checks or unchecks the control (not for no-op
|
|
13368
|
+
* updates), and when a form reset restores a `true` or `false` `defaultChecked`. The second
|
|
13369
|
+
* argument holds the event. The table keeps no selection: update your rows' state here.
|
|
13370
|
+
*/
|
|
13371
|
+
onCheckedChange?: (checked: boolean, details?: TableSelectionCellCheckedChangeDetails) => void;
|
|
13372
|
+
/**
|
|
13373
|
+
* The native change event of the control, called before `onCheckedChange`;
|
|
13374
|
+
* `event.preventDefault()` in it cancels the change.
|
|
13375
|
+
*/
|
|
13376
|
+
onChange?: React_2.ChangeEventHandler<HTMLInputElement>;
|
|
13377
|
+
/** Form field name of the control. With a name, the control submits `name=value` while checked. */
|
|
13378
|
+
name?: string;
|
|
13379
|
+
/**
|
|
13380
|
+
* Value the control submits while checked.
|
|
13381
|
+
* @default 'on'
|
|
13382
|
+
*/
|
|
13383
|
+
value?: string;
|
|
13384
|
+
/** Id of the form the control belongs to, when the table is rendered outside that form. */
|
|
13385
|
+
form?: string;
|
|
13386
|
+
/** Natively disables the control: it cannot be checked or focused. */
|
|
13387
|
+
disabled?: boolean;
|
|
13388
|
+
/** The form must not be submitted while the control is unchecked (native validation). */
|
|
13389
|
+
required?: boolean;
|
|
13390
|
+
/**
|
|
13391
|
+
* Draws an unchecked control only while its row (a `Table.Row`) is hovered or holds focus; its
|
|
13392
|
+
* own keyboard focus, forced colors and a coarse pointer (touch) always draw it. It stays
|
|
13393
|
+
* focusable and named.
|
|
13394
|
+
* @default false
|
|
13395
|
+
*/
|
|
13396
|
+
subtle?: boolean;
|
|
13397
|
+
/**
|
|
13398
|
+
* Hides the control and takes it out of the tab order, while the cell keeps its box (a row that
|
|
13399
|
+
* cannot be selected keeps the column aligned).
|
|
13400
|
+
* @default false
|
|
13401
|
+
*/
|
|
13402
|
+
invisible?: boolean;
|
|
13403
|
+
/** Focus handler of the control. */
|
|
13404
|
+
onFocus?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
13405
|
+
/** Blur handler of the control. */
|
|
13406
|
+
onBlur?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
13407
|
+
/** Keydown handler of the control. */
|
|
13408
|
+
onKeyDown?: React_2.KeyboardEventHandler<HTMLInputElement>;
|
|
13409
|
+
/** Keyup handler of the control. */
|
|
13410
|
+
onKeyUp?: React_2.KeyboardEventHandler<HTMLInputElement>;
|
|
13411
|
+
/** Ref to the `<input>` element. */
|
|
13412
|
+
controlRef?: React_2.Ref<HTMLInputElement>;
|
|
13413
|
+
/** Ref to the `<td>` element. */
|
|
13414
|
+
ref?: React_2.Ref<HTMLTableCellElement>;
|
|
13415
|
+
}
|
|
13416
|
+
|
|
12002
13417
|
/**
|
|
12003
13418
|
* A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored
|
|
12004
13419
|
* in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with
|
|
@@ -12019,11 +13434,11 @@ export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableR
|
|
|
12019
13434
|
* `TabListPanels`) for React Server Components, which cannot use the dotted form.
|
|
12020
13435
|
*/
|
|
12021
13436
|
export declare const TabList: {
|
|
12022
|
-
({ value: valueProp, defaultValue: defaultValueProp, onValueChange, orientation: orientationProp, selectTabOnFocus, selectedValue, defaultSelectedValue, onTabSelect, vertical, className, children, onKeyDown, onFocus, ref, ...rest }: TabListProps): React_2.JSX.Element;
|
|
13437
|
+
({ value: valueProp, defaultValue: defaultValueProp, onValueChange, orientation: orientationProp, appearance, size, selectTabOnFocus, selectedValue, defaultSelectedValue, onTabSelect, vertical, className, children, onKeyDown, onFocus, ref, ...rest }: TabListProps): React_2.JSX.Element;
|
|
12023
13438
|
displayName: string;
|
|
12024
13439
|
} & {
|
|
12025
13440
|
Tab: {
|
|
12026
|
-
({ value, id: idProp, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
13441
|
+
({ value, id: idProp, icon, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
12027
13442
|
displayName: string;
|
|
12028
13443
|
};
|
|
12029
13444
|
Panel: {
|
|
@@ -12036,6 +13451,9 @@ export declare const TabList: {
|
|
|
12036
13451
|
};
|
|
12037
13452
|
};
|
|
12038
13453
|
|
|
13454
|
+
/** The look of a TabList: an underline, subtle fills, or circular subtle or filled tabs. */
|
|
13455
|
+
export declare type TabListAppearance = 'transparent' | 'subtle' | 'subtle-circular' | 'filled-circular';
|
|
13456
|
+
|
|
12039
13457
|
/** TabList: `root` on the `role="tablist"` element. */
|
|
12040
13458
|
export declare const tabListClassNames: {
|
|
12041
13459
|
readonly root: "wave-tab-list";
|
|
@@ -12098,6 +13516,19 @@ export declare interface TabListProps extends Omit<React_2.HTMLAttributes<HTMLDi
|
|
|
12098
13516
|
* @default 'horizontal'
|
|
12099
13517
|
*/
|
|
12100
13518
|
orientation?: Orientation;
|
|
13519
|
+
/**
|
|
13520
|
+
* Look of the tabs: `transparent` underlines the selected tab, `subtle` and `subtle-circular`
|
|
13521
|
+
* fill it with a subtle color (square or fully rounded), `filled-circular` fills it with the
|
|
13522
|
+
* primary color. In forced colors the selected tab keeps a Highlight outline (or underline) in
|
|
13523
|
+
* every appearance.
|
|
13524
|
+
* @default 'transparent'
|
|
13525
|
+
*/
|
|
13526
|
+
appearance?: TabListAppearance;
|
|
13527
|
+
/**
|
|
13528
|
+
* Size of the tabs: their padding and type (`medium` is 14px text on 16 by 8px padding).
|
|
13529
|
+
* @default 'medium'
|
|
13530
|
+
*/
|
|
13531
|
+
size?: CoreSize;
|
|
12101
13532
|
/**
|
|
12102
13533
|
* Whether moving focus with the arrow keys, Home and End also selects the tab (automatic
|
|
12103
13534
|
* activation, as in 0.5). With `false`, the keys only move focus and Enter, Space or a click
|
|
@@ -12129,13 +13560,14 @@ export declare interface TabListProps extends Omit<React_2.HTMLAttributes<HTMLDi
|
|
|
12129
13560
|
* with its value is mounted.
|
|
12130
13561
|
*/
|
|
12131
13562
|
export declare const TabListTab: {
|
|
12132
|
-
({ value, id: idProp, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
13563
|
+
({ value, id: idProp, icon, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
12133
13564
|
displayName: string;
|
|
12134
13565
|
};
|
|
12135
13566
|
|
|
12136
13567
|
/** TabList.Tab: `root` on the `role="tab"` button. */
|
|
12137
13568
|
export declare const tabListTabClassNames: {
|
|
12138
13569
|
readonly root: "wave-tab-list-tab";
|
|
13570
|
+
readonly icon: "wave-tab-list-tab__icon";
|
|
12139
13571
|
};
|
|
12140
13572
|
|
|
12141
13573
|
/** Properties for the TabPanel sub-component. */
|
|
@@ -12156,6 +13588,11 @@ export declare interface TabPanelsProps extends React_2.HTMLAttributes<HTMLDivEl
|
|
|
12156
13588
|
export declare interface TabProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
12157
13589
|
/** Unique value identifying this tab (and its panel). */
|
|
12158
13590
|
value: string;
|
|
13591
|
+
/**
|
|
13592
|
+
* An icon before the text, hidden from assistive technology. A tab with an icon and no text is
|
|
13593
|
+
* icon-only (a square hit area): name it with `aria-label`, or a development warning asks for it.
|
|
13594
|
+
*/
|
|
13595
|
+
icon?: Slot<'span'>;
|
|
12159
13596
|
/** Ref to the tab `<button>`. */
|
|
12160
13597
|
ref?: React_2.Ref<HTMLButtonElement>;
|
|
12161
13598
|
}
|
|
@@ -13169,11 +14606,16 @@ export declare type TagSize = Extract<Size, 'extra-small' | 'small' | 'medium'>;
|
|
|
13169
14606
|
* A step-by-step onboarding popover (a non-modal `role="dialog"`) with Back/Next (Done on the
|
|
13170
14607
|
* last step) and Close.
|
|
13171
14608
|
*
|
|
13172
|
-
* - Visibility is controllable: `open`/`defaultOpen` (default `true`
|
|
13173
|
-
*
|
|
14609
|
+
* - Visibility is controllable: `open`/`defaultOpen` (default `true`, or `false` with a direct
|
|
14610
|
+
* `TeachingPopover.Trigger`)/`onOpenChange`; Close, Done, Escape (anywhere in the document) and
|
|
14611
|
+
* the Trigger dismiss it and call `onDismiss`.
|
|
13174
14612
|
* - The step is controllable with `activeStep`/`defaultActiveStep`/`onStepChange` and clamped to
|
|
13175
14613
|
* the available steps. The heading carries a visually hidden “step n of m”, the new step is
|
|
13176
14614
|
* announced politely, and Back stays focusable (`aria-disabled`) on the first step.
|
|
14615
|
+
* - `primaryAction` and `secondaryAction` (on the popover, or on a step, which wins) replace Next/Done
|
|
14616
|
+
* and Back: a label, a Button-like element or a slot object. The consumer's `onClick` runs first,
|
|
14617
|
+
* then the step's normal action unless it called `preventDefault()`. Done calls `onFinish`
|
|
14618
|
+
* (and, in 0.x, `onDismiss`); `footerLayout` stacks the buttons.
|
|
13177
14619
|
* - The built-in text is English: `labels` localizes Back, Next, Done and the step position, and
|
|
13178
14620
|
* `closeLabel` the Close button.
|
|
13179
14621
|
* - Focus moves to the popover when it opens and returns to the element that had it when it
|
|
@@ -13193,16 +14635,327 @@ export declare type TagSize = Extract<Size, 'extra-small' | 'small' | 'medium'>;
|
|
|
13193
14635
|
* With no control at or before the target, the popover is reached where it is portaled, at the
|
|
13194
14636
|
* end of the page: Tab from the page's last control and Shift+Tab from outside the page enter
|
|
13195
14637
|
* it.
|
|
14638
|
+
* - **Parts** (Fluent's composition): `TeachingPopover.Trigger` opens and closes the popover, gets
|
|
14639
|
+
* focus back when it closes and, without a `target`, is what it points at; written directly
|
|
14640
|
+
* inside TeachingPopover (a Fragment is fine), it makes the popover start closed (`defaultOpen`
|
|
14641
|
+
* `false`). `TeachingPopover.Surface` is the surface itself: it takes the `className`, `style`,
|
|
14642
|
+
* `ref` and other element props that the `steps` form takes on TeachingPopover. Inside it,
|
|
14643
|
+
* `TeachingPopover.Header` (the Close button, with an optional caption and `icon`),
|
|
14644
|
+
* `TeachingPopover.Title` (the step title with the hidden step position; it names the popover),
|
|
14645
|
+
* `TeachingPopover.Body` (the step body, after an optional `media`) and
|
|
14646
|
+
* `TeachingPopover.Footer` (the step dots and the buttons) each show their share of the current
|
|
14647
|
+
* step unless given children; a Surface without children shows all four, which is what the
|
|
14648
|
+
* `steps` form renders. Both forms share one state: the steps, the labels, the actions and the
|
|
14649
|
+
* callbacks stay on TeachingPopover. A part outside a TeachingPopover throws in development.
|
|
14650
|
+
* - **Carousel parts**: `TeachingPopover.Carousel` holds the current step's page (the title and
|
|
14651
|
+
* body) and `TeachingPopover.CarouselFooter`, the bottom row with the step buttons:
|
|
14652
|
+
* `initialStepText` turns the first step's Back into a button that dismisses the popover (“Not
|
|
14653
|
+
* now”), `finalStepText` relabels Done, and `layout` (`'offset'` or `'centered'`) places the
|
|
14654
|
+
* indicator. The indicator is the decorative step dots unless you place
|
|
14655
|
+
* `TeachingPopover.CarouselNav` (interactive step buttons, named by `labels.navButton`, each a
|
|
14656
|
+
* Tab stop, the current one with `aria-current="step"`) or `TeachingPopover.CarouselPageCount`
|
|
14657
|
+
* (a visible “2 of 3”, worded by a render function) there. `steps` stays the only source of
|
|
14658
|
+
* the pages, so there is no card part.
|
|
14659
|
+
*
|
|
14660
|
+
* The parts are also exported under flat names (`TeachingPopoverTrigger`,
|
|
14661
|
+
* `TeachingPopoverSurface`, `TeachingPopoverHeader`, `TeachingPopoverTitle`,
|
|
14662
|
+
* `TeachingPopoverBody`, `TeachingPopoverFooter`, `TeachingPopoverCarousel`,
|
|
14663
|
+
* `TeachingPopoverCarouselNav`, `TeachingPopoverCarouselPageCount`,
|
|
14664
|
+
* `TeachingPopoverCarouselFooter`) for React Server Components, which cannot use the dotted form;
|
|
14665
|
+
* dotted access (`TeachingPopover.Trigger`) needs a client file.
|
|
14666
|
+
*
|
|
14667
|
+
* @example
|
|
14668
|
+
* <TeachingPopover steps={steps} onFinish={markTourSeen}>
|
|
14669
|
+
* <TeachingPopover.Trigger>
|
|
14670
|
+
* <Button>Take the tour</Button>
|
|
14671
|
+
* </TeachingPopover.Trigger>
|
|
14672
|
+
* <TeachingPopover.Surface>
|
|
14673
|
+
* <TeachingPopover.Header icon={<LightbulbIcon />}>Tip</TeachingPopover.Header>
|
|
14674
|
+
* <TeachingPopover.Title />
|
|
14675
|
+
* <TeachingPopover.Body media={<img src="/tour/search.png" alt="" />} />
|
|
14676
|
+
* <TeachingPopover.Footer />
|
|
14677
|
+
* </TeachingPopover.Surface>
|
|
14678
|
+
* </TeachingPopover>
|
|
14679
|
+
*
|
|
14680
|
+
* @example
|
|
14681
|
+
* <TeachingPopover steps={steps} onFinish={markTourSeen}>
|
|
14682
|
+
* <TeachingPopover.Surface>
|
|
14683
|
+
* <TeachingPopover.Header>Tip</TeachingPopover.Header>
|
|
14684
|
+
* <TeachingPopover.Carousel>
|
|
14685
|
+
* <TeachingPopover.Title />
|
|
14686
|
+
* <TeachingPopover.Body />
|
|
14687
|
+
* <TeachingPopover.CarouselFooter initialStepText="Not now" finalStepText="Got it">
|
|
14688
|
+
* <TeachingPopover.CarouselNav />
|
|
14689
|
+
* </TeachingPopover.CarouselFooter>
|
|
14690
|
+
* </TeachingPopover.Carousel>
|
|
14691
|
+
* </TeachingPopover.Surface>
|
|
14692
|
+
* </TeachingPopover>
|
|
13196
14693
|
*/
|
|
13197
14694
|
export declare const TeachingPopover: {
|
|
13198
|
-
({ steps, activeStep: activeStepProp, defaultActiveStep, currentStep, defaultCurrentStep, onStepChange, onDismiss, open: openProp, defaultOpen, onOpenChange, closeLabel, labels, target: targetProp, positioning, side, align, className, style, onKeyDown, ref, ...rest }: TeachingPopoverProps):
|
|
14695
|
+
({ steps, activeStep: activeStepProp, defaultActiveStep, currentStep, defaultCurrentStep, onStepChange, onDismiss, onFinish, primaryAction: primaryActionProp, secondaryAction: secondaryActionProp, footerLayout, open: openProp, defaultOpen, onOpenChange, closeLabel, labels, target: targetProp, positioning, side, align, children, id, className, style, onKeyDown, ref, ...rest }: TeachingPopoverProps): JSX.Element;
|
|
14696
|
+
displayName: string;
|
|
14697
|
+
} & {
|
|
14698
|
+
Trigger: {
|
|
14699
|
+
({ children, asChild, onClick, ref, ...rest }: TeachingPopoverTriggerProps): ReactNode;
|
|
14700
|
+
displayName: string;
|
|
14701
|
+
};
|
|
14702
|
+
Surface: {
|
|
14703
|
+
({ id, ref, ...rest }: TeachingPopoverSurfaceProps): JSX.Element;
|
|
14704
|
+
displayName: string;
|
|
14705
|
+
};
|
|
14706
|
+
Header: {
|
|
14707
|
+
({ icon, dismissButton, className, children, ref, ...rest }: TeachingPopoverHeaderProps): JSX.Element | null;
|
|
14708
|
+
displayName: string;
|
|
14709
|
+
};
|
|
14710
|
+
Title: PolymorphicComponent<"h3", TeachingPopoverTitleOwnProps>;
|
|
14711
|
+
Body: {
|
|
14712
|
+
({ media, className, children, ref, ...rest }: TeachingPopoverBodyProps): JSX.Element | null;
|
|
14713
|
+
displayName: string;
|
|
14714
|
+
};
|
|
14715
|
+
Footer: {
|
|
14716
|
+
({ className, children, ref, ...rest }: TeachingPopoverFooterProps): JSX.Element | null;
|
|
14717
|
+
displayName: string;
|
|
14718
|
+
};
|
|
14719
|
+
Carousel: {
|
|
14720
|
+
({ className, children, ref, ...rest }: TeachingPopoverCarouselProps): JSX.Element | null;
|
|
14721
|
+
displayName: string;
|
|
14722
|
+
};
|
|
14723
|
+
CarouselNav: {
|
|
14724
|
+
({ className, ref, ...rest }: TeachingPopoverCarouselNavProps): JSX.Element | null;
|
|
14725
|
+
displayName: string;
|
|
14726
|
+
};
|
|
14727
|
+
CarouselPageCount: {
|
|
14728
|
+
({ className, children, ref, ...rest }: TeachingPopoverCarouselPageCountProps): JSX.Element | null;
|
|
14729
|
+
displayName: string;
|
|
14730
|
+
};
|
|
14731
|
+
CarouselFooter: {
|
|
14732
|
+
({ layout, initialStepText, finalStepText, className, children, ref, ...rest }: TeachingPopoverCarouselFooterProps): JSX.Element | null;
|
|
14733
|
+
displayName: string;
|
|
14734
|
+
};
|
|
14735
|
+
};
|
|
14736
|
+
|
|
14737
|
+
/**
|
|
14738
|
+
* A footer action of a TeachingPopover (`primaryAction`, `secondaryAction`): the label content, or
|
|
14739
|
+
* a Button-like slot (a `Button`, `<button>` or `<a>` element, or a slot object such as
|
|
14740
|
+
* `{ as: 'a', href, children }`; `as` changes the element, which stays a Wave Button).
|
|
14741
|
+
*
|
|
14742
|
+
* The consumer's `onClick` runs first; then the step's normal action runs (Next or Done for the
|
|
14743
|
+
* primary action, Back for the secondary one) unless the handler called `event.preventDefault()`.
|
|
14744
|
+
*/
|
|
14745
|
+
export declare type TeachingPopoverAction = React_2.ReactNode | (SlotObject<'button'> & Pick<React_2.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'rel' | 'download'>);
|
|
14746
|
+
|
|
14747
|
+
/**
|
|
14748
|
+
* The step body (Fluent's `TeachingPopoverBody`): the current step's `body`, or your children,
|
|
14749
|
+
* after an optional `media` element.
|
|
14750
|
+
*
|
|
14751
|
+
* Also exported as `TeachingPopoverBody` for React Server Components, which cannot use the
|
|
14752
|
+
* dotted `TeachingPopover.Body` (that needs a client file).
|
|
14753
|
+
*/
|
|
14754
|
+
export declare const TeachingPopoverBody: {
|
|
14755
|
+
({ media, className, children, ref, ...rest }: TeachingPopoverBodyProps): React_2.JSX.Element | null;
|
|
14756
|
+
displayName: string;
|
|
14757
|
+
};
|
|
14758
|
+
|
|
14759
|
+
/**
|
|
14760
|
+
* TeachingPopover.Body: `root` on the body element (also the one the `steps` form renders), which
|
|
14761
|
+
* also carries TeachingPopover's `body`; `media` on the element of its `media` slot.
|
|
14762
|
+
*/
|
|
14763
|
+
export declare const teachingPopoverBodyClassNames: {
|
|
14764
|
+
readonly root: "wave-teaching-popover-body";
|
|
14765
|
+
readonly media: "wave-teaching-popover-body__media";
|
|
14766
|
+
};
|
|
14767
|
+
|
|
14768
|
+
/** Properties for the TeachingPopoverBody sub-component. */
|
|
14769
|
+
export declare interface TeachingPopoverBodyProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
14770
|
+
/**
|
|
14771
|
+
* The body content: the current step's `body` without children (or with children that render
|
|
14772
|
+
* nothing).
|
|
14773
|
+
*/
|
|
14774
|
+
children?: React_2.ReactNode;
|
|
14775
|
+
/**
|
|
14776
|
+
* Media above the content, such as a picture or a short video of the feature, inside a `<span>`
|
|
14777
|
+
* (`media={<img src="…" alt="…" />}`; a slot object sets the span's own attributes). It is
|
|
14778
|
+
* content, not decoration: give a picture its `alt` (`alt=""` when the text says it all). A
|
|
14779
|
+
* value that renders nothing renders no element.
|
|
14780
|
+
*/
|
|
14781
|
+
media?: Slot<'span'>;
|
|
14782
|
+
/** Ref to the body element. */
|
|
14783
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14784
|
+
}
|
|
14785
|
+
|
|
14786
|
+
/**
|
|
14787
|
+
* The tour as a carousel (Fluent's `TeachingPopoverCarousel`): it holds the current step's page
|
|
14788
|
+
* and the carousel footer. The steps stay on TeachingPopover (its `steps` are the pages, so there
|
|
14789
|
+
* is no card part), and so do the step state and the callbacks: the carousel parts read them
|
|
14790
|
+
* wherever they are in the popover. Without children it shows the step title and body and a
|
|
14791
|
+
* `TeachingPopover.CarouselFooter`.
|
|
14792
|
+
*
|
|
14793
|
+
* Also exported as `TeachingPopoverCarousel` for React Server Components, which cannot use the
|
|
14794
|
+
* dotted `TeachingPopover.Carousel` (that needs a client file).
|
|
14795
|
+
*/
|
|
14796
|
+
export declare const TeachingPopoverCarousel: {
|
|
14797
|
+
({ className, children, ref, ...rest }: TeachingPopoverCarouselProps): React_2.JSX.Element | null;
|
|
14798
|
+
displayName: string;
|
|
14799
|
+
};
|
|
14800
|
+
|
|
14801
|
+
/**
|
|
14802
|
+
* TeachingPopover.Carousel: `root` on the element that holds the step content and the carousel
|
|
14803
|
+
* footer.
|
|
14804
|
+
*/
|
|
14805
|
+
export declare const teachingPopoverCarouselClassNames: {
|
|
14806
|
+
readonly root: "wave-teaching-popover-carousel";
|
|
14807
|
+
};
|
|
14808
|
+
|
|
14809
|
+
/**
|
|
14810
|
+
* The carousel's bottom row (Fluent's `TeachingPopoverCarouselFooter`): an indicator (the
|
|
14811
|
+
* decorative step dots, or your children) and the buttons of the current step, as in
|
|
14812
|
+
* `TeachingPopover.Footer`: Back and Next (Done on the last step), or the `secondaryAction` and
|
|
14813
|
+
* `primaryAction` that replace them. `initialStepText` turns the first step's Back into a button
|
|
14814
|
+
* that dismisses the popover (“Not now”), `finalStepText` relabels Done, and `layout` places the
|
|
14815
|
+
* indicator; the footer wraps instead of letting the indicator and the buttons overlap. The steps,
|
|
14816
|
+
* the actions and the callbacks stay on TeachingPopover.
|
|
14817
|
+
*
|
|
14818
|
+
* Also exported as `TeachingPopoverCarouselFooter` for React Server Components, which cannot use
|
|
14819
|
+
* the dotted `TeachingPopover.CarouselFooter` (that needs a client file).
|
|
14820
|
+
*/
|
|
14821
|
+
export declare const TeachingPopoverCarouselFooter: {
|
|
14822
|
+
({ layout, initialStepText, finalStepText, className, children, ref, ...rest }: TeachingPopoverCarouselFooterProps): React_2.JSX.Element | null;
|
|
14823
|
+
displayName: string;
|
|
14824
|
+
};
|
|
14825
|
+
|
|
14826
|
+
/**
|
|
14827
|
+
* TeachingPopover.CarouselFooter: `root` on the footer element, which also carries
|
|
14828
|
+
* TeachingPopover's `footer`. Its buttons carry TeachingPopover's button classes, and its
|
|
14829
|
+
* decorative step dots TeachingPopover's `dot`.
|
|
14830
|
+
*/
|
|
14831
|
+
export declare const teachingPopoverCarouselFooterClassNames: {
|
|
14832
|
+
readonly root: "wave-teaching-popover-carousel-footer";
|
|
14833
|
+
};
|
|
14834
|
+
|
|
14835
|
+
/** Properties for the TeachingPopoverCarouselFooter sub-component. */
|
|
14836
|
+
export declare interface TeachingPopoverCarouselFooterProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
14837
|
+
/**
|
|
14838
|
+
* Where the indicator sits: `'offset'` puts it at the start and the buttons together at the
|
|
14839
|
+
* end, as `TeachingPopover.Footer` does, and the buttons wrap to a row of their own (at the end)
|
|
14840
|
+
* when both do not fit in one row; `'centered'` puts it between the secondary button at the
|
|
14841
|
+
* start and the primary button at the end, in the middle of the footer whatever the buttons'
|
|
14842
|
+
* widths (also without a secondary button), and when that row does not fit, the indicator takes
|
|
14843
|
+
* a row of its own above the buttons and the footer gets `data-stacked`. While stacked, the
|
|
14844
|
+
* visual order differs from the Tab order, which stays the secondary button, the indicator's
|
|
14845
|
+
* step buttons, then the primary button. The indicator never shrinks below its content.
|
|
14846
|
+
* Rendered as `data-carousel-layout`. (Fluent's default is `'centered'`; WaveUI keeps its own
|
|
14847
|
+
* footer's arrangement.) TeachingPopover's `footerLayout` applies to `TeachingPopover.Footer`
|
|
14848
|
+
* only.
|
|
14849
|
+
* @default 'offset'
|
|
14850
|
+
*/
|
|
14851
|
+
layout?: 'offset' | 'centered';
|
|
14852
|
+
/**
|
|
14853
|
+
* The text of the first step's secondary button (“Not now”). Given, that button is enabled and
|
|
14854
|
+
* dismisses the popover as Close does (`onOpenChange(false)`, then `onDismiss`; not
|
|
14855
|
+
* `onFinish`), also on a single step. Without it the first step keeps Back, focusable and
|
|
14856
|
+
* `aria-disabled`, and a single step has none. A `secondaryAction` replaces the button.
|
|
14857
|
+
*/
|
|
14858
|
+
initialStepText?: string;
|
|
14859
|
+
/**
|
|
14860
|
+
* The text of the primary button on the last step (“Got it”), which finishes the tour as Done
|
|
14861
|
+
* does. A `primaryAction` replaces the button.
|
|
14862
|
+
* @default TeachingPopover's `labels.done` ('Done')
|
|
14863
|
+
*/
|
|
14864
|
+
finalStepText?: string;
|
|
14865
|
+
/**
|
|
14866
|
+
* The indicator: without children (or with children that render nothing) the decorative step
|
|
14867
|
+
* dots; give it `TeachingPopover.CarouselNav` for interactive step buttons, or
|
|
14868
|
+
* `TeachingPopover.CarouselPageCount` for a visible count. The buttons always render.
|
|
14869
|
+
*/
|
|
14870
|
+
children?: React_2.ReactNode;
|
|
14871
|
+
/** Ref to the footer element. */
|
|
14872
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14873
|
+
}
|
|
14874
|
+
|
|
14875
|
+
/**
|
|
14876
|
+
* Interactive step buttons (Fluent's `TeachingPopoverCarouselNav`): a group named by
|
|
14877
|
+
* `labels.nav` (“Choose step”) with one button per step, each named by `labels.navButton`
|
|
14878
|
+
* (“Step 2 of 3”) and a Tab stop. The current step's button has `aria-current="step"`; activating
|
|
14879
|
+
* another one shows its step (`onStepChange`, then the step announcement), and focus stays on it.
|
|
14880
|
+
* Opt-in: the footers show decorative dots unless you place it, for example as the children of
|
|
14881
|
+
* `TeachingPopover.CarouselFooter`.
|
|
14882
|
+
*
|
|
14883
|
+
* Also exported as `TeachingPopoverCarouselNav` for React Server Components, which cannot use the
|
|
14884
|
+
* dotted `TeachingPopover.CarouselNav` (that needs a client file).
|
|
14885
|
+
*/
|
|
14886
|
+
export declare const TeachingPopoverCarouselNav: {
|
|
14887
|
+
({ className, ref, ...rest }: TeachingPopoverCarouselNavProps): React_2.JSX.Element | null;
|
|
13199
14888
|
displayName: string;
|
|
13200
14889
|
};
|
|
13201
14890
|
|
|
13202
14891
|
/**
|
|
13203
|
-
* TeachingPopover: `root` on the `role="
|
|
13204
|
-
*
|
|
13205
|
-
|
|
14892
|
+
* TeachingPopover.CarouselNav: `root` on the `role="group"` element of the step buttons; `button`
|
|
14893
|
+
* on each step button; `indicator` on the dot inside it.
|
|
14894
|
+
*/
|
|
14895
|
+
export declare const teachingPopoverCarouselNavClassNames: {
|
|
14896
|
+
readonly root: "wave-teaching-popover-carousel-nav";
|
|
14897
|
+
readonly button: "wave-teaching-popover-carousel-nav__button";
|
|
14898
|
+
readonly indicator: "wave-teaching-popover-carousel-nav__indicator";
|
|
14899
|
+
};
|
|
14900
|
+
|
|
14901
|
+
/** Properties for the TeachingPopoverCarouselNav sub-component. */
|
|
14902
|
+
export declare interface TeachingPopoverCarouselNavProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
14903
|
+
/** Ref to the element of the step buttons. */
|
|
14904
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14905
|
+
}
|
|
14906
|
+
|
|
14907
|
+
/**
|
|
14908
|
+
* The visible step count (Fluent's `TeachingPopoverCarouselPageCount`), such as “2 of 3”: the
|
|
14909
|
+
* current step and the step count, worded by a render function child. Place it in a footer,
|
|
14910
|
+
* for example in `TeachingPopover.CarouselFooter` next to or instead of `TeachingPopover.CarouselNav`.
|
|
14911
|
+
*
|
|
14912
|
+
* Also exported as `TeachingPopoverCarouselPageCount` for React Server Components, which cannot
|
|
14913
|
+
* use the dotted `TeachingPopover.CarouselPageCount` (that needs a client file).
|
|
14914
|
+
*/
|
|
14915
|
+
export declare const TeachingPopoverCarouselPageCount: {
|
|
14916
|
+
({ className, children, ref, ...rest }: TeachingPopoverCarouselPageCountProps): React_2.JSX.Element | null;
|
|
14917
|
+
displayName: string;
|
|
14918
|
+
};
|
|
14919
|
+
|
|
14920
|
+
/** TeachingPopover.CarouselPageCount: `root` on the element of the visible step count. */
|
|
14921
|
+
export declare const teachingPopoverCarouselPageCountClassNames: {
|
|
14922
|
+
readonly root: "wave-teaching-popover-carousel-page-count";
|
|
14923
|
+
};
|
|
14924
|
+
|
|
14925
|
+
/** Properties for the TeachingPopoverCarouselPageCount sub-component. */
|
|
14926
|
+
export declare interface TeachingPopoverCarouselPageCountProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
14927
|
+
/**
|
|
14928
|
+
* The text from the one-based number of the current step and the step count (Fluent's render
|
|
14929
|
+
* function); it also localizes the text. A result that renders nothing keeps the default. A
|
|
14930
|
+
* Server Component cannot pass a function: write the part with one in a client file.
|
|
14931
|
+
* @default (current, total) => `${current} of ${total}`
|
|
14932
|
+
*/
|
|
14933
|
+
children?: (current: number, total: number) => React_2.ReactNode;
|
|
14934
|
+
/** Ref to the count element. */
|
|
14935
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14936
|
+
}
|
|
14937
|
+
|
|
14938
|
+
/** Properties for the TeachingPopoverCarousel sub-component. */
|
|
14939
|
+
export declare interface TeachingPopoverCarouselProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
14940
|
+
/**
|
|
14941
|
+
* The carousel's content. Without children (or with children that render nothing) the current
|
|
14942
|
+
* step as a carousel page: `TeachingPopover.Title`, `TeachingPopover.Body` and
|
|
14943
|
+
* `TeachingPopover.CarouselFooter` without children of their own.
|
|
14944
|
+
*/
|
|
14945
|
+
children?: React_2.ReactNode;
|
|
14946
|
+
/** Ref to the carousel element. */
|
|
14947
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14948
|
+
}
|
|
14949
|
+
|
|
14950
|
+
/**
|
|
14951
|
+
* TeachingPopover: `root` on the `role="dialog"` surface (also when TeachingPopover.Surface
|
|
14952
|
+
* renders it); `beak` on the arrow; `closeButton`, `backButton` and `nextButton` on its buttons
|
|
14953
|
+
* (which also carry Button's root; `backButton` also on the first step's button that a
|
|
14954
|
+
* TeachingPopover.CarouselFooter's `initialStepText` names); `primaryButton` and `secondaryButton`
|
|
14955
|
+
* on the buttons that a `primaryAction` and a `secondaryAction` render in place of Next/Done and
|
|
14956
|
+
* Back; `title` on the step title (an `<h3>`, or the element of TeachingPopover.Title's `as`);
|
|
14957
|
+
* `body` on the step body; `footer` on the bottom row (TeachingPopover.Footer's, or
|
|
14958
|
+
* TeachingPopover.CarouselFooter's); `dot` on each decorative step dot.
|
|
13206
14959
|
*/
|
|
13207
14960
|
export declare const teachingPopoverClassNames: {
|
|
13208
14961
|
readonly root: "wave-teaching-popover";
|
|
@@ -13214,8 +14967,94 @@ export declare const teachingPopoverClassNames: {
|
|
|
13214
14967
|
readonly dot: "wave-teaching-popover__dot";
|
|
13215
14968
|
readonly backButton: "wave-teaching-popover__back-button";
|
|
13216
14969
|
readonly nextButton: "wave-teaching-popover__next-button";
|
|
14970
|
+
readonly primaryButton: "wave-teaching-popover__primary-button";
|
|
14971
|
+
readonly secondaryButton: "wave-teaching-popover__secondary-button";
|
|
14972
|
+
};
|
|
14973
|
+
|
|
14974
|
+
/**
|
|
14975
|
+
* The bottom row (Fluent's `TeachingPopoverFooter`): the step dots and the buttons of the current
|
|
14976
|
+
* step, laid out by TeachingPopover's `footerLayout` (rendered as `data-layout` here too), or your
|
|
14977
|
+
* children. The steps, the actions and their labels stay on TeachingPopover.
|
|
14978
|
+
*
|
|
14979
|
+
* Also exported as `TeachingPopoverFooter` for React Server Components, which cannot use the
|
|
14980
|
+
* dotted `TeachingPopover.Footer` (that needs a client file).
|
|
14981
|
+
*/
|
|
14982
|
+
export declare const TeachingPopoverFooter: {
|
|
14983
|
+
({ className, children, ref, ...rest }: TeachingPopoverFooterProps): React_2.JSX.Element | null;
|
|
14984
|
+
displayName: string;
|
|
13217
14985
|
};
|
|
13218
14986
|
|
|
14987
|
+
/**
|
|
14988
|
+
* TeachingPopover.Footer: `root` on the footer element (also the one the `steps` form renders),
|
|
14989
|
+
* which also carries TeachingPopover's `footer`.
|
|
14990
|
+
*/
|
|
14991
|
+
export declare const teachingPopoverFooterClassNames: {
|
|
14992
|
+
readonly root: "wave-teaching-popover-footer";
|
|
14993
|
+
};
|
|
14994
|
+
|
|
14995
|
+
/** Properties for the TeachingPopoverFooter sub-component. */
|
|
14996
|
+
export declare interface TeachingPopoverFooterProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
14997
|
+
/**
|
|
14998
|
+
* The footer content. Without children (or with children that render nothing) the step dots and
|
|
14999
|
+
* the buttons of the current step: Back and Next (Done on the last step), or the
|
|
15000
|
+
* `primaryAction` and `secondaryAction` that replace them.
|
|
15001
|
+
*/
|
|
15002
|
+
children?: React_2.ReactNode;
|
|
15003
|
+
/** Ref to the footer element. */
|
|
15004
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
15005
|
+
}
|
|
15006
|
+
|
|
15007
|
+
/**
|
|
15008
|
+
* The top of the popover (Fluent's `TeachingPopoverHeader`): the Close button, and an optional
|
|
15009
|
+
* caption with a decorative `icon` before the title. Without children it holds only the Close
|
|
15010
|
+
* button, as the `steps` form does. Place it first in a `TeachingPopover.Surface`.
|
|
15011
|
+
*
|
|
15012
|
+
* Also exported as `TeachingPopoverHeader` for React Server Components, which cannot use the
|
|
15013
|
+
* dotted `TeachingPopover.Header` (that needs a client file).
|
|
15014
|
+
*/
|
|
15015
|
+
export declare const TeachingPopoverHeader: {
|
|
15016
|
+
({ icon, dismissButton, className, children, ref, ...rest }: TeachingPopoverHeaderProps): React_2.JSX.Element | null;
|
|
15017
|
+
displayName: string;
|
|
15018
|
+
};
|
|
15019
|
+
|
|
15020
|
+
/**
|
|
15021
|
+
* TeachingPopover.Header: `root` on the header element (also the one the `steps` form renders
|
|
15022
|
+
* around its Close button); `icon` on the element of its `icon` slot. Its Close button carries
|
|
15023
|
+
* TeachingPopover's `closeButton`.
|
|
15024
|
+
*/
|
|
15025
|
+
export declare const teachingPopoverHeaderClassNames: {
|
|
15026
|
+
readonly root: "wave-teaching-popover-header";
|
|
15027
|
+
readonly icon: "wave-teaching-popover-header__icon";
|
|
15028
|
+
};
|
|
15029
|
+
|
|
15030
|
+
/** Properties for the TeachingPopoverHeader sub-component. */
|
|
15031
|
+
export declare interface TeachingPopoverHeaderProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
15032
|
+
/**
|
|
15033
|
+
* A short caption above the title, such as “Tip” or “New”. Without it (and without `icon`) the
|
|
15034
|
+
* header holds only the Close button, as the `steps` form's does; with either, they sit in a row
|
|
15035
|
+
* at the top of the popover, next to the Close button.
|
|
15036
|
+
*/
|
|
15037
|
+
children?: React_2.ReactNode;
|
|
15038
|
+
/**
|
|
15039
|
+
* A decorative icon before the caption (`aria-hidden`), such as a light bulb. None by default
|
|
15040
|
+
* (Fluent's header shows a light bulb). A value that renders nothing renders no element.
|
|
15041
|
+
*/
|
|
15042
|
+
icon?: Slot<'span'>;
|
|
15043
|
+
/**
|
|
15044
|
+
* The Close button at the popover's top end, which dismisses it (`onOpenChange(false)`, then
|
|
15045
|
+
* `onDismiss`) and is named by TeachingPopover's `closeLabel`. Content (an icon) replaces the
|
|
15046
|
+
* dismiss glyph inside the built-in button. A `<button>` or a `Button`, or a slot object whose
|
|
15047
|
+
* `as` is one, is merged into it, never nested: its props and handlers (called first) reach the
|
|
15048
|
+
* built-in button, its content goes inside, and a development warning says so; a text label of
|
|
15049
|
+
* two or more letters or digits in it names the button instead of `closeLabel` (WCAG 2.5.3,
|
|
15050
|
+
* Label in Name), as does its own `aria-label`. `null` renders no Close button; `undefined` and
|
|
15051
|
+
* booleans keep the default.
|
|
15052
|
+
*/
|
|
15053
|
+
dismissButton?: Slot<'span'>;
|
|
15054
|
+
/** Ref to the header element. */
|
|
15055
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
15056
|
+
}
|
|
15057
|
+
|
|
13219
15058
|
/** The built-in text of a TeachingPopover, for localization (see `TeachingPopoverProps.labels`). */
|
|
13220
15059
|
export declare interface TeachingPopoverLabels {
|
|
13221
15060
|
/** Text of the Back button.
|
|
@@ -13237,6 +15076,16 @@ export declare interface TeachingPopoverLabels {
|
|
|
13237
15076
|
* @default (index, count) => `step ${index + 1} of ${count}`
|
|
13238
15077
|
*/
|
|
13239
15078
|
step?: (index: number, count: number) => string;
|
|
15079
|
+
/** Name of the group of step buttons that `TeachingPopover.CarouselNav` renders.
|
|
15080
|
+
* @default 'Choose step'
|
|
15081
|
+
*/
|
|
15082
|
+
nav?: string;
|
|
15083
|
+
/**
|
|
15084
|
+
* Name of the `TeachingPopover.CarouselNav` button that shows the step at `index` (zero-based,
|
|
15085
|
+
* like `activeStep`) out of `count` steps.
|
|
15086
|
+
* @default (index, count) => `Step ${index + 1} of ${count}`
|
|
15087
|
+
*/
|
|
15088
|
+
navButton?: (index: number, count: number) => string;
|
|
13240
15089
|
}
|
|
13241
15090
|
|
|
13242
15091
|
/** Properties for the TeachingPopover component. */
|
|
@@ -13256,17 +15105,54 @@ export declare interface TeachingPopoverProps extends React_2.HTMLAttributes<HTM
|
|
|
13256
15105
|
currentStep?: number;
|
|
13257
15106
|
/** @deprecated Use `defaultActiveStep`. */
|
|
13258
15107
|
defaultCurrentStep?: number;
|
|
13259
|
-
/**
|
|
15108
|
+
/**
|
|
15109
|
+
* Called with the requested step index when Next, Back or a step button of
|
|
15110
|
+
* `TeachingPopover.CarouselNav` is activated (the button of the current step requests nothing).
|
|
15111
|
+
*/
|
|
13260
15112
|
onStepChange?: (step: number) => void;
|
|
13261
|
-
/**
|
|
15113
|
+
/**
|
|
15114
|
+
* Called when the popover is dismissed with Close, Done, Escape or a `TeachingPopover.Trigger`
|
|
15115
|
+
* that closes it.
|
|
15116
|
+
*
|
|
15117
|
+
* Done also calls it in 0.x, after `onFinish`, so that code written before `onFinish` keeps
|
|
15118
|
+
* working; from 1.0 only Close, Escape and the Trigger will.
|
|
15119
|
+
*/
|
|
13262
15120
|
onDismiss?: () => void;
|
|
15121
|
+
/**
|
|
15122
|
+
* Called when the tour is finished: Done, the button that replaces Next on the last step, or a
|
|
15123
|
+
* `primaryAction` on the last step whose click was not prevented. The popover closes first.
|
|
15124
|
+
* Close, Escape and the Trigger call only `onDismiss`. Fires on every activation, like
|
|
15125
|
+
* `onStepChange`.
|
|
15126
|
+
*/
|
|
15127
|
+
onFinish?: () => void;
|
|
15128
|
+
/**
|
|
15129
|
+
* Replaces the Next (or Done) button on every step that sets no `primaryAction` of its own.
|
|
15130
|
+
*/
|
|
15131
|
+
primaryAction?: TeachingPopoverAction;
|
|
15132
|
+
/**
|
|
15133
|
+
* Replaces the Back button on every step that sets no `secondaryAction` of its own.
|
|
15134
|
+
*/
|
|
15135
|
+
secondaryAction?: TeachingPopoverAction;
|
|
15136
|
+
/**
|
|
15137
|
+
* How the footer lays out the step dots and the buttons: side by side, or the dots above
|
|
15138
|
+
* buttons that fill the width. Rendered as `data-layout` on the popover and on its footer.
|
|
15139
|
+
* `TeachingPopover.CarouselFooter` has its own `layout` instead.
|
|
15140
|
+
* @default 'horizontal'
|
|
15141
|
+
*/
|
|
15142
|
+
footerLayout?: 'horizontal' | 'vertical';
|
|
13263
15143
|
/** Controlled visibility of the teaching popover. */
|
|
13264
15144
|
open?: boolean;
|
|
13265
|
-
/**
|
|
13266
|
-
*
|
|
15145
|
+
/**
|
|
15146
|
+
* Initial visibility for uncontrolled usage: `true` (a tour that shows on page load), or
|
|
15147
|
+
* `false` when a `TeachingPopover.Trigger` is a direct child (a Fragment is fine), which then
|
|
15148
|
+
* opens it.
|
|
15149
|
+
* @default true (false with a direct TeachingPopover.Trigger)
|
|
13267
15150
|
*/
|
|
13268
15151
|
defaultOpen?: boolean;
|
|
13269
|
-
/**
|
|
15152
|
+
/**
|
|
15153
|
+
* Called with `false` when Close, Done or Escape dismisses the popover, and with the new state
|
|
15154
|
+
* when a `TeachingPopover.Trigger` opens or closes it.
|
|
15155
|
+
*/
|
|
13270
15156
|
onOpenChange?: (open: boolean) => void;
|
|
13271
15157
|
/**
|
|
13272
15158
|
* Accessible name of the built-in Close button (an icon-only button). Localize it with the
|
|
@@ -13275,15 +15161,17 @@ export declare interface TeachingPopoverProps extends React_2.HTMLAttributes<HTM
|
|
|
13275
15161
|
*/
|
|
13276
15162
|
closeLabel?: string;
|
|
13277
15163
|
/**
|
|
13278
|
-
* Text of the Back, Next and Done buttons
|
|
13279
|
-
* for localization. Unset members keep
|
|
15164
|
+
* Text of the Back, Next and Done buttons, the wording of the step position (“step 2 of 3”) and
|
|
15165
|
+
* the names of `TeachingPopover.CarouselNav`'s step buttons, for localization. Unset members keep
|
|
15166
|
+
* their English defaults.
|
|
13280
15167
|
*/
|
|
13281
15168
|
labels?: TeachingPopoverLabels;
|
|
13282
15169
|
/**
|
|
13283
15170
|
* The element the popover points at (a ref, the element, or a `VirtualElement`: a rectangle such as a
|
|
13284
15171
|
* point; an inline object is fine). When given, the popover is
|
|
13285
15172
|
* rendered in a portal, positioned next to it with a beak, and flips or shifts to stay in view;
|
|
13286
|
-
* without it (`undefined`) the popover renders inline where it is placed (0.4 behaviour)
|
|
15173
|
+
* without it (`undefined`) the popover renders inline where it is placed (0.4 behaviour), or,
|
|
15174
|
+
* with a `TeachingPopover.Trigger`, points at the trigger.
|
|
13287
15175
|
* While the target is `null` or has not been positioned against yet (an element held in state
|
|
13288
15176
|
* that is not set yet, a ref that is not attached), the popover stays hidden: it is not
|
|
13289
15177
|
* shown, takes no focus, announces no step change and does not handle Escape until it can
|
|
@@ -13318,7 +15206,18 @@ export declare interface TeachingPopoverProps extends React_2.HTMLAttributes<HTM
|
|
|
13318
15206
|
* @default `{ offset: 12 }`
|
|
13319
15207
|
*/
|
|
13320
15208
|
positioning?: PopupPositioning;
|
|
13321
|
-
/**
|
|
15209
|
+
/**
|
|
15210
|
+
* `TeachingPopover.Trigger` and `TeachingPopover.Surface` (Fluent's composition), rendered where
|
|
15211
|
+
* they are written. Without a `TeachingPopover.Surface` among them, the popover renders its
|
|
15212
|
+
* surface itself, after the children, with the element props given here (`className`, `style`,
|
|
15213
|
+
* `ref`, …); with one (best written directly inside, a Fragment is fine: see
|
|
15214
|
+
* `TeachingPopover.Surface`), the Surface takes them instead.
|
|
15215
|
+
*/
|
|
15216
|
+
children?: React_2.ReactNode;
|
|
15217
|
+
/**
|
|
15218
|
+
* Ref to the popover surface (`role="dialog"`). Ignored next to a `TeachingPopover.Surface`
|
|
15219
|
+
* (pass it to the Surface).
|
|
15220
|
+
*/
|
|
13322
15221
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
13323
15222
|
}
|
|
13324
15223
|
|
|
@@ -13328,6 +15227,164 @@ export declare interface TeachingPopoverStep {
|
|
|
13328
15227
|
title: string;
|
|
13329
15228
|
/** Body content for the step. */
|
|
13330
15229
|
body: React_2.ReactNode;
|
|
15230
|
+
/**
|
|
15231
|
+
* Replaces the Next (or, on the last step, Done) button on this step; wins over the
|
|
15232
|
+
* popover's `primaryAction`.
|
|
15233
|
+
*/
|
|
15234
|
+
primaryAction?: TeachingPopoverAction;
|
|
15235
|
+
/**
|
|
15236
|
+
* Replaces the Back button on this step (also on a single-step popover, which has no Back);
|
|
15237
|
+
* wins over the popover's `secondaryAction`.
|
|
15238
|
+
*/
|
|
15239
|
+
secondaryAction?: TeachingPopoverAction;
|
|
15240
|
+
}
|
|
15241
|
+
|
|
15242
|
+
/**
|
|
15243
|
+
* The popover surface (Fluent's `TeachingPopoverSurface`): the non-modal `role="dialog"` element
|
|
15244
|
+
* that the `steps` form renders, with the same behaviour (in place, or portaled next to the
|
|
15245
|
+
* target with a beak; focus, dismissal, keyboard order and step announcements), so your
|
|
15246
|
+
* `className`, `style`, `ref` and other props reach the element the `steps` form gives
|
|
15247
|
+
* TeachingPopover's own. Without children it shows the current step as the `steps` form does;
|
|
15248
|
+
* children replace that content: build it from `TeachingPopover.Header`, `Title`, `Body` and
|
|
15249
|
+
* `Footer`, or from your own (then name the surface with `aria-label` or `aria-labelledby`).
|
|
15250
|
+
*
|
|
15251
|
+
* Render one inside TeachingPopover; TeachingPopover then renders no surface of its own, and its
|
|
15252
|
+
* own `className`, `style`, `ref` and other element props are ignored (a development warning says
|
|
15253
|
+
* so). Write it directly inside TeachingPopover (a Fragment is fine) where you can: there it is
|
|
15254
|
+
* found while rendering. One inside an element or a component of yours is found once it has
|
|
15255
|
+
* mounted, so until then TeachingPopover's own surface renders next to it: in the server HTML, and
|
|
15256
|
+
* in the browser's first commit (before anything is painted or focused). A second Surface renders
|
|
15257
|
+
* a second popover (a development warning says so).
|
|
15258
|
+
*
|
|
15259
|
+
* Also exported as `TeachingPopoverSurface` for React Server Components, which cannot use the
|
|
15260
|
+
* dotted `TeachingPopover.Surface` (that needs a client file).
|
|
15261
|
+
*/
|
|
15262
|
+
export declare const TeachingPopoverSurface: {
|
|
15263
|
+
({ id, ref, ...rest }: TeachingPopoverSurfaceProps): React_2.JSX.Element;
|
|
15264
|
+
displayName: string;
|
|
15265
|
+
};
|
|
15266
|
+
|
|
15267
|
+
/**
|
|
15268
|
+
* TeachingPopover.Surface: `root` on the `role="dialog"` surface it renders, which also carries
|
|
15269
|
+
* TeachingPopover's `root`; the content of the current step it shows without children carries
|
|
15270
|
+
* TeachingPopover's part classes.
|
|
15271
|
+
*/
|
|
15272
|
+
export declare const teachingPopoverSurfaceClassNames: {
|
|
15273
|
+
readonly root: "wave-teaching-popover-surface";
|
|
15274
|
+
};
|
|
15275
|
+
|
|
15276
|
+
/** Properties for the TeachingPopoverSurface sub-component. */
|
|
15277
|
+
export declare interface TeachingPopoverSurfaceProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
15278
|
+
/**
|
|
15279
|
+
* The popover's content. Without children (or with children that render nothing) the surface
|
|
15280
|
+
* shows the current step as the `steps` form does: `TeachingPopover.Header`, `Title`, `Body` and
|
|
15281
|
+
* `Footer` without children of their own (the Close button, the step title, its body, and the
|
|
15282
|
+
* footer with the step dots and the buttons). Children replace all of that: build it from those
|
|
15283
|
+
* parts, each showing its share of the current step unless you give it children, or from your
|
|
15284
|
+
* own content. A `TeachingPopover.Title` among the children (at any depth) names the surface;
|
|
15285
|
+
* without one, name it with `aria-label` or `aria-labelledby`.
|
|
15286
|
+
*/
|
|
15287
|
+
children?: React_2.ReactNode;
|
|
15288
|
+
/** Ref to the popover surface (`role="dialog"`). */
|
|
15289
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
15290
|
+
}
|
|
15291
|
+
|
|
15292
|
+
/**
|
|
15293
|
+
* The step title (Fluent's `TeachingPopoverTitle`): an `<h3>` (another level, or any element,
|
|
15294
|
+
* with `as`) holding the current step's `title`, or your children, and a visually hidden step
|
|
15295
|
+
* position. It names the surface: the surface's `aria-labelledby` points at its `id` (yours, or a
|
|
15296
|
+
* generated one), wherever it is among the Surface's children (inside `TeachingPopover.Body`, as
|
|
15297
|
+
* in Fluent, works too).
|
|
15298
|
+
*
|
|
15299
|
+
* Also exported as `TeachingPopoverTitle` for React Server Components, which cannot use the
|
|
15300
|
+
* dotted `TeachingPopover.Title` (that needs a client file).
|
|
15301
|
+
*/
|
|
15302
|
+
export declare const TeachingPopoverTitle: PolymorphicComponent<'h3', TeachingPopoverTitleOwnProps>;
|
|
15303
|
+
|
|
15304
|
+
/**
|
|
15305
|
+
* TeachingPopover.Title: `root` on the heading (also the one the `steps` form renders), which
|
|
15306
|
+
* also carries TeachingPopover's `title`.
|
|
15307
|
+
*/
|
|
15308
|
+
export declare const teachingPopoverTitleClassNames: {
|
|
15309
|
+
readonly root: "wave-teaching-popover-title";
|
|
15310
|
+
};
|
|
15311
|
+
|
|
15312
|
+
/** The TeachingPopover.Title's own props (component-specific props only). */
|
|
15313
|
+
export declare interface TeachingPopoverTitleOwnProps {
|
|
15314
|
+
/**
|
|
15315
|
+
* The title text: the current step's `title` without children (or with children that render
|
|
15316
|
+
* nothing). A visually hidden step position (“, step 2 of 3”, worded by `labels.step`) follows
|
|
15317
|
+
* either, so the heading, which names the popover, says where the tour is.
|
|
15318
|
+
*/
|
|
15319
|
+
children?: React_2.ReactNode;
|
|
15320
|
+
}
|
|
15321
|
+
|
|
15322
|
+
/** Props of {@link TeachingPopoverTitle} rendered as `C` (default `'h3'`), including `ref`. */
|
|
15323
|
+
export declare type TeachingPopoverTitleProps<C extends React_2.ElementType = 'h3'> = PolymorphicProps<C, TeachingPopoverTitleOwnProps>;
|
|
15324
|
+
|
|
15325
|
+
/**
|
|
15326
|
+
* The element that opens and closes the popover (Fluent's `TeachingPopoverTrigger`, as
|
|
15327
|
+
* `Popover.Trigger`). Its props are merged onto the single child (no wrapper element):
|
|
15328
|
+
* `aria-haspopup="dialog"`, `aria-expanded`, `aria-controls` (while open), a composed `onClick`
|
|
15329
|
+
* that opens the popover, or dismisses it while it is open (as Close does: `onOpenChange(false)`,
|
|
15330
|
+
* then `onDismiss`), and a ref. The child's own handlers and classes are kept; the live state ARIA
|
|
15331
|
+
* always wins. A render function receives the props instead; `asChild={false}` renders a wrapper
|
|
15332
|
+
* span, and a custom child that neither forwards `ref` nor spreads its props falls back to that
|
|
15333
|
+
* span automatically (with a development warning). On the span, the state ARIA goes to the first
|
|
15334
|
+
* element in the tab order inside it.
|
|
15335
|
+
*
|
|
15336
|
+
* When TeachingPopover has no `target` (and no `positioning.target`), the popover points at the
|
|
15337
|
+
* trigger: it is portaled next to it with a beak and takes its place in the keyboard order right
|
|
15338
|
+
* after it. Focus returns to the trigger when the popover closes, with a `target` too (as with
|
|
15339
|
+
* `Popover.Trigger`). Place it directly inside TeachingPopover (a Fragment is fine): the popover
|
|
15340
|
+
* then starts closed unless `defaultOpen` says otherwise. A trigger nested deeper still works, but
|
|
15341
|
+
* leaves `defaultOpen` at `true` and becomes the target once it has mounted.
|
|
15342
|
+
*
|
|
15343
|
+
* @example
|
|
15344
|
+
* <TeachingPopover steps={steps}>
|
|
15345
|
+
* <TeachingPopover.Trigger>
|
|
15346
|
+
* <Button>Take the tour</Button>
|
|
15347
|
+
* </TeachingPopover.Trigger>
|
|
15348
|
+
* </TeachingPopover>
|
|
15349
|
+
*
|
|
15350
|
+
* Also exported as `TeachingPopoverTrigger` for React Server Components, which cannot use the
|
|
15351
|
+
* dotted `TeachingPopover.Trigger` (that needs a client file).
|
|
15352
|
+
*/
|
|
15353
|
+
export declare const TeachingPopoverTrigger: {
|
|
15354
|
+
({ children, asChild, onClick, ref, ...rest }: TeachingPopoverTriggerProps): React_2.ReactNode;
|
|
15355
|
+
displayName: string;
|
|
15356
|
+
};
|
|
15357
|
+
|
|
15358
|
+
/**
|
|
15359
|
+
* Props a `TeachingPopover.Trigger` puts on its element; a render-prop child receives them (spread
|
|
15360
|
+
* them onto the element that opens the popover).
|
|
15361
|
+
*/
|
|
15362
|
+
export declare type TeachingPopoverTriggerChildProps = Omit<React_2.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
15363
|
+
'aria-haspopup': 'dialog';
|
|
15364
|
+
'aria-expanded': boolean;
|
|
15365
|
+
/** The surface's id, only while the popover is open. */
|
|
15366
|
+
'aria-controls': string | undefined;
|
|
15367
|
+
onClick: React_2.MouseEventHandler<HTMLElement>;
|
|
15368
|
+
ref: React_2.RefCallback<HTMLElement>;
|
|
15369
|
+
};
|
|
15370
|
+
|
|
15371
|
+
/** Properties for the TeachingPopoverTrigger sub-component. */
|
|
15372
|
+
export declare interface TeachingPopoverTriggerProps extends Omit<React_2.HTMLAttributes<HTMLElement>, 'children'> {
|
|
15373
|
+
/**
|
|
15374
|
+
* The element that opens and closes the popover (its props are merged onto it), or a render
|
|
15375
|
+
* function that receives the trigger props.
|
|
15376
|
+
*/
|
|
15377
|
+
children: React_2.ReactNode | ((props: TeachingPopoverTriggerChildProps) => React_2.ReactNode);
|
|
15378
|
+
/**
|
|
15379
|
+
* `false` renders a wrapper `<span>` carrying the trigger props around the children instead of
|
|
15380
|
+
* merging them onto the child. `aria-haspopup`, `aria-expanded` and `aria-controls`, which a
|
|
15381
|
+
* generic element cannot carry, go to the first element in the tab order inside the span. A
|
|
15382
|
+
* render-prop child ignores `asChild` and receives every prop.
|
|
15383
|
+
* @default true
|
|
15384
|
+
*/
|
|
15385
|
+
asChild?: boolean;
|
|
15386
|
+
/** Ref to the trigger element (the child, or the wrapper span). */
|
|
15387
|
+
ref?: React_2.Ref<HTMLElement>;
|
|
13331
15388
|
}
|
|
13332
15389
|
|
|
13333
15390
|
/**
|
|
@@ -14900,6 +16957,23 @@ export declare interface TreeProps extends React_2.HTMLAttributes<HTMLDivElement
|
|
|
14900
16957
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
14901
16958
|
}
|
|
14902
16959
|
|
|
16960
|
+
/**
|
|
16961
|
+
* Shortens the text of a breadcrumb item that is longer than `maxLength` characters: it trims the
|
|
16962
|
+
* text, keeps the first `maxLength` characters and adds `...`. Shorter text, and text of exactly
|
|
16963
|
+
* `maxLength` characters, is returned unchanged. Show the full text in a tooltip when
|
|
16964
|
+
* {@link isTruncatableBreadcrumbContent} is true.
|
|
16965
|
+
* @default maxLength 30
|
|
16966
|
+
*/
|
|
16967
|
+
export declare function truncateBreadcrumbLongName(content: string, maxLength?: number): string;
|
|
16968
|
+
|
|
16969
|
+
/**
|
|
16970
|
+
* Shortens the text of a breadcrumb item's tooltip that is longer than `maxLength` characters, the
|
|
16971
|
+
* same way as {@link truncateBreadcrumbLongName}. Fluent UI spells this function
|
|
16972
|
+
* `truncateBreadcrumLongTooltip`; WaveUI spells it correctly and keeps no alias.
|
|
16973
|
+
* @default maxLength 80
|
|
16974
|
+
*/
|
|
16975
|
+
export declare function truncateBreadcrumbLongTooltip(content: string, maxLength?: number): string;
|
|
16976
|
+
|
|
14903
16977
|
/** Typography scale variant mapping to Fluent UI type ramp tokens. */
|
|
14904
16978
|
export declare type TypographyVariant = 'caption-2' | 'caption-1' | 'body-1' | 'body-2' | 'subtitle-2' | 'subtitle-1' | 'title-3' | 'title-2' | 'title-1' | 'large-title' | 'display';
|
|
14905
16979
|
|
|
@@ -15364,6 +17438,12 @@ export declare interface UseGridNavigationResult {
|
|
|
15364
17438
|
gridProps: GridNavigationHandlers;
|
|
15365
17439
|
}
|
|
15366
17440
|
|
|
17441
|
+
/**
|
|
17442
|
+
* Whether the enclosing {@link Overflow} currently hides at least one item (the button that the
|
|
17443
|
+
* `hasHiddenItems` prop reserves does not count). Must be called inside `Overflow`.
|
|
17444
|
+
*/
|
|
17445
|
+
export declare function useHasHiddenItems(): boolean;
|
|
17446
|
+
|
|
15367
17447
|
/**
|
|
15368
17448
|
* Generates a stable, SSR-safe unique id, optionally with a prefix. Wraps React's `useId` so every
|
|
15369
17449
|
* component builds DOM ids the same way (C-IDS).
|
|
@@ -15408,6 +17488,12 @@ export declare interface UseInitialFocusOptions {
|
|
|
15408
17488
|
*/
|
|
15409
17489
|
export declare function useIsClient(): boolean;
|
|
15410
17490
|
|
|
17491
|
+
/**
|
|
17492
|
+
* How much of the item group `groupId` is shown: `'visible'` (every member, and also a group
|
|
17493
|
+
* without items), `'hidden'` (none) or `'overflow'` (some). Must be called inside `Overflow`.
|
|
17494
|
+
*/
|
|
17495
|
+
export declare function useIsOverflowGroupVisible(groupId: string): OverflowGroupVisibility;
|
|
17496
|
+
|
|
15411
17497
|
/**
|
|
15412
17498
|
* Whether `target`'s content is wider than the element (`scrollWidth > clientWidth`).
|
|
15413
17499
|
*
|