@sanity/ui 3.1.12-canary.0 → 3.1.12
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/_visual-editing.d.mts +1007 -2
- package/dist/_visual-editing.d.ts +1007 -2
- package/dist/index.d.mts +2655 -464
- package/dist/index.d.ts +2655 -464
- package/dist/theme.d.mts +1222 -925
- package/dist/theme.d.ts +1222 -925
- package/package.json +40 -26
- package/dist/_chunks-dts/useTheme.d.mts +0 -1431
- package/dist/_chunks-dts/useTheme.d.mts.map +0 -1
- package/dist/_chunks-dts/useTheme.d.ts +0 -1431
- package/dist/_chunks-dts/useTheme.d.ts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/theme.d.mts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
|
@@ -1,2 +1,1007 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {BaseTheme} from '@sanity/ui/theme'
|
|
2
|
+
import {DetailedHTMLProps} from 'react'
|
|
3
|
+
import {FastOmit} from 'styled-components'
|
|
4
|
+
import {ForwardRefExoticComponent} from 'react'
|
|
5
|
+
import {HTMLAttributes} from 'react'
|
|
6
|
+
import {HTMLProps} from 'react'
|
|
7
|
+
import {IStyledComponentBase} from 'styled-components/dist/types'
|
|
8
|
+
import {Ref} from 'react'
|
|
9
|
+
import {RefAttributes} from 'react'
|
|
10
|
+
import {RootTheme} from '@sanity/ui/theme'
|
|
11
|
+
import {Theme_v2} from '@sanity/ui/theme'
|
|
12
|
+
import {ThemeColorButtonModeKey} from '@sanity/ui/theme'
|
|
13
|
+
import {ThemeColorCardToneKey} from '@sanity/ui/theme'
|
|
14
|
+
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
15
|
+
import {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
16
|
+
import {ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
20
|
+
* for flex, margins and padding.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const Box: ForwardRefExoticComponent<
|
|
25
|
+
Omit<BoxProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
|
|
26
|
+
RefAttributes<HTMLDivElement>
|
|
27
|
+
>
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
declare type BoxDisplay = 'none' | 'block' | 'grid' | 'flex' | 'inline-block'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
declare type BoxHeight = 'stretch' | 'fill'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
declare type BoxOverflow = 'visible' | 'hidden' | 'auto'
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
declare interface BoxProps
|
|
48
|
+
extends ResponsiveFlexItemProps,
|
|
49
|
+
ResponsiveBoxProps,
|
|
50
|
+
ResponsiveGridItemProps,
|
|
51
|
+
ResponsiveMarginProps,
|
|
52
|
+
ResponsivePaddingProps {
|
|
53
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
54
|
+
forwardedAs?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
declare type BoxSizing = 'content' | 'border'
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare const Button: ForwardRefExoticComponent<
|
|
66
|
+
Omit<ButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'width' | 'as'>, 'ref'> &
|
|
67
|
+
RefAttributes<HTMLButtonElement>
|
|
68
|
+
>
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
declare type ButtonMode = ThemeColorButtonModeKey
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
79
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
80
|
+
fontSize?: number | number[]
|
|
81
|
+
mode?: ButtonMode
|
|
82
|
+
icon?: React.ElementType | React.ReactNode
|
|
83
|
+
iconRight?: React.ElementType | React.ReactNode
|
|
84
|
+
justify?: FlexJustify | FlexJustify[]
|
|
85
|
+
/**
|
|
86
|
+
* @beta Do not use in production, as this might change.
|
|
87
|
+
*/
|
|
88
|
+
loading?: boolean
|
|
89
|
+
selected?: boolean
|
|
90
|
+
space?: number | number[]
|
|
91
|
+
muted?: boolean
|
|
92
|
+
text?: React.ReactNode
|
|
93
|
+
textAlign?: ButtonTextAlign
|
|
94
|
+
textWeight?: ThemeFontWeightKey
|
|
95
|
+
tone?: ButtonTone
|
|
96
|
+
type?: 'button' | 'reset' | 'submit'
|
|
97
|
+
width?: ButtonWidth
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
declare type ButtonTextAlign = 'left' | 'right' | 'center'
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
declare type ButtonTone = ThemeColorStateToneKey
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
declare type ButtonWidth = 'fill'
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
117
|
+
* Components within a `Card` inherit its colors.
|
|
118
|
+
*
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
export declare const Card: ForwardRefExoticComponent<
|
|
122
|
+
Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
|
|
123
|
+
RefAttributes<HTMLDivElement>
|
|
124
|
+
>
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
declare interface CardProps
|
|
130
|
+
extends BoxProps,
|
|
131
|
+
ResponsiveBorderProps,
|
|
132
|
+
ResponsiveRadiusProps,
|
|
133
|
+
ResponsiveShadowProps {
|
|
134
|
+
/**
|
|
135
|
+
* Do not use in production.
|
|
136
|
+
* @beta
|
|
137
|
+
*/
|
|
138
|
+
__unstable_checkered?: boolean
|
|
139
|
+
/**
|
|
140
|
+
* Do not use in production.
|
|
141
|
+
* @beta
|
|
142
|
+
*/
|
|
143
|
+
__unstable_focusRing?: boolean
|
|
144
|
+
muted?: boolean
|
|
145
|
+
pressed?: boolean
|
|
146
|
+
scheme?: ThemeColorSchemeKey
|
|
147
|
+
tone?: CardTone
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
153
|
+
declare type CardTone = ThemeColorCardToneKey | 'inherit'
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
declare type Delay =
|
|
159
|
+
| number
|
|
160
|
+
| Partial<{
|
|
161
|
+
open: number
|
|
162
|
+
close: number
|
|
163
|
+
}>
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
167
|
+
*
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
export declare const Flex: ForwardRefExoticComponent<
|
|
171
|
+
Omit<FlexProps & Omit<HTMLProps<HTMLDivElement>, 'wrap' | 'as'>, 'ref'> &
|
|
172
|
+
RefAttributes<HTMLDivElement>
|
|
173
|
+
>
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
declare type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
183
|
+
declare type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse'
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
declare type FlexJustify =
|
|
189
|
+
| 'flex-start'
|
|
190
|
+
| 'flex-end'
|
|
191
|
+
| 'center'
|
|
192
|
+
| 'space-between'
|
|
193
|
+
| 'space-around'
|
|
194
|
+
| 'space-evenly'
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
declare interface FlexProps
|
|
200
|
+
extends Omit<BoxProps, 'display'>,
|
|
201
|
+
ResponsiveFlexProps,
|
|
202
|
+
ResponsiveFlexItemProps {
|
|
203
|
+
gap?: number | number[]
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
declare type FlexValue = number | 'none' | 'auto' | 'initial'
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
declare type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap'
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
218
|
+
*
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
export declare const Grid: ForwardRefExoticComponent<
|
|
222
|
+
Omit<GridProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'rows'>, 'ref'> &
|
|
223
|
+
RefAttributes<HTMLDivElement>
|
|
224
|
+
>
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
declare type GridAutoCols = 'auto' | 'min' | 'max' | 'fr'
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @public
|
|
233
|
+
*/
|
|
234
|
+
declare type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense'
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @public
|
|
238
|
+
*/
|
|
239
|
+
declare type GridAutoRows = 'auto' | 'min' | 'max' | 'fr'
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @public
|
|
243
|
+
*/
|
|
244
|
+
declare type GridItemColumn = 'auto' | 'full' | number
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
declare type GridItemColumnEnd = 'auto' | number
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
declare type GridItemColumnStart = 'auto' | number
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
declare type GridItemRow = 'auto' | 'full' | number
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
declare type GridItemRowEnd = 'auto' | number
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @public
|
|
268
|
+
*/
|
|
269
|
+
declare type GridItemRowStart = 'auto' | number
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @public
|
|
273
|
+
*/
|
|
274
|
+
declare interface GridProps extends Omit<BoxProps, 'display'>, ResponsiveGridProps {}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
278
|
+
*
|
|
279
|
+
* @public
|
|
280
|
+
*/
|
|
281
|
+
export declare const Hotkeys: ForwardRefExoticComponent<
|
|
282
|
+
HotkeysProps & Omit<HTMLProps<HTMLElement>, 'size' | 'ref' | 'as'> & RefAttributes<HTMLElement>
|
|
283
|
+
>
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @public
|
|
287
|
+
*/
|
|
288
|
+
declare interface HotkeysProps {
|
|
289
|
+
fontSize?: number | number[]
|
|
290
|
+
padding?: number | number[]
|
|
291
|
+
radius?: Radius | Radius[]
|
|
292
|
+
space?: number | number[]
|
|
293
|
+
keys?: string[]
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @public
|
|
298
|
+
*/
|
|
299
|
+
declare interface InlineProps extends Omit<BoxProps, 'display'> {
|
|
300
|
+
/** The spacing between children. */
|
|
301
|
+
space?: number | number[]
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @internal
|
|
306
|
+
*/
|
|
307
|
+
export declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
export declare function isHTMLElement(node: unknown): node is HTMLElement
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @public
|
|
316
|
+
*/
|
|
317
|
+
declare interface LayerProps {
|
|
318
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
319
|
+
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
320
|
+
onActivate?: (props: {activeElement: HTMLElement | null}) => void
|
|
321
|
+
zOffset?: number | number[]
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @public
|
|
326
|
+
*/
|
|
327
|
+
export declare function LayerProvider(props: LayerProviderProps): React.JSX.Element
|
|
328
|
+
|
|
329
|
+
export declare namespace LayerProvider {
|
|
330
|
+
var displayName: string
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
declare interface LayerProviderProps {
|
|
337
|
+
children?: React.ReactNode
|
|
338
|
+
zOffset?: number | number[]
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The `Menu` component is a building block for application menus.
|
|
343
|
+
*
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
346
|
+
export declare const Menu: ForwardRefExoticComponent<
|
|
347
|
+
Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'tabIndex' | 'role' | 'as'>, 'ref'> &
|
|
348
|
+
RefAttributes<HTMLDivElement>
|
|
349
|
+
>
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* @public
|
|
353
|
+
*/
|
|
354
|
+
export declare const MenuDivider: IStyledComponentBase<
|
|
355
|
+
'web',
|
|
356
|
+
FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLHRElement>, HTMLHRElement>, never>
|
|
357
|
+
> &
|
|
358
|
+
string
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* @public
|
|
362
|
+
*/
|
|
363
|
+
export declare function MenuGroup(
|
|
364
|
+
props: Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'popover' | 'ref' | 'tabIndex'> &
|
|
365
|
+
MenuGroupProps,
|
|
366
|
+
): React.JSX.Element
|
|
367
|
+
|
|
368
|
+
export declare namespace MenuGroup {
|
|
369
|
+
var displayName: string
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @public
|
|
374
|
+
*/
|
|
375
|
+
declare interface MenuGroupProps {
|
|
376
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
377
|
+
fontSize?: number | number[]
|
|
378
|
+
icon?: React.ElementType | React.ReactNode
|
|
379
|
+
menu?: Omit<
|
|
380
|
+
MenuProps,
|
|
381
|
+
| 'onClickOutside'
|
|
382
|
+
| 'onEscape'
|
|
383
|
+
| 'onItemClick'
|
|
384
|
+
| 'onKeyDown'
|
|
385
|
+
| 'onMouseEnter'
|
|
386
|
+
| 'registerElement'
|
|
387
|
+
| 'shouldFocus'
|
|
388
|
+
| 'onBlurCapture'
|
|
389
|
+
>
|
|
390
|
+
padding?: number | number[]
|
|
391
|
+
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
392
|
+
radius?: Radius | Radius[]
|
|
393
|
+
space?: number | number[]
|
|
394
|
+
text: React.ReactNode
|
|
395
|
+
tone?: SelectableTone
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* @public
|
|
400
|
+
*/
|
|
401
|
+
export declare const MenuItem: ForwardRefExoticComponent<
|
|
402
|
+
MenuItemProps &
|
|
403
|
+
Omit<HTMLProps<HTMLDivElement>, 'selected' | 'height' | 'ref' | 'tabIndex' | 'as'> &
|
|
404
|
+
RefAttributes<HTMLDivElement>
|
|
405
|
+
>
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @public
|
|
409
|
+
*/
|
|
410
|
+
export declare interface MenuItemProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
411
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
412
|
+
fontSize?: number | number[]
|
|
413
|
+
hotkeys?: string[]
|
|
414
|
+
icon?: React.ElementType | React.ReactNode
|
|
415
|
+
iconRight?: React.ElementType | React.ReactNode
|
|
416
|
+
pressed?: boolean
|
|
417
|
+
selected?: boolean
|
|
418
|
+
space?: number | number[]
|
|
419
|
+
text?: React.ReactNode
|
|
420
|
+
tone?: SelectableTone
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* @public
|
|
425
|
+
*/
|
|
426
|
+
declare interface MenuProps extends ResponsivePaddingProps {
|
|
427
|
+
/**
|
|
428
|
+
* @deprecated Use `shouldFocus="first"` instead.
|
|
429
|
+
*/
|
|
430
|
+
'focusFirst'?: boolean
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated Use `shouldFocus="last"` instead.
|
|
433
|
+
*/
|
|
434
|
+
'focusLast'?: boolean
|
|
435
|
+
'onClickOutside'?: (event: MouseEvent) => void
|
|
436
|
+
'onEscape'?: () => void
|
|
437
|
+
'onItemClick'?: () => void
|
|
438
|
+
'onItemSelect'?: (index: number) => void
|
|
439
|
+
'originElement'?: HTMLElement | null
|
|
440
|
+
'registerElement'?: (el: HTMLElement) => () => void
|
|
441
|
+
'shouldFocus'?: 'first' | 'last' | null
|
|
442
|
+
'space'?: number | number[]
|
|
443
|
+
'aria-labelledby'?: string
|
|
444
|
+
'onBlurCapture'?: (event: FocusEvent) => void
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Placement of floating UI elements.
|
|
449
|
+
*
|
|
450
|
+
* @public
|
|
451
|
+
*/
|
|
452
|
+
declare type Placement =
|
|
453
|
+
| 'top'
|
|
454
|
+
| 'top-start'
|
|
455
|
+
| 'top-end'
|
|
456
|
+
| 'right'
|
|
457
|
+
| 'right-start'
|
|
458
|
+
| 'right-end'
|
|
459
|
+
| 'bottom'
|
|
460
|
+
| 'bottom-start'
|
|
461
|
+
| 'bottom-end'
|
|
462
|
+
| 'left'
|
|
463
|
+
| 'left-start'
|
|
464
|
+
| 'left-end'
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* The `Popover` component is used to display some content on top of another.
|
|
468
|
+
*
|
|
469
|
+
* @public
|
|
470
|
+
*/
|
|
471
|
+
export declare const Popover: ForwardRefExoticComponent<
|
|
472
|
+
Omit<
|
|
473
|
+
PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'width' | 'children' | 'as'>,
|
|
474
|
+
'ref'
|
|
475
|
+
> &
|
|
476
|
+
RefAttributes<HTMLDivElement>
|
|
477
|
+
>
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @beta
|
|
481
|
+
*/
|
|
482
|
+
export declare type PopoverMargins = [number, number, number, number]
|
|
483
|
+
|
|
484
|
+
/** @public */
|
|
485
|
+
declare interface PopoverProps
|
|
486
|
+
extends Omit<LayerProps, 'as'>,
|
|
487
|
+
ResponsiveRadiusProps,
|
|
488
|
+
ResponsiveShadowProps {
|
|
489
|
+
/** @beta */
|
|
490
|
+
__unstable_margins?: PopoverMargins
|
|
491
|
+
/**
|
|
492
|
+
* Whether the popover should animate in and out.
|
|
493
|
+
*
|
|
494
|
+
* @beta
|
|
495
|
+
* @defaultValue false
|
|
496
|
+
*/
|
|
497
|
+
animate?: boolean
|
|
498
|
+
arrow?: boolean
|
|
499
|
+
/** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
|
|
500
|
+
boundaryElement?: HTMLElement | null
|
|
501
|
+
children?: React.JSX.Element
|
|
502
|
+
/**
|
|
503
|
+
* When `true`, prevent overflow within the current boundary:
|
|
504
|
+
* - by flipping on its side axis
|
|
505
|
+
* - by resizing
|
|
506
|
+
/*
|
|
507
|
+
* Note that:
|
|
508
|
+
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
509
|
+
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
510
|
+
*
|
|
511
|
+
* @defaultValue false
|
|
512
|
+
*/
|
|
513
|
+
constrainSize?: boolean
|
|
514
|
+
content?: React.ReactNode
|
|
515
|
+
disabled?: boolean
|
|
516
|
+
fallbackPlacements?: Placement[]
|
|
517
|
+
floatingBoundary?: HTMLElement | null
|
|
518
|
+
/**
|
|
519
|
+
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
520
|
+
* the current boundary by resizing.
|
|
521
|
+
*
|
|
522
|
+
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
523
|
+
*
|
|
524
|
+
* @defaultValue false
|
|
525
|
+
*/
|
|
526
|
+
matchReferenceWidth?: boolean
|
|
527
|
+
/**
|
|
528
|
+
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
529
|
+
*
|
|
530
|
+
* @beta
|
|
531
|
+
* @defaultValue false
|
|
532
|
+
*/
|
|
533
|
+
modal?: boolean
|
|
534
|
+
open?: boolean
|
|
535
|
+
overflow?: BoxOverflow
|
|
536
|
+
padding?: number | number[]
|
|
537
|
+
placement?: Placement
|
|
538
|
+
/**
|
|
539
|
+
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
540
|
+
* fallback placements in order. Whichever fits in the viewport first.
|
|
541
|
+
*
|
|
542
|
+
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
543
|
+
* and the placement with the most viewport space available.
|
|
544
|
+
*
|
|
545
|
+
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
546
|
+
*/
|
|
547
|
+
placementStrategy?: 'flip' | 'autoPlacement'
|
|
548
|
+
/** Whether or not to render the popover in a portal element. */
|
|
549
|
+
portal?: boolean | string
|
|
550
|
+
preventOverflow?: boolean
|
|
551
|
+
referenceBoundary?: HTMLElement | null
|
|
552
|
+
/**
|
|
553
|
+
* When defined, the popover will be positioned relative to this element.
|
|
554
|
+
* The children of the popover won't be rendered.
|
|
555
|
+
*/
|
|
556
|
+
referenceElement?: HTMLElement | null
|
|
557
|
+
scheme?: ThemeColorSchemeKey
|
|
558
|
+
tone?: CardTone
|
|
559
|
+
/** @beta */
|
|
560
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>
|
|
561
|
+
width?: PopoverWidth | PopoverWidth[]
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/** @beta */
|
|
565
|
+
declare type PopoverUpdateCallback = () => void
|
|
566
|
+
|
|
567
|
+
/** @public */
|
|
568
|
+
declare type PopoverWidth = number | 'auto'
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* @public
|
|
572
|
+
*/
|
|
573
|
+
export declare function Portal(props: PortalProps): React.ReactPortal | null
|
|
574
|
+
|
|
575
|
+
export declare namespace Portal {
|
|
576
|
+
var displayName: string
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* @public
|
|
581
|
+
*/
|
|
582
|
+
declare interface PortalProps {
|
|
583
|
+
children: React.ReactNode
|
|
584
|
+
/**
|
|
585
|
+
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
586
|
+
*/
|
|
587
|
+
__unstable_name?: string
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* @public
|
|
592
|
+
*/
|
|
593
|
+
export declare function PortalProvider(props: PortalProviderProps): React.JSX.Element
|
|
594
|
+
|
|
595
|
+
export declare namespace PortalProvider {
|
|
596
|
+
var displayName: string
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* @public
|
|
601
|
+
*/
|
|
602
|
+
declare interface PortalProviderProps {
|
|
603
|
+
/**
|
|
604
|
+
* @deprecated Use `<BoundaryElementProvider element={...} />` instead
|
|
605
|
+
*/
|
|
606
|
+
boundaryElement?: HTMLElement | null
|
|
607
|
+
children: React.ReactNode
|
|
608
|
+
element?: HTMLElement | null
|
|
609
|
+
/**
|
|
610
|
+
* @beta
|
|
611
|
+
*/
|
|
612
|
+
__unstable_elements?: Record<string, HTMLElement | null | undefined>
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* @public
|
|
617
|
+
*/
|
|
618
|
+
declare type Radius = number | 'full'
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* @public
|
|
622
|
+
*/
|
|
623
|
+
declare interface ResponsiveBorderProps {
|
|
624
|
+
border?: boolean | boolean[]
|
|
625
|
+
borderTop?: boolean | boolean[]
|
|
626
|
+
borderRight?: boolean | boolean[]
|
|
627
|
+
borderBottom?: boolean | boolean[]
|
|
628
|
+
borderLeft?: boolean | boolean[]
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* @public
|
|
633
|
+
*/
|
|
634
|
+
declare interface ResponsiveBoxProps {
|
|
635
|
+
display?: BoxDisplay | BoxDisplay[]
|
|
636
|
+
height?: BoxHeight | BoxHeight[]
|
|
637
|
+
overflow?: BoxOverflow | BoxOverflow[]
|
|
638
|
+
sizing?: BoxSizing | BoxSizing[]
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* @public
|
|
643
|
+
*/
|
|
644
|
+
declare interface ResponsiveFlexItemProps {
|
|
645
|
+
/** Sets the flex CSS attribute. The property is responsive. */
|
|
646
|
+
flex?: FlexValue | FlexValue[]
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @public
|
|
651
|
+
*/
|
|
652
|
+
declare interface ResponsiveFlexProps {
|
|
653
|
+
align?: FlexAlign | FlexAlign[]
|
|
654
|
+
direction?: FlexDirection | FlexDirection[]
|
|
655
|
+
justify?: FlexJustify | FlexJustify[]
|
|
656
|
+
wrap?: FlexWrap | FlexWrap[]
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @public
|
|
661
|
+
*/
|
|
662
|
+
declare interface ResponsiveGridItemProps {
|
|
663
|
+
column?: GridItemColumn | GridItemColumn[]
|
|
664
|
+
columnStart?: GridItemColumnStart | GridItemColumnStart[]
|
|
665
|
+
columnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
|
|
666
|
+
row?: GridItemRow | GridItemRow[]
|
|
667
|
+
rowStart?: GridItemRowStart | GridItemRowStart[]
|
|
668
|
+
rowEnd?: GridItemRowEnd | GridItemRowEnd[]
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* @public
|
|
673
|
+
*/
|
|
674
|
+
declare interface ResponsiveGridProps {
|
|
675
|
+
autoRows?: GridAutoRows | GridAutoRows[]
|
|
676
|
+
autoCols?: GridAutoCols | GridAutoCols[]
|
|
677
|
+
autoFlow?: GridAutoFlow | GridAutoFlow[]
|
|
678
|
+
columns?: number | number[]
|
|
679
|
+
gap?: number | number[]
|
|
680
|
+
gapX?: number | number[]
|
|
681
|
+
gapY?: number | number[]
|
|
682
|
+
rows?: number | number[]
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* @public
|
|
687
|
+
*/
|
|
688
|
+
declare interface ResponsiveMarginProps {
|
|
689
|
+
/** Applies margins to all sides. The property is responsive. */
|
|
690
|
+
margin?: number | number[]
|
|
691
|
+
/** Applies margins to the left and right sides. The property is responsive. */
|
|
692
|
+
marginX?: number | number[]
|
|
693
|
+
/** Applies margins to the top and bottom sides. The property is responsive. */
|
|
694
|
+
marginY?: number | number[]
|
|
695
|
+
marginTop?: number | number[]
|
|
696
|
+
marginRight?: number | number[]
|
|
697
|
+
marginBottom?: number | number[]
|
|
698
|
+
marginLeft?: number | number[]
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* @public
|
|
703
|
+
*/
|
|
704
|
+
declare interface ResponsivePaddingProps {
|
|
705
|
+
padding?: number | number[]
|
|
706
|
+
paddingX?: number | number[]
|
|
707
|
+
paddingY?: number | number[]
|
|
708
|
+
paddingTop?: number | number[]
|
|
709
|
+
paddingRight?: number | number[]
|
|
710
|
+
paddingBottom?: number | number[]
|
|
711
|
+
paddingLeft?: number | number[]
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* @public
|
|
716
|
+
*/
|
|
717
|
+
declare interface ResponsiveRadiusProps {
|
|
718
|
+
radius?: Radius | Radius[]
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @public
|
|
723
|
+
*/
|
|
724
|
+
declare interface ResponsiveShadowProps {
|
|
725
|
+
shadow?: number | number[]
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* @public
|
|
730
|
+
*/
|
|
731
|
+
declare type SelectableTone = ThemeColorStateToneKey
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Indicate that something is loading for an indeterminate amount of time.
|
|
735
|
+
*
|
|
736
|
+
* @public
|
|
737
|
+
*/
|
|
738
|
+
export declare const Spinner: ForwardRefExoticComponent<
|
|
739
|
+
Omit<SpinnerProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
|
|
740
|
+
RefAttributes<HTMLDivElement>
|
|
741
|
+
>
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* @public
|
|
745
|
+
*/
|
|
746
|
+
declare interface SpinnerProps {
|
|
747
|
+
muted?: boolean
|
|
748
|
+
size?: number | number[]
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* The `Stack` component is used to place elements on top of each other.
|
|
753
|
+
*
|
|
754
|
+
* @public
|
|
755
|
+
*/
|
|
756
|
+
export declare const Stack: ForwardRefExoticComponent<
|
|
757
|
+
StackProps & Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as'> & RefAttributes<HTMLDivElement>
|
|
758
|
+
>
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* @public
|
|
762
|
+
*/
|
|
763
|
+
declare interface StackProps extends BoxProps {
|
|
764
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
765
|
+
space?: number | number[]
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @public
|
|
770
|
+
* @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
|
|
771
|
+
*/
|
|
772
|
+
export declare const studioTheme: BaseTheme
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* @public
|
|
776
|
+
*/
|
|
777
|
+
export declare const Tab: ForwardRefExoticComponent<
|
|
778
|
+
Omit<
|
|
779
|
+
TabProps &
|
|
780
|
+
Omit<
|
|
781
|
+
HTMLProps<HTMLButtonElement>,
|
|
782
|
+
'label' | 'id' | 'type' | 'width' | 'aria-controls' | 'as'
|
|
783
|
+
>,
|
|
784
|
+
'ref'
|
|
785
|
+
> &
|
|
786
|
+
RefAttributes<HTMLButtonElement>
|
|
787
|
+
>
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* @public
|
|
791
|
+
*/
|
|
792
|
+
export declare const TabList: ForwardRefExoticComponent<
|
|
793
|
+
Omit<TabListProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
|
|
794
|
+
RefAttributes<unknown>
|
|
795
|
+
>
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* @public
|
|
799
|
+
*/
|
|
800
|
+
declare interface TabListProps extends Omit<InlineProps, 'as' | 'height'> {
|
|
801
|
+
children: Array<React.JSX.Element | null | undefined | false>
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* @public
|
|
806
|
+
*/
|
|
807
|
+
declare interface TabProps {
|
|
808
|
+
/**
|
|
809
|
+
* The `id` of the correlating `TabPanel` component.
|
|
810
|
+
*/
|
|
811
|
+
'aria-controls': string
|
|
812
|
+
'id': string
|
|
813
|
+
'icon'?: React.ElementType | React.ReactNode
|
|
814
|
+
'focused'?: boolean
|
|
815
|
+
'fontSize'?: number | number[]
|
|
816
|
+
'label'?: React.ReactNode
|
|
817
|
+
'padding'?: number | number[]
|
|
818
|
+
'selected'?: boolean
|
|
819
|
+
'tone'?: ButtonTone
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* The `Text` component is an agile, themed typographic element.
|
|
824
|
+
*
|
|
825
|
+
* @public
|
|
826
|
+
*/
|
|
827
|
+
declare const Text_2: ForwardRefExoticComponent<
|
|
828
|
+
Omit<TextProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
|
|
829
|
+
RefAttributes<HTMLDivElement>
|
|
830
|
+
>
|
|
831
|
+
export {Text_2 as Text}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* @public
|
|
835
|
+
*/
|
|
836
|
+
declare type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Single line text input.
|
|
840
|
+
*
|
|
841
|
+
* @public
|
|
842
|
+
*/
|
|
843
|
+
export declare const TextInput: ForwardRefExoticComponent<
|
|
844
|
+
Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | 'prefix' | 'as'>, 'ref'> &
|
|
845
|
+
RefAttributes<HTMLInputElement>
|
|
846
|
+
>
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* @public
|
|
850
|
+
*/
|
|
851
|
+
declare type TextInputClearButtonProps = Omit<ButtonProps, 'as'> &
|
|
852
|
+
Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* @public
|
|
856
|
+
*/
|
|
857
|
+
declare interface TextInputProps {
|
|
858
|
+
/**
|
|
859
|
+
* @beta
|
|
860
|
+
*/
|
|
861
|
+
__unstable_disableFocusRing?: boolean
|
|
862
|
+
border?: boolean
|
|
863
|
+
/**
|
|
864
|
+
* @beta
|
|
865
|
+
*/
|
|
866
|
+
clearButton?: boolean | TextInputClearButtonProps
|
|
867
|
+
customValidity?: string
|
|
868
|
+
fontSize?: number | number[]
|
|
869
|
+
icon?: React.ElementType | React.ReactNode
|
|
870
|
+
iconRight?: React.ElementType | React.ReactNode
|
|
871
|
+
/**
|
|
872
|
+
* @beta
|
|
873
|
+
*/
|
|
874
|
+
onClear?: () => void
|
|
875
|
+
padding?: number | number[]
|
|
876
|
+
prefix?: React.ReactNode
|
|
877
|
+
radius?: Radius | Radius[]
|
|
878
|
+
space?: number | number[]
|
|
879
|
+
suffix?: React.ReactNode
|
|
880
|
+
type?: TextInputType
|
|
881
|
+
weight?: ThemeFontWeightKey
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* @public
|
|
886
|
+
*/
|
|
887
|
+
declare type TextInputType =
|
|
888
|
+
| 'search'
|
|
889
|
+
| 'date'
|
|
890
|
+
| 'datetime-local'
|
|
891
|
+
| 'email'
|
|
892
|
+
| 'url'
|
|
893
|
+
| 'month'
|
|
894
|
+
| 'number'
|
|
895
|
+
| 'password'
|
|
896
|
+
| 'tel'
|
|
897
|
+
| 'time'
|
|
898
|
+
| 'text'
|
|
899
|
+
| 'week'
|
|
900
|
+
| 'color'
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* @public
|
|
904
|
+
*/
|
|
905
|
+
declare interface TextProps {
|
|
906
|
+
accent?: boolean
|
|
907
|
+
align?: TextAlign | TextAlign[]
|
|
908
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
909
|
+
/** When `true` the text color will be muted. */
|
|
910
|
+
muted?: boolean
|
|
911
|
+
size?: number | number[]
|
|
912
|
+
/**
|
|
913
|
+
* Controls how overflowing text is treated.
|
|
914
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
915
|
+
* @beta
|
|
916
|
+
*/
|
|
917
|
+
textOverflow?: 'ellipsis'
|
|
918
|
+
weight?: ThemeFontWeightKey
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* @public
|
|
923
|
+
*/
|
|
924
|
+
export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element
|
|
925
|
+
|
|
926
|
+
export declare namespace ThemeProvider {
|
|
927
|
+
var displayName: string
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* @public
|
|
932
|
+
*/
|
|
933
|
+
declare interface ThemeProviderProps {
|
|
934
|
+
children?: React.ReactNode
|
|
935
|
+
scheme?: ThemeColorSchemeKey
|
|
936
|
+
theme?: RootTheme
|
|
937
|
+
tone?: ThemeColorCardToneKey
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Tooltips display information when hovering, focusing or tapping.
|
|
942
|
+
*
|
|
943
|
+
* @public
|
|
944
|
+
*/
|
|
945
|
+
export declare const Tooltip: ForwardRefExoticComponent<
|
|
946
|
+
Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'children' | 'as'>, 'ref'> &
|
|
947
|
+
RefAttributes<HTMLDivElement>
|
|
948
|
+
>
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* @public
|
|
952
|
+
*/
|
|
953
|
+
declare interface TooltipProps extends Omit<LayerProps, 'as'> {
|
|
954
|
+
/** @deprecated Use `fallbackPlacements` instead. */
|
|
955
|
+
allowedAutoPlacements?: Placement[]
|
|
956
|
+
arrow?: boolean
|
|
957
|
+
boundaryElement?: HTMLElement | null
|
|
958
|
+
children?: React.JSX.Element
|
|
959
|
+
content?: React.ReactNode
|
|
960
|
+
disabled?: boolean
|
|
961
|
+
fallbackPlacements?: Placement[]
|
|
962
|
+
padding?: number | number[]
|
|
963
|
+
placement?: Placement
|
|
964
|
+
/** Whether or not to render the tooltip in a portal element. */
|
|
965
|
+
portal?: boolean | string
|
|
966
|
+
radius?: number | number[]
|
|
967
|
+
scheme?: ThemeColorSchemeKey
|
|
968
|
+
shadow?: number | number[]
|
|
969
|
+
/**
|
|
970
|
+
* Adds a delay to open or close the tooltip.
|
|
971
|
+
*
|
|
972
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
973
|
+
*
|
|
974
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
975
|
+
*
|
|
976
|
+
* @public
|
|
977
|
+
* @defaultValue 0
|
|
978
|
+
*/
|
|
979
|
+
delay?: Delay
|
|
980
|
+
/**
|
|
981
|
+
* Whether the tooltip should animate in and out.
|
|
982
|
+
*
|
|
983
|
+
* @beta
|
|
984
|
+
* @defaultValue false
|
|
985
|
+
*/
|
|
986
|
+
animate?: boolean
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
991
|
+
*
|
|
992
|
+
* @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://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
993
|
+
*
|
|
994
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
995
|
+
* 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
|
|
996
|
+
* @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
|
|
997
|
+
*
|
|
998
|
+
* @public
|
|
999
|
+
*/
|
|
1000
|
+
export declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* @public
|
|
1004
|
+
*/
|
|
1005
|
+
export declare function useTheme_v2(): Theme_v2
|
|
1006
|
+
|
|
1007
|
+
export {}
|