jfs-components 0.1.2 → 0.1.12

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 (287) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/lib/commonjs/components/Accordion/Accordion.js +2 -1
  3. package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +4 -3
  4. package/lib/commonjs/components/AccountCard/AccountCard.js +4 -3
  5. package/lib/commonjs/components/AllocationComparisonChart/AllocationComparisonChart.js +9 -6
  6. package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
  7. package/lib/commonjs/components/AreaLineChart/AreaLineChart.js +11 -7
  8. package/lib/commonjs/components/Badge/Badge.js +47 -8
  9. package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
  10. package/lib/commonjs/components/BrandChip/BrandChip.js +3 -3
  11. package/lib/commonjs/components/Button/Button.js +2 -1
  12. package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -1
  13. package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +3 -2
  14. package/lib/commonjs/components/CardCTA/CardCTA.js +197 -27
  15. package/lib/commonjs/components/CardInsight/CardInsight.js +5 -1
  16. package/lib/commonjs/components/CcCard/CcCard.js +470 -0
  17. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -3
  18. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
  19. package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +7 -3
  20. package/lib/commonjs/components/CircularProgressBarDoted/CircularProgressBarDoted.js +3 -2
  21. package/lib/commonjs/components/CircularRating/CircularRating.js +2 -1
  22. package/lib/commonjs/components/ClusterBubble/ClusterBubble.js +3 -2
  23. package/lib/commonjs/components/CompareTable/CompareTable.js +401 -0
  24. package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
  25. package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +3 -2
  26. package/lib/commonjs/components/DonutChart/DonutChart.js +4 -3
  27. package/lib/commonjs/components/Dropdown/Dropdown.js +3 -2
  28. package/lib/commonjs/components/DropdownInput/DropdownInput.js +38 -5
  29. package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
  30. package/lib/commonjs/components/FormField/FormField.js +45 -4
  31. package/lib/commonjs/components/Gauge/Gauge.js +1 -1
  32. package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +3 -2
  33. package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
  34. package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +2 -1
  35. package/lib/commonjs/components/ListGroup/ListGroup.js +2 -1
  36. package/lib/commonjs/components/ListItem/ListItem.js +3 -2
  37. package/lib/commonjs/components/MediaCard/MediaCard.js +4 -2
  38. package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +3 -2
  39. package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +6 -3
  40. package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
  41. package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
  42. package/lib/commonjs/components/PoweredByLabel/PoweredByLabel.js +3 -2
  43. package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +427 -0
  44. package/lib/commonjs/components/ProductOverview/ProductOverview.js +4 -3
  45. package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +2 -2
  46. package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +162 -0
  47. package/lib/commonjs/components/Radio/Radio.js +5 -5
  48. package/lib/commonjs/components/Section/Section.js +3 -2
  49. package/lib/commonjs/components/Slider/Slider.js +474 -0
  50. package/lib/commonjs/components/Stack/Stack.js +86 -0
  51. package/lib/commonjs/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
  52. package/lib/commonjs/components/SummaryTile/SummaryTile.js +3 -2
  53. package/lib/commonjs/components/Table/Table.js +324 -0
  54. package/lib/commonjs/components/Text/Text.js +2 -1
  55. package/lib/commonjs/components/TextInput/TextInput.js +22 -9
  56. package/lib/commonjs/components/TextSegment/TextSegment.js +119 -0
  57. package/lib/commonjs/components/ThreadHero/ThreadHero.js +4 -5
  58. package/lib/commonjs/components/Title/Title.js +2 -1
  59. package/lib/commonjs/components/Toast/Toast.js +3 -2
  60. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +2 -1
  61. package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +3 -2
  62. package/lib/commonjs/components/UpiHandle/UpiHandle.js +2 -2
  63. package/lib/commonjs/components/index.js +107 -0
  64. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  65. package/lib/commonjs/design-tokens/figma-modes.generated.js +39 -9
  66. package/lib/commonjs/icons/registry.js +1 -1
  67. package/lib/commonjs/utils/GlassFill/GlassFill.js +271 -0
  68. package/lib/commonjs/utils/GlassFill/GlassFill.web.js +120 -0
  69. package/lib/commonjs/utils/react-utils.js +78 -0
  70. package/lib/commonjs/utils/web-platform-utils.js +59 -0
  71. package/lib/module/components/Accordion/Accordion.js +3 -2
  72. package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +5 -4
  73. package/lib/module/components/AccountCard/AccountCard.js +5 -4
  74. package/lib/module/components/AllocationComparisonChart/AllocationComparisonChart.js +10 -7
  75. package/lib/module/components/AmountInput/AmountInput.js +6 -4
  76. package/lib/module/components/AreaLineChart/AreaLineChart.js +12 -8
  77. package/lib/module/components/Badge/Badge.js +49 -10
  78. package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
  79. package/lib/module/components/BrandChip/BrandChip.js +4 -4
  80. package/lib/module/components/Button/Button.js +3 -2
  81. package/lib/module/components/CardAdvisory/CardAdvisory.js +3 -2
  82. package/lib/module/components/CardBankAccount/CardBankAccount.js +4 -3
  83. package/lib/module/components/CardCTA/CardCTA.js +198 -28
  84. package/lib/module/components/CardInsight/CardInsight.js +5 -1
  85. package/lib/module/components/CcCard/CcCard.js +464 -0
  86. package/lib/module/components/Checkbox/Checkbox.js +5 -4
  87. package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
  88. package/lib/module/components/CircularProgressBar/CircularProgressBar.js +8 -4
  89. package/lib/module/components/CircularProgressBarDoted/CircularProgressBarDoted.js +4 -3
  90. package/lib/module/components/CircularRating/CircularRating.js +3 -2
  91. package/lib/module/components/ClusterBubble/ClusterBubble.js +4 -3
  92. package/lib/module/components/CompareTable/CompareTable.js +396 -0
  93. package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
  94. package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +4 -3
  95. package/lib/module/components/DonutChart/DonutChart.js +5 -4
  96. package/lib/module/components/Dropdown/Dropdown.js +4 -3
  97. package/lib/module/components/DropdownInput/DropdownInput.js +40 -7
  98. package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
  99. package/lib/module/components/FormField/FormField.js +48 -7
  100. package/lib/module/components/Gauge/Gauge.js +1 -1
  101. package/lib/module/components/HoldingsCard/HoldingsCard.js +4 -3
  102. package/lib/module/components/InputSearch/InputSearch.js +6 -4
  103. package/lib/module/components/InstitutionBadge/InstitutionBadge.js +3 -2
  104. package/lib/module/components/ListGroup/ListGroup.js +3 -2
  105. package/lib/module/components/ListItem/ListItem.js +4 -3
  106. package/lib/module/components/MediaCard/MediaCard.js +4 -2
  107. package/lib/module/components/MetricLegendItem/MetricLegendItem.js +4 -3
  108. package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +7 -4
  109. package/lib/module/components/NoteInput/NoteInput.js +7 -6
  110. package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
  111. package/lib/module/components/PoweredByLabel/PoweredByLabel.js +4 -3
  112. package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +421 -0
  113. package/lib/module/components/ProductOverview/ProductOverview.js +5 -4
  114. package/lib/module/components/ProgressBadge/ProgressBadge.js +3 -3
  115. package/lib/module/components/ProjectionMarker/ProjectionMarker.js +157 -0
  116. package/lib/module/components/Radio/Radio.js +5 -4
  117. package/lib/module/components/Section/Section.js +4 -3
  118. package/lib/module/components/Slider/Slider.js +469 -0
  119. package/lib/module/components/Stack/Stack.js +81 -0
  120. package/lib/module/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
  121. package/lib/module/components/SummaryTile/SummaryTile.js +4 -3
  122. package/lib/module/components/Table/Table.js +315 -0
  123. package/lib/module/components/Text/Text.js +3 -2
  124. package/lib/module/components/TextInput/TextInput.js +24 -11
  125. package/lib/module/components/TextSegment/TextSegment.js +114 -0
  126. package/lib/module/components/ThreadHero/ThreadHero.js +5 -6
  127. package/lib/module/components/Title/Title.js +3 -2
  128. package/lib/module/components/Toast/Toast.js +4 -3
  129. package/lib/module/components/TransactionBubble/TransactionBubble.js +3 -2
  130. package/lib/module/components/TransactionStatus/TransactionStatus.js +4 -3
  131. package/lib/module/components/UpiHandle/UpiHandle.js +3 -3
  132. package/lib/module/components/index.js +11 -0
  133. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  134. package/lib/module/design-tokens/figma-modes.generated.js +39 -9
  135. package/lib/module/icons/registry.js +1 -1
  136. package/lib/module/utils/GlassFill/GlassFill.js +265 -0
  137. package/lib/module/utils/GlassFill/GlassFill.web.js +115 -0
  138. package/lib/module/utils/react-utils.js +75 -0
  139. package/lib/module/utils/web-platform-utils.js +58 -0
  140. package/lib/typescript/src/components/Accordion/Accordion.d.ts +7 -1
  141. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +7 -1
  142. package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +7 -1
  143. package/lib/typescript/src/components/AllocationComparisonChart/AllocationComparisonChart.d.ts +7 -1
  144. package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +3 -2
  145. package/lib/typescript/src/components/AreaLineChart/AreaLineChart.d.ts +8 -1
  146. package/lib/typescript/src/components/Badge/Badge.d.ts +32 -2
  147. package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
  148. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +7 -1
  149. package/lib/typescript/src/components/Button/Button.d.ts +7 -1
  150. package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +7 -1
  151. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +7 -1
  152. package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +27 -5
  153. package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
  154. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +3 -2
  155. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +2 -2
  156. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +7 -1
  157. package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +7 -1
  158. package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +7 -1
  159. package/lib/typescript/src/components/ClusterBubble/ClusterBubble.d.ts +7 -1
  160. package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +94 -0
  161. package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
  162. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +7 -1
  163. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +7 -1
  164. package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +7 -1
  165. package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +26 -1
  166. package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +7 -1
  167. package/lib/typescript/src/components/FormField/FormField.d.ts +2 -2
  168. package/lib/typescript/src/components/HoldingsCard/HoldingsCard.d.ts +7 -1
  169. package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +23 -2
  170. package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +7 -1
  171. package/lib/typescript/src/components/ListGroup/ListGroup.d.ts +7 -1
  172. package/lib/typescript/src/components/ListItem/ListItem.d.ts +7 -1
  173. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +7 -1
  174. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +14 -2
  175. package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +19 -2
  176. package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
  177. package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +7 -1
  178. package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +87 -0
  179. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +7 -1
  180. package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +7 -1
  181. package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +88 -0
  182. package/lib/typescript/src/components/Radio/Radio.d.ts +3 -2
  183. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
  184. package/lib/typescript/src/components/Section/Section.d.ts +7 -1
  185. package/lib/typescript/src/components/Slider/Slider.d.ts +105 -0
  186. package/lib/typescript/src/components/Stack/Stack.d.ts +81 -0
  187. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +7 -1
  188. package/lib/typescript/src/components/Table/Table.d.ts +139 -0
  189. package/lib/typescript/src/components/Text/Text.d.ts +7 -1
  190. package/lib/typescript/src/components/TextInput/TextInput.d.ts +9 -29
  191. package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +106 -0
  192. package/lib/typescript/src/components/ThreadHero/ThreadHero.d.ts +7 -1
  193. package/lib/typescript/src/components/Title/Title.d.ts +7 -1
  194. package/lib/typescript/src/components/Toast/Toast.d.ts +7 -1
  195. package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +7 -1
  196. package/lib/typescript/src/components/TransactionStatus/TransactionStatus.d.ts +7 -1
  197. package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +7 -1
  198. package/lib/typescript/src/components/index.d.ts +14 -3
  199. package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +22 -2
  200. package/lib/typescript/src/icons/registry.d.ts +1 -1
  201. package/lib/typescript/src/utils/GlassFill/GlassFill.d.ts +84 -0
  202. package/lib/typescript/src/utils/GlassFill/GlassFill.web.d.ts +43 -0
  203. package/lib/typescript/src/utils/react-utils.d.ts +47 -0
  204. package/lib/typescript/src/utils/web-platform-utils.d.ts +36 -0
  205. package/package.json +2 -1
  206. package/src/components/Accordion/Accordion.tsx +9 -2
  207. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +10 -3
  208. package/src/components/AccountCard/AccountCard.tsx +10 -3
  209. package/src/components/AllocationComparisonChart/AllocationComparisonChart.tsx +14 -4
  210. package/src/components/AmountInput/AmountInput.tsx +7 -5
  211. package/src/components/AreaLineChart/AreaLineChart.tsx +15 -5
  212. package/src/components/Badge/Badge.tsx +78 -8
  213. package/src/components/BenefitCard/BenefitCard.tsx +309 -0
  214. package/src/components/BrandChip/BrandChip.tsx +9 -3
  215. package/src/components/Button/Button.tsx +9 -2
  216. package/src/components/CardAdvisory/CardAdvisory.tsx +9 -2
  217. package/src/components/CardBankAccount/CardBankAccount.tsx +9 -2
  218. package/src/components/CardCTA/CardCTA.tsx +214 -41
  219. package/src/components/CardInsight/CardInsight.tsx +7 -1
  220. package/src/components/CcCard/CcCard.tsx +598 -0
  221. package/src/components/Checkbox/Checkbox.tsx +5 -4
  222. package/src/components/CheckboxItem/CheckboxItem.tsx +5 -4
  223. package/src/components/CircularProgressBar/CircularProgressBar.tsx +14 -4
  224. package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +10 -3
  225. package/src/components/CircularRating/CircularRating.tsx +9 -2
  226. package/src/components/ClusterBubble/ClusterBubble.tsx +9 -2
  227. package/src/components/CompareTable/CompareTable.tsx +525 -0
  228. package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
  229. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +9 -2
  230. package/src/components/DonutChart/DonutChart.tsx +10 -3
  231. package/src/components/Dropdown/Dropdown.tsx +9 -2
  232. package/src/components/DropdownInput/DropdownInput.tsx +64 -5
  233. package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +8 -1
  234. package/src/components/FormField/FormField.tsx +52 -6
  235. package/src/components/Gauge/Gauge.tsx +1 -1
  236. package/src/components/HoldingsCard/HoldingsCard.tsx +9 -2
  237. package/src/components/InputSearch/InputSearch.tsx +8 -5
  238. package/src/components/InstitutionBadge/InstitutionBadge.tsx +9 -2
  239. package/src/components/ListGroup/ListGroup.tsx +9 -2
  240. package/src/components/ListItem/ListItem.tsx +10 -3
  241. package/src/components/MediaCard/MediaCard.tsx +2 -2
  242. package/src/components/MetricLegendItem/MetricLegendItem.tsx +9 -2
  243. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +17 -2
  244. package/src/components/NoteInput/NoteInput.tsx +8 -6
  245. package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
  246. package/src/components/PoweredByLabel/PoweredByLabel.tsx +9 -2
  247. package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +490 -0
  248. package/src/components/ProductOverview/ProductOverview.tsx +10 -3
  249. package/src/components/ProgressBadge/ProgressBadge.tsx +9 -3
  250. package/src/components/ProjectionMarker/ProjectionMarker.tsx +284 -0
  251. package/src/components/Radio/Radio.tsx +5 -4
  252. package/src/components/Section/Section.tsx +10 -3
  253. package/src/components/Slider/Slider.tsx +635 -0
  254. package/src/components/Stack/Stack.tsx +131 -0
  255. package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +10 -1
  256. package/src/components/SummaryTile/SummaryTile.tsx +9 -2
  257. package/src/components/Table/Table.tsx +449 -0
  258. package/src/components/Text/Text.tsx +9 -2
  259. package/src/components/TextInput/TextInput.tsx +22 -12
  260. package/src/components/TextSegment/TextSegment.tsx +173 -0
  261. package/src/components/ThreadHero/ThreadHero.tsx +10 -3
  262. package/src/components/Title/Title.tsx +9 -2
  263. package/src/components/Toast/Toast.tsx +9 -2
  264. package/src/components/TransactionBubble/TransactionBubble.tsx +9 -2
  265. package/src/components/TransactionStatus/TransactionStatus.tsx +9 -2
  266. package/src/components/UpiHandle/UpiHandle.tsx +9 -3
  267. package/src/components/index.ts +33 -3
  268. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  269. package/src/design-tokens/figma-modes.generated.ts +39 -9
  270. package/src/icons/registry.ts +1 -1
  271. package/src/utils/GlassFill/GlassFill.tsx +305 -0
  272. package/src/utils/GlassFill/GlassFill.web.tsx +148 -0
  273. package/src/utils/react-utils.ts +84 -0
  274. package/src/utils/web-platform-utils.ts +68 -0
  275. package/lib/commonjs/components/MediaCard/GlassFill.js +0 -62
  276. package/lib/commonjs/components/MediaCard/GlassFill.web.js +0 -48
  277. package/lib/module/components/MediaCard/GlassFill.js +0 -57
  278. package/lib/module/components/MediaCard/GlassFill.web.js +0 -43
  279. package/lib/typescript/scripts/extract-component-tokens.d.ts +0 -9
  280. package/lib/typescript/scripts/generate-component-docs.d.ts +0 -9
  281. package/lib/typescript/scripts/generate-icon-registry.d.ts +0 -3
  282. package/lib/typescript/scripts/generate-mode-types.d.ts +0 -2
  283. package/lib/typescript/scripts/retype-modes.d.cts +0 -2
  284. package/lib/typescript/src/components/MediaCard/GlassFill.d.ts +0 -47
  285. package/lib/typescript/src/components/MediaCard/GlassFill.web.d.ts +0 -20
  286. package/src/components/MediaCard/GlassFill.tsx +0 -89
  287. package/src/components/MediaCard/GlassFill.web.tsx +0 -53
