@xetwa/design-system 1.0.29 → 1.0.32

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.29",
3
+ "version": "1.0.32",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,10 +1,10 @@
1
- import { View, StyleSheet, Pressable, Platform, Animated } from 'react-native';
1
+ import { Check, X } from 'lucide-react-native';
2
+ import type { ReactNode } from 'react';
2
3
  import React from 'react';
3
4
  import type { ViewStyle } from 'react-native';
4
- import { theme } from '../../../styles/theme';
5
- import type { ReactNode } from 'react';
6
- import { Check, X } from 'lucide-react-native';
5
+ import { Animated, Platform, Pressable, StyleSheet, View } from 'react-native';
7
6
  import { useResponsive } from '../../../hooks/useResponsive';
7
+ import { theme } from '../../../styles/theme';
8
8
  import { Typography } from '../../Typography/Typography';
9
9
 
10
10
  export type AnswerOptionStatus = 'default' | 'selected' | 'correct' | 'wrong' | 'disabled';
@@ -65,28 +65,32 @@ export const AnswerOptionCard = ({
65
65
  return {
66
66
  borderColor: theme.colors.primary,
67
67
  backgroundColor: theme.colors.primaryLight,
68
- shadowColor: '#FCE5D2',
68
+ shadowColorRaw: theme.colors.primary,
69
+ shadowOpacity: 0.3,
69
70
  textColor: theme.colors.brown[800],
70
71
  };
71
72
  case 'correct':
72
73
  return {
73
74
  borderColor: theme.colors.success,
74
75
  backgroundColor: '#eafaf2',
75
- shadowColor: '#D0E9DE',
76
+ shadowColorRaw: theme.colors.success,
77
+ shadowOpacity: 0.2,
76
78
  textColor: theme.colors.brown[800],
77
79
  };
78
80
  case 'wrong':
79
81
  return {
80
82
  borderColor: theme.colors.error,
81
83
  backgroundColor: '#fdf0ee',
82
- shadowColor: '#F5DEDA',
84
+ shadowColorRaw: theme.colors.error,
85
+ shadowOpacity: 0.2,
83
86
  textColor: theme.colors.brown[800],
84
87
  };
85
88
  case 'disabled':
86
89
  return {
87
90
  borderColor: theme.colors.brown[100],
88
91
  backgroundColor: theme.colors.white,
89
- shadowColor: theme.colors.brown[100],
92
+ shadowColorRaw: theme.colors.brown[100],
93
+ shadowOpacity: 1,
90
94
  textColor: theme.colors.brown[300],
91
95
  };
92
96
  case 'default':
@@ -94,7 +98,8 @@ export const AnswerOptionCard = ({
94
98
  return {
95
99
  borderColor: theme.colors.brown[100],
96
100
  backgroundColor: theme.colors.white,
97
- shadowColor: theme.colors.brown[100],
101
+ shadowColorRaw: theme.colors.brown[100],
102
+ shadowOpacity: 1,
98
103
  textColor: theme.colors.brown[800],
99
104
  };
100
105
  }
@@ -104,10 +109,13 @@ export const AnswerOptionCard = ({
104
109
 
105
110
  const webShadow = Platform.OS === 'web' ? {
106
111
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
- boxShadow: `0 3px 0 ${vStyles.shadowColor}` as any,
112
+ boxShadow: `0 3px 0 rgba(${vStyles.shadowColorRaw === theme.colors.primary ? '242,151,75' : vStyles.shadowColorRaw === theme.colors.success ? '22,145,90' : vStyles.shadowColorRaw === theme.colors.error ? '207,91,72' : '224,213,205'},${vStyles.shadowOpacity})` as any,
108
113
  } : {
109
- borderBottomWidth: 5,
110
- borderBottomColor: vStyles.shadowColor,
114
+ shadowColor: vStyles.shadowColorRaw,
115
+ shadowOffset: { width: 0, height: 3 },
116
+ shadowOpacity: vStyles.shadowOpacity,
117
+ shadowRadius: 0,
118
+ elevation: 0,
111
119
  };
112
120
 
113
121
  const renderSuffix = () => {
@@ -210,41 +218,41 @@ export const AnswerOptionCard = ({
210
218
  {prefixNode && <View style={[styles.prefixContainer, { marginRight: scale(12) }]}>{prefixNode}</View>}
211
219
  {prefix && !prefixNode && (
212
220
  <View style={[
213
- styles.prefixContainer,
214
- {
221
+ styles.prefixContainer,
222
+ {
215
223
  marginRight: scale(12),
216
224
  width: scale(28),
217
225
  height: scale(28),
218
226
  borderRadius: scale(14),
219
- backgroundColor: status === 'correct' ? theme.colors.success : status === 'wrong' ? theme.colors.error : status === 'selected' ? theme.colors.primary : theme.colors.brown[100],
220
- alignItems: 'center',
221
- justifyContent: 'center'
222
- }
223
- ]}>
224
- <Typography style={{
225
- color: status === 'correct' || status === 'wrong' || status === 'selected' ? theme.colors.white : theme.colors.brown[500],
226
- fontWeight: 'bold',
227
- fontSize: scaleText(14)
228
- }}>
229
- {prefix}
230
- </Typography>
231
- </View>
232
- )}
233
- <Typography
234
- style={[
235
- styles.label,
236
- {
237
- color: status === 'disabled' ? theme.colors.brown[300] : vStyles.textColor,
238
- fontSize: getFontSize(),
239
- }
240
- ]}
241
- >
242
- {label}
243
- </Typography>
227
+ backgroundColor: status === 'correct' ? theme.colors.success : status === 'wrong' ? theme.colors.error : status === 'selected' ? theme.colors.primary : theme.colors.brown[100],
228
+ alignItems: 'center',
229
+ justifyContent: 'center'
230
+ }
231
+ ]}>
232
+ <Typography style={{
233
+ color: status === 'correct' || status === 'wrong' || status === 'selected' ? theme.colors.white : theme.colors.brown[500],
234
+ fontWeight: 'bold',
235
+ fontSize: scaleText(14)
236
+ }}>
237
+ {prefix}
238
+ </Typography>
239
+ </View>
240
+ )}
241
+ <Typography
242
+ style={[
243
+ styles.label,
244
+ {
245
+ color: status === 'disabled' ? theme.colors.brown[300] : vStyles.textColor,
246
+ fontSize: getFontSize(),
247
+ }
248
+ ]}
249
+ >
250
+ {label}
251
+ </Typography>
252
+ </View>
253
+ {renderSuffix()}
244
254
  </View>
245
- {renderSuffix()}
246
- </View>
247
- </Pressable>
255
+ </Pressable>
248
256
  </Animated.View>
249
257
  );
250
258
  };
@@ -45,7 +45,7 @@ export const InstructionBubble = ({
45
45
  borderWidth: scale(2),
46
46
  }
47
47
  ]}>
48
- <Typography style={[styles.title, { fontSize: scaleText(22) }]}>
48
+ <Typography style={[styles.title, { fontSize: scaleText(22), lineHeight: scaleText(28) }]}>
49
49
  {title}
50
50
  </Typography>
51
51
  {subtitle && (