jfs-components 0.0.72 → 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.
- package/CHANGELOG.md +11 -0
- package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
- package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
- package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +213 -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 +125 -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/LinearMeter/LinearMeter.js +9 -28
- package/lib/commonjs/components/LinearProgress/LinearProgress.js +68 -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/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/index.js +171 -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/BrandChip/BrandChip.js +143 -0
- package/lib/module/components/CardBankAccount/CardBankAccount.js +208 -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 +119 -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/LinearMeter/LinearMeter.js +9 -28
- package/lib/module/components/LinearProgress/LinearProgress.js +63 -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/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/index.js +21 -1
- 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/BrandChip/BrandChip.d.ts +43 -0
- package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +79 -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 +56 -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/LinearProgress/LinearProgress.d.ts +17 -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/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/index.d.ts +22 -2
- 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 -1
- package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +323 -0
- package/src/components/BrandChip/BrandChip.tsx +235 -0
- package/src/components/CardBankAccount/CardBankAccount.tsx +295 -0
- package/src/components/CardInsight/CardInsight.tsx +239 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +86 -0
- package/src/components/CheckboxItem/CheckboxItem.tsx +174 -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/LinearMeter/LinearMeter.tsx +9 -39
- package/src/components/LinearProgress/LinearProgress.tsx +92 -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/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/index.ts +32 -2
- 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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [0.0.73] - 2026-05-15
|
|
8
|
+
|
|
9
|
+
- Added new coverage and tracking components: `CoverageRing`, `CoverageBarComparison`, and `MonthlyStatusGrid` (with exported `CalendarGlyph`).
|
|
10
|
+
- Enhanced `CircularProgressBar` with an in-ring `supportText` caption (driven by `circularProgressBar/supportText/*` tokens) and a centered text stack.
|
|
11
|
+
- Refreshed `LinearProgress` and `SavingsGoalSummary` token surface: split `Appearance / DataViz` into `Appearance Type` + `AppearanceBrand` + `AppearanceSystem`, and renamed `Emphasis / DataViz` to `Emphasis`.
|
|
12
|
+
- Expanded `SupportText`, `SupportTextIcon`, and `InputSearch` with an `Auto` status mode and a new `FormField States` collection (Idle / Active / Read Only / Error).
|
|
13
|
+
- Added `Error` state and `Color Mode` support to `FormField`, and a new `Page type` (MainPage / SubPage) collection on `Title`.
|
|
14
|
+
- Refreshed component token metadata and updated Storybook/MDX coverage for all changed components.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
7
18
|
## [0.0.72] - 2026-05-04
|
|
8
19
|
|
|
9
20
|
High-level summary (one line per point):
|
|
@@ -0,0 +1,239 @@
|
|
|
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 _Checkbox = _interopRequireDefault(require("../Checkbox/Checkbox"));
|
|
12
|
+
var _Divider = _interopRequireDefault(require("../Divider/Divider"));
|
|
13
|
+
var _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
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
|
+
if (_reactNative.Platform.OS === 'android' && _reactNative.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
18
|
+
_reactNative.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* AccordionCheckbox composes a header (with a `Checkbox`, title, subtitle and
|
|
22
|
+
* chevron) and a collapsible content slot. It mirrors the Figma
|
|
23
|
+
* "Accordion Checkbox" component.
|
|
24
|
+
*
|
|
25
|
+
* Two independent interactions live inside the header:
|
|
26
|
+
* - **Pressing the checkbox** toggles the parent checked state via
|
|
27
|
+
* `onCheckedChange` (typically used for "select all" behaviour).
|
|
28
|
+
* - **Pressing anywhere else on the header** toggles the expanded state via
|
|
29
|
+
* `onExpandedChange`.
|
|
30
|
+
*
|
|
31
|
+
* When expanded, a divider is shown and `children` are rendered with `modes`
|
|
32
|
+
* automatically forwarded through `cloneChildrenWithModes`.
|
|
33
|
+
*
|
|
34
|
+
* @component
|
|
35
|
+
* @param {AccordionCheckboxProps} props
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <AccordionCheckbox
|
|
40
|
+
* title="Axis Bank"
|
|
41
|
+
* subtitle="3 accounts"
|
|
42
|
+
* defaultExpanded
|
|
43
|
+
* defaultChecked
|
|
44
|
+
* modes={{ 'Color Mode': 'Light' }}
|
|
45
|
+
* >
|
|
46
|
+
* <CheckboxGroup>
|
|
47
|
+
* <CheckboxItem label="Fixed deposit • 0245" />
|
|
48
|
+
* <CheckboxItem label="Recurring deposit • 1182" />
|
|
49
|
+
* <CheckboxItem label="Mutual fund • Equity" />
|
|
50
|
+
* </CheckboxGroup>
|
|
51
|
+
* </AccordionCheckbox>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
function AccordionCheckbox({
|
|
55
|
+
title = 'Axis Bank',
|
|
56
|
+
subtitle = '3 accounts',
|
|
57
|
+
defaultExpanded = false,
|
|
58
|
+
expanded: controlledExpanded,
|
|
59
|
+
onExpandedChange,
|
|
60
|
+
defaultChecked = false,
|
|
61
|
+
checked: controlledChecked,
|
|
62
|
+
onCheckedChange,
|
|
63
|
+
disabled = false,
|
|
64
|
+
children,
|
|
65
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
66
|
+
style,
|
|
67
|
+
accessibilityLabel
|
|
68
|
+
}) {
|
|
69
|
+
const isExpandedControlled = controlledExpanded !== undefined;
|
|
70
|
+
const [internalExpanded, setInternalExpanded] = (0, _react.useState)(defaultExpanded);
|
|
71
|
+
const isExpanded = isExpandedControlled ? controlledExpanded : internalExpanded;
|
|
72
|
+
const isCheckedControlled = controlledChecked !== undefined;
|
|
73
|
+
const [internalChecked, setInternalChecked] = (0, _react.useState)(defaultChecked);
|
|
74
|
+
const isChecked = isCheckedControlled ? controlledChecked : internalChecked;
|
|
75
|
+
const handleToggleExpanded = (0, _react.useCallback)(() => {
|
|
76
|
+
if (disabled) return;
|
|
77
|
+
_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);
|
|
78
|
+
const next = !isExpanded;
|
|
79
|
+
if (!isExpandedControlled) {
|
|
80
|
+
setInternalExpanded(next);
|
|
81
|
+
}
|
|
82
|
+
onExpandedChange?.(next);
|
|
83
|
+
}, [disabled, isExpanded, isExpandedControlled, onExpandedChange]);
|
|
84
|
+
const handleToggleChecked = (0, _react.useCallback)(next => {
|
|
85
|
+
if (disabled) return;
|
|
86
|
+
if (!isCheckedControlled) {
|
|
87
|
+
setInternalChecked(next);
|
|
88
|
+
}
|
|
89
|
+
onCheckedChange?.(next);
|
|
90
|
+
}, [disabled, isCheckedControlled, onCheckedChange]);
|
|
91
|
+
const background = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/background', modes) ?? '#ffffff';
|
|
92
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/radius', modes) ?? 12;
|
|
93
|
+
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/padding/horizontal', modes) ?? 12;
|
|
94
|
+
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/padding/vertical', modes) ?? 16;
|
|
95
|
+
const containerGap = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/gap', modes) ?? 12;
|
|
96
|
+
const borderColor = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/border/color', modes) ?? '#ebebed';
|
|
97
|
+
const borderSize = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/border/size', modes) ?? 1;
|
|
98
|
+
const headerGap = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/header/gap', modes) ?? 12;
|
|
99
|
+
const headerPaddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/header/padding/horizontal', modes) ?? 0;
|
|
100
|
+
const headerPaddingVertical = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/header/padding/vertical', modes) ?? 0;
|
|
101
|
+
const headerWrapGap = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/header/wrap/gap', modes) ?? 12;
|
|
102
|
+
const textWrapGap = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/textWrap/gap', modes) ?? 2;
|
|
103
|
+
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/title/color', modes) ?? '#000000';
|
|
104
|
+
const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/title/fontSize', modes) ?? 14;
|
|
105
|
+
const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/title/fontFamily', modes) ?? 'JioType Var';
|
|
106
|
+
const titleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/title/lineHeight', modes) ?? 18;
|
|
107
|
+
const titleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/title/fontWeight', modes) ?? 600;
|
|
108
|
+
const titleFontWeight = String(titleFontWeightRaw);
|
|
109
|
+
const subtitleColor = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/subtitle/color', modes) ?? '#23190a';
|
|
110
|
+
const subtitleFontSize = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/subtitle/fontSize', modes) ?? 12;
|
|
111
|
+
const subtitleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/subtitle/fontFamily', modes) ?? 'JioType Var';
|
|
112
|
+
const subtitleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/subtitle/lineHeight', modes) ?? 16;
|
|
113
|
+
const subtitleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/subtitle/fontWeight', modes) ?? 500;
|
|
114
|
+
const subtitleFontWeight = String(subtitleFontWeightRaw);
|
|
115
|
+
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/icon/color', modes) ?? '#000000';
|
|
116
|
+
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/icon/size', modes) ?? 24;
|
|
117
|
+
const contentGap = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/content/gap', modes) ?? 0;
|
|
118
|
+
const contentPaddingTop = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/content/padding/top', modes) ?? 8;
|
|
119
|
+
const contentPaddingBottom = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/content/padding/bottom', modes) ?? 0;
|
|
120
|
+
const contentPaddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('accordionCheckbox/content/padding/horizontal', modes) ?? 0;
|
|
121
|
+
const containerStyle = {
|
|
122
|
+
backgroundColor: background,
|
|
123
|
+
borderRadius: radius,
|
|
124
|
+
paddingHorizontal,
|
|
125
|
+
paddingVertical,
|
|
126
|
+
flexDirection: 'column',
|
|
127
|
+
alignItems: 'stretch',
|
|
128
|
+
gap: containerGap,
|
|
129
|
+
overflow: 'hidden',
|
|
130
|
+
...(isExpanded ? {
|
|
131
|
+
borderWidth: borderSize,
|
|
132
|
+
borderColor
|
|
133
|
+
} : null),
|
|
134
|
+
...(disabled ? {
|
|
135
|
+
opacity: 0.6
|
|
136
|
+
} : null)
|
|
137
|
+
};
|
|
138
|
+
const headerStyle = {
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
gap: headerGap,
|
|
142
|
+
paddingHorizontal: headerPaddingHorizontal,
|
|
143
|
+
paddingVertical: headerPaddingVertical
|
|
144
|
+
};
|
|
145
|
+
const wrapStyle = {
|
|
146
|
+
flex: 1,
|
|
147
|
+
minWidth: 0,
|
|
148
|
+
flexDirection: 'row',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
gap: headerWrapGap
|
|
151
|
+
};
|
|
152
|
+
const textWrapStyle = {
|
|
153
|
+
flex: 1,
|
|
154
|
+
minWidth: 0,
|
|
155
|
+
flexDirection: 'column',
|
|
156
|
+
alignItems: 'flex-start',
|
|
157
|
+
gap: textWrapGap
|
|
158
|
+
};
|
|
159
|
+
const titleStyle = {
|
|
160
|
+
color: titleColor,
|
|
161
|
+
fontSize: titleFontSize,
|
|
162
|
+
lineHeight: titleLineHeight,
|
|
163
|
+
fontFamily: titleFontFamily,
|
|
164
|
+
fontWeight: titleFontWeight
|
|
165
|
+
};
|
|
166
|
+
const subtitleStyle = {
|
|
167
|
+
color: subtitleColor,
|
|
168
|
+
fontSize: subtitleFontSize,
|
|
169
|
+
lineHeight: subtitleLineHeight,
|
|
170
|
+
fontFamily: subtitleFontFamily,
|
|
171
|
+
fontWeight: subtitleFontWeight
|
|
172
|
+
};
|
|
173
|
+
const contentStyle = {
|
|
174
|
+
flexDirection: 'column',
|
|
175
|
+
alignItems: 'stretch',
|
|
176
|
+
justifyContent: 'center',
|
|
177
|
+
gap: contentGap,
|
|
178
|
+
paddingTop: contentPaddingTop,
|
|
179
|
+
paddingBottom: contentPaddingBottom,
|
|
180
|
+
paddingHorizontal: contentPaddingHorizontal
|
|
181
|
+
};
|
|
182
|
+
const a11yLabel = accessibilityLabel ?? title;
|
|
183
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
184
|
+
style: [containerStyle, style],
|
|
185
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
186
|
+
onPress: handleToggleExpanded,
|
|
187
|
+
disabled: disabled,
|
|
188
|
+
accessibilityRole: "button",
|
|
189
|
+
accessibilityState: {
|
|
190
|
+
expanded: isExpanded,
|
|
191
|
+
disabled
|
|
192
|
+
},
|
|
193
|
+
accessibilityLabel: a11yLabel,
|
|
194
|
+
accessibilityHint: isExpanded ? 'Collapse' : 'Expand',
|
|
195
|
+
style: ({
|
|
196
|
+
pressed
|
|
197
|
+
}) => [headerStyle, pressed && !disabled ? {
|
|
198
|
+
opacity: 0.9
|
|
199
|
+
} : null],
|
|
200
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
201
|
+
style: wrapStyle,
|
|
202
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
203
|
+
checked: isChecked,
|
|
204
|
+
onValueChange: handleToggleChecked,
|
|
205
|
+
disabled: disabled,
|
|
206
|
+
modes: modes,
|
|
207
|
+
accessibilityLabel: typeof title === 'string' ? `Select ${title}` : undefined
|
|
208
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
209
|
+
style: textWrapStyle,
|
|
210
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
211
|
+
style: titleStyle,
|
|
212
|
+
numberOfLines: 1,
|
|
213
|
+
selectable: false,
|
|
214
|
+
children: title
|
|
215
|
+
}), subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
216
|
+
style: subtitleStyle,
|
|
217
|
+
numberOfLines: 1,
|
|
218
|
+
selectable: false,
|
|
219
|
+
children: subtitle
|
|
220
|
+
}) : null]
|
|
221
|
+
})]
|
|
222
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
223
|
+
name: isExpanded ? 'ic_chevron_up' : 'ic_chevron_down',
|
|
224
|
+
size: iconSize,
|
|
225
|
+
color: iconColor,
|
|
226
|
+
accessibilityElementsHidden: true,
|
|
227
|
+
importantForAccessibility: "no"
|
|
228
|
+
})]
|
|
229
|
+
}), isExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
230
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
|
|
231
|
+
modes: modes
|
|
232
|
+
}), children ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
233
|
+
style: contentStyle,
|
|
234
|
+
children: (0, _reactUtils.cloneChildrenWithModes)(children, modes)
|
|
235
|
+
}) : null]
|
|
236
|
+
}) : null]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
var _default = exports.default = AccordionCheckbox;
|
|
@@ -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,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;
|