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,427 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _maskedView = _interopRequireDefault(require("@react-native-masked-view/masked-view"));
10
+ var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
11
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
12
+ var _reactUtils = require("../../utils/react-utils");
13
+ var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
14
+ var _Badge = _interopRequireDefault(require("../Badge/Badge"));
15
+ var _Button = _interopRequireDefault(require("../Button/Button"));
16
+ var _Image = _interopRequireDefault(require("../Image/Image"));
17
+ var _GlassFill = _interopRequireDefault(require("../../utils/GlassFill/GlassFill"));
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
+ function normalizeImageSource(src) {
22
+ if (src == null) return undefined;
23
+ return typeof src === 'string' ? {
24
+ uri: src
25
+ } : src;
26
+ }
27
+ /**
28
+ * ProductMerchandisingCard — a full-bleed image card (Figma node 5277:317)
29
+ * with a top header (avatar + badge) and a bottom **glass footer** that
30
+ * combines a real native background blur with a transparent→black gradient
31
+ * scrim for legible text over any image.
32
+ *
33
+ * Glass footer implementation (works on iOS, Android and Web):
34
+ * - **iOS / Android:** `<GlassFill>` wraps `@react-native-community/blur`'s
35
+ * `BlurView` — iOS gets a real `UIVisualEffectView` (live OS blur),
36
+ * Android gets the community `RealtimeBlurView` with a tinted scrim
37
+ * fallback. The native-only module is isolated in `GlassFill.tsx`.
38
+ * - **Web:** the platform-extension `GlassFill.web.tsx` renders a translucent
39
+ * `View` with `backdrop-filter: blur()` — Metro picks the right file so the
40
+ * web bundle never imports the native blur module.
41
+ * - The gradient scrim is drawn with `react-native-svg` (one renderer for all
42
+ * platforms) so the fade is identical everywhere.
43
+ *
44
+ * The blur strength is driven by the Figma `blur/minimal` token, mapped to the
45
+ * `GlassFill` 0–100 intensity scale the same way `MediaCard` does.
46
+ */
47
+ function ProductMerchandisingCard({
48
+ imageSource,
49
+ title = 'Title',
50
+ subtitle = 'Subtitle',
51
+ badgeLabel,
52
+ badge,
53
+ showAvatar = true,
54
+ avatarSource,
55
+ avatarMonogram,
56
+ avatar,
57
+ specialBadgeLabel,
58
+ specialBadgeIcon,
59
+ specialBadge,
60
+ ctaLabel = 'CTA',
61
+ onCtaPress,
62
+ cta,
63
+ onPress,
64
+ height = 223,
65
+ modes = _reactUtils.EMPTY_MODES,
66
+ style,
67
+ accessibilityLabel,
68
+ disableTruncation
69
+ }) {
70
+ // Unique gradient ids so multiple cards on one (web) document never collide.
71
+ const rawId = (0, _react.useId)();
72
+ const safeId = rawId.replace(/[^a-zA-Z0-9_-]/g, '');
73
+ const scrimId = `pmc-footer-scrim-${safeId}`;
74
+ const blurMaskId = `pmc-footer-blurmask-${safeId}`;
75
+ const normalizedImageSource = (0, _react.useMemo)(() => normalizeImageSource(imageSource), [imageSource]);
76
+ const tokens = (0, _react.useMemo)(() => resolveTokens(modes), [modes]);
77
+ const containerStyle = {
78
+ height,
79
+ borderRadius: tokens.radius,
80
+ overflow: 'hidden',
81
+ position: 'relative',
82
+ flexDirection: 'column',
83
+ justifyContent: 'space-between'
84
+ };
85
+
86
+ // Header avatar defaults to the design's 36px (Avatar Size = M). A
87
+ // consumer-supplied `modes['Avatar Size']` still wins via spread order.
88
+ const avatarModes = (0, _react.useMemo)(() => ({
89
+ 'Avatar Size': 'M',
90
+ ...modes
91
+ }), [modes]);
92
+
93
+ // The Figma node renders the header badge with the brand "Secondary"
94
+ // appearance at "Medium" emphasis (lilac fill + dark label). These are set
95
+ // as defaults so the card matches the design out of the box; a
96
+ // consumer-supplied `modes` value still wins via spread order.
97
+ const badgeModes = (0, _react.useMemo)(() => ({
98
+ AppearanceBrand: 'Secondary',
99
+ Emphasis: 'Medium',
100
+ ...modes
101
+ }), [modes]);
102
+ const headerBadge = badge ?? (badgeLabel != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
103
+ label: badgeLabel,
104
+ modes: badgeModes
105
+ }) : null);
106
+ const headerAvatar = showAvatar ? avatar ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
107
+ style: avatarSource ? 'Image' : avatarMonogram ? 'Monogram' : 'Image',
108
+ imageSource: avatarSource,
109
+ monogram: avatarMonogram,
110
+ modes: avatarModes
111
+ }) : null;
112
+
113
+ // The footer "special badge" is now the shared <Badge type="glass">. The
114
+ // hardcoded literals that defined its look (warm frosted overlay, gentle
115
+ // 5px blur, 6/2 padding, 4px radius, weight-500 white label) are preserved
116
+ // 1:1 via the glass overrides + `style`/`labelStyle`, and the optional
117
+ // `specialBadgeIcon` maps to Badge's `leading` slot — so every existing
118
+ // instantiation renders byte-for-byte the same as before.
119
+ const footerSpecialBadge = specialBadge ?? (specialBadgeLabel != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
120
+ type: "glass",
121
+ label: specialBadgeLabel,
122
+ leading: specialBadgeIcon,
123
+ glassOverlayColor: SPECIAL_BADGE_BG,
124
+ glassIntensity: SPECIAL_BADGE_INTENSITY,
125
+ modes: modes,
126
+ style: styles.specialBadge,
127
+ labelStyle: tokens.specialBadgeText,
128
+ ...(disableTruncation != null ? {
129
+ disableTruncation
130
+ } : null)
131
+ }) : null);
132
+
133
+ // The Figma CTA uses the brand "Secondary" appearance (purple fill, white
134
+ // label) at the small size. Defaults match the design; consumer `modes`
135
+ // win via spread order.
136
+ const ctaModes = (0, _react.useMemo)(() => ({
137
+ 'Button / Size': 'S',
138
+ AppearanceBrand: 'Secondary',
139
+ ...modes
140
+ }), [modes]);
141
+ const footerCta = cta ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
142
+ label: ctaLabel,
143
+ modes: ctaModes,
144
+ onPress: onCtaPress
145
+ });
146
+ const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
147
+ children: [imageSource != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
148
+ imageSource: imageSource,
149
+ style: _reactNative.StyleSheet.absoluteFillObject,
150
+ width: "100%",
151
+ height: height,
152
+ resizeMode: "cover",
153
+ accessibilityElementsHidden: true,
154
+ importantForAccessibility: "no"
155
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
156
+ style: tokens.header,
157
+ pointerEvents: "box-none",
158
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
159
+ style: styles.avatarContainer,
160
+ children: headerAvatar
161
+ }), headerBadge]
162
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
163
+ style: tokens.footer,
164
+ pointerEvents: "box-none",
165
+ children: [normalizedImageSource != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
166
+ style: _reactNative.StyleSheet.absoluteFill,
167
+ pointerEvents: "none",
168
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_maskedView.default, {
169
+ style: _reactNative.StyleSheet.absoluteFill,
170
+ maskElement: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
171
+ width: "100%",
172
+ height: "100%",
173
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
174
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
175
+ id: blurMaskId,
176
+ x1: "0",
177
+ y1: "0",
178
+ x2: "0",
179
+ y2: "1",
180
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
181
+ offset: "0",
182
+ stopColor: "#000000",
183
+ stopOpacity: 0
184
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
185
+ offset: "0.35",
186
+ stopColor: "#000000",
187
+ stopOpacity: 0.5
188
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
189
+ offset: "0.7",
190
+ stopColor: "#000000",
191
+ stopOpacity: 0.92
192
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
193
+ offset: "1",
194
+ stopColor: "#000000",
195
+ stopOpacity: 1
196
+ })]
197
+ })
198
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
199
+ x: "0",
200
+ y: "0",
201
+ width: "100%",
202
+ height: "100%",
203
+ fill: `url(#${blurMaskId})`
204
+ })]
205
+ }),
206
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
207
+ source: normalizedImageSource,
208
+ blurRadius: tokens.imageBlurRadius,
209
+ resizeMode: "cover",
210
+ style: {
211
+ position: 'absolute',
212
+ left: 0,
213
+ right: 0,
214
+ bottom: 0,
215
+ width: '100%',
216
+ height
217
+ }
218
+ })
219
+ })
220
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlassFill.default, {
221
+ tint: "dark",
222
+ intensity: tokens.blurIntensity,
223
+ progressive: true
224
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
225
+ style: [_reactNative.StyleSheet.absoluteFill, styles.scrim],
226
+ pointerEvents: "none",
227
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
228
+ width: "100%",
229
+ height: "100%",
230
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
231
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
232
+ id: scrimId,
233
+ x1: "0",
234
+ y1: "0",
235
+ x2: "0",
236
+ y2: "1",
237
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
238
+ offset: "0.018",
239
+ stopColor: "#000000",
240
+ stopOpacity: 0
241
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
242
+ offset: "0.974",
243
+ stopColor: "#000000",
244
+ stopOpacity: 1
245
+ })]
246
+ })
247
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
248
+ x: "0",
249
+ y: "0",
250
+ width: "100%",
251
+ height: "100%",
252
+ fill: `url(#${scrimId})`
253
+ })]
254
+ })
255
+ }), footerSpecialBadge, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
256
+ style: styles.footerRow,
257
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
258
+ style: tokens.textWrap,
259
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
260
+ style: tokens.title,
261
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
262
+ children: title
263
+ }), subtitle != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
264
+ style: tokens.subtitle,
265
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
266
+ children: subtitle
267
+ }) : null]
268
+ }), footerCta]
269
+ })]
270
+ })]
271
+ });
272
+ if (onPress) {
273
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
274
+ style: ({
275
+ pressed
276
+ }) => [containerStyle, pressed ? styles.pressed : null, style],
277
+ accessibilityRole: "button",
278
+ accessibilityLabel: accessibilityLabel ?? title,
279
+ onPress: onPress,
280
+ children: content
281
+ });
282
+ }
283
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
284
+ style: [containerStyle, style],
285
+ accessibilityLabel: accessibilityLabel,
286
+ children: content
287
+ });
288
+ }
289
+
290
+ // ---------------------------------------------------------------------------
291
+ // Tokens / static styles
292
+ // ---------------------------------------------------------------------------
293
+
294
+ // Figma footer backdrop-blur token (`blur/minimal`). The footer uses a
295
+ // *progressive* blur, so this maps the token to the intensity at the BOTTOM of
296
+ // the ramp (the strongest point); the upper part fades to fully clear. Kept
297
+ // intentionally small to match the design's subtle "minimal" blur.
298
+ const BLUR_INTENSITY_FACTOR = 1.0;
299
+
300
+ // Special badge ("frosted" pill) — values are literals in the Figma node
301
+ // (no dedicated tokens): bg rgba(255,245,229,0.15), 5px backdrop blur.
302
+ const SPECIAL_BADGE_BG = 'rgba(255,245,229,0.15)';
303
+ const SPECIAL_BADGE_INTENSITY = 17; // ~5px CSS blur / ~2 native blurAmount
304
+
305
+ function asNum(raw, fallback) {
306
+ const n = typeof raw === 'number' ? raw : parseFloat(raw);
307
+ return Number.isFinite(n) ? n : fallback;
308
+ }
309
+ function asStr(raw, fallback) {
310
+ return raw != null ? String(raw) : fallback;
311
+ }
312
+ function resolveTokens(modes) {
313
+ // NOTE: token names are passed as string literals DIRECTLY to
314
+ // getVariableByName so the `extract-component-tokens` script can statically
315
+ // collect them for the generated docs. Do not refactor these into a helper
316
+ // that receives the name as a variable.
317
+ const radius = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/radius', modes), 12);
318
+ const headerPadH = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/header/padding/horizontal', modes), 12);
319
+ const headerPadV = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/header/padding/vertical', modes), 12);
320
+ const footerGap = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/gap', modes), 8);
321
+ const footerPadH = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/padding/horizontal', modes), 16);
322
+ const footerPadV = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/padding/vertical', modes), 16);
323
+ const textGap = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/text/gap', modes), 2);
324
+ const blurRadius = asNum((0, _figmaVariablesResolver.getVariableByName)('blur/minimal', modes), 29);
325
+ const titleColor = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/title/font/color', modes), '#ffffff');
326
+ const titleSize = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/title/fontsize', modes), 14);
327
+ const titleFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/title/fontfamily', modes), 'JioType Var');
328
+ const titleWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/title/fontweight', modes), '700');
329
+ const subtitleColor = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/subtitle/font/color', modes), '#c5bcb5');
330
+ const subtitleSize = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/subtitle/fontsize', modes), 12);
331
+ const subtitleFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/subtitle/fontfamily', modes), 'JioType Var');
332
+ const subtitleWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/footer/subtitle/fontweight', modes), '400');
333
+ const sbSize = asNum((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/specialbadge/text/fontsize', modes), 12);
334
+ const sbFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/specialbadge/text/fontfamily', modes), 'JioType Var');
335
+ const sbWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/specialbadge/text/fontweight', modes), '500');
336
+
337
+ // `Image.blurRadius` is interpreted differently per platform — iOS applies a
338
+ // strong Gaussian while Android's IterativeBoxBlur is gentler at the same
339
+ // numeric radius — so we tune each platform to land on the same perceived
340
+ // "minimal" frosted strength as the Figma design.
341
+ const imageBlurRadius = _reactNative.Platform.select({
342
+ ios: Math.max(6, Math.round(blurRadius * 0.5)),
343
+ android: Math.max(12, Math.round(blurRadius * 0.95)),
344
+ default: Math.max(8, Math.round(blurRadius * 0.6))
345
+ });
346
+ return {
347
+ radius,
348
+ blurIntensity: Math.max(0, Math.min(100, Math.round(blurRadius * BLUR_INTENSITY_FACTOR))),
349
+ imageBlurRadius,
350
+ header: {
351
+ flexDirection: 'row',
352
+ alignItems: 'flex-start',
353
+ justifyContent: 'space-between',
354
+ paddingHorizontal: headerPadH,
355
+ paddingVertical: headerPadV,
356
+ zIndex: 1
357
+ },
358
+ footer: {
359
+ paddingHorizontal: footerPadH,
360
+ paddingVertical: footerPadV,
361
+ gap: footerGap,
362
+ overflow: 'hidden',
363
+ zIndex: 2
364
+ },
365
+ textWrap: {
366
+ flex: 1,
367
+ gap: textGap,
368
+ justifyContent: 'center'
369
+ },
370
+ title: {
371
+ color: titleColor,
372
+ fontSize: titleSize,
373
+ fontFamily: titleFamily,
374
+ fontWeight: titleWeight,
375
+ lineHeight: Math.round(titleSize * 1.2),
376
+ includeFontPadding: false
377
+ },
378
+ subtitle: {
379
+ color: subtitleColor,
380
+ fontSize: subtitleSize,
381
+ fontFamily: subtitleFamily,
382
+ fontWeight: subtitleWeight,
383
+ lineHeight: Math.round(subtitleSize * 1.2),
384
+ includeFontPadding: false
385
+ },
386
+ specialBadgeText: {
387
+ color: '#ffffff',
388
+ fontSize: sbSize,
389
+ fontFamily: sbFamily,
390
+ fontWeight: sbWeight,
391
+ lineHeight: Math.round(sbSize * 1.2),
392
+ includeFontPadding: false
393
+ }
394
+ };
395
+ }
396
+ const styles = _reactNative.StyleSheet.create({
397
+ avatarContainer: {
398
+ flexShrink: 1,
399
+ justifyContent: 'center'
400
+ },
401
+ footerRow: {
402
+ flexDirection: 'row',
403
+ alignItems: 'center',
404
+ justifyContent: 'space-between',
405
+ gap: 8
406
+ },
407
+ scrim: {
408
+ // The footer node sits at 90% opacity in Figma; applying it to the
409
+ // scrim (not the content) keeps the title/CTA crisp while preserving
410
+ // the intended fade strength.
411
+ opacity: 0.9
412
+ },
413
+ // Overrides layered on top of <Badge type="glass">. Badge already supplies
414
+ // the row layout + 4px gap (when a leading icon is present), `overflow:
415
+ // 'hidden'`, `alignSelf: 'flex-start'` and `alignItems: 'center'`; these
416
+ // pin the special badge's literal Figma box (6/2 padding, 4px radius)
417
+ // regardless of the badge size tokens resolved by the active modes.
418
+ specialBadge: {
419
+ paddingHorizontal: 6,
420
+ paddingVertical: 2,
421
+ borderRadius: 4
422
+ },
423
+ pressed: {
424
+ opacity: 0.92
425
+ }
426
+ });
427
+ var _default = exports.default = ProductMerchandisingCard;
@@ -29,7 +29,8 @@ const ProductOverview = ({
29
29
  stats = DEFAULT_STATS,
30
30
  modes = _reactUtils.EMPTY_MODES,
31
31
  style,
32
- children
32
+ children,
33
+ disableTruncation
33
34
  }) => {
34
35
  const padding = (0, _figmaVariablesResolver.getVariableByName)('productOverview/padding', modes) ?? 24;
35
36
  const gap = (0, _figmaVariablesResolver.getVariableByName)('productOverview/gap', modes) ?? 12;
@@ -133,11 +134,11 @@ const ProductOverview = ({
133
134
  },
134
135
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
135
136
  style: statValueStyle,
136
- numberOfLines: 1,
137
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
137
138
  children: stat.value
138
139
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
139
140
  style: statLabelStyle,
140
- numberOfLines: 1,
141
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
141
142
  children: stat.label
142
143
  })]
143
144
  }, `${stat.label}-${index}`))
