@sanity/ui 4.2.0 → 5.0.0-alpha.10

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 (339) hide show
  1. package/README.md +194 -28
  2. package/bin/sanity-ui.js +14 -0
  3. package/dist/_chunks-es/LazyRefractor.js +20 -0
  4. package/dist/_chunks-es/LazyRefractor.js.map +1 -0
  5. package/dist/cli/checks.js +148 -0
  6. package/dist/cli/config.js +23 -0
  7. package/dist/cli/detect.js +181 -0
  8. package/dist/cli/doctor.js +49 -0
  9. package/dist/cli/index.js +69 -0
  10. package/dist/cli/init.js +189 -0
  11. package/dist/cli/install.js +79 -0
  12. package/dist/cli/log.js +66 -0
  13. package/dist/cli/selfPackage.js +11 -0
  14. package/dist/cli/styles.js +185 -0
  15. package/dist/cli/test-utils.js +8 -0
  16. package/dist/cli/tsconfig.js +236 -0
  17. package/dist/cli/types.js +1 -0
  18. package/dist/cli/versions.js +45 -0
  19. package/dist/index.d.ts +1203 -1469
  20. package/dist/index.js +2123 -1989
  21. package/dist/index.js.map +1 -1
  22. package/dist/polyfills.d.ts +1 -0
  23. package/dist/polyfills.js +5 -0
  24. package/dist/polyfills.js.map +1 -0
  25. package/dist/styles.css +1 -547
  26. package/package.json +57 -58
  27. package/src/cli/checks.test.ts +38 -0
  28. package/src/cli/checks.ts +200 -0
  29. package/src/cli/config.ts +44 -0
  30. package/src/cli/detect.test.ts +191 -0
  31. package/src/cli/detect.ts +205 -0
  32. package/src/cli/doctor.test.ts +52 -0
  33. package/src/cli/doctor.ts +65 -0
  34. package/src/cli/index.ts +77 -0
  35. package/src/cli/init.ts +225 -0
  36. package/src/cli/install.test.ts +52 -0
  37. package/src/cli/install.ts +108 -0
  38. package/src/cli/log.ts +79 -0
  39. package/src/cli/selfPackage.ts +14 -0
  40. package/src/cli/styles.test.ts +130 -0
  41. package/src/cli/styles.ts +205 -0
  42. package/src/cli/test-utils.ts +10 -0
  43. package/src/cli/tsconfig.test.ts +174 -0
  44. package/src/cli/tsconfig.ts +282 -0
  45. package/src/cli/types.ts +77 -0
  46. package/src/cli/versions.test.ts +35 -0
  47. package/src/cli/versions.ts +41 -0
  48. package/src/components/badge/Badge.tsx +53 -0
  49. package/src/components/badge/badge.css +6 -0
  50. package/src/components/badge/badge.props.ts +31 -0
  51. package/src/components/box/Box.tsx +30 -0
  52. package/src/components/box/box.css +4 -0
  53. package/src/components/box/box.props.ts +29 -0
  54. package/src/components/button/Button.tsx +78 -0
  55. package/src/components/button/button.css +72 -0
  56. package/src/components/button/button.props.ts +122 -0
  57. package/src/components/card/Card.tsx +31 -0
  58. package/src/components/card/card.css +4 -0
  59. package/src/components/card/card.props.ts +58 -0
  60. package/src/components/checkbox/Checkbox.tsx +64 -0
  61. package/src/components/checkbox/checkbox.css +100 -0
  62. package/src/components/checkbox/checkbox.props.ts +33 -0
  63. package/src/components/code/Code.tsx +38 -0
  64. package/src/components/code/LazyRefractor.tsx +9 -0
  65. package/src/components/code/code.css +40 -0
  66. package/src/components/code/code.props.ts +44 -0
  67. package/src/components/container/Container.tsx +30 -0
  68. package/src/components/container/container.css +4 -0
  69. package/src/components/container/container.props.ts +28 -0
  70. package/src/components/dialog/Dialog.tsx +139 -0
  71. package/src/components/dialog/dialog.css +49 -0
  72. package/src/components/dialog/dialog.props.ts +45 -0
  73. package/src/components/divider/Divider.tsx +23 -0
  74. package/src/components/divider/divider.props.ts +9 -0
  75. package/src/components/eyebrow/Eyebrow.tsx +54 -0
  76. package/src/components/eyebrow/eyebrow.css +11 -0
  77. package/src/components/eyebrow/eyebrow.props.ts +28 -0
  78. package/src/components/flex/Flex.tsx +30 -0
  79. package/src/components/flex/flex.css +4 -0
  80. package/src/components/flex/flex.props.ts +33 -0
  81. package/src/components/grid/Grid.tsx +30 -0
  82. package/src/components/grid/grid.css +4 -0
  83. package/src/components/grid/grid.props.ts +33 -0
  84. package/src/components/h-stack/HStack.tsx +34 -0
  85. package/src/components/h-stack/hStack.props.ts +17 -0
  86. package/src/components/heading/Heading.tsx +54 -0
  87. package/src/components/heading/heading.css +9 -0
  88. package/src/components/heading/heading.props.ts +31 -0
  89. package/src/components/icon/Icon.tsx +24 -0
  90. package/src/components/icon/icon.css +17 -0
  91. package/src/components/icon/icon.props.ts +35 -0
  92. package/src/components/icon-button/IconButton.tsx +32 -0
  93. package/src/components/icon-button/iconButton.props.ts +31 -0
  94. package/src/components/index.css +28 -0
  95. package/src/components/indicator/Indicator.tsx +42 -0
  96. package/src/components/indicator/indicator.css +4 -0
  97. package/src/components/indicator/indicator.props.ts +24 -0
  98. package/src/components/indicator-stack/IndicatorStack.tsx +31 -0
  99. package/src/components/indicator-stack/indicator-stack.css +7 -0
  100. package/src/components/indicator-stack/indicatorStack.props.ts +15 -0
  101. package/src/components/inline/Inline.tsx +38 -0
  102. package/src/components/inline/inline.css +4 -0
  103. package/src/components/inline/inline.props.ts +100 -0
  104. package/src/components/label/Label.tsx +34 -0
  105. package/src/components/label/label.css +3 -0
  106. package/src/components/label/label.props.ts +25 -0
  107. package/src/components/link/Link.tsx +29 -0
  108. package/src/components/link/link.css +12 -0
  109. package/src/components/link/link.props.ts +23 -0
  110. package/src/components/list/List.tsx +167 -0
  111. package/src/components/list/list.css +25 -0
  112. package/src/components/list/list.props.ts +130 -0
  113. package/src/components/popover/Popover.tsx +85 -0
  114. package/src/components/popover/popover.css +21 -0
  115. package/src/components/popover/popover.props.ts +38 -0
  116. package/src/components/press-area/PressArea.tsx +29 -0
  117. package/src/components/press-area/press-area.css +22 -0
  118. package/src/components/press-area/pressArea.props.ts +16 -0
  119. package/src/components/radio/Radio.tsx +48 -0
  120. package/src/components/radio/radio.css +97 -0
  121. package/src/components/radio/radio.props.ts +25 -0
  122. package/src/components/skip-to-content/SkipToContent.tsx +35 -0
  123. package/src/components/skip-to-content/skip-to-content.css +9 -0
  124. package/src/components/skip-to-content/skipToContent.props.ts +25 -0
  125. package/src/components/spinner/Spinner.tsx +28 -0
  126. package/src/components/spinner/spinner.css +10 -0
  127. package/src/components/spinner/spinner.props.ts +19 -0
  128. package/src/components/switch/Switch.tsx +48 -0
  129. package/src/components/switch/switch.css +119 -0
  130. package/src/components/switch/switch.props.ts +25 -0
  131. package/src/components/text/Text.tsx +53 -0
  132. package/src/components/text/text.css +9 -0
  133. package/src/components/text/text.props.ts +28 -0
  134. package/src/components/tooltip/Tooltip.tsx +97 -0
  135. package/src/components/tooltip/tooltip.css +31 -0
  136. package/src/components/tooltip/tooltip.props.ts +36 -0
  137. package/src/components/tooltip-group/TooltipGroup.tsx +64 -0
  138. package/src/components/tooltip-group/tooltipGroup.props.ts +15 -0
  139. package/src/components/v-stack/VStack.tsx +32 -0
  140. package/src/components/v-stack/vStack.props.ts +17 -0
  141. package/src/components/visually-hidden/VisuallyHidden.tsx +29 -0
  142. package/src/components/visually-hidden/visually-hidden.css +9 -0
  143. package/src/components/visually-hidden/visuallyHidden.props.ts +23 -0
  144. package/src/css/classes/dynamic/flex-child.css +5 -0
  145. package/src/css/classes/dynamic/grid-child.css +8 -0
  146. package/src/css/classes/dynamic/grid-parent.css +6 -0
  147. package/src/css/classes/dynamic/height.css +5 -0
  148. package/src/css/classes/dynamic/index.css +7 -0
  149. package/src/css/classes/dynamic/line-clamp.css +5 -0
  150. package/src/css/classes/dynamic/readme.md +3 -0
  151. package/src/css/classes/dynamic/width.css +7 -0
  152. package/src/css/classes/dynamic/z-index.css +3 -0
  153. package/src/css/classes/generic/display.css +10 -0
  154. package/src/css/classes/generic/flex.css +24 -0
  155. package/src/css/classes/generic/grid.css +7 -0
  156. package/src/css/classes/generic/index.css +7 -0
  157. package/src/css/classes/generic/overflow.css +19 -0
  158. package/src/css/classes/generic/placement.css +202 -0
  159. package/src/css/classes/generic/position.css +7 -0
  160. package/src/css/classes/generic/readme.md +3 -0
  161. package/src/css/classes/generic/text-align.css +5 -0
  162. package/src/css/classes/index.css +4 -0
  163. package/src/css/classes/local/animation.css +4 -0
  164. package/src/css/classes/local/border.css +20 -0
  165. package/src/css/classes/local/index.css +6 -0
  166. package/src/css/classes/local/readme.md +3 -0
  167. package/src/css/classes/local/text-overflow.css +5 -0
  168. package/src/css/classes/local/text-trim.css +45 -0
  169. package/src/css/classes/local/tone.css +75 -0
  170. package/src/css/classes/local/top-anchor.css +4 -0
  171. package/src/css/classes/system/color.css +223 -0
  172. package/src/css/classes/system/container.css +8 -0
  173. package/src/css/classes/system/font-family.css +2 -0
  174. package/src/css/classes/system/font-weight.css +4 -0
  175. package/src/css/classes/system/gap.css +37 -0
  176. package/src/css/classes/system/index.css +10 -0
  177. package/src/css/classes/system/inset.css +56 -0
  178. package/src/css/classes/system/margin.css +148 -0
  179. package/src/css/classes/system/padding.css +78 -0
  180. package/src/css/classes/system/radius.css +10 -0
  181. package/src/css/classes/system/readme.md +3 -0
  182. package/src/css/classes/system/shadow.css +6 -0
  183. package/src/css/classes/system/typography.css +31 -0
  184. package/src/css/global/font-face.css +20 -0
  185. package/src/css/global/index.css +2 -0
  186. package/src/css/global/reset.css +76 -0
  187. package/src/css/tokens/index.css +3 -0
  188. package/src/css/tokens/opacity.css +6 -0
  189. package/src/css/tokens/semantic.css +25 -0
  190. package/src/css/tokens/surface.css +27 -0
  191. package/src/hooks/useIsClient.ts +10 -0
  192. package/src/index.css +18 -0
  193. package/src/index.ts +65 -0
  194. package/src/polyfills.ts +15 -0
  195. package/src/props/border.ts +51 -0
  196. package/src/props/flexChild.ts +29 -0
  197. package/src/props/flexParent.ts +47 -0
  198. package/src/props/gap.ts +31 -0
  199. package/src/props/gridChild.ts +50 -0
  200. package/src/props/gridParent.ts +45 -0
  201. package/src/props/height.ts +29 -0
  202. package/src/props/layout.ts +44 -0
  203. package/src/props/margin.ts +59 -0
  204. package/src/props/overflow.ts +30 -0
  205. package/src/props/padding.ts +59 -0
  206. package/src/props/placement.ts +16 -0
  207. package/src/props/position.ts +52 -0
  208. package/src/props/shadow.ts +15 -0
  209. package/src/props/tone.ts +15 -0
  210. package/src/props/typography.ts +62 -0
  211. package/src/props/width.ts +29 -0
  212. package/src/props/zIndex.ts +15 -0
  213. package/src/styles.css.d.ts +1 -0
  214. package/src/styles.css.node.js +2 -0
  215. package/src/styles.css.test.ts +24 -0
  216. package/src/types/Button.ts +8 -0
  217. package/src/types/Code.ts +6 -0
  218. package/src/types/Container.ts +3 -0
  219. package/src/types/Density.ts +3 -0
  220. package/src/types/Display.ts +11 -0
  221. package/src/types/Eyebrow.ts +3 -0
  222. package/src/types/Flex.ts +22 -0
  223. package/src/types/FontWeight.ts +3 -0
  224. package/src/types/Grid.ts +3 -0
  225. package/src/types/Heading.ts +6 -0
  226. package/src/types/Icon.ts +3 -0
  227. package/src/types/Interactive.ts +8 -0
  228. package/src/types/List.ts +2 -0
  229. package/src/types/Overflow.ts +3 -0
  230. package/src/types/Placement.ts +16 -0
  231. package/src/types/Position.ts +3 -0
  232. package/src/types/PropDef.ts +73 -0
  233. package/src/types/Radius.ts +3 -0
  234. package/src/types/Responsive.ts +10 -0
  235. package/src/types/Shadow.ts +3 -0
  236. package/src/types/Space.ts +15 -0
  237. package/src/types/Text.ts +3 -0
  238. package/src/types/TextAlign.ts +3 -0
  239. package/src/types/Tone.ts +3 -0
  240. package/src/utils/getProps.test.ts +156 -0
  241. package/src/utils/getProps.ts +156 -0
  242. package/src/utils/mergeTriggerProps.ts +66 -0
  243. package/src/utils/renderPortal.tsx +14 -0
  244. package/src/utils/suffixClassName.ts +5 -0
  245. package/src/version.ts +3 -0
  246. package/LICENSE +0 -21
  247. package/dist/_system-CTe2lb5l.d.ts +0 -40
  248. package/dist/_system-CTe2lb5l.d.ts.map +0 -1
  249. package/dist/arrow-BmX6qbAS.js +0 -170
  250. package/dist/arrow-BmX6qbAS.js.map +0 -1
  251. package/dist/autocomplete.d.ts +0 -140
  252. package/dist/autocomplete.d.ts.map +0 -1
  253. package/dist/autocomplete.js +0 -470
  254. package/dist/autocomplete.js.map +0 -1
  255. package/dist/breadcrumbs.d.ts +0 -18
  256. package/dist/breadcrumbs.d.ts.map +0 -1
  257. package/dist/breadcrumbs.js +0 -119
  258. package/dist/breadcrumbs.js.map +0 -1
  259. package/dist/button-BNyKSDyA.js +0 -180
  260. package/dist/button-BNyKSDyA.js.map +0 -1
  261. package/dist/button-dnqMFkWg.d.ts +0 -76
  262. package/dist/button-dnqMFkWg.d.ts.map +0 -1
  263. package/dist/card-C0a0wQTc.d.ts +0 -7
  264. package/dist/card-C0a0wQTc.d.ts.map +0 -1
  265. package/dist/code.d.ts +0 -20
  266. package/dist/code.d.ts.map +0 -1
  267. package/dist/code.js +0 -90
  268. package/dist/code.js.map +0 -1
  269. package/dist/codeFontStyle-84SMhFtI.js +0 -11
  270. package/dist/codeFontStyle-84SMhFtI.js.map +0 -1
  271. package/dist/component-DVlwaWB-.d.ts +0 -25
  272. package/dist/component-DVlwaWB-.d.ts.map +0 -1
  273. package/dist/element-BYgCE_iK.js +0 -51
  274. package/dist/element-BYgCE_iK.js.map +0 -1
  275. package/dist/factory-BzXTX8_Q.js +0 -3056
  276. package/dist/factory-BzXTX8_Q.js.map +0 -1
  277. package/dist/flex-DmbDG2ks.js +0 -76
  278. package/dist/flex-DmbDG2ks.js.map +0 -1
  279. package/dist/font-EtfxKPUz.d.ts +0 -49
  280. package/dist/font-EtfxKPUz.d.ts.map +0 -1
  281. package/dist/getElementRef-Jw7gY0eV.js +0 -102
  282. package/dist/getElementRef-Jw7gY0eV.js.map +0 -1
  283. package/dist/getScopedTheme-C-sZsyAz.js +0 -267
  284. package/dist/getScopedTheme-C-sZsyAz.js.map +0 -1
  285. package/dist/getTheme_v2-y09KqtEb.js +0 -487
  286. package/dist/getTheme_v2-y09KqtEb.js.map +0 -1
  287. package/dist/grid-6JSgMj1O.js +0 -115
  288. package/dist/grid-6JSgMj1O.js.map +0 -1
  289. package/dist/helpers-C8xxXAQC.js +0 -63
  290. package/dist/helpers-C8xxXAQC.js.map +0 -1
  291. package/dist/hotkeys-CaHsQlsO.js +0 -168
  292. package/dist/hotkeys-CaHsQlsO.js.map +0 -1
  293. package/dist/index.d.ts.map +0 -1
  294. package/dist/layer-Bl5R3uNR.js +0 -61
  295. package/dist/layer-Bl5R3uNR.js.map +0 -1
  296. package/dist/layer-ChlP9Ik6.d.ts +0 -242
  297. package/dist/layer-ChlP9Ik6.d.ts.map +0 -1
  298. package/dist/menu.d.ts +0 -146
  299. package/dist/menu.d.ts.map +0 -1
  300. package/dist/menu.js +0 -626
  301. package/dist/menu.js.map +0 -1
  302. package/dist/popover-B7-28L8y.js +0 -408
  303. package/dist/popover-B7-28L8y.js.map +0 -1
  304. package/dist/popover-CMlQeKn0.d.ts +0 -96
  305. package/dist/popover-CMlQeKn0.d.ts.map +0 -1
  306. package/dist/popover.d.ts +0 -2
  307. package/dist/popover.js +0 -3
  308. package/dist/refractor-CC48DwHi.js +0 -20
  309. package/dist/refractor-CC48DwHi.js.map +0 -1
  310. package/dist/responsiveFont-CilwaORG.js +0 -55
  311. package/dist/responsiveFont-CilwaORG.js.map +0 -1
  312. package/dist/rgba-BSYaEUW6.d.ts +0 -846
  313. package/dist/rgba-BSYaEUW6.d.ts.map +0 -1
  314. package/dist/selectable-B0GUIL74.d.ts +0 -7
  315. package/dist/selectable-B0GUIL74.d.ts.map +0 -1
  316. package/dist/stack-rsNFPq2-.js +0 -112
  317. package/dist/stack-rsNFPq2-.js.map +0 -1
  318. package/dist/styles-css.d.ts +0 -2
  319. package/dist/styles-css.js +0 -4
  320. package/dist/textInput-pSfQjkmx.js +0 -313
  321. package/dist/textInput-pSfQjkmx.js.map +0 -1
  322. package/dist/theme.d.ts +0 -280
  323. package/dist/theme.d.ts.map +0 -1
  324. package/dist/theme.js +0 -55
  325. package/dist/theme.js.map +0 -1
  326. package/dist/toast.d.ts +0 -73
  327. package/dist/toast.d.ts.map +0 -1
  328. package/dist/toast.js +0 -302
  329. package/dist/toast.js.map +0 -1
  330. package/dist/tooltip.d.ts +0 -88
  331. package/dist/tooltip.d.ts.map +0 -1
  332. package/dist/tooltip.js +0 -435
  333. package/dist/tooltip.js.map +0 -1
  334. package/dist/useClickOutsideEvent-wGLGWBZN.js +0 -36
  335. package/dist/useClickOutsideEvent-wGLGWBZN.js.map +0 -1
  336. package/dist/useElementSize-BJvbGHq8.js +0 -51
  337. package/dist/useElementSize-BJvbGHq8.js.map +0 -1
  338. package/dist/useLayer-D1usxIE0.js +0 -712
  339. package/dist/useLayer-D1usxIE0.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,2000 +1,2134 @@
1
1
  "use client";
