@sanity/ui 4.0.0-next.0 → 4.0.0-next.2

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/index.d.cts CHANGED
@@ -1,6 +1,572 @@
1
- import { A as ThemeColorMutedTone, At as ThemeColorSchemeKey$1, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, Dt as ThemeColorCardToneKey, E as ThemeColorSelectable, F as ThemeColorCardState, H as ThemeColorToneKey, I as ThemeColorButton, L as ThemeColorButtonState, M as ThemeColorInputState, Mt as ThemeColorStateToneKey, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, R as ThemeColorButtonStates, S as ThemeColorSpot, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, b as ThemeColorScheme, d as ThemeColorBuilderOpts, g as Theme$1, j as ThemeColorInput, k as ThemeColorMuted, m as RootTheme$1, pt as CSSObject, u as PartialThemeColorBuilderOpts, v as ThemeInput, w as ThemeColorSolid, wt as ThemeColorAvatarColorKey, x as ThemeColorSchemes, xt as ThemeFontWeightKey$1, y as ThemeColor, z as ThemeColorButtonTones } from "./_chunks/rgba.cjs";
2
- import { $ as BoxOwnProps, $t as GridAutoRows, A as FlexOwnProps, An as createColorTheme, At as TagType, B as containsOrEqualsElement, Bt as ResponsiveMarginProps, C as StackProps, Cn as ThemeFontKey, Ct as MenuDivider, D as GridOwnProps, Dn as ThemeFonts, Dt as ElementType, E as Grid, En as ThemeFontWeightKey, Et as ComponentType, F as Button, Fn as rgbToHex, Ft as ResponsiveBoxProps, G as isHTMLSelectElement, Gt as GridItemColumn, H as isHTMLButtonElement, Ht as ResponsiveRadiusProps, I as ButtonOwnProps, In as rgbToHsl, It as ResponsiveFlexItemProps, J as TabListProps, Jt as GridItemRow, K as isHTMLTextAreaElement, Kt as GridItemColumnEnd, L as ButtonProps, Ln as rgba, Lt as ResponsiveFlexProps, M as Card, Mn as hslToRgb, Mt as MenuProps, N as CardOwnProps, Nn as multiply, Nt as Delay, O as GridProps, On as ThemeLayer, Ot as EmptyProps, P as CardProps, Pn as parseColor, Pt as ResponsiveBorderProps, Q as Box, Qt as GridAutoFlow, R as usePrefersDark, Rn as screen, Rt as ResponsiveGridItemProps, S as StackOwnProps, Sn as ThemeFont, St as CardTone, T as SpinnerProps, Tn as ThemeFontWeight, Tt as Assign, U as isHTMLElement, Ut as ResponsiveShadowProps, V as isHTMLAnchorElement, Vt as ResponsivePaddingProps, W as isHTMLInputElement, Wt as ResponsiveWidthProps, X as InlineOwnProps, Xt as GridItemRowStart, Y as Inline, Yt as GridItemRowEnd, Z as InlineProps, Zt as GridAutoCols, _ as Text, _n as Styles, _t as PopoverWidth, a as LayerProvider, an as BoxDisplay, at as ButtonTone, b as TextAlign, bn as ThemeColorSchemeKey, bt as PopoverMargins, c as useTheme_v2, cn as BoxSizing, ct as MenuItemOwnProps, d as Tooltip, dn as Radius, dt as MenuGroupOwnProps, en as FlexAlign, et as BoxProps, f as TooltipProps, fn as BaseTheme, ft as MenuGroupProps, g as TextInputType, gn as RootTheme, gt as PopoverUpdateCallback, h as TextInputProps, hn as RGB, ht as PopoverProps, i as PortalProps, in as FlexWrap, it as ButtonTextAlign, j as FlexProps, jn as hexToRgb, jt as Menu, k as Flex, kn as ThemeShadow, kt as Props, l as ThemeProvider, ln as Hotkeys, lt as MenuItemProps, m as TextInputClearButtonProps, mn as HSL, mt as Popover, n as PortalProviderProps, nn as FlexJustify, nt as TabProps, o as LayerProviderProps, on as BoxHeight, ot as ButtonWidth, p as TextInput, pn as BoxShadow, pt as SelectableTone, q as TabList, qt as GridItemColumnStart, r as Portal, rn as FlexValue, rt as ButtonMode, s as useTheme, sn as BoxOverflow, st as MenuItem, t as PortalProvider, tn as FlexDirection, tt as Tab, u as ThemeProviderProps, un as HotkeysProps, ut as MenuGroup, v as TextOwnProps, vn as Theme, vt as Layer, w as Spinner, wn as ThemeFontSize, wt as MenuDividerProps, x as Stack, xn as ThemeColorSyntax, xt as Placement, y as TextProps, yn as ThemeColorButtonModeKey, yt as LayerProps, z as _isEnterToClickElement, zn as studioTheme, zt as ResponsiveGridProps } from "./_chunks/portalProvider.cjs";
1
+ import { A as ThemeColorMutedTone, At as ThemeColorSchemeKey$1, B as ThemeColorBase, C as ThemeColorSpotKey, Ct as ThemeColorSyntax$1, D as ThemeColorSelectableState, Dt as ThemeColorCardToneKey, E as ThemeColorSelectable, Et as ThemeColorButtonModeKey$1, F as ThemeColorCardState, H as ThemeColorToneKey, Ht as HSL$1, I as ThemeColorButton, L as ThemeColorButtonState, M as ThemeColorInputState, Mt as ThemeColorStateToneKey, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, R as ThemeColorButtonStates, S as ThemeColorSpot, St as ThemeFonts$1, T as ThemeColorSolidTone, U as ThemeColorGenericState, Ut as RGB$1, V as ThemeColorName, W as ThemeAvatar, _ as Theme_v2, _t as ThemeFont$1, a as rgbToHex$1, b as ThemeColorScheme, bt as ThemeFontWeight$1, c as screen$1, d as ThemeColorBuilderOpts, f as createColorTheme$1, ft as ThemeStyles, g as Theme$1, gt as ThemeLayer$1, ht as ThemeShadow$1, i as hslToRgb$1, j as ThemeColorInput, k as ThemeColorMuted, l as multiply$1, m as RootTheme$1, mt as ThemeBoxShadow, n as parseColor$1, o as rgbToHsl$1, p as BaseTheme$1, pt as CSSObject, r as hexToRgb$1, t as rgba$1, u as PartialThemeColorBuilderOpts, v as ThemeInput, vt as ThemeFontKey$1, w as ThemeColorSolid, wt as ThemeColorAvatarColorKey, x as ThemeColorSchemes, xt as ThemeFontWeightKey$1, y as ThemeColor, yt as ThemeFontSize$1, z as ThemeColorButtonTones } from "./_chunks/rgba.cjs";
3
2
  import { Component, ElementType as ElementType$1, HTMLProps, PropsWithChildren, ReactNode, Ref } from "react";
