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,628 @@
1
+ import React, {
2
+ forwardRef,
3
+ useCallback,
4
+ useImperativeHandle,
5
+ useMemo,
6
+ useRef,
7
+ useState,
8
+ } from 'react'
9
+ import {
10
+ View,
11
+ Text,
12
+ PanResponder,
13
+ Platform,
14
+ type LayoutChangeEvent,
15
+ type GestureResponderEvent,
16
+ type StyleProp,
17
+ type ViewStyle,
18
+ type TextStyle,
19
+ } from 'react-native'
20
+ import Svg, { Path } from 'react-native-svg'
21
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
22
+ import { EMPTY_MODES } from '../../utils/react-utils'
23
+ import type { Modes } from '../../design-tokens'
24
+
25
+ /**
26
+ * Imperative handle exposed via `ref`. The primary way to read a slider's value
27
+ * is still the controlled `value` + `onChange` pair (each `<Slider />` reports
28
+ * its own value, so multiple sliders are disambiguated by their own handlers).
29
+ * The ref is a convenience for reading the latest value on demand (e.g. on a
30
+ * button press) or imperatively nudging an uncontrolled slider.
31
+ *
32
+ * @example
33
+ * const slider = useRef<SliderHandle>(null)
34
+ * slider.current?.setValue(50)
35
+ * const v = slider.current?.getValue()
36
+ */
37
+ export interface SliderHandle {
38
+ /** Returns the slider's current (clamped, step-snapped) value. */
39
+ getValue: () => number
40
+ /** Sets the value. Fires `onChange` + `onChangeEnd`. */
41
+ setValue: (value: number) => void
42
+ /** Steps the value up by one `step` (or `by`, snapped to `step`). */
43
+ increment: (by?: number) => void
44
+ /** Steps the value down by one `step` (or `by`, snapped to `step`). */
45
+ decrement: (by?: number) => void
46
+ }
47
+
48
+ export interface SliderProps {
49
+ /** Current value (controlled). Pair with `onChange`. */
50
+ value?: number
51
+ /** Initial value (uncontrolled). Defaults to `minValue`. */
52
+ defaultValue?: number
53
+ /** Called continuously while the value changes (drag / keypress / track press). */
54
+ onChange?: (value: number) => void
55
+ /** Called once when the interaction ends (drag release / keypress). */
56
+ onChangeEnd?: (value: number) => void
57
+ /** Minimum selectable value. Defaults to `0`. */
58
+ minValue?: number
59
+ /** Maximum selectable value. Defaults to `100`. */
60
+ maxValue?: number
61
+ /** Snap increment. Defaults to `1`. Use a smaller value for finer control. */
62
+ step?: number
63
+ /** Disables interaction and dims the control. */
64
+ isDisabled?: boolean
65
+ /**
66
+ * `Intl.NumberFormat` options used to format the value bubble and the
67
+ * min/max labels (e.g. `{ style: 'currency', currency: 'USD' }`).
68
+ */
69
+ formatOptions?: Intl.NumberFormatOptions
70
+ /** BCP-47 locale used with `formatOptions`. Defaults to the runtime locale. */
71
+ locale?: string
72
+ /**
73
+ * Full override for value formatting. Takes precedence over `formatOptions`.
74
+ * Receives the raw numeric value, returns the string to display.
75
+ */
76
+ formatValue?: (value: number) => string
77
+ /** Renders fully custom value-bubble content. Takes precedence over `formatValue`. */
78
+ renderTooltip?: (value: number) => React.ReactNode
79
+ /**
80
+ * When `true` (default, matches the Figma design) the value bubble is
81
+ * always visible. When `false` it behaves like a normal tooltip — hidden at
82
+ * rest and revealed only while the user interacts (dragging on touch, or
83
+ * hovering/dragging on web), then dismissed as soon as the finger lifts.
84
+ *
85
+ * Either way the bubble floats above the track and never occupies layout
86
+ * space, so it will overlap content above the slider — leave room for it.
87
+ */
88
+ alwaysShowTooltip?: boolean
89
+ /** Toggles the min/max labels below the track. Defaults to `true`. */
90
+ showLabels?: boolean
91
+ /** Override for the left (min) label. Defaults to the formatted `minValue`. */
92
+ minLabel?: React.ReactNode
93
+ /** Override for the right (max) label. Defaults to the formatted `maxValue`. */
94
+ maxLabel?: React.ReactNode
95
+ /** Slider width. Defaults to `'100%'` so it fills its parent. */
96
+ width?: number | `${number}%`
97
+ /** Design-token modes for theming. */
98
+ modes?: Modes
99
+ /** Style override for the outer container. */
100
+ style?: StyleProp<ViewStyle>
101
+ /** Accessibility label for screen readers. */
102
+ accessibilityLabel?: string
103
+ }
104
+
105
+ const clamp = (n: number, min: number, max: number) => Math.min(Math.max(n, min), max)
106
+
107
+ const asNum = (raw: unknown, fallback: number): number => {
108
+ const n = typeof raw === 'number' ? raw : parseFloat(raw as string)
109
+ return Number.isFinite(n) ? n : fallback
110
+ }
111
+
112
+ const asStr = (raw: unknown, fallback: string): string => (raw != null ? String(raw) : fallback)
113
+
114
+ // The unfilled track is rendered at a lighter emphasis in the design.
115
+ const TRACK_EMPHASIS: Modes = { Emphasis: 'Low' }
116
+
117
+ /**
118
+ * Slider — Figma node 5373:446 ("Slider").
119
+ *
120
+ * A horizontal, single-thumb slider driven entirely by design tokens. It maps a
121
+ * numeric range (`minValue`–`maxValue`) onto a track with a filled indicator, a
122
+ * draggable handle, a value bubble pinned above the handle, and optional min/max
123
+ * labels beneath the track. Built on `PanResponder` so the one code path works
124
+ * on iOS, Android and the web.
125
+ *
126
+ * The design only labels the range bounds, but a slider's purpose is to bind a
127
+ * value — so the live value is surfaced through the bubble (formatted via
128
+ * `formatOptions` / `formatValue`) and reported through `onChange` /
129
+ * `onChangeEnd`. Supports controlled and uncontrolled usage, web keyboard
130
+ * control, and an imperative {@link SliderHandle} `ref` for on-demand reads.
131
+ */
132
+ const Slider = forwardRef<SliderHandle, SliderProps>(function Slider(
133
+ {
134
+ value: controlledValue,
135
+ defaultValue,
136
+ onChange,
137
+ onChangeEnd,
138
+ minValue = 0,
139
+ maxValue = 100,
140
+ step = 1,
141
+ isDisabled = false,
142
+ formatOptions,
143
+ locale,
144
+ formatValue,
145
+ renderTooltip,
146
+ alwaysShowTooltip = true,
147
+ showLabels = true,
148
+ minLabel,
149
+ maxLabel,
150
+ width = '100%',
151
+ modes = EMPTY_MODES,
152
+ style,
153
+ accessibilityLabel,
154
+ },
155
+ ref
156
+ ) {
157
+ const tokens = useMemo(() => resolveTokens(modes), [modes])
158
+
159
+ const isControlled = controlledValue !== undefined
160
+ const [internalValue, setInternalValue] = useState(() =>
161
+ clamp(defaultValue ?? minValue, minValue, maxValue)
162
+ )
163
+ const rawValue = isControlled ? (controlledValue as number) : internalValue
164
+ const currentValue = clamp(rawValue, minValue, maxValue)
165
+
166
+ const [trackWidth, setTrackWidth] = useState(0)
167
+ const [tooltipWidth, setTooltipWidth] = useState(0)
168
+ const [isDragging, setIsDragging] = useState(false)
169
+ const [isHovered, setIsHovered] = useState(false)
170
+
171
+ const quantize = useCallback(
172
+ (v: number) => {
173
+ if (!step || step <= 0) return clamp(v, minValue, maxValue)
174
+ const stepped = Math.round((v - minValue) / step) * step + minValue
175
+ // Round away float dust introduced by the division (e.g. 0.30000000000004).
176
+ const decimals = (String(step).split('.')[1] || '').length
177
+ const fixed = decimals > 0 ? Number(stepped.toFixed(decimals)) : stepped
178
+ return clamp(fixed, minValue, maxValue)
179
+ },
180
+ [minValue, maxValue, step]
181
+ )
182
+
183
+ // Keep the latest interactive config in a ref so the PanResponder (created
184
+ // once) always reads fresh values without being recreated mid-gesture.
185
+ const interaction = useRef({
186
+ trackWidth,
187
+ minValue,
188
+ maxValue,
189
+ isDisabled,
190
+ isControlled,
191
+ quantize,
192
+ onChange,
193
+ onChangeEnd,
194
+ })
195
+ interaction.current = {
196
+ trackWidth,
197
+ minValue,
198
+ maxValue,
199
+ isDisabled,
200
+ isControlled,
201
+ quantize,
202
+ onChange,
203
+ onChangeEnd,
204
+ }
205
+
206
+ const lastValueRef = useRef(currentValue)
207
+ lastValueRef.current = currentValue
208
+
209
+ const commit = useCallback((next: number, isFinal: boolean) => {
210
+ const { isControlled: ctrl, onChange: change, onChangeEnd: changeEnd } = interaction.current
211
+ const changed = next !== lastValueRef.current
212
+ lastValueRef.current = next
213
+ if (changed) {
214
+ if (!ctrl) setInternalValue(next)
215
+ change?.(next)
216
+ }
217
+ if (isFinal) changeEnd?.(next)
218
+ }, [])
219
+
220
+ const valueFromX = useCallback((x: number): number => {
221
+ const { trackWidth: w, minValue: min, maxValue: max, quantize: q } = interaction.current
222
+ if (w <= 0) return lastValueRef.current
223
+ const ratio = clamp(x / w, 0, 1)
224
+ return q(min + ratio * (max - min))
225
+ }, [])
226
+
227
+ const panResponder = useRef(
228
+ PanResponder.create({
229
+ onStartShouldSetPanResponder: () => !interaction.current.isDisabled,
230
+ onMoveShouldSetPanResponder: () => !interaction.current.isDisabled,
231
+ onPanResponderGrant: (e: GestureResponderEvent) => {
232
+ if (interaction.current.isDisabled) return
233
+ setIsDragging(true)
234
+ commit(valueFromX(e.nativeEvent.locationX), false)
235
+ },
236
+ onPanResponderMove: (e: GestureResponderEvent) => {
237
+ if (interaction.current.isDisabled) return
238
+ commit(valueFromX(e.nativeEvent.locationX), false)
239
+ },
240
+ onPanResponderRelease: (e: GestureResponderEvent) => {
241
+ setIsDragging(false)
242
+ if (interaction.current.isDisabled) return
243
+ commit(valueFromX(e.nativeEvent.locationX), true)
244
+ },
245
+ onPanResponderTerminate: () => {
246
+ setIsDragging(false)
247
+ if (interaction.current.isDisabled) return
248
+ commit(lastValueRef.current, true)
249
+ },
250
+ })
251
+ ).current
252
+
253
+ // Keyboard support (web). Arrow/Page keys nudge, Home/End jump to bounds.
254
+ const handleKeyDown = useCallback(
255
+ (e: any) => {
256
+ if (isDisabled) return
257
+ const big = Math.max(step, (maxValue - minValue) / 10)
258
+ let next: number | null = null
259
+ switch (e.key) {
260
+ case 'ArrowRight':
261
+ case 'ArrowUp':
262
+ next = quantize(currentValue + step)
263
+ break
264
+ case 'ArrowLeft':
265
+ case 'ArrowDown':
266
+ next = quantize(currentValue - step)
267
+ break
268
+ case 'PageUp':
269
+ next = quantize(currentValue + big)
270
+ break
271
+ case 'PageDown':
272
+ next = quantize(currentValue - big)
273
+ break
274
+ case 'Home':
275
+ next = minValue
276
+ break
277
+ case 'End':
278
+ next = maxValue
279
+ break
280
+ default:
281
+ return
282
+ }
283
+ e.preventDefault?.()
284
+ commit(next, true)
285
+ },
286
+ [isDisabled, step, minValue, maxValue, currentValue, quantize, commit]
287
+ )
288
+
289
+ const handleAccessibilityAction = useCallback(
290
+ (event: { nativeEvent: { actionName: string } }) => {
291
+ if (isDisabled) return
292
+ const name = event.nativeEvent.actionName
293
+ if (name === 'increment') commit(quantize(currentValue + step), true)
294
+ else if (name === 'decrement') commit(quantize(currentValue - step), true)
295
+ },
296
+ [isDisabled, step, currentValue, quantize, commit]
297
+ )
298
+
299
+ useImperativeHandle(
300
+ ref,
301
+ (): SliderHandle => ({
302
+ getValue: () => lastValueRef.current,
303
+ setValue: (v: number) => commit(quantize(v), true),
304
+ increment: (by?: number) => commit(quantize(lastValueRef.current + (by ?? step)), true),
305
+ decrement: (by?: number) => commit(quantize(lastValueRef.current - (by ?? step)), true),
306
+ }),
307
+ [quantize, commit, step]
308
+ )
309
+
310
+ const defaultFormat = useCallback(
311
+ (v: number) => {
312
+ try {
313
+ return new Intl.NumberFormat(locale, formatOptions).format(v)
314
+ } catch {
315
+ return String(v)
316
+ }
317
+ },
318
+ [locale, formatOptions]
319
+ )
320
+ const format = formatValue ?? defaultFormat
321
+
322
+ const ratio = maxValue > minValue ? (currentValue - minValue) / (maxValue - minValue) : 0
323
+ const percent = clamp(ratio, 0, 1) * 100
324
+
325
+ const handleSize = tokens.handleSize
326
+ // The bubble floats (absolutely positioned, no reserved layout space). When
327
+ // `alwaysShowTooltip` is false it only appears while interacting: dragging on
328
+ // any platform, or hovering on web. Lifting the finger clears `isDragging`,
329
+ // so the bubble disappears immediately on touch release.
330
+ const showTooltip = alwaysShowTooltip || isDragging || isHovered
331
+
332
+ const onTrackLayout = useCallback((e: LayoutChangeEvent) => {
333
+ setTrackWidth(e.nativeEvent.layout.width)
334
+ }, [])
335
+
336
+ const onTooltipLayout = useCallback((e: LayoutChangeEvent) => {
337
+ setTooltipWidth(e.nativeEvent.layout.width)
338
+ }, [])
339
+
340
+ const valueText = format(currentValue)
341
+
342
+ const tooltipNode = showTooltip ? (
343
+ <View
344
+ onLayout={onTooltipLayout}
345
+ style={[
346
+ styles.tooltip,
347
+ {
348
+ backgroundColor: tokens.tooltipBackground,
349
+ paddingHorizontal: tokens.tooltipPaddingH,
350
+ paddingVertical: tokens.tooltipPaddingV,
351
+ borderRadius: tokens.tooltipRadius,
352
+ maxWidth: tokens.tooltipMaxWidth,
353
+ bottom: handleSize + tokens.tooltipWrapGap,
354
+ // Pinned to the value point on the full-width track area (not
355
+ // the tiny handle-width thumb). An absolute child with only
356
+ // `left` set is clamped by Yoga to `parentWidth - left`, so
357
+ // parenting it to the 20px thumb collapsed the text to ~0px
358
+ // and rendered an empty bubble on device. Centre via translate.
359
+ left: `${percent}%`,
360
+ transform: [{ translateX: -tooltipWidth / 2 }],
361
+ },
362
+ ]}
363
+ pointerEvents="none"
364
+ >
365
+ {renderTooltip ? (
366
+ renderTooltip(currentValue)
367
+ ) : (
368
+ <Text style={tokens.tooltipLabel} numberOfLines={1}>
369
+ {valueText}
370
+ </Text>
371
+ )}
372
+ <View style={[styles.tip, { bottom: -tokens.tipHeight }]} pointerEvents="none">
373
+ <Svg
374
+ width={tokens.tipWidth}
375
+ height={tokens.tipHeight}
376
+ viewBox={`0 0 ${tokens.tipWidth} ${tokens.tipHeight}`}
377
+ >
378
+ <Path
379
+ d={`M0 0 L${tokens.tipWidth / 2} ${tokens.tipHeight} L${tokens.tipWidth} 0 Z`}
380
+ fill={tokens.tooltipBackground}
381
+ />
382
+ </Svg>
383
+ </View>
384
+ </View>
385
+ ) : null
386
+
387
+ return (
388
+ <View
389
+ style={[
390
+ {
391
+ width,
392
+ gap: tokens.gap,
393
+ paddingTop: tokens.paddingTop,
394
+ paddingBottom: tokens.paddingBottom,
395
+ paddingLeft: tokens.paddingLeft,
396
+ paddingRight: tokens.paddingRight,
397
+ opacity: isDisabled ? 0.5 : 1,
398
+ },
399
+ style,
400
+ ]}
401
+ accessibilityLabel={accessibilityLabel}
402
+ >
403
+ {/* Track area — the PanResponder target spans the full track width. */}
404
+ <View
405
+ {...panResponder.panHandlers}
406
+ onLayout={onTrackLayout}
407
+ style={[styles.trackArea, { height: handleSize }]}
408
+ accessible
409
+ accessibilityRole="adjustable"
410
+ accessibilityLabel={accessibilityLabel}
411
+ accessibilityValue={{ min: minValue, max: maxValue, now: currentValue, text: valueText }}
412
+ accessibilityState={{ disabled: isDisabled }}
413
+ accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]}
414
+ onAccessibilityAction={handleAccessibilityAction}
415
+ focusable={!isDisabled}
416
+ {...(Platform.OS === 'web'
417
+ ? {
418
+ onKeyDown: handleKeyDown,
419
+ tabIndex: isDisabled ? -1 : 0,
420
+ onMouseEnter: () => !isDisabled && setIsHovered(true),
421
+ onMouseLeave: () => setIsHovered(false),
422
+ }
423
+ : {})}
424
+ >
425
+ {/* Track */}
426
+ <View
427
+ style={{
428
+ height: tokens.trackHeight,
429
+ borderRadius: tokens.trackRadius,
430
+ backgroundColor: tokens.trackBackground,
431
+ }}
432
+ />
433
+ {/* Filled indicator */}
434
+ <View
435
+ pointerEvents="none"
436
+ style={{
437
+ position: 'absolute',
438
+ left: 0,
439
+ top: (handleSize - tokens.indicatorHeight) / 2,
440
+ height: tokens.indicatorHeight,
441
+ width: `${percent}%`,
442
+ borderRadius: tokens.indicatorRadius,
443
+ backgroundColor: tokens.indicatorBackground,
444
+ }}
445
+ />
446
+ {/* Thumb (handle), centred on the value point */}
447
+ <View
448
+ pointerEvents="none"
449
+ style={{
450
+ position: 'absolute',
451
+ top: 0,
452
+ left: `${percent}%`,
453
+ width: handleSize,
454
+ height: handleSize,
455
+ transform: [{ translateX: -handleSize / 2 }],
456
+ }}
457
+ >
458
+ <View
459
+ style={{
460
+ width: handleSize,
461
+ height: handleSize,
462
+ borderRadius: tokens.handleRadius,
463
+ backgroundColor: tokens.handleBackground,
464
+ }}
465
+ />
466
+ </View>
467
+ {/* Value bubble — parented to the full-width track area so it can
468
+ size to its content (see the note on the tooltip's `left`). */}
469
+ {tooltipNode}
470
+ </View>
471
+
472
+ {/* Min / max labels */}
473
+ {showLabels ? (
474
+ <View style={styles.labelWrap}>
475
+ <Text style={tokens.label}>{minLabel ?? format(minValue)}</Text>
476
+ <Text style={tokens.label}>{maxLabel ?? format(maxValue)}</Text>
477
+ </View>
478
+ ) : null}
479
+ </View>
480
+ )
481
+ })
482
+
483
+ interface ResolvedTokens {
484
+ gap: number
485
+ paddingTop: number
486
+ paddingBottom: number
487
+ paddingLeft: number
488
+ paddingRight: number
489
+ trackHeight: number
490
+ trackRadius: number
491
+ trackBackground: string
492
+ indicatorHeight: number
493
+ indicatorRadius: number
494
+ indicatorBackground: string
495
+ handleSize: number
496
+ handleRadius: number
497
+ handleBackground: string
498
+ tooltipWrapGap: number
499
+ tooltipBackground: string
500
+ tooltipPaddingH: number
501
+ tooltipPaddingV: number
502
+ tooltipRadius: number
503
+ tooltipMaxWidth: number
504
+ tooltipLineHeight: number
505
+ tipWidth: number
506
+ tipHeight: number
507
+ tooltipLabel: TextStyle
508
+ label: TextStyle
509
+ }
510
+
511
+ function resolveTokens(modes: Modes): ResolvedTokens {
512
+ // NOTE: token names are passed as string literals DIRECTLY to
513
+ // getVariableByName so the `extract-component-tokens` script can statically
514
+ // collect them for the generated docs. Do not refactor into a helper that
515
+ // receives the name as a variable.
516
+ const gap = asNum(getVariableByName('slider/gap', modes), 16)
517
+ const paddingTop = asNum(getVariableByName('slider/padding/top', modes), 8)
518
+ const paddingBottom = asNum(getVariableByName('slider/padding/bottom', modes), 0)
519
+ const paddingLeft = asNum(getVariableByName('slider/padding/left', modes), 0)
520
+ const paddingRight = asNum(getVariableByName('slider/padding/right', modes), 0)
521
+
522
+ const trackHeight = asNum(getVariableByName('slider/track/height', modes), 4)
523
+ const trackRadius = asNum(getVariableByName('slider/track/radius', modes), 999)
524
+ // The unfilled track uses a lighter emphasis in the design; consumer modes
525
+ // still win over the baked-in `Emphasis: Low`.
526
+ const trackBackground = asStr(
527
+ getVariableByName('slider/track/background', { ...TRACK_EMPHASIS, ...modes }),
528
+ '#fde8c9'
529
+ )
530
+
531
+ const indicatorHeight = asNum(getVariableByName('slider/indicator/height', modes), 4)
532
+ const indicatorRadius = asNum(getVariableByName('slider/indicator/radius', modes), 999)
533
+ const indicatorBackground = asStr(getVariableByName('slider/indicator/background', modes), '#f7ab21')
534
+
535
+ const handleSize = asNum(getVariableByName('slider/handle/size', modes), 20)
536
+ const handleRadius = asNum(getVariableByName('slider/handle/radius', modes), 999999)
537
+ const handleBackground = asStr(getVariableByName('slider/handle/background', modes), '#f7ab21')
538
+
539
+ const tooltipWrapGap = asNum(getVariableByName('slider/tooltipWrap/gap', modes), 12)
540
+ const tooltipBackground = asStr(getVariableByName('tooltip/background', modes), '#0f0d0a')
541
+ const tooltipPaddingH = asNum(getVariableByName('tooltip/padding/horizontal', modes), 12)
542
+ const tooltipPaddingV = asNum(getVariableByName('tooltip/padding/vertical', modes), 8)
543
+ const tooltipRadius = asNum(getVariableByName('radius', modes), 8)
544
+ const tooltipMaxWidth = asNum(getVariableByName('maxWidth', modes), 280)
545
+ const tipWidth = asNum(getVariableByName('tooltip/tipItem/width', modes), 16)
546
+ const tipHeight = asNum(getVariableByName('tooltip/tipItem/height', modes), 8)
547
+
548
+ const tooltipLabelColor = asStr(getVariableByName('tooltip/label/color', modes), '#ffffff')
549
+ const tooltipLabelSize = asNum(getVariableByName('tooltip/label/fontSize', modes), 14)
550
+ const tooltipLabelFamily = asStr(getVariableByName('tooltip/lable/fontFamily', modes), 'JioType Var')
551
+ const tooltipLabelLineHeight = asNum(getVariableByName('tooltip/label/lineHeight', modes), 18)
552
+ const tooltipLabelWeight = asStr(getVariableByName('tooltip/label/fontWeight', modes), '500')
553
+
554
+ const labelColor = asStr(getVariableByName('text/foreground', modes), '#000000')
555
+ const labelSize = asNum(getVariableByName('text/fontSize', modes), 14)
556
+ const labelFamily = asStr(getVariableByName('text/fontFamily', modes), 'JioType Var')
557
+ const labelLineHeight = asNum(getVariableByName('text/lineHeight', modes), 20)
558
+ const labelWeight = asStr(getVariableByName('text/fontWeight', modes), '500')
559
+ const labelLetterSpacing = asNum(getVariableByName('text/letterSpacing', modes), -0.5)
560
+
561
+ return {
562
+ gap,
563
+ paddingTop,
564
+ paddingBottom,
565
+ paddingLeft,
566
+ paddingRight,
567
+ trackHeight,
568
+ trackRadius,
569
+ trackBackground,
570
+ indicatorHeight,
571
+ indicatorRadius,
572
+ indicatorBackground,
573
+ handleSize,
574
+ handleRadius,
575
+ handleBackground,
576
+ tooltipWrapGap,
577
+ tooltipBackground,
578
+ tooltipPaddingH,
579
+ tooltipPaddingV,
580
+ tooltipRadius,
581
+ tooltipMaxWidth,
582
+ tooltipLineHeight: tooltipLabelLineHeight,
583
+ tipWidth,
584
+ tipHeight,
585
+ tooltipLabel: {
586
+ color: tooltipLabelColor,
587
+ fontSize: tooltipLabelSize,
588
+ fontFamily: tooltipLabelFamily,
589
+ lineHeight: tooltipLabelLineHeight,
590
+ fontWeight: tooltipLabelWeight as TextStyle['fontWeight'],
591
+ includeFontPadding: false as any,
592
+ },
593
+ label: {
594
+ color: labelColor,
595
+ fontSize: labelSize,
596
+ fontFamily: labelFamily,
597
+ lineHeight: labelLineHeight,
598
+ fontWeight: labelWeight as TextStyle['fontWeight'],
599
+ letterSpacing: labelLetterSpacing,
600
+ includeFontPadding: false as any,
601
+ },
602
+ }
603
+ }
604
+
605
+ const styles = {
606
+ trackArea: {
607
+ width: '100%',
608
+ justifyContent: 'center',
609
+ position: 'relative',
610
+ } as ViewStyle,
611
+ labelWrap: {
612
+ flexDirection: 'row',
613
+ justifyContent: 'space-between',
614
+ alignItems: 'flex-start',
615
+ width: '100%',
616
+ } as ViewStyle,
617
+ tooltip: {
618
+ position: 'absolute',
619
+ alignItems: 'center',
620
+ justifyContent: 'center',
621
+ } as ViewStyle,
622
+ tip: {
623
+ position: 'absolute',
624
+ alignSelf: 'center',
625
+ } as ViewStyle,
626
+ }
627
+
628
+ export default Slider
@@ -3,6 +3,7 @@ import { View, type StyleProp, type ViewProps, type ViewStyle } from 'react-nati
3
3
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
4
  import { useTokens } from '../../design-tokens/JFSThemeProvider'
