@ledgerhq/lumen-ui-rnative 0.1.13 → 0.1.15

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 (315) hide show
  1. package/dist/module/i18n/i18n.js +2 -0
  2. package/dist/module/i18n/i18n.js.map +1 -1
  3. package/dist/module/index.js +0 -1
  4. package/dist/module/index.js.map +1 -1
  5. package/dist/module/lib/Animations/Spin/Spin.js +3 -1
  6. package/dist/module/lib/Animations/Spin/Spin.js.map +1 -1
  7. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js +0 -1
  8. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js.map +1 -1
  9. package/dist/module/lib/Components/Avatar/Avatar.figma.js +26 -0
  10. package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -0
  11. package/dist/module/lib/Components/Avatar/Avatar.stories.js +0 -1
  12. package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
  13. package/dist/module/lib/Components/Avatar/Avatar.test.js +0 -1
  14. package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
  15. package/dist/module/lib/Components/Banner/Banner.stories.js +3 -3
  16. package/dist/module/lib/Components/Banner/Banner.stories.js.map +1 -1
  17. package/dist/module/lib/Components/Banner/Banner.test.js +0 -1
  18. package/dist/module/lib/Components/Banner/Banner.test.js.map +1 -1
  19. package/dist/module/lib/Components/BottomSheet/BottomSheet.js +1 -1
  20. package/dist/module/lib/Components/BottomSheet/BottomSheet.js.map +1 -1
  21. package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js +0 -1
  22. package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js.map +1 -1
  23. package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js +0 -2
  24. package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js.map +1 -1
  25. package/dist/module/lib/Components/BottomSheet/CustomHandle.js +0 -1
  26. package/dist/module/lib/Components/BottomSheet/CustomHandle.js.map +1 -1
  27. package/dist/module/lib/Components/Button/BaseButton.test.js +0 -1
  28. package/dist/module/lib/Components/Button/BaseButton.test.js.map +1 -1
  29. package/dist/module/lib/Components/Button/Button.stories.js +2 -2
  30. package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
  31. package/dist/module/lib/Components/Card/Card.js +3 -3
  32. package/dist/module/lib/Components/Card/Card.js.map +1 -1
  33. package/dist/module/lib/Components/Card/Card.test.js +0 -1
  34. package/dist/module/lib/Components/Card/Card.test.js.map +1 -1
  35. package/dist/module/lib/Components/CardButton/CardButton.test.js +0 -1
  36. package/dist/module/lib/Components/CardButton/CardButton.test.js.map +1 -1
  37. package/dist/module/lib/Components/Checkbox/BaseCheckbox.js +1 -1
  38. package/dist/module/lib/Components/Checkbox/BaseCheckbox.js.map +1 -1
  39. package/dist/module/lib/Components/Checkbox/Checkbox.test.js +0 -1
  40. package/dist/module/lib/Components/Checkbox/Checkbox.test.js.map +1 -1
  41. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js +2 -2
  42. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js.map +1 -1
  43. package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js +0 -1
  44. package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js.map +1 -1
  45. package/dist/module/lib/Components/Divider/Divider.test.js +0 -1
  46. package/dist/module/lib/Components/Divider/Divider.test.js.map +1 -1
  47. package/dist/module/lib/Components/Icon/Icon.js +2 -1
  48. package/dist/module/lib/Components/Icon/Icon.js.map +1 -1
  49. package/dist/module/lib/Components/Icon/Icon.test.js +0 -1
  50. package/dist/module/lib/Components/Icon/Icon.test.js.map +1 -1
  51. package/dist/module/lib/Components/Icon/createIcon.js +4 -2
  52. package/dist/module/lib/Components/Icon/createIcon.js.map +1 -1
  53. package/dist/module/lib/Components/IconButton/IconButton.test.js +0 -1
  54. package/dist/module/lib/Components/IconButton/IconButton.test.js.map +1 -1
  55. package/dist/module/lib/Components/Link/Link.test.js +3 -3
  56. package/dist/module/lib/Components/Link/Link.test.js.map +1 -1
  57. package/dist/module/lib/Components/ListItem/ListItem.js +64 -179
  58. package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
  59. package/dist/module/lib/Components/ListItem/ListItem.mdx +53 -49
  60. package/dist/module/lib/Components/ListItem/ListItem.stories.js +65 -59
  61. package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
  62. package/dist/module/lib/Components/NavBar/NavBar.js +3 -3
  63. package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
  64. package/dist/module/lib/Components/NavBar/NavBar.test.js +0 -1
  65. package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
  66. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +2 -2
  67. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
  68. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +46 -14
  69. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
  70. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
  71. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +90 -64
  72. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
  73. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +0 -1
  74. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
  75. package/dist/module/lib/Components/SegmentedControl/SegmentedControlContext.js.map +1 -1
  76. package/dist/module/lib/Components/SegmentedControl/usePillLayout.js +40 -16
  77. package/dist/module/lib/Components/SegmentedControl/usePillLayout.js.map +1 -1
  78. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +1 -1
  79. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +1 -1
  80. package/dist/module/lib/Components/Select/GlobalSelectContext.js +1 -1
  81. package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +1 -1
  82. package/dist/module/lib/Components/Select/Select.js +3 -3
  83. package/dist/module/lib/Components/Select/Select.js.map +1 -1
  84. package/dist/module/lib/Components/Select/Select.test.js +0 -1
  85. package/dist/module/lib/Components/Select/Select.test.js.map +1 -1
  86. package/dist/module/lib/Components/Skeleton/Skeleton.test.js +0 -1
  87. package/dist/module/lib/Components/Skeleton/Skeleton.test.js.map +1 -1
  88. package/dist/module/lib/Components/Slot/Slot.js +4 -0
  89. package/dist/module/lib/Components/Slot/Slot.js.map +1 -1
  90. package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -3
  91. package/dist/module/lib/Components/Spot/Spot.stories.js +0 -1
  92. package/dist/module/lib/Components/Spot/Spot.stories.js.map +1 -1
  93. package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -3
  94. package/dist/module/lib/Components/Stepper/Stepper.test.js +0 -1
  95. package/dist/module/lib/Components/Stepper/Stepper.test.js.map +1 -1
  96. package/dist/module/lib/Components/Subheader/Subheader.stories.js +0 -1
  97. package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
  98. package/dist/module/lib/Components/Subheader/Subheader.test.js +0 -1
  99. package/dist/module/lib/Components/Subheader/Subheader.test.js.map +1 -1
  100. package/dist/module/lib/Components/Switch/BaseSwitch.js +1 -1
  101. package/dist/module/lib/Components/Switch/BaseSwitch.js.map +1 -1
  102. package/dist/module/lib/Components/Switch/Switch.test.js +0 -1
  103. package/dist/module/lib/Components/Switch/Switch.test.js.map +1 -1
  104. package/dist/module/lib/Components/TabBar/TabBar.js +8 -8
  105. package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
  106. package/dist/module/lib/Components/TabBar/TabBar.test.js +0 -1
  107. package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
  108. package/dist/module/lib/Components/Tag/Tag.js +1 -0
  109. package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
  110. package/dist/module/lib/Components/Tag/Tag.mdx +6 -0
  111. package/dist/module/lib/Components/Tag/Tag.stories.js +10 -0
  112. package/dist/module/lib/Components/Tag/Tag.stories.js.map +1 -1
  113. package/dist/module/lib/Components/Tile/Tile.stories.js +0 -1
  114. package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
  115. package/dist/module/lib/Components/Tile/Tile.test.js +0 -1
  116. package/dist/module/lib/Components/Tile/Tile.test.js.map +1 -1
  117. package/dist/module/lib/Components/TileButton/TileButton.test.js +0 -1
  118. package/dist/module/lib/Components/TileButton/TileButton.test.js.map +1 -1
  119. package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js +1 -1
  120. package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js.map +1 -1
  121. package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js +1 -1
  122. package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js.map +1 -1
  123. package/dist/module/lib/Components/Tooltip/Tooltip.test.js +0 -1
  124. package/dist/module/lib/Components/Tooltip/Tooltip.test.js.map +1 -1
  125. package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js +1 -1
  126. package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js.map +1 -1
  127. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
  128. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js +1 -1
  129. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js.map +1 -1
  130. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js +1 -1
  131. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js.map +1 -1
  132. package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js +1 -1
  133. package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js.map +1 -1
  134. package/dist/module/lib/Symbols/Icons/Csv.js +1 -1
  135. package/dist/module/lib/Symbols/Icons/Csv.js.map +1 -1
  136. package/dist/module/lib/Symbols/Icons/TriangleDown.js +47 -0
  137. package/dist/module/lib/Symbols/Icons/TriangleDown.js.map +1 -0
  138. package/dist/module/lib/Symbols/Icons/TriangleUp.js +47 -0
  139. package/dist/module/lib/Symbols/Icons/TriangleUp.js.map +1 -0
  140. package/dist/module/lib/Symbols/index.js +2 -0
  141. package/dist/module/lib/Symbols/index.js.map +1 -1
  142. package/dist/module/lib/utils/react/extractTextFromChildren.js +3 -3
  143. package/dist/module/lib/utils/react/extractTextFromChildren.js.map +1 -1
  144. package/dist/module/lib/utils/useControllableState/useControllableState.js +5 -5
  145. package/dist/module/lib/utils/useControllableState/useControllableState.js.map +1 -1
  146. package/dist/module/lib/utils/useEvent/useGet.js +3 -3
  147. package/dist/module/lib/utils/useEvent/useGet.js.map +1 -1
  148. package/dist/module/styles/hooks/useStyleSheet.test.js +1 -1
  149. package/dist/module/styles/hooks/useStyleSheet.test.js.map +1 -1
  150. package/dist/module/styles/lx/createStyledPressable.test.js +1 -1
  151. package/dist/module/styles/lx/createStyledPressable.test.js.map +1 -1
  152. package/dist/module/styles/lx/createStyledText.test.js +1 -1
  153. package/dist/module/styles/lx/createStyledText.test.js.map +1 -1
  154. package/dist/module/styles/lx/createStyledView.test.js +1 -1
  155. package/dist/module/styles/lx/createStyledView.test.js.map +1 -1
  156. package/dist/module/styles/lx/resolveStyle.test.js +0 -1
  157. package/dist/module/styles/lx/resolveStyle.test.js.map +1 -1
  158. package/dist/module/styles/provider/LumenStyleSheetProvider.test.js +2 -4
  159. package/dist/module/styles/provider/LumenStyleSheetProvider.test.js.map +1 -1
  160. package/dist/module/utils/icon-template.js +3 -0
  161. package/dist/module/utils/icon-template.js.map +1 -1
  162. package/dist/typescript/src/i18n/i18n.d.ts.map +1 -1
  163. package/dist/typescript/src/index.d.ts +0 -1
  164. package/dist/typescript/src/index.d.ts.map +1 -1
  165. package/dist/typescript/src/lib/Animations/Spin/Spin.d.ts.map +1 -1
  166. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts +2 -0
  167. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts.map +1 -0
  168. package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts +0 -1
  169. package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts.map +1 -1
  170. package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts +1 -1
  171. package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts.map +1 -1
  172. package/dist/typescript/src/lib/Components/Card/Card.d.ts.map +1 -1
  173. package/dist/typescript/src/lib/Components/CardButton/types.d.ts +0 -1
  174. package/dist/typescript/src/lib/Components/CardButton/types.d.ts.map +1 -1
  175. package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts +0 -1
  176. package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts.map +1 -1
  177. package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts +1 -2
  178. package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  179. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +21 -40
  180. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  181. package/dist/typescript/src/lib/Components/ListItem/types.d.ts +10 -37
  182. package/dist/typescript/src/lib/Components/ListItem/types.d.ts.map +1 -1
  183. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  184. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  185. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +6 -0
  186. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  187. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +7 -0
  188. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  189. package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts +7 -3
  190. package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts.map +1 -1
  191. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -1
  192. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
  193. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +1 -1
  194. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +1 -1
  195. package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +1 -1
  196. package/dist/typescript/src/lib/Components/Slot/Slot.d.ts.map +1 -1
  197. package/dist/typescript/src/lib/Components/Spot/types.d.ts +2 -2
  198. package/dist/typescript/src/lib/Components/Spot/types.d.ts.map +1 -1
  199. package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts +0 -1
  200. package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts.map +1 -1
  201. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
  202. package/dist/typescript/src/lib/Components/Tag/Tag.d.ts.map +1 -1
  203. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts +0 -1
  204. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts.map +1 -1
  205. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts +1 -1
  206. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts.map +1 -1
  207. package/dist/typescript/src/lib/Symbols/Icons/TriangleDown.d.ts +35 -0
  208. package/dist/typescript/src/lib/Symbols/Icons/TriangleDown.d.ts.map +1 -0
  209. package/dist/typescript/src/lib/Symbols/Icons/TriangleUp.d.ts +35 -0
  210. package/dist/typescript/src/lib/Symbols/Icons/TriangleUp.d.ts.map +1 -0
  211. package/dist/typescript/src/lib/Symbols/index.d.ts +2 -0
  212. package/dist/typescript/src/lib/Symbols/index.d.ts.map +1 -1
  213. package/dist/typescript/src/lib/types/index.d.ts +6 -6
  214. package/dist/typescript/src/lib/types/index.d.ts.map +1 -1
  215. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts +2 -2
  216. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -1
  217. package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts +3 -3
  218. package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -1
  219. package/dist/typescript/src/utils/icon-template.d.ts.map +1 -1
  220. package/package.json +2 -2
  221. package/src/i18n/i18n.ts +2 -0
  222. package/src/index.ts +0 -1
  223. package/src/lib/Animations/Spin/Spin.tsx +5 -1
  224. package/src/lib/Components/AmountDisplay/AmountDisplay.test.tsx +0 -1
  225. package/src/lib/Components/Avatar/Avatar.figma.tsx +29 -0
  226. package/src/lib/Components/Avatar/Avatar.stories.tsx +0 -1
  227. package/src/lib/Components/Avatar/Avatar.test.tsx +0 -1
  228. package/src/lib/Components/Banner/Banner.stories.tsx +3 -3
  229. package/src/lib/Components/Banner/Banner.test.tsx +0 -1
  230. package/src/lib/Components/BottomSheet/BottomSheet.test.tsx +0 -1
  231. package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
  232. package/src/lib/Components/BottomSheet/CustomBackdrop.tsx +0 -2
  233. package/src/lib/Components/BottomSheet/CustomHandle.tsx +1 -1
  234. package/src/lib/Components/Button/BaseButton.test.tsx +0 -1
  235. package/src/lib/Components/Button/Button.stories.tsx +2 -2
  236. package/src/lib/Components/Card/Card.test.tsx +0 -1
  237. package/src/lib/Components/Card/Card.tsx +3 -2
  238. package/src/lib/Components/CardButton/CardButton.test.tsx +0 -1
  239. package/src/lib/Components/CardButton/types.ts +0 -1
  240. package/src/lib/Components/Checkbox/BaseCheckbox.tsx +1 -1
  241. package/src/lib/Components/Checkbox/Checkbox.test.tsx +0 -1
  242. package/src/lib/Components/ContentBanner/ContentBanner.stories.tsx +2 -2
  243. package/src/lib/Components/ContentBanner/ContentBanner.test.tsx +0 -1
  244. package/src/lib/Components/ContentBanner/types.ts +0 -1
  245. package/src/lib/Components/Divider/Divider.test.tsx +0 -1
  246. package/src/lib/Components/Icon/Icon.test.tsx +0 -1
  247. package/src/lib/Components/Icon/Icon.tsx +1 -1
  248. package/src/lib/Components/Icon/createIcon.ts +3 -2
  249. package/src/lib/Components/IconButton/IconButton.test.tsx +0 -1
  250. package/src/lib/Components/Link/Link.test.tsx +3 -3
  251. package/src/lib/Components/ListItem/ListItem.mdx +53 -49
  252. package/src/lib/Components/ListItem/ListItem.stories.tsx +51 -54
  253. package/src/lib/Components/ListItem/ListItem.tsx +80 -210
  254. package/src/lib/Components/ListItem/types.ts +10 -41
  255. package/src/lib/Components/NavBar/NavBar.test.tsx +0 -1
  256. package/src/lib/Components/NavBar/NavBar.tsx +3 -3
  257. package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +2 -2
  258. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
  259. package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +77 -51
  260. package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +0 -1
  261. package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +42 -9
  262. package/src/lib/Components/SegmentedControl/SegmentedControlContext.tsx +4 -0
  263. package/src/lib/Components/SegmentedControl/types.ts +7 -0
  264. package/src/lib/Components/SegmentedControl/usePillLayout.ts +66 -19
  265. package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +1 -1
  266. package/src/lib/Components/Select/GlobalSelectContext.tsx +1 -1
  267. package/src/lib/Components/Select/Select.test.tsx +0 -1
  268. package/src/lib/Components/Select/Select.tsx +16 -14
  269. package/src/lib/Components/Skeleton/Skeleton.test.tsx +0 -1
  270. package/src/lib/Components/Slot/Slot.tsx +4 -0
  271. package/src/lib/Components/Spinner/Spinner.mdx +1 -3
  272. package/src/lib/Components/Spot/Spot.stories.tsx +0 -1
  273. package/src/lib/Components/Spot/types.ts +2 -2
  274. package/src/lib/Components/Stepper/Stepper.mdx +1 -3
  275. package/src/lib/Components/Stepper/Stepper.test.tsx +0 -1
  276. package/src/lib/Components/Subheader/Subheader.stories.tsx +0 -1
  277. package/src/lib/Components/Subheader/Subheader.test.tsx +0 -1
  278. package/src/lib/Components/Switch/BaseSwitch.tsx +1 -1
  279. package/src/lib/Components/Switch/Switch.test.tsx +0 -1
  280. package/src/lib/Components/TabBar/TabBar.test.tsx +0 -1
  281. package/src/lib/Components/TabBar/TabBar.tsx +12 -5
  282. package/src/lib/Components/Tag/Tag.mdx +6 -0
  283. package/src/lib/Components/Tag/Tag.stories.tsx +8 -0
  284. package/src/lib/Components/Tag/Tag.tsx +3 -1
  285. package/src/lib/Components/Tile/Tile.stories.tsx +0 -1
  286. package/src/lib/Components/Tile/Tile.test.tsx +0 -1
  287. package/src/lib/Components/TileButton/TileButton.test.tsx +0 -1
  288. package/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.tsx +1 -1
  289. package/src/lib/Components/Tooltip/GlobalTooltipContext.tsx +1 -7
  290. package/src/lib/Components/Tooltip/Tooltip.test.tsx +0 -1
  291. package/src/lib/Components/TriggerButton/TriggerButton.test.tsx +1 -1
  292. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +1 -1
  293. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.tsx +1 -1
  294. package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.tsx +1 -1
  295. package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +1 -1
  296. package/src/lib/Symbols/Icons/Csv.tsx +1 -1
  297. package/src/lib/Symbols/Icons/TriangleDown.tsx +42 -0
  298. package/src/lib/Symbols/Icons/TriangleUp.tsx +42 -0
  299. package/src/lib/Symbols/index.ts +2 -0
  300. package/src/lib/types/index.ts +7 -7
  301. package/src/lib/utils/react/extractTextFromChildren.ts +4 -4
  302. package/src/lib/utils/useControllableState/useControllableState.ts +7 -9
  303. package/src/lib/utils/useEvent/useGet.ts +3 -3
  304. package/src/styles/hooks/useStyleSheet.test.tsx +1 -1
  305. package/src/styles/lx/createStyledPressable.test.tsx +1 -1
  306. package/src/styles/lx/createStyledText.test.tsx +1 -1
  307. package/src/styles/lx/createStyledView.test.tsx +1 -1
  308. package/src/styles/lx/resolveStyle.test.tsx +0 -1
  309. package/src/styles/provider/LumenStyleSheetProvider.test.tsx +2 -2
  310. package/src/utils/icon-template.ts +2 -0
  311. package/dist/module/lib/Patterns/index.js +0 -4
  312. package/dist/module/lib/Patterns/index.js.map +0 -1
  313. package/dist/typescript/src/lib/Patterns/index.d.ts +0 -3
  314. package/dist/typescript/src/lib/Patterns/index.d.ts.map +0 -1
  315. package/src/lib/Patterns/index.ts +0 -1
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, fireEvent } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
7
6
 
