@sanity/ui 3.0.0-static.29 → 3.0.0-static.30

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 (232) hide show
  1. package/README.md +1 -1
  2. package/dist/_chunks-cjs/_visual-editing.cjs +293 -293
  3. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
  4. package/dist/_chunks-es/_visual-editing.js +294 -294
  5. package/dist/_chunks-es/_visual-editing.js.map +1 -1
  6. package/dist/css/index.cjs.map +1 -1
  7. package/dist/css/index.css +1 -1
  8. package/dist/css/index.js.map +1 -1
  9. package/dist/index.cjs +47 -37
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +12 -0
  12. package/dist/index.d.ts +12 -0
  13. package/dist/index.js +48 -38
  14. package/dist/index.js.map +1 -1
  15. package/dist/theme.cjs +6 -6
  16. package/dist/theme.cjs.map +1 -1
  17. package/dist/theme.js +6 -6
  18. package/dist/theme.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/core/components/autocomplete/autocomplete.tsx +7 -7
  21. package/src/core/components/autocomplete/constants.ts +0 -2
  22. package/src/core/components/autocomplete/types.ts +1 -1
  23. package/src/core/components/breadcrumbs/breadcrumbs.tsx +6 -6
  24. package/src/core/components/dialog/__workshop__/activate.tsx +1 -2
  25. package/src/core/components/dialog/dialog.tsx +6 -5
  26. package/src/core/components/dialog/dialogCard.tsx +8 -8
  27. package/src/core/components/hotkeys/hotkeys.tsx +2 -2
  28. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -2
  29. package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -5
  30. package/src/core/components/menu/menu.tsx +3 -3
  31. package/src/core/components/menu/menuButton.tsx +2 -2
  32. package/src/core/components/menu/menuGroup.tsx +5 -5
  33. package/src/core/components/menu/menuItem.tsx +5 -5
  34. package/src/core/components/tab/tab.tsx +1 -1
  35. package/src/core/components/tab/tabList.tsx +1 -1
  36. package/src/core/components/tab/tabPanel.tsx +1 -1
  37. package/src/core/components/toast/toast.tsx +6 -6
  38. package/src/core/components/toast/toastLayer.tsx +2 -2
  39. package/src/core/components/toast/toastProvider.tsx +1 -1
  40. package/src/core/components/tree/tree.tsx +1 -1
  41. package/src/core/components/tree/treeGroup.tsx +1 -1
  42. package/src/core/components/tree/treeItem.tsx +5 -5
  43. package/src/core/components/virtualList/virtualList.tsx +1 -1
  44. package/src/core/index.ts +95 -44
  45. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -9
  46. package/src/core/primitives/avatar/avatar.tsx +2 -2
  47. package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
  48. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  49. package/src/core/primitives/badge/badge.tsx +2 -2
  50. package/src/core/primitives/button/__workshop__/disabled.tsx +1 -7
  51. package/src/core/primitives/button/button.tsx +3 -4
  52. package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -3
  53. package/src/core/primitives/card/card.tsx +1 -1
  54. package/src/core/primitives/container/container.tsx +1 -1
  55. package/src/core/primitives/flex/flex.tsx +1 -1
  56. package/src/core/primitives/grid/grid.tsx +1 -1
  57. package/src/core/primitives/inline/inline.tsx +1 -1
  58. package/src/core/primitives/kbd/kbd.tsx +4 -4
  59. package/src/core/primitives/layer/layer.tsx +1 -1
  60. package/src/core/primitives/layer/layerCard.tsx +1 -1
  61. package/src/core/primitives/layer/layerProvider.tsx +1 -1
  62. package/src/core/primitives/popover/popover.tsx +6 -4
  63. package/src/core/primitives/popover/popoverLayer.tsx +3 -3
  64. package/src/core/primitives/root/Root.tsx +11 -16
  65. package/src/core/primitives/root/RootProvider.tsx +40 -0
  66. package/src/core/primitives/select/select.tsx +2 -2
  67. package/src/core/primitives/{_selectable → selectable}/selectable.tsx +1 -1
  68. package/src/core/primitives/spinner/spinner.tsx +1 -1
  69. package/src/core/primitives/stack/stack.tsx +1 -1
  70. package/src/core/primitives/switch/switch.tsx +1 -1
  71. package/src/core/primitives/textInput/textInput.tsx +3 -3
  72. package/src/core/primitives/tooltip/tooltip.test.tsx +2 -2
  73. package/src/core/primitives/tooltip/tooltip.tsx +6 -4
  74. package/src/core/primitives/tooltip/tooltipLayer.tsx +2 -2
  75. package/src/core/utils/errorBoundary.tsx +1 -1
  76. package/src/core/utils/portal/portal.tsx +2 -1
  77. package/src/css/components/dialog/dialog.ts +1 -1
  78. package/src/css/components/skeleton/skeleton.ts +3 -3
  79. package/src/css/components/skeleton/types.ts +3 -3
  80. package/src/css/defaultTheme.css.ts +1 -1
  81. package/src/css/index.ts +126 -69
  82. package/src/css/primitives/_input/input.ts +2 -2
  83. package/src/css/primitives/_input/types.ts +2 -2
  84. package/src/css/primitives/_selectable/selectable.ts +1 -1
  85. package/src/css/primitives/_selectable/types.ts +1 -1
  86. package/src/css/primitives/avatar/avatar.ts +1 -1
  87. package/src/css/primitives/box/box.ts +35 -35
  88. package/src/css/primitives/box/types.ts +34 -34
  89. package/src/css/primitives/button/button.css.ts +8 -8
  90. package/src/css/primitives/button/button.ts +4 -4
  91. package/src/css/primitives/button/types.ts +3 -3
  92. package/src/css/primitives/card/__workshop__/color.tsx +8 -3
  93. package/src/css/primitives/code/code.ts +3 -3
  94. package/src/css/primitives/code/types.ts +2 -2
  95. package/src/css/primitives/container/container.ts +3 -3
  96. package/src/css/primitives/heading/heading.ts +4 -4
  97. package/src/css/primitives/heading/types.ts +3 -3
  98. package/src/css/primitives/kbd/kbd.ts +1 -1
  99. package/src/css/primitives/kbd/types.ts +1 -1
  100. package/src/css/primitives/label/label.ts +4 -4
  101. package/src/css/primitives/label/types.ts +3 -3
  102. package/src/css/primitives/root/root.ts +2 -2
  103. package/src/css/primitives/root/types.ts +1 -1
  104. package/src/css/primitives/select/select.ts +1 -1
  105. package/src/css/primitives/select/types.ts +1 -1
  106. package/src/css/primitives/text/text.ts +5 -5
  107. package/src/css/primitives/text/types.ts +4 -4
  108. package/src/css/primitives/textArea/textArea.ts +1 -1
  109. package/src/css/primitives/textArea/types.ts +1 -1
  110. package/src/css/primitives/textInput/textInput.ts +1 -1
  111. package/src/css/primitives/textInput/types.ts +1 -1
  112. package/src/css/primitives/tooltip/tooltip.css.ts +1 -3
  113. package/src/css/primitives/tooltip/tooltip.ts +0 -2
  114. package/src/theme/v3/defaultTokens.ts +6 -6
  115. package/src/core/_compat/index.ts +0 -4
  116. package/src/core/_compat/styles/index.ts +0 -1
  117. package/src/core/_compat/theme/index.ts +0 -5
  118. package/src/core/components/breadcrumbs/index.ts +0 -1
  119. package/src/core/components/dialog/index.ts +0 -5
  120. package/src/core/components/hotkeys/index.ts +0 -1
  121. package/src/core/components/menu/index.ts +0 -5
  122. package/src/core/components/tab/index.ts +0 -3
  123. package/src/core/components/toast/index.ts +0 -4
  124. package/src/core/components/tree/index.ts +0 -4
  125. package/src/core/components/virtualList/index.ts +0 -1
  126. package/src/core/hooks/useElementRect/index.ts +0 -1
  127. package/src/core/hooks/useMediaIndex/index.ts +0 -1
  128. package/src/core/primitives/_selectable/index.ts +0 -2
  129. package/src/core/primitives/arrow/index.ts +0 -1
  130. package/src/core/primitives/avatar/index.ts +0 -4
  131. package/src/core/primitives/badge/index.ts +0 -1
  132. package/src/core/primitives/badge/types2.ts +0 -10
  133. package/src/core/primitives/box/index.ts +0 -2
  134. package/src/core/primitives/button/index.ts +0 -2
  135. package/src/core/primitives/card/index.ts +0 -4
  136. package/src/core/primitives/checkbox/index.ts +0 -1
  137. package/src/core/primitives/code/index.ts +0 -1
  138. package/src/core/primitives/container/index.ts +0 -2
  139. package/src/core/primitives/flex/index.ts +0 -2
  140. package/src/core/primitives/grid/index.ts +0 -2
  141. package/src/core/primitives/heading/index.ts +0 -1
  142. package/src/core/primitives/inline/index.ts +0 -1
  143. package/src/core/primitives/inline/types.ts +0 -7
  144. package/src/core/primitives/kbd/index.ts +0 -1
  145. package/src/core/primitives/label/index.ts +0 -1
  146. package/src/core/primitives/layer/index.ts +0 -4
  147. package/src/core/primitives/popover/index.ts +0 -2
  148. package/src/core/primitives/radio/index.ts +0 -1
  149. package/src/core/primitives/root/index.ts +0 -1
  150. package/src/core/primitives/select/index.ts +0 -1
  151. package/src/core/primitives/skeleton/index.ts +0 -5
  152. package/src/core/primitives/spinner/index.ts +0 -1
  153. package/src/core/primitives/srOnly/index.ts +0 -1
  154. package/src/core/primitives/stack/index.ts +0 -1
  155. package/src/core/primitives/switch/index.ts +0 -1
  156. package/src/core/primitives/text/index.ts +0 -1
  157. package/src/core/primitives/textArea/index.ts +0 -1
  158. package/src/core/primitives/textInput/index.ts +0 -1
  159. package/src/core/primitives/tooltip/index.ts +0 -2
  160. package/src/core/utils/boundaryElement/index.ts +0 -3
  161. package/src/core/utils/elementQuery/index.ts +0 -1
  162. package/src/core/utils/portal/index.ts +0 -4
  163. package/src/css/components/breadcrumbs/index.ts +0 -1
  164. package/src/css/components/dialog/index.ts +0 -1
  165. package/src/css/components/menu/index.ts +0 -1
  166. package/src/css/components/skeleton/index.ts +0 -2
  167. package/src/css/components/toast/index.ts +0 -1
  168. package/src/css/components/tree/index.ts +0 -1
  169. package/src/css/primitives/_arrow/index.ts +0 -1
  170. package/src/css/primitives/_input/index.ts +0 -2
  171. package/src/css/primitives/_selectable/index.ts +0 -2
  172. package/src/css/primitives/avatar/index.ts +0 -2
  173. package/src/css/primitives/badge/index.ts +0 -2
  174. package/src/css/primitives/box/index.ts +0 -2
  175. package/src/css/primitives/button/index.ts +0 -2
  176. package/src/css/primitives/card/index.ts +0 -2
  177. package/src/css/primitives/checkbox/index.ts +0 -1
  178. package/src/css/primitives/code/index.ts +0 -2
  179. package/src/css/primitives/container/index.ts +0 -2
  180. package/src/css/primitives/heading/index.ts +0 -2
  181. package/src/css/primitives/kbd/index.ts +0 -2
  182. package/src/css/primitives/label/index.ts +0 -2
  183. package/src/css/primitives/popover/index.ts +0 -1
  184. package/src/css/primitives/radio/index.ts +0 -1
  185. package/src/css/primitives/root/index.ts +0 -2
  186. package/src/css/primitives/select/index.ts +0 -2
  187. package/src/css/primitives/spinner/index.ts +0 -2
  188. package/src/css/primitives/srOnly/index.ts +0 -1
  189. package/src/css/primitives/stack/index.ts +0 -1
  190. package/src/css/primitives/switch/index.ts +0 -1
  191. package/src/css/primitives/text/index.ts +0 -2
  192. package/src/css/primitives/textArea/index.ts +0 -2
  193. package/src/css/primitives/textInput/index.ts +0 -2
  194. package/src/css/primitives/tooltip/index.ts +0 -2
  195. package/src/css/props/alignItems/index.ts +0 -2
  196. package/src/css/props/border/index.ts +0 -2
  197. package/src/css/props/boxSizing/index.ts +0 -2
  198. package/src/css/props/display/index.ts +0 -2
  199. package/src/css/props/flex/index.ts +0 -2
  200. package/src/css/props/flexDirection/index.ts +0 -2
  201. package/src/css/props/flexWrap/index.ts +0 -2
  202. package/src/css/props/font/index.ts +0 -2
  203. package/src/css/props/gap/index.ts +0 -2
  204. package/src/css/props/gridAutoColumns/index.ts +0 -2
  205. package/src/css/props/gridAutoFlow/index.ts +0 -2
  206. package/src/css/props/gridAutoRows/index.ts +0 -2
  207. package/src/css/props/gridColumn/index.ts +0 -2
  208. package/src/css/props/gridColumnEnd/index.ts +0 -2
  209. package/src/css/props/gridColumnStart/index.ts +0 -2
  210. package/src/css/props/gridRow/index.ts +0 -2
  211. package/src/css/props/gridRowEnd/index.ts +0 -2
  212. package/src/css/props/gridRowStart/index.ts +0 -2
  213. package/src/css/props/gridTemplateColumns/index.ts +0 -2
  214. package/src/css/props/gridTemplateRows/index.ts +0 -2
  215. package/src/css/props/height/index.ts +0 -2
  216. package/src/css/props/inset/index.ts +0 -2
  217. package/src/css/props/justifyContent/index.ts +0 -2
  218. package/src/css/props/margin/index.ts +0 -2
  219. package/src/css/props/maxWidth/index.ts +0 -2
  220. package/src/css/props/minHeight/index.ts +0 -2
  221. package/src/css/props/minWidth/index.ts +0 -2
  222. package/src/css/props/outline/index.ts +0 -2
  223. package/src/css/props/overflow/index.ts +0 -2
  224. package/src/css/props/padding/index.ts +0 -2
  225. package/src/css/props/pointerEvents/index.ts +0 -2
  226. package/src/css/props/position/index.ts +0 -2
  227. package/src/css/props/radius/index.ts +0 -2
  228. package/src/css/props/shadow/index.ts +0 -2
  229. package/src/css/props/textAlign/index.ts +0 -2
  230. package/src/css/props/textOverflow/index.ts +0 -2
  231. package/src/css/props/width/index.ts +0 -2
  232. /package/src/core/primitives/{_selectable → selectable}/types.ts +0 -0