@@ -0,0 +1,309 @@
1
+ import React, { useMemo } from 'react'
2
+ import {
3
+ View,
4
+ Text as RNText,
5
+ Pressable,
6
+ StyleSheet,
7
+ type ViewStyle,
8
+ type TextStyle,
9
+ type StyleProp,
10
+ } from 'react-native'
11
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
12
+ import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
13
+ import Icon from '../Icon/Icon'
14
+ import Text from '../Text/Text'
15
+ import ListItem from '../ListItem/ListItem'
16
+ import Divider from '../Divider/Divider'
17
+ import Button from '../Button/Button'
18
+ import type { Modes } from '../../design-tokens'
19
+
20
+ /**
21
+ * A single benefit row rendered with the shared `ListItem` primitive: a
22
+ * leading icon, a title and an optional right-aligned trailing value.
23
+ */
24
+ export interface BenefitCardItem {
25
+ /** Registry icon name for the leading glyph (e.g. `'ic_jewellery_diamond'`). */
26
+ icon?: string
27
+ /** Per-item override for the leading icon color. Defaults to the brand token. */
28
+ iconColor?: string
29
+ /** Full override for the leading node. Takes precedence over `icon`. */
30
+ leading?: React.ReactNode
31
+ /** Row title (e.g. `"JioPoints"`). */
32
+ title: string
33
+ /** Optional right-aligned trailing value (e.g. `"Up to 2000 pts"`). */
34
+ trailingText?: string
35
+ /** Full override for the trailing node. Takes precedence over `trailingText`. */
36
+ trailing?: React.ReactNode
37
+ /** Makes the row pressable. */
38
+ onPress?: () => void
39
+ }
40
+
41
+ export interface BenefitCardProps {
42
+ /** Header section title (e.g. `"You will earn"`). */
43
+ headerTitle?: string
44
+ /**
45
+ * Highlighted item shown directly under the header title (icon + title +
46
+ * optional trailing value). Rendered above the divider.
47
+ */
48
+ headerItem?: BenefitCardItem
49
+ /**
50
+ * Toggles the whole header section (title + item + divider). Mirrors the
51
+ * Figma `showHeader` property. Defaults to `true`.
52
+ */
53
+ showHeader?: boolean
54
+ /** Body section title (e.g. `"Upgrade to JioFinance+ and earn more"`). */
55
+ bodyTitle?: string
56
+ /**
57
+ * Body benefit rows. Ignored when `children` is provided (the slot wins).
58
+ */
59
+ items?: BenefitCardItem[]
60
+ /**
61
+ * Real slot for the body "list wrap". When provided, these children render
62
+ * instead of `items`; `modes` (plus the `List Item Style: Minimal` style)
63
+ * cascade into every child automatically.
64
+ */
65
+ children?: React.ReactNode
66
+ /** CTA button label. Defaults to `"Upgrade"`. */
67
+ buttonLabel?: string
68
+ /** CTA press handler. */
69
+ onButtonPress?: () => void
70
+ /** Full override for the CTA. Takes precedence over `buttonLabel`. */
71
+ button?: React.ReactNode
72
+ /**
73
+ * Toggles the CTA button. Mirrors the Figma `showButton` property.
74
+ * Defaults to `true`.
75
+ */
76
+ showButton?: boolean
77
+ /** Press handler for the whole card. When set, the card becomes pressable. */
78
+ onPress?: () => void
79
+ /** Card width. Defaults to the Figma spec (`344`). Pass `'100%'` to fill the parent. */
80
+ width?: number | `${number}%`
81
+ /** Modes object for design-token resolution. Cascaded to all children. */
82
+ modes?: Modes
83
+ /** Style overrides for the card container. */
84
+ style?: StyleProp<ViewStyle>
85
+ /** Accessibility label for the card. */
86
+ accessibilityLabel?: string
87
+ }
88
+
89
+ /**
90
+ * BenefitCard — Figma node 5352:1077 ("Benefit Card").
91
+ *
92
+ * A white, rounded card that summarises the rewards a user will earn. It is
93
+ * composed entirely from the shared design-system primitives so it stays in
94
+ * sync with the rest of the library:
95
+ *
96
+ * - **Header** — a section title + a single highlighted {@link ListItem}
97
+ * (leading `Icon`, title, right-aligned trailing value) followed by a
98
+ * `Divider`.
99
+ * - **Body** — a section title + a column of benefit {@link ListItem}s. The
100
+ * list is a real slot: pass `children` to fully control it, or `items` for
101
+ * the declarative path.
102
+ * - **CTA** — a small {@link Button} (Figma `Button / Size = S`).
103
+ *
104
+ * The list rows resolve through the `List Item Style: Minimal` mode (12px /
105
+ * regular title, 4px gap, no padding) and the leading icons use the
106
+ * `AppearanceBrand: Secondary` brand color, exactly matching the design. All
107
+ * three defaults can be overridden via `modes`.
108
+ */
109
+ function BenefitCard({
110
+ headerTitle = 'You will earn',
111
+ headerItem,
112
+ showHeader = true,
113
+ bodyTitle = 'Upgrade to JioFinance+ and earn more',
114
+ items,
115
+ children,
116
+ buttonLabel = 'Upgrade',
117
+ onButtonPress,
118
+ button,
119
+ showButton = true,
120
+ onPress,
121
+ width = 344,
122
+ modes = EMPTY_MODES,
123
+ style,
124
+ accessibilityLabel,
125
+ }: BenefitCardProps) {
126
+ const tokens = useMemo(() => resolveTokens(modes), [modes])
127
+
128
+ // Sub-component modes. Consumer-supplied `modes` always win via spread order.
129
+ const listItemModes = useMemo<Modes>(() => ({ 'List Item Style': 'Minimal', ...modes }), [modes])
130
+ const iconModes = useMemo<Modes>(() => ({ AppearanceBrand: 'Secondary', ...modes }), [modes])
131
+ const trailingTextModes = useMemo<Modes>(
132
+ () => ({ 'Text Sizes': 'Small', Weight: 'Regular', ...modes }),
133
+ [modes]
134
+ )
135
+ const ctaModes = useMemo<Modes>(() => ({ 'Button / Size': 'S', ...modes }), [modes])
136
+
137
+ const renderItem = (item: BenefitCardItem, key: React.Key) => {
138
+ const leading =
139
+ item.leading ??
140
+ (item.icon != null ? (
141
+ <Icon iconName={item.icon} color={item.iconColor} modes={iconModes} />
142
+ ) : null)
143
+
144
+ const trailing =
145
+ item.trailing ??
146
+ (item.trailingText != null ? (
147
+ <Text modes={trailingTextModes}>{item.trailingText}</Text>
148
+ ) : undefined)
149
+
150
+ return (
151
+ <ListItem
152
+ key={key}
153
+ layout="Horizontal"
154
+ navArrow={false}
155
+ showSupportText={false}
156
+ title={item.title}
157
+ leading={leading}
158
+ trailing={trailing}
159
+ onPress={item.onPress}
160
+ modes={listItemModes}
161
+ />
162
+ )
163
+ }
164
+
165
+ const headerNode =
166
+ showHeader && (headerTitle != null || headerItem != null) ? (
167
+ <View style={styles.section}>
168
+ <View style={styles.cardHeader}>
169
+ {headerTitle != null ? <RNText style={tokens.title}>{headerTitle}</RNText> : null}
170
+ {headerItem != null ? renderItem(headerItem, 'header-item') : null}
171
+ </View>
172
+ <Divider modes={modes} />
173
+ </View>
174
+ ) : null
175
+
176
+ const bodyList = children
177
+ ? cloneChildrenWithModes(children, listItemModes)
178
+ : (items ?? DEFAULT_ITEMS).map((item, index) => renderItem(item, index))
179
+
180
+ const ctaNode = button ?? (
181
+ <Button label={buttonLabel} modes={ctaModes} onPress={onButtonPress} />
182
+ )
183
+
184
+ const containerStyle = useMemo<ViewStyle>(
185
+ () => ({ ...tokens.container, width }),
186
+ [tokens.container, width]
187
+ )
188
+
189
+ const content = (
190
+ <>
191
+ {headerNode}
192
+ <View style={tokens.body}>
193
+ {bodyTitle != null ? <RNText style={tokens.title}>{bodyTitle}</RNText> : null}
194
+ <View style={tokens.listWrap}>{bodyList}</View>
195
+ </View>
196
+ {showButton ? ctaNode : null}
197
+ </>
198
+ )
199
+
200
+ if (onPress) {
201
+ return (
202
+ <Pressable
203
+ style={({ pressed }) => [containerStyle, pressed ? styles.pressed : null, style]}
204
+ accessibilityRole="button"
205
+ accessibilityLabel={accessibilityLabel ?? headerTitle ?? bodyTitle}
206
+ onPress={onPress}
207
+ >
208
+ {content}
209
+ </Pressable>
210
+ )
211
+ }
212
+
213
+ return (
214
+ <View style={[containerStyle, style]} accessibilityLabel={accessibilityLabel}>
215
+ {content}
216
+ </View>
217
+ )
218
+ }
219
+
220
+ // ---------------------------------------------------------------------------
221
+ // Tokens / static styles
222
+ // ---------------------------------------------------------------------------
223
+
224
+ // The "card header" inner gap (title -> highlighted item) is a fixed 4px in
225
+ // the Figma node and has no dedicated token.
226
+ const CARD_HEADER_GAP = 4
227
+
228
+ interface ResolvedTokens {
229
+ container: ViewStyle
230
+ body: ViewStyle
231
+ listWrap: ViewStyle
232
+ title: TextStyle
233
+ }
234
+
235
+ function asNum(raw: unknown, fallback: number): number {
236
+ const n = typeof raw === 'number' ? raw : parseFloat(raw as string)
237
+ return Number.isFinite(n) ? n : fallback
238
+ }
239
+
240
+ function asStr(raw: unknown, fallback: string): string {
241
+ return raw != null ? String(raw) : fallback
242
+ }
243
+
244
+ function resolveTokens(modes: Modes): ResolvedTokens {
245
+ // NOTE: token names are passed as string literals DIRECTLY to
246
+ // getVariableByName so the `extract-component-tokens` script can statically
247
+ // collect them for the generated docs. Do not refactor these into a helper
248
+ // that receives the name as a variable.
249
+ const background = asStr(getVariableByName('benefitCard/background', modes), '#ffffff')
250
+ const paddingHorizontal = asNum(getVariableByName('benefitCard/padding/horizontal', modes), 12)
251
+ const paddingVertical = asNum(getVariableByName('benefitCard/padding/vertical', modes), 12)
252
+ const radius = asNum(getVariableByName('benefitCard/radius', modes), 12)
253
+ const gap = asNum(getVariableByName('benefitCard/gap', modes), 8)
254
+
255
+ const titleColor = asStr(getVariableByName('benefitCard/title/foreground', modes), '#000000')
256
+ const titleSize = asNum(getVariableByName('benefitCard/title/fontsize', modes), 14)
257
+ const titleFamily = asStr(getVariableByName('benefitCard/title/fontFamily', modes), 'JioType Var')
258
+ const titleWeight = asStr(getVariableByName('benefitCard/title/fontWeight', modes), '500')
259
+
260
+ return {
261
+ container: {
262
+ backgroundColor: background,
263
+ paddingHorizontal,
264
+ paddingVertical,
265
+ borderRadius: radius,
266
+ gap,
267
+ flexDirection: 'column',
268
+ alignItems: 'flex-start',
269
+ },
270
+ body: {
271
+ alignSelf: 'stretch',
272
+ gap,
273
+ },
274
+ listWrap: {
275
+ alignSelf: 'stretch',
276
+ gap,
277
+ },
278
+ title: {
279
+ color: titleColor,
280
+ fontSize: titleSize,
281
+ fontFamily: titleFamily,
282
+ fontWeight: titleWeight as TextStyle['fontWeight'],
283
+ lineHeight: 20,
284
+ letterSpacing: -0.5,
285
+ includeFontPadding: false as any,
286
+ },
287
+ }
288
+ }
289
+
290
+ const DEFAULT_ITEMS: BenefitCardItem[] = [
291
+ { icon: 'ic_card', title: 'Up to ₹5000 cashback' },
292
+ { icon: 'ic_card', title: '25% extra JioPoints' },
293
+ ]
294
+
295
+ const styles = StyleSheet.create({
296
+ section: {
297
+ alignSelf: 'stretch',
298
+ gap: 8,
299
+ },
300
+ cardHeader: {
301
+ alignSelf: 'stretch',
302
+ gap: CARD_HEADER_GAP,
303
+ },
304
+ pressed: {
305
+ opacity: 0.92,
306
+ },
307
+ })
308
+
309
+ export default BenefitCard
@@ -10,7 +10,7 @@ import {
10
10
  } from 'react-native'
