@sanity/ui 2.0.0-alpha.18 → 2.0.0-alpha.19
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/package.json
CHANGED
|
@@ -70,6 +70,10 @@ export interface TextInputProps {
|
|
|
70
70
|
suffix?: React.ReactNode
|
|
71
71
|
type?: TextInputType
|
|
72
72
|
weight?: ThemeFontWeightKey
|
|
73
|
+
/**
|
|
74
|
+
* @beta
|
|
75
|
+
*/
|
|
76
|
+
unstableDisableFocusRing?: boolean
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
const CLEAR_BUTTON_BOX_STYLE: React.CSSProperties = {zIndex: 2}
|
|
@@ -165,6 +169,7 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
165
169
|
customValidity,
|
|
166
170
|
type = 'text',
|
|
167
171
|
weight,
|
|
172
|
+
unstableDisableFocusRing,
|
|
168
173
|
...restProps
|
|
169
174
|
} = props
|
|
170
175
|
|
|
@@ -221,6 +226,7 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
221
226
|
() => (
|
|
222
227
|
<Presentation
|
|
223
228
|
$hasPrefix={$hasPrefix}
|
|
229
|
+
$unstableDisableFocusRing={unstableDisableFocusRing}
|
|
224
230
|
$hasSuffix={$hasSuffix}
|
|
225
231
|
$radius={radius}
|
|
226
232
|
$scheme={rootTheme.scheme}
|
|
@@ -259,6 +265,7 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
259
265
|
$hasClearButton,
|
|
260
266
|
$hasPrefix,
|
|
261
267
|
$hasSuffix,
|
|
268
|
+
unstableDisableFocusRing,
|
|
262
269
|
],
|
|
263
270
|
)
|
|
264
271
|
|
|
@@ -24,6 +24,7 @@ export interface TextInputRepresentationStyleProps {
|
|
|
24
24
|
$hasSuffix?: boolean
|
|
25
25
|
$scheme: ThemeColorSchemeKey
|
|
26
26
|
$tone: CardTone
|
|
27
|
+
$unstableDisableFocusRing?: boolean
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
const ROOT_STYLE = css`
|
|
@@ -129,7 +130,7 @@ export function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemePr
|
|
|
129
130
|
export function textInputRepresentationStyle(
|
|
130
131
|
props: TextInputRepresentationStyleProps & ThemeProps,
|
|
131
132
|
): ReturnType<typeof css> {
|
|
132
|
-
const {$hasPrefix, $hasSuffix, $scheme, $tone, theme} = props
|
|
133
|
+
const {$hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing, theme} = props
|
|
133
134
|
const {input} = theme.sanity
|
|
134
135
|
const {focusRing} = input.text
|
|
135
136
|
const color = theme.sanity.color.input
|
|
@@ -182,14 +183,18 @@ export function textInputRepresentationStyle(
|
|
|
182
183
|
/* focused */
|
|
183
184
|
*:not(:disabled):focus + & {
|
|
184
185
|
&[data-border] {
|
|
185
|
-
--input-box-shadow: ${
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
--input-box-shadow: ${$unstableDisableFocusRing
|
|
187
|
+
? undefined
|
|
188
|
+
: focusRingStyle({
|
|
189
|
+
border: {color: color.default.enabled.border, width: input.border.width},
|
|
190
|
+
focusRing,
|
|
191
|
+
})};
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
&:not([data-border]) {
|
|
192
|
-
--input-box-shadow: ${
|
|
195
|
+
--input-box-shadow: ${$unstableDisableFocusRing
|
|
196
|
+
? undefined
|
|
197
|
+
: focusRingStyle({focusRing})};
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
200
|
|