3
+ /**
4
+ * @public
5
+ * @deprecated Use `BaseTheme` from `@sanity/ui/theme` instead.
6
+ */
7
+ type BaseTheme = BaseTheme$1;
8
+ /**
9
+ * @public
10
+ * @deprecated Use `ThemeBoxShadow` from `@sanity/ui/theme` instead.
11
+ */
12
+ type BoxShadow = ThemeBoxShadow;
13
+ /**
14
+ * @public
15
+ * @deprecated Use `HSL` from `@sanity/ui/theme` instead.
16
+ */
17
+ type HSL = HSL$1;
18
+ /**
19
+ * @public
20
+ * @deprecated Use `RGB` from `@sanity/ui/theme` instead.
21
+ */
22
+ type RGB = RGB$1;
23
+ /**
24
+ * @public
25
+ * @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
26
+ */
27
+ type RootTheme = RootTheme$1;
28
+ /**
29
+ * @public
30
+ * @deprecated Use `ThemeStyles` from `@sanity/ui/theme` instead.
31
+ */
32
+ type Styles = ThemeStyles;
33
+ /**
34
+ * @public
35
+ * @deprecated Use `Theme` from `@sanity/ui/theme` instead.
36
+ */
37
+ type Theme = Theme$1;
38
+ /**
39
+ * @public
40
+ * @deprecated Use `ThemeColorButtonModeKey` from `@sanity/ui/theme` instead.
41
+ */
42
+ type ThemeColorButtonModeKey = ThemeColorButtonModeKey$1;
43
+ /**
44
+ * @public
45
+ * @deprecated Use `ThemeColorSchemeKey` from `@sanity/ui/theme` instead.
46
+ */
47
+ type ThemeColorSchemeKey = ThemeColorSchemeKey$1;
48
+ /**
49
+ * @public
50
+ * @deprecated Use `ThemeColorSyntax` from `@sanity/ui/theme` instead.
51
+ */
52
+ type ThemeColorSyntax = ThemeColorSyntax$1;
53
+ /**
54
+ * @public
55
+ * @deprecated Use `ThemeFont` from `@sanity/ui/theme` instead.
56
+ */
57
+ type ThemeFont = ThemeFont$1;
58
+ /**
59
+ * @public
60
+ * @deprecated Use `ThemeFontKey` from `@sanity/ui/theme` instead.
61
+ */
62
+ type ThemeFontKey = ThemeFontKey$1;
63
+ /**
64
+ * @public
65
+ * @deprecated Use `ThemeFontSize` from `@sanity/ui/theme` instead.
66
+ */
67
+ type ThemeFontSize = ThemeFontSize$1;
68
+ /**
69
+ * @public
70
+ * @deprecated Use `ThemeFontWeight` from `@sanity/ui/theme` instead.
71
+ */
72
+ type ThemeFontWeight = ThemeFontWeight$1;
73
+ /**
74
+ * @public
75
+ * @deprecated Use `ThemeFontWeightKey` from `@sanity/ui/theme` instead.
76
+ */
77
+ type ThemeFontWeightKey = ThemeFontWeightKey$1;
78
+ /**
79
+ * @public
80
+ * @deprecated Use `ThemeFonts` from `@sanity/ui/theme` instead.
81
+ */
82
+ type ThemeFonts = ThemeFonts$1;
83
+ /**
84
+ * @public
85
+ * @deprecated Use `ThemeLayer` from `@sanity/ui/theme` instead.
86
+ */
87
+ type ThemeLayer = ThemeLayer$1;
88
+ /**
89
+ * @public
90
+ * @deprecated Use `ThemeShadow` from `@sanity/ui/theme` instead.
91
+ */
92
+ type ThemeShadow = ThemeShadow$1;
93
+ /**
94
+ * @public
95
+ * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
96
+ */
97
+ declare const createColorTheme: typeof createColorTheme$1;
98
+ /**
99
+ * @public
100
+ * @deprecated Use `hexToRgb` from `@sanity/ui/theme` instead.
101
+ */
102
+ declare const hexToRgb: typeof hexToRgb$1;
103
+ /**
104
+ * @public
105
+ * @deprecated Use `hslToRgb` from `@sanity/ui/theme` instead.
106
+ */
107
+ declare const hslToRgb: typeof hslToRgb$1;
108
+ /**
109
+ * @public
110
+ * @deprecated Use `multiply` from `@sanity/ui/theme` instead.
111
+ */
112
+ declare const multiply: typeof multiply$1;
113
+ /**
114
+ * @public
115
+ * @deprecated Use `parseColor` from `@sanity/ui/theme` instead.
116
+ */
117
+ declare const parseColor: typeof parseColor$1;
118
+ /**
119
+ * @public
120
+ * @deprecated Use `rgbToHex` from `@sanity/ui/theme` instead.
121
+ */
122
+ declare const rgbToHex: typeof rgbToHex$1;
123
+ /**
124
+ * @public
125
+ * @deprecated Use `rgbToHsl` from `@sanity/ui/theme` instead.
126
+ */
127
+ declare const rgbToHsl: typeof rgbToHsl$1;
128
+ /**
129
+ * @public
130
+ * @deprecated Use `rgba` from `@sanity/ui/theme` instead.
131
+ */
132
+ declare const rgba: typeof rgba$1;
133
+ /**
134
+ * @public
135
+ * @deprecated Use `screen` from `@sanity/ui/theme` instead.
136
+ */
137
+ declare const screen: typeof screen$1;
138
+ /**
139
+ * @public
140
+ * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
141
+ */
142
+ declare const studioTheme: BaseTheme$1;
143
+ /**
144
+ * Assign properties from `U` to `T`, excluding properties that already exist in `T`.
145
+ *
146
+ * @public
147
+ */
148
+ type Assign<T extends object, U extends object> = Omit<T, keyof U> & U;
149
+ /** @public */
150
+ type EmptyProps = object;
151
+ /** @public */
152
+ type TagType = keyof React.JSX.IntrinsicElements;
153
+ /** @public */
154
+ type ComponentType<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ExoticComponent<P>;
155
+ /** @public */
156
+ type ElementType<P = any> = TagType | ComponentType<P>;
157
+ /**
158
+ * Resolves the props of a polymorphic component: the props of the element/component passed to `as`
159
+ * (defaulting to the component's own element), with the component's own props assigned on top.
160
+ *
161
+ * @public
162
+ */
163
+ type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>, P & {
164
+ as?: E;
165
+ }>;
166
+ /**
167
+ * @public
168
+ */
169
+ type BoxSizing = 'content' | 'border';
170
+ /**
171
+ * @public
172
+ */
173
+ type BoxDisplay = 'none' | 'block' | 'grid' | 'flex' | 'inline-block';
174
+ /**
175
+ * @public
176
+ */
177
+ type BoxHeight = 'stretch' | 'fill';
178
+ /**
179
+ * @public
180
+ */
181
+ type BoxOverflow = 'visible' | 'hidden' | 'auto';
182
+ /**
183
+ * @public
184
+ */
185
+ type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
186
+ /**
187
+ * @public
188
+ */
189
+ type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
190
+ /**
191
+ * @public
192
+ */
193
+ type FlexJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
194
+ /**
195
+ * @public
196
+ */
197
+ type FlexValue = number | 'none' | 'auto' | 'initial';
198
+ /**
199
+ * @public
200
+ */
201
+ type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap';
202
+ /**
203
+ * @public
204
+ */
205
+ type GridAutoRows = 'auto' | 'min' | 'max' | 'fr';
206
+ /**
207
+ * @public
208
+ */
209
+ type GridAutoCols = 'auto' | 'min' | 'max' | 'fr';
210
+ /**
211
+ * @public
212
+ */
213
+ type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense';
214
+ /**
215
+ * @public
216
+ */
217
+ type GridItemColumn = 'auto' | 'full' | number;
218
+ /**
219
+ * @public
220
+ */
221
+ type GridItemColumnStart = 'auto' | number;
222
+ /**
223
+ * @public
224
+ */
225
+ type GridItemColumnEnd = 'auto' | number;
226
+ /**
227
+ * @public
228
+ */
229
+ type GridItemRow = 'auto' | 'full' | number;
230
+ /**
231
+ * @public
232
+ */
233
+ type GridItemRowStart = 'auto' | number;
234
+ /**
235
+ * @public
236
+ */
237
+ type GridItemRowEnd = 'auto' | number;
238
+ /**
239
+ * @public
240
+ */
241
+ type Radius = number | 'full';
242
+ /**
243
+ * @public
244
+ */
245
+ interface ResponsiveBorderProps {
246
+ border?: boolean | boolean[];
247
+ borderTop?: boolean | boolean[];
248
+ borderRight?: boolean | boolean[];
249
+ borderBottom?: boolean | boolean[];
250
+ borderLeft?: boolean | boolean[];
251
+ }
252
+ /**
253
+ * @public
254
+ */
255
+ interface ResponsiveBoxProps {
256
+ display?: BoxDisplay | BoxDisplay[];
257
+ height?: BoxHeight | BoxHeight[];
258
+ overflow?: BoxOverflow | BoxOverflow[];
259
+ sizing?: BoxSizing | BoxSizing[];
260
+ }
261
+ /**
262
+ * @public
263
+ */
264
+ interface ResponsiveFlexProps {
265
+ align?: FlexAlign | FlexAlign[];
266
+ direction?: FlexDirection | FlexDirection[];
267
+ justify?: FlexJustify | FlexJustify[];
268
+ wrap?: FlexWrap | FlexWrap[];
269
+ }
270
+ /**
271
+ * @public
272
+ */
273
+ interface ResponsiveFlexItemProps {
274
+ /** Sets the flex CSS attribute. The property is responsive. */
275
+ flex?: FlexValue | FlexValue[];
276
+ }
277
+ /**
278
+ * @public
279
+ */
280
+ interface ResponsiveGridProps {
281
+ autoRows?: GridAutoRows | GridAutoRows[];
282
+ autoCols?: GridAutoCols | GridAutoCols[];
283
+ autoFlow?: GridAutoFlow | GridAutoFlow[];
284
+ /**
285
+ * @deprecated Use `gridTemplateColumns` instead.
286
+ */
287
+ columns?: never;
288
+ gridTemplateColumns?: number | number[];
289
+ gap?: number | number[];
290
+ gapX?: number | number[];
291
+ gapY?: number | number[];
292
+ /**
293
+ * @deprecated Use `gridTemplateRows` instead.
294
+ */
295
+ rows?: never;
296
+ gridTemplateRows?: number | number[];
297
+ }
298
+ /**
299
+ * @public
300
+ */
301
+ interface ResponsiveGridItemProps {
302
+ gridColumn?: GridItemColumn | GridItemColumn[];
303
+ /**
304
+ * @deprecated Use `gridColumn` instead.
305
+ */
306
+ column?: never;
307
+ gridColumnStart?: GridItemColumnStart | GridItemColumnStart[];
308
+ /**
309
+ * @deprecated Use `gridColumnStart` instead.
310
+ */
311
+ columnStart?: never;
312
+ gridColumnEnd?: GridItemColumnEnd | GridItemColumnEnd[];
313
+ /**
314
+ * @deprecated Use `gridColumnEnd` instead.
315
+ */
316
+ columnEnd?: never;
317
+ gridRow?: GridItemRow | GridItemRow[];
318
+ /**
319
+ * @deprecated Use `gridRow` instead.
320
+ */
321
+ row?: never;
322
+ gridRowStart?: GridItemRowStart | GridItemRowStart[];
323
+ /**
324
+ * @deprecated Use `gridRowStart` instead.
325
+ */
326
+ rowStart?: never;
327
+ gridRowEnd?: GridItemRowEnd | GridItemRowEnd[];
328
+ /**
329
+ * @deprecated Use `gridRowEnd` instead.
330
+ */
331
+ rowEnd?: never;
332
+ }
333
+ /**
334
+ * @public
335
+ */
336
+ interface ResponsiveMarginProps {
337
+ /** Applies margins to all sides. The property is responsive. */
338
+ margin?: number | number[];
339
+ /** Applies margins to the left and right sides. The property is responsive. */
340
+ marginX?: number | number[];
341
+ /** Applies margins to the top and bottom sides. The property is responsive. */
342
+ marginY?: number | number[];
343
+ marginTop?: number | number[];
344
+ marginRight?: number | number[];
345
+ marginBottom?: number | number[];
346
+ marginLeft?: number | number[];
347
+ }
348
+ /**
349
+ * @public
350
+ */
351
+ interface ResponsivePaddingProps {
352
+ padding?: number | number[];
353
+ paddingX?: number | number[];
354
+ paddingY?: number | number[];
355
+ paddingTop?: number | number[];
356
+ paddingRight?: number | number[];
357
+ paddingBottom?: number | number[];
358
+ paddingLeft?: number | number[];
359
+ }
360
+ /**
361
+ * @public
362
+ */
363
+ interface ResponsiveRadiusProps {
364
+ radius?: Radius | Radius[];
365
+ }
366
+ /**
367
+ * @public
368
+ */
369
+ interface ResponsiveShadowProps {
370
+ shadow?: number | number[];
371
+ }
372
+ /**
373
+ * @public
374
+ */
375
+ interface ResponsiveWidthProps {
376
+ width?: number | 'auto' | (number | 'auto')[];
377
+ }
378
+ /**
379
+ * @public
380
+ */
381
+ type Delay = number | Partial<{
382
+ open: number;
383
+ close: number;
384
+ }>;
385
+ /**
386
+ * The props that `Box` adds on top of the element it renders as.
387
+ *
388
+ * @public
389
+ */
390
+ interface BoxOwnProps extends ResponsiveFlexItemProps, ResponsiveBoxProps, ResponsiveGridItemProps, ResponsiveMarginProps, ResponsivePaddingProps {
391
+ forwardedAs?: ElementType;
392
+ }
393
+ /**
394
+ * @public
395
+ */
396
+ type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>;
397
+ /**
398
+ * The `Box` component is a basic layout wrapper component which provides utility properties
399
+ * for flex, margins and padding.
400
+ *
401
+ * @public
402
+ */
403
+ declare const Box: <E extends ElementType = 'div'>(props: BoxProps<E>) => React.JSX.Element;
404
+ /**
405
+ * @public
406
+ */
407
+ type CardTone = ThemeColorCardToneKey | 'inherit';
408
+ /**
409
+ * Placement of floating UI elements.
410
+ *
411
+ * @public
412
+ */
413
+ type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
414
+ /**
415
+ * @beta
416
+ */
417
+ type PopoverMargins = [number, number, number, number];
418
+ /**
419
+ * @public
420
+ */
421
+ interface LayerProps {
422
+ as?: React.ElementType | keyof React.JSX.IntrinsicElements;
423
+ /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
424
+ onActivate?: (props: {
425
+ activeElement: HTMLElement | null;
426
+ }) => void;
427
+ zOffset?: number | number[];
428
+ }
429
+ /**
430
+ * @public
431
+ */
432
+ declare const Layer: import("react").ForwardRefExoticComponent<Omit<LayerProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
433
+ /** @beta */
434
+ type PopoverUpdateCallback = () => void;
435
+ /** @public */
436
+ type PopoverWidth = number | 'auto';
437
+ /** @public */
438
+ interface PopoverProps extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {
439
+ /** @beta */
440
+ __unstable_margins?: PopoverMargins;
441
+ /**
442
+ * Whether the popover should animate in and out.
443
+ *
444
+ * @beta
445
+ * @defaultValue false
446
+ */
447
+ animate?: boolean;
448
+ arrow?: boolean;
449
+ /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
450
+ boundaryElement?: never;
451
+ children?: React.JSX.Element;
452
+ /**
453
+ * When `true`, prevent overflow within the current boundary:
454
+ * - by flipping on its side axis
455
+ * - by resizing
456
+ /*
457
+ * Note that:
458
+ * - setting `preventOverflow` to `true` also prevents overflow on its side axis
459
+ * - setting `matchReferenceWidth` to `true` also causes the popover to resize
460
+ *
461
+ * @defaultValue false
462
+ */
463
+ constrainSize?: boolean;
464
+ content?: React.ReactNode;
465
+ disabled?: boolean;
466
+ fallbackPlacements?: Placement[];
467
+ floatingBoundary?: HTMLElement | null;
468
+ /**
469
+ * When `true`, set the maximum width to match the reference element, and also prevent overflow within
470
+ * the current boundary by resizing.
471
+ *
472
+ * Note that setting `constrainSize` to `true` also causes the popover to resize
473
+ *
474
+ * @defaultValue false
475
+ */
476
+ matchReferenceWidth?: boolean;
477
+ /**
478
+ * When true, blocks all pointer interaction with elements beneath the popover until closed.
479
+ *
480
+ * @beta
481
+ * @defaultValue false
482
+ */
483
+ modal?: boolean;
484
+ open?: boolean;
485
+ overflow?: BoxOverflow;
486
+ padding?: number | number[];
487
+ placement?: Placement;
488
+ /**
489
+ * When 'flip' (default), the placement is determined from the initial placement and the
490
+ * fallback placements in order. Whichever fits in the viewport first.
491
+ *
492
+ * When 'autoPlacement', the initial placement and all fallback placements are evaluated
493
+ * and the placement with the most viewport space available.
494
+ *
495
+ * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
496
+ */
497
+ placementStrategy?: 'flip' | 'autoPlacement';
498
+ /** Whether or not to render the popover in a portal element. */
499
+ portal?: boolean | string;
500
+ preventOverflow?: boolean;
501
+ referenceBoundary?: HTMLElement | null;
502
+ /**
503
+ * When defined, the popover will be positioned relative to this element.
504
+ * The children of the popover won't be rendered.
505
+ */
506
+ referenceElement?: HTMLElement | null;
507
+ scheme?: ThemeColorSchemeKey$1;
508
+ tone?: CardTone;
509
+ /** @beta */
510
+ updateRef?: Ref<PopoverUpdateCallback | undefined>;
511
+ width?: PopoverWidth | PopoverWidth[];
512
+ }
513
+ /**
514
+ * The `Popover` component is used to display some content on top of another.
515
+ *
516
+ * @public
517
+ */
518
+ declare const Popover: import("react").ForwardRefExoticComponent<Omit<PopoverProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "content" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
519
+ /**
520
+ * @public
521
+ */
522
+ type ButtonMode = ThemeColorButtonModeKey$1;
523
+ /**
524
+ * @public
525
+ */
526
+ type ButtonTextAlign = 'left' | 'right' | 'center';
527
+ /**
528
+ * @public
529
+ */
530
+ type ButtonTone = ThemeColorStateToneKey;
531
+ /**
532
+ * @public
533
+ */
534
+ type ButtonWidth = 'fill';
535
+ /**
536
+ * @public
537
+ */
538
+ interface ButtonOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
539
+ fontSize?: number | number[];
540
+ mode?: ButtonMode;
541
+ icon?: React.ElementType | React.ReactNode;
542
+ iconRight?: React.ElementType | React.ReactNode;
543
+ justify?: FlexJustify | FlexJustify[];
544
+ /**
545
+ * @beta Do not use in production, as this might change.
546
+ */
547
+ loading?: boolean;
548
+ selected?: boolean;
549
+ /**
550
+ * @deprecated Use `gap` instead.
551
+ */
552
+ space?: never;
553
+ gap?: number | number[];
554
+ muted?: boolean;
555
+ text?: React.ReactNode;
556
+ textAlign?: ButtonTextAlign;
557
+ textWeight?: ThemeFontWeightKey$1;
558
+ tone?: ButtonTone;
559
+ type?: 'button' | 'reset' | 'submit';
560
+ width?: ButtonWidth;
561
+ }
562
+ /**
563
+ * @public
564
+ */
565
+ type ButtonProps<E extends ElementType = 'button'> = Props<ButtonOwnProps, E>;
566
+ /**
567
+ * @public
568
+ */
569
+ declare const Button: <E extends ElementType = 'button'>(props: ButtonProps<E>) => React.JSX.Element;
4
570
  /**
5
571
  * @public
6
572
  */
