@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.
Files changed (389) hide show
  1. package/bin/ui.js +6 -0
  2. package/dist/_chunks-cjs/buildCommand.js +3542 -0
  3. package/dist/_chunks-cjs/buildCommand.js.map +1 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +25 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/css.d.mts +1062 -0
  8. package/dist/css.d.ts +1062 -0
  9. package/dist/css.esm.js +3794 -0
  10. package/dist/css.esm.js.map +1 -0
  11. package/dist/css.js +3794 -0
  12. package/dist/css.js.map +1 -0
  13. package/dist/css.mjs +3794 -0
  14. package/dist/css.mjs.map +1 -0
  15. package/dist/index.d.mts +240 -221
  16. package/dist/index.d.ts +240 -221
  17. package/dist/index.esm.js +3033 -4536
  18. package/dist/index.esm.js.map +1 -1
  19. package/dist/index.js +3037 -4541
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +3033 -4536
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/sanity-theme.css +25 -0
  24. package/dist/system.css +3385 -0
  25. package/dist/theme.d.mts +84 -22
  26. package/dist/theme.d.ts +84 -22
  27. package/dist/theme.esm.js +1718 -656
  28. package/dist/theme.esm.js.map +1 -1
  29. package/dist/theme.js +1757 -693
  30. package/dist/theme.js.map +1 -1
  31. package/dist/theme.mjs +1718 -656
  32. package/dist/theme.mjs.map +1 -1
  33. package/exports/css.ts +1 -0
  34. package/package.json +45 -24
  35. package/src/core/__workshop__/constants.ts +28 -19
  36. package/src/core/_compat/index.ts +2 -0
  37. package/src/core/{styles → _compat/styles}/border/borderStyle.ts +6 -0
  38. package/src/core/{styles → _compat/styles}/border/types.ts +1 -0
  39. package/src/core/{styles → _compat/styles}/box/boxStyle.ts +7 -1
  40. package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
  41. package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -10
  42. package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
  43. package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -18
  44. package/src/core/{styles → _compat/styles}/flex/types.ts +1 -3
  45. package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
  46. package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -10
  47. package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
  48. package/src/core/{styles → _compat/styles}/helpers.ts +10 -1
  49. package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
  50. package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
  51. package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
  52. package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
  53. package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
  54. package/src/core/components/autocomplete/autocomplete.tsx +17 -9
  55. package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
  56. package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
  57. package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
  58. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  59. package/src/core/components/dialog/dialog.tsx +73 -92
  60. package/src/core/components/hotkeys/hotkeys.tsx +18 -29
  61. package/src/core/components/menu/menu.tsx +13 -12
  62. package/src/core/components/menu/menuDivider.tsx +16 -0
  63. package/src/core/components/menu/menuGroup.tsx +10 -8
  64. package/src/core/components/menu/menuItem.tsx +23 -14
  65. package/src/core/components/skeleton/skeleton.tsx +14 -20
  66. package/src/core/components/skeleton/textSkeleton.tsx +72 -48
  67. package/src/core/components/tab/tab.tsx +5 -7
  68. package/src/core/components/tab/tabList.tsx +5 -21
  69. package/src/core/components/tab/tabPanel.tsx +1 -0
  70. package/src/core/components/toast/toast.tsx +31 -16
  71. package/src/core/components/toast/toastProvider.tsx +23 -23
  72. package/src/core/components/tree/tree.tsx +7 -2
  73. package/src/core/components/tree/treeGroup.tsx +4 -1
  74. package/src/core/components/tree/treeItem.tsx +44 -35
  75. package/src/core/components/tree/types.ts +5 -1
  76. package/src/core/hooks/useArrayProp.ts +1 -1
  77. package/src/core/index.ts +0 -1
  78. package/src/core/lib/styled/elements.ts +135 -0
  79. package/src/core/lib/styled/index.ts +2 -0
  80. package/src/core/lib/styled/members.ts +15 -0
  81. package/src/core/lib/styled/styled.ts +79 -0
  82. package/src/core/primitives/_selectable/selectable.tsx +27 -14
  83. package/src/core/primitives/avatar/avatar.tsx +38 -39
  84. package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
  85. package/src/core/primitives/avatar/avatarStack.tsx +2 -2
  86. package/src/core/primitives/avatar/styles.ts +2 -2
  87. package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
  88. package/src/core/primitives/badge/badge.tsx +18 -20
  89. package/src/core/primitives/box/box.tsx +65 -74
  90. package/src/core/primitives/button/__workshop__/props.tsx +5 -2
  91. package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
  92. package/src/core/primitives/button/button.tsx +38 -45
  93. package/src/core/primitives/button/styles.ts +5 -5
  94. package/src/core/primitives/card/RootCardContext.ts +3 -0
  95. package/src/core/primitives/card/__workshop__/props.tsx +2 -2
  96. package/src/core/primitives/card/card.tsx +37 -42
  97. package/src/core/primitives/checkbox/checkbox.tsx +6 -8
  98. package/src/core/primitives/code/code.tsx +22 -13
  99. package/src/core/primitives/code/styles.ts +1 -1
  100. package/src/core/primitives/container/container.tsx +7 -15
  101. package/src/core/primitives/container/styles.ts +1 -1
  102. package/src/core/primitives/flex/flex.tsx +6 -31
  103. package/src/core/primitives/grid/grid.tsx +6 -19
  104. package/src/core/primitives/heading/heading.tsx +24 -28
  105. package/src/core/primitives/heading/styles.ts +2 -2
  106. package/src/core/primitives/inline/inline.tsx +18 -18
  107. package/src/core/primitives/inline/styles.ts +1 -1
  108. package/src/core/primitives/kbd/kbd.tsx +30 -37
  109. package/src/core/primitives/label/label.tsx +15 -9
  110. package/src/core/primitives/label/styles.ts +2 -2
  111. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
  112. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
  113. package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
  114. package/src/core/primitives/popover/popover.tsx +21 -15
  115. package/src/core/primitives/popover/popoverCard.tsx +36 -38
  116. package/src/core/primitives/radio/radio.tsx +1 -1
  117. package/src/core/primitives/radio/styles.ts +3 -3
  118. package/src/core/primitives/select/select.tsx +1 -1
  119. package/src/core/primitives/select/styles.ts +3 -3
  120. package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
  121. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
  122. package/src/core/primitives/spinner/spinner.tsx +8 -22
  123. package/src/core/primitives/stack/stack.tsx +12 -10
  124. package/src/core/primitives/stack/styles.ts +1 -1
  125. package/src/core/primitives/switch/styles.ts +11 -11
  126. package/src/core/primitives/switch/switch.tsx +20 -21
  127. package/src/core/primitives/text/styles.ts +2 -3
  128. package/src/core/primitives/text/text.tsx +18 -25
  129. package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
  130. package/src/core/primitives/textArea/textArea.tsx +3 -3
  131. package/src/core/primitives/textInput/__workshop__/plain.tsx +4 -3
  132. package/src/core/primitives/textInput/textInput.tsx +111 -125
  133. package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
  134. package/src/core/primitives/tooltip/tooltip.tsx +13 -13
  135. package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
  136. package/src/core/primitives/types.ts +36 -16
  137. package/src/core/theme/__workshop__/build/story.tsx +2 -4
  138. package/src/core/theme/useTheme.ts +1 -1
  139. package/src/core/types/avatar.ts +6 -1
  140. package/src/core/types/box.ts +22 -16
  141. package/src/core/types/button.ts +1 -0
  142. package/src/core/types/flex.ts +27 -26
  143. package/src/core/types/grid.ts +17 -12
  144. package/src/core/types/gridItem.ts +32 -24
  145. package/src/core/types/radius.ts +7 -4
  146. package/src/core/types/text.ts +7 -4
  147. package/src/core/utils/arrow/arrow.tsx +1 -1
  148. package/src/core/utils/layer/layer.tsx +28 -11
  149. package/src/core/utils/srOnly/srOnly.tsx +1 -1
  150. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  151. package/src/css/_resp.ts +28 -0
  152. package/src/css/cli/buildCommand.ts +36 -0
  153. package/src/css/cli/index.ts +38 -0
  154. package/src/css/compile/compileRule.ts +58 -0
  155. package/src/css/compile/compileRules.ts +56 -0
  156. package/src/css/compile/compileSystem.ts +7 -0
  157. package/src/css/compile/compileTheme.ts +512 -0
  158. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
  159. package/src/css/components/breadcrumbs/index.ts +1 -0
  160. package/src/css/components/breadcrumbs/rules.ts +25 -0
  161. package/src/css/components/dialog/classes.ts +29 -0
  162. package/src/css/components/dialog/index.ts +1 -0
  163. package/src/css/components/dialog/rules.ts +75 -0
  164. package/src/css/components/menu/index.ts +1 -0
  165. package/src/css/components/menu/menu.ts +5 -0
  166. package/src/css/components/menu/rules.ts +10 -0
  167. package/src/css/components/skeleton/index.ts +2 -0
  168. package/src/css/components/skeleton/rules.ts +106 -0
  169. package/src/css/components/skeleton/skeleton.ts +31 -0
  170. package/src/css/components/skeleton/types.ts +24 -0
  171. package/src/css/components/toast/rules.ts +68 -0
  172. package/src/css/components/tree/index.ts +1 -0
  173. package/src/css/components/tree/rules.ts +167 -0
  174. package/src/css/components/tree/tree.ts +5 -0
  175. package/src/css/composeClassNames.ts +3 -0
  176. package/src/css/index.ts +51 -0
  177. package/src/css/primitives/avatar/avatar.ts +32 -0
  178. package/src/css/primitives/avatar/index.ts +2 -0
  179. package/src/css/primitives/avatar/rules.ts +190 -0
  180. package/src/css/primitives/avatar/types.ts +9 -0
  181. package/src/css/primitives/badge/badge.ts +8 -0
  182. package/src/css/primitives/badge/index.ts +2 -0
  183. package/src/css/primitives/badge/rules.ts +25 -0
  184. package/src/css/primitives/badge/types.ts +8 -0
  185. package/src/css/primitives/box/box.ts +38 -0
  186. package/src/css/primitives/box/index.ts +2 -0
  187. package/src/css/primitives/box/rules.ts +25 -0
  188. package/src/css/primitives/box/types.ts +48 -0
  189. package/src/css/primitives/button/button.ts +26 -0
  190. package/src/css/primitives/button/index.ts +1 -0
  191. package/src/css/primitives/button/rules.ts +58 -0
  192. package/src/css/primitives/card/card.ts +21 -0
  193. package/src/css/primitives/card/index.ts +1 -0
  194. package/src/css/primitives/card/rules.ts +241 -0
  195. package/src/css/primitives/checkbox/__styles.ts +129 -0
  196. package/src/css/primitives/checkbox/checkbox.ts +9 -0
  197. package/src/css/primitives/checkbox/index.ts +1 -0
  198. package/src/css/primitives/checkbox/rules.ts +136 -0
  199. package/src/css/primitives/code/code.ts +9 -0
  200. package/src/css/primitives/code/index.ts +2 -0
  201. package/src/css/primitives/code/rules.ts +71 -0
  202. package/src/css/primitives/code/types.ts +10 -0
  203. package/src/css/primitives/container/container.ts +7 -0
  204. package/src/css/primitives/container/index.ts +2 -0
  205. package/src/css/primitives/container/rules.ts +8 -0
  206. package/src/css/primitives/container/types.ts +6 -0
  207. package/src/css/primitives/heading/heading.ts +16 -0
  208. package/src/css/primitives/heading/index.ts +2 -0
  209. package/src/css/primitives/heading/rules.ts +84 -0
  210. package/src/css/primitives/heading/types.ts +12 -0
  211. package/src/css/primitives/kbd/index.ts +2 -0
  212. package/src/css/primitives/kbd/kbd.ts +7 -0
  213. package/src/css/primitives/kbd/rules.ts +20 -0
  214. package/src/css/primitives/kbd/types.ts +5 -0
  215. package/src/css/primitives/label/index.ts +2 -0
  216. package/src/css/primitives/label/label.ts +16 -0
  217. package/src/css/primitives/label/rules.ts +85 -0
  218. package/src/css/primitives/label/types.ts +12 -0
  219. package/src/css/primitives/popover/index.ts +1 -0
  220. package/src/css/primitives/popover/popover.ts +5 -0
  221. package/src/css/primitives/popover/rules.ts +5 -0
  222. package/src/css/primitives/radio/index.ts +1 -0
  223. package/src/css/primitives/radio/radio.ts +5 -0
  224. package/src/css/primitives/radio/rules.ts +5 -0
  225. package/src/css/primitives/select/index.ts +1 -0
  226. package/src/css/primitives/select/rules.ts +5 -0
  227. package/src/css/primitives/select/select.ts +5 -0
  228. package/src/css/primitives/selectable/__style.ts +117 -0
  229. package/src/css/primitives/selectable/index.ts +2 -0
  230. package/src/css/primitives/selectable/rules.ts +27 -0
  231. package/src/css/primitives/selectable/selectable.ts +9 -0
  232. package/src/css/primitives/selectable/types.ts +6 -0
  233. package/src/css/primitives/spinner/index.ts +1 -0
  234. package/src/css/primitives/spinner/rules.ts +20 -0
  235. package/src/css/primitives/spinner/spinner.ts +9 -0
  236. package/src/css/primitives/switch/index.ts +1 -0
  237. package/src/css/primitives/switch/rules.ts +132 -0
  238. package/src/css/primitives/switch/switch.ts +5 -0
  239. package/src/css/primitives/text/index.ts +2 -0
  240. package/src/css/primitives/text/rules.ts +75 -0
  241. package/src/css/primitives/text/text.ts +16 -0
  242. package/src/css/primitives/text/types.ts +11 -0
  243. package/src/css/primitives/textArea/index.ts +1 -0
  244. package/src/css/primitives/textArea/rules.ts +5 -0
  245. package/src/css/primitives/textArea/textArea.ts +5 -0
  246. package/src/css/primitives/textInput/index.ts +2 -0
  247. package/src/css/primitives/textInput/rules.ts +321 -0
  248. package/src/css/primitives/textInput/textInput.ts +15 -0
  249. package/src/css/primitives/textInput/types.ts +8 -0
  250. package/src/css/primitives/token/rules.ts +45 -0
  251. package/src/css/primitives/tooltip/index.ts +1 -0
  252. package/src/css/primitives/tooltip/rules.ts +17 -0
  253. package/src/css/primitives/tooltip/tooltip.ts +9 -0
  254. package/src/css/responsiveRules.ts +25 -0
  255. package/src/css/rules.ts +99 -0
  256. package/src/css/styles/border/border.ts +22 -0
  257. package/src/css/styles/border/index.ts +2 -0
  258. package/src/css/styles/border/rules.ts +24 -0
  259. package/src/css/styles/border/types.ts +10 -0
  260. package/src/css/styles/display/rules.ts +62 -0
  261. package/src/css/styles/flex/flex.ts +20 -0
  262. package/src/css/styles/flex/index.ts +2 -0
  263. package/src/css/styles/flex/rules.ts +28 -0
  264. package/src/css/styles/flex/types.ts +35 -0
  265. package/src/css/styles/flexItem/flexItem.ts +8 -0
  266. package/src/css/styles/flexItem/index.ts +2 -0
  267. package/src/css/styles/flexItem/rules.ts +11 -0
  268. package/src/css/styles/flexItem/types.ts +11 -0
  269. package/src/css/styles/font/font.ts +17 -0
  270. package/src/css/styles/font/index.ts +2 -0
  271. package/src/css/styles/font/rules.ts +148 -0
  272. package/src/css/styles/font/types.ts +12 -0
  273. package/src/css/styles/gap/gap.ts +8 -0
  274. package/src/css/styles/gap/index.ts +2 -0
  275. package/src/css/styles/gap/rules.ts +33 -0
  276. package/src/css/styles/gap/types.ts +9 -0
  277. package/src/css/styles/grid/grid.ts +13 -0
  278. package/src/css/styles/grid/index.ts +2 -0
  279. package/src/css/styles/grid/rules.ts +146 -0
  280. package/src/css/styles/grid/types.ts +29 -0
  281. package/src/css/styles/gridItem/gridItem.ts +15 -0
  282. package/src/css/styles/gridItem/index.ts +2 -0
  283. package/src/css/styles/gridItem/rules.ts +96 -0
  284. package/src/css/styles/gridItem/types.ts +41 -0
  285. package/src/css/styles/height/rules.ts +7 -0
  286. package/src/css/styles/margin/index.ts +2 -0
  287. package/src/css/styles/margin/margin.ts +15 -0
  288. package/src/css/styles/margin/rules.ts +63 -0
  289. package/src/css/styles/margin/types.ts +11 -0
  290. package/src/css/styles/maxWidth/index.ts +2 -0
  291. package/src/css/styles/maxWidth/maxWidth.ts +6 -0
  292. package/src/css/styles/maxWidth/rules.ts +36 -0
  293. package/src/css/styles/maxWidth/types.ts +6 -0
  294. package/src/css/styles/outline/rules.ts +7 -0
  295. package/src/css/styles/overflow/index.ts +2 -0
  296. package/src/css/styles/overflow/overflow.ts +11 -0
  297. package/src/css/styles/overflow/rules.ts +9 -0
  298. package/src/css/styles/overflow/types.ts +11 -0
  299. package/src/css/styles/padding/index.ts +2 -0
  300. package/src/css/styles/padding/padding.ts +15 -0
  301. package/src/css/styles/padding/rules.ts +61 -0
  302. package/src/css/styles/padding/types.ts +12 -0
  303. package/src/css/styles/pointerEvents/index.ts +2 -0
  304. package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
  305. package/src/css/styles/pointerEvents/rules.ts +11 -0
  306. package/src/css/styles/pointerEvents/types.ts +7 -0
  307. package/src/css/styles/position/index.ts +2 -0
  308. package/src/css/styles/position/position.ts +7 -0
  309. package/src/css/styles/position/rules.ts +31 -0
  310. package/src/css/styles/position/types.ts +13 -0
  311. package/src/css/styles/radius/index.ts +2 -0
  312. package/src/css/styles/radius/radius.ts +8 -0
  313. package/src/css/styles/radius/rules.ts +13 -0
  314. package/src/css/styles/radius/types.ts +7 -0
  315. package/src/css/styles/shadow/rules.ts +53 -0
  316. package/src/css/styles/width/index.ts +2 -0
  317. package/src/css/styles/width/rules.ts +7 -0
  318. package/src/css/styles/width/types.ts +8 -0
  319. package/src/css/styles/width/width.ts +6 -0
  320. package/src/css/types.ts +626 -0
  321. package/src/css/varNames.ts +381 -0
  322. package/src/css/vars.ts +399 -0
  323. package/src/theme/build/_deprecated/color/factory.ts +1 -1
  324. package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
  325. package/src/theme/build/buildColorTheme.ts +39 -45
  326. package/src/theme/build/renderColorTheme.ts +65 -239
  327. package/src/theme/build/resolveColorTokens.ts +115 -51
  328. package/src/theme/config/tokens/color/types.ts +18 -4
  329. package/src/theme/defaults/colorTokens.ts +10 -17
  330. package/src/theme/defaults/config.ts +1 -1
  331. package/src/theme/getScopedTheme.ts +2 -9
  332. package/src/theme/system/_constants.ts +25 -0
  333. package/src/theme/system/_types.ts +41 -0
  334. package/src/theme/system/color/_constants.ts +0 -8
  335. package/src/theme/system/color/badge.ts +7 -3
  336. package/src/theme/system/index.ts +2 -0
  337. package/src/theme/system/v0/color/_system.ts +4 -8
  338. package/src/theme/system/v0/color/color.ts +2 -3
  339. package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
  340. package/src/theme/versioning/v0_v2.ts +0 -4
  341. package/dist/_chunks-cjs/getTheme_v2.js +0 -342
  342. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  343. package/dist/_chunks-es/getTheme_v2.mjs +0 -343
  344. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  345. package/dist/_legacy/getTheme_v2.esm.js +0 -343
  346. package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
  347. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
  348. package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
  349. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -5
  350. package/src/core/components/dialog/styles.ts +0 -76
  351. package/src/core/components/menu/menuDivider.ts +0 -12
  352. package/src/core/components/skeleton/styles.ts +0 -50
  353. package/src/core/components/toast/styles.ts +0 -61
  354. package/src/core/components/tree/style.ts +0 -104
  355. package/src/core/primitives/_selectable/style.ts +0 -114
  356. package/src/core/primitives/card/styles.ts +0 -146
  357. package/src/core/primitives/checkbox/styles.ts +0 -127
  358. /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
  359. /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
  360. /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
  361. /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
  362. /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
  363. /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
  364. /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
  365. /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
  366. /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
  367. /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
  368. /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
  369. /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
  370. /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
  371. /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
  372. /package/src/core/{styles → _compat/styles}/index.ts +0 -0
  373. /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
  374. /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
  375. /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
  376. /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
  377. /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
  378. /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
  379. /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
  380. /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
  381. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
  382. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
  383. /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
  384. /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
  385. /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
  386. /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
  387. /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
  388. /package/src/core/{styles → _compat/styles}/types.ts +0 -0
  389. /package/src/core/{_compat.ts → _compat/types.ts} +0 -0
