@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
@@ -3,7 +3,7 @@ import { c } from "react/compiler-runtime";
3
3
  import { getScopedTheme, getTheme_v2 } from "@sanity/ui/theme";
4
4
  import { createContext, useContext, useState, isValidElement, useDebugValue, useSyncExternalStore, useRef, useImperativeHandle, useEffect, useMemo, useCallback, cloneElement, Children, useId, useLayoutEffect } from "react";
5
5
  import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from "styled-components";
6
- import { box, _selectable, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, card, BREAKPOINTS, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, popoverCard, popover, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, kbd, menu, menuDivider, tooltip } from "@sanity/ui/css";
6
+ import { box, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, card, BREAKPOINTS, popoverCard, popover, _selectable, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, kbd, menu, menuDivider, tooltip } from "@sanity/ui/css";
7
7
  import { useEffectEvent } from "use-effect-event";
8
8
  import { SpinnerIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
9
9
  import { isValidElementType } from "react-is";
@@ -340,29 +340,6 @@ function Box(props) {
340
340
  let t10;
341
341
  return $[149] !== Element || $[150] !== children || $[151] !== rest || $[152] !== t9 ? (t10 = /* @__PURE__ */ jsx(Element, { "data-ui": "Box", ...rest, className: t9, children }), $[149] = Element, $[150] = children, $[151] = rest, $[152] = t9, $[153] = t10) : t10 = $[153], t10;
342
342
  }
343
- const DEFAULT_SELECTABLE_ELEMENT = "button";
344
- function Selectable(props) {
345
- const $ = c(16), t0 = props;
346
- let className, radius, rest, selected, t1, tone;
347
- $[0] !== t0 ? ({
348
- as: t1,
349
- className,
350
- radius,
351
- selected,
352
- tone,
353
- ...rest
354
- } = 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]);
355
- const as = t1 === void 0 ? DEFAULT_SELECTABLE_ELEMENT : t1;
356
- let t2;
357
- $[7] !== className || $[8] !== radius || $[9] !== tone ? (t2 = _selectable({
358
- className,
359
- radius,
360
- tone
361
- }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
362
- const t3 = selected ? "" : void 0;
363
- let t4;
364
- return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
365
- }
366
343
  const DEFAULT_TEXT_ELEMENT = "div";
367
344
  function Text(props) {
368
345
  const $ = c(32), t0 = props;
@@ -569,46 +546,6 @@ function useBoundaryElement() {
569
546
  function useCard() {
570
547
  return useContext(CardContext);
571
548
  }
572
- const DEFAULT_CARD_ELEMENT = "div";
573
- function Card(props) {
574
- const $ = c(38), t0 = props;
575
- let className, disabled, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
576
- $[0] !== t0 ? ({
577
- __unstable_checkered: t1,
578
- __unstable_focusRing: t2,
579
- as: t3,
580
- className,
581
- disabled,
582
- pressed,
583
- radius: t4,
584
- scheme: schemeProp,
585
- selected,
586
- style,
587
- tone: t5,
588
- ...rest
589
- } = 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]);
590
- 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;
591
- let t7;
592
- $[13] !== className || $[14] !== t6 || $[15] !== tone ? (t7 = card({
593
- className,
594
- scheme: t6,
595
- tone
596
- }), $[13] = className, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16];
597
- const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
598
- let t13;
599
- $[17] !== as || $[18] !== radius || $[19] !== rest || $[20] !== style || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t13 = /* @__PURE__ */ 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];
600
- let node = t13;
601
- if (scheme === parent?.scheme && tone === parent?.tone)
602
- return node;
603
- const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
604
- let t17;
605
- if ($[28] !== node || $[29] !== t14 || $[30] !== t15 || $[31] !== t16 ? (t17 = /* @__PURE__ */ 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) {
606
- const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent?.tone ?? "default";
607
- let t20;
608
- return $[33] !== CompatProvider || $[34] !== node || $[35] !== t18 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[33] = CompatProvider, $[34] = node, $[35] = t18, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
609
- }
610
- return node;
611
- }
612
549
  const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
613
550
  globalScope[elementKey] = null;
614
551
  const defaultContextValue = {
@@ -639,44 +576,6 @@ function Portal(props) {
639
576
  let t2;
640
577
  return $[3] !== portalElement || $[4] !== t1 ? (t2 = createPortal(t1, portalElement), $[3] = portalElement, $[4] = t1, $[5] = t2) : t2 = $[5], t2;
641
578
  }
642
- function PortalProvider(props) {
643
- const $ = c(7), {
644
- boundaryElement,
645
- children,
646
- element,
647
- __unstable_elements: elementsProp
648
- } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
649
- let t0;
650
- const t1 = boundaryElement || null, t2 = element || fallbackElement;
651
- let t3;
652
- $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
653
- version: 0,
654
- boundaryElement: t1,
655
- element: t2,
656
- elements
657
- }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
658
- const value = t0;
659
- let t4;
660
- return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
661
- }
662
- function _temp2$2() {
663
- return null;
664
- }
665
- function _temp$4() {
666
- return document.body;
667
- }
668
- const emptySubscribe = () => () => {
669
- };
670
- function useUnique(value) {
671
- const valueRef = useRef(value);
672
- return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
673
- }
674
- function _isEqual(objA, objB) {
675
- if (!objA || !objB)
676
- return objA === objB;
677
- const keysA = Object.keys(objA), keysB = Object.keys(objB);
678
- return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
679
- }
680
579
  function getLayerContext(contextValue) {
681
580
  if (!isRecord(contextValue) || contextValue.version !== 0)
682
581
  throw new Error("the context value is not compatible");
@@ -699,6 +598,224 @@ function useLayer() {
699
598
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
700
599
  }
701
600
  }
601
+ 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 = {
602
+ top: ["bottom", "left", "right"],
603
+ "top-start": ["bottom-start", "left-start", "right-start"],
604
+ "top-end": ["bottom-end", "left-end", "right-end"],
605
+ bottom: ["top", "left", "right"],
606
+ "bottom-start": ["top-start", "left-start", "right-start"],
607
+ "bottom-end": ["top-end", "left-end", "right-end"],
608
+ left: ["right", "top", "bottom"],
609
+ "left-start": ["right-start", "top-start", "bottom-start"],
610
+ "left-end": ["right-end", "top-end", "bottom-end"],
611
+ right: ["left", "top", "bottom"],
612
+ "right-start": ["left-start", "top-start", "bottom-start"],
613
+ "right-end": ["left-end", "top-end", "bottom-end"]
614
+ };
615
+ function size(options) {
616
+ const {
617
+ apply,
618
+ margins,
619
+ padding = 0
620
+ } = options;
621
+ return {
622
+ name: "@sanity/ui/size",
623
+ async fn(args) {
624
+ const {
625
+ elements,
626
+ placement,
627
+ platform,
628
+ rects
629
+ } = args, {
630
+ floating,
631
+ reference
632
+ } = rects, overflow = await detectOverflow(args, {
633
+ altBoundary: !0,
634
+ boundary: options.boundaryElement || void 0,
635
+ elementContext: "floating",
636
+ padding,
637
+ rootBoundary: "viewport"
638
+ });
639
+ let maxWidth = 1 / 0, maxHeight = 1 / 0;
640
+ const floatingW = floating.width, floatingH = floating.height;
641
+ 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({
642
+ availableWidth: maxWidth - margins[1] - margins[3],
643
+ availableHeight: maxHeight - margins[0] - margins[2],
644
+ elements,
645
+ referenceWidth: reference.width - margins[1] - margins[3]
646
+ });
647
+ const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
648
+ return floatingW !== targetW || floatingH !== targetH ? {
649
+ reset: {
650
+ rects: !0
651
+ }
652
+ } : {};
653
+ }
654
+ };
655
+ }
656
+ function moveTowardsLength(movingPoint, targetPoint, amount) {
657
+ const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
658
+ return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
659
+ }
660
+ function moveTowardsFractional(movingPoint, targetPoint, fraction) {
661
+ return {
662
+ x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
663
+ y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
664
+ };
665
+ }
666
+ function getRoundedCommands(points) {
667
+ const len = points.length, cmds = [];
668
+ for (let i = 0; i < len; i += 1) {
669
+ const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
670
+ if (prevPoint && point.radius) {
671
+ 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);
672
+ cmds.push({
673
+ type: "point",
674
+ ...curveStart
675
+ }), cmds.push({
676
+ type: "curve",
677
+ curveEnd,
678
+ startControl,
679
+ endControl
680
+ });
681
+ } else
682
+ cmds.push({
683
+ type: "point",
684
+ ...point
685
+ });
686
+ }
687
+ return cmds;
688
+ }
689
+ function compileCommands(cmds) {
690
+ 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(" ");
691
+ }
692
+ const DEFAULT_ARROW_ELEMENT = "div";
693
+ function Arrow(props) {
694
+ const $ = c(34), t0 = props;
695
+ let h, rest, style, t1, t2, w;
696
+ $[0] !== t0 ? ({
697
+ as: t1,
698
+ width: w,
699
+ height: h,
700
+ radius: t2,
701
+ style,
702
+ ...rest
703
+ } = 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]);
704
+ const Element = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
705
+ let t3;
706
+ const points = [{
707
+ x: 0,
708
+ y: 0
709
+ }, {
710
+ x: radius,
711
+ y: 0,
712
+ radius
713
+ }, {
714
+ x: center,
715
+ y: h - 1,
716
+ radius
717
+ }, {
718
+ x: w - radius,
719
+ y: 0,
720
+ radius
721
+ }, {
722
+ x: w,
723
+ y: 0
724
+ }], cmds = getRoundedCommands(points);
725
+ t3 = compileCommands(cmds);
726
+ const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
727
+ let t4;
728
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = _arrow(), $[7] = t4) : t4 = $[7];
729
+ const t5 = `${w}px`;
730
+ let t6;
731
+ $[8] !== t5 ? (t6 = assignInlineVars({
732
+ [vars.arrow.size]: t5
733
+ }), $[8] = t5, $[9] = t6) : t6 = $[9];
734
+ let t7;
735
+ $[10] !== style || $[11] !== t6 ? (t7 = {
736
+ ...style,
737
+ ...t6
738
+ }, $[10] = style, $[11] = t6, $[12] = t7) : t7 = $[12];
739
+ let t8;
740
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowSvg(), $[13] = t8) : t8 = $[13];
741
+ const t9 = `0 0 ${w} ${w}`;
742
+ let t10;
743
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _arrowStrokeMask(), $[14] = t10) : t10 = $[14];
744
+ let t11;
745
+ $[15] !== w ? (t11 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[15] = w, $[16] = t11) : t11 = $[16];
746
+ let t12;
747
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _arrowStroke(), $[17] = t12) : t12 = $[17];
748
+ let t13;
749
+ $[18] !== strokePath ? (t13 = /* @__PURE__ */ jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[18] = strokePath, $[19] = t13) : t13 = $[19];
750
+ let t14;
751
+ $[20] === Symbol.for("react.memo_cache_sentinel") ? (t14 = _arrowShape(), $[20] = t14) : t14 = $[20];
752
+ let t15;
753
+ $[21] !== fillPath ? (t15 = /* @__PURE__ */ jsx("path", { className: t14, d: fillPath }), $[21] = fillPath, $[22] = t15) : t15 = $[22];
754
+ let t16;
755
+ $[23] !== t11 || $[24] !== t13 || $[25] !== t15 || $[26] !== t9 || $[27] !== w ? (t16 = /* @__PURE__ */ jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
756
+ t11,
757
+ t13,
758
+ t15
759
+ ] }), $[23] = t11, $[24] = t13, $[25] = t15, $[26] = t9, $[27] = w, $[28] = t16) : t16 = $[28];
760
+ let t17;
761
+ return $[29] !== Element || $[30] !== rest || $[31] !== t16 || $[32] !== t7 ? (t17 = /* @__PURE__ */ jsx(Element, { ...rest, className: t4, style: t7, children: t16 }), $[29] = Element, $[30] = rest, $[31] = t16, $[32] = t7, $[33] = t17) : t17 = $[33], t17;
762
+ }
763
+ const DEFAULT_FLEX_ELEMENT = "div";
764
+ function Flex(props) {
765
+ const $ = c(14), t0 = props;
766
+ let align, justify, rest, t1, t2, wrap;
767
+ $[0] !== t0 ? ({
768
+ align,
769
+ as: t1,
770
+ direction: t2,
771
+ justify,
772
+ wrap,
773
+ ...rest
774
+ } = 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]);
775
+ const as = t1 === void 0 ? DEFAULT_FLEX_ELEMENT : t1, direction = t2 === void 0 ? "row" : t2;
776
+ let t3;
777
+ return $[7] !== align || $[8] !== as || $[9] !== direction || $[10] !== justify || $[11] !== rest || $[12] !== wrap ? (t3 = /* @__PURE__ */ 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;
778
+ }
779
+ const DEFAULT_CARD_ELEMENT = "div";
780
+ function Card(props) {
781
+ const $ = c(38), t0 = props;
782
+ let className, disabled, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
783
+ $[0] !== t0 ? ({
784
+ __unstable_checkered: t1,
785
+ __unstable_focusRing: t2,
786
+ as: t3,
787
+ className,
788
+ disabled,
789
+ pressed,
790
+ radius: t4,
791
+ scheme: schemeProp,
792
+ selected,
793
+ style,
794
+ tone: t5,
795
+ ...rest
796
+ } = 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]);
797
+ 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;
798
+ let t7;
799
+ $[13] !== className || $[14] !== t6 || $[15] !== tone ? (t7 = card({
800
+ className,
801
+ scheme: t6,
802
+ tone
803
+ }), $[13] = className, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16];
804
+ const t8 = checkered ? "" : void 0, t9 = disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
805
+ let t13;
806
+ $[17] !== as || $[18] !== radius || $[19] !== rest || $[20] !== style || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t13 = /* @__PURE__ */ 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];
807
+ let node = t13;
808
+ if (scheme === parent?.scheme && tone === parent?.tone)
809
+ return node;
810
+ const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
811
+ let t17;
812
+ if ($[28] !== node || $[29] !== t14 || $[30] !== t15 || $[31] !== t16 ? (t17 = /* @__PURE__ */ 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) {
813
+ const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent?.tone ?? "default";
814
+ let t20;
815
+ return $[33] !== CompatProvider || $[34] !== node || $[35] !== t18 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[33] = CompatProvider, $[34] = node, $[35] = t18, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
816
+ }
817
+ return node;
818
+ }
702
819
  const DEFAULT_LAYER_CARD_ELEMENT = "div";
