use-wc 1.0.0-pre.37 → 1.0.0-pre.39
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 +68 -66
- package/dist/default-tokens.css +29 -31
- package/dist/design-system.css +25 -25
- package/dist/docs/use-calendarday.md +22 -0
- package/dist/docs/use-date-input.md +23 -0
- package/dist/docs/use-date-picker.md +44 -0
- package/dist/docs/use-datetime-input.md +28 -0
- package/dist/docs/use-dropdown.md +46 -0
- package/dist/docs/use-duration-input.md +39 -0
- package/dist/docs/use-focusgroup.md +45 -0
- package/dist/docs/use-grid.md +26 -0
- package/dist/docs/use-gridbody.md +1 -0
- package/dist/docs/use-gridcell.md +17 -0
- package/dist/docs/use-gridhead.md +1 -0
- package/dist/docs/use-gridrow.md +10 -0
- package/dist/docs/use-intl-datetime.md +23 -0
- package/dist/docs/use-listbox-input.md +34 -0
- package/dist/docs/use-menu.md +41 -0
- package/dist/docs/use-month-picker.md +38 -0
- package/dist/docs/use-option.md +20 -0
- package/dist/docs/use-scrollarea.md +17 -0
- package/dist/docs/use-select-input.md +38 -0
- package/dist/docs/use-time-input.md +38 -0
- package/dist/docs/use-tree.md +30 -0
- package/dist/docs/use-treeitem.md +25 -0
- package/dist/docs/use-week-picker.md +44 -0
- package/dist/docs/use-widget.md +21 -0
- package/package.json +3 -2
- package/vscode.html-custom-data.json +8 -7
package/custom-elements.json
CHANGED
|
@@ -396,71 +396,6 @@
|
|
|
396
396
|
}
|
|
397
397
|
]
|
|
398
398
|
},
|
|
399
|
-
{
|
|
400
|
-
"kind": "javascript-module",
|
|
401
|
-
"path": "src/elements/use-calendarday/use-calendarday.ts",
|
|
402
|
-
"declarations": [
|
|
403
|
-
{
|
|
404
|
-
"kind": "class",
|
|
405
|
-
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.",
|
|
406
|
-
"name": "UseCalendarday",
|
|
407
|
-
"slots": [
|
|
408
|
-
{
|
|
409
|
-
"description": "slot for custom day content (replaces the day number)",
|
|
410
|
-
"name": "default"
|
|
411
|
-
}
|
|
412
|
-
],
|
|
413
|
-
"members": [
|
|
414
|
-
{
|
|
415
|
-
"kind": "field",
|
|
416
|
-
"name": "date",
|
|
417
|
-
"type": {
|
|
418
|
-
"text": "string"
|
|
419
|
-
},
|
|
420
|
-
"attribute": "date"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
"kind": "field",
|
|
424
|
-
"name": "day",
|
|
425
|
-
"readonly": true
|
|
426
|
-
}
|
|
427
|
-
],
|
|
428
|
-
"attributes": [
|
|
429
|
-
{
|
|
430
|
-
"name": "date",
|
|
431
|
-
"type": {
|
|
432
|
-
"text": "string"
|
|
433
|
-
},
|
|
434
|
-
"fieldName": "date"
|
|
435
|
-
}
|
|
436
|
-
],
|
|
437
|
-
"superclass": {
|
|
438
|
-
"name": "LitElement",
|
|
439
|
-
"package": "lit"
|
|
440
|
-
},
|
|
441
|
-
"tagName": "use-calendarday",
|
|
442
|
-
"customElement": true
|
|
443
|
-
}
|
|
444
|
-
],
|
|
445
|
-
"exports": [
|
|
446
|
-
{
|
|
447
|
-
"kind": "js",
|
|
448
|
-
"name": "UseCalendarday",
|
|
449
|
-
"declaration": {
|
|
450
|
-
"name": "UseCalendarday",
|
|
451
|
-
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
"kind": "custom-element-definition",
|
|
456
|
-
"name": "use-calendarday",
|
|
457
|
-
"declaration": {
|
|
458
|
-
"name": "UseCalendarday",
|
|
459
|
-
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
]
|
|
463
|
-
},
|
|
464
399
|
{
|
|
465
400
|
"kind": "javascript-module",
|
|
466
401
|
"path": "src/elements/use-date-input/use-date-input.ts",
|
|
@@ -587,6 +522,71 @@
|
|
|
587
522
|
}
|
|
588
523
|
]
|
|
589
524
|
},
|
|
525
|
+
{
|
|
526
|
+
"kind": "javascript-module",
|
|
527
|
+
"path": "src/elements/use-calendarday/use-calendarday.ts",
|
|
528
|
+
"declarations": [
|
|
529
|
+
{
|
|
530
|
+
"kind": "class",
|
|
531
|
+
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.",
|
|
532
|
+
"name": "UseCalendarday",
|
|
533
|
+
"slots": [
|
|
534
|
+
{
|
|
535
|
+
"description": "slot for custom day content (replaces the day number)",
|
|
536
|
+
"name": "default"
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"members": [
|
|
540
|
+
{
|
|
541
|
+
"kind": "field",
|
|
542
|
+
"name": "date",
|
|
543
|
+
"type": {
|
|
544
|
+
"text": "string"
|
|
545
|
+
},
|
|
546
|
+
"attribute": "date"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"kind": "field",
|
|
550
|
+
"name": "day",
|
|
551
|
+
"readonly": true
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"attributes": [
|
|
555
|
+
{
|
|
556
|
+
"name": "date",
|
|
557
|
+
"type": {
|
|
558
|
+
"text": "string"
|
|
559
|
+
},
|
|
560
|
+
"fieldName": "date"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"superclass": {
|
|
564
|
+
"name": "LitElement",
|
|
565
|
+
"package": "lit"
|
|
566
|
+
},
|
|
567
|
+
"tagName": "use-calendarday",
|
|
568
|
+
"customElement": true
|
|
569
|
+
}
|
|
570
|
+
],
|
|
571
|
+
"exports": [
|
|
572
|
+
{
|
|
573
|
+
"kind": "js",
|
|
574
|
+
"name": "UseCalendarday",
|
|
575
|
+
"declaration": {
|
|
576
|
+
"name": "UseCalendarday",
|
|
577
|
+
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"kind": "custom-element-definition",
|
|
582
|
+
"name": "use-calendarday",
|
|
583
|
+
"declaration": {
|
|
584
|
+
"name": "UseCalendarday",
|
|
585
|
+
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
]
|
|
589
|
+
},
|
|
590
590
|
{
|
|
591
591
|
"kind": "javascript-module",
|
|
592
592
|
"path": "src/elements/use-date-picker/use-date-picker.ts",
|
|
@@ -1986,7 +1986,7 @@
|
|
|
1986
1986
|
"declarations": [
|
|
1987
1987
|
{
|
|
1988
1988
|
"kind": "class",
|
|
1989
|
-
"description": "Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)
|
|
1989
|
+
"description": "Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).",
|
|
1990
1990
|
"name": "UseGrid",
|
|
1991
1991
|
"slots": [
|
|
1992
1992
|
{
|
|
@@ -2177,6 +2177,7 @@
|
|
|
2177
2177
|
"text": "\"widget\" | \"action\" | \"default\""
|
|
2178
2178
|
},
|
|
2179
2179
|
"default": "\"default\"",
|
|
2180
|
+
"description": "Determines how the cell behaves in terms of focus and interaction. The possible values are:\n\n- `'none'` - the cell itself is focusable and it does not contain any interactive elements.\n- `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.\n- `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly.",
|
|
2180
2181
|
"attribute": "mode",
|
|
2181
2182
|
"reflects": true
|
|
2182
2183
|
},
|
|
@@ -2230,6 +2231,7 @@
|
|
|
2230
2231
|
"text": "\"widget\" | \"action\" | \"default\""
|
|
2231
2232
|
},
|
|
2232
2233
|
"default": "\"default\"",
|
|
2234
|
+
"description": "Determines how the cell behaves in terms of focus and interaction. The possible values are:\n\n- `'none'` - the cell itself is focusable and it does not contain any interactive elements.\n- `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.\n- `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly.",
|
|
2233
2235
|
"fieldName": "mode"
|
|
2234
2236
|
}
|
|
2235
2237
|
],
|
package/dist/default-tokens.css
CHANGED
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
|
|
116
116
|
:root {
|
|
117
117
|
/* Layout */
|
|
118
|
-
--usewc-
|
|
118
|
+
--usewc-font-document-size: var(--usewc-font-size-16);
|
|
119
119
|
--usewc-color-document-text: var(--usewc-color-gray-700);
|
|
120
120
|
--usewc-color-document-text-muted: var(--usewc-color-gray-500);
|
|
121
121
|
--usewc-color-document-background: var(--usewc-color-white);
|
|
@@ -128,14 +128,14 @@
|
|
|
128
128
|
--usewc-font-input-family: inherit;
|
|
129
129
|
|
|
130
130
|
/* Controls */
|
|
131
|
-
/* -
|
|
132
|
-
--usewc-color-
|
|
133
|
-
--usewc-
|
|
134
|
-
--usewc-
|
|
135
|
-
--usewc-
|
|
136
|
-
--usewc-effect-
|
|
137
|
-
--usewc-
|
|
138
|
-
--usewc-effect-
|
|
131
|
+
/* - Outline (focus indicator) */
|
|
132
|
+
--usewc-color-outline: var(--usewc-color-blue-500);
|
|
133
|
+
--usewc-effect-outline-size: var(--usewc-space-2);
|
|
134
|
+
--usewc-effect-outline-offset: var(--usewc-space-2);
|
|
135
|
+
--usewc-effect-outline-offset-flush: var(--usewc-space-none);
|
|
136
|
+
--usewc-effect-outline-style: solid;
|
|
137
|
+
--usewc-effect-outline-transition: outline 0.05s ease-in-out;
|
|
138
|
+
--usewc-effect-form-opacity-disabled: 0.5;
|
|
139
139
|
/* - Link */
|
|
140
140
|
--usewc-color-link-text-static: var(--usewc-color-blue-500);
|
|
141
141
|
--usewc-color-link-text-hover: var(--usewc-color-blue-600);
|
|
@@ -143,7 +143,6 @@
|
|
|
143
143
|
--usewc-color-link-text-visited: var(--usewc-color-indigo-500);
|
|
144
144
|
--usewc-color-link-text-visited-hover: var(--usewc-color-indigo-600);
|
|
145
145
|
--usewc-color-link-text-visited-active: var(--usewc-color-indigo-700);
|
|
146
|
-
--usewc-color-link-text-visited-visited: var(--usewc-color-indigo-500);
|
|
147
146
|
--usewc-effect-link-text-decoration: underline;
|
|
148
147
|
|
|
149
148
|
/* Form */
|
|
@@ -175,7 +174,7 @@
|
|
|
175
174
|
--usewc-color-input-segment-background-focus: var(--usewc-color-blue-100);
|
|
176
175
|
--usewc-color-input-segment-text-focus: var(--usewc-color-gray-700);
|
|
177
176
|
--usewc-effect-dropdown-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='rgba(255,255,255,0.5' /%3E%3C/svg%3E");
|
|
178
|
-
--usewc-effect-dropdown-trigger-
|
|
177
|
+
--usewc-effect-dropdown-trigger-nested-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='M16 12L8.5 18.9282L8.5 5.0718Z' fill='rgba(255,255,255,0.5' /%3E%3C/svg%3E");
|
|
179
178
|
--usewc-effect-dropdown-trigger-background-size: 1em;
|
|
180
179
|
--usewc-effect-dropdown-trigger-background-blend-mode: difference;
|
|
181
180
|
--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='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E");
|
|
@@ -191,7 +190,6 @@
|
|
|
191
190
|
/* - Effect */
|
|
192
191
|
--usewc-effect-input-border-style: solid;
|
|
193
192
|
--usewc-effect-input-border-radius: var(--usewc-effect-border-radius-4);
|
|
194
|
-
--usewc-effect-input-opacity-disabled: 0.5;
|
|
195
193
|
/* - Font */
|
|
196
194
|
--usewc-font-input-size: var(--usewc-font-size-16);
|
|
197
195
|
|
|
@@ -267,18 +265,18 @@
|
|
|
267
265
|
--usewc-color-button-danger-text-static-auxiliary: var(--usewc-color-red-500);
|
|
268
266
|
--usewc-color-button-danger-text-hover: var(--usewc-color-white);
|
|
269
267
|
/* -- Cancel color */
|
|
270
|
-
--usewc-color-button-
|
|
271
|
-
--usewc-color-button-
|
|
272
|
-
--usewc-color-button-
|
|
273
|
-
--usewc-color-button-
|
|
274
|
-
--usewc-color-button-
|
|
275
|
-
--usewc-color-button-
|
|
276
|
-
--usewc-color-button-
|
|
277
|
-
--usewc-color-button-
|
|
278
|
-
--usewc-color-button-
|
|
279
|
-
--usewc-color-button-
|
|
280
|
-
--usewc-color-button-
|
|
281
|
-
--usewc-color-button-
|
|
268
|
+
--usewc-color-button-clear-background-static: transparent;
|
|
269
|
+
--usewc-color-button-clear-background-static-auxiliary: transparent;
|
|
270
|
+
--usewc-color-button-clear-background-hover: var(--usewc-color-gray-100);
|
|
271
|
+
--usewc-color-button-clear-background-active: var(--usewc-color-gray-200);
|
|
272
|
+
--usewc-color-button-clear-border-static: transparent;
|
|
273
|
+
--usewc-color-button-clear-border-static-auxiliary: var(--usewc-color-gray-100);
|
|
274
|
+
--usewc-color-button-clear-border-hover: transparent;
|
|
275
|
+
--usewc-color-button-clear-border-active: transparent;
|
|
276
|
+
--usewc-color-button-clear-text-static: var(--usewc-color-gray-700);
|
|
277
|
+
--usewc-color-button-clear-text-static-auxiliary: var(--usewc-color-gray-700);
|
|
278
|
+
--usewc-color-button-clear-text-hover: var(--usewc-color-gray-700);
|
|
279
|
+
--usewc-color-button-clear-text-active: var(--usewc-color-gray-700);
|
|
282
280
|
/* - Layout */
|
|
283
281
|
--usewc-layout-button-border: var(--usewc-space-1);
|
|
284
282
|
--usewc-layout-button-background-size: calc(100% + var(--usewc-layout-button-border) * 2)
|
|
@@ -361,7 +359,7 @@
|
|
|
361
359
|
--usewc-color-document-text-muted: var(--usewc-color-gray-300);
|
|
362
360
|
--usewc-color-document-background: var(--usewc-color-gray-800);
|
|
363
361
|
--usewc-color-canvas-background: var(--usewc-color-black);
|
|
364
|
-
--usewc-color-
|
|
362
|
+
--usewc-color-outline: var(--usewc-color-blue-200);
|
|
365
363
|
--usewc-color-input-background-static: oklch(from var(--usewc-color-gray-100) l c h / 0.025);
|
|
366
364
|
--usewc-color-input-border-static: var(--usewc-color-gray-600);
|
|
367
365
|
--usewc-color-input-text-static: var(--usewc-color-gray-200);
|
|
@@ -381,12 +379,12 @@
|
|
|
381
379
|
--usewc-color-button-base-border-hover: var(--usewc-color-gray-500);
|
|
382
380
|
--usewc-color-button-base-border-active: var(--usewc-color-gray-400);
|
|
383
381
|
--usewc-color-button-base-border-static-auxiliary: var(--usewc-color-gray-600);
|
|
384
|
-
--usewc-color-button-
|
|
385
|
-
--usewc-color-button-
|
|
386
|
-
--usewc-color-button-
|
|
387
|
-
--usewc-color-button-
|
|
388
|
-
--usewc-color-button-
|
|
389
|
-
--usewc-color-button-
|
|
382
|
+
--usewc-color-button-clear-text-static: var(--usewc-color-gray-200);
|
|
383
|
+
--usewc-color-button-clear-text-hover: var(--usewc-color-gray-200);
|
|
384
|
+
--usewc-color-button-clear-background-hover: var(--usewc-color-gray-700);
|
|
385
|
+
--usewc-color-button-clear-border-hover: var(--usewc-color-gray-700);
|
|
386
|
+
--usewc-color-button-clear-text-static-auxiliary: var(--usewc-color-gray-300);
|
|
387
|
+
--usewc-color-button-clear-border-static-auxiliary: var(--usewc-color-gray-600);
|
|
390
388
|
--usewc-color-button-primary-background-static: var(--usewc-color-blue-400);
|
|
391
389
|
--usewc-color-button-primary-background-hover: var(--usewc-color-blue-500);
|
|
392
390
|
--usewc-color-button-primary-background-active: var(--usewc-color-blue-600);
|
package/dist/design-system.css
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
color: var(--usewc-color-document-text);
|
|
12
12
|
background-color: var(--usewc-color-document-background);
|
|
13
13
|
font-family: var(--usewc-font-document-family);
|
|
14
|
-
font-size: var(--usewc-
|
|
14
|
+
font-size: var(--usewc-font-document-size);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:is(button, a, details summary, use-widget):not([data-appear-as="native"]):focus-visible,
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
input[type="file"]:not([data-appear-as="native"]):focus-visible,
|
|
20
20
|
use-dropdown:not([data-appear-as="native"])::part(trigger):focus-visible,
|
|
21
21
|
[data-appear-as="input"]:has(input:focus) {
|
|
22
|
-
outline: var(--usewc-
|
|
23
|
-
outline-offset: var(--usewc-
|
|
24
|
-
transition: var(--usewc-
|
|
22
|
+
outline: var(--usewc-effect-outline-size) var(--usewc-effect-outline-style) var(--usewc-color-outline);
|
|
23
|
+
outline-offset: var(--usewc-effect-outline-offset);
|
|
24
|
+
transition: var(--usewc-effect-outline-transition);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
:is(
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
|
|
55
55
|
&:is(:focus, :has(input:focus), :focus-within) {
|
|
56
56
|
border-color: var(--usewc-color-input-border-focus);
|
|
57
|
-
outline-offset: var(--usewc-
|
|
57
|
+
outline-offset: var(--usewc-effect-outline-offset-flush);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&:disabled,
|
|
61
61
|
&[aria-disabled="true"],
|
|
62
62
|
&:has(:disabled, [aria-disabled="true"]) {
|
|
63
|
-
opacity: var(--usewc-effect-
|
|
63
|
+
opacity: var(--usewc-effect-form-opacity-disabled);
|
|
64
64
|
pointer-events: none;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
&:disabled {
|
|
143
|
-
opacity: var(--usewc-effect-
|
|
143
|
+
opacity: var(--usewc-effect-form-opacity-disabled);
|
|
144
144
|
pointer-events: none;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
|
|
285
285
|
&:disabled,
|
|
286
286
|
&[aria-disabled="true"] {
|
|
287
|
-
opacity: var(--usewc-effect-
|
|
287
|
+
opacity: var(--usewc-effect-form-opacity-disabled);
|
|
288
288
|
pointer-events: none;
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -322,21 +322,21 @@
|
|
|
322
322
|
--usewc-theme-color-button-border-active: var(--usewc-color-button-danger-border-active);
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
&.
|
|
326
|
-
--usewc-theme-color-button-text-static: var(--usewc-color-button-
|
|
327
|
-
--usewc-theme-color-button-text-static-auxiliary: var(--usewc-color-button-
|
|
328
|
-
--usewc-theme-color-button-background-static: var(--usewc-color-button-
|
|
325
|
+
&.clear {
|
|
326
|
+
--usewc-theme-color-button-text-static: var(--usewc-color-button-clear-text-static);
|
|
327
|
+
--usewc-theme-color-button-text-static-auxiliary: var(--usewc-color-button-clear-text-static-auxiliary);
|
|
328
|
+
--usewc-theme-color-button-background-static: var(--usewc-color-button-clear-background-static);
|
|
329
329
|
--usewc-theme-color-button-background-static-auxiliary: var(
|
|
330
|
-
--usewc-color-button-
|
|
330
|
+
--usewc-color-button-clear-background-static-auxiliary
|
|
331
331
|
);
|
|
332
|
-
--usewc-theme-color-button-border-static: var(--usewc-color-button-
|
|
333
|
-
--usewc-theme-color-button-border-static-auxiliary: var(--usewc-color-button-
|
|
334
|
-
--usewc-theme-color-button-text-hover: var(--usewc-color-button-
|
|
335
|
-
--usewc-theme-color-button-background-hover: var(--usewc-color-button-
|
|
336
|
-
--usewc-theme-color-button-border-hover: var(--usewc-color-button-
|
|
337
|
-
--usewc-theme-color-button-text-active: var(--usewc-color-button-
|
|
338
|
-
--usewc-theme-color-button-background-active: var(--usewc-color-button-
|
|
339
|
-
--usewc-theme-color-button-border-active: var(--usewc-color-button-
|
|
332
|
+
--usewc-theme-color-button-border-static: var(--usewc-color-button-clear-border-static);
|
|
333
|
+
--usewc-theme-color-button-border-static-auxiliary: var(--usewc-color-button-clear-border-static-auxiliary);
|
|
334
|
+
--usewc-theme-color-button-text-hover: var(--usewc-color-button-clear-text-hover);
|
|
335
|
+
--usewc-theme-color-button-background-hover: var(--usewc-color-button-clear-background-hover);
|
|
336
|
+
--usewc-theme-color-button-border-hover: var(--usewc-color-button-clear-border-hover);
|
|
337
|
+
--usewc-theme-color-button-text-active: var(--usewc-color-button-clear-text-active);
|
|
338
|
+
--usewc-theme-color-button-background-active: var(--usewc-color-button-clear-background-active);
|
|
339
|
+
--usewc-theme-color-button-border-active: var(--usewc-color-button-clear-border-active);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
&.auxiliary:not(:is(:hover, :focus-visible, :active)) {
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
}
|
|
548
548
|
|
|
549
549
|
use-dropdown use-dropdown::part(trigger) {
|
|
550
|
-
background-image: var(--usewc-effect-dropdown-trigger-
|
|
550
|
+
background-image: var(--usewc-effect-dropdown-trigger-nested-background-image);
|
|
551
551
|
background-position: right center;
|
|
552
552
|
}
|
|
553
553
|
|
|
@@ -622,9 +622,9 @@
|
|
|
622
622
|
&:focus-visible,
|
|
623
623
|
&::part(trigger):focus-visible {
|
|
624
624
|
background-color: var(--usewc-color-popover-menu-item-background-static);
|
|
625
|
-
outline: var(--usewc-
|
|
626
|
-
outline-offset: var(--usewc-
|
|
627
|
-
transition: var(--usewc-
|
|
625
|
+
outline: var(--usewc-effect-outline-size) var(--usewc-effect-outline-style) var(--usewc-color-outline);
|
|
626
|
+
outline-offset: var(--usewc-effect-outline-offset-flush);
|
|
627
|
+
transition: var(--usewc-effect-outline-transition);
|
|
628
628
|
color: var(--usewc-color-popover-menu-item-text-focus);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# `use-calendarday`
|
|
2
|
+
|
|
3
|
+
A helper component for customizing specific days within `use-calendar`.
|
|
4
|
+
Content placed inside this element will replace the default day number display.
|
|
5
|
+
|
|
6
|
+
## Attributes
|
|
7
|
+
|
|
8
|
+
| Name | Type | Default | Description |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| date | `string` | - | - |
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
| Name | Type | Default | Description |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| day | - | - | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | slot for custom day content (replaces the day number) |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# `use-date-input`
|
|
2
|
+
|
|
3
|
+
Displays a date picker using segmented inputs for year, month, and day.
|
|
4
|
+
|
|
5
|
+
Uses browser locale for formatting and ARIA labels.
|
|
6
|
+
|
|
7
|
+
## Attributes
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| disabled | `boolean` | `false` | - |
|
|
12
|
+
| readonly | `boolean` | `false` | - |
|
|
13
|
+
| value | `string` | `YYYY-MM-DD` | - |
|
|
14
|
+
| lang | `string` | - | - |
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
| Name | Type | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| yearInput | `HTMLInputElement` | - | - |
|
|
21
|
+
| monthInput | `HTMLInputElement` | - | - |
|
|
22
|
+
| dayInput | `HTMLInputElement` | - | - |
|
|
23
|
+
| id | - | - | - |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `use-date-picker`
|
|
2
|
+
|
|
3
|
+
A day-granularity date picker. Value format: YYYY-MM-DD.
|
|
4
|
+
|
|
5
|
+
## Attributes
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| year | `number` | - | 1970-9999 |
|
|
10
|
+
| month | `number` | - | 1-12 |
|
|
11
|
+
| controls | `boolean` | `false` | - |
|
|
12
|
+
| navigation | `"nowrap" \| "off" \| "on"` | `"on"` | - |
|
|
13
|
+
| hiddenmonths | `string` | `""` | - |
|
|
14
|
+
| focusmode | `"cell" \| "control"` | `"cell"` | - |
|
|
15
|
+
| name | `string \| undefined` | `""` | - |
|
|
16
|
+
| min | `string \| undefined` | - | - |
|
|
17
|
+
| max | `string \| undefined` | - | - |
|
|
18
|
+
| start | `string \| undefined` | - | First date in the visible range. Accepts ISO 8601 date strings or `'min'` to use the same value as `min` |
|
|
19
|
+
| end | `string \| undefined` | - | Last date in the visible range. Accepts ISO 8601 date strings or `'max'` to use the same value as `max` |
|
|
20
|
+
| lang | `string` | - | - |
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Name | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| value | `string` | - | - |
|
|
27
|
+
| navigationEnabled | - | - | - |
|
|
28
|
+
| renderDay | `UseCalendarRenderDay` | - | - |
|
|
29
|
+
|
|
30
|
+
## Events
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| use-change | `CustomEvent` | Fired on selection with detail `{ value: string }` |
|
|
35
|
+
|
|
36
|
+
## Slots
|
|
37
|
+
|
|
38
|
+
| Name | Description |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `header-start` | Content before the title in the header |
|
|
41
|
+
| `title` | Title showing the month and year |
|
|
42
|
+
| `controls` | Navigation controls (previous, today, next buttons) |
|
|
43
|
+
| `header-end` | Content after the controls in the header |
|
|
44
|
+
| `date-{YYYY-MM-DD}` | Per-date content that replaces the default day number |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# `use-datetime-input`
|
|
2
|
+
|
|
3
|
+
Displays a date and time picker by combining `use-date` and `use-time`.
|
|
4
|
+
|
|
5
|
+
The value format is ISO 8601-like: `YYYY-MM-DDTHH:MM:SS.mmm`.
|
|
6
|
+
|
|
7
|
+
## Attributes
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| disabled | `boolean` | - | - |
|
|
12
|
+
| readonly | `boolean` | - | - |
|
|
13
|
+
| hours | `boolean` | `false` | - |
|
|
14
|
+
| minutes | `boolean` | `false` | - |
|
|
15
|
+
| seconds | `boolean` | `false` | - |
|
|
16
|
+
| fractionalSeconds | `boolean` | `false` | - |
|
|
17
|
+
| dayPeriod | `boolean` | `false` | - |
|
|
18
|
+
| hourFormat | `"12" \| "24" \| undefined` | - | - |
|
|
19
|
+
| value | `string` | `''` | - |
|
|
20
|
+
| lang | `string` | - | - |
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Name | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| dateElement | `UseDateInput` | - | - |
|
|
27
|
+
| timeElement | `UseTimeInput` | - | - |
|
|
28
|
+
| id | - | - | - |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# `use-dropdown`
|
|
2
|
+
|
|
3
|
+
When the popover is opened the tabbable elements are found and indexed for
|
|
4
|
+
keyboard navigation. The first tabbable element is focused when the popover is opened. The
|
|
5
|
+
following selector is used to find tabbable elements:
|
|
6
|
+
|
|
7
|
+
```css
|
|
8
|
+
:is(
|
|
9
|
+
[role="menuitem"],
|
|
10
|
+
[role="menuitemcheckbox"],
|
|
11
|
+
[role="menuitemradio"],
|
|
12
|
+
use-menu
|
|
13
|
+
):not(:is(
|
|
14
|
+
[disabled],
|
|
15
|
+
[hidden],
|
|
16
|
+
[inert],
|
|
17
|
+
[aria-hidden="true"]
|
|
18
|
+
))
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Menu items are not used for navigation, they are intended for related action
|
|
22
|
+
items that allows a user to manipulate a user interface or content. Read the
|
|
23
|
+
WCAG guidance for more details:
|
|
24
|
+
[https://www.w3.org/WAI/ARIA/apg/patterns/menubar/](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/)
|
|
25
|
+
|
|
26
|
+
## Attributes
|
|
27
|
+
|
|
28
|
+
| Name | Type | Default | Description |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| disabled | - | - | - |
|
|
31
|
+
| label | `string` | - | - |
|
|
32
|
+
|
|
33
|
+
## Properties
|
|
34
|
+
|
|
35
|
+
| Name | Type | Default | Description |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| trigger | `HTMLButtonElement \| null` | `null` | - |
|
|
38
|
+
|
|
39
|
+
## Slots
|
|
40
|
+
|
|
41
|
+
| Name | Description |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `default` | - |
|
|
44
|
+
| `trigger-content` | - |
|
|
45
|
+
| `trigger-label` | - |
|
|
46
|
+
| `trigger-arrow` | - |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `use-duration-input`
|
|
2
|
+
|
|
3
|
+
Displays the parts of an ISO 8601 duration string using [`Intl.DurationFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat).
|
|
4
|
+
|
|
5
|
+
Uses the [`duration-fns`](https://www.npmjs.com/package/duration-fns) library for parsing ISO 8601 values.
|
|
6
|
+
|
|
7
|
+
<baseline-status featureId="intl-duration-format"></baseline-status>
|
|
8
|
+
|
|
9
|
+
## Attributes
|
|
10
|
+
|
|
11
|
+
| Name | Type | Default | Description |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| years | `boolean` | `false` | - |
|
|
14
|
+
| months | `boolean` | `false` | - |
|
|
15
|
+
| weeks | `boolean` | `false` | - |
|
|
16
|
+
| days | `boolean` | `false` | - |
|
|
17
|
+
| hours | `boolean` | `false` | - |
|
|
18
|
+
| minutes | `boolean` | `false` | - |
|
|
19
|
+
| seconds | `boolean` | `false` | - |
|
|
20
|
+
| milliseconds | `boolean` | `false` | - |
|
|
21
|
+
| disabled | `boolean` | `false` | - |
|
|
22
|
+
| readonly | `boolean` | `false` | - |
|
|
23
|
+
| value | `string` | `PT0S` | - |
|
|
24
|
+
| format | `"long" \| "short" \| "narrow" \| "digital"` | `"short"` | - |
|
|
25
|
+
| lang | `string` | - | - |
|
|
26
|
+
|
|
27
|
+
## Properties
|
|
28
|
+
|
|
29
|
+
| Name | Type | Default | Description |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
| yearInput | `HTMLInputElement` | - | - |
|
|
32
|
+
| monthInput | `HTMLInputElement` | - | - |
|
|
33
|
+
| weekInput | `HTMLInputElement` | - | - |
|
|
34
|
+
| dayInput | `HTMLInputElement` | - | - |
|
|
35
|
+
| hourInput | `HTMLInputElement` | - | - |
|
|
36
|
+
| minuteInput | `HTMLInputElement` | - | - |
|
|
37
|
+
| secondInput | `HTMLInputElement` | - | - |
|
|
38
|
+
| millisecondInput | `HTMLInputElement` | - | - |
|
|
39
|
+
| id | - | - | - |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# `use-focusgroup`
|
|
2
|
+
|
|
3
|
+
Nested controls are removed from the tab flow until the user navigates the nested controls with arrow keys.
|
|
4
|
+
|
|
5
|
+
`use-focusgroup` is most useful for things like WYSIWYG toolbars, sets of tabs, or lists of navigation links (like a list of emails in a master detail layout).
|
|
6
|
+
|
|
7
|
+
## To do
|
|
8
|
+
|
|
9
|
+
- [ ] add `grid` navigation feature
|
|
10
|
+
- [ ] add `autofocus` attribute support
|
|
11
|
+
|
|
12
|
+
## Long term plan
|
|
13
|
+
|
|
14
|
+
This web component was built with the intent to be replaced by browser-native focusgroup support once it becomes baseline. Hopefully migration will be as simple as changing the tag name from `use-focusgroup` to `div` and the `options` attribute to `focusgroup`.
|
|
15
|
+
|
|
16
|
+
<baseline-status featureId="focusgroup_attribute"></baseline-status>
|
|
17
|
+
|
|
18
|
+
## Sources
|
|
19
|
+
|
|
20
|
+
- [Open UI focusgroup Explainer](https://open-ui.org/components/focusgroup.explainer/)
|
|
21
|
+
- [tabbable](https://www.npmjs.com/package/tabbable)
|
|
22
|
+
- [Toolbar Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/)
|
|
23
|
+
- [@gfellerph/focusgroup-polyfill](https://github.com/gfellerph/focusgroup-polyfill)
|
|
24
|
+
|
|
25
|
+
## Attributes
|
|
26
|
+
|
|
27
|
+
| Name | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| features | `string` | `""` | A list of space-separated features that can be used to customize the behavior of the focusgroup.
|
|
30
|
+
|
|
31
|
+
The following options are available:
|
|
32
|
+
|
|
33
|
+
- `inline` opts into keyboard navigation via left and right arrow keys
|
|
34
|
+
- `block` opts into keyboard navigation via up and down arrow keys
|
|
35
|
+
- `wrap` arrow navigation should wrap around when reaching the end
|
|
36
|
+
- `no-memory` whether the focusgroup should not remember the last focused element
|
|
37
|
+
|
|
38
|
+
If nothing if neither `inline` nor `block` is specified, both are assumed. |
|
|
39
|
+
|
|
40
|
+
## Properties
|
|
41
|
+
|
|
42
|
+
| Name | Type | Default | Description |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| focusedElement | `HTMLElement \| null` | `null` | The most recently focused element in the focusgroup. |
|
|
45
|
+
| promoted | - | `false` | Whether the use-focusgroup is promoted to the top of the tab order inside a parent use-focusgroup. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# `use-grid`
|
|
2
|
+
|
|
3
|
+
Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).
|
|
4
|
+
|
|
5
|
+
## Attributes
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| selectmode | `"multiple" \| "single" \| "none"` | `"none"` | - |
|
|
10
|
+
| name | `string` | `""` | - |
|
|
11
|
+
| role | `string` | `"grid"` | - |
|
|
12
|
+
| disabled | `boolean` | `false` | - |
|
|
13
|
+
| readonly | `boolean` | `false` | - |
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Name | Type | Default | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| internals | - | - | - |
|
|
20
|
+
| value | `string[] \| string \| null` | - | - |
|
|
21
|
+
|
|
22
|
+
## Slots
|
|
23
|
+
|
|
24
|
+
| Name | Description |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `` | Grid content (use-gridhead/use-gridbody rows) |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# `use-gridbody`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# `use-gridcell`
|
|
2
|
+
|
|
3
|
+
## Attributes
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Description |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| mode | `"widget" \| "action" \| "default"` | `"default"` | Determines how the cell behaves in terms of focus and interaction. The possible values are:
|
|
8
|
+
|
|
9
|
+
- `'none'` - the cell itself is focusable and it does not contain any interactive elements.
|
|
10
|
+
- `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.
|
|
11
|
+
- `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly. |
|
|
12
|
+
|
|
13
|
+
## Slots
|
|
14
|
+
|
|
15
|
+
| Name | Description |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `undefined` | - |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# `use-gridhead`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# `use-gridrow`
|
|
2
|
+
|
|
3
|
+
## Attributes
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Description |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| selected | `boolean` | `false` | - |
|
|
8
|
+
| disabled | `boolean` | `false` | - |
|
|
9
|
+
| readonly | `boolean` | `false` | - |
|
|
10
|
+
| value | `string` | `""` | - |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# `use-intl-datetime`
|
|
2
|
+
|
|
3
|
+
Displays a localized, human-readable representation of a date, time, or datetime.
|
|
4
|
+
Renders a semantic `<time>` element in its shadow root with a machine-readable
|
|
5
|
+
`datetime` attribute and formatted inner text.
|
|
6
|
+
|
|
7
|
+
Set `datestyle`, `timestyle`, or both to control what is formatted and how.
|
|
8
|
+
The presence of each attribute determines the format mode:
|
|
9
|
+
- `datestyle` only → date formatting
|
|
10
|
+
- `timestyle` only → time formatting
|
|
11
|
+
- both → date and time formatting
|
|
12
|
+
|
|
13
|
+
Locale is resolved from the nearest ancestor `[lang]` attribute, or
|
|
14
|
+
`navigator.language` if none is found. Set `lang` directly on the element to override.
|
|
15
|
+
|
|
16
|
+
## Attributes
|
|
17
|
+
|
|
18
|
+
| Name | Type | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| value | `string \| undefined` | - | ISO date/time string or Unix timestamp (ms) |
|
|
21
|
+
| datestyle | `string \| undefined` | - | Date format style: `short` \| `medium` \| `long` \| `full` |
|
|
22
|
+
| timestyle | `string \| undefined` | - | Time format style: `short` \| `medium` \| `long` \| `full` |
|
|
23
|
+
| lang | `string` | - | BCP 47 locale tag. Inherits from nearest ancestor `[lang]` if not set. |
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `use-listbox-input`
|
|
2
|
+
|
|
3
|
+
## Attributes
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Description |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| name | `string \| undefined` | - | - |
|
|
8
|
+
| placeholder | `string` | `""` | - |
|
|
9
|
+
| multiple | `boolean` | `false` | - |
|
|
10
|
+
| disabled | - | - | - |
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
| Name | Type | Default | Description |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| selected | - | - | UseOption[] |
|
|
17
|
+
| firstSelected | - | - | - |
|
|
18
|
+
| options | `Array<UseOption>` | - | - |
|
|
19
|
+
| listbox | `HTMLDivElement` | - | - |
|
|
20
|
+
| activeOption | - | - | - |
|
|
21
|
+
| value | `FormData` | - | - |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| Name | Type | Description |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| use-change | `CustomEvent` | - |
|
|
28
|
+
|
|
29
|
+
## Slots
|
|
30
|
+
|
|
31
|
+
| Name | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `default` | NodeList of `use-option` elements |
|
|
34
|
+
| `arrow` | - |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# `use-menu`
|
|
2
|
+
|
|
3
|
+
The first tabbable element is focused when the menu gains focus.
|
|
4
|
+
|
|
5
|
+
Menu is not used for navigation, it is intended for related action items that
|
|
6
|
+
allows a user to manipulate a user interface or content.
|
|
7
|
+
|
|
8
|
+
The following selector is used to find tabbable elements:
|
|
9
|
+
|
|
10
|
+
```css
|
|
11
|
+
:is(
|
|
12
|
+
[role="menuitem"],
|
|
13
|
+
[role="menuitemcheckbox"],
|
|
14
|
+
[role="menuitemradio"],
|
|
15
|
+
use-menu
|
|
16
|
+
):not(:is(
|
|
17
|
+
[disabled],
|
|
18
|
+
[hidden],
|
|
19
|
+
[inert],
|
|
20
|
+
[aria-hidden="true"]
|
|
21
|
+
))
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Attributes
|
|
25
|
+
|
|
26
|
+
| Name | Type | Default | Description |
|
|
27
|
+
| --- | --- | --- | --- |
|
|
28
|
+
| disabled | - | - | - |
|
|
29
|
+
| label | `string` | - | - |
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
| Name | Type | Default | Description |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| trigger | `HTMLButtonElement \| null` | `null` | - |
|
|
36
|
+
|
|
37
|
+
## Slots
|
|
38
|
+
|
|
39
|
+
| Name | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `default` | - |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `use-month-picker`
|
|
2
|
+
|
|
3
|
+
A standalone form-associated year-month picker.
|
|
4
|
+
Emits ISO 8601 `YYYY-MM` values.
|
|
5
|
+
|
|
6
|
+
## Attributes
|
|
7
|
+
|
|
8
|
+
| Name | Type | Default | Description |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| year | `number` | - | Year currently shown in the grid. Defaults to the current year, or the year of the initial value attribute. |
|
|
11
|
+
| min | `string` | `""` | Minimum selectable year-month in `YYYY-MM` format (inclusive). |
|
|
12
|
+
| max | `string` | `""` | Maximum selectable year-month in `YYYY-MM` format (inclusive). |
|
|
13
|
+
| navigation | `"on" \| "nowrap" \| "off"` | `"on"` | Controls keyboard navigation within the grid.
|
|
14
|
+
- `'on'` (default): navigation enabled, wraps from December → next year and January → previous year.
|
|
15
|
+
- `'nowrap'`: navigation enabled, clamps at January and December without year-crossing.
|
|
16
|
+
- `'off'`: keyboard navigation disabled entirely. |
|
|
17
|
+
| disabled | `boolean` | - | Disables all interaction. Reflected to the `:state(disabled)` CSS pseudo-class. |
|
|
18
|
+
| value | `string` | - | Selected ISO 8601 year-month (`YYYY-MM`). Empty string means no selection. |
|
|
19
|
+
| lang | `string` | - | - |
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Name | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| navigationEnabled | - | - | - |
|
|
26
|
+
| renderMonth | `UseMonthPickerRenderMonth` | - | - |
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
| Name | Type | Description |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| use-change | `CustomEvent` | Fired when the user selects a month. Detail: `{ value: string }` |
|
|
33
|
+
|
|
34
|
+
## Slots
|
|
35
|
+
|
|
36
|
+
| Name | Description |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `month-{YYYY-MM}` | Per-month content that replaces the default month name (e.g. `month-2026-03`) |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `use-option`
|
|
2
|
+
|
|
3
|
+
`use-option` is a custom element that represents an option in a `use-select-input` custom element.
|
|
4
|
+
|
|
5
|
+
The children of this element are the content of the option and must not contain any interactive elements.
|
|
6
|
+
|
|
7
|
+
## Attributes
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| selected | - | - | - |
|
|
12
|
+
| disabled | - | - | - |
|
|
13
|
+
| value | - | - | - |
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
| Name | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `selected-indicator` | - |
|
|
20
|
+
| `undefined` | - |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# `use-scrollarea`
|
|
2
|
+
|
|
3
|
+
A scroll container that exposes custom states for scroll edge detection.
|
|
4
|
+
|
|
5
|
+
## Custom States
|
|
6
|
+
The following CSS custom states are available for styling:
|
|
7
|
+
|
|
8
|
+
- `:state(at-block-start)` — scrolled to the block-start edge (top in horizontal writing modes)
|
|
9
|
+
- `:state(at-block-end)` — scrolled to the block-end edge (bottom in horizontal writing modes)
|
|
10
|
+
- `:state(at-inline-start)` — scrolled to the inline-start edge (left in LTR)
|
|
11
|
+
- `:state(at-inline-end)` — scrolled to the inline-end edge (right in LTR)
|
|
12
|
+
|
|
13
|
+
## Slots
|
|
14
|
+
|
|
15
|
+
| Name | Description |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `` | Scrollable content |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `use-select-input`
|
|
2
|
+
|
|
3
|
+
## Multiple
|
|
4
|
+
|
|
5
|
+
The `use-listbox-input` provides an attribute for selecting multiple options.
|
|
6
|
+
|
|
7
|
+
## Long term plan
|
|
8
|
+
|
|
9
|
+
This web component was built with the intent to be replaced by browser-native `base-select` support once it becomes baseline.
|
|
10
|
+
|
|
11
|
+
<baseline-status featureId="customizable-select"></baseline-status>
|
|
12
|
+
|
|
13
|
+
## Attributes
|
|
14
|
+
|
|
15
|
+
| Name | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| name | `string \| undefined` | - | - |
|
|
18
|
+
| placeholder | `string` | `""` | - |
|
|
19
|
+
| disabled | - | - | - |
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Name | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| selected | - | - | - |
|
|
26
|
+
| firstSelected | - | - | - |
|
|
27
|
+
| options | `Array<UseOption>` | - | - |
|
|
28
|
+
| trigger | `HTMLButtonElement \| null` | `null` | - |
|
|
29
|
+
| label | `HTMLSpanElement` | - | - |
|
|
30
|
+
| activeOption | - | - | - |
|
|
31
|
+
| value | `FormData` | - | - |
|
|
32
|
+
|
|
33
|
+
## Slots
|
|
34
|
+
|
|
35
|
+
| Name | Description |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `default` | NodeList of `use-option` elements |
|
|
38
|
+
| `arrow` | - |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `use-time-input`
|
|
2
|
+
|
|
3
|
+
Displays time picker using [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
|
|
4
|
+
|
|
5
|
+
Allows users to pick time values with proper localization and formatting.
|
|
6
|
+
|
|
7
|
+
## Attributes
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| hours | `boolean` | `false` | - |
|
|
12
|
+
| minutes | `boolean` | `false` | - |
|
|
13
|
+
| seconds | `boolean` | `false` | - |
|
|
14
|
+
| fractionalSeconds | `boolean` | `false` | - |
|
|
15
|
+
| dayPeriod | `boolean` | `false` | - |
|
|
16
|
+
| hourFormat | `"12" \| "24" \| undefined` | - | - |
|
|
17
|
+
| disabled | `boolean` | `false` | - |
|
|
18
|
+
| readonly | `boolean` | `false` | - |
|
|
19
|
+
| value | `string` | `00:00:00` | - |
|
|
20
|
+
| format | `"long" \| "short" \| "narrow" \| "digital"` | `"long"` | - |
|
|
21
|
+
| lang | `string` | - | - |
|
|
22
|
+
|
|
23
|
+
## Properties
|
|
24
|
+
|
|
25
|
+
| Name | Type | Default | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| id | - | - | - |
|
|
28
|
+
| hourInput | `HTMLInputElement` | - | - |
|
|
29
|
+
| minuteInput | `HTMLInputElement` | - | - |
|
|
30
|
+
| secondInput | `HTMLInputElement` | - | - |
|
|
31
|
+
| fractionalSecondInput | `HTMLInputElement` | - | - |
|
|
32
|
+
| dayPeriodInput | `HTMLInputElement` | - | - |
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
|
|
36
|
+
| Name | Type | Description |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| input | `Event` | - |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `use-tree`
|
|
2
|
+
|
|
3
|
+
Custom input control for managing selected values in a hierarchy.
|
|
4
|
+
|
|
5
|
+
## Attributes
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| name | `string \| undefined` | - | - |
|
|
10
|
+
| multiple | `boolean` | `false` | - |
|
|
11
|
+
| disabled | - | - | - |
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Name | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| selected | - | - | UseTreeItem[] |
|
|
18
|
+
| firstSelected | - | - | - |
|
|
19
|
+
| items | `Array<UseTreeitem>` | - | - |
|
|
20
|
+
| tree | `HTMLDivElement` | - | - |
|
|
21
|
+
| lazyItems | `Array<UseTreeitem>` | `[]` | - |
|
|
22
|
+
| activeOption | - | - | - |
|
|
23
|
+
| value | `FormData` | - | - |
|
|
24
|
+
|
|
25
|
+
## Slots
|
|
26
|
+
|
|
27
|
+
| Name | Description |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `default` | NodeList of `use-treeitem` elements |
|
|
30
|
+
| `arrow` | - |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# `use-treeitem`
|
|
2
|
+
|
|
3
|
+
`use-option` is a custom element that represents an option in a `use-select-input` custom element.
|
|
4
|
+
|
|
5
|
+
The children of this element are the content of the option and must not contain any interactive elements.
|
|
6
|
+
|
|
7
|
+
## To Do
|
|
8
|
+
|
|
9
|
+
- [ ] When the parent is no longer disabled, update the items without their own `[disabled]`
|
|
10
|
+
|
|
11
|
+
## Attributes
|
|
12
|
+
|
|
13
|
+
| Name | Type | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| selected | - | - | - |
|
|
16
|
+
| disabled | - | - | - |
|
|
17
|
+
| expanded | - | - | - |
|
|
18
|
+
| value | - | - | - |
|
|
19
|
+
|
|
20
|
+
## Slots
|
|
21
|
+
|
|
22
|
+
| Name | Description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `selected-indicator` | - |
|
|
25
|
+
| `undefined` | - |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `use-week-picker`
|
|
2
|
+
|
|
3
|
+
A week-granularity date picker. Value format: YYYY-Www (ISO 8601 week).
|
|
4
|
+
|
|
5
|
+
## Attributes
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| year | `number` | - | 1970-9999 |
|
|
10
|
+
| month | `number` | - | 1-12 |
|
|
11
|
+
| controls | `boolean` | `false` | - |
|
|
12
|
+
| navigation | `"nowrap" \| "off" \| "on"` | `"on"` | - |
|
|
13
|
+
| hiddenmonths | `string` | `""` | - |
|
|
14
|
+
| focusmode | `"cell" \| "control"` | `"cell"` | - |
|
|
15
|
+
| name | `string \| undefined` | `""` | - |
|
|
16
|
+
| min | `string \| undefined` | - | - |
|
|
17
|
+
| max | `string \| undefined` | - | - |
|
|
18
|
+
| start | `string \| undefined` | - | First date in the visible range. Accepts ISO 8601 date strings or `'min'` to use the same value as `min` |
|
|
19
|
+
| end | `string \| undefined` | - | Last date in the visible range. Accepts ISO 8601 date strings or `'max'` to use the same value as `max` |
|
|
20
|
+
| lang | `string` | - | - |
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Name | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| value | `string` | - | - |
|
|
27
|
+
| navigationEnabled | - | - | - |
|
|
28
|
+
| renderDay | `UseCalendarRenderDay` | - | - |
|
|
29
|
+
|
|
30
|
+
## Events
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| use-change | `CustomEvent` | Fired on selection with detail `{ value: string; dates: string[] }` |
|
|
35
|
+
|
|
36
|
+
## Slots
|
|
37
|
+
|
|
38
|
+
| Name | Description |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `header-start` | Content before the title in the header |
|
|
41
|
+
| `title` | Title showing the month and year |
|
|
42
|
+
| `controls` | Navigation controls (previous, today, next buttons) |
|
|
43
|
+
| `header-end` | Content after the controls in the header |
|
|
44
|
+
| `date-{YYYY-MM-DD}` | Per-date content that replaces the default day number |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# `use-widget`
|
|
2
|
+
|
|
3
|
+
Nested controls are removed from the tab flow until the user activates the widget with `Enter` or `F2`. Clicking on a control will also activate the widget. Widgets are deactivated with `Escape` or `F2` keys or when the user clicks outside of the widget.
|
|
4
|
+
|
|
5
|
+
`use-widget` can be used for easily navigating customizable dashboard widgets that contain multiple interactive elements. It can also be used for table and grid cells that contain multiple interactive elements, as described in the [WCAG Grid Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).
|
|
6
|
+
|
|
7
|
+
## To do
|
|
8
|
+
|
|
9
|
+
- [ ] Convert to a standard web component instead of LitElement
|
|
10
|
+
- [ ] implement Arrow Key navigation for tabbable elements when activated
|
|
11
|
+
|
|
12
|
+
## Sources
|
|
13
|
+
|
|
14
|
+
- [tabbable](https://www.npmjs.com/package/tabbable)
|
|
15
|
+
- [Grid (Interactive Tabular Data and Layout Containers) Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)
|
|
16
|
+
|
|
17
|
+
## Slots
|
|
18
|
+
|
|
19
|
+
| Name | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `undefined` | - |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-wc",
|
|
3
|
-
"version": "1.0.0-pre.
|
|
3
|
+
"version": "1.0.0-pre.39",
|
|
4
4
|
"private": false,
|
|
5
5
|
"homepage": "https://usewc.com",
|
|
6
6
|
"bugs": "https://github.com/dang-rabbits/use-wc/issues",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
"./package.json": "./package.json"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"pack": "tsc && vp run analyze && vp pack",
|
|
26
|
+
"pack": "tsc && vp run analyze && vp pack && vp run generate-docs",
|
|
27
27
|
"preview": "vp preview",
|
|
28
28
|
"analyze": "custom-elements-manifest analyze",
|
|
29
|
+
"generate-docs": "node scripts/generate-docs.mjs",
|
|
29
30
|
"storybook": "storybook dev -p ${PORT:-6006}",
|
|
30
31
|
"build": "vp run pack && storybook build",
|
|
31
32
|
"test": "vp test",
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
3
3
|
"version": 1.1,
|
|
4
4
|
"tags": [
|
|
5
|
-
{
|
|
6
|
-
"name": "use-calendarday",
|
|
7
|
-
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.\n---\n\n\n### **Slots:**\n - **default** - slot for custom day content (replaces the day number)",
|
|
8
|
-
"attributes": [{ "name": "date", "values": [] }],
|
|
9
|
-
"references": []
|
|
10
|
-
},
|
|
11
5
|
{
|
|
12
6
|
"name": "use-date-input",
|
|
13
7
|
"description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.\n---\n",
|
|
@@ -19,6 +13,12 @@
|
|
|
19
13
|
],
|
|
20
14
|
"references": []
|
|
21
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"name": "use-calendarday",
|
|
18
|
+
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.\n---\n\n\n### **Slots:**\n - **default** - slot for custom day content (replaces the day number)",
|
|
19
|
+
"attributes": [{ "name": "date", "values": [] }],
|
|
20
|
+
"references": []
|
|
21
|
+
},
|
|
22
22
|
{
|
|
23
23
|
"name": "use-date-picker",
|
|
24
24
|
"description": "A day-granularity date picker. Value format: YYYY-MM-DD.\n---\n\n\n### **Events:**\n - **use-change** - Fired on selection with detail `{ value: string }`\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",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "use-grid",
|
|
126
|
-
"description": "Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).\n
|
|
126
|
+
"description": "Accessible grid component following [WAI-ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).\n---\n\n\n### **Slots:**\n - _default_ - Grid content (use-gridhead/use-gridbody rows)",
|
|
127
127
|
"attributes": [
|
|
128
128
|
{
|
|
129
129
|
"name": "selectmode",
|
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
"attributes": [
|
|
153
153
|
{
|
|
154
154
|
"name": "mode",
|
|
155
|
+
"description": "Determines how the cell behaves in terms of focus and interaction. The possible values are:\n\n- `'none'` - the cell itself is focusable and it does not contain any interactive elements.\n- `'widget'` - the cell itself is focusable and it contains more than one interactive element. To access the interactive elements, the user must press `Enter` or `F2`, and to restore focus to the cell, the user must press `Esc` or `F2`.\n- `'action'` - the cell itself is not focusable and it contains a single interactive element. The user can tab to the interactive elements directly.",
|
|
155
156
|
"values": [
|
|
156
157
|
{ "name": "widget" },
|
|
157
158
|
{ "name": "action" },
|