@sanity/ui 0.37.15 → 0.37.18

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.
@@ -1884,18 +1884,20 @@ const color = createColorTheme({
1884
1884
  name
1885
1885
  }) => {
1886
1886
  if (name === 'default') {
1887
- const _skeletonFrom = dark ? hues.gray[900].hex : hues.gray[100].hex;
1887
+ const _tints = hues.gray;
1888
+
1889
+ const _skeletonFrom = dark ? _tints[900].hex : _tints[100].hex;
1888
1890
 
1889
1891
  return {
1890
1892
  fg: dark ? white$1.hex : black$1.hex,
1891
1893
  bg: dark ? black$1.hex : white$1.hex,
1892
- border: hues.gray[dark ? 800 : 200].hex,
1894
+ border: _tints[dark ? 800 : 200].hex,
1893
1895
  focusRing: hues.blue[dark ? 500 : 500].hex,
1894
1896
  shadow: {
1895
- outline: rgba(hues.gray[500].hex, 0.4),
1896
- umbra: rgba(dark ? black$1.hex : hues.gray[500].hex, 0.2),
1897
- penumbra: rgba(dark ? black$1.hex : hues.gray[500].hex, 0.14),
1898
- ambient: rgba(dark ? black$1.hex : hues.gray[500].hex, 0.12)
1897
+ outline: rgba(_tints[500].hex, 0.4),
1898
+ umbra: dark ? rgba(_tints[950].hex, 0.4) : rgba(_tints[500].hex, 0.2),
1899
+ penumbra: dark ? rgba(_tints[950].hex, 0.28) : rgba(_tints[500].hex, 0.14),
1900
+ ambient: dark ? rgba(_tints[950].hex, 0.24) : rgba(_tints[500].hex, 0.12)
1899
1901
  },
1900
1902
  skeleton: {
1901
1903
  from: _skeletonFrom,
@@ -1905,18 +1907,18 @@ const color = createColorTheme({
1905
1907
  }
1906
1908
 
1907
1909
  if (name === 'transparent') {
1908
- const _tints = tones.default;
1909
- const _skeletonFrom2 = _tints[dark ? 800 : 200].hex;
1910
+ const _tints2 = tones.default;
1911
+ const _skeletonFrom2 = _tints2[dark ? 800 : 200].hex;
1910
1912
  return {
1911
- fg: _tints[dark ? 100 : 900].hex,
1912
- bg: _tints[dark ? 950 : 50].hex,
1913
- border: _tints[dark ? 800 : 300].hex,
1913
+ fg: _tints2[dark ? 100 : 900].hex,
1914
+ bg: _tints2[dark ? 950 : 50].hex,
1915
+ border: _tints2[dark ? 800 : 300].hex,
1914
1916
  focusRing: hues.blue[500].hex,
1915
1917
  shadow: {
1916
- outline: rgba(_tints[500].hex, dark ? 0.2 : 0.4),
1917
- umbra: rgba(dark ? black$1.hex : _tints[500].hex, 0.2),
1918
- penumbra: rgba(dark ? black$1.hex : _tints[500].hex, 0.14),
1919
- ambient: rgba(dark ? black$1.hex : _tints[500].hex, 0.12)
1918
+ outline: rgba(_tints2[500].hex, 0.4),
1919
+ umbra: dark ? rgba(_tints2[900].hex, 0.4) : rgba(_tints2[500].hex, 0.2),
1920
+ penumbra: dark ? rgba(_tints2[900].hex, 0.28) : rgba(_tints2[500].hex, 0.14),
1921
+ ambient: dark ? rgba(_tints2[900].hex, 0.24) : rgba(_tints2[500].hex, 0.12)
1920
1922
  },
1921
1923
  skeleton: {
1922
1924
  from: _skeletonFrom2,
@@ -1933,10 +1935,10 @@ const color = createColorTheme({
1933
1935
  border: tints[dark ? 800 : 200].hex,
1934
1936
  focusRing: tints[500].hex,
1935
1937
  shadow: {
1936
- outline: rgba(tints[500].hex, dark ? 0.2 : 0.4),
1937
- umbra: rgba(dark ? black$1.hex : tints[500].hex, 0.2),
1938
- penumbra: rgba(dark ? black$1.hex : tints[500].hex, 0.14),
1939
- ambient: rgba(dark ? black$1.hex : tints[500].hex, 0.12)
1938
+ outline: rgba(tints[500].hex, 0.4),
1939
+ umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
1940
+ penumbra: dark ? rgba(tints[900].hex, 0.28) : rgba(tints[500].hex, 0.14),
1941
+ ambient: dark ? rgba(tints[900].hex, 0.24) : rgba(tints[500].hex, 0.12)
1940
1942
  },
1941
1943
  skeleton: {
1942
1944
  from: skeletonFrom,
@@ -3668,6 +3670,7 @@ function textInputRootStyle() {
3668
3670
  function textInputBaseStyle(props) {
3669
3671
  const {
3670
3672
  theme,
3673
+ $scheme,
3671
3674
  $tone,
3672
3675
  $weight
3673
3676
  } = props;
@@ -3709,7 +3712,7 @@ function textInputBaseStyle(props) {
3709
3712
  color: var(--input-placeholder-color);
3710
3713
  }
3711
3714
 
3712
- &[data-tone='${0}'] {
3715
+ &[data-scheme='${0}'][data-tone='${0}'] {
3713
3716
  --input-fg-color: ${0};
3714
3717
  --input-placeholder-color: ${0};
3715
3718
 
@@ -3737,7 +3740,7 @@ function textInputBaseStyle(props) {
3737
3740
  --input-placeholder-color: ${0};
3738
3741
  }
3739
3742
  }
3740
- `), font.family, $weight && font.weights[$weight] || font.weights.regular, $tone, color.default.enabled.fg, color.default.enabled.placeholder, color.default.enabled.fg, color.default.enabled.placeholder, color.default.disabled.fg, color.default.disabled.placeholder, color.invalid.enabled.fg, color.invalid.enabled.placeholder, color.default.readOnly.fg, color.default.readOnly.placeholder);
3743
+ `), font.family, $weight && font.weights[$weight] || font.weights.regular, $scheme, $tone, color.default.enabled.fg, color.default.enabled.placeholder, color.default.enabled.fg, color.default.enabled.placeholder, color.default.disabled.fg, color.default.disabled.placeholder, color.invalid.enabled.fg, color.invalid.enabled.placeholder, color.default.readOnly.fg, color.default.readOnly.placeholder);
3741
3744
  }
3742
3745
  function textInputFontSizeStyle(props) {
3743
3746
  const {
@@ -3760,6 +3763,7 @@ function textInputRepresentationStyle(props) {
3760
3763
  $border,
3761
3764
  $hasPrefix,
3762
3765
  $hasSuffix,
3766
+ $scheme,
3763
3767
  $tone,
3764
3768
  theme
3765
3769
  } = props;
@@ -3788,7 +3792,7 @@ function textInputRepresentationStyle(props) {
3788
3792
  border-top-right-radius: ${0};
3789
3793
  border-bottom-right-radius: ${0};
3790
3794
 
3791
- &[data-tone='${0}'] {
3795
+ &[data-scheme='${0}'][data-tone='${0}'] {
3792
3796
  --card-bg-color: ${0};
3793
3797
  --card-fg-color: ${0};
3794
3798
 
@@ -3834,7 +3838,7 @@ function textInputRepresentationStyle(props) {
3834
3838
  }
3835
3839
  }
3836
3840
  }
3837
- `), $hasPrefix ? 0 : undefined, $hasPrefix ? 0 : undefined, $hasSuffix ? 0 : undefined, $hasSuffix ? 0 : undefined, $tone, color.default.enabled.bg, color.default.enabled.fg, $border ? focusRingBorderStyle({
3841
+ `), $hasPrefix ? 0 : undefined, $hasPrefix ? 0 : undefined, $hasSuffix ? 0 : undefined, $hasSuffix ? 0 : undefined, $scheme, $tone, color.default.enabled.bg, color.default.enabled.fg, $border ? focusRingBorderStyle({
3838
3842
  color: color.default.enabled.border,
3839
3843
  width: input.border.width
3840
3844
  }) : undefined, color.invalid.enabled.bg, color.invalid.enabled.fg, $border ? focusRingBorderStyle({
@@ -7522,10 +7526,12 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(props, forwardedRef)
7522
7526
  "data-ui": "TextArea"
7523
7527
  }, /*#__PURE__*/React.createElement(InputRoot$1, null, /*#__PURE__*/React.createElement(Input$1, _extends({
7524
7528
  "data-as": "textarea",
7529
+ "data-scheme": rootTheme.scheme,
7525
7530
  "data-tone": rootTheme.tone
7526
7531
  }, restProps, {
7527
7532
  "$fontSize": useArrayProp(fontSize),
7528
7533
  "$padding": useArrayProp(padding),
7534
+ "$scheme": rootTheme.scheme,
7529
7535
  "$space": useArrayProp(0),
7530
7536
  "$tone": rootTheme.tone,
7531
7537
  "$weight": weight,
@@ -7534,7 +7540,9 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(props, forwardedRef)
7534
7540
  })), /*#__PURE__*/React.createElement(Presentation$1, {
7535
7541
  "$border": border,
7536
7542
  "$radius": useArrayProp(radius),
7543
+ "$scheme": rootTheme.scheme,
7537
7544
  "$tone": rootTheme.tone,
7545
+ "data-scheme": rootTheme.scheme,
7538
7546
  "data-tone": rootTheme.tone
7539
7547
  })));
7540
7548
  });
@@ -7667,7 +7675,9 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
7667
7675
  "$hasPrefix": $hasPrefix,
7668
7676
  "$hasSuffix": $hasSuffix,
7669
7677
  "$radius": radius,
7678
+ "$scheme": rootTheme.scheme,
7670
7679
  "$tone": rootTheme.tone,
7680
+ "data-scheme": rootTheme.scheme,
7671
7681
  "data-tone": rootTheme.tone
7672
7682
  }, icon && /*#__PURE__*/React.createElement(LeftBox, {
7673
7683
  padding: padding
@@ -7677,7 +7687,7 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
7677
7687
  padding: padding
7678
7688
  }, /*#__PURE__*/React.createElement(Text, {
7679
7689
  size: fontSize
7680
- }, /*#__PURE__*/isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && /*#__PURE__*/createElement(iconRight)))), [border, fontSize, icon, iconRight, padding, radius, rootTheme.tone, $hasClearButton, $hasPrefix, $hasSuffix]); // Render clear button (memoized)
7690
+ }, /*#__PURE__*/isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && /*#__PURE__*/createElement(iconRight)))), [border, fontSize, icon, iconRight, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]); // Render clear button (memoized)
7681
7691
 
7682
7692
  const clearButtonBoxPadding = useMemo(() => padding.map(v => {
7683
7693
  if (v === 0) return 0;
@@ -7722,12 +7732,14 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
7722
7732
  tone: rootTheme.tone
7723
7733
  }, prefixNode, /*#__PURE__*/React.createElement(InputRoot, null, /*#__PURE__*/React.createElement(Input, _extends({
7724
7734
  "data-as": "input",
7735
+ "data-scheme": rootTheme.scheme,
7725
7736
  "data-tone": rootTheme.tone
7726
7737
  }, restProps, {
7727
7738
  "$fontSize": fontSize,
7728
7739
  "$iconLeft": $hasIcon,
7729
7740
  "$iconRight": $hasIconRight || $hasClearButton,
7730
7741
  "$padding": padding,
7742
+ "$scheme": rootTheme.scheme,
7731
7743
  "$space": space,
7732
7744
  "$tone": rootTheme.tone,
7733
7745
  "$weight": weight,
@@ -8710,7 +8722,7 @@ function dialogStyle({
8710
8722
  alignItems: 'center',
8711
8723
  justifyContent: 'center',
8712
8724
  outline: 'none',
8713
- background: color.shadow.penumbra
8725
+ background: color.shadow.umbra
8714
8726
  };
8715
8727
  }
8716
8728
  function responsiveDialogPositionStyle(props) {