use-wc 1.0.0-pre.60 → 1.0.0-pre.61
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 +22 -11
- package/dist/tokens.css +5 -3
- package/package.json +1 -1
- package/vscode.html-custom-data.json +11 -11
package/custom-elements.json
CHANGED
|
@@ -89,149 +89,6 @@
|
|
|
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
|
-
},
|
|
235
92
|
{
|
|
236
93
|
"kind": "javascript-module",
|
|
237
94
|
"path": "src/elements/use-calendar-base/use-calendar-base.ts",
|
|
@@ -631,8 +488,151 @@
|
|
|
631
488
|
"kind": "js",
|
|
632
489
|
"name": "UseCalendarBase",
|
|
633
490
|
"declaration": {
|
|
634
|
-
"name": "UseCalendarBase",
|
|
635
|
-
"module": "src/elements/use-calendar-base/use-calendar-base.ts"
|
|
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"
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
]
|
|
@@ -767,6 +767,132 @@
|
|
|
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
|
+
},
|
|
770
896
|
{
|
|
771
897
|
"kind": "javascript-module",
|
|
772
898
|
"path": "src/elements/use-date-picker/use-date-picker.ts",
|
|
@@ -1430,132 +1556,6 @@
|
|
|
1430
1556
|
}
|
|
1431
1557
|
]
|
|
1432
1558
|
},
|
|
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
|
@@ -1810,7 +1810,7 @@
|
|
|
1810
1810
|
}
|
|
1811
1811
|
|
|
1812
1812
|
/* Popover — a native `[popover]` element already provides the overlay mechanics (top-layer
|
|
1813
|
-
promotion, light-dismiss
|
|
1813
|
+
promotion, light-dismiss) for free. Themed by default, like the rest of this
|
|
1814
1814
|
family's native elements — `:not(.appearance-native)` is the escape hatch, matching
|
|
1815
1815
|
`input.css`/`select.css`'s convention, not an opt-in class like `dialog.drawer` (a `<dialog>`
|
|
1816
1816
|
needs a class for that one variant since plain and drawer dialogs share one tag; `[popover]`
|
|
@@ -1819,6 +1819,11 @@
|
|
|
1819
1819
|
otherwise — this only replaces the UA default chrome with the shared `surface` tokens,
|
|
1820
1820
|
matching `dialog`/`use-card`.
|
|
1821
1821
|
|
|
1822
|
+
The `::backdrop` is deliberately left at its transparent UA default: a `[popover]` at
|
|
1823
|
+
`popover="auto"` is non-modal — the page stays interactive and an outside click dismisses it
|
|
1824
|
+
— so a tint would misrepresent it as modal. That backdrop tint lives in `dialog.css`, where
|
|
1825
|
+
`showModal()` makes it real.
|
|
1826
|
+
|
|
1822
1827
|
`:not(use-menu)` excludes the one component that self-applies `popover="auto"` and ships its
|
|
1823
1828
|
own distinct chrome in `menu.css`: cascade layers always beat specificity, so without this
|
|
1824
1829
|
exclusion `use-menu:popover-open`'s more specific rule would still lose to this layer, which
|
|
@@ -1840,14 +1845,6 @@
|
|
|
1840
1845
|
all: revert-layer;
|
|
1841
1846
|
}
|
|
1842
1847
|
}
|
|
1843
|
-
|
|
1844
|
-
[popover]:not(use-menu, .appearance-native)::backdrop {
|
|
1845
|
-
background: var(--usewc-color-surface-backdrop);
|
|
1846
|
-
|
|
1847
|
-
use-theme-escape & {
|
|
1848
|
-
all: revert-layer;
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
1848
|
}
|
|
1852
1849
|
|
|
1853
1850
|
/* Shell — `use-shell` is a theme-only tag (no registration, styled by tag name like
|
|
@@ -1910,11 +1907,25 @@
|
|
|
1910
1907
|
|
|
1911
1908
|
/* Surface regions — header/poster/footer styling shared by the three surface hosts (`dialog`,
|
|
1912
1909
|
`use-card`, `[popover]`), scoped to them specifically rather than to bare `use-shell`: this is
|
|
1913
|
-
a surface-family visual convention (avatar sizing, trailing-action
|
|
1914
|
-
not something every generic `use-shell` consumer
|
|
1910
|
+
a surface-family visual convention (the anchored-gap offset, avatar sizing, trailing-action
|
|
1911
|
+
pinning, a footer rule), not something every generic `use-shell` consumer should inherit.
|
|
1915
1912
|
Everything here rides on top of `shell.css`'s flex mechanic — this only adds padding, gaps,
|
|
1916
1913
|
and per-region treatment. */
|
|
1917
1914
|
@layer use-theme.surface {
|
|
1915
|
+
/* An anchored surface keeps a small gap from its anchor, the same convention `use-menu`
|
|
1916
|
+
follows in `menu.css`. Scoped to `use-anchored`'s direct child — the one reliable "this is
|
|
1917
|
+
anchored" signal — so a standalone `[popover]` or modal `<dialog>` elsewhere keeps its UA
|
|
1918
|
+
centering. `margin-block` (both edges) so the gap survives a `position-try` flip to the
|
|
1919
|
+
other side. The open-state check mirrors the positioning util: `:popover-open` for a
|
|
1920
|
+
popover, `[open]` for a `<dialog>`. */
|
|
1921
|
+
use-anchored > :is(dialog, [popover]):not(use-menu, .appearance-native):is([open], :popover-open) {
|
|
1922
|
+
margin-block: var(--usewc-layout-surface-anchor-offset);
|
|
1923
|
+
|
|
1924
|
+
use-theme-escape & {
|
|
1925
|
+
all: revert-layer;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1918
1929
|
:is(dialog:not(.appearance-native), use-card, [popover]:not(use-menu, .appearance-native)) > figure {
|
|
1919
1930
|
margin: 0;
|
|
1920
1931
|
|
package/dist/tokens.css
CHANGED
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
--usewc-color-popover-menu-item-background-hover: var(--usewc-color-selector-background-hover);
|
|
613
613
|
--usewc-color-popover-menu-item-background-active: var(--usewc-color-selector-background-hover);
|
|
614
614
|
--usewc-effect-popover-menu-item-border-radius: var(--usewc-effect-border-radius-4);
|
|
615
|
-
--usewc-layout-popover-menu-anchor-offset: var(--usewc-
|
|
615
|
+
--usewc-layout-popover-menu-anchor-offset: var(--usewc-layout-surface-anchor-offset);
|
|
616
616
|
--usewc-layout-popover-menu-padding: var(--usewc-space-4);
|
|
617
617
|
--usewc-layout-popover-menu-border: var(--usewc-space-1-relative);
|
|
618
618
|
--usewc-effect-popover-menu-border-style: var(--usewc-effect-border-solid);
|
|
@@ -639,11 +639,13 @@
|
|
|
639
639
|
--usewc-font-code-size: var(--usewc-font-size-14);
|
|
640
640
|
|
|
641
641
|
/* Surface — shared by every surface host (dialog, use-card, [popover]): the visible chrome
|
|
642
|
-
(background/border/radius/shadow), the backdrop behind
|
|
643
|
-
|
|
642
|
+
(background/border/radius/shadow), the backdrop behind a modal `<dialog>` (non-modal
|
|
643
|
+
`[popover]` keeps its transparent UA backdrop), the gap an anchored surface keeps from its
|
|
644
|
+
anchor, and the internal header/poster/footer region layout they all apply the same way. */
|
|
644
645
|
--usewc-color-surface-background: var(--usewc-color-canvas-background);
|
|
645
646
|
--usewc-color-surface-border: var(--usewc-color-button-base-border-static);
|
|
646
647
|
--usewc-color-surface-backdrop: oklch(0% 0 0 / 0.4);
|
|
648
|
+
--usewc-layout-surface-anchor-offset: var(--usewc-space-4);
|
|
647
649
|
--usewc-layout-surface-border: var(--usewc-space-1);
|
|
648
650
|
--usewc-effect-surface-border-radius: var(--usewc-effect-border-radius-8);
|
|
649
651
|
--usewc-effect-surface-shadow: var(--usewc-effect-shadow-raised);
|
package/package.json
CHANGED
|
@@ -63,6 +63,17 @@
|
|
|
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
|
+
},
|
|
66
77
|
{
|
|
67
78
|
"name": "use-date-picker",
|
|
68
79
|
"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",
|
|
@@ -96,17 +107,6 @@
|
|
|
96
107
|
],
|
|
97
108
|
"references": []
|
|
98
109
|
},
|
|
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",
|