703
820
  function LayerCard(props) {
704
821
  const $ = c(27), t0 = props;
@@ -816,13 +933,13 @@ function LayerProvider(props) {
816
933
  [childLevel]: prevLen + 1
817
934
  };
818
935
  return setSize(Object.keys(nextState).length), nextState;
819
- }) : setSize(_temp$3), () => {
936
+ }) : setSize(_temp$4), () => {
820
937
  childLevel !== void 0 ? setChildLayers((state_0) => {
821
938
  const nextState_0 = {
822
939
  ...state_0
823
940
  };
824
941
  return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
825
- }) : setSize(_temp2$1), parentDispose?.();
942
+ }) : setSize(_temp2$2), parentDispose?.();
826
943
  };
827
944
  }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
828
945
  const registerChild = t3;
@@ -841,10 +958,10 @@ function LayerProvider(props) {
841
958
  let t8;
842
959
  return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
843
960
  }
844
- function _temp2$1(v_0) {
961
+ function _temp2$2(v_0) {
845
962
  return v_0 - 1;
846
963
  }
847
- function _temp$3(v) {
964
+ function _temp$4(v) {
848
965
  return v + 1;
849
966
  }
850
967
  const DEFAULT_LAYER_ELEMENT = "div";
@@ -863,184 +980,6 @@ function Layer(props) {
863
980
  let t4;
864
981
  return $[9] !== t3 || $[10] !== zOffset ? (t4 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t3 }), $[9] = t3, $[10] = zOffset, $[11] = t4) : t4 = $[11], t4;
865
982
  }
