@ledgerhq/lumen-ui-rnative 0.1.14 → 0.1.16

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 (362) 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/AddressInput/AddressInput.js +21 -10
  8. package/dist/module/lib/Components/AddressInput/AddressInput.js.map +1 -1
  9. package/dist/module/lib/Components/AddressInput/AddressInput.mdx +18 -2
  10. package/dist/module/lib/Components/AddressInput/AddressInput.stories.js +1 -23
  11. package/dist/module/lib/Components/AddressInput/AddressInput.stories.js.map +1 -1
  12. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js +0 -1
  13. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.test.js.map +1 -1
  14. package/dist/module/lib/Components/AmountInput/AmountInput.js +7 -6
  15. package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
  16. package/dist/module/lib/Components/AmountInput/AmountInput.mdx +5 -1
  17. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +1 -36
  18. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
  19. package/dist/module/lib/Components/Avatar/Avatar.figma.js +26 -0
  20. package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -0
  21. package/dist/module/lib/Components/Avatar/Avatar.stories.js +0 -1
  22. package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
  23. package/dist/module/lib/Components/Avatar/Avatar.test.js +0 -1
  24. package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
  25. package/dist/module/lib/Components/Banner/Banner.stories.js +3 -3
  26. package/dist/module/lib/Components/Banner/Banner.stories.js.map +1 -1
  27. package/dist/module/lib/Components/Banner/Banner.test.js +0 -1
  28. package/dist/module/lib/Components/Banner/Banner.test.js.map +1 -1
  29. package/dist/module/lib/Components/BaseInput/BaseInput.js +54 -48
  30. package/dist/module/lib/Components/BaseInput/BaseInput.js.map +1 -1
  31. package/dist/module/lib/Components/BottomSheet/BottomSheet.js +1 -1
  32. package/dist/module/lib/Components/BottomSheet/BottomSheet.js.map +1 -1
  33. package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js +0 -1
  34. package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js.map +1 -1
  35. package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js +0 -2
  36. package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js.map +1 -1
  37. package/dist/module/lib/Components/BottomSheet/CustomHandle.js +0 -1
  38. package/dist/module/lib/Components/BottomSheet/CustomHandle.js.map +1 -1
  39. package/dist/module/lib/Components/Button/BaseButton.test.js +0 -1
  40. package/dist/module/lib/Components/Button/BaseButton.test.js.map +1 -1
  41. package/dist/module/lib/Components/Button/Button.stories.js +2 -2
  42. package/dist/module/lib/Components/Button/Button.stories.js.map +1 -1
  43. package/dist/module/lib/Components/Card/Card.js +3 -3
  44. package/dist/module/lib/Components/Card/Card.js.map +1 -1
  45. package/dist/module/lib/Components/Card/Card.test.js +0 -1
  46. package/dist/module/lib/Components/Card/Card.test.js.map +1 -1
  47. package/dist/module/lib/Components/CardButton/CardButton.test.js +0 -1
  48. package/dist/module/lib/Components/CardButton/CardButton.test.js.map +1 -1
  49. package/dist/module/lib/Components/Checkbox/BaseCheckbox.js +1 -1
  50. package/dist/module/lib/Components/Checkbox/BaseCheckbox.js.map +1 -1
  51. package/dist/module/lib/Components/Checkbox/Checkbox.test.js +0 -1
  52. package/dist/module/lib/Components/Checkbox/Checkbox.test.js.map +1 -1
  53. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js +2 -2
  54. package/dist/module/lib/Components/ContentBanner/ContentBanner.stories.js.map +1 -1
  55. package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js +0 -1
  56. package/dist/module/lib/Components/ContentBanner/ContentBanner.test.js.map +1 -1
  57. package/dist/module/lib/Components/Divider/Divider.test.js +0 -1
  58. package/dist/module/lib/Components/Divider/Divider.test.js.map +1 -1
  59. package/dist/module/lib/Components/Icon/Icon.js +2 -1
  60. package/dist/module/lib/Components/Icon/Icon.js.map +1 -1
  61. package/dist/module/lib/Components/Icon/Icon.test.js +0 -1
  62. package/dist/module/lib/Components/Icon/Icon.test.js.map +1 -1
  63. package/dist/module/lib/Components/Icon/createIcon.js +4 -2
  64. package/dist/module/lib/Components/Icon/createIcon.js.map +1 -1
  65. package/dist/module/lib/Components/IconButton/IconButton.test.js +0 -1
  66. package/dist/module/lib/Components/IconButton/IconButton.test.js.map +1 -1
  67. package/dist/module/lib/Components/Link/Link.test.js +3 -3
  68. package/dist/module/lib/Components/Link/Link.test.js.map +1 -1
  69. package/dist/module/lib/Components/ListItem/ListItem.js +64 -179
  70. package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
  71. package/dist/module/lib/Components/ListItem/ListItem.mdx +53 -49
  72. package/dist/module/lib/Components/ListItem/ListItem.stories.js +65 -59
  73. package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
  74. package/dist/module/lib/Components/MediaImage/MediaImage.js +102 -0
  75. package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -0
  76. package/dist/module/lib/Components/MediaImage/MediaImage.mdx +103 -0
  77. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +91 -0
  78. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -0
  79. package/dist/module/lib/Components/MediaImage/MediaImage.test.js +204 -0
  80. package/dist/module/lib/Components/MediaImage/MediaImage.test.js.map +1 -0
  81. package/dist/module/lib/Components/MediaImage/index.js +5 -0
  82. package/dist/module/lib/Components/MediaImage/index.js.map +1 -0
  83. package/dist/module/lib/Components/MediaImage/types.js +4 -0
  84. package/dist/module/lib/Components/MediaImage/types.js.map +1 -0
  85. package/dist/module/lib/Components/NavBar/NavBar.js +3 -3
  86. package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
  87. package/dist/module/lib/Components/NavBar/NavBar.test.js +0 -1
  88. package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
  89. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +2 -2
  90. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
  91. package/dist/module/lib/Components/SearchInput/SearchInput.js +11 -2
  92. package/dist/module/lib/Components/SearchInput/SearchInput.js.map +1 -1
  93. package/dist/module/lib/Components/SearchInput/SearchInput.mdx +14 -2
  94. package/dist/module/lib/Components/SearchInput/SearchInput.stories.js +1 -19
  95. package/dist/module/lib/Components/SearchInput/SearchInput.stories.js.map +1 -1
  96. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +46 -14
  97. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
  98. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
  99. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js +90 -64
  100. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.stories.js.map +1 -1
  101. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js +0 -1
  102. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.test.js.map +1 -1
  103. package/dist/module/lib/Components/SegmentedControl/SegmentedControlContext.js.map +1 -1
  104. package/dist/module/lib/Components/SegmentedControl/usePillLayout.js +40 -16
  105. package/dist/module/lib/Components/SegmentedControl/usePillLayout.js.map +1 -1
  106. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +1 -1
  107. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +1 -1
  108. package/dist/module/lib/Components/Select/GlobalSelectContext.js +1 -1
  109. package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +1 -1
  110. package/dist/module/lib/Components/Select/Select.js +3 -3
  111. package/dist/module/lib/Components/Select/Select.js.map +1 -1
  112. package/dist/module/lib/Components/Select/Select.test.js +0 -1
  113. package/dist/module/lib/Components/Select/Select.test.js.map +1 -1
  114. package/dist/module/lib/Components/Skeleton/Skeleton.test.js +0 -1
  115. package/dist/module/lib/Components/Skeleton/Skeleton.test.js.map +1 -1
  116. package/dist/module/lib/Components/Slot/Slot.js +4 -0
  117. package/dist/module/lib/Components/Slot/Slot.js.map +1 -1
  118. package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -3
  119. package/dist/module/lib/Components/Spot/Spot.stories.js +0 -1
  120. package/dist/module/lib/Components/Spot/Spot.stories.js.map +1 -1
  121. package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -3
  122. package/dist/module/lib/Components/Stepper/Stepper.test.js +0 -1
  123. package/dist/module/lib/Components/Stepper/Stepper.test.js.map +1 -1
  124. package/dist/module/lib/Components/Subheader/Subheader.stories.js +0 -1
  125. package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
  126. package/dist/module/lib/Components/Subheader/Subheader.test.js +0 -1
  127. package/dist/module/lib/Components/Subheader/Subheader.test.js.map +1 -1
  128. package/dist/module/lib/Components/Switch/BaseSwitch.js +1 -1
  129. package/dist/module/lib/Components/Switch/BaseSwitch.js.map +1 -1
  130. package/dist/module/lib/Components/Switch/Switch.test.js +0 -1
  131. package/dist/module/lib/Components/Switch/Switch.test.js.map +1 -1
  132. package/dist/module/lib/Components/TabBar/TabBar.js +8 -8
  133. package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
  134. package/dist/module/lib/Components/TabBar/TabBar.test.js +0 -1
  135. package/dist/module/lib/Components/TabBar/TabBar.test.js.map +1 -1
  136. package/dist/module/lib/Components/TextInput/TextInput.mdx +14 -2
  137. package/dist/module/lib/Components/TextInput/TextInput.stories.js +1 -28
  138. package/dist/module/lib/Components/TextInput/TextInput.stories.js.map +1 -1
  139. package/dist/module/lib/Components/Tile/Tile.stories.js +0 -1
  140. package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
  141. package/dist/module/lib/Components/Tile/Tile.test.js +0 -1
  142. package/dist/module/lib/Components/Tile/Tile.test.js.map +1 -1
  143. package/dist/module/lib/Components/TileButton/TileButton.test.js +0 -1
  144. package/dist/module/lib/Components/TileButton/TileButton.test.js.map +1 -1
  145. package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js +1 -1
  146. package/dist/module/lib/Components/Tooltip/GlobalTooltipBottomSheet.js.map +1 -1
  147. package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js +1 -1
  148. package/dist/module/lib/Components/Tooltip/GlobalTooltipContext.js.map +1 -1
  149. package/dist/module/lib/Components/Tooltip/Tooltip.test.js +0 -1
  150. package/dist/module/lib/Components/Tooltip/Tooltip.test.js.map +1 -1
  151. package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js +1 -1
  152. package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js.map +1 -1
  153. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
  154. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js +1 -1
  155. package/dist/module/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.js.map +1 -1
  156. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js +1 -1
  157. package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.js.map +1 -1
  158. package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js +1 -1
  159. package/dist/module/lib/Components/Utility/Pressable/Pressable.test.js.map +1 -1
  160. package/dist/module/lib/Components/index.js +1 -0
  161. package/dist/module/lib/Components/index.js.map +1 -1
  162. package/dist/module/lib/utils/react/extractTextFromChildren.js +3 -3
  163. package/dist/module/lib/utils/react/extractTextFromChildren.js.map +1 -1
  164. package/dist/module/lib/utils/useControllableState/useControllableState.js +5 -5
  165. package/dist/module/lib/utils/useControllableState/useControllableState.js.map +1 -1
  166. package/dist/module/lib/utils/useEvent/useGet.js +3 -3
  167. package/dist/module/lib/utils/useEvent/useGet.js.map +1 -1
  168. package/dist/module/styles/hooks/useStyleSheet.test.js +1 -1
  169. package/dist/module/styles/hooks/useStyleSheet.test.js.map +1 -1
  170. package/dist/module/styles/lx/createStyledPressable.test.js +1 -1
  171. package/dist/module/styles/lx/createStyledPressable.test.js.map +1 -1
  172. package/dist/module/styles/lx/createStyledText.test.js +1 -1
  173. package/dist/module/styles/lx/createStyledText.test.js.map +1 -1
  174. package/dist/module/styles/lx/createStyledView.test.js +1 -1
  175. package/dist/module/styles/lx/createStyledView.test.js.map +1 -1
  176. package/dist/module/styles/lx/resolveStyle.test.js +0 -1
  177. package/dist/module/styles/lx/resolveStyle.test.js.map +1 -1
  178. package/dist/module/styles/provider/LumenStyleSheetProvider.test.js +2 -4
  179. package/dist/module/styles/provider/LumenStyleSheetProvider.test.js.map +1 -1
  180. package/dist/module/utils/icon-template.js +3 -0
  181. package/dist/module/utils/icon-template.js.map +1 -1
  182. package/dist/typescript/src/i18n/i18n.d.ts.map +1 -1
  183. package/dist/typescript/src/index.d.ts +0 -1
  184. package/dist/typescript/src/index.d.ts.map +1 -1
  185. package/dist/typescript/src/lib/Animations/Spin/Spin.d.ts.map +1 -1
  186. package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts +1 -1
  187. package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts.map +1 -1
  188. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  189. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  190. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +7 -0
  191. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
  192. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts +2 -0
  193. package/dist/typescript/src/lib/Components/Avatar/Avatar.figma.d.ts.map +1 -0
  194. package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts +1 -1
  195. package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  196. package/dist/typescript/src/lib/Components/BaseInput/types.d.ts +7 -0
  197. package/dist/typescript/src/lib/Components/BaseInput/types.d.ts.map +1 -1
  198. package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts +0 -1
  199. package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts.map +1 -1
  200. package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts +1 -1
  201. package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts.map +1 -1
  202. package/dist/typescript/src/lib/Components/Card/Card.d.ts.map +1 -1
  203. package/dist/typescript/src/lib/Components/CardButton/types.d.ts +0 -1
  204. package/dist/typescript/src/lib/Components/CardButton/types.d.ts.map +1 -1
  205. package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts +0 -1
  206. package/dist/typescript/src/lib/Components/ContentBanner/types.d.ts.map +1 -1
  207. package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts +1 -2
  208. package/dist/typescript/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  209. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +21 -40
  210. package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  211. package/dist/typescript/src/lib/Components/ListItem/types.d.ts +10 -37
  212. package/dist/typescript/src/lib/Components/ListItem/types.d.ts.map +1 -1
  213. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +18 -0
  214. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -0
  215. package/dist/typescript/src/lib/Components/MediaImage/index.d.ts +3 -0
  216. package/dist/typescript/src/lib/Components/MediaImage/index.d.ts.map +1 -0
  217. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +25 -0
  218. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -0
  219. package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts +1 -1
  220. package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
  221. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  222. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  223. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +6 -0
  224. package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  225. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts +7 -0
  226. package/dist/typescript/src/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  227. package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts +7 -3
  228. package/dist/typescript/src/lib/Components/SegmentedControl/usePillLayout.d.ts.map +1 -1
  229. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -1
  230. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
  231. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +1 -1
  232. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +1 -1
  233. package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +1 -1
  234. package/dist/typescript/src/lib/Components/Slot/Slot.d.ts.map +1 -1
  235. package/dist/typescript/src/lib/Components/Spot/types.d.ts +2 -2
  236. package/dist/typescript/src/lib/Components/Spot/types.d.ts.map +1 -1
  237. package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts +0 -1
  238. package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts.map +1 -1
  239. package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
  240. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts +0 -1
  241. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.d.ts.map +1 -1
  242. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts +1 -1
  243. package/dist/typescript/src/lib/Components/Tooltip/GlobalTooltipContext.d.ts.map +1 -1
  244. package/dist/typescript/src/lib/Components/index.d.ts +1 -0
  245. package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
  246. package/dist/typescript/src/lib/types/index.d.ts +6 -6
  247. package/dist/typescript/src/lib/types/index.d.ts.map +1 -1
  248. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts +2 -2
  249. package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -1
  250. package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts +3 -3
  251. package/dist/typescript/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -1
  252. package/dist/typescript/src/utils/icon-template.d.ts.map +1 -1
  253. package/package.json +2 -2
  254. package/src/i18n/i18n.ts +2 -0
  255. package/src/index.ts +0 -1
  256. package/src/lib/Animations/Spin/Spin.tsx +5 -1
  257. package/src/lib/Components/AddressInput/AddressInput.mdx +18 -2
  258. package/src/lib/Components/AddressInput/AddressInput.stories.tsx +1 -23
  259. package/src/lib/Components/AddressInput/AddressInput.tsx +15 -7
  260. package/src/lib/Components/AmountDisplay/AmountDisplay.test.tsx +0 -1
  261. package/src/lib/Components/AmountInput/AmountInput.mdx +5 -1
  262. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +1 -36
  263. package/src/lib/Components/AmountInput/AmountInput.tsx +4 -3
  264. package/src/lib/Components/AmountInput/types.ts +7 -0
  265. package/src/lib/Components/Avatar/Avatar.figma.tsx +29 -0
  266. package/src/lib/Components/Avatar/Avatar.stories.tsx +0 -1
  267. package/src/lib/Components/Avatar/Avatar.test.tsx +0 -1
  268. package/src/lib/Components/Banner/Banner.stories.tsx +3 -3
  269. package/src/lib/Components/Banner/Banner.test.tsx +0 -1
  270. package/src/lib/Components/BaseInput/BaseInput.tsx +66 -60
  271. package/src/lib/Components/BaseInput/types.ts +7 -0
  272. package/src/lib/Components/BottomSheet/BottomSheet.test.tsx +0 -1
  273. package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
  274. package/src/lib/Components/BottomSheet/CustomBackdrop.tsx +0 -2
  275. package/src/lib/Components/BottomSheet/CustomHandle.tsx +1 -1
  276. package/src/lib/Components/Button/BaseButton.test.tsx +0 -1
  277. package/src/lib/Components/Button/Button.stories.tsx +2 -2
  278. package/src/lib/Components/Card/Card.test.tsx +0 -1
  279. package/src/lib/Components/Card/Card.tsx +3 -2
  280. package/src/lib/Components/CardButton/CardButton.test.tsx +0 -1
  281. package/src/lib/Components/CardButton/types.ts +0 -1
  282. package/src/lib/Components/Checkbox/BaseCheckbox.tsx +1 -1
  283. package/src/lib/Components/Checkbox/Checkbox.test.tsx +0 -1
  284. package/src/lib/Components/ContentBanner/ContentBanner.stories.tsx +2 -2
  285. package/src/lib/Components/ContentBanner/ContentBanner.test.tsx +0 -1
  286. package/src/lib/Components/ContentBanner/types.ts +0 -1
  287. package/src/lib/Components/Divider/Divider.test.tsx +0 -1
  288. package/src/lib/Components/Icon/Icon.test.tsx +0 -1
  289. package/src/lib/Components/Icon/Icon.tsx +1 -1
  290. package/src/lib/Components/Icon/createIcon.ts +3 -2
  291. package/src/lib/Components/IconButton/IconButton.test.tsx +0 -1
  292. package/src/lib/Components/Link/Link.test.tsx +3 -3
  293. package/src/lib/Components/ListItem/ListItem.mdx +53 -49
  294. package/src/lib/Components/ListItem/ListItem.stories.tsx +51 -54
  295. package/src/lib/Components/ListItem/ListItem.tsx +80 -210
  296. package/src/lib/Components/ListItem/types.ts +10 -41
  297. package/src/lib/Components/MediaImage/MediaImage.mdx +103 -0
  298. package/src/lib/Components/MediaImage/MediaImage.stories.tsx +55 -0
  299. package/src/lib/Components/MediaImage/MediaImage.test.tsx +179 -0
  300. package/src/lib/Components/MediaImage/MediaImage.tsx +117 -0
  301. package/src/lib/Components/MediaImage/index.ts +2 -0
  302. package/src/lib/Components/MediaImage/types.ts +27 -0
  303. package/src/lib/Components/NavBar/NavBar.test.tsx +0 -1
  304. package/src/lib/Components/NavBar/NavBar.tsx +3 -3
  305. package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +2 -2
  306. package/src/lib/Components/SearchInput/SearchInput.mdx +14 -2
  307. package/src/lib/Components/SearchInput/SearchInput.stories.tsx +1 -19
  308. package/src/lib/Components/SearchInput/SearchInput.tsx +8 -1
  309. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +0 -1
  310. package/src/lib/Components/SegmentedControl/SegmentedControl.stories.tsx +77 -51
  311. package/src/lib/Components/SegmentedControl/SegmentedControl.test.tsx +0 -1
  312. package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +42 -9
  313. package/src/lib/Components/SegmentedControl/SegmentedControlContext.tsx +4 -0
  314. package/src/lib/Components/SegmentedControl/types.ts +7 -0
  315. package/src/lib/Components/SegmentedControl/usePillLayout.ts +66 -19
  316. package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +1 -1
  317. package/src/lib/Components/Select/GlobalSelectContext.tsx +1 -1
  318. package/src/lib/Components/Select/Select.test.tsx +0 -1
  319. package/src/lib/Components/Select/Select.tsx +16 -14
  320. package/src/lib/Components/Skeleton/Skeleton.test.tsx +0 -1
  321. package/src/lib/Components/Slot/Slot.tsx +4 -0
  322. package/src/lib/Components/Spinner/Spinner.mdx +1 -3
  323. package/src/lib/Components/Spot/Spot.stories.tsx +0 -1
  324. package/src/lib/Components/Spot/types.ts +2 -2
  325. package/src/lib/Components/Stepper/Stepper.mdx +1 -3
  326. package/src/lib/Components/Stepper/Stepper.test.tsx +0 -1
  327. package/src/lib/Components/Subheader/Subheader.stories.tsx +0 -1
  328. package/src/lib/Components/Subheader/Subheader.test.tsx +0 -1
  329. package/src/lib/Components/Switch/BaseSwitch.tsx +1 -1
  330. package/src/lib/Components/Switch/Switch.test.tsx +0 -1
  331. package/src/lib/Components/TabBar/TabBar.test.tsx +0 -1
  332. package/src/lib/Components/TabBar/TabBar.tsx +12 -5
  333. package/src/lib/Components/TextInput/TextInput.mdx +14 -2
  334. package/src/lib/Components/TextInput/TextInput.stories.tsx +1 -28
  335. package/src/lib/Components/Tile/Tile.stories.tsx +0 -1
  336. package/src/lib/Components/Tile/Tile.test.tsx +0 -1
  337. package/src/lib/Components/TileButton/TileButton.test.tsx +0 -1
  338. package/src/lib/Components/Tooltip/GlobalTooltipBottomSheet.tsx +1 -1
  339. package/src/lib/Components/Tooltip/GlobalTooltipContext.tsx +1 -7
  340. package/src/lib/Components/Tooltip/Tooltip.test.tsx +0 -1
  341. package/src/lib/Components/TriggerButton/TriggerButton.test.tsx +1 -1
  342. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +1 -1
  343. package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.tsx +1 -1
  344. package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.tsx +1 -1
  345. package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +1 -1
  346. package/src/lib/Components/index.ts +1 -0
  347. package/src/lib/types/index.ts +7 -7
  348. package/src/lib/utils/react/extractTextFromChildren.ts +4 -4
  349. package/src/lib/utils/useControllableState/useControllableState.ts +7 -9
  350. package/src/lib/utils/useEvent/useGet.ts +3 -3
  351. package/src/styles/hooks/useStyleSheet.test.tsx +1 -1
  352. package/src/styles/lx/createStyledPressable.test.tsx +1 -1
  353. package/src/styles/lx/createStyledText.test.tsx +1 -1
  354. package/src/styles/lx/createStyledView.test.tsx +1 -1
  355. package/src/styles/lx/resolveStyle.test.tsx +0 -1
  356. package/src/styles/provider/LumenStyleSheetProvider.test.tsx +2 -2
  357. package/src/utils/icon-template.ts +2 -0
  358. package/dist/module/lib/Patterns/index.js +0 -4
  359. package/dist/module/lib/Patterns/index.js.map +0 -1
  360. package/dist/typescript/src/lib/Patterns/index.d.ts +0 -3
  361. package/dist/typescript/src/lib/Patterns/index.d.ts.map +0 -1
  362. package/src/lib/Patterns/index.ts +0 -1
