jfs-components 0.1.0 → 0.1.8

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 (392) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
  3. package/lib/commonjs/components/AreaLineChart/AreaLineChart.js +1 -1
  4. package/lib/commonjs/components/Balance/Balance.js +17 -12
  5. package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
  6. package/lib/commonjs/components/Card/Card.js +2 -1
  7. package/lib/commonjs/components/CardFeedback/CardFeedback.js +2 -1
  8. package/lib/commonjs/components/CcCard/CcCard.js +470 -0
  9. package/lib/commonjs/components/Checkbox/Checkbox.js +6 -4
  10. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
  11. package/lib/commonjs/components/CompareTable/CompareTable.js +372 -0
  12. package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
  13. package/lib/commonjs/components/Drawer/Drawer.js +13 -4
  14. package/lib/commonjs/components/DropdownInput/DropdownInput.js +36 -4
  15. package/lib/commonjs/components/FormField/FormField.js +4 -3
  16. package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +62 -2
  17. package/lib/commonjs/components/Image/Image.js +11 -5
  18. package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
  19. package/lib/commonjs/components/LottiePlayer/loadNativeLottieView.js +8 -13
  20. package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
  21. package/lib/commonjs/components/Overlay/Overlay.js +92 -0
  22. package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
  23. package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +2 -1
  24. package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.js +263 -0
  25. package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.web.js +116 -0
  26. package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +353 -0
  27. package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +161 -0
  28. package/lib/commonjs/components/Radio/Radio.js +5 -5
  29. package/lib/commonjs/components/Slider/Slider.js +473 -0
  30. package/lib/commonjs/components/TextInput/TextInput.js +15 -9
  31. package/lib/commonjs/components/TextSegment/TextSegment.js +118 -0
  32. package/lib/commonjs/components/docs/modeControls.js +116 -0
  33. package/lib/commonjs/components/index.js +70 -0
  34. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  35. package/lib/commonjs/design-tokens/JFSThemeProvider.js +1 -1
  36. package/lib/commonjs/design-tokens/figma-modes.generated.js +420 -0
  37. package/lib/commonjs/design-tokens/index.js +11 -0
  38. package/lib/commonjs/icons/registry.js +1 -1
  39. package/lib/commonjs/utils/react-utils.js +22 -0
  40. package/lib/module/components/Accordion/Accordion.js +1 -2
  41. package/lib/module/components/AmountInput/AmountInput.js +6 -4
  42. package/lib/module/components/AreaLineChart/AreaLineChart.js +1 -1
  43. package/lib/module/components/Balance/Balance.js +18 -13
  44. package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
  45. package/lib/module/components/Card/Card.js +1 -2
  46. package/lib/module/components/CardFeedback/CardFeedback.js +1 -2
  47. package/lib/module/components/CcCard/CcCard.js +464 -0
  48. package/lib/module/components/Checkbox/Checkbox.js +6 -6
  49. package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
  50. package/lib/module/components/CompareTable/CompareTable.js +367 -0
  51. package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
  52. package/lib/module/components/Drawer/Drawer.js +12 -4
  53. package/lib/module/components/DropdownInput/DropdownInput.js +37 -5
  54. package/lib/module/components/FormField/FormField.js +5 -4
  55. package/lib/module/components/FullscreenModal/FullscreenModal.js +64 -5
  56. package/lib/module/components/Image/Image.js +11 -5
  57. package/lib/module/components/InputSearch/InputSearch.js +6 -4
  58. package/lib/module/components/InstitutionBadge/InstitutionBadge.js +1 -2
  59. package/lib/module/components/LottiePlayer/loadNativeLottieView.js +8 -13
  60. package/lib/module/components/MoneyValue/MoneyValue.js +1 -2
  61. package/lib/module/components/NoteInput/NoteInput.js +7 -6
  62. package/lib/module/components/OTP/OTP.js +1 -2
  63. package/lib/module/components/Overlay/Overlay.js +87 -0
  64. package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
  65. package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +1 -2
  66. package/lib/module/components/PoweredByLabel/PoweredByLabel.js +1 -2
  67. package/lib/module/components/ProductMerchandisingCard/GlassFill.js +257 -0
  68. package/lib/module/components/ProductMerchandisingCard/GlassFill.web.js +111 -0
  69. package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +347 -0
  70. package/lib/module/components/ProjectionMarker/ProjectionMarker.js +156 -0
  71. package/lib/module/components/Radio/Radio.js +5 -4
  72. package/lib/module/components/RechargeCard/RechargeCard.js +1 -2
  73. package/lib/module/components/Section/Section.js +1 -2
  74. package/lib/module/components/Slider/Slider.js +468 -0
  75. package/lib/module/components/TextInput/TextInput.js +16 -12
  76. package/lib/module/components/TextSegment/TextSegment.js +113 -0
  77. package/lib/module/components/UpiHandle/UpiHandle.js +1 -2
  78. package/lib/module/components/docs/modeControls.js +111 -0
  79. package/lib/module/components/index.js +10 -0
  80. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  81. package/lib/module/design-tokens/JFSThemeProvider.js +1 -1
  82. package/lib/module/design-tokens/figma-modes.generated.js +416 -0
  83. package/lib/module/design-tokens/index.js +2 -1
  84. package/lib/module/icons/registry.js +1 -1
  85. package/lib/module/utils/react-utils.js +21 -1
  86. package/lib/typescript/src/components/Accordion/Accordion.d.ts +2 -1
  87. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +2 -1
  88. package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +2 -1
  89. package/lib/typescript/src/components/ActionFooter/ActionFooter.d.ts +2 -1
  90. package/lib/typescript/src/components/ActionTile/ActionTile.d.ts +2 -1
  91. package/lib/typescript/src/components/AllocationComparisonChart/AllocationComparisonChart.d.ts +2 -1
  92. package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +5 -3
  93. package/lib/typescript/src/components/AppBar/AppBar.d.ts +2 -1
  94. package/lib/typescript/src/components/AreaLineChart/AreaLineChart.d.ts +3 -2
  95. package/lib/typescript/src/components/Attached/Attached.d.ts +2 -1
  96. package/lib/typescript/src/components/Avatar/Avatar.d.ts +2 -1
  97. package/lib/typescript/src/components/AvatarGroup/AvatarGroup.d.ts +2 -1
  98. package/lib/typescript/src/components/Badge/Badge.d.ts +2 -1
  99. package/lib/typescript/src/components/Balance/Balance.d.ts +2 -1
  100. package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
  101. package/lib/typescript/src/components/BottomNav/BottomNav.d.ts +2 -1
  102. package/lib/typescript/src/components/BottomNavItem/BottomNavItem.d.ts +2 -1
  103. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +2 -1
  104. package/lib/typescript/src/components/BubbleChart/BubbleChart.d.ts +2 -1
  105. package/lib/typescript/src/components/Button/Button.d.ts +2 -1
  106. package/lib/typescript/src/components/ButtonGroup/ButtonGroup.d.ts +2 -1
  107. package/lib/typescript/src/components/Card/Card.d.ts +3 -2
  108. package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +2 -1
  109. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +2 -1
  110. package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +2 -1
  111. package/lib/typescript/src/components/CardFeedback/CardFeedback.d.ts +7 -6
  112. package/lib/typescript/src/components/CardFinancialCondition/CardFinancialCondition.d.ts +2 -1
  113. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +2 -1
  114. package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +2 -1
  115. package/lib/typescript/src/components/Carousel/Carousel.d.ts +4 -3
  116. package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
  117. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +5 -3
  118. package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +2 -1
  119. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +4 -3
  120. package/lib/typescript/src/components/ChipGroup/ChipGroup.d.ts +2 -1
  121. package/lib/typescript/src/components/ChipSelect/ChipSelect.d.ts +2 -1
  122. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +2 -1
  123. package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +2 -1
  124. package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +2 -1
  125. package/lib/typescript/src/components/ClusterBubble/ClusterBubble.d.ts +2 -1
  126. package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +88 -0
  127. package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
  128. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +3 -2
  129. package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +2 -1
  130. package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +2 -1
  131. package/lib/typescript/src/components/Disclaimer/Disclaimer.d.ts +2 -1
  132. package/lib/typescript/src/components/Divider/Divider.d.ts +2 -1
  133. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +4 -3
  134. package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +3 -2
  135. package/lib/typescript/src/components/Drawer/Drawer.d.ts +15 -1
  136. package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +3 -2
  137. package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +22 -2
  138. package/lib/typescript/src/components/EmptyState/EmptyState.d.ts +2 -1
  139. package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +2 -1
  140. package/lib/typescript/src/components/FilterBar/FilterBar.d.ts +3 -2
  141. package/lib/typescript/src/components/Form/Form.d.ts +2 -1
  142. package/lib/typescript/src/components/FormField/FormField.d.ts +4 -3
  143. package/lib/typescript/src/components/FullscreenModal/FullscreenModal.d.ts +2 -1
  144. package/lib/typescript/src/components/Gauge/Gauge.d.ts +2 -1
  145. package/lib/typescript/src/components/HStack/HStack.d.ts +2 -1
  146. package/lib/typescript/src/components/HoldingsCard/HoldingsCard.d.ts +2 -1
  147. package/lib/typescript/src/components/Icon/Icon.d.ts +2 -1
  148. package/lib/typescript/src/components/IconButton/IconButton.d.ts +2 -1
  149. package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +2 -1
  150. package/lib/typescript/src/components/Image/Image.d.ts +17 -1
  151. package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +25 -3
  152. package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +2 -1
  153. package/lib/typescript/src/components/LazyList/LazyList.d.ts +2 -1
  154. package/lib/typescript/src/components/LinearMeter/LinearMeter.d.ts +3 -2
  155. package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +2 -1
  156. package/lib/typescript/src/components/ListGroup/ListGroup.d.ts +2 -1
  157. package/lib/typescript/src/components/ListItem/ListItem.d.ts +2 -1
  158. package/lib/typescript/src/components/LottieIntroBlock/LottieIntroBlock.d.ts +2 -1
  159. package/lib/typescript/src/components/LottiePlayer/LottiePlayer.d.ts +2 -1
  160. package/lib/typescript/src/components/LottiePlayer/LottiePlayer.web.d.ts +2 -1
  161. package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +6 -5
  162. package/lib/typescript/src/components/MerchantProfile/MerchantProfile.d.ts +2 -1
  163. package/lib/typescript/src/components/MessageField/MessageField.d.ts +2 -1
  164. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +2 -1
  165. package/lib/typescript/src/components/MoneyValue/MoneyValue.d.ts +2 -1
  166. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +4 -3
  167. package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +2 -1
  168. package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +21 -3
  169. package/lib/typescript/src/components/Nudge/Nudge.d.ts +2 -1
  170. package/lib/typescript/src/components/Numpad/Numpad.d.ts +2 -1
  171. package/lib/typescript/src/components/OTP/OTP.d.ts +3 -2
  172. package/lib/typescript/src/components/Overlay/Overlay.d.ts +52 -0
  173. package/lib/typescript/src/components/PageHero/PageHero.d.ts +2 -1
  174. package/lib/typescript/src/components/PaymentFeedback/PaymentFeedback.d.ts +2 -1
  175. package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
  176. package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +2 -1
  177. package/lib/typescript/src/components/Popup/Popup.d.ts +2 -1
  178. package/lib/typescript/src/components/PortfolioHero/PortfolioHero.d.ts +2 -1
  179. package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +2 -1
  180. package/lib/typescript/src/components/ProductLabel/ProductLabel.d.ts +2 -1
  181. package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.d.ts +56 -0
  182. package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.web.d.ts +27 -0
  183. package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +81 -0
  184. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +2 -1
  185. package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +2 -1
  186. package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +82 -0
  187. package/lib/typescript/src/components/Radio/Radio.d.ts +5 -3
  188. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
  189. package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +3 -2
  190. package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +2 -1
  191. package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +2 -1
  192. package/lib/typescript/src/components/Screen/Screen.d.ts +2 -1
  193. package/lib/typescript/src/components/Section/Section.d.ts +3 -2
  194. package/lib/typescript/src/components/SegmentedControl/SegmentedControl.d.ts +2 -1
  195. package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +4 -3
  196. package/lib/typescript/src/components/Slider/Slider.d.ts +99 -0
  197. package/lib/typescript/src/components/Slot/Slot.d.ts +2 -1
  198. package/lib/typescript/src/components/Spinner/Spinner.d.ts +2 -1
  199. package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +2 -1
  200. package/lib/typescript/src/components/StatItem/StatItem.d.ts +2 -1
  201. package/lib/typescript/src/components/StatusHero/StatusHero.d.ts +2 -1
  202. package/lib/typescript/src/components/Stepper/Step.d.ts +2 -1
  203. package/lib/typescript/src/components/Stepper/StepLabel.d.ts +2 -1
  204. package/lib/typescript/src/components/Stepper/Stepper.d.ts +2 -1
  205. package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +2 -1
  206. package/lib/typescript/src/components/SuggestiveSearch/SuggestiveSearch.d.ts +2 -1
  207. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +2 -1
  208. package/lib/typescript/src/components/SupportText/SupportText.d.ts +2 -1
  209. package/lib/typescript/src/components/SupportText/SupportTextIcon.d.ts +2 -1
  210. package/lib/typescript/src/components/SwappableAmount/SwappableAmount.d.ts +2 -1
  211. package/lib/typescript/src/components/Tabs/TabItem.d.ts +2 -1
  212. package/lib/typescript/src/components/Tabs/Tabs.d.ts +2 -1
  213. package/lib/typescript/src/components/TestimonialsCard/TestimonialsCard.d.ts +2 -1
  214. package/lib/typescript/src/components/Text/Text.d.ts +2 -1
  215. package/lib/typescript/src/components/TextInput/TextInput.d.ts +12 -31
  216. package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +100 -0
  217. package/lib/typescript/src/components/ThreadHero/ThreadHero.d.ts +2 -1
  218. package/lib/typescript/src/components/Title/Title.d.ts +2 -1
  219. package/lib/typescript/src/components/Toast/Toast.d.ts +2 -1
  220. package/lib/typescript/src/components/Toast/ToastProvider.d.ts +2 -1
  221. package/lib/typescript/src/components/Toast/useToast.d.ts +3 -2
  222. package/lib/typescript/src/components/Toggle/Toggle.d.ts +2 -1
  223. package/lib/typescript/src/components/Tooltip/Tooltip.d.ts +2 -1
  224. package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +2 -1
  225. package/lib/typescript/src/components/TransactionDetails/TransactionDetails.d.ts +3 -2
  226. package/lib/typescript/src/components/TransactionStatus/TransactionStatus.d.ts +2 -1
  227. package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +2 -1
  228. package/lib/typescript/src/components/VStack/VStack.d.ts +2 -1
  229. package/lib/typescript/src/components/docs/modeControls.d.ts +28 -0
  230. package/lib/typescript/src/components/index.d.ts +11 -1
  231. package/lib/typescript/src/design-tokens/JFSThemeProvider.d.ts +4 -3
  232. package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +284 -0
  233. package/lib/typescript/src/design-tokens/index.d.ts +1 -0
  234. package/lib/typescript/src/icons/registry.d.ts +1 -1
  235. package/lib/typescript/src/skeleton/Skeleton.d.ts +2 -1
  236. package/lib/typescript/src/utils/react-utils.d.ts +12 -1
  237. package/package.json +4 -2
  238. package/src/components/Accordion/Accordion.tsx +2 -1
  239. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +2 -1
  240. package/src/components/AccountCard/AccountCard.tsx +2 -1
  241. package/src/components/ActionFooter/ActionFooter.tsx +2 -1
  242. package/src/components/ActionTile/ActionTile.tsx +2 -1
  243. package/src/components/AllocationComparisonChart/AllocationComparisonChart.tsx +2 -1
  244. package/src/components/AmountInput/AmountInput.tsx +9 -6
  245. package/src/components/AppBar/AppBar.tsx +2 -1
  246. package/src/components/AreaLineChart/AreaLineChart.tsx +8 -7
  247. package/src/components/Attached/Attached.tsx +2 -1
  248. package/src/components/Avatar/Avatar.tsx +3 -2
  249. package/src/components/AvatarGroup/AvatarGroup.tsx +2 -1
  250. package/src/components/Badge/Badge.tsx +2 -1
  251. package/src/components/Balance/Balance.tsx +18 -12
  252. package/src/components/BenefitCard/BenefitCard.tsx +309 -0
  253. package/src/components/BottomNav/BottomNav.tsx +2 -1
  254. package/src/components/BottomNavItem/BottomNavItem.tsx +3 -2
  255. package/src/components/BrandChip/BrandChip.tsx +3 -2
  256. package/src/components/BubbleChart/BubbleChart.tsx +2 -1
  257. package/src/components/Button/Button.tsx +3 -2
  258. package/src/components/ButtonGroup/ButtonGroup.tsx +2 -1
  259. package/src/components/Card/Card.tsx +4 -3
  260. package/src/components/CardAdvisory/CardAdvisory.tsx +3 -2
  261. package/src/components/CardBankAccount/CardBankAccount.tsx +2 -1
  262. package/src/components/CardCTA/CardCTA.tsx +3 -2
  263. package/src/components/CardFeedback/CardFeedback.tsx +11 -10
  264. package/src/components/CardFinancialCondition/CardFinancialCondition.tsx +3 -2
  265. package/src/components/CardInsight/CardInsight.tsx +2 -1
  266. package/src/components/CardProviderInfo/CardProviderInfo.tsx +2 -1
  267. package/src/components/Carousel/Carousel.tsx +5 -4
  268. package/src/components/CcCard/CcCard.tsx +598 -0
  269. package/src/components/Checkbox/Checkbox.tsx +7 -5
  270. package/src/components/CheckboxGroup/CheckboxGroup.tsx +2 -1
  271. package/src/components/CheckboxItem/CheckboxItem.tsx +7 -5
  272. package/src/components/ChipGroup/ChipGroup.tsx +2 -1
  273. package/src/components/ChipSelect/ChipSelect.tsx +2 -1
  274. package/src/components/CircularProgressBar/CircularProgressBar.tsx +2 -1
  275. package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +2 -1
  276. package/src/components/CircularRating/CircularRating.tsx +3 -2
  277. package/src/components/ClusterBubble/ClusterBubble.tsx +2 -1
  278. package/src/components/CompareTable/CompareTable.tsx +477 -0
  279. package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
  280. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +3 -2
  281. package/src/components/CoverageRing/CoverageRing.tsx +2 -1
  282. package/src/components/DebitCard/DebitCard.tsx +2 -1
  283. package/src/components/Disclaimer/Disclaimer.tsx +2 -1
  284. package/src/components/Divider/Divider.tsx +2 -1
  285. package/src/components/DonutChart/DonutChart.tsx +6 -5
  286. package/src/components/DonutChartSummary/DonutChartSummary.tsx +3 -2
  287. package/src/components/Drawer/Drawer.tsx +21 -1
  288. package/src/components/Dropdown/Dropdown.tsx +4 -3
  289. package/src/components/DropdownInput/DropdownInput.tsx +60 -7
  290. package/src/components/EmptyState/EmptyState.tsx +2 -1
  291. package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +2 -1
  292. package/src/components/FilterBar/FilterBar.tsx +3 -2
  293. package/src/components/Form/Form.tsx +2 -1
  294. package/src/components/FormField/FormField.tsx +8 -6
  295. package/src/components/FullscreenModal/FullscreenModal.tsx +68 -10
  296. package/src/components/Gauge/Gauge.tsx +2 -1
  297. package/src/components/HStack/HStack.tsx +2 -1
  298. package/src/components/HoldingsCard/HoldingsCard.tsx +2 -1
  299. package/src/components/Icon/Icon.tsx +3 -2
  300. package/src/components/IconButton/IconButton.tsx +3 -2
  301. package/src/components/IconCapsule/IconCapsule.tsx +3 -2
  302. package/src/components/Image/Image.tsx +29 -5
  303. package/src/components/InputSearch/InputSearch.tsx +11 -7
  304. package/src/components/InstitutionBadge/InstitutionBadge.tsx +3 -2
  305. package/src/components/LazyList/LazyList.tsx +2 -1
  306. package/src/components/LinearMeter/LinearMeter.tsx +3 -2
  307. package/src/components/LinearProgress/LinearProgress.tsx +2 -1
  308. package/src/components/ListGroup/ListGroup.tsx +2 -1
  309. package/src/components/ListItem/ListItem.tsx +3 -2
  310. package/src/components/LottieIntroBlock/LottieIntroBlock.tsx +2 -1
  311. package/src/components/LottiePlayer/LottiePlayer.tsx +3 -2
  312. package/src/components/LottiePlayer/LottiePlayer.web.tsx +3 -2
  313. package/src/components/LottiePlayer/loadNativeLottieView.tsx +9 -13
  314. package/src/components/MediaCard/MediaCard.tsx +7 -6
  315. package/src/components/MerchantProfile/MerchantProfile.tsx +2 -1
  316. package/src/components/MessageField/MessageField.tsx +3 -2
  317. package/src/components/MetricLegendItem/MetricLegendItem.tsx +2 -1
  318. package/src/components/MoneyValue/MoneyValue.tsx +2 -1
  319. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +5 -4
  320. package/src/components/NavArrow/NavArrow.tsx +3 -2
  321. package/src/components/NoteInput/NoteInput.tsx +10 -7
  322. package/src/components/Nudge/Nudge.tsx +3 -2
  323. package/src/components/Numpad/Numpad.tsx +2 -1
  324. package/src/components/OTP/OTP.tsx +3 -2
  325. package/src/components/Overlay/Overlay.tsx +114 -0
  326. package/src/components/PageHero/PageHero.tsx +2 -1
  327. package/src/components/PaymentFeedback/PaymentFeedback.tsx +2 -1
  328. package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
  329. package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +2 -1
  330. package/src/components/Popup/Popup.tsx +2 -1
  331. package/src/components/PortfolioHero/PortfolioHero.tsx +2 -1
  332. package/src/components/PoweredByLabel/PoweredByLabel.tsx +2 -1
  333. package/src/components/ProductLabel/ProductLabel.tsx +2 -1
  334. package/src/components/ProductMerchandisingCard/GlassFill.tsx +276 -0
  335. package/src/components/ProductMerchandisingCard/GlassFill.web.tsx +127 -0
  336. package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +423 -0
  337. package/src/components/ProductOverview/ProductOverview.tsx +2 -1
  338. package/src/components/ProgressBadge/ProgressBadge.tsx +2 -1
  339. package/src/components/ProjectionMarker/ProjectionMarker.tsx +277 -0
  340. package/src/components/Radio/Radio.tsx +7 -5
  341. package/src/components/RangeTrack/RangeTrack.tsx +3 -2
  342. package/src/components/RechargeCard/RechargeCard.tsx +2 -1
  343. package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +2 -1
  344. package/src/components/Screen/Screen.tsx +2 -1
  345. package/src/components/Section/Section.tsx +6 -5
  346. package/src/components/SegmentedControl/SegmentedControl.tsx +3 -2
  347. package/src/components/SegmentedTrack/SegmentedTrack.tsx +5 -4
  348. package/src/components/Slider/Slider.tsx +628 -0
  349. package/src/components/Slot/Slot.tsx +2 -1
  350. package/src/components/Spinner/Spinner.tsx +2 -1
  351. package/src/components/StatGroup/StatGroup.tsx +3 -2
  352. package/src/components/StatItem/StatItem.tsx +2 -1
  353. package/src/components/StatusHero/StatusHero.tsx +2 -1
  354. package/src/components/Stepper/Step.tsx +2 -1
  355. package/src/components/Stepper/StepLabel.tsx +2 -1
  356. package/src/components/Stepper/Stepper.tsx +2 -1
  357. package/src/components/StrengthIndicator/StrengthIndicator.tsx +2 -1
  358. package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +4 -3
  359. package/src/components/SummaryTile/SummaryTile.tsx +2 -1
  360. package/src/components/SupportText/SupportText.tsx +2 -1
  361. package/src/components/SupportText/SupportTextIcon.tsx +2 -1
  362. package/src/components/SwappableAmount/SwappableAmount.tsx +2 -1
  363. package/src/components/Tabs/TabItem.tsx +2 -1
  364. package/src/components/Tabs/Tabs.tsx +2 -1
  365. package/src/components/TestimonialsCard/TestimonialsCard.tsx +2 -1
  366. package/src/components/Text/Text.tsx +2 -1
  367. package/src/components/TextInput/TextInput.tsx +18 -13
  368. package/src/components/TextSegment/TextSegment.tsx +166 -0
  369. package/src/components/ThreadHero/ThreadHero.tsx +2 -1
  370. package/src/components/Title/Title.tsx +2 -1
  371. package/src/components/Toast/Toast.tsx +2 -1
  372. package/src/components/Toast/ToastProvider.tsx +2 -1
  373. package/src/components/Toast/useToast.ts +3 -2
  374. package/src/components/Toggle/Toggle.tsx +2 -1
  375. package/src/components/Tooltip/Tooltip.tsx +3 -2
  376. package/src/components/TransactionBubble/TransactionBubble.tsx +2 -1
  377. package/src/components/TransactionDetails/TransactionDetails.tsx +3 -2
  378. package/src/components/TransactionStatus/TransactionStatus.tsx +3 -2
  379. package/src/components/UpiHandle/UpiHandle.tsx +3 -2
  380. package/src/components/VStack/VStack.tsx +2 -1
  381. package/src/components/docs/modeControls.tsx +122 -0
  382. package/src/components/index.ts +11 -1
  383. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  384. package/src/design-tokens/JFSThemeProvider.tsx +4 -3
  385. package/src/design-tokens/figma-modes.generated.ts +425 -0
  386. package/src/design-tokens/index.ts +1 -0
  387. package/src/icons/registry.ts +1 -1
  388. package/src/skeleton/Skeleton.tsx +2 -1
  389. package/src/utils/react-utils.ts +26 -2
  390. package/lib/typescript/scripts/extract-component-tokens.d.ts +0 -9
  391. package/lib/typescript/scripts/generate-component-docs.d.ts +0 -9
  392. package/lib/typescript/scripts/generate-icon-registry.d.ts +0 -3
