react-native-varia 0.3.0 → 0.4.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/lib/components/Accordion.tsx +61 -21
- package/lib/components/Badge.tsx +9 -0
- package/lib/components/Button.tsx +19 -8
- package/lib/components/Checkbox.tsx +21 -12
- package/lib/components/CircleProgress.tsx +8 -0
- package/lib/components/Divider.tsx +6 -0
- package/lib/components/Drawer.tsx +16 -4
- package/lib/components/Field.tsx +4 -0
- package/lib/components/GradientBackground.tsx +3 -0
- package/lib/components/GradientText.tsx +27 -14
- package/lib/components/IconWrapper.tsx +3 -2
- package/lib/components/Input.tsx +47 -21
- package/lib/components/Link.tsx +4 -0
- package/lib/components/Modal.tsx +18 -5
- package/lib/components/NumberInput.tsx +27 -5
- package/lib/components/RadioGroup.tsx +16 -5
- package/lib/components/ReText.tsx +4 -1
- package/lib/components/Select.tsx +20 -0
- package/lib/components/Slider.tsx +59 -23
- package/lib/components/Slideshow.tsx +19 -3
- package/lib/components/Spinner.tsx +9 -3
- package/lib/components/Switch.tsx +57 -26
- package/lib/components/Text.tsx +3 -0
- package/lib/components/Toast.tsx +110 -36
- package/lib/patterns/index.tsx +299 -90
- package/lib/theme/Accordion.tsx +184 -0
- package/lib/theme/Button.recipe.tsx +24 -7
- package/lib/theme/Drawer.recipe.tsx +2 -4
- package/lib/theme/Field.recipe.tsx +45 -15
- package/lib/theme/GradientText.recipe.tsx +103 -34
- package/lib/theme/Input.recipe.tsx +14 -6
- package/lib/theme/Select.recipe.tsx +3 -0
- package/lib/theme/Slider.recipe.tsx +86 -150
- package/lib/theme/Spinner.recipe.tsx +4 -0
- package/lib/theme/Switch.recipe.tsx +19 -0
- package/lib/theme/Text.recipe.tsx +63 -12
- package/lib/theme/Toast.recipe.tsx +40 -7
- package/lib/varia/types.ts +3 -0
- package/lib/varia/utils.ts +110 -18
- package/package.json +1 -1
- package/lib/components/OldSlider.tsx +0 -327
- package/lib/components/SlidingDrawer.tsx +0 -301
- package/lib/patterns/newPatterns.tsx +0 -285
package/lib/patterns/index.tsx
CHANGED
|
@@ -1,102 +1,331 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {useMemo} from 'react'
|
|
2
2
|
import {Children, useLayoutEffect, useRef, useState} from 'react'
|
|
3
3
|
import type {ReactNode} from 'react'
|
|
4
4
|
import {ScrollView, View} from 'react-native'
|
|
5
5
|
import type {StyleProp, ViewProps, ViewStyle} from 'react-native'
|
|
6
|
+
import Animated, {AnimatedRef} from 'react-native-reanimated'
|
|
6
7
|
import {StyleSheet, UnistylesRuntime} from 'react-native-unistyles'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
py?: SpacingValue
|
|
25
|
-
|
|
9
|
+
interface StackProps {
|
|
10
|
+
backgroundColor?: ViewStyle['backgroundColor']
|
|
11
|
+
bg?: ViewStyle['backgroundColor']
|
|
12
|
+
width?: ViewStyle['width']
|
|
13
|
+
w?: ViewStyle['width']
|
|
14
|
+
minWidth?: ViewStyle['width']
|
|
15
|
+
maxWidth?: ViewStyle['width']
|
|
16
|
+
height?: ViewStyle['height']
|
|
17
|
+
h?: ViewStyle['height']
|
|
18
|
+
minHeight?: ViewStyle['height']
|
|
19
|
+
maxHeight?: ViewStyle['height']
|
|
20
|
+
borderColor?: ViewStyle['borderColor']
|
|
21
|
+
borderWidth?: ViewStyle['borderWidth']
|
|
22
|
+
borderStyle?: ViewStyle['borderStyle']
|
|
23
|
+
borderRadius?: ViewStyle['borderRadius']
|
|
24
|
+
br?: ViewStyle['borderRadius']
|
|
26
25
|
alignSelf?: ViewStyle['alignSelf']
|
|
27
|
-
|
|
28
26
|
alignItems?: ViewStyle['alignItems']
|
|
29
27
|
justifyContent?: ViewStyle['justifyContent']
|
|
28
|
+
flex?: ViewStyle['flex']
|
|
29
|
+
flexShrink?: ViewStyle['flexShrink']
|
|
30
|
+
flexGrow?: ViewStyle['flexGrow']
|
|
31
|
+
flexBasis?: ViewStyle['flexBasis']
|
|
32
|
+
flexWrap?: ViewStyle['flexWrap']
|
|
33
|
+
gap?: ViewStyle['gap']
|
|
34
|
+
m?: ViewStyle['margin']
|
|
35
|
+
mt?: ViewStyle['marginTop']
|
|
36
|
+
mb?: ViewStyle['marginBottom']
|
|
37
|
+
ml?: ViewStyle['marginLeft']
|
|
38
|
+
mr?: ViewStyle['marginRight']
|
|
39
|
+
mx?: ViewStyle['marginHorizontal']
|
|
40
|
+
my?: ViewStyle['marginVertical']
|
|
41
|
+
margin?: ViewStyle['margin']
|
|
42
|
+
marginVertical?: ViewStyle['marginVertical']
|
|
43
|
+
marginHorizontal?: ViewStyle['marginHorizontal']
|
|
44
|
+
marginTop?: ViewStyle['marginTop']
|
|
45
|
+
marginBottom?: ViewStyle['marginBottom']
|
|
46
|
+
marginLeft?: ViewStyle['marginLeft']
|
|
47
|
+
marginRight?: ViewStyle['marginRight']
|
|
48
|
+
p?: ViewStyle['padding']
|
|
49
|
+
pt?: ViewStyle['paddingVertical']
|
|
50
|
+
pb?: ViewStyle['paddingVertical']
|
|
51
|
+
pl?: ViewStyle['paddingLeft']
|
|
52
|
+
pr?: ViewStyle['paddingRight']
|
|
53
|
+
px?: ViewStyle['paddingHorizontal']
|
|
54
|
+
py?: ViewStyle['paddingVertical']
|
|
55
|
+
padding?: ViewStyle['padding']
|
|
56
|
+
paddingVertical?: ViewStyle['paddingVertical']
|
|
57
|
+
paddingHorizontal?: ViewStyle['paddingHorizontal']
|
|
58
|
+
paddingTop?: ViewStyle['paddingTop']
|
|
59
|
+
paddingBottom?: ViewStyle['paddingBottom']
|
|
60
|
+
paddingLeft?: ViewStyle['paddingLeft']
|
|
61
|
+
paddingRight?: ViewStyle['paddingRight']
|
|
62
|
+
children?: React.ReactNode
|
|
63
|
+
// style?: ViewStyle
|
|
64
|
+
style?: StyleProp<ViewStyle>
|
|
65
|
+
align?: 'center' | 'vCenter' | 'hCenter'
|
|
30
66
|
}
|
|
31
67
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
68
|
+
function mapProps(props: StackProps) {
|
|
69
|
+
const stylesArr: any[] = []
|
|
70
|
+
|
|
71
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
72
|
+
if (value == null) return
|
|
73
|
+
|
|
74
|
+
const fn = (stackStyles as any)[key]
|
|
75
|
+
if (typeof fn === 'function') {
|
|
76
|
+
stylesArr.push(fn(value))
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
return stylesArr
|
|
38
81
|
}
|
|
39
82
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
83
|
+
const VStack = ({children, style, align, ...props}: StackProps) => {
|
|
84
|
+
stackStyles.useVariants({align})
|
|
85
|
+
const styleArr = useMemo(() => mapProps(props), [props])
|
|
43
86
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
87
|
+
return (
|
|
88
|
+
<View style={[stackStyles.stack, stackStyles.vstack, styleArr, style]}>
|
|
89
|
+
{children}
|
|
90
|
+
</View>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const HStack = ({children, style, align, ...props}: StackProps) => {
|
|
95
|
+
stackStyles.useVariants({align})
|
|
96
|
+
const styleArr = useMemo(() => mapProps(props), [props])
|
|
54
97
|
|
|
55
|
-
const HStack: React.FC<HstackProps> = ({
|
|
56
|
-
children,
|
|
57
|
-
style,
|
|
58
|
-
center,
|
|
59
|
-
vCenter,
|
|
60
|
-
hCenter,
|
|
61
|
-
flex = 0,
|
|
62
|
-
gap = 0,
|
|
63
|
-
stretch,
|
|
64
|
-
...props
|
|
65
|
-
}) => {
|
|
66
98
|
return (
|
|
67
|
-
<View
|
|
68
|
-
style={[
|
|
69
|
-
styles.hStack(center, vCenter, hCenter, gap, flex, stretch),
|
|
70
|
-
style,
|
|
71
|
-
]}
|
|
72
|
-
{...props}>
|
|
99
|
+
<View style={[stackStyles.stack, stackStyles.hstack, styleArr, style]}>
|
|
73
100
|
{children}
|
|
74
101
|
</View>
|
|
75
102
|
)
|
|
76
103
|
}
|
|
77
|
-
const
|
|
104
|
+
const AnimatedView = Animated.createAnimatedComponent(View)
|
|
105
|
+
|
|
106
|
+
const AnimatedHStack = ({
|
|
78
107
|
children,
|
|
79
108
|
style,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
hCenter,
|
|
83
|
-
flex = 0,
|
|
84
|
-
gap = 0,
|
|
85
|
-
stretch,
|
|
109
|
+
align,
|
|
110
|
+
ref,
|
|
86
111
|
...props
|
|
112
|
+
}: StackProps & {
|
|
113
|
+
ref?: AnimatedRef<Animated.View>
|
|
87
114
|
}) => {
|
|
115
|
+
stackStyles.useVariants({align})
|
|
116
|
+
const styleArr = useMemo(() => mapProps(props), [props])
|
|
117
|
+
|
|
88
118
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
style,
|
|
93
|
-
]}
|
|
94
|
-
{...props}>
|
|
119
|
+
<AnimatedView
|
|
120
|
+
ref={ref && ref}
|
|
121
|
+
style={[stackStyles.stack, stackStyles.vstack, styleArr, style]}>
|
|
95
122
|
{children}
|
|
96
|
-
</
|
|
123
|
+
</AnimatedView>
|
|
97
124
|
)
|
|
98
125
|
}
|
|
99
126
|
|
|
127
|
+
const stackStyles = StyleSheet.create({
|
|
128
|
+
stack: {},
|
|
129
|
+
vstack: {
|
|
130
|
+
flexDirection: 'column',
|
|
131
|
+
variants: {
|
|
132
|
+
align: {
|
|
133
|
+
center: {
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
justifyContent: 'center',
|
|
136
|
+
},
|
|
137
|
+
vCenter: {
|
|
138
|
+
justifyContent: 'center',
|
|
139
|
+
},
|
|
140
|
+
hCenter: {
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
hstack: {
|
|
147
|
+
flexDirection: 'row',
|
|
148
|
+
variants: {
|
|
149
|
+
align: {
|
|
150
|
+
center: {
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
justifyContent: 'center',
|
|
153
|
+
},
|
|
154
|
+
vCenter: {
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
},
|
|
157
|
+
hCenter: {
|
|
158
|
+
justifyContent: 'center',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
backgroundColor: value => ({
|
|
165
|
+
backgroundColor: value,
|
|
166
|
+
}),
|
|
167
|
+
bg: value => ({
|
|
168
|
+
backgroundColor: value,
|
|
169
|
+
}),
|
|
170
|
+
|
|
171
|
+
width: value => ({
|
|
172
|
+
width: value,
|
|
173
|
+
}),
|
|
174
|
+
w: value => ({
|
|
175
|
+
width: value,
|
|
176
|
+
}),
|
|
177
|
+
minWidth: value => ({
|
|
178
|
+
minWidth: value,
|
|
179
|
+
}),
|
|
180
|
+
maxWidth: value => ({
|
|
181
|
+
maxWidth: value,
|
|
182
|
+
}),
|
|
183
|
+
height: value => ({
|
|
184
|
+
height: value,
|
|
185
|
+
}),
|
|
186
|
+
h: value => ({
|
|
187
|
+
height: value,
|
|
188
|
+
}),
|
|
189
|
+
minHeight: value => ({
|
|
190
|
+
minHeight: value,
|
|
191
|
+
}),
|
|
192
|
+
maxHeight: value => ({
|
|
193
|
+
maxHeight: value,
|
|
194
|
+
}),
|
|
195
|
+
|
|
196
|
+
borderColor: value => ({
|
|
197
|
+
borderColor: value,
|
|
198
|
+
}),
|
|
199
|
+
borderWidth: value => ({
|
|
200
|
+
borderWidth: value,
|
|
201
|
+
}),
|
|
202
|
+
borderStyle: value => ({
|
|
203
|
+
borderStyle: value,
|
|
204
|
+
}),
|
|
205
|
+
borderRadius: value => ({
|
|
206
|
+
borderRadius: value,
|
|
207
|
+
}),
|
|
208
|
+
br: value => ({
|
|
209
|
+
borderRadius: value,
|
|
210
|
+
}),
|
|
211
|
+
|
|
212
|
+
flex: value => ({
|
|
213
|
+
flex: value,
|
|
214
|
+
}),
|
|
215
|
+
flexShrink: value => ({
|
|
216
|
+
flexShrink: value,
|
|
217
|
+
}),
|
|
218
|
+
flexGrow: value => ({
|
|
219
|
+
flexGrow: value,
|
|
220
|
+
}),
|
|
221
|
+
flexBasis: value => ({
|
|
222
|
+
flexBasis: value,
|
|
223
|
+
}),
|
|
224
|
+
flexWrap: value => ({
|
|
225
|
+
flexWrap: value,
|
|
226
|
+
}),
|
|
227
|
+
alignSelf: value => ({
|
|
228
|
+
alignSelf: value,
|
|
229
|
+
}),
|
|
230
|
+
alignItems: value => ({
|
|
231
|
+
alignItems: value,
|
|
232
|
+
}),
|
|
233
|
+
justifyContent: value => ({
|
|
234
|
+
justifyContent: value,
|
|
235
|
+
}),
|
|
236
|
+
gap: value => ({
|
|
237
|
+
gap: value,
|
|
238
|
+
}),
|
|
239
|
+
|
|
240
|
+
m: value => ({
|
|
241
|
+
margin: value,
|
|
242
|
+
}),
|
|
243
|
+
mt: value => ({
|
|
244
|
+
marginTop: value,
|
|
245
|
+
}),
|
|
246
|
+
mb: value => ({
|
|
247
|
+
marginBottom: value,
|
|
248
|
+
}),
|
|
249
|
+
ml: value => ({
|
|
250
|
+
marginLeft: value,
|
|
251
|
+
}),
|
|
252
|
+
mr: value => ({
|
|
253
|
+
marginRight: value,
|
|
254
|
+
}),
|
|
255
|
+
mx: value => ({
|
|
256
|
+
marginHorizontal: value,
|
|
257
|
+
}),
|
|
258
|
+
my: value => ({
|
|
259
|
+
marginVertical: value,
|
|
260
|
+
}),
|
|
261
|
+
margin: value => ({
|
|
262
|
+
margin: value,
|
|
263
|
+
}),
|
|
264
|
+
marginVertical: value => ({
|
|
265
|
+
marginVertical: value,
|
|
266
|
+
}),
|
|
267
|
+
marginHorizontal: value => ({
|
|
268
|
+
marginHorizontal: value,
|
|
269
|
+
}),
|
|
270
|
+
marginLeft: value => ({
|
|
271
|
+
marginLeft: value,
|
|
272
|
+
}),
|
|
273
|
+
marginRight: value => ({
|
|
274
|
+
marginRight: value,
|
|
275
|
+
}),
|
|
276
|
+
marginTop: value => ({
|
|
277
|
+
marginTop: value,
|
|
278
|
+
}),
|
|
279
|
+
marginBottom: value => ({
|
|
280
|
+
marginBottom: value,
|
|
281
|
+
}),
|
|
282
|
+
|
|
283
|
+
p: value => ({
|
|
284
|
+
padding: value,
|
|
285
|
+
}),
|
|
286
|
+
pt: value => ({
|
|
287
|
+
paddingTop: value,
|
|
288
|
+
}),
|
|
289
|
+
pb: value => ({
|
|
290
|
+
paddingBottom: value,
|
|
291
|
+
}),
|
|
292
|
+
pl: value => ({
|
|
293
|
+
paddingLeft: value,
|
|
294
|
+
}),
|
|
295
|
+
pr: value => ({
|
|
296
|
+
paddingRight: value,
|
|
297
|
+
}),
|
|
298
|
+
px: value => ({
|
|
299
|
+
paddingHorizontal: value,
|
|
300
|
+
}),
|
|
301
|
+
py: value => ({
|
|
302
|
+
paddingVertical: value,
|
|
303
|
+
}),
|
|
304
|
+
padding: value => ({
|
|
305
|
+
padding: value,
|
|
306
|
+
}),
|
|
307
|
+
paddingHorizontal: value => ({
|
|
308
|
+
paddingHorizontal: value,
|
|
309
|
+
}),
|
|
310
|
+
paddingVertical: value => ({
|
|
311
|
+
paddingVertical: value,
|
|
312
|
+
}),
|
|
313
|
+
paddingLeft: value => ({
|
|
314
|
+
paddingLeft: value,
|
|
315
|
+
}),
|
|
316
|
+
paddingRight: value => ({
|
|
317
|
+
paddingRight: value,
|
|
318
|
+
}),
|
|
319
|
+
paddingTop: value => ({
|
|
320
|
+
paddingTop: value,
|
|
321
|
+
}),
|
|
322
|
+
paddingBottom: value => ({
|
|
323
|
+
paddingBottom: value,
|
|
324
|
+
}),
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
export {VStack, HStack, AnimatedHStack}
|
|
328
|
+
|
|
100
329
|
export const VSpacer = ({size}: {size?: number}) => {
|
|
101
330
|
return (
|
|
102
331
|
<View
|
|
@@ -126,26 +355,6 @@ export const FlexSpacer = () => {
|
|
|
126
355
|
/>
|
|
127
356
|
)
|
|
128
357
|
}
|
|
129
|
-
const styles = StyleSheet.create(() => ({
|
|
130
|
-
hStack: (center, vCenter, hCenter, gap, flex, stretch) => ({
|
|
131
|
-
flex,
|
|
132
|
-
gap,
|
|
133
|
-
flexDirection: 'row',
|
|
134
|
-
alignItems: center ? 'center' : vCenter ? 'center' : 'stretch',
|
|
135
|
-
justifyContent: center ? 'center' : hCenter ? 'center' : 'flex-start',
|
|
136
|
-
...(stretch ? {alignSelf: 'stretch'} : {}),
|
|
137
|
-
}),
|
|
138
|
-
vStack: (center, vCenter, hCenter, gap, flex, stretch) => ({
|
|
139
|
-
flex,
|
|
140
|
-
gap,
|
|
141
|
-
flexDirection: 'column',
|
|
142
|
-
alignItems: center ? 'center' : vCenter ? 'center' : 'stretch',
|
|
143
|
-
justifyContent: center ? 'center' : hCenter ? 'center' : 'flex-start',
|
|
144
|
-
...(stretch ? {alignSelf: 'stretch'} : {}),
|
|
145
|
-
}),
|
|
146
|
-
}))
|
|
147
|
-
|
|
148
|
-
export {HStack, VStack}
|
|
149
358
|
|
|
150
359
|
export const gap = (size: number) => ({
|
|
151
360
|
gap: size,
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native-unistyles'
|
|
2
|
+
import {PalettesWithNestedKeys} from '../style/varia/types'
|
|
3
|
+
|
|
4
|
+
export const AccordionDefaultVariants = {
|
|
5
|
+
variant: 'solid',
|
|
6
|
+
size: 'md',
|
|
7
|
+
} as const
|
|
8
|
+
export const AccordionStyles = StyleSheet.create(theme => ({
|
|
9
|
+
itemContainer: (colorPalette: PalettesWithNestedKeys) => ({
|
|
10
|
+
borderRadius: 12,
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
solid: {
|
|
14
|
+
backgroundColor: theme.colors.bg.default,
|
|
15
|
+
borderColor: 'transparent',
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
},
|
|
18
|
+
outline: {
|
|
19
|
+
borderWidth: 1,
|
|
20
|
+
borderColor: theme.colors[colorPalette].a7,
|
|
21
|
+
},
|
|
22
|
+
subtle: {
|
|
23
|
+
backgroundColor: theme.colors[colorPalette]['a3'],
|
|
24
|
+
borderWidth: 0,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: {
|
|
29
|
+
minHeight: theme.sizes[9],
|
|
30
|
+
paddingHorizontal: theme.sizes['3.5'],
|
|
31
|
+
paddingVertical: theme.sizes[2],
|
|
32
|
+
gap: theme.spacing[2],
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
minHeight: theme.sizes[10],
|
|
36
|
+
paddingHorizontal: theme.sizes[4],
|
|
37
|
+
paddingVertical: theme.sizes[2],
|
|
38
|
+
gap: theme.spacing[2],
|
|
39
|
+
},
|
|
40
|
+
lg: {
|
|
41
|
+
minHeight: theme.sizes[11],
|
|
42
|
+
paddingHorizontal: theme.sizes['4.5'],
|
|
43
|
+
paddingVertical: theme.sizes[2],
|
|
44
|
+
gap: theme.spacing[2],
|
|
45
|
+
},
|
|
46
|
+
xl: {
|
|
47
|
+
minHeight: theme.sizes[12],
|
|
48
|
+
paddingHorizontal: theme.sizes[5],
|
|
49
|
+
paddingVertical: theme.sizes[2],
|
|
50
|
+
gap: theme.spacing['2.5'],
|
|
51
|
+
},
|
|
52
|
+
nosize: {},
|
|
53
|
+
},
|
|
54
|
+
active: {
|
|
55
|
+
true: {},
|
|
56
|
+
false: {},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
variant: 'solid',
|
|
62
|
+
active: true,
|
|
63
|
+
styles: {
|
|
64
|
+
borderColor: theme.colors[colorPalette].default,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
variant: 'outline',
|
|
69
|
+
disabled: true,
|
|
70
|
+
styles: {},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
variant: 'ghost',
|
|
74
|
+
disabled: true,
|
|
75
|
+
styles: {
|
|
76
|
+
backgroundColor: 'transparent',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
variant: 'subtle',
|
|
81
|
+
disabled: true,
|
|
82
|
+
styles: {
|
|
83
|
+
backgroundColor: theme.colors.bg.disabled,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
}),
|
|
88
|
+
header: (colorPalette: PalettesWithNestedKeys) => ({
|
|
89
|
+
variants: {
|
|
90
|
+
variant: {
|
|
91
|
+
solid: {
|
|
92
|
+
backgroundColor: theme.colors.bg.default,
|
|
93
|
+
},
|
|
94
|
+
outline: {},
|
|
95
|
+
subtle: {},
|
|
96
|
+
},
|
|
97
|
+
size: {
|
|
98
|
+
sm: {
|
|
99
|
+
paddingHorizontal: theme.spacing[2],
|
|
100
|
+
height: theme.sizes[9],
|
|
101
|
+
},
|
|
102
|
+
md: {
|
|
103
|
+
paddingHorizontal: theme.spacing[2],
|
|
104
|
+
height: theme.sizes[10],
|
|
105
|
+
},
|
|
106
|
+
lg: {
|
|
107
|
+
paddingHorizontal: theme.spacing[2],
|
|
108
|
+
height: theme.sizes[11],
|
|
109
|
+
},
|
|
110
|
+
xl: {
|
|
111
|
+
paddingHorizontal: theme.spacing[3],
|
|
112
|
+
height: theme.sizes[12],
|
|
113
|
+
},
|
|
114
|
+
nosize: {},
|
|
115
|
+
},
|
|
116
|
+
active: {
|
|
117
|
+
true: {},
|
|
118
|
+
false: {},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
compoundVariants: [
|
|
122
|
+
{
|
|
123
|
+
variant: 'solid',
|
|
124
|
+
active: true,
|
|
125
|
+
styles: {},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
}),
|
|
129
|
+
headerTitle: (colorPalette: PalettesWithNestedKeys) => ({
|
|
130
|
+
variants: {
|
|
131
|
+
variant: {
|
|
132
|
+
solid: {
|
|
133
|
+
color: theme.colors.fg.default,
|
|
134
|
+
},
|
|
135
|
+
outline: {
|
|
136
|
+
color: theme.colors[colorPalette].text,
|
|
137
|
+
},
|
|
138
|
+
subtle: {
|
|
139
|
+
color: theme.colors[colorPalette].text,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
size: {
|
|
143
|
+
sm: {
|
|
144
|
+
fontSize: theme.fontSizes.sm,
|
|
145
|
+
},
|
|
146
|
+
md: {
|
|
147
|
+
fontSize: theme.fontSizes.md,
|
|
148
|
+
},
|
|
149
|
+
lg: {
|
|
150
|
+
fontSize: theme.fontSizes.md,
|
|
151
|
+
},
|
|
152
|
+
xl: {
|
|
153
|
+
fontSize: theme.fontSizes.lg,
|
|
154
|
+
},
|
|
155
|
+
nosize: {
|
|
156
|
+
fontSize: theme.fontSizes.md,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
active: {
|
|
160
|
+
true: {},
|
|
161
|
+
false: {},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
compoundVariants: [
|
|
165
|
+
{
|
|
166
|
+
variant: 'solid',
|
|
167
|
+
active: true,
|
|
168
|
+
styles: {
|
|
169
|
+
color: theme.colors[colorPalette].default,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
variant: 'outline',
|
|
174
|
+
active: true,
|
|
175
|
+
styles: {},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
variant: 'subtle',
|
|
179
|
+
active: true,
|
|
180
|
+
styles: {},
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
}),
|
|
184
|
+
}))
|
|
@@ -9,7 +9,9 @@ export const ButtonDefaultVariants = {
|
|
|
9
9
|
export const ButtonStyles = StyleSheet.create(theme => ({
|
|
10
10
|
container: (colorPalette: PalettesWithNestedKeys) => ({
|
|
11
11
|
borderRadius: 12,
|
|
12
|
-
|
|
12
|
+
_web: {
|
|
13
|
+
_classNames: 'button-container-recipe',
|
|
14
|
+
},
|
|
13
15
|
variants: {
|
|
14
16
|
variant: {
|
|
15
17
|
solid: {
|
|
@@ -107,6 +109,9 @@ export const ButtonStyles = StyleSheet.create(theme => ({
|
|
|
107
109
|
],
|
|
108
110
|
}),
|
|
109
111
|
text: (colorPalette: PalettesWithNestedKeys) => ({
|
|
112
|
+
_web: {
|
|
113
|
+
_classNames: 'button-text-recipe',
|
|
114
|
+
},
|
|
110
115
|
variants: {
|
|
111
116
|
variant: {
|
|
112
117
|
solid: {
|
|
@@ -131,22 +136,34 @@ export const ButtonStyles = StyleSheet.create(theme => ({
|
|
|
131
136
|
},
|
|
132
137
|
size: {
|
|
133
138
|
xs: {
|
|
134
|
-
...textStyle.xs,
|
|
139
|
+
// ...textStyle.xs,
|
|
140
|
+
fontSize: theme.fontSizes.xs,
|
|
141
|
+
lineHeight: 12,
|
|
135
142
|
},
|
|
136
143
|
sm: {
|
|
137
|
-
...textStyle.sm,
|
|
144
|
+
// ...textStyle.sm,
|
|
145
|
+
fontSize: theme.fontSizes.sm,
|
|
146
|
+
lineHeight: 20,
|
|
138
147
|
},
|
|
139
148
|
md: {
|
|
140
|
-
...textStyle.
|
|
149
|
+
// ...textStyle.md,
|
|
150
|
+
fontSize: theme.fontSizes.md,
|
|
151
|
+
lineHeight: 24,
|
|
141
152
|
},
|
|
142
153
|
lg: {
|
|
143
|
-
...textStyle.md,
|
|
154
|
+
// ...textStyle.md,
|
|
155
|
+
fontSize: theme.fontSizes.md,
|
|
156
|
+
lineHeight: 24,
|
|
144
157
|
},
|
|
145
158
|
xl: {
|
|
146
|
-
...textStyle.md,
|
|
159
|
+
// ...textStyle.md,
|
|
160
|
+
fontSize: theme.fontSizes.md,
|
|
161
|
+
lineHeight: 24,
|
|
147
162
|
},
|
|
148
163
|
'2xl': {
|
|
149
|
-
...textStyle.lg,
|
|
164
|
+
// ...textStyle.lg,
|
|
165
|
+
fontSize: theme.fontSizes.lg,
|
|
166
|
+
lineHeight: 28,
|
|
150
167
|
},
|
|
151
168
|
},
|
|
152
169
|
},
|
|
@@ -49,15 +49,13 @@ export const DrawerStyles = StyleSheet.create((theme, rt) => ({
|
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
slider: (colorPalette: PalettesWithNestedKeys) => ({
|
|
52
|
-
boxShadow:
|
|
52
|
+
boxShadow: theme.shadows.sm,
|
|
53
53
|
borderRadius: theme.radii.lg,
|
|
54
54
|
backgroundColor: theme.colors.bg.default,
|
|
55
55
|
padding: theme.spacing[3],
|
|
56
56
|
variants: {
|
|
57
57
|
variant: {
|
|
58
|
-
solid: {
|
|
59
|
-
backgroundColor: 'blue',
|
|
60
|
-
},
|
|
58
|
+
solid: {},
|
|
61
59
|
subtle: {
|
|
62
60
|
boxShadow: 'none',
|
|
63
61
|
borderRadius: theme.radii.none,
|