@ledgerhq/lumen-ui-rnative 0.0.46 → 0.0.48

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 (148) hide show
  1. package/dist/package.json +6 -2
  2. package/dist/src/lib/Components/Divider/Divider.d.ts +25 -0
  3. package/dist/src/lib/Components/Divider/Divider.d.ts.map +1 -0
  4. package/dist/src/lib/Components/Divider/Divider.js +40 -0
  5. package/dist/src/lib/Components/Divider/Divider.stories.d.ts +9 -0
  6. package/dist/src/lib/Components/Divider/Divider.stories.d.ts.map +1 -0
  7. package/dist/src/lib/Components/Divider/Divider.stories.js +51 -0
  8. package/dist/src/lib/Components/Divider/index.d.ts +3 -0
  9. package/dist/src/lib/Components/Divider/index.d.ts.map +1 -0
  10. package/dist/src/lib/Components/Divider/index.js +1 -0
  11. package/dist/src/lib/Components/Divider/types.d.ts +9 -0
  12. package/dist/src/lib/Components/Divider/types.d.ts.map +1 -0
  13. package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
  14. package/dist/src/lib/Components/Icon/Icon.js +3 -4
  15. package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  16. package/dist/src/lib/Components/Icon/createIcon.js +1 -1
  17. package/dist/src/lib/Components/ListItem/ListItem.d.ts +88 -34
  18. package/dist/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  19. package/dist/src/lib/Components/ListItem/ListItem.js +248 -97
  20. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts +2 -3
  21. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts.map +1 -1
  22. package/dist/src/lib/Components/ListItem/ListItem.stories.js +63 -73
  23. package/dist/src/lib/Components/ListItem/index.d.ts +1 -1
  24. package/dist/src/lib/Components/ListItem/index.d.ts.map +1 -1
  25. package/dist/src/lib/Components/ListItem/index.js +1 -1
  26. package/dist/src/lib/Components/ListItem/types.d.ts +106 -0
  27. package/dist/src/lib/Components/ListItem/types.d.ts.map +1 -0
  28. package/dist/src/lib/Components/ListItem/types.js +1 -0
  29. package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
  30. package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.js +2 -7
  31. package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
  32. package/dist/src/lib/Components/Select/Select.js +4 -10
  33. package/dist/src/lib/Components/Select/types.d.ts.map +1 -1
  34. package/dist/src/lib/Components/Spot/types.d.ts +1 -1
  35. package/dist/src/lib/Components/Spot/types.d.ts.map +1 -1
  36. package/dist/src/lib/Components/Tile/Tile.d.ts +84 -19
  37. package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
  38. package/dist/src/lib/Components/Tile/Tile.figma.js +8 -18
  39. package/dist/src/lib/Components/Tile/Tile.js +160 -59
  40. package/dist/src/lib/Components/Tile/Tile.stories.d.ts +2 -2
  41. package/dist/src/lib/Components/Tile/Tile.stories.d.ts.map +1 -1
  42. package/dist/src/lib/Components/Tile/Tile.stories.js +30 -81
  43. package/dist/src/lib/Components/Tile/index.d.ts +1 -1
  44. package/dist/src/lib/Components/Tile/index.d.ts.map +1 -1
  45. package/dist/src/lib/Components/Tile/index.js +1 -1
  46. package/dist/src/lib/Components/Tile/types.d.ts +29 -19
  47. package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
  48. package/dist/src/lib/Components/index.d.ts +1 -0
  49. package/dist/src/lib/Components/index.d.ts.map +1 -1
  50. package/dist/src/lib/Components/index.js +1 -0
  51. package/dist/src/lib/utils/index.d.ts +3 -4
  52. package/dist/src/lib/utils/index.d.ts.map +1 -1
  53. package/dist/src/lib/utils/index.js +3 -4
  54. package/dist/src/lib/utils/react/{extract-text-from-children.d.ts → extractTextFromChildren.d.ts} +1 -1
  55. package/dist/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -0
  56. package/dist/src/lib/utils/react/index.d.ts +1 -1
  57. package/dist/src/lib/utils/react/index.d.ts.map +1 -1
  58. package/dist/src/lib/utils/react/index.js +1 -1
  59. package/dist/src/lib/utils/startTransition/index.d.ts +2 -0
  60. package/dist/src/lib/utils/startTransition/index.d.ts.map +1 -0
  61. package/dist/src/lib/utils/startTransition/index.js +1 -0
  62. package/dist/src/lib/utils/{start-transition/start-transition.d.ts → startTransition/startTransition.d.ts} +1 -1
  63. package/dist/src/lib/utils/startTransition/startTransition.d.ts.map +1 -0
  64. package/dist/src/lib/utils/useControllableState/index.d.ts +2 -0
  65. package/dist/src/lib/utils/useControllableState/index.d.ts.map +1 -0
  66. package/dist/src/lib/utils/useControllableState/index.js +1 -0
  67. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.d.ts → useControllableState/useControllableState.d.ts} +1 -1
  68. package/dist/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -0
  69. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.js → useControllableState/useControllableState.js} +2 -2
  70. package/dist/src/lib/utils/useEvent/index.d.ts +3 -0
  71. package/dist/src/lib/utils/useEvent/index.d.ts.map +1 -0
  72. package/dist/src/lib/utils/useEvent/index.js +2 -0
  73. package/dist/src/lib/utils/{use-event/use-event.d.ts → useEvent/useEvent.d.ts} +1 -1
  74. package/dist/src/lib/utils/useEvent/useEvent.d.ts.map +1 -0
  75. package/dist/src/lib/utils/{use-event/use-event.js → useEvent/useEvent.js} +1 -1
  76. package/dist/src/lib/utils/{use-event/use-get.d.ts → useEvent/useGet.d.ts} +1 -1
  77. package/dist/src/lib/utils/useEvent/useGet.d.ts.map +1 -0
  78. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts +1 -1
  79. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts.map +1 -1
  80. package/dist/src/styles/provider/LumenStyleSheetProvider.js +1 -2
  81. package/package.json +6 -2
  82. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -0
  83. package/src/lib/Components/Divider/Divider.mdx +151 -0
  84. package/src/lib/Components/Divider/Divider.stories.tsx +140 -0
  85. package/src/lib/Components/Divider/Divider.test.tsx +92 -0
  86. package/src/lib/Components/Divider/Divider.tsx +52 -0
  87. package/src/lib/Components/Divider/index.ts +2 -0
  88. package/src/lib/Components/Divider/types.ts +9 -0
  89. package/src/lib/Components/Icon/Icon.tsx +3 -5
  90. package/src/lib/Components/Icon/createIcon.ts +1 -1
  91. package/src/lib/Components/ListItem/ListItem.mdx +402 -124
  92. package/src/lib/Components/ListItem/ListItem.stories.tsx +357 -228
  93. package/src/lib/Components/ListItem/ListItem.tsx +444 -181
  94. package/src/lib/Components/ListItem/index.ts +1 -1
  95. package/src/lib/Components/ListItem/types.ts +121 -0
  96. package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +5 -7
  97. package/src/lib/Components/Select/Select.tsx +4 -18
  98. package/src/lib/Components/Select/types.ts +1 -3
  99. package/src/lib/Components/Spot/types.ts +5 -1
  100. package/src/lib/Components/Switch/Switch.mdx +1 -0
  101. package/src/lib/Components/Tile/Tile.figma.tsx +24 -23
  102. package/src/lib/Components/Tile/Tile.mdx +128 -35
  103. package/src/lib/Components/Tile/Tile.stories.tsx +167 -146
  104. package/src/lib/Components/Tile/Tile.test.tsx +193 -221
  105. package/src/lib/Components/Tile/Tile.tsx +270 -123
  106. package/src/lib/Components/Tile/index.ts +7 -1
  107. package/src/lib/Components/Tile/types.ts +38 -19
  108. package/src/lib/Components/index.ts +1 -0
  109. package/src/lib/utils/index.ts +3 -4
  110. package/src/lib/utils/react/index.ts +1 -1
  111. package/src/lib/utils/startTransition/index.ts +1 -0
  112. package/src/lib/utils/useControllableState/index.ts +1 -0
  113. package/src/lib/utils/{use-controllable-state/use-controllable-state.ts → useControllableState/useControllableState.ts} +2 -2
  114. package/src/lib/utils/useEvent/index.ts +2 -0
  115. package/src/lib/utils/{use-event/use-event.ts → useEvent/useEvent.ts} +1 -1
  116. package/src/styles/provider/LumenStyleSheetProvider.tsx +2 -3
  117. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts +0 -31
  118. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts.map +0 -1
  119. package/dist/src/lib/utils/react/extract-text-from-children.d.ts.map +0 -1
  120. package/dist/src/lib/utils/start-transition/index.d.ts +0 -2
  121. package/dist/src/lib/utils/start-transition/index.d.ts.map +0 -1
  122. package/dist/src/lib/utils/start-transition/index.js +0 -1
  123. package/dist/src/lib/utils/start-transition/start-transition.d.ts.map +0 -1
  124. package/dist/src/lib/utils/string-utils.d.ts +0 -6
  125. package/dist/src/lib/utils/string-utils.d.ts.map +0 -1
  126. package/dist/src/lib/utils/string-utils.js +0 -12
  127. package/dist/src/lib/utils/use-controllable-state/index.d.ts +0 -2
  128. package/dist/src/lib/utils/use-controllable-state/index.d.ts.map +0 -1
  129. package/dist/src/lib/utils/use-controllable-state/index.js +0 -1
  130. package/dist/src/lib/utils/use-controllable-state/use-controllable-state.d.ts.map +0 -1
  131. package/dist/src/lib/utils/use-event/index.d.ts +0 -3
  132. package/dist/src/lib/utils/use-event/index.d.ts.map +0 -1
  133. package/dist/src/lib/utils/use-event/index.js +0 -2
  134. package/dist/src/lib/utils/use-event/use-event.d.ts.map +0 -1
  135. package/dist/src/lib/utils/use-event/use-get.d.ts.map +0 -1
  136. package/src/lib/Components/ListItem/ListItem.types.ts +0 -31
  137. package/src/lib/utils/start-transition/index.ts +0 -1
  138. package/src/lib/utils/string-utils.test.ts +0 -73
  139. package/src/lib/utils/string-utils.ts +0 -11
  140. package/src/lib/utils/use-controllable-state/index.ts +0 -1
  141. package/src/lib/utils/use-event/index.ts +0 -2
  142. /package/dist/src/lib/Components/{ListItem/ListItem.types.js → Divider/types.js} +0 -0
  143. /package/dist/src/lib/utils/react/{extract-text-from-children.js → extractTextFromChildren.js} +0 -0
  144. /package/dist/src/lib/utils/{start-transition/start-transition.js → startTransition/startTransition.js} +0 -0
  145. /package/dist/src/lib/utils/{use-event/use-get.js → useEvent/useGet.js} +0 -0
  146. /package/src/lib/utils/react/{extract-text-from-children.ts → extractTextFromChildren.ts} +0 -0
  147. /package/src/lib/utils/{start-transition/start-transition.ts → startTransition/startTransition.ts} +0 -0
  148. /package/src/lib/utils/{use-event/use-get.ts → useEvent/useGet.ts} +0 -0