11
11
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
12
12
  import { useTokens } from '../../design-tokens/JFSThemeProvider'
13
- import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
13
+ import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils'
14
14
  import Avatar from '../Avatar/Avatar'
15
15
  import type { Modes } from '../../design-tokens'
16
16
 
@@ -38,6 +38,12 @@ export type BrandChipProps = {
38
38
  labelStyle?: StyleProp<TextStyle>
39
39
  /** Accessibility label. Defaults to `label`. */
40
40
  accessibilityLabel?: string
41
+ /**
42
+ * When `true`, disables text truncation: the trailing ellipsis (`…`) is never
43
+ * shown and any `numberOfLines` clamp is ignored, so the text wraps to as many
44
+ * lines as it needs even when horizontal space is tight.
45
+ */
46
+ disableTruncation?: boolean
41
47
  }
42
48
 
43
49
  interface BrandChipTokens {
@@ -164,6 +170,7 @@ function BrandChip({
164
170
  style,
165
171
  labelStyle,
166
172
  accessibilityLabel,
173
+ disableTruncation,
167
174
  }: BrandChipProps) {
168
175
  const { modes: globalModes } = useTokens()
169
176
  const modes = useMemo(
@@ -202,8 +209,7 @@ function BrandChip({
202
209
  {avatarNode}
203
210
  <Text
204
211
  style={[tokens.labelStyle, labelStyle]}
205
- numberOfLines={1}
206
- ellipsizeMode="tail"
212
+ {...resolveTruncation(disableTruncation, 1, 'tail')}
207
213
  >
208
214
  {label}
209
215
  </Text>
@@ -12,7 +12,7 @@ import {
12
12
  } from 'react-native'
13
13
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
14
14
  import { usePressableWebSupport, type SafePressableProps, type WebAccessibilityProps } from '../../utils/web-platform-utils'
15
- import { EMPTY_MODES } from '../../utils/react-utils'
15
+ import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils'
16
16
  import Icon from '../../icons/Icon'
17
17
  import Skeleton from '../../skeleton/Skeleton'
18
18
  import { useSkeleton } from '../../skeleton/SkeletonGroup'
@@ -64,6 +64,12 @@ export type ButtonProps = SafePressableProps & {
64
64
  * the group.
65
65
  */
66
66
  loading?: boolean;
67
+ /**
68
+ * When `true`, disables text truncation: the trailing ellipsis (`…`) is never
69
+ * shown and any `numberOfLines` clamp is ignored, so the text wraps to as many
70
+ * lines as it needs even when horizontal space is tight.
71
+ */
72
+ disableTruncation?: boolean;
67
73
  };
68
74
 
69
75
  // ---------------------------------------------------------------------------
@@ -235,6 +241,7 @@ function ButtonImpl({
235
241
  accessibilityState,
236
242
  webAccessibilityProps,
237
243
  loading,
244
+ disableTruncation,
238
245
  ...rest
239
246
  }: ButtonProps) {
240
247
  // Hover state is web-only in practice; the setter is gated so native taps
@@ -294,7 +301,7 @@ function ButtonImpl({
294
301
  content = (
295
302
  <Text
296
303
  style={activeLabelStyle}
297
- numberOfLines={1}
304
+ {...resolveTruncation(disableTruncation, 1)}
298
305
  >
299
306
  {label}
300
307
  </Text>
@@ -9,7 +9,7 @@ import {
9
9
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
10
10
  import { useTokens } from '../../design-tokens/JFSThemeProvider'
11
11
  import Icon from '../../icons/Icon'
12
- import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
12
+ import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils'
13
13
  import CircularProgressBar from '../CircularProgressBar/CircularProgressBar'
14
14
  import Nudge from '../Nudge/Nudge'
15
15
  import type { Modes } from '../../design-tokens'
@@ -57,6 +57,12 @@ export type CardAdvisoryProps = CardAdvisoryBaseProps & {
57
57
  nudgeStyle?: StyleProp<ViewStyle>
58
58
  /** Accessibility label for the full card. */
59
59
  accessibilityLabel?: string
60
+ /**
61
+ * When `true`, disables text truncation: the trailing ellipsis (`…`) is never
62
+ * shown and any `numberOfLines` clamp is ignored, so the text wraps to as many
63
+ * lines as it needs even when horizontal space is tight.
64
+ */
65
+ disableTruncation?: boolean
60
66
  }
61
67
 
62
68
  interface CardAdvisoryTokens {
@@ -195,6 +201,7 @@ function CardAdvisory({
195
201
  progressStyle,
196
202
  nudgeStyle,
197
203
  accessibilityLabel,
204
+ disableTruncation,
198
205
  ...rest
199
206
  }: CardAdvisoryProps) {
200
207
  const { modes: globalModes } = useTokens()
@@ -236,7 +243,7 @@ function CardAdvisory({
236
243
  <View style={[tokens.mainContentStyle, mainContentStyle]}>
237
244
  <View style={tokens.contentStyle}>
238
245
  <View style={tokens.headerStyle}>
239
- <Text numberOfLines={1} style={[tokens.titleStyle, titleStyle]}>
246
+ <Text {...resolveTruncation(disableTruncation, 1)} style={[tokens.titleStyle, titleStyle]}>
240
247
  {title}
241
248
  </Text>
242
249
  {processedTitleEndSlot || (showInfoIcon ? (
@@ -7,7 +7,7 @@ import {
7
7
  type TextStyle,
8
8
  } from 'react-native'
9
9
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
10
- import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
10
+ import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils'
11
11
  import Badge from '../Badge/Badge'
12
12
  import Button from '../Button/Button'
13
13
  import InstitutionBadge from '../InstitutionBadge/InstitutionBadge'
@@ -80,6 +80,12 @@ export type CardBankAccountProps = {
80
80
  style?: StyleProp<ViewStyle>
81
81
  /** Accessibility label for the card region. */
82
82
  accessibilityLabel?: string
83
+ /**
84
+ * When `true`, disables text truncation: the trailing ellipsis (`…`) is never
85
+ * shown and any `numberOfLines` clamp is ignored, so the text wraps to as many
86
+ * lines as it needs even when horizontal space is tight.
87
+ */
88
+ disableTruncation?: boolean
83
89
  }
84
90
 
85
91
  const DEFAULT_ITEMS: CardBankAccountItem[] = [
@@ -138,6 +144,7 @@ function CardBankAccount({
138
144
  modes: propModes = EMPTY_MODES,
139
145
  style,
140
146
  accessibilityLabel,
147
+ disableTruncation,
141
148
  }: CardBankAccountProps) {
142
149
  // Merge caller modes on top of `DEFAULT_MODES` so every default key
143
150
  // (e.g. `Button / Size`, `AppearanceBrand`, `Emphasis`) can be overridden
@@ -268,7 +275,7 @@ function CardBankAccount({
268
275
  <Text style={labelStyle}>{item.label}</Text>
269
276
  </View>
270
277
  {typeof item.value === 'string' || typeof item.value === 'number' ? (
271
- <Text style={valueTextStyle} numberOfLines={1}>
278
+ <Text style={valueTextStyle} {...resolveTruncation(disableTruncation, 1)}>
272
279
  {item.value}
273
280
  </Text>
274
281
  ) : (