jfs-components 0.0.71 → 0.0.73

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 (141) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
  3. package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
  4. package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -2
  5. package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +213 -0
  6. package/lib/commonjs/components/CardFinancialCondition/CardFinancialCondition.js +213 -0
  7. package/lib/commonjs/components/CardInsight/CardInsight.js +166 -0
  8. package/lib/commonjs/components/Carousel/Carousel.js +9 -7
  9. package/lib/commonjs/components/CheckboxGroup/CheckboxGroup.js +67 -0
  10. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +125 -0
  11. package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +56 -9
  12. package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +272 -0
  13. package/lib/commonjs/components/CoverageRing/CoverageRing.js +141 -0
  14. package/lib/commonjs/components/DonutChart/DonutChart.js +309 -0
  15. package/lib/commonjs/components/DonutChartSummary/DonutChartSummary.js +155 -0
  16. package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +2 -2
  17. package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +132 -0
  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/MetricLegendItem/MetricLegendItem.js +95 -0
  21. package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +286 -0
  22. package/lib/commonjs/components/OTP/OTP.js +381 -37
  23. package/lib/commonjs/components/ProductOverview/ProductOverview.js +147 -0
  24. package/lib/commonjs/components/Radio/Radio.js +194 -0
  25. package/lib/commonjs/components/RadioButton/RadioButton.js +21 -188
  26. package/lib/commonjs/components/RangeTrack/RangeTrack.js +269 -0
  27. package/lib/commonjs/components/SavingsGoalSummary/SavingsGoalSummary.js +181 -0
  28. package/lib/commonjs/components/SegmentedTrack/SegmentedTrack.js +171 -0
  29. package/lib/commonjs/components/StatGroup/StatGroup.js +128 -0
  30. package/lib/commonjs/components/StatItem/StatItem.js +65 -35
  31. package/lib/commonjs/components/StrengthIndicator/StrengthIndicator.js +157 -0
  32. package/lib/commonjs/components/SummaryTile/SummaryTile.js +150 -0
  33. package/lib/commonjs/components/index.js +192 -1
  34. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  35. package/lib/commonjs/icons/registry.js +1 -1
  36. package/lib/commonjs/utils/index.js +7 -0
  37. package/lib/commonjs/utils/number-utils.js +57 -0
  38. package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +233 -0
  39. package/lib/module/components/BrandChip/BrandChip.js +143 -0
  40. package/lib/module/components/CardAdvisory/CardAdvisory.js +2 -2
  41. package/lib/module/components/CardBankAccount/CardBankAccount.js +208 -0
  42. package/lib/module/components/CardFinancialCondition/CardFinancialCondition.js +207 -0
  43. package/lib/module/components/CardInsight/CardInsight.js +161 -0
  44. package/lib/module/components/Carousel/Carousel.js +9 -7
  45. package/lib/module/components/CheckboxGroup/CheckboxGroup.js +62 -0
  46. package/lib/module/components/CheckboxItem/CheckboxItem.js +119 -0
  47. package/lib/module/components/CircularProgressBar/CircularProgressBar.js +56 -9
  48. package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +266 -0
  49. package/lib/module/components/CoverageRing/CoverageRing.js +136 -0
  50. package/lib/module/components/DonutChart/DonutChart.js +303 -0
  51. package/lib/module/components/DonutChartSummary/DonutChartSummary.js +150 -0
  52. package/lib/module/components/HoldingsCard/HoldingsCard.js +2 -2
  53. package/lib/module/components/InstitutionBadge/InstitutionBadge.js +127 -0
  54. package/lib/module/components/LinearMeter/LinearMeter.js +9 -28
  55. package/lib/module/components/LinearProgress/LinearProgress.js +63 -0
  56. package/lib/module/components/MetricLegendItem/MetricLegendItem.js +90 -0
  57. package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +281 -0
  58. package/lib/module/components/OTP/OTP.js +381 -38
  59. package/lib/module/components/ProductOverview/ProductOverview.js +142 -0
  60. package/lib/module/components/Radio/Radio.js +188 -0
  61. package/lib/module/components/RadioButton/RadioButton.js +20 -185
  62. package/lib/module/components/RangeTrack/RangeTrack.js +263 -0
  63. package/lib/module/components/SavingsGoalSummary/SavingsGoalSummary.js +175 -0
  64. package/lib/module/components/SegmentedTrack/SegmentedTrack.js +166 -0
  65. package/lib/module/components/StatGroup/StatGroup.js +123 -0
  66. package/lib/module/components/StatItem/StatItem.js +66 -36
  67. package/lib/module/components/StrengthIndicator/StrengthIndicator.js +152 -0
  68. package/lib/module/components/SummaryTile/SummaryTile.js +145 -0
  69. package/lib/module/components/index.js +28 -1
  70. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  71. package/lib/module/icons/registry.js +1 -1
  72. package/lib/module/utils/index.js +2 -1
  73. package/lib/module/utils/number-utils.js +53 -0
  74. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +71 -0
  75. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +43 -0
  76. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +79 -0
  77. package/lib/typescript/src/components/CardFinancialCondition/CardFinancialCondition.d.ts +50 -0
  78. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +48 -0
  79. package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +41 -0
  80. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +56 -0
  81. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +11 -1
  82. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +105 -0
  83. package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +90 -0
  84. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +117 -0
  85. package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +103 -0
  86. package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +30 -0
  87. package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +17 -0
  88. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +37 -0
  89. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +119 -0
  90. package/lib/typescript/src/components/OTP/OTP.d.ts +88 -2
  91. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +39 -0
  92. package/lib/typescript/src/components/Radio/Radio.d.ts +30 -0
  93. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +20 -28
  94. package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +173 -0
  95. package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +95 -0
  96. package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +108 -0
  97. package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +45 -0
  98. package/lib/typescript/src/components/StatItem/StatItem.d.ts +24 -7
  99. package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +58 -0
  100. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +60 -0
  101. package/lib/typescript/src/components/index.d.ts +29 -2
  102. package/lib/typescript/src/icons/registry.d.ts +1 -1
  103. package/lib/typescript/src/utils/index.d.ts +1 -0
  104. package/lib/typescript/src/utils/number-utils.d.ts +29 -0
  105. package/package.json +1 -1
  106. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +323 -0
  107. package/src/components/BrandChip/BrandChip.tsx +235 -0
  108. package/src/components/CardAdvisory/CardAdvisory.tsx +2 -2
  109. package/src/components/CardBankAccount/CardBankAccount.tsx +295 -0
  110. package/src/components/CardFinancialCondition/CardFinancialCondition.tsx +366 -0
  111. package/src/components/CardInsight/CardInsight.tsx +239 -0
  112. package/src/components/Carousel/Carousel.tsx +14 -6
  113. package/src/components/CheckboxGroup/CheckboxGroup.tsx +86 -0
  114. package/src/components/CheckboxItem/CheckboxItem.tsx +174 -0
  115. package/src/components/CircularProgressBar/CircularProgressBar.tsx +74 -9
  116. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +378 -0
  117. package/src/components/CoverageRing/CoverageRing.tsx +225 -0
  118. package/src/components/DonutChart/DonutChart.tsx +503 -0
  119. package/src/components/DonutChartSummary/DonutChartSummary.tsx +256 -0
  120. package/src/components/HoldingsCard/HoldingsCard.tsx +2 -2
  121. package/src/components/InstitutionBadge/InstitutionBadge.tsx +216 -0
  122. package/src/components/LinearMeter/LinearMeter.tsx +9 -39
  123. package/src/components/LinearProgress/LinearProgress.tsx +92 -0
  124. package/src/components/MetricLegendItem/MetricLegendItem.tsx +167 -0
  125. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +438 -0
  126. package/src/components/OTP/OTP.tsx +476 -29
  127. package/src/components/ProductOverview/ProductOverview.tsx +236 -0
  128. package/src/components/Radio/Radio.tsx +227 -0
  129. package/src/components/RadioButton/RadioButton.tsx +23 -225
  130. package/src/components/RangeTrack/RangeTrack.tsx +394 -0
  131. package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +269 -0
  132. package/src/components/SegmentedTrack/SegmentedTrack.tsx +268 -0
  133. package/src/components/StatGroup/StatGroup.tsx +169 -0
  134. package/src/components/StatItem/StatItem.tsx +117 -40
  135. package/src/components/StrengthIndicator/StrengthIndicator.tsx +205 -0
  136. package/src/components/SummaryTile/SummaryTile.tsx +251 -0
  137. package/src/components/index.ts +39 -2
  138. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  139. package/src/icons/registry.ts +1 -1
  140. package/src/utils/index.ts +1 -0
  141. package/src/utils/number-utils.ts +60 -0
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _reactUtils = require("../../utils/react-utils");
11
+ var _Badge = _interopRequireDefault(require("../Badge/Badge"));
12
+ var _Button = _interopRequireDefault(require("../Button/Button"));
13
+ var _InstitutionBadge = _interopRequireDefault(require("../InstitutionBadge/InstitutionBadge"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const DEFAULT_ITEMS = [{
17
+ label: 'Account type',
18
+ value: 'Korem ipsum'
19
+ }, {
20
+ label: 'Account number',
21
+ value: 'Korem ipsum'
22
+ }, {
23
+ label: 'Last updated',
24
+ value: 'Korem ipsum'
25
+ }];
26
+ const toNumber = (value, fallback) => {
27
+ if (typeof value === 'number') return Number.isFinite(value) ? value : fallback;
28
+ if (typeof value === 'string') {
29
+ const parsed = Number(value);
30
+ return Number.isFinite(parsed) ? parsed : fallback;
31
+ }
32
+ return fallback;
33
+ };
34
+ const toFontWeight = (value, fallback) => {
35
+ if (typeof value === 'number') return String(value);
36
+ if (typeof value === 'string') return value;
37
+ return fallback;
38
+ };
39
+
40
+ /**
41
+ * `CardBankAccount` renders a bank account summary card composed of:
42
+ *
43
+ * 1. A header with an `InstitutionBadge` (avatar + bank name) and an
44
+ * optional trailing `Badge`.
45
+ * 2. A configurable list of label/value rows describing the account.
46
+ * 3. A footer `Button` for the primary action.
47
+ *
48
+ * All values resolve through the `bankAccountCard/*` design tokens with
49
+ * sensible Figma defaults so the card renders correctly out of the box.
50
+ *
51
+ * @component
52
+ * @param {CardBankAccountProps} props
53
+ */
54
+ function CardBankAccount({
55
+ institutionName = 'State Bank of India',
56
+ institutionAvatar,
57
+ badge,
58
+ headerSlot,
59
+ items = DEFAULT_ITEMS,
60
+ children,
61
+ buttonLabel = 'Button',
62
+ onButtonPress,
63
+ footer,
64
+ modes = _reactUtils.EMPTY_MODES,
65
+ style,
66
+ accessibilityLabel
67
+ }) {
68
+ const background = (0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/background', modes) ?? '#ffffff';
69
+ const radius = toNumber((0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/radius', modes), 16);
70
+ const paddingHorizontal = toNumber((0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/padding/horizontal', modes), 12);
71
+ const paddingVertical = toNumber((0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/padding/vertical', modes), 16);
72
+ const gap = toNumber((0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/gap', modes), 16);
73
+ const headerGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('bankAccountCard/header/gap', modes), 8);
74
+ const listGroupGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('listGroup/gap', modes), 12);
75
+ const rowGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('listItem/gap', modes), 8);
76
+ const titleColor = (0, _figmaVariablesResolver.getVariableByName)('listItem/title/color', modes) ?? '#0f0d0a';
77
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('listItem/title/fontFamily', modes) ?? 'JioType Var';
78
+ const titleFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('listItem/title/fontSize', modes), 14);
79
+ const titleLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('listItem/title/lineHeight', modes), 16);
80
+ const titleFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('listItem/title/fontWeight', modes), '700');
81
+ const valueColor = (0, _figmaVariablesResolver.getVariableByName)('text/foreground', modes) ?? '#000000';
82
+ const valueFontFamily = (0, _figmaVariablesResolver.getVariableByName)('text/fontFamily', modes) ?? 'JioType Var';
83
+ const valueFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('text/fontSize', modes), 14);
84
+ const valueLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('text/lineHeight', modes), 20);
85
+ const valueLetterSpacing = toNumber((0, _figmaVariablesResolver.getVariableByName)('text/letterSpacing', modes), -0.5);
86
+ const valueFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('text/fontWeight', modes), '500');
87
+ const labelStyle = {
88
+ color: titleColor,
89
+ fontFamily: titleFontFamily,
90
+ fontSize: titleFontSize,
91
+ lineHeight: titleLineHeight,
92
+ fontWeight: titleFontWeight
93
+ };
94
+ const valueTextStyle = {
95
+ color: valueColor,
96
+ fontFamily: valueFontFamily,
97
+ fontSize: valueFontSize,
98
+ lineHeight: valueLineHeight,
99
+ letterSpacing: valueLetterSpacing,
100
+ fontWeight: valueFontWeight
101
+ };
102
+ const renderBadge = () => {
103
+ if (badge === false || badge === null || badge === undefined) return null;
104
+ if (typeof badge === 'string') {
105
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
106
+ label: badge,
107
+ modes: modes
108
+ });
109
+ }
110
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(badge, modes);
111
+ return processed.length === 1 ? processed[0] : processed;
112
+ };
113
+ const renderHeader = () => {
114
+ if (headerSlot !== undefined) {
115
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(headerSlot, modes);
116
+ return processed.length === 1 ? processed[0] : processed;
117
+ }
118
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
119
+ style: {
120
+ flexDirection: 'row',
121
+ alignItems: 'center',
122
+ gap: headerGap,
123
+ width: '100%'
124
+ },
125
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
126
+ style: {
127
+ flex: 1,
128
+ minWidth: 0
129
+ },
130
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InstitutionBadge.default, {
131
+ label: institutionName,
132
+ ...(institutionAvatar !== undefined ? {
133
+ source: institutionAvatar
134
+ } : {}),
135
+ modes: modes
136
+ })
137
+ }), renderBadge()]
138
+ });
139
+ };
140
+ const renderItems = () => {
141
+ if (children !== undefined && children !== null) {
142
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(children, modes);
143
+ if (processed.length === 0) return null;
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
145
+ style: {
146
+ width: '100%',
147
+ gap: listGroupGap
148
+ },
149
+ children: processed.length === 1 ? processed[0] : processed
150
+ });
151
+ }
152
+ if (!items || items.length === 0) return null;
153
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
154
+ style: {
155
+ width: '100%',
156
+ gap: listGroupGap
157
+ },
158
+ children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
159
+ style: {
160
+ flexDirection: 'row',
161
+ alignItems: 'center',
162
+ gap: rowGap,
163
+ width: '100%'
164
+ },
165
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
166
+ style: {
167
+ flex: 1,
168
+ minWidth: 0
169
+ },
170
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
171
+ style: labelStyle,
172
+ children: item.label
173
+ })
174
+ }), typeof item.value === 'string' || typeof item.value === 'number' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
175
+ style: valueTextStyle,
176
+ numberOfLines: 1,
177
+ children: item.value
178
+ }) : (0, _reactUtils.cloneChildrenWithModes)(item.value, modes)]
179
+ }, `${item.label}-${index}`))
180
+ });
181
+ };
182
+ const renderFooter = () => {
183
+ if (footer === false || footer === null) return null;
184
+ if (footer === undefined) {
185
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
186
+ label: buttonLabel,
187
+ ...(onButtonPress ? {
188
+ onPress: onButtonPress
189
+ } : {}),
190
+ modes: modes,
191
+ style: {
192
+ width: '100%'
193
+ }
194
+ });
195
+ }
196
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(footer, modes);
197
+ return processed.length === 1 ? processed[0] : processed;
198
+ };
199
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
200
+ accessibilityLabel: accessibilityLabel ?? institutionName,
201
+ style: [{
202
+ backgroundColor: background,
203
+ borderRadius: radius,
204
+ paddingHorizontal,
205
+ paddingVertical,
206
+ gap,
207
+ alignItems: 'flex-start',
208
+ width: '100%'
209
+ }, style],
210
+ children: [renderHeader(), renderItems(), renderFooter()]
211
+ });
212
+ }
213
+ var _default = exports.default = CardBankAccount;
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
11
+ var _reactUtils = require("../../utils/react-utils");
12
+ var _Button = _interopRequireDefault(require("../Button/Button"));
13
+ var _CircularProgressBar = _interopRequireDefault(require("../CircularProgressBar/CircularProgressBar"));
14
+ var _Divider = _interopRequireDefault(require("../Divider/Divider"));
15
+ var _Nudge = _interopRequireDefault(require("../Nudge/Nudge"));
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ const toNumber = (value, fallback) => {
20
+ if (typeof value === 'number') {
21
+ return Number.isFinite(value) ? value : fallback;
22
+ }
23
+ if (typeof value === 'string') {
24
+ const parsed = Number(value);
25
+ return Number.isFinite(parsed) ? parsed : fallback;
26
+ }
27
+ return fallback;
28
+ };
29
+ const toFontWeight = (value, fallback) => {
30
+ if (typeof value === 'number') {
31
+ return String(value);
32
+ }
33
+ if (typeof value === 'string') {
34
+ return value;
35
+ }
36
+ return fallback;
37
+ };
38
+ function resolveCardFinancialConditionTokens(modes) {
39
+ const background = (0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/background', modes) || '#ffffff';
40
+ const radius = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/radius', modes), 16);
41
+ const paddingH = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/padding/horizontal', modes), 16);
42
+ const paddingV = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/padding/vertical', modes), 16);
43
+ const gap = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/gap', modes), 8);
44
+ const headerGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/header/gap', modes), 16);
45
+ const textContentGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/textContent/gap', modes), 8);
46
+ const titleColor = (0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/title/color', modes) || '#0c0d10';
47
+ const titleFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/title/fontSize', modes), 16);
48
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/title/fontFamily', modes) || 'JioType Var';
49
+ const titleLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/title/lineHeight', modes), 18);
50
+ const titleFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/title/fontWeight', modes), '700');
51
+ const bodyColor = (0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/body/color', modes) || '#0c0d10';
52
+ const bodyFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/body/fontSize', modes), 14);
53
+ const bodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/body/fontFamily', modes) || 'JioType Var';
54
+ const bodyLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/body/lineHeight', modes), 17);
55
+ const bodyFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('financialConditionCard/body/fontWeight', modes), '400');
56
+ const nudgeBodyColor = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/color', modes) || '#1a1c1f';
57
+ const nudgeBodyFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontSize', modes), 12);
58
+ const nudgeBodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontFamily', modes) || 'JioType Var';
59
+ const nudgeBodyLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('nudge/body/lineHeight', modes), 16);
60
+ const nudgeBodyFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontWeight', modes), '500');
61
+ return {
62
+ containerStyle: {
63
+ alignItems: 'flex-start',
64
+ backgroundColor: background,
65
+ borderRadius: radius,
66
+ gap,
67
+ justifyContent: 'center',
68
+ overflow: 'hidden',
69
+ paddingHorizontal: paddingH,
70
+ paddingVertical: paddingV
71
+ },
72
+ headerStyle: {
73
+ alignItems: 'center',
74
+ flexDirection: 'row',
75
+ gap: headerGap,
76
+ width: '100%'
77
+ },
78
+ textContentStyle: {
79
+ alignItems: 'flex-start',
80
+ flex: 1,
81
+ gap: textContentGap,
82
+ minWidth: 1
83
+ },
84
+ titleStyle: {
85
+ color: titleColor,
86
+ fontFamily: titleFontFamily,
87
+ fontSize: titleFontSize,
88
+ fontWeight: titleFontWeight,
89
+ lineHeight: titleLineHeight
90
+ },
91
+ bodyStyle: {
92
+ color: bodyColor,
93
+ fontFamily: bodyFontFamily,
94
+ fontSize: bodyFontSize,
95
+ fontWeight: bodyFontWeight,
96
+ lineHeight: bodyLineHeight
97
+ },
98
+ nudgeBodyStyle: {
99
+ color: nudgeBodyColor,
100
+ fontFamily: nudgeBodyFontFamily,
101
+ fontSize: nudgeBodyFontSize,
102
+ fontWeight: nudgeBodyFontWeight,
103
+ lineHeight: nudgeBodyLineHeight
104
+ },
105
+ buttonWrapStyle: {
106
+ alignSelf: 'stretch',
107
+ alignItems: 'flex-start'
108
+ }
109
+ };
110
+ }
111
+ function CardFinancialCondition({
112
+ title = 'Protection',
113
+ body = 'Check your coverage and gaps',
114
+ value = 0,
115
+ progressState = 'Inactive',
116
+ valueLabel,
117
+ showNudge = true,
118
+ nudgeBody = 'There may be gaps in your health or life cover\nAdd coverage to stay financially secure',
119
+ showDivider = true,
120
+ showButton = true,
121
+ buttonLabel = 'View Details',
122
+ onPressButton,
123
+ progressSlot,
124
+ nudgeSlot,
125
+ buttonSlot,
126
+ modes: propModes = _reactUtils.EMPTY_MODES,
127
+ style,
128
+ headerStyle,
129
+ titleStyle,
130
+ bodyStyle,
131
+ accessibilityLabel,
132
+ ...rest
133
+ }) {
134
+ const {
135
+ modes: globalModes
136
+ } = (0, _JFSThemeProvider.useTokens)();
137
+ const modes = (0, _react.useMemo)(() => globalModes === _reactUtils.EMPTY_MODES && propModes === _reactUtils.EMPTY_MODES ? _reactUtils.EMPTY_MODES : {
138
+ ...globalModes,
139
+ ...propModes
140
+ }, [globalModes, propModes]);
141
+ const tokens = (0, _react.useMemo)(() => resolveCardFinancialConditionTokens(modes), [modes]);
142
+
143
+ // Match Figma: the action button is the primary call-to-action and uses the
144
+ // Secondary brand (purple) regardless of the card's overall AppearanceBrand,
145
+ // while Nudge / CircularProgressBar still follow the user-supplied modes.
146
+ const buttonModes = (0, _react.useMemo)(() => ({
147
+ ...modes,
148
+ AppearanceBrand: 'Secondary'
149
+ }), [modes]);
150
+ const processedProgressSlot = (0, _react.useMemo)(() => {
151
+ if (!progressSlot) return null;
152
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(progressSlot), modes);
153
+ return processed.length === 1 ? processed[0] : processed;
154
+ }, [progressSlot, modes]);
155
+ const processedNudgeSlot = (0, _react.useMemo)(() => {
156
+ if (!nudgeSlot) return null;
157
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(nudgeSlot), modes);
158
+ return processed.length === 1 ? processed[0] : processed;
159
+ }, [nudgeSlot, modes]);
160
+ const processedButtonSlot = (0, _react.useMemo)(() => {
161
+ if (!buttonSlot) return null;
162
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(buttonSlot), buttonModes);
163
+ return processed.length === 1 ? processed[0] : processed;
164
+ }, [buttonSlot, buttonModes]);
165
+ const defaultAccessibilityLabel = accessibilityLabel ?? `${title}. ${body}.`;
166
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
167
+ accessibilityLabel: defaultAccessibilityLabel,
168
+ style: [tokens.containerStyle, style],
169
+ ...rest,
170
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
171
+ style: [tokens.headerStyle, headerStyle],
172
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
173
+ style: tokens.textContentStyle,
174
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
175
+ style: [tokens.titleStyle, titleStyle],
176
+ children: title
177
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
178
+ style: [tokens.bodyStyle, bodyStyle],
179
+ children: body
180
+ })]
181
+ }), processedProgressSlot || /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgressBar.default, {
182
+ state: progressState,
183
+ value: value,
184
+ modes: modes,
185
+ ...(valueLabel ? {
186
+ valueLabel
187
+ } : {})
188
+ })]
189
+ }), showNudge ? processedNudgeSlot || /*#__PURE__*/(0, _jsxRuntime.jsx)(_Nudge.default, {
190
+ type: "inline-compact",
191
+ modes: modes,
192
+ style: {
193
+ width: '100%'
194
+ },
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
196
+ style: tokens.nudgeBodyStyle,
197
+ children: nudgeBody
198
+ })
199
+ }) : null, showDivider ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
200
+ modes: modes
201
+ }) : null, showButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
202
+ style: tokens.buttonWrapStyle,
203
+ children: processedButtonSlot || /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
204
+ label: buttonLabel,
205
+ modes: buttonModes,
206
+ ...(onPressButton ? {
207
+ onPress: onPressButton
208
+ } : {})
209
+ })
210
+ }) : null]
211
+ });
212
+ }
213
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(CardFinancialCondition);
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _reactUtils = require("../../utils/react-utils");
11
+ var _Badge = _interopRequireDefault(require("../Badge/Badge"));
12
+ var _Divider = _interopRequireDefault(require("../Divider/Divider"));
13
+ var _Nudge = _interopRequireDefault(require("../Nudge/Nudge"));
14
+ var _SavingsGoalSummary = _interopRequireDefault(require("../SavingsGoalSummary/SavingsGoalSummary"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ /**
18
+ * `CardInsight` renders a single insight card composed of:
19
+ *
20
+ * 1. A header with a title, subtitle and a trailing `Badge`.
21
+ * 2. A flexible content slot — defaults to `SavingsGoalSummary`.
22
+ * 3. A `Divider` separating the slot from the footer.
23
+ * 4. A footer slot — defaults to an inline-compact `Nudge`.
24
+ *
25
+ * @component
26
+ * @param {CardInsightProps} props
27
+ */
28
+ function CardInsight({
29
+ title = 'Emergency savings',
30
+ subtitle = 'One line explanation here.',
31
+ badge = 'Label',
32
+ children,
33
+ footer,
34
+ divider,
35
+ modes = _reactUtils.EMPTY_MODES,
36
+ style
37
+ }) {
38
+ const background = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/background', modes) ?? '#ffffff';
39
+ const radius = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/radius', modes) ?? 16;
40
+ const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/padding/horizontal', modes) ?? 12;
41
+ const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/padding/vertical', modes) ?? 16;
42
+ const gap = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/gap', modes) ?? 12;
43
+ const contentGap = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/contentGap', modes) ?? 8;
44
+ const width = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/width', modes) ?? 356;
45
+ const slotBackground = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/slot/background', modes) ?? '#ffffff';
46
+ const headerGap = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/header/gap', modes) ?? 8;
47
+ const textGap = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/text/gap', modes) ?? 4;
48
+ const titleColor = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/title/color', modes) ?? '#0d0d0f';
49
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/title/fontFamily', modes) ?? 'JioType Var';
50
+ const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/title/fontSize', modes) ?? 16;
51
+ const titleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/title/lineHeight', modes) ?? 17.6;
52
+ const titleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/title/fontWeight', modes) ?? 700;
53
+ const titleFontWeight = String(titleFontWeightRaw);
54
+ const bodyColor = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/body/color', modes) ?? '#0d0d0f';
55
+ const bodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/body/fontFamily', modes) ?? 'JioType Var';
56
+ const bodyFontSize = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/body/fontSize', modes) ?? 12;
57
+ const bodyLineHeight = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/body/lineHeight', modes) ?? 15.6;
58
+ const bodyFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('cardInsight/body/fontWeight', modes) ?? 400;
59
+ const bodyFontWeight = String(bodyFontWeightRaw);
60
+ const renderBadge = () => {
61
+ if (badge === false || badge === null || badge === undefined) return null;
62
+ if (typeof badge === 'string') {
63
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
64
+ label: badge,
65
+ modes: modes
66
+ });
67
+ }
68
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(badge, modes);
69
+ return processed.length === 1 ? processed[0] : processed;
70
+ };
71
+ const renderSlot = () => {
72
+ if (!children) {
73
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SavingsGoalSummary.default, {
74
+ modes: modes
75
+ });
76
+ }
77
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(children, modes);
78
+ return processed.length === 1 ? processed[0] : processed;
79
+ };
80
+ const renderFooter = () => {
81
+ if (footer === false || footer === null) return null;
82
+ if (footer === undefined) {
83
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Nudge.default, {
84
+ type: "inline-compact",
85
+ modes: {
86
+ AppearanceBrand: 'Neutral',
87
+ Context: 'Nudge&Alert',
88
+ ...modes
89
+ }
90
+ });
91
+ }
92
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(footer, modes);
93
+ return processed.length === 1 ? processed[0] : processed;
94
+ };
95
+ const renderDivider = () => {
96
+ if (divider === false || divider === null) return null;
97
+ if (divider === undefined || divider === true) {
98
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
99
+ modes: modes
100
+ });
101
+ }
102
+ const processed = (0, _reactUtils.cloneChildrenWithModes)(divider, modes);
103
+ return processed.length === 1 ? processed[0] : processed;
104
+ };
105
+ const footerNode = renderFooter();
106
+ const showDivider = footerNode !== null && divider !== false && divider !== null;
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
108
+ style: [{
109
+ width,
110
+ backgroundColor: background,
111
+ borderRadius: radius,
112
+ paddingHorizontal,
113
+ paddingVertical,
114
+ gap,
115
+ overflow: 'hidden',
116
+ alignItems: 'stretch'
117
+ }, style],
118
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
119
+ style: {
120
+ flexDirection: 'row',
121
+ alignItems: 'flex-start',
122
+ gap: headerGap,
123
+ width: '100%'
124
+ },
125
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
126
+ style: {
127
+ flex: 1,
128
+ minWidth: 0,
129
+ gap: textGap,
130
+ alignItems: 'flex-start'
131
+ },
132
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
133
+ style: {
134
+ color: titleColor,
135
+ fontFamily: titleFontFamily,
136
+ fontSize: titleFontSize,
137
+ lineHeight: titleLineHeight,
138
+ fontWeight: titleFontWeight,
139
+ width: '100%'
140
+ },
141
+ children: title
142
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
143
+ style: {
144
+ color: bodyColor,
145
+ fontFamily: bodyFontFamily,
146
+ fontSize: bodyFontSize,
147
+ lineHeight: bodyLineHeight,
148
+ fontWeight: bodyFontWeight,
149
+ width: '100%'
150
+ },
151
+ children: subtitle
152
+ })]
153
+ }), renderBadge()]
154
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
155
+ style: {
156
+ width: '100%',
157
+ backgroundColor: slotBackground,
158
+ gap: contentGap,
159
+ overflow: 'hidden',
160
+ alignItems: 'stretch'
161
+ },
162
+ children: renderSlot()
163
+ }), showDivider ? renderDivider() : null, footerNode]
164
+ });
165
+ }
166
+ var _default = exports.default = CardInsight;
@@ -51,6 +51,8 @@ function Carousel({
51
51
  const gap = gapProp ?? tokenGap;
52
52
  const containerPaddingH = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/padding/horizontal', modes) || '0');
53
53
  const containerPaddingV = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/padding/vertical', modes) || '0');
54
+ // Outer container max height per Figma (`carousel/maxHeight`).
55
+ const maxHeight = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/maxHeight', modes) || '280');
54
56
  // Spacing between the cards row and the pagination dots uses `carousel/gap`.
55
57
  const paginationOffset = gap;
56
58
 
@@ -162,7 +164,8 @@ function Carousel({
162
164
 
163
165
  // ---- Render ----
164
166
  const outerStyle = {
165
- paddingVertical: containerPaddingV
167
+ paddingVertical: containerPaddingV,
168
+ maxHeight
166
169
  };
167
170
  const contentContainerStyle = {
168
171
  paddingHorizontal: containerPaddingH * 2,
@@ -270,13 +273,12 @@ function Pagination({
270
273
  const modes = propModes || ctxModes || {};
271
274
 
272
275
  // Token resolution for dots — matches Figma tokens
273
- // (carousel/pagination/gap, carousel/pagination/indicator/{activecolor,inactivecolor,radius}).
274
- // Dot dimensions are fixed per Figma spec: inactive 6x6, active 16x6.
275
- const dotSize = 6;
276
- const dotActiveWidth = 16;
276
+ // (carousel/pagination/gap, carousel/pagination/indicator/{activeColor,inactiveColor,radius,size,activeWidth}).
277
+ const dotSize = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/size', modes) || '6');
278
+ const dotActiveWidth = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/activeWidth', modes) || '16');
277
279
  const dotGap = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/gap', modes) || '4');
278
- const dotColor = (0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/inactivecolor', modes) || 'rgba(0,0,0,0.3)';
279
- const dotActiveColor = (0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/activecolor', modes) || '#170d0a';
280
+ const dotColor = (0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/inactiveColor', modes) || 'rgba(0,0,0,0.3)';
281
+ const dotActiveColor = (0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/activeColor', modes) || '#170d0a';
280
282
  const dotRadius = parseFloat((0, _figmaVariablesResolver.getVariableByName)('carousel/pagination/indicator/radius', modes) || '9999');
281
283
  const containerStyle = {
282
284
  flexDirection: 'row',