@sanity/ui 2.8.24-canary.1 → 2.8.24

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.
package/dist/index.js CHANGED
@@ -39,8 +39,8 @@ function _responsive(media, values, callback) {
39
39
  [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
40
40
  });
41
41
  }
42
- function _getArrayProp(val) {
43
- return val === void 0 ? EMPTY_ARRAY : Array.isArray(val) ? val : [val];
42
+ function _getArrayProp(val, defaultVal) {
43
+ return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
44
44
  }
45
45
  function _getResponsiveSpace(theme$1, props, spaceIndexes = EMPTY_ARRAY) {
46
46
  if (!Array.isArray(spaceIndexes))
@@ -147,21 +147,12 @@ function responsiveTextAlignStyle(props) {
147
147
  function responsiveTextFont(props) {
148
148
  return responsiveFont("text", props);
149
149
  }
150
- function useArrayProp(val) {
151
- const $ = reactCompilerRuntime.c(6);
150
+ function useArrayProp(val, defaultVal) {
151
+ const $ = reactCompilerRuntime.c(3);
152
152
  let t0;
153
- $[0] !== val ? (t0 = () => [_getArrayProp(val), JSON.stringify(val)], $[0] = val, $[1] = t0) : t0 = $[1];
154
- const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1;
155
- let result = cachedVal, t2;
156
- $[2] !== val ? (t2 = JSON.stringify(val), $[2] = val, $[3] = t2) : t2 = $[3];
157
- const hash = t2;
158
- if (hash !== cachedHash) {
159
- let t3;
160
- $[4] !== val ? (t3 = _getArrayProp(val), $[4] = val, $[5] = t3) : t3 = $[5];
161
- const current = t3;
162
- setCache([current, hash]), result = current;
163
- }
164
- return result;
153
+ $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
154
+ const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
155
+ return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
165
156
  }
166
157
  function _getElements(element, elementsArg) {
167
158
  const ret = [element];
@@ -211,7 +202,7 @@ function useClickOutside(listener, t0, boundaryElement) {
211
202
  }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
212
203
  }
213
204
  function useClickOutsideEvent(listener, t0, boundaryElement) {
214
- const $ = reactCompilerRuntime.c(8), elementsArg = t0 === void 0 ? _temp$6 : t0;
205
+ const $ = reactCompilerRuntime.c(8), elementsArg = t0 === void 0 ? _temp$b : t0;
215
206
  let t1;
216
207
  $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
217
208
  if (!listener)
@@ -239,7 +230,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
239
230
  };
240
231
  }, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), react.useEffect(t2, t3), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
241
232
  }
242
- function _temp$6() {
233
+ function _temp$b() {
243
234
  return EMPTY_ARRAY;
244
235
  }
245
236
  function useCustomValidity(ref, customValidity) {
@@ -746,15 +737,15 @@ function useMediaIndex() {
746
737
  return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
747
738
  }
748
739
  function usePrefersDark(t0) {
749
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$5 : t0);
740
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$a : t0);
750
741
  }
751
- function _temp$5() {
742
+ function _temp$a() {
752
743
  return !1;
753
744
  }
754
745
  function usePrefersReducedMotion(t0) {
755
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$4 : t0);
746
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$9 : t0);
756
747
  }