@@ -1,4 +1,5 @@
1
1
  import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
2
+ import { LayoutChangeEvent } from 'react-native';
2
3
  import Animated from 'react-native-reanimated';
3
4
  import { useStyleSheet } from '../../../styles';
4
5
  import type { LumenTextStyle, LumenTypographyTokenName } from '../../../styles';
@@ -23,10 +24,15 @@ export function SegmentedControlButton({
23
24
  onPress,
24
25
  ...props
25
26
  }: SegmentedControlButtonProps) {
26
- const { selectedValue, onSelectedChange, disabled } =
27
- useSegmentedControlContext();
27
+ const {
28
+ selectedValue,
29
+ onSelectedChange,
30
+ disabled,
31
+ tabLayout,
32
+ registerButtonLayout,
33
+ } = useSegmentedControlContext();
28
34
  const selected = selectedValue === value;
29
- const styles = useButtonStyles({ selected, disabled });
35
+ const styles = useButtonStyles({ selected, disabled, tabLayout });
30
36
 
31
37
  function handlePress() {
32
38
  if (!disabled) {
@@ -35,9 +41,17 @@ export function SegmentedControlButton({
35
41
  }
36
42
  }
37
43
 
44
+ function handleLayout(e: LayoutChangeEvent) {
45
+ if (tabLayout === 'fit') {
46
+ const { x, width } = e.nativeEvent.layout;
47
+ registerButtonLayout(value, { x, width });
48
+ }
49
+ }
50
+
38
51
  return (
39
52
  <Pressable
40
53
  onPress={handlePress}
54
+ onLayout={handleLayout}
41
55
  disabled={disabled}
42
56
  accessibilityState={{ selected, disabled }}
43
57
  style={styles.button}
@@ -53,6 +67,7 @@ export function SegmentedControlButton({
53
67
  typography={styles.typography}
54
68
  lx={{ color: styles.textColor }}
55
69
  style={styles.label}
70
+ numberOfLines={1}
56
71
  >
57
72
  {children}
58
73
  </Text>
@@ -66,14 +81,16 @@ SegmentedControlButton.displayName = 'SegmentedControlButton';
66
81
  function useButtonStyles({
67
82
  selected,
68
83
  disabled,
84
+ tabLayout,
69
85
  }: {
70
86
  selected: boolean;
71
87
  disabled?: boolean;
88
+ tabLayout: 'fit' | 'fixed';
72
89
  }) {
73
90
  const styles = useStyleSheet(
74
91
  (t) => ({
75
92
  button: {
76
- flex: 1,
93
+ flex: tabLayout === 'fixed' ? 1 : undefined,
77
94
  flexDirection: 'row',
78
95
  alignItems: 'center',
79
96
  justifyContent: 'center',
@@ -91,13 +108,15 @@ function useButtonStyles({
91
108
  label: {
92
109
  textAlign: 'center',
93
110
  includeFontPadding: false,
111
+ flexShrink: 1,
94
112
  },
95
113
  iconWrap: {
96
114
  flexDirection: 'row',
97
115
  alignItems: 'center',
116
+ flexShrink: 0,
98
117
  },
99
118
  }),
100
- [],
119
+ [tabLayout],
101
120
  );
102
121
  const typography: LumenTypographyTokenName = selected
103
122
  ? 'body2SemiBold'
@@ -114,6 +133,7 @@ export function SegmentedControl({
114
133
  children,
115
134
  disabled: disabledProp,
116
135
  appearance = 'background',
136
+ tabLayout = 'fixed',
117
137
  ...props
118
138
  }: SegmentedControlProps) {
119
139
  const disabled = useDisabledContext({
@@ -123,19 +143,28 @@ export function SegmentedControl({
123
143
  const styles = useRootStyles({
124
144
  disabled: Boolean(disabled),
125
145
  appearance,
146
+ tabLayout,
126
147
  });
127
148
  const selectedIndex = useSegmentedControlSelectedIndex(
128
149
  selectedValue,
129
150
  children,
130
151
  );
131
- const { onLayout, animatedPillStyle } = usePillLayout({
152
+ const { onLayout, animatedPillStyle, registerButtonLayout } = usePillLayout({
132
153
  selectedIndex,
154
+ selectedValue,
133
155
  children,
156
+ tabLayout,
134
157
  });
135
158
 
136
159
  return (
137
160
  <SegmentedControlContextProvider
138
- value={{ selectedValue, onSelectedChange, disabled }}
161
+ value={{
162
+ selectedValue,
163
+ onSelectedChange,
164
+ disabled,
165
+ tabLayout,
166
+ registerButtonLayout,
167
+ }}
139
168
  >
140
169
  <Box
141
170
  accessibilityRole='radiogroup'
@@ -160,9 +189,11 @@ SegmentedControl.displayName = 'SegmentedControl';
160
189
  function useRootStyles({
161
190
  disabled,
162
191
  appearance,
192
+ tabLayout,
163
193
  }: {
164
194
  disabled: boolean;
165
195
  appearance: 'background' | 'no-background';
196
+ tabLayout: 'fit' | 'fixed';
166
197
  }) {
167
198
  return useStyleSheet(
168
199
  (t) => ({
@@ -170,7 +201,9 @@ function useRootStyles({
170
201
  flexDirection: 'row',
171
202
  alignItems: 'center',
172
203
  position: 'relative',
173
- width: '100%',
204
+ ...(tabLayout === 'fixed'
205
+ ? { width: '100%' }
206
+ : { alignSelf: 'flex-start' }),
174
207
  borderRadius: t.borderRadius.md,
175
208
  backgroundColor:
176
209
  appearance === 'background' ? t.colors.bg.surface : 'transparent',
@@ -186,6 +219,6 @@ function useRootStyles({
186
219
  zIndex: 0,
187
220
  },
188
221
  }),
189
- [disabled, appearance],
222
+ [disabled, appearance, tabLayout],
190
223
  );
191
224
  }
@@ -1,9 +1,13 @@
1
1
  import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
2
2
 
3
+ export type ButtonLayout = { x: number; width: number };
4
+
3
5
  export type SegmentedControlContextValue = {
4
6
  selectedValue: string;
5
7
  onSelectedChange: (value: string) => void;
6
8
  disabled: boolean;
9
+ tabLayout: 'fit' | 'fixed';
10
+ registerButtonLayout: (value: string, layout: ButtonLayout) => void;
7
11
  };
8
12
 
9
13
  const [SegmentedControlContextProvider, _useSegmentedControlSafeContext] =
@@ -21,6 +21,13 @@ export type SegmentedControlProps = {
21
21
  * @default 'background'
22
22
  */
23
23
  appearance?: 'background' | 'no-background';
24
+ /**
25
+ * Controls how tab widths are calculated.
26
+ * - "fit": each tab sizes to its content
27
+ * - "fixed": all tabs share equal width, filling the container
28
+ * @default 'fixed'
29
+ */
30
+ tabLayout?: 'fit' | 'fixed';
24
31
  /**
25
32
  * Accessible label for the control (e.g. "File view").
26
33
  */
@@ -1,4 +1,12 @@
1
- import React, { useEffect, useMemo, useRef } from 'react';
1
+ import React, {
2
+ Children,
3
+ isValidElement,
4
+ ReactNode,
5
+ useCallback,
6
+ useEffect,
7
+ useMemo,
8
+ useRef,
9
+ } from 'react';
2
10
  import { LayoutChangeEvent } from 'react-native';
3
11
  import {
4
12
  useAnimatedStyle,
@@ -6,15 +14,16 @@ import {
6
14
  withTiming,
7
15
  } from 'react-native-reanimated';
8
16
  import { useTimingConfig } from '../../Animations/useTimingConfig';
17
+ import type { ButtonLayout } from './SegmentedControlContext';
9
18
 
10
19
  export function useSegmentedControlSelectedIndex(
11
20
  selectedValue: string,
12
- children: React.ReactNode,
21
+ children: ReactNode,
13
22
  ): number {
14
23
  return useMemo(
15
24
  () =>
16
- React.Children.toArray(children).findIndex((child) => {
17
- if (React.isValidElement(child) && child.props != null) {
25
+ Children.toArray(children).findIndex((child) => {
26
+ if (isValidElement(child) && child.props != null) {
18
27
  return (child.props as { value?: string }).value === selectedValue;
19
28
  }
20
29
  return false;
@@ -25,17 +34,22 @@ export function useSegmentedControlSelectedIndex(
25
34
 
26
35
  type UsePillLayoutParams = {
27
36
  selectedIndex: number;
37
+ selectedValue: string;
28
38
  children: React.ReactNode;
39
+ tabLayout: 'fit' | 'fixed';
29
40
  };
30
41
 
31
42
  export function usePillLayout({
32
43
  selectedIndex,
44
+ selectedValue,
33
45
  children,
46
+ tabLayout,
34
47
  }: UsePillLayoutParams) {
35
48
  const pillTranslateX = useSharedValue(0);
36
49
  const pillWidth = useSharedValue(0);
37
50
  const pillHeight = useSharedValue(0);
38
51
  const hasLayoutRef = useRef(false);
52
+ const buttonLayoutsRef = useRef(new Map<string, ButtonLayout>());
39
53
 
40
54
  const timingConfig = useTimingConfig({
41
55
  duration: 300,
@@ -44,29 +58,62 @@ export function usePillLayout({
44
58
 
45
59
  const onLayout = (e: LayoutChangeEvent): void => {
46
60
  const { width, height } = e.nativeEvent.layout;
47
- const count = React.Children.count(children);
48
- const slotWidth = count > 0 ? width / count : 0;
49
-
50
- pillWidth.value = slotWidth;
51
61
  pillHeight.value = height;
52
62
 
53
- if (!hasLayoutRef.current) {
54
- hasLayoutRef.current = true;
55
- if (selectedIndex >= 0) {
56
- pillTranslateX.value = selectedIndex * slotWidth;
63
+ if (tabLayout === 'fixed') {
64
+ const count = React.Children.count(children);
65
+ const slotWidth = count > 0 ? width / count : 0;
66
+ pillWidth.value = slotWidth;
67
+
68
+ if (!hasLayoutRef.current) {
69
+ hasLayoutRef.current = true;
70
+ if (selectedIndex >= 0) {
71
+ pillTranslateX.value = selectedIndex * slotWidth;
72
+ }
57
73
  }
58
74
  }
59
75
  };
60
76
 
77
+ const registerButtonLayout = useCallback(
78
+ (value: string, layout: ButtonLayout): void => {
79
+ buttonLayoutsRef.current.set(value, layout);
80
+
81
+ if (tabLayout === 'fit' && !hasLayoutRef.current) {
82
+ hasLayoutRef.current = true;
83
+ if (value === selectedValue) {
84
+ pillTranslateX.value = layout.x;
85
+ pillWidth.value = layout.width;
86
+ }
87
+ }
88
+ },
89
+ [tabLayout, selectedValue, pillTranslateX, pillWidth],
90
+ );
91
+
61
92
  useEffect(() => {
62
93
  if (!hasLayoutRef.current) return;
63
- if (selectedIndex >= 0 && pillWidth.value > 0) {
64
- pillTranslateX.value = withTiming(
65
- selectedIndex * pillWidth.value,
66
- timingConfig,
67
- );
94
+
95
+ if (tabLayout === 'fit') {
96
+ const layout = buttonLayoutsRef.current.get(selectedValue);
97
+ if (layout) {
98
+ pillTranslateX.value = withTiming(layout.x, timingConfig);
99
+ pillWidth.value = withTiming(layout.width, timingConfig);
100
+ }
101
+ } else {
102
+ if (selectedIndex >= 0 && pillWidth.value > 0) {
103
+ pillTranslateX.value = withTiming(
104
+ selectedIndex * pillWidth.value,
105
+ timingConfig,
106
+ );
107
+ }
68
108
  }
69
- }, [selectedIndex, pillWidth, pillTranslateX, timingConfig]);
109
+ }, [
110
+ selectedIndex,
111
+ selectedValue,
112
+ tabLayout,
113
+ pillWidth,
114
+ pillTranslateX,
115
+ timingConfig,
116
+ ]);
70
117
 
71
118
  const animatedPillStyle = useAnimatedStyle(
72
119
  () => ({
@@ -77,5 +124,5 @@ export function usePillLayout({
77
124
  [pillTranslateX, pillWidth, pillHeight],
78
125
  );
79
126
 
80
- return { onLayout, animatedPillStyle };
127
+ return { onLayout, animatedPillStyle, registerButtonLayout };
81
128
  }
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import { useCallback, useEffect } from 'react';
2
2
  import { Pressable } from 'react-native';
3
3
  import { useStyleSheet } from '../../../styles';
4
4
  import { Check } from '../../Symbols';
@@ -1,5 +1,5 @@
1
1
  import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
2
- import React, { useState, useRef, useMemo, ReactNode } from 'react';
2
+ import { useState, useRef, useMemo, ReactNode } from 'react';
3
3
  import { SelectData } from './types';
4
4
 
5
5
  type GlobalSelectBottomSheetContextValue = {
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, fireEvent } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import { GlobalSelectBottomSheet } from './GlobalSelectBottomSheet';
7
6
  import { GlobalSelectProvider } from './GlobalSelectContext';
@@ -1,5 +1,13 @@
1
1
  import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
2
- import React, { useState, useEffect, useCallback, useId } from 'react';
2
+ import {
3
+ useState,
4
+ useEffect,
5
+ useCallback,
6
+ useId,
7
+ Children,
8
+ isValidElement,
9
+ ReactNode,
10
+ } from 'react';
3
11
  import { StyleSheet, View } from 'react-native';
4
12
  import { useStyleSheet } from '../../../styles';
5
13
  import { ChevronDown } from '../../Symbols';
@@ -328,9 +336,9 @@ export const SelectContent = ({ children }: SelectContentProps) => {
328
336
  useEffect(() => {
329
337
  const items: SelectContentItem[] = [];
330
338
 
331
- const extractItems = (child: React.ReactNode): void => {
332
- React.Children.forEach(child, (element) => {
333
- if (!React.isValidElement(element)) return;
339
+ const extractItems = (child: ReactNode): void => {
340
+ Children.forEach(child, (element) => {
341
+ if (!isValidElement(element)) return;
334
342
 
335
343
  if (element.type === SelectItem) {
336
344
  const props = element.props as SelectItemProps;
@@ -344,12 +352,10 @@ export const SelectContent = ({ children }: SelectContentProps) => {
344
352
  disabled: props.disabled,
345
353
  });
346
354
  } else if (element.type === SelectGroup) {
347
- extractItems(
348
- (element.props as { children?: React.ReactNode }).children,
349
- );
355
+ extractItems((element.props as { children?: ReactNode }).children);
350
356
  } else if (element.type === SelectLabel) {
351
357
  const labelText = extractTextFromChildren(
352
- (element.props as { children?: React.ReactNode }).children,
358
+ (element.props as { children?: ReactNode }).children,
353
359
  SelectItemText,
354
360
  );
355
361
  items.push({
@@ -360,12 +366,8 @@ export const SelectContent = ({ children }: SelectContentProps) => {
360
366
  items.push({
361
367
  type: 'separator',
362
368
  });
363
- } else if (
364
- (element.props as { children?: React.ReactNode })?.children
365
- ) {
366
- extractItems(
367
- (element.props as { children?: React.ReactNode }).children,
368
- );
369
+ } else if ((element.props as { children?: ReactNode })?.children) {
370
+ extractItems((element.props as { children?: ReactNode }).children);
369
371
  }
370
372
  });
371
373
  };
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import { Skeleton } from './Skeleton';
7
6
 
@@ -27,6 +27,7 @@ const SlotPressable = ({
27
27
  const { children, ...pressableSlotProps } = props;
28
28
 
29
29
  if (!isValidElement(children)) {
30
+ // eslint-disable-next-line no-console
30
31
  console.error('Slot.Pressable - Invalid asChild element', children);
31
32
  return null;
32
33
  }
@@ -49,6 +50,7 @@ const SlotView = ({
49
50
  const { children, ...viewSlotProps } = props;
50
51
 
51
52
  if (!isValidElement(children)) {
53
+ // eslint-disable-next-line no-console
52
54
  console.error('Slot.View - Invalid asChild element', children);
53
55
  return null;
54
56
  }
@@ -71,6 +73,7 @@ const SlotText = ({
71
73
  const { children, ...textSlotProps } = props;
72
74
 
73
75
  if (!isValidElement(children)) {
76
+ // eslint-disable-next-line no-console
74
77
  console.error('Slot.Text - Invalid asChild element', children);
75
78
  return null;
76
79
  }
@@ -94,6 +97,7 @@ const SlotImage = ({ ref, ...props }: SlotImageSlotProps) => {
94
97
  const { children, ...imageSlotProps } = props;
95
98
 
96
99
  if (!isValidElement(children)) {
100
+ // eslint-disable-next-line no-console
97
101
  console.error('Slot.Image - Invalid asChild element', children);
98
102
  return null;
99
103
  }
@@ -69,7 +69,7 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
69
69
  Import and use the Spinner component:
70
70
 
71
71
  ```tsx
72
- import React, { useState } from 'react';
72
+ import { useState } from 'react';
73
73
  import { View } from 'react-native';
74
74
  import { Spinner } from '@ledgerhq/lumen-ui-rnative';
75
75
 
@@ -85,7 +85,6 @@ function MyComponent() {
85
85
  Spinners support predefined size variants that ensure consistent visual hierarchy:
86
86
 
87
87
  ```tsx
88
- import React from 'react';
89
88
  import { Box, Spinner } from '@ledgerhq/lumen-ui-rnative';
90
89
 
91
90
  function MyComponent() {
@@ -104,7 +103,6 @@ function MyComponent() {
104
103
  Use the `color` property with design token values to set spinner color.
105
104
 
106
105
  ```tsx
107
- import React from 'react';
108
106
  import { Spinner } from '@ledgerhq/lumen-ui-rnative';
109
107
 
110
108
  function MyComponent() {
@@ -1,5 +1,4 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import React from 'react';
3
2
  import { Settings, Plus, Heart, Star } from '../../Symbols';
4
3
  import { IconProps } from '../Icon';
5
4
  import { Box, Text } from '../Utility';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { ComponentType } from 'react';
2
2
  import { StyledViewProps } from '../../../styles';
3
3
  import { IconProps } from '../Icon';
4
4
 
@@ -20,7 +20,7 @@ type IconSpotProps = {
20
20
  /**
21
21
  * A React component to be rendered as the icon. Required when appearance is 'icon'.
22
22
  */
23
- icon: React.ComponentType<IconProps>;
23
+ icon: ComponentType<IconProps>;
24
24
  };
25
25
 
26
26
  type NumberSpotProps = {
@@ -87,7 +87,7 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
87
87
  Import and use the Stepper component:
88
88
 
89
89
  ```tsx
90
- import React, { useState } from 'react';
90
+ import { useState } from 'react';
91
91
  import { View } from 'react-native';
92
92
  import { Stepper } from '@ledgerhq/lumen-ui-rnative';
93
93
 
@@ -109,7 +109,6 @@ function OnboardingFlow() {
109
109
  Control the visual state based on step completion:
110
110
 
111
111
  ```tsx
112
- import React from 'react';
113
112
  import { Box, Stepper } from '@ledgerhq/lumen-ui-rnative';
114
113
 
115
114
  function MultiStepForm() {
@@ -128,7 +127,6 @@ function MultiStepForm() {
128
127
  Provide custom labels for localized or descriptive text:
129
128
 
130
129
  ```tsx
131
- import React from 'react';
132
130
  import { Stepper } from '@ledgerhq/lumen-ui-rnative';
133
131
 
134
132
  function LocalizedStepper() {
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import { Stepper } from './Stepper';
7
6
 
@@ -1,5 +1,4 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native';
2
- import React from 'react';
3
2
  import { View, Text } from 'react-native';
4
3
  import { Link } from '../Link';
5
4
  import { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip';
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, screen, fireEvent } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import {
7
6
  Subheader,
@@ -1,5 +1,5 @@
1
1
  import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
2
- import React, { useCallback, useEffect } from 'react';
2
+ import { useCallback, useEffect } from 'react';
3
3
  import {
4
4
  Pressable,
5
5
  StyleSheet,
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, fireEvent, waitFor } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
5
  import { Switch } from './Switch';
7
6
 
@@ -1,7 +1,6 @@
1
1
  import { describe, it, expect, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, fireEvent } from '@testing-library/react-native';
4
- import React from 'react';
5
4
  import { HomeFill, Settings, BasketPutIn } from '../../Symbols';
6
5
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
7
6
  import { TabBar, TabBarItem } from './TabBar';
@@ -1,5 +1,12 @@
1
1
  import { BlurView } from '@sbaiahmed1/react-native-blur';
2
- import React, { useCallback, useEffect, useRef } from 'react';
2
+ import {
3
+ Children,
4
+ isValidElement,
5
+ ReactNode,
6
+ useCallback,
7
+ useEffect,
8
+ useRef,
9
+ } from 'react';
3
10
  import {
4
11
  LayoutChangeEvent,
5
12
  Platform,
@@ -98,7 +105,7 @@ const useTabBarPillLayout = ({
98
105
  children,
99
106
  }: {
100
107
  active: string;
101
- children: React.ReactNode;
108
+ children: ReactNode;
102
109
  }) => {
103
110
  const pillProgress = useSharedValue(0);
104
111
  const itemWidth = useSharedValue(0);
@@ -111,8 +118,8 @@ const useTabBarPillLayout = ({
111
118
  });
112
119
 
113
120
  const getActiveIndex = useCallback((): number => {
114
- return React.Children.toArray(children).findIndex((child) => {
115
- if (React.isValidElement<TabBarItemProps>(child)) {
121
+ return Children.toArray(children).findIndex((child) => {
122
+ if (isValidElement<TabBarItemProps>(child)) {
116
123
  return child.props.value === active;
117
124
  }
118
125
  return false;
@@ -121,7 +128,7 @@ const useTabBarPillLayout = ({
121
128
 
122
129
  const onLayout = (e: LayoutChangeEvent): void => {
123
130
  const { width, height } = e.nativeEvent.layout;
124
- const count = React.Children.count(children);
131
+ const count = Children.count(children);
125
132
  const slotWidth = (width - PILL_INSET * 2) / count;
126
133
 
127
134
  itemWidth.value = slotWidth;
@@ -47,6 +47,12 @@ Tags can be displayed with or without an icon.
47
47
 
48
48
  <Canvas of={TagStories.ContentTypeShowcase} />
49
49
 
50
+ ### Truncation
51
+
52
+ When a tag's label exceeds the available space, the text is automatically truncated with an ellipsis.
53
+
54
+ <Canvas of={TagStories.TruncateShowcase} />
55
+
50
56
  ### Accessibility
51
57
 
52
58
  To be implemented:
@@ -82,3 +82,11 @@ export const ContentTypeShowcase: Story = {
82
82
  </Box>
83
83
  ),
84
84
  };
85
+
86
+ export const TruncateShowcase: Story = {
87
+ render: () => (
88
+ <Box lx={{ width: 's176' }}>
89
+ <Tag label='Very long custom Tag text that should truncate' />
90
+ </Box>
91
+ ),
92
+ };
@@ -155,7 +155,9 @@ export const Tag = ({
155
155
  {...props}
156
156
  >
157
157
  {IconComponent && <IconComponent size={iconSize} style={styles.icon} />}
158
- <Text style={styles.text}>{label}</Text>
158
+ <Text style={styles.text} numberOfLines={1}>
159
+ {label}
160
+ </Text>
159
161
  </Box>
160
162
  );
161
163
  };
@@ -1,5 +1,4 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import React from 'react';
3
2
  import { Settings, Plus, User, Apps, ChevronRight } from '../../Symbols';
4
3
  import { Spot } from '../Spot';
5
4
  import { Tag } from '../Tag/Tag';