@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.
Files changed (216) hide show
  1. package/dist/_chunks-cjs/buildCommand.js +1387 -681
  2. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  3. package/dist/cli.js +4 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/css.d.mts +131 -12
  6. package/dist/css.d.ts +131 -12
  7. package/dist/css.esm.js +1450 -791
  8. package/dist/css.esm.js.map +1 -1
  9. package/dist/css.js +1449 -790
  10. package/dist/css.js.map +1 -1
  11. package/dist/css.mjs +1450 -791
  12. package/dist/css.mjs.map +1 -1
  13. package/dist/index.d.mts +84 -76
  14. package/dist/index.d.ts +84 -76
  15. package/dist/index.esm.js +2734 -3146
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +2733 -3145
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +2734 -3146
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/sanity-theme.css +1 -1
  22. package/dist/system.css +1590 -1158
  23. package/dist/theme.esm.js +1565 -452
  24. package/dist/theme.esm.js.map +1 -1
  25. package/dist/theme.js +1599 -484
  26. package/dist/theme.js.map +1 -1
  27. package/dist/theme.mjs +1565 -452
  28. package/dist/theme.mjs.map +1 -1
  29. package/package.json +22 -22
  30. package/src/core/__workshop__/constants.ts +14 -5
  31. package/src/core/__workshop__/fontsPlugin.tsx +1 -1
  32. package/src/core/_compat/index.ts +2 -0
  33. package/src/core/{styles → _compat/styles}/box/boxStyle.ts +1 -1
  34. package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
  35. package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -2
  36. package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
  37. package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
  38. package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
  39. package/src/core/{styles → _compat/styles}/helpers.ts +1 -1
  40. package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
  41. package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
  42. package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
  43. package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
  44. package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
  45. package/src/core/components/autocomplete/autocomplete.tsx +5 -5
  46. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  47. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  48. package/src/core/components/dialog/dialog.tsx +1 -5
  49. package/src/core/components/hotkeys/hotkeys.tsx +1 -1
  50. package/src/core/components/menu/menu.tsx +8 -10
  51. package/src/core/components/menu/menuDivider.tsx +16 -0
  52. package/src/core/components/menu/menuGroup.tsx +2 -8
  53. package/src/core/components/menu/menuItem.tsx +1 -1
  54. package/src/core/components/skeleton/skeleton.tsx +14 -20
  55. package/src/core/components/skeleton/textSkeleton.tsx +72 -48
  56. package/src/core/components/tab/tab.tsx +0 -1
  57. package/src/core/components/tab/tabList.tsx +4 -21
  58. package/src/core/components/tab/tabPanel.tsx +1 -0
  59. package/src/core/components/toast/toast.tsx +27 -14
  60. package/src/core/components/toast/toastProvider.tsx +4 -13
  61. package/src/core/components/tree/tree.tsx +1 -2
  62. package/src/core/components/tree/treeGroup.tsx +4 -1
  63. package/src/core/components/tree/treeItem.tsx +11 -15
  64. package/src/core/hooks/useArrayProp.ts +1 -1
  65. package/src/core/index.ts +0 -1
  66. package/src/core/lib/styled/members.ts +2 -2
  67. package/src/core/primitives/avatar/avatar.tsx +0 -21
  68. package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
  69. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  70. package/src/core/primitives/avatar/styles.ts +2 -2
  71. package/src/core/primitives/box/box.tsx +4 -1
  72. package/src/core/primitives/button/__workshop__/props.tsx +2 -1
  73. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  74. package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
  75. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  76. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  77. package/src/core/primitives/button/styles.ts +3 -3
  78. package/src/core/primitives/card/__workshop__/props.tsx +2 -2
  79. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  80. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  81. package/src/core/primitives/card/card.tsx +7 -10
  82. package/src/core/primitives/code/code.tsx +2 -4
  83. package/src/core/primitives/container/styles.ts +1 -1
  84. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  85. package/src/core/primitives/flex/flex.tsx +1 -13
  86. package/src/core/primitives/grid/grid.tsx +5 -19
  87. package/src/core/primitives/heading/heading.tsx +8 -25
  88. package/src/core/primitives/heading/styles.ts +1 -1
  89. package/src/core/primitives/inline/inline.tsx +3 -12
  90. package/src/core/primitives/inline/styles.ts +1 -1
  91. package/src/core/primitives/label/label.tsx +4 -9
  92. package/src/core/primitives/label/styles.ts +1 -1
  93. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
  94. package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
  95. package/src/core/primitives/popover/popover.tsx +1 -1
  96. package/src/core/primitives/popover/popoverCard.tsx +1 -1
  97. package/src/core/primitives/radio/radio.tsx +1 -1
  98. package/src/core/primitives/radio/styles.ts +2 -2
  99. package/src/core/primitives/select/select.tsx +1 -1
  100. package/src/core/primitives/select/styles.ts +3 -3
  101. package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
  102. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
  103. package/src/core/primitives/spinner/spinner.tsx +2 -2
  104. package/src/core/primitives/stack/styles.ts +1 -1
  105. package/src/core/primitives/switch/styles.ts +2 -2
  106. package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
  107. package/src/core/primitives/text/styles.ts +1 -1
  108. package/src/core/primitives/text/text.tsx +1 -4
  109. package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
  110. package/src/core/primitives/textArea/textArea.tsx +3 -3
  111. package/src/core/primitives/textInput/__workshop__/plain.tsx +3 -2
  112. package/src/core/primitives/textInput/textInput.tsx +16 -83
  113. package/src/core/primitives/tooltip/tooltipCard.tsx +5 -5
  114. package/src/core/primitives/types.ts +1 -0
  115. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  116. package/src/core/theme/__workshop__/build/story.tsx +2 -4
  117. package/src/core/theme/themeProvider.tsx +1 -1
  118. package/src/core/types/box.ts +22 -16
  119. package/src/core/types/grid.ts +17 -12
  120. package/src/core/types/text.ts +7 -4
  121. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  122. package/src/core/utils/layer/layer.tsx +2 -2
  123. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  124. package/src/css/compile/{comileRules.ts → compileRules.ts} +2 -5
  125. package/src/css/compile/compileSystem.ts +1 -1
  126. package/src/css/compile/compileTheme.ts +4 -1
  127. package/src/css/components/breadcrumbs/rules.ts +18 -0
  128. package/src/css/components/menu/index.ts +1 -0
  129. package/src/css/components/menu/menu.ts +5 -0
  130. package/src/css/components/menu/rules.ts +10 -0
  131. package/src/css/components/skeleton/index.ts +2 -0
  132. package/src/css/components/skeleton/rules.ts +106 -0
  133. package/src/css/components/skeleton/skeleton.ts +31 -0
  134. package/src/css/components/skeleton/types.ts +24 -0
  135. package/src/css/components/toast/rules.ts +68 -0
  136. package/src/css/components/tree/rules.ts +115 -0
  137. package/src/css/index.ts +4 -0
  138. package/src/css/primitives/box/box.ts +5 -1
  139. package/src/css/primitives/box/types.ts +7 -8
  140. package/src/css/primitives/card/rules.ts +161 -13
  141. package/src/css/primitives/checkbox/__styles.ts +115 -113
  142. package/src/css/primitives/selectable/__style.ts +117 -115
  143. package/src/css/primitives/spinner/rules.ts +5 -7
  144. package/src/css/primitives/spinner/spinner.ts +4 -0
  145. package/src/css/primitives/textInput/index.ts +1 -0
  146. package/src/css/primitives/textInput/rules.ts +159 -64
  147. package/src/css/primitives/textInput/textInput.ts +11 -3
  148. package/src/css/primitives/textInput/types.ts +8 -0
  149. package/src/css/rules.ts +16 -38
  150. package/src/css/styles/font/font.ts +7 -2
  151. package/src/css/styles/font/rules.ts +23 -0
  152. package/src/css/styles/font/types.ts +6 -0
  153. package/src/css/styles/gap/rules.ts +6 -6
  154. package/src/css/styles/grid/grid.ts +13 -0
  155. package/src/css/styles/grid/index.ts +2 -0
  156. package/src/css/styles/grid/rules.ts +112 -1
  157. package/src/css/styles/grid/types.ts +29 -0
  158. package/src/css/styles/margin/rules.ts +58 -54
  159. package/src/css/styles/outline/rules.ts +7 -0
  160. package/src/css/styles/overflow/index.ts +2 -0
  161. package/src/css/styles/overflow/overflow.ts +11 -0
  162. package/src/css/styles/overflow/types.ts +11 -0
  163. package/src/css/styles/padding/rules.ts +50 -48
  164. package/src/css/types.ts +36 -1
  165. package/src/css/varNames.ts +1 -1
  166. package/src/css/vars.ts +86 -0
  167. package/dist/_chunks-cjs/getTheme_v2.js +0 -316
  168. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  169. package/dist/_chunks-es/getTheme_v2.mjs +0 -317
  170. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  171. package/dist/_legacy/getTheme_v2.esm.js +0 -317
  172. package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
  173. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
  174. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -17
  175. package/src/core/components/menu/menuDivider.ts +0 -13
  176. package/src/core/components/skeleton/styles.ts +0 -50
  177. package/src/core/components/toast/styles.ts +0 -61
  178. package/src/core/components/tree/style.ts +0 -104
  179. package/src/core/primitives/card/styles.ts +0 -146
  180. /package/src/core/{styles → _compat/styles}/border/borderStyle.ts +0 -0
  181. /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
  182. /package/src/core/{styles → _compat/styles}/border/types.ts +0 -0
  183. /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
  184. /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
  185. /package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -0
  186. /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
  187. /package/src/core/{styles → _compat/styles}/flex/types.ts +0 -0
  188. /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
  189. /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
  190. /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
  191. /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
  192. /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
  193. /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
  194. /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
  195. /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
  196. /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
  197. /package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -0
  198. /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
  199. /package/src/core/{styles → _compat/styles}/index.ts +0 -0
  200. /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
  201. /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
  202. /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
  203. /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
  204. /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
  205. /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
  206. /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
  207. /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
  208. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
  209. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
  210. /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
  211. /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
  212. /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
  213. /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
  214. /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
  215. /package/src/core/{styles → _compat/styles}/types.ts +0 -0
  216. /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 = 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
