@sanity/ui 2.15.7 → 2.15.9

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 (262) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +134 -134
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +134 -134
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +1 -1
  6. package/dist/_visual-editing.d.ts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +77 -80
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +77 -81
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/theme.js +431 -40
  14. package/dist/theme.js.map +1 -1
  15. package/dist/theme.mjs +393 -4
  16. package/dist/theme.mjs.map +1 -1
  17. package/exports/_visual-editing.ts +15 -15
  18. package/package.json +34 -30
  19. package/src/core/_compat.ts +11 -11
  20. package/src/core/components/autocomplete/__mocks__/apiStore.ts +1 -1
  21. package/src/core/components/autocomplete/__workshop__/async.tsx +1 -0
  22. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -1
  23. package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -1
  24. package/src/core/components/autocomplete/__workshop__/example.tsx +2 -1
  25. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -0
  26. package/src/core/components/autocomplete/autocomplete.styles.tsx +2 -1
  27. package/src/core/components/autocomplete/autocomplete.tsx +3 -2
  28. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
  29. package/src/core/components/breadcrumbs/__workshop__/example.tsx +7 -0
  30. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -0
  31. package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
  32. package/src/core/components/dialog/__workshop__/activate.tsx +2 -1
  33. package/src/core/components/dialog/__workshop__/panes.tsx +1 -0
  34. package/src/core/components/dialog/__workshop__/position.tsx +1 -0
  35. package/src/core/components/dialog/__workshop__/props.tsx +1 -0
  36. package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -3
  37. package/src/core/components/dialog/dialog.tsx +3 -0
  38. package/src/core/components/dialog/dialogProvider.tsx +1 -0
  39. package/src/core/components/dialog/styles.ts +1 -0
  40. package/src/core/components/dialog/useDialog.ts +1 -0
  41. package/src/core/components/hotkeys/hotkeys.tsx +1 -0
  42. package/src/core/components/menu/__workshop__/asComponent.tsx +1 -0
  43. package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -0
  44. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -0
  45. package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -0
  46. package/src/core/components/menu/__workshop__/menuButton.tsx +1 -0
  47. package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -0
  48. package/src/core/components/menu/__workshop__/tones.tsx +1 -0
  49. package/src/core/components/menu/menu.test.tsx +1 -0
  50. package/src/core/components/menu/menu.tsx +1 -0
  51. package/src/core/components/menu/menuButton.tsx +4 -3
  52. package/src/core/components/menu/menuGroup.tsx +1 -0
  53. package/src/core/components/menu/menuItem.tsx +1 -1
  54. package/src/core/components/menu/useMenu.ts +1 -0
  55. package/src/core/components/menu/useMenuController.ts +1 -0
  56. package/src/core/components/skeleton/__workshop__/delay.tsx +1 -0
  57. package/src/core/components/skeleton/__workshop__/skeleton.tsx +1 -0
  58. package/src/core/components/skeleton/skeleton.tsx +2 -2
  59. package/src/core/components/skeleton/textSkeleton.tsx +3 -2
  60. package/src/core/components/tab/tab.tsx +1 -0
  61. package/src/core/components/tab/tabList.tsx +2 -1
  62. package/src/core/components/tab/tabPanel.tsx +1 -0
  63. package/src/core/components/toast/__workshop__/toast.tsx +1 -0
  64. package/src/core/components/toast/styles.ts +2 -1
  65. package/src/core/components/toast/toast.tsx +4 -4
  66. package/src/core/components/toast/toastLayer.tsx +1 -0
  67. package/src/core/components/toast/toastProvider.tsx +1 -0
  68. package/src/core/components/toast/useToast.ts +1 -0
  69. package/src/core/components/tree/__workshop__/basic.tsx +1 -0
  70. package/src/core/components/tree/__workshop__/tabFromElement.tsx +2 -1
  71. package/src/core/components/tree/style.ts +1 -0
  72. package/src/core/components/tree/tree.tsx +1 -0
  73. package/src/core/components/tree/treeGroup.tsx +1 -0
  74. package/src/core/components/tree/treeItem.tsx +3 -2
  75. package/src/core/components/tree/useTree.ts +1 -0
  76. package/src/core/helpers/focus.ts +2 -2
  77. package/src/core/hooks/useArrayProp.ts +1 -0
  78. package/src/core/hooks/useClickOutside.test.tsx +0 -1
  79. package/src/core/hooks/useClickOutside.ts +1 -0
  80. package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -1
  81. package/src/core/hooks/useClickOutsideEvent.ts +1 -0
  82. package/src/core/hooks/useDelayed.test.ts +2 -1
  83. package/src/core/hooks/useDelayedState.ts +1 -2
  84. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -0
  85. package/src/core/hooks/useElementSize.ts +2 -1
  86. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
  87. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +1 -0
  88. package/src/core/hooks/usePrefersDark.test.tsx +2 -1
  89. package/src/core/hooks/usePrefersReducedMotion.test.tsx +2 -1
  90. package/src/core/index.ts +1 -2
  91. package/src/core/lib/createGlobalScopedContext.ts +2 -1
  92. package/src/core/primitives/_selectable/selectable.tsx +1 -0
  93. package/src/core/primitives/_selectable/style.ts +1 -0
  94. package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -0
  95. package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -0
  96. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -0
  97. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -0
  98. package/src/core/primitives/avatar/avatar.tsx +2 -7
  99. package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
  100. package/src/core/primitives/avatar/avatarStack.tsx +3 -2
  101. package/src/core/primitives/avatar/styles.ts +2 -1
  102. package/src/core/primitives/avatar/types.ts +1 -0
  103. package/src/core/primitives/badge/__workshop__/props.tsx +1 -0
  104. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -0
  105. package/src/core/primitives/badge/badge.test.tsx +1 -0
  106. package/src/core/primitives/badge/badge.tsx +1 -0
  107. package/src/core/primitives/badge/styles.ts +1 -0
  108. package/src/core/primitives/box/__workshop__/props.tsx +1 -0
  109. package/src/core/primitives/box/box.tsx +3 -2
  110. package/src/core/primitives/button/__workshop__/custom.tsx +3 -0
  111. package/src/core/primitives/button/__workshop__/disabled.tsx +1 -0
  112. package/src/core/primitives/button/__workshop__/props.tsx +2 -1
  113. package/src/core/primitives/button/__workshop__/stacked.tsx +1 -0
  114. package/src/core/primitives/button/button.test.tsx +1 -0
  115. package/src/core/primitives/button/button.tsx +1 -0
  116. package/src/core/primitives/button/styles.ts +1 -0
  117. package/src/core/primitives/card/__workshop__/asButton.tsx +1 -0
  118. package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -0
  119. package/src/core/primitives/card/__workshop__/props.tsx +3 -1
  120. package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
  121. package/src/core/primitives/card/card.tsx +1 -0
  122. package/src/core/primitives/card/styles.ts +1 -0
  123. package/src/core/primitives/checkbox/checkbox.tsx +1 -0
  124. package/src/core/primitives/checkbox/styles.ts +1 -0
  125. package/src/core/primitives/code/__workshop__/props.tsx +1 -0
  126. package/src/core/primitives/code/code.tsx +2 -1
  127. package/src/core/primitives/container/__workshop__/example.tsx +1 -0
  128. package/src/core/primitives/container/container.tsx +1 -0
  129. package/src/core/primitives/container/styles.ts +2 -1
  130. package/src/core/primitives/flex/__workshop__/example.tsx +1 -0
  131. package/src/core/primitives/flex/flex.tsx +2 -1
  132. package/src/core/primitives/grid/grid.tsx +1 -0
  133. package/src/core/primitives/heading/__workshop__/plain.tsx +2 -1
  134. package/src/core/primitives/heading/heading.tsx +1 -0
  135. package/src/core/primitives/heading/styles.ts +1 -0
  136. package/src/core/primitives/inline/__workshop__/plain.tsx +1 -0
  137. package/src/core/primitives/inline/inline.tsx +2 -1
  138. package/src/core/primitives/inline/styles.ts +2 -1
  139. package/src/core/primitives/kbd/kbd.tsx +2 -1
  140. package/src/core/primitives/label/__workshop__/plain.tsx +2 -1
  141. package/src/core/primitives/label/label.tsx +1 -0
  142. package/src/core/primitives/label/styles.ts +1 -0
  143. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
  144. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -0
  145. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -0
  146. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -1
  147. package/src/core/primitives/popover/__workshop__/TestStory.tsx +1 -0
  148. package/src/core/primitives/popover/floating-ui/size.ts +2 -1
  149. package/src/core/primitives/popover/popover.tsx +6 -7
  150. package/src/core/primitives/popover/popoverCard.tsx +2 -1
  151. package/src/core/primitives/radio/radio.tsx +2 -1
  152. package/src/core/primitives/radio/styles.ts +1 -0
  153. package/src/core/primitives/select/select.tsx +2 -1
  154. package/src/core/primitives/select/styles.ts +3 -3
  155. package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -0
  156. package/src/core/primitives/spinner/spinner.tsx +2 -1
  157. package/src/core/primitives/stack/__workshop__/plain.tsx +1 -0
  158. package/src/core/primitives/stack/stack.tsx +2 -1
  159. package/src/core/primitives/stack/styles.ts +2 -1
  160. package/src/core/primitives/switch/styles.ts +1 -0
  161. package/src/core/primitives/switch/switch.tsx +2 -1
  162. package/src/core/primitives/text/__workshop__/colored.tsx +3 -2
  163. package/src/core/primitives/text/__workshop__/example.tsx +1 -0
  164. package/src/core/primitives/text/styles.ts +1 -0
  165. package/src/core/primitives/text/text.tsx +1 -0
  166. package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -0
  167. package/src/core/primitives/textArea/textArea.tsx +6 -5
  168. package/src/core/primitives/textInput/__workshop__/plain.tsx +2 -1
  169. package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -0
  170. package/src/core/primitives/textInput/textInput.tsx +1 -0
  171. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -0
  172. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -0
  173. package/src/core/primitives/tooltip/__workshop__/props.tsx +3 -2
  174. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -0
  175. package/src/core/primitives/tooltip/tooltip.test.tsx +4 -2
  176. package/src/core/primitives/tooltip/tooltip.tsx +6 -5
  177. package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
  178. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +1 -1
  179. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -0
  180. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -0
  181. package/src/core/styles/border/borderStyle.ts +1 -0
  182. package/src/core/styles/box/boxStyle.ts +1 -0
  183. package/src/core/styles/card/_cardColorStyle.ts +1 -2
  184. package/src/core/styles/flex/flexItemStyle.ts +1 -0
  185. package/src/core/styles/flex/flexStyle.ts +2 -1
  186. package/src/core/styles/flex/index.ts +1 -1
  187. package/src/core/styles/flex/types.ts +1 -0
  188. package/src/core/styles/font/codeFontStyle.ts +1 -0
  189. package/src/core/styles/font/headingFontStyle.ts +1 -0
  190. package/src/core/styles/font/labelFontStyle.ts +1 -0
  191. package/src/core/styles/font/responsiveFont.ts +3 -3
  192. package/src/core/styles/font/textAlignStyle.ts +1 -0
  193. package/src/core/styles/font/textFontStyle.ts +1 -0
  194. package/src/core/styles/font/types.ts +1 -0
  195. package/src/core/styles/grid/gridItemStyle.ts +1 -0
  196. package/src/core/styles/grid/gridStyle.ts +2 -1
  197. package/src/core/styles/grid/index.ts +1 -1
  198. package/src/core/styles/helpers.ts +2 -2
  199. package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -1
  200. package/src/core/styles/input/textInputStyle.ts +3 -3
  201. package/src/core/styles/margin/marginStyle.ts +1 -0
  202. package/src/core/styles/margin/marginsStyle.test.ts +1 -0
  203. package/src/core/styles/padding/paddingStyle.test.ts +1 -0
  204. package/src/core/styles/padding/paddingStyle.ts +1 -0
  205. package/src/core/styles/radius/radiusStyle.ts +1 -0
  206. package/src/core/styles/shadow/shadowStyle.ts +3 -3
  207. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  208. package/src/core/theme/__workshop__/build/story.tsx +18 -9
  209. package/src/core/theme/__workshop__/canvas.tsx +7 -6
  210. package/src/core/theme/__workshop__/debug/story.tsx +5 -3
  211. package/src/core/theme/index.ts +1 -1
  212. package/src/core/theme/theme.test.tsx +1 -0
  213. package/src/core/theme/themeColorProvider.tsx +1 -0
  214. package/src/core/theme/themeProvider.tsx +3 -2
  215. package/src/core/theme/useRootTheme.ts +1 -0
  216. package/src/core/theme/useTheme.ts +1 -1
  217. package/src/core/utils/arrow/arrow.tsx +4 -3
  218. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -0
  219. package/src/core/utils/boundaryElement/index.ts +1 -1
  220. package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -0
  221. package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
  222. package/src/core/utils/errorBoundary.tsx +1 -0
  223. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +1 -0
  224. package/src/core/utils/layer/__workshop__/nested.tsx +1 -0
  225. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +1 -0
  226. package/src/core/utils/layer/index.ts +1 -1
  227. package/src/core/utils/layer/layer.tsx +1 -0
  228. package/src/core/utils/layer/layerProvider.tsx +2 -1
  229. package/src/core/utils/layer/useLayer.ts +1 -0
  230. package/src/core/utils/portal/portal.ts +1 -0
  231. package/src/core/utils/portal/portalProvider.tsx +1 -0
  232. package/src/core/utils/portal/usePortal.ts +1 -0
  233. package/src/core/utils/virtualList/virtualList.tsx +1 -0
  234. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +1 -1
  235. package/src/theme/build/_deprecated/color/card/createCardStates.ts +1 -1
  236. package/src/theme/build/_deprecated/color/factory.ts +6 -6
  237. package/src/theme/build/buildColorTheme.ts +15 -15
  238. package/src/theme/build/colorToken/colorToken.ts +1 -1
  239. package/src/theme/build/mixThemeColor.ts +1 -1
  240. package/src/theme/build/renderColorTheme.ts +7 -6
  241. package/src/theme/build/renderColorValue.ts +3 -2
  242. package/src/theme/build/resolveColorTokens.ts +5 -4
  243. package/src/theme/config/helpers.ts +2 -2
  244. package/src/theme/config/system.ts +2 -1
  245. package/src/theme/config/tokens/color/types.ts +2 -1
  246. package/src/theme/config/tokens/types.ts +2 -1
  247. package/src/theme/config/types.ts +2 -1
  248. package/src/theme/system/color/_helpers.ts +1 -0
  249. package/src/theme/system/color/_system.ts +1 -1
  250. package/src/theme/system/color/color.ts +1 -1
  251. package/src/theme/system/index.ts +1 -2
  252. package/src/theme/system/theme.ts +2 -2
  253. package/src/theme/system/v0/color/index.ts +1 -1
  254. package/src/theme/system/v0/index.ts +1 -1
  255. package/src/theme/versioning/themeColor_v0_v2.ts +5 -5
  256. package/dist/_chunks-cjs/getTheme_v2.js +0 -397
  257. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  258. package/dist/_chunks-es/getTheme_v2.mjs +0 -398
  259. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  260. package/src/core/__workshop__/fontsPlugin.tsx +0 -76
  261. /package/src/core/components/autocomplete/{__fixtures__ → __mocks__}/countries.ts +0 -0
  262. /package/src/core/primitives/kbd/{index.tsx → index.ts} +0 -0
