@sanity/ui 5.0.0-alpha.22 → 5.0.0-alpha.24

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 (377) hide show
  1. package/README.md +10 -0
  2. package/dist/index.d.ts +15 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +76 -59
  5. package/dist/index.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/docs/components/avatar-counter.dsds.yaml +78 -0
  8. package/docs/components/avatar-stack.dsds.yaml +96 -0
  9. package/docs/components/avatar.dsds.yaml +115 -0
  10. package/docs/components/badge.dsds.yaml +126 -0
  11. package/docs/components/box.dsds.yaml +223 -0
  12. package/docs/components/button.dsds.yaml +296 -0
  13. package/docs/components/card.dsds.yaml +317 -0
  14. package/docs/components/checkbox.dsds.yaml +204 -0
  15. package/docs/components/code.dsds.yaml +169 -0
  16. package/docs/components/container.dsds.yaml +189 -0
  17. package/docs/components/dialog.dsds.yaml +343 -0
  18. package/docs/components/divider.dsds.yaml +93 -0
  19. package/docs/components/eyebrow.dsds.yaml +198 -0
  20. package/docs/components/flex.dsds.yaml +237 -0
  21. package/docs/components/grid.dsds.yaml +217 -0
  22. package/docs/components/h-stack.dsds.yaml +127 -0
  23. package/docs/components/heading.dsds.yaml +233 -0
  24. package/docs/components/hotkeys.dsds.yaml +60 -0
  25. package/docs/components/icon-button.dsds.yaml +227 -0
  26. package/docs/components/icon.dsds.yaml +275 -0
  27. package/docs/components/indicator-stack.dsds.yaml +98 -0
  28. package/docs/components/indicator.dsds.yaml +108 -0
  29. package/docs/components/inline.dsds.yaml +127 -0
  30. package/docs/components/kbd.dsds.yaml +59 -0
  31. package/docs/components/link.dsds.yaml +108 -0
  32. package/docs/components/list-button-item.dsds.yaml +103 -0
  33. package/docs/components/list-item-image.dsds.yaml +82 -0
  34. package/docs/components/list-item-text.dsds.yaml +80 -0
  35. package/docs/components/list-item.dsds.yaml +148 -0
  36. package/docs/components/list.dsds.yaml +162 -0
  37. package/docs/components/popover.dsds.yaml +214 -0
  38. package/docs/components/press-area.dsds.yaml +279 -0
  39. package/docs/components/radio.dsds.yaml +198 -0
  40. package/docs/components/select.dsds.yaml +214 -0
  41. package/docs/components/skip-to-content.dsds.yaml +110 -0
  42. package/docs/components/spinner.dsds.yaml +119 -0
  43. package/docs/components/switch.dsds.yaml +202 -0
  44. package/docs/components/tab.dsds.yaml +54 -0
  45. package/docs/components/tabs-list.dsds.yaml +56 -0
  46. package/docs/components/tabs-panel.dsds.yaml +54 -0
  47. package/docs/components/tabs.dsds.yaml +104 -0
  48. package/docs/components/text-area.dsds.yaml +170 -0
  49. package/docs/components/text-input.dsds.yaml +189 -0
  50. package/docs/components/text.dsds.yaml +268 -0
  51. package/docs/components/tooltip-group.dsds.yaml +90 -0
  52. package/docs/components/tooltip.dsds.yaml +216 -0
  53. package/docs/components/v-stack.dsds.yaml +155 -0
  54. package/docs/components/visually-hidden.dsds.yaml +112 -0
  55. package/docs/evals/cases.yaml +1319 -0
  56. package/docs/examples/checkbox-2.tsx +57 -0
  57. package/docs/examples/confirmation-dialogs-1.tsx +27 -0
  58. package/docs/examples/confirmation-dialogs-2.tsx +55 -0
  59. package/docs/examples/confirmation-dialogs-3.tsx +28 -0
  60. package/docs/examples/confirmation-dialogs-4.tsx +38 -0
  61. package/docs/examples/popover-1.tsx +48 -0
  62. package/docs/examples/popover-2.tsx +53 -0
  63. package/docs/foundations/accessibility-guidelines.dsds.yaml +301 -0
  64. package/docs/foundations/color-guidelines.dsds.yaml +308 -0
  65. package/docs/foundations/content-guidelines.dsds.yaml +285 -0
  66. package/docs/foundations/semantics.dsds.yaml +125 -0
  67. package/docs/foundations/spacing-guidelines.dsds.yaml +226 -0
  68. package/docs/foundations/typography-guidelines.dsds.yaml +322 -0
  69. package/docs/icons/icon-access-denied.dsds.yaml +40 -0
  70. package/docs/icons/icon-activity.dsds.yaml +40 -0
  71. package/docs/icons/icon-add-circle.dsds.yaml +14 -0
  72. package/docs/icons/icon-add-comment.dsds.yaml +34 -0
  73. package/docs/icons/icon-add-document.dsds.yaml +34 -0
  74. package/docs/icons/icon-add-user.dsds.yaml +30 -0
  75. package/docs/icons/icon-add.dsds.yaml +57 -0
  76. package/docs/icons/icon-api.dsds.yaml +17 -0
  77. package/docs/icons/icon-archive.dsds.yaml +44 -0
  78. package/docs/icons/icon-arrow-down.dsds.yaml +38 -0
  79. package/docs/icons/icon-arrow-left.dsds.yaml +32 -0
  80. package/docs/icons/icon-arrow-right.dsds.yaml +32 -0
  81. package/docs/icons/icon-arrow-top-right.dsds.yaml +32 -0
  82. package/docs/icons/icon-arrow-up.dsds.yaml +44 -0
  83. package/docs/icons/icon-asterisk.dsds.yaml +18 -0
  84. package/docs/icons/icon-bar-chart.dsds.yaml +40 -0
  85. package/docs/icons/icon-basket.dsds.yaml +14 -0
  86. package/docs/icons/icon-bell.dsds.yaml +30 -0
  87. package/docs/icons/icon-bill.dsds.yaml +40 -0
  88. package/docs/icons/icon-binary-document.dsds.yaml +30 -0
  89. package/docs/icons/icon-block-content.dsds.yaml +30 -0
  90. package/docs/icons/icon-block-element.dsds.yaml +32 -0
  91. package/docs/icons/icon-blockquote.dsds.yaml +32 -0
  92. package/docs/icons/icon-bold.dsds.yaml +28 -0
  93. package/docs/icons/icon-bolt.dsds.yaml +18 -0
  94. package/docs/icons/icon-book.dsds.yaml +34 -0
  95. package/docs/icons/icon-bookmark-filled.dsds.yaml +14 -0
  96. package/docs/icons/icon-bookmark.dsds.yaml +14 -0
  97. package/docs/icons/icon-bottle.dsds.yaml +18 -0
  98. package/docs/icons/icon-bug.dsds.yaml +28 -0
  99. package/docs/icons/icon-bulb-filled.dsds.yaml +14 -0
  100. package/docs/icons/icon-bulb-outline.dsds.yaml +30 -0
  101. package/docs/icons/icon-calendar.dsds.yaml +36 -0
  102. package/docs/icons/icon-case.dsds.yaml +18 -0
  103. package/docs/icons/icon-chart-upward.dsds.yaml +40 -0
  104. package/docs/icons/icon-checkmark-circle.dsds.yaml +40 -0
  105. package/docs/icons/icon-checkmark.dsds.yaml +36 -0
  106. package/docs/icons/icon-chevron-down.dsds.yaml +46 -0
  107. package/docs/icons/icon-chevron-left.dsds.yaml +42 -0
  108. package/docs/icons/icon-chevron-right.dsds.yaml +42 -0
  109. package/docs/icons/icon-chevron-up.dsds.yaml +44 -0
  110. package/docs/icons/icon-circle.dsds.yaml +28 -0
  111. package/docs/icons/icon-clipboard-image.dsds.yaml +30 -0
  112. package/docs/icons/icon-clipboard.dsds.yaml +34 -0
  113. package/docs/icons/icon-clock.dsds.yaml +39 -0
  114. package/docs/icons/icon-close-circle.dsds.yaml +18 -0
  115. package/docs/icons/icon-close.dsds.yaml +51 -0
  116. package/docs/icons/icon-code-block.dsds.yaml +38 -0
  117. package/docs/icons/icon-code.dsds.yaml +40 -0
  118. package/docs/icons/icon-cog.dsds.yaml +38 -0
  119. package/docs/icons/icon-collapse.dsds.yaml +40 -0
  120. package/docs/icons/icon-color-wheel.dsds.yaml +30 -0
  121. package/docs/icons/icon-comment.dsds.yaml +38 -0
  122. package/docs/icons/icon-component.dsds.yaml +18 -0
  123. package/docs/icons/icon-compose-sparkles.dsds.yaml +36 -0
  124. package/docs/icons/icon-compose.dsds.yaml +38 -0
  125. package/docs/icons/icon-confetti.dsds.yaml +18 -0
  126. package/docs/icons/icon-controls.dsds.yaml +36 -0
  127. package/docs/icons/icon-copy.dsds.yaml +31 -0
  128. package/docs/icons/icon-credit-card.dsds.yaml +18 -0
  129. package/docs/icons/icon-crop.dsds.yaml +32 -0
  130. package/docs/icons/icon-cube.dsds.yaml +36 -0
  131. package/docs/icons/icon-dashboard.dsds.yaml +34 -0
  132. package/docs/icons/icon-database.dsds.yaml +40 -0
  133. package/docs/icons/icon-desktop.dsds.yaml +31 -0
  134. package/docs/icons/icon-diamond.dsds.yaml +18 -0
  135. package/docs/icons/icon-document-pdf.dsds.yaml +34 -0
  136. package/docs/icons/icon-document-remove.dsds.yaml +30 -0
  137. package/docs/icons/icon-document-sheet.dsds.yaml +34 -0
  138. package/docs/icons/icon-document-text.dsds.yaml +30 -0
  139. package/docs/icons/icon-document-video.dsds.yaml +30 -0
  140. package/docs/icons/icon-document-word.dsds.yaml +34 -0
  141. package/docs/icons/icon-document-zip.dsds.yaml +30 -0
  142. package/docs/icons/icon-document.dsds.yaml +52 -0
  143. package/docs/icons/icon-documents.dsds.yaml +30 -0
  144. package/docs/icons/icon-dot.dsds.yaml +32 -0
  145. package/docs/icons/icon-double-chevron-down.dsds.yaml +38 -0
  146. package/docs/icons/icon-double-chevron-left.dsds.yaml +34 -0
  147. package/docs/icons/icon-double-chevron-right.dsds.yaml +34 -0
  148. package/docs/icons/icon-double-chevron-up.dsds.yaml +36 -0
  149. package/docs/icons/icon-double-quote.dsds.yaml +14 -0
  150. package/docs/icons/icon-download.dsds.yaml +40 -0
  151. package/docs/icons/icon-drag-handle.dsds.yaml +28 -0
  152. package/docs/icons/icon-drop.dsds.yaml +30 -0
  153. package/docs/icons/icon-earth-americas.dsds.yaml +34 -0
  154. package/docs/icons/icon-earth-globe.dsds.yaml +34 -0
  155. package/docs/icons/icon-edit.dsds.yaml +34 -0
  156. package/docs/icons/icon-ellipsis-horizontal.dsds.yaml +32 -0
  157. package/docs/icons/icon-ellipsis-vertical.dsds.yaml +14 -0
  158. package/docs/icons/icon-empty.dsds.yaml +28 -0
  159. package/docs/icons/icon-enter-right.dsds.yaml +18 -0
  160. package/docs/icons/icon-enter.dsds.yaml +18 -0
  161. package/docs/icons/icon-envelope.dsds.yaml +34 -0
  162. package/docs/icons/icon-equal.dsds.yaml +14 -0
  163. package/docs/icons/icon-error-filled.dsds.yaml +14 -0
  164. package/docs/icons/icon-error-outline.dsds.yaml +38 -0
  165. package/docs/icons/icon-error-screen.dsds.yaml +14 -0
  166. package/docs/icons/icon-expand.dsds.yaml +36 -0
  167. package/docs/icons/icon-eye-closed.dsds.yaml +38 -0
  168. package/docs/icons/icon-eye-open.dsds.yaml +38 -0
  169. package/docs/icons/icon-face-happy.dsds.yaml +14 -0
  170. package/docs/icons/icon-face-indifferent.dsds.yaml +14 -0
  171. package/docs/icons/icon-face-sad.dsds.yaml +14 -0
  172. package/docs/icons/icon-feedback.dsds.yaml +30 -0
  173. package/docs/icons/icon-filter.dsds.yaml +38 -0
  174. package/docs/icons/icon-folder.dsds.yaml +36 -0
  175. package/docs/icons/icon-generate.dsds.yaml +18 -0
  176. package/docs/icons/icon-github.dsds.yaml +14 -0
  177. package/docs/icons/icon-groq.dsds.yaml +31 -0
  178. package/docs/icons/icon-hash.dsds.yaml +18 -0
  179. package/docs/icons/icon-heart-filled.dsds.yaml +18 -0
  180. package/docs/icons/icon-heart.dsds.yaml +18 -0
  181. package/docs/icons/icon-help-circle.dsds.yaml +38 -0
  182. package/docs/icons/icon-highlight.dsds.yaml +18 -0
  183. package/docs/icons/icon-home.dsds.yaml +28 -0
  184. package/docs/icons/icon-ice-cream.dsds.yaml +18 -0
  185. package/docs/icons/icon-image-remove.dsds.yaml +32 -0
  186. package/docs/icons/icon-image.dsds.yaml +36 -0
  187. package/docs/icons/icon-images.dsds.yaml +34 -0
  188. package/docs/icons/icon-inbox.dsds.yaml +14 -0
  189. package/docs/icons/icon-info-filled.dsds.yaml +14 -0
  190. package/docs/icons/icon-info-outline.dsds.yaml +38 -0
  191. package/docs/icons/icon-inline-element.dsds.yaml +32 -0
  192. package/docs/icons/icon-inline.dsds.yaml +18 -0
  193. package/docs/icons/icon-insert-above.dsds.yaml +32 -0
  194. package/docs/icons/icon-insert-below.dsds.yaml +32 -0
  195. package/docs/icons/icon-italic.dsds.yaml +28 -0
  196. package/docs/icons/icon-joystick.dsds.yaml +18 -0
  197. package/docs/icons/icon-json.dsds.yaml +36 -0
  198. package/docs/icons/icon-launch.dsds.yaml +34 -0
  199. package/docs/icons/icon-leave.dsds.yaml +35 -0
  200. package/docs/icons/icon-lemon.dsds.yaml +18 -0
  201. package/docs/icons/icon-link-removed.dsds.yaml +30 -0
  202. package/docs/icons/icon-link.dsds.yaml +36 -0
  203. package/docs/icons/icon-linkedin.dsds.yaml +14 -0
  204. package/docs/icons/icon-list.dsds.yaml +14 -0
  205. package/docs/icons/icon-lock.dsds.yaml +39 -0
  206. package/docs/icons/icon-logo-js.dsds.yaml +18 -0
  207. package/docs/icons/icon-logo-ts.dsds.yaml +18 -0
  208. package/docs/icons/icon-marker-removed.dsds.yaml +14 -0
  209. package/docs/icons/icon-marker.dsds.yaml +14 -0
  210. package/docs/icons/icon-master-detail.dsds.yaml +28 -0
  211. package/docs/icons/icon-menu.dsds.yaml +40 -0
  212. package/docs/icons/icon-microphone-slash.dsds.yaml +14 -0
  213. package/docs/icons/icon-microphone.dsds.yaml +14 -0
  214. package/docs/icons/icon-mobile-device.dsds.yaml +32 -0
  215. package/docs/icons/icon-moon.dsds.yaml +30 -0
  216. package/docs/icons/icon-number.dsds.yaml +30 -0
  217. package/docs/icons/icon-ok-hand.dsds.yaml +18 -0
  218. package/docs/icons/icon-olist.dsds.yaml +36 -0
  219. package/docs/icons/icon-overage.dsds.yaml +42 -0
  220. package/docs/icons/icon-package.dsds.yaml +34 -0
  221. package/docs/icons/icon-panel-left.dsds.yaml +38 -0
  222. package/docs/icons/icon-panel-right.dsds.yaml +40 -0
  223. package/docs/icons/icon-pause.dsds.yaml +32 -0
  224. package/docs/icons/icon-pin-filled.dsds.yaml +28 -0
  225. package/docs/icons/icon-pin-removed.dsds.yaml +14 -0
  226. package/docs/icons/icon-pin.dsds.yaml +32 -0
  227. package/docs/icons/icon-play.dsds.yaml +32 -0
  228. package/docs/icons/icon-plug.dsds.yaml +35 -0
  229. package/docs/icons/icon-presentation.dsds.yaml +18 -0
  230. package/docs/icons/icon-progress50.dsds.yaml +14 -0
  231. package/docs/icons/icon-progress75.dsds.yaml +14 -0
  232. package/docs/icons/icon-projects.dsds.yaml +14 -0
  233. package/docs/icons/icon-publish.dsds.yaml +38 -0
  234. package/docs/icons/icon-read-only.dsds.yaml +36 -0
  235. package/docs/icons/icon-redo.dsds.yaml +38 -0
  236. package/docs/icons/icon-refresh.dsds.yaml +38 -0
  237. package/docs/icons/icon-remove-circle.dsds.yaml +14 -0
  238. package/docs/icons/icon-remove.dsds.yaml +30 -0
  239. package/docs/icons/icon-reset.dsds.yaml +40 -0
  240. package/docs/icons/icon-restore.dsds.yaml +45 -0
  241. package/docs/icons/icon-retrieve.dsds.yaml +14 -0
  242. package/docs/icons/icon-retry.dsds.yaml +14 -0
  243. package/docs/icons/icon-revert.dsds.yaml +14 -0
  244. package/docs/icons/icon-robot.dsds.yaml +17 -0
  245. package/docs/icons/icon-rocket.dsds.yaml +34 -0
  246. package/docs/icons/icon-schema.dsds.yaml +36 -0
  247. package/docs/icons/icon-search.dsds.yaml +34 -0
  248. package/docs/icons/icon-select.dsds.yaml +38 -0
  249. package/docs/icons/icon-share.dsds.yaml +36 -0
  250. package/docs/icons/icon-sort.dsds.yaml +40 -0
  251. package/docs/icons/icon-sparkle.dsds.yaml +26 -0
  252. package/docs/icons/icon-sparkles.dsds.yaml +34 -0
  253. package/docs/icons/icon-spinner.dsds.yaml +38 -0
  254. package/docs/icons/icon-split-horizontal.dsds.yaml +32 -0
  255. package/docs/icons/icon-split-vertical.dsds.yaml +30 -0
  256. package/docs/icons/icon-square.dsds.yaml +18 -0
  257. package/docs/icons/icon-stack-compact.dsds.yaml +30 -0
  258. package/docs/icons/icon-stack.dsds.yaml +44 -0
  259. package/docs/icons/icon-star-filled.dsds.yaml +48 -0
  260. package/docs/icons/icon-star.dsds.yaml +51 -0
  261. package/docs/icons/icon-stop.dsds.yaml +32 -0
  262. package/docs/icons/icon-strikethrough.dsds.yaml +28 -0
  263. package/docs/icons/icon-string.dsds.yaml +38 -0
  264. package/docs/icons/icon-sun.dsds.yaml +30 -0
  265. package/docs/icons/icon-sync.dsds.yaml +36 -0
  266. package/docs/icons/icon-tablet-device.dsds.yaml +30 -0
  267. package/docs/icons/icon-tag.dsds.yaml +32 -0
  268. package/docs/icons/icon-tags.dsds.yaml +36 -0
  269. package/docs/icons/icon-target.dsds.yaml +14 -0
  270. package/docs/icons/icon-task.dsds.yaml +30 -0
  271. package/docs/icons/icon-terminal.dsds.yaml +30 -0
  272. package/docs/icons/icon-text.dsds.yaml +32 -0
  273. package/docs/icons/icon-th-large.dsds.yaml +34 -0
  274. package/docs/icons/icon-th-list.dsds.yaml +30 -0
  275. package/docs/icons/icon-thumbs-down.dsds.yaml +27 -0
  276. package/docs/icons/icon-thumbs-up.dsds.yaml +30 -0
  277. package/docs/icons/icon-tiers.dsds.yaml +18 -0
  278. package/docs/icons/icon-timeline.dsds.yaml +32 -0
  279. package/docs/icons/icon-toggle-arrow-right.dsds.yaml +39 -0
  280. package/docs/icons/icon-token.dsds.yaml +30 -0
  281. package/docs/icons/icon-transfer.dsds.yaml +32 -0
  282. package/docs/icons/icon-translate.dsds.yaml +32 -0
  283. package/docs/icons/icon-trash.dsds.yaml +34 -0
  284. package/docs/icons/icon-trend-upward.dsds.yaml +42 -0
  285. package/docs/icons/icon-triangle-outline.dsds.yaml +18 -0
  286. package/docs/icons/icon-trolley.dsds.yaml +18 -0
  287. package/docs/icons/icon-truncate.dsds.yaml +18 -0
  288. package/docs/icons/icon-twitter.dsds.yaml +18 -0
  289. package/docs/icons/icon-ulist.dsds.yaml +36 -0
  290. package/docs/icons/icon-unarchive.dsds.yaml +32 -0
  291. package/docs/icons/icon-underline.dsds.yaml +28 -0
  292. package/docs/icons/icon-undo.dsds.yaml +34 -0
  293. package/docs/icons/icon-unknown.dsds.yaml +36 -0
  294. package/docs/icons/icon-unlink.dsds.yaml +32 -0
  295. package/docs/icons/icon-unlock.dsds.yaml +41 -0
  296. package/docs/icons/icon-unpublish.dsds.yaml +38 -0
  297. package/docs/icons/icon-upload.dsds.yaml +40 -0
  298. package/docs/icons/icon-user.dsds.yaml +34 -0
  299. package/docs/icons/icon-users.dsds.yaml +34 -0
  300. package/docs/icons/icon-versions.dsds.yaml +14 -0
  301. package/docs/icons/icon-video.dsds.yaml +32 -0
  302. package/docs/icons/icon-warning-filled.dsds.yaml +14 -0
  303. package/docs/icons/icon-warning-outline.dsds.yaml +38 -0
  304. package/docs/icons/icon-wrench.dsds.yaml +18 -0
  305. package/docs/icons.dsds.yaml +768 -0
  306. package/docs/index.dsds.yaml +506 -0
  307. package/docs/overview/api-essentials.dsds.yaml +221 -0
  308. package/docs/overview/component-reference.dsds.yaml +213 -0
  309. package/docs/overview/installation.dsds.yaml +254 -0
  310. package/docs/overview/quick-start.dsds.yaml +317 -0
  311. package/docs/patterns/confirmation-dialogs.dsds.yaml +140 -0
  312. package/docs/patterns/error-messaging.dsds.yaml +58 -0
  313. package/docs/patterns/forms.dsds.yaml +362 -0
  314. package/docs/patterns/layouts.dsds.yaml +403 -0
  315. package/docs/patterns/loading-states.dsds.yaml +41 -0
  316. package/docs/patterns/messaging.dsds.yaml +72 -0
  317. package/docs/patterns/navigation.dsds.yaml +153 -0
  318. package/docs/patterns/responsive.dsds.yaml +590 -0
  319. package/docs/tokens/color.dsds.yaml +1158 -0
  320. package/docs/tokens/container-widths.dsds.yaml +131 -0
  321. package/docs/tokens/content.dsds.yaml +258 -0
  322. package/docs/tokens/content.tokens.json +180 -0
  323. package/docs/tokens/dtcg/README.md +41 -0
  324. package/docs/tokens/dtcg/css/color.css +107 -0
  325. package/docs/tokens/dtcg/css/container.css +12 -0
  326. package/docs/tokens/dtcg/css/fontFamily.css +10 -0
  327. package/docs/tokens/dtcg/css/fontWeight.css +10 -0
  328. package/docs/tokens/dtcg/css/index.css +12 -0
  329. package/docs/tokens/dtcg/css/radius.css +14 -0
  330. package/docs/tokens/dtcg/css/semantic.css +42 -0
  331. package/docs/tokens/dtcg/css/shadow.css +22 -0
  332. package/docs/tokens/dtcg/css/space.css +16 -0
  333. package/docs/tokens/dtcg/css/typography.css +67 -0
  334. package/docs/tokens/dtcg/json/color.tokens.json +911 -0
  335. package/docs/tokens/dtcg/json/container.tokens.json +44 -0
  336. package/docs/tokens/dtcg/json/fontFamily.tokens.json +10 -0
  337. package/docs/tokens/dtcg/json/fontWeight.tokens.json +18 -0
  338. package/docs/tokens/dtcg/json/radius.tokens.json +58 -0
  339. package/docs/tokens/dtcg/json/semantic.tokens.json +372 -0
  340. package/docs/tokens/dtcg/json/shadow.tokens.json +599 -0
  341. package/docs/tokens/dtcg/json/space.tokens.json +72 -0
  342. package/docs/tokens/dtcg/json/typography.tokens.json +354 -0
  343. package/docs/tokens/font-family.dsds.yaml +79 -0
  344. package/docs/tokens/font-weight.dsds.yaml +103 -0
  345. package/docs/tokens/radius.dsds.yaml +153 -0
  346. package/docs/tokens/semantic.dsds.yaml +397 -0
  347. package/docs/tokens/shadow.dsds.yaml +125 -0
  348. package/docs/tokens/space.dsds.yaml +185 -0
  349. package/docs/tokens/typography.dsds.yaml +316 -0
  350. package/llms.txt +108 -0
  351. package/package.json +6 -3
  352. package/skills/sanity-ui-5/SKILL.md +158 -0
  353. package/skills/sanity-ui-5/references/component-choice.md +37 -0
  354. package/skills/sanity-ui-5/references/components.md +145 -0
  355. package/skills/sanity-ui-5/references/forms-and-accessibility.md +189 -0
  356. package/skills/sanity-ui-5/references/migrating-from-v3.md +250 -0
  357. package/skills/sanity-ui-5/references/props-and-imports.md +169 -0
  358. package/skills/sanity-ui-5/references/setup.md +177 -0
  359. package/skills/sanity-ui-5/references/silent-failures.md +33 -0
  360. package/skills/sanity-ui-5/references/taste.md +53 -0
  361. package/skills/sanity-ui-5/references/tone-and-color.md +55 -0
  362. package/src/components/button/Button.tsx +14 -3
  363. package/src/components/button/button.css +23 -25
  364. package/src/components/button/button.props.ts +4 -0
  365. package/src/components/code/code.props.ts +3 -2
  366. package/src/components/eyebrow/Eyebrow.tsx +8 -3
  367. package/src/components/eyebrow/eyebrow.props.ts +10 -2
  368. package/src/components/heading/Heading.tsx +1 -1
  369. package/src/components/heading/heading.props.ts +4 -3
  370. package/src/components/popover/Popover.tsx +4 -3
  371. package/src/components/popover/popover.css +5 -3
  372. package/src/components/popover/popover.props.ts +9 -0
  373. package/src/components/text/text.props.ts +6 -1
  374. package/src/css/classes/system/typography.css +6 -6
  375. package/src/css/tokens/semantic.css +7 -7
  376. package/src/props/typography.ts +1 -5
  377. package/src/version.ts +2 -2
