@sanity/ui 0.37.15 → 0.37.16
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.
- package/lib/dts/src/primitives/textArea/textArea.d.ts.map +1 -1
- package/lib/dts/src/primitives/textInput/textInput.d.ts.map +1 -1
- package/lib/dts/src/styles/input/textInputStyle.d.ts +3 -1
- package/lib/dts/src/styles/input/textInputStyle.d.ts.map +1 -1
- package/lib/sanity-ui.js +11 -3
- package/lib/sanity-ui.js.map +1 -1
- package/lib/sanity-ui.modern.mjs +13 -5
- package/lib/sanity-ui.modern.mjs.map +1 -1
- package/lib/sanity-ui.module.js +11 -3
- package/lib/sanity-ui.module.js.map +1 -1
- package/package.json +2 -2
- package/src/primitives/textArea/textArea.tsx +2 -0
- package/src/primitives/textInput/__workshop__/tones.tsx +222 -105
- package/src/primitives/textInput/textInput.tsx +5 -1
- package/src/styles/input/textInputStyle.ts +7 -5
package/lib/sanity-ui.modern.mjs
CHANGED
|
@@ -3668,6 +3668,7 @@ function textInputRootStyle() {
|
|
|
3668
3668
|
function textInputBaseStyle(props) {
|
|
3669
3669
|
const {
|
|
3670
3670
|
theme,
|
|
3671
|
+
$scheme,
|
|
3671
3672
|
$tone,
|
|
3672
3673
|
$weight
|
|
3673
3674
|
} = props;
|
|
@@ -3709,7 +3710,7 @@ function textInputBaseStyle(props) {
|
|
|
3709
3710
|
color: var(--input-placeholder-color);
|
|
3710
3711
|
}
|
|
3711
3712
|
|
|
3712
|
-
&[data-tone='${0}'] {
|
|
3713
|
+
&[data-scheme='${0}'][data-tone='${0}'] {
|
|
3713
3714
|
--input-fg-color: ${0};
|
|
3714
3715
|
--input-placeholder-color: ${0};
|
|
3715
3716
|
|
|
@@ -3737,7 +3738,7 @@ function textInputBaseStyle(props) {
|
|
|
3737
3738
|
--input-placeholder-color: ${0};
|
|
3738
3739
|
}
|
|
3739
3740
|
}
|
|
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);
|
|
3741
|
+
`), 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
3742
|
}
|
|
3742
3743
|
function textInputFontSizeStyle(props) {
|
|
3743
3744
|
const {
|
|
@@ -3760,6 +3761,7 @@ function textInputRepresentationStyle(props) {
|
|
|
3760
3761
|
$border,
|
|
3761
3762
|
$hasPrefix,
|
|
3762
3763
|
$hasSuffix,
|
|
3764
|
+
$scheme,
|
|
3763
3765
|
$tone,
|
|
3764
3766
|
theme
|
|
3765
3767
|
} = props;
|
|
@@ -3788,7 +3790,7 @@ function textInputRepresentationStyle(props) {
|
|
|
3788
3790
|
border-top-right-radius: ${0};
|
|
3789
3791
|
border-bottom-right-radius: ${0};
|
|
3790
3792
|
|
|
3791
|
-
&[data-tone='${0}'] {
|
|
3793
|
+
&[data-scheme='${0}'][data-tone='${0}'] {
|
|
3792
3794
|
--card-bg-color: ${0};
|
|
3793
3795
|
--card-fg-color: ${0};
|
|
3794
3796
|
|
|
@@ -3834,7 +3836,7 @@ function textInputRepresentationStyle(props) {
|
|
|
3834
3836
|
}
|
|
3835
3837
|
}
|
|
3836
3838
|
}
|
|
3837
|
-
`), $hasPrefix ? 0 : undefined, $hasPrefix ? 0 : undefined, $hasSuffix ? 0 : undefined, $hasSuffix ? 0 : undefined, $tone, color.default.enabled.bg, color.default.enabled.fg, $border ? focusRingBorderStyle({
|
|
3839
|
+
`), $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
3840
|
color: color.default.enabled.border,
|
|
3839
3841
|
width: input.border.width
|
|
3840
3842
|
}) : undefined, color.invalid.enabled.bg, color.invalid.enabled.fg, $border ? focusRingBorderStyle({
|
|
@@ -7526,6 +7528,7 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(props, forwardedRef)
|
|
|
7526
7528
|
}, restProps, {
|
|
7527
7529
|
"$fontSize": useArrayProp(fontSize),
|
|
7528
7530
|
"$padding": useArrayProp(padding),
|
|
7531
|
+
"$scheme": rootTheme.scheme,
|
|
7529
7532
|
"$space": useArrayProp(0),
|
|
7530
7533
|
"$tone": rootTheme.tone,
|
|
7531
7534
|
"$weight": weight,
|
|
@@ -7534,6 +7537,7 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(props, forwardedRef)
|
|
|
7534
7537
|
})), /*#__PURE__*/React.createElement(Presentation$1, {
|
|
7535
7538
|
"$border": border,
|
|
7536
7539
|
"$radius": useArrayProp(radius),
|
|
7540
|
+
"$scheme": rootTheme.scheme,
|
|
7537
7541
|
"$tone": rootTheme.tone,
|
|
7538
7542
|
"data-tone": rootTheme.tone
|
|
7539
7543
|
})));
|
|
@@ -7667,7 +7671,9 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
|
|
|
7667
7671
|
"$hasPrefix": $hasPrefix,
|
|
7668
7672
|
"$hasSuffix": $hasSuffix,
|
|
7669
7673
|
"$radius": radius,
|
|
7674
|
+
"$scheme": rootTheme.scheme,
|
|
7670
7675
|
"$tone": rootTheme.tone,
|
|
7676
|
+
"data-scheme": rootTheme.scheme,
|
|
7671
7677
|
"data-tone": rootTheme.tone
|
|
7672
7678
|
}, icon && /*#__PURE__*/React.createElement(LeftBox, {
|
|
7673
7679
|
padding: padding
|
|
@@ -7677,7 +7683,7 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
|
|
|
7677
7683
|
padding: padding
|
|
7678
7684
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
7679
7685
|
size: fontSize
|
|
7680
|
-
}, /*#__PURE__*/isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && /*#__PURE__*/createElement(iconRight)))), [border, fontSize, icon, iconRight, padding, radius, rootTheme
|
|
7686
|
+
}, /*#__PURE__*/isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && /*#__PURE__*/createElement(iconRight)))), [border, fontSize, icon, iconRight, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]); // Render clear button (memoized)
|
|
7681
7687
|
|
|
7682
7688
|
const clearButtonBoxPadding = useMemo(() => padding.map(v => {
|
|
7683
7689
|
if (v === 0) return 0;
|
|
@@ -7722,12 +7728,14 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
|
|
|
7722
7728
|
tone: rootTheme.tone
|
|
7723
7729
|
}, prefixNode, /*#__PURE__*/React.createElement(InputRoot, null, /*#__PURE__*/React.createElement(Input, _extends({
|
|
7724
7730
|
"data-as": "input",
|
|
7731
|
+
"data-scheme": rootTheme.scheme,
|
|
7725
7732
|
"data-tone": rootTheme.tone
|
|
7726
7733
|
}, restProps, {
|
|
7727
7734
|
"$fontSize": fontSize,
|
|
7728
7735
|
"$iconLeft": $hasIcon,
|
|
7729
7736
|
"$iconRight": $hasIconRight || $hasClearButton,
|
|
7730
7737
|
"$padding": padding,
|
|
7738
|
+
"$scheme": rootTheme.scheme,
|
|
7731
7739
|
"$space": space,
|
|
7732
7740
|
"$tone": rootTheme.tone,
|
|
7733
7741
|
"$weight": weight,
|