2
- import { a as rem, i as _responsive, n as _getArrayProp, r as _getResponsiveSpace, s as EMPTY_RECORD, t as _fillCSSObject } from "./helpers-C8xxXAQC.js";
3
- import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textAreaRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-pSfQjkmx.js";
4
- import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
5
- import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
6
- import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-D1usxIE0.js";
7
- import { t as Flex } from "./flex-DmbDG2ks.js";
8
- import { a as responsiveTextAlignStyle, i as responsiveTextFont, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-rsNFPq2-.js";
9
- import { t as responsiveFont } from "./responsiveFont-CilwaORG.js";
10
- import { n as Spinner, t as Button } from "./button-BNyKSDyA.js";
11
- import { n as _elementSizeObserver, t as useElementSize } from "./useElementSize-BJvbGHq8.js";
12
- import { a as useBoundaryElement, i as PortalContext, n as Portal, o as BoundaryElementContext, r as usePortal, t as Arrow } from "./arrow-BmX6qbAS.js";
13
- import { t as useClickOutsideEvent } from "./useClickOutsideEvent-wGLGWBZN.js";
14
- import { t as responsiveCodeFontStyle } from "./codeFontStyle-84SMhFtI.js";
15
- import { a as rgba$1, c as hslToRgb$1, i as multiply$1, l as rgbToHex$1, n as buildTheme, o as parseColor$1, r as screen$1, s as hexToRgb$1, t as createColorTheme$1, u as rgbToHsl$1 } from "./factory-BzXTX8_Q.js";
16
- import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-CaHsQlsO.js";
17
- import { t as Layer } from "./layer-Bl5R3uNR.js";
18
- import { t as Grid } from "./grid-6JSgMj1O.js";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
19
3
  import { c } from "react/compiler-runtime";
20
- import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
21
- import { clsx } from "clsx/lite";
22
- import { Children, Component, cloneElement, isValidElement, startTransition, useContext, useEffect, useId, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
23
- import { css, styled } from "styled-components";
24
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
25
- import ReactIs from "react-is";
26
- import { CloseIcon } from "@sanity/icons/Close";
27
- import { ToggleArrowRightIcon } from "@sanity/icons/ToggleArrowRight";
4
+ import clsx from "clsx";
5
+ import { isValidElement, useRef, useEffect, lazy, Suspense, useId, Children, useSyncExternalStore, useState, cloneElement, Activity } from "react";
6
+ import { SpinnerIcon } from "@sanity/icons/Spinner";
28
7
  import { CheckmarkIcon } from "@sanity/icons/Checkmark";
29
8
  import { RemoveIcon } from "@sanity/icons/Remove";
30
- /**
31
- * @public
32
- * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
33
- */
34
- const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1, studioTheme = buildTheme(), BASE_STYLE = {
35
- width: "100%",
36
- margin: "0 auto"
37
- };
38
- function containerBaseStyle() {
39
- return BASE_STYLE;
40
- }
41
- function responsiveContainerWidthStyle(props) {
42
- let { container, media } = getTheme_v2(props.theme);
43
- return _responsive(media, props.$width, (val) => ({ maxWidth: val === "auto" ? "none" : rem(container[val]) }));
44
- }
45
- const StyledContainer = /* @__PURE__ */ styled(Box).withConfig({
46
- displayName: "StyledContainer",
47
- componentId: "sc-bmdunn-0"
48
- })(containerBaseStyle, responsiveContainerWidthStyle);
49
- function ContainerComponent(props) {
50
- let $ = c(12), as, ref, restProps, t0;
51
- $[0] === props ? (as = $[1], ref = $[2], restProps = $[3], t0 = $[4]) : ({as, ref, width: t0, ...restProps} = props, $[0] = props, $[1] = as, $[2] = ref, $[3] = restProps, $[4] = t0);
52
- let width = t0 === void 0 ? 2 : t0, t1;
53
- $[5] === width ? t1 = $[6] : (t1 = _getArrayProp(width), $[5] = width, $[6] = t1);
54
- let t2;
55
- return $[7] !== as || $[8] !== ref || $[9] !== restProps || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledContainer, {
56
- "data-ui": "Container",
57
- ...restProps,
58
- $width: t1,
59
- forwardedAs: as,
60
- ref
61
- }), $[7] = as, $[8] = ref, $[9] = restProps, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
62
- }
63
- /**
64
- * The `Container` component wraps content layout in a defined set of widths.
65
- *
66
- * @public
67
- */
68
- const Container = ContainerComponent;
69
- function dialogStyle({ theme }) {
70
- let { color } = getTheme_v2(theme);
71
- return { background: color.backdrop };
72
- }
73
- function responsiveDialogPositionStyle(props) {
74
- let { media } = getTheme_v2(props.theme);
75
- return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
76
- }
77
- /**
78
- * @internal
79
- */
80
- const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", { version: 0 });
81
- /**
82
- * This API might change. DO NOT USE IN PRODUCTION.
83
- * @beta
84
- */
85
- function useDialog() {
86
- return useContext(DialogContext);
87
- }
88
- var dialogCard = "_1a85unk5", dialogContainer = "_1a85unk4", dialogContent = "_1a85unk8", dialogLayer = "_1a85unk0", dialogLayout = "_1a85unk6";
89
- function isTargetWithinScope(boundaryElement, portalElement, target) {
90
- return !boundaryElement || !portalElement || containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
91
- }
92
- const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
93
- displayName: "StyledDialog",
94
- componentId: "sc-drvqzp-0"
95
- })(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle);
96
- function DialogCard(props) {
97
- let $ = c(44), { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, children, contentRef: forwardedContentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: radiusProp, ref: forwardedRef, scheme, shadow: shadowProp, width: widthProp } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t0;
98
- $[0] === radiusProp ? t0 = $[1] : (t0 = _getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0);
99
- let radius = t0, t1;
100
- $[2] === shadowProp ? t1 = $[3] : (t1 = _getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1);
101
- let shadow = t1, t2;
102
- $[4] === widthProp ? t2 = $[5] : (t2 = _getArrayProp(widthProp), $[4] = widthProp, $[5] = t2);
103
- let width = t2, ref = useRef(null), contentRef = useRef(null), { isTopLayer } = useLayer(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, t3;
104
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], useImperativeHandle(forwardedRef, t3);
105
- let t4;
106
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], useImperativeHandle(forwardedContentRef, t4);
107
- let t5, t6;
108
- $[8] === autoFocus ? (t5 = $[9], t6 = $[10]) : (t5 = () => {
109
- autoFocus && ref.current && focusFirstDescendant(ref.current);
110
- }, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6), useEffect(t5, t6);
111
- let t7;
112
- $[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
113
- if (!isTopLayer || !onClose) return;
114
- let target = document.activeElement;
115
- (!target || isTargetWithinScope(boundaryElement, portalElement, target)) && event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
116
- }, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], useGlobalKeyDown(t7);
117
- let t8;
118
- $[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
119
- let target_0 = event_0.target;
120
- (!target_0 || isTargetWithinScope(boundaryElement, portalElement, target_0)) && onClickOutside();
121
- }), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
122
- let t9;
123
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], useClickOutsideEvent(t8, t9);
124
- let t10;
125
- $[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(Box, {
126
- className: "_1a85unk7",
127
- "data-ui": "DialogHeader",
128
- children: /* @__PURE__ */ jsxs(Flex, {
129
- align: "flex-start",
130
- padding: 3,
131
- children: [/* @__PURE__ */ jsx(Box, {
132
- flex: 1,
133
- padding: 2,
134
- children: header && /* @__PURE__ */ jsx(Text, {
135
- id: labelId,
136
- size: 1,
137
- weight: "semibold",
138
- children: header
139
- })
140
- }), showCloseButton && /* @__PURE__ */ jsx(Box, {
141
- flex: "none",
142
- children: /* @__PURE__ */ jsx(Button, {
143
- "aria-label": "Close dialog",
144
- disabled: !onClose,
145
- icon: CloseIcon,
146
- mode: "bleed",
147
- onClick: onClose,
148
- padding: 2
149
- })
150
- })]
151
- })
152
- }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
153
- let t11;
154
- $[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */ jsx(Box, {
155
- className: dialogContent,
156
- "data-ui": "DialogContent",
157
- flex: 1,
158
- ref: contentRef,
159
- tabIndex: -1,
160
- children
161
- }), $[28] = children, $[29] = t11);
162
- let t12;
163
- $[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */ jsx(Box, {
164
- className: "_1a85unk9",
165
- "data-ui": "DialogFooter",
166
- children: footer
167
- }), $[30] = footer, $[31] = t12);
168
- let t13;
169
- $[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(Flex, {
170
- className: dialogLayout,
171
- direction: "column",
172
- flex: 1,
173
- children: [
174
- t10,
175
- t11,
176
- t12
177
- ]
178
- }), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
179
- let t14;
180
- $[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(Card, {
181
- className: dialogCard,
182
- display: "flex",
183
- radius,
184
- ref,
185
- scheme,
186
- shadow,
187
- children: t13
188
- }), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
189
- let t15;
190
- return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(Container, {
191
- className: dialogContainer,
192
- "data-ui": "DialogCard",
193
- display: "flex",
194
- width,
195
- children: t14
196
- }), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
197
- }
198
- /**
199
- * The Dialog component.
200
- *
201
- * @public
202
- */
203
- function Dialog(props) {
204
- let $ = c(75), dialog = useDialog(), { layer } = useTheme_v2(), _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, ref, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
205
- $[0] === props ? (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], ref = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], t6 = $[23]) : ({__unstable_autoFocus: t0, __unstable_hideCloseButton: t1, cardRadius: t2, cardShadow: t3, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, padding: t4, portal: portalProp, position: _positionProp, ref, scheme, width: t5, zOffset: _zOffsetProp, animate: t6, className, ...restProps} = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = ref, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = t6);
206
- let autoFocus = t0 === void 0 || t0, hideCloseButton = t1 !== void 0 && t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 !== void 0 && t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = !usePrefersReducedMotion() && _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t7;
207
- $[24] === cardRadiusProp ? t7 = $[25] : (t7 = _getArrayProp(cardRadiusProp), $[24] = cardRadiusProp, $[25] = t7);
208
- let cardRadius = t7, t8;
209
- $[26] === paddingProp ? t8 = $[27] : (t8 = _getArrayProp(paddingProp), $[26] = paddingProp, $[27] = t8);
210
- let padding = t8, t9;
211
- $[28] === positionProp ? t9 = $[29] : (t9 = _getArrayProp(positionProp), $[28] = positionProp, $[29] = t9);
212
- let position = t9, t10;
213
- $[30] === widthProp ? t10 = $[31] : (t10 = _getArrayProp(widthProp), $[30] = widthProp, $[31] = t10);
214
- let width = t10, t11;
215
- $[32] === zOffsetProp ? t11 = $[33] : (t11 = _getArrayProp(zOffsetProp), $[32] = zOffsetProp, $[33] = t11);
216
- let zOffset = t11, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null), t12;
217
- $[34] === onFocus ? t12 = $[35] : (t12 = (event) => {
218
- onFocus?.(event);
219
- let target = event.target, cardElement = cardRef.current;
220
- if (cardElement && target === preDivRef.current) {
221
- focusLastDescendant(cardElement);
222
- return;
223
- }
224
- if (cardElement && target === postDivRef.current) {
225
- focusFirstDescendant(cardElement);
226
- return;
227
- }
228
- isHTMLElement(event.target) && (focusedElementRef.current = event.target);
229
- }, $[34] = onFocus, $[35] = t12);
230
- let handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0), t13;
231
- $[36] !== boundaryElement || $[37] !== portalElement ? (t13 = () => {
232
- rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
233
- let activeElement = document.activeElement;
234
- if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
235
- let target_0 = focusedElementRef.current;
236
- if (!target_0 || !document.body.contains(target_0)) {
237
- let cardElement_0 = cardRef.current;
238
- cardElement_0 && focusFirstDescendant(cardElement_0);
239
- return;
240
- }
241
- target_0.focus();
242
- }
243
- }, 0);
244
- }, $[36] = boundaryElement, $[37] = portalElement, $[38] = t13) : t13 = $[38];
245
- let handleRootClick = t13, t14 = animate && "_1a85unk3", t15;
246
- $[39] !== className || $[40] !== t14 ? (t15 = clsx(dialogLayer, t14, className), $[39] = className, $[40] = t14, $[41] = t15) : t15 = $[41];
247
- let t16;
248
- $[42] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", {
249
- ref: preDivRef,
250
- tabIndex: 0
251
- }), $[42] = t16) : t16 = $[42];
252
- let t17;
253
- $[43] !== autoFocus || $[44] !== cardRadius || $[45] !== cardShadow || $[46] !== children || $[47] !== contentRef || $[48] !== footer || $[49] !== header || $[50] !== hideCloseButton || $[51] !== id || $[52] !== onClickOutside || $[53] !== onClose || $[54] !== portalProp || $[55] !== scheme || $[56] !== width ? (t17 = /* @__PURE__ */ jsx(DialogCard, {
254
- __unstable_autoFocus: autoFocus,
255
- __unstable_hideCloseButton: hideCloseButton,
256
- contentRef,
257
- footer,
258
- header,
259
- id,
260
- onClickOutside,
261
- onClose,
262
- portal: portalProp,
263
- radius: cardRadius,
264
- ref: cardRef,
265
- scheme,
266
- shadow: cardShadow,
267
- width,
268
- children
269
- }), $[43] = autoFocus, $[44] = cardRadius, $[45] = cardShadow, $[46] = children, $[47] = contentRef, $[48] = footer, $[49] = header, $[50] = hideCloseButton, $[51] = id, $[52] = onClickOutside, $[53] = onClose, $[54] = portalProp, $[55] = scheme, $[56] = width, $[57] = t17) : t17 = $[57];
270
- let t18;
271
- $[58] === Symbol.for("react.memo_cache_sentinel") ? (t18 = /* @__PURE__ */ jsx("div", {
272
- ref: postDivRef,
273
- tabIndex: 0
274
- }), $[58] = t18) : t18 = $[58];
275
- let t19;
276
- $[59] !== handleFocus || $[60] !== handleRootClick || $[61] !== id || $[62] !== labelId || $[63] !== onActivate || $[64] !== padding || $[65] !== position || $[66] !== ref || $[67] !== restProps || $[68] !== t15 || $[69] !== t17 || $[70] !== zOffset ? (t19 = /* @__PURE__ */ jsxs(StyledDialog, {
277
- ...restProps,
278
- $padding: padding,
279
- $position: position,
280
- "aria-labelledby": labelId,
281
- className: t15,
282
- "aria-modal": !0,
283
- "data-ui": "Dialog",
284
- id,
285
- onActivate,
286
- onClick: handleRootClick,
287
- onFocus: handleFocus,
288
- ref,
289
- role: "dialog",
290
- zOffset,
291
- children: [
292
- t16,
293
- t17,
294
- t18
295
- ]
296
- }), $[59] = handleFocus, $[60] = handleRootClick, $[61] = id, $[62] = labelId, $[63] = onActivate, $[64] = padding, $[65] = position, $[66] = ref, $[67] = restProps, $[68] = t15, $[69] = t17, $[70] = zOffset, $[71] = t19) : t19 = $[71];
297
- let t20;
298
- return $[72] !== portalProp || $[73] !== t19 ? (t20 = /* @__PURE__ */ jsx(Portal, {
299
- __unstable_name: portalProp,
300
- children: t19
301
- }), $[72] = portalProp, $[73] = t19, $[74] = t20) : t20 = $[74], t20;
302
- }
303
- /**
304
- * This API might change. DO NOT USE IN PRODUCTION.
305
- * @beta
306
- */
307
- function DialogProvider(props) {
308
- let $ = c(6), { children, position, zOffset } = props, t0;
309
- $[0] !== position || $[1] !== zOffset ? (t0 = {
310
- version: 0,
311
- position,
312
- zOffset
313
- }, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
314
- let contextValue = t0, t1;
315
- return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext.Provider, {
316
- value: contextValue,
317
- children
318
- }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
319
- }
320
- var skeleton = "fnwpv81", skeletonAnimated = "fnwpv84", skeletonHidden = "fnwpv83", skeletonStatic = "fnwpv85", skeletonVisible = "fnwpv82";
321
- const StyledSkeleton$1 = /* @__PURE__ */ styled(Box).withConfig({
322
- displayName: "StyledSkeleton",
323
- componentId: "sc-qq1bsx-0"
324
- })(responsiveRadiusStyle);
325
- /**
326
- * This API might change. DO NOT USE IN PRODUCTION.
327
- * @beta
328
- */
329
- function Skeleton(props) {
330
- let $ = c(21), className, delay, radius, ref, restProps, t0;
331
- $[0] === props ? (className = $[1], delay = $[2], radius = $[3], ref = $[4], restProps = $[5], t0 = $[6]) : ({animated: t0, className, delay, radius, ref, ...restProps} = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = ref, $[5] = restProps, $[6] = t0);
332
- let animated = t0 !== void 0 && t0, [visible, setVisible] = useState(!delay), t1, t2;
333
- $[7] === delay ? (t1 = $[8], t2 = $[9]) : (t1 = () => {
334
- if (!delay) return;
335
- let timeout = setTimeout(() => {
336
- setVisible(!0);
337
- }, delay);
338
- return () => {
339
- clearTimeout(timeout);
340
- };
341
- }, t2 = [delay], $[7] = delay, $[8] = t1, $[9] = t2), useEffect(t1, t2);
342
- let t3;
343
- $[10] === radius ? t3 = $[11] : (t3 = _getArrayProp(radius), $[10] = radius, $[11] = t3);
344
- let t4 = !delay || visible ? skeletonVisible : skeletonHidden, t5 = animated ? skeletonAnimated : skeletonStatic, t6;
345
- $[12] !== className || $[13] !== t4 || $[14] !== t5 ? (t6 = clsx(skeleton, t4, t5, className), $[12] = className, $[13] = t4, $[14] = t5, $[15] = t6) : t6 = $[15];
346
- let t7;
347
- return $[16] !== ref || $[17] !== restProps || $[18] !== t3 || $[19] !== t6 ? (t7 = /* @__PURE__ */ jsx(StyledSkeleton$1, {
348
- "data-ui": "Skeleton",
349
- ...restProps,
350
- $radius: t3,
351
- className: t6,
352
- ref
353
- }), $[16] = ref, $[17] = restProps, $[18] = t3, $[19] = t6, $[20] = t7) : t7 = $[20], t7;
354
- }
355
- const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
356
- displayName: "StyledSkeleton",
357
- componentId: "sc-pe7hmi-0"
358
- })((props) => {
359
- let { $size, $style } = props, { font, media } = getTheme_v2(props.theme), fontStyle = font[$style];
360
- return _responsive(media, $size, (sizeIndex) => {
361
- let fontSize = fontStyle.sizes[sizeIndex];
362
- return { height: fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight };
363
- });
364
- });
365
- /**
366
- * This API might change. DO NOT USE IN PRODUCTION.
367
- * @beta
368
- */
369
- function TextSkeleton(props) {
370
- let $ = c(8), restProps, t0;
371
- $[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
372
- let size = t0 === void 0 ? 2 : t0, t1;
373
- $[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
374
- let $size = t1, t2;
375
- return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
376
- "data-ui": "TextSkeleton",
377
- ...restProps,
378
- $size,
379
- $style: "text"
380
- }), $[5] = $size, $[6] = restProps, $[7] = t2) : t2 = $[7], t2;
381
- }
382
- /**
383
- * This API might change. DO NOT USE IN PRODUCTION.
384
- * @beta
385
- */
386
- function LabelSkeleton(props) {
387
- let $ = c(8), restProps, t0;
388
- $[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
389
- let size = t0 === void 0 ? 2 : t0, t1;
390
- $[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
391
- let $size = t1, t2;
392
- return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
393
- "data-ui": "LabelSkeleton",
394
- ...restProps,
395
- $size,
396
- $style: "label"
397
- }), $[5] = $size, $[6] = restProps, $[7] = t2) : t2 = $[7], t2;
398
- }
399
- /**
400
- * This API might change. DO NOT USE IN PRODUCTION.
401
- * @beta
402
- */
403
- function HeadingSkeleton(props) {
404
- let $ = c(8), restProps, t0;
405
- $[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
406
- let size = t0 === void 0 ? 2 : t0, t1;
407
- $[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
408
- let $size = t1, t2;
409
- return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
410
- "data-ui": "HeadingSkeleton",
411
- ...restProps,
412
- $size,
413
- $style: "heading"
414
- }), $[5] = $size, $[6] = restProps, $[7] = t2) : t2 = $[7], t2;
415
- }
416
- /**
417
- * This API might change. DO NOT USE IN PRODUCTION.
418
- * @beta
419
- */
420
- function CodeSkeleton(props) {
421
- let $ = c(8), restProps, t0;
422
- $[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
423
- let size = t0 === void 0 ? 2 : t0, t1;
424
- $[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
425
- let $size = t1, t2;
426
- return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
427
- "data-ui": "CodeSkeleton",
428
- ...restProps,
429
- $size,
430
- $style: "code"
431
- }), $[5] = $size, $[6] = restProps, $[7] = t2) : t2 = $[7], t2;
432
- }
433
- var tab = "gpfraw0";
434
- /**
435
- * @public
436
- */
437
- function Tab(props) {
438
- let $ = c(35), className, focused, forwardedRef, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
439
- $[0] === props ? (className = $[1], focused = $[2], forwardedRef = $[3], icon = $[4], id = $[5], label = $[6], onClick = $[7], onFocus = $[8], restProps = $[9], selected = $[10], t0 = $[11], t1 = $[12]) : ({className, icon, id, focused, fontSize: t0, label, onClick, onFocus, padding: t1, ref: forwardedRef, selected, ...restProps} = props, $[0] = props, $[1] = className, $[2] = focused, $[3] = forwardedRef, $[4] = icon, $[5] = id, $[6] = label, $[7] = onClick, $[8] = onFocus, $[9] = restProps, $[10] = selected, $[11] = t0, $[12] = t1);
440
- let fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = useRef(null), focusedRef = useRef(!1), t2;
441
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
442
- let t3;
443
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
444
- focusedRef.current = !1;
445
- }, $[14] = t3) : t3 = $[14];
446
- let handleBlur = t3, t4;
447
- $[15] === onFocus ? t4 = $[16] : (t4 = (event) => {
448
- focusedRef.current = !0, onFocus && onFocus(event);
449
- }, $[15] = onFocus, $[16] = t4);
450
- let handleFocus = t4, t5, t6;
451
- $[17] === focused ? (t5 = $[18], t6 = $[19]) : (t5 = () => {
452
- focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
453
- }, t6 = [focused], $[17] = focused, $[18] = t5, $[19] = t6), useEffect(t5, t6);
454
- let t7;
455
- $[20] === className ? t7 = $[21] : (t7 = clsx(tab, className), $[20] = className, $[21] = t7);
456
- let t8 = selected ? "true" : "false", t9 = selected ? 0 : -1, t10;
457
- return $[22] !== fontSize || $[23] !== handleFocus || $[24] !== icon || $[25] !== id || $[26] !== label || $[27] !== onClick || $[28] !== padding || $[29] !== restProps || $[30] !== selected || $[31] !== t7 || $[32] !== t8 || $[33] !== t9 ? (t10 = /* @__PURE__ */ jsx(Button, {
458
- className: t7,
459
- "data-ui": "Tab",
460
- ...restProps,
461
- "aria-selected": t8,
462
- fontSize,
463
- icon,
464
- id,
465
- mode: "bleed",
466
- onClick,
467
- onBlur: handleBlur,
468
- onFocus: handleFocus,
469
- padding,
470
- ref,
471
- role: "tab",
472
- selected,
473
- tabIndex: t9,
474
- text: label,
475
- type: "button"
476
- }), $[22] = fontSize, $[23] = handleFocus, $[24] = icon, $[25] = id, $[26] = label, $[27] = onClick, $[28] = padding, $[29] = restProps, $[30] = selected, $[31] = t7, $[32] = t8, $[33] = t9, $[34] = t10) : t10 = $[34], t10;
477
- }
478
- var tabList = "_11igkzi0";
479
- /**
480
- * @public
481
- */
482
- function TabList(props) {
483
- let $ = c(20), childrenProp, className, ref, restProps;
484
- $[0] === props ? (childrenProp = $[1], className = $[2], ref = $[3], restProps = $[4]) : ({children: childrenProp, className, ref, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = className, $[3] = ref, $[4] = restProps);
485
- let [focusedIndex, setFocusedIndex] = useState(-1), t0;
486
- if ($[5] !== childrenProp || $[6] !== focusedIndex) {
487
- let children = Children.toArray(childrenProp).filter(isValidElement), t1;
488
- $[8] === focusedIndex ? t1 = $[9] : (t1 = (child, childIndex) => cloneElement(child, {
489
- focused: focusedIndex === childIndex,
490
- key: childIndex,
491
- onFocus: () => setFocusedIndex(childIndex)
492
- }), $[8] = focusedIndex, $[9] = t1), t0 = children.map(t1), $[5] = childrenProp, $[6] = focusedIndex, $[7] = t0;
493
- } else t0 = $[7];
494
- let tabs = t0, numTabs = tabs.length, t1;
495
- $[10] === numTabs ? t1 = $[11] : (t1 = (event) => {
496
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
497
- }, $[10] = numTabs, $[11] = t1);
498
- let handleKeyDown = t1, t2;
499
- $[12] === className ? t2 = $[13] : (t2 = clsx(tabList, className), $[12] = className, $[13] = t2);
500
- let t3;
501
- return $[14] !== handleKeyDown || $[15] !== ref || $[16] !== restProps || $[17] !== t2 || $[18] !== tabs ? (t3 = /* @__PURE__ */ jsx(Inline, {
502
- className: t2,
503
- "data-ui": "TabList",
504
- ...restProps,
505
- onKeyDown: handleKeyDown,
506
- ref,
507
- role: "tablist",
508
- children: tabs
509
- }), $[14] = handleKeyDown, $[15] = ref, $[16] = restProps, $[17] = t2, $[18] = tabs, $[19] = t3) : t3 = $[19], t3;
510
- }
511
- /**
512
- * @public
513
- */
514
- function TabPanel(props) {
515
- let $ = c(8), flex, restProps;
516
- $[0] === props ? (flex = $[1], restProps = $[2]) : ({flex, ...restProps} = props, $[0] = props, $[1] = flex, $[2] = restProps);
517
- let t0 = props.tabIndex === void 0 ? 0 : props.tabIndex, t1;
518
- return $[3] !== flex || $[4] !== props.children || $[5] !== restProps || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, {
519
- "data-ui": "TabPanel",
520
- ...restProps,
521
- flex,
522
- role: "tabpanel",
523
- tabIndex: t0,
524
- children: props.children
525
- }), $[3] = flex, $[4] = props.children, $[5] = restProps, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
526
- }
527
- function _findPrevItemElement(state, itemElements, focusedElement) {
528
- let idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
529
- for (let i = len - 1; i >= 0; --i) {
530
- let itemKey = els[i].getAttribute("data-tree-key");
531
- if (!itemKey) continue;
532
- let segments = itemKey.split("/");
533
- segments.pop();
534
- let p = [], expanded = !0;
535
- for (let j = 0; j < segments.length; j += 1) if (p.push(segments[j]), !state[p.join("/")]?.expanded) {
536
- expanded = !1;
537
- break;
538
- }
539
- if (expanded) return els[i];
540
- }
541
- return null;
542
- }
543
- function _findNextItemElement(state, itemElements, focusedElement) {
544
- let idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
545
- for (let i = 1; i < len; i += 1) {
546
- if (!els[i]) continue;
547
- let itemKey = els[i].getAttribute("data-tree-key");
548
- if (!itemKey) continue;
549
- let segments = itemKey.split("/");
550
- segments.pop();
551
- let p = [], expanded = !0;
552
- for (let j = 0; j < segments.length; j += 1) if (p.push(segments[j]), !state[p.join("/")]?.expanded) {
553
- expanded = !1;
554
- break;
555
- }
556
- if (expanded) return els[i];
557
- }
558
- return null;
559
- }
560
- function _focusItemElement(el) {
561
- if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
562
- let firstChild = el.firstChild;
563
- firstChild && firstChild instanceof HTMLElement && firstChild.focus();
564
- }
565
- }
566
- /**
567
- * @internal
568
- */
569
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null);
570
- /**
571
- * This API might change. DO NOT USE IN PRODUCTION.
572
- * @beta
573
- */
574
- function Tree(props) {
575
- let $ = c(38), children, forwardedRef, onFocus, restProps, t0;
576
- $[0] === props ? (children = $[1], forwardedRef = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]) : ({children, gap: t0, onFocus, ref: forwardedRef, ...restProps} = props, $[0] = props, $[1] = children, $[2] = forwardedRef, $[3] = onFocus, $[4] = restProps, $[5] = t0);
577
- let gap = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement), t1;
578
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[6] = t1) : t1 = $[6];
579
- let path = t1, t2;
580
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[7] = t2) : t2 = $[7];
581
- let [itemElements, setItemElements] = useState(t2), t3;
582
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[8] = t3) : t3 = $[8];
583
- let [state, setState] = useState(t3), stateRef = useRef(state), t4;
584
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], useImperativeHandle(forwardedRef, t4);
585
- let t5, t6;
586
- $[10] === focusedElement ? (t5 = $[11], t6 = $[12]) : (t5 = () => {
587
- focusedElementRef.current = focusedElement;
588
- }, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6), useEffect(t5, t6);
589
- let t7, t8;
590
- $[13] === state ? (t7 = $[14], t8 = $[15]) : (t7 = () => {
591
- stateRef.current = state;
592
- }, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8), useEffect(t7, t8);
593
- let t9;
594
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
595
- ...s,
596
- [path_0]: {
597
- element,
598
- expanded
599
- }
600
- })), selected && setFocusedElement(element), () => {
601
- setState((s_0) => {
602
- let newState = { ...s_0 };
603
- return delete newState[path_0], newState;
604
- });
605
- }), $[16] = t9) : t9 = $[16];
606
- let registerItem = t9, t10;
607
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
608
- setState((s_1) => {
609
- let itemState = s_1[path_1];
610
- return itemState ? {
611
- ...s_1,
612
- [path_1]: {
613
- ...itemState,
614
- expanded: expanded_0
615
- }
616
- } : s_1;
617
- });
618
- }, $[17] = t10) : t10 = $[17];
619
- let setExpanded = t10, t11 = focusedElement || itemElements[0] || null, t12;
620
- $[18] !== gap || $[19] !== state || $[20] !== t11 ? (t12 = {
621
- version: 0,
622
- focusedElement: t11,
623
- level: 0,
624
- path,
625
- registerItem,
626
- setExpanded,
627
- setFocusedElement,
628
- gap,
629
- state
630
- }, $[18] = gap, $[19] = state, $[20] = t11, $[21] = t12) : t12 = $[21];
631
- let contextValue = t12, t13;
632
- $[22] === itemElements ? t13 = $[23] : (t13 = (event) => {
633
- if (focusedElementRef.current) {
634
- if (event.key === "ArrowDown") {
635
- event.preventDefault();
636
- let nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
637
- nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
638
- return;
639
- }
640
- if (event.key === "ArrowUp") {
641
- event.preventDefault();
642
- let prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
643
- prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
644
- return;
645
- }
646
- if (event.key === "ArrowLeft") {
647
- event.preventDefault();
648
- let itemKey = focusedElementRef.current.getAttribute("data-tree-key");
649
- if (!itemKey) return;
650
- let itemState_0 = stateRef.current[itemKey];
651
- if (!itemState_0) return;
652
- if (itemState_0.expanded) setState((s_2) => {
653
- let itemState_1 = s_2[itemKey];
654
- return itemState_1 ? {
655
- ...s_2,
656
- [itemKey]: {
657
- ...itemState_1,
658
- expanded: !1
659
- }
660
- } : s_2;
661
- });
662
- else {
663
- let itemPath = itemKey.split("/");
664
- itemPath.pop();
665
- let parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
666
- parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
667
- }
668
- return;
669
- }
670
- if (event.key === "ArrowRight") {
671
- event.preventDefault();
672
- let focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
673
- if (!focusedKey) return;
674
- stateRef.current[focusedKey]?.expanded || setState((s_3) => {
675
- let itemState_2 = s_3[focusedKey];
676
- return itemState_2 ? {
677
- ...s_3,
678
- [focusedKey]: {
679
- ...itemState_2,
680
- expanded: !0
681
- }
682
- } : s_3;
683
- });
684
- return;
685
- }
686
- }
687
- }, $[22] = itemElements, $[23] = t13);
688
- let handleKeyDown = t13, t14;
689
- $[24] === onFocus ? t14 = $[25] : (t14 = (event_0) => {
690
- setFocusedElement(event_0.target), onFocus?.(event_0);
691
- }, $[24] = onFocus, $[25] = t14);
692
- let handleFocus = t14, t15;
693
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
694
- if (!ref.current) return;
695
- let _itemElements = Array.from(ref.current.querySelectorAll("[data-ui=\"TreeItem\"]"));
696
- setItemElements(_itemElements);
697
- }, $[26] = t15) : t15 = $[26];
698
- let t16;
699
- $[27] === children ? t16 = $[28] : (t16 = [children], $[27] = children, $[28] = t16), useEffect(t15, t16);
700
- let t17;
701
- $[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== restProps ? (t17 = /* @__PURE__ */ jsx(Stack, {
702
- as: "ul",
703
- "data-ui": "Tree",
704
- ...restProps,
705
- onFocus: handleFocus,
706
- onKeyDown: handleKeyDown,
707
- ref,
708
- role: "tree",
709
- gap,
710
- children
711
- }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = restProps, $[34] = t17) : t17 = $[34];
712
- let t18;
713
- return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, {
714
- value: contextValue,
715
- children: t17
716
- }), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
717
- }
718
- function treeItemRootColorStyle(props) {
719
- let { color } = getTheme_v2(props.theme), tone = color.selectable.default;
720
- return css`&[role='none']{& > [role='treeitem']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [role='treeitem']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]) > [role='treeitem']:not(:focus):hover{${_cardColorStyle(color, tone.hovered)}}& > [role='treeitem']:focus{${_cardColorStyle(color, tone.selected)}}}}&[role='treeitem']{& > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover{${_cardColorStyle(color, tone.hovered)}}&:focus > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.selected)}}}}`;
721
- }
722
- function treeItemBoxStyle(props) {
723
- let { $level } = props, { space } = getTheme_v2(props.theme);
724
- return css`display:block;padding-left:${rem(space[2] * $level)};text-decoration:none;`;
725
- }
726
- /**
727
- * @beta
728
- */
729
- function useTree() {
730
- let tree = useContext(TreeContext);
731
- if (!tree) throw Error("Tree: missing context value");
732
- return tree;
733
- }
734
- function TreeGroup(props) {
735
- let $ = c(9), children, restProps, t0;
736
- $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, expanded: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
737
- let expanded = t0 !== void 0 && t0, tree = useTree(), t1 = !expanded, t2;
738
- return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */ jsx(Stack, {
739
- as: "ul",
740
- "data-ui": "TreeGroup",
741
- ...restProps,
742
- hidden: t1,
743
- marginTop: tree.gap,
744
- role: "group",
745
- gap: tree.gap,
746
- children
747
- }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
748
- }
749
- var treeItem = "_14vatmh0";
750
- const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
751
- displayName: "StyledTreeItem",
752
- componentId: "sc-inyvr0-0"
753
- })(treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled.a.withConfig({
754
- displayName: "TreeItemBox",
755
- componentId: "sc-inyvr0-1"
756
- })(treeItemBoxStyle);
757
- /**
758
- * This API might change. DO NOT USE IN PRODUCTION.
759
- * @beta
760
- */
761
- function TreeItem(props) {
762
- let $ = c(94), { children, expanded: t0, fontSize: t1, href, icon: IconComponent, id: idProp, linkAs, linkProps, muted, onClick, padding: t2, selected: t3, gap: t4, text, weight, ...restProps } = props, expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, gap = t4 === void 0 ? 2 : t4, [rootElement, _setRootElement] = useState(null), t5;
763
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
764
- startTransition(() => _setRootElement(node));
765
- }, $[0] = t5) : t5 = $[0];
766
- let setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = useId(), id = idProp || _id, t6, t7;
767
- if ($[1] !== id || $[2] !== path) {
768
- let itemPath = path.concat([id || ""]);
769
- t6 = itemPath, t7 = itemPath.join("/"), $[1] = id, $[2] = path, $[3] = t6, $[4] = t7;
770
- } else t6 = $[3], t7 = $[4];
771
- let t8;
772
- $[5] !== t6 || $[6] !== t7 ? (t8 = [t6, t7], $[5] = t6, $[6] = t7, $[7] = t8) : t8 = $[7];
773
- let [itemPath_0, itemKey] = t8, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t9 = tree.level + 1, t10;
774
- $[8] !== itemPath_0 || $[9] !== t9 || $[10] !== tree ? (t10 = {
775
- ...tree,
776
- level: t9,
777
- path: itemPath_0
778
- }, $[8] = itemPath_0, $[9] = t9, $[10] = tree, $[11] = t10) : t10 = $[11];
779
- let contextValue = t10, t11;
780
- $[12] !== expanded || $[13] !== itemKey || $[14] !== onClick || $[15] !== rootElement || $[16] !== setExpanded || $[17] !== setFocusedElement ? (t11 = (event) => {
781
- onClick && onClick(event);
782
- let target = event.target;
783
- target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest("[data-ui=\"TreeItem__box\"]")) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
784
- }, $[12] = expanded, $[13] = itemKey, $[14] = onClick, $[15] = rootElement, $[16] = setExpanded, $[17] = setFocusedElement, $[18] = t11) : t11 = $[18];
785
- let handleClick = t11, t12;
786
- $[19] !== focused || $[20] !== rootElement ? (t12 = (event_0) => {
787
- focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
788
- }, $[19] = focused, $[20] = rootElement, $[21] = t12) : t12 = $[21];
789
- let handleKeyDown = t12, t13, t14;
790
- $[22] !== expanded || $[23] !== itemKey || $[24] !== registerItem || $[25] !== rootElement || $[26] !== selected ? (t13 = () => {
791
- if (rootElement) return registerItem(rootElement, itemKey, expanded, selected);
792
- }, t14 = [
793
- expanded,
794
- itemKey,
795
- registerItem,
796
- rootElement,
797
- selected
798
- ], $[22] = expanded, $[23] = itemKey, $[24] = registerItem, $[25] = rootElement, $[26] = selected, $[27] = t13, $[28] = t14) : (t13 = $[27], t14 = $[28]), useEffect(t13, t14);
799
- let t15 = IconComponent || children ? "visible" : "hidden", t16;
800
- $[29] === t15 ? t16 = $[30] : (t16 = {
801
- visibility: t15,
802
- pointerEvents: "none"
803
- }, $[29] = t15, $[30] = t16);
804
- let t17;
805
- $[31] !== IconComponent || $[32] !== fontSize || $[33] !== muted || $[34] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, {
806
- muted,
807
- size: fontSize,
808
- weight,
809
- children: /* @__PURE__ */ jsx(IconComponent, {})
810
- }), $[31] = IconComponent, $[32] = fontSize, $[33] = muted, $[34] = weight, $[35] = t17) : t17 = $[35];
811
- let t18;
812
- $[36] !== IconComponent || $[37] !== expanded || $[38] !== fontSize || $[39] !== muted || $[40] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(Text, {
813
- muted,
814
- size: fontSize,
815
- weight,
816
- children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, {
817
- className: "_14vatmh1",
818
- style: { transform: expanded ? "rotate(90deg)" : void 0 }
819
- })
820
- }), $[36] = IconComponent, $[37] = expanded, $[38] = fontSize, $[39] = muted, $[40] = weight, $[41] = t18) : t18 = $[41];
821
- let t19;
822
- $[42] !== gap || $[43] !== t16 || $[44] !== t17 || $[45] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, {
823
- marginRight: gap,
824
- style: t16,
825
- children: [t17, t18]
826
- }), $[42] = gap, $[43] = t16, $[44] = t17, $[45] = t18, $[46] = t19) : t19 = $[46];
827
- let t20;
828
- $[47] !== fontSize || $[48] !== muted || $[49] !== text || $[50] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, {
829
- flex: 1,
830
- children: /* @__PURE__ */ jsx(Text, {
831
- muted,
832
- size: fontSize,
833
- textOverflow: "ellipsis",
834
- weight,
835
- children: text
836
- })
837
- }), $[47] = fontSize, $[48] = muted, $[49] = text, $[50] = weight, $[51] = t20) : t20 = $[51];
838
- let t21;
839
- $[52] !== padding || $[53] !== t19 || $[54] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, {
840
- padding,
841
- children: [t19, t20]
842
- }), $[52] = padding, $[53] = t19, $[54] = t20, $[55] = t21) : t21 = $[55];
843
- let content = t21;
844
- if (href) {
845
- let t22 = typeof linkAs == "string" ? linkAs : "a", t23;
846
- $[56] !== content || $[57] !== expanded || $[58] !== href || $[59] !== linkAs || $[60] !== linkProps || $[61] !== t22 || $[62] !== tabIndex || $[63] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, {
847
- ...linkProps,
848
- $level: tree.level,
849
- "aria-expanded": expanded,
850
- as: linkAs,
851
- "data-as": t22,
852
- "data-ui": "TreeItem__box",
853
- href,
854
- ref: treeitemRef,
855
- role: "treeitem",
856
- tabIndex,
857
- children: content
858
- }), $[56] = content, $[57] = expanded, $[58] = href, $[59] = linkAs, $[60] = linkProps, $[61] = t22, $[62] = tabIndex, $[63] = tree.level, $[64] = t23) : t23 = $[64];
859
- let t24;
860
- $[65] !== children || $[66] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, {
861
- hidden: !expanded,
862
- children
863
- }), $[65] = children, $[66] = expanded, $[67] = t24) : t24 = $[67];
864
- let t25;
865
- return $[68] !== contextValue || $[69] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, {
866
- value: contextValue,
867
- children: t24
868
- }), $[68] = contextValue, $[69] = t24, $[70] = t25) : t25 = $[70], /* @__PURE__ */ jsxs(StyledTreeItem, {
869
- "data-selected": selected ? "" : void 0,
870
- "data-tree-id": id,
871
- "data-tree-key": itemKey,
872
- "data-ui": "TreeItem",
873
- ...restProps,
874
- className: clsx(treeItem, restProps.className),
875
- onClick: handleClick,
876
- ref: setRootElement,
877
- role: "none",
878
- children: [t23, t25]
879
- });
880
- }
881
- let T0 = StyledTreeItem, t22 = selected ? "" : void 0, t24 = clsx(treeItem, restProps.className), t25;
882
- $[71] !== content || $[72] !== tree.level ? (t25 = /* @__PURE__ */ jsx(TreeItemBox, {
883
- $level: tree.level,
884
- as: "div",
885
- "data-ui": "TreeItem__box",
886
- children: content
887
- }), $[71] = content, $[72] = tree.level, $[73] = t25) : t25 = $[73];
888
- let t26;
889
- $[74] !== children || $[75] !== expanded ? (t26 = children && /* @__PURE__ */ jsx(TreeGroup, {
890
- expanded,
891
- children
892
- }), $[74] = children, $[75] = expanded, $[76] = t26) : t26 = $[76];
893
- let t27;
894
- $[77] !== contextValue || $[78] !== t26 ? (t27 = /* @__PURE__ */ jsx(TreeContext.Provider, {
895
- value: contextValue,
896
- children: t26
897
- }), $[77] = contextValue, $[78] = t26, $[79] = t27) : t27 = $[79];
898
- let t28;
899
- return $[80] !== T0 || $[81] !== expanded || $[82] !== handleClick || $[83] !== handleKeyDown || $[84] !== id || $[85] !== itemKey || $[86] !== restProps || $[87] !== setRootElement || $[88] !== t22 || $[89] !== t24 || $[90] !== t25 || $[91] !== t27 || $[92] !== tabIndex ? (t28 = /* @__PURE__ */ jsxs(T0, {
900
- "data-selected": t22,
901
- "data-ui": "TreeItem",
902
- "data-tree-id": id,
903
- "data-tree-key": itemKey,
904
- ...restProps,
905
- "aria-expanded": expanded,
906
- className: t24,
907
- onClick: handleClick,
908
- onKeyDown: handleKeyDown,
909
- ref: setRootElement,
910
- role: "treeitem",
911
- tabIndex,
912
- children: [t25, t27]
913
- }), $[80] = T0, $[81] = expanded, $[82] = handleClick, $[83] = handleKeyDown, $[84] = id, $[85] = itemKey, $[86] = restProps, $[87] = setRootElement, $[88] = t22, $[89] = t24, $[90] = t25, $[91] = t27, $[92] = tabIndex, $[93] = t28) : t28 = $[93], t28;
914
- }
915
- /**
916
- * @internal
917
- */
918
- function _isScrollable(el) {
919
- if (!(el instanceof Element)) return !1;
920
- let style = window.getComputedStyle(el);
921
- return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
922
- }
923
- /**
924
- * @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
925
- * @beta
926
- */
927
- function useArrayProp(_val, _defaultVal) {
928
- throw Error("`useArrayProp` was removed in @sanity/ui v4. Use `Array.isArray(value) ? value : [value]` instead.");
929
- }
930
- /**
931
- * @public
932
- * @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
933
- * ```tsx
934
- * const [button, setButtonElement] = useState(null)
935
- * useClickOutside((event) => {}, [button])
936
- * return <button ref={setButtonElement} />
937
- * ```
938
- * do:
939
- * ```tsx
940
- * const buttonRef = useRef()
941
- * useClickOutsideEvent((event) => {}, () => [buttonRef.current])
942
- * return <button ref={buttonRef} />
943
- * ```
944
- */
945
- function useClickOutside(_listener, _elementsArg, _boundaryElement) {
946
- throw Error("`useClickOutside` was removed in @sanity/ui v4. Use `useClickOutsideEvent` instead.");
947
- }
948
- /**
949
- * Subscribe to the rect of a DOM element.
950
- * @beta
951
- *
952
- * @deprecated Use `useElementSize` instead
953
- */
954
- function useElementRect(_element) {
955
- throw Error("`useElementRect` was removed in @sanity/ui v4. Use `useElementSize` instead.");
956
- }
957
- /**
958
- * @beta
959
- * @deprecated use `useImperativeHandle` instead
960
- * @example
961
- * ```diff
962
- * -const ref = useForwardedRef(forwardedRef)
963
- * +const ref = useRef(null)
964
- * +useImperativeHandle(forwardedRef, () => ref.current)
965
- * ```
966
- */
967
- function useForwardedRef(_ref) {
968
- throw Error("`useForwardedRef` was removed in @sanity/ui v4. Use `useRef` and `useImperativeHandle` instead.");
969
- }
970
- /**
971
- * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
972
- *
973
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
974
- *
975
- * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
976
- * Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
977
- * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
978
- *
979
- * @public
980
- */
981
- function usePrefersDark(t0) {
982
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$3 : t0);
983
- }
984
- function _temp$3() {
985
- return !1;
986
- }
987
- /**
988
- * Get responsive CSS for the `label` font style.
989
- * @internal
990
- */
991
- function responsiveLabelFont(props) {
992
- return responsiveFont("label", props);
993
- }
994
- function labelBaseStyle(props) {
995
- let { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
996
- return css`text-transform:uppercase;${$accent && css`color:var(--card-accent-fg-color);`} ${$muted && css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;}& a{text-decoration:none;border-radius:1px;}& svg{display:inline;max-width:unset;}& [data-sanity-icon]{vertical-align:baseline;}`;
997
- }
998
- const StyledLabel = /* @__PURE__ */ styled.div.withConfig({
999
- displayName: "StyledLabel",
1000
- componentId: "sc-43585o-0"
1001
- })(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
1002
- function LabelComponent(props) {
1003
- let $ = c(27), accent, align, childrenProp, ref, restProps, t0, t1, textOverflow, weight;
1004
- $[0] === props ? (accent = $[1], align = $[2], childrenProp = $[3], ref = $[4], restProps = $[5], t0 = $[6], t1 = $[7], textOverflow = $[8], weight = $[9]) : ({accent, align, children: childrenProp, muted: t0, ref, size: t1, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = ref, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = textOverflow, $[9] = weight);
1005
- let muted = t0 !== void 0 && t0, size = t1 === void 0 ? 2 : t1, children = childrenProp;
1006
- if (textOverflow === "ellipsis") {
1007
- let t2;
1008
- $[10] === children ? t2 = $[11] : (t2 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[10] = children, $[11] = t2), children = t2;
1009
- } else {
1010
- let t2;
1011
- $[12] === children ? t2 = $[13] : (t2 = /* @__PURE__ */ jsx("span", { children }), $[12] = children, $[13] = t2), children = t2;
1012
- }
1013
- let t2;
1014
- $[14] === align ? t2 = $[15] : (t2 = _getArrayProp(align), $[14] = align, $[15] = t2);
1015
- let t3;
1016
- $[16] === size ? t3 = $[17] : (t3 = _getArrayProp(size), $[16] = size, $[17] = t3);
1017
- let t4;
1018
- return $[18] !== accent || $[19] !== children || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== t2 || $[24] !== t3 || $[25] !== weight ? (t4 = /* @__PURE__ */ jsx(StyledLabel, {
1019
- "data-ui": "Label",
1020
- ...restProps,
1021
- $accent: accent,
1022
- $align: t2,
1023
- $muted: muted,
1024
- $size: t3,
1025
- $weight: weight,
1026
- ref,
1027
- children
1028
- }), $[18] = accent, $[19] = children, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = t2, $[24] = t3, $[25] = weight, $[26] = t4) : t4 = $[26], t4;
1029
- }
1030
- /**
1031
- * Typographic labels.
1032
- *
1033
- * @public
1034
- */
1035
- const Label = LabelComponent;
1036
- function avatarRootStyle(props) {
1037
- let { $color } = props, { avatar } = getTheme_v2(props.theme);
1038
- return {
1039
- "--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
1040
- "--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
1041
- backgroundColor: "var(--avatar-bg-color)",
1042
- position: "relative",
1043
- boxSizing: "border-box",
1044
- userSelect: "none",
1045
- boxShadow: "0 0 0 1px var(--card-bg-color)",
1046
- "&[data-status=\"inactive\"]": { opacity: "0.5" },
1047
- "&>svg": { "&:not([hidden])": { display: "block" } },
1048
- "&[data-as=\"button\"]": {
1049
- WebkitFontSmoothing: "inherit",
1050
- appearance: "none",
1051
- margin: 0,
1052
- padding: 0,
1053
- border: 0,
1054
- font: "inherit",
1055
- color: "inherit",
1056
- outline: "none",
1057
- "&:focus": { boxShadow: focusRingStyle({ focusRing: avatar.focusRing }) },
1058
- "&:focus:not(:focus-visible)": { boxShadow: "none" }
1059
- }
1060
- };
1061
- }
1062
- function responsiveAvatarSizeStyle(props) {
1063
- let { avatar, media } = getTheme_v2(props.theme);
1064
- return _responsive(media, props.$size, (size) => {
1065
- let avatarSize = avatar.sizes[size] || avatar.sizes[0];
1066
- return {
1067
- width: rem(avatarSize.size),
1068
- height: rem(avatarSize.size),
1069
- borderRadius: rem(avatarSize.size / 2),
1070
- "&>svg": {
1071
- width: rem(avatarSize.size),
1072
- height: rem(avatarSize.size),
1073
- borderRadius: rem(avatarSize.size / 2)
1074
- }
1075
- };
1076
- });
1077
- }
1078
- var avatarArrow = "_1jezl1b0", avatarStack = "_1jezl1b4";
1079
- const StyledAvatar = /* @__PURE__ */ styled.div.withConfig({
1080
- displayName: "StyledAvatar",
1081
- componentId: "sc-3dcnr0-0"
1082
- })(responsiveAvatarSizeStyle, avatarRootStyle), InitialsLabel = /* @__PURE__ */ styled(Label).withConfig({
1083
- displayName: "InitialsLabel",
1084
- componentId: "sc-3dcnr0-1"
1085
- })({ color: "inherit" });
1086
- function AvatarComponent(props) {
1087
- let $ = c(47), __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, ref, restProps, src, t0, t1, t2, title;
1088
- $[0] === props ? (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], ref = $[7], restProps = $[8], src = $[9], t0 = $[10], t1 = $[11], t2 = $[12], title = $[13]) : ({__unstable_hideInnerStroke, as: asProp, color: t0, src, title, initials, onImageLoadError, arrowPosition: arrowPositionProp, animateArrowFrom, ref, status: t1, size: t2, ...restProps} = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = ref, $[8] = restProps, $[9] = src, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = title);
1089
- let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`, t3, t4;
1090
- $[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t3 = () => {
1091
- if (arrowPosition === arrowPositionProp) return;
1092
- let raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1093
- return () => cancelAnimationFrame(raf);
1094
- }, t4 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t3, $[17] = t4) : (t3 = $[16], t4 = $[17]), useEffect(t3, t4);
1095
- let t5, t6;
1096
- $[18] === src ? (t5 = $[19], t6 = $[20]) : (t5 = () => {
1097
- src && setImageFailed(!1);
1098
- }, t6 = [src], $[18] = src, $[19] = t5, $[20] = t6), useEffect(t5, t6);
1099
- let t7;
1100
- $[21] === onImageLoadError ? t7 = $[22] : (t7 = () => {
1101
- setImageFailed(!0), onImageLoadError && onImageLoadError(/* @__PURE__ */ Error("Avatar: the image failed to load"));
1102
- }, $[21] = onImageLoadError, $[22] = t7);
1103
- let handleImageError = t7, T0 = StyledAvatar, t8 = typeof as == "string" ? as : void 0, t10;
1104
- $[23] === color ? t10 = $[24] : (t10 = /* @__PURE__ */ jsx("div", {
1105
- className: avatarArrow,
1106
- children: /* @__PURE__ */ jsx("svg", {
1107
- width: "11",
1108
- height: "7",
1109
- viewBox: "0 0 11 7",
1110
- fill: "none",
1111
- children: /* @__PURE__ */ jsx("path", {
1112
- d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",
1113
- fill: color
1114
- })
1115
- })
1116
- }), $[23] = color, $[24] = t10);
1117
- let t11;
1118
- $[25] !== __unstable_hideInnerStroke || $[26] !== _radius || $[27] !== _sizeRem || $[28] !== handleImageError || $[29] !== imageFailed || $[30] !== imageId || $[31] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxs("svg", {
1119
- className: "_1jezl1b1",
1120
- viewBox: `0 0 ${_sizeRem} ${_sizeRem}`,
1121
- fill: "none",
1122
- children: [
1123
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
1124
- id: imageId,
1125
- patternContentUnits: "objectBoundingBox",
1126
- width: "1",
1127
- height: "1",
1128
- children: /* @__PURE__ */ jsx("image", {
1129
- href: src,
1130
- width: "1",
1131
- height: "1",
1132
- onError: handleImageError
1133
- })
1134
- }) }),
1135
- /* @__PURE__ */ jsx("circle", {
1136
- cx: _radius,
1137
- cy: _radius,
1138
- r: _radius,
1139
- fill: `url(#${imageId})`
1140
- }),
1141
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsx("ellipse", {
1142
- className: "_1jezl1b2",
1143
- cx: _radius,
1144
- cy: _radius,
1145
- rx: _radius,
1146
- ry: _radius,
1147
- vectorEffect: "non-scaling-stroke"
1148
- }),
1149
- /* @__PURE__ */ jsx("ellipse", {
1150
- className: "_1jezl1b3",
1151
- cx: _radius,
1152
- cy: _radius,
1153
- rx: _radius,
1154
- ry: _radius,
1155
- vectorEffect: "non-scaling-stroke"
1156
- })
1157
- ]
1158
- }), $[25] = __unstable_hideInnerStroke, $[26] = _radius, $[27] = _sizeRem, $[28] = handleImageError, $[29] = imageFailed, $[30] = imageId, $[31] = src, $[32] = t11) : t11 = $[32];
1159
- let t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("div", {
1160
- className: "_1jezl1b5",
1161
- children: /* @__PURE__ */ jsx(InitialsLabel, {
1162
- forwardedAs: "span",
1163
- size: size.map(_temp$2),
1164
- weight: "medium",
1165
- children: initials
1166
- })
1167
- }) }), t13;
1168
- return $[33] !== T0 || $[34] !== arrowPosition || $[35] !== as || $[36] !== color || $[37] !== ref || $[38] !== restProps || $[39] !== size || $[40] !== status || $[41] !== t10 || $[42] !== t11 || $[43] !== t12 || $[44] !== t8 || $[45] !== title ? (t13 = /* @__PURE__ */ jsxs(T0, {
1169
- as,
1170
- "data-as": t8,
1171
- "data-ui": "Avatar",
1172
- ...restProps,
1173
- $color: color,
1174
- $size: size,
1175
- "aria-label": title,
1176
- "data-arrow-position": arrowPosition,
1177
- "data-status": status,
1178
- ref,
1179
- title,
1180
- children: [
1181
- t10,
1182
- t11,
1183
- t12
1184
- ]
1185
- }), $[33] = T0, $[34] = arrowPosition, $[35] = as, $[36] = color, $[37] = ref, $[38] = restProps, $[39] = size, $[40] = status, $[41] = t10, $[42] = t11, $[43] = t12, $[44] = t8, $[45] = title, $[46] = t13) : t13 = $[46], t13;
1186
- }
1187
- function _temp$2(s) {
1188
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1189
- }
1190
- /**
1191
- * Avatars are used to represent people and other agents (e.g. bots).
1192
- *
1193
- * @public
1194
- */
1195
- const Avatar = AvatarComponent;
1196
- function _responsiveAvatarCounterSizeStyle(props) {
1197
- let { avatar, media } = getTheme_v2(props.theme);
1198
- return _responsive(media, props.$size, (size) => {
1199
- let avatarSize = avatar.sizes[size];
1200
- return avatarSize ? {
1201
- borderRadius: rem(avatarSize.size / 2),
1202
- minWidth: rem(avatarSize.size),
1203
- height: rem(avatarSize.size)
1204
- } : EMPTY_RECORD;
1205
- });
1206
- }
1207
- function _avatarCounterBaseStyle(props) {
1208
- let { space } = getTheme_v2(props.theme);
1209
- return css`align-items:center;justify-content:center;box-sizing:border-box;user-select:none;color:inherit;color:var(--card-fg-color);background:var(--card-bg-color);box-shadow:0 0 0 1px var(--card-bg-color),inset 0 0 0 1px var(--card-hairline-hard-color);padding:0 ${rem(space[2])};&:not([hidden]){display:flex;}`;
1210
- }
1211
- const StyledAvatarCounter = /* @__PURE__ */ styled.div.withConfig({
1212
- displayName: "StyledAvatarCounter",
1213
- componentId: "sc-rwjooy-0"
1214
- })(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
1215
- /**
1216
- * @public
1217
- */
1218
- function AvatarCounter(props) {
1219
- let $ = c(20), { count, ref, size: t0 } = props, sizeProp = t0 === void 0 ? 1 : t0, T0, T1, t1, t2, t3, t4, t5;
1220
- if ($[0] !== ref || $[1] !== sizeProp) {
1221
- let size = _getArrayProp(sizeProp);
1222
- T1 = StyledAvatarCounter, t3 = size, t4 = "AvatarCounter", t5 = ref, T0 = Label, t1 = "span", t2 = size.map(_temp$1), $[0] = ref, $[1] = sizeProp, $[2] = T0, $[3] = T1, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5;
1223
- } else T0 = $[2], T1 = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8];
1224
- let t6;
1225
- $[9] !== T0 || $[10] !== count || $[11] !== t1 || $[12] !== t2 ? (t6 = /* @__PURE__ */ jsx(T0, {
1226
- as: t1,
1227
- size: t2,
1228
- weight: "medium",
1229
- children: count
1230
- }), $[9] = T0, $[10] = count, $[11] = t1, $[12] = t2, $[13] = t6) : t6 = $[13];
1231
- let t7;
1232
- return $[14] !== T1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx(T1, {
1233
- $size: t3,
1234
- "data-ui": t4,
1235
- ref: t5,
1236
- children: t6
1237
- }), $[14] = T1, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
1238
- }
1239
- function _temp$1(s) {
1240
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1241
- }
1242
- function responsiveAvatarStackSizeStyle(props) {
1243
- let { avatar, media } = getTheme_v2(props.theme);
1244
- return _responsive(media, props.$size, (size) => {
1245
- let avatarSize = avatar.sizes[size];
1246
- return avatarSize ? { "& > div + div": { marginLeft: rem(avatarSize.distance) } } : EMPTY_RECORD;
1247
- });
1248
- }
1249
- const StyledAvatarStack = /* @__PURE__ */ styled.div.withConfig({
1250
- displayName: "StyledAvatarStack",
1251
- componentId: "sc-cw2hpz-0"
1252
- })(responsiveAvatarStackSizeStyle);
1253
- /**
1254
- * @public
1255
- */
1256
- function AvatarStack(props) {
1257
- let $ = c(45), childrenProp, className, ref, restProps, t0, t1;
1258
- $[0] === props ? (childrenProp = $[1], className = $[2], ref = $[3], restProps = $[4], t0 = $[5], t1 = $[6]) : ({children: childrenProp, className, maxLength: t0, ref, size: t1, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = className, $[3] = ref, $[4] = restProps, $[5] = t0, $[6] = t1);
1259
- let maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, T0, t2, t3, t4, t5, t6, t7, t8, t9;
1260
- if ($[7] !== childrenProp || $[8] !== className || $[9] !== maxLengthProp || $[10] !== ref || $[11] !== restProps || $[12] !== sizeProp) {
1261
- let children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), t10;
1262
- $[22] === sizeProp ? t10 = $[23] : (t10 = _getArrayProp(sizeProp), $[22] = sizeProp, $[23] = t10);
1263
- let size = t10, len = children.length, extraCount = len - (maxLength - 1), visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1264
- T0 = StyledAvatarStack, $[24] === className ? t2 = $[25] : (t2 = clsx(avatarStack, className), $[24] = className, $[25] = t2), t3 = "AvatarStack", t4 = restProps, t5 = ref, t6 = size, $[26] !== len || $[27] !== size ? (t7 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, {
1265
- count: len,
1266
- size
1267
- }) }), $[26] = len, $[27] = size, $[28] = t7) : t7 = $[28], $[29] !== extraCount || $[30] !== len || $[31] !== size ? (t8 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, {
1268
- count: extraCount,
1269
- size
1270
- }) }), $[29] = extraCount, $[30] = len, $[31] = size, $[32] = t8) : t8 = $[32];
1271
- let t11;
1272
- $[33] === size ? t11 = $[34] : (t11 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, { size }) }, String(childIndex)), $[33] = size, $[34] = t11), t9 = visibleChildren.map(t11), $[7] = childrenProp, $[8] = className, $[9] = maxLengthProp, $[10] = ref, $[11] = restProps, $[12] = sizeProp, $[13] = T0, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7, $[20] = t8, $[21] = t9;
1273
- } else T0 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17], t6 = $[18], t7 = $[19], t8 = $[20], t9 = $[21];
1274
- let t10;
1275
- return $[35] !== T0 || $[36] !== t2 || $[37] !== t3 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9 ? (t10 = /* @__PURE__ */ jsxs(T0, {
1276
- className: t2,
1277
- "data-ui": t3,
1278
- ...t4,
1279
- ref: t5,
1280
- $size: t6,
1281
- children: [
1282
- t7,
1283
- t8,
1284
- t9
1285
- ]
1286
- }), $[35] = T0, $[36] = t2, $[37] = t3, $[38] = t4, $[39] = t5, $[40] = t6, $[41] = t7, $[42] = t8, $[43] = t9, $[44] = t10) : t10 = $[44], t10;
1287
- }
1288
- function badgeStyle(props) {
1289
- let { $tone } = props;
1290
- return {
1291
- "--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
1292
- "--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
1293
- backgroundColor: "var(--card-bg-color)",
1294
- cursor: "default",
1295
- "&:not([hidden])": {
1296
- display: "inline-block",
1297
- verticalAlign: "top"
1298
- }
1299
- };
1300
- }
1301
- const StyledBadge = /* @__PURE__ */ styled(Box).withConfig({
1302
- displayName: "StyledBadge",
1303
- componentId: "sc-zj5mk0-0"
1304
- })(responsiveRadiusStyle, badgeStyle), Badge = function Badge(props) {
1305
- let $ = c(22), children, ref, restProps, t0, t1, t2, t3;
1306
- $[0] === props ? (children = $[1], ref = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7]) : ({children, fontSize: t0, padding: t1, radius: t2, ref, tone: t3, ...restProps} = props, $[0] = props, $[1] = children, $[2] = ref, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3);
1307
- let fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4;
1308
- $[8] === radius ? t4 = $[9] : (t4 = _getArrayProp(radius), $[8] = radius, $[9] = t4);
1309
- let t5;
1310
- $[10] === padding ? t5 = $[11] : (t5 = _getArrayProp(padding), $[10] = padding, $[11] = t5);
1311
- let t6;
1312
- $[12] !== children || $[13] !== fontSize ? (t6 = /* @__PURE__ */ jsx(Text, {
1313
- size: fontSize,
1314
- children
1315
- }), $[12] = children, $[13] = fontSize, $[14] = t6) : t6 = $[14];
1316
- let t7;
1317
- return $[15] !== ref || $[16] !== restProps || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== tone ? (t7 = /* @__PURE__ */ jsx(StyledBadge, {
1318
- "data-ui": "Badge",
1319
- ...restProps,
1320
- $tone: tone,
1321
- $radius: t4,
1322
- padding: t5,
1323
- ref,
1324
- children: t6
1325
- }), $[15] = ref, $[16] = restProps, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = tone, $[21] = t7) : t7 = $[21], t7;
1326
- };
1327
- function inputElementStyles(props) {
1328
- let { color, input, radius } = getTheme_v2(props.theme), { focusRing } = input.checkbox;
1329
- return css`position:absolute;top:0;left:0;width:100%;height:100%;outline:none;opacity:0;z-index:1;padding:0;margin:0;& + span{position:relative;display:block;height:${rem(input.checkbox.size)};width:${rem(input.checkbox.size)};box-sizing:border-box;box-shadow:${focusRingBorderStyle({
1330
- color: color.input.default.enabled.border,
1331
- width: input.border.width
1332
- })};border-radius:${rem(radius[2])};line-height:1;background-color:${color.input.default.enabled.bg};& > svg{display:block;position:absolute;opacity:0;height:100%;width:100%;& > path{vector-effect:non-scaling-stroke;stroke-width:1.5px !important;}}}&:checked + span{background:${color.input.default.enabled.fg};box-shadow:${focusRingBorderStyle({
1333
- color: color.input.default.enabled.fg,
1334
- width: input.border.width
1335
- })};color:${color.input.default.enabled.bg};}&:not(:disabled):focus:focus-visible + span{box-shadow:${focusRingStyle({ focusRing })};}&:not(:disabled):focus:focus-visible&:checked + span{box-shadow:${focusRingStyle({ focusRing: {
1336
- width: 1,
1337
- offset: 1
1338
- } })};}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${focusRingBorderStyle({
1339
- width: input.border.width,
1340
- color: color.input.invalid.enabled.muted.bg
1341
- })};color:${color.input.default.disabled.fg};}&[data-error]&:checked + span{background-color:${color.input.invalid.enabled.muted.bg};color:${color.input.default.enabled.bg};}&[data-error]&:checked&:not(:disabled):focus:focus-visible + span{box-shadow:${focusRingStyle({
1342
- border: {
1343
- width: input.border.width,
1344
- color: color.input.invalid.readOnly.muted.bg
1345
- },
1346
- focusRing: {
1347
- width: 1,
1348
- offset: 1
1349
- }
1350
- })};}&:disabled + span{background-color:${color.input.default.disabled.bg};box-shadow:${focusRingBorderStyle({
1351
- width: input.border.width,
1352
- color: color.input.default.disabled.border
1353
- })};color:${color.input.default.disabled.fg};}&:disabled&:checked + span{background-color:${color.input.default.disabled.muted.bg};}&[data-read-only] + span{background-color:${color.input.default.readOnly.bg};box-shadow:${focusRingBorderStyle({
1354
- width: input.border.width,
1355
- color: color.input.default.readOnly.border
1356
- })};color:${color.input.default.readOnly.fg};}&[data-read-only]&:checked + span{background-color:${color.input.default.readOnly.muted.bg};}&:checked + span > svg:first-child{opacity:1;}&:indeterminate + span > svg:last-child{opacity:1;}`;
1357
- }
1358
- var checkbox = "ycv36y0";
1359
- const Input$3 = /* @__PURE__ */ styled.input.withConfig({
1360
- displayName: "Input",
1361
- componentId: "sc-ng4gkf-0"
1362
- })(inputElementStyles);
1363
- /**
1364
- * Checkboxes allow the user to select one or more items from a set.
1365
- *
1366
- * @public
1367
- */
9
+ import { CloseIcon } from "@sanity/icons/Close";
10
+ import { createPortal } from "react-dom";
11
+ const PREFIX = "sui", BREAKPOINTS_LENGTH = 6;
12
+ function getProps(componentProps, propDefs) {
13
+ const {
14
+ allComponentProps,
15
+ allPropDefs
16
+ } = flattenCompositeProps(componentProps, propDefs), restProps = {};
17
+ let className = componentProps?.className || "", style = componentProps?.style || {};
18
+ for (const key in allComponentProps) {
19
+ const propDef = allPropDefs?.[key], propValue = allComponentProps[key];
20
+ if (!(propDef && "className" in propDef && propDef.className || propDef?.type === "conditional")) {
21
+ restProps[key] = propValue;
22
+ continue;
23
+ }
24
+ if (Array.isArray(propValue))
25
+ for (let i = 0, len = Math.min(propValue.length, BREAKPOINTS_LENGTH); i < len; i++) {
26
+ const resolvedPropDef = getResolvedPropDef(propValue[i], propDef);
27
+ resolvedPropDef && (className = clsx(className, getClassName(propValue[i], resolvedPropDef, i)), style = {
28
+ ...style,
29
+ ...getStyle(propValue[i], resolvedPropDef, i)
30
+ });
31
+ }
32
+ else {
33
+ const resolvedPropDef = getResolvedPropDef(propValue, propDef);
34
+ if (!resolvedPropDef) {
35
+ restProps[key] = propValue;
36
+ continue;
37
+ }
38
+ className = clsx(className, getClassName(propValue, resolvedPropDef)), style = {
39
+ ...style,
40
+ ...getStyle(propValue, resolvedPropDef)
41
+ };
42
+ }
43
+ }
44
+ return {
45
+ ...restProps,
46
+ className,
47
+ style
48
+ };
49
+ }
50
+ function getResolvedPropDef(propValue, propDef) {
51
+ if (propDef?.type !== "conditional")
52
+ return propDef;
53
+ const resolvedPropDef = propDef.resolve(propValue);
54
+ return resolvedPropDef && "className" in resolvedPropDef && resolvedPropDef.className ? resolvedPropDef : null;
55
+ }
56
+ function getClassName(propValue, propDef, bp) {
57
+ if (propDef.type === "union" && propDef.values?.includes(propValue))
58
+ return `${PREFIX}-${propDef.className}${typeof propValue == "string" ? `-${propValue}` : propValue}${bp ? `-bp-${bp}` : ""}`;
59
+ if (propDef.type === "string" || propDef.type === "number")
60
+ return `${PREFIX}-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
61
+ if (propDef.type === "boolean") {
62
+ if (propValue)
63
+ return `${PREFIX}-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
64
+ if (!propValue && propDef.inverseClassName)
65
+ return `${PREFIX}-${propDef.inverseClassName}${bp ? `-bp-${bp}` : ""}`;
66
+ }
67
+ return "";
68
+ }
69
+ function getStyle(propValue, propDef, bp) {
70
+ return (propDef.type === "string" || propDef.type === "number") && propDef.variable ? {
71
+ [`${propDef.variable}${bp ? `-bp-${bp}` : ""}`]: propValue
72
+ } : {};
73
+ }
74
+ function flattenCompositeProps(componentProps, propDefs) {
75
+ const props = {
76
+ allComponentProps: {},
77
+ allPropDefs: {}
78
+ };
79
+ for (const key in componentProps)
80
+ if (propDefs?.[key] && propDefs?.[key].type === "composite")
81
+ for (const compositeKey in propDefs?.[key].composition) {
82
+ const compositeValue = getCompositeValue(componentProps[key], propDefs[key], compositeKey);
83
+ props.allComponentProps[compositeKey] = compositeValue, props.allPropDefs[compositeKey] = propDefs[key].composition[compositeKey]?.propDef;
84
+ }
85
+ else
86
+ props.allComponentProps[key] = componentProps[key], props.allPropDefs[key] = propDefs?.[key];
87
+ return props;
88
+ }
89
+ function getCompositeValue(propValue, propDef, key) {
90
+ if (!("composition" in propDef))
91
+ return;
92
+ const mapping = propDef.composition[key]?.mapping;
93
+ let compositeValue;
94
+ if (Array.isArray(propValue)) {
95
+ compositeValue = [];
96
+ for (let i = 0, len = propValue.length; i < len; i++)
97
+ compositeValue[i] = mapping?.[propValue[i]];
98
+ } else
99
+ compositeValue = mapping?.[propValue];
100
+ return compositeValue;
101
+ }
102
+ const HASH = "ad9fa1";
103
+ function suffixClassName(className) {
104
+ return `${className}-${HASH}`;
105
+ }
106
+ const RADIUS = [0, 1, 2, 3, 4, 5, 6, "full"], borderProps = {
107
+ border: {
108
+ type: "boolean",
109
+ className: "border",
110
+ inverseClassName: "border-none"
111
+ },
112
+ borderTop: {
113
+ type: "boolean",
114
+ className: "border-top",
115
+ inverseClassName: "border-top-none"
116
+ },
117
+ borderRight: {
118
+ type: "boolean",
119
+ className: "border-right",
120
+ inverseClassName: "border-right-none"
121
+ },
122
+ borderBottom: {
123
+ type: "boolean",
124
+ className: "border-bottom",
125
+ inverseClassName: "border-bottom-none"
126
+ },
127
+ borderLeft: {
128
+ type: "boolean",
129
+ className: "border-left",
130
+ inverseClassName: "border-left-none"
131
+ },
132
+ radius: {
133
+ type: "union",
134
+ className: "radius",
135
+ values: RADIUS
136
+ }
137
+ }, flexChildProps = {
138
+ flexBasis: {
139
+ type: "string",
140
+ className: "flex-basis",
141
+ variable: "--flex-basis"
142
+ },
143
+ flexGrow: {
144
+ type: "number",
145
+ className: "flex-grow",
146
+ variable: "--flex-grow"
147
+ },
148
+ flexShrink: {
149
+ type: "number",
150
+ className: "flex-shrink",
151
+ variable: "--flex-shrink"
152
+ }
153
+ }, gridChildProps = {
154
+ gridColumn: {
155
+ type: "string",
156
+ className: "grid-column",
157
+ variable: "--grid-column"
158
+ },
159
+ gridColumnStart: {
160
+ type: "string",
161
+ className: "grid-column-start",
162
+ variable: "--grid-column-start"
163
+ },
164
+ gridColumnEnd: {
165
+ type: "string",
166
+ className: "grid-column-end",
167
+ variable: "--grid-column-end"
168
+ },
169
+ gridRow: {
170
+ type: "string",
171
+ className: "grid-row",
172
+ variable: "--grid-row"
173
+ },
174
+ gridRowStart: {
175
+ type: "string",
176
+ className: "grid-row-start",
177
+ variable: "--grid-row-start"
178
+ },
179
+ gridRowEnd: {
180
+ type: "string",
181
+ className: "grid-row-end",
182
+ variable: "--grid-row-end"
183
+ }
184
+ }, heightProps = {
185
+ height: {
186
+ type: "string",
187
+ className: "height",
188
+ variable: "--height"
189
+ },
190
+ minHeight: {
191
+ type: "string",
192
+ className: "min-height",
193
+ variable: "--min-height"
194
+ },
195
+ maxHeight: {
196
+ type: "string",
197
+ className: "max-height",
198
+ variable: "--max-height"
199
+ }
200
+ }, SPACE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], SPACE_AUTO = [...SPACE, "auto"], SPACE_INHERIT = [...SPACE, "inherit"], SPACE_AUTO_NEGATIVE = [-9, -8, -7, -6, -5, -4, -3, -2, -1, ...SPACE, "auto"], marginProps = {
201
+ margin: {
202
+ type: "union",
203
+ className: "m",
204
+ values: SPACE_AUTO_NEGATIVE
205
+ },
206
+ marginX: {
207
+ type: "union",
208
+ className: "mx",
209
+ values: SPACE_AUTO_NEGATIVE
210
+ },
211
+ marginY: {
212
+ type: "union",
213
+ className: "my",
214
+ values: SPACE_AUTO_NEGATIVE
215
+ },
216
+ marginTop: {
217
+ type: "union",
218
+ className: "mt",
219
+ values: SPACE_AUTO_NEGATIVE
220
+ },
221
+ marginRight: {
222
+ type: "union",
223
+ className: "mr",
224
+ values: SPACE_AUTO_NEGATIVE
225
+ },
226
+ marginBottom: {
227
+ type: "union",
228
+ className: "mb",
229
+ values: SPACE_AUTO_NEGATIVE
230
+ },
231
+ marginLeft: {
232
+ type: "union",
233
+ className: "ml",
234
+ values: SPACE_AUTO_NEGATIVE
235
+ }
236
+ }, OVERFLOW = ["visible", "hidden", "auto", "scroll", "clip"], overflowProps = {
237
+ overflow: {
238
+ type: "union",
239
+ className: "overflow",
240
+ values: OVERFLOW
241
+ },
242
+ overflowX: {
243
+ type: "union",
244
+ className: "overflow-x",
245
+ values: OVERFLOW
246
+ },
247
+ overflowY: {
248
+ type: "union",
249
+ className: "overflow-y",
250
+ values: OVERFLOW
251
+ }
252
+ }, paddingProps = {
253
+ padding: {
254
+ type: "union",
255
+ className: "p",
256
+ values: SPACE
257
+ },
258
+ paddingX: {
259
+ type: "union",
260
+ className: "px",
261
+ values: SPACE
262
+ },
263
+ paddingY: {
264
+ type: "union",
265
+ className: "py",
266
+ values: SPACE
267
+ },
268
+ paddingTop: {
269
+ type: "union",
270
+ className: "pt",
271
+ values: SPACE
272
+ },
273
+ paddingRight: {
274
+ type: "union",
275
+ className: "pr",
276
+ values: SPACE
277
+ },
278
+ paddingBottom: {
279
+ type: "union",
280
+ className: "pb",
281
+ values: SPACE
282
+ },
283
+ paddingLeft: {
284
+ type: "union",
285
+ className: "pl",
286
+ values: SPACE
287
+ }
288
+ }, POSITION = ["absolute", "fixed", "relative", "static", "sticky"], positionProps = {
289
+ position: {
290
+ type: "union",
291
+ className: "position",
292
+ values: POSITION
293
+ },
294
+ inset: {
295
+ type: "union",
296
+ className: "inset",
297
+ values: SPACE_AUTO
298
+ },
299
+ top: {
300
+ type: "union",
301
+ className: "top",
302
+ values: SPACE_AUTO
303
+ },
304
+ right: {
305
+ type: "union",
306
+ className: "right",
307
+ values: SPACE_AUTO
308
+ },
309
+ bottom: {
310
+ type: "union",
311
+ className: "bottom",
312
+ values: SPACE_AUTO
313
+ },
314
+ left: {
315
+ type: "union",
316
+ className: "left",
317
+ values: SPACE_AUTO
318
+ }
319
+ }, SHADOW = [0, 1, 2, 3, 4, 5], shadowProps = {
320
+ shadow: {
321
+ type: "union",
322
+ className: "shadow",
323
+ values: SHADOW
324
+ }
325
+ }, TONE = ["neutral", "positive", "suggest", "caution", "critical"], toneProps = {
326
+ tone: {
327
+ type: "union",
328
+ className: "tone",
329
+ values: TONE
330
+ }
331
+ }, widthProps = {
332
+ width: {
333
+ type: "string",
334
+ className: "width",
335
+ variable: "--width"
336
+ },
337
+ minWidth: {
338
+ type: "string",
339
+ className: "min-width",
340
+ variable: "--min-width"
341
+ },
342
+ maxWidth: {
343
+ type: "string",
344
+ className: "max-width",
345
+ variable: "--max-width"
346
+ }
347
+ }, zIndexProps = {
348
+ zIndex: {
349
+ type: "number",
350
+ className: "z-index",
351
+ variable: "--z-index"
352
+ }
353
+ }, layoutProps = {
354
+ ...toneProps,
355
+ ...widthProps,
356
+ ...heightProps,
357
+ ...marginProps,
358
+ ...borderProps,
359
+ ...paddingProps,
360
+ ...positionProps,
361
+ ...overflowProps,
362
+ ...flexChildProps,
363
+ ...gridChildProps,
364
+ ...shadowProps,
365
+ ...zIndexProps
366
+ }, DISPLAY_BLOCK = ["block", "inline-block", "none"], DISPLAY_FLEX = ["flex", "inline-flex", "none"], DISPLAY_GRID = ["grid", "inline-grid", "none"], boxProps = {
367
+ as: {
368
+ type: "string"
369
+ },
370
+ display: {
371
+ type: "union",
372
+ className: "display",
373
+ values: DISPLAY_BLOCK
374
+ },
375
+ ...layoutProps
376
+ }, boxClassName = suffixClassName("sui-Box");
377
+ function Box(t0) {
378
+ const $ = c(12);
379
+ let T0, children, rest, style, t1;
380
+ if ($[0] !== t0) {
381
+ const {
382
+ display: t22,
383
+ minHeight: t3,
384
+ minWidth: t4,
385
+ ...props
386
+ } = t0, display = t22 === void 0 ? "block" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
387
+ as,
388
+ children: t5,
389
+ className,
390
+ style: t6,
391
+ ...t7
392
+ } = getProps({
393
+ display,
394
+ minHeight,
395
+ minWidth,
396
+ ...props
397
+ }, boxProps);
398
+ children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(boxClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
399
+ } else
400
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
401
+ let t2;
402
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Box", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
403
+ }
404
+ const ALIGN_ITEMS = ["baseline", "center", "flex-end", "flex-start", "stretch"], JUSTIFY_CONTENT = ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"], FLEX_DIRECTION = ["row", "row-reverse", "column", "column-reverse"], FLEX_WRAP = ["wrap", "wrap-reverse", "nowrap"], flexParentProps = {
405
+ alignItems: {
406
+ type: "union",
407
+ className: "align-items",
408
+ values: ALIGN_ITEMS
409
+ },
410
+ justifyContent: {
411
+ type: "union",
412
+ className: "justify-content",
413
+ values: JUSTIFY_CONTENT
414
+ },
415
+ flexDirection: {
416
+ type: "union",
417
+ className: "flex-direction",
418
+ values: FLEX_DIRECTION
419
+ },
420
+ flexWrap: {
421
+ type: "union",
422
+ className: "flex",
423
+ values: FLEX_WRAP
424
+ }
425
+ }, gapProps = {
426
+ gap: {
427
+ type: "union",
428
+ className: "gap",
429
+ values: SPACE_INHERIT
430
+ },
431
+ rowGap: {
432
+ type: "union",
433
+ className: "row-gap",
434
+ values: SPACE_INHERIT
435
+ },
436
+ columnGap: {
437
+ type: "union",
438
+ className: "column-gap",
439
+ values: SPACE_INHERIT
440
+ }
441
+ }, flexProps = {
442
+ as: {
443
+ type: "string"
444
+ },
445
+ display: {
446
+ type: "union",
447
+ className: "display",
448
+ values: DISPLAY_FLEX
449
+ },
450
+ ...flexParentProps,
451
+ ...gapProps,
452
+ ...layoutProps
453
+ }, flexClassName = suffixClassName("sui-Flex");
454
+ function Flex(t0) {
455
+ const $ = c(12);
456
+ let T0, children, rest, style, t1;
457
+ if ($[0] !== t0) {
458
+ const {
459
+ display: t22,
460
+ minHeight: t3,
461
+ minWidth: t4,
462
+ ...props
463
+ } = t0, display = t22 === void 0 ? "flex" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
464
+ as,
465
+ children: t5,
466
+ className,
467
+ style: t6,
468
+ ...t7
469
+ } = getProps({
470
+ display,
471
+ minHeight,
472
+ minWidth,
473
+ ...props
474
+ }, flexProps);
475
+ children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(flexClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
476
+ } else
477
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
478
+ let t2;
479
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Flex", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
480
+ }
481
+ const FONT_WEIGHT = ["regular", "medium", "semibold", "bold"], TEXT_ALIGN = ["left", "center", "right", "justify"], typographyProps = {
482
+ align: {
483
+ type: "union",
484
+ className: "text",
485
+ values: TEXT_ALIGN
486
+ },
487
+ muted: {
488
+ type: "boolean",
489
+ className: "text-muted",
490
+ inverseClassName: "text-default"
491
+ },
492
+ trim: {
493
+ type: "boolean",
494
+ className: "text-trim",
495
+ inverseClassName: "text-trim-none"
496
+ },
497
+ truncate: {
498
+ type: "conditional",
499
+ resolve: (value) => value === 1 ? {
500
+ type: "number",
501
+ className: "text-overflow"
502
+ } : {
503
+ type: "number",
504
+ className: "line-clamp",
505
+ variable: "--line-clamp"
506
+ }
507
+ },
508
+ weight: {
509
+ type: "union",
510
+ className: "weight",
511
+ values: FONT_WEIGHT
512
+ },
513
+ ...marginProps,
514
+ ...toneProps
515
+ }, ICON_SIZE = [0, 1, 2, 3, 4], iconProps = {
516
+ icon: {
517
+ type: "string"
518
+ },
519
+ size: {
520
+ type: "union",
521
+ className: "icon-body",
522
+ values: ICON_SIZE
523
+ },
524
+ muted: typographyProps.muted,
525
+ ...toneProps,
526
+ ...marginProps
527
+ }, iconClassName = suffixClassName("sui-Icon");
528
+ function Icon(t0) {
529
+ const $ = c(12);
530
+ let T0, props, rest, style, t1;
531
+ if ($[0] !== t0) {
532
+ const {
533
+ size: t22,
534
+ ...t32
535
+ } = t0;
536
+ props = t32;
537
+ const size = t22 === void 0 ? 2 : t22, {
538
+ className,
539
+ style: t4,
540
+ icon: Component,
541
+ ...t5
542
+ } = getProps({
543
+ size,
544
+ ...props
545
+ }, iconProps);
546
+ style = t4, rest = t5, T0 = Component, t1 = clsx(iconClassName, className), $[0] = t0, $[1] = T0, $[2] = props, $[3] = rest, $[4] = style, $[5] = t1;
547
+ } else
548
+ T0 = $[1], props = $[2], rest = $[3], style = $[4], t1 = $[5];
549
+ const t2 = props["aria-label"] ? void 0 : !0;
550
+ let t3;
551
+ return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, "data-ui": "Icon", style, "aria-hidden": t2, ...rest }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
552
+ }
553
+ const spinnerProps = {
554
+ size: {
555
+ type: "union",
556
+ className: "icon-body",
557
+ values: ICON_SIZE
558
+ }
559
+ }, spinnerClassName = suffixClassName("sui-Spinner");
560
+ function Spinner(t0) {
561
+ const $ = c(12);
562
+ let T0, rest, style, t1, t2;
563
+ if ($[0] !== t0) {
564
+ const {
565
+ size: t32,
566
+ ...props
567
+ } = t0, size = t32 === void 0 ? 2 : t32, {
568
+ className,
569
+ style: t4,
570
+ ...t5
571
+ } = getProps({
572
+ size,
573
+ ...props
574
+ }, spinnerProps);
575
+ style = t4, rest = t5, T0 = Icon, t1 = SpinnerIcon, t2 = clsx(spinnerClassName, className), $[0] = t0, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
576
+ } else
577
+ T0 = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
578
+ let t3;
579
+ return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { icon: t1, className: t2, style, "data-ui": "Spinner", role: "status", "aria-label": "Loading...", ...rest }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
580
+ }
581
+ const TEXT_SIZE = [0, 1, 2, 3, 4], textProps = {
582
+ as: {
583
+ type: "string"
584
+ },
585
+ size: {
586
+ type: "union",
587
+ className: "text-body",
588
+ values: TEXT_SIZE
589
+ },
590
+ ...typographyProps
591
+ }, textClassName = suffixClassName("sui-Text");
592
+ function Text(t0) {
593
+ const $ = c(15);
594
+ let T0, children, rest, style, t1, t2;
595
+ if ($[0] !== t0) {
596
+ t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
597
+ bb0: {
598
+ const {
599
+ size: t32,
600
+ ...props
601
+ } = t0, size = t32 === void 0 ? 2 : t32, {
602
+ as,
603
+ children: t4,
604
+ className,
605
+ style: t5,
606
+ ...t6
607
+ } = getProps({
608
+ size,
609
+ ...props
610
+ }, textProps);
611
+ children = t4, style = t5, rest = t6;
612
+ const Component = as || "span";
613
+ if (props.truncate && props.trim) {
614
+ const t7 = clsx(textClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t8 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
615
+ let t9;
616
+ $[7] !== t8 ? (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9) : t9 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t7, style, "data-ui": "Text", ...rest, children: /* @__PURE__ */ jsx("span", { className: t9, children }) });
617
+ break bb0;
618
+ }
619
+ T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
620
+ }
621
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
622
+ } else
623
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
624
+ if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
625
+ return t2;
626
+ let t3;
627
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Text", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
628
+ }
629
+ const BUTTON_DENSITY = ["regular", "loose"], BUTTON_LEVEL = ["primary", "secondary", "tertiary"], BUTTON_TONE = ["neutral", "critical"], buttonProps = {
630
+ as: {
631
+ type: "string"
632
+ },
633
+ density: {
634
+ type: "composite",
635
+ values: BUTTON_DENSITY,
636
+ composition: {
637
+ gap: {
638
+ propDef: gapProps.gap,
639
+ mapping: {
640
+ regular: 2,
641
+ loose: 3
642
+ }
643
+ },
644
+ padding: {
645
+ propDef: paddingProps.padding,
646
+ mapping: {
647
+ regular: 2,
648
+ loose: 3
649
+ }
650
+ },
651
+ minHeight: {
652
+ propDef: heightProps.minHeight,
653
+ mapping: {
654
+ regular: "25px",
655
+ loose: "33px"
656
+ }
657
+ },
658
+ minWidth: {
659
+ propDef: widthProps.minWidth,
660
+ mapping: {
661
+ regular: "25px",
662
+ loose: "33px"
663
+ }
664
+ }
665
+ }
666
+ },
667
+ fullWidth: {
668
+ type: "boolean",
669
+ className: "width-full",
670
+ inverseClassName: "width-auto"
671
+ },
672
+ iconStart: {
673
+ type: "string"
674
+ },
675
+ iconEnd: {
676
+ type: "string"
677
+ },
678
+ level: {
679
+ type: "union",
680
+ className: "button-level",
681
+ values: BUTTON_LEVEL
682
+ },
683
+ loading: {
684
+ type: "boolean"
685
+ },
686
+ text: {
687
+ type: "string"
688
+ },
689
+ tone: {
690
+ type: "union",
691
+ className: "tone",
692
+ values: BUTTON_TONE
693
+ }
694
+ }, buttonClassName = suffixClassName("sui-Button");
695
+ function Button(t0) {
696
+ const $ = c(26);
697
+ let T0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9;
698
+ if ($[0] !== t0) {
699
+ const {
700
+ density: t122,
701
+ level: t13,
702
+ tone: t14,
703
+ ...props
704
+ } = t0, density = t122 === void 0 ? "regular" : t122, level = t13 === void 0 ? "primary" : t13, tone = t14 === void 0 ? "neutral" : t14, {
705
+ as,
706
+ children,
707
+ className,
708
+ disabled,
709
+ style,
710
+ iconStart: IconStart,
711
+ iconEnd: IconEnd,
712
+ loading,
713
+ text,
714
+ ...rest
715
+ } = getProps({
716
+ density,
717
+ level,
718
+ tone,
719
+ ...props
720
+ }, buttonProps);
721
+ T0 = as || "button", t1 = clsx(buttonClassName, "sui-display-inline-flex sui-align-items-center sui-justify-content-center sui-radius2 sui-position-relative sui-overflow-hidden", className), t2 = style, t3 = "Button", t4 = disabled || loading, t5 = loading ? !0 : void 0, t6 = rest, t7 = loading && /* @__PURE__ */ jsx(Flex, { position: "absolute", inset: 0, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(Spinner, {}) }), t8 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, { icon: IconStart, marginX: -1, marginY: -2, size: 1 })), t9 = text && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", trim: !0, children: text }), t10 = children, t11 = IconEnd && (isValidElement(IconEnd) ? IconEnd : /* @__PURE__ */ jsx(Icon, { icon: IconEnd, marginX: -1, marginY: -2, size: 1 })), $[0] = t0, $[1] = T0, $[2] = t1, $[3] = t10, $[4] = t11, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5, $[9] = t6, $[10] = t7, $[11] = t8, $[12] = t9;
722
+ } else
723
+ T0 = $[1], t1 = $[2], t10 = $[3], t11 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8], t6 = $[9], t7 = $[10], t8 = $[11], t9 = $[12];
724
+ let t12;
725
+ return $[13] !== T0 || $[14] !== t1 || $[15] !== t10 || $[16] !== t11 || $[17] !== t2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 ? (t12 = /* @__PURE__ */ jsxs(T0, { className: t1, style: t2, "data-ui": t3, disabled: t4, "aria-busy": t5, ...t6, children: [
726
+ t7,
727
+ t8,
728
+ t9,
729
+ t10,
730
+ t11
731
+ ] }), $[13] = T0, $[14] = t1, $[15] = t10, $[16] = t11, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t12) : t12 = $[25], t12;
732
+ }
733
+ const DENSITY = ["compact", "regular", "loose"], cardProps = {
734
+ as: {
735
+ type: "string"
736
+ },
737
+ density: {
738
+ type: "composite",
739
+ values: DENSITY,
740
+ composition: {
741
+ gap: {
742
+ propDef: gapProps.gap,
743
+ mapping: {
744
+ compact: 2,
745
+ regular: 3,
746
+ loose: 4
747
+ }
748
+ },
749
+ padding: {
750
+ propDef: paddingProps.padding,
751
+ mapping: {
752
+ compact: 3,
753
+ regular: 4,
754
+ loose: 5
755
+ }
756
+ },
757
+ radius: {
758
+ propDef: borderProps.radius,
759
+ mapping: {
760
+ compact: 2,
761
+ regular: 3,
762
+ loose: 4
763
+ }
764
+ }
765
+ }
766
+ },
767
+ ...toneProps,
768
+ ...marginProps
769
+ }, cardClassName = suffixClassName("sui-Card");
770
+ function Card(t0) {
771
+ const $ = c(12);
772
+ let T0, children, rest, style, t1;
773
+ if ($[0] !== t0) {
774
+ const {
775
+ density: t22,
776
+ tone: t3,
777
+ ...props
778
+ } = t0, density = t22 === void 0 ? "regular" : t22, tone = t3 === void 0 ? "neutral" : t3, {
779
+ as,
780
+ children: t4,
781
+ className,
782
+ style: t5,
783
+ ...t6
784
+ } = getProps({
785
+ density,
786
+ tone,
787
+ ...props
788
+ }, cardProps);
789
+ children = t4, style = t5, rest = t6, T0 = as || "div", t1 = clsx(cardClassName, "sui-border", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
790
+ } else
791
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
792
+ let t2;
793
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Card", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
794
+ }
795
+ const labelProps = {
796
+ disabled: {
797
+ type: "boolean"
798
+ },
799
+ error: {
800
+ type: "boolean"
801
+ },
802
+ ...marginProps
803
+ }, labelClassName = suffixClassName("sui-Label");
804
+ function Label(props) {
805
+ const $ = c(18);
806
+ let T0, children, rest, style, t0, t1, t2, t3;
807
+ if ($[0] !== props) {
808
+ const {
809
+ children: t42,
810
+ className,
811
+ style: t5,
812
+ disabled,
813
+ error,
814
+ ...t6
815
+ } = getProps(props, labelProps);
816
+ children = t42, style = t5, rest = t6, T0 = Text, t0 = "label", t1 = 1, t2 = disabled, t3 = clsx(labelClassName, "sui-display-flex sui-align-items-center sui-gap2", error && "sui-error", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = t3;
817
+ } else
818
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7], t3 = $[8];
819
+ let t4;
820
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t0, size: t1, muted: t2, className: t3, style, "data-ui": "Label", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
821
+ }
822
+ const visuallyHiddenProps = {
823
+ as: {
824
+ type: "string"
825
+ },
826
+ visibleOnFocus: {
827
+ type: "boolean",
828
+ className: "sui-visually-hidden-visible"
829
+ }
830
+ }, visuallyHiddenClassName = suffixClassName("sui-VisuallyHidden");
831
+ function VisuallyHidden(props) {
832
+ const $ = c(12);
833
+ let T0, children, rest, style, t0;
834
+ if ($[0] !== props) {
835
+ const {
836
+ as,
837
+ children: t12,
838
+ className,
839
+ style: t2,
840
+ ...t3
841
+ } = getProps(props, visuallyHiddenProps);
842
+ children = t12, style = t2, rest = t3, T0 = as || "span", t0 = clsx(visuallyHiddenClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
843
+ } else
844
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
845
+ let t1;
846
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "VisuallyHidden", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
847
+ }
848
+ const checkboxProps = {
849
+ error: {
850
+ type: "boolean"
851
+ },
852
+ indeterminate: {
853
+ type: "boolean"
854
+ },
855
+ label: {
856
+ type: "string"
857
+ },
858
+ ...marginProps
859
+ }, checkboxClassName = suffixClassName("sui-Checkbox"), checkboxInputClassName = suffixClassName("sui-CheckboxInput"), checkboxMarkClassName = suffixClassName("sui-CheckboxMark");
1368
860
  function Checkbox(props) {
1369
- let $ = c(28), checked, className, customValidity, disabled, forwardedRef, indeterminate, readOnly, restProps, style;
1370
- $[0] === props ? (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], forwardedRef = $[5], indeterminate = $[6], readOnly = $[7], restProps = $[8], style = $[9]) : ({checked, className, disabled, indeterminate, customValidity, readOnly, ref: forwardedRef, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = forwardedRef, $[6] = indeterminate, $[7] = readOnly, $[8] = restProps, $[9] = style);
1371
- let ref = useRef(null), t0;
1372
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[10] = t0) : t0 = $[10], useImperativeHandle(forwardedRef, t0);
1373
- let t1, t2;
1374
- $[11] === indeterminate ? (t1 = $[12], t2 = $[13]) : (t1 = () => {
1375
- ref.current && (ref.current.indeterminate = indeterminate || !1);
1376
- }, t2 = [indeterminate], $[11] = indeterminate, $[12] = t1, $[13] = t2), useEffect(t1, t2), useCustomValidity(ref, customValidity);
1377
- let t3;
1378
- $[14] === className ? t3 = $[15] : (t3 = clsx(checkbox, className), $[14] = className, $[15] = t3);
1379
- let t4 = !disabled && readOnly ? "" : void 0, t5 = customValidity ? "" : void 0, t6 = disabled || readOnly, t7;
1380
- $[16] !== checked || $[17] !== readOnly || $[18] !== restProps || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsx(Input$3, {
1381
- "data-read-only": t4,
1382
- "data-error": t5,
1383
- ...restProps,
1384
- checked,
1385
- disabled: t6,
1386
- type: "checkbox",
1387
- readOnly,
1388
- ref
1389
- }), $[16] = checked, $[17] = readOnly, $[18] = restProps, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22];
1390
- let t8;
1391
- $[23] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(CheckmarkIcon, {}), /* @__PURE__ */ jsx(RemoveIcon, {})] }), $[23] = t8) : t8 = $[23];
1392
- let t9;
1393
- return $[24] !== style || $[25] !== t3 || $[26] !== t7 ? (t9 = /* @__PURE__ */ jsxs("div", {
1394
- className: t3,
1395
- "data-ui": "Checkbox",
1396
- style,
1397
- children: [t7, t8]
1398
- }), $[24] = style, $[25] = t3, $[26] = t7, $[27] = t9) : t9 = $[27], t9;
1399
- }
1400
- /**
1401
- * Get responsive CSS for the `heading` font style.
1402
- * @internal
1403
- */
1404
- function responsiveHeadingFont(props) {
1405
- return responsiveFont("heading", props);
861
+ const $ = c(6), inputRef = useRef(null), {
862
+ className,
863
+ style,
864
+ disabled,
865
+ error,
866
+ indeterminate,
867
+ label,
868
+ ...rest
869
+ } = getProps(props, checkboxProps);
870
+ useEffect(() => {
871
+ inputRef.current && (inputRef.current.indeterminate = indeterminate);
872
+ }, [indeterminate]);
873
+ const t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t1 = "span", t2 = clsx(checkboxMarkClassName, error && "sui-error");
874
+ let t3;
875
+ $[0] !== indeterminate ? (t3 = indeterminate ? /* @__PURE__ */ jsx(RemoveIcon, {}) : /* @__PURE__ */ jsx(CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3) : t3 = $[1];
876
+ let t4;
877
+ return $[2] !== T0 || $[3] !== t2 || $[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t1, className: t2, position: "relative", radius: 2, width: "17px", height: "17px", children: t3 }), $[2] = T0, $[3] = t2, $[4] = t3, $[5] = t4) : t4 = $[5], /* @__PURE__ */ jsxs(Label, { className: t0, style, "data-ui": "Checkbox", disabled, error, children: [
878
+ /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", className: checkboxInputClassName, ref: inputRef, disabled, ...rest }),
879
+ t4,
880
+ label
881
+ ] });
882
+ }
883
+ const CODE_TAG = ["pre", "span"], CODE_SIZE = [0, 1, 2, 3, 4], codeProps = {
884
+ as: {
885
+ type: "union",
886
+ values: CODE_TAG
887
+ },
888
+ language: {
889
+ type: "string"
890
+ },
891
+ size: {
892
+ type: "union",
893
+ className: "text-code",
894
+ values: CODE_SIZE
895
+ },
896
+ muted: typographyProps.muted,
897
+ trim: typographyProps.trim,
898
+ weight: typographyProps.weight,
899
+ ...marginProps
900
+ }, LazyRefractor = lazy(() => import("./_chunks-es/LazyRefractor.js")), codeClassName = suffixClassName("sui-Code");
901
+ function Code(t0) {
902
+ const $ = c(22);
903
+ let T0, children, language, rest, style, t1, t2;
904
+ if ($[0] !== t0) {
905
+ t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
906
+ bb0: {
907
+ const {
908
+ size: t32,
909
+ ...props
910
+ } = t0, size = t32 === void 0 ? 2 : t32, {
911
+ as,
912
+ children: t42,
913
+ className,
914
+ language: t52,
915
+ style: t62,
916
+ ...t7
917
+ } = getProps({
918
+ size,
919
+ ...props
920
+ }, codeProps);
921
+ children = t42, language = t52, style = t62, rest = t7;
922
+ const Component = as || "pre";
923
+ if (!language) {
924
+ t2 = /* @__PURE__ */ jsx(Component, { className: clsx(codeClassName, className), style, "data-ui": "Code", ...rest, children: /* @__PURE__ */ jsx("code", { children }) });
925
+ break bb0;
926
+ }
927
+ T0 = Component, t1 = clsx(codeClassName, className);
928
+ }
929
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = language, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
930
+ } else
931
+ T0 = $[1], children = $[2], language = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
932
+ if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
933
+ return t2;
934
+ let t3;
935
+ $[8] !== children ? (t3 = /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = t3) : t3 = $[9];
936
+ let t4;
937
+ $[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[10] = children, $[11] = language, $[12] = t4) : t4 = $[12];
938
+ let t5;
939
+ $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(Suspense, { fallback: t3, children: t4 }), $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
940
+ let t6;
941
+ return $[16] !== T0 || $[17] !== rest || $[18] !== style || $[19] !== t1 || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Code", ...rest, children: t5 }), $[16] = T0, $[17] = rest, $[18] = style, $[19] = t1, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
942
+ }
943
+ const CONTAINER_SIZE = [0, 1, 2, 3, 4, 5], containerProps = {
944
+ as: {
945
+ type: "string"
946
+ },
947
+ size: {
948
+ type: "union",
949
+ className: "container",
950
+ values: CONTAINER_SIZE
951
+ },
952
+ ...layoutProps
953
+ }, containerClassName = suffixClassName("sui-Container");
954
+ function Container(t0) {
955
+ const $ = c(12);
956
+ let T0, children, rest, style, t1;
957
+ if ($[0] !== t0) {
958
+ const {
959
+ marginX: t22,
960
+ ...props
961
+ } = t0, marginX = t22 === void 0 ? "auto" : t22, {
962
+ as,
963
+ children: t3,
964
+ className,
965
+ style: t4,
966
+ ...t5
967
+ } = getProps({
968
+ marginX,
969
+ ...props
970
+ }, containerProps);
971
+ children = t3, style = t4, rest = t5, T0 = as || "div", t1 = clsx(containerClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
972
+ } else
973
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
974
+ let t2;
975
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Container", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
976
+ }
977
+ const HEADING_TAG = ["h1", "h2", "h3", "h4", "h5", "h6"], HEADING_SIZE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], headingProps = {
978
+ as: {
979
+ type: "union",
980
+ values: HEADING_TAG
981
+ },
982
+ size: {
983
+ type: "union",
984
+ className: "text-heading",
985
+ values: HEADING_SIZE
986
+ },
987
+ ...typographyProps
988
+ }, headingClassName = suffixClassName("sui-Heading");
989
+ function Heading(t0) {
990
+ const $ = c(15);
991
+ let T0, children, rest, style, t1, t2;
992
+ if ($[0] !== t0) {
993
+ t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
994
+ bb0: {
995
+ const {
996
+ size: t32,
997
+ weight: t4,
998
+ ...props
999
+ } = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "bold" : t4, {
1000
+ as,
1001
+ children: t5,
1002
+ className,
1003
+ style: t6,
1004
+ ...t7
1005
+ } = getProps({
1006
+ size,
1007
+ weight,
1008
+ ...props
1009
+ }, headingProps);
1010
+ children = t5, style = t6, rest = t7;
1011
+ const Component = as || "h2";
1012
+ if (props.truncate && props.trim) {
1013
+ const t8 = clsx(headingClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
1014
+ let t10;
1015
+ $[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Heading", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
1016
+ break bb0;
1017
+ }
1018
+ T0 = Component, t1 = clsx(headingClassName, props.truncate && "sui-overflow-hidden", className);
1019
+ }
1020
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1021
+ } else
1022
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1023
+ if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1024
+ return t2;
1025
+ let t3;
1026
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Heading", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1027
+ }
1028
+ const iconButtonProps = {
1029
+ "aria-label": {
1030
+ type: "string"
1031
+ },
1032
+ as: buttonProps.as,
1033
+ icon: {
1034
+ type: "string"
1035
+ }
1036
+ }, iconButtonClassName = suffixClassName("sui-IconButton");
1037
+ function IconButton(props) {
1038
+ const $ = c(16);
1039
+ let IconProp, T0, rest, style, t0, t1;
1040
+ if ($[0] !== props) {
1041
+ const {
1042
+ as,
1043
+ className,
1044
+ style: t22,
1045
+ icon: t32,
1046
+ ...t4
1047
+ } = getProps(props, iconButtonProps);
1048
+ style = t22, IconProp = t32, rest = t4;
1049
+ const Component = as || "button";
1050
+ T0 = Button, t0 = Component, t1 = clsx(iconButtonClassName, className), $[0] = props, $[1] = IconProp, $[2] = T0, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1051
+ } else
1052
+ IconProp = $[1], T0 = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1053
+ let t2;
1054
+ $[7] !== IconProp ? (t2 = /* @__PURE__ */ jsx(Icon, { icon: IconProp, margin: -2, size: 1 }), $[7] = IconProp, $[8] = t2) : t2 = $[8];
1055
+ let t3;
1056
+ return $[9] !== T0 || $[10] !== rest || $[11] !== style || $[12] !== t0 || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IconButton", ...rest, children: t2 }), $[9] = T0, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1057
+ }
1058
+ const dialogProps = {
1059
+ header: {
1060
+ type: "string"
1061
+ },
1062
+ open: {
1063
+ type: "boolean"
1064
+ },
1065
+ size: {
1066
+ type: "union",
1067
+ className: "container",
1068
+ values: CONTAINER_SIZE
1069
+ },
1070
+ topAnchor: {
1071
+ type: "string",
1072
+ className: "top-anchor",
1073
+ variable: "--top-anchor"
1074
+ }
1075
+ }, dialogClassName = suffixClassName("sui-Dialog"), dialogContentClassName = suffixClassName("sui-DialogContent"), dialogFooterClassName = suffixClassName("sui-DialogFooter");
1076
+ function DialogRoot(t0) {
1077
+ const $ = c(17), {
1078
+ open: t1,
1079
+ size: t2,
1080
+ ...props
1081
+ } = t0, open = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 0 : t2, {
1082
+ children,
1083
+ className,
1084
+ style,
1085
+ header,
1086
+ onClose,
1087
+ ...rest
1088
+ } = getProps({
1089
+ size,
1090
+ ...props
1091
+ }, dialogProps), dialogRef = useRef(null), headerId = useId(), dialogClasses = clsx(dialogClassName, `${props.topAnchor ? "sui-mx-auto" : "sui-m-auto"} sui-radius5 sui-shadow3 sui-p4 sui-flex-direction-column sui-gap4 sui-overflow-y-auto`);
1092
+ let t3, t4;
1093
+ $[0] !== open ? (t3 = () => {
1094
+ const dialogElement = dialogRef.current;
1095
+ if (dialogElement)
1096
+ return open ? dialogElement.open || dialogElement.showModal() : dialogElement.open && dialogElement.close(), () => {
1097
+ dialogElement.close();
1098
+ };
1099
+ }, t4 = [open], $[0] = open, $[1] = t3, $[2] = t4) : (t3 = $[1], t4 = $[2]), useEffect(t3, t4);
1100
+ const t5 = "any", t6 = header ? headerId : void 0, t7 = clsx(dialogClasses, className);
1101
+ let t8;
1102
+ $[3] !== header || $[4] !== headerId ? (t8 = header ? /* @__PURE__ */ jsx(Heading, { trim: !0, size: 1, id: headerId, children: header }) : /* @__PURE__ */ jsx("div", {}), $[3] = header, $[4] = headerId, $[5] = t8) : t8 = $[5];
1103
+ let t9;
1104
+ $[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx(IconButton, { "aria-label": "Close", level: "tertiary", icon: CloseIcon, onClick: () => dialogRef.current?.close() }), $[6] = t9) : t9 = $[6];
1105
+ let t10;
1106
+ $[7] !== t8 ? (t10 = /* @__PURE__ */ jsxs(Flex, { flexShrink: 0, justifyContent: "space-between", alignItems: "center", children: [
1107
+ t8,
1108
+ t9
1109
+ ] }), $[7] = t8, $[8] = t10) : t10 = $[8];
1110
+ let t11;
1111
+ return $[9] !== children || $[10] !== onClose || $[11] !== rest || $[12] !== style || $[13] !== t10 || $[14] !== t6 || $[15] !== t7 ? (t11 = /* @__PURE__ */ jsxs("dialog", { ...rest, ref: dialogRef, closedby: t5, "aria-labelledby": t6, onClose, className: t7, style, "data-ui": "Dialog", children: [
1112
+ t10,
1113
+ children
1114
+ ] }), $[9] = children, $[10] = onClose, $[11] = rest, $[12] = style, $[13] = t10, $[14] = t6, $[15] = t7, $[16] = t11) : t11 = $[16], t11;
1115
+ }
1116
+ function DialogContent(props) {
1117
+ const $ = c(12);
1118
+ let T0, children, style, t0, t1;
1119
+ if ($[0] !== props) {
1120
+ const {
1121
+ children: t22,
1122
+ className,
1123
+ style: t3,
1124
+ ...rest
1125
+ } = getProps(props, {});
1126
+ children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogContentClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1127
+ } else
1128
+ T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1129
+ let t2;
1130
+ return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogContent", flexGrow: 1, overflowY: "auto", children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1131
+ }
1132
+ function DialogFooter(props) {
1133
+ const $ = c(12);
1134
+ let T0, children, style, t0, t1;
1135
+ if ($[0] !== props) {
1136
+ const {
1137
+ children: t22,
1138
+ className,
1139
+ style: t3,
1140
+ ...rest
1141
+ } = getProps(props, {});
1142
+ children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogFooterClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1143
+ } else
1144
+ T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1145
+ let t2;
1146
+ return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogFooter", flexShrink: 0, children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1147
+ }
1148
+ DialogRoot.displayName = "Dialog";
1149
+ const Dialog = DialogRoot;
1150
+ DialogRoot.Content = DialogContent;
1151
+ DialogRoot.Footer = DialogFooter;
1152
+ const dividerProps = {
1153
+ ...marginProps
1154
+ }, dividerClassName = suffixClassName("sui-Divider");
1155
+ function Divider(props) {
1156
+ const $ = c(8);
1157
+ let rest, style, t0;
1158
+ if ($[0] !== props) {
1159
+ const {
1160
+ className,
1161
+ style: t12,
1162
+ ...t2
1163
+ } = getProps(props, dividerProps);
1164
+ style = t12, rest = t2, t0 = clsx(dividerClassName, "sui-border-none sui-border-top", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1165
+ } else
1166
+ rest = $[1], style = $[2], t0 = $[3];
1167
+ let t1;
1168
+ return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("hr", { className: t0, style, "data-ui": "Divider", ...rest }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1169
+ }
1170
+ const EYEBROW_SIZE = [0, 1, 2, 3, 4], eyebrowProps = {
1171
+ as: {
1172
+ type: "string"
1173
+ },
1174
+ size: {
1175
+ type: "union",
1176
+ className: "text-eyebrow",
1177
+ values: EYEBROW_SIZE
1178
+ },
1179
+ ...typographyProps
1180
+ }, eyebrowClassName = suffixClassName("sui-Eyebrow");
1181
+ function Eyebrow(t0) {
1182
+ const $ = c(15);
1183
+ let T0, children, rest, style, t1, t2;
1184
+ if ($[0] !== t0) {
1185
+ t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1186
+ bb0: {
1187
+ const {
1188
+ size: t32,
1189
+ weight: t4,
1190
+ ...props
1191
+ } = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "semibold" : t4, {
1192
+ as,
1193
+ children: t5,
1194
+ className,
1195
+ style: t6,
1196
+ ...t7
1197
+ } = getProps({
1198
+ size,
1199
+ weight,
1200
+ ...props
1201
+ }, eyebrowProps);
1202
+ children = t5, style = t6, rest = t7;
1203
+ const Component = as || "span";
1204
+ if (props.truncate && props.trim) {
1205
+ const t8 = clsx(eyebrowClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
1206
+ let t10;
1207
+ $[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Eyebrow", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
1208
+ break bb0;
1209
+ }
1210
+ T0 = Component, t1 = clsx(eyebrowClassName, props.truncate && "sui-overflow-hidden", className);
1211
+ }
1212
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1213
+ } else
1214
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1215
+ if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1216
+ return t2;
1217
+ let t3;
1218
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Eyebrow", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1219
+ }
1220
+ const GRID_AUTO_FLOW = ["row", "column", "row dense", "column dense", "dense"], gridParentProps = {
1221
+ gridAutoFlow: {
1222
+ type: "union",
1223
+ className: "grid-auto-flow",
1224
+ values: GRID_AUTO_FLOW
1225
+ },
1226
+ gridAutoColumns: {
1227
+ type: "string",
1228
+ className: "grid-auto-columns",
1229
+ variable: "--grid-auto-columns"
1230
+ },
1231
+ gridAutoRows: {
1232
+ type: "string",
1233
+ className: "grid-auto-rows",
1234
+ variable: "--grid-auto-rows"
1235
+ },
1236
+ gridTemplateColumns: {
1237
+ type: "string",
1238
+ className: "grid-template-columns",
1239
+ variable: "--grid-template-columns"
1240
+ },
1241
+ gridTemplateRows: {
1242
+ type: "string",
1243
+ className: "grid-template-rows",
1244
+ variable: "--grid-template-rows"
1245
+ }
1246
+ }, gridProps = {
1247
+ as: {
1248
+ type: "string"
1249
+ },
1250
+ display: {
1251
+ type: "union",
1252
+ className: "display",
1253
+ values: DISPLAY_GRID
1254
+ },
1255
+ ...gridParentProps,
1256
+ ...gapProps,
1257
+ ...layoutProps
1258
+ }, gridClassName = suffixClassName("sui-Grid");
1259
+ function Grid(t0) {
1260
+ const $ = c(12);
1261
+ let T0, children, rest, style, t1;
1262
+ if ($[0] !== t0) {
1263
+ const {
1264
+ display: t22,
1265
+ minHeight: t3,
1266
+ minWidth: t4,
1267
+ ...props
1268
+ } = t0, display = t22 === void 0 ? "grid" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
1269
+ as,
1270
+ children: t5,
1271
+ className,
1272
+ style: t6,
1273
+ ...t7
1274
+ } = getProps({
1275
+ display,
1276
+ minHeight,
1277
+ minWidth,
1278
+ ...props
1279
+ }, gridProps);
1280
+ children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(gridClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
1281
+ } else
1282
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
1283
+ let t2;
1284
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Grid", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1285
+ }
1286
+ const hStackProps = {
1287
+ as: {
1288
+ type: "string"
1289
+ },
1290
+ gap: gapProps.gap
1291
+ }, hStackClassName = suffixClassName("sui-HStack");
1292
+ function HStack(props) {
1293
+ const $ = c(14);
1294
+ let T0, children, rest, style, t0, t1;
1295
+ if ($[0] !== props) {
1296
+ const {
1297
+ as,
1298
+ children: t22,
1299
+ className,
1300
+ style: t3,
1301
+ ...t4
1302
+ } = getProps(props, hStackProps);
1303
+ children = t22, style = t3, rest = t4;
1304
+ const Component = as || "div";
1305
+ T0 = Flex, t0 = Component, t1 = clsx(hStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1306
+ } else
1307
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1308
+ let t2;
1309
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "HStack", display: "inline-flex", alignItems: "center", flexWrap: "wrap", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1310
+ }
1311
+ const indicatorProps = {
1312
+ as: {
1313
+ type: "string"
1314
+ },
1315
+ label: {
1316
+ type: "string"
1317
+ },
1318
+ ...toneProps
1319
+ }, indicatorClassName = suffixClassName("sui-Indicator");
1320
+ function Indicator(t0) {
1321
+ const $ = c(18);
1322
+ let T0, ariaLabel, children, rest, style, t1, t2;
1323
+ if ($[0] !== t0) {
1324
+ const {
1325
+ tone: t32,
1326
+ ...props
1327
+ } = t0, tone = t32 === void 0 ? "neutral" : t32, {
1328
+ as,
1329
+ children: t42,
1330
+ className,
1331
+ style: t52,
1332
+ label,
1333
+ ...t6
1334
+ } = getProps({
1335
+ tone,
1336
+ ...props
1337
+ }, indicatorProps);
1338
+ children = t42, style = t52, rest = t6;
1339
+ const Component = as || "span";
1340
+ ariaLabel = label || rest["aria-label"], T0 = Box, t1 = Component, t2 = clsx(indicatorClassName, className), $[0] = t0, $[1] = T0, $[2] = ariaLabel, $[3] = children, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
1341
+ } else
1342
+ T0 = $[1], ariaLabel = $[2], children = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
1343
+ const t3 = ariaLabel ? void 0 : !0, t4 = ariaLabel ? "img" : void 0;
1344
+ let t5;
1345
+ return $[8] !== T0 || $[9] !== ariaLabel || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 ? (t5 = /* @__PURE__ */ jsx(T0, { as: t1, className: t2, style, "data-ui": "Indicator", width: "5px", height: "5px", radius: "full", "aria-label": ariaLabel, "aria-hidden": t3, role: t4, ...rest, children }), $[8] = T0, $[9] = ariaLabel, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5) : t5 = $[17], t5;
1346
+ }
1347
+ const indicatorStackProps = {
1348
+ as: {
1349
+ type: "string"
1350
+ }
1351
+ }, indicatorStackClassName = suffixClassName("sui-IndicatorStack");
1352
+ function IndicatorStack(props) {
1353
+ const $ = c(14);
1354
+ let T0, children, rest, style, t0, t1;
1355
+ if ($[0] !== props) {
1356
+ const {
1357
+ as,
1358
+ children: t22,
1359
+ className,
1360
+ style: t3,
1361
+ ...t4
1362
+ } = getProps(props, indicatorStackProps);
1363
+ children = t22, style = t3, rest = t4;
1364
+ const Component = as || "div";
1365
+ T0 = HStack, t0 = Component, t1 = clsx(indicatorStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1366
+ } else
1367
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1368
+ let t2;
1369
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IndicatorStack", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1370
+ }
1371
+ const inlineProps = {
1372
+ as: {
1373
+ type: "string"
1374
+ },
1375
+ gap: {
1376
+ type: "composite",
1377
+ values: SPACE,
1378
+ composition: {
1379
+ marginTop: {
1380
+ propDef: marginProps.marginTop,
1381
+ mapping: {
1382
+ 0: 0,
1383
+ 1: -1,
1384
+ 2: -2,
1385
+ 3: -3,
1386
+ 4: -4,
1387
+ 5: -5,
1388
+ 6: -6,
1389
+ 7: -7,
1390
+ 8: -8,
1391
+ 9: -9
1392
+ }
1393
+ },
1394
+ marginLeft: {
1395
+ propDef: marginProps.marginLeft,
1396
+ mapping: {
1397
+ 0: 0,
1398
+ 1: -1,
1399
+ 2: -2,
1400
+ 3: -3,
1401
+ 4: -4,
1402
+ 5: -5,
1403
+ 6: -6,
1404
+ 7: -7,
1405
+ 8: -8,
1406
+ 9: -9
1407
+ }
1408
+ }
1409
+ }
1410
+ },
1411
+ ...paddingProps
1412
+ }, inlineChildrenProps = {
1413
+ gap: {
1414
+ type: "composite",
1415
+ values: SPACE,
1416
+ composition: {
1417
+ paddingTop: {
1418
+ propDef: paddingProps.paddingTop,
1419
+ mapping: {
1420
+ 0: 0,
1421
+ 1: 1,
1422
+ 2: 2,
1423
+ 3: 3,
1424
+ 4: 4,
1425
+ 5: 5,
1426
+ 6: 6,
1427
+ 7: 7,
1428
+ 8: 8,
1429
+ 9: 9
1430
+ }
1431
+ },
1432
+ paddingLeft: {
1433
+ propDef: paddingProps.paddingLeft,
1434
+ mapping: {
1435
+ 0: 0,
1436
+ 1: 1,
1437
+ 2: 2,
1438
+ 3: 3,
1439
+ 4: 4,
1440
+ 5: 5,
1441
+ 6: 6,
1442
+ 7: 7,
1443
+ 8: 8,
1444
+ 9: 9
1445
+ }
1446
+ }
1447
+ }
1448
+ }
1449
+ }, inlineClassName = suffixClassName("sui-Inline");
1450
+ function Inline(props) {
1451
+ const $ = c(14);
1452
+ let T0, children, rest, style, t0;
1453
+ if ($[0] !== props) {
1454
+ const {
1455
+ as,
1456
+ children: childrenProp,
1457
+ className,
1458
+ style: t12,
1459
+ ...t2
1460
+ } = getProps(props, inlineProps);
1461
+ style = t12, rest = t2;
1462
+ const {
1463
+ className: childrenClassName
1464
+ } = getProps(props, inlineChildrenProps), Component = as || "div";
1465
+ let t3;
1466
+ $[6] !== childrenClassName ? (t3 = (child) => child && /* @__PURE__ */ jsx("div", { className: childrenClassName, children: child }), $[6] = childrenClassName, $[7] = t3) : t3 = $[7], children = Children.map(childrenProp, t3), T0 = Component, t0 = clsx(inlineClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1467
+ } else
1468
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1469
+ let t1;
1470
+ return $[8] !== T0 || $[9] !== children || $[10] !== rest || $[11] !== style || $[12] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "Inline", ...rest, children }), $[8] = T0, $[9] = children, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1) : t1 = $[13], t1;
1471
+ }
1472
+ const linkProps = {
1473
+ openInNewTab: {
1474
+ type: "boolean"
1475
+ },
1476
+ underlined: {
1477
+ type: "boolean",
1478
+ className: "underlined"
1479
+ }
1480
+ }, linkClassName = suffixClassName("sui-Link");
1481
+ function Link(t0) {
1482
+ const $ = c(14);
1483
+ let children, openInNewTab, rest, style, t1;
1484
+ if ($[0] !== t0) {
1485
+ const {
1486
+ underlined: t22,
1487
+ ...props
1488
+ } = t0, underlined = t22 === void 0 ? !0 : t22, {
1489
+ children: t32,
1490
+ className,
1491
+ style: t4,
1492
+ openInNewTab: t5,
1493
+ ...t6
1494
+ } = getProps({
1495
+ underlined,
1496
+ ...props
1497
+ }, linkProps);
1498
+ children = t32, style = t4, openInNewTab = t5, rest = t6, t1 = clsx(linkClassName, className), $[0] = t0, $[1] = children, $[2] = openInNewTab, $[3] = rest, $[4] = style, $[5] = t1;
1499
+ } else
1500
+ children = $[1], openInNewTab = $[2], rest = $[3], style = $[4], t1 = $[5];
1501
+ let t2;
1502
+ $[6] !== openInNewTab ? (t2 = openInNewTab ? {
1503
+ target: "_blank",
1504
+ rel: "noopener noreferrer"
1505
+ } : {}, $[6] = openInNewTab, $[7] = t2) : t2 = $[7];
1506
+ let t3;
1507
+ return $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t1 || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsx("a", { className: t1, style, "data-ui": "Link", ...t2, ...rest, children }), $[8] = children, $[9] = rest, $[10] = style, $[11] = t1, $[12] = t2, $[13] = t3) : t3 = $[13], t3;
1508
+ }
1509
+ const pressAreaProps = {
1510
+ as: {
1511
+ type: "string"
1512
+ }
1513
+ }, pressAreaClassName = suffixClassName("sui-PressArea");
1514
+ function PressArea(props) {
1515
+ const $ = c(12);
1516
+ let T0, children, rest, style, t0;
1517
+ if ($[0] !== props) {
1518
+ const {
1519
+ as,
1520
+ children: t12,
1521
+ className,
1522
+ style: t2,
1523
+ ...t3
1524
+ } = getProps(props, pressAreaProps);
1525
+ children = t12, style = t2, rest = t3, T0 = as || "button", t0 = clsx(pressAreaClassName, "sui-width-full", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1526
+ } else
1527
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1528
+ let t1;
1529
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "PressArea", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
1530
+ }
1531
+ const vStackProps = {
1532
+ as: {
1533
+ type: "string"
1534
+ },
1535
+ gap: gapProps.gap
1536
+ }, vStackClassName = suffixClassName("sui-VStack");
1537
+ function VStack(props) {
1538
+ const $ = c(14);
1539
+ let T0, children, rest, style, t0, t1;
1540
+ if ($[0] !== props) {
1541
+ const {
1542
+ as,
1543
+ children: t22,
1544
+ className,
1545
+ style: t3,
1546
+ ...t4
1547
+ } = getProps(props, vStackProps);
1548
+ children = t22, style = t3, rest = t4;
1549
+ const Component = as || "div";
1550
+ T0 = Flex, t0 = Component, t1 = clsx(vStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1551
+ } else
1552
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1553
+ let t2;
1554
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "VStack", flexDirection: "column", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1555
+ }
1556
+ const listProps = {
1557
+ as: {
1558
+ type: "string"
1559
+ },
1560
+ gap: gapProps.gap
1561
+ }, listItemProps = {
1562
+ density: {
1563
+ type: "composite",
1564
+ values: DENSITY,
1565
+ composition: {
1566
+ gap: {
1567
+ propDef: gapProps.gap,
1568
+ mapping: {
1569
+ compact: 2,
1570
+ regular: 2,
1571
+ loose: 3
1572
+ }
1573
+ },
1574
+ minHeight: {
1575
+ propDef: heightProps.minHeight,
1576
+ mapping: {
1577
+ compact: "33px",
1578
+ regular: "37px",
1579
+ loose: "45px"
1580
+ }
1581
+ },
1582
+ paddingX: {
1583
+ propDef: paddingProps.padding,
1584
+ mapping: {
1585
+ compact: 1,
1586
+ regular: 2,
1587
+ loose: 3
1588
+ }
1589
+ }
1590
+ }
1591
+ },
1592
+ end: {
1593
+ type: "string"
1594
+ },
1595
+ start: {
1596
+ type: "string"
1597
+ }
1598
+ }, listButtonItemProps = {
1599
+ as: {
1600
+ type: "string"
1601
+ },
1602
+ selected: {
1603
+ type: "boolean"
1604
+ },
1605
+ ...listItemProps
1606
+ }, listItemTextProps = {
1607
+ as: {
1608
+ type: "string"
1609
+ },
1610
+ title: {
1611
+ type: "string"
1612
+ },
1613
+ subtitle: {
1614
+ type: "string"
1615
+ }
1616
+ }, listClassName = suffixClassName("sui-List"), listItemClassName = suffixClassName("sui-ListItem"), listButtonItemClassName = suffixClassName("sui-ListButtonItem"), listItemTextClassName = suffixClassName("sui-ListItemText"), listItemImageClassName = suffixClassName("sui-ListItemImage");
1617
+ function ListRoot(props) {
1618
+ const $ = c(14);
1619
+ let T0, children, rest, style, t0, t1;
1620
+ if ($[0] !== props) {
1621
+ const {
1622
+ as,
1623
+ children: t22,
1624
+ className,
1625
+ style: t3,
1626
+ ...t4
1627
+ } = getProps(props, listProps);
1628
+ children = t22, style = t3, rest = t4;
1629
+ const Component = as || "ul";
1630
+ T0 = VStack, t0 = Component, t1 = clsx(listClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1631
+ } else
1632
+ T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1633
+ let t2;
1634
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "List", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1635
+ }
1636
+ function ListItem(t0) {
1637
+ const $ = c(16);
1638
+ let children, end, rest, start, style, t1;
1639
+ if ($[0] !== t0) {
1640
+ const {
1641
+ density: t22,
1642
+ ...props
1643
+ } = t0, density = t22 === void 0 ? "regular" : t22, {
1644
+ children: t32,
1645
+ className,
1646
+ style: t4,
1647
+ end: t5,
1648
+ start: t6,
1649
+ ...t7
1650
+ } = getProps({
1651
+ density,
1652
+ ...props
1653
+ }, listItemProps);
1654
+ children = t32, style = t4, end = t5, start = t6, rest = t7, t1 = clsx(listItemClassName, "sui-width-full sui-display-flex sui-align-items-center", className), $[0] = t0, $[1] = children, $[2] = end, $[3] = rest, $[4] = start, $[5] = style, $[6] = t1;
1655
+ } else
1656
+ children = $[1], end = $[2], rest = $[3], start = $[4], style = $[5], t1 = $[6];
1657
+ let t2;
1658
+ $[7] !== children ? (t2 = /* @__PURE__ */ jsx(Flex, { flexGrow: 1, gap: "inherit", children }), $[7] = children, $[8] = t2) : t2 = $[8];
1659
+ let t3;
1660
+ return $[9] !== end || $[10] !== rest || $[11] !== start || $[12] !== style || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsxs("li", { className: t1, style, "data-ui": "ListItem", ...rest, children: [
1661
+ start,
1662
+ t2,
1663
+ end
1664
+ ] }), $[9] = end, $[10] = rest, $[11] = start, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1665
+ }
1666
+ function ListButtonItem(t0) {
1667
+ const $ = c(22);
1668
+ let T0, children, end, rest, selected, start, style, t1, t2;
1669
+ if ($[0] !== t0) {
1670
+ const {
1671
+ density: t32,
1672
+ ...props
1673
+ } = t0, density = t32 === void 0 ? "regular" : t32, {
1674
+ as,
1675
+ children: t42,
1676
+ className,
1677
+ style: t5,
1678
+ end: t6,
1679
+ start: t7,
1680
+ selected: t8,
1681
+ ...t9
1682
+ } = getProps({
1683
+ density,
1684
+ ...props
1685
+ }, listButtonItemProps);
1686
+ children = t42, style = t5, end = t6, start = t7, selected = t8, rest = t9;
1687
+ const Component = as || "button";
1688
+ T0 = PressArea, t1 = Component, t2 = clsx(listButtonItemClassName, "sui-width-full sui-display-flex sui-align-items-center sui-radius2", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = end, $[4] = rest, $[5] = selected, $[6] = start, $[7] = style, $[8] = t1, $[9] = t2;
1689
+ } else
1690
+ T0 = $[1], children = $[2], end = $[3], rest = $[4], selected = $[5], start = $[6], style = $[7], t1 = $[8], t2 = $[9];
1691
+ let t3;
1692
+ $[10] !== children ? (t3 = /* @__PURE__ */ jsx(Flex, { flexGrow: 1, gap: "inherit", children }), $[10] = children, $[11] = t3) : t3 = $[11];
1693
+ let t4;
1694
+ return $[12] !== T0 || $[13] !== end || $[14] !== rest || $[15] !== selected || $[16] !== start || $[17] !== style || $[18] !== t1 || $[19] !== t2 || $[20] !== t3 ? (t4 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(T0, { as: t1, className: t2, style, "data-ui": "ListButtonItem", "data-selected": selected, ...rest, children: [
1695
+ start,
1696
+ t3,
1697
+ end
1698
+ ] }) }), $[12] = T0, $[13] = end, $[14] = rest, $[15] = selected, $[16] = start, $[17] = style, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4) : t4 = $[21], t4;
1699
+ }
1700
+ function ListItemText(props) {
1701
+ const $ = c(20);
1702
+ let T0, rest, style, subtitle, t0, t1, title;
1703
+ if ($[0] !== props) {
1704
+ const {
1705
+ as,
1706
+ className,
1707
+ style: t22,
1708
+ title: t32,
1709
+ subtitle: t42,
1710
+ ...t5
1711
+ } = getProps(props, listItemTextProps);
1712
+ style = t22, title = t32, subtitle = t42, rest = t5;
1713
+ const Component = as || "div";
1714
+ T0 = Flex, t0 = Component, t1 = clsx(listItemTextClassName, className), $[0] = props, $[1] = T0, $[2] = rest, $[3] = style, $[4] = subtitle, $[5] = t0, $[6] = t1, $[7] = title;
1715
+ } else
1716
+ T0 = $[1], rest = $[2], style = $[3], subtitle = $[4], t0 = $[5], t1 = $[6], title = $[7];
1717
+ let t2;
1718
+ $[8] !== title ? (t2 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", trim: !0, truncate: 1, children: title }), $[8] = title, $[9] = t2) : t2 = $[9];
1719
+ let t3;
1720
+ $[10] !== subtitle ? (t3 = subtitle && /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, trim: !0, truncate: 1, children: subtitle }), $[10] = subtitle, $[11] = t3) : t3 = $[11];
1721
+ let t4;
1722
+ return $[12] !== T0 || $[13] !== rest || $[14] !== style || $[15] !== t0 || $[16] !== t1 || $[17] !== t2 || $[18] !== t3 ? (t4 = /* @__PURE__ */ jsxs(T0, { as: t0, className: t1, style, "data-ui": "ListItemText", flexDirection: "column", justifyContent: "center", gap: 2, flexGrow: 1, ...rest, children: [
1723
+ t2,
1724
+ t3
1725
+ ] }), $[12] = T0, $[13] = rest, $[14] = style, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4) : t4 = $[19], t4;
1726
+ }
1727
+ function ListItemImage(props) {
1728
+ const $ = c(8);
1729
+ let rest, style, t0;
1730
+ if ($[0] !== props) {
1731
+ const {
1732
+ className,
1733
+ style: t12,
1734
+ ...t2
1735
+ } = getProps(props, {});
1736
+ style = t12, rest = t2, t0 = clsx(listItemImageClassName, "sui-radius2", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1737
+ } else
1738
+ rest = $[1], style = $[2], t0 = $[3];
1739
+ let t1;
1740
+ return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("img", { className: t0, style, "data-ui": "ListItemImage", ...rest }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1741
+ }
1742
+ ListRoot.displayName = "List";
1743
+ const List = ListRoot;
1744
+ ListRoot.Item = ListItem;
1745
+ ListRoot.ButtonItem = ListButtonItem;
1746
+ ListRoot.ItemText = ListItemText;
1747
+ ListRoot.ItemImage = ListItemImage;
1748
+ function useIsClient() {
1749
+ return useSyncExternalStore(_temp2, _temp3, _temp4);
1750
+ }
1751
+ function _temp4() {
1752
+ return !1;
1753
+ }
1754
+ function _temp3() {
1755
+ return !0;
1406
1756
  }
1407
- function headingBaseStyle(props) {
1408
- let { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
1409
- return css`${$accent && css`color:var(--card-accent-fg-color);`} ${$muted && css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;}& a{text-decoration:none;border-radius:1px;color:var(--card-link-color);outline:none;@media (hover:hover){&:hover{text-decoration:underline;}}&:focus{box-shadow:0 0 0 1px var(--card-bg-color),0 0 0 3px var(--card-focus-ring-color);}&:focus:not(:focus-visible){box-shadow:none;}}& strong{font-weight:${font.heading.weights.bold};}& svg{display:inline;max-width:unset;}& [data-sanity-icon]{vertical-align:baseline;}`;
1410
- }
1411
- const StyledHeading = /* @__PURE__ */ styled.div.withConfig({
1412
- displayName: "StyledHeading",
1413
- componentId: "sc-95f8ng-0"
1414
- })(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
1415
- function HeadingComponent(props) {
1416
- let $ = c(27), align, childrenProp, ref, restProps, t0, t1, t2, textOverflow, weight;
1417
- $[0] === props ? (align = $[1], childrenProp = $[2], ref = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7], textOverflow = $[8], weight = $[9]) : ({accent: t0, align, children: childrenProp, muted: t1, ref, size: t2, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = ref, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = textOverflow, $[9] = weight);
1418
- let accent = t0 !== void 0 && t0, muted = t1 !== void 0 && t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
1419
- if (textOverflow === "ellipsis") {
1420
- let t3;
1421
- $[10] === children ? t3 = $[11] : (t3 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[10] = children, $[11] = t3), children = t3;
1422
- }
1423
- let t3;
1424
- $[12] === align ? t3 = $[13] : (t3 = _getArrayProp(align), $[12] = align, $[13] = t3);
1425
- let t4;
1426
- $[14] === size ? t4 = $[15] : (t4 = _getArrayProp(size), $[14] = size, $[15] = t4);
1427
- let t5;
1428
- $[16] === children ? t5 = $[17] : (t5 = /* @__PURE__ */ jsx("span", { children }), $[16] = children, $[17] = t5);
1429
- let t6;
1430
- return $[18] !== accent || $[19] !== muted || $[20] !== ref || $[21] !== restProps || $[22] !== t3 || $[23] !== t4 || $[24] !== t5 || $[25] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledHeading, {
1431
- "data-ui": "Heading",
1432
- ...restProps,
1433
- $accent: accent,
1434
- $align: t3,
1435
- $muted: muted,
1436
- $size: t4,
1437
- $weight: weight,
1438
- ref,
1439
- children: t5
1440
- }), $[18] = accent, $[19] = muted, $[20] = ref, $[21] = restProps, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = weight, $[26] = t6) : t6 = $[26], t6;
1757
+ function _temp2() {
1758
+ return _temp;
1441
1759
  }
1442
- /**
1443
- * Typographic headings.
1444
- *
1445
- * @public
1446
- */
1447
- const Heading = HeadingComponent;
1448
- function inputElementStyle(props) {
1449
- let { color, input } = getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
1450
- return css`appearance:none;position:absolute;top:0;left:0;opacity:0;height:100%;width:100%;outline:none;z-index:1;padding:0;margin:0;border-radius:${rem(input.radio.size / 2)};border:none;& + span{display:block;position:relative;height:${rem(input.radio.size)};width:${rem(input.radio.size)};border-radius:${rem(input.radio.size / 2)};background:${color.input.default.enabled.bg};box-shadow:${focusRingBorderStyle({
1451
- color: color.input.default.enabled.border,
1452
- width: input.border.width
1453
- })};&::after{content:'';position:absolute;top:${rem(dist)};left:${rem(dist)};height:${rem(input.radio.markSize)};width:${rem(input.radio.markSize)};border-radius:${rem(input.radio.markSize / 2)};background:${color.input.default.enabled.fg};opacity:0;}}&:not(:disabled):focus + span{box-shadow:${focusRingStyle({
1454
- border: {
1455
- width: input.border.width,
1456
- color: color.input.default.enabled.border
1457
- },
1458
- focusRing: input.radio.focusRing
1459
- })};}&:not(:disabled):focus:not(:focus-visible) + span{box-shadow:${focusRingBorderStyle({
1460
- color: color.input.default.enabled.border,
1461
- width: input.border.width
1462
- })};}&:checked + span::after{opacity:1;}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${focusRingBorderStyle({
1463
- width: input.border.width,
1464
- color: color.input.invalid.enabled.muted.bg
1465
- })};&::after{background:${color.input.invalid.enabled.muted.bg};}}&[data-read-only] + span{box-shadow:0 0 0 1px ${color.input.default.readOnly.border};background:${color.input.default.readOnly.bg};&::after{background:${color.input.default.readOnly.border};}}&:not([data-read-only]):disabled + span{box-shadow:0 0 0 1px ${color.input.default.disabled.border};background:${color.input.default.disabled.bg};&::after{background:${color.input.default.disabled.border};}}`;
1760
+ function _temp() {
1466
1761
  }
1467
- var radio = "xgt72i0";
1468
- const Input$2 = /* @__PURE__ */ styled.input.withConfig({
1469
- displayName: "Input",
1470
- componentId: "sc-u4kfaz-0"
1471
- })(inputElementStyle);
1472
- /**
1473
- * The `Radio` component allows the user to select one option from a set.
1474
- *
1475
- * @public
1476
- */
1762
+ function isReactEventHandler(key, value) {
1763
+ return /^on[A-Z]/.test(key) && typeof value == "function";
1764
+ }
1765
+ function chainEventHandlers(...handlers) {
1766
+ const defined = handlers.filter(Boolean);
1767
+ if (defined.length !== 0)
1768
+ return defined.length === 1 ? defined[0] : (e) => {
1769
+ for (const handler of defined)
1770
+ handler(e);
1771
+ };
1772
+ }
1773
+ function mergeTriggerProps(childProps, forwardedProps, ownProps) {
1774
+ const result = {};
1775
+ for (const source of [forwardedProps, ownProps])
1776
+ if (source) {
1777
+ for (const [key, value] of Object.entries(source))
1778
+ if (key !== "style") {
1779
+ if (isReactEventHandler(key, value)) {
1780
+ result[key] = chainEventHandlers(result[key], value);
1781
+ continue;
1782
+ }
1783
+ value !== void 0 && (result[key] = value);
1784
+ }
1785
+ }
1786
+ result.style = {
1787
+ ...childProps.style,
1788
+ ...forwardedProps?.style,
1789
+ ...ownProps?.style
1790
+ };
1791
+ for (const [key, value] of Object.entries(childProps))
1792
+ isReactEventHandler(key, value) && (result[key] = chainEventHandlers(result[key], value));
1793
+ return result;
1794
+ }
1795
+ function renderPortal(node, mounted, portal) {
1796
+ return portal ? mounted ? createPortal(node, document.body) : null : node;
1797
+ }
1798
+ const PLACEMENT = ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end"], placementProps = {
1799
+ placement: {
1800
+ type: "union",
1801
+ className: "placement",
1802
+ values: PLACEMENT
1803
+ }
1804
+ }, popoverProps = {
1805
+ anchorName: {
1806
+ type: "string"
1807
+ },
1808
+ content: {
1809
+ type: "string"
1810
+ },
1811
+ portal: {
1812
+ type: "boolean"
1813
+ },
1814
+ ...placementProps
1815
+ }, popoverClassName = suffixClassName("sui-PopoverContent");
1816
+ function PopoverRoot(t0) {
1817
+ const $ = c(4), {
1818
+ placement: t1,
1819
+ ...props
1820
+ } = t0, placement = t1 === void 0 ? "bottom" : t1, {
1821
+ children,
1822
+ className,
1823
+ style,
1824
+ id: idProp,
1825
+ anchorName,
1826
+ content,
1827
+ portal,
1828
+ triggerProps: forwardedTriggerProps,
1829
+ ...rest
1830
+ } = getProps({
1831
+ placement,
1832
+ ...props
1833
+ }, popoverProps), reactId = useId(), id = idProp || reactId, [open, setOpen] = useState(!1), isClient = useIsClient();
1834
+ let t2;
1835
+ $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = (e) => {
1836
+ setOpen(e.newState === "open");
1837
+ }, $[0] = t2) : t2 = $[0];
1838
+ const handleToggle = t2, triggerProps = {
1839
+ popoverTarget: id,
1840
+ style: {
1841
+ anchorName: `--anchor-${anchorName || id}`
1842
+ }
1843
+ }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
1844
+ triggerProps
1845
+ }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps)), t3 = renderPortal(/* @__PURE__ */ jsx(Activity, { mode: open ? "visible" : "hidden", children: /* @__PURE__ */ jsx("div", { className: clsx(popoverClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
1846
+ ...style,
1847
+ positionAnchor: `--anchor-${anchorName || id}`
1848
+ }, "data-ui": "Popover", popover: "auto", id, onToggle: handleToggle, ...rest, children: content }) }), isClient, portal);
1849
+ let t4;
1850
+ return $[1] !== t3 || $[2] !== trigger ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
1851
+ trigger,
1852
+ t3
1853
+ ] }), $[1] = t3, $[2] = trigger, $[3] = t4) : t4 = $[3], t4;
1854
+ }
1855
+ const Popover = Object.assign(PopoverRoot, {
1856
+ forwardsTriggerProps: !0
1857
+ }), radioProps = {
1858
+ error: {
1859
+ type: "boolean"
1860
+ },
1861
+ label: {
1862
+ type: "string"
1863
+ },
1864
+ ...marginProps
1865
+ }, radioClassName = suffixClassName("sui-Radio"), radioInputClassName = suffixClassName("sui-RadioInput"), radioMarkClassName = suffixClassName("sui-RadioMark");
1477
1866
  function Radio(props) {
1478
- let $ = c(22), className, customValidity, disabled, forwardedRef, readOnly, restProps, style;
1479
- $[0] === props ? (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], restProps = $[6], style = $[7]) : ({className, disabled, style, customValidity, readOnly, ref: forwardedRef, ...restProps} = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = restProps, $[7] = style);
1480
- let ref = useRef(null), t0;
1481
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
1482
- let t1;
1483
- $[9] === className ? t1 = $[10] : (t1 = clsx(radio, className), $[9] = className, $[10] = t1);
1484
- let t2 = !disabled && readOnly ? "" : void 0, t3 = customValidity ? "" : void 0, t4 = disabled || readOnly, t5;
1485
- $[11] !== readOnly || $[12] !== restProps || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 ? (t5 = /* @__PURE__ */ jsx(Input$2, {
1486
- "data-read-only": t2,
1487
- "data-error": t3,
1488
- ...restProps,
1489
- disabled: t4,
1490
- readOnly,
1491
- ref,
1492
- type: "radio"
1493
- }), $[11] = readOnly, $[12] = restProps, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5) : t5 = $[16];
1494
- let t6;
1495
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = /* @__PURE__ */ jsx("span", {}), $[17] = t6) : t6 = $[17];
1496
- let t7;
1497
- return $[18] !== style || $[19] !== t1 || $[20] !== t5 ? (t7 = /* @__PURE__ */ jsxs("div", {
1498
- className: t1,
1499
- "data-ui": "Radio",
1500
- style,
1501
- children: [t5, t6]
1502
- }), $[18] = style, $[19] = t1, $[20] = t5, $[21] = t7) : t7 = $[21], t7;
1503
- }
1504
- function inputBaseStyle(props) {
1505
- let { font } = getTheme_v2(props.theme);
1506
- return css`-webkit-font-smoothing:antialiased;appearance:none;border:0;font-family:${font.text.family};color:inherit;width:100%;outline:none;margin:0;&:disabled{opacity:1;}`;
1507
- }
1508
- function inputColorStyle(props) {
1509
- let { color, input } = getTheme_v2(props.theme);
1510
- return css`background-color:${color.input.default.enabled.bg};color:${color.input.default.enabled.fg};box-shadow:${focusRingBorderStyle({
1511
- color: color.input.default.enabled.border,
1512
- width: input.border.width
1513
- })};@media (hover:hover){&:not(:disabled):hover{background-color:${color.input.default.hovered.bg};color:${color.input.default.hovered.fg};box-shadow:${focusRingBorderStyle({
1514
- color: color.input.default.hovered.border,
1515
- width: input.border.width
1516
- })};}}&:not(:disabled):focus{box-shadow:${focusRingStyle({
1517
- border: {
1518
- width: input.border.width,
1519
- color: color.input.default.enabled.border
1520
- },
1521
- focusRing: input.select.focusRing
1522
- })};}&[data-read-only]{background-color:${color.input.default.readOnly.bg};color:${color.input.default.readOnly.fg};box-shadow:${focusRingBorderStyle({
1523
- color: color.input.default.readOnly.border,
1524
- width: input.border.width
1525
- })};}&:not([data-read-only]):disabled{background-color:${color.input.default.disabled.bg};color:${color.input.default.disabled.fg};box-shadow:${focusRingBorderStyle({
1526
- color: color.input.default.disabled.border,
1527
- width: input.border.width
1528
- })};}`;
1529
- }
1530
- function textSize(size) {
1531
- return {
1532
- fontSize: rem(size.fontSize),
1533
- lineHeight: `${rem(size.lineHeight)}`
1534
- };
1535
- }
1536
- function inputTextSizeStyle(props) {
1537
- let { $fontSize } = props, { font, media } = getTheme_v2(props.theme);
1538
- return _responsive(media, $fontSize, (sizeIndex) => textSize(font.text.sizes[sizeIndex] || font.text.sizes[2]));
1539
- }
1540
- function inputStyle() {
1541
- return [
1542
- responsiveRadiusStyle,
1543
- inputBaseStyle,
1544
- inputColorStyle,
1545
- inputTextSizeStyle,
1546
- responsiveInputPaddingIconRightStyle
1547
- ];
1548
- }
1549
- function iconBoxStyle(props) {
1550
- let { color } = getTheme_v2(props.theme);
1551
- return css`pointer-events:none;position:absolute;top:0;right:0;--card-fg-color:${color.input.default.enabled.fg};@media (hover:hover){select:not(disabled):not(:read-only):hover + &&{--card-fg-color:${color.input.default.hovered.fg};}}select:disabled + &&{--card-fg-color:${color.input.default.disabled.fg};}select[data-read-only] + &&{--card-fg-color:${color.input.default.readOnly.fg};}`;
1552
- }
1553
- const selectStyle = {
1554
- input: inputStyle,
1555
- iconBox: iconBoxStyle
1556
- };
1557
- var select = "_14ngdrn0";
1558
- const Input$1 = /* @__PURE__ */ styled.select.withConfig({
1559
- displayName: "Input",
1560
- componentId: "sc-af8su9-0"
1561
- })(selectStyle.input), IconBox = /* @__PURE__ */ styled(Box).withConfig({
1562
- displayName: "IconBox",
1563
- componentId: "sc-af8su9-1"
1564
- })(selectStyle.iconBox);
1565
- /**
1566
- * The `Select` component provides control of options.
1567
- *
1568
- * @public
1569
- */
1570
- function Select(props) {
1571
- let $ = c(38), children, customValidity, disabled, forwardedRef, readOnly, restProps, t0, t1, t2, t3;
1572
- $[0] === props ? (children = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9], t3 = $[10]) : ({children, customValidity, disabled, fontSize: t0, gap: t1, padding: t2, radius: t3, readOnly, ref: forwardedRef, ...restProps} = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3);
1573
- let fontSize = t0 === void 0 ? 2 : t0, gap = t1 === void 0 ? 3 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, ref = useRef(null), t4;
1574
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[11] = t4) : t4 = $[11], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
1575
- let t5 = !disabled && readOnly ? "" : void 0, t6;
1576
- $[12] === fontSize ? t6 = $[13] : (t6 = _getArrayProp(fontSize), $[12] = fontSize, $[13] = t6);
1577
- let t7;
1578
- $[14] === padding ? t7 = $[15] : (t7 = _getArrayProp(padding), $[14] = padding, $[15] = t7);
1579
- let t8;
1580
- $[16] === radius ? t8 = $[17] : (t8 = _getArrayProp(radius), $[16] = radius, $[17] = t8);
1581
- let t9;
1582
- $[18] === gap ? t9 = $[19] : (t9 = _getArrayProp(gap), $[18] = gap, $[19] = t9);
1583
- let t10 = disabled || readOnly, t11;
1584
- $[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$1, {
1585
- "data-read-only": t5,
1586
- "data-ui": "Select",
1587
- ...restProps,
1588
- $fontSize: t6,
1589
- $padding: t7,
1590
- $radius: t8,
1591
- $space: t9,
1592
- disabled: t10,
1593
- ref,
1594
- children
1595
- }), $[20] = children, $[21] = restProps, $[22] = t10, $[23] = t5, $[24] = t6, $[25] = t7, $[26] = t8, $[27] = t9, $[28] = t11) : t11 = $[28];
1596
- let t12;
1597
- $[29] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[29] = t12) : t12 = $[29];
1598
- let t13;
1599
- $[30] === fontSize ? t13 = $[31] : (t13 = /* @__PURE__ */ jsx(Text, {
1600
- size: fontSize,
1601
- children: t12
1602
- }), $[30] = fontSize, $[31] = t13);
1603
- let t14;
1604
- $[32] !== padding || $[33] !== t13 ? (t14 = /* @__PURE__ */ jsx(IconBox, {
1605
- padding,
1606
- children: t13
1607
- }), $[32] = padding, $[33] = t13, $[34] = t14) : t14 = $[34];
1608
- let t15;
1609
- return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */ jsxs("div", {
1610
- className: select,
1611
- "data-ui": "Select",
1612
- children: [t11, t14]
1613
- }), $[35] = t11, $[36] = t14, $[37] = t15) : t15 = $[37], t15;
1614
- }
1615
- function switchRepresentationStyles(props) {
1616
- let { color, input } = getTheme_v2(props.theme);
1617
- return css`--switch-bg-color:${color.input.default.enabled.border};--switch-fg-color:${color.input.default.enabled.bg};--switch-box-shadow:none;&:not([hidden]){display:block;}position:relative;width:${rem(input.switch.width)};height:${rem(input.switch.height)};border-radius:${rem(input.switch.height / 2)};pointer-events:none;&:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;box-shadow:var(--switch-box-shadow);border-radius:inherit;}input:focus + &&{--switch-box-shadow:${focusRingStyle({ focusRing: input.switch.focusRing })};}input:focus:not(:focus-visible) + &&{--switch-box-shadow:none;}input:checked + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}@media (hover:hover){input:not(:disabled):hover + &&{--switch-bg-color:${color.input.default.hovered.border};--switch-fg-color:${color.input.default.hovered.bg};}input:not(:disabled):checked:hover + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}}input:not([data-read-only]):disabled + &&{--switch-bg-color:${color.input.default.disabled.border};--switch-fg-color:${color.input.default.disabled.bg};}input[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.border};--switch-fg-color:${color.input.default.readOnly.bg};}input:checked[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.fg};--switch-fg-color:${color.input.default.readOnly.bg};}`;
1618
- }
1619
- function switchTrackStyles(props) {
1620
- let { input } = getTheme_v2(props.theme);
1621
- return css`&:not([hidden]){display:block;}background-color:var(--switch-bg-color);position:absolute;left:0;top:0;width:${rem(input.switch.width)};height:${rem(input.switch.height)};border-radius:${rem(input.switch.height / 2)};`;
1622
- }
1623
- function switchThumbStyles(props) {
1624
- let { $indeterminate } = props, { input } = getTheme_v2(props.theme), trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size, indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
1625
- return css`&:not([hidden]){display:block;}position:absolute;left:${rem(trackPadding)};top:${rem(trackPadding)};height:${rem(size)};width:${rem(size)};border-radius:${rem(size / 2)};transition-property:transform;transition-duration:${input.switch.transitionDurationMs}ms;transition-timing-function:${input.switch.transitionTimingFunction};background:var(--switch-fg-color);transform:translate3d(0,0,0);box-shadow:0px 1px 0px 0px rgba(0,0,0,0.05);${checked && css`transform:translate3d(${checkedOffset}px,0,0);`} ${$indeterminate && css`transform:translate3d(${indeterminateOffset}px,0,0);`}`;
1626
- }
1627
- var switchInput = "cn60s71", switchRoot = "cn60s70";
1628
- const Representation = /* @__PURE__ */ styled.span.withConfig({
1629
- displayName: "Representation",
1630
- componentId: "sc-ymdgpc-0"
1631
- })(switchRepresentationStyles), Track = /* @__PURE__ */ styled.span.withConfig({
1632
- displayName: "Track",
1633
- componentId: "sc-ymdgpc-1"
1634
- })(switchTrackStyles), Thumb = /* @__PURE__ */ styled.span.withConfig({
1635
- displayName: "Thumb",
1636
- componentId: "sc-ymdgpc-2"
1637
- })(switchThumbStyles);
1638
- /**
1639
- * The `Switch` component allows the user to toggle a setting on and off.
1640
- *
1641
- * Extends all properties of an `<input type="checkbox" />` element, except type.
1642
- *
1643
- * @public
1644
- */
1867
+ const $ = c(26);
1868
+ let T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1869
+ if ($[0] !== props) {
1870
+ const {
1871
+ className,
1872
+ style,
1873
+ label: t82,
1874
+ disabled,
1875
+ error,
1876
+ ...rest
1877
+ } = getProps(props, radioProps);
1878
+ label = t82, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "radio", className: radioInputClassName, disabled, ...rest }), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
1879
+ } else
1880
+ T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1881
+ let t8;
1882
+ $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, position: "relative", radius: "full", width: "17px", height: "17px" }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
1883
+ let t9;
1884
+ return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, { className: t2, style: t3, "data-ui": t4, disabled: t5, error: t6, children: [
1885
+ t7,
1886
+ t8,
1887
+ label
1888
+ ] }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
1889
+ }
1890
+ const skipToContentProps = {
1891
+ label: {
1892
+ type: "string"
1893
+ }
1894
+ }, skipToContentClassName = suffixClassName("sui-SkipToContent");
1895
+ function SkipToContent(props) {
1896
+ const $ = c(18);
1897
+ let T0, label, rest, style, t0, t1, t2;
1898
+ if ($[0] !== props) {
1899
+ const {
1900
+ className,
1901
+ label: t32,
1902
+ style: t42,
1903
+ ...t5
1904
+ } = getProps(props, skipToContentProps);
1905
+ label = t32, style = t42, rest = t5, T0 = VisuallyHidden, t0 = Link, t1 = !1, t2 = clsx(skipToContentClassName, "sui-position-absolute sui-top2 sui-left2 sui-display-inline-block sui-z-index sui-py2 sui-px3 sui-radius2 sui-text-body1", className), $[0] = props, $[1] = T0, $[2] = label, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2;
1906
+ } else
1907
+ T0 = $[1], label = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7];
1908
+ let t3;
1909
+ $[8] !== label ? (t3 = /* @__PURE__ */ jsx(Text, { size: 1, children: label }), $[8] = label, $[9] = t3) : t3 = $[9];
1910
+ let t4;
1911
+ return $[10] !== T0 || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t0, underlined: t1, className: t2, style, "data-ui": "SkipToContent", visibleOnFocus: !0, ...rest, children: t3 }), $[10] = T0, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
1912
+ }
1913
+ const switchProps = {
1914
+ error: {
1915
+ type: "boolean"
1916
+ },
1917
+ label: {
1918
+ type: "string"
1919
+ },
1920
+ ...marginProps
1921
+ }, switchClassName = suffixClassName("sui-Switch"), switchInputClassName = suffixClassName("sui-SwitchInput"), switchMarkClassName = suffixClassName("sui-SwitchMark");
1645
1922
  function Switch(props) {
1646
- let $ = c(29), checked, className, disabled, forwardedRef, indeterminate, readOnly, restProps, style;
1647
- $[0] === props ? (checked = $[1], className = $[2], disabled = $[3], forwardedRef = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]) : ({checked, className, disabled, indeterminate, readOnly, ref: forwardedRef, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = forwardedRef, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style);
1648
- let ref = useRef(null), t0;
1649
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
1650
- let t1, t2;
1651
- $[10] === indeterminate ? (t1 = $[11], t2 = $[12]) : (t1 = () => {
1652
- ref.current && (ref.current.indeterminate = indeterminate || !1);
1653
- }, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2), useEffect(t1, t2);
1654
- let t3;
1655
- $[13] === className ? t3 = $[14] : (t3 = clsx(switchRoot, className), $[13] = className, $[14] = t3);
1656
- let t4 = !disabled && readOnly ? "" : void 0, t5 = indeterminate !== !0 && checked, t6 = disabled || readOnly, t7;
1657
- $[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx("input", {
1658
- className: switchInput,
1659
- "data-read-only": t4,
1660
- ...restProps,
1661
- checked: t5,
1662
- disabled: t6,
1663
- type: "checkbox",
1664
- ref
1665
- }), $[15] = restProps, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
1666
- let t8;
1667
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsx(Track, {}), $[20] = t8) : t8 = $[20];
1668
- let t9;
1669
- $[21] !== checked || $[22] !== indeterminate ? (t9 = /* @__PURE__ */ jsxs(Representation, {
1670
- "aria-hidden": !0,
1671
- "data-name": "representation",
1672
- children: [t8, /* @__PURE__ */ jsx(Thumb, {
1673
- $checked: checked,
1674
- $indeterminate: indeterminate
1675
- })]
1676
- }), $[21] = checked, $[22] = indeterminate, $[23] = t9) : t9 = $[23];
1677
- let t10;
1678
- return $[24] !== style || $[25] !== t3 || $[26] !== t7 || $[27] !== t9 ? (t10 = /* @__PURE__ */ jsxs("span", {
1679
- className: t3,
1680
- "data-ui": "Switch",
1681
- style,
1682
- children: [t7, t9]
1683
- }), $[24] = style, $[25] = t3, $[26] = t7, $[27] = t9, $[28] = t10) : t10 = $[28], t10;
1684
- }
1685
- const Input = /* @__PURE__ */ styled.textarea.withConfig({
1686
- displayName: "Input",
1687
- componentId: "sc-gtnobm-0"
1688
- })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled.div.withConfig({
1689
- displayName: "Presentation",
1690
- componentId: "sc-gtnobm-1"
1691
- })(responsiveRadiusStyle, textInputRepresentationStyle);
1692
- /**
1693
- * A multiline text input.
1694
- *
1695
-
1696
- * @public
1697
- */
1698
- function TextArea(props) {
1699
- let $ = c(36), __unstable_disableFocusRing, customValidity, forwardedRef, restProps, t0, t1, t2, t3, t4, weight;
1700
- $[0] === props ? (__unstable_disableFocusRing = $[1], customValidity = $[2], forwardedRef = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], weight = $[10]) : ({border: t0, customValidity, disabled: t1, fontSize: t2, padding: t3, radius: t4, ref: forwardedRef, weight, __unstable_disableFocusRing, ...restProps} = props, $[0] = props, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = forwardedRef, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = weight);
1701
- let border = t0 === void 0 || t0, disabled = t1 !== void 0 && t1, fontSize = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = useRef(null), rootTheme = useRootTheme(), t5;
1702
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
1703
- let t6 = rootTheme.scheme, t7 = rootTheme.tone, t8;
1704
- $[12] === fontSize ? t8 = $[13] : (t8 = _getArrayProp(fontSize), $[12] = fontSize, $[13] = t8);
1705
- let t9;
1706
- $[14] === padding ? t9 = $[15] : (t9 = _getArrayProp(padding), $[14] = padding, $[15] = t9);
1707
- let t10 = rootTheme.scheme, t11;
1708
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t11 = _getArrayProp(0), $[16] = t11) : t11 = $[16];
1709
- let t12;
1710
- $[17] !== disabled || $[18] !== restProps || $[19] !== rootTheme.scheme || $[20] !== rootTheme.tone || $[21] !== t8 || $[22] !== t9 || $[23] !== weight ? (t12 = /* @__PURE__ */ jsx(Input, {
1711
- "data-as": "textarea",
1712
- "data-scheme": t6,
1713
- "data-tone": t7,
1714
- ...restProps,
1715
- $fontSize: t8,
1716
- $padding: t9,
1717
- $scheme: t10,
1718
- $space: t11,
1719
- $tone: rootTheme.tone,
1720
- $weight: weight,
1721
- disabled,
1722
- ref
1723
- }), $[17] = disabled, $[18] = restProps, $[19] = rootTheme.scheme, $[20] = rootTheme.tone, $[21] = t8, $[22] = t9, $[23] = weight, $[24] = t12) : t12 = $[24];
1724
- let t13;
1725
- $[25] === radius ? t13 = $[26] : (t13 = _getArrayProp(radius), $[25] = radius, $[26] = t13);
1726
- let t14 = border ? "" : void 0, t15;
1727
- $[27] !== __unstable_disableFocusRing || $[28] !== rootTheme.scheme || $[29] !== rootTheme.tone || $[30] !== t13 || $[31] !== t14 ? (t15 = /* @__PURE__ */ jsx(Presentation, {
1728
- $radius: t13,
1729
- $unstableDisableFocusRing: __unstable_disableFocusRing,
1730
- $scheme: rootTheme.scheme,
1731
- $tone: rootTheme.tone,
1732
- "data-border": t14,
1733
- "data-scheme": rootTheme.scheme,
1734
- "data-tone": rootTheme.tone
1735
- }), $[27] = __unstable_disableFocusRing, $[28] = rootTheme.scheme, $[29] = rootTheme.tone, $[30] = t13, $[31] = t14, $[32] = t15) : t15 = $[32];
1736
- let t16;
1737
- return $[33] !== t12 || $[34] !== t15 ? (t16 = /* @__PURE__ */ jsx("span", {
1738
- className: textAreaRoot,
1739
- "data-ui": "TextArea",
1740
- children: /* @__PURE__ */ jsxs("span", {
1741
- className: inputRoot,
1742
- children: [t12, t15]
1743
- })
1744
- }), $[33] = t12, $[34] = t15, $[35] = t16) : t16 = $[35], t16;
1745
- }
1746
- /**
1747
- * @public
1748
- */
1749
- function BoundaryElementProvider(props) {
1750
- let $ = c(5), { children, element } = props, t0;
1751
- $[0] === element ? t0 = $[1] : (t0 = {
1752
- version: 0,
1753
- element
1754
- }, $[0] = element, $[1] = t0);
1755
- let value = t0, t1;
1756
- return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, {
1757
- value,
1758
- children
1759
- }), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
1760
- }
1761
- /**
1762
- * @internal
1763
- * @deprecated ConditionalWrapper was removed in @sanity/ui v4. Inline the conditional wrapping logic instead.
1764
- */
1765
- function ConditionalWrapper(_props) {
1766
- throw Error("`ConditionalWrapper` was removed in @sanity/ui v4. Inline the conditional wrapping logic instead.");
1767
- }
1768
- function findMaxBreakpoints(media, width) {
1769
- let ret = [];
1770
- for (let i = 0; i < media.length; i += 1) media[i] > width && ret.push(i);
1771
- return ret;
1772
- }
1773
- function findMinBreakpoints(media, width) {
1774
- let ret = [];
1775
- for (let i = 0; i < media.length; i += 1) media[i] <= width && ret.push(i);
1776
- return ret;
1777
- }
1778
- /**
1779
- * DO NOT USE IN PRODUCTION.
1780
- * @beta
1781
- */
1782
- function ElementQuery(props) {
1783
- let $ = c(19), theme = useTheme_v2(), _media, children, forwardedRef, restProps;
1784
- $[0] === props ? (_media = $[1], children = $[2], forwardedRef = $[3], restProps = $[4]) : ({children, media: _media, ref: forwardedRef, ...restProps} = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = forwardedRef, $[4] = restProps);
1785
- let media = _media ?? theme.media, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth, t0;
1786
- if ($[5] !== media || $[6] !== width) {
1787
- let eq = findMaxBreakpoints(media, width);
1788
- t0 = eq.length ? eq.join(" ") : void 0, $[5] = media, $[6] = width, $[7] = t0;
1789
- } else t0 = $[7];
1790
- let max = t0, t1;
1791
- if ($[8] !== media || $[9] !== width) {
1792
- let eq_0 = findMinBreakpoints(media, width);
1793
- t1 = eq_0.length ? eq_0.join(" ") : void 0, $[8] = media, $[9] = width, $[10] = t1;
1794
- } else t1 = $[10];
1795
- let min = t1, t2, t3;
1796
- $[11] === element ? (t2 = $[12], t3 = $[13]) : (t2 = () => element, t3 = [element], $[11] = element, $[12] = t2, $[13] = t3), useImperativeHandle(forwardedRef, t2, t3);
1797
- let t4;
1798
- return $[14] !== children || $[15] !== max || $[16] !== min || $[17] !== restProps ? (t4 = /* @__PURE__ */ jsx("div", {
1799
- "data-ui": "ElementQuery",
1800
- ...restProps,
1801
- "data-eq-max": max,
1802
- "data-eq-min": min,
1803
- ref: setElement,
1804
- children
1805
- }), $[14] = children, $[15] = max, $[16] = min, $[17] = restProps, $[18] = t4) : t4 = $[18], t4;
1806
- }
1807
- /**
1808
- * DO NOT USE IN PRODUCTION
1809
- * @beta
1810
- */
1811
- var ErrorBoundary = class extends Component {
1812
- state = { error: null };
1813
- static getDerivedStateFromError(error) {
1814
- return { error };
1815
- }
1816
- componentDidCatch(error, info) {
1817
- this.props.onCatch({
1818
- error,
1819
- info
1820
- });
1821
- }
1822
- render() {
1823
- let { error } = this.state;
1824
- if (error) {
1825
- let message = typeof error?.message == "string" ? error.message : "Error";
1826
- return /* @__PURE__ */ jsx("pre", {
1827
- "data-ui": "ErrorBoundary",
1828
- children: /* @__PURE__ */ jsx("code", { children: message })
1829
- });
1830
- }
1831
- return this.props.children;
1832
- }
1923
+ const $ = c(26);
1924
+ let T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1925
+ if ($[0] !== props) {
1926
+ const {
1927
+ className,
1928
+ style,
1929
+ disabled,
1930
+ error,
1931
+ label: t82,
1932
+ ...rest
1933
+ } = getProps(props, switchProps);
1934
+ label = t82, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", role: "switch", className: switchInputClassName, disabled, ...rest }), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
1935
+ } else
1936
+ T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1937
+ let t8;
1938
+ $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, alignItems: "center", radius: 6, "aria-hidden": "true" }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
1939
+ let t9;
1940
+ return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, { className: t2, style: t3, "data-ui": t4, disabled: t5, error: t6, children: [
1941
+ t7,
1942
+ t8,
1943
+ label
1944
+ ] }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
1945
+ }
1946
+ const tooltipProps = {
1947
+ anchorName: {
1948
+ type: "string"
1949
+ },
1950
+ content: {
1951
+ type: "string"
1952
+ },
1953
+ portal: {
1954
+ type: "boolean"
1955
+ },
1956
+ ...placementProps
1957
+ }, tooltipClassName = suffixClassName("sui-Tooltip");
1958
+ function TooltipRoot(t0) {
1959
+ const $ = c(7), {
1960
+ placement: t1,
1961
+ ...props
1962
+ } = t0, placement = t1 === void 0 ? "bottom" : t1, {
1963
+ children,
1964
+ className,
1965
+ style,
1966
+ id: idProp,
1967
+ anchorName,
1968
+ content,
1969
+ portal,
1970
+ triggerProps: forwardedTriggerProps,
1971
+ ...rest
1972
+ } = getProps({
1973
+ placement,
1974
+ ...props
1975
+ }, tooltipProps), reactId = useId(), id = idProp || reactId, [dismissed, setDismissed] = useState(!1), isClient = useIsClient();
1976
+ let t2, t3;
1977
+ $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
1978
+ setDismissed(!1);
1979
+ }, t3 = () => {
1980
+ setDismissed(!1);
1981
+ }, $[0] = t2, $[1] = t3) : (t2 = $[0], t3 = $[1]);
1982
+ const triggerProps = {
1983
+ "aria-describedby": id,
1984
+ interestfor: id,
1985
+ style: {
1986
+ anchorName: `--anchor-${anchorName || id}`
1987
+ },
1988
+ onMouseLeave: t2,
1989
+ onBlur: t3,
1990
+ onClick: () => {
1991
+ setDismissed(!0), document.getElementById(id)?.hidePopover();
1992
+ }
1993
+ }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
1994
+ triggerProps
1995
+ }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps));
1996
+ let t4;
1997
+ $[2] !== dismissed ? (t4 = (e) => {
1998
+ e.newState === "open" && dismissed && e.preventDefault();
1999
+ }, $[2] = dismissed, $[3] = t4) : t4 = $[3];
2000
+ const handleBeforeToggle = t4, t5 = renderPortal(/* @__PURE__ */ jsx("div", { className: clsx(tooltipClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
2001
+ ...style,
2002
+ positionAnchor: `--anchor-${anchorName || id}`
2003
+ }, "data-ui": "Tooltip", role: "tooltip", popover: "hint", id, onBeforeToggle: handleBeforeToggle, ...rest, children: content }), isClient, portal);
2004
+ let t6;
2005
+ return $[4] !== t5 || $[5] !== trigger ? (t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
2006
+ trigger,
2007
+ t5
2008
+ ] }), $[4] = t5, $[5] = trigger, $[6] = t6) : t6 = $[6], t6;
2009
+ }
2010
+ const Tooltip = Object.assign(TooltipRoot, {
2011
+ forwardsTriggerProps: !0
2012
+ }), tooltipGroupProps = {
2013
+ as: {
2014
+ type: "string"
2015
+ }
2016
+ }, tooltipGroupClassName = suffixClassName("sui-TooltipGroup");
2017
+ function TooltipGroup(props) {
2018
+ const $ = c(17), {
2019
+ as,
2020
+ children,
2021
+ className,
2022
+ style,
2023
+ ...rest
2024
+ } = getProps(props, tooltipGroupProps), Component = as || "div", ref = useRef(null), [isActive, setIsActive] = useState(!1);
2025
+ let t0;
2026
+ $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = (e) => {
2027
+ const tooltip = e.target.closest('[data-ui="Tooltip"]');
2028
+ tooltip && e.propertyName === "opacity" && window.getComputedStyle(tooltip).opacity !== "0" && setIsActive(!0);
2029
+ }, $[0] = t0) : t0 = $[0];
2030
+ const handleTransitionEnd = t0;
2031
+ let t1;
2032
+ $[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
2033
+ setIsActive(!1);
2034
+ }, $[1] = t1) : t1 = $[1];
2035
+ const handleMouseLeave = t1;
2036
+ let t2;
2037
+ $[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = (e_0) => {
2038
+ ref.current && ref.current.contains(e_0.relatedTarget) || setIsActive(!1);
2039
+ }, $[2] = t2) : t2 = $[2];
2040
+ const handleBlur = t2, t3 = clsx(tooltipGroupClassName, className);
2041
+ let t4;
2042
+ $[3] !== isActive ? (t4 = isActive && {
2043
+ "--tooltip-delay-group": "0ms"
2044
+ }, $[3] = isActive, $[4] = t4) : t4 = $[4];
2045
+ let t5;
2046
+ $[5] !== style || $[6] !== t4 ? (t5 = {
2047
+ ...style,
2048
+ ...t4
2049
+ }, $[5] = style, $[6] = t4, $[7] = t5) : t5 = $[7];
2050
+ let t6;
2051
+ return $[8] !== Component || $[9] !== children || $[10] !== handleBlur || $[11] !== handleMouseLeave || $[12] !== handleTransitionEnd || $[13] !== rest || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Component, { className: t3, style: t5, "data-ui": "TooltipGroup", ref, onTransitionEnd: handleTransitionEnd, onMouseLeave: handleMouseLeave, onBlur: handleBlur, ...rest, children }), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
2052
+ }
2053
+ const badgeProps = {
2054
+ as: {
2055
+ type: "string"
2056
+ },
2057
+ iconStart: {
2058
+ type: "string"
2059
+ },
2060
+ text: {
2061
+ type: "string"
2062
+ },
2063
+ ...toneProps
2064
+ }, badgeClassName = suffixClassName("sui-Badge");
2065
+ function Badge(t0) {
2066
+ const $ = c(20);
2067
+ let T0, children, t1, t2, t3, t4, t5, text;
2068
+ if ($[0] !== t0) {
2069
+ const {
2070
+ tone: t62,
2071
+ ...props
2072
+ } = t0, tone = t62 === void 0 ? "neutral" : t62, {
2073
+ as,
2074
+ children: t72,
2075
+ className,
2076
+ style,
2077
+ iconStart: IconStart,
2078
+ text: t8,
2079
+ ...rest
2080
+ } = getProps({
2081
+ tone,
2082
+ ...props
2083
+ }, badgeProps);
2084
+ children = t72, text = t8;
2085
+ const Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
2086
+ T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, { icon: IconStart, marginX: -1, marginY: -2, size: 0 })), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
2087
+ } else
2088
+ T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
2089
+ let t6;
2090
+ $[9] !== text ? (t6 = text && /* @__PURE__ */ jsx(Text, { size: 1, trim: !0, children: text }), $[9] = text, $[10] = t6) : t6 = $[10];
2091
+ let t7;
2092
+ return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { className: t1, style: t2, "data-ui": t3, ...t4, children: [
2093
+ t5,
2094
+ t6,
2095
+ children
2096
+ ] }), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
2097
+ }
2098
+ export {
2099
+ Badge,
2100
+ Box,
2101
+ Button,
2102
+ Card,
2103
+ Checkbox,
2104
+ Code,
2105
+ Container,
2106
+ Dialog,
2107
+ Divider,
2108
+ Eyebrow,
2109
+ Flex,
2110
+ Grid,
2111
+ HStack,
2112
+ Heading,
2113
+ Icon,
2114
+ IconButton,
2115
+ Indicator,
2116
+ IndicatorStack,
2117
+ Inline,
2118
+ Label,
2119
+ Link,
2120
+ List,
2121
+ Popover,
2122
+ PressArea,
2123
+ Radio,
2124
+ SkipToContent,
2125
+ Spinner,
2126
+ Switch,
2127
+ Text,
2128
+ Tooltip,
2129
+ TooltipGroup,
2130
+ VStack,
2131
+ VisuallyHidden,
2132
+ useIsClient
1833
2133
  };
