@ledgerhq/lumen-ui-rnative 0.1.58 → 0.1.59

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 (189) hide show
  1. package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js +9 -0
  2. package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js.map +1 -1
  3. package/dist/module/lib/Components/animations/Spin/Spin.stories.js +3 -0
  4. package/dist/module/lib/Components/animations/Spin/Spin.stories.js.map +1 -1
  5. package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js +4 -0
  6. package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js.map +1 -1
  7. package/dist/module/lib/Components/core/AddressInput/AddressInput.js +18 -6
  8. package/dist/module/lib/Components/core/AddressInput/AddressInput.js.map +1 -1
  9. package/dist/module/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
  10. package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js +30 -0
  11. package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js.map +1 -1
  12. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js +6 -0
  13. package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js.map +1 -1
  14. package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js +64 -44
  15. package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js.map +1 -1
  16. package/dist/module/lib/Components/core/Banner/Banner.stories.js.map +1 -1
  17. package/dist/module/lib/Components/core/Button/Button.stories.js +21 -0
  18. package/dist/module/lib/Components/core/Button/Button.stories.js.map +1 -1
  19. package/dist/module/lib/Components/core/Card/Card.js +15 -10
  20. package/dist/module/lib/Components/core/Card/Card.js.map +1 -1
  21. package/dist/module/lib/Components/core/Card/Card.stories.js +19 -2
  22. package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
  23. package/dist/module/lib/Components/core/Card/Card.test.js +8 -3
  24. package/dist/module/lib/Components/core/Card/Card.test.js.map +1 -1
  25. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js +15 -0
  26. package/dist/module/lib/Components/core/CardButton/CardButton.stories.js.map +1 -1
  27. package/dist/module/lib/Components/core/Checkbox/Checkbox.stories.js.map +1 -1
  28. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +13 -0
  29. package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
  30. package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js +11 -0
  31. package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js.map +1 -1
  32. package/dist/module/lib/Components/core/Divider/Divider.stories.js.map +1 -1
  33. package/dist/module/lib/Components/core/IconButton/IconButton.stories.js +10 -0
  34. package/dist/module/lib/Components/core/IconButton/IconButton.stories.js.map +1 -1
  35. package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js +12 -0
  36. package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
  37. package/dist/module/lib/Components/core/Link/Link.stories.js.map +1 -1
  38. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +21 -3
  39. package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
  40. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js +18 -1
  41. package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js.map +1 -1
  42. package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js +9 -0
  43. package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js.map +1 -1
  44. package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js +13 -0
  45. package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js.map +1 -1
  46. package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js +13 -0
  47. package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js.map +1 -1
  48. package/dist/module/lib/Components/core/NavBar/NavBar.stories.js.map +1 -1
  49. package/dist/module/lib/Components/core/OptionList/OptionList.stories.js +52 -0
  50. package/dist/module/lib/Components/core/OptionList/OptionList.stories.js.map +1 -1
  51. package/dist/module/lib/Components/core/SearchInput/SearchInput.stories.js.map +1 -1
  52. package/dist/module/lib/Components/core/SectionHeader/SectionHeader.stories.js.map +1 -1
  53. package/dist/module/lib/Components/core/Skeleton/Skeleton.stories.js.map +1 -1
  54. package/dist/module/lib/Components/core/Spinner/Spinner.stories.js.map +1 -1
  55. package/dist/module/lib/Components/core/Spot/Spot.stories.js +20 -0
  56. package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
  57. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js +4 -0
  58. package/dist/module/lib/Components/core/Stepper/Stepper.stories.js.map +1 -1
  59. package/dist/module/lib/Components/core/Subheader/Subheader.stories.js.map +1 -1
  60. package/dist/module/lib/Components/core/Switch/Switch.stories.js.map +1 -1
  61. package/dist/module/lib/Components/core/Tag/Tag.stories.js +12 -0
  62. package/dist/module/lib/Components/core/Tag/Tag.stories.js.map +1 -1
  63. package/dist/module/lib/Components/core/TextInput/TextInput.figma.js +4 -0
  64. package/dist/module/lib/Components/core/TextInput/TextInput.figma.js.map +1 -1
  65. package/dist/module/lib/Components/core/TextInput/TextInput.mdx +25 -0
  66. package/dist/module/lib/Components/core/TextInput/TextInput.stories.js +29 -0
  67. package/dist/module/lib/Components/core/TextInput/TextInput.stories.js.map +1 -1
  68. package/dist/module/lib/Components/core/TextInput/TextInput.test.js +125 -2
  69. package/dist/module/lib/Components/core/TextInput/TextInput.test.js.map +1 -1
  70. package/dist/module/lib/Components/core/Tile/Tile.stories.js +23 -1
  71. package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
  72. package/dist/module/lib/Components/core/TileButton/TileButton.stories.js +24 -0
  73. package/dist/module/lib/Components/core/TileButton/TileButton.stories.js.map +1 -1
  74. package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js +12 -0
  75. package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js.map +1 -1
  76. package/dist/module/lib/Components/core/Trend/Trend.stories.js +9 -0
  77. package/dist/module/lib/Components/core/Trend/Trend.stories.js.map +1 -1
  78. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +114 -201
  79. package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
  80. package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js +32 -0
  81. package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js.map +1 -0
  82. package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js +60 -0
  83. package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js.map +1 -0
  84. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js +126 -0
  85. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js.map +1 -0
  86. package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js +34 -0
  87. package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js.map +1 -0
  88. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js +46 -0
  89. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js.map +1 -0
  90. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js +111 -0
  91. package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js.map +1 -0
  92. package/dist/module/lib/Components/primitives/Box/Box.stories.js.map +1 -1
  93. package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js +14 -0
  94. package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
  95. package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js +8 -0
  96. package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
  97. package/dist/module/lib/Components/primitives/Pressable/Pressable.stories.js.map +1 -1
  98. package/dist/module/lib/Components/primitives/Text/Text.stories.js.map +1 -1
  99. package/dist/module/lib/Components/symbols/Icon/Icon.stories.js.map +1 -1
  100. package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts +1 -1
  101. package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts.map +1 -1
  102. package/dist/typescript/src/lib/Components/core/Card/Card.d.ts.map +1 -1
  103. package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts +1 -1
  104. package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts.map +1 -1
  105. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts +1 -1
  106. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts.map +1 -1
  107. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts +8 -0
  108. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts.map +1 -0
  109. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts +8 -0
  110. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts.map +1 -0
  111. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts +8 -0
  112. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -0
  113. package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts +27 -0
  114. package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts.map +1 -0
  115. package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts +48 -1
  116. package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts.map +1 -1
  117. package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts +27 -0
  118. package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts.map +1 -0
  119. package/package.json +2 -2
  120. package/src/lib/Components/animations/Pulse/Pulse.stories.tsx +7 -2
  121. package/src/lib/Components/animations/Spin/Spin.stories.tsx +5 -2
  122. package/src/lib/Components/core/AddressInput/AddressInput.figma.tsx +4 -0
  123. package/src/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
  124. package/src/lib/Components/core/AddressInput/AddressInput.stories.tsx +30 -2
  125. package/src/lib/Components/core/AddressInput/AddressInput.tsx +24 -8
  126. package/src/lib/Components/core/AmountDisplay/AmountDisplay.stories.tsx +8 -2
  127. package/src/lib/Components/core/AmountInput/AmountInput.stories.tsx +33 -13
  128. package/src/lib/Components/core/Avatar/Avatar.stories.tsx +1 -1
  129. package/src/lib/Components/core/AvatarButton/AvatarButton.stories.tsx +1 -1
  130. package/src/lib/Components/core/Banner/Banner.stories.tsx +2 -2
  131. package/src/lib/Components/core/Button/Button.stories.tsx +23 -2
  132. package/src/lib/Components/core/Card/Card.stories.tsx +19 -2
  133. package/src/lib/Components/core/Card/Card.test.tsx +10 -3
  134. package/src/lib/Components/core/Card/Card.tsx +20 -9
  135. package/src/lib/Components/core/CardButton/CardButton.stories.tsx +17 -2
  136. package/src/lib/Components/core/Checkbox/Checkbox.stories.tsx +3 -3
  137. package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +15 -2
  138. package/src/lib/Components/core/DescriptionItem/DescriptionItem.stories.tsx +13 -2
  139. package/src/lib/Components/core/Divider/Divider.stories.tsx +2 -2
  140. package/src/lib/Components/core/DotCount/DotCount.stories.tsx +1 -1
  141. package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +1 -1
  142. package/src/lib/Components/core/DotIndicator/DotIndicator.stories.tsx +1 -1
  143. package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +1 -1
  144. package/src/lib/Components/core/IconButton/IconButton.stories.tsx +12 -2
  145. package/src/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.tsx +14 -2
  146. package/src/lib/Components/core/Link/Link.stories.tsx +2 -2
  147. package/src/lib/Components/core/ListItem/ListItem.stories.tsx +18 -0
  148. package/src/lib/Components/core/MediaBanner/MediaBanner.stories.tsx +19 -2
  149. package/src/lib/Components/core/MediaButton/MediaButton.stories.tsx +11 -2
  150. package/src/lib/Components/core/MediaCard/MediaCard.stories.tsx +13 -0
  151. package/src/lib/Components/core/MediaImage/MediaImage.stories.tsx +1 -1
  152. package/src/lib/Components/core/MediaTag/MediaTag.stories.tsx +15 -2
  153. package/src/lib/Components/core/NavBar/NavBar.stories.tsx +2 -2
  154. package/src/lib/Components/core/OptionList/OptionList.stories.tsx +52 -0
  155. package/src/lib/Components/core/PageIndicator/PageIndicator.stories.tsx +1 -1
  156. package/src/lib/Components/core/SearchInput/SearchInput.stories.tsx +2 -2
  157. package/src/lib/Components/core/SearchInput/types.ts +4 -1
  158. package/src/lib/Components/core/SectionHeader/SectionHeader.stories.tsx +2 -2
  159. package/src/lib/Components/core/SegmentedControl/SegmentedControl.stories.tsx +1 -1
  160. package/src/lib/Components/core/Skeleton/Skeleton.stories.tsx +2 -2
  161. package/src/lib/Components/core/Spinner/Spinner.stories.tsx +2 -2
  162. package/src/lib/Components/core/Spot/Spot.stories.tsx +22 -2
  163. package/src/lib/Components/core/Stepper/Stepper.stories.tsx +6 -2
  164. package/src/lib/Components/core/Subheader/Subheader.stories.tsx +2 -2
  165. package/src/lib/Components/core/Switch/Switch.stories.tsx +3 -3
  166. package/src/lib/Components/core/TabBar/TabBar.stories.tsx +1 -1
  167. package/src/lib/Components/core/Tag/Tag.stories.tsx +14 -2
  168. package/src/lib/Components/core/TextInput/TextInput.figma.tsx +4 -0
  169. package/src/lib/Components/core/TextInput/TextInput.mdx +25 -0
  170. package/src/lib/Components/core/TextInput/TextInput.stories.tsx +29 -2
  171. package/src/lib/Components/core/TextInput/TextInput.test.tsx +129 -2
  172. package/src/lib/Components/core/Tile/Tile.stories.tsx +24 -2
  173. package/src/lib/Components/core/TileButton/TileButton.stories.tsx +26 -2
  174. package/src/lib/Components/core/Tooltip/Tooltip.stories.tsx +14 -2
  175. package/src/lib/Components/core/Trend/Trend.stories.tsx +11 -2
  176. package/src/lib/Components/internal/BaseInput/BaseInput.tsx +123 -242
  177. package/src/lib/Components/internal/BaseInput/BaseInputCounter.tsx +35 -0
  178. package/src/lib/Components/internal/BaseInput/BaseInputHelperText.tsx +57 -0
  179. package/src/lib/Components/internal/BaseInput/BaseInputLabel.tsx +137 -0
  180. package/src/lib/Components/internal/BaseInput/multilineLayout.ts +49 -0
  181. package/src/lib/Components/internal/BaseInput/types.ts +49 -1
  182. package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.ts +110 -0
  183. package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.ts +72 -0
  184. package/src/lib/Components/primitives/Box/Box.stories.tsx +2 -2
  185. package/src/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.tsx +6 -2
  186. package/src/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.tsx +5 -2
  187. package/src/lib/Components/primitives/Pressable/Pressable.stories.tsx +2 -2
  188. package/src/lib/Components/primitives/Text/Text.stories.tsx +2 -2
  189. package/src/lib/Components/symbols/Icon/Icon.stories.tsx +2 -2
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
2
  import { Box, Text } from '../../primitives';
