use-wc 1.0.0-pre.59 → 1.0.0-pre.60
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 +271 -271
- package/dist/design-system.css +468 -4
- package/dist/tokens.css +67 -1
- package/package.json +1 -1
- package/vscode.html-custom-data.json +11 -11
package/custom-elements.json
CHANGED
|
@@ -89,6 +89,149 @@
|
|
|
89
89
|
}
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
|
+
{
|
|
93
|
+
"kind": "javascript-module",
|
|
94
|
+
"path": "src/elements/use-badge/use-badge.ts",
|
|
95
|
+
"declarations": [
|
|
96
|
+
{
|
|
97
|
+
"kind": "class",
|
|
98
|
+
"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.",
|
|
99
|
+
"name": "UseBadge",
|
|
100
|
+
"slots": [
|
|
101
|
+
{
|
|
102
|
+
"description": "Badge content, e.g. a count or short label. Ignored when `dot` is set.",
|
|
103
|
+
"name": ""
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"members": [
|
|
107
|
+
{
|
|
108
|
+
"kind": "field",
|
|
109
|
+
"name": "anchortarget",
|
|
110
|
+
"type": {
|
|
111
|
+
"text": "string | undefined"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "anchortarget",
|
|
114
|
+
"reflects": true
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"kind": "field",
|
|
118
|
+
"name": "dot",
|
|
119
|
+
"type": {
|
|
120
|
+
"text": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"default": "false",
|
|
123
|
+
"attribute": "dot",
|
|
124
|
+
"reflects": true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"kind": "field",
|
|
128
|
+
"name": "blockalign",
|
|
129
|
+
"type": {
|
|
130
|
+
"text": "\"start\" | \"end\""
|
|
131
|
+
},
|
|
132
|
+
"default": "\"start\"",
|
|
133
|
+
"attribute": "blockalign",
|
|
134
|
+
"reflects": true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"kind": "field",
|
|
138
|
+
"name": "inlinealign",
|
|
139
|
+
"type": {
|
|
140
|
+
"text": "\"start\" | \"end\""
|
|
141
|
+
},
|
|
142
|
+
"default": "\"end\"",
|
|
143
|
+
"attribute": "inlinealign",
|
|
144
|
+
"reflects": true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"kind": "field",
|
|
148
|
+
"name": "options",
|
|
149
|
+
"type": {
|
|
150
|
+
"text": "string"
|
|
151
|
+
},
|
|
152
|
+
"default": "\"\"",
|
|
153
|
+
"attribute": "options",
|
|
154
|
+
"reflects": true
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"kind": "field",
|
|
158
|
+
"name": "anchorElement",
|
|
159
|
+
"description": "The element this badge is anchored to. Reading returns whatever element was last resolved,\neither from the `anchortarget` id or set here directly. Setting it anchors to that element\ninstead of resolving `anchortarget`, for cases where the target has no id to reference."
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"attributes": [
|
|
163
|
+
{
|
|
164
|
+
"description": "Id of the element to anchor to, resolved in the badge's own tree.",
|
|
165
|
+
"name": "anchortarget",
|
|
166
|
+
"type": {
|
|
167
|
+
"text": "string | undefined"
|
|
168
|
+
},
|
|
169
|
+
"fieldName": "anchortarget"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"description": "Renders as a fixed-size dot instead of the slotted content.",
|
|
173
|
+
"name": "dot",
|
|
174
|
+
"type": {
|
|
175
|
+
"text": "boolean"
|
|
176
|
+
},
|
|
177
|
+
"default": "false",
|
|
178
|
+
"fieldName": "dot"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"description": "`\"start\" | \"end\"`: Aligns the badge along the block axis relative to its anchor.",
|
|
182
|
+
"name": "blockalign",
|
|
183
|
+
"type": {
|
|
184
|
+
"text": "\"start\" | \"end\""
|
|
185
|
+
},
|
|
186
|
+
"default": "\"start\"",
|
|
187
|
+
"fieldName": "blockalign"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"description": "`\"start\" | \"end\"`: Aligns the badge along the inline axis relative to its anchor.",
|
|
191
|
+
"name": "inlinealign",
|
|
192
|
+
"type": {
|
|
193
|
+
"text": "\"start\" | \"end\""
|
|
194
|
+
},
|
|
195
|
+
"default": "\"end\"",
|
|
196
|
+
"fieldName": "inlinealign"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"description": "Space-separated feature flags. `noaria` opts out of the automatic `aria-describedby` wiring described above.",
|
|
200
|
+
"name": "options",
|
|
201
|
+
"type": {
|
|
202
|
+
"text": "string"
|
|
203
|
+
},
|
|
204
|
+
"default": "\"\"",
|
|
205
|
+
"fieldName": "options"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"superclass": {
|
|
209
|
+
"name": "LitElement",
|
|
210
|
+
"package": "lit"
|
|
211
|
+
},
|
|
212
|
+
"tagName": "use-badge",
|
|
213
|
+
"customElement": true
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"exports": [
|
|
217
|
+
{
|
|
218
|
+
"kind": "js",
|
|
219
|
+
"name": "UseBadge",
|
|
220
|
+
"declaration": {
|
|
221
|
+
"name": "UseBadge",
|
|
222
|
+
"module": "src/elements/use-badge/use-badge.ts"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"kind": "custom-element-definition",
|
|
227
|
+
"name": "use-badge",
|
|
228
|
+
"declaration": {
|
|
229
|
+
"name": "UseBadge",
|
|
230
|
+
"module": "src/elements/use-badge/use-badge.ts"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
92
235
|
{
|
|
93
236
|
"kind": "javascript-module",
|
|
94
237
|
"path": "src/elements/use-calendar-base/use-calendar-base.ts",
|
|
@@ -488,151 +631,8 @@
|
|
|
488
631
|
"kind": "js",
|
|
489
632
|
"name": "UseCalendarBase",
|
|
490
633
|
"declaration": {
|
|
491
|
-
"name": "UseCalendarBase",
|
|
492
|
-
"module": "src/elements/use-calendar-base/use-calendar-base.ts"
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
]
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
"kind": "javascript-module",
|
|
499
|
-
"path": "src/elements/use-badge/use-badge.ts",
|
|
500
|
-
"declarations": [
|
|
501
|
-
{
|
|
502
|
-
"kind": "class",
|
|
503
|
-
"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.",
|
|
504
|
-
"name": "UseBadge",
|
|
505
|
-
"slots": [
|
|
506
|
-
{
|
|
507
|
-
"description": "Badge content, e.g. a count or short label. Ignored when `dot` is set.",
|
|
508
|
-
"name": ""
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
"members": [
|
|
512
|
-
{
|
|
513
|
-
"kind": "field",
|
|
514
|
-
"name": "anchortarget",
|
|
515
|
-
"type": {
|
|
516
|
-
"text": "string | undefined"
|
|
517
|
-
},
|
|
518
|
-
"attribute": "anchortarget",
|
|
519
|
-
"reflects": true
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
"kind": "field",
|
|
523
|
-
"name": "dot",
|
|
524
|
-
"type": {
|
|
525
|
-
"text": "boolean"
|
|
526
|
-
},
|
|
527
|
-
"default": "false",
|
|
528
|
-
"attribute": "dot",
|
|
529
|
-
"reflects": true
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
"kind": "field",
|
|
533
|
-
"name": "blockalign",
|
|
534
|
-
"type": {
|
|
535
|
-
"text": "\"start\" | \"end\""
|
|
536
|
-
},
|
|
537
|
-
"default": "\"start\"",
|
|
538
|
-
"attribute": "blockalign",
|
|
539
|
-
"reflects": true
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
"kind": "field",
|
|
543
|
-
"name": "inlinealign",
|
|
544
|
-
"type": {
|
|
545
|
-
"text": "\"start\" | \"end\""
|
|
546
|
-
},
|
|
547
|
-
"default": "\"end\"",
|
|
548
|
-
"attribute": "inlinealign",
|
|
549
|
-
"reflects": true
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
"kind": "field",
|
|
553
|
-
"name": "options",
|
|
554
|
-
"type": {
|
|
555
|
-
"text": "string"
|
|
556
|
-
},
|
|
557
|
-
"default": "\"\"",
|
|
558
|
-
"attribute": "options",
|
|
559
|
-
"reflects": true
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
"kind": "field",
|
|
563
|
-
"name": "anchorElement",
|
|
564
|
-
"description": "The element this badge is anchored to. Reading returns whatever element was last resolved,\neither from the `anchortarget` id or set here directly. Setting it anchors to that element\ninstead of resolving `anchortarget`, for cases where the target has no id to reference."
|
|
565
|
-
}
|
|
566
|
-
],
|
|
567
|
-
"attributes": [
|
|
568
|
-
{
|
|
569
|
-
"description": "Id of the element to anchor to, resolved in the badge's own tree.",
|
|
570
|
-
"name": "anchortarget",
|
|
571
|
-
"type": {
|
|
572
|
-
"text": "string | undefined"
|
|
573
|
-
},
|
|
574
|
-
"fieldName": "anchortarget"
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
"description": "Renders as a fixed-size dot instead of the slotted content.",
|
|
578
|
-
"name": "dot",
|
|
579
|
-
"type": {
|
|
580
|
-
"text": "boolean"
|
|
581
|
-
},
|
|
582
|
-
"default": "false",
|
|
583
|
-
"fieldName": "dot"
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
"description": "`\"start\" | \"end\"`: Aligns the badge along the block axis relative to its anchor.",
|
|
587
|
-
"name": "blockalign",
|
|
588
|
-
"type": {
|
|
589
|
-
"text": "\"start\" | \"end\""
|
|
590
|
-
},
|
|
591
|
-
"default": "\"start\"",
|
|
592
|
-
"fieldName": "blockalign"
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
"description": "`\"start\" | \"end\"`: Aligns the badge along the inline axis relative to its anchor.",
|
|
596
|
-
"name": "inlinealign",
|
|
597
|
-
"type": {
|
|
598
|
-
"text": "\"start\" | \"end\""
|
|
599
|
-
},
|
|
600
|
-
"default": "\"end\"",
|
|
601
|
-
"fieldName": "inlinealign"
|
|
602
|
-
},
|
|
603
|
-
{
|
|
604
|
-
"description": "Space-separated feature flags. `noaria` opts out of the automatic `aria-describedby` wiring described above.",
|
|
605
|
-
"name": "options",
|
|
606
|
-
"type": {
|
|
607
|
-
"text": "string"
|
|
608
|
-
},
|
|
609
|
-
"default": "\"\"",
|
|
610
|
-
"fieldName": "options"
|
|
611
|
-
}
|
|
612
|
-
],
|
|
613
|
-
"superclass": {
|
|
614
|
-
"name": "LitElement",
|
|
615
|
-
"package": "lit"
|
|
616
|
-
},
|
|
617
|
-
"tagName": "use-badge",
|
|
618
|
-
"customElement": true
|
|
619
|
-
}
|
|
620
|
-
],
|
|
621
|
-
"exports": [
|
|
622
|
-
{
|
|
623
|
-
"kind": "js",
|
|
624
|
-
"name": "UseBadge",
|
|
625
|
-
"declaration": {
|
|
626
|
-
"name": "UseBadge",
|
|
627
|
-
"module": "src/elements/use-badge/use-badge.ts"
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
"kind": "custom-element-definition",
|
|
632
|
-
"name": "use-badge",
|
|
633
|
-
"declaration": {
|
|
634
|
-
"name": "UseBadge",
|
|
635
|
-
"module": "src/elements/use-badge/use-badge.ts"
|
|
634
|
+
"name": "UseCalendarBase",
|
|
635
|
+
"module": "src/elements/use-calendar-base/use-calendar-base.ts"
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
]
|
|
@@ -767,132 +767,6 @@
|
|
|
767
767
|
}
|
|
768
768
|
]
|
|
769
769
|
},
|
|
770
|
-
{
|
|
771
|
-
"kind": "javascript-module",
|
|
772
|
-
"path": "src/elements/use-date-input/use-date-input.ts",
|
|
773
|
-
"declarations": [
|
|
774
|
-
{
|
|
775
|
-
"kind": "class",
|
|
776
|
-
"description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.",
|
|
777
|
-
"name": "UseDateInput",
|
|
778
|
-
"members": [
|
|
779
|
-
{
|
|
780
|
-
"kind": "field",
|
|
781
|
-
"name": "yearInput",
|
|
782
|
-
"type": {
|
|
783
|
-
"text": "HTMLInputElement"
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
"kind": "field",
|
|
788
|
-
"name": "monthInput",
|
|
789
|
-
"type": {
|
|
790
|
-
"text": "HTMLInputElement"
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
"kind": "field",
|
|
795
|
-
"name": "dayInput",
|
|
796
|
-
"type": {
|
|
797
|
-
"text": "HTMLInputElement"
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
"kind": "field",
|
|
802
|
-
"name": "id"
|
|
803
|
-
},
|
|
804
|
-
{
|
|
805
|
-
"kind": "field",
|
|
806
|
-
"name": "disabled",
|
|
807
|
-
"default": "false",
|
|
808
|
-
"type": {
|
|
809
|
-
"text": "boolean"
|
|
810
|
-
},
|
|
811
|
-
"attribute": "disabled"
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
"kind": "field",
|
|
815
|
-
"name": "readOnly",
|
|
816
|
-
"default": "false",
|
|
817
|
-
"type": {
|
|
818
|
-
"text": "boolean"
|
|
819
|
-
},
|
|
820
|
-
"attribute": "readonly"
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
"kind": "field",
|
|
824
|
-
"name": "value",
|
|
825
|
-
"type": {
|
|
826
|
-
"text": "string"
|
|
827
|
-
},
|
|
828
|
-
"default": "YYYY-MM-DD",
|
|
829
|
-
"attribute": "value"
|
|
830
|
-
}
|
|
831
|
-
],
|
|
832
|
-
"attributes": [
|
|
833
|
-
{
|
|
834
|
-
"name": "disabled",
|
|
835
|
-
"default": "false",
|
|
836
|
-
"type": {
|
|
837
|
-
"text": "boolean"
|
|
838
|
-
},
|
|
839
|
-
"fieldName": "disabled"
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
"name": "readonly",
|
|
843
|
-
"default": "false",
|
|
844
|
-
"type": {
|
|
845
|
-
"text": "boolean"
|
|
846
|
-
},
|
|
847
|
-
"fieldName": "readOnly"
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
"name": "value",
|
|
851
|
-
"type": {
|
|
852
|
-
"text": "string"
|
|
853
|
-
},
|
|
854
|
-
"default": "YYYY-MM-DD",
|
|
855
|
-
"fieldName": "value"
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
"name": "lang",
|
|
859
|
-
"type": {
|
|
860
|
-
"text": "string"
|
|
861
|
-
},
|
|
862
|
-
"fieldName": "lang",
|
|
863
|
-
"inheritedFrom": {
|
|
864
|
-
"name": "UseLocaleElement",
|
|
865
|
-
"module": "src/elements/use-locale-element/use-locale-element.ts"
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
],
|
|
869
|
-
"superclass": {
|
|
870
|
-
"name": "UseLocaleElement",
|
|
871
|
-
"module": "/src/elements/use-locale-element/use-locale-element"
|
|
872
|
-
},
|
|
873
|
-
"tagName": "use-date-input",
|
|
874
|
-
"customElement": true
|
|
875
|
-
}
|
|
876
|
-
],
|
|
877
|
-
"exports": [
|
|
878
|
-
{
|
|
879
|
-
"kind": "js",
|
|
880
|
-
"name": "UseDateInput",
|
|
881
|
-
"declaration": {
|
|
882
|
-
"name": "UseDateInput",
|
|
883
|
-
"module": "src/elements/use-date-input/use-date-input.ts"
|
|
884
|
-
}
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
"kind": "custom-element-definition",
|
|
888
|
-
"name": "use-date-input",
|
|
889
|
-
"declaration": {
|
|
890
|
-
"name": "UseDateInput",
|
|
891
|
-
"module": "src/elements/use-date-input/use-date-input.ts"
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
]
|
|
895
|
-
},
|
|
896
770
|
{
|
|
897
771
|
"kind": "javascript-module",
|
|
898
772
|
"path": "src/elements/use-date-picker/use-date-picker.ts",
|
|
@@ -1556,6 +1430,132 @@
|
|
|
1556
1430
|
}
|
|
1557
1431
|
]
|
|
1558
1432
|
},
|
|
1433
|
+
{
|
|
1434
|
+
"kind": "javascript-module",
|
|
1435
|
+
"path": "src/elements/use-date-input/use-date-input.ts",
|
|
1436
|
+
"declarations": [
|
|
1437
|
+
{
|
|
1438
|
+
"kind": "class",
|
|
1439
|
+
"description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.",
|
|
1440
|
+
"name": "UseDateInput",
|
|
1441
|
+
"members": [
|
|
1442
|
+
{
|
|
1443
|
+
"kind": "field",
|
|
1444
|
+
"name": "yearInput",
|
|
1445
|
+
"type": {
|
|
1446
|
+
"text": "HTMLInputElement"
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"kind": "field",
|
|
1451
|
+
"name": "monthInput",
|
|
1452
|
+
"type": {
|
|
1453
|
+
"text": "HTMLInputElement"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"kind": "field",
|
|
1458
|
+
"name": "dayInput",
|
|
1459
|
+
"type": {
|
|
1460
|
+
"text": "HTMLInputElement"
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
"kind": "field",
|
|
1465
|
+
"name": "id"
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
"kind": "field",
|
|
1469
|
+
"name": "disabled",
|
|
1470
|
+
"default": "false",
|
|
1471
|
+
"type": {
|
|
1472
|
+
"text": "boolean"
|
|
1473
|
+
},
|
|
1474
|
+
"attribute": "disabled"
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"kind": "field",
|
|
1478
|
+
"name": "readOnly",
|
|
1479
|
+
"default": "false",
|
|
1480
|
+
"type": {
|
|
1481
|
+
"text": "boolean"
|
|
1482
|
+
},
|
|
1483
|
+
"attribute": "readonly"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
"kind": "field",
|
|
1487
|
+
"name": "value",
|
|
1488
|
+
"type": {
|
|
1489
|
+
"text": "string"
|
|
1490
|
+
},
|
|
1491
|
+
"default": "YYYY-MM-DD",
|
|
1492
|
+
"attribute": "value"
|
|
1493
|
+
}
|
|
1494
|
+
],
|
|
1495
|
+
"attributes": [
|
|
1496
|
+
{
|
|
1497
|
+
"name": "disabled",
|
|
1498
|
+
"default": "false",
|
|
1499
|
+
"type": {
|
|
1500
|
+
"text": "boolean"
|
|
1501
|
+
},
|
|
1502
|
+
"fieldName": "disabled"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"name": "readonly",
|
|
1506
|
+
"default": "false",
|
|
1507
|
+
"type": {
|
|
1508
|
+
"text": "boolean"
|
|
1509
|
+
},
|
|
1510
|
+
"fieldName": "readOnly"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
"name": "value",
|
|
1514
|
+
"type": {
|
|
1515
|
+
"text": "string"
|
|
1516
|
+
},
|
|
1517
|
+
"default": "YYYY-MM-DD",
|
|
1518
|
+
"fieldName": "value"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
"name": "lang",
|
|
1522
|
+
"type": {
|
|
1523
|
+
"text": "string"
|
|
1524
|
+
},
|
|
1525
|
+
"fieldName": "lang",
|
|
1526
|
+
"inheritedFrom": {
|
|
1527
|
+
"name": "UseLocaleElement",
|
|
1528
|
+
"module": "src/elements/use-locale-element/use-locale-element.ts"
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
],
|
|
1532
|
+
"superclass": {
|
|
1533
|
+
"name": "UseLocaleElement",
|
|
1534
|
+
"module": "/src/elements/use-locale-element/use-locale-element"
|
|
1535
|
+
},
|
|
1536
|
+
"tagName": "use-date-input",
|
|
1537
|
+
"customElement": true
|
|
1538
|
+
}
|
|
1539
|
+
],
|
|
1540
|
+
"exports": [
|
|
1541
|
+
{
|
|
1542
|
+
"kind": "js",
|
|
1543
|
+
"name": "UseDateInput",
|
|
1544
|
+
"declaration": {
|
|
1545
|
+
"name": "UseDateInput",
|
|
1546
|
+
"module": "src/elements/use-date-input/use-date-input.ts"
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
"kind": "custom-element-definition",
|
|
1551
|
+
"name": "use-date-input",
|
|
1552
|
+
"declaration": {
|
|
1553
|
+
"name": "UseDateInput",
|
|
1554
|
+
"module": "src/elements/use-date-input/use-date-input.ts"
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
]
|
|
1558
|
+
},
|
|
1559
1559
|
{
|
|
1560
1560
|
"kind": "javascript-module",
|
|
1561
1561
|
"path": "src/elements/use-datetime-input/use-datetime-input.ts",
|
package/dist/design-system.css
CHANGED
|
@@ -232,12 +232,13 @@
|
|
|
232
232
|
all: revert-layer;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
&:hover:not(:disabled
|
|
235
|
+
&:hover:not(:disabled, [aria-disabled="true"], [aria-readonly="true"], :checked) {
|
|
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
|
}
|
|
239
239
|
|
|
240
|
-
&:checked
|
|
240
|
+
&:checked,
|
|
241
|
+
&:indeterminate {
|
|
241
242
|
--usewc-color-selector-border: var(--usewc-color-selector-border-checked);
|
|
242
243
|
--usewc-color-selector-background: var(--usewc-color-selector-background-checked);
|
|
243
244
|
}
|
|
@@ -252,6 +253,12 @@
|
|
|
252
253
|
--usewc-effect-pointer-events: none;
|
|
253
254
|
}
|
|
254
255
|
|
|
256
|
+
/* Readonly reads at full strength but can't be toggled by pointer (keyboard is caught by the
|
|
257
|
+
host). Kept focusable so its state is still announced. */
|
|
258
|
+
&[aria-readonly="true"] {
|
|
259
|
+
--usewc-effect-pointer-events: none;
|
|
260
|
+
}
|
|
261
|
+
|
|
255
262
|
&::after {
|
|
256
263
|
content: "";
|
|
257
264
|
position: absolute;
|
|
@@ -278,6 +285,18 @@
|
|
|
278
285
|
}
|
|
279
286
|
}
|
|
280
287
|
|
|
288
|
+
&[type="checkbox"]:indeterminate::after {
|
|
289
|
+
display: block;
|
|
290
|
+
position: absolute;
|
|
291
|
+
inset-block-start: 50%;
|
|
292
|
+
inset-inline-start: 20%;
|
|
293
|
+
width: 60%;
|
|
294
|
+
height: 0;
|
|
295
|
+
transform: translateY(-50%);
|
|
296
|
+
border-block-start: var(--usewc-layout-selector-checkbox-icon-border-size) solid
|
|
297
|
+
var(--usewc-color-selector-icon-fill);
|
|
298
|
+
}
|
|
299
|
+
|
|
281
300
|
&[type="radio"] {
|
|
282
301
|
border-radius: 50%;
|
|
283
302
|
|
|
@@ -1241,8 +1260,13 @@
|
|
|
1241
1260
|
}
|
|
1242
1261
|
}
|
|
1243
1262
|
|
|
1244
|
-
/* Grid —
|
|
1245
|
-
|
|
1263
|
+
/* Grid — `.table` is the default treatment a bare `use-grid` gets (bordered surface, a muted
|
|
1264
|
+
header, rounded per-row hover/selected bands, roomy cells); `.chips` and `.list` opt out of it
|
|
1265
|
+
into their own layouts. `use-gridhead`/`use-gridbody`/`use-gridcell` all render into light DOM,
|
|
1266
|
+
so this layer styles them directly; `use-gridrow` has a shadow root but its host is styleable.
|
|
1267
|
+
|
|
1268
|
+
A cell holding a use-intl-number reads as tabular data, so it defaults to end-aligned text
|
|
1269
|
+
with tabular-nums, which locks every digit to the same width so values stack and compare
|
|
1246
1270
|
cleanly down a column. text-align and font-variant-numeric are both inherited, so setting them
|
|
1247
1271
|
on use-gridcell reaches the formatted text inside use-intl-number's shadow root without needing
|
|
1248
1272
|
a rule scoped to use-intl-number itself. */
|
|
@@ -1255,6 +1279,446 @@
|
|
|
1255
1279
|
all: revert-layer;
|
|
1256
1280
|
}
|
|
1257
1281
|
}
|
|
1282
|
+
|
|
1283
|
+
use-grid:not(.chips, .list, .appearance-native) {
|
|
1284
|
+
display: block;
|
|
1285
|
+
overflow: clip;
|
|
1286
|
+
border: var(--usewc-layout-grid-border) solid var(--usewc-color-grid-border);
|
|
1287
|
+
border-radius: var(--usewc-effect-grid-border-radius);
|
|
1288
|
+
background: var(--usewc-color-grid-background);
|
|
1289
|
+
color: var(--usewc-color-document-text);
|
|
1290
|
+
|
|
1291
|
+
use-theme-escape & {
|
|
1292
|
+
all: revert-layer;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/* `.compact` just re-points the cell/gap tokens every rule below already reads — the box
|
|
1296
|
+
model is unchanged, the rows are simply shorter. */
|
|
1297
|
+
&.compact {
|
|
1298
|
+
--usewc-layout-grid-cell-line-height: var(--usewc-layout-grid-compact-cell-line-height);
|
|
1299
|
+
--usewc-layout-grid-cell-padding-block: var(--usewc-layout-grid-compact-cell-padding-block);
|
|
1300
|
+
--usewc-layout-grid-cell-padding-inline: var(--usewc-layout-grid-compact-cell-padding-inline);
|
|
1301
|
+
--usewc-layout-grid-row-gap: var(--usewc-layout-grid-compact-row-gap);
|
|
1302
|
+
|
|
1303
|
+
use-theme-escape & {
|
|
1304
|
+
all: revert-layer;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/* The body insets its rows from the grid edge (`--grid-body-inset`) and spaces them with a real
|
|
1309
|
+
`gap`; the row edge is where the hover/selected band aligns, so no extra ::before layer. */
|
|
1310
|
+
use-gridbody {
|
|
1311
|
+
display: flex;
|
|
1312
|
+
flex-direction: column;
|
|
1313
|
+
gap: var(--usewc-layout-grid-row-gap);
|
|
1314
|
+
padding-block: var(--usewc-layout-grid-body-padding-block);
|
|
1315
|
+
padding-inline: var(--usewc-layout-grid-body-inset);
|
|
1316
|
+
|
|
1317
|
+
use-theme-escape & {
|
|
1318
|
+
all: revert-layer;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/* Inline padding is the breathing room between the row edge (band edge) and the text. Header
|
|
1323
|
+
rows take the same inline padding, plus the head's own `--grid-body-inset`, so a header cell
|
|
1324
|
+
lines up with the body cell below it. No block padding — cell padding sets the row height. */
|
|
1325
|
+
use-gridrow {
|
|
1326
|
+
padding-inline: var(--usewc-layout-grid-row-padding-inline);
|
|
1327
|
+
|
|
1328
|
+
use-theme-escape & {
|
|
1329
|
+
all: revert-layer;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/* The hover/selected band is painted straight onto the body row now (no ::before layer). This
|
|
1334
|
+
rule owns every `background` / `border-radius` declaration; the hover/selected/consecutive
|
|
1335
|
+
rules below only re-point the `--usewc-grid-row-*` variables it reads, so inside
|
|
1336
|
+
`use-theme-escape` the `all: revert-layer` here drops the paint and those variable writes
|
|
1337
|
+
have nothing to feed. Corner variables default to the full radius; the consecutive-selected
|
|
1338
|
+
rules square off just the shared edge. */
|
|
1339
|
+
use-gridbody use-gridrow {
|
|
1340
|
+
border-start-start-radius: var(--usewc-grid-row-corner-start-start, var(--usewc-effect-grid-row-border-radius));
|
|
1341
|
+
border-start-end-radius: var(--usewc-grid-row-corner-start-end, var(--usewc-effect-grid-row-border-radius));
|
|
1342
|
+
border-end-start-radius: var(--usewc-grid-row-corner-end-start, var(--usewc-effect-grid-row-border-radius));
|
|
1343
|
+
border-end-end-radius: var(--usewc-grid-row-corner-end-end, var(--usewc-effect-grid-row-border-radius));
|
|
1344
|
+
background: var(--usewc-color-grid-row-background, transparent);
|
|
1345
|
+
|
|
1346
|
+
use-theme-escape & {
|
|
1347
|
+
all: revert-layer;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
use-gridhead {
|
|
1352
|
+
display: block;
|
|
1353
|
+
background: var(--usewc-color-grid-header-background);
|
|
1354
|
+
border-block-end: var(--usewc-layout-grid-border) solid var(--usewc-color-grid-border);
|
|
1355
|
+
color: var(--usewc-color-grid-header-text);
|
|
1356
|
+
font-weight: var(--usewc-font-grid-header-weight);
|
|
1357
|
+
/* Same block padding as the body — clears the grid's `overflow: clip` edge so a focused
|
|
1358
|
+
header cell's outline isn't sheared off at the top. */
|
|
1359
|
+
padding-block: var(--usewc-layout-grid-body-padding-block);
|
|
1360
|
+
padding-inline: var(--usewc-layout-grid-body-inset);
|
|
1361
|
+
|
|
1362
|
+
use-theme-escape & {
|
|
1363
|
+
all: revert-layer;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/* A short vertical rule between column headers — a centred ::before rather than a
|
|
1368
|
+
border-inline-start so it can sit shorter than the cell rather than spanning it. */
|
|
1369
|
+
use-gridhead use-gridcell[role="columnheader"] {
|
|
1370
|
+
position: relative;
|
|
1371
|
+
|
|
1372
|
+
use-theme-escape & {
|
|
1373
|
+
all: revert-layer;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
& + use-gridcell[role="columnheader"]::before {
|
|
1377
|
+
content: "";
|
|
1378
|
+
position: absolute;
|
|
1379
|
+
inset-inline-start: 0;
|
|
1380
|
+
inset-block-start: 50%;
|
|
1381
|
+
transform: translateY(-50%);
|
|
1382
|
+
block-size: var(--usewc-layout-grid-header-divider-height);
|
|
1383
|
+
inline-size: var(--usewc-layout-grid-border);
|
|
1384
|
+
background: var(--usewc-color-grid-border);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
use-theme-escape & + use-gridcell[role="columnheader"]::before {
|
|
1388
|
+
all: revert-layer;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/* ...but not right after a selection header cell — a select column reads as separate from the
|
|
1393
|
+
data columns without a rule between it and the first one. `use-grid` injects the leading
|
|
1394
|
+
cell with `data-usewc-selection-cell` (a real select-all checkbox, or an inert hidden radio
|
|
1395
|
+
spacer in single-select mode); a dev driving selection by hand uses a bare checkbox/radio. */
|
|
1396
|
+
use-gridhead
|
|
1397
|
+
use-gridcell:is([data-usewc-selection-cell], :has(> input:is([type="checkbox"], [type="radio"])))
|
|
1398
|
+
+ use-gridcell[role="columnheader"]::before {
|
|
1399
|
+
content: none;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
use-theme-escape
|
|
1403
|
+
use-gridhead
|
|
1404
|
+
use-gridcell:is([data-usewc-selection-cell], :has(> input:is([type="checkbox"], [type="radio"])))
|
|
1405
|
+
+ use-gridcell[role="columnheader"]::before {
|
|
1406
|
+
all: revert-layer;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
use-gridcell {
|
|
1410
|
+
line-height: var(--usewc-layout-grid-cell-line-height);
|
|
1411
|
+
padding: var(--usewc-layout-grid-cell-padding-block) var(--usewc-layout-grid-cell-padding-inline);
|
|
1412
|
+
|
|
1413
|
+
use-theme-escape & {
|
|
1414
|
+
all: revert-layer;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/* A cell whose only content is a selection control sizes to that control instead of taking
|
|
1419
|
+
an equal flex share like a data column (use-gridrow's shadow makes every cell `flex: 1 1 0`
|
|
1420
|
+
by default), and tightens its inline padding so the checkbox doesn't sit in a wide gutter.
|
|
1421
|
+
This hits both the body checkbox/radio and a "select all" box in the matching header cell,
|
|
1422
|
+
so the column lines up. */
|
|
1423
|
+
use-gridcell[data-usewc-selection-cell],
|
|
1424
|
+
use-gridcell:has(> input:is([type="checkbox"], [type="radio"]):only-child),
|
|
1425
|
+
use-gridcell:has(> label:only-child > input:is([type="checkbox"], [type="radio"])) {
|
|
1426
|
+
flex: 0 0 auto;
|
|
1427
|
+
display: flex;
|
|
1428
|
+
align-items: center;
|
|
1429
|
+
justify-content: center;
|
|
1430
|
+
padding-inline-start: var(--usewc-layout-grid-selector-cell-padding-inline);
|
|
1431
|
+
padding-inline-end: 0;
|
|
1432
|
+
|
|
1433
|
+
use-theme-escape & {
|
|
1434
|
+
all: revert-layer;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/* The row lays its indicator slots and cells out as flex items; the slots carry a fixed
|
|
1439
|
+
1lh size, so `align-self` centres the slot in the row, and flexing whichever slot is
|
|
1440
|
+
showing centres the masked glyph inside it (no inline-block `vertical-align` guesswork).
|
|
1441
|
+
The `[selected]` / `:not([selected])` split keeps the hidden slot on the shadow's
|
|
1442
|
+
`display: none`; the `:not([selectmode="none"])` guard keeps a selection-less grid blank, and
|
|
1443
|
+
`use-gridrow:not([data-usewc-selection-column])` (an attribute use-grid sets on every row it
|
|
1444
|
+
injects a checkbox/radio cell into) keeps it blank when that control is the indicator —
|
|
1445
|
+
otherwise the empty 1lh slot renders as a ghost column left of the control.
|
|
1446
|
+
|
|
1447
|
+
The leading gutter matches the injected checkbox/radio cell's inline padding, so the ✔ glyph
|
|
1448
|
+
and a native selection control land in the same column position across grids. */
|
|
1449
|
+
use-gridrow::part(selected-indicator),
|
|
1450
|
+
use-gridrow::part(deselected-indicator) {
|
|
1451
|
+
align-self: center;
|
|
1452
|
+
margin-inline-start: var(--usewc-layout-grid-selector-cell-padding-inline);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
&:not([selectmode="none"]) use-gridrow:not([data-usewc-selection-column])[selected]::part(selected-indicator),
|
|
1456
|
+
&:not([selectmode="none"])
|
|
1457
|
+
use-gridrow:not([data-usewc-selection-column]):not([selected])::part(deselected-indicator) {
|
|
1458
|
+
display: flex;
|
|
1459
|
+
align-items: center;
|
|
1460
|
+
justify-content: center;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
/* Swap the built-in ✔ / blank glyphs for the same masked checkmark shape use-option and
|
|
1464
|
+
use-treeitem render, so a theme recolours or reshapes every selection indicator from one
|
|
1465
|
+
set of tokens. use-grid clones its default indicator spans into each body row as light-DOM
|
|
1466
|
+
children carrying `part="selected-indicator-default"` / `-deselected-indicator-default`;
|
|
1467
|
+
a custom indicator slotted by the author has no such part, so this never clobbers it. */
|
|
1468
|
+
use-gridrow > [part~="selected-indicator-default"],
|
|
1469
|
+
use-gridrow > [part~="deselected-indicator-default"] {
|
|
1470
|
+
display: inline-block;
|
|
1471
|
+
overflow: hidden;
|
|
1472
|
+
white-space: nowrap;
|
|
1473
|
+
text-indent: 100%;
|
|
1474
|
+
inline-size: var(--usewc-layout-selected-indicator-size);
|
|
1475
|
+
block-size: var(--usewc-layout-selected-indicator-size);
|
|
1476
|
+
mask-size: contain;
|
|
1477
|
+
mask-repeat: no-repeat;
|
|
1478
|
+
mask-position: center;
|
|
1479
|
+
|
|
1480
|
+
use-theme-escape & {
|
|
1481
|
+
all: revert-layer;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
use-gridrow > [part~="selected-indicator-default"] {
|
|
1486
|
+
background-color: var(--usewc-effect-selected-indicator-color, currentColor);
|
|
1487
|
+
mask-image: var(--usewc-effect-selected-indicator-mask-image, none);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
use-gridrow > [part~="deselected-indicator-default"] {
|
|
1491
|
+
background-color: var(--usewc-effect-deselected-indicator-color, transparent);
|
|
1492
|
+
mask-image: var(--usewc-effect-deselected-indicator-mask-image, none);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
/* A row counts as selected when use-grid's own `selectmode` marked it `[selected]`, or when the
|
|
1497
|
+
dev drove selection themselves with a native checkbox/radio in a cell (`selectmode="none"`,
|
|
1498
|
+
the row's `:checked` box is the only selection control). Both light the same band. These
|
|
1499
|
+
rules only move `--usewc-color-grid-row-background` — the body-row rule above reads it into
|
|
1500
|
+
`background` and carries the `use-theme-escape` revert. */
|
|
1501
|
+
use-grid:not(.chips, .list) use-gridbody use-gridrow:is([selected], :has(> use-gridcell input:checked)) {
|
|
1502
|
+
--usewc-color-grid-row-background: var(--usewc-color-grid-row-background-selected);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/* Within a run of consecutive selected rows the bands keep their gap but nearly square off the
|
|
1506
|
+
shared edge, so the run reads as grouped without merging into one shape. The "followed by a
|
|
1507
|
+
selected row" test is spelled out as two `:has()` alternatives rather than
|
|
1508
|
+
`:has(+ :is([selected], :has(…)))` because `:has()` can't be nested inside `:has()`. */
|
|
1509
|
+
use-grid:not(.chips, .list)
|
|
1510
|
+
use-gridbody
|
|
1511
|
+
use-gridrow:is([selected], :has(> use-gridcell input:checked)):is(
|
|
1512
|
+
:has(+ use-gridrow[selected]),
|
|
1513
|
+
:has(+ use-gridrow > use-gridcell input:checked)
|
|
1514
|
+
) {
|
|
1515
|
+
--usewc-grid-row-corner-end-start: var(--usewc-effect-grid-row-border-radius-sequential);
|
|
1516
|
+
--usewc-grid-row-corner-end-end: var(--usewc-effect-grid-row-border-radius-sequential);
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
use-grid:not(.chips, .list)
|
|
1520
|
+
use-gridbody
|
|
1521
|
+
use-gridrow:is([selected], :has(> use-gridcell input:checked))
|
|
1522
|
+
+ use-gridrow:is([selected], :has(> use-gridcell input:checked)) {
|
|
1523
|
+
--usewc-grid-row-corner-start-start: var(--usewc-effect-grid-row-border-radius-sequential);
|
|
1524
|
+
--usewc-grid-row-corner-start-end: var(--usewc-effect-grid-row-border-radius-sequential);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/* Whole-row hover band applies where a row click actually selects — `selectmode` is on and
|
|
1528
|
+
`selectwith` still includes the row gesture (absent attribute means the default, `row`). A
|
|
1529
|
+
disabled row (the `disabled` prop, or a bare `aria-disabled="true"`) never gets it. */
|
|
1530
|
+
use-grid:not(.chips, .list):not([selectmode="none"]):is(:not([selectwith]), [selectwith~="row"])
|
|
1531
|
+
use-gridbody
|
|
1532
|
+
use-gridrow:not([disabled], [aria-disabled="true"]):hover,
|
|
1533
|
+
/* ...and also where the row carries a selection control (injected column or a hand-placed
|
|
1534
|
+
checkbox/radio), so hovering the row surfaces the control even when the row isn't clickable. */
|
|
1535
|
+
use-grid:not(.chips, .list)
|
|
1536
|
+
use-gridbody
|
|
1537
|
+
use-gridrow:not([disabled], [aria-disabled="true"]):has(
|
|
1538
|
+
> use-gridcell input:is([type="checkbox"], [type="radio"])
|
|
1539
|
+
):hover {
|
|
1540
|
+
--usewc-color-grid-row-background: var(--usewc-color-grid-row-background-hover);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
use-grid:not(.chips, .list)
|
|
1544
|
+
use-gridbody
|
|
1545
|
+
use-gridrow:not([disabled], [aria-disabled="true"]):is([selected], :has(> use-gridcell input:checked)):hover {
|
|
1546
|
+
--usewc-color-grid-row-background: var(--usewc-color-grid-row-background-selected-hover);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
/* Cursor for a selectable, non-disabled row body. */
|
|
1550
|
+
use-grid:not(.chips, .list):not([selectmode="none"]):is(:not([selectwith]), [selectwith~="row"])
|
|
1551
|
+
use-gridbody
|
|
1552
|
+
use-gridrow:not([disabled], [aria-disabled="true"]) {
|
|
1553
|
+
cursor: default;
|
|
1554
|
+
|
|
1555
|
+
use-theme-escape & {
|
|
1556
|
+
all: revert-layer;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/* A disabled row — the `disabled` prop (which the component also reflects to `aria-disabled`),
|
|
1561
|
+
or a bare `aria-disabled="true"` a dev sets directly. The component shadow already dims it;
|
|
1562
|
+
this aligns that with the form-control disabled opacity token. It stays keyboard-navigable
|
|
1563
|
+
and AT-perceivable — the component only blocks the selection gestures. An injected
|
|
1564
|
+
checkbox/radio in the row carries `disabled`, so selector.css fades and inerts it too. */
|
|
1565
|
+
use-grid:not(.chips, .list) use-gridbody use-gridrow:is([disabled], [aria-disabled="true"]) {
|
|
1566
|
+
opacity: var(--usewc-effect-form-opacity-disabled);
|
|
1567
|
+
|
|
1568
|
+
use-theme-escape & {
|
|
1569
|
+
all: revert-layer;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/* The themed focus ring on the cells of the table and list variants; chips ring the whole pill
|
|
1574
|
+
(its row) instead, in its own block below. */
|
|
1575
|
+
use-grid:not(.appearance-native, .chips) use-gridcell {
|
|
1576
|
+
--usewc-effect-outline-width: 0;
|
|
1577
|
+
|
|
1578
|
+
outline: var(--usewc-effect-outline-width) var(--usewc-effect-outline-style) var(--usewc-color-outline);
|
|
1579
|
+
outline-offset: var(--usewc-effect-outline-offset-flush);
|
|
1580
|
+
transition: var(--usewc-effect-outline-transition);
|
|
1581
|
+
|
|
1582
|
+
&:focus-visible {
|
|
1583
|
+
--usewc-effect-outline-width: var(--usewc-effect-outline-size);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
use-theme-escape & {
|
|
1587
|
+
all: revert-layer;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/* The data column right after a selection checkbox/radio sits flush against it, so inset that
|
|
1592
|
+
cell's ring by the ring width — otherwise it paints over the control. */
|
|
1593
|
+
use-grid:not(.chips, .list)
|
|
1594
|
+
use-gridcell:is([data-usewc-selection-cell], :has(> input:is([type="checkbox"], [type="radio"])))
|
|
1595
|
+
+ use-gridcell {
|
|
1596
|
+
outline-offset: calc(-1 * var(--usewc-effect-outline-size));
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/* Chips — rows flow as inline pills; the select/deselect indicators are hidden since a chip
|
|
1600
|
+
conveys membership by simply existing (and usually carrying its own remove control). */
|
|
1601
|
+
use-grid.chips {
|
|
1602
|
+
display: flex;
|
|
1603
|
+
flex-wrap: wrap;
|
|
1604
|
+
gap: var(--usewc-layout-grid-chip-gap);
|
|
1605
|
+
|
|
1606
|
+
use-theme-escape & {
|
|
1607
|
+
all: revert-layer;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
use-gridrow {
|
|
1611
|
+
display: inline-flex;
|
|
1612
|
+
align-items: center;
|
|
1613
|
+
border: var(--usewc-layout-grid-border) solid var(--usewc-color-grid-chip-border);
|
|
1614
|
+
border-radius: var(--usewc-effect-grid-chip-border-radius);
|
|
1615
|
+
background: var(--usewc-color-grid-chip-background);
|
|
1616
|
+
|
|
1617
|
+
use-theme-escape & {
|
|
1618
|
+
all: revert-layer;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
use-gridcell {
|
|
1623
|
+
/* Content-sized, not an equal flex share — otherwise a multi-cell chip (label + a remove
|
|
1624
|
+
button) splits the pill and wraps the label. */
|
|
1625
|
+
flex: 0 0 auto;
|
|
1626
|
+
padding: var(--usewc-layout-grid-chip-padding-block) var(--usewc-layout-grid-chip-padding-inline);
|
|
1627
|
+
/* The pill (its row) carries the focus ring instead, so drop the cell's own — otherwise the
|
|
1628
|
+
browser's default outline stacks on top of it. */
|
|
1629
|
+
outline: none;
|
|
1630
|
+
|
|
1631
|
+
use-theme-escape & {
|
|
1632
|
+
all: revert-layer;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/* A leading cell followed by another (the label before a remove button) drops its trailing
|
|
1637
|
+
padding to a hair, and the trailing cell drops its leading padding to nothing and keeps only
|
|
1638
|
+
a hair from the pill's end — so the label and the compact button sit close together. */
|
|
1639
|
+
use-gridcell:has(+ use-gridcell) {
|
|
1640
|
+
padding-inline-end: var(--usewc-layout-grid-chip-padding-block);
|
|
1641
|
+
|
|
1642
|
+
use-theme-escape & {
|
|
1643
|
+
all: revert-layer;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
use-gridcell + use-gridcell {
|
|
1648
|
+
padding-inline: 0 var(--usewc-layout-grid-chip-padding-block);
|
|
1649
|
+
|
|
1650
|
+
use-theme-escape & {
|
|
1651
|
+
all: revert-layer;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
/* A themed button in a chip (the remove control) is a square, dropped to zero inline padding
|
|
1656
|
+
and rounded to the pill's radius, so it reads as part of the chip rather than a stray
|
|
1657
|
+
button. `1lh` (its own line-height) drives a clean square that scales with the text. */
|
|
1658
|
+
use-gridcell button {
|
|
1659
|
+
--usewc-layout-button-padding-inline: 0;
|
|
1660
|
+
--usewc-layout-button-padding-block: 0;
|
|
1661
|
+
--usewc-effect-button-radius: var(--usewc-effect-grid-chip-border-radius);
|
|
1662
|
+
|
|
1663
|
+
inline-size: 1lh;
|
|
1664
|
+
block-size: 1lh;
|
|
1665
|
+
|
|
1666
|
+
use-theme-escape & {
|
|
1667
|
+
all: revert-layer;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/* Focusing a cell rings the whole pill — the pill is the unit, and its border-radius rounds
|
|
1672
|
+
the outline for free. */
|
|
1673
|
+
use-gridrow:has(> use-gridcell:focus-visible) {
|
|
1674
|
+
outline: var(--usewc-effect-outline-size) var(--usewc-effect-outline-style) var(--usewc-color-outline);
|
|
1675
|
+
outline-offset: var(--usewc-effect-outline-offset);
|
|
1676
|
+
|
|
1677
|
+
use-theme-escape & {
|
|
1678
|
+
all: revert-layer;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
use-gridrow::part(selected-indicator),
|
|
1683
|
+
use-gridrow::part(deselected-indicator) {
|
|
1684
|
+
display: none;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/* List — the master/detail layout (a stacked row with its own internal grid-template). The
|
|
1689
|
+
row-internal template still lives in author CSS; this block only supplies the shared chrome
|
|
1690
|
+
(row padding, hover, and a selected-row marker). WIP: the `.list` class is still being
|
|
1691
|
+
defined, so expect this to grow. */
|
|
1692
|
+
use-grid.list {
|
|
1693
|
+
display: flex;
|
|
1694
|
+
flex-direction: column;
|
|
1695
|
+
|
|
1696
|
+
use-theme-escape & {
|
|
1697
|
+
all: revert-layer;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
use-gridrow {
|
|
1701
|
+
padding: var(--usewc-layout-grid-list-row-padding);
|
|
1702
|
+
|
|
1703
|
+
use-theme-escape & {
|
|
1704
|
+
all: revert-layer;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
&:is(:hover, :focus-within) {
|
|
1708
|
+
background: var(--usewc-color-grid-list-row-background-hover);
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
&[selected] {
|
|
1712
|
+
box-shadow: inset var(--usewc-layout-grid-list-row-selected-marker) 0 0 0
|
|
1713
|
+
var(--usewc-color-grid-list-row-selected-marker);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
use-gridrow::part(selected-indicator),
|
|
1718
|
+
use-gridrow::part(deselected-indicator) {
|
|
1719
|
+
display: none;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1258
1722
|
}
|
|
1259
1723
|
|
|
1260
1724
|
/* Card — `use-card` is a theme-only tag, styled like `use-field`/`use-selector` with no
|
package/dist/tokens.css
CHANGED
|
@@ -136,7 +136,10 @@
|
|
|
136
136
|
--usewc-icon-caret-block-start: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 8L18.9282 15.5L5.0718 15.5L12 8Z' fill='black' /%3E%3C/svg%3E");
|
|
137
137
|
--usewc-icon-caret-inline-end: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 12L8.5 18.9282L8.5 5.0718Z' fill='black' /%3E%3C/svg%3E");
|
|
138
138
|
--usewc-icon-caret-inline-start: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12L15.5 5.0718L15.5 18.9282Z' fill='black' /%3E%3C/svg%3E");
|
|
139
|
-
|
|
139
|
+
/* The checkmark path is lifted ~2 units above the geometric centre of the 24×24 box: a
|
|
140
|
+
checkmark's visual mass sits toward its lower vertex, so it needs the optical nudge to read
|
|
141
|
+
as centred wherever it's masked (use-option, use-treeitem, use-grid selection indicators). */
|
|
142
|
+
--usewc-icon-checkmark: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 11L10 16L19 5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E");
|
|
140
143
|
|
|
141
144
|
/** Motion */
|
|
142
145
|
--usewc-transition-duration-fast: 120ms;
|
|
@@ -544,6 +547,63 @@
|
|
|
544
547
|
--usewc-font-badge-weight: var(--usewc-font-weight-medium);
|
|
545
548
|
--usewc-effect-badge-border-radius: var(--usewc-effect-border-radius-pill);
|
|
546
549
|
|
|
550
|
+
/* Grid — `.table` is the default treatment a bare `use-grid` gets; `.chips` and `.list`
|
|
551
|
+
(the latter still being defined) opt into their own layouts instead. */
|
|
552
|
+
--usewc-color-grid-border: var(--usewc-color-button-base-border-static);
|
|
553
|
+
/* The table itself and its header paint no fill — only the hover and selected row bands do. */
|
|
554
|
+
--usewc-color-grid-background: transparent;
|
|
555
|
+
--usewc-color-grid-header-background: transparent;
|
|
556
|
+
--usewc-color-grid-header-text: var(--usewc-color-gray-600);
|
|
557
|
+
--usewc-color-grid-row-background-hover: oklch(from var(--usewc-color-gray-300) l c h / 0.55);
|
|
558
|
+
/* A super-light tint of the primary — its hue and a whisper of its chroma, floated up to
|
|
559
|
+
near-white — so it tracks the primary even if that's overridden. */
|
|
560
|
+
--usewc-color-grid-row-background-selected: oklch(from var(--usewc-color-brand-primary) 0.96 0.03 h);
|
|
561
|
+
/* Same tint, a touch deeper, for a hover landing on an already-selected row. */
|
|
562
|
+
--usewc-color-grid-row-background-selected-hover: oklch(from var(--usewc-color-brand-primary) 0.93 0.045 h);
|
|
563
|
+
--usewc-layout-grid-border: var(--usewc-space-1);
|
|
564
|
+
--usewc-layout-grid-header-divider-height: 60%;
|
|
565
|
+
--usewc-layout-grid-body-inset: var(--usewc-space-4);
|
|
566
|
+
/* Clear space between the header divider (and the grid's bottom edge) and the first/last row
|
|
567
|
+
band. Matches the row gap so the body's inset reads as uniform with the space between rows. */
|
|
568
|
+
--usewc-layout-grid-body-padding-block: var(--usewc-space-4);
|
|
569
|
+
--usewc-layout-grid-row-padding-inline: var(--usewc-space-4);
|
|
570
|
+
/* The visible gap between two body rows' bands, applied as a real `gap` on the body flex column. */
|
|
571
|
+
--usewc-layout-grid-row-gap: var(--usewc-space-4);
|
|
572
|
+
--usewc-effect-grid-row-border-radius: var(--usewc-effect-border-radius-6);
|
|
573
|
+
/* The edge a selected-row band shares with an adjacent selected row: nearly square, but a hair
|
|
574
|
+
of rounding rather than a hard corner. */
|
|
575
|
+
--usewc-effect-grid-row-border-radius-sequential: var(--usewc-effect-border-radius-2);
|
|
576
|
+
/* Cells follow the same box model as input/button: a fixed line-height plus symmetric block
|
|
577
|
+
padding sets a predictable control-height per row, and the header cells take the identical
|
|
578
|
+
values so the header row is exactly as tall as a body row. */
|
|
579
|
+
--usewc-layout-grid-cell-line-height: var(--usewc-line-height-24);
|
|
580
|
+
--usewc-layout-grid-cell-padding-block: var(--usewc-space-6);
|
|
581
|
+
--usewc-layout-grid-cell-padding-inline: var(--usewc-space-12);
|
|
582
|
+
/* A cell holding only a selection checkbox/radio — no data column padding, just enough to keep
|
|
583
|
+
the control off the row edge. The column divider that would sit between it and the first data
|
|
584
|
+
column is dropped, so its trailing edge doesn't need extra room. */
|
|
585
|
+
--usewc-layout-grid-selector-cell-padding-inline: var(--usewc-space-4);
|
|
586
|
+
--usewc-font-grid-header-weight: var(--usewc-font-weight-medium);
|
|
587
|
+
--usewc-effect-grid-border-radius: var(--usewc-effect-border-radius-8);
|
|
588
|
+
/* -- Compact variant (`.compact`): a shorter line-height and tighter block padding / row gap,
|
|
589
|
+
the same way button's small size steps down from its base. */
|
|
590
|
+
--usewc-layout-grid-compact-cell-line-height: var(--usewc-line-height-20);
|
|
591
|
+
--usewc-layout-grid-compact-cell-padding-block: var(--usewc-space-4);
|
|
592
|
+
--usewc-layout-grid-compact-cell-padding-inline: var(--usewc-space-8);
|
|
593
|
+
--usewc-layout-grid-compact-row-gap: var(--usewc-space-2);
|
|
594
|
+
/* -- Chips variant */
|
|
595
|
+
--usewc-layout-grid-chip-gap: var(--usewc-space-8);
|
|
596
|
+
--usewc-layout-grid-chip-padding-block: var(--usewc-space-2);
|
|
597
|
+
--usewc-layout-grid-chip-padding-inline: var(--usewc-space-8);
|
|
598
|
+
--usewc-color-grid-chip-border: var(--usewc-color-grid-border);
|
|
599
|
+
--usewc-color-grid-chip-background: var(--usewc-color-canvas-background);
|
|
600
|
+
--usewc-effect-grid-chip-border-radius: var(--usewc-effect-border-radius-pill);
|
|
601
|
+
/* -- List variant (WIP) */
|
|
602
|
+
--usewc-layout-grid-list-row-padding: var(--usewc-space-8);
|
|
603
|
+
--usewc-color-grid-list-row-background-hover: var(--usewc-color-grid-row-background-hover);
|
|
604
|
+
--usewc-color-grid-list-row-selected-marker: var(--usewc-color-brand-accent);
|
|
605
|
+
--usewc-layout-grid-list-row-selected-marker: var(--usewc-space-2);
|
|
606
|
+
|
|
547
607
|
/* Menu */
|
|
548
608
|
--usewc-layout-popover-menu-item-padding-inline: var(--usewc-space-4);
|
|
549
609
|
--usewc-layout-popover-menu-item-padding-block: var(--usewc-space-2);
|
|
@@ -679,6 +739,12 @@
|
|
|
679
739
|
--usewc-effect-select-trigger-background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 16L5.0718 8.5L18.9282 8.5L12 16Z' fill='rgb(229,231,235)' /%3E%3C/svg%3E");
|
|
680
740
|
--usewc-effect-menu-item-checkmark-background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13L10 18L19 7' stroke='rgb(229,231,235)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E");
|
|
681
741
|
--usewc-color-surface-backdrop: oklch(0% 0 0 / 0.6);
|
|
742
|
+
/* "Super light" can't float up on a near-black page — hold the primary's hue and chroma
|
|
743
|
+
but drop the lightness so the tint reads as a dark primary wash instead. */
|
|
744
|
+
--usewc-color-grid-row-background-selected: oklch(from var(--usewc-color-brand-primary) 0.3 0.05 h);
|
|
745
|
+
--usewc-color-grid-row-background-selected-hover: oklch(from var(--usewc-color-brand-primary) 0.36 0.06 h);
|
|
746
|
+
--usewc-color-grid-row-background-hover: oklch(from var(--usewc-color-gray-800) l c h / 0.6);
|
|
747
|
+
--usewc-color-grid-header-text: var(--usewc-color-gray-200);
|
|
682
748
|
}
|
|
683
749
|
}
|
|
684
750
|
|
package/package.json
CHANGED
|
@@ -63,17 +63,6 @@
|
|
|
63
63
|
"attributes": [],
|
|
64
64
|
"references": []
|
|
65
65
|
},
|
|
66
|
-
{
|
|
67
|
-
"name": "use-date-input",
|
|
68
|
-
"description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.\n---\n",
|
|
69
|
-
"attributes": [
|
|
70
|
-
{ "name": "disabled", "values": [] },
|
|
71
|
-
{ "name": "readonly", "values": [] },
|
|
72
|
-
{ "name": "value", "values": [] },
|
|
73
|
-
{ "name": "lang", "values": [] }
|
|
74
|
-
],
|
|
75
|
-
"references": []
|
|
76
|
-
},
|
|
77
66
|
{
|
|
78
67
|
"name": "use-date-picker",
|
|
79
68
|
"description": "A day-granularity date picker. Value format: YYYY-MM-DD.\n\nCustomize day rendering on an instance:\n```ts\ndatePicker.renderDay = ({ day, date }, html) =>\n date === \"2026-03-17\" ? html`<strong>${day}</strong>` : String(day);\n```\n\nOr override on a subclass to apply it to every instance, falling back to\n`super.renderDay(...)` for dates you don't want to customize:\n```ts\nclass MyDatePicker extends UseDatePicker {\n renderDay(data: { day: number; date: string }, html: LitHtml) {\n if (data.date === \"2026-03-17\") {\n return html`<strong>${data.day}</strong>`;\n }\n return super.renderDay(data, html);\n }\n}\n```\n---\n\n\n### **Events:**\n - **use-change** - Fired on selection with detail `{ value: string }`\n\n### **Methods:**\n - **renderDay(data: _{ day: number; date: string }_, _html: _LitHtml_): _TemplateResult | string_** - See UseCalendarRenderDay. Assigning a new function on an\ninstance (e.g. via `.renderDay=${fn}` in a Lit template) after first\nrender does not schedule a re-render on its own — call `requestUpdate()`\nif needed.\n\nDeclared as a regular method rather than a class field so subclass\noverrides can call `super.renderDay(data, html)` to fall back to the\ndefault (or a parent override's) rendering.\n\n### **Slots:**\n - **header-start** - Content before the title in the header\n- **title** - Title showing the month and year\n- **controls** - Navigation controls (previous, today, next buttons)\n- **header-end** - Content after the controls in the header\n- **date-{YYYY-MM-DD}** - Per-date content that replaces the default day number\n\n### **CSS Parts:**\n - **header** - The header container\n- **title** - The title text\n- **title-month** - The month part of the title\n- **title-literal** - Literal text in the title\n- **title-year** - The year part of the title\n- **controls** - The controls slot container\n- **control** - Individual control button\n- **control-previous** - Previous month button\n- **control-today** - Today button\n- **control-next** - Next month button\n- **grid** - The main calendar grid\n- **grid-header** - The header row with day names\n- **grid-header-cell** - Individual day name header cell\n- **grid-body** - The container for calendar weeks\n- **row** - A row of days\n- **day** - A day cell\n- **day-empty** - An empty day cell (from previous/next month)\n- **day-selected** - A selected day cell\n- **day-today** - The current date cell\n- **day-disabled** - A disabled date cell\n- **title-button** - The clickable button wrapping the month/year title\n- **picker** - The scrollable month/year picker panel (replaces grid when open)\n- **picker-year-section** - Container for one year's label and month grid\n- **picker-year-label** - The year heading inside a year section\n- **picker-months** - The 4-column month grid inside a year section\n- **picker-month** - An individual month button\n- **picker-month-current** - Applied to the currently selected month button",
|
|
@@ -107,6 +96,17 @@
|
|
|
107
96
|
],
|
|
108
97
|
"references": []
|
|
109
98
|
},
|
|
99
|
+
{
|
|
100
|
+
"name": "use-date-input",
|
|
101
|
+
"description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.\n---\n",
|
|
102
|
+
"attributes": [
|
|
103
|
+
{ "name": "disabled", "values": [] },
|
|
104
|
+
{ "name": "readonly", "values": [] },
|
|
105
|
+
{ "name": "value", "values": [] },
|
|
106
|
+
{ "name": "lang", "values": [] }
|
|
107
|
+
],
|
|
108
|
+
"references": []
|
|
109
|
+
},
|
|
110
110
|
{
|
|
111
111
|
"name": "use-datetime-input",
|
|
112
112
|
"description": "Displays a date and time picker by combining `use-date` and `use-time`.\n\nThe value format is ISO 8601-like: `YYYY-MM-DDTHH:MM:SS.mmm`.\n---\n",
|