@rak200/ui 0.2.13 → 0.2.15
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/README.md +3 -3
- package/dist/card.d.ts +41 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +88 -0
- package/dist/card.js.map +1 -0
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +22 -1
- package/dist/field.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +2 -2
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +32 -0
- package/dist/tokens.js.map +1 -1
- package/dist/tooltip.d.ts +69 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +317 -0
- package/dist/tooltip.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,9 +86,9 @@ components; `docs/` is what describes them.
|
|
|
86
86
|
|
|
87
87
|
## Status
|
|
88
88
|
|
|
89
|
-
**v0.**
|
|
90
|
-
`<ui-textarea>`, `<ui-checkbox>`, `<ui-switch>`, `<ui-select>`, `<ui-radio-group>`, `<ui-radio
|
|
91
|
-
and `<ui-icon>` — the token layer
|
|
89
|
+
**v0.** Thirteen components — `<ui-button>`, `<ui-card>`, `<ui-field>`, `<ui-dialog>`, `<ui-input>`,
|
|
90
|
+
`<ui-textarea>`, `<ui-checkbox>`, `<ui-switch>`, `<ui-select>`, `<ui-radio-group>`, `<ui-radio>`,
|
|
91
|
+
`<ui-tooltip>` and `<ui-icon>` — the token layer
|
|
92
92
|
under them, and an adopted glyph set, built to the ecosystem's full quality bar rather than
|
|
93
93
|
sketched: type-checked at the strictest available setting, formatted, tested in a real browser and
|
|
94
94
|
**asserted against axe** for WCAG A/AA, 100% coverage and **100% mutation score**, scanned, and
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A container: a surface with a boundary, a corner and a lift.
|
|
4
|
+
*
|
|
5
|
+
* **Presentational, and deliberately not interactive.** A card that reacts to a click is a
|
|
6
|
+
* button or a link, and both already exist — here and in the platform. This element grows
|
|
7
|
+
* no `clickable` attribute, because the first thing such an attribute has to do is
|
|
8
|
+
* reimplement keyboard activation, the accessible name and the disabled semantics that
|
|
9
|
+
* `<button>` and `<a>` carry for free. `docs/card.md` sends a reader there rather than
|
|
10
|
+
* leaving them to find out.
|
|
11
|
+
*
|
|
12
|
+
* **It claims no role either.** There is no card element and no APG pattern for one, so
|
|
13
|
+
* the shadow root renders slots and nothing else: what a card *means* is the host's, and
|
|
14
|
+
* they say it by slotting a heading, or by writing `<article>` around this element when
|
|
15
|
+
* the content really is self-contained. A `role` invented here would be one every consumer
|
|
16
|
+
* inherits and none of them chose.
|
|
17
|
+
*
|
|
18
|
+
* **Three regions, ordered here rather than in the host's markup.** The slots are declared
|
|
19
|
+
* header, body, footer, so that is the order they render in whatever order the host wrote
|
|
20
|
+
* them — and an unfilled one costs nothing, because a `<slot>` is `display: contents` and
|
|
21
|
+
* contributes no box to lay out or to space.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <ui-card>
|
|
26
|
+
* <h3 slot="header">Monthly plan</h3>
|
|
27
|
+
* <p>Everything in the free tier, plus priority support.</p>
|
|
28
|
+
* <div slot="footer"><ui-button>Choose</ui-button></div>
|
|
29
|
+
* </ui-card>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class UiCard extends LitElement {
|
|
33
|
+
static readonly styles: import("lit").CSSResult;
|
|
34
|
+
render(): TemplateResult;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'ui-card': UiCard;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,MAAO,SAAQ,UAAU;IAClC,gBAAyB,MAAM,0BAwC7B;IAEO,MAAM,IAAI,cAAc;CAOpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,SAAS,EAAE,MAAM,CAAC;KACrB;CACJ"}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { LitElement, css, html } from 'lit';
|
|
2
|
+
import { reference } from './reference.js';
|
|
3
|
+
/**
|
|
4
|
+
* A container: a surface with a boundary, a corner and a lift.
|
|
5
|
+
*
|
|
6
|
+
* **Presentational, and deliberately not interactive.** A card that reacts to a click is a
|
|
7
|
+
* button or a link, and both already exist — here and in the platform. This element grows
|
|
8
|
+
* no `clickable` attribute, because the first thing such an attribute has to do is
|
|
9
|
+
* reimplement keyboard activation, the accessible name and the disabled semantics that
|
|
10
|
+
* `<button>` and `<a>` carry for free. `docs/card.md` sends a reader there rather than
|
|
11
|
+
* leaving them to find out.
|
|
12
|
+
*
|
|
13
|
+
* **It claims no role either.** There is no card element and no APG pattern for one, so
|
|
14
|
+
* the shadow root renders slots and nothing else: what a card *means* is the host's, and
|
|
15
|
+
* they say it by slotting a heading, or by writing `<article>` around this element when
|
|
16
|
+
* the content really is self-contained. A `role` invented here would be one every consumer
|
|
17
|
+
* inherits and none of them chose.
|
|
18
|
+
*
|
|
19
|
+
* **Three regions, ordered here rather than in the host's markup.** The slots are declared
|
|
20
|
+
* header, body, footer, so that is the order they render in whatever order the host wrote
|
|
21
|
+
* them — and an unfilled one costs nothing, because a `<slot>` is `display: contents` and
|
|
22
|
+
* contributes no box to lay out or to space.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <ui-card>
|
|
27
|
+
* <h3 slot="header">Monthly plan</h3>
|
|
28
|
+
* <p>Everything in the free tier, plus priority support.</p>
|
|
29
|
+
* <div slot="footer"><ui-button>Choose</ui-button></div>
|
|
30
|
+
* </ui-card>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class UiCard extends LitElement {
|
|
34
|
+
static { this.styles = css `
|
|
35
|
+
/* A column rather than a block, and the footer below is why: margin-block-start:
|
|
36
|
+
auto needs a flex line to push against. That is what makes a row of cards in a
|
|
37
|
+
grid line their footers up when the bodies are different lengths — the one thing
|
|
38
|
+
a footer slot buys that writing the element last does not.
|
|
39
|
+
|
|
40
|
+
The slots are left at their default display: contents, so the flex items are
|
|
41
|
+
the host's own elements. An empty region is then absent rather than
|
|
42
|
+
zero-height — gap never spaces a card that has no footer. */
|
|
43
|
+
:host {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: calc(${reference('--ui-space')} * 2);
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
padding: calc(${reference('--ui-space')} * 2);
|
|
49
|
+
font-family: ${reference('--ui-font')};
|
|
50
|
+
/* The pair, never half of it: a surface declared without the text colour that
|
|
51
|
+
was chosen against it inherits whatever the page set, and the contrast the
|
|
52
|
+
token layer measured stops holding at the one place it was measured for. */
|
|
53
|
+
color: ${reference('--ui-color-text')};
|
|
54
|
+
background: ${reference('--ui-color-surface')};
|
|
55
|
+
border: 1px solid ${reference('--ui-color-border')};
|
|
56
|
+
border-radius: ${reference('--ui-radius')};
|
|
57
|
+
/* The boundary and the shadow are one decision made twice, because each covers
|
|
58
|
+
where the other cannot. The shadow is what says *raised* on a light page and
|
|
59
|
+
nearly nothing on a dark one — it is black at a low alpha, and light-dark()
|
|
60
|
+
cannot carry a second value for it, since it takes colours and a shadow is
|
|
61
|
+
not one. The boundary is derived, so it mixes toward the text and is correct
|
|
62
|
+
in both schemes by construction. Drop either and the card loses its edge in
|
|
63
|
+
one scheme: measured, a bordered card on the dark surface is the only thing
|
|
64
|
+
separating it from the page behind it. */
|
|
65
|
+
box-shadow: ${reference('--ui-elevation-raised')};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Pushed to the bottom of whatever height the card ended up with. Written on the
|
|
69
|
+
slotted element rather than on a wrapper, because a wrapper would be a flex item
|
|
70
|
+
of its own — present, and therefore spaced by gap, even with nothing in it. */
|
|
71
|
+
slot[name='footer']::slotted(*) {
|
|
72
|
+
margin-block-start: auto;
|
|
73
|
+
}
|
|
74
|
+
`; }
|
|
75
|
+
render() {
|
|
76
|
+
return html `
|
|
77
|
+
<slot name="header"></slot>
|
|
78
|
+
<slot></slot>
|
|
79
|
+
<slot name="footer"></slot>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Stryker disable next-line StringLiteral: the registration runs once, at import, inside
|
|
84
|
+
// the warm process Stryker switches mutants in — so by the time a mutant on this line is
|
|
85
|
+
// active the element is already defined under the original name, and no test can observe
|
|
86
|
+
// the change. Outside the runner's reach, not an equivalent mutant.
|
|
87
|
+
customElements.define('ui-card', UiCard);
|
|
88
|
+
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;aACT,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;wBAYjB,SAAS,CAAC,YAAY,CAAC;;4BAEnB,SAAS,CAAC,YAAY,CAAC;2BACxB,SAAS,CAAC,WAAW,CAAC;;;;qBAI5B,SAAS,CAAC,iBAAiB,CAAC;0BACvB,SAAS,CAAC,oBAAoB,CAAC;gCACzB,SAAS,CAAC,mBAAmB,CAAC;6BACjC,SAAS,CAAC,aAAa,CAAC;;;;;;;;;0BAS3B,SAAS,CAAC,uBAAuB,CAAC;;;;;;;;;KASvD,CAAC;IAEO,MAAM;QACX,OAAO,IAAI,CAAA;;;;SAIV,CAAC;IACN,CAAC;;AAGL,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,oEAAoE;AACpE,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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;CAmLpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,UAAU,EAAE,OAAO,CAAC;KACvB;CACJ"}
|
package/dist/field.js
CHANGED
|
@@ -154,7 +154,14 @@ export class UiField extends LitElement {
|
|
|
154
154
|
// format requirement, which is exactly the error suggestion the user needs in order
|
|
155
155
|
// to recover (WCAG 3.3.3) — dropping it at the moment it becomes useful is the
|
|
156
156
|
// opposite of helping.
|
|
157
|
-
|
|
157
|
+
//
|
|
158
|
+
// And a description this field did not write survives all of it, which is the same
|
|
159
|
+
// courtesy the `id` above gets and for the same reason: something this element
|
|
160
|
+
// cannot see may have put it there. `<ui-tooltip>` is the first to do so, and it
|
|
161
|
+
// was measured being erased — not on the first association, which runs before the
|
|
162
|
+
// tooltip wires, but on the next one, when a re-render moves the help text and the
|
|
163
|
+
// list is rebuilt from what this field alone knows about.
|
|
164
|
+
const described = [error, help, ...this.#foreign(control, uid, [error, help])].filter((id) => id !== undefined);
|
|
158
165
|
if (described.length > 0) {
|
|
159
166
|
control.setAttribute('aria-describedby', described.join(' '));
|
|
160
167
|
}
|
|
@@ -168,6 +175,20 @@ export class UiField extends LitElement {
|
|
|
168
175
|
control.setAttribute('aria-invalid', 'true');
|
|
169
176
|
}
|
|
170
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* The ids already describing `control` that this field is not responsible for.
|
|
180
|
+
*
|
|
181
|
+
* Everything it could have written is excluded rather than remembered: the two ids it
|
|
182
|
+
* generates from `uid`, and whatever the help and error elements are called right now,
|
|
183
|
+
* which may be ids the host supplied. What is left belongs to somebody else and is
|
|
184
|
+
* carried forward in place rather than dropped.
|
|
185
|
+
*/
|
|
186
|
+
#foreign(control, uid, mine) {
|
|
187
|
+
const written = new Set([...mine, `${uid}-help`, `${uid}-error`]);
|
|
188
|
+
return (control.getAttribute('aria-describedby') ?? '')
|
|
189
|
+
.split(' ')
|
|
190
|
+
.filter((id) => id !== '' && !written.has(id));
|
|
191
|
+
}
|
|
171
192
|
/**
|
|
172
193
|
* Gives the control its accessible name from whatever f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CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,OAAgC,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/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { UiButton, type ButtonVariant } from './button.js';
|
|
2
|
+
export { UiCard } from './card.js';
|
|
2
3
|
export { UiCheckbox, UiSwitch } from './checkbox.js';
|
|
3
4
|
export { UiDialog } from './dialog.js';
|
|
4
5
|
export { UiField } from './field.js';
|
|
@@ -6,5 +7,6 @@ export { UiIcon, register } from './icon.js';
|
|
|
6
7
|
export { UiInput, UiTextarea } from './input.js';
|
|
7
8
|
export { UiRadio, UiRadioGroup, type RadioOrientation } from './radio.js';
|
|
8
9
|
export { UiSelect } from './select.js';
|
|
10
|
+
export { UiTooltip } from './tooltip.js';
|
|
9
11
|
export { tokens, derivedTokens, defaults, formulas, darkScheme, tokenStyleSheet, type Token, type DerivedToken, } from './tokens.js';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,E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OAAO,EACH,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,EACf,KAAK,KAAK,EACV,KAAK,YAAY,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { UiButton } from './button.js';
|
|
2
|
+
export { UiCard } from './card.js';
|
|
2
3
|
export { UiCheckbox, UiSwitch } from './checkbox.js';
|
|
3
4
|
export { UiDialog } from './dialog.js';
|
|
4
5
|
export { UiField } from './field.js';
|
|
@@ -6,5 +7,6 @@ export { UiIcon, register } from './icon.js';
|
|
|
6
7
|
export { UiInput, UiTextarea } from './input.js';
|
|
7
8
|
export { UiRadio, UiRadioGroup } from './radio.js';
|
|
8
9
|
export { UiSelect } from './select.js';
|
|
10
|
+
export { UiTooltip } from './tooltip.js';
|
|
9
11
|
export { tokens, derivedTokens, defaults, formulas, darkScheme, tokenStyleSheet, } from './tokens.js';
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACH,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAGlB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACH,MAAM,EACN,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAGlB,MAAM,aAAa,CAAC"}
|
package/dist/tokens.d.ts
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* it does break is code that **enumerates** the set, an exhaustive `Record<Token, string>`
|
|
32
32
|
* above all. The supported shape is the partial map, which is what a theme is anyway.
|
|
33
33
|
*/
|
|
34
|
-
export declare const tokens: readonly ["--ui-color-accent", "--ui-color-accent-contrast", "--ui-color-surface", "--ui-color-text", "--ui-color-focus", "--ui-color-danger", "--ui-color-scrim", "--ui-radius", "--ui-space", "--ui-font", "--ui-duration-100", "--ui-easing-state", "--ui-easing-enter", "--ui-easing-exit", "--ui-icon-size", "--ui-icon-stroke"];
|
|
34
|
+
export declare const tokens: readonly ["--ui-color-accent", "--ui-color-accent-contrast", "--ui-color-surface", "--ui-color-text", "--ui-color-focus", "--ui-color-danger", "--ui-color-scrim", "--ui-radius", "--ui-space", "--ui-font", "--ui-duration-100", "--ui-easing-state", "--ui-easing-enter", "--ui-easing-exit", "--ui-icon-size", "--ui-icon-stroke", "--ui-elevation-100"];
|
|
35
35
|
/** A CSS custom property this package defines and gives a default. */
|
|
36
36
|
export type Token = (typeof tokens)[number];
|
|
37
37
|
/**
|
|
@@ -44,7 +44,7 @@ export type Token = (typeof tokens)[number];
|
|
|
44
44
|
* what it buys is an override surface a host can hold in their head: change the accent and
|
|
45
45
|
* the hover and pressed colours follow, rather than being one more name each.
|
|
46
46
|
*/
|
|
47
|
-
export declare const derivedTokens: readonly ["--ui-duration-state", "--ui-color-border", "--ui-color-text-muted", "--ui-color-hover", "--ui-color-pressed", "--ui-color-accent-hover", "--ui-color-accent-pressed"];
|
|
47
|
+
export declare const derivedTokens: readonly ["--ui-duration-state", "--ui-color-border", "--ui-color-text-muted", "--ui-color-hover", "--ui-color-pressed", "--ui-color-accent-hover", "--ui-color-accent-pressed", "--ui-elevation-raised"];
|
|
48
48
|
/** A CSS custom property this package computes rather than declares. */
|
|
49
49
|
export type DerivedToken = (typeof derivedTokens)[number];
|
|
50
50
|
/**
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,6VA4ET,CAAC;AAEX,sEAAsE;AACtE,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,2MAwBhB,CAAC;AAEX,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CA+CpD,CAAC;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAwB3D,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAW/D,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAsBxC"}
|
package/dist/tokens.js
CHANGED
|
@@ -90,6 +90,23 @@ export const tokens = [
|
|
|
90
90
|
// size, and 2 is the weight the adopted set is drawn at.
|
|
91
91
|
'--ui-icon-size',
|
|
92
92
|
'--ui-icon-stroke',
|
|
93
|
+
// Elevation, arriving with `ui-card` — the category `ROADMAP.md` said would, after the
|
|
94
|
+
// first overlay arrived and brought none.
|
|
95
|
+
//
|
|
96
|
+
// A step in a scale, named by an ordinal with gaps, for the reason the duration scale
|
|
97
|
+
// gives above: elevation is *relative* by nature — a card sits above the page, a menu
|
|
98
|
+
// above the card — so the names have to be able to grow between each other. No
|
|
99
|
+
// component reads this one; they read `--ui-elevation-raised`, which points in here.
|
|
100
|
+
// No second step comes with it: a tooltip and a menu are the components that would
|
|
101
|
+
// judge one, and neither is written.
|
|
102
|
+
//
|
|
103
|
+
// **It carries no dark value, and cannot.** `darkScheme` is emitted through
|
|
104
|
+
// `light-dark()`, which takes colours — and a shadow is not a colour. So this is one
|
|
105
|
+
// value in both schemes, and on a dark page it does almost nothing: black on charcoal
|
|
106
|
+
// is black. What separates a raised surface there is the *boundary*, which is derived
|
|
107
|
+
// and therefore already scheme-correct — which is why `src/card.ts` draws both and
|
|
108
|
+
// says so beside them.
|
|
109
|
+
'--ui-elevation-100',
|
|
93
110
|
];
|
|
94
111
|
/**
|
|
95
112
|
* The roles computed from the grounds rather than declared beside them.
|
|
@@ -120,6 +137,11 @@ export const derivedTokens = [
|
|
|
120
137
|
'--ui-color-pressed',
|
|
121
138
|
'--ui-color-accent-hover',
|
|
122
139
|
'--ui-color-accent-pressed',
|
|
140
|
+
// The purpose the elevation scale is read through, arriving with `ui-card`. `raised`
|
|
141
|
+
// is a role rather than a component: a card is the first surface lifted off the page
|
|
142
|
+
// and will not be the last, and the name a host retunes should not be the name of
|
|
143
|
+
// whichever component happened to need it first.
|
|
144
|
+
'--ui-elevation-raised',
|
|
123
145
|
];
|
|
124
146
|
/**
|
|
125
147
|
* The default value of every ground token, applied at `:root` by {@link tokenStyleSheet}.
|
|
@@ -168,6 +190,12 @@ export const defaults = {
|
|
|
168
190
|
'--ui-easing-exit': 'ease-in',
|
|
169
191
|
'--ui-icon-size': '1.25em',
|
|
170
192
|
'--ui-icon-stroke': '2',
|
|
193
|
+
// Two layers rather than one, which is what makes a shadow read as *lift* instead of
|
|
194
|
+
// as a smudge: a tight, nearly opaque one draws the contact edge, and a wider, softer
|
|
195
|
+
// one is the cast. Both are black at a low alpha, so the shadow darkens whatever it
|
|
196
|
+
// falls on rather than tinting it — a coloured shadow is a decision this layer would
|
|
197
|
+
// have to defend at every hue a host might set.
|
|
198
|
+
'--ui-elevation-100': '0 1px 2px -1px rgb(0 0 0 / 0.1), 0 2px 6px -1px rgb(0 0 0 / 0.1)',
|
|
171
199
|
};
|
|
172
200
|
/**
|
|
173
201
|
* A ground as it is written inside a formula: the name, with its own default behind it.
|
|
@@ -232,6 +260,10 @@ export const formulas = {
|
|
|
232
260
|
// is 4.52 in light, a rounding error from failing, and a default nobody could then
|
|
233
261
|
// retune without breaking a floor they were not thinking about.
|
|
234
262
|
'--ui-color-text-muted': mix('--ui-color-text', 65, '--ui-color-surface'),
|
|
263
|
+
// A plain reference, like the duration purpose above: the scale is where the value
|
|
264
|
+
// lives, and a host who wants flatter cards moves the role rather than reverse
|
|
265
|
+
// engineering which step a card happens to read.
|
|
266
|
+
'--ui-elevation-raised': ground('--ui-elevation-100'),
|
|
235
267
|
};
|
|
236
268
|
/**
|
|
237
269
|
* The grounds whose value differs when the page is rendered dark.
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,mBAAmB;IACnB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,oFAAoF;IACpF,mFAAmF;IACnF,kFAAkF;IAClF,iFAAiF;IACjF,oFAAoF;IACpF,wEAAwE;IACxE,EAAE;IACF,iFAAiF;IACjF,oFAAoF;IACpF,iFAAiF;IACjF,qFAAqF;IACrF,+EAA+E;IAC/E,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,kFAAkF;IAClF,sFAAsF;IACtF,+CAA+C;IAC/C,EAAE;IACF,uFAAuF;IACvF,sFAAsF;IACtF,uFAAuF;IACvF,oFAAoF;IACpF,4CAA4C;IAC5C,mBAAmB;IACnB,mBAAmB;IACnB,qFAAqF;IACrF,oFAAoF;IACpF,sFAAsF;IACtF,qDAAqD;IACrD,EAAE;IACF,uFAAuF;IACvF,uFAAuF;IACvF,mFAAmF;IACnF,kFAAkF;IAClF,mBAAmB;IACnB,kBAAkB;IAClB,oFAAoF;IACpF,mFAAmF;IACnF,mFAAmF;IACnF,2BAA2B;IAC3B,EAAE;IACF,mFAAmF;IACnF,kFAAkF;IAClF,6EAA6E;IAC7E,EAAE;IACF,8EAA8E;IAC9E,sFAAsF;IACtF,yDAAyD;IACzD,gBAAgB;IAChB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,mBAAmB;IACnB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,oFAAoF;IACpF,mFAAmF;IACnF,kFAAkF;IAClF,iFAAiF;IACjF,oFAAoF;IACpF,wEAAwE;IACxE,EAAE;IACF,iFAAiF;IACjF,oFAAoF;IACpF,iFAAiF;IACjF,qFAAqF;IACrF,+EAA+E;IAC/E,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,kFAAkF;IAClF,sFAAsF;IACtF,+CAA+C;IAC/C,EAAE;IACF,uFAAuF;IACvF,sFAAsF;IACtF,uFAAuF;IACvF,oFAAoF;IACpF,4CAA4C;IAC5C,mBAAmB;IACnB,mBAAmB;IACnB,qFAAqF;IACrF,oFAAoF;IACpF,sFAAsF;IACtF,qDAAqD;IACrD,EAAE;IACF,uFAAuF;IACvF,uFAAuF;IACvF,mFAAmF;IACnF,kFAAkF;IAClF,mBAAmB;IACnB,kBAAkB;IAClB,oFAAoF;IACpF,mFAAmF;IACnF,mFAAmF;IACnF,2BAA2B;IAC3B,EAAE;IACF,mFAAmF;IACnF,kFAAkF;IAClF,6EAA6E;IAC7E,EAAE;IACF,8EAA8E;IAC9E,sFAAsF;IACtF,yDAAyD;IACzD,gBAAgB;IAChB,kBAAkB;IAClB,uFAAuF;IACvF,0CAA0C;IAC1C,EAAE;IACF,sFAAsF;IACtF,sFAAsF;IACtF,+EAA+E;IAC/E,qFAAqF;IACrF,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C,OAAO,KAAK,WAAW,CAAC;SACvC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhB,OAAO;QACH,yCAAyC,OAAO,KAAK;QACrD,yDAAyD,SAAS,UAAU;KAC/E,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Supplementary text on hover and on keyboard focus.
|
|
4
|
+
*
|
|
5
|
+
* **Everything is slotted**, the way `<ui-field>` slots everything and for the same
|
|
6
|
+
* measured reason: an IDREF does not cross a shadow boundary, so a tip rendered in here
|
|
7
|
+
* could not be the target of the trigger's `aria-describedby`. The trigger is the child
|
|
8
|
+
* with no `slot`; the tip is `slot="tip"`.
|
|
9
|
+
*
|
|
10
|
+
* ## What the platform does, and what is left
|
|
11
|
+
*
|
|
12
|
+
* The tip is a **popover**, which buys the two things a hand-rolled overlay gets wrong:
|
|
13
|
+
* it is promoted to the top layer, so it escapes `overflow: hidden` and every stacking
|
|
14
|
+
* context above it — measured — and it needs no `z-index`, which is why the second overlay
|
|
15
|
+
* in this package brings no layering category either.
|
|
16
|
+
*
|
|
17
|
+
* `popover="manual"` rather than `auto`, and the difference is the point: an `auto`
|
|
18
|
+
* popover light-dismisses, and dismissing one closes the others — so a tooltip appearing
|
|
19
|
+
* over an open menu would close the menu. What `manual` costs is Escape, which it does not
|
|
20
|
+
* handle: measured, a manual popover stays open on Escape. So this element wires it, which
|
|
21
|
+
* WCAG 2.2's **1.4.13 Content on Hover or Focus** requires anyway.
|
|
22
|
+
*
|
|
23
|
+
* ## Why the placement is written here
|
|
24
|
+
*
|
|
25
|
+
* The issue asked whether a clipping tooltip is solved with CSS anchor positioning or with
|
|
26
|
+
* a dependency. Measured in this engine, anchor positioning is **entirely present** —
|
|
27
|
+
* `anchor-name`, `position-anchor`, `position-area` and `position-try-fallbacks` all
|
|
28
|
+
* parse, and an anchored popover really is placed against its anchor rather than merely
|
|
29
|
+
* accepting the rule. It is still not adopted, and the reason is the one `docs/select.md`
|
|
30
|
+
* gives about `appearance: base-select`: a feature one engine has makes a kit look like
|
|
31
|
+
* two kits.
|
|
32
|
+
*
|
|
33
|
+
* **Here that is not a cosmetic difference but a broken component.** Measured: a popover
|
|
34
|
+
* whose anchor rules are ignored does not fall back to somewhere near the trigger — it is
|
|
35
|
+
* `position: fixed` at `inset: 0`, which is the corner of the screen. And the flip at a
|
|
36
|
+
* viewport edge is `position-try-fallbacks`, so an engine without it needs the script
|
|
37
|
+
* anyway. Adopting the CSS would mean writing the placement *and* a second code path for
|
|
38
|
+
* it, which is two answers to one problem.
|
|
39
|
+
*
|
|
40
|
+
* A positioning dependency was the other option the issue named. It solves scroll
|
|
41
|
+
* containers, virtual anchors and continuous auto-update, none of which a tooltip against
|
|
42
|
+
* a real element needs — and it would be this package's second runtime dependency, where
|
|
43
|
+
* RFC 0016's adoption was a *behaviour* library and not a layout one.
|
|
44
|
+
*
|
|
45
|
+
* So the placement is thirty lines here, measured at the edges by a suite that runs in a
|
|
46
|
+
* real browser. When anchor positioning is available broadly it replaces them and the
|
|
47
|
+
* tests stay: they assert where the tip lands, not who put it there.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```html
|
|
51
|
+
* <ui-tooltip>
|
|
52
|
+
* <button type="button">Save</button>
|
|
53
|
+
* <span slot="tip">Saves without closing the dialog.</span>
|
|
54
|
+
* </ui-tooltip>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare class UiTooltip extends LitElement {
|
|
58
|
+
#private;
|
|
59
|
+
static readonly styles: import("lit").CSSResult;
|
|
60
|
+
connectedCallback(): void;
|
|
61
|
+
disconnectedCallback(): void;
|
|
62
|
+
render(): TemplateResult;
|
|
63
|
+
}
|
|
64
|
+
declare global {
|
|
65
|
+
interface HTMLElementTagNameMap {
|
|
66
|
+
'ui-tooltip': UiTooltip;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AASjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,qBAAa,SAAU,SAAQ,UAAU;;IACrC,gBAAyB,MAAM,0BAkD7B;IAiDO,iBAAiB,IAAI,IAAI;IAqBzB,oBAAoB,IAAI,IAAI;IAU5B,MAAM,IAAI,cAAc;CAqKpC;AAQD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,YAAY,EAAE,SAAS,CAAC;KAC3B;CACJ"}
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { LitElement, css, html } from 'lit';
|
|
2
|
+
import { reference } from './reference.js';
|
|
3
|
+
/** Distinguishes one tooltip's generated id from another's. */
|
|
4
|
+
let sequence = 0;
|
|
5
|
+
/** How far the tip sits from the trigger, and which way the script placed it. */
|
|
6
|
+
const side = 'data-side';
|
|
7
|
+
/**
|
|
8
|
+
* Supplementary text on hover and on keyboard focus.
|
|
9
|
+
*
|
|
10
|
+
* **Everything is slotted**, the way `<ui-field>` slots everything and for the same
|
|
11
|
+
* measured reason: an IDREF does not cross a shadow boundary, so a tip rendered in here
|
|
12
|
+
* could not be the target of the trigger's `aria-describedby`. The trigger is the child
|
|
13
|
+
* with no `slot`; the tip is `slot="tip"`.
|
|
14
|
+
*
|
|
15
|
+
* ## What the platform does, and what is left
|
|
16
|
+
*
|
|
17
|
+
* The tip is a **popover**, which buys the two things a hand-rolled overlay gets wrong:
|
|
18
|
+
* it is promoted to the top layer, so it escapes `overflow: hidden` and every stacking
|
|
19
|
+
* context above it — measured — and it needs no `z-index`, which is why the second overlay
|
|
20
|
+
* in this package brings no layering category either.
|
|
21
|
+
*
|
|
22
|
+
* `popover="manual"` rather than `auto`, and the difference is the point: an `auto`
|
|
23
|
+
* popover light-dismisses, and dismissing one closes the others — so a tooltip appearing
|
|
24
|
+
* over an open menu would close the menu. What `manual` costs is Escape, which it does not
|
|
25
|
+
* handle: measured, a manual popover stays open on Escape. So this element wires it, which
|
|
26
|
+
* WCAG 2.2's **1.4.13 Content on Hover or Focus** requires anyway.
|
|
27
|
+
*
|
|
28
|
+
* ## Why the placement is written here
|
|
29
|
+
*
|
|
30
|
+
* The issue asked whether a clipping tooltip is solved with CSS anchor positioning or with
|
|
31
|
+
* a dependency. Measured in this engine, anchor positioning is **entirely present** —
|
|
32
|
+
* `anchor-name`, `position-anchor`, `position-area` and `position-try-fallbacks` all
|
|
33
|
+
* parse, and an anchored popover really is placed against its anchor rather than merely
|
|
34
|
+
* accepting the rule. It is still not adopted, and the reason is the one `docs/select.md`
|
|
35
|
+
* gives about `appearance: base-select`: a feature one engine has makes a kit look like
|
|
36
|
+
* two kits.
|
|
37
|
+
*
|
|
38
|
+
* **Here that is not a cosmetic difference but a broken component.** Measured: a popover
|
|
39
|
+
* whose anchor rules are ignored does not fall back to somewhere near the trigger — it is
|
|
40
|
+
* `position: fixed` at `inset: 0`, which is the corner of the screen. And the flip at a
|
|
41
|
+
* viewport edge is `position-try-fallbacks`, so an engine without it needs the script
|
|
42
|
+
* anyway. Adopting the CSS would mean writing the placement *and* a second code path for
|
|
43
|
+
* it, which is two answers to one problem.
|
|
44
|
+
*
|
|
45
|
+
* A positioning dependency was the other option the issue named. It solves scroll
|
|
46
|
+
* containers, virtual anchors and continuous auto-update, none of which a tooltip against
|
|
47
|
+
* a real element needs — and it would be this package's second runtime dependency, where
|
|
48
|
+
* RFC 0016's adoption was a *behaviour* library and not a layout one.
|
|
49
|
+
*
|
|
50
|
+
* So the placement is thirty lines here, measured at the edges by a suite that runs in a
|
|
51
|
+
* real browser. When anchor positioning is available broadly it replaces them and the
|
|
52
|
+
* tests stay: they assert where the tip lands, not who put it there.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```html
|
|
56
|
+
* <ui-tooltip>
|
|
57
|
+
* <button type="button">Save</button>
|
|
58
|
+
* <span slot="tip">Saves without closing the dialog.</span>
|
|
59
|
+
* </ui-tooltip>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export class UiTooltip extends LitElement {
|
|
63
|
+
static { this.styles = css `
|
|
64
|
+
/* No box of its own: a wrapper that laid something out would move the trigger it
|
|
65
|
+
wraps, and every call site would have to undo it. */
|
|
66
|
+
:host {
|
|
67
|
+
display: contents;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* The tip is the host's own element, reached through ::slotted — the shape every
|
|
71
|
+
component in this kit has. position: fixed is what the popover already is;
|
|
72
|
+
it is restated because the script writes inset-block-start and
|
|
73
|
+
inset-inline-start against the viewport, and a reader of those two lines
|
|
74
|
+
should not have to know which stylesheet made them mean that.
|
|
75
|
+
|
|
76
|
+
max-content up to a ceiling: a tip is a phrase, and a phrase that wraps at the
|
|
77
|
+
width of whatever it happens to sit near is unreadable. The ceiling is in the
|
|
78
|
+
space token so it scales with everything else a host retunes. */
|
|
79
|
+
slot[name='tip']::slotted(*) {
|
|
80
|
+
position: fixed;
|
|
81
|
+
margin: 0;
|
|
82
|
+
inline-size: max-content;
|
|
83
|
+
max-inline-size: calc(${reference('--ui-space')} * 40);
|
|
84
|
+
padding: calc(${reference('--ui-space')} / 2) ${reference('--ui-space')};
|
|
85
|
+
font-family: ${reference('--ui-font')};
|
|
86
|
+
font-size: 0.875em;
|
|
87
|
+
/* The pair, never half of it: a surface without the colour chosen against it
|
|
88
|
+
inherits whatever the page set, and the contrast measured for that pair
|
|
89
|
+
stops holding. */
|
|
90
|
+
color: ${reference('--ui-color-text')};
|
|
91
|
+
background: ${reference('--ui-color-surface')};
|
|
92
|
+
border: 1px solid ${reference('--ui-color-border')};
|
|
93
|
+
border-radius: ${reference('--ui-radius')};
|
|
94
|
+
box-shadow: ${reference('--ui-elevation-raised')};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* The gap between the tip and its trigger, in CSS because it is a token and the
|
|
98
|
+
script has no way to resolve one: a custom property reads back as it was
|
|
99
|
+
written, so 0.5rem would arrive at a function that needs pixels.
|
|
100
|
+
|
|
101
|
+
It is deliberately small. WCAG 2.2's 1.4.13 asks that a pointer be able to
|
|
102
|
+
travel onto the tip without it vanishing, and it travels across this gap — the
|
|
103
|
+
tip stays open because it is a DOM child of this element, so entering it never
|
|
104
|
+
leaves the host, but only if the pointer does not leave through the gap on the
|
|
105
|
+
way. */
|
|
106
|
+
slot[name='tip']::slotted([data-side='block-start']) {
|
|
107
|
+
translate: 0 calc(${reference('--ui-space')} / -2);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
slot[name='tip']::slotted([data-side='block-end']) {
|
|
111
|
+
translate: 0 calc(${reference('--ui-space')} / 2);
|
|
112
|
+
}
|
|
113
|
+
`; }
|
|
114
|
+
/** Whether the tip is currently shown, which decides what the listeners cost. */
|
|
115
|
+
#shown = false;
|
|
116
|
+
/**
|
|
117
|
+
* What is watching while the tip is open, dropped in one call when it closes.
|
|
118
|
+
*
|
|
119
|
+
* These three are added on show rather than on connection because two of them are
|
|
120
|
+
* per-frame: a page holding fifty tooltips would run fifty no-op scroll handlers for
|
|
121
|
+
* every frame of every scroll, and at most one tooltip is ever open.
|
|
122
|
+
*
|
|
123
|
+
* Built here rather than on the first show so it is never absent — the reason
|
|
124
|
+
* `src/field.ts` builds its observer the same way: a close that has to ask whether the
|
|
125
|
+
* controller exists is a branch no test can reach, because nothing closes what was
|
|
126
|
+
* never opened.
|
|
127
|
+
*/
|
|
128
|
+
#watching = new AbortController();
|
|
129
|
+
/** Re-places the tip under anything that moves the trigger while it is open. */
|
|
130
|
+
#reflow = () => {
|
|
131
|
+
this.#place();
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Dismisses on Escape, which is 1.4.13's first requirement and `manual`'s one gap.
|
|
135
|
+
*
|
|
136
|
+
* On the document rather than on this element: a tip shown by the pointer leaves the
|
|
137
|
+
* focus wherever it was, so a key listener bound here would never hear the key that is
|
|
138
|
+
* supposed to dismiss it.
|
|
139
|
+
*/
|
|
140
|
+
#dismiss = (event) => {
|
|
141
|
+
if (event.key === 'Escape') {
|
|
142
|
+
this.#hide();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Takes every listener off at once, and the reason is not brevity.
|
|
147
|
+
*
|
|
148
|
+
* Removing them one by one needs the event name repeated at both ends, and half of
|
|
149
|
+
* those repetitions cannot be checked: a leaked `pointerenter` is caught the moment it
|
|
150
|
+
* fires, because it opens a popover that is no longer in a document and that throws —
|
|
151
|
+
* but a leaked `pointerleave` reaches `#hide`, which returns at its own guard, and
|
|
152
|
+
* nothing anywhere can tell it happened. One `abort()` is one thing to get right, and
|
|
153
|
+
* a leak of it is observable through the half that is.
|
|
154
|
+
*/
|
|
155
|
+
#listeners = new AbortController();
|
|
156
|
+
connectedCallback() {
|
|
157
|
+
super.connectedCallback();
|
|
158
|
+
// A fresh one per connection: an aborted signal stays aborted, so a tooltip a
|
|
159
|
+
// framework moves in the tree would come back deaf.
|
|
160
|
+
this.#listeners = new AbortController();
|
|
161
|
+
// One options object for the four, and that is the same argument as the controller
|
|
162
|
+
// itself: written per call, each `{ signal }` is its own thing to get right, and
|
|
163
|
+
// half of them cannot be checked — a leaked `pointerleave` reaches `#hide`, which
|
|
164
|
+
// returns at its own guard, and nothing can tell. Shared, all four ride on the one
|
|
165
|
+
// that does report: a leaked `pointerenter` opens a popover that is no longer in a
|
|
166
|
+
// document, which throws.
|
|
167
|
+
const watched = { signal: this.#listeners.signal };
|
|
168
|
+
this.addEventListener('pointerenter', this.#onPointer, watched);
|
|
169
|
+
this.addEventListener('pointerleave', this.#onLeave, watched);
|
|
170
|
+
this.addEventListener('focusin', this.#onFocus, watched);
|
|
171
|
+
this.addEventListener('focusout', this.#onLeave, watched);
|
|
172
|
+
}
|
|
173
|
+
disconnectedCallback() {
|
|
174
|
+
// Removed while shown, the tip takes the window listeners with it. A tooltip that
|
|
175
|
+
// a framework unmounted mid-hover would otherwise keep re-placing an element that
|
|
176
|
+
// is no longer in a document.
|
|
177
|
+
this.#hide();
|
|
178
|
+
this.#listeners.abort();
|
|
179
|
+
super.disconnectedCallback();
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
return html `
|
|
183
|
+
<slot></slot>
|
|
184
|
+
<slot name="tip" @slotchange=${this.#associate}></slot>
|
|
185
|
+
`;
|
|
186
|
+
}
|
|
187
|
+
/** The element the tip is about: the one child carrying no `slot` attribute. */
|
|
188
|
+
#trigger() {
|
|
189
|
+
const found = this.querySelector(':scope > :not([slot])');
|
|
190
|
+
return found instanceof HTMLElement ? found : undefined;
|
|
191
|
+
}
|
|
192
|
+
/** The tip itself, which is the host's own element and stays in their tree. */
|
|
193
|
+
#tip() {
|
|
194
|
+
const found = this.querySelector(":scope > [slot='tip']");
|
|
195
|
+
return found instanceof HTMLElement ? found : undefined;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Makes the tip a popover, names it, and points the trigger at it.
|
|
199
|
+
*
|
|
200
|
+
* On `slotchange` as well as at first render, because a framework re-render replaces
|
|
201
|
+
* the element rather than mutating it — and a tip that is only wired the first time is
|
|
202
|
+
* one that stops being announced at a moment nothing reports.
|
|
203
|
+
*
|
|
204
|
+
* A `role` or an `id` the host wrote is never overwritten, the same courtesy
|
|
205
|
+
* `<ui-field>` and `<ui-switch>` extend. `aria-describedby` is **added to** rather than
|
|
206
|
+
* replaced: the trigger may already be described by a field's help text, and a
|
|
207
|
+
* description that silently replaced another is the failure nobody sees.
|
|
208
|
+
*/
|
|
209
|
+
#associate = () => {
|
|
210
|
+
const trigger = this.#trigger();
|
|
211
|
+
const tip = this.#tip();
|
|
212
|
+
if (trigger === undefined || tip === undefined) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (tip.id === '') {
|
|
216
|
+
// Stryker disable next-line UpdateOperator: two tooltips on one page must get
|
|
217
|
+
// different ids, and a decrementing counter delivers that as well as an
|
|
218
|
+
// incrementing one. No input distinguishes them — an equivalent mutant, the
|
|
219
|
+
// same one `src/field.ts` carries beside its own counter.
|
|
220
|
+
tip.id = `ui-tooltip-${String(++sequence)}`;
|
|
221
|
+
}
|
|
222
|
+
if (!tip.hasAttribute('role')) {
|
|
223
|
+
tip.setAttribute('role', 'tooltip');
|
|
224
|
+
}
|
|
225
|
+
tip.setAttribute('popover', 'manual');
|
|
226
|
+
const described = (trigger.getAttribute('aria-describedby') ?? '')
|
|
227
|
+
.split(' ')
|
|
228
|
+
.filter((id) => id !== '');
|
|
229
|
+
if (!described.includes(tip.id)) {
|
|
230
|
+
trigger.setAttribute('aria-describedby', [...described, tip.id].join(' '));
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Shows on the pointer, except the pointer a touch screen reports.
|
|
235
|
+
*
|
|
236
|
+
* There is no hover on a touch screen, so a tap fires `pointerenter` and then focus —
|
|
237
|
+
* and showing on both means the tip arrives, is dismissed by the tap that follows, and
|
|
238
|
+
* arrives again. Focus is the one that survives, so this defers to it.
|
|
239
|
+
*/
|
|
240
|
+
#onPointer = (event) => {
|
|
241
|
+
if (event.pointerType !== 'touch') {
|
|
242
|
+
this.#show();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
#onFocus = () => {
|
|
246
|
+
this.#show();
|
|
247
|
+
};
|
|
248
|
+
#onLeave = () => {
|
|
249
|
+
this.#hide();
|
|
250
|
+
};
|
|
251
|
+
/** Opens the tip and starts watching whatever can move its trigger. */
|
|
252
|
+
#show() {
|
|
253
|
+
const tip = this.#tip();
|
|
254
|
+
if (tip === undefined || this.#shown) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this.#shown = true;
|
|
258
|
+
tip.showPopover();
|
|
259
|
+
this.#place();
|
|
260
|
+
this.#watching = new AbortController();
|
|
261
|
+
// Shared for the same reason the four above are, and it pays off in the same
|
|
262
|
+
// direction: a leaked `keydown` is invisible — every later Escape returns at
|
|
263
|
+
// `#hide`'s guard — while a leaked `resize` re-places a tip that is not on screen,
|
|
264
|
+
// which a test reads straight off the written inset.
|
|
265
|
+
const watched = { signal: this.#watching.signal };
|
|
266
|
+
// Capturing, because the thing that scrolls is rarely the window: a scroll inside
|
|
267
|
+
// any ancestor moves the trigger and no event reaches the window from it.
|
|
268
|
+
//
|
|
269
|
+
// Not `passive`, and its absence is deliberate rather than an omission: `scroll` is
|
|
270
|
+
// not cancelable, so the flag changes nothing a test could observe — and an option
|
|
271
|
+
// no input can distinguish is one the mutation floor has to be told to ignore. The
|
|
272
|
+
// cheaper answer is not to write it.
|
|
273
|
+
window.addEventListener('scroll', this.#reflow, { capture: true, ...watched });
|
|
274
|
+
window.addEventListener('resize', this.#reflow, watched);
|
|
275
|
+
document.addEventListener('keydown', this.#dismiss, watched);
|
|
276
|
+
}
|
|
277
|
+
/** Closes the tip and stops watching. */
|
|
278
|
+
#hide() {
|
|
279
|
+
if (!this.#shown) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
this.#shown = false;
|
|
283
|
+
this.#tip()?.hidePopover();
|
|
284
|
+
this.#watching.abort();
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Puts the tip above its trigger, below it when there is no room, and inside the
|
|
288
|
+
* viewport either way.
|
|
289
|
+
*
|
|
290
|
+
* Read rather than assumed: the tip's own box is measured after it is shown, because
|
|
291
|
+
* its height depends on how its text wrapped at this width in this font — a number
|
|
292
|
+
* this file cannot know and must not guess.
|
|
293
|
+
*/
|
|
294
|
+
#place() {
|
|
295
|
+
const trigger = this.#trigger();
|
|
296
|
+
const tip = this.#tip();
|
|
297
|
+
if (trigger === undefined || tip === undefined) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const anchor = trigger.getBoundingClientRect();
|
|
301
|
+
const box = tip.getBoundingClientRect();
|
|
302
|
+
const above = anchor.top >= box.height;
|
|
303
|
+
tip.setAttribute(side, above ? 'block-start' : 'block-end');
|
|
304
|
+
tip.style.insetBlockStart = `${String(above ? anchor.top - box.height : anchor.bottom)}px`;
|
|
305
|
+
// Centred on the trigger, then pulled back inside the viewport — in that order,
|
|
306
|
+
// because a tip centred on a trigger near the edge is a tip half off the screen.
|
|
307
|
+
// `Math.max` last so a tip wider than the viewport starts at the leading edge
|
|
308
|
+
// rather than at a negative one.
|
|
309
|
+
tip.style.insetInlineStart = `${String(Math.max(0, Math.min(anchor.left + anchor.width / 2 - box.width / 2, document.documentElement.clientWidth - box.width)))}px`;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// Stryker disable next-line StringLiteral: the registration runs once, at import, inside
|
|
313
|
+
// the warm process Stryker switches mutants in — so by the time a mutant on this line is
|
|
314
|
+
// active the element is already defined under the original name, and no test can observe
|
|
315
|
+
// the change. Outside the runner's reach, not an equivalent mutant.
|
|
316
|
+
customElements.define('ui-tooltip', UiTooltip);
|
|
317
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,+DAA+D;AAC/D,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB,iFAAiF;AACjF,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;aACZ,WAAM,GAAG,GAA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