jfs-components 0.1.18 → 0.1.19

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/commonjs/components/Card/Card.js +29 -12
  3. package/lib/commonjs/components/CardFeedback/CardFeedback.js +16 -2
  4. package/lib/commonjs/components/CardInsight/CardInsight.js +34 -13
  5. package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +23 -3
  6. package/lib/commonjs/components/DebitCard/DebitCard.js +23 -3
  7. package/lib/commonjs/components/MediaCard/MediaCard.js +24 -7
  8. package/lib/commonjs/components/RechargeCard/RechargeCard.js +34 -13
  9. package/lib/commonjs/components/TestimonialsCard/TestimonialsCard.js +23 -5
  10. package/lib/commonjs/icons/registry.js +1 -1
  11. package/lib/module/components/Card/Card.js +31 -14
  12. package/lib/module/components/CardFeedback/CardFeedback.js +17 -3
  13. package/lib/module/components/CardInsight/CardInsight.js +36 -15
  14. package/lib/module/components/CardProviderInfo/CardProviderInfo.js +25 -5
  15. package/lib/module/components/DebitCard/DebitCard.js +25 -5
  16. package/lib/module/components/MediaCard/MediaCard.js +26 -9
  17. package/lib/module/components/RechargeCard/RechargeCard.js +36 -15
  18. package/lib/module/components/TestimonialsCard/TestimonialsCard.js +25 -7
  19. package/lib/module/icons/registry.js +1 -1
  20. package/lib/typescript/src/components/Card/Card.d.ts +10 -1
  21. package/lib/typescript/src/components/CardFeedback/CardFeedback.d.ts +10 -1
  22. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +10 -1
  23. package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +10 -1
  24. package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +10 -1
  25. package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +10 -1
  26. package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +10 -1
  27. package/lib/typescript/src/components/TestimonialsCard/TestimonialsCard.d.ts +8 -1
  28. package/lib/typescript/src/icons/registry.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/src/components/Card/Card.tsx +46 -15
  31. package/src/components/CardFeedback/CardFeedback.tsx +29 -4
  32. package/src/components/CardInsight/CardInsight.tsx +48 -17
  33. package/src/components/CardProviderInfo/CardProviderInfo.tsx +36 -3
  34. package/src/components/DebitCard/DebitCard.tsx +36 -3
  35. package/src/components/MediaCard/MediaCard.tsx +40 -9
  36. package/src/components/RechargeCard/RechargeCard.tsx +48 -13
  37. package/src/components/TestimonialsCard/TestimonialsCard.tsx +37 -6
  38. package/src/icons/registry.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { View, Text, type ViewStyle } from 'react-native';
2
+ import { View, Text, Pressable, type ViewStyle } from 'react-native';
3
3
  import ButtonGroup from '../ButtonGroup/ButtonGroup';
4
4
  import AvatarGroup from '../AvatarGroup/AvatarGroup';
5
5
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
@@ -65,6 +65,15 @@ export type RechargeCardProps = {
65
65
  */
66
66
  modes?: Modes;
67
67
  style?: ViewStyle;
68
+ /**
69
+ * Press handler for the whole card. When set, the card becomes pressable
70
+ * (rendered through a `Pressable` with `accessibilityRole="button"`).
71
+ */
72
+ onPress?: () => void;
73
+ /** Disable interaction when `onPress` is set. */
74
+ disabled?: boolean;
75
+ /** Accessibility label forwarded to the pressable wrapper (defaults to `title`). */
76
+ accessibilityLabel?: string;
68
77
  };
69
78
 
70
79
  /**
@@ -81,6 +90,9 @@ export default function RechargeCard({
81
90
  actions,
82
91
  modes = EMPTY_MODES,
83
92
  style,
93
+ onPress,
94
+ disabled,
95
+ accessibilityLabel,
84
96
  }: RechargeCardProps) {
85
97
  // Container Tokens (defaults mirror Figma node 2235:937).
86
98
  const backgroundColor = getVariableByName('rechargeCard/background', modes);
@@ -132,18 +144,20 @@ export default function RechargeCard({
132
144
  const hasSubscriptions = React.Children.count(subscriptionContent) > 0;
133
145
 
134
146
 
135
- return (
136
- <View style={[{
137
- backgroundColor,
138
- paddingHorizontal,
139
- paddingVertical,
140
- gap,
141
- borderRadius: radius,
142
- borderWidth: strokeWidth,
143
- borderColor: strokeColor,
144
- minWidth,
145
- alignItems: 'flex-start',
146
- }, style]}>
147
+ const containerStyle: ViewStyle = {
148
+ backgroundColor,
149
+ paddingHorizontal,
150
+ paddingVertical,
151
+ gap,
152
+ borderRadius: radius,
153
+ borderWidth: strokeWidth,
154
+ borderColor: strokeColor,
155
+ minWidth,
156
+ alignItems: 'flex-start',
157
+ };
158
+
159
+ const content = (
160
+ <>
147
161
  {/* Header */}
