@sanity/ui 3.1.14 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +323 -292
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +323 -292
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +195 -76
- package/dist/_visual-editing.d.ts +195 -76
- package/dist/index.d.mts +308 -140
- package/dist/index.d.ts +308 -140
- package/dist/index.js +97 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -93
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +10 -4
- package/dist/theme.d.ts +10 -4
- package/package.json +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +1 -1
- package/src/core/components/autocomplete/types.ts +2 -2
- package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +51 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +7 -3
- package/src/core/components/hotkeys/hotkeys.test.tsx +42 -0
- package/src/core/components/hotkeys/hotkeys.tsx +7 -3
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
- package/src/core/components/menu/menu.spacing.test.tsx +63 -0
- package/src/core/components/menu/menu.tsx +8 -2
- package/src/core/components/menu/menuDivider.ts +16 -5
- package/src/core/components/menu/menuGroup.spacing.test.tsx +63 -0
- package/src/core/components/menu/menuGroup.tsx +22 -8
- package/src/core/components/menu/menuItem.spacing.test.tsx +59 -0
- package/src/core/components/menu/menuItem.tsx +25 -8
- package/src/core/components/skeleton/skeleton.tsx +2 -2
- package/src/core/components/tab/tabList.test.tsx +48 -0
- package/src/core/components/tab/tabList.tsx +2 -2
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/styles.ts +2 -2
- package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/tree.test.tsx +55 -0
- package/src/core/components/tree/tree.tsx +19 -10
- package/src/core/components/tree/treeGroup.tsx +3 -3
- package/src/core/components/tree/treeItem.test.tsx +65 -0
- package/src/core/components/tree/treeItem.tsx +11 -4
- package/src/core/components/tree/types.ts +4 -0
- package/src/core/primitives/avatar/avatar.tsx +19 -11
- package/src/core/primitives/badge/badge.tsx +20 -12
- package/src/core/primitives/box/__workshop__/asComponent.tsx +31 -0
- package/src/core/primitives/box/__workshop__/index.ts +5 -0
- package/src/core/primitives/box/box.test.tsx +142 -0
- package/src/core/primitives/box/box.tsx +41 -18
- package/src/core/primitives/button/__workshop__/disabled.tsx +2 -2
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +1 -1
- package/src/core/primitives/button/button.test.tsx +41 -3
- package/src/core/primitives/button/button.tsx +36 -12
- package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/core/primitives/card/card.tsx +24 -13
- package/src/core/primitives/code/code.tsx +16 -7
- package/src/core/primitives/container/container.tsx +23 -10
- package/src/core/primitives/flex/flex.tsx +21 -11
- package/src/core/primitives/grid/grid.test.tsx +80 -0
- package/src/core/primitives/grid/grid.tsx +39 -13
- package/src/core/primitives/heading/heading.tsx +19 -11
- package/src/core/primitives/inline/inline.test.tsx +51 -0
- package/src/core/primitives/inline/inline.tsx +28 -12
- package/src/core/primitives/kbd/kbd.tsx +19 -11
- package/src/core/primitives/label/label.tsx +19 -11
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +1 -1
- package/src/core/primitives/select/select.test.tsx +52 -0
- package/src/core/primitives/select/select.tsx +8 -2
- package/src/core/primitives/stack/stack.test.tsx +57 -0
- package/src/core/primitives/stack/stack.tsx +27 -13
- package/src/core/primitives/text/text.tsx +19 -11
- package/src/core/primitives/textInput/textInput.test.tsx +48 -0
- package/src/core/primitives/textInput/textInput.tsx +9 -4
- package/src/core/primitives/types.ts +33 -0
- package/src/core/types/component.ts +32 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +2 -2
- package/src/theme/system/css.ts +10 -4
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {BaseTheme} from '@sanity/ui/theme'
|
|
2
|
-
import {DetailedHTMLProps} from 'react'
|
|
3
|
-
import {FastOmit} from 'styled-components'
|
|
4
2
|
import {ForwardRefExoticComponent} from 'react'
|
|
5
|
-
import {HTMLAttributes} from 'react'
|
|
6
3
|
import {HTMLProps} from 'react'
|
|
7
|
-
import {IStyledComponentBase} from 'styled-components/dist/types'
|
|
8
4
|
import {Ref} from 'react'
|
|
9
5
|
import {RefAttributes} from 'react'
|
|
10
6
|
import {RootTheme} from '@sanity/ui/theme'
|
|
@@ -15,16 +11,20 @@ import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
|
15
11
|
import {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
16
12
|
import {ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
17
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
declare type Assign<T extends object, U extends object> = Omit<T, keyof U> & U
|
|
20
|
+
|
|
18
21
|
/**
|
|
19
22
|
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
20
23
|
* for flex, margins and padding.
|
|
21
24
|
*
|
|
22
25
|
* @public
|
|
23
26
|
*/
|
|
24
|
-
export declare const Box:
|
|
25
|
-
Omit<BoxProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
|
|
26
|
-
RefAttributes<HTMLDivElement>
|
|
27
|
-
>
|
|
27
|
+
export declare const Box: <E extends ElementType = 'div'>(props: BoxProps<E>) => React.JSX.Element
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @public
|
|
@@ -42,18 +42,24 @@ declare type BoxHeight = 'stretch' | 'fill'
|
|
|
42
42
|
declare type BoxOverflow = 'visible' | 'hidden' | 'auto'
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
+
* The props that `Box` adds on top of the element it renders as.
|
|
46
|
+
*
|
|
45
47
|
* @public
|
|
46
48
|
*/
|
|
47
|
-
declare interface
|
|
49
|
+
declare interface BoxOwnProps
|
|
48
50
|
extends ResponsiveFlexItemProps,
|
|
49
51
|
ResponsiveBoxProps,
|
|
50
52
|
ResponsiveGridItemProps,
|
|
51
53
|
ResponsiveMarginProps,
|
|
52
54
|
ResponsivePaddingProps {
|
|
53
|
-
|
|
54
|
-
forwardedAs?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
55
|
+
forwardedAs?: ElementType
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
declare type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>
|
|
62
|
+
|
|
57
63
|
/**
|
|
58
64
|
* @public
|
|
59
65
|
*/
|
|
@@ -62,10 +68,9 @@ declare type BoxSizing = 'content' | 'border'
|
|
|
62
68
|
/**
|
|
63
69
|
* @public
|
|
64
70
|
*/
|
|
65
|
-
export declare const Button:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
>
|
|
71
|
+
export declare const Button: <E extends ElementType = 'button'>(
|
|
72
|
+
props: ButtonProps<E>,
|
|
73
|
+
) => React.JSX.Element
|
|
69
74
|
|
|
70
75
|
/**
|
|
71
76
|
* @public
|
|
@@ -75,8 +80,7 @@ declare type ButtonMode = ThemeColorButtonModeKey
|
|
|
75
80
|
/**
|
|
76
81
|
* @public
|
|
77
82
|
*/
|
|
78
|
-
declare interface
|
|
79
|
-
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
83
|
+
declare interface ButtonOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
80
84
|
fontSize?: number | number[]
|
|
81
85
|
mode?: ButtonMode
|
|
82
86
|
icon?: React.ElementType | React.ReactNode
|
|
@@ -87,7 +91,11 @@ declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveRadiusPr
|
|
|
87
91
|
*/
|
|
88
92
|
loading?: boolean
|
|
89
93
|
selected?: boolean
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
96
|
+
*/
|
|
90
97
|
space?: number | number[]
|
|
98
|
+
gap?: number | number[]
|
|
91
99
|
muted?: boolean
|
|
92
100
|
text?: React.ReactNode
|
|
93
101
|
textAlign?: ButtonTextAlign
|
|
@@ -97,6 +105,11 @@ declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveRadiusPr
|
|
|
97
105
|
width?: ButtonWidth
|
|
98
106
|
}
|
|
99
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
declare type ButtonProps<E extends ElementType = 'button'> = Props<ButtonOwnProps, E>
|
|
112
|
+
|
|
100
113
|
/**
|
|
101
114
|
* @public
|
|
102
115
|
*/
|
|
@@ -118,16 +131,13 @@ declare type ButtonWidth = 'fill'
|
|
|
118
131
|
*
|
|
119
132
|
* @public
|
|
120
133
|
*/
|
|
121
|
-
export declare const Card:
|
|
122
|
-
Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
|
|
123
|
-
RefAttributes<HTMLDivElement>
|
|
124
|
-
>
|
|
134
|
+
export declare const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element
|
|
125
135
|
|
|
126
136
|
/**
|
|
127
137
|
* @public
|
|
128
138
|
*/
|
|
129
|
-
declare interface
|
|
130
|
-
extends
|
|
139
|
+
declare interface CardOwnProps
|
|
140
|
+
extends BoxOwnProps,
|
|
131
141
|
ResponsiveBorderProps,
|
|
132
142
|
ResponsiveRadiusProps,
|
|
133
143
|
ResponsiveShadowProps {
|
|
@@ -141,17 +151,30 @@ declare interface CardProps
|
|
|
141
151
|
* @beta
|
|
142
152
|
*/
|
|
143
153
|
__unstable_focusRing?: boolean
|
|
154
|
+
disabled?: boolean
|
|
144
155
|
muted?: boolean
|
|
145
156
|
pressed?: boolean
|
|
146
157
|
scheme?: ThemeColorSchemeKey
|
|
158
|
+
selected?: boolean
|
|
147
159
|
tone?: CardTone
|
|
148
160
|
}
|
|
149
161
|
|
|
162
|
+
/**
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
declare type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>
|
|
166
|
+
|
|
150
167
|
/**
|
|
151
168
|
* @public
|
|
152
169
|
*/
|
|
153
170
|
declare type CardTone = ThemeColorCardToneKey | 'inherit'
|
|
154
171
|
|
|
172
|
+
/** @public */
|
|
173
|
+
declare type ComponentType<P = any> =
|
|
174
|
+
| React.FunctionComponent<P>
|
|
175
|
+
| React.ComponentClass<P>
|
|
176
|
+
| React.ExoticComponent<P>
|
|
177
|
+
|
|
155
178
|
/**
|
|
156
179
|
* @public
|
|
157
180
|
*/
|
|
@@ -162,15 +185,18 @@ declare type Delay =
|
|
|
162
185
|
close: number
|
|
163
186
|
}>
|
|
164
187
|
|
|
188
|
+
/** @public */
|
|
189
|
+
declare type ElementType<P = any> = TagType | ComponentType<P>
|
|
190
|
+
|
|
191
|
+
/** @public */
|
|
192
|
+
declare type EmptyProps = object
|
|
193
|
+
|
|
165
194
|
/**
|
|
166
195
|
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
167
196
|
*
|
|
168
197
|
* @public
|
|
169
198
|
*/
|
|
170
|
-
export declare const Flex:
|
|
171
|
-
Omit<FlexProps & Omit<HTMLProps<HTMLDivElement>, 'wrap' | 'as'>, 'ref'> &
|
|
172
|
-
RefAttributes<HTMLDivElement>
|
|
173
|
-
>
|
|
199
|
+
export declare const Flex: <E extends ElementType = 'div'>(props: FlexProps<E>) => React.JSX.Element
|
|
174
200
|
|
|
175
201
|
/**
|
|
176
202
|
* @public
|
|
@@ -196,13 +222,18 @@ declare type FlexJustify =
|
|
|
196
222
|
/**
|
|
197
223
|
* @public
|
|
198
224
|
*/
|
|
199
|
-
declare interface
|
|
200
|
-
extends Omit<
|
|
225
|
+
declare interface FlexOwnProps
|
|
226
|
+
extends Omit<BoxOwnProps, 'display'>,
|
|
201
227
|
ResponsiveFlexProps,
|
|
202
228
|
ResponsiveFlexItemProps {
|
|
203
229
|
gap?: number | number[]
|
|
204
230
|
}
|
|
205
231
|
|
|
232
|
+
/**
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
declare type FlexProps<E extends ElementType = 'div'> = Props<FlexOwnProps, E>
|
|
236
|
+
|
|
206
237
|
/**
|
|
207
238
|
* @public
|
|
208
239
|
*/
|
|
@@ -218,10 +249,7 @@ declare type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap'
|
|
|
218
249
|
*
|
|
219
250
|
* @public
|
|
220
251
|
*/
|
|
221
|
-
export declare const Grid:
|
|
222
|
-
Omit<GridProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'rows'>, 'ref'> &
|
|
223
|
-
RefAttributes<HTMLDivElement>
|
|
224
|
-
>
|
|
252
|
+
export declare const Grid: <E extends ElementType = 'div'>(props: GridProps<E>) => React.JSX.Element
|
|
225
253
|
|
|
226
254
|
/**
|
|
227
255
|
* @public
|
|
@@ -271,7 +299,12 @@ declare type GridItemRowStart = 'auto' | number
|
|
|
271
299
|
/**
|
|
272
300
|
* @public
|
|
273
301
|
*/
|
|
274
|
-
declare interface
|
|
302
|
+
declare interface GridOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveGridProps {}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @public
|
|
306
|
+
*/
|
|
307
|
+
declare type GridProps<E extends ElementType = 'div'> = Props<GridOwnProps, E>
|
|
275
308
|
|
|
276
309
|
/**
|
|
277
310
|
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
@@ -279,7 +312,7 @@ declare interface GridProps extends Omit<BoxProps, 'display'>, ResponsiveGridPro
|
|
|
279
312
|
* @public
|
|
280
313
|
*/
|
|
281
314
|
export declare const Hotkeys: ForwardRefExoticComponent<
|
|
282
|
-
HotkeysProps & Omit<HTMLProps<HTMLElement>, 'size' | '
|
|
315
|
+
HotkeysProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as' | 'ref'> & RefAttributes<HTMLElement>
|
|
283
316
|
>
|
|
284
317
|
|
|
285
318
|
/**
|
|
@@ -287,8 +320,12 @@ export declare const Hotkeys: ForwardRefExoticComponent<
|
|
|
287
320
|
*/
|
|
288
321
|
declare interface HotkeysProps {
|
|
289
322
|
fontSize?: number | number[]
|
|
323
|
+
gap?: number | number[]
|
|
290
324
|
padding?: number | number[]
|
|
291
325
|
radius?: Radius | Radius[]
|
|
326
|
+
/**
|
|
327
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
328
|
+
*/
|
|
292
329
|
space?: number | number[]
|
|
293
330
|
keys?: string[]
|
|
294
331
|
}
|
|
@@ -296,9 +333,14 @@ declare interface HotkeysProps {
|
|
|
296
333
|
/**
|
|
297
334
|
* @public
|
|
298
335
|
*/
|
|
299
|
-
declare interface
|
|
300
|
-
/**
|
|
336
|
+
declare interface InlineOwnProps extends Omit<BoxOwnProps, 'display'> {
|
|
337
|
+
/**
|
|
338
|
+
* The spacing between children.
|
|
339
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
340
|
+
*/
|
|
301
341
|
space?: number | number[]
|
|
342
|
+
/** The spacing between children. */
|
|
343
|
+
gap?: number | number[]
|
|
302
344
|
}
|
|
303
345
|
|
|
304
346
|
/**
|
|
@@ -344,36 +386,33 @@ declare interface LayerProviderProps {
|
|
|
344
386
|
* @public
|
|
345
387
|
*/
|
|
346
388
|
export declare const Menu: ForwardRefExoticComponent<
|
|
347
|
-
Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | '
|
|
389
|
+
Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'tabIndex' | 'role'>, 'ref'> &
|
|
348
390
|
RefAttributes<HTMLDivElement>
|
|
349
391
|
>
|
|
350
392
|
|
|
351
393
|
/**
|
|
352
394
|
* @public
|
|
353
395
|
*/
|
|
354
|
-
export declare const MenuDivider:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
> &
|
|
358
|
-
string
|
|
396
|
+
export declare const MenuDivider: <E extends ElementType = 'hr'>(
|
|
397
|
+
props: MenuDividerProps<E>,
|
|
398
|
+
) => React.JSX.Element
|
|
359
399
|
|
|
360
400
|
/**
|
|
361
401
|
* @public
|
|
362
402
|
*/
|
|
363
|
-
|
|
364
|
-
props: Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'popover' | 'ref' | 'tabIndex'> &
|
|
365
|
-
MenuGroupProps,
|
|
366
|
-
): React.JSX.Element
|
|
403
|
+
declare type MenuDividerProps<E extends ElementType = 'hr'> = Props<EmptyProps, E>
|
|
367
404
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
405
|
+
/**
|
|
406
|
+
* @public
|
|
407
|
+
*/
|
|
408
|
+
export declare const MenuGroup: <E extends ElementType = 'button'>(
|
|
409
|
+
props: MenuGroupProps<E>,
|
|
410
|
+
) => React.JSX.Element
|
|
371
411
|
|
|
372
412
|
/**
|
|
373
413
|
* @public
|
|
374
414
|
*/
|
|
375
|
-
declare interface
|
|
376
|
-
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
415
|
+
declare interface MenuGroupOwnProps {
|
|
377
416
|
fontSize?: number | number[]
|
|
378
417
|
icon?: React.ElementType | React.ReactNode
|
|
379
418
|
menu?: Omit<
|
|
@@ -390,6 +429,10 @@ declare interface MenuGroupProps {
|
|
|
390
429
|
padding?: number | number[]
|
|
391
430
|
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
392
431
|
radius?: Radius | Radius[]
|
|
432
|
+
gap?: number | number[]
|
|
433
|
+
/**
|
|
434
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
435
|
+
*/
|
|
393
436
|
space?: number | number[]
|
|
394
437
|
text: React.ReactNode
|
|
395
438
|
tone?: SelectableTone
|
|
@@ -398,28 +441,39 @@ declare interface MenuGroupProps {
|
|
|
398
441
|
/**
|
|
399
442
|
* @public
|
|
400
443
|
*/
|
|
401
|
-
|
|
402
|
-
MenuItemProps &
|
|
403
|
-
Omit<HTMLProps<HTMLDivElement>, 'selected' | 'height' | 'ref' | 'tabIndex' | 'as'> &
|
|
404
|
-
RefAttributes<HTMLDivElement>
|
|
405
|
-
>
|
|
444
|
+
declare type MenuGroupProps<E extends ElementType = 'button'> = Props<MenuGroupOwnProps, E>
|
|
406
445
|
|
|
407
446
|
/**
|
|
408
447
|
* @public
|
|
409
448
|
*/
|
|
410
|
-
export declare
|
|
411
|
-
|
|
449
|
+
export declare const MenuItem: <E extends ElementType = 'button'>(
|
|
450
|
+
props: MenuItemProps<E>,
|
|
451
|
+
) => React.JSX.Element
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* @public
|
|
455
|
+
*/
|
|
456
|
+
declare interface MenuItemOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
412
457
|
fontSize?: number | number[]
|
|
413
458
|
hotkeys?: string[]
|
|
414
459
|
icon?: React.ElementType | React.ReactNode
|
|
415
460
|
iconRight?: React.ElementType | React.ReactNode
|
|
416
461
|
pressed?: boolean
|
|
417
462
|
selected?: boolean
|
|
463
|
+
gap?: number | number[]
|
|
464
|
+
/**
|
|
465
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
466
|
+
*/
|
|
418
467
|
space?: number | number[]
|
|
419
468
|
text?: React.ReactNode
|
|
420
469
|
tone?: SelectableTone
|
|
421
470
|
}
|
|
422
471
|
|
|
472
|
+
/**
|
|
473
|
+
* @public
|
|
474
|
+
*/
|
|
475
|
+
export declare type MenuItemProps<E extends ElementType = 'button'> = Props<MenuItemOwnProps, E>
|
|
476
|
+
|
|
423
477
|
/**
|
|
424
478
|
* @public
|
|
425
479
|
*/
|
|
@@ -439,6 +493,10 @@ declare interface MenuProps extends ResponsivePaddingProps {
|
|
|
439
493
|
'originElement'?: HTMLElement | null
|
|
440
494
|
'registerElement'?: (el: HTMLElement) => () => void
|
|
441
495
|
'shouldFocus'?: 'first' | 'last' | null
|
|
496
|
+
'gap'?: number | number[]
|
|
497
|
+
/**
|
|
498
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
499
|
+
*/
|
|
442
500
|
'space'?: number | number[]
|
|
443
501
|
'aria-labelledby'?: string
|
|
444
502
|
'onBlurCapture'?: (event: FocusEvent) => void
|
|
@@ -470,7 +528,7 @@ declare type Placement =
|
|
|
470
528
|
*/
|
|
471
529
|
export declare const Popover: ForwardRefExoticComponent<
|
|
472
530
|
Omit<
|
|
473
|
-
PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'width' | '
|
|
531
|
+
PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'width' | 'as' | 'children'>,
|
|
474
532
|
'ref'
|
|
475
533
|
> &
|
|
476
534
|
RefAttributes<HTMLDivElement>
|
|
@@ -612,6 +670,19 @@ declare interface PortalProviderProps {
|
|
|
612
670
|
__unstable_elements?: Record<string, HTMLElement | null | undefined>
|
|
613
671
|
}
|
|
614
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Resolves the props of a polymorphic component: the props of the element/component passed to `as`
|
|
675
|
+
* (defaulting to the component's own element), with the component's own props assigned on top.
|
|
676
|
+
*
|
|
677
|
+
* @public
|
|
678
|
+
*/
|
|
679
|
+
declare type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<
|
|
680
|
+
E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>,
|
|
681
|
+
P & {
|
|
682
|
+
as?: E
|
|
683
|
+
}
|
|
684
|
+
>
|
|
685
|
+
|
|
615
686
|
/**
|
|
616
687
|
* @public
|
|
617
688
|
*/
|
|
@@ -660,11 +731,35 @@ declare interface ResponsiveFlexProps {
|
|
|
660
731
|
* @public
|
|
661
732
|
*/
|
|
662
733
|
declare interface ResponsiveGridItemProps {
|
|
734
|
+
gridColumn?: GridItemColumn | GridItemColumn[]
|
|
735
|
+
/**
|
|
736
|
+
* @deprecated Use `gridColumn` instead. `column` will be removed in v4.
|
|
737
|
+
*/
|
|
663
738
|
column?: GridItemColumn | GridItemColumn[]
|
|
739
|
+
gridColumnStart?: GridItemColumnStart | GridItemColumnStart[]
|
|
740
|
+
/**
|
|
741
|
+
* @deprecated Use `gridColumnStart` instead. `columnStart` will be removed in v4.
|
|
742
|
+
*/
|
|
664
743
|
columnStart?: GridItemColumnStart | GridItemColumnStart[]
|
|
744
|
+
gridColumnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
|
|
745
|
+
/**
|
|
746
|
+
* @deprecated Use `gridColumnEnd` instead. `columnEnd` will be removed in v4.
|
|
747
|
+
*/
|
|
665
748
|
columnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
|
|
749
|
+
gridRow?: GridItemRow | GridItemRow[]
|
|
750
|
+
/**
|
|
751
|
+
* @deprecated Use `gridRow` instead. `row` will be removed in v4.
|
|
752
|
+
*/
|
|
666
753
|
row?: GridItemRow | GridItemRow[]
|
|
754
|
+
gridRowStart?: GridItemRowStart | GridItemRowStart[]
|
|
755
|
+
/**
|
|
756
|
+
* @deprecated Use `gridRowStart` instead. `rowStart` will be removed in v4.
|
|
757
|
+
*/
|
|
667
758
|
rowStart?: GridItemRowStart | GridItemRowStart[]
|
|
759
|
+
gridRowEnd?: GridItemRowEnd | GridItemRowEnd[]
|
|
760
|
+
/**
|
|
761
|
+
* @deprecated Use `gridRowEnd` instead. `rowEnd` will be removed in v4.
|
|
762
|
+
*/
|
|
668
763
|
rowEnd?: GridItemRowEnd | GridItemRowEnd[]
|
|
669
764
|
}
|
|
670
765
|
|
|
@@ -675,11 +770,19 @@ declare interface ResponsiveGridProps {
|
|
|
675
770
|
autoRows?: GridAutoRows | GridAutoRows[]
|
|
676
771
|
autoCols?: GridAutoCols | GridAutoCols[]
|
|
677
772
|
autoFlow?: GridAutoFlow | GridAutoFlow[]
|
|
773
|
+
/**
|
|
774
|
+
* @deprecated Use `gridTemplateColumns` instead. `columns` will be removed in v4.
|
|
775
|
+
*/
|
|
678
776
|
columns?: number | number[]
|
|
777
|
+
gridTemplateColumns?: number | number[]
|
|
679
778
|
gap?: number | number[]
|
|
680
779
|
gapX?: number | number[]
|
|
681
780
|
gapY?: number | number[]
|
|
781
|
+
/**
|
|
782
|
+
* @deprecated Use `gridTemplateRows` instead. `rows` will be removed in v4.
|
|
783
|
+
*/
|
|
682
784
|
rows?: number | number[]
|
|
785
|
+
gridTemplateRows?: number | number[]
|
|
683
786
|
}
|
|
684
787
|
|
|
685
788
|
/**
|
|
@@ -753,18 +856,26 @@ declare interface SpinnerProps {
|
|
|
753
856
|
*
|
|
754
857
|
* @public
|
|
755
858
|
*/
|
|
756
|
-
export declare const Stack:
|
|
757
|
-
StackProps
|
|
758
|
-
|
|
859
|
+
export declare const Stack: <E extends ElementType = 'div'>(
|
|
860
|
+
props: StackProps<E>,
|
|
861
|
+
) => React.JSX.Element
|
|
759
862
|
|
|
760
863
|
/**
|
|
761
864
|
* @public
|
|
762
865
|
*/
|
|
763
|
-
declare interface
|
|
764
|
-
|
|
866
|
+
declare interface StackOwnProps extends BoxOwnProps {
|
|
867
|
+
gap?: number | number[]
|
|
868
|
+
/**
|
|
869
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
870
|
+
*/
|
|
765
871
|
space?: number | number[]
|
|
766
872
|
}
|
|
767
873
|
|
|
874
|
+
/**
|
|
875
|
+
* @public
|
|
876
|
+
*/
|
|
877
|
+
declare type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>
|
|
878
|
+
|
|
768
879
|
/**
|
|
769
880
|
* @public
|
|
770
881
|
* @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
|
|
@@ -779,7 +890,7 @@ export declare const Tab: ForwardRefExoticComponent<
|
|
|
779
890
|
TabProps &
|
|
780
891
|
Omit<
|
|
781
892
|
HTMLProps<HTMLButtonElement>,
|
|
782
|
-
'label' | 'id' | 'type' | '
|
|
893
|
+
'width' | 'label' | 'id' | 'type' | 'as' | 'aria-controls'
|
|
783
894
|
>,
|
|
784
895
|
'ref'
|
|
785
896
|
> &
|
|
@@ -797,7 +908,7 @@ export declare const TabList: ForwardRefExoticComponent<
|
|
|
797
908
|
/**
|
|
798
909
|
* @public
|
|
799
910
|
*/
|
|
800
|
-
declare interface TabListProps extends Omit<
|
|
911
|
+
declare interface TabListProps extends Omit<InlineOwnProps, 'height'> {
|
|
801
912
|
children: Array<React.JSX.Element | null | undefined | false>
|
|
802
913
|
}
|
|
803
914
|
|
|
@@ -819,15 +930,15 @@ declare interface TabProps {
|
|
|
819
930
|
'tone'?: ButtonTone
|
|
820
931
|
}
|
|
821
932
|
|
|
933
|
+
/** @public */
|
|
934
|
+
declare type TagType = keyof React.JSX.IntrinsicElements
|
|
935
|
+
|
|
822
936
|
/**
|
|
823
937
|
* The `Text` component is an agile, themed typographic element.
|
|
824
938
|
*
|
|
825
939
|
* @public
|
|
826
940
|
*/
|
|
827
|
-
declare const Text_2:
|
|
828
|
-
Omit<TextProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
|
|
829
|
-
RefAttributes<HTMLDivElement>
|
|
830
|
-
>
|
|
941
|
+
declare const Text_2: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element
|
|
831
942
|
export {Text_2 as Text}
|
|
832
943
|
|
|
833
944
|
/**
|
|
@@ -841,14 +952,14 @@ declare type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
|
|
|
841
952
|
* @public
|
|
842
953
|
*/
|
|
843
954
|
export declare const TextInput: ForwardRefExoticComponent<
|
|
844
|
-
Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | '
|
|
955
|
+
Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | 'as' | 'prefix'>, 'ref'> &
|
|
845
956
|
RefAttributes<HTMLInputElement>
|
|
846
957
|
>
|
|
847
958
|
|
|
848
959
|
/**
|
|
849
960
|
* @public
|
|
850
961
|
*/
|
|
851
|
-
declare type TextInputClearButtonProps =
|
|
962
|
+
declare type TextInputClearButtonProps = ButtonOwnProps &
|
|
852
963
|
Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>
|
|
853
964
|
|
|
854
965
|
/**
|
|
@@ -875,7 +986,11 @@ declare interface TextInputProps {
|
|
|
875
986
|
padding?: number | number[]
|
|
876
987
|
prefix?: React.ReactNode
|
|
877
988
|
radius?: Radius | Radius[]
|
|
989
|
+
/**
|
|
990
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
991
|
+
*/
|
|
878
992
|
space?: number | number[]
|
|
993
|
+
gap?: number | number[]
|
|
879
994
|
suffix?: React.ReactNode
|
|
880
995
|
type?: TextInputType
|
|
881
996
|
weight?: ThemeFontWeightKey
|
|
@@ -902,10 +1017,9 @@ declare type TextInputType =
|
|
|
902
1017
|
/**
|
|
903
1018
|
* @public
|
|
904
1019
|
*/
|
|
905
|
-
declare interface
|
|
1020
|
+
declare interface TextOwnProps {
|
|
906
1021
|
accent?: boolean
|
|
907
1022
|
align?: TextAlign | TextAlign[]
|
|
908
|
-
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
909
1023
|
/** When `true` the text color will be muted. */
|
|
910
1024
|
muted?: boolean
|
|
911
1025
|
size?: number | number[]
|
|
@@ -918,6 +1032,11 @@ declare interface TextProps {
|
|
|
918
1032
|
weight?: ThemeFontWeightKey
|
|
919
1033
|
}
|
|
920
1034
|
|
|
1035
|
+
/**
|
|
1036
|
+
* @public
|
|
1037
|
+
*/
|
|
1038
|
+
declare type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>
|
|
1039
|
+
|
|
921
1040
|
/**
|
|
922
1041
|
* @public
|
|
923
1042
|
*/
|
|
@@ -943,7 +1062,7 @@ declare interface ThemeProviderProps {
|
|
|
943
1062
|
* @public
|
|
944
1063
|
*/
|
|
945
1064
|
export declare const Tooltip: ForwardRefExoticComponent<
|
|
946
|
-
Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'content' | '
|
|
1065
|
+
Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'as' | 'children'>, 'ref'> &
|
|
947
1066
|
RefAttributes<HTMLDivElement>
|
|
948
1067
|
>
|
|
949
1068
|
|