@xetwa/design-system 1.0.20 → 1.0.21
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,10 @@ 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';
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export const WordChip = ({
|
|
@@ -29,6 +33,8 @@ export const WordChip = ({
|
|
|
29
33
|
onPress,
|
|
30
34
|
style,
|
|
31
35
|
disabled = false,
|
|
36
|
+
fullWidth = false,
|
|
37
|
+
size = 'md',
|
|
32
38
|
}: WordChipProps) => {
|
|
33
39
|
const { scale, scaleText } = useResponsive();
|
|
34
40
|
const [isPressed, setIsPressed] = useState(false);
|
|
@@ -103,7 +109,7 @@ export const WordChip = ({
|
|
|
103
109
|
onPressOut={() => setIsPressed(false)}
|
|
104
110
|
onPress={onPress}
|
|
105
111
|
disabled={isDisabled}
|
|
106
|
-
style={{ alignSelf: 'flex-start' }}
|
|
112
|
+
style={{ alignSelf: fullWidth ? 'stretch' : 'flex-start' }}
|
|
107
113
|
>
|
|
108
114
|
<View style={[
|
|
109
115
|
styles.shadowContainer,
|
|
@@ -120,16 +126,17 @@ export const WordChip = ({
|
|
|
120
126
|
backgroundColor: currentStyles.bg,
|
|
121
127
|
borderColor: currentStyles.border,
|
|
122
128
|
borderRadius: scale(12),
|
|
123
|
-
paddingVertical: scale(9),
|
|
124
|
-
paddingHorizontal: scale(14),
|
|
125
|
-
minHeight: scale(44),
|
|
126
|
-
}
|
|
129
|
+
paddingVertical: scale(size === 'lg' ? 14 : size === 'sm' ? 6 : 9),
|
|
130
|
+
paddingHorizontal: scale(size === 'lg' ? 20 : size === 'sm' ? 10 : 14),
|
|
131
|
+
minHeight: scale(size === 'lg' ? 56 : size === 'sm' ? 36 : 44),
|
|
132
|
+
},
|
|
133
|
+
fullWidth && { width: '100%' }
|
|
127
134
|
]}>
|
|
128
135
|
<Typography style={[
|
|
129
136
|
styles.text,
|
|
130
137
|
{
|
|
131
138
|
color: currentStyles.text,
|
|
132
|
-
fontSize: scaleText(15),
|
|
139
|
+
fontSize: scaleText(size === 'lg' ? 17 : size === 'sm' ? 13 : 15),
|
|
133
140
|
}
|
|
134
141
|
]}>
|
|
135
142
|
{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';
|