@@ -2,30 +2,30 @@
2
2
  * These are internal exports for usage in `@sanity/visual-editing` and `@sanity/insert-menu`,
3
3
  * which are used in environments where the regular `@sanity/ui` export is far too heavy due to imports from refractor and more.
4
4
  */
5
- export {Box} from '../src/core/primitives/box/box'
6
- export {Button} from '../src/core/primitives/button/button'
7
- export {Card} from '../src/core/primitives/card/card'
8
- export {Flex} from '../src/core/primitives/flex/flex'
9
- export {Grid} from '../src/core/primitives/grid/grid'
5
+ export {studioTheme} from '../src/core/_compat'
10
6
  export {Hotkeys} from '../src/core/components/hotkeys/hotkeys'
11
- export {isHTMLAnchorElement, isHTMLElement} from '../src/core/helpers/element'
12
- export {LayerProvider} from '../src/core/utils/layer/layerProvider'
13
7
  export {Menu} from '../src/core/components/menu/menu'
14
8
  export {MenuDivider} from '../src/core/components/menu/menuDivider'
15
9
  export {MenuGroup} from '../src/core/components/menu/menuGroup'
16
10
  export {MenuItem, type MenuItemProps} from '../src/core/components/menu/menuItem'
11
+ export {Tab} from '../src/core/components/tab/tab'
12
+ export {TabList} from '../src/core/components/tab/tabList'
13
+ export {isHTMLAnchorElement, isHTMLElement} from '../src/core/helpers/element'
14
+ export {usePrefersDark} from '../src/core/hooks/usePrefersDark'
15
+ export {Box} from '../src/core/primitives/box/box'
16
+ export {Button} from '../src/core/primitives/button/button'
17
+ export {Card} from '../src/core/primitives/card/card'
18
+ export {Flex} from '../src/core/primitives/flex/flex'
19
+ export {Grid} from '../src/core/primitives/grid/grid'
17
20
  export {Popover} from '../src/core/primitives/popover/popover'