@@ -0,0 +1,179 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
+ import { render, waitFor } from '@testing-library/react-native';
4
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
5
+ import { MediaImage } from './MediaImage';
6
+
7
+ const { sizes, borderRadius } = ledgerLiveThemes.dark;
8
+
9
+ const TestWrapper = ({ children }: { children: React.ReactNode }) => (
10
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
11
+ {children}
12
+ </ThemeProvider>
13
+ );
14
+
15
+ describe('MediaImage Component', () => {
16
+ const validSrc = 'https://crypto-icons.ledger.com/ADA.png';
17
+
18
+ it('should render with image when valid src is provided', () => {
19
+ const { getByTestId } = render(
20
+ <TestWrapper>
21
+ <MediaImage src={validSrc} alt='Cardano' />
22
+ </TestWrapper>,
23
+ );
24
+
25
+ const img = getByTestId('media-image-img');
26
+ expect(img.props.source).toEqual({ uri: validSrc });
27
+ });
28
+
29
+ it('should render fallback when no src is provided', () => {
30
+ const { queryByTestId } = render(
31
+ <TestWrapper>
32
+ <MediaImage alt='Empty' />
33
+ </TestWrapper>,
34
+ );
35
+
36
+ expect(queryByTestId('media-image-img')).toBeNull();
37
+ });
38
+
39
+ it('should render fallback when src is empty string', () => {
40
+ const { queryByTestId } = render(
41
+ <TestWrapper>
42
+ <MediaImage src='' alt='Empty' />
43
+ </TestWrapper>,
44
+ );
45
+
46
+ expect(queryByTestId('media-image-img')).toBeNull();
47
+ });
48
+
49
+ it('should render fallback when image fails to load', async () => {
50
+ const { getByTestId, queryByTestId, rerender } = render(
51
+ <TestWrapper>
52
+ <MediaImage src='https://broken-link.com/404.png' alt='Broken' />
53
+ </TestWrapper>,
54
+ );
55
+
56
+ const img = getByTestId('media-image-img');
57
+ img.props.onError();
58
+
59
+ rerender(
60
+ <TestWrapper>
61
+ <MediaImage src='https://broken-link.com/404.png' alt='Broken' />
62
+ </TestWrapper>,
63
+ );
64
+
65
+ await waitFor(() => {
66
+ expect(queryByTestId('media-image-img')).toBeNull();
67
+ });
68
+ });
69
+
70
+ it('should reset error state when src changes', async () => {
71
+ const { getByTestId, rerender } = render(
72
+ <TestWrapper>
73
+ <MediaImage src='https://broken-link.com/404.png' alt='Test' />
74
+ </TestWrapper>,
75
+ );
76
+
77
+ const img = getByTestId('media-image-img');
78
+ img.props.onError();
79
+
80
+ rerender(
81
+ <TestWrapper>
82
+ <MediaImage src={validSrc} alt='Test' />
83
+ </TestWrapper>,
84
+ );
85
+
86
+ await waitFor(() => {
87
+ const newImg = getByTestId('media-image-img');
88
+ expect(newImg.props.source).toEqual({ uri: validSrc });
89
+ });
90
+ });
91
+
92
+ it('should apply default size (48)', () => {
93
+ const { getByTestId } = render(
94
+ <TestWrapper>
95
+ <MediaImage testID='mi' src={validSrc} alt='Test' />
96
+ </TestWrapper>,
97
+ );
98
+
99
+ const root = getByTestId('mi');
100
+ expect(root.props.style.width).toBe(sizes.s48);
101
+ expect(root.props.style.height).toBe(sizes.s48);
102
+ });
103
+
104
+ it('should apply specified size', () => {
105
+ const { getByTestId } = render(
106
+ <TestWrapper>
107
+ <MediaImage testID='mi' src={validSrc} alt='Test' size={24} />
108
+ </TestWrapper>,
109
+ );
110
+
111
+ const root = getByTestId('mi');
112
+ expect(root.props.style.width).toBe(sizes.s24);
113
+ expect(root.props.style.height).toBe(sizes.s24);
114
+ });
115
+
116
+ it('should apply circle shape', () => {
117
+ const { getByTestId } = render(
118
+ <TestWrapper>
119
+ <MediaImage testID='mi' src={validSrc} alt='Test' shape='circle' />
120
+ </TestWrapper>,
121
+ );
122
+
123
+ const root = getByTestId('mi');
124
+ expect(root.props.style.borderRadius).toBe(borderRadius.full);
125
+ });
126
+
127
+ it('should apply square shape with correct border radius', () => {
128
+ const { getByTestId } = render(
129
+ <TestWrapper>
130
+ <MediaImage
131
+ testID='mi'
132
+ src={validSrc}
133
+ alt='Test'
134
+ size={48}
135
+ shape='square'
136
+ />
137
+ </TestWrapper>,
138
+ );
139
+
140
+ const root = getByTestId('mi');
141
+ expect(root.props.style.borderRadius).toBe(borderRadius.md);
142
+ });
143
+
144
+ it('should set accessibility label from alt prop', () => {
145
+ const { getByLabelText } = render(
146
+ <TestWrapper>
147
+ <MediaImage src={validSrc} alt='Cardano icon' />
148
+ </TestWrapper>,
149
+ );
150
+
151
+ expect(getByLabelText('Cardano icon')).toBeTruthy();
152
+ });
153
+
154
+ it('should apply custom styles', () => {
155
+ const { getByTestId } = render(
156
+ <TestWrapper>
157
+ <MediaImage
158
+ testID='mi'
159
+ src={validSrc}
160
+ alt='Test'
161
+ style={{ borderWidth: 2 }}
162
+ />
163
+ </TestWrapper>,
164
+ );
165
+
166
+ const root = getByTestId('mi');
167
+ expect(root.props.style.borderWidth).toBe(2);
168
+ });
169
+
170
+ it('should pass additional props', () => {
171
+ const { getByTestId } = render(
172
+ <TestWrapper>
173
+ <MediaImage testID='custom-id' src={validSrc} alt='Test' />
174
+ </TestWrapper>,
175
+ );
176
+
177
+ expect(getByTestId('custom-id')).toBeTruthy();
178
+ });
179
+ });
@@ -0,0 +1,117 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { Image, StyleSheet } from 'react-native';
3
+ import { useStyleSheet } from '../../../styles';
4
+ import { Box } from '../Utility';
5
+ import { MediaImageProps, MediaImageSize, MediaImageShape } from './types';
6
+
7
+ type BorderRadiusKey = 'xs' | 'sm' | 'md' | 'lg' | 'full';
8
+
9
+ const borderRadiusMap: Record<MediaImageSize, BorderRadiusKey> = {
10
+ 12: 'xs',
11
+ 16: 'xs',
12
+ 20: 'xs',
13
+ 24: 'sm',
14
+ 32: 'sm',
15
+ 40: 'md',
16
+ 48: 'md',
17
+ 56: 'lg',
18
+ };
19
+
20
+ export const mediaImageDotSizeMap: Record<MediaImageSize, number> = {
21
+ 12: 8,
22
+ 16: 8,
23
+ 20: 8,
24
+ 24: 10,
25
+ 32: 12,
26
+ 40: 16,
27
+ 48: 20,
28
+ 56: 24,
29
+ } as const;
30
+
31
+ const useStyles = ({
32
+ size,
33
+ shape,
34
+ }: {
35
+ size: MediaImageSize;
36
+ shape: MediaImageShape;
37
+ }) => {
38
+ return useStyleSheet(
39
+ (t) => {
40
+ const sizeValue = t.sizes[`s${size}` as keyof typeof t.sizes] as number;
41
+ const radius =
42
+ shape === 'circle'
43
+ ? t.borderRadius.full
44
+ : t.borderRadius[borderRadiusMap[size]];
45
+
46
+ return {
47
+ root: {
48
+ width: sizeValue,
49
+ height: sizeValue,
50
+ borderRadius: radius,
51
+ overflow: 'hidden' as const,
52
+ alignItems: 'center' as const,
53
+ justifyContent: 'center' as const,
54
+ backgroundColor: t.colors.bg.mutedTransparent,
55
+ },
56
+ image: {
57
+ width: '100%' as const,
58
+ height: '100%' as const,
59
+ },
60
+ };
61
+ },
62
+ [size, shape],
63
+ );
64
+ };
65
+
66
+ /**
67
+ * A generic media image component that displays an image with optional shape variants.
68
+ * Supports square and circular appearances with consistent sizing.
69
+ *
70
+ * When the image fails to load or no src is provided, displays a background placeholder.
71
+ *
72
+ * @example
73
+ * import { MediaImage } from '@ledgerhq/lumen-ui-rnative';
74
+ *
75
+ * <MediaImage src="https://example.com/icon.png" alt="Bitcoin" size={32} />
76
+ */
77
+ export const MediaImage = ({
78
+ src,
79
+ alt,
80
+ size = 48,
81
+ shape = 'square',
82
+ lx = {},
83
+ style,
84
+ ref,
85
+ ...props
86
+ }: MediaImageProps) => {
87
+ const [error, setError] = useState(false);
88
+ const shouldFallback = !src || error;
89
+ const styles = useStyles({ size, shape });
90
+
91
+ useEffect(() => {
92
+ setError(false);
93
+ }, [src]);
94
+
95
+ return (
96
+ <Box
97
+ ref={ref}
98
+ lx={lx}
99
+ style={StyleSheet.flatten([styles.root, style])}
100
+ accessibilityRole='image'
101
+ accessibilityLabel={alt}
102
+ {...props}
103
+ >
104
+ {!shouldFallback && (
105
+ <Image
106
+ source={{ uri: src }}
107
+ style={styles.image}
108
+ accessible={false}
109
+ onError={() => setError(true)}
110
+ testID='media-image-img'
111
+ />
112
+ )}
113
+ </Box>
114
+ );
115
+ };
116
+
117
+ MediaImage.displayName = 'MediaImage';
@@ -0,0 +1,2 @@
1
+ export { MediaImage, mediaImageDotSizeMap } from './MediaImage';
2
+ export * from './types';
@@ -0,0 +1,27 @@
1
+ import { StyledViewProps } from '../../../styles';
2
+
3
+ export type MediaImageSize = 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56;
4
+
5
+ export type MediaImageShape = 'square' | 'circle';
6
+
7
+ export type MediaImageProps = {
8
+ /**
9
+ * Image source URL. When undefined or on load error, displays a fallback.
10
+ * @optional
11
+ */
12
+ src?: string;
13
+ /**
14
+ * The shape of the media image.
15
+ * @default 'square'
16
+ */
17
+ shape?: MediaImageShape;
18
+ /**
19
+ * The size of the media image in pixels.
20
+ * @default 48
21
+ */
22
+ size?: MediaImageSize;
23
+ /**
24
+ * Alternative text for the image, used for accessibility.
25
+ */
26
+ alt?: string;
27
+ } & Omit<StyledViewProps, 'children'>;
@@ -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
  NavBar,
