@sanity/ui 4.2.2 → 4.2.4

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,6 +1,6 @@
1
1
  "use client";
2
2
  import { n as _getArrayProp, o as EMPTY_ARRAY, s as EMPTY_RECORD } from "./helpers-C8xxXAQC.js";
3
- import { f as focusFirstDescendant, h as _raf, t as TextInput, u as _hasFocus } from "./textInput-fGZVEKGs.js";
3
+ import { f as focusFirstDescendant, h as _raf, t as TextInput, u as _hasFocus } from "./textInput-Yp5lnvZK.js";
4
4
  import { t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
5
5
  import { s as Card, y as Box } from "./useLayer-CUKYjJYq.js";
6
6
  import { n as Text, t as Stack } from "./stack-SbGBZ0x3.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { a as rem, i as _responsive, n as _getArrayProp, r as _getResponsiveSpace, s as EMPTY_RECORD, t as _fillCSSObject } from "./helpers-C8xxXAQC.js";
3
- import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textAreaRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-fGZVEKGs.js";
3
+ import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textAreaRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-Yp5lnvZK.js";
4
4
  import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
5
5
  import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
6
6
  import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-CUKYjJYq.js";
@@ -1352,7 +1352,7 @@ function inputElementStyles(props) {
1352
1352
  var checkbox = "ycv36y0";
1353
1353
  const Input$3 = /* @__PURE__ */ styled.input.withConfig({
1354
1354
  displayName: "Input",
1355
- componentId: "sc-ng4gkf-0"
1355
+ componentId: "sc-lvzyx-0"
1356
1356
  })(inputElementStyles);
1357
1357
  /**
1358
1358
  * Checkboxes allow the user to select one or more items from a set.
@@ -1374,6 +1374,7 @@ function Checkbox(props) {
1374
1374
  $[16] !== checked || $[17] !== readOnly || $[18] !== restProps || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsx(Input$3, {
1375
1375
  "data-read-only": t4,
1376
1376
  "data-error": t5,
1377
+ "data-ui": "Checkbox__input",
1377
1378
  ...restProps,
1378
1379
  checked,
1379
1380
  disabled: t6,
@@ -1461,7 +1462,7 @@ function inputElementStyle(props) {
1461
1462
  var radio = "xgt72i0";
1462
1463
  const Input$2 = /* @__PURE__ */ styled.input.withConfig({
1463
1464
  displayName: "Input",
1464
- componentId: "sc-u4kfaz-0"
1465
+ componentId: "sc-z843so-0"
1465
1466
  })(inputElementStyle);
1466
1467
  /**
1467
1468
  * The `Radio` component allows the user to select one option from a set.
@@ -1479,6 +1480,7 @@ function Radio(props) {
1479
1480
  $[11] !== readOnly || $[12] !== restProps || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 ? (t5 = /* @__PURE__ */ jsx(Input$2, {
1480
1481
  "data-read-only": t2,
1481
1482
  "data-error": t3,
1483
+ "data-ui": "Radio__input",
1482
1484
  ...restProps,
1483
1485
  disabled: t4,
1484
1486
  readOnly,
@@ -1621,13 +1623,13 @@ function switchThumbStyles(props) {
1621
1623
  var switchInput = "cn60s71", switchRoot = "cn60s70";
1622
1624
  const Representation = /* @__PURE__ */ styled.span.withConfig({
1623
1625
  displayName: "Representation",
1624
- componentId: "sc-ymdgpc-0"
1626
+ componentId: "sc-mmkhq5-0"
1625
1627
  })(switchRepresentationStyles), Track = /* @__PURE__ */ styled.span.withConfig({
1626
1628
  displayName: "Track",
1627
- componentId: "sc-ymdgpc-1"
1629
+ componentId: "sc-mmkhq5-1"
1628
1630
  })(switchTrackStyles), Thumb = /* @__PURE__ */ styled.span.withConfig({
1629
1631
  displayName: "Thumb",
1630
- componentId: "sc-ymdgpc-2"
1632
+ componentId: "sc-mmkhq5-2"
1631
1633
  })(switchThumbStyles);
1632
1634
  /**
1633
1635
  * The `Switch` component allows the user to toggle a setting on and off.
@@ -1658,14 +1660,16 @@ function Switch(props) {
1658
1660
  ref
1659
1661
  }), $[15] = restProps, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
1660
1662
  let t8;
1661
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsx(Track, {}), $[20] = t8) : t8 = $[20];
1663
+ $[20] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsx(Track, { "data-ui": "Switch__track" }), $[20] = t8) : t8 = $[20];
1662
1664
  let t9;
1663
1665
  $[21] !== checked || $[22] !== indeterminate ? (t9 = /* @__PURE__ */ jsxs(Representation, {
1664
1666
  "aria-hidden": !0,
1665
1667
  "data-name": "representation",
1668
+ "data-ui": "Switch__representation",
1666
1669
  children: [t8, /* @__PURE__ */ jsx(Thumb, {
1667
1670
  $checked: checked,
1668
- $indeterminate: indeterminate
1671
+ $indeterminate: indeterminate,
1672
+ "data-ui": "Switch__thumb"
1669
1673
  })]
1670
1674
  }), $[21] = checked, $[22] = indeterminate, $[23] = t9) : t9 = $[23];
1671
1675
  let t10;
@@ -1678,10 +1682,10 @@ function Switch(props) {
1678
1682
  }
1679
1683
  const Input = /* @__PURE__ */ styled.textarea.withConfig({
1680
1684
  displayName: "Input",
1681
- componentId: "sc-gtnobm-0"
1685
+ componentId: "sc-vu8ycr-0"
1682
1686
  })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled.div.withConfig({
1683
1687
  displayName: "Presentation",
1684
- componentId: "sc-gtnobm-1"
1688
+ componentId: "sc-vu8ycr-1"
1685
1689
  })(responsiveRadiusStyle, textInputRepresentationStyle);
1686
1690
  /**
1687
1691
  * A multiline text input.
@@ -1705,6 +1709,7 @@ function TextArea(props) {
1705
1709
  "data-as": "textarea",
1706
1710
  "data-scheme": t6,
1707
1711
  "data-tone": t7,
1712
+ "data-ui": "TextArea__input",
1708
1713
  ...restProps,
1709
1714
  $fontSize: t8,
1710
1715
  $padding: t9,
@@ -1725,7 +1730,8 @@ function TextArea(props) {
1725
1730
  $tone: rootTheme.tone,
1726
1731
  "data-border": t14,
1727
1732
  "data-scheme": rootTheme.scheme,
1728
- "data-tone": rootTheme.tone
1733
+ "data-tone": rootTheme.tone,
1734
+ "data-ui": "TextArea__presentation"
1729
1735
  }), $[27] = __unstable_disableFocusRing, $[28] = rootTheme.scheme, $[29] = rootTheme.tone, $[30] = t13, $[31] = t14, $[32] = t15) : t15 = $[32];
1730
1736
  let t16;
1731
1737
  return $[33] !== t12 || $[34] !== t15 ? (t16 = /* @__PURE__ */ jsx("span", {