@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
package/exports/css.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/css'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-static.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -27,12 +27,24 @@
|
|
|
27
27
|
"require": "./dist/index.js",
|
|
28
28
|
"default": "./dist/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./css": {
|
|
31
|
+
"source": "./exports/css.ts",
|
|
32
|
+
"import": "./dist/css.mjs",
|
|
33
|
+
"require": "./dist/css.js",
|
|
34
|
+
"default": "./dist/css.js"
|
|
35
|
+
},
|
|
36
|
+
"./system.css": {
|
|
37
|
+
"default": "./dist/system.css"
|
|
38
|
+
},
|
|
30
39
|
"./theme": {
|
|
31
40
|
"source": "./exports/theme.ts",
|
|
32
41
|
"import": "./dist/theme.mjs",
|
|
33
42
|
"require": "./dist/theme.js",
|
|
34
43
|
"default": "./dist/theme.js"
|
|
35
44
|
},
|
|
45
|
+
"./sanity-theme.css": {
|
|
46
|
+
"default": "./dist/sanity-theme.css"
|
|
47
|
+
},
|
|
36
48
|
"./package.json": "./package.json"
|
|
37
49
|
},
|
|
38
50
|
"main": "./dist/index.js",
|
|
@@ -45,6 +57,9 @@
|
|
|
45
57
|
]
|
|
46
58
|
}
|
|
47
59
|
},
|
|
60
|
+
"bin": {
|
|
61
|
+
"ui": "./bin/ui.js"
|
|
62
|
+
},
|
|
48
63
|
"files": [
|
|
49
64
|
"dist",
|
|
50
65
|
"exports",
|
|
@@ -82,8 +97,12 @@
|
|
|
82
97
|
"@floating-ui/react-dom": "^2.1.2",
|
|
83
98
|
"@sanity/color": "^3.0.6",
|
|
84
99
|
"@sanity/icons": "^3.4.0",
|
|
100
|
+
"@sanity/ui": "^2.8.10",
|
|
101
|
+
"cac": "^6.7.14",
|
|
85
102
|
"csstype": "^3.1.3",
|
|
103
|
+
"dotenv-flow": "^4.1.0",
|
|
86
104
|
"framer-motion": "11.0.8",
|
|
105
|
+
"react-compiler-runtime": "19.0.0-beta-6fc168f-20241025",
|
|
87
106
|
"react-refractor": "^2.2.0",
|
|
88
107
|
"use-effect-event": "^1.0.2"
|
|
89
108
|
},
|
|
@@ -95,24 +114,24 @@
|
|
|
95
114
|
"@commitlint/cli": "^19.4.0",
|
|
96
115
|
"@commitlint/config-conventional": "^19.2.2",
|
|
97
116
|
"@juggle/resize-observer": "^3.4.0",
|
|
98
|
-
"@sanity/pkg-utils": "^6.11.
|
|
99
|
-
"@sanity/prettier-config": "^1.0.
|
|
117
|
+
"@sanity/pkg-utils": "^6.11.8",
|
|
118
|
+
"@sanity/prettier-config": "^1.0.3",
|
|
100
119
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
101
120
|
"@sanity/ui-workshop": "^2.0.16",
|
|
102
|
-
"@storybook/addon-a11y": "^8.
|
|
103
|
-
"@storybook/addon-docs": "^8.
|
|
104
|
-
"@storybook/addon-essentials": "^8.
|
|
105
|
-
"@storybook/addon-interactions": "^8.
|
|
106
|
-
"@storybook/addon-links": "^8.
|
|
107
|
-
"@storybook/addon-mdx-gfm": "^8.
|
|
108
|
-
"@storybook/addon-storysource": "^8.
|
|
109
|
-
"@storybook/addon-themes": "^8.
|
|
110
|
-
"@storybook/blocks": "^8.
|
|
111
|
-
"@storybook/manager-api": "^8.
|
|
112
|
-
"@storybook/react": "^8.
|
|
113
|
-
"@storybook/react-vite": "^8.
|
|
114
|
-
"@storybook/test": "^8.
|
|
115
|
-
"@storybook/theming": "^8.
|
|
121
|
+
"@storybook/addon-a11y": "^8.4.0",
|
|
122
|
+
"@storybook/addon-docs": "^8.4.0",
|
|
123
|
+
"@storybook/addon-essentials": "^8.4.0",
|
|
124
|
+
"@storybook/addon-interactions": "^8.4.0",
|
|
125
|
+
"@storybook/addon-links": "^8.4.0",
|
|
126
|
+
"@storybook/addon-mdx-gfm": "^8.4.0",
|
|
127
|
+
"@storybook/addon-storysource": "^8.4.0",
|
|
128
|
+
"@storybook/addon-themes": "^8.4.0",
|
|
129
|
+
"@storybook/blocks": "^8.4.0",
|
|
130
|
+
"@storybook/manager-api": "^8.4.0",
|
|
131
|
+
"@storybook/react": "^8.4.0",
|
|
132
|
+
"@storybook/react-vite": "^8.4.0",
|
|
133
|
+
"@storybook/test": "^8.4.0",
|
|
134
|
+
"@storybook/theming": "^8.4.0",
|
|
116
135
|
"@testing-library/dom": "^10.4.0",
|
|
117
136
|
"@testing-library/jest-dom": "^6.6.2",
|
|
118
137
|
"@testing-library/react": "^16.0.1",
|
|
@@ -132,6 +151,7 @@
|
|
|
132
151
|
"cypress": "^13.13.2",
|
|
133
152
|
"cypress-real-events": "^1.13.0",
|
|
134
153
|
"cz-conventional-changelog": "^3.3.0",
|
|
154
|
+
"esbuild-register": "^3.6.0",
|
|
135
155
|
"eslint": "^8.57.1",
|
|
136
156
|
"eslint-config-prettier": "^9.1.0",
|
|
137
157
|
"eslint-plugin-boundaries": "^4.2.2",
|
|
@@ -149,27 +169,27 @@
|
|
|
149
169
|
"jest-environment-jsdom": "^29.7.0",
|
|
150
170
|
"lint-staged": "^14.0.1",
|
|
151
171
|
"module-alias": "^2.2.3",
|
|
172
|
+
"npm-run-all": "^4.1.5",
|
|
152
173
|
"npm-run-all2": "^5.0.2",
|
|
153
174
|
"prettier": "^3.3.3",
|
|
154
175
|
"react": "^18.3.1",
|
|
155
|
-
"react-compiler-runtime": "beta",
|
|
156
176
|
"react-dom": "^18.3.1",
|
|
157
177
|
"react-is": "^18.3.1",
|
|
158
178
|
"refractor": "^4.8.1",
|
|
159
179
|
"rimraf": "^5.0.5",
|
|
160
180
|
"semantic-release": "^24.0.0",
|
|
161
181
|
"start-server-and-test": "^2.0.5",
|
|
162
|
-
"storybook": "^8.
|
|
182
|
+
"storybook": "^8.4.0",
|
|
163
183
|
"styled-components": "^6.1.13",
|
|
164
184
|
"tsconfig-paths": "^4.2.0",
|
|
165
|
-
"typescript": "5.
|
|
185
|
+
"typescript": "5.6.3",
|
|
166
186
|
"vite": "^5.4.2",
|
|
167
187
|
"vite-tsconfig-paths": "^5.0.1"
|
|
168
188
|
},
|
|
169
189
|
"peerDependencies": {
|
|
170
|
-
"react": "^18",
|
|
171
|
-
"react-dom": "^18",
|
|
172
|
-
"react-is": "^18",
|
|
190
|
+
"react": "^18 || >=19.0.0-0",
|
|
191
|
+
"react-dom": "^18 || >=19.0.0-0",
|
|
192
|
+
"react-is": "^18 || >=19.0.0-0",
|
|
173
193
|
"styled-components": "^5.2 || ^6"
|
|
174
194
|
},
|
|
175
195
|
"engines": {
|
|
@@ -182,7 +202,8 @@
|
|
|
182
202
|
"bundle": false
|
|
183
203
|
},
|
|
184
204
|
"scripts": {
|
|
185
|
-
"build": "
|
|
205
|
+
"bin:build": "./bin/ui.js build",
|
|
206
|
+
"build": "run-s clean pkg:build bin:build pkg:check figma:pkg:build",
|
|
186
207
|
"clean": "rimraf .workshop dist",
|
|
187
208
|
"commit": "cz",
|
|
188
209
|
"cypress:dev": "run-p dev cypress:open",
|
|
@@ -9,16 +9,24 @@ import {
|
|
|
9
9
|
CardTone,
|
|
10
10
|
DialogPosition,
|
|
11
11
|
FlexAlign,
|
|
12
|
+
FlexDirection,
|
|
12
13
|
FlexJustify,
|
|
13
14
|
Placement,
|
|
14
15
|
TextAlign,
|
|
15
16
|
TextInputType,
|
|
16
17
|
} from '@sanity/ui'
|
|
17
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
ContainerWidth,
|
|
20
|
+
FontHeadingSize,
|
|
21
|
+
Space,
|
|
22
|
+
ThemeColorSpotKey,
|
|
23
|
+
ThemeColorToneKey,
|
|
24
|
+
ThemeFontWeightKey,
|
|
25
|
+
} from '@sanity/ui/theme'
|
|
18
26
|
|
|
19
27
|
export const WORKSHOP_AVATAR_SIZE_OPTIONS: {[key: string]: AvatarSize} = {
|
|
20
28
|
'0': 0,
|
|
21
|
-
'1': 1,
|
|
29
|
+
'1 (default)': 1,
|
|
22
30
|
'2': 2,
|
|
23
31
|
'3': 3,
|
|
24
32
|
}
|
|
@@ -60,12 +68,12 @@ export const WORKSHOP_BUTTON_TONE_OPTIONS: {[key: string]: ButtonTone} = {
|
|
|
60
68
|
export const WORKSHOP_CARD_AS_OPTIONS: {
|
|
61
69
|
[key: string]: 'div' | 'button' | 'span' | 'ol' | 'pre' | 'ul'
|
|
62
70
|
} = {
|
|
63
|
-
DIV: 'div',
|
|
64
|
-
BUTTON: 'button',
|
|
65
|
-
SPAN: 'span',
|
|
66
|
-
OL: 'ol',
|
|
67
|
-
PRE: 'pre',
|
|
68
|
-
UL: 'ul',
|
|
71
|
+
'DIV (default)': 'div',
|
|
72
|
+
'BUTTON': 'button',
|
|
73
|
+
'SPAN': 'span',
|
|
74
|
+
'OL': 'ol',
|
|
75
|
+
'PRE': 'pre',
|
|
76
|
+
'UL': 'ul',
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
export const WORKSHOP_CARD_TONE_OPTIONS: {[key: string]: CardTone} = {
|
|
@@ -85,7 +93,7 @@ export const WORKSHOP_CODE_LANGUAGE_OPTIONS = {
|
|
|
85
93
|
TypeScript: 'typescript',
|
|
86
94
|
}
|
|
87
95
|
|
|
88
|
-
export const WORKSHOP_CONTAINER_WIDTH_OPTIONS: {[key: string]:
|
|
96
|
+
export const WORKSHOP_CONTAINER_WIDTH_OPTIONS: {[key: string]: ContainerWidth} = {
|
|
89
97
|
'0': 0,
|
|
90
98
|
'1': 1,
|
|
91
99
|
'2': 2,
|
|
@@ -100,7 +108,7 @@ export const WORKSHOP_DIALOG_POSITION_OPTIONS: {[key: string]: DialogPosition} =
|
|
|
100
108
|
Absolute: 'absolute',
|
|
101
109
|
}
|
|
102
110
|
|
|
103
|
-
export const WORKSHOP_FLEX_DIRECTION_OPTIONS: {[key: string]:
|
|
111
|
+
export const WORKSHOP_FLEX_DIRECTION_OPTIONS: {[key: string]: FlexDirection} = {
|
|
104
112
|
Row: 'row',
|
|
105
113
|
Column: 'column',
|
|
106
114
|
}
|
|
@@ -129,12 +137,13 @@ export const WORKSHOP_FONT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey} =
|
|
|
129
137
|
Bold: 'bold',
|
|
130
138
|
}
|
|
131
139
|
|
|
132
|
-
export const WORKSHOP_HEADING_FONT_SIZE_OPTIONS = {
|
|
140
|
+
export const WORKSHOP_HEADING_FONT_SIZE_OPTIONS: Record<string, FontHeadingSize> = {
|
|
133
141
|
'0': 0,
|
|
134
142
|
'1': 1,
|
|
135
|
-
'2': 2,
|
|
143
|
+
'2 (default)': 2,
|
|
136
144
|
'3': 3,
|
|
137
145
|
'4': 4,
|
|
146
|
+
'5': 5,
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
export const WORKSHOP_ICON_SYMBOL_OPTIONS: {[key: string]: IconSymbol | ''} = Object.keys(
|
|
@@ -190,7 +199,7 @@ export const WORKSHOP_SHADOW_OPTIONS = {
|
|
|
190
199
|
'5': 5,
|
|
191
200
|
}
|
|
192
201
|
|
|
193
|
-
export const WORKSHOP_SPACE_OPTIONS = {
|
|
202
|
+
export const WORKSHOP_SPACE_OPTIONS: Record<string, Space> = {
|
|
194
203
|
'0': 0,
|
|
195
204
|
'1': 1,
|
|
196
205
|
'2': 2,
|
|
@@ -254,16 +263,16 @@ export const WORKSHOP_TEXT_OVERFLOW_OPTIONS: {[key: string]: 'ellipsis' | ''} =
|
|
|
254
263
|
export const WORKSHOP_TEXT_SIZE_OPTIONS = {
|
|
255
264
|
'0': 0,
|
|
256
265
|
'1': 1,
|
|
257
|
-
'2': 2,
|
|
266
|
+
'2 (default)': 2,
|
|
258
267
|
'3': 3,
|
|
259
268
|
'4': 4,
|
|
260
269
|
}
|
|
261
270
|
|
|
262
271
|
export const WORKSHOP_TEXT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey | ''} = {
|
|
263
|
-
Regular: '
|
|
264
|
-
Medium: 'medium',
|
|
265
|
-
Semibold: 'semibold',
|
|
266
|
-
Bold: 'bold',
|
|
272
|
+
'Regular (default)': '',
|
|
273
|
+
'Medium': 'medium',
|
|
274
|
+
'Semibold': 'semibold',
|
|
275
|
+
'Bold': 'bold',
|
|
267
276
|
}
|
|
268
277
|
|
|
269
278
|
export const WORKSHOP_THEME_COLOR_TONE_OPTIONS: {[key: string]: ThemeColorToneKey} = {
|
|
@@ -285,7 +294,7 @@ export const WORKSHOP_TOAST_STATUS_OPTIONS: {
|
|
|
285
294
|
Error: 'error',
|
|
286
295
|
}
|
|
287
296
|
|
|
288
|
-
export const WORKSHOP_WIDTH_OPTIONS: {[key: string]:
|
|
297
|
+
export const WORKSHOP_WIDTH_OPTIONS: {[key: string]: ContainerWidth} = {
|
|
289
298
|
'Auto': 'auto',
|
|
290
299
|
'0': 0,
|
|
291
300
|
'1': 1,
|
|
@@ -3,12 +3,14 @@ import {_responsive} from '../helpers'
|
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveBorderStyleProps} from './types'
|
|
5
5
|
|
|
6
|
+
/** @deprecated */
|
|
6
7
|
export function responsiveBorderStyle(): Array<
|
|
7
8
|
(props: ResponsiveBorderStyleProps & ThemeProps) => CSSObject[]
|
|
8
9
|
> {
|
|
9
10
|
return [border, borderTop, borderRight, borderBottom, borderLeft]
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
/** @deprecated */
|
|
12
14
|
function border(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
13
15
|
const {card, media} = getTheme_v2(props.theme)
|
|
14
16
|
const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`
|
|
@@ -18,6 +20,7 @@ function border(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
18
20
|
)
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
/** @deprecated */
|
|
21
24
|
function borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
22
25
|
const {card, media} = getTheme_v2(props.theme)
|
|
23
26
|
const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`
|
|
@@ -27,6 +30,7 @@ function borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
27
30
|
)
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
/** @deprecated */
|
|
30
34
|
function borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
31
35
|
const {card, media} = getTheme_v2(props.theme)
|
|
32
36
|
const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`
|
|
@@ -36,6 +40,7 @@ function borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
36
40
|
)
|
|
37
41
|
}
|
|
38
42
|
|
|
43
|
+
/** @deprecated */
|
|
39
44
|
function borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
40
45
|
const {card, media} = getTheme_v2(props.theme)
|
|
41
46
|
const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`
|
|
@@ -45,6 +50,7 @@ function borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
45
50
|
)
|
|
46
51
|
}
|
|
47
52
|
|
|
53
|
+
/** @deprecated */
|
|
48
54
|
function borderLeft(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
49
55
|
const {card, media} = getTheme_v2(props.theme)
|
|
50
56
|
const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`
|
|
@@ -18,12 +18,14 @@ const BOX_SIZING: {[key: string]: Property.BoxSizing} = {
|
|
|
18
18
|
const BOX_HEIGHT = {
|
|
19
19
|
stretch: 'stretch',
|
|
20
20
|
fill: '100%',
|
|
21
|
-
}
|
|
21
|
+
} as const
|
|
22
22
|
|
|
23
|
+
/** @deprecated */
|
|
23
24
|
export function boxStyle(): CSSObject {
|
|
24
25
|
return BASE_STYLE
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/** @deprecated */
|
|
27
29
|
export function responsiveBoxStyle(): Array<
|
|
28
30
|
(props: ResponsiveBoxStyleProps & ThemeProps) => CSSObject[]
|
|
29
31
|
> {
|
|
@@ -35,6 +37,7 @@ export function responsiveBoxStyle(): Array<
|
|
|
35
37
|
]
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
/** @deprecated */
|
|
38
41
|
function responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
39
42
|
const {media} = getTheme_v2(props.theme)
|
|
40
43
|
|
|
@@ -43,6 +46,7 @@ function responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps)
|
|
|
43
46
|
}))
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
/** @deprecated */
|
|
46
50
|
function responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
47
51
|
const {media} = getTheme_v2(props.theme)
|
|
48
52
|
|
|
@@ -51,6 +55,7 @@ function responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
|
51
55
|
}))
|
|
52
56
|
}
|
|
53
57
|
|
|
58
|
+
/** @deprecated */
|
|
54
59
|
function responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
55
60
|
const {media} = getTheme_v2(props.theme)
|
|
56
61
|
|
|
@@ -59,6 +64,7 @@ function responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
|
59
64
|
}))
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
/** @deprecated */
|
|
62
68
|
function responsiveBoxOverflowStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
63
69
|
const {media} = getTheme_v2(props.theme)
|
|
64
70
|
|
|
@@ -71,14 +71,6 @@ export function _cardColorStyle(
|
|
|
71
71
|
'--card-badge-critical-dot-color': color.badge.critical.dot,
|
|
72
72
|
'--card-badge-critical-fg-color': color.badge.critical.fg,
|
|
73
73
|
'--card-badge-critical-icon-color': color.badge.critical.icon,
|
|
74
|
-
'--card-badge-prospect-bg-color': color.badge.prospect.bg,
|
|
75
|
-
'--card-badge-prospect-dot-color': color.badge.prospect.dot,
|
|
76
|
-
'--card-badge-prospect-fg-color': color.badge.prospect.fg,
|
|
77
|
-
'--card-badge-prospect-icon-color': color.badge.prospect.icon,
|
|
78
|
-
'--card-badge-explore-bg-color': color.badge.explore.bg,
|
|
79
|
-
'--card-badge-explore-dot-color': color.badge.explore.dot,
|
|
80
|
-
'--card-badge-explore-fg-color': color.badge.explore.fg,
|
|
81
|
-
'--card-badge-explore-icon-color': color.badge.explore.icon,
|
|
82
74
|
|
|
83
75
|
'--card-code-bg-color': color.code.bg,
|
|
84
76
|
'--card-code-fg-color': color.code.fg,
|
|
@@ -96,8 +88,8 @@ export function _cardColorStyle(
|
|
|
96
88
|
'--card-muted-bg-color': color.muted.bg,
|
|
97
89
|
'--card-muted-fg-color': color.muted.fg,
|
|
98
90
|
|
|
99
|
-
'--card-skeleton-color
|
|
100
|
-
'--card-skeleton-color
|
|
91
|
+
'--card-skeleton-from-color': color.skeleton.from,
|
|
92
|
+
'--card-skeleton-to-color': color.skeleton.to,
|
|
101
93
|
|
|
102
94
|
// deprecated variables (kept for legacy)
|
|
103
95
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
-
import {EMPTY_ARRAY} from '
|
|
2
|
+
import {EMPTY_ARRAY} from '../../../constants'
|
|
3
3
|
import {_responsive} from '../helpers'
|
|
4
4
|
import {ThemeProps} from '../types'
|
|
5
5
|
import {ResponsiveFlexItemStyleProps} from './types'
|
|
@@ -16,8 +16,6 @@ export function responsiveFlexStyle(): Array<
|
|
|
16
16
|
BASE_STYLE,
|
|
17
17
|
responsiveFlexAlignStyle,
|
|
18
18
|
responsiveFlexGapStyle,
|
|
19
|
-
responsiveFlexGapXStyle,
|
|
20
|
-
responsiveFlexGapYStyle,
|
|
21
19
|
responsiveFlexWrapStyle,
|
|
22
20
|
responsiveFlexJustifyStyle,
|
|
23
21
|
responsiveFlexDirectionStyle,
|
|
@@ -42,22 +40,6 @@ function responsiveFlexGapStyle(props: ResponsiveFlexStyleProps & ThemeProps) {
|
|
|
42
40
|
}))
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
function responsiveFlexGapXStyle(props: ResponsiveFlexStyleProps & ThemeProps) {
|
|
46
|
-
const {media, space} = getTheme_v2(props.theme)
|
|
47
|
-
|
|
48
|
-
return _responsive(media, props.$gapX, (gapX) => ({
|
|
49
|
-
columnGap: gapX ? rem(space[gapX]) : undefined,
|
|
50
|
-
}))
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function responsiveFlexGapYStyle(props: ResponsiveFlexStyleProps & ThemeProps) {
|
|
54
|
-
const {media, space} = getTheme_v2(props.theme)
|
|
55
|
-
|
|
56
|
-
return _responsive(media, props.$gapY, (gapY) => ({
|
|
57
|
-
rowGap: gapY ? rem(space[gapY]) : undefined,
|
|
58
|
-
}))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
43
|
export function responsiveFlexWrapStyle(props: ResponsiveFlexStyleProps & ThemeProps): CSSObject[] {
|
|
62
44
|
const {media} = getTheme_v2(props.theme)
|
|
63
45
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FlexAlign, FlexDirection, FlexJustify, FlexValue, FlexWrap} from '
|
|
1
|
+
import {FlexAlign, FlexDirection, FlexJustify, FlexValue, FlexWrap} from '@sanity/ui/css'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
@@ -7,8 +7,6 @@ export interface ResponsiveFlexStyleProps {
|
|
|
7
7
|
$align: FlexAlign[]
|
|
8
8
|
$direction: FlexDirection[]
|
|
9
9
|
$gap: number[]
|
|
10
|
-
$gapX: number[]
|
|
11
|
-
$gapY: number[]
|
|
12
10
|
$justify: FlexJustify[]
|
|
13
11
|
$wrap: FlexWrap[]
|
|
14
12
|
}
|
|
@@ -3,15 +3,6 @@ import {rem, _responsive} from '../helpers'
|
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveGridStyleProps} from './types'
|
|
5
5
|
|
|
6
|
-
const GRID_CSS = {
|
|
7
|
-
'&&:not([hidden])': {
|
|
8
|
-
display: 'grid',
|
|
9
|
-
},
|
|
10
|
-
'&[data-as="ul"],&[data-as="ol"]': {
|
|
11
|
-
listStyle: 'none',
|
|
12
|
-
},
|
|
13
|
-
}
|
|
14
|
-
|
|
15
6
|
const GRID_AUTO_COLUMS = {
|
|
16
7
|
auto: 'auto',
|
|
17
8
|
min: 'min-content',
|
|
@@ -30,7 +21,6 @@ export function responsiveGridStyle(): Array<
|
|
|
30
21
|
CSSObject | ((props: ResponsiveGridStyleProps & ThemeProps) => CSSObject[])
|
|
31
22
|
> {
|
|
32
23
|
return [
|
|
33
|
-
GRID_CSS,
|
|
34
24
|
responsiveGridAutoFlowStyle,
|
|
35
25
|
responsiveGridAutoRowsStyle,
|
|
36
26
|
responsiveGridAutoColsStyle,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Theme, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
|
-
import {EMPTY_ARRAY} from '
|
|
3
|
+
import {EMPTY_ARRAY} from '../../constants'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -13,6 +13,15 @@ export function _fillCSSObject(keys: string[], value: string | number | CSSObjec
|
|
|
13
13
|
}, {})
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export function px(pixelValue: number): string | 0 {
|
|
20
|
+
if (pixelValue === 0) return 0
|
|
21
|
+
|
|
22
|
+
return `${pixelValue}px`
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
/**
|
|
17
26
|
* @public
|
|
18
27
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ThemeColorSchemeKey, ThemeFontWeightKey, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
|
-
import {css} from 'styled
|
|
4
|
-
import {CardTone} from '
|
|
3
|
+
import {css} from '../../../lib/styled'
|
|
4
|
+
import {CardTone} from '../../../types'
|
|
5
5
|
import {focusRingBorderStyle, focusRingStyle} from '../focusRing'
|
|
6
6
|
import {rem, _responsive} from '../helpers'
|
|
7
7
|
import {ThemeProps} from '../types'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ThemeBoxShadow, ThemeShadow, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
|
-
import {EMPTY_RECORD} from '
|
|
3
|
+
import {EMPTY_RECORD} from '../../../constants'
|
|
4
4
|
import {rem, _responsive} from '../helpers'
|
|
5
5
|
import {ThemeProps} from '../types'
|
|
6
6
|
import {ResponsiveShadowStyleProps} from './types'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {Autocomplete, Box, Button, Card, Code, Container, Stack, Text} from '@sanity/ui'
|
|
1
|
+
import {Autocomplete, Box, Button, Card, Code, Container, Radius, Stack, Text} from '@sanity/ui'
|
|
2
|
+
import {FontTextSize} from '@sanity/ui/theme'
|
|
2
3
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
4
|
import {useCallback, useState} from 'react'
|
|
4
5
|
import {
|
|
@@ -29,7 +30,7 @@ export default function CustomStory() {
|
|
|
29
30
|
key={option.value}
|
|
30
31
|
onClick={(event) => event.preventDefault()}
|
|
31
32
|
padding={padding}
|
|
32
|
-
radius={radius - 1}
|
|
33
|
+
radius={(radius - 1) as Radius}
|
|
33
34
|
>
|
|
34
35
|
<Text size={fontSize}>{option.title}</Text>
|
|
35
36
|
</Card>
|
|
@@ -60,14 +61,14 @@ export default function CustomStory() {
|
|
|
60
61
|
border={border}
|
|
61
62
|
disabled={disabled}
|
|
62
63
|
filterOption={filterOption}
|
|
63
|
-
fontSize={fontSize}
|
|
64
|
+
fontSize={fontSize as FontTextSize}
|
|
64
65
|
id="custom"
|
|
65
66
|
onChange={setValue}
|
|
66
67
|
openButton={openButton}
|
|
67
68
|
options={options}
|
|
68
69
|
padding={padding}
|
|
69
70
|
placeholder="Search"
|
|
70
|
-
radius={radius}
|
|
71
|
+
radius={radius as Radius}
|
|
71
72
|
readOnly={readOnly}
|
|
72
73
|
renderOption={renderOption}
|
|
73
74
|
renderValue={renderValue}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {Autocomplete, Box, Card, Container, Stack, Text} from '@sanity/ui'
|
|
2
|
+
import {FontTextSize, Radius} from '@sanity/ui/theme'
|
|
2
3
|
import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
3
4
|
import {PerfTestProps, usePerfTest} from '@sanity/ui-workshop/plugin-perf'
|
|
4
5
|
import {fireEvent} from '@testing-library/dom'
|
|
@@ -57,14 +58,14 @@ export default function ExampleStory() {
|
|
|
57
58
|
border={border}
|
|
58
59
|
customValidity={customValidity}
|
|
59
60
|
disabled={disabled}
|
|
60
|
-
fontSize={fontSize}
|
|
61
|
+
fontSize={fontSize as FontTextSize}
|
|
61
62
|
onChange={handleChange}
|
|
62
63
|
id="default"
|
|
63
64
|
openButton={openButton}
|
|
64
65
|
options={options}
|
|
65
66
|
padding={padding}
|
|
66
67
|
placeholder="Search"
|
|
67
|
-
radius={radius}
|
|
68
|
+
radius={radius as Radius}
|
|
68
69
|
readOnly={readOnly}
|
|
69
70
|
ref={ref}
|
|
70
71
|
value={value}
|