757
- function _temp$4() {
748
+ function _temp$9() {
758
749
  return !1;
759
750
  }
760
751
  function responsiveBorderStyle() {
@@ -1641,7 +1632,7 @@ function avatarStrokeStyle() {
1641
1632
  const Root$B = styledComponents.styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styledComponents.styled.div(avatarStyle.arrow), BgStroke = styledComponents.styled.ellipse(avatarStyle.bgStroke), Stroke = styledComponents.styled.ellipse(avatarStyle.stroke), Initials = styledComponents.styled.div(avatarStyle.initials), InitialsLabel = styledComponents.styled(Label)({
1642
1633
  color: "inherit"
1643
1634
  }), Image = styledComponents.styled.svg(avatarStyle.image), Avatar = react.forwardRef(function(props, ref) {
1644
- const $ = reactCompilerRuntime.c(53);
1635
+ const $ = reactCompilerRuntime.c(52);
1645
1636
  let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1646
1637
  $[0] !== props ? ({
1647
1638
  __unstable_hideInnerStroke,
@@ -1677,32 +1668,30 @@ const Root$B = styledComponents.styled.div(responsiveAvatarSizeStyle, avatarStyl
1677
1668
  }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1678
1669
  const handleImageError = t7;
1679
1670
  let t8, t9;
1680
- if ($[22] !== size2) {
1681
- let t102;
1682
- $[24] === Symbol.for("react.memo_cache_sentinel") ? (t102 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[24] = t102) : t102 = $[24], t9 = size2.map(t102), $[22] = size2, $[23] = t9;
1683
- } else
1684
- t9 = $[23];
1685
- t8 = t9;
1671
+ $[22] !== size2 ? (t9 = size2.map(_temp$8), $[22] = size2, $[23] = t9) : t9 = $[23], t8 = t9;
1686
1672
  const initialsSize = t8, t10 = typeof as == "string" ? as : void 0;
1687
1673
  let t11;
1688
- $[25] !== color ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[25] = color, $[26] = t11) : t11 = $[26];
1674
+ $[24] !== color ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[24] = color, $[25] = t11) : t11 = $[25];
1689
1675
  let t12;
1690
- $[27] !== __unstable_hideInnerStroke || $[28] !== _radius || $[29] !== _sizeRem || $[30] !== handleImageError || $[31] !== imageFailed || $[32] !== imageId || $[33] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1676
+ $[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1691
1677
  /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsxRuntime.jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1692
1678
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1693
1679
  !__unstable_hideInnerStroke && /* @__PURE__ */ jsxRuntime.jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1694
1680
  /* @__PURE__ */ jsxRuntime.jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1695
- ] }), $[27] = __unstable_hideInnerStroke, $[28] = _radius, $[29] = _sizeRem, $[30] = handleImageError, $[31] = imageFailed, $[32] = imageId, $[33] = src, $[34] = t12) : t12 = $[34];
1681
+ ] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t12) : t12 = $[33];
1696
1682
  let t13;
1697
- $[35] !== imageFailed || $[36] !== initials || $[37] !== initialsSize || $[38] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: /* @__PURE__ */ jsxRuntime.jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[35] = imageFailed, $[36] = initials, $[37] = initialsSize, $[38] = src, $[39] = t13) : t13 = $[39];
1683
+ $[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: /* @__PURE__ */ jsxRuntime.jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t13) : t13 = $[38];
1698
1684
  let t14;
1699
- return $[40] !== arrowPosition || $[41] !== as || $[42] !== color || $[43] !== ref || $[44] !== restProps || $[45] !== size2 || $[46] !== status || $[47] !== t10 || $[48] !== t11 || $[49] !== t12 || $[50] !== t13 || $[51] !== title ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1685
+ return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== title ? (t14 = /* @__PURE__ */ jsxRuntime.jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1700
1686
  t11,
1701
1687
  t12,
1702
1688
  t13
1703
- ] }), $[40] = arrowPosition, $[41] = as, $[42] = color, $[43] = ref, $[44] = restProps, $[45] = size2, $[46] = status, $[47] = t10, $[48] = t11, $[49] = t12, $[50] = t13, $[51] = title, $[52] = t14) : t14 = $[52], t14;
1689
+ ] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t13, $[50] = title, $[51] = t14) : t14 = $[51], t14;
1704
1690
  });
1705
1691
  Avatar.displayName = "ForwardRef(Avatar)";