@@ -145,9 +711,9 @@ interface BreadcrumbsProps {
145
711
  separator?: React.ReactNode;
146
712
  gap?: number | number[];
147
713
  /**
148
- * @deprecated Use `gap` instead. `space` will be removed in v4.
714
+ * @deprecated Use `gap` instead.
149
715
  */
150
- space?: number | number[];
716
+ space?: never;
151
717
  }
152
718
  /**
153
719
  * @beta
@@ -229,6 +795,59 @@ declare function DialogProvider(props: DialogProviderProps): React.JSX.Element;
229
795
  * @beta
230
796
  */
231
797
  declare function useDialog(): DialogContextValue;
798
+ /**
799
+ * @public
800
+ */
801
+ interface HotkeysProps {
802
+ fontSize?: number | number[];
803
+ gap?: number | number[];
804
+ padding?: number | number[];
805
+ radius?: Radius | Radius[];
806
+ /**
807
+ * @deprecated Use `gap` instead.
808
+ */
809
+ space?: never;
810
+ keys?: string[];
811
+ }
812
+ /**
813
+ * Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
814
+ *
815
+ * @public
816
+ */
817
+ declare const Hotkeys: import("react").ForwardRefExoticComponent<HotkeysProps & Omit<import("react").HTMLProps<HTMLElement>, "as" | "ref" | "size"> & import("react").RefAttributes<HTMLElement>>;
818
+ /**
819
+ * @public
820
+ */
821
+ interface MenuProps extends ResponsivePaddingProps {
822
+ /**
823
+ * @deprecated Use `shouldFocus="first"` instead.
824
+ */
825
+ 'focusFirst'?: never;
826
+ /**
827
+ * @deprecated Use `shouldFocus="last"` instead.
828
+ */
829
+ 'focusLast'?: never;
830
+ 'onClickOutside'?: (event: MouseEvent) => void;
831
+ 'onEscape'?: () => void;
832
+ 'onItemClick'?: () => void;
833
+ 'onItemSelect'?: (index: number) => void;
834
+ 'originElement'?: HTMLElement | null;
835
+ 'registerElement'?: (el: HTMLElement) => () => void;
836
+ 'shouldFocus'?: 'first' | 'last' | null;
837
+ 'gap'?: number | number[];
838
+ /**
839
+ * @deprecated Use `gap` instead.
840
+ */
841
+ 'space'?: never;
842
+ 'aria-labelledby'?: string;
843
+ 'onBlurCapture'?: (event: FocusEvent) => void;
844
+ }
845
+ /**
846
+ * The `Menu` component is a building block for application menus.
847
+ *
848
+ * @public
849
+ */
850
+ declare const Menu: import("react").ForwardRefExoticComponent<Omit<MenuProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "height" | "role" | "tabIndex">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
232
851
  /**
233
852
  * @public
234
853
  */
