@sanity/ui 3.0.0-static.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/dist/_chunks-cjs/buildCommand.js +1387 -681
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/css.d.mts +131 -12
- package/dist/css.d.ts +131 -12
- package/dist/css.esm.js +1450 -791
- package/dist/css.esm.js.map +1 -1
- package/dist/css.js +1449 -790
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +1450 -791
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +84 -76
- package/dist/index.d.ts +84 -76
- package/dist/index.esm.js +2734 -3146
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2733 -3145
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2734 -3146
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +1590 -1158
- package/dist/theme.esm.js +1565 -452
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +1599 -484
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1565 -452
- package/dist/theme.mjs.map +1 -1
- package/package.json +22 -22
- package/src/core/__workshop__/constants.ts +14 -5
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/_compat/index.ts +2 -0
- package/src/core/{styles → _compat/styles}/box/boxStyle.ts +1 -1
- package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -2
- package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
- package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/helpers.ts +1 -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 +5 -5
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/__workshop__/props.tsx +2 -0
- package/src/core/components/dialog/dialog.tsx +1 -5
- package/src/core/components/hotkeys/hotkeys.tsx +1 -1
- package/src/core/components/menu/menu.tsx +8 -10
- package/src/core/components/menu/menuDivider.tsx +16 -0
- package/src/core/components/menu/menuGroup.tsx +2 -8
- package/src/core/components/menu/menuItem.tsx +1 -1
- 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 +0 -1
- package/src/core/components/tab/tabList.tsx +4 -21
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/toast.tsx +27 -14
- package/src/core/components/toast/toastProvider.tsx +4 -13
- package/src/core/components/tree/tree.tsx +1 -2
- package/src/core/components/tree/treeGroup.tsx +4 -1
- package/src/core/components/tree/treeItem.tsx +11 -15
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/index.ts +0 -1
- package/src/core/lib/styled/members.ts +2 -2
- package/src/core/primitives/avatar/avatar.tsx +0 -21
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/avatar/styles.ts +2 -2
- package/src/core/primitives/box/box.tsx +4 -1
- package/src/core/primitives/button/__workshop__/props.tsx +2 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +2 -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/styles.ts +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +2 -2
- 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 +7 -10
- package/src/core/primitives/code/code.tsx +2 -4
- package/src/core/primitives/container/styles.ts +1 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -13
- package/src/core/primitives/grid/grid.tsx +5 -19
- package/src/core/primitives/heading/heading.tsx +8 -25
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +3 -12
- package/src/core/primitives/inline/styles.ts +1 -1
- package/src/core/primitives/label/label.tsx +4 -9
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
- package/src/core/primitives/popover/popover.tsx +1 -1
- package/src/core/primitives/popover/popoverCard.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +2 -2
- 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 +2 -2
- package/src/core/primitives/stack/styles.ts +1 -1
- package/src/core/primitives/switch/styles.ts +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -1
- package/src/core/primitives/text/text.tsx +1 -4
- 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 +3 -2
- package/src/core/primitives/textInput/textInput.tsx +16 -83
- package/src/core/primitives/tooltip/tooltipCard.tsx +5 -5
- package/src/core/primitives/types.ts +1 -0
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +2 -4
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/types/box.ts +22 -16
- package/src/core/types/grid.ts +17 -12
- package/src/core/types/text.ts +7 -4
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +2 -2
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/compile/{comileRules.ts → compileRules.ts} +2 -5
- package/src/css/compile/compileSystem.ts +1 -1
- package/src/css/compile/compileTheme.ts +4 -1
- package/src/css/components/breadcrumbs/rules.ts +18 -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/rules.ts +115 -0
- package/src/css/index.ts +4 -0
- package/src/css/primitives/box/box.ts +5 -1
- package/src/css/primitives/box/types.ts +7 -8
- package/src/css/primitives/card/rules.ts +161 -13
- package/src/css/primitives/checkbox/__styles.ts +115 -113
- package/src/css/primitives/selectable/__style.ts +117 -115
- package/src/css/primitives/spinner/rules.ts +5 -7
- package/src/css/primitives/spinner/spinner.ts +4 -0
- package/src/css/primitives/textInput/index.ts +1 -0
- package/src/css/primitives/textInput/rules.ts +159 -64
- package/src/css/primitives/textInput/textInput.ts +11 -3
- package/src/css/primitives/textInput/types.ts +8 -0
- package/src/css/rules.ts +16 -38
- package/src/css/styles/font/font.ts +7 -2
- package/src/css/styles/font/rules.ts +23 -0
- package/src/css/styles/font/types.ts +6 -0
- package/src/css/styles/gap/rules.ts +6 -6
- 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 +112 -1
- package/src/css/styles/grid/types.ts +29 -0
- package/src/css/styles/margin/rules.ts +58 -54
- 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/types.ts +11 -0
- package/src/css/styles/padding/rules.ts +50 -48
- package/src/css/types.ts +36 -1
- package/src/css/varNames.ts +1 -1
- package/src/css/vars.ts +86 -0
- package/dist/_chunks-cjs/getTheme_v2.js +0 -316
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -317
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/dist/_legacy/getTheme_v2.esm.js +0 -317
- 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/breadcrumbs.styles.ts +0 -17
- package/src/core/components/menu/menuDivider.ts +0 -13
- 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/card/styles.ts +0 -146
- /package/src/core/{styles → _compat/styles}/border/borderStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/border/types.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/flexStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/types.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/gridStyle.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
|
@@ -3,57 +3,61 @@ import {responsiveRules} from '../../responsiveRules'
|
|
|
3
3
|
import {type Rules} from '../../types'
|
|
4
4
|
import {vars} from '../../vars'
|
|
5
5
|
|
|
6
|
-
export const marginRules
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
6
|
+
export const marginRules: Rules = {
|
|
7
|
+
// NOTE: order matters
|
|
8
|
+
|
|
9
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
10
|
+
return {
|
|
11
|
+
...acc,
|
|
12
|
+
...responsiveRules(`m-${space}`.replace('.', '_'), {margin: vars.space[space]}),
|
|
13
|
+
}
|
|
14
|
+
}, {}),
|
|
15
|
+
|
|
16
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
17
|
+
return {
|
|
18
|
+
...acc,
|
|
19
|
+
...responsiveRules(`mx-${space}`.replace('.', '_'), {
|
|
20
|
+
marginLeft: vars.space[space],
|
|
21
|
+
marginRight: vars.space[space],
|
|
22
|
+
}),
|
|
23
|
+
}
|
|
24
|
+
}, {}),
|
|
25
|
+
|
|
26
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
27
|
+
return {
|
|
28
|
+
...acc,
|
|
29
|
+
...responsiveRules(`my-${space}`.replace('.', '_'), {
|
|
30
|
+
marginTop: vars.space[space],
|
|
31
|
+
marginBottom: vars.space[space],
|
|
32
|
+
}),
|
|
33
|
+
}
|
|
34
|
+
}, {}),
|
|
35
|
+
|
|
36
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
37
|
+
return {
|
|
38
|
+
...acc,
|
|
39
|
+
...responsiveRules(`mt-${space}`.replace('.', '_'), {marginTop: vars.space[space]}),
|
|
40
|
+
}
|
|
41
|
+
}, {}),
|
|
42
|
+
|
|
43
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
44
|
+
return {
|
|
45
|
+
...acc,
|
|
46
|
+
...responsiveRules(`mr-${space}`.replace('.', '_'), {marginRight: vars.space[space]}),
|
|
47
|
+
}
|
|
48
|
+
}, {}),
|
|
49
|
+
|
|
50
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
51
|
+
return {
|
|
52
|
+
...acc,
|
|
53
|
+
...responsiveRules(`mb-${space}`.replace('.', '_'), {marginBottom: vars.space[space]}),
|
|
54
|
+
}
|
|
55
|
+
}, {}),
|
|
56
|
+
|
|
57
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
58
|
+
return {
|
|
59
|
+
...acc,
|
|
60
|
+
...responsiveRules(`ml-${space}`.replace('.', '_'), {marginLeft: vars.space[space]}),
|
|
61
|
+
}
|
|
62
|
+
}, {}),
|
|
63
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {OverflowStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
export function overflow(props: OverflowStyleProps): string {
|
|
6
|
+
return composeClassNames(
|
|
7
|
+
_resp(`overflow`, props.overflow),
|
|
8
|
+
_resp(`overflow-x`, props.overflowX),
|
|
9
|
+
_resp(`overflow-y`, props.overflowY),
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {ResponsiveProp} from '../../types'
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
export type BoxOverflow = 'visible' | 'hidden' | 'auto'
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
export interface OverflowStyleProps {
|
|
8
|
+
overflow?: ResponsiveProp<BoxOverflow>
|
|
9
|
+
overflowX?: ResponsiveProp<BoxOverflow>
|
|
10
|
+
overflowY?: ResponsiveProp<BoxOverflow>
|
|
11
|
+
}
|
|
@@ -3,57 +3,59 @@ import {responsiveRules} from '../../responsiveRules'
|
|
|
3
3
|
import {type Rules} from '../../types'
|
|
4
4
|
import {vars} from '../../vars'
|
|
5
5
|
|
|
6
|
-
export const paddingRules
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
6
|
+
export const paddingRules: Rules = {
|
|
7
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
8
|
+
return {
|
|
9
|
+
...acc,
|
|
10
|
+
...responsiveRules(`p-${space}`.replace('.', '_'), {padding: vars.space[space]}),
|
|
11
|
+
}
|
|
12
|
+
}, {}),
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, {})
|
|
14
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
15
|
+
return {
|
|
16
|
+
...acc,
|
|
17
|
+
...responsiveRules(`px-${space}`.replace('.', '_'), {
|
|
18
|
+
paddingLeft: vars.space[space],
|
|
19
|
+
paddingRight: vars.space[space],
|
|
20
|
+
}),
|
|
21
|
+
}
|
|
22
|
+
}, {}),
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, {})
|
|
24
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
25
|
+
return {
|
|
26
|
+
...acc,
|
|
27
|
+
...responsiveRules(`py-${space}`.replace('.', '_'), {
|
|
28
|
+
paddingTop: vars.space[space],
|
|
29
|
+
paddingBottom: vars.space[space],
|
|
30
|
+
}),
|
|
31
|
+
}
|
|
32
|
+
}, {}),
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, {})
|
|
34
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
35
|
+
return {
|
|
36
|
+
...acc,
|
|
37
|
+
...responsiveRules(`pt-${space}`.replace('.', '_'), {paddingTop: vars.space[space]}),
|
|
38
|
+
}
|
|
39
|
+
}, {}),
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, {})
|
|
41
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
42
|
+
return {
|
|
43
|
+
...acc,
|
|
44
|
+
...responsiveRules(`pr-${space}`.replace('.', '_'), {paddingRight: vars.space[space]}),
|
|
45
|
+
}
|
|
46
|
+
}, {}),
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, {})
|
|
48
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
49
|
+
return {
|
|
50
|
+
...acc,
|
|
51
|
+
...responsiveRules(`pb-${space}`.replace('.', '_'), {paddingBottom: vars.space[space]}),
|
|
52
|
+
}
|
|
53
|
+
}, {}),
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, {})
|
|
55
|
+
...SPACE.reduce<Rules>((acc, space) => {
|
|
56
|
+
return {
|
|
57
|
+
...acc,
|
|
58
|
+
...responsiveRules(`pl-${space}`.replace('.', '_'), {paddingLeft: vars.space[space]}),
|
|
59
|
+
}
|
|
60
|
+
}, {}),
|
|
61
|
+
}
|
package/src/css/types.ts
CHANGED
|
@@ -176,7 +176,7 @@ export type ThemeVarName =
|
|
|
176
176
|
| '--input-text-focus-ring-width'
|
|
177
177
|
| '--layer-dialog-z-offset'
|
|
178
178
|
| `--radius-${Radius}`
|
|
179
|
-
| `--space-${Space}`
|
|
179
|
+
| `--space-${Exclude<Space, 0.5> | '0_5'}`
|
|
180
180
|
| `--shadow-${Shadow}-umbra`
|
|
181
181
|
| `--shadow-${Shadow}-penumbra`
|
|
182
182
|
| `--shadow-${Shadow}-ambient`
|
|
@@ -264,15 +264,20 @@ export type CardScopedVarName =
|
|
|
264
264
|
| `--card-badge-${ThemeColorStateToneKey}-fg-color`
|
|
265
265
|
| `--card-badge-${ThemeColorStateToneKey}-icon-color`
|
|
266
266
|
| `--card-bg-color`
|
|
267
|
+
| `--card-bg-image`
|
|
268
|
+
| `--card-bg2-color`
|
|
267
269
|
| `--card-border-color`
|
|
268
270
|
| `--card-code-bg-color`
|
|
269
271
|
| `--card-code-fg-color`
|
|
270
272
|
| `--card-fg-color`
|
|
271
273
|
| `--card-focus-ring-color`
|
|
274
|
+
| `--card-hairline-soft-color`
|
|
275
|
+
| `--card-hairline-hard-color`
|
|
272
276
|
| `--card-icon-color`
|
|
273
277
|
| `--card-kbd-bg-color`
|
|
274
278
|
| `--card-kbd-border-color`
|
|
275
279
|
| `--card-kbd-fg-color`
|
|
280
|
+
| `--card-link-color`
|
|
276
281
|
| `--card-link-fg-color`
|
|
277
282
|
| `--card-muted-bg-color`
|
|
278
283
|
| `--card-muted-fg-color`
|
|
@@ -297,12 +302,22 @@ export type CardScopedVarName =
|
|
|
297
302
|
| `--font-letter-spacing`
|
|
298
303
|
| `--font-line-height`
|
|
299
304
|
| `--font-size`
|
|
305
|
+
| `--font-skeleton-line-height`
|
|
306
|
+
| `--font-skeleton-ascender-height`
|
|
307
|
+
| `--font-skeleton-descender-height`
|
|
300
308
|
| `--font-weight-regular`
|
|
301
309
|
| `--font-weight-medium`
|
|
302
310
|
| `--font-weight-semibold`
|
|
303
311
|
| `--font-weight-bold`
|
|
304
312
|
| `--font-weight`
|
|
305
313
|
| `--fg-color`
|
|
314
|
+
| `--input-bg-color`
|
|
315
|
+
| `--input-border-color`
|
|
316
|
+
| `--input-fg-color`
|
|
317
|
+
| `--padding-top`
|
|
318
|
+
| `--padding-right`
|
|
319
|
+
| `--padding-bottom`
|
|
320
|
+
| `--padding-left`
|
|
306
321
|
|
|
307
322
|
// export type CardVarName = `--card-${CardSize}-${CardVariant}-${CardState}-${CardElement}`
|
|
308
323
|
|
|
@@ -581,11 +596,31 @@ export interface ScopedColorVars extends Omit<ColorStateVars, 'badge'> {
|
|
|
581
596
|
badge: ColorBadgeVars & ColorBadgeToneVars
|
|
582
597
|
}
|
|
583
598
|
|
|
599
|
+
export interface FontSizeVars {
|
|
600
|
+
ascenderHeight: CSSVar
|
|
601
|
+
descenderHeight: CSSVar
|
|
602
|
+
fontSize: CSSVar
|
|
603
|
+
lineHeight: CSSVar
|
|
604
|
+
letterSpacing: CSSVar
|
|
605
|
+
iconSize: CSSVar
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export interface FontVars<Size extends number> {
|
|
609
|
+
family: CSSVar
|
|
610
|
+
sizes: Record<Size, FontSizeVars>
|
|
611
|
+
}
|
|
612
|
+
|
|
584
613
|
/** @public */
|
|
585
614
|
export interface Vars {
|
|
586
615
|
color: {
|
|
587
616
|
dark: ColorSchemeVars
|
|
588
617
|
light: ColorSchemeVars
|
|
589
618
|
} & ScopedColorVars
|
|
619
|
+
font: {
|
|
620
|
+
code: FontVars<FontCodeSize>
|
|
621
|
+
heading: FontVars<FontHeadingSize>
|
|
622
|
+
label: FontVars<FontLabelSize>
|
|
623
|
+
text: FontVars<FontTextSize>
|
|
624
|
+
}
|
|
590
625
|
space: Record<Space, CSSVar>
|
|
591
626
|
}
|
package/src/css/varNames.ts
CHANGED
|
@@ -186,7 +186,7 @@ export const varNames: VarNames = {
|
|
|
186
186
|
},
|
|
187
187
|
},
|
|
188
188
|
space: Object.fromEntries(
|
|
189
|
-
SPACE.map((space) => [space, `--space-${space}`
|
|
189
|
+
SPACE.map((space) => [space, `--space-${String(space).replace('.', '_')}` as CSSVarName]),
|
|
190
190
|
) as Record<Space, CSSVarName>,
|
|
191
191
|
} as const
|
|
192
192
|
|
package/src/css/vars.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
FONT_CODE_SIZE,
|
|
3
|
+
FONT_HEADING_SIZE,
|
|
4
|
+
FONT_TEXT_SIZE,
|
|
5
|
+
FontCodeSize,
|
|
6
|
+
FontHeadingSize,
|
|
7
|
+
FontLabelSize,
|
|
8
|
+
FontTextSize,
|
|
2
9
|
SPACE,
|
|
3
10
|
type Space,
|
|
4
11
|
THEME_COLOR_AVATAR_COLORS,
|
|
@@ -12,6 +19,7 @@ import {
|
|
|
12
19
|
type ThemeColorSchemeKey,
|
|
13
20
|
} from '@sanity/ui/theme'
|
|
14
21
|
import {
|
|
22
|
+
FontSizeVars,
|
|
15
23
|
type ColorAvatarVars,
|
|
16
24
|
type ColorBadgeVars,
|
|
17
25
|
type ColorCardVars,
|
|
@@ -162,6 +170,84 @@ export const vars: Vars = {
|
|
|
162
170
|
variable: `var(--color-syntax-variable)`,
|
|
163
171
|
},
|
|
164
172
|
},
|
|
173
|
+
font: {
|
|
174
|
+
code: {
|
|
175
|
+
family: `var(--font-code-family)`,
|
|
176
|
+
sizes: FONT_CODE_SIZE.reduce(
|
|
177
|
+
(acc, size) => {
|
|
178
|
+
return {
|
|
179
|
+
...acc,
|
|
180
|
+
[size]: {
|
|
181
|
+
fontSize: `var(--font-code-${size}-size)`,
|
|
182
|
+
ascenderHeight: `var(--font-code-${size}-ascender-height)`,
|
|
183
|
+
descenderHeight: `var(--font-code-${size}-descender-height)`,
|
|
184
|
+
lineHeight: `var(--font-code-${size}-line-height)`,
|
|
185
|
+
letterSpacing: `var(--font-code-${size}-letter-spacing)`,
|
|
186
|
+
iconSize: `var(--font-code-${size}-icon-size)`,
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{} as Record<FontCodeSize, FontSizeVars>,
|
|
191
|
+
),
|
|
192
|
+
},
|
|
193
|
+
heading: {
|
|
194
|
+
family: `var(--font-heading-family)`,
|
|
195
|
+
sizes: FONT_HEADING_SIZE.reduce(
|
|
196
|
+
(acc, size) => {
|
|
197
|
+
return {
|
|
198
|
+
...acc,
|
|
199
|
+
[size]: {
|
|
200
|
+
fontSize: `var(--font-code-${size}-size)`,
|
|
201
|
+
ascenderHeight: `var(--font-code-${size}-ascender-height)`,
|
|
202
|
+
descenderHeight: `var(--font-code-${size}-descender-height)`,
|
|
203
|
+
lineHeight: `var(--font-code-${size}-line-height)`,
|
|
204
|
+
letterSpacing: `var(--font-code-${size}-letter-spacing)`,
|
|
205
|
+
iconSize: `var(--font-code-${size}-icon-size)`,
|
|
206
|
+
},
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{} as Record<FontHeadingSize, FontSizeVars>,
|
|
210
|
+
),
|
|
211
|
+
},
|
|
212
|
+
label: {
|
|
213
|
+
family: `var(--font-label-family)`,
|
|
214
|
+
sizes: FONT_CODE_SIZE.reduce(
|
|
215
|
+
(acc, size) => {
|
|
216
|
+
return {
|
|
217
|
+
...acc,
|
|
218
|
+
[size]: {
|
|
219
|
+
fontSize: `var(--font-code-${size}-size)`,
|
|
220
|
+
ascenderHeight: `var(--font-code-${size}-ascender-height)`,
|
|
221
|
+
descenderHeight: `var(--font-code-${size}-descender-height)`,
|
|
222
|
+
lineHeight: `var(--font-code-${size}-line-height)`,
|
|
223
|
+
letterSpacing: `var(--font-code-${size}-letter-spacing)`,
|
|
224
|
+
iconSize: `var(--font-code-${size}-icon-size)`,
|
|
225
|
+
},
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{} as Record<FontLabelSize, FontSizeVars>,
|
|
229
|
+
),
|
|
230
|
+
},
|
|
231
|
+
text: {
|
|
232
|
+
family: `var(--font-text-family)`,
|
|
233
|
+
sizes: FONT_TEXT_SIZE.reduce(
|
|
234
|
+
(acc, size) => {
|
|
235
|
+
return {
|
|
236
|
+
...acc,
|
|
237
|
+
[size]: {
|
|
238
|
+
fontSize: `var(--font-code-${size}-size)`,
|
|
239
|
+
ascenderHeight: `var(--font-code-${size}-ascender-height)`,
|
|
240
|
+
descenderHeight: `var(--font-code-${size}-descender-height)`,
|
|
241
|
+
lineHeight: `var(--font-code-${size}-line-height)`,
|
|
242
|
+
letterSpacing: `var(--font-code-${size}-letter-spacing)`,
|
|
243
|
+
iconSize: `var(--font-code-${size}-icon-size)`,
|
|
244
|
+
},
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{} as Record<FontTextSize, FontSizeVars>,
|
|
248
|
+
),
|
|
249
|
+
},
|
|
250
|
+
},
|
|
165
251
|
space: Object.fromEntries(
|
|
166
252
|
SPACE.map((space) => [space, `var(${varNames.space[space]})` satisfies CSSVar]),
|
|
167
253
|
) as Record<Space, CSSVar>,
|