18
- export {Portal} from '../src/core/utils/portal/portal'
19
- export {PortalProvider} from '../src/core/utils/portal/portalProvider'
20
21
  export {Spinner} from '../src/core/primitives/spinner/spinner'
21
22
  export {Stack} from '../src/core/primitives/stack/stack'
22
- export {studioTheme} from '../src/core/_compat'
23
- export {Tab} from '../src/core/components/tab/tab'
24
- export {TabList} from '../src/core/components/tab/tabList'
25
23
  export {Text} from '../src/core/primitives/text/text'
26
24
  export {TextInput} from '../src/core/primitives/textInput/textInput'
27
- export {ThemeProvider} from '../src/core/theme/themeProvider'
28
25
  export {Tooltip} from '../src/core/primitives/tooltip/tooltip'
29
- export type {PopoverMargins} from '../src/core/types/popover'
30
- export {usePrefersDark} from '../src/core/hooks/usePrefersDark'
26
+ export {ThemeProvider} from '../src/core/theme/themeProvider'
31
27
  export {useTheme_v2} from '../src/core/theme/useTheme'
28
+ export type {PopoverMargins} from '../src/core/types/popover'
29
+ export {LayerProvider} from '../src/core/utils/layer/layerProvider'
30
+ export {Portal} from '../src/core/utils/portal/portal'
31
+ export {PortalProvider} from '../src/core/utils/portal/portalProvider'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.15.7",
3
+ "version": "2.15.9",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -70,7 +70,7 @@
70
70
  "dev": "run-p storybook:dev workshop:dev",
