@sanity/ui 3.0.0-static.15 → 3.0.0-static.17

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 (526) hide show
  1. package/README.md +6 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +67 -77
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
  6. package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
  7. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
  8. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  9. package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +68 -78
  10. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  11. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
  12. package/dist/_chunks-es/refractor.js.map +1 -0
  13. package/dist/_visual-editing.cjs +30 -0
  14. package/dist/_visual-editing.cjs.map +1 -0
  15. package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +5 -15
  16. package/dist/_visual-editing.d.ts +5 -15
  17. package/dist/_visual-editing.js +29 -30
  18. package/dist/_visual-editing.js.map +1 -1
  19. package/dist/{cli.js → cli.cjs} +4 -4
  20. package/dist/cli.cjs.map +1 -0
  21. package/dist/{css.mjs → css.cjs} +809 -923
  22. package/dist/css.cjs.map +1 -0
  23. package/dist/{css.d.mts → css.d.cts} +31 -24
  24. package/dist/css.d.ts +31 -24
  25. package/dist/css.js +809 -921
  26. package/dist/css.js.map +1 -1
  27. package/dist/{index.mjs → index.cjs} +373 -406
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/{index.d.mts → index.d.cts} +10 -20
  30. package/dist/index.d.ts +10 -20
  31. package/dist/index.js +371 -406
  32. package/dist/index.js.map +1 -1
  33. package/dist/{theme.mjs → theme.cjs} +219 -196
  34. package/dist/theme.cjs.map +1 -0
  35. package/dist/{theme.d.mts → theme.d.cts} +2 -0
  36. package/dist/theme.d.ts +2 -0
  37. package/dist/theme.js +218 -195
  38. package/dist/theme.js.map +1 -1
  39. package/dist/{sanity-palette.css → ui-palette.css} +1 -1
  40. package/dist/ui-palette.min.css +1 -0
  41. package/dist/{system.css → ui-system.css} +1135 -245
  42. package/dist/ui-system.min.css +1 -0
  43. package/dist/{sanity-theme.css → ui-theme.css} +199 -199
  44. package/dist/ui-theme.min.css +1 -0
  45. package/dist/ui.css +29152 -0
  46. package/dist/ui.min.css +1 -0
  47. package/exports/_visual-editing.ts +27 -27
  48. package/exports/index.ts +1 -1
  49. package/package.json +24 -24
  50. package/src/cli/buildCommand.ts +55 -20
  51. package/src/cli/index.ts +2 -14
  52. package/src/{ui → core}/StyleTags.tsx +4 -4
  53. package/src/{ui → core}/_compat/index.ts +0 -1
  54. package/src/{ui → core}/_compat/theme/themeProvider.tsx +3 -3
  55. package/src/{ui → core}/components/autocomplete/__workshop__/async.tsx +2 -2
  56. package/src/{ui → core}/components/autocomplete/__workshop__/custom.tsx +2 -2
  57. package/src/{ui → core}/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
  58. package/src/{ui → core}/components/tab/tabList.tsx +19 -4
  59. package/src/{ui → core}/index.ts +0 -1
  60. package/src/{ui → core}/primitives/box/box.tsx +3 -0
  61. package/src/core/primitives/button/__workshop__/custom.tsx +27 -0
  62. package/src/{ui → core}/primitives/button/button.tsx +3 -1
  63. package/src/{ui → core}/primitives/card/__workshop__/asButton.tsx +0 -9
  64. package/src/{ui → core}/primitives/card/__workshop__/interactive.tsx +0 -1
  65. package/src/{ui → core}/primitives/card/__workshop__/props.tsx +0 -3
  66. package/src/{ui → core}/primitives/card/__workshop__/selected.tsx +6 -37
  67. package/src/{ui → core}/primitives/card/card.tsx +15 -21
  68. package/src/core/primitives/card/cardProvider.tsx +27 -0
  69. package/src/{ui → core}/primitives/card/types.ts +5 -4
  70. package/src/{ui → core}/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
  71. package/src/{ui → core}/primitives/heading/__workshop__/plain.tsx +1 -8
  72. package/src/{ui → core}/primitives/label/__workshop__/plain.tsx +1 -9
  73. package/src/{ui → core}/primitives/popover/popover.tsx +1 -1
  74. package/src/{ui → core}/primitives/text/__workshop__/example.tsx +1 -9
  75. package/src/{ui → core}/primitives/tooltip/tooltip.tsx +1 -1
  76. package/src/{ui/utils/portal/portal.ts → core/utils/portal/portal.tsx} +8 -10
  77. package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
  78. package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
  79. package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
  80. package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
  81. package/src/css/_mergeStyles.ts +0 -7
  82. package/src/css/_system.style.ts +3 -0
  83. package/src/css/aspects/font/font.style.ts +0 -21
  84. package/src/css/aspects/font/font.ts +1 -6
  85. package/src/css/aspects/font/types.ts +0 -4
  86. package/src/css/aspects/index.ts +1 -0
  87. package/src/css/aspects/textAlign/index.ts +2 -0
  88. package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
  89. package/src/css/aspects/textAlign/textAlign.ts +8 -0
  90. package/src/css/aspects/textAlign/types.ts +7 -0
  91. package/src/css/index.ts +3 -3
  92. package/src/css/primitives/_input/_input.style.ts +9 -11
  93. package/src/css/primitives/box/box.style.ts +5 -1
  94. package/src/css/primitives/box/box.ts +2 -0
  95. package/src/css/primitives/box/types.ts +2 -0
  96. package/src/css/primitives/button/button.style.ts +23 -9
  97. package/src/css/primitives/button/button.ts +1 -12
  98. package/src/css/primitives/button/types.ts +1 -6
  99. package/src/css/primitives/card/card.style.ts +12 -21
  100. package/src/css/primitives/heading/heading.ts +2 -1
  101. package/src/css/primitives/heading/types.ts +2 -1
  102. package/src/css/primitives/kbd/kbd.style.ts +3 -6
  103. package/src/css/primitives/label/label.ts +2 -1
  104. package/src/css/primitives/label/types.ts +2 -1
  105. package/src/css/primitives/text/text.style.ts +0 -5
  106. package/src/css/primitives/text/text.ts +2 -1
  107. package/src/css/primitives/text/types.ts +2 -1
  108. package/src/css/primitives/textInput/textInput.style.ts +1 -120
  109. package/src/css/types.ts +9 -9
  110. package/src/theme/v3/color/buildColor_v3.ts +53 -25
  111. package/src/theme/v3/color/card.ts +0 -42
  112. package/src/theme/v3/color/renderColor.test.ts +1 -0
  113. package/src/theme/v3/color/renderColor.ts +9 -2
  114. package/src/theme/v3/color/token.ts +1 -0
  115. package/src/theme/v3/defaultTokens.ts +7 -2
  116. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  117. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  118. package/dist/_chunks-cjs/refractor.js.map +0 -1
  119. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  120. package/dist/_chunks-es/refractor.mjs.map +0 -1
  121. package/dist/_visual-editing.mjs +0 -31
  122. package/dist/_visual-editing.mjs.map +0 -1
  123. package/dist/cli.js.map +0 -1
  124. package/dist/css.mjs.map +0 -1
  125. package/dist/index.mjs.map +0 -1
  126. package/dist/sanity-palette.min.css +0 -1
  127. package/dist/sanity-theme.min.css +0 -1
  128. package/dist/system.min.css +0 -1
  129. package/dist/theme.mjs.map +0 -1
  130. package/src/css/primitives/button/_constants.ts +0 -17
  131. package/src/ui/RootClassNames.tsx +0 -44
  132. package/src/ui/_compat/studioTheme.ts +0 -7
  133. package/src/ui/primitives/button/__workshop__/custom.tsx +0 -50
  134. package/src/ui/primitives/card/cardProvider.tsx +0 -21
  135. /package/dist/{cli.d.ts → cli.d.cts} +0 -0
  136. /package/src/{ui → core}/_compat/helpers.ts +0 -0
  137. /package/src/{ui → core}/_compat/styles/_responsive.ts +0 -0
  138. /package/src/{ui → core}/_compat/styles/index.ts +0 -0
  139. /package/src/{ui → core}/_compat/theme/index.ts +0 -0
  140. /package/src/{ui → core}/_compat/theme/theme.test.tsx +0 -0
  141. /package/src/{ui → core}/_compat/theme/themeColorProvider.tsx +0 -0
  142. /package/src/{ui → core}/_compat/theme/themeContext.ts +0 -0
  143. /package/src/{ui → core}/_compat/theme/types.ts +0 -0
  144. /package/src/{ui → core}/_compat/theme/useRootTheme.ts +0 -0
  145. /package/src/{ui → core}/_compat/theme/useTheme.ts +0 -0
  146. /package/src/{ui → core}/_compat/types.ts +0 -0
  147. /package/src/{ui → core}/components/autocomplete/__mocks__/apiStore.ts +0 -0
  148. /package/src/{ui → core}/components/autocomplete/__mocks__/countries.ts +0 -0
  149. /package/src/{ui → core}/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -0
  150. /package/src/{ui → core}/components/autocomplete/__workshop__/example.tsx +0 -0
  151. /package/src/{ui → core}/components/autocomplete/__workshop__/fullscreen.tsx +0 -0
  152. /package/src/{ui → core}/components/autocomplete/__workshop__/index.ts +0 -0
  153. /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
  154. /package/src/{ui → core}/components/autocomplete/autocomplete.tsx +0 -0
  155. /package/src/{ui → core}/components/autocomplete/autocompleteOption.tsx +0 -0
  156. /package/src/{ui → core}/components/autocomplete/autocompleteReducer.ts +0 -0
  157. /package/src/{ui → core}/components/autocomplete/constants.ts +0 -0
  158. /package/src/{ui → core}/components/autocomplete/index.ts +0 -0
  159. /package/src/{ui → core}/components/autocomplete/types.ts +0 -0
  160. /package/src/{ui → core}/components/breadcrumbs/__workshop__/example.tsx +0 -0
  161. /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
  162. /package/src/{ui → core}/components/breadcrumbs/breadcrumbs.tsx +0 -0
  163. /package/src/{ui → core}/components/breadcrumbs/index.ts +0 -0
  164. /package/src/{ui → core}/components/dialog/__workshop__/activate.tsx +0 -0
  165. /package/src/{ui → core}/components/dialog/__workshop__/autoFocus.tsx +0 -0
  166. /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
  167. /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
  168. /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
  169. /package/src/{ui → core}/components/dialog/__workshop__/onScroll.tsx +0 -0
  170. /package/src/{ui → core}/components/dialog/__workshop__/panes.tsx +0 -0
  171. /package/src/{ui → core}/components/dialog/__workshop__/position.tsx +0 -0
  172. /package/src/{ui → core}/components/dialog/__workshop__/props.tsx +0 -0
  173. /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
  174. /package/src/{ui → core}/components/dialog/__workshop__/wrapped.tsx +0 -0
  175. /package/src/{ui → core}/components/dialog/dialog.tsx +0 -0
  176. /package/src/{ui → core}/components/dialog/dialogCard.tsx +0 -0
  177. /package/src/{ui → core}/components/dialog/dialogContext.ts +0 -0
  178. /package/src/{ui → core}/components/dialog/dialogProvider.tsx +0 -0
  179. /package/src/{ui → core}/components/dialog/index.ts +0 -0
  180. /package/src/{ui → core}/components/dialog/isTargetWithinScope.ts +0 -0
  181. /package/src/{ui → core}/components/dialog/useDialog.ts +0 -0
  182. /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
  183. /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
  184. /package/src/{ui → core}/components/hotkeys/hotkeys.tsx +0 -0
  185. /package/src/{ui → core}/components/hotkeys/index.ts +0 -0
  186. /package/src/{ui → core}/components/index.ts +0 -0
  187. /package/src/{ui → core}/components/menu/__workshop__/asComponent.tsx +0 -0
  188. /package/src/{ui → core}/components/menu/__workshop__/avatarMenu.tsx +0 -0
  189. /package/src/{ui → core}/components/menu/__workshop__/closableMenuButton.tsx +0 -0
  190. /package/src/{ui → core}/components/menu/__workshop__/constrainedInBoundary.tsx +0 -0
  191. /package/src/{ui → core}/components/menu/__workshop__/customMenuItem.tsx +0 -0
  192. /package/src/{ui → core}/components/menu/__workshop__/customSelectedState.tsx +0 -0
  193. /package/src/{ui → core}/components/menu/__workshop__/disableFocusOnClose.tsx +0 -0
  194. /package/src/{ui → core}/components/menu/__workshop__/groups.tsx +0 -0
  195. /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
  196. /package/src/{ui → core}/components/menu/__workshop__/menuButton.tsx +0 -0
  197. /package/src/{ui → core}/components/menu/__workshop__/menuGroupRight.tsx +0 -0
  198. /package/src/{ui → core}/components/menu/__workshop__/nestedMenu.tsx +0 -0
  199. /package/src/{ui → core}/components/menu/__workshop__/onCloseMenuButton.tsx +0 -0
  200. /package/src/{ui → core}/components/menu/__workshop__/selectedItem.tsx +0 -0
  201. /package/src/{ui → core}/components/menu/__workshop__/shouldFocus.tsx +0 -0
  202. /package/src/{ui → core}/components/menu/__workshop__/tones.tsx +0 -0
  203. /package/src/{ui → core}/components/menu/__workshop__/withoutArrow.tsx +0 -0
  204. /package/src/{ui → core}/components/menu/helpers.ts +0 -0
  205. /package/src/{ui → core}/components/menu/index.ts +0 -0
  206. /package/src/{ui → core}/components/menu/menu.test.tsx +0 -0
  207. /package/src/{ui → core}/components/menu/menu.tsx +0 -0
  208. /package/src/{ui → core}/components/menu/menuButton.tsx +0 -0
  209. /package/src/{ui → core}/components/menu/menuContext.ts +0 -0
  210. /package/src/{ui → core}/components/menu/menuDivider.tsx +0 -0
  211. /package/src/{ui → core}/components/menu/menuGroup.tsx +0 -0
  212. /package/src/{ui → core}/components/menu/menuItem.tsx +0 -0
  213. /package/src/{ui → core}/components/menu/useMenu.ts +0 -0
  214. /package/src/{ui → core}/components/menu/useMenuController.ts +0 -0
  215. /package/src/{ui → core}/components/skeleton/__workshop__/delay.tsx +0 -0
  216. /package/src/{ui → core}/components/skeleton/__workshop__/index.ts +0 -0
  217. /package/src/{ui → core}/components/skeleton/__workshop__/skeleton.tsx +0 -0
  218. /package/src/{ui → core}/components/skeleton/codeSkeleton.tsx +0 -0
  219. /package/src/{ui → core}/components/skeleton/headingSkeleton.tsx +0 -0
  220. /package/src/{ui → core}/components/skeleton/index.ts +0 -0
  221. /package/src/{ui → core}/components/skeleton/labelSkeleton.tsx +0 -0
  222. /package/src/{ui → core}/components/skeleton/skeleton.tsx +0 -0
  223. /package/src/{ui → core}/components/skeleton/textSkeleton.tsx +0 -0
  224. /package/src/{ui → core}/components/tab/__workshop__/example.tsx +0 -0
  225. /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
  226. /package/src/{ui → core}/components/tab/index.ts +0 -0
  227. /package/src/{ui → core}/components/tab/tab.tsx +0 -0
  228. /package/src/{ui → core}/components/tab/tabPanel.tsx +0 -0
  229. /package/src/{ui → core}/components/toast/__workshop__/hook.tsx +0 -0
  230. /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
  231. /package/src/{ui → core}/components/toast/__workshop__/toast.tsx +0 -0
  232. /package/src/{ui → core}/components/toast/index.ts +0 -0
  233. /package/src/{ui → core}/components/toast/toast.test.tsx +0 -0
  234. /package/src/{ui → core}/components/toast/toast.tsx +0 -0
  235. /package/src/{ui → core}/components/toast/toastContext.ts +0 -0
  236. /package/src/{ui → core}/components/toast/toastLayer.tsx +0 -0
  237. /package/src/{ui → core}/components/toast/toastProvider.tsx +0 -0
  238. /package/src/{ui → core}/components/toast/toastState.ts +0 -0
  239. /package/src/{ui → core}/components/toast/types.ts +0 -0
  240. /package/src/{ui → core}/components/toast/useToast.ts +0 -0
  241. /package/src/{ui → core}/components/tree/__workshop__/basic.perf.ts +0 -0
  242. /package/src/{ui → core}/components/tree/__workshop__/basic.tsx +0 -0
  243. /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
  244. /package/src/{ui → core}/components/tree/__workshop__/tabFromElement.tsx +0 -0
  245. /package/src/{ui → core}/components/tree/helpers.ts +0 -0
  246. /package/src/{ui → core}/components/tree/index.ts +0 -0
  247. /package/src/{ui → core}/components/tree/tree.tsx +0 -0
  248. /package/src/{ui → core}/components/tree/treeContext.ts +0 -0
  249. /package/src/{ui → core}/components/tree/treeGroup.tsx +0 -0
  250. /package/src/{ui → core}/components/tree/treeItem.tsx +0 -0
  251. /package/src/{ui → core}/components/tree/types.ts +0 -0
  252. /package/src/{ui → core}/components/tree/useTree.ts +0 -0
  253. /package/src/{ui → core}/constants.ts +0 -0
  254. /package/src/{ui → core}/global.ts +0 -0
  255. /package/src/{ui → core}/helpers/animation.ts +0 -0
  256. /package/src/{ui → core}/helpers/element.ts +0 -0
  257. /package/src/{ui → core}/helpers/focus.ts +0 -0
  258. /package/src/{ui → core}/helpers/index.ts +0 -0
  259. /package/src/{ui → core}/helpers/props.ts +0 -0
  260. /package/src/{ui → core}/helpers/scroll.ts +0 -0
  261. /package/src/{ui → core}/hooks/index.ts +0 -0
  262. /package/src/{ui → core}/hooks/useArrayProp.ts +0 -0
  263. /package/src/{ui → core}/hooks/useClickOutside.test.tsx +0 -0
  264. /package/src/{ui → core}/hooks/useClickOutside.ts +0 -0
  265. /package/src/{ui → core}/hooks/useClickOutsideEvent.test.tsx +0 -0
  266. /package/src/{ui → core}/hooks/useClickOutsideEvent.ts +0 -0
  267. /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
  268. /package/src/{ui → core}/hooks/useDelayed.test.ts +0 -0
  269. /package/src/{ui → core}/hooks/useDelayedState.ts +0 -0
  270. /package/src/{ui → core}/hooks/useElementRect/__workshop__/example.tsx +0 -0
  271. /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
  272. /package/src/{ui → core}/hooks/useElementRect/index.ts +0 -0
  273. /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
  274. /package/src/{ui → core}/hooks/useElementSize.ts +0 -0
  275. /package/src/{ui → core}/hooks/useForwardedRef.ts +0 -0
  276. /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
  277. /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
  278. /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
  279. /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
  280. /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/test.tsx +0 -0
  281. /package/src/{ui → core}/hooks/useMediaIndex/index.ts +0 -0
  282. /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -0
  283. /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.ts +0 -0
  284. /package/src/{ui → core}/hooks/useMounted.ts +0 -0
  285. /package/src/{ui → core}/hooks/usePrefersDark.hydration.test.tsx +0 -0
  286. /package/src/{ui → core}/hooks/usePrefersDark.test.tsx +0 -0
  287. /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
  288. /package/src/{ui → core}/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -0
  289. /package/src/{ui → core}/hooks/usePrefersReducedMotion.test.tsx +0 -0
  290. /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
  291. /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
  292. /package/src/{ui → core}/lib/globalScope.ts +0 -0
  293. /package/src/{ui → core}/lib/isRecord.ts +0 -0
  294. /package/src/{ui → core}/middleware/origin.ts +0 -0
  295. /package/src/{ui → core}/observers/elementSizeObserver.ts +0 -0
  296. /package/src/{ui → core}/observers/index.ts +0 -0
  297. /package/src/{ui → core}/observers/resizeObserver.ts +0 -0
  298. /package/src/{ui → core}/primitives/_selectable/index.ts +0 -0
  299. /package/src/{ui → core}/primitives/_selectable/selectable.tsx +0 -0
  300. /package/src/{ui → core}/primitives/avatar/__workshop__/asButton.tsx +0 -0
  301. /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
  302. /package/src/{ui → core}/primitives/avatar/__workshop__/stack.tsx +0 -0
  303. /package/src/{ui → core}/primitives/avatar/__workshop__/withinButton.tsx +0 -0
  304. /package/src/{ui → core}/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -0
  305. /package/src/{ui → core}/primitives/avatar/avatar.tsx +0 -0
  306. /package/src/{ui → core}/primitives/avatar/avatarCounter.tsx +0 -0
  307. /package/src/{ui → core}/primitives/avatar/avatarStack.tsx +0 -0
  308. /package/src/{ui → core}/primitives/avatar/index.ts +0 -0
  309. /package/src/{ui → core}/primitives/avatar/types.ts +0 -0
  310. /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
  311. /package/src/{ui → core}/primitives/badge/__workshop__/props.tsx +0 -0
  312. /package/src/{ui → core}/primitives/badge/__workshop__/tones.tsx +0 -0
  313. /package/src/{ui → core}/primitives/badge/badge.test.tsx +0 -0
  314. /package/src/{ui → core}/primitives/badge/badge.tsx +0 -0
  315. /package/src/{ui → core}/primitives/badge/index.ts +0 -0
  316. /package/src/{ui → core}/primitives/badge/types.ts +0 -0
  317. /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
  318. /package/src/{ui → core}/primitives/box/__workshop__/props.tsx +0 -0
  319. /package/src/{ui → core}/primitives/box/__workshop__/responsive.tsx +0 -0
  320. /package/src/{ui → core}/primitives/box/index.ts +0 -0
  321. /package/src/{ui → core}/primitives/button/__workshop__/customIcons.tsx +0 -0
  322. /package/src/{ui → core}/primitives/button/__workshop__/disabled.tsx +0 -0
  323. /package/src/{ui → core}/primitives/button/__workshop__/index.ts +0 -0
  324. /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
  325. /package/src/{ui → core}/primitives/button/__workshop__/props.tsx +0 -0
  326. /package/src/{ui → core}/primitives/button/__workshop__/sanityUploadButton.tsx +0 -0
  327. /package/src/{ui → core}/primitives/button/__workshop__/stacked.tsx +0 -0
  328. /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
  329. /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
  330. /package/src/{ui → core}/primitives/button/__workshop__/uploadButton.tsx +0 -0
  331. /package/src/{ui → core}/primitives/button/button.test.tsx +0 -0
  332. /package/src/{ui → core}/primitives/button/index.ts +0 -0
  333. /package/src/{ui → core}/primitives/card/__workshop__/allTones.tsx +0 -0
  334. /package/src/{ui → core}/primitives/card/__workshop__/asComponent.tsx +0 -0
  335. /package/src/{ui → core}/primitives/card/__workshop__/checkered.tsx +0 -0
  336. /package/src/{ui → core}/primitives/card/__workshop__/index.ts +0 -0
  337. /package/src/{ui → core}/primitives/card/__workshop__/listNavigation.tsx +0 -0
  338. /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
  339. /package/src/{ui → core}/primitives/card/cardContext.ts +0 -0
  340. /package/src/{ui → core}/primitives/card/index.ts +0 -0
  341. /package/src/{ui → core}/primitives/card/useCard.ts +0 -0
  342. /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
  343. /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
  344. /package/src/{ui → core}/primitives/checkbox/__workshop__/props.tsx +0 -0
  345. /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
  346. /package/src/{ui → core}/primitives/checkbox/__workshop__/tones.tsx +0 -0
  347. /package/src/{ui → core}/primitives/checkbox/checkbox.tsx +0 -0
  348. /package/src/{ui → core}/primitives/checkbox/index.ts +0 -0
  349. /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
  350. /package/src/{ui → core}/primitives/code/__workshop__/opticalAlignment.tsx +0 -0
  351. /package/src/{ui → core}/primitives/code/__workshop__/props.tsx +0 -0
  352. /package/src/{ui → core}/primitives/code/code.tsx +0 -0
  353. /package/src/{ui → core}/primitives/code/index.ts +0 -0
  354. /package/src/{ui → core}/primitives/code/refractor.tsx +0 -0
  355. /package/src/{ui → core}/primitives/container/__workshop__/example.tsx +0 -0
  356. /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
  357. /package/src/{ui → core}/primitives/container/container.tsx +0 -0
  358. /package/src/{ui → core}/primitives/container/index.ts +0 -0
  359. /package/src/{ui → core}/primitives/container/types.ts +0 -0
  360. /package/src/{ui → core}/primitives/flex/__workshop__/example.tsx +0 -0
  361. /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
  362. /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
  363. /package/src/{ui → core}/primitives/flex/flex.tsx +0 -0
  364. /package/src/{ui → core}/primitives/flex/index.ts +0 -0
  365. /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
  366. /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
  367. /package/src/{ui → core}/primitives/grid/grid.tsx +0 -0
  368. /package/src/{ui → core}/primitives/grid/index.ts +0 -0
  369. /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
  370. /package/src/{ui → core}/primitives/heading/heading.tsx +0 -0
  371. /package/src/{ui → core}/primitives/heading/index.ts +0 -0
  372. /package/src/{ui → core}/primitives/index.ts +0 -0
  373. /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
  374. /package/src/{ui → core}/primitives/inline/__workshop__/plain.tsx +0 -0
  375. /package/src/{ui → core}/primitives/inline/index.ts +0 -0
  376. /package/src/{ui → core}/primitives/inline/inline.tsx +0 -0
  377. /package/src/{ui → core}/primitives/inline/types.ts +0 -0
  378. /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
  379. /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
  380. /package/src/{ui → core}/primitives/kbd/index.ts +0 -0
  381. /package/src/{ui → core}/primitives/kbd/kbd.tsx +0 -0
  382. /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
  383. /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
  384. /package/src/{ui → core}/primitives/label/index.ts +0 -0
  385. /package/src/{ui → core}/primitives/label/label.tsx +0 -0
  386. /package/src/{ui → core}/primitives/popover/__workshop__/AlignedStory.tsx +0 -0
  387. /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
  388. /package/src/{ui → core}/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
  389. /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
  390. /package/src/{ui → core}/primitives/popover/__workshop__/PlainStory.tsx +0 -0
  391. /package/src/{ui → core}/primitives/popover/__workshop__/RecursiveStory.tsx +0 -0
  392. /package/src/{ui → core}/primitives/popover/__workshop__/SidePanelStory.tsx +0 -0
  393. /package/src/{ui → core}/primitives/popover/__workshop__/TestStory.tsx +0 -0
  394. /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
  395. /package/src/{ui → core}/primitives/popover/constants.ts +0 -0
  396. /package/src/{ui → core}/primitives/popover/floating-ui/size.ts +0 -0
  397. /package/src/{ui → core}/primitives/popover/helpers.ts +0 -0
  398. /package/src/{ui → core}/primitives/popover/index.ts +0 -0
  399. /package/src/{ui → core}/primitives/popover/popoverLayer.tsx +0 -0
  400. /package/src/{ui → core}/primitives/popover/types.ts +0 -0
  401. /package/src/{ui → core}/primitives/radio/__workshop__/example.tsx +0 -0
  402. /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
  403. /package/src/{ui → core}/primitives/radio/__workshop__/plain.tsx +0 -0
  404. /package/src/{ui → core}/primitives/radio/index.ts +0 -0
  405. /package/src/{ui → core}/primitives/radio/radio.tsx +0 -0
  406. /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
  407. /package/src/{ui → core}/primitives/select/__workshop__/plain.tsx +0 -0
  408. /package/src/{ui → core}/primitives/select/__workshop__/readOnly.tsx +0 -0
  409. /package/src/{ui → core}/primitives/select/index.ts +0 -0
  410. /package/src/{ui → core}/primitives/select/select.tsx +0 -0
  411. /package/src/{ui → core}/primitives/spinner/__workshop__/Props.tsx +0 -0
  412. /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
  413. /package/src/{ui → core}/primitives/spinner/animatedSpinnerIcon.tsx +0 -0
  414. /package/src/{ui → core}/primitives/spinner/index.ts +0 -0
  415. /package/src/{ui → core}/primitives/spinner/spinner.tsx +0 -0
  416. /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
  417. /package/src/{ui → core}/primitives/stack/__workshop__/plain.tsx +0 -0
  418. /package/src/{ui → core}/primitives/stack/index.ts +0 -0
  419. /package/src/{ui → core}/primitives/stack/stack.tsx +0 -0
  420. /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
  421. /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
  422. /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
  423. /package/src/{ui → core}/primitives/switch/index.ts +0 -0
  424. /package/src/{ui → core}/primitives/switch/switch.tsx +0 -0
  425. /package/src/{ui → core}/primitives/text/__workshop__/colored.tsx +0 -0
  426. /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
  427. /package/src/{ui → core}/primitives/text/__workshop__/opticalAlignment.tsx +0 -0
  428. /package/src/{ui → core}/primitives/text/index.ts +0 -0
  429. /package/src/{ui → core}/primitives/text/text.tsx +0 -0
  430. /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
  431. /package/src/{ui → core}/primitives/textArea/__workshop__/plain.tsx +0 -0
  432. /package/src/{ui → core}/primitives/textArea/index.ts +0 -0
  433. /package/src/{ui → core}/primitives/textArea/textArea.tsx +0 -0
  434. /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
  435. /package/src/{ui → core}/primitives/textInput/__workshop__/customValidity.tsx +0 -0
  436. /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
  437. /package/src/{ui → core}/primitives/textInput/__workshop__/plain.tsx +0 -0
  438. /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
  439. /package/src/{ui → core}/primitives/textInput/__workshop__/states.tsx +0 -0
  440. /package/src/{ui → core}/primitives/textInput/__workshop__/tones.tsx +0 -0
  441. /package/src/{ui → core}/primitives/textInput/__workshop__/typed.tsx +0 -0
  442. /package/src/{ui → core}/primitives/textInput/index.ts +0 -0
  443. /package/src/{ui → core}/primitives/textInput/textInput.tsx +0 -0
  444. /package/src/{ui → core}/primitives/tooltip/__workshop__/customPortal.tsx +0 -0
  445. /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
  446. /package/src/{ui → core}/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -0
  447. /package/src/{ui → core}/primitives/tooltip/__workshop__/props.tsx +0 -0
  448. /package/src/{ui → core}/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -0
  449. /package/src/{ui → core}/primitives/tooltip/constants.ts +0 -0
  450. /package/src/{ui → core}/primitives/tooltip/index.ts +0 -0
  451. /package/src/{ui → core}/primitives/tooltip/tooltip.test.tsx +0 -0
  452. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
  453. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
  454. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -0
  455. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
  456. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
  457. /package/src/{ui → core}/primitives/tooltip/tooltipLayer.tsx +0 -0
  458. /package/src/{ui → core}/primitives/types.ts +0 -0
  459. /package/src/{ui → core}/types/avatar.ts +0 -0
  460. /package/src/{ui → core}/types/badge.ts +0 -0
  461. /package/src/{ui → core}/types/box.ts +0 -0
  462. /package/src/{ui → core}/types/button.ts +0 -0
  463. /package/src/{ui → core}/types/card.ts +0 -0
  464. /package/src/{ui → core}/types/dialog.ts +0 -0
  465. /package/src/{ui → core}/types/flex.ts +0 -0
  466. /package/src/{ui → core}/types/grid.ts +0 -0
  467. /package/src/{ui → core}/types/gridItem.ts +0 -0
  468. /package/src/{ui → core}/types/index.ts +0 -0
  469. /package/src/{ui → core}/types/placement.ts +0 -0
  470. /package/src/{ui → core}/types/popover.ts +0 -0
  471. /package/src/{ui → core}/types/props.ts +0 -0
  472. /package/src/{ui → core}/types/radius.ts +0 -0
  473. /package/src/{ui → core}/types/selectable.ts +0 -0
  474. /package/src/{ui → core}/types/text.ts +0 -0
  475. /package/src/{ui → core}/utils/arrow/arrow.tsx +0 -0
  476. /package/src/{ui → core}/utils/arrow/cmds.ts +0 -0
  477. /package/src/{ui → core}/utils/arrow/index.ts +0 -0
  478. /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
  479. /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
  480. /package/src/{ui → core}/utils/boundaryElement/boundaryElement.test.tsx +0 -0
  481. /package/src/{ui → core}/utils/boundaryElement/boundaryElementContext.ts +0 -0
  482. /package/src/{ui → core}/utils/boundaryElement/boundaryElementProvider.tsx +0 -0
  483. /package/src/{ui → core}/utils/boundaryElement/index.ts +0 -0
  484. /package/src/{ui → core}/utils/boundaryElement/types.ts +0 -0
  485. /package/src/{ui → core}/utils/boundaryElement/useBoundaryElement.ts +0 -0
  486. /package/src/{ui → core}/utils/elementQuery/__workshop__/customMedia.tsx +0 -0
  487. /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
  488. /package/src/{ui → core}/utils/elementQuery/elementQuery.tsx +0 -0
  489. /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
  490. /package/src/{ui → core}/utils/elementQuery/index.ts +0 -0
  491. /package/src/{ui → core}/utils/errorBoundary.tsx +0 -0
  492. /package/src/{ui → core}/utils/getElementRef.ts +0 -0
  493. /package/src/{ui → core}/utils/index.ts +0 -0
  494. /package/src/{ui → core}/utils/layer/__workshop__/_debug.tsx +0 -0
  495. /package/src/{ui → core}/utils/layer/__workshop__/index.ts +0 -0
  496. /package/src/{ui → core}/utils/layer/__workshop__/multipleRoots.tsx +0 -0
  497. /package/src/{ui → core}/utils/layer/__workshop__/nested.tsx +0 -0
  498. /package/src/{ui → core}/utils/layer/__workshop__/responsiveZOffset.tsx +0 -0
  499. /package/src/{ui → core}/utils/layer/getLayerContext.test.ts +0 -0
  500. /package/src/{ui → core}/utils/layer/getLayerContext.ts +0 -0
  501. /package/src/{ui → core}/utils/layer/index.ts +0 -0
  502. /package/src/{ui → core}/utils/layer/layer.test.tsx +0 -0
  503. /package/src/{ui → core}/utils/layer/layer.tsx +0 -0
  504. /package/src/{ui → core}/utils/layer/layerCard.tsx +0 -0
  505. /package/src/{ui → core}/utils/layer/layerContext.ts +0 -0
  506. /package/src/{ui → core}/utils/layer/layerProvider.tsx +0 -0
  507. /package/src/{ui → core}/utils/layer/types.ts +0 -0
  508. /package/src/{ui → core}/utils/layer/useLayer.ts +0 -0
  509. /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
  510. /package/src/{ui → core}/utils/portal/__workshop__/named.tsx +0 -0
  511. /package/src/{ui → core}/utils/portal/index.ts +0 -0
  512. /package/src/{ui → core}/utils/portal/portal.test.tsx +0 -0
  513. /package/src/{ui → core}/utils/portal/portalContext.ts +0 -0
  514. /package/src/{ui → core}/utils/portal/portalProvider.tsx +0 -0
  515. /package/src/{ui → core}/utils/portal/types.ts +0 -0
  516. /package/src/{ui → core}/utils/portal/usePortal.ts +0 -0
  517. /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
  518. /package/src/{ui → core}/utils/srOnly/index.ts +0 -0
  519. /package/src/{ui → core}/utils/srOnly/srOnly.tsx +0 -0
  520. /package/src/{ui → core}/utils/virtualList/__workshop__/changingProps.tsx +0 -0
  521. /package/src/{ui → core}/utils/virtualList/__workshop__/elementScroll.tsx +0 -0
  522. /package/src/{ui → core}/utils/virtualList/__workshop__/index.ts +0 -0
  523. /package/src/{ui → core}/utils/virtualList/__workshop__/infiniteList.tsx +0 -0
  524. /package/src/{ui → core}/utils/virtualList/__workshop__/windowScrolll.tsx +0 -0
  525. /package/src/{ui → core}/utils/virtualList/index.ts +0 -0
  526. /package/src/{ui → core}/utils/virtualList/virtualList.tsx +0 -0