@@ -0,0 +1,598 @@
1
+ import React, { useMemo } from 'react'
2
+ import {
3
+ View,
4
+ Text,
5
+ Pressable,
6
+ StyleSheet,
7
+ type ViewStyle,
8
+ type TextStyle,
9
+ type StyleProp,
10
+ type ImageSourcePropType,
11
+ } from 'react-native'
12
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
13
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
14
+ import Badge from '../Badge/Badge'
15
+ import Avatar from '../Avatar/Avatar'
16
+ import Image from '../Image/Image'
17
+ import Icon from '../Icon/Icon'
18
+ import Title from '../Title/Title'
19
+ import ListItem from '../ListItem/ListItem'
20
+ import TextSegment, { type TextSegmentRun } from '../TextSegment/TextSegment'
21
+ import Button from '../Button/Button'
22
+ import type { Modes } from '../../design-tokens'
23
+
24
+ /**
25
+ * A single coloured chip rendered in the card header. Each badge resolves its
26
+ * own design tokens through `modes`, so different appearances (brand, tonal,
27
+ * etc.) can sit side-by-side in the same group.
28
+ */
29
+ export interface CcCardBadge {
30
+ /** Visible label text. */
31
+ label: string
32
+ /** Per-badge mode overrides (e.g. `{ AppearanceBrand: 'Tertiary' }`). */
33
+ modes?: Modes
34
+ /** Background color override (wins over the token-resolved value). */
35
+ color?: string
36
+ /** Label color override (wins over the token-resolved value). */
37
+ labelColor?: string
38
+ }
39
+
40
+ /**
41
+ * A single benefit row in the card's list, rendered through the shared
42
+ * {@link ListItem} primitive (leading icon + title).
43
+ */
44
+ export interface CcCardListItem {
45
+ /**
46
+ * Registry icon name for the leading glyph. Defaults to `'ic_card'`. Pass
47
+ * `null` to omit the leading icon.
48
+ */
49
+ icon?: string | null
50
+ /** Per-row override for the leading icon color. */
51
+ iconColor?: string
52
+ /** Full override for the leading node. Takes precedence over `icon`. */
53
+ leading?: React.ReactNode
54
+ /** Row title (e.g. `"4 domestic + 2 intl. lounge access yearly"`). */
55
+ title: string
56
+ /** Makes the row pressable. */
57
+ onPress?: () => void
58
+ }
59
+
60
+ export interface CcCardProps {
61
+ /**
62
+ * Compact variant. Renders only the leading media slot (an `Avatar` by
63
+ * default) followed by the footer **without** its CTA button — a condensed
64
+ * representation of the card. Mirrors the Figma `compact` property.
65
+ */
66
+ compact?: boolean
67
+
68
+ // ---- Header (non-compact only) ----------------------------------------
69
+ /** Toggles the header badge row. Defaults to `true`. */
70
+ showHeader?: boolean
71
+ /** Leading (left) badge group. */
72
+ badges?: CcCardBadge[]
73
+ /** Trailing (right-aligned) badge group. */
74
+ trailingBadges?: CcCardBadge[]
75
+ /** Full override for the header. Takes precedence over `badges`/`trailingBadges`. */
76
+ header?: React.ReactNode
77
+
78
+ // ---- Media slot -------------------------------------------------------
79
+ /**
80
+ * Image source for the default media slot. Accepts a URL string or any RN
81
+ * `ImageSourcePropType`. Ignored when `media` is provided.
82
+ */
83
+ imageSource?: ImageSourcePropType | string
84
+ /** Default media image width. Defaults to the Figma spec (`88`). */
85
+ imageWidth?: number
86
+ /** Default media image height. Defaults to the Figma spec (`54`). */
87
+ imageHeight?: number
88
+ /** Product title rendered next to the media slot (non-compact only). */
89
+ title?: string
90
+ /** Product subtitle rendered below the title (non-compact only). */
91
+ subtitle?: string
92
+ /**
93
+ * Full override for the media slot's visual. Whatever you pass here is
94
+ * rendered **in both the compact and non-compact variants** — e.g. pass an
95
+ * `Avatar` and it stays an avatar in both, pass an `Image` and it stays an
96
+ * image in both. `modes` cascade into it automatically. Defaults to an
97
+ * `Image` driven by `imageSource`.
98
+ */
99
+ media?: React.ReactNode
100
+
101
+ // ---- List (non-compact only) ------------------------------------------
102
+ /** Benefit rows rendered in the list. Defaults to three sample rows. */
103
+ items?: CcCardListItem[]
104
+
105
+ // ---- Nudge (non-compact only) -----------------------------------------
106
+ /** Toggles the upsell nudge row. Defaults to `true`. */
107
+ showNudge?: boolean
108
+ /**
109
+ * Declarative content for the nudge's inline text. Defaults to a sample
110
+ * "Upsell message JioFinance+" string with the last run brand-coloured.
111
+ */
112
+ nudgeSegments?: TextSegmentRun[]
113
+ /** Avatar image source shown at the start of the nudge row. */
114
+ nudgeAvatarSource?: ImageSourcePropType | string
115
+ /** Full override for the nudge row. Takes precedence over the declarative props. */
116
+ nudge?: React.ReactNode
117
+
118
+ // ---- Footer -----------------------------------------------------------
119
+ /** Small muted label above the footer title (`ccCard/headline/*`). */
120
+ headline?: string
121
+ /** Bold footer value (`ccCard/title/*`). */
122
+ description?: string
123
+ /** Muted caption rendered inline after the description (`ccCard/subtitle/*`). */
124
+ footerSubtitle?: string
125
+ /** Full override for the footer text block. */
126
+ footer?: React.ReactNode
127
+
128
+ // ---- Footer CTA (non-compact only) ------------------------------------
129
+ /** CTA button label. Defaults to `"Button"`. */
130
+ buttonLabel?: string
131
+ /** CTA press handler. */
132
+ onButtonPress?: () => void
133
+ /** Full override for the CTA. Takes precedence over `buttonLabel`. */
134
+ button?: React.ReactNode
135
+ /** Toggles the CTA button (non-compact). Defaults to `true`. */
136
+ showButton?: boolean
137
+
138
+ // ---- Card -------------------------------------------------------------
139
+ /** Press handler for the whole card. When set, the card becomes pressable. */
140
+ onPress?: () => void
141
+ /** Card width. Defaults to the Figma spec (`343`). Pass `'100%'` to fill the parent. */
142
+ width?: number | `${number}%`
143
+ /** Modes object for design-token resolution. Cascaded to all children. */
144
+ modes?: Modes
145
+ /** Style overrides for the card container. */
146
+ style?: StyleProp<ViewStyle>
147
+ /** Accessibility label for the card. */
148
+ accessibilityLabel?: string
149
+ }
150
+
151
+ /**
152
+ * CcCard — Figma node 5434:1992 ("Cc Card").
153
+ *
154
+ * A white, rounded credit-card product card composed entirely from the shared
155
+ * design-system primitives so it stays in sync with the rest of the library:
156
+ *
157
+ * - **Header** — two {@link Badge} groups (a leading group + a right-aligned
158
+ * trailing group), e.g. `Pre-qualified` / `Lifetime free`.
159
+ * - **Media** — a product `Image` + a {@link Title} (title + subtitle resolved
160
+ * through the `context7: Card` mode → 14px/12px).
161
+ * - **List** — a column of benefit {@link ListItem}s (`List Item Style:
162
+ * Minimal`) with leading icons.
163
+ * - **Nudge** — an inline upsell row: an {@link Avatar} + a {@link TextSegment}.
164
+ * - **Footer** — a headline + description + subtitle text block alongside a
165
+ * small {@link Button} (`Button / Size: S`, `AppearanceBrand: Secondary`).
166
+ *
167
+ * The {@link CcCardProps.compact} variant collapses the card to just the
168
+ * leading avatar slot + the footer text block (no CTA button). All defaults can
169
+ * be overridden via `modes`.
170
+ */
171
+ function CcCard({
172
+ compact = false,
173
+ showHeader = true,
174
+ badges = DEFAULT_BADGES,
175
+ trailingBadges,
176
+ header,
177
+ imageSource,
178
+ imageWidth = 88,
179
+ imageHeight = 54,
180
+ title = 'Title',
181
+ subtitle = 'Subtitle',
182
+ media,
183
+ items = DEFAULT_ITEMS,
184
+ showNudge = true,
185
+ nudgeSegments = DEFAULT_NUDGE_SEGMENTS,
186
+ nudgeAvatarSource,
187
+ nudge,
188
+ headline = 'Headline',
189
+ description = 'Description',
190
+ footerSubtitle = 'Subtitle',
191
+ footer,
192
+ buttonLabel = 'Button',
193
+ onButtonPress,
194
+ button,
195
+ showButton = true,
196
+ onPress,
197
+ width = 343,
198
+ modes = EMPTY_MODES,
199
+ style,
200
+ accessibilityLabel,
201
+ }: CcCardProps) {
202
+ const tokens = useMemo(() => resolveTokens(modes), [modes])
203
+
204
+ // The product title uses the card-sized type ramp (14px bold + 12px
205
+ // subtitle) via the `context7: Card` mode. Consumer modes still win.
206
+ const titleModes = useMemo<Modes>(() => ({ context7: 'Card', ...modes }), [modes])
207
+ // List rows use the minimal style (12px / regular, no padding).
208
+ const listItemModes = useMemo<Modes>(() => ({ 'List Item Style': 'Minimal', ...modes }), [modes])
209
+ // The nudge avatar is the smallest size token.
210
+ const nudgeAvatarModes = useMemo<Modes>(() => ({ 'Avatar Size': 'XS', ...modes }), [modes])
211
+ // The CTA is the small, brand-secondary (lilac→purple) button.
212
+ const ctaModes = useMemo<Modes>(
213
+ () => ({ AppearanceBrand: 'Secondary', 'Button / Size': 'S', ...modes }),
214
+ [modes]
215
+ )
216
+
217
+ // ---- Header -----------------------------------------------------------
218
+ const headerNode = header
219
+ ? cloneChildrenWithModes(header, modes)
220
+ : showHeader && (badges?.length || trailingBadges?.length) ? (
221
+ <View style={styles.header}>
222
+ <BadgeGroup badges={badges} modes={modes} />
223
+ {trailingBadges?.length ? (
224
+ <BadgeGroup badges={trailingBadges} modes={modes} />
225
+ ) : null}
226
+ </View>
227
+ ) : null
228
+
229
+ // ---- Media slot (shared by both compact + non-compact) ----------------
230
+ // Whatever lives in the slot is rendered identically in both variants; only
231
+ // the surrounding sections differ. The default is an Image driven by
232
+ // `imageSource`, but a consumer can pass an Avatar (or any node) via `media`.
233
+ const mediaSlotContent = media ? (
234
+ cloneChildrenWithModes(media, modes)
235
+ ) : (
236
+ <Image
237
+ imageSource={imageSource}
238
+ width={imageWidth}
239
+ height={imageHeight}
240
+ borderRadius={tokens.imageRadius}
241
+ resizeMode="cover"
242
+ accessibilityElementsHidden
243
+ importantForAccessibility="no"
244
+ />
245
+ )
246
+
247
+ // Non-compact lays the slot out in a row next to the product Title.
248
+ const mediaRow = (
249
+ <View style={styles.mediaSlot}>
250
+ {mediaSlotContent}
251
+ <View style={styles.titleWrap}>
252
+ <Title
253
+ title={title}
254
+ subtitle={subtitle}
255
+ textAlign="Left"
256
+ modes={titleModes}
257
+ style={styles.titleInner}
258
+ />
259
+ </View>
260
+ </View>
261
+ )
262
+
263
+ // ---- List -------------------------------------------------------------
264
+ const listNode =
265
+ items.length > 0 ? (
266
+ <View style={tokens.listGroup}>
267
+ {items.map((item, index) => {
268
+ const leading =
269
+ item.leading ??
270
+ (item.icon !== null ? (
271
+ <Icon iconName={item.icon ?? 'ic_card'} color={item.iconColor} modes={listItemModes} />
272
+ ) : null)
273
+ return (
274
+ <ListItem
275
+ key={index}
276
+ layout="Horizontal"
277
+ navArrow={false}
278
+ showSupportText={false}
279
+ title={item.title}
280
+ leading={leading}
281
+ onPress={item.onPress}
282
+ modes={listItemModes}
283
+ />
284
+ )
285
+ })}
286
+ </View>
287
+ ) : null
288
+
289
+ // ---- Nudge ------------------------------------------------------------
290
+ const nudgeNode = nudge
291
+ ? cloneChildrenWithModes(nudge, modes)
292
+ : showNudge ? (
293
+ <View style={tokens.nudge}>
294
+ <Avatar imageSource={nudgeAvatarSource} modes={nudgeAvatarModes} />
295
+ <View style={styles.nudgeContent}>
296
+ <TextSegment segments={nudgeSegments} modes={modes} />
297
+ </View>
298
+ </View>
299
+ ) : null
300
+
301
+ // ---- Footer -----------------------------------------------------------
302
+ const ctaNode = button ? (
303
+ cloneChildrenWithModes(button, ctaModes)
304
+ ) : (
305
+ <Button label={buttonLabel} modes={ctaModes} onPress={onButtonPress} />
306
+ )
307
+
308
+ const footerTextBlock = footer ? (
309
+ cloneChildrenWithModes(footer, modes)
310
+ ) : (
311
+ <View style={tokens.footerTextWrap}>
312
+ {headline != null ? <Text style={tokens.headline}>{headline}</Text> : null}
313
+ <View style={compact ? tokens.titleWrapCompact : tokens.titleWrapDefault}>
314
+ {description != null ? <Text style={tokens.footerTitle}>{description}</Text> : null}
315
+ {footerSubtitle != null ? <Text style={tokens.footerSubtitle}>{footerSubtitle}</Text> : null}
316
+ </View>
317
+ </View>
318
+ )
319
+
320
+ const footerNode = (
321
+ <View style={compact ? tokens.footerRowCompact : tokens.footerRowDefault}>
322
+ {footerTextBlock}
323
+ {!compact && showButton ? ctaNode : null}
324
+ </View>
325
+ )
326
+
327
+ // ---- Compose ----------------------------------------------------------
328
+ const content = compact ? (
329
+ <>
330
+ <View style={styles.compactSlot}>{mediaSlotContent}</View>
331
+ {footerNode}
332
+ </>
333
+ ) : (
334
+ <>
335
+ {headerNode}
336
+ {mediaRow}
337
+ {listNode}
338
+ {nudgeNode}
339
+ {footerNode}
340
+ </>
341
+ )
342
+
343
+ const containerStyle = useMemo<ViewStyle>(
344
+ () => ({ ...tokens.container, width }),
345
+ [tokens.container, width]
346
+ )
347
+
348
+ if (onPress) {
349
+ return (
350
+ <Pressable
351
+ style={({ pressed }) => [containerStyle, pressed ? styles.pressed : null, style]}
352
+ accessibilityRole="button"
353
+ accessibilityLabel={accessibilityLabel ?? title}
354
+ onPress={onPress}
355
+ >
356
+ {content}
357
+ </Pressable>
358
+ )
359
+ }
360
+
361
+ return (
362
+ <View style={[containerStyle, style]} accessibilityLabel={accessibilityLabel}>
363
+ {content}
364
+ </View>
365
+ )
366
+ }
367
+
368
+ // ---------------------------------------------------------------------------
369
+ // BadgeGroup — internal wrapping row of badges
370
+ // ---------------------------------------------------------------------------
371
+
372
+ function BadgeGroup({ badges, modes }: { badges: CcCardBadge[]; modes: Modes }) {
373
+ return (
374
+ <View style={styles.badgeGroup}>
375
+ {badges.map((badge, index) => {
376
+ const badgeModes = badge.modes ? { ...modes, ...badge.modes } : modes
377
+ return (
378
+ <Badge
379
+ key={index}
380
+ label={badge.label}
381
+ modes={badgeModes}
382
+ style={badge.color ? { backgroundColor: badge.color } : undefined}
383
+ labelStyle={badge.labelColor ? { color: badge.labelColor } : undefined}
384
+ />
385
+ )
386
+ })}
387
+ </View>
388
+ )
389
+ }
390
+
391
+ // ---------------------------------------------------------------------------
392
+ // Tokens / static styles
393
+ // ---------------------------------------------------------------------------
394
+
395
+ interface ResolvedTokens {
396
+ container: ViewStyle
397
+ imageRadius: number
398
+ listGroup: ViewStyle
399
+ nudge: ViewStyle
400
+ footerRowDefault: ViewStyle
401
+ footerRowCompact: ViewStyle
402
+ footerTextWrap: ViewStyle
403
+ titleWrapDefault: ViewStyle
404
+ titleWrapCompact: ViewStyle
405
+ headline: TextStyle
406
+ footerTitle: TextStyle
407
+ footerSubtitle: TextStyle
408
+ }
409
+
410
+ function asNum(raw: unknown, fallback: number): number {
411
+ const n = typeof raw === 'number' ? raw : parseFloat(raw as string)
412
+ return Number.isFinite(n) ? n : fallback
413
+ }
414
+
415
+ function asStr(raw: unknown, fallback: string): string {
416
+ return raw != null ? String(raw) : fallback
417
+ }
418
+
419
+ function resolveTokens(modes: Modes): ResolvedTokens {
420
+ // NOTE: token names are passed as string literals DIRECTLY to
421
+ // getVariableByName so the `extract-component-tokens` script can statically
422
+ // collect them for the generated docs. Do not refactor these into a helper
423
+ // that receives the name as a variable.
424
+ const background = asStr(getVariableByName('ccCard/bg', modes), '#ffffff')
425
+ const borderColor = asStr(getVariableByName('ccCard/border/color', modes), '#e3e4e4')
426
+ const borderWidth = asNum(getVariableByName('ccCard/border/size', modes), 1)
427
+ const radius = asNum(getVariableByName('ccCard/radius', modes), 12)
428
+ const paddingHorizontal = asNum(getVariableByName('ccCard/padding/horizontal', modes), 12)
429
+ const paddingVertical = asNum(getVariableByName('ccCard/padding/vertical', modes), 12)
430
+ const gap = asNum(getVariableByName('ccCard/padding/gap', modes), 8)
431
+
432
+ const imageRadius = asNum(getVariableByName('image/radius', modes), 0)
433
+ const listGroupGap = asNum(getVariableByName('listGroup/gap', modes), 4)
434
+ const nudgeGap = asNum(getVariableByName('nudge/gap', modes), 6)
435
+
436
+ const footerGap = asNum(getVariableByName('ccCard/footer/gap', modes), 8)
437
+ const textWrapGap = asNum(getVariableByName('ccCard/footer/textWrap/gap', modes), 4)
438
+ const titleWrapGap = asNum(getVariableByName('ccCard/footer/titleWrap/gap', modes), 8)
439
+
440
+ const headlineColor = asStr(getVariableByName('ccCard/headline/color', modes), '#707275')
441
+ const headlineSize = asNum(getVariableByName('ccCard/headline/fontSize', modes), 10)
442
+ const headlineFamily = asStr(getVariableByName('ccCard/headline/fontFamily', modes), 'JioType Var')
443
+ const headlineLineHeight = asNum(getVariableByName('ccCard/headline/lineHeight', modes), 13)
444
+ const headlineWeight = asStr(getVariableByName('ccCard/headline/fontWeight', modes), '500')
445
+
446
+ const titleColor = asStr(getVariableByName('ccCard/title/color', modes), '#081007')
447
+ const titleSize = asNum(getVariableByName('ccCard/title/fontSize', modes), 14)
448
+ const titleFamily = asStr(getVariableByName('ccCard/title/fontFamily', modes), 'JioType Var')
449
+ const titleLineHeight = asNum(getVariableByName('ccCard/title/lineHeight', modes), 15)
450
+ const titleWeight = asStr(getVariableByName('ccCard/title/fontWeight', modes), '700')
451
+
452
+ const subtitleColor = asStr(getVariableByName('ccCard/subtitle/color', modes), '#707275')
453
+ const subtitleSize = asNum(getVariableByName('ccCard/subtitle/fontSize', modes), 10)
454
+ const subtitleFamily = asStr(getVariableByName('ccCard/subtitle/fontFamily', modes), 'JioType Var')
455
+ const subtitleLineHeight = asNum(getVariableByName('ccCard/subtitle/lineHeight', modes), 13)
456
+ const subtitleWeight = asStr(getVariableByName('ccCard/subtitle/fontWeight', modes), '500')
457
+
458
+ return {
459
+ container: {
460
+ backgroundColor: background,
461
+ borderColor,
462
+ borderWidth,
463
+ borderRadius: radius,
464
+ paddingHorizontal,
465
+ paddingVertical,
466
+ gap,
467
+ flexDirection: 'column',
468
+ alignItems: 'flex-start',
469
+ overflow: 'hidden',
470
+ },
471
+ imageRadius,
472
+ listGroup: {
473
+ alignSelf: 'stretch',
474
+ gap: listGroupGap,
475
+ },
476
+ nudge: {
477
+ alignSelf: 'stretch',
478
+ flexDirection: 'row',
479
+ alignItems: 'center',
480
+ gap: nudgeGap,
481
+ },
482
+ footerRowDefault: {
483
+ alignSelf: 'stretch',
484
+ flexDirection: 'row',
485
+ alignItems: 'flex-end',
486
+ gap: footerGap,
487
+ },
488
+ footerRowCompact: {
489
+ alignSelf: 'stretch',
490
+ flexDirection: 'row',
491
+ alignItems: 'center',
492
+ },
493
+ footerTextWrap: {
494
+ flex: 1,
495
+ minWidth: 1,
496
+ alignItems: 'flex-start',
497
+ gap: textWrapGap,
498
+ },
499
+ titleWrapDefault: {
500
+ flexDirection: 'row',
501
+ alignItems: 'flex-end',
502
+ gap: textWrapGap,
503
+ },
504
+ titleWrapCompact: {
505
+ flexDirection: 'row',
506
+ alignItems: 'flex-end',
507
+ gap: titleWrapGap,
508
+ },
509
+ headline: {
510
+ color: headlineColor,
511
+ fontSize: headlineSize,
512
+ fontFamily: headlineFamily,
513
+ fontWeight: headlineWeight as TextStyle['fontWeight'],
514
+ lineHeight: Math.max(headlineLineHeight, Math.ceil(headlineSize * 1.2)),
515
+ includeFontPadding: false as any,
516
+ },
517
+ footerTitle: {
518
+ color: titleColor,
519
+ fontSize: titleSize,
520
+ fontFamily: titleFamily,
521
+ fontWeight: titleWeight as TextStyle['fontWeight'],
522
+ lineHeight: Math.max(titleLineHeight, Math.ceil(titleSize * 1.2)),
523
+ includeFontPadding: false as any,
524
+ },
525
+ footerSubtitle: {
526
+ color: subtitleColor,
527
+ fontSize: subtitleSize,
528
+ fontFamily: subtitleFamily,
529
+ fontWeight: subtitleWeight as TextStyle['fontWeight'],
530
+ lineHeight: Math.max(subtitleLineHeight, Math.ceil(subtitleSize * 1.2)),
531
+ includeFontPadding: false as any,
532
+ },
533
+ }
534
+ }
535
+
536
+ const DEFAULT_BADGES: CcCardBadge[] = [
537
+ { label: 'Pre-qualified', modes: { AppearanceBrand: 'Tertiary' }, labelColor: '#ffffff' },
538
+ { label: 'Lifetime free', modes: { AppearanceBrand: 'Tertiary' }, labelColor: '#ffffff' },
539
+ ]
540
+
541
+ const DEFAULT_ITEMS: CcCardListItem[] = [
542
+ { icon: 'ic_card', title: '4 domestic + 2 intl. lounge access yearly' },
543
+ { icon: 'ic_card', title: '5% cashback on dining & travel' },
544
+ { icon: 'ic_card', title: 'No annual fee for the first year' },
545
+ ]
546
+
547
+ const DEFAULT_NUDGE_SEGMENTS: TextSegmentRun[] = [
548
+ { text: 'Upsell message ' },
549
+ { text: 'JioFinance+', modes: { 'Text Appearance': 'Primary' } },
550
+ ]
551
+
552
+ const styles = StyleSheet.create({
553
+ header: {
554
+ alignSelf: 'stretch',
555
+ flexDirection: 'row',
556
+ alignItems: 'flex-start',
557
+ justifyContent: 'space-between',
558
+ gap: 8,
559
+ },
560
+ badgeGroup: {
561
+ flexDirection: 'row',
562
+ flexWrap: 'wrap',
563
+ alignItems: 'center',
564
+ gap: 4,
565
+ flexShrink: 1,
566
+ },
567
+ mediaSlot: {
568
+ alignSelf: 'stretch',
569
+ flexDirection: 'row',
570
+ alignItems: 'center',
571
+ gap: 8,
572
+ },
573
+ titleWrap: {
574
+ flex: 1,
575
+ minWidth: 1,
576
+ },
577
+ // The shared Title falls back to 16/8 padding when its tokens resolve to 0
578
+ // (0 is falsy). Zero it out so the only horizontal gap to the media slot is
579
+ // the mediaSlot's hard-coded 8px.
580
+ titleInner: {
581
+ paddingHorizontal: 0,
582
+ paddingVertical: 0,
583
+ },
584
+ // Compact media wrapper hugs its child so the slot sizes to the avatar /
585
+ // image's intrinsic dimensions instead of stretching to the card width.
586
+ compactSlot: {
587
+ alignSelf: 'flex-start',
588
+ },
589
+ nudgeContent: {
590
+ flex: 1,
591
+ minWidth: 1,
592
+ },
593
+ pressed: {
594
+ opacity: 0.92,
595
+ },
596
+ })
597
+
598
+ export default CcCard
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react'
1
+ import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react'
2
2
  import {
3
3
  Pressable,
4
4
  Platform,
@@ -9,6 +9,7 @@ import {
9
9
  import Svg, { Path } from 'react-native-svg'
10
10
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
11
11
  import { EMPTY_MODES } from '../../utils/react-utils'
12
+ import type { Modes } from '../../design-tokens'
12
13
 
13
14
  /**
14
15
  * Tracks whether the last user interaction was a keyboard event (Tab).
@@ -80,7 +81,7 @@ export interface CheckboxProps {
80
81
  /** Whether the checkbox is disabled */
81
82
  disabled?: boolean
82
83
  /** Design token modes for theming */
83
- modes?: Record<string, any>
84
+ modes?: Modes
84
85
  /** Override container styles */
85
86
  style?: StyleProp<ViewStyle>
86
87
  /** Accessibility label for screen readers */
@@ -97,7 +98,7 @@ export interface CheckboxProps {
97
98
  * @component
98
99
  * @param {CheckboxProps} props
99
100
  */
100
- function Checkbox({
101
+ const Checkbox = forwardRef<View, CheckboxProps>(function Checkbox({
101
102
  checked: controlledChecked,
102
103
  defaultChecked = false,
103
104
  onValueChange,
@@ -105,7 +106,7 @@ function Checkbox({
105
106
  modes = EMPTY_MODES,
106
107
  style,
107
108
  accessibilityLabel,
108
- }: CheckboxProps) {
109
+ }: CheckboxProps, ref: React.Ref<View>) {
109
110
  const isControlled = controlledChecked !== undefined
110
111
  const [internalChecked, setInternalChecked] = useState(defaultChecked)
111
112
  const isChecked = isControlled ? controlledChecked : internalChecked
@@ -229,6 +230,7 @@ function Checkbox({
229
230
 
230
231
  return (
231
232
  <Pressable
233
+ ref={ref}
232
234
  style={[touchTargetStyle, style]}
233
235
  hitSlop={hitSlop}
234
236
  onPress={handlePress}
@@ -252,7 +254,7 @@ function Checkbox({
252
254
  </View>
253
255
  </Pressable>
254
256
  )
255
- }
257
+ })
256
258
 
257
259
  function boxShadow(value: string): ViewStyle {
258
260
  if (Platform.OS === 'web') {
@@ -3,6 +3,7 @@ import { View, type StyleProp, type ViewStyle } from 'react-native'
3
3
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
4
  import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
5
5
  import CheckboxItem from '../CheckboxItem/CheckboxItem'
6
+ import type { Modes } from '../../design-tokens'
6
7
 
7
8
  export type CheckboxGroupProps = {
8
9
  /**
@@ -14,7 +15,7 @@ export type CheckboxGroupProps = {
14
15
  */
15
16
  children?: React.ReactNode
16
17
  /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
17
- modes?: Record<string, any>
18
+ modes?: Modes
18
19
  /** Override container styles. */
19
20
  style?: StyleProp<ViewStyle>
20
21
  /** Accessibility label for the surrounding group. */