@@ -0,0 +1,237 @@
1
+ kind: component
2
+ id: flex
3
+ name: Flex
4
+ description: The lowest-level building block for laying out UI elements along a single axis.
5
+ metadata:
6
+ tags:
7
+ - layout
8
+ - flex
9
+ - alignment
10
+ - row
11
+ - column
12
+ - responsive
13
+ - flexbox
14
+ - gap
15
+ - wrap
16
+ - direction
17
+ - justify
18
+ - align
19
+ - alignItems
20
+ - justifyContent
21
+ - flexDirection
22
+ - flexWrap
23
+ status:
24
+ status: stable
25
+ sections:
26
+ - kind: guidelines
27
+ for: all
28
+ framing: when-to-use
29
+ title: When to use
30
+ items:
31
+ - level: should
32
+ statement: To stack items vertically or horizontally. Flex defaults to horizontal.
33
+ - level: should
34
+ statement: 'To control alignment: center children, space them apart, or push one to the end.'
35
+ - level: should
36
+ statement: To create responsive layouts that change direction at breakpoints.
37
+ - level: should-not
38
+ statement: To stack items in a simple vertical column with even spacing — use VStack instead.
39
+ alternatives:
40
+ - to: v-stack
41
+ - level: should-not
42
+ statement: To group a few items in a horizontal row with even spacing — use HStack instead.
43
+ alternatives:
44
+ - to: h-stack
45
+ - level: should-not
46
+ statement: To create a two-axis grid — use Grid instead.
47
+ alternatives:
48
+ - to: grid
49
+ - level: should-not
50
+ statement: To wrap a single child with spacing or visual styling — use Box instead.
51
+ alternatives:
52
+ - to: box
53
+ - kind: guidelines
54
+ for: all
55
+ framing: how-to-use
56
+ items:
57
+ - refs:
58
+ - to: api-essentials#sizing-is-a-css-string
59
+ rel: same-as
60
+ - id: flex-start-alignment-default
61
+ level: should
62
+ statement: Bias toward start-aligned content over center alignment for most interface elements. By default, children of a Flex container should use start alignment (alignItems='flex-start' or justifyContent='flex-start') unless center alignment is deliberately required by the design.
63
+ example:
64
+ title: How to satisfy this
65
+ description: 'Inspect the rendered layout and confirm that text, icons, and controls are left- or top-aligned by default. Check that center alignment is only applied where the design explicitly calls for it (for example, a dialog button row, a centered hero).'
66
+ checkedBy: manual
67
+ - id: flex-wrap-uses-gap
68
+ level: should
69
+ statement: Pair flexWrap='wrap' with the gap prop, not margin on child elements, to prevent item clipping in variable-count rows.
70
+ example:
71
+ title: How to satisfy this
72
+ description: Inspect the Flex element in the source and confirm it carries a gap prop alongside flexWrap='wrap'. Verify that child elements do not carry margin-top, margin-left, or equivalent shorthand values intended to create inter-item spacing.
73
+ checkedBy: manual
74
+ - refs:
75
+ - to: shared-foundations#layout-primitive-no-text-styles
76
+ rel: same-as
77
+ tags: [content]
78
+ - id: flex-no-inline-styles
79
+ level: must-not
80
+ statement: Flex elements carry no `style` attribute for anything a Flex prop or a dedicated component already provides.
81
+ example:
82
+ title: How to satisfy this
83
+ description: Review the JSX source and confirm the Flex element has no style={…} attribute. Where layout or visual adjustments are needed, use Flex props (gap, alignItems, etc.) or replace Flex with the appropriate component (Box, Card, etc.).
84
+ checks:
85
+ - href: ../evals/cases.yaml
86
+ role: agent-test
87
+ checkedBy: assisted
88
+ $extensions:
89
+ io.jev:
90
+ type: boolean
91
+ - id: flex-reverse-dom-order-matches-visual
92
+ level: must-not
93
+ statement: Don't use row-reverse or column-reverse to change sort order — these only change visual order, not tab order. When a reverse direction is used, the DOM order of child elements must still match the intended reading and tab order.
94
+ example:
95
+ title: How to satisfy this
96
+ description: Tab through the Flex container using only the keyboard and confirm focus moves in the same sequence a sighted user would read the content. Inspect the DOM in browser DevTools and verify the source order of children reflects the correct reading sequence, not the reversed visual sequence.
97
+ checkedBy: manual
98
+ - id: flex-no-onclick
99
+ level: must-not
100
+ statement: 'Flex carries no `onClick` handler; it is a layout element, not an interactive one. Use Button for interactive surfaces.'
101
+ example:
102
+ title: How to satisfy this
103
+ description: Inspect the JSX source and confirm no onClick prop is present on any Flex element. If a clickable surface is needed, wrap the content in a Button component instead.
104
+ checks:
105
+ - href: ../evals/cases.yaml
106
+ role: agent-test
107
+ checkedBy: assisted
108
+ $extensions:
109
+ io.jev:
110
+ type: boolean
111
+ - kind: guidelines
112
+ for: agent
113
+ framing: how-to-use
114
+ items:
115
+ - level: should
116
+ statement: Use VStack or HStack for common vertical/horizontal layouts; reserve Flex for cases needing custom alignment or wrapping.
117
+ - level: must-not
118
+ statement: >-
119
+ Do not use `align` or `justify` as prop names. Use `alignItems` and `justifyContent`. Other names silently do nothing — no error, no effect.
120
+ - level: must-not
121
+ statement: Do not use `direction` or `wrap` as prop names. Use `flexDirection` and `flexWrap`.
122
+ - level: must-not
123
+ statement: 'Applying flex styles via inline styles on Box. Instead: Use the Flex component.'
124
+
125
+ - kind: guidelines
126
+ for: all
127
+ title: Accessibility
128
+ tags: [accessibility]
129
+ items:
130
+ - refs:
131
+ - to: semantics#landmark-requirements
132
+ rel: same-as
133
+ - refs:
134
+ - to: semantics#list-semantics
135
+ rel: same-as
136
+ - refs:
137
+ - to: api-essentials#responsive-array-undefined-slot
138
+ rel: same-as
139
+ - level: should
140
+ statement: Flex provides layout along an axis. It does not add keyboard handling, focus management, or ARIA state. If you render Flex as a semantic element via `as`, you own the behavior that element requires.
141
+ - refs:
142
+ - to: shared-foundations#layout-primitive-as-not-behavioral
143
+ rel: same-as
144
+ - level: must-not
145
+ statement: 'Do not use `flex-direction: row-reverse` or `flex-direction: column-reverse` when children contain content users interact with or read. Do not use CSS `order` on Flex children. Screen readers and keyboard follow DOM order, not visual order (WCAG 1.3.2 A, WCAG 2.4.3 A). If visual reordering cannot be avoided, confirm the DOM order produces a logical reading sequence.'
146
+ - kind: section
147
+ for: agent
148
+ freeform:
149
+ - title: Responsive array breakpoints
150
+ body: |-
151
+ Every Flex prop that accepts `Responsive<T>` takes a breakpoint array. The Responsive pattern (`responsive`) has the breakpoint table and the rules for undefined slots.
152
+
153
+ ```tsx
154
+ // Column on mobile → row at 600px
155
+ <Flex
156
+ flexDirection={['column', undefined, 'row']}
157
+ gap={[2, undefined, 3]}
158
+ alignItems={['flex-start', undefined, 'center']}
159
+ >
160
+ ```
161
+
162
+ alternatives:
163
+ - to: v-stack
164
+ note: Vertical list with an even gap between items
165
+ - to: h-stack
166
+ - to: grid
167
+ note: Two-axis layout for card grids and dashboards
168
+ - to: box
169
+ note: Simpler container for spacing and structure
170
+ refs:
171
+ - to: responsive
172
+ rel: relates-to
173
+ note: Owns the breakpoint table for responsive arrays
174
+ - to: space
175
+ rel: relates-to
176
+ sourceFiles:
177
+ - platform: react
178
+ file: packages/ui/src/components/flex/Flex.tsx
179
+ imports:
180
+ - platform: react
181
+ code: import { Flex } from '@sanity/ui'
182
+ package: '@sanity/ui'
183
+ $extensions:
184
+ com.sanity.ui:
185
+ implementationStatus:
186
+ context: Implementation status. Lets a tool tell a component that is coming from one that does not exist, without parsing the status note.
187
+ implemented: true
188
+ migrationGuide:
189
+ context: 'Migration guide for this component, covering the codemod and the changes it cannot make. Held as an extension because it is temporary: migration tooling and porting agents read it, and it should be dropped when Sanity UI 3 support ends.'
190
+ codemod: |-
191
+ Props are renamed to match CSS: `direction`→`flexDirection`, `align`→`alignItems`, `justify`→`justifyContent`, `wrap`→`flexWrap`, `gapX`/`gapY`→`columnGap`/`rowGap`. The old names are silent no-ops, not TypeScript errors — do not assume they still work.
192
+
193
+ Run the codemod: `pnpx @sanity/ui-codemod latest:flex --paths <paths> --toPackage @sanity/ui`.
194
+ guidance: |-
195
+ Flex in the new system replaces the `@sanity/ui` Flex. Core layout behavior is the same.
196
+
197
+ ### Key differences
198
+
199
+ - v5 components use CSS classes with a static stylesheet instead of `styled-components`.
200
+ - Props are named to match their CSS forms. `direction` → `flexDirection`, `align` → `alignItems`, `justify` → `justifyContent`, `wrap` → `flexWrap`.
201
+ - The new Flex sets `display` to `'flex'` by default.
202
+ - The new API has direct props for width, height, position, border, and similar attributes.
203
+ - `gapX`/`gapY` props renamed to `columnGap` and `rowGap`.
204
+
205
+ ### Detailed list of differences
206
+
207
+ | v3 prop | v5 prop | Notes |
208
+ | :---- | :---- | :---- |
209
+ | `direction="column"` | `flexDirection="column"` | Renamed from `direction` to `flexDirection`. |
210
+ | `align="center"` | `alignItems="center"` | Renamed from `align` to `alignItems`. |
211
+ | `justify="space-between"` | `justifyContent="space-between"` | Renamed from `justify` to `justifyContent`. |
212
+ | `wrap="wrap"` | `flexWrap="wrap"` | Renamed from `wrap` to `flexWrap`. |
213
+ | `flex={1}` | `flexGrow={1}` | v3 used a `flex` shorthand on Box. Split into `flexGrow`, `flexShrink`, `flexBasis`. |
214
+ | — | `rowGap`, `columnGap` | New. Separate row and column gap control. |
215
+ | — | `tone` | New. Sets a semantic background tint. Unset, Flex has no background. Accepts `default`, `neutral`, `positive`, `suggest`, `caution`, and `critical`. |
216
+ | — | `width`, `minWidth`, `maxWidth` | New. Accept any CSS string. |
217
+ | — | `position`, `zIndex` | New. |
218
+ | — | `border`, `radius` | New. |
219
+
220
+ ### Breaking changes
221
+
222
+ - **`direction` renamed to `flexDirection`.** `<Flex direction="column">` does nothing. Use `<Flex flexDirection="column">`.
223
+ - **`align` renamed to `alignItems`.** `<Flex align="center">` does nothing. Use `<Flex alignItems="center">`.
224
+ - **`justify` renamed to `justifyContent`.** `<Flex justify="space-between">` does nothing. Use `<Flex justifyContent="space-between">`.
225
+ - **`wrap` renamed to `flexWrap`.** `<Flex wrap="wrap">` does nothing. Use `<Flex flexWrap="wrap">`. This is the most common source of 320px reflow failures.
226
+ - **`flex` prop removed.** `<Flex flex={1}>` does nothing. Use `flexGrow={1}`, `flexShrink={1}`, `flexBasis="0"` separately.
227
+ - **`styled-components` no longer used.** Custom styled-components extensions like `styled(Flex)` will not work.
228
+
229
+ ### Codemod
230
+
231
+ A codemod is available to make the changes above less painful. Run the following command with the path (or a space-separated list of paths) to the file or directory you want to migrate.
232
+
233
+ ```
234
+ pnpx @sanity/ui-codemod latest:flex --paths <paths> --toPackage @sanity/ui
235
+ ```
236
+
237
+ If an instance cannot be migrated or needs manual review, the codemod inserts a comment prefixed with “UI-POC-CODEMOD TODO”.
@@ -0,0 +1,217 @@
1
+ kind: component
2
+ id: grid
3
+ name: Grid
4
+ description: Renders a CSS grid layout container. Supports named props for all CSS grid properties with responsive arrays.
5
+ metadata:
6
+ tags: [layout, grid, columns, rows, two-axis, responsive, dashboard, card-grid, CSS grid]
7
+ status:
8
+ status: stable
9
+ sections:
10
+ - kind: guidelines
11
+ for: all
12
+ framing: when-to-use
13
+ title: When to use
14
+ items:
15
+ - level: should
16
+ statement: To display non-tabular content in multiple rows and columns.
17
+ - level: should
18
+ statement: To build fixed-column layouts where items should align on a shared grid (dashboards, card grids, settings panels).
19
+ - level: should
20
+ statement: When you need precise control over row and column sizing, spanning, or placement.
21
+ - level: should-not
22
+ statement: When content flows in a single direction. Use Flex, VStack, or HStack instead.
23
+ alternatives:
24
+ - to: flex
25
+ - to: v-stack
26
+ - to: h-stack
27
+ - level: should-not
28
+ statement: When you need wrapping rows of variable-width items. Use Flex with flexWrap='wrap' instead.
29
+ alternatives:
30
+ - to: flex
31
+ - level: should-not
32
+ statement: When you need to constrain and center content at a max width. Use Container instead.
33
+ alternatives:
34
+ - to: container
35
+ - kind: guidelines
36
+ for: all
37
+ framing: how-to-use
38
+ items:
39
+ - refs:
40
+ - to: api-essentials#sizing-is-a-css-string
41
+ rel: same-as
42
+ - id: grid-template-columns-uses-fr-or-minmax
43
+ level: should
44
+ statement: 'Use gridTemplateColumns with repeat() and fr units, minmax(), auto, or responsive arrays to build layouts that adapt gracefully — avoid bare pixel values.'
45
+ example:
46
+ title: How to satisfy this
47
+ description: "Review the JSX source and confirm gridTemplateColumns values use expressions like 'repeat(3, 1fr)', 'minmax(200px, 1fr)', or 'auto 1fr'. Pass an array to gridTemplateColumns for responsive breakpoints (for example, ['1fr', 'repeat(2, 1fr)', 'repeat(3, 1fr)']) and verify the rendered grid adapts at each breakpoint."
48
+ checkedBy: manual
49
+ - id: gap-used-not-child-margin
50
+ level: should
51
+ statement: Use gap, columnGap, or rowGap on the Grid component to control the gap between grid cells, not padding or margin on child elements.
52
+ example:
53
+ title: How to satisfy this
54
+ description: Inspect the JSX source and confirm child elements inside Grid have no margin or padding props intended to create inter-cell spacing. In browser DevTools, inspect the computed styles of grid children and verify there is no margin contributing to the gap between cells.
55
+ checkedBy: manual
56
+ - refs:
57
+ - to: shared-foundations#layout-primitive-no-text-styles
58
+ rel: same-as
59
+ tags: [content]
60
+ - id: no-visual-reorder-via-grid-placement
61
+ level: must-not
62
+ statement: Don't use CSS order, gridColumn, or gridRow to visually reorder items away from their DOM order — screen readers follow DOM order, so the visual order of grid items should match their DOM source order.
63
+ example:
64
+ title: How to satisfy this
65
+ description: Tab through the grid with keyboard-only navigation and confirm focus moves in the same sequence as the visual reading order. Inspect the rendered DOM in browser DevTools and confirm the sequence of child nodes matches the left-to-right, top-to-bottom visual order of the grid. Use a screen reader and verify the announced order of items matches what a sighted user would read.
66
+ checkedBy: manual
67
+ - id: no-hardcoded-px-in-grid-template-columns
68
+ level: must-not
69
+ statement: Don't hardcode pixel values in gridTemplateColumns when a fluid unit like fr, minmax(), or auto would serve the same purpose more resiliently.
70
+ example:
71
+ title: How to satisfy this
72
+ description: "Review the JSX source and confirm gridTemplateColumns does not contain values like '200px 200px' or '33% 33% 33%' where 'repeat(3, 1fr)' or 'repeat(3, minmax(0, 1fr))' would work. If a minimum width is needed, verify it is expressed as the lower bound of minmax() (for example, 'minmax(160px, 1fr)') rather than as a fixed column width."
73
+ checkedBy: manual
74
+ - kind: guidelines
75
+ for: all
76
+ title: Accessibility
77
+ tags: [accessibility]
78
+ items:
79
+ - level: must
80
+ statement: If Grid is used for an interactive widget (calendar, data grid, color picker), you must implement the WAI-ARIA grid pattern yourself. This means `role="grid"` with `role="row"` and `role="gridcell"` children, roving tabindex, and full keyboard navigation. Grid the component provides none of this. See the WAI-ARIA Authoring Practices Guide for the `grid` pattern.
81
+ - refs:
82
+ - to: semantics#landmark-requirements
83
+ rel: same-as
84
+ - refs:
85
+ - to: semantics#list-semantics
86
+ rel: same-as
87
+ - refs:
88
+ - to: api-essentials#responsive-array-undefined-slot
89
+ rel: same-as
90
+ - level: should
91
+ statement: 'CSS grid placement (`gridColumn`, `gridRow`, `gridAutoFlow: "column dense"`) can visually reorder items without touching the DOM. Screen readers and keyboard users follow DOM order, not visual order. Never use grid placement to change the logical reading or focus sequence — keep visual order and DOM order in sync (WCAG 1.3.2 A).'
92
+ - level: should
93
+ statement: '`gridAutoFlow: "row dense"` and `"column dense"` fill holes in the grid by pulling later items forward. This can produce a visual order that diverges from DOM order. Only use dense packing for purely decorative or non-interactive content (for example, image mosaics) where reading order does not matter.'
94
+ - level: should
95
+ statement: Take Grid gap values from the spacing scale. Do not use fixed `px` values for gap where a step exists — a fixed value drifts from the scale when the token values change.
96
+ - refs:
97
+ - to: shared-foundations#layout-primitive-as-not-behavioral
98
+ rel: same-as
99
+ - kind: section
100
+ for: agent
101
+ freeform:
102
+ - title: Responsive array breakpoints
103
+ body: |-
104
+ Every Grid prop that accepts `Responsive<T>` takes a breakpoint array. The Responsive pattern (`responsive`) has the breakpoint table and the rules for undefined slots.
105
+
106
+ ```tsx
107
+ // 1 col → 2 col at 600px → 3 col at 1200px
108
+ <Grid
109
+ gridTemplateColumns={['1fr', '1fr', '1fr 1fr', '1fr 1fr', 'repeat(3, 1fr)']}
110
+ gap={[2, undefined, 3]}
111
+ >
112
+ ```
113
+ - title: gridTemplateColumns templates
114
+ body: |-
115
+ Grid uses CSS string syntax for columns — there is no numeric columns prop.
116
+
117
+ ```tsx
118
+ // 1 column
119
+ <Grid gridTemplateColumns="1fr" gap={3}>
120
+
121
+ // 2 equal columns
122
+ <Grid gridTemplateColumns="1fr 1fr" gap={3}>
123
+
124
+ // 3 equal columns
125
+ <Grid gridTemplateColumns="repeat(3, 1fr)" gap={3}>
126
+
127
+ // 4 equal columns
128
+ <Grid gridTemplateColumns="repeat(4, 1fr)" gap={3}>
129
+
130
+ // Auto-fit: fill row with as many columns as fit at min 240px
131
+ <Grid gridTemplateColumns="repeat(auto-fit, minmax(240px, 1fr))" gap={3}>
132
+
133
+ // Responsive: 1 col mobile → 2 col at 600px → 3 col at 1200px
134
+ <Grid
135
+ gridTemplateColumns={['1fr', '1fr', '1fr 1fr', '1fr 1fr', 'repeat(3, 1fr)']}
136
+ gap={3}
137
+ >
138
+ ```
139
+
140
+ alternatives:
141
+ - to: flex
142
+ note: One-axis layout for rows or columns
143
+ - to: container
144
+ refs:
145
+ - to: responsive
146
+ rel: relates-to
147
+ note: Owns the breakpoint table for responsive arrays
148
+ - to: space
149
+ rel: relates-to
150
+ - to: box
151
+ rel: relates-to
152
+ note: Single container for spacing and structure
153
+ sourceFiles:
154
+ - platform: react
155
+ file: packages/ui/src/components/grid/Grid.tsx
156
+ imports:
157
+ - platform: react
158
+ code: import { Grid } from '@sanity/ui'
159
+ package: '@sanity/ui'
160
+ $extensions:
161
+ com.sanity.ui:
162
+ implementationStatus:
163
+ context: Implementation status. Lets a tool tell a component that is coming from one that does not exist, without parsing the status note.
164
+ implemented: true
165
+ migrationGuide:
166
+ context: 'Migration guide for this component, covering the codemod and the changes it cannot make. Held as an extension because it is temporary: migration tooling and porting agents read it, and it should be dropped when Sanity UI 3 support ends.'
167
+ codemod: |-
168
+ `columns`/`rows` are removed — use `gridTemplateColumns`/`gridTemplateRows` with CSS grid syntax (`columns={3}` → `gridTemplateColumns="repeat(3, 1fr)"`). `autoRows`/`autoCols`/`autoFlow`/`gapX`/`gapY` and child props (`column`, `row`, etc.) all gain a `grid` prefix.
169
+
170
+ Run the codemod: `pnpx @sanity/ui-codemod latest:grid --paths <paths> --toPackage @sanity/ui`.
171
+ guidance: |-
172
+ Grid in the new system replaces the `@sanity/ui` Grid. The core grid layout behavior is the same.
173
+
174
+ ### Key differences
175
+
176
+ - v5 components use CSS classes with a static stylesheet as opposed to `styled-components`.
177
+ - `columns` and `rows` props have been removed. Use `gridTemplateColumns` and `gridTemplateRows` with CSS grid syntax. `columns={3}` becomes `gridTemplateColumns="repeat(3, 1fr)"`.
178
+ - Props are named to match their CSS equivalents. `autoRows` → `gridAutoRows`, `autoCols` → `gridAutoColumns`, `autoFlow` → `gridAutoFlow`, `gapX` → `columnGap`, `gapY` → `rowGap`. On child elements: `column` → `gridColumn`, `row` → `gridRow`, `columnStart` → `gridColumnStart`, etc.
179
+ - Responsive arrays work on grid-related props. Use `gridTemplateColumns={['1fr', '1fr', '1fr 1fr', 'repeat(3, 1fr)']}` for responsive column counts.
180
+
181
+ ### Detailed list of differences
182
+
183
+ | v3 prop | v5 prop | Notes |
184
+ | :---- | :---- | :---- |
185
+ | `columns={3}` | `gridTemplateColumns="repeat(3, 1fr)"` | v3 accepted a number. The new version uses the CSS `grid-template-columns` string. |
186
+ | `rows={2}` | `gridTemplateRows="repeat(2, 1fr)"` | Same change — numeric shorthand replaced by CSS string. |
187
+ | `autoRows="min"` | `gridAutoRows="min-content"` | v3 used shorthand values (`'min'`, `'max'`, `'fr'`). New uses CSS values. |
188
+ | `autoCols="auto"` | `gridAutoColumns="auto"` | Renamed from `autoCols` to `gridAutoColumns`. |
189
+ | `autoFlow="column"` | `gridAutoFlow="column"` | Renamed from `autoFlow` to `gridAutoFlow`. |
190
+ | `gapX={2}` | `columnGap={2}` | Renamed from `gapX` to `columnGap`. |
191
+ | `gapY={4}` | `rowGap={4}` | Renamed from `gapY` to `rowGap`. |
192
+ | — | `tone` | New. Sets a semantic background tint. Unset, Grid has no background. Accepts `default`, `neutral`, `positive`, `suggest`, `caution`, and `critical`. |
193
+ | — | `width`, `minWidth`, `maxWidth` | New. Accept any CSS string. |
194
+ | — | `position`, `zIndex` | New. |
195
+ | — | `border`, `radius` | New. |
196
+
197
+ ### Breaking changes
198
+
199
+ - **`columns` prop removed.** `<Grid columns={3}>` does nothing. Use `<Grid gridTemplateColumns="repeat(3, 1fr)">`.
200
+ - **`rows` prop removed.** `<Grid rows={2}>` does nothing. Use `<Grid gridTemplateRows="repeat(2, 1fr)">`.
201
+ - **`autoRows` renamed to `gridAutoRows`.** The old prop name does nothing.
202
+ - **`autoCols` renamed to `gridAutoColumns`.** The old prop name does nothing.
203
+ - **`autoFlow` renamed to `gridAutoFlow`.** The old prop name does nothing.
204
+ - **`gapX` renamed to `columnGap`.** The old prop name does nothing.
205
+ - **`gapY` renamed to `rowGap`.** The old prop name does nothing.
206
+ - **Grid child props renamed on child elements.** `column` → `gridColumn`, `row` → `gridRow`, `columnStart` → `gridColumnStart`, `columnEnd` → `gridColumnEnd`, `rowStart` → `gridRowStart`, `rowEnd` → `gridRowEnd`. The old names do nothing.
207
+ - **`styled-components` no longer used.** Custom styled-components extensions like `styled(Grid)` will not work.
208
+
209
+ ### Codemod
210
+
211
+ A codemod is ready to make the changes above less painful. To get started, run the following command with the path to the file or directory you want to migrate.
212
+
213
+ ```
214
+ pnpx @sanity/ui-codemod latest:grid --paths <paths> --toPackage @sanity/ui
215
+ ```
216
+
217
+ If a component instance cannot be migrated, includes unclear changes, or needs manual review, the codemod inserts a comment prefixed with “UI-POC-CODEMOD TODO”.
@@ -0,0 +1,127 @@
1
+ kind: component
2
+ id: h-stack
3
+ name: HStack
4
+ description: HStack provides an opinionated horizontal layout with uniform gaps for simple use cases.
5
+ metadata:
6
+ tags: [layout, horizontal, row, stack, gap, icon-label, hstack, inline, toolbar, flex]
7
+ status:
8
+ status: stable
9
+ sections:
10
+ - kind: guidelines
11
+ for: all
12
+ framing: when-to-use
13
+ title: When to use
14
+ items:
15
+ - level: should
16
+ statement: 'To horizontally lay out items for common use cases: icon-label pairs, toolbar groups, badges, and filters.'
17
+ - level: should-not
18
+ statement: For vertical stacking. Use VStack or Flex instead.
19
+ alternatives:
20
+ - to: v-stack
21
+ - to: flex
22
+ - level: should-not
23
+ statement: For full-width rows that stretch across their container. Use Flex instead.
24
+ alternatives:
25
+ - to: flex
26
+ - id: horizontal-layouts-need-custom-alignment
27
+ level: should-not
28
+ statement: For horizontal layouts that need custom alignment, or that must stay on one line. Use Flex instead.
29
+ alternatives:
30
+ - to: flex
31
+ - kind: guidelines
32
+ for: agent
33
+ framing: when-to-use
34
+ title: When to use
35
+ items:
36
+ - level: should-not
37
+ statement: Inline is deprecated — use HStack instead.
38
+ alternatives:
39
+ - to: inline
40
+ - kind: guidelines
41
+ for: all
42
+ framing: how-to-use
43
+ items:
44
+ - id: h-stack-defaults
45
+ level: must
46
+ statement: "Expect HStack's three fixed defaults. It renders an inline flex row (`display: inline-flex`), so it sizes to its content and does not stretch to fill its container. It centers children on the cross axis (`alignItems: center`). It wraps children onto a new line when they run out of room (`flexWrap: wrap`). None of these can be changed through props — use Flex when you need a different value."
47
+ - level: should
48
+ statement: "Size the gap to the content: {space-1} between an icon and its text, {space-2} for a row of buttons or toolbar items, and {space-3} or more between separate groups. The full scale is in the Space scale entry's table (`space`)."
49
+ - level: should
50
+ statement: Use HStack for icon+label pairs, button groups, and compact inline groups.
51
+ - level: must-not
52
+ statement: "Don't use HStack when you need alignItems, justifyContent, flexWrap, or any flex prop — use Flex instead. HStack only accepts `as` and `gap`. Passing any other prop is a TypeScript error."
53
+ alternatives:
54
+ - to: flex
55
+ - level: must-not
56
+ statement: Don't add margin to children for spacing — use gap.
57
+ - kind: guidelines
58
+ for: agent
59
+ framing: how-to-use
60
+ items:
61
+ - level: must-not
62
+ statement: "HStack accepts only as and gap. Don't pass any other prop as a JSX attribute."
63
+ - level: must-not
64
+ statement: 'Do not use HStack for a row that must stay on one line. HStack wraps by default (`flexWrap: wrap`) and has no prop to turn it off. Use Flex, which does not wrap unless you set `flexWrap`.'
65
+
66
+ - kind: guidelines
67
+ for: all
68
+ title: Accessibility
69
+ tags: [accessibility]
70
+ items:
71
+ - id: h-stack-dom-order-not-css-order
72
+ level: must-not
73
+ statement: Don’t use CSS to change the visual order of HStack's children. Children render in DOM order — screen readers do not detect CSS order changes.
74
+ - kind: section
75
+ for: agent
76
+ freeform:
77
+ - title: HStack vs Flex
78
+ body: |-
79
+ HStack only accepts `as` and `gap`. Passing any other prop directly is a TypeScript error.
80
+
81
+ ```tsx
82
+ // correct — gap is the only spacing control
83
+ <HStack gap={3}>
84
+ <Button text="Save" />
85
+ <Button level="tertiary" text="Cancel" />
86
+ </HStack>
87
+
88
+ // wrong — TS2322: alignItems and padding do not exist on HStack
89
+ <HStack gap={3} padding={4}>
90
+ ...
91
+ </HStack>
92
+ ```
93
+
94
+ When you need alignment, distribution, or wrapping, use `Flex`:
95
+
96
+ ```tsx
97
+ <Flex gap={3} alignItems="center" justifyContent="space-between">
98
+ <Text>Label</Text>
99
+ <Button>Action</Button>
100
+ </Flex>
101
+ ```
102
+ alternatives:
103
+ - to: flex
104
+ note: Row or column layout with full flex control
105
+ - to: v-stack
106
+ note: Vertical stack with uniform spacing
107
+ - to: inline
108
+ note: Deprecated. Replaced by HStack.
109
+ refs:
110
+ - href: https://www.figma.com/design/5mhVqXlldJEEB2VWZeKQ4i/Sanity-UI?node-id=32600-2633
111
+ rel: design
112
+ role: Figma component (v5)
113
+ - to: space
114
+ rel: relates-to
115
+ sourceFiles:
116
+ - platform: react
117
+ file: packages/ui/src/components/h-stack/HStack.tsx
118
+ imports:
119
+ - platform: react
120
+ code: import { HStack } from '@sanity/ui'
121
+ package: '@sanity/ui'
122
+
123
+ $extensions:
124
+ com.sanity.ui:
125
+ implementationStatus:
126
+ context: Implementation status. Lets a tool tell a component that is coming from one that does not exist, without parsing the status note.
127
+ implemented: true