866
- 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 = {
867
- top: ["bottom", "left", "right"],
868
- "top-start": ["bottom-start", "left-start", "right-start"],
869
- "top-end": ["bottom-end", "left-end", "right-end"],
870
- bottom: ["top", "left", "right"],
871
- "bottom-start": ["top-start", "left-start", "right-start"],
872
- "bottom-end": ["top-end", "left-end", "right-end"],
873
- left: ["right", "top", "bottom"],
874
- "left-start": ["right-start", "top-start", "bottom-start"],
875
- "left-end": ["right-end", "top-end", "bottom-end"],
876
- right: ["left", "top", "bottom"],
877
- "right-start": ["left-start", "top-start", "bottom-start"],
878
- "right-end": ["left-end", "top-end", "bottom-end"]
879
- };
880
- function size(options) {
881
- const {
882
- apply,
883
- margins,
884
- padding = 0
885
- } = options;
886
- return {
887
- name: "@sanity/ui/size",
888
- async fn(args) {
889
- const {
890
- elements,
891
- placement,
892
- platform,
893
- rects
894
- } = args, {
895
- floating,
896
- reference
897
- } = rects, overflow = await detectOverflow(args, {
898
- altBoundary: !0,
899
- boundary: options.boundaryElement || void 0,
900
- elementContext: "floating",
901
- padding,
902
- rootBoundary: "viewport"
903
- });
904
- let maxWidth = 1 / 0, maxHeight = 1 / 0;
905
- const floatingW = floating.width, floatingH = floating.height;
906
- 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({
907
- availableWidth: maxWidth - margins[1] - margins[3],
908
- availableHeight: maxHeight - margins[0] - margins[2],
909
- elements,
910
- referenceWidth: reference.width - margins[1] - margins[3]
911
- });
912
- const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
913
- return floatingW !== targetW || floatingH !== targetH ? {
914
- reset: {
915
- rects: !0
916
- }
917
- } : {};
918
- }
919
- };
920
- }
921
- function moveTowardsLength(movingPoint, targetPoint, amount) {
922
- const width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
923
- return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
924
- }
925
- function moveTowardsFractional(movingPoint, targetPoint, fraction) {
926
- return {
927
- x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
928
- y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
929
- };
930
- }
931
- function getRoundedCommands(points) {
932
- const len = points.length, cmds = [];
933
- for (let i = 0; i < len; i += 1) {
934
- const point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
935
- if (prevPoint && point.radius) {
936
- 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);
937
- cmds.push({
938
- type: "point",
939
- ...curveStart
940
- }), cmds.push({
941
- type: "curve",
942
- curveEnd,
943
- startControl,
944
- endControl
945
- });
946
- } else
947
- cmds.push({
948
- type: "point",
949
- ...point
950
- });
951
- }
952
- return cmds;
953
- }
954
- function compileCommands(cmds) {
955
- 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(" ");
956
- }
957
- const DEFAULT_ARROW_ELEMENT = "div";
958
- function Arrow(props) {
959
- const $ = c(34), t0 = props;
960
- let h, rest, style, t1, t2, w;
961
- $[0] !== t0 ? ({
962
- as: t1,
963
- width: w,
964
- height: h,
965
- radius: t2,
966
- style,
967
- ...rest
968
- } = 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]);
969
- const Element = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
970
- let t3;
971
- const points = [{
972
- x: 0,
973
- y: 0
974
- }, {
975
- x: radius,
976
- y: 0,
977
- radius
978
- }, {
979
- x: center,
980
- y: h - 1,
981
- radius
982
- }, {
983
- x: w - radius,
984
- y: 0,
985
- radius
986
- }, {
987
- x: w,
988
- y: 0
989
- }], cmds = getRoundedCommands(points);
990
- t3 = compileCommands(cmds);
991
- const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
992
- let t4;
993
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = _arrow(), $[7] = t4) : t4 = $[7];
994
- const t5 = `${w}px`;
995
- let t6;
996
- $[8] !== t5 ? (t6 = assignInlineVars({
997
- [vars.arrow.size]: t5
998
- }), $[8] = t5, $[9] = t6) : t6 = $[9];
999
- let t7;
1000
- $[10] !== style || $[11] !== t6 ? (t7 = {
1001
- ...style,
1002
- ...t6
1003
- }, $[10] = style, $[11] = t6, $[12] = t7) : t7 = $[12];
1004
- let t8;
1005
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowSvg(), $[13] = t8) : t8 = $[13];
1006
- const t9 = `0 0 ${w} ${w}`;
1007
- let t10;
1008
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _arrowStrokeMask(), $[14] = t10) : t10 = $[14];
1009
- let t11;
1010
- $[15] !== w ? (t11 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[15] = w, $[16] = t11) : t11 = $[16];
1011
- let t12;
1012
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _arrowStroke(), $[17] = t12) : t12 = $[17];
1013
- let t13;
1014
- $[18] !== strokePath ? (t13 = /* @__PURE__ */ jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[18] = strokePath, $[19] = t13) : t13 = $[19];
1015
- let t14;
1016
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t14 = _arrowShape(), $[20] = t14) : t14 = $[20];
1017
- let t15;
1018
- $[21] !== fillPath ? (t15 = /* @__PURE__ */ jsx("path", { className: t14, d: fillPath }), $[21] = fillPath, $[22] = t15) : t15 = $[22];
1019
- let t16;
1020
- $[23] !== t11 || $[24] !== t13 || $[25] !== t15 || $[26] !== t9 || $[27] !== w ? (t16 = /* @__PURE__ */ jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
1021
- t11,
1022
- t13,
1023
- t15
1024
- ] }), $[23] = t11, $[24] = t13, $[25] = t15, $[26] = t9, $[27] = w, $[28] = t16) : t16 = $[28];
1025
- let t17;
1026
- return $[29] !== Element || $[30] !== rest || $[31] !== t16 || $[32] !== t7 ? (t17 = /* @__PURE__ */ jsx(Element, { ...rest, className: t4, style: t7, children: t16 }), $[29] = Element, $[30] = rest, $[31] = t16, $[32] = t7, $[33] = t17) : t17 = $[33], t17;
1027
- }
1028
- const DEFAULT_FLEX_ELEMENT = "div";
1029
- function Flex(props) {
1030
- const $ = c(14), t0 = props;
1031
- let align, justify, rest, t1, t2, wrap;
1032
- $[0] !== t0 ? ({
1033
- align,
1034
- as: t1,
1035
- direction: t2,
1036
- justify,
1037
- wrap,
1038
- ...rest
1039
- } = 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]);
1040
- const as = t1 === void 0 ? DEFAULT_FLEX_ELEMENT : t1, direction = t2 === void 0 ? "row" : t2;
1041
- let t3;
1042
- return $[7] !== align || $[8] !== as || $[9] !== direction || $[10] !== justify || $[11] !== rest || $[12] !== wrap ? (t3 = /* @__PURE__ */ 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;
1043
- }
1044
983
  function PopoverLayer(props) {
1045
984
  const $ = c(65);
1046
985
  let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t0, xProp, yProp;
@@ -1245,6 +1184,29 @@ function getElementRef$1(element) {
1245
1184
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1246
1185
  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);
1247
1186
  }
