Skip to content

Commit 14609b9

Browse files
committed
docs(list): updated documentations
1 parent ba49a20 commit 14609b9

File tree

7 files changed

+130
-10
lines changed

7 files changed

+130
-10
lines changed

.vscode/tasks.json

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
{
22
// See https://go.microsoft.com/fwlink/?LinkId=733558
33
// for the documentation about the tasks.json format
4-
"version": "0.1.0",
4+
"version": "2.0.0",
55
"tasks": [
66
{
7+
"label": "prettier eslint",
8+
"type": "shell",
79
"command": "node",
8-
"isShellCommand": true,
9-
"showOutput": "always",
10-
"isBuildCommand": true,
11-
"taskName": "prettier eslint",
12-
"args": ["./node_modules/.bin/prettier-eslint", "--write", "--prettier-last", "${file}"]
10+
"args": [
11+
"./node_modules/.bin/prettier-eslint",
12+
"--write",
13+
"--prettier-last",
14+
"${file}"
15+
],
16+
"problemMatcher": [],
17+
"group": {
18+
"_id": "build",
19+
"isDefault": false
20+
}
1321
}
1422
]
1523
}

.vscode/tasks.json.old

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "0.1.0",
5+
"tasks": [
6+
{
7+
"command": "node",
8+
"isShellCommand": true,
9+
"showOutput": "always",
10+
"isBuildCommand": true,
11+
"taskName": "prettier eslint",
12+
"args": ["./node_modules/.bin/prettier-eslint", "--write", "--prettier-last", "${file}"]
13+
}
14+
]
15+
}

packages/lumx-react/src/stories/generated/List/Demos.stories.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export default { title: 'LumX components/list/List Demos' };
55

66
export { App as Big } from './big';
77
export { App as Huge } from './huge';
8+
export { App as Paddings } from './paddings';
89
export { App as Regular } from './regular';
910
export { App as Tiny } from './tiny';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../site-demo/content/product/components/list/react/paddings.tsx

packages/site-demo/content/product/components/list/index.mdx

+36-4
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,54 @@
22

33
**Lists group items vertically.**
44

5-
## Tiny
5+
## Sizes
6+
7+
Lists come in 4 sizes: `tiny`, `regular`, `big` and `huge`.
8+
9+
`tiny`, `regular` and `big` list items have specific **minimum heights** and a `8px` vertical padding.
10+
Favor those 3 sizes for lists with list items with consistent heights.
11+
12+
`huge` list items have a `16px` vertical padding.
13+
Use this size for any other cases.
14+
15+
16+
### Tiny
17+
Tiny list item have a minimum height of `36px`.
18+
Use this size for dense lists with single ine items like menus made of [dropdown](../dropdown).
619

720
<DemoBlock demo="tiny" />
821

9-
## Regular
22+
### Regular
23+
Regular list item have a minimum height of `52px`.
24+
Use this size for single line list items.
1025

1126
<DemoBlock demo="regular" />
1227

13-
## Big
28+
### Big
29+
Big list item have a minimum height of `72px`.
30+
Use this size for two lines list items.
1431

1532
<DemoBlock demo="big" />
1633

17-
## Huge
34+
### Huge
35+
Huge list item have a vertical padding of `16px`.
36+
Use this size for list items that have more than two lines of content.
1837

1938
<DemoBlock demo="huge" />
2039

40+
## Item padding
41+
Horizontal padding has 2 sizes: `big` and `huge`.
42+
By default there is no horizontal padding.
43+
44+
<DemoBlock demo="paddings" />
45+
46+
## Clickable
47+
List items can be clickable.
48+
Clickable list items can then be disabled, highlighted or selected.
49+
Use clickable list items when users need to select one or more options in a list.
50+
51+
<DemoBlock demo="clickable" />
52+
2153
### List properties
2254

2355
<PropTable component="List" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { List, ListItem, ListSubheader, Size } from '@lumx/react';
2+
import React from 'react';
3+
4+
export const App = () => (
5+
<List>
6+
<ListItem linkProps={{ href: '#' }}>Clickable list item</ListItem>
7+
<ListItem linkProps={{ href: '#' }} isDisabled>
8+
Disabled clickable list item
9+
</ListItem>
10+
<ListItem linkProps={{ href: '#' }} isHighlighted>
11+
Highlighted clickable list item
12+
</ListItem>
13+
<ListItem linkProps={{ href: '#' }} isSelected>
14+
Selected clickable list item
15+
</ListItem>
16+
</List>
17+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { List, ListItem, ListSubheader, Size } from '@lumx/react';
2+
import React from 'react';
3+
4+
export const App = () => (
5+
<div>
6+
<List>
7+
<ListSubheader>Default</ListSubheader>
8+
9+
<ListItem size={Size.big} className="lumx-color-background-dark-L6">
10+
<div>
11+
<span>Two-line item</span>
12+
</div>
13+
14+
<div>
15+
<span className="lumx-color-font-dark-L2">Secondary text</span>
16+
</div>
17+
</ListItem>
18+
</List>
19+
<List itemPadding={Size.big}>
20+
<ListSubheader>Big padding</ListSubheader>
21+
22+
<ListItem size={Size.big} className="lumx-color-background-dark-L6">
23+
<div>
24+
<span>Two-line item</span>
25+
</div>
26+
27+
<div>
28+
<span className="lumx-color-font-dark-L2">Secondary text</span>
29+
</div>
30+
</ListItem>
31+
</List>
32+
<List itemPadding={Size.huge}>
33+
<ListSubheader>Huge padding</ListSubheader>
34+
35+
<ListItem size={Size.big} className="lumx-color-background-dark-L6">
36+
<div>
37+
<span>Two-line item</span>
38+
</div>
39+
40+
<div>
41+
<span className="lumx-color-font-dark-L2">Secondary text</span>
42+
</div>
43+
</ListItem>
44+
</List>
45+
</div>
46+
);

0 commit comments

Comments
 (0)