3
3
  import { Switch } from './Switch';
4
4
 
5
- const meta: Meta<typeof Switch> = {
5
+ const meta = {
6
6
  id: 'rnative-switch',
7
7
  title: 'Core/Switch',
8
8
  component: Switch,
@@ -34,10 +34,10 @@ const meta: Meta<typeof Switch> = {
34
34
  description: 'Callback function called when the checked state changes',
35
35
  },
36
36
  },
37
- };
37
+ } satisfies Meta<typeof Switch>;
38
38
 
39
39
  export default meta;
40
- type Story = StoryObj<typeof meta>;
40
+ type Story = StoryObj<typeof Switch>;
41
41
 
42
42
  /**
43
43
  * The base switch in its normal state.
@@ -54,7 +54,7 @@ const meta = {
54
54
  } satisfies Meta<typeof TabBar>;
55
55
 
56
56
  export default meta;
57
- type Story = StoryObj<typeof meta>;
57
+ type Story = StoryObj<typeof TabBar>;
58
58
 
59
59
  export const Base: Story = {
60
60
  args: {} as React.ComponentProps<typeof TabBar>,
@@ -3,7 +3,7 @@ import { Box } from '../../primitives/Box';
3
3
  import { Check } from '../../symbols/icons/Check';
4
4
  import { Tag } from './Tag';
5
5
 
6
- const meta: Meta<typeof Tag> = {
6
+ const meta = {
7
7
  component: Tag,
8
8
  id: 'rnative-tag',
9
9
  title: 'Core/Tag',
@@ -35,7 +35,7 @@ const meta: Meta<typeof Tag> = {
35
35
  description: 'Show icon',
36
36
  },
37
37
  },
38
- };
38
+ } satisfies Meta<typeof Tag>;
39
39
 
40
40
  export default meta;
41
41
 
@@ -51,6 +51,9 @@ export const Base: Story = {
51
51
  };
52
52
 
53
53
  export const AppearanceShowcase: Story = {
54
+ args: {
55
+ label: 'Label',
56
+ },
54
57
  render: () => (
55
58
  <Box lx={{ flexDirection: 'column', gap: 's16' }}>
56
59
  <Box lx={{ flexDirection: 'row', gap: 's4' }}>
@@ -80,6 +83,9 @@ export const AppearanceShowcase: Story = {
80
83
  };
81
84
 
82
85
  export const SizeShowcase: Story = {
86
+ args: {
87
+ label: 'Label',
88
+ },
83
89
  render: () => (
84
90
  <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's4' }}>
85
91
  <Tag size='md' label='Large Tag' />
@@ -89,6 +95,9 @@ export const SizeShowcase: Story = {
89
95
  };
90
96
 
91
97
  export const ContentTypeShowcase: Story = {
98
+ args: {
99
+ label: 'Label',
100
+ },
92
101
  render: () => (
93
102
  <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's4' }}>
94
103
  <Tag label='Label only' />
@@ -98,6 +107,9 @@ export const ContentTypeShowcase: Story = {
98
107
  };
99
108
 
100
109
  export const TruncateShowcase: Story = {
110
+ args: {
111
+ label: 'Label',
112
+ },
101
113
  render: () => (
102
114
  <Box lx={{ width: 's176' }}>
103
115
  <Tag label='Very long custom Tag text that should truncate' />
@@ -28,6 +28,9 @@ figma.connect(
28
28
  true: figma.string('counter'),
29
29
  false: undefined,
30
30
  }),
31
+ multiline: figma.enum('type', {
32
+ 'multi-line': true,
33
+ }),
31
34
  },
32
35
  example: (props: any) => (
33
36
  <TextInput
@@ -38,6 +41,7 @@ figma.connect(
38
41
  helperText={props.helperText.label}
39
42
  status={props.status}
40
43
  maxCount={props.maxCount}
44
+ multiline={props.multiline}
41
45
  onChangeText={() => {}}
42
46
  />
43
47
  ),
@@ -36,6 +36,21 @@ The label text automatically floats above the input when content is entered, pro
36
36
 
37
37
  <Canvas of={TextInputStories.WithLabelAndPlaceholder} />
38
38
 
39
+ ### Multiline
40
+
41
+ Set `multiline` to let the field grow with its content instead of scrolling sideways. Everything else is unchanged: floating label, clear button, helper text, and counter behave exactly as they do on a single-line field.
42
+
43
+ - `minLines`: height the field starts at, in lines. Defaults to `1`
44
+ - `maxLines`: growth ceiling, in lines. Once reached, the field scrolls internally instead of growing. Unbounded when omitted
45
+
46
+ <Canvas of={TextInputStories.WithMultiline} />
47
+
48
+ Equal `minLines` and `maxLines` give a fixed-height box that scrolls instead of growing:
49
+
50
+ <Canvas of={TextInputStories.WithMultilineFixedHeight} />
51
+
52
+ > **Note:** The scroll indicator inside a clamped field is drawn by the platform, so unlike the web component there is no `scrollbarWidth` prop to configure it.
53
+
39
54
  ### Clear Button
40
55
 
41
56
  A clear button (×) appears **automatically** when input has content.
@@ -197,6 +212,16 @@ Combine `maxCount` with the native `maxLength` prop to hard-cap the input. The p
197
212
 
198
213
  <Source of={TextInputStories.WithNativeMaxLength} />
199
214
 
215
+ ### Multiline
216
+
217
+ `multiline` lets the field grow with its content, bounded by `minLines` and `maxLines`:
218
+
219
+ <Source of={TextInputStories.WithMultiline} />
220
+
221
+ Equal `minLines` and `maxLines` give a fixed-height box that scrolls once the ceiling is reached.
222
+
223
+ <Source of={TextInputStories.WithMultilineFixedHeight} />
224
+
200
225
  ### With Custom Styling
201
226
 
202
227
  While the component comes with predefined styles, you can extend them using the `style` prop:
@@ -4,7 +4,7 @@ import { View } from 'react-native';
4
4
  import { TextInput } from './TextInput';
5
5
  import { type TextInputProps } from './types';
6
6
 
7
- const meta: Meta<typeof TextInput> = {
7
+ const meta = {
8
8
  component: TextInput,
9
9
  id: 'rnative-textinput',
10
10
  title: 'Core/TextInput',
@@ -17,7 +17,7 @@ const meta: Meta<typeof TextInput> = {
17
17
  },
18
18
  },
19
19
  },
20
- };
20
+ } satisfies Meta<typeof TextInput>;
21
21
 
22
22
  export default meta;
23
23
  type Story = StoryObj<typeof TextInput>;
@@ -174,6 +174,33 @@ export const WithNeutralHint: Story = {
174
174
  },
175
175
  };
176
176
 
177
+ export const WithMultiline: Story = {
178
+ render: (args) => <TextInputStory {...args} />,
179
+ args: {
180
+ label: 'Note',
181
+ helperText: 'Grows from 2 to 5 lines, then scrolls',
182
+ multiline: true,
183
+ minLines: 2,
184
+ maxLines: 5,
185
+ editable: true,
186
+ hideClearButton: false,
187
+ keyboardType: 'default',
188
+ },
189
+ };
190
+
191
+ export const WithMultilineFixedHeight: Story = {
192
+ render: (args) => <TextInputStory {...args} />,
193
+ args: {
194
+ label: 'Note',
195
+ multiline: true,
196
+ minLines: 4,
197
+ maxLines: 4,
198
+ editable: true,
199
+ hideClearButton: false,
200
+ keyboardType: 'default',
201
+ },
202
+ };
203
+
177
204
  export const DisabledTextInput: Story = {
178
205
  render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
179
206
  args: {
@@ -1,14 +1,40 @@
1
- import { describe, expect, it } from '@jest/globals';
1
+ import { afterEach, describe, expect, it, jest } from '@jest/globals';
2
2
  import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
3
  import { render, screen } from '@testing-library/react-native';
4
4
  import type { ReactElement } from 'react';
5
+ import { RuntimeConstants } from '../../../utils';
6
+ import { Pressable } from '../../primitives';
5
7
  import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
6
8
  import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
7
9
  import { InformationFill } from '../../symbols/icons/InformationFill';
8
10
  import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
9
11
  import { TextInput } from './TextInput';
12
+ import type { TextInputProps } from './types';
10
13
 
11
- const { colors } = ledgerLiveThemes.dark;
14
+ const { colors, spacings } = ledgerLiveThemes.dark;
15
+ const { body1, body2 } = ledgerLiveThemes.dark.typographies.xs.body;
16
+
17
+ // Labelled fields use body2 plus a reserved label row; unlabelled (AddressInput)
18
+ // use body1. Chrome is padding (and that label row) so minLines={1} matches s48.
19
+ const geometries: {
20
+ name: string;
21
+ props: Partial<TextInputProps>;
22
+ lineHeight: number;
23
+ chrome: number;
24
+ }[] = [
25
+ {
26
+ name: 'labelled',
27
+ props: { label: 'Note' },
28
+ lineHeight: body2.lineHeight,
29
+ chrome: spacings.s16 + 2 * spacings.s6,
30
+ },
31
+ {
32
+ name: 'unlabelled',
33
+ props: {},
34
+ lineHeight: body1.lineHeight,
35
+ chrome: 2 * spacings.s12,
36
+ },
37
+ ];
12
38
 
13
39
  const renderWithProvider = (
14
40
  component: ReactElement,
@@ -170,4 +196,105 @@ describe('TextInput', () => {
170
196
  expect(screen.UNSAFE_queryByType(DeleteCircleFill)).toBeNull();
171
197
  });
172
198
  });
199
+
200
+ // The height itself is native, so the bounds are all these tests can reach: the
201
+ // container carries the minLines floor, the input box carries the ceiling.
202
+ describe('Multiline', () => {
203
+ afterEach(() => {
204
+ jest.restoreAllMocks();
205
+ });
206
+
207
+ const field = () => screen.getByPlaceholderText('Write a note');
208
+ const container = () => screen.UNSAFE_getByType(Pressable);
209
+
210
+ const renderMultiline = (props: Partial<TextInputProps> = {}) =>
211
+ renderWithProvider(
212
+ <TextInput
213
+ placeholder='Write a note'
214
+ value=''
215
+ onChangeText={() => {}}
216
+ {...props}
217
+ />,
218
+ );
219
+
220
+ it('stays single-line by default', () => {
221
+ renderMultiline({ label: 'Note' });
222
+
223
+ const { multiline, style } = field().props;
224
+
225
+ expect(multiline).toBeFalsy();
226
+ expect(style.minHeight).toBeUndefined();
227
+ });
228
+
229
+ describe.each(geometries)('$name', ({ props, lineHeight, chrome }) => {
230
+ const renderCase = (extra: Partial<TextInputProps> = {}) =>
231
+ renderMultiline({ ...props, multiline: true, ...extra });
232
+
233
+ it('floors the field at minLines and leaves it unbounded above', () => {
234
+ renderCase({ minLines: 2 });
235
+
236
+ expect(field().props.multiline).toBe(true);
237
+ expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
238
+ expect(field().props.style.maxHeight).toBeUndefined();
239
+ });
240
+
241
+ // A box taller than its text would drop the value below the placeholder on
242
+ // Android, which centres a line within its box.
243
+ it('keeps the input box a single line whatever the floor is', () => {
244
+ renderCase({ minLines: 3 });
245
+
246
+ expect(field().props.style.minHeight).toBe(lineHeight);
247
+ });
248
+
249
+ it('caps the growth at maxLines', () => {
250
+ renderCase({ minLines: 2, maxLines: 4 });
251
+
252
+ expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
253
+ expect(field().props.style.maxHeight).toBe(4 * lineHeight);
254
+ });
255
+
256
+ it('gives a fixed box when minLines and maxLines match', () => {
257
+ renderCase({ minLines: 3, maxLines: 3 });
258
+
259
+ expect(container().props.style.minHeight).toBe(3 * lineHeight + chrome);
260
+ expect(field().props.style.maxHeight).toBe(3 * lineHeight);
261
+ });
262
+
263
+ it('lets maxLines win over a taller minLines', () => {
264
+ renderCase({ minLines: 5, maxLines: 2 });
265
+
266
+ expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
267
+ expect(field().props.style.maxHeight).toBe(2 * lineHeight);
268
+ });
269
+
270
+ it('takes the token line height on Android', () => {
271
+ jest.spyOn(RuntimeConstants, 'isAndroid', 'get').mockReturnValue(true);
272
+
273
+ renderCase();
274
+
275
+ expect(field().props.style.lineHeight).toBe(lineHeight);
276
+ });
277
+
278
+ it('leaves the line height natural on iOS', () => {
279
+ jest.spyOn(RuntimeConstants, 'isIOS', 'get').mockReturnValue(true);
280
+
281
+ renderCase();
282
+
283
+ expect(field().props.style.lineHeight).toBe(0);
284
+ });
285
+ });
286
+
287
+ it('still renders the clear button and the counter', () => {
288
+ renderMultiline({
289
+ label: 'Note',
290
+ multiline: true,
291
+ minLines: 2,
292
+ value: 'Hello',
293
+ maxCount: 32,
294
+ });
295
+
296
+ expect(screen.UNSAFE_getByType(DeleteCircleFill)).toBeTruthy();
297
+ expect(screen.getByText('5/32')).toBeTruthy();
298
+ });
299
+ });
173
300
  });
@@ -11,7 +11,7 @@ import {
11
11
  TileTrailingContent,
12
12
  } from './Tile';
13
13
 
14
- const meta: Meta<typeof Tile> = {
14
+ const meta = {
15
15
  component: Tile,
16
16
  subcomponents: {
17
17
  TileContent,
@@ -48,7 +48,7 @@ const meta: Meta<typeof Tile> = {
48
48
  control: 'boolean',
49
49
  },
50
50
  },
51
- };
51
+ } satisfies Meta<typeof Tile>;
52
52
 
53
53
  export default meta;
54
54
  type Story = StoryObj<typeof Tile>;
@@ -58,6 +58,7 @@ export const Base: Story = {
58
58
  appearance: 'no-background',
59
59
  disabled: false,
60
60
  centered: false,
61
+ children: null,
61
62
  },
62
63
  render: (args) => (
63
64
  <Tile {...args} lx={{ maxWidth: 's112' }}>
@@ -86,6 +87,9 @@ export const Base: Story = {
86
87
  };
87
88
 
88
89
  export const VariantsShowcase: Story = {
90
+ args: {
91
+ children: null,
92
+ },
89
93
  render: () => (
90
94
  <Box lx={{ flexDirection: 'column', gap: 's16' }}>
91
95
  <Tile lx={{ maxWidth: 's176' }}>
@@ -128,6 +132,9 @@ export const VariantsShowcase: Story = {
128
132
  };
129
133
 
130
134
  export const WithSecondaryAction: Story = {
135
+ args: {
136
+ children: null,
137
+ },
131
138
  render: () => (
132
139
  <Tile
133
140
  onLongPress={() => alert('Long press - secondary action triggered!')}
@@ -161,6 +168,9 @@ export const WithSecondaryAction: Story = {
161
168
  };
162
169
 
163
170
  export const HorizontalList: Story = {
171
+ args: {
172
+ children: null,
173
+ },
164
174
  render: () => (
165
175
  <Box lx={{ flexDirection: 'column', gap: 's16' }}>
166
176
  <Box
@@ -207,6 +217,9 @@ export const HorizontalList: Story = {
207
217
  };
208
218
 
209
219
  export const ResponsiveLayout: Story = {
220
+ args: {
221
+ children: null,
222
+ },
210
223
  render: () => (
211
224
  <Box lx={{ width: 'full', flexDirection: 'column', gap: 's16' }}>
212
225
  <Box>
@@ -235,6 +248,9 @@ export const ResponsiveLayout: Story = {
235
248
  };
236
249
 
237
250
  export const AppearanceShowcase: Story = {
251
+ args: {
252
+ children: null,
253
+ },
238
254
  render: () => (
239
255
  <Box lx={{ flexDirection: 'column', gap: 's24' }}>
240
256
  <Box>
@@ -284,6 +300,9 @@ export const AppearanceShowcase: Story = {
284
300
  };
285
301
 
286
302
  export const CenteredShowcase: Story = {
303
+ args: {
304
+ children: null,
305
+ },
287
306
  render: () => (
288
307
  <Box lx={{ flexDirection: 'row', gap: 's8' }}>
289
308
  <Tile appearance='card' lx={{ width: 's128' }}>
@@ -327,6 +346,9 @@ export const CenteredShowcase: Story = {
327
346
  };
328
347
 
329
348
  export const SizeShowcase: Story = {
349
+ args: {
350
+ children: null,
351
+ },
330
352
  render: () => (
331
353
  <Box lx={{ flexDirection: 'column', gap: 's24' }}>
332
354
  <Box>
@@ -13,7 +13,7 @@ const iconOptions = {
13
13
  Cart,
14
14
  };
15
15
 
16
- const meta: Meta<typeof TileButton> = {
16
+ const meta = {
17
17
  component: TileButton,
18
18
  id: 'rnative-tilebutton',
19
19
  title: 'Core/TileButton',
@@ -31,7 +31,7 @@ const meta: Meta<typeof TileButton> = {
31
31
  action: 'pressed',
32
32
  },
33
33
  },
34
- };
34
+ } satisfies Meta<typeof TileButton>;
35
35
 
36
36
  export default meta;
37
37
  type Story = StoryObj<typeof TileButton>;
@@ -52,6 +52,10 @@ export const Base: Story = {
52
52
  };
53
53
 
54
54
  export const AppearanceShowcase: Story = {
55
+ args: {
56
+ icon: Settings,
57
+ children: 'Settings',
58
+ },
55
59
  render: (args) => (
56
60
  <View style={{ gap: 16 }}>
57
61
  <View style={{ flexDirection: 'row', gap: 16 }}>
@@ -67,6 +71,10 @@ export const AppearanceShowcase: Story = {
67
71
  };
68
72
 
69
73
  export const DisabledShowcase: Story = {
74
+ args: {
75
+ icon: Settings,
76
+ children: 'Settings',
77
+ },
70
78
  render: (args) => (
71
79
  <View style={{ flexDirection: 'row', gap: 16 }}>
72
80
  <TileButton icon={Settings} onPress={args.onPress} disabled>
@@ -85,6 +93,10 @@ export const DisabledShowcase: Story = {
85
93
  };
86
94
 
87
95
  export const IconsShowcase: Story = {
96
+ args: {
97
+ icon: Settings,
98
+ children: 'Settings',
99
+ },
88
100
  render: (args) => (
89
101
  <View style={{ flexDirection: 'row', gap: 16 }}>
90
102
  <TileButton icon={Settings} onPress={args.onPress}>
@@ -104,6 +116,10 @@ export const IconsShowcase: Story = {
104
116
  };
105
117
 
106
118
  export const GridLayout: Story = {
119
+ args: {
120
+ icon: Settings,
121
+ children: 'Settings',
122
+ },
107
123
  render: (args) => (
108
124
  <View style={{ width: 343, gap: 8 }}>
109
125
  {/* 2-button row */}
