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