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.
Files changed (116) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
  3. package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
  4. package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +213 -0
  5. package/lib/commonjs/components/CardInsight/CardInsight.js +166 -0
  6. package/lib/commonjs/components/CheckboxGroup/CheckboxGroup.js +67 -0
  7. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +125 -0
  8. package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +56 -9
  9. package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +272 -0
  10. package/lib/commonjs/components/CoverageRing/CoverageRing.js +141 -0
  11. package/lib/commonjs/components/DonutChart/DonutChart.js +309 -0
  12. package/lib/commonjs/components/DonutChartSummary/DonutChartSummary.js +155 -0
  13. package/lib/commonjs/components/LinearMeter/LinearMeter.js +9 -28
  14. package/lib/commonjs/components/LinearProgress/LinearProgress.js +68 -0
  15. package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +95 -0
  16. package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +286 -0
  17. package/lib/commonjs/components/OTP/OTP.js +381 -37
  18. package/lib/commonjs/components/ProductOverview/ProductOverview.js +147 -0
  19. package/lib/commonjs/components/RangeTrack/RangeTrack.js +269 -0
  20. package/lib/commonjs/components/SavingsGoalSummary/SavingsGoalSummary.js +181 -0
  21. package/lib/commonjs/components/SegmentedTrack/SegmentedTrack.js +171 -0
  22. package/lib/commonjs/components/StatGroup/StatGroup.js +128 -0
  23. package/lib/commonjs/components/StatItem/StatItem.js +65 -35
  24. package/lib/commonjs/components/StrengthIndicator/StrengthIndicator.js +157 -0
  25. package/lib/commonjs/components/SummaryTile/SummaryTile.js +150 -0
  26. package/lib/commonjs/components/index.js +171 -1
  27. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  28. package/lib/commonjs/icons/registry.js +1 -1
  29. package/lib/commonjs/utils/index.js +7 -0
  30. package/lib/commonjs/utils/number-utils.js +57 -0
  31. package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +233 -0
  32. package/lib/module/components/BrandChip/BrandChip.js +143 -0
  33. package/lib/module/components/CardBankAccount/CardBankAccount.js +208 -0
  34. package/lib/module/components/CardInsight/CardInsight.js +161 -0
  35. package/lib/module/components/CheckboxGroup/CheckboxGroup.js +62 -0
  36. package/lib/module/components/CheckboxItem/CheckboxItem.js +119 -0
  37. package/lib/module/components/CircularProgressBar/CircularProgressBar.js +56 -9
  38. package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +266 -0
  39. package/lib/module/components/CoverageRing/CoverageRing.js +136 -0
  40. package/lib/module/components/DonutChart/DonutChart.js +303 -0
  41. package/lib/module/components/DonutChartSummary/DonutChartSummary.js +150 -0
  42. package/lib/module/components/LinearMeter/LinearMeter.js +9 -28
  43. package/lib/module/components/LinearProgress/LinearProgress.js +63 -0
  44. package/lib/module/components/MetricLegendItem/MetricLegendItem.js +90 -0
  45. package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +281 -0
  46. package/lib/module/components/OTP/OTP.js +381 -38
  47. package/lib/module/components/ProductOverview/ProductOverview.js +142 -0
  48. package/lib/module/components/RangeTrack/RangeTrack.js +263 -0
  49. package/lib/module/components/SavingsGoalSummary/SavingsGoalSummary.js +175 -0
  50. package/lib/module/components/SegmentedTrack/SegmentedTrack.js +166 -0
  51. package/lib/module/components/StatGroup/StatGroup.js +123 -0
  52. package/lib/module/components/StatItem/StatItem.js +66 -36
  53. package/lib/module/components/StrengthIndicator/StrengthIndicator.js +152 -0
  54. package/lib/module/components/SummaryTile/SummaryTile.js +145 -0
  55. package/lib/module/components/index.js +21 -1
  56. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  57. package/lib/module/icons/registry.js +1 -1
  58. package/lib/module/utils/index.js +2 -1
  59. package/lib/module/utils/number-utils.js +53 -0
  60. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +71 -0
  61. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +43 -0
  62. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +79 -0
  63. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +48 -0
  64. package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +41 -0
  65. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +56 -0
  66. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +11 -1
  67. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +105 -0
  68. package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +90 -0
  69. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +117 -0
  70. package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +103 -0
  71. package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +17 -0
  72. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +37 -0
  73. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +119 -0
  74. package/lib/typescript/src/components/OTP/OTP.d.ts +88 -2
  75. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +39 -0
  76. package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +173 -0
  77. package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +95 -0
  78. package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +108 -0
  79. package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +45 -0
  80. package/lib/typescript/src/components/StatItem/StatItem.d.ts +24 -7
  81. package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +58 -0
  82. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +60 -0
  83. package/lib/typescript/src/components/index.d.ts +22 -2
  84. package/lib/typescript/src/icons/registry.d.ts +1 -1
  85. package/lib/typescript/src/utils/index.d.ts +1 -0
  86. package/lib/typescript/src/utils/number-utils.d.ts +29 -0
  87. package/package.json +1 -1
  88. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +323 -0
  89. package/src/components/BrandChip/BrandChip.tsx +235 -0
  90. package/src/components/CardBankAccount/CardBankAccount.tsx +295 -0
  91. package/src/components/CardInsight/CardInsight.tsx +239 -0
  92. package/src/components/CheckboxGroup/CheckboxGroup.tsx +86 -0
  93. package/src/components/CheckboxItem/CheckboxItem.tsx +174 -0
  94. package/src/components/CircularProgressBar/CircularProgressBar.tsx +74 -9
  95. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +378 -0
  96. package/src/components/CoverageRing/CoverageRing.tsx +225 -0
  97. package/src/components/DonutChart/DonutChart.tsx +503 -0
  98. package/src/components/DonutChartSummary/DonutChartSummary.tsx +256 -0
  99. package/src/components/LinearMeter/LinearMeter.tsx +9 -39
  100. package/src/components/LinearProgress/LinearProgress.tsx +92 -0
  101. package/src/components/MetricLegendItem/MetricLegendItem.tsx +167 -0
  102. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +438 -0
  103. package/src/components/OTP/OTP.tsx +476 -29
  104. package/src/components/ProductOverview/ProductOverview.tsx +236 -0
  105. package/src/components/RangeTrack/RangeTrack.tsx +394 -0
  106. package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +269 -0
  107. package/src/components/SegmentedTrack/SegmentedTrack.tsx +268 -0
  108. package/src/components/StatGroup/StatGroup.tsx +169 -0
  109. package/src/components/StatItem/StatItem.tsx +117 -40
  110. package/src/components/StrengthIndicator/StrengthIndicator.tsx +205 -0
  111. package/src/components/SummaryTile/SummaryTile.tsx +251 -0
  112. package/src/components/index.ts +32 -2
  113. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  114. package/src/icons/registry.ts +1 -1
  115. package/src/utils/index.ts +1 -0
  116. package/src/utils/number-utils.ts +60 -0
