@xetwa/design-system 1.0.12 → 1.0.14

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xetwa/design-system",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -28,6 +28,8 @@ export interface PlanCardProps {
28
28
  excludedItems?: string[];
29
29
  /** Define se o cartão deve exibir o badge de "mais popular". */
30
30
  isPopular?: boolean;
31
+ /** Texto customizado para o badge (ex: "POUPA 40%") */
32
+ badgeText?: string;
31
33
  /** Estilização customizada do container. */
32
34
  style?: ViewStyle | ViewStyle[];
33
35
  /** Variante de layout do cartão (completo ou miniatura). */
@@ -43,6 +45,7 @@ export const PlanCard = ({
43
45
  includedItems = [],
44
46
  excludedItems = [],
45
47
  isPopular = false,
48
+ badgeText,
46
49
  style,
47
50
  variant = 'default',
48
51
  }: PlanCardProps) => {
@@ -66,15 +69,22 @@ export const PlanCard = ({
66
69
  };
67
70
  case 'explorateur':
68
71
  return {
69
- borderWidth: 2,
72
+ borderWidth: 3, // Thicker border as seen in the image
70
73
  borderColor: '#f2974b',
71
74
  backgroundColor: '#ffffff',
72
75
  borderRadius: scale(18),
73
76
  paddingVertical: scale(14),
74
77
  paddingHorizontal: scale(15),
75
- shadow: 'sm' as const,
78
+ shadow: 'none' as const,
76
79
  overflow: 'visible' as const,
77
80
  flatShadow: false,
81
+ customShadow: {
82
+ shadowColor: '#fce3ce', // light orange tint for shadow
83
+ shadowOffset: { width: 4, height: 4 },
84
+ shadowOpacity: 1,
85
+ shadowRadius: 0,
86
+ elevation: 4, // Android fallback
87
+ }
78
88
  };
79
89
  case 'fluent':
80
90
  return {
@@ -133,6 +143,7 @@ export const PlanCard = ({
133
143
  overflow={config.overflow}
134
144
  style={[
135
145
  config.flatShadow ? styles.fluentFlatShadow : null,
146
+ config.customShadow ? config.customShadow : null,
136
147
  ...(Array.isArray(style) ? style : [style].filter(Boolean)),
137
148
  ] as ViewStyle[]}
138
149
  >
@@ -141,48 +152,52 @@ export const PlanCard = ({
141
152
  <View style={[
142
153
  styles.popularBadge,
143
154
  {
144
- top: scale(-10),
155
+ top: scale(-12),
156
+ right: isMini ? scale(20) : undefined, // align right if mini
157
+ alignSelf: isMini ? 'flex-end' : 'center',
145
158
  paddingVertical: scale(4),
146
159
  paddingHorizontal: scale(12),
147
160
  borderRadius: scale(20),
148
161
  }
149
162
  ]}>
150
- <Typography style={[styles.popularBadgeText, { fontSize: scaleText(9), letterSpacing: scale(0.8) }]}>MAIS POPULAR</Typography>
163
+ <Typography variant="label" color="#ffffff" style={{ letterSpacing: scale(0.5) }}>
164
+ {badgeText || 'MAIS POPULAR'}
165
+ </Typography>
151
166
  </View>
152
167
  )}
153
168
 
154
169
  {isMini ? (
155
170
  <View style={[styles.miniHeader, { marginTop: scale(8), marginBottom: scale(4) }]}>
156
171
  <View style={styles.miniLeft}>
157
- <Typography style={[styles.labelTier, { color: colors.labelColor, fontSize: scaleText(10), letterSpacing: scale(1.0) }]}>
158
- {tierLabel || tier.toUpperCase()}
159
- </Typography>
160
- <Typography style={[styles.planName, { color: colors.titleColor, fontSize: scaleText(18), lineHeight: scaleText(20) }]}>
172
+ <Typography variant="h1" color="#51332d" style={{ marginBottom: scale(2) }}>
161
173
  {planName}
162
174
  </Typography>
175
+ <Typography variant="bodySm" color="#9a8478">
176
+ {tierLabel}
177
+ </Typography>
163
178
  </View>
164
- <View style={styles.priceRow}>
165
- <Typography style={[styles.priceText, { color: colors.priceColor, fontSize: scaleText(28), lineHeight: scaleText(32) }]}>
179
+ <View style={styles.miniRight}>
180
+ <Typography variant="display1" color="#51332d">
166
181
  {priceText}
167
182
  </Typography>
168
- <Typography style={[styles.periodText, { color: colors.periodColor, fontSize: scaleText(12), marginLeft: scale(2), lineHeight: scaleText(16) }]}>
183
+ <Typography variant="bodySm" color="#9a8478" style={{ marginTop: scale(2), textAlign: 'right' }}>
169
184
  {pricePeriod}
170
185
  </Typography>
171
186
  </View>
172
187
  </View>
173
188
  ) : (
174
189
  <View style={[styles.header, { gap: scale(4), marginTop: scale(8) }]}>
175
- <Typography style={[styles.labelTier, { color: colors.labelColor, fontSize: scaleText(10), letterSpacing: scale(1.0) }]}>
190
+ <Typography variant="label" color={colors.labelColor} style={{ letterSpacing: scale(1.0) }}>
176
191
  {tierLabel || tier.toUpperCase()}
177
192
  </Typography>
178
- <Typography style={[styles.planName, { color: colors.titleColor, fontSize: scaleText(18), lineHeight: scaleText(20) }]}>
193
+ <Typography variant="h1" color={colors.titleColor}>
179
194
  {planName}
180
195
  </Typography>
181
196
  <View style={styles.priceRow}>
182
- <Typography style={[styles.priceText, { color: colors.priceColor, fontSize: scaleText(28), lineHeight: scaleText(32) }]}>
197
+ <Typography variant="display1" color={colors.priceColor}>
183
198
  {priceText}
184
199
  </Typography>
185
- <Typography style={[styles.periodText, { color: colors.periodColor, fontSize: scaleText(12), marginLeft: scale(2), lineHeight: scaleText(16) }]}>
200
+ <Typography variant="bodySm" color={colors.periodColor} style={{ marginLeft: scale(4), marginTop: scale(8) }}>
186
201
  {pricePeriod}
187
202
  </Typography>
188
203
  </View>
@@ -203,7 +218,7 @@ export const PlanCard = ({
203
218
  <View style={[styles.iconBox, { width: scale(20) }]}>
204
219
  <Check stroke={colors.checkColor} strokeWidth={2.6} size={scale(14)} />
205
220
  </View>
206
- <Typography style={[styles.featureText, { color: colors.itemTextColor, fontSize: scaleText(12), lineHeight: scaleText(14) }]}>
221
+ <Typography variant="bodySm" color={colors.itemTextColor} style={{ flex: 1 }}>
207
222
  {item}
208
223
  </Typography>
209
224
  </View>
@@ -214,7 +229,7 @@ export const PlanCard = ({
214
229
  <View style={[styles.iconBox, { width: scale(20) }]}>
215
230
  <X stroke={colors.crossColor} strokeWidth={2.4} size={scale(14)} />
216
231
  </View>
217
- <Typography style={[styles.featureText, { color: '#9a8478', textDecorationLine: 'line-through', fontSize: scaleText(12), lineHeight: scaleText(14) }]}>
232
+ <Typography variant="bodySm" color="#9a8478" style={{ textDecorationLine: 'line-through', flex: 1 }}>
218
233
  {item}
219
234
  </Typography>
220
235
  </View>
@@ -268,7 +283,11 @@ const styles = StyleSheet.create({
268
283
  },
269
284
  miniLeft: {
270
285
  alignItems: 'flex-start',
271
- gap: 4,
286
+ flex: 1,
287
+ },
288
+ miniRight: {
289
+ alignItems: 'flex-end',
290
+ justifyContent: 'center',
272
291
  },
273
292
  labelTier: {
274
293
 
@@ -1,3 +1,12 @@
1
+ import { Platform } from 'react-native';
2
+
3
+ const font = (family: string, webWeight: '600' | '700' | '800') => {
4
+ return Platform.select({
5
+ web: { fontFamily: family.split('-')[0], fontWeight: webWeight },
6
+ default: { fontFamily: family }
7
+ }) as { fontFamily: string; fontWeight?: '600' | '700' | '800' };
8
+ };
9
+
1
10
  export const theme = {
2
11
  colors: {
3
12
  // Paleta primária
@@ -162,82 +171,72 @@ export const theme = {
162
171
 
163
172
  typography: {
164
173
  display1: {
165
- fontFamily: 'Fredoka',
174
+ ...font('Fredoka-Bold', '700'),
166
175
  fontSize: 28,
167
- fontWeight: '700' as const,
168
176
  lineHeight: 30,
169
177
  },
170
178
  display2: {
171
- fontFamily: 'Fredoka',
179
+ ...font('Fredoka-Bold', '700'),
172
180
  fontSize: 24,
173
- fontWeight: '700' as const,
174
181
  lineHeight: 27,
175
182
  },
176
183
  h1: {
177
- fontFamily: 'Fredoka',
184
+ ...font('Fredoka-Bold', '700'),
178
185
  fontSize: 22,
179
- fontWeight: '700' as const,
180
186
  lineHeight: 25,
181
187
  },
182
188
  h2: {
183
- fontFamily: 'Fredoka',
189
+ ...font('Fredoka-SemiBold', '600'),
184
190
  fontSize: 18,
185
- fontWeight: '600' as const,
186
191
  lineHeight: 22,
187
192
  },
188
193
  h3: {
189
- fontFamily: 'Fredoka',
194
+ ...font('Fredoka-SemiBold', '600'),
190
195
  fontSize: 16,
191
- fontWeight: '600' as const,
192
196
  lineHeight: 20,
193
197
  },
194
198
  label: {
195
- fontFamily: 'Nunito',
199
+ ...font('Nunito-ExtraBold', '800'),
196
200
  fontSize: 10,
197
- fontWeight: '800' as const,
198
- lineHeight: 10,
201
+ lineHeight: 14,
199
202
  letterSpacing: 1.2,
200
203
  },
201
204
  bodyLg: {
202
- fontFamily: 'Nunito',
205
+ ...font('Nunito-Bold', '700'),
203
206
  fontSize: 15,
204
- fontWeight: '600' as const,
205
207
  lineHeight: 23,
206
208
  },
207
209
  bodyMd: {
208
- fontFamily: 'Nunito',
210
+ ...font('Nunito-Bold', '700'),
209
211
  fontSize: 13.5,
210
- fontWeight: '600' as const,
211
212
  lineHeight: 20,
212
213
  },
213
214
  bodySm: {
214
- fontFamily: 'Nunito',
215
+ ...font('Nunito-Bold', '700'),
215
216
  fontSize: 12,
216
- fontWeight: '700' as const,
217
217
  lineHeight: 17,
218
218
  },
219
219
  caption: {
220
- fontFamily: 'Nunito',
220
+ ...font('Nunito-SemiBold', '600'),
221
221
  fontSize: 10,
222
- fontWeight: '700' as const,
223
222
  lineHeight: 14,
224
223
  },
225
224
  btnLg: {
226
- fontFamily: 'Nunito',
225
+ ...font('Nunito-ExtraBold', '800'),
227
226
  fontSize: 16,
228
- fontWeight: '800' as const,
227
+ lineHeight: 22,
229
228
  letterSpacing: 0.64,
230
229
  },
231
230
  btnMd: {
232
- fontFamily: 'Nunito',
231
+ ...font('Nunito-ExtraBold', '800'),
233
232
  fontSize: 14,
234
- fontWeight: '800' as const,
233
+ lineHeight: 20,
235
234
  letterSpacing: 0.56,
236
235
  },
237
236
  btnSm: {
238
- fontFamily: 'Nunito',
237
+ ...font('Nunito-ExtraBold', '800'),
239
238
  fontSize: 12,
240
- fontWeight: '800' as const,
239
+ lineHeight: 16,
241
240
  letterSpacing: 0.48,
242
241
  },
243
242
  },