aidos-ui 3.0.31 → 4.0.1
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/.claude/settings.local.json +14 -1
- package/CLAUDE.md +72 -0
- package/README.md +43 -29
- package/dist/Badge.d.ts +2 -2
- package/dist/Badge.js.map +1 -1
- package/dist/BaseButton.d.ts +2 -2
- package/dist/BaseButton.js +2 -2
- package/dist/BaseButton.js.map +1 -1
- package/dist/BaseInput.d.ts +2 -2
- package/dist/BaseInput.js.map +1 -1
- package/dist/BaseLink.d.ts +2 -2
- package/dist/BaseLink.js +2 -2
- package/dist/BaseLink.js.map +1 -1
- package/dist/BaseListItem.d.ts +3 -3
- package/dist/BaseListItem.js.map +1 -1
- package/dist/BaseView.d.ts +2 -2
- package/dist/BaseView.js.map +1 -1
- package/dist/Calendar.d.ts +4 -4
- package/dist/DarkMode.js.map +1 -1
- package/dist/DateInput.d.ts +2 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatetimeInput.d.ts +2 -2
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.d.ts +3 -3
- package/dist/Dropdown.js.map +1 -1
- package/dist/Icon.d.ts +3 -3
- package/dist/Icon.js +2 -21
- package/dist/Icon.js.map +1 -1
- package/dist/IconLink.js +2 -1
- package/dist/IconLink.js.map +1 -1
- package/dist/Interactable.d.ts +4 -4
- package/dist/Interactable.js +2 -2
- package/dist/Interactable.js.map +1 -1
- package/dist/ListButtonItem.js +2 -2
- package/dist/ListButtonItem.js.map +1 -1
- package/dist/ListLinkItem.js +2 -2
- package/dist/ListLinkItem.js.map +1 -1
- package/dist/MenuIcon.js.map +1 -1
- package/dist/NextJSRouter.js.map +1 -1
- package/dist/NextJSRouterState.js.map +1 -1
- package/dist/OnVisible.d.ts +1 -1
- package/dist/OnVisible.js.map +1 -1
- package/dist/Popover.d.ts +7 -7
- package/dist/Popover.js +2 -2
- package/dist/Popover.js.map +1 -1
- package/dist/ProgressBar.d.ts +2 -2
- package/dist/ProgressBar.js.map +1 -1
- package/dist/Providers.d.ts +2 -2
- package/dist/Providers.js +2 -2
- package/dist/Providers.js.map +1 -1
- package/dist/RangeInput.d.ts +3 -3
- package/dist/RangeInput.js +2 -2
- package/dist/RangeInput.js.map +1 -1
- package/dist/RootView.js.map +1 -1
- package/dist/Select.d.ts +2 -3
- package/dist/Select.js.map +1 -1
- package/dist/StaticCheckbox.js.map +1 -1
- package/dist/Storage.d.ts +2 -1
- package/dist/Storage.js.map +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/Sublist.d.ts +2 -2
- package/dist/Tabs.d.ts +4 -4
- package/dist/Tabs.js +2 -4
- package/dist/Tabs.js.map +1 -1
- package/dist/Text.d.ts +2 -2
- package/dist/Text.js.map +1 -1
- package/dist/TextArea.d.ts +2 -2
- package/dist/TextArea.js.map +1 -1
- package/dist/TextInput.d.ts +4 -3
- package/dist/TextInput.js +14 -5
- package/dist/TextInput.js.map +1 -1
- package/dist/TextPairing.d.ts +2 -2
- package/dist/TextPairing.js.map +1 -1
- package/dist/Tooltip.d.ts +4 -4
- package/dist/Tooltip.js.map +1 -1
- package/dist/aria.js.map +1 -1
- package/dist/hash.js.map +1 -1
- package/dist/jss.d.ts +21 -21
- package/dist/jss.js +6 -6
- package/dist/jss.js.map +1 -1
- package/dist/numberToBase.js.map +1 -1
- package/dist/stateMachineContextFactory.js.map +1 -1
- package/dist/useCookie.js.map +1 -1
- package/dist/useKeyboard.js.map +1 -1
- package/dist/useNavigation.js.map +1 -1
- package/dist/useRefEffect.js.map +1 -1
- package/next-env.d.ts +2 -1
- package/next.config.js +2 -1
- package/package.json +27 -20
- package/src/Badge.tsx +2 -2
- package/src/BaseButton.tsx +4 -4
- package/src/BaseInput.tsx +2 -2
- package/src/BaseLink.tsx +4 -4
- package/src/BaseListItem.tsx +3 -3
- package/src/BaseView.tsx +3 -3
- package/src/Calendar.tsx +4 -4
- package/src/DateInput.tsx +2 -2
- package/src/DatetimeInput.tsx +2 -2
- package/src/Dialog.tsx +3 -3
- package/src/Dropdown.tsx +4 -4
- package/src/Icon.tsx +4 -30
- package/src/IconLink.tsx +2 -1
- package/src/Interactable.tsx +4 -4
- package/src/ListButtonItem.tsx +2 -2
- package/src/ListLinkItem.tsx +2 -2
- package/src/MenuIcon.tsx +2 -2
- package/src/NextJSRouter.tsx +2 -2
- package/src/Popover.tsx +9 -9
- package/src/ProgressBar.tsx +3 -3
- package/src/Providers.tsx +4 -4
- package/src/RangeInput.tsx +5 -5
- package/src/Select.tsx +2 -2
- package/src/StaticCheckbox.tsx +2 -2
- package/src/Storage.tsx +1 -1
- package/src/Sublist.tsx +2 -2
- package/src/Tabs.tsx +4 -6
- package/src/Text.tsx +2 -2
- package/src/TextArea.tsx +2 -2
- package/src/TextInput.tsx +20 -8
- package/src/TextPairing.tsx +2 -2
- package/src/Tooltip.tsx +5 -5
- package/src/docs/mdx.tsx +40 -0
- package/src/docs/searchIndex.ts +1 -1
- package/src/jss.tsx +18 -18
- package/src/pages/Badge.mdx +136 -14
- package/src/pages/Button.mdx +121 -63
- package/src/pages/Calendar.mdx +196 -2
- package/src/pages/Card.mdx +123 -47
- package/src/pages/Checkbox.mdx +103 -28
- package/src/pages/Dialog.mdx +172 -7
- package/src/pages/FlexLayout.mdx +185 -51
- package/src/pages/Hashing.mdx +199 -8
- package/src/pages/Icon.mdx +150 -42
- package/src/pages/IconButton.mdx +127 -116
- package/src/pages/Link.mdx +118 -47
- package/src/pages/List.mdx +167 -283
- package/src/pages/ListHeader.mdx +157 -27
- package/src/pages/Popover.mdx +177 -55
- package/src/pages/ProgressBar.mdx +186 -6
- package/src/pages/ProgressCircle.mdx +196 -13
- package/src/pages/RangeInput.mdx +189 -61
- package/src/pages/Tabs.mdx +202 -346
- package/src/pages/Text.mdx +102 -81
- package/src/pages/TextInput.mdx +169 -44
- package/src/pages/TextPairing.mdx +164 -115
- package/src/pages/TimeInput.mdx +142 -37
- package/src/pages/Tooltip.mdx +99 -12
- package/src/pages/_app.tsx +14 -4
- package/src/pages/css-in-js.mdx +196 -83
- package/src/pages/navigation.mdx +122 -20
- package/src/pages/useCookie.mdx +168 -7
- package/src/pages/useKeyboard.mdx +242 -5
- package/src/pages/useNavigation.mdx +244 -16
- package/src/pages/usePromise.mdx +271 -6
- package/src/pages/useRefEffect.mdx +230 -28
- package/tsconfig.json +13 -4
package/src/pages/List.mdx
CHANGED
|
@@ -2,202 +2,106 @@ import { List } from "../List";
|
|
|
2
2
|
import { ListItem } from "../ListItem";
|
|
3
3
|
import { ListButtonItem } from "../ListButtonItem";
|
|
4
4
|
import { ListLinkItem } from "../ListLinkItem";
|
|
5
|
+
import { ListDivider } from "../ListDivider";
|
|
5
6
|
import { Icon } from "../Icon";
|
|
6
7
|
import { Sublist } from "../Sublist";
|
|
8
|
+
import { Row } from "../Row";
|
|
7
9
|
|
|
8
10
|
# List
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
A container for displaying items in a vertical list. Lists support multiple item types, keyboard navigation, and can be styled with different visual treatments.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Props
|
|
17
|
+
|
|
18
|
+
### List
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Required | Default | Description |
|
|
21
|
+
|------|------|----------|---------|-------------|
|
|
22
|
+
| `ariaLabel` | `string` | Yes | - | Accessible label for the list |
|
|
23
|
+
| `bare` | `boolean` | No | `false` | Minimal styling without background/borders |
|
|
24
|
+
| `carded` | `boolean` | No | `true` | Rounded corners with full border |
|
|
25
|
+
| `navigation` | `boolean` | No | `true` | Enable arrow key navigation |
|
|
26
|
+
| `autofocus` | `boolean` | No | `false` | Focus first item on mount |
|
|
27
|
+
|
|
28
|
+
### List item components
|
|
29
|
+
|
|
30
|
+
- **`ListItem`** - Static, non-interactive item
|
|
31
|
+
- **`ListButtonItem`** - Clickable button item
|
|
32
|
+
- **`ListLinkItem`** - Navigation link item
|
|
33
|
+
- **`ListDivider`** - Visual separator
|
|
34
|
+
- **`ListHeaderItem`** - Section header
|
|
35
|
+
- **`Sublist`** - Collapsible group of items
|
|
13
36
|
|
|
14
|
-
|
|
37
|
+
All item components accept `TextPairing` props (`headline`, `body`, `addOn`, etc.).
|
|
15
38
|
|
|
16
|
-
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Basic list
|
|
42
|
+
|
|
43
|
+
The default list has a bordered card appearance with rounded corners.
|
|
44
|
+
|
|
45
|
+
<List ariaLabel="Settings">
|
|
17
46
|
<ListItem
|
|
18
|
-
headline="
|
|
19
|
-
body="
|
|
47
|
+
headline="Notifications"
|
|
48
|
+
body="Manage your notification preferences"
|
|
20
49
|
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
21
|
-
addOnPosition="start"
|
|
22
|
-
/>
|
|
23
|
-
<ListButtonItem
|
|
24
|
-
color="positive"
|
|
25
|
-
headline="Positive button"
|
|
26
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
27
|
-
addOnPosition="start"
|
|
28
|
-
onClick={() => {}}
|
|
29
50
|
/>
|
|
30
51
|
<ListButtonItem
|
|
31
52
|
color="secondary"
|
|
32
|
-
headline="
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onClick={() => {}}
|
|
36
|
-
/>
|
|
37
|
-
<ListButtonItem
|
|
38
|
-
color="negative"
|
|
39
|
-
headline="Negative button"
|
|
40
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
41
|
-
addOnPosition="start"
|
|
53
|
+
headline="Account"
|
|
54
|
+
body="Update your profile information"
|
|
55
|
+
addOn={<Icon color="primary" icon="fa-user" size="medium" />}
|
|
42
56
|
onClick={() => {}}
|
|
43
57
|
/>
|
|
44
58
|
<ListLinkItem
|
|
45
59
|
href="/"
|
|
46
60
|
color="secondary"
|
|
47
|
-
headline="
|
|
48
|
-
|
|
49
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
50
|
-
addOnPosition="start"
|
|
51
|
-
/>
|
|
52
|
-
<ListLinkItem
|
|
53
|
-
href="/"
|
|
54
|
-
color="secondary"
|
|
55
|
-
headline="Link"
|
|
56
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
57
|
-
addOnPosition="start"
|
|
61
|
+
headline="Help Center"
|
|
62
|
+
addOn={<Icon color="primary" icon="fa-question-circle" size="medium" />}
|
|
58
63
|
withDivider={false}
|
|
59
64
|
/>
|
|
60
65
|
</List>
|
|
61
66
|
|
|
62
67
|
```js
|
|
63
|
-
<List ariaLabel="
|
|
68
|
+
<List ariaLabel="Settings">
|
|
64
69
|
<ListItem
|
|
65
|
-
headline="
|
|
66
|
-
body="
|
|
70
|
+
headline="Notifications"
|
|
71
|
+
body="Manage your notification preferences"
|
|
67
72
|
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
68
|
-
addOnPosition="start"
|
|
69
|
-
/>
|
|
70
|
-
<ListButtonItem
|
|
71
|
-
color="positive"
|
|
72
|
-
headline="Positive button"
|
|
73
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
74
|
-
addOnPosition="start"
|
|
75
|
-
onClick={() => {}}
|
|
76
73
|
/>
|
|
77
74
|
<ListButtonItem
|
|
78
75
|
color="secondary"
|
|
79
|
-
headline="
|
|
80
|
-
addOn={<Icon color="primary" icon="fa-bicycle" size="medium" />}
|
|
81
|
-
addOnPosition="start"
|
|
82
|
-
onClick={() => {}}
|
|
83
|
-
/>
|
|
84
|
-
<ListButtonItem
|
|
85
|
-
color="negative"
|
|
86
|
-
headline="Negative button"
|
|
87
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
88
|
-
addOnPosition="start"
|
|
76
|
+
headline="Account"
|
|
89
77
|
onClick={() => {}}
|
|
90
78
|
/>
|
|
91
79
|
<ListLinkItem
|
|
92
|
-
href="/"
|
|
93
|
-
color="secondary"
|
|
94
|
-
headline="Selected link"
|
|
95
|
-
selected
|
|
96
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
97
|
-
addOnPosition="start"
|
|
98
|
-
/>
|
|
99
|
-
<ListLinkItem
|
|
100
|
-
href="/"
|
|
80
|
+
href="/help"
|
|
101
81
|
color="secondary"
|
|
102
|
-
headline="
|
|
103
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
104
|
-
addOnPosition="start"
|
|
82
|
+
headline="Help Center"
|
|
105
83
|
withDivider={false}
|
|
106
84
|
/>
|
|
107
85
|
</List>
|
|
108
86
|
```
|
|
109
87
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<ListButtonItem
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
121
|
-
addOnPosition="start"
|
|
122
|
-
onClick={() => {}}
|
|
123
|
-
/>
|
|
124
|
-
<ListButtonItem
|
|
125
|
-
color="secondary"
|
|
126
|
-
headline="Secondary button"
|
|
127
|
-
addOn={<Icon color="primary" icon="fa-bicycle" size="medium" />}
|
|
128
|
-
addOnPosition="start"
|
|
129
|
-
onClick={() => {}}
|
|
130
|
-
/>
|
|
131
|
-
<ListButtonItem
|
|
132
|
-
color="negative"
|
|
133
|
-
headline="Negative button"
|
|
134
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
135
|
-
addOnPosition="start"
|
|
136
|
-
onClick={() => {}}
|
|
137
|
-
/>
|
|
138
|
-
<ListLinkItem
|
|
139
|
-
href="/"
|
|
140
|
-
color="secondary"
|
|
141
|
-
headline="Selected link"
|
|
142
|
-
selected
|
|
143
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
144
|
-
addOnPosition="start"
|
|
145
|
-
/>
|
|
146
|
-
<ListLinkItem
|
|
147
|
-
href="/"
|
|
148
|
-
color="secondary"
|
|
149
|
-
headline="Link"
|
|
150
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
151
|
-
addOnPosition="start"
|
|
152
|
-
withDivider={false}
|
|
153
|
-
/>
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Edge-to-edge list
|
|
91
|
+
|
|
92
|
+
Set `carded={false}` to remove rounded corners, useful for full-width layouts.
|
|
93
|
+
|
|
94
|
+
<List carded={false} ariaLabel="Menu">
|
|
95
|
+
<ListButtonItem color="secondary" headline="Profile" onClick={() => {}} />
|
|
96
|
+
<ListButtonItem color="secondary" headline="Settings" onClick={() => {}} />
|
|
97
|
+
<ListButtonItem color="secondary" headline="Logout" onClick={() => {}} withDivider={false} />
|
|
154
98
|
</List>
|
|
155
99
|
|
|
156
100
|
```js
|
|
157
|
-
<List carded={false} ariaLabel="
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
162
|
-
addOnPosition="start"
|
|
163
|
-
/>
|
|
164
|
-
<ListButtonItem
|
|
165
|
-
color="positive"
|
|
166
|
-
headline="Positive button"
|
|
167
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
168
|
-
addOnPosition="start"
|
|
169
|
-
onClick={() => {}}
|
|
170
|
-
/>
|
|
171
|
-
<ListButtonItem
|
|
172
|
-
color="secondary"
|
|
173
|
-
headline="Secondary button"
|
|
174
|
-
addOn={<Icon color="primary" icon="fa-bicycle" size="medium" />}
|
|
175
|
-
addOnPosition="start"
|
|
176
|
-
onClick={() => {}}
|
|
177
|
-
/>
|
|
178
|
-
<ListButtonItem
|
|
179
|
-
color="negative"
|
|
180
|
-
headline="Negative button"
|
|
181
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
182
|
-
addOnPosition="start"
|
|
183
|
-
onClick={() => {}}
|
|
184
|
-
/>
|
|
185
|
-
<ListLinkItem
|
|
186
|
-
href="/"
|
|
187
|
-
color="secondary"
|
|
188
|
-
headline="Selected link"
|
|
189
|
-
selected
|
|
190
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
191
|
-
addOnPosition="start"
|
|
192
|
-
/>
|
|
193
|
-
<ListLinkItem
|
|
194
|
-
href="/"
|
|
195
|
-
color="secondary"
|
|
196
|
-
headline="Link"
|
|
197
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
198
|
-
addOnPosition="start"
|
|
199
|
-
withDivider={false}
|
|
200
|
-
/>
|
|
101
|
+
<List carded={false} ariaLabel="Menu">
|
|
102
|
+
<ListButtonItem color="secondary" headline="Profile" onClick={() => {}} />
|
|
103
|
+
<ListButtonItem color="secondary" headline="Settings" onClick={() => {}} />
|
|
104
|
+
<ListButtonItem color="secondary" headline="Logout" onClick={() => {}} withDivider={false} />
|
|
201
105
|
</List>
|
|
202
106
|
```
|
|
203
107
|
|
|
@@ -205,95 +109,29 @@ The default list style has round borders and high contrast background. It can op
|
|
|
205
109
|
|
|
206
110
|
## Bare list
|
|
207
111
|
|
|
208
|
-
The
|
|
112
|
+
The `bare` variant removes background and borders for a minimal appearance.
|
|
209
113
|
|
|
210
|
-
<List bare ariaLabel="
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
215
|
-
addOnPosition="start"
|
|
216
|
-
/>
|
|
217
|
-
<ListButtonItem
|
|
218
|
-
color="positive"
|
|
219
|
-
headline="Positive button"
|
|
220
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
221
|
-
addOnPosition="start"
|
|
222
|
-
onClick={() => {}}
|
|
223
|
-
/>
|
|
224
|
-
<ListButtonItem
|
|
225
|
-
color="secondary"
|
|
226
|
-
headline="Secondary button"
|
|
227
|
-
addOn={<Icon color="primary" icon="fa-bicycle" size="medium" />}
|
|
228
|
-
addOnPosition="start"
|
|
229
|
-
onClick={() => {}}
|
|
230
|
-
/>
|
|
231
|
-
<ListButtonItem
|
|
232
|
-
color="negative"
|
|
233
|
-
headline="Negative button"
|
|
234
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
235
|
-
addOnPosition="start"
|
|
236
|
-
onClick={() => {}}
|
|
237
|
-
/>
|
|
238
|
-
<ListLinkItem
|
|
239
|
-
href="/"
|
|
240
|
-
color="secondary"
|
|
241
|
-
headline="Selected link"
|
|
242
|
-
selected
|
|
243
|
-
addOn={<Icon color="highlight" icon="fa-renren" size="medium" />}
|
|
244
|
-
addOnPosition="start"
|
|
245
|
-
/>
|
|
246
|
-
<ListLinkItem
|
|
247
|
-
href="/"
|
|
248
|
-
headline="Link"
|
|
249
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
250
|
-
addOnPosition="start"
|
|
251
|
-
withDivider={false}
|
|
252
|
-
/>
|
|
114
|
+
<List bare ariaLabel="Navigation">
|
|
115
|
+
<ListButtonItem bare color="secondary" headline="Home" addOn={<Icon color="primary" icon="fa-home" size="medium" />} onClick={() => {}} />
|
|
116
|
+
<ListButtonItem bare color="secondary" headline="Projects" addOn={<Icon color="primary" icon="fa-folder" size="medium" />} onClick={() => {}} />
|
|
117
|
+
<ListLinkItem bare href="/" color="secondary" headline="Settings" selected addOn={<Icon color="highlight" icon="fa-cog" size="medium" />} withDivider={false} />
|
|
253
118
|
</List>
|
|
254
119
|
|
|
255
120
|
```js
|
|
256
|
-
<List bare ariaLabel="
|
|
257
|
-
<ListItem
|
|
258
|
-
headline="Headline"
|
|
259
|
-
body="Body"
|
|
260
|
-
addOn={<Icon color="primary" icon="fa-bell" size="medium" />}
|
|
261
|
-
addOnPosition="start"
|
|
262
|
-
/>
|
|
263
|
-
<ListButtonItem
|
|
264
|
-
color="positive"
|
|
265
|
-
headline="Positive button"
|
|
266
|
-
addOn={<Icon color="highlight" icon="fa-plus" size="medium" />}
|
|
267
|
-
addOnPosition="start"
|
|
268
|
-
onClick={() => {}}
|
|
269
|
-
/>
|
|
121
|
+
<List bare ariaLabel="Navigation">
|
|
270
122
|
<ListButtonItem
|
|
123
|
+
bare
|
|
271
124
|
color="secondary"
|
|
272
|
-
headline="
|
|
273
|
-
addOn={<Icon color="primary" icon="fa-
|
|
274
|
-
addOnPosition="start"
|
|
275
|
-
onClick={() => {}}
|
|
276
|
-
/>
|
|
277
|
-
<ListButtonItem
|
|
278
|
-
color="negative"
|
|
279
|
-
headline="Negative button"
|
|
280
|
-
addOn={<Icon color="negative" icon="fa-ban" size="medium" />}
|
|
281
|
-
addOnPosition="start"
|
|
125
|
+
headline="Home"
|
|
126
|
+
addOn={<Icon color="primary" icon="fa-home" size="medium" />}
|
|
282
127
|
onClick={() => {}}
|
|
283
128
|
/>
|
|
284
129
|
<ListLinkItem
|
|
285
|
-
|
|
130
|
+
bare
|
|
131
|
+
href="/settings"
|
|
286
132
|
color="secondary"
|
|
287
|
-
headline="
|
|
133
|
+
headline="Settings"
|
|
288
134
|
selected
|
|
289
|
-
addOn={<Icon color="highlight" icon="fa-renren" size="medium" />}
|
|
290
|
-
addOnPosition="start"
|
|
291
|
-
/>
|
|
292
|
-
<ListLinkItem
|
|
293
|
-
href="/"
|
|
294
|
-
headline="Link"
|
|
295
|
-
addOn={<Icon color="primary" icon="fa-renren" size="medium" />}
|
|
296
|
-
addOnPosition="start"
|
|
297
135
|
withDivider={false}
|
|
298
136
|
/>
|
|
299
137
|
</List>
|
|
@@ -301,22 +139,71 @@ The bare list, like other components that support the `bare` style, is much more
|
|
|
301
139
|
|
|
302
140
|
---
|
|
303
141
|
|
|
142
|
+
## Item colors
|
|
143
|
+
|
|
144
|
+
ListButtonItem and ListLinkItem support semantic colors:
|
|
145
|
+
|
|
146
|
+
<List ariaLabel="Actions">
|
|
147
|
+
<ListButtonItem color="positive" headline="Create new" addOn={<Icon color="highlight" icon="fa-plus" size="medium" />} onClick={() => {}} />
|
|
148
|
+
<ListButtonItem color="secondary" headline="Edit item" addOn={<Icon color="primary" icon="fa-pencil" size="medium" />} onClick={() => {}} />
|
|
149
|
+
<ListButtonItem color="negative" headline="Delete item" addOn={<Icon color="negative" icon="fa-trash" size="medium" />} onClick={() => {}} withDivider={false} />
|
|
150
|
+
</List>
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
<ListButtonItem color="positive" headline="Create" onClick={() => {}} />
|
|
154
|
+
<ListButtonItem color="secondary" headline="Edit" onClick={() => {}} />
|
|
155
|
+
<ListButtonItem color="negative" headline="Delete" onClick={() => {}} />
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Selected state
|
|
161
|
+
|
|
162
|
+
Link items support a `selected` prop to indicate the current selection:
|
|
163
|
+
|
|
164
|
+
<List bare ariaLabel="Pages">
|
|
165
|
+
<ListLinkItem bare href="/" color="secondary" headline="Dashboard" />
|
|
166
|
+
<ListLinkItem bare href="/" color="secondary" headline="Analytics" selected />
|
|
167
|
+
<ListLinkItem bare href="/" color="secondary" headline="Reports" withDivider={false} />
|
|
168
|
+
</List>
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
<ListLinkItem
|
|
172
|
+
bare
|
|
173
|
+
href="/analytics"
|
|
174
|
+
headline="Analytics"
|
|
175
|
+
selected={currentPage === "analytics"}
|
|
176
|
+
/>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
304
181
|
## Sublist
|
|
305
182
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<ListItem headline="
|
|
183
|
+
Group related items with collapsible sections:
|
|
184
|
+
|
|
185
|
+
<List bare ariaLabel="Documentation">
|
|
186
|
+
<Sublist label="Getting Started">
|
|
187
|
+
<ListItem headline="Installation" />
|
|
188
|
+
<ListItem headline="Quick Start" />
|
|
189
|
+
<ListItem headline="Configuration" />
|
|
190
|
+
</Sublist>
|
|
191
|
+
<Sublist label="Components">
|
|
192
|
+
<ListItem headline="Button" />
|
|
193
|
+
<ListItem headline="Input" />
|
|
194
|
+
<ListItem headline="List" />
|
|
311
195
|
</Sublist>
|
|
312
196
|
</List>
|
|
313
197
|
|
|
314
198
|
```js
|
|
315
|
-
<List bare ariaLabel="
|
|
316
|
-
<Sublist label="
|
|
317
|
-
<ListItem headline="
|
|
318
|
-
<ListItem headline="
|
|
319
|
-
|
|
199
|
+
<List bare ariaLabel="Documentation">
|
|
200
|
+
<Sublist label="Getting Started">
|
|
201
|
+
<ListItem headline="Installation" />
|
|
202
|
+
<ListItem headline="Quick Start" />
|
|
203
|
+
</Sublist>
|
|
204
|
+
<Sublist label="Components">
|
|
205
|
+
<ListItem headline="Button" />
|
|
206
|
+
<ListItem headline="Input" />
|
|
320
207
|
</Sublist>
|
|
321
208
|
</List>
|
|
322
209
|
```
|
|
@@ -325,54 +212,51 @@ The bare list, like other components that support the `bare` style, is much more
|
|
|
325
212
|
|
|
326
213
|
## Keyboard navigation
|
|
327
214
|
|
|
328
|
-
Lists support
|
|
215
|
+
Lists support arrow key navigation by default (following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)):
|
|
329
216
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
/>
|
|
217
|
+
- **Arrow Up/Down** - Move between items
|
|
218
|
+
- **Enter/Space** - Activate the focused item
|
|
219
|
+
- **Home/End** - Jump to first/last item
|
|
220
|
+
|
|
221
|
+
<List ariaLabel="Keyboard demo" navigation={true}>
|
|
222
|
+
<ListButtonItem color="secondary" headline="First item (use arrow keys)" onClick={() => {}} />
|
|
223
|
+
<ListButtonItem color="secondary" headline="Second item" onClick={() => {}} />
|
|
224
|
+
<ListButtonItem color="secondary" headline="Third item" onClick={() => {}} withDivider={false} />
|
|
339
225
|
</List>
|
|
340
226
|
|
|
341
|
-
|
|
227
|
+
Disable navigation with `navigation={false}` if items have their own focus management.
|
|
342
228
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
withDivider={false}
|
|
348
|
-
color="secondary"
|
|
349
|
-
headline="Headline 3"
|
|
350
|
-
onClick={() => {}}
|
|
351
|
-
/>
|
|
229
|
+
```js
|
|
230
|
+
// Keyboard navigation enabled (default)
|
|
231
|
+
<List ariaLabel="Menu" navigation={true}>
|
|
232
|
+
...
|
|
352
233
|
</List>
|
|
353
234
|
|
|
354
|
-
|
|
355
|
-
<List ariaLabel="
|
|
356
|
-
|
|
357
|
-
<ListButtonItem color="secondary" headline="Headline 2" onClick={() => {}} />
|
|
358
|
-
<ListButtonItem
|
|
359
|
-
withDivider={false}
|
|
360
|
-
color="secondary"
|
|
361
|
-
headline="Headline 3"
|
|
362
|
-
onClick={() => {}}
|
|
363
|
-
/>
|
|
235
|
+
// Keyboard navigation disabled
|
|
236
|
+
<List ariaLabel="Form fields" navigation={false}>
|
|
237
|
+
...
|
|
364
238
|
</List>
|
|
239
|
+
```
|
|
365
240
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
/>
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Dividers
|
|
244
|
+
|
|
245
|
+
List items include dividers by default. Remove with `withDivider={false}`:
|
|
246
|
+
|
|
247
|
+
```js
|
|
248
|
+
<List ariaLabel="Items">
|
|
249
|
+
<ListItem headline="With divider" />
|
|
250
|
+
<ListItem headline="With divider" />
|
|
251
|
+
<ListItem headline="No divider" withDivider={false} />
|
|
375
252
|
</List>
|
|
376
253
|
```
|
|
377
254
|
|
|
378
255
|
---
|
|
256
|
+
|
|
257
|
+
## Accessibility
|
|
258
|
+
|
|
259
|
+
- Uses `role="grid"` with `aria-label` for screen readers
|
|
260
|
+
- Keyboard navigation follows WAI-ARIA grid pattern
|
|
261
|
+
- Focus management with arrow keys, Home, and End
|
|
262
|
+
- Proper focus indicators on keyboard navigation
|