@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {AVATAR_COLORS} from './_constants'
|
|
2
|
+
import type {ColorValue} from './token'
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export type AvatarColor = (typeof AVATAR_COLORS)[number]
|
|
6
|
+
|
|
7
|
+
/** @public */
|
|
8
|
+
export interface ThemeColorAvatarHue_v3 {
|
|
9
|
+
bg: ColorValue
|
|
10
|
+
fg: ColorValue
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** @public */
|
|
14
|
+
export type ThemeColorAvatar_v3 = Record<AvatarColor, ThemeColorAvatarHue_v3>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {ElementColorTokens} from './element'
|
|
4
|
-
import {
|
|
1
|
+
import type {ThemeColorStateToneKey} from '../../v2'
|
|
2
|
+
import type {Hue} from '../palette'
|
|
3
|
+
import type {ElementColorTokens} from './element'
|
|
4
|
+
import type {ColorValue} from './token'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
7
7
|
export interface CardColorTokens {
|
|
@@ -10,66 +10,66 @@ export interface CardColorTokens {
|
|
|
10
10
|
Hue,
|
|
11
11
|
{
|
|
12
12
|
_hue: Hue
|
|
13
|
-
bg:
|
|
14
|
-
fg:
|
|
13
|
+
bg: ColorValue
|
|
14
|
+
fg: ColorValue
|
|
15
15
|
}
|
|
16
16
|
>
|
|
17
|
-
backdrop:
|
|
17
|
+
backdrop: ColorValue
|
|
18
18
|
code: {
|
|
19
|
-
bg:
|
|
20
|
-
fg:
|
|
19
|
+
bg: ColorValue
|
|
20
|
+
fg: ColorValue
|
|
21
21
|
token: {
|
|
22
|
-
atrule:
|
|
23
|
-
attrName:
|
|
24
|
-
attrValue:
|
|
25
|
-
attribute:
|
|
26
|
-
boolean:
|
|
27
|
-
builtin:
|
|
28
|
-
cdata:
|
|
29
|
-
char:
|
|
30
|
-
class:
|
|
31
|
-
className:
|
|
32
|
-
comment:
|
|
33
|
-
constant:
|
|
34
|
-
deleted:
|
|
35
|
-
doctype:
|
|
36
|
-
entity:
|
|
37
|
-
function:
|
|
38
|
-
hexcode:
|
|
39
|
-
id:
|
|
40
|
-
important:
|
|
41
|
-
inserted:
|
|
42
|
-
keyword:
|
|
43
|
-
number:
|
|
44
|
-
operator:
|
|
45
|
-
prolog:
|
|
46
|
-
property:
|
|
47
|
-
pseudoClass:
|
|
48
|
-
pseudoElement:
|
|
49
|
-
punctuation:
|
|
50
|
-
regex:
|
|
51
|
-
selector:
|
|
52
|
-
string:
|
|
53
|
-
symbol:
|
|
54
|
-
tag:
|
|
55
|
-
unit:
|
|
56
|
-
url:
|
|
57
|
-
variable:
|
|
22
|
+
atrule: ColorValue
|
|
23
|
+
attrName: ColorValue
|
|
24
|
+
attrValue: ColorValue
|
|
25
|
+
attribute: ColorValue
|
|
26
|
+
boolean: ColorValue
|
|
27
|
+
builtin: ColorValue
|
|
28
|
+
cdata: ColorValue
|
|
29
|
+
char: ColorValue
|
|
30
|
+
class: ColorValue
|
|
31
|
+
className: ColorValue
|
|
32
|
+
comment: ColorValue
|
|
33
|
+
constant: ColorValue
|
|
34
|
+
deleted: ColorValue
|
|
35
|
+
doctype: ColorValue
|
|
36
|
+
entity: ColorValue
|
|
37
|
+
function: ColorValue
|
|
38
|
+
hexcode: ColorValue
|
|
39
|
+
id: ColorValue
|
|
40
|
+
important: ColorValue
|
|
41
|
+
inserted: ColorValue
|
|
42
|
+
keyword: ColorValue
|
|
43
|
+
number: ColorValue
|
|
44
|
+
operator: ColorValue
|
|
45
|
+
prolog: ColorValue
|
|
46
|
+
property: ColorValue
|
|
47
|
+
pseudoClass: ColorValue
|
|
48
|
+
pseudoElement: ColorValue
|
|
49
|
+
punctuation: ColorValue
|
|
50
|
+
regex: ColorValue
|
|
51
|
+
selector: ColorValue
|
|
52
|
+
string: ColorValue
|
|
53
|
+
symbol: ColorValue
|
|
54
|
+
tag: ColorValue
|
|
55
|
+
unit: ColorValue
|
|
56
|
+
url: ColorValue
|
|
57
|
+
variable: ColorValue
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
focusRing:
|
|
60
|
+
focusRing: ColorValue
|
|
61
61
|
link: {
|
|
62
|
-
fg:
|
|
62
|
+
fg: ColorValue
|
|
63
63
|
}
|
|
64
64
|
shadow: {
|
|
65
|
-
outline:
|
|
66
|
-
umbra:
|
|
67
|
-
penumbra:
|
|
68
|
-
ambient:
|
|
65
|
+
outline: ColorValue
|
|
66
|
+
umbra: ColorValue
|
|
67
|
+
penumbra: ColorValue
|
|
68
|
+
ambient: ColorValue
|
|
69
69
|
}
|
|
70
70
|
skeleton: {
|
|
71
|
-
from:
|
|
72
|
-
to:
|
|
71
|
+
from: ColorValue
|
|
72
|
+
to: ColorValue
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
variant: {
|
|
@@ -1,100 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
ThemeColorCardToneKey,
|
|
5
|
-
ThemeColorSchemeKey,
|
|
6
|
-
ThemeColorStateToneKey,
|
|
1
|
+
import type {
|
|
2
|
+
ThemeColorCardToneKey as CardTone,
|
|
3
|
+
ThemeColorStateToneKey as ElementTone,
|
|
7
4
|
} from '../../v2'
|
|
5
|
+
import type {Hue} from '../palette'
|
|
6
|
+
import type {COLOR_VARIANTS} from './_constants'
|
|
7
|
+
import type {ThemeColorAvatar_v3} from './avatar'
|
|
8
|
+
import type {ColorValue} from './token'
|
|
8
9
|
|
|
9
10
|
/** @public */
|
|
10
11
|
export interface ThemeColorElement {
|
|
11
12
|
_hue: Hue
|
|
12
13
|
bg: {
|
|
13
|
-
0:
|
|
14
|
-
4:
|
|
14
|
+
0: ColorValue
|
|
15
|
+
4: ColorValue
|
|
15
16
|
}
|
|
16
17
|
border: {
|
|
17
|
-
0:
|
|
18
|
-
4:
|
|
18
|
+
0: ColorValue
|
|
19
|
+
4: ColorValue
|
|
19
20
|
}
|
|
20
21
|
fg: {
|
|
21
|
-
0:
|
|
22
|
-
4:
|
|
22
|
+
0: ColorValue
|
|
23
|
+
4: ColorValue
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
/** @public */
|
|
27
|
-
export type ThemeColorVariant = Record<
|
|
28
|
+
export type ThemeColorVariant = Record<ElementTone, ThemeColorElement>
|
|
28
29
|
|
|
29
30
|
/** @public */
|
|
30
|
-
export type ThemeColorVariantKey = 'tinted' | 'solid'
|
|
31
|
+
export type ThemeColorVariantKey = (typeof COLOR_VARIANTS)[number] // 'tinted' | 'solid'
|
|
31
32
|
|
|
32
33
|
/** @public */
|
|
33
34
|
export interface ThemeColorCard_v3 {
|
|
34
35
|
_hue: Hue
|
|
35
|
-
avatar:
|
|
36
|
-
backdrop:
|
|
36
|
+
avatar: ThemeColorAvatar_v3
|
|
37
|
+
backdrop: ColorValue
|
|
37
38
|
code: {
|
|
38
|
-
bg:
|
|
39
|
-
fg:
|
|
39
|
+
bg: ColorValue
|
|
40
|
+
fg: ColorValue
|
|
40
41
|
token: {
|
|
41
|
-
atrule:
|
|
42
|
-
attrName:
|
|
43
|
-
attrValue:
|
|
44
|
-
attribute:
|
|
45
|
-
boolean:
|
|
46
|
-
builtin:
|
|
47
|
-
cdata:
|
|
48
|
-
char:
|
|
49
|
-
class:
|
|
50
|
-
className:
|
|
51
|
-
comment:
|
|
52
|
-
constant:
|
|
53
|
-
deleted:
|
|
54
|
-
doctype:
|
|
55
|
-
entity:
|
|
56
|
-
function:
|
|
57
|
-
hexcode:
|
|
58
|
-
id:
|
|
59
|
-
important:
|
|
60
|
-
inserted:
|
|
61
|
-
keyword:
|
|
62
|
-
number:
|
|
63
|
-
operator:
|
|
64
|
-
prolog:
|
|
65
|
-
property:
|
|
66
|
-
pseudoClass:
|
|
67
|
-
pseudoElement:
|
|
68
|
-
punctuation:
|
|
69
|
-
regex:
|
|
70
|
-
selector:
|
|
71
|
-
string:
|
|
72
|
-
symbol:
|
|
73
|
-
tag:
|
|
74
|
-
unit:
|
|
75
|
-
url:
|
|
76
|
-
variable:
|
|
42
|
+
atrule: ColorValue
|
|
43
|
+
attrName: ColorValue
|
|
44
|
+
attrValue: ColorValue
|
|
45
|
+
attribute: ColorValue
|
|
46
|
+
boolean: ColorValue
|
|
47
|
+
builtin: ColorValue
|
|
48
|
+
cdata: ColorValue
|
|
49
|
+
char: ColorValue
|
|
50
|
+
class: ColorValue
|
|
51
|
+
className: ColorValue
|
|
52
|
+
comment: ColorValue
|
|
53
|
+
constant: ColorValue
|
|
54
|
+
deleted: ColorValue
|
|
55
|
+
doctype: ColorValue
|
|
56
|
+
entity: ColorValue
|
|
57
|
+
function: ColorValue
|
|
58
|
+
hexcode: ColorValue
|
|
59
|
+
id: ColorValue
|
|
60
|
+
important: ColorValue
|
|
61
|
+
inserted: ColorValue
|
|
62
|
+
keyword: ColorValue
|
|
63
|
+
number: ColorValue
|
|
64
|
+
operator: ColorValue
|
|
65
|
+
prolog: ColorValue
|
|
66
|
+
property: ColorValue
|
|
67
|
+
pseudoClass: ColorValue
|
|
68
|
+
pseudoElement: ColorValue
|
|
69
|
+
punctuation: ColorValue
|
|
70
|
+
regex: ColorValue
|
|
71
|
+
selector: ColorValue
|
|
72
|
+
string: ColorValue
|
|
73
|
+
symbol: ColorValue
|
|
74
|
+
tag: ColorValue
|
|
75
|
+
unit: ColorValue
|
|
76
|
+
url: ColorValue
|
|
77
|
+
variable: ColorValue
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
focusRing:
|
|
80
|
+
focusRing: ColorValue
|
|
81
|
+
link: {
|
|
82
|
+
fg: ColorValue
|
|
83
|
+
}
|
|
80
84
|
shadow: {
|
|
81
|
-
outline:
|
|
82
|
-
umbra:
|
|
83
|
-
penumbra:
|
|
84
|
-
ambient:
|
|
85
|
+
outline: ColorValue
|
|
86
|
+
umbra: ColorValue
|
|
87
|
+
penumbra: ColorValue
|
|
88
|
+
ambient: ColorValue
|
|
85
89
|
}
|
|
86
90
|
skeleton: {
|
|
87
|
-
from:
|
|
88
|
-
to:
|
|
91
|
+
from: ColorValue
|
|
92
|
+
to: ColorValue
|
|
89
93
|
}
|
|
90
94
|
variant: Record<ThemeColorVariantKey, ThemeColorVariant>
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
/** @public */
|
|
94
|
-
export
|
|
95
|
-
card: Record<ThemeColorCardToneKey, ThemeColorCard_v3>
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/** @public */
|
|
99
|
-
// color[scheme].card[cardTone][colorVariant][elementTone][property][level]
|
|
100
|
-
export type ThemeColor_v3 = Record<ThemeColorSchemeKey, ThemeColorScheme_v3>
|
|
98
|
+
export type ThemeColor_v3 = Record<CardTone, ThemeColorCard_v3>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {Hue} from '
|
|
2
|
-
import {
|
|
1
|
+
import type {Hue} from '../palette'
|
|
2
|
+
import type {ColorValue} from './token'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
5
5
|
export interface ElementColorTokens {
|
|
6
6
|
_hue: Hue
|
|
7
7
|
bg: {
|
|
8
|
-
0:
|
|
9
|
-
4:
|
|
8
|
+
0: ColorValue
|
|
9
|
+
4: ColorValue
|
|
10
10
|
}
|
|
11
11
|
border: {
|
|
12
|
-
0:
|
|
13
|
-
4:
|
|
12
|
+
0: ColorValue
|
|
13
|
+
4: ColorValue
|
|
14
14
|
}
|
|
15
15
|
fg: {
|
|
16
|
-
0:
|
|
17
|
-
4:
|
|
16
|
+
0: ColorValue
|
|
17
|
+
4: ColorValue
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Hue, Tint} from '
|
|
1
|
+
import type {Hue, Tint} from '../palette'
|
|
2
2
|
|
|
3
3
|
/** @public */
|
|
4
4
|
export type ColorTokenOpacityValue = `0` | `0.${number}` | `1`
|
|
@@ -10,9 +10,23 @@ export type ColorToken =
|
|
|
10
10
|
| `black/${ColorTokenOpacityValue}`
|
|
11
11
|
| `white`
|
|
12
12
|
| `white/${ColorTokenOpacityValue}`
|
|
13
|
-
| `${Hue}
|
|
14
|
-
| `${Hue}
|
|
15
|
-
| `${Hue}
|
|
13
|
+
| `${Hue}-${Tint}`
|
|
14
|
+
| `${Hue}-${Tint}/${ColorTokenOpacityValue}`
|
|
15
|
+
| `${Hue}-${Tint} ${number}%`
|
|
16
16
|
| `${Tint}`
|
|
17
17
|
| `${Tint}/${ColorTokenOpacityValue}`
|
|
18
18
|
| `${Tint} ${number}%`
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Theme color values are tuples of [light, dark] color tokens.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export type ColorValue = [ColorToken, ColorToken]
|
|
26
|
+
|
|
27
|
+
/** @public */
|
|
28
|
+
export interface ResolvedColorToken {
|
|
29
|
+
color: {type: 'inherit'} | {type: 'black' | 'white'} | {type: 'hue'; hue: Hue; tint: Tint}
|
|
30
|
+
opacity: number
|
|
31
|
+
mix: number
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {ThemeColorCardToneKey} from '../../v2'
|
|
2
|
-
import {CardColorTokens} from './card'
|
|
1
|
+
import type {ThemeColorCardToneKey} from '../../v2'
|
|
2
|
+
import type {CardColorTokens} from './card'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
5
5
|
export type ColorTokens = Record<'*' | ThemeColorCardToneKey, CardColorTokens>
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import {PartialTokens, Tokens} from './tokens'
|
|
1
|
+
import type {PartialTokens, Tokens} from './tokens'
|
|
2
2
|
|
|
3
3
|
/** @internal */
|
|
4
4
|
export const defaultTokens: PartialTokens<Tokens> = {
|
|
5
5
|
color: {
|
|
6
6
|
'*': {
|
|
7
|
-
backdrop: ['
|
|
7
|
+
backdrop: ['gray-100/0.5', 'black/0.5'],
|
|
8
8
|
code: {
|
|
9
|
-
bg: ['
|
|
10
|
-
fg: ['
|
|
9
|
+
bg: ['50', '950'],
|
|
10
|
+
fg: ['700', '300'],
|
|
11
11
|
token: {
|
|
12
|
-
atrule: ['purple
|
|
13
|
-
attrName: ['green
|
|
14
|
-
attrValue: ['yellow
|
|
15
|
-
attribute: ['yellow
|
|
16
|
-
boolean: ['purple
|
|
17
|
-
builtin: ['purple
|
|
18
|
-
cdata: ['yellow
|
|
19
|
-
char: ['yellow
|
|
20
|
-
class: ['orange
|
|
21
|
-
className: ['cyan
|
|
22
|
-
comment: ['gray
|
|
23
|
-
constant: ['purple
|
|
24
|
-
deleted: ['red
|
|
25
|
-
entity: ['red
|
|
26
|
-
function: ['green
|
|
27
|
-
hexcode: ['blue
|
|
28
|
-
id: ['purple
|
|
29
|
-
important: ['purple
|
|
30
|
-
inserted: ['green
|
|
31
|
-
keyword: ['magenta
|
|
32
|
-
number: ['purple
|
|
33
|
-
operator: ['magenta
|
|
34
|
-
prolog: ['gray
|
|
35
|
-
property: ['blue
|
|
36
|
-
pseudoClass: ['yellow
|
|
37
|
-
pseudoElement: ['yellow
|
|
38
|
-
punctuation: ['gray
|
|
39
|
-
regex: ['blue
|
|
40
|
-
selector: ['red
|
|
41
|
-
string: ['yellow
|
|
42
|
-
symbol: ['purple
|
|
43
|
-
tag: ['red
|
|
44
|
-
unit: ['orange
|
|
45
|
-
url: ['red
|
|
46
|
-
variable: ['red
|
|
12
|
+
atrule: ['purple-600', 'purple-300'],
|
|
13
|
+
attrName: ['green-600', 'green-300'],
|
|
14
|
+
attrValue: ['yellow-600', 'yellow-300'],
|
|
15
|
+
attribute: ['yellow-600', 'yellow-300'],
|
|
16
|
+
boolean: ['purple-600', 'purple-300'],
|
|
17
|
+
builtin: ['purple-600', 'purple-300'],
|
|
18
|
+
cdata: ['yellow-600', 'yellow-300'],
|
|
19
|
+
char: ['yellow-600', 'yellow-300'],
|
|
20
|
+
class: ['orange-600', 'orange-300'],
|
|
21
|
+
className: ['cyan-600', 'cyan-300'],
|
|
22
|
+
comment: ['gray-300', 'gray-600'],
|
|
23
|
+
constant: ['purple-600', 'purple-300'],
|
|
24
|
+
deleted: ['red-600', 'red-300'],
|
|
25
|
+
entity: ['red-600', 'red-300'],
|
|
26
|
+
function: ['green-600', 'green-300'],
|
|
27
|
+
hexcode: ['blue-600', 'blue-300'],
|
|
28
|
+
id: ['purple-600', 'purple-300'],
|
|
29
|
+
important: ['purple-600', 'purple-300'],
|
|
30
|
+
inserted: ['green-600', 'green-300'],
|
|
31
|
+
keyword: ['magenta-600', 'magenta-300'],
|
|
32
|
+
number: ['purple-600', 'purple-300'],
|
|
33
|
+
operator: ['magenta-600', 'magenta-300'],
|
|
34
|
+
prolog: ['gray-600', 'gray-300'],
|
|
35
|
+
property: ['blue-600', 'blue-300'],
|
|
36
|
+
pseudoClass: ['yellow-600', 'yellow-300'],
|
|
37
|
+
pseudoElement: ['yellow-600', 'yellow-300'],
|
|
38
|
+
punctuation: ['gray-600', 'gray-300'],
|
|
39
|
+
regex: ['blue-600', 'blue-300'],
|
|
40
|
+
selector: ['red-600', 'red-300'],
|
|
41
|
+
string: ['yellow-600', 'yellow-300'],
|
|
42
|
+
symbol: ['purple-600', 'purple-300'],
|
|
43
|
+
tag: ['red-600', 'red-300'],
|
|
44
|
+
unit: ['orange-600', 'orange-300'],
|
|
45
|
+
url: ['red-600', 'red-300'],
|
|
46
|
+
variable: ['red-600', 'red-300'],
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
|
-
focusRing: ['blue
|
|
49
|
+
focusRing: ['blue-500', 'blue-500'],
|
|
50
50
|
link: {
|
|
51
|
-
fg: ['blue
|
|
51
|
+
fg: ['blue-600', 'blue-400'],
|
|
52
52
|
},
|
|
53
53
|
shadow: {
|
|
54
|
-
outline: ['
|
|
55
|
-
umbra: ['
|
|
56
|
-
penumbra: ['
|
|
57
|
-
ambient: ['
|
|
54
|
+
outline: ['600/0.3', '500/0.4'],
|
|
55
|
+
umbra: ['600/0.1', 'black/0.2'],
|
|
56
|
+
penumbra: ['600/0.07', 'black/0.14'],
|
|
57
|
+
ambient: ['600/0.06', 'black/0.12'],
|
|
58
58
|
},
|
|
59
59
|
variant: {
|
|
60
60
|
tinted: {
|
|
61
61
|
'*': {
|
|
62
62
|
bg: {
|
|
63
|
-
0: ['
|
|
64
|
-
4: ['
|
|
63
|
+
0: ['50', '900'],
|
|
64
|
+
4: ['200', '700'],
|
|
65
65
|
},
|
|
66
66
|
border: {
|
|
67
|
-
0: ['
|
|
68
|
-
4: ['
|
|
67
|
+
0: ['100', '700 50%'],
|
|
68
|
+
4: ['300 75%', '500'],
|
|
69
69
|
},
|
|
70
70
|
fg: {
|
|
71
|
-
0: ['
|
|
72
|
-
4: ['
|
|
71
|
+
0: ['900', '100'],
|
|
72
|
+
4: ['700', '300'],
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
'primary': {
|
|
@@ -96,26 +96,26 @@ export const defaultTokens: PartialTokens<Tokens> = {
|
|
|
96
96
|
solid: {
|
|
97
97
|
'*': {
|
|
98
98
|
bg: {
|
|
99
|
-
0: ['
|
|
100
|
-
4: ['
|
|
99
|
+
0: ['500', '400'],
|
|
100
|
+
4: ['600', '300'],
|
|
101
101
|
},
|
|
102
102
|
border: {
|
|
103
|
-
0: ['
|
|
104
|
-
4: ['
|
|
103
|
+
0: ['400', '200'],
|
|
104
|
+
4: ['500', '100'],
|
|
105
105
|
},
|
|
106
106
|
fg: {
|
|
107
|
-
0: ['
|
|
108
|
-
4: ['
|
|
107
|
+
0: ['white', 'black'],
|
|
108
|
+
4: ['200', '700'],
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
'default': {
|
|
112
112
|
bg: {
|
|
113
|
-
0: ['
|
|
114
|
-
4: ['
|
|
113
|
+
0: ['800', '200'],
|
|
114
|
+
4: ['black', 'white'],
|
|
115
115
|
},
|
|
116
116
|
border: {
|
|
117
|
-
0: ['
|
|
118
|
-
4: ['
|
|
117
|
+
0: ['700', '300'],
|
|
118
|
+
4: ['800', '200'],
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
121
|
'primary': {
|
|
@@ -141,16 +141,16 @@ export const defaultTokens: PartialTokens<Tokens> = {
|
|
|
141
141
|
tinted: {
|
|
142
142
|
'*': {
|
|
143
143
|
bg: {
|
|
144
|
-
0: ['
|
|
145
|
-
4: ['
|
|
144
|
+
0: ['gray-50', 'black'],
|
|
145
|
+
4: ['200', '800'],
|
|
146
146
|
},
|
|
147
147
|
border: {
|
|
148
|
-
0: ['
|
|
149
|
-
4: ['
|
|
148
|
+
0: ['200 50%', '800 50%'],
|
|
149
|
+
4: ['300', '600'],
|
|
150
150
|
},
|
|
151
151
|
fg: {
|
|
152
|
-
0: ['
|
|
153
|
-
4: ['
|
|
152
|
+
0: ['black', '100'],
|
|
153
|
+
4: ['700', '400'],
|
|
154
154
|
},
|
|
155
155
|
},
|
|
156
156
|
},
|
|
@@ -161,28 +161,16 @@ export const defaultTokens: PartialTokens<Tokens> = {
|
|
|
161
161
|
tinted: {
|
|
162
162
|
'*': {
|
|
163
163
|
bg: {
|
|
164
|
-
0: ['
|
|
165
|
-
4: ['
|
|
164
|
+
0: ['white', '950'],
|
|
165
|
+
4: ['200', '800'],
|
|
166
166
|
},
|
|
167
167
|
border: {
|
|
168
|
-
0: ['
|
|
169
|
-
4: ['
|
|
168
|
+
0: ['200 50%', '800 50%'],
|
|
169
|
+
4: ['300 75%', '600'],
|
|
170
170
|
},
|
|
171
171
|
fg: {
|
|
172
|
-
0: ['
|
|
173
|
-
4: ['
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
'neutral': {
|
|
180
|
-
variant: {
|
|
181
|
-
tinted: {
|
|
182
|
-
'*': {
|
|
183
|
-
bg: {
|
|
184
|
-
0: ['900', '50'],
|
|
185
|
-
4: ['700', '200'],
|
|
172
|
+
0: ['black', 'white'],
|
|
173
|
+
4: ['600', '400'],
|
|
186
174
|
},
|
|
187
175
|
},
|
|
188
176
|
},
|
package/src/theme/v3/index.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export * from './_constants'
|
|
2
|
+
export * from './_parseColorToken'
|
|
1
3
|
export * from './buildTheme_v3'
|
|
2
4
|
export * from './color'
|
|
3
5
|
export * from './defaultTokens'
|
|
6
|
+
export * from './palette'
|
|
4
7
|
export * from './resolveTokens'
|
|
5
8
|
export * from './tokens'
|
|
6
9
|
export * from './types'
|