@@ -329,29 +329,6 @@ function Box(props) {
329
329
  let t10;
330
330
  return $[149] !== Element || $[150] !== children || $[151] !== rest || $[152] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Element, { "data-ui": "Box", ...rest, className: t9, children }), $[149] = Element, $[150] = children, $[151] = rest, $[152] = t9, $[153] = t10) : t10 = $[153], t10;
331
331
  }
332
- const DEFAULT_SELECTABLE_ELEMENT = "button";
333
- function Selectable(props) {
334
- const $ = compilerRuntime.c(16), t0 = props;
335
- let className, radius, rest, selected, t1, tone;
336
- $[0] !== t0 ? ({
337
- as: t1,
338
- className,
339
- radius,
340
- selected,
341
- tone,
342
- ...rest
343
- } = t0, $[0] = t0, $[1] = className, $[2] = radius, $[3] = rest, $[4] = selected, $[5] = t1, $[6] = tone) : (className = $[1], radius = $[2], rest = $[3], selected = $[4], t1 = $[5], tone = $[6]);
344
- const as = t1 === void 0 ? DEFAULT_SELECTABLE_ELEMENT : t1;
345
- let t2;
346
- $[7] !== className || $[8] !== radius || $[9] !== tone ? (t2 = css._selectable({
347
- className,
348
- radius,
349
- tone
350
- }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
351
- const t3 = selected ? "" : void 0;
352
- let t4;
353
- return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
354
- }
355
332
  const DEFAULT_TEXT_ELEMENT = "div";
356
333
  function Text(props) {
357
334
  const $ = compilerRuntime.c(32), t0 = props;
@@ -558,46 +535,6 @@ function useBoundaryElement() {
558
535
  function useCard() {
559
536
  return react.useContext(CardContext);
560
537
  }
561
- const DEFAULT_CARD_ELEMENT = "div";
562
- function Card(props) {
563
- const $ = compilerRuntime.c(38), t0 = props;
564
- let className, disabled, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
565
- $[0] !== t0 ? ({
566
- __unstable_checkered: t1,
567
- __unstable_focusRing: t2,
568
- as: t3,
569
- className,
570
- disabled,
571
- pressed,
572
- radius: t4,
573
- scheme: schemeProp,
574
- selected,
575
- style,
576
- tone: t5,
577
- ...rest
578
- } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = pressed, $[4] = rest, $[5] = schemeProp, $[6] = selected, $[7] = style, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5) : (className = $[1], disabled = $[2], pressed = $[3], rest = $[4], schemeProp = $[5], selected = $[6], style = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12]);
579
- const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = useCard(), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
580
- let t7;
581
- $[13] !== className || $[14] !== t6 || $[15] !== tone ? (t7 = css.card({
582
- className,
583
- scheme: t6,
584
- tone
585
- }), $[13] = className, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16];
586
- const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
587
- let t13;
588
- $[17] !== as || $[18] !== radius || $[19] !== rest || $[20] !== style || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[17] = as, $[18] = radius, $[19] = rest, $[20] = style, $[21] = t10, $[22] = t11, $[23] = t12, $[24] = t7, $[25] = t8, $[26] = t9, $[27] = t13) : t13 = $[27];
589
- let node = t13;
590
- if (scheme === parent?.scheme && tone === parent?.tone)
591
- return node;
592
- const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
593
- let t17;
594
- if ($[28] !== node || $[29] !== t14 || $[30] !== t15 || $[31] !== t16 ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[28] = node, $[29] = t14, $[30] = t15, $[31] = t16, $[32] = t17) : t17 = $[32], node = t17, parent?.unstable_CompatProvider) {
595
- const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent?.tone ?? "default";
596
- let t20;
597
- return $[33] !== CompatProvider || $[34] !== node || $[35] !== t18 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[33] = CompatProvider, $[34] = node, $[35] = t18, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
598
- }
599
- return node;
600
- }
601
538
  const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
602
539
  globalScope[elementKey] = null;
603
540
  const defaultContextValue = {
@@ -628,44 +565,6 @@ function Portal(props) {
628
565
  let t2;
629
566
  return $[3] !== portalElement || $[4] !== t1 ? (t2 = reactDom.createPortal(t1, portalElement), $[3] = portalElement, $[4] = t1, $[5] = t2) : t2 = $[5], t2;
630
567
  }
631
- function PortalProvider(props) {
632
- const $ = compilerRuntime.c(7), {
633
- boundaryElement,
634
- children,
635
- element,
636
- __unstable_elements: elementsProp
637
- } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
638
- let t0;
639
- const t1 = boundaryElement || null, t2 = element || fallbackElement;
640
- let t3;
641
- $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
642
- version: 0,
643
- boundaryElement: t1,
644
- element: t2,
645
- elements
646
- }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
647
- const value = t0;
648
- let t4;
649
- return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
650
- }
651
- function _temp2$2() {
652
- return null;
653
- }
654
- function _temp$4() {
655
- return document.body;
656
- }
657
- const emptySubscribe = () => () => {
658
- };
659
- function useUnique(value) {
660
- const valueRef = react.useRef(value);
661
- return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
662
- }
663
- function _isEqual(objA, objB) {
664
- if (!objA || !objB)
665
- return objA === objB;
666
- const keysA = Object.keys(objA), keysB = Object.keys(objB);
667
- return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
668
- }
669
568
  function getLayerContext(contextValue) {
670
569
  if (!isRecord(contextValue) || contextValue.version !== 0)
671
570
  throw new Error("the context value is not compatible");
@@ -688,6 +587,224 @@ function useLayer() {
688
587
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
689
588
  }
690
589
  }
590
+ const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
591
+ top: ["bottom", "left", "right"],
592
+ "top-start": ["bottom-start", "left-start", "right-start"],
593
+ "top-end": ["bottom-end", "left-end", "right-end"],
594
+ bottom: ["top", "left", "right"],
595
+ "bottom-start": ["top-start", "left-start", "right-start"],
596
+ "bottom-end": ["top-end", "left-end", "right-end"],
597
+ left: ["right", "top", "bottom"],
598
+ "left-start": ["right-start", "top-start", "bottom-start"],
599
+ "left-end": ["right-end", "top-end", "bottom-end"],
600
+ right: ["left", "top", "bottom"],
601
+ "right-start": ["left-start", "top-start", "bottom-start"],
602
+ "right-end": ["left-end", "top-end", "bottom-end"]
603
+ };
604
+ function size(options) {
605
+ const {
606
+ apply,
607
+ margins,
608
+ padding = 0
609
+ } = options;
610
+ return {
611
+ name: "@sanity/ui/size",
612
+ async fn(args) {
613
+ const {
614
+ elements,
615
+ placement,
616
+ platform,
617
+ rects
618
+ } = args, {
619
+ floating,
620
+ reference
621
+ } = rects, overflow = await reactDom$1.detectOverflow(args, {
622
+ altBoundary: !0,
623
+ boundary: options.boundaryElement || void 0,
624
+ elementContext: "floating",
625
+ padding,
626
+ rootBoundary: "viewport"
627
+ });
628
+ let maxWidth = 1 / 0, maxHeight = 1 / 0;
629
+ const floatingW = floating.width, floatingH = floating.height;
630
+ placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom)), apply({
631
+ availableWidth: maxWidth - margins[1] - margins[3],
632
+ availableHeight: maxHeight - margins[0] - margins[2],
633
+ elements,
634
+ referenceWidth: reference.width - margins[1] - margins[3]
635
+ });
636
+ const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
637
+ return floatingW !== targetW || floatingH !== targetH ? {
638
+ reset: {
639
+ rects: !0
640
+ }
641
+ } : {};
642
+ }
643
+ };
644
+ }
645
+ function moveTowardsLength(movingPoint, targetPoint, amount) {
646
+ const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
647
+ return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
648
+ }
649
+ function moveTowardsFractional(movingPoint, targetPoint, fraction) {
650
+ return {
651
+ x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
652
+ y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
653
+ };
654
+ }
655
+ function getRoundedCommands(points) {
656
+ const len = points.length, cmds = [];
657
+ for (let i = 0; i < len; i += 1) {
658
+ const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
659
+ if (prevPoint && point.radius) {
660
+ const curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, 0.5), endControl = moveTowardsFractional(point, curveEnd, 0.5);
661
+ cmds.push({
662
+ type: "point",
663
+ ...curveStart
664
+ }), cmds.push({
665
+ type: "curve",
666
+ curveEnd,
667
+ startControl,
668
+ endControl
669
+ });
670
+ } else
671
+ cmds.push({
672
+ type: "point",
673
+ ...point
674
+ });
675
+ }
676
+ return cmds;
677
+ }
678
+ function compileCommands(cmds) {
679
+ return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
680
+ }
681
+ const DEFAULT_ARROW_ELEMENT = "div";
682
+ function Arrow(props) {
683
+ const $ = compilerRuntime.c(34), t0 = props;
684
+ let h, rest, style, t1, t2, w;
685
+ $[0] !== t0 ? ({
686
+ as: t1,
687
+ width: w,
688
+ height: h,
689
+ radius: t2,
690
+ style,
691
+ ...rest
692
+ } = t0, $[0] = t0, $[1] = h, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = w) : (h = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], w = $[6]);
693
+ const Element = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
694
+ let t3;
695
+ const points = [{
696
+ x: 0,
697
+ y: 0
698
+ }, {
699
+ x: radius,
700
+ y: 0,
701
+ radius
702
+ }, {
703
+ x: center,
704
+ y: h - 1,
705
+ radius
706
+ }, {
707
+ x: w - radius,
708
+ y: 0,
709
+ radius
710
+ }, {
711
+ x: w,
712
+ y: 0
713
+ }], cmds = getRoundedCommands(points);
714
+ t3 = compileCommands(cmds);
715
+ const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
716
+ let t4;
717
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = css._arrow(), $[7] = t4) : t4 = $[7];
718
+ const t5 = `${w}px`;
719
+ let t6;
720
+ $[8] !== t5 ? (t6 = dynamic.assignInlineVars({
721
+ [css.vars.arrow.size]: t5
722
+ }), $[8] = t5, $[9] = t6) : t6 = $[9];
723
+ let t7;
724
+ $[10] !== style || $[11] !== t6 ? (t7 = {
725
+ ...style,
726
+ ...t6
727
+ }, $[10] = style, $[11] = t6, $[12] = t7) : t7 = $[12];
728
+ let t8;
729
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css._arrowSvg(), $[13] = t8) : t8 = $[13];
730
+ const t9 = `0 0 ${w} ${w}`;
731
+ let t10;
732
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._arrowStrokeMask(), $[14] = t10) : t10 = $[14];
733
+ let t11;
734
+ $[15] !== w ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[15] = w, $[16] = t11) : t11 = $[16];
735
+ let t12;
736
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css._arrowStroke(), $[17] = t12) : t12 = $[17];
737
+ let t13;
738
+ $[18] !== strokePath ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[18] = strokePath, $[19] = t13) : t13 = $[19];
739
+ let t14;
740
+ $[20] === Symbol.for("react.memo_cache_sentinel") ? (t14 = css._arrowShape(), $[20] = t14) : t14 = $[20];
741
+ let t15;
742
+ $[21] !== fillPath ? (t15 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t14, d: fillPath }), $[21] = fillPath, $[22] = t15) : t15 = $[22];
743
+ let t16;
744
+ $[23] !== t11 || $[24] !== t13 || $[25] !== t15 || $[26] !== t9 || $[27] !== w ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
745
+ t11,
746
+ t13,
747
+ t15
748
+ ] }), $[23] = t11, $[24] = t13, $[25] = t15, $[26] = t9, $[27] = w, $[28] = t16) : t16 = $[28];
749
+ let t17;
750
+ return $[29] !== Element || $[30] !== rest || $[31] !== t16 || $[32] !== t7 ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(Element, { ...rest, className: t4, style: t7, children: t16 }), $[29] = Element, $[30] = rest, $[31] = t16, $[32] = t7, $[33] = t17) : t17 = $[33], t17;
751
+ }
752
+ const DEFAULT_FLEX_ELEMENT = "div";
753
+ function Flex(props) {
754
+ const $ = compilerRuntime.c(14), t0 = props;
755
+ let align, justify, rest, t1, t2, wrap;
756
+ $[0] !== t0 ? ({
757
+ align,
758
+ as: t1,
759
+ direction: t2,
760
+ justify,
761
+ wrap,
762
+ ...rest
763
+ } = t0, $[0] = t0, $[1] = align, $[2] = justify, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = wrap) : (align = $[1], justify = $[2], rest = $[3], t1 = $[4], t2 = $[5], wrap = $[6]);
764
+ const as = t1 === void 0 ? DEFAULT_FLEX_ELEMENT : t1, direction = t2 === void 0 ? "row" : t2;
765
+ let t3;
766
+ return $[7] !== align || $[8] !== as || $[9] !== direction || $[10] !== justify || $[11] !== rest || $[12] !== wrap ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Flex", ...rest, alignItems: align, as, display: "flex", flexDirection: direction, flexWrap: wrap, justifyContent: justify }), $[7] = align, $[8] = as, $[9] = direction, $[10] = justify, $[11] = rest, $[12] = wrap, $[13] = t3) : t3 = $[13], t3;
767
+ }
768
+ const DEFAULT_CARD_ELEMENT = "div";
769
+ function Card(props) {
770
+ const $ = compilerRuntime.c(38), t0 = props;
771
+ let className, disabled, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
772
+ $[0] !== t0 ? ({
773
+ __unstable_checkered: t1,
774
+ __unstable_focusRing: t2,
775
+ as: t3,
776
+ className,
777
+ disabled,
778
+ pressed,
779
+ radius: t4,
780
+ scheme: schemeProp,
781
+ selected,
782
+ style,
783
+ tone: t5,
784
+ ...rest
785
+ } = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = pressed, $[4] = rest, $[5] = schemeProp, $[6] = selected, $[7] = style, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5) : (className = $[1], disabled = $[2], pressed = $[3], rest = $[4], schemeProp = $[5], selected = $[6], style = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12]);
786
+ const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = useCard(), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
787
+ let t7;
788
+ $[13] !== className || $[14] !== t6 || $[15] !== tone ? (t7 = css.card({
789
+ className,
790
+ scheme: t6,
791
+ tone
792
+ }), $[13] = className, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16];
793
+ const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
794
+ let t13;
795
+ $[17] !== as || $[18] !== radius || $[19] !== rest || $[20] !== style || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[17] = as, $[18] = radius, $[19] = rest, $[20] = style, $[21] = t10, $[22] = t11, $[23] = t12, $[24] = t7, $[25] = t8, $[26] = t9, $[27] = t13) : t13 = $[27];
796
+ let node = t13;
797
+ if (scheme === parent?.scheme && tone === parent?.tone)
798
+ return node;
799
+ const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
800
+ let t17;
801
+ if ($[28] !== node || $[29] !== t14 || $[30] !== t15 || $[31] !== t16 ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[28] = node, $[29] = t14, $[30] = t15, $[31] = t16, $[32] = t17) : t17 = $[32], node = t17, parent?.unstable_CompatProvider) {
802
+ const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent?.tone ?? "default";
803
+ let t20;
804
+ return $[33] !== CompatProvider || $[34] !== node || $[35] !== t18 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[33] = CompatProvider, $[34] = node, $[35] = t18, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
805
+ }
806
+ return node;
807
+ }
691
808
  const DEFAULT_LAYER_CARD_ELEMENT = "div";
