use-wc 1.0.0-pre.97 → 1.0.0-pre.98
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/custom-elements.json +112 -112
- package/dist/design-system.css +8 -3
- package/package.json +1 -1
- package/vscode.html-custom-data.json +18 -18
package/custom-elements.json
CHANGED
|
@@ -89,76 +89,6 @@
|
|
|
89
89
|
}
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
|
-
{
|
|
93
|
-
"kind": "javascript-module",
|
|
94
|
-
"path": "src/elements/use-avatar/use-avatar.ts",
|
|
95
|
-
"declarations": [
|
|
96
|
-
{
|
|
97
|
-
"kind": "class",
|
|
98
|
-
"description": "`use-avatar` renders a small, fixed-size, clipped container for a person or entity's\nlikeness. Slot in an `<img>` (or `<picture>`) for a photo, an inline `<svg>` for a\ngenerated or stylized mark, or arbitrary markup (a `<div>` of initials, a calendar badge);\nwhatever is slotted is centered and clipped to the avatar's shape. With nothing slotted,\n`use-avatar` falls back to initials derived from the `name` attribute.\n\n```html\n<use-avatar><img src=\"ada.jpg\" alt=\"\" /></use-avatar>\n<use-avatar name=\"Riley Quinn\"></use-avatar>\n<use-avatar><svg viewBox=\"0 0 32 32\">…</svg></use-avatar>\n```\n\nSize it with plain CSS — `inline-size` for the size and `aspect-ratio` for the proportions —\nfrom a stylesheet, a style attribute, or the design system's theme layer. The element takes no\ncustom properties of its own: it is a query container, so the initials scale from whatever box\nit ends up with. A non-square `aspect-ratio` suits a wide thumbnail or poster.\n\nThe element clips its content but gives it no shape of its own — that is the theme's, through\nthe affordance classes it defines: `.circle` (the themed default), `.square`, `.squircle` in\n`theme/avatar.css`. A circle only reads right at a `1` ratio, so a wide avatar wants one of the\nothers.\n\nThe element takes no ARIA role of its own. A slotted `<img>` carries its own `alt`, and the\ninitials fallback is plain text in the accessibility tree — an avatar is decorative beside a\nname far more often than it is the name itself, so labelling it here would mean announcing\nthat name twice.",
|
|
99
|
-
"name": "UseAvatar",
|
|
100
|
-
"cssParts": [
|
|
101
|
-
{
|
|
102
|
-
"description": "The span that renders the `name` fallback.",
|
|
103
|
-
"name": "initials"
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
"slots": [
|
|
107
|
-
{
|
|
108
|
-
"description": "The avatar's content: an `<img>`/`<picture>`, an `<svg>`, or arbitrary markup. Left empty, the `name` attribute's initials are shown instead, as the slot's own fallback. A photo fills the frame and crops; anything else keeps its own size, capped at the frame. Give an `<svg>` a `width`/`height` — without one it defaults to filling the box, and a rounded shape will clip its corners.",
|
|
109
|
-
"name": ""
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
"members": [
|
|
113
|
-
{
|
|
114
|
-
"kind": "field",
|
|
115
|
-
"name": "name",
|
|
116
|
-
"type": {
|
|
117
|
-
"text": "string"
|
|
118
|
-
},
|
|
119
|
-
"default": "\"\"",
|
|
120
|
-
"attribute": "name",
|
|
121
|
-
"reflects": true
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"attributes": [
|
|
125
|
-
{
|
|
126
|
-
"description": "The full name, used for the initials fallback (first + last whitespace-separated token, uppercased) when the slot is empty.",
|
|
127
|
-
"name": "name",
|
|
128
|
-
"type": {
|
|
129
|
-
"text": "string"
|
|
130
|
-
},
|
|
131
|
-
"default": "\"\"",
|
|
132
|
-
"fieldName": "name"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"superclass": {
|
|
136
|
-
"name": "LitElement",
|
|
137
|
-
"package": "lit"
|
|
138
|
-
},
|
|
139
|
-
"tagName": "use-avatar",
|
|
140
|
-
"customElement": true
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
"exports": [
|
|
144
|
-
{
|
|
145
|
-
"kind": "js",
|
|
146
|
-
"name": "UseAvatar",
|
|
147
|
-
"declaration": {
|
|
148
|
-
"name": "UseAvatar",
|
|
149
|
-
"module": "src/elements/use-avatar/use-avatar.ts"
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"kind": "custom-element-definition",
|
|
154
|
-
"name": "use-avatar",
|
|
155
|
-
"declaration": {
|
|
156
|
-
"name": "UseAvatar",
|
|
157
|
-
"module": "src/elements/use-avatar/use-avatar.ts"
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
92
|
{
|
|
163
93
|
"kind": "javascript-module",
|
|
164
94
|
"path": "src/elements/use-badge/use-badge.ts",
|
|
@@ -302,6 +232,76 @@
|
|
|
302
232
|
}
|
|
303
233
|
]
|
|
304
234
|
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "javascript-module",
|
|
237
|
+
"path": "src/elements/use-avatar/use-avatar.ts",
|
|
238
|
+
"declarations": [
|
|
239
|
+
{
|
|
240
|
+
"kind": "class",
|
|
241
|
+
"description": "`use-avatar` renders a small, fixed-size, clipped container for a person or entity's\nlikeness. Slot in an `<img>` (or `<picture>`) for a photo, an inline `<svg>` for a\ngenerated or stylized mark, or arbitrary markup (a `<div>` of initials, a calendar badge);\nwhatever is slotted is centered and clipped to the avatar's shape. With nothing slotted,\n`use-avatar` falls back to initials derived from the `name` attribute.\n\n```html\n<use-avatar><img src=\"ada.jpg\" alt=\"\" /></use-avatar>\n<use-avatar name=\"Riley Quinn\"></use-avatar>\n<use-avatar><svg viewBox=\"0 0 32 32\">…</svg></use-avatar>\n```\n\nSize it with plain CSS — `inline-size` for the size and `aspect-ratio` for the proportions —\nfrom a stylesheet, a style attribute, or the design system's theme layer. The element takes no\ncustom properties of its own: it is a query container, so the initials scale from whatever box\nit ends up with. A non-square `aspect-ratio` suits a wide thumbnail or poster.\n\nThe element clips its content but gives it no shape of its own — that is the theme's, through\nthe affordance classes it defines: `.circle` (the themed default), `.square`, `.squircle` in\n`theme/avatar.css`. A circle only reads right at a `1` ratio, so a wide avatar wants one of the\nothers.\n\nThe element takes no ARIA role of its own. A slotted `<img>` carries its own `alt`, and the\ninitials fallback is plain text in the accessibility tree — an avatar is decorative beside a\nname far more often than it is the name itself, so labelling it here would mean announcing\nthat name twice.",
|
|
242
|
+
"name": "UseAvatar",
|
|
243
|
+
"cssParts": [
|
|
244
|
+
{
|
|
245
|
+
"description": "The span that renders the `name` fallback.",
|
|
246
|
+
"name": "initials"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"slots": [
|
|
250
|
+
{
|
|
251
|
+
"description": "The avatar's content: an `<img>`/`<picture>`, an `<svg>`, or arbitrary markup. Left empty, the `name` attribute's initials are shown instead, as the slot's own fallback. A photo fills the frame and crops; anything else keeps its own size, capped at the frame. Give an `<svg>` a `width`/`height` — without one it defaults to filling the box, and a rounded shape will clip its corners.",
|
|
252
|
+
"name": ""
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"members": [
|
|
256
|
+
{
|
|
257
|
+
"kind": "field",
|
|
258
|
+
"name": "name",
|
|
259
|
+
"type": {
|
|
260
|
+
"text": "string"
|
|
261
|
+
},
|
|
262
|
+
"default": "\"\"",
|
|
263
|
+
"attribute": "name",
|
|
264
|
+
"reflects": true
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"attributes": [
|
|
268
|
+
{
|
|
269
|
+
"description": "The full name, used for the initials fallback (first + last whitespace-separated token, uppercased) when the slot is empty.",
|
|
270
|
+
"name": "name",
|
|
271
|
+
"type": {
|
|
272
|
+
"text": "string"
|
|
273
|
+
},
|
|
274
|
+
"default": "\"\"",
|
|
275
|
+
"fieldName": "name"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"superclass": {
|
|
279
|
+
"name": "LitElement",
|
|
280
|
+
"package": "lit"
|
|
281
|
+
},
|
|
282
|
+
"tagName": "use-avatar",
|
|
283
|
+
"customElement": true
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"exports": [
|
|
287
|
+
{
|
|
288
|
+
"kind": "js",
|
|
289
|
+
"name": "UseAvatar",
|
|
290
|
+
"declaration": {
|
|
291
|
+
"name": "UseAvatar",
|
|
292
|
+
"module": "src/elements/use-avatar/use-avatar.ts"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"kind": "custom-element-definition",
|
|
297
|
+
"name": "use-avatar",
|
|
298
|
+
"declaration": {
|
|
299
|
+
"name": "UseAvatar",
|
|
300
|
+
"module": "src/elements/use-avatar/use-avatar.ts"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
305
|
{
|
|
306
306
|
"kind": "javascript-module",
|
|
307
307
|
"path": "src/elements/use-calendar-base/use-calendar-base.ts",
|
|
@@ -4413,48 +4413,6 @@
|
|
|
4413
4413
|
}
|
|
4414
4414
|
]
|
|
4415
4415
|
},
|
|
4416
|
-
{
|
|
4417
|
-
"kind": "javascript-module",
|
|
4418
|
-
"path": "src/elements/use-pattern/use-pattern.ts",
|
|
4419
|
-
"declarations": [
|
|
4420
|
-
{
|
|
4421
|
-
"kind": "class",
|
|
4422
|
-
"description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```",
|
|
4423
|
-
"name": "UsePattern",
|
|
4424
|
-
"slots": [
|
|
4425
|
-
{
|
|
4426
|
-
"description": "The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
|
|
4427
|
-
"name": ""
|
|
4428
|
-
}
|
|
4429
|
-
],
|
|
4430
|
-
"members": [],
|
|
4431
|
-
"superclass": {
|
|
4432
|
-
"name": "LitElement",
|
|
4433
|
-
"package": "lit"
|
|
4434
|
-
},
|
|
4435
|
-
"tagName": "use-pattern",
|
|
4436
|
-
"customElement": true
|
|
4437
|
-
}
|
|
4438
|
-
],
|
|
4439
|
-
"exports": [
|
|
4440
|
-
{
|
|
4441
|
-
"kind": "js",
|
|
4442
|
-
"name": "UsePattern",
|
|
4443
|
-
"declaration": {
|
|
4444
|
-
"name": "UsePattern",
|
|
4445
|
-
"module": "src/elements/use-pattern/use-pattern.ts"
|
|
4446
|
-
}
|
|
4447
|
-
},
|
|
4448
|
-
{
|
|
4449
|
-
"kind": "custom-element-definition",
|
|
4450
|
-
"name": "use-pattern",
|
|
4451
|
-
"declaration": {
|
|
4452
|
-
"name": "UsePattern",
|
|
4453
|
-
"module": "src/elements/use-pattern/use-pattern.ts"
|
|
4454
|
-
}
|
|
4455
|
-
}
|
|
4456
|
-
]
|
|
4457
|
-
},
|
|
4458
4416
|
{
|
|
4459
4417
|
"kind": "javascript-module",
|
|
4460
4418
|
"path": "src/elements/use-option/use-option.ts",
|
|
@@ -4569,6 +4527,48 @@
|
|
|
4569
4527
|
}
|
|
4570
4528
|
]
|
|
4571
4529
|
},
|
|
4530
|
+
{
|
|
4531
|
+
"kind": "javascript-module",
|
|
4532
|
+
"path": "src/elements/use-pattern/use-pattern.ts",
|
|
4533
|
+
"declarations": [
|
|
4534
|
+
{
|
|
4535
|
+
"kind": "class",
|
|
4536
|
+
"description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```",
|
|
4537
|
+
"name": "UsePattern",
|
|
4538
|
+
"slots": [
|
|
4539
|
+
{
|
|
4540
|
+
"description": "The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
|
|
4541
|
+
"name": ""
|
|
4542
|
+
}
|
|
4543
|
+
],
|
|
4544
|
+
"members": [],
|
|
4545
|
+
"superclass": {
|
|
4546
|
+
"name": "LitElement",
|
|
4547
|
+
"package": "lit"
|
|
4548
|
+
},
|
|
4549
|
+
"tagName": "use-pattern",
|
|
4550
|
+
"customElement": true
|
|
4551
|
+
}
|
|
4552
|
+
],
|
|
4553
|
+
"exports": [
|
|
4554
|
+
{
|
|
4555
|
+
"kind": "js",
|
|
4556
|
+
"name": "UsePattern",
|
|
4557
|
+
"declaration": {
|
|
4558
|
+
"name": "UsePattern",
|
|
4559
|
+
"module": "src/elements/use-pattern/use-pattern.ts"
|
|
4560
|
+
}
|
|
4561
|
+
},
|
|
4562
|
+
{
|
|
4563
|
+
"kind": "custom-element-definition",
|
|
4564
|
+
"name": "use-pattern",
|
|
4565
|
+
"declaration": {
|
|
4566
|
+
"name": "UsePattern",
|
|
4567
|
+
"module": "src/elements/use-pattern/use-pattern.ts"
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
]
|
|
4571
|
+
},
|
|
4572
4572
|
{
|
|
4573
4573
|
"kind": "javascript-module",
|
|
4574
4574
|
"path": "src/elements/use-scrollarea/index.ts",
|
package/dist/design-system.css
CHANGED
|
@@ -783,8 +783,9 @@
|
|
|
783
783
|
inside one of them would.
|
|
784
784
|
|
|
785
785
|
The container only sets `display` and `isolation` — `isolation: isolate` scopes the hover
|
|
786
|
-
`z-index` below to just this set's own children, so a lifted border can't bleed into
|
|
787
|
-
elsewhere on the page.
|
|
786
|
+
and focus `z-index` below to just this set's own children, so a lifted border can't bleed into
|
|
787
|
+
stacking elsewhere on the page. Focus sits a level above hover, so hovering a neighbor never
|
|
788
|
+
covers the focused child's focus ring. Touching sides merge by default (`--usewc-layout-control-set-gap` is a
|
|
788
789
|
negative overlap equal to the button border, and `--usewc-effect-control-set-border-radius-sequential`
|
|
789
790
|
is `0`), both themeable — see `tokens/semantic.css` for the defaults. The button border is the
|
|
790
791
|
one hardcoded assumption left: it and the input border round to the same rendered pixel at
|
|
@@ -814,10 +815,14 @@
|
|
|
814
815
|
margin-inline-start: 0;
|
|
815
816
|
}
|
|
816
817
|
|
|
817
|
-
&:
|
|
818
|
+
&:hover {
|
|
818
819
|
z-index: 1;
|
|
819
820
|
}
|
|
820
821
|
|
|
822
|
+
&:where(:focus-visible, :focus-within) {
|
|
823
|
+
z-index: 2;
|
|
824
|
+
}
|
|
825
|
+
|
|
821
826
|
use-theme-escape & {
|
|
822
827
|
all: revert-layer;
|
|
823
828
|
}
|
package/package.json
CHANGED
|
@@ -19,18 +19,6 @@
|
|
|
19
19
|
],
|
|
20
20
|
"references": []
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
"name": "use-avatar",
|
|
24
|
-
"description": "`use-avatar` renders a small, fixed-size, clipped container for a person or entity's\nlikeness. Slot in an `<img>` (or `<picture>`) for a photo, an inline `<svg>` for a\ngenerated or stylized mark, or arbitrary markup (a `<div>` of initials, a calendar badge);\nwhatever is slotted is centered and clipped to the avatar's shape. With nothing slotted,\n`use-avatar` falls back to initials derived from the `name` attribute.\n\n```html\n<use-avatar><img src=\"ada.jpg\" alt=\"\" /></use-avatar>\n<use-avatar name=\"Riley Quinn\"></use-avatar>\n<use-avatar><svg viewBox=\"0 0 32 32\">…</svg></use-avatar>\n```\n\nSize it with plain CSS — `inline-size` for the size and `aspect-ratio` for the proportions —\nfrom a stylesheet, a style attribute, or the design system's theme layer. The element takes no\ncustom properties of its own: it is a query container, so the initials scale from whatever box\nit ends up with. A non-square `aspect-ratio` suits a wide thumbnail or poster.\n\nThe element clips its content but gives it no shape of its own — that is the theme's, through\nthe affordance classes it defines: `.circle` (the themed default), `.square`, `.squircle` in\n`theme/avatar.css`. A circle only reads right at a `1` ratio, so a wide avatar wants one of the\nothers.\n\nThe element takes no ARIA role of its own. A slotted `<img>` carries its own `alt`, and the\ninitials fallback is plain text in the accessibility tree — an avatar is decorative beside a\nname far more often than it is the name itself, so labelling it here would mean announcing\nthat name twice.\n---\n\n\n### **Slots:**\n - _default_ - The avatar's content: an `<img>`/`<picture>`, an `<svg>`, or arbitrary markup. Left empty, the `name` attribute's initials are shown instead, as the slot's own fallback. A photo fills the frame and crops; anything else keeps its own size, capped at the frame. Give an `<svg>` a `width`/`height` — without one it defaults to filling the box, and a rounded shape will clip its corners.\n\n### **CSS Parts:**\n - **initials** - The span that renders the `name` fallback.",
|
|
25
|
-
"attributes": [
|
|
26
|
-
{
|
|
27
|
-
"name": "name",
|
|
28
|
-
"description": "The full name, used for the initials fallback (first + last whitespace-separated token, uppercased) when the slot is empty.",
|
|
29
|
-
"values": []
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"references": []
|
|
33
|
-
},
|
|
34
22
|
{
|
|
35
23
|
"name": "use-badge",
|
|
36
24
|
"description": "`use-badge` renders a small indicator anchored to another element's corner, using\n[CSS anchor positioning](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning)\ninstead of the classic `position: absolute` + negative-offset trick. This lets the badge live\nanywhere in the DOM rather than being a child of the element it decorates. A badge's shape,\ncolor, and positioning ship built in — reading from the design system's tokens when\n`tokens.css` is loaded, and falling back to sensible defaults otherwise — so no theme is\nrequired to get a working, visible badge.\n\nPoint a badge at its target with the `anchortarget` attribute, set to the target's `id`\n(named to avoid colliding with the `anchor` content attribute HTML is gaining natively):\n\n```html\n<button type=\"button\" id=\"inbox\">Inbox</button>\n<use-badge anchortarget=\"inbox\">99+</use-badge>\n```\n\nThe badge and its anchor must live in the same DOM tree — a badge cannot reach an anchor\ninside another component's shadow root, and an anchor's `anchor-name` set inside a shadow\ntree's stylesheet is not visible here. No positioned ancestor or shared containing block is\nrequired: anchor positioning resolves the badge's location straight from the anchor's own\ngeometry, so the badge can sit anywhere else in the DOM tree.\n\nWithout a resolved anchor — `anchortarget` unset, pointing at a missing id, or `anchorElement`\nnever assigned — the badge has no `:state(anchored)` and renders as a plain inline chip in\nnormal document flow, still using the same color/shape styling.\n\nSome components render their host as `display: contents`, which has no box of its own for CSS\nanchor positioning to resolve against. If the anchor computes a non-empty `--usewc-anchor-name`\ncustom property, the badge uses that dashed-ident as its `position-anchor` directly instead of\ngenerating and writing its own onto the anchor — letting a component publish the name of a\nreal, box-generating part of itself (already established for its own purposes) for badges to\ntarget instead of its host, even though that part lives inside the component's own shadow root.\nThis mechanism is shared with `use-menu`/`use-anchored` via `AnchorController`; components\nwithout a `display: contents` host don't need to publish anything.\n\n**Known Firefox limitation:** anchoring across a shadow root boundary this way — the case\n`--usewc-anchor-name` exists for — is mispositioned in Firefox as of this writing. Verified\ndirectly: `anchor()`'s logical `start`/`end` keywords resolve backwards on both axes\nspecifically for a cross-shadow-root anchor reference, in Firefox only — the same anchor()\ncalls resolve correctly for a same-tree anchor in Firefox, and cross-shadow anchoring resolves\ncorrectly in Chromium and Safari. A badge anchored to a plain element (button, input, anything\nthat isn't itself relying on this escape hatch) is unaffected in every engine, including\nFirefox.\n\n## Side effects\n\nThe badge is a sibling of its anchor rather than a child, so **as a side effect, a badge\nmutates its anchor element**: it appends its own id to the anchor's `aria-describedby`\n(preserving any ids already there, the same way `anchor-name` is appended rather than\nreplaced) to keep its content connected to the anchor for assistive technology. This means a\nbadge's content, or its `aria-label` when set, is announced as part of interacting with the\nanchor, e.g. \"Inbox button, 3\". A `dot` badge has no content of its own, so set `aria-label`\ndirectly on `<use-badge>` for a meaningful description (e.g. `aria-label=\"3 unread messages\"`);\nwithout one, the description contributes nothing and the anchor announces as before.\n\nAvoid adding `aria-hidden` to `<use-badge>` if you rely on this: while the description\ncomputation is specified to still read a hidden node when it's the direct target of\n`aria-describedby`, support for that specific case is inconsistent across browsers and screen\nreaders.\n\nSet `options=\"noaria\"` to opt a badge out of this and leave the anchor's `aria-describedby`\nuntouched, e.g. when the anchor already documents the badge's meaning some other way.\n---\n\n\n### **Slots:**\n - _default_ - Badge content, e.g. a count or short label. Ignored when `dot` is set.",
|
|
@@ -63,6 +51,18 @@
|
|
|
63
51
|
],
|
|
64
52
|
"references": []
|
|
65
53
|
},
|
|
54
|
+
{
|
|
55
|
+
"name": "use-avatar",
|
|
56
|
+
"description": "`use-avatar` renders a small, fixed-size, clipped container for a person or entity's\nlikeness. Slot in an `<img>` (or `<picture>`) for a photo, an inline `<svg>` for a\ngenerated or stylized mark, or arbitrary markup (a `<div>` of initials, a calendar badge);\nwhatever is slotted is centered and clipped to the avatar's shape. With nothing slotted,\n`use-avatar` falls back to initials derived from the `name` attribute.\n\n```html\n<use-avatar><img src=\"ada.jpg\" alt=\"\" /></use-avatar>\n<use-avatar name=\"Riley Quinn\"></use-avatar>\n<use-avatar><svg viewBox=\"0 0 32 32\">…</svg></use-avatar>\n```\n\nSize it with plain CSS — `inline-size` for the size and `aspect-ratio` for the proportions —\nfrom a stylesheet, a style attribute, or the design system's theme layer. The element takes no\ncustom properties of its own: it is a query container, so the initials scale from whatever box\nit ends up with. A non-square `aspect-ratio` suits a wide thumbnail or poster.\n\nThe element clips its content but gives it no shape of its own — that is the theme's, through\nthe affordance classes it defines: `.circle` (the themed default), `.square`, `.squircle` in\n`theme/avatar.css`. A circle only reads right at a `1` ratio, so a wide avatar wants one of the\nothers.\n\nThe element takes no ARIA role of its own. A slotted `<img>` carries its own `alt`, and the\ninitials fallback is plain text in the accessibility tree — an avatar is decorative beside a\nname far more often than it is the name itself, so labelling it here would mean announcing\nthat name twice.\n---\n\n\n### **Slots:**\n - _default_ - The avatar's content: an `<img>`/`<picture>`, an `<svg>`, or arbitrary markup. Left empty, the `name` attribute's initials are shown instead, as the slot's own fallback. A photo fills the frame and crops; anything else keeps its own size, capped at the frame. Give an `<svg>` a `width`/`height` — without one it defaults to filling the box, and a rounded shape will clip its corners.\n\n### **CSS Parts:**\n - **initials** - The span that renders the `name` fallback.",
|
|
57
|
+
"attributes": [
|
|
58
|
+
{
|
|
59
|
+
"name": "name",
|
|
60
|
+
"description": "The full name, used for the initials fallback (first + last whitespace-separated token, uppercased) when the slot is empty.",
|
|
61
|
+
"values": []
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"references": []
|
|
65
|
+
},
|
|
66
66
|
{
|
|
67
67
|
"name": "use-calendarday",
|
|
68
68
|
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.\n---\n\n\n### **Slots:**\n - **default** - slot for custom day content (replaces the day number)",
|
|
@@ -467,12 +467,6 @@
|
|
|
467
467
|
],
|
|
468
468
|
"references": []
|
|
469
469
|
},
|
|
470
|
-
{
|
|
471
|
-
"name": "use-pattern",
|
|
472
|
-
"description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```\n---\n\n\n### **Slots:**\n - _default_ - The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
|
|
473
|
-
"attributes": [],
|
|
474
|
-
"references": []
|
|
475
|
-
},
|
|
476
470
|
{
|
|
477
471
|
"name": "use-option",
|
|
478
472
|
"description": "`use-option` is a custom element that represents an option in a `use-listbox-input` custom\nelement.\n\nThe children of this element are the content of the option and must not contain any\ninteractive elements.\n\nSelection is shown by one of two indicators, swapped based on the option's `selected` state:\na checkmark when selected, nothing (a reserved-space placeholder) when not.\n\nSwapping an indicator **per instance** is a slot: put your own element in the `selected-indicator`\nor `deselected-indicator` slot and it replaces `part(selected-indicator-default)` /\n`part(deselected-indicator-default)` entirely for that option.\n\nSwapping an indicator **for every option in the app** doesn't need touching this component's\n`render()` at all — style `::part(selected-indicator-default)` /\n`::part(deselected-indicator-default)` from an outside stylesheet, the same way any shadow DOM\npart is themed:\n\n```css\nuse-option::part(selected-indicator-default) {\n mask-image: url(\"/icons/my-checkmark.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a pair of tokens —\n`--usewc-effect-selected-indicator-mask-image` for the shape and\n`--usewc-effect-selected-indicator-color` for what paints it (`--usewc-effect-deselected-…`\nfor the other state) — so redefining those custom properties has the same effect without\nwriting a `::part()` rule at all.)\n\n`::part()` only reaches CSS-expressible changes (a mask, a background, a transform). For\nanything else — different markup, an icon font, logic beyond a mask — set the static\n`selectedIcon` and `deselectedIcon` hooks. Every `<use-option>` in the page picks them up;\nconsumers keep writing the same tag, no new element to register or remember to use instead.\nSet them once, as early as possible (an app's entry point, before any options connect) — Lit\ncalls `render()` fresh on every update, so an already-connected instance only reflects the\nchange once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every option:\nUseOption.selectedIcon = \"✓\";\nUseOption.deselectedIcon = \"\";\n\n// A function is called on every render instead:\nUseOption.selectedIcon = (html) => html`<my-icon name=\"check\"></my-icon>`;\n```\n\nThe function form is called with the component's own `html` tag as its (optional) first\nargument rather than requiring the caller to import one — a page can end up with more than one\ncopy of `lit-html` in its module graph, and a `TemplateResult` built from a *different* copy\nthan the one this component renders with can silently fail to render. Taking `html` in as a\nparameter sidesteps that: whatever's returned is guaranteed to come from the same `lit-html`\nthis component already uses. A bare string skips the concern entirely.\n\nA set icon still renders under `part(selected-indicator-default)` /\n`part(deselected-indicator-default)` — the same part the design system's theme masks into the\nbuilt-in glyph. Combining a static hook with `theme.css` means the theme's masking still\napplies to the custom content; reset the relevant `mask-image` token or `::part()` rule if that\nfights with what was set.\n\nOnly need to change the icon on **some** options, not every one in the app? Extend the class,\noverride `render()` normally, and register the subclass under a different tag name so it\ncoexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyOption extends UseOption {\n override render() {\n return html`<slot></slot><slot name=\"selected-indicator\"><my-icon name=\"check\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-option\", MyOption);\n```\n---\n\n\n### **Slots:**\n - **selected-indicator** - Replaces the default checkmark shown when the option is selected.\n- **deselected-indicator** - Replaces the default (empty) indicator shown when the option is not selected.\n- **default** - Option content.",
|
|
@@ -483,6 +477,12 @@
|
|
|
483
477
|
],
|
|
484
478
|
"references": []
|
|
485
479
|
},
|
|
480
|
+
{
|
|
481
|
+
"name": "use-pattern",
|
|
482
|
+
"description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```\n---\n\n\n### **Slots:**\n - _default_ - The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
|
|
483
|
+
"attributes": [],
|
|
484
|
+
"references": []
|
|
485
|
+
},
|
|
486
486
|
{
|
|
487
487
|
"name": "use-scrollarea",
|
|
488
488
|
"description": "A scroll container that exposes custom states for scroll edge detection.\n\n## Custom States\nThe following CSS custom states are available for styling:\n\n- `:state(at-block-start)` — scrolled to the block-start edge (top in horizontal writing modes)\n- `:state(at-block-end)` — scrolled to the block-end edge (bottom in horizontal writing modes)\n- `:state(at-inline-start)` — scrolled to the inline-start edge (left in LTR)\n- `:state(at-inline-end)` — scrolled to the inline-end edge (right in LTR)\n---\n\n\n### **Slots:**\n - _default_ - Scrollable content",
|