@sanity/ui 2.10.0-corel.0 → 3.0.0-static.0

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 (322) hide show
  1. package/bin/ui.js +6 -0
  2. package/dist/_chunks-cjs/buildCommand.js +2836 -0
  3. package/dist/_chunks-cjs/buildCommand.js.map +1 -0
  4. package/dist/_chunks-cjs/getTheme_v2.js +1 -27
  5. package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
  6. package/dist/_chunks-es/getTheme_v2.mjs +1 -27
  7. package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
  8. package/dist/_legacy/getTheme_v2.esm.js +1 -27
  9. package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
  10. package/dist/cli.d.ts +1 -0
  11. package/dist/cli.js +23 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/css.d.mts +943 -0
  14. package/dist/css.d.ts +943 -0
  15. package/dist/css.esm.js +3135 -0
  16. package/dist/css.esm.js.map +1 -0
  17. package/dist/css.js +3135 -0
  18. package/dist/css.js.map +1 -0
  19. package/dist/css.mjs +3135 -0
  20. package/dist/css.mjs.map +1 -0
  21. package/dist/index.d.mts +175 -164
  22. package/dist/index.d.ts +175 -164
  23. package/dist/index.esm.js +864 -1955
  24. package/dist/index.esm.js.map +1 -1
  25. package/dist/index.js +870 -1962
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +864 -1955
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/sanity-theme.css +25 -0
  30. package/dist/system.css +2953 -0
  31. package/dist/theme.d.mts +84 -22
  32. package/dist/theme.d.ts +84 -22
  33. package/dist/theme.esm.js +232 -283
  34. package/dist/theme.esm.js.map +1 -1
  35. package/dist/theme.js +232 -283
  36. package/dist/theme.js.map +1 -1
  37. package/dist/theme.mjs +232 -283
  38. package/dist/theme.mjs.map +1 -1
  39. package/exports/css.ts +1 -0
  40. package/package.json +25 -4
  41. package/src/core/__workshop__/constants.ts +15 -15
  42. package/src/core/__workshop__/fontsPlugin.tsx +1 -1
  43. package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
  44. package/src/core/components/autocomplete/autocomplete.tsx +12 -4
  45. package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
  46. package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
  47. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +14 -2
  48. package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
  49. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  50. package/src/core/components/dialog/dialog.tsx +77 -92
  51. package/src/core/components/hotkeys/hotkeys.tsx +18 -29
  52. package/src/core/components/menu/menu.tsx +8 -5
  53. package/src/core/components/menu/menuDivider.ts +2 -1
  54. package/src/core/components/menu/menuGroup.tsx +16 -8
  55. package/src/core/components/menu/menuItem.tsx +23 -14
  56. package/src/core/components/skeleton/skeleton.tsx +1 -1
  57. package/src/core/components/skeleton/styles.ts +1 -1
  58. package/src/core/components/skeleton/textSkeleton.tsx +1 -1
  59. package/src/core/components/tab/tab.tsx +6 -7
  60. package/src/core/components/tab/tabList.tsx +3 -2
  61. package/src/core/components/toast/styles.ts +1 -1
  62. package/src/core/components/toast/toast.tsx +6 -4
  63. package/src/core/components/toast/toastProvider.tsx +31 -22
  64. package/src/core/components/tree/style.ts +1 -1
  65. package/src/core/components/tree/tree.tsx +8 -2
  66. package/src/core/components/tree/treeGroup.tsx +1 -1
  67. package/src/core/components/tree/treeItem.tsx +38 -25
  68. package/src/core/components/tree/types.ts +5 -1
  69. package/src/core/lib/styled/elements.ts +135 -0
  70. package/src/core/lib/styled/index.ts +2 -0
  71. package/src/core/lib/styled/members.ts +15 -0
  72. package/src/core/lib/styled/styled.ts +79 -0
  73. package/src/core/primitives/_selectable/selectable.tsx +27 -14
  74. package/src/core/primitives/avatar/avatar.tsx +52 -32
  75. package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
  76. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  77. package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
  78. package/src/core/primitives/badge/badge.tsx +18 -20
  79. package/src/core/primitives/box/box.tsx +62 -74
  80. package/src/core/primitives/button/__workshop__/props.tsx +3 -1
  81. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  82. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  83. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  84. package/src/core/primitives/button/button.tsx +38 -45
  85. package/src/core/primitives/button/styles.ts +2 -2
  86. package/src/core/primitives/card/RootCardContext.ts +3 -0
  87. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  88. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  89. package/src/core/primitives/card/card.tsx +44 -46
  90. package/src/core/primitives/card/styles.ts +1 -1
  91. package/src/core/primitives/checkbox/checkbox.tsx +6 -8
  92. package/src/core/primitives/code/code.tsx +23 -12
  93. package/src/core/primitives/code/styles.ts +1 -1
  94. package/src/core/primitives/container/container.tsx +7 -15
  95. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  96. package/src/core/primitives/flex/flex.tsx +6 -19
  97. package/src/core/primitives/grid/grid.tsx +2 -1
  98. package/src/core/primitives/heading/heading.tsx +32 -19
  99. package/src/core/primitives/heading/styles.ts +1 -1
  100. package/src/core/primitives/inline/inline.tsx +22 -13
  101. package/src/core/primitives/kbd/kbd.tsx +30 -37
  102. package/src/core/primitives/label/label.tsx +15 -4
  103. package/src/core/primitives/label/styles.ts +1 -1
  104. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
  105. package/src/core/primitives/popover/popover.tsx +21 -15
  106. package/src/core/primitives/popover/popoverCard.tsx +36 -38
  107. package/src/core/primitives/radio/radio.tsx +1 -1
  108. package/src/core/primitives/radio/styles.ts +1 -1
  109. package/src/core/primitives/select/select.tsx +1 -1
  110. package/src/core/primitives/select/styles.ts +1 -1
  111. package/src/core/primitives/spinner/spinner.tsx +6 -20
  112. package/src/core/primitives/stack/stack.tsx +12 -10
  113. package/src/core/primitives/switch/styles.ts +9 -9
  114. package/src/core/primitives/switch/switch.tsx +20 -21
  115. package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
  116. package/src/core/primitives/text/styles.ts +1 -2
  117. package/src/core/primitives/text/text.tsx +17 -21
  118. package/src/core/primitives/textArea/textArea.tsx +1 -1
  119. package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
  120. package/src/core/primitives/textInput/textInput.tsx +176 -123
  121. package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
  122. package/src/core/primitives/tooltip/tooltip.tsx +13 -13
  123. package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
  124. package/src/core/primitives/types.ts +35 -16
  125. package/src/core/styles/border/borderStyle.ts +6 -0
  126. package/src/core/styles/border/types.ts +1 -0
  127. package/src/core/styles/box/boxStyle.ts +6 -0
  128. package/src/core/styles/card/_cardColorStyle.ts +0 -8
  129. package/src/core/styles/flex/flexStyle.ts +0 -18
  130. package/src/core/styles/flex/types.ts +1 -3
  131. package/src/core/styles/grid/gridStyle.ts +0 -10
  132. package/src/core/styles/helpers.ts +9 -0
  133. package/src/core/styles/input/textInputStyle.ts +1 -1
  134. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  135. package/src/core/theme/themeProvider.tsx +1 -1
  136. package/src/core/theme/useTheme.ts +1 -1
  137. package/src/core/types/avatar.ts +6 -1
  138. package/src/core/types/button.ts +1 -0
  139. package/src/core/types/flex.ts +27 -26
  140. package/src/core/types/gridItem.ts +32 -24
  141. package/src/core/types/radius.ts +7 -4
  142. package/src/core/utils/arrow/arrow.tsx +1 -1
  143. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  144. package/src/core/utils/layer/layer.tsx +28 -11
  145. package/src/core/utils/srOnly/srOnly.tsx +1 -1
  146. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  147. package/src/css/_resp.ts +28 -0
  148. package/src/css/cli/buildCommand.ts +36 -0
  149. package/src/css/cli/index.ts +38 -0
  150. package/src/css/compile/comileRules.ts +59 -0
  151. package/src/css/compile/compileRule.ts +58 -0
  152. package/src/css/compile/compileSystem.ts +7 -0
  153. package/src/css/compile/compileTheme.ts +509 -0
  154. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
  155. package/src/css/components/breadcrumbs/index.ts +1 -0
  156. package/src/css/components/breadcrumbs/rules.ts +7 -0
  157. package/src/css/components/dialog/classes.ts +29 -0
  158. package/src/css/components/dialog/index.ts +1 -0
  159. package/src/css/components/dialog/rules.ts +75 -0
  160. package/src/css/components/tree/index.ts +1 -0
  161. package/src/css/components/tree/rules.ts +52 -0
  162. package/src/css/components/tree/tree.ts +5 -0
  163. package/src/css/composeClassNames.ts +3 -0
  164. package/src/css/index.ts +47 -0
  165. package/src/css/primitives/avatar/avatar.ts +32 -0
  166. package/src/css/primitives/avatar/index.ts +2 -0
  167. package/src/css/primitives/avatar/rules.ts +190 -0
  168. package/src/css/primitives/avatar/types.ts +9 -0
  169. package/src/css/primitives/badge/badge.ts +8 -0
  170. package/src/css/primitives/badge/index.ts +2 -0
  171. package/src/css/primitives/badge/rules.ts +25 -0
  172. package/src/css/primitives/badge/types.ts +8 -0
  173. package/src/css/primitives/box/box.ts +34 -0
  174. package/src/css/primitives/box/index.ts +2 -0
  175. package/src/css/primitives/box/rules.ts +25 -0
  176. package/src/css/primitives/box/types.ts +49 -0
  177. package/src/css/primitives/button/button.ts +26 -0
  178. package/src/css/primitives/button/index.ts +1 -0
  179. package/src/css/primitives/button/rules.ts +58 -0
  180. package/src/css/primitives/card/card.ts +21 -0
  181. package/src/css/primitives/card/index.ts +1 -0
  182. package/src/css/primitives/card/rules.ts +93 -0
  183. package/src/{core/primitives/checkbox/styles.ts → css/primitives/checkbox/__styles.ts} +3 -3
  184. package/src/css/primitives/checkbox/checkbox.ts +9 -0
  185. package/src/css/primitives/checkbox/index.ts +1 -0
  186. package/src/css/primitives/checkbox/rules.ts +136 -0
  187. package/src/css/primitives/code/code.ts +9 -0
  188. package/src/css/primitives/code/index.ts +2 -0
  189. package/src/css/primitives/code/rules.ts +71 -0
  190. package/src/css/primitives/code/types.ts +10 -0
  191. package/src/css/primitives/container/container.ts +7 -0
  192. package/src/css/primitives/container/index.ts +2 -0
  193. package/src/css/primitives/container/rules.ts +8 -0
  194. package/src/css/primitives/container/types.ts +6 -0
  195. package/src/css/primitives/heading/heading.ts +16 -0
  196. package/src/css/primitives/heading/index.ts +2 -0
  197. package/src/css/primitives/heading/rules.ts +84 -0
  198. package/src/css/primitives/heading/types.ts +12 -0
  199. package/src/css/primitives/kbd/index.ts +2 -0
  200. package/src/css/primitives/kbd/kbd.ts +7 -0
  201. package/src/css/primitives/kbd/rules.ts +20 -0
  202. package/src/css/primitives/kbd/types.ts +5 -0
  203. package/src/css/primitives/label/index.ts +2 -0
  204. package/src/css/primitives/label/label.ts +16 -0
  205. package/src/css/primitives/label/rules.ts +85 -0
  206. package/src/css/primitives/label/types.ts +12 -0
  207. package/src/css/primitives/popover/index.ts +1 -0
  208. package/src/css/primitives/popover/popover.ts +5 -0
  209. package/src/css/primitives/popover/rules.ts +5 -0
  210. package/src/css/primitives/radio/index.ts +1 -0
  211. package/src/css/primitives/radio/radio.ts +5 -0
  212. package/src/css/primitives/radio/rules.ts +5 -0
  213. package/src/css/primitives/select/index.ts +1 -0
  214. package/src/css/primitives/select/rules.ts +5 -0
  215. package/src/css/primitives/select/select.ts +5 -0
  216. package/src/{core/primitives/_selectable/style.ts → css/primitives/selectable/__style.ts} +5 -4
  217. package/src/css/primitives/selectable/index.ts +2 -0
  218. package/src/css/primitives/selectable/rules.ts +27 -0
  219. package/src/css/primitives/selectable/selectable.ts +9 -0
  220. package/src/css/primitives/selectable/types.ts +6 -0
  221. package/src/css/primitives/spinner/index.ts +1 -0
  222. package/src/css/primitives/spinner/rules.ts +22 -0
  223. package/src/css/primitives/spinner/spinner.ts +5 -0
  224. package/src/css/primitives/switch/index.ts +1 -0
  225. package/src/css/primitives/switch/rules.ts +132 -0
  226. package/src/css/primitives/switch/switch.ts +5 -0
  227. package/src/css/primitives/text/index.ts +2 -0
  228. package/src/css/primitives/text/rules.ts +75 -0
  229. package/src/css/primitives/text/text.ts +16 -0
  230. package/src/css/primitives/text/types.ts +11 -0
  231. package/src/css/primitives/textArea/index.ts +1 -0
  232. package/src/css/primitives/textArea/rules.ts +5 -0
  233. package/src/css/primitives/textArea/textArea.ts +5 -0
  234. package/src/css/primitives/textInput/index.ts +1 -0
  235. package/src/css/primitives/textInput/rules.ts +226 -0
  236. package/src/css/primitives/textInput/textInput.ts +7 -0
  237. package/src/css/primitives/token/rules.ts +45 -0
  238. package/src/css/primitives/tooltip/index.ts +1 -0
  239. package/src/css/primitives/tooltip/rules.ts +17 -0
  240. package/src/css/primitives/tooltip/tooltip.ts +9 -0
  241. package/src/css/responsiveRules.ts +25 -0
  242. package/src/css/rules.ts +121 -0
  243. package/src/css/styles/border/border.ts +22 -0
  244. package/src/css/styles/border/index.ts +2 -0
  245. package/src/css/styles/border/rules.ts +24 -0
  246. package/src/css/styles/border/types.ts +10 -0
  247. package/src/css/styles/display/rules.ts +62 -0
  248. package/src/css/styles/flex/flex.ts +20 -0
  249. package/src/css/styles/flex/index.ts +2 -0
  250. package/src/css/styles/flex/rules.ts +28 -0
  251. package/src/css/styles/flex/types.ts +35 -0
  252. package/src/css/styles/flexItem/flexItem.ts +8 -0
  253. package/src/css/styles/flexItem/index.ts +2 -0
  254. package/src/css/styles/flexItem/rules.ts +11 -0
  255. package/src/css/styles/flexItem/types.ts +11 -0
  256. package/src/css/styles/font/font.ts +12 -0
  257. package/src/css/styles/font/index.ts +2 -0
  258. package/src/css/styles/font/rules.ts +125 -0
  259. package/src/css/styles/font/types.ts +6 -0
  260. package/src/css/styles/gap/gap.ts +8 -0
  261. package/src/css/styles/gap/index.ts +2 -0
  262. package/src/css/styles/gap/rules.ts +33 -0
  263. package/src/css/styles/gap/types.ts +9 -0
  264. package/src/css/styles/grid/rules.ts +35 -0
  265. package/src/css/styles/gridItem/gridItem.ts +15 -0
  266. package/src/css/styles/gridItem/index.ts +2 -0
  267. package/src/css/styles/gridItem/rules.ts +96 -0
  268. package/src/css/styles/gridItem/types.ts +41 -0
  269. package/src/css/styles/height/rules.ts +7 -0
  270. package/src/css/styles/margin/index.ts +2 -0
  271. package/src/css/styles/margin/margin.ts +15 -0
  272. package/src/css/styles/margin/rules.ts +59 -0
  273. package/src/css/styles/margin/types.ts +11 -0
  274. package/src/css/styles/maxWidth/index.ts +2 -0
  275. package/src/css/styles/maxWidth/maxWidth.ts +6 -0
  276. package/src/css/styles/maxWidth/rules.ts +36 -0
  277. package/src/css/styles/maxWidth/types.ts +6 -0
  278. package/src/css/styles/overflow/rules.ts +9 -0
  279. package/src/css/styles/padding/index.ts +2 -0
  280. package/src/css/styles/padding/padding.ts +15 -0
  281. package/src/css/styles/padding/rules.ts +59 -0
  282. package/src/css/styles/padding/types.ts +12 -0
  283. package/src/css/styles/pointerEvents/index.ts +2 -0
  284. package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
  285. package/src/css/styles/pointerEvents/rules.ts +11 -0
  286. package/src/css/styles/pointerEvents/types.ts +7 -0
  287. package/src/css/styles/position/index.ts +2 -0
  288. package/src/css/styles/position/position.ts +7 -0
  289. package/src/css/styles/position/rules.ts +31 -0
  290. package/src/css/styles/position/types.ts +13 -0
  291. package/src/css/styles/radius/index.ts +2 -0
  292. package/src/css/styles/radius/radius.ts +8 -0
  293. package/src/css/styles/radius/rules.ts +13 -0
  294. package/src/css/styles/radius/types.ts +7 -0
  295. package/src/css/styles/shadow/rules.ts +53 -0
  296. package/src/css/styles/width/index.ts +2 -0
  297. package/src/css/styles/width/rules.ts +7 -0
  298. package/src/css/styles/width/types.ts +8 -0
  299. package/src/css/styles/width/width.ts +6 -0
  300. package/src/css/types.ts +591 -0
  301. package/src/css/varNames.ts +381 -0
  302. package/src/css/vars.ts +313 -0
  303. package/src/theme/build/_deprecated/color/factory.ts +1 -1
  304. package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
  305. package/src/theme/build/buildColorTheme.ts +39 -45
  306. package/src/theme/build/renderColorTheme.ts +65 -239
  307. package/src/theme/build/resolveColorTokens.ts +115 -51
  308. package/src/theme/config/tokens/color/types.ts +18 -4
  309. package/src/theme/defaults/colorTokens.ts +10 -17
  310. package/src/theme/defaults/config.ts +1 -1
  311. package/src/theme/getScopedTheme.ts +2 -9
  312. package/src/theme/system/_constants.ts +25 -0
  313. package/src/theme/system/_types.ts +41 -0
  314. package/src/theme/system/color/_constants.ts +0 -8
  315. package/src/theme/system/color/badge.ts +7 -3
  316. package/src/theme/system/index.ts +2 -0
  317. package/src/theme/system/v0/color/_system.ts +4 -8
  318. package/src/theme/system/v0/color/color.ts +2 -3
  319. package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
  320. package/src/theme/versioning/v0_v2.ts +0 -4
  321. package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
  322. package/src/core/components/dialog/styles.ts +0 -76
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), ReactIs = require("react-is"), styledComponents = require("styled-components"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event"), getTheme_v2 = require("./_chunks-cjs/getTheme_v2.js");
3
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), css$1 = require("@sanity/ui/css"), react = require("react"), ReactIs = require("react-is"), styledComponents = require("styled-components"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), useEffectEvent = require("use-effect-event"), reactDom = require("react-dom"), getTheme_v2 = require("./_chunks-cjs/getTheme_v2.js");
4
4
  function _interopDefaultCompat(e) {
5
5
  return e && typeof e == "object" && "default" in e ? e : { default: e };
6
6
  }
@@ -28,6 +28,9 @@ const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslT
28
28
  function _fillCSSObject(keys, value) {
29
29
  return keys.reduce((style, key2) => (style[key2] = value, style), {});
30
30
  }
31
+ function px(pixelValue) {
32
+ return pixelValue === 0 ? 0 : `${pixelValue}px`;
33
+ }
31
34
  function rem(pixelValue) {
32
35
  return pixelValue === 0 ? 0 : `${pixelValue / 16}rem`;
33
36
  }
@@ -133,7 +136,7 @@ function _getElements(element, elementsArg) {
133
136
  return ret.filter(Boolean);
134
137
  }
135
138
  function useClickOutside(listener, elementsArg = EMPTY_ARRAY, boundaryElement) {
136
- const [element, setElement] = react.useState(null), [elements, setElements] = react.useState(() => _getElements(element, elementsArg)), elementsRef = react.useRef(elements);
139
+ const [element, setElement] = react.useState(null), [elements2, setElements] = react.useState(() => _getElements(element, elementsArg)), elementsRef = react.useRef(elements2);
137
140
  return react.useEffect(() => {
138
141
  const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
139
142
  if (prevElements.length !== nextElements.length) {
@@ -155,7 +158,7 @@ function useClickOutside(listener, elementsArg = EMPTY_ARRAY, boundaryElement) {
155
158
  const handleWindowMouseDown = (evt) => {
156
159
  const target = evt.target;
157
160
  if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
158
- for (const el of elements)
161
+ for (const el of elements2)
159
162
  if (target === el || el.contains(target))
160
163
  return;
161
164
  listener(evt);
@@ -164,7 +167,7 @@ function useClickOutside(listener, elementsArg = EMPTY_ARRAY, boundaryElement) {
164
167
  return window.addEventListener("mousedown", handleWindowMouseDown), () => {
165
168
  window.removeEventListener("mousedown", handleWindowMouseDown);
166
169
  };
167
- }, [boundaryElement, listener, elements]), setElement;
170
+ }, [boundaryElement, listener, elements2]), setElement;
168
171
  }
169
172
  function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundaryElement) {
170
173
  const onEvent = useEffectEvent.useEffectEvent((evt) => {
@@ -176,8 +179,8 @@ function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundar
176
179
  const resolvedBoundaryElement = boundaryElement?.();
177
180
  if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
178
181
  return;
179
- const elements = elementsArg().flat();
180
- for (const el of elements)
182
+ const elements2 = elementsArg().flat();
183
+ for (const el of elements2)
181
184
  if (el && (target === el || el.contains(target)))
182
185
  return;
183
186
  listener(evt);
@@ -273,7 +276,7 @@ var freeze = function(obj) {
273
276
  return cache.get(target);
274
277
  if (isHidden(target))
275
278
  return cache.set(target, zeroBoxes), zeroBoxes;
276
- var cs = getComputedStyle(target), svg = isSVG(target) && target.ownerSVGElement && target.getBBox(), removePadding = !IE && cs.boxSizing === "border-box", switchSizes = verticalRegexp.test(cs.writingMode || ""), canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""), canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""), paddingTop = svg ? 0 : parseDimension(cs.paddingTop), paddingRight = svg ? 0 : parseDimension(cs.paddingRight), paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom), paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft), borderTop2 = svg ? 0 : parseDimension(cs.borderTopWidth), borderRight2 = svg ? 0 : parseDimension(cs.borderRightWidth), borderBottom2 = svg ? 0 : parseDimension(cs.borderBottomWidth), borderLeft2 = svg ? 0 : parseDimension(cs.borderLeftWidth), horizontalPadding = paddingLeft + paddingRight, verticalPadding = paddingTop + paddingBottom, horizontalBorderArea = borderLeft2 + borderRight2, verticalBorderArea = borderTop2 + borderBottom2, horizontalScrollbarThickness = canScrollHorizontally ? target.offsetHeight - verticalBorderArea - target.clientHeight : 0, verticalScrollbarThickness = canScrollVertically ? target.offsetWidth - horizontalBorderArea - target.clientWidth : 0, widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0, heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0, contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness, contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness, borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea, borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea, boxes = freeze({
279
+ var cs = getComputedStyle(target), svg = isSVG(target) && target.ownerSVGElement && target.getBBox(), removePadding = !IE && cs.boxSizing === "border-box", switchSizes = verticalRegexp.test(cs.writingMode || ""), canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""), canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""), paddingTop = svg ? 0 : parseDimension(cs.paddingTop), paddingRight = svg ? 0 : parseDimension(cs.paddingRight), paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom), paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft), borderTop = svg ? 0 : parseDimension(cs.borderTopWidth), borderRight = svg ? 0 : parseDimension(cs.borderRightWidth), borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth), borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth), horizontalPadding = paddingLeft + paddingRight, verticalPadding = paddingTop + paddingBottom, horizontalBorderArea = borderLeft + borderRight, verticalBorderArea = borderTop + borderBottom, horizontalScrollbarThickness = canScrollHorizontally ? target.offsetHeight - verticalBorderArea - target.clientHeight : 0, verticalScrollbarThickness = canScrollVertically ? target.offsetWidth - horizontalBorderArea - target.clientWidth : 0, widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0, heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0, contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness, contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness, borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea, borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea, boxes = freeze({
277
280
  devicePixelContentBoxSize: size$1(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
278
281
  borderBoxSize: size$1(borderBoxWidth, borderBoxHeight, switchSizes),
279
282
  contentBoxSize: size$1(contentWidth, contentHeight, switchSizes),
@@ -548,6 +551,169 @@ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
548
551
  }, [mediaQueryString]);
549
552
  return react.useDebugValue(mediaQueryString), react.useSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
550
553
  }
