@sanity/ui 4.0.0-beta.2 → 4.0.0-beta.4
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/LICENSE +1 -1
- package/dist/index.d.ts +1331 -2068
- package/dist/index.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,2190 +1,1613 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {Component} from 'react'
|
|
13
|
-
import type {ComponentType as ComponentType_2} from 'react'
|
|
14
|
-
import {ContainerStyleProps} from '@sanity/ui-css'
|
|
15
|
-
import type {ContainerWidth} from '@sanity/ui-tokens'
|
|
16
|
-
import type {Context} from 'react'
|
|
17
|
-
import type {ElementTone} from '@sanity/ui-tokens'
|
|
18
|
-
import {ElementType as ElementType_2} from 'react'
|
|
19
|
-
import {ErrorInfo} from 'react'
|
|
20
|
-
import {FlexStyleProps} from '@sanity/ui-css'
|
|
21
|
-
import type {FontCodeSize} from '@sanity/ui-tokens'
|
|
22
|
-
import type {FontHeadingSize} from '@sanity/ui-tokens'
|
|
23
|
-
import type {FontLabelSize} from '@sanity/ui-tokens'
|
|
24
|
-
import type {FontTextSize} from '@sanity/ui-tokens'
|
|
25
|
-
import type {FontWeight} from '@sanity/ui-tokens'
|
|
26
|
-
import {ForwardedRef} from 'react'
|
|
27
|
-
import {GapStyleProps} from '@sanity/ui-css'
|
|
28
|
-
import {GridStyleProps} from '@sanity/ui-css'
|
|
29
|
-
import {HeadingStyleProps} from '@sanity/ui-css'
|
|
30
|
-
import {HTMLMotionProps} from 'motion/react'
|
|
31
|
-
import {InlineStyleProps} from '@sanity/ui-css'
|
|
32
|
-
import {InputStyleProps} from '@sanity/ui-css'
|
|
33
|
-
import {KBDStyleProps} from '@sanity/ui-css'
|
|
34
|
-
import {LabelStyleProps} from '@sanity/ui-css'
|
|
35
|
-
import {LazyExoticComponent} from 'react'
|
|
36
|
-
import {MaxWidth} from '@sanity/ui-css'
|
|
37
|
-
import {MouseEventHandler} from 'react'
|
|
38
|
-
import {PaddingStyleProps} from '@sanity/ui-css'
|
|
39
|
-
import {PropsWithChildren} from 'react'
|
|
40
|
-
import type {Radius} from '@sanity/ui-tokens'
|
|
41
|
-
import {RadiusStyleProps} from '@sanity/ui-css'
|
|
42
|
-
import {ReactElement} from 'react'
|
|
43
|
-
import {ReactNode} from 'react'
|
|
44
|
-
import {ReactPortal} from 'react'
|
|
45
|
-
import {Ref} from 'react'
|
|
46
|
-
import {ResponsiveProp} from '@sanity/ui-css'
|
|
47
|
-
import {ResponsivePropArray} from '@sanity/ui-css'
|
|
48
|
-
import {RootStyleProps} from '@sanity/ui-css'
|
|
49
|
-
import {SelectableStyleProps} from '@sanity/ui-css'
|
|
50
|
-
import {SelectStyleProps} from '@sanity/ui-css'
|
|
51
|
-
import type {Shadow} from '@sanity/ui-tokens'
|
|
52
|
-
import {ShadowStyleProps} from '@sanity/ui-css'
|
|
53
|
-
import {SkeletonStyleProps} from '@sanity/ui-css'
|
|
54
|
-
import type {Space} from '@sanity/ui-tokens'
|
|
55
|
-
import {StackStyleProps} from '@sanity/ui-css'
|
|
56
|
-
import type {Strategy} from '@floating-ui/react-dom'
|
|
57
|
-
import {TextAreaStyleProps} from '@sanity/ui-css'
|
|
58
|
-
import {TextOverflowStyleProps} from '@sanity/ui-css'
|
|
59
|
-
import {TextStyleProps} from '@sanity/ui-css'
|
|
60
|
-
import {vars} from '@sanity/ui-css'
|
|
61
|
-
|
|
1
|
+
import { BREAKPOINTS, BadgeStyleProps, BoxStyleProps, Breakpoint, ButtonStyleProps, CardStyleProps, CodeStyleProps, ContainerStyleProps, FlexStyleProps, GapStyleProps, GridStyleProps, HeadingStyleProps, InlineStyleProps, InputStyleProps, KBDStyleProps, LabelStyleProps, MaxWidth, PaddingStyleProps, RadiusStyleProps, ResponsiveProp, ResponsiveProp as ResponsiveProp$1, ResponsivePropArray, RootStyleProps, SelectStyleProps, SelectableStyleProps, ShadowStyleProps, SkeletonStyleProps, StackStyleProps, TextAreaStyleProps, TextOverflowStyleProps, TextStyleProps, vars } from "@sanity/ui-css";
|
|
2
|
+
import { AvatarColor, AvatarSize, CardTone, ColorScheme, ContainerWidth, ElementTone, FontCodeSize, FontHeadingSize, FontLabelSize, FontTextSize, FontWeight, Radius, Shadow, Space } from "@sanity/ui-tokens";
|
|
3
|
+
import * as _$_sanity_color0 from "@sanity/color";
|
|
4
|
+
import { COLOR_HUES as HUES, COLOR_TINTS as TINTS } from "@sanity/color";
|
|
5
|
+
import * as _$react from "react";
|
|
6
|
+
import { Component, ComponentType as ComponentType$1, Context, ElementType as ElementType$1, ErrorInfo, ForwardedRef, MouseEventHandler, PropsWithChildren, ReactElement, ReactNode, ReactPortal, Ref } from "react";
|
|
7
|
+
import { Strategy } from "@floating-ui/react-dom";
|
|
8
|
+
import { HTMLMotionProps } from "motion/react";
|
|
9
|
+
export * from "@sanity/ui-tokens";
|
|
10
|
+
/** @internal */
|
|
11
|
+
declare const _CODE_TOKEN_KEYS: readonly ["atrule", "attrName", "attrValue", "attribute", "boolean", "builtin", "cdata", "char", "class", "className", "comment", "constant", "deleted", "doctype", "entity", "function", "hexcode", "id", "important", "inserted", "keyword", "number", "operator", "prolog", "property", "pseudoClass", "pseudoElement", "punctuation", "regex", "selector", "string", "symbol", "tag", "unit", "url", "variable"];
|
|
62
12
|
/**
|
|
63
|
-
*
|
|
13
|
+
* Available avatar color mode values for the `_avatarColor` collection.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Avatar colors map to color hues: gray, red, orange, yellow, green,
|
|
17
|
+
* cyan, blue, purple, magenta.
|
|
64
18
|
*
|
|
65
19
|
* @public
|
|
66
20
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
declare const AVATAR_COLORS: _$_sanity_color0.ColorHueKey[];
|
|
22
|
+
/** @public */
|
|
23
|
+
declare const AVATAR_SIZE: readonly [0, 1, 2, 3];
|
|
24
|
+
/** @beta */
|
|
25
|
+
declare const BG_PATTERNS: readonly ["checkered", "halftone", "grid"];
|
|
26
|
+
/** @public */
|
|
27
|
+
declare const BORDER_STYLE: readonly ["default", "muted", "none"];
|
|
28
|
+
/** @public */
|
|
29
|
+
declare const BORDER_WIDTH: readonly [0, 1, 2];
|
|
30
|
+
/** @public */
|
|
31
|
+
declare const BUTTON_MODES: readonly ["default", "ghost", "bleed"];
|
|
69
32
|
/**
|
|
70
|
-
*
|
|
33
|
+
* Available card tone mode values for the `_cardTone` collection.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
71
36
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
37
|
+
declare const CARD_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical", "transparent"];
|
|
74
38
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
39
|
+
* Available color scheme mode values for the `_colorScheme` collection.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
declare const COLOR_SCHEMES: readonly ["light", "dark"];
|
|
44
|
+
/**
|
|
45
|
+
* Available color variant types.
|
|
77
46
|
*
|
|
78
47
|
* @public
|
|
79
48
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
49
|
+
declare const COLOR_VARIANTS: readonly ["tinted", "solid"];
|
|
50
|
+
/** @public */
|
|
51
|
+
declare const CONTAINER_SCALE: readonly [0, 1, 2, 3, 4, 5];
|
|
52
|
+
/** @public */
|
|
53
|
+
declare const CONTAINER: [...typeof CONTAINER_SCALE, 'auto'];
|
|
54
|
+
/** @public */
|
|
55
|
+
declare const ELEMENT_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
56
|
+
/** @public */
|
|
57
|
+
declare const FONT_CODE_SIZE: readonly [0, 1, 2, 3, 4];
|
|
58
|
+
/** @public */
|
|
59
|
+
declare const FONT_HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
60
|
+
/** @public */
|
|
61
|
+
declare const FONT_LABEL_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
85
62
|
/** @public */
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
declare const FONT_TEXT_SIZE: readonly [0, 1, 2, 3, 4];
|
|
64
|
+
/** @public */
|
|
65
|
+
declare const FONT_WEIGHT: readonly ["regular", "medium", "semibold", "bold"];
|
|
66
|
+
/** @public */
|
|
67
|
+
declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6, "full"];
|
|
68
|
+
/** @public */
|
|
69
|
+
declare const SHADOW: readonly [0, 1, 2, 3, 4, 5];
|
|
70
|
+
/** @public */
|
|
71
|
+
declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
88
72
|
/**
|
|
89
|
-
*
|
|
73
|
+
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U;
|
|
78
|
+
/** @public */
|
|
79
|
+
type EmptyProps = {};
|
|
80
|
+
/** @public */
|
|
81
|
+
type TagType = keyof React.JSX.IntrinsicElements;
|
|
82
|
+
/** @public */
|
|
83
|
+
type ComponentType<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ExoticComponent<P>;
|
|
84
|
+
/** @public */
|
|
85
|
+
type ElementType<P> = TagType | ComponentType<P>;
|
|
86
|
+
/** @public */
|
|
87
|
+
type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>, P & {
|
|
88
|
+
as?: E;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Placement of floating UI elements.
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
96
|
+
/** @public */
|
|
97
|
+
type Delay = number | Partial<{
|
|
98
|
+
open: number;
|
|
99
|
+
close: number;
|
|
100
|
+
}>;
|
|
101
|
+
/** @public */
|
|
102
|
+
declare const DEFAULT_BOX_ELEMENT = "div";
|
|
103
|
+
/** @public */
|
|
104
|
+
type BoxOwnProps = BoxStyleProps;
|
|
105
|
+
/** @public */
|
|
106
|
+
type BoxElementType = 'a' | 'article' | 'aside' | 'blockquote' | 'body' | 'button' | 'details' | 'div' | 'header' | 'fieldset' | 'figure' | 'figcaption' | 'footer' | 'form' | 'html' | 'iframe' | 'kbd' | 'label' | 'legend' | 'li' | 'main' | 'nav' | 'ol' | 'pre' | 'section' | 'span' | 'summary' | 'table' | 'tbody' | 'td' | 'tfoot' | 'th' | 'thead' | 'tr' | 'ul' | ComponentType;
|
|
107
|
+
/** @public */
|
|
108
|
+
type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>;
|
|
109
|
+
/**
|
|
110
|
+
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
111
|
+
* for flex, margins and padding.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
90
114
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
115
|
+
declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(props: BoxProps<E>): React.JSX.Element;
|
|
116
|
+
/** @public */
|
|
117
|
+
declare const DEFAULT_CARD_ELEMENT = "div";
|
|
118
|
+
/** @public */
|
|
119
|
+
interface CardOwnProps extends Omit<CardStyleProps, 'tone'> {
|
|
120
|
+
/**
|
|
121
|
+
* Do not use in production.
|
|
122
|
+
* @beta
|
|
123
|
+
* @deprecated Use `__unstable_pattern` instead.
|
|
124
|
+
*/
|
|
125
|
+
__unstable_checkered?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Do not use in production.
|
|
128
|
+
* @beta
|
|
129
|
+
*/
|
|
130
|
+
__unstable_focusRing?: boolean;
|
|
131
|
+
disabled?: boolean;
|
|
132
|
+
pressed?: boolean;
|
|
133
|
+
selected?: boolean;
|
|
134
|
+
target?: string;
|
|
135
|
+
tone?: CardTone | 'inherit';
|
|
94
136
|
}
|
|
95
|
-
|
|
137
|
+
/** @public */
|
|
138
|
+
type CardElementType = BoxElementType;
|
|
139
|
+
/** @public */
|
|
140
|
+
type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>;
|
|
96
141
|
/**
|
|
97
|
-
*
|
|
142
|
+
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
143
|
+
* Components within a `Card` inherit its colors.
|
|
144
|
+
*
|
|
145
|
+
* @public
|
|
98
146
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
147
|
+
declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(props: CardProps<E>): React.JSX.Element;
|
|
148
|
+
/** @public */
|
|
149
|
+
declare const DEFAULT_LAYER_ELEMENT = "div";
|
|
150
|
+
/** @public */
|
|
151
|
+
interface LayerOwnProps extends CardOwnProps {
|
|
152
|
+
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
153
|
+
onActivate?: (props: {
|
|
154
|
+
activeElement: HTMLElement | null;
|
|
155
|
+
}) => void;
|
|
156
|
+
zOffset?: ResponsiveProp$1<number>;
|
|
157
|
+
}
|
|
158
|
+
/** @public */
|
|
159
|
+
type LayerElementType = CardElementType;
|
|
160
|
+
/** @public */
|
|
161
|
+
type LayerProps<E extends LayerElementType = LayerElementType> = Props<LayerOwnProps, E>;
|
|
162
|
+
/** @public */
|
|
163
|
+
declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(props: LayerProps<E>): React.JSX.Element;
|
|
164
|
+
/** @internal */
|
|
165
|
+
interface PopoverLayerOwnProps extends LayerOwnProps {
|
|
166
|
+
/**
|
|
167
|
+
* Whether the popover should animate in and out.
|
|
168
|
+
*
|
|
169
|
+
* @beta
|
|
170
|
+
* @defaultValue false
|
|
171
|
+
*/
|
|
172
|
+
animate?: boolean;
|
|
173
|
+
children?: React.ReactNode;
|
|
174
|
+
originX?: number;
|
|
175
|
+
originY?: number;
|
|
176
|
+
referenceWidth?: number;
|
|
177
|
+
strategy?: Strategy;
|
|
178
|
+
x?: number;
|
|
179
|
+
y?: number;
|
|
101
180
|
}
|
|
102
|
-
|
|
181
|
+
/** @public */
|
|
182
|
+
type PopoverLayerProps = Assign<HTMLMotionProps<'div'>, PopoverLayerOwnProps>;
|
|
103
183
|
/**
|
|
104
|
-
* @
|
|
184
|
+
* @beta
|
|
105
185
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/** @
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
type PopoverMargins = [number, number, number, number];
|
|
187
|
+
/** @beta */
|
|
188
|
+
type PopoverUpdateCallback = () => void;
|
|
189
|
+
/** @public */
|
|
190
|
+
type PopoverWidth = Exclude<ContainerWidth, 'auto'>;
|
|
191
|
+
/** @public */
|
|
192
|
+
type PopoverOwnProps = Omit<PopoverLayerOwnProps, 'maxWidth'> & {
|
|
193
|
+
/** @beta */__unstable_distance?: number;
|
|
194
|
+
/**
|
|
195
|
+
* @beta
|
|
196
|
+
* @deprecated Will be removed in the next major version */
|
|
197
|
+
__unstable_margins?: PopoverMargins; /** @beta */
|
|
198
|
+
__unstable_shift?: number;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Will be removed in the next major version
|
|
201
|
+
*/
|
|
202
|
+
arrow?: boolean;
|
|
203
|
+
children?: ReactElement<{
|
|
204
|
+
ref: ForwardedRef<HTMLElement>;
|
|
205
|
+
}>;
|
|
206
|
+
/**
|
|
207
|
+
* When `true`, prevent overflow within the current boundary:
|
|
208
|
+
* - by flipping on its side axis
|
|
209
|
+
* - by resizing
|
|
210
|
+
*
|
|
211
|
+
* Note that:
|
|
212
|
+
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
213
|
+
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
214
|
+
*
|
|
215
|
+
* @defaultValue false
|
|
216
|
+
*/
|
|
217
|
+
constrainSize?: boolean;
|
|
218
|
+
content?: ReactNode;
|
|
219
|
+
disabled?: boolean;
|
|
220
|
+
fallbackPlacements?: Placement[];
|
|
221
|
+
floatingBoundary?: HTMLElement | null;
|
|
222
|
+
/**
|
|
223
|
+
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
224
|
+
* the current boundary by resizing.
|
|
225
|
+
*
|
|
226
|
+
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
227
|
+
*
|
|
228
|
+
* @defaultValue false
|
|
229
|
+
*/
|
|
230
|
+
matchReferenceWidth?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
233
|
+
*
|
|
234
|
+
* @beta
|
|
235
|
+
* @defaultValue false
|
|
236
|
+
*/
|
|
237
|
+
modal?: boolean;
|
|
238
|
+
open?: boolean;
|
|
239
|
+
placement?: Placement;
|
|
240
|
+
/**
|
|
241
|
+
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
242
|
+
* fallback placements in order. Whichever fits in the viewport first.
|
|
243
|
+
*
|
|
244
|
+
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
245
|
+
* and the placement with the most viewport space available.
|
|
246
|
+
*
|
|
247
|
+
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
248
|
+
*/
|
|
249
|
+
placementStrategy?: 'flip' | 'autoPlacement'; /** Whether or not to render the popover in a portal element. */
|
|
250
|
+
portal?: boolean | string;
|
|
251
|
+
preventOverflow?: boolean;
|
|
252
|
+
referenceBoundary?: HTMLElement | null;
|
|
253
|
+
/**
|
|
254
|
+
* When defined, the popover will be positioned relative to this element.
|
|
255
|
+
* The children of the popover won't be rendered.
|
|
256
|
+
*/
|
|
257
|
+
referenceElement?: HTMLElement | null; /** @beta */
|
|
258
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>;
|
|
259
|
+
width?: ResponsiveProp$1<MaxWidth>;
|
|
260
|
+
};
|
|
261
|
+
/** @public */
|
|
262
|
+
type PopoverElementType = 'div';
|
|
263
|
+
/** @public */
|
|
264
|
+
type PopoverProps = Assign<PopoverLayerProps, PopoverOwnProps>;
|
|
265
|
+
/**
|
|
266
|
+
* The `Popover` component is used to display some content on top of another.
|
|
267
|
+
*
|
|
268
|
+
* @public
|
|
269
|
+
*/
|
|
270
|
+
declare function Popover(props: PopoverProps): React.JSX.Element;
|
|
271
|
+
/** @public */
|
|
272
|
+
declare const DEFAULT_TEXT_ELEMENT = "div";
|
|
273
|
+
/** @public */
|
|
274
|
+
type TextOwnProps = TextStyleProps & TextOverflowStyleProps;
|
|
275
|
+
/** @public */
|
|
276
|
+
type TextElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'li' | 'p' | 'span' | 'summary' | 'time' | ComponentType;
|
|
277
|
+
/** @public */
|
|
278
|
+
type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>;
|
|
279
|
+
/**
|
|
280
|
+
* The `Text` component is an agile, themed typographic element.
|
|
281
|
+
*
|
|
282
|
+
* @public
|
|
283
|
+
*/
|
|
284
|
+
declare function Text<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(props: TextProps<E>): React.JSX.Element;
|
|
285
|
+
/** @public */
|
|
286
|
+
declare const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
287
|
+
/** @public */
|
|
288
|
+
type TooltipOwnProps = LayerOwnProps & RadiusStyleProps & ShadowStyleProps & {
|
|
289
|
+
/**
|
|
290
|
+
* Whether the tooltip should animate in and out.
|
|
291
|
+
*
|
|
292
|
+
* @beta
|
|
293
|
+
* @defaultValue false
|
|
294
|
+
*/
|
|
295
|
+
animate?: boolean; /** @deprecated Will be removed in the next major version */
|
|
296
|
+
arrow?: boolean;
|
|
297
|
+
boundaryElement?: HTMLElement | null;
|
|
298
|
+
children?: React.ReactElement<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
299
|
+
content?: React.ReactNode;
|
|
300
|
+
/**
|
|
301
|
+
* Adds a delay to open or close the tooltip.
|
|
302
|
+
*
|
|
303
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
304
|
+
*
|
|
305
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
306
|
+
*
|
|
307
|
+
* @public
|
|
308
|
+
* @defaultValue 0
|
|
309
|
+
*/
|
|
310
|
+
delay?: Delay;
|
|
311
|
+
disabled?: boolean;
|
|
312
|
+
fallbackPlacements?: Placement[];
|
|
313
|
+
hotkeys?: string[];
|
|
314
|
+
placement?: Placement; /** Whether or not to render the tooltip in a portal element. */
|
|
315
|
+
portal?: boolean | string;
|
|
316
|
+
scheme?: ColorScheme;
|
|
317
|
+
text?: React.ReactNode;
|
|
318
|
+
textSize?: ResponsiveProp$1<FontTextSize>;
|
|
319
|
+
tone?: CardTone;
|
|
320
|
+
};
|
|
321
|
+
/** @public */
|
|
322
|
+
type TooltipElementType = 'div' | 'span' | ComponentType;
|
|
323
|
+
/** @public */
|
|
324
|
+
type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<TooltipOwnProps, E>;
|
|
325
|
+
/**
|
|
326
|
+
* Tooltips display information when hovering, focusing or tapping.
|
|
327
|
+
*
|
|
328
|
+
* @public
|
|
329
|
+
*/
|
|
330
|
+
declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(props: TooltipProps<E>): React.JSX.Element;
|
|
331
|
+
/** @public */
|
|
332
|
+
declare const DEFAULT_BUTTON_ELEMENT = "button";
|
|
333
|
+
/** @public */
|
|
334
|
+
interface ButtonOwnProps extends ButtonStyleProps {
|
|
335
|
+
'data-ui'?: string;
|
|
336
|
+
'fontSize'?: ResponsiveProp$1<FontTextSize>;
|
|
337
|
+
'icon'?: React.ElementType | React.ReactNode;
|
|
338
|
+
'iconRight'?: React.ElementType | React.ReactNode;
|
|
339
|
+
/** @beta Do not use in production, as this might change.*/
|
|
340
|
+
'loading'?: boolean;
|
|
341
|
+
'muted'?: boolean;
|
|
342
|
+
'selected'?: boolean;
|
|
343
|
+
'textAlign'?: TextOwnProps['align'];
|
|
344
|
+
'text'?: React.ReactNode;
|
|
345
|
+
'textOverflow'?: TextOwnProps['textOverflow'];
|
|
346
|
+
'textWeight'?: TextOwnProps['weight'];
|
|
347
|
+
'tooltip'?: Omit<TooltipProps<'div'>, 'as' | 'children'>;
|
|
162
348
|
}
|
|
163
|
-
|
|
164
349
|
/** @public */
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
350
|
+
type ButtonElementType = 'a' | 'button' | 'label' | ComponentType;
|
|
351
|
+
/** @public */
|
|
352
|
+
type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<ButtonOwnProps, E>;
|
|
353
|
+
/** @public */
|
|
354
|
+
declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(props: ButtonProps<E>): React.JSX.Element;
|
|
355
|
+
/** @public */
|
|
356
|
+
declare const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
357
|
+
/** @public */
|
|
358
|
+
type TextInputClearButtonProps = Omit<ButtonProps<'button'>, 'as' | 'onClick' | 'onMouseDown'>;
|
|
359
|
+
/** @public */
|
|
360
|
+
type TextInputOwnProps = InputStyleProps & {
|
|
361
|
+
/**
|
|
362
|
+
* @beta
|
|
363
|
+
*/
|
|
364
|
+
__unstable_disableFocusRing?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* @beta
|
|
367
|
+
*/
|
|
368
|
+
clearButton?: boolean | TextInputClearButtonProps;
|
|
369
|
+
customValidity?: string;
|
|
370
|
+
icon?: ElementType$1 | ReactNode;
|
|
371
|
+
iconRight?: ElementType$1 | ReactNode;
|
|
372
|
+
/**
|
|
373
|
+
* @beta
|
|
374
|
+
*/
|
|
375
|
+
onClear?: () => void;
|
|
376
|
+
prefix?: ReactNode;
|
|
377
|
+
suffix?: ReactNode;
|
|
378
|
+
/**
|
|
379
|
+
* @deprecated Use `fontWeight` instead
|
|
380
|
+
*/
|
|
381
|
+
weight?: FontWeight;
|
|
382
|
+
};
|
|
383
|
+
/** @public */
|
|
384
|
+
type TextInputElementType = 'input' | ComponentType;
|
|
385
|
+
/** @public */
|
|
386
|
+
type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<TextInputOwnProps, E>;
|
|
170
387
|
/**
|
|
171
|
-
*
|
|
388
|
+
* Single line text input.
|
|
389
|
+
*
|
|
390
|
+
* @public
|
|
172
391
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
392
|
+
declare function TextInput<E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT>(props: TextInputProps<E>): React.JSX.Element;
|
|
393
|
+
/** @public */
|
|
394
|
+
type AutocompleteOpenButtonProps = Omit<ButtonProps<'button'>, 'as'>;
|
|
395
|
+
/** @public */
|
|
396
|
+
interface BaseAutocompleteOption {
|
|
397
|
+
value: string;
|
|
175
398
|
}
|
|
176
|
-
|
|
177
399
|
/**
|
|
178
400
|
* @internal
|
|
179
401
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
402
|
+
interface AutocompleteState {
|
|
403
|
+
activeValue: string | null;
|
|
404
|
+
focused: boolean;
|
|
405
|
+
listFocused: boolean;
|
|
406
|
+
query: string | null;
|
|
407
|
+
value: string | null;
|
|
182
408
|
}
|
|
183
|
-
|
|
184
409
|
/**
|
|
185
410
|
* @internal
|
|
186
411
|
*/
|
|
187
|
-
|
|
188
|
-
type: 'root/
|
|
412
|
+
interface AutocompleteRootBlurMsg {
|
|
413
|
+
type: 'root/blur';
|
|
189
414
|
}
|
|
190
|
-
|
|
191
415
|
/**
|
|
192
416
|
* @internal
|
|
193
417
|
*/
|
|
194
|
-
|
|
195
|
-
type: 'root/
|
|
196
|
-
query: string | null
|
|
418
|
+
interface AutocompleteRootClearMsg {
|
|
419
|
+
type: 'root/clear';
|
|
197
420
|
}
|
|
198
|
-
|
|
199
421
|
/**
|
|
200
422
|
* @internal
|
|
201
423
|
*/
|
|
202
|
-
|
|
203
|
-
type: 'root/
|
|
204
|
-
value: string
|
|
205
|
-
listFocused?: boolean
|
|
424
|
+
interface AutocompleteRootEscapeMsg {
|
|
425
|
+
type: 'root/escape';
|
|
206
426
|
}
|
|
207
|
-
|
|
208
427
|
/**
|
|
209
428
|
* @internal
|
|
210
429
|
*/
|
|
211
|
-
|
|
212
|
-
type: 'root/
|
|
213
|
-
|
|
430
|
+
interface AutocompleteRootOpenMsg {
|
|
431
|
+
type: 'root/open';
|
|
432
|
+
query: string | null;
|
|
214
433
|
}
|
|
215
|
-
|
|
216
434
|
/**
|
|
217
435
|
* @internal
|
|
218
436
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
listFocused
|
|
223
|
-
query: string | null
|
|
224
|
-
value: string | null
|
|
437
|
+
interface AutocompleteRootSetActiveValueMsg {
|
|
438
|
+
type: 'root/setActiveValue';
|
|
439
|
+
value: string;
|
|
440
|
+
listFocused?: boolean;
|
|
225
441
|
}
|
|
226
|
-
|
|
227
442
|
/**
|
|
228
443
|
* @internal
|
|
229
444
|
*/
|
|
230
|
-
|
|
231
|
-
type: '
|
|
232
|
-
|
|
445
|
+
interface AutocompleteRootSetListFocusedMsg {
|
|
446
|
+
type: 'root/setListFocused';
|
|
447
|
+
listFocused: boolean;
|
|
233
448
|
}
|
|
234
|
-
|
|
235
449
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* @public
|
|
450
|
+
* @internal
|
|
239
451
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
/** @public */
|
|
245
|
-
export declare function AvatarCounter<
|
|
246
|
-
E extends AvatarCounterElementType = typeof DEFAULT_AVATAR_COUNTER_ELEMENT,
|
|
247
|
-
>(props: AvatarCounterProps<E>): React.JSX.Element
|
|
248
|
-
|
|
249
|
-
/** @public */
|
|
250
|
-
export declare type AvatarCounterElementType = 'button' | 'div' | 'span' | ComponentType
|
|
251
|
-
|
|
252
|
-
/** @public */
|
|
253
|
-
export declare interface AvatarCounterOwnProps {
|
|
254
|
-
count: number
|
|
255
|
-
size?: ResponsiveProp<AvatarSize>
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/** @public */
|
|
259
|
-
export declare type AvatarCounterProps<
|
|
260
|
-
E extends AvatarCounterElementType = AvatarCounterElementType,
|
|
261
|
-
> = Props<AvatarCounterOwnProps, E>
|
|
262
|
-
|
|
263
|
-
/** @public */
|
|
264
|
-
export declare type AvatarElementType = 'a' | 'button' | 'div' | 'span' | ComponentType
|
|
265
|
-
|
|
266
|
-
/** @public */
|
|
267
|
-
export declare interface AvatarOwnProps {
|
|
268
|
-
/** @beta */
|
|
269
|
-
__unstable_hideInnerStroke?: boolean
|
|
270
|
-
animateArrowFrom?: AvatarPosition
|
|
271
|
-
arrowPosition?: AvatarPosition
|
|
272
|
-
color?: AvatarColor
|
|
273
|
-
initials?: string
|
|
274
|
-
onImageLoadError?: (event: Error) => void
|
|
275
|
-
size?: ResponsiveProp<AvatarSize>
|
|
276
|
-
src?: string
|
|
277
|
-
title?: string
|
|
452
|
+
interface AutocompleteInputChangeMsg {
|
|
453
|
+
type: 'input/change';
|
|
454
|
+
query: string | null;
|
|
278
455
|
}
|
|
279
|
-
|
|
280
|
-
/** @public */
|
|
281
|
-
export declare type AvatarPosition = 'top' | 'bottom' | 'inside'
|
|
282
|
-
|
|
283
|
-
/** @public */
|
|
284
|
-
export declare type AvatarProps<E extends AvatarElementType = AvatarElementType> = Props<
|
|
285
|
-
AvatarOwnProps,
|
|
286
|
-
E
|
|
287
|
-
>
|
|
288
|
-
|
|
289
|
-
/** @public */
|
|
290
|
-
export declare function AvatarStack<
|
|
291
|
-
E extends AvatarStackElementType = typeof DEFAULT_AVATAR_STACK_ELEMENT,
|
|
292
|
-
>(props: AvatarStackProps<E>): React.JSX.Element
|
|
293
|
-
|
|
294
|
-
/** @public */
|
|
295
|
-
export declare type AvatarStackChild = ReactElement<AvatarProps<'div'>> | null | undefined | false
|
|
296
|
-
|
|
297
|
-
/** @public */
|
|
298
|
-
export declare type AvatarStackElementType = 'div' | 'span' | ComponentType
|
|
299
|
-
|
|
300
|
-
/** @public */
|
|
301
|
-
export declare type AvatarStackOwnProps = Omit<
|
|
302
|
-
BoxOwnProps,
|
|
303
|
-
'align' | 'alignItems' | 'display' | 'justify' | 'justifyContent'
|
|
304
|
-
> & {
|
|
305
|
-
children: AvatarStackChild | AvatarStackChild[]
|
|
306
|
-
maxLength?: number
|
|
307
|
-
size?: ResponsiveProp<AvatarSize>
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/** @public */
|
|
311
|
-
export declare type AvatarStackProps<E extends AvatarStackElementType = AvatarStackElementType> =
|
|
312
|
-
Props<AvatarStackOwnProps, E>
|
|
313
|
-
|
|
314
456
|
/**
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* @public
|
|
457
|
+
* @internal
|
|
318
458
|
*/
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
): React.JSX.Element
|
|
322
|
-
|
|
323
|
-
/** @public */
|
|
324
|
-
export declare type BadgeElementType = 'div' | 'span' | ComponentType
|
|
325
|
-
|
|
326
|
-
/** @public */
|
|
327
|
-
export declare interface BadgeOwnProps extends BadgeStyleProps {
|
|
328
|
-
fontSize?: ResponsiveProp<FontTextSize>
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/** @public */
|
|
332
|
-
export declare type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<
|
|
333
|
-
BadgeOwnProps,
|
|
334
|
-
E
|
|
335
|
-
>
|
|
336
|
-
|
|
337
|
-
/** @public */
|
|
338
|
-
export declare interface BaseAutocompleteOption {
|
|
339
|
-
value: string
|
|
459
|
+
interface AutocompleteInputFoocusMsg {
|
|
460
|
+
type: 'input/focus';
|
|
340
461
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
props: BoundaryElementProviderProps,
|
|
348
|
-
): React.JSX.Element
|
|
349
|
-
|
|
350
|
-
/** @public */
|
|
351
|
-
export declare interface BoundaryElementProviderProps {
|
|
352
|
-
children: ReactNode
|
|
353
|
-
element: HTMLElement | null
|
|
462
|
+
/**
|
|
463
|
+
* @internal
|
|
464
|
+
*/
|
|
465
|
+
interface AutocompleteValueChangeMsg {
|
|
466
|
+
type: 'value/change';
|
|
467
|
+
value: string | null;
|
|
354
468
|
}
|
|
355
|
-
|
|
356
469
|
/**
|
|
357
|
-
*
|
|
358
|
-
|
|
470
|
+
* @internal
|
|
471
|
+
*/
|
|
472
|
+
type AutocompleteMsg = AutocompleteRootBlurMsg | AutocompleteRootClearMsg | AutocompleteRootEscapeMsg | AutocompleteRootOpenMsg | AutocompleteRootSetActiveValueMsg | AutocompleteRootSetListFocusedMsg | AutocompleteInputChangeMsg | AutocompleteInputFoocusMsg | AutocompleteValueChangeMsg;
|
|
473
|
+
/** @public */
|
|
474
|
+
declare const DEFAULT_AUTOCOMPLETE_ELEMENT = "input";
|
|
475
|
+
/** @public */
|
|
476
|
+
type AutocompleteOwnProps<Option extends BaseAutocompleteOption = BaseAutocompleteOption> = TextInputOwnProps & {
|
|
477
|
+
border?: boolean;
|
|
478
|
+
customValidity?: string;
|
|
479
|
+
filterOption?: (query: string, option: Option) => boolean;
|
|
480
|
+
icon?: ElementType$1 | ReactNode; /** @beta */
|
|
481
|
+
listBox?: BoxOwnProps;
|
|
482
|
+
loading?: boolean;
|
|
483
|
+
onChange?: (value: string) => void;
|
|
484
|
+
onQueryChange?: (query: string | null) => void;
|
|
485
|
+
onSelect?: (value: string) => void; /** @beta */
|
|
486
|
+
openButton?: boolean | AutocompleteOpenButtonProps; /** @beta */
|
|
487
|
+
openOnFocus?: boolean; /** The options to render. */
|
|
488
|
+
options?: Option[];
|
|
489
|
+
padding?: ResponsiveProp$1<Space>;
|
|
490
|
+
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'>;
|
|
491
|
+
prefix?: ReactNode;
|
|
492
|
+
radius?: Radius | Radius[]; /** @beta */
|
|
493
|
+
relatedElements?: HTMLElement[]; /** The callback function for rendering each option. */
|
|
494
|
+
renderOption?: (option: Option) => React.JSX.Element; /** @beta */
|
|
495
|
+
renderPopover?: (props: {
|
|
496
|
+
content: React.JSX.Element | null;
|
|
497
|
+
hidden: boolean;
|
|
498
|
+
inputElement: HTMLInputElement | null;
|
|
499
|
+
onMouseEnter: () => void;
|
|
500
|
+
onMouseLeave: () => void;
|
|
501
|
+
}, ref: ForwardedRef<HTMLDivElement>) => ReactNode;
|
|
502
|
+
renderValue?: (value: string, option?: Option) => string;
|
|
503
|
+
suffix?: ReactNode;
|
|
504
|
+
value?: string;
|
|
505
|
+
};
|
|
506
|
+
/** @public */
|
|
507
|
+
type AutocompleteElementType = 'input' | ComponentType;
|
|
508
|
+
/** @public */
|
|
509
|
+
type AutocompleteProps<E extends AutocompleteElementType = AutocompleteElementType, Option extends BaseAutocompleteOption = BaseAutocompleteOption> = Props<AutocompleteOwnProps<Option>, E>;
|
|
510
|
+
/**
|
|
511
|
+
* The Autocomplete component is typically used for search components.
|
|
512
|
+
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
359
513
|
*
|
|
360
514
|
* @public
|
|
361
515
|
*/
|
|
362
|
-
|
|
363
|
-
props: BoxProps<E>,
|
|
364
|
-
): React.JSX.Element
|
|
365
|
-
|
|
366
|
-
/** @public */
|
|
367
|
-
export declare type BoxElementType =
|
|
368
|
-
| 'a'
|
|
369
|
-
| 'article'
|
|
370
|
-
| 'aside'
|
|
371
|
-
| 'blockquote'
|
|
372
|
-
| 'body'
|
|
373
|
-
| 'button'
|
|
374
|
-
| 'details'
|
|
375
|
-
| 'div'
|
|
376
|
-
| 'header'
|
|
377
|
-
| 'fieldset'
|
|
378
|
-
| 'figure'
|
|
379
|
-
| 'figcaption'
|
|
380
|
-
| 'footer'
|
|
381
|
-
| 'form'
|
|
382
|
-
| 'html'
|
|
383
|
-
| 'iframe'
|
|
384
|
-
| 'kbd'
|
|
385
|
-
| 'label'
|
|
386
|
-
| 'legend'
|
|
387
|
-
| 'li'
|
|
388
|
-
| 'main'
|
|
389
|
-
| 'nav'
|
|
390
|
-
| 'ol'
|
|
391
|
-
| 'pre'
|
|
392
|
-
| 'section'
|
|
393
|
-
| 'span'
|
|
394
|
-
| 'summary'
|
|
395
|
-
| 'table'
|
|
396
|
-
| 'tbody'
|
|
397
|
-
| 'td'
|
|
398
|
-
| 'tfoot'
|
|
399
|
-
| 'th'
|
|
400
|
-
| 'thead'
|
|
401
|
-
| 'tr'
|
|
402
|
-
| 'ul'
|
|
403
|
-
| ComponentType
|
|
404
|
-
|
|
405
|
-
/** @public */
|
|
406
|
-
export declare type BoxOwnProps = BoxStyleProps
|
|
407
|
-
|
|
408
|
-
/** @public */
|
|
409
|
-
export declare type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>
|
|
410
|
-
|
|
516
|
+
declare function Autocomplete<E extends AutocompleteElementType = typeof DEFAULT_AUTOCOMPLETE_ELEMENT, Option extends BaseAutocompleteOption = BaseAutocompleteOption>(props: AutocompleteProps<E, Option>): React.JSX.Element;
|
|
411
517
|
/** @beta */
|
|
412
|
-
|
|
413
|
-
E extends BreadcrumbsElementType = typeof DEFAULT_BREADCRUMBS_ELEMENT,
|
|
414
|
-
>(props: BreadcrumbsProps<E>): React.JSX.Element
|
|
415
|
-
|
|
518
|
+
declare const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
|
|
416
519
|
/** @beta */
|
|
417
|
-
|
|
418
|
-
|
|
520
|
+
type BreadcrumbsOwnProps = GapStyleProps & {
|
|
521
|
+
expandButton?: Omit<ButtonProps, 'as' | 'onClick' | 'selected'>;
|
|
522
|
+
maxLength?: number;
|
|
523
|
+
popover?: PopoverProps;
|
|
524
|
+
separator?: ReactNode;
|
|
525
|
+
};
|
|
419
526
|
/** @beta */
|
|
420
|
-
|
|
421
|
-
expandButton?: Omit<ButtonProps, 'as' | 'onClick' | 'selected'>
|
|
422
|
-
maxLength?: number
|
|
423
|
-
popover?: PopoverProps
|
|
424
|
-
separator?: ReactNode
|
|
425
|
-
}
|
|
426
|
-
|
|
527
|
+
type BreadcrumbsElementType = 'div' | 'nav' | ComponentType;
|
|
427
528
|
/** @beta */
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
export {BREAKPOINTS}
|
|
432
|
-
|
|
433
|
-
/** @public */
|
|
434
|
-
export declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(
|
|
435
|
-
props: ButtonProps<E>,
|
|
436
|
-
): React.JSX.Element
|
|
437
|
-
|
|
438
|
-
/** @public */
|
|
439
|
-
export declare type ButtonElementType = 'a' | 'button' | 'label' | ComponentType
|
|
440
|
-
|
|
441
|
-
/** @public */
|
|
442
|
-
export declare interface ButtonOwnProps extends ButtonStyleProps {
|
|
443
|
-
'data-ui'?: string
|
|
444
|
-
'fontSize'?: ResponsiveProp<FontTextSize>
|
|
445
|
-
'icon'?: React.ElementType | React.ReactNode
|
|
446
|
-
'iconRight'?: React.ElementType | React.ReactNode
|
|
447
|
-
/** @beta Do not use in production, as this might change.*/
|
|
448
|
-
'loading'?: boolean
|
|
449
|
-
'muted'?: boolean
|
|
450
|
-
'selected'?: boolean
|
|
451
|
-
'textAlign'?: TextOwnProps['align']
|
|
452
|
-
'text'?: React.ReactNode
|
|
453
|
-
'textOverflow'?: TextOwnProps['textOverflow']
|
|
454
|
-
'textWeight'?: TextOwnProps['weight']
|
|
455
|
-
'tooltip'?: Omit<TooltipProps<'div'>, 'as' | 'children'>
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/** @public */
|
|
459
|
-
export declare type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<
|
|
460
|
-
ButtonOwnProps,
|
|
461
|
-
E
|
|
462
|
-
>
|
|
463
|
-
|
|
529
|
+
type BreadcrumbsProps<E extends BreadcrumbsElementType = BreadcrumbsElementType> = Props<BreadcrumbsOwnProps, E>;
|
|
530
|
+
/** @beta */
|
|
531
|
+
declare function Breadcrumbs<E extends BreadcrumbsElementType = typeof DEFAULT_BREADCRUMBS_ELEMENT>(props: BreadcrumbsProps<E>): React.JSX.Element;
|
|
464
532
|
/** @public */
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
469
|
-
* Components within a `Card` inherit its colors.
|
|
470
|
-
*
|
|
471
|
-
* @public
|
|
472
|
-
*/
|
|
473
|
-
export declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(
|
|
474
|
-
props: CardProps<E>,
|
|
475
|
-
): React.JSX.Element
|
|
476
|
-
|
|
477
|
-
/** @internal */
|
|
478
|
-
export declare type _CardCompatProviderComponent = ComponentType_2<{
|
|
479
|
-
children?: ReactNode
|
|
480
|
-
tone: CardTone | 'inherit'
|
|
481
|
-
scheme: ColorScheme
|
|
482
|
-
}>
|
|
483
|
-
|
|
484
|
-
/** @public */
|
|
485
|
-
export declare interface CardContextValue {
|
|
486
|
-
tone: CardTone
|
|
487
|
-
scheme: ColorScheme
|
|
488
|
-
}
|
|
489
|
-
|
|
533
|
+
type DialogPosition = 'absolute' | 'fixed';
|
|
490
534
|
/** @public */
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
/** @internal */
|
|
494
|
-
export declare interface _CardInternalContextValue {
|
|
495
|
-
CompatProvider?: _CardCompatProviderComponent
|
|
496
|
-
root: boolean
|
|
497
|
-
}
|
|
498
|
-
|
|
535
|
+
declare const DEFAULT_DIALOG_ELEMENT = "div";
|
|
499
536
|
/** @public */
|
|
500
|
-
|
|
537
|
+
interface DialogOwnProps extends Omit<ContainerStyleProps, 'id' | 'position' | 'radius' | 'shadow'>, Omit<LayerOwnProps, 'id' | 'position' | 'radius' | 'shadow' | 'width'> {
|
|
501
538
|
/**
|
|
502
|
-
* Do not use in production.
|
|
503
539
|
* @beta
|
|
504
|
-
* @deprecated Use `__unstable_pattern` instead.
|
|
505
540
|
*/
|
|
506
|
-
|
|
541
|
+
__unstable_autoFocus?: boolean;
|
|
507
542
|
/**
|
|
508
|
-
* Do not use in production.
|
|
509
543
|
* @beta
|
|
510
544
|
*/
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
545
|
+
__unstable_hideCloseButton?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Whether the dialog should animate in on mount.
|
|
548
|
+
*
|
|
549
|
+
* @beta
|
|
550
|
+
* @defaultValue false
|
|
551
|
+
*/
|
|
552
|
+
animate?: boolean;
|
|
553
|
+
cardRadius?: ResponsiveProp$1<Radius>;
|
|
554
|
+
contentRef?: ForwardedRef<HTMLDivElement>;
|
|
555
|
+
footer?: ReactNode;
|
|
556
|
+
header?: ReactNode;
|
|
557
|
+
id: string;
|
|
558
|
+
/** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
|
|
559
|
+
onActivate?: LayerProps['onActivate'];
|
|
560
|
+
onClickOutside?: () => void;
|
|
561
|
+
onClose?: () => void;
|
|
562
|
+
open?: boolean;
|
|
563
|
+
portal?: string;
|
|
564
|
+
position?: ResponsiveProp$1<DialogPosition>;
|
|
565
|
+
/**
|
|
566
|
+
* @deprecated Not in use – will be removed in the next major version.
|
|
567
|
+
*/
|
|
568
|
+
shadow?: ResponsiveProp$1<Shadow>;
|
|
517
569
|
}
|
|
518
|
-
|
|
519
570
|
/** @public */
|
|
520
|
-
|
|
521
|
-
|
|
571
|
+
type DialogElementType = 'div' | 'span' | ComponentType;
|
|
522
572
|
/** @public */
|
|
523
|
-
|
|
524
|
-
children?: ReactNode
|
|
525
|
-
tone: CardTone
|
|
526
|
-
scheme: ColorScheme
|
|
527
|
-
}): React.JSX.Element
|
|
528
|
-
|
|
573
|
+
type DialogProps<E extends DialogElementType = DialogElementType> = Props<DialogOwnProps, E>;
|
|
529
574
|
/**
|
|
530
|
-
*
|
|
575
|
+
* The Dialog component.
|
|
531
576
|
*
|
|
532
577
|
* @public
|
|
533
578
|
*/
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
indeterminate?: boolean
|
|
544
|
-
customValidity?: string
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/** @public */
|
|
548
|
-
export declare type CheckboxProps<E extends CheckboxElementType = CheckboxElementType> = Props<
|
|
549
|
-
CheckboxOwnProps,
|
|
550
|
-
E
|
|
551
|
-
>
|
|
552
|
-
|
|
553
|
-
/** @public */
|
|
554
|
-
export declare type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[]
|
|
555
|
-
|
|
556
|
-
/** @public */
|
|
557
|
-
export declare type ClickOutsideEventListener = (event: MouseEvent) => void
|
|
558
|
-
|
|
559
|
-
/** @public */
|
|
560
|
-
export declare function Code<E extends CodeElementType = typeof DEFAULT_CODE_ELEMENT>(
|
|
561
|
-
props: CodeProps<E>,
|
|
562
|
-
): React.JSX.Element
|
|
563
|
-
|
|
564
|
-
/** @public */
|
|
565
|
-
export declare type CodeElementType = 'div' | 'pre' | ComponentType
|
|
566
|
-
|
|
567
|
-
/** @public */
|
|
568
|
-
export declare type CodeOwnProps = CodeStyleProps & {
|
|
569
|
-
/** Define the language to use for syntax highlighting. */
|
|
570
|
-
language?: string
|
|
579
|
+
declare function Dialog<E extends DialogElementType = typeof DEFAULT_DIALOG_ELEMENT>(props: DialogProps<E>): React.JSX.Element;
|
|
580
|
+
/**
|
|
581
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
582
|
+
* @beta
|
|
583
|
+
*/
|
|
584
|
+
interface DialogContextValue {
|
|
585
|
+
version: 0.0;
|
|
586
|
+
position?: ResponsiveProp$1<DialogPosition>;
|
|
587
|
+
zOffset?: ResponsiveProp$1<number>;
|
|
571
588
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
589
|
+
/**
|
|
590
|
+
* @internal
|
|
591
|
+
*/
|
|
592
|
+
declare const DialogContext: Context<DialogContextValue>;
|
|
576
593
|
/**
|
|
577
594
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
578
595
|
* @beta
|
|
579
596
|
*/
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
/** @beta */
|
|
585
|
-
export declare type CodeSkeletonElementType = SkeletonElementType
|
|
586
|
-
|
|
587
|
-
/** @beta */
|
|
588
|
-
export declare type CodeSkeletonOwnProps = SkeletonOwnProps & {
|
|
589
|
-
size?: ResponsiveProp<FontCodeSize>
|
|
597
|
+
interface DialogProviderProps {
|
|
598
|
+
children?: ReactNode;
|
|
599
|
+
position?: ResponsiveProp$1<DialogPosition>;
|
|
600
|
+
zOffset?: ResponsiveProp$1<number>;
|
|
590
601
|
}
|
|
591
|
-
|
|
592
602
|
/**
|
|
593
603
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
594
604
|
* @beta
|
|
595
605
|
*/
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
606
|
+
declare function DialogProvider(props: DialogProviderProps): React.JSX.Element;
|
|
607
|
+
/**
|
|
608
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
609
|
+
* @beta
|
|
610
|
+
*/
|
|
611
|
+
declare function useDialog(): DialogContextValue;
|
|
612
|
+
/** @public */
|
|
613
|
+
declare const DEFAULT_HOTKEYS_ELEMENT = "kbd";
|
|
599
614
|
/** @public */
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
615
|
+
interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
|
|
616
|
+
/** @deprecated No longer supported. */
|
|
617
|
+
fontSize?: never;
|
|
618
|
+
/** @deprecated No longer supported. */
|
|
619
|
+
padding?: never;
|
|
620
|
+
keys: string[];
|
|
621
|
+
}
|
|
622
|
+
/** @public */
|
|
623
|
+
type HotkeysElementType = 'kbd' | ComponentType;
|
|
624
|
+
/** @public */
|
|
625
|
+
type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<HotkeysOwnProps, E>;
|
|
605
626
|
/**
|
|
606
|
-
*
|
|
627
|
+
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
628
|
+
*
|
|
629
|
+
* @example
|
|
630
|
+
* ```tsx
|
|
631
|
+
* import {Hotkeys} from '@sanity/ui'
|
|
632
|
+
*
|
|
633
|
+
* <Hotkeys keys={['⌘', 'K']} />
|
|
634
|
+
* ```
|
|
607
635
|
*
|
|
608
636
|
* @public
|
|
609
637
|
*/
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
638
|
+
declare function Hotkeys<E extends HotkeysElementType = typeof DEFAULT_HOTKEYS_ELEMENT>(props: HotkeysProps<E>): React.JSX.Element | undefined;
|
|
639
|
+
/** @public */
|
|
640
|
+
declare const DEFAULT_MENU_ELEMENT = "div";
|
|
614
641
|
/** @public */
|
|
615
|
-
|
|
616
|
-
|
|
642
|
+
type MenuOwnProps = PaddingStyleProps & {
|
|
643
|
+
'gap'?: ResponsiveProp$1<Space>;
|
|
644
|
+
'onClickOutside'?: (event: MouseEvent) => void;
|
|
645
|
+
'onEscape'?: () => void;
|
|
646
|
+
'onItemClick'?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
647
|
+
'onItemSelect'?: (index: number) => void;
|
|
648
|
+
'originElement'?: HTMLElement | null;
|
|
649
|
+
'registerElement'?: (el: HTMLElement) => () => void;
|
|
650
|
+
'shouldFocus'?: 'first' | 'last' | null;
|
|
651
|
+
'aria-labelledby'?: string;
|
|
652
|
+
};
|
|
617
653
|
/** @public */
|
|
618
|
-
|
|
619
|
-
|
|
654
|
+
type MenuElementType = 'div' | 'span' | ComponentType;
|
|
620
655
|
/** @public */
|
|
621
|
-
|
|
622
|
-
ContainerOwnProps,
|
|
623
|
-
E
|
|
624
|
-
>
|
|
625
|
-
|
|
656
|
+
type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>;
|
|
626
657
|
/**
|
|
627
|
-
*
|
|
658
|
+
* The `Menu` component is a building block for application menus.
|
|
659
|
+
*
|
|
660
|
+
* @public
|
|
628
661
|
*/
|
|
629
|
-
|
|
630
|
-
|
|
662
|
+
declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(props: MenuProps<E>): React.JSX.Element;
|
|
631
663
|
/** @public */
|
|
632
|
-
|
|
633
|
-
|
|
664
|
+
type MenuButtonProps = {
|
|
665
|
+
/**
|
|
666
|
+
* @beta Do not use in production.
|
|
667
|
+
*/
|
|
668
|
+
__unstable_disableRestoreFocusOnClose?: boolean;
|
|
669
|
+
button: ReactElement<ButtonProps>;
|
|
670
|
+
id: string;
|
|
671
|
+
menu?: ReactElement;
|
|
672
|
+
onClose?: () => void;
|
|
673
|
+
onOpen?: () => void;
|
|
674
|
+
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
675
|
+
ref?: ForwardedRef<HTMLButtonElement | null>;
|
|
676
|
+
};
|
|
677
|
+
/**
|
|
678
|
+
* The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
|
|
679
|
+
*
|
|
680
|
+
* @public
|
|
681
|
+
*/
|
|
682
|
+
declare function MenuButton(props: MenuButtonProps): React.JSX.Element;
|
|
634
683
|
/** @public */
|
|
635
|
-
|
|
636
|
-
|
|
684
|
+
declare const DEFAULT_MENU_DIVIDER_ELEMENT = "hr";
|
|
637
685
|
/** @public */
|
|
638
|
-
|
|
639
|
-
|
|
686
|
+
type MenuDividerOwnProps = {};
|
|
640
687
|
/** @public */
|
|
641
|
-
|
|
642
|
-
|
|
688
|
+
type MenuDividerElementType = 'div' | 'hr' | 'span' | ComponentType;
|
|
643
689
|
/** @public */
|
|
644
|
-
|
|
645
|
-
|
|
690
|
+
type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> = Props<MenuDividerOwnProps, E>;
|
|
646
691
|
/** @public */
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
/** @beta */
|
|
650
|
-
export declare const DEFAULT_BREADCRUMBS_ELEMENT = 'nav'
|
|
651
|
-
|
|
692
|
+
declare function MenuDivider<E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT>(props: MenuDividerProps<E>): React.JSX.Element;
|
|
652
693
|
/** @public */
|
|
653
|
-
|
|
654
|
-
|
|
694
|
+
declare const DEFAULT_MENU_GROUP_ELEMENT = "button";
|
|
655
695
|
/** @public */
|
|
656
|
-
|
|
657
|
-
|
|
696
|
+
type MenuGroupOwnProps = RadiusStyleProps & {
|
|
697
|
+
disabled?: boolean;
|
|
698
|
+
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
699
|
+
gap?: ResponsiveProp$1<Space>;
|
|
700
|
+
icon?: ElementType$1 | ReactNode;
|
|
701
|
+
menu?: Omit<MenuProps<typeof DEFAULT_MENU_ELEMENT>, 'onClickOutside' | 'onEscape' | 'onItemClick' | 'onKeyDown' | 'onMouseEnter' | 'registerElement' | 'shouldFocus' | 'onBlurCapture'>;
|
|
702
|
+
padding?: ResponsiveProp$1<Space>;
|
|
703
|
+
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
704
|
+
text?: ReactNode;
|
|
705
|
+
tone?: ElementTone;
|
|
706
|
+
};
|
|
658
707
|
/** @public */
|
|
659
|
-
|
|
660
|
-
|
|
708
|
+
type MenuGroupElementType = 'button' | ComponentType;
|
|
661
709
|
/** @public */
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
/** @beta */
|
|
665
|
-
export declare const DEFAULT_CODE_SKELETON_ELEMENT = 'div'
|
|
666
|
-
|
|
710
|
+
type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<MenuGroupOwnProps, E>;
|
|
667
711
|
/** @public */
|
|
668
|
-
|
|
669
|
-
|
|
712
|
+
declare function MenuGroup<E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT>(props: MenuGroupProps<E>): React.JSX.Element;
|
|
670
713
|
/** @public */
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/** @beta */
|
|
674
|
-
export declare const DEFAULT_ELEMENT_QUERY_ELEMENT = 'div'
|
|
675
|
-
|
|
714
|
+
declare const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
676
715
|
/** @public */
|
|
677
|
-
|
|
678
|
-
|
|
716
|
+
type MenuItemOwnProps = GapStyleProps & PaddingStyleProps & RadiusStyleProps & {
|
|
717
|
+
disabled?: boolean;
|
|
718
|
+
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
719
|
+
hotkeys?: string[];
|
|
720
|
+
icon?: ElementType$1 | ReactNode;
|
|
721
|
+
iconRight?: ElementType$1 | ReactNode;
|
|
722
|
+
pressed?: boolean;
|
|
723
|
+
selected?: boolean;
|
|
724
|
+
text?: ReactNode;
|
|
725
|
+
tone?: ElementTone;
|
|
726
|
+
};
|
|
679
727
|
/** @public */
|
|
680
|
-
|
|
681
|
-
|
|
728
|
+
type MenuItemElementType = 'button' | 'a' | ComponentType;
|
|
682
729
|
/** @public */
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
/** @beta */
|
|
686
|
-
export declare const DEFAULT_HEADING_SKELETON_ELEMENT = 'div'
|
|
687
|
-
|
|
730
|
+
type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Props<MenuItemOwnProps, E>;
|
|
688
731
|
/** @public */
|
|
689
|
-
|
|
690
|
-
|
|
732
|
+
declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(props: MenuItemProps<E>): React.JSX.Element;
|
|
691
733
|
/** @public */
|
|
692
|
-
|
|
693
|
-
|
|
734
|
+
declare const DEFAULT_TAB_ELEMENT = "button";
|
|
694
735
|
/** @public */
|
|
695
|
-
|
|
696
|
-
|
|
736
|
+
interface TabOwnProps extends ButtonOwnProps {
|
|
737
|
+
/**
|
|
738
|
+
* The `id` of the corresponding `TabPanel` component.
|
|
739
|
+
*/
|
|
740
|
+
'aria-controls': string;
|
|
741
|
+
'id': string;
|
|
742
|
+
'focused'?: boolean;
|
|
743
|
+
'label'?: React.ReactNode;
|
|
744
|
+
'onActivate'?: () => void;
|
|
745
|
+
}
|
|
697
746
|
/** @public */
|
|
698
|
-
|
|
699
|
-
|
|
747
|
+
type TabElementType = 'button' | ComponentType;
|
|
700
748
|
/** @public */
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
/** @beta */
|
|
704
|
-
export declare const DEFAULT_LABEL_SKELETON_ELEMENT = 'div'
|
|
705
|
-
|
|
749
|
+
type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>;
|
|
706
750
|
/** @public */
|
|
707
|
-
|
|
708
|
-
|
|
751
|
+
declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(props: TabProps<E>): React.JSX.Element;
|
|
709
752
|
/** @public */
|
|
710
|
-
|
|
711
|
-
|
|
753
|
+
declare const DEFAULT_FLEX_ELEMENT = "div";
|
|
712
754
|
/** @public */
|
|
713
|
-
|
|
714
|
-
|
|
755
|
+
type FlexOwnProps = FlexStyleProps;
|
|
715
756
|
/** @public */
|
|
716
|
-
|
|
717
|
-
|
|
757
|
+
type FlexElementType = BoxElementType;
|
|
718
758
|
/** @public */
|
|
719
|
-
|
|
720
|
-
|
|
759
|
+
type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>;
|
|
760
|
+
/**
|
|
761
|
+
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
762
|
+
*
|
|
763
|
+
* @public
|
|
764
|
+
*/
|
|
765
|
+
declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(props: FlexProps<E>): React.JSX.Element;
|
|
721
766
|
/** @public */
|
|
722
|
-
|
|
723
|
-
|
|
767
|
+
declare const DEFAULT_TAB_LIST_ELEMENT = "div";
|
|
724
768
|
/** @public */
|
|
725
|
-
|
|
726
|
-
|
|
769
|
+
interface TabListOwnProps extends FlexOwnProps {
|
|
770
|
+
autoActivate?: boolean;
|
|
771
|
+
}
|
|
727
772
|
/** @public */
|
|
728
|
-
|
|
729
|
-
|
|
773
|
+
type TabListElementType = 'div' | 'span' | ComponentType;
|
|
730
774
|
/** @public */
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
/** @beta */
|
|
734
|
-
export declare const DEFAULT_SKELETON_ELEMENT = 'div'
|
|
735
|
-
|
|
775
|
+
type TabListProps<E extends TabListElementType = TabListElementType> = Omit<Props<TabListOwnProps, E>, 'role'>;
|
|
736
776
|
/** @public */
|
|
737
|
-
|
|
738
|
-
|
|
777
|
+
declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(props: TabListProps<E>): React.JSX.Element;
|
|
739
778
|
/** @public */
|
|
740
|
-
|
|
741
|
-
|
|
779
|
+
declare const DEFAULT_TAB_PANEL_ELEMENT = "div";
|
|
742
780
|
/** @public */
|
|
743
|
-
|
|
744
|
-
|
|
781
|
+
type TabPanelOwnProps = BoxOwnProps & {
|
|
782
|
+
/**
|
|
783
|
+
* The `id` of the corresponding `Tab` component.
|
|
784
|
+
*/
|
|
785
|
+
'aria-labelledby': string;
|
|
786
|
+
'id': string;
|
|
787
|
+
};
|
|
745
788
|
/** @public */
|
|
746
|
-
|
|
747
|
-
|
|
789
|
+
type TabPanelElementType = 'div' | 'span' | ComponentType;
|
|
748
790
|
/** @public */
|
|
749
|
-
|
|
750
|
-
|
|
791
|
+
type TabPanelProps<E extends TabPanelElementType = TabPanelElementType> = Props<TabPanelOwnProps, E>;
|
|
751
792
|
/** @public */
|
|
752
|
-
|
|
753
|
-
|
|
793
|
+
declare function TabPanel<E extends TabPanelElementType = typeof DEFAULT_TAB_PANEL_ELEMENT>(props: TabPanelProps<E>): React.JSX.Element;
|
|
794
|
+
/** @internal */
|
|
795
|
+
declare const DEFAULT_TOAST_ELEMENT = "li";
|
|
796
|
+
/** @internal */
|
|
797
|
+
type ToastOwnProps = RadiusStyleProps & {
|
|
798
|
+
closable?: boolean;
|
|
799
|
+
description?: ReactNode;
|
|
800
|
+
onClose?: () => void;
|
|
801
|
+
title?: ReactNode;
|
|
802
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
803
|
+
duration?: number;
|
|
804
|
+
};
|
|
805
|
+
/** @internal */
|
|
806
|
+
type ToastElementType = 'li' | ComponentType;
|
|
807
|
+
/** @internal */
|
|
808
|
+
type ToastProps<E extends ToastElementType = ToastElementType> = Props<ToastOwnProps, E>;
|
|
809
|
+
/**
|
|
810
|
+
* The `Toast` component gives feedback to users when an action has taken place.
|
|
811
|
+
*
|
|
812
|
+
* Toasts can be closed with a close button, or auto-dismiss when the duration expires.
|
|
813
|
+
*
|
|
814
|
+
* @internal
|
|
815
|
+
*/
|
|
816
|
+
declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(props: ToastProps<E>): React.JSX.Element;
|
|
817
|
+
/** @internal */
|
|
818
|
+
type ToastLayerOwnProps = GapStyleProps & PaddingStyleProps;
|
|
819
|
+
/** @internal */
|
|
820
|
+
type ToastLayerElementType = 'ul' | ComponentType;
|
|
821
|
+
/** @internal */
|
|
822
|
+
type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementType> = Props<ToastLayerOwnProps, E>;
|
|
754
823
|
/** @public */
|
|
755
|
-
|
|
756
|
-
|
|
824
|
+
interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
825
|
+
children?: React.ReactNode;
|
|
826
|
+
zOffset?: ResponsiveProp$1<number>;
|
|
827
|
+
}
|
|
757
828
|
/** @public */
|
|
758
|
-
|
|
759
|
-
|
|
829
|
+
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
760
830
|
/** @public */
|
|
761
|
-
|
|
762
|
-
|
|
831
|
+
interface ToastParams {
|
|
832
|
+
closable?: boolean;
|
|
833
|
+
description?: ReactNode;
|
|
834
|
+
duration?: number;
|
|
835
|
+
id?: string;
|
|
836
|
+
onClose?: () => void;
|
|
837
|
+
title?: ReactNode;
|
|
838
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
839
|
+
}
|
|
763
840
|
/** @public */
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
841
|
+
interface ToastContextValue {
|
|
842
|
+
version: 0.0;
|
|
843
|
+
/**
|
|
844
|
+
* Creates or updates a toast notification.
|
|
845
|
+
* If a toast with the same ID already exists, it will be updated.
|
|
846
|
+
* If an ID is not provided, a random one will be generated.
|
|
847
|
+
* The returned ID can be used to programatically update a toast.
|
|
848
|
+
*/
|
|
849
|
+
push: (params: ToastParams) => string;
|
|
850
|
+
}
|
|
772
851
|
/** @public */
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
/** @
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
/** @beta */
|
|
782
|
-
export declare const DEFAULT_VIRTUAL_LIST_ELEMENT = 'div'
|
|
783
|
-
|
|
852
|
+
declare function useToast(): ToastContextValue;
|
|
853
|
+
/** @public */
|
|
854
|
+
declare const DEFAULT_STACK_ELEMENT = "div";
|
|
855
|
+
/** @public */
|
|
856
|
+
type StackOwnProps = StackStyleProps;
|
|
857
|
+
/** @public */
|
|
858
|
+
type StackElementType = BoxElementType;
|
|
784
859
|
/** @public */
|
|
785
|
-
|
|
786
|
-
| number
|
|
787
|
-
| Partial<{
|
|
788
|
-
open: number
|
|
789
|
-
close: number
|
|
790
|
-
}>
|
|
791
|
-
|
|
860
|
+
type StackProps<E extends StackElementType = StackElementType> = Props<StackOwnProps, E>;
|
|
792
861
|
/**
|
|
793
|
-
* The
|
|
862
|
+
* The `Stack` component is used to place elements on top of each other.
|
|
794
863
|
*
|
|
795
864
|
* @public
|
|
796
865
|
*/
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
866
|
+
declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(props: StackProps<E>): React.JSX.Element;
|
|
867
|
+
/** @beta */
|
|
868
|
+
declare const DEFAULT_TREE_ELEMENT = "div";
|
|
801
869
|
/**
|
|
802
|
-
*
|
|
870
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
871
|
+
* @beta
|
|
803
872
|
*/
|
|
804
|
-
|
|
805
|
-
|
|
873
|
+
type TreeOwnProps = Omit<StackOwnProps, 'position'>;
|
|
874
|
+
/** @beta */
|
|
875
|
+
type TreeElementType = 'div' | ComponentType;
|
|
876
|
+
/** @beta */
|
|
877
|
+
type TreeProps<E extends TreeElementType = TreeElementType> = Props<TreeOwnProps, E>;
|
|
806
878
|
/**
|
|
807
879
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
808
880
|
* @beta
|
|
809
881
|
*/
|
|
810
|
-
|
|
811
|
-
version: 0.0
|
|
812
|
-
position?: ResponsiveProp<DialogPosition>
|
|
813
|
-
zOffset?: ResponsiveProp<number>
|
|
814
|
-
}
|
|
815
|
-
|
|
882
|
+
declare function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(props: TreeProps<E>): React.JSX.Element;
|
|
816
883
|
/** @public */
|
|
817
|
-
|
|
818
|
-
|
|
884
|
+
declare const DEFAULT_SELECTABLE_ELEMENT = "button";
|
|
819
885
|
/** @public */
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
Omit<ContainerStyleProps, 'id' | 'position' | 'radius' | 'shadow'>,
|
|
823
|
-
Omit<LayerOwnProps, 'id' | 'position' | 'radius' | 'shadow' | 'width'> {
|
|
824
|
-
/**
|
|
825
|
-
* @beta
|
|
826
|
-
*/
|
|
827
|
-
__unstable_autoFocus?: boolean
|
|
828
|
-
/**
|
|
829
|
-
* @beta
|
|
830
|
-
*/
|
|
831
|
-
__unstable_hideCloseButton?: boolean
|
|
832
|
-
/**
|
|
833
|
-
* Whether the dialog should animate in on mount.
|
|
834
|
-
*
|
|
835
|
-
* @beta
|
|
836
|
-
* @defaultValue false
|
|
837
|
-
*/
|
|
838
|
-
animate?: boolean
|
|
839
|
-
cardRadius?: ResponsiveProp<Radius>
|
|
840
|
-
contentRef?: ForwardedRef<HTMLDivElement>
|
|
841
|
-
footer?: ReactNode
|
|
842
|
-
header?: ReactNode
|
|
843
|
-
id: string
|
|
844
|
-
/** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
|
|
845
|
-
onActivate?: LayerProps['onActivate']
|
|
846
|
-
onClickOutside?: () => void
|
|
847
|
-
onClose?: () => void
|
|
848
|
-
open?: boolean
|
|
849
|
-
portal?: string
|
|
850
|
-
position?: ResponsiveProp<DialogPosition>
|
|
851
|
-
/**
|
|
852
|
-
* @deprecated Not in use – will be removed in the next major version.
|
|
853
|
-
*/
|
|
854
|
-
shadow?: ResponsiveProp<Shadow>
|
|
886
|
+
interface SelectableOwnProps extends SelectableStyleProps {
|
|
887
|
+
selected?: boolean;
|
|
855
888
|
}
|
|
856
|
-
|
|
857
889
|
/** @public */
|
|
858
|
-
|
|
859
|
-
|
|
890
|
+
type SelectableElementType = 'a' | 'button' | 'span' | ComponentType;
|
|
860
891
|
/** @public */
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
892
|
+
type SelectableProps<E extends SelectableElementType = SelectableElementType> = Props<SelectableOwnProps, E>;
|
|
893
|
+
/** @public */
|
|
894
|
+
declare function Selectable<E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT>(props: SelectableProps<E>): React.JSX.Element;
|
|
895
|
+
/** @beta */
|
|
896
|
+
declare const DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
897
|
+
/** @beta */
|
|
898
|
+
type TreeItemOwnProps = SelectableOwnProps & {
|
|
899
|
+
expanded?: boolean;
|
|
900
|
+
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
901
|
+
icon?: ElementType$1;
|
|
902
|
+
/**
|
|
903
|
+
* Allows passing a custom element type to the link component
|
|
904
|
+
* @internal
|
|
905
|
+
*/
|
|
906
|
+
linkAs?: SelectableElementType;
|
|
907
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>;
|
|
908
|
+
padding?: ResponsiveProp$1<Space>;
|
|
909
|
+
gap?: ResponsiveProp$1<Space>; /** @deprecated Use `gap` instead */
|
|
910
|
+
space?: never;
|
|
911
|
+
text?: ReactNode;
|
|
912
|
+
weight?: FontWeight;
|
|
913
|
+
};
|
|
914
|
+
/** @beta */
|
|
915
|
+
type TreeItemElementType = 'a' | 'li' | ComponentType;
|
|
916
|
+
/** @beta */
|
|
917
|
+
type TreeItemProps<E extends TreeItemElementType = TreeItemElementType> = Props<TreeItemOwnProps, E>;
|
|
866
918
|
/**
|
|
867
919
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
868
920
|
* @beta
|
|
869
921
|
*/
|
|
870
|
-
|
|
871
|
-
|
|
922
|
+
declare function TreeItem<E extends TreeItemElementType = typeof DEFAULT_TREE_ITEM_ELEMENT>(props: TreeItemProps<E>): React.JSX.Element;
|
|
872
923
|
/**
|
|
873
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
874
924
|
* @beta
|
|
875
925
|
*/
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
926
|
+
interface TreeState {
|
|
927
|
+
[key: string]: {
|
|
928
|
+
element: HTMLElement;
|
|
929
|
+
expanded: boolean;
|
|
930
|
+
} | undefined;
|
|
880
931
|
}
|
|
881
|
-
|
|
882
932
|
/**
|
|
883
|
-
* DO NOT USE IN PRODUCTION.
|
|
884
933
|
* @beta
|
|
885
934
|
*/
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
935
|
+
interface TreeContextValue {
|
|
936
|
+
version: 0.0;
|
|
937
|
+
focusedElement: HTMLElement | null;
|
|
938
|
+
gap: ResponsiveProp$1<Space>;
|
|
939
|
+
level: number;
|
|
940
|
+
path: string[];
|
|
941
|
+
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void;
|
|
942
|
+
setExpanded: (path: string, expanded: boolean) => void;
|
|
943
|
+
setFocusedElement: (focusedElement: HTMLElement | null) => void;
|
|
944
|
+
state: TreeState;
|
|
945
|
+
}
|
|
893
946
|
/**
|
|
894
|
-
* DO NOT USE IN PRODUCTION.
|
|
895
947
|
* @beta
|
|
896
948
|
*/
|
|
897
|
-
|
|
898
|
-
|
|
949
|
+
declare function useTree(): TreeContextValue;
|
|
950
|
+
/** @beta */
|
|
951
|
+
declare const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
952
|
+
/** @beta */
|
|
953
|
+
interface VirtualListChangeOpts {
|
|
954
|
+
fromIndex: number;
|
|
955
|
+
gap: number;
|
|
956
|
+
itemHeight: number;
|
|
957
|
+
scrollHeight: number;
|
|
958
|
+
scrollTop: number;
|
|
959
|
+
toIndex: number;
|
|
899
960
|
}
|
|
900
|
-
|
|
961
|
+
/** @beta */
|
|
962
|
+
interface VirtualListOwnProps<Item = any> {
|
|
963
|
+
gap?: Space;
|
|
964
|
+
getItemKey?: (item: Item, itemIndex: number) => string;
|
|
965
|
+
items?: Item[];
|
|
966
|
+
onChange?: (opts: VirtualListChangeOpts) => void;
|
|
967
|
+
renderItem?: (item: Item) => ReactNode;
|
|
968
|
+
}
|
|
969
|
+
/** @beta */
|
|
970
|
+
type VirtualListElementType = 'div' | ComponentType;
|
|
971
|
+
/** @beta */
|
|
972
|
+
type VirtualListProps<E extends VirtualListElementType = VirtualListElementType, Item = any> = Props<VirtualListOwnProps<Item>, E>;
|
|
973
|
+
/** @beta */
|
|
974
|
+
declare function VirtualList<E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT, Item = any>(props: VirtualListProps<E, Item>): React.JSX.Element;
|
|
901
975
|
/**
|
|
902
|
-
*
|
|
903
|
-
* @beta
|
|
976
|
+
* @internal
|
|
904
977
|
*/
|
|
905
|
-
|
|
906
|
-
Props<ElementQueryOwnProps, E>
|
|
907
|
-
|
|
978
|
+
declare function _raf(fn: () => void): () => void;
|
|
908
979
|
/**
|
|
909
|
-
* @
|
|
980
|
+
* @internal
|
|
910
981
|
*/
|
|
911
|
-
|
|
912
|
-
width: number
|
|
913
|
-
height: number
|
|
914
|
-
}
|
|
915
|
-
|
|
982
|
+
declare function _raf2(fn: () => void): () => void;
|
|
916
983
|
/**
|
|
917
|
-
* @
|
|
984
|
+
* @internal
|
|
918
985
|
*/
|
|
919
|
-
|
|
920
|
-
content: ElementRectValue
|
|
921
|
-
border: ElementRectValue
|
|
922
|
-
/** @deprecated INTERNAL ONLY */
|
|
923
|
-
_contentRect: DOMRectReadOnly
|
|
924
|
-
}
|
|
925
|
-
|
|
986
|
+
declare function _isEnterToClickElement(element: HTMLElement): boolean;
|
|
926
987
|
/**
|
|
927
988
|
* @internal
|
|
928
989
|
*/
|
|
929
|
-
|
|
930
|
-
subscribe: (element: HTMLElement, subscriber: _ElementSizeSubscriber) => () => void
|
|
931
|
-
}
|
|
932
|
-
|
|
990
|
+
declare function isHTMLElement(node: unknown): node is HTMLElement;
|
|
933
991
|
/**
|
|
934
992
|
* @internal
|
|
935
993
|
*/
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
994
|
+
declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement;
|
|
995
|
+
/**
|
|
996
|
+
* @internal
|
|
997
|
+
*/
|
|
998
|
+
declare function isHTMLInputElement(element: unknown): element is HTMLInputElement;
|
|
999
|
+
/**
|
|
1000
|
+
* @internal
|
|
1001
|
+
*/
|
|
1002
|
+
declare function isHTMLButtonElement(element: unknown): element is HTMLButtonElement;
|
|
1003
|
+
/**
|
|
1004
|
+
* @internal
|
|
1005
|
+
*/
|
|
1006
|
+
declare function isHTMLSelectElement(element: unknown): element is HTMLSelectElement;
|
|
940
1007
|
/**
|
|
941
1008
|
* @internal
|
|
942
1009
|
*/
|
|
943
|
-
|
|
944
|
-
|
|
1010
|
+
declare function isHTMLTextAreaElement(element: unknown): element is HTMLTextAreaElement;
|
|
945
1011
|
/**
|
|
946
1012
|
* @internal
|
|
947
1013
|
*/
|
|
948
|
-
|
|
949
|
-
|
|
1014
|
+
declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* @internal
|
|
1017
|
+
*/
|
|
1018
|
+
declare function _hasFocus(element: HTMLElement): boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* @internal
|
|
1021
|
+
*/
|
|
1022
|
+
declare function isFocusable(element: HTMLElement): boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* @internal
|
|
1025
|
+
*/
|
|
1026
|
+
declare function attemptFocus(element: HTMLElement): boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* @internal
|
|
1029
|
+
*/
|
|
1030
|
+
declare function focusFirstDescendant(element: HTMLElement): boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* @internal
|
|
1033
|
+
*/
|
|
1034
|
+
declare function focusLastDescendant(element: HTMLElement): boolean;
|
|
1035
|
+
/**
|
|
1036
|
+
* @internal
|
|
1037
|
+
*/
|
|
1038
|
+
declare function _getResponsiveProp<T>(val: ResponsiveProp$1<T> | undefined, defaultVal?: ResponsivePropArray<T>): ResponsivePropArray<T>;
|
|
1039
|
+
/**
|
|
1040
|
+
* @internal
|
|
1041
|
+
*/
|
|
1042
|
+
declare function _isScrollable(el: Node): boolean;
|
|
1043
|
+
/** @public */
|
|
1044
|
+
type ClickOutsideEventListener = (event: MouseEvent) => void;
|
|
950
1045
|
/** @public */
|
|
951
|
-
|
|
952
|
-
|
|
1046
|
+
type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
953
1047
|
/** @public */
|
|
954
|
-
|
|
955
|
-
|
|
1048
|
+
declare function useClickOutsideEvent(listener: ClickOutsideEventListener | false | undefined, elementsArg?: () => ClickOutsideEventElements, boundaryElement?: () => HTMLElement | null): void;
|
|
956
1049
|
/**
|
|
957
|
-
* DO NOT USE IN PRODUCTION
|
|
958
1050
|
* @beta
|
|
959
1051
|
*/
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
render(): ReactNode
|
|
966
|
-
}
|
|
967
|
-
|
|
1052
|
+
declare function useCustomValidity(ref: {
|
|
1053
|
+
current: null | {
|
|
1054
|
+
setCustomValidity: (validity: string) => void;
|
|
1055
|
+
};
|
|
1056
|
+
}, customValidity: string | undefined): void;
|
|
968
1057
|
/**
|
|
969
|
-
* DO NOT USE IN PRODUCTION
|
|
970
1058
|
* @beta
|
|
971
1059
|
*/
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1060
|
+
interface ElementRectValue {
|
|
1061
|
+
width: number;
|
|
1062
|
+
height: number;
|
|
1063
|
+
}
|
|
976
1064
|
/**
|
|
977
|
-
* DO NOT USE IN PRODUCTION
|
|
978
1065
|
* @beta
|
|
979
1066
|
*/
|
|
980
|
-
|
|
981
|
-
|
|
1067
|
+
interface ElementSize {
|
|
1068
|
+
content: ElementRectValue;
|
|
1069
|
+
border: ElementRectValue;
|
|
1070
|
+
/** @deprecated INTERNAL ONLY */
|
|
1071
|
+
_contentRect: DOMRectReadOnly;
|
|
982
1072
|
}
|
|
983
|
-
|
|
984
1073
|
/**
|
|
985
|
-
*
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
*/
|
|
989
|
-
export declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(
|
|
990
|
-
props: FlexProps<E>,
|
|
991
|
-
): React.JSX.Element
|
|
992
|
-
|
|
993
|
-
/** @public */
|
|
994
|
-
export declare type FlexElementType = BoxElementType
|
|
995
|
-
|
|
996
|
-
/** @public */
|
|
997
|
-
export declare type FlexOwnProps = FlexStyleProps
|
|
998
|
-
|
|
999
|
-
/** @public */
|
|
1000
|
-
export declare type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>
|
|
1001
|
-
|
|
1074
|
+
* @internal
|
|
1075
|
+
*/
|
|
1076
|
+
type _ElementSizeSubscriber = (elementRect: ElementSize) => void;
|
|
1002
1077
|
/**
|
|
1003
1078
|
* @internal
|
|
1004
1079
|
*/
|
|
1005
|
-
|
|
1006
|
-
|
|
1080
|
+
interface _ElementSizeObserver {
|
|
1081
|
+
subscribe: (element: HTMLElement, subscriber: _ElementSizeSubscriber) => () => void;
|
|
1082
|
+
}
|
|
1007
1083
|
/**
|
|
1008
1084
|
* @internal
|
|
1009
1085
|
*/
|
|
1010
|
-
|
|
1011
|
-
|
|
1086
|
+
interface _ElementSizeListener {
|
|
1087
|
+
subscribe: (element: HTMLElement, subscriber: _ElementSizeSubscriber) => () => void;
|
|
1088
|
+
}
|
|
1012
1089
|
/**
|
|
1013
1090
|
* @internal
|
|
1014
1091
|
*/
|
|
1015
|
-
|
|
1016
|
-
val: ResponsiveProp<T> | undefined,
|
|
1017
|
-
defaultVal?: ResponsivePropArray<T>,
|
|
1018
|
-
): ResponsivePropArray<T>
|
|
1019
|
-
|
|
1092
|
+
declare const _elementSizeObserver: _ElementSizeObserver;
|
|
1020
1093
|
/**
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
* @public
|
|
1094
|
+
* Subscribe to the size of a DOM element.
|
|
1095
|
+
* @beta
|
|
1024
1096
|
*/
|
|
1025
|
-
|
|
1026
|
-
props: GridProps<E>,
|
|
1027
|
-
): React.JSX.Element
|
|
1028
|
-
|
|
1029
|
-
/** @public */
|
|
1030
|
-
export declare type GridElementType = BoxElementType
|
|
1031
|
-
|
|
1032
|
-
/** @public */
|
|
1033
|
-
export declare type GridOwnProps = GridStyleProps
|
|
1034
|
-
|
|
1035
|
-
/** @public */
|
|
1036
|
-
export declare type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>
|
|
1037
|
-
|
|
1097
|
+
declare function useElementSize(element: HTMLElement | null): ElementSize | null;
|
|
1038
1098
|
/**
|
|
1039
|
-
*
|
|
1099
|
+
* Adds global keydown event listener to the window.
|
|
1100
|
+
*
|
|
1101
|
+
* @param onKeyDown - The function to call when a keydown event is triggered.
|
|
1102
|
+
* @param options - The options to pass to the addEventListener function (example, capture: true)
|
|
1103
|
+
* @beta
|
|
1040
1104
|
*/
|
|
1041
|
-
|
|
1042
|
-
|
|
1105
|
+
declare function useGlobalKeyDown(onKeyDown: (event: KeyboardEvent) => void, options?: AddEventListenerOptions): void;
|
|
1043
1106
|
/**
|
|
1044
|
-
*
|
|
1107
|
+
* Efficiently subscribes to `window.matchMedia` queries
|
|
1108
|
+
*
|
|
1109
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1045
1110
|
*
|
|
1046
1111
|
* @public
|
|
1047
1112
|
*/
|
|
1048
|
-
|
|
1049
|
-
props: HeadingProps<E>,
|
|
1050
|
-
): React.JSX.Element
|
|
1051
|
-
|
|
1052
|
-
/** @public */
|
|
1053
|
-
export declare type HeadingElementType =
|
|
1054
|
-
| 'div'
|
|
1055
|
-
| 'h1'
|
|
1056
|
-
| 'h2'
|
|
1057
|
-
| 'h3'
|
|
1058
|
-
| 'h4'
|
|
1059
|
-
| 'h5'
|
|
1060
|
-
| 'h6'
|
|
1061
|
-
| 'label'
|
|
1062
|
-
| 'span'
|
|
1063
|
-
| ComponentType
|
|
1064
|
-
|
|
1065
|
-
/** @public */
|
|
1066
|
-
export declare type HeadingOwnProps = HeadingStyleProps & TextOverflowStyleProps
|
|
1067
|
-
|
|
1068
|
-
/** @public */
|
|
1069
|
-
export declare type HeadingProps<E extends HeadingElementType = HeadingElementType> = Props<
|
|
1070
|
-
HeadingOwnProps,
|
|
1071
|
-
E
|
|
1072
|
-
>
|
|
1073
|
-
|
|
1113
|
+
declare function useMatchMedia(mediaQueryString: `(${string})`, getServerSnapshot?: () => boolean): boolean;
|
|
1074
1114
|
/**
|
|
1075
|
-
*
|
|
1076
|
-
* @beta
|
|
1115
|
+
* @internal
|
|
1077
1116
|
*/
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
/** @beta */
|
|
1083
|
-
export declare type HeadingSkeletonElementType = SkeletonElementType
|
|
1084
|
-
|
|
1085
|
-
/** @beta */
|
|
1086
|
-
export declare type HeadingSkeletonOwnProps = SkeletonOwnProps & {
|
|
1087
|
-
size?: ResponsiveProp<FontHeadingSize>
|
|
1117
|
+
interface _MediaStore {
|
|
1118
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
1119
|
+
getSnapshot: () => Breakpoint;
|
|
1088
1120
|
}
|
|
1089
|
-
|
|
1090
1121
|
/**
|
|
1091
1122
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1092
1123
|
* @beta
|
|
1093
1124
|
*/
|
|
1094
|
-
|
|
1095
|
-
E extends HeadingSkeletonElementType = HeadingSkeletonElementType,
|
|
1096
|
-
> = Props<HeadingSkeletonOwnProps, E>
|
|
1097
|
-
|
|
1125
|
+
declare function useMediaIndex(): Breakpoint;
|
|
1098
1126
|
/**
|
|
1099
|
-
*
|
|
1127
|
+
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
1100
1128
|
*
|
|
1101
|
-
* @
|
|
1102
|
-
* ```tsx
|
|
1103
|
-
* import {Hotkeys} from '@sanity/ui'
|
|
1129
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1104
1130
|
*
|
|
1105
|
-
*
|
|
1106
|
-
*
|
|
1131
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1132
|
+
* Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
|
|
1133
|
+
* @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
|
|
1134
|
+
*
|
|
1135
|
+
* @public
|
|
1136
|
+
*/
|
|
1137
|
+
declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
|
|
1138
|
+
/**
|
|
1139
|
+
* Returns true if motion should be reduced
|
|
1140
|
+
*
|
|
1141
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1142
|
+
*
|
|
1143
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1144
|
+
* Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
|
|
1145
|
+
* @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b
|
|
1107
1146
|
*
|
|
1108
1147
|
* @public
|
|
1109
1148
|
*/
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1149
|
+
declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean;
|
|
1150
|
+
interface SyntaxProps {
|
|
1151
|
+
language?: string;
|
|
1152
|
+
value: React.ReactNode;
|
|
1153
|
+
}
|
|
1154
|
+
declare function Syntax(props: SyntaxProps): React.JSX.Element;
|
|
1155
|
+
/** @internal */
|
|
1156
|
+
declare const LazySyntax: _$react.LazyExoticComponent<typeof Syntax>;
|
|
1114
1157
|
/** @public */
|
|
1115
|
-
|
|
1116
|
-
|
|
1158
|
+
type AvatarPosition = 'top' | 'bottom' | 'inside';
|
|
1117
1159
|
/** @public */
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
/** @
|
|
1122
|
-
|
|
1123
|
-
|
|
1160
|
+
declare const DEFAULT_AVATAR_ELEMENT = "span";
|
|
1161
|
+
/** @public */
|
|
1162
|
+
interface AvatarOwnProps {
|
|
1163
|
+
/** @beta */
|
|
1164
|
+
__unstable_hideInnerStroke?: boolean;
|
|
1165
|
+
animateArrowFrom?: AvatarPosition;
|
|
1166
|
+
arrowPosition?: AvatarPosition;
|
|
1167
|
+
color?: AvatarColor;
|
|
1168
|
+
initials?: string;
|
|
1169
|
+
onImageLoadError?: (event: Error) => void;
|
|
1170
|
+
size?: ResponsiveProp$1<AvatarSize>;
|
|
1171
|
+
src?: string;
|
|
1172
|
+
title?: string;
|
|
1124
1173
|
}
|
|
1125
|
-
|
|
1126
1174
|
/** @public */
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
>
|
|
1131
|
-
|
|
1175
|
+
type AvatarElementType = 'a' | 'button' | 'div' | 'span' | ComponentType;
|
|
1176
|
+
/** @public */
|
|
1177
|
+
type AvatarProps<E extends AvatarElementType = AvatarElementType> = Props<AvatarOwnProps, E>;
|
|
1132
1178
|
/**
|
|
1133
|
-
*
|
|
1179
|
+
* Avatars are used to represent people and other agents (e.g. bots).
|
|
1134
1180
|
*
|
|
1135
1181
|
* @public
|
|
1136
1182
|
*/
|
|
1137
|
-
|
|
1138
|
-
props: InlineProps<E>,
|
|
1139
|
-
): React.JSX.Element
|
|
1140
|
-
|
|
1183
|
+
declare function Avatar<E extends AvatarElementType = typeof DEFAULT_AVATAR_ELEMENT>(props: AvatarProps<E>): React.JSX.Element;
|
|
1141
1184
|
/** @public */
|
|
1142
|
-
|
|
1143
|
-
|
|
1185
|
+
declare const DEFAULT_AVATAR_COUNTER_ELEMENT = "span";
|
|
1144
1186
|
/** @public */
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
language?: string
|
|
1187
|
+
interface AvatarCounterOwnProps {
|
|
1188
|
+
count: number;
|
|
1189
|
+
size?: ResponsiveProp$1<AvatarSize>;
|
|
1149
1190
|
}
|
|
1150
|
-
|
|
1151
1191
|
/** @public */
|
|
1152
|
-
|
|
1153
|
-
|
|
1192
|
+
type AvatarCounterElementType = 'button' | 'div' | 'span' | ComponentType;
|
|
1154
1193
|
/** @public */
|
|
1155
|
-
|
|
1156
|
-
|
|
1194
|
+
type AvatarCounterProps<E extends AvatarCounterElementType = AvatarCounterElementType> = Props<AvatarCounterOwnProps, E>;
|
|
1157
1195
|
/** @public */
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
/**
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
/**
|
|
1174
|
-
|
|
1175
|
-
*/
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1184
|
-
|
|
1185
|
-
*/
|
|
1186
|
-
export declare function isHTMLElement(node: unknown): node is HTMLElement
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* @internal
|
|
1190
|
-
*/
|
|
1191
|
-
export declare function isHTMLInputElement(element: unknown): element is HTMLInputElement
|
|
1192
|
-
|
|
1193
|
-
/**
|
|
1194
|
-
* @internal
|
|
1195
|
-
*/
|
|
1196
|
-
export declare function isHTMLSelectElement(element: unknown): element is HTMLSelectElement
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* @internal
|
|
1200
|
-
*/
|
|
1201
|
-
export declare function isHTMLTextAreaElement(element: unknown): element is HTMLTextAreaElement
|
|
1202
|
-
|
|
1203
|
-
/**
|
|
1204
|
-
* @internal
|
|
1205
|
-
*/
|
|
1206
|
-
export declare function _isScrollable(el: Node): boolean
|
|
1207
|
-
|
|
1196
|
+
declare function AvatarCounter<E extends AvatarCounterElementType = typeof DEFAULT_AVATAR_COUNTER_ELEMENT>(props: AvatarCounterProps<E>): React.JSX.Element;
|
|
1197
|
+
/** @public */
|
|
1198
|
+
declare const DEFAULT_AVATAR_STACK_ELEMENT = "span";
|
|
1199
|
+
/** @public */
|
|
1200
|
+
type AvatarStackChild = ReactElement<AvatarProps<'div'>> | null | undefined | false;
|
|
1201
|
+
/** @public */
|
|
1202
|
+
type AvatarStackOwnProps = Omit<BoxOwnProps, 'align' | 'alignItems' | 'display' | 'justify' | 'justifyContent'> & {
|
|
1203
|
+
children: AvatarStackChild | AvatarStackChild[];
|
|
1204
|
+
maxLength?: number;
|
|
1205
|
+
size?: ResponsiveProp$1<AvatarSize>;
|
|
1206
|
+
};
|
|
1207
|
+
/** @public */
|
|
1208
|
+
type AvatarStackElementType = 'div' | 'span' | ComponentType;
|
|
1209
|
+
/** @public */
|
|
1210
|
+
type AvatarStackProps<E extends AvatarStackElementType = AvatarStackElementType> = Props<AvatarStackOwnProps, E>;
|
|
1211
|
+
/** @public */
|
|
1212
|
+
declare function AvatarStack<E extends AvatarStackElementType = typeof DEFAULT_AVATAR_STACK_ELEMENT>(props: AvatarStackProps<E>): React.JSX.Element;
|
|
1213
|
+
/** @public */
|
|
1214
|
+
declare const DEFAULT_BADGE_ELEMENT = "span";
|
|
1215
|
+
/** @public */
|
|
1216
|
+
interface BadgeOwnProps extends BadgeStyleProps {
|
|
1217
|
+
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
1218
|
+
}
|
|
1219
|
+
/** @public */
|
|
1220
|
+
type BadgeElementType = 'div' | 'span' | ComponentType;
|
|
1221
|
+
/** @public */
|
|
1222
|
+
type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<BadgeOwnProps, E>;
|
|
1208
1223
|
/**
|
|
1209
|
-
*
|
|
1224
|
+
* Badges are used to tag resources.
|
|
1210
1225
|
*
|
|
1211
1226
|
* @public
|
|
1212
1227
|
*/
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1228
|
+
declare function Badge<E extends BadgeElementType = typeof DEFAULT_BADGE_ELEMENT>(props: BadgeProps<E>): React.JSX.Element;
|
|
1229
|
+
/** @public */
|
|
1230
|
+
type ButtonTextAlign = 'left' | 'right' | 'center';
|
|
1231
|
+
/** @public */
|
|
1232
|
+
declare function CardProvider(props: {
|
|
1233
|
+
children?: ReactNode;
|
|
1234
|
+
tone: CardTone;
|
|
1235
|
+
scheme: ColorScheme;
|
|
1236
|
+
}): React.JSX.Element;
|
|
1237
|
+
/** @public */
|
|
1238
|
+
interface CardContextValue {
|
|
1239
|
+
tone: CardTone;
|
|
1240
|
+
scheme: ColorScheme;
|
|
1241
|
+
}
|
|
1242
|
+
/** @internal */
|
|
1243
|
+
type _CardCompatProviderComponent = ComponentType$1<{
|
|
1244
|
+
children?: ReactNode;
|
|
1245
|
+
tone: CardTone | 'inherit';
|
|
1246
|
+
scheme: ColorScheme;
|
|
1247
|
+
}>;
|
|
1248
|
+
/** @internal */
|
|
1249
|
+
interface _CardInternalContextValue {
|
|
1250
|
+
CompatProvider?: _CardCompatProviderComponent;
|
|
1251
|
+
root: boolean;
|
|
1252
|
+
}
|
|
1253
|
+
/** @public */
|
|
1254
|
+
declare function useCard(): CardContextValue;
|
|
1217
1255
|
/** @public */
|
|
1218
|
-
|
|
1219
|
-
|
|
1256
|
+
declare const DEFAULT_CHECKBOX_ELEMENT = "input";
|
|
1220
1257
|
/** @public */
|
|
1221
|
-
|
|
1222
|
-
|
|
1258
|
+
type CheckboxOwnProps = {
|
|
1259
|
+
indeterminate?: boolean;
|
|
1260
|
+
customValidity?: string;
|
|
1261
|
+
};
|
|
1223
1262
|
/** @public */
|
|
1224
|
-
|
|
1225
|
-
|
|
1263
|
+
type CheckboxElementType = 'input' | ComponentType;
|
|
1264
|
+
/** @public */
|
|
1265
|
+
type CheckboxProps<E extends CheckboxElementType = CheckboxElementType> = Props<CheckboxOwnProps, E>;
|
|
1226
1266
|
/**
|
|
1227
|
-
*
|
|
1267
|
+
* Checkboxes allow the user to select one or more items from a set.
|
|
1228
1268
|
*
|
|
1229
1269
|
* @public
|
|
1230
1270
|
*/
|
|
1231
|
-
|
|
1232
|
-
props: LabelProps<E>,
|
|
1233
|
-
): React.JSX.Element
|
|
1234
|
-
|
|
1235
|
-
/** @public */
|
|
1236
|
-
export declare type LabelElementType =
|
|
1237
|
-
| 'div'
|
|
1238
|
-
| 'h1'
|
|
1239
|
-
| 'h2'
|
|
1240
|
-
| 'h3'
|
|
1241
|
-
| 'h4'
|
|
1242
|
-
| 'h5'
|
|
1243
|
-
| 'h6'
|
|
1244
|
-
| 'label'
|
|
1245
|
-
| 'li'
|
|
1246
|
-
| 'p'
|
|
1247
|
-
| 'span'
|
|
1248
|
-
| ComponentType
|
|
1249
|
-
|
|
1250
|
-
/** @public */
|
|
1251
|
-
export declare type LabelOwnProps = LabelStyleProps & TextOverflowStyleProps
|
|
1252
|
-
|
|
1253
|
-
/** @public */
|
|
1254
|
-
export declare type LabelProps<E extends LabelElementType = LabelElementType> = Props<
|
|
1255
|
-
LabelOwnProps,
|
|
1256
|
-
E
|
|
1257
|
-
>
|
|
1258
|
-
|
|
1259
|
-
/**
|
|
1260
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1261
|
-
* @beta
|
|
1262
|
-
*/
|
|
1263
|
-
export declare function LabelSkeleton<
|
|
1264
|
-
E extends LabelSkeletonElementType = typeof DEFAULT_LABEL_SKELETON_ELEMENT,
|
|
1265
|
-
>(props: LabelSkeletonProps<E>): React.JSX.Element
|
|
1266
|
-
|
|
1267
|
-
/** @beta */
|
|
1268
|
-
export declare type LabelSkeletonElementType = SkeletonElementType
|
|
1269
|
-
|
|
1270
|
-
/** @beta */
|
|
1271
|
-
export declare type LabelSkeletonOwnProps = SkeletonOwnProps & {
|
|
1272
|
-
size?: ResponsiveProp<FontLabelSize>
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
/**
|
|
1276
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1277
|
-
* @beta
|
|
1278
|
-
*/
|
|
1279
|
-
export declare type LabelSkeletonProps<
|
|
1280
|
-
E extends LabelSkeletonElementType = LabelSkeletonElementType,
|
|
1281
|
-
> = Props<LabelSkeletonOwnProps, E>
|
|
1282
|
-
|
|
1283
|
-
/** @public */
|
|
1284
|
-
export declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(
|
|
1285
|
-
props: LayerProps<E>,
|
|
1286
|
-
): React.JSX.Element
|
|
1287
|
-
|
|
1288
|
-
/** @public */
|
|
1289
|
-
export declare interface LayerContextValue {
|
|
1290
|
-
version: 0.0
|
|
1291
|
-
isTopLayer: boolean
|
|
1292
|
-
level?: number
|
|
1293
|
-
registerChild: (childLevel?: number) => () => void
|
|
1294
|
-
size: number
|
|
1295
|
-
zIndex: number
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1271
|
+
declare function Checkbox<E extends CheckboxElementType = typeof DEFAULT_CHECKBOX_ELEMENT>(props: CheckboxProps<E>): React.JSX.Element;
|
|
1298
1272
|
/** @public */
|
|
1299
|
-
|
|
1300
|
-
|
|
1273
|
+
declare const DEFAULT_CODE_ELEMENT = "pre";
|
|
1301
1274
|
/** @public */
|
|
1302
|
-
|
|
1303
|
-
/**
|
|
1304
|
-
|
|
1305
|
-
zOffset?: ResponsiveProp<number>
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1275
|
+
type CodeOwnProps = CodeStyleProps & {
|
|
1276
|
+
/** Define the language to use for syntax highlighting. */language?: string;
|
|
1277
|
+
};
|
|
1308
1278
|
/** @public */
|
|
1309
|
-
|
|
1310
|
-
LayerOwnProps,
|
|
1311
|
-
E
|
|
1312
|
-
>
|
|
1313
|
-
|
|
1279
|
+
type CodeElementType = 'div' | 'pre' | ComponentType;
|
|
1314
1280
|
/** @public */
|
|
1315
|
-
|
|
1316
|
-
|
|
1281
|
+
type CodeProps<E extends CodeElementType = CodeElementType> = Props<CodeOwnProps, E>;
|
|
1317
1282
|
/** @public */
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
/** @
|
|
1324
|
-
|
|
1325
|
-
|
|
1283
|
+
declare function Code<E extends CodeElementType = typeof DEFAULT_CODE_ELEMENT>(props: CodeProps<E>): React.JSX.Element;
|
|
1284
|
+
/** @public */
|
|
1285
|
+
declare const DEFAULT_CONTAINER_ELEMENT = "div";
|
|
1286
|
+
/** @public */
|
|
1287
|
+
type ContainerOwnProps = ContainerStyleProps;
|
|
1288
|
+
/** @public */
|
|
1289
|
+
type ContainerElementType = BoxElementType;
|
|
1290
|
+
/** @public */
|
|
1291
|
+
type ContainerProps<E extends ContainerElementType = ContainerElementType> = Props<ContainerOwnProps, E>;
|
|
1292
|
+
/**
|
|
1293
|
+
* The `Container` component wraps content layout in a defined set of widths.
|
|
1294
|
+
*
|
|
1295
|
+
* @public
|
|
1296
|
+
*/
|
|
1297
|
+
declare function Container<E extends ContainerElementType = typeof DEFAULT_CONTAINER_ELEMENT>(props: ContainerProps<E>): React.JSX.Element;
|
|
1326
1298
|
/**
|
|
1327
1299
|
* @internal
|
|
1328
1300
|
*/
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
getSnapshot: () => Breakpoint
|
|
1301
|
+
interface ResponsiveWidthStyleProps {
|
|
1302
|
+
$width: (number | 'auto')[];
|
|
1332
1303
|
}
|
|
1333
|
-
|
|
1304
|
+
/** @public */
|
|
1305
|
+
declare const DEFAULT_GRID_ELEMENT = "div";
|
|
1306
|
+
/** @public */
|
|
1307
|
+
type GridOwnProps = GridStyleProps;
|
|
1308
|
+
/** @public */
|
|
1309
|
+
type GridElementType = BoxElementType;
|
|
1310
|
+
/** @public */
|
|
1311
|
+
type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>;
|
|
1334
1312
|
/**
|
|
1335
|
-
* The `
|
|
1313
|
+
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
1336
1314
|
*
|
|
1337
1315
|
* @public
|
|
1338
1316
|
*/
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1317
|
+
declare function Grid<E extends GridElementType = typeof DEFAULT_GRID_ELEMENT>(props: GridProps<E>): React.JSX.Element;
|
|
1318
|
+
/** @public */
|
|
1319
|
+
declare const DEFAULT_HEADING_ELEMENT = "div";
|
|
1320
|
+
/** @public */
|
|
1321
|
+
type HeadingOwnProps = HeadingStyleProps & TextOverflowStyleProps;
|
|
1322
|
+
/** @public */
|
|
1323
|
+
type HeadingElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'span' | ComponentType;
|
|
1324
|
+
/** @public */
|
|
1325
|
+
type HeadingProps<E extends HeadingElementType = HeadingElementType> = Props<HeadingOwnProps, E>;
|
|
1343
1326
|
/**
|
|
1344
|
-
*
|
|
1327
|
+
* Typographic headings.
|
|
1345
1328
|
*
|
|
1346
1329
|
* @public
|
|
1347
1330
|
*/
|
|
1348
|
-
|
|
1349
|
-
|
|
1331
|
+
declare function Heading<E extends HeadingElementType = typeof DEFAULT_HEADING_ELEMENT>(props: HeadingProps<E>): React.JSX.Element;
|
|
1350
1332
|
/** @public */
|
|
1351
|
-
|
|
1352
|
-
/**
|
|
1353
|
-
* @beta Do not use in production.
|
|
1354
|
-
*/
|
|
1355
|
-
__unstable_disableRestoreFocusOnClose?: boolean
|
|
1356
|
-
button: ReactElement<ButtonProps>
|
|
1357
|
-
id: string
|
|
1358
|
-
menu?: ReactElement
|
|
1359
|
-
onClose?: () => void
|
|
1360
|
-
onOpen?: () => void
|
|
1361
|
-
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
1362
|
-
ref?: ForwardedRef<HTMLButtonElement | null>
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
/** @public */
|
|
1366
|
-
export declare function MenuDivider<
|
|
1367
|
-
E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT,
|
|
1368
|
-
>(props: MenuDividerProps<E>): React.JSX.Element
|
|
1369
|
-
|
|
1370
|
-
/** @public */
|
|
1371
|
-
export declare type MenuDividerElementType = 'div' | 'hr' | 'span' | ComponentType
|
|
1372
|
-
|
|
1373
|
-
/** @public */
|
|
1374
|
-
export declare type MenuDividerOwnProps = {}
|
|
1375
|
-
|
|
1376
|
-
/** @public */
|
|
1377
|
-
export declare type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> =
|
|
1378
|
-
Props<MenuDividerOwnProps, E>
|
|
1379
|
-
|
|
1380
|
-
/** @public */
|
|
1381
|
-
export declare type MenuElementType = 'div' | 'span' | ComponentType
|
|
1382
|
-
|
|
1383
|
-
/** @public */
|
|
1384
|
-
export declare function MenuGroup<
|
|
1385
|
-
E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT,
|
|
1386
|
-
>(props: MenuGroupProps<E>): React.JSX.Element
|
|
1387
|
-
|
|
1388
|
-
/** @public */
|
|
1389
|
-
export declare type MenuGroupElementType = 'button' | ComponentType
|
|
1390
|
-
|
|
1391
|
-
/** @public */
|
|
1392
|
-
export declare type MenuGroupOwnProps = RadiusStyleProps & {
|
|
1393
|
-
disabled?: boolean
|
|
1394
|
-
fontSize?: ResponsiveProp<FontTextSize>
|
|
1395
|
-
gap?: ResponsiveProp<Space>
|
|
1396
|
-
icon?: ElementType_2 | ReactNode
|
|
1397
|
-
menu?: Omit<
|
|
1398
|
-
MenuProps<typeof DEFAULT_MENU_ELEMENT>,
|
|
1399
|
-
| 'onClickOutside'
|
|
1400
|
-
| 'onEscape'
|
|
1401
|
-
| 'onItemClick'
|
|
1402
|
-
| 'onKeyDown'
|
|
1403
|
-
| 'onMouseEnter'
|
|
1404
|
-
| 'registerElement'
|
|
1405
|
-
| 'shouldFocus'
|
|
1406
|
-
| 'onBlurCapture'
|
|
1407
|
-
>
|
|
1408
|
-
padding?: ResponsiveProp<Space>
|
|
1409
|
-
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
1410
|
-
text?: ReactNode
|
|
1411
|
-
tone?: ElementTone
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
/** @public */
|
|
1415
|
-
export declare type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<
|
|
1416
|
-
MenuGroupOwnProps,
|
|
1417
|
-
E
|
|
1418
|
-
>
|
|
1419
|
-
|
|
1420
|
-
/** @public */
|
|
1421
|
-
export declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(
|
|
1422
|
-
props: MenuItemProps<E>,
|
|
1423
|
-
): React.JSX.Element
|
|
1424
|
-
|
|
1425
|
-
/** @public */
|
|
1426
|
-
export declare type MenuItemElementType = 'button' | 'a' | ComponentType
|
|
1427
|
-
|
|
1428
|
-
/** @public */
|
|
1429
|
-
export declare type MenuItemOwnProps = GapStyleProps &
|
|
1430
|
-
PaddingStyleProps &
|
|
1431
|
-
RadiusStyleProps & {
|
|
1432
|
-
disabled?: boolean
|
|
1433
|
-
fontSize?: ResponsiveProp<FontTextSize>
|
|
1434
|
-
hotkeys?: string[]
|
|
1435
|
-
icon?: ElementType_2 | ReactNode
|
|
1436
|
-
iconRight?: ElementType_2 | ReactNode
|
|
1437
|
-
pressed?: boolean
|
|
1438
|
-
selected?: boolean
|
|
1439
|
-
text?: ReactNode
|
|
1440
|
-
tone?: ElementTone
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
/** @public */
|
|
1444
|
-
export declare type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Props<
|
|
1445
|
-
MenuItemOwnProps,
|
|
1446
|
-
E
|
|
1447
|
-
>
|
|
1448
|
-
|
|
1449
|
-
/** @public */
|
|
1450
|
-
export declare type MenuOwnProps = PaddingStyleProps & {
|
|
1451
|
-
'gap'?: ResponsiveProp<Space>
|
|
1452
|
-
'onClickOutside'?: (event: MouseEvent) => void
|
|
1453
|
-
'onEscape'?: () => void
|
|
1454
|
-
'onItemClick'?: (event: React.MouseEvent<HTMLButtonElement>) => void
|
|
1455
|
-
'onItemSelect'?: (index: number) => void
|
|
1456
|
-
'originElement'?: HTMLElement | null
|
|
1457
|
-
'registerElement'?: (el: HTMLElement) => () => void
|
|
1458
|
-
'shouldFocus'?: 'first' | 'last' | null
|
|
1459
|
-
'aria-labelledby'?: string
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1333
|
+
declare const DEFAULT_INLINE_ELEMENT = "div";
|
|
1462
1334
|
/** @public */
|
|
1463
|
-
|
|
1464
|
-
|
|
1335
|
+
type InlineOwnProps = InlineStyleProps;
|
|
1336
|
+
/** @public */
|
|
1337
|
+
type InlineElementType = BoxElementType;
|
|
1338
|
+
/** @public */
|
|
1339
|
+
type InlineProps<E extends InlineElementType = InlineElementType> = Props<InlineOwnProps, E>;
|
|
1465
1340
|
/**
|
|
1466
|
-
*
|
|
1341
|
+
* The `Inline` component is a layout utility for aligning and spacing items horizontally.
|
|
1467
1342
|
*
|
|
1468
1343
|
* @public
|
|
1469
1344
|
*/
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
| 'bottom-end'
|
|
1480
|
-
| 'left'
|
|
1481
|
-
| 'left-start'
|
|
1482
|
-
| 'left-end'
|
|
1483
|
-
|
|
1345
|
+
declare function Inline<E extends InlineElementType = typeof DEFAULT_INLINE_ELEMENT>(props: InlineProps<E>): React.JSX.Element;
|
|
1346
|
+
/** @public */
|
|
1347
|
+
declare const DEFAULT_KBD_ELEMENT = "kbd";
|
|
1348
|
+
/** @public */
|
|
1349
|
+
type KBDOwnProps = KBDStyleProps;
|
|
1350
|
+
/** @public */
|
|
1351
|
+
type KBDElementType = 'kbd' | ComponentType;
|
|
1352
|
+
/** @public */
|
|
1353
|
+
type KBDProps<E extends KBDElementType = KBDElementType> = Props<KBDOwnProps, E>;
|
|
1484
1354
|
/**
|
|
1485
|
-
*
|
|
1355
|
+
* Used to define some text as keyboard input.
|
|
1486
1356
|
*
|
|
1487
1357
|
* @public
|
|
1488
1358
|
*/
|
|
1489
|
-
|
|
1490
|
-
|
|
1359
|
+
declare function KBD<E extends KBDElementType = typeof DEFAULT_KBD_ELEMENT>(props: KBDProps<E>): React.JSX.Element;
|
|
1491
1360
|
/** @public */
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
* Whether the popover should animate in and out.
|
|
1498
|
-
*
|
|
1499
|
-
* @beta
|
|
1500
|
-
* @defaultValue false
|
|
1501
|
-
*/
|
|
1502
|
-
animate?: boolean
|
|
1503
|
-
children?: React.ReactNode
|
|
1504
|
-
originX?: number
|
|
1505
|
-
originY?: number
|
|
1506
|
-
referenceWidth?: number
|
|
1507
|
-
strategy?: Strategy
|
|
1508
|
-
x?: number
|
|
1509
|
-
y?: number
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1361
|
+
declare const DEFAULT_LABEL_ELEMENT = "div";
|
|
1362
|
+
/** @public */
|
|
1363
|
+
type LabelOwnProps = LabelStyleProps & TextOverflowStyleProps;
|
|
1364
|
+
/** @public */
|
|
1365
|
+
type LabelElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'li' | 'p' | 'span' | ComponentType;
|
|
1512
1366
|
/** @public */
|
|
1513
|
-
|
|
1514
|
-
|
|
1367
|
+
type LabelProps<E extends LabelElementType = LabelElementType> = Props<LabelOwnProps, E>;
|
|
1515
1368
|
/**
|
|
1516
|
-
*
|
|
1369
|
+
* Typographic labels.
|
|
1370
|
+
*
|
|
1371
|
+
* @public
|
|
1517
1372
|
*/
|
|
1518
|
-
|
|
1519
|
-
|
|
1373
|
+
declare function Label<E extends LabelElementType = typeof DEFAULT_LABEL_ELEMENT>(props: LabelProps<E>): React.JSX.Element;
|
|
1520
1374
|
/** @public */
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
/**
|
|
1525
|
-
* @beta
|
|
1526
|
-
* @deprecated Will be removed in the next major version */
|
|
1527
|
-
__unstable_margins?: PopoverMargins
|
|
1528
|
-
/** @beta */
|
|
1529
|
-
__unstable_shift?: number
|
|
1530
|
-
/**
|
|
1531
|
-
* @deprecated Will be removed in the next major version
|
|
1532
|
-
*/
|
|
1533
|
-
arrow?: boolean
|
|
1534
|
-
children?: ReactElement<{
|
|
1535
|
-
ref: ForwardedRef<HTMLElement>
|
|
1536
|
-
}>
|
|
1537
|
-
/**
|
|
1538
|
-
* When `true`, prevent overflow within the current boundary:
|
|
1539
|
-
* - by flipping on its side axis
|
|
1540
|
-
* - by resizing
|
|
1541
|
-
*
|
|
1542
|
-
* Note that:
|
|
1543
|
-
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
1544
|
-
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
1545
|
-
*
|
|
1546
|
-
* @defaultValue false
|
|
1547
|
-
*/
|
|
1548
|
-
constrainSize?: boolean
|
|
1549
|
-
content?: ReactNode
|
|
1550
|
-
disabled?: boolean
|
|
1551
|
-
fallbackPlacements?: Placement[]
|
|
1552
|
-
floatingBoundary?: HTMLElement | null
|
|
1553
|
-
/**
|
|
1554
|
-
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
1555
|
-
* the current boundary by resizing.
|
|
1556
|
-
*
|
|
1557
|
-
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
1558
|
-
*
|
|
1559
|
-
* @defaultValue false
|
|
1560
|
-
*/
|
|
1561
|
-
matchReferenceWidth?: boolean
|
|
1562
|
-
/**
|
|
1563
|
-
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
1564
|
-
*
|
|
1565
|
-
* @beta
|
|
1566
|
-
* @defaultValue false
|
|
1567
|
-
*/
|
|
1568
|
-
modal?: boolean
|
|
1569
|
-
open?: boolean
|
|
1570
|
-
placement?: Placement
|
|
1571
|
-
/**
|
|
1572
|
-
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
1573
|
-
* fallback placements in order. Whichever fits in the viewport first.
|
|
1574
|
-
*
|
|
1575
|
-
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
1576
|
-
* and the placement with the most viewport space available.
|
|
1577
|
-
*
|
|
1578
|
-
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
1579
|
-
*/
|
|
1580
|
-
placementStrategy?: 'flip' | 'autoPlacement'
|
|
1581
|
-
/** Whether or not to render the popover in a portal element. */
|
|
1582
|
-
portal?: boolean | string
|
|
1583
|
-
preventOverflow?: boolean
|
|
1584
|
-
referenceBoundary?: HTMLElement | null
|
|
1585
|
-
/**
|
|
1586
|
-
* When defined, the popover will be positioned relative to this element.
|
|
1587
|
-
* The children of the popover won't be rendered.
|
|
1588
|
-
*/
|
|
1589
|
-
referenceElement?: HTMLElement | null
|
|
1590
|
-
/** @beta */
|
|
1591
|
-
updateRef?: Ref<PopoverUpdateCallback | undefined>
|
|
1592
|
-
width?: ResponsiveProp<MaxWidth>
|
|
1375
|
+
interface LayerProviderProps {
|
|
1376
|
+
children?: ReactNode;
|
|
1377
|
+
zOffset?: ResponsiveProp$1<number>;
|
|
1593
1378
|
}
|
|
1594
|
-
|
|
1595
1379
|
/** @public */
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
/** @beta */
|
|
1599
|
-
export declare type PopoverUpdateCallback = () => void
|
|
1600
|
-
|
|
1601
|
-
/** @public */
|
|
1602
|
-
export declare type PopoverWidth = Exclude<ContainerWidth, 'auto'>
|
|
1603
|
-
|
|
1380
|
+
declare function LayerProvider(props: LayerProviderProps): React.JSX.Element;
|
|
1604
1381
|
/** @public */
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
elements?: Record<string, HTMLElement | null | undefined>
|
|
1382
|
+
interface LayerContextValue {
|
|
1383
|
+
version: 0.0;
|
|
1384
|
+
isTopLayer: boolean;
|
|
1385
|
+
level?: number;
|
|
1386
|
+
registerChild: (childLevel?: number) => () => void;
|
|
1387
|
+
size: number;
|
|
1388
|
+
zIndex: number;
|
|
1613
1389
|
}
|
|
1614
|
-
|
|
1615
1390
|
/** @public */
|
|
1616
|
-
|
|
1617
|
-
children: ReactNode
|
|
1618
|
-
/**
|
|
1619
|
-
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
1620
|
-
*/
|
|
1621
|
-
__unstable_name?: string
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1391
|
+
declare function useLayer(): LayerContextValue;
|
|
1624
1392
|
/** @public */
|
|
1625
|
-
|
|
1626
|
-
|
|
1393
|
+
declare const DEFAULT_RADIO_ELEMENT = "input";
|
|
1627
1394
|
/** @public */
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
*/
|
|
1634
|
-
__unstable_elements?: Record<string, HTMLElement | null | undefined>
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1395
|
+
type RadioOwnProps = {
|
|
1396
|
+
customValidity?: string;
|
|
1397
|
+
};
|
|
1398
|
+
/** @public */
|
|
1399
|
+
type RadioElementType = 'input' | ComponentType;
|
|
1637
1400
|
/** @public */
|
|
1638
|
-
|
|
1639
|
-
E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>,
|
|
1640
|
-
P & {
|
|
1641
|
-
as?: E
|
|
1642
|
-
}
|
|
1643
|
-
>
|
|
1644
|
-
|
|
1401
|
+
type RadioProps<E extends RadioElementType = RadioElementType> = Props<RadioOwnProps, E>;
|
|
1645
1402
|
/**
|
|
1646
1403
|
* The `Radio` component allows the user to select one option from a set.
|
|
1647
1404
|
*
|
|
1648
1405
|
* @public
|
|
1649
1406
|
*/
|
|
1650
|
-
|
|
1651
|
-
props: RadioProps<E>,
|
|
1652
|
-
): React.JSX.Element
|
|
1653
|
-
|
|
1407
|
+
declare function Radio<E extends RadioElementType = typeof DEFAULT_RADIO_ELEMENT>(props: RadioProps<E>): React.JSX.Element;
|
|
1654
1408
|
/** @public */
|
|
1655
|
-
|
|
1656
|
-
|
|
1409
|
+
declare const DEFAULT_SELECT_ELEMENT = "select";
|
|
1657
1410
|
/** @public */
|
|
1658
|
-
|
|
1659
|
-
customValidity?: string
|
|
1660
|
-
|
|
1661
|
-
|
|
1411
|
+
type SelectOwnProps = SelectStyleProps & {
|
|
1412
|
+
customValidity?: string;
|
|
1413
|
+
readOnly?: boolean;
|
|
1414
|
+
};
|
|
1415
|
+
/** @public */
|
|
1416
|
+
type SelectElementType = 'select' | ComponentType;
|
|
1662
1417
|
/** @public */
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1418
|
+
type SelectProps<E extends SelectElementType = SelectElementType> = Props<SelectOwnProps, E>;
|
|
1419
|
+
/**
|
|
1420
|
+
* The `Select` component provides control of options.
|
|
1421
|
+
*
|
|
1422
|
+
* @public
|
|
1423
|
+
*/
|
|
1424
|
+
declare function Select<E extends SelectElementType = typeof DEFAULT_SELECT_ELEMENT>(props: SelectProps<E>): React.JSX.Element;
|
|
1425
|
+
/** @beta */
|
|
1426
|
+
declare const DEFAULT_SKELETON_ELEMENT = "div";
|
|
1427
|
+
/**
|
|
1428
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1429
|
+
* @beta
|
|
1430
|
+
*/
|
|
1431
|
+
type SkeletonOwnProps = SkeletonStyleProps & {
|
|
1432
|
+
animated?: boolean;
|
|
1433
|
+
delay?: number;
|
|
1434
|
+
};
|
|
1435
|
+
/** @beta */
|
|
1436
|
+
type SkeletonElementType = 'div' | 'span' | ComponentType;
|
|
1437
|
+
/** @beta */
|
|
1438
|
+
type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<SkeletonOwnProps, E>;
|
|
1439
|
+
/**
|
|
1440
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1441
|
+
* @beta
|
|
1442
|
+
*/
|
|
1443
|
+
declare function Skeleton<E extends SkeletonElementType = typeof DEFAULT_SKELETON_ELEMENT>(props: SkeletonProps<E>): React.JSX.Element;
|
|
1444
|
+
/** @beta */
|
|
1445
|
+
declare const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
1446
|
+
/** @beta */
|
|
1447
|
+
type CodeSkeletonOwnProps = SkeletonOwnProps & {
|
|
1448
|
+
size?: ResponsiveProp$1<FontCodeSize>;
|
|
1449
|
+
};
|
|
1450
|
+
/** @beta */
|
|
1451
|
+
type CodeSkeletonElementType = SkeletonElementType;
|
|
1668
1452
|
/**
|
|
1669
|
-
*
|
|
1453
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1454
|
+
* @beta
|
|
1670
1455
|
*/
|
|
1671
|
-
|
|
1672
|
-
|
|
1456
|
+
type CodeSkeletonProps<E extends CodeSkeletonElementType = CodeSkeletonElementType> = Props<CodeSkeletonOwnProps, E>;
|
|
1673
1457
|
/**
|
|
1674
|
-
*
|
|
1458
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1459
|
+
* @beta
|
|
1675
1460
|
*/
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1461
|
+
declare function CodeSkeleton<E extends CodeSkeletonElementType = typeof DEFAULT_CODE_SKELETON_ELEMENT>(props: CodeSkeletonProps<E>): React.JSX.Element;
|
|
1462
|
+
/** @beta */
|
|
1463
|
+
declare const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
|
|
1464
|
+
/** @beta */
|
|
1465
|
+
type HeadingSkeletonOwnProps = SkeletonOwnProps & {
|
|
1466
|
+
size?: ResponsiveProp$1<FontHeadingSize>;
|
|
1467
|
+
};
|
|
1468
|
+
/** @beta */
|
|
1469
|
+
type HeadingSkeletonElementType = SkeletonElementType;
|
|
1680
1470
|
/**
|
|
1681
|
-
*
|
|
1471
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1472
|
+
* @beta
|
|
1682
1473
|
*/
|
|
1683
|
-
|
|
1684
|
-
$width: (number | 'auto')[]
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1474
|
+
type HeadingSkeletonProps<E extends HeadingSkeletonElementType = HeadingSkeletonElementType> = Props<HeadingSkeletonOwnProps, E>;
|
|
1687
1475
|
/**
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1690
|
-
* @public
|
|
1476
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1477
|
+
* @beta
|
|
1691
1478
|
*/
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
/** @
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
/** @public */
|
|
1703
|
-
export declare type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>
|
|
1704
|
-
|
|
1705
|
-
/** @public */
|
|
1706
|
-
export declare function RootProvider(props: RootProviderProps): React.JSX.Element
|
|
1707
|
-
|
|
1708
|
-
/** @public */
|
|
1709
|
-
export declare interface RootProviderProps {
|
|
1710
|
-
boundaryElement: HTMLElement | null
|
|
1711
|
-
children?: ReactNode
|
|
1712
|
-
portalElement: HTMLElement | null
|
|
1713
|
-
scheme: ColorScheme
|
|
1714
|
-
tone: CardTone
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1479
|
+
declare function HeadingSkeleton<E extends HeadingSkeletonElementType = typeof DEFAULT_HEADING_SKELETON_ELEMENT>(props: HeadingSkeletonProps<E>): React.JSX.Element;
|
|
1480
|
+
/** @beta */
|
|
1481
|
+
declare const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
1482
|
+
/** @beta */
|
|
1483
|
+
type LabelSkeletonOwnProps = SkeletonOwnProps & {
|
|
1484
|
+
size?: ResponsiveProp$1<FontLabelSize>;
|
|
1485
|
+
};
|
|
1486
|
+
/** @beta */
|
|
1487
|
+
type LabelSkeletonElementType = SkeletonElementType;
|
|
1717
1488
|
/**
|
|
1718
|
-
*
|
|
1719
|
-
*
|
|
1720
|
-
* @public
|
|
1489
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1490
|
+
* @beta
|
|
1721
1491
|
*/
|
|
1722
|
-
|
|
1723
|
-
props: SelectProps<E>,
|
|
1724
|
-
): React.JSX.Element
|
|
1725
|
-
|
|
1726
|
-
/** @public */
|
|
1727
|
-
export declare function Selectable<
|
|
1728
|
-
E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT,
|
|
1729
|
-
>(props: SelectableProps<E>): React.JSX.Element
|
|
1730
|
-
|
|
1731
|
-
/** @public */
|
|
1732
|
-
export declare type SelectableElementType = 'a' | 'button' | 'span' | ComponentType
|
|
1733
|
-
|
|
1734
|
-
/** @public */
|
|
1735
|
-
export declare interface SelectableOwnProps extends SelectableStyleProps {
|
|
1736
|
-
selected?: boolean
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
/** @public */
|
|
1740
|
-
export declare type SelectableProps<E extends SelectableElementType = SelectableElementType> =
|
|
1741
|
-
Props<SelectableOwnProps, E>
|
|
1742
|
-
|
|
1743
|
-
/** @public */
|
|
1744
|
-
export declare type SelectElementType = 'select' | ComponentType
|
|
1745
|
-
|
|
1746
|
-
/** @public */
|
|
1747
|
-
export declare type SelectOwnProps = SelectStyleProps & {
|
|
1748
|
-
customValidity?: string
|
|
1749
|
-
readOnly?: boolean
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
/** @public */
|
|
1753
|
-
export declare type SelectProps<E extends SelectElementType = SelectElementType> = Props<
|
|
1754
|
-
SelectOwnProps,
|
|
1755
|
-
E
|
|
1756
|
-
>
|
|
1757
|
-
|
|
1492
|
+
type LabelSkeletonProps<E extends LabelSkeletonElementType = LabelSkeletonElementType> = Props<LabelSkeletonOwnProps, E>;
|
|
1758
1493
|
/**
|
|
1759
1494
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1760
1495
|
* @beta
|
|
1761
1496
|
*/
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1497
|
+
declare function LabelSkeleton<E extends LabelSkeletonElementType = typeof DEFAULT_LABEL_SKELETON_ELEMENT>(props: LabelSkeletonProps<E>): React.JSX.Element;
|
|
1498
|
+
/** @beta */
|
|
1499
|
+
declare const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
1500
|
+
/** @beta */
|
|
1501
|
+
type TextSkeletonOwnProps = SkeletonOwnProps & {
|
|
1502
|
+
size?: ResponsiveProp$1<FontTextSize>;
|
|
1503
|
+
};
|
|
1766
1504
|
/** @beta */
|
|
1767
|
-
|
|
1768
|
-
|
|
1505
|
+
type TextSkeletonElementType = SkeletonElementType;
|
|
1769
1506
|
/**
|
|
1770
1507
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1771
1508
|
* @beta
|
|
1772
1509
|
*/
|
|
1773
|
-
|
|
1774
|
-
animated?: boolean
|
|
1775
|
-
delay?: number
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
/** @beta */
|
|
1779
|
-
export declare type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<
|
|
1780
|
-
SkeletonOwnProps,
|
|
1781
|
-
E
|
|
1782
|
-
>
|
|
1783
|
-
|
|
1510
|
+
type TextSkeletonProps<E extends TextSkeletonElementType = TextSkeletonElementType> = Props<TextSkeletonOwnProps, E>;
|
|
1784
1511
|
/**
|
|
1785
|
-
*
|
|
1786
|
-
*
|
|
1787
|
-
* @public
|
|
1512
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1513
|
+
* @beta
|
|
1788
1514
|
*/
|
|
1789
|
-
|
|
1790
|
-
props: SpinnerProps<E>,
|
|
1791
|
-
): React.JSX.Element
|
|
1792
|
-
|
|
1793
|
-
/** @public */
|
|
1794
|
-
export declare type SpinnerElementType = 'div' | 'span' | ComponentType
|
|
1795
|
-
|
|
1796
|
-
/** @public */
|
|
1797
|
-
export declare type SpinnerOwnProps = {
|
|
1798
|
-
muted?: boolean
|
|
1799
|
-
size?: ResponsiveProp<FontTextSize>
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
/** @public */
|
|
1803
|
-
export declare type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<
|
|
1804
|
-
SpinnerOwnProps,
|
|
1805
|
-
E
|
|
1806
|
-
>
|
|
1807
|
-
|
|
1808
|
-
/** @public */
|
|
1809
|
-
export declare function SrOnly<E extends SrOnlyElementType = typeof DEFAULT_SR_ONLY_ELEMENT>(
|
|
1810
|
-
props: SrOnlyProps<E>,
|
|
1811
|
-
): React.JSX.Element
|
|
1812
|
-
|
|
1515
|
+
declare function TextSkeleton<E extends TextSkeletonElementType = typeof DEFAULT_TEXT_SKELETON_ELEMENT>(props: TextSkeletonProps<E>): React.JSX.Element;
|
|
1813
1516
|
/** @public */
|
|
1814
|
-
|
|
1815
|
-
|
|
1517
|
+
declare const DEFAULT_SPINNER_ELEMENT = "div";
|
|
1816
1518
|
/** @public */
|
|
1817
|
-
|
|
1818
|
-
|
|
1519
|
+
type SpinnerOwnProps = {
|
|
1520
|
+
muted?: boolean;
|
|
1521
|
+
size?: ResponsiveProp$1<FontTextSize>;
|
|
1522
|
+
};
|
|
1819
1523
|
/** @public */
|
|
1820
|
-
|
|
1821
|
-
SrOnlyOwnProps,
|
|
1822
|
-
E
|
|
1823
|
-
>
|
|
1824
|
-
|
|
1825
|
-
/**
|
|
1826
|
-
* The `Stack` component is used to place elements on top of each other.
|
|
1827
|
-
*
|
|
1828
|
-
* @public
|
|
1829
|
-
*/
|
|
1830
|
-
export declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(
|
|
1831
|
-
props: StackProps<E>,
|
|
1832
|
-
): React.JSX.Element
|
|
1833
|
-
|
|
1834
|
-
/** @public */
|
|
1835
|
-
export declare type StackElementType = BoxElementType
|
|
1836
|
-
|
|
1524
|
+
type SpinnerElementType = 'div' | 'span' | ComponentType;
|
|
1837
1525
|
/** @public */
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
/** @public */
|
|
1841
|
-
export declare type StackProps<E extends StackElementType = StackElementType> = Props<
|
|
1842
|
-
StackOwnProps,
|
|
1843
|
-
E
|
|
1844
|
-
>
|
|
1845
|
-
|
|
1526
|
+
type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<SpinnerOwnProps, E>;
|
|
1846
1527
|
/**
|
|
1847
|
-
*
|
|
1848
|
-
*
|
|
1849
|
-
* Extends all properties of an `<input type="checkbox" />` element, except type.
|
|
1528
|
+
* Indicate that something is loading for an indeterminate amount of time.
|
|
1850
1529
|
*
|
|
1851
1530
|
* @public
|
|
1852
1531
|
*/
|
|
1853
|
-
|
|
1854
|
-
props: SwitchProps<E>,
|
|
1855
|
-
): React.JSX.Element
|
|
1856
|
-
|
|
1857
|
-
/** @public */
|
|
1858
|
-
export declare type SwitchElementType = 'input' | ComponentType
|
|
1859
|
-
|
|
1860
|
-
/** @public */
|
|
1861
|
-
export declare type SwitchOwnProps = {
|
|
1862
|
-
indeterminate?: boolean
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
/** @public */
|
|
1866
|
-
export declare type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<
|
|
1867
|
-
SwitchOwnProps,
|
|
1868
|
-
E
|
|
1869
|
-
>
|
|
1870
|
-
|
|
1871
|
-
declare function Syntax(props: SyntaxProps): React.JSX.Element
|
|
1872
|
-
|
|
1873
|
-
declare interface SyntaxProps {
|
|
1874
|
-
language?: string
|
|
1875
|
-
value: React.ReactNode
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
/** @public */
|
|
1879
|
-
export declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
|
|
1880
|
-
props: TabProps<E>,
|
|
1881
|
-
): React.JSX.Element
|
|
1882
|
-
|
|
1532
|
+
declare function Spinner<E extends SpinnerElementType = typeof DEFAULT_SPINNER_ELEMENT>(props: SpinnerProps<E>): React.JSX.Element;
|
|
1883
1533
|
/** @public */
|
|
1884
|
-
|
|
1885
|
-
|
|
1534
|
+
declare const DEFAULT_SR_ONLY_ELEMENT = "span";
|
|
1886
1535
|
/** @public */
|
|
1887
|
-
|
|
1888
|
-
props: TabListProps<E>,
|
|
1889
|
-
): React.JSX.Element
|
|
1890
|
-
|
|
1536
|
+
type SrOnlyOwnProps = {};
|
|
1891
1537
|
/** @public */
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
/** @public */
|
|
1895
|
-
export declare interface TabListOwnProps extends FlexOwnProps {
|
|
1896
|
-
autoActivate?: boolean
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
/** @public */
|
|
1900
|
-
export declare type TabListProps<E extends TabListElementType = TabListElementType> = Omit<
|
|
1901
|
-
Props<TabListOwnProps, E>,
|
|
1902
|
-
'role'
|
|
1903
|
-
>
|
|
1904
|
-
|
|
1905
|
-
/** @public */
|
|
1906
|
-
export declare interface TabOwnProps extends ButtonOwnProps {
|
|
1907
|
-
/**
|
|
1908
|
-
* The `id` of the corresponding `TabPanel` component.
|
|
1909
|
-
*/
|
|
1910
|
-
'aria-controls': string
|
|
1911
|
-
'id': string
|
|
1912
|
-
'focused'?: boolean
|
|
1913
|
-
'label'?: React.ReactNode
|
|
1914
|
-
'onActivate'?: () => void
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1538
|
+
type SrOnlyElementType = 'span' | ComponentType;
|
|
1917
1539
|
/** @public */
|
|
1918
|
-
|
|
1919
|
-
props: TabPanelProps<E>,
|
|
1920
|
-
): React.JSX.Element
|
|
1921
|
-
|
|
1540
|
+
type SrOnlyProps<E extends SrOnlyElementType = SrOnlyElementType> = Props<SrOnlyOwnProps, E>;
|
|
1922
1541
|
/** @public */
|
|
1923
|
-
|
|
1924
|
-
|
|
1542
|
+
declare function SrOnly<E extends SrOnlyElementType = typeof DEFAULT_SR_ONLY_ELEMENT>(props: SrOnlyProps<E>): React.JSX.Element;
|
|
1925
1543
|
/** @public */
|
|
1926
|
-
|
|
1927
|
-
/**
|
|
1928
|
-
* The `id` of the corresponding `Tab` component.
|
|
1929
|
-
*/
|
|
1930
|
-
'aria-labelledby': string
|
|
1931
|
-
'id': string
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1544
|
+
declare const DEFAULT_SWITCH_ELEMENT = "input";
|
|
1934
1545
|
/** @public */
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
>
|
|
1939
|
-
|
|
1546
|
+
type SwitchOwnProps = {
|
|
1547
|
+
indeterminate?: boolean;
|
|
1548
|
+
};
|
|
1940
1549
|
/** @public */
|
|
1941
|
-
|
|
1942
|
-
|
|
1550
|
+
type SwitchElementType = 'input' | ComponentType;
|
|
1943
1551
|
/** @public */
|
|
1944
|
-
|
|
1945
|
-
|
|
1552
|
+
type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<SwitchOwnProps, E>;
|
|
1946
1553
|
/**
|
|
1947
|
-
* The `
|
|
1554
|
+
* The `Switch` component allows the user to toggle a setting on and off.
|
|
1948
1555
|
*
|
|
1949
|
-
*
|
|
1950
|
-
*/
|
|
1951
|
-
declare function Text_2<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(
|
|
1952
|
-
props: TextProps<E>,
|
|
1953
|
-
): React.JSX.Element
|
|
1954
|
-
export {Text_2 as Text}
|
|
1955
|
-
|
|
1956
|
-
/**
|
|
1957
|
-
* A multiline text input.
|
|
1556
|
+
* Extends all properties of an `<input type="checkbox" />` element, except type.
|
|
1958
1557
|
*
|
|
1959
1558
|
* @public
|
|
1960
1559
|
*/
|
|
1961
|
-
|
|
1962
|
-
props: TextAreaProps<E>,
|
|
1963
|
-
): React.JSX.Element
|
|
1964
|
-
|
|
1560
|
+
declare function Switch<E extends SwitchElementType = typeof DEFAULT_SWITCH_ELEMENT>(props: SwitchProps<E>): React.JSX.Element;
|
|
1965
1561
|
/** @public */
|
|
1966
|
-
|
|
1967
|
-
|
|
1562
|
+
declare const DEFAULT_INLINE_CODE_ELEMENT = "code";
|
|
1968
1563
|
/** @public */
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
__unstable_disableFocusRing?: boolean
|
|
1974
|
-
customValidity?: string
|
|
1564
|
+
interface InlineCodeProps {
|
|
1565
|
+
children: React.ReactNode;
|
|
1566
|
+
/** Language to use for syntax highlighting. */
|
|
1567
|
+
language?: string;
|
|
1975
1568
|
}
|
|
1976
|
-
|
|
1977
|
-
/** @public */
|
|
1978
|
-
export declare type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<
|
|
1979
|
-
TextAreaOwnProps,
|
|
1980
|
-
E
|
|
1981
|
-
>
|
|
1982
|
-
|
|
1983
|
-
/** @public */
|
|
1984
|
-
export declare type TextElementType =
|
|
1985
|
-
| 'div'
|
|
1986
|
-
| 'h1'
|
|
1987
|
-
| 'h2'
|
|
1988
|
-
| 'h3'
|
|
1989
|
-
| 'h4'
|
|
1990
|
-
| 'h5'
|
|
1991
|
-
| 'h6'
|
|
1992
|
-
| 'label'
|
|
1993
|
-
| 'li'
|
|
1994
|
-
| 'p'
|
|
1995
|
-
| 'span'
|
|
1996
|
-
| 'summary'
|
|
1997
|
-
| 'time'
|
|
1998
|
-
| ComponentType
|
|
1999
|
-
|
|
2000
|
-
/**
|
|
2001
|
-
* Single line text input.
|
|
2002
|
-
*
|
|
2003
|
-
* @public
|
|
2004
|
-
*/
|
|
2005
|
-
export declare function TextInput<
|
|
2006
|
-
E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT,
|
|
2007
|
-
>(props: TextInputProps<E>): React.JSX.Element
|
|
2008
|
-
|
|
2009
1569
|
/** @public */
|
|
2010
|
-
|
|
2011
|
-
ButtonProps<'button'>,
|
|
2012
|
-
'as' | 'onClick' | 'onMouseDown'
|
|
2013
|
-
>
|
|
2014
|
-
|
|
1570
|
+
declare function InlineCode(props: InlineCodeProps): React.JSX.Element;
|
|
2015
1571
|
/** @public */
|
|
2016
|
-
|
|
2017
|
-
|
|
1572
|
+
declare const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
|
|
2018
1573
|
/** @public */
|
|
2019
|
-
|
|
2020
|
-
/**
|
|
2021
|
-
* @beta
|
|
2022
|
-
*/
|
|
2023
|
-
__unstable_disableFocusRing?: boolean
|
|
2024
|
-
/**
|
|
2025
|
-
* @beta
|
|
2026
|
-
*/
|
|
2027
|
-
clearButton?: boolean | TextInputClearButtonProps
|
|
2028
|
-
customValidity?: string
|
|
2029
|
-
icon?: ElementType_2 | ReactNode
|
|
2030
|
-
iconRight?: ElementType_2 | ReactNode
|
|
1574
|
+
type TextAreaOwnProps = TextAreaStyleProps & {
|
|
2031
1575
|
/**
|
|
2032
1576
|
* @beta
|
|
2033
1577
|
*/
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
/**
|
|
2038
|
-
* @deprecated Use `fontWeight` instead
|
|
2039
|
-
*/
|
|
2040
|
-
weight?: FontWeight
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
/** @public */
|
|
2044
|
-
export declare type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<
|
|
2045
|
-
TextInputOwnProps,
|
|
2046
|
-
E
|
|
2047
|
-
>
|
|
2048
|
-
|
|
2049
|
-
/** @public */
|
|
2050
|
-
export declare type TextOwnProps = TextStyleProps & TextOverflowStyleProps
|
|
2051
|
-
|
|
1578
|
+
__unstable_disableFocusRing?: boolean;
|
|
1579
|
+
customValidity?: string;
|
|
1580
|
+
};
|
|
2052
1581
|
/** @public */
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
2057
|
-
* @beta
|
|
2058
|
-
*/
|
|
2059
|
-
export declare function TextSkeleton<
|
|
2060
|
-
E extends TextSkeletonElementType = typeof DEFAULT_TEXT_SKELETON_ELEMENT,
|
|
2061
|
-
>(props: TextSkeletonProps<E>): React.JSX.Element
|
|
2062
|
-
|
|
2063
|
-
/** @beta */
|
|
2064
|
-
export declare type TextSkeletonElementType = SkeletonElementType
|
|
2065
|
-
|
|
2066
|
-
/** @beta */
|
|
2067
|
-
export declare type TextSkeletonOwnProps = SkeletonOwnProps & {
|
|
2068
|
-
size?: ResponsiveProp<FontTextSize>
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
2073
|
-
* @beta
|
|
2074
|
-
*/
|
|
2075
|
-
export declare type TextSkeletonProps<E extends TextSkeletonElementType = TextSkeletonElementType> =
|
|
2076
|
-
Props<TextSkeletonOwnProps, E>
|
|
2077
|
-
|
|
2078
|
-
/**
|
|
2079
|
-
* The `Toast` component gives feedback to users when an action has taken place.
|
|
2080
|
-
*
|
|
2081
|
-
* Toasts can be closed with a close button, or auto-dismiss when the duration expires.
|
|
2082
|
-
*
|
|
2083
|
-
* @internal
|
|
2084
|
-
*/
|
|
2085
|
-
export declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
|
|
2086
|
-
props: ToastProps<E>,
|
|
2087
|
-
): React.JSX.Element
|
|
2088
|
-
|
|
1582
|
+
type TextAreaElementType = 'textarea' | ComponentType;
|
|
2089
1583
|
/** @public */
|
|
2090
|
-
|
|
2091
|
-
version: 0.0
|
|
2092
|
-
/**
|
|
2093
|
-
* Creates or updates a toast notification.
|
|
2094
|
-
* If a toast with the same ID already exists, it will be updated.
|
|
2095
|
-
* If an ID is not provided, a random one will be generated.
|
|
2096
|
-
* The returned ID can be used to programatically update a toast.
|
|
2097
|
-
*/
|
|
2098
|
-
push: (params: ToastParams) => string
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
/** @internal */
|
|
2102
|
-
export declare type ToastElementType = 'li' | ComponentType
|
|
2103
|
-
|
|
2104
|
-
/** @internal */
|
|
2105
|
-
declare type ToastLayerElementType = 'ul' | ComponentType
|
|
2106
|
-
|
|
2107
|
-
/** @internal */
|
|
2108
|
-
declare type ToastLayerOwnProps = GapStyleProps & PaddingStyleProps
|
|
2109
|
-
|
|
2110
|
-
/** @internal */
|
|
2111
|
-
declare type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementType> = Props<
|
|
2112
|
-
ToastLayerOwnProps,
|
|
2113
|
-
E
|
|
2114
|
-
>
|
|
2115
|
-
|
|
2116
|
-
/** @internal */
|
|
2117
|
-
export declare type ToastOwnProps = RadiusStyleProps & {
|
|
2118
|
-
closable?: boolean
|
|
2119
|
-
description?: ReactNode
|
|
2120
|
-
onClose?: () => void
|
|
2121
|
-
title?: ReactNode
|
|
2122
|
-
status?: 'error' | 'warning' | 'success' | 'info'
|
|
2123
|
-
duration?: number
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
/** @public */
|
|
2127
|
-
export declare interface ToastParams {
|
|
2128
|
-
closable?: boolean
|
|
2129
|
-
description?: ReactNode
|
|
2130
|
-
duration?: number
|
|
2131
|
-
id?: string
|
|
2132
|
-
onClose?: () => void
|
|
2133
|
-
title?: ReactNode
|
|
2134
|
-
status?: 'error' | 'warning' | 'success' | 'info'
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
/** @internal */
|
|
2138
|
-
export declare type ToastProps<E extends ToastElementType = ToastElementType> = Props<
|
|
2139
|
-
ToastOwnProps,
|
|
2140
|
-
E
|
|
2141
|
-
>
|
|
2142
|
-
|
|
2143
|
-
/** @public */
|
|
2144
|
-
export declare function ToastProvider(props: ToastProviderProps): React.JSX.Element
|
|
2145
|
-
|
|
2146
|
-
/** @public */
|
|
2147
|
-
export declare interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
2148
|
-
children?: React.ReactNode
|
|
2149
|
-
zOffset?: ResponsiveProp<number>
|
|
2150
|
-
}
|
|
2151
|
-
|
|
1584
|
+
type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<TextAreaOwnProps, E>;
|
|
2152
1585
|
/**
|
|
2153
|
-
*
|
|
1586
|
+
* A multiline text input.
|
|
2154
1587
|
*
|
|
2155
1588
|
* @public
|
|
2156
1589
|
*/
|
|
2157
|
-
|
|
2158
|
-
props: TooltipProps<E>,
|
|
2159
|
-
): React.JSX.Element
|
|
2160
|
-
|
|
1590
|
+
declare function TextArea<E extends TextAreaElementType = typeof DEFAULT_TEXT_AREA_ELEMENT>(props: TextAreaProps<E>): React.JSX.Element;
|
|
2161
1591
|
/**
|
|
2162
1592
|
* @beta
|
|
2163
1593
|
*/
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
visibleTooltipId: string | undefined
|
|
1594
|
+
interface TooltipDelayGroupContextValue {
|
|
1595
|
+
handleOpenChange: (params: {
|
|
1596
|
+
open: boolean;
|
|
1597
|
+
id: string;
|
|
1598
|
+
immediate?: boolean;
|
|
1599
|
+
}) => void;
|
|
1600
|
+
visibleTooltipId: string | undefined;
|
|
2172
1601
|
}
|
|
2173
|
-
|
|
2174
1602
|
/**
|
|
2175
|
-
* @
|
|
2176
|
-
* Provides context for a group of tooltip elements that should share a delay
|
|
2177
|
-
* which temporarily becomes 0ms after the first tooltip of the group opens.
|
|
1603
|
+
* @beta
|
|
2178
1604
|
*/
|
|
2179
|
-
|
|
2180
|
-
props: TooltipDelayGroupProviderProps,
|
|
2181
|
-
): React.JSX.Element
|
|
2182
|
-
|
|
1605
|
+
declare const TooltipDelayGroupContext: Context<TooltipDelayGroupContextValue | null>;
|
|
2183
1606
|
/**
|
|
2184
1607
|
* @public
|
|
2185
1608
|
* */
|
|
2186
|
-
|
|
2187
|
-
children?: ReactNode
|
|
1609
|
+
interface TooltipDelayGroupProviderProps {
|
|
1610
|
+
children?: ReactNode;
|
|
2188
1611
|
/**
|
|
2189
1612
|
* Handles the delays to open or close a tooltip inside a group
|
|
2190
1613
|
*
|
|
@@ -2194,294 +1617,134 @@ export declare interface TooltipDelayGroupProviderProps {
|
|
|
2194
1617
|
*
|
|
2195
1618
|
* @public
|
|
2196
1619
|
*/
|
|
2197
|
-
delay?: Delay
|
|
1620
|
+
delay?: Delay;
|
|
2198
1621
|
}
|
|
2199
|
-
|
|
2200
|
-
/** @public */
|
|
2201
|
-
export declare type TooltipElementType = 'div' | 'span' | ComponentType
|
|
2202
|
-
|
|
2203
|
-
/** @public */
|
|
2204
|
-
export declare type TooltipOwnProps = LayerOwnProps &
|
|
2205
|
-
RadiusStyleProps &
|
|
2206
|
-
ShadowStyleProps & {
|
|
2207
|
-
/**
|
|
2208
|
-
* Whether the tooltip should animate in and out.
|
|
2209
|
-
*
|
|
2210
|
-
* @beta
|
|
2211
|
-
* @defaultValue false
|
|
2212
|
-
*/
|
|
2213
|
-
animate?: boolean
|
|
2214
|
-
/** @deprecated Will be removed in the next major version */
|
|
2215
|
-
arrow?: boolean
|
|
2216
|
-
boundaryElement?: HTMLElement | null
|
|
2217
|
-
children?: React.ReactElement<
|
|
2218
|
-
React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>
|
|
2219
|
-
>
|
|
2220
|
-
content?: React.ReactNode
|
|
2221
|
-
/**
|
|
2222
|
-
* Adds a delay to open or close the tooltip.
|
|
2223
|
-
*
|
|
2224
|
-
* If only a `number` is passed, it will be used for both opening and closing.
|
|
2225
|
-
*
|
|
2226
|
-
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
2227
|
-
*
|
|
2228
|
-
* @public
|
|
2229
|
-
* @defaultValue 0
|
|
2230
|
-
*/
|
|
2231
|
-
delay?: Delay
|
|
2232
|
-
disabled?: boolean
|
|
2233
|
-
fallbackPlacements?: Placement[]
|
|
2234
|
-
hotkeys?: string[]
|
|
2235
|
-
placement?: Placement
|
|
2236
|
-
/** Whether or not to render the tooltip in a portal element. */
|
|
2237
|
-
portal?: boolean | string
|
|
2238
|
-
scheme?: ColorScheme
|
|
2239
|
-
text?: React.ReactNode
|
|
2240
|
-
textSize?: ResponsiveProp<FontTextSize>
|
|
2241
|
-
tone?: CardTone
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
/** @public */
|
|
2245
|
-
export declare type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<
|
|
2246
|
-
TooltipOwnProps,
|
|
2247
|
-
E
|
|
2248
|
-
>
|
|
2249
|
-
|
|
2250
|
-
/**
|
|
2251
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
2252
|
-
* @beta
|
|
2253
|
-
*/
|
|
2254
|
-
export declare function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(
|
|
2255
|
-
props: TreeProps<E>,
|
|
2256
|
-
): React.JSX.Element
|
|
2257
|
-
|
|
2258
1622
|
/**
|
|
2259
|
-
* @
|
|
1623
|
+
* @public
|
|
1624
|
+
* Provides context for a group of tooltip elements that should share a delay
|
|
1625
|
+
* which temporarily becomes 0ms after the first tooltip of the group opens.
|
|
2260
1626
|
*/
|
|
2261
|
-
|
|
2262
|
-
version: 0.0
|
|
2263
|
-
focusedElement: HTMLElement | null
|
|
2264
|
-
gap: ResponsiveProp<Space>
|
|
2265
|
-
level: number
|
|
2266
|
-
path: string[]
|
|
2267
|
-
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void
|
|
2268
|
-
setExpanded: (path: string, expanded: boolean) => void
|
|
2269
|
-
setFocusedElement: (focusedElement: HTMLElement | null) => void
|
|
2270
|
-
state: TreeState
|
|
2271
|
-
}
|
|
2272
|
-
|
|
2273
|
-
/** @beta */
|
|
2274
|
-
export declare type TreeElementType = 'div' | ComponentType
|
|
2275
|
-
|
|
1627
|
+
declare function TooltipDelayGroupProvider(props: TooltipDelayGroupProviderProps): React.JSX.Element;
|
|
2276
1628
|
/**
|
|
2277
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
2278
1629
|
* @beta
|
|
2279
1630
|
*/
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
export declare type TreeItemElementType = 'a' | 'li' | ComponentType
|
|
2286
|
-
|
|
2287
|
-
/** @beta */
|
|
2288
|
-
export declare type TreeItemOwnProps = SelectableOwnProps & {
|
|
2289
|
-
expanded?: boolean
|
|
2290
|
-
fontSize?: ResponsiveProp<FontTextSize>
|
|
2291
|
-
icon?: ElementType_2
|
|
2292
|
-
/**
|
|
2293
|
-
* Allows passing a custom element type to the link component
|
|
2294
|
-
* @internal
|
|
2295
|
-
*/
|
|
2296
|
-
linkAs?: SelectableElementType
|
|
2297
|
-
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>
|
|
2298
|
-
padding?: ResponsiveProp<Space>
|
|
2299
|
-
gap?: ResponsiveProp<Space>
|
|
2300
|
-
/** @deprecated Use `gap` instead */
|
|
2301
|
-
space?: never
|
|
2302
|
-
text?: ReactNode
|
|
2303
|
-
weight?: FontWeight
|
|
1631
|
+
declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue | null;
|
|
1632
|
+
/** @public */
|
|
1633
|
+
interface BoundaryElementProviderProps {
|
|
1634
|
+
children: ReactNode;
|
|
1635
|
+
element: HTMLElement | null;
|
|
2304
1636
|
}
|
|
2305
|
-
|
|
1637
|
+
/** @public */
|
|
1638
|
+
declare function BoundaryElementProvider(props: BoundaryElementProviderProps): React.JSX.Element;
|
|
1639
|
+
/** @public */
|
|
1640
|
+
type BoundaryElementContextValue = HTMLElement | null;
|
|
1641
|
+
/** @public */
|
|
1642
|
+
declare function useBoundaryElement(): {
|
|
1643
|
+
version: 0.0;
|
|
1644
|
+
element: BoundaryElementContextValue;
|
|
1645
|
+
};
|
|
2306
1646
|
/** @beta */
|
|
2307
|
-
|
|
2308
|
-
TreeItemOwnProps,
|
|
2309
|
-
E
|
|
2310
|
-
>
|
|
2311
|
-
|
|
1647
|
+
declare const DEFAULT_ELEMENT_QUERY_ELEMENT = "div";
|
|
2312
1648
|
/**
|
|
2313
|
-
*
|
|
1649
|
+
* DO NOT USE IN PRODUCTION.
|
|
2314
1650
|
* @beta
|
|
2315
1651
|
*/
|
|
2316
|
-
|
|
2317
|
-
|
|
1652
|
+
type ElementQueryOwnProps = {
|
|
1653
|
+
media?: number[];
|
|
1654
|
+
};
|
|
2318
1655
|
/** @beta */
|
|
2319
|
-
|
|
2320
|
-
|
|
1656
|
+
type ElementQueryElementType = 'div' | ComponentType;
|
|
2321
1657
|
/**
|
|
1658
|
+
* DO NOT USE IN PRODUCTION.
|
|
2322
1659
|
* @beta
|
|
2323
1660
|
*/
|
|
2324
|
-
|
|
2325
|
-
[key: string]:
|
|
2326
|
-
| {
|
|
2327
|
-
element: HTMLElement
|
|
2328
|
-
expanded: boolean
|
|
2329
|
-
}
|
|
2330
|
-
| undefined
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
/** @public */
|
|
2334
|
-
export declare function useBoundaryElement(): {
|
|
2335
|
-
version: 0.0
|
|
2336
|
-
element: BoundaryElementContextValue
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
/** @public */
|
|
2340
|
-
export declare function useCard(): CardContextValue
|
|
2341
|
-
|
|
2342
|
-
/** @public */
|
|
2343
|
-
export declare function useClickOutsideEvent(
|
|
2344
|
-
listener: ClickOutsideEventListener | false | undefined,
|
|
2345
|
-
elementsArg?: () => ClickOutsideEventElements,
|
|
2346
|
-
boundaryElement?: () => HTMLElement | null,
|
|
2347
|
-
): void
|
|
2348
|
-
|
|
1661
|
+
type ElementQueryProps<E extends ElementQueryElementType = ElementQueryElementType> = Props<ElementQueryOwnProps, E>;
|
|
2349
1662
|
/**
|
|
1663
|
+
* DO NOT USE IN PRODUCTION.
|
|
2350
1664
|
* @beta
|
|
2351
1665
|
*/
|
|
2352
|
-
|
|
2353
|
-
ref: {
|
|
2354
|
-
current: null | {
|
|
2355
|
-
setCustomValidity: (validity: string) => void
|
|
2356
|
-
}
|
|
2357
|
-
},
|
|
2358
|
-
customValidity: string | undefined,
|
|
2359
|
-
): void
|
|
2360
|
-
|
|
1666
|
+
declare function ElementQuery<E extends ElementQueryElementType = typeof DEFAULT_ELEMENT_QUERY_ELEMENT>(props: ElementQueryProps<E>): React.JSX.Element;
|
|
2361
1667
|
/**
|
|
2362
|
-
*
|
|
1668
|
+
* DO NOT USE IN PRODUCTION
|
|
2363
1669
|
* @beta
|
|
2364
1670
|
*/
|
|
2365
|
-
|
|
2366
|
-
|
|
1671
|
+
type ErrorBoundaryProps = PropsWithChildren<{
|
|
1672
|
+
onCatch: (params: {
|
|
1673
|
+
error: Error;
|
|
1674
|
+
info: ErrorInfo;
|
|
1675
|
+
}) => void;
|
|
1676
|
+
}>;
|
|
2367
1677
|
/**
|
|
2368
|
-
*
|
|
1678
|
+
* DO NOT USE IN PRODUCTION
|
|
2369
1679
|
* @beta
|
|
2370
1680
|
*/
|
|
2371
|
-
|
|
2372
|
-
|
|
1681
|
+
interface ErrorBoundaryState {
|
|
1682
|
+
error: Error | null;
|
|
1683
|
+
}
|
|
2373
1684
|
/**
|
|
2374
|
-
*
|
|
2375
|
-
*
|
|
2376
|
-
* @param onKeyDown - The function to call when a keydown event is triggered.
|
|
2377
|
-
* @param options - The options to pass to the addEventListener function (example, capture: true)
|
|
1685
|
+
* DO NOT USE IN PRODUCTION
|
|
2378
1686
|
* @beta
|
|
2379
1687
|
*/
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
):
|
|
2384
|
-
|
|
1688
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1689
|
+
state: ErrorBoundaryState;
|
|
1690
|
+
static displayName: string;
|
|
1691
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
1692
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
1693
|
+
render(): ReactNode;
|
|
1694
|
+
}
|
|
2385
1695
|
/** @public */
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
/**
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
* @public
|
|
2394
|
-
*/
|
|
2395
|
-
export declare function useMatchMedia(
|
|
2396
|
-
mediaQueryString: `(${string})`,
|
|
2397
|
-
getServerSnapshot?: () => boolean,
|
|
2398
|
-
): boolean
|
|
2399
|
-
|
|
2400
|
-
/**
|
|
2401
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
2402
|
-
* @beta
|
|
2403
|
-
*/
|
|
2404
|
-
export declare function useMediaIndex(): Breakpoint
|
|
2405
|
-
|
|
1696
|
+
interface PortalProps {
|
|
1697
|
+
children: ReactNode;
|
|
1698
|
+
/**
|
|
1699
|
+
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
1700
|
+
*/
|
|
1701
|
+
__unstable_name?: string;
|
|
1702
|
+
}
|
|
2406
1703
|
/** @public */
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
*/
|
|
2420
|
-
|
|
2421
|
-
|
|
1704
|
+
declare function Portal(props: PortalProps): ReactPortal | null;
|
|
1705
|
+
/** @public */
|
|
1706
|
+
interface PortalProviderProps {
|
|
1707
|
+
children: ReactNode;
|
|
1708
|
+
element?: HTMLElement | null;
|
|
1709
|
+
/**
|
|
1710
|
+
* @beta
|
|
1711
|
+
*/
|
|
1712
|
+
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
1713
|
+
}
|
|
1714
|
+
/** @public */
|
|
1715
|
+
declare function PortalProvider(props: PortalProviderProps): React.JSX.Element;
|
|
1716
|
+
/** @public */
|
|
1717
|
+
interface PortalContextValue {
|
|
1718
|
+
version: 0.0;
|
|
1719
|
+
boundaryElement: HTMLElement | null;
|
|
1720
|
+
element: HTMLElement | null;
|
|
1721
|
+
elements?: Record<string, HTMLElement | null | undefined>;
|
|
1722
|
+
}
|
|
1723
|
+
/** @public */
|
|
1724
|
+
declare function usePortal(): PortalContextValue;
|
|
1725
|
+
/** @public */
|
|
1726
|
+
declare const DEFAULT_ROOT_ELEMENT = "html";
|
|
1727
|
+
/** @public */
|
|
1728
|
+
type RootOwnProps = RootStyleProps;
|
|
1729
|
+
/** @public */
|
|
1730
|
+
type RootElementType = 'html' | 'div';
|
|
1731
|
+
/** @public */
|
|
1732
|
+
type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>;
|
|
2422
1733
|
/**
|
|
2423
|
-
*
|
|
2424
|
-
*
|
|
2425
|
-
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
2426
|
-
*
|
|
2427
|
-
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
2428
|
-
* Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
|
|
2429
|
-
* @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b
|
|
1734
|
+
* The `Root` component.
|
|
2430
1735
|
*
|
|
2431
1736
|
* @public
|
|
2432
1737
|
*/
|
|
2433
|
-
|
|
2434
|
-
|
|
1738
|
+
declare function Root<E extends RootElementType = typeof DEFAULT_ROOT_ELEMENT>(props: RootProps<E>): React.JSX.Element;
|
|
2435
1739
|
/** @public */
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
/**
|
|
2444
|
-
* @beta
|
|
2445
|
-
*/
|
|
2446
|
-
export declare function useTree(): TreeContextValue
|
|
2447
|
-
|
|
2448
|
-
export {vars}
|
|
2449
|
-
|
|
2450
|
-
/** @beta */
|
|
2451
|
-
export declare function VirtualList<
|
|
2452
|
-
E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT,
|
|
2453
|
-
Item = any,
|
|
2454
|
-
>(props: VirtualListProps<E, Item>): React.JSX.Element
|
|
2455
|
-
|
|
2456
|
-
/** @beta */
|
|
2457
|
-
export declare interface VirtualListChangeOpts {
|
|
2458
|
-
fromIndex: number
|
|
2459
|
-
gap: number
|
|
2460
|
-
itemHeight: number
|
|
2461
|
-
scrollHeight: number
|
|
2462
|
-
scrollTop: number
|
|
2463
|
-
toIndex: number
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
/** @beta */
|
|
2467
|
-
export declare type VirtualListElementType = 'div' | ComponentType
|
|
2468
|
-
|
|
2469
|
-
/** @beta */
|
|
2470
|
-
export declare interface VirtualListOwnProps<Item = any> {
|
|
2471
|
-
gap?: Space
|
|
2472
|
-
getItemKey?: (item: Item, itemIndex: number) => string
|
|
2473
|
-
items?: Item[]
|
|
2474
|
-
onChange?: (opts: VirtualListChangeOpts) => void
|
|
2475
|
-
renderItem?: (item: Item) => ReactNode
|
|
1740
|
+
interface RootProviderProps {
|
|
1741
|
+
boundaryElement: HTMLElement | null;
|
|
1742
|
+
children?: ReactNode;
|
|
1743
|
+
portalElement: HTMLElement | null;
|
|
1744
|
+
scheme: ColorScheme;
|
|
1745
|
+
tone: CardTone;
|
|
2476
1746
|
}
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
export
|
|
2480
|
-
|
|
2481
|
-
Item = any,
|
|
2482
|
-
> = Props<VirtualListOwnProps<Item>, E>
|
|
2483
|
-
|
|
2484
|
-
export * from '@sanity/ui-tokens'
|
|
2485
|
-
export * from '@sanity/ui-tokens/constants'
|
|
2486
|
-
|
|
2487
|
-
export {}
|
|
1747
|
+
/** @public */
|
|
1748
|
+
declare function RootProvider(props: RootProviderProps): React.JSX.Element;
|
|
1749
|
+
export { AVATAR_COLORS, AVATAR_SIZE, Assign, Autocomplete, AutocompleteElementType, AutocompleteInputChangeMsg, AutocompleteInputFoocusMsg, AutocompleteMsg, AutocompleteOpenButtonProps, AutocompleteOwnProps, AutocompleteProps, AutocompleteRootBlurMsg, AutocompleteRootClearMsg, AutocompleteRootEscapeMsg, AutocompleteRootOpenMsg, AutocompleteRootSetActiveValueMsg, AutocompleteRootSetListFocusedMsg, AutocompleteState, AutocompleteValueChangeMsg, Avatar, AvatarCounter, AvatarCounterElementType, AvatarCounterOwnProps, AvatarCounterProps, AvatarElementType, AvatarOwnProps, AvatarPosition, AvatarProps, AvatarStack, AvatarStackChild, AvatarStackElementType, AvatarStackOwnProps, AvatarStackProps, BG_PATTERNS, BORDER_STYLE, BORDER_WIDTH, BREAKPOINTS, BUTTON_MODES, Badge, BadgeElementType, BadgeOwnProps, BadgeProps, BaseAutocompleteOption, BoundaryElementContextValue, BoundaryElementProvider, BoundaryElementProviderProps, Box, BoxElementType, BoxOwnProps, BoxProps, Breadcrumbs, BreadcrumbsElementType, BreadcrumbsOwnProps, BreadcrumbsProps, Button, ButtonElementType, ButtonOwnProps, ButtonProps, ButtonTextAlign, CARD_TONES, COLOR_SCHEMES, COLOR_VARIANTS, CONTAINER, CONTAINER_SCALE, Card, CardContextValue, CardElementType, CardOwnProps, CardProps, CardProvider, Checkbox, CheckboxElementType, CheckboxOwnProps, CheckboxProps, ClickOutsideEventElements, ClickOutsideEventListener, Code, CodeElementType, CodeOwnProps, CodeProps, CodeSkeleton, CodeSkeletonElementType, CodeSkeletonOwnProps, CodeSkeletonProps, ComponentType, Container, ContainerElementType, ContainerOwnProps, ContainerProps, DEFAULT_AUTOCOMPLETE_ELEMENT, DEFAULT_AVATAR_COUNTER_ELEMENT, DEFAULT_AVATAR_ELEMENT, DEFAULT_AVATAR_STACK_ELEMENT, DEFAULT_BADGE_ELEMENT, DEFAULT_BOX_ELEMENT, DEFAULT_BREADCRUMBS_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_CHECKBOX_ELEMENT, DEFAULT_CODE_ELEMENT, DEFAULT_CODE_SKELETON_ELEMENT, DEFAULT_CONTAINER_ELEMENT, DEFAULT_DIALOG_ELEMENT, DEFAULT_ELEMENT_QUERY_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HEADING_ELEMENT, DEFAULT_HEADING_SKELETON_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_INLINE_CODE_ELEMENT, DEFAULT_INLINE_ELEMENT, DEFAULT_KBD_ELEMENT, DEFAULT_LABEL_ELEMENT, DEFAULT_LABEL_SKELETON_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_RADIO_ELEMENT, DEFAULT_ROOT_ELEMENT, DEFAULT_SELECTABLE_ELEMENT, DEFAULT_SELECT_ELEMENT, DEFAULT_SKELETON_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_SR_ONLY_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_SWITCH_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TAB_PANEL_ELEMENT, DEFAULT_TEXT_AREA_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TEXT_SKELETON_ELEMENT, DEFAULT_TOAST_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, DEFAULT_TREE_ELEMENT, DEFAULT_TREE_ITEM_ELEMENT, DEFAULT_VIRTUAL_LIST_ELEMENT, Delay, Dialog, DialogContext, DialogContextValue, DialogElementType, DialogOwnProps, DialogPosition, DialogProps, DialogProvider, DialogProviderProps, ELEMENT_TONES, ElementQuery, ElementQueryElementType, ElementQueryOwnProps, ElementQueryProps, ElementRectValue, ElementSize, ElementType, EmptyProps, ErrorBoundary, ErrorBoundaryProps, ErrorBoundaryState, FONT_CODE_SIZE, FONT_HEADING_SIZE, FONT_LABEL_SIZE, FONT_TEXT_SIZE, FONT_WEIGHT, Flex, FlexElementType, FlexOwnProps, FlexProps, Grid, GridElementType, GridOwnProps, GridProps, HUES, Heading, HeadingElementType, HeadingOwnProps, HeadingProps, HeadingSkeleton, HeadingSkeletonElementType, HeadingSkeletonOwnProps, HeadingSkeletonProps, Hotkeys, HotkeysElementType, HotkeysOwnProps, HotkeysProps, Inline, InlineCode, InlineCodeProps, InlineElementType, InlineOwnProps, InlineProps, KBD, KBDElementType, KBDOwnProps, KBDProps, Label, LabelElementType, LabelOwnProps, LabelProps, LabelSkeleton, LabelSkeletonElementType, LabelSkeletonOwnProps, LabelSkeletonProps, Layer, LayerContextValue, LayerElementType, LayerOwnProps, LayerProps, LayerProvider, LayerProviderProps, LazySyntax, Menu, MenuButton, MenuButtonProps, MenuDivider, MenuDividerElementType, MenuDividerOwnProps, MenuDividerProps, MenuElementType, MenuGroup, MenuGroupElementType, MenuGroupOwnProps, MenuGroupProps, MenuItem, MenuItemElementType, MenuItemOwnProps, MenuItemProps, MenuOwnProps, MenuProps, Placement, Popover, PopoverElementType, PopoverMargins, PopoverOwnProps, PopoverProps, PopoverUpdateCallback, PopoverWidth, Portal, PortalContextValue, PortalProps, PortalProvider, PortalProviderProps, Props, RADIUS, Radio, RadioElementType, RadioOwnProps, RadioProps, type ResponsiveProp, ResponsiveWidthStyleProps, Root, RootElementType, RootOwnProps, RootProps, RootProvider, RootProviderProps, SHADOW, SPACE, Select, SelectElementType, SelectOwnProps, SelectProps, Selectable, SelectableElementType, SelectableOwnProps, SelectableProps, Skeleton, SkeletonElementType, SkeletonOwnProps, SkeletonProps, Spinner, SpinnerElementType, SpinnerOwnProps, SpinnerProps, SrOnly, SrOnlyElementType, SrOnlyOwnProps, SrOnlyProps, Stack, StackElementType, StackOwnProps, StackProps, Switch, SwitchElementType, SwitchOwnProps, SwitchProps, TINTS, Tab, TabElementType, TabList, TabListElementType, TabListOwnProps, TabListProps, TabOwnProps, TabPanel, TabPanelElementType, TabPanelOwnProps, TabPanelProps, TabProps, TagType, Text, TextArea, TextAreaElementType, TextAreaOwnProps, TextAreaProps, TextElementType, TextInput, TextInputClearButtonProps, TextInputElementType, TextInputOwnProps, TextInputProps, TextOwnProps, TextProps, TextSkeleton, TextSkeletonElementType, TextSkeletonOwnProps, TextSkeletonProps, Toast, ToastContextValue, ToastElementType, ToastOwnProps, ToastParams, ToastProps, ToastProvider, ToastProviderProps, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupContextValue, TooltipDelayGroupProvider, TooltipDelayGroupProviderProps, TooltipElementType, TooltipOwnProps, TooltipProps, Tree, TreeContextValue, TreeElementType, TreeItem, TreeItemElementType, TreeItemOwnProps, TreeItemProps, TreeOwnProps, TreeProps, TreeState, VirtualList, VirtualListChangeOpts, VirtualListElementType, VirtualListOwnProps, VirtualListProps, _CODE_TOKEN_KEYS, _CardCompatProviderComponent, _CardInternalContextValue, _ElementSizeListener, _ElementSizeObserver, _ElementSizeSubscriber, _MediaStore, _elementSizeObserver, _getResponsiveProp, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, attemptFocus, containsOrEqualsElement, focusFirstDescendant, focusLastDescendant, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, useBoundaryElement, useCard, useClickOutsideEvent, useCustomValidity, useDialog, useElementSize, useGlobalKeyDown, useLayer, useMatchMedia, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useToast, useTooltipDelayGroup, useTree, vars };
|
|
1750
|
+
//# sourceMappingURL=index.d.ts.map
|