692
809
  function LayerCard(props) {
693
810
  const $ = compilerRuntime.c(27), t0 = props;
@@ -805,13 +922,13 @@ function LayerProvider(props) {
805
922
  [childLevel]: prevLen + 1
806
923
  };
807
924
  return setSize(Object.keys(nextState).length), nextState;
808
- }) : setSize(_temp$3), () => {
925
+ }) : setSize(_temp$4), () => {
809
926
  childLevel !== void 0 ? setChildLayers((state_0) => {
810
927
  const nextState_0 = {
811
928
  ...state_0
812
929
  };
813
930
  return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
814
- }) : setSize(_temp2$1), parentDispose?.();
931
+ }) : setSize(_temp2$2), parentDispose?.();
815
932
  };
816
933
  }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
817
934
  const registerChild = t3;
@@ -830,10 +947,10 @@ function LayerProvider(props) {
830
947
  let t8;
831
948
  return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
832
949
  }
833
- function _temp2$1(v_0) {
950
+ function _temp2$2(v_0) {
834
951
  return v_0 - 1;
835
952
  }
836
- function _temp$3(v) {
953
+ function _temp$4(v) {
837
954
  return v + 1;
838
955
  }
839
956
  const DEFAULT_LAYER_ELEMENT = "div";
@@ -852,184 +969,6 @@ function Layer(props) {
852
969
  let t4;
853
970
  return $[9] !== t3 || $[10] !== zOffset ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: t3 }), $[9] = t3, $[10] = zOffset, $[11] = t4) : t4 = $[11], t4;
