@rak200/ui 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.d.ts +1 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +1 -2
- package/dist/button.js.map +1 -1
- package/dist/dialog.d.ts +3 -7
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +3 -7
- package/dist/dialog.js.map +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +12 -14
- package/dist/field.js.map +1 -1
- package/dist/menu.d.ts +3 -14
- package/dist/menu.d.ts.map +1 -1
- package/dist/menu.js +3 -14
- package/dist/menu.js.map +1 -1
- package/dist/radio.d.ts +142 -59
- package/dist/radio.d.ts.map +1 -1
- package/dist/radio.js +378 -147
- package/dist/radio.js.map +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +31 -0
- package/dist/tooltip.js.map +1 -1
- package/package.json +1 -1
package/dist/button.d.ts
CHANGED
|
@@ -7,8 +7,7 @@ export type ButtonVariant = 'primary' | 'secondary';
|
|
|
7
7
|
* It delegates to a real `<button>` in its shadow root rather than reimplementing one,
|
|
8
8
|
* which is what makes the keyboard behaviour, the accessible name and the disabled
|
|
9
9
|
* semantics the platform's job instead of this file's. No state machine is involved
|
|
10
|
-
* because a button has no state to model
|
|
11
|
-
* does.
|
|
10
|
+
* because a button has no state to model.
|
|
12
11
|
*
|
|
13
12
|
* @example
|
|
14
13
|
* ```html
|
package/dist/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACpC,gBAAyB,MAAM,0BA6E7B;IAEF,gBAAyB,UAAU;;;;;;;;;MAGjC;IAEF;;;;;;;;OAQG;IACH,OAAO,EAAE,aAAa,CAAa;IAEnC,kFAAkF;IAClF,QAAQ,UAAS;IAER,MAAM,IAAI,cAAc;CAOpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,WAAW,EAAE,QAAQ,CAAC;KACzB;CACJ"}
|
package/dist/button.js
CHANGED
|
@@ -6,8 +6,7 @@ import { reference } from './reference.js';
|
|
|
6
6
|
* It delegates to a real `<button>` in its shadow root rather than reimplementing one,
|
|
7
7
|
* which is what makes the keyboard behaviour, the accessible name and the disabled
|
|
8
8
|
* semantics the platform's job instead of this file's. No state machine is involved
|
|
9
|
-
* because a button has no state to model
|
|
10
|
-
* does.
|
|
9
|
+
* because a button has no state to model.
|
|
11
10
|
*
|
|
12
11
|
* @example
|
|
13
12
|
* ```html
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,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F,4EAA4E;AAC5E,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC"}
|
package/dist/dialog.d.ts
CHANGED
|
@@ -45,13 +45,9 @@ export declare function applyLock(root: HTMLElement, overflow: string, gutter: s
|
|
|
45
45
|
* than this file's. What is written here is the part the platform leaves out: the scroll
|
|
46
46
|
* lock, the accessible name across the shadow boundary, and an exit that can be seen.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* one the user agent enforces. *The platform owns what the platform is good at* is the
|
|
52
|
-
* older rule and the stronger one here. Zag arrives with the first component the platform
|
|
53
|
-
* gives nothing for; `ARCHITECTURE.md` carries that decision for a consumer, and
|
|
54
|
-
* `ROADMAP.md` names the component.
|
|
48
|
+
* A state machine over a `<div>` would mean giving up the top layer to re-acquire a focus
|
|
49
|
+
* trap the user agent already enforces — see `ARCHITECTURE.md`, *Behaviour is delegated*
|
|
50
|
+
* (#122).
|
|
55
51
|
*
|
|
56
52
|
* @example
|
|
57
53
|
* ```html
|
package/dist/dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAiBjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAGnF;AAiFD
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAiBjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAGnF;AAiFD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,QAAS,SAAQ,UAAU;;IACpC,gBAAyB,MAAM,0BAwG7B;IAEF,gBAAyB,UAAU;;;;;MAEjC;IAEF;;;;;;;;;;OAUG;IACH,IAAI,UAAS;;IAyCJ,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAU5B,YAAY,IAAI,IAAI;IAIpB,OAAO,IAAI,IAAI;IAiBf,MAAM,IAAI,cAAc;IAIjC;;;;;OAKG;IACH,IAAI,IAAI,IAAI;IAIZ,2FAA2F;IAC3F,KAAK,IAAI,IAAI;CA0FhB;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,WAAW,EAAE,QAAQ,CAAC;KACzB;CACJ"}
|
package/dist/dialog.js
CHANGED
|
@@ -124,13 +124,9 @@ function build() {
|
|
|
124
124
|
* than this file's. What is written here is the part the platform leaves out: the scroll
|
|
125
125
|
* lock, the accessible name across the shadow boundary, and an exit that can be seen.
|
|
126
126
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* one the user agent enforces. *The platform owns what the platform is good at* is the
|
|
131
|
-
* older rule and the stronger one here. Zag arrives with the first component the platform
|
|
132
|
-
* gives nothing for; `ARCHITECTURE.md` carries that decision for a consumer, and
|
|
133
|
-
* `ROADMAP.md` names the component.
|
|
127
|
+
* A state machine over a `<div>` would mean giving up the top layer to re-acquire a focus
|
|
128
|
+
* trap the user agent already enforces — see `ARCHITECTURE.md`, *Behaviour is delegated*
|
|
129
|
+
* (#122).
|
|
134
130
|
*
|
|
135
131
|
* @example
|
|
136
132
|
* ```html
|
package/dist/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,4FAA4F;AAC5F,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,mDAAmD;AACnD,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd;;;;;GAKG;AACH,IAAI,SAA+C,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,OAAe,EAAE,OAAe;IAC7E,OAAO,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB,EAAE,QAAgB,EAAE,MAAc;IACzE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,IAAI;IACT,KAAK,IAAI,CAAC,CAAC;IAEX,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACZ,OAAO;IACX,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IAEtC,SAAS,GAAG;QACR,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ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C,CAAC;QACnD,CAAC;IACL,CAAC;;AAGL,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,oEAAoE;AACpE,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC"}
|
package/dist/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,OAAQ,SAAQ,UAAU;;IACnC,gBAAyB,MAAM,0BAuB7B;IAeO,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAK5B,YAAY,IAAI,IAAI;IAIpB,MAAM,IAAI,cAAc;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,OAAQ,SAAQ,UAAU;;IACnC,gBAAyB,MAAM,0BAuB7B;IAeO,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAK5B,YAAY,IAAI,IAAI;IAIpB,MAAM,IAAI,cAAc;CAiLpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,UAAU,EAAE,OAAO,CAAC;KACvB;CACJ"}
|
package/dist/field.js
CHANGED
|
@@ -110,22 +110,20 @@ export class UiField extends LitElement {
|
|
|
110
110
|
/**
|
|
111
111
|
* The control this field is about, which a wrapper may stand in front of.
|
|
112
112
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* reports at critical impact.
|
|
113
|
+
* A host who boxes their control in an element of their own — a layout `<div>`, a
|
|
114
|
+
* widget from somewhere else — leaves the label pointing at the box rather than at the
|
|
115
|
+
* thing the browser focuses, and a `<label for>` aimed at anything that is not labelable
|
|
116
|
+
* names nothing, which axe reports at critical impact.
|
|
118
117
|
*
|
|
119
|
-
* A control written as a direct child
|
|
120
|
-
*
|
|
118
|
+
* A control written as a direct child matches nothing to descend into and is returned
|
|
119
|
+
* as it is.
|
|
121
120
|
*/
|
|
122
121
|
#control() {
|
|
123
122
|
const slotted = this.#slotted(null);
|
|
124
|
-
// A
|
|
125
|
-
// one, and the descent stops there.
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
// leaves the group anonymous.
|
|
123
|
+
// A slotted element carrying a `role` is claiming to *be* the widget rather than to
|
|
124
|
+
// box one, and the descent stops there. `role="radiogroup"` is the case that shows
|
|
125
|
+
// why: the thing to name is the group, and looking through it would reach the first
|
|
126
|
+
// radio, naming one option and leaving the group anonymous.
|
|
129
127
|
if (slotted?.hasAttribute('role') === true) {
|
|
130
128
|
return slotted;
|
|
131
129
|
}
|
|
@@ -201,8 +199,8 @@ export class UiField extends LitElement {
|
|
|
201
199
|
* **`<label for>` is preferred wherever it reaches**, because it is the platform's own
|
|
202
200
|
* association and it does two things `aria-labelledby` does not: it names the control
|
|
203
201
|
* and it makes the label a click target for it. It only reaches a **labelable**
|
|
204
|
-
* element, though, and
|
|
205
|
-
* custom element labels nothing, which axe reports at critical impact.
|
|
202
|
+
* element, though, and an element carrying a role is not one — a `<label for>` aimed at
|
|
203
|
+
* a custom element labels nothing, which axe reports at critical impact.
|
|
206
204
|
*
|
|
207
205
|
* Which elements are labelable is asked of the platform rather than listed here: those
|
|
208
206
|
* are exactly the ones it gives a `labels` collection to. A list kept in this file
|
package/dist/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":"AA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C,EAAE,UAAkB;QAC3D,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC7D,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;YACpB,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC;QAC5B,CAAC;QAED,OAAO,OAAO,CAAC,EAAE,CAAC;IACtB,CAAC;;AAGL,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,oEAAoE;AACpE,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/menu.d.ts
CHANGED
|
@@ -33,20 +33,9 @@ import { LitElement, type TemplateResult } from 'lit';
|
|
|
33
33
|
* - **The single tab stop, and the keys inside it.** Every item is a real button, so
|
|
34
34
|
* without a tabindex the menu is a row of tab stops rather than an APG menu.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* candidate, and Zag ships a menu machine — so this is a refusal rather than an absence of
|
|
40
|
-
* an option, and it is the fourth. `ARCHITECTURE.md` carries it; the short form is that the
|
|
41
|
-
* test asks where the **accessible behaviour** is the expensive part, and the measurement
|
|
42
|
-
* above splits it: the layer, the dismissal, Escape and the ordering against other open
|
|
43
|
-
* layers are all the platform's. What is left is a roving tabindex and four keys, which the
|
|
44
|
-
* `<ui-radio-group>` refusal already named as not the trigger.
|
|
45
|
-
*
|
|
46
|
-
* The second reason is the issue's own: Zag's menu positions through `@zag-js/popper`,
|
|
47
|
-
* which is Floating UI. Adopting it would put a second placement in a package whose first
|
|
48
|
-
* one is measured, documented and shared — and *two answers to one problem is one too
|
|
49
|
-
* many* is the issue's sentence, not this file's.
|
|
36
|
+
* No state machine here either, and the measurement above is why: what a machine would
|
|
37
|
+
* have replaced is a roving tabindex and four keys. `ARCHITECTURE.md`, *Behaviour is
|
|
38
|
+
* delegated*, carries that decision for the whole package (#122).
|
|
50
39
|
*
|
|
51
40
|
* @example
|
|
52
41
|
* ```html
|
package/dist/menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AA4DjE
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AA4DjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IAClC,gBAAyB,MAAM,0BAsJ7B;IAEF,gBAAyB,UAAU;;;;;MAEjC;IAEF;;;;;;;;;;OAUG;IACH,IAAI,UAAS;;IAsEJ,oBAAoB,IAAI,IAAI;IAS5B,OAAO,IAAI,IAAI;IA4Bf,MAAM,IAAI,cAAc;CAwNpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,SAAS,EAAE,MAAM,CAAC;KACrB;CACJ"}
|
package/dist/menu.js
CHANGED
|
@@ -83,20 +83,9 @@ function caret() {
|
|
|
83
83
|
* - **The single tab stop, and the keys inside it.** Every item is a real button, so
|
|
84
84
|
* without a tabindex the menu is a row of tab stops rather than an APG menu.
|
|
85
85
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* candidate, and Zag ships a menu machine — so this is a refusal rather than an absence of
|
|
90
|
-
* an option, and it is the fourth. `ARCHITECTURE.md` carries it; the short form is that the
|
|
91
|
-
* test asks where the **accessible behaviour** is the expensive part, and the measurement
|
|
92
|
-
* above splits it: the layer, the dismissal, Escape and the ordering against other open
|
|
93
|
-
* layers are all the platform's. What is left is a roving tabindex and four keys, which the
|
|
94
|
-
* `<ui-radio-group>` refusal already named as not the trigger.
|
|
95
|
-
*
|
|
96
|
-
* The second reason is the issue's own: Zag's menu positions through `@zag-js/popper`,
|
|
97
|
-
* which is Floating UI. Adopting it would put a second placement in a package whose first
|
|
98
|
-
* one is measured, documented and shared — and *two answers to one problem is one too
|
|
99
|
-
* many* is the issue's sentence, not this file's.
|
|
86
|
+
* No state machine here either, and the measurement above is why: what a machine would
|
|
87
|
+
* have replaced is a roving tabindex and four keys. `ARCHITECTURE.md`, *Behaviour is
|
|
88
|
+
* delegated*, carries that decision for the whole package (#122).
|
|
100
89
|
*
|
|
101
90
|
* @example
|
|
102
91
|
* ```html
|
package/dist/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG,MAAM,CAAC;AAEvB,uEAAuE;AACvE,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC;AAEnB,8FAA8F;AAC9F,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAE3C,uFAAuF;AACvF,SAAS,IAAI,CAAC,IAAI,GAAG,EAAE;IACnB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,KAAK;IACV,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC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E;AACpE,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/radio.d.ts
CHANGED
|
@@ -1,101 +1,184 @@
|
|
|
1
|
-
import { LitElement, type TemplateResult } from 'lit';
|
|
1
|
+
import { LitElement, type CSSResult, type TemplateResult } from 'lit';
|
|
2
2
|
/** Which way a group lays its options out, and announces that it did. */
|
|
3
3
|
export type RadioOrientation = 'vertical' | 'horizontal';
|
|
4
4
|
/**
|
|
5
|
-
* One
|
|
5
|
+
* One choice in a {@link UiRadioGroup}: a value, and the text beside it.
|
|
6
6
|
*
|
|
7
|
-
* **The `<input type="radio">`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `<
|
|
12
|
-
*
|
|
13
|
-
* **This element carries no state and no name.** It is a drawing, and everything that
|
|
14
|
-
* makes a set of radios *a group* — one tab stop, arrow keys that move and select, one
|
|
15
|
-
* value out of the set — is the platform's, because they are native radios sharing a
|
|
16
|
-
* `name`. Wrapping each one changes none of that: measured in this suite, a group whose
|
|
17
|
-
* radios sit inside custom elements is still one group.
|
|
7
|
+
* **It draws nothing.** The group renders the real `<input type="radio">` and the
|
|
8
|
+
* `<label>` around it, because a `role="radiogroup"`, the name pointing at it and the
|
|
9
|
+
* controls it contains have to share one tree scope — `ARCHITECTURE.md`, *A relationship
|
|
10
|
+
* needs one tree scope*. So this element exists to be read rather than to be seen, the way
|
|
11
|
+
* `<ui-option>` does for `<ui-select>`.
|
|
18
12
|
*
|
|
19
13
|
* @example
|
|
20
14
|
* ```html
|
|
21
|
-
* <
|
|
22
|
-
* <ui-radio><input type="radio" name="plan" value="free" /></ui-radio>
|
|
23
|
-
* Free
|
|
24
|
-
* </label>
|
|
15
|
+
* <ui-radio value="free">Free</ui-radio>
|
|
25
16
|
* ```
|
|
26
17
|
*/
|
|
27
18
|
export declare class UiRadio extends LitElement {
|
|
28
|
-
|
|
19
|
+
#private;
|
|
20
|
+
static readonly styles: CSSResult;
|
|
21
|
+
static readonly properties: {
|
|
22
|
+
value: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
reflect: boolean;
|
|
25
|
+
};
|
|
26
|
+
checked: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
reflect: boolean;
|
|
29
|
+
};
|
|
30
|
+
disabled: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
reflect: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** What the group submits while this choice is the one in force. */
|
|
36
|
+
value: string;
|
|
37
|
+
/** Whether this is the choice a group with no `value` starts on, and resets to. */
|
|
38
|
+
checked: boolean;
|
|
39
|
+
/** Whether this one choice refuses interaction, the rest of the set staying live. */
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Tells the group something changed, on every update and on every slot change.
|
|
43
|
+
*
|
|
44
|
+
* A property write is not something a `MutationObserver` reports, which is what makes a
|
|
45
|
+
* declaration this package owns different from an element a host wrote: the property is
|
|
46
|
+
* reactive here. It bubbles because the choices are the group's own light-DOM children,
|
|
47
|
+
* and it is dispatched from `updated()` rather than from `disconnectedCallback`, which
|
|
48
|
+
* has no path left to bubble along.
|
|
49
|
+
*/
|
|
50
|
+
updated(): void;
|
|
29
51
|
render(): TemplateResult;
|
|
30
52
|
}
|
|
31
53
|
/**
|
|
32
|
-
* A set of
|
|
54
|
+
* A set of choices, laid out and named as one thing.
|
|
33
55
|
*
|
|
34
|
-
* **It hand-rolls no roving tabindex and it brings no state machine
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
56
|
+
* **It hand-rolls no roving tabindex and it brings no state machine.** Native radios
|
|
57
|
+
* sharing a `name` **are** the APG **Radio Group** pattern — one tab stop, arrow keys that
|
|
58
|
+
* move *and* select, wrapping at the ends, and left/right swapped under `dir="rtl"` — and
|
|
59
|
+
* that holds inside a shadow root, where the group is scoped by its tree because the
|
|
60
|
+
* controls have no form owner. `tests/radio.test.ts` measures it rather than trusting it.
|
|
61
|
+
* `ARCHITECTURE.md`, *Behaviour is delegated*, carries why no machine arrived.
|
|
40
62
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* **What is left for this element is what the platform leaves out**: the layout, the
|
|
46
|
-
* `role` that makes a set of radios a group to a screen reader, and the group-level name,
|
|
47
|
-
* description and error state — which {@link UiField} wires onto *this* element rather
|
|
48
|
-
* than onto an option, because a `<label for>` naming one radio names one option and
|
|
49
|
-
* leaves the group anonymous.
|
|
63
|
+
* **What it owns is what the platform leaves out**: the drawing, the layout, the group's
|
|
64
|
+
* own name, help and message, and form participation through `ElementInternals` — a
|
|
65
|
+
* control in a shadow root has no form owner, so the element answers for the value, the
|
|
66
|
+
* validity and the three form lifecycle callbacks.
|
|
50
67
|
*
|
|
51
68
|
* @example
|
|
52
69
|
* ```html
|
|
53
|
-
* <ui-
|
|
54
|
-
* <
|
|
55
|
-
* <ui-radio-
|
|
56
|
-
*
|
|
57
|
-
* <label><ui-radio><input type="radio" name="plan" value="pro" /></ui-radio> Pro</label>
|
|
58
|
-
* </ui-radio-group>
|
|
59
|
-
* </ui-field>
|
|
70
|
+
* <ui-radio-group label="Plan" name="plan" help="Change it any time.">
|
|
71
|
+
* <ui-radio value="free">Free</ui-radio>
|
|
72
|
+
* <ui-radio value="pro" checked>Pro</ui-radio>
|
|
73
|
+
* </ui-radio-group>
|
|
60
74
|
* ```
|
|
61
75
|
*/
|
|
62
76
|
export declare class UiRadioGroup extends LitElement {
|
|
63
|
-
|
|
77
|
+
#private;
|
|
78
|
+
static readonly styles: CSSResult;
|
|
79
|
+
static readonly formAssociated = true;
|
|
80
|
+
/**
|
|
81
|
+
* Focus is delegated, so `focus()` and `reportValidity()` reach a control — the host is
|
|
82
|
+
* not a focusable element. Measured with the group: the delegation lands on the first
|
|
83
|
+
* option rather than making all of them tab stops, because the roving one is still the
|
|
84
|
+
* platform's.
|
|
85
|
+
*/
|
|
86
|
+
static readonly shadowRootOptions: {
|
|
87
|
+
delegatesFocus: boolean;
|
|
88
|
+
clonable?: boolean;
|
|
89
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
90
|
+
mode: ShadowRootMode;
|
|
91
|
+
serializable?: boolean;
|
|
92
|
+
slotAssignment?: SlotAssignmentMode;
|
|
93
|
+
};
|
|
64
94
|
static readonly properties: {
|
|
95
|
+
label: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
reflect: boolean;
|
|
98
|
+
};
|
|
99
|
+
help: {
|
|
100
|
+
type: StringConstructor;
|
|
101
|
+
reflect: boolean;
|
|
102
|
+
};
|
|
103
|
+
error: {
|
|
104
|
+
type: StringConstructor;
|
|
105
|
+
reflect: boolean;
|
|
106
|
+
};
|
|
107
|
+
name: {
|
|
108
|
+
type: StringConstructor;
|
|
109
|
+
reflect: boolean;
|
|
110
|
+
};
|
|
111
|
+
value: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
};
|
|
65
114
|
orientation: {
|
|
66
115
|
type: StringConstructor;
|
|
67
116
|
reflect: boolean;
|
|
68
117
|
};
|
|
118
|
+
required: {
|
|
119
|
+
type: BooleanConstructor;
|
|
120
|
+
reflect: boolean;
|
|
121
|
+
};
|
|
122
|
+
disabled: {
|
|
123
|
+
type: BooleanConstructor;
|
|
124
|
+
reflect: boolean;
|
|
125
|
+
};
|
|
69
126
|
};
|
|
70
127
|
/**
|
|
71
|
-
*
|
|
128
|
+
* The accessible name, and the text above the set.
|
|
72
129
|
*
|
|
73
130
|
* A plain field rather than the `accessor` keyword, for the reason `src/button.ts`
|
|
74
|
-
* gives beside its own
|
|
75
|
-
* auto-accessors, and the module would fail to parse.
|
|
131
|
+
* gives beside its own — and so for every property below.
|
|
76
132
|
*/
|
|
77
|
-
|
|
133
|
+
label: string;
|
|
134
|
+
/** Supporting text under the set, which survives an error rather than yielding. */
|
|
135
|
+
help: string;
|
|
136
|
+
/** The message, which paints the boundaries and is announced with the group. */
|
|
137
|
+
error: string;
|
|
78
138
|
/**
|
|
79
|
-
*
|
|
139
|
+
* The name the value is submitted under.
|
|
80
140
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
141
|
+
* **Reflected, and that is a requirement rather than a convenience.** A form names a
|
|
142
|
+
* form-associated custom element's entry from the content attribute, so a host who set
|
|
143
|
+
* only the property would submit nothing at all — silently.
|
|
144
|
+
*/
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* The choice currently made.
|
|
86
148
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
149
|
+
* **Empty means _the declared default_ rather than _nothing_**, which is what lets a
|
|
150
|
+
* `<ui-radio checked>` mean what `<input checked>` means and a reset return to it.
|
|
151
|
+
* Not reflected, the way a native control's `checked` IDL attribute is not.
|
|
89
152
|
*/
|
|
153
|
+
value: string;
|
|
154
|
+
/** Which way the options are laid out, and what the group announces it did. */
|
|
155
|
+
orientation: RadioOrientation;
|
|
156
|
+
/** Whether a form is invalid while no choice is made. */
|
|
157
|
+
required: boolean;
|
|
158
|
+
/** Whether the whole set refuses interaction, and submits nothing. */
|
|
159
|
+
disabled: boolean;
|
|
90
160
|
connectedCallback(): void;
|
|
91
161
|
/**
|
|
92
|
-
*
|
|
162
|
+
* The value and the validity, which move together here or disagree anywhere.
|
|
93
163
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
164
|
+
* The first control is the one asked, and it is the one the browser would focus when a
|
|
165
|
+
* form reports an invalid group. Iterated rather than asserted, for the reason
|
|
166
|
+
* `src/input.ts` gives beside the same shape: a null branch here is unreachable, which
|
|
167
|
+
* is a coverage hole and an immortal mutant at once.
|
|
97
168
|
*/
|
|
98
|
-
|
|
169
|
+
updated(): void;
|
|
170
|
+
/** A form reset, which returns to the choice the declarations name. */
|
|
171
|
+
formResetCallback(): void;
|
|
172
|
+
/** A `<fieldset disabled>` above this element, which reaches it and nothing below. */
|
|
173
|
+
formDisabledCallback(disabled: boolean): void;
|
|
174
|
+
/** Restoring after a back-navigation, where the browser hands the value back. */
|
|
175
|
+
formStateRestoreCallback(state: string | null): void;
|
|
176
|
+
/** The form this element participates in, for a host that needs it. */
|
|
177
|
+
get form(): HTMLFormElement | null;
|
|
178
|
+
/** Whether the group currently satisfies its constraints. */
|
|
179
|
+
get validity(): ValidityState;
|
|
180
|
+
/** The message a form would report for it, empty while the group is valid. */
|
|
181
|
+
get validationMessage(): string;
|
|
99
182
|
render(): TemplateResult;
|
|
100
183
|
}
|
|
101
184
|
declare global {
|
package/dist/radio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../src/radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../src/radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1F,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,CAAC;AAmDzD;;;;;;;;;;;;;GAaG;AACH,qBAAa,OAAQ,SAAQ,UAAU;;IACnC,gBAAyB,MAAM,EAAE,SAAS,CAIxC;IAEF,gBAAyB,UAAU;;;;;;;;;;;;;MAIjC;IAEF,oEAAoE;IACpE,KAAK,SAAM;IAEX,mFAAmF;IACnF,OAAO,UAAS;IAEhB,qFAAqF;IACrF,QAAQ,UAAS;IAEjB;;;;;;;;OAQG;IACM,OAAO,IAAI,IAAI;IAQf,MAAM,IAAI,cAAc;CAGpC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IACxC,gBAAyB,MAAM,EAAE,SAAS,CAiLxC;IAEF,MAAM,CAAC,QAAQ,C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