@xetwa/design-system 1.0.19 → 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}
|
|
@@ -72,8 +72,8 @@ export const PlanCard = ({
|
|
|
72
72
|
};
|
|
73
73
|
case 'explorateur':
|
|
74
74
|
return {
|
|
75
|
-
borderWidth:
|
|
76
|
-
borderColor: '#f2974b',
|
|
75
|
+
borderWidth: isSelected ? 3 : 1.5,
|
|
76
|
+
borderColor: isSelected ? '#f2974b' : '#efe2d6',
|
|
77
77
|
backgroundColor: '#ffffff',
|
|
78
78
|
borderRadius: scale(18),
|
|
79
79
|
paddingVertical: scale(14),
|
|
@@ -81,13 +81,13 @@ export const PlanCard = ({
|
|
|
81
81
|
shadow: 'none' as const,
|
|
82
82
|
overflow: 'visible' as const,
|
|
83
83
|
flatShadow: false,
|
|
84
|
-
customShadow: {
|
|
84
|
+
customShadow: isSelected ? {
|
|
85
85
|
shadowColor: '#fce3ce', // light orange tint for shadow
|
|
86
86
|
shadowOffset: { width: 4, height: 4 },
|
|
87
87
|
shadowOpacity: 1,
|
|
88
88
|
shadowRadius: 0,
|
|
89
89
|
elevation: 4, // Android fallback
|
|
90
|
-
}
|
|
90
|
+
} : null
|
|
91
91
|
};
|
|
92
92
|
case 'fluent':
|
|
93
93
|
return {
|
|
@@ -144,7 +144,11 @@ export const PlanCard = ({
|
|
|
144
144
|
paddingHorizontal={config.paddingHorizontal}
|
|
145
145
|
shadow={config.shadow}
|
|
146
146
|
overflow={config.overflow}
|
|
147
|
-
isSelected
|
|
147
|
+
// Do not pass isSelected to BaseCard for explorateur if we manually manage it in config,
|
|
148
|
+
// to prevent BaseCard from forcing its own activeBorderWidth (2).
|
|
149
|
+
// Wait, if decouverte uses BaseCard's isSelected, we can just pass it selectively or change BaseCard.
|
|
150
|
+
// Let's just NOT pass isSelected for explorateur since we computed the exact colors and width in config.
|
|
151
|
+
isSelected={tier === 'decouverte' ? isSelected : false}
|
|
148
152
|
style={[
|
|
149
153
|
config.flatShadow ? styles.fluentFlatShadow : null,
|
|
150
154
|
config.customShadow ? config.customShadow : null,
|
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';
|