1187
+ const DEFAULT_SELECTABLE_ELEMENT = "button";
1188
+ function Selectable(props) {
1189
+ const $ = c(16), t0 = props;
1190
+ let className, radius, rest, selected, t1, tone;
1191
+ $[0] !== t0 ? ({
1192
+ as: t1,
1193
+ className,
1194
+ radius,
1195
+ selected,
1196
+ tone,
1197
+ ...rest
1198
+ } = 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]);
1199
+ const as = t1 === void 0 ? DEFAULT_SELECTABLE_ELEMENT : t1;
1200
+ let t2;
1201
+ $[7] !== className || $[8] !== radius || $[9] !== tone ? (t2 = _selectable({
1202
+ className,
1203
+ radius,
1204
+ tone
1205
+ }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
1206
+ const t3 = selected ? "" : void 0;
1207
+ let t4;
1208
+ return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
1209
+ }
1248
1210
  const DEFAULT_STACK_ELEMENT = "div";
1249
1211
  function Stack(props) {
1250
1212
  const $ = c(13), t0 = props;
@@ -1310,14 +1272,14 @@ function TextInput(props) {
1310
1272
  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 = useRef(null), responsivePadding = useResponsiveProp(padding), withClearButton = !!clearButton;
1311
1273
  let t9;
1312
1274
  $[23] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[23] = t9) : t9 = $[23], useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
1313
- const handleClearMouseDown = _temp$2;
1275
+ const handleClearMouseDown = _temp$3;
1314
1276
  let t10;
1315
1277
  $[24] !== onClear ? (t10 = (event_0) => {
1316
1278
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
1317
1279
  }, $[24] = onClear, $[25] = t10) : t10 = $[25];
1318
1280
  const handleClearClick = t10;
1319
1281
  let t11, t12;
1320
- $[26] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2)), $[26] = responsivePadding, $[27] = t12) : t12 = $[27], t11 = t12;
1282
+ $[26] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2$1)), $[26] = responsivePadding, $[27] = t12) : t12 = $[27], t11 = t12;
1321
1283
  const clearButtonBoxPadding = t11;
