react-native-varia 0.3.0 → 0.4.1
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/FloatingAction.tsx +215 -0
- package/lib/components/GradientBackground.tsx +3 -0
- package/lib/components/GradientText.tsx +27 -14
- package/lib/components/IconWrapper.tsx +4 -3
- 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/FloatingAction.tsx +112 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {TextStyle, View, type ColorValue} from 'react-native'
|
|
2
2
|
import Svg, {
|
|
3
3
|
Defs,
|
|
4
4
|
LinearGradient,
|
|
@@ -6,19 +6,23 @@ import Svg, {
|
|
|
6
6
|
Text,
|
|
7
7
|
type NumberProp,
|
|
8
8
|
} from 'react-native-svg'
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
UnistylesVariants,
|
|
11
|
+
withUnistyles,
|
|
12
|
+
StyleSheet,
|
|
13
|
+
} from 'react-native-unistyles'
|
|
10
14
|
import {gradientTextTokens} from '../theme/GradientText.recipe'
|
|
11
15
|
import {
|
|
12
16
|
NestedColorsType,
|
|
13
17
|
PalettesWithNestedKeys,
|
|
14
18
|
ThemeType,
|
|
15
19
|
} from '../style/varia/types'
|
|
16
|
-
import {getVariantValue, resolveColor
|
|
20
|
+
import {getVariantValue, resolveColor} from '../style/varia/utils'
|
|
17
21
|
import {ThemeColors} from '../style/varia/types'
|
|
18
|
-
import {
|
|
22
|
+
import {TextStyles} from '../theme/Text.recipe'
|
|
19
23
|
|
|
20
24
|
type AllTextVariants = UnistylesVariants<typeof TextStyles>
|
|
21
|
-
type TextVariantsWithoutVariant = Omit<AllTextVariants,
|
|
25
|
+
type TextVariantsWithoutVariant = Omit<AllTextVariants, 'variant'>
|
|
22
26
|
|
|
23
27
|
type GradientTextProps = TextVariantsWithoutVariant & {
|
|
24
28
|
colorPalette: PalettesWithNestedKeys
|
|
@@ -46,9 +50,9 @@ const BaseGradientText = ({
|
|
|
46
50
|
size = gradientTextTokens.defaultProps.size,
|
|
47
51
|
}: GradientTextProps) => {
|
|
48
52
|
TextStyles.useVariants({
|
|
49
|
-
size
|
|
53
|
+
size,
|
|
50
54
|
})
|
|
51
|
-
|
|
55
|
+
|
|
52
56
|
const colorValue = gradientTextTokens.variants.variant[variant]
|
|
53
57
|
|
|
54
58
|
const resolvedStartColor = resolveColor(
|
|
@@ -65,9 +69,16 @@ const BaseGradientText = ({
|
|
|
65
69
|
// const fontSizeValue = gradientTextTokens.variants.size[size].fontSize
|
|
66
70
|
// const resolvedFontSize = fontSize || resolveFontSize(fontSizeValue, fontSizes)
|
|
67
71
|
|
|
68
|
-
const resolvedFontSize =
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
const resolvedFontSize =
|
|
73
|
+
fontSize ||
|
|
74
|
+
getVariantValue(TextStyles.text(colorPalette), 'size', size, 'fontSize')
|
|
75
|
+
const resolvedFontWeight =
|
|
76
|
+
getVariantValue(
|
|
77
|
+
TextStyles.text(colorPalette),
|
|
78
|
+
'size',
|
|
79
|
+
size,
|
|
80
|
+
'fontWeight',
|
|
81
|
+
) || 400
|
|
71
82
|
|
|
72
83
|
const directionVariant = gradientTextTokens.variants.direction[direction]
|
|
73
84
|
|
|
@@ -89,10 +100,6 @@ const BaseGradientText = ({
|
|
|
89
100
|
<Text
|
|
90
101
|
fill="url(#gradient)"
|
|
91
102
|
fontSize={resolvedFontSize}
|
|
92
|
-
// fontWeight={
|
|
93
|
-
// (gradientTextTokens.variants.size[size] as {fontWeight?: number})
|
|
94
|
-
// .fontWeight ?? 400
|
|
95
|
-
// }
|
|
96
103
|
fontWeight={resolvedFontWeight}
|
|
97
104
|
x="50%"
|
|
98
105
|
y={resolvedFontSize}
|
|
@@ -108,9 +115,15 @@ const BaseGradientText = ({
|
|
|
108
115
|
const styles = StyleSheet.create({
|
|
109
116
|
root: {
|
|
110
117
|
flexDirection: 'row',
|
|
118
|
+
_web: {
|
|
119
|
+
_classNames: 'gradient_text-root-base',
|
|
120
|
+
},
|
|
111
121
|
},
|
|
112
122
|
innerContainer: {
|
|
113
123
|
width: '100%',
|
|
124
|
+
_web: {
|
|
125
|
+
_classNames: 'gradient-inner-container-base',
|
|
126
|
+
},
|
|
114
127
|
},
|
|
115
128
|
})
|
|
116
129
|
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
NestedColorsType,
|
|
15
15
|
PalettesWithNestedKeys,
|
|
16
16
|
ThemeColors,
|
|
17
|
-
ThemeType,
|
|
18
17
|
} from '../style/varia/types'
|
|
19
18
|
import {resolveColor} from '../style/varia/utils'
|
|
20
19
|
|
|
@@ -69,7 +68,7 @@ const Icon = ({
|
|
|
69
68
|
<Svg
|
|
70
69
|
width={size || width}
|
|
71
70
|
height={size || height}
|
|
72
|
-
viewBox="0 0
|
|
71
|
+
viewBox="0 0 23 23"
|
|
73
72
|
// viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}
|
|
74
73
|
fill="none"
|
|
75
74
|
{...rest}>
|
|
@@ -107,7 +106,9 @@ const styles = StyleSheet.create({
|
|
|
107
106
|
justifyContent: 'center',
|
|
108
107
|
alignItems: 'center',
|
|
109
108
|
...(rotation && {transform: [{rotate: `${rotation}deg`}]}),
|
|
110
|
-
|
|
109
|
+
_web: {
|
|
110
|
+
_classNames: 'icon_wrapper-root-base',
|
|
111
|
+
},
|
|
111
112
|
}),
|
|
112
113
|
})
|
|
113
114
|
|
package/lib/components/Input.tsx
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '../style/varia/types'
|
|
20
20
|
import {useState} from 'react'
|
|
21
21
|
import {IconWrapperProps} from './IconWrapper'
|
|
22
|
+
import {getVariantValue} from '../style/varia/utils'
|
|
22
23
|
|
|
23
24
|
type InputVariants = UnistylesVariants<typeof InputStyles>
|
|
24
25
|
|
|
@@ -89,17 +90,22 @@ const Input = ({
|
|
|
89
90
|
disabled,
|
|
90
91
|
invalid,
|
|
91
92
|
})
|
|
92
|
-
const iconPosition = icon ?
|
|
93
|
+
const iconPosition = icon ? icon.position || 'left' : null
|
|
93
94
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
const resolvedPlaceholderColor = getVariantValue(
|
|
96
|
+
InputStyles.placeholder(colorPalette),
|
|
97
|
+
'variant',
|
|
98
|
+
variant,
|
|
99
|
+
'color',
|
|
100
|
+
)
|
|
98
101
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
const resolvedPaddingHorizontal =
|
|
103
|
+
getVariantValue(
|
|
104
|
+
InputStyles.input(colorPalette),
|
|
105
|
+
'size',
|
|
106
|
+
size,
|
|
107
|
+
'paddingHorizontal',
|
|
108
|
+
) || 0
|
|
103
109
|
|
|
104
110
|
const IconComponent = icon?.component
|
|
105
111
|
const IconRendered = IconComponent ? (
|
|
@@ -110,16 +116,16 @@ const Input = ({
|
|
|
110
116
|
colorPalette,
|
|
111
117
|
size: icon.size,
|
|
112
118
|
color: InputStyles.input(colorPalette).color,
|
|
113
|
-
style: styles.icon(
|
|
119
|
+
style: styles.icon(
|
|
120
|
+
iconPosition,
|
|
121
|
+
resolvedPaddingHorizontal,
|
|
122
|
+
textAlignVertical,
|
|
123
|
+
),
|
|
114
124
|
}}
|
|
115
125
|
/>
|
|
116
126
|
) : null
|
|
117
127
|
|
|
118
|
-
|
|
119
|
-
iconPosition === 'left'
|
|
120
|
-
? (icon?.size || 0) + paddingHorizontal * 2
|
|
121
|
-
: paddingHorizontal,
|
|
122
|
-
)
|
|
128
|
+
const withIconPadding = (icon?.size || 0) + resolvedPaddingHorizontal * 2
|
|
123
129
|
|
|
124
130
|
return (
|
|
125
131
|
<View
|
|
@@ -132,18 +138,29 @@ const Input = ({
|
|
|
132
138
|
flex,
|
|
133
139
|
maxWidth,
|
|
134
140
|
iconPosition,
|
|
135
|
-
|
|
141
|
+
resolvedPaddingHorizontal,
|
|
136
142
|
textAlignVertical,
|
|
137
|
-
(icon?.size || 0) +
|
|
143
|
+
(icon?.size || 0) + resolvedPaddingHorizontal * 2,
|
|
138
144
|
alignSelf,
|
|
139
145
|
),
|
|
140
146
|
InputStyles.input(colorPalette),
|
|
141
147
|
inputMixins && inputMixins,
|
|
142
148
|
style && style,
|
|
149
|
+
iconPosition && {
|
|
150
|
+
paddingInline: 0,
|
|
151
|
+
paddingLeft:
|
|
152
|
+
iconPosition === 'left'
|
|
153
|
+
? withIconPadding - 0.1
|
|
154
|
+
: resolvedPaddingHorizontal,
|
|
155
|
+
paddingRight:
|
|
156
|
+
iconPosition === 'right'
|
|
157
|
+
? withIconPadding - 0.1
|
|
158
|
+
: resolvedPaddingHorizontal,
|
|
159
|
+
},
|
|
143
160
|
]}
|
|
144
161
|
value={value}
|
|
145
162
|
placeholder={placeholder}
|
|
146
|
-
placeholderTextColor={
|
|
163
|
+
placeholderTextColor={resolvedPlaceholderColor}
|
|
147
164
|
inputMode={inputMode}
|
|
148
165
|
keyboardType={keyboardType}
|
|
149
166
|
secureTextEntry={password}
|
|
@@ -174,6 +191,10 @@ const styles = StyleSheet.create({
|
|
|
174
191
|
: textAlignVertical === 'bottom'
|
|
175
192
|
? 'flex-end'
|
|
176
193
|
: 'flex-start',
|
|
194
|
+
flexBasis: 'auto',
|
|
195
|
+
_web: {
|
|
196
|
+
_classNames: 'input-container-base',
|
|
197
|
+
},
|
|
177
198
|
}),
|
|
178
199
|
input: (
|
|
179
200
|
flex,
|
|
@@ -185,12 +206,14 @@ const styles = StyleSheet.create({
|
|
|
185
206
|
alignSelf,
|
|
186
207
|
) => ({
|
|
187
208
|
flex,
|
|
188
|
-
paddingLeft: iconPosition === 'left' ? padding : paddingHorizontal,
|
|
189
|
-
paddingRight: iconPosition === 'right' ? padding : paddingHorizontal,
|
|
190
209
|
textAlignVertical,
|
|
191
210
|
maxWidth,
|
|
192
211
|
alignSelf,
|
|
193
|
-
outline: 'none'
|
|
212
|
+
outline: 'none',
|
|
213
|
+
flexBasis: 'auto',
|
|
214
|
+
_web: {
|
|
215
|
+
_classNames: 'input-base',
|
|
216
|
+
},
|
|
194
217
|
}),
|
|
195
218
|
icon: (iconPosition, paddingHorizontal, textAlignVertical) => ({
|
|
196
219
|
position: 'absolute',
|
|
@@ -198,6 +221,9 @@ const styles = StyleSheet.create({
|
|
|
198
221
|
...(iconPosition === 'right' && {right: paddingHorizontal}),
|
|
199
222
|
top: textAlignVertical !== 'top' ? 'auto' : 10,
|
|
200
223
|
bottom: textAlignVertical !== 'bottom' ? 'auto' : 10,
|
|
224
|
+
_web: {
|
|
225
|
+
_classNames: 'input-icon-base',
|
|
226
|
+
},
|
|
201
227
|
}),
|
|
202
228
|
})
|
|
203
229
|
|
package/lib/components/Link.tsx
CHANGED
|
@@ -37,6 +37,7 @@ const Link = ({
|
|
|
37
37
|
color,
|
|
38
38
|
mixins,
|
|
39
39
|
}: LinkProps) => {
|
|
40
|
+
console.log(color)
|
|
40
41
|
return (
|
|
41
42
|
<TouchableOpacity
|
|
42
43
|
onPress={async () => {
|
|
@@ -67,6 +68,9 @@ const Link = ({
|
|
|
67
68
|
const styles = StyleSheet.create({
|
|
68
69
|
link: (underline): any => ({
|
|
69
70
|
textDecorationLine: underline,
|
|
71
|
+
_web: {
|
|
72
|
+
_classNames: 'link-base',
|
|
73
|
+
},
|
|
70
74
|
}),
|
|
71
75
|
})
|
|
72
76
|
|
package/lib/components/Modal.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import Text from './Text'
|
|
|
13
13
|
import {ModalStyles, ModalTokens} from '../theme/Modal.recipe'
|
|
14
14
|
import {PalettesWithNestedKeys} from '../style/varia/types'
|
|
15
15
|
|
|
16
|
+
const AnimatedView = Animated.createAnimatedComponent(View)
|
|
16
17
|
type ModalVariants = UnistylesVariants<typeof ModalStyles>
|
|
17
18
|
type AnimationKey = keyof typeof ModalTokens.animations.variants
|
|
18
19
|
type ColorPaletteKey = PalettesWithNestedKeys
|
|
@@ -89,7 +90,7 @@ const ModalOverlay = ({children, ...props}: ModalOverlayProps) => {
|
|
|
89
90
|
ModalStyles.useVariants({variant})
|
|
90
91
|
|
|
91
92
|
return (
|
|
92
|
-
<
|
|
93
|
+
<AnimatedView
|
|
93
94
|
style={[styles.overlay, ModalStyles.overlay(colorPalette)]}
|
|
94
95
|
entering={ModalTokens.animations.variants[animation]?.enteringOverlay}
|
|
95
96
|
exiting={ModalTokens.animations.variants[animation]?.exitingOverlay}>
|
|
@@ -97,7 +98,7 @@ const ModalOverlay = ({children, ...props}: ModalOverlayProps) => {
|
|
|
97
98
|
<View style={StyleSheet.absoluteFillObject} />
|
|
98
99
|
</TouchableWithoutFeedback>
|
|
99
100
|
{children}
|
|
100
|
-
</
|
|
101
|
+
</AnimatedView>
|
|
101
102
|
)
|
|
102
103
|
}
|
|
103
104
|
|
|
@@ -123,12 +124,12 @@ const ModalContent = ({children, ...props}: ModalContentProps) => {
|
|
|
123
124
|
ModalStyles.useVariants({variant})
|
|
124
125
|
|
|
125
126
|
return (
|
|
126
|
-
<
|
|
127
|
+
<AnimatedView
|
|
127
128
|
style={[styles.content(), ModalStyles.content(colorPalette)]}
|
|
128
129
|
entering={ModalTokens.animations.variants[animation]?.enteringContent}
|
|
129
130
|
exiting={ModalTokens.animations.variants[animation]?.exitingContent}>
|
|
130
131
|
{children}
|
|
131
|
-
</
|
|
132
|
+
</AnimatedView>
|
|
132
133
|
)
|
|
133
134
|
}
|
|
134
135
|
|
|
@@ -217,11 +218,17 @@ const styles = StyleSheet.create(theme => {
|
|
|
217
218
|
zIndex: 1000,
|
|
218
219
|
justifyContent: 'center',
|
|
219
220
|
alignItems: 'center',
|
|
221
|
+
_web: {
|
|
222
|
+
_classNames: 'modal-overlay-base',
|
|
223
|
+
},
|
|
220
224
|
},
|
|
221
225
|
content: () => ({
|
|
222
226
|
justifyContent: 'center',
|
|
223
227
|
alignItems: 'center',
|
|
224
228
|
alignSelf: 'stretch',
|
|
229
|
+
_web: {
|
|
230
|
+
_classNames: 'modal-content-base',
|
|
231
|
+
},
|
|
225
232
|
}),
|
|
226
233
|
header: {
|
|
227
234
|
flexDirection: 'row',
|
|
@@ -229,9 +236,15 @@ const styles = StyleSheet.create(theme => {
|
|
|
229
236
|
alignItems: 'center',
|
|
230
237
|
width: '100%',
|
|
231
238
|
marginBottom: 10,
|
|
239
|
+
_web: {
|
|
240
|
+
_classNames: 'modal-header-base',
|
|
241
|
+
},
|
|
232
242
|
},
|
|
233
243
|
closeButton: {
|
|
234
244
|
color: 'white',
|
|
245
|
+
_web: {
|
|
246
|
+
_classNames: 'modal-close-button-base',
|
|
247
|
+
},
|
|
235
248
|
},
|
|
236
249
|
}
|
|
237
250
|
})
|
|
@@ -246,4 +259,4 @@ const Modal = Object.assign(ModalRoot, {
|
|
|
246
259
|
CloseTrigger: ModalCloseTrigger,
|
|
247
260
|
CloseButton: CloseButton,
|
|
248
261
|
})
|
|
249
|
-
export default Modal
|
|
262
|
+
export default Modal
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '../style/varia/types'
|
|
13
13
|
import Plus from '../icons/Plus'
|
|
14
14
|
import Minus from '../icons/Minus'
|
|
15
|
-
import {computeFlexSync} from '../style/varia/utils'
|
|
15
|
+
import {computeFlexSync, getVariantValue} from '../style/varia/utils'
|
|
16
16
|
|
|
17
17
|
type NumberInputVariants = UnistylesVariants<typeof NumberInputStyles>
|
|
18
18
|
|
|
@@ -204,8 +204,14 @@ const NumberInput = {
|
|
|
204
204
|
} = {...useSimpleNumberInputContext(), ...props}
|
|
205
205
|
NumberInputStyles.useVariants({variant, size, distribution})
|
|
206
206
|
|
|
207
|
-
const color = (NumberInputStyles.buttons(colorPalette) as {color: string})
|
|
208
|
-
|
|
207
|
+
// const color = (NumberInputStyles.buttons(colorPalette) as {color: string})
|
|
208
|
+
// .color
|
|
209
|
+
const color = getVariantValue(
|
|
210
|
+
NumberInputStyles.buttons(colorPalette),
|
|
211
|
+
'variant',
|
|
212
|
+
variant,
|
|
213
|
+
'color',
|
|
214
|
+
)
|
|
209
215
|
|
|
210
216
|
const iconElement = children || <IncreaseTriggerIcon />
|
|
211
217
|
const iconWithProps = React.isValidElement<IconProps>(iconElement)
|
|
@@ -241,8 +247,14 @@ const NumberInput = {
|
|
|
241
247
|
} = {...useSimpleNumberInputContext(), ...props}
|
|
242
248
|
NumberInputStyles.useVariants({variant, size, distribution})
|
|
243
249
|
|
|
244
|
-
const color = (NumberInputStyles.buttons(colorPalette) as {color: string})
|
|
245
|
-
|
|
250
|
+
// const color = (NumberInputStyles.buttons(colorPalette) as {color: string})
|
|
251
|
+
// .color
|
|
252
|
+
const color = getVariantValue(
|
|
253
|
+
NumberInputStyles.buttons(colorPalette),
|
|
254
|
+
'variant',
|
|
255
|
+
variant,
|
|
256
|
+
'color',
|
|
257
|
+
)
|
|
246
258
|
|
|
247
259
|
const iconElement = children || <DecreaseTriggerIcon />
|
|
248
260
|
const iconWithProps = React.isValidElement<IconProps>(iconElement)
|
|
@@ -282,13 +294,23 @@ const simpleNumberInputstyles = StyleSheet.create({
|
|
|
282
294
|
flex,
|
|
283
295
|
alignSelf,
|
|
284
296
|
alignItems: 'stretch',
|
|
297
|
+
flexBasis: 'auto',
|
|
298
|
+
_web: {
|
|
299
|
+
_classNames: 'number-input-root-base',
|
|
300
|
+
},
|
|
285
301
|
}),
|
|
286
302
|
input: (flex: number) => ({
|
|
287
303
|
paddingVertical: 0,
|
|
288
304
|
flex,
|
|
305
|
+
_web: {
|
|
306
|
+
_classNames: 'number-input-base',
|
|
307
|
+
},
|
|
289
308
|
}),
|
|
290
309
|
button: {
|
|
291
310
|
justifyContent: 'center',
|
|
292
311
|
alignItems: 'center',
|
|
312
|
+
_web: {
|
|
313
|
+
_classNames: 'number-input-button-base',
|
|
314
|
+
},
|
|
293
315
|
},
|
|
294
316
|
})
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
RadioGroupDefaultVariants,
|
|
7
7
|
} from '../theme/RadioGroup.recipe'
|
|
8
8
|
import {
|
|
9
|
+
AlignItems,
|
|
9
10
|
AlignSelf,
|
|
11
|
+
Flex,
|
|
12
|
+
Gap,
|
|
13
|
+
JustifyContent,
|
|
10
14
|
PalettesWithNestedKeys,
|
|
11
15
|
StackDirection,
|
|
12
16
|
} from '../style/varia/types'
|
|
@@ -21,9 +25,9 @@ type RadioGroupRootProps = RadioGroupVariants & {
|
|
|
21
25
|
direction?: StackDirection
|
|
22
26
|
flex?: number
|
|
23
27
|
alignSelf?: AlignSelf
|
|
24
|
-
justifyContent?:
|
|
25
|
-
alignItems?:
|
|
26
|
-
gap?:
|
|
28
|
+
justifyContent?: JustifyContent
|
|
29
|
+
alignItems?: AlignItems
|
|
30
|
+
gap?: Gap
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
type RadioGroupContextProps = {
|
|
@@ -32,7 +36,7 @@ type RadioGroupContextProps = {
|
|
|
32
36
|
colorPalette: PalettesWithNestedKeys
|
|
33
37
|
variant: RadioGroupVariants['variant']
|
|
34
38
|
size: RadioGroupVariants['size']
|
|
35
|
-
flex:
|
|
39
|
+
flex: Flex
|
|
36
40
|
alignSelf?: AlignSelf
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -58,7 +62,7 @@ function Root({
|
|
|
58
62
|
flex = 0,
|
|
59
63
|
alignSelf = 'auto',
|
|
60
64
|
direction = 'column',
|
|
61
|
-
justifyContent,
|
|
65
|
+
justifyContent = 'space-between',
|
|
62
66
|
alignItems,
|
|
63
67
|
gap,
|
|
64
68
|
}: RadioGroupRootProps) {
|
|
@@ -218,10 +222,17 @@ const styles = StyleSheet.create({
|
|
|
218
222
|
alignItems,
|
|
219
223
|
gap,
|
|
220
224
|
justifyContent,
|
|
225
|
+
flexBasis: 'auto',
|
|
226
|
+
_web: {
|
|
227
|
+
_classNames: 'radio-root',
|
|
228
|
+
},
|
|
221
229
|
}),
|
|
222
230
|
item: {
|
|
223
231
|
flexDirection: 'row',
|
|
224
232
|
alignItems: 'center',
|
|
233
|
+
_web: {
|
|
234
|
+
_classNames: 'radio-item',
|
|
235
|
+
},
|
|
225
236
|
},
|
|
226
237
|
})
|
|
227
238
|
|
|
@@ -52,7 +52,7 @@ const ReText = ({
|
|
|
52
52
|
return {
|
|
53
53
|
text: text.value,
|
|
54
54
|
} as TextInputProps
|
|
55
|
-
})
|
|
55
|
+
}, [text])
|
|
56
56
|
return (
|
|
57
57
|
<AnimatedTextInput
|
|
58
58
|
underlineColorAndroid="transparent"
|
|
@@ -81,6 +81,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
81
81
|
}),
|
|
82
82
|
...(fontSize && {fontSize}),
|
|
83
83
|
textAlign: 'left',
|
|
84
|
+
_web: {
|
|
85
|
+
_classNames: 'retext-text-base',
|
|
86
|
+
},
|
|
84
87
|
}),
|
|
85
88
|
customStyle: style => ({
|
|
86
89
|
...style,
|
|
@@ -277,24 +277,41 @@ const styles = StyleSheet.create({
|
|
|
277
277
|
justifyContent: 'center',
|
|
278
278
|
...(stretch ? {alignSelf: stretch} : {}),
|
|
279
279
|
alignItems: 'stretch',
|
|
280
|
+
flexBasis: 'auto',
|
|
281
|
+
_web: {
|
|
282
|
+
_classNames: 'select-container-base',
|
|
283
|
+
},
|
|
280
284
|
}),
|
|
281
285
|
input: (flex: Flex) => ({
|
|
282
286
|
flex,
|
|
283
287
|
flexDirection: 'row',
|
|
284
288
|
alignItems: 'center',
|
|
285
289
|
justifyContent: 'center',
|
|
290
|
+
flexBasis: 'auto',
|
|
291
|
+
_web: {
|
|
292
|
+
_classNames: 'select-input-base',
|
|
293
|
+
},
|
|
286
294
|
}),
|
|
287
295
|
item: {
|
|
288
296
|
alignItems: 'center',
|
|
289
297
|
flexDirection: 'row',
|
|
298
|
+
_web: {
|
|
299
|
+
_classNames: 'select-item-base',
|
|
300
|
+
},
|
|
290
301
|
},
|
|
291
302
|
backdrop: {
|
|
292
303
|
...StyleSheet.absoluteFillObject,
|
|
293
304
|
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
305
|
+
_web: {
|
|
306
|
+
_classNames: 'select-backdrop-base',
|
|
307
|
+
},
|
|
294
308
|
},
|
|
295
309
|
modalContent: {
|
|
296
310
|
overflow: 'hidden',
|
|
297
311
|
alignSelf: 'stretch',
|
|
312
|
+
_web: {
|
|
313
|
+
_classNames: 'select-modal-content-base',
|
|
314
|
+
},
|
|
298
315
|
},
|
|
299
316
|
portalContainer: {
|
|
300
317
|
position: 'absolute',
|
|
@@ -304,5 +321,8 @@ const styles = StyleSheet.create({
|
|
|
304
321
|
bottom: 0,
|
|
305
322
|
justifyContent: 'center',
|
|
306
323
|
alignItems: 'center',
|
|
324
|
+
_web: {
|
|
325
|
+
_classNames: 'select-portal-container-base',
|
|
326
|
+
},
|
|
307
327
|
},
|
|
308
328
|
})
|