@@ -1,5 +1,5 @@
1
1
  import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
2
- import React, { ReactNode } from 'react';
2
+ import { Children, isValidElement, ReactNode } from 'react';
3
3
  import { StyleSheet } from 'react-native';
4
4
  import { useCommonTranslation } from '../../../i18n';
5
5
  import { useStyleSheet } from '../../../styles';
@@ -35,8 +35,8 @@ function extractSlots(children: ReactNode): Slots {
35
35
  trailing: null,
36
36
  };
37
37
 
38
- React.Children.forEach(children, (child) => {
39
- if (!React.isValidElement(child)) {
38
+ Children.forEach(children, (child) => {
39
+ if (!isValidElement(child)) {
40
40
  return;
41
41
  }
42
42
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, screen } from '@testing-library/react-native';
4
- import React from 'react';
5
4
 
5
+ import { createRef } from 'react';
6
6
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
7
7
  import { PageIndicator } from './PageIndicator';
8
8
 
@@ -162,7 +162,7 @@ describe('PageIndicator Component', () => {
162
162
 
163
163
  describe('Props', () => {
164
164
  it('should accept ref prop', () => {
165
- const ref = React.createRef<React.ElementRef<typeof PageIndicator>>();
165
+ const ref = createRef<React.ElementRef<typeof PageIndicator>>();
166
166
  renderWithProvider(
167
167
  <PageIndicator
168
168
  ref={ref}
@@ -57,10 +57,14 @@ Use `onClear` to extend the default clear behavior with custom logic.
57
57
 
58
58
  ### Disabled State
59
59
 
60
- The search input can be disabled using the `editable` prop set to `false`.
60
+ The search input can be fully disabled using the `disabled` prop, which prevents interaction and applies a muted visual style.
61
61
 
62
62
  <Canvas of={SearchInputStories.DisabledSearchInput} />
63
63
 
64
+ ### Read-Only State
65
+
66
+ Alternatively, use `editable={false}` to prevent editing without applying the muted visual style. This is useful for displaying non-editable values that should still look like regular inputs.
67
+
64
68
  ### Error State
65
69
 
66
70
  The search component supports error handling through `errorMessage` which displays an error message below the input with error styling including a red border and text color.
@@ -273,7 +277,15 @@ Use the `keyboardType` prop to show the appropriate keyboard:
273
277
 
274
278
  ### Disabled State
275
279
 
276
- Use the `editable` prop to disable the search input:
280
+ Use the `disabled` prop to disable the search input with a muted visual style:
281
+
282
+ ```tsx
283
+ <SearchInput placeholder='Search' value='Current search' disabled />
284
+ ```
285
+
286
+ ### Read-Only State
287
+
288
+ Use the `editable` prop to make the search input non-editable without the muted visual style:
277
289
 
278
290
  ```tsx
279
291
  <SearchInput placeholder='Search' value='Current search' editable={false} />
@@ -19,24 +19,6 @@ const meta: Meta<typeof SearchInput> = {
19
19
  },
20
20
  },
21
21
  },
22
- argTypes: {
23
- placeholder: {
24
- control: 'text',
25
- description: 'Placeholder text when input is empty',
26
- },
27
- errorMessage: {
28
- control: 'text',
29
- description: 'Error message to display below input',
30
- },
31
- editable: {
32
- control: 'boolean',
33
- description: 'Whether the input is editable',
34
- },
35
- hideClearButton: {
36
- control: 'boolean',
37
- description: 'Hide the clear button',
38
- },
39
- },
40
22
  };
41
23
 
42
24
  export default meta;
@@ -105,7 +87,7 @@ export const DisabledSearchInput: Story = {
105
87
  ),
106
88
  args: {
107
89
  placeholder: 'Search products',
108
- editable: false,
90
+ disabled: true,
109
91
  hideClearButton: false,
110
92
  },
111
93
  };
@@ -1,3 +1,4 @@
1
+ import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
1
2
  import { useStyleSheet } from '../../../styles';
2
3
  import { Search as SearchIcon } from '../../Symbols';
3
4
  import { BaseInput } from '../BaseInput';
@@ -8,18 +9,24 @@ export const SearchInput = ({
8
9
  style,
9
10
  containerStyle,
10
11
  inputStyle,
12
+ disabled: disabledProp,
11
13
  ref,
12
14
  ...props
13
15
  }: SearchInputProps) => {
16
+ const disabled = useDisabledContext({
17
+ consumerName: 'SearchInput',
18
+ mergeWith: { disabled: disabledProp },
19
+ });
14
20
  const styles = useAppearanceStyles(appearance);
15
21
 
16
22
  return (
17
23
  <BaseInput
18
24
  ref={ref}
19
- prefix={<SearchIcon size={20} color='muted' accessible={false} />}
25
+ prefix={<SearchIcon size={20} accessible={false} disabled={disabled} />}
20
26
  style={style}
21
27
  containerStyle={[containerStyle, styles.container]}
22
28
  inputStyle={[inputStyle, styles.input]}
29
+ disabled={disabledProp}
23
30
  {...props}
24
31
  />
25
32
  );
@@ -61,7 +61,6 @@ Use the library as part of `@ledgerhq/lumen-ui-rnative`. See the [Setup Guide
61
61
  Control selected value in state at the top level and pass it to SegmentedControl. Buttons use value to identify themselves; selected state is derived from context.
62
62
 
63
63
  ```tsx
64
- import React from 'react';
65
64
  import { SegmentedControl, SegmentedControlButton } from '@ledgerhq/lumen-ui-rnative';
66
65
 
67
66
  export default function Example() {
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
- import React, { useState } from 'react';
2
+ import { useState } from 'react';
3
3
  import { Coins, Nft, TransferHorizontal, Settings } from '../../Symbols';
4
4
  import { Box } from '../Utility';
5
5
  import { SegmentedControl, SegmentedControlButton } from './SegmentedControl';
@@ -14,29 +14,22 @@ const meta = {
14
14
  layout: 'centered',
15
15
  backgrounds: { default: 'light' },
16
16
  },
17
- argTypes: {
18
- onSelectedChange: {
19
- action: 'change',
20
- },
21
- disabled: {
22
- control: 'boolean',
23
- },
24
- appearance: {
25
- options: ['background', 'no-background'],
26
- control: 'radio',
27
- },
28
- accessibilityLabel: {
29
- control: 'text',
30
- },
31
- selectedValue: {
32
- control: 'text',
33
- },
34
- children: {
35
- control: false,
36
- },
37
- },
17
+ decorators: [
18
+ (Story) => (
19
+ <Box
20
+ lx={{
21
+ width: 's320',
22
+ flexDirection: 'row',
23
+ justifyContent: 'center',
24
+ }}
25
+ >
26
+ <Story />
27
+ </Box>
28
+ ),
29
+ ],
38
30
  args: {
39
31
  appearance: 'background',
32
+ tabLayout: 'fixed',
40
33
  },
41
34
  } satisfies Meta<typeof SegmentedControl>;
42
35
 
@@ -49,20 +42,16 @@ export const Base: Story = {
49
42
  const [state, setState] = useState('send');
50
43
 
51
44
  return (
52
- <Box lx={{ width: 's256' }}>
53
- <SegmentedControl
54
- {...args}
55
- selectedValue={state}
56
- onSelectedChange={setState}
57
- accessibilityLabel='Transaction type'
58
- >
59
- <SegmentedControlButton value='send'>Send</SegmentedControlButton>
60
- <SegmentedControlButton value='receive'>
61
- Receive
62
- </SegmentedControlButton>
63
- <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
64
- </SegmentedControl>
65
- </Box>
45
+ <SegmentedControl
46
+ {...args}
47
+ selectedValue={state}
48
+ onSelectedChange={setState}
49
+ accessibilityLabel='Transaction type'
50
+ >
51
+ <SegmentedControlButton value='send'>Send</SegmentedControlButton>
52
+ <SegmentedControlButton value='receive'>Receive</SegmentedControlButton>
53
+ <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
54
+ </SegmentedControl>
66
55
  );
67
56
  },
68
57
  };
@@ -96,23 +85,60 @@ export const WithIcons: Story = {
96
85
  },
97
86
  };
98
87
 
88
+ export const TabLayoutShowcase: Story = {
89
+ args: {} as React.ComponentProps<typeof SegmentedControl>,
90
+ render: (args) => {
91
+ const [fitState, setFitState] = useState('send');
92
+ const [fixedState, setFixedState] = useState('send');
93
+
94
+ return (
95
+ <Box lx={{ gap: 's24' }} style={{ width: '100%' }}>
96
+ <SegmentedControl
97
+ {...args}
98
+ tabLayout='fit'
99
+ selectedValue={fitState}
100
+ onSelectedChange={setFitState}
101
+ accessibilityLabel='Fit layout'
102
+ >
103
+ <SegmentedControlButton value='send'>Send</SegmentedControlButton>
104
+ <SegmentedControlButton value='receive'>
105
+ Receive
106
+ </SegmentedControlButton>
107
+ <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
108
+ </SegmentedControl>
109
+ <SegmentedControl
110
+ {...args}
111
+ tabLayout='fixed'
112
+ selectedValue={fixedState}
113
+ onSelectedChange={setFixedState}
114
+ accessibilityLabel='Fixed layout'
115
+ >
116
+ <SegmentedControlButton value='send'>Send</SegmentedControlButton>
117
+ <SegmentedControlButton value='receive'>
118
+ Receive
119
+ </SegmentedControlButton>
120
+ <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
121
+ </SegmentedControl>
122
+ </Box>
123
+ );
124
+ },
125
+ };
126
+
99
127
  export const Disabled: Story = {
100
128
  args: {} as React.ComponentProps<typeof SegmentedControl>,
101
129
  render: (args) => (
102
- <Box lx={{ width: 's256' }}>
103
- <SegmentedControl
104
- {...args}
105
- selectedValue='receive'
106
- onSelectedChange={() => {
107
- /* empty */
108
- }}
109
- accessibilityLabel='Transaction type (disabled)'
110
- disabled
111
- >
112
- <SegmentedControlButton value='send'>Send</SegmentedControlButton>
113
- <SegmentedControlButton value='receive'>Receive</SegmentedControlButton>
114
- <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
115
- </SegmentedControl>
116
- </Box>
130
+ <SegmentedControl
131
+ {...args}
132
+ selectedValue='receive'
133
+ onSelectedChange={() => {
134
+ /* empty */
135
+ }}
136
+ accessibilityLabel='Transaction type (disabled)'
137
+ disabled
138
+ >
139
+ <SegmentedControlButton value='send'>Send</SegmentedControlButton>
140
+ <SegmentedControlButton value='receive'>Receive</SegmentedControlButton>
141
+ <SegmentedControlButton value='buy'>Buy</SegmentedControlButton>
142
+ </SegmentedControl>
117
143
  ),
118
144
  };
@@ -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