5
5
  import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils'
6
+ import type { Modes } from '../../design-tokens'
6
7
 
7
8
  export type SlotLayoutDirection = 'vertical' | 'horizontal'
8
9
 
@@ -30,7 +31,7 @@ export type SlotProps = ViewProps & {
30
31
  /**
31
32
  * Mode configuration passed to the token resolver and cascaded to children.
32
33
  */
33
- modes?: Record<string, any>
34
+ modes?: Modes
34
35
  style?: StyleProp<ViewStyle>
35
36
  }
36
37
 
@@ -14,6 +14,7 @@ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
14
14
  import { useTokens } from '../../design-tokens/JFSThemeProvider'
15
15
  import { EMPTY_MODES } from '../../utils/react-utils'
16
16
  import { useReducedMotion } from '../../skeleton/useReducedMotion'
17
+ import type { Modes } from '../../design-tokens'
17
18
 
18
19
  /**
19
20
  * Per-segment colours, resolved from the Figma `spiner/*` tokens. Consumers can
@@ -52,7 +53,7 @@ export type SpinnerProps = SpinnerBaseProps & {
52
53
  /** When false, renders a static resting spinner (also honoured for reduced motion). Defaults to true. */
53
54
  animating?: boolean
54
55
  /** Design token modes forwarded to token lookups. */
