@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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const textRules: Rules = {
|
|
5
|
+
'text': {
|
|
6
|
+
'--font-weight-regular': `var(--font-text-weight-regular)`,
|
|
7
|
+
'--font-weight-medium': `var(--font-text-weight-medium)`,
|
|
8
|
+
'--font-weight-semibold': `var(--font-text-weight-semibold)`,
|
|
9
|
+
'--font-weight-bold': `var(--font-text-weight-bold)`,
|
|
10
|
+
|
|
11
|
+
'--font-family': `var(--font-text-family)`,
|
|
12
|
+
|
|
13
|
+
'color': 'var(--color-fg)',
|
|
14
|
+
|
|
15
|
+
'@nest': {
|
|
16
|
+
'& a': {
|
|
17
|
+
color: 'var(--color-link-fg)',
|
|
18
|
+
textDecoration: 'none',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
'text-accent': {
|
|
24
|
+
'--fg-color': 'var(--color-accent-fg)',
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
'text-muted': {
|
|
28
|
+
'--fg-color': 'var(--color-muted-fg)',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
...responsiveRules('text-0', {
|
|
32
|
+
'--font-size': 'var(--font-text-0-size)',
|
|
33
|
+
'--font-line-height': 'var(--font-text-0-line-height)',
|
|
34
|
+
'--font-letter-spacing': 'var(--font-text-0-letter-spacing)',
|
|
35
|
+
'--font-icon-size': 'var(--font-text-0-icon-size)',
|
|
36
|
+
'--font-ascender-height': 'var(--font-text-0-ascender-height)',
|
|
37
|
+
'--font-descender-height': 'var(--font-text-0-descender-height)',
|
|
38
|
+
}),
|
|
39
|
+
|
|
40
|
+
...responsiveRules('text-1', {
|
|
41
|
+
'--font-size': 'var(--font-text-1-size)',
|
|
42
|
+
'--font-line-height': 'var(--font-text-1-line-height)',
|
|
43
|
+
'--font-letter-spacing': 'var(--font-text-1-letter-spacing)',
|
|
44
|
+
'--font-icon-size': 'var(--font-text-1-icon-size)',
|
|
45
|
+
'--font-ascender-height': 'var(--font-text-1-ascender-height)',
|
|
46
|
+
'--font-descender-height': 'var(--font-text-1-descender-height)',
|
|
47
|
+
}),
|
|
48
|
+
|
|
49
|
+
...responsiveRules('text-2', {
|
|
50
|
+
'--font-size': 'var(--font-text-2-size)',
|
|
51
|
+
'--font-line-height': 'var(--font-text-2-line-height)',
|
|
52
|
+
'--font-letter-spacing': 'var(--font-text-2-letter-spacing)',
|
|
53
|
+
'--font-icon-size': 'var(--font-text-2-icon-size)',
|
|
54
|
+
'--font-ascender-height': 'var(--font-text-2-ascender-height)',
|
|
55
|
+
'--font-descender-height': 'var(--font-text-2-descender-height)',
|
|
56
|
+
}),
|
|
57
|
+
|
|
58
|
+
...responsiveRules('text-3', {
|
|
59
|
+
'--font-size': 'var(--font-text-3-size)',
|
|
60
|
+
'--font-line-height': 'var(--font-text-3-line-height)',
|
|
61
|
+
'--font-letter-spacing': 'var(--font-text-3-letter-spacing)',
|
|
62
|
+
'--font-icon-size': 'var(--font-text-3-icon-size)',
|
|
63
|
+
'--font-ascender-height': 'var(--font-text-3-ascender-height)',
|
|
64
|
+
'--font-descender-height': 'var(--font-text-3-descender-height)',
|
|
65
|
+
}),
|
|
66
|
+
|
|
67
|
+
...responsiveRules('text-4', {
|
|
68
|
+
'--font-size': 'var(--font-text-4-size)',
|
|
69
|
+
'--font-line-height': 'var(--font-text-4-line-height)',
|
|
70
|
+
'--font-letter-spacing': 'var(--font-text-4-letter-spacing)',
|
|
71
|
+
'--font-icon-size': 'var(--font-text-4-icon-size)',
|
|
72
|
+
'--font-ascender-height': 'var(--font-text-4-ascender-height)',
|
|
73
|
+
'--font-descender-height': 'var(--font-text-4-descender-height)',
|
|
74
|
+
}),
|
|
75
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {font} from '../../styles/font'
|
|
4
|
+
import {TextStyleProps} from './types'
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
export function text(props: TextStyleProps): string {
|
|
8
|
+
return composeClassNames(
|
|
9
|
+
'text',
|
|
10
|
+
'block',
|
|
11
|
+
font(props),
|
|
12
|
+
props.accent && 'text-accent',
|
|
13
|
+
props.muted && 'text-muted',
|
|
14
|
+
_resp(`text`, props.size),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {FontStyleProps} from '@sanity/ui/css'
|
|
2
|
+
import {ResponsiveProp} from '../../types'
|
|
3
|
+
|
|
4
|
+
export type TextSize = number
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
export interface TextStyleProps extends FontStyleProps {
|
|
8
|
+
accent?: boolean
|
|
9
|
+
muted?: boolean
|
|
10
|
+
size?: ResponsiveProp<TextSize>
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './textArea'
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import {FONT_TEXT_SIZE, SPACE} from '@sanity/ui/theme'
|
|
2
|
+
// import {_resp} from '../../_resp'
|
|
3
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
4
|
+
import {Rules} from '../../types'
|
|
5
|
+
import {vars} from '../../vars'
|
|
6
|
+
|
|
7
|
+
export const textInputRules: Rules = {
|
|
8
|
+
'text-input': {
|
|
9
|
+
'--font-family': vars.font.text.family,
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
13
|
+
return {
|
|
14
|
+
...acc,
|
|
15
|
+
...responsiveRules(`text-input-p-${space}`.replace('.', '_'), {
|
|
16
|
+
'--padding-top': `calc(${vars.space[space]} - var(--font-ascender-height))`,
|
|
17
|
+
'--padding-right': vars.space[space],
|
|
18
|
+
'--padding-bottom': `calc(${vars.space[space]} - var(--font-descender-height))`,
|
|
19
|
+
'--padding-left': vars.space[space],
|
|
20
|
+
}),
|
|
21
|
+
}
|
|
22
|
+
}, {}),
|
|
23
|
+
|
|
24
|
+
...FONT_TEXT_SIZE.reduce<Rules>((acc, size) => {
|
|
25
|
+
return {
|
|
26
|
+
...acc,
|
|
27
|
+
...responsiveRules(`text-input-${size}`, {
|
|
28
|
+
'--font-size': vars.font.text.sizes[size].fontSize,
|
|
29
|
+
'--font-line-height': vars.font.text.sizes[size].lineHeight,
|
|
30
|
+
'--font-letter-spacing': vars.font.text.sizes[size].letterSpacing,
|
|
31
|
+
'--font-ascender-height': vars.font.text.sizes[size].ascenderHeight,
|
|
32
|
+
'--font-descender-height': vars.font.text.sizes[size].descenderHeight,
|
|
33
|
+
}),
|
|
34
|
+
}
|
|
35
|
+
}, {}),
|
|
36
|
+
|
|
37
|
+
'text-input-element': {
|
|
38
|
+
'appearance': 'none',
|
|
39
|
+
'background': 'none',
|
|
40
|
+
'border': 0,
|
|
41
|
+
'borderRadius': 0,
|
|
42
|
+
'outline': 'none',
|
|
43
|
+
'width': '100%',
|
|
44
|
+
'boxSizing': 'border-box',
|
|
45
|
+
'fontFamily': 'var(--font-family)',
|
|
46
|
+
'fontSize': 'var(--font-size)',
|
|
47
|
+
'fontWeight': 'var(--font-weight)',
|
|
48
|
+
'lineHeight': 'var(--font-line-height)',
|
|
49
|
+
'letterSpacing': 'var(--font-letter-spacing)',
|
|
50
|
+
'margin': 0,
|
|
51
|
+
'position': 'relative',
|
|
52
|
+
'zIndex': 1,
|
|
53
|
+
'display': 'block',
|
|
54
|
+
'color': 'var(--input-fg-color)',
|
|
55
|
+
'paddingTop': 'var(--padding-top)',
|
|
56
|
+
'paddingRight': 'var(--padding-right)',
|
|
57
|
+
'paddingBottom': 'var(--padding-bottom)',
|
|
58
|
+
'paddingLeft': 'var(--padding-left)',
|
|
59
|
+
|
|
60
|
+
'--input-fg-color': 'var(--color-input-default-enabled-fg)',
|
|
61
|
+
|
|
62
|
+
'@nest': {
|
|
63
|
+
// NOTE: This is a hack to disable Chrome’s autofill styles
|
|
64
|
+
'&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active':
|
|
65
|
+
{
|
|
66
|
+
WebkitTextFillColor: 'var(--input-fg-color) !important',
|
|
67
|
+
transition: 'background-color 5000s',
|
|
68
|
+
transitionDelay: '86400s', // 24h
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
/* &:is(textarea) */
|
|
72
|
+
// '&[data-as="textarea"]': {
|
|
73
|
+
// resize: 'none',
|
|
74
|
+
// },
|
|
75
|
+
|
|
76
|
+
'&::placeholder': {
|
|
77
|
+
color: 'var(--input-placeholder-color)',
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
81
|
+
// /* --input-fg-color: ${color.input.default.enabled.fg}; */
|
|
82
|
+
// /* --input-placeholder-color: ${color.input.default.enabled.placeholder}; */
|
|
83
|
+
// /* enabled */
|
|
84
|
+
// &:not(:invalid):not(:disabled):not(:read-only) {
|
|
85
|
+
// /* --input-fg-color: ${color.input.default.enabled.fg}; */
|
|
86
|
+
// /* --input-placeholder-color: ${color.input.default.enabled.placeholder}; */
|
|
87
|
+
// }
|
|
88
|
+
// /* disabled */
|
|
89
|
+
// &:not(:invalid):disabled {
|
|
90
|
+
// /* --input-fg-color: ${color.input.default.disabled.fg}; */
|
|
91
|
+
// /* --input-placeholder-color: ${color.input.default.disabled.placeholder}; */
|
|
92
|
+
// }
|
|
93
|
+
// /* invalid */
|
|
94
|
+
// &:invalid {
|
|
95
|
+
// /* --input-fg-color: ${color.input.invalid.enabled.fg}; */
|
|
96
|
+
// /* --input-placeholder-color: ${color.input.invalid.enabled.placeholder}; */
|
|
97
|
+
// }
|
|
98
|
+
// /* readOnly */
|
|
99
|
+
// &:read-only {
|
|
100
|
+
// /* --input-fg-color: ${color.input.default.readOnly.fg}; */
|
|
101
|
+
// /* --input-placeholder-color: ${color.input.default.readOnly.placeholder}; */
|
|
102
|
+
// }
|
|
103
|
+
// }
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
'text-input-prefix': {
|
|
108
|
+
'borderTopRightRadius': 0,
|
|
109
|
+
'borderBottomRightRadius': 0,
|
|
110
|
+
|
|
111
|
+
'@nest': {
|
|
112
|
+
'& > span': {
|
|
113
|
+
display: 'block',
|
|
114
|
+
margin: '-1px',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
'text-input-suffix': {
|
|
120
|
+
'borderTopLeftRadius': 0,
|
|
121
|
+
'borderBottomLeftRadius': 0,
|
|
122
|
+
|
|
123
|
+
'@nest': {
|
|
124
|
+
'& > span': {
|
|
125
|
+
display: 'block',
|
|
126
|
+
margin: '-1px',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
'text-input-presentation': {
|
|
132
|
+
'--input-box-shadow': 'inset 0 0 0 1px var(--input-border-color)',
|
|
133
|
+
|
|
134
|
+
'position': 'absolute',
|
|
135
|
+
'top': 0,
|
|
136
|
+
'left': 0,
|
|
137
|
+
'right': 0,
|
|
138
|
+
'bottom': 0,
|
|
139
|
+
'display': 'block',
|
|
140
|
+
'pointerEvents': 'none',
|
|
141
|
+
'zIndex': 0,
|
|
142
|
+
|
|
143
|
+
'backgroundColor': 'var(--input-bg-color)',
|
|
144
|
+
'boxShadow': 'var(--input-box-shadow)',
|
|
145
|
+
|
|
146
|
+
'--input-border-color': 'var(--color-input-default-enabled-border)',
|
|
147
|
+
|
|
148
|
+
// border-top-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
149
|
+
// border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
150
|
+
// border-top-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
151
|
+
// border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
152
|
+
|
|
153
|
+
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
154
|
+
// --card-bg-color: ${color.input.default.enabled.bg};
|
|
155
|
+
// --card-fg-color: ${color.input.default.enabled.fg};
|
|
156
|
+
|
|
157
|
+
// /* enabled */
|
|
158
|
+
// *:not(:disabled) + &[data-border] {
|
|
159
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
160
|
+
// color: color.input.default.enabled.border,
|
|
161
|
+
// width: input.border.width,
|
|
162
|
+
// })};
|
|
163
|
+
// }
|
|
164
|
+
|
|
165
|
+
// /* invalid */
|
|
166
|
+
// *:not(:disabled):invalid + & {
|
|
167
|
+
// --card-bg-color: ${color.input.invalid.enabled.bg};
|
|
168
|
+
// --card-fg-color: ${color.input.invalid.enabled.fg};
|
|
169
|
+
|
|
170
|
+
// &[data-border] {
|
|
171
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
172
|
+
// color: color.input.invalid.enabled.border,
|
|
173
|
+
// width: input.border.width,
|
|
174
|
+
// })};
|
|
175
|
+
// }
|
|
176
|
+
// }
|
|
177
|
+
|
|
178
|
+
// /* focused */
|
|
179
|
+
// *:not(:disabled):focus + & {
|
|
180
|
+
// &[data-border] {
|
|
181
|
+
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
182
|
+
// ? undefined
|
|
183
|
+
// : focusRingStyle({
|
|
184
|
+
// border: {color: color.input.default.enabled.border, width: input.border.width},
|
|
185
|
+
// focusRing: input.text.focusRing,
|
|
186
|
+
// })};
|
|
187
|
+
// }
|
|
188
|
+
|
|
189
|
+
// &:not([data-border]) {
|
|
190
|
+
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
191
|
+
// ? undefined
|
|
192
|
+
// : focusRingStyle({focusRing: input.text.focusRing})};
|
|
193
|
+
// }
|
|
194
|
+
// }
|
|
195
|
+
|
|
196
|
+
// /* disabled */
|
|
197
|
+
// *:not(:invalid):disabled + & {
|
|
198
|
+
// --card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
199
|
+
// --card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
200
|
+
// --card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
201
|
+
|
|
202
|
+
// &[data-border] {
|
|
203
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
204
|
+
// color: color.input.default.disabled.border,
|
|
205
|
+
// width: input.border.width,
|
|
206
|
+
// })};
|
|
207
|
+
// }
|
|
208
|
+
// }
|
|
209
|
+
|
|
210
|
+
// *:invalid:disabled + & {
|
|
211
|
+
// --card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
212
|
+
// --card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
213
|
+
// --card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
214
|
+
|
|
215
|
+
// &[data-border] {
|
|
216
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
217
|
+
// color: color.input.invalid.disabled.border,
|
|
218
|
+
// width: input.border.width,
|
|
219
|
+
// })};
|
|
220
|
+
// }
|
|
221
|
+
// }
|
|
222
|
+
|
|
223
|
+
// /* readOnly */
|
|
224
|
+
// *:not(:invalid):read-only + & {
|
|
225
|
+
// --card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
226
|
+
// --card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
227
|
+
// }
|
|
228
|
+
|
|
229
|
+
// *:invalid:read-only + & {
|
|
230
|
+
// --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
231
|
+
// --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
232
|
+
// }
|
|
233
|
+
|
|
234
|
+
// /* hovered */
|
|
235
|
+
// @media (hover: hover) {
|
|
236
|
+
// *:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
237
|
+
// --card-bg-color: ${color.input.default.hovered.bg};
|
|
238
|
+
// --card-fg-color: ${color.input.default.hovered.fg};
|
|
239
|
+
// }
|
|
240
|
+
|
|
241
|
+
// *:invalid:not(:disabled):not(:read-only):hover + & {
|
|
242
|
+
// --card-bg-color: ${color.input.invalid.hovered.bg};
|
|
243
|
+
// --card-fg-color: ${color.input.invalid.hovered.fg};
|
|
244
|
+
// }
|
|
245
|
+
|
|
246
|
+
// *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
247
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
248
|
+
// color: color.input.default.hovered.border,
|
|
249
|
+
// width: input.border.width,
|
|
250
|
+
// })};
|
|
251
|
+
// }
|
|
252
|
+
|
|
253
|
+
// *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
254
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
255
|
+
// color: color.input.invalid.hovered.border,
|
|
256
|
+
// width: input.border.width,
|
|
257
|
+
// })};
|
|
258
|
+
// }
|
|
259
|
+
// }
|
|
260
|
+
// }
|
|
261
|
+
},
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// const Root = styled(Card).attrs({forwardedAs: 'span'})(textInputRootStyle)
|
|
265
|
+
|
|
266
|
+
// const InputRoot = styled.span`
|
|
267
|
+
// flex: 1;
|
|
268
|
+
// min-width: 0;
|
|
269
|
+
// display: block;
|
|
270
|
+
// position: relative;
|
|
271
|
+
// `
|
|
272
|
+
|
|
273
|
+
// const Prefix = styled(Card).attrs({forwardedAs: 'span'})`
|
|
274
|
+
// border-top-right-radius: 0;
|
|
275
|
+
// border-bottom-right-radius: 0;
|
|
276
|
+
|
|
277
|
+
// & > span {
|
|
278
|
+
// display: block;
|
|
279
|
+
// margin: -1px;
|
|
280
|
+
// }
|
|
281
|
+
// `
|
|
282
|
+
|
|
283
|
+
// const Suffix = styled(Card).attrs({forwardedAs: 'span'})`
|
|
284
|
+
// border-top-left-radius: 0;
|
|
285
|
+
// border-bottom-left-radius: 0;
|
|
286
|
+
|
|
287
|
+
// & > span {
|
|
288
|
+
// display: block;
|
|
289
|
+
// margin: -1px;
|
|
290
|
+
// }
|
|
291
|
+
// `
|
|
292
|
+
|
|
293
|
+
// const Input = styled.input<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(
|
|
294
|
+
// responsiveInputPaddingStyle,
|
|
295
|
+
// textInputBaseStyle,
|
|
296
|
+
// textInputFontSizeStyle,
|
|
297
|
+
// )
|
|
298
|
+
|
|
299
|
+
// const Presentation = styled.span<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>(
|
|
300
|
+
// responsiveRadiusStyle,
|
|
301
|
+
// textInputRepresentationStyle,
|
|
302
|
+
// )
|
|
303
|
+
|
|
304
|
+
// const LeftBox = styled(Box)`
|
|
305
|
+
// position: absolute;
|
|
306
|
+
// top: 0;
|
|
307
|
+
// left: 0;
|
|
308
|
+
// `
|
|
309
|
+
|
|
310
|
+
// const RightBox = styled(Box)`
|
|
311
|
+
// position: absolute;
|
|
312
|
+
// top: 0;
|
|
313
|
+
// right: 0;
|
|
314
|
+
// `
|
|
315
|
+
|
|
316
|
+
// const RightCard = styled(Card)`
|
|
317
|
+
// background-color: transparent;
|
|
318
|
+
// position: absolute;
|
|
319
|
+
// top: 0;
|
|
320
|
+
// right: 0;
|
|
321
|
+
// `
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {TextInputStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
export function textInput(props: TextInputStyleProps): string {
|
|
6
|
+
return composeClassNames(
|
|
7
|
+
'text-input',
|
|
8
|
+
_resp('text-input', props.size),
|
|
9
|
+
_resp('text-input-p', props.padding),
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function textInputElement(): string {
|
|
14
|
+
return composeClassNames('text-input-element')
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type {Rules} from '../../types'
|
|
2
|
+
import {vars} from '../../vars'
|
|
3
|
+
|
|
4
|
+
export const tokenRules: Rules = {
|
|
5
|
+
token: {
|
|
6
|
+
'@nest': {
|
|
7
|
+
'&.atrule': {color: vars.color.syntax.atrule},
|
|
8
|
+
'&.attr-name': {color: vars.color.syntax.attrName},
|
|
9
|
+
'&.attr-value': {color: vars.color.syntax.attrValue},
|
|
10
|
+
'&.attribute': {color: vars.color.syntax.attribute},
|
|
11
|
+
'&.boolean': {color: vars.color.syntax.boolean},
|
|
12
|
+
'&.builtin': {color: vars.color.syntax.builtin},
|
|
13
|
+
'&.cdata': {color: vars.color.syntax.cdata},
|
|
14
|
+
'&.char': {color: vars.color.syntax.char},
|
|
15
|
+
'&.class': {color: vars.color.syntax.class},
|
|
16
|
+
'&.class-name': {color: vars.color.syntax.className},
|
|
17
|
+
'&.comment': {color: vars.color.syntax.comment},
|
|
18
|
+
'&.constant': {color: vars.color.syntax.constant},
|
|
19
|
+
'&.deleted': {color: vars.color.syntax.deleted},
|
|
20
|
+
'&.doctype': {color: vars.color.syntax.doctype},
|
|
21
|
+
'&.entity': {color: vars.color.syntax.entity},
|
|
22
|
+
'&.function': {color: vars.color.syntax.function},
|
|
23
|
+
'&.hexcode': {color: vars.color.syntax.hexcode},
|
|
24
|
+
'&.id': {color: vars.color.syntax.id},
|
|
25
|
+
'&.important': {color: vars.color.syntax.important},
|
|
26
|
+
'&.inserted': {color: vars.color.syntax.inserted},
|
|
27
|
+
'&.keyword': {color: vars.color.syntax.keyword},
|
|
28
|
+
'&.number': {color: vars.color.syntax.number},
|
|
29
|
+
'&.operator': {color: vars.color.syntax.operator},
|
|
30
|
+
'&.prolog': {color: vars.color.syntax.prolog},
|
|
31
|
+
'&.property': {color: vars.color.syntax.property},
|
|
32
|
+
'&.pseudo-class': {color: vars.color.syntax.pseudoClass},
|
|
33
|
+
'&.pseudo-element': {color: vars.color.syntax.pseudoElement},
|
|
34
|
+
'&.punctuation': {color: vars.color.syntax.punctuation},
|
|
35
|
+
'&.regex': {color: vars.color.syntax.regex},
|
|
36
|
+
'&.selector': {color: vars.color.syntax.selector},
|
|
37
|
+
'&.string': {color: vars.color.syntax.string},
|
|
38
|
+
'&.symbol': {color: vars.color.syntax.symbol},
|
|
39
|
+
'&.tag': {color: vars.color.syntax.tag},
|
|
40
|
+
'&.unit': {color: vars.color.syntax.unit},
|
|
41
|
+
'&.url': {color: vars.color.syntax.url},
|
|
42
|
+
'&.variable': {color: vars.color.syntax.variable},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tooltip'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Rules} from '../../types'
|
|
2
|
+
|
|
3
|
+
export const tooltipRules: Rules = {
|
|
4
|
+
'tooltip': {
|
|
5
|
+
pointerEvents: 'none',
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
'tooltip-card': {
|
|
9
|
+
'@nest': {
|
|
10
|
+
'&[data-animate] > *': {
|
|
11
|
+
// opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
12
|
+
opacity: `var(--motion-content-opacity, 1)`,
|
|
13
|
+
willChange: 'opacity',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {type Properties, type Rules} from './types'
|
|
2
|
+
|
|
3
|
+
export function responsiveRules(className: string, props: Properties): Rules {
|
|
4
|
+
return {
|
|
5
|
+
[className]: props,
|
|
6
|
+
[`_1:${className}`]: {
|
|
7
|
+
'@media': {'screen and (min-width: 360px)': props},
|
|
8
|
+
},
|
|
9
|
+
[`_2:${className}`]: {
|
|
10
|
+
'@media': {'screen and (min-width: 600px)': props},
|
|
11
|
+
},
|
|
12
|
+
[`_3:${className}`]: {
|
|
13
|
+
'@media': {'screen and (min-width: 900px)': props},
|
|
14
|
+
},
|
|
15
|
+
[`_4:${className}`]: {
|
|
16
|
+
'@media': {'screen and (min-width: 1200px)': props},
|
|
17
|
+
},
|
|
18
|
+
[`_5:${className}`]: {
|
|
19
|
+
'@media': {'screen and (min-width: 1800px)': props},
|
|
20
|
+
},
|
|
21
|
+
[`_6:${className}`]: {
|
|
22
|
+
'@media': {'screen and (min-width: 2400px)': props},
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/css/rules.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {breadcrumbsRules} from './components/breadcrumbs/rules'
|
|
2
|
+
import {dialogRules} from './components/dialog/rules'
|
|
3
|
+
import {menuRules} from './components/menu/rules'
|
|
4
|
+
import {skeletonRules} from './components/skeleton/rules'
|
|
5
|
+
import {avatarRules} from './primitives/avatar/rules'
|
|
6
|
+
import {badgeRules} from './primitives/badge/rules'
|
|
7
|
+
import {boxRules} from './primitives/box/rules'
|
|
8
|
+
import {buttonRules} from './primitives/button/rules'
|
|
9
|
+
import {cardRules} from './primitives/card/rules'
|
|
10
|
+
import {checkboxRules} from './primitives/checkbox/rules'
|
|
11
|
+
import {codeRules} from './primitives/code/rules'
|
|
12
|
+
import {containerRules} from './primitives/container/rules'
|
|
13
|
+
import {headingRules} from './primitives/heading/rules'
|
|
14
|
+
import {kbdRules} from './primitives/kbd/rules'
|
|
15
|
+
import {labelRules} from './primitives/label/rules'
|
|
16
|
+
import {popoverRules} from './primitives/popover/rules'
|
|
17
|
+
import {radioRules} from './primitives/radio/rules'
|
|
18
|
+
import {selectRules} from './primitives/select/rules'
|
|
19
|
+
import {selectableRules} from './primitives/selectable/rules'
|
|
20
|
+
import {spinnerRules} from './primitives/spinner/rules'
|
|
21
|
+
import {switchRules} from './primitives/switch/rules'
|
|
22
|
+
import {textRules} from './primitives/text/rules'
|
|
23
|
+
import {textAreaRules} from './primitives/textArea/rules'
|
|
24
|
+
import {textInputRules} from './primitives/textInput/rules'
|
|
25
|
+
import {tokenRules} from './primitives/token/rules'
|
|
26
|
+
import {tooltipRules} from './primitives/tooltip/rules'
|
|
27
|
+
import {borderRules} from './styles/border/rules'
|
|
28
|
+
import {displayRules} from './styles/display/rules'
|
|
29
|
+
import {flexRules} from './styles/flex/rules'
|
|
30
|
+
import {flexItemRules} from './styles/flexItem/rules'
|
|
31
|
+
import {fontRules} from './styles/font/rules'
|
|
32
|
+
import {gapRules} from './styles/gap/rules'
|
|
33
|
+
import {gridRules} from './styles/grid/rules'
|
|
34
|
+
import {gridItemRules} from './styles/gridItem/rules'
|
|
35
|
+
import {heightRules} from './styles/height/rules'
|
|
36
|
+
import {marginRules} from './styles/margin/rules'
|
|
37
|
+
import {maxWidthRules} from './styles/maxWidth/rules'
|
|
38
|
+
import {outlineRules} from './styles/outline/rules'
|
|
39
|
+
import {overflowRules} from './styles/overflow/rules'
|
|
40
|
+
import {paddingRules} from './styles/padding/rules'
|
|
41
|
+
import {pointerEventsRules} from './styles/pointerEvents/rules'
|
|
42
|
+
import {positionRules} from './styles/position/rules'
|
|
43
|
+
import {radiusRules} from './styles/radius/rules'
|
|
44
|
+
import {shadowRules} from './styles/shadow/rules'
|
|
45
|
+
import {widthRules} from './styles/width/rules'
|
|
46
|
+
import {type Rules} from './types'
|
|
47
|
+
|
|
48
|
+
export const rules: Rules = {
|
|
49
|
+
// styles
|
|
50
|
+
...borderRules,
|
|
51
|
+
...displayRules,
|
|
52
|
+
...flexItemRules,
|
|
53
|
+
...flexRules,
|
|
54
|
+
...fontRules,
|
|
55
|
+
...gapRules,
|
|
56
|
+
...gridItemRules,
|
|
57
|
+
...gridRules,
|
|
58
|
+
...heightRules,
|
|
59
|
+
...marginRules,
|
|
60
|
+
...outlineRules,
|
|
61
|
+
...overflowRules,
|
|
62
|
+
...paddingRules,
|
|
63
|
+
...pointerEventsRules,
|
|
64
|
+
...positionRules,
|
|
65
|
+
...radiusRules,
|
|
66
|
+
...shadowRules,
|
|
67
|
+
...widthRules,
|
|
68
|
+
|
|
69
|
+
// primitives
|
|
70
|
+
...avatarRules,
|
|
71
|
+
...badgeRules,
|
|
72
|
+
...boxRules,
|
|
73
|
+
...buttonRules,
|
|
74
|
+
...cardRules,
|
|
75
|
+
...checkboxRules,
|
|
76
|
+
...codeRules,
|
|
77
|
+
...containerRules,
|
|
78
|
+
...headingRules,
|
|
79
|
+
...kbdRules,
|
|
80
|
+
...labelRules,
|
|
81
|
+
...maxWidthRules,
|
|
82
|
+
...popoverRules,
|
|
83
|
+
...radioRules,
|
|
84
|
+
...selectRules,
|
|
85
|
+
...selectableRules,
|
|
86
|
+
...spinnerRules,
|
|
87
|
+
...switchRules,
|
|
88
|
+
...textAreaRules,
|
|
89
|
+
...textInputRules,
|
|
90
|
+
...textRules,
|
|
91
|
+
...tokenRules,
|
|
92
|
+
...tooltipRules,
|
|
93
|
+
|
|
94
|
+
// components
|
|
95
|
+
...breadcrumbsRules,
|
|
96
|
+
...dialogRules,
|
|
97
|
+
...menuRules,
|
|
98
|
+
...skeletonRules,
|
|
99
|
+
}
|