@slotted/angular 0.1.0-beta.30 → 0.1.0-beta.32
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/docs/alert.json +1 -1
- package/docs/alert.md +1 -1
- package/docs/app-shell.json +1 -1
- package/docs/app-shell.md +1 -1
- package/docs/card.json +1 -0
- package/docs/card.md +1 -1
- package/docs/cascader.json +1 -0
- package/docs/cascader.md +1 -1
- package/docs/chart.examples.md +11 -1
- package/docs/chart.json +36 -2
- package/docs/chart.md +7 -3
- package/docs/collapsible.json +1 -0
- package/docs/collapsible.md +1 -1
- package/docs/combobox.json +1 -0
- package/docs/combobox.md +1 -1
- package/docs/dashboard-grid.json +21 -0
- package/docs/dashboard-grid.md +3 -0
- package/docs/dialog.json +2 -0
- package/docs/dialog.md +1 -1
- package/docs/drawer.json +1 -0
- package/docs/drawer.md +1 -1
- package/docs/entity-picker.json +1 -0
- package/docs/entity-picker.md +1 -1
- package/docs/form.json +1 -1
- package/docs/form.md +1 -1
- package/docs/import-export-center.json +1 -0
- package/docs/import-export-center.md +1 -1
- package/docs/index.md +1 -1
- package/docs/list.examples.md +907 -0
- package/docs/list.json +121 -33
- package/docs/list.md +73 -137
- package/docs/menu.json +1 -0
- package/docs/menu.md +1 -1
- package/docs/multi-select.json +1 -0
- package/docs/multi-select.md +1 -1
- package/docs/navigation-menu.json +1 -0
- package/docs/navigation-menu.md +1 -1
- package/docs/notification-center.json +1 -0
- package/docs/notification-center.md +1 -1
- package/docs/page-header.json +1 -1
- package/docs/page-header.md +1 -1
- package/docs/popover.json +1 -0
- package/docs/popover.md +1 -1
- package/docs/result-state.json +1 -0
- package/docs/result-state.md +1 -1
- package/docs/section.json +1 -1
- package/docs/section.md +1 -1
- package/docs/select.json +1 -0
- package/docs/select.md +1 -1
- package/docs/skills/compose-screen/SKILL.md +5 -0
- package/docs/skills/review-screen/SKILL.md +23 -22
- package/docs/table.json +7 -0
- package/docs/table.md +1 -0
- package/docs/toast.json +1 -0
- package/docs/toast.md +1 -1
- package/docs/tokens.md +8 -0
- package/docs/tour.json +1 -0
- package/docs/tour.md +1 -1
- package/fesm2022/slotted-angular-alert.mjs +2 -2
- package/fesm2022/slotted-angular-alert.mjs.map +1 -1
- package/fesm2022/slotted-angular-app-shell.mjs +2 -2
- package/fesm2022/slotted-angular-app-shell.mjs.map +1 -1
- package/fesm2022/slotted-angular-card.mjs +2 -2
- package/fesm2022/slotted-angular-cascader.mjs +4 -4
- package/fesm2022/slotted-angular-cascader.mjs.map +1 -1
- package/fesm2022/slotted-angular-chart.mjs +13 -7
- package/fesm2022/slotted-angular-chart.mjs.map +1 -1
- package/fesm2022/slotted-angular-collapsible.mjs +2 -2
- package/fesm2022/slotted-angular-collapsible.mjs.map +1 -1
- package/fesm2022/slotted-angular-combobox.mjs +2 -2
- package/fesm2022/slotted-angular-combobox.mjs.map +1 -1
- package/fesm2022/slotted-angular-dashboard-grid.mjs +123 -54
- package/fesm2022/slotted-angular-dashboard-grid.mjs.map +1 -1
- package/fesm2022/slotted-angular-date-field.mjs +5 -3
- package/fesm2022/slotted-angular-date-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-dialog.mjs +4 -4
- package/fesm2022/slotted-angular-dialog.mjs.map +1 -1
- package/fesm2022/slotted-angular-drawer.mjs +2 -2
- package/fesm2022/slotted-angular-drawer.mjs.map +1 -1
- package/fesm2022/slotted-angular-entity-picker.mjs +2 -2
- package/fesm2022/slotted-angular-entity-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-form.mjs +2 -2
- package/fesm2022/slotted-angular-form.mjs.map +1 -1
- package/fesm2022/slotted-angular-import-export-center.mjs +2 -2
- package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -1
- package/fesm2022/slotted-angular-menu.mjs +2 -2
- package/fesm2022/slotted-angular-menu.mjs.map +1 -1
- package/fesm2022/slotted-angular-message.mjs +4 -4
- package/fesm2022/slotted-angular-message.mjs.map +1 -1
- package/fesm2022/slotted-angular-multi-select.mjs +2 -2
- package/fesm2022/slotted-angular-multi-select.mjs.map +1 -1
- package/fesm2022/slotted-angular-navigation-menu.mjs +4 -4
- package/fesm2022/slotted-angular-navigation-menu.mjs.map +1 -1
- package/fesm2022/slotted-angular-notification-center.mjs +2 -2
- package/fesm2022/slotted-angular-notification-center.mjs.map +1 -1
- package/fesm2022/slotted-angular-page-header.mjs +2 -2
- package/fesm2022/slotted-angular-page-header.mjs.map +1 -1
- package/fesm2022/slotted-angular-popover.mjs +2 -2
- package/fesm2022/slotted-angular-popover.mjs.map +1 -1
- package/fesm2022/slotted-angular-result-state.mjs +2 -2
- package/fesm2022/slotted-angular-result-state.mjs.map +1 -1
- package/fesm2022/slotted-angular-scroll-area.mjs +2 -2
- package/fesm2022/slotted-angular-scroll-area.mjs.map +1 -1
- package/fesm2022/slotted-angular-section.mjs +2 -2
- package/fesm2022/slotted-angular-section.mjs.map +1 -1
- package/fesm2022/slotted-angular-select.mjs +2 -2
- package/fesm2022/slotted-angular-select.mjs.map +1 -1
- package/fesm2022/slotted-angular-side-navigation.mjs +2 -2
- package/fesm2022/slotted-angular-side-navigation.mjs.map +1 -1
- package/fesm2022/slotted-angular-table.mjs +11 -4
- package/fesm2022/slotted-angular-table.mjs.map +1 -1
- package/fesm2022/slotted-angular-toast.mjs +2 -2
- package/fesm2022/slotted-angular-toast.mjs.map +1 -1
- package/fesm2022/slotted-angular-top-navigation.mjs +2 -2
- package/fesm2022/slotted-angular-top-navigation.mjs.map +1 -1
- package/fesm2022/slotted-angular-tour.mjs +2 -2
- package/fesm2022/slotted-angular-tour.mjs.map +1 -1
- package/package.json +3 -3
- package/types/slotted-angular-chart.d.ts.map +1 -1
- package/types/slotted-angular-dashboard-grid.d.ts +3 -1
- package/types/slotted-angular-dashboard-grid.d.ts.map +1 -1
- package/types/slotted-angular-date-field.d.ts +1 -0
- package/types/slotted-angular-date-field.d.ts.map +1 -1
- package/types/slotted-angular-table.d.ts +7 -1
- package/types/slotted-angular-table.d.ts.map +1 -1
package/docs/list.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"part": "root",
|
|
70
70
|
"element": "ul or ol, or the element render returns",
|
|
71
71
|
"required": true,
|
|
72
|
-
"purpose": "The
|
|
72
|
+
"purpose": "The list. It carries data-ui=\"list\", the three axes, data-inset, data-loading and role=\"list\". The role is not redundant: List draws its own marker, and Safari drops list semantics when CSS removes the native one."
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"part": "section",
|
|
@@ -81,25 +81,25 @@
|
|
|
81
81
|
"part": "section-label",
|
|
82
82
|
"element": "h1 to h6, or a div",
|
|
83
83
|
"required": false,
|
|
84
|
-
"purpose": "The group name. It carries the id the nested list
|
|
84
|
+
"purpose": "The group name. It carries the id the nested list is named by, data-sticky when it holds still while its own rows scroll past, and data-variant: caption, the small muted name, or ruled, the name in the text color over a rule with no background."
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"part": "section-end",
|
|
88
88
|
"element": "span",
|
|
89
89
|
"required": false,
|
|
90
|
-
"purpose": "What stands at the end of the heading, on the line of the name: a day
|
|
90
|
+
"purpose": "What stands at the end of the heading, on the line of the name: a day's total, a count. It is set in tabular figures, on the element inside the heading marked slListSectionEnd."
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"part": "section-list",
|
|
94
94
|
"element": "ul or ol",
|
|
95
95
|
"required": false,
|
|
96
|
-
"purpose": "The rows of one group. It takes the element of the
|
|
96
|
+
"purpose": "The rows of one group. It takes the element of the list around it, carries role=\"list\" for the same reason the root does, and is named by the heading above it."
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"part": "empty",
|
|
100
100
|
"element": "li",
|
|
101
101
|
"required": false,
|
|
102
|
-
"purpose": "
|
|
102
|
+
"purpose": "The message the list shows when it holds no rows. It sits inside the list, so a screen reader reads the message rather than announcing zero items and stopping."
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"api": [
|
|
@@ -108,111 +108,111 @@
|
|
|
108
108
|
"type": "'plain' | 'ruled' | 'framed' | 'separated'",
|
|
109
109
|
"defaultValue": "plain",
|
|
110
110
|
"appliesTo": "slList",
|
|
111
|
-
"description": "How the rows are told apart: by
|
|
111
|
+
"description": "How the rows are told apart: by spacing, by a rule between them, by a box around the list, or by a surface for each row."
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"name": "size",
|
|
115
115
|
"type": "'sm' | 'md' | 'lg'",
|
|
116
116
|
"defaultValue": "md",
|
|
117
117
|
"appliesTo": "slList",
|
|
118
|
-
"description": "The room a row gets. Density is the application
|
|
118
|
+
"description": "The room a row gets: its minimum height, padding, gap and type size. Density is set by the application; size is set per list."
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"name": "marker",
|
|
122
122
|
"type": "'none' | 'bullet' | 'number'",
|
|
123
123
|
"defaultValue": "none",
|
|
124
124
|
"appliesTo": "slList",
|
|
125
|
-
"description": "What is painted in the marker column.
|
|
125
|
+
"description": "What is painted in the marker column. List draws the marker itself, so removing it never removes the list semantics."
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"name": "ordered",
|
|
129
129
|
"type": "boolean",
|
|
130
130
|
"defaultValue": "false",
|
|
131
131
|
"appliesTo": "the element",
|
|
132
|
-
"description": "Not an input
|
|
132
|
+
"description": "Not an input. Write slList on an ol instead of a ul: the element carries the reading order."
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"name": "inset",
|
|
136
136
|
"type": "boolean",
|
|
137
137
|
"defaultValue": "false",
|
|
138
138
|
"appliesTo": "slList",
|
|
139
|
-
"description": "
|
|
139
|
+
"description": "Removes the rows' inline padding, for a list inside a box that already pads its content. Rules and hover fills still run edge to edge."
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"name": "loading",
|
|
143
143
|
"type": "boolean",
|
|
144
144
|
"defaultValue": "false",
|
|
145
145
|
"appliesTo": "slList",
|
|
146
|
-
"description": "Writes aria-busy on the
|
|
146
|
+
"description": "Writes aria-busy on the list and draws nothing. slSkeleton, composed inside the rows, stands in for their content."
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"name": "level",
|
|
150
150
|
"type": "'none' | '1' | '2' | '3' | '4' | '5' | '6'",
|
|
151
151
|
"defaultValue": "3",
|
|
152
152
|
"appliesTo": "the element",
|
|
153
|
-
"description": "Not an input
|
|
153
|
+
"description": "Not an input. slListSectionLabel goes on the heading element you write, at the level the document needs."
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
"name": "sticky",
|
|
157
157
|
"type": "boolean",
|
|
158
158
|
"defaultValue": "false",
|
|
159
159
|
"appliesTo": "slListSectionLabel",
|
|
160
|
-
"description": "Keeps a group name in place while its own rows scroll past it"
|
|
160
|
+
"description": "Keeps a group name in place while its own rows scroll past it, above the rows and on the list surface."
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"name": "variant",
|
|
164
164
|
"type": "'caption' | 'ruled'",
|
|
165
165
|
"defaultValue": "caption",
|
|
166
166
|
"appliesTo": "slListSectionLabel",
|
|
167
|
-
"description": "How the group heading is drawn: the small muted name,
|
|
167
|
+
"description": "How the group heading is drawn: caption is the small muted name, ruled is the name over a rule with no background. An element inside it marked slListSectionEnd stands at the end of the line, in tabular figures."
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"name": "id",
|
|
171
171
|
"type": "string",
|
|
172
172
|
"defaultValue": "—",
|
|
173
173
|
"appliesTo": "slListSectionLabel",
|
|
174
|
-
"description": "The heading
|
|
174
|
+
"description": "The heading's id, which the nested list is named by. Generated when none is written."
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"name": "exportAs",
|
|
178
178
|
"type": "slList | slListSection | slListSectionLabel | slListSectionList | slListEmpty",
|
|
179
179
|
"defaultValue": "—",
|
|
180
180
|
"appliesTo": "every directive",
|
|
181
|
-
"description": "Reaches the instance from a template"
|
|
181
|
+
"description": "Reaches the directive instance from a template."
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"name": "aria-label / aria-labelledby",
|
|
185
185
|
"type": "string",
|
|
186
186
|
"defaultValue": "—",
|
|
187
187
|
"appliesTo": "slList",
|
|
188
|
-
"description": "The
|
|
188
|
+
"description": "The list's accessible name, written on the element. slList adds no name of its own."
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
"name": "role",
|
|
192
192
|
"type": "string",
|
|
193
193
|
"defaultValue": "list",
|
|
194
194
|
"appliesTo": "slList, slListSectionList",
|
|
195
|
-
"description": "Written by
|
|
195
|
+
"description": "Written by slList and slListSectionList, never over a role written on the element."
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"name": "provideListDefaults",
|
|
199
199
|
"type": "{ variant, size, marker, inset }",
|
|
200
200
|
"defaultValue": "—",
|
|
201
201
|
"appliesTo": "an injector",
|
|
202
|
-
"description": "Sets
|
|
202
|
+
"description": "Sets variant, size, marker and inset once for every list under the injector. An input set on a list still wins."
|
|
203
203
|
}
|
|
204
204
|
],
|
|
205
205
|
"composition": [],
|
|
206
206
|
"events": [],
|
|
207
207
|
"accessibility": [
|
|
208
|
-
"
|
|
209
|
-
"role=\"list\" is written on the root and on every nested group
|
|
210
|
-
"The directive goes on the
|
|
211
|
-
"A group is an li
|
|
212
|
-
"loading writes aria-busy on the
|
|
213
|
-
"The empty message is an li inside the list. Outside
|
|
214
|
-
"
|
|
215
|
-
"
|
|
208
|
+
"A static list has no pattern in the ARIA Authoring Practices, which cover interactive collections such as Listbox and Grid. slList follows HTML and the ARIA roles model.",
|
|
209
|
+
"role=\"list\" is written on the root and on every nested group. It is not redundant: slList draws its own marker, and Safari with VoiceOver drops list semantics when CSS removes the native one. A role written on the element, such as menu or listbox, is kept.",
|
|
210
|
+
"The directive goes on the ul or ol you write, because the element carries the reading order. React renders the element from an ordered prop instead.",
|
|
211
|
+
"A group is an li that holds a heading and a nested list, and the nested list is named by that heading through aria-labelledby. The heading keeps the level the document needs, because slListSectionLabel goes on the element you write.",
|
|
212
|
+
"loading writes aria-busy on the list, which ARIA 1.2 asks of a container whose content has not arrived. slList draws no spinner and no placeholder; slSkeleton goes inside the rows.",
|
|
213
|
+
"The empty message is an li inside the list. Outside the list, a screen reader announces a list of zero items and reads nothing more, and the words fall outside the frame of a framed list.",
|
|
214
|
+
"slList binds no key. Every control a row holds is in the page tab sequence, so Tab and Shift+Tab move between them. Arrow keys, Home, End and typeahead belong to Listbox and Table.",
|
|
215
|
+
"slList holds no value a consumer can own, so it declares no model and emits no output. A row paints a selection with selected, and the slCheckbox composed into the row announces it."
|
|
216
216
|
]
|
|
217
217
|
}
|
|
218
218
|
},
|
|
@@ -291,17 +291,17 @@
|
|
|
291
291
|
"id": "sections",
|
|
292
292
|
"title": "Groups",
|
|
293
293
|
"note": "A group is an li holding a heading and a nested list, and the nested list names itself by that heading. The heading keeps whatever level the document needs, because the directive goes on the page own element.",
|
|
294
|
-
"language": "
|
|
295
|
-
"source": "<li slListSection>\n
|
|
296
|
-
"verdict": "
|
|
294
|
+
"language": "ts",
|
|
295
|
+
"source": "import { Component } from '@angular/core';\nimport {\n SlList,\n SlListSection,\n SlListSectionEnd,\n SlListSectionLabel,\n SlListSectionList,\n} from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\n\nconst DAYS = [\n {\n day: 'Today',\n total: '$4,820.00',\n payouts: [\n { id: 'PO-2291', customer: 'Contoso Foods', amount: '$3,150.00' },\n { id: 'PO-2290', customer: 'Aster Bakery', amount: '$1,670.00' },\n ],\n },\n {\n day: 'Yesterday',\n total: '$3,115.50',\n payouts: [\n { id: 'PO-2289', customer: 'Bluefin Market', amount: '$2,240.50' },\n { id: 'PO-2288', customer: 'Driftwood Inn', amount: '$875.00' },\n ],\n },\n];\n\n@Component({\n selector: 'app-list-sections',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n SlListSection,\n SlListSectionEnd,\n SlListSectionLabel,\n SlListSectionList,\n ],\n template: `\n <ul slList aria-label=\"Payouts\" variant=\"ruled\">\n @for (group of days; track group.day) {\n <li slListSection>\n <h3 slListSectionLabel>\n {{ group.day }}\n <span slListSectionEnd>{{ group.total }}</span>\n </h3>\n <ul slListSectionList>\n @for (payout of group.payouts; track payout.id) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ payout.customer }}</span>\n <span slListItemDescription>{{ payout.id }}</span>\n </span>\n <span slListItemEnd>{{ payout.amount }}</span>\n </div>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n `,\n})\nexport class ListSections {\n readonly days = DAYS;\n}\n",
|
|
296
|
+
"verdict": "example"
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
"id": "inset",
|
|
300
300
|
"title": "A set inside a padded box",
|
|
301
301
|
"note": "inset takes the rows inline padding away so the titles line up with the box around them. The rule and the hover fill still run edge to edge, which is the half disableGutters leaves out elsewhere.",
|
|
302
|
-
"language": "
|
|
303
|
-
"source": "
|
|
304
|
-
"verdict": "
|
|
302
|
+
"language": "ts",
|
|
303
|
+
"source": "import { Component } from '@angular/core';\nimport { SlCard, SlCardBody, SlCardHeader } from '@slotted/angular/card';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlHeading } from '@slotted/angular/typography';\n\n@Component({\n selector: 'app-list-inset',\n imports: [\n SlCard,\n SlCardBody,\n SlCardHeader,\n SlHeading,\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemLabel,\n ],\n template: `\n <div slCard>\n <div slCardHeader>\n <h3 slHeading size=\"md\">On shift in Reno</h3>\n </div>\n <div slCardBody>\n <ul slList aria-label=\"On shift in Reno\" inset variant=\"ruled\">\n @for (person of crew; track person.name) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ person.name }}</span>\n <span slListItemDescription>{{ person.role }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n </div>\n `,\n})\nexport class ListInset {\n readonly crew = [\n { name: 'Amara Nwosu', role: 'Shift lead, receiving' },\n { name: 'Diego Morales', role: 'Picker, aisles 1 to 6' },\n { name: 'Ingrid Holm', role: 'Packer, station 2' },\n ];\n}\n",
|
|
304
|
+
"verdict": "example"
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
307
|
"id": "states",
|
|
@@ -334,6 +334,94 @@
|
|
|
334
334
|
"language": "html",
|
|
335
335
|
"source": "<nav aria-label=\"Sections\">\n <ul slList>\n <li slListItem current=\"page\">\n <a slListItemContent href=\"/billing\">Billing</a>\n </li>\n </ul>\n</nav>\n",
|
|
336
336
|
"verdict": "excerpt"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"id": "basic",
|
|
340
|
+
"title": "basic.ts",
|
|
341
|
+
"note": null,
|
|
342
|
+
"language": "ts",
|
|
343
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\n\nconst WAREHOUSES = [\n { id: 'reno', name: 'Reno', summary: '312 orders to ship today', open: '1,284' },\n { id: 'columbus', name: 'Columbus', summary: '198 orders to ship today', open: '962' },\n { id: 'savannah', name: 'Savannah', summary: '74 orders to ship today', open: '418' },\n];\n\n@Component({\n selector: 'app-list-basic',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n ],\n template: `\n <ul slList aria-label=\"Warehouses\" variant=\"ruled\">\n @for (warehouse of warehouses; track warehouse.id) {\n <li slListItem>\n <a slListItemContent [href]=\"'#' + warehouse.id\">\n <span slListItemBody>\n <span slListItemLabel>{{ warehouse.name }}</span>\n <span slListItemDescription>{{ warehouse.summary }}</span>\n </span>\n <span slListItemEnd>{{ warehouse.open }}</span>\n </a>\n </li>\n }\n </ul>\n `,\n})\nexport class ListBasic {\n readonly warehouses = WAREHOUSES;\n}\n",
|
|
344
|
+
"verdict": "example"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"id": "defaults",
|
|
348
|
+
"title": "defaults.ts",
|
|
349
|
+
"note": null,
|
|
350
|
+
"language": "ts",
|
|
351
|
+
"source": "import { Component } from '@angular/core';\nimport { provideListDefaults, SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlStack } from '@slotted/angular/stack';\n\n@Component({\n selector: 'app-list-defaults',\n imports: [SlList, SlListItem, SlListItemBody, SlListItemContent, SlListItemLabel, SlStack],\n providers: [provideListDefaults({ size: 'sm', variant: 'ruled' })],\n template: `\n <div slStack [gap]=\"5\">\n <ul slList aria-label=\"Carriers\">\n @for (name of carriers; track name) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ name }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n <ul slList aria-label=\"Docks\" variant=\"framed\">\n @for (name of docks; track name) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ name }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n `,\n})\nexport class ListDefaults {\n readonly carriers = ['UPS Ground', 'FedEx Express'];\n readonly docks = ['Dock 1, inbound', 'Dock 3, outbound'];\n}\n",
|
|
352
|
+
"verdict": "example"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"id": "empty",
|
|
356
|
+
"title": "empty.ts",
|
|
357
|
+
"note": null,
|
|
358
|
+
"language": "ts",
|
|
359
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList, SlListEmpty } from '@slotted/angular/list';\nimport { SlHeading, SlText } from '@slotted/angular/typography';\n\n@Component({\n selector: 'app-list-empty',\n imports: [SlHeading, SlList, SlListEmpty, SlText],\n template: `\n <ul slList aria-label=\"Returns\" variant=\"framed\">\n <li slListEmpty>\n <h3 slHeading size=\"md\">No returns waiting</h3>\n <span slText tone=\"muted\"\n >A return appears here once the customer ships the parcel back.</span\n >\n </li>\n </ul>\n `,\n})\nexport class ListEmpty {}\n",
|
|
360
|
+
"verdict": "example"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"id": "loading",
|
|
364
|
+
"title": "loading.ts",
|
|
365
|
+
"note": null,
|
|
366
|
+
"language": "ts",
|
|
367
|
+
"source": "import { Component, effect, signal } from '@angular/core';\nimport { SlButton } from '@slotted/angular/button';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlSkeleton, SlSkeletonRegion } from '@slotted/angular/skeleton';\nimport { SlStack } from '@slotted/angular/stack';\n\n@Component({\n selector: 'app-list-loading',\n imports: [\n SlButton,\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n SlSkeleton,\n SlSkeletonRegion,\n SlStack,\n ],\n template: `\n <div slStack align=\"start\" [gap]=\"3\">\n <button slButton size=\"sm\" variant=\"outline\" (click)=\"loading.set(true)\">\n Refresh carriers\n </button>\n <div\n slSkeletonRegion\n [delay]=\"200\"\n [loading]=\"loading()\"\n [messages]=\"{ label: 'Loading carriers' }\"\n [minDuration]=\"400\"\n >\n <ul slList aria-label=\"Carriers\" [loading]=\"loading()\" variant=\"ruled\">\n @for (carrier of carriers; track carrier.name) {\n <li slListItem [loading]=\"loading()\">\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>\n @if (loading()) {\n <span slSkeleton [inlineSize]=\"carrier.widths[0]\"></span>\n } @else {\n {{ carrier.name }}\n }\n </span>\n <span slListItemDescription>\n @if (loading()) {\n <span slSkeleton [inlineSize]=\"carrier.widths[1]\"></span>\n } @else {\n {{ carrier.cutoff }}\n }\n </span>\n </span>\n <span slListItemEnd>\n @if (loading()) {\n <span slSkeleton inlineSize=\"2rem\"></span>\n } @else {\n {{ carrier.parcels }}\n }\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n </div>\n `,\n})\nexport class ListLoading {\n readonly carriers = [\n { name: 'UPS Ground', cutoff: 'Pickup at 16:30', parcels: '142', widths: ['6rem', '7rem'] },\n { name: 'FedEx Express', cutoff: 'Pickup at 17:00', parcels: '38', widths: ['7.5rem', '7rem'] },\n { name: 'USPS Priority', cutoff: 'Drop-off by 18:00', parcels: '61', widths: ['7rem', '8rem'] },\n ];\n\n readonly loading = signal(true);\n\n constructor() {\n effect((onCleanup) => {\n if (!this.loading()) return;\n const timer = setTimeout(() => this.loading.set(false), 1500);\n onCleanup(() => clearTimeout(timer));\n });\n }\n}\n",
|
|
368
|
+
"verdict": "example"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"id": "markers",
|
|
372
|
+
"title": "markers.ts",
|
|
373
|
+
"note": null,
|
|
374
|
+
"language": "ts",
|
|
375
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlStack } from '@slotted/angular/stack';\nimport { SlText } from '@slotted/angular/typography';\n\n@Component({\n selector: 'app-list-markers',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n SlStack,\n SlText,\n ],\n template: `\n <div slStack [gap]=\"5\">\n <div slStack [gap]=\"2\">\n <span slText size=\"sm\" tone=\"muted\">bullet</span>\n <ul slList aria-label=\"Shipping rules\" marker=\"bullet\">\n @for (rule of rules; track rule) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ rule }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n\n <div slStack [gap]=\"2\">\n <span slText size=\"sm\" tone=\"muted\">number, ordered</span>\n <ol slList aria-label=\"Receiving steps\" marker=\"number\">\n @for (step of steps; track step) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ step }}</span>\n </span>\n </div>\n </li>\n }\n </ol>\n </div>\n </div>\n `,\n})\nexport class ListMarkers {\n readonly rules = [\n 'Lithium batteries ship by ground only',\n 'Parcels over 30 kg need a two-person lift label',\n ];\n\n readonly steps = [\n 'Receive the pallet at dock 3',\n 'Scan every carton',\n 'Put each carton away by bin',\n ];\n}\n",
|
|
376
|
+
"verdict": "example"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"id": "navigation",
|
|
380
|
+
"title": "navigation.ts",
|
|
381
|
+
"note": null,
|
|
382
|
+
"language": "ts",
|
|
383
|
+
"source": "import { Component, signal } from '@angular/core';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\n\n@Component({\n selector: 'app-list-navigation',\n imports: [SlList, SlListItem, SlListItemBody, SlListItemContent, SlListItemLabel],\n template: `\n <nav aria-label=\"Settings\">\n <ul slList>\n @for (section of sections; track section.href) {\n <li slListItem [current]=\"section.href === here() ? 'page' : false\">\n <a slListItemContent [href]=\"section.href\" (click)=\"navigate($event, section.href)\">\n <span slListItemBody>\n <span slListItemLabel>{{ section.name }}</span>\n </span>\n </a>\n </li>\n }\n </ul>\n </nav>\n `,\n})\nexport class ListNavigation {\n readonly sections = [\n { href: '#general', name: 'General' },\n { href: '#warehouses', name: 'Warehouses' },\n { href: '#carriers', name: 'Carriers' },\n { href: '#billing', name: 'Billing' },\n ];\n\n readonly here = signal('#warehouses');\n\n navigate(event: MouseEvent, href: string) {\n event.preventDefault();\n this.here.set(href);\n }\n}\n",
|
|
384
|
+
"verdict": "example"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"id": "page-of-set",
|
|
388
|
+
"title": "page-of-set.ts",
|
|
389
|
+
"note": null,
|
|
390
|
+
"language": "ts",
|
|
391
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\n\n@Component({\n selector: 'app-list-page-of-set',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n ],\n template: `\n <ul slList aria-label=\"Orders 41 to 43 of 128\" variant=\"ruled\">\n @for (order of orders; track order.id) {\n <li slListItem [position]=\"order.position\" [setSize]=\"128\">\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ order.id }}</span>\n <span slListItemDescription>{{ order.customer }}</span>\n </span>\n <span slListItemEnd>{{ order.total }}</span>\n </div>\n </li>\n }\n </ul>\n `,\n})\nexport class ListPageOfSet {\n readonly orders = [\n { position: 41, id: 'SO-1141', customer: 'Granite Outfitters', total: '$612.40' },\n { position: 42, id: 'SO-1142', customer: 'Cobalt Fitness', total: '$1,208.00' },\n { position: 43, id: 'SO-1143', customer: 'Fernhill School', total: '$94.75' },\n ];\n}\n",
|
|
392
|
+
"verdict": "example"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"id": "selection",
|
|
396
|
+
"title": "selection.ts",
|
|
397
|
+
"note": null,
|
|
398
|
+
"language": "ts",
|
|
399
|
+
"source": "import { Component, signal } from '@angular/core';\nimport { SlBadge } from '@slotted/angular/badge';\nimport { SlCheckbox } from '@slotted/angular/checkbox';\nimport { SlList } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n SlListItemStart,\n} from '@slotted/angular/list-item';\nimport { SlStack } from '@slotted/angular/stack';\nimport { SlText } from '@slotted/angular/typography';\nimport { SlVisuallyHidden } from '@slotted/angular/visually-hidden';\n\n@Component({\n selector: 'app-list-selection',\n imports: [\n SlBadge,\n SlCheckbox,\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemDescription,\n SlListItemEnd,\n SlListItemLabel,\n SlListItemStart,\n SlStack,\n SlText,\n SlVisuallyHidden,\n ],\n template: `\n <div slStack [gap]=\"3\">\n <ul slList aria-label=\"Orders to pick\" variant=\"ruled\">\n @for (order of orders; track order.id) {\n <li slListItem [selected]=\"picked().includes(order.id)\">\n <div slListItemContent>\n <span slListItemStart>\n <span\n slCheckbox\n [checked]=\"picked().includes(order.id)\"\n (checkedChange)=\"pick(order.id, $event.value)\"\n >\n <span slVisuallyHidden>Pick {{ order.id }}</span>\n </span>\n </span>\n <span slListItemBody>\n <span slListItemLabel>{{ order.id }}</span>\n <span slListItemDescription>{{ order.customer }}</span>\n </span>\n <span slListItemEnd>\n <span slBadge variant=\"soft\">{{ order.lines }} lines</span>\n </span>\n </div>\n </li>\n }\n </ul>\n <span slText size=\"sm\" tone=\"muted\">\n {{ picked().length }} of {{ orders.length }} orders on the pick list\n </span>\n </div>\n `,\n})\nexport class ListSelection {\n readonly orders = [\n { id: 'SO-1182', customer: 'Contoso Foods', lines: 6 },\n { id: 'SO-1183', customer: 'Atlas Freight', lines: 2 },\n { id: 'SO-1184', customer: 'Ember Goods', lines: 11 },\n ];\n\n readonly picked = signal<string[]>(['SO-1182']);\n\n pick(id: string, checked: boolean) {\n this.picked.update((current) =>\n checked ? [...current, id] : current.filter((entry) => entry !== id),\n );\n }\n}\n",
|
|
400
|
+
"verdict": "example"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"id": "sizes",
|
|
404
|
+
"title": "sizes.ts",
|
|
405
|
+
"note": null,
|
|
406
|
+
"language": "ts",
|
|
407
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList, type ListSize } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlStack } from '@slotted/angular/stack';\nimport { SlText } from '@slotted/angular/typography';\n\n@Component({\n selector: 'app-list-sizes',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n SlStack,\n SlText,\n ],\n template: `\n <div slStack [gap]=\"5\">\n @for (size of sizes; track size) {\n <div slStack [gap]=\"2\">\n <span slText size=\"sm\" tone=\"muted\">{{ size }}</span>\n <ul slList [attr.aria-label]=\"'Bins, ' + size\" [size]=\"size\" variant=\"ruled\">\n @for (bin of bins; track bin) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ bin }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n }\n </div>\n `,\n})\nexport class ListSizes {\n readonly sizes: ListSize[] = ['sm', 'md', 'lg'];\n readonly bins = ['Aisle 4, bin 12', 'Aisle 4, bin 13'];\n}\n",
|
|
408
|
+
"verdict": "example"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"id": "sticky",
|
|
412
|
+
"title": "sticky.ts",
|
|
413
|
+
"note": null,
|
|
414
|
+
"language": "ts",
|
|
415
|
+
"source": "import { Component } from '@angular/core';\nimport {\n SlList,\n SlListSection,\n SlListSectionEnd,\n SlListSectionLabel,\n SlListSectionList,\n} from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemEnd,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlScrollArea, SlScrollAreaContent } from '@slotted/angular/scroll-area';\n\nconst DAYS = [\n {\n day: 'Monday',\n moves: [\n { id: 'MV-801', sku: 'Oat flour, 25 kg', quantity: '+40' },\n { id: 'MV-802', sku: 'Rye flour, 25 kg', quantity: '+24' },\n { id: 'MV-803', sku: 'Sea salt, 5 kg', quantity: '−12' },\n { id: 'MV-804', sku: 'Cane sugar, 10 kg', quantity: '−30' },\n ],\n },\n {\n day: 'Tuesday',\n moves: [\n { id: 'MV-805', sku: 'Oat flour, 25 kg', quantity: '−18' },\n { id: 'MV-806', sku: 'Dried yeast, 500 g', quantity: '+60' },\n { id: 'MV-807', sku: 'Butter, 10 kg', quantity: '−8' },\n { id: 'MV-808', sku: 'Sea salt, 5 kg', quantity: '+20' },\n ],\n },\n {\n day: 'Wednesday',\n moves: [\n { id: 'MV-809', sku: 'Rye flour, 25 kg', quantity: '−16' },\n { id: 'MV-810', sku: 'Cane sugar, 10 kg', quantity: '+45' },\n { id: 'MV-811', sku: 'Butter, 10 kg', quantity: '+12' },\n { id: 'MV-812', sku: 'Dried yeast, 500 g', quantity: '−22' },\n ],\n },\n];\n\n@Component({\n selector: 'app-list-sticky',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemEnd,\n SlListItemLabel,\n SlListSection,\n SlListSectionEnd,\n SlListSectionLabel,\n SlListSectionList,\n SlScrollArea,\n SlScrollAreaContent,\n ],\n template: `\n <div slScrollArea maxBlockSize=\"16rem\" [messages]=\"{ label: 'Stock movements' }\">\n <div slScrollAreaContent>\n <ul slList aria-label=\"Stock movements\" variant=\"ruled\">\n @for (group of days; track group.day) {\n <li slListSection>\n <h3 slListSectionLabel sticky variant=\"ruled\">\n {{ group.day }}\n <span slListSectionEnd>{{ group.moves.length }} moves</span>\n </h3>\n <ul slListSectionList>\n @for (move of group.moves; track move.id) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ move.sku }}</span>\n </span>\n <span slListItemEnd>{{ move.quantity }}</span>\n </div>\n </li>\n }\n </ul>\n </li>\n }\n </ul>\n </div>\n </div>\n `,\n})\nexport class ListSticky {\n readonly days = DAYS;\n}\n",
|
|
416
|
+
"verdict": "example"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"id": "variants",
|
|
420
|
+
"title": "variants.ts",
|
|
421
|
+
"note": null,
|
|
422
|
+
"language": "ts",
|
|
423
|
+
"source": "import { Component } from '@angular/core';\nimport { SlList, type ListVariant } from '@slotted/angular/list';\nimport {\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n} from '@slotted/angular/list-item';\nimport { SlStack } from '@slotted/angular/stack';\nimport { SlText } from '@slotted/angular/typography';\n\n@Component({\n selector: 'app-list-variants',\n imports: [\n SlList,\n SlListItem,\n SlListItemBody,\n SlListItemContent,\n SlListItemLabel,\n SlStack,\n SlText,\n ],\n template: `\n <div slStack [gap]=\"5\">\n @for (variant of variants; track variant) {\n <div slStack [gap]=\"2\">\n <span slText size=\"sm\" tone=\"muted\">{{ variant }}</span>\n <ul slList [attr.aria-label]=\"'Carriers, ' + variant\" [variant]=\"variant\">\n @for (carrier of carriers; track carrier) {\n <li slListItem>\n <div slListItemContent>\n <span slListItemBody>\n <span slListItemLabel>{{ carrier }}</span>\n </span>\n </div>\n </li>\n }\n </ul>\n </div>\n }\n </div>\n `,\n})\nexport class ListVariants {\n readonly variants: ListVariant[] = ['plain', 'ruled', 'framed', 'separated'];\n readonly carriers = ['UPS Ground', 'FedEx Express'];\n}\n",
|
|
424
|
+
"verdict": "example"
|
|
337
425
|
}
|
|
338
426
|
]
|
|
339
427
|
}
|
package/docs/list.md
CHANGED
|
@@ -13,17 +13,56 @@ Selector: `ul[slList], ol[slList], li[slListSection], [slListSectionLabel], ul[s
|
|
|
13
13
|
|
|
14
14
|
## Minimal example
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
Example
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { Component } from '@angular/core';
|
|
20
|
+
import { SlList } from '@slotted/angular/list';
|
|
21
|
+
import {
|
|
22
|
+
SlListItem,
|
|
23
|
+
SlListItemBody,
|
|
24
|
+
SlListItemContent,
|
|
25
|
+
SlListItemDescription,
|
|
26
|
+
SlListItemEnd,
|
|
27
|
+
SlListItemLabel,
|
|
28
|
+
} from '@slotted/angular/list-item';
|
|
29
|
+
|
|
30
|
+
const WAREHOUSES = [
|
|
31
|
+
{ id: 'reno', name: 'Reno', summary: '312 orders to ship today', open: '1,284' },
|
|
32
|
+
{ id: 'columbus', name: 'Columbus', summary: '198 orders to ship today', open: '962' },
|
|
33
|
+
{ id: 'savannah', name: 'Savannah', summary: '74 orders to ship today', open: '418' },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
@Component({
|
|
37
|
+
selector: 'app-list-basic',
|
|
38
|
+
imports: [
|
|
39
|
+
SlList,
|
|
40
|
+
SlListItem,
|
|
41
|
+
SlListItemBody,
|
|
42
|
+
SlListItemContent,
|
|
43
|
+
SlListItemDescription,
|
|
44
|
+
SlListItemEnd,
|
|
45
|
+
SlListItemLabel,
|
|
46
|
+
],
|
|
47
|
+
template: `
|
|
48
|
+
<ul slList aria-label="Warehouses" variant="ruled">
|
|
49
|
+
@for (warehouse of warehouses; track warehouse.id) {
|
|
50
|
+
<li slListItem>
|
|
51
|
+
<a slListItemContent [href]="'#' + warehouse.id">
|
|
52
|
+
<span slListItemBody>
|
|
53
|
+
<span slListItemLabel>{{ warehouse.name }}</span>
|
|
54
|
+
<span slListItemDescription>{{ warehouse.summary }}</span>
|
|
55
|
+
</span>
|
|
56
|
+
<span slListItemEnd>{{ warehouse.open }}</span>
|
|
57
|
+
</a>
|
|
58
|
+
</li>
|
|
59
|
+
}
|
|
60
|
+
</ul>
|
|
61
|
+
`,
|
|
62
|
+
})
|
|
63
|
+
export class ListBasic {
|
|
64
|
+
readonly warehouses = WAREHOUSES;
|
|
65
|
+
}
|
|
27
66
|
```
|
|
28
67
|
|
|
29
68
|
## Anatomy
|
|
@@ -41,20 +80,20 @@ Excerpt — not a complete module
|
|
|
41
80
|
|
|
42
81
|
| Name | Type | Default | Applies to | Description |
|
|
43
82
|
| --- | --- | --- | --- | --- |
|
|
44
|
-
| `variant` | `'plain' \| 'ruled' \| 'framed' \| 'separated'` | plain | slList | How the rows are told apart: by
|
|
45
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | md | slList | The room a row gets. Density is the application
|
|
46
|
-
| `marker` | `'none' \| 'bullet' \| 'number'` | none | slList | What is painted in the marker column.
|
|
47
|
-
| `ordered` | `boolean` | false | the element | Not an input
|
|
48
|
-
| `inset` | `boolean` | false | slList |
|
|
49
|
-
| `loading` | `boolean` | false | slList | Writes aria-busy on the
|
|
50
|
-
| `level` | `'none' \| '1' \| '2' \| '3' \| '4' \| '5' \| '6'` | 3 | the element | Not an input
|
|
51
|
-
| `sticky` | `boolean` | false | slListSectionLabel | Keeps a group name in place while its own rows scroll past it |
|
|
52
|
-
| `variant` | `'caption' \| 'ruled'` | caption | slListSectionLabel | How the group heading is drawn: the small muted name,
|
|
53
|
-
| `id` | `string` | — | slListSectionLabel | The heading
|
|
54
|
-
| `exportAs` | `slList \| slListSection \| slListSectionLabel \| slListSectionList \| slListEmpty` | — | every directive | Reaches the instance from a template |
|
|
55
|
-
| `aria-label / aria-labelledby` | `string` | — | slList | The
|
|
56
|
-
| `role` | `string` | list | slList, slListSectionList | Written by
|
|
57
|
-
| `provideListDefaults` | `{ variant, size, marker, inset }` | — | an injector | Sets
|
|
83
|
+
| `variant` | `'plain' \| 'ruled' \| 'framed' \| 'separated'` | plain | slList | How the rows are told apart: by spacing, by a rule between them, by a box around the list, or by a surface for each row. |
|
|
84
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | md | slList | The room a row gets: its minimum height, padding, gap and type size. Density is set by the application; size is set per list. |
|
|
85
|
+
| `marker` | `'none' \| 'bullet' \| 'number'` | none | slList | What is painted in the marker column. List draws the marker itself, so removing it never removes the list semantics. |
|
|
86
|
+
| `ordered` | `boolean` | false | the element | Not an input. Write slList on an ol instead of a ul: the element carries the reading order. |
|
|
87
|
+
| `inset` | `boolean` | false | slList | Removes the rows' inline padding, for a list inside a box that already pads its content. Rules and hover fills still run edge to edge. |
|
|
88
|
+
| `loading` | `boolean` | false | slList | Writes aria-busy on the list and draws nothing. slSkeleton, composed inside the rows, stands in for their content. |
|
|
89
|
+
| `level` | `'none' \| '1' \| '2' \| '3' \| '4' \| '5' \| '6'` | 3 | the element | Not an input. slListSectionLabel goes on the heading element you write, at the level the document needs. |
|
|
90
|
+
| `sticky` | `boolean` | false | slListSectionLabel | Keeps a group name in place while its own rows scroll past it, above the rows and on the list surface. |
|
|
91
|
+
| `variant` | `'caption' \| 'ruled'` | caption | slListSectionLabel | How the group heading is drawn: caption is the small muted name, ruled is the name over a rule with no background. An element inside it marked slListSectionEnd stands at the end of the line, in tabular figures. |
|
|
92
|
+
| `id` | `string` | — | slListSectionLabel | The heading's id, which the nested list is named by. Generated when none is written. |
|
|
93
|
+
| `exportAs` | `slList \| slListSection \| slListSectionLabel \| slListSectionList \| slListEmpty` | — | every directive | Reaches the directive instance from a template. |
|
|
94
|
+
| `aria-label / aria-labelledby` | `string` | — | slList | The list's accessible name, written on the element. slList adds no name of its own. |
|
|
95
|
+
| `role` | `string` | list | slList, slListSectionList | Written by slList and slListSectionList, never over a role written on the element. |
|
|
96
|
+
| `provideListDefaults` | `{ variant, size, marker, inset }` | — | an injector | Sets variant, size, marker and inset once for every list under the injector. An input set on a list still wins. |
|
|
58
97
|
|
|
59
98
|
## Axes and defaults
|
|
60
99
|
|
|
@@ -66,14 +105,14 @@ Excerpt — not a complete module
|
|
|
66
105
|
|
|
67
106
|
## Rules
|
|
68
107
|
|
|
69
|
-
-
|
|
70
|
-
- role="list" is written on the root and on every nested group
|
|
71
|
-
- The directive goes on the
|
|
72
|
-
- A group is an li
|
|
73
|
-
- loading writes aria-busy on the
|
|
74
|
-
- The empty message is an li inside the list. Outside
|
|
75
|
-
-
|
|
76
|
-
-
|
|
108
|
+
- A static list has no pattern in the ARIA Authoring Practices, which cover interactive collections such as Listbox and Grid. slList follows HTML and the ARIA roles model.
|
|
109
|
+
- role="list" is written on the root and on every nested group. It is not redundant: slList draws its own marker, and Safari with VoiceOver drops list semantics when CSS removes the native one. A role written on the element, such as menu or listbox, is kept.
|
|
110
|
+
- The directive goes on the ul or ol you write, because the element carries the reading order. React renders the element from an ordered prop instead.
|
|
111
|
+
- A group is an li that holds a heading and a nested list, and the nested list is named by that heading through aria-labelledby. The heading keeps the level the document needs, because slListSectionLabel goes on the element you write.
|
|
112
|
+
- loading writes aria-busy on the list, which ARIA 1.2 asks of a container whose content has not arrived. slList draws no spinner and no placeholder; slSkeleton goes inside the rows.
|
|
113
|
+
- The empty message is an li inside the list. Outside the list, a screen reader announces a list of zero items and reads nothing more, and the words fall outside the frame of a framed list.
|
|
114
|
+
- slList binds no key. Every control a row holds is in the page tab sequence, so Tab and Shift+Tab move between them. Arrow keys, Home, End and typeahead belong to Listbox and Table.
|
|
115
|
+
- slList holds no value a consumer can own, so it declares no model and emits no output. A row paints a selection with selected, and the slCheckbox composed into the row announces it.
|
|
77
116
|
|
|
78
117
|
## Tokens
|
|
79
118
|
|
|
@@ -81,107 +120,4 @@ Excerpt — not a complete module
|
|
|
81
120
|
|
|
82
121
|
## Examples
|
|
83
122
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Four words, and they are accordion’s four so that two families cannot mean different things by one of them. Only separated spends a gap; the other three separate with a line or with nothing.
|
|
87
|
-
|
|
88
|
-
Excerpt — not a complete module
|
|
89
|
-
|
|
90
|
-
```html
|
|
91
|
-
<ul slList variant="plain"></ul>
|
|
92
|
-
<ul slList variant="ruled"></ul>
|
|
93
|
-
<ul slList variant="framed"></ul>
|
|
94
|
-
<ul slList variant="separated"></ul>
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### The mark, and the order
|
|
98
|
-
|
|
99
|
-
The element carries the reading order and the input carries the painted mark, which is why an ordered set can paint its own badges and still read in order. The bullet is drawn geometry rather than a character.
|
|
100
|
-
|
|
101
|
-
Excerpt — not a complete module
|
|
102
|
-
|
|
103
|
-
```html
|
|
104
|
-
<ul slList marker="bullet"></ul>
|
|
105
|
-
<ol slList marker="number"></ol>
|
|
106
|
-
<ol slList></ol>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Groups
|
|
110
|
-
|
|
111
|
-
A group is an li holding a heading and a nested list, and the nested list names itself by that heading. The heading keeps whatever level the document needs, because the directive goes on the page own element.
|
|
112
|
-
|
|
113
|
-
Excerpt — not a complete module
|
|
114
|
-
|
|
115
|
-
```html
|
|
116
|
-
<li slListSection>
|
|
117
|
-
<h3 slListSectionLabel sticky>Folders</h3>
|
|
118
|
-
<ul slListSectionList>
|
|
119
|
-
<ng-container [ngTemplateOutlet]="folderRows" />
|
|
120
|
-
</ul>
|
|
121
|
-
</li>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### A set inside a padded box
|
|
125
|
-
|
|
126
|
-
inset takes the rows inline padding away so the titles line up with the box around them. The rule and the hover fill still run edge to edge, which is the half disableGutters leaves out elsewhere.
|
|
127
|
-
|
|
128
|
-
Excerpt — not a complete module
|
|
129
|
-
|
|
130
|
-
```html
|
|
131
|
-
<ul slList inset variant="ruled" aria-label="Members">
|
|
132
|
-
<ng-container [ngTemplateOutlet]="memberRows" />
|
|
133
|
-
</ul>
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Loading, and empty
|
|
137
|
-
|
|
138
|
-
loading writes aria-busy and draws nothing: slSkeleton stands in for the rows. The empty message is an li inside the set, so a reader hears it rather than hearing zero items and then silence.
|
|
139
|
-
|
|
140
|
-
Excerpt — not a complete module
|
|
141
|
-
|
|
142
|
-
```html
|
|
143
|
-
<ul slList loading variant="ruled" aria-label="Folders"></ul>
|
|
144
|
-
<ul slList variant="framed" aria-label="Results">
|
|
145
|
-
<li slListEmpty>No matches</li>
|
|
146
|
-
</ul>
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Content the family did not choose
|
|
150
|
-
|
|
151
|
-
A page of a larger set says where the reader is with position and setSize, and only then. A set in another script mirrors its marker column, its inset and its metadata, because every rule is a logical property.
|
|
152
|
-
|
|
153
|
-
Excerpt — not a complete module
|
|
154
|
-
|
|
155
|
-
```html
|
|
156
|
-
<ul slList variant="ruled" aria-label="Results 41 to 43 of 128">
|
|
157
|
-
<li slListItem [position]="41" [setSize]="128"></li>
|
|
158
|
-
</ul>
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### The families beside it
|
|
162
|
-
|
|
163
|
-
The set supplies the box and the rhythm. slCheckbox announces the selection a row paints, slBadge carries a count, and the rows answer their own width while the set does not.
|
|
164
|
-
|
|
165
|
-
Excerpt — not a complete module
|
|
166
|
-
|
|
167
|
-
```ts
|
|
168
|
-
bootstrapApplication(App, {
|
|
169
|
-
providers: [provideListDefaults({ size: 'sm', variant: 'ruled' })],
|
|
170
|
-
});
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### The role, and the landmark
|
|
174
|
-
|
|
175
|
-
The family writes role="list" because it draws its own marker, and reads a role the page wrote with HostAttributeToken before the binding runs. A nav is the page decision, so the family writes none.
|
|
176
|
-
|
|
177
|
-
Excerpt — not a complete module
|
|
178
|
-
|
|
179
|
-
```html
|
|
180
|
-
<nav aria-label="Sections">
|
|
181
|
-
<ul slList>
|
|
182
|
-
<li slListItem current="page">
|
|
183
|
-
<a slListItemContent href="/billing">Billing</a>
|
|
184
|
-
</li>
|
|
185
|
-
</ul>
|
|
186
|
-
</nav>
|
|
187
|
-
```
|
|
123
|
+
See [list.examples.md](./list.examples.md).
|