@sanity/ui 3.1.9 → 3.1.11

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
2
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), react$1 = require("motion/react"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
@@ -3025,7 +3025,7 @@ const StyledArrow = /* @__PURE__ */ styledComponents.styled.div.withConfig({
3025
3025
  displayName: "ShapePath",
3026
3026
  componentId: "sc-12vzy6c-2"
3027
3027
  })`fill:var(--card-bg-color);`, Arrow = react.forwardRef(function(props, ref) {
3028
- const $ = reactCompilerRuntime.c(24);
3028
+ const $ = reactCompilerRuntime.c(29);
3029
3029
  let h, restProps, t0, w;
3030
3030
  $[0] !== props ? ({
3031
3031
  width: w,
@@ -3035,40 +3035,47 @@ const StyledArrow = /* @__PURE__ */ styledComponents.styled.div.withConfig({
3035
3035
  } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
3036
3036
  const radius = t0 === void 0 ? 0 : t0, {
3037
3037
  card
3038
- } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
3039
- x: 0,
3040
- y: 0
3041
- }, {
3042
- x: radius,
3043
- y: 0,
3044
- radius
3045
- }, {
3046
- x: center,
3047
- y: h - 1,
3048
- radius
3049
- }, {
3050
- x: w - radius,
3051
- y: 0,
3052
- radius
3053
- }, {
3054
- x: w,
3055
- y: 0
3056
- }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t1 = `0 0 ${w} ${w}`;
3057
- let t2;
3058
- $[5] !== strokeWidth || $[6] !== w ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[5] = strokeWidth, $[6] = w, $[7] = t2) : t2 = $[7];
3059
- const t3 = strokeWidth * 2;
3060
- let t4;
3061
- $[8] !== strokePath || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t3 }), $[8] = strokePath, $[9] = t3, $[10] = t4) : t4 = $[10];
3038
+ } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2;
3039
+ let t1;
3040
+ if ($[5] !== center || $[6] !== h || $[7] !== radius || $[8] !== w) {
3041
+ const points = [{
3042
+ x: 0,
3043
+ y: 0
3044
+ }, {
3045
+ x: radius,
3046
+ y: 0,
3047
+ radius
3048
+ }, {
3049
+ x: center,
3050
+ y: h - 1,
3051
+ radius
3052
+ }, {
3053
+ x: w - radius,
3054
+ y: 0,
3055
+ radius
3056
+ }, {
3057
+ x: w,
3058
+ y: 0
3059
+ }], cmds = getRoundedCommands(points);
3060
+ t1 = compileCommands(cmds), $[5] = center, $[6] = h, $[7] = radius, $[8] = w, $[9] = t1;
3061
+ } else
3062
+ t1 = $[9];
3063
+ const path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t2 = `0 0 ${w} ${w}`;
3064
+ let t3;
3065
+ $[10] !== strokeWidth || $[11] !== w ? (t3 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[10] = strokeWidth, $[11] = w, $[12] = t3) : t3 = $[12];
3066
+ const t4 = strokeWidth * 2;
3062
3067
  let t5;
3063
- $[11] !== fillPath ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
3068
+ $[13] !== strokePath || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t4 }), $[13] = strokePath, $[14] = t4, $[15] = t5) : t5 = $[15];
3064
3069
  let t6;
3065
- $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t1, children: [
3066
- t2,
3067
- t4,
3068
- t5
3069
- ] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
3070
+ $[16] !== fillPath ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath }), $[16] = fillPath, $[17] = t6) : t6 = $[17];
3070
3071
  let t7;