1834
- /**
1835
- * @public
1836
- */
1837
- function PortalProvider(props) {
1838
- let $ = c(7), { boundaryElement, children, element, __unstable_elements: elements } = props, fallbackElement = useSyncExternalStore(emptySubscribe, _temp, _temp2), t0 = boundaryElement || null, t1 = element || fallbackElement, t2;
1839
- $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
1840
- version: 0,
1841
- boundaryElement: t0,
1842
- element: t1,
1843
- elements
1844
- }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
1845
- let value = t2, t3;
1846
- return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext.Provider, {
1847
- value,
1848
- children
1849
- }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
1850
- }
1851
- function _temp2() {
1852
- return null;
1853
- }
1854
- function _temp() {
1855
- return document.body;
1856
- }
1857
- const emptySubscribe = () => () => {};
1858
- var srOnly = "_1omd6w40";
1859
- /**
1860
- * @public
1861
- */
1862
- function SrOnly(props) {
1863
- let $ = c(4), { as: t0, children, ref } = props, Component = t0 === void 0 ? "div" : t0, t1;
1864
- return $[0] !== Component || $[1] !== children || $[2] !== ref ? (t1 = /* @__PURE__ */ jsx(Component, {
1865
- "aria-hidden": !0,
1866
- className: srOnly,
1867
- "data-ui": "SrOnly",
1868
- ref,
1869
- children
1870
- }), $[0] = Component, $[1] = children, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
1871
- }
1872
- var virtualList = "woi5yn0", virtualListItem = "woi5yn1";
1873
- /**
1874
- * @beta
1875
- */
1876
- function VirtualList(props) {
1877
- let $ = c(49), className, forwardedRef, getItemKey, onChange, renderItem, restProps, t0, t1, t2;
1878
- $[0] === props ? (className = $[1], forwardedRef = $[2], getItemKey = $[3], onChange = $[4], renderItem = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9]) : ({as: t0, className, gap: t1, getItemKey, items: t2, onChange, ref: forwardedRef, renderItem, ...restProps} = props, $[0] = props, $[1] = className, $[2] = forwardedRef, $[3] = getItemKey, $[4] = onChange, $[5] = renderItem, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2);
1879
- let as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1, t3;
1880
- $[10] === t2 ? t3 = $[11] : (t3 = t2 === void 0 ? [] : t2, $[10] = t2, $[11] = t3);
1881
- let items = t3, { space } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1), t4;
1882
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[12] = t4) : t4 = $[12], useImperativeHandle(forwardedRef, t4);
1883
- let t5;
1884
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
1885
- if (!wrapperRef.current) return;
1886
- let firstElement = wrapperRef.current.firstChild;
1887
- firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
1888
- }, $[13] = t5) : t5 = $[13];
1889
- let t6;
1890
- $[14] === renderItem ? t6 = $[15] : (t6 = [renderItem], $[14] = renderItem, $[15] = t6), useEffect(t5, t6);
1891
- let t7, t8;
1892
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
1893
- if (!ref.current) return;
1894
- let scrollEl = findScrollable(ref.current.parentNode);
1895
- if (scrollEl) {
1896
- if (!(scrollEl instanceof HTMLElement)) return;
1897
- let handleScroll = () => {
1898
- setScrollTop(scrollEl.scrollTop);
1899
- };
1900
- scrollEl.addEventListener("scroll", handleScroll, { passive: !0 });
1901
- let ro = new ResizeObserver((entries) => {
1902
- setScrollHeight(entries[0].contentRect.height);
1903
- });
1904
- return ro.observe(scrollEl), handleScroll(), () => {
1905
- scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
1906
- };
1907
- }
1908
- let handleScroll_0 = () => {
1909
- setScrollTop(window.scrollY);
1910
- }, handleResize = () => {
1911
- setScrollHeight(window.innerHeight);
1912
- };
1913
- return window.addEventListener("scroll", handleScroll_0, { passive: !0 }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
1914
- window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
1915
- };
1916
- }, t8 = [], $[16] = t7, $[17] = t8) : (t7 = $[16], t8 = $[17]), useEffect(t7, t8);
1917
- let len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0, t10, t9;
1918
- $[18] !== fromIndex || $[19] !== gap || $[20] !== itemHeight || $[21] !== onChange || $[22] !== scrollHeight || $[23] !== scrollTop || $[24] !== space || $[25] !== toIndex ? (t9 = () => {
1919
- onChange && onChange({
1920
- fromIndex,
1921
- gap: space[gap],
1922
- itemHeight,
1923
- scrollHeight,
1924
- scrollTop,
1925
- toIndex
1926
- });
1927
- }, t10 = [
1928
- fromIndex,
1929
- gap,
1930
- itemHeight,
1931
- onChange,
1932
- scrollHeight,
1933
- scrollTop,
1934
- space,
1935
- toIndex
1936
- ], $[18] = fromIndex, $[19] = gap, $[20] = itemHeight, $[21] = onChange, $[22] = scrollHeight, $[23] = scrollTop, $[24] = space, $[25] = toIndex, $[26] = t10, $[27] = t9) : (t10 = $[26], t9 = $[27]), useEffect(t9, t10);
1937
- let t11;
1938
- $[28] !== fromIndex || $[29] !== gap || $[30] !== getItemKey || $[31] !== itemHeight || $[32] !== items || $[33] !== renderItem || $[34] !== space || $[35] !== toIndex ? (t11 = {
1939
- fromIndex,
1940
- gap,
1941
- itemHeight,
1942
- space,
1943
- toIndex,
1944
- getItemKey,
1945
- items,
1946
- renderItem
1947
- }, $[28] = fromIndex, $[29] = gap, $[30] = getItemKey, $[31] = itemHeight, $[32] = items, $[33] = renderItem, $[34] = space, $[35] = toIndex, $[36] = t11) : t11 = $[36];
1948
- let children = useChildren(t11), Component = as, t12;
1949
- $[37] === className ? t12 = $[38] : (t12 = clsx(virtualList, className), $[37] = className, $[38] = t12);
1950
- let t13;
1951
- $[39] === height ? t13 = $[40] : (t13 = { height }, $[39] = height, $[40] = t13);
1952
- let t14;
1953
- $[41] !== children || $[42] !== t13 ? (t14 = /* @__PURE__ */ jsx("div", {
1954
- ref: wrapperRef,
1955
- style: t13,
1956
- children
1957
- }), $[41] = children, $[42] = t13, $[43] = t14) : t14 = $[43];
1958
- let t15;
1959
- return $[44] !== Component || $[45] !== restProps || $[46] !== t12 || $[47] !== t14 ? (t15 = /* @__PURE__ */ jsx(Component, {
1960
- className: t12,
1961
- "data-ui": "VirtualList",
1962
- ref,
1963
- ...restProps,
1964
- children: t14
1965
- }), $[44] = Component, $[45] = restProps, $[46] = t12, $[47] = t14, $[48] = t15) : t15 = $[48], t15;
1966
- }
1967
- function useChildren(t0) {
1968
- let $ = c(21), { fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex } = t0;
1969
- if (!renderItem || items.length === 0) return null;
1970
- if (itemHeight === -1) {
1971
- let t1;
1972
- $[0] !== items[0] || $[1] !== renderItem ? (t1 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t1) : t1 = $[2];
1973
- let t2;
1974
- return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */ jsx("div", {
1975
- className: virtualListItem,
1976
- children: t1
1977
- }, 0)], $[3] = t1, $[4] = t2), t2;
1978
- }
1979
- let t1;
1980
- if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
1981
- let t2;
1982
- $[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
1983
- let itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
1984
- return /* @__PURE__ */ jsx("div", {
1985
- className: virtualListItem,
1986
- style: { top: itemIndex * (itemHeight + space[gap]) },
1987
- children: node
1988
- }, key);
1989
- }, $[14] = fromIndex, $[15] = gap, $[16] = getItemKey, $[17] = itemHeight, $[18] = renderItem, $[19] = space, $[20] = t2) : t2 = $[20], t1 = items.slice(fromIndex, toIndex).map(t2), $[5] = fromIndex, $[6] = gap, $[7] = getItemKey, $[8] = itemHeight, $[9] = items, $[10] = renderItem, $[11] = space, $[12] = toIndex, $[13] = t1;
1990
- } else t1 = $[13];
1991
- return t1;
1992
- }
1993
- function findScrollable(parentNode) {
1994
- let _scrollEl = parentNode;
1995
- for (; _scrollEl && !_isScrollable(_scrollEl);) _scrollEl = _scrollEl.parentNode;
1996
- return _scrollEl;
1997
- }
1998
- export { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Button, Card, Checkbox, CodeSkeleton, ConditionalWrapper, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Tree, TreeItem, VirtualList, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useClickOutsideEvent, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMatchMedia, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useTree };
1999
-
2000
- //# sourceMappingURL=index.js.map
2134
+ //# sourceMappingURL=index.js.map