854
971
  }
855
- const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
856
- top: ["bottom", "left", "right"],
857
- "top-start": ["bottom-start", "left-start", "right-start"],
858
- "top-end": ["bottom-end", "left-end", "right-end"],
859
- bottom: ["top", "left", "right"],
860
- "bottom-start": ["top-start", "left-start", "right-start"],
861
- "bottom-end": ["top-end", "left-end", "right-end"],
862
- left: ["right", "top", "bottom"],
863
- "left-start": ["right-start", "top-start", "bottom-start"],
864
- "left-end": ["right-end", "top-end", "bottom-end"],
865
- right: ["left", "top", "bottom"],
866
- "right-start": ["left-start", "top-start", "bottom-start"],
867
- "right-end": ["left-end", "top-end", "bottom-end"]
868
- };
869
- function size(options) {
870
- const {
871
- apply,
872
- margins,
873
- padding = 0
874
- } = options;
875
- return {
876
- name: "@sanity/ui/size",
877
- async fn(args) {
878
- const {
879
- elements,
880
- placement,
881
- platform,
882
- rects
883
- } = args, {
884
- floating,
885
- reference
886
- } = rects, overflow = await reactDom$1.detectOverflow(args, {
887
- altBoundary: !0,
888
- boundary: options.boundaryElement || void 0,
889
- elementContext: "floating",
890
- padding,
891
- rootBoundary: "viewport"
892
- });
893
- let maxWidth = 1 / 0, maxHeight = 1 / 0;
894
- const floatingW = floating.width, floatingH = floating.height;
895
- placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom)), apply({
896
- availableWidth: maxWidth - margins[1] - margins[3],
897
- availableHeight: maxHeight - margins[0] - margins[2],
898
- elements,
899
- referenceWidth: reference.width - margins[1] - margins[3]
900
- });
901
- const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
902
- return floatingW !== targetW || floatingH !== targetH ? {
903
- reset: {
904
- rects: !0
905
- }
906
- } : {};
907
- }
908
- };
909
- }
910
- function moveTowardsLength(movingPoint, targetPoint, amount) {
911
- const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
912
- return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
913
- }
914
- function moveTowardsFractional(movingPoint, targetPoint, fraction) {
915
- return {
916
- x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
917
- y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
918
- };
919
- }
920
- function getRoundedCommands(points) {
921
- const len = points.length, cmds = [];
922
- for (let i = 0; i < len; i += 1) {
923
- const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
924
- if (prevPoint && point.radius) {
925
- const curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, 0.5), endControl = moveTowardsFractional(point, curveEnd, 0.5);
926
- cmds.push({
927
- type: "point",
928
- ...curveStart
929
- }), cmds.push({
930
- type: "curve",
931
- curveEnd,
932
- startControl,
933
- endControl
934
- });
935
- } else
936
- cmds.push({
937
- type: "point",
938
- ...point
939
- });
940
- }
941
- return cmds;
942
- }
943
- function compileCommands(cmds) {
944
- return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
945
- }
946
- const DEFAULT_ARROW_ELEMENT = "div";
947
- function Arrow(props) {
948
- const $ = compilerRuntime.c(34), t0 = props;
949
- let h, rest, style, t1, t2, w;
950
- $[0] !== t0 ? ({
951
- as: t1,
952
- width: w,
953
- height: h,
954
- radius: t2,
955
- style,
956
- ...rest
957
- } = t0, $[0] = t0, $[1] = h, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = w) : (h = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], w = $[6]);
958
- const Element = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
959
- let t3;
960
- const points = [{
961
- x: 0,
962
- y: 0
963
- }, {
964
- x: radius,
965
- y: 0,
966
- radius
967
- }, {
968
- x: center,
969
- y: h - 1,
970
- radius
971
- }, {
972
- x: w - radius,
973
- y: 0,
974
- radius
975
- }, {
976
- x: w,
977
- y: 0
978
- }], cmds = getRoundedCommands(points);
979
- t3 = compileCommands(cmds);
980
- const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
981
- let t4;
982
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = css._arrow(), $[7] = t4) : t4 = $[7];
983
- const t5 = `${w}px`;
984
- let t6;
985
- $[8] !== t5 ? (t6 = dynamic.assignInlineVars({
986
- [css.vars.arrow.size]: t5
987
- }), $[8] = t5, $[9] = t6) : t6 = $[9];
988
- let t7;
989
- $[10] !== style || $[11] !== t6 ? (t7 = {
990
- ...style,
991
- ...t6
992
- }, $[10] = style, $[11] = t6, $[12] = t7) : t7 = $[12];
993
- let t8;
994
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css._arrowSvg(), $[13] = t8) : t8 = $[13];
995
- const t9 = `0 0 ${w} ${w}`;
996
- let t10;
997
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._arrowStrokeMask(), $[14] = t10) : t10 = $[14];
998
- let t11;
999
- $[15] !== w ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[15] = w, $[16] = t11) : t11 = $[16];
1000
- let t12;
1001
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css._arrowStroke(), $[17] = t12) : t12 = $[17];
1002
- let t13;
1003
- $[18] !== strokePath ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[18] = strokePath, $[19] = t13) : t13 = $[19];
1004
- let t14;
1005
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t14 = css._arrowShape(), $[20] = t14) : t14 = $[20];
1006
- let t15;
1007
- $[21] !== fillPath ? (t15 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t14, d: fillPath }), $[21] = fillPath, $[22] = t15) : t15 = $[22];
1008
- let t16;
1009
- $[23] !== t11 || $[24] !== t13 || $[25] !== t15 || $[26] !== t9 || $[27] !== w ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
1010
- t11,
1011
- t13,
1012
- t15
1013
- ] }), $[23] = t11, $[24] = t13, $[25] = t15, $[26] = t9, $[27] = w, $[28] = t16) : t16 = $[28];
1014
- let t17;
1015
- return $[29] !== Element || $[30] !== rest || $[31] !== t16 || $[32] !== t7 ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(Element, { ...rest, className: t4, style: t7, children: t16 }), $[29] = Element, $[30] = rest, $[31] = t16, $[32] = t7, $[33] = t17) : t17 = $[33], t17;
1016
- }
1017
- const DEFAULT_FLEX_ELEMENT = "div";
1018
- function Flex(props) {
1019
- const $ = compilerRuntime.c(14), t0 = props;
1020
- let align, justify, rest, t1, t2, wrap;
1021
- $[0] !== t0 ? ({
1022
- align,
1023
- as: t1,
1024
- direction: t2,
1025
- justify,
1026
- wrap,
1027
- ...rest
1028
- } = t0, $[0] = t0, $[1] = align, $[2] = justify, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = wrap) : (align = $[1], justify = $[2], rest = $[3], t1 = $[4], t2 = $[5], wrap = $[6]);
1029
- const as = t1 === void 0 ? DEFAULT_FLEX_ELEMENT : t1, direction = t2 === void 0 ? "row" : t2;
1030
- let t3;
1031
- return $[7] !== align || $[8] !== as || $[9] !== direction || $[10] !== justify || $[11] !== rest || $[12] !== wrap ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Flex", ...rest, alignItems: align, as, display: "flex", flexDirection: direction, flexWrap: wrap, justifyContent: justify }), $[7] = align, $[8] = as, $[9] = direction, $[10] = justify, $[11] = rest, $[12] = wrap, $[13] = t3) : t3 = $[13], t3;
1032
- }
1033
972
  function PopoverLayer(props) {
1034
973
  const $ = compilerRuntime.c(65);
1035
974
  let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t0, xProp, yProp;
@@ -1234,6 +1173,29 @@ function getElementRef$1(element) {
1234
1173
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1235
1174
  return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
1236
1175
  }
1176
+ const DEFAULT_SELECTABLE_ELEMENT = "button";
1177
+ function Selectable(props) {
1178
+ const $ = compilerRuntime.c(16), t0 = props;
1179
+ let className, radius, rest, selected, t1, tone;
1180
+ $[0] !== t0 ? ({
1181
+ as: t1,
1182
+ className,
1183
+ radius,
1184
+ selected,
1185
+ tone,
1186
+ ...rest
1187
+ } = t0, $[0] = t0, $[1] = className, $[2] = radius, $[3] = rest, $[4] = selected, $[5] = t1, $[6] = tone) : (className = $[1], radius = $[2], rest = $[3], selected = $[4], t1 = $[5], tone = $[6]);
1188
+ const as = t1 === void 0 ? DEFAULT_SELECTABLE_ELEMENT : t1;
1189
+ let t2;
1190
+ $[7] !== className || $[8] !== radius || $[9] !== tone ? (t2 = css._selectable({
1191
+ className,
1192
+ radius,
1193
+ tone
1194
+ }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
1195
+ const t3 = selected ? "" : void 0;
1196
+ let t4;
1197
+ return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
1198
+ }
1237
1199
  const DEFAULT_STACK_ELEMENT = "div";
1238
1200
  function Stack(props) {
1239
1201
  const $ = compilerRuntime.c(13), t0 = props;
@@ -1299,14 +1261,14 @@ function TextInput(props) {
1299
1261
  const Element = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 2 : t6, space = t7 === void 0 ? 3 : t7, type = t8 === void 0 ? "text" : t8, ref = react.useRef(null), responsivePadding = useResponsiveProp(padding), withClearButton = !!clearButton;
1300
1262
  let t9;
1301
1263
  $[23] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[23] = t9) : t9 = $[23], react.useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
1302
- const handleClearMouseDown = _temp$2;
1264
+ const handleClearMouseDown = _temp$3;
1303
1265
  let t10;
1304
1266
  $[24] !== onClear ? (t10 = (event_0) => {
1305
1267
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
1306
1268
  }, $[24] = onClear, $[25] = t10) : t10 = $[25];
1307
1269
  const handleClearClick = t10;
1308
1270
  let t11, t12;
1309
- $[26] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2)), $[26] = responsivePadding, $[27] = t12) : t12 = $[27], t11 = t12;
1271
+ $[26] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2$1)), $[26] = responsivePadding, $[27] = t12) : t12 = $[27], t11 = t12;
1310
1272
  const clearButtonBoxPadding = t11;
