@ledgerhq/lumen-ui-rnative 0.1.61 → 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/getDotIconProps.test.js +1 -4
- package/dist/module/lib/Components/core/DotIcon/getDotIconProps.test.js.map +1 -1
- package/dist/module/lib/Components/core/DotIcon/index.js +0 -10
- package/dist/module/lib/Components/core/DotIcon/index.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js +1 -4
- package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js.map +1 -1
- package/dist/module/lib/Components/core/DotSymbol/index.js +0 -15
- 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/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/index.d.ts +0 -7
- package/dist/typescript/src/lib/Components/core/DotIcon/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/DotSymbol/index.d.ts +0 -12
- 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/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/getDotIconProps.test.ts +1 -5
- package/src/lib/Components/core/DotIcon/index.ts +0 -10
- package/src/lib/Components/core/DotSymbol/getDotSymbolProps.test.ts +1 -5
- package/src/lib/Components/core/DotSymbol/index.ts +0 -15
- 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/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
|
@@ -14,35 +14,35 @@ import { MediaButton } from '../MediaButton';
|
|
|
14
14
|
import { Spot } from '../Spot';
|
|
15
15
|
import { Tag } from '../Tag/Tag';
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from './
|
|
30
|
-
import type {
|
|
17
|
+
createSelectList,
|
|
18
|
+
SelectList,
|
|
19
|
+
SelectListContent,
|
|
20
|
+
SelectListEmptyState,
|
|
21
|
+
SelectListItem,
|
|
22
|
+
SelectListItemLeading,
|
|
23
|
+
SelectListItemContent,
|
|
24
|
+
SelectListItemDescription,
|
|
25
|
+
SelectListItemContentRow,
|
|
26
|
+
SelectListSearch,
|
|
27
|
+
SelectListTrigger,
|
|
28
|
+
SelectListItemText,
|
|
29
|
+
} from './SelectList';
|
|
30
|
+
import type { SelectListItemData } from './types';
|
|
31
31
|
|
|
32
32
|
const meta = {
|
|
33
|
-
component:
|
|
34
|
-
id: 'rnative-
|
|
35
|
-
title: 'Core/
|
|
33
|
+
component: SelectList,
|
|
34
|
+
id: 'rnative-selectlist',
|
|
35
|
+
title: 'Core/SelectList',
|
|
36
36
|
subcomponents: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
SelectListContent,
|
|
38
|
+
SelectListItem,
|
|
39
|
+
SelectListItemLeading,
|
|
40
|
+
SelectListItemContent,
|
|
41
|
+
SelectListItemText,
|
|
42
|
+
SelectListItemDescription,
|
|
43
|
+
SelectListItemContentRow,
|
|
44
|
+
SelectListSearch,
|
|
45
|
+
SelectListTrigger,
|
|
46
46
|
},
|
|
47
47
|
decorators: [
|
|
48
48
|
(Story) => (
|
|
@@ -71,12 +71,12 @@ const meta = {
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
-
} satisfies Meta<typeof
|
|
74
|
+
} satisfies Meta<typeof SelectList>;
|
|
75
75
|
|
|
76
76
|
export default meta;
|
|
77
|
-
type Story = StoryObj<typeof
|
|
77
|
+
type Story = StoryObj<typeof SelectList>;
|
|
78
78
|
|
|
79
|
-
const CURRENCIES:
|
|
79
|
+
const CURRENCIES: SelectListItemData[] = [
|
|
80
80
|
{
|
|
81
81
|
value: 'btc',
|
|
82
82
|
label: 'Bitcoin',
|
|
@@ -111,12 +111,12 @@ export const Base: Story = {
|
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
113
|
<>
|
|
114
|
-
<
|
|
114
|
+
<SelectListTrigger
|
|
115
115
|
label='Currency'
|
|
116
116
|
onPress={() => bottomSheetRef.current?.present()}
|
|
117
117
|
>
|
|
118
118
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
119
|
-
</
|
|
119
|
+
</SelectListTrigger>
|
|
120
120
|
<BottomSheet
|
|
121
121
|
ref={bottomSheetRef}
|
|
122
122
|
enableDynamicSizing
|
|
@@ -125,7 +125,7 @@ export const Base: Story = {
|
|
|
125
125
|
>
|
|
126
126
|
<BottomSheetView>
|
|
127
127
|
<BottomSheetHeader title='Select currency' />
|
|
128
|
-
<
|
|
128
|
+
<SelectList
|
|
129
129
|
items={CURRENCIES}
|
|
130
130
|
value={value}
|
|
131
131
|
onValueChange={(v) => {
|
|
@@ -133,29 +133,29 @@ export const Base: Story = {
|
|
|
133
133
|
bottomSheetRef.current?.dismiss();
|
|
134
134
|
}}
|
|
135
135
|
>
|
|
136
|
-
<
|
|
136
|
+
<SelectListContent
|
|
137
137
|
renderItem={(item) => {
|
|
138
138
|
const ticker = (item.meta as { ticker: string }).ticker;
|
|
139
139
|
return (
|
|
140
|
-
<
|
|
141
|
-
<
|
|
140
|
+
<SelectListItem value={item.value}>
|
|
141
|
+
<SelectListItemLeading>
|
|
142
142
|
<CryptoIcon
|
|
143
143
|
ledgerId={(item.meta?.ledgerId as string) ?? ''}
|
|
144
144
|
ticker={ticker}
|
|
145
145
|
size={32}
|
|
146
146
|
/>
|
|
147
|
-
</
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
<
|
|
147
|
+
</SelectListItemLeading>
|
|
148
|
+
<SelectListItemContent>
|
|
149
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
150
|
+
<SelectListItemDescription>
|
|
151
151
|
{ticker}
|
|
152
|
-
</
|
|
153
|
-
</
|
|
154
|
-
</
|
|
152
|
+
</SelectListItemDescription>
|
|
153
|
+
</SelectListItemContent>
|
|
154
|
+
</SelectListItem>
|
|
155
155
|
);
|
|
156
156
|
}}
|
|
157
157
|
/>
|
|
158
|
-
</
|
|
158
|
+
</SelectList>
|
|
159
159
|
</BottomSheetView>
|
|
160
160
|
</BottomSheet>
|
|
161
161
|
</>
|
|
@@ -163,7 +163,7 @@ export const Base: Story = {
|
|
|
163
163
|
},
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
-
const FOODS:
|
|
166
|
+
const FOODS: SelectListItemData[] = [
|
|
167
167
|
{ value: 'apple', label: 'Apple', group: 'Fruits' },
|
|
168
168
|
{ value: 'banana', label: 'Banana', group: 'Fruits' },
|
|
169
169
|
{ value: 'orange', label: 'Orange', group: 'Fruits' },
|
|
@@ -184,12 +184,12 @@ export const WithGroups: Story = {
|
|
|
184
184
|
|
|
185
185
|
return (
|
|
186
186
|
<>
|
|
187
|
-
<
|
|
187
|
+
<SelectListTrigger
|
|
188
188
|
label='Food'
|
|
189
189
|
onPress={() => bottomSheetRef.current?.present()}
|
|
190
190
|
>
|
|
191
191
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
192
|
-
</
|
|
192
|
+
</SelectListTrigger>
|
|
193
193
|
<BottomSheet
|
|
194
194
|
ref={bottomSheetRef}
|
|
195
195
|
enableDynamicSizing
|
|
@@ -198,7 +198,7 @@ export const WithGroups: Story = {
|
|
|
198
198
|
>
|
|
199
199
|
<BottomSheetScrollView>
|
|
200
200
|
<BottomSheetHeader title='Pick a food' />
|
|
201
|
-
<
|
|
201
|
+
<SelectList
|
|
202
202
|
items={FOODS}
|
|
203
203
|
value={value}
|
|
204
204
|
onValueChange={(v) => {
|
|
@@ -206,16 +206,16 @@ export const WithGroups: Story = {
|
|
|
206
206
|
bottomSheetRef.current?.dismiss();
|
|
207
207
|
}}
|
|
208
208
|
>
|
|
209
|
-
<
|
|
209
|
+
<SelectListContent
|
|
210
210
|
renderItem={(item) => (
|
|
211
|
-
<
|
|
212
|
-
<
|
|
213
|
-
<
|
|
214
|
-
</
|
|
215
|
-
</
|
|
211
|
+
<SelectListItem value={item.value}>
|
|
212
|
+
<SelectListItemContent>
|
|
213
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
214
|
+
</SelectListItemContent>
|
|
215
|
+
</SelectListItem>
|
|
216
216
|
)}
|
|
217
217
|
/>
|
|
218
|
-
</
|
|
218
|
+
</SelectList>
|
|
219
219
|
</BottomSheetScrollView>
|
|
220
220
|
</BottomSheet>
|
|
221
221
|
</>
|
|
@@ -223,7 +223,7 @@ export const WithGroups: Story = {
|
|
|
223
223
|
},
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
const NETWORKS:
|
|
226
|
+
const NETWORKS: SelectListItemData[] = [
|
|
227
227
|
{
|
|
228
228
|
value: 'ethereum',
|
|
229
229
|
label: 'Ethereum',
|
|
@@ -258,12 +258,12 @@ export const WithContentRow: Story = {
|
|
|
258
258
|
|
|
259
259
|
return (
|
|
260
260
|
<>
|
|
261
|
-
<
|
|
261
|
+
<SelectListTrigger
|
|
262
262
|
label='Network'
|
|
263
263
|
onPress={() => bottomSheetRef.current?.present()}
|
|
264
264
|
>
|
|
265
265
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
266
|
-
</
|
|
266
|
+
</SelectListTrigger>
|
|
267
267
|
<BottomSheet
|
|
268
268
|
ref={bottomSheetRef}
|
|
269
269
|
enableDynamicSizing
|
|
@@ -272,7 +272,7 @@ export const WithContentRow: Story = {
|
|
|
272
272
|
>
|
|
273
273
|
<BottomSheetView>
|
|
274
274
|
<BottomSheetHeader title='Select network' />
|
|
275
|
-
<
|
|
275
|
+
<SelectList
|
|
276
276
|
items={NETWORKS}
|
|
277
277
|
value={value}
|
|
278
278
|
onValueChange={(v) => {
|
|
@@ -280,7 +280,7 @@ export const WithContentRow: Story = {
|
|
|
280
280
|
bottomSheetRef.current?.dismiss();
|
|
281
281
|
}}
|
|
282
282
|
>
|
|
283
|
-
<
|
|
283
|
+
<SelectListContent
|
|
284
284
|
renderItem={(item) => {
|
|
285
285
|
const meta = item.meta as {
|
|
286
286
|
ticker: string;
|
|
@@ -288,28 +288,28 @@ export const WithContentRow: Story = {
|
|
|
288
288
|
tag: string;
|
|
289
289
|
};
|
|
290
290
|
return (
|
|
291
|
-
<
|
|
292
|
-
<
|
|
291
|
+
<SelectListItem value={item.value}>
|
|
292
|
+
<SelectListItemLeading>
|
|
293
293
|
<CryptoIcon
|
|
294
294
|
ledgerId={meta.ledgerId}
|
|
295
295
|
ticker={meta.ticker}
|
|
296
296
|
size={32}
|
|
297
297
|
/>
|
|
298
|
-
</
|
|
299
|
-
<
|
|
300
|
-
<
|
|
301
|
-
<
|
|
298
|
+
</SelectListItemLeading>
|
|
299
|
+
<SelectListItemContent>
|
|
300
|
+
<SelectListItemContentRow>
|
|
301
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
302
302
|
<Tag label={meta.tag} appearance='gray' size='sm' />
|
|
303
|
-
</
|
|
304
|
-
<
|
|
303
|
+
</SelectListItemContentRow>
|
|
304
|
+
<SelectListItemDescription>
|
|
305
305
|
{meta.ticker}
|
|
306
|
-
</
|
|
307
|
-
</
|
|
308
|
-
</
|
|
306
|
+
</SelectListItemDescription>
|
|
307
|
+
</SelectListItemContent>
|
|
308
|
+
</SelectListItem>
|
|
309
309
|
);
|
|
310
310
|
}}
|
|
311
311
|
/>
|
|
312
|
-
</
|
|
312
|
+
</SelectList>
|
|
313
313
|
</BottomSheetView>
|
|
314
314
|
</BottomSheet>
|
|
315
315
|
</>
|
|
@@ -317,7 +317,7 @@ export const WithContentRow: Story = {
|
|
|
317
317
|
},
|
|
318
318
|
};
|
|
319
319
|
|
|
320
|
-
const ACCOUNTS:
|
|
320
|
+
const ACCOUNTS: SelectListItemData[] = [
|
|
321
321
|
{
|
|
322
322
|
value: 'savings',
|
|
323
323
|
label: 'Savings Account',
|
|
@@ -350,12 +350,12 @@ export const WithDisabledItems: Story = {
|
|
|
350
350
|
|
|
351
351
|
return (
|
|
352
352
|
<>
|
|
353
|
-
<
|
|
353
|
+
<SelectListTrigger
|
|
354
354
|
label='Account'
|
|
355
355
|
onPress={() => bottomSheetRef.current?.present()}
|
|
356
356
|
>
|
|
357
357
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
358
|
-
</
|
|
358
|
+
</SelectListTrigger>
|
|
359
359
|
<BottomSheet
|
|
360
360
|
ref={bottomSheetRef}
|
|
361
361
|
enableDynamicSizing
|
|
@@ -364,7 +364,7 @@ export const WithDisabledItems: Story = {
|
|
|
364
364
|
>
|
|
365
365
|
<BottomSheetView>
|
|
366
366
|
<BottomSheetHeader title='Select account' />
|
|
367
|
-
<
|
|
367
|
+
<SelectList
|
|
368
368
|
items={ACCOUNTS}
|
|
369
369
|
value={value}
|
|
370
370
|
onValueChange={(v) => {
|
|
@@ -372,24 +372,24 @@ export const WithDisabledItems: Story = {
|
|
|
372
372
|
bottomSheetRef.current?.dismiss();
|
|
373
373
|
}}
|
|
374
374
|
>
|
|
375
|
-
<
|
|
375
|
+
<SelectListContent
|
|
376
376
|
renderItem={(item) => (
|
|
377
|
-
<
|
|
378
|
-
<
|
|
377
|
+
<SelectListItem value={item.value} disabled={item.disabled}>
|
|
378
|
+
<SelectListItemLeading>
|
|
379
379
|
<Spot appearance='icon' icon={Settings} />
|
|
380
|
-
</
|
|
381
|
-
<
|
|
382
|
-
<
|
|
380
|
+
</SelectListItemLeading>
|
|
381
|
+
<SelectListItemContent>
|
|
382
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
383
383
|
{item.description && (
|
|
384
|
-
<
|
|
384
|
+
<SelectListItemDescription>
|
|
385
385
|
{item.description}
|
|
386
|
-
</
|
|
386
|
+
</SelectListItemDescription>
|
|
387
387
|
)}
|
|
388
|
-
</
|
|
389
|
-
</
|
|
388
|
+
</SelectListItemContent>
|
|
389
|
+
</SelectListItem>
|
|
390
390
|
)}
|
|
391
391
|
/>
|
|
392
|
-
</
|
|
392
|
+
</SelectList>
|
|
393
393
|
</BottomSheetView>
|
|
394
394
|
</BottomSheet>
|
|
395
395
|
</>
|
|
@@ -397,7 +397,7 @@ export const WithDisabledItems: Story = {
|
|
|
397
397
|
},
|
|
398
398
|
};
|
|
399
399
|
|
|
400
|
-
const GROUPED_NETWORKS:
|
|
400
|
+
const GROUPED_NETWORKS: SelectListItemData[] = [
|
|
401
401
|
{
|
|
402
402
|
value: 'eth-main',
|
|
403
403
|
label: 'Ethereum',
|
|
@@ -442,12 +442,12 @@ export const GroupedWithContentRow: Story = {
|
|
|
442
442
|
|
|
443
443
|
return (
|
|
444
444
|
<>
|
|
445
|
-
<
|
|
445
|
+
<SelectListTrigger
|
|
446
446
|
label='Network'
|
|
447
447
|
onPress={() => bottomSheetRef.current?.present()}
|
|
448
448
|
>
|
|
449
449
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
450
|
-
</
|
|
450
|
+
</SelectListTrigger>
|
|
451
451
|
<BottomSheet
|
|
452
452
|
ref={bottomSheetRef}
|
|
453
453
|
enableDynamicSizing
|
|
@@ -456,7 +456,7 @@ export const GroupedWithContentRow: Story = {
|
|
|
456
456
|
>
|
|
457
457
|
<BottomSheetScrollView>
|
|
458
458
|
<BottomSheetHeader title='Select network' />
|
|
459
|
-
<
|
|
459
|
+
<SelectList
|
|
460
460
|
items={GROUPED_NETWORKS}
|
|
461
461
|
value={value}
|
|
462
462
|
onValueChange={(v) => {
|
|
@@ -464,7 +464,7 @@ export const GroupedWithContentRow: Story = {
|
|
|
464
464
|
bottomSheetRef.current?.dismiss();
|
|
465
465
|
}}
|
|
466
466
|
>
|
|
467
|
-
<
|
|
467
|
+
<SelectListContent
|
|
468
468
|
renderItem={(item) => {
|
|
469
469
|
const meta = item.meta as {
|
|
470
470
|
ticker: string;
|
|
@@ -472,28 +472,28 @@ export const GroupedWithContentRow: Story = {
|
|
|
472
472
|
tag: string;
|
|
473
473
|
};
|
|
474
474
|
return (
|
|
475
|
-
<
|
|
476
|
-
<
|
|
475
|
+
<SelectListItem value={item.value}>
|
|
476
|
+
<SelectListItemLeading>
|
|
477
477
|
<CryptoIcon
|
|
478
478
|
ledgerId={meta.ledgerId}
|
|
479
479
|
ticker={meta.ticker}
|
|
480
480
|
size={32}
|
|
481
481
|
/>
|
|
482
|
-
</
|
|
483
|
-
<
|
|
484
|
-
<
|
|
485
|
-
<
|
|
482
|
+
</SelectListItemLeading>
|
|
483
|
+
<SelectListItemContent>
|
|
484
|
+
<SelectListItemContentRow>
|
|
485
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
486
486
|
<Tag label={meta.tag} appearance='gray' size='sm' />
|
|
487
|
-
</
|
|
488
|
-
<
|
|
487
|
+
</SelectListItemContentRow>
|
|
488
|
+
<SelectListItemDescription>
|
|
489
489
|
{meta.ticker}
|
|
490
|
-
</
|
|
491
|
-
</
|
|
492
|
-
</
|
|
490
|
+
</SelectListItemDescription>
|
|
491
|
+
</SelectListItemContent>
|
|
492
|
+
</SelectListItem>
|
|
493
493
|
);
|
|
494
494
|
}}
|
|
495
495
|
/>
|
|
496
|
-
</
|
|
496
|
+
</SelectList>
|
|
497
497
|
</BottomSheetScrollView>
|
|
498
498
|
</BottomSheet>
|
|
499
499
|
</>
|
|
@@ -513,12 +513,12 @@ export const WithSearch: Story = {
|
|
|
513
513
|
|
|
514
514
|
return (
|
|
515
515
|
<>
|
|
516
|
-
<
|
|
516
|
+
<SelectListTrigger
|
|
517
517
|
label='Currency'
|
|
518
518
|
onPress={() => bottomSheetRef.current?.present()}
|
|
519
519
|
>
|
|
520
520
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
521
|
-
</
|
|
521
|
+
</SelectListTrigger>
|
|
522
522
|
<BottomSheet
|
|
523
523
|
ref={bottomSheetRef}
|
|
524
524
|
enableDynamicSizing
|
|
@@ -527,7 +527,7 @@ export const WithSearch: Story = {
|
|
|
527
527
|
>
|
|
528
528
|
<BottomSheetView>
|
|
529
529
|
<BottomSheetHeader title='Select currency' />
|
|
530
|
-
<
|
|
530
|
+
<SelectList
|
|
531
531
|
items={CURRENCIES}
|
|
532
532
|
value={value}
|
|
533
533
|
onValueChange={(v) => {
|
|
@@ -535,34 +535,34 @@ export const WithSearch: Story = {
|
|
|
535
535
|
bottomSheetRef.current?.dismiss();
|
|
536
536
|
}}
|
|
537
537
|
>
|
|
538
|
-
<
|
|
539
|
-
<
|
|
538
|
+
<SelectListSearch placeholder='Search currencies' />
|
|
539
|
+
<SelectListContent
|
|
540
540
|
renderItem={(item) => {
|
|
541
541
|
const ticker = (item.meta as { ticker: string }).ticker;
|
|
542
542
|
return (
|
|
543
|
-
<
|
|
544
|
-
<
|
|
543
|
+
<SelectListItem value={item.value}>
|
|
544
|
+
<SelectListItemLeading>
|
|
545
545
|
<CryptoIcon
|
|
546
546
|
ledgerId={(item.meta?.ledgerId as string) ?? ''}
|
|
547
547
|
ticker={ticker}
|
|
548
548
|
size={32}
|
|
549
549
|
/>
|
|
550
|
-
</
|
|
551
|
-
<
|
|
552
|
-
<
|
|
553
|
-
<
|
|
550
|
+
</SelectListItemLeading>
|
|
551
|
+
<SelectListItemContent>
|
|
552
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
553
|
+
<SelectListItemDescription>
|
|
554
554
|
{ticker}
|
|
555
|
-
</
|
|
556
|
-
</
|
|
557
|
-
</
|
|
555
|
+
</SelectListItemDescription>
|
|
556
|
+
</SelectListItemContent>
|
|
557
|
+
</SelectListItem>
|
|
558
558
|
);
|
|
559
559
|
}}
|
|
560
560
|
/>
|
|
561
|
-
<
|
|
561
|
+
<SelectListEmptyState
|
|
562
562
|
title='No currencies found'
|
|
563
563
|
description='Try a different search term'
|
|
564
564
|
/>
|
|
565
|
-
</
|
|
565
|
+
</SelectList>
|
|
566
566
|
</BottomSheetView>
|
|
567
567
|
</BottomSheet>
|
|
568
568
|
</>
|
|
@@ -582,12 +582,12 @@ export const WithSearchAndGroups: Story = {
|
|
|
582
582
|
|
|
583
583
|
return (
|
|
584
584
|
<>
|
|
585
|
-
<
|
|
585
|
+
<SelectListTrigger
|
|
586
586
|
label='Network'
|
|
587
587
|
onPress={() => bottomSheetRef.current?.present()}
|
|
588
588
|
>
|
|
589
589
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
590
|
-
</
|
|
590
|
+
</SelectListTrigger>
|
|
591
591
|
<BottomSheet
|
|
592
592
|
ref={bottomSheetRef}
|
|
593
593
|
enableDynamicSizing
|
|
@@ -596,7 +596,7 @@ export const WithSearchAndGroups: Story = {
|
|
|
596
596
|
>
|
|
597
597
|
<BottomSheetScrollView>
|
|
598
598
|
<BottomSheetHeader title='Select network' />
|
|
599
|
-
<
|
|
599
|
+
<SelectList
|
|
600
600
|
items={GROUPED_NETWORKS}
|
|
601
601
|
value={value}
|
|
602
602
|
onValueChange={(v) => {
|
|
@@ -604,18 +604,18 @@ export const WithSearchAndGroups: Story = {
|
|
|
604
604
|
bottomSheetRef.current?.dismiss();
|
|
605
605
|
}}
|
|
606
606
|
>
|
|
607
|
-
<
|
|
608
|
-
<
|
|
607
|
+
<SelectListSearch placeholder='Search networks' />
|
|
608
|
+
<SelectListContent
|
|
609
609
|
renderItem={(item) => (
|
|
610
|
-
<
|
|
611
|
-
<
|
|
612
|
-
<
|
|
613
|
-
</
|
|
614
|
-
</
|
|
610
|
+
<SelectListItem value={item.value}>
|
|
611
|
+
<SelectListItemContent>
|
|
612
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
613
|
+
</SelectListItemContent>
|
|
614
|
+
</SelectListItem>
|
|
615
615
|
)}
|
|
616
616
|
/>
|
|
617
|
-
<
|
|
618
|
-
</
|
|
617
|
+
<SelectListEmptyState title='No networks found' />
|
|
618
|
+
</SelectList>
|
|
619
619
|
</BottomSheetScrollView>
|
|
620
620
|
</BottomSheet>
|
|
621
621
|
</>
|
|
@@ -635,12 +635,12 @@ export const WithCustomSearchFilter: Story = {
|
|
|
635
635
|
|
|
636
636
|
return (
|
|
637
637
|
<>
|
|
638
|
-
<
|
|
638
|
+
<SelectListTrigger
|
|
639
639
|
label='Currency'
|
|
640
640
|
onPress={() => bottomSheetRef.current?.present()}
|
|
641
641
|
>
|
|
642
642
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
643
|
-
</
|
|
643
|
+
</SelectListTrigger>
|
|
644
644
|
<BottomSheet
|
|
645
645
|
ref={bottomSheetRef}
|
|
646
646
|
enableDynamicSizing
|
|
@@ -649,7 +649,7 @@ export const WithCustomSearchFilter: Story = {
|
|
|
649
649
|
>
|
|
650
650
|
<BottomSheetView>
|
|
651
651
|
<BottomSheetHeader title='Select currency' />
|
|
652
|
-
<
|
|
652
|
+
<SelectList
|
|
653
653
|
items={CURRENCIES}
|
|
654
654
|
value={value}
|
|
655
655
|
onValueChange={(v) => {
|
|
@@ -665,31 +665,31 @@ export const WithCustomSearchFilter: Story = {
|
|
|
665
665
|
);
|
|
666
666
|
}}
|
|
667
667
|
>
|
|
668
|
-
<
|
|
669
|
-
<
|
|
668
|
+
<SelectListSearch placeholder='Search by name or ticker' />
|
|
669
|
+
<SelectListContent
|
|
670
670
|
renderItem={(item) => {
|
|
671
671
|
const ticker = (item.meta as { ticker: string }).ticker;
|
|
672
672
|
return (
|
|
673
|
-
<
|
|
674
|
-
<
|
|
673
|
+
<SelectListItem value={item.value}>
|
|
674
|
+
<SelectListItemLeading>
|
|
675
675
|
<CryptoIcon
|
|
676
676
|
ledgerId={(item.meta?.ledgerId as string) ?? ''}
|
|
677
677
|
ticker={ticker}
|
|
678
678
|
size={32}
|
|
679
679
|
/>
|
|
680
|
-
</
|
|
681
|
-
<
|
|
682
|
-
<
|
|
683
|
-
<
|
|
680
|
+
</SelectListItemLeading>
|
|
681
|
+
<SelectListItemContent>
|
|
682
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
683
|
+
<SelectListItemDescription>
|
|
684
684
|
{ticker}
|
|
685
|
-
</
|
|
686
|
-
</
|
|
687
|
-
</
|
|
685
|
+
</SelectListItemDescription>
|
|
686
|
+
</SelectListItemContent>
|
|
687
|
+
</SelectListItem>
|
|
688
688
|
);
|
|
689
689
|
}}
|
|
690
690
|
/>
|
|
691
|
-
<
|
|
692
|
-
</
|
|
691
|
+
<SelectListEmptyState title='No currencies found' />
|
|
692
|
+
</SelectList>
|
|
693
693
|
</BottomSheetView>
|
|
694
694
|
</BottomSheet>
|
|
695
695
|
</>
|
|
@@ -710,12 +710,12 @@ export const WithControlledSearch: Story = {
|
|
|
710
710
|
|
|
711
711
|
return (
|
|
712
712
|
<>
|
|
713
|
-
<
|
|
713
|
+
<SelectListTrigger
|
|
714
714
|
label='Currency'
|
|
715
715
|
onPress={() => bottomSheetRef.current?.present()}
|
|
716
716
|
>
|
|
717
717
|
{selected && <Text lx={{ color: 'base' }}>{selected.label}</Text>}
|
|
718
|
-
</
|
|
718
|
+
</SelectListTrigger>
|
|
719
719
|
<BottomSheet
|
|
720
720
|
ref={bottomSheetRef}
|
|
721
721
|
enableDynamicSizing
|
|
@@ -727,7 +727,7 @@ export const WithControlledSearch: Story = {
|
|
|
727
727
|
<Box lx={{ padding: 's8' }}>
|
|
728
728
|
<Text lx={{ color: 'muted' }}>Search: "{searchValue}"</Text>
|
|
729
729
|
</Box>
|
|
730
|
-
<
|
|
730
|
+
<SelectList
|
|
731
731
|
items={CURRENCIES}
|
|
732
732
|
value={value}
|
|
733
733
|
onValueChange={(v) => {
|
|
@@ -737,31 +737,31 @@ export const WithControlledSearch: Story = {
|
|
|
737
737
|
searchValue={searchValue}
|
|
738
738
|
onSearchValueChange={setSearchValue}
|
|
739
739
|
>
|
|
740
|
-
<
|
|
741
|
-
<
|
|
740
|
+
<SelectListSearch placeholder='Search currencies' />
|
|
741
|
+
<SelectListContent
|
|
742
742
|
renderItem={(item) => {
|
|
743
743
|
const ticker = (item.meta as { ticker: string }).ticker;
|
|
744
744
|
return (
|
|
745
|
-
<
|
|
746
|
-
<
|
|
745
|
+
<SelectListItem value={item.value}>
|
|
746
|
+
<SelectListItemLeading>
|
|
747
747
|
<CryptoIcon
|
|
748
748
|
ledgerId={(item.meta?.ledgerId as string) ?? ''}
|
|
749
749
|
ticker={ticker}
|
|
750
750
|
size={32}
|
|
751
751
|
/>
|
|
752
|
-
</
|
|
753
|
-
<
|
|
754
|
-
<
|
|
755
|
-
<
|
|
752
|
+
</SelectListItemLeading>
|
|
753
|
+
<SelectListItemContent>
|
|
754
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
755
|
+
<SelectListItemDescription>
|
|
756
756
|
{ticker}
|
|
757
|
-
</
|
|
758
|
-
</
|
|
759
|
-
</
|
|
757
|
+
</SelectListItemDescription>
|
|
758
|
+
</SelectListItemContent>
|
|
759
|
+
</SelectListItem>
|
|
760
760
|
);
|
|
761
761
|
}}
|
|
762
762
|
/>
|
|
763
|
-
<
|
|
764
|
-
</
|
|
763
|
+
<SelectListEmptyState title='No currencies found' />
|
|
764
|
+
</SelectList>
|
|
765
765
|
</BottomSheetView>
|
|
766
766
|
</BottomSheet>
|
|
767
767
|
</>
|
|
@@ -779,7 +779,7 @@ export const EmptyState: Story = {
|
|
|
779
779
|
|
|
780
780
|
return (
|
|
781
781
|
<>
|
|
782
|
-
<
|
|
782
|
+
<SelectListTrigger
|
|
783
783
|
label='Currency'
|
|
784
784
|
onPress={() => bottomSheetRef.current?.present()}
|
|
785
785
|
/>
|
|
@@ -791,21 +791,21 @@ export const EmptyState: Story = {
|
|
|
791
791
|
>
|
|
792
792
|
<BottomSheetView>
|
|
793
793
|
<BottomSheetHeader title='Select currency' />
|
|
794
|
-
<
|
|
795
|
-
<
|
|
794
|
+
<SelectList items={[]} value={null}>
|
|
795
|
+
<SelectListContent
|
|
796
796
|
renderItem={(item) => (
|
|
797
|
-
<
|
|
798
|
-
<
|
|
799
|
-
<
|
|
800
|
-
</
|
|
801
|
-
</
|
|
797
|
+
<SelectListItem value={item.value}>
|
|
798
|
+
<SelectListItemContent>
|
|
799
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
800
|
+
</SelectListItemContent>
|
|
801
|
+
</SelectListItem>
|
|
802
802
|
)}
|
|
803
803
|
/>
|
|
804
|
-
<
|
|
804
|
+
<SelectListEmptyState
|
|
805
805
|
title='No options available'
|
|
806
806
|
description='There are no items to display'
|
|
807
807
|
/>
|
|
808
|
-
</
|
|
808
|
+
</SelectList>
|
|
809
809
|
</BottomSheetView>
|
|
810
810
|
</BottomSheet>
|
|
811
811
|
</>
|
|
@@ -813,13 +813,13 @@ export const EmptyState: Story = {
|
|
|
813
813
|
},
|
|
814
814
|
};
|
|
815
815
|
|
|
816
|
-
const SIMPLE_OPTIONS:
|
|
816
|
+
const SIMPLE_OPTIONS: SelectListItemData[] = [
|
|
817
817
|
{ value: 'all', label: 'All accounts' },
|
|
818
818
|
{ value: 'savings', label: 'Savings' },
|
|
819
819
|
{ value: 'checking', label: 'Checking' },
|
|
820
820
|
];
|
|
821
821
|
|
|
822
|
-
const SETTINGS_OPTIONS:
|
|
822
|
+
const SETTINGS_OPTIONS: SelectListItemData[] = [
|
|
823
823
|
{ value: 'general', label: 'General' },
|
|
824
824
|
{ value: 'security', label: 'Security' },
|
|
825
825
|
{ value: 'notifications', label: 'Notifications' },
|
|
@@ -827,7 +827,7 @@ const SETTINGS_OPTIONS: OptionListItemData[] = [
|
|
|
827
827
|
|
|
828
828
|
const appearances = ['gray', 'transparent', 'no-background'] as const;
|
|
829
829
|
|
|
830
|
-
const
|
|
830
|
+
const SimpleSelectListSheet = ({
|
|
831
831
|
sheetRef,
|
|
832
832
|
items,
|
|
833
833
|
title,
|
|
@@ -835,7 +835,7 @@ const SimpleOptionListSheet = ({
|
|
|
835
835
|
onValueChange,
|
|
836
836
|
}: {
|
|
837
837
|
sheetRef: ReturnType<typeof useBottomSheetRef>;
|
|
838
|
-
items:
|
|
838
|
+
items: SelectListItemData[];
|
|
839
839
|
title: string;
|
|
840
840
|
value: string | null;
|
|
841
841
|
onValueChange: (v: string | null) => void;
|
|
@@ -848,7 +848,7 @@ const SimpleOptionListSheet = ({
|
|
|
848
848
|
>
|
|
849
849
|
<BottomSheetView>
|
|
850
850
|
<BottomSheetHeader title={title} />
|
|
851
|
-
<
|
|
851
|
+
<SelectList
|
|
852
852
|
items={items}
|
|
853
853
|
value={value}
|
|
854
854
|
onValueChange={(v) => {
|
|
@@ -856,16 +856,16 @@ const SimpleOptionListSheet = ({
|
|
|
856
856
|
sheetRef.current?.dismiss();
|
|
857
857
|
}}
|
|
858
858
|
>
|
|
859
|
-
<
|
|
859
|
+
<SelectListContent
|
|
860
860
|
renderItem={(item) => (
|
|
861
|
-
<
|
|
862
|
-
<
|
|
863
|
-
<
|
|
864
|
-
</
|
|
865
|
-
</
|
|
861
|
+
<SelectListItem value={item.value}>
|
|
862
|
+
<SelectListItemContent>
|
|
863
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
864
|
+
</SelectListItemContent>
|
|
865
|
+
</SelectListItem>
|
|
866
866
|
)}
|
|
867
867
|
/>
|
|
868
|
-
</
|
|
868
|
+
</SelectList>
|
|
869
869
|
</BottomSheetView>
|
|
870
870
|
</BottomSheet>
|
|
871
871
|
);
|
|
@@ -951,14 +951,14 @@ export const TriggerShowcase: Story = {
|
|
|
951
951
|
})}
|
|
952
952
|
</Box>
|
|
953
953
|
|
|
954
|
-
<
|
|
954
|
+
<SimpleSelectListSheet
|
|
955
955
|
sheetRef={buttonRef}
|
|
956
956
|
items={SIMPLE_OPTIONS}
|
|
957
957
|
title='All accounts'
|
|
958
958
|
value={buttonValue}
|
|
959
959
|
onValueChange={setButtonValue}
|
|
960
960
|
/>
|
|
961
|
-
<
|
|
961
|
+
<SimpleSelectListSheet
|
|
962
962
|
sheetRef={iconRef}
|
|
963
963
|
items={SETTINGS_OPTIONS}
|
|
964
964
|
title='Settings'
|
|
@@ -973,7 +973,7 @@ export const TriggerShowcase: Story = {
|
|
|
973
973
|
>
|
|
974
974
|
<BottomSheetView>
|
|
975
975
|
<BottomSheetHeader title='Select network' />
|
|
976
|
-
<
|
|
976
|
+
<SelectList
|
|
977
977
|
items={CURRENCIES}
|
|
978
978
|
value={cryptoValue}
|
|
979
979
|
onValueChange={(v) => {
|
|
@@ -981,33 +981,33 @@ export const TriggerShowcase: Story = {
|
|
|
981
981
|
cryptoRef.current?.dismiss();
|
|
982
982
|
}}
|
|
983
983
|
>
|
|
984
|
-
<
|
|
984
|
+
<SelectListContent
|
|
985
985
|
renderItem={(item) => {
|
|
986
986
|
const ticker = (item.meta as { ticker: string }).ticker;
|
|
987
987
|
return (
|
|
988
|
-
<
|
|
989
|
-
<
|
|
988
|
+
<SelectListItem value={item.value}>
|
|
989
|
+
<SelectListItemLeading>
|
|
990
990
|
<CryptoIcon
|
|
991
991
|
ledgerId={(item.meta?.ledgerId as string) ?? ''}
|
|
992
992
|
ticker={ticker}
|
|
993
993
|
size={32}
|
|
994
994
|
/>
|
|
995
|
-
</
|
|
996
|
-
<
|
|
997
|
-
<
|
|
998
|
-
<
|
|
995
|
+
</SelectListItemLeading>
|
|
996
|
+
<SelectListItemContent>
|
|
997
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
998
|
+
<SelectListItemDescription>
|
|
999
999
|
{ticker}
|
|
1000
|
-
</
|
|
1001
|
-
</
|
|
1002
|
-
</
|
|
1000
|
+
</SelectListItemDescription>
|
|
1001
|
+
</SelectListItemContent>
|
|
1002
|
+
</SelectListItem>
|
|
1003
1003
|
);
|
|
1004
1004
|
}}
|
|
1005
1005
|
/>
|
|
1006
|
-
</
|
|
1006
|
+
</SelectList>
|
|
1007
1007
|
</BottomSheetView>
|
|
1008
1008
|
</BottomSheet>
|
|
1009
1009
|
{appearances.map((appearance) => (
|
|
1010
|
-
<
|
|
1010
|
+
<SimpleSelectListSheet
|
|
1011
1011
|
key={appearance}
|
|
1012
1012
|
sheetRef={appearanceRefs[appearance]}
|
|
1013
1013
|
items={SIMPLE_OPTIONS}
|
|
@@ -1030,39 +1030,39 @@ export const WithDefaultValue: Story = {
|
|
|
1030
1030
|
},
|
|
1031
1031
|
render: () => (
|
|
1032
1032
|
<Box lx={{ width: 's320' }}>
|
|
1033
|
-
<
|
|
1034
|
-
<
|
|
1033
|
+
<SelectList items={CURRENCIES} defaultValue='eth'>
|
|
1034
|
+
<SelectListContent
|
|
1035
1035
|
renderItem={(item) => {
|
|
1036
1036
|
const meta = item.meta as { ticker: string; ledgerId: string };
|
|
1037
1037
|
return (
|
|
1038
|
-
<
|
|
1039
|
-
<
|
|
1038
|
+
<SelectListItem value={item.value}>
|
|
1039
|
+
<SelectListItemLeading>
|
|
1040
1040
|
<CryptoIcon
|
|
1041
1041
|
ledgerId={meta.ledgerId}
|
|
1042
1042
|
ticker={meta.ticker}
|
|
1043
1043
|
size={32}
|
|
1044
1044
|
/>
|
|
1045
|
-
</
|
|
1046
|
-
<
|
|
1047
|
-
<
|
|
1048
|
-
<
|
|
1045
|
+
</SelectListItemLeading>
|
|
1046
|
+
<SelectListItemContent>
|
|
1047
|
+
<SelectListItemText>{item.label}</SelectListItemText>
|
|
1048
|
+
<SelectListItemDescription>
|
|
1049
1049
|
{meta.ticker}
|
|
1050
|
-
</
|
|
1051
|
-
</
|
|
1052
|
-
</
|
|
1050
|
+
</SelectListItemDescription>
|
|
1051
|
+
</SelectListItemContent>
|
|
1052
|
+
</SelectListItem>
|
|
1053
1053
|
);
|
|
1054
1054
|
}}
|
|
1055
1055
|
/>
|
|
1056
|
-
</
|
|
1056
|
+
</SelectList>
|
|
1057
1057
|
</Box>
|
|
1058
1058
|
),
|
|
1059
1059
|
};
|
|
1060
1060
|
|
|
1061
1061
|
type TypedNetwork = 'eth' | 'sol' | 'btc';
|
|
1062
1062
|
type TypedNetworkMeta = { ticker: string; ledgerId: string };
|
|
1063
|
-
const NetworkList =
|
|
1063
|
+
const NetworkList = createSelectList<TypedNetwork, TypedNetworkMeta>();
|
|
1064
1064
|
|
|
1065
|
-
const TYPED_NETWORKS:
|
|
1065
|
+
const TYPED_NETWORKS: SelectListItemData<TypedNetwork, TypedNetworkMeta>[] = [
|
|
1066
1066
|
{
|
|
1067
1067
|
value: 'eth',
|
|
1068
1068
|
label: 'Ethereum',
|
|
@@ -1090,35 +1090,35 @@ export const TypesafeFactory: Story = {
|
|
|
1090
1090
|
|
|
1091
1091
|
return (
|
|
1092
1092
|
<Box lx={{ width: 's320' }}>
|
|
1093
|
-
<NetworkList.
|
|
1093
|
+
<NetworkList.SelectList
|
|
1094
1094
|
items={TYPED_NETWORKS}
|
|
1095
1095
|
value={value}
|
|
1096
1096
|
onValueChange={setValue}
|
|
1097
1097
|
>
|
|
1098
|
-
<NetworkList.
|
|
1098
|
+
<NetworkList.SelectListContent
|
|
1099
1099
|
renderItem={({ value, label, meta }) =>
|
|
1100
1100
|
meta ? (
|
|
1101
|
-
<NetworkList.
|
|
1102
|
-
<NetworkList.
|
|
1101
|
+
<NetworkList.SelectListItem value={value}>
|
|
1102
|
+
<NetworkList.SelectListItemLeading>
|
|
1103
1103
|
<CryptoIcon
|
|
1104
1104
|
ledgerId={meta.ledgerId}
|
|
1105
1105
|
ticker={meta.ticker}
|
|
1106
1106
|
size={32}
|
|
1107
1107
|
/>
|
|
1108
|
-
</NetworkList.
|
|
1109
|
-
<NetworkList.
|
|
1110
|
-
<NetworkList.
|
|
1108
|
+
</NetworkList.SelectListItemLeading>
|
|
1109
|
+
<NetworkList.SelectListItemContent>
|
|
1110
|
+
<NetworkList.SelectListItemText>
|
|
1111
1111
|
{label}
|
|
1112
|
-
</NetworkList.
|
|
1113
|
-
<NetworkList.
|
|
1112
|
+
</NetworkList.SelectListItemText>
|
|
1113
|
+
<NetworkList.SelectListItemDescription>
|
|
1114
1114
|
{meta.ticker}
|
|
1115
|
-
</NetworkList.
|
|
1116
|
-
</NetworkList.
|
|
1117
|
-
</NetworkList.
|
|
1115
|
+
</NetworkList.SelectListItemDescription>
|
|
1116
|
+
</NetworkList.SelectListItemContent>
|
|
1117
|
+
</NetworkList.SelectListItem>
|
|
1118
1118
|
) : null
|
|
1119
1119
|
}
|
|
1120
1120
|
/>
|
|
1121
|
-
</NetworkList.
|
|
1121
|
+
</NetworkList.SelectList>
|
|
1122
1122
|
</Box>
|
|
1123
1123
|
);
|
|
1124
1124
|
},
|