1322
1284
  let t13, t14;
1323
1285
  $[28] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[28] = responsivePadding, $[29] = t14) : t14 = $[29], t13 = t14;
@@ -1385,15 +1347,15 @@ function _temp3(t0) {
1385
1347
  const [key_0, value_0] = t0;
1386
1348
  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];
1387
1349
  }
1388
- function _temp2(t0) {
1350
+ function _temp2$1(t0) {
1389
1351
  const [key2, value] = t0;
1390
1352
  return value === 0 ? [key2, 0] : value === 1 ? [key2, 1] : value === 2 ? [key2, 1] : [key2, typeof value == "number" ? value - 2 : 0];
1391
1353
  }
1392
- function _temp$2(event) {
1354
+ function _temp$3(event) {
1393
1355
  event.preventDefault(), event.stopPropagation();
1394
1356
  }
1395
1357
  function useClickOutsideEvent(listener, t0, boundaryElement) {
1396
- const $ = c(9), elementsArg = t0 === void 0 ? _temp$1 : t0;
1358
+ const $ = c(9), elementsArg = t0 === void 0 ? _temp$2 : t0;
1397
1359
  let t1;
1398
1360
  $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1399
1361
  if (!listener)
@@ -1423,7 +1385,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
1423
1385
  let t3;
1424
1386
  $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1425
1387
  }
1426
- function _temp$1() {
1388
+ function _temp$2() {
1427
1389
  return EMPTY_ARRAY;
1428
1390
  }
1429
1391
  function useGlobalKeyDown(onKeyDown) {
@@ -1453,14 +1415,14 @@ function KBD(props) {
1453
1415
  radius: t5,
1454
1416
  ...rest
1455
1417
  } = 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]);
1456
- 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;
1418
+ 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;
1457
1419
  let t7;
1458
1420
  $[9] !== className || $[10] !== radius ? (t7 = kbd({
1459
1421
  className,
1460
1422
  radius
1461
1423
  }), $[9] = className, $[10] = radius, $[11] = t7) : t7 = $[11];
1462
1424
  let t8;
1463
- $[12] !== children || $[13] !== fontSize ? (t8 = /* @__PURE__ */ jsx(Text, { as: "span", muted: !0, size: fontSize, weight: "semibold", children }), $[12] = children, $[13] = fontSize, $[14] = t8) : t8 = $[14];
1425
+ $[12] !== children || $[13] !== fontSize ? (t8 = /* @__PURE__ */ jsx(Text, { as: "span", muted: !0, size: fontSize, weight: "medium", children }), $[12] = children, $[13] = fontSize, $[14] = t8) : t8 = $[14];
1464
1426
  let t9;
1465
1427
  return $[15] !== display || $[16] !== padding || $[17] !== rest || $[18] !== t6 || $[19] !== t7 || $[20] !== t8 ? (t9 = /* @__PURE__ */ 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;
1466
1428
  }
@@ -2030,11 +1992,49 @@ function Grid(props) {
2030
1992
  return $[4] !== as || $[5] !== children || $[6] !== rest ? (t2 = /* @__PURE__ */ jsx(Box, { "data-ui": "Grid", ...rest, as, display: "grid", children }), $[4] = as, $[5] = children, $[6] = rest, $[7] = t2) : t2 = $[7], t2;
2031
1993
  }
2032
1994
  function usePrefersDark(t0) {
2033
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp : t0);
1995
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$1 : t0);
2034
1996
  }
