@sanity/ui 3.0.0-static.11 → 3.0.0-static.13
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 +1293 -1215
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/buildCommand.js +28 -10
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +1284 -1202
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +528 -358
- package/dist/_visual-editing.d.ts +528 -358
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +143 -73
- package/dist/css.d.ts +143 -73
- package/dist/css.js +329 -472
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +330 -473
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1362 -869
- package/dist/index.d.ts +1362 -869
- package/dist/index.js +383 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +387 -312
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-palette.css +105 -1
- package/dist/sanity-palette.min.css +1 -0
- package/dist/sanity-theme.css +4571 -1
- package/dist/sanity-theme.min.css +1 -0
- package/dist/system.css +22053 -21946
- package/dist/system.min.css +1 -0
- package/dist/theme.d.mts +51 -106
- package/dist/theme.d.ts +51 -106
- package/dist/theme.js +9 -9
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +9 -9
- package/dist/theme.mjs.map +1 -1
- package/package.json +10 -5
- package/src/cli/buildCommand.ts +46 -19
- package/src/css/_comp.ts +2 -2
- package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
- package/src/css/{system.style.ts → _system.style.ts} +3 -2
- package/src/css/aspects/display/display.ts +1 -0
- package/src/css/aspects/display/types.ts +2 -3
- package/src/css/aspects/flex/types.ts +4 -12
- package/src/css/aspects/flexItem/types.ts +1 -3
- package/src/css/aspects/font/types.ts +1 -3
- package/src/css/aspects/grid/grid.ts +1 -0
- package/src/css/aspects/grid/types.ts +5 -9
- package/src/css/aspects/gridItem/gridItem.ts +1 -1
- package/src/css/aspects/gridItem/types.ts +7 -18
- package/src/css/aspects/height/height.ts +3 -4
- package/src/css/aspects/inset/inset.ts +1 -0
- package/src/css/aspects/margin/margin.ts +1 -0
- package/src/css/aspects/margin/types.ts +1 -0
- package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
- package/src/css/aspects/maxWidth/types.ts +1 -0
- package/src/css/aspects/minWidth/minWidth.ts +1 -0
- package/src/css/aspects/minWidth/types.ts +2 -0
- package/src/css/aspects/overflow/overflow.ts +1 -0
- package/src/css/aspects/padding/padding.ts +1 -0
- package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
- package/src/css/aspects/position/position.ts +1 -0
- package/src/css/aspects/shadow/shadow.ts +1 -0
- package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
- package/src/css/aspects/textOverflow/types.ts +1 -0
- package/src/css/aspects/width/types.ts +2 -0
- package/src/css/aspects/width/width.ts +1 -0
- package/src/css/{compile/compilePalette.ts → compilePalette.ts} +14 -10
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
- package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
- package/src/css/components/dialog/dialog.ts +7 -0
- package/src/css/components/menu/menu.ts +2 -0
- package/src/css/components/skeleton/skeleton.ts +4 -0
- package/src/css/components/skeleton/types.ts +4 -0
- package/src/css/components/toast/toast.ts +5 -0
- package/src/css/components/tree/tree.ts +1 -0
- package/src/css/composeClassNames.ts +4 -2
- package/src/css/constants.ts +2 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_arrow/_arrow.ts +3 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
- package/src/css/primitives/_selectable/selectable.ts +1 -2
- package/src/css/primitives/avatar/avatar.style.ts +5 -8
- package/src/css/primitives/avatar/avatar.ts +6 -0
- package/src/css/primitives/avatar/types.ts +1 -0
- package/src/css/primitives/box/types.ts +1 -3
- package/src/css/primitives/button/button.ts +4 -21
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +18 -0
- package/src/css/primitives/card/card.style.ts +3 -6
- package/src/css/primitives/card/card.ts +2 -2
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.ts +2 -0
- package/src/css/primitives/container/container.ts +1 -0
- package/src/css/primitives/container/types.ts +1 -0
- package/src/css/primitives/kbd/kbd.ts +1 -0
- package/src/css/primitives/label/types.ts +7 -2
- package/src/css/primitives/popover/popover.ts +2 -0
- package/src/css/primitives/radio/radio.ts +1 -0
- package/src/css/primitives/select/select.ts +2 -0
- package/src/css/primitives/spinner/spinner.ts +2 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/types.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +1 -0
- package/src/css/primitives/textInput/textInput.ts +1 -0
- package/src/css/primitives/tooltip/tooltip.ts +2 -0
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +9 -12
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +3 -1
- package/src/css/varNames.ts +131 -141
- package/src/css/vars.ts +1 -6
- package/src/theme/palette/constants.ts +2 -0
- package/src/theme/palette/types.ts +3 -0
- package/src/theme/types.ts +2 -6
- package/src/theme/v0/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -18
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v2/avatar.ts +1 -3
- package/src/theme/v2/color/_system.ts +1 -3
- package/src/theme/v2/color/avatar.ts +2 -6
- package/src/theme/v2/color/badge.ts +2 -6
- package/src/theme/v2/color/button.ts +3 -9
- package/src/theme/v2/color/color.ts +3 -9
- package/src/theme/v2/color/input.ts +3 -9
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +2 -6
- package/src/theme/v2/color/state.ts +1 -3
- package/src/theme/v2/color/syntax.ts +1 -3
- package/src/theme/v2/input.ts +1 -3
- package/src/theme/v2/theme.ts +2 -6
- package/src/theme/v3/buildTheme_v3.ts +1 -0
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/defaultTokens.ts +1 -0
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +3 -0
- package/src/ui/StyleTags.tsx +3 -1
- package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
- package/src/ui/_compat/theme/themeProvider.tsx +2 -6
- package/src/ui/_compat/theme/types.ts +1 -3
- package/src/ui/_compat/theme/useRootTheme.ts +1 -3
- package/src/ui/_compat/theme/useTheme.ts +2 -6
- package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
- package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
- package/src/ui/components/autocomplete/types.ts +3 -8
- package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
- package/src/ui/components/dialog/dialog.tsx +89 -291
- package/src/ui/components/dialog/dialogCard.tsx +183 -0
- package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
- package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
- package/src/ui/components/menu/menu.tsx +27 -33
- package/src/ui/components/menu/menuButton.tsx +10 -14
- package/src/ui/components/menu/menuDivider.tsx +25 -13
- package/src/ui/components/menu/menuGroup.tsx +34 -26
- package/src/ui/components/menu/menuItem.tsx +51 -40
- package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
- package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
- package/src/ui/components/skeleton/index.ts +3 -0
- package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
- package/src/ui/components/skeleton/skeleton.tsx +39 -16
- package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
- package/src/ui/components/tab/tab.tsx +23 -19
- package/src/ui/components/tab/tabList.tsx +34 -33
- package/src/ui/components/tab/tabPanel.tsx +25 -19
- package/src/ui/components/toast/toast.tsx +21 -16
- package/src/ui/components/toast/toastLayer.tsx +28 -10
- package/src/ui/components/toast/toastProvider.tsx +2 -6
- package/src/ui/components/toast/types.ts +2 -6
- package/src/ui/components/toast/useToast.ts +1 -3
- package/src/ui/components/tree/tree.tsx +194 -187
- package/src/ui/components/tree/treeGroup.tsx +25 -5
- package/src/ui/components/tree/treeItem.tsx +35 -23
- package/src/ui/hooks/useClickOutside.ts +2 -6
- package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
- package/src/ui/primitives/_selectable/selectable.tsx +33 -20
- package/src/ui/primitives/avatar/avatar.tsx +28 -31
- package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
- package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
- package/src/ui/primitives/avatar/types.ts +2 -0
- package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
- package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/ui/primitives/badge/badge.tsx +33 -32
- package/src/ui/primitives/badge/types.ts +2 -1
- package/src/ui/primitives/box/box.tsx +59 -29
- package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/ui/primitives/button/button.test.tsx +1 -15
- package/src/ui/primitives/button/button.tsx +64 -70
- package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
- package/src/ui/primitives/card/card.tsx +22 -22
- package/src/ui/primitives/card/cardProvider.tsx +2 -0
- package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
- package/src/ui/primitives/code/code.tsx +24 -22
- package/src/ui/primitives/container/container.tsx +26 -15
- package/src/ui/primitives/flex/flex.tsx +21 -19
- package/src/ui/primitives/grid/grid.tsx +21 -16
- package/src/ui/primitives/heading/heading.tsx +42 -19
- package/src/ui/primitives/inline/inline.tsx +26 -23
- package/src/ui/primitives/kbd/kbd.tsx +25 -23
- package/src/ui/primitives/label/label.tsx +41 -26
- package/src/ui/primitives/popover/popover.tsx +281 -277
- package/src/ui/primitives/popover/popoverCard.tsx +119 -118
- package/src/ui/primitives/radio/radio.tsx +30 -14
- package/src/ui/primitives/select/select.tsx +24 -16
- package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
- package/src/ui/primitives/spinner/spinner.tsx +24 -12
- package/src/ui/primitives/stack/stack.tsx +27 -18
- package/src/ui/primitives/switch/switch.tsx +31 -14
- package/src/ui/primitives/text/text.tsx +42 -24
- package/src/ui/primitives/textArea/textArea.tsx +33 -18
- package/src/ui/primitives/textInput/textInput.tsx +28 -40
- package/src/ui/primitives/tooltip/constants.ts +1 -1
- package/src/ui/primitives/tooltip/tooltip.tsx +76 -59
- package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
- package/src/ui/primitives/types.ts +1 -3
- package/src/ui/types/avatar.ts +3 -6
- package/src/ui/types/badge.ts +1 -3
- package/src/ui/types/button.ts +1 -3
- package/src/ui/types/card.ts +1 -3
- package/src/ui/types/dialog.ts +1 -3
- package/src/ui/types/props.ts +20 -10
- package/src/ui/utils/arrow/arrow.tsx +40 -14
- package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
- package/src/ui/utils/boundaryElement/types.ts +1 -3
- package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
- package/src/ui/utils/elementQuery/elementQuery.tsx +36 -14
- package/src/ui/utils/errorBoundary.tsx +2 -0
- package/src/ui/utils/index.ts +0 -1
- package/src/ui/utils/layer/layer.tsx +23 -93
- package/src/ui/utils/layer/layerCard.tsx +92 -0
- package/src/ui/utils/layer/layerProvider.tsx +2 -6
- package/src/ui/utils/layer/useLayer.ts +1 -3
- package/src/ui/utils/portal/portal.ts +2 -6
- package/src/ui/utils/portal/portalProvider.tsx +2 -6
- package/src/ui/utils/portal/types.ts +1 -3
- package/src/ui/utils/portal/usePortal.ts +1 -3
- package/src/ui/utils/srOnly/srOnly.tsx +25 -20
- package/src/ui/utils/virtualList/virtualList.tsx +36 -24
- package/src/css/compile/compileRule.ts +0 -97
- package/src/css/compile/compileRules.test.ts +0 -36
- package/src/css/compile/compileRules.ts +0 -43
- package/src/css/compile/compileSystem.ts +0 -7
- package/src/css/compile/types.ts +0 -6
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/ui/utils/conditionalWrapper/index.ts +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {BoxStyleProps} from '@sanity/ui/css'
|
|
2
|
-
import {ButtonStyleProps} from '@sanity/ui/css'
|
|
1
|
+
import type {BoxStyleProps} from '@sanity/ui/css'
|
|
2
|
+
import type {ButtonStyleProps} from '@sanity/ui/css'
|
|
3
3
|
import {CardStyleProps} from '@sanity/ui/css'
|
|
4
|
+
import type {ComponentClass} from 'react'
|
|
4
5
|
import type {ComponentProps} from 'react'
|
|
5
|
-
import {DisplayStyleProps} from '@sanity/ui/css'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import type {DisplayStyleProps} from '@sanity/ui/css'
|
|
7
|
+
import {ElementType as ElementType_2} from 'react'
|
|
8
|
+
import type {ExoticComponent} from 'react'
|
|
8
9
|
import {FlexStyleProps} from '@sanity/ui/css'
|
|
9
10
|
import {FontTextSize} from '@sanity/ui/theme'
|
|
10
11
|
import {ForwardedRef} from 'react'
|
|
11
|
-
import {
|
|
12
|
+
import type {FunctionComponent} from 'react'
|
|
12
13
|
import {GapStyleProps} from '@sanity/ui/css'
|
|
14
|
+
import {GridStyleProps} from '@sanity/ui/css'
|
|
15
|
+
import {HTMLAttributes} from 'react'
|
|
13
16
|
import {InputStyleProps} from '@sanity/ui/css'
|
|
14
|
-
import {InsetStyleProps} from '@sanity/ui/css'
|
|
15
|
-
import {
|
|
16
|
-
import {NamedExoticComponent} from 'react'
|
|
17
|
+
import type {InsetStyleProps} from '@sanity/ui/css'
|
|
18
|
+
import {JSX} from 'react'
|
|
17
19
|
import {PaddingStyleProps} from '@sanity/ui/css'
|
|
18
|
-
import {
|
|
19
|
-
import {PositionStyleProps} from '@sanity/ui/css'
|
|
20
|
-
import {Radius} from '@sanity/ui/theme'
|
|
20
|
+
import type {PositionStyleProps} from '@sanity/ui/css'
|
|
21
21
|
import {RadiusStyleProps} from '@sanity/ui/css'
|
|
22
22
|
import {ReactElement} from 'react'
|
|
23
23
|
import {ReactNode} from 'react'
|
|
24
24
|
import {ReactPortal} from 'react'
|
|
25
|
+
import {Ref} from 'react'
|
|
25
26
|
import {RefAttributes} from 'react'
|
|
26
|
-
import {RefCallback} from 'react'
|
|
27
27
|
import {ResponsiveProp} from '@sanity/ui/css'
|
|
28
28
|
import {RootTheme} from '@sanity/ui/theme'
|
|
29
29
|
import {ShadowStyleProps} from '@sanity/ui/css'
|
|
@@ -36,40 +36,75 @@ import {ThemeColorCardToneKey} from '@sanity/ui/theme'
|
|
|
36
36
|
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
37
37
|
import {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
38
38
|
import {ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
39
|
-
import {Width} from '@sanity/ui/css'
|
|
40
|
-
|
|
41
|
-
/** @public */
|
|
42
|
-
declare type Assign<T, U> = Omit<T, keyof U> & U
|
|
39
|
+
import type {Width} from '@sanity/ui/css'
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
46
|
-
* for flex, margins and padding.
|
|
42
|
+
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
47
43
|
*
|
|
48
44
|
* @public
|
|
49
45
|
*/
|
|
50
|
-
|
|
51
|
-
Omit<ElementProps<'div'> & PolymorphicProps, keyof BoxProps> &
|
|
52
|
-
BoxProps &
|
|
53
|
-
RefAttributes<HTMLDivElement>
|
|
54
|
-
>
|
|
46
|
+
declare type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U
|
|
55
47
|
|
|
56
48
|
/**
|
|
49
|
+
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
50
|
+
* for flex, margins and padding.
|
|
51
|
+
*
|
|
57
52
|
* @public
|
|
58
53
|
*/
|
|
59
|
-
export declare
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
InsetStyleProps,
|
|
63
|
-
PositionStyleProps {}
|
|
54
|
+
export declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(
|
|
55
|
+
props: BoxProps<E>,
|
|
56
|
+
): JSX.Element
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
export declare namespace Box {
|
|
59
|
+
var displayName: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** @public */
|
|
63
|
+
declare type BoxElementType =
|
|
64
|
+
| 'a'
|
|
65
|
+
| 'article'
|
|
66
|
+
| 'aside'
|
|
67
|
+
| 'blockquote'
|
|
68
|
+
| 'button'
|
|
69
|
+
| 'details'
|
|
70
|
+
| 'div'
|
|
71
|
+
| 'header'
|
|
72
|
+
| 'fieldset'
|
|
73
|
+
| 'figure'
|
|
74
|
+
| 'figcaption'
|
|
75
|
+
| 'footer'
|
|
76
|
+
| 'form'
|
|
77
|
+
| 'kbd'
|
|
78
|
+
| 'label'
|
|
79
|
+
| 'legend'
|
|
80
|
+
| 'li'
|
|
81
|
+
| 'main'
|
|
82
|
+
| 'nav'
|
|
83
|
+
| 'ol'
|
|
84
|
+
| 'pre'
|
|
85
|
+
| 'section'
|
|
86
|
+
| 'span'
|
|
87
|
+
| 'summary'
|
|
88
|
+
| 'ul'
|
|
89
|
+
| ComponentType
|
|
90
|
+
|
|
91
|
+
/** @public */
|
|
92
|
+
declare type BoxOwnProps = BoxStyleProps & GapStyleProps & InsetStyleProps & PositionStyleProps
|
|
93
|
+
|
|
94
|
+
/** @public */
|
|
95
|
+
export declare type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>
|
|
96
|
+
|
|
97
|
+
/** @public */
|
|
98
|
+
export declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(
|
|
99
|
+
props: ButtonProps<E>,
|
|
100
|
+
): JSX.Element
|
|
101
|
+
|
|
102
|
+
export declare namespace Button {
|
|
103
|
+
var displayName: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** @public */
|
|
107
|
+
declare type ButtonElementType = 'a' | 'button' | 'label' | ComponentType
|
|
73
108
|
|
|
74
109
|
/**
|
|
75
110
|
* @public
|
|
@@ -77,40 +112,41 @@ export declare const Button: ForwardRefExoticComponent<
|
|
|
77
112
|
*/
|
|
78
113
|
declare type ButtonMode = ThemeColorButtonModeKey
|
|
79
114
|
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
'type'?: 'button' | 'reset' | 'submit'
|
|
108
|
-
'width'?: ResponsiveProp<Width>
|
|
109
|
-
}
|
|
115
|
+
/** @public */
|
|
116
|
+
declare type ButtonOwnProps = ButtonStyleProps &
|
|
117
|
+
DisplayStyleProps &
|
|
118
|
+
GapStyleProps &
|
|
119
|
+
PaddingStyleProps & {
|
|
120
|
+
'align'?: FlexStyleProps['align']
|
|
121
|
+
'data-ui'?: string
|
|
122
|
+
'disabled'?: boolean
|
|
123
|
+
'fontSize'?: ResponsiveProp<FontTextSize>
|
|
124
|
+
'mode'?: ButtonMode
|
|
125
|
+
'icon'?: ElementType_2 | ReactNode
|
|
126
|
+
'iconRight'?: ElementType_2 | ReactNode
|
|
127
|
+
'justify'?: FlexStyleProps['justify']
|
|
128
|
+
/** @beta Do not use in production, as this might change.*/
|
|
129
|
+
'loading'?: boolean
|
|
130
|
+
'selected'?: boolean
|
|
131
|
+
/** @deprecated Use `gap` instead. */
|
|
132
|
+
'space'?: ResponsiveProp<Space>
|
|
133
|
+
'textAlign'?: ButtonTextAlign
|
|
134
|
+
'muted'?: boolean
|
|
135
|
+
'target'?: string
|
|
136
|
+
'text'?: ReactNode
|
|
137
|
+
'textOverflow'?: TextOwnProps['textOverflow']
|
|
138
|
+
'textWeight'?: TextOwnProps['weight']
|
|
139
|
+
'tone'?: ButtonTone
|
|
140
|
+
'width'?: ResponsiveProp<Width>
|
|
141
|
+
}
|
|
110
142
|
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
143
|
+
/** @public */
|
|
144
|
+
export declare type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<
|
|
145
|
+
ButtonOwnProps,
|
|
146
|
+
E
|
|
147
|
+
>
|
|
148
|
+
|
|
149
|
+
/** @public */
|
|
114
150
|
declare type ButtonTextAlign = 'left' | 'right' | 'center'
|
|
115
151
|
|
|
116
152
|
/**
|
|
@@ -125,16 +161,19 @@ declare type ButtonTone = ThemeColorStateToneKey
|
|
|
125
161
|
*
|
|
126
162
|
* @public
|
|
127
163
|
*/
|
|
128
|
-
export declare
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
RefAttributes<HTMLDivElement>
|
|
132
|
-
>
|
|
164
|
+
export declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(
|
|
165
|
+
props: CardProps<E>,
|
|
166
|
+
): JSX.Element
|
|
133
167
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
168
|
+
export declare namespace Card {
|
|
169
|
+
var displayName: string
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** @public */
|
|
173
|
+
declare type CardElementType = BoxElementType
|
|
174
|
+
|
|
175
|
+
/** @public */
|
|
176
|
+
declare interface CardOwnProps extends BoxOwnProps, CardStyleProps {
|
|
138
177
|
/**
|
|
139
178
|
* Do not use in production.
|
|
140
179
|
* @beta
|
|
@@ -146,15 +185,72 @@ export declare interface CardProps extends BoxProps, CardStyleProps {
|
|
|
146
185
|
*/
|
|
147
186
|
__unstable_focusRing?: boolean
|
|
148
187
|
disabled?: boolean
|
|
149
|
-
href?: string
|
|
150
188
|
pressed?: boolean
|
|
151
189
|
selected?: boolean
|
|
152
190
|
target?: string
|
|
153
191
|
}
|
|
154
192
|
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
/** @public */
|
|
194
|
+
export declare type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>
|
|
195
|
+
|
|
196
|
+
/** @public */
|
|
197
|
+
declare type ComponentType<P = any> = FunctionComponent<P> | ComponentClass<P> | ExoticComponent<P>
|
|
198
|
+
|
|
199
|
+
/** @public */
|
|
200
|
+
declare const DEFAULT_BOX_ELEMENT = 'div'
|
|
201
|
+
|
|
202
|
+
/** @public */
|
|
203
|
+
declare const DEFAULT_BUTTON_ELEMENT = 'button'
|
|
204
|
+
|
|
205
|
+
/** @public */
|
|
206
|
+
declare const DEFAULT_CARD_ELEMENT = 'div'
|
|
207
|
+
|
|
208
|
+
/** @public */
|
|
209
|
+
declare const DEFAULT_FLEX_ELEMENT = 'div'
|
|
210
|
+
|
|
211
|
+
/** @public */
|
|
212
|
+
declare const DEFAULT_GRID_ELEMENT = 'div'
|
|
213
|
+
|
|
214
|
+
/** @public */
|
|
215
|
+
declare const DEFAULT_HOTKEYS_ELEMENT = 'kbd'
|
|
216
|
+
|
|
217
|
+
/** @public */
|
|
218
|
+
declare const DEFAULT_MENU_DIVIDER_ELEMENT = 'hr'
|
|
219
|
+
|
|
220
|
+
/** @public */
|
|
221
|
+
declare const DEFAULT_MENU_ELEMENT = 'div'
|
|
222
|
+
|
|
223
|
+
/** @public */
|
|
224
|
+
declare const DEFAULT_MENU_GROUP_ELEMENT = 'button'
|
|
225
|
+
|
|
226
|
+
/** @public */
|
|
227
|
+
declare const DEFAULT_MENU_ITEM_ELEMENT = 'button'
|
|
228
|
+
|
|
229
|
+
/** @public */
|
|
230
|
+
declare const DEFAULT_POPOVER_ELEMENT = 'div'
|
|
231
|
+
|
|
232
|
+
/** @public */
|
|
233
|
+
declare const DEFAULT_SPINNER_ELEMENT = 'div'
|
|
234
|
+
|
|
235
|
+
/** @public */
|
|
236
|
+
declare const DEFAULT_STACK_ELEMENT = 'div'
|
|
237
|
+
|
|
238
|
+
/** @public */
|
|
239
|
+
declare const DEFAULT_TAB_ELEMENT = 'button'
|
|
240
|
+
|
|
241
|
+
/** @public */
|
|
242
|
+
declare const DEFAULT_TAB_LIST_ELEMENT = 'div'
|
|
243
|
+
|
|
244
|
+
/** @public */
|
|
245
|
+
declare const DEFAULT_TEXT_ELEMENT = 'div'
|
|
246
|
+
|
|
247
|
+
/** @public */
|
|
248
|
+
declare const DEFAULT_TEXT_INPUT_ELEMENT = 'input'
|
|
249
|
+
|
|
250
|
+
/** @public */
|
|
251
|
+
declare const DEFAULT_TOOLTIP_ELEMENT = 'div'
|
|
252
|
+
|
|
253
|
+
/** @public */
|
|
158
254
|
declare type Delay =
|
|
159
255
|
| number
|
|
160
256
|
| Partial<{
|
|
@@ -163,57 +259,73 @@ declare type Delay =
|
|
|
163
259
|
}>
|
|
164
260
|
|
|
165
261
|
/** @public */
|
|
166
|
-
declare type
|
|
262
|
+
declare type ElementType<P> = TagType | ComponentType<P>
|
|
263
|
+
|
|
264
|
+
/** @public */
|
|
265
|
+
declare type EmptyProps = {}
|
|
167
266
|
|
|
168
267
|
/**
|
|
169
268
|
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
170
269
|
*
|
|
171
270
|
* @public
|
|
172
271
|
*/
|
|
173
|
-
export declare
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
RefAttributes<HTMLDivElement>
|
|
177
|
-
>
|
|
272
|
+
export declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(
|
|
273
|
+
props: FlexProps<E>,
|
|
274
|
+
): JSX.Element
|
|
178
275
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
*/
|
|
182
|
-
export declare interface FlexProps extends Omit<BoxProps, 'display'> {
|
|
183
|
-
htmlFor?: string
|
|
276
|
+
export declare namespace Flex {
|
|
277
|
+
var displayName: string
|
|
184
278
|
}
|
|
185
279
|
|
|
280
|
+
/** @public */
|
|
281
|
+
declare type FlexElementType = BoxElementType
|
|
282
|
+
|
|
283
|
+
/** @public */
|
|
284
|
+
declare type FlexOwnProps = Omit<BoxOwnProps, 'display'>
|
|
285
|
+
|
|
286
|
+
/** @public */
|
|
287
|
+
export declare type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>
|
|
288
|
+
|
|
186
289
|
/**
|
|
187
290
|
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
188
291
|
*
|
|
189
292
|
* @public
|
|
190
293
|
*/
|
|
191
|
-
export declare
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
RefAttributes<HTMLDivElement>
|
|
195
|
-
>
|
|
294
|
+
export declare function Grid<E extends GridElementType = typeof DEFAULT_GRID_ELEMENT>(
|
|
295
|
+
props: GridProps<E>,
|
|
296
|
+
): JSX.Element
|
|
196
297
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
298
|
+
export declare namespace Grid {
|
|
299
|
+
var displayName: string
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** @public */
|
|
303
|
+
declare type GridElementType = BoxElementType
|
|
304
|
+
|
|
305
|
+
/** @public */
|
|
306
|
+
declare type GridOwnProps = Omit<BoxOwnProps, 'display'>
|
|
307
|
+
|
|
308
|
+
/** @public */
|
|
309
|
+
export declare type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>
|
|
201
310
|
|
|
202
311
|
/**
|
|
203
312
|
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
204
313
|
*
|
|
205
314
|
* @public
|
|
206
315
|
*/
|
|
207
|
-
export declare
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
RefAttributes<HTMLDivElement>
|
|
211
|
-
>
|
|
316
|
+
export declare function Hotkeys<E extends HotkeysElementType = typeof DEFAULT_HOTKEYS_ELEMENT>(
|
|
317
|
+
props: HotkeysProps<E>,
|
|
318
|
+
): JSX.Element | undefined
|
|
212
319
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
320
|
+
export declare namespace Hotkeys {
|
|
321
|
+
var displayName: string
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** @public */
|
|
325
|
+
declare type HotkeysElementType = 'kbd' | ComponentType
|
|
326
|
+
|
|
327
|
+
/** @public */
|
|
328
|
+
declare interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
|
|
217
329
|
fontSize?: ResponsiveProp<FontTextSize>
|
|
218
330
|
padding?: ResponsiveProp<Space>
|
|
219
331
|
/** @deprecated Use `gap` instead. */
|
|
@@ -221,10 +333,14 @@ export declare interface HotkeysProps extends GapStyleProps, RadiusStyleProps {
|
|
|
221
333
|
keys?: string[]
|
|
222
334
|
}
|
|
223
335
|
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
336
|
+
/** @public */
|
|
337
|
+
export declare type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<
|
|
338
|
+
HotkeysOwnProps,
|
|
339
|
+
E
|
|
340
|
+
>
|
|
341
|
+
|
|
342
|
+
/** @public */
|
|
343
|
+
declare type InlineOwnProps = Omit<BoxOwnProps, keyof FlexStyleProps | keyof GridStyleProps> & {
|
|
228
344
|
/** @deprecated Use `gap` instead. */
|
|
229
345
|
space?: ResponsiveProp<Space>
|
|
230
346
|
}
|
|
@@ -239,27 +355,21 @@ export declare function isHTMLAnchorElement(element: unknown): element is HTMLAn
|
|
|
239
355
|
*/
|
|
240
356
|
export declare function isHTMLElement(node: unknown): node is HTMLElement
|
|
241
357
|
|
|
242
|
-
/**
|
|
243
|
-
|
|
244
|
-
*/
|
|
245
|
-
declare interface LayerProps extends BoxProps {
|
|
358
|
+
/** @public */
|
|
359
|
+
declare type LayerOwnProps = CardOwnProps & {
|
|
246
360
|
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
247
361
|
onActivate?: (props: {activeElement: HTMLElement | null}) => void
|
|
248
362
|
zOffset?: number | number[]
|
|
249
363
|
}
|
|
250
364
|
|
|
251
|
-
/**
|
|
252
|
-
* @public
|
|
253
|
-
*/
|
|
365
|
+
/** @public */
|
|
254
366
|
export declare function LayerProvider(props: LayerProviderProps): ReactElement
|
|
255
367
|
|
|
256
368
|
export declare namespace LayerProvider {
|
|
257
369
|
var displayName: string
|
|
258
370
|
}
|
|
259
371
|
|
|
260
|
-
/**
|
|
261
|
-
* @public
|
|
262
|
-
*/
|
|
372
|
+
/** @public */
|
|
263
373
|
declare interface LayerProviderProps {
|
|
264
374
|
children?: ReactNode
|
|
265
375
|
zOffset?: number | number[]
|
|
@@ -270,42 +380,58 @@ declare interface LayerProviderProps {
|
|
|
270
380
|
*
|
|
271
381
|
* @public
|
|
272
382
|
*/
|
|
273
|
-
export declare
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
RefAttributes<HTMLDivElement>
|
|
277
|
-
>
|
|
383
|
+
export declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(
|
|
384
|
+
props: MenuProps<E>,
|
|
385
|
+
): JSX.Element
|
|
278
386
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
387
|
+
export declare namespace Menu {
|
|
388
|
+
var displayName: string
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** @public */
|
|
392
|
+
export declare function MenuDivider<
|
|
393
|
+
E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT,
|
|
394
|
+
>(props: MenuDividerProps<E>): JSX.Element
|
|
395
|
+
|
|
396
|
+
export declare namespace MenuDivider {
|
|
397
|
+
var displayName: string
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/** @public */
|
|
401
|
+
declare type MenuDividerElementType = 'div' | 'hr' | 'span' | ComponentType
|
|
402
|
+
|
|
403
|
+
/** @public */
|
|
404
|
+
declare type MenuDividerOwnProps = {}
|
|
405
|
+
|
|
406
|
+
/** @public */
|
|
407
|
+
declare type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> = Props<
|
|
408
|
+
MenuDividerOwnProps,
|
|
409
|
+
E
|
|
286
410
|
>
|
|
287
411
|
|
|
288
412
|
/** @public */
|
|
289
|
-
declare
|
|
413
|
+
declare type MenuElementType = 'div' | 'span' | ComponentType
|
|
290
414
|
|
|
291
|
-
/**
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
415
|
+
/** @public */
|
|
416
|
+
export declare function MenuGroup<
|
|
417
|
+
E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT,
|
|
418
|
+
>(props: MenuGroupProps<E>): JSX.Element
|
|
295
419
|
|
|
296
420
|
export declare namespace MenuGroup {
|
|
297
421
|
var displayName: string
|
|
298
422
|
}
|
|
299
423
|
|
|
300
|
-
/**
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
424
|
+
/** @public */
|
|
425
|
+
declare type MenuGroupElementType = 'button' | ComponentType
|
|
426
|
+
|
|
427
|
+
/** @public */
|
|
428
|
+
declare type MenuGroupOwnProps = RadiusStyleProps & {
|
|
304
429
|
disabled?: boolean
|
|
305
430
|
fontSize?: ResponsiveProp<FontTextSize>
|
|
306
|
-
|
|
431
|
+
gap?: ResponsiveProp<Space>
|
|
432
|
+
icon?: ElementType_2 | ReactNode
|
|
307
433
|
menu?: Omit<
|
|
308
|
-
MenuProps
|
|
434
|
+
MenuProps<typeof DEFAULT_MENU_ELEMENT>,
|
|
309
435
|
| 'onClickOutside'
|
|
310
436
|
| 'onEscape'
|
|
311
437
|
| 'onItemClick'
|
|
@@ -317,43 +443,55 @@ export declare interface MenuGroupProps extends GapStyleProps {
|
|
|
317
443
|
>
|
|
318
444
|
padding?: ResponsiveProp<Space>
|
|
319
445
|
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
320
|
-
radius?: Radius | Radius[]
|
|
321
446
|
/** @deprecated Use `gap` instead. */
|
|
322
447
|
space?: ResponsiveProp<Space>
|
|
323
|
-
text
|
|
324
|
-
tone?:
|
|
448
|
+
text?: ReactNode
|
|
449
|
+
tone?: ThemeColorStateToneKey
|
|
325
450
|
}
|
|
326
451
|
|
|
327
|
-
/**
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
Omit<ElementProps<'div'> & PolymorphicProps, keyof MenuItemProps> &
|
|
332
|
-
MenuItemProps &
|
|
333
|
-
RefAttributes<HTMLDivElement>
|
|
452
|
+
/** @public */
|
|
453
|
+
export declare type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<
|
|
454
|
+
MenuGroupOwnProps,
|
|
455
|
+
E
|
|
334
456
|
>
|
|
335
457
|
|
|
336
|
-
/**
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
icon?: ElementType | ReactNode
|
|
344
|
-
iconRight?: ElementType | ReactNode
|
|
345
|
-
pressed?: boolean
|
|
346
|
-
selected?: boolean
|
|
347
|
-
/** @deprecated Use `gap` instead. */
|
|
348
|
-
space?: ResponsiveProp<Space>
|
|
349
|
-
text?: ReactNode
|
|
350
|
-
tone?: SelectableTone
|
|
458
|
+
/** @public */
|
|
459
|
+
export declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(
|
|
460
|
+
props: MenuItemProps<E>,
|
|
461
|
+
): JSX.Element
|
|
462
|
+
|
|
463
|
+
export declare namespace MenuItem {
|
|
464
|
+
var displayName: string
|
|
351
465
|
}
|
|
352
466
|
|
|
353
|
-
/**
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
467
|
+
/** @public */
|
|
468
|
+
declare type MenuItemElementType = 'button' | 'a' | ComponentType
|
|
469
|
+
|
|
470
|
+
/** @public */
|
|
471
|
+
declare type MenuItemOwnProps = GapStyleProps &
|
|
472
|
+
PaddingStyleProps &
|
|
473
|
+
RadiusStyleProps & {
|
|
474
|
+
disabled?: boolean
|
|
475
|
+
fontSize?: number | number[]
|
|
476
|
+
hotkeys?: string[]
|
|
477
|
+
icon?: ElementType_2 | ReactNode
|
|
478
|
+
iconRight?: ElementType_2 | ReactNode
|
|
479
|
+
pressed?: boolean
|
|
480
|
+
selected?: boolean
|
|
481
|
+
/** @deprecated Use `gap` instead. */
|
|
482
|
+
space?: ResponsiveProp<Space>
|
|
483
|
+
text?: ReactNode
|
|
484
|
+
tone?: ThemeColorStateToneKey
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** @public */
|
|
488
|
+
export declare type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Omit<
|
|
489
|
+
Props<MenuItemOwnProps, E>,
|
|
490
|
+
'role'
|
|
491
|
+
>
|
|
492
|
+
|
|
493
|
+
/** @public */
|
|
494
|
+
declare type MenuOwnProps = PaddingStyleProps & {
|
|
357
495
|
/**
|
|
358
496
|
* @deprecated Use `shouldFocus="first"` instead.
|
|
359
497
|
*/
|
|
@@ -362,6 +500,7 @@ export declare interface MenuProps extends PaddingStyleProps, Pick<GapStyleProps
|
|
|
362
500
|
* @deprecated Use `shouldFocus="last"` instead.
|
|
363
501
|
*/
|
|
364
502
|
'focusLast'?: boolean
|
|
503
|
+
'gap'?: ResponsiveProp<Space>
|
|
365
504
|
'onClickOutside'?: (event: MouseEvent) => void
|
|
366
505
|
'onEscape'?: () => void
|
|
367
506
|
'onItemClick'?: () => void
|
|
@@ -374,6 +513,9 @@ export declare interface MenuProps extends PaddingStyleProps, Pick<GapStyleProps
|
|
|
374
513
|
'aria-labelledby'?: string
|
|
375
514
|
}
|
|
376
515
|
|
|
516
|
+
/** @public */
|
|
517
|
+
export declare type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>
|
|
518
|
+
|
|
377
519
|
/**
|
|
378
520
|
* Placement of floating UI elements.
|
|
379
521
|
*
|
|
@@ -393,20 +535,21 @@ declare type Placement =
|
|
|
393
535
|
| 'left-start'
|
|
394
536
|
| 'left-end'
|
|
395
537
|
|
|
396
|
-
declare interface PolymorphicProps_2 {
|
|
397
|
-
as?: ElementType
|
|
398
|
-
}
|
|
399
|
-
|
|
400
538
|
/**
|
|
401
539
|
* The `Popover` component is used to display some content on top of another.
|
|
402
540
|
*
|
|
403
541
|
* @public
|
|
404
542
|
*/
|
|
405
|
-
export declare
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
543
|
+
export declare function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_ELEMENT>(
|
|
544
|
+
props: PopoverProps<E>,
|
|
545
|
+
): JSX.Element
|
|
546
|
+
|
|
547
|
+
export declare namespace Popover {
|
|
548
|
+
var displayName: string
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/** @public */
|
|
552
|
+
declare type PopoverElementType = 'div' | ComponentType
|
|
410
553
|
|
|
411
554
|
/**
|
|
412
555
|
* @beta
|
|
@@ -414,7 +557,7 @@ export declare const Popover: NamedExoticComponent<
|
|
|
414
557
|
export declare type PopoverMargins = [number, number, number, number]
|
|
415
558
|
|
|
416
559
|
/** @public */
|
|
417
|
-
|
|
560
|
+
declare type PopoverOwnProps = LayerOwnProps & {
|
|
418
561
|
/** @beta */
|
|
419
562
|
__unstable_margins?: PopoverMargins
|
|
420
563
|
/**
|
|
@@ -474,26 +617,26 @@ export declare interface PopoverProps extends CardProps, LayerProps {
|
|
|
474
617
|
*/
|
|
475
618
|
referenceElement?: HTMLElement | null
|
|
476
619
|
/** @beta */
|
|
477
|
-
updateRef?:
|
|
478
|
-
| MutableRefObject<PopoverUpdateCallback | undefined>
|
|
479
|
-
| RefCallback<PopoverUpdateCallback | undefined>
|
|
620
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>
|
|
480
621
|
}
|
|
481
622
|
|
|
623
|
+
/** @public */
|
|
624
|
+
export declare type PopoverProps<E extends PopoverElementType = PopoverElementType> = Props<
|
|
625
|
+
PopoverOwnProps,
|
|
626
|
+
E
|
|
627
|
+
>
|
|
628
|
+
|
|
482
629
|
/** @beta */
|
|
483
630
|
declare type PopoverUpdateCallback = () => void
|
|
484
631
|
|
|
485
|
-
/**
|
|
486
|
-
* @public
|
|
487
|
-
*/
|
|
632
|
+
/** @public */
|
|
488
633
|
export declare function Portal(props: PortalProps): ReactPortal | null
|
|
489
634
|
|
|
490
635
|
export declare namespace Portal {
|
|
491
636
|
var displayName: string
|
|
492
637
|
}
|
|
493
638
|
|
|
494
|
-
/**
|
|
495
|
-
* @public
|
|
496
|
-
*/
|
|
639
|
+
/** @public */
|
|
497
640
|
export declare interface PortalProps {
|
|
498
641
|
children: ReactNode
|
|
499
642
|
/**
|
|
@@ -502,18 +645,14 @@ export declare interface PortalProps {
|
|
|
502
645
|
__unstable_name?: string
|
|
503
646
|
}
|
|
504
647
|
|
|
505
|
-
/**
|
|
506
|
-
* @public
|
|
507
|
-
*/
|
|
648
|
+
/** @public */
|
|
508
649
|
export declare function PortalProvider(props: PortalProviderProps): ReactElement
|
|
509
650
|
|
|
510
651
|
export declare namespace PortalProvider {
|
|
511
652
|
var displayName: string
|
|
512
653
|
}
|
|
513
654
|
|
|
514
|
-
/**
|
|
515
|
-
* @public
|
|
516
|
-
*/
|
|
655
|
+
/** @public */
|
|
517
656
|
export declare interface PortalProviderProps {
|
|
518
657
|
/**
|
|
519
658
|
* @deprecated Use `<BoundaryElementProvider element={...} />` instead
|
|
@@ -528,105 +667,124 @@ export declare interface PortalProviderProps {
|
|
|
528
667
|
}
|
|
529
668
|
|
|
530
669
|
/** @public */
|
|
531
|
-
declare type Props<P extends
|
|
532
|
-
|
|
533
|
-
P
|
|
670
|
+
declare type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<
|
|
671
|
+
E extends TagType ? JSX.IntrinsicElements[E] : ComponentProps<E>,
|
|
672
|
+
P & {
|
|
673
|
+
as?: E
|
|
674
|
+
}
|
|
534
675
|
>
|
|
535
676
|
|
|
536
|
-
/**
|
|
537
|
-
* @public
|
|
538
|
-
* @deprecated Use `ThemeColorStateToneKey` instead
|
|
539
|
-
*/
|
|
540
|
-
declare type SelectableTone = ThemeColorStateToneKey
|
|
541
|
-
|
|
542
677
|
/**
|
|
543
678
|
* Indicate that something is loading for an indeterminate amount of time.
|
|
544
679
|
*
|
|
545
680
|
* @public
|
|
546
681
|
*/
|
|
547
|
-
export declare
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
RefAttributes<HTMLDivElement>
|
|
551
|
-
>
|
|
682
|
+
export declare function Spinner<E extends SpinnerElementType = typeof DEFAULT_SPINNER_ELEMENT>(
|
|
683
|
+
props: SpinnerProps<E>,
|
|
684
|
+
): JSX.Element
|
|
552
685
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
686
|
+
export declare namespace Spinner {
|
|
687
|
+
var displayName: string
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/** @public */
|
|
691
|
+
declare type SpinnerElementType = 'div' | 'span' | ComponentType
|
|
692
|
+
|
|
693
|
+
/** @public */
|
|
694
|
+
declare type SpinnerOwnProps = {
|
|
557
695
|
muted?: boolean
|
|
558
696
|
size?: ResponsiveProp<FontTextSize>
|
|
559
697
|
}
|
|
560
698
|
|
|
699
|
+
/** @public */
|
|
700
|
+
export declare type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<
|
|
701
|
+
SpinnerOwnProps,
|
|
702
|
+
E
|
|
703
|
+
>
|
|
704
|
+
|
|
561
705
|
/**
|
|
562
706
|
* The `Stack` component is used to place elements on top of each other.
|
|
563
707
|
*
|
|
564
708
|
* @public
|
|
565
709
|
*/
|
|
566
|
-
export declare
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
RefAttributes<HTMLDivElement>
|
|
570
|
-
>
|
|
710
|
+
export declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(
|
|
711
|
+
props: StackProps<E>,
|
|
712
|
+
): JSX.Element
|
|
571
713
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
714
|
+
export declare namespace Stack {
|
|
715
|
+
var displayName: string
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/** @public */
|
|
719
|
+
declare type StackElementType = BoxElementType
|
|
720
|
+
|
|
721
|
+
/** @public */
|
|
722
|
+
declare type StackOwnProps = Omit<
|
|
723
|
+
BoxOwnProps,
|
|
724
|
+
'align' | 'columns' | 'direction' | 'display' | 'gapX' | 'gapY' | 'justify'
|
|
725
|
+
> & {
|
|
580
726
|
/** @deprecated Use `gap` instead. */
|
|
581
727
|
space?: ResponsiveProp<Space>
|
|
582
728
|
}
|
|
583
729
|
|
|
730
|
+
/** @public */
|
|
731
|
+
export declare type StackProps<E extends StackElementType = StackElementType> = Props<
|
|
732
|
+
StackOwnProps,
|
|
733
|
+
E
|
|
734
|
+
>
|
|
735
|
+
|
|
584
736
|
/**
|
|
585
737
|
* @public
|
|
586
738
|
* @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
|
|
587
739
|
*/
|
|
588
740
|
export declare const studioTheme: RootTheme
|
|
589
741
|
|
|
590
|
-
/**
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
Omit<ElementProps<'button'> & PolymorphicProps, keyof TabProps> &
|
|
595
|
-
TabProps &
|
|
596
|
-
RefAttributes<HTMLButtonElement>
|
|
597
|
-
>
|
|
742
|
+
/** @public */
|
|
743
|
+
export declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
|
|
744
|
+
props: TabProps<E>,
|
|
745
|
+
): JSX.Element
|
|
598
746
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
export declare const TabList: ForwardRefExoticComponent<
|
|
603
|
-
Omit<ElementProps<'div'> & PolymorphicProps, keyof TabListProps> &
|
|
604
|
-
TabListProps &
|
|
605
|
-
RefAttributes<HTMLDivElement>
|
|
606
|
-
>
|
|
747
|
+
export declare namespace Tab {
|
|
748
|
+
var displayName: string
|
|
749
|
+
}
|
|
607
750
|
|
|
608
|
-
/**
|
|
609
|
-
|
|
610
|
-
|
|
751
|
+
/** @public */
|
|
752
|
+
declare type TabElementType = 'button' | ComponentType
|
|
753
|
+
|
|
754
|
+
/** @public */
|
|
755
|
+
export declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(
|
|
756
|
+
props: TabListProps<E>,
|
|
757
|
+
): JSX.Element
|
|
758
|
+
|
|
759
|
+
export declare namespace TabList {
|
|
760
|
+
var displayName: string
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** @public */
|
|
611
764
|
declare type TabListChild = ReactElement<Props<TabProps, 'button'>> | null | undefined | false
|
|
612
765
|
|
|
613
|
-
/**
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
766
|
+
/** @public */
|
|
767
|
+
declare type TabListElementType = 'div' | 'span' | ComponentType
|
|
768
|
+
|
|
769
|
+
/** @public */
|
|
770
|
+
declare type TabListOwnProps = Omit<InlineOwnProps, 'as' | 'height'> & {
|
|
617
771
|
children: TabListChild[]
|
|
618
772
|
}
|
|
619
773
|
|
|
620
|
-
/**
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
774
|
+
/** @public */
|
|
775
|
+
export declare type TabListProps<E extends TabListElementType = TabListElementType> = Props<
|
|
776
|
+
TabListOwnProps,
|
|
777
|
+
E
|
|
778
|
+
>
|
|
779
|
+
|
|
780
|
+
/** @public */
|
|
781
|
+
declare type TabOwnProps = {
|
|
624
782
|
/**
|
|
625
783
|
* The `id` of the corresponding `TabPanel` component.
|
|
626
784
|
*/
|
|
627
785
|
'aria-controls': string
|
|
628
786
|
'id': string
|
|
629
|
-
'icon'?:
|
|
787
|
+
'icon'?: ElementType_2 | ReactNode
|
|
630
788
|
'focused'?: boolean
|
|
631
789
|
'fontSize'?: ResponsiveProp<FontTextSize>
|
|
632
790
|
'label'?: ReactNode
|
|
@@ -635,41 +793,65 @@ export declare interface TabProps {
|
|
|
635
793
|
'tone'?: ButtonTone
|
|
636
794
|
}
|
|
637
795
|
|
|
796
|
+
/** @public */
|
|
797
|
+
export declare type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>
|
|
798
|
+
|
|
799
|
+
/** @public */
|
|
800
|
+
declare type TagType = keyof JSX.IntrinsicElements
|
|
801
|
+
|
|
638
802
|
/**
|
|
639
803
|
* The `Text` component is an agile, themed typographic element.
|
|
640
804
|
*
|
|
641
805
|
* @public
|
|
642
806
|
*/
|
|
643
|
-
declare
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
807
|
+
declare function Text_2<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(
|
|
808
|
+
props: TextProps<E>,
|
|
809
|
+
): JSX.Element
|
|
810
|
+
|
|
811
|
+
declare namespace Text_2 {
|
|
812
|
+
var displayName: string
|
|
813
|
+
}
|
|
648
814
|
export {Text_2 as Text}
|
|
649
815
|
|
|
816
|
+
/** @public */
|
|
817
|
+
declare type TextElementType =
|
|
818
|
+
| 'div'
|
|
819
|
+
| 'h1'
|
|
820
|
+
| 'h2'
|
|
821
|
+
| 'h3'
|
|
822
|
+
| 'h4'
|
|
823
|
+
| 'h5'
|
|
824
|
+
| 'h6'
|
|
825
|
+
| 'label'
|
|
826
|
+
| 'li'
|
|
827
|
+
| 'p'
|
|
828
|
+
| 'span'
|
|
829
|
+
| ComponentType
|
|
830
|
+
|
|
650
831
|
/**
|
|
651
832
|
* Single line text input.
|
|
652
833
|
*
|
|
653
834
|
* @public
|
|
654
835
|
*/
|
|
655
|
-
export declare
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
RefAttributes<HTMLInputElement>
|
|
659
|
-
>
|
|
836
|
+
export declare function TextInput<
|
|
837
|
+
E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT,
|
|
838
|
+
>(props: TextInputProps<E>): JSX.Element
|
|
660
839
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
840
|
+
export declare namespace TextInput {
|
|
841
|
+
var displayName: string
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** @public */
|
|
664
845
|
declare type TextInputClearButtonProps = Omit<
|
|
665
|
-
|
|
846
|
+
ButtonProps<'button'>,
|
|
666
847
|
'as' | 'onClick' | 'onMouseDown'
|
|
667
848
|
>
|
|
668
849
|
|
|
669
|
-
/**
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
850
|
+
/** @public */
|
|
851
|
+
declare type TextInputElementType = 'input' | ComponentType
|
|
852
|
+
|
|
853
|
+
/** @public */
|
|
854
|
+
declare type TextInputOwnProps = InputStyleProps & {
|
|
673
855
|
/**
|
|
674
856
|
* @beta
|
|
675
857
|
*/
|
|
@@ -679,8 +861,8 @@ export declare interface TextInputProps extends InputStyleProps {
|
|
|
679
861
|
*/
|
|
680
862
|
clearButton?: boolean | TextInputClearButtonProps
|
|
681
863
|
customValidity?: string
|
|
682
|
-
icon?:
|
|
683
|
-
iconRight?:
|
|
864
|
+
icon?: ElementType_2 | ReactNode
|
|
865
|
+
iconRight?: ElementType_2 | ReactNode
|
|
684
866
|
/**
|
|
685
867
|
* @beta
|
|
686
868
|
*/
|
|
@@ -689,47 +871,29 @@ export declare interface TextInputProps extends InputStyleProps {
|
|
|
689
871
|
/** @deprecated Use `gap` instead. */
|
|
690
872
|
space?: ResponsiveProp<Space>
|
|
691
873
|
suffix?: ReactNode
|
|
692
|
-
type?: TextInputType
|
|
693
874
|
weight?: ThemeFontWeightKey
|
|
694
875
|
}
|
|
695
876
|
|
|
696
|
-
/**
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
| 'date'
|
|
702
|
-
| 'datetime-local'
|
|
703
|
-
| 'email'
|
|
704
|
-
| 'url'
|
|
705
|
-
| 'month'
|
|
706
|
-
| 'number'
|
|
707
|
-
| 'password'
|
|
708
|
-
| 'tel'
|
|
709
|
-
| 'time'
|
|
710
|
-
| 'text'
|
|
711
|
-
| 'week'
|
|
712
|
-
| 'color'
|
|
877
|
+
/** @public */
|
|
878
|
+
export declare type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<
|
|
879
|
+
TextInputOwnProps,
|
|
880
|
+
E
|
|
881
|
+
>
|
|
713
882
|
|
|
714
|
-
/**
|
|
715
|
-
|
|
716
|
-
*/
|
|
717
|
-
export declare interface TextProps extends TextStyleProps, TextOverflowStyleProps {
|
|
718
|
-
htmlFor?: string
|
|
719
|
-
}
|
|
883
|
+
/** @public */
|
|
884
|
+
declare type TextOwnProps = TextStyleProps & TextOverflowStyleProps
|
|
720
885
|
|
|
721
|
-
/**
|
|
722
|
-
|
|
723
|
-
|
|
886
|
+
/** @public */
|
|
887
|
+
export declare type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>
|
|
888
|
+
|
|
889
|
+
/** @public */
|
|
724
890
|
export declare function ThemeProvider(props: ThemeProviderProps): ReactElement
|
|
725
891
|
|
|
726
892
|
export declare namespace ThemeProvider {
|
|
727
893
|
var displayName: string
|
|
728
894
|
}
|
|
729
895
|
|
|
730
|
-
/**
|
|
731
|
-
* @public
|
|
732
|
-
*/
|
|
896
|
+
/** @public */
|
|
733
897
|
export declare interface ThemeProviderProps {
|
|
734
898
|
children?: ReactNode
|
|
735
899
|
scheme?: ThemeColorSchemeKey
|
|
@@ -742,52 +906,60 @@ export declare interface ThemeProviderProps {
|
|
|
742
906
|
*
|
|
743
907
|
* @public
|
|
744
908
|
*/
|
|
745
|
-
export declare
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
RefAttributes<HTMLDivElement>
|
|
749
|
-
>
|
|
909
|
+
export declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(
|
|
910
|
+
props: TooltipProps<E>,
|
|
911
|
+
): JSX.Element
|
|
750
912
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
*/
|
|
754
|
-
export declare interface TooltipProps
|
|
755
|
-
extends Omit<LayerProps, 'as'>,
|
|
756
|
-
RadiusStyleProps,
|
|
757
|
-
ShadowStyleProps {
|
|
758
|
-
/** @deprecated Use `fallbackPlacements` instead. */
|
|
759
|
-
allowedAutoPlacements?: Placement[]
|
|
760
|
-
/**
|
|
761
|
-
* Whether the tooltip should animate in and out.
|
|
762
|
-
*
|
|
763
|
-
* @beta
|
|
764
|
-
* @defaultValue false
|
|
765
|
-
*/
|
|
766
|
-
animate?: boolean
|
|
767
|
-
arrow?: boolean
|
|
768
|
-
boundaryElement?: HTMLElement | null
|
|
769
|
-
children?: ReactElement<Props>
|
|
770
|
-
content?: ReactNode
|
|
771
|
-
/**
|
|
772
|
-
* Adds a delay to open or close the tooltip.
|
|
773
|
-
*
|
|
774
|
-
* If only a `number` is passed, it will be used for both opening and closing.
|
|
775
|
-
*
|
|
776
|
-
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
777
|
-
*
|
|
778
|
-
* @public
|
|
779
|
-
* @defaultValue 0
|
|
780
|
-
*/
|
|
781
|
-
delay?: Delay
|
|
782
|
-
disabled?: boolean
|
|
783
|
-
fallbackPlacements?: Placement[]
|
|
784
|
-
placement?: Placement
|
|
785
|
-
/** Whether or not to render the tooltip in a portal element. */
|
|
786
|
-
portal?: boolean | string
|
|
787
|
-
scheme?: ThemeColorSchemeKey
|
|
788
|
-
tone?: ThemeColorCardToneKey
|
|
913
|
+
export declare namespace Tooltip {
|
|
914
|
+
var displayName: string
|
|
789
915
|
}
|
|
790
916
|
|
|
917
|
+
/** @public */
|
|
918
|
+
declare type TooltipElementType = 'div' | 'span' | ComponentType
|
|
919
|
+
|
|
920
|
+
/** @public */
|
|
921
|
+
declare type TooltipOwnProps = LayerOwnProps &
|
|
922
|
+
RadiusStyleProps &
|
|
923
|
+
ShadowStyleProps & {
|
|
924
|
+
/** @deprecated Use `fallbackPlacements` instead. */
|
|
925
|
+
allowedAutoPlacements?: Placement[]
|
|
926
|
+
/**
|
|
927
|
+
* Whether the tooltip should animate in and out.
|
|
928
|
+
*
|
|
929
|
+
* @beta
|
|
930
|
+
* @defaultValue false
|
|
931
|
+
*/
|
|
932
|
+
animate?: boolean
|
|
933
|
+
arrow?: boolean
|
|
934
|
+
boundaryElement?: HTMLElement | null
|
|
935
|
+
children?: ReactElement<HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>>
|
|
936
|
+
content?: ReactNode
|
|
937
|
+
/**
|
|
938
|
+
* Adds a delay to open or close the tooltip.
|
|
939
|
+
*
|
|
940
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
941
|
+
*
|
|
942
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
943
|
+
*
|
|
944
|
+
* @public
|
|
945
|
+
* @defaultValue 0
|
|
946
|
+
*/
|
|
947
|
+
delay?: Delay
|
|
948
|
+
disabled?: boolean
|
|
949
|
+
fallbackPlacements?: Placement[]
|
|
950
|
+
placement?: Placement
|
|
951
|
+
/** Whether or not to render the tooltip in a portal element. */
|
|
952
|
+
portal?: boolean | string
|
|
953
|
+
scheme?: ThemeColorSchemeKey
|
|
954
|
+
tone?: ThemeColorCardToneKey
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/** @public */
|
|
958
|
+
export declare type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<
|
|
959
|
+
TooltipOwnProps,
|
|
960
|
+
E
|
|
961
|
+
>
|
|
962
|
+
|
|
791
963
|
/**
|
|
792
964
|
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
793
965
|
*
|
|
@@ -801,9 +973,7 @@ export declare interface TooltipProps
|
|
|
801
973
|
*/
|
|
802
974
|
export declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean
|
|
803
975
|
|
|
804
|
-
/**
|
|
805
|
-
* @public
|
|
806
|
-
*/
|
|
976
|
+
/** @public */
|
|
807
977
|
export declare function useTheme_v2(): Theme_v2
|
|
808
978
|
|
|
809
979
|
export {}
|