@sanity/ui 2.10.0-corel.0 → 3.0.0-static.1
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/bin/ui.js +6 -0
- package/dist/_chunks-cjs/buildCommand.js +3542 -0
- package/dist/_chunks-cjs/buildCommand.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +25 -0
- package/dist/cli.js.map +1 -0
- package/dist/css.d.mts +1062 -0
- package/dist/css.d.ts +1062 -0
- package/dist/css.esm.js +3794 -0
- package/dist/css.esm.js.map +1 -0
- package/dist/css.js +3794 -0
- package/dist/css.js.map +1 -0
- package/dist/css.mjs +3794 -0
- package/dist/css.mjs.map +1 -0
- package/dist/index.d.mts +240 -221
- package/dist/index.d.ts +240 -221
- package/dist/index.esm.js +3033 -4536
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3037 -4541
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3033 -4536
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +25 -0
- package/dist/system.css +3385 -0
- package/dist/theme.d.mts +84 -22
- package/dist/theme.d.ts +84 -22
- package/dist/theme.esm.js +1718 -656
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +1757 -693
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1718 -656
- package/dist/theme.mjs.map +1 -1
- package/exports/css.ts +1 -0
- package/package.json +45 -24
- package/src/core/__workshop__/constants.ts +28 -19
- package/src/core/_compat/index.ts +2 -0
- package/src/core/{styles → _compat/styles}/border/borderStyle.ts +6 -0
- package/src/core/{styles → _compat/styles}/border/types.ts +1 -0
- package/src/core/{styles → _compat/styles}/box/boxStyle.ts +7 -1
- package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -10
- package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
- package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -18
- package/src/core/{styles → _compat/styles}/flex/types.ts +1 -3
- package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -10
- package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/helpers.ts +10 -1
- package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
- package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
- package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
- package/src/core/components/autocomplete/autocomplete.tsx +17 -9
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
- package/src/core/components/dialog/__workshop__/props.tsx +2 -0
- package/src/core/components/dialog/dialog.tsx +73 -92
- package/src/core/components/hotkeys/hotkeys.tsx +18 -29
- package/src/core/components/menu/menu.tsx +13 -12
- package/src/core/components/menu/menuDivider.tsx +16 -0
- package/src/core/components/menu/menuGroup.tsx +10 -8
- package/src/core/components/menu/menuItem.tsx +23 -14
- package/src/core/components/skeleton/skeleton.tsx +14 -20
- package/src/core/components/skeleton/textSkeleton.tsx +72 -48
- package/src/core/components/tab/tab.tsx +5 -7
- package/src/core/components/tab/tabList.tsx +5 -21
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/toast.tsx +31 -16
- package/src/core/components/toast/toastProvider.tsx +23 -23
- package/src/core/components/tree/tree.tsx +7 -2
- package/src/core/components/tree/treeGroup.tsx +4 -1
- package/src/core/components/tree/treeItem.tsx +44 -35
- package/src/core/components/tree/types.ts +5 -1
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/index.ts +0 -1
- package/src/core/lib/styled/elements.ts +135 -0
- package/src/core/lib/styled/index.ts +2 -0
- package/src/core/lib/styled/members.ts +15 -0
- package/src/core/lib/styled/styled.ts +79 -0
- package/src/core/primitives/_selectable/selectable.tsx +27 -14
- package/src/core/primitives/avatar/avatar.tsx +38 -39
- package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/avatar/styles.ts +2 -2
- package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
- package/src/core/primitives/badge/badge.tsx +18 -20
- package/src/core/primitives/box/box.tsx +65 -74
- package/src/core/primitives/button/__workshop__/props.tsx +5 -2
- package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
- package/src/core/primitives/button/button.tsx +38 -45
- package/src/core/primitives/button/styles.ts +5 -5
- package/src/core/primitives/card/RootCardContext.ts +3 -0
- package/src/core/primitives/card/__workshop__/props.tsx +2 -2
- package/src/core/primitives/card/card.tsx +37 -42
- package/src/core/primitives/checkbox/checkbox.tsx +6 -8
- package/src/core/primitives/code/code.tsx +22 -13
- package/src/core/primitives/code/styles.ts +1 -1
- package/src/core/primitives/container/container.tsx +7 -15
- package/src/core/primitives/container/styles.ts +1 -1
- package/src/core/primitives/flex/flex.tsx +6 -31
- package/src/core/primitives/grid/grid.tsx +6 -19
- package/src/core/primitives/heading/heading.tsx +24 -28
- package/src/core/primitives/heading/styles.ts +2 -2
- package/src/core/primitives/inline/inline.tsx +18 -18
- package/src/core/primitives/inline/styles.ts +1 -1
- package/src/core/primitives/kbd/kbd.tsx +30 -37
- package/src/core/primitives/label/label.tsx +15 -9
- package/src/core/primitives/label/styles.ts +2 -2
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
- package/src/core/primitives/popover/popover.tsx +21 -15
- package/src/core/primitives/popover/popoverCard.tsx +36 -38
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +3 -3
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +3 -3
- package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
- package/src/core/primitives/spinner/spinner.tsx +8 -22
- package/src/core/primitives/stack/stack.tsx +12 -10
- package/src/core/primitives/stack/styles.ts +1 -1
- package/src/core/primitives/switch/styles.ts +11 -11
- package/src/core/primitives/switch/switch.tsx +20 -21
- package/src/core/primitives/text/styles.ts +2 -3
- package/src/core/primitives/text/text.tsx +18 -25
- package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/textArea/textArea.tsx +3 -3
- package/src/core/primitives/textInput/__workshop__/plain.tsx +4 -3
- package/src/core/primitives/textInput/textInput.tsx +111 -125
- package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.tsx +13 -13
- package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
- package/src/core/primitives/types.ts +36 -16
- package/src/core/theme/__workshop__/build/story.tsx +2 -4
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/types/avatar.ts +6 -1
- package/src/core/types/box.ts +22 -16
- package/src/core/types/button.ts +1 -0
- package/src/core/types/flex.ts +27 -26
- package/src/core/types/grid.ts +17 -12
- package/src/core/types/gridItem.ts +32 -24
- package/src/core/types/radius.ts +7 -4
- package/src/core/types/text.ts +7 -4
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +28 -11
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/_resp.ts +28 -0
- package/src/css/cli/buildCommand.ts +36 -0
- package/src/css/cli/index.ts +38 -0
- package/src/css/compile/compileRule.ts +58 -0
- package/src/css/compile/compileRules.ts +56 -0
- package/src/css/compile/compileSystem.ts +7 -0
- package/src/css/compile/compileTheme.ts +512 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
- package/src/css/components/breadcrumbs/index.ts +1 -0
- package/src/css/components/breadcrumbs/rules.ts +25 -0
- package/src/css/components/dialog/classes.ts +29 -0
- package/src/css/components/dialog/index.ts +1 -0
- package/src/css/components/dialog/rules.ts +75 -0
- package/src/css/components/menu/index.ts +1 -0
- package/src/css/components/menu/menu.ts +5 -0
- package/src/css/components/menu/rules.ts +10 -0
- package/src/css/components/skeleton/index.ts +2 -0
- package/src/css/components/skeleton/rules.ts +106 -0
- package/src/css/components/skeleton/skeleton.ts +31 -0
- package/src/css/components/skeleton/types.ts +24 -0
- package/src/css/components/toast/rules.ts +68 -0
- package/src/css/components/tree/index.ts +1 -0
- package/src/css/components/tree/rules.ts +167 -0
- package/src/css/components/tree/tree.ts +5 -0
- package/src/css/composeClassNames.ts +3 -0
- package/src/css/index.ts +51 -0
- package/src/css/primitives/avatar/avatar.ts +32 -0
- package/src/css/primitives/avatar/index.ts +2 -0
- package/src/css/primitives/avatar/rules.ts +190 -0
- package/src/css/primitives/avatar/types.ts +9 -0
- package/src/css/primitives/badge/badge.ts +8 -0
- package/src/css/primitives/badge/index.ts +2 -0
- package/src/css/primitives/badge/rules.ts +25 -0
- package/src/css/primitives/badge/types.ts +8 -0
- package/src/css/primitives/box/box.ts +38 -0
- package/src/css/primitives/box/index.ts +2 -0
- package/src/css/primitives/box/rules.ts +25 -0
- package/src/css/primitives/box/types.ts +48 -0
- package/src/css/primitives/button/button.ts +26 -0
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/rules.ts +58 -0
- package/src/css/primitives/card/card.ts +21 -0
- package/src/css/primitives/card/index.ts +1 -0
- package/src/css/primitives/card/rules.ts +241 -0
- package/src/css/primitives/checkbox/__styles.ts +129 -0
- package/src/css/primitives/checkbox/checkbox.ts +9 -0
- package/src/css/primitives/checkbox/index.ts +1 -0
- package/src/css/primitives/checkbox/rules.ts +136 -0
- package/src/css/primitives/code/code.ts +9 -0
- package/src/css/primitives/code/index.ts +2 -0
- package/src/css/primitives/code/rules.ts +71 -0
- package/src/css/primitives/code/types.ts +10 -0
- package/src/css/primitives/container/container.ts +7 -0
- package/src/css/primitives/container/index.ts +2 -0
- package/src/css/primitives/container/rules.ts +8 -0
- package/src/css/primitives/container/types.ts +6 -0
- package/src/css/primitives/heading/heading.ts +16 -0
- package/src/css/primitives/heading/index.ts +2 -0
- package/src/css/primitives/heading/rules.ts +84 -0
- package/src/css/primitives/heading/types.ts +12 -0
- package/src/css/primitives/kbd/index.ts +2 -0
- package/src/css/primitives/kbd/kbd.ts +7 -0
- package/src/css/primitives/kbd/rules.ts +20 -0
- package/src/css/primitives/kbd/types.ts +5 -0
- package/src/css/primitives/label/index.ts +2 -0
- package/src/css/primitives/label/label.ts +16 -0
- package/src/css/primitives/label/rules.ts +85 -0
- package/src/css/primitives/label/types.ts +12 -0
- package/src/css/primitives/popover/index.ts +1 -0
- package/src/css/primitives/popover/popover.ts +5 -0
- package/src/css/primitives/popover/rules.ts +5 -0
- package/src/css/primitives/radio/index.ts +1 -0
- package/src/css/primitives/radio/radio.ts +5 -0
- package/src/css/primitives/radio/rules.ts +5 -0
- package/src/css/primitives/select/index.ts +1 -0
- package/src/css/primitives/select/rules.ts +5 -0
- package/src/css/primitives/select/select.ts +5 -0
- package/src/css/primitives/selectable/__style.ts +117 -0
- package/src/css/primitives/selectable/index.ts +2 -0
- package/src/css/primitives/selectable/rules.ts +27 -0
- package/src/css/primitives/selectable/selectable.ts +9 -0
- package/src/css/primitives/selectable/types.ts +6 -0
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/rules.ts +20 -0
- package/src/css/primitives/spinner/spinner.ts +9 -0
- package/src/css/primitives/switch/index.ts +1 -0
- package/src/css/primitives/switch/rules.ts +132 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/index.ts +2 -0
- package/src/css/primitives/text/rules.ts +75 -0
- package/src/css/primitives/text/text.ts +16 -0
- package/src/css/primitives/text/types.ts +11 -0
- package/src/css/primitives/textArea/index.ts +1 -0
- package/src/css/primitives/textArea/rules.ts +5 -0
- package/src/css/primitives/textArea/textArea.ts +5 -0
- package/src/css/primitives/textInput/index.ts +2 -0
- package/src/css/primitives/textInput/rules.ts +321 -0
- package/src/css/primitives/textInput/textInput.ts +15 -0
- package/src/css/primitives/textInput/types.ts +8 -0
- package/src/css/primitives/token/rules.ts +45 -0
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/rules.ts +17 -0
- package/src/css/primitives/tooltip/tooltip.ts +9 -0
- package/src/css/responsiveRules.ts +25 -0
- package/src/css/rules.ts +99 -0
- package/src/css/styles/border/border.ts +22 -0
- package/src/css/styles/border/index.ts +2 -0
- package/src/css/styles/border/rules.ts +24 -0
- package/src/css/styles/border/types.ts +10 -0
- package/src/css/styles/display/rules.ts +62 -0
- package/src/css/styles/flex/flex.ts +20 -0
- package/src/css/styles/flex/index.ts +2 -0
- package/src/css/styles/flex/rules.ts +28 -0
- package/src/css/styles/flex/types.ts +35 -0
- package/src/css/styles/flexItem/flexItem.ts +8 -0
- package/src/css/styles/flexItem/index.ts +2 -0
- package/src/css/styles/flexItem/rules.ts +11 -0
- package/src/css/styles/flexItem/types.ts +11 -0
- package/src/css/styles/font/font.ts +17 -0
- package/src/css/styles/font/index.ts +2 -0
- package/src/css/styles/font/rules.ts +148 -0
- package/src/css/styles/font/types.ts +12 -0
- package/src/css/styles/gap/gap.ts +8 -0
- package/src/css/styles/gap/index.ts +2 -0
- package/src/css/styles/gap/rules.ts +33 -0
- package/src/css/styles/gap/types.ts +9 -0
- package/src/css/styles/grid/grid.ts +13 -0
- package/src/css/styles/grid/index.ts +2 -0
- package/src/css/styles/grid/rules.ts +146 -0
- package/src/css/styles/grid/types.ts +29 -0
- package/src/css/styles/gridItem/gridItem.ts +15 -0
- package/src/css/styles/gridItem/index.ts +2 -0
- package/src/css/styles/gridItem/rules.ts +96 -0
- package/src/css/styles/gridItem/types.ts +41 -0
- package/src/css/styles/height/rules.ts +7 -0
- package/src/css/styles/margin/index.ts +2 -0
- package/src/css/styles/margin/margin.ts +15 -0
- package/src/css/styles/margin/rules.ts +63 -0
- package/src/css/styles/margin/types.ts +11 -0
- package/src/css/styles/maxWidth/index.ts +2 -0
- package/src/css/styles/maxWidth/maxWidth.ts +6 -0
- package/src/css/styles/maxWidth/rules.ts +36 -0
- package/src/css/styles/maxWidth/types.ts +6 -0
- package/src/css/styles/outline/rules.ts +7 -0
- package/src/css/styles/overflow/index.ts +2 -0
- package/src/css/styles/overflow/overflow.ts +11 -0
- package/src/css/styles/overflow/rules.ts +9 -0
- package/src/css/styles/overflow/types.ts +11 -0
- package/src/css/styles/padding/index.ts +2 -0
- package/src/css/styles/padding/padding.ts +15 -0
- package/src/css/styles/padding/rules.ts +61 -0
- package/src/css/styles/padding/types.ts +12 -0
- package/src/css/styles/pointerEvents/index.ts +2 -0
- package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
- package/src/css/styles/pointerEvents/rules.ts +11 -0
- package/src/css/styles/pointerEvents/types.ts +7 -0
- package/src/css/styles/position/index.ts +2 -0
- package/src/css/styles/position/position.ts +7 -0
- package/src/css/styles/position/rules.ts +31 -0
- package/src/css/styles/position/types.ts +13 -0
- package/src/css/styles/radius/index.ts +2 -0
- package/src/css/styles/radius/radius.ts +8 -0
- package/src/css/styles/radius/rules.ts +13 -0
- package/src/css/styles/radius/types.ts +7 -0
- package/src/css/styles/shadow/rules.ts +53 -0
- package/src/css/styles/width/index.ts +2 -0
- package/src/css/styles/width/rules.ts +7 -0
- package/src/css/styles/width/types.ts +8 -0
- package/src/css/styles/width/width.ts +6 -0
- package/src/css/types.ts +626 -0
- package/src/css/varNames.ts +381 -0
- package/src/css/vars.ts +399 -0
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +39 -45
- package/src/theme/build/renderColorTheme.ts +65 -239
- package/src/theme/build/resolveColorTokens.ts +115 -51
- package/src/theme/config/tokens/color/types.ts +18 -4
- package/src/theme/defaults/colorTokens.ts +10 -17
- package/src/theme/defaults/config.ts +1 -1
- package/src/theme/getScopedTheme.ts +2 -9
- package/src/theme/system/_constants.ts +25 -0
- package/src/theme/system/_types.ts +41 -0
- package/src/theme/system/color/_constants.ts +0 -8
- package/src/theme/system/color/badge.ts +7 -3
- package/src/theme/system/index.ts +2 -0
- package/src/theme/system/v0/color/_system.ts +4 -8
- package/src/theme/system/v0/color/color.ts +2 -3
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
- package/src/theme/versioning/v0_v2.ts +0 -4
- package/dist/_chunks-cjs/getTheme_v2.js +0 -342
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -343
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/dist/_legacy/getTheme_v2.esm.js +0 -343
- package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -5
- package/src/core/components/dialog/styles.ts +0 -76
- package/src/core/components/menu/menuDivider.ts +0 -12
- package/src/core/components/skeleton/styles.ts +0 -50
- package/src/core/components/toast/styles.ts +0 -61
- package/src/core/components/tree/style.ts +0 -104
- package/src/core/primitives/_selectable/style.ts +0 -114
- package/src/core/primitives/card/styles.ts +0 -146
- package/src/core/primitives/checkbox/styles.ts +0 -127
- /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/types.ts +0 -0
- /package/src/core/{_compat.ts → _compat/types.ts} +0 -0
|
@@ -5,18 +5,16 @@ import {
|
|
|
5
5
|
ThemeColorCard_v2,
|
|
6
6
|
ThemeColorInputMode_v2,
|
|
7
7
|
ThemeColorState_v2,
|
|
8
|
-
} from '@sanity/ui/theme'
|
|
9
|
-
import {
|
|
10
8
|
THEME_COLOR_BUTTON_MODES,
|
|
11
9
|
THEME_COLOR_CARD_TONES,
|
|
12
10
|
THEME_COLOR_INPUT_MODES,
|
|
13
11
|
THEME_COLOR_STATE_TONES,
|
|
14
12
|
ThemeColorCardToneKey,
|
|
15
13
|
ThemeColorInputModeKey,
|
|
14
|
+
buildTheme,
|
|
16
15
|
} from '@sanity/ui/theme'
|
|
17
|
-
import {buildTheme} from '@sanity/ui/theme'
|
|
18
16
|
import {ReactElement} from 'react'
|
|
19
|
-
import {rem} from '../../../
|
|
17
|
+
import {rem} from '../../../_compat'
|
|
20
18
|
import {useTheme_v2} from '../../useTheme'
|
|
21
19
|
import {getCSSProps} from './helpers'
|
|
22
20
|
import {Root} from './Root'
|
package/src/core/types/avatar.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export {
|
|
2
|
+
/** @deprecated Use `AvatarSize` from `@sanity/ui/theme' instead. */
|
|
3
|
+
type AvatarSize,
|
|
4
|
+
} from '@sanity/ui/theme'
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* @public
|
|
3
8
|
*/
|
|
@@ -6,7 +11,7 @@ export type AvatarPosition = 'top' | 'bottom' | 'inside'
|
|
|
6
11
|
/**
|
|
7
12
|
* @public
|
|
8
13
|
*/
|
|
9
|
-
export type AvatarSize = 0 | 1 | 2 | 3
|
|
14
|
+
// export type AvatarSize = 0 | 1 | 2 | 3
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* @public
|
package/src/core/types/box.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @deprecated use `Display` from `@sanity/ui/css` instead.
|
|
5
|
+
*/
|
|
6
|
+
type Display as BoxDisplay,
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated use `BoxHeight` from `@sanity/ui/css` instead.
|
|
11
|
+
*/
|
|
12
|
+
type BoxHeight,
|
|
10
13
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated use `Overflow` from `@sanity/ui/css` instead.
|
|
17
|
+
*/
|
|
18
|
+
type BoxOverflow,
|
|
15
19
|
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
* @deprecated use `BoxSizing` from `@sanity/ui/css` instead.
|
|
23
|
+
*/
|
|
24
|
+
type BoxSizing,
|
|
25
|
+
} from '@sanity/ui/css'
|
package/src/core/types/button.ts
CHANGED
package/src/core/types/flex.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
type FlexAlign,
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
type FlexDirection,
|
|
10
13
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| 'flex-end'
|
|
17
|
-
| 'center'
|
|
18
|
-
| 'space-between'
|
|
19
|
-
| 'space-around'
|
|
20
|
-
| 'space-evenly'
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
type FlexJustify,
|
|
21
19
|
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
24
|
+
type FlexValue,
|
|
26
25
|
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
30
|
+
type FlexWrap,
|
|
31
|
+
} from '@sanity/ui/css'
|
package/src/core/types/grid.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @deprecated Use `GridAutoRows` from `@sanity/ui/css` instead.
|
|
5
|
+
*/
|
|
6
|
+
type GridAutoRows,
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated Use `GridAutoCols` from `@sanity/ui/css` instead.
|
|
11
|
+
*/
|
|
12
|
+
type GridAutoCols,
|
|
10
13
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated Use `GridAutoFlow` from `@sanity/ui/css` instead.
|
|
17
|
+
*/
|
|
18
|
+
type GridAutoFlow,
|
|
19
|
+
} from '@sanity/ui/css'
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @deprecated
|
|
5
|
+
*/
|
|
6
|
+
type GridItemColumn,
|
|
5
7
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
type GridItemColumnStart,
|
|
10
13
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
type GridItemColumnEnd,
|
|
15
19
|
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
24
|
+
type GridItemRow,
|
|
20
25
|
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
30
|
+
type GridItemRowStart,
|
|
25
31
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
* @deprecated
|
|
35
|
+
*/
|
|
36
|
+
type GridItemRowEnd,
|
|
37
|
+
} from '@sanity/ui/css'
|
package/src/core/types/radius.ts
CHANGED
package/src/core/types/text.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForwardedRef, HTMLProps, ReactElement, forwardRef} from 'react'
|
|
2
|
-
import {styled, css} from 'styled
|
|
2
|
+
import {styled, css} from '../../lib/styled'
|
|
3
3
|
import {useTheme_v2} from '../../theme'
|
|
4
4
|
import {Point, compileCommands, getRoundedCommands} from './cmds'
|
|
5
5
|
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import {FocusEvent, forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from 'react'
|
|
2
|
-
import {styled} from 'styled-components'
|
|
3
2
|
import {EMPTY_RECORD} from '../../constants'
|
|
4
3
|
import {containsOrEqualsElement, isHTMLElement} from '../../helpers'
|
|
4
|
+
// import {styled} from '../../lib/styled'
|
|
5
|
+
import {Box, BoxProps} from '../../primitives'
|
|
5
6
|
import {LayerProvider} from './layerProvider'
|
|
6
7
|
import {useLayer} from './useLayer'
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @public
|
|
10
11
|
*/
|
|
11
|
-
export interface LayerProps {
|
|
12
|
-
as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
12
|
+
export interface LayerProps extends BoxProps {
|
|
13
|
+
// as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
13
14
|
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
14
15
|
onActivate?: (props: {activeElement: HTMLElement | null}) => void
|
|
15
16
|
zOffset?: number | number[]
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
interface LayerChildrenProps {
|
|
19
|
-
as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
19
|
+
interface LayerChildrenProps extends BoxProps {
|
|
20
|
+
// as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
20
21
|
onActivate?: LayerProps['onActivate']
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
const Root = styled.div({position: 'relative'})
|
|
24
|
+
// const Root = styled.div({position: 'relative'})
|
|
24
25
|
|
|
25
26
|
const LayerChildren = forwardRef(function LayerChildren(
|
|
26
|
-
props: LayerChildrenProps &
|
|
27
|
+
props: LayerChildrenProps &
|
|
28
|
+
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'rows' | 'width' | 'wrap'>,
|
|
27
29
|
forwardedRef: React.Ref<HTMLDivElement>,
|
|
28
30
|
) {
|
|
29
|
-
const {
|
|
31
|
+
const {
|
|
32
|
+
children,
|
|
33
|
+
onActivate,
|
|
34
|
+
onFocus,
|
|
35
|
+
position = 'relative',
|
|
36
|
+
style = EMPTY_RECORD,
|
|
37
|
+
...restProps
|
|
38
|
+
} = props
|
|
30
39
|
const {zIndex, isTopLayer} = useLayer()
|
|
31
40
|
const lastFocusedRef = useRef<HTMLElement | null>(null)
|
|
32
41
|
const ref = useRef<HTMLDivElement | null>(null)
|
|
@@ -65,9 +74,16 @@ const LayerChildren = forwardRef(function LayerChildren(
|
|
|
65
74
|
)
|
|
66
75
|
|
|
67
76
|
return (
|
|
68
|
-
<
|
|
77
|
+
<Box
|
|
78
|
+
data-ui="Layer"
|
|
79
|
+
{...restProps}
|
|
80
|
+
onFocus={handleFocus}
|
|
81
|
+
position={position}
|
|
82
|
+
ref={ref}
|
|
83
|
+
style={{...style, zIndex}}
|
|
84
|
+
>
|
|
69
85
|
{children}
|
|
70
|
-
</
|
|
86
|
+
</Box>
|
|
71
87
|
)
|
|
72
88
|
})
|
|
73
89
|
|
|
@@ -75,7 +91,7 @@ const LayerChildren = forwardRef(function LayerChildren(
|
|
|
75
91
|
* @public
|
|
76
92
|
*/
|
|
77
93
|
export const Layer = forwardRef(function Layer(
|
|
78
|
-
props: LayerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as'>,
|
|
94
|
+
props: LayerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'rows' | 'width' | 'wrap'>,
|
|
79
95
|
ref: React.Ref<HTMLDivElement>,
|
|
80
96
|
) {
|
|
81
97
|
const {children, zOffset = 1, ...restProps} = props
|
|
@@ -88,4 +104,5 @@ export const Layer = forwardRef(function Layer(
|
|
|
88
104
|
</LayerProvider>
|
|
89
105
|
)
|
|
90
106
|
})
|
|
107
|
+
|
|
91
108
|
Layer.displayName = 'ForwardRef(Layer)'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'
|
|
3
|
-
import {styled} from 'styled-components'
|
|
4
3
|
import {_isScrollable} from '../../helpers'
|
|
4
|
+
import {styled} from '../../lib/styled'
|
|
5
5
|
import {_ResizeObserver} from '../../observers'
|
|
6
6
|
import {StackProps} from '../../primitives'
|
|
7
7
|
import {useTheme_v2} from '../../theme'
|
package/src/css/_resp.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {ResponsiveProp} from './types'
|
|
2
|
+
|
|
3
|
+
export function _resp<T>(
|
|
4
|
+
prefix: string | undefined,
|
|
5
|
+
prop: ResponsiveProp<T> | undefined,
|
|
6
|
+
): string | undefined {
|
|
7
|
+
if (prop === undefined) {
|
|
8
|
+
return undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (Array.isArray(prop)) {
|
|
12
|
+
return prop
|
|
13
|
+
.map((value, index) => {
|
|
14
|
+
const className = (typeof value === 'boolean' ? [prefix] : [prefix, value])
|
|
15
|
+
.filter((s) => s === 0 || Boolean(s))
|
|
16
|
+
.join('-')
|
|
17
|
+
.replace(/\./g, '_')
|
|
18
|
+
|
|
19
|
+
return index === 0 ? `${className}` : `_${index}:${className}`
|
|
20
|
+
})
|
|
21
|
+
.join(' ')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (typeof prop === 'boolean' ? [prefix] : [prefix, prop])
|
|
25
|
+
.filter((s) => s === 0 || Boolean(s))
|
|
26
|
+
.join('-')
|
|
27
|
+
.replace(/\./g, '_')
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from 'fs/promises'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import {buildTheme as buildUITheme} from '@sanity/ui/theme'
|
|
4
|
+
import {compileSystem} from '../compile/compileSystem'
|
|
5
|
+
import {compileTheme} from '../compile/compileTheme'
|
|
6
|
+
|
|
7
|
+
async function buildSystem(outDir: string) {
|
|
8
|
+
const css = compileSystem()
|
|
9
|
+
|
|
10
|
+
await fs.mkdir(outDir, {recursive: true})
|
|
11
|
+
|
|
12
|
+
await fs.writeFile(path.resolve(outDir, 'system.css'), css, 'utf-8')
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.log('- system.css')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function buildTheme(outDir: string) {
|
|
19
|
+
const css = compileTheme(buildUITheme().v2!)
|
|
20
|
+
|
|
21
|
+
await fs.mkdir(outDir, {recursive: true})
|
|
22
|
+
|
|
23
|
+
await fs.writeFile(path.resolve(outDir, 'sanity-theme.css'), css, 'utf-8')
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
26
|
+
console.log('- sanity-theme.css')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function buildCommand(options: {cwd?: string; outDir?: string}): Promise<void> {
|
|
30
|
+
const cwd = options.cwd ?? process.cwd()
|
|
31
|
+
const outDir = options.outDir ?? path.resolve(cwd, 'dist')
|
|
32
|
+
|
|
33
|
+
await buildSystem(outDir)
|
|
34
|
+
|
|
35
|
+
await buildTheme(outDir)
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import cac from 'cac'
|
|
2
|
+
|
|
3
|
+
import {version} from '../../../package.json'
|
|
4
|
+
|
|
5
|
+
const cli = cac('ui')
|
|
6
|
+
|
|
7
|
+
// cli
|
|
8
|
+
// .command('dev')
|
|
9
|
+
// .option('--cwd [cwd]', 'Output directory')
|
|
10
|
+
// .action(async (options) => {
|
|
11
|
+
// const {devCommand} = await import('./devCommand')
|
|
12
|
+
|
|
13
|
+
// await devCommand({
|
|
14
|
+
// ...options,
|
|
15
|
+
// cwd: options.cwd || process.cwd(),
|
|
16
|
+
// })
|
|
17
|
+
// })
|
|
18
|
+
|
|
19
|
+
cli
|
|
20
|
+
.command('build')
|
|
21
|
+
.option('--cwd [cwd]', 'Working directory')
|
|
22
|
+
.option('--outDir [outDir]', 'Output directory')
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
const {buildCommand} = await import('./buildCommand')
|
|
25
|
+
|
|
26
|
+
await buildCommand({
|
|
27
|
+
...options,
|
|
28
|
+
cwd: options.cwd || process.cwd(),
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
cli.command('').action(() => {
|
|
33
|
+
cli.outputHelp()
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
cli.help()
|
|
37
|
+
cli.version(version)
|
|
38
|
+
cli.parse()
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {type Properties} from '../types'
|
|
2
|
+
|
|
3
|
+
export function compileRule(selector: string, props: Properties): string {
|
|
4
|
+
return compileProperties(selector, props) + compileNestedRules(selector, props['@nest'])
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function compileProperties(selector: string, props: Properties) {
|
|
8
|
+
let css = '{'
|
|
9
|
+
|
|
10
|
+
for (const key in props) {
|
|
11
|
+
if (key === '@keyframes') continue // ignore
|
|
12
|
+
if (key === '@media') continue // ignore
|
|
13
|
+
if (key === '@nest') continue // ignore
|
|
14
|
+
|
|
15
|
+
const value = (props as Record<string, string>)[key]
|
|
16
|
+
|
|
17
|
+
const valueArr = Array.isArray(value) ? value : [value]
|
|
18
|
+
|
|
19
|
+
for (const v of valueArr) {
|
|
20
|
+
css += toSnakeCase(key) + ':' + v + ';'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (css.length === 1) return ''
|
|
25
|
+
|
|
26
|
+
return selector + css + '}'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function compileNestedRules(selector: string, props?: Record<string, Properties>) {
|
|
30
|
+
if (!props) return ''
|
|
31
|
+
|
|
32
|
+
let css = ''
|
|
33
|
+
|
|
34
|
+
for (const key in props) {
|
|
35
|
+
const value = (props as Record<string, string>)[key]
|
|
36
|
+
|
|
37
|
+
css +=
|
|
38
|
+
'\n' +
|
|
39
|
+
key.replace(/&/g, selector) +
|
|
40
|
+
compileProperties(selector, value as Properties).substring(selector.length)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return css
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function compileMediaQueryRule(query: string, rules: Record<string, Properties>): string {
|
|
47
|
+
let css = `@media ${query}{`
|
|
48
|
+
|
|
49
|
+
for (const key in rules) {
|
|
50
|
+
css += '\n ' + compileRule(`.${key}`.replace(/:/g, '\\:'), rules[key])
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return css + '\n}'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function toSnakeCase(value: string) {
|
|
57
|
+
return value.replace(/[A-Z]/g, (match) => '-' + match.toLowerCase())
|
|
58
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {type Properties, type Rules} from '../types'
|
|
2
|
+
import {compileRule, compileMediaQueryRule} from './compileRule'
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export function compileRules(rules: Rules): string {
|
|
6
|
+
let css = ''
|
|
7
|
+
|
|
8
|
+
const keyframes: Record<string, Record<string, Properties>> = {}
|
|
9
|
+
const mediaQueries: Record<string, Record<string, Properties>> = {}
|
|
10
|
+
|
|
11
|
+
for (const [className, props] of Object.entries(rules)) {
|
|
12
|
+
const selectorCss = compileRule(`.${className}`.replace(/:/g, '\\:'), props)
|
|
13
|
+
|
|
14
|
+
css += selectorCss ? `${selectorCss}\n` : ''
|
|
15
|
+
|
|
16
|
+
if (props['@keyframes']) {
|
|
17
|
+
for (const name in props['@keyframes']) {
|
|
18
|
+
// if (!keyframes[name]) {
|
|
19
|
+
// keyframes[name] = {from: {}, to: {}}
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
keyframes[name] = props['@keyframes'][name]
|
|
23
|
+
// keyframes[name][className] = props['@keyframes'][key]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (props['@media']) {
|
|
28
|
+
for (const key in props['@media']) {
|
|
29
|
+
if (!mediaQueries[key]) {
|
|
30
|
+
mediaQueries[key] = {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
mediaQueries[key][className] = props['@media'][key]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
for (const [name, value] of Object.entries(keyframes)) {
|
|
39
|
+
let keyframesCss = `@keyframes ${name} {\n`
|
|
40
|
+
|
|
41
|
+
for (const [key, props] of Object.entries(value)) {
|
|
42
|
+
keyframesCss += ` ${key}`
|
|
43
|
+
keyframesCss += compileRule('', props).replace(/\n/g, '\n ') + '\n'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
keyframesCss += `\n}\n`
|
|
47
|
+
|
|
48
|
+
css += keyframesCss
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
for (const [query, queryRules] of Object.entries(mediaQueries)) {
|
|
52
|
+
css += compileMediaQueryRule(query, queryRules) + '\n'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return css.replace(/\n{2,}/g, '\n').trimStart()
|
|
56
|
+
}
|