@ledgerhq/lumen-ui-rnative 0.1.60 → 0.1.62
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.
- package/dist/module/lib/Components/core/Avatar/Avatar.js +17 -6
- package/dist/module/lib/Components/core/Avatar/Avatar.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/Avatar.mdx +10 -6
- package/dist/module/lib/Components/core/Avatar/Avatar.stories.js +15 -6
- package/dist/module/lib/Components/core/Avatar/Avatar.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/Avatar.test.js +56 -0
- package/dist/module/lib/Components/core/Avatar/Avatar.test.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/index.js +1 -1
- package/dist/module/lib/Components/core/Avatar/index.js.map +1 -1
- package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.js +21 -0
- package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.js.map +1 -0
- package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.test.js +88 -0
- package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.test.js.map +1 -0
- package/dist/module/lib/Components/core/Banner/Banner.js +3 -3
- package/dist/module/lib/Components/core/Banner/Banner.js.map +1 -1
- package/dist/module/lib/Components/core/Banner/Banner.test.js +3 -3
- package/dist/module/lib/Components/core/Banner/Banner.test.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/DotIcon.js +0 -13
- package/dist/module/lib/Components/core/DotIcon/DotIcon.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/DotIcon.mdx +3 -3
- package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js +14 -13
- package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/DotIcon.test.js +22 -0
- package/dist/module/lib/Components/core/DotIcon/DotIcon.test.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/getDotIconProps.js +37 -0
- package/dist/module/lib/Components/core/DotIcon/getDotIconProps.js.map +1 -0
- package/dist/module/lib/Components/core/DotIcon/getDotIconProps.test.js +38 -0
- package/dist/module/lib/Components/core/DotIcon/getDotIconProps.test.js.map +1 -0
- package/dist/module/lib/Components/core/DotIcon/index.js +2 -1
- package/dist/module/lib/Components/core/DotIcon/index.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js +0 -19
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.mdx +3 -3
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js +18 -17
- package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.js +55 -0
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.js.map +1 -0
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js +56 -0
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js.map +1 -0
- package/dist/module/lib/Components/core/DotSymbol/index.js +2 -1
- package/dist/module/lib/Components/core/DotSymbol/index.js.map +1 -1
- package/dist/module/lib/Components/core/MediaButton/MediaButton.js +2 -2
- package/dist/module/lib/Components/core/MediaButton/MediaButton.mdx +2 -2
- package/dist/module/lib/Components/core/MenuList/MenuList.figma.js +21 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.figma.js.map +1 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.js +143 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.js.map +1 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.mdx +66 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.stories.js +139 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.stories.js.map +1 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.test.js +146 -0
- package/dist/module/lib/Components/core/MenuList/MenuList.test.js.map +1 -0
- package/dist/module/lib/Components/core/MenuList/index.js +5 -0
- package/dist/module/lib/Components/core/MenuList/index.js.map +1 -0
- package/dist/module/lib/Components/core/MenuList/types.js.map +1 -0
- package/dist/module/lib/Components/core/SelectList/SelectList.figma.js +28 -0
- package/dist/module/lib/Components/core/{OptionList/OptionList.figma.js.map → SelectList/SelectList.figma.js.map} +1 -1
- package/dist/module/lib/Components/core/{OptionList/OptionList.js → SelectList/SelectList.js} +46 -46
- package/dist/module/lib/Components/core/{OptionList/OptionList.js.map → SelectList/SelectList.js.map} +1 -1
- package/dist/module/lib/Components/core/{OptionList/OptionList.mdx → SelectList/SelectList.mdx} +81 -81
- package/dist/module/lib/Components/core/{OptionList/OptionList.stories.js → SelectList/SelectList.stories.js} +130 -130
- package/dist/module/lib/Components/core/{OptionList/OptionList.stories.js.map → SelectList/SelectList.stories.js.map} +1 -1
- package/dist/module/lib/Components/core/{OptionList/OptionList.test.js → SelectList/SelectList.test.js} +83 -83
- package/dist/module/lib/Components/core/{OptionList/OptionList.test.js.map → SelectList/SelectList.test.js.map} +1 -1
- package/dist/module/lib/Components/core/SelectList/index.js +5 -0
- package/dist/module/lib/Components/core/{OptionList → SelectList}/index.js.map +1 -1
- package/dist/module/lib/Components/core/SelectList/types.js +4 -0
- package/dist/module/lib/Components/core/{OptionList → SelectList}/types.js.map +1 -1
- package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.js → SelectList/useSelectList/useSelectListItems.js} +2 -2
- package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.js.map → SelectList/useSelectList/useSelectListItems.js.map} +1 -1
- package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.js → SelectList/useSelectList/useSelectListItems.test.js} +17 -17
- package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.js.map → SelectList/useSelectList/useSelectListItems.test.js.map} +1 -1
- package/dist/module/lib/Components/core/index.js +2 -1
- package/dist/module/lib/Components/core/index.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.js +2 -2
- package/dist/module/lib/Components/internal/BaseButton/BaseButton.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js +2 -2
- package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseTag/BaseTag.js +3 -3
- package/dist/module/lib/Components/internal/BaseTag/BaseTag.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseTag/BaseTag.test.js +1 -1
- package/dist/module/lib/Components/internal/BaseTag/BaseTag.test.js.map +1 -1
- package/dist/module/lib/Components/symbols/Icon/Icon.test.js +1 -1
- package/dist/module/lib/Components/symbols/icons/CloudSync.js +50 -0
- package/dist/module/lib/Components/symbols/icons/CloudSync.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Dollar.js +11 -5
- package/dist/module/lib/Components/symbols/icons/Dollar.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/DollarConvert.js +1 -1
- package/dist/module/lib/Components/symbols/icons/DollarConvert.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/DollarFill.js +47 -0
- package/dist/module/lib/Components/symbols/icons/DollarFill.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/FaceId.js +50 -0
- package/dist/module/lib/Components/symbols/icons/FaceId.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Fingerprint.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Fingerprint.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Pause.js +2 -1
- package/dist/module/lib/Components/symbols/icons/Pause.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Range.js +2 -5
- package/dist/module/lib/Components/symbols/icons/Range.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Telegram.js +20 -9
- package/dist/module/lib/Components/symbols/icons/Telegram.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/Usb.js +1 -1
- package/dist/module/lib/Components/symbols/index.js +4 -0
- package/dist/module/lib/Components/symbols/index.js.map +1 -1
- package/dist/typescript/src/lib/Components/core/Avatar/Avatar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Avatar/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/Avatar/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Avatar/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/Avatar/useResolveAvatarColor.d.ts +10 -0
- package/dist/typescript/src/lib/Components/core/Avatar/useResolveAvatarColor.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/DotIcon/DotIcon.d.ts +0 -13
- package/dist/typescript/src/lib/Components/core/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/DotIcon/getDotIconProps.d.ts +66 -0
- package/dist/typescript/src/lib/Components/core/DotIcon/getDotIconProps.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/DotIcon/index.d.ts +2 -1
- package/dist/typescript/src/lib/Components/core/DotIcon/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/DotSymbol/DotSymbol.d.ts +1 -5
- package/dist/typescript/src/lib/Components/core/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts +102 -0
- package/dist/typescript/src/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/DotSymbol/index.d.ts +2 -1
- package/dist/typescript/src/lib/Components/core/DotSymbol/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/MediaButton/MediaButton.d.ts +2 -2
- package/dist/typescript/src/lib/Components/core/MenuList/MenuList.d.ts +29 -0
- package/dist/typescript/src/lib/Components/core/MenuList/MenuList.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/MenuList/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/core/MenuList/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/MenuList/types.d.ts +42 -0
- package/dist/typescript/src/lib/Components/core/MenuList/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/core/SelectList/SelectList.d.ts +27 -0
- package/dist/typescript/src/lib/Components/core/{OptionList/OptionList.d.ts.map → SelectList/SelectList.d.ts.map} +1 -1
- package/dist/typescript/src/lib/Components/core/SelectList/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/types.d.ts +24 -24
- package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/SelectList/useSelectList/useSelectListItems.d.ts +20 -0
- package/dist/typescript/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.d.ts.map → SelectList/useSelectList/useSelectListItems.d.ts.map} +1 -1
- package/dist/typescript/src/lib/Components/core/index.d.ts +2 -1
- package/dist/typescript/src/lib/Components/core/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/CloudSync.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CloudSync.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Dollar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/DollarFill.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/DollarFill.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/FaceId.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/FaceId.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Fingerprint.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Fingerprint.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Pause.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/Range.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/icons/Telegram.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/symbols/index.d.ts +4 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Components/core/Avatar/Avatar.mdx +10 -6
- package/src/lib/Components/core/Avatar/Avatar.stories.tsx +16 -9
- package/src/lib/Components/core/Avatar/Avatar.test.tsx +64 -0
- package/src/lib/Components/core/Avatar/Avatar.tsx +41 -8
- package/src/lib/Components/core/Avatar/index.ts +1 -1
- package/src/lib/Components/core/Avatar/types.ts +1 -1
- package/src/lib/Components/core/Avatar/useResolveAvatarColor.test.tsx +106 -0
- package/src/lib/Components/core/Avatar/useResolveAvatarColor.ts +25 -0
- package/src/lib/Components/core/Banner/Banner.test.tsx +3 -3
- package/src/lib/Components/core/Banner/Banner.tsx +3 -3
- package/src/lib/Components/core/DotIcon/DotIcon.mdx +3 -3
- package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +14 -13
- package/src/lib/Components/core/DotIcon/DotIcon.test.tsx +20 -0
- package/src/lib/Components/core/DotIcon/DotIcon.tsx +0 -15
- package/src/lib/Components/core/DotIcon/getDotIconProps.test.ts +19 -0
- package/src/lib/Components/core/DotIcon/getDotIconProps.ts +20 -0
- package/src/lib/Components/core/DotIcon/index.ts +2 -5
- package/src/lib/Components/core/DotSymbol/DotSymbol.mdx +3 -3
- package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +18 -17
- package/src/lib/Components/core/DotSymbol/DotSymbol.tsx +0 -23
- package/src/lib/Components/core/DotSymbol/getDotSymbolProps.test.ts +25 -0
- package/src/lib/Components/core/DotSymbol/getDotSymbolProps.ts +26 -0
- package/src/lib/Components/core/DotSymbol/index.ts +2 -1
- package/src/lib/Components/core/MediaButton/MediaButton.mdx +2 -2
- package/src/lib/Components/core/MediaButton/MediaButton.tsx +2 -2
- package/src/lib/Components/core/MenuList/MenuList.figma.tsx +23 -0
- package/src/lib/Components/core/MenuList/MenuList.mdx +66 -0
- package/src/lib/Components/core/MenuList/MenuList.stories.tsx +114 -0
- package/src/lib/Components/core/MenuList/MenuList.test.tsx +135 -0
- package/src/lib/Components/core/MenuList/MenuList.tsx +162 -0
- package/src/lib/Components/core/MenuList/index.ts +2 -0
- package/src/lib/Components/core/MenuList/types.ts +49 -0
- package/src/lib/Components/core/SelectList/SelectList.figma.tsx +37 -0
- package/src/lib/Components/core/{OptionList/OptionList.mdx → SelectList/SelectList.mdx} +81 -81
- package/src/lib/Components/core/{OptionList/OptionList.stories.tsx → SelectList/SelectList.stories.tsx} +227 -227
- package/src/lib/Components/core/{OptionList/OptionList.test.tsx → SelectList/SelectList.test.tsx} +138 -138
- package/src/lib/Components/core/{OptionList/OptionList.tsx → SelectList/SelectList.tsx} +92 -92
- package/src/lib/Components/core/SelectList/index.ts +2 -0
- package/src/lib/Components/core/{OptionList → SelectList}/types.ts +28 -28
- package/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.ts → SelectList/useSelectList/useSelectListItems.test.ts} +24 -24
- package/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.ts → SelectList/useSelectList/useSelectListItems.ts} +21 -21
- package/src/lib/Components/core/Spot/Spot.tsx +1 -1
- package/src/lib/Components/core/index.ts +2 -1
- package/src/lib/Components/internal/BaseButton/BaseButton.tsx +2 -2
- package/src/lib/Components/internal/BaseInput/BaseInputLabel.tsx +5 -2
- package/src/lib/Components/internal/BaseTag/BaseTag.test.tsx +3 -3
- package/src/lib/Components/internal/BaseTag/BaseTag.tsx +3 -3
- package/src/lib/Components/symbols/Icon/Icon.test.tsx +1 -1
- package/src/lib/Components/symbols/icons/CloudSync.tsx +45 -0
- package/src/lib/Components/symbols/icons/Dollar.tsx +8 -1
- package/src/lib/Components/symbols/icons/DollarConvert.tsx +1 -1
- package/src/lib/Components/symbols/icons/DollarFill.tsx +42 -0
- package/src/lib/Components/symbols/icons/FaceId.tsx +45 -0
- package/src/lib/Components/symbols/icons/Fingerprint.tsx +45 -0
- package/src/lib/Components/symbols/icons/Pause.tsx +2 -1
- package/src/lib/Components/symbols/icons/Range.tsx +2 -5
- package/src/lib/Components/symbols/icons/Telegram.tsx +14 -7
- package/src/lib/Components/symbols/icons/Usb.tsx +1 -1
- package/src/lib/Components/symbols/index.ts +4 -0
- package/dist/module/lib/Components/core/Avatar/resolveAvatarColor.js +0 -18
- package/dist/module/lib/Components/core/Avatar/resolveAvatarColor.js.map +0 -1
- package/dist/module/lib/Components/core/OptionList/OptionList.figma.js +0 -28
- package/dist/module/lib/Components/core/OptionList/index.js +0 -5
- package/dist/typescript/src/lib/Components/core/Avatar/resolveAvatarColor.d.ts +0 -8
- package/dist/typescript/src/lib/Components/core/Avatar/resolveAvatarColor.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/core/OptionList/OptionList.d.ts +0 -27
- package/dist/typescript/src/lib/Components/core/OptionList/index.d.ts +0 -3
- package/dist/typescript/src/lib/Components/core/OptionList/useOptionList/useOptionListItems.d.ts +0 -20
- package/src/lib/Components/core/Avatar/resolveAvatarColor.ts +0 -19
- package/src/lib/Components/core/OptionList/OptionList.figma.tsx +0 -37
- package/src/lib/Components/core/OptionList/index.ts +0 -2
- /package/dist/module/lib/Components/core/{OptionList → MenuList}/types.js +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import * as
|
|
2
|
+
import * as SelectListStories from './SelectList.stories';
|
|
3
3
|
import {
|
|
4
4
|
CustomTabs,
|
|
5
5
|
Tab,
|
|
6
6
|
} from '../../../../../.storybook/components';
|
|
7
7
|
|
|
8
|
-
<Meta title='Core/
|
|
8
|
+
<Meta title='Core/SelectList' of={SelectListStories} />
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# SelectList
|
|
11
11
|
|
|
12
12
|
<CustomTabs>
|
|
13
13
|
<Tab label="Overview">
|
|
14
14
|
|
|
15
15
|
## Introduction
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
SelectList is a data-driven, composable selection list designed to be embedded inside a `BottomSheet`, a new screen, or any container.
|
|
18
18
|
|
|
19
19
|
It handles **selection state**, **automatic grouping** (via a `group` field on items), and exposes a `renderItem` callback for full control over item rendering.
|
|
20
20
|
|
|
@@ -22,18 +22,18 @@ It handles **selection state**, **automatic grouping** (via a `group` field on i
|
|
|
22
22
|
|
|
23
23
|
## Anatomy
|
|
24
24
|
|
|
25
|
-
<Canvas of={
|
|
25
|
+
<Canvas of={SelectListStories.Base} />
|
|
26
26
|
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
27
|
+
- **SelectList**: Root component managing selection state and item processing
|
|
28
|
+
- **SelectListTrigger**: Input-style trigger with floating label and chevron — displays the selected value and opens a BottomSheet on press
|
|
29
|
+
- **SelectListContent**: Iterates items, renders group labels and separators automatically, calls `renderItem`
|
|
30
|
+
- **SelectListItem**: Pressable item with selection check mark
|
|
31
|
+
- **SelectListItemLeading**: Slot for leading visuals (icons, avatars)
|
|
32
|
+
- **SelectListItemContent**: Flex column for title + description
|
|
33
|
+
- **SelectListItemContentRow**: Horizontal row for placing elements side-by-side (e.g. title + tag)
|
|
34
|
+
- **SelectListItemText**: Styled title text
|
|
35
|
+
- **SelectListItemDescription**: Styled description text
|
|
36
|
+
- **SelectListSearch**: Search input that filters items by label (default) or via a custom `filter` function
|
|
37
37
|
|
|
38
38
|
## Properties
|
|
39
39
|
|
|
@@ -41,49 +41,49 @@ It handles **selection state**, **automatic grouping** (via a `group` field on i
|
|
|
41
41
|
|
|
42
42
|
Items with a `group` field are automatically grouped with labels and separators:
|
|
43
43
|
|
|
44
|
-
<Canvas of={
|
|
44
|
+
<Canvas of={SelectListStories.WithGroups} />
|
|
45
45
|
|
|
46
46
|
### Complex item layout
|
|
47
47
|
|
|
48
|
-
Use `
|
|
48
|
+
Use `SelectListItemContentRow` to place a `Tag` next to the title:
|
|
49
49
|
|
|
50
|
-
<Canvas of={
|
|
50
|
+
<Canvas of={SelectListStories.WithContentRow} />
|
|
51
51
|
|
|
52
52
|
### Disabled items
|
|
53
53
|
|
|
54
54
|
Individual items can be disabled:
|
|
55
55
|
|
|
56
|
-
<Canvas of={
|
|
56
|
+
<Canvas of={SelectListStories.WithDisabledItems} />
|
|
57
57
|
|
|
58
58
|
### Groups + complex layout
|
|
59
59
|
|
|
60
60
|
Combining grouping with rich item content:
|
|
61
61
|
|
|
62
|
-
<Canvas of={
|
|
62
|
+
<Canvas of={SelectListStories.GroupedWithContentRow} />
|
|
63
63
|
|
|
64
64
|
### Search
|
|
65
65
|
|
|
66
|
-
Drop `
|
|
66
|
+
Drop `SelectListSearch` inside the list to enable case-insensitive filtering on item labels. Pair with `SelectListEmptyState` to handle no-match scenarios. Pass a custom `filter` to match against meta (or anything else), or `filter={null}` to disable filtering. Use `filteredItems` + `onSearchValueChange` for async/server-side search.
|
|
67
67
|
|
|
68
|
-
<Canvas of={
|
|
68
|
+
<Canvas of={SelectListStories.WithSearch} />
|
|
69
69
|
|
|
70
70
|
Search works within grouped items too. Empty groups are hidden automatically:
|
|
71
71
|
|
|
72
|
-
<Canvas of={
|
|
72
|
+
<Canvas of={SelectListStories.WithSearchAndGroups} />
|
|
73
73
|
|
|
74
74
|
Pass a custom `filter` to match against fields beyond the label. Here, the query also matches each item's ticker via `meta`:
|
|
75
75
|
|
|
76
|
-
<Canvas of={
|
|
76
|
+
<Canvas of={SelectListStories.WithCustomSearchFilter} />
|
|
77
77
|
|
|
78
78
|
Drive the search input from the outside with `searchValue` + `onSearchValueChange`. This is useful for syncing search state with other UI or kicking off async fetches:
|
|
79
79
|
|
|
80
|
-
<Canvas of={
|
|
80
|
+
<Canvas of={SelectListStories.WithControlledSearch} />
|
|
81
81
|
|
|
82
82
|
### Trigger showcase
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
SelectList can be opened from any trigger. `MediaButton` supports multiple appearances (`gray`, `transparent`, `no-background`), optional icons (`flat` / `rounded`), and disabled state:
|
|
85
85
|
|
|
86
|
-
<Canvas of={
|
|
86
|
+
<Canvas of={SelectListStories.TriggerShowcase} />
|
|
87
87
|
|
|
88
88
|
</Tab>
|
|
89
89
|
<Tab label="Implementation">
|
|
@@ -94,15 +94,15 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
94
94
|
|
|
95
95
|
## Basic usage
|
|
96
96
|
|
|
97
|
-
> **Recommended:** prefer the [type-safe variant](#type-safe-variant) below. It ties `value`, `items[].value`, `
|
|
97
|
+
> **Recommended:** prefer the [type-safe variant](#type-safe-variant) below. It ties `value`, `items[].value`, `SelectListItem.value`, and the `renderItem(item).meta` shape to one literal union plus an optional `TMeta`, dropping the `as Meta` casts in `renderItem`.
|
|
98
98
|
|
|
99
99
|
```tsx
|
|
100
100
|
import {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
SelectList,
|
|
102
|
+
SelectListContent,
|
|
103
|
+
SelectListItem,
|
|
104
|
+
SelectListItemContent,
|
|
105
|
+
SelectListItemText,
|
|
106
106
|
} from '@ledgerhq/lumen-ui-rnative';
|
|
107
107
|
|
|
108
108
|
const items = [
|
|
@@ -114,35 +114,35 @@ function MyList() {
|
|
|
114
114
|
const [value, setValue] = useState<string | null>(null);
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
|
-
<
|
|
118
|
-
<
|
|
117
|
+
<SelectList items={items} value={value} onValueChange={setValue}>
|
|
118
|
+
<SelectListContent
|
|
119
119
|
renderItem={(item) => (
|
|
120
|
-
<
|
|
121
|
-
<
|
|
122
|
-
<
|
|
123
|
-
</
|
|
124
|
-
</
|
|
120
|
+
<SelectListItem value={item.value}>
|
|
121
|
+
<SelectListItemContent>
|
|
122
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
123
|
+
</SelectListItemContent>
|
|
124
|
+
</SelectListItem>
|
|
125
125
|
)}
|
|
126
126
|
/>
|
|
127
|
-
</
|
|
127
|
+
</SelectList>
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
## Type-safe variant
|
|
133
133
|
|
|
134
|
-
`
|
|
134
|
+
`SelectList` and its subcomponents communicate via context, so TypeScript cannot connect `value` / `items[].value` / `SelectListItem.value` on its own. A typo compiles. `createSelectList<T, TMeta>()` ties them together via one literal union (`T`) and an optional meta shape (`TMeta`) that flows into `renderItem(item)`, removing the `as` cast on `item.meta`.
|
|
135
135
|
|
|
136
136
|
```tsx
|
|
137
|
-
import {
|
|
138
|
-
import type {
|
|
137
|
+
import { createSelectList } from '@ledgerhq/lumen-ui-rnative';
|
|
138
|
+
import type { SelectListItemData } from '@ledgerhq/lumen-ui-rnative';
|
|
139
139
|
|
|
140
140
|
type Network = 'eth' | 'sol' | 'btc';
|
|
141
141
|
type NetworkMeta = { ticker: string; ledgerId: string };
|
|
142
142
|
|
|
143
|
-
const NetworkList =
|
|
143
|
+
const NetworkList = createSelectList<Network, NetworkMeta>();
|
|
144
144
|
|
|
145
|
-
const NETWORKS:
|
|
145
|
+
const NETWORKS: SelectListItemData<Network, NetworkMeta>[] = [
|
|
146
146
|
{ value: 'eth', label: 'Ethereum', meta: { ticker: 'ETH', ledgerId: 'ethereum' } },
|
|
147
147
|
{ value: 'sol', label: 'Solana', meta: { ticker: 'SOL', ledgerId: 'solana' } },
|
|
148
148
|
{ value: 'btc', label: 'Bitcoin', meta: { ticker: 'BTC', ledgerId: 'bitcoin' } },
|
|
@@ -152,34 +152,34 @@ function Example() {
|
|
|
152
152
|
const [value, setValue] = React.useState<Network | null>('eth');
|
|
153
153
|
|
|
154
154
|
return (
|
|
155
|
-
<NetworkList.
|
|
156
|
-
<NetworkList.
|
|
155
|
+
<NetworkList.SelectList items={NETWORKS} value={value} onValueChange={setValue}>
|
|
156
|
+
<NetworkList.SelectListContent
|
|
157
157
|
renderItem={({ value, label, meta }) =>
|
|
158
158
|
meta ? (
|
|
159
|
-
<NetworkList.
|
|
160
|
-
<NetworkList.
|
|
161
|
-
<NetworkList.
|
|
162
|
-
<NetworkList.
|
|
159
|
+
<NetworkList.SelectListItem value={value}>
|
|
160
|
+
<NetworkList.SelectListItemContent>
|
|
161
|
+
<NetworkList.SelectListItemText>{label}</NetworkList.SelectListItemText>
|
|
162
|
+
<NetworkList.SelectListItemDescription>
|
|
163
163
|
{meta.ticker}
|
|
164
|
-
</NetworkList.
|
|
165
|
-
</NetworkList.
|
|
166
|
-
</NetworkList.
|
|
164
|
+
</NetworkList.SelectListItemDescription>
|
|
165
|
+
</NetworkList.SelectListItemContent>
|
|
166
|
+
</NetworkList.SelectListItem>
|
|
167
167
|
) : null
|
|
168
168
|
}
|
|
169
169
|
/>
|
|
170
|
-
</NetworkList.
|
|
170
|
+
</NetworkList.SelectList>
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
## Inside a BottomSheet
|
|
176
176
|
|
|
177
|
-
Use `
|
|
177
|
+
Use `SelectListTrigger` as the input-style trigger — it provides a floating label that animates up when a value is selected, and a chevron indicator. Pass children only when a value is selected so the label stays centered when empty.
|
|
178
178
|
|
|
179
179
|
```tsx
|
|
180
180
|
import {
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
SelectList, SelectListContent, SelectListItem,
|
|
182
|
+
SelectListItemContent, SelectListItemText, SelectListTrigger,
|
|
183
183
|
BottomSheet, BottomSheetHeader, BottomSheetView,
|
|
184
184
|
useBottomSheetRef, Text,
|
|
185
185
|
} from '@ledgerhq/lumen-ui-rnative';
|
|
@@ -191,12 +191,12 @@ function CurrencyPicker() {
|
|
|
191
191
|
|
|
192
192
|
return (
|
|
193
193
|
<>
|
|
194
|
-
<
|
|
194
|
+
<SelectListTrigger
|
|
195
195
|
label='Currency'
|
|
196
196
|
onPress={() => ref.current?.present()}
|
|
197
197
|
>
|
|
198
198
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
199
|
-
</
|
|
199
|
+
</SelectListTrigger>
|
|
200
200
|
<BottomSheet
|
|
201
201
|
ref={ref}
|
|
202
202
|
enableDynamicSizing
|
|
@@ -205,21 +205,21 @@ function CurrencyPicker() {
|
|
|
205
205
|
>
|
|
206
206
|
<BottomSheetView>
|
|
207
207
|
<BottomSheetHeader title='Pick a currency' />
|
|
208
|
-
<
|
|
208
|
+
<SelectList
|
|
209
209
|
items={items}
|
|
210
210
|
value={value}
|
|
211
211
|
onValueChange={(v) => { setValue(v); ref.current?.dismiss(); }}
|
|
212
212
|
>
|
|
213
|
-
<
|
|
213
|
+
<SelectListContent
|
|
214
214
|
renderItem={(item) => (
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
<
|
|
218
|
-
</
|
|
219
|
-
</
|
|
215
|
+
<SelectListItem value={item.value}>
|
|
216
|
+
<SelectListItemContent>
|
|
217
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
218
|
+
</SelectListItemContent>
|
|
219
|
+
</SelectListItem>
|
|
220
220
|
)}
|
|
221
221
|
/>
|
|
222
|
-
</
|
|
222
|
+
</SelectList>
|
|
223
223
|
</BottomSheetView>
|
|
224
224
|
</BottomSheet>
|
|
225
225
|
</>
|
|
@@ -241,7 +241,7 @@ const items = [
|
|
|
241
241
|
|
|
242
242
|
## Controlled vs uncontrolled
|
|
243
243
|
|
|
244
|
-
Use `value` + `onValueChange` (controlled) when
|
|
244
|
+
Use `value` + `onValueChange` (controlled) when SelectList is inside a BottomSheet — the sheet unmounts children on dismiss, so internal state is lost. Use `defaultValue` (uncontrolled) only when the component stays mounted (e.g. inline in a screen).
|
|
245
245
|
|
|
246
246
|
## Custom item layout with meta
|
|
247
247
|
|
|
@@ -252,22 +252,22 @@ const items = [
|
|
|
252
252
|
{ value: 'eth', label: 'Ethereum', meta: { ticker: 'ETH', tag: 'ERC-20' } },
|
|
253
253
|
];
|
|
254
254
|
|
|
255
|
-
<
|
|
255
|
+
<SelectListContent
|
|
256
256
|
renderItem={(item) => {
|
|
257
257
|
const meta = item.meta as { ticker: string; tag: string };
|
|
258
258
|
return (
|
|
259
|
-
<
|
|
260
|
-
<
|
|
259
|
+
<SelectListItem value={item.value}>
|
|
260
|
+
<SelectListItemLeading>
|
|
261
261
|
<Spot appearance='icon' icon={Wallet} />
|
|
262
|
-
</
|
|
263
|
-
<
|
|
264
|
-
<
|
|
265
|
-
<
|
|
262
|
+
</SelectListItemLeading>
|
|
263
|
+
<SelectListItemContent>
|
|
264
|
+
<SelectListItemContentRow>
|
|
265
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
266
266
|
<Tag label={meta.tag} appearance='gray' size='sm' />
|
|
267
|
-
</
|
|
268
|
-
<
|
|
269
|
-
</
|
|
270
|
-
</
|
|
267
|
+
</SelectListItemContentRow>
|
|
268
|
+
<SelectListItemDescription>{meta.ticker}</SelectListItemDescription>
|
|
269
|
+
</SelectListItemContent>
|
|
270
|
+
</SelectListItem>
|
|
271
271
|
);
|
|
272
272
|
}}
|
|
273
273
|
/>
|