1
- import { transparentize } from '../tools' ;
2
-
3
- const baseStyle = ( ) => {
4
- // const { primary } = props.theme.colors;
5
- // Todo: Resolve boxShadow Color or Provide some alternatiove prop for user to change focusRing color
6
- // // Todo: Update to support similar focusRing on iOS , Android and Web
7
- // const focusRing =
8
- // Platform.OS === 'web'
9
- // ? {
10
- // boxShadow:
11
- // props.variant !== 'underlined'
12
- // ? `${primary[400]} 0px 0px 0px 1px`
13
- // : `${primary[400]} 0px 1px 0px 0px`,
14
- // zIndex: 1,
15
- // }
16
- // : {
17
- // // boxShadow: `${useToken('colors', ['primary.400'])} 0px 0px 0px 1px`,
18
- // };
1
+ import { transparentize , mode } from '../tools' ;
19
2
3
+ const baseStyle = ( props : any ) => {
4
+ const { primary } = props . theme . colors ;
5
+ const focusRing = mode (
6
+ {
7
+ outlineWidth : '1px' ,
8
+ outlineColor : `${ primary [ 600 ] } ` ,
9
+ outlineStyle : 'solid' ,
10
+ } ,
11
+ {
12
+ outlineWidth : '1px' ,
13
+ outlineColor : `${ primary [ 500 ] } ` ,
14
+ outlineStyle : 'solid' ,
15
+ }
16
+ ) ( props ) ;
20
17
return {
21
18
fontFamily : 'body' ,
22
19
py : '2' ,
@@ -37,12 +34,7 @@ const baseStyle = () => {
37
34
style : { outline : 'none' } ,
38
35
cursor : 'auto' ,
39
36
} ,
40
- _stack : {
41
- flexDirection : 'row' ,
42
- alignItems : 'center' ,
43
- // justifyContent: 'space-between',
44
- overflow : 'hidden' ,
45
- } ,
37
+
46
38
_input : {
47
39
bg : 'transparent' ,
48
40
flex : 1 ,
@@ -72,6 +64,15 @@ const baseStyle = () => {
72
64
borderColor : 'muted.300' ,
73
65
} ,
74
66
} ,
67
+ _stack : {
68
+ flexDirection : 'row' ,
69
+ alignItems : 'center' ,
70
+ // justifyContent: 'space-between',
71
+ overflow : 'hidden' ,
72
+ _focus : {
73
+ style : { ...focusRing } ,
74
+ } ,
75
+ } ,
75
76
} ,
76
77
_dark : {
77
78
placeholderTextColor : 'text.600' ,
@@ -98,6 +99,15 @@ const baseStyle = () => {
98
99
borderColor : 'muted.700' ,
99
100
} ,
100
101
} ,
102
+ _stack : {
103
+ flexDirection : 'row' ,
104
+ alignItems : 'center' ,
105
+ // justifyContent: 'space-between',
106
+ overflow : 'hidden' ,
107
+ _focus : {
108
+ style : { ...focusRing } ,
109
+ } ,
110
+ } ,
101
111
} ,
102
112
} ;
103
113
} ;
@@ -108,7 +118,6 @@ function roundedStyle(props: Record<string, any>) {
108
118
borderRadius : 'full' ,
109
119
borderWidth : '1' ,
110
120
_focus : {
111
- borderWidth : '2' ,
112
121
bg : transparentize ( 'primary.600' , 0.1 ) ( theme ) ,
113
122
} ,
114
123
_invalid : {
@@ -121,7 +130,6 @@ function outlineStyle(props: Record<string, any>) {
121
130
return {
122
131
borderWidth : '1' ,
123
132
_focus : {
124
- borderWidth : '2' ,
125
133
bg : transparentize ( 'primary.600' , 0.1 ) ( theme ) ,
126
134
} ,
127
135
_invalid : {
@@ -132,10 +140,8 @@ function outlineStyle(props: Record<string, any>) {
132
140
function filledStyle ( props : Record < string , any > ) {
133
141
const { theme } = props ;
134
142
return {
135
- borderWidth : '0' ,
136
- borderColor : 'transparent' ,
143
+ borderWidth : '1' ,
137
144
_focus : {
138
- borderWidth : '2' ,
139
145
bg : transparentize ( 'primary.600' , 0.1 ) ( theme ) ,
140
146
} ,
141
147
_hover : {
@@ -149,9 +155,11 @@ function filledStyle(props: Record<string, any>) {
149
155
} ,
150
156
_light : {
151
157
bg : 'muted.100' ,
158
+ borderColor : 'muted.100' ,
152
159
} ,
153
160
_dark : {
154
161
bg : 'muted.800' ,
162
+ borderColor : 'muted.800' ,
155
163
} ,
156
164
} ;
157
165
}
@@ -167,16 +175,27 @@ function unstyledStyle() {
167
175
_focus : {
168
176
bg : 'transparent' ,
169
177
} ,
178
+ _stack : {
179
+ _focus : {
180
+ style : {
181
+ outlineWidth : '0' ,
182
+ } ,
183
+ } ,
184
+ } ,
170
185
} ;
171
186
}
172
187
function underlinedStyle ( ) {
173
188
return {
174
189
borderWidth : '0' ,
175
190
pl : '0' ,
176
191
borderBottomWidth : '1' ,
177
- _focus : {
178
- borderBottomWidth : '2' ,
179
- fontWeight : '500' ,
192
+ _stack : {
193
+ _focus : {
194
+ style : {
195
+ outlineWidth : '0' ,
196
+ boxShadow : '0 1px 0 0 #0891B2' ,
197
+ } ,
198
+ } ,
180
199
} ,
181
200
_invalid : {
182
201
borderBottomWidth : '2' ,
0 commit comments