1692
+ function _temp$8(s) {
1693
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1694
+ }
1706
1695
  function _responsiveAvatarCounterSizeStyle(props) {
1707
1696
  const {
1708
1697
  avatar,
@@ -1740,24 +1729,22 @@ function _avatarCounterBaseStyle(props) {
1740
1729
  `;
1741
1730
  }
1742
1731
  const Root$A = styledComponents.styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = react.forwardRef(function(props, ref) {
1743
- const $ = reactCompilerRuntime.c(10), {
1732
+ const $ = reactCompilerRuntime.c(9), {
1744
1733
  count,
1745
1734
  size: t0
1746
1735
  } = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
1747
1736
  let t1, t2;
1748
- if ($[0] !== size2) {
1749
- let t32;
1750
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[2] = t32) : t32 = $[2], t2 = size2.map(t32), $[0] = size2, $[1] = t2;
1751
- } else
1752
- t2 = $[1];
1753
- t1 = t2;
1737
+ $[0] !== size2 ? (t2 = size2.map(_temp$7), $[0] = size2, $[1] = t2) : t2 = $[1], t1 = t2;
1754
1738
  const fontSize2 = t1;
1755
1739
  let t3;
1756
- $[3] !== count || $[4] !== fontSize2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[3] = count, $[4] = fontSize2, $[5] = t3) : t3 = $[5];
1740
+ $[2] !== count || $[3] !== fontSize2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t3) : t3 = $[4];
1757
1741
  let t4;
1758
- return $[6] !== ref || $[7] !== size2 || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[6] = ref, $[7] = size2, $[8] = t3, $[9] = t4) : t4 = $[9], t4;
1742
+ return $[5] !== ref || $[6] !== size2 || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[5] = ref, $[6] = size2, $[7] = t3, $[8] = t4) : t4 = $[8], t4;
1759
1743
  });
1760
1744
  AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1745
+ function _temp$7(s) {
1746
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1747
+ }
1761
1748
  const BASE_STYLES = styledComponents.css`
1762
1749
  white-space: nowrap;
1763
1750
 
@@ -2953,7 +2940,7 @@ function inlineSpaceStyle(props) {
2953
2940
  });
2954
2941
  }
2955
2942
  const Root$m = styledComponents.styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
2956
- const $ = reactCompilerRuntime.c(13);
2943
+ const $ = reactCompilerRuntime.c(12);
2957
2944
  let as, childrenProp, restProps, space;
2958
2945
  $[0] !== props ? ({
2959
2946
  as,
@@ -2962,17 +2949,15 @@ const Root$m = styledComponents.styled(Box)(inlineBaseStyle, inlineSpaceStyle),
2962
2949
  ...restProps
2963
2950
  } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2964
2951
  let t0, t1;
2965
- if ($[5] !== childrenProp) {
2966
- let t22;
2967
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t22 = (child) => child && /* @__PURE__ */ jsxRuntime.jsx("div", { children: child }), $[7] = t22) : t22 = $[7], t1 = react.Children.map(childrenProp, t22), $[5] = childrenProp, $[6] = t1;
2968
- } else
2969
- t1 = $[6];
2970
- t0 = t1;
2952
+ $[5] !== childrenProp ? (t1 = react.Children.map(childrenProp, _temp$6), $[5] = childrenProp, $[6] = t1) : t1 = $[6], t0 = t1;
2971
2953
  const children = t0, t2 = useArrayProp(space);
2972
2954
  let t3;
2973
- return $[8] !== as || $[9] !== children || $[10] !== restProps || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[8] = as, $[9] = children, $[10] = restProps, $[11] = t2, $[12] = t3) : t3 = $[12], t3;
2955
+ return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
2974
2956
  });
2975
2957
  Inline.displayName = "ForwardRef(Inline)";