@@ -1,20 +1,35 @@
1
1
  import { Meta, Story, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
2
  import { Box } from '../Utility';
3
3
  import * as ListItemStories from './ListItem.stories';
4
- import { ListItem } from './ListItem';
5
- import { CustomTabs, Tab } from '../../../../.storybook/components';
4
+ import {
5
+ ListItem,
6
+ ListItemLeading,
7
+ ListItemContent,
8
+ ListItemTitle,
9
+ ListItemDescription,
10
+ ListItemTrailing,
11
+ ListItemSpot,
12
+ ListItemTruncate,
13
+ } from './ListItem';
14
+ import {
15
+ CustomTabs,
16
+ Tab,
17
+ DoVsDontRow,
18
+ DoBlockItem,
19
+ DontBlockItem,
20
+ } from '../../../../.storybook/components';
6
21
  import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
7
22
 
8
23
  <Meta title='Components/ListItem' of={ListItemStories} />
9
24
 
10
- # 📋 ListItem
25
+ # ListItem
11
26
 
12
27
  <CustomTabs>
13
28
  <Tab label="Overview">
14
29
 
15
30
  ## Introduction
16
31
 
17
- ListItems are flexible interactive elements designed for lists in React Native applications. They provide a structured way to display a title with optional description, leading content (usually a Spot), description tag, and flexible trailing content with native touch interactions.
32
+ ListItems are flexible interactive elements designed for lists. They use a composite component pattern that provides full flexibility over layout and content through composable sub-components.
18
33
 
19
34
  > View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=2255-4155).