- }, {})
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,7 @@
1
+ import {Rules} from '../../types'
2
+
3
+ export const outlineRules: Rules = {
4
+ 'outline-none': {
5
+ outline: 'none',
6
+ },
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './overflow'
2
+ export * from './types'
@@ -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 = SPACE.reduce<Rules>((acc, space) => {
7
- return {
8
- ...acc,
9
- ...responsiveRules(`p-${space}`, {padding: vars.space[space]}),
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
- 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
- }, {})
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
- 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
- }, {})
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
- export const paddingTopRules = SPACE.reduce<Rules>((acc, space) => {
34
- return {
35
- ...acc,
36
- ...responsiveRules(`pt-${space}`, {paddingTop: vars.space[space]}),
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
- export const paddingRightRules = SPACE.reduce<Rules>((acc, space) => {
41
- return {
42
- ...acc,
43
- ...responsiveRules(`pr-${space}`, {paddingRight: vars.space[space]}),
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
- export const paddingBottomRules = SPACE.reduce<Rules>((acc, space) => {
48
- return {
49
- ...acc,
50
- ...responsiveRules(`pb-${space}`, {paddingBottom: vars.space[space]}),
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
- export const paddingLeftRules = SPACE.reduce<Rules>((acc, space) => {
55
- return {
56
- ...acc,
57
- ...responsiveRules(`pl-${space}`, {paddingLeft: vars.space[space]}),
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
  }
@@ -186,7 +186,7 @@ export const varNames: VarNames = {
186
186
  },
187
187
  },
188
188
  space: Object.fromEntries(
189
- SPACE.map((space) => [space, `--space-${space}` satisfies CSSVarName]),
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>,