@@ -1,29 +1,6 @@
1
1
  import {EditIcon, PublishIcon} from '@sanity/icons'
2
- import {Box, Card, Container, Flex, Inline, Stack, Text, useRootTheme} from '@sanity/ui'
3
- import {getTheme_v2, Theme, ThemeColorStateToneKey} from '@sanity/ui/theme'
2
+ import {Box, Card, Container, Flex, Inline, Stack, Text} from '@sanity/ui'
4
3
  import {useBoolean} from '@sanity/ui-workshop'
5
- import {css, styled} from 'styled-components'
6
-
7
- const TextWithTone = styled(Text)<{$tone: ThemeColorStateToneKey}>((props: {
8
- $tone: ThemeColorStateToneKey
9
- theme: Theme
10
- }) => {
11
- const {$tone} = props
12
- const {color} = getTheme_v2(props.theme)
13
- const tone = color.button.default[$tone]
14
-
15
- return css`
16
- &:not([data-selected]) {
17
- --card-fg-color: ${tone.enabled.bg};
18
- --card-muted-fg-color: ${tone.enabled.bg};
19
- }
20
-
21
- [data-ui='Card']:disabled & {
22
- --card-fg-color: inherit;
23
- --card-muted-fg-color: inherit;
24
- }
25
- `
26
- })
27
4
 