20
35
 
@@ -22,11 +37,13 @@ ListItems are flexible interactive elements designed for lists in React Native a
22
37
 
23
38
  <Canvas of={ListItemStories.Base} />
24
39
 
25
- - **Title**: The main label of the item (required)
26
- - **Leading Content (optional)**: Visually represents the item's category or action, usually using a Spot component
27
- - **Description (optional)**: Provides additional context
28
- - **Description Tag (optional)**: Small tag next to description for status or labels
29
- - **Trailing Content (optional)**: Arbitrary content to be displayed on the right side
40
+ - **ListItem**: Root interactive container (Pressable)
41
+ - **ListItemLeading**: Left section containing visual element and content
42
+ - **ListItemSpot**: Spot adapter that inherits disabled state from parent ListItem
43
+ - **ListItemContent**: Container for title and description
44
+ - **ListItemTitle**: The main label of the item (required)
45
+ - **ListItemDescription**: Provides additional context, can include inline Tag
46
+ - **ListItemTrailing**: Right section for trailing content (chevron, switch, value, etc.)
30
47
 
31
48
  ## Properties
32
49
 
@@ -37,20 +54,15 @@ ListItems are flexible interactive elements designed for lists in React Native a
37
54
 
38
55
  ### Trailing Content Variants
39
56
 