@@ -240,7 +859,7 @@ interface MenuButtonProps {
240
859
  /**
241
860
  * @deprecated Use `popover={{boundaryElement: element}}` instead.
242
861
  */
243
- boundaryElement?: HTMLElement;
862
+ boundaryElement?: never;
244
863
  button: React.JSX.Element;
245
864
  id: string;
246
865
  menu?: React.JSX.Element;
@@ -249,25 +868,25 @@ interface MenuButtonProps {
249
868
  /**
250
869
  * @deprecated Use `popover={{placement: 'top'}}` instead.
251
870
  */
252
- placement?: Placement;
871
+ placement?: never;
253
872
  popover?: Omit<PopoverProps, 'content' | 'open'>;
254
873
  /**
255
874
  * @deprecated Use `popover={{scheme: 'dark'}}` instead.
256
875
  */
257
- popoverScheme?: ThemeColorSchemeKey$1;
876
+ popoverScheme?: never;
258
877
  /**
259
878
  * @deprecated Use `popover={{radius: 2}}` instead.
260
879
  */
261
- popoverRadius?: Radius | Radius[];
880
+ popoverRadius?: never;
262
881
  /**
263
882
  * @beta Do not use in production.
264
883
  * @deprecated Use `popover={{portal: true}}` instead.
265
884
  */
266
- portal?: boolean;
885
+ portal?: never;
267
886
  /**
268
887
  * @deprecated Use `popover={{preventOverflow: true}}` instead.
269
888
  */
270
- preventOverflow?: boolean;
889
+ preventOverflow?: never;
271
890
  }
272
891
  /**
273
892
  * The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
@@ -275,6 +894,70 @@ interface MenuButtonProps {
275
894
  * @public
276
895
  */
277
896
  declare const MenuButton: import("react").ForwardRefExoticComponent<MenuButtonProps & import("react").RefAttributes<HTMLButtonElement | null>>;
897
+ /**
898
+ * @public
899
+ */
900
+ type MenuDividerProps<E extends ElementType = 'hr'> = Props<EmptyProps, E>;
901
+ /**
902
+ * @public
903
+ */
904
+ declare const MenuDivider: <E extends ElementType = 'hr'>(props: MenuDividerProps<E>) => React.JSX.Element;
905
+ /**
906
+ * @public
907
+ */
908
+ type SelectableTone = ThemeColorStateToneKey;
909
+ /**
910
+ * @public
911
+ */
912
+ interface MenuGroupOwnProps {
913
+ fontSize?: number | number[];
914
+ icon?: React.ElementType | React.ReactNode;
915
+ menu?: Omit<MenuProps, 'onClickOutside' | 'onEscape' | 'onItemClick' | 'onKeyDown' | 'onMouseEnter' | 'registerElement' | 'shouldFocus' | 'onBlurCapture'>;
916
+ padding?: number | number[];
917
+ popover?: Omit<PopoverProps, 'content' | 'open'>;
918
+ radius?: Radius | Radius[];
919
+ gap?: number | number[];
920
+ /**
921
+ * @deprecated Use `gap` instead.
922
+ */
923
+ space?: never;
924
+ text: React.ReactNode;
925
+ tone?: SelectableTone;
926
+ }
927
+ /**
928
+ * @public
929
+ */
930
+ type MenuGroupProps<E extends ElementType = 'button'> = Props<MenuGroupOwnProps, E>;
931
+ /**
932
+ * @public
933
+ */
934
+ declare const MenuGroup: <E extends ElementType = 'button'>(props: MenuGroupProps<E>) => React.JSX.Element;
935
+ /**
936
+ * @public
937
+ */
938
+ interface MenuItemOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
939
+ fontSize?: number | number[];
940
+ hotkeys?: string[];
941
+ icon?: React.ElementType | React.ReactNode;
942
+ iconRight?: React.ElementType | React.ReactNode;
943
+ pressed?: boolean;
944
+ selected?: boolean;
945
+ gap?: number | number[];
946
+ /**
947
+ * @deprecated Use `gap` instead.
948
+ */
949
+ space?: never;
950
+ text?: React.ReactNode;
951
+ tone?: SelectableTone;
952
+ }
953
+ /**
954
+ * @public
955
+ */
956
+ type MenuItemProps<E extends ElementType = 'button'> = Props<MenuItemOwnProps, E>;
957
+ /**
958
+ * @public
959
+ */
960
+ declare const MenuItem: <E extends ElementType = 'button'>(props: MenuItemProps<E>) => React.JSX.Element;
278
961
  /**
279
962
  * This API might change. DO NOT USE IN PRODUCTION.
280
963
  * @beta
@@ -310,32 +993,84 @@ interface HeadingSkeletonProps extends SkeletonProps {
310
993
  size?: number | number[];
311
994
  }
312
995
  /**
313
- * This API might change. DO NOT USE IN PRODUCTION.
314
- * @beta
996
+ * This API might change. DO NOT USE IN PRODUCTION.
997
+ * @beta
998
+ */
999
+ interface CodeSkeletonProps extends SkeletonProps {
1000
+ size?: number | number[];
1001
+ }
1002
+ /**
1003
+ * This API might change. DO NOT USE IN PRODUCTION.
1004
+ * @beta
1005
+ */
1006
+ declare const TextSkeleton: import("react").ForwardRefExoticComponent<Omit<TextSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1007
+ /**
1008
+ * This API might change. DO NOT USE IN PRODUCTION.
1009
+ * @beta
1010
+ */
1011
+ declare const LabelSkeleton: import("react").ForwardRefExoticComponent<Omit<LabelSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1012
+ /**
1013
+ * This API might change. DO NOT USE IN PRODUCTION.
1014
+ * @beta
1015
+ */
1016
+ declare const HeadingSkeleton: import("react").ForwardRefExoticComponent<Omit<HeadingSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1017
+ /**
1018
+ * This API might change. DO NOT USE IN PRODUCTION.
1019
+ * @beta
1020
+ */
1021
+ declare const CodeSkeleton: import("react").ForwardRefExoticComponent<Omit<CodeSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1022
+ /**
1023
+ * @public
1024
+ */
1025
+ interface TabProps {
1026
+ /**
1027
+ * The `id` of the correlating `TabPanel` component.
1028
+ */
1029
+ 'aria-controls': string;
1030
+ 'id': string;
1031
+ 'icon'?: React.ElementType | React.ReactNode;
1032
+ 'focused'?: boolean;
1033
+ 'fontSize'?: number | number[];
1034
+ 'label'?: React.ReactNode;
1035
+ 'padding'?: number | number[];
1036
+ 'selected'?: boolean;
1037
+ 'tone'?: ButtonTone;
1038
+ }
1039
+ /**
1040
+ * @public
1041
+ */
1042
+ declare const Tab: import("react").ForwardRefExoticComponent<Omit<TabProps & Omit<import("react").HTMLProps<HTMLButtonElement>, "aria-controls" | "as" | "id" | "label" | "type" | "width">, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
1043
+ /**
1044
+ * @public
315
1045
  */
