@xetwa/design-system 1.0.20 → 1.0.22
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/package.json
CHANGED
|
@@ -21,6 +21,12 @@ export interface WordChipProps {
|
|
|
21
21
|
style?: ViewStyle | ViewStyle[];
|
|
22
22
|
/** Impede cliques. */
|
|
23
23
|
disabled?: boolean;
|
|
24
|
+
/** Se verdadeiro, ocupa a largura total disponível. */
|
|
25
|
+
fullWidth?: boolean;
|
|
26
|
+
/** Tamanho do chip. */
|
|
27
|
+
size?: 'sm' | 'md' | 'lg';
|
|
28
|
+
/** Largura personalizada. Ignora max-width e align-self flex-start. */
|
|
29
|
+
width?: number | string;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
export const WordChip = ({
|
|
@@ -29,6 +35,9 @@ export const WordChip = ({
|
|
|
29
35
|
onPress,
|
|
30
36
|
style,
|
|
31
37
|
disabled = false,
|
|
38
|
+
fullWidth = false,
|
|
39
|
+
size = 'md',
|
|
40
|
+
width,
|
|
32
41
|
}: WordChipProps) => {
|
|
33
42
|
const { scale, scaleText } = useResponsive();
|
|
34
43
|
const [isPressed, setIsPressed] = useState(false);
|
|
@@ -97,13 +106,13 @@ export const WordChip = ({
|
|
|
97
106
|
const showPressed = isPressed && !isDisabled;
|
|
98
107
|
|
|
99
108
|
return (
|
|
100
|
-
<Animated.View style={[{ transform: [{ scale: scaleAnim }] }, style]}>
|
|
109
|
+
<Animated.View style={[{ transform: [{ scale: scaleAnim }] }, width ? { width } : null, style]}>
|
|
101
110
|
<Pressable
|
|
102
111
|
onPressIn={() => setIsPressed(true)}
|
|
103
112
|
onPressOut={() => setIsPressed(false)}
|
|
104
113
|
onPress={onPress}
|
|
105
114
|
disabled={isDisabled}
|
|
106
|
-
style={{ alignSelf: 'flex-start' }}
|
|
115
|
+
style={{ alignSelf: width ? 'stretch' : (fullWidth ? 'stretch' : 'flex-start') }}
|
|
107
116
|
>
|
|
108
117
|
<View style={[
|
|
109
118
|
styles.shadowContainer,
|
|
@@ -112,7 +121,8 @@ export const WordChip = ({
|
|
|
112
121
|
borderRadius: scale(12),
|
|
113
122
|
paddingBottom: showPressed ? 0 : scale(3),
|
|
114
123
|
marginTop: showPressed ? scale(3) : 0,
|
|
115
|
-
}
|
|
124
|
+
},
|
|
125
|
+
(fullWidth || width) ? { alignSelf: 'stretch', width: '100%' } : null
|
|
116
126
|
]}>
|
|
117
127
|
<View style={[
|
|
118
128
|
styles.innerContainer,
|
|
@@ -120,16 +130,17 @@ export const WordChip = ({
|
|
|
120
130
|
backgroundColor: currentStyles.bg,
|
|
121
131
|
borderColor: currentStyles.border,
|
|
122
132
|
borderRadius: scale(12),
|
|
123
|
-
paddingVertical: scale(9),
|
|
124
|
-
paddingHorizontal: scale(14),
|
|
125
|
-
minHeight: scale(44),
|
|
126
|
-
}
|
|
133
|
+
paddingVertical: scale(size === 'lg' ? 14 : size === 'sm' ? 6 : 9),
|
|
134
|
+
paddingHorizontal: scale(size === 'lg' ? 20 : size === 'sm' ? 10 : 14),
|
|
135
|
+
minHeight: scale(size === 'lg' ? 56 : size === 'sm' ? 36 : 44),
|
|
136
|
+
},
|
|
137
|
+
(fullWidth || width) ? { width: '100%' } : null
|
|
127
138
|
]}>
|
|
128
139
|
<Typography style={[
|
|
129
140
|
styles.text,
|
|
130
141
|
{
|
|
131
142
|
color: currentStyles.text,
|
|
132
|
-
fontSize: scaleText(15),
|
|
143
|
+
fontSize: scaleText(size === 'lg' ? 17 : size === 'sm' ? 13 : 15),
|
|
133
144
|
}
|
|
134
145
|
]}>
|
|
135
146
|
{word}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './components/DataDisplay/LevelBadge/LevelBadge';
|
|
|
23
23
|
export * from './hooks/useResponsive';
|
|
24
24
|
export * from './components/Mascots/Vava/Vava';
|
|
25
25
|
export * from './components/Mascots/Yaya/Yaya';
|
|
26
|
+
export * from './components/Buttons/WordChip/WordChip';
|
|
26
27
|
export * from './components/Feedback/FeedbackBottomSheet/FeedbackBottomSheet';
|
|
27
28
|
export * from './components/Headers/ProfileHeader/ProfileHeader';
|
|
28
29
|
export * from './components/Inputs/FillInTheBlank/FillInTheBlank';
|