@okshaun/components 4.1.5 → 5.0.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 +1 -1
- package/dist/icon-metadata.json +134 -0
- package/dist/index.js +16208 -10749
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +754 -530
- package/dist/{preset-jXQwQ5KL.js → preset-B6fsdoKY.js} +2338 -317
- package/dist/preset-B6fsdoKY.js.map +1 -0
- package/dist/preset.js +1 -1
- package/dist/specs/keyframes.json +66 -0
- package/dist/specs/recipes.json +394 -26
- package/dist/specs/tokens.json +15 -0
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +248 -2
- package/dist/styles.css +3971 -789
- package/dist/svgs/barcode-reader-off.svg +1 -0
- package/dist/svgs/circle-dashed.svg +1 -0
- package/dist/svgs/drawer-left-hide.svg +1 -0
- package/dist/svgs/drawer-left-show.svg +1 -0
- package/dist/svgs/drawer-right-hide.svg +1 -0
- package/dist/svgs/drawer-right-show.svg +1 -0
- package/dist/svgs/not-equal.svg +1 -0
- package/dist/svgs/square-dashed.svg +1 -0
- package/dist/types/index.d.ts +2989 -115
- package/package.json +9 -12
- package/src/recipes/alert.ts +80 -0
- package/src/recipes/autocomplete.ts +2 -2
- package/src/recipes/avatar.ts +13 -6
- package/src/recipes/button.ts +41 -30
- package/src/recipes/checkbox.ts +3 -0
- package/src/recipes/chip.ts +16 -0
- package/src/recipes/code.ts +40 -23
- package/src/recipes/codeBlock.ts +277 -0
- package/src/recipes/drawer.ts +150 -0
- package/src/recipes/filterField.ts +138 -0
- package/src/recipes/filterMenu.ts +71 -0
- package/src/recipes/filterToken.ts +189 -0
- package/src/recipes/inlineNote.ts +49 -0
- package/src/recipes/keyFact.ts +111 -0
- package/src/recipes/listItem.ts +25 -0
- package/src/recipes/menu.ts +41 -2
- package/src/recipes/pageBanner.ts +110 -0
- package/src/recipes/peekBar.ts +35 -0
- package/src/recipes/popover.ts +206 -0
- package/src/recipes/printPreview.ts +101 -0
- package/src/recipes/recipes-regular.ts +1 -1
- package/src/recipes/recipes-slot.ts +14 -0
- package/src/recipes/segmentedFields.ts +11 -5
- package/src/recipes/select.ts +204 -63
- package/src/recipes/spinner.ts +1 -1
- package/src/recipes/tabs.ts +161 -0
- package/src/recipes/tag.ts +13 -2
- package/src/recipes/timeMenus.ts +1 -1
- package/src/recipes/toast.ts +116 -0
- package/src/recipes/toggle.ts +3 -3
- package/src/styles/primitives/fontSizes.ts +1 -0
- package/src/styles/primitives/radii.ts +2 -0
- package/src/styles/utilities/keyframes.ts +38 -0
- package/src/utils/compoundComponent.ts +29 -0
- package/dist/preset-jXQwQ5KL.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -4,22 +4,32 @@ import { Component } from 'react';
|
|
|
4
4
|
import { ComponentPropsWithRef } from 'react';
|
|
5
5
|
import { ComponentType } from 'react';
|
|
6
6
|
import { Context } from 'react';
|
|
7
|
+
import { CSSProperties } from 'react';
|
|
8
|
+
import { Dispatch } from 'react';
|
|
7
9
|
import { ElementType } from 'react';
|
|
10
|
+
import { FloatingContext } from '@floating-ui/react';
|
|
8
11
|
import { FormApi } from '@tanstack/react-form';
|
|
9
12
|
import { FormAsyncValidateOrFn } from '@tanstack/react-form';
|
|
10
13
|
import { FormValidateOrFn } from '@tanstack/react-form';
|
|
11
14
|
import { HTMLProps } from 'react';
|
|
15
|
+
import { InputHTMLAttributes } from 'react';
|
|
12
16
|
import { JSX } from 'react/jsx-runtime';
|
|
13
17
|
import { JSX as JSX_2 } from 'react';
|
|
14
18
|
import { JSXElementConstructor } from 'react';
|
|
19
|
+
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
20
|
+
import { KeyboardEventHandler } from 'react';
|
|
15
21
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
22
|
+
import { MutableRefObject } from 'react';
|
|
16
23
|
import { Placement } from '@floating-ui/react';
|
|
17
24
|
import { Preset } from '@pandacss/types';
|
|
18
25
|
import { ReactElement } from 'react';
|
|
19
26
|
import { ReactFormExtendedApi } from '@tanstack/react-form';
|
|
20
27
|
import { ReactNode } from 'react';
|
|
21
28
|
import { Ref } from 'react';
|
|
29
|
+
import { RefCallback } from 'react';
|
|
30
|
+
import { ReferenceType } from '@floating-ui/react';
|
|
22
31
|
import { RefObject } from 'react';
|
|
32
|
+
import { SetStateAction } from 'react';
|
|
23
33
|
import { useForm } from '@tanstack/react-form';
|
|
24
34
|
|
|
25
35
|
declare type AdvancedPseudos =
|
|
@@ -48,6 +58,76 @@ declare type AdvancedPseudos =
|
|
|
48
58
|
| ":nth-of-type"
|
|
49
59
|
| ":where";
|
|
50
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Announces a state or outcome inline, in the flow of the section it concerns.
|
|
63
|
+
*
|
|
64
|
+
* Use `Alert` for blocking feedback the user must read before continuing and
|
|
65
|
+
* for section-level awareness. Use `PageBanner` for a system condition that
|
|
66
|
+
* affects the whole page, `Toast` for transient non-blocking feedback, and
|
|
67
|
+
* `InlineNote` for guidance attached to a single form field.
|
|
68
|
+
*
|
|
69
|
+
* Renders a `div` with `role="alert"` when `tone` is `danger` so assistive
|
|
70
|
+
* technology interrupts, and `role="status"` otherwise so it announces
|
|
71
|
+
* politely. `tone="neutral"` uses the info icon.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <Alert tone="danger" title="Could not save" dismissible onDismiss={clear}>
|
|
76
|
+
* The server rejected the request.
|
|
77
|
+
* </Alert>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const Alert: (props: AlertProps) => JSX.Element;
|
|
81
|
+
|
|
82
|
+
declare type AlertDismissProps = {
|
|
83
|
+
/** Adds a close control. The alert does not remove itself. */
|
|
84
|
+
dismissible: true;
|
|
85
|
+
/** Runs when the close control is activated. */
|
|
86
|
+
onDismiss: () => void;
|
|
87
|
+
} | {
|
|
88
|
+
/** @default false */
|
|
89
|
+
dismissible?: false;
|
|
90
|
+
onDismiss?: never;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
declare type AlertOwnProps = {
|
|
94
|
+
/** Semantic tone. Selects the surface, border, and tone icon. */
|
|
95
|
+
/** @default "info" */
|
|
96
|
+
tone?: AlertTone;
|
|
97
|
+
/** Optional bold title rendered above the message. It does not create a document heading. */
|
|
98
|
+
title?: string;
|
|
99
|
+
/** The alert message. */
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
/** Leading action, normally a `Button`. */
|
|
102
|
+
primaryAction?: ReactNode;
|
|
103
|
+
/** Trailing action, normally a lower-emphasis `Button`. Render only alongside `primaryAction`. */
|
|
104
|
+
secondaryAction?: ReactNode;
|
|
105
|
+
/** Accessible label for the close control. @default "Dismiss" */
|
|
106
|
+
dismissLabel?: string;
|
|
107
|
+
} & AlertDismissProps;
|
|
108
|
+
|
|
109
|
+
/** Props accepted by {@link Alert}. Includes compatible native element props. */
|
|
110
|
+
export declare type AlertProps = Omit<BoxProps, keyof AlertVariantProps | keyof AlertOwnProps> & Omit<AlertVariantProps, 'tone'> & AlertOwnProps;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Semantic tone shared by every notification component.
|
|
114
|
+
*
|
|
115
|
+
* `neutral` renders the info icon: it marks the message as informational
|
|
116
|
+
* without claiming a state.
|
|
117
|
+
*/
|
|
118
|
+
export declare type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
119
|
+
|
|
120
|
+
declare interface AlertVariant {
|
|
121
|
+
/**
|
|
122
|
+
* @default "info"
|
|
123
|
+
*/
|
|
124
|
+
tone: "info" | "success" | "warning" | "danger" | "neutral"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare type AlertVariantProps = {
|
|
128
|
+
[key in keyof AlertVariant]?: ConditionalValue<AlertVariant[key]> | undefined
|
|
129
|
+
}
|
|
130
|
+
|
|
51
131
|
/**
|
|
52
132
|
* Numeric design-token sizes supported by the icon recipe. Non-numeric sizes
|
|
53
133
|
* do not have corresponding recipe variants.
|
|
@@ -79,6 +159,7 @@ declare type AriaAttributes =
|
|
|
79
159
|
declare type AspectRatioToken = "square" | "landscape" | "portrait" | "wide" | "ultrawide" | "golden"
|
|
80
160
|
|
|
81
161
|
declare type AsProp<T extends ElementType> = {
|
|
162
|
+
/** Element or component rendered by the polymorphic component. */
|
|
82
163
|
/** @default "div" */
|
|
83
164
|
as?: T;
|
|
84
165
|
};
|
|
@@ -142,12 +223,31 @@ declare type AutocompleteBaseProps = Omit<BoxProps, keyof AutocompleteVariantPro
|
|
|
142
223
|
/** Runs when interaction requests that the listbox open or close. */
|
|
143
224
|
onOpenChange?: (open: boolean, reason: AutocompleteOpenChangeReason) => void;
|
|
144
225
|
/**
|
|
145
|
-
* Offers the current input as a selectable option
|
|
146
|
-
*
|
|
226
|
+
* Offers the current input as a selectable create option whenever there is
|
|
227
|
+
* typed text. The create option stays first and is the default action;
|
|
228
|
+
* choosing a catalog option requires an explicit click or Enter on that
|
|
229
|
+
* row. Blur and outside dismiss commit create; Escape cancels and clears
|
|
230
|
+
* the draft.
|
|
231
|
+
*
|
|
232
|
+
* Intended for single-select. Consumers should use `multiple={false}` when
|
|
233
|
+
* enabling custom values (switch modes in the app if needed).
|
|
147
234
|
*
|
|
148
235
|
* @default false
|
|
149
236
|
*/
|
|
150
237
|
allowCustomValue?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Forces search-chip (`data-new`) styling for the controlled single value,
|
|
240
|
+
* even when a child `Option` shares that value. Consumers should set this
|
|
241
|
+
* on hydrate (for example when a URL exact flag is absent) and on every
|
|
242
|
+
* change from `onValueChange`: `'create-option'` → true,
|
|
243
|
+
* `'select-option'` → false.
|
|
244
|
+
*
|
|
245
|
+
* Single-select only; ignored when `multiple` is true.
|
|
246
|
+
*
|
|
247
|
+
* @default undefined (infer: unmatched values are custom when
|
|
248
|
+
* `allowCustomValue` is on; matching `Option`s are exact)
|
|
249
|
+
*/
|
|
250
|
+
isCustomValue?: boolean;
|
|
151
251
|
/** Creates the visible label for a custom-value option. */
|
|
152
252
|
getCreateOptionLabel?: (inputValue: string) => string;
|
|
153
253
|
/**
|
|
@@ -261,7 +361,7 @@ export declare const Avatar: (props: AvatarProps) => JSX.Element;
|
|
|
261
361
|
export declare type AvatarPresence = 'online' | 'busy' | 'offline' | 'focus';
|
|
262
362
|
|
|
263
363
|
/** Props accepted by {@link Avatar}. */
|
|
264
|
-
export declare type AvatarProps = Omit<BoxProps, keyof AvatarVariantProps> & Omit<AvatarVariantProps, 'size' | 'shape'> & {
|
|
364
|
+
export declare type AvatarProps = Omit<BoxProps, keyof AvatarVariantProps> & Omit<AvatarVariantProps, 'size' | 'shape' | 'stacked'> & {
|
|
265
365
|
/** Image source URL */
|
|
266
366
|
src?: string;
|
|
267
367
|
/** Alt text for image */
|
|
@@ -288,6 +388,40 @@ export declare type AvatarShape = 'circle' | 'square' | 'hexagon';
|
|
|
288
388
|
/** Supported visual sizes for {@link Avatar}. */
|
|
289
389
|
export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
290
390
|
|
|
391
|
+
/**
|
|
392
|
+
* A row of overlapping avatars with an optional "+N" overflow avatar.
|
|
393
|
+
*
|
|
394
|
+
* Each avatar overlaps the previous one by 4px and gets a 2px ring in the
|
|
395
|
+
* surface color, drawn inside its edge so initials stay readable. Use circle
|
|
396
|
+
* or square avatars; the ring does not follow the hexagon shape.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```tsx
|
|
400
|
+
* <AvatarStack max={3} aria-label="Assigned to 5 people">
|
|
401
|
+
* <Avatar name="Ada Lovelace" />
|
|
402
|
+
* <Avatar name="Grace Hopper" />
|
|
403
|
+
* <Avatar name="Alan Turing" />
|
|
404
|
+
* <Avatar name="Katherine Johnson" />
|
|
405
|
+
* <Avatar name="Edsger Dijkstra" />
|
|
406
|
+
* </AvatarStack>
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
409
|
+
export declare const AvatarStack: (props: AvatarStackProps) => JSX.Element;
|
|
410
|
+
|
|
411
|
+
/** Props accepted by {@link AvatarStack}. */
|
|
412
|
+
export declare type AvatarStackProps = BoxProps & {
|
|
413
|
+
/** `Avatar` elements to show, in order. Later avatars sit on top of earlier ones. */
|
|
414
|
+
children?: ReactNode;
|
|
415
|
+
/** Size applied to every avatar that does not set its own `size`. */
|
|
416
|
+
/** @default "md" */
|
|
417
|
+
size?: AvatarSize;
|
|
418
|
+
/**
|
|
419
|
+
* Largest number of avatars to show. Any avatars after this number are
|
|
420
|
+
* replaced by one "+N" overflow avatar. Leave unset to show all avatars.
|
|
421
|
+
*/
|
|
422
|
+
max?: number;
|
|
423
|
+
};
|
|
424
|
+
|
|
291
425
|
/** Status states displayed at the top-right of an avatar. */
|
|
292
426
|
export declare type AvatarStatus = 'approved' | 'declined' | 'locked';
|
|
293
427
|
|
|
@@ -300,6 +434,7 @@ declare interface AvatarVariant {
|
|
|
300
434
|
* @default "circle"
|
|
301
435
|
*/
|
|
302
436
|
shape: "circle" | "square" | "hexagon"
|
|
437
|
+
stacked: boolean
|
|
303
438
|
}
|
|
304
439
|
|
|
305
440
|
declare type AvatarVariantProps = {
|
|
@@ -375,10 +510,21 @@ declare type BorderToken = "default" | "bold" | "inverse" | "disabled" | "input"
|
|
|
375
510
|
declare type BorderWidthToken = "0" | "1" | "2" | "4" | "8" | "16"
|
|
376
511
|
|
|
377
512
|
/**
|
|
378
|
-
*
|
|
379
|
-
*
|
|
513
|
+
* Renders a token-aware polymorphic foundation for design-system components.
|
|
514
|
+
*
|
|
515
|
+
* `Box` renders a `div` by default. Set `as` to use another semantic element or
|
|
516
|
+
* component; compatible native props and the React 19 `ref` prop follow that
|
|
517
|
+
* selection. Prefer a semantic component when one already expresses the
|
|
518
|
+
* intended behavior.
|
|
519
|
+
*
|
|
520
|
+
* @example
|
|
521
|
+
* ```tsx
|
|
522
|
+
* <Box as="section" p="16" aria-labelledby="summary-heading">
|
|
523
|
+
* Summary content
|
|
524
|
+
* </Box>
|
|
525
|
+
* ```
|
|
380
526
|
*/
|
|
381
|
-
export declare const Box: <T extends ElementType = "div">(props: BoxProps<T>) =>
|
|
527
|
+
export declare const Box: <T extends ElementType = "div">(props: BoxProps<T>) => JSX.Element;
|
|
382
528
|
|
|
383
529
|
declare type BoxOwnProps = SystemStyleObject_2 & BoxVariantProps;
|
|
384
530
|
|
|
@@ -393,11 +539,29 @@ declare type BoxVariantProps = {
|
|
|
393
539
|
[key in keyof BoxVariant]?: ConditionalValue<BoxVariant[key]> | undefined
|
|
394
540
|
}
|
|
395
541
|
|
|
542
|
+
/** One segment of a {@link Breadcrumbs} path. */
|
|
543
|
+
export declare type BreadcrumbItem = {
|
|
544
|
+
/** Stable key for the segment. */
|
|
545
|
+
id: string;
|
|
546
|
+
/** Visible segment text. */
|
|
547
|
+
label: string;
|
|
548
|
+
/** Destination of a linked segment. Omit it for the current page. */
|
|
549
|
+
href?: string;
|
|
550
|
+
/**
|
|
551
|
+
* Called when a linked segment is clicked. Call `event.preventDefault()` to
|
|
552
|
+
* handle the navigation in the app, such as a client-side route change or
|
|
553
|
+
* closing a panel, instead of following `href`. A segment without `href`
|
|
554
|
+
* is plain text and ignores this handler.
|
|
555
|
+
*/
|
|
556
|
+
onClick?: (event: MouseEvent_2<HTMLAnchorElement>) => void;
|
|
557
|
+
};
|
|
558
|
+
|
|
396
559
|
/**
|
|
397
560
|
* Displays the current navigation path as a semantic unordered list.
|
|
398
561
|
*
|
|
399
562
|
* Linked segments use {@link Link}; segments without `href` are rendered as
|
|
400
|
-
* plain text.
|
|
563
|
+
* plain text. Give a linked segment `onClick` when the app handles the
|
|
564
|
+
* navigation itself. Use page navigation instead when the hierarchy is not a path to
|
|
401
565
|
* the current location.
|
|
402
566
|
*
|
|
403
567
|
* @example
|
|
@@ -419,11 +583,7 @@ export declare type BreadcrumbsProps = Omit<BoxProps, keyof BreadcrumbsVariantPr
|
|
|
419
583
|
* without it renders as plain text, which is normally the current page.
|
|
420
584
|
* Keep the final segment non-linked when it represents the current page.
|
|
421
585
|
*/
|
|
422
|
-
items:
|
|
423
|
-
id: string;
|
|
424
|
-
label: string;
|
|
425
|
-
href?: string;
|
|
426
|
-
}[];
|
|
586
|
+
items: BreadcrumbItem[];
|
|
427
587
|
};
|
|
428
588
|
|
|
429
589
|
declare interface BreadcrumbsVariant {
|
|
@@ -472,11 +632,13 @@ declare type BreakpointToken = "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
|
472
632
|
* `FormField` or slot context, explicitly supplied `size`, `error`, `invalid`,
|
|
473
633
|
* and `disabled` values take precedence over slot context, which takes
|
|
474
634
|
* precedence over field context. Its recipe defaults to the `standard` variant
|
|
475
|
-
* and `md` size.
|
|
635
|
+
* and `md` size. Set `disabledReason` instead of `disabled` when the user needs
|
|
636
|
+
* to know why the action is unavailable.
|
|
476
637
|
*
|
|
477
638
|
* @example
|
|
478
639
|
* ```tsx
|
|
479
640
|
* <Button onClick={saveInvoice}>Save invoice</Button>
|
|
641
|
+
* <Button disabledReason="Closed orders can't be edited.">Edit order</Button>
|
|
480
642
|
* ```
|
|
481
643
|
*/
|
|
482
644
|
export declare const Button: (props: ButtonProps) => JSX.Element;
|
|
@@ -521,10 +683,18 @@ export declare type ButtonProps = Omit<BoxProps, keyof ButtonVariantProps | 'chi
|
|
|
521
683
|
/** Sets `aria-invalid` and marks the control invalid for styling and slots. */
|
|
522
684
|
invalid?: boolean;
|
|
523
685
|
/**
|
|
524
|
-
* Disables a native button. For links, marks the anchor `aria-disabled
|
|
525
|
-
*
|
|
686
|
+
* Disables a native button. For links, marks the anchor `aria-disabled`,
|
|
687
|
+
* removes its `href` so it can't navigate, and keeps it focusable.
|
|
526
688
|
*/
|
|
527
689
|
disabled?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Disables the action and explains why. The control stays focusable and
|
|
692
|
+
* is marked `aria-disabled`, clicks are blocked, the reason shows in a
|
|
693
|
+
* tooltip on hover and focus, and it is linked with `aria-describedby`.
|
|
694
|
+
* Use it instead of `disabled` whenever the user can't tell why an action
|
|
695
|
+
* is unavailable, such as a missing permission or a locked record.
|
|
696
|
+
*/
|
|
697
|
+
disabledReason?: string;
|
|
528
698
|
/**
|
|
529
699
|
* Native button type; ignored when `href` causes the component to render an
|
|
530
700
|
* anchor.
|
|
@@ -745,12 +915,18 @@ declare type CheckboxVariantProps = {
|
|
|
745
915
|
* roving focus; grouped multi-select chips use checkbox behavior. `before` and
|
|
746
916
|
* `after` slots inherit state through slot context.
|
|
747
917
|
*
|
|
918
|
+
* Pass `items` instead of `children` to show a list. Lists with more than two
|
|
919
|
+
* items show the first two plus a `+N` count (by item count, not width) and
|
|
920
|
+
* reveal the full list in a tooltip. A static overflowing chip becomes
|
|
921
|
+
* keyboard-focusable so the tooltip can be opened without a pointer, and its
|
|
922
|
+
* full list is also exposed to screen readers.
|
|
923
|
+
*
|
|
748
924
|
* @example
|
|
749
925
|
* ```tsx
|
|
750
926
|
* <Chip dismissable onDismiss={() => remove('design')}>Design</Chip>
|
|
751
927
|
* ```
|
|
752
928
|
*/
|
|
753
|
-
export declare const Chip: (props: ChipProps) => JSX.Element;
|
|
929
|
+
export declare const Chip: (props: ChipProps) => JSX.Element | null;
|
|
754
930
|
|
|
755
931
|
/**
|
|
756
932
|
* Coordinates the selection and keyboard behavior of child {@link Chip} values.
|
|
@@ -808,9 +984,26 @@ export declare type ChipGroupProps = Omit<WrapProps, 'role'> & Omit<BoxProps, ke
|
|
|
808
984
|
|
|
809
985
|
export declare type ChipGroupType = 'single' | 'multi';
|
|
810
986
|
|
|
811
|
-
/**
|
|
812
|
-
|
|
987
|
+
/** The chip label: either `children` or an `items` list, never both. */
|
|
988
|
+
declare type ChipLabelProps = {
|
|
989
|
+
/** Visible chip label. A string label is also used in the default dismissal label. */
|
|
813
990
|
children: ReactNode;
|
|
991
|
+
items?: never;
|
|
992
|
+
} | {
|
|
993
|
+
children?: never;
|
|
994
|
+
/**
|
|
995
|
+
* Label list rendered comma-joined. With more than two items only the
|
|
996
|
+
* first two are shown, followed by `+N` for the rest, and a tooltip
|
|
997
|
+
* lists every item. Overflow is decided by item count, not available
|
|
998
|
+
* width. An empty list renders nothing and the chip does not register
|
|
999
|
+
* with a parent `ChipGroup`. If the emptied chip was the group's selected
|
|
1000
|
+
* value, clear that value; otherwise no visible chip is the tab stop.
|
|
1001
|
+
*/
|
|
1002
|
+
items: string[];
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
/** Props for {@link Chip}, a compact label that can be static, actionable, selectable, or dismissible. */
|
|
1006
|
+
export declare type ChipProps = Omit<BoxProps, keyof ChipVariantProps | 'children'> & Omit<ChipVariantProps, 'before' | 'after'> & ChipLabelProps & {
|
|
814
1007
|
/** Content displayed before the chip label. */
|
|
815
1008
|
before?: ReactNode;
|
|
816
1009
|
/** Content displayed after the chip label and before the dismiss control. */
|
|
@@ -825,11 +1018,17 @@ export declare type ChipProps = Omit<BoxProps, keyof ChipVariantProps | 'childre
|
|
|
825
1018
|
dismissable?: boolean;
|
|
826
1019
|
/**
|
|
827
1020
|
* Accessible name for the dismiss button.
|
|
828
|
-
* @default `Remove ${children}`
|
|
1021
|
+
* @default `labels.removeItem` (English: `Remove ${children}`, or `Remove` plus the comma-joined `items`)
|
|
829
1022
|
*/
|
|
830
1023
|
dismissLabel?: string;
|
|
1024
|
+
/** Ref forwarded to the dismiss button. */
|
|
1025
|
+
dismissButtonRef?: Ref<HTMLButtonElement>;
|
|
1026
|
+
/** Tab order override for the dismiss button. */
|
|
1027
|
+
dismissButtonTabIndex?: number;
|
|
831
1028
|
/** Called when the dismiss button is activated. The button is disabled when this callback is absent. */
|
|
832
1029
|
onDismiss?: () => void;
|
|
1030
|
+
/** Keyboard handler composed onto the dismiss button. */
|
|
1031
|
+
onDismissKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
|
|
833
1032
|
onClick?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
834
1033
|
/** Value used by a parent `ChipGroup` to identify and select this chip. */
|
|
835
1034
|
value?: string;
|
|
@@ -860,28 +1059,168 @@ declare type ChipVariantProps = {
|
|
|
860
1059
|
}
|
|
861
1060
|
|
|
862
1061
|
/**
|
|
863
|
-
*
|
|
1062
|
+
* Marks a short piece of code, an identifier, or a machine value inside text.
|
|
1063
|
+
*
|
|
1064
|
+
* Renders a native `code` element. The font size follows the surrounding
|
|
1065
|
+
* text, and long values wrap rather than overflow. Use `CodeBlock` for
|
|
1066
|
+
* multi-line code, or when the reader needs a copy button. Use `Kbd` for
|
|
1067
|
+
* keyboard shortcuts.
|
|
864
1068
|
*
|
|
865
|
-
*
|
|
866
|
-
*
|
|
1069
|
+
* The default `subtle` variant tints the background. Use `outline` where a
|
|
1070
|
+
* tint competes with a selected row, and `plain` for monospace values in dense
|
|
1071
|
+
* tables, such as part numbers.
|
|
867
1072
|
*
|
|
868
1073
|
* @example
|
|
869
1074
|
* ```tsx
|
|
870
|
-
* <
|
|
1075
|
+
* <Text>
|
|
1076
|
+
* Set <Code>API_TOKEN</Code> in your environment, then send it as a bearer token.
|
|
1077
|
+
* </Text>
|
|
871
1078
|
* ```
|
|
872
1079
|
*/
|
|
873
1080
|
export declare const Code: (props: CodeProps) => JSX.Element;
|
|
874
1081
|
|
|
875
|
-
/**
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1082
|
+
/**
|
|
1083
|
+
* Displays read-only, multi-line code or machine output with a copy button.
|
|
1084
|
+
*
|
|
1085
|
+
* Renders native `pre` and `code` elements. Long lines scroll horizontally by
|
|
1086
|
+
* default; set `wrap` for prose-like output such as logs or email bodies. Use
|
|
1087
|
+
* `maxLines` to collapse long output behind a "Show all" button, and `title`
|
|
1088
|
+
* for a file name or label. Use `Code` for code inside a sentence.
|
|
1089
|
+
*
|
|
1090
|
+
* When the content overflows, the scroll area becomes a labelled, focusable
|
|
1091
|
+
* region so keyboard users can scroll it. The copy button announces "Copied"
|
|
1092
|
+
* through a polite live region. The block does not highlight syntax.
|
|
1093
|
+
*
|
|
1094
|
+
* `tone="inverse"` follows the theme: it is dark in the light theme and light
|
|
1095
|
+
* in the dark theme.
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```tsx
|
|
1099
|
+
* <CodeBlock title="Request" language="json" code={prettyJson} maxLines={12} />
|
|
1100
|
+
* ```
|
|
1101
|
+
*/
|
|
1102
|
+
export declare const CodeBlock: (props: CodeBlockProps) => JSX.Element;
|
|
1103
|
+
|
|
1104
|
+
declare type CodeBlockOwnProps = {
|
|
1105
|
+
/**
|
|
1106
|
+
* The code to display, as plain text. Takes precedence over `children`.
|
|
1107
|
+
* One trailing line break is removed.
|
|
1108
|
+
*/
|
|
1109
|
+
code?: string;
|
|
1110
|
+
/** The code to display, as plain text, when `code` is not provided. */
|
|
1111
|
+
children?: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Programming or data language, such as `sql` or `json`. Rendered as
|
|
1114
|
+
* `data-language` and a `language-*` class, and used in the accessible name
|
|
1115
|
+
* when there is no string `title`. It does not apply syntax highlighting.
|
|
1116
|
+
*/
|
|
1117
|
+
language?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Header text, such as a file name or a short label. Renders a header bar
|
|
1120
|
+
* that holds the title and the copy button.
|
|
1121
|
+
*/
|
|
1122
|
+
title?: ReactNode;
|
|
1123
|
+
/**
|
|
1124
|
+
* Shows a copy button. The button copies the plain text, never the line
|
|
1125
|
+
* numbers, and announces the result to screen readers.
|
|
1126
|
+
*
|
|
1127
|
+
* @default true
|
|
1128
|
+
*/
|
|
1129
|
+
copyable?: boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* Accessible label and tooltip for the copy button. Overrides the
|
|
1132
|
+
* `copyCode` label from `LocaleProvider`.
|
|
1133
|
+
*
|
|
1134
|
+
* @default "Copy code"
|
|
1135
|
+
*/
|
|
1136
|
+
copyLabel?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* Number of lines to show before the block collapses behind a "Show all"
|
|
1139
|
+
* button. Counts source lines; a wrapped line counts once.
|
|
1140
|
+
*/
|
|
1141
|
+
maxLines?: number;
|
|
1142
|
+
/** Controlled expanded state when `maxLines` collapses the block. */
|
|
1143
|
+
expanded?: boolean;
|
|
1144
|
+
/**
|
|
1145
|
+
* Initial expanded state when `expanded` is not provided.
|
|
1146
|
+
*
|
|
1147
|
+
* @default false
|
|
1148
|
+
*/
|
|
1149
|
+
defaultExpanded?: boolean;
|
|
1150
|
+
/** Runs when the user expands or collapses the block. */
|
|
1151
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
1152
|
+
/**
|
|
1153
|
+
* Shows a line number beside each line. Pass `{ start }` to number from a
|
|
1154
|
+
* value other than 1. Line numbers are hidden from screen readers and are
|
|
1155
|
+
* not copied.
|
|
1156
|
+
*
|
|
1157
|
+
* @default false
|
|
1158
|
+
*/
|
|
1159
|
+
lineNumbers?: boolean | {
|
|
1160
|
+
start: number;
|
|
1161
|
+
};
|
|
1162
|
+
/**
|
|
1163
|
+
* Surface tone. `inverse` follows the theme: it is dark in the light theme
|
|
1164
|
+
* and light in the dark theme. Takes a plain value, not a responsive or
|
|
1165
|
+
* conditional object, because the copy button variant follows it.
|
|
1166
|
+
*
|
|
1167
|
+
* @default "default"
|
|
1168
|
+
*/
|
|
1169
|
+
tone?: 'default' | 'inverse';
|
|
881
1170
|
};
|
|
882
1171
|
|
|
883
|
-
|
|
1172
|
+
/** Props accepted by {@link CodeBlock}. Includes compatible native element props. */
|
|
1173
|
+
export declare type CodeBlockProps = Omit<BoxProps, keyof CodeBlockVariantProps | keyof CodeBlockOwnProps> & Omit<CodeBlockVariantProps, 'tone' | 'lineNumbers' | 'collapsed' | 'actionGutter'> & CodeBlockOwnProps;
|
|
1174
|
+
|
|
1175
|
+
declare interface CodeBlockVariant {
|
|
1176
|
+
/**
|
|
1177
|
+
* @default "default"
|
|
1178
|
+
*/
|
|
1179
|
+
tone: "default" | "inverse"
|
|
1180
|
+
/**
|
|
1181
|
+
* @default "md"
|
|
1182
|
+
*/
|
|
1183
|
+
size: "sm" | "md"
|
|
1184
|
+
/**
|
|
1185
|
+
* @default false
|
|
1186
|
+
*/
|
|
1187
|
+
wrap: boolean
|
|
1188
|
+
/**
|
|
1189
|
+
* @default false
|
|
1190
|
+
*/
|
|
1191
|
+
lineNumbers: boolean
|
|
1192
|
+
/**
|
|
1193
|
+
* @default false
|
|
1194
|
+
*/
|
|
1195
|
+
collapsed: boolean
|
|
1196
|
+
/**
|
|
1197
|
+
* @default false
|
|
1198
|
+
*/
|
|
1199
|
+
actionGutter: boolean
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
declare type CodeBlockVariantProps = {
|
|
1203
|
+
[key in keyof CodeBlockVariant]?: ConditionalValue<CodeBlockVariant[key]> | undefined
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
declare type CodeOwnProps = {
|
|
1207
|
+
/** Code, an identifier, or a value shown in a monospace font. */
|
|
1208
|
+
children?: ReactNode;
|
|
1209
|
+
/**
|
|
1210
|
+
* Programming or data language of the content, such as `sql` or `json`.
|
|
1211
|
+
* Rendered as `data-language`; it does not apply syntax highlighting.
|
|
1212
|
+
*/
|
|
1213
|
+
language?: string;
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
/** Props accepted by {@link Code}. Includes compatible native element props. */
|
|
1217
|
+
export declare type CodeProps = Omit<BoxProps, keyof CodeVariantProps | keyof CodeOwnProps> & CodeVariantProps & CodeOwnProps;
|
|
884
1218
|
|
|
1219
|
+
declare interface CodeVariant {
|
|
1220
|
+
/**
|
|
1221
|
+
* @default "subtle"
|
|
1222
|
+
*/
|
|
1223
|
+
variant: "subtle" | "outline" | "plain"
|
|
885
1224
|
}
|
|
886
1225
|
|
|
887
1226
|
declare type CodeVariantProps = {
|
|
@@ -1778,6 +2117,10 @@ export declare type DateInputProps = Omit<BoxProps, keyof SegmentedFieldsVariant
|
|
|
1778
2117
|
iconBefore?: IconNamesList;
|
|
1779
2118
|
/** Legacy icon rendered after the field when `after` is absent. */
|
|
1780
2119
|
iconAfter?: IconNamesList;
|
|
2120
|
+
/** Shows a clear action in the `after` slot when it is otherwise unused and the field has a value. @default true */
|
|
2121
|
+
clearable?: boolean;
|
|
2122
|
+
/** Accessible label for the clear action. @default 'Clear date' */
|
|
2123
|
+
clearLabel?: string;
|
|
1781
2124
|
/** Applies error styling. Overrides field context when provided. */
|
|
1782
2125
|
error?: boolean;
|
|
1783
2126
|
/** Prevents editing. Overrides field context when provided. */
|
|
@@ -1842,7 +2185,7 @@ export declare type DateMenuProps = Omit<MenuProps, 'children' | 'onChange' | 'v
|
|
|
1842
2185
|
export declare const DatePicker: (props: DatePickerProps) => JSX.Element;
|
|
1843
2186
|
|
|
1844
2187
|
/** Props for {@link DatePicker}, combining a segmented input and calendar menu. */
|
|
1845
|
-
export declare type DatePickerProps = Pick<DateInputProps, 'id' | 'label' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'size'> & {
|
|
2188
|
+
export declare type DatePickerProps = Pick<DateInputProps, 'id' | 'label' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'clearLabel' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'size'> & {
|
|
1846
2189
|
/** Controlled selected date. Pair with `onChange`. */
|
|
1847
2190
|
value?: DateValue | null;
|
|
1848
2191
|
/** Initial selected date when `value` is not provided. */
|
|
@@ -1911,6 +2254,10 @@ export declare type DateRangeInputProps = Omit<BoxProps, keyof SegmentedFieldsVa
|
|
|
1911
2254
|
iconBefore?: IconNamesList;
|
|
1912
2255
|
/** Legacy icon rendered after the range when `after` is absent. */
|
|
1913
2256
|
iconAfter?: IconNamesList;
|
|
2257
|
+
/** Shows a clear action in the `after` slot when it is otherwise unused and either endpoint has a value. @default true */
|
|
2258
|
+
clearable?: boolean;
|
|
2259
|
+
/** Accessible label for the clear action. @default 'Clear date range' */
|
|
2260
|
+
clearLabel?: string;
|
|
1914
2261
|
/** Applies error styling. Overrides field context when provided. */
|
|
1915
2262
|
error?: boolean;
|
|
1916
2263
|
/** Prevents editing both endpoints. Overrides field context when provided. */
|
|
@@ -1974,7 +2321,7 @@ export declare type DateRangeMenuProps = Omit<MenuProps, 'children' | 'onChange'
|
|
|
1974
2321
|
export declare const DateRangePicker: (props: DateRangePickerProps) => JSX.Element;
|
|
1975
2322
|
|
|
1976
2323
|
/** Props for {@link DateRangePicker}, combining range input and calendar menu. */
|
|
1977
|
-
export declare type DateRangePickerProps = Pick<DateRangeInputProps, 'id' | 'startLabel' | 'endLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'size'> & {
|
|
2324
|
+
export declare type DateRangePickerProps = Pick<DateRangeInputProps, 'id' | 'startLabel' | 'endLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'clearLabel' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'size'> & {
|
|
1978
2325
|
/** Controlled start and end dates. Pair with `onChange`. */
|
|
1979
2326
|
value?: DateRangeValue | null;
|
|
1980
2327
|
/** Initial range when `value` is not provided. */
|
|
@@ -2046,6 +2393,10 @@ export declare type DateTimeInputProps = Omit<BoxProps, keyof SegmentedFieldsVar
|
|
|
2046
2393
|
iconBefore?: IconNamesList;
|
|
2047
2394
|
/** Legacy icon rendered after the field when `after` is absent. */
|
|
2048
2395
|
iconAfter?: IconNamesList;
|
|
2396
|
+
/** Shows a clear action in the `after` slot when it is otherwise unused and either date or time has a value. @default true */
|
|
2397
|
+
clearable?: boolean;
|
|
2398
|
+
/** Accessible label for the clear action. @default 'Clear date and time' */
|
|
2399
|
+
clearLabel?: string;
|
|
2049
2400
|
/** Applies error styling. Overrides field context when provided. */
|
|
2050
2401
|
error?: boolean;
|
|
2051
2402
|
/** Prevents editing both portions. Overrides field context when provided. */
|
|
@@ -2117,7 +2468,7 @@ export declare type DateTimeMenuProps = Omit<MenuProps, 'children' | 'onChange'
|
|
|
2117
2468
|
export declare const DateTimePicker: (props: DateTimePickerProps) => JSX.Element;
|
|
2118
2469
|
|
|
2119
2470
|
/** Props for {@link DateTimePicker}, combining segmented entry and menu. */
|
|
2120
|
-
export declare type DateTimePickerProps = Pick<DateTimeInputProps, 'id' | 'dateLabel' | 'timeLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'timeFormat' | 'size'> & {
|
|
2471
|
+
export declare type DateTimePickerProps = Pick<DateTimeInputProps, 'id' | 'dateLabel' | 'timeLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'clearLabel' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'timeFormat' | 'size'> & {
|
|
2121
2472
|
/** Controlled combined date and time. Pair with `onChange`. */
|
|
2122
2473
|
value?: DateTimeValue | null;
|
|
2123
2474
|
/** Initial combined value when `value` is not provided. */
|
|
@@ -2169,7 +2520,7 @@ export declare type DateTimePickerProps = Pick<DateTimeInputProps, 'id' | 'dateL
|
|
|
2169
2520
|
export declare const DateTimeRangePicker: (props: DateTimeRangePickerProps) => JSX.Element;
|
|
2170
2521
|
|
|
2171
2522
|
/** Props for {@link DateTimeRangePicker}, which coordinates two pickers. */
|
|
2172
|
-
export declare type DateTimeRangePickerProps = Pick<DateTimeInputProps, 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'timeFormat' | 'size'> & {
|
|
2523
|
+
export declare type DateTimeRangePickerProps = Pick<DateTimeInputProps, 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'error' | 'disabled' | 'invalid' | 'dateFormat' | 'timeFormat' | 'size'> & {
|
|
2173
2524
|
/** Controlled start and end date-times. Pair with `onChange`. */
|
|
2174
2525
|
value?: DateTimeRangeValue | null;
|
|
2175
2526
|
/** Initial range when `value` is not provided. */
|
|
@@ -2190,6 +2541,10 @@ export declare type DateTimeRangePickerProps = Pick<DateTimeInputProps, 'before'
|
|
|
2190
2541
|
endDateLabel?: string;
|
|
2191
2542
|
/** Accessible time label for the end picker. */
|
|
2192
2543
|
endTimeLabel?: string;
|
|
2544
|
+
/** Accessible label for the start endpoint clear action. */
|
|
2545
|
+
startClearLabel?: string;
|
|
2546
|
+
/** Accessible label for the end endpoint clear action. */
|
|
2547
|
+
endClearLabel?: string;
|
|
2193
2548
|
/** Floating UI placement shared by both endpoint menus. */
|
|
2194
2549
|
placement?: Placement;
|
|
2195
2550
|
};
|
|
@@ -2213,6 +2568,10 @@ export declare interface DateValue {
|
|
|
2213
2568
|
day: number;
|
|
2214
2569
|
}
|
|
2215
2570
|
|
|
2571
|
+
/** English defaults for every {@link LocaleLabels} entry. */
|
|
2572
|
+
export declare const defaultLocaleLabels: LocaleLabels;
|
|
2573
|
+
|
|
2574
|
+
/** Returns explicit `textValue` when present, otherwise derives searchable text from item metadata. */
|
|
2216
2575
|
export declare const deriveItemTextValue: ({ textValue, label, description, getItemText, }: {
|
|
2217
2576
|
textValue?: string;
|
|
2218
2577
|
label?: string;
|
|
@@ -2259,6 +2618,208 @@ declare type DividerVariantProps = {
|
|
|
2259
2618
|
[key in keyof DividerVariant]?: ConditionalValue<DividerVariant[key]> | undefined
|
|
2260
2619
|
}
|
|
2261
2620
|
|
|
2621
|
+
/**
|
|
2622
|
+
* Renders a controlled panel that slides in from the edge of the screen.
|
|
2623
|
+
*
|
|
2624
|
+
* By default the drawer is modal: it adds a scrim, traps focus, locks page
|
|
2625
|
+
* scroll, and closes on Escape or an outside press. Set `modal={false}` for a
|
|
2626
|
+
* detail panel that sits beside a list the user keeps working in. Changing the
|
|
2627
|
+
* drawer's children while it stays open swaps the content without replaying
|
|
2628
|
+
* the entry motion.
|
|
2629
|
+
*
|
|
2630
|
+
* Supply an accessible name through `aria-label` or `aria-labelledby`; a
|
|
2631
|
+
* visible `DrawerHeader` title alone is not linked automatically.
|
|
2632
|
+
*
|
|
2633
|
+
* @example
|
|
2634
|
+
* ```tsx
|
|
2635
|
+
* <Drawer open={open} onOpenChange={setOpen} aria-labelledby={titleId}>
|
|
2636
|
+
* <DrawerHeader title="Filters" titleId={titleId} />
|
|
2637
|
+
* <DrawerBody>…</DrawerBody>
|
|
2638
|
+
* <DrawerFooter><Button onClick={apply}>Apply</Button></DrawerFooter>
|
|
2639
|
+
* </Drawer>
|
|
2640
|
+
* ```
|
|
2641
|
+
*
|
|
2642
|
+
* @example
|
|
2643
|
+
* ```tsx
|
|
2644
|
+
* // Non-modal: the list behind stays clickable; a row click swaps the case.
|
|
2645
|
+
* <Drawer open={caseId !== null} onOpenChange={() => setCaseId(null)} modal={false} size="xl" aria-label="Case detail">
|
|
2646
|
+
* <CaseDetail caseId={caseId} />
|
|
2647
|
+
* </Drawer>
|
|
2648
|
+
* ```
|
|
2649
|
+
*/
|
|
2650
|
+
export declare const Drawer: (props: DrawerProps) => JSX.Element | null;
|
|
2651
|
+
|
|
2652
|
+
/**
|
|
2653
|
+
* Renders the main content region of a {@link Drawer}. It fills the height
|
|
2654
|
+
* between the header and the footer.
|
|
2655
|
+
*
|
|
2656
|
+
* @example
|
|
2657
|
+
* ```tsx
|
|
2658
|
+
* <DrawerBody>Changes are saved automatically.</DrawerBody>
|
|
2659
|
+
* ```
|
|
2660
|
+
*/
|
|
2661
|
+
export declare const DrawerBody: (props: DrawerBodyProps) => JSX.Element;
|
|
2662
|
+
|
|
2663
|
+
/** Props for {@link DrawerBody}, the main content region of a drawer. */
|
|
2664
|
+
export declare type DrawerBodyProps = Omit<BoxProps, 'children'> & {
|
|
2665
|
+
/** Content displayed in the drawer's body region. */
|
|
2666
|
+
children: ReactNode;
|
|
2667
|
+
/**
|
|
2668
|
+
* When `true`, the body scrolls as one region. Set `false` when the content
|
|
2669
|
+
* manages its own scroll regions, such as a thread and a side rail that
|
|
2670
|
+
* scroll separately.
|
|
2671
|
+
* @default true
|
|
2672
|
+
*/
|
|
2673
|
+
scrollable?: boolean;
|
|
2674
|
+
};
|
|
2675
|
+
|
|
2676
|
+
/** State and close behavior shared with descendants of {@link Drawer}. */
|
|
2677
|
+
declare interface DrawerContextValue {
|
|
2678
|
+
/** Whether the drawer is currently in its open phase. */
|
|
2679
|
+
open: boolean;
|
|
2680
|
+
/** Requests closing through the parent drawer's `onOpenChange(false)`. */
|
|
2681
|
+
onClose: () => void;
|
|
2682
|
+
/** Whether the parent drawer traps focus and blocks the page behind it. */
|
|
2683
|
+
modal: boolean;
|
|
2684
|
+
/**
|
|
2685
|
+
* Tells the drawer that a header close button is rendered. A modal drawer
|
|
2686
|
+
* then focuses its panel on open, so the close button's tooltip does not
|
|
2687
|
+
* open and take the first Escape. Returns the cleanup that unregisters it.
|
|
2688
|
+
*/
|
|
2689
|
+
registerHeaderCloseButton: () => () => void;
|
|
2690
|
+
/** The drawer panel. Use it to check whether an element is inside the drawer. */
|
|
2691
|
+
panelRef: RefObject<HTMLElement | null>;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
/**
|
|
2695
|
+
* Renders the action region of a {@link Drawer}. It stays fixed at the bottom
|
|
2696
|
+
* while the body scrolls.
|
|
2697
|
+
*
|
|
2698
|
+
* @example
|
|
2699
|
+
* ```tsx
|
|
2700
|
+
* <DrawerFooter><Button>Apply</Button></DrawerFooter>
|
|
2701
|
+
* ```
|
|
2702
|
+
*/
|
|
2703
|
+
export declare const DrawerFooter: (props: DrawerFooterProps) => JSX.Element;
|
|
2704
|
+
|
|
2705
|
+
/** Props for {@link DrawerFooter}, the action region of a drawer. */
|
|
2706
|
+
export declare type DrawerFooterProps = Omit<BoxProps, 'children'> & {
|
|
2707
|
+
/** Content displayed in the footer, typically action buttons. */
|
|
2708
|
+
children: ReactNode;
|
|
2709
|
+
};
|
|
2710
|
+
|
|
2711
|
+
/**
|
|
2712
|
+
* Renders the header region of a parent {@link Drawer}. It stays fixed while
|
|
2713
|
+
* the body scrolls.
|
|
2714
|
+
*
|
|
2715
|
+
* Use `title` for the standard heading, or provide `children` for custom
|
|
2716
|
+
* content such as previous and next controls. It must be rendered inside
|
|
2717
|
+
* `Drawer` because it uses drawer context to close the drawer.
|
|
2718
|
+
*
|
|
2719
|
+
* @example
|
|
2720
|
+
* ```tsx
|
|
2721
|
+
* <DrawerHeader title="Filters" titleId={titleId} />
|
|
2722
|
+
* ```
|
|
2723
|
+
*/
|
|
2724
|
+
export declare const DrawerHeader: (props: DrawerHeaderProps) => JSX.Element;
|
|
2725
|
+
|
|
2726
|
+
/** Props for {@link DrawerHeader}, the optional heading and close-control region. */
|
|
2727
|
+
export declare type DrawerHeaderProps = Omit<BoxProps, 'children'> & {
|
|
2728
|
+
/** Text rendered as the default level-three heading when `children` is omitted. */
|
|
2729
|
+
title?: string;
|
|
2730
|
+
/**
|
|
2731
|
+
* Identifier applied to the title heading for `aria-labelledby` on the drawer.
|
|
2732
|
+
* Pass the same value to the parent drawer's `aria-labelledby`.
|
|
2733
|
+
*/
|
|
2734
|
+
titleId?: string;
|
|
2735
|
+
/**
|
|
2736
|
+
* Shows the built-in button that calls the parent drawer's `onOpenChange(false)`.
|
|
2737
|
+
* @default true
|
|
2738
|
+
*/
|
|
2739
|
+
showCloseButton?: boolean;
|
|
2740
|
+
/**
|
|
2741
|
+
* Custom header content. When supplied, it replaces both `title` and the
|
|
2742
|
+
* built-in close button; use `useDrawerContext().onClose` for a custom close
|
|
2743
|
+
* control.
|
|
2744
|
+
*/
|
|
2745
|
+
children?: ReactNode;
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2748
|
+
/** Props for {@link Drawer}, a controlled, portalled panel at the screen edge. */
|
|
2749
|
+
export declare type DrawerProps = Omit<BoxProps, keyof DrawerVariantProps | 'children'> & {
|
|
2750
|
+
/** Controlled drawer state. Render state changes by updating this value after `onOpenChange`. */
|
|
2751
|
+
open: boolean;
|
|
2752
|
+
/** Called when Escape, the close button, or (modal only) an outside press requests closing. */
|
|
2753
|
+
onOpenChange: (open: boolean) => void;
|
|
2754
|
+
/**
|
|
2755
|
+
* When `true`, the drawer covers the page with a scrim, traps focus, locks
|
|
2756
|
+
* page scroll, and closes on an outside press.
|
|
2757
|
+
*
|
|
2758
|
+
* When `false`, the page behind stays visible and usable: there is no scrim,
|
|
2759
|
+
* focus moves into the drawer on open but Tab can leave it, the page can
|
|
2760
|
+
* scroll, and an outside press does not close it. Escape closes the drawer
|
|
2761
|
+
* only while focus is inside it. Use this for a detail panel beside a list,
|
|
2762
|
+
* where a click on another row changes the drawer's content.
|
|
2763
|
+
* @default true
|
|
2764
|
+
*/
|
|
2765
|
+
modal?: boolean;
|
|
2766
|
+
/**
|
|
2767
|
+
* Screen edge the drawer attaches to.
|
|
2768
|
+
* @default 'right'
|
|
2769
|
+
*/
|
|
2770
|
+
side?: DrawerVariantProps['side'];
|
|
2771
|
+
/**
|
|
2772
|
+
* Drawer width: `sm` 448px, `md` 576px, `lg` 768px, `xl` 1024px, `full` the
|
|
2773
|
+
* whole viewport. Every size is full width below the `xs` breakpoint.
|
|
2774
|
+
* @default 'md'
|
|
2775
|
+
*/
|
|
2776
|
+
size?: DrawerVariantProps['size'];
|
|
2777
|
+
/**
|
|
2778
|
+
* Prevents an outside press from requesting close. Modal drawers only;
|
|
2779
|
+
* Escape still requests close.
|
|
2780
|
+
* @default false
|
|
2781
|
+
*/
|
|
2782
|
+
preventOutsideClose?: boolean;
|
|
2783
|
+
/**
|
|
2784
|
+
* Element to focus when the drawer opens. Forwarded to Floating UI's
|
|
2785
|
+
* `FloatingFocusManager`. A number selects by tabbable index; a ref targets
|
|
2786
|
+
* a specific element. Defaults to the drawer panel itself when the drawer
|
|
2787
|
+
* is non-modal or a `DrawerHeader` close button is shown, so opening it does
|
|
2788
|
+
* not show the close button's tooltip. Otherwise defaults to the first
|
|
2789
|
+
* tabbable element.
|
|
2790
|
+
*/
|
|
2791
|
+
initialFocus?: number | RefObject<HTMLElement | null>;
|
|
2792
|
+
/**
|
|
2793
|
+
* Returns focus to the previously focused element when the drawer closes, or
|
|
2794
|
+
* to a specific element when given a ref.
|
|
2795
|
+
* @default true
|
|
2796
|
+
*/
|
|
2797
|
+
returnFocus?: boolean | RefObject<HTMLElement | null>;
|
|
2798
|
+
/** Drawer content, typically composed from `DrawerHeader`, `DrawerBody`, and `DrawerFooter`. */
|
|
2799
|
+
children: ReactNode;
|
|
2800
|
+
/** Identifier applied to the drawer element. Provide accessible naming with `aria-label` or `aria-labelledby`. */
|
|
2801
|
+
id?: string;
|
|
2802
|
+
};
|
|
2803
|
+
|
|
2804
|
+
declare interface DrawerVariant {
|
|
2805
|
+
/**
|
|
2806
|
+
* @default "right"
|
|
2807
|
+
*/
|
|
2808
|
+
side: "right" | "left"
|
|
2809
|
+
/**
|
|
2810
|
+
* @default "md"
|
|
2811
|
+
*/
|
|
2812
|
+
size: "sm" | "md" | "lg" | "xl" | "full"
|
|
2813
|
+
/**
|
|
2814
|
+
* @default true
|
|
2815
|
+
*/
|
|
2816
|
+
scrollable: boolean
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
declare type DrawerVariantProps = {
|
|
2820
|
+
[key in keyof DrawerVariant]?: ConditionalValue<DrawerVariant[key]> | undefined
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2262
2823
|
/**
|
|
2263
2824
|
* Adds a test id to the interaction chain shared with a subtree.
|
|
2264
2825
|
*
|
|
@@ -2312,21 +2873,322 @@ export declare type FieldContextValue = {
|
|
|
2312
2873
|
describedBy?: string;
|
|
2313
2874
|
};
|
|
2314
2875
|
|
|
2315
|
-
declare type FontSizeToken = "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "64" | "72" | "80" | "96"
|
|
2316
|
-
|
|
2317
|
-
declare type FontToken = "heading" | "sans" | "body" | "serif" | "mono"
|
|
2318
|
-
|
|
2319
|
-
declare type FontWeightToken = "light" | "normal" | "medium" | "bold" | "black"
|
|
2320
|
-
|
|
2321
|
-
export { FormApi }
|
|
2322
|
-
|
|
2323
2876
|
/**
|
|
2324
|
-
*
|
|
2877
|
+
* The filter bar's field: the applied filters as tokens, followed by one
|
|
2878
|
+
* text input.
|
|
2325
2879
|
*
|
|
2326
|
-
*
|
|
2327
|
-
*
|
|
2328
|
-
*
|
|
2329
|
-
*
|
|
2880
|
+
* The field owns layout and a few keys. The app owns the filters and the
|
|
2881
|
+
* menus. Tokens that do not fit go behind a "+N more" button. Backspace in
|
|
2882
|
+
* an empty input arms the last token, and a second Backspace removes it.
|
|
2883
|
+
* The input moves into the token named by `editingKey`, and focus moves
|
|
2884
|
+
* with it.
|
|
2885
|
+
*
|
|
2886
|
+
* Pair it with `FilterMenu` and `useFilterMenu` for the menus.
|
|
2887
|
+
*
|
|
2888
|
+
* @example
|
|
2889
|
+
* ```tsx
|
|
2890
|
+
* <FilterField
|
|
2891
|
+
* tokens={filters.map((f) => ({ key: f.id, ...toTokenProps(f) }))}
|
|
2892
|
+
* inputValue={text}
|
|
2893
|
+
* onInputChange={setText}
|
|
2894
|
+
* inputProps={menu.inputProps}
|
|
2895
|
+
* inputRef={setInput}
|
|
2896
|
+
* placeholder="Filter or search…"
|
|
2897
|
+
* onClearAll={clearAll}
|
|
2898
|
+
* shortcut="/"
|
|
2899
|
+
* />
|
|
2900
|
+
* ```
|
|
2901
|
+
*/
|
|
2902
|
+
export declare const FilterField: (props: FilterFieldProps) => JSX.Element;
|
|
2903
|
+
|
|
2904
|
+
declare type FilterFieldOwnProps = {
|
|
2905
|
+
/** Filters shown as tokens, in order. */
|
|
2906
|
+
tokens: FilterFieldToken[];
|
|
2907
|
+
/** Text in the input. */
|
|
2908
|
+
inputValue: string;
|
|
2909
|
+
/** Runs when the person types in the input. */
|
|
2910
|
+
onInputChange: (value: string) => void;
|
|
2911
|
+
/**
|
|
2912
|
+
* Attributes for the input, such as `inputProps` from `useFilterMenu`. Its
|
|
2913
|
+
* `onKeyDown` runs before the field's own Backspace handling. Call
|
|
2914
|
+
* `preventDefault` to skip that handling.
|
|
2915
|
+
*/
|
|
2916
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'disabled' | 'placeholder'> & {
|
|
2917
|
+
[key: `data-${string}`]: string | boolean | undefined;
|
|
2918
|
+
};
|
|
2919
|
+
/** Ref to the input. The input moves into a token while it is edited. */
|
|
2920
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
2921
|
+
/** Placeholder text of the input. */
|
|
2922
|
+
placeholder?: string;
|
|
2923
|
+
/**
|
|
2924
|
+
* Key of the token whose value is edited. The input moves into that token,
|
|
2925
|
+
* and the token stays visible when the field overflows.
|
|
2926
|
+
*/
|
|
2927
|
+
editingKey?: string | null;
|
|
2928
|
+
/**
|
|
2929
|
+
* Runs when the "+N more" button is clicked. Gets the keys of the tokens
|
|
2930
|
+
* that do not fit, and the button, to anchor a menu.
|
|
2931
|
+
*/
|
|
2932
|
+
onMoreClick?: (hiddenKeys: string[], anchor: HTMLElement) => void;
|
|
2933
|
+
/** Marks the "+N more" button as open while its menu shows. */
|
|
2934
|
+
moreOpen?: boolean;
|
|
2935
|
+
/**
|
|
2936
|
+
* Runs when the clear button is clicked. The button shows only when this
|
|
2937
|
+
* is set and the field has a token or text.
|
|
2938
|
+
*/
|
|
2939
|
+
onClearAll?: () => void;
|
|
2940
|
+
/**
|
|
2941
|
+
* Accessible name of the clear button.
|
|
2942
|
+
* @default `labels.clearFilters` (English: "Clear all filters")
|
|
2943
|
+
*/
|
|
2944
|
+
clearLabel?: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* A key that focuses the input from anywhere on the page, such as "/".
|
|
2947
|
+
* It is ignored while another text field has focus. A hint shows whenever
|
|
2948
|
+
* the field does not have focus.
|
|
2949
|
+
*/
|
|
2950
|
+
shortcut?: string;
|
|
2951
|
+
/** Disables the input, the tokens and the buttons. */
|
|
2952
|
+
disabled?: boolean;
|
|
2953
|
+
};
|
|
2954
|
+
|
|
2955
|
+
/** Props for {@link FilterField}. Includes `Box` style props for the frame. */
|
|
2956
|
+
export declare type FilterFieldProps = Omit<BoxProps, keyof FilterFieldOwnProps | 'children'> & FilterFieldOwnProps;
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* One token in a {@link FilterField}. The field sets `editor`,
|
|
2960
|
+
* `retainFocus` and `disabled`, so values passed for them are replaced.
|
|
2961
|
+
*/
|
|
2962
|
+
export declare type FilterFieldToken = FilterTokenProps & {
|
|
2963
|
+
/** Stable key, unique in the field. */
|
|
2964
|
+
key: string;
|
|
2965
|
+
};
|
|
2966
|
+
|
|
2967
|
+
/**
|
|
2968
|
+
* The popup list of a filter field: grouped rows, checkboxes for multi-pick
|
|
2969
|
+
* lists, end-of-row detail, an empty line and a hint footer.
|
|
2970
|
+
*
|
|
2971
|
+
* Focus stays in the owner's input, as in a combobox, so the menu never
|
|
2972
|
+
* takes focus. Pair it with {@link useFilterMenu}, which adds the input's
|
|
2973
|
+
* ARIA attributes and the arrow, Enter, Space and Esc keys. Use `Menu` for
|
|
2974
|
+
* an action menu that takes focus, and `Autocomplete` for a form field.
|
|
2975
|
+
*
|
|
2976
|
+
* Renders a `listbox` in a portal, positioned under `anchor`.
|
|
2977
|
+
*
|
|
2978
|
+
* @example
|
|
2979
|
+
* ```tsx
|
|
2980
|
+
* const menu = useFilterMenu({ rows, open, onSelect: pick, onClose: close });
|
|
2981
|
+
* <input ref={setInput} {...menu.inputProps} aria-label="Filter" />
|
|
2982
|
+
* <FilterMenu {...menu.menuProps} anchor={input} aria-label="Fields" />
|
|
2983
|
+
* ```
|
|
2984
|
+
*/
|
|
2985
|
+
export declare const FilterMenu: (props: FilterMenuProps) => JSX.Element | null;
|
|
2986
|
+
|
|
2987
|
+
/** A row the user can pick in a {@link FilterMenu}. */
|
|
2988
|
+
export declare type FilterMenuItemRow = {
|
|
2989
|
+
type: 'item';
|
|
2990
|
+
/** Stable key, unique in the menu. Passed to `onSelect`. */
|
|
2991
|
+
key: string;
|
|
2992
|
+
/** Visible row text. Matches of the menu's `query` are highlighted. */
|
|
2993
|
+
label: string;
|
|
2994
|
+
/**
|
|
2995
|
+
* Content before the label, such as an avatar or a status dot. It comes
|
|
2996
|
+
* after the checkbox when the row has one.
|
|
2997
|
+
*/
|
|
2998
|
+
before?: ReactNode;
|
|
2999
|
+
/** Second line of text under the label, such as a customer name. */
|
|
3000
|
+
description?: string;
|
|
3001
|
+
/**
|
|
3002
|
+
* Short text at the end of the row, such as "current", a count or a date
|
|
3003
|
+
* range. It does not wrap.
|
|
3004
|
+
*/
|
|
3005
|
+
detail?: string;
|
|
3006
|
+
/**
|
|
3007
|
+
* Shows a checkbox for a multi-pick list. `true` checks it. Leave it
|
|
3008
|
+
* undefined for a single-pick row, which shows no checkbox.
|
|
3009
|
+
*/
|
|
3010
|
+
checked?: boolean;
|
|
3011
|
+
/** Marks the current value of a single-pick list. Sets `aria-selected`. */
|
|
3012
|
+
selected?: boolean;
|
|
3013
|
+
/** Skips the row in keyboard moves and ignores clicks. */
|
|
3014
|
+
disabled?: boolean;
|
|
3015
|
+
};
|
|
3016
|
+
|
|
3017
|
+
declare type FilterMenuOwnProps = {
|
|
3018
|
+
/** Shows the menu. The owner of the input decides when it opens and closes. */
|
|
3019
|
+
open: boolean;
|
|
3020
|
+
/**
|
|
3021
|
+
* Element the menu opens under, such as the filter input or a token.
|
|
3022
|
+
* The menu does not render while this is `null`.
|
|
3023
|
+
*/
|
|
3024
|
+
anchor: Element | null;
|
|
3025
|
+
/** Rows to show, in order. */
|
|
3026
|
+
rows: FilterMenuRow[];
|
|
3027
|
+
/** Listbox id. The input points to it with `aria-controls`. */
|
|
3028
|
+
id: string;
|
|
3029
|
+
/** Accessible name of the listbox, such as "Fields" or "Stage values". */
|
|
3030
|
+
'aria-label': string;
|
|
3031
|
+
/** Key of the highlighted row. Enter in the input picks this row. */
|
|
3032
|
+
activeKey?: string | null;
|
|
3033
|
+
/** Runs when the pointer moves over a pickable row. */
|
|
3034
|
+
onActiveKeyChange?: (key: string) => void;
|
|
3035
|
+
/** Runs when a pickable row is clicked. Focus stays where it was. */
|
|
3036
|
+
onSelect: (key: string) => void;
|
|
3037
|
+
/** Typed text. Matches in row labels and descriptions are highlighted. */
|
|
3038
|
+
query?: string;
|
|
3039
|
+
/** Hint line under the list, such as "Enter picks · Esc cancels". */
|
|
3040
|
+
footer?: ReactNode;
|
|
3041
|
+
};
|
|
3042
|
+
|
|
3043
|
+
/** Props for {@link FilterMenu}. Includes `Box` style props for the popup. */
|
|
3044
|
+
export declare type FilterMenuProps = Omit<BoxProps, keyof FilterMenuOwnProps | 'children'> & FilterMenuOwnProps;
|
|
3045
|
+
|
|
3046
|
+
/**
|
|
3047
|
+
* One row of a {@link FilterMenu}.
|
|
3048
|
+
*
|
|
3049
|
+
* - `group`: a heading. The item rows after it, up to the next heading, form
|
|
3050
|
+
* one labeled group.
|
|
3051
|
+
* - `item`: a row the user can pick.
|
|
3052
|
+
* - `empty`: a status line, such as "No field matches".
|
|
3053
|
+
*/
|
|
3054
|
+
export declare type FilterMenuRow = {
|
|
3055
|
+
type: 'group';
|
|
3056
|
+
label: string;
|
|
3057
|
+
} | FilterMenuItemRow | {
|
|
3058
|
+
type: 'empty';
|
|
3059
|
+
label: string;
|
|
3060
|
+
};
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* One filter in a filter field, read as a sentence: field, operator, value.
|
|
3064
|
+
*
|
|
3065
|
+
* Each part is its own click target, and the remove button ends the token.
|
|
3066
|
+
* A part with no click handler renders as text. Use `Chip` for a label with
|
|
3067
|
+
* one action. The root renders a `span` with `role="group"` and an
|
|
3068
|
+
* accessible name made from the sentence.
|
|
3069
|
+
*
|
|
3070
|
+
* In `removing` state, the parts stay clickable so the consumer can restore
|
|
3071
|
+
* the filter, and the remove button is hidden.
|
|
3072
|
+
*
|
|
3073
|
+
* @example
|
|
3074
|
+
* ```tsx
|
|
3075
|
+
* <FilterToken
|
|
3076
|
+
* field="Stage"
|
|
3077
|
+
* operator="is any of"
|
|
3078
|
+
* value="Open, In progress"
|
|
3079
|
+
* onValueClick={openValues}
|
|
3080
|
+
* onRemove={() => remove('stage')}
|
|
3081
|
+
* />
|
|
3082
|
+
* ```
|
|
3083
|
+
*/
|
|
3084
|
+
export declare const FilterToken: (props: FilterTokenProps) => JSX.Element;
|
|
3085
|
+
|
|
3086
|
+
/**
|
|
3087
|
+
* A second operator and value joined to the first, for a filter that mixes
|
|
3088
|
+
* exact picks with typed text: "Part is any of A, B or contains “water”".
|
|
3089
|
+
*/
|
|
3090
|
+
export declare type FilterTokenJoined = {
|
|
3091
|
+
/** Operator text, including the joining word, such as "or contains". */
|
|
3092
|
+
operator: string;
|
|
3093
|
+
/** Value text, such as "“water”". */
|
|
3094
|
+
value: string;
|
|
3095
|
+
};
|
|
3096
|
+
|
|
3097
|
+
declare type FilterTokenOwnProps = {
|
|
3098
|
+
/** Name of the filtered field, such as "Stage". */
|
|
3099
|
+
field: string;
|
|
3100
|
+
/** Operator text, such as "is", "is any of" or "is between". */
|
|
3101
|
+
operator: string;
|
|
3102
|
+
/**
|
|
3103
|
+
* The filter value. A string shows as is, such as "Sep 1 – Sep 30". A list
|
|
3104
|
+
* shows its first two items, then `+N` for the rest, and a tooltip lists
|
|
3105
|
+
* every item. A value cut off by the width limit also shows the tooltip,
|
|
3106
|
+
* so the full text can be read on hover or focus. An empty
|
|
3107
|
+
* string or list shows "…" for a filter that has no value yet. Omit it for
|
|
3108
|
+
* an operator that takes no value, such as "is empty".
|
|
3109
|
+
*/
|
|
3110
|
+
value?: string | string[];
|
|
3111
|
+
/**
|
|
3112
|
+
* A second operator and value after the first. The operator part opens the
|
|
3113
|
+
* operator menu (`onOperatorClick`), and the value part opens the value
|
|
3114
|
+
* menu (`onValueClick`), as the first ones do.
|
|
3115
|
+
*/
|
|
3116
|
+
joined?: FilterTokenJoined;
|
|
3117
|
+
/** @default "applied" */
|
|
3118
|
+
state?: FilterTokenState;
|
|
3119
|
+
/** @default "default" */
|
|
3120
|
+
tone?: FilterTokenTone;
|
|
3121
|
+
/**
|
|
3122
|
+
* Renders the operator as text, not as a button. Use it when the field
|
|
3123
|
+
* supports only one operator.
|
|
3124
|
+
*/
|
|
3125
|
+
operatorLocked?: boolean;
|
|
3126
|
+
/**
|
|
3127
|
+
* Content that replaces the value button while the token is edited in
|
|
3128
|
+
* place, usually a text input. Every value stays before it, with no `+N`
|
|
3129
|
+
* count, so the person sees the whole list they are editing.
|
|
3130
|
+
*/
|
|
3131
|
+
editor?: ReactNode;
|
|
3132
|
+
/** Disables every part of the token, the `editor` included. */
|
|
3133
|
+
disabled?: boolean;
|
|
3134
|
+
/**
|
|
3135
|
+
* Keeps focus where it is when a part is clicked with a pointer. A filter
|
|
3136
|
+
* field sets this so focus stays in its input, as in a combobox.
|
|
3137
|
+
*/
|
|
3138
|
+
retainFocus?: boolean;
|
|
3139
|
+
/**
|
|
3140
|
+
* Runs when the field part is clicked. Falls back to `onValueClick` when
|
|
3141
|
+
* absent, because the field and the value both open the value menu.
|
|
3142
|
+
*/
|
|
3143
|
+
onFieldClick?: (event: MouseEvent_2<HTMLButtonElement>) => void;
|
|
3144
|
+
/** Runs when the operator part is clicked. Not called when `operatorLocked` is true. */
|
|
3145
|
+
onOperatorClick?: (event: MouseEvent_2<HTMLButtonElement>) => void;
|
|
3146
|
+
/** Runs when the value part is clicked. */
|
|
3147
|
+
onValueClick?: (event: MouseEvent_2<HTMLButtonElement>) => void;
|
|
3148
|
+
/**
|
|
3149
|
+
* Runs when the remove button is clicked. The button is not shown when this
|
|
3150
|
+
* is absent or when `state` is `removing`.
|
|
3151
|
+
*/
|
|
3152
|
+
onRemove?: () => void;
|
|
3153
|
+
/**
|
|
3154
|
+
* Accessible name for the remove button.
|
|
3155
|
+
* @default `labels.removeFilter` (English: `Remove filter: ${field} ${operator} ${values}`), with every value
|
|
3156
|
+
*/
|
|
3157
|
+
removeLabel?: string;
|
|
3158
|
+
};
|
|
3159
|
+
|
|
3160
|
+
/** Props for {@link FilterToken}. Includes `Box` style props for the root. */
|
|
3161
|
+
export declare type FilterTokenProps = Omit<BoxProps, keyof FilterTokenOwnProps | 'children'> & FilterTokenOwnProps;
|
|
3162
|
+
|
|
3163
|
+
/**
|
|
3164
|
+
* Where a filter token is in the edit cycle.
|
|
3165
|
+
*
|
|
3166
|
+
* - `applied`: the results include this filter.
|
|
3167
|
+
* - `editing`: a menu for this token is open.
|
|
3168
|
+
* - `pending`: added or changed, and waits for Apply.
|
|
3169
|
+
* - `removing`: removed, and waits for Apply. Shown struck through.
|
|
3170
|
+
* - `armed`: the next Backspace removes it.
|
|
3171
|
+
*/
|
|
3172
|
+
export declare type FilterTokenState = 'applied' | 'editing' | 'pending' | 'removing' | 'armed';
|
|
3173
|
+
|
|
3174
|
+
/** Visual tone of a filter token. `exclude` marks a negated operator, such as "is not". */
|
|
3175
|
+
export declare type FilterTokenTone = 'default' | 'exclude';
|
|
3176
|
+
|
|
3177
|
+
declare type FontSizeToken = "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "96"
|
|
3178
|
+
|
|
3179
|
+
declare type FontToken = "heading" | "sans" | "body" | "serif" | "mono"
|
|
3180
|
+
|
|
3181
|
+
declare type FontWeightToken = "light" | "normal" | "medium" | "bold" | "black"
|
|
3182
|
+
|
|
3183
|
+
export { FormApi }
|
|
3184
|
+
|
|
3185
|
+
/**
|
|
3186
|
+
* Groups a label, control, help text, and validation message into one field.
|
|
3187
|
+
*
|
|
3188
|
+
* `labelFor` must match the `id` of the nested input. The component provides
|
|
3189
|
+
* `size`, `error`, `invalid`, and `disabled` through field context to
|
|
3190
|
+
* compatible descendants, but it does not add native input attributes for
|
|
3191
|
+
* them. If `success` and an error state are both true, success messaging wins.
|
|
2330
3192
|
*
|
|
2331
3193
|
* @example
|
|
2332
3194
|
* ```tsx
|
|
@@ -2406,8 +3268,17 @@ declare type FormFieldVariantProps = {
|
|
|
2406
3268
|
[key in keyof FormFieldVariant]?: ConditionalValue<FormFieldVariant[key]> | undefined
|
|
2407
3269
|
}
|
|
2408
3270
|
|
|
3271
|
+
/** Returns the internal menu compound-component marker for a React element, or `null` for other values. */
|
|
2409
3272
|
export declare const getComponentType: (node: unknown) => string | null;
|
|
2410
3273
|
|
|
3274
|
+
/**
|
|
3275
|
+
* Returns the DOM id of one option in a {@link FilterMenu}. The input uses
|
|
3276
|
+
* it in `aria-activedescendant`. The key is percent-encoded, so two different
|
|
3277
|
+
* keys always give two different ids, and the id never holds whitespace.
|
|
3278
|
+
*/
|
|
3279
|
+
export declare const getFilterMenuOptionId: (menuId: string, key: string) => string;
|
|
3280
|
+
|
|
3281
|
+
/** Splits text into case-insensitive query-match parts for highlight rendering. */
|
|
2411
3282
|
export declare const getHighlightedTextParts: (value: string, query: string) => {
|
|
2412
3283
|
text: string;
|
|
2413
3284
|
match: boolean;
|
|
@@ -2417,6 +3288,7 @@ declare type Globals = "-moz-initial" | "inherit" | "initial" | "revert" | "reve
|
|
|
2417
3288
|
|
|
2418
3289
|
export declare type GlobalStyleObject = Record<string, unknown>;
|
|
2419
3290
|
|
|
3291
|
+
/** Returns whether a child tree contains any visible menu item, subgroup, or submenu for a filter. */
|
|
2420
3292
|
export declare const hasMatchingItems: (children: ReactNode, filterContext: MenuFilterContextValue) => boolean;
|
|
2421
3293
|
|
|
2422
3294
|
/**
|
|
@@ -2512,7 +3384,9 @@ export declare const Icon: (props: IconProps) => JSX.Element;
|
|
|
2512
3384
|
* Renders a native `button` by default, or an anchor when `href` is supplied.
|
|
2513
3385
|
* Its explicit `size`, `error`, `invalid`, and `disabled` values take
|
|
2514
3386
|
* precedence over slot context, which takes precedence over field context.
|
|
2515
|
-
* Its recipe defaults to the `standard` variant and `md` size.
|
|
3387
|
+
* Its recipe defaults to the `standard` variant and `md` size. Set
|
|
3388
|
+
* `disabledReason` instead of `disabled` when the user needs to know why the
|
|
3389
|
+
* action is unavailable.
|
|
2516
3390
|
*
|
|
2517
3391
|
* @example
|
|
2518
3392
|
* ```tsx
|
|
@@ -2543,10 +3417,17 @@ export declare type IconButtonProps = Omit<BoxProps, keyof IconButtonVariantProp
|
|
|
2543
3417
|
*/
|
|
2544
3418
|
loading?: boolean;
|
|
2545
3419
|
/**
|
|
2546
|
-
* Disables a native button. For links, marks the anchor `aria-disabled
|
|
2547
|
-
*
|
|
3420
|
+
* Disables a native button. For links, marks the anchor `aria-disabled`,
|
|
3421
|
+
* removes its `href` so it can't navigate, and keeps it focusable.
|
|
2548
3422
|
*/
|
|
2549
3423
|
disabled?: boolean;
|
|
3424
|
+
/**
|
|
3425
|
+
* Disables the action and explains why. The control stays focusable and
|
|
3426
|
+
* is marked `aria-disabled`, clicks are blocked, the tooltip shows
|
|
3427
|
+
* `altText` as its title with the reason below, and the reason is linked
|
|
3428
|
+
* with `aria-describedby`. `altText` stays the accessible name.
|
|
3429
|
+
*/
|
|
3430
|
+
disabledReason?: string;
|
|
2550
3431
|
/**
|
|
2551
3432
|
* Native button type; ignored when `href` causes the component to render an
|
|
2552
3433
|
* anchor.
|
|
@@ -2603,6 +3484,7 @@ export declare const IconNames: {
|
|
|
2603
3484
|
readonly attachment: "attachment";
|
|
2604
3485
|
readonly bank: "bank";
|
|
2605
3486
|
readonly 'barcode-off': "barcode-off";
|
|
3487
|
+
readonly 'barcode-reader-off': "barcode-reader-off";
|
|
2606
3488
|
readonly 'barcode-reader': "barcode-reader";
|
|
2607
3489
|
readonly barcode: "barcode";
|
|
2608
3490
|
readonly barricade: "barricade";
|
|
@@ -2650,6 +3532,7 @@ export declare const IconNames: {
|
|
|
2650
3532
|
readonly 'chevron-up': "chevron-up";
|
|
2651
3533
|
readonly 'circle-change': "circle-change";
|
|
2652
3534
|
readonly 'circle-check': "circle-check";
|
|
3535
|
+
readonly 'circle-dashed': "circle-dashed";
|
|
2653
3536
|
readonly circle: "circle";
|
|
2654
3537
|
readonly 'circles-add': "circles-add";
|
|
2655
3538
|
readonly circuit: "circuit";
|
|
@@ -2681,6 +3564,10 @@ export declare const IconNames: {
|
|
|
2681
3564
|
readonly dots: "dots";
|
|
2682
3565
|
readonly 'download-cloud': "download-cloud";
|
|
2683
3566
|
readonly download: "download";
|
|
3567
|
+
readonly 'drawer-left-hide': "drawer-left-hide";
|
|
3568
|
+
readonly 'drawer-left-show': "drawer-left-show";
|
|
3569
|
+
readonly 'drawer-right-hide': "drawer-right-hide";
|
|
3570
|
+
readonly 'drawer-right-show': "drawer-right-show";
|
|
2684
3571
|
readonly edit: "edit";
|
|
2685
3572
|
readonly encrypted: "encrypted";
|
|
2686
3573
|
readonly envelope: "envelope";
|
|
@@ -2775,6 +3662,7 @@ export declare const IconNames: {
|
|
|
2775
3662
|
readonly network: "network";
|
|
2776
3663
|
readonly 'newspaper-clipping': "newspaper-clipping";
|
|
2777
3664
|
readonly newspaper: "newspaper";
|
|
3665
|
+
readonly 'not-equal': "not-equal";
|
|
2778
3666
|
readonly 'note-stack': "note-stack";
|
|
2779
3667
|
readonly note: "note";
|
|
2780
3668
|
readonly notepad: "notepad";
|
|
@@ -2843,6 +3731,7 @@ export declare const IconNames: {
|
|
|
2843
3731
|
readonly sparkle: "sparkle";
|
|
2844
3732
|
readonly spinner: "spinner";
|
|
2845
3733
|
readonly 'square-add': "square-add";
|
|
3734
|
+
readonly 'square-dashed': "square-dashed";
|
|
2846
3735
|
readonly 'square-inside': "square-inside";
|
|
2847
3736
|
readonly 'square-select': "square-select";
|
|
2848
3737
|
readonly square: "square";
|
|
@@ -2931,6 +3820,7 @@ declare type IconNamesList =
|
|
|
2931
3820
|
| 'attachment'
|
|
2932
3821
|
| 'bank'
|
|
2933
3822
|
| 'barcode-off'
|
|
3823
|
+
| 'barcode-reader-off'
|
|
2934
3824
|
| 'barcode-reader'
|
|
2935
3825
|
| 'barcode'
|
|
2936
3826
|
| 'barricade'
|
|
@@ -2978,6 +3868,7 @@ declare type IconNamesList =
|
|
|
2978
3868
|
| 'chevron-up'
|
|
2979
3869
|
| 'circle-change'
|
|
2980
3870
|
| 'circle-check'
|
|
3871
|
+
| 'circle-dashed'
|
|
2981
3872
|
| 'circle'
|
|
2982
3873
|
| 'circles-add'
|
|
2983
3874
|
| 'circuit'
|
|
@@ -3009,6 +3900,10 @@ declare type IconNamesList =
|
|
|
3009
3900
|
| 'dots'
|
|
3010
3901
|
| 'download-cloud'
|
|
3011
3902
|
| 'download'
|
|
3903
|
+
| 'drawer-left-hide'
|
|
3904
|
+
| 'drawer-left-show'
|
|
3905
|
+
| 'drawer-right-hide'
|
|
3906
|
+
| 'drawer-right-show'
|
|
3012
3907
|
| 'edit'
|
|
3013
3908
|
| 'encrypted'
|
|
3014
3909
|
| 'envelope'
|
|
@@ -3103,6 +3998,7 @@ declare type IconNamesList =
|
|
|
3103
3998
|
| 'network'
|
|
3104
3999
|
| 'newspaper-clipping'
|
|
3105
4000
|
| 'newspaper'
|
|
4001
|
+
| 'not-equal'
|
|
3106
4002
|
| 'note-stack'
|
|
3107
4003
|
| 'note'
|
|
3108
4004
|
| 'notepad'
|
|
@@ -3171,6 +4067,7 @@ declare type IconNamesList =
|
|
|
3171
4067
|
| 'sparkle'
|
|
3172
4068
|
| 'spinner'
|
|
3173
4069
|
| 'square-add'
|
|
4070
|
+
| 'square-dashed'
|
|
3174
4071
|
| 'square-inside'
|
|
3175
4072
|
| 'square-select'
|
|
3176
4073
|
| 'square'
|
|
@@ -3292,6 +4189,49 @@ declare type Important = ImportantMark | WhitespaceImportant
|
|
|
3292
4189
|
|
|
3293
4190
|
declare type ImportantMark = "!" | "!important"
|
|
3294
4191
|
|
|
4192
|
+
/**
|
|
4193
|
+
* Attaches short guidance or a validation message to a single form field.
|
|
4194
|
+
*
|
|
4195
|
+
* An inline note has no surface, title, actions, or dismiss control: it is the
|
|
4196
|
+
* smallest notification in the set and belongs directly beneath the control it
|
|
4197
|
+
* describes. Use `Alert` when the message concerns a whole section.
|
|
4198
|
+
*
|
|
4199
|
+
* Reference it from the field with `aria-describedby` so the message reaches
|
|
4200
|
+
* screen readers on focus. It has no live-region role by default because
|
|
4201
|
+
* static field guidance would otherwise be announced both on mount and again
|
|
4202
|
+
* on field focus. Add an appropriate role when inserting a note dynamically.
|
|
4203
|
+
* `tone="neutral"` uses the info icon.
|
|
4204
|
+
*
|
|
4205
|
+
* @example
|
|
4206
|
+
* ```tsx
|
|
4207
|
+
* <InlineNote id="email-note" tone="danger">Enter a valid email address.</InlineNote>
|
|
4208
|
+
* ```
|
|
4209
|
+
*/
|
|
4210
|
+
export declare const InlineNote: (props: InlineNoteProps) => JSX.Element;
|
|
4211
|
+
|
|
4212
|
+
declare type InlineNoteOwnProps = {
|
|
4213
|
+
/** Semantic tone. Selects the text and icon color tokens and the tone icon. */
|
|
4214
|
+
/** @default "info" */
|
|
4215
|
+
tone?: AlertTone;
|
|
4216
|
+
/** The note text. */
|
|
4217
|
+
children: ReactNode;
|
|
4218
|
+
};
|
|
4219
|
+
|
|
4220
|
+
/** Props accepted by {@link InlineNote}. Includes compatible native element props. */
|
|
4221
|
+
export declare type InlineNoteProps = Omit<BoxProps, keyof InlineNoteVariantProps | keyof InlineNoteOwnProps> & Omit<InlineNoteVariantProps, 'tone'> & InlineNoteOwnProps;
|
|
4222
|
+
|
|
4223
|
+
declare interface InlineNoteVariant {
|
|
4224
|
+
/**
|
|
4225
|
+
* @default "info"
|
|
4226
|
+
*/
|
|
4227
|
+
tone: "info" | "success" | "warning" | "danger" | "neutral"
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
declare type InlineNoteVariantProps = {
|
|
4231
|
+
[key in keyof InlineNoteVariant]?: ConditionalValue<InlineNoteVariant[key]> | undefined
|
|
4232
|
+
}
|
|
4233
|
+
|
|
4234
|
+
/** Returns whether text is visible for the supplied filtering mode and query. */
|
|
3295
4235
|
export declare const isItemMatch: ({ textValue, query, filterMode, }: {
|
|
3296
4236
|
textValue: string;
|
|
3297
4237
|
query: string;
|
|
@@ -3329,6 +4269,79 @@ export declare type KbdSpecialSymbol = 'command' | 'option' | 'control' | 'shift
|
|
|
3329
4269
|
|
|
3330
4270
|
export declare type KbdValue = string | KbdSpecialSymbol;
|
|
3331
4271
|
|
|
4272
|
+
/**
|
|
4273
|
+
* Shows one short fact about a record as a label and a value.
|
|
4274
|
+
*
|
|
4275
|
+
* Use up to three horizontal key facts in a page header aside. Use the vertical
|
|
4276
|
+
* layout in a strip of facts under the title. A horizontal label ends in the
|
|
4277
|
+
* `keyFactLabel` text from `LocaleProvider` ("Owner:" in English). Set `editing`
|
|
4278
|
+
* to change the value in place. With `editMode="confirm"`, the fact gets its
|
|
4279
|
+
* own save and cancel buttons.
|
|
4280
|
+
*
|
|
4281
|
+
* @example
|
|
4282
|
+
* ```tsx
|
|
4283
|
+
* <KeyFact label="Customer" value="Acme Corp" href="/customer/42" />
|
|
4284
|
+
* ```
|
|
4285
|
+
*/
|
|
4286
|
+
export declare const KeyFact: (props: KeyFactProps) => JSX.Element;
|
|
4287
|
+
|
|
4288
|
+
/** Props for {@link KeyFact}. */
|
|
4289
|
+
export declare type KeyFactProps = Omit<BoxProps, keyof KeyFactVariantProps | 'children'> & KeyFactVariantProps & {
|
|
4290
|
+
/** Name of the fact, such as "Owner" or "Due". */
|
|
4291
|
+
label: string;
|
|
4292
|
+
/** Value of the fact. A value wider than the space it has truncates and shows the full value in a tooltip. */
|
|
4293
|
+
value: string;
|
|
4294
|
+
/** Makes the value a link, such as to the related record. Ignored while `editing`. */
|
|
4295
|
+
href?: string;
|
|
4296
|
+
/**
|
|
4297
|
+
* `horizontal` reads "Label: Value" on one line, for a page header aside.
|
|
4298
|
+
* `vertical` stacks the label over a larger value, for a facts strip.
|
|
4299
|
+
* Takes a conditional value, such as `{ base: 'vertical', md: 'horizontal' }`.
|
|
4300
|
+
* A conditional value without `base` starts as `horizontal`.
|
|
4301
|
+
*
|
|
4302
|
+
* @default 'horizontal'
|
|
4303
|
+
*/
|
|
4304
|
+
layout?: KeyFactVariantProps['layout'];
|
|
4305
|
+
/**
|
|
4306
|
+
* Replaces the value with a text input labeled by `label`. The input starts
|
|
4307
|
+
* with `value`. On its own, `editing` has no save or cancel: put the
|
|
4308
|
+
* KeyFact in a form with its own Save, or set `editMode="confirm"`.
|
|
4309
|
+
*
|
|
4310
|
+
* @default false
|
|
4311
|
+
*/
|
|
4312
|
+
editing?: boolean;
|
|
4313
|
+
/**
|
|
4314
|
+
* How the value is changed while `editing`.
|
|
4315
|
+
* `input` shows the text input alone, for a form with its own Save.
|
|
4316
|
+
* `confirm` adds save and cancel buttons, for a single fact saved on its
|
|
4317
|
+
* own. In `confirm`, Enter saves and Escape cancels.
|
|
4318
|
+
*
|
|
4319
|
+
* @default 'input'
|
|
4320
|
+
*/
|
|
4321
|
+
editMode?: 'input' | 'confirm';
|
|
4322
|
+
/** Called with the new value when the user saves. Called only in `editMode="confirm"`. */
|
|
4323
|
+
onSave?: (value: string) => void;
|
|
4324
|
+
/** Called when the user cancels. Called only in `editMode="confirm"`. */
|
|
4325
|
+
onCancel?: () => void;
|
|
4326
|
+
/** Props for the text input shown while `editing`, such as `name` and `onChange`. Pass `name` when the KeyFact is in a form. */
|
|
4327
|
+
inputProps?: Partial<Omit<TextInputProps, 'id'>>;
|
|
4328
|
+
};
|
|
4329
|
+
|
|
4330
|
+
declare interface KeyFactVariant {
|
|
4331
|
+
/**
|
|
4332
|
+
* @default "horizontal"
|
|
4333
|
+
*/
|
|
4334
|
+
layout: "horizontal" | "vertical"
|
|
4335
|
+
/**
|
|
4336
|
+
* @default false
|
|
4337
|
+
*/
|
|
4338
|
+
editing: boolean
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
declare type KeyFactVariantProps = {
|
|
4342
|
+
[key in keyof KeyFactVariant]?: ConditionalValue<KeyFactVariant[key]> | undefined
|
|
4343
|
+
}
|
|
4344
|
+
|
|
3332
4345
|
/**
|
|
3333
4346
|
* Renders a native label for a form control.
|
|
3334
4347
|
*
|
|
@@ -3361,7 +4374,7 @@ declare interface LabelVariant {
|
|
|
3361
4374
|
dashedUnderline: boolean
|
|
3362
4375
|
truncate: boolean
|
|
3363
4376
|
allCaps: boolean
|
|
3364
|
-
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "64" | "72" | "80" | "96"
|
|
4377
|
+
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "96"
|
|
3365
4378
|
weight: "light" | "normal" | "medium" | "bold" | "black"
|
|
3366
4379
|
_disabled: boolean
|
|
3367
4380
|
}
|
|
@@ -3423,7 +4436,7 @@ declare interface LinkVariant {
|
|
|
3423
4436
|
dashedUnderline: boolean
|
|
3424
4437
|
truncate: boolean
|
|
3425
4438
|
allCaps: boolean
|
|
3426
|
-
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "64" | "72" | "80" | "96"
|
|
4439
|
+
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "96"
|
|
3427
4440
|
weight: "light" | "normal" | "medium" | "bold" | "black"
|
|
3428
4441
|
}
|
|
3429
4442
|
|
|
@@ -3457,7 +4470,8 @@ declare type ListContextValue = {
|
|
|
3457
4470
|
iconAfter?: IconNamesList;
|
|
3458
4471
|
};
|
|
3459
4472
|
|
|
3460
|
-
|
|
4473
|
+
/** Responsive density value shared by List primitives. */
|
|
4474
|
+
export declare type ListDensity = ListItemVariantProps['density'];
|
|
3461
4475
|
|
|
3462
4476
|
/**
|
|
3463
4477
|
* Renders an interactive option, link, selection control, or visual divider.
|
|
@@ -3523,6 +4537,11 @@ export declare type ListItemProps = Omit<BoxProps, keyof ListItemVariantProps |
|
|
|
3523
4537
|
href?: string;
|
|
3524
4538
|
/** Content rendered before the default label and description. */
|
|
3525
4539
|
before?: ReactNode;
|
|
4540
|
+
/**
|
|
4541
|
+
* Short content rendered at the end of the row, after the default label
|
|
4542
|
+
* and description, such as a count or a date range. It does not wrap.
|
|
4543
|
+
*/
|
|
4544
|
+
after?: ReactNode;
|
|
3526
4545
|
/** Primary text rendered when custom `children` are not supplied. */
|
|
3527
4546
|
label?: string;
|
|
3528
4547
|
/** Secondary text rendered below `label` when custom `children` are not supplied. */
|
|
@@ -3646,6 +4665,226 @@ declare type ListVariantProps = {
|
|
|
3646
4665
|
[key in keyof ListVariant]?: ConditionalValue<ListVariant[key]> | undefined
|
|
3647
4666
|
}
|
|
3648
4667
|
|
|
4668
|
+
/** Value returned by {@link useLocale} and provided by {@link LocaleProvider}. */
|
|
4669
|
+
export declare interface LocaleContextType {
|
|
4670
|
+
/**
|
|
4671
|
+
* BCP 47 locale tag, such as `en-US` or `fr-FR`, for `Intl` formatting in
|
|
4672
|
+
* date components.
|
|
4673
|
+
*/
|
|
4674
|
+
locale: string;
|
|
4675
|
+
/** Built-in component text, with every entry resolved. */
|
|
4676
|
+
labels: LocaleLabels;
|
|
4677
|
+
}
|
|
4678
|
+
|
|
4679
|
+
/**
|
|
4680
|
+
* Built-in text that design-system components render or announce.
|
|
4681
|
+
*
|
|
4682
|
+
* Every entry has an English default in {@link defaultLocaleLabels}. Pass a
|
|
4683
|
+
* partial set to {@link LocaleProvider} to translate them in one place. A
|
|
4684
|
+
* label prop on a component still overrides the provider.
|
|
4685
|
+
*
|
|
4686
|
+
* Entries that include a value are functions, so the app can pass them to
|
|
4687
|
+
* its own translation function with plural and interpolation support.
|
|
4688
|
+
*/
|
|
4689
|
+
export declare interface LocaleLabels {
|
|
4690
|
+
/** Default cancel button text in modals and date and time menus. */
|
|
4691
|
+
cancel: string;
|
|
4692
|
+
/** Default submit button text in `Modal`. */
|
|
4693
|
+
submit: string;
|
|
4694
|
+
/** Accessible name and tooltip of the save button in `KeyFact`. */
|
|
4695
|
+
save: string;
|
|
4696
|
+
/** Apply button text in range and date-time menus. */
|
|
4697
|
+
apply: string;
|
|
4698
|
+
/** Accessible name of the dismiss button in `Alert` and `Toast`. */
|
|
4699
|
+
dismiss: string;
|
|
4700
|
+
/** Accessible name of the close button in `ModalHeader`. */
|
|
4701
|
+
closeDialog: string;
|
|
4702
|
+
/** Accessible name of the close button in `DrawerHeader`. */
|
|
4703
|
+
closeDrawer: string;
|
|
4704
|
+
/** Accessible name and tooltip of the close button in `PopoverClose`. */
|
|
4705
|
+
closePopover: string;
|
|
4706
|
+
/** Accessible name of the remove button on a dismissible `Chip`. */
|
|
4707
|
+
removeItem: (item: string) => string;
|
|
4708
|
+
/** Accessible name of the remove button on a `FilterToken`, given the filter as a sentence. */
|
|
4709
|
+
removeFilter: (filter: string) => string;
|
|
4710
|
+
/** Accessible name of `ThemeSwitcher`, given the theme it switches to. */
|
|
4711
|
+
switchToTheme: (nextTheme: Theme) => string;
|
|
4712
|
+
/** Label of a horizontal `KeyFact`, written before its value ("Owner:"). */
|
|
4713
|
+
keyFactLabel: (label: string) => string;
|
|
4714
|
+
/** Position text in `PeekBar`, such as "Case 3 of 40". */
|
|
4715
|
+
peekPosition: (position: {
|
|
4716
|
+
noun: string;
|
|
4717
|
+
index: number;
|
|
4718
|
+
total: number;
|
|
4719
|
+
}) => string;
|
|
4720
|
+
/** Accessible name of the previous button in `PeekBar`, given the noun. */
|
|
4721
|
+
previousItem: (noun: string) => string;
|
|
4722
|
+
/** Accessible name of the next button in `PeekBar`, given the noun. */
|
|
4723
|
+
nextItem: (noun: string) => string;
|
|
4724
|
+
/** Text of the open-full-page button in `PeekBar`. */
|
|
4725
|
+
openFullPage: string;
|
|
4726
|
+
/** Default placeholder for `Select` and `Autocomplete`. */
|
|
4727
|
+
selectPlaceholder: string;
|
|
4728
|
+
/** Empty-state text in a filtered `Menu`. */
|
|
4729
|
+
noResults: string;
|
|
4730
|
+
/** Accessible name of the `Autocomplete` listbox. */
|
|
4731
|
+
suggestions: string;
|
|
4732
|
+
/** Default `Autocomplete` text while options load. */
|
|
4733
|
+
loadingOptions: string;
|
|
4734
|
+
/** Default `Autocomplete` text when no option matches. */
|
|
4735
|
+
noOptions: string;
|
|
4736
|
+
/** Default text of the `Autocomplete` option that creates a custom value. */
|
|
4737
|
+
addOption: (value: string) => string;
|
|
4738
|
+
/** Screen-reader announcement after an `Autocomplete` option is selected. */
|
|
4739
|
+
optionSelected: (label: string) => string;
|
|
4740
|
+
/** Screen-reader announcement after a custom `Autocomplete` value is created. */
|
|
4741
|
+
optionCreated: (value: string) => string;
|
|
4742
|
+
/** Screen-reader announcement after an `Autocomplete` value is removed. */
|
|
4743
|
+
optionRemoved: (label: string) => string;
|
|
4744
|
+
/** Accessible name of the `Autocomplete` hidden-tag count. */
|
|
4745
|
+
moreSelected: (count: number) => string;
|
|
4746
|
+
/** Default accessible name of the `FilterField` input. */
|
|
4747
|
+
filterOrSearch: string;
|
|
4748
|
+
/** Default accessible name of the `FilterField` clear button. */
|
|
4749
|
+
clearFilters: string;
|
|
4750
|
+
/** Text of the `FilterField` button that lists the tokens that do not fit. */
|
|
4751
|
+
moreFilters: (count: number) => string;
|
|
4752
|
+
/** Default accessible name and tooltip of the `CodeBlock` copy button. */
|
|
4753
|
+
copyCode: string;
|
|
4754
|
+
/** Tooltip and announcement after `CodeBlock` copies its code. */
|
|
4755
|
+
copied: string;
|
|
4756
|
+
/** Announcement when `CodeBlock` cannot copy its code. */
|
|
4757
|
+
copyFailed: string;
|
|
4758
|
+
/** Text of the `CodeBlock` button that expands a collapsed block. */
|
|
4759
|
+
showAllLines: (count: number) => string;
|
|
4760
|
+
/** Text of the `CodeBlock` button that collapses an expanded block. */
|
|
4761
|
+
showLess: string;
|
|
4762
|
+
/** Accessible name of the `Tabs` overflow menu button. */
|
|
4763
|
+
moreTabs: string;
|
|
4764
|
+
/** Default accessible name of `Calendar`. */
|
|
4765
|
+
chooseDate: string;
|
|
4766
|
+
/** Accessible name of the previous-month button. */
|
|
4767
|
+
previousMonth: string;
|
|
4768
|
+
/** Accessible name of the next-month button. */
|
|
4769
|
+
nextMonth: string;
|
|
4770
|
+
/** Accessible name of the previous-year button. */
|
|
4771
|
+
previousYear: string;
|
|
4772
|
+
/** Accessible name of the next-year button. */
|
|
4773
|
+
nextYear: string;
|
|
4774
|
+
/** Accessible name of the previous-years button. */
|
|
4775
|
+
previousYears: string;
|
|
4776
|
+
/** Accessible name of the next-years button. */
|
|
4777
|
+
nextYears: string;
|
|
4778
|
+
/** Accessible name of the month grid. */
|
|
4779
|
+
chooseMonthIn: (year: number) => string;
|
|
4780
|
+
/** Accessible name of the year grid. */
|
|
4781
|
+
chooseYear: string;
|
|
4782
|
+
/** Added to a day's accessible name when it is today. */
|
|
4783
|
+
today: string;
|
|
4784
|
+
/** Added to a day's accessible name when it is selected. */
|
|
4785
|
+
selected: string;
|
|
4786
|
+
/** Added to a day's accessible name when it starts a range. */
|
|
4787
|
+
rangeStart: string;
|
|
4788
|
+
/** Added to a day's accessible name when it ends a range. */
|
|
4789
|
+
rangeEnd: string;
|
|
4790
|
+
/** Default accessible name of a date field. */
|
|
4791
|
+
date: string;
|
|
4792
|
+
/** Default accessible name of a time field. */
|
|
4793
|
+
time: string;
|
|
4794
|
+
/** Default accessible name of a range's start date. */
|
|
4795
|
+
startDate: string;
|
|
4796
|
+
/** Default accessible name of a range's end date. */
|
|
4797
|
+
endDate: string;
|
|
4798
|
+
/** Default accessible name of a range's start time. */
|
|
4799
|
+
startTime: string;
|
|
4800
|
+
/** Default accessible name of a range's end time. */
|
|
4801
|
+
endTime: string;
|
|
4802
|
+
/** Accessible name of the month segment. */
|
|
4803
|
+
month: string;
|
|
4804
|
+
/** Accessible name of the day segment. */
|
|
4805
|
+
day: string;
|
|
4806
|
+
/** Accessible name of the year segment. */
|
|
4807
|
+
year: string;
|
|
4808
|
+
/** Accessible name of the hour segment and hour column. */
|
|
4809
|
+
hour: string;
|
|
4810
|
+
/** Accessible name of the minute segment and minute column. */
|
|
4811
|
+
minute: string;
|
|
4812
|
+
/** Accessible name of the AM/PM segment and column. */
|
|
4813
|
+
meridiem: string;
|
|
4814
|
+
/** Accessible name of a named field's hour column, such as "Start time hour". */
|
|
4815
|
+
fieldHour: (field: string) => string;
|
|
4816
|
+
/** Accessible name of a named field's minute column. */
|
|
4817
|
+
fieldMinute: (field: string) => string;
|
|
4818
|
+
/** Accessible name of a named field's AM/PM column. */
|
|
4819
|
+
fieldMeridiem: (field: string) => string;
|
|
4820
|
+
/** Placeholder of the month segment. */
|
|
4821
|
+
monthPlaceholder: string;
|
|
4822
|
+
/** Placeholder of the day segment. */
|
|
4823
|
+
dayPlaceholder: string;
|
|
4824
|
+
/** Placeholder of the year segment. */
|
|
4825
|
+
yearPlaceholder: string;
|
|
4826
|
+
/** Placeholder of the hour segment. */
|
|
4827
|
+
hourPlaceholder: string;
|
|
4828
|
+
/** Placeholder of the minute segment. */
|
|
4829
|
+
minutePlaceholder: string;
|
|
4830
|
+
/** Header of the hour column in time menus. */
|
|
4831
|
+
hourColumn: string;
|
|
4832
|
+
/** Header of the minute column in time menus. */
|
|
4833
|
+
minuteColumn: string;
|
|
4834
|
+
/** Header of the AM/PM column in time menus. */
|
|
4835
|
+
meridiemColumn: string;
|
|
4836
|
+
/** Default accessible name of the clear button in `DateInput`. */
|
|
4837
|
+
clearDate: string;
|
|
4838
|
+
/** Default accessible name of the clear button in `DateRangeInput`. */
|
|
4839
|
+
clearDateRange: string;
|
|
4840
|
+
/** Default accessible name of the clear button in `TimeInput`. */
|
|
4841
|
+
clearTime: string;
|
|
4842
|
+
/** Default accessible name of the clear button in `TimeRangeInput`. */
|
|
4843
|
+
clearTimeRange: string;
|
|
4844
|
+
/** Default accessible name of the clear button in `DateTimeInput`. */
|
|
4845
|
+
clearDateTime: string;
|
|
4846
|
+
/** Default accessible name of the start clear button in `DateTimeRangePicker`. */
|
|
4847
|
+
clearStartDateTime: string;
|
|
4848
|
+
/** Default accessible name of the end clear button in `DateTimeRangePicker`. */
|
|
4849
|
+
clearEndDateTime: string;
|
|
4850
|
+
}
|
|
4851
|
+
|
|
4852
|
+
/**
|
|
4853
|
+
* Provides the locale and built-in labels to design-system components.
|
|
4854
|
+
*
|
|
4855
|
+
* The design system does not translate text. The app passes its own
|
|
4856
|
+
* translations through `labels`. A label prop on a component overrides the
|
|
4857
|
+
* provider. Text direction comes from `<html dir>`, not from this provider.
|
|
4858
|
+
* Providers can nest; an inner provider overrides only what it sets.
|
|
4859
|
+
*
|
|
4860
|
+
* @example
|
|
4861
|
+
* ```tsx
|
|
4862
|
+
* <LocaleProvider
|
|
4863
|
+
* locale="fr-FR"
|
|
4864
|
+
* labels={{ closeDialog: t('ds.closeDialog'), noResults: t('ds.noResults') }}
|
|
4865
|
+
* >
|
|
4866
|
+
* <App />
|
|
4867
|
+
* </LocaleProvider>
|
|
4868
|
+
* ```
|
|
4869
|
+
*/
|
|
4870
|
+
export declare function LocaleProvider({ locale, labels, children, }: LocaleProviderProps): JSX.Element;
|
|
4871
|
+
|
|
4872
|
+
/** Props for {@link LocaleProvider}. */
|
|
4873
|
+
export declare interface LocaleProviderProps {
|
|
4874
|
+
/**
|
|
4875
|
+
* BCP 47 locale tag, such as `en-US` or `fr-FR`, for `Intl` formatting in
|
|
4876
|
+
* date components. Defaults to the parent provider's locale, then `en-US`.
|
|
4877
|
+
*/
|
|
4878
|
+
locale?: string;
|
|
4879
|
+
/**
|
|
4880
|
+
* Translated built-in labels. An entry left out, or set to `undefined`,
|
|
4881
|
+
* keeps the parent provider's value, then the English default.
|
|
4882
|
+
*/
|
|
4883
|
+
labels?: Partial<LocaleLabels>;
|
|
4884
|
+
/** Content that reads the locale and labels. */
|
|
4885
|
+
children: ReactNode;
|
|
4886
|
+
}
|
|
4887
|
+
|
|
3649
4888
|
/**
|
|
3650
4889
|
* Displays a keyboard-navigable action list from a trigger or inline in a layout.
|
|
3651
4890
|
*
|
|
@@ -3663,21 +4902,31 @@ declare type ListVariantProps = {
|
|
|
3663
4902
|
*/
|
|
3664
4903
|
export declare const Menu: (props: MenuProps) => JSX.Element;
|
|
3665
4904
|
|
|
4905
|
+
/** Shared root behavior consumed by menu compound components. */
|
|
3666
4906
|
export declare type MenuContext = {
|
|
3667
4907
|
density: MenuDensity;
|
|
3668
4908
|
panel?: MenuVariantProps['panel'];
|
|
3669
4909
|
closeOnSelect: boolean;
|
|
3670
4910
|
subMenuInteraction: SubMenuInteraction;
|
|
3671
4911
|
inline: boolean;
|
|
4912
|
+
/**
|
|
4913
|
+
* True when the root list renders in the page with no popup of its own
|
|
4914
|
+
* (`inline`, or no `trigger`). No root popup returns focus on close, so a
|
|
4915
|
+
* flyout restores focus to its own trigger instead.
|
|
4916
|
+
*/
|
|
4917
|
+
rendersInline: boolean;
|
|
3672
4918
|
onCloseMenu: () => void;
|
|
3673
4919
|
onPushDiginLevel: (title: string, levelChildren: ReactNode) => void;
|
|
3674
4920
|
onPopDiginLevel: () => void;
|
|
3675
|
-
onMenubarEdgeNavigate?: (direction: 1 | -1) => void;
|
|
3676
4921
|
diginDepth: number;
|
|
4922
|
+
/** See `Menu` prop `onMenubarEdgeNavigate`. */
|
|
4923
|
+
onMenubarEdgeNavigate?: (direction: 1 | -1) => void;
|
|
3677
4924
|
};
|
|
3678
4925
|
|
|
3679
|
-
|
|
4926
|
+
/** Spacing density shared by a menu panel and its rows. */
|
|
4927
|
+
export declare type MenuDensity = ListDensity;
|
|
3680
4928
|
|
|
4929
|
+
/** Filtering state consumed by menu compound components. */
|
|
3681
4930
|
declare type MenuFilterContextValue = {
|
|
3682
4931
|
query: string;
|
|
3683
4932
|
filterMode: MenuFilterMode;
|
|
@@ -3688,6 +4937,7 @@ declare type MenuFilterContextValue = {
|
|
|
3688
4937
|
}) => string;
|
|
3689
4938
|
};
|
|
3690
4939
|
|
|
4940
|
+
/** Determines whether `query` hides non-matching menu items. */
|
|
3691
4941
|
declare type MenuFilterMode = 'none' | 'contains';
|
|
3692
4942
|
|
|
3693
4943
|
/**
|
|
@@ -3705,12 +4955,18 @@ declare type MenuFilterMode = 'none' | 'contains';
|
|
|
3705
4955
|
*/
|
|
3706
4956
|
export declare const MenuGroup: (props: MenuGroupProps) => JSX.Element | null;
|
|
3707
4957
|
|
|
3708
|
-
|
|
4958
|
+
declare type MenuGroupOwnProps = {
|
|
4959
|
+
/** Optional group heading. */
|
|
3709
4960
|
label?: string;
|
|
4961
|
+
/** Menu children shown only when at least one child matches the current filter. */
|
|
3710
4962
|
children: ReactNode;
|
|
4963
|
+
/** Adds a divider before the group. */
|
|
3711
4964
|
divider?: boolean;
|
|
3712
4965
|
};
|
|
3713
4966
|
|
|
4967
|
+
/** Props for {@link MenuGroup}, a labeled group of related menu children. */
|
|
4968
|
+
export declare type MenuGroupProps = Omit<BoxProps, keyof MenuGroupOwnProps> & MenuGroupOwnProps;
|
|
4969
|
+
|
|
3714
4970
|
/**
|
|
3715
4971
|
* Renders an actionable row within a {@link Menu}.
|
|
3716
4972
|
*
|
|
@@ -3725,58 +4981,167 @@ export declare type MenuGroupProps = BoxProps & {
|
|
|
3725
4981
|
*/
|
|
3726
4982
|
export declare const MenuItem: (props: MenuItemProps) => JSX.Element | null;
|
|
3727
4983
|
|
|
3728
|
-
|
|
4984
|
+
/** Props for {@link MenuItem}, a selectable row inside a {@link Menu}. */
|
|
4985
|
+
export declare type MenuItemProps = Omit<BoxProps, 'as' | 'ref' | 'onClick' | 'type'> & Omit<MenuVariantProps, 'iconBefore' | 'iconAfter'> & {
|
|
4986
|
+
/** Primary visible text, also used for typeahead and filtering unless `textValue` is supplied. */
|
|
3729
4987
|
label?: string;
|
|
4988
|
+
/** Secondary visible text included in filtering by default. */
|
|
3730
4989
|
description?: string;
|
|
4990
|
+
/**
|
|
4991
|
+
* Chooses a regular item, checkable item, toggle item, or divider.
|
|
4992
|
+
* @default 'default'
|
|
4993
|
+
*/
|
|
3731
4994
|
variant?: MenuItemVariant;
|
|
4995
|
+
/** Prevents activation and marks the row unavailable to assistive technology. */
|
|
3732
4996
|
disabled?: boolean;
|
|
4997
|
+
/** Sets selected styling and `aria-checked` for checkbox and toggle variants. */
|
|
3733
4998
|
selected?: boolean;
|
|
4999
|
+
/** Icon displayed before the item text. */
|
|
3734
5000
|
iconBefore?: IconNamesList;
|
|
5001
|
+
/** Icon displayed after the item text. */
|
|
3735
5002
|
iconAfter?: IconNamesList;
|
|
5003
|
+
/** Renders the item as an anchor instead of a button. */
|
|
3736
5004
|
href?: string;
|
|
5005
|
+
/** Browsing context for an anchor item. */
|
|
3737
5006
|
target?: string;
|
|
5007
|
+
/** Relationship attribute for an anchor item, such as `noopener` for a new tab. */
|
|
3738
5008
|
rel?: string;
|
|
5009
|
+
/** Overrides the parent menu's `closeOnSelect` behavior for this item. */
|
|
3739
5010
|
closeOnSelect?: boolean;
|
|
5011
|
+
/** Overrides the parent menu's row density for this item. */
|
|
3740
5012
|
density?: MenuDensity;
|
|
5013
|
+
/** Explicit text used for typeahead and filtering instead of label and description. */
|
|
3741
5014
|
textValue?: string;
|
|
5015
|
+
/** Called for pointer selection before the menu closes. Call `event.preventDefault()` to prevent the automatic close and tree click event. */
|
|
3742
5016
|
onClick?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
3743
5017
|
};
|
|
3744
5018
|
|
|
5019
|
+
/** Visual and ARIA role variants supported by {@link MenuItem}. */
|
|
3745
5020
|
export declare type MenuItemVariant = 'default' | 'checkbox' | 'toggle' | 'divider';
|
|
3746
5021
|
|
|
5022
|
+
/** Roving-focus state for one menu level. */
|
|
3747
5023
|
declare type MenuListContextValue = {
|
|
3748
5024
|
activeIndex: number | null;
|
|
3749
|
-
|
|
5025
|
+
/**
|
|
5026
|
+
* Row that holds the roving tab stop. Falls back to `activeIndex` when
|
|
5027
|
+
* omitted; the root menu sets it so Tab can enter before any row is active.
|
|
5028
|
+
*/
|
|
5029
|
+
tabbableIndex?: number | null;
|
|
3750
5030
|
getItemProps: (userProps?: HTMLProps<HTMLElement>) => HTMLProps<HTMLElement>;
|
|
5031
|
+
/** Move active item along the list main axis (looping), for nested submenu delegation. */
|
|
5032
|
+
navigateMainAxis?: (direction: 1 | -1) => void;
|
|
5033
|
+
/** 0 = root menu panel; each nested `SubMenu` flyout increments by 1. */
|
|
5034
|
+
nestedMenuDepth: number;
|
|
5035
|
+
/** Close the flyout for this list’s parent `SubMenu` and focus its trigger (APG popout Left). */
|
|
5036
|
+
closeParentSubMenuFlyout?: () => void;
|
|
3751
5037
|
};
|
|
3752
5038
|
|
|
3753
|
-
|
|
5039
|
+
declare type MenuOwnProps = {
|
|
5040
|
+
/** Trigger element cloned with the menu's event handlers and ARIA attributes. Omit it, or use `inline`, to render the menu in place. */
|
|
3754
5041
|
trigger?: ReactElement;
|
|
5042
|
+
/** `MenuItem`, `MenuGroup`, and `SubMenu` children that make up the menu. */
|
|
3755
5043
|
children: ReactNode;
|
|
5044
|
+
/** Controlled popup state. Pair with `onOpenChange`; omit it to use `defaultOpen`. */
|
|
3756
5045
|
open?: boolean;
|
|
5046
|
+
/**
|
|
5047
|
+
* Initial popup state for an uncontrolled triggered menu. It is used only on first render.
|
|
5048
|
+
* @default false
|
|
5049
|
+
*/
|
|
3757
5050
|
defaultOpen?: boolean;
|
|
5051
|
+
/** Called when interaction requests that a triggered menu open or close. */
|
|
3758
5052
|
onOpenChange?: (open: boolean) => void;
|
|
5053
|
+
/**
|
|
5054
|
+
* Floating UI placement of a triggered menu relative to its trigger.
|
|
5055
|
+
* @default 'bottom-start'
|
|
5056
|
+
*/
|
|
3759
5057
|
placement?: Placement;
|
|
5058
|
+
/**
|
|
5059
|
+
* Positioning strategy for a triggered menu.
|
|
5060
|
+
* @default 'absolute'
|
|
5061
|
+
*/
|
|
3760
5062
|
strategy?: 'absolute' | 'fixed';
|
|
5063
|
+
/**
|
|
5064
|
+
* Closes the root menu after a `MenuItem` is selected unless that item overrides it.
|
|
5065
|
+
* @default true
|
|
5066
|
+
*/
|
|
3761
5067
|
closeOnSelect?: boolean;
|
|
5068
|
+
/**
|
|
5069
|
+
* Renders the panel in normal document flow without requiring a trigger.
|
|
5070
|
+
* @default false
|
|
5071
|
+
*/
|
|
3762
5072
|
inline?: boolean;
|
|
5073
|
+
/**
|
|
5074
|
+
* Pointer interactions that open the trigger.
|
|
5075
|
+
* @default 'click'
|
|
5076
|
+
*/
|
|
3763
5077
|
triggerInteraction?: MenuTriggerInteraction;
|
|
5078
|
+
/**
|
|
5079
|
+
* Delay before hover interaction opens the menu, in milliseconds.
|
|
5080
|
+
* @default 75
|
|
5081
|
+
*/
|
|
3764
5082
|
triggerOpenDelay?: number;
|
|
5083
|
+
/**
|
|
5084
|
+
* Delay before hover interaction closes the menu, in milliseconds.
|
|
5085
|
+
* @default 100
|
|
5086
|
+
*/
|
|
3765
5087
|
triggerCloseDelay?: number;
|
|
5088
|
+
/**
|
|
5089
|
+
* Default presentation for descendant `SubMenu` components.
|
|
5090
|
+
* @default 'hover'
|
|
5091
|
+
*/
|
|
3766
5092
|
subMenuInteraction?: SubMenuInteraction;
|
|
5093
|
+
/**
|
|
5094
|
+
* Spacing density for menu rows.
|
|
5095
|
+
* @default 'compact'
|
|
5096
|
+
*/
|
|
3767
5097
|
density?: MenuDensity;
|
|
5098
|
+
/**
|
|
5099
|
+
* Text used to filter `MenuItem` and `SubMenu` labels when `filterMode` is `'contains'`.
|
|
5100
|
+
* @default ''
|
|
5101
|
+
*/
|
|
3768
5102
|
query?: string;
|
|
5103
|
+
/** Reserved for external filtering controls; this component does not call it. */
|
|
3769
5104
|
onQueryChange?: (query: string) => void;
|
|
5105
|
+
/**
|
|
5106
|
+
* Enables case-insensitive substring filtering when set to `'contains'`.
|
|
5107
|
+
* @default 'none'
|
|
5108
|
+
*/
|
|
3770
5109
|
filterMode?: MenuFilterMode;
|
|
5110
|
+
/**
|
|
5111
|
+
* Content rendered when filtering leaves no visible menu children.
|
|
5112
|
+
* @default 'No results found'
|
|
5113
|
+
*/
|
|
3771
5114
|
renderNoResults?: ReactNode;
|
|
5115
|
+
/**
|
|
5116
|
+
* Highlights case-insensitive query matches in visible labels and descriptions.
|
|
5117
|
+
* @default Boolean(query)
|
|
5118
|
+
*/
|
|
3772
5119
|
highlightMatches?: boolean;
|
|
5120
|
+
/**
|
|
5121
|
+
* Derives searchable text when an item does not provide `textValue`. It receives the item's label and description.
|
|
5122
|
+
* @default joins label and description with a space
|
|
5123
|
+
*/
|
|
3773
5124
|
getItemText?: (item: {
|
|
3774
5125
|
label?: string;
|
|
3775
5126
|
description?: string;
|
|
3776
5127
|
}) => string;
|
|
5128
|
+
/** Applies the recipe's panel visual treatment. */
|
|
3777
5129
|
panel?: MenuVariantProps['panel'];
|
|
5130
|
+
/**
|
|
5131
|
+
* When this `Menu` is used as one section of a horizontal menubar, pass a
|
|
5132
|
+
* handler so Arrow Left / Arrow Right on **leaf** items and at the first
|
|
5133
|
+
* submenu level can move to the previous/next menubar section (APG Navigation
|
|
5134
|
+
* Menubar pattern). Typically closes this menu then focuses/opens the
|
|
5135
|
+
* adjacent section’s trigger.
|
|
5136
|
+
* Also enables focus order so the trigger keeps focus while the panel is open
|
|
5137
|
+
* until the user arrows into the list (otherwise focus would jump to the first
|
|
5138
|
+
* row and horizontal menubar keys would not run on the trigger).
|
|
5139
|
+
*/
|
|
3778
5140
|
onMenubarEdgeNavigate?: (direction: 1 | -1) => void;
|
|
3779
|
-
}
|
|
5141
|
+
};
|
|
5142
|
+
|
|
5143
|
+
/** Props for {@link Menu}, including popup state, filtering, and nested-menu behavior. */
|
|
5144
|
+
export declare type MenuProps = Omit<BoxProps, keyof MenuOwnProps> & MenuOwnProps;
|
|
3780
5145
|
|
|
3781
5146
|
/**
|
|
3782
5147
|
* Provides menu root and filter context for custom compound-menu composition.
|
|
@@ -3793,13 +5158,18 @@ export declare type MenuProps = {
|
|
|
3793
5158
|
*/
|
|
3794
5159
|
export declare const MenuProvider: ({ children, root, filter }: MenuProviderProps) => JSX.Element;
|
|
3795
5160
|
|
|
5161
|
+
/** Props for {@link MenuProvider}, an escape hatch for custom menu composition. */
|
|
3796
5162
|
export declare type MenuProviderProps = {
|
|
5163
|
+
/** Descendants that consume the supplied menu contexts. */
|
|
3797
5164
|
children: ReactNode;
|
|
5165
|
+
/** Partial root behavior merged with the normal menu defaults. */
|
|
3798
5166
|
root?: Partial<MenuContext>;
|
|
5167
|
+
/** Partial filtering behavior merged with the normal menu defaults. */
|
|
3799
5168
|
filter?: Partial<MenuFilterContextValue>;
|
|
3800
5169
|
};
|
|
3801
5170
|
|
|
3802
|
-
|
|
5171
|
+
/** Pointer or focus interactions that can open a menu trigger. */
|
|
5172
|
+
declare type MenuTriggerInteraction = 'click' | 'hover' | 'focus' | 'click-and-hover';
|
|
3803
5173
|
|
|
3804
5174
|
declare interface MenuVariant {
|
|
3805
5175
|
/**
|
|
@@ -3811,6 +5181,7 @@ declare interface MenuVariant {
|
|
|
3811
5181
|
*/
|
|
3812
5182
|
density: "compact" | "comfortable" | "spacious"
|
|
3813
5183
|
panel: boolean
|
|
5184
|
+
scrollable: boolean
|
|
3814
5185
|
}
|
|
3815
5186
|
|
|
3816
5187
|
declare type MenuVariantProps = {
|
|
@@ -4015,6 +5386,12 @@ declare interface ModalWrapperContextValue {
|
|
|
4015
5386
|
onClose: () => void;
|
|
4016
5387
|
/** Whether the parent modal blocks overlay-triggered closing. */
|
|
4017
5388
|
preventOverlayClose?: boolean;
|
|
5389
|
+
/**
|
|
5390
|
+
* Tells the modal that a header close button is rendered. The modal then
|
|
5391
|
+
* focuses the dialog itself on open, so the close button's tooltip does not
|
|
5392
|
+
* open and take the first Escape. Returns the cleanup that unregisters it.
|
|
5393
|
+
*/
|
|
5394
|
+
registerHeaderCloseButton: () => () => void;
|
|
4018
5395
|
}
|
|
4019
5396
|
|
|
4020
5397
|
/** Props for {@link ModalWrapper}, a controlled, portalled dialog shell. */
|
|
@@ -4032,6 +5409,9 @@ export declare type ModalWrapperProps = Omit<BoxProps, keyof ModalVariantProps>
|
|
|
4032
5409
|
* Element to focus when the dialog opens. Forwarded to Floating UI's
|
|
4033
5410
|
* `FloatingFocusManager`. A number selects by tabbable index; a ref targets
|
|
4034
5411
|
* a specific element (for example Cancel on a delete confirmation).
|
|
5412
|
+
*
|
|
5413
|
+
* Default: the dialog itself when a `ModalHeader` close button is shown,
|
|
5414
|
+
* otherwise the first tabbable element.
|
|
4035
5415
|
*/
|
|
4036
5416
|
initialFocus?: number | RefObject<HTMLElement | null>;
|
|
4037
5417
|
/** Dialog content, typically composed from `ModalHeader`, `ModalBody`, and `ModalFooter`. */
|
|
@@ -5421,6 +6801,209 @@ export declare type OptionProps = {
|
|
|
5421
6801
|
iconRight?: IconNamesList;
|
|
5422
6802
|
};
|
|
5423
6803
|
|
|
6804
|
+
/** Identity of one measured item. Keys must be unique and stable across renders. */
|
|
6805
|
+
export declare type OverflowItemKey = string | number;
|
|
6806
|
+
|
|
6807
|
+
/**
|
|
6808
|
+
* States a system condition that affects the entire page, spanning its full
|
|
6809
|
+
* width.
|
|
6810
|
+
*
|
|
6811
|
+
* A page banner has no dismiss control by design: it describes a condition
|
|
6812
|
+
* that persists until it is resolved, so removing it is the application's
|
|
6813
|
+
* decision, not the reader's. Use `Alert` for a message scoped to one section.
|
|
6814
|
+
*
|
|
6815
|
+
* Renders a `div` with `role="alert"` when `tone` is `danger` and
|
|
6816
|
+
* `role="status"` otherwise. `tone="neutral"` uses the info icon.
|
|
6817
|
+
*
|
|
6818
|
+
* @example
|
|
6819
|
+
* ```tsx
|
|
6820
|
+
* <PageBanner tone="warning" emphasis="bold">
|
|
6821
|
+
* Scheduled maintenance begins at 22:00 UTC.
|
|
6822
|
+
* </PageBanner>
|
|
6823
|
+
* ```
|
|
6824
|
+
*/
|
|
6825
|
+
export declare const PageBanner: (props: PageBannerProps) => JSX.Element;
|
|
6826
|
+
|
|
6827
|
+
/** Visual weight of a {@link PageBanner}. */
|
|
6828
|
+
export declare type PageBannerEmphasis = 'subtle' | 'bold';
|
|
6829
|
+
|
|
6830
|
+
declare type PageBannerOwnProps = {
|
|
6831
|
+
/** Semantic tone. Selects the surface, border, and tone icon. */
|
|
6832
|
+
/** @default "info" */
|
|
6833
|
+
tone?: AlertTone;
|
|
6834
|
+
/**
|
|
6835
|
+
* Visual weight. `subtle` tints the page edge; `bold` fills the banner with
|
|
6836
|
+
* the tone color and inverts text and icon for maximum contrast.
|
|
6837
|
+
*
|
|
6838
|
+
* @default "subtle"
|
|
6839
|
+
*/
|
|
6840
|
+
emphasis?: PageBannerEmphasis;
|
|
6841
|
+
/** The banner message. */
|
|
6842
|
+
children: ReactNode;
|
|
6843
|
+
/** Leading action, normally a `Button`. */
|
|
6844
|
+
primaryAction?: ReactNode;
|
|
6845
|
+
/** Trailing action, normally a lower-emphasis `Button`. Render only alongside `primaryAction`. */
|
|
6846
|
+
secondaryAction?: ReactNode;
|
|
6847
|
+
};
|
|
6848
|
+
|
|
6849
|
+
/** Props accepted by {@link PageBanner}. Includes compatible native element props. */
|
|
6850
|
+
export declare type PageBannerProps = Omit<BoxProps, keyof PageBannerVariantProps | keyof PageBannerOwnProps> & Omit<PageBannerVariantProps, 'tone'> & PageBannerOwnProps;
|
|
6851
|
+
|
|
6852
|
+
declare interface PageBannerVariant {
|
|
6853
|
+
/**
|
|
6854
|
+
* @default "info"
|
|
6855
|
+
*/
|
|
6856
|
+
tone: "info" | "success" | "warning" | "danger" | "neutral"
|
|
6857
|
+
}
|
|
6858
|
+
|
|
6859
|
+
declare type PageBannerVariantProps = {
|
|
6860
|
+
[key in keyof PageBannerVariant]?: ConditionalValue<PageBannerVariant[key]> | undefined
|
|
6861
|
+
}
|
|
6862
|
+
|
|
6863
|
+
/** A page resolved to CSS pixels at scale 1. */
|
|
6864
|
+
declare type PageBox = {
|
|
6865
|
+
width: number;
|
|
6866
|
+
height: number;
|
|
6867
|
+
margins: PageMarginBox;
|
|
6868
|
+
};
|
|
6869
|
+
|
|
6870
|
+
/** Page margins in CSS pixels. */
|
|
6871
|
+
declare type PageMarginBox = {
|
|
6872
|
+
top: number;
|
|
6873
|
+
right: number;
|
|
6874
|
+
bottom: number;
|
|
6875
|
+
left: number;
|
|
6876
|
+
};
|
|
6877
|
+
|
|
6878
|
+
/**
|
|
6879
|
+
* Page margins in the page's `unit`. A number applies the same margin to all
|
|
6880
|
+
* four sides.
|
|
6881
|
+
*/
|
|
6882
|
+
export declare type PageMargins = number | {
|
|
6883
|
+
top: number;
|
|
6884
|
+
right: number;
|
|
6885
|
+
bottom: number;
|
|
6886
|
+
left: number;
|
|
6887
|
+
};
|
|
6888
|
+
|
|
6889
|
+
/**
|
|
6890
|
+
* Page orientation. `portrait` makes the page taller than it is wide and
|
|
6891
|
+
* `landscape` makes it wider than it is tall, whichever way the size is given.
|
|
6892
|
+
*/
|
|
6893
|
+
export declare type PageOrientation = 'portrait' | 'landscape';
|
|
6894
|
+
|
|
6895
|
+
/**
|
|
6896
|
+
* Physical size of a printed page.
|
|
6897
|
+
*
|
|
6898
|
+
* Pass one of the {@link pageSizes} presets or any object of this shape, such
|
|
6899
|
+
* as a size read from a template's `@page` rule.
|
|
6900
|
+
*
|
|
6901
|
+
* @example
|
|
6902
|
+
* ```ts
|
|
6903
|
+
* const shippingLabel: PageSize = { width: 4, height: 6, unit: 'in' };
|
|
6904
|
+
* ```
|
|
6905
|
+
*/
|
|
6906
|
+
export declare type PageSize = {
|
|
6907
|
+
/** Page width in `unit`. */
|
|
6908
|
+
width: number;
|
|
6909
|
+
/** Page height in `unit`. */
|
|
6910
|
+
height: number;
|
|
6911
|
+
/** Unit for `width`, `height`, and the page margins. */
|
|
6912
|
+
unit: PageUnit;
|
|
6913
|
+
};
|
|
6914
|
+
|
|
6915
|
+
/**
|
|
6916
|
+
* Common page and label stock sizes.
|
|
6917
|
+
*
|
|
6918
|
+
* Presets are plain {@link PageSize} values. Use an object literal for any size
|
|
6919
|
+
* not listed here.
|
|
6920
|
+
*
|
|
6921
|
+
* @example
|
|
6922
|
+
* ```tsx
|
|
6923
|
+
* <PrintPage size={pageSizes.a4} />
|
|
6924
|
+
* ```
|
|
6925
|
+
*/
|
|
6926
|
+
export declare const pageSizes: {
|
|
6927
|
+
readonly letter: {
|
|
6928
|
+
readonly width: 8.5;
|
|
6929
|
+
readonly height: 11;
|
|
6930
|
+
readonly unit: "in";
|
|
6931
|
+
};
|
|
6932
|
+
readonly legal: {
|
|
6933
|
+
readonly width: 8.5;
|
|
6934
|
+
readonly height: 14;
|
|
6935
|
+
readonly unit: "in";
|
|
6936
|
+
};
|
|
6937
|
+
readonly tabloid: {
|
|
6938
|
+
readonly width: 11;
|
|
6939
|
+
readonly height: 17;
|
|
6940
|
+
readonly unit: "in";
|
|
6941
|
+
};
|
|
6942
|
+
readonly halfLetter: {
|
|
6943
|
+
readonly width: 5.5;
|
|
6944
|
+
readonly height: 8.5;
|
|
6945
|
+
readonly unit: "in";
|
|
6946
|
+
};
|
|
6947
|
+
readonly a3: {
|
|
6948
|
+
readonly width: 297;
|
|
6949
|
+
readonly height: 420;
|
|
6950
|
+
readonly unit: "mm";
|
|
6951
|
+
};
|
|
6952
|
+
readonly a4: {
|
|
6953
|
+
readonly width: 210;
|
|
6954
|
+
readonly height: 297;
|
|
6955
|
+
readonly unit: "mm";
|
|
6956
|
+
};
|
|
6957
|
+
readonly a5: {
|
|
6958
|
+
readonly width: 148;
|
|
6959
|
+
readonly height: 210;
|
|
6960
|
+
readonly unit: "mm";
|
|
6961
|
+
};
|
|
6962
|
+
readonly a6: {
|
|
6963
|
+
readonly width: 105;
|
|
6964
|
+
readonly height: 148;
|
|
6965
|
+
readonly unit: "mm";
|
|
6966
|
+
};
|
|
6967
|
+
readonly postcard: {
|
|
6968
|
+
readonly width: 4;
|
|
6969
|
+
readonly height: 6;
|
|
6970
|
+
readonly unit: "in";
|
|
6971
|
+
};
|
|
6972
|
+
readonly card5x7: {
|
|
6973
|
+
readonly width: 5;
|
|
6974
|
+
readonly height: 7;
|
|
6975
|
+
readonly unit: "in";
|
|
6976
|
+
};
|
|
6977
|
+
readonly label4x6: {
|
|
6978
|
+
readonly width: 4;
|
|
6979
|
+
readonly height: 6;
|
|
6980
|
+
readonly unit: "in";
|
|
6981
|
+
};
|
|
6982
|
+
readonly label4x3: {
|
|
6983
|
+
readonly width: 4;
|
|
6984
|
+
readonly height: 3;
|
|
6985
|
+
readonly unit: "in";
|
|
6986
|
+
};
|
|
6987
|
+
readonly label4x2: {
|
|
6988
|
+
readonly width: 4;
|
|
6989
|
+
readonly height: 2;
|
|
6990
|
+
readonly unit: "in";
|
|
6991
|
+
};
|
|
6992
|
+
readonly label3x2: {
|
|
6993
|
+
readonly width: 3;
|
|
6994
|
+
readonly height: 2;
|
|
6995
|
+
readonly unit: "in";
|
|
6996
|
+
};
|
|
6997
|
+
readonly label2x1: {
|
|
6998
|
+
readonly width: 2;
|
|
6999
|
+
readonly height: 1;
|
|
7000
|
+
readonly unit: "in";
|
|
7001
|
+
};
|
|
7002
|
+
};
|
|
7003
|
+
|
|
7004
|
+
/** Unit used by a {@link PageSize} and its margins. */
|
|
7005
|
+
export declare type PageUnit = 'in' | 'mm' | 'pt';
|
|
7006
|
+
|
|
5424
7007
|
declare type ParentSelector = `${DataAttributes | AriaAttributes} &`
|
|
5425
7008
|
|
|
5426
7009
|
export declare type Parts = Record<string, SystemStyleObject>;
|
|
@@ -5436,12 +7019,441 @@ export declare type PatternConfig<T extends PatternProperties = PatternPropertie
|
|
|
5436
7019
|
|
|
5437
7020
|
export declare type PatternProperties = Record<string, unknown>;
|
|
5438
7021
|
|
|
7022
|
+
/**
|
|
7023
|
+
* Drawer chrome for a record opened from a list: position, previous and next,
|
|
7024
|
+
* open full page, and close.
|
|
7025
|
+
*
|
|
7026
|
+
* Place it at the top of a `Drawer`, above the record's page header. The
|
|
7027
|
+
* position text ("Case 3 of 40") is announced when it changes. "," and "."
|
|
7028
|
+
* open the previous and next records while focus is in the bar or its drawer.
|
|
7029
|
+
* All text comes
|
|
7030
|
+
* from `LocaleProvider` (`peekPosition`, `previousItem`, `nextItem`,
|
|
7031
|
+
* `openFullPage`, and `closeDrawer`).
|
|
7032
|
+
*
|
|
7033
|
+
* @example
|
|
7034
|
+
* ```tsx
|
|
7035
|
+
* <PeekBar noun="Case" index={3} total={40} onPrevious={prev} onNext={next} openHref="/case/3" />
|
|
7036
|
+
* ```
|
|
7037
|
+
*/
|
|
7038
|
+
export declare const PeekBar: (props: PeekBarProps) => JSX.Element;
|
|
7039
|
+
|
|
7040
|
+
/** Props for {@link PeekBar}. */
|
|
7041
|
+
export declare type PeekBarProps = Omit<BoxProps, 'children'> & {
|
|
7042
|
+
/** What the list holds, singular, such as "Case" or "Order". Used in the position text and button names. */
|
|
7043
|
+
noun: string;
|
|
7044
|
+
/** Position of the open record in the list, starting at 1. */
|
|
7045
|
+
index: number;
|
|
7046
|
+
/** Number of records in the list. */
|
|
7047
|
+
total: number;
|
|
7048
|
+
/** Opens the previous record. The button is disabled on the first record or when this is not set. */
|
|
7049
|
+
onPrevious?: () => void;
|
|
7050
|
+
/** Opens the next record. The button is disabled on the last record or when this is not set. */
|
|
7051
|
+
onNext?: () => void;
|
|
7052
|
+
/** Link to the record's full page. Shows the "Open" button. */
|
|
7053
|
+
openHref?: string;
|
|
7054
|
+
/** Opens the record's full page. Shows the "Open" button. Ignored when `openHref` is set. */
|
|
7055
|
+
onOpen?: () => void;
|
|
7056
|
+
/**
|
|
7057
|
+
* Closes the peek. Inside a `Drawer`, it defaults to the drawer's close.
|
|
7058
|
+
* The close button is hidden when there is no close action.
|
|
7059
|
+
*/
|
|
7060
|
+
onClose?: () => void;
|
|
7061
|
+
/**
|
|
7062
|
+
* Turns on the keyboard shortcuts: "," opens the previous record and "."
|
|
7063
|
+
* opens the next. They work while focus is in the bar, or anywhere in its
|
|
7064
|
+
* `Drawer`, except while a text field has focus or a modifier key is held.
|
|
7065
|
+
*
|
|
7066
|
+
* @default true
|
|
7067
|
+
*/
|
|
7068
|
+
shortcuts?: boolean;
|
|
7069
|
+
};
|
|
7070
|
+
|
|
5439
7071
|
/**
|
|
5440
7072
|
* Combines custom props with the compatible native props and ref for the
|
|
5441
7073
|
* element selected by `as`.
|
|
5442
7074
|
*/
|
|
5443
7075
|
declare type PolymorphicComponentProps<T extends ElementType, Props extends object = object> = Props & AsProp<T> & Omit<ComponentPropsWithRef<T>, PropsToOmit<T, Props>>;
|
|
5444
7076
|
|
|
7077
|
+
/**
|
|
7078
|
+
* Anchors multipurpose floating content for handbook notes, definitions, and
|
|
7079
|
+
* rich callouts.
|
|
7080
|
+
*
|
|
7081
|
+
* Compose with `PopoverTrigger`, optional `PopoverAnchor`, and
|
|
7082
|
+
* `PopoverContent` (plus Header/Title/Description/Body/Media/Footer/Close).
|
|
7083
|
+
* Use `interaction="definition"` for hover/focus plain notes without a focus
|
|
7084
|
+
* trap (content must be non-interactive), and `interaction="rich"` for
|
|
7085
|
+
* click-to-open interactive content with focus trapping.
|
|
7086
|
+
*
|
|
7087
|
+
* @example
|
|
7088
|
+
* ```tsx
|
|
7089
|
+
* <Popover interaction="definition" tone="warning">
|
|
7090
|
+
* <PopoverTrigger>cycle time</PopoverTrigger>
|
|
7091
|
+
* <PopoverContent>
|
|
7092
|
+
* <PopoverHeader>
|
|
7093
|
+
* <PopoverTitle>Warning</PopoverTitle>
|
|
7094
|
+
* </PopoverHeader>
|
|
7095
|
+
* <PopoverBody>
|
|
7096
|
+
* Cycle time includes queue and wait, not only active work.
|
|
7097
|
+
* </PopoverBody>
|
|
7098
|
+
* </PopoverContent>
|
|
7099
|
+
* </Popover>
|
|
7100
|
+
* ```
|
|
7101
|
+
*/
|
|
7102
|
+
export declare const Popover: (props: PopoverProps) => JSX.Element;
|
|
7103
|
+
|
|
7104
|
+
/**
|
|
7105
|
+
* Optionally separates positioning from the interactive trigger.
|
|
7106
|
+
*
|
|
7107
|
+
* When mounted, Floating UI positions the content relative to this element
|
|
7108
|
+
* while `PopoverTrigger` still receives hover/focus/click interactions.
|
|
7109
|
+
*
|
|
7110
|
+
* @example
|
|
7111
|
+
* ```tsx
|
|
7112
|
+
* <PopoverAnchor>
|
|
7113
|
+
* <Box display="inline-block">…</Box>
|
|
7114
|
+
* </PopoverAnchor>
|
|
7115
|
+
* ```
|
|
7116
|
+
*/
|
|
7117
|
+
export declare const PopoverAnchor: (props: PopoverAnchorProps) => JSX.Element;
|
|
7118
|
+
|
|
7119
|
+
/** Props for {@link PopoverAnchor}, an optional positioning reference. */
|
|
7120
|
+
export declare type PopoverAnchorProps = Omit<BoxProps, 'children'> & {
|
|
7121
|
+
/**
|
|
7122
|
+
* Element used for positioning while Trigger retains interaction props.
|
|
7123
|
+
* A single React element receives the position ref via `cloneElement`.
|
|
7124
|
+
*/
|
|
7125
|
+
children: ReactNode;
|
|
7126
|
+
};
|
|
7127
|
+
|
|
7128
|
+
/**
|
|
7129
|
+
* Optional explicit arrow. Content already renders an arrow when
|
|
7130
|
+
* `showArrow` is true on the root; use this only when customizing fill/stroke
|
|
7131
|
+
* and setting `showArrow={false}` on the root.
|
|
7132
|
+
*
|
|
7133
|
+
* @example
|
|
7134
|
+
* ```tsx
|
|
7135
|
+
* <Popover showArrow={false}>
|
|
7136
|
+
* <PopoverContent>
|
|
7137
|
+
* <PopoverBody>…</PopoverBody>
|
|
7138
|
+
* <PopoverArrow />
|
|
7139
|
+
* </PopoverContent>
|
|
7140
|
+
* </Popover>
|
|
7141
|
+
* ```
|
|
7142
|
+
*/
|
|
7143
|
+
export declare const PopoverArrow: (props: PopoverArrowProps) => JSX.Element;
|
|
7144
|
+
|
|
7145
|
+
/** Props for {@link PopoverArrow}. Prefer `showArrow` on the root in most cases. */
|
|
7146
|
+
export declare type PopoverArrowProps = {
|
|
7147
|
+
/** Override fill color token variable. */
|
|
7148
|
+
fill?: string;
|
|
7149
|
+
/** Override stroke color token variable. */
|
|
7150
|
+
stroke?: string;
|
|
7151
|
+
};
|
|
7152
|
+
|
|
7153
|
+
/**
|
|
7154
|
+
* Renders the main content region of a {@link PopoverContent}.
|
|
7155
|
+
*
|
|
7156
|
+
* @example
|
|
7157
|
+
* ```tsx
|
|
7158
|
+
* <PopoverBody>
|
|
7159
|
+
* Cycle time includes queue and wait, not only active work.
|
|
7160
|
+
* </PopoverBody>
|
|
7161
|
+
* ```
|
|
7162
|
+
*/
|
|
7163
|
+
export declare const PopoverBody: (props: PopoverBodyProps) => JSX.Element;
|
|
7164
|
+
|
|
7165
|
+
/** Props for {@link PopoverBody}, the main content region. */
|
|
7166
|
+
export declare type PopoverBodyProps = Omit<BoxProps, 'children'> & {
|
|
7167
|
+
/** Body content. Strings render as text; nodes may include links and controls. */
|
|
7168
|
+
children: string | ReactNode;
|
|
7169
|
+
};
|
|
7170
|
+
|
|
7171
|
+
/**
|
|
7172
|
+
* Optional control that closes the parent {@link Popover}.
|
|
7173
|
+
*
|
|
7174
|
+
* Escape and outside press already dismiss the panel; use this when a visible
|
|
7175
|
+
* close affordance is needed (typically in rich notes).
|
|
7176
|
+
*
|
|
7177
|
+
* @example
|
|
7178
|
+
* ```tsx
|
|
7179
|
+
* <PopoverHeader>
|
|
7180
|
+
* <PopoverTitle>Tip</PopoverTitle>
|
|
7181
|
+
* <PopoverClose />
|
|
7182
|
+
* </PopoverHeader>
|
|
7183
|
+
* ```
|
|
7184
|
+
*/
|
|
7185
|
+
export declare const PopoverClose: (props: PopoverCloseProps) => JSX.Element;
|
|
7186
|
+
|
|
7187
|
+
/** Props for {@link PopoverClose}, an optional dismiss control. */
|
|
7188
|
+
export declare type PopoverCloseProps = Omit<IconButtonProps, 'iconName' | 'altText' | 'onClick'> & {
|
|
7189
|
+
/** Accessible label for the close control. @default "Close" */
|
|
7190
|
+
altText?: string;
|
|
7191
|
+
/** Called after the popover requests close. */
|
|
7192
|
+
onClick?: IconButtonProps['onClick'];
|
|
7193
|
+
};
|
|
7194
|
+
|
|
7195
|
+
/**
|
|
7196
|
+
* Renders the portalled popover panel with dismiss behavior and optional focus
|
|
7197
|
+
* trapping.
|
|
7198
|
+
*
|
|
7199
|
+
* For `interaction="rich"`, focus is trapped inside the panel and restored to
|
|
7200
|
+
* the trigger on close. For `interaction="definition"`, there is no focus trap
|
|
7201
|
+
* and keyboard users cannot reach the content, so keep it non-interactive.
|
|
7202
|
+
* Escape and outside press dismiss the panel. Tone is visual only and never
|
|
7203
|
+
* sets `role="alert"`.
|
|
7204
|
+
*
|
|
7205
|
+
* @example
|
|
7206
|
+
* ```tsx
|
|
7207
|
+
* <PopoverContent>
|
|
7208
|
+
* <PopoverHeader><PopoverTitle>Tip</PopoverTitle></PopoverHeader>
|
|
7209
|
+
* <PopoverBody>Save often while editing.</PopoverBody>
|
|
7210
|
+
* </PopoverContent>
|
|
7211
|
+
* ```
|
|
7212
|
+
*/
|
|
7213
|
+
export declare const PopoverContent: (props: PopoverContentProps) => JSX.Element | null;
|
|
7214
|
+
|
|
7215
|
+
/** Props for {@link PopoverContent}, the portalled floating panel. */
|
|
7216
|
+
export declare type PopoverContentProps = Omit<BoxProps, 'children'> & {
|
|
7217
|
+
/** Popover panel content composed from Header, Body, Footer, and related parts. */
|
|
7218
|
+
children: ReactNode;
|
|
7219
|
+
};
|
|
7220
|
+
|
|
7221
|
+
/** Shared state for {@link Popover} compound parts. */
|
|
7222
|
+
declare type PopoverContextValue = {
|
|
7223
|
+
/** Whether the floating content is open. */
|
|
7224
|
+
open: boolean;
|
|
7225
|
+
/** Updates open state for controlled or uncontrolled usage. */
|
|
7226
|
+
setOpen: (open: boolean) => void;
|
|
7227
|
+
/**
|
|
7228
|
+
* Interaction mode.
|
|
7229
|
+
* - `definition`: hover + focus, no focus trap
|
|
7230
|
+
* - `rich`: click, focus trap + restore focus
|
|
7231
|
+
*/
|
|
7232
|
+
interaction: PopoverInteraction;
|
|
7233
|
+
/** Preferred placement relative to the reference. */
|
|
7234
|
+
placement: Placement;
|
|
7235
|
+
/** Gap between reference and content, in pixels. */
|
|
7236
|
+
offset: number;
|
|
7237
|
+
/** Whether the arrow is rendered inside content. */
|
|
7238
|
+
showArrow: boolean;
|
|
7239
|
+
/** Recipe size for the content panel. */
|
|
7240
|
+
size: PopoverSize;
|
|
7241
|
+
/** Optional visual tone for the content panel. */
|
|
7242
|
+
tone?: PopoverTone;
|
|
7243
|
+
/** Floating UI context for interactions and focus management. */
|
|
7244
|
+
floatingContext: FloatingContext;
|
|
7245
|
+
/** Floating UI refs used by Trigger, Anchor, and Content. */
|
|
7246
|
+
refs: {
|
|
7247
|
+
setReference: (node: ReferenceType | null) => void;
|
|
7248
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
7249
|
+
setPositionReference: (node: ReferenceType | null) => void;
|
|
7250
|
+
};
|
|
7251
|
+
/** Position styles for the floating content. */
|
|
7252
|
+
floatingStyles: CSSProperties;
|
|
7253
|
+
/** DOM reference element used for portal ancestry. */
|
|
7254
|
+
domReference: Element | null;
|
|
7255
|
+
/** Interaction props for the trigger. */
|
|
7256
|
+
getReferenceProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
|
|
7257
|
+
/** Interaction props for the floating content. */
|
|
7258
|
+
getFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
|
|
7259
|
+
/** Ref for the Floating UI arrow element. */
|
|
7260
|
+
arrowRef: MutableRefObject<SVGSVGElement | null>;
|
|
7261
|
+
/** Optional id for the title (`aria-labelledby`). */
|
|
7262
|
+
titleId: string | undefined;
|
|
7263
|
+
setTitleId: Dispatch<SetStateAction<string | undefined>>;
|
|
7264
|
+
/** Optional id for the description (`aria-describedby`). */
|
|
7265
|
+
descriptionId: string | undefined;
|
|
7266
|
+
setDescriptionId: Dispatch<SetStateAction<string | undefined>>;
|
|
7267
|
+
/** Whether an explicit Anchor is mounted for positioning. */
|
|
7268
|
+
hasAnchor: boolean;
|
|
7269
|
+
setHasAnchor: Dispatch<SetStateAction<boolean>>;
|
|
7270
|
+
/** Ref callback helpers for merging consumer refs. */
|
|
7271
|
+
setReferenceRef: RefCallback<Element>;
|
|
7272
|
+
setFloatingRef: RefCallback<HTMLElement>;
|
|
7273
|
+
};
|
|
7274
|
+
|
|
7275
|
+
/**
|
|
7276
|
+
* Renders supporting description text and wires it to `aria-describedby`.
|
|
7277
|
+
*
|
|
7278
|
+
* @example
|
|
7279
|
+
* ```tsx
|
|
7280
|
+
* <PopoverDescription>Applies to open work orders only.</PopoverDescription>
|
|
7281
|
+
* ```
|
|
7282
|
+
*/
|
|
7283
|
+
export declare const PopoverDescription: (props: PopoverDescriptionProps) => JSX.Element;
|
|
7284
|
+
|
|
7285
|
+
/** Props for {@link PopoverDescription}, supporting text under the title. */
|
|
7286
|
+
export declare type PopoverDescriptionProps = Omit<BoxProps, 'children'> & {
|
|
7287
|
+
/** Description content. Strings render as text; nodes render as-is. */
|
|
7288
|
+
children: string | ReactNode;
|
|
7289
|
+
};
|
|
7290
|
+
|
|
7291
|
+
/**
|
|
7292
|
+
* Renders the optional footer/actions region of a {@link PopoverContent}.
|
|
7293
|
+
*
|
|
7294
|
+
* @example
|
|
7295
|
+
* ```tsx
|
|
7296
|
+
* <PopoverFooter>
|
|
7297
|
+
* <Button size="sm">Got it</Button>
|
|
7298
|
+
* </PopoverFooter>
|
|
7299
|
+
* ```
|
|
7300
|
+
*/
|
|
7301
|
+
export declare const PopoverFooter: (props: PopoverFooterProps) => JSX.Element;
|
|
7302
|
+
|
|
7303
|
+
/** Props for {@link PopoverFooter}, the optional action region. */
|
|
7304
|
+
export declare type PopoverFooterProps = Omit<BoxProps, 'children'> & {
|
|
7305
|
+
/** Footer content, typically actions such as `Button` or `Link`. */
|
|
7306
|
+
children: ReactNode;
|
|
7307
|
+
};
|
|
7308
|
+
|
|
7309
|
+
/**
|
|
7310
|
+
* Renders the optional header region of a parent {@link PopoverContent}.
|
|
7311
|
+
*
|
|
7312
|
+
* @example
|
|
7313
|
+
* ```tsx
|
|
7314
|
+
* <PopoverHeader>
|
|
7315
|
+
* <PopoverTitle>Warning</PopoverTitle>
|
|
7316
|
+
* <PopoverClose />
|
|
7317
|
+
* </PopoverHeader>
|
|
7318
|
+
* ```
|
|
7319
|
+
*/
|
|
7320
|
+
export declare const PopoverHeader: (props: PopoverHeaderProps) => JSX.Element;
|
|
7321
|
+
|
|
7322
|
+
/** Props for {@link PopoverHeader}, the optional heading region. */
|
|
7323
|
+
export declare type PopoverHeaderProps = Omit<BoxProps, 'children'> & {
|
|
7324
|
+
/** Header content, typically `PopoverTitle` and optional `PopoverClose`. */
|
|
7325
|
+
children?: ReactNode;
|
|
7326
|
+
};
|
|
7327
|
+
|
|
7328
|
+
/** How the popover opens and manages focus. */
|
|
7329
|
+
export declare type PopoverInteraction = 'definition' | 'rich';
|
|
7330
|
+
|
|
7331
|
+
/**
|
|
7332
|
+
* Renders an optional media region inside {@link PopoverContent}.
|
|
7333
|
+
*
|
|
7334
|
+
* Place images or other illustrative content here. Keep interactive controls
|
|
7335
|
+
* in Body or Footer so media stays presentational.
|
|
7336
|
+
*
|
|
7337
|
+
* @example
|
|
7338
|
+
* ```tsx
|
|
7339
|
+
* <PopoverMedia>
|
|
7340
|
+
* <img src="/diagram.png" alt="Cycle time diagram" />
|
|
7341
|
+
* </PopoverMedia>
|
|
7342
|
+
* ```
|
|
7343
|
+
*/
|
|
7344
|
+
export declare const PopoverMedia: (props: PopoverMediaProps) => JSX.Element;
|
|
7345
|
+
|
|
7346
|
+
/** Props for {@link PopoverMedia}, an optional media region. */
|
|
7347
|
+
export declare type PopoverMediaProps = Omit<BoxProps, 'children'> & {
|
|
7348
|
+
/** Media content such as an image or illustration. */
|
|
7349
|
+
children: ReactNode;
|
|
7350
|
+
};
|
|
7351
|
+
|
|
7352
|
+
/** Props for {@link Popover}, the compound root for multipurpose floating notes. */
|
|
7353
|
+
export declare type PopoverProps = {
|
|
7354
|
+
/** Compound parts such as Trigger and Content. */
|
|
7355
|
+
children: ReactNode;
|
|
7356
|
+
/**
|
|
7357
|
+
* How the popover opens and manages focus.
|
|
7358
|
+
* - `definition`: hover + focus, no focus trap (handbook definitions).
|
|
7359
|
+
* Keyboard users cannot move focus into the content, so it must be
|
|
7360
|
+
* non-interactive: no links, buttons, or `PopoverClose`.
|
|
7361
|
+
* - `rich`: click open, focus trap + restore focus (interactive content)
|
|
7362
|
+
* @default 'rich'
|
|
7363
|
+
*/
|
|
7364
|
+
interaction?: PopoverInteraction;
|
|
7365
|
+
/** Controlled open state. */
|
|
7366
|
+
open?: boolean;
|
|
7367
|
+
/**
|
|
7368
|
+
* Initial open state when uncontrolled.
|
|
7369
|
+
* @default false
|
|
7370
|
+
*/
|
|
7371
|
+
defaultOpen?: boolean;
|
|
7372
|
+
/** Called when open state should change. */
|
|
7373
|
+
onOpenChange?: (open: boolean) => void;
|
|
7374
|
+
/**
|
|
7375
|
+
* Preferred placement relative to the reference. The overlay can flip when it does not fit.
|
|
7376
|
+
* @default 'bottom'
|
|
7377
|
+
*/
|
|
7378
|
+
placement?: Placement;
|
|
7379
|
+
/**
|
|
7380
|
+
* Gap between reference and content, in pixels.
|
|
7381
|
+
* @default 8
|
|
7382
|
+
*/
|
|
7383
|
+
offset?: number;
|
|
7384
|
+
/**
|
|
7385
|
+
* Shows the arrow pointing at the reference.
|
|
7386
|
+
* @default true
|
|
7387
|
+
*/
|
|
7388
|
+
showArrow?: boolean;
|
|
7389
|
+
/**
|
|
7390
|
+
* Content panel size. Wider than Tooltip (`240`).
|
|
7391
|
+
* @default 'md'
|
|
7392
|
+
*/
|
|
7393
|
+
size?: PopoverSize;
|
|
7394
|
+
/**
|
|
7395
|
+
* Visual tone for handbook-style notes. Affects surface and border only —
|
|
7396
|
+
* never maps to `role="alert"`.
|
|
7397
|
+
*/
|
|
7398
|
+
tone?: PopoverTone;
|
|
7399
|
+
};
|
|
7400
|
+
|
|
7401
|
+
/** Content size. Wider than Tooltip (`240`). */
|
|
7402
|
+
export declare type PopoverSize = 'sm' | 'md' | 'lg';
|
|
7403
|
+
|
|
7404
|
+
/**
|
|
7405
|
+
* Renders the popover title and wires it to `aria-labelledby` on the panel.
|
|
7406
|
+
*
|
|
7407
|
+
* When the parent sets a `tone`, an optional leading icon matches that tone.
|
|
7408
|
+
* Tone remains visual only and does not change live-region roles.
|
|
7409
|
+
*
|
|
7410
|
+
* @example
|
|
7411
|
+
* ```tsx
|
|
7412
|
+
* <PopoverTitle>Warning</PopoverTitle>
|
|
7413
|
+
* ```
|
|
7414
|
+
*/
|
|
7415
|
+
export declare const PopoverTitle: (props: PopoverTitleProps) => JSX.Element;
|
|
7416
|
+
|
|
7417
|
+
/** Props for {@link PopoverTitle}, the popover heading. */
|
|
7418
|
+
export declare type PopoverTitleProps = Omit<BoxProps, 'children' | 'title'> & {
|
|
7419
|
+
/** Title content. Strings render as text; nodes render as-is. */
|
|
7420
|
+
children: string | ReactNode;
|
|
7421
|
+
/**
|
|
7422
|
+
* Shows the tone icon when the parent Popover has a `tone`.
|
|
7423
|
+
* @default true
|
|
7424
|
+
*/
|
|
7425
|
+
showToneIcon?: boolean;
|
|
7426
|
+
};
|
|
7427
|
+
|
|
7428
|
+
/** Handbook-style visual tones. Visual only — never maps to `role="alert"`. */
|
|
7429
|
+
export declare type PopoverTone = 'note' | 'tip' | 'warning' | 'important' | 'caution';
|
|
7430
|
+
|
|
7431
|
+
/**
|
|
7432
|
+
* Marks the control that opens a parent {@link Popover}.
|
|
7433
|
+
*
|
|
7434
|
+
* Pass plain text for an inline dashed-underline phrase: it renders a
|
|
7435
|
+
* `button` in `rich` mode and a focusable `span` in `definition` mode. Pass a
|
|
7436
|
+
* single element (such as `Button`) to use it as the trigger as-is; it must be
|
|
7437
|
+
* focusable, and for `rich` it should be a button so screen readers announce
|
|
7438
|
+
* it as one.
|
|
7439
|
+
*
|
|
7440
|
+
* @example
|
|
7441
|
+
* ```tsx
|
|
7442
|
+
* <PopoverTrigger>cycle time</PopoverTrigger>
|
|
7443
|
+
* ```
|
|
7444
|
+
*/
|
|
7445
|
+
export declare const PopoverTrigger: (props: PopoverTriggerProps) => JSX.Element;
|
|
7446
|
+
|
|
7447
|
+
/** Props for {@link PopoverTrigger}, the control that opens the popover. */
|
|
7448
|
+
export declare type PopoverTriggerProps = Omit<BoxProps, 'children'> & {
|
|
7449
|
+
/**
|
|
7450
|
+
* Trigger content. A single React element receives refs and interaction
|
|
7451
|
+
* props via `cloneElement` and keeps its own styles. Otherwise content is
|
|
7452
|
+
* wrapped in an inline `button` (`rich`) or focusable `span` (`definition`).
|
|
7453
|
+
*/
|
|
7454
|
+
children: ReactNode;
|
|
7455
|
+
};
|
|
7456
|
+
|
|
5445
7457
|
declare type PositionAreaAxis =
|
|
5446
7458
|
| 'left'
|
|
5447
7459
|
| 'center'
|
|
@@ -5507,35 +7519,117 @@ declare type PositionTry =
|
|
|
5507
7519
|
| DashedIdent
|
|
5508
7520
|
|
|
5509
7521
|
/**
|
|
5510
|
-
*
|
|
7522
|
+
* One printed page at its true proportions.
|
|
5511
7523
|
*
|
|
5512
|
-
*
|
|
5513
|
-
*
|
|
7524
|
+
* Place inside a `PrintPreview`, which sets the scale. Outside a preview the
|
|
7525
|
+
* page renders at scale 1.
|
|
7526
|
+
*
|
|
7527
|
+
* The sheet is white with dark text in both themes, because paper is white.
|
|
7528
|
+
* Design-system components placed directly on the sheet still follow the app
|
|
7529
|
+
* theme. Content in an iframe is not affected.
|
|
7530
|
+
*
|
|
7531
|
+
* Content inside can call `usePrintPage` for the scale and the page geometry.
|
|
5514
7532
|
*
|
|
5515
7533
|
* @example
|
|
5516
7534
|
* ```tsx
|
|
5517
|
-
* <
|
|
7535
|
+
* <PrintPage size={pageSizes.label4x6} orientation="landscape">
|
|
7536
|
+
* <ShippingLabel />
|
|
7537
|
+
* </PrintPage>
|
|
5518
7538
|
* ```
|
|
5519
7539
|
*/
|
|
5520
|
-
export declare const
|
|
5521
|
-
|
|
5522
|
-
/** Props accepted by {@link Pre}. */
|
|
5523
|
-
export declare type PreProps = BoxProps & {
|
|
5524
|
-
/** Preformatted code content. */
|
|
5525
|
-
children: string | ReactNode;
|
|
5526
|
-
/** Language metadata forwarded to the nested `Code` element. */
|
|
5527
|
-
lang?: string;
|
|
5528
|
-
/** Element override for the rendered `pre` container. */
|
|
5529
|
-
as?: string;
|
|
5530
|
-
};
|
|
7540
|
+
export declare const PrintPage: (props: PrintPageProps) => JSX.Element;
|
|
5531
7541
|
|
|
5532
|
-
|
|
5533
|
-
extends
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
7542
|
+
/** Geometry of one page, shared with its content. */
|
|
7543
|
+
declare interface PrintPageContextValue extends PageBox {
|
|
7544
|
+
/** Current scale from the parent preview. `1` outside a preview. */
|
|
7545
|
+
scale: number;
|
|
7546
|
+
}
|
|
5537
7547
|
|
|
5538
|
-
declare
|
|
7548
|
+
declare type PrintPageOwnProps = {
|
|
7549
|
+
/** Physical page size. Use a `pageSizes` preset or any `PageSize` object. */
|
|
7550
|
+
size: PageSize;
|
|
7551
|
+
/**
|
|
7552
|
+
* Forces the page to be taller (`portrait`) or wider (`landscape`) than it
|
|
7553
|
+
* is wide. Leave unset to use `size` as given.
|
|
7554
|
+
*/
|
|
7555
|
+
orientation?: PageOrientation;
|
|
7556
|
+
/**
|
|
7557
|
+
* Page margins in the unit of `size`. Margins do not pad the content. They
|
|
7558
|
+
* set the guide drawn by `showMargins` and the values from `usePrintPage`.
|
|
7559
|
+
*/
|
|
7560
|
+
/** @default 0 */
|
|
7561
|
+
margins?: PageMargins;
|
|
7562
|
+
/** Stripes the margin area and draws a dashed line at the content edge. */
|
|
7563
|
+
/** @default false */
|
|
7564
|
+
showMargins?: boolean;
|
|
7565
|
+
/**
|
|
7566
|
+
* Layer drawn above the content in page space, such as error markers or a
|
|
7567
|
+
* selection outline. The layer ignores the pointer. Set `pointerEvents` on
|
|
7568
|
+
* its children to make them interactive.
|
|
7569
|
+
*/
|
|
7570
|
+
overlay?: ReactNode;
|
|
7571
|
+
/**
|
|
7572
|
+
* Page content. It fills the whole sheet at 96 CSS pixels per inch, so an
|
|
7573
|
+
* iframe with full width and height lays out as it prints.
|
|
7574
|
+
*/
|
|
7575
|
+
children?: ReactNode;
|
|
7576
|
+
};
|
|
7577
|
+
|
|
7578
|
+
/** Props accepted by {@link PrintPage}. Includes `Box` and native `div` props. */
|
|
7579
|
+
export declare type PrintPageProps = Omit<BoxProps, keyof PrintPageOwnProps> & PrintPageOwnProps;
|
|
7580
|
+
|
|
7581
|
+
/**
|
|
7582
|
+
* Shows printed pages at their true proportions, scaled to fit the area.
|
|
7583
|
+
*
|
|
7584
|
+
* Wrap one or more `PrintPage` elements. The preview measures itself and
|
|
7585
|
+
* applies one scale to every page, chosen by `fit`. Pages stack vertically
|
|
7586
|
+
* and the preview scrolls when they do not fit.
|
|
7587
|
+
*
|
|
7588
|
+
* The preview does not know what is on the page. Page size comes from each
|
|
7589
|
+
* `PrintPage`'s `size` prop, so it works for server-rendered HTML in an iframe,
|
|
7590
|
+
* an editable canvas, or a rendered PDF page.
|
|
7591
|
+
*
|
|
7592
|
+
* Renders a focusable `div` so keyboard users can scroll it. Give it an
|
|
7593
|
+
* `aria-label` that names what is previewed.
|
|
7594
|
+
*
|
|
7595
|
+
* @example
|
|
7596
|
+
* ```tsx
|
|
7597
|
+
* <PrintPreview aria-label="Document preview">
|
|
7598
|
+
* <PrintPage size={pageSizes.letter} margins={0.5} showMargins>
|
|
7599
|
+
* <iframe title="Document" srcDoc={html} />
|
|
7600
|
+
* </PrintPage>
|
|
7601
|
+
* </PrintPreview>
|
|
7602
|
+
* ```
|
|
7603
|
+
*/
|
|
7604
|
+
export declare const PrintPreview: (props: PrintPreviewProps) => JSX.Element;
|
|
7605
|
+
|
|
7606
|
+
/** Fit mode for {@link PrintPreview}. */
|
|
7607
|
+
export declare type PrintPreviewFit = 'page' | 'width' | number;
|
|
7608
|
+
|
|
7609
|
+
declare type PrintPreviewOwnProps = {
|
|
7610
|
+
/**
|
|
7611
|
+
* How pages scale to the preview area. `page` fits the whole largest page.
|
|
7612
|
+
* `width` fits its width and scrolls vertically. A number is a fixed zoom,
|
|
7613
|
+
* where `1` lays the page out at 96 CSS pixels per inch.
|
|
7614
|
+
*/
|
|
7615
|
+
/** @default "page" */
|
|
7616
|
+
fit?: PrintPreviewFit;
|
|
7617
|
+
/** One or more `PrintPage` elements. */
|
|
7618
|
+
children?: ReactNode;
|
|
7619
|
+
/** Ref to the scrolling root element. */
|
|
7620
|
+
ref?: Ref<HTMLDivElement>;
|
|
7621
|
+
};
|
|
7622
|
+
|
|
7623
|
+
/** Props accepted by {@link PrintPreview}. Includes `Box` and native `div` props. */
|
|
7624
|
+
export declare type PrintPreviewProps = Omit<BoxProps, keyof PrintPreviewOwnProps> & PrintPreviewOwnProps;
|
|
7625
|
+
|
|
7626
|
+
declare interface PropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}>
|
|
7627
|
+
extends StandardPropertiesFallback<TLength, TTime>,
|
|
7628
|
+
VendorPropertiesFallback<TLength, TTime>,
|
|
7629
|
+
ObsoletePropertiesFallback<TLength, TTime>,
|
|
7630
|
+
SvgPropertiesFallback<TLength, TTime> {}
|
|
7631
|
+
|
|
7632
|
+
declare namespace Property {
|
|
5539
7633
|
type AccentColor = Globals | DataType.Color | "auto";
|
|
5540
7634
|
|
|
5541
7635
|
type AlignContent = Globals | DataType.ContentDistribution | DataType.ContentPosition | "baseline" | "normal" | (string & {});
|
|
@@ -7414,7 +9508,7 @@ declare type RadioVariantProps = {
|
|
|
7414
9508
|
[key in keyof RadioVariant]?: ConditionalValue<RadioVariant[key]> | undefined
|
|
7415
9509
|
}
|
|
7416
9510
|
|
|
7417
|
-
declare type RadiusToken = "0" | "1" | "2" | "3" | "4" | "8" | "16" | "100" | "999"
|
|
9511
|
+
declare type RadiusToken = "0" | "1" | "2" | "3" | "4" | "6" | "8" | "12" | "16" | "100" | "999"
|
|
7418
9512
|
|
|
7419
9513
|
export declare type RecipeConfig<V extends RecipeVariantRecord = RecipeVariantRecord> = BaseRecipeConfig<V>;
|
|
7420
9514
|
|
|
@@ -7641,6 +9735,10 @@ declare type SegmentValue = number | string | null;
|
|
|
7641
9735
|
* it; typeahead and arrow keys navigate options; Escape or outside press closes
|
|
7642
9736
|
* it. Focus stays on the trigger when the non-modal popup opens.
|
|
7643
9737
|
*
|
|
9738
|
+
* Use `before` on the `Select` or on each `SelectOption` to show an avatar or
|
|
9739
|
+
* a status icon beside the value. Set `clearable={false}` when the field must
|
|
9740
|
+
* always hold a value.
|
|
9741
|
+
*
|
|
7644
9742
|
* @example
|
|
7645
9743
|
* ```tsx
|
|
7646
9744
|
* <Select defaultValue="draft" name="status">
|
|
@@ -7665,34 +9763,46 @@ declare interface SelectContextValue {
|
|
|
7665
9763
|
}
|
|
7666
9764
|
|
|
7667
9765
|
/**
|
|
7668
|
-
*
|
|
7669
|
-
*
|
|
7670
|
-
*
|
|
9766
|
+
* Declares an option for a parent {@link Select}.
|
|
9767
|
+
*
|
|
9768
|
+
* This component returns `null`; place it directly inside `Select` so the
|
|
9769
|
+
* parent can interpret its metadata.
|
|
9770
|
+
*
|
|
9771
|
+
* @example
|
|
9772
|
+
* ```tsx
|
|
9773
|
+
* <SelectOption value="medium" label="Medium" />
|
|
9774
|
+
* ```
|
|
7671
9775
|
*/
|
|
7672
|
-
export declare const SelectOption: (
|
|
9776
|
+
export declare const SelectOption: (_props: SelectOptionProps) => null;
|
|
7673
9777
|
|
|
7674
9778
|
/** Metadata consumed by {@link Select}; `SelectOption` does not render an element itself. */
|
|
7675
9779
|
export declare type SelectOptionProps = Omit<BoxProps, 'children'> & {
|
|
7676
|
-
/**
|
|
9780
|
+
/** Stable value emitted by the parent `Select`. */
|
|
7677
9781
|
value: string;
|
|
7678
|
-
/**
|
|
7679
|
-
label: string
|
|
7680
|
-
/**
|
|
9782
|
+
/** Visible option text and the value used for keyboard typeahead. */
|
|
9783
|
+
label: string;
|
|
9784
|
+
/** Excludes the option from pointer and keyboard selection. */
|
|
7681
9785
|
disabled?: boolean;
|
|
7682
|
-
/**
|
|
9786
|
+
/** Supporting text displayed below the label in the popup. */
|
|
7683
9787
|
description?: string;
|
|
7684
|
-
/** Icon
|
|
9788
|
+
/** Icon displayed before the option label. */
|
|
7685
9789
|
iconLeft?: IconNamesList;
|
|
7686
|
-
/** Icon
|
|
9790
|
+
/** Icon displayed after the option label. */
|
|
7687
9791
|
iconRight?: IconNamesList;
|
|
7688
|
-
/**
|
|
7689
|
-
|
|
9792
|
+
/**
|
|
9793
|
+
* Decorative content, such as an `Avatar` or a colored `Icon`, displayed
|
|
9794
|
+
* before the option label. It takes precedence over `iconLeft`. In a single
|
|
9795
|
+
* select, the selection check moves to the end of the row in place of
|
|
9796
|
+
* `iconRight`, and the selected option's `before` is also shown in the
|
|
9797
|
+
* trigger unless the `Select` has its own `before`.
|
|
9798
|
+
*/
|
|
9799
|
+
before?: ReactNode;
|
|
7690
9800
|
};
|
|
7691
9801
|
|
|
7692
9802
|
declare type Selectors = AttributeSelector | ParentSelector
|
|
7693
9803
|
|
|
7694
9804
|
/** Props for {@link Select}, an ARIA listbox-based single or multiple select. */
|
|
7695
|
-
export declare type SelectProps = Omit<BoxProps
|
|
9805
|
+
export declare type SelectProps = Omit<BoxProps, keyof SelectVariantProps | 'children' | 'onChange' | 'type' | 'value'> & SelectVariantProps & {
|
|
7696
9806
|
/** Controlled selected value. Use a string for single selection or a string array for multiple selection, with `onChange` to accept changes. */
|
|
7697
9807
|
value?: SelectValue;
|
|
7698
9808
|
/**
|
|
@@ -7731,7 +9841,8 @@ export declare type SelectProps = Omit<BoxProps<'button'>, keyof SelectVariantPr
|
|
|
7731
9841
|
* @default 4
|
|
7732
9842
|
*/
|
|
7733
9843
|
offset?: number;
|
|
7734
|
-
children
|
|
9844
|
+
/** Metadata-only `SelectOption` children used to build the listbox. Other children are ignored. */
|
|
9845
|
+
children?: ReactNode;
|
|
7735
9846
|
/** Identifier for the combobox trigger. A generated identifier is used when omitted. */
|
|
7736
9847
|
id?: string;
|
|
7737
9848
|
/** Form field name. Each selected value is submitted through a hidden input. */
|
|
@@ -7756,6 +9867,20 @@ export declare type SelectProps = Omit<BoxProps<'button'>, keyof SelectVariantPr
|
|
|
7756
9867
|
* @default false
|
|
7757
9868
|
*/
|
|
7758
9869
|
autoSize?: boolean;
|
|
9870
|
+
/**
|
|
9871
|
+
* Decorative content, such as an `Avatar` or a colored `Icon`, shown in
|
|
9872
|
+
* the trigger before the selected value. When omitted, a single select
|
|
9873
|
+
* shows the selected option's `before` instead.
|
|
9874
|
+
*/
|
|
9875
|
+
before?: ReactNode;
|
|
9876
|
+
/**
|
|
9877
|
+
* Lets the user clear a single selection by choosing the selected option
|
|
9878
|
+
* again or by pressing Backspace or Delete. Set it to `false` for a field
|
|
9879
|
+
* that must always hold a value, such as a status. It has no effect when
|
|
9880
|
+
* `multiple` is set.
|
|
9881
|
+
* @default true
|
|
9882
|
+
*/
|
|
9883
|
+
clearable?: boolean;
|
|
7759
9884
|
};
|
|
7760
9885
|
|
|
7761
9886
|
/**
|
|
@@ -7789,7 +9914,10 @@ declare interface SelectVariant {
|
|
|
7789
9914
|
/**
|
|
7790
9915
|
* @default "md"
|
|
7791
9916
|
*/
|
|
7792
|
-
size: "
|
|
9917
|
+
size: "sm" | "md" | "lg" | "xl"
|
|
9918
|
+
before: boolean
|
|
9919
|
+
multiple: boolean
|
|
9920
|
+
autoSize: boolean
|
|
7793
9921
|
}
|
|
7794
9922
|
|
|
7795
9923
|
declare type SelectVariantProps = {
|
|
@@ -14142,17 +16270,31 @@ declare type StringToMultiple<T extends string> = T | `${T}, ${T}`
|
|
|
14142
16270
|
*/
|
|
14143
16271
|
export declare const SubMenu: (props: SubMenuProps) => JSX.Element | null;
|
|
14144
16272
|
|
|
16273
|
+
/** Opens a submenu as a positioned flyout or as an in-panel drill-in level. */
|
|
14145
16274
|
declare type SubMenuInteraction = 'hover' | 'digin';
|
|
14146
16275
|
|
|
16276
|
+
/** Props for {@link SubMenu}, a nested menu trigger and its child menu. */
|
|
14147
16277
|
export declare type SubMenuProps = Omit<BoxProps, 'as'> & Omit<MenuVariantProps, 'iconBefore' | 'iconAfter'> & {
|
|
16278
|
+
/** Visible submenu trigger text. */
|
|
14148
16279
|
label: string;
|
|
16280
|
+
/** Secondary visible text included in filtering by default. */
|
|
14149
16281
|
description?: string;
|
|
16282
|
+
/** Prevents opening the nested menu. */
|
|
14150
16283
|
disabled?: boolean;
|
|
16284
|
+
/** Applies selected styling to the nested-menu trigger. */
|
|
14151
16285
|
selected?: boolean;
|
|
16286
|
+
/** Icon displayed before the trigger text. */
|
|
14152
16287
|
iconBefore?: IconNamesList;
|
|
16288
|
+
/** Overrides the parent menu's submenu interaction mode. */
|
|
14153
16289
|
interaction?: SubMenuInteraction;
|
|
16290
|
+
/**
|
|
16291
|
+
* Floating placement for a hover submenu.
|
|
16292
|
+
* @default 'right-start'
|
|
16293
|
+
*/
|
|
14154
16294
|
placement?: Placement;
|
|
16295
|
+
/** `MenuItem`, `MenuGroup`, or nested `SubMenu` children. */
|
|
14155
16296
|
children: ReactNode;
|
|
16297
|
+
/** Explicit text used for typeahead and filtering instead of label and description. */
|
|
14156
16298
|
textValue?: string;
|
|
14157
16299
|
};
|
|
14158
16300
|
|
|
@@ -21715,6 +23857,218 @@ export declare type SystemStyleObject = Record<string, unknown>;
|
|
|
21715
23857
|
|
|
21716
23858
|
declare type SystemStyleObject_2 = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>
|
|
21717
23859
|
|
|
23860
|
+
/**
|
|
23861
|
+
* Selects one panel inside a {@link Tabs} strip.
|
|
23862
|
+
*
|
|
23863
|
+
* Renders a `button` with `role="tab"`. Only the selected tab is in the tab
|
|
23864
|
+
* order; Arrow, Home, and End move between the others. A tab that does not fit
|
|
23865
|
+
* the strip stays mounted but hidden so it can still be measured, and it is
|
|
23866
|
+
* offered in the overflow menu instead. The menu row is plain text, so give
|
|
23867
|
+
* `label` when `children` are not plain text.
|
|
23868
|
+
*
|
|
23869
|
+
* `badgeTooltip` opens on hover and on keyboard focus of the tab itself, points
|
|
23870
|
+
* at the badge, and is linked to the tab with `aria-describedby` while open.
|
|
23871
|
+
*
|
|
23872
|
+
* @example
|
|
23873
|
+
* ```tsx
|
|
23874
|
+
* <Tab value="materials" badge={3} badgeTooltip="2 Open Requests">
|
|
23875
|
+
* Materials
|
|
23876
|
+
* </Tab>
|
|
23877
|
+
* ```
|
|
23878
|
+
*/
|
|
23879
|
+
export declare const Tab: (props: TabProps) => JSX.Element;
|
|
23880
|
+
|
|
23881
|
+
declare type TabOwnProps = {
|
|
23882
|
+
/** Identifies the tab and the `TabPanel` it controls. Must be unique within a `Tabs`. */
|
|
23883
|
+
value: string;
|
|
23884
|
+
/** Visible label rendered in the strip. Plain text is also reused as the overflow-menu row's text unless `label` overrides it. */
|
|
23885
|
+
children?: ReactNode;
|
|
23886
|
+
/**
|
|
23887
|
+
* Plain-text name for this tab's overflow-menu row, which cannot render
|
|
23888
|
+
* markup. Set it when `children` contain more than text — an icon, a nested
|
|
23889
|
+
* element — because flattening those to a string reads badly. It never
|
|
23890
|
+
* changes what the strip renders: `children` still render there as-is.
|
|
23891
|
+
* Without it the menu row falls back to the flattened `children`, then to
|
|
23892
|
+
* `value`.
|
|
23893
|
+
*/
|
|
23894
|
+
label?: string;
|
|
23895
|
+
/** Count shown in a trailing {@link Badge}. A zero or omitted count renders no badge. */
|
|
23896
|
+
badge?: number;
|
|
23897
|
+
/** Tooltip text describing what the badge counts. Requires `badge`. */
|
|
23898
|
+
badgeTooltip?: string;
|
|
23899
|
+
/** Prevents selection and skips the tab during arrow-key navigation. */
|
|
23900
|
+
disabled?: boolean;
|
|
23901
|
+
};
|
|
23902
|
+
|
|
23903
|
+
/**
|
|
23904
|
+
* Renders the content for one {@link Tab}.
|
|
23905
|
+
*
|
|
23906
|
+
* The panel stays mounted when another tab is selected and is hidden with
|
|
23907
|
+
* `display: none`, which preserves scroll position and local state; set
|
|
23908
|
+
* `unmountInactive` on `Tabs` to render only the selected panel instead. A
|
|
23909
|
+
* function child receives `{ isActive }`, and descendants can call
|
|
23910
|
+
* `useTabPanelActive()` for the same signal, so hidden panels can pause polling
|
|
23911
|
+
* or animation.
|
|
23912
|
+
*
|
|
23913
|
+
* @example
|
|
23914
|
+
* ```tsx
|
|
23915
|
+
* <TabPanel value="materials">
|
|
23916
|
+
* {({ isActive }) => <MaterialsGrid paused={!isActive} />}
|
|
23917
|
+
* </TabPanel>
|
|
23918
|
+
* ```
|
|
23919
|
+
*/
|
|
23920
|
+
export declare const TabPanel: (props: TabPanelProps) => JSX.Element | null;
|
|
23921
|
+
|
|
23922
|
+
declare type TabPanelOwnProps = {
|
|
23923
|
+
/** `value` of the {@link Tab} this panel belongs to. */
|
|
23924
|
+
value: string;
|
|
23925
|
+
/**
|
|
23926
|
+
* Panel content. A function child receives `{ isActive }` so expensive work
|
|
23927
|
+
* can pause while the panel is mounted but hidden.
|
|
23928
|
+
*/
|
|
23929
|
+
children?: ReactNode | ((props: TabPanelRenderProps) => ReactNode);
|
|
23930
|
+
};
|
|
23931
|
+
|
|
23932
|
+
/**
|
|
23933
|
+
* Props for {@link TabPanel}, the content region for one {@link Tab}.
|
|
23934
|
+
*
|
|
23935
|
+
* `id` is omitted: `Tabs` generates it so `aria-controls` and
|
|
23936
|
+
* `aria-labelledby` always point at the matching tab.
|
|
23937
|
+
*/
|
|
23938
|
+
export declare type TabPanelProps = Omit<BoxProps, keyof TabPanelOwnProps | 'id'> & TabPanelOwnProps;
|
|
23939
|
+
|
|
23940
|
+
/** Argument passed to a {@link TabPanel} render-prop child. */
|
|
23941
|
+
export declare type TabPanelRenderProps = {
|
|
23942
|
+
/** Whether this panel's tab is currently selected. */
|
|
23943
|
+
isActive: boolean;
|
|
23944
|
+
};
|
|
23945
|
+
|
|
23946
|
+
/**
|
|
23947
|
+
* Props for {@link Tab}, one selectable item in a {@link Tabs} strip.
|
|
23948
|
+
*
|
|
23949
|
+
* `id` is omitted: `Tabs` generates it so `aria-controls` and
|
|
23950
|
+
* `aria-labelledby` always point at the matching panel.
|
|
23951
|
+
*/
|
|
23952
|
+
export declare type TabProps = Omit<BoxProps, keyof TabOwnProps | 'id'> & TabOwnProps;
|
|
23953
|
+
|
|
23954
|
+
/**
|
|
23955
|
+
* Groups related content into a single view with one panel visible at a time.
|
|
23956
|
+
*
|
|
23957
|
+
* Compose it from `Tab` and `TabPanel` children; the first enabled `Tab` is
|
|
23958
|
+
* selected by default. Selection is uncontrolled with `defaultValue` or
|
|
23959
|
+
* controlled with `value` plus `onChange`. Tabs that do not fit the available width move into
|
|
23960
|
+
* an overflow menu at the end of the strip, and the selected tab always stays
|
|
23961
|
+
* visible. Every panel stays mounted and hidden unless `unmountInactive` is
|
|
23962
|
+
* set, so read `useTabPanelActive()` to pause work in a hidden panel.
|
|
23963
|
+
*
|
|
23964
|
+
* The strip renders a `tablist` with roving tabindex and Arrow, Home, and End
|
|
23965
|
+
* navigation. Supply `aria-label` or `aria-labelledby` so it is announced.
|
|
23966
|
+
*
|
|
23967
|
+
* @example
|
|
23968
|
+
* ```tsx
|
|
23969
|
+
* <Tabs defaultValue="work" aria-label="Order sections">
|
|
23970
|
+
* <Tab value="work">Work</Tab>
|
|
23971
|
+
* <Tab value="materials" badge={3}>Materials</Tab>
|
|
23972
|
+
* <TabPanel value="work">Work content</TabPanel>
|
|
23973
|
+
* <TabPanel value="materials">Materials content</TabPanel>
|
|
23974
|
+
* </Tabs>
|
|
23975
|
+
* ```
|
|
23976
|
+
*/
|
|
23977
|
+
export declare const Tabs: (props: TabsProps) => JSX.Element;
|
|
23978
|
+
|
|
23979
|
+
/** React event that produced a tab selection, or `null` for an automatic fallback. */
|
|
23980
|
+
export declare type TabsChangeEvent = MouseEvent_2<HTMLElement> | KeyboardEvent_2<HTMLElement> | null;
|
|
23981
|
+
|
|
23982
|
+
/**
|
|
23983
|
+
* Runs when user interaction changes the tab or an unavailable controlled
|
|
23984
|
+
* value falls back to the first enabled tab.
|
|
23985
|
+
*
|
|
23986
|
+
* @param event - The React event that caused the change, or `null` when the
|
|
23987
|
+
* selected tab became unavailable.
|
|
23988
|
+
* @param value - The `value` of the newly selected tab.
|
|
23989
|
+
* @param reason - Which interaction produced the change.
|
|
23990
|
+
*/
|
|
23991
|
+
export declare type TabsChangeHandler = (event: TabsChangeEvent, value: string, reason: TabsChangeReason) => void;
|
|
23992
|
+
|
|
23993
|
+
/**
|
|
23994
|
+
* Why the selected tab changed.
|
|
23995
|
+
*
|
|
23996
|
+
* `clicked-on-tab` covers direct activation in the tab strip, by pointer or by
|
|
23997
|
+
* keyboard. `selected-from-overflow` covers a pick from the overflow menu.
|
|
23998
|
+
* `fallback-after-removal` keeps controlled state aligned when the selected
|
|
23999
|
+
* tab is removed or disabled.
|
|
24000
|
+
*/
|
|
24001
|
+
export declare type TabsChangeReason = 'clicked-on-tab' | 'selected-from-overflow' | 'fallback-after-removal';
|
|
24002
|
+
|
|
24003
|
+
/** Slot class names produced by the `tabs` recipe and shared with tab parts. */
|
|
24004
|
+
declare type TabsClasses = Record<'root' | 'strip' | 'list' | 'tab' | 'badge' | 'overflow' | 'menu' | 'panel', string>;
|
|
24005
|
+
|
|
24006
|
+
/** State and behavior shared by tab compound components. */
|
|
24007
|
+
declare type TabsContextValue = {
|
|
24008
|
+
/** Currently selected tab value, or `undefined` when no tab is selectable. */
|
|
24009
|
+
selectedValue: string | undefined;
|
|
24010
|
+
/** Applies a selection request from a tab or the overflow menu. */
|
|
24011
|
+
selectTab: (event: TabsChangeEvent, value: string, reason: TabsChangeReason) => void;
|
|
24012
|
+
/** Stores or clears a tab's DOM element so widths can be measured. */
|
|
24013
|
+
registerTabElement: (value: string, element: HTMLElement | null) => void;
|
|
24014
|
+
/** Handles arrow-key, Home, and End navigation from any tab. */
|
|
24015
|
+
onTabKeyDown: (event: KeyboardEvent_2<HTMLElement>) => void;
|
|
24016
|
+
/** Values currently moved into the overflow menu. */
|
|
24017
|
+
overflowValues: readonly string[];
|
|
24018
|
+
/** Whether only the selected panel is mounted. */
|
|
24019
|
+
unmountInactive: boolean;
|
|
24020
|
+
/** Recipe slot classes computed once by `Tabs`. */
|
|
24021
|
+
classes: TabsClasses;
|
|
24022
|
+
/** Returns the DOM id of a tab button. */
|
|
24023
|
+
getTabId: (value: string) => string;
|
|
24024
|
+
/** Returns the DOM id of a tab panel. */
|
|
24025
|
+
getPanelId: (value: string) => string;
|
|
24026
|
+
};
|
|
24027
|
+
|
|
24028
|
+
declare type TabsOwnProps = {
|
|
24029
|
+
/** `Tab` and `TabPanel` children. Tab order in the strip follows source order. */
|
|
24030
|
+
children: ReactNode;
|
|
24031
|
+
/** Controlled selected tab `value`. Pair with `onChange`; omit it to use `defaultValue`. */
|
|
24032
|
+
value?: string;
|
|
24033
|
+
/**
|
|
24034
|
+
* Initially selected tab `value` when `value` is not provided. It is used
|
|
24035
|
+
* only on first render.
|
|
24036
|
+
* @default the first `Tab` child's `value`
|
|
24037
|
+
*/
|
|
24038
|
+
defaultValue?: string;
|
|
24039
|
+
/** Runs when user interaction selects a different tab. */
|
|
24040
|
+
onChange?: TabsChangeHandler;
|
|
24041
|
+
/**
|
|
24042
|
+
* Renders only the selected `TabPanel`. By default every panel stays mounted
|
|
24043
|
+
* and inactive panels are hidden with `display: none`, which preserves their
|
|
24044
|
+
* scroll position and local state.
|
|
24045
|
+
* @default false
|
|
24046
|
+
*/
|
|
24047
|
+
unmountInactive?: boolean;
|
|
24048
|
+
/**
|
|
24049
|
+
* Accessible name for the tab strip. Provide this or `aria-labelledby` so the
|
|
24050
|
+
* `tablist` is announced.
|
|
24051
|
+
*/
|
|
24052
|
+
'aria-label'?: string;
|
|
24053
|
+
/** Id of an element that labels the tab strip. */
|
|
24054
|
+
'aria-labelledby'?: string;
|
|
24055
|
+
};
|
|
24056
|
+
|
|
24057
|
+
/** Props for {@link Tabs}, the tab strip and panel container. */
|
|
24058
|
+
export declare type TabsProps = Omit<BoxProps, keyof TabsVariantProps | keyof TabsOwnProps> & Omit<TabsVariantProps, 'overflowed'> & TabsOwnProps;
|
|
24059
|
+
|
|
24060
|
+
declare interface TabsVariant {
|
|
24061
|
+
/**
|
|
24062
|
+
* @default false
|
|
24063
|
+
*/
|
|
24064
|
+
hasOverflow: boolean
|
|
24065
|
+
overflowed: boolean
|
|
24066
|
+
}
|
|
24067
|
+
|
|
24068
|
+
declare type TabsVariantProps = {
|
|
24069
|
+
[key in keyof TabsVariant]?: ConditionalValue<TabsVariant[key]> | undefined
|
|
24070
|
+
}
|
|
24071
|
+
|
|
21718
24072
|
/**
|
|
21719
24073
|
* Displays a compact, non-interactive category or status label.
|
|
21720
24074
|
*
|
|
@@ -21729,16 +24083,23 @@ declare type SystemStyleObject_2 = Omit<Nested<SystemProperties & CssVarProperti
|
|
|
21729
24083
|
export declare const Tag: (props: TagProps) => JSX.Element;
|
|
21730
24084
|
|
|
21731
24085
|
/** Props accepted by {@link Tag}. */
|
|
21732
|
-
export declare type TagProps = Omit<BoxProps, keyof TagVariantProps> & Omit<TagVariantProps, 'iconBefore' | 'iconAfter'> & {
|
|
24086
|
+
export declare type TagProps = Omit<BoxProps, keyof TagVariantProps> & Omit<TagVariantProps, 'iconBefore' | 'iconAfter' | 'size'> & {
|
|
21733
24087
|
/** Visible tag label. */
|
|
21734
24088
|
children: string;
|
|
21735
24089
|
/** Decorative icon shown before the label. */
|
|
21736
24090
|
iconBefore?: IconNamesList;
|
|
21737
24091
|
/** Decorative icon shown after the label. */
|
|
21738
24092
|
iconAfter?: IconNamesList;
|
|
24093
|
+
/** Height and text size. Use `sm` in dense rows such as table cells. */
|
|
24094
|
+
/** @default "md" */
|
|
24095
|
+
size?: TagVariantProps['size'];
|
|
21739
24096
|
};
|
|
21740
24097
|
|
|
21741
24098
|
declare interface TagVariant {
|
|
24099
|
+
/**
|
|
24100
|
+
* @default "md"
|
|
24101
|
+
*/
|
|
24102
|
+
size: "sm" | "md"
|
|
21742
24103
|
/**
|
|
21743
24104
|
* @default "gray"
|
|
21744
24105
|
*/
|
|
@@ -21899,7 +24260,7 @@ declare interface TextVariant {
|
|
|
21899
24260
|
dashedUnderline: boolean
|
|
21900
24261
|
truncate: boolean
|
|
21901
24262
|
allCaps: boolean
|
|
21902
|
-
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "64" | "72" | "80" | "96"
|
|
24263
|
+
size: "10" | "12" | "14" | "16" | "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "96"
|
|
21903
24264
|
weight: "light" | "normal" | "medium" | "bold" | "black"
|
|
21904
24265
|
}
|
|
21905
24266
|
|
|
@@ -21975,6 +24336,10 @@ export declare type TimeInputProps = Omit<BoxProps, keyof SegmentedFieldsVariant
|
|
|
21975
24336
|
iconBefore?: IconNamesList;
|
|
21976
24337
|
/** Legacy icon rendered after the field when `after` is absent. */
|
|
21977
24338
|
iconAfter?: IconNamesList;
|
|
24339
|
+
/** Shows a clear action in the `after` slot when it is otherwise unused and the field has a value. @default true */
|
|
24340
|
+
clearable?: boolean;
|
|
24341
|
+
/** Accessible label for the clear action. @default 'Clear time' */
|
|
24342
|
+
clearLabel?: string;
|
|
21978
24343
|
/** Applies error styling. Overrides field context when provided. */
|
|
21979
24344
|
error?: boolean;
|
|
21980
24345
|
/** Prevents editing. Overrides field context when provided. */
|
|
@@ -22038,7 +24403,7 @@ export declare type TimeMenuProps = Omit<MenuProps, 'children' | 'onChange' | 'v
|
|
|
22038
24403
|
export declare const TimePicker: (props: TimePickerProps) => JSX.Element;
|
|
22039
24404
|
|
|
22040
24405
|
/** Props for {@link TimePicker}, combining segmented entry and a time menu. */
|
|
22041
|
-
export declare type TimePickerProps = Pick<TimeInputProps, 'id' | 'label' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'timeFormat' | 'size'> & {
|
|
24406
|
+
export declare type TimePickerProps = Pick<TimeInputProps, 'id' | 'label' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'clearLabel' | 'error' | 'disabled' | 'invalid' | 'timeFormat' | 'size'> & {
|
|
22042
24407
|
/** Controlled 24-hour time value. Pair with `onChange`. */
|
|
22043
24408
|
value?: TimeValue | null;
|
|
22044
24409
|
/** Initial time when `value` is not provided. */
|
|
@@ -22100,6 +24465,10 @@ export declare type TimeRangeInputProps = Omit<BoxProps, keyof SegmentedFieldsVa
|
|
|
22100
24465
|
iconBefore?: IconNamesList;
|
|
22101
24466
|
/** Legacy icon rendered after the range when `after` is absent. */
|
|
22102
24467
|
iconAfter?: IconNamesList;
|
|
24468
|
+
/** Shows a clear action in the `after` slot when it is otherwise unused and either endpoint has a value. @default true */
|
|
24469
|
+
clearable?: boolean;
|
|
24470
|
+
/** Accessible label for the clear action. @default 'Clear time range' */
|
|
24471
|
+
clearLabel?: string;
|
|
22103
24472
|
/** Applies error styling. Overrides field context when provided. */
|
|
22104
24473
|
error?: boolean;
|
|
22105
24474
|
/** Prevents editing both endpoints. Overrides field context when provided. */
|
|
@@ -22163,7 +24532,7 @@ export declare type TimeRangeMenuProps = Omit<MenuProps, 'children' | 'onChange'
|
|
|
22163
24532
|
export declare const TimeRangePicker: (props: TimeRangePickerProps) => JSX.Element;
|
|
22164
24533
|
|
|
22165
24534
|
/** Props for {@link TimeRangePicker}, combining range input and time menu. */
|
|
22166
|
-
export declare type TimeRangePickerProps = Pick<TimeRangeInputProps, 'id' | 'startLabel' | 'endLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'error' | 'disabled' | 'invalid' | 'timeFormat' | 'size'> & {
|
|
24535
|
+
export declare type TimeRangePickerProps = Pick<TimeRangeInputProps, 'id' | 'startLabel' | 'endLabel' | 'before' | 'after' | 'iconBefore' | 'iconAfter' | 'clearable' | 'clearLabel' | 'error' | 'disabled' | 'invalid' | 'timeFormat' | 'size'> & {
|
|
22167
24536
|
/** Controlled start and end times. Pair with `onChange`. */
|
|
22168
24537
|
value?: TimeRangeValue | null;
|
|
22169
24538
|
/** Initial time range when `value` is not provided. */
|
|
@@ -22198,6 +24567,179 @@ export declare interface TimeValue {
|
|
|
22198
24567
|
minute: number;
|
|
22199
24568
|
}
|
|
22200
24569
|
|
|
24570
|
+
/**
|
|
24571
|
+
* Confirms a non-blocking outcome in a transient, floating message.
|
|
24572
|
+
*
|
|
24573
|
+
* Applications normally queue toasts imperatively with `useToast` rather than
|
|
24574
|
+
* rendering this component, which is the presentation for one entry in a
|
|
24575
|
+
* `ToastProvider` stack. Render it directly only to place a toast outside that
|
|
24576
|
+
* stack. Use `Alert` when the message must stay until it is read.
|
|
24577
|
+
*
|
|
24578
|
+
* Renders a `div` with `role="alert"` when `tone` is `danger` and
|
|
24579
|
+
* `role="status"` otherwise. `tone="neutral"` uses the info icon.
|
|
24580
|
+
*
|
|
24581
|
+
* @example
|
|
24582
|
+
* ```tsx
|
|
24583
|
+
* <Toast tone="success" duration={5000} onDismiss={remove}>Saved</Toast>
|
|
24584
|
+
* ```
|
|
24585
|
+
*/
|
|
24586
|
+
export declare const Toast: (props: ToastProps) => JSX.Element;
|
|
24587
|
+
|
|
24588
|
+
/**
|
|
24589
|
+
* Imperative toast API returned by {@link useToast}.
|
|
24590
|
+
*
|
|
24591
|
+
* Call it directly for full control, or use a tone shorthand. Every queueing
|
|
24592
|
+
* call returns the new toast's id.
|
|
24593
|
+
*/
|
|
24594
|
+
export declare type ToastApi = {
|
|
24595
|
+
(message: ReactNode, options?: ToastOptions): string;
|
|
24596
|
+
/** Queues an `info` toast. */
|
|
24597
|
+
info: ToastTrigger;
|
|
24598
|
+
/** Queues a `success` toast. */
|
|
24599
|
+
success: ToastTrigger;
|
|
24600
|
+
/** Queues a `warning` toast. */
|
|
24601
|
+
warning: ToastTrigger;
|
|
24602
|
+
/** Queues a `danger` toast. Danger toasts never auto-dismiss. */
|
|
24603
|
+
danger: ToastTrigger;
|
|
24604
|
+
/** Queues a `neutral` toast, which uses the info icon and a neutral surface. */
|
|
24605
|
+
neutral: ToastTrigger;
|
|
24606
|
+
/** Starts the exit animation for one toast. Unknown ids are ignored. */
|
|
24607
|
+
dismiss: (id: string) => void;
|
|
24608
|
+
/** Starts the exit animation for every toast currently on screen. */
|
|
24609
|
+
dismissAll: () => void;
|
|
24610
|
+
};
|
|
24611
|
+
|
|
24612
|
+
declare type ToastDismissProps = {
|
|
24613
|
+
/** Shows the close control. */
|
|
24614
|
+
/** @default true */
|
|
24615
|
+
dismissible?: true;
|
|
24616
|
+
/** Runs when the close control is activated or `duration` elapses. */
|
|
24617
|
+
onDismiss: () => void;
|
|
24618
|
+
} | {
|
|
24619
|
+
dismissible: false;
|
|
24620
|
+
/** Optional callback used by `duration` when no close control is shown. */
|
|
24621
|
+
onDismiss?: () => void;
|
|
24622
|
+
};
|
|
24623
|
+
|
|
24624
|
+
/** Options accepted when queueing a toast through {@link useToast}. */
|
|
24625
|
+
export declare type ToastOptions = {
|
|
24626
|
+
/**
|
|
24627
|
+
* Semantic tone. `danger` is never auto-dismissed, whatever `duration` says.
|
|
24628
|
+
*
|
|
24629
|
+
* @default "neutral"
|
|
24630
|
+
*/
|
|
24631
|
+
tone?: AlertTone;
|
|
24632
|
+
/**
|
|
24633
|
+
* Milliseconds the toast stays on screen before it dismisses itself. The
|
|
24634
|
+
* countdown pauses while the toast is hovered or holds focus. Ignored for
|
|
24635
|
+
* `tone: 'danger'`, which the provider always pins open.
|
|
24636
|
+
*
|
|
24637
|
+
* @default 5000
|
|
24638
|
+
*/
|
|
24639
|
+
duration?: number;
|
|
24640
|
+
/** Leading action, normally a `Button`. */
|
|
24641
|
+
primaryAction?: ReactNode;
|
|
24642
|
+
/** Trailing action, normally a lower-emphasis `Button`. */
|
|
24643
|
+
secondaryAction?: ReactNode;
|
|
24644
|
+
/**
|
|
24645
|
+
* Shows the close control.
|
|
24646
|
+
*
|
|
24647
|
+
* @default true
|
|
24648
|
+
*/
|
|
24649
|
+
dismissible?: boolean;
|
|
24650
|
+
/** Accessible label for the close control. @default "Dismiss" */
|
|
24651
|
+
dismissLabel?: string;
|
|
24652
|
+
/** Runs once the toast leaves the stack, whether it timed out or was closed. */
|
|
24653
|
+
onDismiss?: () => void;
|
|
24654
|
+
};
|
|
24655
|
+
|
|
24656
|
+
declare type ToastOwnProps = {
|
|
24657
|
+
/** Semantic tone. Selects the leading accent and the tone icon. */
|
|
24658
|
+
/** @default "neutral" */
|
|
24659
|
+
tone?: AlertTone;
|
|
24660
|
+
/** The toast message. */
|
|
24661
|
+
children: ReactNode;
|
|
24662
|
+
/** Leading action, normally a `Button`. */
|
|
24663
|
+
primaryAction?: ReactNode;
|
|
24664
|
+
/** Trailing action, normally a lower-emphasis `Button`. Render only alongside `primaryAction`. */
|
|
24665
|
+
secondaryAction?: ReactNode;
|
|
24666
|
+
/**
|
|
24667
|
+
* Milliseconds before the toast calls `onDismiss` by itself. The countdown
|
|
24668
|
+
* pauses while the toast is hovered or contains focus and resumes from the
|
|
24669
|
+
* remaining time. Pass `null`, or omit it, for a toast that never times out.
|
|
24670
|
+
* `ToastProvider` supplies this value and always passes `null` for
|
|
24671
|
+
* `tone: 'danger'`.
|
|
24672
|
+
*/
|
|
24673
|
+
duration?: number | null;
|
|
24674
|
+
/** Accessible label for the close control. @default "Dismiss" */
|
|
24675
|
+
dismissLabel?: string;
|
|
24676
|
+
/**
|
|
24677
|
+
* Animation phase. `closing` plays the exit animation; the owner removes the
|
|
24678
|
+
* toast once it finishes.
|
|
24679
|
+
*
|
|
24680
|
+
* @default "open"
|
|
24681
|
+
*/
|
|
24682
|
+
state?: 'open' | 'closing';
|
|
24683
|
+
} & ToastDismissProps;
|
|
24684
|
+
|
|
24685
|
+
/** Props accepted by {@link Toast}. Includes compatible native element props. */
|
|
24686
|
+
export declare type ToastProps = Omit<BoxProps, keyof ToastVariantProps | keyof ToastOwnProps> & Omit<ToastVariantProps, 'tone'> & ToastOwnProps;
|
|
24687
|
+
|
|
24688
|
+
/**
|
|
24689
|
+
* Hosts the toast stack and provides the imperative API that `useToast`
|
|
24690
|
+
* returns.
|
|
24691
|
+
*
|
|
24692
|
+
* Mount it once near the root of the application, around everything that may
|
|
24693
|
+
* raise a toast. It renders a fixed bottom-right viewport through a portal, so
|
|
24694
|
+
* it needs no layout position of its own.
|
|
24695
|
+
*
|
|
24696
|
+
* The provider — not the calling code — enforces the two rules that keep the
|
|
24697
|
+
* stack predictable: a `danger` toast never auto-dismisses, and no more than
|
|
24698
|
+
* `limit` toasts are on screen at once.
|
|
24699
|
+
*
|
|
24700
|
+
* @example
|
|
24701
|
+
* ```tsx
|
|
24702
|
+
* <ToastProvider>
|
|
24703
|
+
* <App />
|
|
24704
|
+
* </ToastProvider>
|
|
24705
|
+
* ```
|
|
24706
|
+
*/
|
|
24707
|
+
export declare const ToastProvider: (props: ToastProviderProps) => JSX.Element;
|
|
24708
|
+
|
|
24709
|
+
/** Props accepted by {@link ToastProvider}. */
|
|
24710
|
+
export declare type ToastProviderProps = {
|
|
24711
|
+
/** Application subtree that may queue toasts with `useToast`. */
|
|
24712
|
+
children: ReactNode;
|
|
24713
|
+
/**
|
|
24714
|
+
* Default lifetime in milliseconds for toasts that do not set `duration`.
|
|
24715
|
+
* `danger` toasts ignore it and never time out.
|
|
24716
|
+
*
|
|
24717
|
+
* @default 5000
|
|
24718
|
+
*/
|
|
24719
|
+
duration?: number;
|
|
24720
|
+
/**
|
|
24721
|
+
* Largest number of toasts shown at once. Queueing beyond this removes the
|
|
24722
|
+
* oldest toast immediately.
|
|
24723
|
+
*
|
|
24724
|
+
* @default 3
|
|
24725
|
+
*/
|
|
24726
|
+
limit?: number;
|
|
24727
|
+
};
|
|
24728
|
+
|
|
24729
|
+
/** Queues a toast and returns its identifier. */
|
|
24730
|
+
export declare type ToastTrigger = (message: ReactNode, options?: Omit<ToastOptions, 'tone'>) => string;
|
|
24731
|
+
|
|
24732
|
+
declare interface ToastVariant {
|
|
24733
|
+
/**
|
|
24734
|
+
* @default "neutral"
|
|
24735
|
+
*/
|
|
24736
|
+
tone: "info" | "success" | "warning" | "danger" | "neutral"
|
|
24737
|
+
}
|
|
24738
|
+
|
|
24739
|
+
declare type ToastVariantProps = {
|
|
24740
|
+
[key in keyof ToastVariant]?: ConditionalValue<ToastVariant[key]> | undefined
|
|
24741
|
+
}
|
|
24742
|
+
|
|
22201
24743
|
/**
|
|
22202
24744
|
* Toggle is a controlled component.
|
|
22203
24745
|
* You must pass `checked` and `onChange` props.
|
|
@@ -22314,9 +24856,11 @@ declare type Tokens = {
|
|
|
22314
24856
|
/**
|
|
22315
24857
|
* Shows nonessential contextual text for a trigger on hover and keyboard focus.
|
|
22316
24858
|
*
|
|
22317
|
-
* The trigger is wrapped in a span
|
|
22318
|
-
*
|
|
22319
|
-
*
|
|
24859
|
+
* The trigger is wrapped in a span, or takes the props itself with `asChild`,
|
|
24860
|
+
* and is linked with `aria-describedby`; Escape dismisses the portalled
|
|
24861
|
+
* tooltip. Do not use a tooltip as the only accessible
|
|
24862
|
+
* name or instruction for an interactive control. Set `disabled` to suppress
|
|
24863
|
+
* the tooltip without changing the rendered structure.
|
|
22320
24864
|
*
|
|
22321
24865
|
* @example
|
|
22322
24866
|
* ```tsx
|
|
@@ -22327,23 +24871,57 @@ export declare const Tooltip: (props: TooltipProps) => JSX.Element;
|
|
|
22327
24871
|
|
|
22328
24872
|
/** Props for {@link Tooltip}, nonessential contextual text shown on hover or focus. */
|
|
22329
24873
|
export declare type TooltipProps = Omit<BoxProps, keyof TooltipVariantProps | 'children'> & TooltipVariantProps & {
|
|
22330
|
-
/**
|
|
24874
|
+
/** Text displayed in the tooltip body. Use an accessible label instead when this is essential control information. */
|
|
22331
24875
|
text: string;
|
|
22332
|
-
/** Optional
|
|
24876
|
+
/** Optional title displayed above the tooltip body. */
|
|
22333
24877
|
title?: string;
|
|
22334
|
-
/**
|
|
24878
|
+
/**
|
|
24879
|
+
* Shows the arrow pointing at the trigger.
|
|
24880
|
+
* @default true
|
|
24881
|
+
*/
|
|
22335
24882
|
caret?: boolean;
|
|
22336
|
-
/**
|
|
24883
|
+
/**
|
|
24884
|
+
* Preferred placement relative to the trigger. The overlay can flip when it does not fit.
|
|
24885
|
+
* @default 'bottom'
|
|
24886
|
+
*/
|
|
22337
24887
|
placement?: Placement;
|
|
22338
|
-
/**
|
|
24888
|
+
/**
|
|
24889
|
+
* Gap between trigger and tooltip, in pixels.
|
|
24890
|
+
* @default 8
|
|
24891
|
+
*/
|
|
22339
24892
|
offset?: number;
|
|
22340
|
-
/**
|
|
24893
|
+
/**
|
|
24894
|
+
* Turns the tooltip off while keeping the trigger wrapper in the tree, so toggling it does not remount `children`.
|
|
24895
|
+
* @default false
|
|
24896
|
+
*/
|
|
24897
|
+
disabled?: boolean;
|
|
24898
|
+
/** Hover open/close delay in milliseconds, or separate `open` and `close` delays. */
|
|
22341
24899
|
delay?: number | {
|
|
22342
24900
|
open: number;
|
|
22343
24901
|
close: number;
|
|
22344
24902
|
};
|
|
22345
|
-
/**
|
|
24903
|
+
/**
|
|
24904
|
+
* Puts the trigger props on `children` instead of a wrapper span, so the
|
|
24905
|
+
* tooltip adds nothing to layout. `children` must be one element that
|
|
24906
|
+
* takes a `ref`. An `aria-describedby` on the child is kept, and the
|
|
24907
|
+
* tooltip's ID is added to it while the tooltip is open.
|
|
24908
|
+
* @default false
|
|
24909
|
+
*/
|
|
24910
|
+
asChild?: boolean;
|
|
24911
|
+
/**
|
|
24912
|
+
* Links the open tooltip to the trigger with `aria-describedby`. Set it to
|
|
24913
|
+
* `false` only when the trigger already has the same text as its
|
|
24914
|
+
* description, so screen readers do not read it twice.
|
|
24915
|
+
* @default true
|
|
24916
|
+
*/
|
|
24917
|
+
describeTrigger?: boolean;
|
|
24918
|
+
/** Trigger content, wrapped in an inline-flex span to receive floating interaction props unless `asChild` is set. */
|
|
22346
24919
|
children?: ReactNode;
|
|
24920
|
+
/**
|
|
24921
|
+
* Tooltip recipe size.
|
|
24922
|
+
* @default 'md'
|
|
24923
|
+
*/
|
|
24924
|
+
size?: TooltipVariantProps['size'];
|
|
22347
24925
|
};
|
|
22348
24926
|
|
|
22349
24927
|
declare interface TooltipVariant {
|
|
@@ -22370,9 +24948,49 @@ declare interface UnstyledProps {
|
|
|
22370
24948
|
|
|
22371
24949
|
export declare const useChipGroup: () => ChipGroupContextValue | null;
|
|
22372
24950
|
|
|
24951
|
+
/**
|
|
24952
|
+
* Copies text to the clipboard and reports a short-lived `copied` state for
|
|
24953
|
+
* feedback.
|
|
24954
|
+
*
|
|
24955
|
+
* Uses `navigator.clipboard.writeText`, which requires a secure context
|
|
24956
|
+
* (HTTPS or localhost) and a user gesture. The hook does not announce the
|
|
24957
|
+
* result; pair `copied` with visible feedback and a polite live region, as
|
|
24958
|
+
* `CodeBlock` does.
|
|
24959
|
+
*
|
|
24960
|
+
* @example
|
|
24961
|
+
* ```tsx
|
|
24962
|
+
* const { copy, copied } = useClipboard();
|
|
24963
|
+
* <Button onClick={() => copy(secret)}>{copied ? 'Copied' : 'Copy'}</Button>
|
|
24964
|
+
* ```
|
|
24965
|
+
*/
|
|
24966
|
+
export declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;
|
|
24967
|
+
|
|
24968
|
+
/** Options accepted by {@link useClipboard}. */
|
|
24969
|
+
export declare type UseClipboardOptions = {
|
|
24970
|
+
/**
|
|
24971
|
+
* Milliseconds that `copied` stays `true` after a successful copy.
|
|
24972
|
+
*
|
|
24973
|
+
* @default 2000
|
|
24974
|
+
*/
|
|
24975
|
+
timeout?: number;
|
|
24976
|
+
};
|
|
24977
|
+
|
|
24978
|
+
/** Value returned by {@link useClipboard}. */
|
|
24979
|
+
export declare type UseClipboardReturn = {
|
|
24980
|
+
/**
|
|
24981
|
+
* Writes the text to the system clipboard. Resolves `true` on success and
|
|
24982
|
+
* `false` when the browser denies access or has no Clipboard API.
|
|
24983
|
+
*/
|
|
24984
|
+
copy: (text: string) => Promise<boolean>;
|
|
24985
|
+
/** `true` for `timeout` milliseconds after the last successful copy. */
|
|
24986
|
+
copied: boolean;
|
|
24987
|
+
/** `true` when the last copy attempt failed. Cleared by the next attempt. */
|
|
24988
|
+
failed: boolean;
|
|
24989
|
+
};
|
|
24990
|
+
|
|
22373
24991
|
export declare function useContainerQuery(containerRef: RefObject<HTMLElement>, size: ContainerSizeKey, direction?: QueryDirection): boolean;
|
|
22374
24992
|
|
|
22375
|
-
export declare const useControllableState: <T>({ value, defaultValue, onChange, }: UseControllableStateProps<T>) => readonly [T, (nextValue: T | ((currentValue: T) => T)) => void];
|
|
24993
|
+
export declare const useControllableState: <T>({ value, defaultValue, onChange, }: UseControllableStateProps<T>) => readonly [T, (nextValue: T | ((currentValue: T) => T)) => void, boolean];
|
|
22376
24994
|
|
|
22377
24995
|
export declare type UseControllableStateProps<T> = {
|
|
22378
24996
|
value?: T;
|
|
@@ -22380,20 +24998,118 @@ export declare type UseControllableStateProps<T> = {
|
|
|
22380
24998
|
onChange?: (value: T) => void;
|
|
22381
24999
|
};
|
|
22382
25000
|
|
|
25001
|
+
/**
|
|
25002
|
+
* Returns state and close behavior from the closest parent {@link Drawer}.
|
|
25003
|
+
*
|
|
25004
|
+
* Call only in a drawer descendant; it throws when no drawer context is present.
|
|
25005
|
+
* Use it to build a custom close control inside a custom {@link DrawerHeader}.
|
|
25006
|
+
*
|
|
25007
|
+
* @example
|
|
25008
|
+
* ```tsx
|
|
25009
|
+
* const { onClose } = useDrawerContext();
|
|
25010
|
+
* ```
|
|
25011
|
+
*/
|
|
25012
|
+
export declare const useDrawerContext: () => DrawerContextValue;
|
|
25013
|
+
|
|
22383
25014
|
export declare const useFieldContext: () => FieldContextValue | null;
|
|
22384
25015
|
|
|
25016
|
+
/**
|
|
25017
|
+
* Wires a text input to a {@link FilterMenu} as a combobox. Focus stays in
|
|
25018
|
+
* the input. Arrow keys move the active row, Enter picks it, and Esc calls
|
|
25019
|
+
* `onClose`.
|
|
25020
|
+
*
|
|
25021
|
+
* A handled key calls `preventDefault`. Check `event.defaultPrevented` in your
|
|
25022
|
+
* own `onKeyDown` to skip keys the hook already handled.
|
|
25023
|
+
*
|
|
25024
|
+
* @example
|
|
25025
|
+
* ```tsx
|
|
25026
|
+
* const menu = useFilterMenu({ rows, open, onSelect: pick, onClose: close });
|
|
25027
|
+
* <input {...menu.inputProps} aria-label="Filter" />
|
|
25028
|
+
* <FilterMenu {...menu.menuProps} anchor={input} aria-label="Fields" />
|
|
25029
|
+
* ```
|
|
25030
|
+
*/
|
|
25031
|
+
export declare const useFilterMenu: (options: UseFilterMenuOptions) => UseFilterMenuResult;
|
|
25032
|
+
|
|
25033
|
+
/** Options for {@link useFilterMenu}. */
|
|
25034
|
+
export declare type UseFilterMenuOptions = {
|
|
25035
|
+
/** Rows shown in the menu. */
|
|
25036
|
+
rows: FilterMenuRow[];
|
|
25037
|
+
/** Whether the menu is open. Keys do nothing while it is closed. */
|
|
25038
|
+
open: boolean;
|
|
25039
|
+
/** Runs when Enter (or Space, with `spaceSelects`) picks the active row. */
|
|
25040
|
+
onSelect: (key: string) => void;
|
|
25041
|
+
/** Runs when Esc is pressed while the menu is open. */
|
|
25042
|
+
onClose: () => void;
|
|
25043
|
+
/**
|
|
25044
|
+
* Makes Space pick the active row. Set it for a multi-pick list when the
|
|
25045
|
+
* input is empty, so Space toggles a checkbox instead of typing a space.
|
|
25046
|
+
*/
|
|
25047
|
+
spaceSelects?: boolean;
|
|
25048
|
+
/** Listbox id. A generated id is used when absent. */
|
|
25049
|
+
id?: string;
|
|
25050
|
+
};
|
|
25051
|
+
|
|
25052
|
+
/** Value returned by {@link useFilterMenu}. */
|
|
25053
|
+
export declare type UseFilterMenuResult = {
|
|
25054
|
+
/** Key of the active row. It falls back to the first pickable row. */
|
|
25055
|
+
activeKey: string | null;
|
|
25056
|
+
/**
|
|
25057
|
+
* Sets the active row. Pass `null` to go back to the first pickable row,
|
|
25058
|
+
* for example after the typed text changes.
|
|
25059
|
+
*/
|
|
25060
|
+
setActiveKey: (key: string | null) => void;
|
|
25061
|
+
/** Spread onto the text input that owns the menu. */
|
|
25062
|
+
inputProps: {
|
|
25063
|
+
role: 'combobox';
|
|
25064
|
+
'aria-expanded': boolean;
|
|
25065
|
+
'aria-controls': string | undefined;
|
|
25066
|
+
'aria-autocomplete': 'list';
|
|
25067
|
+
'aria-activedescendant': string | undefined;
|
|
25068
|
+
onKeyDown: (event: KeyboardEvent_2<HTMLInputElement>) => void;
|
|
25069
|
+
};
|
|
25070
|
+
/** Spread onto the {@link FilterMenu}, with `anchor` and `aria-label`. */
|
|
25071
|
+
menuProps: {
|
|
25072
|
+
id: string;
|
|
25073
|
+
open: boolean;
|
|
25074
|
+
rows: FilterMenuRow[];
|
|
25075
|
+
activeKey: string | null;
|
|
25076
|
+
onActiveKeyChange: (key: string) => void;
|
|
25077
|
+
onSelect: (key: string) => void;
|
|
25078
|
+
};
|
|
25079
|
+
};
|
|
25080
|
+
|
|
22385
25081
|
export { useForm }
|
|
22386
25082
|
|
|
22387
25083
|
export declare const useIconConfig: () => IconConfigContextValue;
|
|
22388
25084
|
|
|
22389
25085
|
export declare const useListContext: () => ListContextValue;
|
|
22390
25086
|
|
|
25087
|
+
/**
|
|
25088
|
+
* Returns the active locale and built-in labels.
|
|
25089
|
+
*
|
|
25090
|
+
* Works without a {@link LocaleProvider}: it then returns `en-US` and the
|
|
25091
|
+
* English defaults.
|
|
25092
|
+
*
|
|
25093
|
+
* @example
|
|
25094
|
+
* ```tsx
|
|
25095
|
+
* const { locale, labels } = useLocale();
|
|
25096
|
+
* ```
|
|
25097
|
+
*/
|
|
25098
|
+
export declare function useLocale(): LocaleContextType;
|
|
25099
|
+
|
|
22391
25100
|
export declare function useMediaQuery(breakpoint: BreakpointKey, direction?: QueryDirection_2): boolean;
|
|
22392
25101
|
|
|
25102
|
+
/**
|
|
25103
|
+
* Returns the enclosing menu's shared behavior.
|
|
25104
|
+
*
|
|
25105
|
+
* Must be called below `Menu` or `MenuProvider`; otherwise it throws.
|
|
25106
|
+
*/
|
|
22393
25107
|
export declare const useMenuContext: () => MenuContext;
|
|
22394
25108
|
|
|
25109
|
+
/** Returns the active menu filtering configuration, or the default configuration outside a `Menu`. */
|
|
22395
25110
|
export declare const useMenuFilterContext: () => MenuFilterContextValue;
|
|
22396
25111
|
|
|
25112
|
+
/** Returns roving-focus state for the current menu level, or `null` when none is provided. */
|
|
22397
25113
|
export declare const useMenuListContext: () => MenuListContextValue | null;
|
|
22398
25114
|
|
|
22399
25115
|
/**
|
|
@@ -22408,10 +25124,168 @@ export declare const useMenuListContext: () => MenuListContextValue | null;
|
|
|
22408
25124
|
*/
|
|
22409
25125
|
export declare const useModalWrapperContext: () => ModalWrapperContextValue;
|
|
22410
25126
|
|
|
25127
|
+
/**
|
|
25128
|
+
* Splits a row of items into the ones that fit and the ones that overflow.
|
|
25129
|
+
*
|
|
25130
|
+
* Implements the "priority plus" pattern: usable width is the container's
|
|
25131
|
+
* client width minus its horizontal padding, with the container's column gap
|
|
25132
|
+
* charged between items. A reserve for the overflow toggle is subtracted only
|
|
25133
|
+
* once the row is known to overflow, so a row that fits never loses an item to
|
|
25134
|
+
* a toggle that is not rendered. Candidates compete for that width ordered by
|
|
25135
|
+
* distance from `activeItem`, so the items nearest the active one win. The
|
|
25136
|
+
* first candidate that does not fit ends the walk, and everything after it
|
|
25137
|
+
* overflows too;
|
|
25138
|
+
* later, narrower items are not squeezed in because that reorders the row
|
|
25139
|
+
* unpredictably. `activeItem` is always forced back into `visible`.
|
|
25140
|
+
*
|
|
25141
|
+
* The hook only measures — the caller decides what to render. Overflowed
|
|
25142
|
+
* elements must remain in the DOM for `offsetWidth` to stay readable. It
|
|
25143
|
+
* remeasures on `ResizeObserver` entries for the container and each item, and
|
|
25144
|
+
* on window resize, throttled through `requestAnimationFrame`.
|
|
25145
|
+
*
|
|
25146
|
+
* @example
|
|
25147
|
+
* ```tsx
|
|
25148
|
+
* const { visible, overflow } = useOverflowItems({
|
|
25149
|
+
* items: ids,
|
|
25150
|
+
* containerRef,
|
|
25151
|
+
* getItemElement: useCallback((id) => elements.current.get(id) ?? null, []),
|
|
25152
|
+
* activeItem: selectedId,
|
|
25153
|
+
* });
|
|
25154
|
+
* ```
|
|
25155
|
+
*/
|
|
25156
|
+
export declare const useOverflowItems: <TKey extends OverflowItemKey>({ items, containerRef, getItemElement, activeItem, reserve, reserveRef, enabled, }: UseOverflowItemsOptions<TKey>) => UseOverflowItemsResult<TKey>;
|
|
25157
|
+
|
|
25158
|
+
/** Options accepted by {@link useOverflowItems}. */
|
|
25159
|
+
export declare type UseOverflowItemsOptions<TKey extends OverflowItemKey> = {
|
|
25160
|
+
/** Candidate keys in source order. The returned arrays preserve this order. */
|
|
25161
|
+
items: readonly TKey[];
|
|
25162
|
+
/** Ref for the element whose content box constrains the visible items. */
|
|
25163
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
25164
|
+
/**
|
|
25165
|
+
* Resolves the measured element for a key. Overflowed elements must stay in
|
|
25166
|
+
* the DOM (for example `visibility: hidden; position: absolute`) so their
|
|
25167
|
+
* `offsetWidth` remains readable. Keep the function referentially stable.
|
|
25168
|
+
*/
|
|
25169
|
+
getItemElement: (key: TKey) => HTMLElement | null;
|
|
25170
|
+
/**
|
|
25171
|
+
* Key that must always end up visible, and the anchor that space is
|
|
25172
|
+
* allocated around: candidates nearest to it win the available width.
|
|
25173
|
+
*/
|
|
25174
|
+
activeItem?: TKey | null;
|
|
25175
|
+
/**
|
|
25176
|
+
* Width in CSS pixels held back for the overflow toggle.
|
|
25177
|
+
* @default 32
|
|
25178
|
+
*/
|
|
25179
|
+
reserve?: number;
|
|
25180
|
+
/**
|
|
25181
|
+
* Element whose rendered width is held back for the overflow toggle. When
|
|
25182
|
+
* present, its measured width takes precedence over `reserve`.
|
|
25183
|
+
*/
|
|
25184
|
+
reserveRef?: RefObject<HTMLElement | null>;
|
|
25185
|
+
/**
|
|
25186
|
+
* Enables measurement. When `false`, every item is reported as visible.
|
|
25187
|
+
* @default true
|
|
25188
|
+
*/
|
|
25189
|
+
enabled?: boolean;
|
|
25190
|
+
};
|
|
25191
|
+
|
|
25192
|
+
/** Result returned by {@link useOverflowItems}. */
|
|
25193
|
+
export declare type UseOverflowItemsResult<TKey extends OverflowItemKey> = {
|
|
25194
|
+
/** Items that fit, in source order. */
|
|
25195
|
+
visible: TKey[];
|
|
25196
|
+
/** Items that do not fit, in source order. */
|
|
25197
|
+
overflow: TKey[];
|
|
25198
|
+
/** Whether at least one item overflowed. */
|
|
25199
|
+
hasOverflow: boolean;
|
|
25200
|
+
/** Forces a synchronous remeasure, for content changes no observer reports. */
|
|
25201
|
+
measure: () => void;
|
|
25202
|
+
/**
|
|
25203
|
+
* Makes an item visible, then runs a callback after the DOM updates. The
|
|
25204
|
+
* latest requested item stays visible until `activeItem` reaches it, moves to
|
|
25205
|
+
* a key that was never requested, or the item is removed. A deferred
|
|
25206
|
+
* selection update, including the commit of an older request, does not hide
|
|
25207
|
+
* it again.
|
|
25208
|
+
*/
|
|
25209
|
+
ensureVisible: (key: TKey, onVisible?: () => void) => void;
|
|
25210
|
+
};
|
|
25211
|
+
|
|
25212
|
+
/**
|
|
25213
|
+
* Returns shared state from the closest parent {@link Popover}.
|
|
25214
|
+
*
|
|
25215
|
+
* Call only in a Popover descendant; it throws when no popover context is present.
|
|
25216
|
+
*
|
|
25217
|
+
* @example
|
|
25218
|
+
* ```tsx
|
|
25219
|
+
* const { setOpen } = usePopoverContext();
|
|
25220
|
+
* ```
|
|
25221
|
+
*/
|
|
25222
|
+
export declare const usePopoverContext: () => PopoverContextValue;
|
|
25223
|
+
|
|
25224
|
+
/**
|
|
25225
|
+
* Returns the geometry of the closest parent {@link PrintPage}.
|
|
25226
|
+
*
|
|
25227
|
+
* All lengths are CSS pixels at scale 1, which is page space: 96 per inch.
|
|
25228
|
+
* Divide a screen distance by `scale` to get a page distance, for example to
|
|
25229
|
+
* map a pointer position to a block on the page.
|
|
25230
|
+
*
|
|
25231
|
+
* Call only inside a `PrintPage`; it throws when no page is present.
|
|
25232
|
+
*
|
|
25233
|
+
* @example
|
|
25234
|
+
* ```tsx
|
|
25235
|
+
* const { scale, margins } = usePrintPage();
|
|
25236
|
+
* const pageX = (event.clientX - rect.left) / scale;
|
|
25237
|
+
* ```
|
|
25238
|
+
*/
|
|
25239
|
+
export declare const usePrintPage: () => PrintPageContextValue;
|
|
25240
|
+
|
|
22411
25241
|
export declare const useSelectContext: () => SelectContextValue;
|
|
22412
25242
|
|
|
25243
|
+
/**
|
|
25244
|
+
* Returns whether the surrounding `TabPanel` is the selected one.
|
|
25245
|
+
*
|
|
25246
|
+
* Panels stay mounted by default, so hidden content keeps running unless it
|
|
25247
|
+
* checks this value. Use it to pause polling, animation, or media playback.
|
|
25248
|
+
* Returns `true` outside a `TabPanel`.
|
|
25249
|
+
*
|
|
25250
|
+
* @example
|
|
25251
|
+
* ```tsx
|
|
25252
|
+
* const isActive = useTabPanelActive();
|
|
25253
|
+
* useEffect(() => {
|
|
25254
|
+
* if (!isActive) return;
|
|
25255
|
+
* const id = setInterval(refresh, 5000);
|
|
25256
|
+
* return () => clearInterval(id);
|
|
25257
|
+
* }, [isActive]);
|
|
25258
|
+
* ```
|
|
25259
|
+
*/
|
|
25260
|
+
export declare const useTabPanelActive: () => boolean;
|
|
25261
|
+
|
|
25262
|
+
/**
|
|
25263
|
+
* Returns the enclosing tab strip's shared state.
|
|
25264
|
+
*
|
|
25265
|
+
* Must be called below `Tabs`; otherwise it throws.
|
|
25266
|
+
*/
|
|
25267
|
+
export declare const useTabsContext: () => TabsContextValue;
|
|
25268
|
+
|
|
22413
25269
|
export declare function useTheme(): ThemeContextType;
|
|
22414
25270
|
|
|
25271
|
+
/**
|
|
25272
|
+
* Returns the imperative toast API for the nearest `ToastProvider`.
|
|
25273
|
+
*
|
|
25274
|
+
* Call the returned value directly for full control, or use a tone shorthand.
|
|
25275
|
+
* Every queueing call returns the new toast's id, which `dismiss` accepts.
|
|
25276
|
+
* Queueing during render is not supported; call it from an event handler or an
|
|
25277
|
+
* effect.
|
|
25278
|
+
*
|
|
25279
|
+
* @throws When called outside a `ToastProvider`.
|
|
25280
|
+
*
|
|
25281
|
+
* @example
|
|
25282
|
+
* ```tsx
|
|
25283
|
+
* const toast = useToast();
|
|
25284
|
+
* const id = toast.danger('Could not save', { primaryAction: <Button onClick={retry}>Retry</Button> });
|
|
25285
|
+
* ```
|
|
25286
|
+
*/
|
|
25287
|
+
export declare const useToast: () => ToastApi;
|
|
25288
|
+
|
|
22415
25289
|
declare type UtilitySizeToken = "full" | "half" | "min" | "max" | "fit" | "prose" | "auto"
|
|
22416
25290
|
|
|
22417
25291
|
declare interface UtilityValues {
|
|
@@ -22576,7 +25450,7 @@ declare interface UtilityValues {
|
|
|
22576
25450
|
transitionDuration: Tokens["durations"];
|
|
22577
25451
|
transition: "all" | "common" | "size" | "position" | "background" | "colors" | "opacity" | "shadow" | "transform";
|
|
22578
25452
|
animation: Tokens["animations"];
|
|
22579
|
-
animationName: "spin" | "ping" | "pulse" | "bounce" | "badgePop" | "badgePopStandalone" | "slideLeft" | "slideRight" | "skeletonWave" | "modalFadeIn" | "modalFadeOut" | "modalScaleIn" | "modalScaleOut" | "modalScaleInTop" | "modalScaleOutTop";
|
|
25453
|
+
animationName: "spin" | "ping" | "pulse" | "bounce" | "badgePop" | "badgePopStandalone" | "slideLeft" | "slideRight" | "skeletonWave" | "modalFadeIn" | "modalFadeOut" | "modalScaleIn" | "modalScaleOut" | "modalScaleInTop" | "modalScaleOutTop" | "drawerSlideInRight" | "drawerSlideOutRight" | "drawerSlideInLeft" | "drawerSlideOutLeft" | "toastSlideIn" | "toastSlideOut";
|
|
22580
25454
|
animationTimingFunction: Tokens["easings"];
|
|
22581
25455
|
animationDuration: Tokens["durations"];
|
|
22582
25456
|
animationDelay: Tokens["durations"];
|