@@ -142,6 +158,10 @@ export const GridLayout: Story = {
142
158
  };
143
159
 
144
160
  export const WidthShowcase: Story = {
161
+ args: {
162
+ icon: Settings,
163
+ children: 'Settings',
164
+ },
145
165
  render: (args) => (
146
166
  <View
147
167
  style={{
@@ -163,6 +183,10 @@ export const WidthShowcase: Story = {
163
183
  };
164
184
 
165
185
  export const TruncationShowcase: Story = {
186
+ args: {
187
+ icon: Settings,
188
+ children: 'Settings',
189
+ },
166
190
  render: (args) => (
167
191
  <View style={{ flexDirection: 'row', gap: 16 }}>
168
192
  <View style={{ width: 80 }}>
@@ -7,18 +7,21 @@ import { InteractiveIcon } from '../InteractiveIcon';
7
7
  import { GlobalTooltipBottomSheet } from './GlobalTooltipBottomSheet';
8
8
  import { Tooltip, TooltipTrigger, TooltipContent } from './Tooltip';
9
9
 
10
- const meta: Meta<typeof Tooltip> = {
10
+ const meta = {
11
11
  component: Tooltip,
12
12
  subcomponents: { TooltipTrigger, TooltipContent },
13
13
  id: 'rnative-tooltip',
14
14
  title: 'Core/Tooltip',
15
- };
15
+ } satisfies Meta<typeof Tooltip>;
16
16
 
17
17
  export default meta;
18
18
 
19
19
  type Story = StoryObj<typeof Tooltip>;
20
20
 
21
21
  export const Base: Story = {
22
+ args: {
23
+ children: null,
24
+ },
22
25
  render: () => (
23
26
  <>
24
27
  <Box
@@ -45,6 +48,9 @@ export const Base: Story = {
45
48
  };
46
49
 
47
50
  export const WithCustomContent: Story = {
51
+ args: {
52
+ children: null,
53
+ },
48
54
  render: () => (
49
55
  <>
50
56
  <Box
@@ -83,6 +89,9 @@ export const WithCustomContent: Story = {
83
89
  };
84
90
 
85
91
  export const WithMultipleTooltips: Story = {
92
+ args: {
93
+ children: null,
94
+ },
86
95
  render: () => (
87
96
  <>
88
97
  <Box
@@ -135,6 +144,9 @@ export const WithMultipleTooltips: Story = {
135
144
  };
136
145
 
137
146
  export const WithChangeCallback: Story = {
147
+ args: {
148
+ children: null,
149
+ },
138
150
  render: () => {
139
151
  return (
140
152
  <>
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
2
  import { Box } from '../../primitives/Box';
3
3
  import { Trend } from './Trend';
4
4
 
5
- const meta: Meta<typeof Trend> = {
5
+ const meta = {
6
6
  component: Trend,
7
7
  id: 'rnative-trend',
8
8
  title: 'Core/Trend',
@@ -18,7 +18,7 @@ const meta: Meta<typeof Trend> = {
18
18
  control: 'boolean',
19
19
  },
20
20
  },
21
- };
21
+ } satisfies Meta<typeof Trend>;
22
22
 
23
23
  export default meta;
24
24
 
@@ -33,6 +33,9 @@ export const Base: Story = {
33
33
  };
34
34
 
35
35
  export const VariantShowcase: Story = {
36
+ args: {
37
+ value: 5.25,
38
+ },
36
39
  render: () => (
37
40
  <Box lx={{ flexDirection: 'column', gap: 's8' }}>
38
41
  <Trend value={5.25} />
@@ -43,6 +46,9 @@ export const VariantShowcase: Story = {
43
46
  };
44
47
 
45
48
  export const SizeShowcase: Story = {
49
+ args: {
50
+ value: 5.25,
51
+ },
46
52
  render: () => (
47
53
  <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's16' }}>
48
54
  <Trend value={5.25} size='md' />
@@ -52,6 +58,9 @@ export const SizeShowcase: Story = {
52
58
  };
53
59
 
54
60
  export const DisabledShowcase: Story = {
61
+ args: {
62
+ value: 5.25,
63
+ },
55
64
  render: () => (
56
65
  <Box lx={{ flexDirection: 'column', gap: 's8' }}>
57
66
  <Trend value={5.25} disabled />