2035
- function _temp() {
1997
+ function _temp$1() {
2036
1998
  return !1;
2037
1999
  }
2000
+ function PortalProvider(props) {
2001
+ const $ = c(7), {
2002
+ boundaryElement,
2003
+ children,
2004
+ element,
2005
+ __unstable_elements: elementsProp
2006
+ } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp, _temp2);
2007
+ let t0;
2008
+ const t1 = boundaryElement || null, t2 = element || fallbackElement;
2009
+ let t3;
2010
+ $[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
2011
+ version: 0,
2012
+ boundaryElement: t1,
2013
+ element: t2,
2014
+ elements
2015
+ }, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
2016
+ const value = t0;
2017
+ let t4;
2018
+ return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
2019
+ }
2020
+ function _temp2() {
2021
+ return null;
2022
+ }
2023
+ function _temp() {
2024
+ return document.body;
2025
+ }
2026
+ const emptySubscribe = () => () => {
2027
+ };
2028
+ function useUnique(value) {
2029
+ const valueRef = useRef(value);
2030
+ return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
2031
+ }
2032
+ function _isEqual(objA, objB) {
2033
+ if (!objA || !objB)
2034
+ return objA === objB;
2035
+ const keysA = Object.keys(objA), keysB = Object.keys(objB);
2036
+ return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
2037
+ }
2038
2038
  function useDelayedState(initialState) {
2039
2039
  const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef(void 0);
2040
2040
  let t0;