jfs-components 0.1.18 → 0.1.23

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 (72) hide show
  1. package/CHANGELOG.md +19 -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/CheckboxItem/CheckboxItem.js +31 -8
  7. package/lib/commonjs/components/ContentSheet/ContentSheet.js +131 -0
  8. package/lib/commonjs/components/DebitCard/DebitCard.js +23 -3
  9. package/lib/commonjs/components/HeroSection/HeroSection.js +165 -0
  10. package/lib/commonjs/components/Image/Image.js +33 -7
  11. package/lib/commonjs/components/Link/Link.js +115 -0
  12. package/lib/commonjs/components/ListItem/ListItem.js +16 -1
  13. package/lib/commonjs/components/MediaCard/MediaCard.js +24 -7
  14. package/lib/commonjs/components/RechargeCard/RechargeCard.js +34 -13
  15. package/lib/commonjs/components/TestimonialsCard/TestimonialsCard.js +23 -5
  16. package/lib/commonjs/components/index.js +21 -0
  17. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  18. package/lib/commonjs/design-tokens/figma-modes.generated.js +53 -43
  19. package/lib/commonjs/icons/registry.js +1 -1
  20. package/lib/module/components/Card/Card.js +31 -14
  21. package/lib/module/components/CardFeedback/CardFeedback.js +17 -3
  22. package/lib/module/components/CardInsight/CardInsight.js +36 -15
  23. package/lib/module/components/CardProviderInfo/CardProviderInfo.js +25 -5
  24. package/lib/module/components/CheckboxItem/CheckboxItem.js +31 -8
  25. package/lib/module/components/ContentSheet/ContentSheet.js +126 -0
  26. package/lib/module/components/DebitCard/DebitCard.js +25 -5
  27. package/lib/module/components/HeroSection/HeroSection.js +159 -0
  28. package/lib/module/components/Image/Image.js +34 -7
  29. package/lib/module/components/Link/Link.js +110 -0
  30. package/lib/module/components/ListItem/ListItem.js +16 -1
  31. package/lib/module/components/MediaCard/MediaCard.js +26 -9
  32. package/lib/module/components/RechargeCard/RechargeCard.js +36 -15
  33. package/lib/module/components/TestimonialsCard/TestimonialsCard.js +25 -7
  34. package/lib/module/components/index.js +3 -0
  35. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  36. package/lib/module/design-tokens/figma-modes.generated.js +53 -43
  37. package/lib/module/icons/registry.js +1 -1
  38. package/lib/typescript/src/components/Card/Card.d.ts +10 -1
  39. package/lib/typescript/src/components/CardFeedback/CardFeedback.d.ts +10 -1
  40. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +10 -1
  41. package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +10 -1
  42. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +26 -3
  43. package/lib/typescript/src/components/ContentSheet/ContentSheet.d.ts +71 -0
  44. package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +10 -1
  45. package/lib/typescript/src/components/HeroSection/HeroSection.d.ts +80 -0
  46. package/lib/typescript/src/components/Image/Image.d.ts +27 -2
  47. package/lib/typescript/src/components/Link/Link.d.ts +73 -0
  48. package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +10 -1
  49. package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +10 -1
  50. package/lib/typescript/src/components/TestimonialsCard/TestimonialsCard.d.ts +8 -1
  51. package/lib/typescript/src/components/index.d.ts +3 -0
  52. package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +8 -0
  53. package/lib/typescript/src/icons/registry.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/src/components/Card/Card.tsx +46 -15
  56. package/src/components/CardFeedback/CardFeedback.tsx +29 -4
  57. package/src/components/CardInsight/CardInsight.tsx +48 -17
  58. package/src/components/CardProviderInfo/CardProviderInfo.tsx +36 -3
  59. package/src/components/CheckboxItem/CheckboxItem.tsx +59 -14
  60. package/src/components/ContentSheet/ContentSheet.tsx +217 -0
  61. package/src/components/DebitCard/DebitCard.tsx +36 -3
  62. package/src/components/HeroSection/HeroSection.tsx +231 -0
  63. package/src/components/Image/Image.tsx +55 -3
  64. package/src/components/Link/Link.tsx +159 -0
  65. package/src/components/ListItem/ListItem.tsx +15 -0
  66. package/src/components/MediaCard/MediaCard.tsx +40 -9
  67. package/src/components/RechargeCard/RechargeCard.tsx +48 -13
  68. package/src/components/TestimonialsCard/TestimonialsCard.tsx +37 -6
  69. package/src/components/index.ts +3 -0
  70. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  71. package/src/design-tokens/figma-modes.generated.ts +53 -43
  72. 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
  }
@@ -36,6 +36,7 @@ export { default as FullscreenModal, type FullscreenModalProps } from './Fullscr
36
36
  export { default as Form, type FormProps } from './Form/Form';
37
37
  export { useFormContext } from './Form/Form';
38
38
  export { default as FormField, type FormFieldProps, type FormFieldType } from './FormField/FormField';
39
+ export { default as ContentSheet, type ContentSheetProps } from './ContentSheet/ContentSheet';
39
40
  export { default as CircularProgressBar, type CircularProgressBarProps } from './CircularProgressBar/CircularProgressBar'
40
41
  export { default as CircularProgressBarDoted, type CircularProgressBarDotedProps } from './CircularProgressBarDoted/CircularProgressBarDoted'
41
42
  export { default as CircularRating, type CircularRatingProps } from './CircularRating/CircularRating'
@@ -45,6 +46,7 @@ export { default as ComparisonBar, type ComparisonBarProps, type ComparisonBarIt
45
46
  export { default as AllocationComparisonChart, type AllocationComparisonChartProps, type AllocationSegment } from './AllocationComparisonChart/AllocationComparisonChart'
46
47
  export { default as MonthlyStatusGrid, CalendarGlyph, type MonthlyStatusGridProps, type MonthlyStatusGridMonth, type MonthlyStatus, type CalendarGlyphProps } from './MonthlyStatusGrid/MonthlyStatusGrid'
47
48
  export { default as Gauge, type GaugeProps } from './Gauge/Gauge';
49
+ export { default as HeroSection, type HeroSectionProps } from './HeroSection/HeroSection';
48
50
  export { default as HoldingsCard, type HoldingsCardProps } from './HoldingsCard/HoldingsCard';
49
51
  export { default as HStack, type HStackProps } from './HStack/HStack';
50
52
  export { default as Icon, type IconProps } from './Icon/Icon';
@@ -52,6 +54,7 @@ export { default as IconButton } from './IconButton/IconButton';
52
54
  export { default as IconCapsule } from './IconCapsule/IconCapsule';
53
55
  export { default as Image, type ImageProps } from './Image/Image';
54
56
  export { default as LazyList } from './LazyList/LazyList';
57
+ export { default as Link, type LinkProps } from './Link/Link';
55
58
  export { default as LinearMeter, type LinearMeterProps } from './LinearMeter/LinearMeter';
56
59
  export { default as LinearProgress, type LinearProgressProps } from './LinearProgress/LinearProgress';
57
60
  export { default as ListGroup } from './ListGroup/ListGroup';