@sanity/ui 3.0.0-static.2 → 3.0.0-static.21
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/README.md +7 -6
- package/bin/{ui.js → sanity-ui.cjs} +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +2488 -0
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -2
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/_visual-editing.js +2500 -0
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -2
- package/dist/_chunks-es/refractor.js.map +1 -0
- package/dist/_visual-editing.cjs +30 -0
- package/dist/_visual-editing.cjs.map +1 -0
- package/dist/_visual-editing.d.cts +893 -0
- package/dist/_visual-editing.d.ts +503 -416
- package/dist/_visual-editing.js +29 -30
- package/dist/_visual-editing.js.map +1 -1
- package/dist/css.cjs +598 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +14884 -0
- package/dist/css.d.ts +14379 -1630
- package/dist/css.js +480 -4594
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +2222 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +1284 -961
- package/dist/index.d.ts +1284 -961
- package/dist/index.js +1270 -592
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +2843 -2571
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +331 -311
- package/dist/theme.d.ts +331 -311
- package/dist/theme.js +2843 -2569
- package/dist/theme.js.map +1 -1
- package/dist/ui.css +22564 -0
- package/exports/_visual-editing.ts +0 -1
- package/package.json +84 -79
- package/src/cli/buildCommand.ts +3 -41
- package/src/cli/index.ts +2 -14
- package/src/core/_compat/helpers.ts +72 -0
- package/src/core/_compat/index.ts +1 -6
- 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 +4 -10
- package/src/core/_compat/theme/themeContext.ts +5 -5
- package/src/core/_compat/theme/themeProvider.tsx +19 -13
- package/src/core/_compat/theme/types.ts +2 -4
- package/src/core/_compat/theme/useRootTheme.ts +2 -4
- package/src/core/_compat/theme/useTheme.ts +3 -7
- package/src/core/_compat/types.ts +0 -73
- package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
- package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
- package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
- package/src/core/components/autocomplete/autocomplete.tsx +106 -140
- 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 +4 -9
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +32 -28
- package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
- package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
- package/src/core/components/dialog/__workshop__/position.tsx +4 -4
- package/src/core/components/dialog/__workshop__/props.tsx +7 -7
- package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
- package/src/core/components/dialog/dialog.tsx +104 -304
- package/src/core/components/dialog/dialogCard.tsx +190 -0
- package/src/core/components/dialog/dialogContext.ts +5 -3
- package/src/core/components/dialog/dialogProvider.tsx +6 -7
- package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/core/components/dialog/useDialog.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +41 -27
- package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
- 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 +4 -4
- 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__/tones.tsx +3 -3
- 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 +27 -35
- package/src/core/components/menu/menuButton.tsx +18 -24
- package/src/core/components/menu/menuContext.ts +1 -1
- package/src/core/components/menu/menuDivider.tsx +25 -15
- package/src/core/components/menu/menuGroup.tsx +39 -33
- package/src/core/components/menu/menuItem.tsx +58 -46
- 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 +3 -3
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
- package/src/core/components/skeleton/codeSkeleton.tsx +49 -0
- package/src/core/components/skeleton/headingSkeleton.tsx +48 -0
- package/src/core/components/skeleton/index.ts +3 -0
- package/src/core/components/skeleton/labelSkeleton.tsx +47 -0
- package/src/core/components/skeleton/skeleton.tsx +37 -18
- package/src/core/components/skeleton/textSkeleton.tsx +29 -112
- package/src/core/components/tab/__workshop__/example.tsx +2 -2
- package/src/core/components/tab/tab.tsx +28 -26
- package/src/core/components/tab/tabList.tsx +49 -28
- package/src/core/components/tab/tabPanel.tsx +29 -22
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/__workshop__/toast.tsx +5 -5
- package/src/core/components/toast/toast.test.tsx +5 -5
- package/src/core/components/toast/toast.tsx +30 -57
- package/src/core/components/toast/toastContext.ts +1 -1
- package/src/core/components/toast/toastLayer.tsx +29 -13
- package/src/core/components/toast/toastProvider.tsx +5 -10
- package/src/core/components/toast/types.ts +3 -7
- package/src/core/components/toast/useToast.ts +2 -4
- 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 +196 -191
- package/src/core/components/tree/treeContext.ts +1 -1
- package/src/core/components/tree/treeGroup.tsx +24 -6
- package/src/core/components/tree/treeItem.tsx +44 -34
- package/src/core/components/tree/types.ts +2 -2
- package/src/core/components/tree/useTree.ts +1 -1
- package/src/core/constants.ts +6 -0
- package/src/core/helpers/props.ts +18 -0
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useArrayProp.ts +1 -4
- package/src/core/hooks/useClickOutside.test.tsx +15 -16
- package/src/core/hooks/useClickOutside.ts +2 -6
- package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
- package/src/core/hooks/useClickOutsideEvent.ts +3 -9
- 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/useMatchMedia.ts +13 -31
- 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 +12 -12
- 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/hooks/useResponsiveProp.ts +28 -0
- package/src/core/index.ts +0 -1
- package/src/core/lib/isArray.ts +3 -0
- package/src/core/middleware/origin.ts +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +33 -24
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +43 -48
- package/src/core/primitives/avatar/avatarCounter.tsx +46 -39
- package/src/core/primitives/avatar/avatarStack.tsx +44 -45
- package/src/core/primitives/avatar/types.ts +3 -3
- package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/core/primitives/badge/badge.test.tsx +2 -3
- package/src/core/primitives/badge/badge.tsx +34 -40
- package/src/core/primitives/badge/types.ts +2 -1
- package/src/core/primitives/box/__workshop__/props.tsx +2 -2
- package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
- package/src/core/primitives/box/box.tsx +153 -88
- package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
- 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 +19 -22
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/core/primitives/button/button.test.tsx +3 -18
- package/src/core/primitives/button/button.tsx +67 -76
- package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
- package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
- 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 +3 -4
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +14 -17
- package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
- package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
- package/src/core/primitives/card/card.tsx +52 -48
- package/src/core/primitives/card/cardContext.ts +10 -0
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/core/primitives/card/index.ts +2 -0
- package/src/core/primitives/card/types.ts +19 -3
- package/src/core/primitives/card/useCard.ts +9 -0
- package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
- package/src/core/primitives/checkbox/checkbox.tsx +30 -23
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/__workshop__/props.tsx +4 -7
- package/src/core/primitives/code/code.tsx +27 -30
- package/src/core/primitives/code/refractor.tsx +0 -2
- package/src/core/primitives/container/__workshop__/example.tsx +2 -2
- package/src/core/primitives/container/container.tsx +27 -25
- package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
- package/src/core/primitives/flex/flex.tsx +44 -17
- package/src/core/primitives/grid/grid.tsx +20 -17
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
- package/src/core/primitives/heading/heading.tsx +51 -33
- package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
- package/src/core/primitives/inline/inline.tsx +46 -27
- package/src/core/primitives/inline/types.ts +1 -0
- package/src/core/primitives/kbd/kbd.tsx +28 -28
- package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
- package/src/core/primitives/label/label.tsx +49 -39
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
- 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 +299 -335
- package/src/core/primitives/popover/popoverLayer.tsx +147 -0
- package/src/core/primitives/popover/types.ts +3 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
- package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
- package/src/core/primitives/radio/radio.tsx +34 -19
- package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +28 -28
- package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -9
- package/src/core/primitives/spinner/spinner.tsx +27 -15
- package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/stack/stack.tsx +44 -20
- package/src/core/primitives/switch/switch.tsx +31 -17
- package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
- package/src/core/primitives/text/__workshop__/example.tsx +9 -20
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +52 -44
- package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
- package/src/core/primitives/textArea/textArea.tsx +47 -22
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
- package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
- package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
- package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
- package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +80 -106
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
- package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- 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 +107 -90
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -5
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +105 -0
- package/src/core/primitives/types.ts +19 -30
- package/src/core/types/avatar.ts +3 -6
- package/src/core/types/badge.ts +2 -4
- package/src/core/types/button.ts +2 -4
- package/src/core/types/card.ts +2 -4
- package/src/core/types/dialog.ts +1 -3
- package/src/core/types/flex.ts +3 -3
- package/src/core/types/props.ts +20 -10
- package/src/core/types/selectable.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +43 -28
- 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 +4 -10
- package/src/core/utils/boundaryElement/types.ts +1 -3
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
- package/src/core/utils/elementQuery/elementQuery.tsx +41 -19
- package/src/core/utils/errorBoundary.tsx +6 -4
- package/src/core/utils/index.ts +0 -1
- 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 +25 -95
- package/src/core/utils/layer/layerCard.tsx +90 -0
- package/src/core/utils/layer/layerContext.ts +1 -1
- package/src/core/utils/layer/layerProvider.tsx +20 -17
- package/src/core/utils/layer/useLayer.ts +2 -4
- 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.ts → portal.tsx} +17 -11
- package/src/core/utils/portal/portalContext.ts +1 -1
- package/src/core/utils/portal/portalProvider.tsx +4 -10
- package/src/core/utils/portal/types.ts +1 -3
- package/src/core/utils/portal/usePortal.ts +2 -4
- package/src/core/utils/srOnly/srOnly.tsx +25 -27
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +71 -55
- package/src/css/__theme/index.ts +16 -0
- package/src/css/__theme/lib/contract/buildVarContract.ts +78 -0
- package/src/css/__theme/lib/contract/index.ts +4 -0
- package/src/css/__theme/lib/contract/types.ts +17 -0
- package/src/css/__theme/resolveTheme.ts +865 -0
- package/src/css/_assign.ts +3 -0
- package/src/css/_composeClassNames.ts +12 -0
- package/src/css/_fromEntries.ts +3 -0
- package/src/css/_getClassNames.ts +9 -0
- package/src/css/_responsiveClassName.ts +45 -0
- package/src/css/_responsiveStyle.css.ts +34 -0
- package/src/css/_style.css.ts +9 -0
- package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
- package/src/css/components/dialog/dialog.css.ts +81 -0
- package/src/css/components/dialog/dialog.ts +20 -11
- package/src/css/components/index.ts +6 -0
- package/src/css/components/menu/menu.css.ts +14 -0
- package/src/css/components/menu/menu.ts +8 -5
- package/src/css/components/skeleton/skeleton.css.ts +132 -0
- package/src/css/components/skeleton/skeleton.ts +14 -9
- package/src/css/components/skeleton/types.ts +13 -5
- package/src/css/components/toast/toast.css.ts +16 -0
- package/src/css/components/toast/toast.ts +5 -15
- package/src/css/components/tree/tree.css.ts +65 -0
- package/src/css/components/tree/tree.ts +5 -3
- package/src/css/constants.ts +10 -0
- package/src/css/defaultTheme.css.ts +468 -0
- package/src/css/index.ts +12 -38
- package/src/css/layers.css.ts +9 -0
- package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
- package/src/css/primitives/_arrow/_arrow.ts +18 -6
- package/src/css/primitives/_input/_input.css.ts +258 -0
- package/src/css/primitives/_input/input.ts +17 -14
- package/src/css/primitives/_input/types.ts +3 -3
- package/src/css/primitives/_selectable/_selectable.css.ts +121 -0
- package/src/css/primitives/_selectable/selectable.ts +5 -5
- package/src/css/primitives/_selectable/types.ts +3 -2
- package/src/css/primitives/avatar/avatar.css.ts +175 -0
- package/src/css/primitives/avatar/avatar.ts +52 -11
- package/src/css/primitives/avatar/types.ts +5 -3
- package/src/css/primitives/badge/badge.css.ts +26 -0
- package/src/css/primitives/badge/badge.ts +4 -4
- package/src/css/primitives/badge/types.ts +5 -4
- package/src/css/primitives/box/box.css.ts +19 -0
- package/src/css/primitives/box/box.ts +52 -16
- package/src/css/primitives/box/types.ts +46 -22
- package/src/css/primitives/button/button.css.ts +285 -0
- package/src/css/primitives/button/button.ts +15 -33
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +19 -0
- package/src/css/primitives/card/card.css.ts +365 -0
- package/src/css/primitives/card/card.ts +9 -12
- package/src/css/primitives/card/types.ts +4 -6
- package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
- package/src/css/primitives/checkbox/checkbox.ts +13 -5
- package/src/css/primitives/code/code.css.ts +271 -0
- package/src/css/primitives/code/code.ts +13 -5
- package/src/css/primitives/code/types.ts +4 -3
- package/src/css/primitives/container/container.css.ts +4 -0
- package/src/css/primitives/container/container.ts +12 -4
- package/src/css/primitives/container/types.ts +4 -2
- package/src/css/primitives/heading/heading.css.ts +85 -0
- package/src/css/primitives/heading/heading.ts +13 -11
- package/src/css/primitives/heading/types.ts +6 -3
- package/src/css/primitives/index.ts +24 -0
- package/src/css/primitives/kbd/kbd.css.ts +16 -0
- package/src/css/primitives/kbd/kbd.ts +6 -4
- package/src/css/primitives/kbd/types.ts +2 -3
- package/src/css/primitives/label/label.css.ts +85 -0
- package/src/css/primitives/label/label.ts +13 -10
- package/src/css/primitives/label/types.ts +13 -5
- package/src/css/primitives/popover/popover.css.ts +6 -0
- package/src/css/primitives/popover/popover.ts +10 -3
- package/src/css/primitives/radio/radio.css.ts +78 -0
- package/src/css/primitives/radio/radio.ts +15 -3
- package/src/css/primitives/select/select.css.ts +24 -0
- package/src/css/primitives/select/select.ts +7 -4
- package/src/css/primitives/select/types.ts +1 -1
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/spinner.css.ts +23 -0
- package/src/css/primitives/spinner/spinner.ts +9 -5
- package/src/css/primitives/spinner/types.ts +4 -0
- package/src/css/primitives/stack/index.ts +1 -0
- package/src/css/primitives/stack/stack.css.ts +6 -0
- package/src/css/primitives/stack/stack.ts +7 -0
- package/src/css/primitives/switch/switch.css.ts +98 -0
- package/src/css/primitives/switch/switch.ts +13 -7
- package/src/css/primitives/text/text.css.ts +85 -0
- package/src/css/primitives/text/text.ts +13 -11
- package/src/css/primitives/text/types.ts +9 -3
- package/src/css/primitives/textArea/textArea.css.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +5 -3
- package/src/css/primitives/textArea/types.ts +5 -3
- package/src/css/primitives/textInput/textInput.css.ts +41 -0
- package/src/css/primitives/textInput/textInput.ts +20 -4
- package/src/css/primitives/textInput/types.ts +3 -7
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/tooltip.css.ts +6 -0
- package/src/css/primitives/tooltip/tooltip.ts +8 -7
- package/src/css/primitives/tooltip/types.ts +4 -0
- package/src/css/props/alignItems/alignItems.css.ts +22 -0
- package/src/css/props/alignItems/alignItems.ts +8 -0
- package/src/css/props/alignItems/index.ts +2 -0
- package/src/css/props/alignItems/types.ts +9 -0
- package/src/css/props/border/border.css.ts +65 -0
- package/src/css/props/border/border.ts +36 -0
- package/src/css/props/border/types.ts +13 -0
- package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
- package/src/css/props/boxSizing/boxSizing.ts +10 -0
- package/src/css/props/boxSizing/index.ts +2 -0
- package/src/css/props/boxSizing/types.ts +7 -0
- package/src/css/props/display/display.css.ts +56 -0
- package/src/css/props/display/display.ts +17 -0
- package/src/css/{styles → props}/display/types.ts +3 -4
- package/src/css/props/flex/flex.css.ts +52 -0
- package/src/css/props/flex/flex.ts +8 -0
- package/src/css/props/flex/types.ts +9 -0
- package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
- package/src/css/props/flexDirection/flexDirection.ts +8 -0
- package/src/css/props/flexDirection/index.ts +2 -0
- package/src/css/props/flexDirection/types.ts +9 -0
- package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
- package/src/css/props/flexWrap/flexWrap.ts +8 -0
- package/src/css/props/flexWrap/index.ts +2 -0
- package/src/css/props/flexWrap/types.ts +9 -0
- package/src/css/props/font/font.css.ts +93 -0
- package/src/css/props/font/font.ts +8 -0
- package/src/css/props/font/types.ts +6 -0
- package/src/css/props/gap/gap.css.ts +40 -0
- package/src/css/props/gap/gap.ts +13 -0
- package/src/css/{styles → props}/gap/types.ts +2 -2
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
- package/src/css/props/gridAutoColumns/index.ts +2 -0
- package/src/css/props/gridAutoColumns/types.ts +19 -0
- package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
- package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
- package/src/css/props/gridAutoFlow/index.ts +2 -0
- package/src/css/props/gridAutoFlow/types.ts +13 -0
- package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
- package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
- package/src/css/props/gridAutoRows/index.ts +2 -0
- package/src/css/props/gridAutoRows/types.ts +13 -0
- package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
- package/src/css/props/gridColumn/gridColumn.ts +8 -0
- package/src/css/props/gridColumn/index.ts +2 -0
- package/src/css/props/gridColumn/types.ts +19 -0
- package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
- package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
- package/src/css/props/gridColumnEnd/index.ts +2 -0
- package/src/css/props/gridColumnEnd/types.ts +19 -0
- package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
- package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
- package/src/css/props/gridColumnStart/index.ts +2 -0
- package/src/css/props/gridColumnStart/types.ts +19 -0
- package/src/css/props/gridRow/gridRow.css.ts +49 -0
- package/src/css/props/gridRow/gridRow.ts +8 -0
- package/src/css/props/gridRow/index.ts +2 -0
- package/src/css/props/gridRow/types.ts +19 -0
- package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
- package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
- package/src/css/props/gridRowEnd/index.ts +2 -0
- package/src/css/props/gridRowEnd/types.ts +19 -0
- package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
- package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
- package/src/css/props/gridRowStart/index.ts +2 -0
- package/src/css/props/gridRowStart/types.ts +19 -0
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
- package/src/css/props/gridTemplateColumns/index.ts +2 -0
- package/src/css/props/gridTemplateColumns/types.ts +19 -0
- package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
- package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
- package/src/css/props/gridTemplateRows/index.ts +2 -0
- package/src/css/props/gridTemplateRows/types.ts +19 -0
- package/src/css/props/height/height.css.ts +25 -0
- package/src/css/props/height/height.ts +8 -0
- package/src/css/props/height/index.ts +2 -0
- package/src/css/props/height/types.ts +15 -0
- package/src/css/props/index.ts +37 -0
- package/src/css/props/inset/inset.css.ts +37 -0
- package/src/css/props/inset/inset.ts +21 -0
- package/src/css/{styles → props}/inset/types.ts +1 -1
- package/src/css/props/justifyContent/index.ts +2 -0
- package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
- package/src/css/props/justifyContent/justifyContent.ts +8 -0
- package/src/css/props/justifyContent/types.ts +15 -0
- package/src/css/props/margin/margin.css.ts +117 -0
- package/src/css/props/margin/margin.ts +25 -0
- package/src/css/props/margin/types.ts +17 -0
- package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
- package/src/css/props/maxWidth/maxWidth.ts +8 -0
- package/src/css/props/maxWidth/types.ts +11 -0
- package/src/css/props/minHeight/index.ts +2 -0
- package/src/css/props/minHeight/minHeight.css.ts +13 -0
- package/src/css/props/minHeight/minHeight.ts +8 -0
- package/src/css/props/minHeight/types.ts +9 -0
- package/src/css/props/minWidth/index.ts +2 -0
- package/src/css/props/minWidth/minWidth.css.ts +25 -0
- package/src/css/props/minWidth/minWidth.ts +8 -0
- package/src/css/props/minWidth/types.ts +9 -0
- package/src/css/props/outline/index.ts +2 -0
- package/src/css/props/outline/outline.css.ts +10 -0
- package/src/css/props/outline/outline.ts +8 -0
- package/src/css/props/outline/types.ts +7 -0
- package/src/css/props/overflow/overflow.css.ts +16 -0
- package/src/css/props/overflow/overflow.ts +8 -0
- package/src/css/props/overflow/types.ts +17 -0
- package/src/css/props/padding/padding.css.ts +87 -0
- package/src/css/props/padding/padding.ts +25 -0
- package/src/css/props/padding/types.ts +17 -0
- package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
- package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
- package/src/css/props/position/position.css.ts +22 -0
- package/src/css/props/position/position.ts +8 -0
- package/src/css/{styles → props}/position/types.ts +1 -1
- package/src/css/props/radius/radius.css.ts +21 -0
- package/src/css/props/radius/radius.ts +8 -0
- package/src/css/props/radius/types.ts +8 -0
- package/src/css/props/shadow/shadow.css.ts +23 -0
- package/src/css/props/shadow/shadow.ts +8 -0
- package/src/css/props/shadow/types.ts +8 -0
- package/src/css/props/textAlign/index.ts +2 -0
- package/src/css/props/textAlign/textAlign.css.ts +22 -0
- package/src/css/props/textAlign/textAlign.ts +8 -0
- package/src/css/props/textAlign/types.ts +7 -0
- package/src/css/props/textOverflow/textOverflow.css.ts +13 -0
- package/src/css/props/textOverflow/textOverflow.ts +8 -0
- package/src/css/{styles → props}/textOverflow/types.ts +5 -1
- package/src/css/props/width/types.ts +11 -0
- package/src/css/props/width/width.css.ts +28 -0
- package/src/css/props/width/width.ts +8 -0
- package/src/css/types.ts +221 -766
- package/src/css/util.ts +3 -8
- package/src/css/utils/index.ts +1 -0
- package/src/css/utils/srOnly/srOnly.css.ts +10 -0
- package/src/css/utils/srOnly/srOnly.ts +5 -3
- package/src/css/vars.css.ts +676 -0
- package/src/theme/getScopedTheme.ts +4 -4
- package/src/theme/index.ts +0 -5
- package/src/theme/types.ts +6 -10
- 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/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -19
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v0/styles.ts +1 -1
- package/src/theme/v0/theme.ts +7 -7
- package/src/theme/v2/avatar.ts +2 -4
- 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/v2/build/buildTheme.ts +12 -0
- 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 +2 -4
- package/src/theme/v2/color/avatar.ts +3 -7
- package/src/theme/v2/color/badge.ts +3 -7
- package/src/theme/v2/color/button.ts +5 -11
- package/src/theme/v2/color/color.ts +10 -16
- package/src/theme/v2/color/input.ts +8 -10
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +4 -8
- package/src/theme/v2/color/state.ts +5 -7
- package/src/theme/v2/color/syntax.ts +1 -3
- 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 +3 -3
- package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
- package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
- package/src/theme/v2/index.ts +2 -0
- package/src/theme/v2/input.ts +2 -4
- package/src/theme/v2/theme.ts +10 -14
- package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
- package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
- package/src/theme/v3/buildTheme_v3.ts +20 -11
- 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 +58 -95
- package/src/theme/v3/color/color.ts +75 -71
- 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 +19 -4
- package/src/theme/v3/color/tokens.ts +2 -2
- package/src/theme/v3/defaultFonts.ts +250 -0
- package/src/theme/v3/defaultTokens.ts +199 -0
- package/src/theme/v3/index.ts +4 -1
- package/src/theme/{palette → v3/palette}/constants.ts +3 -3
- package/src/theme/v3/palette/types.ts +7 -0
- package/src/theme/v3/resolveTokens.ts +70 -65
- package/src/theme/v3/tokens.ts +2 -2
- package/src/theme/v3/types.ts +97 -12
- 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 +62 -40
- package/dist/_chunks-cjs/_visual-editing.js +0 -3059
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/buildCommand.js +0 -32
- package/dist/_chunks-cjs/buildCommand.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-cjs/v3_v2.js +0 -251
- package/dist/_chunks-cjs/v3_v2.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs +0 -3066
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_chunks-es/v3_v2.mjs +0 -252
- package/dist/_chunks-es/v3_v2.mjs.map +0 -1
- package/dist/_visual-editing.d.mts +0 -806
- package/dist/_visual-editing.mjs +0 -31
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -357
- package/dist/cli.js.map +0 -1
- package/dist/css.d.mts +0 -2135
- package/dist/css.mjs +0 -4713
- package/dist/css.mjs.map +0 -1
- package/dist/index.mjs +0 -1542
- package/dist/index.mjs.map +0 -1
- package/dist/sanity-palette.css +0 -9
- package/dist/sanity-theme.css +0 -1
- package/dist/system.css +0 -3577
- package/dist/theme.mjs.map +0 -1
- package/src/core/StyleTags.tsx +0 -24
- package/src/core/primitives/popover/popoverCard.tsx +0 -148
- package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/core/utils/conditionalWrapper/index.ts +0 -1
- package/src/css/_resp.ts +0 -31
- package/src/css/compile/compilePalette.ts +0 -60
- package/src/css/compile/compileRule.ts +0 -90
- package/src/css/compile/compileRules.test.ts +0 -35
- package/src/css/compile/compileRules.ts +0 -40
- package/src/css/compile/compileSystem.ts +0 -7
- package/src/css/compile/compileTheme.ts +0 -15
- package/src/css/compile/compileTheme_v3.ts +0 -410
- package/src/css/compile/types.ts +0 -6
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -76
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/components/skeleton/rules.ts +0 -112
- package/src/css/components/toast/rules.ts +0 -17
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/composeClassNames.ts +0 -13
- package/src/css/primitives/_arrow/rules.ts +0 -71
- package/src/css/primitives/_input/rules.ts +0 -163
- package/src/css/primitives/_selectable/__style.ts +0 -117
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/_selectable/rules.ts +0 -129
- package/src/css/primitives/avatar/rules.ts +0 -176
- package/src/css/primitives/badge/rules.ts +0 -22
- package/src/css/primitives/box/rules.ts +0 -28
- package/src/css/primitives/button/_constants.ts +0 -17
- package/src/css/primitives/button/rules.ts +0 -293
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/css/primitives/card/rules.ts +0 -471
- package/src/css/primitives/checkbox/__styles.ts +0 -129
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/select/rules.ts +0 -22
- package/src/css/primitives/spinner/rules.ts +0 -20
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/token/rules.ts +0 -45
- package/src/css/primitives/tooltip/rules.ts +0 -19
- package/src/css/responsiveRules.ts +0 -25
- package/src/css/rules.ts +0 -113
- package/src/css/styles/border/border.ts +0 -22
- package/src/css/styles/border/rules.ts +0 -24
- package/src/css/styles/border/types.ts +0 -10
- package/src/css/styles/display/display.ts +0 -7
- package/src/css/styles/display/rules.ts +0 -62
- package/src/css/styles/flex/flex.ts +0 -20
- package/src/css/styles/flex/rules.ts +0 -28
- package/src/css/styles/flex/types.ts +0 -35
- package/src/css/styles/flexItem/flexItem.ts +0 -8
- package/src/css/styles/flexItem/index.ts +0 -2
- package/src/css/styles/flexItem/rules.ts +0 -12
- package/src/css/styles/flexItem/types.ts +0 -11
- package/src/css/styles/font/font.ts +0 -17
- package/src/css/styles/font/rules.ts +0 -148
- package/src/css/styles/font/types.ts +0 -12
- package/src/css/styles/gap/gap.ts +0 -8
- package/src/css/styles/gap/rules.ts +0 -34
- package/src/css/styles/grid/grid.ts +0 -13
- package/src/css/styles/grid/index.ts +0 -2
- package/src/css/styles/grid/rules.ts +0 -146
- package/src/css/styles/grid/types.ts +0 -29
- package/src/css/styles/gridItem/gridItem.ts +0 -15
- package/src/css/styles/gridItem/index.ts +0 -2
- package/src/css/styles/gridItem/rules.ts +0 -96
- package/src/css/styles/gridItem/types.ts +0 -41
- package/src/css/styles/height/rules.ts +0 -7
- package/src/css/styles/index.ts +0 -19
- package/src/css/styles/inset/inset.ts +0 -13
- package/src/css/styles/inset/rules.ts +0 -16
- package/src/css/styles/margin/margin.ts +0 -15
- package/src/css/styles/margin/rules.ts +0 -64
- package/src/css/styles/margin/types.ts +0 -11
- package/src/css/styles/maxWidth/maxWidth.ts +0 -6
- package/src/css/styles/maxWidth/rules.ts +0 -13
- package/src/css/styles/maxWidth/types.ts +0 -7
- package/src/css/styles/outline/rules.ts +0 -7
- package/src/css/styles/overflow/overflow.ts +0 -11
- package/src/css/styles/overflow/rules.ts +0 -9
- package/src/css/styles/overflow/types.ts +0 -11
- package/src/css/styles/padding/padding.ts +0 -15
- package/src/css/styles/padding/rules.ts +0 -62
- package/src/css/styles/padding/types.ts +0 -14
- package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
- package/src/css/styles/pointerEvents/rules.ts +0 -11
- package/src/css/styles/position/position.ts +0 -7
- package/src/css/styles/position/rules.ts +0 -24
- package/src/css/styles/radius/radius.ts +0 -8
- package/src/css/styles/radius/rules.ts +0 -13
- package/src/css/styles/radius/types.ts +0 -8
- package/src/css/styles/shadow/rules.ts +0 -53
- package/src/css/styles/shadow/shadow.ts +0 -7
- package/src/css/styles/shadow/types.ts +0 -8
- package/src/css/styles/textOverflow/rules.ts +0 -17
- package/src/css/styles/textOverflow/textOverflow.ts +0 -6
- package/src/css/styles/width/rules.ts +0 -7
- package/src/css/styles/width/types.ts +0 -9
- package/src/css/styles/width/width.ts +0 -6
- package/src/css/utils/srOnly/rules.ts +0 -11
- package/src/css/varNames.ts +0 -473
- package/src/css/vars.ts +0 -443
- package/src/theme/_types.ts +0 -41
- package/src/theme/build/buildTheme.ts +0 -12
- 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/palette/types.ts +0 -16
- package/src/theme/v3/buildTheme_v3.test.ts +0 -40
- package/src/theme/v3/color/buildColor_v3.ts +0 -193
- package/src/theme/v3/color/parseColor.test.ts +0 -79
- package/src/theme/v3/color/renderColor.test.ts +0 -19
- package/src/theme/v3/color/renderColor.ts +0 -33
- package/src/theme/v3/defaults.ts +0 -205
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
- /package/src/css/{styles → props}/border/index.ts +0 -0
- /package/src/css/{styles → props}/display/index.ts +0 -0
- /package/src/css/{styles → props}/flex/index.ts +0 -0
- /package/src/css/{styles → props}/font/index.ts +0 -0
- /package/src/css/{styles → props}/gap/index.ts +0 -0
- /package/src/css/{styles → props}/inset/index.ts +0 -0
- /package/src/css/{styles → props}/margin/index.ts +0 -0
- /package/src/css/{styles → props}/maxWidth/index.ts +0 -0
- /package/src/css/{styles → props}/overflow/index.ts +0 -0
- /package/src/css/{styles → props}/padding/index.ts +0 -0
- /package/src/css/{styles → props}/pointerEvents/index.ts +0 -0
- /package/src/css/{styles → props}/pointerEvents/types.ts +0 -0
- /package/src/css/{styles → props}/position/index.ts +0 -0
- /package/src/css/{styles → props}/radius/index.ts +0 -0
- /package/src/css/{styles → props}/shadow/index.ts +0 -0
- /package/src/css/{styles → props}/textOverflow/index.ts +0 -0
- /package/src/css/{styles → props}/width/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}/index.ts +0 -0
package/dist/css.mjs
DELETED
|
@@ -1,4713 +0,0 @@
|
|
|
1
|
-
import { v3_v2 } from "./_chunks-es/v3_v2.mjs";
|
|
2
|
-
import { HUES, TINTS, SPACE, FONT_TEXT_SIZE, FONT_LABEL_SIZE, FONT_HEADING_SIZE, FONT_CODE_SIZE, AVATAR_SIZE, THEME_COLOR_STATE_TONES, THEME_COLOR_CARD_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BUTTON_MODES, renderColor } from "@sanity/ui/theme";
|
|
3
|
-
function compileRule(selector, props, context) {
|
|
4
|
-
let css = compileProperties(selector, props);
|
|
5
|
-
if (props["@nest"] && (css += compileNestedRules(selector, props["@nest"], context)), props["@keyframes"])
|
|
6
|
-
for (const name in props["@keyframes"])
|
|
7
|
-
context.keyframes[name] = props["@keyframes"][name];
|
|
8
|
-
if (props["@media"])
|
|
9
|
-
for (const key in props["@media"])
|
|
10
|
-
context.media[key] || (context.media[key] = {}), context.media[key][selector] = props["@media"][key];
|
|
11
|
-
return css;
|
|
12
|
-
}
|
|
13
|
-
function compileProperties(selector, props) {
|
|
14
|
-
let css = "{";
|
|
15
|
-
for (const key in props) {
|
|
16
|
-
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
17
|
-
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
18
|
-
for (const v of valueArr)
|
|
19
|
-
css += toSnakeCase(key) + ":" + v + ";";
|
|
20
|
-
}
|
|
21
|
-
return css === "{" ? "" : selector + css + "}";
|
|
22
|
-
}
|
|
23
|
-
function compileNestedRules(selector, props, context) {
|
|
24
|
-
if (!props) return "";
|
|
25
|
-
let css = "";
|
|
26
|
-
for (const [_selector, _props] of Object.entries(props))
|
|
27
|
-
css += `
|
|
28
|
-
` + compileRule(_selector.replace(/&/g, selector), _props, context);
|
|
29
|
-
return css;
|
|
30
|
-
}
|
|
31
|
-
function compileMediaQueryRule(query, rules2) {
|
|
32
|
-
let css = `@media ${query}{`;
|
|
33
|
-
for (const [selector, props] of Object.entries(rules2))
|
|
34
|
-
css += `
|
|
35
|
-
` + compileProperties(selector, props), props["@nest"] && (css += compileNestedRules(selector, props["@nest"], {
|
|
36
|
-
keyframes: {},
|
|
37
|
-
media: {}
|
|
38
|
-
}));
|
|
39
|
-
return css + `
|
|
40
|
-
}`;
|
|
41
|
-
}
|
|
42
|
-
function toSnakeCase(value) {
|
|
43
|
-
return value.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
|
|
44
|
-
}
|
|
45
|
-
function compilePalette(config) {
|
|
46
|
-
const props = {
|
|
47
|
-
"--l-min": `${config.luminosity.min * 100}%`,
|
|
48
|
-
"--l-max": `${config.luminosity.max * 100}%`,
|
|
49
|
-
"--l-range": "calc(var(--l-max) - var(--l-min))",
|
|
50
|
-
"--c-min": `${config.chroma.min}`,
|
|
51
|
-
"--c-max": `${config.chroma.max}`,
|
|
52
|
-
"--c-range": "calc(var(--c-max) - var(--c-min))",
|
|
53
|
-
...compileHues(config.hues),
|
|
54
|
-
"--black": `oklch(
|
|
55
|
-
calc(var(--l-min) + 0.0 * var(--l-range))
|
|
56
|
-
calc(var(--c-min) + 0.0 * var(--gray-c-range))
|
|
57
|
-
var(--gray-h)
|
|
58
|
-
)`,
|
|
59
|
-
"--white": `oklch(
|
|
60
|
-
calc(var(--l-min) + 1.0 * var(--l-range))
|
|
61
|
-
calc(var(--c-min) + 0.0 * var(--gray-c-range))
|
|
62
|
-
var(--gray-h)
|
|
63
|
-
)`
|
|
64
|
-
};
|
|
65
|
-
return compileRule(":root", props, {
|
|
66
|
-
keyframes: {},
|
|
67
|
-
media: {}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function compileHues(hues) {
|
|
71
|
-
const rules2 = {};
|
|
72
|
-
for (const hue of HUES) {
|
|
73
|
-
const {
|
|
74
|
-
c,
|
|
75
|
-
h
|
|
76
|
-
} = hues[hue];
|
|
77
|
-
rules2[`--${hue}-h`] = `${h}`, rules2[`--${hue}-c`] = `${c}`, rules2[`--${hue}-c-max`] = `min(var(--c-max), var(--${hue}-c))`, rules2[`--${hue}-c-range`] = `calc(var(--${hue}-c-max) - var(--c-min))`;
|
|
78
|
-
for (const tint of TINTS) {
|
|
79
|
-
const l_offset = parseFloat((1 - tint / 1e3).toFixed(2)), c_offset_tmp = tint / 500, c_offset = parseFloat((c_offset_tmp < 1 ? c_offset_tmp : 2 - c_offset_tmp).toFixed(1));
|
|
80
|
-
rules2[`--${hue}-${tint}`] = ["oklch(", `calc(var(--l-min) + ${l_offset} * var(--l-range)) `, `calc(var(--c-min) + ${c_offset} * var(--${hue}-c-range)) `, `var(--${hue}-h)`, ")"].join("");
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return rules2;
|
|
84
|
-
}
|
|
85
|
-
const breadcrumbsRules = {
|
|
86
|
-
breadcrumbs: {
|
|
87
|
-
lineHeight: 0
|
|
88
|
-
}
|
|
89
|
-
}, varNames = {
|
|
90
|
-
avatar: {
|
|
91
|
-
distance: "--avatar-distance",
|
|
92
|
-
focusRing: {
|
|
93
|
-
offset: "--avatar-focus-ring-offset",
|
|
94
|
-
width: "--avatar-focus-ring-width"
|
|
95
|
-
},
|
|
96
|
-
size: "--avatar-size",
|
|
97
|
-
sizes: AVATAR_SIZE.reduce((acc, size) => ({
|
|
98
|
-
...acc,
|
|
99
|
-
[size]: {
|
|
100
|
-
distance: `--avatar-${size}-distance`,
|
|
101
|
-
size: `--avatar-${size}-size`
|
|
102
|
-
}
|
|
103
|
-
}), {})
|
|
104
|
-
},
|
|
105
|
-
color: {
|
|
106
|
-
// card scope
|
|
107
|
-
accent: {
|
|
108
|
-
fg: "--color-accent-fg"
|
|
109
|
-
},
|
|
110
|
-
avatar: {
|
|
111
|
-
bg: "--color-avatar-bg",
|
|
112
|
-
fg: "--color-avatar-fg",
|
|
113
|
-
gray: {
|
|
114
|
-
bg: "--color-avatar-gray-bg",
|
|
115
|
-
fg: "--color-avatar-gray-fg"
|
|
116
|
-
},
|
|
117
|
-
blue: {
|
|
118
|
-
bg: "--color-avatar-blue-bg",
|
|
119
|
-
fg: "--color-avatar-blue-fg"
|
|
120
|
-
},
|
|
121
|
-
purple: {
|
|
122
|
-
bg: "--color-avatar-purple-bg",
|
|
123
|
-
fg: "--color-avatar-purple-fg"
|
|
124
|
-
},
|
|
125
|
-
magenta: {
|
|
126
|
-
bg: "--color-avatar-magenta-bg",
|
|
127
|
-
fg: "--color-avatar-magenta-fg"
|
|
128
|
-
},
|
|
129
|
-
red: {
|
|
130
|
-
bg: "--color-avatar-red-bg",
|
|
131
|
-
fg: "--color-avatar-red-fg"
|
|
132
|
-
},
|
|
133
|
-
orange: {
|
|
134
|
-
bg: "--color-avatar-orange-bg",
|
|
135
|
-
fg: "--color-avatar-gray-fg"
|
|
136
|
-
},
|
|
137
|
-
yellow: {
|
|
138
|
-
bg: "--color-avatar-yellow-bg",
|
|
139
|
-
fg: "--color-avatar-yellow-fg"
|
|
140
|
-
},
|
|
141
|
-
green: {
|
|
142
|
-
bg: "--color-avatar-green-bg",
|
|
143
|
-
fg: "--color-avatar-green-fg"
|
|
144
|
-
},
|
|
145
|
-
cyan: {
|
|
146
|
-
bg: "--color-avatar-cyan-bg",
|
|
147
|
-
fg: "--color-avatar-yellow-fg"
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
backdrop: "--color-backdrop",
|
|
151
|
-
bg: "--color-bg",
|
|
152
|
-
border: "--color-border",
|
|
153
|
-
fg: "--color-fg",
|
|
154
|
-
focusRing: "--color-focus-ring",
|
|
155
|
-
input: {
|
|
156
|
-
bg: "--color-input-bg",
|
|
157
|
-
border: "--color-input-border",
|
|
158
|
-
fg: "--color-input-fg",
|
|
159
|
-
placeholder: "--color-input-placeholder"
|
|
160
|
-
},
|
|
161
|
-
link: {
|
|
162
|
-
fg: "--color-link-fg"
|
|
163
|
-
},
|
|
164
|
-
muted: {
|
|
165
|
-
bg: "--color-muted-bg",
|
|
166
|
-
fg: "--color-muted-fg"
|
|
167
|
-
},
|
|
168
|
-
shadow: {
|
|
169
|
-
outline: "--color-shadow-outline",
|
|
170
|
-
umbra: "--color-shadow-umbra",
|
|
171
|
-
penumbra: "--color-shadow-penumbra",
|
|
172
|
-
ambient: "--color-shadow-ambient"
|
|
173
|
-
},
|
|
174
|
-
skeleton: {
|
|
175
|
-
from: "--color-skeleton-from",
|
|
176
|
-
to: "--color-skeleton-to"
|
|
177
|
-
},
|
|
178
|
-
token: {
|
|
179
|
-
atrule: "--color-token-atrule",
|
|
180
|
-
attrName: "--color-token-attr-name",
|
|
181
|
-
attrValue: "--color-token-attr-value",
|
|
182
|
-
attribute: "--color-token-attribute",
|
|
183
|
-
boolean: "--color-token-boolean",
|
|
184
|
-
builtin: "--color-token-builtin",
|
|
185
|
-
cdata: "--color-token-cdata",
|
|
186
|
-
char: "--color-token-char",
|
|
187
|
-
class: "--color-token-class",
|
|
188
|
-
className: "--color-token-class-name",
|
|
189
|
-
comment: "--color-token-comment",
|
|
190
|
-
constant: "--color-token-constant",
|
|
191
|
-
deleted: "--color-token-deleted",
|
|
192
|
-
doctype: "--color-token-doctype",
|
|
193
|
-
entity: "--color-token-entity",
|
|
194
|
-
function: "--color-token-function",
|
|
195
|
-
hexcode: "--color-token-hexcode",
|
|
196
|
-
id: "--color-token-id",
|
|
197
|
-
important: "--color-token-important",
|
|
198
|
-
inserted: "--color-token-inserted",
|
|
199
|
-
keyword: "--color-token-keyword",
|
|
200
|
-
number: "--color-token-number",
|
|
201
|
-
operator: "--color-token-operator",
|
|
202
|
-
prolog: "--color-token-prolog",
|
|
203
|
-
property: "--color-token-property",
|
|
204
|
-
pseudoClass: "--color-token-pseudo-class",
|
|
205
|
-
pseudoElement: "--color-token-pseudo-element",
|
|
206
|
-
punctuation: "--color-token-punctuation",
|
|
207
|
-
regex: "--color-token-regex",
|
|
208
|
-
selector: "--color-token-selector",
|
|
209
|
-
string: "--color-token-string",
|
|
210
|
-
symbol: "--color-token-symbol",
|
|
211
|
-
tag: "--color-token-tag",
|
|
212
|
-
unit: "--color-token-unit",
|
|
213
|
-
url: "--color-token-url",
|
|
214
|
-
variable: "--color-token-variable"
|
|
215
|
-
},
|
|
216
|
-
solid: buildColorVariantVarNames({
|
|
217
|
-
variant: "solid"
|
|
218
|
-
}),
|
|
219
|
-
tinted: buildColorVariantVarNames({
|
|
220
|
-
variant: "tinted"
|
|
221
|
-
}),
|
|
222
|
-
// tone scopes
|
|
223
|
-
transparent: buildColorCardVarNames({
|
|
224
|
-
tone: "transparent"
|
|
225
|
-
}),
|
|
226
|
-
default: buildColorCardVarNames({
|
|
227
|
-
tone: "default"
|
|
228
|
-
}),
|
|
229
|
-
neutral: buildColorCardVarNames({
|
|
230
|
-
tone: "neutral"
|
|
231
|
-
}),
|
|
232
|
-
primary: buildColorCardVarNames({
|
|
233
|
-
tone: "primary"
|
|
234
|
-
}),
|
|
235
|
-
suggest: buildColorCardVarNames({
|
|
236
|
-
tone: "suggest"
|
|
237
|
-
}),
|
|
238
|
-
positive: buildColorCardVarNames({
|
|
239
|
-
tone: "positive"
|
|
240
|
-
}),
|
|
241
|
-
caution: buildColorCardVarNames({
|
|
242
|
-
tone: "caution"
|
|
243
|
-
}),
|
|
244
|
-
critical: buildColorCardVarNames({
|
|
245
|
-
tone: "critical"
|
|
246
|
-
}),
|
|
247
|
-
// scheme scope
|
|
248
|
-
dark: {
|
|
249
|
-
transparent: buildColorCardVarNames({
|
|
250
|
-
scheme: "dark",
|
|
251
|
-
tone: "transparent"
|
|
252
|
-
}),
|
|
253
|
-
default: buildColorCardVarNames({
|
|
254
|
-
scheme: "dark",
|
|
255
|
-
tone: "default"
|
|
256
|
-
}),
|
|
257
|
-
neutral: buildColorCardVarNames({
|
|
258
|
-
scheme: "dark",
|
|
259
|
-
tone: "neutral"
|
|
260
|
-
}),
|
|
261
|
-
primary: buildColorCardVarNames({
|
|
262
|
-
scheme: "dark",
|
|
263
|
-
tone: "primary"
|
|
264
|
-
}),
|
|
265
|
-
suggest: buildColorCardVarNames({
|
|
266
|
-
scheme: "dark",
|
|
267
|
-
tone: "neutral"
|
|
268
|
-
}),
|
|
269
|
-
positive: buildColorCardVarNames({
|
|
270
|
-
scheme: "dark",
|
|
271
|
-
tone: "positive"
|
|
272
|
-
}),
|
|
273
|
-
caution: buildColorCardVarNames({
|
|
274
|
-
scheme: "dark",
|
|
275
|
-
tone: "caution"
|
|
276
|
-
}),
|
|
277
|
-
critical: buildColorCardVarNames({
|
|
278
|
-
scheme: "dark",
|
|
279
|
-
tone: "critical"
|
|
280
|
-
})
|
|
281
|
-
},
|
|
282
|
-
light: {
|
|
283
|
-
transparent: buildColorCardVarNames({
|
|
284
|
-
scheme: "light",
|
|
285
|
-
tone: "transparent"
|
|
286
|
-
}),
|
|
287
|
-
default: buildColorCardVarNames({
|
|
288
|
-
scheme: "light",
|
|
289
|
-
tone: "default"
|
|
290
|
-
}),
|
|
291
|
-
neutral: buildColorCardVarNames({
|
|
292
|
-
scheme: "light",
|
|
293
|
-
tone: "neutral"
|
|
294
|
-
}),
|
|
295
|
-
primary: buildColorCardVarNames({
|
|
296
|
-
scheme: "light",
|
|
297
|
-
tone: "primary"
|
|
298
|
-
}),
|
|
299
|
-
suggest: buildColorCardVarNames({
|
|
300
|
-
scheme: "light",
|
|
301
|
-
tone: "suggest"
|
|
302
|
-
}),
|
|
303
|
-
positive: buildColorCardVarNames({
|
|
304
|
-
scheme: "light",
|
|
305
|
-
tone: "positive"
|
|
306
|
-
}),
|
|
307
|
-
caution: buildColorCardVarNames({
|
|
308
|
-
scheme: "light",
|
|
309
|
-
tone: "caution"
|
|
310
|
-
}),
|
|
311
|
-
critical: buildColorCardVarNames({
|
|
312
|
-
scheme: "light",
|
|
313
|
-
tone: "critical"
|
|
314
|
-
})
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
font: {
|
|
318
|
-
code: {
|
|
319
|
-
family: "--font-code-family",
|
|
320
|
-
sizes: FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
321
|
-
...acc,
|
|
322
|
-
[size]: {
|
|
323
|
-
fontSize: `--font-code-${size}-size`,
|
|
324
|
-
ascenderHeight: `--font-code-${size}-ascender-height`,
|
|
325
|
-
descenderHeight: `--font-code-${size}-descender-height`,
|
|
326
|
-
lineHeight: `--font-code-${size}-line-height`,
|
|
327
|
-
letterSpacing: `--font-code-${size}-letter-spacing`,
|
|
328
|
-
iconSize: `--font-code-${size}-icon-size`
|
|
329
|
-
}
|
|
330
|
-
}), {})
|
|
331
|
-
},
|
|
332
|
-
heading: {
|
|
333
|
-
family: "--font-heading-family",
|
|
334
|
-
sizes: FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
335
|
-
...acc,
|
|
336
|
-
[size]: {
|
|
337
|
-
fontSize: `--font-heading-${size}-size`,
|
|
338
|
-
ascenderHeight: `--font-heading-${size}-ascender-height`,
|
|
339
|
-
descenderHeight: `--font-heading-${size}-descender-height`,
|
|
340
|
-
lineHeight: `--font-heading-${size}-line-height`,
|
|
341
|
-
letterSpacing: `--font-heading-${size}-letter-spacing`,
|
|
342
|
-
iconSize: `--font-heading-${size}-icon-size`
|
|
343
|
-
}
|
|
344
|
-
}), {})
|
|
345
|
-
},
|
|
346
|
-
label: {
|
|
347
|
-
family: "--font-label-family",
|
|
348
|
-
sizes: FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
349
|
-
...acc,
|
|
350
|
-
[size]: {
|
|
351
|
-
fontSize: `--font-label-${size}-size`,
|
|
352
|
-
ascenderHeight: `--font-label-${size}-ascender-height`,
|
|
353
|
-
descenderHeight: `--font-label-${size}-descender-height`,
|
|
354
|
-
lineHeight: `--font-label-${size}-line-height`,
|
|
355
|
-
letterSpacing: `--font-label-${size}-letter-spacing`,
|
|
356
|
-
iconSize: `--font-label-${size}-icon-size`
|
|
357
|
-
}
|
|
358
|
-
}), {})
|
|
359
|
-
},
|
|
360
|
-
text: {
|
|
361
|
-
family: "--font-text-family",
|
|
362
|
-
sizes: FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
363
|
-
...acc,
|
|
364
|
-
[size]: {
|
|
365
|
-
fontSize: `--font-text-${size}-size`,
|
|
366
|
-
ascenderHeight: `--font-text-${size}-ascender-height`,
|
|
367
|
-
descenderHeight: `--font-text-${size}-descender-height`,
|
|
368
|
-
lineHeight: `--font-text-${size}-line-height`,
|
|
369
|
-
letterSpacing: `--font-text-${size}-letter-spacing`,
|
|
370
|
-
iconSize: `--font-text-${size}-icon-size`
|
|
371
|
-
}
|
|
372
|
-
}), {})
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
input: {
|
|
376
|
-
fontSize: "--input-font-size",
|
|
377
|
-
lineHeight: "--input-line-height",
|
|
378
|
-
letterSpacing: "--input-letter-spacing",
|
|
379
|
-
ascenderHeight: "--input-ascender-height",
|
|
380
|
-
descenderHeight: "--input-descender-height",
|
|
381
|
-
// capHeight: `--input-cap-height`,
|
|
382
|
-
gap: "--input-gap",
|
|
383
|
-
padding: "--input-padding"
|
|
384
|
-
},
|
|
385
|
-
space: Object.fromEntries(SPACE.map((space) => [space, `--space-${String(space).replace(".", "_")}`]))
|
|
386
|
-
};
|
|
387
|
-
function buildColorCardVarNames(props) {
|
|
388
|
-
const {
|
|
389
|
-
scheme,
|
|
390
|
-
tone
|
|
391
|
-
} = props, sourcePrefix = scheme ? `--color-${scheme}-${tone}` : `--color-${tone}`;
|
|
392
|
-
return {
|
|
393
|
-
accent: {
|
|
394
|
-
fg: `${sourcePrefix}-accent-fg`
|
|
395
|
-
},
|
|
396
|
-
avatar: {
|
|
397
|
-
gray: {
|
|
398
|
-
bg: `${sourcePrefix}-avatar-gray-bg`,
|
|
399
|
-
fg: `${sourcePrefix}-avatar-gray-fg`
|
|
400
|
-
},
|
|
401
|
-
blue: {
|
|
402
|
-
bg: `${sourcePrefix}-avatar-blue-bg`,
|
|
403
|
-
fg: `${sourcePrefix}-avatar-blue-fg`
|
|
404
|
-
},
|
|
405
|
-
purple: {
|
|
406
|
-
bg: `${sourcePrefix}-avatar-purple-bg`,
|
|
407
|
-
fg: `${sourcePrefix}-avatar-purple-fg`
|
|
408
|
-
},
|
|
409
|
-
magenta: {
|
|
410
|
-
bg: `${sourcePrefix}-avatar-magenta-bg`,
|
|
411
|
-
fg: `${sourcePrefix}-avatar-magenta-fg`
|
|
412
|
-
},
|
|
413
|
-
red: {
|
|
414
|
-
bg: `${sourcePrefix}-avatar-red-bg`,
|
|
415
|
-
fg: `${sourcePrefix}-avatar-red-fg`
|
|
416
|
-
},
|
|
417
|
-
orange: {
|
|
418
|
-
bg: `${sourcePrefix}-avatar-orange-bg`,
|
|
419
|
-
fg: `${sourcePrefix}-avatar-gray-fg`
|
|
420
|
-
},
|
|
421
|
-
yellow: {
|
|
422
|
-
bg: `${sourcePrefix}-avatar-yellow-bg`,
|
|
423
|
-
fg: `${sourcePrefix}-avatar-yellow-fg`
|
|
424
|
-
},
|
|
425
|
-
green: {
|
|
426
|
-
bg: `${sourcePrefix}-avatar-green-bg`,
|
|
427
|
-
fg: `${sourcePrefix}-avatar-green-fg`
|
|
428
|
-
},
|
|
429
|
-
cyan: {
|
|
430
|
-
bg: `${sourcePrefix}-avatar-cyan-bg`,
|
|
431
|
-
fg: `${sourcePrefix}-avatar-yellow-fg`
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
backdrop: `${sourcePrefix}-backdrop`,
|
|
435
|
-
focusRing: `${sourcePrefix}-focus-ring`,
|
|
436
|
-
link: {
|
|
437
|
-
fg: `${sourcePrefix}-link-fg`
|
|
438
|
-
},
|
|
439
|
-
muted: {
|
|
440
|
-
bg: `${sourcePrefix}-muted-bg`,
|
|
441
|
-
fg: `${sourcePrefix}-muted-fg`
|
|
442
|
-
},
|
|
443
|
-
shadow: {
|
|
444
|
-
outline: `${sourcePrefix}-shadow-outline`,
|
|
445
|
-
umbra: `${sourcePrefix}-shadow-umbra`,
|
|
446
|
-
penumbra: `${sourcePrefix}-shadow-penumbra`,
|
|
447
|
-
ambient: `${sourcePrefix}-shadow-ambient`
|
|
448
|
-
},
|
|
449
|
-
skeleton: {
|
|
450
|
-
from: `${sourcePrefix}-skeleton-from`,
|
|
451
|
-
to: `${sourcePrefix}-skeleton-to`
|
|
452
|
-
},
|
|
453
|
-
token: {
|
|
454
|
-
atrule: `${sourcePrefix}-token-atrule`,
|
|
455
|
-
attrName: `${sourcePrefix}-token-attr-name`,
|
|
456
|
-
attrValue: `${sourcePrefix}-token-attr-value`,
|
|
457
|
-
attribute: `${sourcePrefix}-token-attribute`,
|
|
458
|
-
boolean: `${sourcePrefix}-token-boolean`,
|
|
459
|
-
builtin: `${sourcePrefix}-token-builtin`,
|
|
460
|
-
cdata: `${sourcePrefix}-token-cdata`,
|
|
461
|
-
char: `${sourcePrefix}-token-char`,
|
|
462
|
-
class: `${sourcePrefix}-token-class`,
|
|
463
|
-
className: `${sourcePrefix}-token-class-name`,
|
|
464
|
-
comment: `${sourcePrefix}-token-comment`,
|
|
465
|
-
constant: `${sourcePrefix}-token-constant`,
|
|
466
|
-
deleted: `${sourcePrefix}-token-deleted`,
|
|
467
|
-
doctype: `${sourcePrefix}-token-doctype`,
|
|
468
|
-
entity: `${sourcePrefix}-token-entity`,
|
|
469
|
-
function: `${sourcePrefix}-token-function`,
|
|
470
|
-
hexcode: `${sourcePrefix}-token-hexcode`,
|
|
471
|
-
id: `${sourcePrefix}-token-id`,
|
|
472
|
-
important: `${sourcePrefix}-token-important`,
|
|
473
|
-
inserted: `${sourcePrefix}-token-inserted`,
|
|
474
|
-
keyword: `${sourcePrefix}-token-keyword`,
|
|
475
|
-
number: `${sourcePrefix}-token-number`,
|
|
476
|
-
operator: `${sourcePrefix}-token-operator`,
|
|
477
|
-
prolog: `${sourcePrefix}-token-prolog`,
|
|
478
|
-
property: `${sourcePrefix}-token-property`,
|
|
479
|
-
pseudoClass: `${sourcePrefix}-token-pseudo-class`,
|
|
480
|
-
pseudoElement: `${sourcePrefix}-token-pseudo-element`,
|
|
481
|
-
punctuation: `${sourcePrefix}-token-punctuation`,
|
|
482
|
-
regex: `${sourcePrefix}-token-regex`,
|
|
483
|
-
selector: `${sourcePrefix}-token-selector`,
|
|
484
|
-
string: `${sourcePrefix}-token-string`,
|
|
485
|
-
symbol: `${sourcePrefix}-token-symbol`,
|
|
486
|
-
tag: `${sourcePrefix}-token-tag`,
|
|
487
|
-
unit: `${sourcePrefix}-token-unit`,
|
|
488
|
-
url: `${sourcePrefix}-token-url`,
|
|
489
|
-
variable: `${sourcePrefix}-token-variable`
|
|
490
|
-
},
|
|
491
|
-
solid: buildColorVariantVarNames({
|
|
492
|
-
scheme,
|
|
493
|
-
tone,
|
|
494
|
-
variant: "solid"
|
|
495
|
-
}),
|
|
496
|
-
tinted: buildColorVariantVarNames({
|
|
497
|
-
scheme,
|
|
498
|
-
tone,
|
|
499
|
-
variant: "tinted"
|
|
500
|
-
})
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
function buildColorVariantVarNames(options) {
|
|
504
|
-
const {
|
|
505
|
-
scheme,
|
|
506
|
-
tone,
|
|
507
|
-
variant
|
|
508
|
-
} = options, _prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}` : tone ? `--color-${tone}-${variant}` : `--color-${variant}`, vars2 = {
|
|
509
|
-
bg: {
|
|
510
|
-
0: `${_prefix}-bg-0`,
|
|
511
|
-
1: `${_prefix}-bg-1`,
|
|
512
|
-
2: `${_prefix}-bg-2`,
|
|
513
|
-
3: `${_prefix}-bg-3`,
|
|
514
|
-
4: `${_prefix}-bg-4`
|
|
515
|
-
},
|
|
516
|
-
border: {
|
|
517
|
-
0: `${_prefix}-border-0`,
|
|
518
|
-
1: `${_prefix}-border-1`,
|
|
519
|
-
2: `${_prefix}-border-2`,
|
|
520
|
-
3: `${_prefix}-border-3`,
|
|
521
|
-
4: `${_prefix}-border-4`
|
|
522
|
-
},
|
|
523
|
-
fg: {
|
|
524
|
-
0: `${_prefix}-fg-0`,
|
|
525
|
-
1: `${_prefix}-fg-1`,
|
|
526
|
-
2: `${_prefix}-fg-2`,
|
|
527
|
-
3: `${_prefix}-fg-3`,
|
|
528
|
-
4: `${_prefix}-fg-4`
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
532
|
-
const prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
533
|
-
vars2[elementTone] = {
|
|
534
|
-
bg: {
|
|
535
|
-
0: `${prefix}-bg-0`,
|
|
536
|
-
1: `${prefix}-bg-1`,
|
|
537
|
-
2: `${prefix}-bg-2`,
|
|
538
|
-
3: `${prefix}-bg-3`,
|
|
539
|
-
4: `${prefix}-bg-4`
|
|
540
|
-
},
|
|
541
|
-
border: {
|
|
542
|
-
0: `${prefix}-border-0`,
|
|
543
|
-
1: `${prefix}-border-1`,
|
|
544
|
-
2: `${prefix}-border-2`,
|
|
545
|
-
3: `${prefix}-border-3`,
|
|
546
|
-
4: `${prefix}-border-4`
|
|
547
|
-
},
|
|
548
|
-
fg: {
|
|
549
|
-
0: `${prefix}-fg-0`,
|
|
550
|
-
1: `${prefix}-fg-1`,
|
|
551
|
-
2: `${prefix}-fg-2`,
|
|
552
|
-
3: `${prefix}-fg-3`,
|
|
553
|
-
4: `${prefix}-fg-4`
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
return vars2;
|
|
558
|
-
}
|
|
559
|
-
const darkColorVars = {};
|
|
560
|
-
for (const tone of THEME_COLOR_CARD_TONES)
|
|
561
|
-
darkColorVars[tone] = buildColorCardVars({
|
|
562
|
-
scheme: "dark",
|
|
563
|
-
tone
|
|
564
|
-
});
|
|
565
|
-
const lightColorVars = {};
|
|
566
|
-
for (const tone of THEME_COLOR_CARD_TONES)
|
|
567
|
-
lightColorVars[tone] = buildColorCardVars({
|
|
568
|
-
scheme: "light",
|
|
569
|
-
tone
|
|
570
|
-
});
|
|
571
|
-
const colorVars = {
|
|
572
|
-
accent: {
|
|
573
|
-
fg: `var(${varNames.color.accent.fg})`
|
|
574
|
-
},
|
|
575
|
-
avatar: {
|
|
576
|
-
bg: `var(${varNames.color.avatar.bg})`,
|
|
577
|
-
fg: `var(${varNames.color.avatar.fg})`,
|
|
578
|
-
gray: {
|
|
579
|
-
bg: `var(${varNames.color.avatar.gray.bg})`,
|
|
580
|
-
fg: `var(${varNames.color.avatar.gray.fg})`
|
|
581
|
-
},
|
|
582
|
-
blue: {
|
|
583
|
-
bg: `var(${varNames.color.avatar.blue.bg})`,
|
|
584
|
-
fg: `var(${varNames.color.avatar.blue.fg})`
|
|
585
|
-
},
|
|
586
|
-
purple: {
|
|
587
|
-
bg: `var(${varNames.color.avatar.purple.bg})`,
|
|
588
|
-
fg: `var(${varNames.color.avatar.purple.fg})`
|
|
589
|
-
},
|
|
590
|
-
magenta: {
|
|
591
|
-
bg: `var(${varNames.color.avatar.magenta.bg})`,
|
|
592
|
-
fg: `var(${varNames.color.avatar.magenta.fg})`
|
|
593
|
-
},
|
|
594
|
-
red: {
|
|
595
|
-
bg: `var(${varNames.color.avatar.red.bg})`,
|
|
596
|
-
fg: `var(${varNames.color.avatar.red.fg})`
|
|
597
|
-
},
|
|
598
|
-
orange: {
|
|
599
|
-
bg: `var(${varNames.color.avatar.orange.bg})`,
|
|
600
|
-
fg: `var(${varNames.color.avatar.orange.fg})`
|
|
601
|
-
},
|
|
602
|
-
yellow: {
|
|
603
|
-
bg: `var(${varNames.color.avatar.yellow.bg})`,
|
|
604
|
-
fg: `var(${varNames.color.avatar.yellow.fg})`
|
|
605
|
-
},
|
|
606
|
-
green: {
|
|
607
|
-
bg: `var(${varNames.color.avatar.green.bg})`,
|
|
608
|
-
fg: `var(${varNames.color.avatar.green.fg})`
|
|
609
|
-
},
|
|
610
|
-
cyan: {
|
|
611
|
-
bg: `var(${varNames.color.avatar.cyan.bg})`,
|
|
612
|
-
fg: `var(${varNames.color.avatar.cyan.fg})`
|
|
613
|
-
}
|
|
614
|
-
},
|
|
615
|
-
backdrop: `var(${varNames.color.backdrop})`,
|
|
616
|
-
bg: `var(${varNames.color.bg})`,
|
|
617
|
-
border: `var(${varNames.color.border})`,
|
|
618
|
-
fg: `var(${varNames.color.fg})`,
|
|
619
|
-
focusRing: `var(${varNames.color.focusRing})`,
|
|
620
|
-
input: {
|
|
621
|
-
bg: `var(${varNames.color.input.bg})`,
|
|
622
|
-
border: `var(${varNames.color.input.border})`,
|
|
623
|
-
fg: `var(${varNames.color.input.fg})`,
|
|
624
|
-
placeholder: `var(${varNames.color.input.placeholder})`
|
|
625
|
-
},
|
|
626
|
-
link: {
|
|
627
|
-
fg: `var(${varNames.color.link.fg})`
|
|
628
|
-
},
|
|
629
|
-
muted: {
|
|
630
|
-
bg: `var(${varNames.color.muted.bg})`,
|
|
631
|
-
fg: `var(${varNames.color.muted.fg})`
|
|
632
|
-
},
|
|
633
|
-
shadow: {
|
|
634
|
-
outline: `var(${varNames.color.shadow.outline})`,
|
|
635
|
-
umbra: `var(${varNames.color.shadow.umbra})`,
|
|
636
|
-
penumbra: `var(${varNames.color.shadow.penumbra})`,
|
|
637
|
-
ambient: `var(${varNames.color.shadow.ambient})`
|
|
638
|
-
},
|
|
639
|
-
skeleton: {
|
|
640
|
-
from: `var(${varNames.color.skeleton.from})`,
|
|
641
|
-
to: `var(${varNames.color.skeleton.to})`
|
|
642
|
-
},
|
|
643
|
-
token: {
|
|
644
|
-
atrule: `var(${varNames.color.token.atrule})`,
|
|
645
|
-
attrName: `var(${varNames.color.token.attrName})`,
|
|
646
|
-
attrValue: `var(${varNames.color.token.attrValue})`,
|
|
647
|
-
attribute: `var(${varNames.color.token.attribute})`,
|
|
648
|
-
boolean: `var(${varNames.color.token.boolean})`,
|
|
649
|
-
builtin: `var(${varNames.color.token.builtin})`,
|
|
650
|
-
cdata: `var(${varNames.color.token.cdata})`,
|
|
651
|
-
char: `var(${varNames.color.token.char})`,
|
|
652
|
-
class: `var(${varNames.color.token.class})`,
|
|
653
|
-
className: `var(${varNames.color.token.className})`,
|
|
654
|
-
comment: `var(${varNames.color.token.comment})`,
|
|
655
|
-
constant: `var(${varNames.color.token.constant})`,
|
|
656
|
-
deleted: `var(${varNames.color.token.deleted})`,
|
|
657
|
-
doctype: `var(${varNames.color.token.doctype})`,
|
|
658
|
-
entity: `var(${varNames.color.token.entity})`,
|
|
659
|
-
function: `var(${varNames.color.token.function})`,
|
|
660
|
-
hexcode: `var(${varNames.color.token.hexcode})`,
|
|
661
|
-
id: `var(${varNames.color.token.id})`,
|
|
662
|
-
important: `var(${varNames.color.token.important})`,
|
|
663
|
-
inserted: `var(${varNames.color.token.inserted})`,
|
|
664
|
-
keyword: `var(${varNames.color.token.keyword})`,
|
|
665
|
-
number: `var(${varNames.color.token.number})`,
|
|
666
|
-
operator: `var(${varNames.color.token.operator})`,
|
|
667
|
-
prolog: `var(${varNames.color.token.prolog})`,
|
|
668
|
-
property: `var(${varNames.color.token.property})`,
|
|
669
|
-
pseudoClass: `var(${varNames.color.token.pseudoClass})`,
|
|
670
|
-
pseudoElement: `var(${varNames.color.token.pseudoElement})`,
|
|
671
|
-
punctuation: `var(${varNames.color.token.punctuation})`,
|
|
672
|
-
regex: `var(${varNames.color.token.regex})`,
|
|
673
|
-
selector: `var(${varNames.color.token.selector})`,
|
|
674
|
-
string: `var(${varNames.color.token.string})`,
|
|
675
|
-
symbol: `var(${varNames.color.token.symbol})`,
|
|
676
|
-
tag: `var(${varNames.color.token.tag})`,
|
|
677
|
-
unit: `var(${varNames.color.token.unit})`,
|
|
678
|
-
url: `var(${varNames.color.token.url})`,
|
|
679
|
-
variable: `var(${varNames.color.token.variable})`
|
|
680
|
-
},
|
|
681
|
-
solid: buildColorVariantVars({
|
|
682
|
-
variant: "solid"
|
|
683
|
-
}),
|
|
684
|
-
tinted: buildColorVariantVars({
|
|
685
|
-
variant: "tinted"
|
|
686
|
-
}),
|
|
687
|
-
...THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
688
|
-
...acc,
|
|
689
|
-
[tone]: buildColorCardVars({
|
|
690
|
-
tone
|
|
691
|
-
})
|
|
692
|
-
}), {}),
|
|
693
|
-
dark: darkColorVars,
|
|
694
|
-
light: lightColorVars
|
|
695
|
-
}, vars = {
|
|
696
|
-
avatar: {
|
|
697
|
-
distance: `var(${varNames.avatar.distance})`,
|
|
698
|
-
size: `var(${varNames.avatar.size})`,
|
|
699
|
-
sizes: AVATAR_SIZE.reduce((acc, size) => ({
|
|
700
|
-
...acc,
|
|
701
|
-
[size]: {
|
|
702
|
-
size: `var(${varNames.avatar.sizes[size].size})`,
|
|
703
|
-
distance: `var(${varNames.avatar.sizes[size].distance})`
|
|
704
|
-
}
|
|
705
|
-
}), {})
|
|
706
|
-
},
|
|
707
|
-
color: colorVars,
|
|
708
|
-
font: {
|
|
709
|
-
code: {
|
|
710
|
-
family: `var(${varNames.font.code.family})`,
|
|
711
|
-
sizes: FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
712
|
-
...acc,
|
|
713
|
-
[size]: {
|
|
714
|
-
fontSize: `var(${varNames.font.code.sizes[size].fontSize})`,
|
|
715
|
-
ascenderHeight: `var(${varNames.font.code.sizes[size].ascenderHeight})`,
|
|
716
|
-
descenderHeight: `var(${varNames.font.code.sizes[size].descenderHeight})`,
|
|
717
|
-
lineHeight: `var(${varNames.font.code.sizes[size].lineHeight})`,
|
|
718
|
-
letterSpacing: `var(${varNames.font.code.sizes[size].letterSpacing})`,
|
|
719
|
-
iconSize: `var(${varNames.font.code.sizes[size].iconSize})`
|
|
720
|
-
}
|
|
721
|
-
}), {})
|
|
722
|
-
},
|
|
723
|
-
heading: {
|
|
724
|
-
family: `var(${varNames.font.heading.family})`,
|
|
725
|
-
sizes: FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
726
|
-
...acc,
|
|
727
|
-
[size]: {
|
|
728
|
-
fontSize: `var(${varNames.font.heading.sizes[size].fontSize})`,
|
|
729
|
-
ascenderHeight: `var(${varNames.font.heading.sizes[size].ascenderHeight})`,
|
|
730
|
-
descenderHeight: `var(${varNames.font.heading.sizes[size].descenderHeight})`,
|
|
731
|
-
lineHeight: `var(${varNames.font.heading.sizes[size].lineHeight})`,
|
|
732
|
-
letterSpacing: `var(${varNames.font.heading.sizes[size].letterSpacing})`,
|
|
733
|
-
iconSize: `var(${varNames.font.heading.sizes[size].iconSize})`
|
|
734
|
-
}
|
|
735
|
-
}), {})
|
|
736
|
-
},
|
|
737
|
-
label: {
|
|
738
|
-
family: `var(${varNames.font.label.family})`,
|
|
739
|
-
sizes: FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
740
|
-
...acc,
|
|
741
|
-
[size]: {
|
|
742
|
-
fontSize: `var(${varNames.font.label.sizes[size].fontSize})`,
|
|
743
|
-
ascenderHeight: `var(${varNames.font.label.sizes[size].ascenderHeight})`,
|
|
744
|
-
descenderHeight: `var(${varNames.font.label.sizes[size].descenderHeight})`,
|
|
745
|
-
lineHeight: `var(${varNames.font.label.sizes[size].lineHeight})`,
|
|
746
|
-
letterSpacing: `var(${varNames.font.label.sizes[size].letterSpacing})`,
|
|
747
|
-
iconSize: `var(${varNames.font.label.sizes[size].iconSize})`
|
|
748
|
-
}
|
|
749
|
-
}), {})
|
|
750
|
-
},
|
|
751
|
-
text: {
|
|
752
|
-
family: `var(${varNames.font.text.family})`,
|
|
753
|
-
sizes: FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
754
|
-
...acc,
|
|
755
|
-
[size]: {
|
|
756
|
-
fontSize: `var(${varNames.font.text.sizes[size].fontSize})`,
|
|
757
|
-
ascenderHeight: `var(${varNames.font.text.sizes[size].ascenderHeight})`,
|
|
758
|
-
descenderHeight: `var(${varNames.font.text.sizes[size].descenderHeight})`,
|
|
759
|
-
lineHeight: `var(${varNames.font.text.sizes[size].lineHeight})`,
|
|
760
|
-
letterSpacing: `var(${varNames.font.text.sizes[size].letterSpacing})`,
|
|
761
|
-
iconSize: `var(${varNames.font.text.sizes[size].iconSize})`
|
|
762
|
-
}
|
|
763
|
-
}), {})
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
input: {
|
|
767
|
-
fontSize: "var(--input-font-size)",
|
|
768
|
-
lineHeight: "var(--input-line-height)",
|
|
769
|
-
letterSpacing: "var(--input-letter-spacing)",
|
|
770
|
-
ascenderHeight: "var(--input-ascender-height)",
|
|
771
|
-
descenderHeight: "var(--input-descender-height)",
|
|
772
|
-
// capHeight: `var(--input-cap-height)`,
|
|
773
|
-
gap: "var(--input-gap)",
|
|
774
|
-
padding: "var(--input-padding)",
|
|
775
|
-
text: {
|
|
776
|
-
focusRing: {
|
|
777
|
-
width: "var(--input-text-focus-ring-width)",
|
|
778
|
-
offset: "var(--input-text-focus-ring-offset)"
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
space: Object.fromEntries(SPACE.map((space) => [space, `var(${varNames.space[space]})`]))
|
|
783
|
-
};
|
|
784
|
-
function buildColorCardVars(props) {
|
|
785
|
-
const {
|
|
786
|
-
scheme,
|
|
787
|
-
tone
|
|
788
|
-
} = props, prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone];
|
|
789
|
-
return {
|
|
790
|
-
accent: {
|
|
791
|
-
fg: `var(${prefix.accent.fg})`
|
|
792
|
-
},
|
|
793
|
-
avatar: {
|
|
794
|
-
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
795
|
-
...acc,
|
|
796
|
-
[color]: {
|
|
797
|
-
bg: `var(${prefix.avatar[color].bg})`,
|
|
798
|
-
fg: `var(${prefix.avatar[color].fg})`
|
|
799
|
-
}
|
|
800
|
-
}), {})
|
|
801
|
-
},
|
|
802
|
-
backdrop: `var(${prefix.backdrop})`,
|
|
803
|
-
focusRing: `var(${prefix.focusRing})`,
|
|
804
|
-
link: {
|
|
805
|
-
fg: `var(${prefix.link.fg})`
|
|
806
|
-
},
|
|
807
|
-
muted: {
|
|
808
|
-
bg: `var(${prefix.muted.bg})`,
|
|
809
|
-
fg: `var(${prefix.muted.fg})`
|
|
810
|
-
},
|
|
811
|
-
shadow: {
|
|
812
|
-
outline: `var(${prefix.shadow.outline})`,
|
|
813
|
-
umbra: `var(${prefix.shadow.umbra})`,
|
|
814
|
-
penumbra: `var(${prefix.shadow.penumbra})`,
|
|
815
|
-
ambient: `var(${prefix.shadow.ambient})`
|
|
816
|
-
},
|
|
817
|
-
skeleton: {
|
|
818
|
-
from: `var(${prefix.skeleton.from})`,
|
|
819
|
-
to: `var(${prefix.skeleton.to})`
|
|
820
|
-
},
|
|
821
|
-
token: {
|
|
822
|
-
atrule: `var(${prefix.token.atrule})`,
|
|
823
|
-
attrName: `var(${prefix.token.attrName})`,
|
|
824
|
-
attrValue: `var(${prefix.token.attrValue})`,
|
|
825
|
-
attribute: `var(${prefix.token.attribute})`,
|
|
826
|
-
boolean: `var(${prefix.token.boolean})`,
|
|
827
|
-
builtin: `var(${prefix.token.builtin})`,
|
|
828
|
-
cdata: `var(${prefix.token.cdata})`,
|
|
829
|
-
char: `var(${prefix.token.char})`,
|
|
830
|
-
class: `var(${prefix.token.class})`,
|
|
831
|
-
className: `var(${prefix.token.className})`,
|
|
832
|
-
comment: `var(${prefix.token.comment})`,
|
|
833
|
-
constant: `var(${prefix.token.constant})`,
|
|
834
|
-
deleted: `var(${prefix.token.deleted})`,
|
|
835
|
-
doctype: `var(${prefix.token.doctype})`,
|
|
836
|
-
entity: `var(${prefix.token.entity})`,
|
|
837
|
-
function: `var(${prefix.token.function})`,
|
|
838
|
-
hexcode: `var(${prefix.token.hexcode})`,
|
|
839
|
-
id: `var(${prefix.token.id})`,
|
|
840
|
-
important: `var(${prefix.token.important})`,
|
|
841
|
-
inserted: `var(${prefix.token.inserted})`,
|
|
842
|
-
keyword: `var(${prefix.token.keyword})`,
|
|
843
|
-
number: `var(${prefix.token.number})`,
|
|
844
|
-
operator: `var(${prefix.token.operator})`,
|
|
845
|
-
prolog: `var(${prefix.token.prolog})`,
|
|
846
|
-
property: `var(${prefix.token.property})`,
|
|
847
|
-
pseudoClass: `var(${prefix.token.pseudoClass})`,
|
|
848
|
-
pseudoElement: `var(${prefix.token.pseudoElement})`,
|
|
849
|
-
punctuation: `var(${prefix.token.punctuation})`,
|
|
850
|
-
regex: `var(${prefix.token.regex})`,
|
|
851
|
-
selector: `var(${prefix.token.selector})`,
|
|
852
|
-
string: `var(${prefix.token.string})`,
|
|
853
|
-
symbol: `var(${prefix.token.symbol})`,
|
|
854
|
-
tag: `var(${prefix.token.tag})`,
|
|
855
|
-
unit: `var(${prefix.token.unit})`,
|
|
856
|
-
url: `var(${prefix.token.url})`,
|
|
857
|
-
variable: `var(${prefix.token.variable})`
|
|
858
|
-
},
|
|
859
|
-
solid: buildColorVariantVars({
|
|
860
|
-
scheme,
|
|
861
|
-
tone,
|
|
862
|
-
variant: "solid"
|
|
863
|
-
}),
|
|
864
|
-
tinted: buildColorVariantVars({
|
|
865
|
-
scheme,
|
|
866
|
-
tone,
|
|
867
|
-
variant: "tinted"
|
|
868
|
-
})
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
function buildColorVariantVars(options) {
|
|
872
|
-
const {
|
|
873
|
-
scheme,
|
|
874
|
-
tone,
|
|
875
|
-
variant
|
|
876
|
-
} = options, _prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}` : tone ? `--color-${tone}-${variant}` : `--color-${variant}`, vars2 = {
|
|
877
|
-
bg: {
|
|
878
|
-
0: `var(${_prefix}-bg-0)`,
|
|
879
|
-
1: `var(${_prefix}-bg-1)`,
|
|
880
|
-
2: `var(${_prefix}-bg-2)`,
|
|
881
|
-
3: `var(${_prefix}-bg-3)`,
|
|
882
|
-
4: `var(${_prefix}-bg-4)`
|
|
883
|
-
},
|
|
884
|
-
border: {
|
|
885
|
-
0: `var(${_prefix}-border-0)`,
|
|
886
|
-
1: `var(${_prefix}-border-1)`,
|
|
887
|
-
2: `var(${_prefix}-border-2)`,
|
|
888
|
-
3: `var(${_prefix}-border-3)`,
|
|
889
|
-
4: `var(${_prefix}-border-4)`
|
|
890
|
-
},
|
|
891
|
-
fg: {
|
|
892
|
-
0: `var(${_prefix}-fg-0)`,
|
|
893
|
-
1: `var(${_prefix}-fg-1)`,
|
|
894
|
-
2: `var(${_prefix}-fg-2)`,
|
|
895
|
-
3: `var(${_prefix}-fg-3)`,
|
|
896
|
-
4: `var(${_prefix}-fg-4)`
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
900
|
-
const prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
901
|
-
vars2[elementTone] = {
|
|
902
|
-
bg: {
|
|
903
|
-
0: `var(${prefix}-bg-0)`,
|
|
904
|
-
1: `var(${prefix}-bg-1)`,
|
|
905
|
-
2: `var(${prefix}-bg-2)`,
|
|
906
|
-
3: `var(${prefix}-bg-3)`,
|
|
907
|
-
4: `var(${prefix}-bg-4)`
|
|
908
|
-
},
|
|
909
|
-
border: {
|
|
910
|
-
0: `var(${prefix}-border-0)`,
|
|
911
|
-
1: `var(${prefix}-border-1)`,
|
|
912
|
-
2: `var(${prefix}-border-2)`,
|
|
913
|
-
3: `var(${prefix}-border-3)`,
|
|
914
|
-
4: `var(${prefix}-border-4)`
|
|
915
|
-
},
|
|
916
|
-
fg: {
|
|
917
|
-
0: `var(${prefix}-fg-0)`,
|
|
918
|
-
1: `var(${prefix}-fg-1)`,
|
|
919
|
-
2: `var(${prefix}-fg-2)`,
|
|
920
|
-
3: `var(${prefix}-fg-3)`,
|
|
921
|
-
4: `var(${prefix}-fg-4)`
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
return vars2;
|
|
926
|
-
}
|
|
927
|
-
const dialogRules = {
|
|
928
|
-
dialog: {
|
|
929
|
-
top: 0,
|
|
930
|
-
left: 0,
|
|
931
|
-
right: 0,
|
|
932
|
-
bottom: 0,
|
|
933
|
-
alignItems: "center",
|
|
934
|
-
justifyContent: "center",
|
|
935
|
-
outline: "none",
|
|
936
|
-
background: vars.color.backdrop,
|
|
937
|
-
"@keyframes": {
|
|
938
|
-
"dialog-zoom-in": {
|
|
939
|
-
from: {
|
|
940
|
-
opacity: 0,
|
|
941
|
-
transform: "scale(0.95)"
|
|
942
|
-
},
|
|
943
|
-
to: {
|
|
944
|
-
opacity: 1,
|
|
945
|
-
transform: "scale(1)"
|
|
946
|
-
}
|
|
947
|
-
},
|
|
948
|
-
"dialog-fade-in": {
|
|
949
|
-
from: {
|
|
950
|
-
opacity: 0
|
|
951
|
-
},
|
|
952
|
-
to: {
|
|
953
|
-
opacity: 1
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
},
|
|
957
|
-
"@nest": {
|
|
958
|
-
"&[data-animate]": {
|
|
959
|
-
animation: "dialog-fade-in 200ms ease-out"
|
|
960
|
-
},
|
|
961
|
-
// Animates the dialog card.
|
|
962
|
-
'&[data-animate] > [data-ui="DialogCard"]': {
|
|
963
|
-
animation: "dialog-zoom-in 200ms ease-out"
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
|
-
"dialog-container": {
|
|
968
|
-
width: "100%",
|
|
969
|
-
height: "100%"
|
|
970
|
-
},
|
|
971
|
-
"dialog-card-root": {
|
|
972
|
-
width: "100%",
|
|
973
|
-
maxHeight: "100%",
|
|
974
|
-
overflow: ["hidden", "clip"]
|
|
975
|
-
},
|
|
976
|
-
"dialog-layout": {
|
|
977
|
-
width: "100%"
|
|
978
|
-
},
|
|
979
|
-
"dialog-header": {
|
|
980
|
-
zIndex: 2
|
|
981
|
-
},
|
|
982
|
-
"dialog-content": {
|
|
983
|
-
zIndex: 1,
|
|
984
|
-
outline: "none"
|
|
985
|
-
},
|
|
986
|
-
"dialog-footer": {
|
|
987
|
-
zIndex: 3
|
|
988
|
-
}
|
|
989
|
-
}, menuRules = {
|
|
990
|
-
menu: {
|
|
991
|
-
outline: "none"
|
|
992
|
-
},
|
|
993
|
-
"menu-divider": {
|
|
994
|
-
height: "1px",
|
|
995
|
-
border: 0,
|
|
996
|
-
backgroundColor: vars.color.border,
|
|
997
|
-
margin: 0
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
function responsiveRules(className, props) {
|
|
1001
|
-
return {
|
|
1002
|
-
[className]: props,
|
|
1003
|
-
[`_1:${className}`]: {
|
|
1004
|
-
"@media": {
|
|
1005
|
-
"screen and (min-width: 360px)": props
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
[`_2:${className}`]: {
|
|
1009
|
-
"@media": {
|
|
1010
|
-
"screen and (min-width: 600px)": props
|
|
1011
|
-
}
|
|
1012
|
-
},
|
|
1013
|
-
[`_3:${className}`]: {
|
|
1014
|
-
"@media": {
|
|
1015
|
-
"screen and (min-width: 900px)": props
|
|
1016
|
-
}
|
|
1017
|
-
},
|
|
1018
|
-
[`_4:${className}`]: {
|
|
1019
|
-
"@media": {
|
|
1020
|
-
"screen and (min-width: 1200px)": props
|
|
1021
|
-
}
|
|
1022
|
-
},
|
|
1023
|
-
[`_5:${className}`]: {
|
|
1024
|
-
"@media": {
|
|
1025
|
-
"screen and (min-width: 1800px)": props
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
[`_6:${className}`]: {
|
|
1029
|
-
"@media": {
|
|
1030
|
-
"screen and (min-width: 2400px)": props
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
}
|
|
1035
|
-
const skeletonRules = {
|
|
1036
|
-
skeleton: {
|
|
1037
|
-
"--color-skeleton-from": `color-mix(in srgb, transparent, ${vars.color.muted.fg} 5%)`,
|
|
1038
|
-
"--color-skeleton-to": `color-mix(in srgb, transparent, ${vars.color.muted.fg} 10%)`,
|
|
1039
|
-
backgroundColor: vars.color.skeleton.from,
|
|
1040
|
-
backgroundPosition: "100%",
|
|
1041
|
-
backgroundSize: "200% 100%",
|
|
1042
|
-
backgroundAttachment: "fixed",
|
|
1043
|
-
opacity: 0,
|
|
1044
|
-
transition: "opacity 200ms ease-in",
|
|
1045
|
-
"@keyframes": {
|
|
1046
|
-
"skeleton-pulse": {
|
|
1047
|
-
"0%": {
|
|
1048
|
-
backgroundPosition: "100%"
|
|
1049
|
-
},
|
|
1050
|
-
"100%": {
|
|
1051
|
-
backgroundPosition: "-100%"
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
},
|
|
1055
|
-
"@nest": {
|
|
1056
|
-
"&[data-animated]": {
|
|
1057
|
-
backgroundImage: ["linear-gradient(to right", vars.color.skeleton.from, vars.color.skeleton.to, vars.color.skeleton.from, vars.color.skeleton.from, vars.color.skeleton.from, ")"].join(", "),
|
|
1058
|
-
animationName: "skeleton-pulse",
|
|
1059
|
-
animationTimingFunction: "ease-in-out",
|
|
1060
|
-
animationIterationCount: "infinite",
|
|
1061
|
-
animationDuration: "2000ms"
|
|
1062
|
-
},
|
|
1063
|
-
"&[data-visible]": {
|
|
1064
|
-
opacity: 1
|
|
1065
|
-
}
|
|
1066
|
-
},
|
|
1067
|
-
"@media": {
|
|
1068
|
-
"screen and (prefers-reduced-motion: no-preference)": {
|
|
1069
|
-
backgroundColor: vars.color.skeleton.from
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
},
|
|
1073
|
-
"font-skeleton": {
|
|
1074
|
-
height: "calc(var(--font-skeleton-line-height) - var(--font-skeleton-ascender-height) - var(--font-skeleton-descender-height))"
|
|
1075
|
-
},
|
|
1076
|
-
// ...responsiveRules('text-skeleton-0', {
|
|
1077
|
-
// '--font-skeleton-line-height': 'var(--font-text-0-line-height)',
|
|
1078
|
-
// '--font-skeleton-ascender-height': 'var(--font-text-0-ascender-height)',
|
|
1079
|
-
// '--font-skeleton-descender-height': 'var(--font-text-0-descender-height)',
|
|
1080
|
-
// }),
|
|
1081
|
-
...FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
1082
|
-
...acc,
|
|
1083
|
-
...responsiveRules(`code-skeleton-${size}`, {
|
|
1084
|
-
"--font-skeleton-line-height": vars.font.code.sizes[size].lineHeight,
|
|
1085
|
-
"--font-skeleton-ascender-height": vars.font.code.sizes[size].ascenderHeight,
|
|
1086
|
-
"--font-skeleton-descender-height": vars.font.code.sizes[size].descenderHeight
|
|
1087
|
-
})
|
|
1088
|
-
}), {}),
|
|
1089
|
-
...FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
1090
|
-
...acc,
|
|
1091
|
-
...responsiveRules(`heading-skeleton-${size}`, {
|
|
1092
|
-
"--font-skeleton-line-height": vars.font.heading.sizes[size].lineHeight,
|
|
1093
|
-
"--font-skeleton-ascender-height": vars.font.heading.sizes[size].ascenderHeight,
|
|
1094
|
-
"--font-skeleton-descender-height": vars.font.heading.sizes[size].descenderHeight
|
|
1095
|
-
})
|
|
1096
|
-
}), {}),
|
|
1097
|
-
...FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
1098
|
-
...acc,
|
|
1099
|
-
...responsiveRules(`label-skeleton-${size}`, {
|
|
1100
|
-
"--font-skeleton-line-height": vars.font.label.sizes[size].lineHeight,
|
|
1101
|
-
"--font-skeleton-ascender-height": vars.font.label.sizes[size].ascenderHeight,
|
|
1102
|
-
"--font-skeleton-descender-height": vars.font.label.sizes[size].descenderHeight
|
|
1103
|
-
})
|
|
1104
|
-
}), {}),
|
|
1105
|
-
...FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
1106
|
-
...acc,
|
|
1107
|
-
...responsiveRules(`text-skeleton-${size}`, {
|
|
1108
|
-
"--font-skeleton-line-height": vars.font.text.sizes[size].lineHeight,
|
|
1109
|
-
"--font-skeleton-ascender-height": vars.font.text.sizes[size].ascenderHeight,
|
|
1110
|
-
"--font-skeleton-descender-height": vars.font.text.sizes[size].descenderHeight
|
|
1111
|
-
})
|
|
1112
|
-
}), {})
|
|
1113
|
-
}, toastRules = {
|
|
1114
|
-
"toast-layer": {
|
|
1115
|
-
position: "fixed",
|
|
1116
|
-
right: 0,
|
|
1117
|
-
bottom: 0,
|
|
1118
|
-
pointerEvents: "none",
|
|
1119
|
-
maxWidth: "420px",
|
|
1120
|
-
width: "100%"
|
|
1121
|
-
},
|
|
1122
|
-
toast: {
|
|
1123
|
-
pointerEvents: "all",
|
|
1124
|
-
overflow: ["hidden", "clip"]
|
|
1125
|
-
}
|
|
1126
|
-
}, _arrowRules = {
|
|
1127
|
-
arrow: {
|
|
1128
|
-
position: "absolute",
|
|
1129
|
-
// todo: replace with vars?
|
|
1130
|
-
width: "var(--arrow-size)",
|
|
1131
|
-
height: "var(--arrow-size)",
|
|
1132
|
-
"@nest": {
|
|
1133
|
-
":empty + &": {
|
|
1134
|
-
display: "none"
|
|
1135
|
-
},
|
|
1136
|
-
"& > svg": {
|
|
1137
|
-
display: "block",
|
|
1138
|
-
transformOrigin: "calc(var(--arrow-size) / 2) calc(var(--arrow-size) / 2)"
|
|
1139
|
-
},
|
|
1140
|
-
// top
|
|
1141
|
-
'[data-placement^="top"] > &': {
|
|
1142
|
-
bottom: "calc(0px - var(--arrow-size))"
|
|
1143
|
-
},
|
|
1144
|
-
'[data-placement^="top"] > & svg': {
|
|
1145
|
-
transform: "rotate(0deg)"
|
|
1146
|
-
},
|
|
1147
|
-
// right
|
|
1148
|
-
'[data-placement^="right"] > &': {
|
|
1149
|
-
left: "calc(0px - var(--arrow-size))"
|
|
1150
|
-
},
|
|
1151
|
-
'[data-placement^="right"] > & svg': {
|
|
1152
|
-
transform: "rotate(90deg)"
|
|
1153
|
-
},
|
|
1154
|
-
// left
|
|
1155
|
-
'[data-placement^="left"] > &': {
|
|
1156
|
-
right: "calc(0px - var(--arrow-size))"
|
|
1157
|
-
},
|
|
1158
|
-
'[data-placement^="left"] > & svg': {
|
|
1159
|
-
transform: "rotate(-90deg)"
|
|
1160
|
-
},
|
|
1161
|
-
// bottom
|
|
1162
|
-
'[data-placement^="bottom"] > &': {
|
|
1163
|
-
top: "calc(0px - var(--arrow-size))"
|
|
1164
|
-
},
|
|
1165
|
-
'[data-placement^="bottom"] > & svg': {
|
|
1166
|
-
transform: "rotate(180deg)"
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
},
|
|
1170
|
-
"arrow-stroke": {
|
|
1171
|
-
stroke: vars.color.shadow.outline
|
|
1172
|
-
},
|
|
1173
|
-
"arrow-shape": {
|
|
1174
|
-
fill: vars.color.bg
|
|
1175
|
-
}
|
|
1176
|
-
}, _inputRules = {
|
|
1177
|
-
input: {
|
|
1178
|
-
position: "relative"
|
|
1179
|
-
},
|
|
1180
|
-
"input-b": {
|
|
1181
|
-
"@nest": {
|
|
1182
|
-
"& .input-presentation": {
|
|
1183
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
},
|
|
1187
|
-
"input-element": {
|
|
1188
|
-
"--color-input-fg": vars.color.tinted.default.fg[2],
|
|
1189
|
-
"--color-input-placeholder": vars.color.tinted.default.border[4],
|
|
1190
|
-
WebkitFontSmoothing: "inherit",
|
|
1191
|
-
appearance: "none",
|
|
1192
|
-
border: 0,
|
|
1193
|
-
outline: "none",
|
|
1194
|
-
margin: 0,
|
|
1195
|
-
fontFamily: vars.font.text.family,
|
|
1196
|
-
fontSize: vars.input.fontSize,
|
|
1197
|
-
lineHeight: vars.input.lineHeight,
|
|
1198
|
-
letterSpacing: vars.input.letterSpacing,
|
|
1199
|
-
backgroundColor: "transparent",
|
|
1200
|
-
color: vars.color.input.fg,
|
|
1201
|
-
padding: ["calc(var(--input-padding) - var(--input-ascender-height))", "var(--input-padding)", "calc(var(--input-padding) - var(--input-descender-height))", "var(--input-padding)"].join(" "),
|
|
1202
|
-
borderRadius: "inherit",
|
|
1203
|
-
position: "relative",
|
|
1204
|
-
zIndex: 1,
|
|
1205
|
-
display: "block",
|
|
1206
|
-
boxSizing: "border-box",
|
|
1207
|
-
resize: "none",
|
|
1208
|
-
width: ["-moz-available", "-webkit-fill-available", "stretch"],
|
|
1209
|
-
"@nest": {
|
|
1210
|
-
".input[data-icon-left] &": {
|
|
1211
|
-
paddingLeft: "calc(var(--input-padding) + calc(var(--input-line-height) - var(--input-ascender-height) - var(--input-descender-height)) + var(--input-gap))"
|
|
1212
|
-
},
|
|
1213
|
-
".input[data-icon-right] &": {
|
|
1214
|
-
paddingRight: "calc(var(--input-padding) + calc(var(--input-line-height) - var(--input-ascender-height) - var(--input-descender-height)) + var(--input-gap))"
|
|
1215
|
-
},
|
|
1216
|
-
"&::placeholder": {
|
|
1217
|
-
color: vars.color.input.placeholder
|
|
1218
|
-
},
|
|
1219
|
-
"&:hover": {
|
|
1220
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[0]
|
|
1221
|
-
},
|
|
1222
|
-
"&:focus": {
|
|
1223
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[0]
|
|
1224
|
-
},
|
|
1225
|
-
"&:disabled": {
|
|
1226
|
-
[varNames.color.input.fg]: vars.color.tinted.default.border[3]
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
},
|
|
1230
|
-
"input-presentation": {
|
|
1231
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[4],
|
|
1232
|
-
[varNames.color.input.bg]: vars.color.tinted.default.bg[0],
|
|
1233
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[1],
|
|
1234
|
-
borderRadius: "inherit",
|
|
1235
|
-
position: "absolute",
|
|
1236
|
-
top: 0,
|
|
1237
|
-
left: 0,
|
|
1238
|
-
right: 0,
|
|
1239
|
-
bottom: 0,
|
|
1240
|
-
display: "block",
|
|
1241
|
-
pointerEvents: "none",
|
|
1242
|
-
zIndex: 0,
|
|
1243
|
-
"@nest": {
|
|
1244
|
-
".input[data-prefix] &": {
|
|
1245
|
-
borderTopLeftRadius: 0,
|
|
1246
|
-
borderBottomLeftRadius: 0
|
|
1247
|
-
},
|
|
1248
|
-
".input[data-suffix] &": {
|
|
1249
|
-
borderTopRightRadius: 0,
|
|
1250
|
-
borderBottomRightRadius: 0
|
|
1251
|
-
},
|
|
1252
|
-
".input-element:placeholder-shown + &": {
|
|
1253
|
-
[varNames.color.input.fg]: vars.color.tinted.default.border[4]
|
|
1254
|
-
},
|
|
1255
|
-
".input-element:hover + &": {
|
|
1256
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[2],
|
|
1257
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[1],
|
|
1258
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`
|
|
1259
|
-
},
|
|
1260
|
-
".input-element:focus + &": {
|
|
1261
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[2],
|
|
1262
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[1],
|
|
1263
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`,
|
|
1264
|
-
outlineWidth: vars.input.text.focusRing.width,
|
|
1265
|
-
outlineStyle: "solid",
|
|
1266
|
-
outlineColor: vars.color.focusRing,
|
|
1267
|
-
outlineOffset: vars.input.text.focusRing.offset
|
|
1268
|
-
},
|
|
1269
|
-
".input-element:disabled + &": {
|
|
1270
|
-
[varNames.color.input.bg]: vars.color.tinted.default.bg[1],
|
|
1271
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[0],
|
|
1272
|
-
opacity: 1
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
};
|
|
1277
|
-
for (const textSize of FONT_TEXT_SIZE) {
|
|
1278
|
-
const source = vars.font.text.sizes[textSize];
|
|
1279
|
-
_inputRules[`input-${textSize}`] = {
|
|
1280
|
-
[varNames.input.fontSize]: source.fontSize,
|
|
1281
|
-
[varNames.input.lineHeight]: source.lineHeight,
|
|
1282
|
-
[varNames.input.letterSpacing]: source.letterSpacing,
|
|
1283
|
-
[varNames.input.ascenderHeight]: source.ascenderHeight,
|
|
1284
|
-
[varNames.input.descenderHeight]: source.descenderHeight
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
for (const space of SPACE)
|
|
1288
|
-
Object.assign(_inputRules, responsiveRules(`input-p-${space}`, {
|
|
1289
|
-
[varNames.input.padding]: vars.space[space]
|
|
1290
|
-
}));
|
|
1291
|
-
for (const space of SPACE)
|
|
1292
|
-
Object.assign(_inputRules, responsiveRules(`input-g-${space}`, {
|
|
1293
|
-
[varNames.input.gap]: vars.space[space]
|
|
1294
|
-
}));
|
|
1295
|
-
const toneMap$2 = {
|
|
1296
|
-
default: "surface",
|
|
1297
|
-
neutral: "neutral",
|
|
1298
|
-
suggest: "suggest",
|
|
1299
|
-
primary: "accent",
|
|
1300
|
-
positive: "positive",
|
|
1301
|
-
caution: "caution",
|
|
1302
|
-
critical: "critical"
|
|
1303
|
-
}, _selectableRules = {
|
|
1304
|
-
selectable: {
|
|
1305
|
-
backgroundColor: vars.color.bg,
|
|
1306
|
-
color: vars.color.fg,
|
|
1307
|
-
"--color-bg": vars.color.tinted.bg[0],
|
|
1308
|
-
"--color-border": vars.color.tinted.border[2],
|
|
1309
|
-
"--color-fg": vars.color.tinted.fg[2],
|
|
1310
|
-
"@nest": {
|
|
1311
|
-
"&:is(button)": {
|
|
1312
|
-
WebkitFontSmoothing: "inherit",
|
|
1313
|
-
appearance: "none",
|
|
1314
|
-
outline: "none",
|
|
1315
|
-
font: "inherit",
|
|
1316
|
-
textAlign: "inherit",
|
|
1317
|
-
border: 0,
|
|
1318
|
-
width: ["-moz-available", "-webkit-fill-available", "stretch"]
|
|
1319
|
-
},
|
|
1320
|
-
/* &:is(a) */
|
|
1321
|
-
"&:is(a)": {
|
|
1322
|
-
outline: "none",
|
|
1323
|
-
textDecoration: "none"
|
|
1324
|
-
},
|
|
1325
|
-
...buildSelectableTones()
|
|
1326
|
-
},
|
|
1327
|
-
"@media": {
|
|
1328
|
-
"(hover: hover)": {
|
|
1329
|
-
"@nest": {
|
|
1330
|
-
"&:not([data-disabled])": {
|
|
1331
|
-
// cursor: 'pointer',
|
|
1332
|
-
},
|
|
1333
|
-
"&:not([data-disabled]):hover": {
|
|
1334
|
-
"--color-bg": vars.color.tinted.bg[1],
|
|
1335
|
-
"--color-border": vars.color.tinted.border[3],
|
|
1336
|
-
"--color-fg": vars.color.tinted.fg[1],
|
|
1337
|
-
"--color-muted-bg": vars.color.tinted.bg[2],
|
|
1338
|
-
"--color-muted-fg": vars.color.tinted.fg[4]
|
|
1339
|
-
},
|
|
1340
|
-
'&:not([data-disabled]):active, &:not([data-disabled])[aria-pressed="true"], &:not([data-disabled])[data-pressed]': {
|
|
1341
|
-
"--color-bg": vars.color.tinted.bg[2],
|
|
1342
|
-
"--color-border": vars.color.tinted.border[4],
|
|
1343
|
-
"--color-fg": vars.color.tinted.fg[0],
|
|
1344
|
-
"--color-muted-bg": vars.color.tinted.bg[3],
|
|
1345
|
-
"--color-muted-fg": vars.color.tinted.fg[4]
|
|
1346
|
-
},
|
|
1347
|
-
"&:not([data-disabled]):focus": {
|
|
1348
|
-
"--color-bg": vars.color.solid.bg[0],
|
|
1349
|
-
"--color-border": vars.color.solid.border[1],
|
|
1350
|
-
"--color-fg": vars.color.solid.fg[1],
|
|
1351
|
-
"--color-muted-bg": vars.color.solid.bg[1],
|
|
1352
|
-
"--color-muted-fg": vars.color.solid.fg[3]
|
|
1353
|
-
},
|
|
1354
|
-
"&[data-disabled]": {
|
|
1355
|
-
"--color-bg": vars.color.tinted.bg[0],
|
|
1356
|
-
"--color-border": vars.color.tinted.border[1],
|
|
1357
|
-
"--color-fg": vars.color.tinted.border[4],
|
|
1358
|
-
"--color-muted-bg": vars.color.tinted.bg[1],
|
|
1359
|
-
"--color-muted-fg": vars.color.tinted.border[4]
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
function buildSelectableTones() {
|
|
1367
|
-
const rules2 = {};
|
|
1368
|
-
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
1369
|
-
const target = varNames.color, source = vars.color;
|
|
1370
|
-
rules2[`&.${toneMap$2[tone]}`] = {
|
|
1371
|
-
[target.tinted.bg[0]]: source.tinted[tone].bg[0],
|
|
1372
|
-
[target.tinted.bg[1]]: source.tinted[tone].bg[1],
|
|
1373
|
-
[target.tinted.bg[2]]: source.tinted[tone].bg[2],
|
|
1374
|
-
[target.tinted.bg[3]]: source.tinted[tone].bg[3],
|
|
1375
|
-
[target.tinted.bg[4]]: source.tinted[tone].bg[4],
|
|
1376
|
-
[target.tinted.border[0]]: source.tinted[tone].border[0],
|
|
1377
|
-
[target.tinted.border[1]]: source.tinted[tone].border[1],
|
|
1378
|
-
[target.tinted.border[2]]: source.tinted[tone].border[2],
|
|
1379
|
-
[target.tinted.border[3]]: source.tinted[tone].border[3],
|
|
1380
|
-
[target.tinted.border[4]]: source.tinted[tone].border[4],
|
|
1381
|
-
[target.tinted.fg[0]]: source.tinted[tone].fg[0],
|
|
1382
|
-
[target.tinted.fg[1]]: source.tinted[tone].fg[1],
|
|
1383
|
-
[target.tinted.fg[2]]: source.tinted[tone].fg[2],
|
|
1384
|
-
[target.tinted.fg[3]]: source.tinted[tone].fg[3],
|
|
1385
|
-
[target.tinted.fg[4]]: source.tinted[tone].fg[4],
|
|
1386
|
-
[target.solid.bg[0]]: source.solid[tone].bg[0],
|
|
1387
|
-
[target.solid.bg[1]]: source.solid[tone].bg[1],
|
|
1388
|
-
[target.solid.bg[2]]: source.solid[tone].bg[2],
|
|
1389
|
-
[target.solid.bg[3]]: source.solid[tone].bg[3],
|
|
1390
|
-
[target.solid.bg[4]]: source.solid[tone].bg[4],
|
|
1391
|
-
[target.solid.border[0]]: source.solid[tone].border[0],
|
|
1392
|
-
[target.solid.border[1]]: source.solid[tone].border[1],
|
|
1393
|
-
[target.solid.border[2]]: source.solid[tone].border[2],
|
|
1394
|
-
[target.solid.border[3]]: source.solid[tone].border[3],
|
|
1395
|
-
[target.solid.border[4]]: source.solid[tone].border[4],
|
|
1396
|
-
[target.solid.fg[0]]: source.solid[tone].fg[0],
|
|
1397
|
-
[target.solid.fg[1]]: source.solid[tone].fg[1],
|
|
1398
|
-
[target.solid.fg[2]]: source.solid[tone].fg[2],
|
|
1399
|
-
[target.solid.fg[3]]: source.solid[tone].fg[3],
|
|
1400
|
-
[target.solid.fg[4]]: source.solid[tone].fg[4]
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
return rules2;
|
|
1404
|
-
}
|
|
1405
|
-
const avatarRules = {
|
|
1406
|
-
avatar: {
|
|
1407
|
-
backgroundColor: vars.color.avatar.bg,
|
|
1408
|
-
position: "relative",
|
|
1409
|
-
boxSizing: "border-box",
|
|
1410
|
-
userSelect: "none",
|
|
1411
|
-
boxShadow: `0 0 0 1px ${vars.color.bg}`,
|
|
1412
|
-
lineHeight: 0,
|
|
1413
|
-
width: vars.avatar.size,
|
|
1414
|
-
height: vars.avatar.size,
|
|
1415
|
-
borderRadius: vars.avatar.size,
|
|
1416
|
-
"@nest": {
|
|
1417
|
-
'&[data-status="inactive"]': {
|
|
1418
|
-
opacity: 0.5
|
|
1419
|
-
},
|
|
1420
|
-
// &:is(button)
|
|
1421
|
-
"&:is(button)": {
|
|
1422
|
-
WebkitFontSmoothing: "inherit",
|
|
1423
|
-
appearance: "none",
|
|
1424
|
-
margin: 0,
|
|
1425
|
-
padding: 0,
|
|
1426
|
-
border: 0,
|
|
1427
|
-
font: "inherit",
|
|
1428
|
-
color: "inherit",
|
|
1429
|
-
outline: "none"
|
|
1430
|
-
},
|
|
1431
|
-
"&:is(button):focus": {
|
|
1432
|
-
outline: "var(--avatar-focus-ring-width) solid var(--color-focus-ring)",
|
|
1433
|
-
outlineOffset: "var(--avatar-focus-ring-offset)"
|
|
1434
|
-
},
|
|
1435
|
-
"&:is(button):focus:not(:focus-visible)": {
|
|
1436
|
-
boxShadow: "none"
|
|
1437
|
-
},
|
|
1438
|
-
":disabled &, [data-disabled] &": {
|
|
1439
|
-
[varNames.color.avatar.bg]: vars.color.border,
|
|
1440
|
-
[varNames.color.avatar.fg]: vars.color.bg
|
|
1441
|
-
},
|
|
1442
|
-
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
1443
|
-
...acc,
|
|
1444
|
-
[`&.${color}`]: {
|
|
1445
|
-
[varNames.color.avatar.bg]: vars.color.avatar[color].bg,
|
|
1446
|
-
[varNames.color.avatar.fg]: vars.color.avatar[color].fg
|
|
1447
|
-
}
|
|
1448
|
-
}), {})
|
|
1449
|
-
}
|
|
1450
|
-
},
|
|
1451
|
-
...AVATAR_SIZE.reduce((acc, size) => ({
|
|
1452
|
-
...acc,
|
|
1453
|
-
...responsiveRules(`avatar-${size}`, {
|
|
1454
|
-
[varNames.avatar.distance]: vars.avatar.sizes[size].distance,
|
|
1455
|
-
[varNames.avatar.size]: vars.avatar.sizes[size].size
|
|
1456
|
-
})
|
|
1457
|
-
}), {}),
|
|
1458
|
-
"avatar-arrow": {
|
|
1459
|
-
position: "absolute",
|
|
1460
|
-
boxSizing: "border-box",
|
|
1461
|
-
zIndex: 0,
|
|
1462
|
-
opacity: 0,
|
|
1463
|
-
transition: "all 0.2s linear",
|
|
1464
|
-
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
1465
|
-
left: 0,
|
|
1466
|
-
right: 0,
|
|
1467
|
-
top: 0,
|
|
1468
|
-
bottom: 0,
|
|
1469
|
-
"@nest": {
|
|
1470
|
-
"& > svg": {
|
|
1471
|
-
display: "block",
|
|
1472
|
-
width: "11px",
|
|
1473
|
-
height: "7px",
|
|
1474
|
-
position: "absolute",
|
|
1475
|
-
top: "-5px",
|
|
1476
|
-
left: "50%",
|
|
1477
|
-
transform: "translateX(-6px)"
|
|
1478
|
-
},
|
|
1479
|
-
'[data-arrow-position="inside"] > &': {
|
|
1480
|
-
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
1481
|
-
opacity: 0
|
|
1482
|
-
},
|
|
1483
|
-
'[data-arrow-position="top"] > &': {
|
|
1484
|
-
opacity: 1,
|
|
1485
|
-
transform: "rotate(0deg)"
|
|
1486
|
-
},
|
|
1487
|
-
'[data-arrow-position="bottom"] > &': {
|
|
1488
|
-
opacity: 1,
|
|
1489
|
-
transform: "rotate(-180deg)"
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
},
|
|
1493
|
-
"avatar-image": {
|
|
1494
|
-
"@nest": {
|
|
1495
|
-
"& > img": {
|
|
1496
|
-
display: "block",
|
|
1497
|
-
position: "absolute",
|
|
1498
|
-
width: vars.avatar.size,
|
|
1499
|
-
height: vars.avatar.size,
|
|
1500
|
-
borderRadius: vars.avatar.size
|
|
1501
|
-
},
|
|
1502
|
-
"& > span": {
|
|
1503
|
-
display: "block",
|
|
1504
|
-
position: "absolute",
|
|
1505
|
-
width: vars.avatar.size,
|
|
1506
|
-
height: vars.avatar.size,
|
|
1507
|
-
borderRadius: vars.avatar.size,
|
|
1508
|
-
boxShadow: [`inset 0 0 0 1px ${vars.color.avatar.bg}`, `inset 0 0 0 1.75px ${vars.color.bg}`].join(", ")
|
|
1509
|
-
},
|
|
1510
|
-
"[data-image-error] &": {
|
|
1511
|
-
display: "none"
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
},
|
|
1515
|
-
"avatar-initials": {
|
|
1516
|
-
color: vars.color.avatar.fg,
|
|
1517
|
-
borderRadius: vars.avatar.size
|
|
1518
|
-
},
|
|
1519
|
-
"avatar-counter": {
|
|
1520
|
-
color: vars.color.fg,
|
|
1521
|
-
backgroundColor: vars.color.bg,
|
|
1522
|
-
boxShadow: [`0 0 0 1px ${vars.color.bg}`, `inset 0 0 0 1px ${vars.color.border}`].join(", "),
|
|
1523
|
-
userSelect: "none",
|
|
1524
|
-
borderRadius: vars.avatar.size,
|
|
1525
|
-
height: vars.avatar.size,
|
|
1526
|
-
"@nest": {
|
|
1527
|
-
"&&": {
|
|
1528
|
-
minWidth: vars.avatar.size
|
|
1529
|
-
},
|
|
1530
|
-
"[data-hide-inner-stroke] &": {
|
|
1531
|
-
boxShadow: `0 0 0 1px ${vars.color.bg}`
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
},
|
|
1535
|
-
"avatar-stack": {
|
|
1536
|
-
"@nest": {
|
|
1537
|
-
"& > div + div": {
|
|
1538
|
-
marginLeft: vars.avatar.distance
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
}, badgeToneRules = {};
|
|
1543
|
-
for (const tone of THEME_COLOR_STATE_TONES)
|
|
1544
|
-
badgeToneRules[`badge-${tone}`] = {
|
|
1545
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-4)`,
|
|
1546
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`
|
|
1547
|
-
};
|
|
1548
|
-
const badgeRules = {
|
|
1549
|
-
badge: {
|
|
1550
|
-
backgroundColor: "var(--color-bg)",
|
|
1551
|
-
color: "var(--color-fg)",
|
|
1552
|
-
verticalAlign: "top"
|
|
1553
|
-
},
|
|
1554
|
-
...badgeToneRules
|
|
1555
|
-
}, boxRules = {
|
|
1556
|
-
box: {
|
|
1557
|
-
minWidth: 0,
|
|
1558
|
-
minHeight: 0,
|
|
1559
|
-
"@nest": {
|
|
1560
|
-
"&:is(ul), &:is(ol)": {
|
|
1561
|
-
listStyle: "none"
|
|
1562
|
-
},
|
|
1563
|
-
"&.muted": {
|
|
1564
|
-
backgroundColor: "var(--color-muted-bg)"
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
},
|
|
1568
|
-
// sizing
|
|
1569
|
-
"box-content": {
|
|
1570
|
-
boxSizing: "content-box"
|
|
1571
|
-
},
|
|
1572
|
-
"box-border": {
|
|
1573
|
-
boxSizing: "border-box"
|
|
1574
|
-
}
|
|
1575
|
-
}, toneMap$1 = {
|
|
1576
|
-
default: "surface",
|
|
1577
|
-
neutral: "neutral",
|
|
1578
|
-
suggest: "suggest",
|
|
1579
|
-
primary: "accent",
|
|
1580
|
-
positive: "positive",
|
|
1581
|
-
caution: "caution",
|
|
1582
|
-
critical: "critical"
|
|
1583
|
-
}, variantMap = {
|
|
1584
|
-
default: "solid",
|
|
1585
|
-
ghost: "ghost",
|
|
1586
|
-
bleed: "tinted"
|
|
1587
|
-
}, buttonVariantRules = {};
|
|
1588
|
-
for (const mode of THEME_COLOR_BUTTON_MODES)
|
|
1589
|
-
for (const tone of THEME_COLOR_STATE_TONES)
|
|
1590
|
-
mode === "default" && (buttonVariantRules[`&.${variantMap[mode]}.${toneMap$1[tone]}`] = {
|
|
1591
|
-
boxShadow: "none",
|
|
1592
|
-
"--color-bg": `var(--color-solid-${tone}-bg-0)`,
|
|
1593
|
-
"--color-border": `var(--color-solid-${tone}-border-1)`,
|
|
1594
|
-
"--color-fg": `var(--color-solid-${tone}-fg-0)`,
|
|
1595
|
-
"--color-muted-fg": `var(--color-solid-${tone}-fg-4)`,
|
|
1596
|
-
"@nest": {
|
|
1597
|
-
"&:not([data-disabled]):hover": {
|
|
1598
|
-
"--color-bg": `var(--color-solid-${tone}-bg-1)`,
|
|
1599
|
-
"--color-border": `var(--color-solid-${tone}-border-2)`,
|
|
1600
|
-
"--color-fg": `var(--color-solid-${tone}-fg-0)`,
|
|
1601
|
-
"--color-muted-fg": `var(--color-solid-${tone}-fg-4)`
|
|
1602
|
-
},
|
|
1603
|
-
"&:not([data-disabled]):active": {
|
|
1604
|
-
"--color-bg": `var(--color-solid-${tone}-bg-2)`,
|
|
1605
|
-
"--color-border": `var(--color-solid-${tone}-border-3)`,
|
|
1606
|
-
"--color-fg": `var(--color-solid-${tone}-fg-0)`,
|
|
1607
|
-
"--color-muted-fg": `var(--color-solid-${tone}-fg-4)`
|
|
1608
|
-
},
|
|
1609
|
-
"&:not([data-disabled])[data-selected]": {
|
|
1610
|
-
"--color-bg": `var(--color-solid-${tone}-bg-2)`,
|
|
1611
|
-
"--color-border": `var(--color-solid-${tone}-border-3)`,
|
|
1612
|
-
"--color-fg": `var(--color-solid-${tone}-fg-0)`,
|
|
1613
|
-
"--color-muted-fg": `var(--color-solid-${tone}-fg-4)`
|
|
1614
|
-
},
|
|
1615
|
-
"&[data-disabled]": {
|
|
1616
|
-
"--color-bg": "var(--color-tinted-default-bg-1)",
|
|
1617
|
-
"--color-border": "var(--color-tinted-default-border-0)",
|
|
1618
|
-
"--color-fg": "var(--color-tinted-default-border-2)",
|
|
1619
|
-
"--color-muted-fg": "var(--color-tinted-default-border-1)"
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
}), mode === "bleed" && (buttonVariantRules[`&.${variantMap[mode]}.${toneMap$1[tone]}`] = {
|
|
1623
|
-
boxShadow: "none",
|
|
1624
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-0)`,
|
|
1625
|
-
"--color-border": `var(--color-tinted-${tone}-border-1)`,
|
|
1626
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-2)`,
|
|
1627
|
-
"--color-muted-fg": `var(--color-tinted-${tone}-fg-4)`,
|
|
1628
|
-
"@nest": {
|
|
1629
|
-
"&:not([data-disabled]):hover": {
|
|
1630
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-1)`,
|
|
1631
|
-
"--color-border": `var(--color-tinted-${tone}-border-2)`,
|
|
1632
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`,
|
|
1633
|
-
"--color-muted-fg": `var(--color-tinted-${tone}-fg-3)`
|
|
1634
|
-
},
|
|
1635
|
-
"&:not([data-disabled]):active": {
|
|
1636
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-2)`,
|
|
1637
|
-
"--color-border": `var(--color-tinted-${tone}-border-3)`,
|
|
1638
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`,
|
|
1639
|
-
"--color-muted-fg": `var(--color-tinted-${tone}-fg-3)`
|
|
1640
|
-
},
|
|
1641
|
-
"&:not([data-disabled])[data-selected]": {
|
|
1642
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-2)`,
|
|
1643
|
-
"--color-border": `var(--color-tinted-${tone}-border-3)`,
|
|
1644
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`,
|
|
1645
|
-
"--color-muted-fg": `var(--color-tinted-${tone}-fg-3)`
|
|
1646
|
-
},
|
|
1647
|
-
"&[data-disabled]": {
|
|
1648
|
-
"--color-bg": "var(--color-tinted-default-bg-0)",
|
|
1649
|
-
"--color-border": "var(--color-tinted-default-border-0)",
|
|
1650
|
-
"--color-fg": "var(--color-tinted-default-border-2)",
|
|
1651
|
-
"--color-muted-fg": "var(--color-tinted-default-border-1)"
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
}), mode === "ghost" && (buttonVariantRules[`&.${variantMap[mode]}.${toneMap$1[tone]}`] = {
|
|
1655
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-1)`,
|
|
1656
|
-
"--color-border": `var(--color-tinted-${tone}-border-0)`,
|
|
1657
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-2)`,
|
|
1658
|
-
"@nest": {
|
|
1659
|
-
"&:not([data-disabled]):hover": {
|
|
1660
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-2)`,
|
|
1661
|
-
"--color-border": `var(--color-tinted-${tone}-border-1)`,
|
|
1662
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`
|
|
1663
|
-
},
|
|
1664
|
-
"&:not([data-disabled]):active": {
|
|
1665
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-3)`,
|
|
1666
|
-
"--color-border": `var(--color-tinted-${tone}-border-2)`,
|
|
1667
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`
|
|
1668
|
-
},
|
|
1669
|
-
"&:not([data-disabled])[data-selected]": {
|
|
1670
|
-
"--color-bg": `var(--color-tinted-${tone}-bg-3)`,
|
|
1671
|
-
"--color-border": `var(--color-tinted-${tone}-border-2)`,
|
|
1672
|
-
"--color-fg": `var(--color-tinted-${tone}-fg-1)`
|
|
1673
|
-
},
|
|
1674
|
-
"&[data-disabled]": {
|
|
1675
|
-
"--color-bg": "var(--color-tinted-default-bg-0)",
|
|
1676
|
-
"--color-border": "var(--color-tinted-default-border-0)",
|
|
1677
|
-
"--color-fg": "var(--color-tinted-default-border-2)"
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
});
|
|
1681
|
-
const buttonRules = {
|
|
1682
|
-
button: {
|
|
1683
|
-
WebkitFontSmoothing: "inherit",
|
|
1684
|
-
appearance: "none",
|
|
1685
|
-
font: "inherit",
|
|
1686
|
-
outline: "none",
|
|
1687
|
-
userSelect: "none",
|
|
1688
|
-
textDecoration: "none",
|
|
1689
|
-
border: 0,
|
|
1690
|
-
boxSizing: "border-box",
|
|
1691
|
-
padding: 0,
|
|
1692
|
-
overflow: "hidden",
|
|
1693
|
-
margin: 0,
|
|
1694
|
-
textAlign: "left",
|
|
1695
|
-
position: "relative",
|
|
1696
|
-
verticalAlign: "top",
|
|
1697
|
-
backgroundColor: "var(--color-bg)",
|
|
1698
|
-
color: "var(--color-fg)",
|
|
1699
|
-
boxShadow: "inset 0 0 0 var(--button-border-width) var(--color-border)",
|
|
1700
|
-
"@nest": {
|
|
1701
|
-
"&::-moz-focus-inner": {
|
|
1702
|
-
border: 0,
|
|
1703
|
-
padding: 0
|
|
1704
|
-
},
|
|
1705
|
-
"&:focus": {
|
|
1706
|
-
outline: "var(--button-focus-ring-width) solid var(--color-focus-ring)",
|
|
1707
|
-
outlineOffset: "var(--button-focus-ring-offset)"
|
|
1708
|
-
},
|
|
1709
|
-
"&:focus:not(:focus-visible)": {
|
|
1710
|
-
outline: "none"
|
|
1711
|
-
},
|
|
1712
|
-
...buttonVariantRules
|
|
1713
|
-
}
|
|
1714
|
-
},
|
|
1715
|
-
"button-loading-box": {
|
|
1716
|
-
position: "absolute",
|
|
1717
|
-
top: 0,
|
|
1718
|
-
left: 0,
|
|
1719
|
-
right: 0,
|
|
1720
|
-
bottom: 0,
|
|
1721
|
-
backgroundColor: "var(--color-bg)",
|
|
1722
|
-
borderRadius: "inherit",
|
|
1723
|
-
zIndex: 1,
|
|
1724
|
-
opacity: 0.8
|
|
1725
|
-
}
|
|
1726
|
-
}, toneMap = {
|
|
1727
|
-
transparent: "canvas",
|
|
1728
|
-
default: "surface",
|
|
1729
|
-
neutral: "neutral",
|
|
1730
|
-
suggest: "suggest",
|
|
1731
|
-
primary: "accent",
|
|
1732
|
-
positive: "positive",
|
|
1733
|
-
caution: "caution",
|
|
1734
|
-
critical: "critical",
|
|
1735
|
-
inherit: void 0
|
|
1736
|
-
}, cardRules = {
|
|
1737
|
-
card: {
|
|
1738
|
-
backgroundColor: vars.color.bg,
|
|
1739
|
-
color: vars.color.fg,
|
|
1740
|
-
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
1741
|
-
[varNames.color.border]: vars.color.tinted.default.border[1],
|
|
1742
|
-
[varNames.color.fg]: vars.color.tinted.default.fg[0],
|
|
1743
|
-
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
1744
|
-
[varNames.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
1745
|
-
"@nest": {
|
|
1746
|
-
...buildCardTonesRules(),
|
|
1747
|
-
"&[data-checkered]": {
|
|
1748
|
-
"--card-bg-image": "repeating-conic-gradient(var(--color-tinted-default-bg-0) 0% 25%, var(--color-tinted-default-bg-1) 0% 50%)",
|
|
1749
|
-
backgroundSize: "var(--space-3) var(--space-3)",
|
|
1750
|
-
backgroundPosition: "50% 50%",
|
|
1751
|
-
backgroundImage: "var(--card-bg-image)"
|
|
1752
|
-
},
|
|
1753
|
-
"&:is(a)": {
|
|
1754
|
-
outline: "none",
|
|
1755
|
-
textDecoration: "none",
|
|
1756
|
-
"@nest": {
|
|
1757
|
-
"&:not(:disabled)": {
|
|
1758
|
-
"@nest": {
|
|
1759
|
-
"&:hover": {
|
|
1760
|
-
"--color-bg": "var(--color-tinted-default-bg-1)",
|
|
1761
|
-
"--color-fg": "var(--color-tinted-default-fg-0)",
|
|
1762
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-2)",
|
|
1763
|
-
"--color-muted-fg": "var(--color-tinted-default-fg-3)"
|
|
1764
|
-
// '--color-icon': 'var(--color-tinted-default-fg-1)',
|
|
1765
|
-
},
|
|
1766
|
-
"&:active, &[data-pressed]": {
|
|
1767
|
-
"--color-bg": "var(--color-tinted-default-bg-2)",
|
|
1768
|
-
"--color-fg": "var(--color-tinted-default-fg-1)",
|
|
1769
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-3)",
|
|
1770
|
-
"--color-muted-fg": "var(--color-tinted-default-fg-4)"
|
|
1771
|
-
// '--color-icon': 'var(--color-tinted-default-fg-1)',
|
|
1772
|
-
},
|
|
1773
|
-
//
|
|
1774
|
-
"&[data-selectable]:focus, &[data-selected]": {
|
|
1775
|
-
"--color-bg": "var(--color-solid-default-bg-1)",
|
|
1776
|
-
"--color-fg": "var(--color-solid-default-fg-1)",
|
|
1777
|
-
"--color-muted-bg": "var(--color-solid-default-bg-0)",
|
|
1778
|
-
"--color-muted-fg": "var(--color-solid-default-fg-3)"
|
|
1779
|
-
// '--color-icon': 'var(--color-solid-default-fg-1)',
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
},
|
|
1785
|
-
"&:is(button)": {
|
|
1786
|
-
WebkitFontSmoothing: "inherit",
|
|
1787
|
-
appearance: "none",
|
|
1788
|
-
outline: "none",
|
|
1789
|
-
font: "inherit",
|
|
1790
|
-
textAlign: "inherit",
|
|
1791
|
-
border: 0,
|
|
1792
|
-
width: ["-moz-available", "-webkit-fill-available", "stretch"],
|
|
1793
|
-
cursor: "default",
|
|
1794
|
-
// todo
|
|
1795
|
-
// --card-focus-ring-box-shadow: none;
|
|
1796
|
-
// box-shadow: var(--card-focus-ring-box-shadow);
|
|
1797
|
-
"@nest": {
|
|
1798
|
-
"&:not(:disabled)": {
|
|
1799
|
-
"@nest": {
|
|
1800
|
-
"&:hover": {
|
|
1801
|
-
"--color-bg": "var(--color-tinted-default-bg-1)",
|
|
1802
|
-
"--color-fg": "var(--color-tinted-default-fg-1)",
|
|
1803
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-2)",
|
|
1804
|
-
"--color-muted-fg": "var(--color-tinted-default-fg-3)"
|
|
1805
|
-
// '--color-icon': 'var(--color-tinted-default-fg-1)',
|
|
1806
|
-
},
|
|
1807
|
-
"&:active": {
|
|
1808
|
-
"--color-bg": "var(--color-tinted-default-bg-2)",
|
|
1809
|
-
"--color-fg": "var(--color-tinted-default-fg-1)",
|
|
1810
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-3)",
|
|
1811
|
-
"--color-muted-fg": "var(--color-tinted-default-fg-4)"
|
|
1812
|
-
// '--color-icon': 'var(--color-tinted-default-fg-1)',
|
|
1813
|
-
},
|
|
1814
|
-
"&[data-pressed]": {
|
|
1815
|
-
"--color-bg": "var(--color-tinted-default-bg-2)",
|
|
1816
|
-
"--color-fg": "var(--color-tinted-default-fg-1)",
|
|
1817
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-3)",
|
|
1818
|
-
"--color-muted-fg": "var(--color-tinted-default-fg-4)"
|
|
1819
|
-
// '--color-icon': 'var(--color-tinted-default-fg-1)',
|
|
1820
|
-
},
|
|
1821
|
-
// &:focus,
|
|
1822
|
-
"&[data-selectable]:focus, &[data-selected]": {
|
|
1823
|
-
"--color-bg": "var(--color-solid-default-bg-2)",
|
|
1824
|
-
"--color-border": "var(--color-solid-default-border-0)",
|
|
1825
|
-
"--color-fg": "var(--color-solid-default-fg-1)",
|
|
1826
|
-
"--color-muted-bg": "var(--color-solid-default-bg-3)",
|
|
1827
|
-
"--color-muted-fg": "var(--color-solid-default-fg-4)"
|
|
1828
|
-
// '--color-icon': 'var(--color-solid-default-fg-1)',
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
},
|
|
1832
|
-
"&:disabled": {
|
|
1833
|
-
"--color-bg": "var(--color-tinted-default-bg-0)",
|
|
1834
|
-
"--color-fg": "var(--color-tinted-default-border-2)",
|
|
1835
|
-
"--color-muted-bg": "var(--color-tinted-default-bg-1)",
|
|
1836
|
-
"--color-muted-fg": "var(--color-tinted-default-border-1)"
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
},
|
|
1840
|
-
"&:is(pre)": {
|
|
1841
|
-
font: "inherit"
|
|
1842
|
-
}
|
|
1843
|
-
},
|
|
1844
|
-
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1845
|
-
// Legacy `--card` variables
|
|
1846
|
-
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1847
|
-
//
|
|
1848
|
-
// '--card-accent-fg-color': 'var(--color-accent-fg)',
|
|
1849
|
-
// ...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => {
|
|
1850
|
-
// return {
|
|
1851
|
-
// ...acc,
|
|
1852
|
-
// [`--card-avatar-${color}-bg-color`]: `var(--color-avatar-${color}-bg)`,
|
|
1853
|
-
// [`--card-avatar-${color}-fg-color`]: `var(--color-avatar-${color}-fg)`,
|
|
1854
|
-
// }
|
|
1855
|
-
// }, {} as Properties),
|
|
1856
|
-
// '--card-backdrop-color': 'var(--color-backdrop)',
|
|
1857
|
-
// ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
1858
|
-
// return {
|
|
1859
|
-
// ...acc,
|
|
1860
|
-
// [`--card-badge-${tone}-bg-color`]: `var(--color-badge-${tone}-bg)`,
|
|
1861
|
-
// [`--card-badge-${tone}-dot-color`]: `var(--color-badge-${tone}-dot)`,
|
|
1862
|
-
// [`--card-badge-${tone}-fg-color`]: `var(--color-badge-${tone}-fg)`,
|
|
1863
|
-
// [`--card-badge-${tone}-icon-color`]: `var(--color-badge-${tone}-icon)`,
|
|
1864
|
-
// }
|
|
1865
|
-
// }, {} as Properties),
|
|
1866
|
-
"--card-bg-color": vars.color.bg,
|
|
1867
|
-
"--card-bg2-color": vars.color.muted.bg,
|
|
1868
|
-
"--card-border-color": vars.color.border,
|
|
1869
|
-
"--card-code-bg-color": vars.color.muted.bg,
|
|
1870
|
-
"--card-code-fg-color": vars.color.tinted.default.fg[4],
|
|
1871
|
-
"--card-fg-color": vars.color.fg,
|
|
1872
|
-
"--card-focus-ring-color": vars.color.focusRing,
|
|
1873
|
-
"--card-icon-color": vars.color.fg,
|
|
1874
|
-
"--card-kbd-bg-color": vars.color.muted.bg,
|
|
1875
|
-
"--card-kbd-border-color": vars.color.tinted.default.border[1],
|
|
1876
|
-
"--card-kbd-fg-color": vars.color.muted.fg,
|
|
1877
|
-
"--card-link-color": vars.color.link.fg,
|
|
1878
|
-
"--card-link-fg-color": vars.color.link.fg,
|
|
1879
|
-
"--card-muted-bg-color": vars.color.muted.bg,
|
|
1880
|
-
// 'var(--color-muted-bg)', // vars.color.tinted.default.bg[1],
|
|
1881
|
-
"--card-muted-fg-color": vars.color.muted.fg,
|
|
1882
|
-
// vars.color.tinted.default.fg[4],
|
|
1883
|
-
"--card-shadow-outline-color": vars.color.shadow.outline,
|
|
1884
|
-
"--card-shadow-umbra-color": vars.color.shadow.umbra,
|
|
1885
|
-
"--card-shadow-penumbra-color": vars.color.shadow.penumbra,
|
|
1886
|
-
"--card-shadow-ambient-color": vars.color.shadow.ambient,
|
|
1887
|
-
// '--card-skeleton-from-color': 'var(--color-skeleton-from)',
|
|
1888
|
-
// '--card-skeleton-to-color': 'var(--color-skeleton-to)',
|
|
1889
|
-
"--card-hairline-soft-color": vars.color.tinted.default.border[1],
|
|
1890
|
-
"--card-hairline-hard-color": vars.color.tinted.default.border[2]
|
|
1891
|
-
}
|
|
1892
|
-
};
|
|
1893
|
-
function buildCardTonesRules() {
|
|
1894
|
-
const rules2 = {};
|
|
1895
|
-
for (const scheme of ["light", "dark"]) {
|
|
1896
|
-
const props = {
|
|
1897
|
-
colorScheme: scheme
|
|
1898
|
-
};
|
|
1899
|
-
for (const cardTone of THEME_COLOR_CARD_TONES) {
|
|
1900
|
-
const source = vars.color[scheme][cardTone], target = varNames.color[cardTone];
|
|
1901
|
-
Object.assign(props, {
|
|
1902
|
-
...buildCardAvatarColorProperties({
|
|
1903
|
-
source,
|
|
1904
|
-
target
|
|
1905
|
-
}),
|
|
1906
|
-
[target.backdrop]: source.backdrop,
|
|
1907
|
-
[target.focusRing]: source.focusRing,
|
|
1908
|
-
[target.link.fg]: source.link.fg,
|
|
1909
|
-
[target.shadow.outline]: source.shadow.outline,
|
|
1910
|
-
[target.shadow.umbra]: source.shadow.umbra,
|
|
1911
|
-
[target.shadow.penumbra]: source.shadow.penumbra,
|
|
1912
|
-
[target.shadow.ambient]: source.shadow.ambient,
|
|
1913
|
-
[target.token.atrule]: source.token.atrule,
|
|
1914
|
-
[target.token.attrName]: source.token.attrName,
|
|
1915
|
-
[target.token.attrValue]: source.token.attrValue,
|
|
1916
|
-
[target.token.attribute]: source.token.attribute,
|
|
1917
|
-
[target.token.boolean]: source.token.boolean,
|
|
1918
|
-
[target.token.builtin]: source.token.builtin,
|
|
1919
|
-
[target.token.cdata]: source.token.cdata,
|
|
1920
|
-
[target.token.char]: source.token.char,
|
|
1921
|
-
[target.token.class]: source.token.class,
|
|
1922
|
-
[target.token.className]: source.token.className,
|
|
1923
|
-
[target.token.comment]: source.token.comment,
|
|
1924
|
-
[target.token.constant]: source.token.constant,
|
|
1925
|
-
[target.token.deleted]: source.token.deleted,
|
|
1926
|
-
[target.token.doctype]: source.token.doctype,
|
|
1927
|
-
[target.token.entity]: source.token.entity,
|
|
1928
|
-
[target.token.function]: source.token.function,
|
|
1929
|
-
[target.token.hexcode]: source.token.hexcode,
|
|
1930
|
-
[target.token.id]: source.token.id,
|
|
1931
|
-
[target.token.important]: source.token.important,
|
|
1932
|
-
[target.token.inserted]: source.token.inserted,
|
|
1933
|
-
[target.token.keyword]: source.token.keyword,
|
|
1934
|
-
[target.token.number]: source.token.number,
|
|
1935
|
-
[target.token.operator]: source.token.operator,
|
|
1936
|
-
[target.token.prolog]: source.token.prolog,
|
|
1937
|
-
[target.token.property]: source.token.property,
|
|
1938
|
-
[target.token.pseudoClass]: source.token.pseudoClass,
|
|
1939
|
-
[target.token.pseudoElement]: source.token.pseudoElement,
|
|
1940
|
-
[target.token.punctuation]: source.token.punctuation,
|
|
1941
|
-
[target.token.regex]: source.token.regex,
|
|
1942
|
-
[target.token.selector]: source.token.selector,
|
|
1943
|
-
[target.token.string]: source.token.string,
|
|
1944
|
-
[target.token.symbol]: source.token.symbol,
|
|
1945
|
-
[target.token.tag]: source.token.tag,
|
|
1946
|
-
[target.token.unit]: source.token.unit,
|
|
1947
|
-
[target.token.url]: source.token.url,
|
|
1948
|
-
[target.token.variable]: source.token.variable,
|
|
1949
|
-
...buildCardColorVariantProperties({
|
|
1950
|
-
source: source.solid,
|
|
1951
|
-
target: target.solid
|
|
1952
|
-
}),
|
|
1953
|
-
...buildCardColorVariantProperties({
|
|
1954
|
-
source: source.tinted,
|
|
1955
|
-
target: target.tinted
|
|
1956
|
-
})
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
rules2[`&.${scheme}`] = props;
|
|
1960
|
-
}
|
|
1961
|
-
for (const cardTone of THEME_COLOR_CARD_TONES) {
|
|
1962
|
-
const source = vars.color[cardTone], target = varNames.color;
|
|
1963
|
-
rules2[`&.${toneMap[cardTone]}`] = {
|
|
1964
|
-
...buildCardAvatarColorProperties({
|
|
1965
|
-
source,
|
|
1966
|
-
target
|
|
1967
|
-
}),
|
|
1968
|
-
[target.backdrop]: source.backdrop,
|
|
1969
|
-
[target.focusRing]: source.focusRing,
|
|
1970
|
-
[target.link.fg]: source.link.fg,
|
|
1971
|
-
[target.shadow.outline]: source.shadow.outline,
|
|
1972
|
-
[target.shadow.umbra]: source.shadow.umbra,
|
|
1973
|
-
[target.shadow.penumbra]: source.shadow.penumbra,
|
|
1974
|
-
[target.shadow.ambient]: source.shadow.ambient,
|
|
1975
|
-
[target.token.atrule]: source.token.atrule,
|
|
1976
|
-
[target.token.attrName]: source.token.attrName,
|
|
1977
|
-
[target.token.attrValue]: source.token.attrValue,
|
|
1978
|
-
[target.token.attribute]: source.token.attribute,
|
|
1979
|
-
[target.token.boolean]: source.token.boolean,
|
|
1980
|
-
[target.token.builtin]: source.token.builtin,
|
|
1981
|
-
[target.token.cdata]: source.token.cdata,
|
|
1982
|
-
[target.token.char]: source.token.char,
|
|
1983
|
-
[target.token.class]: source.token.class,
|
|
1984
|
-
[target.token.className]: source.token.className,
|
|
1985
|
-
[target.token.comment]: source.token.comment,
|
|
1986
|
-
[target.token.constant]: source.token.constant,
|
|
1987
|
-
[target.token.deleted]: source.token.deleted,
|
|
1988
|
-
[target.token.doctype]: source.token.doctype,
|
|
1989
|
-
[target.token.entity]: source.token.entity,
|
|
1990
|
-
[target.token.function]: source.token.function,
|
|
1991
|
-
[target.token.hexcode]: source.token.hexcode,
|
|
1992
|
-
[target.token.id]: source.token.id,
|
|
1993
|
-
[target.token.important]: source.token.important,
|
|
1994
|
-
[target.token.inserted]: source.token.inserted,
|
|
1995
|
-
[target.token.keyword]: source.token.keyword,
|
|
1996
|
-
[target.token.number]: source.token.number,
|
|
1997
|
-
[target.token.operator]: source.token.operator,
|
|
1998
|
-
[target.token.prolog]: source.token.prolog,
|
|
1999
|
-
[target.token.property]: source.token.property,
|
|
2000
|
-
[target.token.pseudoClass]: source.token.pseudoClass,
|
|
2001
|
-
[target.token.pseudoElement]: source.token.pseudoElement,
|
|
2002
|
-
[target.token.punctuation]: source.token.punctuation,
|
|
2003
|
-
[target.token.regex]: source.token.regex,
|
|
2004
|
-
[target.token.selector]: source.token.selector,
|
|
2005
|
-
[target.token.string]: source.token.string,
|
|
2006
|
-
[target.token.symbol]: source.token.symbol,
|
|
2007
|
-
[target.token.tag]: source.token.tag,
|
|
2008
|
-
[target.token.unit]: source.token.unit,
|
|
2009
|
-
[target.token.url]: source.token.url,
|
|
2010
|
-
[target.token.variable]: source.token.variable,
|
|
2011
|
-
...buildCardColorVariantProperties({
|
|
2012
|
-
source: source.solid,
|
|
2013
|
-
target: target.solid
|
|
2014
|
-
}),
|
|
2015
|
-
...buildCardColorVariantProperties({
|
|
2016
|
-
source: source.tinted,
|
|
2017
|
-
target: target.tinted
|
|
2018
|
-
})
|
|
2019
|
-
};
|
|
2020
|
-
}
|
|
2021
|
-
return rules2;
|
|
2022
|
-
}
|
|
2023
|
-
function buildCardAvatarColorProperties(options) {
|
|
2024
|
-
const {
|
|
2025
|
-
source,
|
|
2026
|
-
target
|
|
2027
|
-
} = options, props = {};
|
|
2028
|
-
for (const hue of HUES)
|
|
2029
|
-
Object.assign(props, {
|
|
2030
|
-
[target.avatar[hue].bg]: source.avatar[hue].bg,
|
|
2031
|
-
[target.avatar[hue].fg]: source.avatar[hue].fg
|
|
2032
|
-
});
|
|
2033
|
-
return props;
|
|
2034
|
-
}
|
|
2035
|
-
function buildCardColorVariantProperties(options) {
|
|
2036
|
-
const {
|
|
2037
|
-
source,
|
|
2038
|
-
target
|
|
2039
|
-
} = options, props = {};
|
|
2040
|
-
for (const elementTone of THEME_COLOR_STATE_TONES)
|
|
2041
|
-
Object.assign(props, {
|
|
2042
|
-
[target[elementTone].bg[0]]: source[elementTone].bg[0],
|
|
2043
|
-
[target[elementTone].bg[1]]: source[elementTone].bg[1],
|
|
2044
|
-
[target[elementTone].bg[2]]: source[elementTone].bg[2],
|
|
2045
|
-
[target[elementTone].bg[3]]: source[elementTone].bg[3],
|
|
2046
|
-
[target[elementTone].bg[4]]: source[elementTone].bg[4],
|
|
2047
|
-
[target[elementTone].border[0]]: source[elementTone].border[0],
|
|
2048
|
-
[target[elementTone].border[1]]: source[elementTone].border[1],
|
|
2049
|
-
[target[elementTone].border[2]]: source[elementTone].border[2],
|
|
2050
|
-
[target[elementTone].border[3]]: source[elementTone].border[3],
|
|
2051
|
-
[target[elementTone].border[4]]: source[elementTone].border[4],
|
|
2052
|
-
[target[elementTone].fg[0]]: source[elementTone].fg[0],
|
|
2053
|
-
[target[elementTone].fg[1]]: source[elementTone].fg[1],
|
|
2054
|
-
[target[elementTone].fg[2]]: source[elementTone].fg[2],
|
|
2055
|
-
[target[elementTone].fg[3]]: source[elementTone].fg[3],
|
|
2056
|
-
[target[elementTone].fg[4]]: source[elementTone].fg[4]
|
|
2057
|
-
});
|
|
2058
|
-
return props;
|
|
2059
|
-
}
|
|
2060
|
-
const checkboxRules = {
|
|
2061
|
-
checkbox: {
|
|
2062
|
-
position: "relative",
|
|
2063
|
-
display: "inline-block"
|
|
2064
|
-
},
|
|
2065
|
-
"checkbox-input": {
|
|
2066
|
-
position: "absolute",
|
|
2067
|
-
top: 0,
|
|
2068
|
-
left: 0,
|
|
2069
|
-
width: "100%",
|
|
2070
|
-
height: "100%",
|
|
2071
|
-
outline: "none",
|
|
2072
|
-
opacity: 0,
|
|
2073
|
-
zIndex: 1,
|
|
2074
|
-
padding: 0,
|
|
2075
|
-
margin: 0,
|
|
2076
|
-
"@nest": {
|
|
2077
|
-
"& + span": {
|
|
2078
|
-
position: "relative",
|
|
2079
|
-
display: "block",
|
|
2080
|
-
width: "var(--input-checkbox-size)",
|
|
2081
|
-
height: "var(--input-checkbox-size)",
|
|
2082
|
-
boxSizing: "border-box",
|
|
2083
|
-
borderRadius: "var(--radius-2)",
|
|
2084
|
-
lineHeight: 1,
|
|
2085
|
-
backgroundColor: "var(--color-checkbox-bg)",
|
|
2086
|
-
boxShadow: "inset 0 0 0 1px var(--color-checkbox-border)",
|
|
2087
|
-
color: "var(--color-checkbox-fg)",
|
|
2088
|
-
// '--color-checkbox-bg': 'var(--color-input-default-enabled-bg)',
|
|
2089
|
-
// '--color-checkbox-border': 'var(--color-input-default-enabled-border)',
|
|
2090
|
-
// '--color-checkbox-fg': 'var(--color-input-default-enabled-fg)',
|
|
2091
|
-
"--color-checkbox-bg": "var(--color-tinted-default-bg-0)",
|
|
2092
|
-
"--color-checkbox-border": "var(--color-tinted-default-border-1)",
|
|
2093
|
-
"--color-checkbox-fg": "var(--color-tinted-default-fg-0)"
|
|
2094
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2095
|
-
// color: color.input.default.enabled.border,
|
|
2096
|
-
// width: input.border.width,
|
|
2097
|
-
// })},
|
|
2098
|
-
},
|
|
2099
|
-
"& + span > svg": {
|
|
2100
|
-
display: "block",
|
|
2101
|
-
position: "absolute",
|
|
2102
|
-
opacity: 0,
|
|
2103
|
-
height: "100%",
|
|
2104
|
-
width: "100%"
|
|
2105
|
-
},
|
|
2106
|
-
"& + span > svg > path": {
|
|
2107
|
-
vectorEffect: "non-scaling-stroke",
|
|
2108
|
-
strokeWidth: "1.5px !important"
|
|
2109
|
-
},
|
|
2110
|
-
"&:hover + span": {
|
|
2111
|
-
"--color-checkbox-bg": "var(--color-tinted-default-bg-1)",
|
|
2112
|
-
"--color-checkbox-border": "var(--color-tinted-default-border-2)",
|
|
2113
|
-
"--color-checkbox-fg": "var(--color-tinted-default-fg-0)"
|
|
2114
|
-
},
|
|
2115
|
-
"&:checked + span": {
|
|
2116
|
-
"--color-checkbox-bg": "var(--color-solid-default-bg-0)",
|
|
2117
|
-
"--color-checkbox-border": "var(--color-solid-default-bg-0)",
|
|
2118
|
-
"--color-checkbox-fg": "var(--color-solid-default-fg-0)"
|
|
2119
|
-
// '--color-checkbox-bg': 'var(--color-input-default-enabled-fg)',
|
|
2120
|
-
// '--color-checkbox-border': 'var(--color-input-default-enabled-fg)',
|
|
2121
|
-
// '--color-checkbox-fg': 'var(--color-input-default-enabled-bg)',
|
|
2122
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2123
|
-
// color: color.input.default.enabled.fg,
|
|
2124
|
-
// width: input.border.width,
|
|
2125
|
-
// })},
|
|
2126
|
-
},
|
|
2127
|
-
"&:checked + span > svg:first-child": {
|
|
2128
|
-
opacity: 1
|
|
2129
|
-
},
|
|
2130
|
-
// focus
|
|
2131
|
-
"&:not(:disabled):focus:focus-visible + span": {
|
|
2132
|
-
// box-shadow: ${focusRingStyle({focusRing})},
|
|
2133
|
-
},
|
|
2134
|
-
// focus when checked - uses a different offset
|
|
2135
|
-
"&:not(:disabled):focus:focus-visible&:checked + span": {
|
|
2136
|
-
// box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})},
|
|
2137
|
-
},
|
|
2138
|
-
"&[data-error] + span": {
|
|
2139
|
-
"--color-checkbox-bg": "var(--color-input-invalid-enabled-border)",
|
|
2140
|
-
"--color-checkbox-border": "var(--color-input-invalid-enabled-bg)",
|
|
2141
|
-
"--color-checkbox-fg": "var(--color-input-invalid-enabled-fg)"
|
|
2142
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2143
|
-
// width: input.border.width,
|
|
2144
|
-
// color: color.input.invalid.enabled.muted.bg,
|
|
2145
|
-
// })},
|
|
2146
|
-
},
|
|
2147
|
-
"&[data-error]:checked + span": {
|
|
2148
|
-
"--color-checkbox-bg": "var(--color-input-invalid-enabled-muted-bg)",
|
|
2149
|
-
"--color-checkbox-fg": "var(--color-input-invalid-enabled-bg)"
|
|
2150
|
-
},
|
|
2151
|
-
"&[data-error]:checked:not(:disabled):focus:focus-visible + span": {
|
|
2152
|
-
"--color-checkbox-border": "var(--color-input-invalid-readOnly-muted-bg)"
|
|
2153
|
-
// box-shadow: ${focusRingStyle({
|
|
2154
|
-
// border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
|
|
2155
|
-
// focusRing: {width: 1, offset: 1},
|
|
2156
|
-
// })},
|
|
2157
|
-
},
|
|
2158
|
-
"&:disabled + span": {
|
|
2159
|
-
"--color-checkbox-bg": "var(--color-tinted-default-bg-1)",
|
|
2160
|
-
"--color-checkbox-border": "var(--color-tinted-default-border-0)",
|
|
2161
|
-
"--color-checkbox-fg": "var(--color-tinted-default-border-2)"
|
|
2162
|
-
},
|
|
2163
|
-
"&:checked:disabled + span": {
|
|
2164
|
-
"--color-checkbox-bg": "var(--color-tinted-default-border-2)",
|
|
2165
|
-
"--color-checkbox-border": "var(--color-tinted-default-border-2)",
|
|
2166
|
-
"--color-checkbox-fg": "var(--color-tinted-default-bg-0)"
|
|
2167
|
-
},
|
|
2168
|
-
// '&:disabled:checked + span': {
|
|
2169
|
-
// '--color-checkbox-bg': 'var(--color-input-default-disabled-muted-bg)',
|
|
2170
|
-
// },
|
|
2171
|
-
"&[data-read-only] + span": {
|
|
2172
|
-
"--color-checkbox-bg": "var(--color-input-default-readOnly-bg)",
|
|
2173
|
-
"--color-checkbox-border": "var(--color-input-default-readOnly-border)",
|
|
2174
|
-
"--color-checkbox-fg": "var(--color-input-default-readOnly-fg)"
|
|
2175
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2176
|
-
// width: input.border.width,
|
|
2177
|
-
// color: color.input.default.readOnly.border,
|
|
2178
|
-
// })},
|
|
2179
|
-
},
|
|
2180
|
-
"&[data-read-only]:checked + span": {
|
|
2181
|
-
"--color-checkbox-bg": "var(--color-input-default-readOnly-muted-bg)"
|
|
2182
|
-
},
|
|
2183
|
-
"&:indeterminate + span > svg:last-child": {
|
|
2184
|
-
opacity: 1
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
}, codeRules = {
|
|
2189
|
-
code: {
|
|
2190
|
-
"--font-weight-regular": "var(--font-code-weight-regular)",
|
|
2191
|
-
"--font-weight-medium": "var(--font-code-weight-medium)",
|
|
2192
|
-
"--font-weight-semibold": "var(--font-code-weight-semibold)",
|
|
2193
|
-
"--font-weight-bold": "var(--font-code-weight-bold)",
|
|
2194
|
-
"--font-family": "var(--font-code-family)",
|
|
2195
|
-
"--font-feature-settings": "var(--font-code-feature-settings)",
|
|
2196
|
-
color: "var(--color-code-fg)",
|
|
2197
|
-
"@nest": {
|
|
2198
|
-
"& > code": {
|
|
2199
|
-
fontFamily: "inherit"
|
|
2200
|
-
},
|
|
2201
|
-
// & code {
|
|
2202
|
-
// font-family: inherit;
|
|
2203
|
-
// &.refractor .token {
|
|
2204
|
-
// ${codeSyntaxHighlightingStyle}
|
|
2205
|
-
// }
|
|
2206
|
-
// }
|
|
2207
|
-
"& a": {
|
|
2208
|
-
color: "var(--color-link-fg)",
|
|
2209
|
-
textDecoration: "none",
|
|
2210
|
-
borderRadius: "1px"
|
|
2211
|
-
},
|
|
2212
|
-
"& svg": {
|
|
2213
|
-
// Some popular CSS libraries change the defaults for SVG display
|
|
2214
|
-
// Make sure SVGs are rendered as inline elements
|
|
2215
|
-
display: "inline"
|
|
2216
|
-
},
|
|
2217
|
-
"& [data-sanity-icon]": {
|
|
2218
|
-
verticalAlign: "baseline"
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
},
|
|
2222
|
-
...responsiveRules("code-0", {
|
|
2223
|
-
"--font-size": "var(--font-code-0-size)",
|
|
2224
|
-
"--font-line-height": "var(--font-code-0-line-height)",
|
|
2225
|
-
"--font-letter-spacing": "var(--font-code-0-letter-spacing)",
|
|
2226
|
-
"--font-icon-size": "var(--font-code-0-icon-size)",
|
|
2227
|
-
"--font-ascender-height": "var(--font-code-0-ascender-height)",
|
|
2228
|
-
"--font-descender-height": "var(--font-code-0-descender-height)"
|
|
2229
|
-
// '--font-cap-height': 'var(--font-code-0-cap-height)',
|
|
2230
|
-
}),
|
|
2231
|
-
...responsiveRules("code-1", {
|
|
2232
|
-
"--font-size": "var(--font-code-1-size)",
|
|
2233
|
-
"--font-line-height": "var(--font-code-1-line-height)",
|
|
2234
|
-
"--font-letter-spacing": "var(--font-code-1-letter-spacing)",
|
|
2235
|
-
"--font-icon-size": "var(--font-code-1-icon-size)",
|
|
2236
|
-
"--font-ascender-height": "var(--font-code-1-ascender-height)",
|
|
2237
|
-
"--font-descender-height": "var(--font-code-1-descender-height)"
|
|
2238
|
-
// '--font-cap-height': 'var(--font-code-1-cap-height)',
|
|
2239
|
-
}),
|
|
2240
|
-
...responsiveRules("code-2", {
|
|
2241
|
-
"--font-size": "var(--font-code-2-size)",
|
|
2242
|
-
"--font-line-height": "var(--font-code-2-line-height)",
|
|
2243
|
-
"--font-letter-spacing": "var(--font-code-2-letter-spacing)",
|
|
2244
|
-
"--font-icon-size": "var(--font-code-2-icon-size)",
|
|
2245
|
-
"--font-ascender-height": "var(--font-code-2-ascender-height)",
|
|
2246
|
-
"--font-descender-height": "var(--font-code-2-descender-height)"
|
|
2247
|
-
// '--font-cap-height': 'var(--font-code-2-cap-height)',
|
|
2248
|
-
}),
|
|
2249
|
-
...responsiveRules("code-3", {
|
|
2250
|
-
"--font-size": "var(--font-code-3-size)",
|
|
2251
|
-
"--font-line-height": "var(--font-code-3-line-height)",
|
|
2252
|
-
"--font-letter-spacing": "var(--font-code-3-letter-spacing)",
|
|
2253
|
-
"--font-icon-size": "var(--font-code-3-icon-size)",
|
|
2254
|
-
"--font-ascender-height": "var(--font-code-3-ascender-height)",
|
|
2255
|
-
"--font-descender-height": "var(--font-code-3-descender-height)"
|
|
2256
|
-
// '--font-cap-height': 'var(--font-code-3-cap-height)',
|
|
2257
|
-
}),
|
|
2258
|
-
...responsiveRules("code-4", {
|
|
2259
|
-
"--font-size": "var(--font-code-4-size)",
|
|
2260
|
-
"--font-line-height": "var(--font-code-4-line-height)",
|
|
2261
|
-
"--font-letter-spacing": "var(--font-code-4-letter-spacing)",
|
|
2262
|
-
"--font-icon-size": "var(--font-code-4-icon-size)",
|
|
2263
|
-
"--font-ascender-height": "var(--font-code-4-ascender-height)",
|
|
2264
|
-
"--font-descender-height": "var(--font-code-4-descender-height)"
|
|
2265
|
-
// '--font-cap-height': 'var(--font-code-4-cap-height)',
|
|
2266
|
-
})
|
|
2267
|
-
}, containerRules = {
|
|
2268
|
-
container: {
|
|
2269
|
-
margin: "0 auto",
|
|
2270
|
-
width: "100%"
|
|
2271
|
-
}
|
|
2272
|
-
}, headingRules = {
|
|
2273
|
-
heading: {
|
|
2274
|
-
"--font-weight-regular": "var(--font-heading-weight-regular)",
|
|
2275
|
-
"--font-weight-medium": "var(--font-heading-weight-medium)",
|
|
2276
|
-
"--font-weight-semibold": "var(--font-heading-weight-semibold)",
|
|
2277
|
-
"--font-weight-bold": "var(--font-heading-weight-bold)",
|
|
2278
|
-
"--font-family": "var(--font-heading-family)",
|
|
2279
|
-
"--font-feature-settings": "var(--font-heading-feature-settings)",
|
|
2280
|
-
color: "var(--color-fg)",
|
|
2281
|
-
"@nest": {
|
|
2282
|
-
"& a": {
|
|
2283
|
-
color: "var(--color-link-fg)",
|
|
2284
|
-
textDecoration: "none"
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
},
|
|
2288
|
-
// 'heading-accent': {
|
|
2289
|
-
// '--color-fg': 'var(--color-accent-fg)',
|
|
2290
|
-
// },
|
|
2291
|
-
"heading-muted": {
|
|
2292
|
-
"--color-fg": "var(--color-tinted-default-fg-4)"
|
|
2293
|
-
},
|
|
2294
|
-
...responsiveRules("heading-0", {
|
|
2295
|
-
"--font-size": "var(--font-heading-0-size)",
|
|
2296
|
-
"--font-line-height": "var(--font-heading-0-line-height)",
|
|
2297
|
-
"--font-letter-spacing": "var(--font-heading-0-letter-spacing)",
|
|
2298
|
-
"--font-icon-size": "var(--font-heading-0-icon-size)",
|
|
2299
|
-
"--font-ascender-height": "var(--font-heading-0-ascender-height)",
|
|
2300
|
-
"--font-descender-height": "var(--font-heading-0-descender-height)"
|
|
2301
|
-
// '--font-cap-height': 'var(--font-heading-0-cap-height)',
|
|
2302
|
-
}),
|
|
2303
|
-
...responsiveRules("heading-1", {
|
|
2304
|
-
"--font-size": "var(--font-heading-1-size)",
|
|
2305
|
-
"--font-line-height": "var(--font-heading-1-line-height)",
|
|
2306
|
-
"--font-letter-spacing": "var(--font-heading-1-letter-spacing)",
|
|
2307
|
-
"--font-icon-size": "var(--font-heading-1-icon-size)",
|
|
2308
|
-
"--font-ascender-height": "var(--font-heading-1-ascender-height)",
|
|
2309
|
-
"--font-descender-height": "var(--font-heading-1-descender-height)"
|
|
2310
|
-
// '--font-cap-height': 'var(--font-heading-1-cap-height)',
|
|
2311
|
-
}),
|
|
2312
|
-
...responsiveRules("heading-2", {
|
|
2313
|
-
"--font-size": "var(--font-heading-2-size)",
|
|
2314
|
-
"--font-line-height": "var(--font-heading-2-line-height)",
|
|
2315
|
-
"--font-letter-spacing": "var(--font-heading-2-letter-spacing)",
|
|
2316
|
-
"--font-icon-size": "var(--font-heading-2-icon-size)",
|
|
2317
|
-
"--font-ascender-height": "var(--font-heading-2-ascender-height)",
|
|
2318
|
-
"--font-descender-height": "var(--font-heading-2-descender-height)"
|
|
2319
|
-
// '--font-cap-height': 'var(--font-heading-2-cap-height)',
|
|
2320
|
-
}),
|
|
2321
|
-
...responsiveRules("heading-3", {
|
|
2322
|
-
"--font-size": "var(--font-heading-3-size)",
|
|
2323
|
-
"--font-line-height": "var(--font-heading-3-line-height)",
|
|
2324
|
-
"--font-letter-spacing": "var(--font-heading-3-letter-spacing)",
|
|
2325
|
-
"--font-icon-size": "var(--font-heading-3-icon-size)",
|
|
2326
|
-
"--font-ascender-height": "var(--font-heading-3-ascender-height)",
|
|
2327
|
-
"--font-descender-height": "var(--font-heading-3-descender-height)"
|
|
2328
|
-
// '--font-cap-height': 'var(--font-heading-3-cap-height)',
|
|
2329
|
-
}),
|
|
2330
|
-
...responsiveRules("heading-4", {
|
|
2331
|
-
"--font-size": "var(--font-heading-4-size)",
|
|
2332
|
-
"--font-line-height": "var(--font-heading-4-line-height)",
|
|
2333
|
-
"--font-letter-spacing": "var(--font-heading-4-letter-spacing)",
|
|
2334
|
-
"--font-icon-size": "var(--font-heading-4-icon-size)",
|
|
2335
|
-
"--font-ascender-height": "var(--font-heading-4-ascender-height)",
|
|
2336
|
-
"--font-descender-height": "var(--font-heading-4-descender-height)"
|
|
2337
|
-
// '--font-cap-height': 'var(--font-heading-4-cap-height)',
|
|
2338
|
-
}),
|
|
2339
|
-
...responsiveRules("heading-5", {
|
|
2340
|
-
"--font-size": "var(--font-heading-5-size)",
|
|
2341
|
-
"--font-line-height": "var(--font-heading-5-line-height)",
|
|
2342
|
-
"--font-letter-spacing": "var(--font-heading-5-letter-spacing)",
|
|
2343
|
-
"--font-icon-size": "var(--font-heading-5-icon-size)",
|
|
2344
|
-
"--font-ascender-height": "var(--font-heading-5-ascender-height)",
|
|
2345
|
-
"--font-descender-height": "var(--font-heading-5-descender-height)"
|
|
2346
|
-
// '--font-cap-height': 'var(--font-heading-5-cap-height)',
|
|
2347
|
-
})
|
|
2348
|
-
}, kbdRules = {
|
|
2349
|
-
kbd: {
|
|
2350
|
-
// '--color-bg': 'var(--color-tinted-default-bg-1)',
|
|
2351
|
-
// '--color-border': 'var(--color-tinted-default-border-2)',
|
|
2352
|
-
// '--color-fg': 'var(--color-tinted-default-fg-3)',
|
|
2353
|
-
boxShadow: "inset 0 0 0 0.5px var(--color-border)",
|
|
2354
|
-
background: "var(--color-muted-bg)",
|
|
2355
|
-
font: "inherit",
|
|
2356
|
-
verticalAlign: "top",
|
|
2357
|
-
"@nest": {
|
|
2358
|
-
"&:not([hidden])": {
|
|
2359
|
-
display: "inline-block"
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}, labelRules = {
|
|
2364
|
-
label: {
|
|
2365
|
-
"--font-weight-regular": "var(--font-label-weight-regular)",
|
|
2366
|
-
"--font-weight-medium": "var(--font-label-weight-medium)",
|
|
2367
|
-
"--font-weight-semibold": "var(--font-label-weight-semibold)",
|
|
2368
|
-
"--font-weight-bold": "var(--font-label-weight-bold)",
|
|
2369
|
-
"--font-family": "var(--font-label-family)",
|
|
2370
|
-
"--font-feature-settings": "var(--font-label-feature-settings)",
|
|
2371
|
-
color: "var(--color-fg)",
|
|
2372
|
-
textTransform: "uppercase",
|
|
2373
|
-
"@nest": {
|
|
2374
|
-
"& a": {
|
|
2375
|
-
color: "var(--color-link-fg)",
|
|
2376
|
-
textDecoration: "none"
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
},
|
|
2380
|
-
"label-accent": {
|
|
2381
|
-
"--color-fg": "var(--color-accent-fg)"
|
|
2382
|
-
},
|
|
2383
|
-
"label-muted": {
|
|
2384
|
-
"--color-fg": "var(--color-muted-fg)"
|
|
2385
|
-
},
|
|
2386
|
-
...responsiveRules("label-0", {
|
|
2387
|
-
"--font-size": "var(--font-label-0-size)",
|
|
2388
|
-
"--font-line-height": "var(--font-label-0-line-height)",
|
|
2389
|
-
"--font-letter-spacing": "var(--font-label-0-letter-spacing)",
|
|
2390
|
-
"--font-icon-size": "var(--font-label-0-icon-size)",
|
|
2391
|
-
"--font-ascender-height": "var(--font-label-0-ascender-height)",
|
|
2392
|
-
"--font-descender-height": "var(--font-label-0-descender-height)"
|
|
2393
|
-
// '--font-cap-height': 'var(--font-label-0-cap-height)',
|
|
2394
|
-
}),
|
|
2395
|
-
...responsiveRules("label-1", {
|
|
2396
|
-
"--font-size": "var(--font-label-1-size)",
|
|
2397
|
-
"--font-line-height": "var(--font-label-1-line-height)",
|
|
2398
|
-
"--font-letter-spacing": "var(--font-label-1-letter-spacing)",
|
|
2399
|
-
"--font-icon-size": "var(--font-label-1-icon-size)",
|
|
2400
|
-
"--font-ascender-height": "var(--font-label-1-ascender-height)",
|
|
2401
|
-
"--font-descender-height": "var(--font-label-1-descender-height)"
|
|
2402
|
-
// '--font-cap-height': 'var(--font-label-1-cap-height)',
|
|
2403
|
-
}),
|
|
2404
|
-
...responsiveRules("label-2", {
|
|
2405
|
-
"--font-size": "var(--font-label-2-size)",
|
|
2406
|
-
"--font-line-height": "var(--font-label-2-line-height)",
|
|
2407
|
-
"--font-letter-spacing": "var(--font-label-2-letter-spacing)",
|
|
2408
|
-
"--font-icon-size": "var(--font-label-2-icon-size)",
|
|
2409
|
-
"--font-ascender-height": "var(--font-label-2-ascender-height)",
|
|
2410
|
-
"--font-descender-height": "var(--font-label-2-descender-height)"
|
|
2411
|
-
// '--font-cap-height': 'var(--font-label-2-cap-height)',
|
|
2412
|
-
}),
|
|
2413
|
-
...responsiveRules("label-3", {
|
|
2414
|
-
"--font-size": "var(--font-label-3-size)",
|
|
2415
|
-
"--font-line-height": "var(--font-label-3-line-height)",
|
|
2416
|
-
"--font-letter-spacing": "var(--font-label-3-letter-spacing)",
|
|
2417
|
-
"--font-icon-size": "var(--font-label-3-icon-size)",
|
|
2418
|
-
"--font-ascender-height": "var(--font-label-3-ascender-height)",
|
|
2419
|
-
"--font-descender-height": "var(--font-label-3-descender-height)"
|
|
2420
|
-
// '--font-cap-height': 'var(--font-label-3-cap-height)',
|
|
2421
|
-
}),
|
|
2422
|
-
...responsiveRules("label-4", {
|
|
2423
|
-
"--font-size": "var(--font-label-4-size)",
|
|
2424
|
-
"--font-line-height": "var(--font-label-4-line-height)",
|
|
2425
|
-
"--font-letter-spacing": "var(--font-label-4-letter-spacing)",
|
|
2426
|
-
"--font-icon-size": "var(--font-label-4-icon-size)",
|
|
2427
|
-
"--font-ascender-height": "var(--font-label-4-ascender-height)",
|
|
2428
|
-
"--font-descender-height": "var(--font-label-4-descender-height)"
|
|
2429
|
-
// '--font-cap-height': 'var(--font-label-4-cap-height)',
|
|
2430
|
-
}),
|
|
2431
|
-
...responsiveRules("label-5", {
|
|
2432
|
-
"--font-size": "var(--font-label-5-size)",
|
|
2433
|
-
"--font-line-height": "var(--font-label-5-line-height)",
|
|
2434
|
-
"--font-letter-spacing": "var(--font-label-5-letter-spacing)",
|
|
2435
|
-
"--font-icon-size": "var(--font-label-5-icon-size)",
|
|
2436
|
-
"--font-ascender-height": "var(--font-label-5-ascender-height)",
|
|
2437
|
-
"--font-descender-height": "var(--font-label-5-descender-height)"
|
|
2438
|
-
// '--font-cap-height': 'var(--font-label-5-cap-height)',
|
|
2439
|
-
})
|
|
2440
|
-
}, popoverRules = {
|
|
2441
|
-
//
|
|
2442
|
-
}, radioRules = {
|
|
2443
|
-
radio: {
|
|
2444
|
-
position: "relative",
|
|
2445
|
-
"@nest": {
|
|
2446
|
-
"&:not([hidden])": {
|
|
2447
|
-
display: "inline-block"
|
|
2448
|
-
},
|
|
2449
|
-
"& input": {
|
|
2450
|
-
appearance: "none",
|
|
2451
|
-
position: "absolute",
|
|
2452
|
-
top: "0",
|
|
2453
|
-
left: "0",
|
|
2454
|
-
opacity: "0",
|
|
2455
|
-
height: "100%",
|
|
2456
|
-
width: "100%",
|
|
2457
|
-
outline: "none",
|
|
2458
|
-
zIndex: "1",
|
|
2459
|
-
padding: "0",
|
|
2460
|
-
margin: "0",
|
|
2461
|
-
borderRadius: "9999px",
|
|
2462
|
-
border: "none"
|
|
2463
|
-
},
|
|
2464
|
-
/* enabled */
|
|
2465
|
-
"& > input + span": {
|
|
2466
|
-
display: "block",
|
|
2467
|
-
position: "relative",
|
|
2468
|
-
width: "var(--input-radio-size)",
|
|
2469
|
-
height: "var(--input-radio-size)",
|
|
2470
|
-
borderRadius: "9999px",
|
|
2471
|
-
backgroundColor: "var(--color-input-bg)",
|
|
2472
|
-
boxShadow: "inset 0 0 0 1px var(--color-input-border)",
|
|
2473
|
-
// border-radius: ${rem(input.radio.size / 2)};
|
|
2474
|
-
// background: ${color.input.default.enabled.bg};
|
|
2475
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2476
|
-
// color: color.input.default.enabled.border,
|
|
2477
|
-
// width: input.border.width,
|
|
2478
|
-
// })};
|
|
2479
|
-
"--color-input-fg": "var(--color-tinted-default-fg-0)",
|
|
2480
|
-
"--color-input-bg": "var(--color-tinted-default-bg-0)",
|
|
2481
|
-
"--color-input-border": "var(--color-tinted-default-border-1)"
|
|
2482
|
-
},
|
|
2483
|
-
"& > input + span::after": {
|
|
2484
|
-
content: '""',
|
|
2485
|
-
position: "absolute",
|
|
2486
|
-
top: "calc((var(--input-radio-size) - var(--input-radio-mark-size)) / 2)",
|
|
2487
|
-
left: "calc((var(--input-radio-size) - var(--input-radio-mark-size)) / 2)",
|
|
2488
|
-
width: "var(--input-radio-mark-size)",
|
|
2489
|
-
height: "var(--input-radio-mark-size)",
|
|
2490
|
-
backgroundColor: "var(--color-input-fg)",
|
|
2491
|
-
borderRadius: "9999px",
|
|
2492
|
-
opacity: 0
|
|
2493
|
-
},
|
|
2494
|
-
/* hovered */
|
|
2495
|
-
"& > input:not(:disabled):hover + span": {
|
|
2496
|
-
"--color-input-bg": "var(--color-tinted-default-bg-1)",
|
|
2497
|
-
"--color-input-border": "var(--color-tinted-default-border-2)"
|
|
2498
|
-
},
|
|
2499
|
-
/* focused */
|
|
2500
|
-
"& > input:not(:disabled):focus + span": {
|
|
2501
|
-
"--color-input-border": "var(--color-tinted-default-border-2)"
|
|
2502
|
-
// box-shadow: ${focusRingStyle({
|
|
2503
|
-
// border: {width: input.border.width, color: color.input.default.enabled.border},
|
|
2504
|
-
// focusRing: input.radio.focusRing,
|
|
2505
|
-
// })};
|
|
2506
|
-
},
|
|
2507
|
-
"& > input:not(:disabled):focus:not(:focus-visible) + span": {
|
|
2508
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2509
|
-
// color: color.input.default.enabled.border,
|
|
2510
|
-
// width: input.border.width,
|
|
2511
|
-
// })};
|
|
2512
|
-
},
|
|
2513
|
-
"& > input:checked + span::after": {
|
|
2514
|
-
opacity: 1
|
|
2515
|
-
}
|
|
2516
|
-
// /* customValidity */
|
|
2517
|
-
// &[data-error] + span {
|
|
2518
|
-
// background-color: ${color.input.invalid.enabled.border};
|
|
2519
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
2520
|
-
// width: input.border.width,
|
|
2521
|
-
// color: color.input.invalid.enabled.muted.bg,
|
|
2522
|
-
// })};
|
|
2523
|
-
// &::after {
|
|
2524
|
-
// background: ${color.input.invalid.enabled.muted.bg};
|
|
2525
|
-
// }
|
|
2526
|
-
// }
|
|
2527
|
-
// /* read only */
|
|
2528
|
-
// &[data-read-only] + span {
|
|
2529
|
-
// box-shadow: 0 0 0 1px ${color.input.default.readOnly.border};
|
|
2530
|
-
// background: ${color.input.default.readOnly.bg};
|
|
2531
|
-
// &::after {
|
|
2532
|
-
// background: ${color.input.default.readOnly.border};
|
|
2533
|
-
// }
|
|
2534
|
-
// }
|
|
2535
|
-
// /* disabled */
|
|
2536
|
-
// &:not([data-read-only]):disabled + span {
|
|
2537
|
-
// box-shadow: 0 0 0 1px ${color.input.default.disabled.border};
|
|
2538
|
-
// background: ${color.input.default.disabled.bg};
|
|
2539
|
-
// &::after {
|
|
2540
|
-
// background: ${color.input.default.disabled.border};
|
|
2541
|
-
// }
|
|
2542
|
-
// }
|
|
2543
|
-
// `
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
}, selectRules = {
|
|
2547
|
-
select: {
|
|
2548
|
-
"@nest": {
|
|
2549
|
-
"& > select:disabled": {
|
|
2550
|
-
opacity: 1
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
},
|
|
2554
|
-
"select-presentation": {
|
|
2555
|
-
"@nest": {
|
|
2556
|
-
"& > span": {
|
|
2557
|
-
// place icon to the right
|
|
2558
|
-
position: "absolute",
|
|
2559
|
-
top: 0,
|
|
2560
|
-
right: 0
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
}
|
|
2564
|
-
}, spinnerRules = {
|
|
2565
|
-
spinner: {},
|
|
2566
|
-
"animated-spinner-icon": {
|
|
2567
|
-
animation: "spinner-rotate 500ms linear infinite",
|
|
2568
|
-
"@keyframes": {
|
|
2569
|
-
"spinner-rotate": {
|
|
2570
|
-
from: {
|
|
2571
|
-
transform: "rotate(0deg)"
|
|
2572
|
-
},
|
|
2573
|
-
to: {
|
|
2574
|
-
transform: "rotate(360deg)"
|
|
2575
|
-
}
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
}, switchRules = {
|
|
2580
|
-
switch: {},
|
|
2581
|
-
"switch-element": {
|
|
2582
|
-
position: "absolute",
|
|
2583
|
-
top: 0,
|
|
2584
|
-
right: 0,
|
|
2585
|
-
bottom: 0,
|
|
2586
|
-
left: 0,
|
|
2587
|
-
opacity: 0,
|
|
2588
|
-
height: "100%",
|
|
2589
|
-
width: "100%",
|
|
2590
|
-
outline: "none",
|
|
2591
|
-
padding: 0,
|
|
2592
|
-
margin: 0,
|
|
2593
|
-
/* Place the input element above the representation element */
|
|
2594
|
-
zIndex: 1
|
|
2595
|
-
},
|
|
2596
|
-
"switch-presentation": {
|
|
2597
|
-
"--switch-bg-color": "var(--color-tinted-default-border-2)",
|
|
2598
|
-
// '--switch-border-color': 'var(--color-tinted-default-border-1)',
|
|
2599
|
-
"--switch-fg-color": "var(--color-tinted-default-bg-0)",
|
|
2600
|
-
// --switch-bg-color: ${color.input.default.enabled.border};
|
|
2601
|
-
// --switch-fg-color: ${color.input.default.enabled.bg};
|
|
2602
|
-
"--switch-thumb-offset": "0",
|
|
2603
|
-
"--switch-thumb-size": "calc(var(--input-switch-height) - var(--input-switch-padding) * 2)",
|
|
2604
|
-
display: "block",
|
|
2605
|
-
// &:not([hidden]) {
|
|
2606
|
-
// display: block;
|
|
2607
|
-
// }
|
|
2608
|
-
position: "relative",
|
|
2609
|
-
width: "var(--input-switch-width)",
|
|
2610
|
-
height: "var(--input-switch-height)",
|
|
2611
|
-
borderRadius: "calc(var(--input-switch-height) / 2)",
|
|
2612
|
-
outlineOffset: "var(--input-switch-focus-ring-offset)",
|
|
2613
|
-
// Make sure it’s not possible to interact with the presentation element
|
|
2614
|
-
pointerEvents: "none",
|
|
2615
|
-
"@nest": {
|
|
2616
|
-
// '&::after': {
|
|
2617
|
-
// content: '""',
|
|
2618
|
-
// display: 'block',
|
|
2619
|
-
// position: 'absolute',
|
|
2620
|
-
// top: 0,
|
|
2621
|
-
// left: 0,
|
|
2622
|
-
// right: 0,
|
|
2623
|
-
// bottom: 0,
|
|
2624
|
-
// zIndex: 1,
|
|
2625
|
-
// // boxShadow: 'var(--switch-box-shadow)',
|
|
2626
|
-
// borderRadius: 'inherit',
|
|
2627
|
-
// },
|
|
2628
|
-
".switch-element:focus + &": {
|
|
2629
|
-
// --switch-box-shadow: ${focusRingStyle({focusRing: input.switch.focusRing})};
|
|
2630
|
-
outline: "var(--input-switch-focus-ring-width) solid var(--color-focus-ring)"
|
|
2631
|
-
},
|
|
2632
|
-
"input:focus:not(:focus-visible) + &": {
|
|
2633
|
-
outline: "none"
|
|
2634
|
-
},
|
|
2635
|
-
"input:checked + &": {
|
|
2636
|
-
"--switch-bg-color": "var(--color-solid-default-bg-0)",
|
|
2637
|
-
// '--switch-border-color': 'var(--color-solid-default-bg-0)',
|
|
2638
|
-
"--switch-fg-color": "var(--color-solid-default-fg-0)"
|
|
2639
|
-
},
|
|
2640
|
-
// input:not([data-read-only]):disabled + && {
|
|
2641
|
-
// --switch-bg-color: ${color.input.default.disabled.border};
|
|
2642
|
-
// --switch-fg-color: ${color.input.default.disabled.bg};
|
|
2643
|
-
// }
|
|
2644
|
-
// input[data-read-only]:disabled + && {
|
|
2645
|
-
// --switch-bg-color: ${color.input.default.readOnly.border};
|
|
2646
|
-
// --switch-fg-color: ${color.input.default.readOnly.bg};
|
|
2647
|
-
// }
|
|
2648
|
-
// input:checked[data-read-only]:disabled + && {
|
|
2649
|
-
// --switch-bg-color: ${color.input.default.readOnly.fg};
|
|
2650
|
-
// --switch-fg-color: ${color.input.default.readOnly.bg};
|
|
2651
|
-
// }
|
|
2652
|
-
".switch-element:checked + &": {
|
|
2653
|
-
"--switch-thumb-offset": "calc(var(--input-switch-width) - (var(--input-switch-padding) * 2) - var(--switch-thumb-size))"
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
// @media (hover: hover) {
|
|
2657
|
-
// input:not(:disabled):hover + && {
|
|
2658
|
-
// --switch-bg-color: ${color.input.default.hovered.border};
|
|
2659
|
-
// --switch-fg-color: ${color.input.default.hovered.bg};
|
|
2660
|
-
// }
|
|
2661
|
-
// input:not(:disabled):checked:hover + && {
|
|
2662
|
-
// --switch-bg-color: ${color.input.default.enabled.fg};
|
|
2663
|
-
// --switch-fg-color: ${color.input.default.enabled.bg};
|
|
2664
|
-
// }
|
|
2665
|
-
// }
|
|
2666
|
-
},
|
|
2667
|
-
"switch-track": {
|
|
2668
|
-
display: "block",
|
|
2669
|
-
backgroundColor: "var(--switch-bg-color)",
|
|
2670
|
-
position: "absolute",
|
|
2671
|
-
left: 0,
|
|
2672
|
-
top: 0,
|
|
2673
|
-
right: 0,
|
|
2674
|
-
bottom: 0,
|
|
2675
|
-
borderRadius: "inherit",
|
|
2676
|
-
// boxShadow: 'inset 0 0 0 1px var(--switch-border-color)',
|
|
2677
|
-
transition: "box-shadow, background-color var(--input-switch-transition-duration-ms) var(--input-switch-transition-timing-function)"
|
|
2678
|
-
},
|
|
2679
|
-
"switch-thumb": {
|
|
2680
|
-
// '--switch-thumb-offset': '0',
|
|
2681
|
-
display: "block",
|
|
2682
|
-
position: "absolute",
|
|
2683
|
-
left: "var(--input-switch-padding)",
|
|
2684
|
-
top: "var(--input-switch-padding)",
|
|
2685
|
-
width: "var(--switch-thumb-size)",
|
|
2686
|
-
height: "var(--switch-thumb-size)",
|
|
2687
|
-
backgroundColor: "var(--switch-fg-color)",
|
|
2688
|
-
borderRadius: "9999px",
|
|
2689
|
-
boxShadow: "0 0 0 0.5px var(--color-shadow-umbra), 0 0.5px 2px 0.5px var(--color-shadow-umbra)",
|
|
2690
|
-
transform: "translate3d(var(--switch-thumb-offset), 0, 0)",
|
|
2691
|
-
transition: "transform var(--input-switch-transition-duration-ms) var(--input-switch-transition-timing-function)"
|
|
2692
|
-
// transition-property: transform;
|
|
2693
|
-
// transition-duration: ${input.switch.transitionDurationMs}ms;
|
|
2694
|
-
// transition-timing-function: ${input.switch.transitionTimingFunction};
|
|
2695
|
-
// const {$indeterminate} = props
|
|
2696
|
-
// const {input} = getTheme_v2(props.theme)
|
|
2697
|
-
// const trackWidth = input.switch.width
|
|
2698
|
-
// const trackHeight = input.switch.height
|
|
2699
|
-
// const trackPadding = input.switch.padding
|
|
2700
|
-
// const size = trackHeight - input.switch.padding * 2
|
|
2701
|
-
// const checkedOffset = trackWidth - trackPadding * 2 - size
|
|
2702
|
-
// const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding
|
|
2703
|
-
// const checked = $indeterminate !== true && props.$checked === true
|
|
2704
|
-
// return css`
|
|
2705
|
-
// position: absolute;
|
|
2706
|
-
// left: ${rem(trackPadding)};
|
|
2707
|
-
// top: ${rem(trackPadding)};
|
|
2708
|
-
// height: ${rem(size)};
|
|
2709
|
-
// width: ${rem(size)};
|
|
2710
|
-
// border-radius: ${rem(size / 2)};
|
|
2711
|
-
// transition-property: transform;
|
|
2712
|
-
// transition-duration: ${input.switch.transitionDurationMs}ms;
|
|
2713
|
-
// transition-timing-function: ${input.switch.transitionTimingFunction};
|
|
2714
|
-
// background: var(--switch-fg-color);
|
|
2715
|
-
// transform: translate3d(0, 0, 0);
|
|
2716
|
-
// box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
|
|
2717
|
-
// ${checked &&
|
|
2718
|
-
// css`
|
|
2719
|
-
// transform: translate3d(${checkedOffset}px, 0, 0);
|
|
2720
|
-
// `}
|
|
2721
|
-
// ${$indeterminate &&
|
|
2722
|
-
// css`
|
|
2723
|
-
// transform: translate3d(${indeterminateOffset}px, 0, 0);
|
|
2724
|
-
// `}
|
|
2725
|
-
// `
|
|
2726
|
-
}
|
|
2727
|
-
}, textRules = {
|
|
2728
|
-
text: {
|
|
2729
|
-
"--font-weight-regular": "var(--font-text-weight-regular)",
|
|
2730
|
-
"--font-weight-medium": "var(--font-text-weight-medium)",
|
|
2731
|
-
"--font-weight-semibold": "var(--font-text-weight-semibold)",
|
|
2732
|
-
"--font-weight-bold": "var(--font-text-weight-bold)",
|
|
2733
|
-
"--font-family": "var(--font-text-family)",
|
|
2734
|
-
"--font-feature-settings": "var(--font-text-feature-settings)",
|
|
2735
|
-
color: "var(--color-fg)",
|
|
2736
|
-
"@nest": {
|
|
2737
|
-
"& a": {
|
|
2738
|
-
color: "var(--color-link-fg)",
|
|
2739
|
-
textDecoration: "none"
|
|
2740
|
-
},
|
|
2741
|
-
"& a:hover": {
|
|
2742
|
-
color: "var(--color-fg)"
|
|
2743
|
-
}
|
|
2744
|
-
// '& svg': {
|
|
2745
|
-
// color: 'var(--color-icon)',
|
|
2746
|
-
// },
|
|
2747
|
-
}
|
|
2748
|
-
},
|
|
2749
|
-
// 'text-accent': {
|
|
2750
|
-
// '--color-fg': 'var(--color-accent-fg)',
|
|
2751
|
-
// },
|
|
2752
|
-
"text-muted": {
|
|
2753
|
-
color: "var(--color-muted-fg)"
|
|
2754
|
-
// '--color-fg': 'var(--color-tinted-default-fg-4)',
|
|
2755
|
-
},
|
|
2756
|
-
...responsiveRules("text-0", {
|
|
2757
|
-
"--font-size": "var(--font-text-0-size)",
|
|
2758
|
-
"--font-line-height": "var(--font-text-0-line-height)",
|
|
2759
|
-
"--font-letter-spacing": "var(--font-text-0-letter-spacing)",
|
|
2760
|
-
"--font-icon-size": "var(--font-text-0-icon-size)",
|
|
2761
|
-
"--font-ascender-height": "var(--font-text-0-ascender-height)",
|
|
2762
|
-
"--font-descender-height": "var(--font-text-0-descender-height)"
|
|
2763
|
-
// '--font-cap-height': 'var(--font-text-0-cap-height)',
|
|
2764
|
-
}),
|
|
2765
|
-
...responsiveRules("text-1", {
|
|
2766
|
-
"--font-size": "var(--font-text-1-size)",
|
|
2767
|
-
"--font-line-height": "var(--font-text-1-line-height)",
|
|
2768
|
-
"--font-letter-spacing": "var(--font-text-1-letter-spacing)",
|
|
2769
|
-
"--font-icon-size": "var(--font-text-1-icon-size)",
|
|
2770
|
-
"--font-ascender-height": "var(--font-text-1-ascender-height)",
|
|
2771
|
-
"--font-descender-height": "var(--font-text-1-descender-height)"
|
|
2772
|
-
// '--font-cap-height': 'var(--font-text-1-cap-height)',
|
|
2773
|
-
}),
|
|
2774
|
-
...responsiveRules("text-2", {
|
|
2775
|
-
"--font-size": "var(--font-text-2-size)",
|
|
2776
|
-
"--font-line-height": "var(--font-text-2-line-height)",
|
|
2777
|
-
"--font-letter-spacing": "var(--font-text-2-letter-spacing)",
|
|
2778
|
-
"--font-icon-size": "var(--font-text-2-icon-size)",
|
|
2779
|
-
"--font-ascender-height": "var(--font-text-2-ascender-height)",
|
|
2780
|
-
"--font-descender-height": "var(--font-text-2-descender-height)"
|
|
2781
|
-
// '--font-cap-height': 'var(--font-text-2-cap-height)',
|
|
2782
|
-
}),
|
|
2783
|
-
...responsiveRules("text-3", {
|
|
2784
|
-
"--font-size": "var(--font-text-3-size)",
|
|
2785
|
-
"--font-line-height": "var(--font-text-3-line-height)",
|
|
2786
|
-
"--font-letter-spacing": "var(--font-text-3-letter-spacing)",
|
|
2787
|
-
"--font-icon-size": "var(--font-text-3-icon-size)",
|
|
2788
|
-
"--font-ascender-height": "var(--font-text-3-ascender-height)",
|
|
2789
|
-
"--font-descender-height": "var(--font-text-3-descender-height)"
|
|
2790
|
-
// '--font-cap-height': 'var(--font-text-3-cap-height)',
|
|
2791
|
-
}),
|
|
2792
|
-
...responsiveRules("text-4", {
|
|
2793
|
-
"--font-size": "var(--font-text-4-size)",
|
|
2794
|
-
"--font-line-height": "var(--font-text-4-line-height)",
|
|
2795
|
-
"--font-letter-spacing": "var(--font-text-4-letter-spacing)",
|
|
2796
|
-
"--font-icon-size": "var(--font-text-4-icon-size)",
|
|
2797
|
-
"--font-ascender-height": "var(--font-text-4-ascender-height)",
|
|
2798
|
-
"--font-descender-height": "var(--font-text-4-descender-height)"
|
|
2799
|
-
// '--font-cap-height': 'var(--font-text-4-cap-height)',
|
|
2800
|
-
})
|
|
2801
|
-
}, textAreaRules = {
|
|
2802
|
-
"text-area": {
|
|
2803
|
-
//
|
|
2804
|
-
}
|
|
2805
|
-
}, textInputRules = {
|
|
2806
|
-
"text-input": {
|
|
2807
|
-
"--font-family": vars.font.text.family,
|
|
2808
|
-
"@nest": {
|
|
2809
|
-
"& > span": {
|
|
2810
|
-
borderRadius: "inherit"
|
|
2811
|
-
}
|
|
2812
|
-
}
|
|
2813
|
-
},
|
|
2814
|
-
"text-input-prefix": {
|
|
2815
|
-
borderTop: "1px solid var(--color-border)",
|
|
2816
|
-
borderLeft: "1px solid var(--color-border)",
|
|
2817
|
-
borderBottom: "1px solid var(--color-border)",
|
|
2818
|
-
borderTopRightRadius: "0 !important",
|
|
2819
|
-
borderBottomRightRadius: "0 !important",
|
|
2820
|
-
"@nest": {
|
|
2821
|
-
"& > span": {
|
|
2822
|
-
display: "block",
|
|
2823
|
-
margin: "-1px"
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
},
|
|
2827
|
-
"text-input-suffix": {
|
|
2828
|
-
borderTop: "1px solid var(--color-border)",
|
|
2829
|
-
borderRight: "1px solid var(--color-border)",
|
|
2830
|
-
borderBottom: "1px solid var(--color-border)",
|
|
2831
|
-
borderTopLeftRadius: "0 !important",
|
|
2832
|
-
borderBottomLeftRadius: "0 !important",
|
|
2833
|
-
"@nest": {
|
|
2834
|
-
"& > span": {
|
|
2835
|
-
display: "block",
|
|
2836
|
-
margin: "-1px"
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
|
-
},
|
|
2840
|
-
"text-input-presentation": {
|
|
2841
|
-
// position: 'absolute',
|
|
2842
|
-
// top: 0,
|
|
2843
|
-
// left: 0,
|
|
2844
|
-
// right: 0,
|
|
2845
|
-
// bottom: 0,
|
|
2846
|
-
// display: 'block',
|
|
2847
|
-
// pointerEvents: 'none',
|
|
2848
|
-
// zIndex: 0,
|
|
2849
|
-
// backgroundColor: 'var(--input-bg-color)',
|
|
2850
|
-
// 'boxShadow': 'var(--input-box-shadow)',
|
|
2851
|
-
// '--input-border-color': 'var(--color-input-default-enabled-border)',
|
|
2852
|
-
// '--input-border-color': 'var(--color-tinted-default-border-1)',
|
|
2853
|
-
// '--input-box-shadow': 'inset 0 0 0 1px var(--input-border-color)',
|
|
2854
|
-
// border-top-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
2855
|
-
// border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
2856
|
-
// border-top-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
2857
|
-
// border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
2858
|
-
// '@nest': {
|
|
2859
|
-
// 'input:hover + &': {
|
|
2860
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
2861
|
-
// },
|
|
2862
|
-
// 'input:focus + &': {
|
|
2863
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
2864
|
-
// },
|
|
2865
|
-
// },
|
|
2866
|
-
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
2867
|
-
// --card-bg-color: ${color.input.default.enabled.bg};
|
|
2868
|
-
// --card-fg-color: ${color.input.default.enabled.fg};
|
|
2869
|
-
// /* enabled */
|
|
2870
|
-
// *:not(:disabled) + &[data-border] {
|
|
2871
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2872
|
-
// color: color.input.default.enabled.border,
|
|
2873
|
-
// width: input.border.width,
|
|
2874
|
-
// })};
|
|
2875
|
-
// }
|
|
2876
|
-
// /* invalid */
|
|
2877
|
-
// *:not(:disabled):invalid + & {
|
|
2878
|
-
// --card-bg-color: ${color.input.invalid.enabled.bg};
|
|
2879
|
-
// --card-fg-color: ${color.input.invalid.enabled.fg};
|
|
2880
|
-
// &[data-border] {
|
|
2881
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2882
|
-
// color: color.input.invalid.enabled.border,
|
|
2883
|
-
// width: input.border.width,
|
|
2884
|
-
// })};
|
|
2885
|
-
// }
|
|
2886
|
-
// }
|
|
2887
|
-
// /* focused */
|
|
2888
|
-
// *:not(:disabled):focus + & {
|
|
2889
|
-
// &[data-border] {
|
|
2890
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
2891
|
-
// ? undefined
|
|
2892
|
-
// : focusRingStyle({
|
|
2893
|
-
// border: {color: color.input.default.enabled.border, width: input.border.width},
|
|
2894
|
-
// focusRing: input.text.focusRing,
|
|
2895
|
-
// })};
|
|
2896
|
-
// }
|
|
2897
|
-
// &:not([data-border]) {
|
|
2898
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
2899
|
-
// ? undefined
|
|
2900
|
-
// : focusRingStyle({focusRing: input.text.focusRing})};
|
|
2901
|
-
// }
|
|
2902
|
-
// }
|
|
2903
|
-
// /* disabled */
|
|
2904
|
-
// *:not(:invalid):disabled + & {
|
|
2905
|
-
// --card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
2906
|
-
// --card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
2907
|
-
// --card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
2908
|
-
// &[data-border] {
|
|
2909
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2910
|
-
// color: color.input.default.disabled.border,
|
|
2911
|
-
// width: input.border.width,
|
|
2912
|
-
// })};
|
|
2913
|
-
// }
|
|
2914
|
-
// }
|
|
2915
|
-
// *:invalid:disabled + & {
|
|
2916
|
-
// --card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
2917
|
-
// --card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
2918
|
-
// --card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
2919
|
-
// &[data-border] {
|
|
2920
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2921
|
-
// color: color.input.invalid.disabled.border,
|
|
2922
|
-
// width: input.border.width,
|
|
2923
|
-
// })};
|
|
2924
|
-
// }
|
|
2925
|
-
// }
|
|
2926
|
-
// /* readOnly */
|
|
2927
|
-
// *:not(:invalid):read-only + & {
|
|
2928
|
-
// --card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
2929
|
-
// --card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
2930
|
-
// }
|
|
2931
|
-
// *:invalid:read-only + & {
|
|
2932
|
-
// --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
2933
|
-
// --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
2934
|
-
// }
|
|
2935
|
-
// /* hovered */
|
|
2936
|
-
// @media (hover: hover) {
|
|
2937
|
-
// *:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
2938
|
-
// --card-bg-color: ${color.input.default.hovered.bg};
|
|
2939
|
-
// --card-fg-color: ${color.input.default.hovered.fg};
|
|
2940
|
-
// }
|
|
2941
|
-
// *:invalid:not(:disabled):not(:read-only):hover + & {
|
|
2942
|
-
// --card-bg-color: ${color.input.invalid.hovered.bg};
|
|
2943
|
-
// --card-fg-color: ${color.input.invalid.hovered.fg};
|
|
2944
|
-
// }
|
|
2945
|
-
// *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
2946
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2947
|
-
// color: color.input.default.hovered.border,
|
|
2948
|
-
// width: input.border.width,
|
|
2949
|
-
// })};
|
|
2950
|
-
// }
|
|
2951
|
-
// *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
2952
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
2953
|
-
// color: color.input.invalid.hovered.border,
|
|
2954
|
-
// width: input.border.width,
|
|
2955
|
-
// })};
|
|
2956
|
-
// }
|
|
2957
|
-
// }
|
|
2958
|
-
// }
|
|
2959
|
-
}
|
|
2960
|
-
}, tokenRules = {
|
|
2961
|
-
token: {
|
|
2962
|
-
"@nest": {
|
|
2963
|
-
"&.atrule": {
|
|
2964
|
-
color: "var(--color-token-atrule)"
|
|
2965
|
-
},
|
|
2966
|
-
"&.attr-name": {
|
|
2967
|
-
color: "var(--color-token-attr-name)"
|
|
2968
|
-
},
|
|
2969
|
-
"&.attr-value": {
|
|
2970
|
-
color: "var(--color-token-attr-value)"
|
|
2971
|
-
},
|
|
2972
|
-
"&.attribute": {
|
|
2973
|
-
color: "var(--color-token-attribute)"
|
|
2974
|
-
},
|
|
2975
|
-
"&.boolean": {
|
|
2976
|
-
color: "var(--color-token-boolean)"
|
|
2977
|
-
},
|
|
2978
|
-
"&.builtin": {
|
|
2979
|
-
color: "var(--color-token-builtin)"
|
|
2980
|
-
},
|
|
2981
|
-
"&.cdata": {
|
|
2982
|
-
color: "var(--color-token-cdata)"
|
|
2983
|
-
},
|
|
2984
|
-
"&.char": {
|
|
2985
|
-
color: "var(--color-token-char)"
|
|
2986
|
-
},
|
|
2987
|
-
"&.class": {
|
|
2988
|
-
color: "var(--color-token-class)"
|
|
2989
|
-
},
|
|
2990
|
-
"&.class-name": {
|
|
2991
|
-
color: "var(--color-token-class-name)"
|
|
2992
|
-
},
|
|
2993
|
-
"&.comment": {
|
|
2994
|
-
color: "var(--color-token-comment)"
|
|
2995
|
-
},
|
|
2996
|
-
"&.constant": {
|
|
2997
|
-
color: "var(--color-token-constant)"
|
|
2998
|
-
},
|
|
2999
|
-
"&.deleted": {
|
|
3000
|
-
color: "var(--color-token-deleted)"
|
|
3001
|
-
},
|
|
3002
|
-
"&.doctype": {
|
|
3003
|
-
color: "var(--color-token-doctype)"
|
|
3004
|
-
},
|
|
3005
|
-
"&.entity": {
|
|
3006
|
-
color: "var(--color-token-entity)"
|
|
3007
|
-
},
|
|
3008
|
-
"&.function": {
|
|
3009
|
-
color: "var(--color-token-function)"
|
|
3010
|
-
},
|
|
3011
|
-
"&.hexcode": {
|
|
3012
|
-
color: "var(--color-token-hexcode)"
|
|
3013
|
-
},
|
|
3014
|
-
"&.id": {
|
|
3015
|
-
color: "var(--color-token-id)"
|
|
3016
|
-
},
|
|
3017
|
-
"&.important": {
|
|
3018
|
-
color: "var(--color-token-important)"
|
|
3019
|
-
},
|
|
3020
|
-
"&.inserted": {
|
|
3021
|
-
color: "var(--color-token-inserted)"
|
|
3022
|
-
},
|
|
3023
|
-
"&.keyword": {
|
|
3024
|
-
color: "var(--color-token-keyword)"
|
|
3025
|
-
},
|
|
3026
|
-
"&.number": {
|
|
3027
|
-
color: "var(--color-token-number)"
|
|
3028
|
-
},
|
|
3029
|
-
"&.operator": {
|
|
3030
|
-
color: "var(--color-token-operator)"
|
|
3031
|
-
},
|
|
3032
|
-
"&.prolog": {
|
|
3033
|
-
color: "var(--color-token-prolog)"
|
|
3034
|
-
},
|
|
3035
|
-
"&.property": {
|
|
3036
|
-
color: "var(--color-token-property)"
|
|
3037
|
-
},
|
|
3038
|
-
"&.pseudo-class": {
|
|
3039
|
-
color: "var(--color-token-pseudo-class)"
|
|
3040
|
-
},
|
|
3041
|
-
"&.pseudo-element": {
|
|
3042
|
-
color: "var(--color-token-pseudo-element)"
|
|
3043
|
-
},
|
|
3044
|
-
"&.punctuation": {
|
|
3045
|
-
color: "var(--color-token-punctuation)"
|
|
3046
|
-
},
|
|
3047
|
-
"&.attr-value &:not(.attr-equals).punctuation": {
|
|
3048
|
-
color: "inherit"
|
|
3049
|
-
},
|
|
3050
|
-
"&.regex": {
|
|
3051
|
-
color: "var(--color-token-regex)"
|
|
3052
|
-
},
|
|
3053
|
-
"&.selector": {
|
|
3054
|
-
color: "var(--color-token-selector)"
|
|
3055
|
-
},
|
|
3056
|
-
"&.string": {
|
|
3057
|
-
color: "var(--color-token-string)"
|
|
3058
|
-
},
|
|
3059
|
-
"&.symbol": {
|
|
3060
|
-
color: "var(--color-token-symbol)"
|
|
3061
|
-
},
|
|
3062
|
-
"&.tag": {
|
|
3063
|
-
color: "var(--color-token-tag)"
|
|
3064
|
-
},
|
|
3065
|
-
"&.unit": {
|
|
3066
|
-
color: "var(--color-token-unit)"
|
|
3067
|
-
},
|
|
3068
|
-
"&.url": {
|
|
3069
|
-
color: "var(--color-token-url)"
|
|
3070
|
-
},
|
|
3071
|
-
"&.variable": {
|
|
3072
|
-
color: "var(--color-token-variable)"
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
}, tooltipRules = {
|
|
3077
|
-
tooltip: {
|
|
3078
|
-
pointerEvents: "none"
|
|
3079
|
-
},
|
|
3080
|
-
"tooltip-card": {
|
|
3081
|
-
willChange: "transform",
|
|
3082
|
-
"@nest": {
|
|
3083
|
-
"&[data-animate] > *": {
|
|
3084
|
-
// opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
3085
|
-
opacity: "var(--motion-content-opacity, 1)",
|
|
3086
|
-
willChange: "opacity"
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
}
|
|
3090
|
-
}, borderRules = {
|
|
3091
|
-
...responsiveRules("border", {
|
|
3092
|
-
border: "1px solid var(--card-border-color)"
|
|
3093
|
-
}),
|
|
3094
|
-
...responsiveRules("border-t", {
|
|
3095
|
-
borderTop: "1px solid var(--card-border-color)"
|
|
3096
|
-
}),
|
|
3097
|
-
...responsiveRules("border-r", {
|
|
3098
|
-
borderRight: "1px solid var(--card-border-color)"
|
|
3099
|
-
}),
|
|
3100
|
-
...responsiveRules("border-b", {
|
|
3101
|
-
borderBottom: "1px solid var(--card-border-color)"
|
|
3102
|
-
}),
|
|
3103
|
-
...responsiveRules("border-l", {
|
|
3104
|
-
borderLeft: "1px solid var(--card-border-color)"
|
|
3105
|
-
})
|
|
3106
|
-
}, displayRules = {
|
|
3107
|
-
...responsiveRules("block", {
|
|
3108
|
-
"@nest": {
|
|
3109
|
-
"&:not([hidden])": {
|
|
3110
|
-
display: "block"
|
|
3111
|
-
}
|
|
3112
|
-
}
|
|
3113
|
-
}),
|
|
3114
|
-
...responsiveRules("inline-block", {
|
|
3115
|
-
"@nest": {
|
|
3116
|
-
"&:not([hidden])": {
|
|
3117
|
-
display: "inline-block"
|
|
3118
|
-
}
|
|
3119
|
-
}
|
|
3120
|
-
}),
|
|
3121
|
-
...responsiveRules("flex", {
|
|
3122
|
-
"@nest": {
|
|
3123
|
-
"&:not([hidden])": {
|
|
3124
|
-
display: "flex"
|
|
3125
|
-
}
|
|
3126
|
-
}
|
|
3127
|
-
}),
|
|
3128
|
-
...responsiveRules("inline-flex", {
|
|
3129
|
-
"@nest": {
|
|
3130
|
-
"&:not([hidden])": {
|
|
3131
|
-
display: "inline-flex"
|
|
3132
|
-
}
|
|
3133
|
-
}
|
|
3134
|
-
}),
|
|
3135
|
-
...responsiveRules("grid", {
|
|
3136
|
-
gridTemplateRows: "auto",
|
|
3137
|
-
"@nest": {
|
|
3138
|
-
"&:not([hidden])": {
|
|
3139
|
-
display: "grid"
|
|
3140
|
-
}
|
|
3141
|
-
}
|
|
3142
|
-
}),
|
|
3143
|
-
...responsiveRules("inline-grid", {
|
|
3144
|
-
gridTemplateRows: "auto",
|
|
3145
|
-
"@nest": {
|
|
3146
|
-
"&:not([hidden])": {
|
|
3147
|
-
display: "inline-grid"
|
|
3148
|
-
}
|
|
3149
|
-
}
|
|
3150
|
-
}),
|
|
3151
|
-
...responsiveRules("none", {
|
|
3152
|
-
"@nest": {
|
|
3153
|
-
"&:not([hidden])": {
|
|
3154
|
-
display: "none"
|
|
3155
|
-
}
|
|
3156
|
-
}
|
|
3157
|
-
})
|
|
3158
|
-
}, flexRules = {
|
|
3159
|
-
// direction
|
|
3160
|
-
...responsiveRules("row", {
|
|
3161
|
-
flexDirection: "row"
|
|
3162
|
-
}),
|
|
3163
|
-
...responsiveRules("column", {
|
|
3164
|
-
flexDirection: "column"
|
|
3165
|
-
}),
|
|
3166
|
-
// align
|
|
3167
|
-
...responsiveRules("align-flex-start", {
|
|
3168
|
-
alignItems: "flex-start"
|
|
3169
|
-
}),
|
|
3170
|
-
...responsiveRules("align-flex-end", {
|
|
3171
|
-
alignItems: "end"
|
|
3172
|
-
}),
|
|
3173
|
-
...responsiveRules("align-center", {
|
|
3174
|
-
alignItems: "center"
|
|
3175
|
-
}),
|
|
3176
|
-
...responsiveRules("align-stretch", {
|
|
3177
|
-
alignItems: "stretch"
|
|
3178
|
-
}),
|
|
3179
|
-
...responsiveRules("align-baseline", {
|
|
3180
|
-
alignItems: "baseline"
|
|
3181
|
-
}),
|
|
3182
|
-
// justify
|
|
3183
|
-
...responsiveRules("justify-flex-start", {
|
|
3184
|
-
justifyContent: "flex-start"
|
|
3185
|
-
}),
|
|
3186
|
-
...responsiveRules("justify-flex-end", {
|
|
3187
|
-
justifyContent: "flex-end"
|
|
3188
|
-
}),
|
|
3189
|
-
...responsiveRules("justify-center", {
|
|
3190
|
-
justifyContent: "center"
|
|
3191
|
-
}),
|
|
3192
|
-
...responsiveRules("justify-between", {
|
|
3193
|
-
justifyContent: "space-between"
|
|
3194
|
-
}),
|
|
3195
|
-
...responsiveRules("justify-around", {
|
|
3196
|
-
justifyContent: "space-around"
|
|
3197
|
-
}),
|
|
3198
|
-
...responsiveRules("justify-evenly", {
|
|
3199
|
-
justifyContent: "space-evenly"
|
|
3200
|
-
}),
|
|
3201
|
-
// wrap
|
|
3202
|
-
...responsiveRules("wrap-nowrap", {
|
|
3203
|
-
flexWrap: "nowrap"
|
|
3204
|
-
}),
|
|
3205
|
-
...responsiveRules("wrap-wrap", {
|
|
3206
|
-
flexWrap: "wrap"
|
|
3207
|
-
}),
|
|
3208
|
-
...responsiveRules("wrap-reverse", {
|
|
3209
|
-
flexWrap: "wrap-reverse"
|
|
3210
|
-
})
|
|
3211
|
-
}, flexItemRules = {
|
|
3212
|
-
...responsiveRules("flex-none", {
|
|
3213
|
-
flex: "none"
|
|
3214
|
-
}),
|
|
3215
|
-
...responsiveRules("flex-auto", {
|
|
3216
|
-
flex: "auto"
|
|
3217
|
-
}),
|
|
3218
|
-
...responsiveRules("flex-1", {
|
|
3219
|
-
flex: 1
|
|
3220
|
-
}),
|
|
3221
|
-
...responsiveRules("flex-2", {
|
|
3222
|
-
flex: 2
|
|
3223
|
-
}),
|
|
3224
|
-
...responsiveRules("flex-3", {
|
|
3225
|
-
flex: 3
|
|
3226
|
-
}),
|
|
3227
|
-
...responsiveRules("flex-4", {
|
|
3228
|
-
flex: 4
|
|
3229
|
-
}),
|
|
3230
|
-
...responsiveRules("flex-5", {
|
|
3231
|
-
flex: 5
|
|
3232
|
-
})
|
|
3233
|
-
}, fontRules = {
|
|
3234
|
-
font: {
|
|
3235
|
-
// 'position': 'relative',
|
|
3236
|
-
fontFamily: "var(--font-family)",
|
|
3237
|
-
fontFeatureSettings: "var(--font-feature-settings)",
|
|
3238
|
-
fontSize: "var(--font-size)",
|
|
3239
|
-
lineHeight: "var(--font-line-height)",
|
|
3240
|
-
letterSpacing: "var(--font-letter-spacing)",
|
|
3241
|
-
fontWeight: "var(--font-weight)",
|
|
3242
|
-
transform: "translateY(var(--font-descender-height))",
|
|
3243
|
-
padding: "1px 0",
|
|
3244
|
-
margin: "0",
|
|
3245
|
-
"--font-icon-offset": "calc(((var(--font-line-height) - var(--font-ascender-height) - var(--font-descender-height)) - var(--font-icon-size)) / 2)",
|
|
3246
|
-
"--font-weight": "var(--font-weight-regular)",
|
|
3247
|
-
"@nest": {
|
|
3248
|
-
"&:before": {
|
|
3249
|
-
content: '""',
|
|
3250
|
-
display: "block",
|
|
3251
|
-
height: 0,
|
|
3252
|
-
marginTop: "calc((0px - var(--font-ascender-height) - var(--font-descender-height)) - 1px)"
|
|
3253
|
-
},
|
|
3254
|
-
"&:after": {
|
|
3255
|
-
content: '""',
|
|
3256
|
-
display: "block",
|
|
3257
|
-
height: 0,
|
|
3258
|
-
marginBottom: "-1px"
|
|
3259
|
-
},
|
|
3260
|
-
"& svg": {
|
|
3261
|
-
// Certain popular CSS libraries changes the defaults for SVG display
|
|
3262
|
-
// Make sure SVGs are rendered as inline elements
|
|
3263
|
-
display: "inline"
|
|
3264
|
-
},
|
|
3265
|
-
// todo
|
|
3266
|
-
// '& svg:not([data-sanity-icon])': {
|
|
3267
|
-
// fontSize: 'calc(var(--custom-icon-size) / 16 * 1rem)',
|
|
3268
|
-
// margin: 'var(--custom-icon-offset)',
|
|
3269
|
-
// },
|
|
3270
|
-
"& [data-sanity-icon]": {
|
|
3271
|
-
fontSize: "var(--font-icon-size)",
|
|
3272
|
-
margin: "var(--font-icon-offset)",
|
|
3273
|
-
vectorEffect: "non-scaling-stroke"
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
},
|
|
3277
|
-
"font-regular": {
|
|
3278
|
-
"--font-weight": "var(--font-weight-regular)"
|
|
3279
|
-
},
|
|
3280
|
-
"font-medium": {
|
|
3281
|
-
"--font-weight": "var(--font-weight-medium)"
|
|
3282
|
-
},
|
|
3283
|
-
"font-semibold": {
|
|
3284
|
-
"--font-weight": "var(--font-weight-semibold)"
|
|
3285
|
-
},
|
|
3286
|
-
"font-bold": {
|
|
3287
|
-
"--font-weight": "var(--font-weight-bold)"
|
|
3288
|
-
},
|
|
3289
|
-
// align
|
|
3290
|
-
...responsiveRules("text-align-initial", {
|
|
3291
|
-
textAlign: "initial"
|
|
3292
|
-
}),
|
|
3293
|
-
...responsiveRules("text-align-left", {
|
|
3294
|
-
textAlign: "left"
|
|
3295
|
-
}),
|
|
3296
|
-
...responsiveRules("text-align-center", {
|
|
3297
|
-
textAlign: "center"
|
|
3298
|
-
}),
|
|
3299
|
-
...responsiveRules("text-align-right", {
|
|
3300
|
-
textAlign: "right"
|
|
3301
|
-
}),
|
|
3302
|
-
...responsiveRules("text-align-justify", {
|
|
3303
|
-
textAlign: "justify"
|
|
3304
|
-
})
|
|
3305
|
-
}, gapRules = {
|
|
3306
|
-
...SPACE.reduce((acc, space) => ({
|
|
3307
|
-
...acc,
|
|
3308
|
-
...responsiveRules(`g-${space}`.replace(".", "_"), {
|
|
3309
|
-
gap: vars.space[space]
|
|
3310
|
-
})
|
|
3311
|
-
}), {}),
|
|
3312
|
-
...SPACE.reduce((acc, space) => ({
|
|
3313
|
-
...acc,
|
|
3314
|
-
...responsiveRules(`gx-${space}`.replace(".", "_"), {
|
|
3315
|
-
columnGap: vars.space[space]
|
|
3316
|
-
})
|
|
3317
|
-
}), {}),
|
|
3318
|
-
...SPACE.reduce((acc, space) => ({
|
|
3319
|
-
...acc,
|
|
3320
|
-
...responsiveRules(`gy-${space}`.replace(".", "_"), {
|
|
3321
|
-
rowGap: vars.space[space]
|
|
3322
|
-
})
|
|
3323
|
-
}), {})
|
|
3324
|
-
}, gridRules = {
|
|
3325
|
-
// autoCols
|
|
3326
|
-
...responsiveRules("auto-cols-auto", {
|
|
3327
|
-
gridAutoColumns: "auto"
|
|
3328
|
-
}),
|
|
3329
|
-
...responsiveRules("auto-cols-min", {
|
|
3330
|
-
gridAutoColumns: "min"
|
|
3331
|
-
}),
|
|
3332
|
-
...responsiveRules("auto-cols-max", {
|
|
3333
|
-
gridAutoColumns: "max"
|
|
3334
|
-
}),
|
|
3335
|
-
...responsiveRules("auto-cols-fr", {
|
|
3336
|
-
gridAutoColumns: "fr"
|
|
3337
|
-
}),
|
|
3338
|
-
// autoFlow
|
|
3339
|
-
...responsiveRules("auto-flow-row", {
|
|
3340
|
-
gridAutoFlow: "row"
|
|
3341
|
-
}),
|
|
3342
|
-
...responsiveRules("auto-flow-column", {
|
|
3343
|
-
gridAutoFlow: "column"
|
|
3344
|
-
}),
|
|
3345
|
-
...responsiveRules("auto-flow-row-dense", {
|
|
3346
|
-
gridAutoFlow: "row dense"
|
|
3347
|
-
}),
|
|
3348
|
-
...responsiveRules("auto-flow-column-dense", {
|
|
3349
|
-
gridAutoFlow: "column dense"
|
|
3350
|
-
}),
|
|
3351
|
-
// autoRows
|
|
3352
|
-
...responsiveRules("auto-rows-auto", {
|
|
3353
|
-
gridAutoRows: "auto"
|
|
3354
|
-
}),
|
|
3355
|
-
...responsiveRules("auto-rows-min", {
|
|
3356
|
-
gridAutoRows: "min-content"
|
|
3357
|
-
}),
|
|
3358
|
-
...responsiveRules("auto-rows-max", {
|
|
3359
|
-
gridAutoRows: "max-content"
|
|
3360
|
-
}),
|
|
3361
|
-
...responsiveRules("auto-rows-fr", {
|
|
3362
|
-
gridAutoRows: "minmax(0, 1fr)"
|
|
3363
|
-
}),
|
|
3364
|
-
// columns
|
|
3365
|
-
...responsiveRules("columns-1", {
|
|
3366
|
-
gridTemplateColumns: "repeat(1, 1fr)"
|
|
3367
|
-
}),
|
|
3368
|
-
...responsiveRules("columns-2", {
|
|
3369
|
-
gridTemplateColumns: "repeat(2, 1fr)"
|
|
3370
|
-
}),
|
|
3371
|
-
...responsiveRules("columns-3", {
|
|
3372
|
-
gridTemplateColumns: "repeat(3, 1fr)"
|
|
3373
|
-
}),
|
|
3374
|
-
...responsiveRules("columns-4", {
|
|
3375
|
-
gridTemplateColumns: "repeat(4, 1fr)"
|
|
3376
|
-
}),
|
|
3377
|
-
...responsiveRules("columns-5", {
|
|
3378
|
-
gridTemplateColumns: "repeat(5, 1fr)"
|
|
3379
|
-
}),
|
|
3380
|
-
...responsiveRules("columns-6", {
|
|
3381
|
-
gridTemplateColumns: "repeat(6, 1fr)"
|
|
3382
|
-
}),
|
|
3383
|
-
...responsiveRules("columns-7", {
|
|
3384
|
-
gridTemplateColumns: "repeat(7, 1fr)"
|
|
3385
|
-
}),
|
|
3386
|
-
...responsiveRules("columns-8", {
|
|
3387
|
-
gridTemplateColumns: "repeat(8, 1fr)"
|
|
3388
|
-
}),
|
|
3389
|
-
...responsiveRules("columns-9", {
|
|
3390
|
-
gridTemplateColumns: "repeat(9, 1fr)"
|
|
3391
|
-
}),
|
|
3392
|
-
...responsiveRules("columns-10", {
|
|
3393
|
-
gridTemplateColumns: "repeat(10, 1fr)"
|
|
3394
|
-
}),
|
|
3395
|
-
...responsiveRules("columns-12", {
|
|
3396
|
-
gridTemplateColumns: "repeat(12, 1fr)"
|
|
3397
|
-
}),
|
|
3398
|
-
// rows
|
|
3399
|
-
...responsiveRules("rows-1", {
|
|
3400
|
-
gridTemplateRows: "repeat(1, 1fr)"
|
|
3401
|
-
}),
|
|
3402
|
-
...responsiveRules("rows-2", {
|
|
3403
|
-
gridTemplateRows: "repeat(2, 1fr)"
|
|
3404
|
-
}),
|
|
3405
|
-
...responsiveRules("rows-3", {
|
|
3406
|
-
gridTemplateRows: "repeat(3, 1fr)"
|
|
3407
|
-
}),
|
|
3408
|
-
...responsiveRules("rows-4", {
|
|
3409
|
-
gridTemplateRows: "repeat(4, 1fr)"
|
|
3410
|
-
}),
|
|
3411
|
-
...responsiveRules("rows-5", {
|
|
3412
|
-
gridTemplateRows: "repeat(5, 1fr)"
|
|
3413
|
-
}),
|
|
3414
|
-
...responsiveRules("rows-6", {
|
|
3415
|
-
gridTemplateRows: "repeat(6, 1fr)"
|
|
3416
|
-
}),
|
|
3417
|
-
...responsiveRules("rows-7", {
|
|
3418
|
-
gridTemplateRows: "repeat(7, 1fr)"
|
|
3419
|
-
}),
|
|
3420
|
-
...responsiveRules("rows-8", {
|
|
3421
|
-
gridTemplateRows: "repeat(8, 1fr)"
|
|
3422
|
-
}),
|
|
3423
|
-
...responsiveRules("rows-9", {
|
|
3424
|
-
gridTemplateRows: "repeat(9, 1fr)"
|
|
3425
|
-
}),
|
|
3426
|
-
...responsiveRules("rows-10", {
|
|
3427
|
-
gridTemplateRows: "repeat(10, 1fr)"
|
|
3428
|
-
}),
|
|
3429
|
-
...responsiveRules("rows-12", {
|
|
3430
|
-
gridTemplateRows: "repeat(12, 1fr)"
|
|
3431
|
-
})
|
|
3432
|
-
}, gridItemRules = {
|
|
3433
|
-
// column
|
|
3434
|
-
...responsiveRules("col-auto", {
|
|
3435
|
-
gridColumn: "span 1 / span 1"
|
|
3436
|
-
}),
|
|
3437
|
-
...responsiveRules("col-full", {
|
|
3438
|
-
gridColumn: "1 / -1"
|
|
3439
|
-
}),
|
|
3440
|
-
...responsiveRules("col-1", {
|
|
3441
|
-
gridColumn: "span 1 / span 1"
|
|
3442
|
-
}),
|
|
3443
|
-
...responsiveRules("col-2", {
|
|
3444
|
-
gridColumn: "span 2 / span 2"
|
|
3445
|
-
}),
|
|
3446
|
-
...responsiveRules("col-3", {
|
|
3447
|
-
gridColumn: "span 3 / span 3"
|
|
3448
|
-
}),
|
|
3449
|
-
...responsiveRules("col-4", {
|
|
3450
|
-
gridColumn: "span 4 / span 4"
|
|
3451
|
-
}),
|
|
3452
|
-
...responsiveRules("col-5", {
|
|
3453
|
-
gridColumn: "span 5 / span 5"
|
|
3454
|
-
}),
|
|
3455
|
-
...responsiveRules("col-6", {
|
|
3456
|
-
gridColumn: "span 6 / span 6"
|
|
3457
|
-
}),
|
|
3458
|
-
...responsiveRules("col-7", {
|
|
3459
|
-
gridColumn: "span 7 / span 7"
|
|
3460
|
-
}),
|
|
3461
|
-
...responsiveRules("col-8", {
|
|
3462
|
-
gridColumn: "span 8 / span 8"
|
|
3463
|
-
}),
|
|
3464
|
-
...responsiveRules("col-9", {
|
|
3465
|
-
gridColumn: "span 9 / span 9"
|
|
3466
|
-
}),
|
|
3467
|
-
...responsiveRules("col-10", {
|
|
3468
|
-
gridColumn: "span 10 / span 10"
|
|
3469
|
-
}),
|
|
3470
|
-
...responsiveRules("col-11", {
|
|
3471
|
-
gridColumn: "span 11 / span 11"
|
|
3472
|
-
}),
|
|
3473
|
-
...responsiveRules("col-12", {
|
|
3474
|
-
gridColumn: "span 12 / span 12"
|
|
3475
|
-
}),
|
|
3476
|
-
// columnStart
|
|
3477
|
-
...responsiveRules("col-start-auto", {
|
|
3478
|
-
gridColumnStart: "auto"
|
|
3479
|
-
}),
|
|
3480
|
-
...responsiveRules("col-start-1", {
|
|
3481
|
-
gridColumnStart: "1"
|
|
3482
|
-
}),
|
|
3483
|
-
...responsiveRules("col-start-2", {
|
|
3484
|
-
gridColumnStart: "2"
|
|
3485
|
-
}),
|
|
3486
|
-
...responsiveRules("col-start-3", {
|
|
3487
|
-
gridColumnStart: "3"
|
|
3488
|
-
}),
|
|
3489
|
-
...responsiveRules("col-start-4", {
|
|
3490
|
-
gridColumnStart: "4"
|
|
3491
|
-
}),
|
|
3492
|
-
...responsiveRules("col-start-5", {
|
|
3493
|
-
gridColumnStart: "5"
|
|
3494
|
-
}),
|
|
3495
|
-
...responsiveRules("col-start-6", {
|
|
3496
|
-
gridColumnStart: "6"
|
|
3497
|
-
}),
|
|
3498
|
-
...responsiveRules("col-start-7", {
|
|
3499
|
-
gridColumnStart: "7"
|
|
3500
|
-
}),
|
|
3501
|
-
...responsiveRules("col-start-8", {
|
|
3502
|
-
gridColumnStart: "8"
|
|
3503
|
-
}),
|
|
3504
|
-
...responsiveRules("col-start-9", {
|
|
3505
|
-
gridColumnStart: "9"
|
|
3506
|
-
}),
|
|
3507
|
-
...responsiveRules("col-start-10", {
|
|
3508
|
-
gridColumnStart: "10"
|
|
3509
|
-
}),
|
|
3510
|
-
...responsiveRules("col-start-11", {
|
|
3511
|
-
gridColumnStart: "11"
|
|
3512
|
-
}),
|
|
3513
|
-
...responsiveRules("col-start-12", {
|
|
3514
|
-
gridColumnStart: "12"
|
|
3515
|
-
}),
|
|
3516
|
-
// columnEnd
|
|
3517
|
-
...responsiveRules("col-end-auto", {
|
|
3518
|
-
gridColumnEnd: "auto"
|
|
3519
|
-
}),
|
|
3520
|
-
...responsiveRules("col-end-1", {
|
|
3521
|
-
gridColumnEnd: "1"
|
|
3522
|
-
}),
|
|
3523
|
-
...responsiveRules("col-end-2", {
|
|
3524
|
-
gridColumnEnd: "2"
|
|
3525
|
-
}),
|
|
3526
|
-
...responsiveRules("col-end-3", {
|
|
3527
|
-
gridColumnEnd: "3"
|
|
3528
|
-
}),
|
|
3529
|
-
...responsiveRules("col-end-4", {
|
|
3530
|
-
gridColumnEnd: "4"
|
|
3531
|
-
}),
|
|
3532
|
-
...responsiveRules("col-end-5", {
|
|
3533
|
-
gridColumnEnd: "5"
|
|
3534
|
-
}),
|
|
3535
|
-
...responsiveRules("col-end-6", {
|
|
3536
|
-
gridColumnEnd: "6"
|
|
3537
|
-
}),
|
|
3538
|
-
...responsiveRules("col-end-7", {
|
|
3539
|
-
gridColumnEnd: "7"
|
|
3540
|
-
}),
|
|
3541
|
-
...responsiveRules("col-end-8", {
|
|
3542
|
-
gridColumnEnd: "8"
|
|
3543
|
-
}),
|
|
3544
|
-
...responsiveRules("col-end-9", {
|
|
3545
|
-
gridColumnEnd: "9"
|
|
3546
|
-
}),
|
|
3547
|
-
...responsiveRules("col-end-10", {
|
|
3548
|
-
gridColumnEnd: "10"
|
|
3549
|
-
}),
|
|
3550
|
-
...responsiveRules("col-end-11", {
|
|
3551
|
-
gridColumnEnd: "11"
|
|
3552
|
-
}),
|
|
3553
|
-
...responsiveRules("col-end-12", {
|
|
3554
|
-
gridColumnEnd: "12"
|
|
3555
|
-
}),
|
|
3556
|
-
// row
|
|
3557
|
-
...responsiveRules("row-auto", {
|
|
3558
|
-
gridRow: "span 1 / span 1"
|
|
3559
|
-
}),
|
|
3560
|
-
...responsiveRules("row-full", {
|
|
3561
|
-
gridRow: "1 / -1"
|
|
3562
|
-
}),
|
|
3563
|
-
...responsiveRules("row-1", {
|
|
3564
|
-
gridRow: "span 1 / span 1"
|
|
3565
|
-
}),
|
|
3566
|
-
...responsiveRules("row-2", {
|
|
3567
|
-
gridRow: "span 2 / span 2"
|
|
3568
|
-
}),
|
|
3569
|
-
...responsiveRules("row-3", {
|
|
3570
|
-
gridRow: "span 3 / span 3"
|
|
3571
|
-
}),
|
|
3572
|
-
...responsiveRules("row-4", {
|
|
3573
|
-
gridRow: "span 4 / span 4"
|
|
3574
|
-
}),
|
|
3575
|
-
...responsiveRules("row-5", {
|
|
3576
|
-
gridRow: "span 5 / span 5"
|
|
3577
|
-
}),
|
|
3578
|
-
...responsiveRules("row-6", {
|
|
3579
|
-
gridRow: "span 6 / span 6"
|
|
3580
|
-
}),
|
|
3581
|
-
...responsiveRules("row-7", {
|
|
3582
|
-
gridRow: "span 7 / span 7"
|
|
3583
|
-
}),
|
|
3584
|
-
...responsiveRules("row-8", {
|
|
3585
|
-
gridRow: "span 8 / span 8"
|
|
3586
|
-
}),
|
|
3587
|
-
...responsiveRules("row-9", {
|
|
3588
|
-
gridRow: "span 9 / span 9"
|
|
3589
|
-
}),
|
|
3590
|
-
...responsiveRules("row-10", {
|
|
3591
|
-
gridRow: "span 10 / span 10"
|
|
3592
|
-
}),
|
|
3593
|
-
...responsiveRules("row-11", {
|
|
3594
|
-
gridRow: "span 11 / span 11"
|
|
3595
|
-
}),
|
|
3596
|
-
...responsiveRules("row-12", {
|
|
3597
|
-
gridRow: "span 12 / span 12"
|
|
3598
|
-
}),
|
|
3599
|
-
// rowStart
|
|
3600
|
-
...responsiveRules("row-start-auto", {
|
|
3601
|
-
gridRowStart: "auto"
|
|
3602
|
-
}),
|
|
3603
|
-
...responsiveRules("row-start-1", {
|
|
3604
|
-
gridRowStart: "1"
|
|
3605
|
-
}),
|
|
3606
|
-
...responsiveRules("row-start-2", {
|
|
3607
|
-
gridRowStart: "2"
|
|
3608
|
-
}),
|
|
3609
|
-
...responsiveRules("row-start-3", {
|
|
3610
|
-
gridRowStart: "3"
|
|
3611
|
-
}),
|
|
3612
|
-
...responsiveRules("row-start-4", {
|
|
3613
|
-
gridRowStart: "4"
|
|
3614
|
-
}),
|
|
3615
|
-
...responsiveRules("row-start-5", {
|
|
3616
|
-
gridRowStart: "5"
|
|
3617
|
-
}),
|
|
3618
|
-
...responsiveRules("row-start-6", {
|
|
3619
|
-
gridRowStart: "6"
|
|
3620
|
-
}),
|
|
3621
|
-
...responsiveRules("row-start-7", {
|
|
3622
|
-
gridRowStart: "7"
|
|
3623
|
-
}),
|
|
3624
|
-
...responsiveRules("row-start-8", {
|
|
3625
|
-
gridRowStart: "8"
|
|
3626
|
-
}),
|
|
3627
|
-
...responsiveRules("row-start-9", {
|
|
3628
|
-
gridRowStart: "9"
|
|
3629
|
-
}),
|
|
3630
|
-
...responsiveRules("row-start-10", {
|
|
3631
|
-
gridRowStart: "10"
|
|
3632
|
-
}),
|
|
3633
|
-
...responsiveRules("row-start-11", {
|
|
3634
|
-
gridRowStart: "11"
|
|
3635
|
-
}),
|
|
3636
|
-
...responsiveRules("row-start-12", {
|
|
3637
|
-
gridRowStart: "12"
|
|
3638
|
-
}),
|
|
3639
|
-
// rowEnd
|
|
3640
|
-
...responsiveRules("row-end-auto", {
|
|
3641
|
-
gridRowEnd: "auto"
|
|
3642
|
-
}),
|
|
3643
|
-
...responsiveRules("row-end-1", {
|
|
3644
|
-
gridRowEnd: "1"
|
|
3645
|
-
}),
|
|
3646
|
-
...responsiveRules("row-end-2", {
|
|
3647
|
-
gridRowEnd: "2"
|
|
3648
|
-
}),
|
|
3649
|
-
...responsiveRules("row-end-3", {
|
|
3650
|
-
gridRowEnd: "3"
|
|
3651
|
-
}),
|
|
3652
|
-
...responsiveRules("row-end-4", {
|
|
3653
|
-
gridRowEnd: "4"
|
|
3654
|
-
}),
|
|
3655
|
-
...responsiveRules("row-end-5", {
|
|
3656
|
-
gridRowEnd: "5"
|
|
3657
|
-
}),
|
|
3658
|
-
...responsiveRules("row-end-6", {
|
|
3659
|
-
gridRowEnd: "6"
|
|
3660
|
-
}),
|
|
3661
|
-
...responsiveRules("row-end-7", {
|
|
3662
|
-
gridRowEnd: "7"
|
|
3663
|
-
}),
|
|
3664
|
-
...responsiveRules("row-end-8", {
|
|
3665
|
-
gridRowEnd: "8"
|
|
3666
|
-
}),
|
|
3667
|
-
...responsiveRules("row-end-9", {
|
|
3668
|
-
gridRowEnd: "9"
|
|
3669
|
-
}),
|
|
3670
|
-
...responsiveRules("row-end-10", {
|
|
3671
|
-
gridRowEnd: "10"
|
|
3672
|
-
}),
|
|
3673
|
-
...responsiveRules("row-end-11", {
|
|
3674
|
-
gridRowEnd: "11"
|
|
3675
|
-
}),
|
|
3676
|
-
...responsiveRules("row-end-12", {
|
|
3677
|
-
gridRowEnd: "12"
|
|
3678
|
-
})
|
|
3679
|
-
}, heightRules = {
|
|
3680
|
-
...responsiveRules("h-fill", {
|
|
3681
|
-
height: "100%"
|
|
3682
|
-
}),
|
|
3683
|
-
...responsiveRules("h-stretch", {
|
|
3684
|
-
height: "stretch"
|
|
3685
|
-
})
|
|
3686
|
-
}, insetRules = {
|
|
3687
|
-
...responsiveRules("inset-0", {
|
|
3688
|
-
top: 0,
|
|
3689
|
-
left: 0,
|
|
3690
|
-
right: 0,
|
|
3691
|
-
bottom: 0
|
|
3692
|
-
}),
|
|
3693
|
-
...responsiveRules("top-0", {
|
|
3694
|
-
top: 0
|
|
3695
|
-
}),
|
|
3696
|
-
...responsiveRules("right-0", {
|
|
3697
|
-
right: 0
|
|
3698
|
-
}),
|
|
3699
|
-
...responsiveRules("bottom-0", {
|
|
3700
|
-
bottom: 0
|
|
3701
|
-
}),
|
|
3702
|
-
...responsiveRules("left-0", {
|
|
3703
|
-
left: 0
|
|
3704
|
-
})
|
|
3705
|
-
}, marginRules = {
|
|
3706
|
-
// NOTE: order matters
|
|
3707
|
-
...SPACE.reduce((acc, space) => ({
|
|
3708
|
-
...acc,
|
|
3709
|
-
...responsiveRules(`m-${space}`.replace(".", "_"), {
|
|
3710
|
-
margin: vars.space[space]
|
|
3711
|
-
})
|
|
3712
|
-
}), {}),
|
|
3713
|
-
...SPACE.reduce((acc, space) => ({
|
|
3714
|
-
...acc,
|
|
3715
|
-
...responsiveRules(`mx-${space}`.replace(".", "_"), {
|
|
3716
|
-
marginLeft: vars.space[space],
|
|
3717
|
-
marginRight: vars.space[space]
|
|
3718
|
-
})
|
|
3719
|
-
}), {}),
|
|
3720
|
-
...SPACE.reduce((acc, space) => ({
|
|
3721
|
-
...acc,
|
|
3722
|
-
...responsiveRules(`my-${space}`.replace(".", "_"), {
|
|
3723
|
-
marginTop: vars.space[space],
|
|
3724
|
-
marginBottom: vars.space[space]
|
|
3725
|
-
})
|
|
3726
|
-
}), {}),
|
|
3727
|
-
...SPACE.reduce((acc, space) => ({
|
|
3728
|
-
...acc,
|
|
3729
|
-
...responsiveRules(`mt-${space}`.replace(".", "_"), {
|
|
3730
|
-
marginTop: vars.space[space]
|
|
3731
|
-
})
|
|
3732
|
-
}), {}),
|
|
3733
|
-
...SPACE.reduce((acc, space) => ({
|
|
3734
|
-
...acc,
|
|
3735
|
-
...responsiveRules(`mr-${space}`.replace(".", "_"), {
|
|
3736
|
-
marginRight: vars.space[space]
|
|
3737
|
-
})
|
|
3738
|
-
}), {}),
|
|
3739
|
-
...SPACE.reduce((acc, space) => ({
|
|
3740
|
-
...acc,
|
|
3741
|
-
...responsiveRules(`mb-${space}`.replace(".", "_"), {
|
|
3742
|
-
marginBottom: vars.space[space]
|
|
3743
|
-
})
|
|
3744
|
-
}), {}),
|
|
3745
|
-
...SPACE.reduce((acc, space) => ({
|
|
3746
|
-
...acc,
|
|
3747
|
-
...responsiveRules(`ml-${space}`.replace(".", "_"), {
|
|
3748
|
-
marginLeft: vars.space[space]
|
|
3749
|
-
})
|
|
3750
|
-
}), {})
|
|
3751
|
-
}, maxWidthRules = {
|
|
3752
|
-
...responsiveRules("max-w-0", {
|
|
3753
|
-
maxWidth: "var(--container-0)"
|
|
3754
|
-
}),
|
|
3755
|
-
...responsiveRules("max-w-1", {
|
|
3756
|
-
maxWidth: "var(--container-1)"
|
|
3757
|
-
}),
|
|
3758
|
-
...responsiveRules("max-w-2", {
|
|
3759
|
-
maxWidth: "var(--container-2)"
|
|
3760
|
-
}),
|
|
3761
|
-
...responsiveRules("max-w-3", {
|
|
3762
|
-
maxWidth: "var(--container-3)"
|
|
3763
|
-
}),
|
|
3764
|
-
...responsiveRules("max-w-4", {
|
|
3765
|
-
maxWidth: "var(--container-4)"
|
|
3766
|
-
}),
|
|
3767
|
-
...responsiveRules("max-w-5", {
|
|
3768
|
-
maxWidth: "var(--container-5)"
|
|
3769
|
-
}),
|
|
3770
|
-
...responsiveRules("max-w-auto", {
|
|
3771
|
-
maxWidth: "none"
|
|
3772
|
-
}),
|
|
3773
|
-
...responsiveRules("max-w-fill", {
|
|
3774
|
-
maxWidth: "100%"
|
|
3775
|
-
})
|
|
3776
|
-
}, outlineRules = {
|
|
3777
|
-
"outline-none": {
|
|
3778
|
-
outline: "none"
|
|
3779
|
-
}
|
|
3780
|
-
}, overflowRules = {
|
|
3781
|
-
...responsiveRules("overflow-visible", {
|
|
3782
|
-
overflow: "visible"
|
|
3783
|
-
}),
|
|
3784
|
-
...responsiveRules("overflow-hidden", {
|
|
3785
|
-
overflow: "hidden"
|
|
3786
|
-
}),
|
|
3787
|
-
...responsiveRules("overflow-scroll", {
|
|
3788
|
-
overflow: "scroll"
|
|
3789
|
-
}),
|
|
3790
|
-
...responsiveRules("overflow-auto", {
|
|
3791
|
-
overflow: "auto"
|
|
3792
|
-
})
|
|
3793
|
-
}, paddingRules = {
|
|
3794
|
-
...SPACE.reduce((acc, space) => ({
|
|
3795
|
-
...acc,
|
|
3796
|
-
...responsiveRules(`p-${space}`.replace(".", "_"), {
|
|
3797
|
-
padding: vars.space[space]
|
|
3798
|
-
})
|
|
3799
|
-
}), {}),
|
|
3800
|
-
...SPACE.reduce((acc, space) => ({
|
|
3801
|
-
...acc,
|
|
3802
|
-
...responsiveRules(`px-${space}`.replace(".", "_"), {
|
|
3803
|
-
paddingLeft: vars.space[space],
|
|
3804
|
-
paddingRight: vars.space[space]
|
|
3805
|
-
})
|
|
3806
|
-
}), {}),
|
|
3807
|
-
...SPACE.reduce((acc, space) => ({
|
|
3808
|
-
...acc,
|
|
3809
|
-
...responsiveRules(`py-${space}`.replace(".", "_"), {
|
|
3810
|
-
paddingTop: vars.space[space],
|
|
3811
|
-
paddingBottom: vars.space[space]
|
|
3812
|
-
})
|
|
3813
|
-
}), {}),
|
|
3814
|
-
...SPACE.reduce((acc, space) => ({
|
|
3815
|
-
...acc,
|
|
3816
|
-
...responsiveRules(`pt-${space}`.replace(".", "_"), {
|
|
3817
|
-
paddingTop: vars.space[space]
|
|
3818
|
-
})
|
|
3819
|
-
}), {}),
|
|
3820
|
-
...SPACE.reduce((acc, space) => ({
|
|
3821
|
-
...acc,
|
|
3822
|
-
...responsiveRules(`pr-${space}`.replace(".", "_"), {
|
|
3823
|
-
paddingRight: vars.space[space]
|
|
3824
|
-
})
|
|
3825
|
-
}), {}),
|
|
3826
|
-
...SPACE.reduce((acc, space) => ({
|
|
3827
|
-
...acc,
|
|
3828
|
-
...responsiveRules(`pb-${space}`.replace(".", "_"), {
|
|
3829
|
-
paddingBottom: vars.space[space]
|
|
3830
|
-
})
|
|
3831
|
-
}), {}),
|
|
3832
|
-
...SPACE.reduce((acc, space) => ({
|
|
3833
|
-
...acc,
|
|
3834
|
-
...responsiveRules(`pl-${space}`.replace(".", "_"), {
|
|
3835
|
-
paddingLeft: vars.space[space]
|
|
3836
|
-
})
|
|
3837
|
-
}), {})
|
|
3838
|
-
}, pointerEventsRules = {
|
|
3839
|
-
"pointer-events-none": {
|
|
3840
|
-
pointerEvents: "none"
|
|
3841
|
-
},
|
|
3842
|
-
"pointer-events-auto": {
|
|
3843
|
-
pointerEvents: "auto"
|
|
3844
|
-
}
|
|
3845
|
-
}, positionRules = {
|
|
3846
|
-
...responsiveRules("pos-absolute", {
|
|
3847
|
-
position: "absolute"
|
|
3848
|
-
}),
|
|
3849
|
-
...responsiveRules("pos-fixed", {
|
|
3850
|
-
position: "fixed"
|
|
3851
|
-
}),
|
|
3852
|
-
...responsiveRules("pos-relative", {
|
|
3853
|
-
position: "relative"
|
|
3854
|
-
}),
|
|
3855
|
-
...responsiveRules("pos-static", {
|
|
3856
|
-
position: "static"
|
|
3857
|
-
}),
|
|
3858
|
-
...responsiveRules("pos-sticky", {
|
|
3859
|
-
position: "sticky"
|
|
3860
|
-
})
|
|
3861
|
-
}, radiusRules = {
|
|
3862
|
-
...responsiveRules("r-0", {
|
|
3863
|
-
borderRadius: "var(--radius-0)"
|
|
3864
|
-
}),
|
|
3865
|
-
...responsiveRules("r-1", {
|
|
3866
|
-
borderRadius: "var(--radius-1)"
|
|
3867
|
-
}),
|
|
3868
|
-
...responsiveRules("r-2", {
|
|
3869
|
-
borderRadius: "var(--radius-2)"
|
|
3870
|
-
}),
|
|
3871
|
-
...responsiveRules("r-3", {
|
|
3872
|
-
borderRadius: "var(--radius-3)"
|
|
3873
|
-
}),
|
|
3874
|
-
...responsiveRules("r-4", {
|
|
3875
|
-
borderRadius: "var(--radius-4)"
|
|
3876
|
-
}),
|
|
3877
|
-
...responsiveRules("r-5", {
|
|
3878
|
-
borderRadius: "var(--radius-5)"
|
|
3879
|
-
}),
|
|
3880
|
-
...responsiveRules("r-6", {
|
|
3881
|
-
borderRadius: "var(--radius-6)"
|
|
3882
|
-
}),
|
|
3883
|
-
...responsiveRules("r-full", {
|
|
3884
|
-
borderRadius: "9999px"
|
|
3885
|
-
})
|
|
3886
|
-
}, shadowRules = {
|
|
3887
|
-
...responsiveRules("shadow-0", {
|
|
3888
|
-
boxShadow: "none"
|
|
3889
|
-
}),
|
|
3890
|
-
...responsiveRules("shadow-1", {
|
|
3891
|
-
boxShadow: ["var(--shadow-outline) var(--color-shadow-outline)", "var(--shadow-1-umbra) var(--color-shadow-umbra)", "var(--shadow-1-penumbra) var(--color-shadow-penumbra)", "var(--shadow-1-ambient) var(--color-shadow-ambient)"].join(", ")
|
|
3892
|
-
}),
|
|
3893
|
-
...responsiveRules("shadow-2", {
|
|
3894
|
-
boxShadow: ["var(--shadow-outline) var(--color-shadow-outline)", "var(--shadow-2-umbra) var(--color-shadow-umbra)", "var(--shadow-2-penumbra) var(--color-shadow-penumbra)", "var(--shadow-2-ambient) var(--color-shadow-ambient)"].join(", ")
|
|
3895
|
-
}),
|
|
3896
|
-
...responsiveRules("shadow-3", {
|
|
3897
|
-
boxShadow: ["var(--shadow-outline) var(--color-shadow-outline)", "var(--shadow-3-umbra) var(--color-shadow-umbra)", "var(--shadow-3-penumbra) var(--color-shadow-penumbra)", "var(--shadow-3-ambient) var(--color-shadow-ambient)"].join(", ")
|
|
3898
|
-
}),
|
|
3899
|
-
...responsiveRules("shadow-4", {
|
|
3900
|
-
boxShadow: ["var(--shadow-outline) var(--color-shadow-outline)", "var(--shadow-4-umbra) var(--color-shadow-umbra)", "var(--shadow-4-penumbra) var(--color-shadow-penumbra)", "var(--shadow-4-ambient) var(--color-shadow-ambient)"].join(", ")
|
|
3901
|
-
}),
|
|
3902
|
-
...responsiveRules("shadow-5", {
|
|
3903
|
-
boxShadow: ["var(--shadow-outline) var(--color-shadow-outline)", "var(--shadow-5-umbra) var(--color-shadow-umbra)", "var(--shadow-5-penumbra) var(--color-shadow-penumbra)", "var(--shadow-5-ambient) var(--color-shadow-ambient)"].join(", ")
|
|
3904
|
-
})
|
|
3905
|
-
}, textOverflowRules = {
|
|
3906
|
-
"text-overflow-ellipsis": {
|
|
3907
|
-
display: "block",
|
|
3908
|
-
whiteSpace: "nowrap",
|
|
3909
|
-
textOverflow: "ellipsis",
|
|
3910
|
-
overflow: ["hidden", "clip"]
|
|
3911
|
-
},
|
|
3912
|
-
"text-overflow-clip": {
|
|
3913
|
-
display: "block",
|
|
3914
|
-
whiteSpace: "nowrap",
|
|
3915
|
-
textOverflow: "clip",
|
|
3916
|
-
overflow: ["hidden", "clip"]
|
|
3917
|
-
}
|
|
3918
|
-
}, widthRules = {
|
|
3919
|
-
"w-fill": {
|
|
3920
|
-
width: ["-moz-available", "-webkit-fill-available", "stretch"]
|
|
3921
|
-
}
|
|
3922
|
-
}, srOnlyRules = {
|
|
3923
|
-
"sr-only": {
|
|
3924
|
-
display: "block",
|
|
3925
|
-
width: 0,
|
|
3926
|
-
height: 0,
|
|
3927
|
-
position: "absolute",
|
|
3928
|
-
overflow: ["hidden", "clip"]
|
|
3929
|
-
}
|
|
3930
|
-
}, rules = {
|
|
3931
|
-
// styles
|
|
3932
|
-
...borderRules,
|
|
3933
|
-
...displayRules,
|
|
3934
|
-
...flexItemRules,
|
|
3935
|
-
...flexRules,
|
|
3936
|
-
...fontRules,
|
|
3937
|
-
...gapRules,
|
|
3938
|
-
...gridItemRules,
|
|
3939
|
-
...gridRules,
|
|
3940
|
-
...heightRules,
|
|
3941
|
-
...insetRules,
|
|
3942
|
-
...marginRules,
|
|
3943
|
-
...outlineRules,
|
|
3944
|
-
...overflowRules,
|
|
3945
|
-
...paddingRules,
|
|
3946
|
-
...pointerEventsRules,
|
|
3947
|
-
...positionRules,
|
|
3948
|
-
...radiusRules,
|
|
3949
|
-
...shadowRules,
|
|
3950
|
-
...widthRules,
|
|
3951
|
-
// utils
|
|
3952
|
-
...srOnlyRules,
|
|
3953
|
-
// primitives
|
|
3954
|
-
..._arrowRules,
|
|
3955
|
-
..._inputRules,
|
|
3956
|
-
..._selectableRules,
|
|
3957
|
-
...avatarRules,
|
|
3958
|
-
...badgeRules,
|
|
3959
|
-
...boxRules,
|
|
3960
|
-
...buttonRules,
|
|
3961
|
-
...cardRules,
|
|
3962
|
-
...checkboxRules,
|
|
3963
|
-
...codeRules,
|
|
3964
|
-
...containerRules,
|
|
3965
|
-
...headingRules,
|
|
3966
|
-
...kbdRules,
|
|
3967
|
-
...labelRules,
|
|
3968
|
-
...maxWidthRules,
|
|
3969
|
-
...popoverRules,
|
|
3970
|
-
...radioRules,
|
|
3971
|
-
...selectRules,
|
|
3972
|
-
...spinnerRules,
|
|
3973
|
-
...switchRules,
|
|
3974
|
-
...textAreaRules,
|
|
3975
|
-
...textInputRules,
|
|
3976
|
-
...textOverflowRules,
|
|
3977
|
-
...textRules,
|
|
3978
|
-
...tokenRules,
|
|
3979
|
-
...tooltipRules,
|
|
3980
|
-
// components
|
|
3981
|
-
...breadcrumbsRules,
|
|
3982
|
-
...dialogRules,
|
|
3983
|
-
...menuRules,
|
|
3984
|
-
...skeletonRules,
|
|
3985
|
-
...toastRules
|
|
3986
|
-
};
|
|
3987
|
-
function compileRules(rules2) {
|
|
3988
|
-
let css = "";
|
|
3989
|
-
const context = {
|
|
3990
|
-
keyframes: {},
|
|
3991
|
-
media: {}
|
|
3992
|
-
};
|
|
3993
|
-
for (const [className, props] of Object.entries(rules2)) {
|
|
3994
|
-
const ruleCss = compileRule(`.${className}`.replace(/:/g, "\\:"), props, context);
|
|
3995
|
-
css += ruleCss ? `${ruleCss}
|
|
3996
|
-
` : "";
|
|
3997
|
-
}
|
|
3998
|
-
for (const [name, value] of Object.entries(context.keyframes)) {
|
|
3999
|
-
let keyframesCss = `@keyframes ${name} {
|
|
4000
|
-
`;
|
|
4001
|
-
for (const [key, props] of Object.entries(value))
|
|
4002
|
-
keyframesCss += ` ${key}`, keyframesCss += compileRule("", props, context).replace(/\n/g, `
|
|
4003
|
-
`) + `
|
|
4004
|
-
`;
|
|
4005
|
-
keyframesCss += `
|
|
4006
|
-
}
|
|
4007
|
-
`, css += keyframesCss;
|
|
4008
|
-
}
|
|
4009
|
-
for (const [query, queryRules] of Object.entries(context.media))
|
|
4010
|
-
css += compileMediaQueryRule(query, queryRules) + `
|
|
4011
|
-
`;
|
|
4012
|
-
return css.replace(/\n{2,}/g, `
|
|
4013
|
-
`).trimStart();
|
|
4014
|
-
}
|
|
4015
|
-
function compileSystem() {
|
|
4016
|
-
return compileRules(rules);
|
|
4017
|
-
}
|
|
4018
|
-
function isRecord(value) {
|
|
4019
|
-
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
4020
|
-
}
|
|
4021
|
-
function isArray(value) {
|
|
4022
|
-
return Array.isArray(value);
|
|
4023
|
-
}
|
|
4024
|
-
function rem(value) {
|
|
4025
|
-
return value === 0 ? "0" : `${value / 16}rem`;
|
|
4026
|
-
}
|
|
4027
|
-
function px(value) {
|
|
4028
|
-
return value === 0 ? "0" : `${value}px`;
|
|
4029
|
-
}
|
|
4030
|
-
function toBoxShadow(value) {
|
|
4031
|
-
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
4032
|
-
}
|
|
4033
|
-
function compileTheme_v3(theme) {
|
|
4034
|
-
return compileRule(":root", compileThemeProperties(theme), {
|
|
4035
|
-
keyframes: {},
|
|
4036
|
-
media: {}
|
|
4037
|
-
});
|
|
4038
|
-
}
|
|
4039
|
-
function compileThemeProperties(theme) {
|
|
4040
|
-
return {
|
|
4041
|
-
...buildAvatarThemeProperties(theme),
|
|
4042
|
-
...buildButtonThemeProperties(theme),
|
|
4043
|
-
...buildContainerThemeProperties(theme),
|
|
4044
|
-
...buildFontCodeThemeProperties(theme),
|
|
4045
|
-
...buildFontHeadingThemeProperties(theme),
|
|
4046
|
-
...buildFontLabelThemeProperties(theme),
|
|
4047
|
-
...buildFontTextThemeProperties(theme),
|
|
4048
|
-
...buildInputThemeProperties(theme),
|
|
4049
|
-
...buildRadiusThemeProperties(theme),
|
|
4050
|
-
...buildShadowThemeProperties(theme),
|
|
4051
|
-
...buildSpaceThemeProperties(theme),
|
|
4052
|
-
// ...buildColorPaletteProperties(palette),
|
|
4053
|
-
...buildColorThemeProperties(theme)
|
|
4054
|
-
};
|
|
4055
|
-
}
|
|
4056
|
-
function buildAvatarThemeProperties(theme) {
|
|
4057
|
-
return {
|
|
4058
|
-
"--avatar-focus-ring-offset": px(theme.avatar.focusRing.offset),
|
|
4059
|
-
"--avatar-focus-ring-width": px(theme.avatar.focusRing.width),
|
|
4060
|
-
"--avatar-0-distance": px(theme.avatar.sizes[0].distance),
|
|
4061
|
-
"--avatar-0-size": px(theme.avatar.sizes[0].size),
|
|
4062
|
-
"--avatar-1-distance": px(theme.avatar.sizes[1].distance),
|
|
4063
|
-
"--avatar-1-size": px(theme.avatar.sizes[1].size),
|
|
4064
|
-
"--avatar-2-distance": px(theme.avatar.sizes[2].distance),
|
|
4065
|
-
"--avatar-2-size": px(theme.avatar.sizes[2].size),
|
|
4066
|
-
"--avatar-3-distance": px(theme.avatar.sizes[3].distance),
|
|
4067
|
-
"--avatar-3-size": px(theme.avatar.sizes[3].size)
|
|
4068
|
-
};
|
|
4069
|
-
}
|
|
4070
|
-
function buildButtonThemeProperties(theme) {
|
|
4071
|
-
return {
|
|
4072
|
-
"--button-border-width": px(theme.button.border.width),
|
|
4073
|
-
"--button-focus-ring-offset": px(theme.button.focusRing.offset),
|
|
4074
|
-
"--button-focus-ring-width": px(theme.button.focusRing.width)
|
|
4075
|
-
// [`--button-text-weight`]: theme.button.textWeight,
|
|
4076
|
-
};
|
|
4077
|
-
}
|
|
4078
|
-
function buildContainerThemeProperties(theme) {
|
|
4079
|
-
return {
|
|
4080
|
-
"--container-0": px(theme.container[0]),
|
|
4081
|
-
"--container-1": px(theme.container[1]),
|
|
4082
|
-
"--container-2": px(theme.container[2]),
|
|
4083
|
-
"--container-3": px(theme.container[3]),
|
|
4084
|
-
"--container-4": px(theme.container[4]),
|
|
4085
|
-
"--container-5": px(theme.container[5])
|
|
4086
|
-
};
|
|
4087
|
-
}
|
|
4088
|
-
function buildFontCodeThemeProperties(theme) {
|
|
4089
|
-
const props = {
|
|
4090
|
-
"--font-code-family": theme.font.code.family,
|
|
4091
|
-
"--font-code-feature-settings": theme.font.code.featureSettings,
|
|
4092
|
-
"--font-code-weight-regular": `${theme.font.code.weights.regular}`,
|
|
4093
|
-
"--font-code-weight-medium": `${theme.font.code.weights.medium}`,
|
|
4094
|
-
"--font-code-weight-semibold": `${theme.font.code.weights.semibold}`,
|
|
4095
|
-
"--font-code-weight-bold": `${theme.font.code.weights.bold}`
|
|
4096
|
-
};
|
|
4097
|
-
for (const size of FONT_CODE_SIZE)
|
|
4098
|
-
props[`--font-code-${size}-size`] = rem(theme.font.code.sizes[size].fontSize), props[`--font-code-${size}-line-height`] = rem(theme.font.code.sizes[size].lineHeight), props[`--font-code-${size}-ascender-height`] = px(theme.font.code.sizes[size].ascenderHeight), props[`--font-code-${size}-descender-height`] = px(theme.font.code.sizes[size].descenderHeight), props[`--font-code-${size}-letter-spacing`] = px(theme.font.code.sizes[size].letterSpacing), props[`--font-code-${size}-icon-size`] = px(theme.font.code.sizes[size].iconSize);
|
|
4099
|
-
return props;
|
|
4100
|
-
}
|
|
4101
|
-
function buildFontHeadingThemeProperties(theme) {
|
|
4102
|
-
const props = {
|
|
4103
|
-
"--font-heading-family": theme.font.heading.family,
|
|
4104
|
-
"--font-heading-feature-settings": theme.font.heading.featureSettings,
|
|
4105
|
-
"--font-heading-weight-regular": `${theme.font.heading.weights.regular}`,
|
|
4106
|
-
"--font-heading-weight-medium": `${theme.font.heading.weights.medium}`,
|
|
4107
|
-
"--font-heading-weight-semibold": `${theme.font.heading.weights.semibold}`,
|
|
4108
|
-
"--font-heading-weight-bold": `${theme.font.heading.weights.bold}`
|
|
4109
|
-
};
|
|
4110
|
-
for (const size of FONT_HEADING_SIZE)
|
|
4111
|
-
props[`--font-heading-${size}-size`] = rem(theme.font.heading.sizes[size].fontSize), props[`--font-heading-${size}-line-height`] = rem(theme.font.heading.sizes[size].lineHeight), props[`--font-heading-${size}-ascender-height`] = px(theme.font.heading.sizes[size].ascenderHeight), props[`--font-heading-${size}-descender-height`] = px(theme.font.heading.sizes[size].descenderHeight), props[`--font-heading-${size}-letter-spacing`] = px(theme.font.heading.sizes[size].letterSpacing), props[`--font-heading-${size}-icon-size`] = px(theme.font.heading.sizes[size].iconSize);
|
|
4112
|
-
return props;
|
|
4113
|
-
}
|
|
4114
|
-
function buildFontLabelThemeProperties(theme) {
|
|
4115
|
-
const props = {
|
|
4116
|
-
"--font-label-family": theme.font.label.family,
|
|
4117
|
-
"--font-label-feature-settings": theme.font.label.featureSettings,
|
|
4118
|
-
"--font-label-weight-regular": `${theme.font.label.weights.regular}`,
|
|
4119
|
-
"--font-label-weight-medium": `${theme.font.label.weights.medium}`,
|
|
4120
|
-
"--font-label-weight-semibold": `${theme.font.label.weights.semibold}`,
|
|
4121
|
-
"--font-label-weight-bold": `${theme.font.label.weights.bold}`
|
|
4122
|
-
};
|
|
4123
|
-
for (const size of FONT_LABEL_SIZE)
|
|
4124
|
-
props[`--font-label-${size}-size`] = rem(theme.font.label.sizes[size].fontSize), props[`--font-label-${size}-line-height`] = rem(theme.font.label.sizes[size].lineHeight), props[`--font-label-${size}-ascender-height`] = px(theme.font.label.sizes[size].ascenderHeight), props[`--font-label-${size}-descender-height`] = px(theme.font.label.sizes[size].descenderHeight), props[`--font-label-${size}-letter-spacing`] = px(theme.font.label.sizes[size].letterSpacing), props[`--font-label-${size}-icon-size`] = px(theme.font.label.sizes[size].iconSize);
|
|
4125
|
-
return props;
|
|
4126
|
-
}
|
|
4127
|
-
function buildFontTextThemeProperties(theme) {
|
|
4128
|
-
const props = {
|
|
4129
|
-
"--font-text-family": theme.font.text.family,
|
|
4130
|
-
"--font-text-feature-settings": theme.font.text.featureSettings,
|
|
4131
|
-
"--font-text-weight-regular": `${theme.font.text.weights.regular}`,
|
|
4132
|
-
"--font-text-weight-medium": `${theme.font.text.weights.medium}`,
|
|
4133
|
-
"--font-text-weight-semibold": `${theme.font.text.weights.semibold}`,
|
|
4134
|
-
"--font-text-weight-bold": `${theme.font.text.weights.bold}`
|
|
4135
|
-
};
|
|
4136
|
-
for (const size of FONT_TEXT_SIZE)
|
|
4137
|
-
props[`--font-text-${size}-size`] = rem(theme.font.text.sizes[size].fontSize), props[`--font-text-${size}-line-height`] = rem(theme.font.text.sizes[size].lineHeight), props[`--font-text-${size}-ascender-height`] = px(theme.font.text.sizes[size].ascenderHeight), props[`--font-text-${size}-descender-height`] = px(theme.font.text.sizes[size].descenderHeight), props[`--font-text-${size}-letter-spacing`] = px(theme.font.text.sizes[size].letterSpacing), props[`--font-text-${size}-icon-size`] = px(theme.font.text.sizes[size].iconSize);
|
|
4138
|
-
return props;
|
|
4139
|
-
}
|
|
4140
|
-
function buildInputThemeProperties(theme) {
|
|
4141
|
-
return {
|
|
4142
|
-
"--input-border-width": px(theme.input.border.width),
|
|
4143
|
-
"--input-checkbox-focus-ring-offset": px(theme.input.checkbox.focusRing.offset),
|
|
4144
|
-
"--input-checkbox-focus-ring-width": px(theme.input.checkbox.focusRing.width),
|
|
4145
|
-
"--input-checkbox-size": px(theme.input.checkbox.size),
|
|
4146
|
-
"--input-radio-focus-ring-offset": px(theme.input.radio.focusRing.offset),
|
|
4147
|
-
"--input-radio-focus-ring-width": px(theme.input.radio.focusRing.width),
|
|
4148
|
-
"--input-radio-mark-size": px(theme.input.radio.markSize),
|
|
4149
|
-
"--input-radio-size": px(theme.input.radio.size),
|
|
4150
|
-
"--input-select-focus-ring-offset": px(theme.input.select.focusRing.offset),
|
|
4151
|
-
"--input-select-focus-ring-width": px(theme.input.select.focusRing.width),
|
|
4152
|
-
"--input-switch-focus-ring-offset": px(theme.input.switch.focusRing.offset),
|
|
4153
|
-
"--input-switch-focus-ring-width": px(theme.input.switch.focusRing.width),
|
|
4154
|
-
"--input-switch-height": px(theme.input.switch.height),
|
|
4155
|
-
"--input-switch-padding": px(theme.input.switch.padding),
|
|
4156
|
-
"--input-switch-transition-duration-ms": `${theme.input.switch.transitionDurationMs}ms`,
|
|
4157
|
-
"--input-switch-transition-timing-function": theme.input.switch.transitionTimingFunction,
|
|
4158
|
-
"--input-switch-width": px(theme.input.switch.width),
|
|
4159
|
-
"--input-text-focus-ring-offset": px(theme.input.text.focusRing.offset),
|
|
4160
|
-
"--input-text-focus-ring-width": px(theme.input.text.focusRing.width)
|
|
4161
|
-
};
|
|
4162
|
-
}
|
|
4163
|
-
function buildRadiusThemeProperties(theme) {
|
|
4164
|
-
return {
|
|
4165
|
-
"--radius-0": rem(theme.radius[0]),
|
|
4166
|
-
"--radius-1": rem(theme.radius[1]),
|
|
4167
|
-
"--radius-2": rem(theme.radius[2]),
|
|
4168
|
-
"--radius-3": rem(theme.radius[3]),
|
|
4169
|
-
"--radius-4": rem(theme.radius[4]),
|
|
4170
|
-
"--radius-5": rem(theme.radius[5]),
|
|
4171
|
-
"--radius-6": rem(theme.radius[6])
|
|
4172
|
-
};
|
|
4173
|
-
}
|
|
4174
|
-
function buildShadowThemeProperties(theme) {
|
|
4175
|
-
return {
|
|
4176
|
-
"--shadow-outline": `0 0 0 ${theme.card.shadow.outline}px`,
|
|
4177
|
-
"--shadow-0-umbra": toBoxShadow(theme.shadow[0]?.umbra),
|
|
4178
|
-
"--shadow-0-penumbra": toBoxShadow(theme.shadow[0]?.penumbra),
|
|
4179
|
-
"--shadow-0-ambient": toBoxShadow(theme.shadow[0]?.ambient),
|
|
4180
|
-
"--shadow-1-umbra": toBoxShadow(theme.shadow[1]?.umbra),
|
|
4181
|
-
"--shadow-1-penumbra": toBoxShadow(theme.shadow[1]?.penumbra),
|
|
4182
|
-
"--shadow-1-ambient": toBoxShadow(theme.shadow[1]?.ambient),
|
|
4183
|
-
"--shadow-2-umbra": toBoxShadow(theme.shadow[2]?.umbra),
|
|
4184
|
-
"--shadow-2-penumbra": toBoxShadow(theme.shadow[2]?.penumbra),
|
|
4185
|
-
"--shadow-2-ambient": toBoxShadow(theme.shadow[2]?.ambient),
|
|
4186
|
-
"--shadow-3-umbra": toBoxShadow(theme.shadow[3]?.umbra),
|
|
4187
|
-
"--shadow-3-penumbra": toBoxShadow(theme.shadow[3]?.penumbra),
|
|
4188
|
-
"--shadow-3-ambient": toBoxShadow(theme.shadow[3]?.ambient),
|
|
4189
|
-
"--shadow-4-umbra": toBoxShadow(theme.shadow[4]?.umbra),
|
|
4190
|
-
"--shadow-4-penumbra": toBoxShadow(theme.shadow[4]?.penumbra),
|
|
4191
|
-
"--shadow-4-ambient": toBoxShadow(theme.shadow[4]?.ambient),
|
|
4192
|
-
"--shadow-5-umbra": toBoxShadow(theme.shadow[5]?.umbra),
|
|
4193
|
-
"--shadow-5-penumbra": toBoxShadow(theme.shadow[5]?.penumbra),
|
|
4194
|
-
"--shadow-5-ambient": toBoxShadow(theme.shadow[5]?.ambient)
|
|
4195
|
-
};
|
|
4196
|
-
}
|
|
4197
|
-
function buildSpaceThemeProperties(theme) {
|
|
4198
|
-
return {
|
|
4199
|
-
"--space-0": rem(theme.space[0]),
|
|
4200
|
-
"--space-0_5": rem(theme.space[1] / 2),
|
|
4201
|
-
"--space-1": rem(theme.space[1]),
|
|
4202
|
-
"--space-2": rem(theme.space[2]),
|
|
4203
|
-
"--space-3": rem(theme.space[3]),
|
|
4204
|
-
"--space-4": rem(theme.space[4]),
|
|
4205
|
-
"--space-5": rem(theme.space[5]),
|
|
4206
|
-
"--space-6": rem(theme.space[6]),
|
|
4207
|
-
"--space-7": rem(theme.space[7]),
|
|
4208
|
-
"--space-8": rem(theme.space[8]),
|
|
4209
|
-
"--space-9": rem(theme.space[9])
|
|
4210
|
-
};
|
|
4211
|
-
}
|
|
4212
|
-
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4213
|
-
function buildColorThemeProperties(theme) {
|
|
4214
|
-
const props = {};
|
|
4215
|
-
for (const scheme of THEME_COLOR_SCHEMES)
|
|
4216
|
-
for (const cardTone of THEME_COLOR_CARD_TONES) {
|
|
4217
|
-
Object.assign(props, buildColorAvatarThemeProperties(theme, {
|
|
4218
|
-
scheme,
|
|
4219
|
-
cardTone
|
|
4220
|
-
})), Object.assign(props, buildColorCardThemeProperties(theme, {
|
|
4221
|
-
scheme,
|
|
4222
|
-
cardTone
|
|
4223
|
-
}));
|
|
4224
|
-
for (const colorVariant of THEME_COLOR_VARIANTS)
|
|
4225
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
4226
|
-
const tokens = theme._tokens.color[cardTone].variant[colorVariant][elementTone], prefix = `--color-${scheme}-${cardTone}-${colorVariant}-${elementTone}`, context = {
|
|
4227
|
-
bgVar: `${prefix}-bg-0`,
|
|
4228
|
-
hue: tokens._hue,
|
|
4229
|
-
scheme
|
|
4230
|
-
};
|
|
4231
|
-
Object.assign(props, {
|
|
4232
|
-
[`${prefix}-bg-0`]: renderColor(tokens.bg[0], context),
|
|
4233
|
-
[`${prefix}-bg-1`]: `color-mix(in srgb, var(${prefix}-bg-0), var(${prefix}-bg-4) 25%)`,
|
|
4234
|
-
[`${prefix}-bg-2`]: `color-mix(in srgb, var(${prefix}-bg-0), var(${prefix}-bg-4) 50%)`,
|
|
4235
|
-
[`${prefix}-bg-3`]: `color-mix(in srgb, var(${prefix}-bg-0), var(${prefix}-bg-4) 75%)`,
|
|
4236
|
-
[`${prefix}-bg-4`]: renderColor(tokens.bg[4], context),
|
|
4237
|
-
[`${prefix}-border-0`]: renderColor(tokens.border[0], context),
|
|
4238
|
-
[`${prefix}-border-1`]: `color-mix(in srgb, var(${prefix}-border-0), var(${prefix}-border-4) 25%)`,
|
|
4239
|
-
[`${prefix}-border-2`]: `color-mix(in srgb, var(${prefix}-border-0), var(${prefix}-border-4) 50%)`,
|
|
4240
|
-
[`${prefix}-border-3`]: `color-mix(in srgb, var(${prefix}-border-0), var(${prefix}-border-4) 75%)`,
|
|
4241
|
-
[`${prefix}-border-4`]: renderColor(tokens.border[4], context),
|
|
4242
|
-
[`${prefix}-fg-0`]: renderColor(tokens.fg[0], context),
|
|
4243
|
-
[`${prefix}-fg-1`]: `color-mix(in srgb, var(${prefix}-fg-0), var(${prefix}-fg-4) 25%)`,
|
|
4244
|
-
[`${prefix}-fg-2`]: `color-mix(in srgb, var(${prefix}-fg-0), var(${prefix}-fg-4) 50%)`,
|
|
4245
|
-
[`${prefix}-fg-3`]: `color-mix(in srgb, var(${prefix}-fg-0), var(${prefix}-fg-4) 75%)`,
|
|
4246
|
-
[`${prefix}-fg-4`]: renderColor(tokens.fg[4], context)
|
|
4247
|
-
});
|
|
4248
|
-
}
|
|
4249
|
-
}
|
|
4250
|
-
return props;
|
|
4251
|
-
}
|
|
4252
|
-
function buildColorAvatarThemeProperties(theme, options) {
|
|
4253
|
-
const {
|
|
4254
|
-
scheme,
|
|
4255
|
-
cardTone
|
|
4256
|
-
} = options, tokens = theme._tokens.color[cardTone], prefix = `--color-${scheme}-${cardTone}`, props = {};
|
|
4257
|
-
for (const hue of HUES) {
|
|
4258
|
-
const context = {
|
|
4259
|
-
bgVar: `${prefix}-bg-0`,
|
|
4260
|
-
hue: tokens.avatar[hue]._hue ?? hue,
|
|
4261
|
-
scheme
|
|
4262
|
-
};
|
|
4263
|
-
Object.assign(props, {
|
|
4264
|
-
[`${prefix}-avatar-${hue}-bg`]: renderColor(tokens.avatar[hue].bg, context),
|
|
4265
|
-
[`${prefix}-avatar-${hue}-fg`]: renderColor(tokens.avatar[hue].fg, context)
|
|
4266
|
-
});
|
|
4267
|
-
}
|
|
4268
|
-
return props;
|
|
4269
|
-
}
|
|
4270
|
-
function buildColorCardThemeProperties(theme, options) {
|
|
4271
|
-
const {
|
|
4272
|
-
scheme,
|
|
4273
|
-
cardTone
|
|
4274
|
-
} = options, tokens = theme._tokens.color[cardTone], prefix = `--color-${scheme}-${cardTone}`, context = {
|
|
4275
|
-
bgVar: `${prefix}-bg-0`,
|
|
4276
|
-
hue: tokens._hue,
|
|
4277
|
-
scheme
|
|
4278
|
-
};
|
|
4279
|
-
return {
|
|
4280
|
-
[`${prefix}-backdrop`]: renderColor(tokens.backdrop, context),
|
|
4281
|
-
[`${prefix}-focus-ring`]: renderColor(tokens.focusRing, context),
|
|
4282
|
-
[`${prefix}-link-fg`]: renderColor(tokens.link.fg, context),
|
|
4283
|
-
[`${prefix}-shadow-outline`]: renderColor(tokens.shadow.outline, context),
|
|
4284
|
-
[`${prefix}-shadow-umbra`]: renderColor(tokens.shadow.umbra, context),
|
|
4285
|
-
[`${prefix}-shadow-penumbra`]: renderColor(tokens.shadow.penumbra, context),
|
|
4286
|
-
[`${prefix}-shadow-ambient`]: renderColor(tokens.shadow.ambient, context),
|
|
4287
|
-
[`${prefix}-token-atrule`]: renderColor(tokens.token.atrule, context),
|
|
4288
|
-
[`${prefix}-token-attr-name`]: renderColor(tokens.token.attrName, context),
|
|
4289
|
-
[`${prefix}-token-attr-value`]: renderColor(tokens.token.attrValue, context),
|
|
4290
|
-
[`${prefix}-token-attribute`]: renderColor(tokens.token.attribute, context),
|
|
4291
|
-
[`${prefix}-token-boolean`]: renderColor(tokens.token.boolean, context),
|
|
4292
|
-
[`${prefix}-token-builtin`]: renderColor(tokens.token.builtin, context),
|
|
4293
|
-
[`${prefix}-token-cdata`]: renderColor(tokens.token.cdata, context),
|
|
4294
|
-
[`${prefix}-token-char`]: renderColor(tokens.token.char, context),
|
|
4295
|
-
[`${prefix}-token-class-name`]: renderColor(tokens.token.className, context),
|
|
4296
|
-
[`${prefix}-token-class`]: renderColor(tokens.token.class, context),
|
|
4297
|
-
[`${prefix}-token-comment`]: renderColor(tokens.token.comment, context),
|
|
4298
|
-
[`${prefix}-token-constant`]: renderColor(tokens.token.constant, context),
|
|
4299
|
-
[`${prefix}-token-deleted`]: renderColor(tokens.token.deleted, context),
|
|
4300
|
-
[`${prefix}-token-doctype`]: renderColor(tokens.token.doctype, context),
|
|
4301
|
-
[`${prefix}-token-entity`]: renderColor(tokens.token.entity, context),
|
|
4302
|
-
[`${prefix}-token-function`]: renderColor(tokens.token.function, context),
|
|
4303
|
-
[`${prefix}-token-hexcode`]: renderColor(tokens.token.hexcode, context),
|
|
4304
|
-
[`${prefix}-token-id`]: renderColor(tokens.token.id, context),
|
|
4305
|
-
[`${prefix}-token-important`]: renderColor(tokens.token.important, context),
|
|
4306
|
-
[`${prefix}-token-inserted`]: renderColor(tokens.token.inserted, context),
|
|
4307
|
-
[`${prefix}-token-keyword`]: renderColor(tokens.token.keyword, context),
|
|
4308
|
-
[`${prefix}-token-number`]: renderColor(tokens.token.number, context),
|
|
4309
|
-
[`${prefix}-token-operator`]: renderColor(tokens.token.operator, context),
|
|
4310
|
-
[`${prefix}-token-prolog`]: renderColor(tokens.token.prolog, context),
|
|
4311
|
-
[`${prefix}-token-property`]: renderColor(tokens.token.property, context),
|
|
4312
|
-
[`${prefix}-token-pseudo-class`]: renderColor(tokens.token.pseudoClass, context),
|
|
4313
|
-
[`${prefix}-token-pseudo-eelement`]: renderColor(tokens.token.pseudoElement, context),
|
|
4314
|
-
[`${prefix}-token-punctuation`]: renderColor(tokens.token.punctuation, context),
|
|
4315
|
-
[`${prefix}-token-regex`]: renderColor(tokens.token.regex, context),
|
|
4316
|
-
[`${prefix}-token-selector`]: renderColor(tokens.token.selector, context),
|
|
4317
|
-
[`${prefix}-token-string`]: renderColor(tokens.token.string, context),
|
|
4318
|
-
[`${prefix}-token-symbol`]: renderColor(tokens.token.symbol, context),
|
|
4319
|
-
[`${prefix}-token-tag`]: renderColor(tokens.token.tag, context),
|
|
4320
|
-
[`${prefix}-token-unit`]: renderColor(tokens.token.unit, context),
|
|
4321
|
-
[`${prefix}-token-url`]: renderColor(tokens.token.url, context),
|
|
4322
|
-
[`${prefix}-token-variable`]: renderColor(tokens.token.variable, context)
|
|
4323
|
-
};
|
|
4324
|
-
}
|
|
4325
|
-
function compileTheme(theme) {
|
|
4326
|
-
return theme.v3 ? compileTheme_v3(theme.v3) : theme.v2 ? `/* v2 - not supported */
|
|
4327
|
-
` : `/* v0 - not supported */
|
|
4328
|
-
`;
|
|
4329
|
-
}
|
|
4330
|
-
function composeClassNames(...classNames) {
|
|
4331
|
-
return unique(classNames.map((n) => typeof n == "string" && n.trim()).filter(Boolean)).join(" ") || void 0;
|
|
4332
|
-
}
|
|
4333
|
-
function unique(array) {
|
|
4334
|
-
return Array.from(new Set(array));
|
|
4335
|
-
}
|
|
4336
|
-
function breadcrumbs() {
|
|
4337
|
-
return composeClassNames("breadcrumbs");
|
|
4338
|
-
}
|
|
4339
|
-
function dialog() {
|
|
4340
|
-
return composeClassNames("dialog");
|
|
4341
|
-
}
|
|
4342
|
-
function dialogContainer() {
|
|
4343
|
-
return composeClassNames("dialog-container");
|
|
4344
|
-
}
|
|
4345
|
-
function dialogCardRoot() {
|
|
4346
|
-
return composeClassNames("dialog-card-root");
|
|
4347
|
-
}
|
|
4348
|
-
function dialogLayout() {
|
|
4349
|
-
return composeClassNames("dialog-layout");
|
|
4350
|
-
}
|
|
4351
|
-
function dialogHeader() {
|
|
4352
|
-
return composeClassNames("dialog-header");
|
|
4353
|
-
}
|
|
4354
|
-
function dialogContent() {
|
|
4355
|
-
return composeClassNames("dialog-content");
|
|
4356
|
-
}
|
|
4357
|
-
function dialogFooter() {
|
|
4358
|
-
return composeClassNames("dialog-footer");
|
|
4359
|
-
}
|
|
4360
|
-
function menu() {
|
|
4361
|
-
return composeClassNames("menu");
|
|
4362
|
-
}
|
|
4363
|
-
function menuDivider() {
|
|
4364
|
-
return composeClassNames("menu-divider");
|
|
4365
|
-
}
|
|
4366
|
-
function _resp(prefix, prop) {
|
|
4367
|
-
if (!(prop === void 0 || prop === !1))
|
|
4368
|
-
return Array.isArray(prop) ? prop.map((value, index) => {
|
|
4369
|
-
if (value === void 0 || typeof prop == "boolean" && prop === !1) return;
|
|
4370
|
-
const className = (typeof value == "boolean" ? [prefix] : [prefix, value]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
4371
|
-
return index === 0 ? `${className}` : `_${index}:${className}`;
|
|
4372
|
-
}).filter(Boolean).join(" ") : (typeof prop == "boolean" ? [prefix] : [prefix, prop]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
4373
|
-
}
|
|
4374
|
-
function radius(props) {
|
|
4375
|
-
return composeClassNames(_resp("r", props.radius));
|
|
4376
|
-
}
|
|
4377
|
-
function skeleton(props) {
|
|
4378
|
-
return composeClassNames("skeleton", radius(props));
|
|
4379
|
-
}
|
|
4380
|
-
function codeSkeleton(props) {
|
|
4381
|
-
return composeClassNames("font-skeleton", _resp("code-skeleton", props.size));
|
|
4382
|
-
}
|
|
4383
|
-
function headingSkeleton(props) {
|
|
4384
|
-
return composeClassNames("font-skeleton", _resp("heading-skeleton", props.size));
|
|
4385
|
-
}
|
|
4386
|
-
function labelSkeleton(props) {
|
|
4387
|
-
return composeClassNames("font-skeleton", _resp("label-skeleton", props.size));
|
|
4388
|
-
}
|
|
4389
|
-
function textSkeleton(props) {
|
|
4390
|
-
return composeClassNames("font-skeleton", _resp("text-skeleton", props.size));
|
|
4391
|
-
}
|
|
4392
|
-
function toastLayer() {
|
|
4393
|
-
return composeClassNames("toast-layer");
|
|
4394
|
-
}
|
|
4395
|
-
function toast() {
|
|
4396
|
-
return composeClassNames("toast");
|
|
4397
|
-
}
|
|
4398
|
-
function toastLoadingBar() {
|
|
4399
|
-
return composeClassNames("toast-loading-bar");
|
|
4400
|
-
}
|
|
4401
|
-
function toastLoadingBarProgress() {
|
|
4402
|
-
return composeClassNames("toast-loading-bar-progress");
|
|
4403
|
-
}
|
|
4404
|
-
function toastLoadingBarMask() {
|
|
4405
|
-
return composeClassNames("toast-loading-bar-mask");
|
|
4406
|
-
}
|
|
4407
|
-
function treeItem() {
|
|
4408
|
-
return composeClassNames("tree-item");
|
|
4409
|
-
}
|
|
4410
|
-
function _arrow() {
|
|
4411
|
-
return composeClassNames("arrow");
|
|
4412
|
-
}
|
|
4413
|
-
function _arrowStroke() {
|
|
4414
|
-
return "arrow-stroke";
|
|
4415
|
-
}
|
|
4416
|
-
function _arrowShape() {
|
|
4417
|
-
return "arrow-shape";
|
|
4418
|
-
}
|
|
4419
|
-
const prefixes$2 = {
|
|
4420
|
-
border: "border",
|
|
4421
|
-
borderTop: "border-t",
|
|
4422
|
-
borderRight: "border-r",
|
|
4423
|
-
borderBottom: "border-b",
|
|
4424
|
-
borderLeft: "border-l"
|
|
4425
|
-
};
|
|
4426
|
-
function border(props) {
|
|
4427
|
-
return composeClassNames(_resp(prefixes$2.border, props.border), _resp(prefixes$2.borderTop, props.borderTop), _resp(prefixes$2.borderRight, props.borderRight), _resp(prefixes$2.borderBottom, props.borderBottom), _resp(prefixes$2.borderLeft, props.borderLeft));
|
|
4428
|
-
}
|
|
4429
|
-
function display(props) {
|
|
4430
|
-
return composeClassNames(_resp(void 0, props.display));
|
|
4431
|
-
}
|
|
4432
|
-
const prefixes$1 = {
|
|
4433
|
-
align: "align",
|
|
4434
|
-
// `flex-align`
|
|
4435
|
-
direction: void 0,
|
|
4436
|
-
// `
|
|
4437
|
-
justify: "justify",
|
|
4438
|
-
// `flex-justify`
|
|
4439
|
-
wrap: "wrap"
|
|
4440
|
-
// `flex-wrap`
|
|
4441
|
-
};
|
|
4442
|
-
function flex(props) {
|
|
4443
|
-
return composeClassNames(_resp(prefixes$1.align, props.align), _resp(prefixes$1.direction, props.direction), _resp(prefixes$1.justify, props.justify), _resp(prefixes$1.wrap, props.wrap));
|
|
4444
|
-
}
|
|
4445
|
-
function flexItem(props) {
|
|
4446
|
-
return composeClassNames(_resp("flex", props.flex));
|
|
4447
|
-
}
|
|
4448
|
-
const prefixes = {
|
|
4449
|
-
align: "text-align",
|
|
4450
|
-
weight: "font"
|
|
4451
|
-
};
|
|
4452
|
-
function font(props) {
|
|
4453
|
-
return composeClassNames("font", props.weight && `${prefixes.weight}-${props.weight}`, _resp(prefixes.align, props.align));
|
|
4454
|
-
}
|
|
4455
|
-
function gap(props) {
|
|
4456
|
-
return composeClassNames(_resp("g", props.gap), _resp("gx", props.gapX), _resp("gy", props.gapY));
|
|
4457
|
-
}
|
|
4458
|
-
function grid(props) {
|
|
4459
|
-
return composeClassNames(_resp("auto-cols", props.autoCols), _resp("auto-rows", props.autoRows), _resp("auto-flow", props.autoFlow), _resp("columns", props.columns), _resp("rows", props.rows));
|
|
4460
|
-
}
|
|
4461
|
-
function gridItem(props) {
|
|
4462
|
-
return composeClassNames(_resp("col", props.column), _resp("col-start", props.columnStart), _resp("col-end", props.columnEnd), _resp("row", props.row), _resp("row-start", props.rowStart), _resp("row-end", props.rowEnd));
|
|
4463
|
-
}
|
|
4464
|
-
function inset(props) {
|
|
4465
|
-
return composeClassNames(_resp("inset", props.inset), _resp("top", props.insetTop), _resp("right", props.insetRight), _resp("bottom", props.insetBottom), _resp("left", props.insetLeft));
|
|
4466
|
-
}
|
|
4467
|
-
function margin(props) {
|
|
4468
|
-
return composeClassNames(_resp("m", props.margin), _resp("mx", props.marginX), _resp("my", props.marginY), _resp("mt", props.marginTop), _resp("mr", props.marginRight), _resp("mb", props.marginBottom), _resp("ml", props.marginLeft));
|
|
4469
|
-
}
|
|
4470
|
-
function maxWidth(props) {
|
|
4471
|
-
return _resp("max-w", props.maxWidth) ?? "";
|
|
4472
|
-
}
|
|
4473
|
-
function overflow(props) {
|
|
4474
|
-
return composeClassNames(_resp("overflow", props.overflow), _resp("overflow-x", props.overflowX), _resp("overflow-y", props.overflowY));
|
|
4475
|
-
}
|
|
4476
|
-
function padding(props) {
|
|
4477
|
-
return composeClassNames(_resp("p", props.padding), _resp("px", props.paddingX), _resp("py", props.paddingY), _resp("pt", props.paddingTop), _resp("pr", props.paddingRight), _resp("pb", props.paddingBottom), _resp("pl", props.paddingLeft));
|
|
4478
|
-
}
|
|
4479
|
-
function pointerEvents(props) {
|
|
4480
|
-
return composeClassNames(props.pointerEvents && `pointer-events-${props.pointerEvents}`);
|
|
4481
|
-
}
|
|
4482
|
-
function position(props) {
|
|
4483
|
-
return composeClassNames(_resp("pos", props.position));
|
|
4484
|
-
}
|
|
4485
|
-
function shadow(props) {
|
|
4486
|
-
return composeClassNames(_resp("shadow", props.shadow));
|
|
4487
|
-
}
|
|
4488
|
-
function textOverflow(props) {
|
|
4489
|
-
return composeClassNames(props.textOverflow && `text-overflow-${props.textOverflow}`);
|
|
4490
|
-
}
|
|
4491
|
-
function width(props) {
|
|
4492
|
-
return _resp("w", props.width) ?? "";
|
|
4493
|
-
}
|
|
4494
|
-
function _input(props) {
|
|
4495
|
-
return composeClassNames("input", _resp("input", props.fontSize), props.border && "input-b", _resp("input-p", props.padding), _resp("input-g", props.gap), radius(props), width(props));
|
|
4496
|
-
}
|
|
4497
|
-
function _inputElement() {
|
|
4498
|
-
return "input-element";
|
|
4499
|
-
}
|
|
4500
|
-
function _inputPresentation() {
|
|
4501
|
-
return "input-presentation";
|
|
4502
|
-
}
|
|
4503
|
-
function _selectable(props) {
|
|
4504
|
-
return composeClassNames("selectable", toneMap$2[props.tone ?? "default"], radius(props));
|
|
4505
|
-
}
|
|
4506
|
-
function avatar(props) {
|
|
4507
|
-
return composeClassNames("avatar", props.color || "gray", _resp("avatar", props.size));
|
|
4508
|
-
}
|
|
4509
|
-
function avatarArrow() {
|
|
4510
|
-
return composeClassNames("avatar-arrow");
|
|
4511
|
-
}
|
|
4512
|
-
function avatarInitials() {
|
|
4513
|
-
return composeClassNames("avatar-initials");
|
|
4514
|
-
}
|
|
4515
|
-
function avatarImage() {
|
|
4516
|
-
return composeClassNames("avatar-image");
|
|
4517
|
-
}
|
|
4518
|
-
function avatarCounter(props) {
|
|
4519
|
-
return composeClassNames("avatar-counter", _resp("avatar", props.size));
|
|
4520
|
-
}
|
|
4521
|
-
function avatarStack(props) {
|
|
4522
|
-
return composeClassNames("avatar-stack", _resp("avatar", props.size));
|
|
4523
|
-
}
|
|
4524
|
-
function badge(props) {
|
|
4525
|
-
return composeClassNames("badge", props.tone && `badge-${props.tone}`, radius(props));
|
|
4526
|
-
}
|
|
4527
|
-
function box(props) {
|
|
4528
|
-
return composeClassNames("box", props.muted && "muted", border(props), display(props), _resp("h", props.height), _resp("box", props.sizing), flex(props), flexItem(props), grid(props), gridItem(props), gap(props), inset(props), margin(props), maxWidth(props), props.outline && `outline-${props.outline}`, overflow(props), padding(props), pointerEvents(props), position(props), radius(props), width(props));
|
|
4529
|
-
}
|
|
4530
|
-
function button(props) {
|
|
4531
|
-
const {
|
|
4532
|
-
mode,
|
|
4533
|
-
tone
|
|
4534
|
-
} = props;
|
|
4535
|
-
return composeClassNames("button", variantMap[mode ?? "default"], toneMap$1[tone ?? "default"], display(props), flexItem(props), radius(props), width(props));
|
|
4536
|
-
}
|
|
4537
|
-
function buttonLoadingBox() {
|
|
4538
|
-
return "button-loading-box";
|
|
4539
|
-
}
|
|
4540
|
-
function card(props) {
|
|
4541
|
-
return composeClassNames(props.scheme, toneMap[props.tone ?? "inherit"], "card", props.checkered && "card-checkered", box(props), shadow(props));
|
|
4542
|
-
}
|
|
4543
|
-
function checkbox() {
|
|
4544
|
-
return composeClassNames("checkbox");
|
|
4545
|
-
}
|
|
4546
|
-
function checkboxInput() {
|
|
4547
|
-
return composeClassNames("checkbox-input");
|
|
4548
|
-
}
|
|
4549
|
-
function code(props) {
|
|
4550
|
-
return composeClassNames("code", "block", font(props), _resp("code", props.size));
|
|
4551
|
-
}
|
|
4552
|
-
function container(props) {
|
|
4553
|
-
return composeClassNames("container", maxWidth({
|
|
4554
|
-
maxWidth: props.width
|
|
4555
|
-
}));
|
|
4556
|
-
}
|
|
4557
|
-
function heading(props) {
|
|
4558
|
-
return composeClassNames("heading", "block", flexItem(props), font(props), props.accent && "heading-accent", props.muted && "heading-muted", _resp("heading", props.size));
|
|
4559
|
-
}
|
|
4560
|
-
function kbd(props) {
|
|
4561
|
-
return composeClassNames("kbd", radius(props));
|
|
4562
|
-
}
|
|
4563
|
-
function label(props) {
|
|
4564
|
-
return composeClassNames("label", "block", font(props), props.accent && "label-accent", props.muted && "label-muted", _resp("label", props.size));
|
|
4565
|
-
}
|
|
4566
|
-
function popover() {
|
|
4567
|
-
return composeClassNames("popover");
|
|
4568
|
-
}
|
|
4569
|
-
function radio() {
|
|
4570
|
-
return composeClassNames("radio");
|
|
4571
|
-
}
|
|
4572
|
-
function select(props) {
|
|
4573
|
-
return composeClassNames("select", _input(props));
|
|
4574
|
-
}
|
|
4575
|
-
function selectPresentation() {
|
|
4576
|
-
return composeClassNames("select-presentation", _inputPresentation());
|
|
4577
|
-
}
|
|
4578
|
-
function spinner() {
|
|
4579
|
-
return composeClassNames("spinner");
|
|
4580
|
-
}
|
|
4581
|
-
function animatedSpinnerIcon() {
|
|
4582
|
-
return composeClassNames("animated-spinner-icon");
|
|
4583
|
-
}
|
|
4584
|
-
function _switch() {
|
|
4585
|
-
return composeClassNames("switch");
|
|
4586
|
-
}
|
|
4587
|
-
function _switchElement() {
|
|
4588
|
-
return composeClassNames("switch-element");
|
|
4589
|
-
}
|
|
4590
|
-
function _switchPresentation() {
|
|
4591
|
-
return composeClassNames("switch-presentation");
|
|
4592
|
-
}
|
|
4593
|
-
function _switchThumb() {
|
|
4594
|
-
return composeClassNames("switch-thumb");
|
|
4595
|
-
}
|
|
4596
|
-
function _switchTrack() {
|
|
4597
|
-
return composeClassNames("switch-track");
|
|
4598
|
-
}
|
|
4599
|
-
function text(props) {
|
|
4600
|
-
return composeClassNames("text", "block", flexItem(props), font(props), props.accent && "text-accent", props.muted && "text-muted", _resp("text", props.size));
|
|
4601
|
-
}
|
|
4602
|
-
function textArea(props) {
|
|
4603
|
-
return composeClassNames("text-area", _input(props));
|
|
4604
|
-
}
|
|
4605
|
-
function textInput(props) {
|
|
4606
|
-
return composeClassNames(_input(props), "text-input");
|
|
4607
|
-
}
|
|
4608
|
-
function tooltip() {
|
|
4609
|
-
return composeClassNames("tooltip");
|
|
4610
|
-
}
|
|
4611
|
-
function tooltipCard() {
|
|
4612
|
-
return composeClassNames("tooltip-card");
|
|
4613
|
-
}
|
|
4614
|
-
function srOnly() {
|
|
4615
|
-
return composeClassNames("sr-only");
|
|
4616
|
-
}
|
|
4617
|
-
export {
|
|
4618
|
-
_arrow,
|
|
4619
|
-
_arrowShape,
|
|
4620
|
-
_arrowStroke,
|
|
4621
|
-
_input,
|
|
4622
|
-
_inputElement,
|
|
4623
|
-
_inputPresentation,
|
|
4624
|
-
_selectable,
|
|
4625
|
-
_switch,
|
|
4626
|
-
_switchElement,
|
|
4627
|
-
_switchPresentation,
|
|
4628
|
-
_switchThumb,
|
|
4629
|
-
_switchTrack,
|
|
4630
|
-
animatedSpinnerIcon,
|
|
4631
|
-
avatar,
|
|
4632
|
-
avatarArrow,
|
|
4633
|
-
avatarCounter,
|
|
4634
|
-
avatarImage,
|
|
4635
|
-
avatarInitials,
|
|
4636
|
-
avatarStack,
|
|
4637
|
-
badge,
|
|
4638
|
-
border,
|
|
4639
|
-
box,
|
|
4640
|
-
breadcrumbs,
|
|
4641
|
-
button,
|
|
4642
|
-
buttonLoadingBox,
|
|
4643
|
-
card,
|
|
4644
|
-
checkbox,
|
|
4645
|
-
checkboxInput,
|
|
4646
|
-
code,
|
|
4647
|
-
codeSkeleton,
|
|
4648
|
-
compilePalette,
|
|
4649
|
-
compileSystem,
|
|
4650
|
-
compileTheme,
|
|
4651
|
-
composeClassNames,
|
|
4652
|
-
container,
|
|
4653
|
-
dialog,
|
|
4654
|
-
dialogCardRoot,
|
|
4655
|
-
dialogContainer,
|
|
4656
|
-
dialogContent,
|
|
4657
|
-
dialogFooter,
|
|
4658
|
-
dialogHeader,
|
|
4659
|
-
dialogLayout,
|
|
4660
|
-
display,
|
|
4661
|
-
flex,
|
|
4662
|
-
flexItem,
|
|
4663
|
-
font,
|
|
4664
|
-
gap,
|
|
4665
|
-
grid,
|
|
4666
|
-
gridItem,
|
|
4667
|
-
heading,
|
|
4668
|
-
headingSkeleton,
|
|
4669
|
-
inset,
|
|
4670
|
-
isArray,
|
|
4671
|
-
isRecord,
|
|
4672
|
-
kbd,
|
|
4673
|
-
label,
|
|
4674
|
-
labelSkeleton,
|
|
4675
|
-
margin,
|
|
4676
|
-
maxWidth,
|
|
4677
|
-
menu,
|
|
4678
|
-
menuDivider,
|
|
4679
|
-
overflow,
|
|
4680
|
-
padding,
|
|
4681
|
-
pointerEvents,
|
|
4682
|
-
popover,
|
|
4683
|
-
position,
|
|
4684
|
-
px,
|
|
4685
|
-
radio,
|
|
4686
|
-
radius,
|
|
4687
|
-
rem,
|
|
4688
|
-
select,
|
|
4689
|
-
selectPresentation,
|
|
4690
|
-
shadow,
|
|
4691
|
-
skeleton,
|
|
4692
|
-
spinner,
|
|
4693
|
-
srOnly,
|
|
4694
|
-
text,
|
|
4695
|
-
textArea,
|
|
4696
|
-
textInput,
|
|
4697
|
-
textOverflow,
|
|
4698
|
-
textSkeleton,
|
|
4699
|
-
toBoxShadow,
|
|
4700
|
-
toast,
|
|
4701
|
-
toastLayer,
|
|
4702
|
-
toastLoadingBar,
|
|
4703
|
-
toastLoadingBarMask,
|
|
4704
|
-
toastLoadingBarProgress,
|
|
4705
|
-
tooltip,
|
|
4706
|
-
tooltipCard,
|
|
4707
|
-
treeItem,
|
|
4708
|
-
v3_v2,
|
|
4709
|
-
varNames,
|
|
4710
|
-
vars,
|
|
4711
|
-
width
|
|
4712
|
-
};
|
|
4713
|
-
//# sourceMappingURL=css.mjs.map
|