1311
1273
  let t13, t14;
1312
1274
  $[28] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[28] = responsivePadding, $[29] = t14) : t14 = $[29], t13 = t14;
@@ -1374,15 +1336,15 @@ function _temp3(t0) {
1374
1336
  const [key_0, value_0] = t0;
1375
1337
  return value_0 === 0 ? [key_0, 0] : value_0 === 1 ? [key_0, 0] : value_0 === 2 ? [key_0, 1] : [key_0, typeof value_0 == "number" ? value_0 - 1 : 0];
1376
1338
  }
1377
- function _temp2(t0) {
1339
+ function _temp2$1(t0) {
1378
1340
  const [key2, value] = t0;
1379
1341
  return value === 0 ? [key2, 0] : value === 1 ? [key2, 1] : value === 2 ? [key2, 1] : [key2, typeof value == "number" ? value - 2 : 0];
1380
1342
  }
1381
- function _temp$2(event) {
1343
+ function _temp$3(event) {
1382
1344
  event.preventDefault(), event.stopPropagation();
1383
1345
  }
1384
1346
  function useClickOutsideEvent(listener, t0, boundaryElement) {
1385
- const $ = compilerRuntime.c(9), elementsArg = t0 === void 0 ? _temp$1 : t0;
1347
+ const $ = compilerRuntime.c(9), elementsArg = t0 === void 0 ? _temp$2 : t0;
1386
1348
  let t1;
1387
1349
  $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1388
1350
  if (!listener)
@@ -1412,7 +1374,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
1412
1374
  let t3;
1413
1375
  $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], react.useEffect(t2, t3), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1414
1376
  }
1415
- function _temp$1() {
1377
+ function _temp$2() {
1416
1378
  return EMPTY_ARRAY;
1417
1379
  }
1418
1380
  function useGlobalKeyDown(onKeyDown) {
@@ -1442,14 +1404,14 @@ function KBD(props) {
1442
1404
  radius: t5,
1443
1405
  ...rest
1444
1406
  } = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5) : (children = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8]);
1445
- const as = t1 === void 0 ? DEFAULT_KBD_ELEMENT : t1, display = t2 === void 0 ? "inline-block" : t2, fontSize = t3 === void 0 ? 0 : t3, padding = t4 === void 0 ? 1 : t4, radius = t5 === void 0 ? 2 : t5, t6 = as;
1407
+ const as = t1 === void 0 ? DEFAULT_KBD_ELEMENT : t1, display = t2 === void 0 ? "inline-block" : t2, fontSize = t3 === void 0 ? 1 : t3, padding = t4 === void 0 ? 1 : t4, radius = t5 === void 0 ? 2 : t5, t6 = as;
1446
1408
  let t7;
1447
1409
  $[9] !== className || $[10] !== radius ? (t7 = css.kbd({
1448
1410
  className,
1449
1411
  radius
1450
1412
  }), $[9] = className, $[10] = radius, $[11] = t7) : t7 = $[11];
1451
1413
  let t8;
1452
- $[12] !== children || $[13] !== fontSize ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", muted: !0, size: fontSize, weight: "semibold", children }), $[12] = children, $[13] = fontSize, $[14] = t8) : t8 = $[14];
1414
+ $[12] !== children || $[13] !== fontSize ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", muted: !0, size: fontSize, weight: "medium", children }), $[12] = children, $[13] = fontSize, $[14] = t8) : t8 = $[14];
1453
1415
  let t9;
1454
1416
  return $[15] !== display || $[16] !== padding || $[17] !== rest || $[18] !== t6 || $[19] !== t7 || $[20] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "KBD", ...rest, as: t6, className: t7, display, muted: !0, padding, children: t8 }), $[15] = display, $[16] = padding, $[17] = rest, $[18] = t6, $[19] = t7, $[20] = t8, $[21] = t9) : t9 = $[21], t9;
