@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 +1 @@
1
- {"version":3,"file":"refractor.js","sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n\nLazyRefractor.displayName = 'LazyRefractor'\n"],"names":["LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","hasLanguage","registered","t1","t2","Refractor","String","t3","displayName"],"mappings":";;AAEA,SAAeA,cAAAC,OAAA;AAAA,QAAAC,IAAAC,uBAAA,EAAA,GAKb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAWA,eAAYE;AAAY,MAAAC;AAAAN,WAAAE,YACzDI,KAAAJ,WAAWK,eAAAA,YAAYL,QAAe,IAAC,IAAQF,OAAAE,UAAAF,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAAlE,QAAAQ,aAAmBF;AAA+C,MAAAG;AAAAT,IAAA,CAAA,MAAAE,YAAAF,SAAAQ,cAAAR,EAAA,CAAA,MAAAI,SAI7DK,KAAA,EAAEP,YAAYM,wDAAsBJ,UAAAA,MAAAA,CAAM,GAAOJ,OAAAE,UAAAF,OAAAQ,YAAAR,OAAAI,OAAAJ,OAAAS,MAAAA,KAAAT,EAAA,CAAA;AAAA,MAAAU;AAAAV,IAAA,CAAA,MAAAE,YAAAF,SAAAQ,cAAAR,EAAA,CAAA,MAAAI,SACjDM,KAAAR,YAAYM,6CAAeG,eAAAA,WAAA,EAAU,QAAA,IAAiBT,UAAiB,OAAAU,OAAOR,KAAK,EAAA,CAAC,GAAIJ,OAAAE,UAAAF,OAAAQ,YAAAR,OAAAI,OAAAJ,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAAA,MAAAa;AAAA,SAAAb,EAAA,EAAA,MAAAS,MAAAT,UAAAU,MAF3FG,4DACGJ,UAAAA;AAAAA,IAAAA;AAAAA,IACAC;AAAAA,EAAAA,EAAAA,CAAwF,GACxFV,QAAAS,IAAAT,QAAAU,IAAAV,QAAAa,MAAAA,KAAAb,EAAA,EAAA,GAHHa;AAGG;AAIPf,cAAcgB,cAAc;;"}
1
+ {"version":3,"file":"refractor.js","sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n\nLazyRefractor.displayName = 'LazyRefractor'\n"],"names":["LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","hasLanguage","registered","t1","t2","Refractor","String","t3","displayName"],"mappings":";;AAEA,SAAeA,cAAAC,OAAA;AAAA,QAAAC,IAAAC,uBAAA,EAAA,GAKb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE;AAA2D,MAAAC;AAAAN,WAAAE,YACzDI,KAAAJ,WAAWK,eAAAA,YAAYL,QAAuB,IAA9C,IAA+CF,OAAAE,UAAAF,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAAlE,QAAAQ,aAAmBF;AAA+C,MAAAG;AAAAT,IAAA,CAAA,MAAAE,YAAAF,SAAAQ,cAAAR,EAAA,CAAA,MAAAI,SAI7DK,KAAA,EAAEP,YAAAM,8CAA2B,QAAA,EAAOJ,UAAAA,MAAAA,CAAM,GAAOJ,OAAAE,UAAAF,OAAAQ,YAAAR,OAAAI,OAAAJ,OAAAS,MAAAA,KAAAT,EAAA,CAAA;AAAA,MAAAU;AAAAV,IAAA,CAAA,MAAAE,YAAAF,SAAAQ,cAAAR,EAAA,CAAA,MAAAI,SACjDM,KAAAR,YAAAM,6CAA2BG,eAAAA,WAAA,EAAU,QAAA,IAAiBT,UAAiB,OAAAU,OAAOR,KAAK,EAAA,CAAC,GAAIJ,OAAAE,UAAAF,OAAAQ,YAAAR,OAAAI,OAAAJ,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAAA,MAAAa;AAAA,SAAAb,EAAA,EAAA,MAAAS,MAAAT,UAAAU,MAF3FG,4DACGJ,UAAAA;AAAAA,IAAAA;AAAAA,IACAC;AAAAA,EAAAA,EAAAA,CAAwF,GACxFV,QAAAS,IAAAT,QAAAU,IAAAV,QAAAa,MAAAA,KAAAb,EAAA,EAAA,GAHHa;AAGG;AAIPf,cAAcgB,cAAc;;"}
@@ -6,7 +6,7 @@ import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled,
6
6
  import ReactIs, { isValidElementType } from "react-is";
7
7
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
8
8
  import { detectOverflow, useFloating, autoPlacement, flip, offset, shift, arrow, hide, autoUpdate } from "@floating-ui/react-dom";
