@valancex/common 0.13.0 → 0.14.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/dist/app.d.ts +4 -0
- package/dist/app.js +16 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.js +10 -2
- package/dist/desktop.d.ts +4 -2
- package/dist/desktop.js +2 -1
- package/dist/early-replay.d.ts +57 -0
- package/dist/early-replay.js +75 -0
- package/dist/early.d.ts +8 -0
- package/dist/early.js +30 -0
- package/dist/form.d.ts +165 -0
- package/dist/form.js +388 -0
- package/dist/index.d.ts +85 -4
- package/dist/index.js +64 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +1 -0
- package/dist/primitives.d.ts +21 -0
- package/dist/primitives.js +792 -56
- package/dist/record.d.ts +4 -0
- package/dist/record.js +14 -0
- package/dist/server.js +2 -1
- package/dist/vocabulary.d.ts +24 -0
- package/dist/vocabulary.js +5 -8
- package/package.json +10 -6
package/dist/primitives.js
CHANGED
|
@@ -1,66 +1,802 @@
|
|
|
1
|
-
//
|
|
2
|
-
// what they are on the web. It is also what the MESH manifest is derived from, so a tag that is not here is a compile error that names it.
|
|
1
|
+
// GENERATED by @valancex/primitives from its specifications (specs/) and the web's realizations (realizations/web.json): do not edit; `pnpm --filter @valancex/primitives generate` writes it.
|
|
3
2
|
//
|
|
4
|
-
//
|
|
5
|
-
// the
|
|
3
|
+
// The tags a layout or component may use, and the element each becomes. This is the vocabulary of the application model: a template says `<nav>`, `<link>`, `<paragraph>`, and this table says what they
|
|
4
|
+
// are on the web. It is also what the MESH manifest is derived from (and `declared` below says what the specification adds to the derivation: a prop's type and whether a use must write it), so a tag
|
|
5
|
+
// that is not here is a compile error that names it.
|
|
6
6
|
import * as Web from "@valancex/valance/web";
|
|
7
|
-
const klass = Web.attribute("class");
|
|
8
|
-
const id = Web.attribute("id");
|
|
9
|
-
const label = Web.attribute("aria-label");
|
|
10
|
-
// A prop a tag declares is a prop every use of it must write (docs/application-model/HANDOFF.md, finding D1: MESH derives "required" from the realization and has no optional prop). So the
|
|
11
|
-
// table is many narrow tags rather than a few wide ones: a tag carries only what its uses always have.
|
|
12
7
|
export const primitives = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
nav: { element: "nav", props: { class: klass, label } },
|
|
25
|
-
aside: { element: "aside", props: { class: klass } },
|
|
8
|
+
column: { element: "vlx-column", attributes: { "data-vlx": "column" } },
|
|
9
|
+
row: { element: "vlx-row", attributes: { "data-vlx": "row" } },
|
|
10
|
+
heading: { element: "h2", attributes: { "data-vlx": "heading" }, props: { level: Web.attribute("aria-level") } },
|
|
11
|
+
text: { element: "span", attributes: { "data-vlx": "text" }, props: { id: Web.attribute("id") } },
|
|
12
|
+
shell: { element: "div", props: { class: Web.attribute("class"), theme: Web.attribute("data-theme") } },
|
|
13
|
+
div: { element: "div", props: { class: Web.attribute("class") } },
|
|
14
|
+
header: { element: "header", props: { class: Web.attribute("class") } },
|
|
15
|
+
footer: { element: "footer", props: { class: Web.attribute("class") } },
|
|
16
|
+
main: { element: "main", props: { id: Web.attribute("id"), tabindex: Web.attribute("tabindex") } },
|
|
17
|
+
nav: { element: "nav", props: { class: Web.attribute("class"), label: Web.attribute("aria-label") } },
|
|
18
|
+
aside: { element: "aside", props: { class: Web.attribute("class") } },
|
|
26
19
|
section: { element: "section" },
|
|
27
20
|
article: { element: "article" },
|
|
28
|
-
h1: { element: "h1", props: { id } },
|
|
29
|
-
h2: { element: "h2", props: { id } },
|
|
30
|
-
h3: { element: "h3", props: { id } },
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
list: { element: "ul", props: { class:
|
|
34
|
-
olist: { element: "ol", props: { class:
|
|
35
|
-
|
|
36
|
-
pre: { element: "pre", props: { class:
|
|
21
|
+
h1: { element: "h1", props: { id: Web.attribute("id") } },
|
|
22
|
+
h2: { element: "h2", props: { id: Web.attribute("id") } },
|
|
23
|
+
h3: { element: "h3", props: { id: Web.attribute("id") } },
|
|
24
|
+
paragraph: { element: "p", props: { class: Web.attribute("class"), id: Web.attribute("id") } },
|
|
25
|
+
blockquote: { element: "blockquote", props: { class: Web.attribute("class") } },
|
|
26
|
+
list: { element: "ul", props: { ...(Web.elementWhen === undefined ? {} : { ordered: Web.elementWhen("ol") }), class: Web.attribute("class") } },
|
|
27
|
+
olist: { element: "ol", props: { class: Web.attribute("class") } },
|
|
28
|
+
listitem: { element: "li" },
|
|
29
|
+
pre: { element: "pre", props: { class: Web.attribute("class"), tabindex: Web.attribute("tabindex") } },
|
|
37
30
|
code: { element: "code" },
|
|
38
31
|
strong: { element: "strong" },
|
|
39
32
|
em: { element: "em" },
|
|
40
|
-
span: { element: "span", props: { class:
|
|
41
|
-
image: { element: "img", props: { class:
|
|
42
|
-
/** A link inside text. */
|
|
33
|
+
span: { element: "span", props: { class: Web.attribute("class") } },
|
|
34
|
+
image: { element: "img", props: { class: Web.attribute("class"), src: Web.attribute("src"), alt: Web.attribute("alt"), loading: Web.attribute("loading") } },
|
|
43
35
|
a: { element: "a", props: { href: Web.attribute("href") } },
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
link: { element: "a", props: { href: Web.attribute("href"), class: Web.attribute("class"), current: Web.attribute("aria-current") } },
|
|
37
|
+
checkbox: { element: "input", attributes: { "type": "checkbox", "data-vlx": "checkbox" }, props: { checked: Web.controlledBoolean("checked"), label: Web.attribute("aria-label"), invalid: Web.attribute("aria-invalid"), describedby: Web.attribute("aria-describedby"), earlyInput: Web.attribute("data-early-input") }, events: { change: Web.event("change", { kind: "boolean", of: (_event, element) => element.checked }) } },
|
|
38
|
+
textfield: { element: "input", attributes: { "data-vlx": "textfield" }, props: { value: Web.controlled("value"), placeholder: Web.attribute("placeholder"), label: Web.attribute("aria-label"), kind: Web.attribute("type"), invalid: Web.attribute("aria-invalid"), describedby: Web.attribute("aria-describedby") }, events: { change: Web.event("input", { kind: "string", of: (_event, element) => element.value }), submit: Web.event("keydown", undefined, { key: "Enter" }), cancel: Web.event("keydown", undefined, { key: "Escape" }), focus: Web.event("focus"), blur: Web.event("blur") } },
|
|
39
|
+
button: { element: "button", attributes: { "data-vlx": "button" }, props: { id: Web.attribute("id"), class: Web.attribute("class"), pressed: Web.attribute("aria-pressed"), label: Web.attribute("aria-label"), disabled: Web.booleanAttribute("disabled"), intent: Web.attribute("data-intent"), size: Web.attribute("data-size"), earlyInput: Web.attribute("data-early-input") }, events: { click: Web.event("click") } },
|
|
40
|
+
toggle: { element: "button", props: { pressed: Web.attribute("aria-pressed"), label: Web.attribute("aria-label"), disabled: Web.booleanAttribute("disabled"), class: Web.attribute("class"), earlyInput: Web.attribute("data-early-input") }, events: { change: Web.event("click", { kind: "boolean", of: (_event, element) => element.getAttribute("aria-pressed") !== "true" }) } },
|
|
41
|
+
radiogroup: { element: "div", attributes: { "role": "radiogroup" }, props: { label: Web.attribute("aria-label"), invalid: Web.attribute("aria-invalid"), describedby: Web.attribute("aria-describedby") } },
|
|
42
|
+
radio: { element: "input", attributes: { "type": "radio" }, props: { checked: Web.controlledBoolean("checked"), value: Web.attribute("value"), label: Web.attribute("aria-label"), disabled: Web.booleanAttribute("disabled"), earlyInput: Web.attribute("data-early-input") }, events: { select: Web.event("change", { kind: "string", of: (_event, element) => element.value }) }, ...{ group: { "within": "radiogroup", "attribute": "name" } } },
|
|
43
|
+
status: { element: "div", attributes: { "role": "status" } },
|
|
44
|
+
alert: { element: "div", attributes: { "role": "alert" } },
|
|
45
|
+
label: { element: "label" },
|
|
46
|
+
...(Web.layerProp === undefined ? {} : { dialog: { element: "dialog", props: { open: Web.layerProp("open"), label: Web.attribute("aria-label") }, events: { dismiss: Web.layerDismiss }, ...{ layer: "modal" } } }),
|
|
47
|
+
...(Web.layerProp === undefined ? {} : { popover: { element: "div", attributes: { "role": "group" }, props: { open: Web.layerProp("open"), anchor: Web.layerProp("anchor"), placement: Web.layerProp("placement"), mode: Web.attribute("popover"), label: Web.attribute("aria-label") }, events: { dismiss: Web.layerDismiss }, ...{ layer: "popover" } } }),
|
|
48
|
+
};
|
|
49
|
+
/** What each tag's props and events are, as the specification states them (the derivation from the table alone cannot say whether a prop is required, nor type one realized as text). */
|
|
50
|
+
export const declared = {
|
|
51
|
+
"column": {
|
|
52
|
+
"props": {},
|
|
53
|
+
"events": {}
|
|
54
|
+
},
|
|
55
|
+
"row": {
|
|
56
|
+
"props": {},
|
|
57
|
+
"events": {}
|
|
58
|
+
},
|
|
59
|
+
"heading": {
|
|
60
|
+
"props": {
|
|
61
|
+
"level": {
|
|
62
|
+
"type": {
|
|
63
|
+
"kind": "number"
|
|
64
|
+
},
|
|
65
|
+
"required": false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"events": {}
|
|
69
|
+
},
|
|
70
|
+
"text": {
|
|
71
|
+
"props": {
|
|
72
|
+
"id": {
|
|
73
|
+
"type": {
|
|
74
|
+
"kind": "string"
|
|
75
|
+
},
|
|
76
|
+
"required": false
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"events": {}
|
|
80
|
+
},
|
|
81
|
+
"shell": {
|
|
82
|
+
"props": {
|
|
83
|
+
"class": {
|
|
84
|
+
"type": {
|
|
85
|
+
"kind": "string"
|
|
86
|
+
},
|
|
87
|
+
"required": true
|
|
88
|
+
},
|
|
89
|
+
"theme": {
|
|
90
|
+
"type": {
|
|
91
|
+
"kind": "string"
|
|
92
|
+
},
|
|
93
|
+
"required": true
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"events": {}
|
|
97
|
+
},
|
|
98
|
+
"div": {
|
|
99
|
+
"props": {
|
|
100
|
+
"class": {
|
|
101
|
+
"type": {
|
|
102
|
+
"kind": "string"
|
|
103
|
+
},
|
|
104
|
+
"required": true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"events": {}
|
|
108
|
+
},
|
|
109
|
+
"header": {
|
|
110
|
+
"props": {
|
|
111
|
+
"class": {
|
|
112
|
+
"type": {
|
|
113
|
+
"kind": "string"
|
|
114
|
+
},
|
|
115
|
+
"required": true
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"events": {}
|
|
119
|
+
},
|
|
120
|
+
"footer": {
|
|
121
|
+
"props": {
|
|
122
|
+
"class": {
|
|
123
|
+
"type": {
|
|
124
|
+
"kind": "string"
|
|
125
|
+
},
|
|
126
|
+
"required": true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"events": {}
|
|
130
|
+
},
|
|
131
|
+
"main": {
|
|
132
|
+
"props": {
|
|
133
|
+
"id": {
|
|
134
|
+
"type": {
|
|
135
|
+
"kind": "string"
|
|
136
|
+
},
|
|
137
|
+
"required": true
|
|
138
|
+
},
|
|
139
|
+
"tabindex": {
|
|
140
|
+
"type": {
|
|
141
|
+
"kind": "string"
|
|
142
|
+
},
|
|
143
|
+
"required": true
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"events": {}
|
|
147
|
+
},
|
|
148
|
+
"nav": {
|
|
149
|
+
"props": {
|
|
150
|
+
"class": {
|
|
151
|
+
"type": {
|
|
152
|
+
"kind": "string"
|
|
153
|
+
},
|
|
154
|
+
"required": true
|
|
155
|
+
},
|
|
156
|
+
"label": {
|
|
157
|
+
"type": {
|
|
158
|
+
"kind": "string"
|
|
159
|
+
},
|
|
160
|
+
"required": true
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"events": {}
|
|
164
|
+
},
|
|
165
|
+
"aside": {
|
|
166
|
+
"props": {
|
|
167
|
+
"class": {
|
|
168
|
+
"type": {
|
|
169
|
+
"kind": "string"
|
|
170
|
+
},
|
|
171
|
+
"required": true
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"events": {}
|
|
175
|
+
},
|
|
176
|
+
"section": {
|
|
177
|
+
"props": {},
|
|
178
|
+
"events": {}
|
|
179
|
+
},
|
|
180
|
+
"article": {
|
|
181
|
+
"props": {},
|
|
182
|
+
"events": {}
|
|
183
|
+
},
|
|
184
|
+
"h1": {
|
|
185
|
+
"props": {
|
|
186
|
+
"id": {
|
|
187
|
+
"type": {
|
|
188
|
+
"kind": "string"
|
|
189
|
+
},
|
|
190
|
+
"required": true
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"events": {}
|
|
194
|
+
},
|
|
195
|
+
"h2": {
|
|
196
|
+
"props": {
|
|
197
|
+
"id": {
|
|
198
|
+
"type": {
|
|
199
|
+
"kind": "string"
|
|
200
|
+
},
|
|
201
|
+
"required": true
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"events": {}
|
|
205
|
+
},
|
|
206
|
+
"h3": {
|
|
207
|
+
"props": {
|
|
208
|
+
"id": {
|
|
209
|
+
"type": {
|
|
210
|
+
"kind": "string"
|
|
211
|
+
},
|
|
212
|
+
"required": true
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"events": {}
|
|
216
|
+
},
|
|
217
|
+
"paragraph": {
|
|
218
|
+
"props": {
|
|
219
|
+
"class": {
|
|
220
|
+
"type": {
|
|
221
|
+
"kind": "string"
|
|
222
|
+
},
|
|
223
|
+
"required": true
|
|
224
|
+
},
|
|
225
|
+
"id": {
|
|
226
|
+
"type": {
|
|
227
|
+
"kind": "string"
|
|
228
|
+
},
|
|
229
|
+
"required": false
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"events": {}
|
|
233
|
+
},
|
|
234
|
+
"blockquote": {
|
|
235
|
+
"props": {
|
|
236
|
+
"class": {
|
|
237
|
+
"type": {
|
|
238
|
+
"kind": "string"
|
|
239
|
+
},
|
|
240
|
+
"required": true
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"events": {}
|
|
244
|
+
},
|
|
245
|
+
"list": {
|
|
246
|
+
"props": {
|
|
247
|
+
"ordered": {
|
|
248
|
+
"type": {
|
|
249
|
+
"kind": "boolean"
|
|
250
|
+
},
|
|
251
|
+
"required": false
|
|
252
|
+
},
|
|
253
|
+
"class": {
|
|
254
|
+
"type": {
|
|
255
|
+
"kind": "string"
|
|
256
|
+
},
|
|
257
|
+
"required": true
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"events": {}
|
|
261
|
+
},
|
|
262
|
+
"olist": {
|
|
263
|
+
"props": {
|
|
264
|
+
"class": {
|
|
265
|
+
"type": {
|
|
266
|
+
"kind": "string"
|
|
267
|
+
},
|
|
268
|
+
"required": true
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"events": {}
|
|
272
|
+
},
|
|
273
|
+
"listitem": {
|
|
274
|
+
"props": {},
|
|
275
|
+
"events": {}
|
|
276
|
+
},
|
|
277
|
+
"pre": {
|
|
278
|
+
"props": {
|
|
279
|
+
"class": {
|
|
280
|
+
"type": {
|
|
281
|
+
"kind": "string"
|
|
282
|
+
},
|
|
283
|
+
"required": true
|
|
284
|
+
},
|
|
285
|
+
"tabindex": {
|
|
286
|
+
"type": {
|
|
287
|
+
"kind": "string"
|
|
288
|
+
},
|
|
289
|
+
"required": true
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"events": {}
|
|
293
|
+
},
|
|
294
|
+
"code": {
|
|
295
|
+
"props": {},
|
|
296
|
+
"events": {}
|
|
297
|
+
},
|
|
298
|
+
"strong": {
|
|
299
|
+
"props": {},
|
|
300
|
+
"events": {}
|
|
301
|
+
},
|
|
302
|
+
"em": {
|
|
303
|
+
"props": {},
|
|
304
|
+
"events": {}
|
|
305
|
+
},
|
|
306
|
+
"span": {
|
|
307
|
+
"props": {
|
|
308
|
+
"class": {
|
|
309
|
+
"type": {
|
|
310
|
+
"kind": "string"
|
|
311
|
+
},
|
|
312
|
+
"required": true
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"events": {}
|
|
316
|
+
},
|
|
317
|
+
"image": {
|
|
318
|
+
"props": {
|
|
319
|
+
"class": {
|
|
320
|
+
"type": {
|
|
321
|
+
"kind": "string"
|
|
322
|
+
},
|
|
323
|
+
"required": true
|
|
324
|
+
},
|
|
325
|
+
"src": {
|
|
326
|
+
"type": {
|
|
327
|
+
"kind": "string"
|
|
328
|
+
},
|
|
329
|
+
"required": true
|
|
330
|
+
},
|
|
331
|
+
"alt": {
|
|
332
|
+
"type": {
|
|
333
|
+
"kind": "string"
|
|
334
|
+
},
|
|
335
|
+
"required": true
|
|
336
|
+
},
|
|
337
|
+
"loading": {
|
|
338
|
+
"type": {
|
|
339
|
+
"kind": "string"
|
|
340
|
+
},
|
|
341
|
+
"required": true
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"events": {}
|
|
345
|
+
},
|
|
346
|
+
"a": {
|
|
347
|
+
"props": {
|
|
348
|
+
"href": {
|
|
349
|
+
"type": {
|
|
350
|
+
"kind": "string"
|
|
351
|
+
},
|
|
352
|
+
"required": true
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"events": {}
|
|
356
|
+
},
|
|
357
|
+
"link": {
|
|
358
|
+
"props": {
|
|
359
|
+
"href": {
|
|
360
|
+
"type": {
|
|
361
|
+
"kind": "string"
|
|
362
|
+
},
|
|
363
|
+
"required": true
|
|
364
|
+
},
|
|
365
|
+
"class": {
|
|
366
|
+
"type": {
|
|
367
|
+
"kind": "string"
|
|
368
|
+
},
|
|
369
|
+
"required": true
|
|
370
|
+
},
|
|
371
|
+
"current": {
|
|
372
|
+
"type": {
|
|
373
|
+
"kind": "string"
|
|
374
|
+
},
|
|
375
|
+
"required": true
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"events": {}
|
|
379
|
+
},
|
|
380
|
+
"checkbox": {
|
|
381
|
+
"props": {
|
|
382
|
+
"checked": {
|
|
383
|
+
"type": {
|
|
384
|
+
"kind": "boolean"
|
|
385
|
+
},
|
|
386
|
+
"required": true
|
|
387
|
+
},
|
|
388
|
+
"label": {
|
|
389
|
+
"type": {
|
|
390
|
+
"kind": "string"
|
|
391
|
+
},
|
|
392
|
+
"required": false
|
|
393
|
+
},
|
|
394
|
+
"invalid": {
|
|
395
|
+
"type": {
|
|
396
|
+
"kind": "boolean"
|
|
397
|
+
},
|
|
398
|
+
"required": false
|
|
399
|
+
},
|
|
400
|
+
"describedby": {
|
|
401
|
+
"type": {
|
|
402
|
+
"kind": "string"
|
|
403
|
+
},
|
|
404
|
+
"required": false
|
|
405
|
+
},
|
|
406
|
+
"earlyInput": {
|
|
407
|
+
"type": {
|
|
408
|
+
"kind": "enum",
|
|
409
|
+
"values": [
|
|
410
|
+
"keep",
|
|
411
|
+
"drop"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"required": false
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"events": {
|
|
418
|
+
"change": {
|
|
419
|
+
"payload": {
|
|
420
|
+
"kind": "boolean"
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"textfield": {
|
|
426
|
+
"props": {
|
|
427
|
+
"value": {
|
|
428
|
+
"type": {
|
|
429
|
+
"kind": "string"
|
|
430
|
+
},
|
|
431
|
+
"required": true
|
|
432
|
+
},
|
|
433
|
+
"placeholder": {
|
|
434
|
+
"type": {
|
|
435
|
+
"kind": "string"
|
|
436
|
+
},
|
|
437
|
+
"required": false
|
|
438
|
+
},
|
|
439
|
+
"label": {
|
|
440
|
+
"type": {
|
|
441
|
+
"kind": "string"
|
|
442
|
+
},
|
|
443
|
+
"required": false
|
|
444
|
+
},
|
|
445
|
+
"kind": {
|
|
446
|
+
"type": {
|
|
447
|
+
"kind": "string"
|
|
448
|
+
},
|
|
449
|
+
"required": false
|
|
450
|
+
},
|
|
451
|
+
"invalid": {
|
|
452
|
+
"type": {
|
|
453
|
+
"kind": "boolean"
|
|
454
|
+
},
|
|
455
|
+
"required": false
|
|
456
|
+
},
|
|
457
|
+
"describedby": {
|
|
458
|
+
"type": {
|
|
459
|
+
"kind": "string"
|
|
460
|
+
},
|
|
461
|
+
"required": false
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
"events": {
|
|
465
|
+
"change": {
|
|
466
|
+
"payload": {
|
|
467
|
+
"kind": "string"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"submit": {},
|
|
471
|
+
"cancel": {},
|
|
472
|
+
"focus": {},
|
|
473
|
+
"blur": {}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"button": {
|
|
477
|
+
"props": {
|
|
478
|
+
"id": {
|
|
479
|
+
"type": {
|
|
480
|
+
"kind": "string"
|
|
481
|
+
},
|
|
482
|
+
"required": false
|
|
483
|
+
},
|
|
484
|
+
"class": {
|
|
485
|
+
"type": {
|
|
486
|
+
"kind": "string"
|
|
487
|
+
},
|
|
488
|
+
"required": false
|
|
489
|
+
},
|
|
490
|
+
"pressed": {
|
|
491
|
+
"type": {
|
|
492
|
+
"kind": "string"
|
|
493
|
+
},
|
|
494
|
+
"required": false
|
|
495
|
+
},
|
|
496
|
+
"label": {
|
|
497
|
+
"type": {
|
|
498
|
+
"kind": "string"
|
|
499
|
+
},
|
|
500
|
+
"required": false
|
|
501
|
+
},
|
|
502
|
+
"disabled": {
|
|
503
|
+
"type": {
|
|
504
|
+
"kind": "boolean"
|
|
505
|
+
},
|
|
506
|
+
"required": false
|
|
507
|
+
},
|
|
508
|
+
"intent": {
|
|
509
|
+
"type": {
|
|
510
|
+
"kind": "enum",
|
|
511
|
+
"values": [
|
|
512
|
+
"neutral",
|
|
513
|
+
"primary",
|
|
514
|
+
"danger"
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
"required": false
|
|
518
|
+
},
|
|
519
|
+
"size": {
|
|
520
|
+
"type": {
|
|
521
|
+
"kind": "enum",
|
|
522
|
+
"values": [
|
|
523
|
+
"sm",
|
|
524
|
+
"md",
|
|
525
|
+
"lg"
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
"required": false
|
|
529
|
+
},
|
|
530
|
+
"earlyInput": {
|
|
531
|
+
"type": {
|
|
532
|
+
"kind": "enum",
|
|
533
|
+
"values": [
|
|
534
|
+
"keep",
|
|
535
|
+
"drop"
|
|
536
|
+
]
|
|
537
|
+
},
|
|
538
|
+
"required": false
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
"events": {
|
|
542
|
+
"click": {}
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"toggle": {
|
|
546
|
+
"props": {
|
|
547
|
+
"pressed": {
|
|
548
|
+
"type": {
|
|
549
|
+
"kind": "boolean"
|
|
550
|
+
},
|
|
551
|
+
"required": true
|
|
552
|
+
},
|
|
553
|
+
"label": {
|
|
554
|
+
"type": {
|
|
555
|
+
"kind": "string"
|
|
556
|
+
},
|
|
557
|
+
"required": false
|
|
558
|
+
},
|
|
559
|
+
"disabled": {
|
|
560
|
+
"type": {
|
|
561
|
+
"kind": "boolean"
|
|
562
|
+
},
|
|
563
|
+
"required": false
|
|
564
|
+
},
|
|
565
|
+
"class": {
|
|
566
|
+
"type": {
|
|
567
|
+
"kind": "string"
|
|
568
|
+
},
|
|
569
|
+
"required": false
|
|
570
|
+
},
|
|
571
|
+
"earlyInput": {
|
|
572
|
+
"type": {
|
|
573
|
+
"kind": "enum",
|
|
574
|
+
"values": [
|
|
575
|
+
"keep",
|
|
576
|
+
"drop"
|
|
577
|
+
]
|
|
578
|
+
},
|
|
579
|
+
"required": false
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"events": {
|
|
583
|
+
"change": {
|
|
584
|
+
"payload": {
|
|
585
|
+
"kind": "boolean"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
"radiogroup": {
|
|
591
|
+
"props": {
|
|
592
|
+
"label": {
|
|
593
|
+
"type": {
|
|
594
|
+
"kind": "string"
|
|
595
|
+
},
|
|
596
|
+
"required": false
|
|
597
|
+
},
|
|
598
|
+
"invalid": {
|
|
599
|
+
"type": {
|
|
600
|
+
"kind": "boolean"
|
|
601
|
+
},
|
|
602
|
+
"required": false
|
|
603
|
+
},
|
|
604
|
+
"describedby": {
|
|
605
|
+
"type": {
|
|
606
|
+
"kind": "string"
|
|
607
|
+
},
|
|
608
|
+
"required": false
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"events": {}
|
|
612
|
+
},
|
|
613
|
+
"radio": {
|
|
614
|
+
"props": {
|
|
615
|
+
"checked": {
|
|
616
|
+
"type": {
|
|
617
|
+
"kind": "boolean"
|
|
618
|
+
},
|
|
619
|
+
"required": true
|
|
620
|
+
},
|
|
621
|
+
"value": {
|
|
622
|
+
"type": {
|
|
623
|
+
"kind": "string"
|
|
624
|
+
},
|
|
625
|
+
"required": true
|
|
626
|
+
},
|
|
627
|
+
"label": {
|
|
628
|
+
"type": {
|
|
629
|
+
"kind": "string"
|
|
630
|
+
},
|
|
631
|
+
"required": false
|
|
632
|
+
},
|
|
633
|
+
"disabled": {
|
|
634
|
+
"type": {
|
|
635
|
+
"kind": "boolean"
|
|
636
|
+
},
|
|
637
|
+
"required": false
|
|
638
|
+
},
|
|
639
|
+
"earlyInput": {
|
|
640
|
+
"type": {
|
|
641
|
+
"kind": "enum",
|
|
642
|
+
"values": [
|
|
643
|
+
"keep",
|
|
644
|
+
"drop"
|
|
645
|
+
]
|
|
646
|
+
},
|
|
647
|
+
"required": false
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
"events": {
|
|
651
|
+
"select": {
|
|
652
|
+
"payload": {
|
|
653
|
+
"kind": "string"
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
"status": {
|
|
659
|
+
"props": {},
|
|
660
|
+
"events": {}
|
|
661
|
+
},
|
|
662
|
+
"alert": {
|
|
663
|
+
"props": {},
|
|
664
|
+
"events": {}
|
|
665
|
+
},
|
|
666
|
+
"label": {
|
|
667
|
+
"props": {},
|
|
668
|
+
"events": {}
|
|
669
|
+
},
|
|
670
|
+
"dialog": {
|
|
671
|
+
"props": {
|
|
672
|
+
"open": {
|
|
673
|
+
"type": {
|
|
674
|
+
"kind": "boolean"
|
|
675
|
+
},
|
|
676
|
+
"required": true
|
|
677
|
+
},
|
|
678
|
+
"label": {
|
|
679
|
+
"type": {
|
|
680
|
+
"kind": "string"
|
|
681
|
+
},
|
|
682
|
+
"required": true
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
"events": {
|
|
686
|
+
"dismiss": {
|
|
687
|
+
"payload": {
|
|
688
|
+
"kind": "string"
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
"popover": {
|
|
694
|
+
"props": {
|
|
695
|
+
"open": {
|
|
696
|
+
"type": {
|
|
697
|
+
"kind": "boolean"
|
|
698
|
+
},
|
|
699
|
+
"required": true
|
|
700
|
+
},
|
|
701
|
+
"anchor": {
|
|
702
|
+
"type": {
|
|
703
|
+
"kind": "string"
|
|
704
|
+
},
|
|
705
|
+
"required": false
|
|
706
|
+
},
|
|
707
|
+
"placement": {
|
|
708
|
+
"type": {
|
|
709
|
+
"kind": "enum",
|
|
710
|
+
"values": [
|
|
711
|
+
"top",
|
|
712
|
+
"bottom",
|
|
713
|
+
"start",
|
|
714
|
+
"end"
|
|
715
|
+
]
|
|
716
|
+
},
|
|
717
|
+
"required": false
|
|
718
|
+
},
|
|
719
|
+
"mode": {
|
|
720
|
+
"type": {
|
|
721
|
+
"kind": "enum",
|
|
722
|
+
"values": [
|
|
723
|
+
"auto",
|
|
724
|
+
"manual"
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
"required": false
|
|
728
|
+
},
|
|
729
|
+
"label": {
|
|
730
|
+
"type": {
|
|
731
|
+
"kind": "string"
|
|
732
|
+
},
|
|
733
|
+
"required": false
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
"events": {
|
|
737
|
+
"dismiss": {
|
|
738
|
+
"payload": {
|
|
739
|
+
"kind": "string"
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
/** The tags that were renamed (decision P7), old to new: a template that writes the old one is told the new. */
|
|
746
|
+
export const renamed = {
|
|
747
|
+
"para": "paragraph",
|
|
748
|
+
"item": "listitem",
|
|
749
|
+
"quote": "blockquote"
|
|
750
|
+
};
|
|
751
|
+
/** The props that were renamed (decision I29), by tag, old to new: a template that writes the old one is told the new. */
|
|
752
|
+
export const renamedProps = {
|
|
753
|
+
"popover": {
|
|
754
|
+
"kind": "mode"
|
|
755
|
+
},
|
|
756
|
+
"button": {
|
|
757
|
+
"replay": "earlyInput"
|
|
758
|
+
},
|
|
759
|
+
"toggle": {
|
|
760
|
+
"replay": "earlyInput"
|
|
761
|
+
},
|
|
762
|
+
"checkbox": {
|
|
763
|
+
"replay": "earlyInput"
|
|
764
|
+
},
|
|
765
|
+
"radio": {
|
|
766
|
+
"replay": "earlyInput"
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
/** What a use of a tag must satisfy besides its props (`vlx` checks it): the tags that need a name (a `label` prop, or a `label` around them), the tags a tag may contain only, and the tags a tag must be inside. */
|
|
770
|
+
export const rules = {
|
|
771
|
+
"named": [
|
|
772
|
+
"checkbox",
|
|
773
|
+
"textfield",
|
|
774
|
+
"radiogroup",
|
|
775
|
+
"radio",
|
|
776
|
+
"dialog"
|
|
777
|
+
],
|
|
778
|
+
"modal": [
|
|
779
|
+
"dialog"
|
|
780
|
+
],
|
|
781
|
+
"only": {
|
|
782
|
+
"list": [
|
|
783
|
+
"listitem"
|
|
784
|
+
],
|
|
785
|
+
"olist": [
|
|
786
|
+
"listitem"
|
|
787
|
+
],
|
|
788
|
+
"radiogroup": [
|
|
789
|
+
"radio",
|
|
790
|
+
"label"
|
|
791
|
+
]
|
|
792
|
+
},
|
|
793
|
+
"within": {
|
|
794
|
+
"listitem": [
|
|
795
|
+
"list",
|
|
796
|
+
"olist"
|
|
797
|
+
],
|
|
798
|
+
"radio": [
|
|
799
|
+
"radiogroup"
|
|
800
|
+
]
|
|
801
|
+
}
|
|
66
802
|
};
|