554
+ const css = styledComponents.css, keyframes = styledComponents.keyframes, ThemeProvider$1 = styledComponents.ThemeProvider, useTheme$1 = styledComponents.useTheme, elements = [
555
+ "a",
556
+ "abbr",
557
+ "address",
558
+ "area",
559
+ "article",
560
+ "aside",
561
+ "audio",
562
+ "b",
563
+ "base",
564
+ "bdi",
565
+ "bdo",
566
+ "big",
567
+ "blockquote",
568
+ "body",
569
+ "br",
570
+ "button",
571
+ "canvas",
572
+ "caption",
573
+ "cite",
574
+ "code",
575
+ "col",
576
+ "colgroup",
577
+ "data",
578
+ "datalist",
579
+ "dd",
580
+ "del",
581
+ "details",
582
+ "dfn",
583
+ "dialog",
584
+ "div",
585
+ "dl",
586
+ "dt",
587
+ "em",
588
+ "embed",
589
+ "fieldset",
590
+ "figcaption",
591
+ "figure",
592
+ "footer",
593
+ "form",
594
+ "h1",
595
+ "h2",
596
+ "h3",
597
+ "h4",
598
+ "h5",
599
+ "h6",
600
+ "header",
601
+ "hgroup",
602
+ "hr",
603
+ "html",
604
+ "i",
605
+ "iframe",
606
+ "img",
607
+ "input",
608
+ "ins",
609
+ "kbd",
610
+ "keygen",
611
+ "label",
612
+ "legend",
613
+ "li",
614
+ "link",
615
+ "main",
616
+ "map",
617
+ "mark",
618
+ "menu",
619
+ "menuitem",
620
+ "meta",
621
+ "meter",
622
+ "nav",
623
+ "noscript",
624
+ "object",
625
+ "ol",
626
+ "optgroup",
627
+ "option",
628
+ "output",
629
+ "p",
630
+ "param",
631
+ "picture",
632
+ "pre",
633
+ "progress",
634
+ "q",
635
+ "rp",
636
+ "rt",
637
+ "ruby",
638
+ "s",
639
+ "samp",
640
+ "script",
641
+ "section",
642
+ "select",
643
+ "small",
644
+ "source",
645
+ "span",
646
+ "strong",
647
+ "style",
648
+ "sub",
649
+ "summary",
650
+ "sup",
651
+ "table",
652
+ "tbody",
653
+ "td",
654
+ "textarea",
655
+ "tfoot",
656
+ "th",
657
+ "thead",
658
+ "time",
659
+ "tr",
660
+ "track",
661
+ "u",
662
+ "ul",
663
+ "use",
664
+ "var",
665
+ "video",
666
+ "wbr",
667
+ // SVG
668
+ "circle",
669
+ "clipPath",
670
+ "defs",
671
+ "ellipse",
672
+ "foreignObject",
673
+ "g",
674
+ "image",
675
+ "line",
676
+ "linearGradient",
677
+ "marker",
678
+ "mask",
679
+ "path",
680
+ "pattern",
681
+ "polygon",
682
+ "polyline",
683
+ "radialGradient",
684
+ "rect",
685
+ "stop",
686
+ "svg",
687
+ "text",
688
+ "tspan"
689
+ ], baseStyled = (tagName) => {
690
+ const m = (_strings, ..._interpolations) => {
691
+ const Styled = react.forwardRef(function(props, ref) {
692
+ const { as, forwardedAs, ...rest } = props, sanitizedProps = Object.fromEntries(
693
+ Object.entries(rest).filter(([, val]) => !!val && (!isArray(val) || val.length > 0)).map(([key2, val]) => key2.startsWith("$") ? [`data-${toSnakeCase(key2.slice(1))}`, val] : [key2, val])
694
+ );
695
+ return react.createElement(as ?? tagName, { ...sanitizedProps, as: forwardedAs, ref });
696
+ });
697
+ return Styled.displayName = `Styled(${typeof tagName == "function" ? tagName.displayName : tagName})`, Styled;
698
+ };
699
+ return m.attrs = (attrs) => (_strings, ..._interpolations) => {
700
+ const StyledAttrs = react.forwardRef(function(_props, ref) {
701
+ const props = { ...attrs, ..._props }, { as, forwardedAs, ...rest } = props, sanitizedProps = Object.fromEntries(
702
+ Object.entries(rest).filter(([, val]) => !!val && (!isArray(val) || val.length > 0)).map(([key2, val]) => key2.startsWith("$") ? [`data-${toSnakeCase(key2.slice(1))}`, val] : [key2, val])
703
+ );
704
+ return react.createElement(as ?? tagName, { ...sanitizedProps, as: forwardedAs, ref });
705
+ });
706
+ return StyledAttrs.displayName = `StyledAttrs(${typeof tagName == "function" ? tagName.displayName : tagName})`, StyledAttrs;
707
+ }, m;
708
+ }, styled = baseStyled;
709
+ for (const tagName of elements)
710
+ styled[tagName] = baseStyled(tagName);
711
+ function toSnakeCase(str) {
712
+ return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
713
+ }
714
+ function isArray(value) {
715
+ return Array.isArray(value);
716
+ }
551
717
  function getGlobalScope() {
552
718
  if (typeof globalThis < "u") return globalThis;
553
719
  if (typeof window < "u") return window;
@@ -576,7 +742,7 @@ function ThemeProvider(props) {
576
742
  scheme,
577
743
  tone
578
744
  } : null, [rootTheme, scheme, tone]), theme$1 = react.useMemo(() => rootTheme ? theme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
579
- return theme$1 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
745
+ return theme$1 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider$1, { theme: theme$1, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
580
746
  }
581
747
  ThemeProvider.displayName = "ThemeProvider";
582
748
  function useRootTheme() {
@@ -591,10 +757,10 @@ function ThemeColorProvider(props) {
591
757
  }
592
758
  ThemeColorProvider.displayName = "ThemeColorProvider";
593
759
  function useTheme() {
594
- return styledComponents.useTheme();
760
+ return useTheme$1();
595
761
  }
596
762
  function useTheme_v2() {
597
- return theme.getTheme_v2(styledComponents.useTheme());
763
+ return theme.getTheme_v2(useTheme$1());
598
764
  }
599
765
  function _getMediaQuery(media, index) {
600
766
  return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
@@ -643,107 +809,16 @@ function usePrefersDark(getServerSnapshot2 = () => !1) {
643
809
  function usePrefersReducedMotion(getServerSnapshot2 = () => !1) {
644
810
  return useMatchMedia("(prefers-reduced-motion: reduce)", getServerSnapshot2);
645
811
  }
646
- function responsiveBorderStyle() {
647
- return [border, borderTop, borderRight, borderBottom, borderLeft];
648
- }
649
- function border(props) {
650
- const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
651
- return _responsive(
652
- media,
653
- props.$border,
654
- (value) => value ? { "&&": { border: borderStyle } } : { "&&": { border: 0 } }
655
- );
656
- }
657
- function borderTop(props) {
658
- const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
659
- return _responsive(
660
- media,
661
- props.$borderTop,
662
- (value) => value ? { "&&": { borderTop: borderStyle } } : { "&&": { borderTop: 0 } }
663
- );
664
- }
665
- function borderRight(props) {
666
- const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
667
- return _responsive(
668
- media,
669
- props.$borderRight,
670
- (value) => value ? { "&&": { borderRight: borderStyle } } : { "&&": { borderRight: 0 } }
671
- );
672
- }
673
- function borderBottom(props) {
674
- const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
675
- return _responsive(
676
- media,
677
- props.$borderBottom,
678
- (value) => value ? { "&&": { borderBottom: borderStyle } } : { "&&": { borderBottom: 0 } }
679
- );
680
- }
681
- function borderLeft(props) {
682
- const { card, media } = theme.getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
683
- return _responsive(
684
- media,
685
- props.$borderLeft,
686
- (value) => value ? { "&&": { borderLeft: borderStyle } } : { "&&": { borderLeft: 0 } }
687
- );
688
- }
689
- const BASE_STYLE$4 = {
690
- '&[data-as="ul"],&[data-as="ol"]': {
691
- listStyle: "none"
692
- }
693
- }, BOX_SIZING = {
694
- content: "content-box",
695
- border: "border-box"
696
- }, BOX_HEIGHT = {
697
- stretch: "stretch",
698
- fill: "100%"
699
- };
700
- function boxStyle() {
701
- return BASE_STYLE$4;
702
- }
703
- function responsiveBoxStyle() {
704
- return [
705
- responsiveBoxSizingStyle,
706
- responsiveBoxHeightStyle,
707
- responsiveBoxOverflowStyle,
708
- responsiveBoxDisplayStyle
709
- ];
710
- }
711
- function responsiveBoxDisplayStyle(props) {
712
- const { media } = theme.getTheme_v2(props.theme);
713
- return _responsive(media, props.$display, (display) => ({
714
- "&:not([hidden])": { display }
715
- }));
716
- }
717
- function responsiveBoxSizingStyle(props) {
718
- const { media } = theme.getTheme_v2(props.theme);
719
- return _responsive(media, props.$sizing, (sizing) => ({
720
- boxSizing: BOX_SIZING[sizing]
721
- }));
722
- }
723
- function responsiveBoxHeightStyle(props) {
724
- const { media } = theme.getTheme_v2(props.theme);
725
- return _responsive(media, props.$height, (height) => ({
726
- height: BOX_HEIGHT[height]
727
- }));
728
- }
729
- function responsiveBoxOverflowStyle(props) {
730
- const { media } = theme.getTheme_v2(props.theme);
731
- return _responsive(media, props.$overflow, (overflow) => ({
732
- overflow
733
- }));
734
- }
735
- const BASE_STYLE$3 = {
812
+ const BASE_STYLE$1 = {
736
813
  "&&:not([hidden])": {
737
814
  display: "flex"
738
815
  }
739
816
  };
740
817
  function responsiveFlexStyle() {
741
818
  return [
742
- BASE_STYLE$3,
819
+ BASE_STYLE$1,
743
820
  responsiveFlexAlignStyle,
744
821
  responsiveFlexGapStyle,
745
- responsiveFlexGapXStyle,
746
- responsiveFlexGapYStyle,
747
822
  responsiveFlexWrapStyle,
748
823
  responsiveFlexJustifyStyle,
749
824
  responsiveFlexDirectionStyle
@@ -759,18 +834,6 @@ function responsiveFlexGapStyle(props) {
759
834
  gap: gap ? rem(space[gap]) : void 0
760
835
  }));
761
836
  }
762
- function responsiveFlexGapXStyle(props) {
763
- const { media, space } = theme.getTheme_v2(props.theme);
764
- return _responsive(media, props.$gapX, (gapX) => ({
765
- columnGap: gapX ? rem(space[gapX]) : void 0
766
- }));
767
- }
768
- function responsiveFlexGapYStyle(props) {
769
- const { media, space } = theme.getTheme_v2(props.theme);
770
- return _responsive(media, props.$gapY, (gapY) => ({
771
- rowGap: gapY ? rem(space[gapY]) : void 0
772
- }));
773
- }
774
837
  function responsiveFlexWrapStyle(props) {
775
838
  const { media } = theme.getTheme_v2(props.theme);
776
839
  return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
@@ -783,37 +846,30 @@ function responsiveFlexDirectionStyle(props) {
783
846
  const { media } = theme.getTheme_v2(props.theme);
784
847
  return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
785
848
  }
786
- const BASE_STYLE$2 = {
849
+ const BASE_STYLE = {
787
850
  minWidth: 0,
788
851
  minHeight: 0
789
852
  };
790
853
  function flexItemStyle() {
791
- return [BASE_STYLE$2, responsiveFlexItemStyle];
854
+ return [BASE_STYLE, responsiveFlexItemStyle];
792
855
  }
793
856
  function responsiveFlexItemStyle(props) {
794
857
  const { media } = theme.getTheme_v2(props.theme);
795
858
  return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex })) : EMPTY_ARRAY;
796
859
  }
797
- function focusRingBorderStyle(border2) {
798
- return `inset 0 0 0 ${border2.width}px ${border2.color}`;
860
+ function focusRingBorderStyle(border) {
861
+ return `inset 0 0 0 ${border.width}px ${border.color}`;
799
862
  }
800
863
  function focusRingStyle(opts) {
801
- const { base, border: border2, focusRing } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
864
+ const { base, border, focusRing } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
802
865
  return [
803
866
  focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
804
- border2 && focusRingBorderStyle(border2),
867
+ border && focusRingBorderStyle(border),
805
868
  focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
806
869
  focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
807
870
  ].filter(Boolean).join(",");
808
871
  }
809
- const GRID_CSS = {
810
- "&&:not([hidden])": {
811
- display: "grid"
812
- },
813
- '&[data-as="ul"],&[data-as="ol"]': {
814
- listStyle: "none"
815
- }
816
- }, GRID_AUTO_COLUMS = {
872
+ const GRID_AUTO_COLUMS = {
817
873
  auto: "auto",
818
874
  min: "min-content",
819
875
  max: "max-content",
@@ -826,7 +882,6 @@ const GRID_CSS = {
826
882
  };
827
883
  function responsiveGridStyle() {
828
884
  return [
829
- GRID_CSS,
830
885
  responsiveGridAutoFlowStyle,
831
886
  responsiveGridAutoRowsStyle,
832
887
  responsiveGridAutoColsStyle,
@@ -885,53 +940,6 @@ function responsiveGridGapYStyle(props) {
885
940
  rowGap: gapY ? rem(space[gapY]) : void 0
886
941
  }));
887
942
  }
888
- function responsiveGridItemStyle() {
889
- return [
890
- responsiveGridItemRowStyle,
891
- responsiveGridItemRowStartStyle,
892
- responsiveGridItemRowEndStyle,
893
- responsiveGridItemColumnStyle,
894
- responsiveGridItemColumnStartStyle,
895
- responsiveGridItemColumnEndStyle
896
- ];
897
- }
898
- const GRID_ITEM_ROW = {
899
- auto: "auto",
900
- full: "1 / -1"
901
- }, GRID_ITEM_COLUMN = {
902
- auto: "auto",
903
- full: "1 / -1"
904
- };
905
- function responsiveGridItemRowStyle(props) {
906
- const { media } = theme.getTheme_v2(props.theme);
907
- return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
908
- }
909
- function responsiveGridItemRowStartStyle(props) {
910
- const { media } = theme.getTheme_v2(props.theme);
911
- return _responsive(media, props.$rowStart, (rowStart) => ({
912
- gridRowStart: rowStart
913
- }));
914
- }
915
- function responsiveGridItemRowEndStyle(props) {
916
- const { media } = theme.getTheme_v2(props.theme);
917
- return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: rowEnd }));
918
- }
919
- function responsiveGridItemColumnStyle(props) {
920
- const { media } = theme.getTheme_v2(props.theme);
921
- return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
922
- }
923
- function responsiveGridItemColumnStartStyle(props) {
924
- const { media } = theme.getTheme_v2(props.theme);
925
- return _responsive(media, props.$columnStart, (columnStart) => ({
926
- gridColumnStart: columnStart
927
- }));
928
- }
929
- function responsiveGridItemColumnEndStyle(props) {
930
- const { media } = theme.getTheme_v2(props.theme);
931
- return _responsive(media, props.$columnEnd, (columnEnd) => ({
932
- gridColumnEnd: columnEnd
933
- }));
934
- }
935
943
  function responsiveInputPaddingStyle(props) {
936
944
  const { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = theme.getTheme_v2(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
937
945
  for (let i = 0; i < len; i += 1)
@@ -949,7 +957,7 @@ function responsiveInputPaddingStyle(props) {
949
957
  function responsiveInputPaddingIconRightStyle(props) {
950
958
  return responsiveInputPaddingStyle({ ...props, $iconRight: !0 });
951
959
  }
952
- const ROOT_STYLE = styledComponents.css`
960
+ const ROOT_STYLE = css`
953
961
  &:not([hidden]) {
954
962
  display: flex;
955
963
  }
@@ -961,7 +969,7 @@ function textInputRootStyle() {
961
969
  }
962
970
  function textInputBaseStyle(props) {
963
971
  const { $scheme, $tone, $weight } = props, { color, font } = theme.getTheme_v2(props.theme);
964
- return styledComponents.css`
972
+ return css`
965
973
  appearance: none;
966
974
  background: none;
967
975
  border: 0;
@@ -1039,7 +1047,7 @@ function textInputFontSizeStyle(props) {
1039
1047
  }
1040
1048
  function textInputRepresentationStyle(props) {
1041
1049
  const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = theme.getTheme_v2(props.theme);
1042
- return styledComponents.css`
1050
+ return css`
1043
1051
  --input-box-shadow: none;
1044
1052
 
1045
1053
  position: absolute;
@@ -1165,30 +1173,6 @@ function textInputRepresentationStyle(props) {
1165
1173
  }
1166
1174
  `;
1167
1175
  }
1168
- function responsiveMarginStyle(props) {
1169
- const { theme: theme2 } = props;
1170
- return [
1171
- _getResponsiveSpace(theme2, ["margin"], props.$margin),
1172
- _getResponsiveSpace(theme2, ["marginLeft", "marginRight"], props.$marginX),
1173
- _getResponsiveSpace(theme2, ["marginTop", "marginBottom"], props.$marginY),
1174
- _getResponsiveSpace(theme2, ["marginTop"], props.$marginTop),
1175
- _getResponsiveSpace(theme2, ["marginRight"], props.$marginRight),
1176
- _getResponsiveSpace(theme2, ["marginBottom"], props.$marginBottom),
1177
- _getResponsiveSpace(theme2, ["marginLeft"], props.$marginLeft)
1178
- ].filter(Boolean);
1179
- }
1180
- function responsivePaddingStyle(props) {
1181
- const { theme: theme2 } = props;
1182
- return [
1183
- _getResponsiveSpace(theme2, ["padding"], props.$padding),
1184
- _getResponsiveSpace(theme2, ["paddingLeft", "paddingRight"], props.$paddingX),
1185
- _getResponsiveSpace(theme2, ["paddingTop", "paddingBottom"], props.$paddingY),
1186
- _getResponsiveSpace(theme2, ["paddingTop"], props.$paddingTop),
1187
- _getResponsiveSpace(theme2, ["paddingRight"], props.$paddingRight),
1188
- _getResponsiveSpace(theme2, ["paddingBottom"], props.$paddingBottom),
1189
- _getResponsiveSpace(theme2, ["paddingLeft"], props.$paddingLeft)
1190
- ].filter(Boolean);
1191
- }
1192
1176
  function responsiveRadiusStyle(props) {
1193
1177
  const { media, radius } = theme.getTheme_v2(props.theme);
1194
1178
  return _responsive(media, props.$radius, (value) => {
@@ -1196,32 +1180,16 @@ function responsiveRadiusStyle(props) {
1196
1180
  return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
1197
1181
  });
1198
1182
  }
1199
- function toBoxShadow(shadow, color) {
1200
- return `${shadow.map(rem).join(" ")} ${color}`;
1201
- }
1202
- function shadowStyle(shadow, outlineWidth = 1) {
1203
- if (!shadow) return EMPTY_RECORD;
1204
- const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`, umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)"), penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)"), ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
1205
- return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
1206
- }
1207
- function responsiveShadowStyle(props) {
1208
- const { card, media, shadow } = theme.getTheme_v2(props.theme);
1209
- return _responsive(
1210
- media,
1211
- props.$shadow,
1212
- (index) => shadowStyle(shadow[index], card.shadow.outline)
1213
- );
1214
- }
1215
1183
  function labelBaseStyle(props) {
1216
1184
  const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1217
- return styledComponents.css`
1185
+ return css`
1218
1186
  text-transform: uppercase;
1219
1187
 
1220
- ${$accent && styledComponents.css`
1188
+ ${$accent && css`
1221
1189
  color: var(--card-accent-fg-color);
1222
1190
  `}
1223
1191
 
1224
- ${$muted && styledComponents.css`
1192
+ ${$muted && css`
1225
1193
  color: var(--card-muted-fg-color);
1226
1194
  `}
1227
1195
 
@@ -1246,7 +1214,7 @@ function labelBaseStyle(props) {
1246
1214
  }
1247
1215
  `;
1248
1216
  }
1249
- const Root$C = styledComponents.styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styledComponents.styled.span`
1217
+ const Root$f = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styled.span`
1250
1218
  display: block;
1251
1219
  white-space: nowrap;
1252
1220
  text-overflow: ellipsis;
@@ -1257,6 +1225,7 @@ const Root$C = styledComponents.styled.div(responsiveLabelFont, responsiveTextAl
1257
1225
  accent,
1258
1226
  align,
1259
1227
  children: childrenProp,
1228
+ className,
1260
1229
  muted = !1,
1261
1230
  size: size2 = 2,
1262
1231
  textOverflow,
@@ -1265,164 +1234,31 @@ const Root$C = styledComponents.styled.div(responsiveLabelFont, responsiveTextAl
1265
1234
  } = props;
1266
1235
  let children = childrenProp;
1267
1236
  return textOverflow === "ellipsis" ? children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow$2, { children }) : children = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), /* @__PURE__ */ jsxRuntime.jsx(
1268
- Root$C,
1237
+ Root$f,
1269
1238
  {
1270
1239
  "data-ui": "Label",
1271
1240
  ...restProps,
1272
- $accent: accent,
1273
1241
  $align: useArrayProp(align),
1274
- $muted: muted,
1275
- $size: useArrayProp(size2),
1276
1242
  $weight: weight,
1243
+ className: css$1.composeClassNames(
1244
+ className,
1245
+ css$1.label({
1246
+ accent,
1247
+ muted,
1248
+ size: size2
1249
+ })
1250
+ ),
1277
1251
  ref,
1278
1252
  children
1279
1253
  }
1280
1254
  );
1281
1255
  });
1282
1256
  Label.displayName = "ForwardRef(Label)";
1283
- const avatarStyle = {
1284
- root: avatarRootStyle,
1285
- arrow: avatarArrowStyle,
1286
- bgStroke: avatarBgStrokeStyle,
1287
- stroke: avatarStrokeStyle,
1288
- initials: avatarInitialsStyle,
1289
- image: avatarImageStyle
1290
- };
1291
- function avatarArrowStyle() {
1292
- return {
1293
- position: "absolute",
1294
- boxSizing: "border-box",
1295
- zIndex: 0,
1296
- opacity: 0,
1297
- transition: "all 0.2s linear",
1298
- transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1299
- left: 0,
1300
- right: 0,
1301
- top: 0,
1302
- bottom: 0,
1303
- "& > svg": {
1304
- width: "11px",
1305
- height: "7px",
1306
- position: "absolute",
1307
- top: "-5px",
1308
- left: "50%",
1309
- transform: "translateX(-6px)",
1310
- "&:not([hidden])": {
1311
- display: "block"
1312
- }
1313
- },
1314
- "[data-arrow-position='inside'] > &": {
1315
- transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1316
- opacity: 0
1317
- },
1318
- "[data-arrow-position='top'] > &": {
1319
- opacity: 1,
1320
- transform: "rotate(0deg)"
1321
- },
1322
- "[data-arrow-position='bottom'] > &": {
1323
- opacity: 1,
1324
- transform: "rotate(-180deg)"
1325
- }
1326
- };
1327
- }
1328
- function avatarRootStyle(props) {
1329
- const { $color } = props, { avatar } = theme.getTheme_v2(props.theme);
1330
- return {
1331
- "--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
1332
- "--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
1333
- backgroundColor: "var(--avatar-bg-color)",
1334
- position: "relative",
1335
- boxSizing: "border-box",
1336
- userSelect: "none",
1337
- boxShadow: "0 0 0 1px var(--card-bg-color)",
1338
- '&[data-status="inactive"]': {
1339
- opacity: 0.5
1340
- },
1341
- "&>svg": {
1342
- "&:not([hidden])": {
1343
- display: "block"
1344
- }
1345
- },
1346
- /* &:is(button) */
1347
- '&[data-as="button"]': {
1348
- WebkitFontSmoothing: "inherit",
1349
- appearance: "none",
1350
- margin: 0,
1351
- padding: 0,
1352
- border: 0,
1353
- font: "inherit",
1354
- color: "inherit",
1355
- outline: "none",
1356
- "&:focus": {
1357
- boxShadow: focusRingStyle({ focusRing: avatar.focusRing })
1358
- },
1359
- "&:focus:not(:focus-visible)": {
1360
- boxShadow: "none"
1361
- }
1362
- }
1363
- };
1364
- }
1365
- function responsiveAvatarSizeStyle(props) {
1366
- const { avatar, media } = theme.getTheme_v2(props.theme);
1367
- return _responsive(media, props.$size, (size2) => {
1368
- const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
1369
- return {
1370
- width: rem(avatarSize.size),
1371
- height: rem(avatarSize.size),
1372
- borderRadius: rem(avatarSize.size / 2),
1373
- "&>svg": {
1374
- width: rem(avatarSize.size),
1375
- height: rem(avatarSize.size),
1376
- borderRadius: rem(avatarSize.size / 2)
1377
- }
1378
- };
1379
- });
1380
- }
1381
- function avatarImageStyle() {
1382
- return {
1383
- position: "relative"
1384
- };
1385
- }
1386
- function avatarInitialsStyle() {
1387
- return {
1388
- width: "100%",
1389
- height: "100%",
1390
- color: "var(--avatar-fg-color)",
1391
- alignItems: "center",
1392
- justifyContent: "center",
1393
- textTransform: "uppercase",
1394
- textAlign: "center",
1395
- borderRadius: "50%",
1396
- "&:not([hidden])": {
1397
- display: "flex"
1398
- }
1399
- };
1400
- }
1401
- function avatarBgStrokeStyle() {
1402
- return {
1403
- strokeWidth: "4px",
1404
- stroke: "var(--card-bg-color)"
1405
- };
1406
- }
1407
- function avatarStrokeStyle() {
1408
- return {
1409
- strokeWidth: "2px",
1410
- stroke: "var(--avatar-bg-color)",
1411
- '[data-status="editing"] &': {
1412
- strokeDasharray: "2 4",
1413
- strokeLinecap: "round"
1414
- }
1415
- };
1416
- }
1417
- const Root$B = styledComponents.styled.div(
1418
- responsiveAvatarSizeStyle,
1419
- avatarStyle.root
1420
- ), Arrow$1 = styledComponents.styled.div(avatarStyle.arrow), BgStroke = styledComponents.styled.ellipse(avatarStyle.bgStroke), Stroke = styledComponents.styled.ellipse(avatarStyle.stroke), Initials = styledComponents.styled.div(avatarStyle.initials), InitialsLabel = styledComponents.styled(Label)({
1421
- color: "inherit"
1422
- }), Image = styledComponents.styled.svg(avatarStyle.image), Avatar = react.forwardRef(function(props, ref) {
1257
+ const Avatar = react.forwardRef(function(props, ref) {
1423
1258
  const {
1424
1259
  __unstable_hideInnerStroke,
1425
1260
  as: asProp,
1261
+ className,
1426
1262
  color = "gray",
1427
1263
  src,
1428
1264
  title,
@@ -1433,7 +1269,7 @@ const Root$B = styledComponents.styled.div(
1433
1269
  status = "online",
1434
1270
  size: sizeProp = 1,
1435
1271
  ...restProps
1436
- } = props, { avatar } = useTheme_v2(), as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = react.useId(), [arrowPosition, setArrowPosition] = react.useState(
1272
+ } = props, { avatar: avatarTheme } = useTheme_v2(), As = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), _sizeRem = (avatarTheme.sizes[size2[0]] || avatarTheme.sizes[0]).size, _radius = _sizeRem / 2, elementId = react.useId(), [arrowPosition, setArrowPosition] = react.useState(
1437
1273
  animateArrowFrom || arrowPositionProp || "inside"
1438
1274
  ), [imageFailed, setImageFailed] = react.useState(!1), imageId = `avatar-image-${elementId}`;
1439
1275
  react.useEffect(() => {
@@ -1450,28 +1286,34 @@ const Root$B = styledComponents.styled.div(
1450
1286
  [size2]
1451
1287
  );
1452
1288
  return /* @__PURE__ */ jsxRuntime.jsxs(
1453
- Root$B,
1289
+ As,
1454
1290
  {
1455
- as,
1456
- "data-as": typeof as == "string" ? as : void 0,
1291
+ "data-as": typeof As == "string" ? As : void 0,
1457
1292
  "data-ui": "Avatar",
1458
1293
  ...restProps,
1459
1294
  $color: color,
1460
1295
  $size: size2,
1461
1296
  "aria-label": title,
1462
- "data-arrow-position": arrowPosition,
1297
+ className: css$1.composeClassNames(
1298
+ className,
1299
+ css$1.avatar({
1300
+ arrowPosition,
1301
+ color,
1302
+ size: sizeProp
1303
+ })
1304
+ ),
1463
1305
  "data-status": status,
1464
1306
  ref,
1465
1307
  title,
1466
1308
  children: [
1467
- /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
1309
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: css$1.avatarArrow(), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
1468
1310
  "path",
1469
1311
  {
1470
1312
  d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",
1471
1313
  fill: color
1472
1314
  }
1473
1315
  ) }) }),
1474
- !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1316
+ !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: css$1.avatarImage(), viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1475
1317
  /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsxRuntime.jsx(
1476
1318
  "image",
1477
1319
  {
@@ -1483,8 +1325,9 @@ const Root$B = styledComponents.styled.div(
1483
1325
  ) }) }),
1484
1326
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1485
1327
  !__unstable_hideInnerStroke && /* @__PURE__ */ jsxRuntime.jsx(
1486
- BgStroke,
1328
+ "ellipse",
1487
1329
  {
1330
+ className: css$1.avatarBgStroke(),
1488
1331
  cx: _radius,
1489
1332
  cy: _radius,
1490
1333
  rx: _radius,
@@ -1493,8 +1336,9 @@ const Root$B = styledComponents.styled.div(
1493
1336
  }
1494
1337
  ),
1495
1338
  /* @__PURE__ */ jsxRuntime.jsx(
1496
- Stroke,
1339
+ "ellipse",
1497
1340
  {
1341
+ className: css$1.avatarStroke(),
1498
1342
  cx: _radius,
1499
1343
  cy: _radius,
1500
1344
  rx: _radius,
@@ -1503,7 +1347,7 @@ const Root$B = styledComponents.styled.div(
1503
1347
  }
1504
1348
  )
1505
1349
  ] }),
1506
- (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: /* @__PURE__ */ jsxRuntime.jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) })
1350
+ (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: css$1.avatarInitials(), children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: initialsSize, style: { color: "inherit" }, weight: "medium", children: initials }) }) })
1507
1351
  ]
1508
1352
  }
1509
1353
  );
@@ -1522,7 +1366,7 @@ function _responsiveAvatarCounterSizeStyle(props) {
1522
1366
  }
1523
1367
  function _avatarCounterBaseStyle(props) {
1524
1368
  const { space } = theme.getTheme_v2(props.theme);
1525
- return styledComponents.css`
1369
+ return css`
1526
1370
  align-items: center;
1527
1371
  justify-content: center;
1528
1372
  box-sizing: border-box;
@@ -1540,7 +1384,7 @@ function _avatarCounterBaseStyle(props) {
1540
1384
  }
1541
1385
  `;
1542
1386
  }
1543
- const Root$A = styledComponents.styled.div(
1387
+ const Root$e = styled.div(
1544
1388
  _responsiveAvatarCounterSizeStyle,
1545
1389
  _avatarCounterBaseStyle
1546
1390
  ), AvatarCounter = react.forwardRef(function(props, ref) {
@@ -1548,10 +1392,10 @@ const Root$A = styledComponents.styled.div(
1548
1392
  () => size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0),
1549
1393
  [size2]
1550
1394
  );
1551
- return /* @__PURE__ */ jsxRuntime.jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
1395
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$e, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
1552
1396
  });
1553
1397
  AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1554
- const BASE_STYLES = styledComponents.css`
1398
+ const BASE_STYLES = css`
1555
1399
  white-space: nowrap;
1556
1400
 
1557
1401
  & > div {
@@ -1576,7 +1420,7 @@ function responsiveAvatarStackSizeStyle(props) {
1576
1420
  } : EMPTY_RECORD;
1577
1421
  });
1578
1422
  }
1579
- const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1423
+ const Root$d = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1580
1424
  const {
1581
1425
  children: childrenProp,
1582
1426
  maxLength: maxLengthProp = 4,
@@ -1586,29 +1430,30 @@ const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avata
1586
1430
  () => react.Children.toArray(childrenProp).filter(react.isValidElement),
1587
1431
  [childrenProp]
1588
1432
  ), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1589
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$z, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1433
+ return /* @__PURE__ */ jsxRuntime.jsxs(Root$d, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1590
1434
  len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }),
1591
1435
  len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1592
1436
  visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, { size: size2 }) }, String(childIndex)))