@@ -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;
@@ -0,0 +1,125 @@
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 _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ 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); }
15
+ /**
16
+ * CheckboxItem composes a `Checkbox`, a label and an optional `endSlot` into a
17
+ * single horizontal pressable row. Pressing anywhere on the row (outside of the
18
+ * `endSlot`) toggles the checkbox, mirroring the typical native form pattern.
19
+ *
20
+ * Mirrors the Figma "Checkbox Item" component and uses the `checkboxItem/*`
21
+ * design tokens for typography and spacing.
22
+ *
23
+ * @component
24
+ * @param {CheckboxItemProps} props
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const [checked, setChecked] = useState(false)
29
+ *
30
+ * <CheckboxItem
31
+ * label="Fixed deposit • 0245"
32
+ * checked={checked}
33
+ * onValueChange={setChecked}
34
+ * modes={{ 'Color Mode': 'Light' }}
35
+ * />
36
+ * ```
37
+ */
38
+ function CheckboxItem({
39
+ checked: controlledChecked,
40
+ defaultChecked = false,
41
+ onValueChange,
42
+ disabled = false,
43
+ label = 'Fixed deposit • 0245',
44
+ endSlot,
45
+ endSlotWidth = 80,
46
+ modes = _reactUtils.EMPTY_MODES,
47
+ style,
48
+ labelStyle,
49
+ accessibilityLabel
50
+ }) {
51
+ const isControlled = controlledChecked !== undefined;
52
+ const [internalChecked, setInternalChecked] = (0, _react.useState)(defaultChecked);
53
+ const isChecked = isControlled ? controlledChecked : internalChecked;
54
+ const handleToggle = (0, _react.useCallback)(() => {
55
+ if (disabled) return;
56
+ const next = !isChecked;
57
+ if (!isControlled) {
58
+ setInternalChecked(next);
59
+ }
60
+ onValueChange?.(next);
61
+ }, [disabled, isChecked, isControlled, onValueChange]);
62
+ const gap = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/gap', modes) ?? 8;
63
+ const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/padding/horizontal', modes) ?? 0;
64
+ const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/padding/vertical', modes) ?? 0;
65
+ const labelColor = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/foreground', modes) ?? '#1a1c1f';
66
+ const labelFontFamily = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/label/fontFamily', modes) ?? 'JioType Var';
67
+ const labelFontSize = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/label/fontSize', modes) ?? 14;
68
+ const labelLineHeight = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/label/lineHeight', modes) ?? 19;
69
+ const labelFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('checkboxItem/label/fontWeight', modes) ?? 400;
70
+ const labelFontWeight = String(labelFontWeightRaw);
71
+ const containerStyle = {
72
+ flexDirection: 'row',
73
+ alignItems: 'center',
74
+ gap,
75
+ paddingHorizontal,
76
+ paddingVertical,
77
+ width: '100%'
78
+ };
79
+ const resolvedLabelStyle = {
80
+ flex: 1,
81
+ minWidth: 0,
82
+ color: labelColor,
83
+ fontFamily: labelFontFamily,
84
+ fontSize: labelFontSize,
85
+ lineHeight: labelLineHeight,
86
+ fontWeight: labelFontWeight
87
+ };
88
+ const a11yLabel = accessibilityLabel ?? (typeof label === 'string' ? label : undefined);
89
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
90
+ style: [containerStyle, style],
91
+ onPress: handleToggle,
92
+ disabled: disabled,
93
+ accessibilityRole: "checkbox",
94
+ accessibilityState: {
95
+ checked: isChecked,
96
+ disabled
97
+ },
98
+ accessibilityLabel: a11yLabel,
99
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
100
+ checked: isChecked,
101
+ disabled: disabled,
102
+ onValueChange: handleToggle,
103
+ modes: modes,
104
+ accessibilityLabel: a11yLabel
105
+ }), label != null && label !== false ? typeof label === 'string' || typeof label === 'number' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
+ style: [resolvedLabelStyle, labelStyle],
107
+ selectable: false,
108
+ children: label
109
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
110
+ style: {
111
+ flex: 1,
112
+ minWidth: 0
113
+ },
114
+ children: label
115
+ }) : null, endSlot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
116
+ style: {
117
+ width: endSlotWidth,
118
+ flexShrink: 0,
119
+ alignItems: 'stretch'
120
+ },
121
+ children: (0, _reactUtils.cloneChildrenWithModes)(endSlot, modes)
122
+ }) : null]
123
+ });
124
+ }
125
+ var _default = exports.default = CheckboxItem;
@@ -43,11 +43,13 @@ function CircularProgressBar({
43
43
  value = 70,
44
44
  state = 'Inactive',
45
45
  valueLabel,
46
+ supportText,
46
47
  modes: propModes = _reactUtils.EMPTY_MODES,
47
48
  style,
48
49
  trackStyle,
49
50
  progressStyle,
50
51
  valueStyle,
52
+ supportTextStyle,
51
53
  accessibilityLabel,
52
54
  ...rest
53
55
  }) {
@@ -58,6 +60,17 @@ function CircularProgressBar({
58
60
  ...globalModes,
59
61
  ...propModes
60
62
  };
63
+ // The Figma `circularProgressBar/track/color` variable aliases to the same
64
+ // chain as `progress/color`, so user-selected Brand modes collapse the
65
+ // track and progress to a single hue. The Figma source of truth always
66
+ // renders the track as a neutral gray, so we force Neutral/Medium when
67
+ // resolving the track color while keeping the user modes for everything
68
+ // else.
69
+ const trackModes = {
70
+ ...modes,
71
+ 'AppearanceBrand': 'Neutral',
72
+ 'Emphasis': 'Medium'
73
+ };
61
74
  const isActive = state === true || state === 'Active';
62
75
  const normalizedValue = clamp(value, 0, 100);
63
76
  const size = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/size', modes), 60);
@@ -65,15 +78,18 @@ function CircularProgressBar({
65
78
  const radius = Math.max(0, (size - strokeWidth) / 2);
66
79
  const center = size / 2;
67
80
  const circumference = 2 * Math.PI * radius;
68
- const trackColor = getStrokeColor(trackStyle, (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/track/color', modes) || '#ebebed');
81
+ const trackColor = getStrokeColor(trackStyle, (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/track/color', trackModes) || '#ebebed');
69
82
  const progressColor = getStrokeColor(progressStyle, (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/progress/color', modes) || '#25ab21');
70
83
  const iconColor = (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/icon/color', modes) || '#666666';
71
84
  const iconSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/icon/size', modes), 24);
72
85
  const foreground = (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/foreground', modes) || '#0d0d0f';
73
- const fontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/fontSize', modes), 18);
86
+ const fontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/value/fontSize', modes), 18);
74
87
  const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/fontFamily', modes) || 'JioType Var';
75
- const lineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/lineHeight', modes), 21);
76
- const fontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/fontWeight', modes), '700');
88
+ const lineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/value/lineHeight', modes), 21);
89
+ const fontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/value/fontWeight', modes), '700');
90
+ const supportFontSize = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/supportText/fontSize', modes), 11);
91
+ const supportLineHeight = toNumber((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/supportText/lineHeight', modes), 13);
92
+ const supportFontWeight = toFontWeight((0, _figmaVariablesResolver.getVariableByName)('circularProgressBar/supportText/fontWeight', modes), '500');
77
93
  const computedContainerStyle = {
78
94
  alignItems: 'center',
79
95
  height: size,
@@ -81,13 +97,34 @@ function CircularProgressBar({
81
97
  position: 'relative',
82
98
  width: size
83
99
  };
100
+
101
+ // The text stack (support text + value) is centered inside the ring using
102
+ // an absolutely-positioned column. Keeping the wrapper absolute (rather
103
+ // than the individual texts, as in earlier versions) lets multi-line stacks
104
+ // render correctly without sub-pixel misalignment.
105
+ const textStackStyle = {
106
+ alignItems: 'center',
107
+ justifyContent: 'center',
108
+ left: 0,
109
+ position: 'absolute',
110
+ right: 0,
111
+ top: 0,
112
+ bottom: 0
113
+ };
84
114
  const computedValueStyle = {
85
115
  color: foreground,
86
116
  fontFamily,
87
117
  fontSize,
88
118
  fontWeight,
89
119
  lineHeight,
90
- position: 'absolute',
120
+ textAlign: 'center'
121
+ };
122
+ const computedSupportTextStyle = {
123
+ color: foreground,
124
+ fontFamily,
125
+ fontSize: supportFontSize,
126
+ fontWeight: supportFontWeight,
127
+ lineHeight: supportLineHeight,
91
128
  textAlign: 'center'
92
129
  };
93
130
  const iconStyle = {
@@ -96,7 +133,8 @@ function CircularProgressBar({
96
133
  top: (size - iconSize) / 2
97
134
  };
98
135
  const displayValue = valueLabel ?? String(Math.round(normalizedValue));
99
- const defaultAccessibilityLabel = accessibilityLabel ?? (isActive ? `${displayValue} out of 100` : 'Inactive progress');
136
+ const hasSupportText = typeof supportText === 'string' && supportText.length > 0;
137
+ const defaultAccessibilityLabel = accessibilityLabel ?? (isActive ? hasSupportText ? `${supportText}, ${displayValue} out of 100` : `${displayValue} out of 100` : 'Inactive progress');
100
138
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
101
139
  accessibilityRole: "progressbar",
102
140
  accessibilityLabel: defaultAccessibilityLabel,
@@ -132,9 +170,18 @@ function CircularProgressBar({
132
170
  originX: center,
133
171
  originY: center
134
172
  }) : null]
135
- }), isActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
136
- style: [computedValueStyle, valueStyle],
137
- children: displayValue
173
+ }), isActive ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
174
+ style: textStackStyle,
175
+ pointerEvents: "none",
176
+ children: [hasSupportText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
177
+ style: [computedSupportTextStyle, supportTextStyle],
178
+ numberOfLines: 1,
179
+ children: supportText
180
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
181
+ style: [computedValueStyle, valueStyle],
182
+ numberOfLines: 1,
183
+ children: displayValue
184
+ })]
138
185
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconMinus.IconMinus, {
139
186
  width: iconSize,
140
187
  height: iconSize,