react-native-varia 0.2.3 → 0.3.0
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/bin/cli.js +24 -34
- package/lib/components/Accordion.tsx +113 -0
- package/lib/components/Button.tsx +16 -3
- package/lib/components/Checkbox.tsx +12 -7
- package/lib/components/CircleProgress.tsx +30 -21
- package/lib/components/Divider.tsx +23 -19
- package/lib/components/Drawer.tsx +23 -69
- package/lib/components/Field.tsx +24 -39
- package/lib/components/GradientBackground.tsx +25 -7
- package/lib/components/GradientText.tsx +61 -21
- package/lib/components/IconWrapper.tsx +20 -14
- package/lib/components/Input.tsx +107 -25
- package/lib/components/Modal.tsx +4 -10
- package/lib/components/NumberInput.tsx +54 -11
- package/lib/components/OldSlider.tsx +327 -0
- package/lib/components/RadioGroup.tsx +58 -18
- package/lib/components/ReText.tsx +1 -1
- package/lib/components/Select.tsx +58 -22
- package/lib/components/Slider.tsx +273 -138
- package/lib/components/Slideshow.tsx +65 -63
- package/lib/components/SlidingDrawer.tsx +20 -21
- package/lib/components/Spinner.tsx +13 -5
- package/lib/components/Toast.tsx +89 -0
- package/lib/components/context/Field.tsx +27 -0
- package/lib/patterns/index.tsx +16 -5
- package/lib/patterns/newPatterns.tsx +285 -0
- package/lib/theme/Button.recipe.tsx +11 -1
- package/lib/theme/CircleProgress.recipe.tsx +3 -3
- package/lib/theme/Drawer.recipe.tsx +107 -0
- package/lib/theme/Field.recipe.tsx +17 -2
- package/lib/theme/Input.recipe.tsx +12 -3
- package/lib/theme/NumberInput.recipe.tsx +8 -3
- package/lib/theme/RadioGroup.recipe.tsx +7 -1
- package/lib/theme/Select.recipe.tsx +7 -7
- package/lib/theme/Slider.recipe.tsx +402 -27
- package/lib/theme/Slideshow.recipe.tsx +1 -1
- package/lib/theme/Toast.recipe.tsx +71 -0
- package/lib/varia/mixins.ts +0 -4
- package/lib/varia/types.ts +8 -0
- package/lib/varia/utils.ts +66 -0
- package/package.json +1 -1
- package/lib/theme/Button.recipe-old.tsx +0 -67
- package/lib/theme/SlidingDrawer.recipe.tsx +0 -53
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import {useMemo} from 'react'
|
|
2
|
+
import {StyleProp, View, ViewStyle} from 'react-native'
|
|
3
|
+
import {StyleSheet} from 'react-native-unistyles'
|
|
4
|
+
|
|
5
|
+
interface StackProps {
|
|
6
|
+
backgroundColor?: ViewStyle['backgroundColor']
|
|
7
|
+
bg?: ViewStyle['backgroundColor']
|
|
8
|
+
width?: ViewStyle['width']
|
|
9
|
+
w?: ViewStyle['width']
|
|
10
|
+
height?: ViewStyle['height']
|
|
11
|
+
h?: ViewStyle['height']
|
|
12
|
+
borderColor?: ViewStyle['borderColor']
|
|
13
|
+
borderWidth?: ViewStyle['borderWidth']
|
|
14
|
+
borderStyle?: ViewStyle['borderStyle']
|
|
15
|
+
borderRadius?: ViewStyle['borderRadius']
|
|
16
|
+
br?: ViewStyle['borderRadius']
|
|
17
|
+
alignSelf?: ViewStyle['alignSelf']
|
|
18
|
+
alignItems?: ViewStyle['alignItems']
|
|
19
|
+
justifyContent?: ViewStyle['justifyContent']
|
|
20
|
+
flex?: ViewStyle['flex']
|
|
21
|
+
flexShrink?: ViewStyle['flexShrink']
|
|
22
|
+
flexGrow?: ViewStyle['flexGrow']
|
|
23
|
+
flexBasis?: ViewStyle['flexBasis']
|
|
24
|
+
flexWrap?: ViewStyle['flexWrap']
|
|
25
|
+
gap?: ViewStyle['gap']
|
|
26
|
+
m?: ViewStyle['margin']
|
|
27
|
+
mt?: ViewStyle['marginTop']
|
|
28
|
+
mb?: ViewStyle['marginBottom']
|
|
29
|
+
ml?: ViewStyle['marginLeft']
|
|
30
|
+
mr?: ViewStyle['marginRight']
|
|
31
|
+
mx?: ViewStyle['marginHorizontal']
|
|
32
|
+
my?: ViewStyle['marginVertical']
|
|
33
|
+
margin?: ViewStyle['margin']
|
|
34
|
+
marginVertical?: ViewStyle['marginVertical']
|
|
35
|
+
marginHorizontal?: ViewStyle['marginHorizontal']
|
|
36
|
+
marginTop?: ViewStyle['marginTop']
|
|
37
|
+
marginBottom?: ViewStyle['marginBottom']
|
|
38
|
+
marginLeft?: ViewStyle['marginLeft']
|
|
39
|
+
marginRight?: ViewStyle['marginRight']
|
|
40
|
+
p?: ViewStyle['padding']
|
|
41
|
+
pt?: ViewStyle['paddingVertical']
|
|
42
|
+
pb?: ViewStyle['paddingVertical']
|
|
43
|
+
pl?: ViewStyle['paddingLeft']
|
|
44
|
+
pr?: ViewStyle['paddingRight']
|
|
45
|
+
px?: ViewStyle['paddingHorizontal']
|
|
46
|
+
py?: ViewStyle['paddingVertical']
|
|
47
|
+
padding?: ViewStyle['padding']
|
|
48
|
+
paddingVertical?: ViewStyle['paddingVertical']
|
|
49
|
+
paddingHorizontal?: ViewStyle['paddingHorizontal']
|
|
50
|
+
paddingTop?: ViewStyle['paddingTop']
|
|
51
|
+
paddingBottom?: ViewStyle['paddingBottom']
|
|
52
|
+
paddingLeft?: ViewStyle['paddingLeft']
|
|
53
|
+
paddingRight?: ViewStyle['paddingRight']
|
|
54
|
+
children?: React.ReactNode
|
|
55
|
+
// style?: ViewStyle
|
|
56
|
+
style?: StyleProp<ViewStyle>
|
|
57
|
+
align?: 'center' | 'vCenter' | 'hCenter'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function mapProps(props: StackProps) {
|
|
61
|
+
const stylesArr: any[] = []
|
|
62
|
+
|
|
63
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
64
|
+
if (value == null) return
|
|
65
|
+
|
|
66
|
+
const fn = (stackStyles as any)[key]
|
|
67
|
+
if (typeof fn === 'function') {
|
|
68
|
+
stylesArr.push(fn(value))
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return stylesArr
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const VStack = ({children, style, align, ...props}: StackProps) => {
|
|
76
|
+
stackStyles.useVariants({align})
|
|
77
|
+
const styleArr = useMemo(() => mapProps(props), [props])
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<View style={[stackStyles.stack, stackStyles.vstack, styleArr, style]}>
|
|
81
|
+
{children}
|
|
82
|
+
</View>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const HStack = ({children, style, align, ...props}: StackProps) => {
|
|
87
|
+
stackStyles.useVariants({align})
|
|
88
|
+
const styleArr = useMemo(() => mapProps(props), [props])
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<View style={[stackStyles.stack, stackStyles.hstack, styleArr, style]}>
|
|
92
|
+
{children}
|
|
93
|
+
</View>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const stackStyles = StyleSheet.create({
|
|
98
|
+
stack: {},
|
|
99
|
+
vstack: {
|
|
100
|
+
flexDirection: 'column',
|
|
101
|
+
variants: {
|
|
102
|
+
align: {
|
|
103
|
+
center: {
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
},
|
|
107
|
+
vCenter: {
|
|
108
|
+
justifyContent: 'center',
|
|
109
|
+
},
|
|
110
|
+
hCenter: {
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
hstack: {
|
|
117
|
+
flexDirection: 'row',
|
|
118
|
+
variants: {
|
|
119
|
+
align: {
|
|
120
|
+
center: {
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
},
|
|
124
|
+
vCenter: {
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
},
|
|
127
|
+
hCenter: {
|
|
128
|
+
justifyContent: 'center',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
backgroundColor: value => ({
|
|
135
|
+
backgroundColor: value,
|
|
136
|
+
}),
|
|
137
|
+
bg: value => ({
|
|
138
|
+
backgroundColor: value,
|
|
139
|
+
}),
|
|
140
|
+
|
|
141
|
+
width: value => ({
|
|
142
|
+
width: value,
|
|
143
|
+
}),
|
|
144
|
+
w: value => ({
|
|
145
|
+
width: value,
|
|
146
|
+
}),
|
|
147
|
+
height: value => ({
|
|
148
|
+
height: value,
|
|
149
|
+
}),
|
|
150
|
+
h: value => ({
|
|
151
|
+
height: value,
|
|
152
|
+
}),
|
|
153
|
+
|
|
154
|
+
borderColor: value => ({
|
|
155
|
+
borderColor: value,
|
|
156
|
+
}),
|
|
157
|
+
borderWidth: value => ({
|
|
158
|
+
borderWidth: value,
|
|
159
|
+
}),
|
|
160
|
+
borderStyle: value => ({
|
|
161
|
+
borderStyle: value,
|
|
162
|
+
}),
|
|
163
|
+
borderRadius: value => ({
|
|
164
|
+
borderRadius: value,
|
|
165
|
+
}),
|
|
166
|
+
br: value => ({
|
|
167
|
+
borderRadius: value,
|
|
168
|
+
}),
|
|
169
|
+
|
|
170
|
+
flex: value => ({
|
|
171
|
+
flex: value,
|
|
172
|
+
}),
|
|
173
|
+
flexShrink: value => ({
|
|
174
|
+
flexShrink: value,
|
|
175
|
+
}),
|
|
176
|
+
flexGrow: value => ({
|
|
177
|
+
flexGrow: value,
|
|
178
|
+
}),
|
|
179
|
+
flexBasis: value => ({
|
|
180
|
+
flexBasis: value,
|
|
181
|
+
}),
|
|
182
|
+
flexWrap: value => ({
|
|
183
|
+
flexWrap: value,
|
|
184
|
+
}),
|
|
185
|
+
alignSelf: value => ({
|
|
186
|
+
alignSelf: value,
|
|
187
|
+
}),
|
|
188
|
+
alignItems: value => ({
|
|
189
|
+
alignItems: value,
|
|
190
|
+
}),
|
|
191
|
+
justifyContent: value => ({
|
|
192
|
+
justifyContent: value,
|
|
193
|
+
}),
|
|
194
|
+
gap: value => ({
|
|
195
|
+
gap: value,
|
|
196
|
+
}),
|
|
197
|
+
|
|
198
|
+
m: value => ({
|
|
199
|
+
margin: value,
|
|
200
|
+
}),
|
|
201
|
+
mt: value => ({
|
|
202
|
+
marginTop: value,
|
|
203
|
+
}),
|
|
204
|
+
mb: value => ({
|
|
205
|
+
marginBottom: value,
|
|
206
|
+
}),
|
|
207
|
+
ml: value => ({
|
|
208
|
+
marginLeft: value,
|
|
209
|
+
}),
|
|
210
|
+
mr: value => ({
|
|
211
|
+
marginRight: value,
|
|
212
|
+
}),
|
|
213
|
+
mx: value => ({
|
|
214
|
+
marginHorizontal: value,
|
|
215
|
+
}),
|
|
216
|
+
my: value => ({
|
|
217
|
+
marginVertical: value,
|
|
218
|
+
}),
|
|
219
|
+
margin: value => ({
|
|
220
|
+
margin: value,
|
|
221
|
+
}),
|
|
222
|
+
marginVertical: value => ({
|
|
223
|
+
marginVertical: value,
|
|
224
|
+
}),
|
|
225
|
+
marginHorizontal: value => ({
|
|
226
|
+
marginHorizontal: value,
|
|
227
|
+
}),
|
|
228
|
+
marginLeft: value => ({
|
|
229
|
+
marginLeft: value,
|
|
230
|
+
}),
|
|
231
|
+
marginRight: value => ({
|
|
232
|
+
marginRight: value,
|
|
233
|
+
}),
|
|
234
|
+
marginTop: value => ({
|
|
235
|
+
marginTop: value,
|
|
236
|
+
}),
|
|
237
|
+
marginBottom: value => ({
|
|
238
|
+
marginBottom: value,
|
|
239
|
+
}),
|
|
240
|
+
|
|
241
|
+
p: value => ({
|
|
242
|
+
padding: value,
|
|
243
|
+
}),
|
|
244
|
+
pt: value => ({
|
|
245
|
+
paddingTop: value,
|
|
246
|
+
}),
|
|
247
|
+
pb: value => ({
|
|
248
|
+
paddingBottom: value,
|
|
249
|
+
}),
|
|
250
|
+
pl: value => ({
|
|
251
|
+
paddingLeft: value,
|
|
252
|
+
}),
|
|
253
|
+
pr: value => ({
|
|
254
|
+
paddingRight: value,
|
|
255
|
+
}),
|
|
256
|
+
px: value => ({
|
|
257
|
+
paddingHorizontal: value,
|
|
258
|
+
}),
|
|
259
|
+
py: value => ({
|
|
260
|
+
paddingVertical: value,
|
|
261
|
+
}),
|
|
262
|
+
padding: value => ({
|
|
263
|
+
padding: value,
|
|
264
|
+
}),
|
|
265
|
+
paddingHorizontal: value => ({
|
|
266
|
+
paddingHorizontal: value,
|
|
267
|
+
}),
|
|
268
|
+
paddingVertical: value => ({
|
|
269
|
+
paddingVertical: value,
|
|
270
|
+
}),
|
|
271
|
+
paddingLeft: value => ({
|
|
272
|
+
paddingLeft: value,
|
|
273
|
+
}),
|
|
274
|
+
paddingRight: value => ({
|
|
275
|
+
paddingRight: value,
|
|
276
|
+
}),
|
|
277
|
+
paddingTop: value => ({
|
|
278
|
+
paddingTop: value,
|
|
279
|
+
}),
|
|
280
|
+
paddingBottom: value => ({
|
|
281
|
+
paddingBottom: value,
|
|
282
|
+
}),
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
export {VStack, HStack}
|
|
@@ -9,6 +9,7 @@ export const ButtonDefaultVariants = {
|
|
|
9
9
|
export const ButtonStyles = StyleSheet.create(theme => ({
|
|
10
10
|
container: (colorPalette: PalettesWithNestedKeys) => ({
|
|
11
11
|
borderRadius: 12,
|
|
12
|
+
|
|
12
13
|
variants: {
|
|
13
14
|
variant: {
|
|
14
15
|
solid: {
|
|
@@ -24,6 +25,12 @@ export const ButtonStyles = StyleSheet.create(theme => ({
|
|
|
24
25
|
subtle: {
|
|
25
26
|
backgroundColor: theme.colors[colorPalette]['a3'],
|
|
26
27
|
},
|
|
28
|
+
icon: {
|
|
29
|
+
backgroundColor: 'transparent',
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderColor: theme.colors[colorPalette].a7,
|
|
32
|
+
borderRadius: theme.radii.full,
|
|
33
|
+
},
|
|
27
34
|
},
|
|
28
35
|
size: {
|
|
29
36
|
xs: {
|
|
@@ -103,7 +110,7 @@ export const ButtonStyles = StyleSheet.create(theme => ({
|
|
|
103
110
|
variants: {
|
|
104
111
|
variant: {
|
|
105
112
|
solid: {
|
|
106
|
-
color: theme.colors
|
|
113
|
+
color: theme.colors.fg.default,
|
|
107
114
|
},
|
|
108
115
|
outline: {
|
|
109
116
|
color: theme.colors[colorPalette].text,
|
|
@@ -114,6 +121,9 @@ export const ButtonStyles = StyleSheet.create(theme => ({
|
|
|
114
121
|
subtle: {
|
|
115
122
|
color: theme.colors[colorPalette].text,
|
|
116
123
|
},
|
|
124
|
+
icon: {
|
|
125
|
+
color: theme.colors[colorPalette].text,
|
|
126
|
+
},
|
|
117
127
|
},
|
|
118
128
|
disabled: {
|
|
119
129
|
true: {},
|
|
@@ -12,8 +12,8 @@ const circleProgressTokens = createCircleProgressTokens({
|
|
|
12
12
|
progressStrokeWidth: 8,
|
|
13
13
|
},
|
|
14
14
|
md: {
|
|
15
|
-
trackStrokeWidth:
|
|
16
|
-
progressStrokeWidth:
|
|
15
|
+
trackStrokeWidth: 18,
|
|
16
|
+
progressStrokeWidth: 16,
|
|
17
17
|
},
|
|
18
18
|
lg: {
|
|
19
19
|
trackStrokeWidth: 40,
|
|
@@ -22,7 +22,7 @@ const circleProgressTokens = createCircleProgressTokens({
|
|
|
22
22
|
},
|
|
23
23
|
variant: {
|
|
24
24
|
solid: {
|
|
25
|
-
trackColor: '
|
|
25
|
+
trackColor: 'bg.emphasized',
|
|
26
26
|
progressColor: 'colorPalette.9',
|
|
27
27
|
},
|
|
28
28
|
outline: {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native-unistyles'
|
|
2
|
+
import {PalettesWithNestedKeys} from '../style/varia/types'
|
|
3
|
+
|
|
4
|
+
export const DrawerTokens = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
variant: 'solid',
|
|
7
|
+
animation: 'defaultSpring',
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
animation: {
|
|
11
|
+
defaultSpring: {
|
|
12
|
+
type: 'withSpring' as const,
|
|
13
|
+
props: {
|
|
14
|
+
damping: 20,
|
|
15
|
+
stiffness: 200,
|
|
16
|
+
mass: 1,
|
|
17
|
+
overshootClamping: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
slowSpring: {
|
|
21
|
+
type: 'withSpring' as const,
|
|
22
|
+
props: {
|
|
23
|
+
damping: 200,
|
|
24
|
+
stiffness: 20,
|
|
25
|
+
mass: 10,
|
|
26
|
+
overshootClamping: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultTiming: {
|
|
30
|
+
type: 'withTiming' as const,
|
|
31
|
+
props: {
|
|
32
|
+
duration: 1000,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
} as const
|
|
38
|
+
export const DrawerStyles = StyleSheet.create((theme, rt) => ({
|
|
39
|
+
positioner: {
|
|
40
|
+
variants: {
|
|
41
|
+
variant: {
|
|
42
|
+
solid: {},
|
|
43
|
+
subtle: {},
|
|
44
|
+
card: {},
|
|
45
|
+
new: {
|
|
46
|
+
justifyContent: 'flex-start',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
slider: (colorPalette: PalettesWithNestedKeys) => ({
|
|
52
|
+
boxShadow: `0px -10px 20px black`,
|
|
53
|
+
borderRadius: theme.radii.lg,
|
|
54
|
+
backgroundColor: theme.colors.bg.default,
|
|
55
|
+
padding: theme.spacing[3],
|
|
56
|
+
variants: {
|
|
57
|
+
variant: {
|
|
58
|
+
solid: {
|
|
59
|
+
backgroundColor: 'blue',
|
|
60
|
+
},
|
|
61
|
+
subtle: {
|
|
62
|
+
boxShadow: 'none',
|
|
63
|
+
borderRadius: theme.radii.none,
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
backgroundColor: theme.colors.black['0'],
|
|
66
|
+
},
|
|
67
|
+
card: {
|
|
68
|
+
boxShadow: 'none',
|
|
69
|
+
borderRadius: theme.radii.lg,
|
|
70
|
+
// marginHorizontal: theme.spacing[3],
|
|
71
|
+
borderWidth: 2,
|
|
72
|
+
borderColor: theme.colors.border.default,
|
|
73
|
+
// height: rt.screen.height,
|
|
74
|
+
// height: 'auto',
|
|
75
|
+
alignSelf: 'auto',
|
|
76
|
+
maxWidth: '90%',
|
|
77
|
+
},
|
|
78
|
+
new: {
|
|
79
|
+
maxWidth: '80%',
|
|
80
|
+
},
|
|
81
|
+
iglooroom: {
|
|
82
|
+
padding: 0,
|
|
83
|
+
boxShadow: 'none',
|
|
84
|
+
borderRadius: theme.radii.none,
|
|
85
|
+
backgroundColor: 'transparent',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
overlay: (colorPalette: PalettesWithNestedKeys) => ({
|
|
91
|
+
backgroundColor: theme.colors.backdrop,
|
|
92
|
+
variants: {
|
|
93
|
+
variant: {
|
|
94
|
+
solid: {},
|
|
95
|
+
subtle: {
|
|
96
|
+
backgroundColor: '#00000040',
|
|
97
|
+
},
|
|
98
|
+
card: {
|
|
99
|
+
backgroundColor: '#00000020',
|
|
100
|
+
},
|
|
101
|
+
new: {
|
|
102
|
+
backgroundColor: '#00000020',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
107
|
+
}))
|
|
@@ -23,7 +23,16 @@ export const FieldStyles = StyleSheet.create(theme => ({
|
|
|
23
23
|
color: theme.colors.fg.default,
|
|
24
24
|
variants: {
|
|
25
25
|
variant: {
|
|
26
|
-
solid: {
|
|
26
|
+
solid: {
|
|
27
|
+
// transform: [{translateY: theme.spacing['3.5']}],
|
|
28
|
+
// marginLeft: theme.spacing['3'],
|
|
29
|
+
// paddingHorizontal: theme.spacing['1'],
|
|
30
|
+
backgroundColor: theme.colors.bg.default,
|
|
31
|
+
zIndex: 10,
|
|
32
|
+
flex: 0,
|
|
33
|
+
width: 'auto',
|
|
34
|
+
alignSelf: 'baseline',
|
|
35
|
+
},
|
|
27
36
|
},
|
|
28
37
|
size: {
|
|
29
38
|
xs: {
|
|
@@ -34,9 +43,15 @@ export const FieldStyles = StyleSheet.create(theme => ({
|
|
|
34
43
|
},
|
|
35
44
|
md: {
|
|
36
45
|
fontSize: theme.fontSizes.md,
|
|
46
|
+
transform: [{translateY: theme.spacing['4.5']}],
|
|
47
|
+
marginLeft: theme.spacing['2'],
|
|
48
|
+
paddingHorizontal: theme.spacing['1'],
|
|
37
49
|
},
|
|
38
50
|
lg: {
|
|
39
|
-
fontSize: theme.fontSizes
|
|
51
|
+
fontSize: theme.fontSizes['2xl'],
|
|
52
|
+
transform: [{translateY: theme.spacing['5']}],
|
|
53
|
+
marginLeft: theme.spacing['2.5'],
|
|
54
|
+
paddingHorizontal: theme.spacing['1'],
|
|
40
55
|
},
|
|
41
56
|
},
|
|
42
57
|
},
|
|
@@ -5,12 +5,14 @@ import {textStyle} from '../style/varia/textStyles'
|
|
|
5
5
|
export const InputDefaultVariants = {
|
|
6
6
|
variant: 'solid',
|
|
7
7
|
size: 'md',
|
|
8
|
-
spacing: 'md',
|
|
9
8
|
} as const
|
|
10
9
|
|
|
11
10
|
export const InputStyles = StyleSheet.create(theme => ({
|
|
12
11
|
placeholder: (colorPalette: PalettesWithNestedKeys) => ({
|
|
13
12
|
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
solid: {},
|
|
15
|
+
},
|
|
14
16
|
invalid: {
|
|
15
17
|
true: {
|
|
16
18
|
color: theme.colors.fg.error,
|
|
@@ -23,6 +25,8 @@ export const InputStyles = StyleSheet.create(theme => ({
|
|
|
23
25
|
md: {},
|
|
24
26
|
lg: {},
|
|
25
27
|
xl: {},
|
|
28
|
+
'2xl': {},
|
|
29
|
+
flex: {},
|
|
26
30
|
},
|
|
27
31
|
},
|
|
28
32
|
}),
|
|
@@ -31,8 +35,10 @@ export const InputStyles = StyleSheet.create(theme => ({
|
|
|
31
35
|
borderWidth: 1,
|
|
32
36
|
borderRadius: 4,
|
|
33
37
|
color: theme.colors.fg.default,
|
|
34
|
-
lineHeight: 10,
|
|
35
38
|
variants: {
|
|
39
|
+
variant: {
|
|
40
|
+
solid: {},
|
|
41
|
+
},
|
|
36
42
|
focused: {
|
|
37
43
|
true: {
|
|
38
44
|
borderColor: theme.colors[colorPalette].default,
|
|
@@ -71,7 +77,7 @@ export const InputStyles = StyleSheet.create(theme => ({
|
|
|
71
77
|
md: {
|
|
72
78
|
paddingHorizontal: theme.sizes[3],
|
|
73
79
|
minHeight: theme.sizes[10],
|
|
74
|
-
maxHeight: theme.sizes[
|
|
80
|
+
maxHeight: theme.sizes[20],
|
|
75
81
|
minWidth: theme.sizes[10],
|
|
76
82
|
fontSize: theme.fontSizes.md,
|
|
77
83
|
},
|
|
@@ -97,6 +103,9 @@ export const InputStyles = StyleSheet.create(theme => ({
|
|
|
97
103
|
minWidth: theme.sizes[16],
|
|
98
104
|
...textStyle['3xl'],
|
|
99
105
|
},
|
|
106
|
+
flex: {
|
|
107
|
+
paddingHorizontal: theme.sizes[2],
|
|
108
|
+
},
|
|
100
109
|
},
|
|
101
110
|
},
|
|
102
111
|
}),
|
|
@@ -27,6 +27,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
27
27
|
md: {},
|
|
28
28
|
lg: {},
|
|
29
29
|
xl: {},
|
|
30
|
+
flex: {},
|
|
30
31
|
},
|
|
31
32
|
},
|
|
32
33
|
}),
|
|
@@ -63,6 +64,9 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
63
64
|
minWidth: theme.sizes[12],
|
|
64
65
|
height: theme.sizes[12],
|
|
65
66
|
},
|
|
67
|
+
flex: {
|
|
68
|
+
padding: theme.sizes[0.5],
|
|
69
|
+
},
|
|
66
70
|
},
|
|
67
71
|
},
|
|
68
72
|
}),
|
|
@@ -82,6 +86,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
82
86
|
md: {},
|
|
83
87
|
lg: {},
|
|
84
88
|
xl: {},
|
|
89
|
+
flex: {},
|
|
85
90
|
},
|
|
86
91
|
},
|
|
87
92
|
compoundVariants: [
|
|
@@ -121,6 +126,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
121
126
|
md: {},
|
|
122
127
|
lg: {},
|
|
123
128
|
xl: {},
|
|
129
|
+
flex: {},
|
|
124
130
|
},
|
|
125
131
|
},
|
|
126
132
|
compoundVariants: [
|
|
@@ -150,9 +156,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
150
156
|
variants: {
|
|
151
157
|
distribution: {
|
|
152
158
|
vertical: {},
|
|
153
|
-
horizontal: {
|
|
154
|
-
flex: 1,
|
|
155
|
-
},
|
|
159
|
+
horizontal: {},
|
|
156
160
|
},
|
|
157
161
|
variant: {
|
|
158
162
|
solid: {
|
|
@@ -185,6 +189,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
185
189
|
minHeight: theme.sizes[12],
|
|
186
190
|
maxHeight: theme.sizes[12],
|
|
187
191
|
},
|
|
192
|
+
flex: {},
|
|
188
193
|
},
|
|
189
194
|
},
|
|
190
195
|
}),
|
|
@@ -30,11 +30,12 @@ export const RadioGroupStyles = StyleSheet.create(theme => ({
|
|
|
30
30
|
lg: {
|
|
31
31
|
gap: theme.sizes[4],
|
|
32
32
|
},
|
|
33
|
+
nosize: {},
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
36
|
}),
|
|
36
37
|
|
|
37
|
-
item: (colorPalette: PalettesWithNestedKeys) => ({
|
|
38
|
+
item: (colorPalette: PalettesWithNestedKeys, pressed: boolean) => ({
|
|
38
39
|
variants: {
|
|
39
40
|
variant: {
|
|
40
41
|
solid: {},
|
|
@@ -55,6 +56,9 @@ export const RadioGroupStyles = StyleSheet.create(theme => ({
|
|
|
55
56
|
lg: {
|
|
56
57
|
gap: theme.sizes[4],
|
|
57
58
|
},
|
|
59
|
+
nosize: {
|
|
60
|
+
gap: theme.sizes[2],
|
|
61
|
+
},
|
|
58
62
|
},
|
|
59
63
|
},
|
|
60
64
|
compoundVariants: [
|
|
@@ -93,6 +97,7 @@ export const RadioGroupStyles = StyleSheet.create(theme => ({
|
|
|
93
97
|
sm: {width: theme.sizes[4], height: theme.sizes[4]},
|
|
94
98
|
md: {width: theme.sizes[5], height: theme.sizes[5]},
|
|
95
99
|
lg: {width: theme.sizes[6], height: theme.sizes[6]},
|
|
100
|
+
nosize: {width: theme.sizes[5], height: theme.sizes[5]},
|
|
96
101
|
},
|
|
97
102
|
checked: {
|
|
98
103
|
true: {},
|
|
@@ -125,6 +130,7 @@ export const RadioGroupStyles = StyleSheet.create(theme => ({
|
|
|
125
130
|
sm: {width: theme.sizes[2], height: theme.sizes[2]},
|
|
126
131
|
md: {width: theme.sizes[3], height: theme.sizes[3]},
|
|
127
132
|
lg: {width: theme.sizes['3.5'], height: theme.sizes['3.5']},
|
|
133
|
+
nosize: {width: theme.sizes[3], height: theme.sizes[3]},
|
|
128
134
|
},
|
|
129
135
|
checked: {
|
|
130
136
|
true: {},
|
|
@@ -8,13 +8,14 @@ export const SelectDefaultVariants = {
|
|
|
8
8
|
} as const
|
|
9
9
|
|
|
10
10
|
export const SelectStyles = StyleSheet.create((theme, rt) => ({
|
|
11
|
-
trigger: (colorPalette: PalettesWithNestedKeys) => ({
|
|
11
|
+
trigger: (colorPalette: PalettesWithNestedKeys, pressed: boolean) => ({
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
outline: {
|
|
15
15
|
borderColor: theme.colors.border.default,
|
|
16
16
|
borderWidth: 1,
|
|
17
17
|
borderRadius: theme.radii.sm,
|
|
18
|
+
opacity: pressed ? 0.5 : 1,
|
|
18
19
|
},
|
|
19
20
|
ghost: {
|
|
20
21
|
backgroundColor: 'transparent',
|
|
@@ -30,6 +31,7 @@ export const SelectStyles = StyleSheet.create((theme, rt) => ({
|
|
|
30
31
|
lg: {
|
|
31
32
|
height: theme.sizes[11],
|
|
32
33
|
},
|
|
34
|
+
nosize: {},
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
37
|
}),
|
|
@@ -45,6 +47,7 @@ export const SelectStyles = StyleSheet.create((theme, rt) => ({
|
|
|
45
47
|
sm: {},
|
|
46
48
|
md: {},
|
|
47
49
|
lg: {},
|
|
50
|
+
nosize: {},
|
|
48
51
|
},
|
|
49
52
|
},
|
|
50
53
|
}),
|
|
@@ -56,12 +59,8 @@ export const SelectStyles = StyleSheet.create((theme, rt) => ({
|
|
|
56
59
|
marginHorizontal: 20,
|
|
57
60
|
variants: {
|
|
58
61
|
variant: {
|
|
59
|
-
outline: {
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
ghost: {
|
|
63
|
-
backgroundColor: 'pink',
|
|
64
|
-
},
|
|
62
|
+
outline: {},
|
|
63
|
+
ghost: {},
|
|
65
64
|
},
|
|
66
65
|
size: {
|
|
67
66
|
sm: {
|
|
@@ -73,6 +72,7 @@ export const SelectStyles = StyleSheet.create((theme, rt) => ({
|
|
|
73
72
|
lg: {
|
|
74
73
|
padding: theme.spacing['1.5'],
|
|
75
74
|
},
|
|
75
|
+
nosize: {},
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
}),
|