2958
+ function _temp$6(child) {
2959
+ return child && /* @__PURE__ */ jsxRuntime.jsx("div", { children: child });
2960
+ }
2976
2961
  function kbdStyle() {
2977
2962
  return styledComponents.css`
2978
2963
  --card-bg-color: var(--card-kbd-bg-color);
@@ -3401,13 +3386,13 @@ function LayerProvider(props) {
3401
3386
  [childLevel]: prevLen + 1
3402
3387
  };
3403
3388
  return setSize(Object.keys(nextState).length), nextState;
3404
- }) : setSize((v) => v + 1), () => {
3389
+ }) : setSize(_temp$5), () => {
3405
3390
  childLevel !== void 0 ? setChildLayers((state_0) => {
3406
3391
  const nextState_0 = {
3407
3392
  ...state_0
3408
3393
  };
3409
3394
  return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3410
- }) : setSize((v_0) => v_0 - 1), parentDispose?.();
3395
+ }) : setSize(_temp2$3), parentDispose?.();
3411
3396
  };
3412
3397
  }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
3413
3398
  const registerChild = t3;
@@ -3426,6 +3411,12 @@ function LayerProvider(props) {
3426
3411
  let t8;
3427
3412
  return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
3428
3413
  }
3414
+ function _temp2$3(v_0) {
3415
+ return v_0 - 1;
3416
+ }
3417
+ function _temp$5(v) {
3418
+ return v + 1;
3419
+ }
3429
3420
  LayerProvider.displayName = "LayerProvider";
3430
3421
  const Root$j = styledComponents.styled.div({
3431
3422
  position: "relative"
@@ -3512,8 +3503,9 @@ function PortalProvider(props) {
3512
3503
  const $ = reactCompilerRuntime.c(7), {
3513
3504
  boundaryElement,
3514
3505
  children,
3515
- element
3516
- } = props, elements = useUnique(props.__unstable_elements), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
3506
+ element,
3507
+ __unstable_elements: elementsProp
3508
+ } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
3517
3509
  let t0;
3518
3510
  const t1 = boundaryElement || null, t2 = element || fallbackElement;
3519
3511
  let t3;
@@ -3527,21 +3519,20 @@ function PortalProvider(props) {
3527
3519
  let t4;
3528
3520
  return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
3529
3521
  }
3530
- function _temp2$1() {
3522
+ function _temp2$2() {
3531
3523
  return null;
3532
3524
  }
3533
- function _temp$3() {
3525
+ function _temp$4() {
3534
3526
  return document.body;
3535
3527
  }
3536
3528
  PortalProvider.displayName = "PortalProvider";
3537
3529
  const emptySubscribe = () => () => {
3538
3530
  };
3539
3531
  function useUnique(value) {
3540
- const [cachedValue, setCachedValue] = react.useState(value);
3541
- let result = cachedValue;
3542
- return isEqual(cachedValue, value) || (setCachedValue(value), result = value), result;
3532
+ const valueRef = react.useRef(value);
3533
+ return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
3543
3534
  }
3544
- function isEqual(objA, objB) {
3535
+ function _isEqual(objA, objB) {
3545
3536
  if (!objA || !objB)
3546
3537
  return objA === objB;
3547
3538
  const keysA = Object.keys(objA), keysB = Object.keys(objB);
@@ -4595,7 +4586,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4595
4586
  display: "block"
4596
4587
  }
4597
4588
  }), TextInput = react.forwardRef(function(props, forwardedRef) {
4598
- const $ = reactCompilerRuntime.c(86);
4589
+ const $ = reactCompilerRuntime.c(84);
4599
4590
  let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
4600
4591
  $[0] !== props ? ({
4601
4592
  __unstable_disableFocusRing,
@@ -4620,7 +4611,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4620
4611
  const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = react.useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4621
4612
  let t7;
4622
4613
  $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4623
- const handleClearMouseDown = _temp$2;
4614
+ const handleClearMouseDown = _temp$3;
4624
4615
  let t8;
4625
4616
  $[20] !== onClear ? (t8 = (event_0) => {
4626
4617
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
@@ -4648,49 +4639,45 @@ const CLEAR_BUTTON_BOX_STYLE = {
4648
4639
  ] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t12, $[41] = t13, $[42] = t14, $[43] = t15) : t15 = $[43], t11 = t15;
4649
4640
  const presentationNode = t11;
4650
4641
  let t16, t17;
4651
- if ($[44] !== padding) {
4652
- let t182;
4653
- $[46] === Symbol.for("react.memo_cache_sentinel") ? (t182 = (v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2, $[46] = t182) : t182 = $[46], t17 = padding.map(t182), $[44] = padding, $[45] = t17;
4654
- } else
4655
- t17 = $[45];
4656
- t16 = t17;
4642
+ $[44] !== padding ? (t17 = padding.map(_temp2$1), $[44] = padding, $[45] = t17) : t17 = $[45], t16 = t17;
4657
4643
  const clearButtonBoxPadding = t16;
4658
4644
  let t18, t19;
4659
- if ($[47] !== padding) {
4660
- let t202;
4661
- $[49] === Symbol.for("react.memo_cache_sentinel") ? (t202 = (v_0) => v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1, $[49] = t202) : t202 = $[49], t19 = padding.map(t202), $[47] = padding, $[48] = t19;
4662
- } else
4663
- t19 = $[48];
4664
- t18 = t19;
4645
+ $[46] !== padding ? (t19 = padding.map(_temp3), $[46] = padding, $[47] = t19) : t19 = $[47], t18 = t19;
4665
4646
  const clearButtonPadding = t18;
4666
4647
  let t20;
4667
4648
  t20 = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
4668
4649
  const clearButtonProps = t20;
4669
4650
  let t21, t22;
4670
- $[50] !== clearButton || $[51] !== clearButtonBoxPadding || $[52] !== clearButtonPadding || $[53] !== clearButtonProps || $[54] !== customValidity || $[55] !== disabled || $[56] !== fontSize2 || $[57] !== handleClearClick || $[58] !== radius || $[59] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[50] = clearButton, $[51] = clearButtonBoxPadding, $[52] = clearButtonPadding, $[53] = clearButtonProps, $[54] = customValidity, $[55] = disabled, $[56] = fontSize2, $[57] = handleClearClick, $[58] = radius, $[59] = readOnly, $[60] = t22) : t22 = $[60], t21 = t22;
4651
+ $[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t22) : t22 = $[58], t21 = t22;
4671
4652
  const clearButtonNode = t21;
4672
4653
  let t23, t24;
4673
- $[61] !== radius || $[62] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[61] = radius, $[62] = suffix, $[63] = t24) : t24 = $[63], t23 = t24;
4654
+ $[59] !== radius || $[60] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t24) : t24 = $[61], t23 = t24;
4674
4655
  const suffixNode = t23, t25 = $hasIconRight || $hasClearButton;
4675
4656
  let t26;
4676
- $[64] !== $hasIcon || $[65] !== disabled || $[66] !== fontSize2 || $[67] !== padding || $[68] !== readOnly || $[69] !== restProps || $[70] !== rootTheme.scheme || $[71] !== rootTheme.tone || $[72] !== space || $[73] !== t25 || $[74] !== type || $[75] !== weight ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[64] = $hasIcon, $[65] = disabled, $[66] = fontSize2, $[67] = padding, $[68] = readOnly, $[69] = restProps, $[70] = rootTheme.scheme, $[71] = rootTheme.tone, $[72] = space, $[73] = t25, $[74] = type, $[75] = weight, $[76] = t26) : t26 = $[76];
4657
+ $[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t25 || $[72] !== type || $[73] !== weight ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t25, $[72] = type, $[73] = weight, $[74] = t26) : t26 = $[74];
4677
4658
  let t27;
4678
- $[77] !== clearButtonNode || $[78] !== presentationNode || $[79] !== t26 ? (t27 = /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
4659
+ $[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t26 ? (t27 = /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
4679
4660
  t26,
4680
4661
  presentationNode,
4681
4662
  clearButtonNode
4682
- ] }), $[77] = clearButtonNode, $[78] = presentationNode, $[79] = t26, $[80] = t27) : t27 = $[80];
4663
+ ] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t26, $[78] = t27) : t27 = $[78];
4683
4664
  let t28;
4684
- return $[81] !== prefixNode || $[82] !== rootTheme.tone || $[83] !== suffixNode || $[84] !== t27 ? (t28 = /* @__PURE__ */ jsxRuntime.jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4665
+ return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t27 ? (t28 = /* @__PURE__ */ jsxRuntime.jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4685
4666
  prefixNode,
4686
4667
  t27,
4687
4668
  suffixNode
4688
- ] }), $[81] = prefixNode, $[82] = rootTheme.tone, $[83] = suffixNode, $[84] = t27, $[85] = t28) : t28 = $[85], t28;
4669
+ ] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t27, $[83] = t28) : t28 = $[83], t28;
4689
4670
  });
4690
4671
  TextInput.displayName = "ForwardRef(TextInput)";
4691
- function _temp$2(event) {
4672
+ function _temp$3(event) {
4692
4673
  event.preventDefault(), event.stopPropagation();
4693
4674
  }
4675
+ function _temp2$1(v) {
4676
+ return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
4677
+ }
4678
+ function _temp3(v_0) {
4679
+ return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
4680
+ }
4694
4681
  function useDelayedState(initialState) {
4695
4682
  const $ = reactCompilerRuntime.c(3), [state, setState] = react.useState(initialState), delayedAction = react.useRef();
4696
4683
  let t0;
@@ -5807,7 +5794,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5807
5794
  }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
5808
5795
  let t9;
5809
5796
  $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
5810
- setOpen((v) => !v), setShouldFocus(null);
5797
+ setOpen(_temp$2), setShouldFocus(null);
5811
5798
  }, $[12] = t9) : t9 = $[12];
5812
5799
  const handleButtonClick = t9;
5813
5800
  let t10;
@@ -5909,6 +5896,9 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5909
5896
  return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
5910
5897
  });
5911
5898
  MenuButton.displayName = "ForwardRef(MenuButton)";
5899
+ function _temp$2(v) {
5900
+ return !v;
5901
+ }
5912
5902
  const MenuDivider = styledComponents.styled.hr`
5913
5903
  height: 1px;
5914
5904
  border: 0;