react-native-varia 0.2.2 → 0.2.4
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 +316 -139
- package/lib/components/Accordion.tsx +113 -0
- package/lib/components/Button.tsx +19 -8
- package/lib/components/CircleProgress.tsx +46 -28
- package/lib/components/Divider.tsx +18 -15
- package/lib/components/Drawer.tsx +496 -0
- package/lib/components/Field.tsx +24 -39
- package/lib/components/GradientBackground.tsx +25 -7
- package/lib/components/GradientText.tsx +38 -11
- package/lib/components/IconWrapper.tsx +20 -14
- package/lib/components/Input.tsx +106 -25
- package/lib/components/NumberInput.tsx +88 -19
- package/lib/components/OldSlider.tsx +327 -0
- package/lib/components/RadioGroup.tsx +55 -17
- package/lib/components/ReText.tsx +1 -1
- package/lib/components/Select.tsx +58 -22
- package/lib/components/Slider.tsx +176 -115
- package/lib/components/Slideshow.tsx +68 -69
- package/lib/components/SlidingDrawer.tsx +72 -29
- package/lib/components/Spinner.tsx +6 -2
- package/lib/components/Toast.tsx +89 -0
- package/lib/components/context/Field.tsx +27 -0
- package/lib/icons/Minus.tsx +24 -0
- package/lib/icons/Plus.tsx +23 -0
- package/lib/theme/Button.recipe.tsx +11 -1
- package/lib/theme/CircleProgress.recipe.tsx +3 -3
- package/lib/theme/Field.recipe.tsx +17 -2
- package/lib/theme/Input.recipe.tsx +12 -3
- package/lib/theme/NumberInput.recipe.tsx +9 -4
- package/lib/theme/RadioGroup.recipe.tsx +7 -1
- package/lib/theme/Select.recipe.tsx +7 -7
- package/lib/theme/Slider.recipe.tsx +366 -22
- package/lib/theme/Slideshow.recipe.tsx +1 -1
- package/lib/theme/SlidingDrawer.recipe.tsx +58 -4
- package/lib/theme/Toast.recipe.tsx +71 -0
- package/package.json +3 -2
- package/lib/components/NewSelect.tsx +0 -202
- package/lib/components/index.tsx +0 -83
- package/lib/components/layoutTest.tsx +0 -74
- package/lib/theme/Button.recipe-old.tsx +0 -67
|
@@ -8,12 +8,13 @@ import Animated, {
|
|
|
8
8
|
withTiming,
|
|
9
9
|
type SharedValue,
|
|
10
10
|
} from 'react-native-reanimated'
|
|
11
|
-
import {
|
|
11
|
+
import {scheduleOnRN} from 'react-native-worklets'
|
|
12
12
|
import {
|
|
13
13
|
SlidingDrawerTokens,
|
|
14
14
|
SlidingDrawerStyles,
|
|
15
15
|
} from '../theme/SlidingDrawer.recipe'
|
|
16
16
|
import {PalettesWithNestedKeys} from '../style/varia/types'
|
|
17
|
+
import {TouchableWithoutFeedback, ViewStyle} from 'react-native'
|
|
17
18
|
|
|
18
19
|
export type SlidingDrawerRef = {
|
|
19
20
|
snapTo: (point: number) => void | null
|
|
@@ -26,6 +27,7 @@ type SlidingDrawerVariants = UnistylesVariants<typeof SlidingDrawerStyles>
|
|
|
26
27
|
type SlidingDrawerProps = SlidingDrawerVariants & {
|
|
27
28
|
colorPalette?: PalettesWithNestedKeys
|
|
28
29
|
animation?: keyof typeof SlidingDrawerTokens.variants.animation
|
|
30
|
+
width?: string
|
|
29
31
|
flex?: number
|
|
30
32
|
direction?: 1 | -1
|
|
31
33
|
onCollapse?: () => void
|
|
@@ -35,14 +37,20 @@ type SlidingDrawerProps = SlidingDrawerVariants & {
|
|
|
35
37
|
axis: 'y' | 'x'
|
|
36
38
|
allowGestures?: boolean
|
|
37
39
|
overlay?: boolean
|
|
40
|
+
closeOnOverlayPress?: boolean
|
|
38
41
|
children?: React.ReactNode
|
|
39
|
-
ref?: React.RefObject<SlidingDrawerRef>
|
|
42
|
+
ref?: React.RefObject<SlidingDrawerRef | null>
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(
|
|
46
|
+
TouchableWithoutFeedback,
|
|
47
|
+
)
|
|
48
|
+
|
|
42
49
|
const SlidingDrawer = ({
|
|
43
50
|
colorPalette = 'accent',
|
|
44
51
|
variant = SlidingDrawerTokens.defaultProps.variant,
|
|
45
52
|
animation = SlidingDrawerTokens.defaultProps.animation,
|
|
53
|
+
width = '100%',
|
|
46
54
|
flex = 0,
|
|
47
55
|
direction = 1,
|
|
48
56
|
onCollapse,
|
|
@@ -52,6 +60,7 @@ const SlidingDrawer = ({
|
|
|
52
60
|
axis,
|
|
53
61
|
allowGestures = true,
|
|
54
62
|
overlay = false,
|
|
63
|
+
closeOnOverlayPress = true,
|
|
55
64
|
children,
|
|
56
65
|
ref,
|
|
57
66
|
}: SlidingDrawerProps) => {
|
|
@@ -64,7 +73,7 @@ const SlidingDrawer = ({
|
|
|
64
73
|
const translate = useSharedValue(points[0])
|
|
65
74
|
|
|
66
75
|
const context: SharedValue<{
|
|
67
|
-
position:
|
|
76
|
+
position: number
|
|
68
77
|
snapPoint: number
|
|
69
78
|
}> = useSharedValue({
|
|
70
79
|
position: points[0],
|
|
@@ -97,7 +106,7 @@ const SlidingDrawer = ({
|
|
|
97
106
|
animationVariant.props,
|
|
98
107
|
)
|
|
99
108
|
updateCurrentSnapPoint(destination)
|
|
100
|
-
onSnap &&
|
|
109
|
+
onSnap && scheduleOnRN(onSnap, destination)
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
|
|
@@ -106,7 +115,7 @@ const SlidingDrawer = ({
|
|
|
106
115
|
if (overlay) {
|
|
107
116
|
showOverlay()
|
|
108
117
|
}
|
|
109
|
-
onExpand &&
|
|
118
|
+
onExpand && scheduleOnRN(onExpand)
|
|
110
119
|
}
|
|
111
120
|
|
|
112
121
|
const isCollapsed = () => {
|
|
@@ -119,7 +128,7 @@ const SlidingDrawer = ({
|
|
|
119
128
|
if (overlay) {
|
|
120
129
|
hideOverlay()
|
|
121
130
|
}
|
|
122
|
-
onCollapse &&
|
|
131
|
+
onCollapse && scheduleOnRN(onCollapse)
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
const hideOverlay = () => {
|
|
@@ -147,12 +156,39 @@ const SlidingDrawer = ({
|
|
|
147
156
|
})
|
|
148
157
|
.onUpdate(event => {
|
|
149
158
|
const delta = axis === 'y' ? event.translationY : event.translationX
|
|
150
|
-
|
|
159
|
+
|
|
160
|
+
const proposed = delta + (context.value.position ?? 0)
|
|
161
|
+
|
|
162
|
+
const minPoint = Math.min(...points)
|
|
163
|
+
const maxPoint = Math.max(...points)
|
|
164
|
+
|
|
165
|
+
let clamped = proposed
|
|
166
|
+
|
|
167
|
+
if (proposed < minPoint) {
|
|
168
|
+
const overdrag = minPoint - proposed
|
|
169
|
+
clamped = minPoint - overdrag / (1 + overdrag / 60)
|
|
170
|
+
} else if (proposed > maxPoint) {
|
|
171
|
+
const overdrag = proposed - maxPoint
|
|
172
|
+
clamped = maxPoint + overdrag / (1 + overdrag / 60)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
translate.value = clamped
|
|
151
176
|
})
|
|
152
177
|
.onEnd(({velocityX, velocityY, translationX, translationY}) => {
|
|
153
178
|
const velocity = axis === 'y' ? velocityY : velocityX
|
|
154
179
|
const translation = axis === 'y' ? translationY : translationX
|
|
155
180
|
|
|
181
|
+
const minPoint = Math.min(...points)
|
|
182
|
+
const maxPoint = Math.max(...points)
|
|
183
|
+
|
|
184
|
+
if (translate.value < minPoint) {
|
|
185
|
+
translate.value = withSpring(minPoint, {velocity})
|
|
186
|
+
return
|
|
187
|
+
} else if (translate.value > maxPoint) {
|
|
188
|
+
translate.value = withSpring(maxPoint, {velocity})
|
|
189
|
+
return
|
|
190
|
+
}
|
|
191
|
+
|
|
156
192
|
const forwardsThreshold =
|
|
157
193
|
(points[context.value.snapPoint] +
|
|
158
194
|
points[context.value.snapPoint + 1]) /
|
|
@@ -197,39 +233,44 @@ const SlidingDrawer = ({
|
|
|
197
233
|
})
|
|
198
234
|
|
|
199
235
|
const blockAnimatedStyle = useAnimatedStyle(() => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{
|
|
203
|
-
|
|
204
|
-
}
|
|
236
|
+
if (axis === 'y') {
|
|
237
|
+
return {
|
|
238
|
+
transform: [{translateY: translate.value}],
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
return {
|
|
242
|
+
transform: [{translateX: translate.value}],
|
|
243
|
+
}
|
|
244
|
+
}
|
|
205
245
|
})
|
|
206
246
|
|
|
207
247
|
const displayOverlayStyle = useAnimatedStyle(() => {
|
|
208
248
|
return {
|
|
209
|
-
display: changeDisplay.value,
|
|
249
|
+
display: changeDisplay.value as ViewStyle['display'],
|
|
210
250
|
opacity: opacity.value,
|
|
211
|
-
}
|
|
251
|
+
}
|
|
212
252
|
})
|
|
213
253
|
|
|
214
254
|
return (
|
|
215
255
|
<>
|
|
216
256
|
{overlay && (
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
257
|
+
<AnimatedTouchableOpacity
|
|
258
|
+
onPress={() => closeOnOverlayPress && collapse()}>
|
|
259
|
+
<Animated.View
|
|
260
|
+
style={[
|
|
261
|
+
StyleSheet.absoluteFillObject,
|
|
262
|
+
displayOverlayStyle,
|
|
263
|
+
SlidingDrawerStyles.overlay(colorPalette),
|
|
264
|
+
]}
|
|
265
|
+
/>
|
|
266
|
+
</AnimatedTouchableOpacity>
|
|
226
267
|
)}
|
|
227
268
|
<GestureDetector gesture={slideGesture}>
|
|
228
269
|
<Animated.View
|
|
229
270
|
style={[
|
|
230
|
-
styles.container(flex, direction, axis,
|
|
271
|
+
styles.container(flex, direction, axis, width),
|
|
231
272
|
blockAnimatedStyle,
|
|
232
|
-
SlidingDrawerStyles.
|
|
273
|
+
SlidingDrawerStyles.slider(colorPalette),
|
|
233
274
|
]}>
|
|
234
275
|
{children}
|
|
235
276
|
</Animated.View>
|
|
@@ -240,14 +281,16 @@ const SlidingDrawer = ({
|
|
|
240
281
|
export default SlidingDrawer
|
|
241
282
|
|
|
242
283
|
const styles = StyleSheet.create({
|
|
243
|
-
container: (flex, direction, axis,
|
|
284
|
+
container: (flex, direction, axis, width) => ({
|
|
244
285
|
position: flex === 0 ? 'absolute' : 'relative',
|
|
245
|
-
bottom: axis === 'y' && direction === 1 ? 0 : 'auto',
|
|
246
|
-
top: axis === 'y' && direction ===
|
|
286
|
+
bottom: axis === 'y' && direction === -1 ? 0 : 'auto',
|
|
287
|
+
top: axis === 'y' && direction === 1 ? 0 : 'auto',
|
|
247
288
|
left: axis === 'x' ? 0 : 'auto',
|
|
248
289
|
flex: flex === 0 ? 1 : flex,
|
|
249
290
|
height: '100%',
|
|
250
|
-
width
|
|
291
|
+
width,
|
|
292
|
+
flexDirection: 'column',
|
|
293
|
+
alignSelf: 'stretch',
|
|
251
294
|
alignItems: 'center',
|
|
252
295
|
justifyContent: 'flex-start',
|
|
253
296
|
zIndex: 100,
|
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
type ViewStyle,
|
|
6
6
|
} from 'react-native'
|
|
7
7
|
import {withUnistyles, UnistylesVariants} from 'react-native-unistyles'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
NestedColorsType,
|
|
10
|
+
PalettesWithNestedKeys,
|
|
11
|
+
ThemeColors,
|
|
12
|
+
} from '../style/varia/types'
|
|
9
13
|
import {SpinnerTokens} from '../theme/Spinner.recipe'
|
|
10
14
|
import {resolveColor} from '../style/varia/utils'
|
|
11
15
|
import {SpinnerStyles} from '../theme/Spinner.recipe'
|
|
@@ -16,7 +20,7 @@ export type SpinnerProps = SpinnerVariants &
|
|
|
16
20
|
color?: ThemeColors
|
|
17
21
|
style?: StyleProp<ViewStyle>
|
|
18
22
|
mixins?: StyleProp<ViewStyle> | StyleProp<ViewStyle>[]
|
|
19
|
-
colors:
|
|
23
|
+
colors: NestedColorsType
|
|
20
24
|
colorPalette?: PalettesWithNestedKeys
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, {useEffect} from 'react'
|
|
2
|
+
import {StyleSheet} from 'react-native'
|
|
3
|
+
import Animated, {
|
|
4
|
+
useSharedValue,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
withTiming,
|
|
7
|
+
Easing,
|
|
8
|
+
} from 'react-native-reanimated'
|
|
9
|
+
import {scheduleOnRN} from 'react-native-worklets'
|
|
10
|
+
import {ToastStyles, ToastDefaultVariants} from '../theme/Toast.recipe'
|
|
11
|
+
import {UnistylesVariants} from 'react-native-unistyles'
|
|
12
|
+
import {PalettesWithNestedKeys} from '../style/varia/types'
|
|
13
|
+
import Text from './Text'
|
|
14
|
+
|
|
15
|
+
type ToastVariants = UnistylesVariants<typeof ToastStyles>
|
|
16
|
+
type ToastProps = ToastVariants & {
|
|
17
|
+
colorPalette?: PalettesWithNestedKeys
|
|
18
|
+
message: string
|
|
19
|
+
duration?: number
|
|
20
|
+
onClose?: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const Toast: React.FC<ToastProps> = ({
|
|
24
|
+
colorPalette = 'accent',
|
|
25
|
+
variant = ToastDefaultVariants.variant,
|
|
26
|
+
size = ToastDefaultVariants.size,
|
|
27
|
+
message,
|
|
28
|
+
duration = 5000,
|
|
29
|
+
onClose,
|
|
30
|
+
}) => {
|
|
31
|
+
ToastStyles.useVariants({
|
|
32
|
+
variant,
|
|
33
|
+
size,
|
|
34
|
+
})
|
|
35
|
+
const opacity = useSharedValue(0)
|
|
36
|
+
const translateY = useSharedValue(50) // Aparece desde abajo
|
|
37
|
+
|
|
38
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
39
|
+
opacity: opacity.value,
|
|
40
|
+
transform: [{translateY: translateY.value}],
|
|
41
|
+
}))
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
// Animación de entrada
|
|
45
|
+
opacity.value = withTiming(1, {
|
|
46
|
+
duration: 200,
|
|
47
|
+
easing: Easing.out(Easing.ease),
|
|
48
|
+
})
|
|
49
|
+
translateY.value = withTiming(0, {
|
|
50
|
+
duration: 200,
|
|
51
|
+
easing: Easing.out(Easing.ease),
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
// Animación de salida
|
|
55
|
+
const timeout = setTimeout(() => {
|
|
56
|
+
opacity.value = withTiming(0, {duration: 300})
|
|
57
|
+
translateY.value = withTiming(50, {duration: 300}, () => {
|
|
58
|
+
if (onClose) scheduleOnRN(onClose)
|
|
59
|
+
})
|
|
60
|
+
}, duration)
|
|
61
|
+
|
|
62
|
+
return () => clearTimeout(timeout)
|
|
63
|
+
}, [])
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Animated.View
|
|
67
|
+
style={[
|
|
68
|
+
styles.container,
|
|
69
|
+
animatedStyle,
|
|
70
|
+
ToastStyles.container(colorPalette),
|
|
71
|
+
]}>
|
|
72
|
+
<Text style={ToastStyles.text(colorPalette)}>{message}</Text>
|
|
73
|
+
</Animated.View>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
container: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
bottom: 50,
|
|
81
|
+
// left: 20,
|
|
82
|
+
// right: 20,
|
|
83
|
+
padding: 15,
|
|
84
|
+
borderRadius: 8,
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export default Toast
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {createContext, useContext} from 'react'
|
|
2
|
+
import {UnistylesVariants} from 'react-native-unistyles'
|
|
3
|
+
import {FieldStyles} from '../../theme/Field.recipe'
|
|
4
|
+
import {PalettesWithNestedKeys} from '../../style/varia/types'
|
|
5
|
+
|
|
6
|
+
export type FieldVariants = UnistylesVariants<typeof FieldStyles>
|
|
7
|
+
|
|
8
|
+
export type FieldContextType = {
|
|
9
|
+
error?: string
|
|
10
|
+
variant?: FieldVariants['variant']
|
|
11
|
+
size?: FieldVariants['size']
|
|
12
|
+
colorPalette?: PalettesWithNestedKeys
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const FieldContext = createContext<FieldContextType | undefined>(undefined)
|
|
16
|
+
|
|
17
|
+
export function useField() {
|
|
18
|
+
const context = useContext(FieldContext)
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
'Field subcomponents (Label, Error) must be used inside Field.Root',
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
return context
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default FieldContext
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {IconWrapperProps, ThemedIcon} from '../components/IconWrapper'
|
|
3
|
+
import {Path} from 'react-native-svg'
|
|
4
|
+
import {View} from 'react-native'
|
|
5
|
+
|
|
6
|
+
const Minus = ({
|
|
7
|
+
color,
|
|
8
|
+
...props
|
|
9
|
+
}: Omit<IconWrapperProps, 'children' | 'colors'>) => {
|
|
10
|
+
return (
|
|
11
|
+
<ThemedIcon {...props} color={color}>
|
|
12
|
+
<>
|
|
13
|
+
<Path
|
|
14
|
+
stroke={color}
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
strokeWidth="2.5"
|
|
18
|
+
d="M1.5 12h20"
|
|
19
|
+
/>
|
|
20
|
+
</>
|
|
21
|
+
</ThemedIcon>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
export default Minus
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {IconWrapperProps, ThemedIcon} from '../components/IconWrapper'
|
|
3
|
+
import {Path} from 'react-native-svg'
|
|
4
|
+
|
|
5
|
+
const Plus = ({
|
|
6
|
+
color,
|
|
7
|
+
...props
|
|
8
|
+
}: Omit<IconWrapperProps, 'children' | 'colors'>) => {
|
|
9
|
+
return (
|
|
10
|
+
<ThemedIcon {...props} color={color}>
|
|
11
|
+
<>
|
|
12
|
+
<Path
|
|
13
|
+
stroke={color}
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
strokeLinejoin="round"
|
|
16
|
+
strokeWidth="2.5"
|
|
17
|
+
d="M1.5 11.5h20m-10-10v20"
|
|
18
|
+
/>
|
|
19
|
+
</>
|
|
20
|
+
</ThemedIcon>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
export default Plus
|
|
@@ -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: {
|
|
@@ -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
|
}),
|
|
@@ -38,7 +39,7 @@ export const NumberInputStyles = StyleSheet.create(theme => ({
|
|
|
38
39
|
},
|
|
39
40
|
variant: {
|
|
40
41
|
solid: {
|
|
41
|
-
color: theme.colors[colorPalette]
|
|
42
|
+
color: theme.colors[colorPalette].text,
|
|
42
43
|
borderColor: theme.colors.border.default,
|
|
43
44
|
borderWidth: 1,
|
|
44
45
|
borderRadius: theme.radii.sm,
|
|
@@ -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: {},
|