40
- ListItems support arbitrary trailing content to suit different interaction patterns:
41
-
42
- - **caret**: Navigation indicator (chevron right)
43
- - **value**: Displays a primary value with optional subvalue
44
- - **tag**: Shows a tag for status or category
45
- - **icon**: Custom trailing icon
57
+ ListItems follow composite component pattern to allow for maximum flexibility over layout and content through composable sub-components.
46
58
 
47
- <Canvas of={ListItemStories.TrailingContentVariantsShowcase} />
59
+ <Canvas of={ListItemStories.VariantsShowcase} />
48
60
 
49
- ### States
61
+ ### Disabled State
50
62
 
51
- ListItems support standard states including active and disabled for touch interactions.
63
+ When disabled, the ListItem becomes non-interactive. The disabled state is automatically propagated to ListItemSpot and ListItemDescription via context.
52
64
 
53
- <Canvas of={ListItemStories.StateShowcase} />
65
+ <Canvas of={ListItemStories.DisabledState} />
54
66
 
55
67
  ## Responsive Layout
56
68
 
@@ -70,9 +82,9 @@ ListItems adapt to their container width, truncating long titles and description
70
82
  React Native ListItem includes:
71
83
 
72
84
  - Native touch feedback with `Pressable`
73
- - Proper text truncation with ellipsis
74
- - Disabled state handling
75
- - Screen reader support through React Native's accessibility features
85
+ - Proper text truncation with `numberOfLines` and `ellipsizeMode`
86
+ - Disabled state handling with automatic context propagation
87
+ - Screen reader support through React Native's accessibility features (`accessibilityRole`, `accessibilityState`)
76
88
 
77
89
  </Tab>
78
90
  <Tab label="Implementation">
@@ -81,19 +93,27 @@ React Native ListItem includes:
81
93
 
82
94
  Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
83
95
 
84
- ### Basic Usage
96
+ ## Basic Usage
97
+
98
+ The ListItem uses a composite component pattern for maximum flexibility:
85
99
 
86
100
  ```tsx
87
- import { ListItem } from '@ledgerhq/lumen-ui-rnative';
88
- import { ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
101
+ import {
102
+ ListItem,
103
+ ListItemLeading,
104
+ ListItemContent,
105
+ ListItemTitle,
106
+ } from '@ledgerhq/lumen-ui-rnative';
89
107
 
90
108
  function MyComponent() {
91
109
  return (
92
- <ListItem
93
- title='Settings'
94
- trailingContent={<ChevronRight size={24} />}
95
- onPress={() => console.log('Pressed!')}
96
- />
110
+ <ListItem onPress={() => console.log('Pressed!')}>
111
+ <ListItemLeading>
112
+ <ListItemContent>
113
+ <ListItemTitle>Settings</ListItemTitle>
114
+ </ListItemContent>
115
+ </ListItemLeading>
116
+ </ListItem>
97
117
  );
98
118
  }
99
119
  ```
