@sanity/ui 3.0.0-static.18 → 3.0.0-static.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.cjs +137 -136
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/buildCommand.cjs +21 -22
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +138 -137
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_visual-editing.d.cts +12 -22
- package/dist/_visual-editing.d.ts +12 -22
- package/dist/cli.cjs +1 -1
- package/dist/css.cjs +1589 -2017
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +9423 -874
- package/dist/css.d.ts +9423 -874
- package/dist/css.js +1591 -2019
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +28 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +30 -42
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +2749 -2756
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +242 -161
- package/dist/theme.d.ts +242 -161
- package/dist/theme.js +2750 -2757
- package/dist/theme.js.map +1 -1
- package/dist/ui-system.css +15719 -16097
- package/dist/ui-system.min.css +1 -1
- package/dist/ui-theme.css +850 -4568
- package/dist/ui-theme.min.css +1 -1
- package/dist/ui.css +16569 -20772
- package/dist/ui.min.css +1 -1
- package/package.json +10 -15
- package/src/cli/buildCommand.ts +13 -30
- package/src/core/StyleTags.tsx +4 -12
- package/src/core/_compat/styles/_responsive.ts +1 -1
- package/src/core/_compat/theme/theme.test.tsx +4 -5
- package/src/core/_compat/theme/themeColorProvider.tsx +2 -2
- package/src/core/_compat/theme/themeContext.ts +2 -2
- package/src/core/_compat/theme/themeProvider.tsx +2 -2
- package/src/core/_compat/theme/types.ts +1 -1
- package/src/core/_compat/theme/useRootTheme.ts +1 -1
- package/src/core/_compat/theme/useTheme.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/custom.tsx +11 -11
- package/src/core/components/autocomplete/__workshop__/example.tsx +6 -7
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +5 -5
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
- package/src/core/components/autocomplete/constants.ts +1 -1
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +7 -7
- package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
- package/src/core/components/dialog/__workshop__/position.tsx +1 -1
- package/src/core/components/dialog/__workshop__/props.tsx +1 -1
- package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
- package/src/core/components/dialog/dialog.tsx +15 -8
- package/src/core/components/dialog/dialogCard.tsx +18 -3
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +3 -3
- package/src/core/components/dialog/useDialog.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +4 -4
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
- package/src/core/components/menu/__workshop__/groups.tsx +2 -2
- package/src/core/components/menu/__workshop__/menuButton.tsx +1 -1
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
- package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
- package/src/core/components/menu/menu.test.tsx +6 -7
- package/src/core/components/menu/menu.tsx +2 -2
- package/src/core/components/menu/menuButton.tsx +9 -9
- package/src/core/components/menu/menuContext.ts +1 -1
- package/src/core/components/menu/menuDivider.tsx +3 -3
- package/src/core/components/menu/menuGroup.tsx +9 -9
- package/src/core/components/menu/menuItem.tsx +9 -6
- package/src/core/components/menu/useMenu.ts +1 -1
- package/src/core/components/menu/useMenuController.ts +4 -4
- package/src/core/components/skeleton/__workshop__/delay.tsx +1 -1
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/components/skeleton/codeSkeleton.tsx +5 -5
- package/src/core/components/skeleton/headingSkeleton.tsx +5 -5
- package/src/core/components/skeleton/labelSkeleton.tsx +5 -5
- package/src/core/components/skeleton/skeleton.tsx +4 -4
- package/src/core/components/skeleton/textSkeleton.tsx +5 -5
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/tab/tab.tsx +7 -7
- package/src/core/components/tab/tabList.tsx +14 -7
- package/src/core/components/tab/tabPanel.tsx +10 -7
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/toast.test.tsx +5 -5
- package/src/core/components/toast/toast.tsx +6 -7
- package/src/core/components/toast/toastContext.ts +1 -1
- package/src/core/components/toast/toastLayer.tsx +2 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/toast/types.ts +1 -1
- package/src/core/components/toast/useToast.ts +1 -1
- package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/core/components/tree/__workshop__/basic.tsx +1 -1
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/helpers.ts +1 -1
- package/src/core/components/tree/tree.tsx +6 -6
- package/src/core/components/tree/treeContext.ts +1 -1
- package/src/core/components/tree/treeGroup.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +15 -15
- package/src/core/components/tree/types.ts +2 -2
- package/src/core/components/tree/useTree.ts +1 -1
- package/src/core/hooks/useClickOutside.test.tsx +15 -16
- package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
- package/src/core/hooks/useDelayed.test.ts +6 -7
- package/src/core/hooks/useDelayedState.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useForwardedRef.ts +1 -1
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -2
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersDark.test.tsx +1 -0
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
- package/src/core/middleware/origin.ts +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +3 -3
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +6 -6
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
- package/src/core/primitives/avatar/avatarStack.tsx +7 -7
- package/src/core/primitives/avatar/types.ts +1 -3
- package/src/core/primitives/badge/badge.test.tsx +2 -3
- package/src/core/primitives/badge/badge.tsx +3 -3
- package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
- package/src/core/primitives/box/box.tsx +4 -2
- package/src/core/primitives/button/__workshop__/custom.tsx +2 -2
- package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
- package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
- package/src/core/primitives/button/__workshop__/props.tsx +3 -4
- package/src/core/primitives/button/__workshop__/stacked.tsx +4 -5
- package/src/core/primitives/button/button.test.tsx +2 -3
- package/src/core/primitives/button/button.tsx +11 -6
- package/src/core/primitives/card/__workshop__/asButton.tsx +16 -7
- package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
- package/src/core/primitives/card/__workshop__/index.ts +1 -1
- package/src/core/primitives/card/__workshop__/interactive.tsx +1 -1
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +3 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
- package/src/core/primitives/card/card.tsx +4 -4
- package/src/core/primitives/card/cardContext.ts +2 -2
- package/src/core/primitives/card/cardProvider.tsx +3 -3
- package/src/core/primitives/card/types.ts +2 -2
- package/src/core/primitives/card/useCard.ts +2 -1
- package/src/core/primitives/checkbox/__workshop__/props.tsx +2 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
- package/src/core/primitives/checkbox/checkbox.tsx +5 -7
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/code.tsx +3 -3
- package/src/core/primitives/container/container.tsx +4 -4
- package/src/core/primitives/flex/flex.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +2 -2
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +2 -2
- package/src/core/primitives/inline/types.ts +1 -0
- package/src/core/primitives/kbd/kbd.tsx +5 -5
- package/src/core/primitives/label/label.tsx +5 -5
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -4
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -3
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +2 -2
- package/src/core/primitives/popover/helpers.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +1 -1
- package/src/core/primitives/popover/popoverLayer.tsx +4 -4
- package/src/core/primitives/popover/types.ts +3 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +5 -5
- package/src/core/primitives/select/__workshop__/plain.tsx +15 -3
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +4 -10
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -2
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +3 -3
- package/src/core/primitives/spinner/spinner.tsx +3 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +5 -5
- package/src/core/primitives/switch/switch.tsx +3 -3
- package/src/core/primitives/text/__workshop__/colored.tsx +5 -5
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +6 -6
- package/src/core/primitives/textArea/__workshop__/plain.tsx +35 -23
- package/src/core/primitives/textArea/textArea.tsx +14 -5
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +9 -15
- package/src/core/primitives/textInput/__workshop__/states.tsx +4 -4
- package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +13 -11
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +2 -2
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +5 -4
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
- package/src/core/primitives/tooltip/tooltip.tsx +11 -6
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -3
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +4 -4
- package/src/core/primitives/types.ts +15 -24
- package/src/core/types/badge.ts +1 -1
- package/src/core/types/button.ts +1 -1
- package/src/core/types/card.ts +1 -1
- package/src/core/types/selectable.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +5 -14
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -2
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -1
- package/src/core/utils/errorBoundary.tsx +4 -4
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
- package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
- package/src/core/utils/layer/getLayerContext.test.ts +3 -1
- package/src/core/utils/layer/getLayerContext.ts +1 -1
- package/src/core/utils/layer/layer.test.tsx +5 -5
- package/src/core/utils/layer/layer.tsx +2 -2
- package/src/core/utils/layer/layerCard.tsx +3 -3
- package/src/core/utils/layer/layerContext.ts +1 -1
- package/src/core/utils/layer/layerProvider.tsx +10 -2
- package/src/core/utils/layer/useLayer.ts +1 -1
- package/src/core/utils/portal/__workshop__/named.tsx +3 -3
- package/src/core/utils/portal/portal.test.tsx +5 -5
- package/src/core/utils/portal/portal.tsx +3 -2
- package/src/core/utils/portal/portalContext.ts +1 -1
- package/src/core/utils/portal/portalProvider.tsx +2 -2
- package/src/core/utils/portal/usePortal.ts +1 -1
- package/src/core/utils/srOnly/srOnly.tsx +3 -3
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +3 -3
- package/src/css/_assign.ts +3 -0
- package/src/css/_compileStyle.ts +12 -4
- package/src/css/_compileTheme.ts +10 -13
- package/src/css/_composeClassNames.ts +12 -0
- package/src/css/_fromEntries.ts +3 -0
- package/src/css/_getClassNames.ts +9 -0
- package/src/css/_hash.ts +9 -0
- package/src/css/_mergeStyles.ts +1 -1
- package/src/css/_resp.ts +6 -12
- package/src/css/_scopeClassName.ts +9 -0
- package/src/css/_scopeClassNames.ts +12 -0
- package/src/css/_system.style.ts +2 -0
- package/src/css/aspects/border/border.style.ts +2 -2
- package/src/css/aspects/border/border.ts +3 -3
- package/src/css/aspects/border/types.ts +1 -1
- package/src/css/aspects/boxSizing/boxSizing.style.ts +10 -0
- package/src/css/aspects/boxSizing/boxSizing.ts +8 -0
- package/src/css/aspects/boxSizing/index.ts +2 -0
- package/src/css/aspects/boxSizing/types.ts +9 -0
- package/src/css/aspects/display/display.style.ts +8 -8
- package/src/css/aspects/display/display.ts +3 -3
- package/src/css/aspects/display/types.ts +1 -1
- package/src/css/aspects/flex/flex.ts +3 -3
- package/src/css/aspects/flex/types.ts +1 -1
- package/src/css/aspects/flexItem/flex.style.ts +1 -1
- package/src/css/aspects/flexItem/flexItem.ts +3 -3
- package/src/css/aspects/flexItem/types.ts +1 -1
- package/src/css/aspects/font/font.style.ts +33 -22
- package/src/css/aspects/font/font.ts +3 -3
- package/src/css/aspects/font/types.ts +1 -1
- package/src/css/aspects/gap/gap.style.ts +2 -2
- package/src/css/aspects/gap/gap.ts +3 -3
- package/src/css/aspects/gap/types.ts +2 -2
- package/src/css/aspects/grid/grid.ts +3 -3
- package/src/css/aspects/grid/types.ts +1 -1
- package/src/css/aspects/gridItem/gridItem.ts +3 -3
- package/src/css/aspects/gridItem/types.ts +1 -1
- package/src/css/aspects/height/height.ts +3 -3
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/inset/inset.ts +3 -3
- package/src/css/aspects/inset/types.ts +1 -1
- package/src/css/aspects/margin/margin.style.ts +10 -10
- package/src/css/aspects/margin/margin.ts +3 -3
- package/src/css/aspects/margin/types.ts +1 -1
- package/src/css/aspects/maxWidth/maxWidth.style.ts +1 -1
- package/src/css/aspects/maxWidth/maxWidth.ts +4 -3
- package/src/css/aspects/maxWidth/types.ts +2 -2
- package/src/css/aspects/minWidth/minWidth.ts +4 -3
- package/src/css/aspects/minWidth/types.ts +1 -1
- package/src/css/aspects/overflow/overflow.ts +3 -3
- package/src/css/aspects/overflow/types.ts +1 -1
- package/src/css/aspects/padding/padding.style.ts +2 -5
- package/src/css/aspects/padding/padding.ts +3 -3
- package/src/css/aspects/padding/types.ts +2 -2
- package/src/css/aspects/pointerEvents/pointerEvents.ts +3 -3
- package/src/css/aspects/position/position.ts +3 -3
- package/src/css/aspects/position/types.ts +1 -1
- package/src/css/aspects/radius/radius.style.ts +1 -1
- package/src/css/aspects/radius/radius.ts +3 -3
- package/src/css/aspects/radius/types.ts +2 -2
- package/src/css/aspects/shadow/shadow.style.ts +7 -7
- package/src/css/aspects/shadow/shadow.ts +3 -3
- package/src/css/aspects/shadow/types.ts +2 -2
- package/src/css/aspects/textAlign/textAlign.style.ts +1 -1
- package/src/css/aspects/textAlign/textAlign.ts +3 -3
- package/src/css/aspects/textOverflow/textOverflow.ts +3 -3
- package/src/css/aspects/width/types.ts +2 -2
- package/src/css/aspects/width/width.style.ts +1 -1
- package/src/css/aspects/width/width.ts +4 -3
- package/src/css/components/breadcrumbs/breadcrumbs.style.ts +1 -1
- package/src/css/components/breadcrumbs/breadcrumbs.ts +2 -2
- package/src/css/components/dialog/dialog.style.ts +14 -16
- package/src/css/components/dialog/dialog.ts +9 -8
- package/src/css/components/menu/menu.style.ts +2 -2
- package/src/css/components/menu/menu.ts +3 -3
- package/src/css/components/skeleton/skeleton.style.ts +24 -17
- package/src/css/components/skeleton/skeleton.ts +8 -7
- package/src/css/components/skeleton/types.ts +4 -6
- package/src/css/components/toast/toast.style.ts +1 -1
- package/src/css/components/toast/toast.ts +6 -6
- package/src/css/components/tree/tree.style.ts +7 -23
- package/src/css/components/tree/tree.ts +2 -2
- package/src/css/constants.ts +0 -3
- package/src/css/index.ts +3 -5
- package/src/css/prefix/constants.ts +6 -0
- package/src/css/prefix/types.ts +1 -0
- package/src/css/primitives/_arrow/_arrow.style.ts +11 -13
- package/src/css/primitives/_arrow/_arrow.ts +5 -5
- package/src/css/primitives/_input/_input.style.ts +171 -75
- package/src/css/primitives/_input/input.ts +13 -10
- package/src/css/primitives/_input/types.ts +3 -3
- package/src/css/primitives/_selectable/_selectable.style.ts +5 -6
- package/src/css/primitives/_selectable/selectable.ts +4 -3
- package/src/css/primitives/_selectable/types.ts +2 -2
- package/src/css/primitives/avatar/avatar.style.ts +38 -39
- package/src/css/primitives/avatar/avatar.ts +8 -8
- package/src/css/primitives/avatar/types.ts +3 -3
- package/src/css/primitives/badge/badge.style.ts +2 -3
- package/src/css/primitives/badge/badge.ts +7 -3
- package/src/css/primitives/badge/types.ts +2 -2
- package/src/css/primitives/box/box.style.ts +5 -15
- package/src/css/primitives/box/box.ts +7 -9
- package/src/css/primitives/box/types.ts +3 -6
- package/src/css/primitives/button/button.style.ts +189 -162
- package/src/css/primitives/button/button.ts +11 -4
- package/src/css/primitives/button/types.ts +1 -1
- package/src/css/primitives/card/card.style.ts +102 -68
- package/src/css/primitives/card/card.ts +5 -7
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.style.ts +125 -101
- package/src/css/primitives/checkbox/checkbox.ts +3 -3
- package/src/css/primitives/code/code.style.ts +24 -26
- package/src/css/primitives/code/code.ts +7 -3
- package/src/css/primitives/code/types.ts +2 -2
- package/src/css/primitives/container/container.style.ts +1 -1
- package/src/css/primitives/container/container.ts +4 -3
- package/src/css/primitives/container/types.ts +2 -2
- package/src/css/primitives/heading/heading.style.ts +31 -23
- package/src/css/primitives/heading/heading.ts +10 -8
- package/src/css/primitives/heading/types.ts +3 -2
- package/src/css/primitives/kbd/kbd.style.ts +7 -7
- package/src/css/primitives/kbd/kbd.ts +4 -3
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.style.ts +27 -24
- package/src/css/primitives/label/label.ts +5 -8
- package/src/css/primitives/label/types.ts +4 -3
- package/src/css/primitives/popover/popover.style.ts +6 -2
- package/src/css/primitives/popover/popover.ts +3 -3
- package/src/css/primitives/radio/radio.style.ts +37 -76
- package/src/css/primitives/radio/radio.ts +2 -2
- package/src/css/primitives/select/select.style.ts +3 -3
- package/src/css/primitives/select/select.ts +5 -5
- package/src/css/primitives/select/types.ts +1 -1
- package/src/css/primitives/spinner/spinner.style.ts +1 -1
- package/src/css/primitives/spinner/spinner.ts +3 -3
- package/src/css/primitives/stack/stack.style.ts +6 -2
- package/src/css/primitives/stack/stack.ts +2 -2
- package/src/css/primitives/switch/switch.style.ts +47 -39
- package/src/css/primitives/switch/switch.ts +6 -6
- package/src/css/primitives/text/text.style.ts +28 -23
- package/src/css/primitives/text/text.ts +5 -8
- package/src/css/primitives/text/types.ts +2 -2
- package/src/css/primitives/textArea/textArea.style.ts +6 -2
- package/src/css/primitives/textArea/textArea.ts +4 -4
- package/src/css/primitives/textArea/types.ts +1 -1
- package/src/css/primitives/textInput/textInput.style.ts +23 -17
- package/src/css/primitives/textInput/textInput.ts +4 -4
- package/src/css/primitives/textInput/types.ts +2 -8
- package/src/css/primitives/token/token.style.ts +4 -4
- package/src/css/primitives/tooltip/tooltip.style.ts +5 -4
- package/src/css/primitives/tooltip/tooltip.ts +3 -3
- package/src/css/renderColor.ts +31 -0
- package/src/css/theme/index.ts +14 -0
- package/src/css/theme/lib/contract/buildVarContract.ts +76 -0
- package/src/css/theme/lib/contract/index.ts +2 -0
- package/src/css/theme/lib/contract/types.ts +15 -0
- package/src/css/theme/resolveTheme.ts +852 -0
- package/src/css/types.ts +25 -914
- package/src/css/utils/srOnly/srOnly.style.ts +1 -1
- package/src/css/utils/srOnly/srOnly.ts +3 -3
- package/src/theme/getScopedTheme.ts +4 -4
- package/src/theme/index.ts +0 -5
- package/src/theme/types.ts +4 -4
- package/src/theme/v0/color/_generic.ts +1 -1
- package/src/theme/v0/color/button.ts +1 -1
- package/src/theme/v0/color/card.ts +1 -1
- package/src/theme/v0/color/color.ts +11 -11
- package/src/theme/v0/color/input.ts +1 -1
- package/src/theme/v0/color/muted.ts +1 -1
- package/src/theme/v0/color/selectable.ts +1 -1
- package/src/theme/v0/color/solid.ts +1 -1
- package/src/theme/v0/color/spot.ts +1 -1
- package/src/theme/v0/styles.ts +1 -1
- package/src/theme/v0/theme.ts +7 -7
- package/src/theme/v2/avatar.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
- package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
- package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
- package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
- package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
- package/src/theme/{build → v2/build}/buildTheme.ts +4 -4
- package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
- package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
- package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
- package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
- package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
- package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
- package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
- package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
- package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
- package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
- package/src/theme/v2/color/_helpers.ts +2 -2
- package/src/theme/v2/color/_system.ts +1 -1
- package/src/theme/v2/color/avatar.ts +1 -1
- package/src/theme/v2/color/badge.ts +1 -1
- package/src/theme/v2/color/button.ts +2 -2
- package/src/theme/v2/color/color.ts +7 -7
- package/src/theme/v2/color/input.ts +5 -1
- package/src/theme/v2/color/selectable.ts +2 -2
- package/src/theme/v2/color/state.ts +4 -4
- package/src/theme/{config → v2/config}/helpers.ts +6 -13
- package/src/theme/{config → v2/config}/system.ts +11 -12
- package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
- package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
- package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
- package/src/theme/{config → v2/config}/types.ts +8 -6
- package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/colorTokens.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/config.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/fonts.ts +1 -1
- package/src/theme/v2/index.ts +2 -0
- package/src/theme/v2/input.ts +1 -1
- package/src/theme/v2/theme.ts +8 -8
- package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
- package/src/theme/v3/_parseColorToken.ts +185 -0
- package/src/theme/v3/buildTheme_v3.ts +11 -7
- package/src/theme/v3/color/_constants.ts +15 -0
- package/src/theme/v3/color/avatar.ts +14 -0
- package/src/theme/v3/color/card.ts +53 -53
- package/src/theme/v3/color/color.ts +66 -68
- package/src/theme/v3/color/element.ts +8 -8
- package/src/theme/v3/color/index.ts +2 -2
- package/src/theme/v3/color/token.ts +18 -4
- package/src/theme/v3/color/tokens.ts +2 -2
- package/src/theme/v3/defaultTokens.ts +73 -85
- package/src/theme/v3/index.ts +3 -0
- package/src/theme/v3/palette/index.ts +2 -0
- package/src/theme/v3/resolveTokens.ts +65 -65
- package/src/theme/v3/tokens.ts +2 -2
- package/src/theme/v3/types.ts +61 -7
- package/src/theme/versioning/getTheme_v2.ts +3 -3
- package/src/theme/versioning/is_v0.ts +2 -2
- package/src/theme/versioning/is_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
- package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
- package/src/theme/versioning/v0_v2.ts +3 -3
- package/src/theme/versioning/v2_v0.ts +4 -4
- package/src/theme/versioning/v3_v2.ts +38 -38
- package/dist/ui-palette.css +0 -105
- package/dist/ui-palette.min.css +0 -1
- package/src/css/_comp.test.ts +0 -7
- package/src/css/_comp.ts +0 -11
- package/src/css/_compilePalette.ts +0 -32
- package/src/css/_compileTheme_v3.ts +0 -440
- package/src/css/aspects/flex/flex.style.ts +0 -30
- package/src/css/composeClassNames.ts +0 -19
- package/src/css/primitives/_selectable/__style.ts +0 -117
- package/src/css/primitives/checkbox/__styles.ts +0 -129
- package/src/css/scopeClassName.ts +0 -7
- package/src/css/varNames.ts +0 -607
- package/src/css/vars.ts +0 -520
- package/src/theme/_types.ts +0 -41
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/v3/buildTheme_v3.test.ts +0 -40
- package/src/theme/v3/color/buildColor_v3.ts +0 -226
- package/src/theme/v3/color/parseColor.test.ts +0 -79
- package/src/theme/v3/color/parseColor.ts +0 -167
- package/src/theme/v3/color/renderColor.test.ts +0 -20
- package/src/theme/v3/color/renderColor.ts +0 -43
- /package/src/{theme/palette → css/prefix}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
- /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
- /package/src/theme/{build → v2/build}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
- /package/src/theme/{build → v2/build}/merge.ts +0 -0
- /package/src/theme/{config → v2/config}/index.ts +0 -0
- /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
- /package/src/theme/{palette → v3/palette}/constants.ts +0 -0
- /package/src/theme/{palette → v3/palette}/types.ts +0 -0
package/dist/theme.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
import {ColorHueKey} from '@sanity/color'
|
|
2
|
-
import {
|
|
2
|
+
import type {ColorHues} from '@sanity/color'
|
|
3
|
+
import type {ColorTint} from '@sanity/color'
|
|
3
4
|
import {ColorTintKey} from '@sanity/color'
|
|
5
|
+
import type {Hue as Hue_2} from '@sanity/ui/theme'
|
|
4
6
|
import type {StyledObject} from 'styled-components'
|
|
5
7
|
|
|
8
|
+
/** @public */
|
|
9
|
+
export declare const AVATAR_COLORS: readonly [
|
|
10
|
+
'gray',
|
|
11
|
+
'blue',
|
|
12
|
+
'purple',
|
|
13
|
+
'magenta',
|
|
14
|
+
'red',
|
|
15
|
+
'orange',
|
|
16
|
+
'yellow',
|
|
17
|
+
'green',
|
|
18
|
+
'cyan',
|
|
19
|
+
]
|
|
20
|
+
|
|
6
21
|
/** @public */
|
|
7
22
|
export declare const AVATAR_SIZE: readonly [0, 1, 2, 3]
|
|
8
23
|
|
|
24
|
+
/** @public */
|
|
25
|
+
export declare type AvatarColor = (typeof AVATAR_COLORS)[number]
|
|
26
|
+
|
|
9
27
|
/** @public */
|
|
10
28
|
export declare type AvatarSize = (typeof AVATAR_SIZE)[number]
|
|
11
29
|
|
|
12
30
|
/** @public */
|
|
13
31
|
export declare type BaseTheme = RootTheme
|
|
14
32
|
|
|
15
|
-
/** @internal */
|
|
16
|
-
export declare function buildColor_v3(tokens: ColorTokens): ThemeColor_v3
|
|
17
|
-
|
|
18
33
|
/** @internal */
|
|
19
34
|
export declare function buildTheme(_config?: ThemeConfig): RootTheme
|
|
20
35
|
|
|
@@ -28,66 +43,66 @@ export declare interface CardColorTokens {
|
|
|
28
43
|
Hue,
|
|
29
44
|
{
|
|
30
45
|
_hue: Hue
|
|
31
|
-
bg:
|
|
32
|
-
fg:
|
|
46
|
+
bg: ColorValue
|
|
47
|
+
fg: ColorValue
|
|
33
48
|
}
|
|
34
49
|
>
|
|
35
|
-
backdrop:
|
|
50
|
+
backdrop: ColorValue
|
|
36
51
|
code: {
|
|
37
|
-
bg:
|
|
38
|
-
fg:
|
|
52
|
+
bg: ColorValue
|
|
53
|
+
fg: ColorValue
|
|
39
54
|
token: {
|
|
40
|
-
atrule:
|
|
41
|
-
attrName:
|
|
42
|
-
attrValue:
|
|
43
|
-
attribute:
|
|
44
|
-
boolean:
|
|
45
|
-
builtin:
|
|
46
|
-
cdata:
|
|
47
|
-
char:
|
|
48
|
-
class:
|
|
49
|
-
className:
|
|
50
|
-
comment:
|
|
51
|
-
constant:
|
|
52
|
-
deleted:
|
|
53
|
-
doctype:
|
|
54
|
-
entity:
|
|
55
|
-
function:
|
|
56
|
-
hexcode:
|
|
57
|
-
id:
|
|
58
|
-
important:
|
|
59
|
-
inserted:
|
|
60
|
-
keyword:
|
|
61
|
-
number:
|
|
62
|
-
operator:
|
|
63
|
-
prolog:
|
|
64
|
-
property:
|
|
65
|
-
pseudoClass:
|
|
66
|
-
pseudoElement:
|
|
67
|
-
punctuation:
|
|
68
|
-
regex:
|
|
69
|
-
selector:
|
|
70
|
-
string:
|
|
71
|
-
symbol:
|
|
72
|
-
tag:
|
|
73
|
-
unit:
|
|
74
|
-
url:
|
|
75
|
-
variable:
|
|
55
|
+
atrule: ColorValue
|
|
56
|
+
attrName: ColorValue
|
|
57
|
+
attrValue: ColorValue
|
|
58
|
+
attribute: ColorValue
|
|
59
|
+
boolean: ColorValue
|
|
60
|
+
builtin: ColorValue
|
|
61
|
+
cdata: ColorValue
|
|
62
|
+
char: ColorValue
|
|
63
|
+
class: ColorValue
|
|
64
|
+
className: ColorValue
|
|
65
|
+
comment: ColorValue
|
|
66
|
+
constant: ColorValue
|
|
67
|
+
deleted: ColorValue
|
|
68
|
+
doctype: ColorValue
|
|
69
|
+
entity: ColorValue
|
|
70
|
+
function: ColorValue
|
|
71
|
+
hexcode: ColorValue
|
|
72
|
+
id: ColorValue
|
|
73
|
+
important: ColorValue
|
|
74
|
+
inserted: ColorValue
|
|
75
|
+
keyword: ColorValue
|
|
76
|
+
number: ColorValue
|
|
77
|
+
operator: ColorValue
|
|
78
|
+
prolog: ColorValue
|
|
79
|
+
property: ColorValue
|
|
80
|
+
pseudoClass: ColorValue
|
|
81
|
+
pseudoElement: ColorValue
|
|
82
|
+
punctuation: ColorValue
|
|
83
|
+
regex: ColorValue
|
|
84
|
+
selector: ColorValue
|
|
85
|
+
string: ColorValue
|
|
86
|
+
symbol: ColorValue
|
|
87
|
+
tag: ColorValue
|
|
88
|
+
unit: ColorValue
|
|
89
|
+
url: ColorValue
|
|
90
|
+
variable: ColorValue
|
|
76
91
|
}
|
|
77
92
|
}
|
|
78
|
-
focusRing:
|
|
93
|
+
focusRing: ColorValue
|
|
79
94
|
link: {
|
|
80
|
-
fg:
|
|
95
|
+
fg: ColorValue
|
|
81
96
|
}
|
|
82
97
|
shadow: {
|
|
83
|
-
outline:
|
|
84
|
-
umbra:
|
|
85
|
-
penumbra:
|
|
86
|
-
ambient:
|
|
98
|
+
outline: ColorValue
|
|
99
|
+
umbra: ColorValue
|
|
100
|
+
penumbra: ColorValue
|
|
101
|
+
ambient: ColorValue
|
|
87
102
|
}
|
|
88
103
|
skeleton: {
|
|
89
|
-
from:
|
|
90
|
-
to:
|
|
104
|
+
from: ColorValue
|
|
105
|
+
to: ColorValue
|
|
91
106
|
}
|
|
92
107
|
variant: {
|
|
93
108
|
solid: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
|
|
@@ -193,6 +208,9 @@ export declare const COLOR_CONFIG_STATES: readonly [
|
|
|
193
208
|
'disabled',
|
|
194
209
|
]
|
|
195
210
|
|
|
211
|
+
/** @public */
|
|
212
|
+
export declare const COLOR_VARIANTS: readonly ['tinted', 'solid']
|
|
213
|
+
|
|
196
214
|
/** @public */
|
|
197
215
|
export declare type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey]
|
|
198
216
|
|
|
@@ -232,14 +250,40 @@ export declare type ColorConfigValue =
|
|
|
232
250
|
| `white`
|
|
233
251
|
| `black/${ColorConfigOpacityValue}`
|
|
234
252
|
| `white/${ColorConfigOpacityValue}`
|
|
235
|
-
| `${
|
|
236
|
-
| `${
|
|
237
|
-
| `${
|
|
238
|
-
| `${
|
|
239
|
-
| `${
|
|
240
|
-
| `${
|
|
241
|
-
| `${
|
|
242
|
-
| `${
|
|
253
|
+
| `${Hue}`
|
|
254
|
+
| `${Hue} ${number}%`
|
|
255
|
+
| `${Hue}/${Tint}`
|
|
256
|
+
| `${Hue}/${Tint} ${number}%`
|
|
257
|
+
| `${Hue}/${Tint}/${ColorConfigOpacityValue}`
|
|
258
|
+
| `${Tint}`
|
|
259
|
+
| `${Tint} ${number}%`
|
|
260
|
+
| `${Tint}/${ColorConfigOpacityValue}`
|
|
261
|
+
|
|
262
|
+
/** @internal */
|
|
263
|
+
export declare interface ColorInheritNode {
|
|
264
|
+
type: 'inherit'
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** @internal */
|
|
268
|
+
export declare interface ColorNode {
|
|
269
|
+
type: 'color'
|
|
270
|
+
name: 'black' | 'white'
|
|
271
|
+
/** Between 0 and 1 */
|
|
272
|
+
opacity: number
|
|
273
|
+
/** Between 0 and 1 */
|
|
274
|
+
mix: number
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** @internal */
|
|
278
|
+
export declare interface ColorTintNode {
|
|
279
|
+
type: 'tint'
|
|
280
|
+
hue: Hue
|
|
281
|
+
tint: Tint
|
|
282
|
+
/** Between 0 and 1 */
|
|
283
|
+
opacity: number
|
|
284
|
+
/** Between 0 and 1 */
|
|
285
|
+
mix: number
|
|
286
|
+
}
|
|
243
287
|
|
|
244
288
|
/** @public */
|
|
245
289
|
export declare type ColorToken =
|
|
@@ -248,9 +292,9 @@ export declare type ColorToken =
|
|
|
248
292
|
| `black/${ColorTokenOpacityValue}`
|
|
249
293
|
| `white`
|
|
250
294
|
| `white/${ColorTokenOpacityValue}`
|
|
251
|
-
| `${Hue}
|
|
252
|
-
| `${Hue}
|
|
253
|
-
| `${Hue}
|
|
295
|
+
| `${Hue}-${Tint}`
|
|
296
|
+
| `${Hue}-${Tint}/${ColorTokenOpacityValue}`
|
|
297
|
+
| `${Hue}-${Tint} ${number}%`
|
|
254
298
|
| `${Tint}`
|
|
255
299
|
| `${Tint}/${ColorTokenOpacityValue}`
|
|
256
300
|
| `${Tint} ${number}%`
|
|
@@ -261,9 +305,22 @@ export declare type ColorTokenOpacityValue = `0` | `0.${number}` | `1`
|
|
|
261
305
|
/** @public */
|
|
262
306
|
export declare type ColorTokens = Record<'*' | ThemeColorCardToneKey, CardColorTokens>
|
|
263
307
|
|
|
308
|
+
/**
|
|
309
|
+
* Theme color values are tuples of [light, dark] color tokens.
|
|
310
|
+
*
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
313
|
+
export declare type ColorValue = [ColorToken, ColorToken]
|
|
314
|
+
|
|
264
315
|
/** @public */
|
|
265
316
|
export declare const CONTAINER: readonly [0, 1, 2, 3, 4, 5, 'auto']
|
|
266
317
|
|
|
318
|
+
/** @public */
|
|
319
|
+
export declare const CONTAINER_SCALE: readonly [0, 1, 2, 3, 4, 5]
|
|
320
|
+
|
|
321
|
+
/** @public */
|
|
322
|
+
export declare type ContainerScale = (typeof CONTAINER_SCALE)[number]
|
|
323
|
+
|
|
267
324
|
/** @public */
|
|
268
325
|
export declare type ContainerWidth = (typeof CONTAINER)[number]
|
|
269
326
|
|
|
@@ -282,9 +339,6 @@ export declare function createColorTheme(
|
|
|
282
339
|
*/
|
|
283
340
|
export declare type CSSObject = StyledObject<any>
|
|
284
341
|
|
|
285
|
-
/** @public */
|
|
286
|
-
export declare type CSSVariableKey = `--${string}`
|
|
287
|
-
|
|
288
342
|
/** @internal */
|
|
289
343
|
export declare const defaultTokens: PartialTokens<Tokens>
|
|
290
344
|
|
|
@@ -292,16 +346,16 @@ export declare const defaultTokens: PartialTokens<Tokens>
|
|
|
292
346
|
export declare interface ElementColorTokens {
|
|
293
347
|
_hue: Hue
|
|
294
348
|
bg: {
|
|
295
|
-
0:
|
|
296
|
-
4:
|
|
349
|
+
0: ColorValue
|
|
350
|
+
4: ColorValue
|
|
297
351
|
}
|
|
298
352
|
border: {
|
|
299
|
-
0:
|
|
300
|
-
4:
|
|
353
|
+
0: ColorValue
|
|
354
|
+
4: ColorValue
|
|
301
355
|
}
|
|
302
356
|
fg: {
|
|
303
|
-
0:
|
|
304
|
-
4:
|
|
357
|
+
0: ColorValue
|
|
358
|
+
4: ColorValue
|
|
305
359
|
}
|
|
306
360
|
}
|
|
307
361
|
|
|
@@ -332,7 +386,10 @@ export declare type FontTextSize = (typeof FONT_TEXT_SIZE)[number]
|
|
|
332
386
|
/** @public */
|
|
333
387
|
export declare type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold'
|
|
334
388
|
|
|
335
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* @internal
|
|
391
|
+
* @deprecated Will be removed in next major version
|
|
392
|
+
*/
|
|
336
393
|
export declare function getContrastRatio(bg: string, fg: string): number
|
|
337
394
|
|
|
338
395
|
/** @internal */
|
|
@@ -410,9 +467,6 @@ export declare function isColorOpacityValue(str: string): str is ColorConfigOpac
|
|
|
410
467
|
/** @internal */
|
|
411
468
|
export declare function isColorTintKey(str: string): str is ColorTintKey
|
|
412
469
|
|
|
413
|
-
/** @internal */
|
|
414
|
-
export declare function isColorTokenValue(str: string): str is ColorConfigValue
|
|
415
|
-
|
|
416
470
|
/** @internal */
|
|
417
471
|
export declare function isColorValue(str: string): str is 'black' | 'white'
|
|
418
472
|
|
|
@@ -435,7 +489,12 @@ export declare function multiply(b: RGB | RGBA, s: RGB | RGBA): RGB
|
|
|
435
489
|
export declare function parseColor(color: unknown): RGB | RGBA
|
|
436
490
|
|
|
437
491
|
/** @internal */
|
|
438
|
-
export declare function
|
|
492
|
+
export declare function _parseColorToken(
|
|
493
|
+
str: ColorToken,
|
|
494
|
+
options: {
|
|
495
|
+
defaultHue: Hue
|
|
496
|
+
},
|
|
497
|
+
): TokenizeColorResult
|
|
439
498
|
|
|
440
499
|
/** @internal */
|
|
441
500
|
export declare function parseTokenValue(str: string): TokenValueNode | undefined
|
|
@@ -456,23 +515,27 @@ export declare type PartialTokens<T> = T extends [ColorToken, ColorToken]
|
|
|
456
515
|
: T
|
|
457
516
|
|
|
458
517
|
/** @public */
|
|
459
|
-
export declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6
|
|
518
|
+
export declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6]
|
|
460
519
|
|
|
461
520
|
/** @public */
|
|
462
521
|
export declare type Radius = (typeof RADIUS)[number]
|
|
463
522
|
|
|
464
523
|
/** @public */
|
|
465
|
-
export declare
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
524
|
+
export declare interface ResolvedColorToken {
|
|
525
|
+
color:
|
|
526
|
+
| {
|
|
527
|
+
type: 'inherit'
|
|
528
|
+
}
|
|
529
|
+
| {
|
|
530
|
+
type: 'black' | 'white'
|
|
531
|
+
}
|
|
532
|
+
| {
|
|
533
|
+
type: 'hue'
|
|
534
|
+
hue: Hue
|
|
535
|
+
tint: Tint
|
|
536
|
+
}
|
|
537
|
+
opacity: number
|
|
538
|
+
mix: number
|
|
476
539
|
}
|
|
477
540
|
|
|
478
541
|
/** @internal */
|
|
@@ -638,7 +701,7 @@ export declare const SHADOW: readonly [0, 1, 2, 3, 4, 5]
|
|
|
638
701
|
export declare type Shadow = (typeof SHADOW)[number]
|
|
639
702
|
|
|
640
703
|
/** @public */
|
|
641
|
-
export declare const SPACE: readonly [0,
|
|
704
|
+
export declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
|
642
705
|
|
|
643
706
|
/** @public */
|
|
644
707
|
export declare type Space = (typeof SPACE)[number]
|
|
@@ -755,9 +818,10 @@ export declare interface Theme_v3 {
|
|
|
755
818
|
input: ThemeInput_v2
|
|
756
819
|
layer: ThemeLayer
|
|
757
820
|
media: number[]
|
|
758
|
-
|
|
821
|
+
palette: ThemePalette_v3
|
|
822
|
+
radius: Record<Radius, number>
|
|
759
823
|
shadow: Array<ThemeShadow | null>
|
|
760
|
-
space: number
|
|
824
|
+
space: Record<Space, number>
|
|
761
825
|
}
|
|
762
826
|
|
|
763
827
|
/**
|
|
@@ -803,11 +867,14 @@ export declare interface ThemeColor extends Partial<Omit<ThemeColorGenericState,
|
|
|
803
867
|
}
|
|
804
868
|
|
|
805
869
|
/** @public */
|
|
806
|
-
export declare type ThemeColor_v3 = Record<
|
|
870
|
+
export declare type ThemeColor_v3 = Record<ThemeColorCardToneKey, ThemeColorCard_v3>
|
|
807
871
|
|
|
808
872
|
/** @public */
|
|
809
873
|
export declare type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>
|
|
810
874
|
|
|
875
|
+
/** @public */
|
|
876
|
+
export declare type ThemeColorAvatar_v3 = Record<AvatarColor, ThemeColorAvatarHue_v3>
|
|
877
|
+
|
|
811
878
|
/** @public */
|
|
812
879
|
export declare type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number]
|
|
813
880
|
|
|
@@ -818,10 +885,16 @@ export declare interface ThemeColorAvatarHue_v2 {
|
|
|
818
885
|
fg: string
|
|
819
886
|
}
|
|
820
887
|
|
|
888
|
+
/** @public */
|
|
889
|
+
export declare interface ThemeColorAvatarHue_v3 {
|
|
890
|
+
bg: ColorValue
|
|
891
|
+
fg: ColorValue
|
|
892
|
+
}
|
|
893
|
+
|
|
821
894
|
/** @public */
|
|
822
895
|
export declare interface ThemeColorAvatarHueTokens {
|
|
823
896
|
_blend?: ColorBlendModeTokenValue
|
|
824
|
-
_hue?:
|
|
897
|
+
_hue?: Hue_2
|
|
825
898
|
bg?: ThemeColorTokenValue
|
|
826
899
|
fg?: ThemeColorTokenValue
|
|
827
900
|
}
|
|
@@ -859,7 +932,7 @@ export declare interface ThemeColorBadgeTone_v2 {
|
|
|
859
932
|
/** @public */
|
|
860
933
|
export declare interface ThemeColorBadgeToneTokens {
|
|
861
934
|
_blend?: ColorBlendModeTokenValue
|
|
862
|
-
_hue?:
|
|
935
|
+
_hue?: Hue_2
|
|
863
936
|
bg?: ThemeColorTokenValue
|
|
864
937
|
dot?: ThemeColorTokenValue
|
|
865
938
|
fg?: ThemeColorTokenValue
|
|
@@ -1001,7 +1074,7 @@ export declare interface ThemeColorButtonStates {
|
|
|
1001
1074
|
/** @public */
|
|
1002
1075
|
export declare interface ThemeColorButtonTokens
|
|
1003
1076
|
extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
|
|
1004
|
-
_hue?:
|
|
1077
|
+
_hue?: Hue_2
|
|
1005
1078
|
}
|
|
1006
1079
|
|
|
1007
1080
|
/** @public */
|
|
@@ -1049,60 +1122,63 @@ export declare interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
|
1049
1122
|
/** @public */
|
|
1050
1123
|
export declare interface ThemeColorCard_v3 {
|
|
1051
1124
|
_hue: Hue
|
|
1052
|
-
avatar:
|
|
1053
|
-
backdrop:
|
|
1125
|
+
avatar: ThemeColorAvatar_v3
|
|
1126
|
+
backdrop: ColorValue
|
|
1054
1127
|
code: {
|
|
1055
|
-
bg:
|
|
1056
|
-
fg:
|
|
1128
|
+
bg: ColorValue
|
|
1129
|
+
fg: ColorValue
|
|
1057
1130
|
token: {
|
|
1058
|
-
atrule:
|
|
1059
|
-
attrName:
|
|
1060
|
-
attrValue:
|
|
1061
|
-
attribute:
|
|
1062
|
-
boolean:
|
|
1063
|
-
builtin:
|
|
1064
|
-
cdata:
|
|
1065
|
-
char:
|
|
1066
|
-
class:
|
|
1067
|
-
className:
|
|
1068
|
-
comment:
|
|
1069
|
-
constant:
|
|
1070
|
-
deleted:
|
|
1071
|
-
doctype:
|
|
1072
|
-
entity:
|
|
1073
|
-
function:
|
|
1074
|
-
hexcode:
|
|
1075
|
-
id:
|
|
1076
|
-
important:
|
|
1077
|
-
inserted:
|
|
1078
|
-
keyword:
|
|
1079
|
-
number:
|
|
1080
|
-
operator:
|
|
1081
|
-
prolog:
|
|
1082
|
-
property:
|
|
1083
|
-
pseudoClass:
|
|
1084
|
-
pseudoElement:
|
|
1085
|
-
punctuation:
|
|
1086
|
-
regex:
|
|
1087
|
-
selector:
|
|
1088
|
-
string:
|
|
1089
|
-
symbol:
|
|
1090
|
-
tag:
|
|
1091
|
-
unit:
|
|
1092
|
-
url:
|
|
1093
|
-
variable:
|
|
1131
|
+
atrule: ColorValue
|
|
1132
|
+
attrName: ColorValue
|
|
1133
|
+
attrValue: ColorValue
|
|
1134
|
+
attribute: ColorValue
|
|
1135
|
+
boolean: ColorValue
|
|
1136
|
+
builtin: ColorValue
|
|
1137
|
+
cdata: ColorValue
|
|
1138
|
+
char: ColorValue
|
|
1139
|
+
class: ColorValue
|
|
1140
|
+
className: ColorValue
|
|
1141
|
+
comment: ColorValue
|
|
1142
|
+
constant: ColorValue
|
|
1143
|
+
deleted: ColorValue
|
|
1144
|
+
doctype: ColorValue
|
|
1145
|
+
entity: ColorValue
|
|
1146
|
+
function: ColorValue
|
|
1147
|
+
hexcode: ColorValue
|
|
1148
|
+
id: ColorValue
|
|
1149
|
+
important: ColorValue
|
|
1150
|
+
inserted: ColorValue
|
|
1151
|
+
keyword: ColorValue
|
|
1152
|
+
number: ColorValue
|
|
1153
|
+
operator: ColorValue
|
|
1154
|
+
prolog: ColorValue
|
|
1155
|
+
property: ColorValue
|
|
1156
|
+
pseudoClass: ColorValue
|
|
1157
|
+
pseudoElement: ColorValue
|
|
1158
|
+
punctuation: ColorValue
|
|
1159
|
+
regex: ColorValue
|
|
1160
|
+
selector: ColorValue
|
|
1161
|
+
string: ColorValue
|
|
1162
|
+
symbol: ColorValue
|
|
1163
|
+
tag: ColorValue
|
|
1164
|
+
unit: ColorValue
|
|
1165
|
+
url: ColorValue
|
|
1166
|
+
variable: ColorValue
|
|
1094
1167
|
}
|
|
1095
1168
|
}
|
|
1096
|
-
focusRing:
|
|
1169
|
+
focusRing: ColorValue
|
|
1170
|
+
link: {
|
|
1171
|
+
fg: ColorValue
|
|
1172
|
+
}
|
|
1097
1173
|
shadow: {
|
|
1098
|
-
outline:
|
|
1099
|
-
umbra:
|
|
1100
|
-
penumbra:
|
|
1101
|
-
ambient:
|
|
1174
|
+
outline: ColorValue
|
|
1175
|
+
umbra: ColorValue
|
|
1176
|
+
penumbra: ColorValue
|
|
1177
|
+
ambient: ColorValue
|
|
1102
1178
|
}
|
|
1103
1179
|
skeleton: {
|
|
1104
|
-
from:
|
|
1105
|
-
to:
|
|
1180
|
+
from: ColorValue
|
|
1181
|
+
to: ColorValue
|
|
1106
1182
|
}
|
|
1107
1183
|
variant: Record<ThemeColorVariantKey, ThemeColorVariant>
|
|
1108
1184
|
}
|
|
@@ -1120,16 +1196,16 @@ export declare type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[numb
|
|
|
1120
1196
|
export declare interface ThemeColorElement {
|
|
1121
1197
|
_hue: Hue
|
|
1122
1198
|
bg: {
|
|
1123
|
-
0:
|
|
1124
|
-
4:
|
|
1199
|
+
0: ColorValue
|
|
1200
|
+
4: ColorValue
|
|
1125
1201
|
}
|
|
1126
1202
|
border: {
|
|
1127
|
-
0:
|
|
1128
|
-
4:
|
|
1203
|
+
0: ColorValue
|
|
1204
|
+
4: ColorValue
|
|
1129
1205
|
}
|
|
1130
1206
|
fg: {
|
|
1131
|
-
0:
|
|
1132
|
-
4:
|
|
1207
|
+
0: ColorValue
|
|
1208
|
+
4: ColorValue
|
|
1133
1209
|
}
|
|
1134
1210
|
}
|
|
1135
1211
|
|
|
@@ -1230,7 +1306,7 @@ export declare interface ThemeColorInputStates {
|
|
|
1230
1306
|
/** @public */
|
|
1231
1307
|
export declare interface ThemeColorInputStateTokens {
|
|
1232
1308
|
_blend?: ColorBlendModeTokenValue
|
|
1233
|
-
_hue?:
|
|
1309
|
+
_hue?: Hue_2
|
|
1234
1310
|
bg?: ThemeColorTokenValue
|
|
1235
1311
|
border?: ThemeColorTokenValue
|
|
1236
1312
|
fg?: ThemeColorTokenValue
|
|
@@ -1243,7 +1319,7 @@ export declare interface ThemeColorInputStateTokens {
|
|
|
1243
1319
|
/** @public */
|
|
1244
1320
|
export declare interface ThemeColorInputTokens
|
|
1245
1321
|
extends Partial<Record<ColorConfigInputState, ThemeColorInputStateTokens>> {
|
|
1246
|
-
_hue?:
|
|
1322
|
+
_hue?: Hue_2
|
|
1247
1323
|
}
|
|
1248
1324
|
|
|
1249
1325
|
/** @public */
|
|
@@ -1294,7 +1370,7 @@ export declare type ThemeColorName =
|
|
|
1294
1370
|
export declare type ThemeColorPalette = {
|
|
1295
1371
|
black: string | ColorTint
|
|
1296
1372
|
white: string | ColorTint
|
|
1297
|
-
} & Record<
|
|
1373
|
+
} & Record<Hue, Record<Tint, string | ColorTint>>
|
|
1298
1374
|
|
|
1299
1375
|
/**
|
|
1300
1376
|
* @public
|
|
@@ -1305,11 +1381,6 @@ export declare type ThemeColorScheme = Record<ThemeColorName, ThemeColor>
|
|
|
1305
1381
|
/** @public */
|
|
1306
1382
|
export declare type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
|
|
1307
1383
|
|
|
1308
|
-
/** @public */
|
|
1309
|
-
export declare interface ThemeColorScheme_v3 {
|
|
1310
|
-
card: Record<ThemeColorCardToneKey, ThemeColorCard_v3>
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
1384
|
/** @public */
|
|
1314
1385
|
export declare type ThemeColorSchemeKey = (typeof THEME_COLOR_SCHEMES)[number]
|
|
1315
1386
|
|
|
@@ -1454,7 +1525,7 @@ export declare type ThemeColorStatesTokens = Partial<
|
|
|
1454
1525
|
/** @public */
|
|
1455
1526
|
export declare interface ThemeColorStateTokens {
|
|
1456
1527
|
_blend?: ColorBlendModeTokenValue
|
|
1457
|
-
_hue?:
|
|
1528
|
+
_hue?: Hue_2
|
|
1458
1529
|
accent?: {
|
|
1459
1530
|
fg?: ThemeColorTokenValue
|
|
1460
1531
|
}
|
|
@@ -1538,7 +1609,7 @@ export declare interface ThemeColorTokens {
|
|
|
1538
1609
|
Record<
|
|
1539
1610
|
ColorConfigStateTone,
|
|
1540
1611
|
{
|
|
1541
|
-
_hue?:
|
|
1612
|
+
_hue?: Hue_2
|
|
1542
1613
|
} & ThemeColorStatesTokens
|
|
1543
1614
|
>
|
|
1544
1615
|
>
|
|
@@ -1558,7 +1629,7 @@ export declare type ThemeColorToneKey = ThemeColorName
|
|
|
1558
1629
|
export declare type ThemeColorVariant = Record<ThemeColorStateToneKey, ThemeColorElement>
|
|
1559
1630
|
|
|
1560
1631
|
/** @public */
|
|
1561
|
-
export declare type ThemeColorVariantKey =
|
|
1632
|
+
export declare type ThemeColorVariantKey = (typeof COLOR_VARIANTS)[number]
|
|
1562
1633
|
|
|
1563
1634
|
/** @public */
|
|
1564
1635
|
export declare interface ThemeConfig {
|
|
@@ -1717,6 +1788,13 @@ export declare interface ThemeOptions {
|
|
|
1717
1788
|
tokens?: PartialTokens<Tokens>
|
|
1718
1789
|
}
|
|
1719
1790
|
|
|
1791
|
+
/** @public */
|
|
1792
|
+
export declare interface ThemePalette_v3 {
|
|
1793
|
+
black: ColorTint
|
|
1794
|
+
white: ColorTint
|
|
1795
|
+
hues: ColorHues
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1720
1798
|
/** @public */
|
|
1721
1799
|
export declare interface ThemeShadow {
|
|
1722
1800
|
umbra: ThemeBoxShadow
|
|
@@ -1779,6 +1857,9 @@ export declare interface TokenHueValueNode {
|
|
|
1779
1857
|
value?: ColorHueKey
|
|
1780
1858
|
}
|
|
1781
1859
|
|
|
1860
|
+
/** @internal */
|
|
1861
|
+
export declare type TokenizeColorResult = ColorNode | ColorTintNode | ColorInheritNode
|
|
1862
|
+
|
|
1782
1863
|
/** @internal */
|
|
1783
1864
|
export declare type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode
|
|
1784
1865
|
|