@ledgerhq/lumen-ui-rnative 0.1.36 → 0.1.38

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 (245) hide show
  1. package/dist/module/lib/Animations/Pulse/Pulse.mdx +1 -1
  2. package/dist/module/lib/Animations/Spin/Spin.mdx +1 -1
  3. package/dist/module/lib/Components/AddressInput/AddressInput.mdx +1 -1
  4. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +68 -39
  5. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
  6. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
  7. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js +24 -0
  8. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js.map +1 -1
  9. package/dist/module/lib/Components/AmountDisplay/types.js.map +1 -1
  10. package/dist/module/lib/Components/AmountInput/AmountInput.js +109 -72
  11. package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
  12. package/dist/module/lib/Components/AmountInput/AmountInput.mdx +13 -1
  13. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +53 -0
  14. package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
  15. package/dist/module/lib/Components/Avatar/Avatar.js +6 -5
  16. package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
  17. package/dist/module/lib/Components/Avatar/Avatar.mdx +3 -1
  18. package/dist/module/lib/Components/Avatar/Avatar.test.js +10 -13
  19. package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
  20. package/dist/module/lib/Components/Banner/Banner.mdx +1 -1
  21. package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  22. package/dist/module/lib/Components/Button/Button.mdx +1 -1
  23. package/dist/module/lib/Components/Card/Card.stories.js +4 -9
  24. package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
  25. package/dist/module/lib/Components/CardButton/CardButton.mdx +1 -1
  26. package/dist/module/lib/Components/Checkbox/Checkbox.mdx +1 -1
  27. package/dist/module/lib/Components/Divider/Divider.mdx +1 -1
  28. package/dist/module/lib/Components/DotIcon/DotIcon.js +51 -27
  29. package/dist/module/lib/Components/DotIcon/DotIcon.js.map +1 -1
  30. package/dist/module/lib/Components/DotIcon/DotIcon.mdx +92 -0
  31. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +57 -0
  32. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
  33. package/dist/module/lib/Components/DotIndicator/DotIndicator.js +5 -5
  34. package/dist/module/lib/Components/DotIndicator/DotIndicator.js.map +1 -1
  35. package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
  36. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +3 -3
  37. package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js +12 -2
  38. package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js.map +1 -1
  39. package/dist/module/lib/Components/DotSymbol/DotSymbol.js +59 -34
  40. package/dist/module/lib/Components/DotSymbol/DotSymbol.js.map +1 -1
  41. package/dist/module/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
  42. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +60 -0
  43. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
  44. package/dist/module/lib/Components/IconButton/IconButton.mdx +1 -1
  45. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  46. package/dist/module/lib/Components/Label/Label.js +1 -1
  47. package/dist/module/lib/Components/Link/Link.mdx +1 -1
  48. package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  49. package/dist/module/lib/Components/MediaButton/MediaButton.js +19 -19
  50. package/dist/module/lib/Components/MediaButton/MediaButton.js.map +1 -1
  51. package/dist/module/lib/Components/MediaButton/MediaButton.mdx +5 -5
  52. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +17 -17
  53. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
  54. package/dist/module/lib/Components/MediaButton/MediaButton.test.js +4 -4
  55. package/dist/module/lib/Components/MediaButton/MediaButton.test.js.map +1 -1
  56. package/dist/module/lib/Components/MediaImage/MediaImage.js +24 -6
  57. package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
  58. package/dist/module/lib/Components/MediaImage/MediaImage.mdx +1 -1
  59. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +47 -0
  60. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
  61. package/dist/module/lib/Components/NavBar/CoinCapsule.js +2 -2
  62. package/dist/module/lib/Components/NavBar/CoinCapsule.js.map +1 -1
  63. package/dist/module/lib/Components/NavBar/NavBar.js +2 -2
  64. package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
  65. package/dist/module/lib/Components/NavBar/NavBar.mdx +2 -2
  66. package/dist/module/lib/Components/NavBar/NavBar.stories.js +1 -1
  67. package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
  68. package/dist/module/lib/Components/NavBar/NavBar.test.js +3 -3
  69. package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
  70. package/dist/module/lib/Components/OptionList/OptionList.mdx +1 -1
  71. package/dist/module/lib/Components/OptionList/OptionList.stories.js +4 -4
  72. package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
  73. package/dist/module/lib/Components/PageIndicator/PageIndicator.js +13 -8
  74. package/dist/module/lib/Components/PageIndicator/PageIndicator.js.map +1 -1
  75. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +58 -0
  76. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
  77. package/dist/module/lib/Components/SearchInput/SearchInput.mdx +1 -1
  78. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
  79. package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -1
  80. package/dist/module/lib/Components/Spot/Spot.mdx +1 -1
  81. package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -1
  82. package/dist/module/lib/Components/Subheader/Subheader.mdx +1 -1
  83. package/dist/module/lib/Components/Switch/Switch.mdx +1 -1
  84. package/dist/module/lib/Components/TabBar/TabBar.mdx +1 -1
  85. package/dist/module/lib/Components/TextInput/TextInput.mdx +1 -1
  86. package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js +2 -5
  87. package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js.map +1 -1
  88. package/dist/module/lib/Components/Tile/Tile.mdx +1 -1
  89. package/dist/module/lib/Components/Tooltip/Tooltip.mdx +1 -1
  90. package/dist/module/lib/Components/index.js +0 -1
  91. package/dist/module/lib/Components/index.js.map +1 -1
  92. package/dist/module/lib/Symbols/Icons/Lightbulb.js +3 -3
  93. package/dist/module/lib/Symbols/Icons/Lightbulb.js.map +1 -1
  94. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
  95. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  96. package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts +1 -1
  97. package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts.map +1 -1
  98. package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts +10 -3
  99. package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts.map +1 -1
  100. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  101. package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  102. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +12 -0
  103. package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
  104. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +1 -1
  105. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  106. package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts +3 -2
  107. package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
  108. package/dist/typescript/src/lib/Components/DotIcon/types.d.ts +7 -1
  109. package/dist/typescript/src/lib/Components/DotIcon/types.d.ts.map +1 -1
  110. package/dist/typescript/src/lib/Components/DotIndicator/types.d.ts +2 -2
  111. package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
  112. package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
  113. package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts +7 -1
  114. package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts.map +1 -1
  115. package/dist/typescript/src/lib/Components/Label/Label.d.ts +1 -1
  116. package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts +5 -5
  117. package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
  118. package/dist/typescript/src/lib/Components/MediaButton/types.d.ts +6 -6
  119. package/dist/typescript/src/lib/Components/MediaButton/types.d.ts.map +1 -1
  120. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +1 -1
  121. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
  122. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +7 -1
  123. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -1
  124. package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts +1 -1
  125. package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
  126. package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts +1 -1
  127. package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts.map +1 -1
  128. package/dist/typescript/src/lib/Components/NavBar/types.d.ts +3 -3
  129. package/dist/typescript/src/lib/Components/NavBar/types.d.ts.map +1 -1
  130. package/dist/typescript/src/lib/Components/PageIndicator/PageIndicator.d.ts.map +1 -1
  131. package/dist/typescript/src/lib/Components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
  132. package/dist/typescript/src/lib/Components/index.d.ts +0 -1
  133. package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
  134. package/package.json +3 -3
  135. package/src/lib/Animations/Pulse/Pulse.mdx +1 -1
  136. package/src/lib/Animations/Spin/Spin.mdx +1 -1
  137. package/src/lib/Components/AddressInput/AddressInput.mdx +1 -1
  138. package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
  139. package/src/lib/Components/AmountDisplay/AmountDisplay.stories.tsx +18 -0
  140. package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +71 -40
  141. package/src/lib/Components/AmountDisplay/index.ts +5 -1
  142. package/src/lib/Components/AmountDisplay/types.ts +12 -3
  143. package/src/lib/Components/AmountInput/AmountInput.mdx +13 -1
  144. package/src/lib/Components/AmountInput/AmountInput.stories.tsx +68 -1
  145. package/src/lib/Components/AmountInput/AmountInput.tsx +118 -75
  146. package/src/lib/Components/AmountInput/types.ts +14 -0
  147. package/src/lib/Components/Avatar/Avatar.mdx +3 -1
  148. package/src/lib/Components/Avatar/Avatar.test.tsx +16 -18
  149. package/src/lib/Components/Avatar/Avatar.tsx +9 -8
  150. package/src/lib/Components/Banner/Banner.mdx +1 -1
  151. package/src/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  152. package/src/lib/Components/Button/Button.mdx +1 -1
  153. package/src/lib/Components/Card/Card.stories.tsx +1 -3
  154. package/src/lib/Components/CardButton/CardButton.mdx +1 -1
  155. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
  156. package/src/lib/Components/Divider/Divider.mdx +1 -1
  157. package/src/lib/Components/DotIcon/DotIcon.mdx +92 -0
  158. package/src/lib/Components/DotIcon/DotIcon.stories.tsx +43 -0
  159. package/src/lib/Components/DotIcon/DotIcon.tsx +35 -15
  160. package/src/lib/Components/DotIcon/types.ts +7 -1
  161. package/src/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
  162. package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +2 -2
  163. package/src/lib/Components/DotIndicator/DotIndicator.test.tsx +12 -2
  164. package/src/lib/Components/DotIndicator/DotIndicator.tsx +5 -5
  165. package/src/lib/Components/DotIndicator/types.ts +2 -2
  166. package/src/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
  167. package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +32 -0
  168. package/src/lib/Components/DotSymbol/DotSymbol.tsx +46 -25
  169. package/src/lib/Components/DotSymbol/types.ts +7 -1
  170. package/src/lib/Components/IconButton/IconButton.mdx +1 -1
  171. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  172. package/src/lib/Components/Label/Label.tsx +1 -1
  173. package/src/lib/Components/Link/Link.mdx +1 -1
  174. package/src/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  175. package/src/lib/Components/MediaButton/MediaButton.mdx +5 -5
  176. package/src/lib/Components/MediaButton/MediaButton.stories.tsx +29 -15
  177. package/src/lib/Components/MediaButton/MediaButton.test.tsx +4 -4
  178. package/src/lib/Components/MediaButton/MediaButton.tsx +35 -22
  179. package/src/lib/Components/MediaButton/types.ts +6 -6
  180. package/src/lib/Components/MediaImage/MediaImage.mdx +1 -1
  181. package/src/lib/Components/MediaImage/MediaImage.stories.tsx +21 -0
  182. package/src/lib/Components/MediaImage/MediaImage.tsx +14 -2
  183. package/src/lib/Components/MediaImage/types.ts +7 -1
  184. package/src/lib/Components/NavBar/CoinCapsule.tsx +2 -2
  185. package/src/lib/Components/NavBar/NavBar.mdx +2 -2
  186. package/src/lib/Components/NavBar/NavBar.stories.tsx +3 -1
  187. package/src/lib/Components/NavBar/NavBar.test.tsx +3 -3
  188. package/src/lib/Components/NavBar/NavBar.tsx +2 -2
  189. package/src/lib/Components/NavBar/types.ts +3 -3
  190. package/src/lib/Components/OptionList/OptionList.mdx +1 -1
  191. package/src/lib/Components/OptionList/OptionList.stories.tsx +4 -4
  192. package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +78 -0
  193. package/src/lib/Components/PageIndicator/PageIndicator.tsx +15 -7
  194. package/src/lib/Components/SearchInput/SearchInput.mdx +1 -1
  195. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
  196. package/src/lib/Components/Spinner/Spinner.mdx +1 -1
  197. package/src/lib/Components/Spot/Spot.mdx +1 -1
  198. package/src/lib/Components/Stepper/Stepper.mdx +1 -1
  199. package/src/lib/Components/Subheader/Subheader.mdx +1 -1
  200. package/src/lib/Components/Switch/Switch.mdx +1 -1
  201. package/src/lib/Components/TabBar/TabBar.mdx +1 -1
  202. package/src/lib/Components/TextInput/TextInput.mdx +1 -1
  203. package/src/lib/Components/ThemeProvider/ThemeProvider.tsx +1 -4
  204. package/src/lib/Components/Tile/Tile.mdx +1 -1
  205. package/src/lib/Components/Tooltip/Tooltip.mdx +1 -1
  206. package/src/lib/Components/index.ts +0 -1
  207. package/src/lib/Symbols/Icons/Lightbulb.tsx +3 -3
  208. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +0 -155
  209. package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +0 -1
  210. package/dist/module/lib/Components/Select/GlobalSelectContext.js +0 -78
  211. package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +0 -1
  212. package/dist/module/lib/Components/Select/Select.js +0 -366
  213. package/dist/module/lib/Components/Select/Select.js.map +0 -1
  214. package/dist/module/lib/Components/Select/Select.mdx +0 -596
  215. package/dist/module/lib/Components/Select/Select.stories.js +0 -304
  216. package/dist/module/lib/Components/Select/Select.stories.js.map +0 -1
  217. package/dist/module/lib/Components/Select/Select.test.js +0 -123
  218. package/dist/module/lib/Components/Select/Select.test.js.map +0 -1
  219. package/dist/module/lib/Components/Select/SelectContext.js +0 -38
  220. package/dist/module/lib/Components/Select/SelectContext.js.map +0 -1
  221. package/dist/module/lib/Components/Select/index.js +0 -6
  222. package/dist/module/lib/Components/Select/index.js.map +0 -1
  223. package/dist/module/lib/Components/Select/types.js +0 -4
  224. package/dist/module/lib/Components/Select/types.js.map +0 -1
  225. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -20
  226. package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +0 -1
  227. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +0 -44
  228. package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +0 -1
  229. package/dist/typescript/src/lib/Components/Select/Select.d.ts +0 -52
  230. package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +0 -1
  231. package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts +0 -36
  232. package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts.map +0 -1
  233. package/dist/typescript/src/lib/Components/Select/index.d.ts +0 -4
  234. package/dist/typescript/src/lib/Components/Select/index.d.ts.map +0 -1
  235. package/dist/typescript/src/lib/Components/Select/types.d.ts +0 -130
  236. package/dist/typescript/src/lib/Components/Select/types.d.ts.map +0 -1
  237. package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +0 -180
  238. package/src/lib/Components/Select/GlobalSelectContext.tsx +0 -103
  239. package/src/lib/Components/Select/Select.mdx +0 -596
  240. package/src/lib/Components/Select/Select.stories.tsx +0 -266
  241. package/src/lib/Components/Select/Select.test.tsx +0 -117
  242. package/src/lib/Components/Select/Select.tsx +0 -469
  243. package/src/lib/Components/Select/SelectContext.tsx +0 -68
  244. package/src/lib/Components/Select/index.ts +0 -3
  245. package/src/lib/Components/Select/types.ts +0 -149