71
71
  "figma:pkg:build": "cd figma && pnpm build",
72
72
  "format": "prettier --write --cache --ignore-unknown .",
73
- "lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx",
73
+ "lint": "eslint .",
74
74
  "pkg:build": "pkg build --strict",
75
75
  "pkg:check": "pkg --strict",
76
76
  "prepare": "husky install",
@@ -120,7 +120,7 @@
120
120
  "@sanity/icons": "^3.7.0",
121
121
  "csstype": "^3.1.3",
122
122
  "framer-motion": "^12.5.0",
123
- "react-compiler-runtime": "19.0.0-beta-3229e95-20250315",
123
+ "react-compiler-runtime": "19.0.0-beta-e993439-20250328",
124
124
  "react-refractor": "^2.2.0",
125
125
  "use-effect-event": "^1.0.2"
126
126
  },
@@ -131,24 +131,25 @@
131
131
  "@babel/preset-typescript": "^7.26.0",
132
132
  "@commitlint/cli": "^19.8.0",
133
133
  "@commitlint/config-conventional": "^19.8.0",
134
- "@sanity/pkg-utils": "^7.1.0",
134
+ "@eslint/js": "^9.23.0",
135
+ "@sanity/pkg-utils": "^7.1.1",
135
136
  "@sanity/prettier-config": "^1.0.3",
136
137
  "@sanity/semantic-release-preset": "^5.0.0",
137
- "@sanity/ui-workshop": "^2.0.31",
138
- "@storybook/addon-a11y": "^8.6.4",
139
- "@storybook/addon-docs": "^8.6.4",
140
- "@storybook/addon-essentials": "^8.6.4",
141
- "@storybook/addon-interactions": "^8.6.4",
142
- "@storybook/addon-links": "^8.6.4",
143
- "@storybook/addon-mdx-gfm": "^8.6.4",
144
- "@storybook/addon-storysource": "^8.6.4",
145
- "@storybook/addon-themes": "^8.6.4",
146
- "@storybook/blocks": "^8.6.4",
147
- "@storybook/manager-api": "^8.6.4",
148
- "@storybook/react": "^8.6.4",
149
- "@storybook/react-vite": "^8.6.4",
150
- "@storybook/test": "^8.6.4",
151
- "@storybook/theming": "^8.6.4",
138
+ "@sanity/ui-workshop": "^2.0.33",
139
+ "@storybook/addon-a11y": "^8.6.8",
140
+ "@storybook/addon-docs": "^8.6.8",
141
+ "@storybook/addon-essentials": "^8.6.8",
142
+ "@storybook/addon-interactions": "^8.6.8",
143
+ "@storybook/addon-links": "^8.6.8",
144
+ "@storybook/addon-mdx-gfm": "^8.6.8",
145
+ "@storybook/addon-storysource": "^8.6.8",
146
+ "@storybook/addon-themes": "^8.6.8",
147
+ "@storybook/blocks": "^8.6.8",
148
+ "@storybook/manager-api": "^8.6.8",
149
+ "@storybook/react": "^8.6.8",
150
+ "@storybook/react-vite": "^8.6.8",
151
+ "@storybook/test": "^8.6.8",
152
+ "@storybook/theming": "^8.6.8",
152
153
  "@testing-library/dom": "^10.4.0",
