@sanity/ui 3.0.0-static.10 → 3.0.0-static.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +1300 -1269
- 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 +1298 -1263
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +516 -360
- package/dist/_visual-editing.d.ts +516 -360
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +258 -75
- package/dist/css.d.ts +258 -75
- package/dist/css.js +746 -752
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +748 -754
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1342 -871
- package/dist/index.d.ts +1342 -871
- package/dist/index.js +433 -325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +429 -321
- 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 -21710
- 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 +19 -20
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +19 -20
- 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/_resp.ts +0 -1
- 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/font.style.ts +7 -66
- 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.style.ts +16 -41
- 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/compilePalette.ts +32 -0
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/compileTheme_v3.ts +434 -0
- 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.style.ts +8 -4
- 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 +11 -0
- package/src/css/index.ts +4 -3
- package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
- package/src/css/primitives/_arrow/_arrow.ts +7 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +24 -25
- 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.style.ts +48 -15
- 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 +4 -7
- 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/token/token.style.ts +37 -36
- package/src/css/primitives/tooltip/tooltip.ts +2 -0
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +115 -15
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +1 -0
- package/src/css/varNames.ts +230 -143
- package/src/css/vars.ts +53 -22
- 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 +2 -1
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/{defaults.ts → defaultTokens.ts} +2 -2
- package/src/theme/v3/index.ts +1 -1
- package/src/theme/v3/resolveTokens.ts +18 -18
- package/src/ui/RootClassNames.tsx +44 -0
- package/src/ui/StyleTags.tsx +3 -1
- package/src/ui/_compat/helpers.ts +72 -0
- package/src/ui/_compat/index.ts +2 -6
- package/src/ui/_compat/studioTheme.ts +7 -0
- 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/_compat/types.ts +0 -83
- 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/index.ts +1 -0
- 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 +63 -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 +29 -26
- package/src/ui/primitives/popover/popover.tsx +293 -271
- package/src/ui/primitives/popover/popoverCard.tsx +122 -120
- 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 +30 -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 +85 -61
- 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 +43 -25
- 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 +43 -19
- 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 +69 -50
- package/src/css/compile/compilePalette.ts +0 -27
- 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 -10
- package/src/css/compile/compileTheme_v3.ts +0 -401
- package/src/css/compile/types.ts +0 -6
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -78
- package/src/css/components/skeleton/rules.ts +0 -113
- package/src/css/components/toast/rules.ts +0 -18
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/spinner/rules.ts +0 -21
- package/src/css/primitives/token/rules.ts +0 -45
- 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,107 +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
|
-
export declare const studioTheme:
|
|
589
|
-
|
|
740
|
+
export declare const studioTheme: RootTheme
|
|
741
|
+
|
|
742
|
+
/** @public */
|
|
743
|
+
export declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
|
|
744
|
+
props: TabProps<E>,
|
|
745
|
+
): JSX.Element
|
|
746
|
+
|
|
747
|
+
export declare namespace Tab {
|
|
748
|
+
var displayName: string
|
|
590
749
|
}
|
|
591
750
|
|
|
592
|
-
/**
|
|
593
|
-
|
|
594
|
-
*/
|
|
595
|
-
export declare const Tab: ForwardRefExoticComponent<
|
|
596
|
-
Omit<ElementProps<'button'> & PolymorphicProps, keyof TabProps> &
|
|
597
|
-
TabProps &
|
|
598
|
-
RefAttributes<HTMLButtonElement>
|
|
599
|
-
>
|
|
751
|
+
/** @public */
|
|
752
|
+
declare type TabElementType = 'button' | ComponentType
|
|
600
753
|
|
|
601
|
-
/**
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
Omit<ElementProps<'div'> & PolymorphicProps, keyof TabListProps> &
|
|
606
|
-
TabListProps &
|
|
607
|
-
RefAttributes<HTMLDivElement>
|
|
608
|
-
>
|
|
754
|
+
/** @public */
|
|
755
|
+
export declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(
|
|
756
|
+
props: TabListProps<E>,
|
|
757
|
+
): JSX.Element
|
|
609
758
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
759
|
+
export declare namespace TabList {
|
|
760
|
+
var displayName: string
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** @public */
|
|
613
764
|
declare type TabListChild = ReactElement<Props<TabProps, 'button'>> | null | undefined | false
|
|
614
765
|
|
|
615
|
-
/**
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
766
|
+
/** @public */
|
|
767
|
+
declare type TabListElementType = 'div' | 'span' | ComponentType
|
|
768
|
+
|
|
769
|
+
/** @public */
|
|
770
|
+
declare type TabListOwnProps = Omit<InlineOwnProps, 'as' | 'height'> & {
|
|
619
771
|
children: TabListChild[]
|
|
620
772
|
}
|
|
621
773
|
|
|
622
|
-
/**
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
774
|
+
/** @public */
|
|
775
|
+
export declare type TabListProps<E extends TabListElementType = TabListElementType> = Props<
|
|
776
|
+
TabListOwnProps,
|
|
777
|
+
E
|
|
778
|
+
>
|
|
779
|
+
|
|
780
|
+
/** @public */
|
|
781
|
+
declare type TabOwnProps = {
|
|
626
782
|
/**
|
|
627
783
|
* The `id` of the corresponding `TabPanel` component.
|
|
628
784
|
*/
|
|
629
785
|
'aria-controls': string
|
|
630
786
|
'id': string
|
|
631
|
-
'icon'?:
|
|
787
|
+
'icon'?: ElementType_2 | ReactNode
|
|
632
788
|
'focused'?: boolean
|
|
633
789
|
'fontSize'?: ResponsiveProp<FontTextSize>
|
|
634
790
|
'label'?: ReactNode
|
|
@@ -637,41 +793,53 @@ export declare interface TabProps {
|
|
|
637
793
|
'tone'?: ButtonTone
|
|
638
794
|
}
|
|
639
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
|
+
|
|
640
802
|
/**
|
|
641
803
|
* The `Text` component is an agile, themed typographic element.
|
|
642
804
|
*
|
|
643
805
|
* @public
|
|
644
806
|
*/
|
|
645
|
-
declare
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
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
|
+
}
|
|
650
814
|
export {Text_2 as Text}
|
|
651
815
|
|
|
816
|
+
/** @public */
|
|
817
|
+
declare type TextElementType = 'div' | 'label' | 'li' | 'span' | ComponentType
|
|
818
|
+
|
|
652
819
|
/**
|
|
653
820
|
* Single line text input.
|
|
654
821
|
*
|
|
655
822
|
* @public
|
|
656
823
|
*/
|
|
657
|
-
export declare
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
RefAttributes<HTMLInputElement>
|
|
661
|
-
>
|
|
824
|
+
export declare function TextInput<
|
|
825
|
+
E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT,
|
|
826
|
+
>(props: TextInputProps<E>): JSX.Element
|
|
662
827
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
828
|
+
export declare namespace TextInput {
|
|
829
|
+
var displayName: string
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/** @public */
|
|
666
833
|
declare type TextInputClearButtonProps = Omit<
|
|
667
|
-
|
|
834
|
+
ButtonProps<'button'>,
|
|
668
835
|
'as' | 'onClick' | 'onMouseDown'
|
|
669
836
|
>
|
|
670
837
|
|
|
671
|
-
/**
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
838
|
+
/** @public */
|
|
839
|
+
declare type TextInputElementType = 'input' | ComponentType
|
|
840
|
+
|
|
841
|
+
/** @public */
|
|
842
|
+
declare type TextInputOwnProps = InputStyleProps & {
|
|
675
843
|
/**
|
|
676
844
|
* @beta
|
|
677
845
|
*/
|
|
@@ -681,8 +849,8 @@ export declare interface TextInputProps extends InputStyleProps {
|
|
|
681
849
|
*/
|
|
682
850
|
clearButton?: boolean | TextInputClearButtonProps
|
|
683
851
|
customValidity?: string
|
|
684
|
-
icon?:
|
|
685
|
-
iconRight?:
|
|
852
|
+
icon?: ElementType_2 | ReactNode
|
|
853
|
+
iconRight?: ElementType_2 | ReactNode
|
|
686
854
|
/**
|
|
687
855
|
* @beta
|
|
688
856
|
*/
|
|
@@ -691,47 +859,29 @@ export declare interface TextInputProps extends InputStyleProps {
|
|
|
691
859
|
/** @deprecated Use `gap` instead. */
|
|
692
860
|
space?: ResponsiveProp<Space>
|
|
693
861
|
suffix?: ReactNode
|
|
694
|
-
type?: TextInputType
|
|
695
862
|
weight?: ThemeFontWeightKey
|
|
696
863
|
}
|
|
697
864
|
|
|
698
|
-
/**
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
| 'date'
|
|
704
|
-
| 'datetime-local'
|
|
705
|
-
| 'email'
|
|
706
|
-
| 'url'
|
|
707
|
-
| 'month'
|
|
708
|
-
| 'number'
|
|
709
|
-
| 'password'
|
|
710
|
-
| 'tel'
|
|
711
|
-
| 'time'
|
|
712
|
-
| 'text'
|
|
713
|
-
| 'week'
|
|
714
|
-
| 'color'
|
|
865
|
+
/** @public */
|
|
866
|
+
export declare type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<
|
|
867
|
+
TextInputOwnProps,
|
|
868
|
+
E
|
|
869
|
+
>
|
|
715
870
|
|
|
716
|
-
/**
|
|
717
|
-
|
|
718
|
-
*/
|
|
719
|
-
export declare interface TextProps extends TextStyleProps, TextOverflowStyleProps {
|
|
720
|
-
htmlFor?: string
|
|
721
|
-
}
|
|
871
|
+
/** @public */
|
|
872
|
+
declare type TextOwnProps = TextStyleProps & TextOverflowStyleProps
|
|
722
873
|
|
|
723
|
-
/**
|
|
724
|
-
|
|
725
|
-
|
|
874
|
+
/** @public */
|
|
875
|
+
export declare type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>
|
|
876
|
+
|
|
877
|
+
/** @public */
|
|
726
878
|
export declare function ThemeProvider(props: ThemeProviderProps): ReactElement
|
|
727
879
|
|
|
728
880
|
export declare namespace ThemeProvider {
|
|
729
881
|
var displayName: string
|
|
730
882
|
}
|
|
731
883
|
|
|
732
|
-
/**
|
|
733
|
-
* @public
|
|
734
|
-
*/
|
|
884
|
+
/** @public */
|
|
735
885
|
export declare interface ThemeProviderProps {
|
|
736
886
|
children?: ReactNode
|
|
737
887
|
scheme?: ThemeColorSchemeKey
|
|
@@ -744,52 +894,60 @@ export declare interface ThemeProviderProps {
|
|
|
744
894
|
*
|
|
745
895
|
* @public
|
|
746
896
|
*/
|
|
747
|
-
export declare
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
RefAttributes<HTMLDivElement>
|
|
751
|
-
>
|
|
897
|
+
export declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(
|
|
898
|
+
props: TooltipProps<E>,
|
|
899
|
+
): JSX.Element
|
|
752
900
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
*/
|
|
756
|
-
export declare interface TooltipProps
|
|
757
|
-
extends Omit<LayerProps, 'as'>,
|
|
758
|
-
RadiusStyleProps,
|
|
759
|
-
ShadowStyleProps {
|
|
760
|
-
/** @deprecated Use `fallbackPlacements` instead. */
|
|
761
|
-
allowedAutoPlacements?: Placement[]
|
|
762
|
-
/**
|
|
763
|
-
* Whether the tooltip should animate in and out.
|
|
764
|
-
*
|
|
765
|
-
* @beta
|
|
766
|
-
* @defaultValue false
|
|
767
|
-
*/
|
|
768
|
-
animate?: boolean
|
|
769
|
-
arrow?: boolean
|
|
770
|
-
boundaryElement?: HTMLElement | null
|
|
771
|
-
children?: ReactElement<Props>
|
|
772
|
-
content?: ReactNode
|
|
773
|
-
/**
|
|
774
|
-
* Adds a delay to open or close the tooltip.
|
|
775
|
-
*
|
|
776
|
-
* If only a `number` is passed, it will be used for both opening and closing.
|
|
777
|
-
*
|
|
778
|
-
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
779
|
-
*
|
|
780
|
-
* @public
|
|
781
|
-
* @defaultValue 0
|
|
782
|
-
*/
|
|
783
|
-
delay?: Delay
|
|
784
|
-
disabled?: boolean
|
|
785
|
-
fallbackPlacements?: Placement[]
|
|
786
|
-
placement?: Placement
|
|
787
|
-
/** Whether or not to render the tooltip in a portal element. */
|
|
788
|
-
portal?: boolean | string
|
|
789
|
-
scheme?: ThemeColorSchemeKey
|
|
790
|
-
tone?: ThemeColorCardToneKey
|
|
901
|
+
export declare namespace Tooltip {
|
|
902
|
+
var displayName: string
|
|
791
903
|
}
|
|
792
904
|
|
|
905
|
+
/** @public */
|
|
906
|
+
declare type TooltipElementType = 'div' | 'span' | ComponentType
|
|
907
|
+
|
|
908
|
+
/** @public */
|
|
909
|
+
declare type TooltipOwnProps = LayerOwnProps &
|
|
910
|
+
RadiusStyleProps &
|
|
911
|
+
ShadowStyleProps & {
|
|
912
|
+
/** @deprecated Use `fallbackPlacements` instead. */
|
|
913
|
+
allowedAutoPlacements?: Placement[]
|
|
914
|
+
/**
|
|
915
|
+
* Whether the tooltip should animate in and out.
|
|
916
|
+
*
|
|
917
|
+
* @beta
|
|
918
|
+
* @defaultValue false
|
|
919
|
+
*/
|
|
920
|
+
animate?: boolean
|
|
921
|
+
arrow?: boolean
|
|
922
|
+
boundaryElement?: HTMLElement | null
|
|
923
|
+
children?: ReactElement<HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>>
|
|
924
|
+
content?: ReactNode
|
|
925
|
+
/**
|
|
926
|
+
* Adds a delay to open or close the tooltip.
|
|
927
|
+
*
|
|
928
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
929
|
+
*
|
|
930
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
931
|
+
*
|
|
932
|
+
* @public
|
|
933
|
+
* @defaultValue 0
|
|
934
|
+
*/
|
|
935
|
+
delay?: Delay
|
|
936
|
+
disabled?: boolean
|
|
937
|
+
fallbackPlacements?: Placement[]
|
|
938
|
+
placement?: Placement
|
|
939
|
+
/** Whether or not to render the tooltip in a portal element. */
|
|
940
|
+
portal?: boolean | string
|
|
941
|
+
scheme?: ThemeColorSchemeKey
|
|
942
|
+
tone?: ThemeColorCardToneKey
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/** @public */
|
|
946
|
+
export declare type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<
|
|
947
|
+
TooltipOwnProps,
|
|
948
|
+
E
|
|
949
|
+
>
|
|
950
|
+
|
|
793
951
|
/**
|
|
794
952
|
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
795
953
|
*
|
|
@@ -803,9 +961,7 @@ export declare interface TooltipProps
|
|
|
803
961
|
*/
|
|
804
962
|
export declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean
|
|
805
963
|
|
|
806
|
-
/**
|
|
807
|
-
* @public
|
|
808
|
-
*/
|
|
964
|
+
/** @public */
|
|
809
965
|
export declare function useTheme_v2(): Theme_v2
|
|
810
966
|
|
|
811
967
|
export {}
|