@@ -34,6 +34,7 @@ function ProgressBadge({
34
34
  style,
35
35
  textStyle: textStyleOverride,
36
36
  accessibilityLabel,
37
+ disableTruncation,
37
38
  ...rest
38
39
  }) {
39
40
  // Resolve layout tokens
@@ -119,8 +120,7 @@ function ProgressBadge({
119
120
  importantForAccessibility: "no"
120
121
  }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
121
122
  style: [textStyle, textStyleOverride],
122
- numberOfLines: 1,
123
- ellipsizeMode: "tail",
123
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1, 'tail'),
124
124
  accessibilityElementsHidden: true,
125
125
  importantForAccessibility: "no",
126
126
  children: taskName
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _reactUtils = require("../../utils/react-utils");
11
+ var _Divider = _interopRequireDefault(require("../Divider/Divider"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ /**
15
+ * A value rendered at either end of the marker. A `string`/`number` is rendered
16
+ * with the built-in title typography; any other `ReactNode` (e.g. a
17
+ * `MoneyValue`) is rendered as-is so consumers can fully control presentation.
18
+ */
19
+
20
+ const isTextValue = value => typeof value === 'string' || typeof value === 'number';
21
+
22
+ /**
23
+ * ProjectionMarker renders a start value and an end value connected to a
24
+ * centered badge that summarizes the projection (e.g. a tenure and interest
25
+ * rate). It mirrors the Figma `projectionMarker` component and is commonly used
26
+ * inside "Potential returns" style cards.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <ProjectionMarker
31
+ * startValue="₹1,00,000"
32
+ * endValue="₹1,25,101"
33
+ * duration="1Y 10M"
34
+ * rate="@ 8.25 %"
35
+ * />
36
+ * ```
37
+ *
38
+ * @example Custom end values via MoneyValue
39
+ * ```tsx
40
+ * <ProjectionMarker
41
+ * startValue={<MoneyValue value="1,00,000" />}
42
+ * endValue={<MoneyValue value="1,25,101" />}
43
+ * duration="1Y 10M"
44
+ * rate="@ 8.25 %"
45
+ * />
46
+ * ```
47
+ */
48
+ function ProjectionMarker({
49
+ startValue = '₹1,00,000',
50
+ endValue = '₹1,25,101',
51
+ duration = '1Y 10M',
52
+ rate = '@ 8.25 %',
53
+ showConnectors = true,
54
+ modes = _reactUtils.EMPTY_MODES,
55
+ style,
56
+ startValueStyle,
57
+ endValueStyle,
58
+ badgeStyle,
59
+ durationStyle,
60
+ rateStyle,
61
+ accessibilityLabel,
62
+ disableTruncation
63
+ }) {
64
+ const titleColor = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/title/color', modes) ?? '#000000';
65
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/title/fontfamily', modes) ?? 'JioType Var';
66
+ const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/title/fontsize', modes) ?? 14;
67
+ const titleFontWeight = String((0, _figmaVariablesResolver.getVariableByName)('projectionMarker/title/fontweight', modes) ?? 600);
68
+ const durationColor = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/duration/color', modes) ?? '#000000';
69
+ const durationFontFamily = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/duration/fontfamily', modes) ?? 'JioType Var';
70
+ const durationFontSize = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/duration/fontsize', modes) ?? 12;
71
+ const durationFontWeight = String((0, _figmaVariablesResolver.getVariableByName)('projectionMarker/duration/fontweight', modes) ?? 500);
72
+ const rateColor = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/rate/color', modes) ?? '#6b6b6b';
73
+ const rateFontFamily = (0, _figmaVariablesResolver.getVariableByName)('metricdata/rate/fontfamily', modes) ?? 'JioType Var';
74
+ const rateFontSize = (0, _figmaVariablesResolver.getVariableByName)('metricdata/rate/fontsize', modes) ?? 11;
75
+ const rateFontWeight = String((0, _figmaVariablesResolver.getVariableByName)('metricdata/rate/fontweight', modes) ?? 400);
76
+ const badgeBg = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/durationWrap/bg/color', modes) ?? '#f5f5f5';
77
+ const badgeBorderColor = (0, _figmaVariablesResolver.getVariableByName)('projectionMarker/durationWrap/border/color', modes) ?? '#ebebed';
78
+ const badgeBorderWidth = (0, _figmaVariablesResolver.getVariableByName)('metricdata/durationWrap/stroke', modes) ?? 1;
79
+ const badgeRadius = (0, _figmaVariablesResolver.getVariableByName)('metricdata/durationWrap/radius', modes) ?? 8;
80
+ const badgePaddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('metricdata/durationWrap/padding/horizontal', modes) ?? 16;
81
+ const badgePaddingVertical = (0, _figmaVariablesResolver.getVariableByName)('metricdata/durationWrap/padding/vertical', modes) ?? 8;
82
+ const titleTextStyle = {
83
+ color: titleColor,
84
+ fontFamily: titleFontFamily,
85
+ fontSize: titleFontSize,
86
+ fontWeight: titleFontWeight,
87
+ lineHeight: titleFontSize * 1.3
88
+ };
89
+ const renderEndValue = (value, overrideStyle) => {
90
+ if (value === null || value === undefined) return null;
91
+ if (isTextValue(value)) {
92
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
93
+ style: [titleTextStyle, overrideStyle],
94
+ ...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
95
+ children: value
96
+ });
97
+ }
98
+ return (0, _reactUtils.cloneChildrenWithModes)(value, modes);
99
+ };
100
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
101
+ style: [styles.container, style],
102
+ accessibilityRole: "summary",
103
+ accessibilityLabel: accessibilityLabel,
104
+ children: [renderEndValue(startValue, startValueStyle), showConnectors && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
105
+ direction: "horizontal",
106
+ modes: modes,
107
+ style: styles.connector
108
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
109
+ style: [styles.badge, {
110
+ backgroundColor: badgeBg,
111
+ borderColor: badgeBorderColor,
112
+ borderWidth: badgeBorderWidth,
113
+ borderRadius: badgeRadius,
114
+ paddingHorizontal: badgePaddingHorizontal,
115
+ paddingVertical: badgePaddingVertical
116
+ }, badgeStyle],
117
+ children: [duration !== null && duration !== undefined ? isTextValue(duration) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
118
+ style: [{
119
+ color: durationColor,
120
+ fontFamily: durationFontFamily,
121
+ fontSize: durationFontSize,
122
+ fontWeight: durationFontWeight,
123
+ lineHeight: durationFontSize * 1.2,
124
+ textAlign: 'center'
125
+ }, durationStyle],
126
+ children: duration
127
+ }) : (0, _reactUtils.cloneChildrenWithModes)(duration, modes) : null, rate !== null && rate !== undefined ? isTextValue(rate) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
128
+ style: [{
129
+ color: rateColor,
130
+ fontFamily: rateFontFamily,
131
+ fontSize: rateFontSize,
132
+ fontWeight: rateFontWeight,
133
+ lineHeight: rateFontSize * 1.3,
134
+ textAlign: 'center'
135
+ }, rateStyle],
136
+ children: rate
137
+ }) : (0, _reactUtils.cloneChildrenWithModes)(rate, modes) : null]
138
+ }), showConnectors && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
139
+ direction: "horizontal",
140
+ modes: modes,
141
+ style: styles.connector
142
+ }), renderEndValue(endValue, endValueStyle)]
143
+ });
144
+ }
145
+ const styles = {
146
+ container: {
147
+ flexDirection: 'row',
148
+ alignItems: 'center',
149
+ width: '100%'
150
+ },
151
+ connector: {
152
+ flex: 1,
153
+ alignSelf: 'center',
154
+ marginHorizontal: 16
155
+ },
156
+ badge: {
157
+ flexDirection: 'column',
158
+ alignItems: 'center',
159
+ justifyContent: 'center'
160
+ }
161
+ };
162
+ var _default = exports.default = ProjectionMarker;
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Radio = Radio;
7
- exports.default = void 0;
6
+ exports.default = exports.Radio = void 0;
8
7
  var _react = _interopRequireWildcard(require("react"));
9
8
  var _reactNative = require("react-native");
10
9
  var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
@@ -19,14 +18,14 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
19
18
  // Radio
20
19
  // ---------------------------------------------------------------------------
21
20
 
22
- function Radio({
21
+ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)(function Radio({
23
22
  selected = false,
24
23
  disabled = false,
25
24
  onPress,
26
25
  modes = _reactUtils.EMPTY_MODES,
27
26
  style,
28
27
  testID
29
- }) {
28
+ }, ref) {
30
29
  // ---- Refs & State ----
31
30
  const [hovered, setHovered] = (0, _react.useState)(false);
32
31
  const [focused, setFocused] = (0, _react.useState)(false);
@@ -174,6 +173,7 @@ function Radio({
174
173
  (0, _figmaVariablesResolver.getVariableByName)('radio/disabledSelected/border/color');
175
174
  }
176
175
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
176
+ ref: ref,
177
177
  testID: testID,
178
178
  disabled: disabled,
179
179
  onPress: onPress,
@@ -190,5 +190,5 @@ function Radio({
190
190
  style: selectorStyle
191
191
  })
192
192
  });
193
- }
193
+ });
194
194
  var _default = exports.default = Radio;