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,635 @@
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, resolveTruncation } 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
+ * When `true`, disables text truncation: the trailing ellipsis (`…`) is never
105
+ * shown and any `numberOfLines` clamp is ignored, so the text wraps to as many
106
+ * lines as it needs even when horizontal space is tight.
107
+ */
108
+ disableTruncation?: boolean
109
+ }
110
+
111
+ const clamp = (n: number, min: number, max: number) => Math.min(Math.max(n, min), max)
112
+
113
+ const asNum = (raw: unknown, fallback: number): number => {
114
+ const n = typeof raw === 'number' ? raw : parseFloat(raw as string)
115
+ return Number.isFinite(n) ? n : fallback
116
+ }
117
+
118
+ const asStr = (raw: unknown, fallback: string): string => (raw != null ? String(raw) : fallback)
119
+
120
+ // The unfilled track is rendered at a lighter emphasis in the design.
121
+ const TRACK_EMPHASIS: Modes = { Emphasis: 'Low' }
122
+
123
+ /**
124
+ * Slider — Figma node 5373:446 ("Slider").
125
+ *
126
+ * A horizontal, single-thumb slider driven entirely by design tokens. It maps a
127
+ * numeric range (`minValue`–`maxValue`) onto a track with a filled indicator, a
128
+ * draggable handle, a value bubble pinned above the handle, and optional min/max
129
+ * labels beneath the track. Built on `PanResponder` so the one code path works
130
+ * on iOS, Android and the web.
131
+ *
132
+ * The design only labels the range bounds, but a slider's purpose is to bind a
133
+ * value — so the live value is surfaced through the bubble (formatted via
134
+ * `formatOptions` / `formatValue`) and reported through `onChange` /
135
+ * `onChangeEnd`. Supports controlled and uncontrolled usage, web keyboard
136
+ * control, and an imperative {@link SliderHandle} `ref` for on-demand reads.
137
+ */
138
+ const Slider = forwardRef<SliderHandle, SliderProps>(function Slider(
139
+ {
140
+ value: controlledValue,
141
+ defaultValue,
142
+ onChange,
143
+ onChangeEnd,
144
+ minValue = 0,
145
+ maxValue = 100,
146
+ step = 1,
147
+ isDisabled = false,
148
+ formatOptions,
149
+ locale,
150
+ formatValue,
151
+ renderTooltip,
152
+ alwaysShowTooltip = true,
153
+ showLabels = true,
154
+ minLabel,
155
+ maxLabel,
156
+ width = '100%',
157
+ modes = EMPTY_MODES,
158
+ style,
159
+ accessibilityLabel,
160
+ disableTruncation,
161
+ },
162
+ ref
163
+ ) {
164
+ const tokens = useMemo(() => resolveTokens(modes), [modes])
165
+
166
+ const isControlled = controlledValue !== undefined
167
+ const [internalValue, setInternalValue] = useState(() =>
168
+ clamp(defaultValue ?? minValue, minValue, maxValue)
169
+ )
170
+ const rawValue = isControlled ? (controlledValue as number) : internalValue
171
+ const currentValue = clamp(rawValue, minValue, maxValue)
172
+
173
+ const [trackWidth, setTrackWidth] = useState(0)
174
+ const [tooltipWidth, setTooltipWidth] = useState(0)
175
+ const [isDragging, setIsDragging] = useState(false)
176
+ const [isHovered, setIsHovered] = useState(false)
177
+
178
+ const quantize = useCallback(
179
+ (v: number) => {
180
+ if (!step || step <= 0) return clamp(v, minValue, maxValue)
181
+ const stepped = Math.round((v - minValue) / step) * step + minValue
182
+ // Round away float dust introduced by the division (e.g. 0.30000000000004).
183
+ const decimals = (String(step).split('.')[1] || '').length
184
+ const fixed = decimals > 0 ? Number(stepped.toFixed(decimals)) : stepped
185
+ return clamp(fixed, minValue, maxValue)
186
+ },
187
+ [minValue, maxValue, step]
188
+ )
189
+
190
+ // Keep the latest interactive config in a ref so the PanResponder (created
191
+ // once) always reads fresh values without being recreated mid-gesture.
192
+ const interaction = useRef({
193
+ trackWidth,
194
+ minValue,
195
+ maxValue,
196
+ isDisabled,
197
+ isControlled,
198
+ quantize,
199
+ onChange,
200
+ onChangeEnd,
201
+ })
202
+ interaction.current = {
203
+ trackWidth,
204
+ minValue,
205
+ maxValue,
206
+ isDisabled,
207
+ isControlled,
208
+ quantize,
209
+ onChange,
210
+ onChangeEnd,
211
+ }
212
+
213
+ const lastValueRef = useRef(currentValue)
214
+ lastValueRef.current = currentValue
215
+
216
+ const commit = useCallback((next: number, isFinal: boolean) => {
217
+ const { isControlled: ctrl, onChange: change, onChangeEnd: changeEnd } = interaction.current
218
+ const changed = next !== lastValueRef.current
219
+ lastValueRef.current = next
220
+ if (changed) {
221
+ if (!ctrl) setInternalValue(next)
222
+ change?.(next)
223
+ }
224
+ if (isFinal) changeEnd?.(next)
225
+ }, [])
226
+
227
+ const valueFromX = useCallback((x: number): number => {
228
+ const { trackWidth: w, minValue: min, maxValue: max, quantize: q } = interaction.current
229
+ if (w <= 0) return lastValueRef.current
230
+ const ratio = clamp(x / w, 0, 1)
231
+ return q(min + ratio * (max - min))
232
+ }, [])
233
+
234
+ const panResponder = useRef(
235
+ PanResponder.create({
236
+ onStartShouldSetPanResponder: () => !interaction.current.isDisabled,
237
+ onMoveShouldSetPanResponder: () => !interaction.current.isDisabled,
238
+ onPanResponderGrant: (e: GestureResponderEvent) => {
239
+ if (interaction.current.isDisabled) return
240
+ setIsDragging(true)
241
+ commit(valueFromX(e.nativeEvent.locationX), false)
242
+ },
243
+ onPanResponderMove: (e: GestureResponderEvent) => {
244
+ if (interaction.current.isDisabled) return
245
+ commit(valueFromX(e.nativeEvent.locationX), false)
246
+ },
247
+ onPanResponderRelease: (e: GestureResponderEvent) => {
248
+ setIsDragging(false)
249
+ if (interaction.current.isDisabled) return
250
+ commit(valueFromX(e.nativeEvent.locationX), true)
251
+ },
252
+ onPanResponderTerminate: () => {
253
+ setIsDragging(false)
254
+ if (interaction.current.isDisabled) return
255
+ commit(lastValueRef.current, true)
256
+ },
257
+ })
258
+ ).current
259
+
260
+ // Keyboard support (web). Arrow/Page keys nudge, Home/End jump to bounds.
261
+ const handleKeyDown = useCallback(
262
+ (e: any) => {
263
+ if (isDisabled) return
264
+ const big = Math.max(step, (maxValue - minValue) / 10)
265
+ let next: number | null = null
266
+ switch (e.key) {
267
+ case 'ArrowRight':
268
+ case 'ArrowUp':
269
+ next = quantize(currentValue + step)
270
+ break
271
+ case 'ArrowLeft':
272
+ case 'ArrowDown':
273
+ next = quantize(currentValue - step)
274
+ break
275
+ case 'PageUp':
276
+ next = quantize(currentValue + big)
277
+ break
278
+ case 'PageDown':
279
+ next = quantize(currentValue - big)
280
+ break
281
+ case 'Home':
282
+ next = minValue
283
+ break
284
+ case 'End':
285
+ next = maxValue
286
+ break
287
+ default:
288
+ return
289
+ }
290
+ e.preventDefault?.()
291
+ commit(next, true)
292
+ },
293
+ [isDisabled, step, minValue, maxValue, currentValue, quantize, commit]
294
+ )
295
+
296
+ const handleAccessibilityAction = useCallback(
297
+ (event: { nativeEvent: { actionName: string } }) => {
298
+ if (isDisabled) return
299
+ const name = event.nativeEvent.actionName
300
+ if (name === 'increment') commit(quantize(currentValue + step), true)
301
+ else if (name === 'decrement') commit(quantize(currentValue - step), true)
302
+ },
303
+ [isDisabled, step, currentValue, quantize, commit]
304
+ )
305
+
306
+ useImperativeHandle(
307
+ ref,
308
+ (): SliderHandle => ({
309
+ getValue: () => lastValueRef.current,
310
+ setValue: (v: number) => commit(quantize(v), true),
311
+ increment: (by?: number) => commit(quantize(lastValueRef.current + (by ?? step)), true),
312
+ decrement: (by?: number) => commit(quantize(lastValueRef.current - (by ?? step)), true),
313
+ }),
314
+ [quantize, commit, step]
315
+ )
316
+
317
+ const defaultFormat = useCallback(
318
+ (v: number) => {
319
+ try {
320
+ return new Intl.NumberFormat(locale, formatOptions).format(v)
321
+ } catch {
322
+ return String(v)
323
+ }
324
+ },
325
+ [locale, formatOptions]
326
+ )
327
+ const format = formatValue ?? defaultFormat
328
+
329
+ const ratio = maxValue > minValue ? (currentValue - minValue) / (maxValue - minValue) : 0
330
+ const percent = clamp(ratio, 0, 1) * 100
331
+
332
+ const handleSize = tokens.handleSize
333
+ // The bubble floats (absolutely positioned, no reserved layout space). When
334
+ // `alwaysShowTooltip` is false it only appears while interacting: dragging on
335
+ // any platform, or hovering on web. Lifting the finger clears `isDragging`,
336
+ // so the bubble disappears immediately on touch release.
337
+ const showTooltip = alwaysShowTooltip || isDragging || isHovered
338
+
339
+ const onTrackLayout = useCallback((e: LayoutChangeEvent) => {
340
+ setTrackWidth(e.nativeEvent.layout.width)
341
+ }, [])
342
+
343
+ const onTooltipLayout = useCallback((e: LayoutChangeEvent) => {
344
+ setTooltipWidth(e.nativeEvent.layout.width)
345
+ }, [])
346
+
347
+ const valueText = format(currentValue)
348
+
349
+ const tooltipNode = showTooltip ? (
350
+ <View
351
+ onLayout={onTooltipLayout}
352
+ style={[
353
+ styles.tooltip,
354
+ {
355
+ backgroundColor: tokens.tooltipBackground,
356
+ paddingHorizontal: tokens.tooltipPaddingH,
357
+ paddingVertical: tokens.tooltipPaddingV,
358
+ borderRadius: tokens.tooltipRadius,
359
+ maxWidth: tokens.tooltipMaxWidth,
360
+ bottom: handleSize + tokens.tooltipWrapGap,
361
+ // Pinned to the value point on the full-width track area (not
362
+ // the tiny handle-width thumb). An absolute child with only
363
+ // `left` set is clamped by Yoga to `parentWidth - left`, so
364
+ // parenting it to the 20px thumb collapsed the text to ~0px
365
+ // and rendered an empty bubble on device. Centre via translate.
366
+ left: `${percent}%`,
367
+ transform: [{ translateX: -tooltipWidth / 2 }],
368
+ },
369
+ ]}
370
+ pointerEvents="none"
371
+ >
372
+ {renderTooltip ? (
373
+ renderTooltip(currentValue)
374
+ ) : (
375
+ <Text style={tokens.tooltipLabel} {...resolveTruncation(disableTruncation, 1)}>
376
+ {valueText}
377
+ </Text>
378
+ )}
379
+ <View style={[styles.tip, { bottom: -tokens.tipHeight }]} pointerEvents="none">
380
+ <Svg
381
+ width={tokens.tipWidth}
382
+ height={tokens.tipHeight}
383
+ viewBox={`0 0 ${tokens.tipWidth} ${tokens.tipHeight}`}
384
+ >
385
+ <Path
386
+ d={`M0 0 L${tokens.tipWidth / 2} ${tokens.tipHeight} L${tokens.tipWidth} 0 Z`}
387
+ fill={tokens.tooltipBackground}
388
+ />
389
+ </Svg>
390
+ </View>
391
+ </View>
392
+ ) : null
393
+
394
+ return (
395
+ <View
396
+ style={[
397
+ {
398
+ width,
399
+ gap: tokens.gap,
400
+ paddingTop: tokens.paddingTop,
401
+ paddingBottom: tokens.paddingBottom,
402
+ paddingLeft: tokens.paddingLeft,
403
+ paddingRight: tokens.paddingRight,
404
+ opacity: isDisabled ? 0.5 : 1,
405
+ },
406
+ style,
407
+ ]}
408
+ accessibilityLabel={accessibilityLabel}
409
+ >
410
+ {/* Track area — the PanResponder target spans the full track width. */}
411
+ <View
412
+ {...panResponder.panHandlers}
413
+ onLayout={onTrackLayout}
414
+ style={[styles.trackArea, { height: handleSize }]}
415
+ accessible
416
+ accessibilityRole="adjustable"
417
+ accessibilityLabel={accessibilityLabel}
418
+ accessibilityValue={{ min: minValue, max: maxValue, now: currentValue, text: valueText }}
419
+ accessibilityState={{ disabled: isDisabled }}
420
+ accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]}
421
+ onAccessibilityAction={handleAccessibilityAction}
422
+ focusable={!isDisabled}
423
+ {...(Platform.OS === 'web'
424
+ ? {
425
+ onKeyDown: handleKeyDown,
426
+ tabIndex: isDisabled ? -1 : 0,
427
+ onMouseEnter: () => !isDisabled && setIsHovered(true),
428
+ onMouseLeave: () => setIsHovered(false),
429
+ }
430
+ : {})}
431
+ >
432
+ {/* Track */}
433
+ <View
434
+ style={{
435
+ height: tokens.trackHeight,
436
+ borderRadius: tokens.trackRadius,
437
+ backgroundColor: tokens.trackBackground,
438
+ }}
439
+ />
440
+ {/* Filled indicator */}
441
+ <View
442
+ pointerEvents="none"
443
+ style={{
444
+ position: 'absolute',
445
+ left: 0,
446
+ top: (handleSize - tokens.indicatorHeight) / 2,
447
+ height: tokens.indicatorHeight,
448
+ width: `${percent}%`,
449
+ borderRadius: tokens.indicatorRadius,
450
+ backgroundColor: tokens.indicatorBackground,
451
+ }}
452
+ />
453
+ {/* Thumb (handle), centred on the value point */}
454
+ <View
455
+ pointerEvents="none"
456
+ style={{
457
+ position: 'absolute',
458
+ top: 0,
459
+ left: `${percent}%`,
460
+ width: handleSize,
461
+ height: handleSize,
462
+ transform: [{ translateX: -handleSize / 2 }],
463
+ }}
464
+ >
465
+ <View
466
+ style={{
467
+ width: handleSize,
468
+ height: handleSize,
469
+ borderRadius: tokens.handleRadius,
470
+ backgroundColor: tokens.handleBackground,
471
+ }}
472
+ />
473
+ </View>
474
+ {/* Value bubble — parented to the full-width track area so it can
475
+ size to its content (see the note on the tooltip's `left`). */}
476
+ {tooltipNode}
477
+ </View>
478
+
479
+ {/* Min / max labels */}
480
+ {showLabels ? (
481
+ <View style={styles.labelWrap}>
482
+ <Text style={tokens.label}>{minLabel ?? format(minValue)}</Text>
483
+ <Text style={tokens.label}>{maxLabel ?? format(maxValue)}</Text>
484
+ </View>
485
+ ) : null}
486
+ </View>
487
+ )
488
+ })
489
+
490
+ interface ResolvedTokens {
491
+ gap: number
492
+ paddingTop: number
493
+ paddingBottom: number
494
+ paddingLeft: number
495
+ paddingRight: number
496
+ trackHeight: number
497
+ trackRadius: number
498
+ trackBackground: string
499
+ indicatorHeight: number
500
+ indicatorRadius: number
501
+ indicatorBackground: string
502
+ handleSize: number
503
+ handleRadius: number
504
+ handleBackground: string
505
+ tooltipWrapGap: number
506
+ tooltipBackground: string
507
+ tooltipPaddingH: number
508
+ tooltipPaddingV: number
509
+ tooltipRadius: number
510
+ tooltipMaxWidth: number
511
+ tooltipLineHeight: number
512
+ tipWidth: number
513
+ tipHeight: number
514
+ tooltipLabel: TextStyle
515
+ label: TextStyle
516
+ }
517
+
518
+ function resolveTokens(modes: Modes): ResolvedTokens {
519
+ // NOTE: token names are passed as string literals DIRECTLY to
520
+ // getVariableByName so the `extract-component-tokens` script can statically
521
+ // collect them for the generated docs. Do not refactor into a helper that
522
+ // receives the name as a variable.
523
+ const gap = asNum(getVariableByName('slider/gap', modes), 16)
524
+ const paddingTop = asNum(getVariableByName('slider/padding/top', modes), 8)
525
+ const paddingBottom = asNum(getVariableByName('slider/padding/bottom', modes), 0)
526
+ const paddingLeft = asNum(getVariableByName('slider/padding/left', modes), 0)
527
+ const paddingRight = asNum(getVariableByName('slider/padding/right', modes), 0)
528
+
529
+ const trackHeight = asNum(getVariableByName('slider/track/height', modes), 4)
530
+ const trackRadius = asNum(getVariableByName('slider/track/radius', modes), 999)
531
+ // The unfilled track uses a lighter emphasis in the design; consumer modes
532
+ // still win over the baked-in `Emphasis: Low`.
533
+ const trackBackground = asStr(
534
+ getVariableByName('slider/track/background', { ...TRACK_EMPHASIS, ...modes }),
535
+ '#fde8c9'
536
+ )
537
+
538
+ const indicatorHeight = asNum(getVariableByName('slider/indicator/height', modes), 4)
539
+ const indicatorRadius = asNum(getVariableByName('slider/indicator/radius', modes), 999)
540
+ const indicatorBackground = asStr(getVariableByName('slider/indicator/background', modes), '#f7ab21')
541
+
542
+ const handleSize = asNum(getVariableByName('slider/handle/size', modes), 20)
543
+ const handleRadius = asNum(getVariableByName('slider/handle/radius', modes), 999999)
544
+ const handleBackground = asStr(getVariableByName('slider/handle/background', modes), '#f7ab21')
545
+
546
+ const tooltipWrapGap = asNum(getVariableByName('slider/tooltipWrap/gap', modes), 12)
547
+ const tooltipBackground = asStr(getVariableByName('tooltip/background', modes), '#0f0d0a')
548
+ const tooltipPaddingH = asNum(getVariableByName('tooltip/padding/horizontal', modes), 12)
549
+ const tooltipPaddingV = asNum(getVariableByName('tooltip/padding/vertical', modes), 8)
550
+ const tooltipRadius = asNum(getVariableByName('radius', modes), 8)
551
+ const tooltipMaxWidth = asNum(getVariableByName('maxWidth', modes), 280)
552
+ const tipWidth = asNum(getVariableByName('tooltip/tipItem/width', modes), 16)
553
+ const tipHeight = asNum(getVariableByName('tooltip/tipItem/height', modes), 8)
554
+
555
+ const tooltipLabelColor = asStr(getVariableByName('tooltip/label/color', modes), '#ffffff')
556
+ const tooltipLabelSize = asNum(getVariableByName('tooltip/label/fontSize', modes), 14)
557
+ const tooltipLabelFamily = asStr(getVariableByName('tooltip/lable/fontFamily', modes), 'JioType Var')
558
+ const tooltipLabelLineHeight = asNum(getVariableByName('tooltip/label/lineHeight', modes), 18)
559
+ const tooltipLabelWeight = asStr(getVariableByName('tooltip/label/fontWeight', modes), '500')
560
+
561
+ const labelColor = asStr(getVariableByName('text/foreground', modes), '#000000')
562
+ const labelSize = asNum(getVariableByName('text/fontSize', modes), 14)
563
+ const labelFamily = asStr(getVariableByName('text/fontFamily', modes), 'JioType Var')
564
+ const labelLineHeight = asNum(getVariableByName('text/lineHeight', modes), 20)
565
+ const labelWeight = asStr(getVariableByName('text/fontWeight', modes), '500')
566
+ const labelLetterSpacing = asNum(getVariableByName('text/letterSpacing', modes), -0.5)
567
+
568
+ return {
569
+ gap,
570
+ paddingTop,
571
+ paddingBottom,
572
+ paddingLeft,
573
+ paddingRight,
574
+ trackHeight,
575
+ trackRadius,
576
+ trackBackground,
577
+ indicatorHeight,
578
+ indicatorRadius,
579
+ indicatorBackground,
580
+ handleSize,
581
+ handleRadius,
582
+ handleBackground,
583
+ tooltipWrapGap,
584
+ tooltipBackground,
585
+ tooltipPaddingH,
586
+ tooltipPaddingV,
587
+ tooltipRadius,
588
+ tooltipMaxWidth,
589
+ tooltipLineHeight: tooltipLabelLineHeight,
590
+ tipWidth,
591
+ tipHeight,
592
+ tooltipLabel: {
593
+ color: tooltipLabelColor,
594
+ fontSize: tooltipLabelSize,
595
+ fontFamily: tooltipLabelFamily,
596
+ lineHeight: tooltipLabelLineHeight,
597
+ fontWeight: tooltipLabelWeight as TextStyle['fontWeight'],
598
+ includeFontPadding: false as any,
599
+ },
600
+ label: {
601
+ color: labelColor,
602
+ fontSize: labelSize,
603
+ fontFamily: labelFamily,
604
+ lineHeight: labelLineHeight,
605
+ fontWeight: labelWeight as TextStyle['fontWeight'],
606
+ letterSpacing: labelLetterSpacing,
607
+ includeFontPadding: false as any,
608
+ },
609
+ }
610
+ }
611
+
612
+ const styles = {
613
+ trackArea: {
614
+ width: '100%',
615
+ justifyContent: 'center',
616
+ position: 'relative',
617
+ } as ViewStyle,
618
+ labelWrap: {
619
+ flexDirection: 'row',
620
+ justifyContent: 'space-between',
621
+ alignItems: 'flex-start',
622
+ width: '100%',
623
+ } as ViewStyle,
624
+ tooltip: {
625
+ position: 'absolute',
626
+ alignItems: 'center',
627
+ justifyContent: 'center',
628
+ } as ViewStyle,
629
+ tip: {
630
+ position: 'absolute',
631
+ alignSelf: 'center',
632
+ } as ViewStyle,
633
+ }
634
+
635
+ export default Slider