316
- interface CodeSkeletonProps extends SkeletonProps {
317
- size?: number | number[];
1046
+ interface InlineOwnProps extends Omit<BoxOwnProps, 'display'> {
1047
+ /**
1048
+ * @deprecated Use `gap` instead.
1049
+ */
1050
+ space?: never;
1051
+ /** The spacing between children. */
1052
+ gap?: number | number[];
318
1053
  }
319
1054
  /**
320
- * This API might change. DO NOT USE IN PRODUCTION.
321
- * @beta
1055
+ * @public
322
1056
  */
323
- declare const TextSkeleton: import("react").ForwardRefExoticComponent<Omit<TextSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1057
+ type InlineProps<E extends ElementType = 'div'> = Props<InlineOwnProps, E>;
324
1058
  /**
325
- * This API might change. DO NOT USE IN PRODUCTION.
326
- * @beta
1059
+ * The `Inline` component is a layout utility for aligning and spacing items horizontally.
1060
+ *
1061
+ * @public
327
1062
  */
328
- declare const LabelSkeleton: import("react").ForwardRefExoticComponent<Omit<LabelSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1063
+ declare const Inline: <E extends ElementType = 'div'>(props: InlineProps<E>) => React.JSX.Element;
329
1064
  /**
330
- * This API might change. DO NOT USE IN PRODUCTION.
331
- * @beta
1065
+ * @public
332
1066
  */
333
- declare const HeadingSkeleton: import("react").ForwardRefExoticComponent<Omit<HeadingSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1067
+ interface TabListProps extends Omit<InlineOwnProps, 'height'> {
1068
+ children: Array<React.JSX.Element | null | undefined | false>;
1069
+ }
334
1070
  /**
335
- * This API might change. DO NOT USE IN PRODUCTION.
336
- * @beta
1071
+ * @public
337
1072
  */
338
- declare const CodeSkeleton: import("react").ForwardRefExoticComponent<Omit<CodeSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1073
+ declare const TabList: import("react").ForwardRefExoticComponent<Omit<TabListProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "height">, "ref"> & import("react").RefAttributes<unknown>>;
339
1074
  /**
340
1075
  * @public
341
1076
  */
@@ -428,9 +1163,9 @@ declare function useToast(): ToastContextValue;
428
1163
  interface TreeProps {
429
1164
  gap?: number | number[];
430
1165
  /**
431
- * @deprecated Use `gap` instead. `space` will be removed in v4.
1166
+ * @deprecated Use `gap` instead.
432
1167
  */
433
- space?: number | number[];
1168
+ space?: never;
434
1169
  }
435
1170
  /**
436
1171
  * This API might change. DO NOT USE IN PRODUCTION.
@@ -457,9 +1192,9 @@ interface TreeItemProps {
457
1192
  padding?: number | number[];
458
1193
  gap?: number | number[];
459
1194
  /**
460
- * @deprecated Use `gap` instead. `space` will be removed in v4.
1195
+ * @deprecated Use `gap` instead.
461
1196
  */
462
- space?: number | number[];
1197
+ space?: never;
463
1198
  text?: React.ReactNode;
464
1199
  weight?: ThemeFontWeightKey$1;
465
1200
  }