28
5
  export default function SelectedStory() {
29
6
  const disabled = useBoolean('Disabled', false) || false
@@ -62,31 +39,23 @@ export default function SelectedStory() {
62
39
  }
63
40
 
64
41
  function Preview({selected}: {selected: boolean}) {
65
- const rootTheme = useRootTheme()
66
-
67
42
  return (
68
43
  <Flex>
69
44
  <Box flex={1}>
70
45
  <Text size={1}>Title</Text>
71
46
  </Box>
72
47
  <Inline space={3}>
73
- <TextWithTone
74
- data-selected={selected ? '' : undefined}
75
- muted
76
- size={1}
77
- weight="medium"
78
- $tone={rootTheme.tone === 'default' ? 'caution' : 'default'}
79
- >
48
+ <Text data-selected={selected ? '' : undefined} muted size={1} weight="medium">
80
49
  <EditIcon />
81
- </TextWithTone>
82
- <TextWithTone
50
+ </Text>
51
+ <Text
83
52
  data-selected={selected ? '' : undefined}
84
53
  muted
85
54
  size={1}
86
- $tone={rootTheme.tone === 'default' ? 'positive' : 'default'}
55
+ // $tone={rootTheme.tone === 'default' ? 'positive' : 'default'}
87
56
  >
88
57
  <PublishIcon />
89
- </TextWithTone>
58
+ </Text>
90
59
  </Inline>
91
60
  </Flex>
92
61
  )
@@ -1,5 +1,4 @@
1
1
  import {card, CardStyleProps, composeClassNames} from '@sanity/ui/css'
2
- import {createElement} from 'react'
3
2
 
4
3
  import {Props} from '../../types'
5
4
  import {Box, BoxElementType, BoxOwnProps} from '../box'
@@ -57,14 +56,8 @@ export function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(pr
57
56
  } = props as CardProps<typeof DEFAULT_CARD_ELEMENT>
58
57
 
59
58
  const parent = useCard()
60
-
61
- const context = {
62
- tone: parent?.tone ?? 'default',
63
- scheme: parent?.scheme ?? 'light',
64
- }
65
-
66
- const tone = toneProp === 'inherit' ? context.tone : toneProp
67
- const scheme = schemeProp === undefined ? context.scheme : schemeProp
59
+ const tone = toneProp === 'inherit' ? parent?.tone : toneProp
60
+ const scheme = schemeProp === undefined ? parent?.scheme : schemeProp
68
61
 
69
62
  let node = (
70
63
  <Box
@@ -74,7 +67,7 @@ export function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(pr
74
67
  className={composeClassNames(
75
68
  className,
76
69
  card({
77
- scheme: scheme === context.scheme ? undefined : scheme,
70
+ scheme: scheme === parent?.scheme ? undefined : scheme,
78
71
  shadow,
79
72
  tone,
80
73
  }),
@@ -89,27 +82,28 @@ export function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(pr
89
82
  />
90
83
  )
91
84
 
92
- if (scheme === context.scheme && tone === context.tone) {
85
+ if (scheme === parent?.scheme && tone === parent?.tone) {
93
86
  return node
94
87
  }
95
88
 
96
89
  node = (
97
90
  <CardProvider
98
- compat_provider={parent?.compat_provider}
99
- rendered={true}
100
- scheme={scheme}
101
- tone={tone ?? context.tone}
91
+ scheme={scheme ?? 'light'}
92
+ tone={tone ?? 'default'}
93
+ unstable_CompatProvider={parent?.unstable_CompatProvider}
102
94
  >
103
95
  {node}
104
96
  </CardProvider>
105
97
  )
106
98
 
107
- if (parent?.compat_provider) {
108
- return createElement(parent.compat_provider, {
109
- children: node,
110
- scheme,
111
- tone: tone ?? context.tone,
112
- })
99
+ if (parent?.unstable_CompatProvider) {
100
+ const CompatProvider = parent.unstable_CompatProvider
101
+
102
+ return (
103
+ <CompatProvider scheme={scheme ?? 'light'} tone={tone ?? parent?.tone ?? 'default'}>
104
+ {node}
105
+ </CompatProvider>
106
+ )
113
107
  }
114
108
 
115
109
  return node
@@ -0,0 +1,27 @@
1
+ import {ThemeColorCardToneKey, ThemeColorSchemeKey} from '@sanity/ui/theme'
2
+ import {ReactNode, useMemo} from 'react'
3
+
4
+ import {CardContext} from './cardContext'
5
+ import {_CardCompatProviderComponent} from './types'
6
+
7
+ export function CardProvider(props: {
8
+ children?: ReactNode
9
+ tone: ThemeColorCardToneKey
10
+ scheme: ThemeColorSchemeKey
11
+ unstable_CompatProvider?: _CardCompatProviderComponent
12
+ }) {
13
+ const {children, tone, scheme, unstable_CompatProvider} = props
14
+
15
+ return (
16
+ <CardContext.Provider
17
+ value={useMemo(
18
+ () => ({tone, scheme, unstable_CompatProvider}),
19
+ [tone, scheme, unstable_CompatProvider],
20
+ )}
21
+ >
22
+ {children}
23
+ </CardContext.Provider>
24
+ )
25
+ }
26
+
27
+ CardProvider.displayName = 'CardProvider'
@@ -12,16 +12,17 @@ export interface CardStyleProps {
12
12
  $tone: ThemeColorCardToneKey
13
13
  }
14
14
 
15
- export type CardCompatProviderComponent = ComponentType<{
15
+ /** @internal */
16
+ export type _CardCompatProviderComponent = ComponentType<{
16
17
  children?: ReactNode
17
18
  tone: ThemeColorCardToneKey
18
19
  scheme: ThemeColorSchemeKey
19
20
  }>
20
21
 
21
- /** @internal */
22
+ /** @public */
22
23
  export interface CardContextValue {
23
- compat_provider?: CardCompatProviderComponent
24
- rendered: boolean
25
24
  tone: ThemeColorCardToneKey
26
25
  scheme: ThemeColorSchemeKey
26
+ /** @internal */
27
+ unstable_CompatProvider?: _CardCompatProviderComponent
27
28
  }
@@ -43,7 +43,7 @@ export default function OpticalAlignment() {
43
43
 
44
44
  <Flex>
45
45
  <Card padding={2} tone="neutral">
46
- <Heading accent>
46
+ <Heading>
47
47
  <AddCircleIcon />
48
48
  </Heading>
49
49
  </Card>
@@ -8,7 +8,6 @@ import {
8
8
  } from '../../../../../workshop/constants'
9
9
 
10
10
  export default function PlainStory() {
11
- const accent = useBoolean('Accent', false, 'Props')
12
11
  const muted = useBoolean('Muted', false, 'Props')
13
12
  const size = useSelect('Size', WORKSHOP_HEADING_FONT_SIZE_OPTIONS, 2, 'Props')
14
13
  const textChild = useText('Text', 'Hello, world', 'Props')
@@ -18,13 +17,7 @@ export default function PlainStory() {
18
17
 
19
18
  return (
20
19
  <Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
21
- <Heading
22
- accent={accent}
23
- muted={muted}
24
- size={size}
25
- textOverflow={textOverflow}
26
- weight={weight}
27
- >
20
+ <Heading muted={muted} size={size} textOverflow={textOverflow} weight={weight}>
28
21
  {textChild}
29
22
  </Heading>
30
23
  </Flex>
@@ -9,7 +9,6 @@ import {
9
9
  } from '../../../../../workshop/constants'
10
10
 
11
11
  export default function PlainStory() {
12
- const accent = useBoolean('Accent', false, 'Props')
13
12
  const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS, undefined, 'Props') || undefined
14
13
  const muted = useBoolean('Muted', false, 'Props')
15
14
  const size = useSelect('Size', WORKSHOP_LABEL_FONT_SIZE_OPTIONS, undefined, 'Props')
@@ -21,14 +20,7 @@ export default function PlainStory() {
21
20
  return (
22
21
  <Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
23
22
  <Container width={0}>
24
- <Label
25
- accent={accent}
26
- align={align}
27
- muted={muted}
28
- size={size}
29
- textOverflow={textOverflow}
30
- weight={weight}
31
- >
23
+ <Label align={align} muted={muted} size={size} textOverflow={textOverflow} weight={weight}>
32
24
  {textChild}
33
25
  </Label>
34
26
  </Container>
@@ -141,7 +141,7 @@ export function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_EL
141
141
 
142
142
  const {
143
143
  __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
144
- animate: _animate = false,
144
+ animate: _animate = true,
145
145
  arrow: arrowProp = false,
146
146
  as: as = DEFAULT_POPOVER_ELEMENT,
147
147
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -9,7 +9,6 @@ import {
9
9
  } from '../../../../../workshop/constants'
10
10
 
11
11
  export default function TextStory() {
12
- const accent = useBoolean('Accent', false, 'Props')
13
12
  const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS, '', 'Props') || undefined
14
13
  const muted = useBoolean('Muted', false, 'Props')
15
14
  const size = useSelect('Size', WORKSHOP_TEXT_SIZE_OPTIONS, 1, 'Props')
@@ -23,14 +22,7 @@ export default function TextStory() {
23
22
  return (
24
23
  <Flex align="center" height="fill" justify="center" padding={4} sizing="border">
25
24
  <Container width={0}>
26
- <Text
27
- accent={accent}
28
- align={align}
29
- muted={muted}
30
- size={size}
31
- textOverflow={textOverflow}
32
- weight={weight}
33
- >
25
+ <Text align={align} muted={muted} size={size} textOverflow={textOverflow} weight={weight}>
34
26
  {text}
35
27
  </Text>
36
28
  </Container>
@@ -107,7 +107,7 @@ export function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_EL
107
107
  const boundaryElementContext = useBoundaryElement()
108
108
 
109
109
  const {
110
- animate: _animate = false,
110
+ animate: _animate = true,
111
111
  arrow: arrowProp = false,
112
112
  as = DEFAULT_TOOLTIP_ELEMENT,
113
113
  boundaryElement = boundaryElementContext?.element,
@@ -1,4 +1,4 @@
1
- import {createElement, ReactNode, ReactPortal} from 'react'
1
+ import {ReactNode, ReactPortal} from 'react'
2
2
  import {createPortal} from 'react-dom'
3
3
 
4
4
  import {CardProvider, useCard} from '../../primitives'
@@ -26,15 +26,13 @@ export function Portal(props: PortalProps): ReactPortal | null {
26
26
  }
27
27
 
28
28
  return createPortal(
29
- createElement(
30
- CardProvider,
31
- {
32
- rendered: true,
33
- tone: 'transparent', // card?.tone || 'default',
34
- scheme: card?.scheme || 'light',
35
- },
36
- children,
37
- ),
29
+ <CardProvider
30
+ // rendered={true}
31
+ tone="transparent" // card?.tone || 'default',
32
+ scheme={card?.scheme || 'light'}
33
+ >
34
+ {children}
35
+ </CardProvider>,
38
36
  portalElement,
39
37
  )
40
38
  }
@@ -6,10 +6,10 @@ import {Properties} from './types'
6
6
  import {varNames} from './varNames'
7
7
 
8
8
  /** @internal */
9
- export function compilePalette(): string {
9
+ export function _compilePalette(): string {
10
10
  return _compileStyle({
11
11
  layers: {
12
- theme: {
12
+ palette: {
13
13
  ':root': compilePaletteProperties(),
14
14
  },
15
15
  },
@@ -2,6 +2,6 @@ import {_compileStyle} from './_compileStyle'
2
2
  import {_systemStyle} from './_system.style'
3
3
 
4
4
  /** @internal */
5
- export function compileSystem(): string {
5
+ export function _compileSystem(): string {
6
6
  return _compileStyle(_systemStyle)
7
7
  }
@@ -1,11 +1,11 @@
1
1
  import {type RootTheme} from '@sanity/ui/theme'
2
2
 
3
- import {compileTheme_v3} from './compileTheme_v3'
3
+ import {_compileTheme_v3} from './_compileTheme_v3'
4
4
 
5
5
  /** @internal */
6
- export function compileTheme(theme: RootTheme): string {
6
+ export function _compileTheme(theme: RootTheme): string {
7
7
  if (theme.v3) {
8
- return compileTheme_v3(theme.v3)
8
+ return _compileTheme_v3(theme.v3)
9
9
  }
10
10
 
11
11
  if (theme.v2) {
@@ -22,7 +22,7 @@ const THEME_COLOR_SCHEMES = ['dark', 'light'] as const
22
22
  const THEME_COLOR_VARIANTS = ['tinted', 'solid'] as const
23
23
 
24
24
  /** @internal */
25
- export function compileTheme_v3(theme: Theme_v3): string {
25
+ export function _compileTheme_v3(theme: Theme_v3): string {
26
26
  return _compileStyle({
27
27
  layers: {
28
28
  theme: {
@@ -36,7 +36,10 @@ function compileThemeProperties(theme: Theme_v3): Properties {
36
36
  return {
37
37
  ...buildAvatarThemeProperties(theme),
38
38
  ...buildButtonThemeProperties(theme),
39
+
40
+ // card
39
41
  [varNames.card.shadow.outline]: px(theme.card.shadow.outline),
42
+
40
43
  ...buildColorThemeProperties(theme),
41
44
  ...buildContainerThemeProperties(theme),
42
45
  ...buildFontCodeThemeProperties(theme),
@@ -297,6 +300,7 @@ function buildColorThemeProperties(theme: Theme_v3): Properties {
297
300
  const t = theme._tokens.color[cardTone].variant[colorVariant][elementTone]
298
301
 
299
302
  const context: RenderColorContext = {
303
+ bgValue: 'transparent',
300
304
  bgVar: v.bg[0],
301
305
  hue: t._hue,
302
306
  scheme,
@@ -342,6 +346,7 @@ function buildColorAvatarThemeProperties(
342
346
 
343
347
  for (const hue of HUES) {
344
348
  const context: RenderColorContext = {
349
+ bgValue: 'transparent',
345
350
  bgVar: varNames.color.bg,
346
351
  hue: t.avatar[hue]._hue ?? hue,
347
352
  scheme,
@@ -366,6 +371,7 @@ function buildColorCardThemeProperties(
366
371
  const t = theme._tokens.color[cardTone]
367
372
 
368
373
  const context: RenderColorContext = {
374
+ bgValue: 'transparent',
369
375
  bgVar: varNames.color.bg,
370
376
  hue: t._hue,
371
377
  scheme,
@@ -1,5 +1,3 @@
1
- // import type {Style, StyleKeyframes, StyleLayers, StyleRules} from '@sanity/css'
2
-
3
1
  import {Style, StyleKeyframes, StyleLayers, StyleRules} from './types'
4
2
 
5
3
  /** @internal */
@@ -9,11 +7,6 @@ export function _mergeStyles(styles: Style[]): Style {
9
7
  const rules: StyleRules = {}
10
8
 
11
9
  for (const s of styles) {
12
- if (!s) {
13
- // TODO: should not happen
14
- continue
15
- }
16
-
17
10
  Object.assign(keyframes, s.keyframes)
18
11
 
19
12
  for (const layerName in s.layers) {
@@ -31,6 +31,7 @@ import {pointerEventsStyle} from './aspects/pointerEvents/pointerEvents.style'
31
31
  import {positionStyle} from './aspects/position/position.style'
32
32
  import {radiusStyle} from './aspects/radius/radius.style'
33
33
  import {shadowStyle} from './aspects/shadow/shadow.style'
34
+ import {textAlignStyle} from './aspects/textAlign/textAlign.style'
34
35
  import {textOverflowStyle} from './aspects/textOverflow/textOverflow.style'
35
36
  import {widthStyle} from './aspects/width/width.style'
36
37
  import {breadcrumbsStyle} from './components/breadcrumbs/breadcrumbs.style'
@@ -74,6 +75,7 @@ export const _systemStyle: Style = _mergeStyles([
74
75
  {
75
76
  // define order of layers
76
77
  layers: {
78
+ palette: {},
77
79
  theme: {},
78
80
  base: {},
79
81
  util: {},
@@ -114,6 +116,7 @@ export const _systemStyle: Style = _mergeStyles([
114
116
  positionStyle,
115
117
  radiusStyle,
116
118
  shadowStyle,
119
+ textAlignStyle,
117
120
  textOverflowStyle,
118
121
  widthStyle,
119
122
 
@@ -1,4 +1,3 @@
1
- import {_responsiveRule} from '../../_responsiveRule'
2
1
  import {Style, StyleRules} from '../../types'
3
2
 
4
3
  export const primitive: StyleRules = {
@@ -69,24 +68,4 @@ export const primitive: StyleRules = {
69
68
  },
70
69
  }
71
70
 
72
- _responsiveRule(primitive, `text-align-initial`, {
73
- textAlign: 'initial',
74
- })
75
-
76
- _responsiveRule(primitive, `text-align-left`, {
77
- textAlign: 'left',
78
- })
79
-
80
- _responsiveRule(primitive, `text-align-center`, {
81
- textAlign: 'center',
82
- })
83
-
84
- _responsiveRule(primitive, `text-align-right`, {
85
- textAlign: 'right',
86
- })
87
-
88
- _responsiveRule(primitive, `text-align-justify`, {
89
- textAlign: 'justify',
90
- })
91
-
92
71
  export const fontStyle: Style = {layers: {primitive}}
@@ -1,12 +1,7 @@
1
- import {_resp} from '../../_resp'
2
1
  import {composeClassNames} from '../../composeClassNames'
3
2
  import {FontStyleProps} from './types'
4
3
 
5
4
  /** @public */
6
5
  export function font(props: FontStyleProps): string | undefined {
7
- return composeClassNames(
8
- 'font',
9
- props.weight && `font-${props.weight}`,
10
- _resp('text-align', props.align),
11
- )
6
+ return composeClassNames('font', props.weight && `font-${props.weight}`)
12
7
  }
@@ -1,10 +1,6 @@
1
1
  import {FontWeight} from '@sanity/ui/theme'
2
2
 
3
- /** @public */
4
- export type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
5
-
6
3
  /** @public */
7
4
  export interface FontStyleProps {
8
- align?: TextAlign
9
5
  weight?: FontWeight
10
6
  }
@@ -17,5 +17,6 @@ export * from './pointerEvents'
17
17
  export * from './position'
18
18
  export * from './radius'
19
19
  export * from './shadow'
20
+ export * from './textAlign'
20
21
  export * from './textOverflow'
21
22
  export * from './width'
@@ -0,0 +1,2 @@
1
+ export * from './textAlign'
2
+ export * from './types'
@@ -0,0 +1,26 @@
1
+ import {_responsiveRule} from '../../_responsiveRule'
2
+ import {Style, StyleRules} from '../../types'
3
+
4
+ export const util: StyleRules = {}
5
+
6
+ _responsiveRule(util, `text-align-initial`, {
7
+ textAlign: 'initial',
8
+ })
9
+
10
+ _responsiveRule(util, `text-align-left`, {
11
+ textAlign: 'left',
12
+ })
13
+
14
+ _responsiveRule(util, `text-align-center`, {
15
+ textAlign: 'center',
16
+ })
17
+
18
+ _responsiveRule(util, `text-align-right`, {
19
+ textAlign: 'right',
20
+ })
21
+
22
+ _responsiveRule(util, `text-align-justify`, {
23
+ textAlign: 'justify',
24
+ })
25
+
26
+ export const textAlignStyle: Style = {layers: {util}}
@@ -0,0 +1,8 @@
1
+ import {_resp} from '../../_resp'
2
+ import {composeClassNames} from '../../composeClassNames'
3
+ import {TextAlignStyleProps} from './types'
4
+
5
+ /** @public */
6
+ export function textAlign(props: TextAlignStyleProps): string | undefined {
7
+ return composeClassNames(_resp('text-align', props.textAlign))
8
+ }
@@ -0,0 +1,7 @@
1
+ /** @public */
2
+ export type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
3
+
4
+ /** @public */
5
+ export interface TextAlignStyleProps {
6
+ textAlign?: TextAlign
7
+ }
package/src/css/index.ts CHANGED
@@ -1,7 +1,7 @@
1
+ export * from './_compilePalette'
2
+ export * from './_compileSystem'
3
+ export * from './_compileTheme'
1
4
  export * from './aspects'
2
- export * from './compilePalette'
3
- export * from './compileSystem'
4
- export * from './compileTheme'
5
5
  export * from './components/breadcrumbs'
6
6
  export * from './components/dialog'
7
7
  export * from './components/menu'
@@ -1,5 +1,6 @@
1
1
  import {FONT_TEXT_SIZE, SPACE} from '@sanity/ui/theme'
2
2
 
3
+ import {_responsiveRule} from '../../_responsiveRule'
3
4
  import {Style, StyleRules} from '../../types'
4
5
  import {varNames} from '../../varNames'
5
6
  import {vars} from '../../vars'
@@ -132,31 +133,28 @@ const primitive: StyleRules = {
132
133
  },
133
134
  }
134
135
 
135
- // todo: make responsive
136
- for (const textSize of FONT_TEXT_SIZE) {
137
- const source = vars.font.text.sizes[textSize]
136
+ for (const size of FONT_TEXT_SIZE) {
137
+ const source = vars.font.text.sizes[size]
138
138
 
139
- primitive[`.input-${textSize}`] = {
139
+ _responsiveRule(primitive, `input-${size}`, {
140
140
  [varNames.input.fontSize]: source.fontSize,
141
141
  [varNames.input.lineHeight]: source.lineHeight,
142
142
  [varNames.input.letterSpacing]: source.letterSpacing,
143
143
  [varNames.input.ascenderHeight]: source.ascenderHeight,
144
144
  [varNames.input.descenderHeight]: source.descenderHeight,
145
- }
145
+ })
146
146
  }
147
147
 
148
- // todo: make responsive
149
148
  for (const space of SPACE) {
150
- primitive[`.input-p-${space}`] = {
149
+ _responsiveRule(primitive, `input-p-${space}`, {
151
150
  [varNames.input.padding]: vars.space[space],
152
- }
151
+ })
153
152
  }
154
153
 
155
- // todo: make responsive
156
154
  for (const space of SPACE) {
157
- primitive[`.input-g-${space}`] = {
155
+ _responsiveRule(primitive, `input-g-${space}`, {
158
156
  [varNames.input.gap]: vars.space[space],
159
- }
157
+ })
160
158
  }
161
159
 
162
160
  export const _inputStyle: Style = {layers: {primitive}}
@@ -7,7 +7,11 @@ const primitive: StyleRules = {
7
7
  'minHeight': 0,
8
8
 
9
9
  '@nest': {
10
- '&:is(ul), &:is(ol)': {
10
+ 'iframe&': {
11
+ border: 'none',
12
+ },
13
+
14
+ 'ul&, ol&': {
11
15
  listStyle: 'none',
12
16
  },
13
17
 
@@ -18,6 +18,7 @@ import {
18
18
  pointerEvents,
19
19
  position,
20
20
  radius,
21
+ textAlign,
21
22
  width,
22
23
  } from '../../aspects'
23
24
  import {BoxStyleProps} from './types'
@@ -47,6 +48,7 @@ export function box(props: BoxStyleProps): string | undefined {
47
48
  pointerEvents(props),
48
49
  position(props),
49
50
  radius(props),
51
+ textAlign(props),
50
52
  width(props),
51
53
  )
52
54
  }