sanity 5.6.1-next.6 → 5.7.0-next.7

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,4 +1,4 @@
1
- var version = "5.6.1-next.6+bed417e356", peerDependencies = {
1
+ var version = "5.7.0-next.7+c59672612e", peerDependencies = {
2
2
  "styled-components": "^6.1.15"
3
3
  };
4
4
  export {
@@ -7,7 +7,7 @@ try {
7
7
  try {
8
8
  buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
9
9
  // and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
10
- "5.6.1-next.6+bed417e356";
10
+ "5.7.0-next.7+c59672612e";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/index.d.ts CHANGED
@@ -14234,6 +14234,8 @@ declare const studioLocaleStrings: {
14234
14234
  'inputs.reference.strength-mismatch.title': string
14235
14235
  /** Label for button that triggers the action that weakens a reference on strength mismatch */
14236
14236
  'inputs.reference.strength-mismatch.weaken-button-label': string
14237
+ /** Label for action to clear the current value of the select field */
14238
+ 'inputs.select.action.clear': string
14237
14239
  /** Action message for generating the slug */
14238
14240
  'inputs.slug.action.generate': string
14239
14241
  /** Loading message for when the input is actively generating a slug */
package/lib/index.js CHANGED
@@ -1766,6 +1766,8 @@ const studioLocaleNamespace = "studio", validationLocaleNamespace = "validation"
1766
1766
  "inputs.reference.strength-mismatch.title": "Reference strength mismatch",
1767
1767
  /** Label for button that triggers the action that weakens a reference on strength mismatch */
1768
1768
  "inputs.reference.strength-mismatch.weaken-button-label": "Convert to weak reference",
1769
+ /** Label for action to clear the current value of the select field */
1770
+ "inputs.select.action.clear": "Clear",
1769
1771
  /** Action message for generating the slug */
1770
1772
  "inputs.slug.action.generate": "Generate",
1771
1773
  /** Loading message for when the input is actively generating a slug */
@@ -40931,7 +40933,7 @@ function _temp$2o(item_1, i) {
40931
40933
  return /* @__PURE__ */ jsx("option", { value: i - 1, children: item_1.title }, `${i - 1}`);
40932
40934
  }
40933
40935
  const RadioSelect = forwardRef(function(props2, ref) {
40934
- const $ = c(12), {
40936
+ const $ = c(22), {
40935
40937
  items,
40936
40938
  value,
40937
40939
  onChange,
@@ -40940,13 +40942,29 @@ const RadioSelect = forwardRef(function(props2, ref) {
40940
40942
  customValidity,
40941
40943
  direction,
40942
40944
  inputId
40943
- } = props2, Layout2 = direction === "horizontal" ? Inline : Stack;
40945
+ } = props2, {
40946
+ t
40947
+ } = useTranslation();
40944
40948
  let t0;
40945
- $[0] !== customValidity || $[1] !== inputId || $[2] !== items || $[3] !== onChange || $[4] !== onFocus || $[5] !== readOnly || $[6] !== ref || $[7] !== value ? (t0 = items.map((item, index) => /* @__PURE__ */ jsx(RadioSelectItem, { customValidity, inputId, item, onChange, onFocus, readOnly, ref: index === 0 ? ref : null, value }, index)), $[0] = customValidity, $[1] = inputId, $[2] = items, $[3] = onChange, $[4] = onFocus, $[5] = readOnly, $[6] = ref, $[7] = value, $[8] = t0) : t0 = $[8];
40946
- let t1;
40947
- return $[9] !== Layout2 || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(Card, { border: !0, padding: 3, radius: 2, children: /* @__PURE__ */ jsx(Layout2, { space: 3, role: "group", children: t0 }) }), $[9] = Layout2, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
40949
+ $[0] !== onChange ? (t0 = () => {
40950
+ onChange(null);
40951
+ }, $[0] = onChange, $[1] = t0) : t0 = $[1];
40952
+ const handleClear = t0, isHorizontal = direction === "horizontal", Layout2 = isHorizontal ? Inline : Stack, showClearButton = !readOnly && value, t1 = isHorizontal ? "center" : "flex-end";
40953
+ let t2;
40954
+ $[2] !== customValidity || $[3] !== inputId || $[4] !== items || $[5] !== onChange || $[6] !== onFocus || $[7] !== readOnly || $[8] !== ref || $[9] !== value ? (t2 = items.map((item, index) => /* @__PURE__ */ jsx(RadioSelectItem, { customValidity, inputId, item, onChange, onFocus, readOnly, ref: index === 0 ? ref : null, value }, index)), $[2] = customValidity, $[3] = inputId, $[4] = items, $[5] = onChange, $[6] = onFocus, $[7] = readOnly, $[8] = ref, $[9] = value, $[10] = t2) : t2 = $[10];
40955
+ let t3;
40956
+ $[11] !== Layout2 || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsx(Layout2, { space: 3, role: "group", paddingY: 1, children: t2 }), $[11] = Layout2, $[12] = t2, $[13] = t3) : t3 = $[13];
40957
+ let t4;
40958
+ $[14] !== handleClear || $[15] !== showClearButton || $[16] !== t ? (t4 = showClearButton && /* @__PURE__ */ jsx(Button, { icon: ResetIcon, onClick: handleClear, tooltipProps: {
40959
+ content: t("inputs.select.action.clear")
40960
+ }, mode: "bleed" }), $[14] = handleClear, $[15] = showClearButton, $[16] = t, $[17] = t4) : t4 = $[17];
40961
+ let t5;
40962
+ return $[18] !== t1 || $[19] !== t3 || $[20] !== t4 ? (t5 = /* @__PURE__ */ jsx(Card, { border: !0, paddingY: 2, paddingX: 3, radius: 2, children: /* @__PURE__ */ jsxs(Flex, { align: t1, gap: 3, justify: "space-between", children: [
40963
+ t3,
40964
+ t4
40965
+ ] }) }), $[18] = t1, $[19] = t3, $[20] = t4, $[21] = t5) : t5 = $[21], t5;
40948
40966
  }), RadioSelectItem = forwardRef(function(props2, ref) {
40949
- const $ = c(16), {
40967
+ const $ = c(17), {
40950
40968
  customValidity,
40951
40969
  inputId,
40952
40970
  item,
@@ -40959,16 +40977,17 @@ const RadioSelect = forwardRef(function(props2, ref) {
40959
40977
  $[0] !== item || $[1] !== onChange ? (t0 = () => {
40960
40978
  onChange(item);
40961
40979
  }, $[0] = item, $[1] = onChange, $[2] = t0) : t0 = $[2];
40962
- const handleChange = t0, t1 = value === item;
40963
- let t2;
40964
- $[3] !== customValidity || $[4] !== handleChange || $[5] !== inputId || $[6] !== onFocus || $[7] !== readOnly || $[8] !== ref || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Radio, { ref, checked: t1, onChange: handleChange, onFocus, readOnly, customValidity, name: inputId }), $[3] = customValidity, $[4] = handleChange, $[5] = inputId, $[6] = onFocus, $[7] = readOnly, $[8] = ref, $[9] = t1, $[10] = t2) : t2 = $[10];
40980
+ const handleChange = t0, checked = value === item;
40981
+ let t1;
40982
+ $[3] !== checked || $[4] !== customValidity || $[5] !== handleChange || $[6] !== inputId || $[7] !== onFocus || $[8] !== readOnly || $[9] !== ref ? (t1 = /* @__PURE__ */ jsx(Radio, { ref, checked, onChange: handleChange, onFocus, readOnly, customValidity, name: inputId }), $[3] = checked, $[4] = customValidity, $[5] = handleChange, $[6] = inputId, $[7] = onFocus, $[8] = readOnly, $[9] = ref, $[10] = t1) : t1 = $[10];
40983
+ const t2 = checked ? "medium" : "regular";
40965
40984
  let t3;
40966
- $[11] !== item.title ? (t3 = /* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text$1, { size: 1, weight: "medium", children: item.title }) }), $[11] = item.title, $[12] = t3) : t3 = $[12];
40985
+ $[11] !== item.title || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text$1, { size: 1, weight: t2, children: item.title }) }), $[11] = item.title, $[12] = t2, $[13] = t3) : t3 = $[13];
40967
40986
  let t4;
40968
- return $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsxs(Flex, { as: "label", align: "center", children: [
40969
- t2,
40987
+ return $[14] !== t1 || $[15] !== t3 ? (t4 = /* @__PURE__ */ jsxs(Flex, { as: "label", align: "center", children: [
40988
+ t1,
40970
40989
  t3
40971
- ] }), $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
40990
+ ] }), $[14] = t1, $[15] = t3, $[16] = t4) : t4 = $[16], t4;
40972
40991
  });
40973
40992
  function resolveNumberInput(type) {
40974
40993
  return getOption(type, "list") ? SelectInput : NumberInput;