use-wc 1.0.0-pre.69 → 1.0.0-pre.70
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 +127 -127
- package/dist/design-system.css +66 -39
- package/dist/tokens.css +0 -1
- package/dist/use-wc.d.mts +119 -1
- package/dist/use-wc.mjs +645 -6
- 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",
|
|
@@ -3667,63 +3667,6 @@
|
|
|
3667
3667
|
}
|
|
3668
3668
|
]
|
|
3669
3669
|
},
|
|
3670
|
-
{
|
|
3671
|
-
"kind": "javascript-module",
|
|
3672
|
-
"path": "src/elements/use-scrollarea/index.ts",
|
|
3673
|
-
"declarations": [],
|
|
3674
|
-
"exports": [
|
|
3675
|
-
{
|
|
3676
|
-
"kind": "js",
|
|
3677
|
-
"name": "UseScrollarea",
|
|
3678
|
-
"declaration": {
|
|
3679
|
-
"name": "UseScrollarea",
|
|
3680
|
-
"module": "./use-scrollarea"
|
|
3681
|
-
}
|
|
3682
|
-
}
|
|
3683
|
-
]
|
|
3684
|
-
},
|
|
3685
|
-
{
|
|
3686
|
-
"kind": "javascript-module",
|
|
3687
|
-
"path": "src/elements/use-scrollarea/use-scrollarea.ts",
|
|
3688
|
-
"declarations": [
|
|
3689
|
-
{
|
|
3690
|
-
"kind": "class",
|
|
3691
|
-
"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)",
|
|
3692
|
-
"name": "UseScrollarea",
|
|
3693
|
-
"slots": [
|
|
3694
|
-
{
|
|
3695
|
-
"description": "Scrollable content",
|
|
3696
|
-
"name": ""
|
|
3697
|
-
}
|
|
3698
|
-
],
|
|
3699
|
-
"members": [],
|
|
3700
|
-
"superclass": {
|
|
3701
|
-
"name": "LitElement",
|
|
3702
|
-
"package": "lit"
|
|
3703
|
-
},
|
|
3704
|
-
"tagName": "use-scrollarea",
|
|
3705
|
-
"customElement": true
|
|
3706
|
-
}
|
|
3707
|
-
],
|
|
3708
|
-
"exports": [
|
|
3709
|
-
{
|
|
3710
|
-
"kind": "js",
|
|
3711
|
-
"name": "UseScrollarea",
|
|
3712
|
-
"declaration": {
|
|
3713
|
-
"name": "UseScrollarea",
|
|
3714
|
-
"module": "src/elements/use-scrollarea/use-scrollarea.ts"
|
|
3715
|
-
}
|
|
3716
|
-
},
|
|
3717
|
-
{
|
|
3718
|
-
"kind": "custom-element-definition",
|
|
3719
|
-
"name": "use-scrollarea",
|
|
3720
|
-
"declaration": {
|
|
3721
|
-
"name": "UseScrollarea",
|
|
3722
|
-
"module": "src/elements/use-scrollarea/use-scrollarea.ts"
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
|
-
]
|
|
3726
|
-
},
|
|
3727
3670
|
{
|
|
3728
3671
|
"kind": "javascript-module",
|
|
3729
3672
|
"path": "src/elements/use-option/use-option.ts",
|
|
@@ -3838,6 +3781,63 @@
|
|
|
3838
3781
|
}
|
|
3839
3782
|
]
|
|
3840
3783
|
},
|
|
3784
|
+
{
|
|
3785
|
+
"kind": "javascript-module",
|
|
3786
|
+
"path": "src/elements/use-scrollarea/index.ts",
|
|
3787
|
+
"declarations": [],
|
|
3788
|
+
"exports": [
|
|
3789
|
+
{
|
|
3790
|
+
"kind": "js",
|
|
3791
|
+
"name": "UseScrollarea",
|
|
3792
|
+
"declaration": {
|
|
3793
|
+
"name": "UseScrollarea",
|
|
3794
|
+
"module": "./use-scrollarea"
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
]
|
|
3798
|
+
},
|
|
3799
|
+
{
|
|
3800
|
+
"kind": "javascript-module",
|
|
3801
|
+
"path": "src/elements/use-scrollarea/use-scrollarea.ts",
|
|
3802
|
+
"declarations": [
|
|
3803
|
+
{
|
|
3804
|
+
"kind": "class",
|
|
3805
|
+
"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)",
|
|
3806
|
+
"name": "UseScrollarea",
|
|
3807
|
+
"slots": [
|
|
3808
|
+
{
|
|
3809
|
+
"description": "Scrollable content",
|
|
3810
|
+
"name": ""
|
|
3811
|
+
}
|
|
3812
|
+
],
|
|
3813
|
+
"members": [],
|
|
3814
|
+
"superclass": {
|
|
3815
|
+
"name": "LitElement",
|
|
3816
|
+
"package": "lit"
|
|
3817
|
+
},
|
|
3818
|
+
"tagName": "use-scrollarea",
|
|
3819
|
+
"customElement": true
|
|
3820
|
+
}
|
|
3821
|
+
],
|
|
3822
|
+
"exports": [
|
|
3823
|
+
{
|
|
3824
|
+
"kind": "js",
|
|
3825
|
+
"name": "UseScrollarea",
|
|
3826
|
+
"declaration": {
|
|
3827
|
+
"name": "UseScrollarea",
|
|
3828
|
+
"module": "src/elements/use-scrollarea/use-scrollarea.ts"
|
|
3829
|
+
}
|
|
3830
|
+
},
|
|
3831
|
+
{
|
|
3832
|
+
"kind": "custom-element-definition",
|
|
3833
|
+
"name": "use-scrollarea",
|
|
3834
|
+
"declaration": {
|
|
3835
|
+
"name": "UseScrollarea",
|
|
3836
|
+
"module": "src/elements/use-scrollarea/use-scrollarea.ts"
|
|
3837
|
+
}
|
|
3838
|
+
}
|
|
3839
|
+
]
|
|
3840
|
+
},
|
|
3841
3841
|
{
|
|
3842
3842
|
"kind": "javascript-module",
|
|
3843
3843
|
"path": "src/elements/use-time-input/use-time-input.ts",
|
package/dist/design-system.css
CHANGED
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
all: revert-layer;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
&:hover:not(:disabled, [aria-disabled="true"], [aria-readonly="true"], :checked) {
|
|
235
|
+
&:hover:not(:disabled, [aria-disabled="true"], [aria-readonly="true"], :checked, :indeterminate) {
|
|
236
236
|
--usewc-color-selector-border: var(--usewc-color-selector-border-hover);
|
|
237
237
|
--usewc-color-selector-background: var(--usewc-color-selector-background-hover);
|
|
238
238
|
}
|
|
@@ -1995,11 +1995,11 @@
|
|
|
1995
1995
|
Five variant classes name what the container *is*, and its semantic `<figure>` / `<header>` /
|
|
1996
1996
|
`<main>` / `<footer>` regions are arranged to match:
|
|
1997
1997
|
|
|
1998
|
-
use-layout.page an app frame —
|
|
1998
|
+
use-layout.page an app frame — a topbar and footer over the body, roomy
|
|
1999
1999
|
use-layout.entry a row in a list — a leading avatar rail with the regions beside it
|
|
2000
2000
|
use-layout.message a chat or comment — `.entry`'s layout at chat density
|
|
2001
|
-
use-layout.card a panel — avatar + hgroup + actions, end-aligned
|
|
2002
|
-
|
|
2001
|
+
use-layout.card a panel — avatar + hgroup + actions, end-aligned footer,
|
|
2002
|
+
compact, plus the chrome at end of file
|
|
2003
2003
|
use-layout.media a media object — a rail cell beside an anonymous body cell holding
|
|
2004
2004
|
the stacked regions (à la Bootstrap 3's .media)
|
|
2005
2005
|
|
|
@@ -2008,13 +2008,22 @@
|
|
|
2008
2008
|
order is canonical — figure, header, main, footer — and a variant may re-position regions
|
|
2009
2009
|
visually but never asks an author to reorder markup.
|
|
2010
2010
|
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2011
|
+
A variant's own density sets *only* two axes on itself — `--usewc-layout-region-padding` (the
|
|
2012
|
+
inline inset) and `--usewc-layout-region-gap` (everything block: internal spacing within a
|
|
2013
|
+
region, and the padding a region gets on its own block edges) — plus `-avatar-size`,
|
|
2014
|
+
`--usewc-layout-footer-justify` and `-row-gap`. Reusing `-gap` as the block padding isn't a
|
|
2015
|
+
shortcut: it's the same "how far apart do things stack" value either way, so a region's own
|
|
2016
|
+
padding and the room it leaves around its neighbours always agree. One generic set of region
|
|
2017
|
+
rules reads these; the arrangement itself (flex vs. grid vs. table, where the avatar sits,
|
|
2018
|
+
which edge a footer aligns to) stays with each variant or, where a property can't say it, a
|
|
2019
|
+
structural override. A `use-layout.page` is a `use-layout`, so the base pin/grow rules above
|
|
2020
|
+
already cover it too.
|
|
2021
|
+
|
|
2022
|
+
`.page` and `.card` also take `.divided`, which rules a header/footer off from the body — opt-in,
|
|
2023
|
+
not a variant default. Undivided, the container's stacking gap does the separating, on top of
|
|
2024
|
+
each region's own padding. `.divided` turns that gap off and draws a border on whichever region
|
|
2025
|
+
isn't first instead, so the padding alone (never the gap) is what holds the line clear of its
|
|
2026
|
+
neighbour — the two mechanisms are never both in play at once.
|
|
2018
2027
|
|
|
2019
2028
|
Every selector stays compound (`use-layout.page`, never a bare `.page`) so none of these
|
|
2020
2029
|
common words can collide with an author's own class of the same name.
|
|
@@ -2212,11 +2221,9 @@
|
|
|
2212
2221
|
order by source position, later winning. */
|
|
2213
2222
|
use-layout.page {
|
|
2214
2223
|
--usewc-layout-region-padding: var(--usewc-layout-page-padding);
|
|
2215
|
-
--usewc-layout-region-padding-block: var(--usewc-layout-page-padding-block);
|
|
2216
2224
|
--usewc-layout-region-gap: var(--usewc-layout-page-gap);
|
|
2225
|
+
--usewc-layout-region-row-gap: var(--usewc-layout-page-gap);
|
|
2217
2226
|
--usewc-layout-region-avatar-size: var(--usewc-layout-page-avatar-size);
|
|
2218
|
-
--usewc-layout-header-rule: var(--usewc-layout-region-rule);
|
|
2219
|
-
--usewc-layout-footer-rule: var(--usewc-layout-region-rule);
|
|
2220
2227
|
--usewc-layout-footer-justify: space-between;
|
|
2221
2228
|
|
|
2222
2229
|
use-theme-escape & {
|
|
@@ -2252,8 +2259,8 @@
|
|
|
2252
2259
|
use-layout.card {
|
|
2253
2260
|
--usewc-layout-region-padding: var(--usewc-layout-card-padding);
|
|
2254
2261
|
--usewc-layout-region-gap: var(--usewc-layout-card-gap);
|
|
2262
|
+
--usewc-layout-region-row-gap: var(--usewc-layout-card-gap);
|
|
2255
2263
|
--usewc-layout-region-avatar-size: var(--usewc-layout-card-avatar-size);
|
|
2256
|
-
--usewc-layout-footer-rule: var(--usewc-layout-region-rule);
|
|
2257
2264
|
--usewc-layout-footer-justify: flex-end;
|
|
2258
2265
|
|
|
2259
2266
|
use-theme-escape & {
|
|
@@ -2276,10 +2283,39 @@
|
|
|
2276
2283
|
}
|
|
2277
2284
|
}
|
|
2278
2285
|
|
|
2279
|
-
/*
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2286
|
+
/* `.divided` rules a region off from the one before it by position, not by tag — the border and
|
|
2287
|
+
the padding that keeps it clear of its neighbour both land on "whichever child isn't first",
|
|
2288
|
+
so a `<figure>`, an author's own `<section>`, or any other stand-in divides exactly like
|
|
2289
|
+
`header`/`main`/`footer` do, with nothing to name per tag. It only makes sense for `.page` and
|
|
2290
|
+
`.card`, the two plain-column variants where "the next region" is unambiguous; `.entry`,
|
|
2291
|
+
`.message` and `.media` arrange their regions structurally instead, so a rule between them
|
|
2292
|
+
isn't a single boundary to draw. Turning the stacking gap off is what makes this exclusive
|
|
2293
|
+
with the undivided case — the border and the padding are the only spacing here, never the
|
|
2294
|
+
gap too. */
|
|
2295
|
+
use-layout:is(.page, .card).divided {
|
|
2296
|
+
--usewc-layout-region-row-gap: 0;
|
|
2297
|
+
|
|
2298
|
+
use-theme-escape & {
|
|
2299
|
+
all: revert-layer;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
& > * {
|
|
2303
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2304
|
+
|
|
2305
|
+
use-theme-escape & {
|
|
2306
|
+
all: revert-layer;
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
& > :not(:first-child) {
|
|
2311
|
+
border-block-start: var(--usewc-layout-region-rule);
|
|
2312
|
+
|
|
2313
|
+
use-theme-escape & {
|
|
2314
|
+
all: revert-layer;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2283
2319
|
/* ── Generic regions ────────────────────────────────────────────────────────────────────────
|
|
2284
2320
|
One ruleset for every variant, reading the properties above. Nested under the shared variant
|
|
2285
2321
|
list rather than repeating it on every selector, so it stays in one place as variants are
|
|
@@ -2287,6 +2323,7 @@
|
|
|
2287
2323
|
hairline by naming one rather than by having a rule of its own. */
|
|
2288
2324
|
:where(use-layout:is(.page, .entry, .message, .card, .media)) {
|
|
2289
2325
|
min-block-size: 0;
|
|
2326
|
+
gap: var(--usewc-layout-region-row-gap);
|
|
2290
2327
|
|
|
2291
2328
|
use-theme-escape & {
|
|
2292
2329
|
all: revert-layer;
|
|
@@ -2294,7 +2331,8 @@
|
|
|
2294
2331
|
|
|
2295
2332
|
& > use-layout[fill] {
|
|
2296
2333
|
overflow: auto;
|
|
2297
|
-
padding: var(--usewc-layout-region-padding);
|
|
2334
|
+
padding-inline: var(--usewc-layout-region-padding);
|
|
2335
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2298
2336
|
|
|
2299
2337
|
use-theme-escape & {
|
|
2300
2338
|
all: revert-layer;
|
|
@@ -2302,7 +2340,8 @@
|
|
|
2302
2340
|
}
|
|
2303
2341
|
|
|
2304
2342
|
& > main {
|
|
2305
|
-
padding: var(--usewc-layout-region-padding);
|
|
2343
|
+
padding-inline: var(--usewc-layout-region-padding);
|
|
2344
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2306
2345
|
|
|
2307
2346
|
use-theme-escape & {
|
|
2308
2347
|
all: revert-layer;
|
|
@@ -2329,18 +2368,6 @@
|
|
|
2329
2368
|
}
|
|
2330
2369
|
}
|
|
2331
2370
|
|
|
2332
|
-
/* A header already supplies the block-start padding, so the body region drops its own and
|
|
2333
|
-
the two read as one padded column rather than a double gap under the header. A scrolling
|
|
2334
|
-
`use-layout[fill]` keeps its padding, though — with `overflow: auto` a zeroed start edge
|
|
2335
|
-
clips the focus ring of whatever sits at the top of the scroll. */
|
|
2336
|
-
& > header + main {
|
|
2337
|
-
padding-block-start: 0;
|
|
2338
|
-
|
|
2339
|
-
use-theme-escape & {
|
|
2340
|
-
all: revert-layer;
|
|
2341
|
-
}
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
2371
|
& > figure {
|
|
2345
2372
|
margin: 0;
|
|
2346
2373
|
|
|
@@ -2365,9 +2392,8 @@
|
|
|
2365
2392
|
align-items: center;
|
|
2366
2393
|
justify-content: flex-start;
|
|
2367
2394
|
gap: var(--usewc-layout-region-gap);
|
|
2368
|
-
padding-block: var(--usewc-layout-region-padding-block, var(--usewc-layout-region-padding));
|
|
2369
2395
|
padding-inline: var(--usewc-layout-region-padding);
|
|
2370
|
-
|
|
2396
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2371
2397
|
|
|
2372
2398
|
use-theme-escape & {
|
|
2373
2399
|
all: revert-layer;
|
|
@@ -2379,9 +2405,8 @@
|
|
|
2379
2405
|
align-items: center;
|
|
2380
2406
|
justify-content: var(--usewc-layout-footer-justify, flex-end);
|
|
2381
2407
|
gap: var(--usewc-layout-region-gap);
|
|
2382
|
-
padding-block: var(--usewc-layout-region-padding-block, var(--usewc-layout-region-padding));
|
|
2383
2408
|
padding-inline: var(--usewc-layout-region-padding);
|
|
2384
|
-
|
|
2409
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2385
2410
|
|
|
2386
2411
|
use-theme-escape & {
|
|
2387
2412
|
all: revert-layer;
|
|
@@ -2535,7 +2560,8 @@
|
|
|
2535
2560
|
grid-template-columns: var(--usewc-layout-region-avatar-size) 1fr;
|
|
2536
2561
|
column-gap: var(--usewc-layout-region-gap);
|
|
2537
2562
|
row-gap: var(--usewc-layout-region-row-gap);
|
|
2538
|
-
padding: var(--usewc-layout-region-padding);
|
|
2563
|
+
padding-inline: var(--usewc-layout-region-padding);
|
|
2564
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2539
2565
|
|
|
2540
2566
|
use-theme-escape & {
|
|
2541
2567
|
all: revert-layer;
|
|
@@ -2668,7 +2694,8 @@
|
|
|
2668
2694
|
display: table;
|
|
2669
2695
|
inline-size: 100%;
|
|
2670
2696
|
border-spacing: 0;
|
|
2671
|
-
padding: var(--usewc-layout-region-padding);
|
|
2697
|
+
padding-inline: var(--usewc-layout-region-padding);
|
|
2698
|
+
padding-block: var(--usewc-layout-region-gap);
|
|
2672
2699
|
|
|
2673
2700
|
use-theme-escape & {
|
|
2674
2701
|
all: revert-layer;
|
package/dist/tokens.css
CHANGED
|
@@ -732,7 +732,6 @@
|
|
|
732
732
|
);
|
|
733
733
|
|
|
734
734
|
--usewc-layout-page-padding: var(--usewc-space-20);
|
|
735
|
-
--usewc-layout-page-padding-block: var(--usewc-space-12);
|
|
736
735
|
--usewc-layout-page-gap: var(--usewc-space-12);
|
|
737
736
|
--usewc-layout-page-avatar-size: var(--usewc-layout-region-title-block-size);
|
|
738
737
|
|
package/dist/use-wc.d.mts
CHANGED
|
@@ -1604,4 +1604,122 @@ declare global {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
1606
|
//#endregion
|
|
1607
|
-
|
|
1607
|
+
//#region src/elements/use-grid/constants.d.ts
|
|
1608
|
+
declare const SELECTION_CELL_ATTRIBUTE = "data-usewc-selection-cell";
|
|
1609
|
+
//#endregion
|
|
1610
|
+
//#region src/elements/use-grid/use-grid.d.ts
|
|
1611
|
+
/** Accepted `selectwith` values — `"none"` alone, or `"row"` and/or `"control"` (canonical order). */
|
|
1612
|
+
type SelectWith = "none" | "row" | "control" | "row control";
|
|
1613
|
+
/**
|
|
1614
|
+
* Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).
|
|
1615
|
+
*
|
|
1616
|
+
* ## Grid Cell Modes
|
|
1617
|
+
* The `mode` attribute of the `use-gridcell` element determines how the cell behaves in terms of focus and interaction. The possible values are:
|
|
1618
|
+
*
|
|
1619
|
+
* - `'none'` - the cell itself is focusable and it does not contain any interactive elements.
|
|
1620
|
+
* - `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.
|
|
1621
|
+
* - `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly.
|
|
1622
|
+
*
|
|
1623
|
+
* ## Accessible Label
|
|
1624
|
+
* Provide `aria-label` or `aria-labelledby` on the `use-grid` element so screen readers can identify the grid.
|
|
1625
|
+
*
|
|
1626
|
+
* @slot - Grid content (use-gridhead/use-gridbody rows)
|
|
1627
|
+
*/
|
|
1628
|
+
declare class UseGrid extends LitElement {
|
|
1629
|
+
#private;
|
|
1630
|
+
static formAssociated: boolean;
|
|
1631
|
+
get internals(): ElementInternals;
|
|
1632
|
+
selectmode: "multiple" | "single" | "none";
|
|
1633
|
+
selectwith: SelectWith;
|
|
1634
|
+
name: string;
|
|
1635
|
+
role: string;
|
|
1636
|
+
disabled: boolean;
|
|
1637
|
+
readonly: boolean;
|
|
1638
|
+
constructor();
|
|
1639
|
+
/** `true` when `selectmode="multiple"`. Read by `use-gridcell` selection cells. */
|
|
1640
|
+
get isMultiSelect(): boolean;
|
|
1641
|
+
/**
|
|
1642
|
+
* `true` when a checkbox/radio selection column should exist (`selectmode` on and `selectwith`
|
|
1643
|
+
* includes `control`). Read by `use-gridrow.reconcileSelectorCell`.
|
|
1644
|
+
*/
|
|
1645
|
+
get injectsSelectionColumn(): boolean;
|
|
1646
|
+
/**
|
|
1647
|
+
* The shared `name` for injected radio controls — the grid's `name` when set, otherwise a stable
|
|
1648
|
+
* generated id. Lazily created so single-select grids without a `name` still group correctly.
|
|
1649
|
+
*/
|
|
1650
|
+
get selectionGroupName(): string;
|
|
1651
|
+
isRowDisabled(row: Element | null | undefined): boolean;
|
|
1652
|
+
set value(value: string[] | string);
|
|
1653
|
+
get value(): string[] | string | null;
|
|
1654
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
1655
|
+
connectedCallback(): void;
|
|
1656
|
+
disconnectedCallback(): void;
|
|
1657
|
+
firstUpdated(): void;
|
|
1658
|
+
render(): TemplateResult$1<1>;
|
|
1659
|
+
static styles: import("lit").CSSResult;
|
|
1660
|
+
}
|
|
1661
|
+
declare global {
|
|
1662
|
+
interface HTMLElementTagNameMap {
|
|
1663
|
+
"use-grid": UseGrid;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
//#endregion
|
|
1667
|
+
//#region src/elements/use-grid/use-gridhead.d.ts
|
|
1668
|
+
declare class UseGridHead extends HTMLElement {
|
|
1669
|
+
connectedCallback(): void;
|
|
1670
|
+
}
|
|
1671
|
+
declare global {
|
|
1672
|
+
interface HTMLElementTagNameMap {
|
|
1673
|
+
"use-gridhead": UseGridHead;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
//#endregion
|
|
1677
|
+
//#region src/elements/use-grid/use-gridbody.d.ts
|
|
1678
|
+
declare class UseGridBody extends HTMLElement {
|
|
1679
|
+
connectedCallback(): void;
|
|
1680
|
+
}
|
|
1681
|
+
declare global {
|
|
1682
|
+
interface HTMLElementTagNameMap {
|
|
1683
|
+
"use-gridbody": UseGridBody;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
//#endregion
|
|
1687
|
+
//#region src/elements/use-grid/use-gridrow.d.ts
|
|
1688
|
+
declare class UseGridRow extends LitElement {
|
|
1689
|
+
#private;
|
|
1690
|
+
selected: boolean;
|
|
1691
|
+
disabled: boolean;
|
|
1692
|
+
readonly: boolean;
|
|
1693
|
+
value: string;
|
|
1694
|
+
firstUpdated(): void;
|
|
1695
|
+
updated(): void;
|
|
1696
|
+
reconcileSelectorCell(): void;
|
|
1697
|
+
render(): TemplateResult$1<1>;
|
|
1698
|
+
static styles: import("lit").CSSResult;
|
|
1699
|
+
}
|
|
1700
|
+
declare global {
|
|
1701
|
+
interface HTMLElementTagNameMap {
|
|
1702
|
+
"use-gridrow": UseGridRow;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
//#endregion
|
|
1706
|
+
//#region src/elements/use-grid/use-gridcell.d.ts
|
|
1707
|
+
declare class UseGridCell extends UseWidget {
|
|
1708
|
+
#private;
|
|
1709
|
+
/**
|
|
1710
|
+
* Determines how the cell behaves in terms of focus and interaction. The possible values are:
|
|
1711
|
+
*
|
|
1712
|
+
* - `'none'` - the cell itself is focusable and it does not contain any interactive elements.
|
|
1713
|
+
* - `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.
|
|
1714
|
+
* - `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly.
|
|
1715
|
+
*/
|
|
1716
|
+
mode: "widget" | "action" | "default";
|
|
1717
|
+
connectedCallback(): void;
|
|
1718
|
+
}
|
|
1719
|
+
declare global {
|
|
1720
|
+
interface HTMLElementTagNameMap {
|
|
1721
|
+
"use-gridcell": UseGridCell;
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
//#endregion
|
|
1725
|
+
export { SELECTION_CELL_ATTRIBUTE, UseAnchored, UseAvatar, UseBadge, UseCalendarBase, UseCalendarRenderDay, UseCaret, UseDateInput, UseDatePicker, UseDatetimeInput, UseDurationInput, UseFocusgroup, UseGrid, UseGridBody, UseGridCell, UseGridHead, UseGridRow, UseIntlDatetime, UseIntlNumber, UseListboxInput, UseMenu, UseMonthPicker, UseMonthPickerRenderMonth, UseOption, UseScrollarea, UseTimeInput, UseTree, UseTreeitem, UseWeekPicker, UseWidget };
|