153
154
  "@testing-library/jest-dom": "^6.6.3",
154
155
  "@testing-library/react": "^16.2.0",
@@ -156,28 +157,30 @@
156
157
  "@types/jest": "^29.5.14",
157
158
  "@types/jest-axe": "^3.5.9",
158
159
  "@types/node": "^20.12.7",
159
- "@types/react": "^19.0.10",
160
+ "@types/react": "^19.0.12",
160
161
  "@types/react-dom": "^19.0.4",
161
162
  "@types/react-is": "^19.0.0",
162
163
  "@types/refractor": "^3.4.1",
163
- "@typescript-eslint/eslint-plugin": "^8.26.1",
164
- "@typescript-eslint/parser": "^8.26.1",
165
164
  "@vitejs/plugin-react": "^4.3.4",
166
- "babel-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
165
+ "babel-plugin-react-compiler": "19.0.0-beta-e993439-20250328",
167
166
  "babel-plugin-styled-components": "^2.1.4",
168
167
  "commitizen": "^4.3.1",
169
168
  "cypress": "^13.17.0",
170
169
  "cypress-real-events": "^1.14.0",
171
170
  "cz-conventional-changelog": "^3.3.0",
172
- "eslint": "^8.57.1",
171
+ "eslint": "^9.23.0",
173
172
  "eslint-config-prettier": "^10.1.1",
173
+ "eslint-formatter-compact": "^8.40.0",
174
174
  "eslint-plugin-boundaries": "^5.0.1",
175
175
  "eslint-plugin-import": "^2.31.0",
176
176
  "eslint-plugin-jsx-a11y": "^6.10.2",
177
177
  "eslint-plugin-react": "^7.37.4",
178
- "eslint-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
178
+ "eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250328",
179
179
  "eslint-plugin-react-hooks": "experimental",
180
- "eslint-plugin-storybook": "^0.11.4",
180
+ "eslint-plugin-react-refresh": "^0.4.19",
181
+ "eslint-plugin-simple-import-sort": "^12.1.1",
182
+ "eslint-plugin-storybook": "^0.12.0",
183
+ "globals": "^16.0.0",
181
184
  "http-server": "^14.1.1",
182
185
  "husky": "^8.0.3",
183
186
  "jest": "^29.7.0",
@@ -193,12 +196,13 @@
193
196
  "refractor": "^4.9.0",
194
197
  "rimraf": "^5.0.5",
195
198
  "semantic-release": "^24.2.3",
196
- "start-server-and-test": "^2.0.10",
197
- "storybook": "^8.6.4",
198
- "styled-components": "^6.1.15",
199
+ "start-server-and-test": "^2.0.11",
200
+ "storybook": "^8.6.8",
201
+ "styled-components": "^6.1.16",
199
202
  "tsconfig-paths": "^4.2.0",
200
203
  "typescript": "5.8.2",
201
- "vite": "^5.4.14",
204
+ "typescript-eslint": "^8.28.0",
205
+ "vite": "^5.4.15",
202
206
  "vite-tsconfig-paths": "^5.1.4"
203
207
  },