@@ -103,38 +123,67 @@ function MyComponent() {
103
123
  Add a description below the title for additional context:
104
124
 
105
125
  ```tsx
106
- import { ListItem } from '@ledgerhq/lumen-ui-rnative';
126
+ import {
127
+ ListItem,
128
+ ListItemLeading,
129
+ ListItemContent,
130
+ ListItemTitle,
131
+ ListItemDescription,
132
+ ListItemTrailing,
133
+ } from '@ledgerhq/lumen-ui-rnative';
107
134
  import { ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
108
135
 
109
136
  function MyComponent() {
110
137
  return (
111
- <ListItem
112
- title='Account Settings'
113
- description='Manage your profile and preferences'
114
- trailingContent={<ChevronRight size={24} />}
115
- onPress={() => console.log('Pressed!')}
116
- />
138
+ <ListItem>
139
+ <ListItemLeading>
140
+ <ListItemContent>
141
+ <ListItemTitle>Account Settings</ListItemTitle>
142
+ <ListItemDescription>
143
+ Manage your profile and preferences
144
+ </ListItemDescription>
145
+ </ListItemContent>
146
+ </ListItemLeading>
147
+ <ListItemTrailing>
148
+ <ChevronRight size={24} />
149
+ </ListItemTrailing>
150
+ </ListItem>
117
151
  );
118
152
  }
119
153
  ```
120
154
 
121
155
  ### With Leading Content
122
156
 
123
- Include a Spot component as leading icon for visual identification:
157
+ Include a ListItemSpot component as leading icon for visual identification. It automatically inherits the disabled state from the parent ListItem:
124
158
 
125
159
  ```tsx
126
- import { ListItem, Spot } from '@ledgerhq/lumen-ui-rnative';
160
+ import {
161
+ ListItem,
162
+ ListItemLeading,
163
+ ListItemContent,
164
+ ListItemTitle,
165
+ ListItemDescription,
166
+ ListItemTrailing,
167
+ ListItemSpot,
168
+ } from '@ledgerhq/lumen-ui-rnative';
127
169
  import { Settings, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
128
170
 
129
171
  function MyComponent() {
130
172
  return (
131
- <ListItem
132
- title='Settings'
133
- description='Manage your profile and preferences'
134
- leadingContent={<Spot appearance='icon' icon={Settings} />}
135
- trailingContent={<ChevronRight size={24} />}
136
- onPress={() => console.log('Pressed!')}
137
- />
173
+ <ListItem>
174
+ <ListItemLeading>
175
+ <ListItemSpot appearance='icon' icon={Settings} />
176
+ <ListItemContent>
177
+ <ListItemTitle>Settings</ListItemTitle>
178
+ <ListItemDescription>
179
+ Manage your profile and preferences
180
+ </ListItemDescription>
181
+ </ListItemContent>
182
+ </ListItemLeading>
183
+ <ListItemTrailing>
184
+ <ChevronRight size={24} />
185
+ </ListItemTrailing>
186
+ </ListItem>
138
187
  );
139
188
  }
140
189
  ```
@@ -144,67 +193,109 @@ function MyComponent() {
144
193
  The ListItem supports arbitrary trailing content variants. Below are some examples:
145
194
 
146
195
  ```tsx
147
- import { ListItem, Spot, Tag, Box, Text } from '@ledgerhq/lumen-ui-rnative';
196
+ import { useState } from 'react';
148
197
  import {
149
- Settings,
150
- PenEdit,
151
- ChevronRight,
152
- User,
153
- } from '@ledgerhq/lumen-ui-rnative/symbols';
198
+ ListItem,
199
+ ListItemLeading,
200
+ ListItemContent,
201
+ ListItemTitle,
202
+ ListItemDescription,
203
+ ListItemTrailing,
204
+ ListItemSpot,
205
+ Switch,
206
+ Tag,
207
+ Box,
208
+ } from '@ledgerhq/lumen-ui-rnative';
209
+ import { Settings, Check, ChevronRight, User } from '@ledgerhq/lumen-ui-rnative/symbols';
154
210
 
155
211
  function ListVariants() {
212
+ const [selected, setSelected] = useState(false);
213
+
156
214
  return (
157
- <Box lx={{ flexDirection: 'column', gap: 's0', maxWidth: 's320' }}>
215
+ <Box lx={{ flexDirection: 'column', maxWidth: 's320' }}>
158
216
  {/* Chevron - For navigation items */}
159
- <ListItem
160
- title='Chevron Variant'
161
- description='With description'
162
- leadingContent={<Spot appearance='icon' icon={User} />}
163
- trailingContent={<ChevronRight size={24} />}
164
- onPress={() => console.log('Navigate')}
165
- />
217
+ <ListItem>
218
+ <ListItemLeading>
219
+ <ListItemSpot appearance='icon' icon={User} />
220
+ <ListItemContent>
221
+ <ListItemTitle>Chevron Variant</ListItemTitle>
222
+ <ListItemDescription>With description</ListItemDescription>
223
+ </ListItemContent>
224
+ </ListItemLeading>
225
+ <ListItemTrailing>
226
+ <ChevronRight size={24} />
227
+ </ListItemTrailing>
228
+ </ListItem>
229
+
230
+ {/* Switch - For switchable options */}
231
+ <ListItem onPress={() => setSelected(!selected)}>
232
+ <ListItemLeading>
233
+ <ListItemSpot appearance='icon' icon={User} />
234
+ <ListItemContent>
235
+ <ListItemTitle>Enable Feature</ListItemTitle>
236
+ <ListItemDescription>Toggle this setting on/off</ListItemDescription>
237
+ </ListItemContent>
238
+ </ListItemLeading>
239
+ <ListItemTrailing>
240
+ <Switch checked={selected} onCheckedChange={setSelected} />
241
+ </ListItemTrailing>
242
+ </ListItem>
166
243
 
167
244
  {/* Value - For displaying values */}
168
- <ListItem
169
- title='Account Balance'
170
- description='Current available funds'
171
- leadingContent={<Spot appearance='icon' icon={User} />}
172
- trailingContent={
173
- <Box lx={{ alignItems: 'flex-end' }}>
174
- <Text typography='body2SemiBold'>42.00</Text>
175
- <Text typography='body3' lx={{ color: 'muted' }}>
176
- USD
177
- </Text>
178
- </Box>
179
- }
180
- onPress={() => console.log('View balance')}
181
- />
245
+ <ListItem>
246
+ <ListItemLeading>
247
+ <ListItemSpot appearance='icon' icon={User} />
248
+ <ListItemContent>
249
+ <ListItemTitle>Account Balance</ListItemTitle>
250
+ <ListItemDescription>Current available funds</ListItemDescription>
251
+ </ListItemContent>
252
+ </ListItemLeading>
253
+ <ListItemTrailing>
254
+ <ListItemContent align='end'>
255
+ <ListItemTitle>42.00</ListItemTitle>
256
+ <ListItemDescription>USD</ListItemDescription>
257
+ </ListItemContent>
258
+ </ListItemTrailing>
259
+ </ListItem>
182
260
 
183
261
  {/* Tag - For status indicators */}
184
- <ListItem
185
- title='New Feature'
186
- description='Recently added functionality'
187
- leadingContent={<Spot appearance='icon' icon={User} />}
188
- trailingContent={<Tag label='New' appearance='accent' />}
189
- onPress={() => console.log('View feature')}
190
- />
262
+ <ListItem>
263
+ <ListItemLeading>
264
+ <ListItemSpot appearance='icon' icon={User} />
265
+ <ListItemContent>
266
+ <ListItemTitle>New Feature</ListItemTitle>
267
+ <ListItemDescription>Recently added functionality</ListItemDescription>
268
+ </ListItemContent>
269
+ </ListItemLeading>
270
+ <ListItemTrailing>
271
+ <Tag label='New' appearance='accent' />
272
+ </ListItemTrailing>
273
+ </ListItem>
191
274
 
192
275
  {/* Icon - For trailing icons */}
193
- <ListItem
194
- title='Edit Profile'
195
- description='Modify your information'
196
- leadingContent={<Spot appearance='icon' icon={User} />}
197
- trailingContent={<PenEdit size={24} />}
198
- onPress={() => console.log('Edit')}
199
- />
276
+ <ListItem>
277
+ <ListItemLeading>
278
+ <ListItemSpot appearance='icon' icon={User} />
279
+ <ListItemContent>
280
+ <ListItemTitle>Edit Profile</ListItemTitle>
281
+ <ListItemDescription>Modify your information</ListItemDescription>
282
+ </ListItemContent>
283
+ </ListItemLeading>
284
+ <ListItemTrailing>
285
+ <Check />
286
+ </ListItemTrailing>
287
+ </ListItem>
200
288
 
201
289
  {/* None - No trailing content */}
202
- <ListItem
203
- title='Simple Item'
204
- description='No trailing elements'
205
- leadingContent={<Spot appearance='icon' icon={User} />}
206
- onPress={() => console.log('Simple action')}
207
- />
290
+ <ListItem>
291
+ <ListItemLeading>
292
+ <ListItemSpot appearance='icon' icon={User} />
293
+ <ListItemContent>
294
+ <ListItemTitle>Simple Item</ListItemTitle>
295
+ <ListItemDescription>No trailing elements</ListItemDescription>
296
+ </ListItemContent>
297
+ </ListItemLeading>
298
+ </ListItem>
208
299
  </Box>
209
300
  );
210
301
  }
@@ -212,52 +303,102 @@ function ListVariants() {
212
303
 
213
304
  ### With Description Tag
214
305
 
215
- Add a tag to the description for additional status information:
306
+ Add a tag inline with the description for additional status information:
216
307
 
217
308
  ```tsx
218
- import { ListItem, Tag } from '@ledgerhq/lumen-ui-rnative';
309
+ import {
310
+ ListItem,
311
+ ListItemLeading,
312
+ ListItemContent,
313
+ ListItemTitle,
314
+ ListItemDescription,
315
+ ListItemTruncate,
316
+ ListItemTrailing,
317
+ Tag,
318
+ } from '@ledgerhq/lumen-ui-rnative';
219
319
  import { Bolt, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
220
320
 
221
321
  function MyComponent() {
222
322
  return (
223
- <ListItem
224
- title='New Item'
225
- description='Recently added'
226
- descriptionTag={
227
- <Tag label='New' appearance='accent' icon={Bolt} size='sm' />
228
- }
229
- trailingContent={<ChevronRight size={24} />}
230
- onPress={() => console.log('Pressed!')}
231
- />
323
+ <ListItem>
324
+ <ListItemLeading>
325
+ <ListItemContent>
326
+ <ListItemTitle>New Item</ListItemTitle>
327
+ <ListItemDescription>
328
+ <ListItemTruncate>Recently added</ListItemTruncate>
329
+ <Tag label='New' appearance='accent' icon={Bolt} size='sm' />
330
+ </ListItemDescription>
331
+ </ListItemContent>
332
+ </ListItemLeading>
333
+ <ListItemTrailing>
334
+ <ChevronRight size={24} />
335
+ </ListItemTrailing>
336
+ </ListItem>
232
337
  );
233
338
  }
234
339
  ```
235
340
 
236
341
  ### Disabled State
237
342
 
238
- Disable the ListItem to prevent interaction:
343
+ Disable the ListItem to prevent interaction. The disabled state is automatically propagated to ListItemDescription and ListItemSpot via context:
239
344
 
240
345
  ```tsx
241
- <ListItem title='Disabled Option' description='Cannot be changed' disabled />
346
+ import {
347
+ ListItem,
348
+ ListItemLeading,
349
+ ListItemContent,
350
+ ListItemTitle,
351
+ ListItemDescription,
352
+ ListItemTrailing,
353
+ ListItemSpot,
354
+ Switch,
355
+ } from '@ledgerhq/lumen-ui-rnative';
356
+ import { Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
357
+
358
+ <ListItem disabled>
359
+ <ListItemLeading>
360
+ <ListItemSpot appearance='icon' icon={Settings} />
361
+ <ListItemContent>
362
+ <ListItemTitle>Disabled Option</ListItemTitle>
363
+ <ListItemDescription>Cannot be changed</ListItemDescription>
364
+ </ListItemContent>
365
+ </ListItemLeading>
366
+ <ListItemTrailing>
367
+ <Switch checked={false} disabled />
368
+ </ListItemTrailing>
369
+ </ListItem>
242
370
  ```
243
371
 
244
372
  ### Responsive Layout
245
373
 
246
- ListItem handles truncation responsively. Use `Box` to control the container:
374
+ ListItem handles truncation responsively. Use `lx` prop to control container width:
247
375
 
248
376
  ```tsx
249
- import { ListItem, Spot, Box } from '@ledgerhq/lumen-ui-rnative';
377
+ import {
378
+ ListItem,
379
+ ListItemLeading,
380
+ ListItemContent,
381
+ ListItemTitle,
382
+ ListItemDescription,
383
+ ListItemTrailing,
384
+ ListItemSpot,
385
+ } from '@ledgerhq/lumen-ui-rnative';
250
386
  import { User, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
251
387
 
252
- <Box lx={{ width: 's256', backgroundColor: 'base', padding: 's4' }}>
253
- <ListItem
254
- title='Very Long Title That Will Truncate'
255
- description='Very long description that will also truncate appropriately'
256
- leadingContent={<Spot appearance='icon' icon={User} />}
257
- trailingContent={<ChevronRight size={24} />}
258
- onPress={() => console.log('Pressed!')}
259
- />
260
- </Box>
388
+ <ListItem lx={{ maxWidth: 's256' }}>
389
+ <ListItemLeading>
390
+ <ListItemSpot appearance='icon' icon={User} />
391
+ <ListItemContent>
392
+ <ListItemTitle>Very Long Title That Will Truncate</ListItemTitle>
393
+ <ListItemDescription>
394
+ Very long description that will also truncate appropriately
395
+ </ListItemDescription>
396
+ </ListItemContent>
397
+ </ListItemLeading>
398
+ <ListItemTrailing>
399
+ <ChevronRight size={24} />
400
+ </ListItemTrailing>
401
+ </ListItem>
261
402
  ```
262
403
 
263
404
  ### Custom Styling
@@ -265,17 +406,154 @@ import { User, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
265
406
  Use `lx` prop for layout purposes only, such as maximum width:
266
407
 
267
408
  ```tsx
268
- <ListItem
269
- title='Constrained Width'
270
- description='This item has a maximum width applied'
271
- lx={{ maxWidth: 's320' }}
272
- onPress={() => console.log('Pressed!')}
273
- />
409
+ import {
410
+ ListItem,
411
+ ListItemLeading,
412
+ ListItemContent,
413
+ ListItemTitle,
414
+ ListItemDescription,
415
+ ListItemTrailing,
416
+ } from '@ledgerhq/lumen-ui-rnative';
417
+ import { ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
418
+
419
+ <ListItem lx={{ maxWidth: 's320' }}>
420
+ <ListItemLeading>
421
+ <ListItemContent>
422
+ <ListItemTitle>Constrained Width</ListItemTitle>
423
+ <ListItemDescription>
424
+ This item has a maximum width applied
425
+ </ListItemDescription>
426
+ </ListItemContent>
427
+ </ListItemLeading>
428
+ <ListItemTrailing>
429
+ <ChevronRight size={24} />
430
+ </ListItemTrailing>
431
+ </ListItem>
274
432
  ```
275
433
 
276
434
  ## Do's and Don'ts
277
435
 
436
+ The following guidelines ensure consistent usage of the ListItem component and maintain design system principles.
437
+
278
438
  <Box lx={{ flexDirection: 'column', gap: 's24' }}>
439
+ <DoVsDontRow>
440
+ <DoBlockItem
441
+ title='Use the composite pattern correctly'
442
+ description='ListItemContent should be nested inside ListItemLeading to group visual and text content together'
443
+ >
444
+
445
+ {/* prettier-ignore */}
446
+ ```tsx
447
+ <ListItem>
448
+ <ListItemLeading>
449
+ <ListItemSpot appearance='icon' icon={Settings} />
450
+ <ListItemContent>
451
+ <ListItemTitle>Settings</ListItemTitle>
452
+ <ListItemDescription>Manage preferences</ListItemDescription>
453
+ </ListItemContent>
454
+ </ListItemLeading>
455
+ <ListItemTrailing>
456
+ <ChevronRight size={24} />
457
+ </ListItemTrailing>
458
+ </ListItem>
459
+ ```
460
+
461
+ </DoBlockItem>
462
+ <DontBlockItem
463
+ title="Don't place ListItemContent outside ListItemLeading"
464
+ description='ListItemContent must be inside ListItemLeading for proper layout'
465
+ >
466
+
467
+ {/* prettier-ignore */}
468
+ ```tsx
469
+ // DON'T - ListItemContent outside ListItemLeading
470
+ <ListItem>
471
+ <ListItemLeading>
472
+ <ListItemSpot appearance='icon' icon={Settings} />
473
+ </ListItemLeading>
474
+ <ListItemContent>
475
+ <ListItemTitle>Settings</ListItemTitle>
476
+ </ListItemContent>
477
+ </ListItem>
478
+ ```
479
+
480
+ </DontBlockItem>
481
+
482
+ </DoVsDontRow>
483
+
484
+ <DoVsDontRow>
485
+ <DoBlockItem
486
+ title='Use ListItemTruncate with Tags'
487
+ description='Wrap text in ListItemTruncate when combining with Tags. Use variant="title" inside ListItemTitle.'
488
+ >
489
+
490
+ {/* prettier-ignore */}
491
+ ```tsx
492
+ <ListItemTitle>
493
+ <ListItemTruncate variant='title'>Title text</ListItemTruncate>
494
+ <Tag label='New' appearance='base' size='sm' />
495
+ </ListItemTitle>
496
+ <ListItemDescription>
497
+ <ListItemTruncate>Description text</ListItemTruncate>
498
+ <Tag label='New' appearance='accent' size='sm' />
499
+ </ListItemDescription>
500
+ ```
501
+
502
+ </DoBlockItem>
503
+ <DontBlockItem
504
+ title="Don't mix text and Tags without ListItemTruncate"
505
+ description='Text will not truncate properly without ListItemTruncate wrapper'
506
+ >
507
+
508
+ {/* prettier-ignore */}
509
+ ```tsx
510
+ // DON'T - Text won't truncate correctly
511
+ <ListItemDescription>
512
+ Recently added
513
+ <Tag label='New' appearance='accent' size='sm' />
514
+ </ListItemDescription>
515
+ ```
516
+
517
+ </DontBlockItem>
518
+
519
+ </DoVsDontRow>
520
+
521
+ <DoVsDontRow>
522
+ <DoBlockItem
523
+ title='Use concise text for title and description'
524
+ description='Keep title and description short since they truncate to one line'
525
+ >
526
+
527
+ {/* prettier-ignore */}
528
+ ```tsx
529
+ <ListItemContent>
530
+ <ListItemTitle>Account Settings</ListItemTitle>
531
+ <ListItemDescription>Manage preferences</ListItemDescription>
532
+ </ListItemContent>
533
+ ```
534
+
535
+ </DoBlockItem>
536
+ <DontBlockItem
537
+ title="Don't use long text"
538
+ description='Title and description truncate to one line'
539
+ >
540
+
541
+ {/* prettier-ignore */}
542
+ ```tsx
543
+ <ListItemContent>
544
+ <ListItemTitle>
545
+ This is a very long title that will be truncated
546
+ </ListItemTitle>
547
+ <ListItemDescription>
548
+ This is also a very long description that will be truncated
549
+ </ListItemDescription>
550
+ </ListItemContent>
551
+ ```
552
+
553
+ </DontBlockItem>
554
+
555
+ </DoVsDontRow>
556
+
279
557
  <CommonRulesDoAndDont />
280
558
  </Box>
281
559