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