204
208
  "peerDependencies": {
@@ -2,22 +2,24 @@
2
2
 
3
3
  import {
4
4
  type BaseTheme as _BaseTheme,
5
- type ThemeBoxShadow,
5
+ buildTheme,
6
6
  type HSL as _HSL,
7
7
  type PartialThemeColorBuilderOpts,
8
8
  type RGB as _RGB,
9
9
  type RootTheme as _RootTheme,
10
- type ThemeStyles,
11
10
  type Theme as _Theme,
12
11
  type ThemeAvatar,
12
+ type ThemeBoxShadow,
13
13
  type ThemeColor,
14
14
  type ThemeColorBase,
15
15
  type ThemeColorBuilderOpts,
16
16
  type ThemeColorButton,
17
17
  type ThemeColorButtonModeKey as _ThemeColorButtonModeKey,
18
+ type ThemeColorButtonState,
18
19
  type ThemeColorButtonStates,
19
20
  type ThemeColorButtonTones,
20
21
  type ThemeColorCard,
22
+ type ThemeColorCardState,
21
23
  type ThemeColorGenericState,
22
24
  type ThemeColorInput,
23
25
  type ThemeColorInputState,
@@ -29,6 +31,7 @@ import {
29
31
  type ThemeColorSchemeKey as _ThemeColorSchemeKey,
30
32
  type ThemeColorSchemes,
31
33
  type ThemeColorSelectable,
34
+ type ThemeColorSelectableState,
32
35
  type ThemeColorSelectableStates,
33
36
  type ThemeColorSolid,
34
37
  type ThemeColorSolidTone,
@@ -38,17 +41,14 @@ import {
38
41
  type ThemeColorToneKey,
39
42
  type ThemeFont as _ThemeFont,
40
43
  type ThemeFontKey as _ThemeFontKey,
44
+ type ThemeFonts as _ThemeFonts,
41
45
  type ThemeFontSize as _ThemeFontSize,
42
46
  type ThemeFontWeight as _ThemeFontWeight,
43
47
  type ThemeFontWeightKey as _ThemeFontWeightKey,
44
- type ThemeFonts as _ThemeFonts,
45
48
  type ThemeInput,
46
49
  type ThemeLayer as _ThemeLayer,
47
50
  type ThemeShadow as _ThemeShadow,
48
- type ThemeColorButtonState,
49
- type ThemeColorCardState,
50
- type ThemeColorSelectableState,
51
- buildTheme,
51
+ type ThemeStyles,
52
52
  } from '@sanity/ui/theme'
53
53
 
54
54
  /**
@@ -166,9 +166,11 @@ export {
166
166
  type ThemeColorBase,
167
167
  type ThemeColorBuilderOpts,
168
168
  type ThemeColorButton,
169
+ type ThemeColorButtonState,
169
170
  type ThemeColorButtonStates,
170
171
  type ThemeColorButtonTones,
171
172
  type ThemeColorCard,
173
+ type ThemeColorCardState,
172
174
  type ThemeColorGenericState,
173
175
  type ThemeColorInput,
174
176
  type ThemeColorInputState,
@@ -179,6 +181,7 @@ export {
179
181
  type ThemeColorScheme,
180
182
  type ThemeColorSchemes,
181
183
  type ThemeColorSelectable,
184
+ type ThemeColorSelectableState,
182
185
  type ThemeColorSelectableStates,
183
186
  type ThemeColorSolid,
184
187
  type ThemeColorSolidTone,
@@ -186,9 +189,6 @@ export {
186
189
  type ThemeColorSpotKey,
187
190
  type ThemeColorToneKey,
188
191
  type ThemeInput,
189
- type ThemeColorButtonState,
190
- type ThemeColorCardState,
191
- type ThemeColorSelectableState,
192
192
  }
193
193
 
194
194
  import {
@@ -197,9 +197,9 @@ import {
197
197
  hslToRgb as _hslToRgb,
198
198
  multiply as _multiply,
199
199
  parseColor as _parseColor,
200
+ rgba as _rgba,
200
201
  rgbToHex as _rgbToHex,
201
202
  rgbToHsl as _rgbToHsl,
202
- rgba as _rgba,
203
203
  screen as _screen,
204
204
  } from '@sanity/ui/theme'
205
205
 
@@ -1,4 +1,4 @@
1
- import countries from '../__fixtures__/countries'
1
+ import countries from './countries'
2
2
 
3
3
  export const countriesStore = {
4
4
  search(
@@ -11,6 +11,7 @@ import {
11
11
  Text,
12
12
  } from '@sanity/ui'
13
13
  import {useCallback, useEffect, useRef, useState} from 'react'
14
+
14
15
  import {countriesStore} from '../__mocks__/apiStore'
15
16
 
16
17
  export default function AsyncStory() {
@@ -9,8 +9,9 @@ import {
9
9
  Text,
10
10
  } from '@sanity/ui'
11
11
  import {useCallback, useState} from 'react'
12
+
12
13
  import {Popover} from '../../../primitives'
13
- import countries from '../__fixtures__/countries'
14
+ import countries from '../__mocks__/countries'
14
15
  import {AutocompleteProps} from '../autocomplete'
15
16
  import {ExampleOption} from './types'
16
17
 
@@ -1,12 +1,13 @@
1
1
  import {Autocomplete, Box, Button, Card, Code, Container, Stack, Text} from '@sanity/ui'
2
2
  import {useBoolean, useSelect} from '@sanity/ui-workshop'
3
3
  import {useCallback, useState} from 'react'
4
+
4
5
  import {
5
6
  WORKSHOP_RADIUS_OPTIONS,
6
7
  WORKSHOP_SPACE_OPTIONS,
7
8
  WORKSHOP_TEXT_SIZE_OPTIONS,
8
9
  } from '../../../__workshop__/constants'
9
- import countries from '../__fixtures__/countries'
10
+ import countries from '../__mocks__/countries'
10
11
  import {ExampleOption} from './types'
11
12
 
12
13
  export default function CustomStory() {
@@ -3,13 +3,14 @@ import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
3
3
  import {PerfTestProps, usePerfTest} from '@sanity/ui-workshop/plugin-perf'
4
4
  import {fireEvent} from '@testing-library/dom'
5
5
  import {useCallback, useMemo, useState} from 'react'
6
+
6
7
  import {
7
8
  WORKSHOP_CARD_TONE_OPTIONS,
8
9
  WORKSHOP_RADIUS_OPTIONS,
9
10
  WORKSHOP_SPACE_OPTIONS,
10
11
  WORKSHOP_TEXT_SIZE_OPTIONS,
11
12
  } from '../../../__workshop__/constants'
12
- import countries from '../__fixtures__/countries'
13
+ import countries from '../__mocks__/countries'
13
14
 
14
15
  const typingPerfTest: PerfTestProps<HTMLInputElement> = {
15
16
  name: 'typing',
@@ -19,6 +19,7 @@ import {
19
19
  } from '@sanity/ui'
20
20
  import {useBoolean} from '@sanity/ui-workshop'
21
21
  import {useCallback, useEffect, useMemo, useRef, useState} from 'react'
22
+
22
23
  import {countriesStore} from '../__mocks__/apiStore'
23
24
 
24
25
  export default function Fullscreen() {
@@ -1,5 +1,6 @@
1
1
  import {SpinnerIcon} from '@sanity/icons'
2
- import {styled, keyframes} from 'styled-components'
2
+ import {keyframes, styled} from 'styled-components'
3
+
3
4
  import {Box} from '../../primitives'
4
5
 
5
6
  /**
@@ -1,15 +1,15 @@
1
1
  import {ChevronDownIcon} from '@sanity/icons'
2
2
  import {
3
3
  ChangeEvent,
4
+ cloneElement,
4
5
  ElementType,
5
6
  FocusEvent,
7
+ forwardRef,
6
8
  HTMLProps,
7
9
  KeyboardEvent,
8
10
  MouseEvent,
9
11
  ReactNode,
10
12
  Ref,
11
- cloneElement,
12
- forwardRef,
13
13
  useCallback,
14
14
  useEffect,
15
15
  useImperativeHandle,
@@ -17,6 +17,7 @@ import {
17
17
  useReducer,
18
18
  useRef,
19
19
  } from 'react'
20
+
20
21
  import {EMPTY_ARRAY, EMPTY_RECORD} from '../../constants'
21
22
  import {_hasFocus, _raf, focusFirstDescendant} from '../../helpers'
22
23
  import {useArrayProp} from '../../hooks'
@@ -1,4 +1,5 @@
1
1
  import {useCallback} from 'react'
2
+
2
3
  import {_isEnterToClickElement} from '../../helpers'
3
4
 
4
5
  export interface AutocompleteOptionProps {
@@ -28,24 +28,31 @@ export default function Example() {
28
28
  space={2}
29
29
  >
30
30
  <Text size={1}>
31
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
31
32
  <a href="#">Root</a>
32
33
  </Text>
33
34
  <Text size={1}>
35
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
34
36
  <a href="#">Category A</a>
35
37
  </Text>
36
38
  <Text size={1}>
39
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
37
40
  <a href="#">Category B</a>
38
41
  </Text>
39
42
  <Text size={1}>
43
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
40
44
  <a href="#">Category C</a>
41
45
  </Text>
42
46
  <Text size={1}>
47
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
43
48
  <a href="#">Category D</a>
44
49
  </Text>
45
50
  <Text size={1}>
51
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
46
52
  <a href="#">Category E</a>
47
53
  </Text>
48
54
  <Text size={1}>
55
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
49
56
  <a href="#">Category F</a>
50
57
  </Text>
51
58
  <Text size={1}>Item</Text>
@@ -1,4 +1,5 @@
1
1
  import {styled} from 'styled-components'
2
+
2
3
  import {Button} from '../../primitives'
3
4
 
4
5
  export const StyledBreadcrumbs = styled.ol`
@@ -8,6 +8,7 @@ import {
8
8
  useRef,
9
9
  useState,
10
10
  } from 'react'
11
+
11
12
  import {useArrayProp, useClickOutsideEvent} from '../../hooks'
12
13
  import {Box, Popover, Stack, Text} from '../../primitives'
13
14
  import {ExpandButton, StyledBreadcrumbs} from './breadcrumbs.styles'
@@ -1,5 +1,6 @@
1
1
  import {useState} from 'react'
2
- import {Stack, Flex, Button, Text} from '../../../primitives'
2
+
3
+ import {Button, Flex, Stack, Text} from '../../../primitives'
3
4
  import {Layer, LayerProvider} from '../../../utils'
4
5
  import {Menu, MenuButton, MenuItem} from '../../menu'
5
6
  import {Dialog} from '../dialog'
@@ -1,5 +1,6 @@
1
1
  import {useCallback, useState} from 'react'
2
2
  import {styled} from 'styled-components'
3
+
3
4
  import {Box, Button, Card, Flex} from '../../../primitives'
4
5
  import {BoundaryElementProvider, PortalProvider} from '../../../utils'
5
6
  import {Menu, MenuButton, MenuItem} from '../../menu'
@@ -1,6 +1,7 @@
1
1
  import {ArrowDownIcon, ArrowUpIcon} from '@sanity/icons'
2
2
  import {Box, Dialog, LayerProvider, Stack, Text} from '@sanity/ui'
3
3
  import {useBoolean, useSelect} from '@sanity/ui-workshop'
4
+
4
5
  import {WORKSHOP_DIALOG_POSITION_OPTIONS} from '../../../__workshop__/constants'
5
6
 
6
7
  export default function PositionStory() {
@@ -1,6 +1,7 @@
1
1
  import {Box, Button, Dialog, LayerProvider, Stack, Text} from '@sanity/ui'
2
2
  import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
3
3
  import {useCallback, useRef, useState} from 'react'
4
+
4
5
  import {WORKSHOP_WIDTH_OPTIONS} from '../../../__workshop__/constants'
5
6
 
6
7
  export default function PropsStory() {
@@ -1,7 +1,5 @@
1
+ import {Box, Button, Dialog, DialogProps, LayerProvider, useLayer} from '@sanity/ui'
1
2
  import {ReactNode, useCallback, useEffect, useRef, useState} from 'react'
2
- import {Box, Button} from '../../../primitives'
3
- import {LayerProvider, useLayer} from '../../../utils'
4
- import {Dialog, DialogProps} from '../dialog'
5
3
 
6
4
  export default function WrappedStory() {
7
5
  return (
@@ -2,6 +2,7 @@ import {CloseIcon} from '@sanity/icons'
2
2
  import {ThemeColorSchemeKey} from '@sanity/ui/theme'
3
3
  import {forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from 'react'
4
4
  import {styled} from 'styled-components'
5
+
5
6
  import {
6
7
  containsOrEqualsElement,
7
8
  focusFirstDescendant,
@@ -404,6 +405,7 @@ export const Dialog = forwardRef(function Dialog(
404
405
  role="dialog"
405
406
  zOffset={zOffset}
406
407
  >
408
+ {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
407
409
  <div ref={preDivRef} tabIndex={0} />
408
410
  <DialogCard
409
411
  __unstable_autoFocus={autoFocus}
@@ -423,6 +425,7 @@ export const Dialog = forwardRef(function Dialog(
423
425
  >
424
426
  {children}
425
427
  </DialogCard>
428
+ {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
426
429
  <div ref={postDivRef} tabIndex={0} />
427
430
  </StyledDialog>
428
431
  </Portal>
@@ -1,4 +1,5 @@
1
1
  import {useMemo} from 'react'
2
+
2
3
  import {DialogPosition} from '../../types'
3
4
  import {DialogContext, DialogContextValue} from './dialogContext'
4
5
 
@@ -1,5 +1,6 @@
1
1
  import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
2
2
  import {css} from 'styled-components'
3
+
3
4
  import {_responsive, ThemeProps} from '../../styles'
4
5
  import {DialogPosition} from '../../types'
5
6
 
@@ -1,4 +1,5 @@
1
1
  import {useContext} from 'react'
2
+
2
3
  import {DialogContext, DialogContextValue} from './dialogContext'
3
4
 
4
5
  /**
@@ -1,5 +1,6 @@
1
1
  import {forwardRef} from 'react'
2
2
  import {styled} from 'styled-components'
3
+
3
4
  import {useArrayProp} from '../../hooks'
4
5
  import {Inline, KBD} from '../../primitives'
5
6
  import {Radius} from '../../types'
@@ -8,6 +8,7 @@ const CustomLink = forwardRef(function CustomLink(
8
8
  const {children, req, ...restProps} = props
9
9
 
10
10
  return (
11
+ // eslint-disable-next-line jsx-a11y/anchor-is-valid
11
12
  <a data-required={req} {...restProps} href="#" ref={ref}>
12
13
  {children}
13
14
  </a>
@@ -1,4 +1,5 @@
1
1
  import {UsersIcon} from '@sanity/icons'
2
+
2
3
  import {Avatar, Badge, Box, Button, Flex, Text} from '../../../primitives'
3
4
  import {Hotkeys} from '../../hotkeys'
4
5
  import {Menu} from '../menu'
@@ -12,6 +12,7 @@ import {
12
12
  Text,
13
13
  } from '@sanity/ui'
14
14
  import {useState} from 'react'
15
+
15
16
  import {MenuButtonProps} from '../menuButton'
16
17
 
17
18
  const POPOVER_PROPS: MenuButtonProps['popover'] = {
@@ -1,5 +1,6 @@
1
1
  import {ChevronDownIcon} from '@sanity/icons'
2
2
  import {useSelect} from '@sanity/ui-workshop'
3
+
3
4
  import {Box, Button} from '../../../primitives'
4
5
  import {Menu} from '../menu'
5
6
  import {MenuButton} from '../menuButton'
@@ -13,6 +13,7 @@ import {
13
13
  } from '@sanity/ui'
14
14
  import {useAction, useBoolean, useSelect} from '@sanity/ui-workshop'
15
15
  import {useMemo} from 'react'
16
+
16
17
  import {WORKSHOP_CARD_TONE_OPTIONS} from '../../../__workshop__/constants'
17
18
 
18
19
  export default function MenuButtonStory() {
@@ -1,5 +1,6 @@
1
1
  import {useSelect} from '@sanity/ui-workshop'
2
2
  import {Fragment, useCallback, useState} from 'react'
3
+
3
4
  import {Button, Flex, Popover} from '../../../primitives'
4
5
  import {LayerProvider} from '../../../utils'
5
6
  import {Menu} from '../menu'
@@ -2,6 +2,7 @@ import {CubeIcon} from '@sanity/icons'
2
2
  import {Box, Card, LayerProvider, Menu, MenuItem} from '@sanity/ui'
3
3
  import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
4
4
  import {useBoolean, useSelect} from '@sanity/ui-workshop'
5
+
5
6
  import {WORKSHOP_CARD_TONE_OPTIONS} from '../../../__workshop__/constants'
6
7
 
7
8
  export default function TonesStory() {
@@ -3,6 +3,7 @@
3
3
  /* eslint-disable no-console */
4
4
 
5
5
  import React, {useCallback, useMemo} from 'react'
6
+
6
7
  import {render} from '../../../../test'
7
8
  import {MenuContext, MenuContextValue} from './menuContext'
8
9
  import {useMenu} from './useMenu'
@@ -1,5 +1,6 @@
1
1
  import {forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef} from 'react'
2
2
  import {styled} from 'styled-components'
3
+
3
4
  import {useClickOutsideEvent, useGlobalKeyDown} from '../../hooks'
4
5
  import {Box, Stack} from '../../primitives'
5
6
  import {ResponsivePaddingProps} from '../../primitives/types'
@@ -3,12 +3,13 @@ import {
3
3
  cloneElement,
4
4
  forwardRef,
5
5
  useCallback,
6
- useMemo,
7
- useState,
8
6
  useEffect,
9
- useRef,
10
7
  useImperativeHandle,
8
+ useMemo,
9
+ useRef,
10
+ useState,
11
11
  } from 'react'
12
+
12
13
  import {Popover, PopoverProps} from '../../primitives'
13
14
  import {Placement, Radius} from '../../types'
14
15
  import {MenuProps} from './menu'
@@ -1,6 +1,7 @@
1
1
  import {ChevronRightIcon} from '@sanity/icons'
2
2
  import {isValidElement, useCallback, useEffect, useState} from 'react'
3
3
  import {isValidElementType} from 'react-is'
4
+
4
5
  import {useArrayProp} from '../../hooks'
5
6
  import {Box, Flex, Popover, PopoverProps, Text} from '../../primitives'
6
7
  import {Selectable} from '../../primitives/_selectable'