1593
1437
  ] });
1594
1438
  });
1595
1439
  AvatarStack.displayName = "ForwardRef(AvatarStack)";
1596
- const Root$y = styledComponents.styled.div(
1597
- boxStyle,
1598
- flexItemStyle,
1599
- responsiveBoxStyle,
1600
- responsiveGridItemStyle,
1601
- responsiveMarginStyle,
1602
- responsivePaddingStyle
1603
- ), Box = react.forwardRef(function(props, ref) {
1440
+ const Box = react.forwardRef(function(props, ref) {
1604
1441
  const {
1605
- as: asProp = "div",
1442
+ align,
1443
+ as: As = "div",
1444
+ className,
1606
1445
  column,
1607
1446
  columnStart,
1608
1447
  columnEnd,
1448
+ direction,
1609
1449
  display = "block",
1610
1450
  flex,
1451
+ gap,
1452
+ gapX,
1453
+ gapY,
1611
1454
  height,
1455
+ inset,
1456
+ justify,
1612
1457
  margin = 0,
1613
1458
  marginX,
1614
1459
  marginY,
@@ -1624,119 +1469,70 @@ const Root$y = styledComponents.styled.div(
1624
1469
  paddingRight,
1625
1470
  paddingBottom,
1626
1471
  paddingLeft,
1472
+ pointerEvents,
1473
+ position,
1627
1474
  row,
1628
1475
  rowStart,
1629
1476
  rowEnd,
1630
1477
  sizing,
1478
+ width,
1479
+ wrap,
1631
1480
  ...restProps
1632
1481
  } = props;
1633
1482
  return /* @__PURE__ */ jsxRuntime.jsx(
1634
- Root$y,
1483
+ As,
1635
1484
  {
1636
- "data-as": typeof asProp == "string" ? asProp : void 0,
1485
+ "data-as": typeof As == "string" ? As : void 0,
1637
1486
  "data-ui": "Box",
1638
1487
  ...restProps,
1639
- $column: useArrayProp(column),
1640
- $columnStart: useArrayProp(columnStart),
1641
- $columnEnd: useArrayProp(columnEnd),
1642
- $display: useArrayProp(display),
1643
- $flex: useArrayProp(flex),
1644
- $height: useArrayProp(height),
1645
- $margin: useArrayProp(margin),
1646
- $marginX: useArrayProp(marginX),
1647
- $marginY: useArrayProp(marginY),
1648
- $marginTop: useArrayProp(marginTop),
1649
- $marginRight: useArrayProp(marginRight),
1650
- $marginBottom: useArrayProp(marginBottom),
1651
- $marginLeft: useArrayProp(marginLeft),
1652
- $overflow: useArrayProp(overflow),
1653
- $padding: useArrayProp(padding),
1654
- $paddingX: useArrayProp(paddingX),
1655
- $paddingY: useArrayProp(paddingY),
1656
- $paddingTop: useArrayProp(paddingTop),
1657
- $paddingRight: useArrayProp(paddingRight),
1658
- $paddingBottom: useArrayProp(paddingBottom),
1659
- $paddingLeft: useArrayProp(paddingLeft),
1660
- $row: useArrayProp(row),
1661
- $rowStart: useArrayProp(rowStart),
1662
- $rowEnd: useArrayProp(rowEnd),
1663
- $sizing: useArrayProp(sizing),
1664
- as: asProp,
1488
+ className: css$1.composeClassNames(
1489
+ className,
1490
+ css$1.box({
1491
+ align,
1492
+ column,
1493
+ columnStart,
1494
+ columnEnd,
1495
+ direction,
1496
+ display,
1497
+ flex,
1498
+ gap,
1499
+ gapX,
1500
+ gapY,
1501
+ height,
1502
+ inset,
1503
+ justify,
1504
+ overflow,
1505
+ margin,
1506
+ marginX,
1507
+ marginY,
1508
+ marginTop,
1509
+ marginRight,
1510
+ marginBottom,
1511
+ marginLeft,
1512
+ padding,
1513
+ paddingX,
1514
+ paddingY,
1515
+ paddingTop,
1516
+ paddingRight,
1517
+ paddingBottom,
1518
+ paddingLeft,
1519
+ pointerEvents,
1520
+ position,
1521
+ row,
1522
+ rowStart,
1523
+ rowEnd,
1524
+ sizing,
1525
+ width,
1526
+ wrap
1527
+ })
1528
+ ),
1665
1529
  ref,
1666
1530
  children: props.children
1667
1531
  }
1668
1532
  );
1669
1533
  });
1670
1534
  Box.displayName = "ForwardRef(Box)";
1671
- function textBaseStyle(props) {
1672
- const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
1673
- return styledComponents.css`
1674
- min-width: 0;
1675
- color: var(--card-fg-color);
1676
-
1677
- ${$accent && styledComponents.css`
1678
- color: var(--card-accent-fg-color);
1679
- `}
1680
-
1681
- ${$muted && styledComponents.css`
1682
- color: var(--card-muted-fg-color);
1683
- `}
1684
-
1685
- & code {
1686
- font-family: ${font.code.family};
1687
- border-radius: 1px;
1688
- background-color: var(--card-code-bg-color);
1689
- color: var(--card-code-fg-color);
1690
- }
1691
-
1692
- & a {
1693
- text-decoration: none;
1694
- border-radius: 1px;
1695
- color: var(--card-link-color);
1696
- outline: none;
1697
-
1698
- @media (hover: hover) {
1699
- &:hover {
1700
- text-decoration: underline;
1701
- }
1702
- }
1703
-
1704
- &:focus {
1705
- box-shadow:
1706
- 0 0 0 1px var(--card-bg-color),
1707
- 0 0 0 3px var(--card-focus-ring-color);
1708
- }
1709
-
1710
- &:focus:not(:focus-visible) {
1711
- box-shadow: none;
1712
- }
1713
- }
1714
-
1715
- & strong {
1716
- font-weight: ${font.text.weights.bold};
1717
- }
1718
-
1719
- & svg {
1720
- /* Certain popular CSS libraries changes the defaults for SVG display */
1721
- /* Make sure SVGs are rendered as inline elements */
1722
- display: inline;
1723
- }
1724
-
1725
- & [data-sanity-icon] {
1726
- vertical-align: baseline;
1727
- color: var(--card-icon-color);
1728
-
1729
- & path {
1730
- vector-effect: non-scaling-stroke !important;
1731
- }
1732
- }
1733
- `;
1734
- }
1735
- const Root$x = styledComponents.styled.div(
1736
- responsiveTextFont,
1737
- responsiveTextAlignStyle,
1738
- textBaseStyle
1739
- ), SpanWithTextOverflow$1 = styledComponents.styled.span`
1535
+ const SpanWithTextOverflow$1 = styled.span`
1740
1536
  display: block;
1741
1537
  white-space: nowrap;
1742
1538
  text-overflow: ellipsis;
@@ -1746,7 +1542,9 @@ const Root$x = styledComponents.styled.div(
1746
1542
  const {
1747
1543
  accent = !1,
1748
1544
  align,
1545
+ as: As = "div",
1749
1546
  children: childrenProp,
1547
+ className,
1750
1548
  muted = !1,
1751
1549
  size: size2 = 2,
1752
1550
  textOverflow,
@@ -1755,282 +1553,86 @@ const Root$x = styledComponents.styled.div(
1755
1553
  } = props;
1756
1554
  let children = childrenProp;
1757
1555
  return textOverflow === "ellipsis" ? children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow$1, { children }) : children = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), /* @__PURE__ */ jsxRuntime.jsx(
1758
- Root$x,
1556
+ As,
1759
1557
  {
1760
1558
  "data-ui": "Text",
1761
1559
  ...restProps,
1762
- $accent: accent,
1763
1560
  $align: useArrayProp(align),
1764
- $muted: muted,
1765
1561
  ref,
1766
- $size: useArrayProp(size2),
1767
- $weight: weight,
1562
+ className: css$1.composeClassNames(
1563
+ className,
1564
+ css$1.text({
1565
+ accent,
1566
+ muted,
1567
+ size: size2,
1568
+ weight
1569
+ })
1570
+ ),
1768
1571
  children
1769
1572
  }
1770
1573
  );
1771
1574
  });
1772
1575
  Text.displayName = "ForwardRef(Text)";
1773
- function badgeStyle(props) {
1774
- const { $tone } = props;
1775
- return {
1776
- "--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
1777
- "--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
1778
- backgroundColor: "var(--card-bg-color)",
1779
- cursor: "default",
1780
- "&:not([hidden])": {
1781
- display: "inline-block",
1782
- verticalAlign: "top"
1783
- }
1784
- };
1785
- }
1786
- const Root$w = styledComponents.styled(Box)(
1787
- responsiveRadiusStyle,
1788
- badgeStyle
1789
- ), Badge = react.forwardRef(function(props, ref) {
1576
+ const Badge = react.forwardRef(function(props, ref) {
1790
1577
  const {
1791
1578
  children,
1579
+ className,
1580
+ display = "inline-block",
1792
1581
  fontSize: fontSize2 = 1,
1793
1582
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1794
1583
  mode: _deprecated_mode,
1795
1584
  padding = 1,
1796
- radius = "full",
1585
+ radius = 2,
1797
1586
  tone = "default",
1798
1587
  ...restProps
1799
1588
  } = props;
1800
1589
  return /* @__PURE__ */ jsxRuntime.jsx(
1801
- Root$w,
1590
+ Box,
1802
1591
  {
1803
1592
  "data-ui": "Badge",
1804
1593
  ...restProps,
1805
- $tone: tone,
1806
- $radius: useArrayProp(radius),
1807
- padding: useArrayProp(padding),
1594
+ className: css$1.composeClassNames(
1595
+ className,
1596
+ css$1.badge({
1597
+ radius,
1598
+ tone
1599
+ })
1600
+ ),
1601
+ display,
1602
+ padding,
1808
1603
  ref,
1809
1604
  children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children })
1810
1605
  }
1811
1606
  );
1812
1607
  });
1813
1608
  Badge.displayName = "ForwardRef(Badge)";
1814
- const Root$v = styledComponents.styled(Box)(
1609
+ const Root$c = styled(Box)(
1815
1610
  flexItemStyle,
1816
1611
  responsiveFlexStyle
1817
1612
  ), Flex = react.forwardRef(function(props, ref) {
1818
- const { align, as, direction = "row", gap, gapX, gapY, justify, wrap, ...restProps } = props;
1613
+ const { as, direction = "row", ...restProps } = props;
1819
1614
  return /* @__PURE__ */ jsxRuntime.jsx(
1820
- Root$v,
1615
+ Root$c,
1821
1616
  {
1822
1617
  "data-ui": "Flex",
1823
1618
  ...restProps,
1824
- $align: useArrayProp(align),
1825
- $direction: useArrayProp(direction),
1826
- $gap: useArrayProp(gap),
1827
- $gapX: useArrayProp(gapX),
1828
- $gapY: useArrayProp(gapY),
1829
- $justify: useArrayProp(justify),
1830
- $wrap: useArrayProp(wrap),
1619
+ direction,
1620
+ display: "flex",
1831
1621
  forwardedAs: as,
1832
1622
  ref
1833
1623
  }
1834
1624
  );
1835
1625
  });
1836
1626
  Flex.displayName = "ForwardRef(Flex)";
1837
- const rotate$1 = styledComponents.keyframes`
1838
- from {
1839
- transform: rotate(0deg);
1840
- }
1841
-
1842
- to {
1843
- transform: rotate(360deg);
1844
- }
1845
- `, Root$u = styledComponents.styled(Text)`
1846
- & > span > svg {
1847
- animation: ${rotate$1} 500ms linear infinite;
1848
- }
1849
- `, Spinner = react.forwardRef(function(props, ref) {
1850
- return /* @__PURE__ */ jsxRuntime.jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, {}) });
1627
+ const Spinner = react.forwardRef(function(props, ref) {
1628
+ return /* @__PURE__ */ jsxRuntime.jsx(Text, { "data-ui": "Spinner", ...props, className: css$1.spinner(), ref, children: /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, {}) });
1851
1629
  });
1852
1630
  Spinner.displayName = "ForwardRef(Spinner)";