@@ -490,9 +1225,9 @@ interface TreeContextValue {
490
1225
  setFocusedElement: (focusedElement: HTMLElement | null) => void;
491
1226
  gap: number | number[];
492
1227
  /**
493
- * @deprecated Use `gap` instead. `space` will be removed in v4.
1228
+ * @deprecated Use `gap` instead.
494
1229
  */
495
- space: number | number[];
1230
+ space?: never;
496
1231
  state: TreeState;
497
1232
  }
498
1233
  /**
@@ -507,6 +1242,38 @@ declare function _raf(fn: () => void): () => void;
507
1242
  * @internal
508
1243
  */
509
1244
  declare function _raf2(fn: () => void): () => void;
1245
+ /**
1246
+ * @internal
1247
+ */
1248
+ declare function _isEnterToClickElement(element: HTMLElement): boolean;
1249
+ /**
1250
+ * @internal
1251
+ */
1252
+ declare function isHTMLElement(node: unknown): node is HTMLElement;
1253
+ /**
1254
+ * @internal
1255
+ */
1256
+ declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement;
1257
+ /**
1258
+ * @internal
1259
+ */
1260
+ declare function isHTMLInputElement(element: unknown): element is HTMLInputElement;
1261
+ /**
1262
+ * @internal
1263
+ */
1264
+ declare function isHTMLButtonElement(element: unknown): element is HTMLButtonElement;
1265
+ /**
1266
+ * @internal
1267
+ */
1268
+ declare function isHTMLSelectElement(element: unknown): element is HTMLSelectElement;
1269
+ /**
1270
+ * @internal
1271
+ */
1272
+ declare function isHTMLTextAreaElement(element: unknown): element is HTMLTextAreaElement;
1273
+ /**
1274
+ * @internal
1275
+ */
1276
+ declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean;
510
1277
  /**
511
1278
  * @internal
512
1279
  */
@@ -537,7 +1304,7 @@ type ArrayPropPrimitive = string | number | boolean | undefined | null;
537
1304
  * @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
538
1305
  * @beta
539
1306
  */
540
- declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(val: T | T[] | undefined, defaultVal?: T[]): T[];
1307
+ declare function useArrayProp(_val?: never, _defaultVal?: never): never;
541
1308
  /**
542
1309
  * @public
543
1310
  */
@@ -561,7 +1328,7 @@ type ClickOutsideElements = (HTMLElement | null | (HTMLElement | null)[])[];
561
1328
  * return <button ref={buttonRef} />
562
1329
  * ```
563
1330
  */
564
- declare function useClickOutside(listener: ClickOutsideListener, elementsArg?: ClickOutsideElements, boundaryElement?: HTMLElement | null): (el: HTMLElement | null) => void;
1331
+ declare function useClickOutside(_listener?: never, _elementsArg?: never, _boundaryElement?: never): never;
565
1332
  /**
566
1333
  * @public
567
1334
  */
@@ -588,7 +1355,7 @@ declare function useCustomValidity(ref: {
588
1355
  *
589
1356
  * @deprecated Use `useElementSize` instead
590
1357
  */
591
- declare function useElementRect(element: HTMLElement | null): DOMRectReadOnly | null;
1358
+ declare function useElementRect(_element?: never): never;
592
1359
  /**
593
1360
  * @beta
594
1361
  */
@@ -640,7 +1407,7 @@ declare function useElementSize(element: HTMLElement | null): ElementSize | null
640
1407
  * +useImperativeHandle(forwardedRef, () => ref.current)
641
1408
  * ```
642
1409
  */
643
- declare function useForwardedRef<T>(ref: React.ForwardedRef<T>): React.RefObject<T | null>;
1410
+ declare function useForwardedRef(_ref?: never): never;
644
1411
  /**
645
1412
  * Adds global keydown event listener to the window.
646
1413
  *
@@ -669,6 +1436,18 @@ interface _MediaStore {
669
1436
  * @beta
670
1437
  */
671
1438
  declare function useMediaIndex(): number;
1439
+ /**
1440
+ * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
1441
+ *
1442
+ * @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)
1443
+ *
1444
+ * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
1445
+ * 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
1446
+ * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
1447
+ *
1448
+ * @public
1449
+ */
1450
+ declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
672
1451
  /**
673
1452
  * Returns true if motion should be reduced
674
1453
  *
@@ -734,7 +1513,7 @@ interface AvatarCounterProps {
734
1513
  count: number;
735
1514
  size?: AvatarSize | AvatarSize[];
736
1515
  /** @deprecated No longer supported. */
