@sanity/ui 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_visual-editing.d.mts +2 -1126
- package/dist/_visual-editing.d.ts +2 -1126
- package/dist/_visual-editing.js +3 -31
- package/dist/_visual-editing.mjs +2 -31
- package/dist/index.d.mts +555 -2769
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +555 -2769
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2982 -1934
- package/dist/index.mjs +2950 -1903
- package/dist/index.mjs.map +1 -1
- package/dist/refractor.js +16 -0
- package/dist/refractor.mjs +21 -0
- package/dist/refractor.mjs.map +1 -0
- package/dist/tabList.js +3804 -0
- package/dist/tabList.mjs +3355 -0
- package/dist/tabList.mjs.map +1 -0
- package/dist/theme.d.mts +927 -1227
- package/dist/theme.d.mts.map +1 -0
- package/dist/theme.d.ts +927 -1227
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +3 -4127
- package/dist/theme.mjs +2 -4127
- package/dist/theme2.d.mts +2 -0
- package/dist/theme2.d.ts +2 -0
- package/dist/theme2.js +4104 -0
- package/dist/theme2.mjs +3851 -0
- package/dist/theme2.mjs.map +1 -0
- package/dist/useTheme.d.mts +1451 -0
- package/dist/useTheme.d.mts.map +1 -0
- package/dist/useTheme.d.ts +1451 -0
- package/dist/useTheme.d.ts.map +1 -0
- package/exports/_visual-editing.ts +1 -0
- package/package.json +49 -102
- package/src/core/_compat.ts +30 -0
- package/src/core/components/autocomplete/autocomplete.tsx +8 -0
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +8 -5
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +3 -0
- package/src/core/components/dialog/dialog.tsx +5 -2
- package/src/core/components/hotkeys/hotkeys.test.tsx +10 -5
- package/src/core/components/hotkeys/hotkeys.tsx +2 -0
- package/src/core/components/menu/menu.spacing.test.tsx +12 -7
- package/src/core/components/menu/menu.test.tsx +9 -6
- package/src/core/components/menu/menu.tsx +4 -2
- package/src/core/components/menu/menuButton.tsx +8 -0
- package/src/core/components/menu/menuDivider.ts +1 -0
- package/src/core/components/menu/menuGroup.spacing.test.tsx +9 -6
- package/src/core/components/menu/menuGroup.tsx +6 -2
- package/src/core/components/menu/menuItem.spacing.test.tsx +8 -5
- package/src/core/components/menu/menuItem.tsx +4 -0
- package/src/core/components/menu/useMenuController.ts +2 -0
- package/src/core/components/skeleton/skeleton.tsx +1 -0
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.test.tsx +7 -5
- package/src/core/components/tab/tabList.tsx +1 -0
- package/src/core/components/toast/toast.test.tsx +9 -4
- package/src/core/components/toast/toast.tsx +1 -0
- package/src/core/components/toast/toastLayer.tsx +1 -0
- package/src/core/components/tree/tree.test.tsx +10 -5
- package/src/core/components/tree/tree.tsx +2 -0
- package/src/core/components/tree/treeGroup.tsx +1 -0
- package/src/core/components/tree/treeItem.test.tsx +10 -5
- package/src/core/components/tree/treeItem.tsx +1 -0
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useClickOutside.test.tsx +43 -15
- package/src/core/hooks/useClickOutside.ts +1 -1
- package/src/core/hooks/useClickOutsideEvent.test.tsx +8 -4
- package/src/core/hooks/useDelayed.test.ts +9 -8
- package/src/core/hooks/useElementRect/useElementRect.ts +1 -0
- package/src/core/hooks/useForwardedRef.ts +1 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersDark.test.tsx +3 -1
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +3 -1
- package/src/core/lib/createGlobalScopedContext.ts +1 -0
- package/src/core/lib/globalScope.ts +1 -0
- package/src/core/observers/elementSizeObserver.ts +1 -0
- package/src/core/primitives/avatar/avatar.tsx +2 -2
- package/src/core/primitives/avatar/avatarStack.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +3 -2
- package/src/core/primitives/badge/badge.tsx +3 -1
- package/src/core/primitives/box/box.test.tsx +18 -5
- package/src/core/primitives/box/box.tsx +9 -1
- package/src/core/primitives/button/button.test.tsx +10 -6
- package/src/core/primitives/button/button.tsx +4 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/card.tsx +2 -5
- package/src/core/primitives/card/types.ts +1 -0
- package/src/core/primitives/code/code.tsx +1 -0
- package/src/core/primitives/code/refractor.tsx +2 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +2 -3
- package/src/core/primitives/grid/grid.test.tsx +11 -5
- package/src/core/primitives/grid/grid.tsx +3 -0
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/inline/inline.test.tsx +9 -5
- package/src/core/primitives/inline/inline.tsx +3 -0
- package/src/core/primitives/kbd/kbd.tsx +5 -1
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/popover/popover.tsx +5 -4
- package/src/core/primitives/popover/popoverCard.tsx +1 -0
- package/src/core/primitives/popover/types.ts +0 -1
- package/src/core/primitives/select/select.test.tsx +9 -5
- package/src/core/primitives/select/select.tsx +1 -0
- package/src/core/primitives/stack/stack.test.tsx +9 -5
- package/src/core/primitives/stack/stack.tsx +2 -0
- package/src/core/primitives/stack/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textInput/textInput.test.tsx +9 -5
- package/src/core/primitives/textInput/textInput.tsx +3 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +82 -49
- package/src/core/primitives/tooltip/tooltip.tsx +3 -1
- package/src/core/primitives/tooltip/tooltipCard.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +2 -0
- package/src/core/styles/flex/types.ts +0 -1
- package/src/core/styles/font/responsiveFont.ts +0 -3
- package/src/core/styles/font/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +1 -0
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/theme/theme.test.tsx +7 -3
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +2 -0
- package/src/core/utils/arrow/arrow.tsx +1 -0
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +9 -4
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +1 -0
- package/src/core/utils/getElementRef.ts +5 -0
- package/src/core/utils/layer/getLayerContext.test.ts +2 -0
- package/src/core/utils/layer/layer.test.tsx +9 -4
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/useLayer.ts +2 -0
- package/src/core/utils/portal/portal.test.tsx +9 -4
- package/src/core/utils/portal/portalProvider.tsx +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +2 -1
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +10 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +4 -0
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +5 -0
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +5 -0
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +6 -0
- package/src/theme/build/_deprecated/color/color.test.ts +5 -1
- package/src/theme/build/_deprecated/color/defaults.ts +1 -0
- package/src/theme/build/_deprecated/color/factory.ts +36 -0
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +5 -0
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +4 -0
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +3 -0
- package/src/theme/build/buildColorTheme.test.ts +2 -0
- package/src/theme/build/buildColorTheme.ts +8 -0
- package/src/theme/build/buildTheme.test.ts +2 -0
- package/src/theme/build/lib/color-fns/color-fns.test.ts +3 -1
- package/src/theme/build/merge.ts +5 -0
- package/src/theme/build/mixThemeColor.test.ts +2 -0
- package/src/theme/build/renderColorTheme.ts +6 -0
- package/src/theme/build/renderColorValue.ts +0 -2
- package/src/theme/build/resolveColorTokens.ts +6 -0
- package/src/theme/build/theme.test.ts +2 -0
- package/src/theme/config/helpers.ts +5 -0
- package/src/theme/config/system.ts +2 -0
- package/src/theme/config/tokens/color/types.ts +6 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.ts +1 -0
- package/src/theme/getScopedTheme.ts +6 -1
- package/src/theme/system/color/_helpers.ts +4 -0
- package/src/theme/system/theme.ts +4 -0
- package/src/theme/system/v0/color/_system.ts +1 -0
- package/src/theme/system/v0/color/button.ts +14 -0
- package/src/theme/system/v0/color/card.ts +6 -0
- package/src/theme/system/v0/color/color.ts +11 -0
- package/src/theme/system/v0/color/input.ts +6 -0
- package/src/theme/system/v0/color/muted.ts +11 -0
- package/src/theme/system/v0/color/selectable.ts +11 -0
- package/src/theme/system/v0/color/solid.ts +11 -0
- package/src/theme/system/v0/color/spot.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +15 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +7 -0
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -0
- package/src/theme/versioning/v0_v2.ts +13 -1
- package/src/theme/versioning/v2_v0.ts +18 -0
- package/dist/_chunks-cjs/_visual-editing.js +0 -5899
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js +0 -23
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs +0 -5905
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs +0 -26
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_visual-editing.js.map +0 -1
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/theme.mjs.map +0 -1
- package/src/core/__workshop__/constants.ts +0 -293
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -19
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -75
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -89
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/components/skeleton/__workshop__/index.ts +0 -11
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -14
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -19
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -21
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
- package/src/core/primitives/badge/__workshop__/index.ts +0 -19
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
- package/src/core/primitives/box/__workshop__/index.ts +0 -24
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/core/primitives/button/__workshop__/index.ts +0 -59
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -18
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/core/primitives/card/__workshop__/props.tsx +0 -53
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/core/primitives/code/__workshop__/index.ts +0 -19
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/code/__workshop__/props.tsx +0 -21
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -8
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -11
- package/src/core/primitives/grid/__workshop__/index.ts +0 -10
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/index.ts +0 -19
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/inline/__workshop__/index.ts +0 -8
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/label/__workshop__/index.ts +0 -19
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/core/primitives/popover/__workshop__/index.ts +0 -49
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -11
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/select/__workshop__/index.ts +0 -11
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -11
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
- package/src/core/primitives/text/__workshop__/example.tsx +0 -39
- package/src/core/primitives/text/__workshop__/index.ts +0 -24
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/theme/__workshop__/build/Root.tsx +0 -367
- package/src/core/theme/__workshop__/build/helpers.ts +0 -46
- package/src/core/theme/__workshop__/build/story.tsx +0 -465
- package/src/core/theme/__workshop__/canvas.tsx +0 -352
- package/src/core/theme/__workshop__/color.tsx +0 -62
- package/src/core/theme/__workshop__/debug/story.tsx +0 -408
- package/src/core/theme/__workshop__/index.ts +0 -39
- package/src/core/theme/__workshop__/layer.tsx +0 -78
- package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
- package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/utils/layer/__workshop__/index.ts +0 -24
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/core/utils/portal/__workshop__/index.ts +0 -14
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
package/dist/theme.d.mts
CHANGED
|
@@ -1,1506 +1,1206 @@
|
|
|
1
|
-
import {ColorHueKey} from
|
|
2
|
-
import
|
|
3
|
-
import {ColorTintKey} from '@sanity/color'
|
|
4
|
-
import type * as CSS_2 from 'csstype'
|
|
5
|
-
|
|
1
|
+
import { ColorHueKey, ColorTint, ColorTintKey } from "@sanity/color";
|
|
2
|
+
import * as CSS from "csstype";
|
|
6
3
|
/**
|
|
7
4
|
* @public
|
|
8
5
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
* @deprecated Use `v2.color` instead
|
|
23
|
-
*/
|
|
24
|
-
color: ThemeColorSchemes
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use `v2.container` instead
|
|
27
|
-
*/
|
|
28
|
-
container: number[]
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Use component-specific `v2.{button | card | input}.focusRing` values instead
|
|
31
|
-
*/
|
|
32
|
-
focusRing: {
|
|
33
|
-
offset: number
|
|
34
|
-
width: number
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use `v2.font` instead
|
|
38
|
-
*/
|
|
39
|
-
fonts: ThemeFonts
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `v2.input` instead
|
|
42
|
-
*/
|
|
43
|
-
input: ThemeInput
|
|
44
|
-
/**
|
|
45
|
-
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
46
|
-
* @beta
|
|
47
|
-
* @deprecated Use `v2.layer` instead
|
|
48
|
-
*/
|
|
49
|
-
layer?: ThemeLayer
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated Use `v2.media` instead
|
|
52
|
-
*/
|
|
53
|
-
media: number[]
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated Use `v2.radius` instead
|
|
56
|
-
*/
|
|
57
|
-
radius: number[]
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated Use `v2.shadow` instead
|
|
60
|
-
*/
|
|
61
|
-
shadows: Array<ThemeShadow | null>
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated Use `v2.space` instead
|
|
64
|
-
*/
|
|
65
|
-
space: number[]
|
|
66
|
-
/**
|
|
67
|
-
* @internal
|
|
68
|
-
* @deprecated Use `v2.style` instead
|
|
69
|
-
*/
|
|
70
|
-
styles?: ThemeStyles
|
|
71
|
-
v2?: RootTheme_v2
|
|
6
|
+
interface ThemeFocusRing {
|
|
7
|
+
offset: number;
|
|
8
|
+
width: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
interface ThemeAvatar_v2 {
|
|
14
|
+
sizes: {
|
|
15
|
+
/** Spacing between avatars in an <AvatarStack> component (px) */distance: number; /** Diameter of the avatar (px) */
|
|
16
|
+
size: number;
|
|
17
|
+
}[];
|
|
18
|
+
focusRing: ThemeFocusRing;
|
|
72
19
|
}
|
|
73
|
-
|
|
74
|
-
/** @internal */
|
|
75
|
-
export declare function buildTheme(config?: ThemeConfig): RootTheme
|
|
76
|
-
|
|
77
|
-
/** @public */
|
|
78
|
-
export declare const COLOR_CONFIG_AVATAR_COLORS: readonly ['*', ...ColorHueKey[]]
|
|
79
|
-
|
|
80
|
-
/** @public */
|
|
81
|
-
export declare const COLOR_CONFIG_BLEND_KEYS: readonly ['_blend']
|
|
82
|
-
|
|
83
|
-
/** @public */
|
|
84
|
-
export declare const COLOR_CONFIG_CARD_KEYS: readonly [
|
|
85
|
-
'_hue',
|
|
86
|
-
'bg',
|
|
87
|
-
'fg',
|
|
88
|
-
'border',
|
|
89
|
-
'focusRing',
|
|
90
|
-
'muted/fg',
|
|
91
|
-
'accent/fg',
|
|
92
|
-
'link/fg',
|
|
93
|
-
'code/bg',
|
|
94
|
-
'code/fg',
|
|
95
|
-
'skeleton/from',
|
|
96
|
-
'skeleton/to',
|
|
97
|
-
'status/dot',
|
|
98
|
-
'status/icon',
|
|
99
|
-
'_hue',
|
|
100
|
-
'bg',
|
|
101
|
-
'fg',
|
|
102
|
-
'border',
|
|
103
|
-
'focusRing',
|
|
104
|
-
'shadow/outline',
|
|
105
|
-
'shadow/umbra',
|
|
106
|
-
'shadow/penumbra',
|
|
107
|
-
'shadow/ambient',
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
/** @public */
|
|
111
|
-
export declare const COLOR_CONFIG_CARD_TONES: readonly [
|
|
112
|
-
'*',
|
|
113
|
-
'transparent',
|
|
114
|
-
'default',
|
|
115
|
-
'neutral',
|
|
116
|
-
'primary',
|
|
117
|
-
'suggest',
|
|
118
|
-
'positive',
|
|
119
|
-
'caution',
|
|
120
|
-
'critical',
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
/** @public */
|
|
124
|
-
export declare const COLOR_CONFIG_INPUT_MODES: readonly ['*', 'default', 'invalid']
|
|
125
|
-
|
|
126
20
|
/** @public */
|
|
127
|
-
|
|
128
|
-
'*',
|
|
129
|
-
'enabled',
|
|
130
|
-
'hovered',
|
|
131
|
-
'readOnly',
|
|
132
|
-
'disabled',
|
|
133
|
-
]
|
|
134
|
-
|
|
21
|
+
declare const THEME_COLOR_SCHEMES: readonly ["light", "dark"];
|
|
135
22
|
/** @public */
|
|
136
|
-
|
|
137
|
-
'_hue',
|
|
138
|
-
'bg',
|
|
139
|
-
'fg',
|
|
140
|
-
'border',
|
|
141
|
-
'focusRing',
|
|
142
|
-
'muted/fg',
|
|
143
|
-
'accent/fg',
|
|
144
|
-
'link/fg',
|
|
145
|
-
'code/bg',
|
|
146
|
-
'code/fg',
|
|
147
|
-
'skeleton/from',
|
|
148
|
-
'skeleton/to',
|
|
149
|
-
'status/dot',
|
|
150
|
-
'status/icon',
|
|
151
|
-
]
|
|
152
|
-
|
|
23
|
+
declare const THEME_COLOR_BLEND_MODES: readonly ["multiply", "screen"];
|
|
153
24
|
/** @public */
|
|
154
|
-
|
|
155
|
-
'*',
|
|
156
|
-
'default',
|
|
157
|
-
'neutral',
|
|
158
|
-
'primary',
|
|
159
|
-
'suggest',
|
|
160
|
-
'positive',
|
|
161
|
-
'caution',
|
|
162
|
-
'critical',
|
|
163
|
-
]
|
|
164
|
-
|
|
25
|
+
declare const THEME_COLOR_CARD_TONES: readonly ["transparent", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
165
26
|
/** @public */
|
|
166
|
-
|
|
167
|
-
'*',
|
|
168
|
-
'enabled',
|
|
169
|
-
'hovered',
|
|
170
|
-
'pressed',
|
|
171
|
-
'selected',
|
|
172
|
-
'disabled',
|
|
173
|
-
]
|
|
174
|
-
|
|
27
|
+
declare const THEME_COLOR_STATE_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
175
28
|
/** @public */
|
|
176
|
-
|
|
177
|
-
|
|
29
|
+
declare const THEME_COLOR_STATES: readonly ["enabled", "hovered", "pressed", "selected", "disabled"];
|
|
178
30
|
/** @public */
|
|
179
|
-
|
|
180
|
-
|
|
31
|
+
declare const THEME_COLOR_BUTTON_MODES: readonly ["default", "ghost", "bleed"];
|
|
181
32
|
/** @public */
|
|
182
|
-
|
|
183
|
-
|
|
33
|
+
declare const THEME_COLOR_INPUT_MODES: readonly ["default", "invalid"];
|
|
184
34
|
/** @public */
|
|
185
|
-
|
|
186
|
-
|
|
35
|
+
declare const THEME_COLOR_INPUT_STATES: readonly ["enabled", "hovered", "readOnly", "disabled"];
|
|
187
36
|
/** @public */
|
|
188
|
-
|
|
189
|
-
|
|
37
|
+
declare const THEME_COLOR_AVATAR_COLORS: import("@sanity/color").ColorHueKey[];
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
type ThemeColorSchemeKey = (typeof THEME_COLOR_SCHEMES)[number];
|
|
190
42
|
/** @public */
|
|
191
|
-
|
|
192
|
-
|
|
43
|
+
type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number];
|
|
193
44
|
/** @public */
|
|
194
|
-
|
|
195
|
-
|
|
45
|
+
type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[number];
|
|
196
46
|
/** @public */
|
|
197
|
-
|
|
198
|
-
|
|
47
|
+
type ThemeColorButtonModeKey = (typeof THEME_COLOR_BUTTON_MODES)[number];
|
|
199
48
|
/** @public */
|
|
200
|
-
|
|
201
|
-
|
|
49
|
+
type ThemeColorStateKey = (typeof THEME_COLOR_STATES)[number];
|
|
202
50
|
/** @public */
|
|
203
|
-
|
|
204
|
-
|
|
51
|
+
type ThemeColorStateToneKey = (typeof THEME_COLOR_STATE_TONES)[number];
|
|
205
52
|
/** @public */
|
|
206
|
-
|
|
207
|
-
|
|
53
|
+
type ThemeColorInputModeKey = (typeof THEME_COLOR_INPUT_MODES)[number];
|
|
208
54
|
/** @public */
|
|
209
|
-
|
|
210
|
-
| `black`
|
|
211
|
-
| `white`
|
|
212
|
-
| `black/${ColorConfigOpacityValue}`
|
|
213
|
-
| `white/${ColorConfigOpacityValue}`
|
|
214
|
-
| `${ColorHueKey}`
|
|
215
|
-
| `${ColorHueKey} ${number}%`
|
|
216
|
-
| `${ColorHueKey}/${ColorTintKey}`
|
|
217
|
-
| `${ColorHueKey}/${ColorTintKey} ${number}%`
|
|
218
|
-
| `${ColorHueKey}/${ColorTintKey}/${ColorConfigOpacityValue}`
|
|
219
|
-
| `${ColorTintKey}`
|
|
220
|
-
| `${ColorTintKey} ${number}%`
|
|
221
|
-
| `${ColorTintKey}/${ColorConfigOpacityValue}`
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* @public
|
|
225
|
-
* @deprecated Use `buildColorTheme` instead.
|
|
226
|
-
*/
|
|
227
|
-
export declare function createColorTheme(
|
|
228
|
-
partialOpts?: PartialThemeColorBuilderOpts,
|
|
229
|
-
): ThemeColorSchemes
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* A CSS-in-JS style object: standard CSS properties plus an index signature that allows nested
|
|
233
|
-
* selectors, at-rules and custom properties.
|
|
234
|
-
*
|
|
235
|
-
* This is a self-owned definition (based on `csstype`) so the published `.d.ts` types stay fully
|
|
236
|
-
* controlled by us and do not reference any external CSS-in-JS library types.
|
|
237
|
-
*
|
|
238
|
-
* @internal
|
|
239
|
-
*/
|
|
240
|
-
export declare interface CSSObject extends CSS_2.Properties<number | (string & {})> {
|
|
241
|
-
[key: string]: CSSObject | string | number | undefined
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/** @internal */
|
|
245
|
-
export declare function getContrastRatio(bg: string, fg: string): number
|
|
246
|
-
|
|
247
|
-
/** @internal */
|
|
248
|
-
export declare function getScopedTheme(
|
|
249
|
-
themeProp: RootTheme | RootTheme_v2,
|
|
250
|
-
scheme: ThemeColorSchemeKey,
|
|
251
|
-
tone: ThemeColorCardToneKey,
|
|
252
|
-
): Theme
|
|
253
|
-
|
|
55
|
+
type ThemeColorInputStateKey = (typeof THEME_COLOR_INPUT_STATES)[number];
|
|
254
56
|
/** @public */
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @internal
|
|
259
|
-
*/
|
|
260
|
-
export declare function hexToRgb(hex: string): RGB
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* @internal
|
|
264
|
-
*/
|
|
265
|
-
export declare interface HSL {
|
|
266
|
-
h: number
|
|
267
|
-
s: number
|
|
268
|
-
l: number
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* @internal
|
|
273
|
-
*/
|
|
274
|
-
export declare function hslToRgb(hsl: HSL): RGB
|
|
275
|
-
|
|
276
|
-
/** @internal */
|
|
277
|
-
export declare function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme
|
|
278
|
-
|
|
279
|
-
/** @internal */
|
|
280
|
-
export declare function is_v2(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme_v2
|
|
281
|
-
|
|
282
|
-
/** @internal */
|
|
283
|
-
export declare function isColorBlendModeValue(str: string): str is ThemeColorBlendModeKey
|
|
284
|
-
|
|
285
|
-
/** @internal */
|
|
286
|
-
export declare function isColorButtonMode(str: string): str is ThemeColorButtonModeKey
|
|
287
|
-
|
|
57
|
+
type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number];
|
|
288
58
|
/** @internal */
|
|
289
|
-
|
|
290
|
-
|
|
59
|
+
declare function isColorBlendModeValue(str: string): str is ThemeColorBlendModeKey;
|
|
291
60
|
/** @internal */
|
|
292
|
-
|
|
293
|
-
|
|
61
|
+
declare function isColorHueKey(str: string): str is ColorHueKey;
|
|
294
62
|
/** @internal */
|
|
295
|
-
|
|
296
|
-
|
|
63
|
+
declare function isColorTintKey(str: string): str is ColorTintKey;
|
|
297
64
|
/** @internal */
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
/** @internal */
|
|
301
|
-
export declare function isColorConfigStateTone(str: string): str is ColorConfigStateTone
|
|
302
|
-
|
|
303
|
-
/** @internal */
|
|
304
|
-
export declare function isColorHueKey(str: string): str is ColorHueKey
|
|
305
|
-
|
|
306
|
-
/** @internal */
|
|
307
|
-
export declare function isColorOpacityValue(str: string): str is ColorConfigOpacityValue
|
|
308
|
-
|
|
309
|
-
/** @internal */
|
|
310
|
-
export declare function isColorTintKey(str: string): str is ColorTintKey
|
|
311
|
-
|
|
312
|
-
/** @internal */
|
|
313
|
-
export declare function isColorTokenValue(str: string): str is ColorConfigValue
|
|
314
|
-
|
|
315
|
-
/** @internal */
|
|
316
|
-
export declare function isColorValue(str: string): str is 'black' | 'white'
|
|
317
|
-
|
|
65
|
+
declare function isColorButtonMode(str: string): str is ThemeColorButtonModeKey;
|
|
318
66
|
/**
|
|
319
|
-
*
|
|
320
|
-
* @internal
|
|
67
|
+
* @public
|
|
321
68
|
*/
|
|
322
|
-
|
|
323
|
-
|
|
69
|
+
interface ThemeColorAvatarHue_v2 {
|
|
70
|
+
_blend?: ThemeColorBlendModeKey;
|
|
71
|
+
bg: string;
|
|
72
|
+
fg: string;
|
|
73
|
+
}
|
|
324
74
|
/**
|
|
325
|
-
*
|
|
326
|
-
* Source: https://www.w3.org/TR/compositing-1/#blendingmultiply
|
|
327
|
-
* @internal
|
|
75
|
+
* @public
|
|
328
76
|
*/
|
|
329
|
-
|
|
330
|
-
|
|
77
|
+
type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>;
|
|
331
78
|
/**
|
|
332
|
-
* @
|
|
79
|
+
* @public
|
|
333
80
|
*/
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
export declare function parseTokenValue(str: string): TokenValueNode | undefined
|
|
341
|
-
|
|
81
|
+
interface ThemeColorBadgeTone_v2 {
|
|
82
|
+
bg: string;
|
|
83
|
+
fg: string;
|
|
84
|
+
dot: string;
|
|
85
|
+
icon: string;
|
|
86
|
+
}
|
|
342
87
|
/**
|
|
343
88
|
* @public
|
|
344
|
-
* @deprecated Use `ThemeConfig` instead.
|
|
345
89
|
*/
|
|
346
|
-
|
|
347
|
-
|
|
90
|
+
type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>;
|
|
348
91
|
/**
|
|
349
|
-
* @
|
|
92
|
+
* @public
|
|
350
93
|
*/
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
a?: undefined
|
|
94
|
+
interface ThemeColorKBD {
|
|
95
|
+
bg: string;
|
|
96
|
+
fg: string;
|
|
97
|
+
border: string;
|
|
356
98
|
}
|
|
357
|
-
|
|
358
99
|
/**
|
|
359
|
-
* @
|
|
100
|
+
* @public
|
|
360
101
|
*/
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
102
|
+
interface ThemeColorState_v2 {
|
|
103
|
+
/** @internal */
|
|
104
|
+
_blend?: ThemeColorBlendModeKey;
|
|
105
|
+
accent: {
|
|
106
|
+
fg: string;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* @internal This may be removed in a future release
|
|
110
|
+
* */
|
|
111
|
+
avatar: ThemeColorAvatar_v2;
|
|
112
|
+
/**
|
|
113
|
+
* @internal This may be removed in a future release
|
|
114
|
+
* */
|
|
115
|
+
badge: ThemeColorBadge_v2;
|
|
116
|
+
bg: string;
|
|
117
|
+
border: string;
|
|
118
|
+
code: {
|
|
119
|
+
bg: string;
|
|
120
|
+
fg: string;
|
|
121
|
+
};
|
|
122
|
+
fg: string;
|
|
123
|
+
icon: string;
|
|
124
|
+
kbd: ThemeColorKBD;
|
|
125
|
+
link: {
|
|
126
|
+
fg: string;
|
|
127
|
+
};
|
|
128
|
+
muted: {
|
|
129
|
+
bg: string;
|
|
130
|
+
fg: string;
|
|
131
|
+
};
|
|
132
|
+
skeleton: {
|
|
133
|
+
from: string;
|
|
134
|
+
to: string;
|
|
135
|
+
};
|
|
366
136
|
}
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* @internal
|
|
370
|
-
*/
|
|
371
|
-
export declare function rgba(color: unknown, a: number): string
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @internal
|
|
375
|
-
*/
|
|
376
|
-
export declare function rgbaToRGBA(rgba: string): RGBA
|
|
377
|
-
|
|
378
137
|
/**
|
|
379
|
-
* @
|
|
138
|
+
* @public
|
|
380
139
|
*/
|
|
381
|
-
|
|
382
|
-
|
|
140
|
+
type ThemeColorButtonTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>;
|
|
383
141
|
/**
|
|
384
|
-
* @
|
|
385
|
-
* @see https://css-tricks.com/converting-color-spaces-in-javascript/
|
|
142
|
+
* @public
|
|
386
143
|
*/
|
|
387
|
-
|
|
388
|
-
|
|
144
|
+
type ThemeColorButtonMode_v2 = Record<ThemeColorStateToneKey, ThemeColorButtonTone_v2>;
|
|
389
145
|
/**
|
|
390
146
|
* @public
|
|
391
147
|
*/
|
|
392
|
-
|
|
393
|
-
|
|
148
|
+
type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>;
|
|
394
149
|
/**
|
|
395
150
|
* @public
|
|
396
151
|
*/
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
card: {
|
|
408
|
-
border: {
|
|
409
|
-
width: number
|
|
410
|
-
}
|
|
411
|
-
focusRing: ThemeFocusRing
|
|
412
|
-
shadow: {
|
|
413
|
-
outline: number
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
color: ThemeColorSchemes_v2
|
|
417
|
-
container: number[]
|
|
418
|
-
font: ThemeFonts
|
|
419
|
-
input: ThemeInput_v2
|
|
420
|
-
layer: ThemeLayer
|
|
421
|
-
media: number[]
|
|
422
|
-
radius: number[]
|
|
423
|
-
shadow: Array<ThemeShadow | null>
|
|
424
|
-
space: number[]
|
|
425
|
-
/** @internal */
|
|
426
|
-
style?: ThemeStyles
|
|
152
|
+
interface ThemeColorInputState_v2 {
|
|
153
|
+
_blend?: ThemeColorBlendModeKey;
|
|
154
|
+
bg: string;
|
|
155
|
+
border: string;
|
|
156
|
+
fg: string;
|
|
157
|
+
muted: {
|
|
158
|
+
bg: string;
|
|
159
|
+
};
|
|
160
|
+
placeholder: string;
|
|
427
161
|
}
|
|
428
|
-
|
|
429
162
|
/**
|
|
430
|
-
*
|
|
431
|
-
* Source: https://www.w3.org/TR/compositing-1/#blendingscreen
|
|
432
|
-
* @internal
|
|
163
|
+
* @public
|
|
433
164
|
*/
|
|
434
|
-
|
|
435
|
-
export {screen_2 as screen}
|
|
436
|
-
|
|
165
|
+
type ThemeColorInputMode_v2 = Record<ThemeColorInputStateKey, ThemeColorInputState_v2>;
|
|
437
166
|
/**
|
|
438
167
|
* @public
|
|
439
168
|
*/
|
|
440
|
-
|
|
441
|
-
sanity: Omit<RootTheme, 'color' | 'v2'> & {
|
|
442
|
-
/**
|
|
443
|
-
* @deprecated Use `v2.color` instead
|
|
444
|
-
*/
|
|
445
|
-
color: ThemeColor
|
|
446
|
-
v2?: Theme_v2
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/** @public */
|
|
451
|
-
export declare const THEME_COLOR_AVATAR_COLORS: ColorHueKey[]
|
|
452
|
-
|
|
453
|
-
/** @public */
|
|
454
|
-
export declare const THEME_COLOR_BLEND_MODES: readonly ['multiply', 'screen']
|
|
455
|
-
|
|
456
|
-
/** @public */
|
|
457
|
-
export declare const THEME_COLOR_BUTTON_MODES: readonly ['default', 'ghost', 'bleed']
|
|
458
|
-
|
|
459
|
-
/** @public */
|
|
460
|
-
export declare const THEME_COLOR_CARD_TONES: readonly [
|
|
461
|
-
'transparent',
|
|
462
|
-
'default',
|
|
463
|
-
'neutral',
|
|
464
|
-
'primary',
|
|
465
|
-
'suggest',
|
|
466
|
-
'positive',
|
|
467
|
-
'caution',
|
|
468
|
-
'critical',
|
|
469
|
-
]
|
|
470
|
-
|
|
471
|
-
/** @public */
|
|
472
|
-
export declare const THEME_COLOR_INPUT_MODES: readonly ['default', 'invalid']
|
|
473
|
-
|
|
474
|
-
/** @public */
|
|
475
|
-
export declare const THEME_COLOR_INPUT_STATES: readonly [
|
|
476
|
-
'enabled',
|
|
477
|
-
'hovered',
|
|
478
|
-
'readOnly',
|
|
479
|
-
'disabled',
|
|
480
|
-
]
|
|
481
|
-
|
|
482
|
-
/** @public */
|
|
483
|
-
export declare const THEME_COLOR_SCHEMES: readonly ['light', 'dark']
|
|
484
|
-
|
|
485
|
-
/** @public */
|
|
486
|
-
export declare const THEME_COLOR_STATE_TONES: readonly [
|
|
487
|
-
'default',
|
|
488
|
-
'neutral',
|
|
489
|
-
'primary',
|
|
490
|
-
'suggest',
|
|
491
|
-
'positive',
|
|
492
|
-
'caution',
|
|
493
|
-
'critical',
|
|
494
|
-
]
|
|
495
|
-
|
|
496
|
-
/** @public */
|
|
497
|
-
export declare const THEME_COLOR_STATES: readonly [
|
|
498
|
-
'enabled',
|
|
499
|
-
'hovered',
|
|
500
|
-
'pressed',
|
|
501
|
-
'selected',
|
|
502
|
-
'disabled',
|
|
503
|
-
]
|
|
504
|
-
|
|
169
|
+
type ThemeColorInput_v2 = Record<ThemeColorInputModeKey, ThemeColorInputMode_v2>;
|
|
505
170
|
/**
|
|
506
171
|
* @public
|
|
507
172
|
*/
|
|
508
|
-
|
|
509
|
-
color: ThemeColorCard_v2
|
|
510
|
-
/**
|
|
511
|
-
* Indicates whether the theme is resolved or raw, it's necessary to avoid issues
|
|
512
|
-
* with sanity V2 components accessing a v1 <ThemeProvider>.
|
|
513
|
-
* See https://github.com/sanity-io/ui/pull/1203 for more info.
|
|
514
|
-
*/
|
|
515
|
-
_resolved: boolean
|
|
516
|
-
}
|
|
517
|
-
|
|
173
|
+
type ThemeColorSelectableTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>;
|
|
518
174
|
/**
|
|
519
175
|
* @public
|
|
520
|
-
* @deprecated Use `ThemeAvatar_v2` from `@sanity/ui/theme` instead.
|
|
521
176
|
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
177
|
+
type ThemeColorSelectable_v2 = Record<ThemeColorStateToneKey, ThemeColorSelectableTone_v2>;
|
|
178
|
+
/** @public */
|
|
179
|
+
interface ThemeColorShadow {
|
|
180
|
+
outline: string;
|
|
181
|
+
umbra: string;
|
|
182
|
+
penumbra: string;
|
|
183
|
+
ambient: string;
|
|
527
184
|
}
|
|
528
|
-
|
|
529
185
|
/**
|
|
530
186
|
* @public
|
|
531
187
|
*/
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
188
|
+
interface ThemeColorSyntax {
|
|
189
|
+
atrule: string;
|
|
190
|
+
attrName: string;
|
|
191
|
+
attrValue: string;
|
|
192
|
+
attribute: string;
|
|
193
|
+
boolean: string;
|
|
194
|
+
builtin: string;
|
|
195
|
+
cdata: string;
|
|
196
|
+
char: string;
|
|
197
|
+
class: string;
|
|
198
|
+
className: string;
|
|
199
|
+
comment: string;
|
|
200
|
+
constant: string;
|
|
201
|
+
deleted: string;
|
|
202
|
+
doctype: string;
|
|
203
|
+
entity: string;
|
|
204
|
+
function: string;
|
|
205
|
+
hexcode: string;
|
|
206
|
+
id: string;
|
|
207
|
+
important: string;
|
|
208
|
+
inserted: string;
|
|
209
|
+
keyword: string;
|
|
210
|
+
number: string;
|
|
211
|
+
operator: string;
|
|
212
|
+
prolog: string;
|
|
213
|
+
property: string;
|
|
214
|
+
pseudoClass: string;
|
|
215
|
+
pseudoElement: string;
|
|
216
|
+
punctuation: string;
|
|
217
|
+
regex: string;
|
|
218
|
+
selector: string;
|
|
219
|
+
string: string;
|
|
220
|
+
symbol: string;
|
|
221
|
+
tag: string;
|
|
222
|
+
unit: string;
|
|
223
|
+
url: string;
|
|
224
|
+
variable: string;
|
|
540
225
|
}
|
|
541
|
-
|
|
542
226
|
/**
|
|
543
227
|
* @public
|
|
544
228
|
*/
|
|
545
|
-
|
|
546
|
-
|
|
229
|
+
interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
230
|
+
/** @internal */
|
|
231
|
+
_blend: ThemeColorBlendModeKey;
|
|
232
|
+
_dark: boolean;
|
|
233
|
+
backdrop: string;
|
|
234
|
+
button: ThemeColorButton_v2;
|
|
235
|
+
focusRing: string;
|
|
236
|
+
input: ThemeColorInput_v2;
|
|
237
|
+
selectable: ThemeColorSelectable_v2;
|
|
238
|
+
shadow: ThemeColorShadow;
|
|
239
|
+
syntax: ThemeColorSyntax;
|
|
240
|
+
}
|
|
547
241
|
/**
|
|
548
242
|
* @public
|
|
549
|
-
* @deprecated Use `ThemeColor_v2` instead.
|
|
550
243
|
*/
|
|
551
|
-
|
|
552
|
-
base: ThemeColorBase
|
|
553
|
-
button: ThemeColorButton
|
|
554
|
-
card: ThemeColorCard
|
|
555
|
-
dark: boolean
|
|
556
|
-
input: ThemeColorInput
|
|
557
|
-
muted: ThemeColorMuted
|
|
558
|
-
selectable?: ThemeColorSelectable
|
|
559
|
-
solid: ThemeColorSolid
|
|
560
|
-
spot: ThemeColorSpot
|
|
561
|
-
syntax: ThemeColorSyntax
|
|
562
|
-
}
|
|
563
|
-
|
|
244
|
+
type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>;
|
|
564
245
|
/**
|
|
565
246
|
* @public
|
|
566
247
|
*/
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
/** @public */
|
|
570
|
-
export declare type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number]
|
|
571
|
-
|
|
248
|
+
type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>;
|
|
572
249
|
/**
|
|
573
|
-
*
|
|
250
|
+
* A CSS-in-JS style object: standard CSS properties plus an index signature that allows nested
|
|
251
|
+
* selectors, at-rules and custom properties.
|
|
252
|
+
*
|
|
253
|
+
* This is a self-owned definition (based on `csstype`) so the published `.d.ts` types stay fully
|
|
254
|
+
* controlled by us and do not reference any external CSS-in-JS library types.
|
|
255
|
+
*
|
|
256
|
+
* @internal
|
|
574
257
|
*/
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
bg: string
|
|
578
|
-
fg: string
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
/** @public */
|
|
582
|
-
export declare interface ThemeColorAvatarHueTokens {
|
|
583
|
-
_blend?: ColorBlendModeTokenValue
|
|
584
|
-
_hue?: ColorHueKey
|
|
585
|
-
bg?: ThemeColorTokenValue
|
|
586
|
-
fg?: ThemeColorTokenValue
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
/** @public */
|
|
590
|
-
export declare interface ThemeColorAvatarTokens {
|
|
591
|
-
'*'?: ThemeColorAvatarHueTokens
|
|
592
|
-
'gray'?: ThemeColorAvatarHueTokens
|
|
593
|
-
'blue'?: ThemeColorAvatarHueTokens
|
|
594
|
-
'purple'?: ThemeColorAvatarHueTokens
|
|
595
|
-
'magenta'?: ThemeColorAvatarHueTokens
|
|
596
|
-
'red'?: ThemeColorAvatarHueTokens
|
|
597
|
-
'orange'?: ThemeColorAvatarHueTokens
|
|
598
|
-
'yellow'?: ThemeColorAvatarHueTokens
|
|
599
|
-
'green'?: ThemeColorAvatarHueTokens
|
|
600
|
-
'cyan'?: ThemeColorAvatarHueTokens
|
|
258
|
+
interface CSSObject extends CSS.Properties<number | (string & {})> {
|
|
259
|
+
[key: string]: CSSObject | string | number | undefined;
|
|
601
260
|
}
|
|
602
|
-
|
|
603
261
|
/**
|
|
604
262
|
* @public
|
|
605
263
|
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
/** @public */
|
|
609
|
-
export declare type ThemeColorBadgeTokens = Partial<
|
|
610
|
-
Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>
|
|
611
|
-
>
|
|
612
|
-
|
|
264
|
+
type ThemeFontKey = 'code' | 'heading' | 'label' | 'text';
|
|
613
265
|
/**
|
|
614
266
|
* @public
|
|
615
267
|
*/
|
|
616
|
-
|
|
617
|
-
bg: string
|
|
618
|
-
fg: string
|
|
619
|
-
dot: string
|
|
620
|
-
icon: string
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/** @public */
|
|
624
|
-
export declare interface ThemeColorBadgeToneTokens {
|
|
625
|
-
_blend?: ColorBlendModeTokenValue
|
|
626
|
-
_hue?: ColorHueKey
|
|
627
|
-
bg?: ThemeColorTokenValue
|
|
628
|
-
dot?: ThemeColorTokenValue
|
|
629
|
-
fg?: ThemeColorTokenValue
|
|
630
|
-
icon?: ThemeColorTokenValue
|
|
631
|
-
}
|
|
632
|
-
|
|
268
|
+
type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
633
269
|
/**
|
|
634
270
|
* @public
|
|
635
|
-
* @deprecated Use `ThemeColorCard_v2` instead.
|
|
636
271
|
*/
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
outline: string
|
|
645
|
-
umbra: string
|
|
646
|
-
penumbra: string
|
|
647
|
-
ambient: string
|
|
648
|
-
}
|
|
649
|
-
skeleton?: {
|
|
650
|
-
from: string
|
|
651
|
-
to: string
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/** @public */
|
|
656
|
-
export declare interface ThemeColorBaseTokens extends ThemeColorStateTokens {
|
|
657
|
-
focusRing?: ThemeColorTokenValue
|
|
658
|
-
backdrop?: ThemeColorTokenValue
|
|
659
|
-
shadow?: {
|
|
660
|
-
outline?: ThemeColorTokenValue
|
|
661
|
-
umbra?: ThemeColorTokenValue
|
|
662
|
-
penumbra?: ThemeColorTokenValue
|
|
663
|
-
ambient?: ThemeColorTokenValue
|
|
664
|
-
}
|
|
272
|
+
interface ThemeFontSize {
|
|
273
|
+
ascenderHeight: number;
|
|
274
|
+
descenderHeight: number;
|
|
275
|
+
fontSize: number;
|
|
276
|
+
iconSize: number;
|
|
277
|
+
letterSpacing: number;
|
|
278
|
+
lineHeight: number;
|
|
665
279
|
}
|
|
666
|
-
|
|
667
|
-
/** @public */
|
|
668
|
-
export declare type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number]
|
|
669
|
-
|
|
670
280
|
/**
|
|
671
281
|
* @public
|
|
672
|
-
* @deprecated Use `buildColorTheme` instead.
|
|
673
282
|
*/
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
tone: ThemeColorName
|
|
680
|
-
name: ThemeColorName
|
|
681
|
-
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
682
|
-
}) => ThemeColorGenericState
|
|
683
|
-
muted: (opts: {
|
|
684
|
-
base: ThemeColorBase
|
|
685
|
-
dark: boolean
|
|
686
|
-
tone: ThemeColorToneKey
|
|
687
|
-
name: ThemeColorName
|
|
688
|
-
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
689
|
-
}) => ThemeColorGenericState
|
|
690
|
-
card: (opts: {
|
|
691
|
-
base: ThemeColorBase
|
|
692
|
-
dark: boolean
|
|
693
|
-
muted: ThemeColorMuted
|
|
694
|
-
name: ThemeColorName
|
|
695
|
-
solid: ThemeColorSolid
|
|
696
|
-
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
697
|
-
}) => ThemeColorGenericState
|
|
698
|
-
button: (opts: {
|
|
699
|
-
dark: boolean
|
|
700
|
-
mode: ThemeColorButtonModeKey
|
|
701
|
-
base: ThemeColorBase
|
|
702
|
-
solid: ThemeColorSolidTone
|
|
703
|
-
muted: ThemeColorMutedTone
|
|
704
|
-
}) => ThemeColorButtonStates
|
|
705
|
-
input: (opts: {
|
|
706
|
-
base: ThemeColorBase
|
|
707
|
-
solid: ThemeColorSolidTone
|
|
708
|
-
muted: ThemeColorMutedTone
|
|
709
|
-
dark: boolean
|
|
710
|
-
mode: 'default' | 'invalid'
|
|
711
|
-
state: 'enabled' | 'disabled' | 'hovered' | 'readOnly'
|
|
712
|
-
}) => ThemeColorInputState
|
|
713
|
-
selectable: (opts: {
|
|
714
|
-
dark: boolean
|
|
715
|
-
base: ThemeColorBase
|
|
716
|
-
solid: ThemeColorSolid
|
|
717
|
-
muted: ThemeColorMuted
|
|
718
|
-
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
719
|
-
tone: 'default' | 'primary' | 'positive' | 'caution' | 'critical'
|
|
720
|
-
}) => ThemeColorGenericState
|
|
721
|
-
syntax: (opts: {base: ThemeColorBase; dark: boolean}) => ThemeColorSyntax
|
|
722
|
-
spot: (opts: {base: ThemeColorBase; dark: boolean; key: ThemeColorSpotKey}) => string
|
|
283
|
+
interface ThemeFontWeight {
|
|
284
|
+
regular: number;
|
|
285
|
+
medium: number;
|
|
286
|
+
semibold: number;
|
|
287
|
+
bold: number;
|
|
723
288
|
}
|
|
724
|
-
|
|
725
289
|
/**
|
|
726
290
|
* @public
|
|
727
|
-
* @deprecated Use `ThemeColorButton_v2` instead.
|
|
728
291
|
*/
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
292
|
+
interface ThemeFont {
|
|
293
|
+
family: string;
|
|
294
|
+
weights: ThemeFontWeight;
|
|
295
|
+
sizes: ThemeFontSize[];
|
|
296
|
+
/** @deprecated No longer supported. */
|
|
297
|
+
horizontalOffset?: number;
|
|
733
298
|
}
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* @public
|
|
737
|
-
*/
|
|
738
|
-
export declare type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>
|
|
739
|
-
|
|
740
299
|
/**
|
|
741
300
|
* @public
|
|
742
301
|
*/
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
export declare type ThemeColorButtonModeKey = (typeof THEME_COLOR_BUTTON_MODES)[number]
|
|
750
|
-
|
|
302
|
+
interface ThemeFonts {
|
|
303
|
+
code: ThemeFont;
|
|
304
|
+
heading: ThemeFont;
|
|
305
|
+
label: ThemeFont;
|
|
306
|
+
text: ThemeFont;
|
|
307
|
+
}
|
|
751
308
|
/**
|
|
752
309
|
* @public
|
|
753
|
-
* @deprecated Use `ThemeColorState_v2` instead.
|
|
754
310
|
*/
|
|
755
|
-
|
|
756
|
-
|
|
311
|
+
interface ThemeInput_v2 {
|
|
312
|
+
checkbox: {
|
|
313
|
+
size: number;
|
|
314
|
+
focusRing: ThemeFocusRing;
|
|
315
|
+
};
|
|
316
|
+
radio: {
|
|
317
|
+
size: number;
|
|
318
|
+
markSize: number;
|
|
319
|
+
focusRing: ThemeFocusRing;
|
|
320
|
+
};
|
|
321
|
+
switch: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
padding: number;
|
|
325
|
+
transitionDurationMs: number;
|
|
326
|
+
transitionTimingFunction: string;
|
|
327
|
+
focusRing: ThemeFocusRing;
|
|
328
|
+
};
|
|
329
|
+
border: {
|
|
330
|
+
width: number;
|
|
331
|
+
};
|
|
332
|
+
select: {
|
|
333
|
+
focusRing: ThemeFocusRing;
|
|
334
|
+
};
|
|
335
|
+
text: {
|
|
336
|
+
focusRing: ThemeFocusRing;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
757
339
|
/**
|
|
758
340
|
* @public
|
|
759
|
-
* @deprecated Use `ThemeColorButtonStates_v2` instead.
|
|
760
341
|
*/
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
|
|
772
|
-
_hue?: ColorHueKey
|
|
342
|
+
interface ThemeLayer {
|
|
343
|
+
dialog: {
|
|
344
|
+
zOffset: number;
|
|
345
|
+
};
|
|
346
|
+
popover: {
|
|
347
|
+
zOffset: number;
|
|
348
|
+
};
|
|
349
|
+
tooltip: {
|
|
350
|
+
zOffset: number;
|
|
351
|
+
};
|
|
773
352
|
}
|
|
774
|
-
|
|
775
353
|
/**
|
|
776
354
|
* @public
|
|
777
355
|
*/
|
|
778
|
-
|
|
779
|
-
|
|
356
|
+
type ThemeBoxShadow = [number, number, number, number];
|
|
780
357
|
/**
|
|
781
|
-
* TODO: Rename to `ThemeColorButtonMode`.
|
|
782
358
|
* @public
|
|
783
|
-
* @deprecated Use `ThemeColorButtonTones_v2` instead.
|
|
784
359
|
*/
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
caution: ThemeColorButtonStates
|
|
790
|
-
critical: ThemeColorButtonStates
|
|
360
|
+
interface ThemeShadow {
|
|
361
|
+
umbra: ThemeBoxShadow;
|
|
362
|
+
penumbra: ThemeBoxShadow;
|
|
363
|
+
ambient: ThemeBoxShadow;
|
|
791
364
|
}
|
|
792
|
-
|
|
793
365
|
/**
|
|
794
|
-
* @
|
|
795
|
-
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
366
|
+
* @internal
|
|
796
367
|
*/
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
368
|
+
interface ThemeStyles {
|
|
369
|
+
button?: {
|
|
370
|
+
root?: CSSObject;
|
|
371
|
+
};
|
|
372
|
+
card?: {
|
|
373
|
+
root?: CSSObject;
|
|
374
|
+
};
|
|
803
375
|
}
|
|
804
|
-
|
|
805
376
|
/**
|
|
806
377
|
* @public
|
|
378
|
+
* @deprecated Use `ThemeAvatar_v2` from `@sanity/ui/theme` instead.
|
|
807
379
|
*/
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
button: ThemeColorButton_v2
|
|
814
|
-
focusRing: string
|
|
815
|
-
input: ThemeColorInput_v2
|
|
816
|
-
selectable: ThemeColorSelectable_v2
|
|
817
|
-
shadow: ThemeColorShadow
|
|
818
|
-
syntax: ThemeColorSyntax
|
|
380
|
+
interface ThemeAvatar {
|
|
381
|
+
sizes: {
|
|
382
|
+
distance: number;
|
|
383
|
+
size: number;
|
|
384
|
+
}[];
|
|
819
385
|
}
|
|
820
|
-
|
|
821
|
-
/**
|
|
822
|
-
* @public
|
|
823
|
-
* @deprecated Use `ThemeColorState_v2` instead.
|
|
824
|
-
*/
|
|
825
|
-
export declare type ThemeColorCardState = ThemeColorGenericState
|
|
826
|
-
|
|
827
|
-
/** @public */
|
|
828
|
-
export declare type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[number]
|
|
829
|
-
|
|
830
386
|
/**
|
|
831
387
|
* @public
|
|
832
388
|
* @deprecated Use `ThemeColorState_v2` instead.
|
|
833
389
|
*/
|
|
834
|
-
|
|
390
|
+
interface ThemeColorGenericState {
|
|
835
391
|
/** @internal */
|
|
836
|
-
_blend?: ThemeColorBlendModeKey
|
|
837
|
-
bg: string
|
|
392
|
+
_blend?: ThemeColorBlendModeKey;
|
|
393
|
+
bg: string;
|
|
838
394
|
/**
|
|
839
395
|
* @beta
|
|
840
396
|
*/
|
|
841
|
-
bg2?: string
|
|
842
|
-
border: string
|
|
843
|
-
fg: string
|
|
844
|
-
icon: string
|
|
397
|
+
bg2?: string;
|
|
398
|
+
border: string;
|
|
399
|
+
fg: string;
|
|
400
|
+
icon: string;
|
|
845
401
|
muted: {
|
|
846
|
-
fg: string
|
|
847
|
-
}
|
|
402
|
+
fg: string;
|
|
403
|
+
};
|
|
848
404
|
accent: {
|
|
849
|
-
fg: string
|
|
850
|
-
}
|
|
405
|
+
fg: string;
|
|
406
|
+
};
|
|
851
407
|
link: {
|
|
852
|
-
fg: string
|
|
853
|
-
}
|
|
408
|
+
fg: string;
|
|
409
|
+
};
|
|
854
410
|
code: {
|
|
855
|
-
bg: string
|
|
856
|
-
fg: string
|
|
857
|
-
}
|
|
411
|
+
bg: string;
|
|
412
|
+
fg: string;
|
|
413
|
+
};
|
|
858
414
|
skeleton?: {
|
|
859
|
-
from: string
|
|
860
|
-
to: string
|
|
861
|
-
}
|
|
415
|
+
from: string;
|
|
416
|
+
to: string;
|
|
417
|
+
};
|
|
862
418
|
}
|
|
863
|
-
|
|
864
419
|
/**
|
|
865
420
|
* @public
|
|
866
|
-
* @deprecated Use `
|
|
421
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
867
422
|
*/
|
|
868
|
-
|
|
869
|
-
default: ThemeColorInputStates
|
|
870
|
-
invalid: ThemeColorInputStates
|
|
871
|
-
}
|
|
872
|
-
|
|
423
|
+
type ThemeColorName = 'transparent' | 'default' | 'primary' | 'positive' | 'caution' | 'critical';
|
|
873
424
|
/**
|
|
874
425
|
* @public
|
|
426
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
875
427
|
*/
|
|
876
|
-
|
|
877
|
-
|
|
428
|
+
type ThemeColorToneKey = ThemeColorName;
|
|
878
429
|
/**
|
|
879
430
|
* @public
|
|
431
|
+
* @deprecated Use `ThemeColorCard_v2` instead.
|
|
880
432
|
*/
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
433
|
+
interface ThemeColorBase {
|
|
434
|
+
bg: string;
|
|
435
|
+
fg: string;
|
|
436
|
+
border: string;
|
|
437
|
+
focusRing: string;
|
|
438
|
+
backdrop?: string;
|
|
439
|
+
shadow: {
|
|
440
|
+
outline: string;
|
|
441
|
+
umbra: string;
|
|
442
|
+
penumbra: string;
|
|
443
|
+
ambient: string;
|
|
444
|
+
};
|
|
445
|
+
skeleton?: {
|
|
446
|
+
from: string;
|
|
447
|
+
to: string;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
889
450
|
/**
|
|
890
451
|
* @public
|
|
891
|
-
* @deprecated Use `
|
|
452
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
892
453
|
*/
|
|
893
|
-
|
|
894
|
-
_blend?: ThemeColorBlendModeKey
|
|
895
|
-
bg: string
|
|
896
|
-
bg2: string
|
|
897
|
-
border: string
|
|
898
|
-
fg: string
|
|
899
|
-
placeholder: string
|
|
900
|
-
}
|
|
901
|
-
|
|
454
|
+
type ThemeColorButtonState = ThemeColorGenericState;
|
|
902
455
|
/**
|
|
903
456
|
* @public
|
|
457
|
+
* @deprecated Use `ThemeColorButtonStates_v2` instead.
|
|
904
458
|
*/
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
bg: string
|
|
912
|
-
}
|
|
913
|
-
placeholder: string
|
|
459
|
+
interface ThemeColorButtonStates {
|
|
460
|
+
enabled: ThemeColorGenericState;
|
|
461
|
+
hovered: ThemeColorGenericState;
|
|
462
|
+
pressed: ThemeColorGenericState;
|
|
463
|
+
selected: ThemeColorGenericState;
|
|
464
|
+
disabled: ThemeColorGenericState;
|
|
914
465
|
}
|
|
915
|
-
|
|
916
|
-
/** @public */
|
|
917
|
-
export declare type ThemeColorInputStateKey = (typeof THEME_COLOR_INPUT_STATES)[number]
|
|
918
|
-
|
|
919
466
|
/**
|
|
467
|
+
* TODO: Rename to `ThemeColorButtonMode`.
|
|
920
468
|
* @public
|
|
921
|
-
* @deprecated Use `
|
|
469
|
+
* @deprecated Use `ThemeColorButtonTones_v2` instead.
|
|
922
470
|
*/
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
471
|
+
interface ThemeColorButtonTones {
|
|
472
|
+
default: ThemeColorButtonStates;
|
|
473
|
+
primary: ThemeColorButtonStates;
|
|
474
|
+
positive: ThemeColorButtonStates;
|
|
475
|
+
caution: ThemeColorButtonStates;
|
|
476
|
+
critical: ThemeColorButtonStates;
|
|
928
477
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
muted?: {
|
|
938
|
-
bg?: ThemeColorTokenValue
|
|
939
|
-
}
|
|
940
|
-
placeholder?: ThemeColorTokenValue
|
|
478
|
+
/**
|
|
479
|
+
* @public
|
|
480
|
+
* @deprecated Use `ThemeColorButton_v2` instead.
|
|
481
|
+
*/
|
|
482
|
+
interface ThemeColorButton {
|
|
483
|
+
default: ThemeColorButtonTones;
|
|
484
|
+
ghost: ThemeColorButtonTones;
|
|
485
|
+
bleed: ThemeColorButtonTones;
|
|
941
486
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
487
|
+
/**
|
|
488
|
+
* @public
|
|
489
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
490
|
+
*/
|
|
491
|
+
type ThemeColorCardState = ThemeColorGenericState;
|
|
492
|
+
/**
|
|
493
|
+
* @public
|
|
494
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
495
|
+
*/
|
|
496
|
+
interface ThemeColorCard {
|
|
497
|
+
enabled: ThemeColorGenericState;
|
|
498
|
+
hovered: ThemeColorGenericState;
|
|
499
|
+
pressed: ThemeColorGenericState;
|
|
500
|
+
selected: ThemeColorGenericState;
|
|
501
|
+
disabled: ThemeColorGenericState;
|
|
947
502
|
}
|
|
948
|
-
|
|
949
503
|
/**
|
|
950
504
|
* @public
|
|
505
|
+
* @deprecated Use `ThemeColorInputState_v2` instead.
|
|
951
506
|
*/
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
507
|
+
interface ThemeColorInputState {
|
|
508
|
+
_blend?: ThemeColorBlendModeKey;
|
|
509
|
+
bg: string;
|
|
510
|
+
bg2: string;
|
|
511
|
+
border: string;
|
|
512
|
+
fg: string;
|
|
513
|
+
placeholder: string;
|
|
956
514
|
}
|
|
957
|
-
|
|
958
515
|
/**
|
|
959
516
|
* @public
|
|
960
|
-
* @deprecated Use `
|
|
517
|
+
* @deprecated Use `ThemeColorInputMode_v2` instead.
|
|
961
518
|
*/
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
caution: ThemeColorMutedTone
|
|
968
|
-
critical: ThemeColorMutedTone
|
|
519
|
+
interface ThemeColorInputStates {
|
|
520
|
+
enabled: ThemeColorInputState;
|
|
521
|
+
disabled: ThemeColorInputState;
|
|
522
|
+
hovered: ThemeColorInputState;
|
|
523
|
+
readOnly: ThemeColorInputState;
|
|
969
524
|
}
|
|
970
|
-
|
|
971
525
|
/**
|
|
972
526
|
* @public
|
|
973
|
-
* @deprecated Use `
|
|
527
|
+
* @deprecated Use `ThemeColorInput_v2` instead.
|
|
974
528
|
*/
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
hovered: ThemeColorGenericState
|
|
979
|
-
pressed: ThemeColorGenericState
|
|
980
|
-
selected: ThemeColorGenericState
|
|
529
|
+
interface ThemeColorInput {
|
|
530
|
+
default: ThemeColorInputStates;
|
|
531
|
+
invalid: ThemeColorInputStates;
|
|
981
532
|
}
|
|
982
|
-
|
|
983
533
|
/**
|
|
984
534
|
* @public
|
|
985
|
-
* @deprecated Use `
|
|
535
|
+
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
986
536
|
*/
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
/** @public */
|
|
996
|
-
export declare type ThemeColorPalette = {
|
|
997
|
-
black: string | ColorTint
|
|
998
|
-
white: string | ColorTint
|
|
999
|
-
} & Record<ColorHueKey, Record<ColorTintKey, string | ColorTint>>
|
|
1000
|
-
|
|
537
|
+
interface ThemeColorMutedTone {
|
|
538
|
+
enabled: ThemeColorGenericState;
|
|
539
|
+
disabled: ThemeColorGenericState;
|
|
540
|
+
hovered: ThemeColorGenericState;
|
|
541
|
+
pressed: ThemeColorGenericState;
|
|
542
|
+
selected: ThemeColorGenericState;
|
|
543
|
+
}
|
|
1001
544
|
/**
|
|
1002
545
|
* @public
|
|
1003
|
-
* @deprecated Use `
|
|
546
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
1004
547
|
*/
|
|
1005
|
-
|
|
1006
|
-
|
|
548
|
+
interface ThemeColorMuted {
|
|
549
|
+
default: ThemeColorMutedTone;
|
|
550
|
+
transparent: ThemeColorMutedTone;
|
|
551
|
+
primary: ThemeColorMutedTone;
|
|
552
|
+
positive: ThemeColorMutedTone;
|
|
553
|
+
caution: ThemeColorMutedTone;
|
|
554
|
+
critical: ThemeColorMutedTone;
|
|
555
|
+
}
|
|
1007
556
|
/**
|
|
1008
557
|
* @public
|
|
558
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
1009
559
|
*/
|
|
1010
|
-
|
|
1011
|
-
|
|
560
|
+
type ThemeColorSelectableState = ThemeColorGenericState;
|
|
1012
561
|
/**
|
|
1013
562
|
* @public
|
|
563
|
+
* @deprecated Use `ThemeColorSelectableStates_v2` instead.
|
|
1014
564
|
*/
|
|
1015
|
-
|
|
1016
|
-
|
|
565
|
+
interface ThemeColorSelectableStates {
|
|
566
|
+
enabled: ThemeColorSelectableState;
|
|
567
|
+
hovered: ThemeColorSelectableState;
|
|
568
|
+
pressed: ThemeColorSelectableState;
|
|
569
|
+
selected: ThemeColorSelectableState;
|
|
570
|
+
disabled: ThemeColorSelectableState;
|
|
571
|
+
}
|
|
1017
572
|
/**
|
|
1018
573
|
* @public
|
|
1019
|
-
* @deprecated Use `
|
|
574
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
1020
575
|
*/
|
|
1021
|
-
|
|
1022
|
-
|
|
576
|
+
interface ThemeColorSelectable {
|
|
577
|
+
default: ThemeColorSelectableStates;
|
|
578
|
+
primary: ThemeColorSelectableStates;
|
|
579
|
+
positive: ThemeColorSelectableStates;
|
|
580
|
+
caution: ThemeColorSelectableStates;
|
|
581
|
+
critical: ThemeColorSelectableStates;
|
|
582
|
+
}
|
|
1023
583
|
/**
|
|
1024
584
|
* @public
|
|
585
|
+
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
1025
586
|
*/
|
|
1026
|
-
|
|
1027
|
-
|
|
587
|
+
interface ThemeColorSolidTone {
|
|
588
|
+
enabled: ThemeColorGenericState;
|
|
589
|
+
disabled: ThemeColorGenericState;
|
|
590
|
+
hovered: ThemeColorGenericState;
|
|
591
|
+
pressed: ThemeColorGenericState;
|
|
592
|
+
selected: ThemeColorGenericState;
|
|
593
|
+
}
|
|
1028
594
|
/**
|
|
1029
595
|
* @public
|
|
1030
596
|
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
1031
597
|
*/
|
|
1032
|
-
|
|
1033
|
-
default:
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
598
|
+
interface ThemeColorSolid {
|
|
599
|
+
default: ThemeColorSolidTone;
|
|
600
|
+
transparent: ThemeColorSolidTone;
|
|
601
|
+
primary: ThemeColorSolidTone;
|
|
602
|
+
positive: ThemeColorSolidTone;
|
|
603
|
+
caution: ThemeColorSolidTone;
|
|
604
|
+
critical: ThemeColorSolidTone;
|
|
1038
605
|
}
|
|
1039
|
-
|
|
1040
606
|
/**
|
|
1041
607
|
* @public
|
|
608
|
+
* @deprecated Use `ThemeColorAvatarColorKey` instead
|
|
1042
609
|
*/
|
|
1043
|
-
|
|
1044
|
-
ThemeColorStateToneKey,
|
|
1045
|
-
ThemeColorSelectableTone_v2
|
|
1046
|
-
>
|
|
1047
|
-
|
|
610
|
+
type ThemeColorSpotKey = ThemeColorAvatarColorKey;
|
|
1048
611
|
/**
|
|
1049
612
|
* @public
|
|
1050
|
-
* @deprecated Use `
|
|
613
|
+
* @deprecated Use `ThemeColorAvatar_v2` instead
|
|
1051
614
|
*/
|
|
1052
|
-
|
|
1053
|
-
|
|
615
|
+
type ThemeColorSpot = Record<ThemeColorSpotKey, string>;
|
|
1054
616
|
/**
|
|
1055
617
|
* @public
|
|
1056
|
-
* @deprecated Use `
|
|
618
|
+
* @deprecated Use `ThemeColor_v2` instead.
|
|
1057
619
|
*/
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
620
|
+
interface ThemeColor extends Partial<Omit<ThemeColorGenericState, 'muted'>> {
|
|
621
|
+
base: ThemeColorBase;
|
|
622
|
+
button: ThemeColorButton;
|
|
623
|
+
card: ThemeColorCard;
|
|
624
|
+
dark: boolean;
|
|
625
|
+
input: ThemeColorInput;
|
|
626
|
+
muted: ThemeColorMuted;
|
|
627
|
+
selectable?: ThemeColorSelectable;
|
|
628
|
+
solid: ThemeColorSolid;
|
|
629
|
+
spot: ThemeColorSpot;
|
|
630
|
+
syntax: ThemeColorSyntax;
|
|
1064
631
|
}
|
|
1065
|
-
|
|
1066
632
|
/**
|
|
1067
633
|
* @public
|
|
634
|
+
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
1068
635
|
*/
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
/** @public */
|
|
1072
|
-
export declare interface ThemeColorShadow {
|
|
1073
|
-
outline: string
|
|
1074
|
-
umbra: string
|
|
1075
|
-
penumbra: string
|
|
1076
|
-
ambient: string
|
|
1077
|
-
}
|
|
1078
|
-
|
|
636
|
+
type ThemeColorScheme = Record<ThemeColorName, ThemeColor>;
|
|
1079
637
|
/**
|
|
1080
638
|
* @public
|
|
1081
|
-
* @deprecated Use `
|
|
639
|
+
* @deprecated Use `ThemeColorSchemes_v2` instead.
|
|
1082
640
|
*/
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
641
|
+
type ThemeColorSchemes = Record<ThemeColorSchemeKey, ThemeColorScheme>;
|
|
642
|
+
/**
|
|
643
|
+
* @public
|
|
644
|
+
* @deprecated Use `ThemeInput_v2` instead
|
|
645
|
+
*/
|
|
646
|
+
interface ThemeInput {
|
|
647
|
+
checkbox: {
|
|
648
|
+
size: number;
|
|
649
|
+
};
|
|
650
|
+
radio: {
|
|
651
|
+
size: number;
|
|
652
|
+
markSize: number;
|
|
653
|
+
};
|
|
654
|
+
switch: {
|
|
655
|
+
width: number;
|
|
656
|
+
height: number;
|
|
657
|
+
padding: number;
|
|
658
|
+
transitionDurationMs: number;
|
|
659
|
+
transitionTimingFunction: string;
|
|
660
|
+
};
|
|
661
|
+
border: {
|
|
662
|
+
width: number;
|
|
663
|
+
};
|
|
1090
664
|
}
|
|
1091
|
-
|
|
1092
665
|
/**
|
|
1093
666
|
* @public
|
|
1094
|
-
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
1095
667
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
668
|
+
interface RootTheme_v2 {
|
|
669
|
+
_version: 2;
|
|
670
|
+
avatar: ThemeAvatar_v2;
|
|
671
|
+
button: {
|
|
672
|
+
border: {
|
|
673
|
+
width: number;
|
|
674
|
+
};
|
|
675
|
+
focusRing: ThemeFocusRing;
|
|
676
|
+
textWeight: ThemeFontWeightKey;
|
|
677
|
+
};
|
|
678
|
+
card: {
|
|
679
|
+
border: {
|
|
680
|
+
width: number;
|
|
681
|
+
};
|
|
682
|
+
focusRing: ThemeFocusRing;
|
|
683
|
+
shadow: {
|
|
684
|
+
outline: number;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
color: ThemeColorSchemes_v2;
|
|
688
|
+
container: number[];
|
|
689
|
+
font: ThemeFonts;
|
|
690
|
+
input: ThemeInput_v2;
|
|
691
|
+
layer: ThemeLayer;
|
|
692
|
+
media: number[];
|
|
693
|
+
radius: number[];
|
|
694
|
+
shadow: Array<ThemeShadow | null>;
|
|
695
|
+
space: number[];
|
|
696
|
+
/** @internal */
|
|
697
|
+
style?: ThemeStyles;
|
|
1102
698
|
}
|
|
1103
|
-
|
|
1104
699
|
/**
|
|
1105
700
|
* @public
|
|
1106
|
-
* @deprecated Use `ThemeColorAvatar_v2` instead
|
|
1107
701
|
*/
|
|
1108
|
-
|
|
1109
|
-
|
|
702
|
+
interface BaseTheme {
|
|
703
|
+
_version?: 0;
|
|
704
|
+
/**
|
|
705
|
+
* @deprecated Use `v2.avatar` instead
|
|
706
|
+
*/
|
|
707
|
+
avatar: ThemeAvatar;
|
|
708
|
+
/**
|
|
709
|
+
* @deprecated Use `v2.button` instead
|
|
710
|
+
*/
|
|
711
|
+
button: {
|
|
712
|
+
textWeight: ThemeFontWeightKey;
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
* @deprecated Use `v2.color` instead
|
|
716
|
+
*/
|
|
717
|
+
color: ThemeColorSchemes;
|
|
718
|
+
/**
|
|
719
|
+
* @deprecated Use `v2.container` instead
|
|
720
|
+
*/
|
|
721
|
+
container: number[];
|
|
722
|
+
/**
|
|
723
|
+
* @deprecated Use component-specific `v2.{button | card | input}.focusRing` values instead
|
|
724
|
+
*/
|
|
725
|
+
focusRing: {
|
|
726
|
+
offset: number;
|
|
727
|
+
width: number;
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* @deprecated Use `v2.font` instead
|
|
731
|
+
*/
|
|
732
|
+
fonts: ThemeFonts;
|
|
733
|
+
/**
|
|
734
|
+
* @deprecated Use `v2.input` instead
|
|
735
|
+
*/
|
|
736
|
+
input: ThemeInput;
|
|
737
|
+
/**
|
|
738
|
+
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
739
|
+
* @beta
|
|
740
|
+
* @deprecated Use `v2.layer` instead
|
|
741
|
+
*/
|
|
742
|
+
layer?: ThemeLayer;
|
|
743
|
+
/**
|
|
744
|
+
* @deprecated Use `v2.media` instead
|
|
745
|
+
*/
|
|
746
|
+
media: number[];
|
|
747
|
+
/**
|
|
748
|
+
* @deprecated Use `v2.radius` instead
|
|
749
|
+
*/
|
|
750
|
+
radius: number[];
|
|
751
|
+
/**
|
|
752
|
+
* @deprecated Use `v2.shadow` instead
|
|
753
|
+
*/
|
|
754
|
+
shadows: Array<ThemeShadow | null>;
|
|
755
|
+
/**
|
|
756
|
+
* @deprecated Use `v2.space` instead
|
|
757
|
+
*/
|
|
758
|
+
space: number[];
|
|
759
|
+
/**
|
|
760
|
+
* @internal
|
|
761
|
+
* @deprecated Use `v2.style` instead
|
|
762
|
+
*/
|
|
763
|
+
styles?: ThemeStyles;
|
|
764
|
+
v2?: RootTheme_v2;
|
|
765
|
+
}
|
|
1110
766
|
/**
|
|
1111
767
|
* @public
|
|
1112
|
-
* @deprecated Use `ThemeColorAvatarColorKey` instead
|
|
1113
768
|
*/
|
|
1114
|
-
|
|
1115
|
-
|
|
769
|
+
type RootTheme = BaseTheme;
|
|
1116
770
|
/**
|
|
1117
771
|
* @public
|
|
1118
772
|
*/
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
_blend?: ThemeColorBlendModeKey
|
|
1122
|
-
accent: {
|
|
1123
|
-
fg: string
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* @internal This may be removed in a future release
|
|
1127
|
-
* */
|
|
1128
|
-
avatar: ThemeColorAvatar_v2
|
|
773
|
+
type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
|
|
774
|
+
color: ThemeColorCard_v2;
|
|
1129
775
|
/**
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
776
|
+
* Indicates whether the theme is resolved or raw, it's necessary to avoid issues
|
|
777
|
+
* with sanity V2 components accessing a v1 <ThemeProvider>.
|
|
778
|
+
* See https://github.com/sanity-io/ui/pull/1203 for more info.
|
|
779
|
+
*/
|
|
780
|
+
_resolved: boolean;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* @public
|
|
784
|
+
*/
|
|
785
|
+
interface Theme {
|
|
786
|
+
sanity: Omit<RootTheme, 'color' | 'v2'> & {
|
|
787
|
+
/**
|
|
788
|
+
* @deprecated Use `v2.color` instead
|
|
789
|
+
*/
|
|
790
|
+
color: ThemeColor;
|
|
791
|
+
v2?: Theme_v2;
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* @public
|
|
796
|
+
* @deprecated Use `buildColorTheme` instead.
|
|
797
|
+
*/
|
|
798
|
+
interface ThemeColorBuilderOpts {
|
|
799
|
+
base: (opts: {
|
|
800
|
+
dark: boolean;
|
|
801
|
+
name: ThemeColorName;
|
|
802
|
+
}) => ThemeColorBase;
|
|
803
|
+
solid: (opts: {
|
|
804
|
+
base: ThemeColorBase;
|
|
805
|
+
dark: boolean;
|
|
806
|
+
tone: ThemeColorName;
|
|
807
|
+
name: ThemeColorName;
|
|
808
|
+
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected';
|
|
809
|
+
}) => ThemeColorGenericState;
|
|
810
|
+
muted: (opts: {
|
|
811
|
+
base: ThemeColorBase;
|
|
812
|
+
dark: boolean;
|
|
813
|
+
tone: ThemeColorToneKey;
|
|
814
|
+
name: ThemeColorName;
|
|
815
|
+
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected';
|
|
816
|
+
}) => ThemeColorGenericState;
|
|
817
|
+
card: (opts: {
|
|
818
|
+
base: ThemeColorBase;
|
|
819
|
+
dark: boolean;
|
|
820
|
+
muted: ThemeColorMuted;
|
|
821
|
+
name: ThemeColorName;
|
|
822
|
+
solid: ThemeColorSolid;
|
|
823
|
+
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected';
|
|
824
|
+
}) => ThemeColorGenericState;
|
|
825
|
+
button: (opts: {
|
|
826
|
+
dark: boolean;
|
|
827
|
+
mode: ThemeColorButtonModeKey;
|
|
828
|
+
base: ThemeColorBase;
|
|
829
|
+
solid: ThemeColorSolidTone;
|
|
830
|
+
muted: ThemeColorMutedTone;
|
|
831
|
+
}) => ThemeColorButtonStates;
|
|
832
|
+
input: (opts: {
|
|
833
|
+
base: ThemeColorBase;
|
|
834
|
+
solid: ThemeColorSolidTone;
|
|
835
|
+
muted: ThemeColorMutedTone;
|
|
836
|
+
dark: boolean;
|
|
837
|
+
mode: 'default' | 'invalid';
|
|
838
|
+
state: 'enabled' | 'disabled' | 'hovered' | 'readOnly';
|
|
839
|
+
}) => ThemeColorInputState;
|
|
840
|
+
selectable: (opts: {
|
|
841
|
+
dark: boolean;
|
|
842
|
+
base: ThemeColorBase;
|
|
843
|
+
solid: ThemeColorSolid;
|
|
844
|
+
muted: ThemeColorMuted;
|
|
845
|
+
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected';
|
|
846
|
+
tone: 'default' | 'primary' | 'positive' | 'caution' | 'critical';
|
|
847
|
+
}) => ThemeColorGenericState;
|
|
848
|
+
syntax: (opts: {
|
|
849
|
+
base: ThemeColorBase;
|
|
850
|
+
dark: boolean;
|
|
851
|
+
}) => ThemeColorSyntax;
|
|
852
|
+
spot: (opts: {
|
|
853
|
+
base: ThemeColorBase;
|
|
854
|
+
dark: boolean;
|
|
855
|
+
key: ThemeColorSpotKey;
|
|
856
|
+
}) => string;
|
|
1153
857
|
}
|
|
1154
|
-
|
|
858
|
+
/**
|
|
859
|
+
* @public
|
|
860
|
+
* @deprecated Use `ThemeConfig` instead.
|
|
861
|
+
*/
|
|
862
|
+
type PartialThemeColorBuilderOpts = Partial<ThemeColorBuilderOpts>;
|
|
863
|
+
/**
|
|
864
|
+
* @public
|
|
865
|
+
* @deprecated Use `buildColorTheme` instead.
|
|
866
|
+
*/
|
|
867
|
+
declare function createColorTheme(partialOpts?: PartialThemeColorBuilderOpts): ThemeColorSchemes;
|
|
868
|
+
/** @public */
|
|
869
|
+
declare const COLOR_CONFIG_STATE_KEYS: readonly ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon"];
|
|
870
|
+
/** @public */
|
|
871
|
+
type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number];
|
|
872
|
+
/** @public */
|
|
873
|
+
declare const COLOR_CONFIG_CARD_KEYS: readonly ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon", "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"];
|
|
874
|
+
/** @public */
|
|
875
|
+
type ColorConfigCardKey = (typeof COLOR_CONFIG_CARD_KEYS)[number];
|
|
876
|
+
/** @public */
|
|
877
|
+
declare const COLOR_CONFIG_BLEND_KEYS: readonly ["_blend"];
|
|
878
|
+
/** @public */
|
|
879
|
+
type ColorConfigBlendKey = (typeof COLOR_CONFIG_BLEND_KEYS)[number];
|
|
880
|
+
/** @public */
|
|
881
|
+
type ColorConfigOpacityValue = `0` | `0.${number}` | `1`;
|
|
882
|
+
/** @public */
|
|
883
|
+
type ColorConfigValue = `black` | `white` | `black/${ColorConfigOpacityValue}` | `white/${ColorConfigOpacityValue}` | `${ColorHueKey}` | `${ColorHueKey} ${number}%` | `${ColorHueKey}/${ColorTintKey}` | `${ColorHueKey}/${ColorTintKey} ${number}%` | `${ColorHueKey}/${ColorTintKey}/${ColorConfigOpacityValue}` | `${ColorTintKey}` | `${ColorTintKey} ${number}%` | `${ColorTintKey}/${ColorConfigOpacityValue}`;
|
|
1155
884
|
/** @public */
|
|
1156
|
-
|
|
1157
|
-
|
|
885
|
+
type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue];
|
|
1158
886
|
/** @public */
|
|
1159
|
-
|
|
1160
|
-
Record<ColorConfigState, ThemeColorStateTokens>
|
|
1161
|
-
>
|
|
1162
|
-
|
|
887
|
+
type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey];
|
|
1163
888
|
/** @public */
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
889
|
+
declare const COLOR_CONFIG_AVATAR_COLORS: readonly ["*", ...ColorHueKey[]];
|
|
890
|
+
/** @public */
|
|
891
|
+
type ColorConfigAvatarColor = (typeof COLOR_CONFIG_AVATAR_COLORS)[number];
|
|
892
|
+
/** @public */
|
|
893
|
+
declare const COLOR_CONFIG_CARD_TONES: readonly ["*", "transparent", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
894
|
+
/** @public */
|
|
895
|
+
type ColorConfigCardTone = (typeof COLOR_CONFIG_CARD_TONES)[number];
|
|
896
|
+
/** @public */
|
|
897
|
+
declare const COLOR_CONFIG_STATE_TONES: readonly ["*", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
898
|
+
/** @public */
|
|
899
|
+
type ColorConfigStateTone = (typeof COLOR_CONFIG_STATE_TONES)[number];
|
|
900
|
+
/** @public */
|
|
901
|
+
declare const COLOR_CONFIG_STATES: readonly ["*", "enabled", "hovered", "pressed", "selected", "disabled"];
|
|
902
|
+
/** @public */
|
|
903
|
+
type ColorConfigState = (typeof COLOR_CONFIG_STATES)[number];
|
|
904
|
+
/** @public */
|
|
905
|
+
declare const COLOR_CONFIG_INPUT_MODES: readonly ["*", "default", "invalid"];
|
|
906
|
+
/** @public */
|
|
907
|
+
type ColorConfigInputMode = (typeof COLOR_CONFIG_INPUT_MODES)[number];
|
|
908
|
+
/** @public */
|
|
909
|
+
declare const COLOR_CONFIG_INPUT_STATES: readonly ["*", "enabled", "hovered", "readOnly", "disabled"];
|
|
910
|
+
/** @public */
|
|
911
|
+
type ColorConfigInputState = (typeof COLOR_CONFIG_INPUT_STATES)[number];
|
|
912
|
+
/** @internal */
|
|
913
|
+
declare function isColorConfigBaseTone(str: string): str is ColorConfigCardTone;
|
|
914
|
+
/** @internal */
|
|
915
|
+
declare function isColorConfigBaseKey(str: string): str is ColorConfigCardKey;
|
|
916
|
+
/** @internal */
|
|
917
|
+
declare function isColorConfigStateKey(str: string): str is ColorConfigStateKey;
|
|
918
|
+
/** @internal */
|
|
919
|
+
declare function isColorConfigStateTone(str: string): str is ColorConfigStateTone;
|
|
920
|
+
/** @internal */
|
|
921
|
+
declare function isColorConfigBlendKey(str: string): str is ColorConfigBlendKey;
|
|
922
|
+
/** @internal */
|
|
923
|
+
declare function isColorTokenValue(str: string): str is ColorConfigValue;
|
|
924
|
+
/** @internal */
|
|
925
|
+
declare function isColorValue(str: string): str is 'black' | 'white';
|
|
926
|
+
/** @internal */
|
|
927
|
+
declare function isColorOpacityValue(str: string): str is ColorConfigOpacityValue;
|
|
928
|
+
/** @public */
|
|
929
|
+
interface ThemeColorAvatarHueTokens {
|
|
930
|
+
_blend?: ColorBlendModeTokenValue;
|
|
931
|
+
_hue?: ColorHueKey;
|
|
932
|
+
bg?: ThemeColorTokenValue;
|
|
933
|
+
fg?: ThemeColorTokenValue;
|
|
934
|
+
}
|
|
935
|
+
/** @public */
|
|
936
|
+
interface ThemeColorAvatarTokens {
|
|
937
|
+
'*'?: ThemeColorAvatarHueTokens;
|
|
938
|
+
'gray'?: ThemeColorAvatarHueTokens;
|
|
939
|
+
'blue'?: ThemeColorAvatarHueTokens;
|
|
940
|
+
'purple'?: ThemeColorAvatarHueTokens;
|
|
941
|
+
'magenta'?: ThemeColorAvatarHueTokens;
|
|
942
|
+
'red'?: ThemeColorAvatarHueTokens;
|
|
943
|
+
'orange'?: ThemeColorAvatarHueTokens;
|
|
944
|
+
'yellow'?: ThemeColorAvatarHueTokens;
|
|
945
|
+
'green'?: ThemeColorAvatarHueTokens;
|
|
946
|
+
'cyan'?: ThemeColorAvatarHueTokens;
|
|
947
|
+
}
|
|
948
|
+
/** @public */
|
|
949
|
+
interface ThemeColorBaseTokens extends ThemeColorStateTokens {
|
|
950
|
+
focusRing?: ThemeColorTokenValue;
|
|
951
|
+
backdrop?: ThemeColorTokenValue;
|
|
952
|
+
shadow?: {
|
|
953
|
+
outline?: ThemeColorTokenValue;
|
|
954
|
+
umbra?: ThemeColorTokenValue;
|
|
955
|
+
penumbra?: ThemeColorTokenValue;
|
|
956
|
+
ambient?: ThemeColorTokenValue;
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
/** @public */
|
|
960
|
+
interface ThemeColorBadgeToneTokens {
|
|
961
|
+
_blend?: ColorBlendModeTokenValue;
|
|
962
|
+
_hue?: ColorHueKey;
|
|
963
|
+
bg?: ThemeColorTokenValue;
|
|
964
|
+
dot?: ThemeColorTokenValue;
|
|
965
|
+
fg?: ThemeColorTokenValue;
|
|
966
|
+
icon?: ThemeColorTokenValue;
|
|
967
|
+
}
|
|
968
|
+
/** @public */
|
|
969
|
+
type ThemeColorBadgeTokens = Partial<Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>>;
|
|
970
|
+
/** @public */
|
|
971
|
+
interface ThemeColorStateTokens {
|
|
972
|
+
_blend?: ColorBlendModeTokenValue;
|
|
973
|
+
_hue?: ColorHueKey;
|
|
1167
974
|
accent?: {
|
|
1168
|
-
fg?: ThemeColorTokenValue
|
|
1169
|
-
}
|
|
1170
|
-
avatar?: ThemeColorAvatarTokens
|
|
1171
|
-
badge?: ThemeColorBadgeTokens
|
|
1172
|
-
bg?: ThemeColorTokenValue
|
|
1173
|
-
border?: ThemeColorTokenValue
|
|
975
|
+
fg?: ThemeColorTokenValue;
|
|
976
|
+
};
|
|
977
|
+
avatar?: ThemeColorAvatarTokens;
|
|
978
|
+
badge?: ThemeColorBadgeTokens;
|
|
979
|
+
bg?: ThemeColorTokenValue;
|
|
980
|
+
border?: ThemeColorTokenValue;
|
|
1174
981
|
code?: {
|
|
1175
|
-
bg?: ThemeColorTokenValue
|
|
1176
|
-
fg?: ThemeColorTokenValue
|
|
1177
|
-
}
|
|
1178
|
-
fg?: ThemeColorTokenValue
|
|
1179
|
-
icon?: ThemeColorTokenValue
|
|
982
|
+
bg?: ThemeColorTokenValue;
|
|
983
|
+
fg?: ThemeColorTokenValue;
|
|
984
|
+
};
|
|
985
|
+
fg?: ThemeColorTokenValue;
|
|
986
|
+
icon?: ThemeColorTokenValue;
|
|
1180
987
|
kbd?: {
|
|
1181
|
-
bg?: ThemeColorTokenValue
|
|
1182
|
-
fg?: ThemeColorTokenValue
|
|
1183
|
-
border?: ThemeColorTokenValue
|
|
1184
|
-
}
|
|
988
|
+
bg?: ThemeColorTokenValue;
|
|
989
|
+
fg?: ThemeColorTokenValue;
|
|
990
|
+
border?: ThemeColorTokenValue;
|
|
991
|
+
};
|
|
1185
992
|
link?: {
|
|
1186
|
-
fg?: ThemeColorTokenValue
|
|
1187
|
-
}
|
|
993
|
+
fg?: ThemeColorTokenValue;
|
|
994
|
+
};
|
|
1188
995
|
muted?: {
|
|
1189
|
-
bg?: ThemeColorTokenValue
|
|
1190
|
-
fg?: ThemeColorTokenValue
|
|
1191
|
-
}
|
|
996
|
+
bg?: ThemeColorTokenValue;
|
|
997
|
+
fg?: ThemeColorTokenValue;
|
|
998
|
+
};
|
|
1192
999
|
skeleton?: {
|
|
1193
|
-
from?: ThemeColorTokenValue
|
|
1194
|
-
to?: ThemeColorTokenValue
|
|
1195
|
-
}
|
|
1000
|
+
from?: ThemeColorTokenValue;
|
|
1001
|
+
to?: ThemeColorTokenValue;
|
|
1002
|
+
};
|
|
1196
1003
|
}
|
|
1197
|
-
|
|
1198
1004
|
/** @public */
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
*/
|
|
1204
|
-
export declare interface ThemeColorSyntax {
|
|
1205
|
-
atrule: string
|
|
1206
|
-
attrName: string
|
|
1207
|
-
attrValue: string
|
|
1208
|
-
attribute: string
|
|
1209
|
-
boolean: string
|
|
1210
|
-
builtin: string
|
|
1211
|
-
cdata: string
|
|
1212
|
-
char: string
|
|
1213
|
-
class: string
|
|
1214
|
-
className: string
|
|
1215
|
-
comment: string
|
|
1216
|
-
constant: string
|
|
1217
|
-
deleted: string
|
|
1218
|
-
doctype: string
|
|
1219
|
-
entity: string
|
|
1220
|
-
function: string
|
|
1221
|
-
hexcode: string
|
|
1222
|
-
id: string
|
|
1223
|
-
important: string
|
|
1224
|
-
inserted: string
|
|
1225
|
-
keyword: string
|
|
1226
|
-
number: string
|
|
1227
|
-
operator: string
|
|
1228
|
-
prolog: string
|
|
1229
|
-
property: string
|
|
1230
|
-
pseudoClass: string
|
|
1231
|
-
pseudoElement: string
|
|
1232
|
-
punctuation: string
|
|
1233
|
-
regex: string
|
|
1234
|
-
selector: string
|
|
1235
|
-
string: string
|
|
1236
|
-
symbol: string
|
|
1237
|
-
tag: string
|
|
1238
|
-
unit: string
|
|
1239
|
-
url: string
|
|
1240
|
-
variable: string
|
|
1005
|
+
type ThemeColorStatesTokens = Partial<Record<ColorConfigState, ThemeColorStateTokens>>;
|
|
1006
|
+
/** @public */
|
|
1007
|
+
interface ThemeColorButtonTokens extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
|
|
1008
|
+
_hue?: ColorHueKey;
|
|
1241
1009
|
}
|
|
1242
|
-
|
|
1243
1010
|
/** @public */
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
>
|
|
1255
|
-
>
|
|
1256
|
-
syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>
|
|
1011
|
+
interface ThemeColorInputStateTokens {
|
|
1012
|
+
_blend?: ColorBlendModeTokenValue;
|
|
1013
|
+
_hue?: ColorHueKey;
|
|
1014
|
+
bg?: ThemeColorTokenValue;
|
|
1015
|
+
border?: ThemeColorTokenValue;
|
|
1016
|
+
fg?: ThemeColorTokenValue;
|
|
1017
|
+
muted?: {
|
|
1018
|
+
bg?: ThemeColorTokenValue;
|
|
1019
|
+
};
|
|
1020
|
+
placeholder?: ThemeColorTokenValue;
|
|
1257
1021
|
}
|
|
1258
|
-
|
|
1259
1022
|
/** @public */
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1023
|
+
interface ThemeColorInputTokens extends Partial<Record<ColorConfigInputState, ThemeColorInputStateTokens>> {
|
|
1024
|
+
_hue?: ColorHueKey;
|
|
1025
|
+
}
|
|
1026
|
+
/** @public */
|
|
1027
|
+
interface ThemeColorTokens {
|
|
1028
|
+
base?: Partial<Record<ColorConfigCardTone, ThemeColorBaseTokens>>;
|
|
1029
|
+
button?: Partial<Record<ThemeColorButtonModeKey, ThemeColorButtonTokens>>;
|
|
1030
|
+
input?: Partial<Record<ColorConfigInputMode, ThemeColorInputTokens>>;
|
|
1031
|
+
selectable?: Partial<Record<ColorConfigStateTone, {
|
|
1032
|
+
_hue?: ColorHueKey;
|
|
1033
|
+
} & ThemeColorStatesTokens>>;
|
|
1034
|
+
syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>;
|
|
1035
|
+
}
|
|
1036
|
+
/** @internal */
|
|
1037
|
+
interface TokenBaseKeyNode {
|
|
1038
|
+
type: 'base';
|
|
1039
|
+
tone: ColorConfigCardTone;
|
|
1040
|
+
key: ColorConfigCardKey | ColorConfigBlendKey;
|
|
1041
|
+
}
|
|
1042
|
+
/** @internal */
|
|
1043
|
+
interface TokenButtonKeyNode {
|
|
1044
|
+
type: 'button';
|
|
1045
|
+
tone: ColorConfigStateTone;
|
|
1046
|
+
mode: ThemeColorButtonModeKey;
|
|
1047
|
+
key: ColorConfigStateKey | ColorConfigBlendKey;
|
|
1048
|
+
}
|
|
1049
|
+
/** @internal */
|
|
1050
|
+
type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode;
|
|
1051
|
+
/** @internal */
|
|
1052
|
+
interface TokenColorValueNode {
|
|
1053
|
+
type: 'color';
|
|
1054
|
+
key?: 'black' | 'white';
|
|
1055
|
+
hue?: ColorHueKey;
|
|
1056
|
+
mix?: number;
|
|
1057
|
+
opacity?: number;
|
|
1058
|
+
tint?: ColorTintKey;
|
|
1059
|
+
}
|
|
1060
|
+
/** @internal */
|
|
1061
|
+
interface TokenHueValueNode {
|
|
1062
|
+
type: 'hue';
|
|
1063
|
+
value?: ColorHueKey;
|
|
1064
|
+
}
|
|
1065
|
+
/** @internal */
|
|
1066
|
+
interface TokenBlendModeValueNode {
|
|
1067
|
+
type: 'blendMode';
|
|
1068
|
+
value?: ThemeColorBlendModeKey;
|
|
1069
|
+
}
|
|
1070
|
+
/** @internal */
|
|
1071
|
+
type TokenValueNode = TokenColorValueNode | TokenHueValueNode | TokenBlendModeValueNode;
|
|
1072
|
+
/** @internal */
|
|
1073
|
+
declare function parseTokenKey(str: string): TokenKeyNode | undefined;
|
|
1074
|
+
/** @internal */
|
|
1075
|
+
declare function parseTokenValue(str: string): TokenValueNode | undefined;
|
|
1268
1076
|
/** @public */
|
|
1269
|
-
|
|
1270
|
-
|
|
1077
|
+
type ThemeColorPalette = {
|
|
1078
|
+
black: string | ColorTint;
|
|
1079
|
+
white: string | ColorTint;
|
|
1080
|
+
} & Record<ColorHueKey, Record<ColorTintKey, string | ColorTint>>;
|
|
1081
|
+
/** @public */
|
|
1082
|
+
interface ThemeConfig {
|
|
1083
|
+
avatar?: ThemeAvatar_v2;
|
|
1271
1084
|
button?: {
|
|
1272
1085
|
border: {
|
|
1273
|
-
width: number
|
|
1274
|
-
}
|
|
1275
|
-
focusRing: ThemeFocusRing
|
|
1276
|
-
textWeight: ThemeFontWeightKey
|
|
1277
|
-
}
|
|
1086
|
+
width: number;
|
|
1087
|
+
};
|
|
1088
|
+
focusRing: ThemeFocusRing;
|
|
1089
|
+
textWeight: ThemeFontWeightKey;
|
|
1090
|
+
};
|
|
1278
1091
|
card?: {
|
|
1279
1092
|
border: {
|
|
1280
|
-
width: number
|
|
1281
|
-
}
|
|
1282
|
-
focusRing: ThemeFocusRing
|
|
1093
|
+
width: number;
|
|
1094
|
+
};
|
|
1095
|
+
focusRing: ThemeFocusRing;
|
|
1283
1096
|
shadow: {
|
|
1284
|
-
outline: number
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
color?: ThemeColorTokens
|
|
1288
|
-
container?: number[]
|
|
1289
|
-
font?: ThemeFonts
|
|
1290
|
-
input?: ThemeInput_v2
|
|
1291
|
-
layer?: ThemeLayer
|
|
1292
|
-
media?: number[]
|
|
1293
|
-
palette?: ThemeColorPalette
|
|
1294
|
-
radius?: number[]
|
|
1295
|
-
shadow?: Array<ThemeShadow | null
|
|
1296
|
-
space?: number[]
|
|
1097
|
+
outline: number;
|
|
1098
|
+
};
|
|
1099
|
+
};
|
|
1100
|
+
color?: ThemeColorTokens;
|
|
1101
|
+
container?: number[];
|
|
1102
|
+
font?: ThemeFonts;
|
|
1103
|
+
input?: ThemeInput_v2;
|
|
1104
|
+
layer?: ThemeLayer;
|
|
1105
|
+
media?: number[];
|
|
1106
|
+
palette?: ThemeColorPalette;
|
|
1107
|
+
radius?: number[];
|
|
1108
|
+
shadow?: Array<ThemeShadow | null>;
|
|
1109
|
+
space?: number[];
|
|
1297
1110
|
/** @internal */
|
|
1298
|
-
style?: ThemeStyles
|
|
1111
|
+
style?: ThemeStyles;
|
|
1299
1112
|
}
|
|
1300
|
-
|
|
1113
|
+
/** @internal */
|
|
1114
|
+
declare function buildTheme(config?: ThemeConfig): RootTheme;
|
|
1301
1115
|
/**
|
|
1302
|
-
* @
|
|
1116
|
+
* @internal
|
|
1303
1117
|
*/
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1118
|
+
interface RGB {
|
|
1119
|
+
r: number;
|
|
1120
|
+
g: number;
|
|
1121
|
+
b: number;
|
|
1122
|
+
a?: undefined;
|
|
1307
1123
|
}
|
|
1308
|
-
|
|
1309
1124
|
/**
|
|
1310
|
-
* @
|
|
1125
|
+
* @internal
|
|
1311
1126
|
*/
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
horizontalOffset?: number
|
|
1127
|
+
interface RGBA {
|
|
1128
|
+
r: number;
|
|
1129
|
+
g: number;
|
|
1130
|
+
b: number;
|
|
1131
|
+
a: number;
|
|
1318
1132
|
}
|
|
1319
|
-
|
|
1320
1133
|
/**
|
|
1321
|
-
* @
|
|
1134
|
+
* @internal
|
|
1322
1135
|
*/
|
|
1323
|
-
|
|
1324
|
-
|
|
1136
|
+
interface HSL {
|
|
1137
|
+
h: number;
|
|
1138
|
+
s: number;
|
|
1139
|
+
l: number;
|
|
1140
|
+
}
|
|
1325
1141
|
/**
|
|
1326
|
-
*
|
|
1142
|
+
* Apply the \`mix\` blend mode
|
|
1143
|
+
* @internal
|
|
1327
1144
|
*/
|
|
1328
|
-
|
|
1329
|
-
code: ThemeFont
|
|
1330
|
-
heading: ThemeFont
|
|
1331
|
-
label: ThemeFont
|
|
1332
|
-
text: ThemeFont
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1145
|
+
declare function mix(b: RGB | RGBA, s: RGB | RGBA, weight: number): RGB;
|
|
1335
1146
|
/**
|
|
1336
|
-
*
|
|
1147
|
+
* Apply the \`multiply\` blend mode
|
|
1148
|
+
* Source: https://www.w3.org/TR/compositing-1/#blendingmultiply
|
|
1149
|
+
* @internal
|
|
1337
1150
|
*/
|
|
1338
|
-
|
|
1339
|
-
ascenderHeight: number
|
|
1340
|
-
descenderHeight: number
|
|
1341
|
-
fontSize: number
|
|
1342
|
-
iconSize: number
|
|
1343
|
-
letterSpacing: number
|
|
1344
|
-
lineHeight: number
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1151
|
+
declare function multiply(b: RGB | RGBA, s: RGB | RGBA): RGB;
|
|
1347
1152
|
/**
|
|
1348
|
-
*
|
|
1153
|
+
* Apply the \`screen\` blend mode
|
|
1154
|
+
* Source: https://www.w3.org/TR/compositing-1/#blendingscreen
|
|
1155
|
+
* @internal
|
|
1349
1156
|
*/
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
semibold: number
|
|
1354
|
-
bold: number
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1157
|
+
declare function screen(b: RGB | RGBA, s: RGB | RGBA): RGB;
|
|
1158
|
+
/** @internal */
|
|
1159
|
+
declare function getContrastRatio(bg: string, fg: string): number;
|
|
1357
1160
|
/**
|
|
1358
|
-
* @
|
|
1161
|
+
* @internal
|
|
1359
1162
|
*/
|
|
1360
|
-
|
|
1361
|
-
|
|
1163
|
+
declare function hexToRgb(hex: string): RGB;
|
|
1362
1164
|
/**
|
|
1363
|
-
* @
|
|
1364
|
-
* @deprecated Use `ThemeInput_v2` instead
|
|
1165
|
+
* @internal
|
|
1365
1166
|
*/
|
|
1366
|
-
|
|
1367
|
-
checkbox: {
|
|
1368
|
-
size: number
|
|
1369
|
-
}
|
|
1370
|
-
radio: {
|
|
1371
|
-
size: number
|
|
1372
|
-
markSize: number
|
|
1373
|
-
}
|
|
1374
|
-
switch: {
|
|
1375
|
-
width: number
|
|
1376
|
-
height: number
|
|
1377
|
-
padding: number
|
|
1378
|
-
transitionDurationMs: number
|
|
1379
|
-
transitionTimingFunction: string
|
|
1380
|
-
}
|
|
1381
|
-
border: {
|
|
1382
|
-
width: number
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1167
|
+
declare function rgbaToRGBA(rgba: string): RGBA;
|
|
1386
1168
|
/**
|
|
1387
|
-
* @
|
|
1169
|
+
* @internal
|
|
1388
1170
|
*/
|
|
1389
|
-
|
|
1390
|
-
checkbox: {
|
|
1391
|
-
size: number
|
|
1392
|
-
focusRing: ThemeFocusRing
|
|
1393
|
-
}
|
|
1394
|
-
radio: {
|
|
1395
|
-
size: number
|
|
1396
|
-
markSize: number
|
|
1397
|
-
focusRing: ThemeFocusRing
|
|
1398
|
-
}
|
|
1399
|
-
switch: {
|
|
1400
|
-
width: number
|
|
1401
|
-
height: number
|
|
1402
|
-
padding: number
|
|
1403
|
-
transitionDurationMs: number
|
|
1404
|
-
transitionTimingFunction: string
|
|
1405
|
-
focusRing: ThemeFocusRing
|
|
1406
|
-
}
|
|
1407
|
-
border: {
|
|
1408
|
-
width: number
|
|
1409
|
-
}
|
|
1410
|
-
select: {
|
|
1411
|
-
focusRing: ThemeFocusRing
|
|
1412
|
-
}
|
|
1413
|
-
text: {
|
|
1414
|
-
focusRing: ThemeFocusRing
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1171
|
+
declare function rgbToHex(color: RGB | RGBA): string;
|
|
1418
1172
|
/**
|
|
1419
|
-
* @
|
|
1173
|
+
* @internal
|
|
1174
|
+
* @see https://css-tricks.com/converting-color-spaces-in-javascript/
|
|
1420
1175
|
*/
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
zOffset: number
|
|
1427
|
-
}
|
|
1428
|
-
tooltip: {
|
|
1429
|
-
zOffset: number
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1176
|
+
declare function rgbToHsl({
|
|
1177
|
+
r,
|
|
1178
|
+
g,
|
|
1179
|
+
b
|
|
1180
|
+
}: RGB): HSL;
|
|
1433
1181
|
/**
|
|
1434
|
-
* @
|
|
1182
|
+
* @internal
|
|
1435
1183
|
*/
|
|
1436
|
-
|
|
1437
|
-
umbra: ThemeBoxShadow
|
|
1438
|
-
penumbra: ThemeBoxShadow
|
|
1439
|
-
ambient: ThemeBoxShadow
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1184
|
+
declare function hslToRgb(hsl: HSL): RGB;
|
|
1442
1185
|
/**
|
|
1443
1186
|
* @internal
|
|
1444
1187
|
*/
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
root?: CSSObject
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
/** @internal */
|
|
1455
|
-
export declare interface TokenBaseKeyNode {
|
|
1456
|
-
type: 'base'
|
|
1457
|
-
tone: ColorConfigCardTone
|
|
1458
|
-
key: ColorConfigCardKey | ColorConfigBlendKey
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
/** @internal */
|
|
1462
|
-
export declare interface TokenBlendModeValueNode {
|
|
1463
|
-
type: 'blendMode'
|
|
1464
|
-
value?: ThemeColorBlendModeKey
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
/** @internal */
|
|
1468
|
-
export declare interface TokenButtonKeyNode {
|
|
1469
|
-
type: 'button'
|
|
1470
|
-
tone: ColorConfigStateTone
|
|
1471
|
-
mode: ThemeColorButtonModeKey
|
|
1472
|
-
key: ColorConfigStateKey | ColorConfigBlendKey
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
/** @internal */
|
|
1476
|
-
export declare interface TokenColorValueNode {
|
|
1477
|
-
type: 'color'
|
|
1478
|
-
key?: 'black' | 'white'
|
|
1479
|
-
hue?: ColorHueKey
|
|
1480
|
-
mix?: number
|
|
1481
|
-
opacity?: number
|
|
1482
|
-
tint?: ColorTintKey
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1188
|
+
declare function parseColor(color: unknown): RGB | RGBA;
|
|
1189
|
+
/**
|
|
1190
|
+
* @internal
|
|
1191
|
+
*/
|
|
1192
|
+
declare function rgba(color: unknown, a: number): string;
|
|
1485
1193
|
/** @internal */
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1194
|
+
declare function getScopedTheme(themeProp: RootTheme | RootTheme_v2, scheme: ThemeColorSchemeKey, tone: ThemeColorCardToneKey): Theme;
|
|
1195
|
+
/** @public */
|
|
1196
|
+
declare function getTheme_v2(theme: Theme): Theme_v2;
|
|
1491
1197
|
/** @internal */
|
|
1492
|
-
|
|
1493
|
-
|
|
1198
|
+
declare function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme;
|
|
1494
1199
|
/** @internal */
|
|
1495
|
-
|
|
1496
|
-
| TokenColorValueNode
|
|
1497
|
-
| TokenHueValueNode
|
|
1498
|
-
| TokenBlendModeValueNode
|
|
1499
|
-
|
|
1200
|
+
declare function is_v2(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme_v2;
|
|
1500
1201
|
/** @internal */
|
|
1501
|
-
|
|
1502
|
-
|
|
1202
|
+
declare function v0_v2(v0: RootTheme): RootTheme_v2;
|
|
1503
1203
|
/** @internal */
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1204
|
+
declare function v2_v0(v2: RootTheme_v2): RootTheme;
|
|
1205
|
+
export { COLOR_CONFIG_BLEND_KEYS as $, THEME_COLOR_STATE_TONES as $n, ThemeColorGenericState as $t, TokenHueValueNode as A, ThemeColorAvatarHue_v2 as An, ThemeColorScheme as At, ThemeColorInputTokens as B, ThemeColorInputModeKey as Bn, ThemeColorMutedTone as Bt, ThemeConfig as C, ThemeColorButtonMode_v2 as Cn, BaseTheme as Ct, TokenBlendModeValueNode as D, ThemeColorKBD as Dn, Theme_v2 as Dt, TokenBaseKeyNode as E, ThemeColorState_v2 as En, Theme as Et, ThemeColorBadgeTokens as F, isColorTintKey as Fn, ThemeColorSolidTone as Ft, isColorConfigBaseTone as G, THEME_COLOR_AVATAR_COLORS as Gn, ThemeColorCardState as Gt, ThemeColorStatesTokens as H, ThemeColorSchemeKey as Hn, ThemeColorInputState as Ht, ThemeColorBadgeToneTokens as I, ThemeColorAvatarColorKey as In, ThemeColorSelectable as It, isColorConfigStateTone as J, THEME_COLOR_CARD_TONES as Jn, ThemeColorButtonStates as Jt, isColorConfigBlendKey as K, THEME_COLOR_BLEND_MODES as Kn, ThemeColorButton as Kt, ThemeColorBaseTokens as L, ThemeColorBlendModeKey as Ln, ThemeColorSelectableState as Lt, TokenValueNode as M, isColorBlendModeValue as Mn, ThemeColorSpot as Mt, ThemeColorAvatarHueTokens as N, isColorButtonMode as Nn, ThemeColorSpotKey as Nt, TokenButtonKeyNode as O, ThemeColorBadgeTone_v2 as On, ThemeInput as Ot, ThemeColorAvatarTokens as P, isColorHueKey as Pn, ThemeColorSolid as Pt, COLOR_CONFIG_AVATAR_COLORS as Q, THEME_COLOR_STATES as Qn, ThemeColorToneKey as Qt, ThemeColorButtonTokens as R, ThemeColorButtonModeKey as Rn, ThemeColorSelectableStates as Rt, ThemeColorPalette as S, ThemeColorInput_v2 as Sn, createColorTheme as St, parseTokenKey as T, ThemeColorButton_v2 as Tn, RootTheme_v2 as Tt, ThemeColorTokens as U, ThemeColorStateKey as Un, ThemeColorInputStates as Ut, ThemeColorStateTokens as V, ThemeColorInputStateKey as Vn, ThemeColorInput as Vt, isColorConfigBaseKey as W, ThemeColorStateToneKey as Wn, ThemeColorCard as Wt, isColorTokenValue as X, THEME_COLOR_INPUT_STATES as Xn, ThemeColorBase as Xt, isColorOpacityValue as Y, THEME_COLOR_INPUT_MODES as Yn, ThemeColorButtonTones as Yt, isColorValue as Z, THEME_COLOR_SCHEMES as Zn, ThemeColorName as Zt, mix as _, ThemeColorShadow as _n, ColorConfigStateTone as _t, getTheme_v2 as a, ThemeInput_v2 as an, COLOR_CONFIG_STATE_KEYS as at, RGBA as b, ThemeColorInputMode_v2 as bn, PartialThemeColorBuilderOpts as bt, parseColor as c, ThemeFontSize as cn, ColorConfigAvatarColor as ct, rgbToHex as d, ThemeFonts as dn, ColorConfigCardTone as dt, ThemeAvatar as en, ThemeAvatar_v2 as er, COLOR_CONFIG_CARD_KEYS as et, rgbToHsl as f, CSSObject as fn, ColorConfigInputMode as ft, multiply as g, ThemeColorSyntax as gn, ColorConfigStateKey as gt, screen as h, ThemeColorSchemes_v2 as hn, ColorConfigState as ht, is_v0 as i, ThemeLayer as in, COLOR_CONFIG_STATES as it, TokenKeyNode as j, ThemeColorAvatar_v2 as jn, ThemeColorSchemes as jt, TokenColorValueNode as k, ThemeColorBadge_v2 as kn, ThemeColor as kt, hexToRgb as l, ThemeFontWeight as ln, ColorConfigBlendKey as lt, getContrastRatio as m, ThemeColorScheme_v2 as mn, ColorConfigOpacityValue as mt, v0_v2 as n, ThemeBoxShadow as nn, COLOR_CONFIG_INPUT_MODES as nt, getScopedTheme as o, ThemeFont as on, COLOR_CONFIG_STATE_TONES as ot, rgbaToRGBA as p, ThemeColorCard_v2 as pn, ColorConfigInputState as pt, isColorConfigStateKey as q, THEME_COLOR_BUTTON_MODES as qn, ThemeColorButtonState as qt, is_v2 as r, ThemeShadow as rn, COLOR_CONFIG_INPUT_STATES as rt, rgba as s, ThemeFontKey as sn, ColorBlendModeTokenValue as st, v2_v0 as t, ThemeStyles as tn, ThemeFocusRing as tr, COLOR_CONFIG_CARD_TONES as tt, hslToRgb as u, ThemeFontWeightKey as un, ColorConfigCardKey as ut, HSL as v, ThemeColorSelectableTone_v2 as vn, ColorConfigValue as vt, parseTokenValue as w, ThemeColorButtonTone_v2 as wn, RootTheme as wt, buildTheme as x, ThemeColorInputState_v2 as xn, ThemeColorBuilderOpts as xt, RGB as y, ThemeColorSelectable_v2 as yn, ThemeColorTokenValue as yt, ThemeColorInputStateTokens as z, ThemeColorCardToneKey as zn, ThemeColorMuted as zt };
|
|
1206
|
+
//# sourceMappingURL=theme.d.mts.map
|