@sanity/ui 3.0.0-static.17 → 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 +138 -137
- 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 +139 -138
- 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 -2016
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +9427 -874
- package/dist/css.d.ts +9427 -874
- package/dist/css.js +1591 -2018
- 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 +26 -23
- package/dist/index.d.ts +26 -23
- 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 +3 -18
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +10 -10
- 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 +1 -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 +26 -910
- 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
|
@@ -4,43 +4,80 @@ import {
|
|
|
4
4
|
THEME_COLOR_INPUT_STATES,
|
|
5
5
|
THEME_COLOR_STATE_TONES,
|
|
6
6
|
THEME_COLOR_STATES,
|
|
7
|
-
ThemeColorBadge_v2,
|
|
8
|
-
ThemeColorButton_v2,
|
|
9
|
-
ThemeColorButtonMode_v2,
|
|
10
|
-
ThemeColorButtonTone_v2,
|
|
11
|
-
ThemeColorCard_v2,
|
|
12
|
-
ThemeColorInput_v2,
|
|
13
|
-
ThemeColorInputMode_v2,
|
|
14
|
-
ThemeColorInputState_v2,
|
|
15
|
-
ThemeColorSelectable_v2,
|
|
16
|
-
ThemeColorSelectableTone_v2,
|
|
17
|
-
ThemeColorState_v2,
|
|
18
|
-
ThemeColorStateKey,
|
|
19
|
-
ThemeColorStateToneKey,
|
|
7
|
+
type ThemeColorBadge_v2,
|
|
8
|
+
type ThemeColorButton_v2,
|
|
9
|
+
type ThemeColorButtonMode_v2,
|
|
10
|
+
type ThemeColorButtonTone_v2,
|
|
11
|
+
type ThemeColorCard_v2,
|
|
12
|
+
type ThemeColorInput_v2,
|
|
13
|
+
type ThemeColorInputMode_v2,
|
|
14
|
+
type ThemeColorInputState_v2,
|
|
15
|
+
type ThemeColorSelectable_v2,
|
|
16
|
+
type ThemeColorSelectableTone_v2,
|
|
17
|
+
type ThemeColorState_v2,
|
|
18
|
+
type ThemeColorStateKey,
|
|
19
|
+
type ThemeColorStateToneKey,
|
|
20
20
|
} from '../v2'
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
_parseColorToken,
|
|
23
|
+
type ColorToken,
|
|
24
|
+
type ColorValue,
|
|
25
|
+
type Hue,
|
|
26
|
+
type ThemeColorCard_v3,
|
|
27
|
+
type ThemeColorElement,
|
|
28
|
+
type ThemeColorVariantKey,
|
|
29
|
+
type ThemePalette_v3,
|
|
30
|
+
} from '../v3'
|
|
31
|
+
|
|
32
|
+
function renderColor(colorToken: ColorToken, options: {defaultHue: Hue; palette: ThemePalette_v3}) {
|
|
33
|
+
const {defaultHue, palette} = options
|
|
34
|
+
|
|
35
|
+
const color = _parseColorToken(colorToken, {defaultHue})
|
|
36
|
+
|
|
37
|
+
if (color.type === 'color') {
|
|
38
|
+
return palette[color.name].hex
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (color.type === 'tint') {
|
|
42
|
+
return palette.hues[color.hue][color.tint].hex
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return '#000'
|
|
46
|
+
}
|
|
22
47
|
|
|
23
48
|
export function themeColor_v3_v2(options: {
|
|
24
49
|
color: ThemeColorCard_v3
|
|
25
50
|
dark: boolean
|
|
51
|
+
palette: ThemePalette_v3
|
|
26
52
|
}): ThemeColorCard_v2 {
|
|
27
|
-
const {color, dark} = options
|
|
53
|
+
const {color, dark, palette} = options
|
|
54
|
+
|
|
55
|
+
const i = dark ? 1 : 0
|
|
56
|
+
|
|
57
|
+
const defaultHue = color._hue
|
|
58
|
+
|
|
59
|
+
const colorOptions = {defaultHue, palette}
|
|
28
60
|
|
|
29
61
|
return {
|
|
30
62
|
_blend: 'screen',
|
|
31
63
|
_dark: dark,
|
|
32
64
|
...buildColorState({
|
|
33
65
|
cardColor: color,
|
|
66
|
+
dark,
|
|
67
|
+
palette,
|
|
34
68
|
state: 'enabled',
|
|
35
69
|
tone: 'default',
|
|
36
70
|
variant: 'tinted',
|
|
37
71
|
}),
|
|
38
|
-
|
|
72
|
+
|
|
73
|
+
backdrop: renderColor(color.backdrop[i], colorOptions),
|
|
39
74
|
button: THEME_COLOR_BUTTON_MODES.reduce<ThemeColorButton_v2>((modes, mode) => {
|
|
40
75
|
modes[mode] = THEME_COLOR_STATE_TONES.reduce<ThemeColorButtonMode_v2>((tones, tone) => {
|
|
41
76
|
tones[tone] = THEME_COLOR_STATES.reduce<ThemeColorButtonTone_v2>((states, state) => {
|
|
42
77
|
states[state] = buildColorState({
|
|
43
78
|
cardColor: color,
|
|
79
|
+
dark,
|
|
80
|
+
palette,
|
|
44
81
|
state,
|
|
45
82
|
tone,
|
|
46
83
|
variant: mode === 'default' ? 'solid' : 'tinted',
|
|
@@ -58,10 +95,15 @@ export function themeColor_v3_v2(options: {
|
|
|
58
95
|
|
|
59
96
|
return modes
|
|
60
97
|
}, {} as ThemeColorButton_v2),
|
|
61
|
-
|
|
98
|
+
|
|
99
|
+
focusRing: renderColor(color.focusRing[i], colorOptions),
|
|
62
100
|
input: THEME_COLOR_INPUT_MODES.reduce<ThemeColorInput_v2>((modes, mode) => {
|
|
63
101
|
modes[mode] = THEME_COLOR_INPUT_STATES.reduce<ThemeColorInputMode_v2>((states, state) => {
|
|
64
|
-
states[state] = buildInputState(color.variant.tinted.default
|
|
102
|
+
states[state] = buildInputState(color.variant.tinted.default, {
|
|
103
|
+
dark,
|
|
104
|
+
defaultHue,
|
|
105
|
+
palette,
|
|
106
|
+
})
|
|
65
107
|
|
|
66
108
|
return states
|
|
67
109
|
}, {} as ThemeColorInputMode_v2)
|
|
@@ -72,7 +114,8 @@ export function themeColor_v3_v2(options: {
|
|
|
72
114
|
tones[tone] = THEME_COLOR_STATES.reduce<ThemeColorSelectableTone_v2>((states, state) => {
|
|
73
115
|
states[state] = buildColorState({
|
|
74
116
|
cardColor: color,
|
|
75
|
-
|
|
117
|
+
dark,
|
|
118
|
+
palette,
|
|
76
119
|
state,
|
|
77
120
|
tone,
|
|
78
121
|
variant: 'tinted',
|
|
@@ -83,8 +126,52 @@ export function themeColor_v3_v2(options: {
|
|
|
83
126
|
|
|
84
127
|
return tones
|
|
85
128
|
}, {} as ThemeColorSelectable_v2),
|
|
86
|
-
|
|
87
|
-
|
|
129
|
+
|
|
130
|
+
shadow: {
|
|
131
|
+
outline: renderColor(color.shadow.outline[i], colorOptions),
|
|
132
|
+
umbra: renderColor(color.shadow.umbra[i], colorOptions),
|
|
133
|
+
penumbra: renderColor(color.shadow.penumbra[i], colorOptions),
|
|
134
|
+
ambient: renderColor(color.shadow.ambient[i], colorOptions),
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
syntax: {
|
|
138
|
+
atrule: renderColor(color.code.token.atrule[i], colorOptions),
|
|
139
|
+
attrName: renderColor(color.code.token.attrName[i], colorOptions),
|
|
140
|
+
attrValue: renderColor(color.code.token.attrValue[i], colorOptions),
|
|
141
|
+
attribute: renderColor(color.code.token.attribute[i], colorOptions),
|
|
142
|
+
boolean: renderColor(color.code.token.boolean[i], colorOptions),
|
|
143
|
+
builtin: renderColor(color.code.token.builtin[i], colorOptions),
|
|
144
|
+
cdata: renderColor(color.code.token.cdata[i], colorOptions),
|
|
145
|
+
char: renderColor(color.code.token.char[i], colorOptions),
|
|
146
|
+
class: renderColor(color.code.token.class[i], colorOptions),
|
|
147
|
+
className: renderColor(color.code.token.className[i], colorOptions),
|
|
148
|
+
comment: renderColor(color.code.token.comment[i], colorOptions),
|
|
149
|
+
constant: renderColor(color.code.token.constant[i], colorOptions),
|
|
150
|
+
deleted: renderColor(color.code.token.deleted[i], colorOptions),
|
|
151
|
+
doctype: renderColor(color.code.token.doctype[i], colorOptions),
|
|
152
|
+
entity: renderColor(color.code.token.entity[i], colorOptions),
|
|
153
|
+
function: renderColor(color.code.token.function[i], colorOptions),
|
|
154
|
+
hexcode: renderColor(color.code.token.hexcode[i], colorOptions),
|
|
155
|
+
id: renderColor(color.code.token.id[i], colorOptions),
|
|
156
|
+
important: renderColor(color.code.token.important[i], colorOptions),
|
|
157
|
+
inserted: renderColor(color.code.token.inserted[i], colorOptions),
|
|
158
|
+
keyword: renderColor(color.code.token.keyword[i], colorOptions),
|
|
159
|
+
number: renderColor(color.code.token.number[i], colorOptions),
|
|
160
|
+
operator: renderColor(color.code.token.operator[i], colorOptions),
|
|
161
|
+
prolog: renderColor(color.code.token.prolog[i], colorOptions),
|
|
162
|
+
property: renderColor(color.code.token.property[i], colorOptions),
|
|
163
|
+
pseudoClass: renderColor(color.code.token.pseudoClass[i], colorOptions),
|
|
164
|
+
pseudoElement: renderColor(color.code.token.pseudoElement[i], colorOptions),
|
|
165
|
+
punctuation: renderColor(color.code.token.punctuation[i], colorOptions),
|
|
166
|
+
regex: renderColor(color.code.token.regex[i], colorOptions),
|
|
167
|
+
selector: renderColor(color.code.token.selector[i], colorOptions),
|
|
168
|
+
string: renderColor(color.code.token.string[i], colorOptions),
|
|
169
|
+
symbol: renderColor(color.code.token.symbol[i], colorOptions),
|
|
170
|
+
tag: renderColor(color.code.token.tag[i], colorOptions),
|
|
171
|
+
unit: renderColor(color.code.token.unit[i], colorOptions),
|
|
172
|
+
url: renderColor(color.code.token.url[i], colorOptions),
|
|
173
|
+
variable: renderColor(color.code.token.variable[i], colorOptions),
|
|
174
|
+
},
|
|
88
175
|
}
|
|
89
176
|
}
|
|
90
177
|
|
|
@@ -127,80 +214,170 @@ const stateShades: Record<
|
|
|
127
214
|
|
|
128
215
|
function mix(
|
|
129
216
|
tokens: {
|
|
130
|
-
0:
|
|
131
|
-
4:
|
|
217
|
+
0: ColorValue
|
|
218
|
+
4: ColorValue
|
|
132
219
|
},
|
|
133
220
|
index: ElementTokenIndex,
|
|
221
|
+
options: {
|
|
222
|
+
dark: boolean
|
|
223
|
+
defaultHue: Hue
|
|
224
|
+
palette: ThemePalette_v3
|
|
225
|
+
},
|
|
134
226
|
) {
|
|
227
|
+
const {dark, defaultHue, palette} = options
|
|
228
|
+
const colorOptions = {defaultHue, palette}
|
|
229
|
+
const i = dark ? 1 : 0
|
|
230
|
+
|
|
231
|
+
const from = renderColor(tokens[0][i], colorOptions)
|
|
232
|
+
const to = renderColor(tokens[4][i], colorOptions)
|
|
233
|
+
|
|
135
234
|
if (index === 0) {
|
|
136
|
-
return
|
|
235
|
+
return from
|
|
137
236
|
}
|
|
138
237
|
|
|
139
238
|
if (index === 4) {
|
|
140
|
-
return
|
|
239
|
+
return to
|
|
141
240
|
}
|
|
142
241
|
|
|
143
|
-
return `color-mix(in oklch, ${
|
|
242
|
+
return `color-mix(in oklch, ${from}, ${to} ${index * 25}%)`
|
|
144
243
|
}
|
|
145
244
|
|
|
146
245
|
function buildColorState(options: {
|
|
147
246
|
cardColor: ThemeColorCard_v3
|
|
247
|
+
dark: boolean
|
|
248
|
+
palette: ThemePalette_v3
|
|
148
249
|
state: ThemeColorStateKey
|
|
149
250
|
tone: ThemeColorStateToneKey
|
|
150
251
|
variant: ThemeColorVariantKey
|
|
151
252
|
}): ThemeColorState_v2 {
|
|
152
|
-
const {cardColor, state, tone, variant} = options
|
|
253
|
+
const {cardColor, dark, palette, state, tone, variant} = options
|
|
153
254
|
const color = cardColor.variant[variant][tone]
|
|
154
255
|
|
|
155
256
|
const shades = stateShades[state]
|
|
156
257
|
|
|
258
|
+
const defaultHue = cardColor._hue
|
|
259
|
+
const colorOptions = {defaultHue, palette}
|
|
260
|
+
|
|
261
|
+
const i = dark ? 1 : 0
|
|
262
|
+
|
|
263
|
+
// cardColor.avatar.blue.bg
|
|
264
|
+
|
|
157
265
|
return {
|
|
158
266
|
accent: {
|
|
159
|
-
fg: color.fg[4],
|
|
267
|
+
fg: renderColor(color.fg[4][i], colorOptions),
|
|
160
268
|
},
|
|
161
|
-
|
|
269
|
+
|
|
270
|
+
avatar: {
|
|
271
|
+
gray: {
|
|
272
|
+
bg: renderColor(cardColor.avatar.gray.bg[i], colorOptions),
|
|
273
|
+
fg: renderColor(cardColor.avatar.gray.fg[i], colorOptions),
|
|
274
|
+
},
|
|
275
|
+
blue: {
|
|
276
|
+
bg: renderColor(cardColor.avatar.blue.bg[i], colorOptions),
|
|
277
|
+
fg: renderColor(cardColor.avatar.blue.fg[i], colorOptions),
|
|
278
|
+
},
|
|
279
|
+
purple: {
|
|
280
|
+
bg: renderColor(cardColor.avatar.purple.bg[i], colorOptions),
|
|
281
|
+
fg: renderColor(cardColor.avatar.purple.fg[i], colorOptions),
|
|
282
|
+
},
|
|
283
|
+
magenta: {
|
|
284
|
+
bg: renderColor(cardColor.avatar.magenta.bg[i], colorOptions),
|
|
285
|
+
fg: renderColor(cardColor.avatar.magenta.fg[i], colorOptions),
|
|
286
|
+
},
|
|
287
|
+
red: {
|
|
288
|
+
bg: renderColor(cardColor.avatar.red.bg[i], colorOptions),
|
|
289
|
+
fg: renderColor(cardColor.avatar.red.fg[i], colorOptions),
|
|
290
|
+
},
|
|
291
|
+
orange: {
|
|
292
|
+
bg: renderColor(cardColor.avatar.orange.bg[i], colorOptions),
|
|
293
|
+
fg: renderColor(cardColor.avatar.orange.fg[i], colorOptions),
|
|
294
|
+
},
|
|
295
|
+
yellow: {
|
|
296
|
+
bg: renderColor(cardColor.avatar.yellow.bg[i], colorOptions),
|
|
297
|
+
fg: renderColor(cardColor.avatar.yellow.fg[i], colorOptions),
|
|
298
|
+
},
|
|
299
|
+
green: {
|
|
300
|
+
bg: renderColor(cardColor.avatar.green.bg[i], colorOptions),
|
|
301
|
+
fg: renderColor(cardColor.avatar.green.fg[i], colorOptions),
|
|
302
|
+
},
|
|
303
|
+
cyan: {
|
|
304
|
+
bg: renderColor(cardColor.avatar.cyan.bg[i], colorOptions),
|
|
305
|
+
fg: renderColor(cardColor.avatar.cyan.fg[i], colorOptions),
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
// avatar: cardColor.avatar,
|
|
162
310
|
badge: THEME_COLOR_STATE_TONES.reduce<ThemeColorBadge_v2>((tones, tone) => {
|
|
163
311
|
tones[tone] = {
|
|
164
|
-
bg: mix(color.bg, 1),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
312
|
+
bg: mix(color.bg, 1, {dark, defaultHue, palette}),
|
|
313
|
+
|
|
314
|
+
fg: mix(color.fg, 1, {dark, defaultHue, palette}),
|
|
315
|
+
|
|
316
|
+
dot: mix(color.fg, 3, {dark, defaultHue, palette}),
|
|
317
|
+
|
|
318
|
+
icon: mix(color.fg, 3, {dark, defaultHue, palette}),
|
|
168
319
|
}
|
|
169
320
|
|
|
170
321
|
return tones
|
|
171
322
|
}, {} as ThemeColorBadge_v2),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
323
|
+
|
|
324
|
+
bg: mix(color.bg, shades.bg[0], {dark, defaultHue, palette}),
|
|
325
|
+
|
|
326
|
+
border: mix(color.border, shades.border[0], {dark, defaultHue, palette}),
|
|
327
|
+
|
|
328
|
+
fg: mix(color.fg, shades.fg[0], {dark, defaultHue, palette}),
|
|
175
329
|
code: {
|
|
176
|
-
bg: mix(color.bg, shades.bg[1]),
|
|
177
|
-
|
|
330
|
+
bg: mix(color.bg, shades.bg[1], {dark, defaultHue, palette}),
|
|
331
|
+
|
|
332
|
+
fg: mix(color.fg, shades.fg[2], {dark, defaultHue, palette}),
|
|
178
333
|
},
|
|
179
|
-
|
|
334
|
+
|
|
335
|
+
icon: mix(color.fg, shades.fg[2], {dark, defaultHue, palette}),
|
|
180
336
|
kbd: {
|
|
181
|
-
bg: mix(color.bg, 0),
|
|
182
|
-
|
|
183
|
-
|
|
337
|
+
bg: mix(color.bg, 0, {dark, defaultHue, palette}),
|
|
338
|
+
|
|
339
|
+
fg: mix(color.fg, 0, {dark, defaultHue, palette}),
|
|
340
|
+
|
|
341
|
+
border: mix(color.bg, 0, {dark, defaultHue, palette}),
|
|
184
342
|
},
|
|
185
343
|
link: {
|
|
186
|
-
fg: mix(color.fg, shades.fg[2]),
|
|
344
|
+
fg: mix(color.fg, shades.fg[2], {dark, defaultHue, palette}),
|
|
187
345
|
},
|
|
188
346
|
muted: {
|
|
189
|
-
bg: mix(color.bg, shades.bg[1]),
|
|
190
|
-
|
|
347
|
+
bg: mix(color.bg, shades.bg[1], {dark, defaultHue, palette}),
|
|
348
|
+
|
|
349
|
+
fg: mix(color.fg, shades.fg[2], {dark, defaultHue, palette}),
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
skeleton: {
|
|
353
|
+
from: renderColor(cardColor.skeleton.from[i], colorOptions),
|
|
354
|
+
to: renderColor(cardColor.skeleton.to[i], colorOptions),
|
|
191
355
|
},
|
|
192
|
-
skeleton: cardColor.skeleton,
|
|
193
356
|
}
|
|
194
357
|
}
|
|
195
358
|
|
|
196
|
-
function buildInputState(
|
|
359
|
+
function buildInputState(
|
|
360
|
+
colorElement: ThemeColorElement,
|
|
361
|
+
options: {
|
|
362
|
+
dark: boolean
|
|
363
|
+
defaultHue: Hue
|
|
364
|
+
palette: ThemePalette_v3
|
|
365
|
+
},
|
|
366
|
+
): ThemeColorInputState_v2 {
|
|
367
|
+
const {dark, defaultHue, palette} = options
|
|
368
|
+
const colorOptions = {defaultHue, palette}
|
|
369
|
+
const i = dark ? 1 : 0
|
|
370
|
+
|
|
197
371
|
return {
|
|
198
|
-
bg: colorElement.bg[0],
|
|
199
|
-
|
|
200
|
-
|
|
372
|
+
bg: renderColor(colorElement.bg[0][i], colorOptions),
|
|
373
|
+
|
|
374
|
+
border: renderColor(colorElement.bg[0][i], colorOptions),
|
|
375
|
+
|
|
376
|
+
fg: renderColor(colorElement.fg[0][i], colorOptions),
|
|
201
377
|
muted: {
|
|
202
|
-
bg: colorElement.bg[0],
|
|
378
|
+
bg: renderColor(colorElement.bg[0][i], colorOptions),
|
|
203
379
|
},
|
|
204
|
-
|
|
380
|
+
|
|
381
|
+
placeholder: renderColor(colorElement.fg[0][i], colorOptions),
|
|
205
382
|
}
|
|
206
383
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type {RootTheme} from '../types'
|
|
2
|
+
import type {RootTheme_v2} from '../v2'
|
|
3
|
+
import {defaultThemeConfig} from '../v2/defaults/config'
|
|
4
4
|
import {themeColor_v0_v2} from './themeColor_v0_v2'
|
|
5
5
|
|
|
6
6
|
const cache = new WeakMap<RootTheme, RootTheme_v2>()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {RootTheme} from '../types'
|
|
2
|
-
import {ThemeColor, ThemeColorInputState, ThemeColorInputStates} from '../v0'
|
|
3
|
-
import {
|
|
1
|
+
import type {RootTheme} from '../types'
|
|
2
|
+
import type {ThemeColor, ThemeColorInputState, ThemeColorInputStates} from '../v0'
|
|
3
|
+
import type {
|
|
4
4
|
RootTheme_v2,
|
|
5
5
|
ThemeColorCard_v2,
|
|
6
6
|
ThemeColorInputMode_v2,
|
|
7
7
|
ThemeColorInputState_v2,
|
|
8
8
|
} from '../v2'
|
|
9
|
-
import {Theme_v3} from '../v3'
|
|
9
|
+
import type {Theme_v3} from '../v3'
|
|
10
10
|
|
|
11
11
|
const cache = new WeakMap<RootTheme_v2, RootTheme>()
|
|
12
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {RootTheme_v2} from '../v2'
|
|
4
|
-
import {Theme_v3} from '../v3'
|
|
1
|
+
import type {RootTheme_v2} from '../v2'
|
|
2
|
+
import type {Theme_v3} from '../v3'
|
|
5
3
|
import {themeColor_v3_v2} from './themeColor_v3_v2'
|
|
6
4
|
|
|
7
5
|
export function v3_v2(theme_v3: Theme_v3): RootTheme_v2 {
|
|
6
|
+
const palette = theme_v3.palette
|
|
7
|
+
|
|
8
8
|
return {
|
|
9
9
|
_version: 2,
|
|
10
10
|
avatar: theme_v3.avatar,
|
|
@@ -13,86 +13,86 @@ export function v3_v2(theme_v3: Theme_v3): RootTheme_v2 {
|
|
|
13
13
|
color: {
|
|
14
14
|
dark: {
|
|
15
15
|
transparent: themeColor_v3_v2({
|
|
16
|
-
color: theme_v3.color.
|
|
16
|
+
color: theme_v3.color.transparent,
|
|
17
17
|
dark: true,
|
|
18
|
-
|
|
18
|
+
palette,
|
|
19
19
|
}),
|
|
20
20
|
default: themeColor_v3_v2({
|
|
21
|
-
color: theme_v3.color.
|
|
21
|
+
color: theme_v3.color.default,
|
|
22
22
|
dark: true,
|
|
23
|
-
|
|
23
|
+
palette,
|
|
24
24
|
}),
|
|
25
25
|
neutral: themeColor_v3_v2({
|
|
26
|
-
color: theme_v3.color.
|
|
26
|
+
color: theme_v3.color.neutral,
|
|
27
27
|
dark: true,
|
|
28
|
-
|
|
28
|
+
palette,
|
|
29
29
|
}),
|
|
30
30
|
primary: themeColor_v3_v2({
|
|
31
|
-
color: theme_v3.color.
|
|
31
|
+
color: theme_v3.color.primary,
|
|
32
32
|
dark: true,
|
|
33
|
-
|
|
33
|
+
palette,
|
|
34
34
|
}),
|
|
35
35
|
suggest: themeColor_v3_v2({
|
|
36
|
-
color: theme_v3.color.
|
|
36
|
+
color: theme_v3.color.suggest,
|
|
37
37
|
dark: true,
|
|
38
|
-
|
|
38
|
+
palette,
|
|
39
39
|
}),
|
|
40
40
|
positive: themeColor_v3_v2({
|
|
41
|
-
color: theme_v3.color.
|
|
41
|
+
color: theme_v3.color.positive,
|
|
42
42
|
dark: true,
|
|
43
|
-
|
|
43
|
+
palette,
|
|
44
44
|
}),
|
|
45
45
|
caution: themeColor_v3_v2({
|
|
46
|
-
color: theme_v3.color.
|
|
46
|
+
color: theme_v3.color.caution,
|
|
47
47
|
dark: true,
|
|
48
|
-
|
|
48
|
+
palette,
|
|
49
49
|
}),
|
|
50
50
|
critical: themeColor_v3_v2({
|
|
51
|
-
color: theme_v3.color.
|
|
51
|
+
color: theme_v3.color.critical,
|
|
52
52
|
dark: true,
|
|
53
|
-
|
|
53
|
+
palette,
|
|
54
54
|
}),
|
|
55
55
|
},
|
|
56
56
|
light: {
|
|
57
57
|
transparent: themeColor_v3_v2({
|
|
58
|
-
color: theme_v3.color.
|
|
58
|
+
color: theme_v3.color.transparent,
|
|
59
59
|
dark: false,
|
|
60
|
-
|
|
60
|
+
palette,
|
|
61
61
|
}),
|
|
62
62
|
default: themeColor_v3_v2({
|
|
63
|
-
color: theme_v3.color.
|
|
63
|
+
color: theme_v3.color.default,
|
|
64
64
|
dark: false,
|
|
65
|
-
|
|
65
|
+
palette,
|
|
66
66
|
}),
|
|
67
67
|
neutral: themeColor_v3_v2({
|
|
68
|
-
color: theme_v3.color.
|
|
68
|
+
color: theme_v3.color.neutral,
|
|
69
69
|
dark: false,
|
|
70
|
-
|
|
70
|
+
palette,
|
|
71
71
|
}),
|
|
72
72
|
primary: themeColor_v3_v2({
|
|
73
|
-
color: theme_v3.color.
|
|
73
|
+
color: theme_v3.color.primary,
|
|
74
74
|
dark: false,
|
|
75
|
-
|
|
75
|
+
palette,
|
|
76
76
|
}),
|
|
77
77
|
suggest: themeColor_v3_v2({
|
|
78
|
-
color: theme_v3.color.
|
|
78
|
+
color: theme_v3.color.suggest,
|
|
79
79
|
dark: false,
|
|
80
|
-
|
|
80
|
+
palette,
|
|
81
81
|
}),
|
|
82
82
|
positive: themeColor_v3_v2({
|
|
83
|
-
color: theme_v3.color.
|
|
83
|
+
color: theme_v3.color.positive,
|
|
84
84
|
dark: false,
|
|
85
|
-
|
|
85
|
+
palette,
|
|
86
86
|
}),
|
|
87
87
|
caution: themeColor_v3_v2({
|
|
88
|
-
color: theme_v3.color.
|
|
88
|
+
color: theme_v3.color.caution,
|
|
89
89
|
dark: false,
|
|
90
|
-
|
|
90
|
+
palette,
|
|
91
91
|
}),
|
|
92
92
|
critical: themeColor_v3_v2({
|
|
93
|
-
color: theme_v3.color.
|
|
93
|
+
color: theme_v3.color.critical,
|
|
94
94
|
dark: false,
|
|
95
|
-
|
|
95
|
+
palette,
|
|
96
96
|
}),
|
|
97
97
|
},
|
|
98
98
|
},
|
|
@@ -101,8 +101,8 @@ export function v3_v2(theme_v3: Theme_v3): RootTheme_v2 {
|
|
|
101
101
|
input: theme_v3.input,
|
|
102
102
|
layer: theme_v3.layer,
|
|
103
103
|
media: theme_v3.media,
|
|
104
|
-
radius: theme_v3.radius,
|
|
104
|
+
radius: Object.values(theme_v3.radius),
|
|
105
105
|
shadow: theme_v3.shadow,
|
|
106
|
-
space: theme_v3.space,
|
|
106
|
+
space: Object.values(theme_v3.space),
|
|
107
107
|
}
|
|
108
108
|
}
|
package/dist/ui-palette.css
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
@layer s-palette {
|
|
2
|
-
:root {
|
|
3
|
-
--black: #0d0e12;
|
|
4
|
-
--white: #ffffff;
|
|
5
|
-
--gray-50: #f6f6f8;
|
|
6
|
-
--gray-100: #eeeef1;
|
|
7
|
-
--gray-200: #e3e4e8;
|
|
8
|
-
--gray-300: #bbbdc9;
|
|
9
|
-
--gray-400: #9499ad;
|
|
10
|
-
--gray-500: #727892;
|
|
11
|
-
--gray-600: #515870;
|
|
12
|
-
--gray-700: #383d51;
|
|
13
|
-
--gray-800: #252837;
|
|
14
|
-
--gray-900: #1b1d27;
|
|
15
|
-
--gray-950: #13141b;
|
|
16
|
-
--blue-50: #f5f8ff;
|
|
17
|
-
--blue-100: #e5edff;
|
|
18
|
-
--blue-200: #dbe5ff;
|
|
19
|
-
--blue-300: #a8bfff;
|
|
20
|
-
--blue-400: #7595ff;
|
|
21
|
-
--blue-500: #556bfc;
|
|
22
|
-
--blue-600: #4043e7;
|
|
23
|
-
--blue-700: #2927aa;
|
|
24
|
-
--blue-800: #192457;
|
|
25
|
-
--blue-900: #161a41;
|
|
26
|
-
--blue-950: #101228;
|
|
27
|
-
--purple-50: #f8f5ff;
|
|
28
|
-
--purple-100: #f1ebff;
|
|
29
|
-
--purple-200: #ece1fe;
|
|
30
|
-
--purple-300: #ccb1fc;
|
|
31
|
-
--purple-400: #b087f7;
|
|
32
|
-
--purple-500: #8f57ef;
|
|
33
|
-
--purple-600: #721fe5;
|
|
34
|
-
--purple-700: #4c1a9e;
|
|
35
|
-
--purple-800: #2f1862;
|
|
36
|
-
--purple-900: #23173f;
|
|
37
|
-
--purple-950: #181128;
|
|
38
|
-
--magenta-50: #fef6f9;
|
|
39
|
-
--magenta-100: #fde8ef;
|
|
40
|
-
--magenta-200: #fcdee9;
|
|
41
|
-
--magenta-300: #f7abc5;
|
|
42
|
-
--magenta-400: #f0709b;
|
|
43
|
-
--magenta-500: #e72767;
|
|
44
|
-
--magenta-600: #b11651;
|
|
45
|
-
--magenta-700: #7c1342;
|
|
46
|
-
--magenta-800: #4b1130;
|
|
47
|
-
--magenta-900: #341325;
|
|
48
|
-
--magenta-950: #1f0f14;
|
|
49
|
-
--red-50: #fff6f5;
|
|
50
|
-
--red-100: #ffe7e5;
|
|
51
|
-
--red-200: #ffdedc;
|
|
52
|
-
--red-300: #fdada5;
|
|
53
|
-
--red-400: #f77769;
|
|
54
|
-
--red-500: #ef4434;
|
|
55
|
-
--red-600: #cc2819;
|
|
56
|
-
--red-700: #8b2018;
|
|
57
|
-
--red-800: #4d1714;
|
|
58
|
-
--red-900: #321615;
|
|
59
|
-
--red-950: #1e1011;
|
|
60
|
-
--orange-50: #fff7f0;
|
|
61
|
-
--orange-100: #ffeadb;
|
|
62
|
-
--orange-200: #ffddc7;
|
|
63
|
-
--orange-300: #ffb685;
|
|
64
|
-
--orange-400: #ff8e42;
|
|
65
|
-
--orange-500: #fa6400;
|
|
66
|
-
--orange-600: #b14802;
|
|
67
|
-
--orange-700: #7c3404;
|
|
68
|
-
--orange-800: #461e07;
|
|
69
|
-
--orange-900: #32160b;
|
|
70
|
-
--orange-950: #21120d;
|
|
71
|
-
--yellow-50: #fefae1;
|
|
72
|
-
--yellow-100: #fcf3bb;
|
|
73
|
-
--yellow-200: #f9e994;
|
|
74
|
-
--yellow-300: #f7d455;
|
|
75
|
-
--yellow-400: #f9bc15;
|
|
76
|
-
--yellow-500: #d28a04;
|
|
77
|
-
--yellow-600: #965908;
|
|
78
|
-
--yellow-700: #653a0b;
|
|
79
|
-
--yellow-800: #3b220c;
|
|
80
|
-
--yellow-900: #271a11;
|
|
81
|
-
--yellow-950: #181410;
|
|
82
|
-
--green-50: #e7fef5;
|
|
83
|
-
--green-100: #c5fce8;
|
|
84
|
-
--green-200: #a9f9dc;
|
|
85
|
-
--green-300: #59f3ba;
|
|
86
|
-
--green-400: #0ff0a1;
|
|
87
|
-
--green-500: #04b97a;
|
|
88
|
-
--green-600: #01794f;
|
|
89
|
-
--green-700: #015133;
|
|
90
|
-
--green-800: #023120;
|
|
91
|
-
--green-900: #06231a;
|
|
92
|
-
--green-950: #071715;
|
|
93
|
-
--cyan-50: #e7fefe;
|
|
94
|
-
--cyan-100: #c5fcfc;
|
|
95
|
-
--cyan-200: #96f8f8;
|
|
96
|
-
--cyan-300: #62efef;
|
|
97
|
-
--cyan-400: #18e2e2;
|
|
98
|
-
--cyan-500: #04b8be;
|
|
99
|
-
--cyan-600: #037782;
|
|
100
|
-
--cyan-700: #024950;
|
|
101
|
-
--cyan-800: #042f34;
|
|
102
|
-
--cyan-900: #072227;
|
|
103
|
-
--cyan-950: #0d181c;
|
|
104
|
-
}
|
|
105
|
-
}
|
package/dist/ui-palette.min.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer s-palette{:root{--black:#0d0e12;--white:#fff;--gray-50:#f6f6f8;--gray-100:#eeeef1;--gray-200:#e3e4e8;--gray-300:#bbbdc9;--gray-400:#9499ad;--gray-500:#727892;--gray-600:#515870;--gray-700:#383d51;--gray-800:#252837;--gray-900:#1b1d27;--gray-950:#13141b;--blue-50:#f5f8ff;--blue-100:#e5edff;--blue-200:#dbe5ff;--blue-300:#a8bfff;--blue-400:#7595ff;--blue-500:#556bfc;--blue-600:#4043e7;--blue-700:#2927aa;--blue-800:#192457;--blue-900:#161a41;--blue-950:#101228;--purple-50:#f8f5ff;--purple-100:#f1ebff;--purple-200:#ece1fe;--purple-300:#ccb1fc;--purple-400:#b087f7;--purple-500:#8f57ef;--purple-600:#721fe5;--purple-700:#4c1a9e;--purple-800:#2f1862;--purple-900:#23173f;--purple-950:#181128;--magenta-50:#fef6f9;--magenta-100:#fde8ef;--magenta-200:#fcdee9;--magenta-300:#f7abc5;--magenta-400:#f0709b;--magenta-500:#e72767;--magenta-600:#b11651;--magenta-700:#7c1342;--magenta-800:#4b1130;--magenta-900:#341325;--magenta-950:#1f0f14;--red-50:#fff6f5;--red-100:#ffe7e5;--red-200:#ffdedc;--red-300:#fdada5;--red-400:#f77769;--red-500:#ef4434;--red-600:#cc2819;--red-700:#8b2018;--red-800:#4d1714;--red-900:#321615;--red-950:#1e1011;--orange-50:#fff7f0;--orange-100:#ffeadb;--orange-200:#ffddc7;--orange-300:#ffb685;--orange-400:#ff8e42;--orange-500:#fa6400;--orange-600:#b14802;--orange-700:#7c3404;--orange-800:#461e07;--orange-900:#32160b;--orange-950:#21120d;--yellow-50:#fefae1;--yellow-100:#fcf3bb;--yellow-200:#f9e994;--yellow-300:#f7d455;--yellow-400:#f9bc15;--yellow-500:#d28a04;--yellow-600:#965908;--yellow-700:#653a0b;--yellow-800:#3b220c;--yellow-900:#271a11;--yellow-950:#181410;--green-50:#e7fef5;--green-100:#c5fce8;--green-200:#a9f9dc;--green-300:#59f3ba;--green-400:#0ff0a1;--green-500:#04b97a;--green-600:#01794f;--green-700:#015133;--green-800:#023120;--green-900:#06231a;--green-950:#071715;--cyan-50:#e7fefe;--cyan-100:#c5fcfc;--cyan-200:#96f8f8;--cyan-300:#62efef;--cyan-400:#18e2e2;--cyan-500:#04b8be;--cyan-600:#037782;--cyan-700:#024950;--cyan-800:#042f34;--cyan-900:#072227;--cyan-950:#0d181c}}
|
package/src/css/_comp.test.ts
DELETED
package/src/css/_comp.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {_getClassNames} from './composeClassNames'
|
|
2
|
-
import {scopeClassName} from './scopeClassName'
|
|
3
|
-
|
|
4
|
-
export function _comp(...classNames: Array<string | false | undefined>): string | undefined {
|
|
5
|
-
return (
|
|
6
|
-
_getClassNames(...classNames)
|
|
7
|
-
.filter(Boolean)
|
|
8
|
-
.map(scopeClassName)
|
|
9
|
-
.join(' ') || undefined
|
|
10
|
-
)
|
|
11
|
-
}
|