1
1
import { transparentize } from '../tools' ;
2
2
const baseStyle = ( props : any ) => {
3
- const { primary } = props . theme . colors ;
3
+ const { primary, error } = props . theme . colors ;
4
4
5
5
return {
6
6
fontFamily : 'body' ,
@@ -47,6 +47,24 @@ const baseStyle = (props: any) => {
47
47
} ,
48
48
_invalid : {
49
49
borderColor : 'error.600' ,
50
+ _hover : { borderColor : 'error.600' } ,
51
+ _focus : {
52
+ borderColor : 'error.600' ,
53
+ _stack : {
54
+ style : {
55
+ outlineWidth : '1px' ,
56
+ outlineColor : `${ props . inValidOutlineColor || error [ 600 ] } ` ,
57
+ outlineStyle : 'solid' ,
58
+ } ,
59
+ } ,
60
+ } ,
61
+ _stack : {
62
+ style : {
63
+ outlineWidth : '1px' ,
64
+ outlineColor : `${ props . inValidOutlineColor || error [ 600 ] } ` ,
65
+ outlineStyle : 'solid' ,
66
+ } ,
67
+ } ,
50
68
} ,
51
69
_ios : {
52
70
selectionColor : 'coolGray.800' ,
@@ -86,6 +104,24 @@ const baseStyle = (props: any) => {
86
104
} ,
87
105
_invalid : {
88
106
borderColor : 'error.500' ,
107
+ _stack : {
108
+ style : {
109
+ outlineWidth : '1px' ,
110
+ outlineColor : `${ props . inValidOutlineColor || error [ 500 ] } ` ,
111
+ outlineStyle : 'solid' ,
112
+ } ,
113
+ } ,
114
+ _hover : { borderColor : 'error.500' } ,
115
+ _focus : {
116
+ borderColor : 'error.500' ,
117
+ _stack : {
118
+ style : {
119
+ outlineWidth : '1px' ,
120
+ outlineColor : `${ props . inValidOutlineColor || error [ 500 ] } ` ,
121
+ outlineStyle : 'solid' ,
122
+ } ,
123
+ } ,
124
+ } ,
89
125
} ,
90
126
_ios : {
91
127
selectionColor : 'warmGray.50' ,
@@ -117,9 +153,6 @@ function roundedStyle(props: Record<string, any>) {
117
153
_focus : {
118
154
bg : transparentize ( 'primary.600' , 0.1 ) ( theme ) ,
119
155
} ,
120
- _invalid : {
121
- borderWidth : '2' ,
122
- } ,
123
156
} ;
124
157
}
125
158
function outlineStyle ( props : Record < string , any > ) {
@@ -129,9 +162,6 @@ function outlineStyle(props: Record<string, any>) {
129
162
_focus : {
130
163
bg : transparentize ( 'primary.600' , 0.1 ) ( theme ) ,
131
164
} ,
132
- _invalid : {
133
- borderWidth : '2' ,
134
- } ,
135
165
} ;
136
166
}
137
167
function filledStyle ( props : Record < string , any > ) {
@@ -147,9 +177,6 @@ function filledStyle(props: Record<string, any>) {
147
177
borderWidth : 0 ,
148
178
} ,
149
179
} ,
150
- _invalid : {
151
- borderWidth : '2' ,
152
- } ,
153
180
_light : {
154
181
bg : 'muted.100' ,
155
182
borderColor : 'muted.100' ,
@@ -172,6 +199,13 @@ function unstyledStyle() {
172
199
_focus : {
173
200
bg : 'transparent' ,
174
201
} ,
202
+ _invalid : {
203
+ _stack : {
204
+ style : {
205
+ outlineWidth : 0 ,
206
+ } ,
207
+ } ,
208
+ } ,
175
209
_stack : {
176
210
_focus : {
177
211
style : {
@@ -182,35 +216,64 @@ function unstyledStyle() {
182
216
} ;
183
217
}
184
218
function underlinedStyle ( props : Record < string , any > ) {
185
- const { primary } = props . theme . colors ;
219
+ const { primary, error } = props . theme . colors ;
186
220
187
221
return {
188
222
borderWidth : '0' ,
189
223
pl : '0' ,
190
224
borderBottomWidth : '1' ,
191
225
_light : {
192
- _stack : {
193
- _focus : {
226
+ _focus : {
227
+ _stack : {
194
228
style : {
195
229
outlineWidth : '0' ,
196
230
boxShadow : `0 1px 0 0 ${ props . focusOutlineColor || primary [ 600 ] } ` ,
197
231
} ,
198
232
} ,
233
+ _invalid : {
234
+ _stack : {
235
+ style : {
236
+ boxShadow : `0 1px 0 0 ${ props . inValidOutlineColor || error [ 600 ] } ` ,
237
+ } ,
238
+ } ,
239
+ } ,
240
+ } ,
241
+ _invalid : {
242
+ _stack : {
243
+ style : {
244
+ outlineWidth : 0 ,
245
+ boxShadow : `0 1px 0 0 ${ props . inValidOutlineColor || error [ 600 ] } ` ,
246
+ } ,
247
+ } ,
199
248
} ,
200
249
} ,
201
250
_dark : {
202
- _stack : {
203
- _focus : {
251
+ _focus : {
252
+ _stack : {
204
253
style : {
205
254
outlineWidth : '0' ,
206
255
boxShadow : `0 1px 0 0 ${ props . focusOutlineColor || primary [ 500 ] } ` ,
207
256
} ,
208
257
} ,
258
+ _invalid : {
259
+ _stack : {
260
+ style : {
261
+ outlineWidth : 0 ,
262
+ boxShadow : `0 1px 0 0 ${ props . inValidOutlineColor || error [ 500 ] } ` ,
263
+ } ,
264
+ } ,
265
+ } ,
266
+ } ,
267
+ _invalid : {
268
+ _stack : {
269
+ style : {
270
+ outlineWidth : 0 ,
271
+ boxShadow : `0 1px 0 0 ${ props . focusOutlineColor || error [ 500 ] } ` ,
272
+ } ,
273
+ } ,
209
274
} ,
210
275
} ,
211
- _invalid : {
212
- borderBottomWidth : '2' ,
213
- } ,
276
+
214
277
borderRadius : 0 ,
215
278
} ;
216
279
}
0 commit comments