148
162
  <View style={{ gap: headerGap, alignItems: 'flex-start' }}>
149
163
  <Text style={{
@@ -244,6 +258,27 @@ export default function RechargeCard({
244
258
  <ButtonGroup modes={{ ...DEFAULT_BUTTON_GROUP_MODES, ...modes }}>
245
259
  {actions}
246
260
  </ButtonGroup>
261
+ </>
262
+ );
263
+
264
+ if (onPress) {
265
+ return (
266
+ <Pressable
267
+ style={[containerStyle, style]}
268
+ onPress={onPress}
269
+ disabled={disabled}
270
+ accessibilityRole="button"
271
+ accessibilityLabel={accessibilityLabel ?? title}
272
+ accessibilityState={{ disabled: !!disabled }}
273
+ >
274
+ {content}
275
+ </Pressable>
276
+ );
277
+ }
278
+
279
+ return (
280
+ <View style={[containerStyle, style]} accessibilityLabel={accessibilityLabel}>
281
+ {content}
247
282
  </View>
248
283
  );
249
284
  }
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import {
3
3
  View,
4
4
  Text,
5
+ Pressable,
5
6
  type ViewStyle,
6
7
  type TextStyle,
7
8
  type StyleProp,
@@ -38,6 +39,13 @@ export type TestimonialsCardProps = {
38
39
  * from the title and body.
39
40
  */
40
41
  accessibilityLabel?: string
42
+ /**
43
+ * Press handler for the whole card. When set, the card becomes pressable
44
+ * (rendered through a `Pressable` with `accessibilityRole="button"`).
45
+ */
46
+ onPress?: () => void
47
+ /** Disable interaction when `onPress` is set. */
48
+ disabled?: boolean
41
49
  }
42
50
 
43
51
  /**
@@ -63,6 +71,8 @@ function TestimonialsCard({
63
71
  style,
64
72
  avatarProps,
65
73
  accessibilityLabel,
74
+ onPress,
75
+ disabled,
66
76
  }: TestimonialsCardProps) {
67
77
  // Container tokens
68
78
  const background = getVariableByName('testimonialsCard/background', modes) ?? '#ffffff'
@@ -127,12 +137,8 @@ function TestimonialsCard({
127
137
  const resolvedAccessibilityLabel =
128
138
  accessibilityLabel ?? `Testimonial${title ? ` from ${title}` : ''}${body ? `: ${body}` : ''}`
129
139
 
130
- return (
131
- <View
132
- style={[containerStyle, style]}
133
- accessibilityRole="text"
134
- accessibilityLabel={resolvedAccessibilityLabel}
135
- >
140
+ const content = (
141
+ <>
136
142
  <Avatar
137
143
  style="Image"
138
144
  modes={avatarModes}
@@ -150,6 +156,31 @@ function TestimonialsCard({
150
156
  </Text>
151
157
  )}
152
158
  </View>
159
+ </>
160
+ )
161
+
162
+ if (onPress) {
163
+ return (
164
+ <Pressable
165
+ style={[containerStyle, style]}
166
+ onPress={onPress}
167
+ disabled={disabled}
168
+ accessibilityRole="button"
169
+ accessibilityLabel={resolvedAccessibilityLabel}
170
+ accessibilityState={{ disabled: !!disabled }}
171
+ >
172
+ {content}
173
+ </Pressable>
174
+ )
175
+ }
176
+
177
+ return (
178
+ <View
179
+ style={[containerStyle, style]}
180
+ accessibilityRole="text"
181
+ accessibilityLabel={resolvedAccessibilityLabel}
182
+ >
183
+ {content}
153
184
  </View>
154
185
  )
155
186
  }
@@ -4,7 +4,7 @@
4
4
  * Auto-generated from SVG files in src/icons/
5
5
  * DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
6
6
  *
7
- * Generated: 2026-06-29T08:47:00.741Z
7
+ * Generated: 2026-06-29T11:40:01.320Z
8
8
  */
9
9
 
10
10
  // Icon name to SVG data mapping