1853
- function _cardColorStyle(base, color, checkered = !1) {
1854
- return {
1855
- // from base
1856
- "--card-backdrop-color": base.backdrop,
1857
- "--card-focus-ring-color": base.focusRing,
1858
- "--card-shadow-outline-color": base.shadow.outline,
1859
- "--card-shadow-umbra-color": base.shadow.umbra,
1860
- "--card-shadow-penumbra-color": base.shadow.penumbra,
1861
- "--card-shadow-ambient-color": base.shadow.ambient,
1862
- // from state
1863
- "--card-accent-fg-color": color.accent.fg,
1864
- "--card-avatar-gray-bg-color": color.avatar.gray.bg,
1865
- "--card-avatar-gray-fg-color": color.avatar.gray.fg,
1866
- "--card-avatar-blue-bg-color": color.avatar.blue.bg,
1867
- "--card-avatar-blue-fg-color": color.avatar.blue.fg,
1868
- "--card-avatar-purple-bg-color": color.avatar.purple.bg,
1869
- "--card-avatar-purple-fg-color": color.avatar.purple.fg,
1870
- "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
1871
- "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
1872
- "--card-avatar-red-bg-color": color.avatar.red.bg,
1873
- "--card-avatar-red-fg-color": color.avatar.red.fg,
1874
- "--card-avatar-orange-bg-color": color.avatar.orange.bg,
1875
- "--card-avatar-orange-fg-color": color.avatar.orange.fg,
1876
- "--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
1877
- "--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
1878
- "--card-avatar-green-bg-color": color.avatar.green.bg,
1879
- "--card-avatar-green-fg-color": color.avatar.green.fg,
1880
- "--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
1881
- "--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
1882
- "--card-bg-color": color.bg,
1883
- "--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
1884
- "--card-border-color": color.border,
1885
- "--card-badge-default-bg-color": color.badge.default.bg,
1886
- "--card-badge-default-dot-color": color.badge.default.dot,
1887
- "--card-badge-default-fg-color": color.badge.default.fg,
1888
- "--card-badge-default-icon-color": color.badge.default.icon,
1889
- "--card-badge-primary-bg-color": color.badge.primary.bg,
1890
- "--card-badge-primary-dot-color": color.badge.primary.dot,
1891
- "--card-badge-primary-fg-color": color.badge.primary.fg,
1892
- "--card-badge-primary-icon-color": color.badge.primary.icon,
1893
- "--card-badge-positive-bg-color": color.badge.positive.bg,
1894
- "--card-badge-positive-dot-color": color.badge.positive.dot,
1895
- "--card-badge-positive-fg-color": color.badge.positive.fg,
1896
- "--card-badge-positive-icon-color": color.badge.positive.icon,
1897
- "--card-badge-caution-bg-color": color.badge.caution.bg,
1898
- "--card-badge-caution-dot-color": color.badge.caution.dot,
1899
- "--card-badge-caution-fg-color": color.badge.caution.fg,
1900
- "--card-badge-caution-icon-color": color.badge.caution.icon,
1901
- "--card-badge-critical-bg-color": color.badge.critical.bg,
1902
- "--card-badge-critical-dot-color": color.badge.critical.dot,
1903
- "--card-badge-critical-fg-color": color.badge.critical.fg,
1904
- "--card-badge-critical-icon-color": color.badge.critical.icon,
1905
- "--card-badge-prospect-bg-color": color.badge.prospect.bg,
1906
- "--card-badge-prospect-dot-color": color.badge.prospect.dot,
1907
- "--card-badge-prospect-fg-color": color.badge.prospect.fg,
1908
- "--card-badge-prospect-icon-color": color.badge.prospect.icon,
1909
- "--card-badge-explore-bg-color": color.badge.explore.bg,
1910
- "--card-badge-explore-dot-color": color.badge.explore.dot,
1911
- "--card-badge-explore-fg-color": color.badge.explore.fg,
1912
- "--card-badge-explore-icon-color": color.badge.explore.icon,
1913
- "--card-code-bg-color": color.code.bg,
1914
- "--card-code-fg-color": color.code.fg,
1915
- "--card-fg-color": color.fg,
1916
- "--card-icon-color": color.icon,
1917
- "--card-kbd-bg-color": color.kbd.bg,
1918
- "--card-kbd-border-color": color.kbd.border,
1919
- "--card-kbd-fg-color": color.kbd.fg,
1920
- "--card-link-fg-color": color.link.fg,
1921
- "--card-muted-bg-color": color.muted.bg,
1922
- "--card-muted-fg-color": color.muted.fg,
1923
- "--card-skeleton-color-from": color.skeleton.from,
1924
- "--card-skeleton-color-to": color.skeleton.to,
1925
- // deprecated variables (kept for legacy)
1926
- "--card-bg2-color": color.muted.bg,
1927
- "--card-link-color": color.link.fg,
1928
- "--card-hairline-soft-color": color.border,
1929
- "--card-hairline-hard-color": color.border
1930
- };
1931
- }
1932
- function buttonBaseStyles(props) {
1933
- const { $width } = props, { style } = theme.getTheme_v2(props.theme);
1934
- return styledComponents.css`
1935
- ${style?.button};
1936
-
1937
- -webkit-font-smoothing: inherit;
1938
- appearance: none;
1939
- display: inline-flex;
1940
- align-items: center;
1941
- font: inherit;
1942
- border: 0;
1943
- outline: none;
1944
- user-select: none;
1945
- text-decoration: none;
1946
- border: 0;
1947
- box-sizing: border-box;
1948
- padding: 0;
1949
- overflow: hidden;
1950
- margin: 0;
1951
- text-align: left;
1952
- position: relative;
1953
- vertical-align: top;
1954
-
1955
- ${$width === "fill" && styledComponents.css`
1956
- width: -moz-available;
1957
- width: -webkit-fill-available;
1958
- width: stretch;
1959
- `}
1960
-
1961
- & > span {
1962
- display: block;
1963
- flex: 1;
1964
- min-width: 0;
1965
- border-radius: inherit;
1966
- }
1967
-
1968
- &::-moz-focus-inner {
1969
- border: 0;
1970
- padding: 0;
1971
- }
1972
- `;
1973
- }
1974
- function combineBoxShadow(...boxShadows) {
1975
- return boxShadows.filter(Boolean).join(",");
1976
- }
1977
- function buttonColorStyles(props) {
1978
- const { $mode } = props, { button, color: baseColor, style } = theme.getTheme_v2(props.theme), shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
1979
- width: button.border.width,
1980
- color: "var(--card-border-color)"
1981
- }, defaultBoxShadow = void 0;
1982
- return [
1983
- _cardColorStyle(baseColor, color.enabled),
1984
- {
1985
- backgroundColor: "var(--card-bg-color)",
1986
- color: "var(--card-fg-color)",
1987
- boxShadow: focusRingBorderStyle(border2),
1988
- '&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
1989
- "&:not([data-disabled='true'])": {
1990
- boxShadow: combineBoxShadow(
1991
- focusRingBorderStyle(border2),
1992
- shadow ? defaultBoxShadow : void 0
1993
- ),
1994
- "&:focus": {
1995
- boxShadow: focusRingStyle({
1996
- base: baseColor,
1997
- border: { width: 2, color: baseColor.bg },
1998
- focusRing: button.focusRing
1999
- })
2000
- },
2001
- "&:focus:not(:focus-visible)": {
2002
- boxShadow: combineBoxShadow(
2003
- focusRingBorderStyle(border2),
2004
- shadow ? defaultBoxShadow : void 0
2005
- )
2006
- },
2007
- "@media (hover: hover)": {
2008
- "&:hover": _cardColorStyle(baseColor, color.hovered),
2009
- "&:active": _cardColorStyle(baseColor, color.pressed),
2010
- "&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
2011
- },
2012
- "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
2013
- }
2014
- },
2015
- style?.button?.root
2016
- ].filter(Boolean);
2017
- }
2018
- const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styledComponents.styled.div`
2019
- position: absolute;
2020
- top: 0;
2021
- left: 0;
2022
- right: 0;
2023
- bottom: 0;
2024
- display: flex;
2025
- align-items: center;
2026
- justify-content: center;
2027
- background-color: var(--card-bg-color);
2028
- border-radius: inherit;
2029
- z-index: 1;
2030
- box-shadow: inherit;
2031
- `, Button = react.forwardRef(function(props, ref) {
1631
+ const Button = react.forwardRef(function(props, ref) {
2032
1632
  const {
1633
+ as: As = "button",
2033
1634
  children,
1635
+ className,
2034
1636
  disabled,
2035
1637
  fontSize: fontSize2 = 1,
2036
1638
  icon: IconComponent,
@@ -2057,7 +1659,7 @@ const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseS
2057
1659
  muted = !1,
2058
1660
  width,
2059
1661
  ...restProps
2060
- } = props, { button } = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), boxProps = react.useMemo(
1662
+ } = props, { button: buttonTheme } = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), space = useArrayProp(spaceProp), boxProps = react.useMemo(
2061
1663
  () => ({
2062
1664
  // flex: 1,
2063
1665
  padding,
@@ -2071,27 +1673,32 @@ const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseS
2071
1673
  [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]
2072
1674
  );
2073
1675
  return /* @__PURE__ */ jsxRuntime.jsxs(
2074
- Root$t,
1676
+ As,
2075
1677
  {
2076
1678
  "data-ui": "Button",
2077
1679
  ...restProps,
2078
- $mode: mode,
2079
- $radius: radius,
2080
- $tone: tone,
1680
+ className: css$1.composeClassNames(
1681
+ className,
1682
+ css$1.button({
1683
+ mode,
1684
+ radius: radiusProp,
1685
+ tone,
1686
+ width
1687
+ })
1688
+ ),
2081
1689
  "data-disabled": !!(loading || disabled),
2082
1690
  "data-selected": selected ? "" : void 0,
2083
1691
  disabled: !!(loading || disabled),
2084
1692
  ref,
2085
1693
  type,
2086
- $width: width,
2087
1694
  children: [
2088
- !!loading && /* @__PURE__ */ jsxRuntime.jsx(LoadingBox, { children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }),
1695
+ !!loading && /* @__PURE__ */ jsxRuntime.jsx(Box, { align: "center", className: css$1.buttonLoadingBox(), display: "flex", justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: fontSize2 }) }),
2089
1696
  (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", justify, gap: space, children: [
2090
1697
  IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { as: "span", size: fontSize2, style: { flex: "none" }, children: [
2091
1698
  react.isValidElement(IconComponent) && IconComponent,
2092
1699
  ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
2093
1700
  ] }),
2094
- text && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", children: /* @__PURE__ */ jsxRuntime.jsx(
1701
+ text && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
2095
1702
  Text,
2096
1703
  {
2097
1704
  as: "span",
@@ -2099,7 +1706,7 @@ const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseS
2099
1706
  align: textAlign,
2100
1707
  size: fontSize2,
2101
1708
  textOverflow,
2102
- weight: textWeight ?? button.textWeight,
1709
+ weight: textWeight ?? buttonTheme.textWeight,
2103
1710
  children: text
2104
1711
  }
2105
1712
  ) }),
@@ -2114,299 +1721,60 @@ const Root$t = styledComponents.styled.button(responsiveRadiusStyle, buttonBaseS
2114
1721
  );
2115
1722
  });
2116
1723
  Button.displayName = "ForwardRef(Button)";
2117
- function cardStyle(props) {
2118
- return [cardBaseStyle(props), cardColorStyle(props)];
2119
- }
2120
- function cardBaseStyle(props) {
2121
- const { $checkered } = props, { space } = theme.getTheme_v2(props.theme);
2122
- return styledComponents.css`
2123
- ${$checkered && styledComponents.css`
2124
- background-size: ${space[3]}px ${space[3]}px;
2125
- background-position: 50% 50%;
2126
- background-image: var(--card-bg-image);
2127
- `}
2128
-
2129
- &[data-as='button'] {
2130
- -webkit-font-smoothing: inherit;
2131
- appearance: none;
2132
- outline: none;
2133
- font: inherit;
2134
- text-align: inherit;
2135
- border: 0;
2136
- width: -moz-available;
2137
- width: -webkit-fill-available;
2138
- width: stretch;
2139
- }
2140
-
2141
- /* &:is(a) */
2142
- &[data-as='a'] {
2143
- outline: none;
2144
- text-decoration: none;
2145
- }
2146
-
2147
- /* &:is(pre) */
2148
- &[data-as='pre'] {
2149
- font: inherit;
2150
- }
2151
- `;
2152
- }
2153
- function cardColorStyle(props) {
2154
- const { $checkered, $focusRing, $muted } = props, { card, color, style } = theme.getTheme_v2(props.theme), border2 = { width: card.border.width, color: "var(--card-border-color)" };
2155
- return styledComponents.css`
2156
- color-scheme: ${color._dark ? "dark" : "light"};
2157
-
2158
- ${_cardColorStyle(color, color, $checkered)}
2159
-
2160
- background-color: ${$muted ? "var(--card-muted-bg-color)" : "var(--card-bg-color)"};
2161
- color: var(--card-fg-color);
2162
-
2163
- /* &:is(button) */
2164
- &[data-as='button'] {
2165
- --card-focus-ring-box-shadow: none;
2166
-
2167
- cursor: default;
2168
- box-shadow: var(--card-focus-ring-box-shadow);
2169
-
2170
- &:disabled {
2171
- ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
2172
- }
2173
-
2174
- &:not(:disabled) {
2175
- &[data-pressed] {
2176
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2177
- }
2178
-
2179
- &[data-selected] {
2180
- ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
2181
- }
2182
-
2183
- @media (hover: hover) {
2184
- &:not([data-pressed]):not([data-selected]) {
2185
- &[data-hovered],
2186
- &:hover {
2187
- ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
2188
- }
2189
-
2190
- &:active {
2191
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2192
- }
2193
- }
2194
- }
2195
-
2196
- &:focus-visible {
2197
- --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border: border2, focusRing: card.focusRing }) : void 0};
2198
- }
2199
- }
2200
- }
2201
-
2202
- /* &:is(a) */
2203
- &[data-as='a'] {
2204
- cursor: pointer;
2205
- box-shadow: var(--card-focus-ring-box-shadow);
2206
-
2207
- &[data-disabled] {
2208
- ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
2209
- }
2210
-
2211
- &:not([data-disabled]) {
2212
- &[data-pressed] {
2213
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2214
- }
2215
-
2216
- &[data-selected] {
2217
- ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
2218
- }
2219
-
2220
- @media (hover: hover) {
2221
- &:not([data-pressed]):not([data-selected]) {
2222
- &[data-hovered],
2223
- &:hover {
2224
- ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
2225
- }
2226
-
2227
- &:active {
2228
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2229
- }
2230
- }
2231
- }
2232
-
2233
- &:focus-visible {
2234
- --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border: border2, focusRing: card.focusRing }) : void 0};
2235
- }
2236
- }
2237
- }
2238
-
2239
- ${style?.card?.root}
2240
- `;
2241
- }
2242
- const Root$s = styledComponents.styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = react.forwardRef(function(props, ref) {
1724
+ const RootCardContext = react.createContext(null), Card = react.forwardRef(function(props, ref) {
2243
1725
  const {
2244
- __unstable_checkered: checkered = !1,
2245
- __unstable_focusRing: focusRing = !1,
1726
+ // __unstable_checkered: checkered = false,
1727
+ // __unstable_focusRing: focusRing = false,
2246
1728
  as: asProp,
2247
- border: border2,
2248
- borderTop: borderTop2,
2249
- borderRight: borderRight2,
2250
- borderBottom: borderBottom2,
2251
- borderLeft: borderLeft2,
2252
- muted,
1729
+ border,
1730
+ borderTop,
1731
+ borderRight,
1732
+ borderBottom,
1733
+ borderLeft,
1734
+ className,
1735
+ // muted,
2253
1736
  pressed,
2254
1737
  radius = 0,
2255
1738
  scheme,
2256
1739
  selected,
2257
1740
  shadow,
1741
+ style,
2258
1742
  tone: toneProp = "default",
2259
1743
  ...restProps
2260
- } = props, as = ReactIs.isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
2261
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeColorProvider, { scheme, tone, children: /* @__PURE__ */ jsxRuntime.jsx(
2262
- Root$s,
1744
+ } = props, as = ReactIs.isValidElementType(asProp) ? asProp : "div", rootCard = react.useContext(RootCardContext), rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, node = /* @__PURE__ */ jsxRuntime.jsx(ThemeColorProvider, { scheme, tone, children: /* @__PURE__ */ jsxRuntime.jsx(
1745
+ Box,
2263
1746
  {
2264
1747
  "data-as": typeof as == "string" ? as : void 0,
2265
1748
  "data-scheme": rootTheme.scheme,
2266
1749
  "data-ui": "Card",
2267
1750
  "data-tone": tone,
2268
1751
  ...restProps,
2269
- $border: useArrayProp(border2),
2270
- $borderTop: useArrayProp(borderTop2),
2271
- $borderRight: useArrayProp(borderRight2),
2272
- $borderBottom: useArrayProp(borderBottom2),
2273
- $borderLeft: useArrayProp(borderLeft2),
2274
- $checkered: checkered,
2275
- $focusRing: focusRing,
2276
- $muted: muted,
2277
- $radius: useArrayProp(radius),
2278
- $shadow: useArrayProp(shadow),
2279
- $tone: tone,
2280
- "data-checkered": checkered ? "" : void 0,
1752
+ as,
1753
+ className: css$1.composeClassNames(
1754
+ className,
1755
+ rootCard ? void 0 : "root",
1756
+ css$1.card({
1757
+ border,
1758
+ borderTop,
1759
+ borderRight,
1760
+ borderBottom,
1761
+ borderLeft,
1762
+ radius,
1763
+ shadow
1764
+ })
1765
+ ),
2281
1766
  "data-pressed": pressed ? "" : void 0,
1767
+ "data-test": rootCard ? void 0 : "",
2282
1768
  "data-selected": selected ? "" : void 0,
2283
- forwardedAs: as,
2284
1769
  ref,
2285
- selected
1770
+ selected,
1771
+ style
2286
1772
  }
2287
1773
  ) });
1774
+ return rootCard ? node : /* @__PURE__ */ jsxRuntime.jsx(RootCardContext.Provider, { value: { renderedVars: !0 }, children: node });
2288
1775
  });
2289
1776
  Card.displayName = "ForwardRef(Card)";
2290
- function checkboxBaseStyles() {
2291
- return styledComponents.css`
2292
- position: relative;
2293
- display: inline-block;
2294
- `;
2295
- }
2296
- function inputElementStyles(props) {
2297
- const { color, input, radius } = theme.getTheme_v2(props.theme), { focusRing } = input.checkbox;
2298
- return styledComponents.css`
2299
- position: absolute;
2300
- top: 0;
2301
- left: 0;
2302
- width: 100%;
2303
- height: 100%;
2304
- outline: none;
2305
- opacity: 0;
2306
- z-index: 1;
2307
- padding: 0;
2308
- margin: 0;
2309
-
2310
- & + span {
2311
- position: relative;
2312
- display: block;
2313
- height: ${rem(input.checkbox.size)};
2314
- width: ${rem(input.checkbox.size)};
2315
- box-sizing: border-box;
2316
- box-shadow: ${focusRingBorderStyle({
2317
- color: color.input.default.enabled.border,
2318
- width: input.border.width
2319
- })};
2320
- border-radius: ${rem(radius[2])};
2321
- line-height: 1;
2322
- background-color: ${color.input.default.enabled.bg};
2323
-
2324
- & > svg {
2325
- display: block;
2326
- position: absolute;
2327
- opacity: 0;
2328
- height: 100%;
2329
- width: 100%;
2330
-
2331
- & > path {
2332
- vector-effect: non-scaling-stroke;
2333
- stroke-width: 1.5px !important;
2334
- }
2335
- }
2336
- }
2337
-
2338
- &:checked + span {
2339
- background: ${color.input.default.enabled.fg};
2340
- box-shadow: ${focusRingBorderStyle({
2341
- color: color.input.default.enabled.fg,
2342
- width: input.border.width
2343
- })};
2344
- color: ${color.input.default.enabled.bg};
2345
- }
2346
-
2347
- /* focus */
2348
- &:not(:disabled):focus:focus-visible + span {
2349
- box-shadow: ${focusRingStyle({ focusRing })};
2350
- }
2351
-
2352
- /* focus when checked - uses a different offset */
2353
- &:not(:disabled):focus:focus-visible&:checked + span {
2354
- box-shadow: ${focusRingStyle({ focusRing: { width: 1, offset: 1 } })};
2355
- }
2356
-
2357
- &[data-error] + span {
2358
- background-color: ${color.input.invalid.enabled.border};
2359
- box-shadow: ${focusRingBorderStyle({
2360
- width: input.border.width,
2361
- color: color.input.invalid.enabled.muted.bg
2362
- })};
2363
- color: ${color.input.default.disabled.fg};
2364
- }
2365
- &[data-error]&:checked + span {
2366
- background-color: ${color.input.invalid.enabled.muted.bg};
2367
- color: ${color.input.default.enabled.bg};
2368
- }
2369
- &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {
2370
- box-shadow: ${focusRingStyle({
2371
- border: { width: input.border.width, color: color.input.invalid.readOnly.muted.bg },
2372
- focusRing: { width: 1, offset: 1 }
2373
- })};
2374
- }
2375
-
2376
- &:disabled + span {
2377
- background-color: ${color.input.default.disabled.bg};
2378
- box-shadow: ${focusRingBorderStyle({
2379
- width: input.border.width,
2380
- color: color.input.default.disabled.border
2381
- })};
2382
- color: ${color.input.default.disabled.fg};
2383
- }
2384
- &:disabled&:checked + span {
2385
- background-color: ${color.input.default.disabled.muted.bg};
2386
- }
2387
-
2388
- &[data-read-only] + span {
2389
- background-color: ${color.input.default.readOnly.bg};
2390
- box-shadow: ${focusRingBorderStyle({
2391
- width: input.border.width,
2392
- color: color.input.default.readOnly.border
2393
- })};
2394
- color: ${color.input.default.readOnly.fg};
2395
- }
2396
-
2397
- &[data-read-only]&:checked + span {
2398
- background-color: ${color.input.default.readOnly.muted.bg};
2399
- }
2400
-
2401
- &:checked + span > svg:first-child {
2402
- opacity: 1;
2403
- }
2404
- &:indeterminate + span > svg:last-child {
2405
- opacity: 1;
2406
- }
2407
- `;
2408
- }
2409
- const Root$r = styledComponents.styled.div(checkboxBaseStyles), Input$5 = styledComponents.styled.input(inputElementStyles), Checkbox = react.forwardRef(function(props, forwardedRef) {
1777
+ const Checkbox = react.forwardRef(function(props, forwardedRef) {
2410
1778
  const {
2411
1779
  checked,
2412
1780
  className,
@@ -2422,14 +1790,15 @@ const Root$r = styledComponents.styled.div(checkboxBaseStyles), Input$5 = styled
2422
1790
  () => ref.current
2423
1791
  ), react.useEffect(() => {
2424
1792
  ref.current && (ref.current.indeterminate = indeterminate || !1);
2425
- }, [indeterminate]), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$r, { className, "data-ui": "Checkbox", style, children: [
1793
+ }, [indeterminate]), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs("span", { className: css$1.composeClassNames(className, css$1.checkbox()), "data-ui": "Checkbox", style, children: [
2426
1794
  /* @__PURE__ */ jsxRuntime.jsx(
2427
- Input$5,
1795
+ "input",
2428
1796
  {
2429
1797
  "data-read-only": !disabled && readOnly ? "" : void 0,
2430
1798
  "data-error": customValidity ? "" : void 0,
2431
1799
  ...restProps,
2432
1800
  checked,
1801
+ className: css$1.composeClassNames(className, css$1.checkboxInput()),
2433
1802
  disabled: disabled || readOnly,
2434
1803
  type: "checkbox",
2435
1804
  readOnly,
@@ -2443,120 +1812,49 @@ const Root$r = styledComponents.styled.div(checkboxBaseStyles), Input$5 = styled
2443
1812
  ] });
2444
1813
  });
2445
1814
  Checkbox.displayName = "ForwardRef(Checkbox)";
2446
- function codeSyntaxHighlightingStyle({ theme: theme$1 }) {
1815
+ const Code = react.forwardRef(function(props, ref) {
2447
1816
  const {
2448
- color: { syntax: color }
2449
- } = theme.getTheme_v2(theme$1);
2450
- return {
2451
- "&.atrule": { color: color.atrule },
2452
- "&.attr-name": { color: color.attrName },
2453
- "&.attr-value": { color: color.attrValue },
2454
- "&.attribute": { color: color.attribute },
2455
- "&.boolean": { color: color.boolean },
2456
- "&.builtin": { color: color.builtin },
2457
- "&.cdata": { color: color.cdata },
2458
- "&.char": { color: color.char },
2459
- "&.class": { color: color.class },
2460
- "&.class-name": { color: color.className },
2461
- "&.comment": { color: color.comment },
2462
- "&.constant": { color: color.constant },
2463
- "&.deleted": { color: color.deleted },
2464
- "&.doctype": { color: color.doctype },
2465
- "&.entity": { color: color.entity },
2466
- "&.function": { color: color.function },
2467
- "&.hexcode": { color: color.hexcode },
2468
- "&.id": { color: color.id },
2469
- "&.important": { color: color.important },
2470
- "&.inserted": { color: color.inserted },
2471
- "&.keyword": { color: color.keyword },
2472
- "&.number": { color: color.number },
2473
- "&.operator": { color: color.operator },
2474
- "&.prolog": { color: color.prolog },
2475
- "&.property": { color: color.property },
2476
- "&.pseudo-class": { color: color.pseudoClass },
2477
- "&.pseudo-element": { color: color.pseudoElement },
2478
- "&.punctuation": { color: color.punctuation },
2479
- "&.regex": { color: color.regex },
2480
- "&.selector": { color: color.selector },
2481
- "&.string": { color: color.string },
2482
- "&.symbol": { color: color.symbol },
2483
- "&.tag": { color: color.tag },
2484
- "&.unit": { color: color.unit },
2485
- "&.url": { color: color.url },
2486
- "&.variable": { color: color.variable }
2487
- };
2488
- }
2489
- function codeBaseStyle() {
2490
- return styledComponents.css`
2491
- color: var(--card-code-fg-color);
2492
-
2493
- & code {
2494
- font-family: inherit;
2495
-
2496
- &.refractor .token {
2497
- ${codeSyntaxHighlightingStyle}
2498
- }
2499
- }
2500
-
2501
- & a {
2502
- color: inherit;
2503
- text-decoration: underline;
2504
- border-radius: 1px;
2505
- }
2506
-
2507
- & svg {
2508
- /* Certain popular CSS libraries changes the defaults for SVG display */
2509
- /* Make sure SVGs are rendered as inline elements */
2510
- display: inline;
2511
- }
2512
-
2513
- & [data-sanity-icon] {
2514
- vertical-align: baseline;
1817
+ as: As = "pre",
1818
+ children,
1819
+ className,
1820
+ language: languageProp,
1821
+ size: size2 = 2,
1822
+ weight,
1823
+ ...restProps
1824
+ } = props, language = typeof languageProp == "string" ? languageProp : void 0, registered = language ? Refractor__default.default.hasLanguage(language) : !1;
1825
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1826
+ As,
1827
+ {
1828
+ "data-ui": "Code",
1829
+ ...restProps,
1830
+ className: css$1.composeClassNames(className, css$1.code({ size: size2, weight })),
1831
+ ref,
1832
+ children: [
1833
+ !(language && registered) && /* @__PURE__ */ jsxRuntime.jsx("code", { children }),
1834
+ language && registered && /* @__PURE__ */ jsxRuntime.jsx(Refractor__default.default, { inline: !0, language, value: String(children) })
1835
+ ]
2515
1836
  }
2516
- `;
2517
- }
2518
- const Root$q = styledComponents.styled.pre(codeBaseStyle, responsiveCodeFontStyle), Code = react.forwardRef(function(props, ref) {
2519
- const { children, language: languageProp, size: size2 = 2, weight, ...restProps } = props, language = typeof languageProp == "string" ? languageProp : void 0, registered = language ? Refractor__default.default.hasLanguage(language) : !1;
2520
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$q, { "data-ui": "Code", ...restProps, $size: useArrayProp(size2), $weight: weight, ref, children: [
2521
- !(language && registered) && /* @__PURE__ */ jsxRuntime.jsx("code", { children }),
2522
- language && registered && /* @__PURE__ */ jsxRuntime.jsx(Refractor__default.default, { inline: !0, language, value: String(children) })
2523
- ] });
1837
+ );
2524
1838
  });
2525
1839
  Code.displayName = "ForwardRef(Code)";
2526
- const BASE_STYLE$1 = {
2527
- width: "100%",
2528
- margin: "0 auto"
2529
- };
2530
- function containerBaseStyle() {
2531
- return BASE_STYLE$1;
2532
- }
2533
- function responsiveContainerWidthStyle(props) {
2534
- const { container, media } = theme.getTheme_v2(props.theme);
2535
- return _responsive(media, props.$width, (val) => ({
2536
- maxWidth: val === "auto" ? "none" : rem(container[val])
2537
- }));
2538
- }
2539
- const Root$p = styledComponents.styled(Box)(
2540
- containerBaseStyle,
2541
- responsiveContainerWidthStyle
2542
- ), Container = react.forwardRef(function(props, ref) {
2543
- const { as, width = 2, ...restProps } = props;
1840
+ const Container = react.forwardRef(function(props, ref) {
1841
+ const { as, className, width = 2, ...restProps } = props;
2544
1842
  return /* @__PURE__ */ jsxRuntime.jsx(
2545
- Root$p,
1843
+ Box,
2546
1844
  {
2547
1845
  "data-ui": "Container",
2548
1846
  ...restProps,
2549
- $width: useArrayProp(width),
2550
- forwardedAs: as,
1847
+ as,
1848
+ className: css$1.composeClassNames(className, css$1.container({ width })),
2551
1849
  ref
2552
1850
  }
2553
1851
  );
2554
1852
  });
2555
1853
  Container.displayName = "ForwardRef(Container)";
2556
- const Root$o = styledComponents.styled(Box)(responsiveGridStyle), Grid = react.forwardRef(function(props, ref) {
1854
+ const Root$b = styled(Box)(responsiveGridStyle), Grid = react.forwardRef(function(props, ref) {
2557
1855
  const { as, autoRows, autoCols, autoFlow, columns, gap, gapX, gapY, rows, children, ...restProps } = props;
2558
1856
  return /* @__PURE__ */ jsxRuntime.jsx(
2559
- Root$o,
1857
+ Root$b,
2560
1858
  {
2561
1859
  "data-as": typeof as == "string" ? as : void 0,
2562
1860
  "data-ui": "Grid",
@@ -2569,6 +1867,7 @@ const Root$o = styledComponents.styled(Box)(responsiveGridStyle), Grid = react.f
2569
1867
  $gapX: useArrayProp(gapX),
2570
1868
  $gapY: useArrayProp(gapY),
2571
1869
  $rows: useArrayProp(rows),
1870
+ display: "grid",
2572
1871
  forwardedAs: as,
2573
1872
  ref,
2574
1873
  children
@@ -2576,61 +1875,7 @@ const Root$o = styledComponents.styled(Box)(responsiveGridStyle), Grid = react.f
2576
1875
  );
2577
1876
  });
2578
1877
  Grid.displayName = "ForwardRef(Grid)";
2579
- function headingBaseStyle(props) {
2580
- const { $accent, $muted } = props, { font } = theme.getTheme_v2(props.theme);
2581
- return styledComponents.css`
2582
- ${$accent && styledComponents.css`
2583
- color: var(--card-accent-fg-color);
2584
- `}
2585
-
2586
- ${$muted && styledComponents.css`
2587
- color: var(--card-muted-fg-color);
2588
- `}
2589
-
2590
- & code {
2591
- font-family: ${font.code.family};
2592
- border-radius: 1px;
2593
- }
2594
-
2595
- & a {
2596
- text-decoration: none;
2597
- border-radius: 1px;
2598
- color: var(--card-link-color);
2599
- outline: none;
2600
-
2601
- @media (hover: hover) {
2602
- &:hover {
2603
- text-decoration: underline;
2604
- }
2605
- }
2606
-
2607
- &:focus {
2608
- box-shadow:
2609
- 0 0 0 1px var(--card-bg-color),
2610
- 0 0 0 3px var(--card-focus-ring-color);
2611
- }
2612
-
2613
- &:focus:not(:focus-visible) {
2614
- box-shadow: none;
2615
- }
2616
- }
2617
-
2618
- & strong {
2619
- font-weight: ${font.heading.weights.bold};
2620
- }
2621
-
2622
- & svg {
2623
- /* Certain popular CSS libraries changes the defaults for SVG display */
2624
- /* Make sure SVGs are rendered as inline elements */
2625
- display: inline;
2626
- }
2627
-
2628
- & [data-sanity-icon] {
2629
- vertical-align: baseline;
2630
- }
2631
- `;
2632
- }
2633
- const Root$n = styledComponents.styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), SpanWithTextOverflow = styledComponents.styled.span`
1878
+ const SpanWithTextOverflow = styled.span`
2634
1879
  display: block;
2635
1880
  white-space: nowrap;
2636
1881
  text-overflow: ellipsis;
@@ -2640,7 +1885,9 @@ const Root$n = styledComponents.styled.div(headingBaseStyle, responsiveTextAlign
2640
1885
  const {
2641
1886
  accent = !1,
2642
1887
  align,
1888
+ as: As = "div",
2643
1889
  children: childrenProp,
1890
+ className,
2644
1891
  muted = !1,
2645
1892
  size: size2 = 2,
2646
1893
  textOverflow,
@@ -2649,81 +1896,71 @@ const Root$n = styledComponents.styled.div(headingBaseStyle, responsiveTextAlign
2649
1896
  } = props;
2650
1897
  let children = childrenProp;
2651
1898
  return textOverflow === "ellipsis" && (children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children })), /* @__PURE__ */ jsxRuntime.jsx(
2652
- Root$n,
1899
+ As,
2653
1900
  {
2654
1901
  "data-ui": "Heading",
2655
1902
  ...restProps,
2656
- $accent: accent,
2657
1903
  $align: useArrayProp(align),
2658
- $muted: muted,
2659
- $size: useArrayProp(size2),
2660
- $weight: weight,
1904
+ className: css$1.composeClassNames(
1905
+ className,
1906
+ css$1.heading({
1907
+ accent,
1908
+ muted,
1909
+ size: size2,
1910
+ weight
1911
+ })
1912
+ ),
2661
1913
  ref,
2662
1914
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2663
1915
  }
2664
1916
  );
2665
1917
  });
2666
1918
  Heading.displayName = "ForwardRef(Heading)";
2667
- function inlineBaseStyle() {
2668
- return {
2669
- lineHeight: 0,
2670
- "&&:not([hidden])": {
2671
- display: "block"
2672
- },
2673
- "& > div": {
2674
- display: "inline-block",
2675
- verticalAlign: "middle"
2676
- }
2677
- };
2678
- }
2679
- function inlineSpaceStyle(props) {
2680
- const { media, space } = theme.getTheme_v2(props.theme);
2681
- return _responsive(media, props.$space, (spaceIndex) => {
2682
- const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
2683
- return {
2684
- margin: `-${_space} 0 0 -${_space}`,
2685
- "& > div": { padding: `${_space} 0 0 ${_space}` }
2686
- };
2687
- });
2688
- }
2689
- const Root$m = styledComponents.styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
1919
+ const Inline = react.forwardRef(function(props, ref) {
2690
1920
  const { as, children: childrenProp, space, ...restProps } = props, children = react.useMemo(
2691
- () => react.Children.map(childrenProp, (child) => child && /* @__PURE__ */ jsxRuntime.jsx("div", { children: child })),
1921
+ () => react.Children.map(childrenProp, (child) => child && /* @__PURE__ */ jsxRuntime.jsx(Box, { maxWidth: "fill", children: child })),
2692
1922
  [childrenProp]
2693
1923
  );
2694
1924
  return /* @__PURE__ */ jsxRuntime.jsx(
2695
- Root$m,
1925
+ Box,
2696
1926
  {
2697
1927
  "data-ui": "Inline",
2698
1928
  ...restProps,
2699
- $space: useArrayProp(space),
2700
- forwardedAs: as,
1929
+ align: "center",
1930
+ as,
1931
+ display: "flex",
1932
+ gap: space,
2701
1933
  ref,
1934
+ wrap: "wrap",
2702
1935
  children
2703
1936
  }
2704
1937
  );
2705
1938
  });
2706
1939
  Inline.displayName = "ForwardRef(Inline)";
2707
- function kbdStyle() {
2708
- return styledComponents.css`
2709
- --card-bg-color: var(--card-kbd-bg-color);
2710
- --card-border-color: var(--card-kbd-border-color);
2711
- --card-fg-color: var(--card-kbd-fg-color);
2712
-
2713
- box-shadow: inset 0 0 0 1px var(--card-border-color);
2714
- background: var(--card-bg-color);
2715
- font: inherit;
2716
-
2717
- vertical-align: top;
2718
-
2719
- &:not([hidden]) {
2720
- display: inline-block;
1940
+ const KBD = react.forwardRef(function(props, ref) {
1941
+ const {
1942
+ as = "kbd",
1943
+ children,
1944
+ className,
1945
+ display = "inline-block",
1946
+ fontSize: fontSize2 = 0,
1947
+ padding = 1,
1948
+ radius = 2,
1949
+ ...restProps
1950
+ } = props;
1951
+ return /* @__PURE__ */ jsxRuntime.jsx(
1952
+ Box,
1953
+ {
1954
+ "data-ui": "KBD",
1955
+ ...restProps,
1956
+ as,
1957
+ className: css$1.composeClassNames(className, css$1.kbd({ radius })),
1958
+ display,
1959
+ padding,
1960
+ ref,
1961
+ children: /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children })
2721
1962
  }
2722
- `;
2723
- }
2724
- const Root$l = styledComponents.styled.kbd(responsiveRadiusStyle, kbdStyle), KBD = react.forwardRef(function(props, ref) {
2725
- const { children, fontSize: fontSize2 = 0, padding = 1, radius = 2, ...restProps } = props;
2726
- return /* @__PURE__ */ jsxRuntime.jsx(Root$l, { "data-ui": "KBD", ...restProps, $radius: useArrayProp(radius), ref, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }) }) });
1963
+ );
2727
1964
  });
2728
1965
  KBD.displayName = "ForwardRef(KBD)";
2729
1966
  const origin = {
@@ -2783,8 +2020,8 @@ function getRoundedCommands(points) {
2783
2020
  function compileCommands(cmds) {
2784
2021
  return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
2785
2022
  }
2786
- const Root$k = styledComponents.styled.div(
2787
- ({ $w: w }) => styledComponents.css`
2023
+ const Root$a = styled.div(
2024
+ ({ $w: w }) => css`
2788
2025
  position: absolute;
2789
2026
  width: ${w}px;
2790
2027
  height: ${w}px;
@@ -2831,9 +2068,9 @@ const Root$k = styledComponents.styled.div(
2831
2068
  }
2832
2069
  }
2833
2070
  `
2834
- ), StrokePath = styledComponents.styled.path`
2071
+ ), StrokePath = styled.path`
2835
2072
  stroke: var(--card-shadow-outline-color);
2836
- `, ShapePath = styledComponents.styled.path`
2073
+ `, ShapePath = styled.path`
2837
2074
  fill: var(--card-bg-color);
2838
2075
  `, Arrow = react.forwardRef(function(props, ref) {
2839
2076
  const { width: w, height: h, radius = 0, ...restProps } = props, { card } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [
@@ -2861,7 +2098,7 @@ const Root$k = styledComponents.styled.div(
2861
2098
  y: 0
2862
2099
  }
2863
2100
  ], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
2864
- return /* @__PURE__ */ jsxRuntime.jsx(Root$k, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
2101
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$a, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
2865
2102
  /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }),
2866
2103
  /* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
2867
2104
  /* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath })
@@ -3075,8 +2312,15 @@ function LayerProvider(props) {
3075
2312
  return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children });
3076
2313
  }
3077
2314
  LayerProvider.displayName = "LayerProvider";
3078
- const Root$j = styledComponents.styled.div({ position: "relative" }), LayerChildren = react.forwardRef(function(props, forwardedRef) {
3079
- const { children, onActivate, onFocus, style = EMPTY_RECORD, ...restProps } = props, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
2315
+ const LayerChildren = react.forwardRef(function(props, forwardedRef) {
2316
+ const {
2317
+ children,
2318
+ onActivate,
2319
+ onFocus,
2320
+ position = "relative",
2321
+ style = EMPTY_RECORD,
2322
+ ...restProps
2323
+ } = props, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
3080
2324
  react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
3081
2325
  isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({ activeElement: lastFocusedRef.current }), isTopLayerRef.current = isTopLayer;
3082
2326
  }, [isTopLayer, onActivate]);
@@ -3088,7 +2332,18 @@ const Root$j = styledComponents.styled.div({ position: "relative" }), LayerChild
3088
2332
  },
3089
2333
  [isTopLayer, onFocus]
3090
2334
  );
3091
- return /* @__PURE__ */ jsxRuntime.jsx(Root$j, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: { ...style, zIndex }, children });
2335
+ return /* @__PURE__ */ jsxRuntime.jsx(
2336
+ Box,
2337
+ {
2338
+ "data-ui": "Layer",
2339
+ ...restProps,
2340
+ onFocus: handleFocus,
2341
+ position,
2342
+ ref,
2343
+ style: { ...style, zIndex },
2344
+ children
2345
+ }
2346
+ );
3092
2347
  }), Layer = react.forwardRef(function(props, ref) {
3093
2348
  const { children, zOffset = 1, ...restProps } = props;
3094
2349
  return /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(LayerChildren, { ...restProps, ref, children }) });
@@ -3117,7 +2372,7 @@ function Portal(props) {
3117
2372
  }
3118
2373
  Portal.displayName = "Portal";
3119
2374
  function PortalProvider(props) {
3120
- const { boundaryElement, children, element, __unstable_elements: elementsProp } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(
2375
+ const { boundaryElement, children, element, __unstable_elements: elementsProp } = props, elements2 = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(
3121
2376
  emptySubscribe,
3122
2377
  () => document.body,
3123
2378
  () => null
@@ -3125,8 +2380,8 @@ function PortalProvider(props) {
3125
2380
  version: 0,
3126
2381
  boundaryElement: boundaryElement || null,
3127
2382
  element: element || fallbackElement,
3128
- elements
3129
- }), [boundaryElement, element, elements, fallbackElement]);
2383
+ elements: elements2
2384
+ }), [boundaryElement, element, elements2, fallbackElement]);
3130
2385
  return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children });