737
- tone?: 'navbar';
1516
+ tone?: never;
738
1517
  }
739
1518
  /**
740
1519
  * @public
@@ -748,7 +1527,7 @@ interface AvatarStackProps {
748
1527
  maxLength?: number;
749
1528
  size?: AvatarSize | AvatarSize[];
750
1529
  /** @deprecated No longer supported. */
751
- tone?: 'navbar';
1530
+ tone?: never;
752
1531
  }
753
1532
  /**
754
1533
  * @public
@@ -770,7 +1549,7 @@ interface ResponsiveAvatarSizeStyleProps {
770
1549
  * @public
771
1550
  * @deprecated No longer used
772
1551
  */
773
- type BadgeMode = 'default' | 'outline';
1552
+ type BadgeMode = never;
774
1553
  /**
775
1554
  * @public
776
1555
  */
@@ -781,7 +1560,7 @@ type BadgeTone = ThemeColorStateToneKey;
781
1560
  interface BadgeOwnProps extends BoxOwnProps, ResponsiveRadiusProps {
782
1561
  fontSize?: number | number[];
783
1562
  /** @deprecated No longer used. */
784
- mode?: BadgeMode;
1563
+ mode?: never;
785
1564
  tone?: BadgeTone;
786
1565
  }
787
1566
  /**
@@ -794,6 +1573,38 @@ type BadgeProps<E extends ElementType = 'div'> = Props<BadgeOwnProps, E>;
794
1573
  * @public
795
1574
  */
796
1575
  declare const Badge: <E extends ElementType = 'div'>(props: BadgeProps<E>) => React.JSX.Element;
1576
+ /**
1577
+ * @public
1578
+ */
1579
+ interface CardOwnProps extends BoxOwnProps, ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps {
1580
+ /**
1581
+ * Do not use in production.
1582
+ * @beta
1583
+ */
1584
+ __unstable_checkered?: boolean;
1585
+ /**
1586
+ * Do not use in production.
1587
+ * @beta
1588
+ */
1589
+ __unstable_focusRing?: boolean;
1590
+ disabled?: boolean;
1591
+ muted?: boolean;
1592
+ pressed?: boolean;
1593
+ scheme?: ThemeColorSchemeKey$1;
1594
+ selected?: boolean;
1595
+ tone?: CardTone;
1596
+ }
1597
+ /**
1598
+ * @public
1599
+ */
1600
+ type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>;
1601
+ /**
1602
+ * The `Card` component acts much like a `Box`, but with a background and foreground color.
1603
+ * Components within a `Card` inherit its colors.
1604
+ *
1605
+ * @public
1606
+ */
1607
+ declare const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element;
797
1608
  /**
798
1609
  * @internal
799
1610
  */