@@ -9,7 +9,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
9
9
 
10
10
  <Meta title='Animations/Spin' of={SpinStories} />
11
11
 
12
- # 🔄 Spin
12
+ # Spin
13
13
 
14
14
  <CustomTabs>
15
15
  <Tab label="Overview">
@@ -7,7 +7,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
7
7
 
8
8
  <Meta title='Input/AddressInput' of={AddressInputStories} />
9
9
 
10
- # ⌨️ AddressInput
10
+ # AddressInput
11
11
 
12
12
  <CustomTabs>
13
13
  <Tab label="Overview" path='Input/AddressInput'>
@@ -12,7 +12,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
12
12
 
13
13
  <Meta title='Communication/AmountDisplay' of={AmountDisplayStories} />
14
14
 
15
- # 🔢 AmountDisplay
15
+ # AmountDisplay
16
16
 
17
17
  <CustomTabs>
18
18
  <Tab label="Overview">
@@ -39,6 +39,12 @@ The AmountDisplay component renders formatted monetary amounts with flexible cur
39
39
  <Canvas of={AmountDisplayStories.Base} />
40
40
  <Controls of={AmountDisplayStories.Base} />
41
41
 
42
+ ### Size
43
+
44
+ The `size` prop controls the typographic scale of the amount display. Use `md` (default) for primary amounts and `sm` for secondary or contextual amounts.
45
+
46
+ <Canvas of={AmountDisplayStories.Sizes} />
47
+
42
48
  ### Privacy
