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.
- package/CHANGELOG.md +60 -0
- package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
- package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
- package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -2
- package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +213 -0
- package/lib/commonjs/components/CardFinancialCondition/CardFinancialCondition.js +213 -0
- package/lib/commonjs/components/CardInsight/CardInsight.js +166 -0
- package/lib/commonjs/components/Carousel/Carousel.js +9 -7
- 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/HoldingsCard/HoldingsCard.js +2 -2
- package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +132 -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/Radio/Radio.js +194 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +21 -188
- 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 +192 -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/CardAdvisory/CardAdvisory.js +2 -2
- package/lib/module/components/CardBankAccount/CardBankAccount.js +208 -0
- package/lib/module/components/CardFinancialCondition/CardFinancialCondition.js +207 -0
- package/lib/module/components/CardInsight/CardInsight.js +161 -0
- package/lib/module/components/Carousel/Carousel.js +9 -7
- 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/HoldingsCard/HoldingsCard.js +2 -2
- package/lib/module/components/InstitutionBadge/InstitutionBadge.js +127 -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/Radio/Radio.js +188 -0
- package/lib/module/components/RadioButton/RadioButton.js +20 -185
- 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 +28 -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/CardFinancialCondition/CardFinancialCondition.d.ts +50 -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/InstitutionBadge/InstitutionBadge.d.ts +30 -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/Radio/Radio.d.ts +30 -0
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +20 -28
- 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 +29 -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/CardAdvisory/CardAdvisory.tsx +2 -2
- package/src/components/CardBankAccount/CardBankAccount.tsx +295 -0
- package/src/components/CardFinancialCondition/CardFinancialCondition.tsx +366 -0
- package/src/components/CardInsight/CardInsight.tsx +239 -0
- package/src/components/Carousel/Carousel.tsx +14 -6
- 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/HoldingsCard/HoldingsCard.tsx +2 -2
- package/src/components/InstitutionBadge/InstitutionBadge.tsx +216 -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/Radio/Radio.tsx +227 -0
- package/src/components/RadioButton/RadioButton.tsx +23 -225
- 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 +39 -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,66 @@ 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
|
+
|
|
18
|
+
## [0.0.72] - 2026-05-04
|
|
19
|
+
|
|
20
|
+
High-level summary (one line per point):
|
|
21
|
+
|
|
22
|
+
- **`RadioButton` renamed to `Radio`** — naming aligned with the rest of the library; the old `RadioButton` import is preserved as a deprecated alias so consumer code keeps working without changes.
|
|
23
|
+
- **`Carousel` pagination is now fully token-driven** — dot size, active width, and active/inactive colors come from design tokens (`carousel/pagination/indicator/{size,activeWidth,activeColor,inactiveColor}`) instead of hardcoded values, with token names normalized to camelCase.
|
|
24
|
+
- **`Carousel` outer container height is now controlled by a token** — new `carousel/maxHeight` token enforces the Figma-aligned max height of the carousel viewport.
|
|
25
|
+
- **`HoldingsCard` migrated to `Radio`** — internal-only swap, no API change for consumers.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `Carousel.Pagination` now reads `carousel/pagination/indicator/size`, `carousel/pagination/indicator/activeWidth`, `carousel/pagination/indicator/activeColor`, and `carousel/pagination/indicator/inactiveColor` from design tokens. Previous lowercase names (`activecolor`, `inactivecolor`) and hardcoded dot dimensions (6×6 / 16×6) are replaced.
|
|
30
|
+
- `Carousel` outer container respects a new `carousel/maxHeight` token (defaults to `280`) applied as `maxHeight` on the outer view.
|
|
31
|
+
- `HoldingsCard` now imports the new `Radio` component instead of `RadioButton` (no behavioral change).
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- New `Radio` component (`src/components/Radio/Radio.tsx`) with its own stories and MDX docs. Exported from the package barrel as `Radio` / `RadioProps`.
|
|
36
|
+
|
|
37
|
+
### Deprecated
|
|
38
|
+
|
|
39
|
+
- `RadioButton` is deprecated. It is kept as a thin re-export of `Radio` for backward compatibility and will be removed in a future major release. Migrate to `import { Radio } from 'jfs-components'`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [0.0.71] - 2026-05-04
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **`CardAdvisory`** — new card component with stories and MDX docs.
|
|
48
|
+
- **`CardFinancialCondition`** — new card component with stories and MDX docs.
|
|
49
|
+
- **`CircularProgressBar`** — new circular progress component with stories and MDX docs.
|
|
50
|
+
- **`CircularProgressBarDoted`** — new dotted variant of the circular progress component with stories and MDX docs.
|
|
51
|
+
- **`CircularRating`** — new circular rating display component with stories and MDX docs.
|
|
52
|
+
- **`Gauge`** — new gauge component with stories and MDX docs.
|
|
53
|
+
- **`InstitutionBadge`** — new institution badge component with stories and MDX docs.
|
|
54
|
+
- All new components are exported from the package barrel with their public types.
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- **`Nudge`** — significant rewrite (props, layout, and token usage refreshed); story file simplified.
|
|
59
|
+
- **`CardCTA`** — expanded API and visual variants; story coverage extended.
|
|
60
|
+
- **`MediaCard`** — minor doc/story refresh; no breaking changes.
|
|
61
|
+
- **`ListGroup`** — small adjustments to internal layout; no API change.
|
|
62
|
+
- Refreshed component token metadata and the icon registry; updated `Coin Variables` design-token JSON.
|
|
63
|
+
- Storybook plumbing: added `.storybook/storybook-test-mock.js` and registered it in `.storybook/main.js` to stabilize Storybook test runs.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
7
67
|
## [0.0.70] - 2026-04-23
|
|
8
68
|
|
|
9
69
|
### Fixed
|
|
@@ -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);
|
|
@@ -37,8 +37,8 @@ const toFontWeight = (value, fallback) => {
|
|
|
37
37
|
function resolveCardAdvisoryTokens(modes) {
|
|
38
38
|
const width = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/width', modes), 360);
|
|
39
39
|
const gap = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/gap', modes), 16);
|
|
40
|
-
const paddingHorizontal = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/padding/horizontal', modes),
|
|
41
|
-
const paddingVertical = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/padding/vertical', modes),
|
|
40
|
+
const paddingHorizontal = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/padding/horizontal', modes), 0);
|
|
41
|
+
const paddingVertical = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/padding/vertical', modes), 0);
|
|
42
42
|
const radius = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/radius', modes), 0);
|
|
43
43
|
const background = (0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/background', modes) || '#ffffff';
|
|
44
44
|
const mainContentGap = toNumber((0, _figmaVariablesResolver.getVariableByName)('cardAdvisory/mainContent/gap', modes), 16);
|