@@ -0,0 +1,241 @@
1
+ import {THEME_COLOR_AVATAR_COLORS, THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
2
+ import {Properties, Rules} from '../../types'
3
+
4
+ export const cardRules: Rules = {
5
+ card: {
6
+ 'backgroundColor': 'var(--card-bg-color)',
7
+ 'color': 'var(--card-fg-color)',
8
+
9
+ /* deprecated variables (kept for legacy) */
10
+ '--card-accent-fg-color': 'var(--color-accent-fg)',
11
+
12
+ ...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => {
13
+ return {
14
+ ...acc,
15
+ [`--card-avatar-${color}-bg-color`]: `var(--color-avatar-${color}-bg)`,
16
+ [`--card-avatar-${color}-fg-color`]: `var(--color-avatar-${color}-fg)`,
17
+ }
18
+ }, {} as Properties),
19
+
20
+ '--card-backdrop-color': 'var(--color-backdrop)',
21
+
22
+ ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
23
+ return {
24
+ ...acc,
25
+ [`--card-badge-${tone}-bg-color`]: `var(--color-badge-${tone}-bg)`,
26
+ [`--card-badge-${tone}-dot-color`]: `var(--color-badge-${tone}-dot)`,
27
+ [`--card-badge-${tone}-fg-color`]: `var(--color-badge-${tone}-fg)`,
28
+ [`--card-badge-${tone}-icon-color`]: `var(--color-badge-${tone}-icon)`,
29
+ }
30
+ }, {} as Properties),
31
+
32
+ '--card-bg-color': 'var(--color-bg)',
33
+ '--card-border-color': 'var(--color-border)',
34
+ '--card-code-bg-color': 'var(--color-code-bg)',
35
+ '--card-code-fg-color': 'var(--color-code-fg)',
36
+ '--card-fg-color': 'var(--color-fg)',
37
+ '--card-focus-ring-color': 'var(--color-focus-ring)',
38
+
39
+ '--card-icon-color': 'var(--color-icon)',
40
+
41
+ '--card-kbd-bg-color': 'var(--color-kbd-bg)',
42
+ '--card-kbd-border-color': 'var(--color-kbd-border)',
43
+ '--card-kbd-fg-color': 'var(--color-kbd-fg)',
44
+
45
+ '--card-link-fg-color': 'var(--color-link-fg)',
46
+
47
+ '--card-muted-bg-color': 'var(--color-muted-bg)',
48
+ '--card-muted-fg-color': 'var(--color-muted-fg)',
49
+
50
+ '--card-shadow-outline-color': 'var(--color-shadow-outline)',
51
+ '--card-shadow-umbra-color': 'var(--color-shadow-umbra)',
52
+ '--card-shadow-penumbra-color': 'var(--color-shadow-penumbra)',
53
+ '--card-shadow-ambient-color': 'var(--color-shadow-ambient)',
54
+
55
+ '--card-skeleton-from-color': 'var(--color-skeleton-from)',
56
+ '--card-skeleton-to-color': 'var(--color-skeleton-to)',
57
+
58
+ '--card-bg2-color': `var(--color-muted-bg)`,
59
+ '--card-link-color': `var(--color-link-fg)`,
60
+ '--card-hairline-soft-color': `var(--color-border)`,
61
+ '--card-hairline-hard-color': `var(--color-border)`,
62
+
63
+ '@nest': {
64
+ '&[data-checkered]': {
65
+ '--card-bg-image': `repeating-conic-gradient(var(--color-bg) 0% 25%, var(--color-muted-bg) 0% 50%)`,
66
+ 'backgroundSize': `var(--space-3) var(--space-3)`,
67
+ 'backgroundPosition': '50% 50%',
68
+ 'backgroundImage': 'var(--card-bg-image)',
69
+ },
70
+
71
+ '&[data-as="button"]': {
72
+ WebkitFontSmoothing: 'inherit',
73
+ appearance: 'none',
74
+ outline: 'none',
75
+ font: 'inherit',
76
+ textAlign: 'inherit',
77
+ border: 0,
78
+ width: ['-moz-available', '-webkit-fill-available', 'stretch'],
79
+ },
80
+
81
+ '&[data-as="a"]': {
82
+ outline: 'none',
83
+ textDecoration: 'none',
84
+ },
85
+
86
+ '&[data-as="pre"]': {
87
+ font: 'inherit',
88
+ },
89
+ },
90
+ },
91
+ }
92
+
93
+ // import {getTheme_v2} from '@sanity/ui/theme'
94
+ // import {css} from '../../lib/styled'
95
+ // // import {ThemeProps} from '../../styles'
96
+ // // import {_cardColorStyle} from '../../styles/card'
97
+ // // import {focusRingStyle} from '../../styles/focusRing'
98
+ // import {CardStyleProps} from './types'
99
+ // import {ThemeProps} from '../../_compat'
100
+ // import {_cardColorStyle} from '../../_compat/styles/card'
101
+ // import {focusRingStyle} from '../../_compat/styles/focusRing'
102
+
103
+ // export function cardStyle(
104
+ // props: CardStyleProps & ThemeProps,
105
+ // ): Array<ReturnType<typeof css> | (() => ReturnType<typeof css>)> {
106
+ // return [cardBaseStyle(props), cardColorStyle(props)]
107
+ // }
108
+
109
+ // export function cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
110
+ // const {$checkered} = props
111
+ // const {space} = getTheme_v2(props.theme)
112
+
113
+ // return css`
114
+ // ${$checkered &&
115
+ // css`
116
+ // background-size: ${space[3]}px ${space[3]}px;
117
+ // background-position: 50% 50%;
118
+ // background-image: var(--card-bg-image);
119
+ // `}
120
+
121
+ // &[data-as='button'] {
122
+ // -webkit-font-smoothing: inherit;
123
+ // appearance: none;
124
+ // outline: none;
125
+ // font: inherit;
126
+ // text-align: inherit;
127
+ // border: 0;
128
+ // width: -moz-available;
129
+ // width: -webkit-fill-available;
130
+ // width: stretch;
131
+ // }
132
+
133
+ // /* &:is(a) */
134
+ // &[data-as='a'] {
135
+ // outline: none;
136
+ // text-decoration: none;
137
+ // }
138
+
139
+ // /* &:is(pre) */
140
+ // &[data-as='pre'] {
141
+ // font: inherit;
142
+ // }
143
+ // `
144
+ // }
145
+
146
+ // export function cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
147
+ // const {$checkered, $focusRing, $muted} = props
148
+ // const {card, color, style} = getTheme_v2(props.theme)
149
+ // const border = {width: card.border.width, color: 'var(--card-border-color)'}
150
+
151
+ // return css`
152
+ // color-scheme: ${color._dark ? 'dark' : 'light'};
153
+
154
+ // ${_cardColorStyle(color, color, $checkered)}
155
+
156
+ // background-color: ${$muted ? 'var(--card-muted-bg-color)' : 'var(--card-bg-color)'};
157
+ // color: var(--card-fg-color);
158
+
159
+ // /* &:is(button) */
160
+ // &[data-as='button'] {
161
+ // --card-focus-ring-box-shadow: none;
162
+
163
+ // cursor: default;
164
+ // box-shadow: var(--card-focus-ring-box-shadow);
165
+
166
+ // &:disabled {
167
+ // ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
168
+ // }
169
+
170
+ // &:not(:disabled) {
171
+ // &[data-pressed] {
172
+ // ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
173
+ // }
174
+
175
+ // &[data-selected] {
176
+ // ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
177
+ // }
178
+
179
+ // @media (hover: hover) {
180
+ // &:not([data-pressed]):not([data-selected]) {
181
+ // &[data-hovered],
182
+ // &:hover {
183
+ // ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
184
+ // }
185
+
186
+ // &:active {
187
+ // ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
188
+ // }
189
+ // }
190
+ // }
191
+
192
+ // &:focus-visible {
193
+ // --card-focus-ring-box-shadow: ${$focusRing
194
+ // ? focusRingStyle({base: color, border, focusRing: card.focusRing})
195
+ // : undefined};
196
+ // }
197
+ // }
198
+ // }
199
+
200
+ // /* &:is(a) */
201
+ // &[data-as='a'] {
202
+ // cursor: pointer;
203
+ // box-shadow: var(--card-focus-ring-box-shadow);
204
+
205
+ // &[data-disabled] {
206
+ // ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
207
+ // }
208
+
209
+ // &:not([data-disabled]) {
210
+ // &[data-pressed] {
211
+ // ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
212
+ // }
213
+
214
+ // &[data-selected] {
215
+ // ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
216
+ // }
217
+
218
+ // @media (hover: hover) {
219
+ // &:not([data-pressed]):not([data-selected]) {
220
+ // &[data-hovered],
221
+ // &:hover {
222
+ // ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
223
+ // }
224
+
225
+ // &:active {
226
+ // ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
227
+ // }
228
+ // }
229
+ // }
230
+
231
+ // &:focus-visible {
232
+ // --card-focus-ring-box-shadow: ${$focusRing
233
+ // ? focusRingStyle({base: color, border, focusRing: card.focusRing})
234
+ // : undefined};
235
+ // }
236
+ // }
237
+ // }
238
+
239
+ // ${style?.card?.root}
240
+ // `
241
+ // }
@@ -0,0 +1,129 @@
1
+ // import {getTheme_v2} from '@sanity/ui/theme'
2
+ // import {css} from '../../../core/lib/styled'
3
+ // import {rem, ThemeProps} from '../../../core/styles'
4
+ // import {focusRingBorderStyle, focusRingStyle} from '../../../core/styles/internal'
5
+
6
+ // export function checkboxBaseStyles(): ReturnType<typeof css> {
7
+ // return css`
8
+ // position: relative;
9
+ // display: inline-block;
10
+ // `
11
+ // }
12
+
13
+ // export function inputElementStyles(props: ThemeProps): ReturnType<typeof css> {
14
+ // const {color, input, radius} = getTheme_v2(props.theme)
15
+ // const {focusRing} = input.checkbox
16
+
17
+ // return css`
18
+ // position: absolute;
19
+ // top: 0;
20
+ // left: 0;
21
+ // width: 100%;
22
+ // height: 100%;
23
+ // outline: none;
24
+ // opacity: 0;
25
+ // z-index: 1;
26
+ // padding: 0;
27
+ // margin: 0;
28
+
29
+ // & + span {
30
+ // position: relative;
31
+ // display: block;
32
+ // height: ${rem(input.checkbox.size)};
33
+ // width: ${rem(input.checkbox.size)};
34
+ // box-sizing: border-box;
35
+ // box-shadow: ${focusRingBorderStyle({
36
+ // color: color.input.default.enabled.border,
37
+ // width: input.border.width,
38
+ // })};
39
+ // border-radius: ${rem(radius[2])};
40
+ // line-height: 1;
41
+ // background-color: ${color.input.default.enabled.bg};
42
+
43
+ // & > svg {
44
+ // display: block;
45
+ // position: absolute;
46
+ // opacity: 0;
47
+ // height: 100%;
48
+ // width: 100%;
49
+
50
+ // & > path {
51
+ // vector-effect: non-scaling-stroke;
52
+ // stroke-width: 1.5px !important;
53
+ // }
54
+ // }
55
+ // }
56
+
57
+ // &:checked + span {
58
+ // background: ${color.input.default.enabled.fg};
59
+ // box-shadow: ${focusRingBorderStyle({
60
+ // color: color.input.default.enabled.fg,
61
+ // width: input.border.width,
62
+ // })};
63
+ // color: ${color.input.default.enabled.bg};
64
+ // }
65
+
66
+ // /* focus */
67
+ // &:not(:disabled):focus:focus-visible + span {
68
+ // box-shadow: ${focusRingStyle({focusRing})};
69
+ // }
70
+
71
+ // /* focus when checked - uses a different offset */
72
+ // &:not(:disabled):focus:focus-visible&:checked + span {
73
+ // box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})};
74
+ // }
75
+
76
+ // &[data-error] + span {
77
+ // background-color: ${color.input.invalid.enabled.border};
78
+ // box-shadow: ${focusRingBorderStyle({
79
+ // width: input.border.width,
80
+ // color: color.input.invalid.enabled.muted.bg,
81
+ // })};
82
+ // color: ${color.input.default.disabled.fg};
83
+ // }
84
+ // &[data-error]&:checked + span {
85
+ // background-color: ${color.input.invalid.enabled.muted.bg};
86
+ // color: ${color.input.default.enabled.bg};
87
+ // }
88
+ // &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {
89
+ // box-shadow: ${focusRingStyle({
90
+ // border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
91
+ // focusRing: {width: 1, offset: 1},
92
+ // })};
93
+ // }
94
+
95
+ // &:disabled + span {
96
+ // background-color: ${color.input.default.disabled.bg};
97
+ // box-shadow: ${focusRingBorderStyle({
98
+ // width: input.border.width,
99
+ // color: color.input.default.disabled.border,
100
+ // })};
101
+ // color: ${color.input.default.disabled.fg};
102
+ // }
103
+ // &:disabled&:checked + span {
104
+ // background-color: ${color.input.default.disabled.muted.bg};
105
+ // }
106
+
107
+ // &[data-read-only] + span {
108
+ // background-color: ${color.input.default.readOnly.bg};
109
+ // box-shadow: ${focusRingBorderStyle({
110
+ // width: input.border.width,
111
+ // color: color.input.default.readOnly.border,
112
+ // })};
113
+ // color: ${color.input.default.readOnly.fg};
114
+ // }
115
+
116
+ // &[data-read-only]&:checked + span {
117
+ // background-color: ${color.input.default.readOnly.muted.bg};
118
+ // }
119
+
120
+ // &:checked + span > svg:first-child {
121
+ // opacity: 1;
122
+ // }
123
+ // &:indeterminate + span > svg:last-child {
124
+ // opacity: 1;
125
+ // }
126
+ // `
127
+ // }
128
+
129
+ export {}
@@ -0,0 +1,9 @@
1
+ import {composeClassNames} from '../../composeClassNames'
2
+
3
+ export function checkbox(): string {
4
+ return composeClassNames('checkbox')
5
+ }
6
+
7
+ export function checkboxInput(): string {
8
+ return composeClassNames('checkbox-input')
9
+ }
@@ -0,0 +1 @@
1
+ export * from './checkbox'
@@ -0,0 +1,136 @@
1
+ import {Rules} from '../../types'
2
+
3
+ export const checkboxRules: Rules = {
4
+ 'checkbox': {
5
+ position: 'relative',
6
+ display: 'inline-block',
7
+ },
8
+
9
+ 'checkbox-input': {
10
+ 'position': 'absolute',
11
+ 'top': 0,
12
+ 'left': 0,
13
+ 'width': '100%',
14
+ 'height': '100%',
15
+ 'outline': 'none',
16
+ 'opacity': 0,
17
+ 'zIndex': 1,
18
+ 'padding': 0,
19
+ 'margin': 0,
20
+
21
+ '@nest': {
22
+ '& + span': {
23
+ 'position': 'relative',
24
+ 'display': 'block',
25
+ 'width': `var(--input-checkbox-size)`,
26
+ 'height': `var(--input-checkbox-size)`,
27
+ 'boxSizing': 'border-box',
28
+ 'borderRadius': `var(--radius-2)`,
29
+ 'lineHeight': 1,
30
+ 'backgroundColor': `var(--color-checkbox-bg)`,
31
+ 'boxShadow': `inset 0 0 0 1px var(--color-checkbox-border)`,
32
+ 'color': `var(--color-checkbox-fg)`,
33
+
34
+ '--color-checkbox-bg': 'var(--color-input-default-enabled-bg)',
35
+ '--color-checkbox-border': 'var(--color-input-default-enabled-border)',
36
+ '--color-checkbox-fg': 'var(--color-input-default-enabled-fg)',
37
+ // box-shadow: ${focusRingBorderStyle({
38
+ // color: color.input.default.enabled.border,
39
+ // width: input.border.width,
40
+ // })},
41
+ },
42
+
43
+ '& + span > svg': {
44
+ display: 'block',
45
+ position: 'absolute',
46
+ opacity: 0,
47
+ height: '100%',
48
+ width: '100%',
49
+ },
50
+
51
+ '& + span > svg > path': {
52
+ vectorEffect: 'non-scaling-stroke',
53
+ strokeWidth: '1.5px !important',
54
+ },
55
+
56
+ '&:checked + span': {
57
+ '--color-checkbox-bg': 'var(--color-input-default-enabled-fg)',
58
+ '--color-checkbox-border': 'var(--color-input-default-enabled-fg)',
59
+ '--color-checkbox-fg': 'var(--color-input-default-enabled-bg)',
60
+ // box-shadow: ${focusRingBorderStyle({
61
+ // color: color.input.default.enabled.fg,
62
+ // width: input.border.width,
63
+ // })},
64
+ },
65
+
66
+ '&:checked + span > svg:first-child': {
67
+ opacity: 1,
68
+ },
69
+
70
+ // focus
71
+ '&:not(:disabled):focus:focus-visible + span': {
72
+ // box-shadow: ${focusRingStyle({focusRing})},
73
+ },
74
+
75
+ // focus when checked - uses a different offset
76
+ '&:not(:disabled):focus:focus-visible&:checked + span': {
77
+ // box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})},
78
+ },
79
+
80
+ '&[data-error] + span': {
81
+ '--color-checkbox-bg': 'var(--color-input-invalid-enabled-border)',
82
+ '--color-checkbox-border': 'var(--color-input-invalid-enabled-bg)',
83
+ '--color-checkbox-fg': 'var(--color-input-invalid-enabled-fg)',
84
+ // box-shadow: ${focusRingBorderStyle({
85
+ // width: input.border.width,
86
+ // color: color.input.invalid.enabled.muted.bg,
87
+ // })},
88
+ },
89
+
90
+ '&[data-error]:checked + span': {
91
+ '--color-checkbox-bg': 'var(--color-input-invalid-enabled-muted-bg)',
92
+ '--color-checkbox-fg': 'var(--color-input-invalid-enabled-bg)',
93
+ },
94
+
95
+ '&[data-error]:checked:not(:disabled):focus:focus-visible + span': {
96
+ '--color-checkbox-border': 'var(--color-input-invalid-readOnly-muted-bg)',
97
+ // box-shadow: ${focusRingStyle({
98
+ // border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
99
+ // focusRing: {width: 1, offset: 1},
100
+ // })},
101
+ },
102
+
103
+ '&:disabled + span': {
104
+ '--color-checkbox-bg': 'var(--color-input-default-disabled-bg)',
105
+ '--color-checkbox-border': 'var(--color-input-default-disabled-border)',
106
+ '--color-checkbox-fg': 'var(--color-input-default-disabled-fg)',
107
+ // box-shadow: ${focusRingBorderStyle({
108
+ // width: input.border.width,
109
+ // color: color.input.default.disabled.border,
110
+ // })},
111
+ },
112
+
113
+ '&:disabled:checked + span': {
114
+ '--color-checkbox-bg': 'var(--color-input-default-disabled-muted-bg)',
115
+ },
116
+
117
+ '&[data-read-only] + span': {
118
+ '--color-checkbox-bg': 'var(--color-input-default-readOnly-bg)',
119
+ '--color-checkbox-border': 'var(--color-input-default-readOnly-border)',
120
+ '--color-checkbox-fg': 'var(--color-input-default-readOnly-fg)',
121
+ // box-shadow: ${focusRingBorderStyle({
122
+ // width: input.border.width,
123
+ // color: color.input.default.readOnly.border,
124
+ // })},
125
+ },
126
+
127
+ '&[data-read-only]:checked + span': {
128
+ '--color-checkbox-bg': 'var(--color-input-default-readOnly-muted-bg)',
129
+ },
130
+
131
+ '&:indeterminate + span > svg:last-child': {
132
+ opacity: 1,
133
+ },
134
+ },
135
+ },
136
+ }
@@ -0,0 +1,9 @@
1
+ import {_resp} from '../../_resp'
2
+ import {composeClassNames} from '../../composeClassNames'
3
+ import {font} from '../../styles/font'
4
+ import {CodeStyleProps} from './types'
5
+
6
+ /** @public */
7
+ export function code(props: CodeStyleProps): string {
8
+ return composeClassNames('code', 'block', font(props), _resp(`code`, props.size))
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from './code'
2
+ export * from './types'
@@ -0,0 +1,71 @@
1
+ import {responsiveRules} from '../../responsiveRules'
2
+ import {Rules} from '../../types'
3
+
4
+ export const codeRules: Rules = {
5
+ code: {
6
+ '--font-weight-regular': `var(--font-code-weight-regular)`,
7
+ '--font-weight-medium': `var(--font-code-weight-medium)`,
8
+ '--font-weight-semibold': `var(--font-code-weight-semibold)`,
9
+ '--font-weight-bold': `var(--font-code-weight-bold)`,
10
+
11
+ '--font-family': `var(--font-code-family)`,
12
+
13
+ 'color': 'var(--color-fg)',
14
+
15
+ '@nest': {
16
+ '& > code': {
17
+ font: 'inherit',
18
+ },
19
+
20
+ '& a': {
21
+ color: 'var(--color-link-fg)',
22
+ textDecoration: 'none',
23
+ },
24
+ },
25
+ },
26
+
27
+ ...responsiveRules('code-0', {
28
+ '--font-size': 'var(--font-code-0-size)',
29
+ '--font-line-height': 'var(--font-code-0-line-height)',
30
+ '--font-letter-spacing': 'var(--font-code-0-letter-spacing)',
31
+ '--font-icon-size': 'var(--font-code-0-icon-size)',
32
+ '--font-ascender-height': 'var(--font-code-0-ascender-height)',
33
+ '--font-descender-height': 'var(--font-code-0-descender-height)',
34
+ }),
35
+
36
+ ...responsiveRules('code-1', {
37
+ '--font-size': 'var(--font-code-1-size)',
38
+ '--font-line-height': 'var(--font-code-1-line-height)',
39
+ '--font-letter-spacing': 'var(--font-code-1-letter-spacing)',
40
+ '--font-icon-size': 'var(--font-code-1-icon-size)',
41
+ '--font-ascender-height': 'var(--font-code-1-ascender-height)',
42
+ '--font-descender-height': 'var(--font-code-1-descender-height)',
43
+ }),
44
+
45
+ ...responsiveRules('code-2', {
46
+ '--font-size': 'var(--font-code-2-size)',
47
+ '--font-line-height': 'var(--font-code-2-line-height)',
48
+ '--font-letter-spacing': 'var(--font-code-2-letter-spacing)',
49
+ '--font-icon-size': 'var(--font-code-2-icon-size)',
50
+ '--font-ascender-height': 'var(--font-code-2-ascender-height)',
51
+ '--font-descender-height': 'var(--font-code-2-descender-height)',
52
+ }),
53
+
54
+ ...responsiveRules('code-3', {
55
+ '--font-size': 'var(--font-code-3-size)',
56
+ '--font-line-height': 'var(--font-code-3-line-height)',
57
+ '--font-letter-spacing': 'var(--font-code-3-letter-spacing)',
58
+ '--font-icon-size': 'var(--font-code-3-icon-size)',
59
+ '--font-ascender-height': 'var(--font-code-3-ascender-height)',
60
+ '--font-descender-height': 'var(--font-code-3-descender-height)',
61
+ }),
62
+
63
+ ...responsiveRules('code-4', {
64
+ '--font-size': 'var(--font-code-4-size)',
65
+ '--font-line-height': 'var(--font-code-4-line-height)',
66
+ '--font-letter-spacing': 'var(--font-code-4-letter-spacing)',
67
+ '--font-icon-size': 'var(--font-code-4-icon-size)',
68
+ '--font-ascender-height': 'var(--font-code-4-ascender-height)',
69
+ '--font-descender-height': 'var(--font-code-4-descender-height)',
70
+ }),
71
+ }
@@ -0,0 +1,10 @@
1
+ import {FontStyleProps} from '@sanity/ui/css'
2
+ import {ResponsiveProp} from '../../types'
3
+
4
+ /** @public */
5
+ export type CodeSize = number
6
+
7
+ /** @public */
8
+ export interface CodeStyleProps extends FontStyleProps {
9
+ size?: ResponsiveProp<CodeSize>
10
+ }
@@ -0,0 +1,7 @@
1
+ import {composeClassNames} from '../../composeClassNames'
2
+ import {maxWidth} from '../../styles/maxWidth'
3
+ import {ContainerStyleProps} from './types'
4
+
5
+ export function container(props: ContainerStyleProps): string {
6
+ return composeClassNames('container', maxWidth({maxWidth: props.width}))
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './container'
2
+ export * from './types'
@@ -0,0 +1,8 @@
1
+ import {Rules} from '../../types'
2
+
3
+ export const containerRules: Rules = {
4
+ container: {
5
+ margin: '0 auto',
6
+ width: '100%',
7
+ },
8
+ }
@@ -0,0 +1,6 @@
1
+ import {ContainerWidth} from '@sanity/ui/theme'
2
+ import {ResponsiveProp} from '../../types'
3
+
4
+ export interface ContainerStyleProps {
5
+ width?: ResponsiveProp<ContainerWidth>
6
+ }
@@ -0,0 +1,16 @@
1
+ import {_resp} from '../../_resp'
2
+ import {composeClassNames} from '../../composeClassNames'
3
+ import {font} from '../../styles/font'
4
+ import {HeadingStyleProps} from './types'
5
+
6
+ /** @public */
7
+ export function heading(props: HeadingStyleProps): string {
8
+ return composeClassNames(
9
+ 'heading',
10
+ 'block',
11
+ font(props),
12
+ props.accent && 'heading-accent',
13
+ props.muted && 'heading-muted',
14
+ _resp(`heading`, props.size),
15
+ )
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from './heading'
2
+ export * from './types'