jfs-components 0.0.72 → 0.0.74

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 (158) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
  3. package/lib/commonjs/components/AccountCard/AccountCard.js +247 -0
  4. package/lib/commonjs/components/AppBar/AppBar.js +17 -11
  5. package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
  6. package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +229 -0
  7. package/lib/commonjs/components/CardInsight/CardInsight.js +166 -0
  8. package/lib/commonjs/components/CheckboxGroup/CheckboxGroup.js +67 -0
  9. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +140 -0
  10. package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +56 -9
  11. package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +272 -0
  12. package/lib/commonjs/components/CoverageRing/CoverageRing.js +141 -0
  13. package/lib/commonjs/components/DonutChart/DonutChart.js +309 -0
  14. package/lib/commonjs/components/DonutChartSummary/DonutChartSummary.js +155 -0
  15. package/lib/commonjs/components/Dropdown/Dropdown.js +214 -0
  16. package/lib/commonjs/components/DropdownInput/DropdownInput.js +542 -0
  17. package/lib/commonjs/components/FormField/FormField.js +328 -178
  18. package/lib/commonjs/components/LinearMeter/LinearMeter.js +9 -28
  19. package/lib/commonjs/components/LinearProgress/LinearProgress.js +68 -0
  20. package/lib/commonjs/components/LottieIntroBlock/LottieIntroBlock.js +150 -0
  21. package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +95 -0
  22. package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +286 -0
  23. package/lib/commonjs/components/OTP/OTP.js +381 -37
  24. package/lib/commonjs/components/PageHero/PageHero.js +153 -0
  25. package/lib/commonjs/components/PoweredByLabel/PoweredByLabel.js +135 -0
  26. package/lib/commonjs/components/PoweredByLabel/finvu.png +0 -0
  27. package/lib/commonjs/components/ProductOverview/ProductOverview.js +147 -0
  28. package/lib/commonjs/components/RangeTrack/RangeTrack.js +269 -0
  29. package/lib/commonjs/components/SavingsGoalSummary/SavingsGoalSummary.js +181 -0
  30. package/lib/commonjs/components/SegmentedTrack/SegmentedTrack.js +171 -0
  31. package/lib/commonjs/components/StatGroup/StatGroup.js +128 -0
  32. package/lib/commonjs/components/StatItem/StatItem.js +65 -35
  33. package/lib/commonjs/components/StrengthIndicator/StrengthIndicator.js +157 -0
  34. package/lib/commonjs/components/SummaryTile/SummaryTile.js +150 -0
  35. package/lib/commonjs/components/Text/Text.js +9 -2
  36. package/lib/commonjs/components/Tooltip/Tooltip.js +34 -27
  37. package/lib/commonjs/components/index.js +231 -1
  38. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  39. package/lib/commonjs/icons/registry.js +1 -1
  40. package/lib/commonjs/utils/index.js +7 -0
  41. package/lib/commonjs/utils/number-utils.js +57 -0
  42. package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +233 -0
  43. package/lib/module/components/AccountCard/AccountCard.js +241 -0
  44. package/lib/module/components/AppBar/AppBar.js +17 -11
  45. package/lib/module/components/BrandChip/BrandChip.js +143 -0
  46. package/lib/module/components/CardBankAccount/CardBankAccount.js +223 -0
  47. package/lib/module/components/CardInsight/CardInsight.js +161 -0
  48. package/lib/module/components/CheckboxGroup/CheckboxGroup.js +62 -0
  49. package/lib/module/components/CheckboxItem/CheckboxItem.js +134 -0
  50. package/lib/module/components/CircularProgressBar/CircularProgressBar.js +56 -9
  51. package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +266 -0
  52. package/lib/module/components/CoverageRing/CoverageRing.js +136 -0
  53. package/lib/module/components/DonutChart/DonutChart.js +303 -0
  54. package/lib/module/components/DonutChartSummary/DonutChartSummary.js +150 -0
  55. package/lib/module/components/Dropdown/Dropdown.js +206 -0
  56. package/lib/module/components/DropdownInput/DropdownInput.js +536 -0
  57. package/lib/module/components/FormField/FormField.js +330 -180
  58. package/lib/module/components/LinearMeter/LinearMeter.js +9 -28
  59. package/lib/module/components/LinearProgress/LinearProgress.js +63 -0
  60. package/lib/module/components/LottieIntroBlock/LottieIntroBlock.js +144 -0
  61. package/lib/module/components/MetricLegendItem/MetricLegendItem.js +90 -0
  62. package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +281 -0
  63. package/lib/module/components/OTP/OTP.js +381 -38
  64. package/lib/module/components/PageHero/PageHero.js +147 -0
  65. package/lib/module/components/PoweredByLabel/PoweredByLabel.js +130 -0
  66. package/lib/module/components/PoweredByLabel/finvu.png +0 -0
  67. package/lib/module/components/ProductOverview/ProductOverview.js +142 -0
  68. package/lib/module/components/RangeTrack/RangeTrack.js +263 -0
  69. package/lib/module/components/SavingsGoalSummary/SavingsGoalSummary.js +175 -0
  70. package/lib/module/components/SegmentedTrack/SegmentedTrack.js +166 -0
  71. package/lib/module/components/StatGroup/StatGroup.js +123 -0
  72. package/lib/module/components/StatItem/StatItem.js +66 -36
  73. package/lib/module/components/StrengthIndicator/StrengthIndicator.js +152 -0
  74. package/lib/module/components/SummaryTile/SummaryTile.js +145 -0
  75. package/lib/module/components/Text/Text.js +9 -2
  76. package/lib/module/components/Tooltip/Tooltip.js +34 -27
  77. package/lib/module/components/index.js +28 -2
  78. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  79. package/lib/module/icons/registry.js +1 -1
  80. package/lib/module/utils/index.js +2 -1
  81. package/lib/module/utils/number-utils.js +53 -0
  82. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +71 -0
  83. package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +81 -0
  84. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +43 -0
  85. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +86 -0
  86. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +48 -0
  87. package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +41 -0
  88. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +72 -0
  89. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +11 -1
  90. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +105 -0
  91. package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +90 -0
  92. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +117 -0
  93. package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +103 -0
  94. package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +62 -0
  95. package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +107 -0
  96. package/lib/typescript/src/components/FormField/FormField.d.ts +76 -19
  97. package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +17 -0
  98. package/lib/typescript/src/components/LottieIntroBlock/LottieIntroBlock.d.ts +58 -0
  99. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +37 -0
  100. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +119 -0
  101. package/lib/typescript/src/components/OTP/OTP.d.ts +88 -2
  102. package/lib/typescript/src/components/PageHero/PageHero.d.ts +53 -0
  103. package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +70 -0
  104. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +39 -0
  105. package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +173 -0
  106. package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +95 -0
  107. package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +108 -0
  108. package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +45 -0
  109. package/lib/typescript/src/components/StatItem/StatItem.d.ts +24 -7
  110. package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +58 -0
  111. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +60 -0
  112. package/lib/typescript/src/components/Text/Text.d.ts +12 -2
  113. package/lib/typescript/src/components/Tooltip/Tooltip.d.ts +13 -2
  114. package/lib/typescript/src/components/index.d.ts +29 -3
  115. package/lib/typescript/src/icons/registry.d.ts +1 -1
  116. package/lib/typescript/src/utils/index.d.ts +1 -0
  117. package/lib/typescript/src/utils/number-utils.d.ts +29 -0
  118. package/package.json +1 -3
  119. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +323 -0
  120. package/src/components/AccountCard/AccountCard.tsx +376 -0
  121. package/src/components/AppBar/AppBar.tsx +25 -14
  122. package/src/components/BrandChip/BrandChip.tsx +235 -0
  123. package/src/components/CardBankAccount/CardBankAccount.tsx +321 -0
  124. package/src/components/CardInsight/CardInsight.tsx +239 -0
  125. package/src/components/CheckboxGroup/CheckboxGroup.tsx +86 -0
  126. package/src/components/CheckboxItem/CheckboxItem.tsx +209 -0
  127. package/src/components/CircularProgressBar/CircularProgressBar.tsx +74 -9
  128. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +378 -0
  129. package/src/components/CoverageRing/CoverageRing.tsx +225 -0
  130. package/src/components/DonutChart/DonutChart.tsx +503 -0
  131. package/src/components/DonutChartSummary/DonutChartSummary.tsx +256 -0
  132. package/src/components/Dropdown/Dropdown.tsx +331 -0
  133. package/src/components/DropdownInput/DropdownInput.tsx +819 -0
  134. package/src/components/FormField/FormField.tsx +542 -215
  135. package/src/components/LinearMeter/LinearMeter.tsx +9 -39
  136. package/src/components/LinearProgress/LinearProgress.tsx +92 -0
  137. package/src/components/LottieIntroBlock/LottieIntroBlock.tsx +202 -0
  138. package/src/components/MetricLegendItem/MetricLegendItem.tsx +167 -0
  139. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +438 -0
  140. package/src/components/OTP/OTP.tsx +476 -29
  141. package/src/components/PageHero/PageHero.tsx +200 -0
  142. package/src/components/PoweredByLabel/PoweredByLabel.tsx +221 -0
  143. package/src/components/PoweredByLabel/finvu.png +0 -0
  144. package/src/components/ProductOverview/ProductOverview.tsx +236 -0
  145. package/src/components/RangeTrack/RangeTrack.tsx +394 -0
  146. package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +269 -0
  147. package/src/components/SegmentedTrack/SegmentedTrack.tsx +268 -0
  148. package/src/components/StatGroup/StatGroup.tsx +169 -0
  149. package/src/components/StatItem/StatItem.tsx +117 -40
  150. package/src/components/StrengthIndicator/StrengthIndicator.tsx +205 -0
  151. package/src/components/SummaryTile/SummaryTile.tsx +251 -0
  152. package/src/components/Text/Text.tsx +24 -3
  153. package/src/components/Tooltip/Tooltip.tsx +50 -25
  154. package/src/components/index.ts +47 -3
  155. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  156. package/src/icons/registry.ts +1 -1
  157. package/src/utils/index.ts +1 -0
  158. package/src/utils/number-utils.ts +60 -0
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+
3
+ import React, { useMemo } from 'react';
4
+ import { Pressable, Text, View } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { useTokens } from '../../design-tokens/JFSThemeProvider';
7
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
8
+ import Avatar from '../Avatar/Avatar';
9
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const toNumber = (value, fallback) => {
11
+ if (typeof value === 'number') {
12
+ return Number.isFinite(value) ? value : fallback;
13
+ }
14
+ if (typeof value === 'string') {
15
+ const parsed = Number(value);
16
+ return Number.isFinite(parsed) ? parsed : fallback;
17
+ }
18
+ return fallback;
19
+ };
20
+ const toFontWeight = (value, fallback) => {
21
+ if (typeof value === 'number') return String(value);
22
+ if (typeof value === 'string') return value;
23
+ return fallback;
24
+ };
25
+ function resolveBrandChipTokens(modes) {
26
+ const background = getVariableByName('brandChip/background', modes) ?? '#ffffff';
27
+ const foreground = getVariableByName('brandChip/foreground', modes) ?? '#0d0d0f';
28
+ const borderColor = getVariableByName('brandChip/border/color', modes) ?? '#e0e0e3';
29
+ const borderSize = toNumber(getVariableByName('brandChip/border/size', modes), 1);
30
+ const gap = toNumber(getVariableByName('brandChip/gap', modes), 8);
31
+ const paddingLeft = toNumber(getVariableByName('brandChip/padding/left', modes), 8);
32
+ const paddingRight = toNumber(getVariableByName('brandChip/padding/right', modes), 12);
33
+ const paddingVertical = toNumber(getVariableByName('brandChip/padding/vertical', modes), 5);
34
+ // The Figma token uses 25000 as a sentinel for "always pill-shaped".
35
+ // Cap it to a value React Native renders predictably.
36
+ const radiusRaw = toNumber(getVariableByName('brandChip/radius', modes), 9999);
37
+ const radius = radiusRaw >= 9999 ? 9999 : radiusRaw;
38
+ const fontFamily = getVariableByName('brandChip/label/fontFamily', modes) ?? 'JioType Var';
39
+ const fontSize = toNumber(getVariableByName('brandChip/label/fontSize', modes), 16);
40
+ const lineHeight = toNumber(getVariableByName('brandChip/label/lineHeight', modes), 21);
41
+ const fontWeight = toFontWeight(getVariableByName('brandChip/label/fontWeight', modes), '500');
42
+ return {
43
+ containerStyle: {
44
+ flexDirection: 'row',
45
+ alignItems: 'center',
46
+ alignSelf: 'flex-start',
47
+ backgroundColor: background,
48
+ borderColor,
49
+ borderWidth: borderSize,
50
+ borderStyle: 'solid',
51
+ borderRadius: radius,
52
+ paddingLeft,
53
+ paddingRight,
54
+ paddingTop: paddingVertical,
55
+ paddingBottom: paddingVertical,
56
+ gap
57
+ },
58
+ labelStyle: {
59
+ color: foreground,
60
+ fontFamily,
61
+ fontSize,
62
+ fontWeight,
63
+ lineHeight
64
+ }
65
+ };
66
+ }
67
+
68
+ // The Figma reference renders the avatar at 29px which is the `S` size in
69
+ // the Avatar Size collection. Callers can override via `modes`.
70
+ const DEFAULT_AVATAR_SIZE_MODE = 'S';
71
+
72
+ /**
73
+ * `BrandChip` renders a compact pill that pairs a small institution avatar
74
+ * with a short identifier label (e.g. `"Axis Bank • 0245"`). It's typically
75
+ * used to surface the currently-selected linked account in headers, sticky
76
+ * bars, or selectors.
77
+ *
78
+ * All visual values resolve through the `brandChip/*` design tokens with
79
+ * sensible Figma defaults so the chip renders correctly out of the box.
80
+ *
81
+ * @component
82
+ * @param {BrandChipProps} props
83
+ */
84
+ function BrandChip({
85
+ label = 'Axis Bank • 0245',
86
+ imageSource,
87
+ avatarSlot,
88
+ onPress,
89
+ modes: propModes = EMPTY_MODES,
90
+ style,
91
+ labelStyle,
92
+ accessibilityLabel
93
+ }) {
94
+ const {
95
+ modes: globalModes
96
+ } = useTokens();
97
+ const modes = useMemo(() => globalModes === EMPTY_MODES && propModes === EMPTY_MODES ? EMPTY_MODES : {
98
+ ...globalModes,
99
+ ...propModes
100
+ }, [globalModes, propModes]);
101
+ const avatarModes = useMemo(() => ({
102
+ 'Avatar Size': DEFAULT_AVATAR_SIZE_MODE,
103
+ ...modes
104
+ }), [modes]);
105
+ const tokens = useMemo(() => resolveBrandChipTokens(modes), [modes]);
106
+ const processedAvatarSlot = useMemo(() => {
107
+ if (!avatarSlot) return null;
108
+ const processed = cloneChildrenWithModes(avatarSlot, avatarModes);
109
+ return processed.length === 1 ? processed[0] : processed;
110
+ }, [avatarSlot, avatarModes]);
111
+ const avatarNode = processedAvatarSlot ?? (imageSource !== undefined ? /*#__PURE__*/_jsx(Avatar, {
112
+ style: "Image",
113
+ imageSource: imageSource,
114
+ modes: avatarModes
115
+ }) : /*#__PURE__*/_jsx(Avatar, {
116
+ style: "Image",
117
+ modes: avatarModes
118
+ }));
119
+ const a11yLabel = accessibilityLabel ?? label;
120
+ const content = /*#__PURE__*/_jsxs(_Fragment, {
121
+ children: [avatarNode, /*#__PURE__*/_jsx(Text, {
122
+ style: [tokens.labelStyle, labelStyle],
123
+ numberOfLines: 1,
124
+ ellipsizeMode: "tail",
125
+ children: label
126
+ })]
127
+ });
128
+ if (onPress) {
129
+ return /*#__PURE__*/_jsx(Pressable, {
130
+ accessibilityRole: "button",
131
+ accessibilityLabel: a11yLabel,
132
+ onPress: onPress,
133
+ style: [tokens.containerStyle, style],
134
+ children: content
135
+ });
136
+ }
137
+ return /*#__PURE__*/_jsx(View, {
138
+ accessibilityLabel: a11yLabel,
139
+ style: [tokens.containerStyle, style],
140
+ children: content
141
+ });
142
+ }
143
+ export default /*#__PURE__*/React.memo(BrandChip);
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ import React, { useMemo } from 'react';
4
+ import { View, Text } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
7
+ import Badge from '../Badge/Badge';
8
+ import Button from '../Button/Button';
9
+ import InstitutionBadge from '../InstitutionBadge/InstitutionBadge';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const DEFAULT_ITEMS = [{
12
+ label: 'Account type',
13
+ value: 'Korem ipsum'
14
+ }, {
15
+ label: 'Account number',
16
+ value: 'Korem ipsum'
17
+ }, {
18
+ label: 'Last updated',
19
+ value: 'Korem ipsum'
20
+ }];
21
+
22
+ // Component-level defaults that match the Figma reference. Caller-provided
23
+ // `modes` are merged on top so every key here can be overridden per-instance.
24
+ const DEFAULT_MODES = Object.freeze({
25
+ 'Button / Size': 'S',
26
+ AppearanceBrand: 'Secondary',
27
+ Emphasis: 'Medium'
28
+ });
29
+ const toNumber = (value, fallback) => {
30
+ if (typeof value === 'number') return Number.isFinite(value) ? value : fallback;
31
+ if (typeof value === 'string') {
32
+ const parsed = Number(value);
33
+ return Number.isFinite(parsed) ? parsed : fallback;
34
+ }
35
+ return fallback;
36
+ };
37
+ const toFontWeight = (value, fallback) => {
38
+ if (typeof value === 'number') return String(value);
39
+ if (typeof value === 'string') return value;
40
+ return fallback;
41
+ };
42
+
43
+ /**
44
+ * `CardBankAccount` renders a bank account summary card composed of:
45
+ *
46
+ * 1. A header with an `InstitutionBadge` (avatar + bank name) and an
47
+ * optional trailing `Badge`.
48
+ * 2. A configurable list of label/value rows describing the account.
49
+ * 3. A footer `Button` for the primary action.
50
+ *
51
+ * All values resolve through the `bankAccountCard/*` design tokens with
52
+ * sensible Figma defaults so the card renders correctly out of the box.
53
+ *
54
+ * @component
55
+ * @param {CardBankAccountProps} props
56
+ */
57
+ function CardBankAccount({
58
+ institutionName = 'State Bank of India',
59
+ institutionAvatar,
60
+ badge,
61
+ headerSlot,
62
+ items = DEFAULT_ITEMS,
63
+ children,
64
+ buttonLabel = 'Button',
65
+ onButtonPress,
66
+ footer,
67
+ modes: propModes = EMPTY_MODES,
68
+ style,
69
+ accessibilityLabel
70
+ }) {
71
+ // Merge caller modes on top of `DEFAULT_MODES` so every default key
72
+ // (e.g. `Button / Size`, `AppearanceBrand`, `Emphasis`) can be overridden
73
+ // per-instance while still applying out of the box.
74
+ const modes = useMemo(() => propModes === EMPTY_MODES ? DEFAULT_MODES : {
75
+ ...DEFAULT_MODES,
76
+ ...propModes
77
+ }, [propModes]);
78
+ const background = getVariableByName('bankAccountCard/background', modes) ?? '#ffffff';
79
+ const radius = toNumber(getVariableByName('bankAccountCard/radius', modes), 16);
80
+ const paddingHorizontal = toNumber(getVariableByName('bankAccountCard/padding/horizontal', modes), 12);
81
+ const paddingVertical = toNumber(getVariableByName('bankAccountCard/padding/vertical', modes), 16);
82
+ const gap = toNumber(getVariableByName('bankAccountCard/gap', modes), 16);
83
+ const headerGap = toNumber(getVariableByName('bankAccountCard/header/gap', modes), 8);
84
+ const listGroupGap = toNumber(getVariableByName('listGroup/gap', modes), 12);
85
+ const rowGap = toNumber(getVariableByName('listItem/gap', modes), 8);
86
+ const titleColor = getVariableByName('listItem/title/color', modes) ?? '#0f0d0a';
87
+ const titleFontFamily = getVariableByName('listItem/title/fontFamily', modes) ?? 'JioType Var';
88
+ const titleFontSize = toNumber(getVariableByName('listItem/title/fontSize', modes), 14);
89
+ const titleLineHeight = toNumber(getVariableByName('listItem/title/lineHeight', modes), 16);
90
+ const titleFontWeight = toFontWeight(getVariableByName('listItem/title/fontWeight', modes), '700');
91
+ const valueColor = getVariableByName('text/foreground', modes) ?? '#000000';
92
+ const valueFontFamily = getVariableByName('text/fontFamily', modes) ?? 'JioType Var';
93
+ const valueFontSize = toNumber(getVariableByName('text/fontSize', modes), 14);
94
+ const valueLineHeight = toNumber(getVariableByName('text/lineHeight', modes), 20);
95
+ const valueLetterSpacing = toNumber(getVariableByName('text/letterSpacing', modes), -0.5);
96
+ const valueFontWeight = toFontWeight(getVariableByName('text/fontWeight', modes), '500');
97
+ const labelStyle = {
98
+ color: titleColor,
99
+ fontFamily: titleFontFamily,
100
+ fontSize: titleFontSize,
101
+ lineHeight: titleLineHeight,
102
+ fontWeight: titleFontWeight
103
+ };
104
+ const valueTextStyle = {
105
+ color: valueColor,
106
+ fontFamily: valueFontFamily,
107
+ fontSize: valueFontSize,
108
+ lineHeight: valueLineHeight,
109
+ letterSpacing: valueLetterSpacing,
110
+ fontWeight: valueFontWeight
111
+ };
112
+ const renderBadge = () => {
113
+ if (badge === false || badge === null || badge === undefined) return null;
114
+ if (typeof badge === 'string') {
115
+ return /*#__PURE__*/_jsx(Badge, {
116
+ label: badge,
117
+ modes: modes
118
+ });
119
+ }
120
+ const processed = cloneChildrenWithModes(badge, modes);
121
+ return processed.length === 1 ? processed[0] : processed;
122
+ };
123
+ const renderHeader = () => {
124
+ if (headerSlot !== undefined) {
125
+ const processed = cloneChildrenWithModes(headerSlot, modes);
126
+ return processed.length === 1 ? processed[0] : processed;
127
+ }
128
+ return /*#__PURE__*/_jsxs(View, {
129
+ style: {
130
+ flexDirection: 'row',
131
+ alignItems: 'center',
132
+ gap: headerGap,
133
+ width: '100%'
134
+ },
135
+ children: [/*#__PURE__*/_jsx(View, {
136
+ style: {
137
+ flex: 1,
138
+ minWidth: 0
139
+ },
140
+ children: /*#__PURE__*/_jsx(InstitutionBadge, {
141
+ label: institutionName,
142
+ ...(institutionAvatar !== undefined ? {
143
+ source: institutionAvatar
144
+ } : {}),
145
+ modes: modes
146
+ })
147
+ }), renderBadge()]
148
+ });
149
+ };
150
+ const renderItems = () => {
151
+ if (children !== undefined && children !== null) {
152
+ const processed = cloneChildrenWithModes(children, modes);
153
+ if (processed.length === 0) return null;
154
+ return /*#__PURE__*/_jsx(View, {
155
+ style: {
156
+ width: '100%',
157
+ gap: listGroupGap
158
+ },
159
+ children: processed.length === 1 ? processed[0] : processed
160
+ });
161
+ }
162
+ if (!items || items.length === 0) return null;
163
+ return /*#__PURE__*/_jsx(View, {
164
+ style: {
165
+ width: '100%',
166
+ gap: listGroupGap
167
+ },
168
+ children: items.map((item, index) => /*#__PURE__*/_jsxs(View, {
169
+ style: {
170
+ flexDirection: 'row',
171
+ alignItems: 'center',
172
+ gap: rowGap,
173
+ width: '100%'
174
+ },
175
+ children: [/*#__PURE__*/_jsx(View, {
176
+ style: {
177
+ flex: 1,
178
+ minWidth: 0
179
+ },
180
+ children: /*#__PURE__*/_jsx(Text, {
181
+ style: labelStyle,
182
+ children: item.label
183
+ })
184
+ }), typeof item.value === 'string' || typeof item.value === 'number' ? /*#__PURE__*/_jsx(Text, {
185
+ style: valueTextStyle,
186
+ numberOfLines: 1,
187
+ children: item.value
188
+ }) : cloneChildrenWithModes(item.value, modes)]
189
+ }, `${item.label}-${index}`))
190
+ });
191
+ };
192
+ const renderFooter = () => {
193
+ if (footer === false || footer === null) return null;
194
+ if (footer === undefined) {
195
+ return /*#__PURE__*/_jsx(Button, {
196
+ label: buttonLabel,
197
+ ...(onButtonPress ? {
198
+ onPress: onButtonPress
199
+ } : {}),
200
+ modes: modes,
201
+ style: {
202
+ width: '100%'
203
+ }
204
+ });
205
+ }
206
+ const processed = cloneChildrenWithModes(footer, modes);
207
+ return processed.length === 1 ? processed[0] : processed;
208
+ };
209
+ return /*#__PURE__*/_jsxs(View, {
210
+ accessibilityLabel: accessibilityLabel ?? institutionName,
211
+ style: [{
212
+ backgroundColor: background,
213
+ borderRadius: radius,
214
+ paddingHorizontal,
215
+ paddingVertical,
216
+ gap,
217
+ alignItems: 'flex-start',
218
+ width: '100%'
219
+ }, style],
220
+ children: [renderHeader(), renderItems(), renderFooter()]
221
+ });
222
+ }
223
+ export default CardBankAccount;
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Text } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
7
+ import Badge from '../Badge/Badge';
8
+ import Divider from '../Divider/Divider';
9
+ import Nudge from '../Nudge/Nudge';
10
+ import SavingsGoalSummary from '../SavingsGoalSummary/SavingsGoalSummary';
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ /**
13
+ * `CardInsight` renders a single insight card composed of:
14
+ *
15
+ * 1. A header with a title, subtitle and a trailing `Badge`.
16
+ * 2. A flexible content slot — defaults to `SavingsGoalSummary`.
17
+ * 3. A `Divider` separating the slot from the footer.
18
+ * 4. A footer slot — defaults to an inline-compact `Nudge`.
19
+ *
20
+ * @component
21
+ * @param {CardInsightProps} props
22
+ */
23
+ function CardInsight({
24
+ title = 'Emergency savings',
25
+ subtitle = 'One line explanation here.',
26
+ badge = 'Label',
27
+ children,
28
+ footer,
29
+ divider,
30
+ modes = EMPTY_MODES,
31
+ style
32
+ }) {
33
+ const background = getVariableByName('cardInsight/background', modes) ?? '#ffffff';
34
+ const radius = getVariableByName('cardInsight/radius', modes) ?? 16;
35
+ const paddingHorizontal = getVariableByName('cardInsight/padding/horizontal', modes) ?? 12;
36
+ const paddingVertical = getVariableByName('cardInsight/padding/vertical', modes) ?? 16;
37
+ const gap = getVariableByName('cardInsight/gap', modes) ?? 12;
38
+ const contentGap = getVariableByName('cardInsight/contentGap', modes) ?? 8;
39
+ const width = getVariableByName('cardInsight/width', modes) ?? 356;
40
+ const slotBackground = getVariableByName('cardInsight/slot/background', modes) ?? '#ffffff';
41
+ const headerGap = getVariableByName('cardInsight/header/gap', modes) ?? 8;
42
+ const textGap = getVariableByName('cardInsight/text/gap', modes) ?? 4;
43
+ const titleColor = getVariableByName('cardInsight/title/color', modes) ?? '#0d0d0f';
44
+ const titleFontFamily = getVariableByName('cardInsight/title/fontFamily', modes) ?? 'JioType Var';
45
+ const titleFontSize = getVariableByName('cardInsight/title/fontSize', modes) ?? 16;
46
+ const titleLineHeight = getVariableByName('cardInsight/title/lineHeight', modes) ?? 17.6;
47
+ const titleFontWeightRaw = getVariableByName('cardInsight/title/fontWeight', modes) ?? 700;
48
+ const titleFontWeight = String(titleFontWeightRaw);
49
+ const bodyColor = getVariableByName('cardInsight/body/color', modes) ?? '#0d0d0f';
50
+ const bodyFontFamily = getVariableByName('cardInsight/body/fontFamily', modes) ?? 'JioType Var';
51
+ const bodyFontSize = getVariableByName('cardInsight/body/fontSize', modes) ?? 12;
52
+ const bodyLineHeight = getVariableByName('cardInsight/body/lineHeight', modes) ?? 15.6;
53
+ const bodyFontWeightRaw = getVariableByName('cardInsight/body/fontWeight', modes) ?? 400;
54
+ const bodyFontWeight = String(bodyFontWeightRaw);
55
+ const renderBadge = () => {
56
+ if (badge === false || badge === null || badge === undefined) return null;
57
+ if (typeof badge === 'string') {
58
+ return /*#__PURE__*/_jsx(Badge, {
59
+ label: badge,
60
+ modes: modes
61
+ });
62
+ }
63
+ const processed = cloneChildrenWithModes(badge, modes);
64
+ return processed.length === 1 ? processed[0] : processed;
65
+ };
66
+ const renderSlot = () => {
67
+ if (!children) {
68
+ return /*#__PURE__*/_jsx(SavingsGoalSummary, {
69
+ modes: modes
70
+ });
71
+ }
72
+ const processed = cloneChildrenWithModes(children, modes);
73
+ return processed.length === 1 ? processed[0] : processed;
74
+ };
75
+ const renderFooter = () => {
76
+ if (footer === false || footer === null) return null;
77
+ if (footer === undefined) {
78
+ return /*#__PURE__*/_jsx(Nudge, {
79
+ type: "inline-compact",
80
+ modes: {
81
+ AppearanceBrand: 'Neutral',
82
+ Context: 'Nudge&Alert',
83
+ ...modes
84
+ }
85
+ });
86
+ }
87
+ const processed = cloneChildrenWithModes(footer, modes);
88
+ return processed.length === 1 ? processed[0] : processed;
89
+ };
90
+ const renderDivider = () => {
91
+ if (divider === false || divider === null) return null;
92
+ if (divider === undefined || divider === true) {
93
+ return /*#__PURE__*/_jsx(Divider, {
94
+ modes: modes
95
+ });
96
+ }
97
+ const processed = cloneChildrenWithModes(divider, modes);
98
+ return processed.length === 1 ? processed[0] : processed;
99
+ };
100
+ const footerNode = renderFooter();
101
+ const showDivider = footerNode !== null && divider !== false && divider !== null;
102
+ return /*#__PURE__*/_jsxs(View, {
103
+ style: [{
104
+ width,
105
+ backgroundColor: background,
106
+ borderRadius: radius,
107
+ paddingHorizontal,
108
+ paddingVertical,
109
+ gap,
110
+ overflow: 'hidden',
111
+ alignItems: 'stretch'
112
+ }, style],
113
+ children: [/*#__PURE__*/_jsxs(View, {
114
+ style: {
115
+ flexDirection: 'row',
116
+ alignItems: 'flex-start',
117
+ gap: headerGap,
118
+ width: '100%'
119
+ },
120
+ children: [/*#__PURE__*/_jsxs(View, {
121
+ style: {
122
+ flex: 1,
123
+ minWidth: 0,
124
+ gap: textGap,
125
+ alignItems: 'flex-start'
126
+ },
127
+ children: [/*#__PURE__*/_jsx(Text, {
128
+ style: {
129
+ color: titleColor,
130
+ fontFamily: titleFontFamily,
131
+ fontSize: titleFontSize,
132
+ lineHeight: titleLineHeight,
133
+ fontWeight: titleFontWeight,
134
+ width: '100%'
135
+ },
136
+ children: title
137
+ }), /*#__PURE__*/_jsx(Text, {
138
+ style: {
139
+ color: bodyColor,
140
+ fontFamily: bodyFontFamily,
141
+ fontSize: bodyFontSize,
142
+ lineHeight: bodyLineHeight,
143
+ fontWeight: bodyFontWeight,
144
+ width: '100%'
145
+ },
146
+ children: subtitle
147
+ })]
148
+ }), renderBadge()]
149
+ }), /*#__PURE__*/_jsx(View, {
150
+ style: {
151
+ width: '100%',
152
+ backgroundColor: slotBackground,
153
+ gap: contentGap,
154
+ overflow: 'hidden',
155
+ alignItems: 'stretch'
156
+ },
157
+ children: renderSlot()
158
+ }), showDivider ? renderDivider() : null, footerNode]
159
+ });
160
+ }
161
+ export default CardInsight;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
7
+ import CheckboxItem from '../CheckboxItem/CheckboxItem';
8
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
9
+ /**
10
+ * CheckboxGroup composes a vertical stack of `CheckboxItem`s. Spacing and
11
+ * padding are driven by the `checkboxGroup/*` design tokens so groups stay
12
+ * visually consistent across screens.
13
+ *
14
+ * The `modes` prop is forwarded recursively to all children — including
15
+ * `CheckboxItem`s and any element rendered inside their `endSlot`.
16
+ *
17
+ * @component
18
+ * @param {CheckboxGroupProps} props
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <CheckboxGroup modes={{ 'Color Mode': 'Light' }}>
23
+ * <CheckboxItem label="Fixed deposit • 0245" />
24
+ * <CheckboxItem label="Recurring deposit • 1182" />
25
+ * <CheckboxItem label="Mutual fund • Equity" />
26
+ * </CheckboxGroup>
27
+ * ```
28
+ */
29
+ function CheckboxGroup({
30
+ children,
31
+ modes = EMPTY_MODES,
32
+ style,
33
+ accessibilityLabel
34
+ }) {
35
+ const gap = getVariableByName('checkboxGroup/gap', modes) ?? 12;
36
+ const paddingHorizontal = getVariableByName('checkboxGroup/padding/horizontal', modes) ?? 0;
37
+ const paddingVertical = getVariableByName('checkboxGroup/padding/vertical', modes) ?? 0;
38
+ const containerStyle = {
39
+ width: '100%',
40
+ flexDirection: 'column',
41
+ alignItems: 'stretch',
42
+ gap,
43
+ paddingHorizontal,
44
+ paddingVertical
45
+ };
46
+ const items = children ? cloneChildrenWithModes(children, modes) : /*#__PURE__*/_jsxs(_Fragment, {
47
+ children: [/*#__PURE__*/_jsx(CheckboxItem, {
48
+ modes: modes
49
+ }), /*#__PURE__*/_jsx(CheckboxItem, {
50
+ modes: modes
51
+ }), /*#__PURE__*/_jsx(CheckboxItem, {
52
+ modes: modes
53
+ })]
54
+ });
55
+ return /*#__PURE__*/_jsx(View, {
56
+ style: [containerStyle, style],
57
+ accessibilityRole: "list",
58
+ accessibilityLabel: accessibilityLabel,
59
+ children: items
60
+ });
61
+ }
62
+ export default CheckboxGroup;