@@ -853,6 +1664,40 @@ declare const Container: <E extends ElementType = 'div'>(props: ContainerProps<E
853
1664
  interface ResponsiveWidthStyleProps {
854
1665
  $width: (number | 'auto')[];
855
1666
  }
1667
+ /**
1668
+ * @public
1669
+ */
1670
+ interface FlexOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveFlexProps, ResponsiveFlexItemProps {
1671
+ gap?: number | number[];
1672
+ }
1673
+ /**
1674
+ * @public
1675
+ */
1676
+ type FlexProps<E extends ElementType = 'div'> = Props<FlexOwnProps, E>;
1677
+ /**
1678
+ * The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
1679
+ *
1680
+ * @public
1681
+ */
1682
+ declare const Flex: <E extends ElementType = 'div'>(props: FlexProps<E>) => React.JSX.Element;
1683
+ /**
1684
+ * @public
1685
+ */
1686
+ interface GridOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveGridProps {}
1687
+ /**
1688
+ * @public
1689
+ */
1690
+ type GridProps<E extends ElementType = 'div'> = Props<GridOwnProps, E>;
1691
+ /**
1692
+ * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
1693
+ *
1694
+ * @public
1695
+ */
1696
+ declare const Grid: <E extends ElementType = 'div'>(props: GridProps<E>) => React.JSX.Element;
1697
+ /**
1698
+ * @public
1699
+ */
1700
+ type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial';
856
1701
  /**
857
1702
  * @public
858
1703
  */
@@ -944,9 +1789,9 @@ interface SelectProps {
944
1789
  padding?: number | number[];
945
1790
  radius?: Radius | Radius[];
946
1791
  /**
947
- * @deprecated Use `gap` instead. `space` will be removed in v4.
1792
+ * @deprecated Use `gap` instead.
948
1793
  */
949
- space?: number | number[];
1794
+ space?: never;
950
1795
  customValidity?: string;
951
1796
  }
952
1797
  /**
@@ -955,6 +1800,39 @@ interface SelectProps {
955
1800
  * @public
956
1801
  */
957
1802
  declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps & Omit<import("react").HTMLProps<HTMLSelectElement>, "as">, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
1803
+ /**
1804
+ * @public
1805
+ */
1806
+ interface SpinnerProps {
1807
+ muted?: boolean;
1808
+ size?: number | number[];
1809
+ }
1810
+ /**
1811
+ * Indicate that something is loading for an indeterminate amount of time.
1812
+ *
1813
+ * @public
1814
+ */
1815
+ declare const Spinner: import("react").ForwardRefExoticComponent<Omit<SpinnerProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1816
+ /**
1817
+ * @public
1818
+ */
1819
+ interface StackOwnProps extends BoxOwnProps {
1820
+ gap?: number | number[];
1821
+ /**
1822
+ * @deprecated Use `gap` instead.
1823
+ */
1824
+ space?: never;
1825
+ }
1826
+ /**
1827
+ * @public
1828
+ */
1829
+ type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>;
1830
+ /**
1831
+ * The `Stack` component is used to place elements on top of each other.
1832
+ *
1833
+ * @public
1834
+ */
1835
+ declare const Stack: <E extends ElementType = 'div'>(props: StackProps<E>) => React.JSX.Element;
958
1836
  /**
959
1837
  * @public
960
1838
  */
@@ -969,6 +1847,33 @@ interface SwitchProps {
969
1847
  * @public
970
1848
  */
971
1849
  declare const Switch: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & SwitchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
1850
+ /**
1851
+ * @public
1852
+ */
1853
+ interface TextOwnProps {
1854
+ accent?: boolean;
1855
+ align?: TextAlign | TextAlign[];
1856
+ /** When `true` the text color will be muted. */
1857
+ muted?: boolean;
1858
+ size?: number | number[];
1859
+ /**
1860
+ * Controls how overflowing text is treated.
1861
+ * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
1862
+ * @beta
1863
+ */
1864
+ textOverflow?: 'ellipsis';
1865
+ weight?: ThemeFontWeightKey$1;
1866
+ }
1867
+ /**
1868
+ * @public
1869
+ */
1870
+ type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>;
1871
+ /**
1872
+ * The `Text` component is an agile, themed typographic element.
1873
+ *
1874
+ * @public
1875
+ */
1876
+ declare const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element;
972
1877
  /**
973
1878
  * @public
974
1879
  */
@@ -989,6 +1894,97 @@ interface TextAreaProps extends ResponsiveRadiusProps {
989
1894
  * @public
990
1895
  */
991
1896
  declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps & Omit<import("react").HTMLProps<HTMLTextAreaElement>, "as">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
1897
+ /**
1898
+ * @public
1899
+ */
1900
+ type TextInputClearButtonProps = ButtonOwnProps & Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>;
1901
+ /**
1902
+ * @public
1903
+ */
1904
+ type TextInputType = 'search' | 'date' | 'datetime-local' | 'email' | 'url' | 'month' | 'number' | 'password' | 'tel' | 'time' | 'text' | 'week' | 'color';
1905
+ /**
1906
+ * @public
1907
+ */
1908
+ interface TextInputProps {
1909
+ /**
1910
+ * @beta
1911
+ */
1912
+ __unstable_disableFocusRing?: boolean;
1913
+ border?: boolean;
1914
+ /**
1915
+ * @beta
1916
+ */
1917
+ clearButton?: boolean | TextInputClearButtonProps;
1918
+ customValidity?: string;
1919
+ fontSize?: number | number[];
1920
+ icon?: React.ElementType | React.ReactNode;
1921
+ iconRight?: React.ElementType | React.ReactNode;
1922
+ /**
1923
+ * @beta
1924
+ */
1925
+ onClear?: () => void;
1926
+ padding?: number | number[];
1927
+ prefix?: React.ReactNode;
1928
+ radius?: Radius | Radius[];
1929
+ /**
1930
+ * @deprecated Use `gap` instead.
1931
+ */
1932
+ space?: never;
1933
+ gap?: number | number[];
1934
+ suffix?: React.ReactNode;
1935
+ type?: TextInputType;
1936
+ weight?: ThemeFontWeightKey$1;
1937
+ }
1938
+ /**
1939
+ * Single line text input.
1940
+ *
1941
+ * @public
1942
+ */
1943
+ declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps & Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "prefix" | "type">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
1944
+ /**
1945
+ * @public
1946
+ */
1947
+ interface TooltipProps extends Omit<LayerProps, 'as'> {
1948
+ /** @deprecated Use `fallbackPlacements` instead. */
1949
+ allowedAutoPlacements?: never;
1950
+ arrow?: boolean;
1951
+ boundaryElement?: HTMLElement | null;
1952
+ children?: React.JSX.Element;
1953
+ content?: React.ReactNode;
1954
+ disabled?: boolean;
1955
+ fallbackPlacements?: Placement[];
1956
+ padding?: number | number[];
1957
+ placement?: Placement;
1958
+ /** Whether or not to render the tooltip in a portal element. */
1959
+ portal?: boolean | string;
1960
+ radius?: number | number[];
1961
+ scheme?: ThemeColorSchemeKey$1;
1962
+ shadow?: number | number[];
1963
+ /**
1964
+ * Adds a delay to open or close the tooltip.
1965
+ *
1966
+ * If only a `number` is passed, it will be used for both opening and closing.
1967
+ *
1968
+ * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
1969
+ *
1970
+ * @public
1971
+ * @defaultValue 0
1972
+ */
1973
+ delay?: Delay;
1974
+ /**
1975
+ * Whether the tooltip should animate in and out.
1976
+ *
1977
+ * @beta
1978
+ * @defaultValue false
1979
+ */
1980
+ animate?: boolean;
1981
+ }
1982
+ /**
1983
+ * Tooltips display information when hovering, focusing or tapping.
1984
+ *
1985
+ * @public
1986
+ */
1987
+ declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<TooltipProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "content">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
992
1988
  /**
993
1989
  * @beta
994
1990
  */
@@ -1117,6 +2113,19 @@ interface ThemeColorProviderProps {
1117
2113
  * @public
1118
2114
  */
1119
2115
  declare function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element;
2116
+ /**
2117
+ * @public
2118
+ */
2119
+ interface ThemeProviderProps {
2120
+ children?: React.ReactNode;
2121
+ scheme?: ThemeColorSchemeKey$1;
2122
+ theme?: RootTheme$1;
2123
+ tone?: ThemeColorCardToneKey;
2124
+ }
2125
+ /**
2126
+ * @public
2127
+ */
2128
+ declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
1120
2129
  /**
1121
2130
  * @public
1122
2131
  */
@@ -1131,6 +2140,14 @@ interface ThemeContextValue {
1131
2140
  * @public
1132
2141
  */
1133
2142
  declare function useRootTheme(): ThemeContextValue;
2143
+ /**
2144
+ * @public
2145
+ */
2146
+ declare function useTheme(): Theme$1;
2147
+ /**
2148
+ * @public
2149
+ */
2150
+ declare function useTheme_v2(): Theme_v2;
1134
2151
  /** @internal */
1135
2152
  declare const Arrow: import("react").ForwardRefExoticComponent<Omit<{
1136
2153
  width: number;
@@ -1161,13 +2178,9 @@ interface BoundaryElementContextValue {
1161
2178
  declare function useBoundaryElement(): BoundaryElementContextValue;
1162
2179
  /**
1163
2180
  * @internal
1164
- * @deprecated this component will be removed in the next major release
2181
+ * @deprecated ConditionalWrapper was removed in @sanity/ui v4. Inline the conditional wrapping logic instead.
1165
2182
  */
1166
- declare function ConditionalWrapper({ children, condition, wrapper }: {
1167
- children: React.ReactNode;
1168
- condition: boolean;
1169
- wrapper: (children: React.ReactNode) => React.ReactNode;
1170
- }): React.ReactNode;
2183
+ declare function ConditionalWrapper(_props?: never): never;
1171
2184
  /**
1172
2185
  * DO NOT USE IN PRODUCTION.
1173
2186
  * @beta
@@ -1208,6 +2221,17 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
1208
2221
  componentDidCatch(error: Error, info: React.ErrorInfo): void;
1209
2222
  render(): React.ReactNode;
1210
2223
  }
2224
+ /**
2225
+ * @public
2226
+ */
2227
+ interface LayerProviderProps {
2228
+ children?: React.ReactNode;
2229
+ zOffset?: number | number[];
2230
+ }
2231
+ /**
2232
+ * @public
2233
+ */
2234
+ declare function LayerProvider(props: LayerProviderProps): React.JSX.Element;
1211
2235
  /** @public */
1212
2236
  interface LayerContextValue {
1213
2237
  version: 0.0;
@@ -1221,6 +2245,39 @@ interface LayerContextValue {
1221
2245
  * @public
1222
2246
  */
1223
2247
  declare function useLayer(): LayerContextValue;
2248
+ /**
2249
+ * @public
2250
+ */
2251
+ interface PortalProps {
2252
+ children: React.ReactNode;
2253
+ /**
2254
+ * @beta This API might change. DO NOT USE IN PRODUCTION.
2255
+ */
2256
+ __unstable_name?: string;
2257
+ }
2258
+ /**
2259
+ * @public
2260
+ */
2261
+ declare function Portal(props: PortalProps): React.ReactPortal | null;
2262
+ /**
2263
+ * @public
2264
+ */
2265
+ interface PortalProviderProps {
2266
+ /**
2267
+ * @deprecated Use `<BoundaryElementProvider element={...} />` instead
2268
+ */
2269
+ boundaryElement?: HTMLElement | null;
2270
+ children: React.ReactNode;
2271
+ element?: HTMLElement | null;
2272
+ /**
2273
+ * @beta
2274
+ */
2275
+ __unstable_elements?: Record<string, HTMLElement | null | undefined>;
2276
+ }
2277
+ /**
2278
+ * @public
2279
+ */
2280
+ declare function PortalProvider(props: PortalProviderProps): React.JSX.Element;
1224
2281
  /**
1225
2282
  * @public
1226
2283
  */