@sanity/ui 1.0.0-beta.29 → 1.0.0-beta.30

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "1.0.0-beta.29",
3
+ "version": "1.0.0-beta.30",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/types/src/index.d.ts",
6
6
  "source": "./src/index.ts",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@floating-ui/react-dom": "^1.0.0",
36
- "@sanity/color": "2.1.19-beta.0",
37
- "@sanity/icons": "1.3.9-beta.0",
36
+ "@sanity/color": "2.1.19-beta.1",
37
+ "@sanity/icons": "1.3.9-beta.1",
38
38
  "framer-motion": "^7.5.3",
39
39
  "react-refractor": "^2.1.7"
40
40
  },
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "ce4a5a2a78b3368407da8910038c5cc19e3b9a2d"
72
+ "gitHead": "9555be81dc9d9ad2997ab34ecb59c91ec0b27a49"
73
73
  }
@@ -89,10 +89,10 @@ export const TextArea = forwardRef(function TextArea(
89
89
  ref={ref}
90
90
  />
91
91
  <Presentation
92
- $border={border}
93
92
  $radius={useArrayProp(radius)}
94
93
  $scheme={rootTheme.scheme}
95
94
  $tone={rootTheme.tone}
95
+ data-border={border ? '' : undefined}
96
96
  data-scheme={rootTheme.scheme}
97
97
  data-tone={rootTheme.tone}
98
98
  />
@@ -211,12 +211,12 @@ export const TextInput = forwardRef(function TextInput(
211
211
  const presentationNode = useMemo(
212
212
  () => (
213
213
  <Presentation
214
- $border={border}
215
214
  $hasPrefix={$hasPrefix}
216
215
  $hasSuffix={$hasSuffix}
217
216
  $radius={radius}
218
217
  $scheme={rootTheme.scheme}
219
218
  $tone={rootTheme.tone}
219
+ data-border={border ? '' : undefined}
220
220
  data-scheme={rootTheme.scheme}
221
221
  data-tone={rootTheme.tone}
222
222
  >
@@ -19,7 +19,6 @@ export interface TextInputInputStyleProps {
19
19
  * @internal
20
20
  */
21
21
  export interface TextInputRepresentationStyleProps {
22
- $border?: boolean
23
22
  $hasPrefix?: boolean
24
23
  $hasSuffix?: boolean
25
24
  $scheme: ThemeColorSchemeKey
@@ -129,7 +128,7 @@ export function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemePr
129
128
  export function textInputRepresentationStyle(
130
129
  props: TextInputRepresentationStyleProps & ThemeProps
131
130
  ): FlattenSimpleInterpolation {
132
- const {$border, $hasPrefix, $hasSuffix, $scheme, $tone, theme} = props
131
+ const {$hasPrefix, $hasSuffix, $scheme, $tone, theme} = props
133
132
  const {focusRing, input} = theme.sanity
134
133
  const color = theme.sanity.color.input
135
134
 
@@ -158,41 +157,51 @@ export function textInputRepresentationStyle(
158
157
  --card-fg-color: ${color.default.enabled.fg};
159
158
 
160
159
  /* enabled */
161
- *:not(:disabled) + & {
162
- --input-box-shadow: ${$border
163
- ? focusRingBorderStyle({color: color.default.enabled.border, width: input.border.width})
164
- : undefined};
160
+ *:not(:disabled) + &[data-border] {
161
+ --input-box-shadow: ${focusRingBorderStyle({
162
+ color: color.default.enabled.border,
163
+ width: input.border.width,
164
+ })};
165
165
  }
166
166
 
167
167
  /* invalid */
168
168
  *:not(:disabled):invalid + & {
169
169
  --card-bg-color: ${color.invalid.enabled.bg};
170
170
  --card-fg-color: ${color.invalid.enabled.fg};
171
- --input-box-shadow: ${$border
172
- ? focusRingBorderStyle({color: color.invalid.enabled.border, width: input.border.width})
173
- : 'none'};
171
+
172
+ &[data-border] {
173
+ --input-box-shadow: ${focusRingBorderStyle({
174
+ color: color.invalid.enabled.border,
175
+ width: input.border.width,
176
+ })};
177
+ }
174
178
  }
175
179
 
176
180
  /* focused */
177
181
  *:not(:disabled):focus + & {
178
- --input-box-shadow: ${focusRingStyle({
179
- border: $border
180
- ? {color: color.default.enabled.border, width: input.border.width}
181
- : undefined,
182
- focusRing,
183
- })};
182
+ &[data-border] {
183
+ --input-box-shadow: ${focusRingStyle({
184
+ border: {color: color.default.enabled.border, width: input.border.width},
185
+ focusRing,
186
+ })};
187
+ }
188
+
189
+ &:not([data-border]) {
190
+ --input-box-shadow: ${focusRingStyle({focusRing})};
191
+ }
184
192
  }
185
193
 
186
194
  /* disabled */
187
195
  *:disabled + & {
188
196
  --card-bg-color: ${color.default.disabled.bg} !important;
189
197
  --card-fg-color: ${color.default.disabled.fg} !important;
190
- --input-box-shadow: ${$border
191
- ? focusRingBorderStyle({
192
- color: color.default.disabled.border,
193
- width: input.border.width,
194
- })
195
- : 'none'};
198
+
199
+ &[data-border] {
200
+ --input-box-shadow: ${focusRingBorderStyle({
201
+ color: color.default.disabled.border,
202
+ width: input.border.width,
203
+ })};
204
+ }
196
205
  }
197
206
 
198
207
  /* readOnly */
@@ -208,13 +217,11 @@ export function textInputRepresentationStyle(
208
217
  --card-fg-color: ${color.default.hovered.fg};
209
218
  }
210
219
 
211
- *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + & {
212
- --input-box-shadow: ${$border
213
- ? focusRingBorderStyle({
214
- color: color.default.hovered.border,
215
- width: input.border.width,
216
- })
217
- : 'none'};
220
+ *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
221
+ --input-box-shadow: ${focusRingBorderStyle({
222
+ color: color.default.hovered.border,
223
+ width: input.border.width,
224
+ })};
218
225
  }
219
226
  }
220
227
  }