3131
2386
  }
3132
2387
  PortalProvider.displayName = "PortalProvider";
@@ -3142,7 +2397,7 @@ function _isEqual(objA, objB) {
3142
2397
  const keysA = Object.keys(objA), keysB = Object.keys(objB);
3143
2398
  return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
3144
2399
  }
3145
- const Root$i = styledComponents.styled.div`
2400
+ const Root$9 = styled.div`
3146
2401
  display: block;
3147
2402
  width: 0;
3148
2403
  height: 0;
@@ -3151,12 +2406,12 @@ const Root$i = styledComponents.styled.div`
3151
2406
  overflow: clip;
3152
2407
  `, SrOnly = react.forwardRef(function(props, ref) {
3153
2408
  const { as, children } = props;
3154
- return /* @__PURE__ */ jsxRuntime.jsx(Root$i, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
2409
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$9, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
3155
2410
  });
3156
2411
  SrOnly.displayName = "ForwardRef(SrOnly)";
3157
- const Root$h = styledComponents.styled.div`
2412
+ const Root$8 = styled.div`
3158
2413
  position: relative;
3159
- `, ItemWrapper = styledComponents.styled.div`
2414
+ `, ItemWrapper = styled.div`
3160
2415
  position: absolute;
3161
2416
  left: 0;
3162
2417
  right: 0;
@@ -3202,7 +2457,7 @@ const Root$h = styledComponents.styled.div`
3202
2457
  const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3203
2458
  return /* @__PURE__ */ jsxRuntime.jsx(ItemWrapper, { style: { top: itemIndex * (itemHeight + space[gap]) }, children: node }, key2);
3204
2459
  }), [fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex]), wrapperStyle = react.useMemo(() => ({ height }), [height]);
3205
- return /* @__PURE__ */ jsxRuntime.jsx(Root$h, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }) });
2460
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$8, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }) });
3206
2461
  });
3207
2462
  VirtualList.displayName = "ForwardRef(VirtualList)";
3208
2463
  const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
@@ -3224,7 +2479,7 @@ function size(options) {
3224
2479
  return {
3225
2480
  name: "@sanity/ui/size",
3226
2481
  async fn(args) {
3227
- const { elements, placement, platform, rects } = args, { floating, reference } = rects, overflow = await reactDom$1.detectOverflow(args, {
2482
+ const { elements: elements2, placement, platform, rects } = args, { floating, reference } = rects, overflow = await reactDom$1.detectOverflow(args, {
3228
2483
  altBoundary: !0,
3229
2484
  boundary: options.boundaryElement || void 0,
3230
2485
  elementContext: "floating",
@@ -3236,10 +2491,10 @@ function size(options) {
3236
2491
  placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom)), apply({
3237
2492
  availableWidth: maxWidth - margins[1] - margins[3],
3238
2493
  availableHeight: maxHeight - margins[0] - margins[2],
3239
- elements,
2494
+ elements: elements2,
3240
2495
  referenceWidth: reference.width - margins[1] - margins[3]
3241
2496
  });
3242
- const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
2497
+ const nextDimensions = await platform.getDimensions(elements2.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
3243
2498
  return floatingW !== targetW || floatingH !== targetH ? { reset: { rects: !0 } } : {};
3244
2499
  }
3245
2500
  };
@@ -3256,18 +2511,7 @@ function calcMaxWidth(params) {
3256
2511
  (boundaryWidth || 1 / 0) - DEFAULT_POPOVER_PADDING * 2
3257
2512
  );
3258
2513
  }
3259
- const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3260
- &:not([hidden]) {
3261
- display: flex;
3262
- }
3263
- flex-direction: column;
3264
- width: max-content;
3265
- min-width: min-content;
3266
- & > * {
3267
- opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
3268
- will-change: opacity;
3269
- }
3270
- `, PopoverCard = react.memo(
2514
+ const MotionCard$1 = framerMotion.motion(Card), PopoverCard = react.memo(
3271
2515
  react.forwardRef(function(props, ref) {
3272
2516
  const {
3273
2517
  __unstable_margins: marginsProp,
@@ -3320,6 +2564,7 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3320
2564
  return /* @__PURE__ */ jsxRuntime.jsxs(
3321
2565
  MotionCard$1,
3322
2566
  {
2567
+ className: "popover-card",
3323
2568
  "data-ui": "Popover",
3324
2569
  ...restProps,
3325
2570
  "data-placement": placement,
@@ -3367,21 +2612,21 @@ const Popover = react.memo(
3367
2612
  onActivate,
3368
2613
  open,
3369
2614
  overflow = "hidden",
3370
- padding: paddingProp,
2615
+ padding,
3371
2616
  placement: placementProp = "bottom",
3372
2617
  portal,
3373
2618
  preventOverflow = !0,
3374
- radius: radiusProp = 3,
2619
+ radius = 3,
3375
2620
  referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
3376
2621
  referenceElement,
3377
2622
  scheme,
3378
- shadow: shadowProp = 3,
2623
+ shadow = 3,
3379
2624
  tone = "inherit",
3380
2625
  width: widthProp = "auto",
3381
2626
  zOffset: zOffsetProp = layer.popover.zOffset,
3382
2627
  updateRef,
3383
2628
  ...restProps
3384
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
2629
+ } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
3385
2630
  react.useImperativeHandle(
3386
2631
  forwardedRef,
3387
2632
  () => ref.current
@@ -3416,13 +2661,13 @@ const Popover = react.memo(
3416
2661
  })
3417
2662
  ), ret.push(reactDom$1.offset({ mainAxis: DEFAULT_POPOVER_DISTANCE })), (constrainSize || matchReferenceWidth) && ret.push(
3418
2663
  size({
3419
- apply({ availableWidth, availableHeight, elements, referenceWidth }) {
2664
+ apply({ availableWidth, availableHeight, elements: elements2, referenceWidth }) {
3420
2665
  referenceWidthRef.current = referenceWidth;
3421
2666
  const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
3422
- matchReferenceWidth ? elements.floating.style.width = `${referenceWidth}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(
2667
+ matchReferenceWidth ? elements2.floating.style.width = `${referenceWidth}px` : _currentWidth !== void 0 && (elements2.floating.style.width = `${_currentWidth}px`), constrainSize && (elements2.floating.style.maxWidth = `${Math.min(
3423
2668
  availableWidth,
3424
2669
  _maxWidth ?? 1 / 0
3425
- )}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
2670
+ )}px`, elements2.floating.style.maxHeight = `${availableHeight}px`);
3426
2671
  },
3427
2672
  boundaryElement: floatingBoundary || void 0,
3428
2673
  constrainSize,
@@ -3476,11 +2721,11 @@ const Popover = react.memo(
3476
2721
  typeof childRef == "function" ? childRef(node) : childRef && (childRef.current = node);
3477
2722
  },
3478
2723
  [childProp, refs]
3479
- ), child = react.useMemo(() => childProp ? react.cloneElement(childProp, { ref: referenceElement ? void 0 : setReference }) : null, [childProp, referenceElement, setReference]);
2724
+ ), child = react.useMemo(() => !childProp || referenceElement ? null : react.cloneElement(childProp, { ref: setReference }), [childProp, referenceElement, setReference]);
3480
2725
  if (react.useEffect(() => {
3481
2726
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
3482
2727
  }, [update, updateRef]), react.useEffect(() => {
3483
- referenceElement && refs.setReference(referenceElement);
2728
+ child || refs.setReference(referenceElement || null);
3484
2729
  }, [referenceElement, refs, child]), disabled)
3485
2730
  return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
3486
2731
  const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3523,7 +2768,7 @@ function getElementRef(element) {
3523
2768
  return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
3524
2769
  }
3525
2770
  function radioBaseStyle() {
3526
- return styledComponents.css`
2771
+ return css`
3527
2772
  position: relative;
3528
2773
 
3529
2774
  &:not([hidden]) {
@@ -3537,7 +2782,7 @@ function radioBaseStyle() {
3537
2782
  }
3538
2783
  function inputElementStyle(props) {
3539
2784
  const { color, input } = theme.getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
3540
- return styledComponents.css`
2785
+ return css`
3541
2786
  appearance: none;
3542
2787
  position: absolute;
3543
2788
  top: 0;
@@ -3630,14 +2875,14 @@ function inputElementStyle(props) {
3630
2875
  }
3631
2876
  `;
3632
2877
  }
3633
- const Root$g = styledComponents.styled.div(radioBaseStyle), Input$4 = styledComponents.styled.input(inputElementStyle), Radio = react.forwardRef(function(props, forwardedRef) {
2878
+ const Root$7 = styled.div(radioBaseStyle), Input$2 = styled.input(inputElementStyle), Radio = react.forwardRef(function(props, forwardedRef) {
3634
2879
  const { className, disabled, style, customValidity, readOnly, ...restProps } = props, ref = react.useRef(null);
3635
2880
  return react.useImperativeHandle(
3636
2881
  forwardedRef,
3637
2882
  () => ref.current
3638
- ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$g, { className, "data-ui": "Radio", style, children: [
2883
+ ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { className, "data-ui": "Radio", style, children: [
3639
2884
  /* @__PURE__ */ jsxRuntime.jsx(
3640
- Input$4,
2885
+ Input$2,
3641
2886
  {
3642
2887
  "data-read-only": !disabled && readOnly ? "" : void 0,
3643
2888
  "data-error": customValidity ? "" : void 0,
@@ -3653,7 +2898,7 @@ const Root$g = styledComponents.styled.div(radioBaseStyle), Input$4 = styledComp
3653
2898
  });
3654
2899
  Radio.displayName = "ForwardRef(Radio)";
3655
2900
  function rootStyle() {
3656
- return styledComponents.css`
2901
+ return css`
3657
2902
  position: relative;
3658
2903
  width: -moz-available;
3659
2904
  width: -webkit-fill-available;
@@ -3666,7 +2911,7 @@ function rootStyle() {
3666
2911
  }
3667
2912
  function inputBaseStyle(props) {
3668
2913
  const { font } = theme.getTheme_v2(props.theme);
3669
- return styledComponents.css`
2914
+ return css`
3670
2915
  -webkit-font-smoothing: antialiased;
3671
2916
  appearance: none;
3672
2917
  border: 0;
@@ -3683,7 +2928,7 @@ function inputBaseStyle(props) {
3683
2928
  }
3684
2929
  function inputColorStyle(props) {
3685
2930
  const { color, input } = theme.getTheme_v2(props.theme);
3686
- return styledComponents.css`
2931
+ return css`
3687
2932
  /* enabled */
3688
2933
  background-color: ${color.input.default.enabled.bg};
3689
2934
  color: ${color.input.default.enabled.fg};
@@ -3755,7 +3000,7 @@ function inputStyle() {
3755
3000
  }
3756
3001
  function iconBoxStyle(props) {
3757
3002
  const { color } = theme.getTheme_v2(props.theme);
3758
- return styledComponents.css`
3003
+ return css`
3759
3004
  pointer-events: none;
3760
3005
  position: absolute;
3761
3006
  top: 0;
@@ -3786,7 +3031,7 @@ const selectStyle = {
3786
3031
  root: rootStyle,
3787
3032
  input: inputStyle,
3788
3033
  iconBox: iconBoxStyle
3789
- }, Root$f = styledComponents.styled.div(selectStyle.root), Input$3 = styledComponents.styled.select(selectStyle.input), IconBox = styledComponents.styled(Box)(selectStyle.iconBox), Select = react.forwardRef(function(props, forwardedRef) {
3034
+ }, Root$6 = styled.div(selectStyle.root), Input$1 = styled.select(selectStyle.input), IconBox = styled(Box)(selectStyle.iconBox), Select = react.forwardRef(function(props, forwardedRef) {
3790
3035
  const {
3791
3036
  children,
3792
3037
  customValidity,
@@ -3801,9 +3046,9 @@ const selectStyle = {
3801
3046
  return react.useImperativeHandle(
3802
3047
  forwardedRef,
3803
3048
  () => ref.current
3804
- ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$f, { "data-ui": "Select", children: [
3049
+ ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(Root$6, { "data-ui": "Select", children: [
3805
3050
  /* @__PURE__ */ jsxRuntime.jsx(
3806
- Input$3,
3051
+ Input$1,
3807
3052
  {
3808
3053
  "data-read-only": !disabled && readOnly ? "" : void 0,
3809
3054
  "data-ui": "Select",
@@ -3821,223 +3066,83 @@ const selectStyle = {
3821
3066
  ] });
3822
3067
  });
3823
3068
  Select.displayName = "ForwardRef(Select)";
3824
- const BASE_STYLE = {
3825
- "&&:not([hidden])": {
3826
- display: "grid"
3827
- },
3828
- '&[data-as="ul"],&[data-as="ol"]': {
3829
- listStyle: "none"
3830
- },
3831
- gridTemplateColumns: "minmax(0, 1fr)",
3832
- gridAutoRows: "min-content"
3833
- };
3834
- function stackBaseStyle() {
3835
- return BASE_STYLE;
3836
- }
3837
- function responsiveStackSpaceStyle(props) {
3838
- const { media, space } = theme.getTheme_v2(props.theme);
3839
- return _responsive(media, props.$space, (spaceIndex) => ({
3840
- gridGap: rem(space[spaceIndex])
3841
- }));
3842
- }
3843
- const Root$e = styledComponents.styled(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = react.forwardRef(function(props, ref) {
3069
+ const Stack = react.forwardRef(function(props, ref) {
3844
3070
  const { as, space, ...restProps } = props;
3845
3071
  return /* @__PURE__ */ jsxRuntime.jsx(
3846
- Root$e,
3072
+ Box,
3847
3073
  {
3074
+ as,
3848
3075
  "data-as": typeof as == "string" ? as : void 0,
3849
3076
  "data-ui": "Stack",
3850
3077
  ...restProps,
3851
- $space: useArrayProp(space),
3078
+ direction: "column",
3079
+ display: "flex",
3852
3080
  forwardedAs: as,
3081
+ gapY: space,
3853
3082
  ref
3854
3083
  }
3855
3084
  );
3856
3085
  });
3857
3086
  Stack.displayName = "ForwardRef(Stack)";
3858
- function switchBaseStyles() {
3859
- return styledComponents.css`
3860
- position: relative;
3861
- &:not([hidden]) {
3862
- display: inline-block;
3863
- }
3864
- `;
3865
- }
3866
- function switchInputStyles() {
3867
- return styledComponents.css`
3868
- position: absolute;
3869
- top: 0;
3870
- right: 0;
3871
- bottom: 0;
3872
- left: 0;
3873
- opacity: 0;
3874
- height: 100%;
3875
- width: 100%;
3876
- outline: none;
3877
- padding: 0;
3878
- margin: 0;
3879
-
3880
- /* Place the input element above the representation element */
3881
- z-index: 1;
3882
- `;
3883
- }
3884
- function switchRepresentationStyles(props) {
3885
- const { color, input } = theme.getTheme_v2(props.theme);
3886
- return styledComponents.css`
3887
- --switch-bg-color: ${color.input.default.enabled.border};
3888
- --switch-fg-color: ${color.input.default.enabled.bg};
3889
- --switch-box-shadow: none;
3890
-
3891
- &:not([hidden]) {
3892
- display: block;
3893
- }
3894
- position: relative;
3895
- width: ${rem(input.switch.width)};
3896
- height: ${rem(input.switch.height)};
3897
- border-radius: ${rem(input.switch.height / 2)};
3898
-
3899
- /* Make sure it’s not possible to interact with the wrapper element */
3900
- pointer-events: none;
3901
-
3902
- &:after {
3903
- content: '';
3904
- display: block;
3905
- position: absolute;
3906
- top: 0;
3907
- left: 0;
3908
- right: 0;
3909
- bottom: 0;
3910
- z-index: 1;
3911
- box-shadow: var(--switch-box-shadow);
3912
- border-radius: inherit;
3913
- }
3914
-
3915
- /* Focus styles */
3916
- input:focus + && {
3917
- --switch-box-shadow: ${focusRingStyle({ focusRing: input.switch.focusRing })};
3918
- }
3919
-
3920
- input:focus:not(:focus-visible) + && {
3921
- --switch-box-shadow: none;
3922
- }
3923
-
3924
- input:checked + && {
3925
- --switch-bg-color: ${color.input.default.enabled.fg};
3926
- --switch-fg-color: ${color.input.default.enabled.bg};
3927
- }
3928
-
3929
- @media (hover: hover) {
3930
- input:not(:disabled):hover + && {
3931
- --switch-bg-color: ${color.input.default.hovered.border};
3932
- --switch-fg-color: ${color.input.default.hovered.bg};
3933
- }
3934
-
3935
- input:not(:disabled):checked:hover + && {
3936
- --switch-bg-color: ${color.input.default.enabled.fg};
3937
- --switch-fg-color: ${color.input.default.enabled.bg};
3938
- }
3939
- }
3940
-
3941
- input:not([data-read-only]):disabled + && {
3942
- --switch-bg-color: ${color.input.default.disabled.border};
3943
- --switch-fg-color: ${color.input.default.disabled.bg};
3944
- }
3945
-
3946
- input[data-read-only]:disabled + && {
3947
- --switch-bg-color: ${color.input.default.readOnly.border};
3948
- --switch-fg-color: ${color.input.default.readOnly.bg};
3949
- }
3950
-
3951
- input:checked[data-read-only]:disabled + && {
3952
- --switch-bg-color: ${color.input.default.readOnly.fg};
3953
- --switch-fg-color: ${color.input.default.readOnly.bg};
3954
- }
3955
- `;
3956
- }
3957
- function switchTrackStyles(props) {
3958
- const { input } = theme.getTheme_v2(props.theme);
3959
- return styledComponents.css`
3960
- &:not([hidden]) {
3961
- display: block;
3962
- }
3963
- background-color: var(--switch-bg-color);
3964
- position: absolute;
3965
- left: 0;
3966
- top: 0;
3967
- width: ${rem(input.switch.width)};
3968
- height: ${rem(input.switch.height)};
3969
- border-radius: ${rem(input.switch.height / 2)};
3970
- `;
3971
- }
3972
- function switchThumbStyles(props) {
3973
- const { $indeterminate } = props, { input } = theme.getTheme_v2(props.theme), trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size2 = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size2, indeterminateOffset = trackWidth / 2 - size2 / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
3974
- return styledComponents.css`
3975
- &:not([hidden]) {
3976
- display: block;
3977
- }
3978
- position: absolute;
3979
- left: ${rem(trackPadding)};
3980
- top: ${rem(trackPadding)};
3981
- height: ${rem(size2)};
3982
- width: ${rem(size2)};
3983
- border-radius: ${rem(size2 / 2)};
3984
- transition-property: transform;
3985
- transition-duration: ${input.switch.transitionDurationMs}ms;
3986
- transition-timing-function: ${input.switch.transitionTimingFunction};
3987
- background: var(--switch-fg-color);
3988
- transform: translate3d(0, 0, 0);
3989
- box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
3990
-
3991
- ${checked && styledComponents.css`
3992
- transform: translate3d(${checkedOffset}px, 0, 0);
3993
- `}
3994
-
3995
- ${$indeterminate && styledComponents.css`
3996
- transform: translate3d(${indeterminateOffset}px, 0, 0);
3997
- `}
3998
- `;
3999
- }
4000
- const Root$d = styledComponents.styled.span(switchBaseStyles), Input$2 = styledComponents.styled.input(switchInputStyles), Representation = styledComponents.styled.span(switchRepresentationStyles), Track = styledComponents.styled.span(switchTrackStyles), Thumb = styledComponents.styled.span(switchThumbStyles), Switch = react.forwardRef(function(props, forwardedRef) {
3087
+ const Switch = react.forwardRef(function(props, forwardedRef) {
4001
3088
  const { checked, className, disabled, indeterminate, readOnly, style, ...restProps } = props, ref = react.useRef(null);
4002
3089
  return react.useImperativeHandle(
4003
3090
  forwardedRef,
4004
3091
  () => ref.current
4005
3092
  ), react.useEffect(() => {
4006
3093
  ref.current && (ref.current.indeterminate = indeterminate || !1);
4007
- }, [indeterminate]), /* @__PURE__ */ jsxRuntime.jsxs(Root$d, { className, "data-ui": "Switch", style, children: [
4008
- /* @__PURE__ */ jsxRuntime.jsx(
4009
- Input$2,
4010
- {
4011
- "data-read-only": !disabled && readOnly ? "" : void 0,
4012
- ...restProps,
4013
- checked: indeterminate !== !0 && checked,
4014
- disabled: disabled || readOnly,
4015
- type: "checkbox",
4016
- ref
4017
- }
4018
- ),
4019
- /* @__PURE__ */ jsxRuntime.jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
4020
- /* @__PURE__ */ jsxRuntime.jsx(Track, {}),
4021
- /* @__PURE__ */ jsxRuntime.jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
4022
- ] })
4023
- ] });
3094
+ }, [indeterminate]), /* @__PURE__ */ jsxRuntime.jsxs(
3095
+ Box,
3096
+ {
3097
+ className: css$1.composeClassNames(className, css$1._switch()),
3098
+ "data-ui": "Switch",
3099
+ display: "inline-block",
3100
+ position: "relative",
3101
+ style,
3102
+ children: [
3103
+ /* @__PURE__ */ jsxRuntime.jsx(
3104
+ "input",
3105
+ {
3106
+ "data-read-only": !disabled && readOnly ? "" : void 0,
3107
+ ...restProps,
3108
+ checked: indeterminate !== !0 && checked,
3109
+ className: "switch-input",
3110
+ disabled: disabled || readOnly,
3111
+ type: "checkbox",
3112
+ ref
3113
+ }
3114
+ ),
3115
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": !0, className: "switch-presentation", "data-name": "representation", children: [
3116
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "switch-track" }),
3117
+ /* @__PURE__ */ jsxRuntime.jsx(
3118
+ "span",
3119
+ {
3120
+ className: "switch-thumb",
3121
+ "data-checked": checked ? "" : void 0,
3122
+ "data-indeterminate": indeterminate ? "" : void 0
3123
+ }
3124
+ )
3125
+ ] })
3126
+ ]
3127
+ }
3128
+ );
4024
3129
  });
4025
3130
  Switch.displayName = "ForwardRef(Switch)";
4026
- const Root$c = styledComponents.styled.span(textInputRootStyle), InputRoot$1 = styledComponents.styled.span`
3131
+ const Root$5 = styled.span(textInputRootStyle), InputRoot = styled.span`
4027
3132
  flex: 1;
4028
3133
  min-width: 0;
4029
3134
  display: block;
4030
3135
  position: relative;
4031
- `, Input$1 = styledComponents.styled.textarea(
3136
+ `, Input = styled.textarea(
4032
3137
  responsiveInputPaddingStyle,
4033
3138
  textInputBaseStyle,
4034
3139
  textInputFontSizeStyle
4035
- ), Presentation$1 = styledComponents.styled.div(
3140
+ ), Presentation = styled.div(
4036
3141
  responsiveRadiusStyle,
4037
3142
  textInputRepresentationStyle
4038
3143
  ), TextArea = react.forwardRef(function(props, forwardedRef) {
4039
3144
  const {
4040
- border: border2 = !0,
3145
+ border = !0,
4041
3146
  customValidity,
4042
3147
  disabled = !1,
4043
3148
  fontSize: fontSize2 = 2,
@@ -4050,9 +3155,9 @@ const Root$c = styledComponents.styled.span(textInputRootStyle), InputRoot$1 = s
4050
3155
  return react.useImperativeHandle(
4051
3156
  forwardedRef,
4052
3157
  () => ref.current
4053
- ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsx(Root$c, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxRuntime.jsxs(InputRoot$1, { children: [
3158
+ ), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsx(Root$5, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
4054
3159
  /* @__PURE__ */ jsxRuntime.jsx(
4055
- Input$1,
3160
+ Input,
4056
3161
  {
4057
3162
  "data-as": "textarea",
4058
3163
  "data-scheme": rootTheme.scheme,
@@ -4069,13 +3174,13 @@ const Root$c = styledComponents.styled.span(textInputRootStyle), InputRoot$1 = s
4069
3174
  }
4070
3175
  ),
4071
3176
  /* @__PURE__ */ jsxRuntime.jsx(
4072
- Presentation$1,
3177
+ Presentation,
4073
3178
  {
4074
3179
  $radius: useArrayProp(radius),
4075
3180
  $unstableDisableFocusRing: __unstable_disableFocusRing,
4076
3181
  $scheme: rootTheme.scheme,
4077
3182
  $tone: rootTheme.tone,
4078
- "data-border": border2 ? "" : void 0,
3183
+ "data-border": border ? "" : void 0,
4079
3184
  "data-scheme": rootTheme.scheme,
4080
3185
  "data-tone": rootTheme.tone
4081
3186
  }
@@ -4083,55 +3188,20 @@ const Root$c = styledComponents.styled.span(textInputRootStyle), InputRoot$1 = s
4083
3188
  ] }) });
4084
3189
  });
4085
3190
  TextArea.displayName = "ForwardRef(TextArea)";
4086
- const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(Card).attrs({ forwardedAs: "span" })(textInputRootStyle), InputRoot = styledComponents.styled.span`
4087
- flex: 1;
4088
- min-width: 0;
4089
- display: block;
4090
- position: relative;
4091
- `, Prefix = styledComponents.styled(Card).attrs({ forwardedAs: "span" })`
4092
- border-top-right-radius: 0;
4093
- border-bottom-right-radius: 0;
4094
-
4095
- & > span {
4096
- display: block;
4097
- margin: -1px;
4098
- }
4099
- `, Suffix = styledComponents.styled(Card).attrs({ forwardedAs: "span" })`
4100
- border-top-left-radius: 0;
4101
- border-bottom-left-radius: 0;
4102
-
4103
- & > span {
4104
- display: block;
4105
- margin: -1px;
4106
- }
4107
- `, Input = styledComponents.styled.input(
4108
- responsiveInputPaddingStyle,
4109
- textInputBaseStyle,
4110
- textInputFontSizeStyle
4111
- ), Presentation = styledComponents.styled.span(
4112
- responsiveRadiusStyle,
4113
- textInputRepresentationStyle
4114
- ), LeftBox = styledComponents.styled(Box)`
4115
- position: absolute;
4116
- top: 0;
4117
- left: 0;
4118
- `, RightBox = styledComponents.styled(Box)`
4119
- position: absolute;
4120
- top: 0;
4121
- right: 0;
4122
- `, RightCard = styledComponents.styled(Card)`
4123
- background-color: transparent;
4124
- position: absolute;
4125
- top: 0;
4126
- right: 0;
4127
- `, TextInputClearButton = styledComponents.styled(Button)({
3191
+ const CLEAR_BUTTON_BOX_STYLE = {
3192
+ backgroundColor: "transparent",
3193
+ top: 0,
3194
+ right: 0,
3195
+ zIndex: 2
3196
+ }, TextInputClearButton = styled(Button)({
4128
3197
  "&:not([hidden])": {
4129
3198
  display: "block"
4130
3199
  }
4131
3200
  }), TextInput = react.forwardRef(function(props, forwardedRef) {
4132
3201
  const {
4133
3202
  __unstable_disableFocusRing,
4134
- border: border2 = !0,
3203
+ border = !0,
3204
+ className,
4135
3205
  clearButton,
4136
3206
  disabled = !1,
4137
3207
  fontSize: fontSizeProp = 2,
@@ -4142,13 +3212,13 @@ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(C
4142
3212
  prefix,
4143
3213
  radius: radiusProp = 2,
4144
3214
  readOnly,
4145
- space: spaceProp = 3,
3215
+ space: _space = 3,
4146
3216
  suffix,
4147
3217
  customValidity,
4148
3218
  type = "text",
4149
- weight,
3219
+ weight: _width,
4150
3220
  ...restProps
4151
- } = props, ref = react.useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
3221
+ } = props, ref = react.useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), $hasClearButton = !!clearButton;
4152
3222
  react.useImperativeHandle(
4153
3223
  forwardedRef,
4154
3224
  () => ref.current
@@ -4161,27 +3231,40 @@ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(C
4161
3231
  },
4162
3232
  [onClear, ref]
4163
3233
  ), prefixNode = react.useMemo(
4164
- () => prefix && /* @__PURE__ */ jsxRuntime.jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }),
3234
+ () => prefix && /* @__PURE__ */ jsxRuntime.jsx(
3235
+ Card,
3236
+ {
3237
+ as: "span",
3238
+ borderTop: !0,
3239
+ borderLeft: !0,
3240
+ borderBottom: !0,
3241
+ className: "text-input-prefix",
3242
+ radius,
3243
+ sizing: "border",
3244
+ tone: "inherit",
3245
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix })
3246
+ }
3247
+ ),
4165
3248
  [prefix, radius]
4166
3249
  ), presentationNode = react.useMemo(
4167
3250
  () => /* @__PURE__ */ jsxRuntime.jsxs(
4168
- Presentation,
3251
+ Card,
4169
3252
  {
4170
- $hasPrefix,
4171
- $unstableDisableFocusRing: __unstable_disableFocusRing,
4172
- $hasSuffix,
4173
- $radius: radius,
4174
- $scheme: rootTheme.scheme,
4175
- $tone: rootTheme.tone,
4176
- "data-border": border2 ? "" : void 0,
3253
+ as: "span",
3254
+ border,
3255
+ className: "text-input-presentation",
3256
+ "data-border": border ? "" : void 0,
3257
+ "data-disable-focus-ring": __unstable_disableFocusRing ? "" : void 0,
4177
3258
  "data-scheme": rootTheme.scheme,
4178
3259
  "data-tone": rootTheme.tone,
3260
+ position: "absolute",
3261
+ radius,
4179
3262
  children: [
4180
- IconComponent && /* @__PURE__ */ jsxRuntime.jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
3263
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, position: "absolute", style: { top: 0, left: 0 }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4181
3264
  react.isValidElement(IconComponent) && IconComponent,
4182
3265
  ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
4183
3266
  ] }) }),
4184
- !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(RightBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
3267
+ !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, position: "absolute", style: { top: 0, right: 0 }, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4185
3268
  react.isValidElement(IconRightComponent) && IconRightComponent,
4186
3269
  ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
4187
3270
  ] }) })
@@ -4190,16 +3273,16 @@ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(C
4190
3273
  ),
4191
3274
  [
4192
3275
  __unstable_disableFocusRing,
4193
- border2,
3276
+ border,
4194
3277
  fontSize2,
4195
3278
  IconComponent,
4196
3279
  IconRightComponent,
4197
3280
  padding,
4198
3281
  radius,
4199
3282
  rootTheme,
4200
- $hasClearButton,
4201
- $hasPrefix,
4202
- $hasSuffix
3283
+ $hasClearButton
3284
+ // $hasPrefix,
3285
+ // $hasSuffix,
4203
3286
  ]
4204
3287
  ), clearButtonBoxPadding = react.useMemo(
4205
3288
  () => padding.map((v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2),
@@ -4212,10 +3295,10 @@ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(C
4212
3295
  [clearButton]
4213
3296
  ), clearButtonNode = react.useMemo(
4214
3297
  () => !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(
4215
- RightCard,
3298
+ Card,
4216
3299
  {
4217
- forwardedAs: "span",
4218
3300
  padding: clearButtonBoxPadding,
3301
+ position: "absolute",
4219
3302
  style: CLEAR_BUTTON_BOX_STYLE,
4220
3303
  tone: customValidity ? "critical" : "inherit",
4221
3304
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -4249,38 +3332,63 @@ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styledComponents.styled(C
4249
3332
  readOnly
4250
3333
  ]
4251
3334
  ), suffixNode = react.useMemo(
4252
- () => suffix && /* @__PURE__ */ jsxRuntime.jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }),
3335
+ () => suffix && /* @__PURE__ */ jsxRuntime.jsx(
3336
+ Card,
3337
+ {
3338
+ as: "span",
3339
+ borderTop: !0,
3340
+ borderRight: !0,
3341
+ borderBottom: !0,
3342
+ className: "text-input-suffix",
3343
+ radius,
3344
+ sizing: "border",
3345
+ tone: "inherit",
3346
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix })
3347
+ }
3348
+ ),
4253
3349
  [radius, suffix]
4254
3350
  );
4255
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4256
- prefixNode,
4257
- /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
4258
- /* @__PURE__ */ jsxRuntime.jsx(
4259
- Input,
4260
- {
4261
- "data-as": "input",
4262
- "data-scheme": rootTheme.scheme,
4263
- "data-tone": rootTheme.tone,
4264
- ...restProps,
4265
- $fontSize: fontSize2,
4266
- $iconLeft: $hasIcon,
4267
- $iconRight: $hasIconRight || $hasClearButton,
4268
- $padding: padding,
4269
- $scheme: rootTheme.scheme,
4270
- $space: space,
4271
- $tone: rootTheme.tone,
4272
- $weight: weight,
4273
- disabled,
4274
- readOnly,
4275
- ref,
4276
- type
4277
- }
4278
- ),
4279
- presentationNode,
4280
- clearButtonNode
4281
- ] }),
4282
- suffixNode
4283
- ] });
3351
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3352
+ Card,
3353
+ {
3354
+ align: "center",
3355
+ as: "span",
3356
+ className: css$1.composeClassNames(className, css$1.textInput({ size: fontSizeProp })),
3357
+ "data-ui": "TextInput",
3358
+ display: "flex",
3359
+ tone: rootTheme.tone,
3360
+ children: [
3361
+ prefixNode,
3362
+ /* @__PURE__ */ jsxRuntime.jsxs(
3363
+ Box,
3364
+ {
3365
+ as: "span",
3366
+ className: "text-input-wrapper",
3367
+ flex: 1,
3368
+ position: "relative",
3369
+ children: [
3370
+ /* @__PURE__ */ jsxRuntime.jsx(
3371
+ "input",
3372
+ {
3373
+ "data-as": "input",
3374
+ "data-scheme": rootTheme.scheme,
3375
+ "data-tone": rootTheme.tone,
3376
+ ...restProps,
3377
+ disabled,
3378
+ readOnly,
3379
+ ref,
3380
+ type
3381
+ }
3382
+ ),
3383
+ presentationNode,
3384
+ clearButtonNode
3385
+ ]
3386
+ }
3387
+ ),
3388
+ suffixNode
3389
+ ]
3390
+ }
3391
+ );
4284
3392
  });
4285
3393
  TextInput.displayName = "ForwardRef(TextInput)";
4286
3394
  function useDelayedState(initialState) {
@@ -4306,12 +3414,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4306
3414
  right: ["right-end", "right-start", "left", "top", "bottom"],
4307
3415
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
4308
3416
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
4309
- }, MotionCard = styledComponents.styled(framerMotion.motion(Card))`
4310
- & > * {
4311
- opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
4312
- will-change: opacity;
4313
- }
4314
- `, TooltipCard = react.memo(
3417
+ }, MotionCard = framerMotion.motion(Card), TooltipCard = react.memo(
4315
3418
  react.forwardRef(function(props, ref) {
4316
3419
  const {
4317
3420
  animate,
@@ -4351,6 +3454,8 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4351
3454
  {
4352
3455
  "data-ui": "Tooltip__card",
4353
3456
  ...restProps,
3457
+ "data-animate": animate ? "" : void 0,
3458
+ className: css$1.tooltipCard(),
4354
3459
  "data-placement": placement,
4355
3460
  padding,
4356
3461
  radius,
@@ -4400,14 +3505,13 @@ function TooltipDelayGroupProvider(props) {
4400
3505
  return /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children });
4401
3506
  }
4402
3507
  TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4403
- const Root$a = styledComponents.styled(Layer)`
4404
- pointer-events: none;
4405
- `, Tooltip = react.forwardRef(function(props, forwardedRef) {
3508
+ const Tooltip = react.forwardRef(function(props, forwardedRef) {
4406
3509
  const boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), {
4407
3510
  animate: _animate = !1,
4408
3511
  arrow: arrowProp = !1,
4409
3512
  boundaryElement = boundaryElementContext?.element,
4410
3513
  children: childProp,
3514
+ className,
4411
3515
  content,
4412
3516
  disabled,
4413
3517
  fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
@@ -4512,8 +3616,8 @@ const Root$a = styledComponents.styled(Layer)`
4512
3616
  },
4513
3617
  [update]
4514
3618
  ), setFloating = react.useCallback(
4515
- (node) => {
4516
- ref.current = node, refs.setFloating(node);
3619
+ (node2) => {
3620
+ ref.current = node2, refs.setFloating(node2);
4517
3621
  },
4518
3622
  [refs]
4519
3623
  ), childRef = react.useRef(null);
@@ -4540,11 +3644,12 @@ const Root$a = styledComponents.styled(Layer)`
4540
3644
  return setReferenceElement(childRef.current), () => setReferenceElement(null);
4541
3645
  }, [child]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4542
3646
  if (disabled) return child;
4543
- const tooltip = /* @__PURE__ */ jsxRuntime.jsx(
4544
- Root$a,
3647
+ const node = /* @__PURE__ */ jsxRuntime.jsx(
3648
+ Layer,
4545
3649
  {
4546
3650
  "data-ui": "Tooltip",
4547
3651
  ...restProps,
3652
+ className: css$1.composeClassNames(className, css$1.tooltip()),
4548
3653
  ref: setFloating,
4549
3654
  style: {
4550
3655
  ...floatingStyles,
@@ -4572,7 +3677,7 @@ const Root$a = styledComponents.styled(Layer)`
4572
3677
  }
4573
3678
  )
4574
3679
  }
4575
- ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip);
3680
+ ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: node }) : node);
4576
3681
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4577
3682
  animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
4578
3683
  child
@@ -4595,15 +3700,15 @@ function useCloseOnMouseLeave({
4595
3700
  return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
4596
3701
  }, [onMouseMove, showTooltip]);
4597
3702
  }
4598
- const Root$9 = styledComponents.styled.div`
3703
+ const Root$4 = styled.div`
4599
3704
  line-height: 0;
4600
- `, ListBox = styledComponents.styled(Box)`
3705
+ `, ListBox = styled(Box)`
4601
3706
  & > ul {
4602
3707
  list-style: none;
4603
3708
  padding: 0;
4604
3709
  margin: 0;
4605
3710
  }
4606
- `, rotate = styledComponents.keyframes`
3711
+ `, rotate = keyframes`
4607
3712
  from {
4608
3713
  transform: rotate(0deg);
4609
3714
  }
@@ -4611,7 +3716,7 @@ const Root$9 = styledComponents.styled.div`
4611
3716
  to {
4612
3717
  transform: rotate(360deg);
4613
3718
  }
4614
- `, AnimatedSpinnerIcon = styledComponents.styled(icons.SpinnerIcon)`
3719
+ `, AnimatedSpinnerIcon = styled(icons.SpinnerIcon)`
4615
3720
  animation: ${rotate} 500ms linear infinite;
4616
3721
  `;
4617
3722
  function AutocompleteOption(props) {
@@ -4655,7 +3760,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4655
3760
  "CapsLock"
4656
3761
  ], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = react.forwardRef(function(props, forwardedRef) {
4657
3762
  const {
4658
- border: border2 = !0,
3763
+ border = !0,
4659
3764
  customValidity,
4660
3765
  disabled,
4661
3766
  filterOption: filterOptionProp,
@@ -4709,13 +3814,13 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4709
3814
  setTimeout(() => {
4710
3815
  if (popoverMouseWithinRef.current)
4711
3816
  return;
4712
- const elements = (relatedElements || []).concat(
3817
+ const elements2 = (relatedElements || []).concat(
4713
3818
  rootElementRef.current ? [rootElementRef.current] : [],
4714
3819
  resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []
4715
3820
  );
4716
3821
  let focusInside = !1;
4717
3822
  if (document.activeElement) {
4718
- for (const e of elements)
3823
+ for (const e of elements2)
4719
3824
  if (e === document.activeElement || e.contains(document.activeElement)) {
4720
3825
  focusInside = !0;
4721
3826
  break;
@@ -4813,7 +3918,10 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4813
3918
  }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(
4814
3919
  () => padding.map((v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2),
4815
3920
  [padding]
4816
- ), openButtonPadding = react.useMemo(() => padding.map((v) => Math.max(v - 1, 0)), [padding]), openButtonProps = react.useMemo(
3921
+ ), openButtonPadding = react.useMemo(
3922
+ () => padding.map((v) => Math.max(v - 1, 0)),
3923
+ [padding]
3924
+ ), openButtonProps = react.useMemo(
4817
3925
  () => typeof openButton == "object" ? openButton : EMPTY_RECORD,
4818
3926
  [openButton]
4819
3927
  ), handleOpenClick = react.useCallback(
@@ -4857,7 +3965,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4857
3965
  autoCapitalize: "off",
4858
3966
  autoComplete: "off",
4859
3967
  autoCorrect: "off",
4860
- border: border2,
3968
+ border,
4861
3969
  clearButton,
4862
3970
  customValidity,
4863
3971
  disabled,
@@ -4974,7 +4082,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4974
4082
  renderPopover
4975
4083
  ]);
4976
4084
  return /* @__PURE__ */ jsxRuntime.jsxs(
4977
- Root$9,
4085
+ Root$4,
4978
4086
  {
4979
4087
  "data-ui": "Autocomplete",
4980
4088
  onBlur: handleRootBlur,
@@ -4989,11 +4097,10 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
4989
4097
  );
4990
4098
  });
4991
4099
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
4992
- const Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.nav`
4993
- line-height: 0;
4994
- `, Breadcrumbs = react.forwardRef(function(props, ref) {
4100
+ const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(props, ref) {
4995
4101
  const {
4996
4102
  children,
4103
+ className,
4997
4104
  expandButton: expandButtonProps,
4998
4105
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4999
4106
  gap: _gapProp,
@@ -5042,60 +4149,21 @@ const Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.nav`
5042
4149
  }
5043
4150
  return rawItems;
5044
4151
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]), len = items.length;
5045
- return /* @__PURE__ */ jsxRuntime.jsx(Root$8, { "data-ui": "Breadcrumbs", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { align: "flex-start", as: "ol", gapX, gapY, wrap: "wrap", children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(Flex, { align: "flex-start", as: "li", gapX, gapY, children: [
5046
- /* @__PURE__ */ jsxRuntime.jsx(Box, { children: item }),
5047
- itemIndex < len - 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": !0, children: separator || /* @__PURE__ */ jsxRuntime.jsx(Text, { muted: !0, children: "/" }) })
5048
- ] }, itemIndex)) }) });
4152
+ return /* @__PURE__ */ jsxRuntime.jsx(
4153
+ "nav",
4154
+ {
4155
+ "data-ui": "Breadcrumbs",
4156
+ ...restProps,
4157
+ className: css$1.composeClassNames(className, css$1.breadcrumbs()),
4158
+ ref,
4159
+ children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { align: "flex-start", as: "ol", gapX, gapY, wrap: "wrap", children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(Flex, { align: "flex-start", as: "li", gapX, gapY, children: [
4160
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { children: item }),
4161
+ itemIndex < len - 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": !0, children: separator || /* @__PURE__ */ jsxRuntime.jsx(Text, { muted: !0, children: "/" }) })
4162
+ ] }, itemIndex)) })
4163
+ }
4164
+ );
5049
4165
  });
5050
4166
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
5051
- function dialogStyle({ theme: theme$1 }) {
5052
- const { color } = theme.getTheme_v2(theme$1);
5053
- return {
5054
- "&:not([hidden])": {
5055
- display: "flex"
5056
- },
5057
- top: 0,
5058
- left: 0,
5059
- right: 0,
5060
- bottom: 0,
5061
- alignItems: "center",
5062
- justifyContent: "center",
5063
- outline: "none",
5064
- background: color.backdrop
5065
- };
5066
- }
5067
- function responsiveDialogPositionStyle(props) {
5068
- const { media } = theme.getTheme_v2(props.theme);
5069
- return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
5070
- }
5071
- function animationDialogStyle(props) {
5072
- return props.$animate ? styledComponents.css`
5073
- @keyframes zoomIn {
5074
- from {
5075
- opacity: 0;
5076
- transform: scale(0.95);
5077
- }
5078
- to {
5079
- opacity: 1;
5080
- transform: scale(1);
5081
- }
5082
- }
5083
- @keyframes fadeIn {
5084
- from {
5085
- opacity: 0;
5086
- }
5087
- to {
5088
- opacity: 1;
5089
- }
5090
- }
5091
-
5092
- animation: fadeIn 200ms ease-out;
5093
- // Animates the dialog card.
5094
- & > [data-ui='DialogCard'] {
5095
- animation: zoomIn 200ms ease-out;
5096
- }
5097
- ` : styledComponents.css``;
5098
- }
5099
4167
  const DialogContext = createGlobalScopedContext(
5100
4168
  "@sanity/ui/context/dialog",
5101
4169
  { version: 0 }
@@ -5106,40 +4174,7 @@ function useDialog() {
5106
4174
  function isTargetWithinScope(boundaryElement, portalElement, target) {
5107
4175
  return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
5108
4176
  }
5109
- const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styledComponents.styled(Container)`
5110
- &:not([hidden]) {
5111
- display: flex;
5112
- }
5113
- width: 100%;
5114
- height: 100%;
5115
- flex-direction: column;
5116
- align-items: center;
5117
- justify-content: center;
5118
- `, DialogCardRoot = styledComponents.styled(Card)`
5119
- &:not([hidden]) {
5120
- display: flex;
5121
- }
5122
- width: 100%;
5123
- min-height: 0;
5124
- max-height: 100%;
5125
- overflow: hidden;
5126
- overflow: clip;
5127
- `, DialogLayout = styledComponents.styled(Flex)`
5128
- flex: 1;
5129
- min-height: 0;
5130
- width: 100%;
5131
- `, DialogHeader = styledComponents.styled(Box)`
5132
- position: relative;
5133
- z-index: 2;
5134
- `, DialogContent = styledComponents.styled(Box)`
5135
- position: relative;
5136
- z-index: 1;
5137
- overflow: auto;
5138
- outline: none;
5139
- `, DialogFooter = styledComponents.styled(Box)`
5140
- position: relative;
5141
- z-index: 3;
5142
- `, DialogCard = react.forwardRef(function(props, forwardedRef) {
4177
+ const DialogCard = react.forwardRef(function(props, forwardedRef) {
5143
4178
  const {
5144
4179
  __unstable_autoFocus: autoFocus,
5145
4180
  __unstable_hideCloseButton: hideCloseButton,
@@ -5176,33 +4211,68 @@ const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyl
5176
4211
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || onClickOutside();
5177
4212
  }),
5178
4213
  () => [ref.current]
5179
- ), /* @__PURE__ */ jsxRuntime.jsx(DialogContainer, { "data-ui": "DialogCard", width, children: /* @__PURE__ */ jsxRuntime.jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogLayout, { direction: "column", children: [
5180
- showHeader && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { align: "flex-start", padding: 3, children: [
5181
- /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
5182
- showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
5183
- Button,
4214
+ ), /* @__PURE__ */ jsxRuntime.jsx(
4215
+ Container,
4216
+ {
4217
+ align: "center",
4218
+ className: css$1.dialogContainer(),
4219
+ "data-ui": "DialogCard",
4220
+ direction: "column",
4221
+ display: "flex",
4222
+ justify: "center",
4223
+ width,
4224
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4225
+ Card,
5184
4226
  {
5185
- "aria-label": "Close dialog",
5186
- disabled: !onClose,
5187
- icon: icons.CloseIcon,
5188
- mode: "bleed",
5189
- onClick: onClose,
5190
- padding: 2
4227
+ className: css$1.dialogCardRoot(),
4228
+ display: "flex",
4229
+ radius,
4230
+ ref,
4231
+ scheme,
4232
+ shadow,
4233
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { className: css$1.dialogLayout(), direction: "column", flex: 1, children: [
4234
+ showHeader && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css$1.dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { align: "flex-start", padding: 3, children: [
4235
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
4236
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
4237
+ Button,
4238
+ {
4239
+ "aria-label": "Close dialog",
4240
+ disabled: !onClose,
4241
+ icon: icons.CloseIcon,
4242
+ mode: "bleed",
4243
+ onClick: onClose,
4244
+ padding: 2
4245
+ }
4246
+ ) })
4247
+ ] }) }),
4248
+ /* @__PURE__ */ jsxRuntime.jsx(
4249
+ Box,
4250
+ {
4251
+ className: css$1.dialogContent(),
4252
+ flex: 1,
4253
+ overflow: "auto",
4254
+ position: "relative",
4255
+ ref: contentRef,
4256
+ tabIndex: -1,
4257
+ children
4258
+ }
4259
+ ),
4260
+ footer && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css$1.dialogFooter(), position: "relative", children: footer })
4261
+ ] })
5191
4262
  }
5192
- ) })
5193
- ] }) }),
5194
- /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }),
5195
- footer && /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: footer })
5196
- ] }) }) });
4263
+ )
4264
+ }
4265
+ );
5197
4266
  });