3071
- return $[19] !== ref || $[20] !== restProps || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(StyledArrow, { ...restProps, $w: w, ref, children: t6 }), $[19] = ref, $[20] = restProps, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23], t7;
3072
+ $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t2, children: [
3073
+ t3,
3074
+ t5,
3075
+ t6
3076
+ ] }), $[18] = t2, $[19] = t3, $[20] = t5, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23];
3077
+ let t8;
3078
+ return $[24] !== ref || $[25] !== restProps || $[26] !== t7 || $[27] !== w ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(StyledArrow, { ...restProps, $w: w, ref, children: t7 }), $[24] = ref, $[25] = restProps, $[26] = t7, $[27] = w, $[28] = t8) : t8 = $[28], t8;
3072
3079
  });
3073
3080
  Arrow.displayName = "ForwardRef(Arrow)";
3074
3081
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
@@ -3564,10 +3571,10 @@ function calcMaxWidth(params) {
3564
3571
  if (!(currentWidth === void 0 && boundaryWidth === void 0))
3565
3572
  return Math.min(currentWidth ?? 1 / 0, (boundaryWidth || 1 / 0) - DEFAULT_POPOVER_PADDING * 2);
3566
3573
  }
3567
- const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).withConfig({
3574
+ const MotionCard$1 = styledComponents.styled(react$1.motion.create(Card)).withConfig({
3568
3575
  displayName: "MotionCard",
3569
3576
  componentId: "sc-ihg31s-0"
3570
- })`&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;`, MotionFlex = styledComponents.styled(framerMotion.motion.create(Flex)).withConfig({
3577
+ })`&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;`, MotionFlex = styledComponents.styled(react$1.motion.create(Flex)).withConfig({
3571
3578
  displayName: "MotionFlex",
3572
3579
  componentId: "sc-ihg31s-1"
3573
3580
  })`will-change:opacity;`, PopoverCard = react.forwardRef(function(props, ref) {
@@ -3829,7 +3836,7 @@ const ViewportOverlay = () => {
3829
3836
  $[116] !== open || $[117] !== popover || $[118] !== portal ? (t38 = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[116] = open, $[117] = popover, $[118] = portal, $[119] = t38) : t38 = $[119];
3830
3837
  const children = t38;
3831
3838
  let t39;
3832
- $[120] !== animate || $[121] !== children ? (t39 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[120] = animate, $[121] = children, $[122] = t39) : t39 = $[122];
3839
+ $[120] !== animate || $[121] !== children ? (t39 = animate ? /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { children }) : children, $[120] = animate, $[121] = children, $[122] = t39) : t39 = $[122];
3833
3840
  let t40;
3834
3841
  return $[123] !== child || $[124] !== t39 ? (t40 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3835
3842
  t39,
@@ -4725,7 +4732,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4725
4732
  right: ["right-end", "right-start", "left", "top", "bottom"],
4726
4733
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
4727
4734
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
4728
- }, MotionCard = styledComponents.styled(framerMotion.motion.create(Card)).withConfig({
4735
+ }, MotionCard = styledComponents.styled(react$1.motion.create(Card)).withConfig({
4729
4736
  displayName: "MotionCard",
4730
4737
  componentId: "sc-1xn138w-0"
4731
4738
  })`will-change:transform;`, TooltipCard = react.forwardRef(function(props, ref) {
@@ -4998,7 +5005,7 @@ const StyledTooltip = styledComponents.styled(Layer).withConfig({
4998
5005
  $[127] !== portalProp || $[128] !== showTooltip || $[129] !== tooltip ? (t38 = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[127] = portalProp, $[128] = showTooltip, $[129] = tooltip, $[130] = t38) : t38 = $[130];
4999
5006
  const children = t38;
5000
5007
  let t39;
5001
- $[131] !== animate || $[132] !== children ? (t39 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[131] = animate, $[132] = children, $[133] = t39) : t39 = $[133];
5008
+ $[131] !== animate || $[132] !== children ? (t39 = animate ? /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { children }) : children, $[131] = animate, $[132] = children, $[133] = t39) : t39 = $[133];
5002
5009
  let t40;
5003
5010
  return $[134] !== child || $[135] !== t39 ? (t40 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5004
5011
  t39,