@firstprateek/vastu 0.0.0-stage → 1.1.0
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/LICENSE +15 -0
- package/README.md +52 -2
- package/custom-elements.json +3737 -0
- package/dist/dev/all.d.ts +12 -0
- package/dist/dev/all.d.ts.map +1 -0
- package/dist/dev/all.js +13 -0
- package/dist/dev/all.js.map +1 -0
- package/dist/dev/bar-chart/bar-chart.d.ts +63 -0
- package/dist/dev/bar-chart/bar-chart.d.ts.map +1 -0
- package/dist/dev/bar-chart/bar-chart.js +316 -0
- package/dist/dev/bar-chart/bar-chart.js.map +1 -0
- package/dist/dev/bar-chart/index.d.ts +3 -0
- package/dist/dev/bar-chart/index.d.ts.map +1 -0
- package/dist/dev/bar-chart/index.js +5 -0
- package/dist/dev/bar-chart/index.js.map +1 -0
- package/dist/dev/button/button.d.ts +98 -0
- package/dist/dev/button/button.d.ts.map +1 -0
- package/dist/dev/button/button.js +292 -0
- package/dist/dev/button/button.js.map +1 -0
- package/dist/dev/button/index.d.ts +4 -0
- package/dist/dev/button/index.d.ts.map +1 -0
- package/dist/dev/button/index.js +5 -0
- package/dist/dev/button/index.js.map +1 -0
- package/dist/dev/checkbox/checkbox.d.ts +71 -0
- package/dist/dev/checkbox/checkbox.d.ts.map +1 -0
- package/dist/dev/checkbox/checkbox.js +232 -0
- package/dist/dev/checkbox/checkbox.js.map +1 -0
- package/dist/dev/checkbox/index.d.ts +3 -0
- package/dist/dev/checkbox/index.d.ts.map +1 -0
- package/dist/dev/checkbox/index.js +5 -0
- package/dist/dev/checkbox/index.js.map +1 -0
- package/dist/dev/core/cssom.d.ts +15 -0
- package/dist/dev/core/cssom.d.ts.map +1 -0
- package/dist/dev/core/cssom.js +30 -0
- package/dist/dev/core/cssom.js.map +1 -0
- package/dist/dev/core/define.d.ts +3 -0
- package/dist/dev/core/define.d.ts.map +1 -0
- package/dist/dev/core/define.js +6 -0
- package/dist/dev/core/define.js.map +1 -0
- package/dist/dev/core/dev-mode.d.ts +6 -0
- package/dist/dev/core/dev-mode.d.ts.map +1 -0
- package/dist/dev/core/dev-mode.js +6 -0
- package/dist/dev/core/dev-mode.js.map +1 -0
- package/dist/dev/core/focus-ring.d.ts +3 -0
- package/dist/dev/core/focus-ring.d.ts.map +1 -0
- package/dist/dev/core/focus-ring.js +14 -0
- package/dist/dev/core/focus-ring.js.map +1 -0
- package/dist/dev/core/form-control.d.ts +47 -0
- package/dist/dev/core/form-control.d.ts.map +1 -0
- package/dist/dev/core/form-control.js +75 -0
- package/dist/dev/core/form-control.js.map +1 -0
- package/dist/dev/core/warn.d.ts +12 -0
- package/dist/dev/core/warn.d.ts.map +1 -0
- package/dist/dev/core/warn.js +35 -0
- package/dist/dev/core/warn.js.map +1 -0
- package/dist/dev/dialog/dialog.d.ts +77 -0
- package/dist/dev/dialog/dialog.d.ts.map +1 -0
- package/dist/dev/dialog/dialog.js +253 -0
- package/dist/dev/dialog/dialog.js.map +1 -0
- package/dist/dev/dialog/index.d.ts +4 -0
- package/dist/dev/dialog/index.d.ts.map +1 -0
- package/dist/dev/dialog/index.js +5 -0
- package/dist/dev/dialog/index.js.map +1 -0
- package/dist/dev/menu/index.d.ts +3 -0
- package/dist/dev/menu/index.d.ts.map +1 -0
- package/dist/dev/menu/index.js +5 -0
- package/dist/dev/menu/index.js.map +1 -0
- package/dist/dev/menu/menu.d.ts +71 -0
- package/dist/dev/menu/menu.d.ts.map +1 -0
- package/dist/dev/menu/menu.js +330 -0
- package/dist/dev/menu/menu.js.map +1 -0
- package/dist/dev/navbar/index.d.ts +3 -0
- package/dist/dev/navbar/index.d.ts.map +1 -0
- package/dist/dev/navbar/index.js +5 -0
- package/dist/dev/navbar/index.js.map +1 -0
- package/dist/dev/navbar/navbar.d.ts +69 -0
- package/dist/dev/navbar/navbar.d.ts.map +1 -0
- package/dist/dev/navbar/navbar.js +353 -0
- package/dist/dev/navbar/navbar.js.map +1 -0
- package/dist/dev/poll/index.d.ts +3 -0
- package/dist/dev/poll/index.d.ts.map +1 -0
- package/dist/dev/poll/index.js +5 -0
- package/dist/dev/poll/index.js.map +1 -0
- package/dist/dev/poll/poll.d.ts +67 -0
- package/dist/dev/poll/poll.d.ts.map +1 -0
- package/dist/dev/poll/poll.js +301 -0
- package/dist/dev/poll/poll.js.map +1 -0
- package/dist/dev/switch/index.d.ts +3 -0
- package/dist/dev/switch/index.d.ts.map +1 -0
- package/dist/dev/switch/index.js +5 -0
- package/dist/dev/switch/index.js.map +1 -0
- package/dist/dev/switch/switch.d.ts +69 -0
- package/dist/dev/switch/switch.d.ts.map +1 -0
- package/dist/dev/switch/switch.js +213 -0
- package/dist/dev/switch/switch.js.map +1 -0
- package/dist/dev/tabs/index.d.ts +3 -0
- package/dist/dev/tabs/index.d.ts.map +1 -0
- package/dist/dev/tabs/index.js +5 -0
- package/dist/dev/tabs/index.js.map +1 -0
- package/dist/dev/tabs/tabs.d.ts +64 -0
- package/dist/dev/tabs/tabs.d.ts.map +1 -0
- package/dist/dev/tabs/tabs.js +212 -0
- package/dist/dev/tabs/tabs.js.map +1 -0
- package/dist/dev/text-field/index.d.ts +3 -0
- package/dist/dev/text-field/index.d.ts.map +1 -0
- package/dist/dev/text-field/index.js +5 -0
- package/dist/dev/text-field/index.js.map +1 -0
- package/dist/dev/text-field/text-field.d.ts +91 -0
- package/dist/dev/text-field/text-field.d.ts.map +1 -0
- package/dist/dev/text-field/text-field.js +267 -0
- package/dist/dev/text-field/text-field.js.map +1 -0
- package/dist/dev/toast/index.d.ts +4 -0
- package/dist/dev/toast/index.d.ts.map +1 -0
- package/dist/dev/toast/index.js +5 -0
- package/dist/dev/toast/index.js.map +1 -0
- package/dist/dev/toast/toast.d.ts +71 -0
- package/dist/dev/toast/toast.d.ts.map +1 -0
- package/dist/dev/toast/toast.js +258 -0
- package/dist/dev/toast/toast.js.map +1 -0
- package/dist/prod/all.js +13 -0
- package/dist/prod/bar-chart/bar-chart.js +316 -0
- package/dist/prod/bar-chart/index.js +5 -0
- package/dist/prod/button/button.js +292 -0
- package/dist/prod/button/index.js +5 -0
- package/dist/prod/checkbox/checkbox.js +232 -0
- package/dist/prod/checkbox/index.js +5 -0
- package/dist/prod/core/cssom.js +30 -0
- package/dist/prod/core/define.js +6 -0
- package/dist/prod/core/dev-mode.js +1 -0
- package/dist/prod/core/focus-ring.js +14 -0
- package/dist/prod/core/form-control.js +75 -0
- package/dist/prod/core/warn.js +2 -0
- package/dist/prod/dialog/dialog.js +253 -0
- package/dist/prod/dialog/index.js +5 -0
- package/dist/prod/menu/index.js +5 -0
- package/dist/prod/menu/menu.js +330 -0
- package/dist/prod/navbar/index.js +5 -0
- package/dist/prod/navbar/navbar.js +353 -0
- package/dist/prod/poll/index.js +5 -0
- package/dist/prod/poll/poll.js +301 -0
- package/dist/prod/switch/index.js +5 -0
- package/dist/prod/switch/switch.js +213 -0
- package/dist/prod/tabs/index.js +5 -0
- package/dist/prod/tabs/tabs.js +212 -0
- package/dist/prod/text-field/index.js +5 -0
- package/dist/prod/text-field/text-field.js +267 -0
- package/dist/prod/toast/index.js +5 -0
- package/dist/prod/toast/toast.js +258 -0
- package/package.json +110 -3
|
@@ -0,0 +1,3737 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/bar-chart/bar-chart.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "class",
|
|
11
|
+
"description": "A bar chart that compares values across a few categories. The data is plain markup, and the\nbars animate when it changes, so it can follow live values.",
|
|
12
|
+
"name": "VaBarChart",
|
|
13
|
+
"cssProperties": [
|
|
14
|
+
{
|
|
15
|
+
"type": {
|
|
16
|
+
"text": "<color>"
|
|
17
|
+
},
|
|
18
|
+
"description": "Colour of the bars.",
|
|
19
|
+
"name": "--va-bar-chart-bar-bg",
|
|
20
|
+
"x-applies": {
|
|
21
|
+
"part": "bar",
|
|
22
|
+
"property": "background-color"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": {
|
|
27
|
+
"text": "<length>"
|
|
28
|
+
},
|
|
29
|
+
"description": "Corner radius of the bars' outer end.",
|
|
30
|
+
"name": "--va-bar-chart-bar-radius",
|
|
31
|
+
"x-applies": {
|
|
32
|
+
"part": "bar",
|
|
33
|
+
"property": "border-top-left-radius"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": {
|
|
38
|
+
"text": "<length>"
|
|
39
|
+
},
|
|
40
|
+
"description": "Height of the plot area.",
|
|
41
|
+
"name": "--va-bar-chart-size",
|
|
42
|
+
"x-applies": {
|
|
43
|
+
"part": "plot",
|
|
44
|
+
"property": "height"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"cssParts": [
|
|
49
|
+
{
|
|
50
|
+
"description": "The chart's title.",
|
|
51
|
+
"name": "label"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"description": "The area the bars are drawn in.",
|
|
55
|
+
"name": "plot"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Each bar.",
|
|
59
|
+
"name": "bar"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"description": "The value labels along the left edge.",
|
|
63
|
+
"name": "axis"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"slots": [
|
|
67
|
+
{
|
|
68
|
+
"description": "The data, as `<data value=\"N\">Category</data>` elements, in order. Change them and the bars animate to the new values.",
|
|
69
|
+
"name": ""
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"members": [
|
|
73
|
+
{
|
|
74
|
+
"kind": "field",
|
|
75
|
+
"name": "label",
|
|
76
|
+
"privacy": "public",
|
|
77
|
+
"type": {
|
|
78
|
+
"text": "string"
|
|
79
|
+
},
|
|
80
|
+
"description": "The chart's title, shown above it.",
|
|
81
|
+
"default": "''",
|
|
82
|
+
"attribute": "label"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "field",
|
|
86
|
+
"name": "max",
|
|
87
|
+
"privacy": "public",
|
|
88
|
+
"type": {
|
|
89
|
+
"text": "number"
|
|
90
|
+
},
|
|
91
|
+
"description": "The top of the value axis. 0 (the default) fits the axis to the data; set it to keep the scale steady while live values change.",
|
|
92
|
+
"default": "0",
|
|
93
|
+
"attribute": "max"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"attributes": [
|
|
97
|
+
{
|
|
98
|
+
"name": "label",
|
|
99
|
+
"type": {
|
|
100
|
+
"text": "string"
|
|
101
|
+
},
|
|
102
|
+
"description": "The chart's title, shown above it.",
|
|
103
|
+
"default": "''",
|
|
104
|
+
"fieldName": "label"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "max",
|
|
108
|
+
"type": {
|
|
109
|
+
"text": "number"
|
|
110
|
+
},
|
|
111
|
+
"description": "The top of the value axis. 0 (the default) fits the axis to the data; set it to keep the scale steady while live values change.",
|
|
112
|
+
"default": "0",
|
|
113
|
+
"fieldName": "max"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"superclass": {
|
|
117
|
+
"name": "LitElement",
|
|
118
|
+
"package": "lit"
|
|
119
|
+
},
|
|
120
|
+
"tagName": "va-bar-chart",
|
|
121
|
+
"customElement": true,
|
|
122
|
+
"summary": "Compares a number across a few categories, one bar per category.",
|
|
123
|
+
"x-keyboard": [
|
|
124
|
+
{
|
|
125
|
+
"context": "items",
|
|
126
|
+
"key": "ArrowRight",
|
|
127
|
+
"action": "next",
|
|
128
|
+
"description": "Moves to the next bar, wrapping round."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"context": "items",
|
|
132
|
+
"key": "ArrowLeft",
|
|
133
|
+
"action": "previous",
|
|
134
|
+
"description": "Moves to the previous bar, wrapping round."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"context": "items",
|
|
138
|
+
"key": "Home",
|
|
139
|
+
"action": "first",
|
|
140
|
+
"description": "Moves to the first bar."
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"context": "items",
|
|
144
|
+
"key": "End",
|
|
145
|
+
"action": "last",
|
|
146
|
+
"description": "Moves to the last bar."
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"x-keyboard-items": "data",
|
|
150
|
+
"x-a11y": {
|
|
151
|
+
"notes": [
|
|
152
|
+
"Each `<data>` element is in the Tab order once (roving tabindex) and is announced as \"Category: value\". Arrow keys move between bars.",
|
|
153
|
+
"The value axis is hidden from assistive technology, because every bar announces its own value."
|
|
154
|
+
],
|
|
155
|
+
"role": "figure",
|
|
156
|
+
"nameFrom": [
|
|
157
|
+
"label"
|
|
158
|
+
],
|
|
159
|
+
"name": "The `label`, which is the chart's visible title."
|
|
160
|
+
},
|
|
161
|
+
"x-guidance": {
|
|
162
|
+
"use": "To compare one number across a few categories (up to about 12), such as visitors per day or sales per region.",
|
|
163
|
+
"avoid": "For trends over many points in time, for parts of a whole, or when readers need to look up exact values.",
|
|
164
|
+
"instead": "A line chart for trends; a table when exact values matter."
|
|
165
|
+
},
|
|
166
|
+
"events": [],
|
|
167
|
+
"x-examples": [
|
|
168
|
+
{
|
|
169
|
+
"title": "Visitors per day",
|
|
170
|
+
"description": "Each bar is a <data> element: value is the number and the text is the category. Change the elements and the bars animate to the new values.",
|
|
171
|
+
"path": "src/bar-chart/examples/1-per-day.html",
|
|
172
|
+
"code": "<va-bar-chart label=\"Visitors per day\">\n <data value=\"120\">Mon</data>\n <data value=\"98\">Tue</data>\n <data value=\"143\">Wed</data>\n <data value=\"87\">Thu</data>\n <data value=\"164\">Fri</data>\n <data value=\"61\">Sat</data>\n <data value=\"45\">Sun</data>\n</va-bar-chart>"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"title": "A fixed scale",
|
|
176
|
+
"description": "max fixes the top of the axis, so the scale stays steady while live values change. Here every value is a percentage.",
|
|
177
|
+
"path": "src/bar-chart/examples/2-fixed-scale.html",
|
|
178
|
+
"code": "<va-bar-chart label=\"Build success rate (%)\" max=\"100\">\n <data value=\"97\">Web</data>\n <data value=\"88\">iOS</data>\n <data value=\"91\">Android</data>\n <data value=\"99\">API</data>\n</va-bar-chart>"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"title": "Gains and losses",
|
|
182
|
+
"description": "Negative values hang below the zero line.",
|
|
183
|
+
"path": "src/bar-chart/examples/3-negative.html",
|
|
184
|
+
"code": "<va-bar-chart label=\"Change in sign-ups from last month\">\n <data value=\"42\">North</data>\n <data value=\"-18\">South</data>\n <data value=\"7\">East</data>\n <data value=\"-5\">West</data>\n</va-bar-chart>"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"exports": [
|
|
190
|
+
{
|
|
191
|
+
"kind": "js",
|
|
192
|
+
"name": "VaBarChart",
|
|
193
|
+
"declaration": {
|
|
194
|
+
"name": "VaBarChart",
|
|
195
|
+
"module": "src/bar-chart/bar-chart.ts"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"kind": "javascript-module",
|
|
202
|
+
"path": "src/button/button.ts",
|
|
203
|
+
"declarations": [
|
|
204
|
+
{
|
|
205
|
+
"kind": "class",
|
|
206
|
+
"description": "A button that starts an action or submits a form.",
|
|
207
|
+
"name": "VaButton",
|
|
208
|
+
"cssProperties": [
|
|
209
|
+
{
|
|
210
|
+
"type": {
|
|
211
|
+
"text": "<color>"
|
|
212
|
+
},
|
|
213
|
+
"description": "Background colour.",
|
|
214
|
+
"name": "--va-button-bg",
|
|
215
|
+
"x-applies": {
|
|
216
|
+
"part": "control",
|
|
217
|
+
"property": "background-color"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"type": {
|
|
222
|
+
"text": "<color>"
|
|
223
|
+
},
|
|
224
|
+
"description": "Background colour on hover.",
|
|
225
|
+
"name": "--va-button-bg-hover",
|
|
226
|
+
"x-applies": {
|
|
227
|
+
"part": "control",
|
|
228
|
+
"state": "hover",
|
|
229
|
+
"property": "background-color"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"type": {
|
|
234
|
+
"text": "<color>"
|
|
235
|
+
},
|
|
236
|
+
"description": "Text and icon colour.",
|
|
237
|
+
"name": "--va-button-fg",
|
|
238
|
+
"x-applies": {
|
|
239
|
+
"part": "control",
|
|
240
|
+
"property": "color"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"type": {
|
|
245
|
+
"text": "<color>"
|
|
246
|
+
},
|
|
247
|
+
"description": "Border colour.",
|
|
248
|
+
"name": "--va-button-border",
|
|
249
|
+
"x-applies": {
|
|
250
|
+
"part": "control",
|
|
251
|
+
"property": "border-top-color"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"type": {
|
|
256
|
+
"text": "<length>"
|
|
257
|
+
},
|
|
258
|
+
"description": "Corner radius.",
|
|
259
|
+
"name": "--va-button-radius",
|
|
260
|
+
"x-applies": {
|
|
261
|
+
"part": "control",
|
|
262
|
+
"property": "border-top-left-radius"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"type": {
|
|
267
|
+
"text": "<length>"
|
|
268
|
+
},
|
|
269
|
+
"description": "Minimum height.",
|
|
270
|
+
"name": "--va-button-height",
|
|
271
|
+
"x-applies": {
|
|
272
|
+
"part": "control",
|
|
273
|
+
"property": "min-height"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"type": {
|
|
278
|
+
"text": "<length>"
|
|
279
|
+
},
|
|
280
|
+
"description": "Space before and after the text.",
|
|
281
|
+
"name": "--va-button-padding-inline",
|
|
282
|
+
"x-applies": {
|
|
283
|
+
"part": "control",
|
|
284
|
+
"property": "padding-left"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"type": {
|
|
289
|
+
"text": "<length>"
|
|
290
|
+
},
|
|
291
|
+
"description": "Text size.",
|
|
292
|
+
"name": "--va-button-font-size",
|
|
293
|
+
"x-applies": {
|
|
294
|
+
"part": "control",
|
|
295
|
+
"property": "font-size"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"cssParts": [
|
|
300
|
+
{
|
|
301
|
+
"description": "The native button inside.",
|
|
302
|
+
"name": "control"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"description": "The wrapper around the text.",
|
|
306
|
+
"name": "label"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"slots": [
|
|
310
|
+
{
|
|
311
|
+
"description": "The button's text. This is its accessible name.",
|
|
312
|
+
"name": ""
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"description": "An icon before the text. Mark decorative icons `aria-hidden=\"true\"`.",
|
|
316
|
+
"name": "start"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"description": "An icon after the text.",
|
|
320
|
+
"name": "end"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"members": [
|
|
324
|
+
{
|
|
325
|
+
"kind": "field",
|
|
326
|
+
"name": "variant",
|
|
327
|
+
"privacy": "public",
|
|
328
|
+
"type": {
|
|
329
|
+
"text": "'primary' | 'secondary' | 'ghost' | 'danger'"
|
|
330
|
+
},
|
|
331
|
+
"description": "Visual emphasis. Use one `primary` button per view.",
|
|
332
|
+
"default": "'primary'",
|
|
333
|
+
"attribute": "variant",
|
|
334
|
+
"reflects": true
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"kind": "field",
|
|
338
|
+
"name": "size",
|
|
339
|
+
"privacy": "public",
|
|
340
|
+
"type": {
|
|
341
|
+
"text": "'sm' | 'md' | 'lg'"
|
|
342
|
+
},
|
|
343
|
+
"description": "Height and text size. Every size meets the 24px WCAG 2.2 target size.",
|
|
344
|
+
"default": "'md'",
|
|
345
|
+
"attribute": "size",
|
|
346
|
+
"reflects": true
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"kind": "field",
|
|
350
|
+
"name": "type",
|
|
351
|
+
"privacy": "public",
|
|
352
|
+
"type": {
|
|
353
|
+
"text": "'button' | 'submit' | 'reset'"
|
|
354
|
+
},
|
|
355
|
+
"description": "What the button does in a form. Defaults to `button`, unlike the native `<button>`,\nso a button never submits a form by accident. Set `type=\"submit\"` to submit.",
|
|
356
|
+
"default": "'button'",
|
|
357
|
+
"attribute": "type",
|
|
358
|
+
"reflects": true
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"kind": "field",
|
|
362
|
+
"name": "disabled",
|
|
363
|
+
"privacy": "public",
|
|
364
|
+
"type": {
|
|
365
|
+
"text": "boolean"
|
|
366
|
+
},
|
|
367
|
+
"description": "Disables the button. It cannot be focused or activated.",
|
|
368
|
+
"default": "false",
|
|
369
|
+
"attribute": "disabled",
|
|
370
|
+
"reflects": true
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"kind": "field",
|
|
374
|
+
"name": "loading",
|
|
375
|
+
"privacy": "public",
|
|
376
|
+
"type": {
|
|
377
|
+
"text": "boolean"
|
|
378
|
+
},
|
|
379
|
+
"description": "Shows a spinner and blocks activation, but keeps the button focusable.",
|
|
380
|
+
"default": "false",
|
|
381
|
+
"attribute": "loading",
|
|
382
|
+
"reflects": true
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"kind": "field",
|
|
386
|
+
"name": "name",
|
|
387
|
+
"privacy": "public",
|
|
388
|
+
"type": {
|
|
389
|
+
"text": "string"
|
|
390
|
+
},
|
|
391
|
+
"description": "Submitted with the form as `name=value` when this button submits it.",
|
|
392
|
+
"default": "''",
|
|
393
|
+
"attribute": "name"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"kind": "field",
|
|
397
|
+
"name": "value",
|
|
398
|
+
"privacy": "public",
|
|
399
|
+
"type": {
|
|
400
|
+
"text": "string"
|
|
401
|
+
},
|
|
402
|
+
"description": "Submitted with `name` when this button submits the form.",
|
|
403
|
+
"default": "''",
|
|
404
|
+
"attribute": "value"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"kind": "field",
|
|
408
|
+
"name": "accessibleLabel",
|
|
409
|
+
"privacy": "public",
|
|
410
|
+
"type": {
|
|
411
|
+
"text": "string"
|
|
412
|
+
},
|
|
413
|
+
"description": "Accessible name for a button with no text, such as an icon-only button. Not shown.",
|
|
414
|
+
"default": "''",
|
|
415
|
+
"attribute": "accessible-label"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"kind": "field",
|
|
419
|
+
"name": "commandfor",
|
|
420
|
+
"privacy": "public",
|
|
421
|
+
"type": {
|
|
422
|
+
"text": "string"
|
|
423
|
+
},
|
|
424
|
+
"description": "The id of the element this button sends `command` to, as with the native Invoker Commands API.\nFor example `commandfor=\"confirm\" command=\"--show\"` opens `<va-dialog id=\"confirm\">`.",
|
|
425
|
+
"default": "''",
|
|
426
|
+
"attribute": "commandfor"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"kind": "field",
|
|
430
|
+
"name": "command",
|
|
431
|
+
"privacy": "public",
|
|
432
|
+
"type": {
|
|
433
|
+
"text": "string"
|
|
434
|
+
},
|
|
435
|
+
"description": "The command sent to the `commandfor` element on click, such as `--show` or `--close`.",
|
|
436
|
+
"default": "''",
|
|
437
|
+
"attribute": "command"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"kind": "field",
|
|
441
|
+
"name": "form",
|
|
442
|
+
"type": {
|
|
443
|
+
"text": "HTMLFormElement | null"
|
|
444
|
+
},
|
|
445
|
+
"description": "The form this button belongs to, if any.",
|
|
446
|
+
"readonly": true
|
|
447
|
+
}
|
|
448
|
+
],
|
|
449
|
+
"events": [
|
|
450
|
+
{
|
|
451
|
+
"description": "The native click event. Not fired while `disabled` or `loading`.",
|
|
452
|
+
"name": "click",
|
|
453
|
+
"x-trigger": {
|
|
454
|
+
"how": "click"
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
"attributes": [
|
|
459
|
+
{
|
|
460
|
+
"name": "variant",
|
|
461
|
+
"type": {
|
|
462
|
+
"text": "'primary' | 'secondary' | 'ghost' | 'danger'"
|
|
463
|
+
},
|
|
464
|
+
"description": "Visual emphasis. Use one `primary` button per view.",
|
|
465
|
+
"default": "'primary'",
|
|
466
|
+
"fieldName": "variant"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"name": "size",
|
|
470
|
+
"type": {
|
|
471
|
+
"text": "'sm' | 'md' | 'lg'"
|
|
472
|
+
},
|
|
473
|
+
"description": "Height and text size. Every size meets the 24px WCAG 2.2 target size.",
|
|
474
|
+
"default": "'md'",
|
|
475
|
+
"fieldName": "size"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "type",
|
|
479
|
+
"type": {
|
|
480
|
+
"text": "'button' | 'submit' | 'reset'"
|
|
481
|
+
},
|
|
482
|
+
"description": "What the button does in a form. Defaults to `button`, unlike the native `<button>`,\nso a button never submits a form by accident. Set `type=\"submit\"` to submit.",
|
|
483
|
+
"default": "'button'",
|
|
484
|
+
"fieldName": "type"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"name": "disabled",
|
|
488
|
+
"type": {
|
|
489
|
+
"text": "boolean"
|
|
490
|
+
},
|
|
491
|
+
"description": "Disables the button. It cannot be focused or activated.",
|
|
492
|
+
"default": "false",
|
|
493
|
+
"fieldName": "disabled"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "loading",
|
|
497
|
+
"type": {
|
|
498
|
+
"text": "boolean"
|
|
499
|
+
},
|
|
500
|
+
"description": "Shows a spinner and blocks activation, but keeps the button focusable.",
|
|
501
|
+
"default": "false",
|
|
502
|
+
"fieldName": "loading"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "name",
|
|
506
|
+
"type": {
|
|
507
|
+
"text": "string"
|
|
508
|
+
},
|
|
509
|
+
"description": "Submitted with the form as `name=value` when this button submits it.",
|
|
510
|
+
"default": "''",
|
|
511
|
+
"fieldName": "name"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "value",
|
|
515
|
+
"type": {
|
|
516
|
+
"text": "string"
|
|
517
|
+
},
|
|
518
|
+
"description": "Submitted with `name` when this button submits the form.",
|
|
519
|
+
"default": "''",
|
|
520
|
+
"fieldName": "value"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"name": "accessible-label",
|
|
524
|
+
"type": {
|
|
525
|
+
"text": "string"
|
|
526
|
+
},
|
|
527
|
+
"description": "Accessible name for a button with no text, such as an icon-only button. Not shown.",
|
|
528
|
+
"default": "''",
|
|
529
|
+
"fieldName": "accessibleLabel"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "commandfor",
|
|
533
|
+
"type": {
|
|
534
|
+
"text": "string"
|
|
535
|
+
},
|
|
536
|
+
"description": "The id of the element this button sends `command` to, as with the native Invoker Commands API.\nFor example `commandfor=\"confirm\" command=\"--show\"` opens `<va-dialog id=\"confirm\">`.",
|
|
537
|
+
"default": "''",
|
|
538
|
+
"fieldName": "commandfor"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "command",
|
|
542
|
+
"type": {
|
|
543
|
+
"text": "string"
|
|
544
|
+
},
|
|
545
|
+
"description": "The command sent to the `commandfor` element on click, such as `--show` or `--close`.",
|
|
546
|
+
"default": "''",
|
|
547
|
+
"fieldName": "command"
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
"superclass": {
|
|
551
|
+
"name": "LitElement",
|
|
552
|
+
"package": "lit"
|
|
553
|
+
},
|
|
554
|
+
"tagName": "va-button",
|
|
555
|
+
"customElement": true,
|
|
556
|
+
"summary": "Starts an action, or submits or resets the form it is in.",
|
|
557
|
+
"x-keyboard": [
|
|
558
|
+
{
|
|
559
|
+
"context": "host",
|
|
560
|
+
"key": "Enter",
|
|
561
|
+
"action": "activates",
|
|
562
|
+
"description": "Activates the button."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"context": "host",
|
|
566
|
+
"key": "Space",
|
|
567
|
+
"action": "activates",
|
|
568
|
+
"description": "Activates the button."
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"context": "host",
|
|
572
|
+
"key": "Tab",
|
|
573
|
+
"action": "focus-next",
|
|
574
|
+
"description": "Moves focus to the next control. A disabled button is skipped."
|
|
575
|
+
}
|
|
576
|
+
],
|
|
577
|
+
"x-a11y": {
|
|
578
|
+
"notes": [
|
|
579
|
+
"`loading` keeps the button focusable, sets `aria-disabled` and `aria-busy`, and adds \"Loading\" to its name."
|
|
580
|
+
],
|
|
581
|
+
"role": "button",
|
|
582
|
+
"nameFrom": [
|
|
583
|
+
"text",
|
|
584
|
+
"accessible-label"
|
|
585
|
+
],
|
|
586
|
+
"name": "The slotted text. A button with only an icon must have `accessible-label`."
|
|
587
|
+
},
|
|
588
|
+
"x-guidance": {
|
|
589
|
+
"use": "For an action on the current page (Save, Delete, Open dialog) or to submit a form.",
|
|
590
|
+
"avoid": "For navigation to another page or URL.",
|
|
591
|
+
"instead": "A link (`<a href>`) for navigation."
|
|
592
|
+
},
|
|
593
|
+
"x-replaces": "button",
|
|
594
|
+
"x-examples": [
|
|
595
|
+
{
|
|
596
|
+
"title": "Variants",
|
|
597
|
+
"description": "One primary action per view; secondary and ghost for the rest; danger for destructive actions.",
|
|
598
|
+
"path": "src/button/examples/1-variants.html",
|
|
599
|
+
"code": "<va-button>Save changes</va-button>\n<va-button variant=\"secondary\">Cancel</va-button>\n<va-button variant=\"ghost\">Learn more</va-button>\n<va-button variant=\"danger\">Delete project</va-button>"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"title": "Sizes",
|
|
603
|
+
"description": "Every size meets the WCAG 2.2 target size of 24 by 24 pixels.",
|
|
604
|
+
"path": "src/button/examples/2-sizes.html",
|
|
605
|
+
"code": "<va-button size=\"sm\">Small</va-button>\n<va-button size=\"md\">Medium</va-button>\n<va-button size=\"lg\">Large</va-button>"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"title": "Disabled and loading",
|
|
609
|
+
"description": "Disabled buttons can't be focused. Loading buttons stay focusable, so the user keeps their place.",
|
|
610
|
+
"path": "src/button/examples/3-states.html",
|
|
611
|
+
"code": "<va-button disabled>Disabled</va-button>\n<va-button loading>Saving</va-button>\n<va-button variant=\"secondary\" disabled>Disabled</va-button>"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"title": "With icons",
|
|
615
|
+
"description": "Decorative icons are aria-hidden. An icon-only button needs accessible-label.",
|
|
616
|
+
"path": "src/button/examples/4-icons.html",
|
|
617
|
+
"code": "<va-button variant=\"secondary\">\n <svg slot=\"start\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 5v14M5 12h14\"/></svg>\n New article\n</va-button>\n<va-button variant=\"ghost\" accessible-label=\"Close\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M6 6l12 12M18 6L6 18\"/></svg>\n</va-button>"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"title": "In a form",
|
|
621
|
+
"description": "type=\"submit\" submits the form with name=value; the default type=\"button\" never submits.",
|
|
622
|
+
"path": "src/button/examples/5-form.html",
|
|
623
|
+
"code": "<form>\n <va-text-field label=\"Email\" name=\"email\" type=\"email\" value=\"ada@example.com\"></va-text-field>\n <va-button type=\"submit\" name=\"intent\" value=\"subscribe\">Subscribe</va-button>\n <va-button type=\"reset\" variant=\"secondary\">Reset</va-button>\n</form>"
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
"exports": [
|
|
629
|
+
{
|
|
630
|
+
"kind": "js",
|
|
631
|
+
"name": "VaButton",
|
|
632
|
+
"declaration": {
|
|
633
|
+
"name": "VaButton",
|
|
634
|
+
"module": "src/button/button.ts"
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"kind": "javascript-module",
|
|
641
|
+
"path": "src/checkbox/checkbox.ts",
|
|
642
|
+
"declarations": [
|
|
643
|
+
{
|
|
644
|
+
"kind": "class",
|
|
645
|
+
"description": "A checkbox for a choice that is submitted with a form.",
|
|
646
|
+
"name": "VaCheckbox",
|
|
647
|
+
"cssProperties": [
|
|
648
|
+
{
|
|
649
|
+
"type": {
|
|
650
|
+
"text": "<color>"
|
|
651
|
+
},
|
|
652
|
+
"description": "Border colour of the box when unchecked.",
|
|
653
|
+
"name": "--va-checkbox-border",
|
|
654
|
+
"x-applies": {
|
|
655
|
+
"part": "control",
|
|
656
|
+
"state": "unchecked",
|
|
657
|
+
"property": "border-top-color"
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"type": {
|
|
662
|
+
"text": "<color>"
|
|
663
|
+
},
|
|
664
|
+
"description": "Fill and border colour when checked or indeterminate.",
|
|
665
|
+
"name": "--va-checkbox-bg-checked",
|
|
666
|
+
"x-applies": {
|
|
667
|
+
"part": "control",
|
|
668
|
+
"state": "checked",
|
|
669
|
+
"property": "background-color"
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"type": {
|
|
674
|
+
"text": "<color>"
|
|
675
|
+
},
|
|
676
|
+
"description": "Colour of the tick or dash.",
|
|
677
|
+
"name": "--va-checkbox-mark-fg",
|
|
678
|
+
"x-applies": {
|
|
679
|
+
"part": "control",
|
|
680
|
+
"state": "checked",
|
|
681
|
+
"property": "color"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"type": {
|
|
686
|
+
"text": "<length>"
|
|
687
|
+
},
|
|
688
|
+
"description": "Width and height of the box.",
|
|
689
|
+
"name": "--va-checkbox-size",
|
|
690
|
+
"x-applies": {
|
|
691
|
+
"part": "control",
|
|
692
|
+
"property": "width"
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
],
|
|
696
|
+
"cssParts": [
|
|
697
|
+
{
|
|
698
|
+
"description": "The square box.",
|
|
699
|
+
"name": "control"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"description": "The label text.",
|
|
703
|
+
"name": "label"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"description": "The help text.",
|
|
707
|
+
"name": "help-text"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
"slots": [
|
|
711
|
+
{
|
|
712
|
+
"description": "The visible label. Clicking it toggles the checkbox.",
|
|
713
|
+
"name": ""
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"description": "Optional help text under the label. It becomes the checkbox's description.",
|
|
717
|
+
"name": "help-text"
|
|
718
|
+
}
|
|
719
|
+
],
|
|
720
|
+
"members": [
|
|
721
|
+
{
|
|
722
|
+
"kind": "field",
|
|
723
|
+
"name": "checked",
|
|
724
|
+
"privacy": "public",
|
|
725
|
+
"type": {
|
|
726
|
+
"text": "boolean"
|
|
727
|
+
},
|
|
728
|
+
"description": "Whether the box is checked. The `checked` attribute sets the initial state, as on a native checkbox.",
|
|
729
|
+
"default": "false",
|
|
730
|
+
"attribute": "checked"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"kind": "field",
|
|
734
|
+
"name": "indeterminate",
|
|
735
|
+
"privacy": "public",
|
|
736
|
+
"type": {
|
|
737
|
+
"text": "boolean"
|
|
738
|
+
},
|
|
739
|
+
"description": "Shows a dash for a partly selected group. Cleared when the user toggles the box.",
|
|
740
|
+
"default": "false",
|
|
741
|
+
"attribute": "indeterminate"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"kind": "field",
|
|
745
|
+
"name": "value",
|
|
746
|
+
"privacy": "public",
|
|
747
|
+
"type": {
|
|
748
|
+
"text": "string"
|
|
749
|
+
},
|
|
750
|
+
"description": "Submitted with `name` while the box is checked. Defaults to `on`, as for a native checkbox.",
|
|
751
|
+
"default": "'on'",
|
|
752
|
+
"attribute": "value"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"kind": "field",
|
|
756
|
+
"name": "accessibleLabel",
|
|
757
|
+
"privacy": "public",
|
|
758
|
+
"type": {
|
|
759
|
+
"text": "string"
|
|
760
|
+
},
|
|
761
|
+
"description": "Accessible name for a checkbox with no visible label, such as one selecting a table row.",
|
|
762
|
+
"default": "''",
|
|
763
|
+
"attribute": "accessible-label"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"kind": "field",
|
|
767
|
+
"name": "name",
|
|
768
|
+
"privacy": "public",
|
|
769
|
+
"type": {
|
|
770
|
+
"text": "string"
|
|
771
|
+
},
|
|
772
|
+
"description": "Submitted with the form as `name=value`.",
|
|
773
|
+
"default": "''",
|
|
774
|
+
"attribute": "name",
|
|
775
|
+
"inheritedFrom": {
|
|
776
|
+
"name": "FormControl",
|
|
777
|
+
"module": "src/core/form-control.ts"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"kind": "field",
|
|
782
|
+
"name": "disabled",
|
|
783
|
+
"privacy": "public",
|
|
784
|
+
"type": {
|
|
785
|
+
"text": "boolean"
|
|
786
|
+
},
|
|
787
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
788
|
+
"default": "false",
|
|
789
|
+
"attribute": "disabled",
|
|
790
|
+
"reflects": true,
|
|
791
|
+
"inheritedFrom": {
|
|
792
|
+
"name": "FormControl",
|
|
793
|
+
"module": "src/core/form-control.ts"
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"kind": "field",
|
|
798
|
+
"name": "required",
|
|
799
|
+
"privacy": "public",
|
|
800
|
+
"type": {
|
|
801
|
+
"text": "boolean"
|
|
802
|
+
},
|
|
803
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
804
|
+
"default": "false",
|
|
805
|
+
"attribute": "required",
|
|
806
|
+
"reflects": true,
|
|
807
|
+
"inheritedFrom": {
|
|
808
|
+
"name": "FormControl",
|
|
809
|
+
"module": "src/core/form-control.ts"
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
"kind": "field",
|
|
814
|
+
"name": "form",
|
|
815
|
+
"type": {
|
|
816
|
+
"text": "HTMLFormElement | null"
|
|
817
|
+
},
|
|
818
|
+
"description": "The form this control belongs to, if any.",
|
|
819
|
+
"readonly": true,
|
|
820
|
+
"inheritedFrom": {
|
|
821
|
+
"name": "FormControl",
|
|
822
|
+
"module": "src/core/form-control.ts"
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"kind": "field",
|
|
827
|
+
"name": "validity",
|
|
828
|
+
"type": {
|
|
829
|
+
"text": "ValidityState"
|
|
830
|
+
},
|
|
831
|
+
"description": "The control's validity state, as on native controls.",
|
|
832
|
+
"readonly": true,
|
|
833
|
+
"inheritedFrom": {
|
|
834
|
+
"name": "FormControl",
|
|
835
|
+
"module": "src/core/form-control.ts"
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"kind": "field",
|
|
840
|
+
"name": "validationMessage",
|
|
841
|
+
"type": {
|
|
842
|
+
"text": "string"
|
|
843
|
+
},
|
|
844
|
+
"description": "The message the browser shows when the control is invalid, or an empty string.",
|
|
845
|
+
"readonly": true,
|
|
846
|
+
"inheritedFrom": {
|
|
847
|
+
"name": "FormControl",
|
|
848
|
+
"module": "src/core/form-control.ts"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"kind": "method",
|
|
853
|
+
"name": "checkValidity",
|
|
854
|
+
"return": {
|
|
855
|
+
"type": {
|
|
856
|
+
"text": "boolean"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
"description": "Returns true if the control is valid; otherwise fires `invalid` and returns false.",
|
|
860
|
+
"inheritedFrom": {
|
|
861
|
+
"name": "FormControl",
|
|
862
|
+
"module": "src/core/form-control.ts"
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"kind": "method",
|
|
867
|
+
"name": "reportValidity",
|
|
868
|
+
"return": {
|
|
869
|
+
"type": {
|
|
870
|
+
"text": "boolean"
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
"description": "Like `checkValidity()`, but also shows the browser's message to the user.",
|
|
874
|
+
"inheritedFrom": {
|
|
875
|
+
"name": "FormControl",
|
|
876
|
+
"module": "src/core/form-control.ts"
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
],
|
|
880
|
+
"events": [
|
|
881
|
+
{
|
|
882
|
+
"description": "When the user checks or unchecks the box. Read `event.target.checked`.",
|
|
883
|
+
"name": "change",
|
|
884
|
+
"x-trigger": {
|
|
885
|
+
"how": "click"
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"description": "When the user checks or unchecks the box, just before `change`.",
|
|
890
|
+
"name": "input",
|
|
891
|
+
"x-trigger": {
|
|
892
|
+
"how": "click"
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
],
|
|
896
|
+
"attributes": [
|
|
897
|
+
{
|
|
898
|
+
"name": "checked",
|
|
899
|
+
"type": {
|
|
900
|
+
"text": "boolean"
|
|
901
|
+
},
|
|
902
|
+
"description": "Whether the box is checked. The `checked` attribute sets the initial state, as on a native checkbox.",
|
|
903
|
+
"default": "false",
|
|
904
|
+
"fieldName": "checked"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
"name": "indeterminate",
|
|
908
|
+
"type": {
|
|
909
|
+
"text": "boolean"
|
|
910
|
+
},
|
|
911
|
+
"description": "Shows a dash for a partly selected group. Cleared when the user toggles the box.",
|
|
912
|
+
"default": "false",
|
|
913
|
+
"fieldName": "indeterminate"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"name": "value",
|
|
917
|
+
"type": {
|
|
918
|
+
"text": "string"
|
|
919
|
+
},
|
|
920
|
+
"description": "Submitted with `name` while the box is checked. Defaults to `on`, as for a native checkbox.",
|
|
921
|
+
"default": "'on'",
|
|
922
|
+
"fieldName": "value"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"name": "accessible-label",
|
|
926
|
+
"type": {
|
|
927
|
+
"text": "string"
|
|
928
|
+
},
|
|
929
|
+
"description": "Accessible name for a checkbox with no visible label, such as one selecting a table row.",
|
|
930
|
+
"default": "''",
|
|
931
|
+
"fieldName": "accessibleLabel"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
"name": "name",
|
|
935
|
+
"type": {
|
|
936
|
+
"text": "string"
|
|
937
|
+
},
|
|
938
|
+
"description": "Submitted with the form as `name=value`.",
|
|
939
|
+
"default": "''",
|
|
940
|
+
"fieldName": "name",
|
|
941
|
+
"inheritedFrom": {
|
|
942
|
+
"name": "FormControl",
|
|
943
|
+
"module": "src/core/form-control.ts"
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"name": "disabled",
|
|
948
|
+
"type": {
|
|
949
|
+
"text": "boolean"
|
|
950
|
+
},
|
|
951
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
952
|
+
"default": "false",
|
|
953
|
+
"fieldName": "disabled",
|
|
954
|
+
"inheritedFrom": {
|
|
955
|
+
"name": "FormControl",
|
|
956
|
+
"module": "src/core/form-control.ts"
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"name": "required",
|
|
961
|
+
"type": {
|
|
962
|
+
"text": "boolean"
|
|
963
|
+
},
|
|
964
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
965
|
+
"default": "false",
|
|
966
|
+
"fieldName": "required",
|
|
967
|
+
"inheritedFrom": {
|
|
968
|
+
"name": "FormControl",
|
|
969
|
+
"module": "src/core/form-control.ts"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
"superclass": {
|
|
974
|
+
"name": "FormControl",
|
|
975
|
+
"module": "/src/core/form-control.js"
|
|
976
|
+
},
|
|
977
|
+
"tagName": "va-checkbox",
|
|
978
|
+
"customElement": true,
|
|
979
|
+
"summary": "Lets the user choose an option, or agree to something, as part of a form.",
|
|
980
|
+
"x-keyboard": [
|
|
981
|
+
{
|
|
982
|
+
"context": "host",
|
|
983
|
+
"key": "Space",
|
|
984
|
+
"action": "toggles",
|
|
985
|
+
"description": "Checks or unchecks the box."
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"context": "host",
|
|
989
|
+
"key": "Tab",
|
|
990
|
+
"action": "focus-next",
|
|
991
|
+
"description": "Moves focus to the next control."
|
|
992
|
+
}
|
|
993
|
+
],
|
|
994
|
+
"x-a11y": {
|
|
995
|
+
"notes": [
|
|
996
|
+
"`indeterminate` is announced as \"mixed\", for a box that stands for a partly selected group.",
|
|
997
|
+
"Style states with `va-checkbox:state(checked)` and `:state(indeterminate)`; the `checked` attribute is the initial state only, as on a native checkbox."
|
|
998
|
+
],
|
|
999
|
+
"role": "checkbox",
|
|
1000
|
+
"nameFrom": [
|
|
1001
|
+
"text",
|
|
1002
|
+
"accessible-label"
|
|
1003
|
+
],
|
|
1004
|
+
"name": "The slotted label text. Use `accessible-label` only when there is no visible label."
|
|
1005
|
+
},
|
|
1006
|
+
"x-guidance": {
|
|
1007
|
+
"use": "For an option submitted with a form, for agreeing to terms, or to select items in a list.",
|
|
1008
|
+
"avoid": "For a setting that should apply immediately.",
|
|
1009
|
+
"instead": "`va-switch` for settings that take effect immediately."
|
|
1010
|
+
},
|
|
1011
|
+
"x-replaces": "input[type=\"checkbox\"]",
|
|
1012
|
+
"x-examples": [
|
|
1013
|
+
{
|
|
1014
|
+
"title": "Options",
|
|
1015
|
+
"description": "A checkbox's label is its slotted text; help text goes in the help-text slot.",
|
|
1016
|
+
"path": "src/checkbox/examples/1-options.html",
|
|
1017
|
+
"code": "<va-checkbox checked>Include archived projects</va-checkbox>\n<va-checkbox>\n Send me a copy\n <span slot=\"help-text\">We'll email it to the address on your account.</span>\n</va-checkbox>\n<va-checkbox indeterminate>Select all (some selected)</va-checkbox>\n<va-checkbox disabled>Not available on your plan</va-checkbox>"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"title": "Required, in a form",
|
|
1021
|
+
"description": "A required checkbox blocks submit until it is checked, like a native one.",
|
|
1022
|
+
"path": "src/checkbox/examples/2-form.html",
|
|
1023
|
+
"code": "<form>\n <va-checkbox name=\"terms\" value=\"accepted\" required>I agree to the terms</va-checkbox>\n <va-button type=\"submit\">Create account</va-button>\n</form>"
|
|
1024
|
+
}
|
|
1025
|
+
]
|
|
1026
|
+
}
|
|
1027
|
+
],
|
|
1028
|
+
"exports": [
|
|
1029
|
+
{
|
|
1030
|
+
"kind": "js",
|
|
1031
|
+
"name": "VaCheckbox",
|
|
1032
|
+
"declaration": {
|
|
1033
|
+
"name": "VaCheckbox",
|
|
1034
|
+
"module": "src/checkbox/checkbox.ts"
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
]
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"kind": "javascript-module",
|
|
1041
|
+
"path": "src/core/cssom.ts",
|
|
1042
|
+
"declarations": [
|
|
1043
|
+
{
|
|
1044
|
+
"kind": "variable",
|
|
1045
|
+
"name": "cssom"
|
|
1046
|
+
}
|
|
1047
|
+
],
|
|
1048
|
+
"exports": [
|
|
1049
|
+
{
|
|
1050
|
+
"kind": "js",
|
|
1051
|
+
"name": "cssom",
|
|
1052
|
+
"declaration": {
|
|
1053
|
+
"name": "cssom",
|
|
1054
|
+
"module": "src/core/cssom.ts"
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
]
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"kind": "javascript-module",
|
|
1061
|
+
"path": "src/core/form-control.ts",
|
|
1062
|
+
"declarations": [
|
|
1063
|
+
{
|
|
1064
|
+
"kind": "class",
|
|
1065
|
+
"description": "Base class for Vastu form controls. It joins the control to its `<form>` through\nElementInternals, so the control submits, resets, disables and validates like a native one.\nSubclasses call `setFormValue()` and `setValidity()`; everything else is handled here.",
|
|
1066
|
+
"name": "FormControl",
|
|
1067
|
+
"members": [
|
|
1068
|
+
{
|
|
1069
|
+
"kind": "field",
|
|
1070
|
+
"name": "name",
|
|
1071
|
+
"privacy": "public",
|
|
1072
|
+
"type": {
|
|
1073
|
+
"text": "string"
|
|
1074
|
+
},
|
|
1075
|
+
"description": "Submitted with the form as `name=value`.",
|
|
1076
|
+
"default": "''",
|
|
1077
|
+
"attribute": "name"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"kind": "field",
|
|
1081
|
+
"name": "disabled",
|
|
1082
|
+
"privacy": "public",
|
|
1083
|
+
"type": {
|
|
1084
|
+
"text": "boolean"
|
|
1085
|
+
},
|
|
1086
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
1087
|
+
"default": "false",
|
|
1088
|
+
"attribute": "disabled",
|
|
1089
|
+
"reflects": true
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"kind": "field",
|
|
1093
|
+
"name": "required",
|
|
1094
|
+
"privacy": "public",
|
|
1095
|
+
"type": {
|
|
1096
|
+
"text": "boolean"
|
|
1097
|
+
},
|
|
1098
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
1099
|
+
"default": "false",
|
|
1100
|
+
"attribute": "required",
|
|
1101
|
+
"reflects": true
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"kind": "field",
|
|
1105
|
+
"name": "_fieldsetDisabled",
|
|
1106
|
+
"privacy": "protected",
|
|
1107
|
+
"type": {
|
|
1108
|
+
"text": "boolean"
|
|
1109
|
+
},
|
|
1110
|
+
"description": "Set while a disabled `<fieldset>` around the control disables it. Kept apart from `disabled`.",
|
|
1111
|
+
"default": "false",
|
|
1112
|
+
"attribute": "_fieldsetDisabled"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"kind": "field",
|
|
1116
|
+
"name": "form",
|
|
1117
|
+
"type": {
|
|
1118
|
+
"text": "HTMLFormElement | null"
|
|
1119
|
+
},
|
|
1120
|
+
"description": "The form this control belongs to, if any.",
|
|
1121
|
+
"readonly": true
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
"kind": "field",
|
|
1125
|
+
"name": "validity",
|
|
1126
|
+
"type": {
|
|
1127
|
+
"text": "ValidityState"
|
|
1128
|
+
},
|
|
1129
|
+
"description": "The control's validity state, as on native controls.",
|
|
1130
|
+
"readonly": true
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"kind": "field",
|
|
1134
|
+
"name": "validationMessage",
|
|
1135
|
+
"type": {
|
|
1136
|
+
"text": "string"
|
|
1137
|
+
},
|
|
1138
|
+
"description": "The message the browser shows when the control is invalid, or an empty string.",
|
|
1139
|
+
"readonly": true
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
"kind": "method",
|
|
1143
|
+
"name": "checkValidity",
|
|
1144
|
+
"return": {
|
|
1145
|
+
"type": {
|
|
1146
|
+
"text": "boolean"
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
"description": "Returns true if the control is valid; otherwise fires `invalid` and returns false."
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"kind": "method",
|
|
1153
|
+
"name": "reportValidity",
|
|
1154
|
+
"return": {
|
|
1155
|
+
"type": {
|
|
1156
|
+
"text": "boolean"
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
"description": "Like `checkValidity()`, but also shows the browser's message to the user."
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
"kind": "field",
|
|
1163
|
+
"name": "_isDisabled",
|
|
1164
|
+
"type": {
|
|
1165
|
+
"text": "boolean"
|
|
1166
|
+
},
|
|
1167
|
+
"privacy": "protected",
|
|
1168
|
+
"description": "Whether the control is disabled, by its own `disabled` or by a disabled fieldset.",
|
|
1169
|
+
"readonly": true
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
"kind": "method",
|
|
1173
|
+
"name": "_setState",
|
|
1174
|
+
"privacy": "protected",
|
|
1175
|
+
"return": {
|
|
1176
|
+
"type": {
|
|
1177
|
+
"text": "void"
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
"parameters": [
|
|
1181
|
+
{
|
|
1182
|
+
"name": "name",
|
|
1183
|
+
"type": {
|
|
1184
|
+
"text": "string"
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"name": "on",
|
|
1189
|
+
"type": {
|
|
1190
|
+
"text": "boolean"
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
],
|
|
1194
|
+
"description": "Sets or clears a custom state, for authors' :state(…) selectors."
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"kind": "method",
|
|
1198
|
+
"name": "_emit",
|
|
1199
|
+
"privacy": "protected",
|
|
1200
|
+
"return": {
|
|
1201
|
+
"type": {
|
|
1202
|
+
"text": "void"
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
"parameters": [
|
|
1206
|
+
{
|
|
1207
|
+
"name": "type",
|
|
1208
|
+
"type": {
|
|
1209
|
+
"text": "'input' | 'change'"
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
],
|
|
1213
|
+
"description": "Fires a bubbling event on the host, as a native control would."
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"kind": "field",
|
|
1217
|
+
"name": "_internals"
|
|
1218
|
+
}
|
|
1219
|
+
],
|
|
1220
|
+
"events": [],
|
|
1221
|
+
"attributes": [
|
|
1222
|
+
{
|
|
1223
|
+
"name": "name",
|
|
1224
|
+
"type": {
|
|
1225
|
+
"text": "string"
|
|
1226
|
+
},
|
|
1227
|
+
"description": "Submitted with the form as `name=value`.",
|
|
1228
|
+
"default": "''",
|
|
1229
|
+
"fieldName": "name"
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"name": "disabled",
|
|
1233
|
+
"type": {
|
|
1234
|
+
"text": "boolean"
|
|
1235
|
+
},
|
|
1236
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
1237
|
+
"default": "false",
|
|
1238
|
+
"fieldName": "disabled"
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
"name": "required",
|
|
1242
|
+
"type": {
|
|
1243
|
+
"text": "boolean"
|
|
1244
|
+
},
|
|
1245
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
1246
|
+
"default": "false",
|
|
1247
|
+
"fieldName": "required"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"name": "_fieldsetDisabled",
|
|
1251
|
+
"type": {
|
|
1252
|
+
"text": "boolean"
|
|
1253
|
+
},
|
|
1254
|
+
"description": "Set while a disabled `<fieldset>` around the control disables it. Kept apart from `disabled`.",
|
|
1255
|
+
"default": "false",
|
|
1256
|
+
"fieldName": "_fieldsetDisabled"
|
|
1257
|
+
}
|
|
1258
|
+
],
|
|
1259
|
+
"superclass": {
|
|
1260
|
+
"name": "LitElement",
|
|
1261
|
+
"package": "lit"
|
|
1262
|
+
},
|
|
1263
|
+
"customElement": true
|
|
1264
|
+
}
|
|
1265
|
+
],
|
|
1266
|
+
"exports": [
|
|
1267
|
+
{
|
|
1268
|
+
"kind": "js",
|
|
1269
|
+
"name": "FormControl",
|
|
1270
|
+
"declaration": {
|
|
1271
|
+
"name": "FormControl",
|
|
1272
|
+
"module": "src/core/form-control.ts"
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
]
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
"kind": "javascript-module",
|
|
1279
|
+
"path": "src/dialog/dialog.ts",
|
|
1280
|
+
"declarations": [
|
|
1281
|
+
{
|
|
1282
|
+
"kind": "class",
|
|
1283
|
+
"description": "A modal dialog built on the native `<dialog>`: it sits in the top layer, makes the page behind it\ninert, keeps focus inside, closes with Escape and returns focus to where it came from.",
|
|
1284
|
+
"name": "VaDialog",
|
|
1285
|
+
"cssProperties": [
|
|
1286
|
+
{
|
|
1287
|
+
"type": {
|
|
1288
|
+
"text": "<color>"
|
|
1289
|
+
},
|
|
1290
|
+
"description": "Background colour.",
|
|
1291
|
+
"name": "--va-dialog-bg",
|
|
1292
|
+
"x-applies": {
|
|
1293
|
+
"part": "dialog",
|
|
1294
|
+
"state": "open",
|
|
1295
|
+
"property": "background-color"
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"type": {
|
|
1300
|
+
"text": "<length>"
|
|
1301
|
+
},
|
|
1302
|
+
"description": "Maximum width.",
|
|
1303
|
+
"name": "--va-dialog-width",
|
|
1304
|
+
"x-applies": {
|
|
1305
|
+
"part": "dialog",
|
|
1306
|
+
"state": "open",
|
|
1307
|
+
"property": "max-width"
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"type": {
|
|
1312
|
+
"text": "<length>"
|
|
1313
|
+
},
|
|
1314
|
+
"description": "Corner radius.",
|
|
1315
|
+
"name": "--va-dialog-radius",
|
|
1316
|
+
"x-applies": {
|
|
1317
|
+
"part": "dialog",
|
|
1318
|
+
"state": "open",
|
|
1319
|
+
"property": "border-top-left-radius"
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"cssParts": [
|
|
1324
|
+
{
|
|
1325
|
+
"description": "The native dialog element.",
|
|
1326
|
+
"name": "dialog"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
"description": "The row with the heading and the close button.",
|
|
1330
|
+
"name": "header"
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
"description": "The heading.",
|
|
1334
|
+
"name": "heading"
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"description": "The close button.",
|
|
1338
|
+
"name": "close-button"
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"description": "The wrapper around the content.",
|
|
1342
|
+
"name": "body"
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
"description": "The wrapper around the actions.",
|
|
1346
|
+
"name": "footer"
|
|
1347
|
+
}
|
|
1348
|
+
],
|
|
1349
|
+
"slots": [
|
|
1350
|
+
{
|
|
1351
|
+
"description": "The dialog's content.",
|
|
1352
|
+
"name": ""
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
"description": "Actions, such as Cancel and Confirm buttons. Put the primary action last.",
|
|
1356
|
+
"name": "footer"
|
|
1357
|
+
}
|
|
1358
|
+
],
|
|
1359
|
+
"members": [
|
|
1360
|
+
{
|
|
1361
|
+
"kind": "field",
|
|
1362
|
+
"name": "open",
|
|
1363
|
+
"privacy": "public",
|
|
1364
|
+
"type": {
|
|
1365
|
+
"text": "boolean"
|
|
1366
|
+
},
|
|
1367
|
+
"description": "Whether the dialog is open. Prefer `show()` and `close()`, or `command=\"--show\"` on a `va-button`.",
|
|
1368
|
+
"default": "false",
|
|
1369
|
+
"attribute": "open",
|
|
1370
|
+
"reflects": true
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
"kind": "field",
|
|
1374
|
+
"name": "heading",
|
|
1375
|
+
"privacy": "public",
|
|
1376
|
+
"type": {
|
|
1377
|
+
"text": "string"
|
|
1378
|
+
},
|
|
1379
|
+
"description": "The visible heading. It is also the dialog's accessible name.",
|
|
1380
|
+
"default": "''",
|
|
1381
|
+
"attribute": "heading"
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"kind": "field",
|
|
1385
|
+
"name": "accessibleLabel",
|
|
1386
|
+
"privacy": "public",
|
|
1387
|
+
"type": {
|
|
1388
|
+
"text": "string"
|
|
1389
|
+
},
|
|
1390
|
+
"description": "Accessible name, when there is no visible heading. Not shown.",
|
|
1391
|
+
"default": "''",
|
|
1392
|
+
"attribute": "accessible-label"
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
"kind": "field",
|
|
1396
|
+
"name": "hideCloseButton",
|
|
1397
|
+
"privacy": "public",
|
|
1398
|
+
"type": {
|
|
1399
|
+
"text": "boolean"
|
|
1400
|
+
},
|
|
1401
|
+
"description": "Hides the close button in the header, for a dialog that needs an explicit choice. Escape still closes it.",
|
|
1402
|
+
"default": "false",
|
|
1403
|
+
"attribute": "hide-close-button",
|
|
1404
|
+
"reflects": true
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
"kind": "method",
|
|
1408
|
+
"name": "show",
|
|
1409
|
+
"return": {
|
|
1410
|
+
"type": {
|
|
1411
|
+
"text": "void"
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
"description": "Opens the dialog as a modal."
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"kind": "method",
|
|
1418
|
+
"name": "close",
|
|
1419
|
+
"return": {
|
|
1420
|
+
"type": {
|
|
1421
|
+
"text": "void"
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
"description": "Closes the dialog, unless a `va-close` listener cancels it."
|
|
1425
|
+
}
|
|
1426
|
+
],
|
|
1427
|
+
"events": [
|
|
1428
|
+
{
|
|
1429
|
+
"name": "va-open",
|
|
1430
|
+
"type": {
|
|
1431
|
+
"text": "Event"
|
|
1432
|
+
},
|
|
1433
|
+
"description": "After the dialog has opened.",
|
|
1434
|
+
"x-trigger": {
|
|
1435
|
+
"how": "call show"
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"name": "va-closed",
|
|
1440
|
+
"type": {
|
|
1441
|
+
"text": "CustomEvent<{ reason: 'escape' | 'close-button' | 'command' | 'method' | 'property' }>"
|
|
1442
|
+
},
|
|
1443
|
+
"description": "After the dialog has closed, however it closed (`property` when `open` was set to false). Focus is back on the element that opened it.",
|
|
1444
|
+
"x-trigger": {
|
|
1445
|
+
"how": "press Escape",
|
|
1446
|
+
"setup": "open"
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"type": {
|
|
1451
|
+
"text": "CustomEvent<{ reason: 'escape' | 'close-button' | 'command' | 'method' }>"
|
|
1452
|
+
},
|
|
1453
|
+
"description": "Before the dialog closes, when the user or close() asks it to. Cancel it with `preventDefault()` to keep the dialog open.",
|
|
1454
|
+
"name": "va-close",
|
|
1455
|
+
"x-trigger": {
|
|
1456
|
+
"how": "press Escape",
|
|
1457
|
+
"setup": "open"
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
],
|
|
1461
|
+
"attributes": [
|
|
1462
|
+
{
|
|
1463
|
+
"name": "open",
|
|
1464
|
+
"type": {
|
|
1465
|
+
"text": "boolean"
|
|
1466
|
+
},
|
|
1467
|
+
"description": "Whether the dialog is open. Prefer `show()` and `close()`, or `command=\"--show\"` on a `va-button`.",
|
|
1468
|
+
"default": "false",
|
|
1469
|
+
"fieldName": "open"
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"name": "heading",
|
|
1473
|
+
"type": {
|
|
1474
|
+
"text": "string"
|
|
1475
|
+
},
|
|
1476
|
+
"description": "The visible heading. It is also the dialog's accessible name.",
|
|
1477
|
+
"default": "''",
|
|
1478
|
+
"fieldName": "heading"
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"name": "accessible-label",
|
|
1482
|
+
"type": {
|
|
1483
|
+
"text": "string"
|
|
1484
|
+
},
|
|
1485
|
+
"description": "Accessible name, when there is no visible heading. Not shown.",
|
|
1486
|
+
"default": "''",
|
|
1487
|
+
"fieldName": "accessibleLabel"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"name": "hide-close-button",
|
|
1491
|
+
"type": {
|
|
1492
|
+
"text": "boolean"
|
|
1493
|
+
},
|
|
1494
|
+
"description": "Hides the close button in the header, for a dialog that needs an explicit choice. Escape still closes it.",
|
|
1495
|
+
"default": "false",
|
|
1496
|
+
"fieldName": "hideCloseButton"
|
|
1497
|
+
}
|
|
1498
|
+
],
|
|
1499
|
+
"superclass": {
|
|
1500
|
+
"name": "LitElement",
|
|
1501
|
+
"package": "lit"
|
|
1502
|
+
},
|
|
1503
|
+
"tagName": "va-dialog",
|
|
1504
|
+
"customElement": true,
|
|
1505
|
+
"summary": "Asks the user to confirm, decide or enter something before going back to the page.",
|
|
1506
|
+
"x-keyboard": [
|
|
1507
|
+
{
|
|
1508
|
+
"context": "open",
|
|
1509
|
+
"key": "Escape",
|
|
1510
|
+
"action": "closes",
|
|
1511
|
+
"description": "Closes the dialog and returns focus to the element that opened it."
|
|
1512
|
+
}
|
|
1513
|
+
],
|
|
1514
|
+
"x-a11y": {
|
|
1515
|
+
"notes": [
|
|
1516
|
+
"The page behind is inert while the dialog is open, so focus and screen readers stay inside it.",
|
|
1517
|
+
"On open, focus goes to the first element with `autofocus`, else the first focusable control in the content, else the close button."
|
|
1518
|
+
],
|
|
1519
|
+
"role": "dialog",
|
|
1520
|
+
"nameFrom": [
|
|
1521
|
+
"heading",
|
|
1522
|
+
"accessible-label"
|
|
1523
|
+
],
|
|
1524
|
+
"name": "The `heading`, or `accessible-label` when there is no visible heading."
|
|
1525
|
+
},
|
|
1526
|
+
"x-guidance": {
|
|
1527
|
+
"use": "For a decision the user must make before going on, such as confirming a deletion, or a short focused task.",
|
|
1528
|
+
"avoid": "For information that doesn't need a response, or for long, multi-step flows.",
|
|
1529
|
+
"instead": "`va-toast` for confirmations that need no response; a full page for long flows."
|
|
1530
|
+
},
|
|
1531
|
+
"x-replaces": "dialog",
|
|
1532
|
+
"x-commands": [
|
|
1533
|
+
{
|
|
1534
|
+
"name": "--show",
|
|
1535
|
+
"description": "Opens the dialog."
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
"name": "--close",
|
|
1539
|
+
"description": "Closes the dialog (fires `va-close` first)."
|
|
1540
|
+
}
|
|
1541
|
+
],
|
|
1542
|
+
"x-examples": [
|
|
1543
|
+
{
|
|
1544
|
+
"title": "Confirm a destructive action",
|
|
1545
|
+
"description": "A va-button with commandfor and command=\"--show\" opens the dialog without any script. Focus returns to it on close.",
|
|
1546
|
+
"path": "src/dialog/examples/1-confirm.html",
|
|
1547
|
+
"code": "<va-button variant=\"danger\" commandfor=\"delete-dialog\" command=\"--show\">Delete project</va-button>\n<va-dialog id=\"delete-dialog\" heading=\"Delete this project?\">\n <p>“Atlas” and its 14 files will be deleted for everyone. You can't undo this.</p>\n <va-button slot=\"footer\" variant=\"secondary\" commandfor=\"delete-dialog\" command=\"--close\">Cancel</va-button>\n <va-button slot=\"footer\" variant=\"danger\">Delete project</va-button>\n</va-dialog>"
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
"title": "A short form",
|
|
1551
|
+
"description": "Focus starts on the first field. Escape or the close button cancels.",
|
|
1552
|
+
"path": "src/dialog/examples/2-form.html",
|
|
1553
|
+
"code": "<va-button commandfor=\"rename-dialog\" command=\"--show\">Rename</va-button>\n<va-dialog id=\"rename-dialog\" heading=\"Rename file\">\n <va-text-field label=\"File name\" value=\"notes-final-v2.md\"></va-text-field>\n <va-button slot=\"footer\" variant=\"secondary\" commandfor=\"rename-dialog\" command=\"--close\">Cancel</va-button>\n <va-button slot=\"footer\">Save</va-button>\n</va-dialog>"
|
|
1554
|
+
}
|
|
1555
|
+
]
|
|
1556
|
+
}
|
|
1557
|
+
],
|
|
1558
|
+
"exports": [
|
|
1559
|
+
{
|
|
1560
|
+
"kind": "js",
|
|
1561
|
+
"name": "VaDialog",
|
|
1562
|
+
"declaration": {
|
|
1563
|
+
"name": "VaDialog",
|
|
1564
|
+
"module": "src/dialog/dialog.ts"
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
]
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"kind": "javascript-module",
|
|
1571
|
+
"path": "src/menu/menu.ts",
|
|
1572
|
+
"declarations": [
|
|
1573
|
+
{
|
|
1574
|
+
"kind": "class",
|
|
1575
|
+
"description": "A button that opens a menu of actions, following the WAI-ARIA menu button pattern.",
|
|
1576
|
+
"name": "VaMenu",
|
|
1577
|
+
"cssProperties": [
|
|
1578
|
+
{
|
|
1579
|
+
"type": {
|
|
1580
|
+
"text": "<color>"
|
|
1581
|
+
},
|
|
1582
|
+
"description": "Background colour of the menu.",
|
|
1583
|
+
"name": "--va-menu-bg",
|
|
1584
|
+
"x-applies": {
|
|
1585
|
+
"part": "menu",
|
|
1586
|
+
"state": "open",
|
|
1587
|
+
"property": "background-color"
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
"type": {
|
|
1592
|
+
"text": "<length>"
|
|
1593
|
+
},
|
|
1594
|
+
"description": "Corner radius of the menu.",
|
|
1595
|
+
"name": "--va-menu-radius",
|
|
1596
|
+
"x-applies": {
|
|
1597
|
+
"part": "menu",
|
|
1598
|
+
"state": "open",
|
|
1599
|
+
"property": "border-top-left-radius"
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
{
|
|
1603
|
+
"type": {
|
|
1604
|
+
"text": "<color>"
|
|
1605
|
+
},
|
|
1606
|
+
"description": "Background colour of the focused or hovered item.",
|
|
1607
|
+
"name": "--va-menu-item-bg-hover",
|
|
1608
|
+
"x-applies": {
|
|
1609
|
+
"light": "[role=\"menuitem\"]",
|
|
1610
|
+
"state": "focus",
|
|
1611
|
+
"property": "background-color"
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
],
|
|
1615
|
+
"cssParts": [
|
|
1616
|
+
{
|
|
1617
|
+
"description": "The button that opens the menu.",
|
|
1618
|
+
"name": "trigger"
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"description": "The popup list.",
|
|
1622
|
+
"name": "menu"
|
|
1623
|
+
}
|
|
1624
|
+
],
|
|
1625
|
+
"slots": [
|
|
1626
|
+
{
|
|
1627
|
+
"description": "The menu items, as `<button value=\"…\">` elements.",
|
|
1628
|
+
"name": ""
|
|
1629
|
+
}
|
|
1630
|
+
],
|
|
1631
|
+
"members": [
|
|
1632
|
+
{
|
|
1633
|
+
"kind": "field",
|
|
1634
|
+
"name": "open",
|
|
1635
|
+
"privacy": "public",
|
|
1636
|
+
"type": {
|
|
1637
|
+
"text": "boolean"
|
|
1638
|
+
},
|
|
1639
|
+
"description": "Whether the menu is open.",
|
|
1640
|
+
"default": "false",
|
|
1641
|
+
"attribute": "open",
|
|
1642
|
+
"reflects": true
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
"kind": "field",
|
|
1646
|
+
"name": "label",
|
|
1647
|
+
"privacy": "public",
|
|
1648
|
+
"type": {
|
|
1649
|
+
"text": "string"
|
|
1650
|
+
},
|
|
1651
|
+
"description": "The button's text, and the menu's accessible name.",
|
|
1652
|
+
"default": "''",
|
|
1653
|
+
"attribute": "label"
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
"kind": "field",
|
|
1657
|
+
"name": "variant",
|
|
1658
|
+
"privacy": "public",
|
|
1659
|
+
"type": {
|
|
1660
|
+
"text": "'secondary' | 'ghost'"
|
|
1661
|
+
},
|
|
1662
|
+
"description": "The button's look, as for `va-button`.",
|
|
1663
|
+
"default": "'secondary'",
|
|
1664
|
+
"attribute": "variant",
|
|
1665
|
+
"reflects": true
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"kind": "field",
|
|
1669
|
+
"name": "placement",
|
|
1670
|
+
"privacy": "public",
|
|
1671
|
+
"type": {
|
|
1672
|
+
"text": "'bottom-start' | 'bottom-end'"
|
|
1673
|
+
},
|
|
1674
|
+
"description": "Which edge of the button the menu lines up with.",
|
|
1675
|
+
"default": "'bottom-start'",
|
|
1676
|
+
"attribute": "placement",
|
|
1677
|
+
"reflects": true
|
|
1678
|
+
}
|
|
1679
|
+
],
|
|
1680
|
+
"events": [
|
|
1681
|
+
{
|
|
1682
|
+
"name": "va-select",
|
|
1683
|
+
"type": {
|
|
1684
|
+
"text": "CustomEvent<{ value: string, item: HTMLElement }>"
|
|
1685
|
+
},
|
|
1686
|
+
"description": "When the user chooses an item. `event.detail.value` is the item's `value`, or its text when it has none; `event.detail.item` is the item.",
|
|
1687
|
+
"x-trigger": {
|
|
1688
|
+
"how": "press Enter",
|
|
1689
|
+
"setup": "open"
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
],
|
|
1693
|
+
"attributes": [
|
|
1694
|
+
{
|
|
1695
|
+
"name": "open",
|
|
1696
|
+
"type": {
|
|
1697
|
+
"text": "boolean"
|
|
1698
|
+
},
|
|
1699
|
+
"description": "Whether the menu is open.",
|
|
1700
|
+
"default": "false",
|
|
1701
|
+
"fieldName": "open"
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
"name": "label",
|
|
1705
|
+
"type": {
|
|
1706
|
+
"text": "string"
|
|
1707
|
+
},
|
|
1708
|
+
"description": "The button's text, and the menu's accessible name.",
|
|
1709
|
+
"default": "''",
|
|
1710
|
+
"fieldName": "label"
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
"name": "variant",
|
|
1714
|
+
"type": {
|
|
1715
|
+
"text": "'secondary' | 'ghost'"
|
|
1716
|
+
},
|
|
1717
|
+
"description": "The button's look, as for `va-button`.",
|
|
1718
|
+
"default": "'secondary'",
|
|
1719
|
+
"fieldName": "variant"
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
"name": "placement",
|
|
1723
|
+
"type": {
|
|
1724
|
+
"text": "'bottom-start' | 'bottom-end'"
|
|
1725
|
+
},
|
|
1726
|
+
"description": "Which edge of the button the menu lines up with.",
|
|
1727
|
+
"default": "'bottom-start'",
|
|
1728
|
+
"fieldName": "placement"
|
|
1729
|
+
}
|
|
1730
|
+
],
|
|
1731
|
+
"superclass": {
|
|
1732
|
+
"name": "LitElement",
|
|
1733
|
+
"package": "lit"
|
|
1734
|
+
},
|
|
1735
|
+
"tagName": "va-menu",
|
|
1736
|
+
"customElement": true,
|
|
1737
|
+
"summary": "Opens a short list of actions from a button, such as Edit, Duplicate and Delete.",
|
|
1738
|
+
"x-keyboard": [
|
|
1739
|
+
{
|
|
1740
|
+
"context": "host",
|
|
1741
|
+
"key": "Enter",
|
|
1742
|
+
"action": "opens",
|
|
1743
|
+
"description": "Opens the menu and focuses the first item."
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
"context": "host",
|
|
1747
|
+
"key": "Space",
|
|
1748
|
+
"action": "opens",
|
|
1749
|
+
"description": "Opens the menu and focuses the first item."
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
"context": "host",
|
|
1753
|
+
"key": "ArrowDown",
|
|
1754
|
+
"action": "opens",
|
|
1755
|
+
"description": "Opens the menu and focuses the first item."
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
"context": "open",
|
|
1759
|
+
"key": "ArrowDown",
|
|
1760
|
+
"action": "next",
|
|
1761
|
+
"description": "Moves to the next item, wrapping round."
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
"context": "open",
|
|
1765
|
+
"key": "ArrowUp",
|
|
1766
|
+
"action": "previous",
|
|
1767
|
+
"description": "Moves to the previous item, wrapping round."
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
"context": "open",
|
|
1771
|
+
"key": "Home",
|
|
1772
|
+
"action": "first",
|
|
1773
|
+
"description": "Moves to the first item."
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
"context": "open",
|
|
1777
|
+
"key": "End",
|
|
1778
|
+
"action": "last",
|
|
1779
|
+
"description": "Moves to the last item."
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
"context": "open",
|
|
1783
|
+
"key": "Enter",
|
|
1784
|
+
"action": "selects",
|
|
1785
|
+
"description": "Chooses the focused item and closes the menu."
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
"context": "open",
|
|
1789
|
+
"key": "Escape",
|
|
1790
|
+
"action": "closes",
|
|
1791
|
+
"description": "Closes the menu and returns focus to the button."
|
|
1792
|
+
}
|
|
1793
|
+
],
|
|
1794
|
+
"x-keyboard-items": "[role=\"menuitem\"]",
|
|
1795
|
+
"x-a11y": {
|
|
1796
|
+
"notes": [
|
|
1797
|
+
"The button has `aria-haspopup=\"menu\"` and `aria-expanded`. Items get `role=\"menuitem\"`.",
|
|
1798
|
+
"Typing a letter moves to the next item that starts with it."
|
|
1799
|
+
],
|
|
1800
|
+
"role": "menu",
|
|
1801
|
+
"nameFrom": [
|
|
1802
|
+
"label"
|
|
1803
|
+
],
|
|
1804
|
+
"name": "The `label`, which is also the button's text."
|
|
1805
|
+
},
|
|
1806
|
+
"x-guidance": {
|
|
1807
|
+
"use": "For a few actions on one thing, when there isn't room to show them as buttons.",
|
|
1808
|
+
"avoid": "For navigation, for choosing a value in a form, or for one or two actions.",
|
|
1809
|
+
"instead": "Links for navigation; a select or radio group for form values; plain buttons for one or two actions."
|
|
1810
|
+
},
|
|
1811
|
+
"x-replaces": "[role=\"menu\"]",
|
|
1812
|
+
"x-examples": [
|
|
1813
|
+
{
|
|
1814
|
+
"title": "Actions on an item",
|
|
1815
|
+
"description": "Items are buttons with a value. Choosing one fires va-select with that value.",
|
|
1816
|
+
"path": "src/menu/examples/1-actions.html",
|
|
1817
|
+
"code": "<va-menu label=\"Actions\">\n <button value=\"edit\">Edit</button>\n <button value=\"duplicate\">Duplicate</button>\n <button value=\"move\">Move to folder</button>\n <button value=\"delete\">Delete</button>\n</va-menu>"
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
"title": "Aligned to the end, ghost button",
|
|
1821
|
+
"description": "placement=\"bottom-end\" lines the menu up with the button's right edge, for menus at the end of a row.",
|
|
1822
|
+
"path": "src/menu/examples/2-end.html",
|
|
1823
|
+
"code": "<va-menu label=\"More\" variant=\"ghost\" placement=\"bottom-end\">\n <button value=\"share\">Share</button>\n <button value=\"download\">Download</button>\n <button value=\"report\">Report a problem</button>\n</va-menu>"
|
|
1824
|
+
}
|
|
1825
|
+
]
|
|
1826
|
+
}
|
|
1827
|
+
],
|
|
1828
|
+
"exports": [
|
|
1829
|
+
{
|
|
1830
|
+
"kind": "js",
|
|
1831
|
+
"name": "VaMenu",
|
|
1832
|
+
"declaration": {
|
|
1833
|
+
"name": "VaMenu",
|
|
1834
|
+
"module": "src/menu/menu.ts"
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
]
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"kind": "javascript-module",
|
|
1841
|
+
"path": "src/navbar/navbar.ts",
|
|
1842
|
+
"declarations": [
|
|
1843
|
+
{
|
|
1844
|
+
"kind": "class",
|
|
1845
|
+
"description": "A site's main navigation bar: a brand link and links to pages. On narrow screens the links fold\nbehind a Menu button, following the WAI-ARIA disclosure navigation pattern.",
|
|
1846
|
+
"name": "VaNavbar",
|
|
1847
|
+
"cssProperties": [
|
|
1848
|
+
{
|
|
1849
|
+
"type": {
|
|
1850
|
+
"text": "<color>"
|
|
1851
|
+
},
|
|
1852
|
+
"description": "Background colour of the bar and of the open panel.",
|
|
1853
|
+
"name": "--va-navbar-bg",
|
|
1854
|
+
"x-applies": {
|
|
1855
|
+
"part": "bar",
|
|
1856
|
+
"property": "background-color"
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"type": {
|
|
1861
|
+
"text": "<color>"
|
|
1862
|
+
},
|
|
1863
|
+
"description": "Colour of the line under the bar.",
|
|
1864
|
+
"name": "--va-navbar-border",
|
|
1865
|
+
"x-applies": {
|
|
1866
|
+
"part": "bar",
|
|
1867
|
+
"property": "border-bottom-color"
|
|
1868
|
+
}
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"type": {
|
|
1872
|
+
"text": "<length>"
|
|
1873
|
+
},
|
|
1874
|
+
"description": "Minimum height of the bar.",
|
|
1875
|
+
"name": "--va-navbar-size",
|
|
1876
|
+
"x-applies": {
|
|
1877
|
+
"part": "bar",
|
|
1878
|
+
"property": "min-height"
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
"type": {
|
|
1883
|
+
"text": "<color>"
|
|
1884
|
+
},
|
|
1885
|
+
"description": "Text colour of the links.",
|
|
1886
|
+
"name": "--va-navbar-link-fg",
|
|
1887
|
+
"x-applies": {
|
|
1888
|
+
"light": "a:not([slot]):not([aria-current])",
|
|
1889
|
+
"property": "color"
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
"type": {
|
|
1894
|
+
"text": "<color>"
|
|
1895
|
+
},
|
|
1896
|
+
"description": "Colour of the line that marks the current page's link.",
|
|
1897
|
+
"name": "--va-navbar-indicator-border",
|
|
1898
|
+
"x-applies": {
|
|
1899
|
+
"light": "[aria-current=\"page\"]",
|
|
1900
|
+
"property": "border-bottom-color"
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
],
|
|
1904
|
+
"cssParts": [
|
|
1905
|
+
{
|
|
1906
|
+
"description": "The bar, which is the `<nav>` element.",
|
|
1907
|
+
"name": "bar"
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
"description": "The Menu button shown on narrow screens.",
|
|
1911
|
+
"name": "toggle"
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
"description": "The wrapper around the links. On narrow screens it is the panel that opens.",
|
|
1915
|
+
"name": "links"
|
|
1916
|
+
}
|
|
1917
|
+
],
|
|
1918
|
+
"slots": [
|
|
1919
|
+
{
|
|
1920
|
+
"description": "The links, as `<a href=\"…\">` elements. Mark the current page's link with `aria-current=\"page\"`.",
|
|
1921
|
+
"name": ""
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
"description": "The site's name or logo, as an `<a href=\"…\">` to the home page.",
|
|
1925
|
+
"name": "brand"
|
|
1926
|
+
}
|
|
1927
|
+
],
|
|
1928
|
+
"members": [
|
|
1929
|
+
{
|
|
1930
|
+
"kind": "field",
|
|
1931
|
+
"name": "open",
|
|
1932
|
+
"privacy": "public",
|
|
1933
|
+
"type": {
|
|
1934
|
+
"text": "boolean"
|
|
1935
|
+
},
|
|
1936
|
+
"description": "Whether the panel of links is open. It only shows while the navbar is folded.",
|
|
1937
|
+
"default": "false",
|
|
1938
|
+
"attribute": "open",
|
|
1939
|
+
"reflects": true
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
"kind": "field",
|
|
1943
|
+
"name": "collapseBelow",
|
|
1944
|
+
"privacy": "public",
|
|
1945
|
+
"type": {
|
|
1946
|
+
"text": "number"
|
|
1947
|
+
},
|
|
1948
|
+
"description": "Width in pixels below which the links fold behind the Menu button. It is the navbar's own width, not the window's.",
|
|
1949
|
+
"default": "600",
|
|
1950
|
+
"attribute": "collapse-below"
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
"kind": "field",
|
|
1954
|
+
"name": "toggleLabel",
|
|
1955
|
+
"privacy": "public",
|
|
1956
|
+
"type": {
|
|
1957
|
+
"text": "string"
|
|
1958
|
+
},
|
|
1959
|
+
"description": "Visible text of the Menu button.",
|
|
1960
|
+
"default": "'Menu'",
|
|
1961
|
+
"attribute": "toggle-label"
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"kind": "field",
|
|
1965
|
+
"name": "accessibleLabel",
|
|
1966
|
+
"privacy": "public",
|
|
1967
|
+
"type": {
|
|
1968
|
+
"text": "string"
|
|
1969
|
+
},
|
|
1970
|
+
"description": "Accessible name of the navigation landmark.",
|
|
1971
|
+
"default": "''",
|
|
1972
|
+
"attribute": "accessible-label"
|
|
1973
|
+
}
|
|
1974
|
+
],
|
|
1975
|
+
"attributes": [
|
|
1976
|
+
{
|
|
1977
|
+
"name": "open",
|
|
1978
|
+
"type": {
|
|
1979
|
+
"text": "boolean"
|
|
1980
|
+
},
|
|
1981
|
+
"description": "Whether the panel of links is open. It only shows while the navbar is folded.",
|
|
1982
|
+
"default": "false",
|
|
1983
|
+
"fieldName": "open"
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
"name": "collapse-below",
|
|
1987
|
+
"type": {
|
|
1988
|
+
"text": "number"
|
|
1989
|
+
},
|
|
1990
|
+
"description": "Width in pixels below which the links fold behind the Menu button. It is the navbar's own width, not the window's.",
|
|
1991
|
+
"default": "600",
|
|
1992
|
+
"fieldName": "collapseBelow"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"name": "toggle-label",
|
|
1996
|
+
"type": {
|
|
1997
|
+
"text": "string"
|
|
1998
|
+
},
|
|
1999
|
+
"description": "Visible text of the Menu button.",
|
|
2000
|
+
"default": "'Menu'",
|
|
2001
|
+
"fieldName": "toggleLabel"
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
"name": "accessible-label",
|
|
2005
|
+
"type": {
|
|
2006
|
+
"text": "string"
|
|
2007
|
+
},
|
|
2008
|
+
"description": "Accessible name of the navigation landmark.",
|
|
2009
|
+
"default": "''",
|
|
2010
|
+
"fieldName": "accessibleLabel"
|
|
2011
|
+
}
|
|
2012
|
+
],
|
|
2013
|
+
"cssStates": [
|
|
2014
|
+
{
|
|
2015
|
+
"description": "The links are folded behind the Menu button.",
|
|
2016
|
+
"name": "collapsed"
|
|
2017
|
+
}
|
|
2018
|
+
],
|
|
2019
|
+
"superclass": {
|
|
2020
|
+
"name": "LitElement",
|
|
2021
|
+
"package": "lit"
|
|
2022
|
+
},
|
|
2023
|
+
"tagName": "va-navbar",
|
|
2024
|
+
"customElement": true,
|
|
2025
|
+
"summary": "Shows a site's brand and main links in a bar that folds behind a Menu button on narrow screens.",
|
|
2026
|
+
"x-keyboard": [
|
|
2027
|
+
{
|
|
2028
|
+
"context": "open",
|
|
2029
|
+
"key": "Escape",
|
|
2030
|
+
"action": "closes",
|
|
2031
|
+
"description": "Closes the open panel of links and returns focus to the Menu button."
|
|
2032
|
+
}
|
|
2033
|
+
],
|
|
2034
|
+
"x-a11y": {
|
|
2035
|
+
"notes": [
|
|
2036
|
+
"The bar is a `<nav>` landmark. The links keep their own names; mark the current page with `aria-current=\"page\"`.",
|
|
2037
|
+
"Style the folded layout with `va-navbar:state(collapsed)`.",
|
|
2038
|
+
"On narrow screens the Menu button has a visible label, `aria-expanded` and `aria-controls`. Escape, a click outside or moving focus away closes the panel."
|
|
2039
|
+
],
|
|
2040
|
+
"role": "navigation",
|
|
2041
|
+
"nameFrom": [
|
|
2042
|
+
"accessible-label"
|
|
2043
|
+
],
|
|
2044
|
+
"name": "The `accessible-label` attribute, such as \"Main\" (not shown). Needed when a page has more than one navigation landmark."
|
|
2045
|
+
},
|
|
2046
|
+
"x-guidance": {
|
|
2047
|
+
"use": "For a site's or app's main navigation: a brand link and up to about seven links to pages.",
|
|
2048
|
+
"avoid": "For actions that do something on the page, for switching views in one place, or for deep hierarchies of pages.",
|
|
2049
|
+
"instead": "`va-menu` for actions; `va-tabs` for views in one place; nested lists in a sidebar for deep navigation."
|
|
2050
|
+
},
|
|
2051
|
+
"events": [],
|
|
2052
|
+
"x-examples": [
|
|
2053
|
+
{
|
|
2054
|
+
"title": "Site navigation",
|
|
2055
|
+
"description": "A brand link, then links to pages. The current page's link has aria-current=\"page\". When the navbar is narrower than 600px, the links fold behind a Menu button.",
|
|
2056
|
+
"path": "src/navbar/examples/1-site.html",
|
|
2057
|
+
"code": "<va-navbar accessible-label=\"Main\">\n <a slot=\"brand\" href=\"#\">Acme</a>\n <a href=\"#\" aria-current=\"page\">Home</a>\n <a href=\"#work\">Work</a>\n <a href=\"#about\">About</a>\n <a href=\"#contact\">Contact</a>\n</va-navbar>"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"title": "Folding earlier",
|
|
2061
|
+
"description": "collapse-below sets the width at which the links fold. With many links, fold earlier so they never wrap. toggle-label changes the Menu button's text.",
|
|
2062
|
+
"path": "src/navbar/examples/2-fold-earlier.html",
|
|
2063
|
+
"code": "<va-navbar accessible-label=\"Main\" collapse-below=\"900\" toggle-label=\"Pages\">\n <a slot=\"brand\" href=\"#\">Northwind Studio</a>\n <a href=\"#\">Projects</a>\n <a href=\"#services\" aria-current=\"page\">Services</a>\n <a href=\"#team\">Team</a>\n <a href=\"#journal\">Journal</a>\n <a href=\"#careers\">Careers</a>\n <a href=\"#contact\">Contact</a>\n</va-navbar>"
|
|
2064
|
+
}
|
|
2065
|
+
]
|
|
2066
|
+
}
|
|
2067
|
+
],
|
|
2068
|
+
"exports": [
|
|
2069
|
+
{
|
|
2070
|
+
"kind": "js",
|
|
2071
|
+
"name": "VaNavbar",
|
|
2072
|
+
"declaration": {
|
|
2073
|
+
"name": "VaNavbar",
|
|
2074
|
+
"module": "src/navbar/navbar.ts"
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
]
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
"kind": "javascript-module",
|
|
2081
|
+
"path": "src/poll/poll.ts",
|
|
2082
|
+
"declarations": [
|
|
2083
|
+
{
|
|
2084
|
+
"kind": "class",
|
|
2085
|
+
"description": "A one-question poll. The user votes with one click, and the poll shows the results.",
|
|
2086
|
+
"name": "VaPoll",
|
|
2087
|
+
"cssProperties": [
|
|
2088
|
+
{
|
|
2089
|
+
"type": {
|
|
2090
|
+
"text": "<color>"
|
|
2091
|
+
},
|
|
2092
|
+
"description": "Border colour of each answer's row.",
|
|
2093
|
+
"name": "--va-poll-border",
|
|
2094
|
+
"x-applies": {
|
|
2095
|
+
"part": "option",
|
|
2096
|
+
"property": "border-top-color"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
"type": {
|
|
2101
|
+
"text": "<length>"
|
|
2102
|
+
},
|
|
2103
|
+
"description": "Corner radius of each answer's row.",
|
|
2104
|
+
"name": "--va-poll-radius",
|
|
2105
|
+
"x-applies": {
|
|
2106
|
+
"part": "option",
|
|
2107
|
+
"property": "border-top-left-radius"
|
|
2108
|
+
}
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
"type": {
|
|
2112
|
+
"text": "<color>"
|
|
2113
|
+
},
|
|
2114
|
+
"description": "Colour of the result bars.",
|
|
2115
|
+
"name": "--va-poll-bar-bg",
|
|
2116
|
+
"x-applies": {
|
|
2117
|
+
"part": "bar",
|
|
2118
|
+
"property": "background-color"
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
],
|
|
2122
|
+
"cssParts": [
|
|
2123
|
+
{
|
|
2124
|
+
"description": "The question.",
|
|
2125
|
+
"name": "label"
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
"description": "The row around each answer.",
|
|
2129
|
+
"name": "option"
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
"description": "The bar behind each answer that shows its share of the votes.",
|
|
2133
|
+
"name": "bar"
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
"description": "The share of the votes, shown after voting.",
|
|
2137
|
+
"name": "result"
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
"description": "The help text and the vote count.",
|
|
2141
|
+
"name": "help-text"
|
|
2142
|
+
}
|
|
2143
|
+
],
|
|
2144
|
+
"slots": [
|
|
2145
|
+
{
|
|
2146
|
+
"description": "The answers, as `<button value=\"…\" data-votes=\"N\">` elements. `data-votes` is the number of votes so far.",
|
|
2147
|
+
"name": ""
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
"description": "Optional text under the poll, such as when it closes. Overrides the `help-text` attribute.",
|
|
2151
|
+
"name": "help-text"
|
|
2152
|
+
}
|
|
2153
|
+
],
|
|
2154
|
+
"members": [
|
|
2155
|
+
{
|
|
2156
|
+
"kind": "field",
|
|
2157
|
+
"name": "label",
|
|
2158
|
+
"privacy": "public",
|
|
2159
|
+
"type": {
|
|
2160
|
+
"text": "string"
|
|
2161
|
+
},
|
|
2162
|
+
"description": "The question, shown above the answers.",
|
|
2163
|
+
"default": "''",
|
|
2164
|
+
"attribute": "label"
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"kind": "field",
|
|
2168
|
+
"name": "value",
|
|
2169
|
+
"privacy": "public",
|
|
2170
|
+
"type": {
|
|
2171
|
+
"text": "string"
|
|
2172
|
+
},
|
|
2173
|
+
"description": "The value of the answer the user voted for, or an empty string before a vote. Setting it shows the results with that answer marked, for a user who has already voted.",
|
|
2174
|
+
"default": "''",
|
|
2175
|
+
"attribute": "value"
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
"kind": "field",
|
|
2179
|
+
"name": "showResults",
|
|
2180
|
+
"privacy": "public",
|
|
2181
|
+
"type": {
|
|
2182
|
+
"text": "boolean"
|
|
2183
|
+
},
|
|
2184
|
+
"description": "Shows the results without a vote, such as for a closed poll.",
|
|
2185
|
+
"default": "false",
|
|
2186
|
+
"attribute": "show-results",
|
|
2187
|
+
"reflects": true
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
"kind": "field",
|
|
2191
|
+
"name": "helpText",
|
|
2192
|
+
"privacy": "public",
|
|
2193
|
+
"type": {
|
|
2194
|
+
"text": "string"
|
|
2195
|
+
},
|
|
2196
|
+
"description": "Text under the poll, such as when it closes.",
|
|
2197
|
+
"default": "''",
|
|
2198
|
+
"attribute": "help-text"
|
|
2199
|
+
}
|
|
2200
|
+
],
|
|
2201
|
+
"events": [
|
|
2202
|
+
{
|
|
2203
|
+
"type": {
|
|
2204
|
+
"text": "CustomEvent<{ value: string, item: HTMLElement }>"
|
|
2205
|
+
},
|
|
2206
|
+
"description": "When the user votes. `event.detail.value` is the answer's `value`, or its text when it has none; `event.detail.item` is the answer. Send the vote to your server here.",
|
|
2207
|
+
"name": "va-select",
|
|
2208
|
+
"x-trigger": {
|
|
2209
|
+
"how": "click-item 2"
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
],
|
|
2213
|
+
"attributes": [
|
|
2214
|
+
{
|
|
2215
|
+
"name": "label",
|
|
2216
|
+
"type": {
|
|
2217
|
+
"text": "string"
|
|
2218
|
+
},
|
|
2219
|
+
"description": "The question, shown above the answers.",
|
|
2220
|
+
"default": "''",
|
|
2221
|
+
"fieldName": "label"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
"name": "value",
|
|
2225
|
+
"type": {
|
|
2226
|
+
"text": "string"
|
|
2227
|
+
},
|
|
2228
|
+
"description": "The value of the answer the user voted for, or an empty string before a vote. Setting it shows the results with that answer marked, for a user who has already voted.",
|
|
2229
|
+
"default": "''",
|
|
2230
|
+
"fieldName": "value"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
"name": "show-results",
|
|
2234
|
+
"type": {
|
|
2235
|
+
"text": "boolean"
|
|
2236
|
+
},
|
|
2237
|
+
"description": "Shows the results without a vote, such as for a closed poll.",
|
|
2238
|
+
"default": "false",
|
|
2239
|
+
"fieldName": "showResults"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
"name": "help-text",
|
|
2243
|
+
"type": {
|
|
2244
|
+
"text": "string"
|
|
2245
|
+
},
|
|
2246
|
+
"description": "Text under the poll, such as when it closes.",
|
|
2247
|
+
"default": "''",
|
|
2248
|
+
"fieldName": "helpText"
|
|
2249
|
+
}
|
|
2250
|
+
],
|
|
2251
|
+
"superclass": {
|
|
2252
|
+
"name": "LitElement",
|
|
2253
|
+
"package": "lit"
|
|
2254
|
+
},
|
|
2255
|
+
"tagName": "va-poll",
|
|
2256
|
+
"customElement": true,
|
|
2257
|
+
"summary": "A poll: asks one question with a few answers. Visitors vote with one click and see everyone's results.",
|
|
2258
|
+
"x-keyboard": [
|
|
2259
|
+
{
|
|
2260
|
+
"context": "items",
|
|
2261
|
+
"key": "Enter",
|
|
2262
|
+
"action": "activates",
|
|
2263
|
+
"description": "Votes for the focused answer."
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
"context": "items",
|
|
2267
|
+
"key": "Space",
|
|
2268
|
+
"action": "activates",
|
|
2269
|
+
"description": "Votes for the focused answer."
|
|
2270
|
+
}
|
|
2271
|
+
],
|
|
2272
|
+
"x-keyboard-items": "button",
|
|
2273
|
+
"x-a11y": {
|
|
2274
|
+
"notes": [
|
|
2275
|
+
"After a vote the answers stay focusable but get `aria-disabled=\"true\"` and an `aria-description` with their share of the votes. A polite live region announces that the vote was counted."
|
|
2276
|
+
],
|
|
2277
|
+
"role": "group",
|
|
2278
|
+
"nameFrom": [
|
|
2279
|
+
"label"
|
|
2280
|
+
],
|
|
2281
|
+
"name": "The `label`, which is the question shown above the answers."
|
|
2282
|
+
},
|
|
2283
|
+
"x-guidance": {
|
|
2284
|
+
"use": "For a quick, one-click opinion poll on a page, with two to six answers.",
|
|
2285
|
+
"avoid": "For choices that are submitted with a form, for surveys with several questions, or where users need to review their answer before sending it.",
|
|
2286
|
+
"instead": "A radio group in a form, with a submit `va-button`."
|
|
2287
|
+
},
|
|
2288
|
+
"x-examples": [
|
|
2289
|
+
{
|
|
2290
|
+
"title": "A quick poll",
|
|
2291
|
+
"description": "Each answer is a button with a value and its votes so far in data-votes. One click counts the vote, fires va-select and shows the results.",
|
|
2292
|
+
"path": "src/poll/examples/1-quick-poll.html",
|
|
2293
|
+
"code": "<va-poll label=\"Tabs or spaces?\">\n <button value=\"tabs\" data-votes=\"12\">Tabs</button>\n <button value=\"spaces\" data-votes=\"30\">Spaces</button>\n <button value=\"formatter\" data-votes=\"9\">Whatever the formatter does</button>\n</va-poll>"
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
"title": "After a vote",
|
|
2297
|
+
"description": "Set value to the answer the user chose before, and the poll shows the results with that answer marked. help-text adds a note under the vote count.",
|
|
2298
|
+
"path": "src/poll/examples/2-already-voted.html",
|
|
2299
|
+
"code": "<va-poll label=\"Which view library do you use most?\" value=\"lit\" help-text=\"The poll closes on Friday.\">\n <button value=\"lit\" data-votes=\"48\">Lit</button>\n <button value=\"react\" data-votes=\"61\">React</button>\n <button value=\"vue\" data-votes=\"27\">Vue</button>\n <button value=\"none\" data-votes=\"14\">None, plain DOM</button>\n</va-poll>"
|
|
2300
|
+
}
|
|
2301
|
+
]
|
|
2302
|
+
}
|
|
2303
|
+
],
|
|
2304
|
+
"exports": [
|
|
2305
|
+
{
|
|
2306
|
+
"kind": "js",
|
|
2307
|
+
"name": "VaPoll",
|
|
2308
|
+
"declaration": {
|
|
2309
|
+
"name": "VaPoll",
|
|
2310
|
+
"module": "src/poll/poll.ts"
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
]
|
|
2314
|
+
},
|
|
2315
|
+
{
|
|
2316
|
+
"kind": "javascript-module",
|
|
2317
|
+
"path": "src/switch/switch.ts",
|
|
2318
|
+
"declarations": [
|
|
2319
|
+
{
|
|
2320
|
+
"kind": "class",
|
|
2321
|
+
"description": "An on/off switch for a setting that takes effect immediately.",
|
|
2322
|
+
"name": "VaSwitch",
|
|
2323
|
+
"cssProperties": [
|
|
2324
|
+
{
|
|
2325
|
+
"type": {
|
|
2326
|
+
"text": "<color>"
|
|
2327
|
+
},
|
|
2328
|
+
"description": "Track colour when off.",
|
|
2329
|
+
"name": "--va-switch-track-bg",
|
|
2330
|
+
"x-applies": {
|
|
2331
|
+
"part": "control",
|
|
2332
|
+
"state": "unchecked",
|
|
2333
|
+
"property": "background-color"
|
|
2334
|
+
}
|
|
2335
|
+
},
|
|
2336
|
+
{
|
|
2337
|
+
"type": {
|
|
2338
|
+
"text": "<color>"
|
|
2339
|
+
},
|
|
2340
|
+
"description": "Track colour when on.",
|
|
2341
|
+
"name": "--va-switch-track-bg-checked",
|
|
2342
|
+
"x-applies": {
|
|
2343
|
+
"part": "control",
|
|
2344
|
+
"state": "checked",
|
|
2345
|
+
"property": "background-color"
|
|
2346
|
+
}
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
"type": {
|
|
2350
|
+
"text": "<color>"
|
|
2351
|
+
},
|
|
2352
|
+
"description": "Thumb colour.",
|
|
2353
|
+
"name": "--va-switch-thumb-bg",
|
|
2354
|
+
"x-applies": {
|
|
2355
|
+
"part": "thumb",
|
|
2356
|
+
"property": "background-color"
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
],
|
|
2360
|
+
"cssParts": [
|
|
2361
|
+
{
|
|
2362
|
+
"description": "The switch's track (a native button with `role=\"switch\"`).",
|
|
2363
|
+
"name": "control"
|
|
2364
|
+
},
|
|
2365
|
+
{
|
|
2366
|
+
"description": "The round thumb.",
|
|
2367
|
+
"name": "thumb"
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
"description": "The label text.",
|
|
2371
|
+
"name": "label"
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
"description": "The help text.",
|
|
2375
|
+
"name": "help-text"
|
|
2376
|
+
}
|
|
2377
|
+
],
|
|
2378
|
+
"slots": [
|
|
2379
|
+
{
|
|
2380
|
+
"description": "The visible label. Clicking it flips the switch.",
|
|
2381
|
+
"name": ""
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
"description": "Optional help text under the label. It becomes the switch's description.",
|
|
2385
|
+
"name": "help-text"
|
|
2386
|
+
}
|
|
2387
|
+
],
|
|
2388
|
+
"members": [
|
|
2389
|
+
{
|
|
2390
|
+
"kind": "field",
|
|
2391
|
+
"name": "checked",
|
|
2392
|
+
"privacy": "public",
|
|
2393
|
+
"type": {
|
|
2394
|
+
"text": "boolean"
|
|
2395
|
+
},
|
|
2396
|
+
"description": "Whether the switch is on.",
|
|
2397
|
+
"default": "false",
|
|
2398
|
+
"attribute": "checked"
|
|
2399
|
+
},
|
|
2400
|
+
{
|
|
2401
|
+
"kind": "field",
|
|
2402
|
+
"name": "value",
|
|
2403
|
+
"privacy": "public",
|
|
2404
|
+
"type": {
|
|
2405
|
+
"text": "string"
|
|
2406
|
+
},
|
|
2407
|
+
"description": "Submitted with `name` while the switch is on. Defaults to `on`, as for a native checkbox.",
|
|
2408
|
+
"default": "'on'",
|
|
2409
|
+
"attribute": "value"
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
"kind": "field",
|
|
2413
|
+
"name": "accessibleLabel",
|
|
2414
|
+
"privacy": "public",
|
|
2415
|
+
"type": {
|
|
2416
|
+
"text": "string"
|
|
2417
|
+
},
|
|
2418
|
+
"description": "Accessible name for a switch with no visible label.",
|
|
2419
|
+
"default": "''",
|
|
2420
|
+
"attribute": "accessible-label"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
"kind": "field",
|
|
2424
|
+
"name": "name",
|
|
2425
|
+
"privacy": "public",
|
|
2426
|
+
"type": {
|
|
2427
|
+
"text": "string"
|
|
2428
|
+
},
|
|
2429
|
+
"description": "Submitted with the form as `name=value`.",
|
|
2430
|
+
"default": "''",
|
|
2431
|
+
"attribute": "name",
|
|
2432
|
+
"inheritedFrom": {
|
|
2433
|
+
"name": "FormControl",
|
|
2434
|
+
"module": "src/core/form-control.ts"
|
|
2435
|
+
}
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
"kind": "field",
|
|
2439
|
+
"name": "disabled",
|
|
2440
|
+
"privacy": "public",
|
|
2441
|
+
"type": {
|
|
2442
|
+
"text": "boolean"
|
|
2443
|
+
},
|
|
2444
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
2445
|
+
"default": "false",
|
|
2446
|
+
"attribute": "disabled",
|
|
2447
|
+
"reflects": true,
|
|
2448
|
+
"inheritedFrom": {
|
|
2449
|
+
"name": "FormControl",
|
|
2450
|
+
"module": "src/core/form-control.ts"
|
|
2451
|
+
}
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
"kind": "field",
|
|
2455
|
+
"name": "required",
|
|
2456
|
+
"privacy": "public",
|
|
2457
|
+
"type": {
|
|
2458
|
+
"text": "boolean"
|
|
2459
|
+
},
|
|
2460
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
2461
|
+
"default": "false",
|
|
2462
|
+
"attribute": "required",
|
|
2463
|
+
"reflects": true,
|
|
2464
|
+
"inheritedFrom": {
|
|
2465
|
+
"name": "FormControl",
|
|
2466
|
+
"module": "src/core/form-control.ts"
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2469
|
+
{
|
|
2470
|
+
"kind": "field",
|
|
2471
|
+
"name": "form",
|
|
2472
|
+
"type": {
|
|
2473
|
+
"text": "HTMLFormElement | null"
|
|
2474
|
+
},
|
|
2475
|
+
"description": "The form this control belongs to, if any.",
|
|
2476
|
+
"readonly": true,
|
|
2477
|
+
"inheritedFrom": {
|
|
2478
|
+
"name": "FormControl",
|
|
2479
|
+
"module": "src/core/form-control.ts"
|
|
2480
|
+
}
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
"kind": "field",
|
|
2484
|
+
"name": "validity",
|
|
2485
|
+
"type": {
|
|
2486
|
+
"text": "ValidityState"
|
|
2487
|
+
},
|
|
2488
|
+
"description": "The control's validity state, as on native controls.",
|
|
2489
|
+
"readonly": true,
|
|
2490
|
+
"inheritedFrom": {
|
|
2491
|
+
"name": "FormControl",
|
|
2492
|
+
"module": "src/core/form-control.ts"
|
|
2493
|
+
}
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
"kind": "field",
|
|
2497
|
+
"name": "validationMessage",
|
|
2498
|
+
"type": {
|
|
2499
|
+
"text": "string"
|
|
2500
|
+
},
|
|
2501
|
+
"description": "The message the browser shows when the control is invalid, or an empty string.",
|
|
2502
|
+
"readonly": true,
|
|
2503
|
+
"inheritedFrom": {
|
|
2504
|
+
"name": "FormControl",
|
|
2505
|
+
"module": "src/core/form-control.ts"
|
|
2506
|
+
}
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
"kind": "method",
|
|
2510
|
+
"name": "checkValidity",
|
|
2511
|
+
"return": {
|
|
2512
|
+
"type": {
|
|
2513
|
+
"text": "boolean"
|
|
2514
|
+
}
|
|
2515
|
+
},
|
|
2516
|
+
"description": "Returns true if the control is valid; otherwise fires `invalid` and returns false.",
|
|
2517
|
+
"inheritedFrom": {
|
|
2518
|
+
"name": "FormControl",
|
|
2519
|
+
"module": "src/core/form-control.ts"
|
|
2520
|
+
}
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
"kind": "method",
|
|
2524
|
+
"name": "reportValidity",
|
|
2525
|
+
"return": {
|
|
2526
|
+
"type": {
|
|
2527
|
+
"text": "boolean"
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2530
|
+
"description": "Like `checkValidity()`, but also shows the browser's message to the user.",
|
|
2531
|
+
"inheritedFrom": {
|
|
2532
|
+
"name": "FormControl",
|
|
2533
|
+
"module": "src/core/form-control.ts"
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
],
|
|
2537
|
+
"events": [
|
|
2538
|
+
{
|
|
2539
|
+
"description": "When the user flips the switch. Read `event.target.checked`.",
|
|
2540
|
+
"name": "change",
|
|
2541
|
+
"x-trigger": {
|
|
2542
|
+
"how": "click"
|
|
2543
|
+
}
|
|
2544
|
+
},
|
|
2545
|
+
{
|
|
2546
|
+
"description": "When the user flips the switch, just before `change`.",
|
|
2547
|
+
"name": "input",
|
|
2548
|
+
"x-trigger": {
|
|
2549
|
+
"how": "click"
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
],
|
|
2553
|
+
"attributes": [
|
|
2554
|
+
{
|
|
2555
|
+
"name": "checked",
|
|
2556
|
+
"type": {
|
|
2557
|
+
"text": "boolean"
|
|
2558
|
+
},
|
|
2559
|
+
"description": "Whether the switch is on.",
|
|
2560
|
+
"default": "false",
|
|
2561
|
+
"fieldName": "checked"
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
"name": "value",
|
|
2565
|
+
"type": {
|
|
2566
|
+
"text": "string"
|
|
2567
|
+
},
|
|
2568
|
+
"description": "Submitted with `name` while the switch is on. Defaults to `on`, as for a native checkbox.",
|
|
2569
|
+
"default": "'on'",
|
|
2570
|
+
"fieldName": "value"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"name": "accessible-label",
|
|
2574
|
+
"type": {
|
|
2575
|
+
"text": "string"
|
|
2576
|
+
},
|
|
2577
|
+
"description": "Accessible name for a switch with no visible label.",
|
|
2578
|
+
"default": "''",
|
|
2579
|
+
"fieldName": "accessibleLabel"
|
|
2580
|
+
},
|
|
2581
|
+
{
|
|
2582
|
+
"name": "name",
|
|
2583
|
+
"type": {
|
|
2584
|
+
"text": "string"
|
|
2585
|
+
},
|
|
2586
|
+
"description": "Submitted with the form as `name=value`.",
|
|
2587
|
+
"default": "''",
|
|
2588
|
+
"fieldName": "name",
|
|
2589
|
+
"inheritedFrom": {
|
|
2590
|
+
"name": "FormControl",
|
|
2591
|
+
"module": "src/core/form-control.ts"
|
|
2592
|
+
}
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
"name": "disabled",
|
|
2596
|
+
"type": {
|
|
2597
|
+
"text": "boolean"
|
|
2598
|
+
},
|
|
2599
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
2600
|
+
"default": "false",
|
|
2601
|
+
"fieldName": "disabled",
|
|
2602
|
+
"inheritedFrom": {
|
|
2603
|
+
"name": "FormControl",
|
|
2604
|
+
"module": "src/core/form-control.ts"
|
|
2605
|
+
}
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
"name": "required",
|
|
2609
|
+
"type": {
|
|
2610
|
+
"text": "boolean"
|
|
2611
|
+
},
|
|
2612
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
2613
|
+
"default": "false",
|
|
2614
|
+
"fieldName": "required",
|
|
2615
|
+
"inheritedFrom": {
|
|
2616
|
+
"name": "FormControl",
|
|
2617
|
+
"module": "src/core/form-control.ts"
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
],
|
|
2621
|
+
"superclass": {
|
|
2622
|
+
"name": "FormControl",
|
|
2623
|
+
"module": "/src/core/form-control.js"
|
|
2624
|
+
},
|
|
2625
|
+
"tagName": "va-switch",
|
|
2626
|
+
"customElement": true,
|
|
2627
|
+
"summary": "Turns a setting on or off, with immediate effect.",
|
|
2628
|
+
"x-keyboard": [
|
|
2629
|
+
{
|
|
2630
|
+
"context": "host",
|
|
2631
|
+
"key": "Space",
|
|
2632
|
+
"action": "toggles",
|
|
2633
|
+
"description": "Turns the switch on or off."
|
|
2634
|
+
},
|
|
2635
|
+
{
|
|
2636
|
+
"context": "host",
|
|
2637
|
+
"key": "Enter",
|
|
2638
|
+
"action": "toggles",
|
|
2639
|
+
"description": "Turns the switch on or off."
|
|
2640
|
+
},
|
|
2641
|
+
{
|
|
2642
|
+
"context": "host",
|
|
2643
|
+
"key": "Tab",
|
|
2644
|
+
"action": "focus-next",
|
|
2645
|
+
"description": "Moves focus to the next control."
|
|
2646
|
+
}
|
|
2647
|
+
],
|
|
2648
|
+
"x-a11y": {
|
|
2649
|
+
"notes": [
|
|
2650
|
+
"The state is announced as on or off, not checked or unchecked.",
|
|
2651
|
+
"Style the on state with `va-switch:state(checked)`; the `checked` attribute is the initial state only, as on a native checkbox."
|
|
2652
|
+
],
|
|
2653
|
+
"role": "switch",
|
|
2654
|
+
"nameFrom": [
|
|
2655
|
+
"text",
|
|
2656
|
+
"accessible-label"
|
|
2657
|
+
],
|
|
2658
|
+
"name": "The slotted label text. Use `accessible-label` only when there is no visible label."
|
|
2659
|
+
},
|
|
2660
|
+
"x-guidance": {
|
|
2661
|
+
"use": "For a setting that applies as soon as it changes, such as \"Dark theme\" or \"Email notifications\".",
|
|
2662
|
+
"avoid": "For a choice that is only applied when a form is submitted, or for agreeing to terms.",
|
|
2663
|
+
"instead": "`va-checkbox` for choices submitted with a form."
|
|
2664
|
+
},
|
|
2665
|
+
"x-replaces": "[role=\"switch\"]",
|
|
2666
|
+
"x-examples": [
|
|
2667
|
+
{
|
|
2668
|
+
"title": "Settings",
|
|
2669
|
+
"description": "Each switch applies its setting straight away.",
|
|
2670
|
+
"path": "src/switch/examples/1-settings.html",
|
|
2671
|
+
"code": "<va-switch checked>Email notifications</va-switch>\n<va-switch>\n Dark theme\n <span slot=\"help-text\">Uses darker colours for this page.</span>\n</va-switch>\n<va-switch disabled>Sync (needs an account)</va-switch>"
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
"title": "In a form",
|
|
2675
|
+
"description": "A switch submits name=value while it's on, and resets with its form.",
|
|
2676
|
+
"path": "src/switch/examples/2-form.html",
|
|
2677
|
+
"code": "<form>\n <va-switch name=\"newsletter\" value=\"weekly\" checked>Weekly newsletter</va-switch>\n <va-button type=\"submit\">Save</va-button>\n <va-button type=\"reset\" variant=\"secondary\">Reset</va-button>\n</form>"
|
|
2678
|
+
}
|
|
2679
|
+
]
|
|
2680
|
+
}
|
|
2681
|
+
],
|
|
2682
|
+
"exports": [
|
|
2683
|
+
{
|
|
2684
|
+
"kind": "js",
|
|
2685
|
+
"name": "VaSwitch",
|
|
2686
|
+
"declaration": {
|
|
2687
|
+
"name": "VaSwitch",
|
|
2688
|
+
"module": "src/switch/switch.ts"
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
]
|
|
2692
|
+
},
|
|
2693
|
+
{
|
|
2694
|
+
"kind": "javascript-module",
|
|
2695
|
+
"path": "src/tabs/tabs.ts",
|
|
2696
|
+
"declarations": [
|
|
2697
|
+
{
|
|
2698
|
+
"kind": "class",
|
|
2699
|
+
"description": "Tabs that switch between panels of related content, following the WAI-ARIA tabs pattern.",
|
|
2700
|
+
"name": "VaTabs",
|
|
2701
|
+
"cssProperties": [
|
|
2702
|
+
{
|
|
2703
|
+
"type": {
|
|
2704
|
+
"text": "<color>"
|
|
2705
|
+
},
|
|
2706
|
+
"description": "Colour of the line under the row of tabs.",
|
|
2707
|
+
"name": "--va-tabs-border",
|
|
2708
|
+
"x-applies": {
|
|
2709
|
+
"part": "tablist",
|
|
2710
|
+
"property": "border-bottom-color"
|
|
2711
|
+
}
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
"type": {
|
|
2715
|
+
"text": "<color>"
|
|
2716
|
+
},
|
|
2717
|
+
"description": "Colour of the selected tab's underline.",
|
|
2718
|
+
"name": "--va-tabs-indicator-border",
|
|
2719
|
+
"x-applies": {
|
|
2720
|
+
"light": "[aria-selected=\"true\"]",
|
|
2721
|
+
"property": "border-bottom-color"
|
|
2722
|
+
}
|
|
2723
|
+
},
|
|
2724
|
+
{
|
|
2725
|
+
"type": {
|
|
2726
|
+
"text": "<color>"
|
|
2727
|
+
},
|
|
2728
|
+
"description": "Text colour of tabs that aren't selected.",
|
|
2729
|
+
"name": "--va-tabs-fg",
|
|
2730
|
+
"x-applies": {
|
|
2731
|
+
"light": "[aria-selected=\"false\"]",
|
|
2732
|
+
"property": "color"
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
],
|
|
2736
|
+
"cssParts": [
|
|
2737
|
+
{
|
|
2738
|
+
"description": "The row of tabs.",
|
|
2739
|
+
"name": "tablist"
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
"description": "The wrapper around the panels.",
|
|
2743
|
+
"name": "panels"
|
|
2744
|
+
}
|
|
2745
|
+
],
|
|
2746
|
+
"slots": [
|
|
2747
|
+
{
|
|
2748
|
+
"description": "The tabs, as `<button slot=\"tab\">` elements, in order.",
|
|
2749
|
+
"name": "tab"
|
|
2750
|
+
},
|
|
2751
|
+
{
|
|
2752
|
+
"description": "The panels, as elements with `slot=\"panel\"`, in the same order as the tabs.",
|
|
2753
|
+
"name": "panel"
|
|
2754
|
+
}
|
|
2755
|
+
],
|
|
2756
|
+
"members": [
|
|
2757
|
+
{
|
|
2758
|
+
"kind": "field",
|
|
2759
|
+
"name": "selectedIndex",
|
|
2760
|
+
"privacy": "public",
|
|
2761
|
+
"type": {
|
|
2762
|
+
"text": "number"
|
|
2763
|
+
},
|
|
2764
|
+
"description": "The index of the selected tab, from 0. Kept within the tabs that exist.",
|
|
2765
|
+
"default": "0",
|
|
2766
|
+
"attribute": "selected-index",
|
|
2767
|
+
"reflects": true
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
"kind": "field",
|
|
2771
|
+
"name": "activation",
|
|
2772
|
+
"privacy": "public",
|
|
2773
|
+
"type": {
|
|
2774
|
+
"text": "'automatic' | 'manual'"
|
|
2775
|
+
},
|
|
2776
|
+
"description": "`automatic` selects a tab as soon as it gets focus; `manual` waits for Enter or Space.",
|
|
2777
|
+
"default": "'automatic'",
|
|
2778
|
+
"attribute": "activation",
|
|
2779
|
+
"reflects": true
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
"kind": "field",
|
|
2783
|
+
"name": "accessibleLabel",
|
|
2784
|
+
"privacy": "public",
|
|
2785
|
+
"type": {
|
|
2786
|
+
"text": "string"
|
|
2787
|
+
},
|
|
2788
|
+
"description": "Accessible name of the row of tabs.",
|
|
2789
|
+
"default": "''",
|
|
2790
|
+
"attribute": "accessible-label"
|
|
2791
|
+
}
|
|
2792
|
+
],
|
|
2793
|
+
"events": [
|
|
2794
|
+
{
|
|
2795
|
+
"name": "va-select",
|
|
2796
|
+
"type": {
|
|
2797
|
+
"text": "CustomEvent<{ index: number, tab: HTMLElement }>"
|
|
2798
|
+
},
|
|
2799
|
+
"description": "When the user selects a different tab. `event.detail.index` is its index; `event.detail.tab` is the tab.",
|
|
2800
|
+
"x-trigger": {
|
|
2801
|
+
"how": "click-item 2"
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
],
|
|
2805
|
+
"attributes": [
|
|
2806
|
+
{
|
|
2807
|
+
"name": "selected-index",
|
|
2808
|
+
"type": {
|
|
2809
|
+
"text": "number"
|
|
2810
|
+
},
|
|
2811
|
+
"description": "The index of the selected tab, from 0. Kept within the tabs that exist.",
|
|
2812
|
+
"default": "0",
|
|
2813
|
+
"fieldName": "selectedIndex"
|
|
2814
|
+
},
|
|
2815
|
+
{
|
|
2816
|
+
"name": "activation",
|
|
2817
|
+
"type": {
|
|
2818
|
+
"text": "'automatic' | 'manual'"
|
|
2819
|
+
},
|
|
2820
|
+
"description": "`automatic` selects a tab as soon as it gets focus; `manual` waits for Enter or Space.",
|
|
2821
|
+
"default": "'automatic'",
|
|
2822
|
+
"fieldName": "activation"
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
"name": "accessible-label",
|
|
2826
|
+
"type": {
|
|
2827
|
+
"text": "string"
|
|
2828
|
+
},
|
|
2829
|
+
"description": "Accessible name of the row of tabs.",
|
|
2830
|
+
"default": "''",
|
|
2831
|
+
"fieldName": "accessibleLabel"
|
|
2832
|
+
}
|
|
2833
|
+
],
|
|
2834
|
+
"superclass": {
|
|
2835
|
+
"name": "LitElement",
|
|
2836
|
+
"package": "lit"
|
|
2837
|
+
},
|
|
2838
|
+
"tagName": "va-tabs",
|
|
2839
|
+
"customElement": true,
|
|
2840
|
+
"summary": "Switches between panels of related content in the same place on the page.",
|
|
2841
|
+
"x-keyboard": [
|
|
2842
|
+
{
|
|
2843
|
+
"context": "items",
|
|
2844
|
+
"key": "ArrowRight",
|
|
2845
|
+
"action": "next",
|
|
2846
|
+
"description": "Moves to the next tab, wrapping round. Selects it unless `activation=\"manual\"`."
|
|
2847
|
+
},
|
|
2848
|
+
{
|
|
2849
|
+
"context": "items",
|
|
2850
|
+
"key": "ArrowLeft",
|
|
2851
|
+
"action": "previous",
|
|
2852
|
+
"description": "Moves to the previous tab, wrapping round."
|
|
2853
|
+
},
|
|
2854
|
+
{
|
|
2855
|
+
"context": "items",
|
|
2856
|
+
"key": "Home",
|
|
2857
|
+
"action": "first",
|
|
2858
|
+
"description": "Moves to the first tab."
|
|
2859
|
+
},
|
|
2860
|
+
{
|
|
2861
|
+
"context": "items",
|
|
2862
|
+
"key": "End",
|
|
2863
|
+
"action": "last",
|
|
2864
|
+
"description": "Moves to the last tab."
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
"context": "items",
|
|
2868
|
+
"key": "Enter",
|
|
2869
|
+
"action": "activates",
|
|
2870
|
+
"description": "Selects the focused tab (needed when `activation=\"manual\"`)."
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
"context": "items",
|
|
2874
|
+
"key": "Tab",
|
|
2875
|
+
"action": "focus-next",
|
|
2876
|
+
"description": "Moves focus from the tabs into the selected panel."
|
|
2877
|
+
}
|
|
2878
|
+
],
|
|
2879
|
+
"x-keyboard-items": "[slot=\"tab\"]",
|
|
2880
|
+
"x-a11y": {
|
|
2881
|
+
"notes": [
|
|
2882
|
+
"Each tab gets `role=\"tab\"`, `aria-selected` and `aria-controls`; each panel gets `role=\"tabpanel\"` and `aria-labelledby`.",
|
|
2883
|
+
"Only the selected tab is in the Tab order (roving tabindex); arrow keys move between tabs."
|
|
2884
|
+
],
|
|
2885
|
+
"role": "tablist",
|
|
2886
|
+
"nameFrom": [
|
|
2887
|
+
"accessible-label"
|
|
2888
|
+
],
|
|
2889
|
+
"name": "The `accessible-label` attribute, such as \"Account settings\" (not shown)."
|
|
2890
|
+
},
|
|
2891
|
+
"x-guidance": {
|
|
2892
|
+
"use": "To switch between a few views of related content in one place, such as sections of a settings page.",
|
|
2893
|
+
"avoid": "For navigation between pages, for steps in a sequence, or for more than about 6 tabs.",
|
|
2894
|
+
"instead": "Links for navigation; a stepper for sequences; a list or menu for many options."
|
|
2895
|
+
},
|
|
2896
|
+
"x-replaces": "[role=\"tablist\"]",
|
|
2897
|
+
"x-examples": [
|
|
2898
|
+
{
|
|
2899
|
+
"title": "Settings sections",
|
|
2900
|
+
"description": "Tabs are buttons in the tab slot; panels follow in the same order. Arrow keys move between tabs.",
|
|
2901
|
+
"path": "src/tabs/examples/1-settings.html",
|
|
2902
|
+
"code": "<va-tabs accessible-label=\"Account settings\">\n <button slot=\"tab\">Profile</button>\n <button slot=\"tab\">Notifications</button>\n <button slot=\"tab\">Billing</button>\n <div slot=\"panel\"><p>Your name, photo and bio.</p></div>\n <div slot=\"panel\"><p>Choose what we email you about.</p></div>\n <div slot=\"panel\"><p>Plan, invoices and payment method.</p></div>\n</va-tabs>"
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
"title": "Manual activation",
|
|
2906
|
+
"description": "With activation=\"manual\", arrow keys only move focus; Enter or Space selects. Use it when showing a panel is slow.",
|
|
2907
|
+
"path": "src/tabs/examples/2-manual.html",
|
|
2908
|
+
"code": "<va-tabs accessible-label=\"Reports\" activation=\"manual\" selected-index=\"1\">\n <button slot=\"tab\">Daily</button>\n <button slot=\"tab\">Weekly</button>\n <button slot=\"tab\">Monthly</button>\n <div slot=\"panel\"><p>Today's numbers.</p></div>\n <div slot=\"panel\"><p>This week's numbers.</p></div>\n <div slot=\"panel\"><p>This month's numbers.</p></div>\n</va-tabs>"
|
|
2909
|
+
}
|
|
2910
|
+
]
|
|
2911
|
+
}
|
|
2912
|
+
],
|
|
2913
|
+
"exports": [
|
|
2914
|
+
{
|
|
2915
|
+
"kind": "js",
|
|
2916
|
+
"name": "VaTabs",
|
|
2917
|
+
"declaration": {
|
|
2918
|
+
"name": "VaTabs",
|
|
2919
|
+
"module": "src/tabs/tabs.ts"
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
]
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
"kind": "javascript-module",
|
|
2926
|
+
"path": "src/text-field/text-field.ts",
|
|
2927
|
+
"declarations": [
|
|
2928
|
+
{
|
|
2929
|
+
"kind": "class",
|
|
2930
|
+
"description": "A single-line text input with a visible label, help text and error message.",
|
|
2931
|
+
"name": "VaTextField",
|
|
2932
|
+
"cssProperties": [
|
|
2933
|
+
{
|
|
2934
|
+
"type": {
|
|
2935
|
+
"text": "<color>"
|
|
2936
|
+
},
|
|
2937
|
+
"description": "Background colour of the field.",
|
|
2938
|
+
"name": "--va-text-field-bg",
|
|
2939
|
+
"x-applies": {
|
|
2940
|
+
"part": "field",
|
|
2941
|
+
"property": "background-color"
|
|
2942
|
+
}
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
"type": {
|
|
2946
|
+
"text": "<color>"
|
|
2947
|
+
},
|
|
2948
|
+
"description": "Border colour of the field.",
|
|
2949
|
+
"name": "--va-text-field-border",
|
|
2950
|
+
"x-applies": {
|
|
2951
|
+
"part": "field",
|
|
2952
|
+
"property": "border-top-color"
|
|
2953
|
+
}
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
"type": {
|
|
2957
|
+
"text": "<color>"
|
|
2958
|
+
},
|
|
2959
|
+
"description": "Border colour while the field shows an error.",
|
|
2960
|
+
"name": "--va-text-field-border-invalid",
|
|
2961
|
+
"x-applies": {
|
|
2962
|
+
"part": "field",
|
|
2963
|
+
"state": "invalid",
|
|
2964
|
+
"property": "border-top-color"
|
|
2965
|
+
}
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
"type": {
|
|
2969
|
+
"text": "<length>"
|
|
2970
|
+
},
|
|
2971
|
+
"description": "Corner radius of the field.",
|
|
2972
|
+
"name": "--va-text-field-radius",
|
|
2973
|
+
"x-applies": {
|
|
2974
|
+
"part": "field",
|
|
2975
|
+
"property": "border-top-left-radius"
|
|
2976
|
+
}
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
"type": {
|
|
2980
|
+
"text": "<length>"
|
|
2981
|
+
},
|
|
2982
|
+
"description": "Minimum height of the field.",
|
|
2983
|
+
"name": "--va-text-field-height",
|
|
2984
|
+
"x-applies": {
|
|
2985
|
+
"part": "field",
|
|
2986
|
+
"property": "min-height"
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
],
|
|
2990
|
+
"cssParts": [
|
|
2991
|
+
{
|
|
2992
|
+
"description": "The visible label.",
|
|
2993
|
+
"name": "label"
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
"description": "The box around the input and its icons.",
|
|
2997
|
+
"name": "field"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"description": "The native input.",
|
|
3001
|
+
"name": "input"
|
|
3002
|
+
},
|
|
3003
|
+
{
|
|
3004
|
+
"description": "The help text.",
|
|
3005
|
+
"name": "help-text"
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
"description": "The error message.",
|
|
3009
|
+
"name": "error"
|
|
3010
|
+
}
|
|
3011
|
+
],
|
|
3012
|
+
"slots": [
|
|
3013
|
+
{
|
|
3014
|
+
"description": "An icon or prefix inside the field, before the text.",
|
|
3015
|
+
"name": "start"
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
"description": "An icon or suffix inside the field, after the text.",
|
|
3019
|
+
"name": "end"
|
|
3020
|
+
}
|
|
3021
|
+
],
|
|
3022
|
+
"members": [
|
|
3023
|
+
{
|
|
3024
|
+
"kind": "field",
|
|
3025
|
+
"name": "label",
|
|
3026
|
+
"privacy": "public",
|
|
3027
|
+
"type": {
|
|
3028
|
+
"text": "string"
|
|
3029
|
+
},
|
|
3030
|
+
"description": "The visible label above the field. Required: it is also the field's accessible name.",
|
|
3031
|
+
"default": "''",
|
|
3032
|
+
"attribute": "label"
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
"kind": "field",
|
|
3036
|
+
"name": "type",
|
|
3037
|
+
"privacy": "public",
|
|
3038
|
+
"type": {
|
|
3039
|
+
"text": "'text' | 'email' | 'password' | 'search' | 'tel' | 'url'"
|
|
3040
|
+
},
|
|
3041
|
+
"description": "The kind of text. Sets the keyboard on phones and the built-in validation.",
|
|
3042
|
+
"default": "'text'",
|
|
3043
|
+
"attribute": "type"
|
|
3044
|
+
},
|
|
3045
|
+
{
|
|
3046
|
+
"kind": "field",
|
|
3047
|
+
"name": "value",
|
|
3048
|
+
"privacy": "public",
|
|
3049
|
+
"type": {
|
|
3050
|
+
"text": "string"
|
|
3051
|
+
},
|
|
3052
|
+
"description": "The current text.",
|
|
3053
|
+
"default": "''",
|
|
3054
|
+
"attribute": "value"
|
|
3055
|
+
},
|
|
3056
|
+
{
|
|
3057
|
+
"kind": "field",
|
|
3058
|
+
"name": "placeholder",
|
|
3059
|
+
"privacy": "public",
|
|
3060
|
+
"type": {
|
|
3061
|
+
"text": "string"
|
|
3062
|
+
},
|
|
3063
|
+
"description": "Example text shown while the field is empty. Never a substitute for `label`.",
|
|
3064
|
+
"default": "''",
|
|
3065
|
+
"attribute": "placeholder"
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
"kind": "field",
|
|
3069
|
+
"name": "helpText",
|
|
3070
|
+
"privacy": "public",
|
|
3071
|
+
"type": {
|
|
3072
|
+
"text": "string"
|
|
3073
|
+
},
|
|
3074
|
+
"description": "Help text under the field, such as the expected format.",
|
|
3075
|
+
"default": "''",
|
|
3076
|
+
"attribute": "help-text"
|
|
3077
|
+
},
|
|
3078
|
+
{
|
|
3079
|
+
"kind": "field",
|
|
3080
|
+
"name": "error",
|
|
3081
|
+
"privacy": "public",
|
|
3082
|
+
"type": {
|
|
3083
|
+
"text": "string"
|
|
3084
|
+
},
|
|
3085
|
+
"description": "A custom error message. While set, the field is invalid and shows it.",
|
|
3086
|
+
"default": "''",
|
|
3087
|
+
"attribute": "error"
|
|
3088
|
+
},
|
|
3089
|
+
{
|
|
3090
|
+
"kind": "field",
|
|
3091
|
+
"name": "readOnly",
|
|
3092
|
+
"privacy": "public",
|
|
3093
|
+
"type": {
|
|
3094
|
+
"text": "boolean"
|
|
3095
|
+
},
|
|
3096
|
+
"description": "The text can be selected and submitted, but not changed.",
|
|
3097
|
+
"default": "false",
|
|
3098
|
+
"attribute": "readonly",
|
|
3099
|
+
"reflects": true
|
|
3100
|
+
},
|
|
3101
|
+
{
|
|
3102
|
+
"kind": "field",
|
|
3103
|
+
"name": "minLength",
|
|
3104
|
+
"privacy": "public",
|
|
3105
|
+
"type": {
|
|
3106
|
+
"text": "number"
|
|
3107
|
+
},
|
|
3108
|
+
"description": "The minimum number of characters.",
|
|
3109
|
+
"attribute": "minlength"
|
|
3110
|
+
},
|
|
3111
|
+
{
|
|
3112
|
+
"kind": "field",
|
|
3113
|
+
"name": "maxLength",
|
|
3114
|
+
"privacy": "public",
|
|
3115
|
+
"type": {
|
|
3116
|
+
"text": "number"
|
|
3117
|
+
},
|
|
3118
|
+
"description": "The maximum number of characters.",
|
|
3119
|
+
"attribute": "maxlength"
|
|
3120
|
+
},
|
|
3121
|
+
{
|
|
3122
|
+
"kind": "field",
|
|
3123
|
+
"name": "pattern",
|
|
3124
|
+
"privacy": "public",
|
|
3125
|
+
"type": {
|
|
3126
|
+
"text": "string"
|
|
3127
|
+
},
|
|
3128
|
+
"description": "A regular expression the whole value must match.",
|
|
3129
|
+
"default": "''",
|
|
3130
|
+
"attribute": "pattern"
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
"kind": "field",
|
|
3134
|
+
"name": "autocomplete",
|
|
3135
|
+
"privacy": "public",
|
|
3136
|
+
"type": {
|
|
3137
|
+
"text": "string"
|
|
3138
|
+
},
|
|
3139
|
+
"description": "A hint for the browser's autofill, such as `email` or `name`.",
|
|
3140
|
+
"default": "''",
|
|
3141
|
+
"attribute": "autocomplete"
|
|
3142
|
+
},
|
|
3143
|
+
{
|
|
3144
|
+
"kind": "method",
|
|
3145
|
+
"name": "select",
|
|
3146
|
+
"return": {
|
|
3147
|
+
"type": {
|
|
3148
|
+
"text": "void"
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
"description": "Selects all the text in the field."
|
|
3152
|
+
},
|
|
3153
|
+
{
|
|
3154
|
+
"kind": "field",
|
|
3155
|
+
"name": "name",
|
|
3156
|
+
"privacy": "public",
|
|
3157
|
+
"type": {
|
|
3158
|
+
"text": "string"
|
|
3159
|
+
},
|
|
3160
|
+
"description": "Submitted with the form as `name=value`.",
|
|
3161
|
+
"default": "''",
|
|
3162
|
+
"attribute": "name",
|
|
3163
|
+
"inheritedFrom": {
|
|
3164
|
+
"name": "FormControl",
|
|
3165
|
+
"module": "src/core/form-control.ts"
|
|
3166
|
+
}
|
|
3167
|
+
},
|
|
3168
|
+
{
|
|
3169
|
+
"kind": "field",
|
|
3170
|
+
"name": "disabled",
|
|
3171
|
+
"privacy": "public",
|
|
3172
|
+
"type": {
|
|
3173
|
+
"text": "boolean"
|
|
3174
|
+
},
|
|
3175
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
3176
|
+
"default": "false",
|
|
3177
|
+
"attribute": "disabled",
|
|
3178
|
+
"reflects": true,
|
|
3179
|
+
"inheritedFrom": {
|
|
3180
|
+
"name": "FormControl",
|
|
3181
|
+
"module": "src/core/form-control.ts"
|
|
3182
|
+
}
|
|
3183
|
+
},
|
|
3184
|
+
{
|
|
3185
|
+
"kind": "field",
|
|
3186
|
+
"name": "required",
|
|
3187
|
+
"privacy": "public",
|
|
3188
|
+
"type": {
|
|
3189
|
+
"text": "boolean"
|
|
3190
|
+
},
|
|
3191
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
3192
|
+
"default": "false",
|
|
3193
|
+
"attribute": "required",
|
|
3194
|
+
"reflects": true,
|
|
3195
|
+
"inheritedFrom": {
|
|
3196
|
+
"name": "FormControl",
|
|
3197
|
+
"module": "src/core/form-control.ts"
|
|
3198
|
+
}
|
|
3199
|
+
},
|
|
3200
|
+
{
|
|
3201
|
+
"kind": "field",
|
|
3202
|
+
"name": "form",
|
|
3203
|
+
"type": {
|
|
3204
|
+
"text": "HTMLFormElement | null"
|
|
3205
|
+
},
|
|
3206
|
+
"description": "The form this control belongs to, if any.",
|
|
3207
|
+
"readonly": true,
|
|
3208
|
+
"inheritedFrom": {
|
|
3209
|
+
"name": "FormControl",
|
|
3210
|
+
"module": "src/core/form-control.ts"
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
3213
|
+
{
|
|
3214
|
+
"kind": "field",
|
|
3215
|
+
"name": "validity",
|
|
3216
|
+
"type": {
|
|
3217
|
+
"text": "ValidityState"
|
|
3218
|
+
},
|
|
3219
|
+
"description": "The control's validity state, as on native controls.",
|
|
3220
|
+
"readonly": true,
|
|
3221
|
+
"inheritedFrom": {
|
|
3222
|
+
"name": "FormControl",
|
|
3223
|
+
"module": "src/core/form-control.ts"
|
|
3224
|
+
}
|
|
3225
|
+
},
|
|
3226
|
+
{
|
|
3227
|
+
"kind": "field",
|
|
3228
|
+
"name": "validationMessage",
|
|
3229
|
+
"type": {
|
|
3230
|
+
"text": "string"
|
|
3231
|
+
},
|
|
3232
|
+
"description": "The message the browser shows when the control is invalid, or an empty string.",
|
|
3233
|
+
"readonly": true,
|
|
3234
|
+
"inheritedFrom": {
|
|
3235
|
+
"name": "FormControl",
|
|
3236
|
+
"module": "src/core/form-control.ts"
|
|
3237
|
+
}
|
|
3238
|
+
},
|
|
3239
|
+
{
|
|
3240
|
+
"kind": "method",
|
|
3241
|
+
"name": "checkValidity",
|
|
3242
|
+
"return": {
|
|
3243
|
+
"type": {
|
|
3244
|
+
"text": "boolean"
|
|
3245
|
+
}
|
|
3246
|
+
},
|
|
3247
|
+
"description": "Returns true if the control is valid; otherwise fires `invalid` and returns false.",
|
|
3248
|
+
"inheritedFrom": {
|
|
3249
|
+
"name": "FormControl",
|
|
3250
|
+
"module": "src/core/form-control.ts"
|
|
3251
|
+
}
|
|
3252
|
+
},
|
|
3253
|
+
{
|
|
3254
|
+
"kind": "method",
|
|
3255
|
+
"name": "reportValidity",
|
|
3256
|
+
"return": {
|
|
3257
|
+
"type": {
|
|
3258
|
+
"text": "boolean"
|
|
3259
|
+
}
|
|
3260
|
+
},
|
|
3261
|
+
"description": "Like `checkValidity()`, but also shows the browser's message to the user.",
|
|
3262
|
+
"inheritedFrom": {
|
|
3263
|
+
"name": "FormControl",
|
|
3264
|
+
"module": "src/core/form-control.ts"
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
],
|
|
3268
|
+
"events": [
|
|
3269
|
+
{
|
|
3270
|
+
"description": "The native input event, on every keystroke. Read `event.target.value`.",
|
|
3271
|
+
"name": "input",
|
|
3272
|
+
"x-trigger": {
|
|
3273
|
+
"how": "press a"
|
|
3274
|
+
}
|
|
3275
|
+
},
|
|
3276
|
+
{
|
|
3277
|
+
"description": "When the user commits a change, by leaving the field or pressing Enter.",
|
|
3278
|
+
"name": "change",
|
|
3279
|
+
"x-trigger": {
|
|
3280
|
+
"how": "commit"
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
],
|
|
3284
|
+
"attributes": [
|
|
3285
|
+
{
|
|
3286
|
+
"name": "label",
|
|
3287
|
+
"type": {
|
|
3288
|
+
"text": "string"
|
|
3289
|
+
},
|
|
3290
|
+
"description": "The visible label above the field. Required: it is also the field's accessible name.",
|
|
3291
|
+
"default": "''",
|
|
3292
|
+
"fieldName": "label"
|
|
3293
|
+
},
|
|
3294
|
+
{
|
|
3295
|
+
"name": "type",
|
|
3296
|
+
"type": {
|
|
3297
|
+
"text": "'text' | 'email' | 'password' | 'search' | 'tel' | 'url'"
|
|
3298
|
+
},
|
|
3299
|
+
"description": "The kind of text. Sets the keyboard on phones and the built-in validation.",
|
|
3300
|
+
"default": "'text'",
|
|
3301
|
+
"fieldName": "type"
|
|
3302
|
+
},
|
|
3303
|
+
{
|
|
3304
|
+
"name": "value",
|
|
3305
|
+
"type": {
|
|
3306
|
+
"text": "string"
|
|
3307
|
+
},
|
|
3308
|
+
"description": "The current text.",
|
|
3309
|
+
"default": "''",
|
|
3310
|
+
"fieldName": "value"
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
"name": "placeholder",
|
|
3314
|
+
"type": {
|
|
3315
|
+
"text": "string"
|
|
3316
|
+
},
|
|
3317
|
+
"description": "Example text shown while the field is empty. Never a substitute for `label`.",
|
|
3318
|
+
"default": "''",
|
|
3319
|
+
"fieldName": "placeholder"
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
"name": "help-text",
|
|
3323
|
+
"type": {
|
|
3324
|
+
"text": "string"
|
|
3325
|
+
},
|
|
3326
|
+
"description": "Help text under the field, such as the expected format.",
|
|
3327
|
+
"default": "''",
|
|
3328
|
+
"fieldName": "helpText"
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
"name": "error",
|
|
3332
|
+
"type": {
|
|
3333
|
+
"text": "string"
|
|
3334
|
+
},
|
|
3335
|
+
"description": "A custom error message. While set, the field is invalid and shows it.",
|
|
3336
|
+
"default": "''",
|
|
3337
|
+
"fieldName": "error"
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
"name": "readonly",
|
|
3341
|
+
"type": {
|
|
3342
|
+
"text": "boolean"
|
|
3343
|
+
},
|
|
3344
|
+
"description": "The text can be selected and submitted, but not changed.",
|
|
3345
|
+
"default": "false",
|
|
3346
|
+
"fieldName": "readOnly"
|
|
3347
|
+
},
|
|
3348
|
+
{
|
|
3349
|
+
"name": "minlength",
|
|
3350
|
+
"type": {
|
|
3351
|
+
"text": "number"
|
|
3352
|
+
},
|
|
3353
|
+
"description": "The minimum number of characters.",
|
|
3354
|
+
"fieldName": "minLength"
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
"name": "maxlength",
|
|
3358
|
+
"type": {
|
|
3359
|
+
"text": "number"
|
|
3360
|
+
},
|
|
3361
|
+
"description": "The maximum number of characters.",
|
|
3362
|
+
"fieldName": "maxLength"
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
"name": "pattern",
|
|
3366
|
+
"type": {
|
|
3367
|
+
"text": "string"
|
|
3368
|
+
},
|
|
3369
|
+
"description": "A regular expression the whole value must match.",
|
|
3370
|
+
"default": "''",
|
|
3371
|
+
"fieldName": "pattern"
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
"name": "autocomplete",
|
|
3375
|
+
"type": {
|
|
3376
|
+
"text": "string"
|
|
3377
|
+
},
|
|
3378
|
+
"description": "A hint for the browser's autofill, such as `email` or `name`.",
|
|
3379
|
+
"default": "''",
|
|
3380
|
+
"fieldName": "autocomplete"
|
|
3381
|
+
},
|
|
3382
|
+
{
|
|
3383
|
+
"name": "name",
|
|
3384
|
+
"type": {
|
|
3385
|
+
"text": "string"
|
|
3386
|
+
},
|
|
3387
|
+
"description": "Submitted with the form as `name=value`.",
|
|
3388
|
+
"default": "''",
|
|
3389
|
+
"fieldName": "name",
|
|
3390
|
+
"inheritedFrom": {
|
|
3391
|
+
"name": "FormControl",
|
|
3392
|
+
"module": "src/core/form-control.ts"
|
|
3393
|
+
}
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
"name": "disabled",
|
|
3397
|
+
"type": {
|
|
3398
|
+
"text": "boolean"
|
|
3399
|
+
},
|
|
3400
|
+
"description": "Disables the control. It can't be focused, changed or submitted.",
|
|
3401
|
+
"default": "false",
|
|
3402
|
+
"fieldName": "disabled",
|
|
3403
|
+
"inheritedFrom": {
|
|
3404
|
+
"name": "FormControl",
|
|
3405
|
+
"module": "src/core/form-control.ts"
|
|
3406
|
+
}
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
"name": "required",
|
|
3410
|
+
"type": {
|
|
3411
|
+
"text": "boolean"
|
|
3412
|
+
},
|
|
3413
|
+
"description": "The control must have a value before its form can be submitted.",
|
|
3414
|
+
"default": "false",
|
|
3415
|
+
"fieldName": "required",
|
|
3416
|
+
"inheritedFrom": {
|
|
3417
|
+
"name": "FormControl",
|
|
3418
|
+
"module": "src/core/form-control.ts"
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
],
|
|
3422
|
+
"superclass": {
|
|
3423
|
+
"name": "FormControl",
|
|
3424
|
+
"module": "/src/core/form-control.js"
|
|
3425
|
+
},
|
|
3426
|
+
"tagName": "va-text-field",
|
|
3427
|
+
"customElement": true,
|
|
3428
|
+
"summary": "Collects a short piece of text, such as a name, an email address or a search term.",
|
|
3429
|
+
"x-keyboard": [
|
|
3430
|
+
{
|
|
3431
|
+
"context": "host",
|
|
3432
|
+
"key": "Tab",
|
|
3433
|
+
"action": "focus-next",
|
|
3434
|
+
"description": "Moves focus to the next control."
|
|
3435
|
+
}
|
|
3436
|
+
],
|
|
3437
|
+
"x-a11y": {
|
|
3438
|
+
"notes": [
|
|
3439
|
+
"Help text and the error message are linked with `aria-describedby`; the error also sets `aria-invalid`.",
|
|
3440
|
+
"Errors appear after the user leaves the field or submits the form, not while they type."
|
|
3441
|
+
],
|
|
3442
|
+
"role": "textbox",
|
|
3443
|
+
"nameFrom": [
|
|
3444
|
+
"label"
|
|
3445
|
+
],
|
|
3446
|
+
"name": "The `label` attribute, shown above the field. Every text field needs one."
|
|
3447
|
+
},
|
|
3448
|
+
"x-guidance": {
|
|
3449
|
+
"use": "For short, free-form text: names, email addresses, search terms, codes.",
|
|
3450
|
+
"avoid": "For long text, or for picking from a fixed set of options.",
|
|
3451
|
+
"instead": "A textarea for long text; a select or radio group for fixed options."
|
|
3452
|
+
},
|
|
3453
|
+
"x-replaces": "input:not([type]), input[type=\"text\"], input[type=\"email\"], input[type=\"password\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"url\"]",
|
|
3454
|
+
"x-examples": [
|
|
3455
|
+
{
|
|
3456
|
+
"title": "Label, help and placeholder",
|
|
3457
|
+
"description": "Every field has a visible label. Help text says what format to use; a placeholder only gives an example.",
|
|
3458
|
+
"path": "src/text-field/examples/1-basic.html",
|
|
3459
|
+
"code": "<va-text-field label=\"Full name\" autocomplete=\"name\"></va-text-field>\n<va-text-field label=\"Username\" help-text=\"Letters and numbers only, 3 to 20 characters.\" placeholder=\"e.g. ada99\" minlength=\"3\" maxlength=\"20\" pattern=\"[A-Za-z0-9]+\"></va-text-field>"
|
|
3460
|
+
},
|
|
3461
|
+
{
|
|
3462
|
+
"title": "Validation in a form",
|
|
3463
|
+
"description": "Errors show after the user leaves the field or submits, never while they type.",
|
|
3464
|
+
"path": "src/text-field/examples/2-validation.html",
|
|
3465
|
+
"code": "<form>\n <va-text-field label=\"Email address\" name=\"email\" type=\"email\" required autocomplete=\"email\"></va-text-field>\n <va-button type=\"submit\">Subscribe</va-button>\n</form>"
|
|
3466
|
+
},
|
|
3467
|
+
{
|
|
3468
|
+
"title": "Custom error, read-only and disabled",
|
|
3469
|
+
"description": "Set error to show a message from your own validation, such as a server check.",
|
|
3470
|
+
"path": "src/text-field/examples/3-states.html",
|
|
3471
|
+
"code": "<va-text-field label=\"Coupon code\" value=\"SPRING\" error=\"This code has expired.\"></va-text-field>\n<va-text-field label=\"Account ID\" value=\"ACC-20817\" readonly></va-text-field>\n<va-text-field label=\"Company\" disabled help-text=\"Only an admin can change this.\"></va-text-field>"
|
|
3472
|
+
}
|
|
3473
|
+
]
|
|
3474
|
+
}
|
|
3475
|
+
],
|
|
3476
|
+
"exports": [
|
|
3477
|
+
{
|
|
3478
|
+
"kind": "js",
|
|
3479
|
+
"name": "VaTextField",
|
|
3480
|
+
"declaration": {
|
|
3481
|
+
"name": "VaTextField",
|
|
3482
|
+
"module": "src/text-field/text-field.ts"
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
]
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
"kind": "javascript-module",
|
|
3489
|
+
"path": "src/toast/toast.ts",
|
|
3490
|
+
"declarations": [
|
|
3491
|
+
{
|
|
3492
|
+
"kind": "class",
|
|
3493
|
+
"description": "A region for short, non-blocking status messages (\"toasts\"). Place one per page and call `show()`,\nor point a `va-button` at it with `command=\"--show\"`; the button's `value` is the message.",
|
|
3494
|
+
"name": "VaToast",
|
|
3495
|
+
"cssProperties": [
|
|
3496
|
+
{
|
|
3497
|
+
"type": {
|
|
3498
|
+
"text": "<color>"
|
|
3499
|
+
},
|
|
3500
|
+
"description": "Background colour of a message.",
|
|
3501
|
+
"name": "--va-toast-bg",
|
|
3502
|
+
"x-applies": {
|
|
3503
|
+
"part": "toast",
|
|
3504
|
+
"state": "open",
|
|
3505
|
+
"property": "background-color"
|
|
3506
|
+
}
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
"type": {
|
|
3510
|
+
"text": "<color>"
|
|
3511
|
+
},
|
|
3512
|
+
"description": "Text colour of a message.",
|
|
3513
|
+
"name": "--va-toast-fg",
|
|
3514
|
+
"x-applies": {
|
|
3515
|
+
"part": "toast",
|
|
3516
|
+
"state": "open",
|
|
3517
|
+
"property": "color"
|
|
3518
|
+
}
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
"type": {
|
|
3522
|
+
"text": "<length>"
|
|
3523
|
+
},
|
|
3524
|
+
"description": "Corner radius of a message.",
|
|
3525
|
+
"name": "--va-toast-radius",
|
|
3526
|
+
"x-applies": {
|
|
3527
|
+
"part": "toast",
|
|
3528
|
+
"state": "open",
|
|
3529
|
+
"property": "border-top-left-radius"
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
],
|
|
3533
|
+
"cssParts": [
|
|
3534
|
+
{
|
|
3535
|
+
"description": "The fixed area the toasts appear in.",
|
|
3536
|
+
"name": "region"
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
"description": "Each message.",
|
|
3540
|
+
"name": "toast"
|
|
3541
|
+
},
|
|
3542
|
+
{
|
|
3543
|
+
"description": "Each message's close button.",
|
|
3544
|
+
"name": "close-button"
|
|
3545
|
+
}
|
|
3546
|
+
],
|
|
3547
|
+
"members": [
|
|
3548
|
+
{
|
|
3549
|
+
"kind": "field",
|
|
3550
|
+
"name": "duration",
|
|
3551
|
+
"privacy": "public",
|
|
3552
|
+
"type": {
|
|
3553
|
+
"text": "number"
|
|
3554
|
+
},
|
|
3555
|
+
"description": "Milliseconds before an info or success message closes by itself. Errors stay until dismissed.",
|
|
3556
|
+
"default": "5000",
|
|
3557
|
+
"attribute": "duration"
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
"kind": "field",
|
|
3561
|
+
"name": "accessibleLabel",
|
|
3562
|
+
"privacy": "public",
|
|
3563
|
+
"type": {
|
|
3564
|
+
"text": "string"
|
|
3565
|
+
},
|
|
3566
|
+
"description": "Accessible name of the region. Not shown.",
|
|
3567
|
+
"default": "'Notifications'",
|
|
3568
|
+
"attribute": "accessible-label"
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
"kind": "field",
|
|
3572
|
+
"name": "hasMessages",
|
|
3573
|
+
"type": {
|
|
3574
|
+
"text": "boolean"
|
|
3575
|
+
},
|
|
3576
|
+
"description": "True while at least one message is showing.",
|
|
3577
|
+
"readonly": true
|
|
3578
|
+
},
|
|
3579
|
+
{
|
|
3580
|
+
"kind": "method",
|
|
3581
|
+
"name": "show",
|
|
3582
|
+
"return": {
|
|
3583
|
+
"type": {
|
|
3584
|
+
"text": "number"
|
|
3585
|
+
}
|
|
3586
|
+
},
|
|
3587
|
+
"parameters": [
|
|
3588
|
+
{
|
|
3589
|
+
"name": "message",
|
|
3590
|
+
"type": {
|
|
3591
|
+
"text": "string"
|
|
3592
|
+
}
|
|
3593
|
+
},
|
|
3594
|
+
{
|
|
3595
|
+
"name": "options",
|
|
3596
|
+
"default": "{}",
|
|
3597
|
+
"type": {
|
|
3598
|
+
"text": "{ variant?: 'info' | 'success' | 'error'; duration?: number }"
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
],
|
|
3602
|
+
"description": "Shows a message and returns its id. `variant` defaults to `info`; errors stay until dismissed."
|
|
3603
|
+
},
|
|
3604
|
+
{
|
|
3605
|
+
"kind": "method",
|
|
3606
|
+
"name": "dismiss",
|
|
3607
|
+
"return": {
|
|
3608
|
+
"type": {
|
|
3609
|
+
"text": "void"
|
|
3610
|
+
}
|
|
3611
|
+
},
|
|
3612
|
+
"parameters": [
|
|
3613
|
+
{
|
|
3614
|
+
"name": "id",
|
|
3615
|
+
"optional": true,
|
|
3616
|
+
"type": {
|
|
3617
|
+
"text": "number"
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
],
|
|
3621
|
+
"description": "Closes one message by id, or every message when no id is given."
|
|
3622
|
+
}
|
|
3623
|
+
],
|
|
3624
|
+
"events": [
|
|
3625
|
+
{
|
|
3626
|
+
"name": "va-dismiss",
|
|
3627
|
+
"type": {
|
|
3628
|
+
"text": "CustomEvent<{ id: number, reason: 'timeout' | 'close-button' | 'escape' | 'method' }>"
|
|
3629
|
+
},
|
|
3630
|
+
"description": "After a message has closed. `event.detail.id` is the id `show()` returned.",
|
|
3631
|
+
"x-trigger": {
|
|
3632
|
+
"how": "press Escape",
|
|
3633
|
+
"setup": "open"
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
],
|
|
3637
|
+
"attributes": [
|
|
3638
|
+
{
|
|
3639
|
+
"name": "duration",
|
|
3640
|
+
"type": {
|
|
3641
|
+
"text": "number"
|
|
3642
|
+
},
|
|
3643
|
+
"description": "Milliseconds before an info or success message closes by itself. Errors stay until dismissed.",
|
|
3644
|
+
"default": "5000",
|
|
3645
|
+
"fieldName": "duration"
|
|
3646
|
+
},
|
|
3647
|
+
{
|
|
3648
|
+
"name": "accessible-label",
|
|
3649
|
+
"type": {
|
|
3650
|
+
"text": "string"
|
|
3651
|
+
},
|
|
3652
|
+
"description": "Accessible name of the region. Not shown.",
|
|
3653
|
+
"default": "'Notifications'",
|
|
3654
|
+
"fieldName": "accessibleLabel"
|
|
3655
|
+
}
|
|
3656
|
+
],
|
|
3657
|
+
"superclass": {
|
|
3658
|
+
"name": "LitElement",
|
|
3659
|
+
"package": "lit"
|
|
3660
|
+
},
|
|
3661
|
+
"tagName": "va-toast",
|
|
3662
|
+
"customElement": true,
|
|
3663
|
+
"summary": "Shows short status messages, such as \"Changes saved\", without interrupting the user.",
|
|
3664
|
+
"x-keyboard": [
|
|
3665
|
+
{
|
|
3666
|
+
"context": "open",
|
|
3667
|
+
"key": "Escape",
|
|
3668
|
+
"action": "closes",
|
|
3669
|
+
"description": "Dismisses the message that has focus."
|
|
3670
|
+
}
|
|
3671
|
+
],
|
|
3672
|
+
"x-keyboard-items": "[part~=\"close-button\"]",
|
|
3673
|
+
"x-a11y": {
|
|
3674
|
+
"notes": [
|
|
3675
|
+
"Info and success messages are announced politely; errors use `role=\"alert\"` and are announced at once.",
|
|
3676
|
+
"Messages pause their timer while hovered or focused, and errors stay until dismissed (WCAG 2.2.1).",
|
|
3677
|
+
"While a modal dialog is open, the element moves itself into that dialog (a light-DOM move, so its messages stay clickable and announced) and back to its place when the dialog closes. Don't render it from a framework that would fight the move; place it once, outside framework-managed DOM."
|
|
3678
|
+
],
|
|
3679
|
+
"role": "status",
|
|
3680
|
+
"name": "The `accessible-label` attribute, \"Notifications\" by default (not shown)."
|
|
3681
|
+
},
|
|
3682
|
+
"x-guidance": {
|
|
3683
|
+
"use": "To confirm that something happened, such as \"Changes saved\" or \"Link copied\", or to report a background failure.",
|
|
3684
|
+
"avoid": "For anything the user must act on or read in full, or for form validation errors.",
|
|
3685
|
+
"instead": "`va-dialog` for decisions; `va-text-field`'s `error` for field errors."
|
|
3686
|
+
},
|
|
3687
|
+
"x-commands": [
|
|
3688
|
+
{
|
|
3689
|
+
"name": "--show",
|
|
3690
|
+
"description": "Shows the sending button's `value` as a message. Its `data-toast-variant` sets the look: `info` (default), `success` or `error`.",
|
|
3691
|
+
"data": [
|
|
3692
|
+
{
|
|
3693
|
+
"name": "data-toast-variant",
|
|
3694
|
+
"values": [
|
|
3695
|
+
"info",
|
|
3696
|
+
"success",
|
|
3697
|
+
"error"
|
|
3698
|
+
]
|
|
3699
|
+
}
|
|
3700
|
+
]
|
|
3701
|
+
}
|
|
3702
|
+
],
|
|
3703
|
+
"x-examples": [
|
|
3704
|
+
{
|
|
3705
|
+
"title": "Status messages",
|
|
3706
|
+
"description": "Place one va-toast per page. A va-button with commandfor and command=\"--show\" sends its value as the message; data-toast-variant sets the look (info, success or error).",
|
|
3707
|
+
"path": "src/toast/examples/1-status.html",
|
|
3708
|
+
"code": "<va-button commandfor=\"toaster\" command=\"--show\" value=\"Changes saved\" data-toast-variant=\"success\">Save</va-button>\n<va-button variant=\"secondary\" commandfor=\"toaster\" command=\"--show\" value=\"Link copied\">Copy link</va-button>\n<va-button variant=\"danger\" commandfor=\"toaster\" command=\"--show\" value=\"Couldn't sync. Check your connection.\" data-toast-variant=\"error\">Simulate an error</va-button>\n<va-toast id=\"toaster\"></va-toast>"
|
|
3709
|
+
}
|
|
3710
|
+
]
|
|
3711
|
+
},
|
|
3712
|
+
{
|
|
3713
|
+
"kind": "variable",
|
|
3714
|
+
"name": "variant"
|
|
3715
|
+
},
|
|
3716
|
+
{
|
|
3717
|
+
"kind": "variable",
|
|
3718
|
+
"name": "duration"
|
|
3719
|
+
},
|
|
3720
|
+
{
|
|
3721
|
+
"kind": "variable",
|
|
3722
|
+
"name": "message"
|
|
3723
|
+
}
|
|
3724
|
+
],
|
|
3725
|
+
"exports": [
|
|
3726
|
+
{
|
|
3727
|
+
"kind": "js",
|
|
3728
|
+
"name": "VaToast",
|
|
3729
|
+
"declaration": {
|
|
3730
|
+
"name": "VaToast",
|
|
3731
|
+
"module": "src/toast/toast.ts"
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
]
|
|
3735
|
+
}
|
|
3736
|
+
]
|
|
3737
|
+
}
|