5198
4267
  DialogCard.displayName = "ForwardRef(DialogCard)";
5199
4268
  const Dialog = react.forwardRef(function(props, ref) {
5200
- const dialog = useDialog(), { layer } = useTheme_v2(), {
4269
+ const context = useDialog(), { layer } = useTheme_v2(), {
5201
4270
  __unstable_autoFocus: autoFocus = !0,
5202
4271
  __unstable_hideCloseButton: hideCloseButton = !1,
5203
4272
  cardRadius: cardRadiusProp = 4,
5204
4273
  cardShadow = 3,
5205
4274
  children,
4275
+ className,
5206
4276
  contentRef,
5207
4277
  footer,
5208
4278
  header,
@@ -5211,15 +4281,15 @@ const Dialog = react.forwardRef(function(props, ref) {
5211
4281
  onClickOutside,
5212
4282
  onClose,
5213
4283
  onFocus,
5214
- padding: paddingProp = 3,
4284
+ padding = 3,
5215
4285
  portal: portalProp,
5216
- position: positionProp = dialog.position || "fixed",
4286
+ position: positionProp = context.position || "fixed",
5217
4287
  scheme,
5218
4288
  width: widthProp = 0,
5219
- zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
4289
+ zOffset: zOffsetProp = context.zOffset || layer.dialog.zOffset,
5220
4290
  animate: _animate = !1,
5221
4291
  ...restProps
5222
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null), handleFocus = react.useCallback(
4292
+ } = props, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null), handleFocus = react.useCallback(
5223
4293
  (event) => {
5224
4294
  onFocus?.(event);
5225
4295
  const target = event.target, cardElement = cardRef.current;
@@ -5249,19 +4319,21 @@ const Dialog = react.forwardRef(function(props, ref) {
5249
4319
  }, 0);
5250
4320
  }, [boundaryElement, portalElement]);
5251
4321
  return /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: portalProp, children: /* @__PURE__ */ jsxRuntime.jsxs(
5252
- Root$7,
4322
+ Layer,
5253
4323
  {
5254
4324
  ...restProps,
5255
- $animate: animate,
5256
- $padding: padding,
5257
- $position: position,
5258
4325
  "aria-labelledby": labelId,
5259
4326
  "aria-modal": !0,
4327
+ className: css$1.composeClassNames(className, css$1.dialog()),
4328
+ "data-animate": animate ? "" : void 0,
5260
4329
  "data-ui": "Dialog",
4330
+ display: "flex",
5261
4331
  id,
5262
4332
  onActivate,
5263
4333
  onClick: handleRootClick,
5264
4334
  onFocus: handleFocus,
4335
+ padding,
4336
+ position,
5265
4337
  ref,
5266
4338
  role: "dialog",
5267
4339
  zOffset,
@@ -5305,20 +4377,9 @@ function DialogProvider(props) {
5305
4377
  return /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children });
5306
4378
  }
5307
4379
  DialogProvider.displayName = "DialogProvider";
5308
- const Root$6 = styledComponents.styled.kbd`
5309
- font: inherit;
5310
- padding: 1px;
5311
-
5312
- &:not([hidden]) {
5313
- display: block;
5314
- }
5315
- `, Key = styledComponents.styled(KBD)`
5316
- &:not([hidden]) {
5317
- display: block;
5318
- }
5319
- `, Hotkeys = react.forwardRef(function(props, ref) {
4380
+ const Hotkeys = react.forwardRef(function(props, ref) {
5320
4381
  const { fontSize: fontSize2, keys, padding, radius, space: spaceProp = 0.5, ...restProps } = props, space = useArrayProp(spaceProp);
5321
- return !keys || keys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) : /* @__PURE__ */ jsxRuntime.jsx(Root$6, { "data-ui": "Hotkeys", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx(Inline, { as: "span", space, children: keys.map((key2, i) => /* @__PURE__ */ jsxRuntime.jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i)) }) });
4382
+ return !keys || keys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) : /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "kbd", "data-ui": "Hotkeys", ...restProps, display: "flex", gap: spaceProp, ref, children: /* @__PURE__ */ jsxRuntime.jsx(Inline, { as: "span", space, children: keys.map((key2, i) => /* @__PURE__ */ jsxRuntime.jsx(KBD, { display: "block", fontSize: fontSize2, padding, radius, children: key2 }, i)) }) });
5322
4383
  });
5323
4384
  Hotkeys.displayName = "ForwardRef(Hotkeys)";
5324
4385
  const MenuContext = createGlobalScopedContext(
@@ -5328,8 +4389,8 @@ const MenuContext = createGlobalScopedContext(
5328
4389
  function _isFocusable(element) {
5329
4390
  return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
5330
4391
  }
5331
- function _getFocusableElements(elements) {
5332
- return elements.filter(_isFocusable);
4392
+ function _getFocusableElements(elements2) {
4393
+ return elements2.filter(_isFocusable);
5333
4394
  }
5334
4395
  function _getDOMPath(rootElement, el) {
5335
4396
  const path = [];
@@ -5345,10 +4406,10 @@ function _getDOMPath(rootElement, el) {
5345
4406
  return path;
5346
4407
  }
5347
4408
  const EMPTY_PATH = [];
5348
- function _sortElements(rootElement, elements) {
4409
+ function _sortElements(rootElement, elements2) {
5349
4410
  if (!rootElement) return;
5350
4411
  const map = /* @__PURE__ */ new WeakMap();
5351
- for (const el of elements)
4412
+ for (const el of elements2)
5352
4413
  map.set(el, _getDOMPath(rootElement, el));
5353
4414
  const _sort = (a, b) => {
5354
4415
  const _a = map.get(a) || EMPTY_PATH, _b = map.get(b) || EMPTY_PATH, len = Math.max(_a.length, _b.length);
@@ -5359,7 +4420,7 @@ function _sortElements(rootElement, elements) {
5359
4420
  }
5360
4421
  return 0;
5361
4422
  };
5362
- elements.sort(_sort);
4423
+ elements2.sort(_sort);
5363
4424
  }
5364
4425
  function useMenuController(props) {
5365
4426
  const { onKeyDown, originElement, shouldFocus, rootElementRef } = props, elementsRef = react.useRef([]), [activeIndex, _setActiveIndex] = react.useState(-1), activeIndexRef = react.useRef(activeIndex), activeElement = react.useMemo(() => elementsRef.current[activeIndex] || null, [activeIndex]), mounted = !!rootElementRef.current, setActiveIndex = react.useCallback((nextActiveIndex) => {
@@ -5466,7 +4527,7 @@ function useMenuController(props) {
5466
4527
  mount
5467
4528
  };
5468
4529
  }
5469
- const Root$5 = styledComponents.styled(Box)`
4530
+ const Root$3 = styled(Box)`
5470
4531
  outline: none;
5471
4532
  overflow: auto;
5472
4533
  `, Menu = react.forwardRef(function(props, forwardedRef) {
@@ -5541,7 +4602,7 @@ const Root$5 = styledComponents.styled(Box)`
5541
4602
  ]
5542
4603
  );
5543
4604
  return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
5544
- Root$5,
4605
+ Root$3,
5545
4606
  {
5546
4607
  "data-ui": "Menu",
5547
4608
  ...restProps,
@@ -5686,114 +4747,25 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5686
4747
  return /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
5687
4748
  });
5688
4749
  MenuButton.displayName = "ForwardRef(MenuButton)";
5689
- const MenuDivider = styledComponents.styled.hr`
4750
+ const MenuDivider = styled.hr`
5690
4751
  height: 1px;
5691
4752
  border: 0;
5692
4753
  background: var(--card-hairline-soft-color);
5693
4754
  margin: 0;
5694
4755
  `;
5695
4756
  MenuDivider.displayName = "MenuDivider";
5696
- function selectableBaseStyle() {
5697
- return styledComponents.css`
5698
- background-color: inherit;
5699
- color: inherit;
5700
-
5701
- &[data-as='button'] {
5702
- -webkit-font-smoothing: inherit;
5703
- appearance: none;
5704
- outline: none;
5705
- font: inherit;
5706
- text-align: inherit;
5707
- border: 0;
5708
- width: -moz-available;
5709
- width: -webkit-fill-available;
5710
- width: stretch;
5711
- }
5712
-
5713
- /* &:is(a) */
5714
- &[data-as='a'] {
5715
- text-decoration: none;
5716
- }
5717
- `;
5718
- }
5719
- function selectableColorStyle(props) {
5720
- const { $tone } = props, { color, style } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
5721
- return styledComponents.css`
5722
- ${_cardColorStyle(color, tone.enabled)}
5723
-
5724
- background-color: var(--card-bg-color);
5725
- color: var(--card-fg-color);
5726
- outline: none;
5727
-
5728
- /* &:is(button) */
5729
- &[data-as='button'] {
5730
- &:disabled {
5731
- ${_cardColorStyle(color, tone.disabled)}
5732
- }
5733
-
5734
- &:not(:disabled) {
5735
- &[aria-pressed='true'] {
5736
- ${_cardColorStyle(color, tone.pressed)}
5737
- }
5738
-
5739
- &[data-selected],
5740
- &[aria-selected='true'] > & {
5741
- ${_cardColorStyle(color, tone.selected)}
5742
- }
5743
-
5744
- @media (hover: hover) {
5745
- &:not([data-selected]) {
5746
- &[data-hovered],
5747
- &:hover {
5748
- ${_cardColorStyle(color, tone.hovered)}
5749
- }
5750
-
5751
- &:active {
5752
- ${_cardColorStyle(color, tone.pressed)}
5753
- }
5754
- }
5755
- }
5756
- }
5757
- }
5758
-
5759
- /* &:is(a) */
5760
- &[data-as='a'] {
5761
- &[data-disabled] {
5762
- ${_cardColorStyle(color, tone.disabled)}
5763
- }
5764
-
5765
- &:not([data-disabled]) {
5766
- &[data-pressed] {
5767
- ${_cardColorStyle(color, tone.pressed)}
5768
- }
5769
-
5770
- &[data-selected] {
5771
- ${_cardColorStyle(color, tone.selected)}
5772
- }
5773
-
5774
- @media (hover: hover) {
5775
- &:not([data-selected]) {
5776
- &[data-hovered],
5777
- &:hover {
5778
- ${_cardColorStyle(color, tone.hovered)}
5779
- }
5780
- &:active {
5781
- ${_cardColorStyle(color, tone.pressed)}
5782
- }
5783
- }
5784
- }
5785
- }
4757
+ const Selectable = react.forwardRef(function(props, ref) {
4758
+ const { className, radius, tone, ...restProps } = props;
4759
+ return /* @__PURE__ */ jsxRuntime.jsx(
4760
+ Box,
4761
+ {
4762
+ ...restProps,
4763
+ className: css$1.composeClassNames(className, css$1.selectable({ radius, tone })),
4764
+ ref
5786
4765
  }
5787
-
5788
- ${style?.card?.root}
5789
- `;
5790
- }
5791
- const Selectable = styledComponents.styled(Box)(
5792
- responsiveRadiusStyle,
5793
- selectableBaseStyle,
5794
- selectableColorStyle
5795
- );
5796
- Selectable.displayName = "Selectable";
4766
+ );
4767
+ });
4768
+ Selectable.displayName = "ForwardRef(Selectable)";
5797
4769
  function useMenu() {
5798
4770
  const value = react.useContext(MenuContext);
5799
4771
  if (!value)
@@ -5816,7 +4788,7 @@ function MenuGroup(props) {
5816
4788
  text,
5817
4789
  tone = "default",
5818
4790
  ...restProps
5819
- } = props, menu = useMenu(), { scheme } = useRootTheme(), {
4791
+ } = props, menu = useMenu(), {
5820
4792
  activeElement,
5821
4793
  mount,
5822
4794
  onClickOutside,
@@ -5882,14 +4854,13 @@ function MenuGroup(props) {
5882
4854
  "aria-pressed": as === "button" ? withinMenu : void 0,
5883
4855
  "data-pressed": as !== "button" ? withinMenu : void 0,
5884
4856
  "data-selected": !withinMenu && active ? "" : void 0,
5885
- $radius: useArrayProp(radius),
5886
- $tone: tone,
5887
- $scheme: scheme,
5888
4857
  onClick: handleClick,
5889
4858
  onKeyDown: handleKeyDown,
5890
4859
  onMouseEnter: handleMouseEnter,
4860
+ radius,
5891
4861
  ref: setRootElement,
5892
4862
  tabIndex: -1,
4863
+ tone,
5893
4864
  type: as === "button" ? "button" : void 0,
5894
4865
  children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
5895
4866
  IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
@@ -5927,7 +4898,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5927
4898
  text,
5928
4899
  tone = "default",
5929
4900
  ...restProps
5930
- } = props, { scheme } = useRootTheme(), menu = useMenu(), {
4901
+ } = props, menu = useMenu(), {
5931
4902
  activeElement,
5932
4903
  mount,
5933
4904
  onItemClick,
@@ -5951,7 +4922,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5951
4922
  paddingLeft
5952
4923
  }),
5953
4924
  [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]
5954
- ), hotkeysFontSize = useArrayProp(fontSize2).map((s) => s - 1), setRef = react.useCallback((el) => {
4925
+ ), setRef = react.useCallback((el) => {
5955
4926
  ref.current = el, setRootElement(el);
5956
4927
  }, []);
5957
4928
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5960,14 +4931,11 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5960
4931
  "data-ui": "MenuItem",
5961
4932
  ...restProps,
5962
4933
  "aria-pressed": as === "button" && pressed,
4934
+ as,
5963
4935
  "data-pressed": as !== "button" && pressed ? "" : void 0,
5964
4936
  "data-selected": active ? "" : void 0,
5965
4937
  "data-disabled": disabled ? "" : void 0,
5966
- forwardedAs: as,
5967
- $radius: useArrayProp(radius),
5968
- $padding: useArrayProp(0),
5969
- $tone: disabled ? "default" : tone,
5970
- $scheme: scheme,
4938
+ radius,
5971
4939
  disabled,
5972
4940
  onClick: handleClick,
5973
4941
  onMouseEnter: onItemMouseEnter,
@@ -5975,6 +4943,7 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5975
4943
  ref: setRef,
5976
4944
  role: "menuitem",
5977
4945
  tabIndex: -1,
4946
+ tone,
5978
4947
  type: as === "button" ? "button" : void 0,
5979
4948
  children: [
5980
4949
  (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
@@ -5986,7 +4955,6 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5986
4955
  hotkeys && /* @__PURE__ */ jsxRuntime.jsx(
5987
4956
  Hotkeys,
5988
4957
  {
5989
- fontSize: hotkeysFontSize,
5990
4958
  keys: hotkeys,
5991
4959
  style: { marginTop: -4, marginBottom: -4 }
5992
4960
  }
@@ -6002,14 +4970,14 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
6002
4970
  );
6003
4971
  });
6004
4972
  MenuItem.displayName = "ForwardRef(MenuItem)";
6005
- const keyframe = styledComponents.keyframes`
4973
+ const keyframe = keyframes`
6006
4974
  0% {
6007
4975
  background-position: 100%;
6008
4976
  }
6009
4977
  100% {
6010
4978
  background-position: -100%;
6011
4979
  }
6012
- `, animation = styledComponents.css`
4980
+ `, animation = css`
6013
4981
  background-image: linear-gradient(
6014
4982
  to right,
6015
4983
  var(--card-skeleton-color-from),
@@ -6025,12 +4993,12 @@ const keyframe = styledComponents.keyframes`
6025
4993
  animation-timing-function: ease-in-out;
6026
4994
  animation-iteration-count: infinite;
6027
4995
  animation-duration: 2000ms;
6028
- `, skeletonStyle = styledComponents.css`
4996
+ `, skeletonStyle = css`
6029
4997
  opacity: ${({ $visible }) => $visible ? 1 : 0};
6030
4998
  transition: opacity 200ms ease-in;
6031
4999
 
6032
5000
  @media screen and (prefers-reduced-motion: no-preference) {
6033
- ${({ $animated }) => $animated ? animation : styledComponents.css`
5001
+ ${({ $animated }) => $animated ? animation : css`
6034
5002
  background-color: var(--card-skeleton-color-from);
6035
5003
  `}
6036
5004
  }
@@ -6038,7 +5006,7 @@ const keyframe = styledComponents.keyframes`
6038
5006
  @media screen and (prefers-reduced-motion: reduce) {
6039
5007
  background-color: var(--card-skeleton-color-from);
6040
5008
  }
6041
- `, Root$4 = styledComponents.styled(Box)(
5009
+ `, Root$2 = styled(Box)(
6042
5010
  responsiveRadiusStyle,
6043
5011
  skeletonStyle
6044
5012
  ), Skeleton = react.forwardRef(function(props, ref) {
@@ -6053,7 +5021,7 @@ const keyframe = styledComponents.keyframes`
6053
5021
  clearTimeout(timeout);
6054
5022
  };
6055
5023
  }, [delay]), /* @__PURE__ */ jsxRuntime.jsx(
6056
- Root$4,
5024
+ Root$2,
6057
5025
  {
6058
5026
  ...restProps,
6059
5027
  $animated: animated,
@@ -6064,7 +5032,7 @@ const keyframe = styledComponents.keyframes`
6064
5032
  );
6065
5033
  });
6066
5034
  Skeleton.displayName = "ForwardRef(Skeleton)";
6067
- const Root$3 = styledComponents.styled(Skeleton)((props) => {
5035
+ const Root$1 = styled(Skeleton)((props) => {
6068
5036
  const { $size, $style } = props, { font, media } = theme.getTheme_v2(props.theme), fontStyle = font[$style];
6069
5037
  return _responsive(media, $size, (sizeIndex) => {
6070
5038
  const fontSize2 = fontStyle.sizes[sizeIndex];
@@ -6072,27 +5040,25 @@ const Root$3 = styledComponents.styled(Skeleton)((props) => {
6072
5040
  });
6073
5041
  }), TextSkeleton = react.forwardRef(function(props, ref) {
6074
5042
  const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
6075
- return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "text" });
5043
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$1, { ...restProps, $size, ref, $style: "text" });
6076
5044
  });
6077
5045
  TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
6078
5046
  const LabelSkeleton = react.forwardRef(function(props, ref) {
6079
5047
  const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
6080
- return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "label" });
5048
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$1, { ...restProps, $size, ref, $style: "label" });
6081
5049
  });
6082
5050
  LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
6083
5051
  const HeadingSkeleton = react.forwardRef(function(props, ref) {
6084
5052
  const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
6085
- return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "heading" });
5053
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$1, { ...restProps, $size, ref, $style: "heading" });
6086
5054
  });
6087
5055
  HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
6088
5056
  const CodeSkeleton = react.forwardRef(function(props, ref) {
6089
5057
  const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
6090
- return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "code" });
5058
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$1, { ...restProps, $size, ref, $style: "code" });
6091
5059
  });
6092
5060
  CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
6093
- const CustomButton = styledComponents.styled(Button)`
6094
- max-width: 100%;
6095
- `, Tab = react.forwardRef(function(props, forwardedRef) {
5061
+ const Tab = react.forwardRef(function(props, forwardedRef) {
6096
5062
  const {
6097
5063
  icon,
6098
5064
  id,
@@ -6120,7 +5086,7 @@ const CustomButton = styledComponents.styled(Button)`
6120
5086
  return react.useEffect(() => {
6121
5087
  focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
6122
5088
  }, [focused]), /* @__PURE__ */ jsxRuntime.jsx(
6123
- CustomButton,
5089
+ Button,
6124
5090
  {
6125
5091
  "data-ui": "Tab",
6126
5092
  ...restProps,
@@ -6146,7 +5112,7 @@ Tab.displayName = "ForwardRef(Tab)";
6146
5112
  function _isReactElement(node) {
6147
5113
  return !!node;
6148
5114
  }
6149
- const CustomInline = styledComponents.styled(Inline)`
5115
+ const CustomInline = styled(Inline)`
6150
5116
  & > div {
6151
5117
  display: inline-block;
6152
5118
  vertical-align: middle;
@@ -6197,9 +5163,9 @@ const TabPanel = react.forwardRef(function(props, ref) {
6197
5163
  );
6198
5164
  });
6199
5165
  TabPanel.displayName = "ForwardRef(TabPanel)";
6200
- const TextBox = styledComponents.styled(Flex)`
5166
+ const TextBox = styled(Flex)`
6201
5167
  overflow-x: auto;
6202
- `, loadingAnimation = styledComponents.keyframes`
5168
+ `, loadingAnimation = keyframes`
6203
5169
  0% {
6204
5170
  width: 0;
6205
5171
  }
@@ -6209,7 +5175,7 @@ const TextBox = styledComponents.styled(Flex)`
6209
5175
  `, LOADING_BAR_HEIGHT = 2;
6210
5176
  function rootStyles(props) {
6211
5177
  const { color } = getTheme_v2.getTheme_v2(props.theme), loadingBarColor = color.button.default[props.tone].enabled.bg;
6212
- return props.$duration ? styledComponents.css`
5178
+ return props.$duration ? css`
6213
5179
  pointer-events: all;
6214
5180
  width: 100%;
6215
5181
  position: relative;
@@ -6231,7 +5197,7 @@ function rootStyles(props) {
6231
5197
  opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
6232
5198
  will-change: opacity;
6233
5199
  }
6234
- ` : styledComponents.css`
5200
+ ` : css`
6235
5201
  pointer-events: all;
6236
5202
  & > * {
6237
5203
  opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
@@ -6254,18 +5220,19 @@ const STATUS_CARD_TONE = {
6254
5220
  warning: "alert",
6255
5221
  success: "alert",
6256
5222
  info: "alert"
6257
- }, Root$2 = styledComponents.styled(Card)(
5223
+ }, Root = styled(Card)(
6258
5224
  rootStyles
6259
5225
  );
6260
5226
  function Toast(props) {
6261
5227
  const { closable, description, duration, onClose, radius = 3, title, status, ...restProps } = props, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status";
6262
5228
  return /* @__PURE__ */ jsxRuntime.jsx(
6263
- Root$2,
5229
+ Root,
6264
5230
  {
6265
5231
  "data-ui": "Toast",
6266
5232
  role,
6267
5233
  ...restProps,
6268
5234
  marginTop: 3,
5235
+ pointerEvents: "auto",
6269
5236
  radius,
6270
5237
  shadow: 2,
6271
5238
  tone: cardTone,
@@ -6303,21 +5270,7 @@ const subscribe = () => () => {
6303
5270
  }, ToastContext = createGlobalScopedContext(
6304
5271
  "@sanity/ui/context/toast",
6305
5272
  null
6306
- ), Root$1 = styledComponents.styled(Layer)`
6307
- position: fixed;
6308
- top: 0;
6309
- left: 0;
6310
- right: 0;
6311
- bottom: 0;
6312
- pointer-events: none;
6313
- `, ToastContainer = styledComponents.styled.div`
6314
- box-sizing: border-box;
6315
- position: absolute;
6316
- right: 0;
6317
- bottom: 0;
6318
- max-width: 420px;
6319
- width: 100%;
6320
- `;
5273
+ );
6321
5274
  let toastId = 0;
6322
5275
  function ToastProvider(props) {
6323
5276
  const { children, padding = 4, paddingX, paddingY, zOffset } = props, [state, _setState] = react.useState([]), toastsRef = react.useRef({}), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion(), variants = react.useMemo(
@@ -6372,29 +5325,55 @@ function ToastProvider(props) {
6372
5325
  []
6373
5326
  ), /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
6374
5327
  children,
6375
- mounted && /* @__PURE__ */ jsxRuntime.jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map(({ dismiss, id, params }) => /* @__PURE__ */ jsxRuntime.jsx(
6376
- framerMotion.motion.div,
5328
+ mounted && /* @__PURE__ */ jsxRuntime.jsx(
5329
+ Layer,
6377
5330
  {
6378
- layout: "position",
6379
- initial: "initial",
6380
- animate: "animate",
6381
- exit: "exit",
6382
- variants,
6383
- transition: prefersReducedMotion ? { duration: 0 } : { type: "spring", damping: 30, stiffness: 400 },
5331
+ className: void 0,
5332
+ "data-ui": "ToastProvider",
5333
+ inset: 0,
5334
+ pointerEvents: "none",
5335
+ position: "fixed",
5336
+ zOffset,
5337
+ width: "fill",
6384
5338
  children: /* @__PURE__ */ jsxRuntime.jsx(
6385
- Toast,
5339
+ Box,
6386
5340
  {
6387
- closable: params.closable,
6388
- description: params.description,
6389
- onClose: dismiss,
6390
- status: params.status,
6391
- title: params.title,
6392
- duration: params.duration
5341
+ className: void 0,
5342
+ position: "absolute",
5343
+ sizing: "border",
5344
+ style: {
5345
+ // todo: move to css
5346
+ right: 0,
5347
+ bottom: 0,
5348
+ maxWidth: 420
5349
+ },
5350
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map(({ dismiss, id, params }) => /* @__PURE__ */ jsxRuntime.jsx(
5351
+ framerMotion.motion.div,
5352
+ {
5353
+ layout: "position",
5354
+ initial: "initial",
5355
+ animate: "animate",
5356
+ exit: "exit",
5357
+ variants,
5358
+ transition: prefersReducedMotion ? { duration: 0 } : { type: "spring", damping: 30, stiffness: 400 },
5359
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5360
+ Toast,
5361
+ {
5362
+ closable: params.closable,
5363
+ description: params.description,
5364
+ onClose: dismiss,
5365
+ status: params.status,
5366
+ title: params.title,
5367
+ duration: params.duration
5368
+ }
5369
+ )
5370
+ },
5371
+ id
5372
+ )) }) })
6393
5373
  }
6394
5374
  )
6395
- },
6396
- id
6397
- )) }) }) }) })
5375
+ }
5376
+ )
6398
5377
  ] });
6399
5378
  }
6400
5379
  ToastProvider.displayName = "ToastProvider";
@@ -6584,92 +5563,6 @@ const TreeContext = createGlobalScopedContext(
6584
5563
  })
6585
5564
  );
6586
5565
  Tree.displayName = "Memo(ForwardRef(Tree))";
6587
- function treeItemRootStyle() {
6588
- return styledComponents.css`
6589
- &[role='none'] > [role='treeitem'] {
6590
- outline: none;
6591
- cursor: default;
6592
- border-radius: 3px;
6593
-
6594
- background-color: var(--card-bg-color);
6595
- color: var(--treeitem-fg-color);
6596
-
6597
- &:focus {
6598
- position: relative;
6599
- }
6600
- }
6601
-
6602
- &[role='treeitem'] {
6603
- outline: none;
6604
-
6605
- & > div {
6606
- cursor: default;
6607
- border-radius: 3px;
6608
-
6609
- background-color: var(--card-bg-color);
6610
- color: var(--treeitem-fg-color);
6611
- }
6612
-
6613
- &:focus > div {
6614
- position: relative;
6615
- }
6616
- }
6617
- `;
6618
- }
6619
- function treeItemRootColorStyle(props) {
6620
- const $tone = "default", { color } = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
6621
- return styledComponents.css`
6622
- &[role='none'] {
6623
- & > [role='treeitem'] {
6624
- ${_cardColorStyle(color, tone.enabled)}
6625
- }
6626
-
6627
- &[data-selected] > [role='treeitem'] {
6628
- ${_cardColorStyle(color, tone.pressed)}
6629
- }
6630
-
6631
- @media (hover: hover) {
6632
- &:not([data-selected]) > [role='treeitem']:not(:focus):hover {
6633
- ${_cardColorStyle(color, tone.hovered)}
6634
- }
6635
-
6636
- & > [role='treeitem']:focus {
6637
- ${_cardColorStyle(color, tone.selected)}
6638
- }
6639
- }
6640
- }
6641
-
6642
- &[role='treeitem'] {
6643
- & > [data-ui='TreeItem__box'] {
6644
- ${_cardColorStyle(color, tone.enabled)}
6645
- }
6646
-
6647
- &[data-selected] > [data-ui='TreeItem__box'] {
6648
- ${_cardColorStyle(color, tone.pressed)}
6649
- }
6650
-
6651
- @media (hover: hover) {
6652
- &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
6653
- ${_cardColorStyle(color, tone.hovered)}
6654
- }
6655
-
6656
- &:focus > [data-ui='TreeItem__box'] {
6657
- ${_cardColorStyle(color, tone.selected)}
6658
- }
6659
- }
6660
- }
6661
- `;
6662
- }
6663
- function treeItemBoxStyle(props) {
6664
- const { $level } = props, { space } = theme.getTheme_v2(props.theme);
6665
- return styledComponents.css`
6666
- padding-left: ${rem(space[2] * $level)};
6667
-
6668
- &[data-as='a'] {
6669
- text-decoration: none;
6670
- }
6671
- `;
6672
- }
6673
5566
  function useTree() {
6674
5567
  const tree = react.useContext(TreeContext);
6675
5568
  if (!tree)
@@ -6691,13 +5584,14 @@ const TreeGroup = react.memo(function(props) {
6691
5584
  children
6692
5585
  }
6693
5586
  );
6694
- }), Root = react.memo(styledComponents.styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styledComponents.styled(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle), ToggleArrowText = styledComponents.styled(Text)`
5587
+ }), ToggleArrowText = styled(Text)`
6695
5588
  & > svg {
6696
5589
  transition: transform 100ms;
6697
5590
  }
6698
5591
  `, TreeItem = react.memo(function(props) {
6699
5592
  const {
6700
5593
  children,
5594
+ className,
6701
5595
  expanded: expandedProp = !1,
6702
5596
  fontSize: fontSize2 = 1,
6703
5597
  href,
@@ -6732,11 +5626,10 @@ const TreeGroup = react.memo(function(props) {
6732
5626
  if (rootRef.current)
6733
5627
  return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
6734
5628
  }, [expanded, itemPath, registerItem, selected]);
6735
- const content = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { padding, children: [
5629
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
6736
5630
  /* @__PURE__ */ jsxRuntime.jsxs(
6737
5631
  Box,
6738
5632
  {
6739
- marginRight: space,
6740
5633
  style: {
6741
5634
  visibility: IconComponent || children ? "visible" : "hidden",
6742
5635
  pointerEvents: "none"
@@ -6750,21 +5643,22 @@ const TreeGroup = react.memo(function(props) {
6750
5643
  /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) })
6751
5644
  ] });
6752
5645
  return href ? /* @__PURE__ */ jsxRuntime.jsxs(
6753
- Root,
5646
+ Box,
6754
5647
  {
6755
5648
  "data-selected": selected ? "" : void 0,
6756
5649
  "data-tree-id": id,
6757
5650
  "data-tree-key": itemKey,
6758
5651
  "data-ui": "TreeItem",
6759
5652
  ...restProps,
5653
+ as: "li",
5654
+ className: css$1.composeClassNames(className, css$1.treeItem()),
6760
5655
  onClick: handleClick,
6761
5656
  ref: rootRef,
6762
5657
  role: "none",
6763
5658
  children: [
6764
5659
  /* @__PURE__ */ jsxRuntime.jsx(
6765
- TreeItemBox,
5660
+ Box,
6766
5661
  {
6767
- $level: tree.level,
6768
5662
  "aria-expanded": expanded,
6769
5663
  as: linkAs,
6770
5664
  "data-ui": "TreeItem__box",
@@ -6772,6 +5666,9 @@ const TreeGroup = react.memo(function(props) {
6772
5666
  ref: treeitemRef,
6773
5667
  role: "treeitem",
6774
5668
  tabIndex,
5669
+ style: {
5670
+ paddingLeft: `calc(var(--space-2) * ${tree.level})`
5671
+ },
6775
5672
  children: content
6776
5673
  }
6777
5674
  ),
@@ -6779,7 +5676,7 @@ const TreeGroup = react.memo(function(props) {
6779
5676
  ]
6780
5677
  }
6781
5678
  ) : /* @__PURE__ */ jsxRuntime.jsxs(
6782
- Root,
5679
+ Box,
6783
5680
  {
6784
5681
  "data-selected": selected ? "" : void 0,
6785
5682
  "data-ui": "TreeItem",
@@ -6793,7 +5690,17 @@ const TreeGroup = react.memo(function(props) {
6793
5690
  role: "treeitem",
6794
5691
  tabIndex,
6795
5692
  children: [
6796
- /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }),
5693
+ /* @__PURE__ */ jsxRuntime.jsx(
5694
+ Box,
5695
+ {
5696
+ as: "div",
5697
+ "data-ui": "TreeItem__box",
5698
+ style: {
5699
+ paddingLeft: `calc(var(--space-2) * ${tree.level})`
5700
+ },
5701
+ children: content
5702
+ }
5703
+ ),
6797
5704
  /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
6798
5705
  ]
6799
5706
  }
@@ -6891,6 +5798,7 @@ exports.isHTMLSelectElement = isHTMLSelectElement;
6891
5798
  exports.isHTMLTextAreaElement = isHTMLTextAreaElement;
6892
5799
  exports.multiply = multiply;
6893
5800
  exports.parseColor = parseColor;
5801
+ exports.px = px;
6894
5802
  exports.rem = rem;
6895
5803
  exports.responsiveCodeFontStyle = responsiveCodeFontStyle;
6896
5804
  exports.responsiveHeadingFont = responsiveHeadingFont;