@sanity/ui 2.9.0-corel.0 → 3.0.0-static.0
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 +2836 -0
- package/dist/_chunks-cjs/buildCommand.js.map +1 -0
- package/dist/_chunks-cjs/getTheme_v2.js +1 -27
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +1 -27
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +1 -27
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -0
- package/dist/css.d.mts +943 -0
- package/dist/css.d.ts +943 -0
- package/dist/css.esm.js +3135 -0
- package/dist/css.esm.js.map +1 -0
- package/dist/css.js +3135 -0
- package/dist/css.js.map +1 -0
- package/dist/css.mjs +3135 -0
- package/dist/css.mjs.map +1 -0
- package/dist/index.d.mts +175 -164
- package/dist/index.d.ts +175 -164
- package/dist/index.esm.js +864 -1955
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +870 -1962
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +864 -1955
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +25 -0
- package/dist/system.css +2953 -0
- package/dist/theme.d.mts +84 -22
- package/dist/theme.d.ts +84 -22
- package/dist/theme.esm.js +232 -283
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +232 -283
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +232 -283
- package/dist/theme.mjs.map +1 -1
- package/exports/css.ts +1 -0
- package/package.json +25 -4
- package/src/core/__workshop__/constants.ts +15 -15
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +12 -4
- 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.styles.ts +14 -2
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +77 -92
- package/src/core/components/hotkeys/hotkeys.tsx +18 -29
- package/src/core/components/menu/menu.tsx +8 -5
- package/src/core/components/menu/menuDivider.ts +2 -1
- package/src/core/components/menu/menuGroup.tsx +16 -8
- package/src/core/components/menu/menuItem.tsx +23 -14
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/styles.ts +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +1 -1
- package/src/core/components/tab/tab.tsx +6 -7
- package/src/core/components/tab/tabList.tsx +3 -2
- package/src/core/components/toast/styles.ts +1 -1
- package/src/core/components/toast/toast.tsx +6 -4
- package/src/core/components/toast/toastProvider.tsx +31 -22
- package/src/core/components/tree/style.ts +1 -1
- package/src/core/components/tree/tree.tsx +8 -2
- package/src/core/components/tree/treeGroup.tsx +1 -1
- package/src/core/components/tree/treeItem.tsx +38 -25
- package/src/core/components/tree/types.ts +5 -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 +52 -32
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- 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 +62 -74
- package/src/core/primitives/button/__workshop__/props.tsx +3 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +38 -45
- package/src/core/primitives/button/styles.ts +2 -2
- package/src/core/primitives/card/RootCardContext.ts +3 -0
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +44 -46
- package/src/core/primitives/card/styles.ts +1 -1
- package/src/core/primitives/checkbox/checkbox.tsx +6 -8
- package/src/core/primitives/code/code.tsx +23 -12
- package/src/core/primitives/code/styles.ts +1 -1
- package/src/core/primitives/container/container.tsx +7 -15
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +6 -19
- package/src/core/primitives/grid/grid.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +32 -19
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +22 -13
- package/src/core/primitives/kbd/kbd.tsx +30 -37
- package/src/core/primitives/label/label.tsx +15 -4
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -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 +1 -1
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +1 -1
- package/src/core/primitives/spinner/spinner.tsx +6 -20
- package/src/core/primitives/stack/stack.tsx +12 -10
- package/src/core/primitives/switch/styles.ts +9 -9
- package/src/core/primitives/switch/switch.tsx +20 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -2
- package/src/core/primitives/text/text.tsx +17 -21
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +176 -123
- 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 +35 -16
- package/src/core/styles/border/borderStyle.ts +6 -0
- package/src/core/styles/border/types.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +6 -0
- package/src/core/styles/card/_cardColorStyle.ts +0 -8
- package/src/core/styles/flex/flexStyle.ts +0 -18
- package/src/core/styles/flex/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +0 -10
- package/src/core/styles/helpers.ts +9 -0
- package/src/core/styles/input/textInputStyle.ts +1 -1
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/types/avatar.ts +6 -1
- package/src/core/types/button.ts +1 -0
- package/src/core/types/flex.ts +27 -26
- package/src/core/types/gridItem.ts +32 -24
- package/src/core/types/radius.ts +7 -4
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.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/comileRules.ts +59 -0
- package/src/css/compile/compileRule.ts +58 -0
- package/src/css/compile/compileSystem.ts +7 -0
- package/src/css/compile/compileTheme.ts +509 -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 +7 -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/tree/index.ts +1 -0
- package/src/css/components/tree/rules.ts +52 -0
- package/src/css/components/tree/tree.ts +5 -0
- package/src/css/composeClassNames.ts +3 -0
- package/src/css/index.ts +47 -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 +34 -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 +49 -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 +93 -0
- package/src/{core/primitives/checkbox/styles.ts → css/primitives/checkbox/__styles.ts} +3 -3
- 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/{core/primitives/_selectable/style.ts → css/primitives/selectable/__style.ts} +5 -4
- 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 +22 -0
- package/src/css/primitives/spinner/spinner.ts +5 -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 +1 -0
- package/src/css/primitives/textInput/rules.ts +226 -0
- package/src/css/primitives/textInput/textInput.ts +7 -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 +121 -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 +12 -0
- package/src/css/styles/font/index.ts +2 -0
- package/src/css/styles/font/rules.ts +125 -0
- package/src/css/styles/font/types.ts +6 -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/rules.ts +35 -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 +59 -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/overflow/rules.ts +9 -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 +59 -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 +591 -0
- package/src/css/varNames.ts +381 -0
- package/src/css/vars.ts +313 -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/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
- package/src/core/components/dialog/styles.ts +0 -76
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {SPACE} from '@sanity/ui/theme'
|
|
2
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
3
|
+
import {type Rules} from '../../types'
|
|
4
|
+
import {vars} from '../../vars'
|
|
5
|
+
|
|
6
|
+
export const gapRules: Rules = {
|
|
7
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
8
|
+
return {
|
|
9
|
+
...acc,
|
|
10
|
+
...responsiveRules(`g-${space}`, {
|
|
11
|
+
gap: space === 0.5 ? 'calc(var(--space-1) / 2)' : vars.space[space],
|
|
12
|
+
}),
|
|
13
|
+
}
|
|
14
|
+
}, {}),
|
|
15
|
+
|
|
16
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
17
|
+
return {
|
|
18
|
+
...acc,
|
|
19
|
+
...responsiveRules(`gx-${space}`, {
|
|
20
|
+
columnGap: space === 0.5 ? 'calc(var(--space-1) / 2)' : vars.space[space],
|
|
21
|
+
}),
|
|
22
|
+
}
|
|
23
|
+
}, {}),
|
|
24
|
+
|
|
25
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
26
|
+
return {
|
|
27
|
+
...acc,
|
|
28
|
+
...responsiveRules(`gy-${space}`, {
|
|
29
|
+
rowGap: space === 0.5 ? 'calc(var(--space-1) / 2)' : vars.space[space],
|
|
30
|
+
}),
|
|
31
|
+
}
|
|
32
|
+
}, {}),
|
|
33
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {type Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const gridRules: Rules = {
|
|
5
|
+
// autoCols
|
|
6
|
+
...responsiveRules('auto-cols-auto', {gridAutoColumns: 'auto'}),
|
|
7
|
+
...responsiveRules('auto-cols-min', {gridAutoColumns: 'min'}),
|
|
8
|
+
...responsiveRules('auto-cols-max', {gridAutoColumns: 'max'}),
|
|
9
|
+
...responsiveRules('auto-cols-fr', {gridAutoColumns: 'fr'}),
|
|
10
|
+
|
|
11
|
+
// autoFlow
|
|
12
|
+
...responsiveRules('auto-flow-row', {gridAutoFlow: 'row'}),
|
|
13
|
+
...responsiveRules('auto-flow-column', {gridAutoFlow: 'column'}),
|
|
14
|
+
...responsiveRules('auto-flow-row-dense', {gridAutoFlow: 'row dense'}),
|
|
15
|
+
...responsiveRules('auto-flow-column-dense', {gridAutoFlow: 'column dense'}),
|
|
16
|
+
|
|
17
|
+
// autoRows
|
|
18
|
+
...responsiveRules('auto-rows-auto', {gridAutoRows: 'auto'}),
|
|
19
|
+
...responsiveRules('auto-rows-min', {gridAutoRows: 'min-content'}),
|
|
20
|
+
...responsiveRules('auto-rows-max', {gridAutoRows: 'max-content'}),
|
|
21
|
+
// ...responsiveRules('auto-rows-fr', {gridAutoRows: 'fr'}),
|
|
22
|
+
|
|
23
|
+
// columns
|
|
24
|
+
...responsiveRules('columns-1', {gridTemplateColumns: 'repeat(1, 1fr)'}),
|
|
25
|
+
...responsiveRules('columns-2', {gridTemplateColumns: 'repeat(2, 1fr)'}),
|
|
26
|
+
...responsiveRules('columns-3', {gridTemplateColumns: 'repeat(3, 1fr)'}),
|
|
27
|
+
...responsiveRules('columns-4', {gridTemplateColumns: 'repeat(4, 1fr)'}),
|
|
28
|
+
...responsiveRules('columns-5', {gridTemplateColumns: 'repeat(5, 1fr)'}),
|
|
29
|
+
...responsiveRules('columns-6', {gridTemplateColumns: 'repeat(6, 1fr)'}),
|
|
30
|
+
...responsiveRules('columns-7', {gridTemplateColumns: 'repeat(7, 1fr)'}),
|
|
31
|
+
...responsiveRules('columns-8', {gridTemplateColumns: 'repeat(8, 1fr)'}),
|
|
32
|
+
...responsiveRules('columns-9', {gridTemplateColumns: 'repeat(9, 1fr)'}),
|
|
33
|
+
...responsiveRules('columns-10', {gridTemplateColumns: 'repeat(10, 1fr)'}),
|
|
34
|
+
...responsiveRules('columns-12', {gridTemplateColumns: 'repeat(12, 1fr)'}),
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {GridItemStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export function gridItem(props: GridItemStyleProps): string {
|
|
7
|
+
return composeClassNames(
|
|
8
|
+
_resp(`col`, props.column),
|
|
9
|
+
_resp(`col-start`, props.columnStart),
|
|
10
|
+
_resp(`col-end`, props.columnEnd),
|
|
11
|
+
_resp(`row`, props.row),
|
|
12
|
+
_resp(`row-start`, props.rowStart),
|
|
13
|
+
_resp(`row-end`, props.rowEnd),
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {type Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const gridItemRules: Rules = {
|
|
5
|
+
// column
|
|
6
|
+
...responsiveRules('col-auto', {gridColumn: `span 1 / span 1`}),
|
|
7
|
+
...responsiveRules('col-full', {gridColumn: `1 / -1`}),
|
|
8
|
+
...responsiveRules('col-1', {gridColumn: `span 1 / span 1`}),
|
|
9
|
+
...responsiveRules('col-2', {gridColumn: `span 2 / span 2`}),
|
|
10
|
+
...responsiveRules('col-3', {gridColumn: `span 3 / span 3`}),
|
|
11
|
+
...responsiveRules('col-4', {gridColumn: `span 4 / span 4`}),
|
|
12
|
+
...responsiveRules('col-5', {gridColumn: `span 5 / span 5`}),
|
|
13
|
+
...responsiveRules('col-6', {gridColumn: `span 6 / span 6`}),
|
|
14
|
+
...responsiveRules('col-7', {gridColumn: `span 7 / span 7`}),
|
|
15
|
+
...responsiveRules('col-8', {gridColumn: `span 8 / span 8`}),
|
|
16
|
+
...responsiveRules('col-9', {gridColumn: `span 9 / span 9`}),
|
|
17
|
+
...responsiveRules('col-10', {gridColumn: `span 10 / span 10`}),
|
|
18
|
+
...responsiveRules('col-11', {gridColumn: `span 11 / span 11`}),
|
|
19
|
+
...responsiveRules('col-12', {gridColumn: `span 12 / span 12`}),
|
|
20
|
+
|
|
21
|
+
// columnStart
|
|
22
|
+
...responsiveRules('col-start-auto', {gridColumnStart: 'auto'}),
|
|
23
|
+
...responsiveRules('col-start-1', {gridColumnStart: '1'}),
|
|
24
|
+
...responsiveRules('col-start-2', {gridColumnStart: '2'}),
|
|
25
|
+
...responsiveRules('col-start-3', {gridColumnStart: '3'}),
|
|
26
|
+
...responsiveRules('col-start-4', {gridColumnStart: '4'}),
|
|
27
|
+
...responsiveRules('col-start-5', {gridColumnStart: '5'}),
|
|
28
|
+
...responsiveRules('col-start-6', {gridColumnStart: '6'}),
|
|
29
|
+
...responsiveRules('col-start-7', {gridColumnStart: '7'}),
|
|
30
|
+
...responsiveRules('col-start-8', {gridColumnStart: '8'}),
|
|
31
|
+
...responsiveRules('col-start-9', {gridColumnStart: '9'}),
|
|
32
|
+
...responsiveRules('col-start-10', {gridColumnStart: '10'}),
|
|
33
|
+
...responsiveRules('col-start-11', {gridColumnStart: '11'}),
|
|
34
|
+
...responsiveRules('col-start-12', {gridColumnStart: '12'}),
|
|
35
|
+
|
|
36
|
+
// columnEnd
|
|
37
|
+
...responsiveRules('col-end-auto', {gridColumnEnd: 'auto'}),
|
|
38
|
+
...responsiveRules('col-end-1', {gridColumnEnd: '1'}),
|
|
39
|
+
...responsiveRules('col-end-2', {gridColumnEnd: '2'}),
|
|
40
|
+
...responsiveRules('col-end-3', {gridColumnEnd: '3'}),
|
|
41
|
+
...responsiveRules('col-end-4', {gridColumnEnd: '4'}),
|
|
42
|
+
...responsiveRules('col-end-5', {gridColumnEnd: '5'}),
|
|
43
|
+
...responsiveRules('col-end-6', {gridColumnEnd: '6'}),
|
|
44
|
+
...responsiveRules('col-end-7', {gridColumnEnd: '7'}),
|
|
45
|
+
...responsiveRules('col-end-8', {gridColumnEnd: '8'}),
|
|
46
|
+
...responsiveRules('col-end-9', {gridColumnEnd: '9'}),
|
|
47
|
+
...responsiveRules('col-end-10', {gridColumnEnd: '10'}),
|
|
48
|
+
...responsiveRules('col-end-11', {gridColumnEnd: '11'}),
|
|
49
|
+
...responsiveRules('col-end-12', {gridColumnEnd: '12'}),
|
|
50
|
+
|
|
51
|
+
// row
|
|
52
|
+
...responsiveRules('row-auto', {gridRow: `span 1 / span 1`}),
|
|
53
|
+
...responsiveRules('row-full', {gridRow: `1 / -1`}),
|
|
54
|
+
...responsiveRules('row-1', {gridRow: `span 1 / span 1`}),
|
|
55
|
+
...responsiveRules('row-2', {gridRow: `span 2 / span 2`}),
|
|
56
|
+
...responsiveRules('row-3', {gridRow: `span 3 / span 3`}),
|
|
57
|
+
...responsiveRules('row-4', {gridRow: `span 4 / span 4`}),
|
|
58
|
+
...responsiveRules('row-5', {gridRow: `span 5 / span 5`}),
|
|
59
|
+
...responsiveRules('row-6', {gridRow: `span 6 / span 6`}),
|
|
60
|
+
...responsiveRules('row-7', {gridRow: `span 7 / span 7`}),
|
|
61
|
+
...responsiveRules('row-8', {gridRow: `span 8 / span 8`}),
|
|
62
|
+
...responsiveRules('row-9', {gridRow: `span 9 / span 9`}),
|
|
63
|
+
...responsiveRules('row-10', {gridRow: `span 10 / span 10`}),
|
|
64
|
+
...responsiveRules('row-11', {gridRow: `span 11 / span 11`}),
|
|
65
|
+
...responsiveRules('row-12', {gridRow: `span 12 / span 12`}),
|
|
66
|
+
|
|
67
|
+
// rowStart
|
|
68
|
+
...responsiveRules('row-start-auto', {gridRowStart: 'auto'}),
|
|
69
|
+
...responsiveRules('row-start-1', {gridRowStart: '1'}),
|
|
70
|
+
...responsiveRules('row-start-2', {gridRowStart: '2'}),
|
|
71
|
+
...responsiveRules('row-start-3', {gridRowStart: '3'}),
|
|
72
|
+
...responsiveRules('row-start-4', {gridRowStart: '4'}),
|
|
73
|
+
...responsiveRules('row-start-5', {gridRowStart: '5'}),
|
|
74
|
+
...responsiveRules('row-start-6', {gridRowStart: '6'}),
|
|
75
|
+
...responsiveRules('row-start-7', {gridRowStart: '7'}),
|
|
76
|
+
...responsiveRules('row-start-8', {gridRowStart: '8'}),
|
|
77
|
+
...responsiveRules('row-start-9', {gridRowStart: '9'}),
|
|
78
|
+
...responsiveRules('row-start-10', {gridRowStart: '10'}),
|
|
79
|
+
...responsiveRules('row-start-11', {gridRowStart: '11'}),
|
|
80
|
+
...responsiveRules('row-start-12', {gridRowStart: '12'}),
|
|
81
|
+
|
|
82
|
+
// rowEnd
|
|
83
|
+
...responsiveRules('row-end-auto', {gridRowEnd: 'auto'}),
|
|
84
|
+
...responsiveRules('row-end-1', {gridRowEnd: '1'}),
|
|
85
|
+
...responsiveRules('row-end-2', {gridRowEnd: '2'}),
|
|
86
|
+
...responsiveRules('row-end-3', {gridRowEnd: '3'}),
|
|
87
|
+
...responsiveRules('row-end-4', {gridRowEnd: '4'}),
|
|
88
|
+
...responsiveRules('row-end-5', {gridRowEnd: '5'}),
|
|
89
|
+
...responsiveRules('row-end-6', {gridRowEnd: '6'}),
|
|
90
|
+
...responsiveRules('row-end-7', {gridRowEnd: '7'}),
|
|
91
|
+
...responsiveRules('row-end-8', {gridRowEnd: '8'}),
|
|
92
|
+
...responsiveRules('row-end-9', {gridRowEnd: '9'}),
|
|
93
|
+
...responsiveRules('row-end-10', {gridRowEnd: '10'}),
|
|
94
|
+
...responsiveRules('row-end-11', {gridRowEnd: '11'}),
|
|
95
|
+
...responsiveRules('row-end-12', {gridRowEnd: '12'}),
|
|
96
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {ResponsiveProp} from '../../types'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type GridItemColumn = 'auto' | 'full' | number
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export type GridItemColumnStart = 'auto' | number
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type GridItemColumnEnd = 'auto' | number
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type GridItemRow = 'auto' | 'full' | number
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export type GridItemRowStart = 'auto' | number
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type GridItemRowEnd = 'auto' | number
|
|
32
|
+
|
|
33
|
+
export interface GridItemStyleProps {
|
|
34
|
+
column?: ResponsiveProp<GridItemColumn>
|
|
35
|
+
columnStart?: ResponsiveProp<GridItemColumnStart>
|
|
36
|
+
columnEnd?: ResponsiveProp<GridItemColumnEnd>
|
|
37
|
+
|
|
38
|
+
row?: ResponsiveProp<GridItemRow>
|
|
39
|
+
rowStart?: ResponsiveProp<GridItemRowStart>
|
|
40
|
+
rowEnd?: ResponsiveProp<GridItemRowEnd>
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {MarginStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
export function margin(props: MarginStyleProps): string {
|
|
6
|
+
return composeClassNames(
|
|
7
|
+
_resp('m', props.margin),
|
|
8
|
+
_resp('mx', props.marginX),
|
|
9
|
+
_resp('my', props.marginY),
|
|
10
|
+
_resp('mt', props.marginTop),
|
|
11
|
+
_resp('mr', props.marginRight),
|
|
12
|
+
_resp('mb', props.marginBottom),
|
|
13
|
+
_resp('ml', props.marginLeft),
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {SPACE} from '@sanity/ui/theme'
|
|
2
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
3
|
+
import {type Rules} from '../../types'
|
|
4
|
+
import {vars} from '../../vars'
|
|
5
|
+
|
|
6
|
+
export const marginRules = SPACE.reduce<Rules>((acc, space) => {
|
|
7
|
+
return {
|
|
8
|
+
...acc,
|
|
9
|
+
...responsiveRules(`m-${space}`, {margin: vars.space[space]}),
|
|
10
|
+
}
|
|
11
|
+
}, {})
|
|
12
|
+
|
|
13
|
+
export const marginXRules = SPACE.reduce<Rules>((acc, space) => {
|
|
14
|
+
return {
|
|
15
|
+
...acc,
|
|
16
|
+
...responsiveRules(`mx-${space}`, {
|
|
17
|
+
marginLeft: vars.space[space],
|
|
18
|
+
marginRight: vars.space[space],
|
|
19
|
+
}),
|
|
20
|
+
}
|
|
21
|
+
}, {})
|
|
22
|
+
|
|
23
|
+
export const marginYRules = SPACE.reduce<Rules>((acc, space) => {
|
|
24
|
+
return {
|
|
25
|
+
...acc,
|
|
26
|
+
...responsiveRules(`my-${space}`, {
|
|
27
|
+
marginTop: vars.space[space],
|
|
28
|
+
marginBottom: vars.space[space],
|
|
29
|
+
}),
|
|
30
|
+
}
|
|
31
|
+
}, {})
|
|
32
|
+
|
|
33
|
+
export const marginTopRules = SPACE.reduce<Rules>((acc, space) => {
|
|
34
|
+
return {
|
|
35
|
+
...acc,
|
|
36
|
+
...responsiveRules(`mt-${space}`, {marginTop: vars.space[space]}),
|
|
37
|
+
}
|
|
38
|
+
}, {})
|
|
39
|
+
|
|
40
|
+
export const marginRightRules = SPACE.reduce<Rules>((acc, space) => {
|
|
41
|
+
return {
|
|
42
|
+
...acc,
|
|
43
|
+
...responsiveRules(`mr-${space}`, {marginRight: vars.space[space]}),
|
|
44
|
+
}
|
|
45
|
+
}, {})
|
|
46
|
+
|
|
47
|
+
export const marginBottomRules = SPACE.reduce<Rules>((acc, space) => {
|
|
48
|
+
return {
|
|
49
|
+
...acc,
|
|
50
|
+
...responsiveRules(`mb-${space}`, {marginBottom: vars.space[space]}),
|
|
51
|
+
}
|
|
52
|
+
}, {})
|
|
53
|
+
|
|
54
|
+
export const marginLeftRules = SPACE.reduce<Rules>((acc, space) => {
|
|
55
|
+
return {
|
|
56
|
+
...acc,
|
|
57
|
+
...responsiveRules(`ml-${space}`, {marginLeft: vars.space[space]}),
|
|
58
|
+
}
|
|
59
|
+
}, {})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {ResponsiveProp} from '../../types'
|
|
2
|
+
|
|
3
|
+
export interface MarginStyleProps {
|
|
4
|
+
margin?: ResponsiveProp<number>
|
|
5
|
+
marginTop?: ResponsiveProp<number>
|
|
6
|
+
marginRight?: ResponsiveProp<number>
|
|
7
|
+
marginBottom?: ResponsiveProp<number>
|
|
8
|
+
marginLeft?: ResponsiveProp<number>
|
|
9
|
+
marginX?: ResponsiveProp<number>
|
|
10
|
+
marginY?: ResponsiveProp<number>
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const maxWidthRules: Rules = {
|
|
5
|
+
...responsiveRules('max-w-0', {
|
|
6
|
+
maxWidth: `var(--container-0)`,
|
|
7
|
+
}),
|
|
8
|
+
|
|
9
|
+
...responsiveRules('max-w-1', {
|
|
10
|
+
maxWidth: `var(--container-1)`,
|
|
11
|
+
}),
|
|
12
|
+
|
|
13
|
+
...responsiveRules('max-w-2', {
|
|
14
|
+
maxWidth: `var(--container-2)`,
|
|
15
|
+
}),
|
|
16
|
+
|
|
17
|
+
...responsiveRules('max-w-3', {
|
|
18
|
+
maxWidth: `var(--container-3)`,
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
...responsiveRules('max-w-4', {
|
|
22
|
+
maxWidth: `var(--container-4)`,
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
...responsiveRules('max-w-5', {
|
|
26
|
+
maxWidth: `var(--container-5)`,
|
|
27
|
+
}),
|
|
28
|
+
|
|
29
|
+
...responsiveRules('max-w-auto', {
|
|
30
|
+
maxWidth: 'none',
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
...responsiveRules('max-w-fill', {
|
|
34
|
+
maxWidth: '100%',
|
|
35
|
+
}),
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {type Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const overflowRules: Rules = {
|
|
5
|
+
...responsiveRules('overflow-visible', {overflow: 'visible'}),
|
|
6
|
+
...responsiveRules('overflow-hidden', {overflow: 'hidden'}),
|
|
7
|
+
...responsiveRules('overflow-scroll', {overflow: 'scroll'}),
|
|
8
|
+
...responsiveRules('overflow-auto', {overflow: 'auto'}),
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {PaddingStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
export function padding(props: PaddingStyleProps): string {
|
|
6
|
+
return composeClassNames(
|
|
7
|
+
_resp('p', props.padding),
|
|
8
|
+
_resp('px', props.paddingX),
|
|
9
|
+
_resp('py', props.paddingY),
|
|
10
|
+
_resp('pt', props.paddingTop),
|
|
11
|
+
_resp('pr', props.paddingRight),
|
|
12
|
+
_resp('pb', props.paddingBottom),
|
|
13
|
+
_resp('pl', props.paddingLeft),
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {SPACE} from '@sanity/ui/theme'
|
|
2
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
3
|
+
import {type Rules} from '../../types'
|
|
4
|
+
import {vars} from '../../vars'
|
|
5
|
+
|
|
6
|
+
export const paddingRules = SPACE.reduce<Rules>((acc, space) => {
|
|
7
|
+
return {
|
|
8
|
+
...acc,
|
|
9
|
+
...responsiveRules(`p-${space}`, {padding: vars.space[space]}),
|
|
10
|
+
}
|
|
11
|
+
}, {})
|
|
12
|
+
|
|
13
|
+
export const paddingXRules = SPACE.reduce<Rules>((acc, space) => {
|
|
14
|
+
return {
|
|
15
|
+
...acc,
|
|
16
|
+
...responsiveRules(`px-${space}`, {
|
|
17
|
+
paddingLeft: vars.space[space],
|
|
18
|
+
paddingRight: vars.space[space],
|
|
19
|
+
}),
|
|
20
|
+
}
|
|
21
|
+
}, {})
|
|
22
|
+
|
|
23
|
+
export const paddingYRules = SPACE.reduce<Rules>((acc, space) => {
|
|
24
|
+
return {
|
|
25
|
+
...acc,
|
|
26
|
+
...responsiveRules(`py-${space}`, {
|
|
27
|
+
paddingTop: vars.space[space],
|
|
28
|
+
paddingBottom: vars.space[space],
|
|
29
|
+
}),
|
|
30
|
+
}
|
|
31
|
+
}, {})
|
|
32
|
+
|
|
33
|
+
export const paddingTopRules = SPACE.reduce<Rules>((acc, space) => {
|
|
34
|
+
return {
|
|
35
|
+
...acc,
|
|
36
|
+
...responsiveRules(`pt-${space}`, {paddingTop: vars.space[space]}),
|
|
37
|
+
}
|
|
38
|
+
}, {})
|
|
39
|
+
|
|
40
|
+
export const paddingRightRules = SPACE.reduce<Rules>((acc, space) => {
|
|
41
|
+
return {
|
|
42
|
+
...acc,
|
|
43
|
+
...responsiveRules(`pr-${space}`, {paddingRight: vars.space[space]}),
|
|
44
|
+
}
|
|
45
|
+
}, {})
|
|
46
|
+
|
|
47
|
+
export const paddingBottomRules = SPACE.reduce<Rules>((acc, space) => {
|
|
48
|
+
return {
|
|
49
|
+
...acc,
|
|
50
|
+
...responsiveRules(`pb-${space}`, {paddingBottom: vars.space[space]}),
|
|
51
|
+
}
|
|
52
|
+
}, {})
|
|
53
|
+
|
|
54
|
+
export const paddingLeftRules = SPACE.reduce<Rules>((acc, space) => {
|
|
55
|
+
return {
|
|
56
|
+
...acc,
|
|
57
|
+
...responsiveRules(`pl-${space}`, {paddingLeft: vars.space[space]}),
|
|
58
|
+
}
|
|
59
|
+
}, {})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {ResponsiveProp} from '../../types'
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
export interface PaddingStyleProps {
|
|
5
|
+
padding?: ResponsiveProp<number>
|
|
6
|
+
paddingTop?: ResponsiveProp<number>
|
|
7
|
+
paddingRight?: ResponsiveProp<number>
|
|
8
|
+
paddingBottom?: ResponsiveProp<number>
|
|
9
|
+
paddingLeft?: ResponsiveProp<number>
|
|
10
|
+
paddingX?: ResponsiveProp<number>
|
|
11
|
+
paddingY?: ResponsiveProp<number>
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
2
|
+
import {PointerEventsStyleProps} from './types'
|
|
3
|
+
|
|
4
|
+
export function pointerEvents(props: PointerEventsStyleProps): string {
|
|
5
|
+
return composeClassNames(props.pointerEvents && `pointer-events-${props.pointerEvents}`)
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {PositionStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
export function position(props: PositionStyleProps): string {
|
|
6
|
+
return composeClassNames(_resp('pos', props.position), _resp('inset', props.inset))
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const positionRules: Rules = {
|
|
5
|
+
...responsiveRules('pos-absolute', {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
}),
|
|
8
|
+
|
|
9
|
+
...responsiveRules('pos-fixed', {
|
|
10
|
+
position: 'fixed',
|
|
11
|
+
}),
|
|
12
|
+
|
|
13
|
+
...responsiveRules('pos-relative', {
|
|
14
|
+
position: 'relative',
|
|
15
|
+
}),
|
|
16
|
+
|
|
17
|
+
...responsiveRules('pos-static', {
|
|
18
|
+
position: 'static',
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
...responsiveRules('pos-sticky', {
|
|
22
|
+
position: 'sticky',
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
...responsiveRules('inset-0', {
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
bottom: 0,
|
|
30
|
+
}),
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {ResponsiveProp} from '../../types'
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
export type Inset = 0
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
export type Position = 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'
|
|
8
|
+
|
|
9
|
+
/** @public */
|
|
10
|
+
export interface PositionStyleProps {
|
|
11
|
+
inset?: ResponsiveProp<Inset>
|
|
12
|
+
position?: ResponsiveProp<Position>
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {RadiusStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export function radius(props: RadiusStyleProps): string {
|
|
7
|
+
return composeClassNames(_resp('r', props.radius))
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
+
import {type Rules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const radiusRules: Rules = {
|
|
5
|
+
...responsiveRules('r-0', {borderRadius: 'var(--radius-0)'}),
|
|
6
|
+
...responsiveRules('r-1', {borderRadius: 'var(--radius-1)'}),
|
|
7
|
+
...responsiveRules('r-2', {borderRadius: 'var(--radius-2)'}),
|
|
8
|
+
...responsiveRules('r-3', {borderRadius: 'var(--radius-3)'}),
|
|
9
|
+
...responsiveRules('r-4', {borderRadius: 'var(--radius-4)'}),
|
|
10
|
+
...responsiveRules('r-5', {borderRadius: 'var(--radius-5)'}),
|
|
11
|
+
...responsiveRules('r-6', {borderRadius: 'var(--radius-6)'}),
|
|
12
|
+
...responsiveRules('r-round', {borderRadius: '9999px'}),
|
|
13
|
+
}
|