@ledgerhq/lumen-ui-rnative 0.0.47 → 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.
- package/dist/package.json +3 -3
- package/dist/src/lib/Components/Divider/Divider.d.ts +25 -0
- package/dist/src/lib/Components/Divider/Divider.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/Divider.js +40 -0
- package/dist/src/lib/Components/Divider/Divider.stories.d.ts +9 -0
- package/dist/src/lib/Components/Divider/Divider.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/Divider.stories.js +51 -0
- package/dist/src/lib/Components/Divider/index.d.ts +3 -0
- package/dist/src/lib/Components/Divider/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/index.js +1 -0
- package/dist/src/lib/Components/Divider/types.d.ts +9 -0
- package/dist/src/lib/Components/Divider/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/types.js +1 -0
- package/dist/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/src/lib/Components/ListItem/ListItem.js +9 -3
- package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
- package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.js +2 -7
- package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/src/lib/Components/Select/Select.js +4 -10
- package/dist/src/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.d.ts +84 -19
- package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.figma.js +8 -18
- package/dist/src/lib/Components/Tile/Tile.js +160 -59
- package/dist/src/lib/Components/Tile/Tile.stories.d.ts +2 -2
- package/dist/src/lib/Components/Tile/Tile.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.stories.js +30 -81
- package/dist/src/lib/Components/Tile/index.d.ts +1 -1
- package/dist/src/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/index.js +1 -1
- package/dist/src/lib/Components/Tile/types.d.ts +29 -19
- package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/src/lib/Components/index.d.ts +1 -0
- package/dist/src/lib/Components/index.d.ts.map +1 -1
- package/dist/src/lib/Components/index.js +1 -0
- package/package.json +3 -3
- package/src/lib/Components/Divider/Divider.mdx +151 -0
- package/src/lib/Components/Divider/Divider.stories.tsx +140 -0
- package/src/lib/Components/Divider/Divider.test.tsx +92 -0
- package/src/lib/Components/Divider/Divider.tsx +52 -0
- package/src/lib/Components/Divider/index.ts +2 -0
- package/src/lib/Components/Divider/types.ts +9 -0
- package/src/lib/Components/ListItem/ListItem.tsx +10 -3
- package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +5 -7
- package/src/lib/Components/Select/Select.tsx +4 -18
- package/src/lib/Components/Select/types.ts +1 -3
- package/src/lib/Components/Tile/Tile.figma.tsx +24 -23
- package/src/lib/Components/Tile/Tile.mdx +128 -35
- package/src/lib/Components/Tile/Tile.stories.tsx +167 -146
- package/src/lib/Components/Tile/Tile.test.tsx +193 -221
- package/src/lib/Components/Tile/Tile.tsx +270 -123
- package/src/lib/Components/Tile/index.ts +7 -1
- package/src/lib/Components/Tile/types.ts +38 -19
- package/src/lib/Components/index.ts +1 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Meta, Story, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as TileStories from './Tile.stories';
|
|
3
3
|
import { Tile } from './Tile';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
CustomTabs,
|
|
6
|
+
Tab,
|
|
7
|
+
DoVsDontRow,
|
|
8
|
+
DoBlockItem,
|
|
9
|
+
DontBlockItem,
|
|
10
|
+
} from '../../../../.storybook/components';
|
|
5
11
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
6
12
|
import { Box } from '../Utility';
|
|
7
13
|
|
|
@@ -14,42 +20,47 @@ import { Box } from '../Utility';
|
|
|
14
20
|
|
|
15
21
|
## Introduction
|
|
16
22
|
|
|
17
|
-
Tile components are compact, card-like interactive elements designed for horizontal lists, carousels, or grids. They
|
|
23
|
+
Tile components are compact, card-like interactive elements designed for horizontal lists, carousels, or grids. They use a flexible composite pattern that allows you to compose tiles with spots, text content, tags, and custom elements in a vertical layout.
|
|
18
24
|
|
|
19
25
|
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=5783-1328).
|
|
20
26
|
|
|
21
27
|
## Anatomy
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **Trailing Content (optional)**: Trailing custom content at the bottom of the tile
|
|
29
|
-
- **Secondary Action (optional)**: Action button in the top right corner, visible on hover
|
|
29
|
+
- **TileSpot**: Visual icon or element at the top
|
|
30
|
+
- **TileContent**: Container for title and description
|
|
31
|
+
- **TileTitle**: The main label of the item (required)
|
|
32
|
+
- **TileDescription (optional)**: Provides additional context
|
|
33
|
+
- **Custom Content (optional)**: Any ReactNode like Tag, View, etc.
|
|
30
34
|
|
|
31
35
|
## Properties
|
|
32
36
|
|
|
33
|
-
### Overview
|
|
34
|
-
|
|
35
37
|
<Canvas of={TileStories.Base} />
|
|
36
38
|
<Controls of={TileStories.Base} />
|
|
37
39
|
|
|
38
|
-
###
|
|
40
|
+
### Appearance & States
|
|
41
|
+
|
|
42
|
+
Two appearance variants are available with multiple interactive states:
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
**Appearances:**
|
|
45
|
+
- **no-background** (default): Transparent background with pressed states
|
|
46
|
+
- **card**: Surface background color with pressed states
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
**States:**
|
|
49
|
+
- **Default**: Base state with no interaction
|
|
50
|
+
- **Pressed**: Darker background when pressed
|
|
51
|
+
- **Disabled**: Non-interactive state with disabled styles
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
<Canvas of={TileStories.AppearanceShowcase} />
|
|
45
54
|
|
|
46
|
-
|
|
55
|
+
### Variants
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
Tile components support various configurations including different spot icons, with/without description, and with/without trailing content (tags).
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
<Canvas of={TileStories.VariantsShowcase} />
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
### Secondary Action (Long Press)
|
|
62
|
+
|
|
63
|
+
Use `onLongPress` for secondary actions on mobile devices. Try long pressing the tile below to see it in action.
|
|
53
64
|
|
|
54
65
|
<Canvas of={TileStories.WithSecondaryAction} />
|
|
55
66
|
|
|
@@ -75,42 +86,124 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
75
86
|
## Basic Usage
|
|
76
87
|
|
|
77
88
|
```tsx
|
|
78
|
-
import {
|
|
89
|
+
import {
|
|
90
|
+
Tile,
|
|
91
|
+
TileSpot,
|
|
92
|
+
TileContent,
|
|
93
|
+
TileTitle,
|
|
94
|
+
TileDescription,
|
|
95
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
79
96
|
import { Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
80
97
|
|
|
81
98
|
function MyComponent() {
|
|
82
99
|
return (
|
|
83
100
|
<Tile
|
|
84
101
|
lx={{ width: 's128' }}
|
|
85
|
-
title='Settings'
|
|
86
|
-
description='BTC'
|
|
87
|
-
leadingContent={<Spot appearance='icon' icon={Settings} />}
|
|
88
|
-
trailingContent={<Tag label='Active' appearance='success' size='sm' />}
|
|
89
102
|
onPress={() => console.log('Primary action')}
|
|
90
103
|
onLongPress={() => console.log('Secondary action')}
|
|
91
|
-
|
|
104
|
+
>
|
|
105
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
106
|
+
<TileContent>
|
|
107
|
+
<TileTitle>Settings</TileTitle>
|
|
108
|
+
<TileDescription>Manage preferences</TileDescription>
|
|
109
|
+
</TileContent>
|
|
110
|
+
</Tile>
|
|
92
111
|
);
|
|
93
112
|
}
|
|
94
113
|
```
|
|
95
114
|
|
|
115
|
+
## Advanced Patterns
|
|
116
|
+
|
|
117
|
+
### With Custom Content (Tags, etc.)
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import {
|
|
121
|
+
Tile,
|
|
122
|
+
TileSpot,
|
|
123
|
+
TileContent,
|
|
124
|
+
TileTitle,
|
|
125
|
+
TileDescription,
|
|
126
|
+
Tag,
|
|
127
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
128
|
+
import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
129
|
+
|
|
130
|
+
<Tile appearance='card'>
|
|
131
|
+
<TileSpot appearance='icon' icon={Bitcoin} />
|
|
132
|
+
<TileContent>
|
|
133
|
+
<TileTitle>Bitcoin</TileTitle>
|
|
134
|
+
<TileDescription>BTC</TileDescription>
|
|
135
|
+
</TileContent>
|
|
136
|
+
<Tag label='Active' appearance='success' />
|
|
137
|
+
</Tile>;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Disabled State
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<Tile disabled>
|
|
144
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
145
|
+
<TileContent>
|
|
146
|
+
<TileTitle>Settings</TileTitle>
|
|
147
|
+
<TileDescription>Unavailable</TileDescription>
|
|
148
|
+
</TileContent>
|
|
149
|
+
</Tile>
|
|
150
|
+
```
|
|
151
|
+
|
|
96
152
|
### With Coin Icon
|
|
97
153
|
|
|
98
154
|
```tsx
|
|
99
|
-
import {
|
|
155
|
+
import {
|
|
156
|
+
Tile,
|
|
157
|
+
TileSpot,
|
|
158
|
+
TileContent,
|
|
159
|
+
TileTitle,
|
|
160
|
+
TileDescription,
|
|
161
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
162
|
+
|
|
163
|
+
<Tile onPress={() => console.log('Clicked!')}>
|
|
164
|
+
<TileSpot appearance='coin' icon='btc' />
|
|
165
|
+
<TileContent>
|
|
166
|
+
<TileTitle>Bitcoin</TileTitle>
|
|
167
|
+
<TileDescription>BTC</TileDescription>
|
|
168
|
+
</TileContent>
|
|
169
|
+
</Tile>;
|
|
170
|
+
```
|
|
100
171
|
|
|
101
|
-
|
|
102
|
-
|
|
172
|
+
### Horizontal List
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
import { ScrollView } from 'react-native';
|
|
176
|
+
|
|
177
|
+
<ScrollView horizontal>
|
|
178
|
+
{items.map((item) => (
|
|
179
|
+
<Tile key={item.id} lx={{ width: 's128', flexShrink: 0 }}>
|
|
180
|
+
<TileSpot appearance='icon' icon={item.icon} />
|
|
181
|
+
<TileContent>
|
|
182
|
+
<TileTitle>{item.title}</TileTitle>
|
|
183
|
+
<TileDescription>{item.description}</TileDescription>
|
|
184
|
+
</TileContent>
|
|
185
|
+
</Tile>
|
|
186
|
+
))}
|
|
187
|
+
</ScrollView>;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### With Secondary Action (Long Press)
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
103
193
|
<Tile
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
194
|
+
onPress={() => console.log('Primary action')}
|
|
195
|
+
onLongPress={() => console.log('Secondary action - show menu')}
|
|
196
|
+
>
|
|
197
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
198
|
+
<TileContent>
|
|
199
|
+
<TileTitle>Settings</TileTitle>
|
|
200
|
+
<TileDescription>Long press for options</TileDescription>
|
|
201
|
+
</TileContent>
|
|
202
|
+
</Tile>
|
|
111
203
|
```
|
|
112
204
|
|
|
113
205
|
## Do's and Don'ts
|
|
206
|
+
|
|
114
207
|
<Box lx={{ flexDirection: 'column', gap: 's24' }}>
|
|
115
208
|
<CommonRulesDoAndDont />
|
|
116
209
|
</Box>
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
-
import {
|
|
3
|
-
Settings,
|
|
4
|
-
Plus,
|
|
5
|
-
User,
|
|
6
|
-
Wallet,
|
|
7
|
-
Cart,
|
|
8
|
-
Apps,
|
|
9
|
-
Chart1,
|
|
10
|
-
} from '../../Symbols';
|
|
11
|
-
import { Spot } from '../Spot/Spot';
|
|
2
|
+
import { Settings, Plus, User, Apps } from '../../Symbols';
|
|
12
3
|
import { Tag } from '../Tag/Tag';
|
|
13
|
-
import { Box } from '../Utility';
|
|
14
|
-
import {
|
|
4
|
+
import { Box, Text } from '../Utility';
|
|
5
|
+
import {
|
|
6
|
+
Tile,
|
|
7
|
+
TileSpot,
|
|
8
|
+
TileContent,
|
|
9
|
+
TileTitle,
|
|
10
|
+
TileDescription,
|
|
11
|
+
} from './Tile';
|
|
15
12
|
|
|
16
13
|
const meta: Meta<typeof Tile> = {
|
|
17
14
|
component: Tile,
|
|
@@ -25,144 +22,109 @@ const meta: Meta<typeof Tile> = {
|
|
|
25
22
|
},
|
|
26
23
|
},
|
|
27
24
|
},
|
|
28
|
-
argTypes: {
|
|
29
|
-
leadingContent: {
|
|
30
|
-
control: 'select',
|
|
31
|
-
options: ['None', 'Settings', 'Plus'],
|
|
32
|
-
mapping: {
|
|
33
|
-
None: undefined,
|
|
34
|
-
Settings: <Spot appearance='icon' icon={Settings} />,
|
|
35
|
-
Plus: <Spot appearance='icon' icon={Plus} />,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
trailingContent: {
|
|
39
|
-
control: 'select',
|
|
40
|
-
options: ['None', 'Tag', 'Text'],
|
|
41
|
-
mapping: {
|
|
42
|
-
None: undefined,
|
|
43
|
-
Tag: <Tag label='Tag' appearance='base' />,
|
|
44
|
-
Text: <span>Text</span>,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
25
|
};
|
|
49
26
|
|
|
50
27
|
export default meta;
|
|
51
28
|
type Story = StoryObj<typeof Tile>;
|
|
52
29
|
|
|
53
30
|
export const Base: Story = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
31
|
+
render: () => (
|
|
32
|
+
<Tile lx={{ maxWidth: 's112' }}>
|
|
33
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
34
|
+
<TileContent>
|
|
35
|
+
<TileTitle>Item with Spot and Description</TileTitle>
|
|
36
|
+
<TileDescription>Additional information</TileDescription>
|
|
37
|
+
</TileContent>
|
|
38
|
+
</Tile>
|
|
39
|
+
),
|
|
60
40
|
parameters: {
|
|
61
41
|
docs: {
|
|
62
42
|
source: {
|
|
63
43
|
code: `
|
|
64
|
-
<Tile
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/>
|
|
44
|
+
<Tile lx={{ maxWidth: 's112' }}>
|
|
45
|
+
<TileSpot appearance="icon" icon={Settings} />
|
|
46
|
+
<TileContent>
|
|
47
|
+
<TileTitle>Item with Spot and Description</TileTitle>
|
|
48
|
+
<TileDescription>Additional information</TileDescription>
|
|
49
|
+
</TileContent>
|
|
50
|
+
</Tile>
|
|
72
51
|
`,
|
|
73
52
|
},
|
|
74
53
|
},
|
|
75
54
|
},
|
|
76
55
|
};
|
|
77
56
|
|
|
78
|
-
export const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
57
|
+
export const VariantsShowcase: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Box lx={{ flexDirection: 'column', gap: 's16' }}>
|
|
60
|
+
<Tile lx={{ maxWidth: 's176' }}>
|
|
61
|
+
<TileSpot appearance='icon' icon={User} />
|
|
62
|
+
<TileContent>
|
|
63
|
+
<TileTitle>User</TileTitle>
|
|
64
|
+
<TileDescription>With description</TileDescription>
|
|
65
|
+
</TileContent>
|
|
66
|
+
</Tile>
|
|
67
|
+
<Tile lx={{ maxWidth: 's176' }}>
|
|
68
|
+
<TileSpot appearance='icon' icon={Plus} />
|
|
69
|
+
<TileContent>
|
|
70
|
+
<TileTitle>Without Description</TileTitle>
|
|
71
|
+
</TileContent>
|
|
72
|
+
</Tile>
|
|
73
|
+
<Tile lx={{ maxWidth: 's176' }}>
|
|
74
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
75
|
+
<TileContent>
|
|
76
|
+
<TileTitle>With Trailing Content</TileTitle>
|
|
77
|
+
<TileDescription>Additional information</TileDescription>
|
|
78
|
+
</TileContent>
|
|
79
|
+
<Tag label='Custom' appearance='base' />
|
|
80
|
+
</Tile>
|
|
81
|
+
<Tile lx={{ maxWidth: 's176' }}>
|
|
82
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
83
|
+
<TileContent>
|
|
84
|
+
<TileTitle>With Trailing Content</TileTitle>
|
|
85
|
+
<TileDescription>Additional information</TileDescription>
|
|
86
|
+
</TileContent>
|
|
87
|
+
<Text typography='body2SemiBold' lx={{ color: 'success' }}>
|
|
88
|
+
+7.87%
|
|
89
|
+
</Text>
|
|
90
|
+
</Tile>
|
|
91
|
+
</Box>
|
|
92
|
+
),
|
|
102
93
|
};
|
|
103
94
|
|
|
104
95
|
export const WithSecondaryAction: Story = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
render: () => (
|
|
97
|
+
<Tile
|
|
98
|
+
onLongPress={() => alert('Long press - secondary action triggered!')}
|
|
99
|
+
lx={{ maxWidth: 's176' }}
|
|
100
|
+
>
|
|
101
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
102
|
+
<TileContent>
|
|
103
|
+
<TileTitle>Long Press Me</TileTitle>
|
|
104
|
+
<TileDescription>Try long pressing this tile</TileDescription>
|
|
105
|
+
</TileContent>
|
|
106
|
+
</Tile>
|
|
107
|
+
),
|
|
112
108
|
parameters: {
|
|
113
109
|
docs: {
|
|
114
110
|
source: {
|
|
115
111
|
code: `
|
|
116
112
|
<Tile
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
onLongPress={() => alert('Long press - secondary action triggered!')}
|
|
114
|
+
lx={{ maxWidth: 's160' }}
|
|
115
|
+
>
|
|
116
|
+
<TileSpot appearance="icon" icon={Settings} />
|
|
117
|
+
<TileContent>
|
|
118
|
+
<TileTitle>Long Press Me</TileTitle>
|
|
119
|
+
<TileDescription>Try long pressing this tile</TileDescription>
|
|
120
|
+
</TileContent>
|
|
121
|
+
</Tile>
|
|
123
122
|
`,
|
|
124
123
|
},
|
|
125
124
|
},
|
|
126
125
|
},
|
|
127
126
|
};
|
|
128
127
|
|
|
129
|
-
export const LeadingContentVariantsShowcase: Story = {
|
|
130
|
-
render: () => (
|
|
131
|
-
<Box lx={{ flexDirection: 'row' }}>
|
|
132
|
-
<Tile
|
|
133
|
-
title='User'
|
|
134
|
-
description='With description'
|
|
135
|
-
leadingContent={<Spot appearance='icon' icon={User} />}
|
|
136
|
-
lx={{ maxWidth: 's128' }}
|
|
137
|
-
/>
|
|
138
|
-
<Tile
|
|
139
|
-
title='Wallet'
|
|
140
|
-
description='With description'
|
|
141
|
-
leadingContent={<Spot appearance='icon' icon={Wallet} />}
|
|
142
|
-
lx={{ maxWidth: 's128' }}
|
|
143
|
-
/>
|
|
144
|
-
<Tile
|
|
145
|
-
title='Cart'
|
|
146
|
-
description='With description'
|
|
147
|
-
leadingContent={<Spot appearance='icon' icon={Cart} />}
|
|
148
|
-
lx={{ maxWidth: 's128' }}
|
|
149
|
-
/>
|
|
150
|
-
<Tile
|
|
151
|
-
title='Apps'
|
|
152
|
-
description='With description'
|
|
153
|
-
leadingContent={<Spot appearance='icon' icon={Apps} />}
|
|
154
|
-
lx={{ maxWidth: 's128' }}
|
|
155
|
-
/>
|
|
156
|
-
<Tile
|
|
157
|
-
title='Chart'
|
|
158
|
-
description='With description'
|
|
159
|
-
leadingContent={<Spot appearance='icon' icon={Chart1} />}
|
|
160
|
-
lx={{ maxWidth: 's128' }}
|
|
161
|
-
/>
|
|
162
|
-
</Box>
|
|
163
|
-
),
|
|
164
|
-
};
|
|
165
|
-
|
|
166
128
|
export const HorizontalList: Story = {
|
|
167
129
|
render: () => (
|
|
168
130
|
<Box lx={{ flexDirection: 'column', gap: 's16' }}>
|
|
@@ -174,13 +136,14 @@ export const HorizontalList: Story = {
|
|
|
174
136
|
backgroundColor: 'base',
|
|
175
137
|
}}
|
|
176
138
|
>
|
|
177
|
-
{Array.from({ length:
|
|
178
|
-
<Tile
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
139
|
+
{Array.from({ length: 3 }).map((_, i) => (
|
|
140
|
+
<Tile key={`list-1-${i}`}>
|
|
141
|
+
<TileSpot appearance='icon' icon={Apps} />
|
|
142
|
+
<TileContent>
|
|
143
|
+
<TileTitle>Item {i + 1}</TileTitle>
|
|
144
|
+
<TileDescription>Description {i + 1}</TileDescription>
|
|
145
|
+
</TileContent>
|
|
146
|
+
</Tile>
|
|
184
147
|
))}
|
|
185
148
|
</Box>
|
|
186
149
|
<Box
|
|
@@ -189,16 +152,19 @@ export const HorizontalList: Story = {
|
|
|
189
152
|
width: 's480',
|
|
190
153
|
position: 'relative',
|
|
191
154
|
backgroundColor: 'base',
|
|
155
|
+
overflow: 'scroll',
|
|
192
156
|
}}
|
|
193
157
|
>
|
|
194
|
-
{Array.from({ length:
|
|
195
|
-
<Tile
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
158
|
+
{Array.from({ length: 5 }).map((_, i) => (
|
|
159
|
+
<Tile key={`list-2-${i}`} lx={{ width: 's128', flexShrink: 0 }}>
|
|
160
|
+
<TileSpot appearance='icon' icon={Apps} />
|
|
161
|
+
<TileContent>
|
|
162
|
+
<TileTitle>Item {i + 1}</TileTitle>
|
|
163
|
+
<TileDescription>
|
|
164
|
+
Long description that should truncate appropriately
|
|
165
|
+
</TileDescription>
|
|
166
|
+
</TileContent>
|
|
167
|
+
</Tile>
|
|
202
168
|
))}
|
|
203
169
|
</Box>
|
|
204
170
|
</Box>
|
|
@@ -209,19 +175,74 @@ export const ResponsiveLayout: Story = {
|
|
|
209
175
|
render: () => (
|
|
210
176
|
<Box lx={{ width: 'full', flexDirection: 'column', gap: 's16' }}>
|
|
211
177
|
<Box>
|
|
212
|
-
<Tile
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
178
|
+
<Tile>
|
|
179
|
+
<TileSpot appearance='icon' icon={Apps} />
|
|
180
|
+
<TileContent>
|
|
181
|
+
<TileTitle>Item fill width</TileTitle>
|
|
182
|
+
<TileDescription>Description fill width</TileDescription>
|
|
183
|
+
</TileContent>
|
|
184
|
+
</Tile>
|
|
217
185
|
</Box>
|
|
218
186
|
<Box lx={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
219
|
-
<Tile
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
187
|
+
<Tile lx={{ width: 's224' }}>
|
|
188
|
+
<TileSpot appearance='icon' icon={Plus} />
|
|
189
|
+
<TileContent>
|
|
190
|
+
<TileTitle>Long Item with fixed width</TileTitle>
|
|
191
|
+
<TileDescription>
|
|
192
|
+
lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam,
|
|
193
|
+
quos.
|
|
194
|
+
</TileDescription>
|
|
195
|
+
</TileContent>
|
|
196
|
+
</Tile>
|
|
197
|
+
</Box>
|
|
198
|
+
</Box>
|
|
199
|
+
),
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const AppearanceShowcase: Story = {
|
|
203
|
+
render: () => (
|
|
204
|
+
<Box lx={{ flexDirection: 'column', gap: 's24' }}>
|
|
205
|
+
<Box>
|
|
206
|
+
<Box lx={{ marginBottom: 's8' }}>
|
|
207
|
+
<Text typography='body2SemiBold'>No Background</Text>
|
|
208
|
+
</Box>
|
|
209
|
+
<Box lx={{ flexDirection: 'row', gap: 's16' }}>
|
|
210
|
+
<Tile appearance='no-background' lx={{ width: 's112' }}>
|
|
211
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
212
|
+
<TileContent>
|
|
213
|
+
<TileTitle>Press me</TileTitle>
|
|
214
|
+
<TileDescription>Press state</TileDescription>
|
|
215
|
+
</TileContent>
|
|
216
|
+
</Tile>
|
|
217
|
+
<Tile appearance='no-background' disabled lx={{ width: 's112' }}>
|
|
218
|
+
<TileSpot appearance='icon' icon={Settings} />
|
|
219
|
+
<TileContent>
|
|
220
|
+
<TileTitle>Disabled</TileTitle>
|
|
221
|
+
<TileDescription>Disabled state</TileDescription>
|
|
222
|
+
</TileContent>
|
|
223
|
+
</Tile>
|
|
224
|
+
</Box>
|
|
225
|
+
</Box>
|
|
226
|
+
<Box>
|
|
227
|
+
<Box lx={{ marginBottom: 's8' }}>
|
|
228
|
+
<Text typography='body2SemiBold'>Card</Text>
|
|
229
|
+
</Box>
|
|
230
|
+
<Box lx={{ flexDirection: 'row', gap: 's16' }}>
|
|
231
|
+
<Tile appearance='card' lx={{ width: 's112' }}>
|
|
232
|
+
<TileSpot appearance='icon' icon={User} />
|
|
233
|
+
<TileContent>
|
|
234
|
+
<TileTitle>Press me</TileTitle>
|
|
235
|
+
<TileDescription>Press state</TileDescription>
|
|
236
|
+
</TileContent>
|
|
237
|
+
</Tile>
|
|
238
|
+
<Tile appearance='card' disabled lx={{ width: 's112' }}>
|
|
239
|
+
<TileSpot appearance='icon' icon={User} />
|
|
240
|
+
<TileContent>
|
|
241
|
+
<TileTitle>Disabled</TileTitle>
|
|
242
|
+
<TileDescription>Disabled state</TileDescription>
|
|
243
|
+
</TileContent>
|
|
244
|
+
</Tile>
|
|
245
|
+
</Box>
|
|
225
246
|
</Box>
|
|
226
247
|
</Box>
|
|
227
248
|
),
|