@xetwa/design-system 1.0.18 → 1.0.20
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
|
@@ -30,6 +30,8 @@ export interface PlanCardProps {
|
|
|
30
30
|
isPopular?: boolean;
|
|
31
31
|
/** Texto customizado para o badge (ex: "POUPA 40%") */
|
|
32
32
|
badgeText?: string;
|
|
33
|
+
/** Define se o plano está selecionado */
|
|
34
|
+
isSelected?: boolean;
|
|
33
35
|
/** Estilização customizada do container. */
|
|
34
36
|
style?: ViewStyle | ViewStyle[];
|
|
35
37
|
/** Variante de layout do cartão (completo ou miniatura). */
|
|
@@ -46,6 +48,7 @@ export const PlanCard = ({
|
|
|
46
48
|
excludedItems = [],
|
|
47
49
|
isPopular = false,
|
|
48
50
|
badgeText,
|
|
51
|
+
isSelected = false,
|
|
49
52
|
style,
|
|
50
53
|
variant = 'default',
|
|
51
54
|
}: PlanCardProps) => {
|
|
@@ -69,8 +72,8 @@ export const PlanCard = ({
|
|
|
69
72
|
};
|
|
70
73
|
case 'explorateur':
|
|
71
74
|
return {
|
|
72
|
-
borderWidth:
|
|
73
|
-
borderColor: '#f2974b',
|
|
75
|
+
borderWidth: isSelected ? 3 : 1.5,
|
|
76
|
+
borderColor: isSelected ? '#f2974b' : '#efe2d6',
|
|
74
77
|
backgroundColor: '#ffffff',
|
|
75
78
|
borderRadius: scale(18),
|
|
76
79
|
paddingVertical: scale(14),
|
|
@@ -78,13 +81,13 @@ export const PlanCard = ({
|
|
|
78
81
|
shadow: 'none' as const,
|
|
79
82
|
overflow: 'visible' as const,
|
|
80
83
|
flatShadow: false,
|
|
81
|
-
customShadow: {
|
|
84
|
+
customShadow: isSelected ? {
|
|
82
85
|
shadowColor: '#fce3ce', // light orange tint for shadow
|
|
83
86
|
shadowOffset: { width: 4, height: 4 },
|
|
84
87
|
shadowOpacity: 1,
|
|
85
88
|
shadowRadius: 0,
|
|
86
89
|
elevation: 4, // Android fallback
|
|
87
|
-
}
|
|
90
|
+
} : null
|
|
88
91
|
};
|
|
89
92
|
case 'fluent':
|
|
90
93
|
return {
|
|
@@ -141,6 +144,11 @@ export const PlanCard = ({
|
|
|
141
144
|
paddingHorizontal={config.paddingHorizontal}
|
|
142
145
|
shadow={config.shadow}
|
|
143
146
|
overflow={config.overflow}
|
|
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}
|
|
144
152
|
style={[
|
|
145
153
|
config.flatShadow ? styles.fluentFlatShadow : null,
|
|
146
154
|
config.customShadow ? config.customShadow : null,
|