9
- import { motion, AnimatePresence } from "framer-motion";
9
+ import { motion, AnimatePresence } from "motion/react";
10
10
  import { ResizeObserver } from "@juggle/resize-observer";
11
11
  import { createPortal } from "react-dom";
12
12
  import { useEffectEvent } from "use-effect-event";
@@ -3029,7 +3029,7 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
3029
3029
  displayName: "ShapePath",
3030
3030
  componentId: "sc-12vzy6c-2"
3031
3031
  })`fill:var(--card-bg-color);`, Arrow = forwardRef(function(props, ref) {
3032
- const $ = c(24);
3032
+ const $ = c(29);
3033
3033
  let h, restProps, t0, w;
3034
3034
  $[0] !== props ? ({
3035
3035
  width: w,
@@ -3039,40 +3039,47 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
3039
3039
  } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
3040
3040
  const radius = t0 === void 0 ? 0 : t0, {
3041
3041
  card
3042
- } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
3043
- x: 0,
3044
- y: 0
3045
- }, {
3046
- x: radius,
3047
- y: 0,
3048
- radius
3049
- }, {
3050
- x: center,
3051
- y: h - 1,
3052
- radius
3053
- }, {
3054
- x: w - radius,
3055
- y: 0,
3056
- radius
3057
- }, {
3058
- x: w,
3059
- y: 0
3060
- }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t1 = `0 0 ${w} ${w}`;
3061
- let t2;
3062
- $[5] !== strokeWidth || $[6] !== w ? (t2 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[5] = strokeWidth, $[6] = w, $[7] = t2) : t2 = $[7];
3063
- const t3 = strokeWidth * 2;
3064
- let t4;
3065
- $[8] !== strokePath || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t3 }), $[8] = strokePath, $[9] = t3, $[10] = t4) : t4 = $[10];
3042
+ } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2;
3043
+ let t1;
3044
+ if ($[5] !== center || $[6] !== h || $[7] !== radius || $[8] !== w) {
3045
+ const points = [{
3046
+ x: 0,
3047
+ y: 0
3048
+ }, {
3049
+ x: radius,
3050
+ y: 0,
3051
+ radius
3052
+ }, {
3053
+ x: center,
3054
+ y: h - 1,
3055
+ radius
3056
+ }, {
3057
+ x: w - radius,
3058
+ y: 0,
3059
+ radius
3060
+ }, {
3061
+ x: w,
3062
+ y: 0
3063
+ }], cmds = getRoundedCommands(points);
3064
+ t1 = compileCommands(cmds), $[5] = center, $[6] = h, $[7] = radius, $[8] = w, $[9] = t1;
3065
+ } else
3066
+ t1 = $[9];
3067
+ const path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t2 = `0 0 ${w} ${w}`;
3068
+ let t3;
3069
+ $[10] !== strokeWidth || $[11] !== w ? (t3 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[10] = strokeWidth, $[11] = w, $[12] = t3) : t3 = $[12];
3070
+ const t4 = strokeWidth * 2;
3066
3071
  let t5;
3067
- $[11] !== fillPath ? (t5 = /* @__PURE__ */ jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
3072
+ $[13] !== strokePath || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t4 }), $[13] = strokePath, $[14] = t4, $[15] = t5) : t5 = $[15];
3068
3073
  let t6;
3069
- $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t1, children: [
3070
- t2,
3071
- t4,
3072
- t5
3073
- ] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
3074
+ $[16] !== fillPath ? (t6 = /* @__PURE__ */ jsx(ShapePath, { d: fillPath }), $[16] = fillPath, $[17] = t6) : t6 = $[17];
3074
3075
  let t7;
3075
- return $[19] !== ref || $[20] !== restProps || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsx(StyledArrow, { ...restProps, $w: w, ref, children: t6 }), $[19] = ref, $[20] = restProps, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23], t7;
3076
+ $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t2, children: [
3077
+ t3,
3078
+ t5,
3079
+ t6
3080
+ ] }), $[18] = t2, $[19] = t3, $[20] = t5, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23];
3081
+ let t8;
3082
+ return $[24] !== ref || $[25] !== restProps || $[26] !== t7 || $[27] !== w ? (t8 = /* @__PURE__ */ jsx(StyledArrow, { ...restProps, $w: w, ref, children: t7 }), $[24] = ref, $[25] = restProps, $[26] = t7, $[27] = w, $[28] = t8) : t8 = $[28], t8;
3076
3083
  });
3077
3084
  Arrow.displayName = "ForwardRef(Arrow)";
3078
3085
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);