1455
1417
  }
@@ -2019,11 +1981,49 @@ function Grid(props) {
2019
1981
  return $[4] !== as || $[5] !== children || $[6] !== rest ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "Grid", ...rest, as, display: "grid", children }), $[4] = as, $[5] = children, $[6] = rest, $[7] = t2) : t2 = $[7], t2;
2020
1982
  }
2021
1983
  function usePrefersDark(t0) {
2022
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp : t0);
1984
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$1 : t0);
2023
1985
  }
2024
- function _temp() {
1986
+ function _temp$1() {
2025
1987
  return !1;
2026
1988
  }
1989
+ function PortalProvider(props) {
1990
+ const $ = compilerRuntime.c(7), {
1991
+ boundaryElement,
1992
+ children,
1993
+ element,
1994
+ __unstable_elements: elementsProp
1995
+ } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp, _temp2);
1996
+ let t0;
1997
+ const t1 = boundaryElement || null, t2 = element || fallbackElement;
1998
+ let t3;
1999
+ $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
2000
+ version: 0,
2001
+ boundaryElement: t1,
2002
+ element: t2,
2003
+ elements
2004
+ }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
2005
+ const value = t0;
2006
+ let t4;
2007
+ return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
2008
+ }
2009
+ function _temp2() {
2010
+ return null;
2011
+ }
2012
+ function _temp() {
2013
+ return document.body;
2014
+ }
2015
+ const emptySubscribe = () => () => {
2016
+ };
2017
+ function useUnique(value) {
2018
+ const valueRef = react.useRef(value);
2019
+ return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
2020
+ }
2021
+ function _isEqual(objA, objB) {
2022
+ if (!objA || !objB)
2023
+ return objA === objB;
2024
+ const keysA = Object.keys(objA), keysB = Object.keys(objB);
2025
+ return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
2026
+ }
2027
2027
  function useDelayedState(initialState) {
2028
2028
  const $ = compilerRuntime.c(3), [state, setState] = react.useState(initialState), delayedAction = react.useRef(void 0);
2029
2029
  let t0;