43
49
 
44
50
  The `hidden` prop allows you to toggle amount visibility for privacy-sensitive applications. When set to `true`, the component displays bullet points (••••) instead of the actual amount, while keeping the currency symbol visible. The example below demonstrates toggling amount visibility with a button.
@@ -79,6 +79,12 @@ const meta: Meta<typeof AmountDisplay> = {
79
79
  type: 'boolean',
80
80
  },
81
81
  },
82
+ size: {
83
+ control: {
84
+ type: 'select',
85
+ },
86
+ options: ['sm', 'md'],
87
+ },
82
88
  },
83
89
  parameters: {
84
90
  layout: 'centered',
@@ -109,6 +115,18 @@ export const Base: Story = {
109
115
  },
110
116
  };
111
117
 
118
+ export const Sizes: Story = {
119
+ args: {
120
+ value: 1234.56,
121
+ },
122
+ render: (props) => (
123
+ <View style={{ alignItems: 'center', gap: 24 }}>
124
+ <AmountDisplay {...props} size='md' />
125
+ <AmountDisplay {...props} size='sm' />
126
+ </View>
127
+ ),
128
+ };
129
+
112
130
  export const WithHideButton: Story = {
113
131
  render: (props) => {
114
132
  const [hidden, setHidden] = useState(false);
@@ -8,6 +8,7 @@ import Animated, {
8
8
  withTiming,
9
9
  } from 'react-native-reanimated';
10
10
  import { useCommonTranslation } from '../../../i18n';
11
+ import type { LumenTypographyTokenName } from '../../../styles';
11
12
  import { useStyleSheet } from '../../../styles';
12
13
  import { Pulse } from '../../Animations/Pulse';
13
14
  import { useTimingConfig } from '../../Animations/useTimingConfig';
@@ -15,38 +16,66 @@ import { RuntimeConstants } from '../../utils';
15
16
  import { Box } from '../Utility';
16
17
  import type {
17
18
  AmountDisplayProps,
19
+ AmountDisplaySize,
18
20
  DigitStripListProps,
19
21
  DigitStripProps,
22
+ DigitWidths,
20
23
  } from './types';
21
24
  import { DIGITS } from './types';
22
25
 
23
- const INTEGER_DIGIT_WIDTHS = {
24
- 0: 25,
25
- 1: 15.5,
26
- 2: 23.5,
27
- 3: 24.5,
28
- 4: 25.5,
29
- 5: 23.5,
30
- 6: 25,
31
- 7: 22,
32
- 8: 24.5,
33
- 9: 24.5,
26
+ const TYPOGRAPHY_WIDTHS = {
27
+ heading1SemiBold: {
28
+ 0: 25,
29
+ 1: 15.5,
30
+ 2: 23.5,
31
+ 3: 24.5,
32
+ 4: 25.5,
33
+ 5: 23.5,
34
+ 6: 25,
35
+ 7: 22,
36
+ 8: 24.5,
37
+ 9: 24.5,
38
+ },
39
+ heading2SemiBold: {
40
+ 0: 17.5,
41
+ 1: 11,
42
+ 2: 16.5,
43
+ 3: 17,
44
+ 4: 18,
45
+ 5: 16,
46
+ 6: 17.5,
47
+ 7: 15,
48
+ 8: 17,
49
+ 9: 17,
50
+ },
51
+ heading4SemiBold: {
52
+ 0: 13,
53
+ 1: 8.5,
54
+ 2: 12.5,
55
+ 3: 12.5,
56
+ 4: 13,
57
+ 5: 12,
58
+ 6: 12.5,
59
+ 7: 11.5,
60
+ 8: 12.5,
61
+ 9: 12.5,
62
+ },
63
+ } as const satisfies Partial<Record<LumenTypographyTokenName, DigitWidths>>;
64
+
65
+ type MeasuredTypography = keyof typeof TYPOGRAPHY_WIDTHS;
66
+
67
+ type SizeTypographyConfig = {
68
+ integer: MeasuredTypography;
69
+ decimal: MeasuredTypography;
34
70
  };
35
71
 
36
- const DECIMAL_DIGIT_WIDTHS = {
37
- 0: 17.5,
38
- 1: 11,
39
- 2: 16.5,
40
- 3: 17,
41
- 4: 18,
42
- 5: 16,
43
- 6: 17.5,
44
- 7: 15,
45
- 8: 17,
46
- 9: 17,
72
+ const SIZE_TYPOGRAPHY: Record<AmountDisplaySize, SizeTypographyConfig> = {
73
+ md: { integer: 'heading1SemiBold', decimal: 'heading2SemiBold' },
74
+ sm: { integer: 'heading2SemiBold', decimal: 'heading4SemiBold' },
47
75
  };
48
76
 
49
- const useStyles = () => {
77
+ const useStyles = (size: AmountDisplaySize) => {
78
+ const typography = SIZE_TYPOGRAPHY[size];
50
79
  return useStyleSheet(
51
80
  (t) => ({
52
81
  container: {
@@ -61,19 +90,19 @@ const useStyles = () => {
61
90
  paddingBottom: t.spacings.s2,
62
91
  },
63
92
  integerText: {
64
- ...t.typographies.heading1SemiBold,
93
+ ...t.typographies[typography.integer],
65
94
  color: t.colors.text.base,
66
95
  },
67
96
  decimalText: {
68
- ...t.typographies.heading2SemiBold,
97
+ ...t.typographies[typography.decimal],
69
98
  color: t.colors.text.muted,
70
99
  },
71
100
  currencyStartText: {
72
- ...t.typographies.heading1SemiBold,
101
+ ...t.typographies[typography.integer],
73
102
  color: t.colors.text.base,
74
103
  },
75
104
  currencyEndText: {
76
- ...t.typographies.heading2SemiBold,
105
+ ...t.typographies[typography.decimal],
77
106
  color: t.colors.text.muted,
78
107
  },
79
108
  spacingStart: {
@@ -83,7 +112,7 @@ const useStyles = () => {
83
112
  marginLeft: t.spacings.s4,
84
113
  },
85
114
  }),
86
- [],
115
+ [typography],
87
116
  );
88
117
  };
89
118
 
@@ -136,10 +165,8 @@ const useAnimatedDigitStrip = ({
136
165
  };
137
166
 
138
167
  const DigitStrip = memo(
139
- ({ value, textStyle, animate, type }: DigitStripProps) => {
140
- const targetWidth = (
141
- type === 'integer' ? INTEGER_DIGIT_WIDTHS : DECIMAL_DIGIT_WIDTHS
142
- )[value];
168
+ ({ value, textStyle, animate, widths }: DigitStripProps) => {
169
+ const targetWidth = widths[value];
143
170
  const lineHeight = textStyle.lineHeight;
144
171
  const width = useSharedValue<number>(targetWidth);
145
172
  const { animatedStyle } = useAnimatedDigitStrip({
@@ -176,7 +203,7 @@ const DigitStrip = memo(
176
203
  DigitStrip.displayName = 'DigitStrip';
177
204
 
178
205
  const DigitStripList = memo(
179
- ({ items, textStyle, animate, type }: DigitStripListProps) => {
206
+ ({ items, textStyle, animate, widths }: DigitStripListProps) => {
180
207
  return items.map((item, index) => {
181
208
  const key = items.length - index;
182
209
  if (item.type === 'separator') {
@@ -192,7 +219,7 @@ const DigitStripList = memo(
192
219
  value={Number(item.value) as DigitStripProps['value']}
193
220
  animate={animate}
194
221
  textStyle={textStyle}
195
- type={type}
222
+ widths={widths}
196
223
  />
197
224
  );
198
225
  });
@@ -233,15 +260,16 @@ DigitStripList.displayName = 'DigitStripList';
233
260
  * <AmountDisplay value={1234.56} formatter={usdFormatter} hidden={true} />
234
261
  * ```
235
262
  */
236
- export const AmountDisplay = ({
263
+ export function AmountDisplay({
237
264
  value,
238
265
  formatter,
239
266
  hidden = false,
240
267
  loading = false,
241
268
  animate = true,
269
+ size = 'md',
242
270
  ...props
243
- }: AmountDisplayProps) => {
244
- const styles = useStyles();
271
+ }: AmountDisplayProps) {
272
+ const styles = useStyles(size);
245
273
  const { t } = useCommonTranslation();
246
274
  const parts = formatter(value);
247
275
  const splitDigits = useSplitText(parts);
@@ -250,6 +278,9 @@ export const AmountDisplay = ({
250
278
  hidden,
251
279
  t('components.amountDisplay.amountHiddenAriaLabel'),
252
280
  );
281
+ const typography = SIZE_TYPOGRAPHY[size];
282
+ const integerWidths = TYPOGRAPHY_WIDTHS[typography.integer];
283
+ const decimalWidths = TYPOGRAPHY_WIDTHS[typography.decimal];
253
284
 
254
285
  return (
255
286
  <Box
@@ -281,7 +312,7 @@ export const AmountDisplay = ({
281
312
  items={splitDigits.integerPart}
282
313
  textStyle={styles.integerText}
283
314
  animate={animate}
284
- type='integer'
315
+ widths={integerWidths}
285
316
  />
286
317
  )}
287
318
  </View>
@@ -296,7 +327,7 @@ export const AmountDisplay = ({
296
327
  items={splitDigits.decimalPart}
297
328
  textStyle={styles.decimalText}
298
329
  animate={animate}
299
- type='decimal'
330
+ widths={decimalWidths}
300
331
  />
301
332
  )}
302
333
  {parts.currencyPosition === 'end' && (
@@ -312,4 +343,4 @@ export const AmountDisplay = ({
312
343
  </Pulse>
313
344
  </Box>
314
345
  );
315
- };
346
+ }
@@ -1,2 +1,6 @@
1
1
  export { AmountDisplay } from './AmountDisplay';
2
- export type { AmountDisplayProps, FormattedValue } from './types';
2
+ export type {
3
+ AmountDisplayProps,
4
+ AmountDisplaySize,
5
+ FormattedValue,
6
+ } from './types';
@@ -6,13 +6,17 @@ export type { FormattedValue };
6
6
 
7
7
  export const DIGITS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] as const;
8
8
 
9
- type IntegerDigit = (typeof DIGITS)[number];
9
+ type Digit = (typeof DIGITS)[number];
10
+
11
+ export type AmountDisplaySize = 'sm' | 'md';
12
+
13
+ export type DigitWidths = Record<Digit, number>;
10
14
 
11
15
  export type DigitStripProps = {
12
- value: IntegerDigit;
16
+ value: Digit;
13
17
  animate: boolean;
14
18
  textStyle: TextStyle & { lineHeight: number };
15
- type: 'integer' | 'decimal';
19
+ widths: DigitWidths;
16
20
  };
17
21
 
18
22
  export type DigitStripListProps = {
@@ -48,4 +52,9 @@ export type AmountDisplayProps = ViewProps & {
48
52
  * @default true
49
53
  */
50
54
  animate?: boolean;
55
+ /**
56
+ * The size variant of the amount display.
57
+ * @default 'md'
58
+ */
59
+ size?: AmountDisplaySize;
51
60
  } & Omit<StyledViewProps, 'children'>;
@@ -7,7 +7,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
7
7
 
8
8
  <Meta title='Input/AmountInput' of={AmountInputStories} />
9
9
 
10
- # 💰 AmountInput
10
+ # AmountInput
11
11
 
12
12
  <CustomTabs>
13
13
  <Tab label="Overview">
@@ -29,6 +29,18 @@ AmountInput is a specialized input component designed for handling numeric value
29
29
 
30
30
  > **Layout:** The AmountInput component takes the full width of its container by default. You can control the width by using the `style` prop or by wrapping in a container.
31
31
 
32
+ ### Size
33
+
34
+ Use the `size` prop to control typography scale.
35
+
36
+ <Canvas of={AmountInputStories.Size} />
37
+
38
+ ### Alignment
39
+
40
+ Use the `align` prop to position the amount within its container. Defaults to `center`. Use `start` or `end` for left- or right-aligned layouts.
41
+
42
+ <Canvas of={AmountInputStories.Alignment} />
43
+
32
44
  ### Currency Text Position
33
45
 
34
46
  The currency text can be positioned on either the **left** (default) or **right** side of the input:
@@ -2,7 +2,18 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
2
  import { useState } from 'react';
3
3
  import { View } from 'react-native';
4
4
  import { AmountInput } from './AmountInput';
5
- import { type AmountInputProps } from './types';
5
+ import {
6
+ type AmountInputAlign,
7
+ type AmountInputProps,
8
+ type AmountInputSize,
9
+ } from './types';
10
+
11
+ const ALIGNMENTS: AmountInputAlign[] = ['start', 'center', 'end'];
12
+
13
+ const SIZES: { size: AmountInputSize; value: string }[] = [
14
+ { size: 'md', value: '1234.56' },
15
+ { size: 'sm', value: '55 555' },
16
+ ];
6
17
 
7
18
  const meta: Meta<typeof AmountInput> = {
8
19
  component: AmountInput,
@@ -16,6 +27,15 @@ const meta: Meta<typeof AmountInput> = {
16
27
  },
17
28
  },
18
29
  },
30
+ argTypes: {
31
+ isInvalid: {
32
+ control: 'boolean',
33
+ description: 'Marks the input as invalid for error styling.',
34
+ },
35
+ },
36
+ args: {
37
+ isInvalid: false,
38
+ },
19
39
  };
20
40
 
21
41
  export default meta;
@@ -68,6 +88,53 @@ export const WithValue: Story = {
68
88
  },
69
89
  };
70
90
 
91
+ export const Size: Story = {
92
+ render: () => (
93
+ <View
94
+ style={{
95
+ width: '100%',
96
+ maxWidth: 320,
97
+ alignItems: 'center',
98
+ gap: 24,
99
+ padding: 24,
100
+ }}
101
+ >
102
+ {SIZES.map(({ size, value }) => (
103
+ <AmountInput
104
+ key={size}
105
+ size={size}
106
+ value={value}
107
+ currencyText='$'
108
+ onChangeText={() => {}}
109
+ />
110
+ ))}
111
+ </View>
112
+ ),
113
+ };
114
+
115
+ export const Alignment: Story = {
116
+ render: () => (
117
+ <View
118
+ style={{
119
+ width: '100%',
120
+ maxWidth: 320,
121
+ gap: 24,
122
+ padding: 24,
123
+ }}
124
+ >
125
+ {ALIGNMENTS.map((align) => (
126
+ <AmountInput
127
+ key={align}
128
+ align={align}
129
+ value='1234.56'
130
+ currencyText='$'
131
+ onChangeText={() => {}}
132
+ />
133
+ ))}
134
+ </View>
135
+ ),
136
+ };
137
+
71
138
  export const CurrencyPositionLeft: Story = {
72
139
  render: (args) => <AmountInputStory {...args} />,
73
140
  args: {