55
- modes?: Record<string, any>
56
+ modes?: Modes
56
57
  /** Container style override. */
57
58
  style?: StyleProp<ViewStyle>
58
59
  /** Accessibility label announced to assistive tech. Defaults to "Loading". */
@@ -8,6 +8,7 @@ import {
8
8
  } from '../../utils/react-utils'
9
9
  import StatItem from '../StatItem/StatItem'
10
10
  import Divider from '../Divider/Divider'
11
+ import type { Modes } from '../../design-tokens'
11
12
 
12
13
  export type StatGroupItem = {
13
14
  /** Stable key for the item. Falls back to the label / index. */
@@ -34,7 +35,7 @@ export type StatGroupProps = {
34
35
  */
35
36
  children?: React.ReactNode
36
37
  /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
37
- modes?: Record<string, any>
38
+ modes?: Modes
38
39
  /** Override container styles. */
39
40
  style?: StyleProp<ViewStyle>
40
41
  }
@@ -123,7 +124,7 @@ function renderSlotChildren({
123
124
  }: {
124
125
  items?: StatGroupItem[]
125
126
  children?: React.ReactNode
126
- modes: Record<string, any>
127
+ modes: Modes
127
128
  }): React.ReactNode[] {
128
129
  let nodes: React.ReactNode[]
129
130