@fusion.dev/helix-headless 0.147.0 → 0.149.0
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 +11222 -2332
- package/dist/accordion/item/accordion-item.d.ts +5 -2
- package/dist/accordion/item/accordion-item.js +11 -7
- package/dist/accordion/root/accordion-root.js +4 -6
- package/dist/announcement/root/announcement-root.d.ts +61 -5
- package/dist/announcement/root/announcement-root.js +126 -20
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +21 -9
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +19 -0
- package/dist/badge/count.js +20 -0
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +8 -22
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/blockquote/root/blockquote-root.d.ts +66 -8
- package/dist/blockquote/root/blockquote-root.js +85 -8
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/arrows.d.ts +14 -0
- package/dist/button-group/arrows.js +10 -0
- package/dist/button-group/root/button-group-root.d.ts +144 -3
- package/dist/button-group/root/button-group-root.js +142 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/edge-pan.d.ts +61 -0
- package/dist/canvas/edge-pan.js +63 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.d.ts +12 -2
- package/dist/canvas/node/canvas-node.js +8 -3
- package/dist/canvas/root/canvas-document.d.ts +10 -0
- package/dist/canvas/root/canvas-document.js +1 -0
- package/dist/canvas/root/canvas-root.d.ts +168 -9
- package/dist/canvas/root/canvas-root.js +239 -69
- package/dist/canvas/snap.d.ts +42 -0
- package/dist/canvas/snap.js +32 -0
- package/dist/carousel/root/carousel-root.d.ts +9 -3
- package/dist/carousel/root/carousel-root.js +17 -10
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +40 -4
- package/dist/chat/root/chat-root.js +38 -14
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
- package/dist/checkbox-group/select-all.d.ts +11 -0
- package/dist/checkbox-group/select-all.js +5 -0
- package/dist/code-block/root/code-block-root.d.ts +20 -8
- package/dist/code-block/root/code-block-root.js +16 -5
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +52 -24
- package/dist/color-picker/wheel.d.ts +11 -0
- package/dist/color-picker/wheel.js +9 -0
- package/dist/combobox/root/combobox-root.d.ts +106 -18
- package/dist/combobox/root/combobox-root.js +101 -26
- package/dist/command/root/command-root.d.ts +19 -9
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +284 -161
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/description-list/item/description-list-item.d.ts +4 -0
- package/dist/description-list/item/description-list-item.js +7 -1
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/divider/root/divider-root.d.ts +45 -16
- package/dist/divider/root/divider-root.js +28 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/item/drilldown-item.js +3 -4
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +26 -3
- package/dist/empty/root/empty-root.d.ts +17 -3
- package/dist/empty/root/empty-root.js +29 -5
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -18
- package/dist/file-input/status.js +2 -1
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +7 -3
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/fields.d.ts +20 -0
- package/dist/format-date/fields.js +14 -0
- package/dist/format-date/options.d.ts +2 -1
- package/dist/format-date/options.js +9 -38
- package/dist/format-date/root/format-date-root.d.ts +55 -5
- package/dist/format-date/root/format-date-root.js +29 -34
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +101 -14
- package/dist/graph/root/graph-root.js +140 -46
- package/dist/heatmap/root/heatmap-root.d.ts +37 -4
- package/dist/heatmap/root/heatmap-root.js +51 -16
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/image/root/image-root.d.ts +11 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/kbd/root/kbd-root.js +1 -2
- package/dist/legend/root/legend-root.js +4 -17
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +119 -23
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +185 -33
- package/dist/listbox/root/listbox-root.js +166 -136
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +18 -2
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +73 -16
- package/dist/map/root/map-root.js +122 -44
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/megamenu/root/megamenu-root.js +4 -11
- package/dist/menu/root/menu-root.d.ts +7 -2
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +7 -8
- package/dist/notifications/group/notification-group.d.ts +8 -1
- package/dist/notifications/group/notification-group.js +12 -6
- package/dist/notifications/notification/notification.d.ts +17 -1
- package/dist/notifications/notification/notification.js +6 -2
- package/dist/notifications/root/notifications-root.d.ts +49 -5
- package/dist/notifications/root/notifications-root.js +36 -8
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
- package/dist/object-inspector/root/object-inspector-root.js +41 -30
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +8 -3
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +23 -0
- package/dist/pin-input/code.js +21 -0
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +13 -23
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +26 -5
- package/dist/qr-code/root/qr-code-root.js +27 -6
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/measures.d.ts +22 -0
- package/dist/scatter-chart/measures.js +11 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
- package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
- package/dist/select/root/select-root.d.ts +67 -8
- package/dist/select/root/select-root.js +45 -11
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
- package/dist/speed-dial/group/speed-dial-group.js +43 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
- package/dist/speed-dial/item/speed-dial-item.js +41 -3
- package/dist/speed-dial/long-press.d.ts +50 -0
- package/dist/speed-dial/long-press.js +48 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
- package/dist/speed-dial/root/speed-dial-root.js +117 -5
- package/dist/splitter/root/splitter-root.d.ts +12 -3
- package/dist/splitter/root/splitter-root.js +22 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/cell/table-cell.d.ts +8 -1
- package/dist/table/cell/table-cell.js +6 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +122 -0
- package/dist/table/grid-controller.js +299 -0
- package/dist/table/root/table-root.d.ts +154 -8
- package/dist/table/root/table-root.js +197 -38
- package/dist/table/row/table-row.d.ts +55 -1
- package/dist/table/row/table-row.js +60 -7
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +8 -15
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +16 -7
- package/dist/time-picker/root/time-picker-root.js +28 -12
- package/dist/toast/item/toast-item.d.ts +13 -3
- package/dist/toast/item/toast-item.js +2 -0
- package/dist/toast/root/toast-root.d.ts +22 -2
- package/dist/toast/root/toast-root.js +24 -17
- package/dist/toggle/group/toggle-group.js +3 -5
- package/dist/toolbar/root/toolbar-root.d.ts +36 -0
- package/dist/toolbar/root/toolbar-root.js +43 -9
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tooltip/root/tooltip-root.js +1 -2
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +23 -3
- package/dist/video/root/video-root.js +56 -15
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +10 -19
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +6005 -2114
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1594 -676
- package/types/words.d.ts +3280 -0
- package/dist/kbd/keys.d.ts +0 -29
- package/dist/kbd/keys.js +0 -52
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
- package/dist/tooltip/focus-target.d.ts +0 -6
- package/dist/tooltip/focus-target.js +0 -9
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, colorName, customElement,
|
|
7
|
+
import { AriaForwardController, colorName, customElement, formatWords, HelixFormElement, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerField, parseColor, toCss, words, wordsConverter, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { html } from 'lit/static-html.js';
|
|
@@ -24,6 +24,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
24
24
|
this.readOnly = false;
|
|
25
25
|
this.announcesInput = true;
|
|
26
26
|
this.swatches = '';
|
|
27
|
+
this.swatchLabel = '{name} {value}';
|
|
27
28
|
this.triggerLabel = 'Choose a color';
|
|
28
29
|
this.wheel = false;
|
|
29
30
|
this.settled = '';
|
|
@@ -55,6 +56,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
55
56
|
this.requestOpen(true);
|
|
56
57
|
};
|
|
57
58
|
}
|
|
59
|
+
static { this.words = 'helix-color-input'; }
|
|
58
60
|
requestValue(next) {
|
|
59
61
|
if (this.readOnly) {
|
|
60
62
|
return false;
|
|
@@ -70,6 +72,11 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
70
72
|
get anchor() {
|
|
71
73
|
return this.control ?? this.partNamed('trigger');
|
|
72
74
|
}
|
|
75
|
+
renderSwatchValue() {
|
|
76
|
+
return this.variant === 'swatch'
|
|
77
|
+
? html `<span id="swatch-value" hidden>${this.swatchWords}</span>`
|
|
78
|
+
: nothing;
|
|
79
|
+
}
|
|
73
80
|
get picked() {
|
|
74
81
|
return parseColor(this.value) ? this.value : this.settled;
|
|
75
82
|
}
|
|
@@ -78,7 +85,10 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
78
85
|
if (!parsed) {
|
|
79
86
|
return this.value || this.triggerLabel;
|
|
80
87
|
}
|
|
81
|
-
return
|
|
88
|
+
return formatWords(this, 'swatchLabel', {
|
|
89
|
+
name: colorName(parsed, this.colorWords, wordsLocale(this)),
|
|
90
|
+
value: this.value,
|
|
91
|
+
});
|
|
82
92
|
}
|
|
83
93
|
get painted() {
|
|
84
94
|
const parsed = parseColor(this.value);
|
|
@@ -199,9 +209,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
199
209
|
style="--color-input-swatch: ${this.value === '' ? 'transparent' : this.painted}"
|
|
200
210
|
></span>
|
|
201
211
|
<slot name="trigger"></slot>
|
|
202
|
-
${this.
|
|
203
|
-
? html `<span id="swatch-value" hidden>${this.swatchWords}</span>`
|
|
204
|
-
: nothing}
|
|
212
|
+
${this.renderSwatchValue()}
|
|
205
213
|
</button>
|
|
206
214
|
</div>
|
|
207
215
|
|
|
@@ -249,6 +257,11 @@ __decorate([
|
|
|
249
257
|
property()
|
|
250
258
|
], HelixHeadlessColorInput.prototype, "swatches", void 0);
|
|
251
259
|
__decorate([
|
|
260
|
+
words,
|
|
261
|
+
property({ attribute: 'swatch-label' })
|
|
262
|
+
], HelixHeadlessColorInput.prototype, "swatchLabel", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
words,
|
|
252
265
|
property({ attribute: 'trigger-label' })
|
|
253
266
|
], HelixHeadlessColorInput.prototype, "triggerLabel", void 0);
|
|
254
267
|
__decorate([
|
|
@@ -103,6 +103,11 @@ declare const HelixHeadlessColorPicker_base: (new (...args: any[]) => import("@f
|
|
|
103
103
|
* @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
|
|
104
104
|
*/
|
|
105
105
|
export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_base {
|
|
106
|
+
/**
|
|
107
|
+
* The key this family's words are registered under, its styled tag:
|
|
108
|
+
* `registerWords('de', { 'helix-color-picker': { hueLabel: 'Farbton' } })`.
|
|
109
|
+
*/
|
|
110
|
+
static words: string;
|
|
106
111
|
/**
|
|
107
112
|
* Whether the color carries an alpha channel.
|
|
108
113
|
*
|
|
@@ -122,7 +127,7 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
122
127
|
/**
|
|
123
128
|
* The message shown when the value is text that is not a color.
|
|
124
129
|
*/
|
|
125
|
-
badInputMessage
|
|
130
|
+
badInputMessage: string;
|
|
126
131
|
/**
|
|
127
132
|
* What the blue channel's field is called, in `channel-fields`.
|
|
128
133
|
*/
|
|
@@ -288,6 +293,16 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
288
293
|
* What the square's horizontal ramp is called.
|
|
289
294
|
*/
|
|
290
295
|
saturationLabel: string;
|
|
296
|
+
/**
|
|
297
|
+
* What a screen reader hears for the square's place, the color's two
|
|
298
|
+
* numbers and its name, on whichever of its two inputs it is on.
|
|
299
|
+
* `{first}` is `saturation` or `brightness`, the input's own channel, which
|
|
300
|
+
* is said first, so each order is its whole sentence. `{saturation}` and
|
|
301
|
+
* `{brightness}` are shares from 0 to 1, written as percentages with
|
|
302
|
+
* `number, percent`, `{saturationLabel}` and `{brightnessLabel}` the
|
|
303
|
+
* channels' names, and `{name}` the color's, such as "vibrant red".
|
|
304
|
+
*/
|
|
305
|
+
squareText: string;
|
|
291
306
|
/**
|
|
292
307
|
* Colors offered under the picker, as a comma-separated list.
|
|
293
308
|
*/
|
|
@@ -305,9 +320,10 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
305
320
|
*
|
|
306
321
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
307
322
|
* named for the validity flag it reports, so a form in another language
|
|
308
|
-
* speaks it.
|
|
323
|
+
* speaks it. Unset is the sentence registered for the page's language, then
|
|
324
|
+
* the English.
|
|
309
325
|
*/
|
|
310
|
-
valueMissingMessage
|
|
326
|
+
valueMissingMessage: string;
|
|
311
327
|
/**
|
|
312
328
|
* Draws the hue as a wheel around the square, in place of the hue ramp, as
|
|
313
329
|
* React Aria's ColorWheel sits round its ColorArea.
|
|
@@ -4,14 +4,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { CopyController, capturePointer, clamp, colorName, customElement, drawIcon,
|
|
7
|
+
import { CopyController, capturePointer, clamp, colorName, customElement, drawIcon, focusItemOf, formatColor, formatNumber, formatWords, HelixFormElement, HelixSampleEndEvent, HelixSampleStartEvent, hostAria, hueName, isRtl, KeyboardNavigationController, MixinControllerValue, MixinPickerFeedback, parseColor, rovingStop, splitValues, toCss, words, wordsConverter, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { eyedropper } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { live } from 'lit/directives/live.js';
|
|
12
12
|
import { html } from 'lit/static-html.js';
|
|
13
13
|
import { channelFields, writeChannel } from '../channels.js';
|
|
14
|
-
import { hueAt } from '../wheel.js';
|
|
14
|
+
import { areaAt, hueAt } from '../wheel.js';
|
|
15
15
|
import '../../button/index.js';
|
|
16
16
|
import '../../button-group/index.js';
|
|
17
17
|
import '../../slider/index.js';
|
|
@@ -22,6 +22,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this.alpha = false;
|
|
24
24
|
this.autocomplete = 'off';
|
|
25
|
+
this.badInputMessage = 'Enter a color, like #ff0000, rgb(255 0 0) or hsl(0 100% 50%).';
|
|
25
26
|
this.blueLabel = 'Blue';
|
|
26
27
|
this.brightnessLabel = 'Brightness';
|
|
27
28
|
this.channelFields = false;
|
|
@@ -42,9 +43,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
42
43
|
this.redLabel = 'Red';
|
|
43
44
|
this.required = false;
|
|
44
45
|
this.saturationLabel = 'Saturation';
|
|
46
|
+
this.squareText = '{first, select, brightness {{brightnessLabel} {brightness, number, percent}, {saturationLabel} {saturation, number, percent}, {name}} other {{saturationLabel} {saturation, number, percent}, {brightnessLabel} {brightness, number, percent}, {name}}}';
|
|
45
47
|
this.swatches = '';
|
|
46
48
|
this.toolsLabel = 'Color tools';
|
|
47
49
|
this.valueLabel = 'Color';
|
|
50
|
+
this.valueMissingMessage = 'Choose a color.';
|
|
48
51
|
this.wheel = false;
|
|
49
52
|
this.sampling = false;
|
|
50
53
|
this.owned = false;
|
|
@@ -99,15 +102,12 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
99
102
|
items: () => [
|
|
100
103
|
...(this.renderRoot?.querySelectorAll('[part="swatches"] [part="swatch"]') ??
|
|
101
104
|
[]),
|
|
102
|
-
].map((swatch, index) => ({
|
|
103
|
-
|
|
104
|
-
disabled: false,
|
|
105
|
-
focusItem: () => {
|
|
105
|
+
].map((swatch, index) => focusItemOf(swatch, {
|
|
106
|
+
focus: () => {
|
|
106
107
|
this.swatchAt = index;
|
|
107
108
|
swatch.focus();
|
|
108
109
|
},
|
|
109
|
-
|
|
110
|
-
selected: false,
|
|
110
|
+
owns: (node) => node === swatch,
|
|
111
111
|
})),
|
|
112
112
|
origin: 'focus',
|
|
113
113
|
selects: () => false,
|
|
@@ -165,10 +165,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
165
165
|
if (box.width === 0 || box.height === 0) {
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
const across = isRtl(grid) ? 1 - fromLeft : fromLeft;
|
|
170
|
-
const down = Math.min(1, Math.max(0, (event.clientY - box.top) / box.height));
|
|
171
|
-
this.move({ brightness: Math.round((1 - down) * 100), saturation: Math.round(across * 100) });
|
|
168
|
+
this.move(areaAt(event.clientX, event.clientY, box, isRtl(grid)));
|
|
172
169
|
};
|
|
173
170
|
this.handleWheelPointer = (event) => {
|
|
174
171
|
const wheel = event.currentTarget;
|
|
@@ -234,6 +231,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
234
231
|
event.stopPropagation();
|
|
235
232
|
};
|
|
236
233
|
}
|
|
234
|
+
static { this.words = 'helix-color-picker'; }
|
|
237
235
|
settle() {
|
|
238
236
|
if (this.unsettled) {
|
|
239
237
|
this.unsettled = false;
|
|
@@ -270,11 +268,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
270
268
|
}
|
|
271
269
|
reportRequired() {
|
|
272
270
|
if (this.required && this.value === '') {
|
|
273
|
-
this.internals.setValidity({ valueMissing: true }, this.valueMissingMessage
|
|
271
|
+
this.internals.setValidity({ valueMissing: true }, this.valueMissingMessage, this.partNamed('grid') ?? undefined);
|
|
274
272
|
return;
|
|
275
273
|
}
|
|
276
274
|
if (this.value !== '' && parseColor(this.value) === null) {
|
|
277
|
-
this.internals.setValidity({ badInput: true }, this.badInputMessage
|
|
275
|
+
this.internals.setValidity({ badInput: true }, this.badInputMessage, this.partNamed('value') ?? this.partNamed('grid') ?? undefined);
|
|
278
276
|
return;
|
|
279
277
|
}
|
|
280
278
|
this.internals.setValidity({});
|
|
@@ -416,7 +414,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
416
414
|
: html `<${this.tag('button')}
|
|
417
415
|
part="format"
|
|
418
416
|
exportparts="button: format-button, live: format-live, spinner: format-spinner, text: format-text"
|
|
419
|
-
label=${
|
|
417
|
+
label=${formatWords(this, 'formatLabel', { format: this.format ?? 'hex' })}
|
|
420
418
|
?disabled=${this.isDisabled}
|
|
421
419
|
@click=${this.handleFormat}
|
|
422
420
|
>
|
|
@@ -445,7 +443,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
445
443
|
type="button"
|
|
446
444
|
role="option"
|
|
447
445
|
tabindex=${index === stop ? '0' : '-1'}
|
|
448
|
-
aria-label=${parsed ? colorName(parsed, this.colorWords,
|
|
446
|
+
aria-label=${parsed ? colorName(parsed, this.colorWords, wordsLocale(this)) : preset}
|
|
449
447
|
aria-selected=${chosen[index] ? 'true' : 'false'}
|
|
450
448
|
style="--color-picker-swatch: ${preset}"
|
|
451
449
|
?disabled=${this.isDisabled}
|
|
@@ -460,10 +458,19 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
460
458
|
render() {
|
|
461
459
|
const color = this.color;
|
|
462
460
|
const painted = toCss(color);
|
|
463
|
-
const
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
461
|
+
const locale = wordsLocale(this);
|
|
462
|
+
const square = (first) => formatWords(this, 'squareText', {
|
|
463
|
+
brightness: color.brightness / 100,
|
|
464
|
+
brightnessLabel: this.brightnessLabel,
|
|
465
|
+
first,
|
|
466
|
+
name: colorName(color, this.colorWords, locale),
|
|
467
|
+
saturation: color.saturation / 100,
|
|
468
|
+
saturationLabel: this.saturationLabel,
|
|
469
|
+
});
|
|
470
|
+
const both = square('saturation');
|
|
471
|
+
const reversed = square('brightness');
|
|
472
|
+
const hue = hueName({ alpha: 100, brightness: 100, hue: color.hue, saturation: 100 }, this.colorWords, locale);
|
|
473
|
+
const hueSaid = (value) => new Intl.ListFormat(locale, { style: 'short', type: 'unit' }).format([String(value), hue]);
|
|
467
474
|
const owner = this.getAttribute('aria-label')?.trim();
|
|
468
475
|
const axisName = (channel) => (owner ? `${owner}, ${channel}` : channel);
|
|
469
476
|
const area = html `<div
|
|
@@ -524,7 +531,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
524
531
|
dir="ltr"
|
|
525
532
|
aria-label=${axisName(this.hueLabel)}
|
|
526
533
|
aria-describedby=${this.feedback === '' ? nothing : 'feedback'}
|
|
527
|
-
aria-valuetext=${
|
|
534
|
+
aria-valuetext=${hueSaid(color.hue)}
|
|
528
535
|
aria-invalid=${this.marked ? 'true' : nothing}
|
|
529
536
|
.value=${String(color.hue)}
|
|
530
537
|
?disabled=${this.isDisabled}
|
|
@@ -541,15 +548,15 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
|
|
|
541
548
|
type="button"
|
|
542
549
|
aria-label=${this.copier.copied
|
|
543
550
|
? this.copiedLabel
|
|
544
|
-
:
|
|
551
|
+
: formatWords(this, 'copyLabel', { value: this.value }).trim()}
|
|
545
552
|
data-copied=${this.copier.copied ? '' : nothing}
|
|
546
553
|
?disabled=${this.isDisabled || this.value === ''}
|
|
547
554
|
@click=${() => this.copier.copy(this.value)}
|
|
548
555
|
></button>
|
|
549
556
|
<div part="channels">
|
|
550
|
-
${this.wheel ? nothing : this.renderChannel('hue', this.hueLabel, 360, color.hue,
|
|
557
|
+
${this.wheel ? nothing : this.renderChannel('hue', this.hueLabel, 360, color.hue, hueSaid('{value}'))}
|
|
551
558
|
${this.alpha
|
|
552
|
-
? this.renderChannel('alpha', this.opacityLabel, 100, color.alpha, formatNumber(color.alpha / 100,
|
|
559
|
+
? this.renderChannel('alpha', this.opacityLabel, 100, color.alpha, formatNumber(color.alpha / 100, locale, { style: 'percent' }))
|
|
553
560
|
: nothing}
|
|
554
561
|
</div>
|
|
555
562
|
</div>
|
|
@@ -593,12 +600,15 @@ __decorate([
|
|
|
593
600
|
property()
|
|
594
601
|
], HelixHeadlessColorPicker.prototype, "autocomplete", void 0);
|
|
595
602
|
__decorate([
|
|
603
|
+
words,
|
|
596
604
|
property({ attribute: 'bad-input-message' })
|
|
597
605
|
], HelixHeadlessColorPicker.prototype, "badInputMessage", void 0);
|
|
598
606
|
__decorate([
|
|
607
|
+
words,
|
|
599
608
|
property({ attribute: 'blue-label' })
|
|
600
609
|
], HelixHeadlessColorPicker.prototype, "blueLabel", void 0);
|
|
601
610
|
__decorate([
|
|
611
|
+
words,
|
|
602
612
|
property({ attribute: 'brightness-label' })
|
|
603
613
|
], HelixHeadlessColorPicker.prototype, "brightnessLabel", void 0);
|
|
604
614
|
__decorate([
|
|
@@ -608,27 +618,34 @@ __decorate([
|
|
|
608
618
|
property({ attribute: 'color-words', converter: wordsConverter })
|
|
609
619
|
], HelixHeadlessColorPicker.prototype, "colorWords", void 0);
|
|
610
620
|
__decorate([
|
|
621
|
+
words,
|
|
611
622
|
property({ attribute: 'copied-label' })
|
|
612
623
|
], HelixHeadlessColorPicker.prototype, "copiedLabel", void 0);
|
|
613
624
|
__decorate([
|
|
625
|
+
words,
|
|
614
626
|
property({ attribute: 'copy-label' })
|
|
615
627
|
], HelixHeadlessColorPicker.prototype, "copyLabel", void 0);
|
|
616
628
|
__decorate([
|
|
629
|
+
words,
|
|
617
630
|
property({ attribute: 'eyedropper-label' })
|
|
618
631
|
], HelixHeadlessColorPicker.prototype, "eyedropperLabel", void 0);
|
|
619
632
|
__decorate([
|
|
620
633
|
property({ reflect: true })
|
|
621
634
|
], HelixHeadlessColorPicker.prototype, "format", void 0);
|
|
622
635
|
__decorate([
|
|
636
|
+
words,
|
|
623
637
|
property({ attribute: 'format-label' })
|
|
624
638
|
], HelixHeadlessColorPicker.prototype, "formatLabel", void 0);
|
|
625
639
|
__decorate([
|
|
640
|
+
words,
|
|
626
641
|
property({ attribute: 'green-label' })
|
|
627
642
|
], HelixHeadlessColorPicker.prototype, "greenLabel", void 0);
|
|
628
643
|
__decorate([
|
|
644
|
+
words,
|
|
629
645
|
property({ attribute: 'hue-label' })
|
|
630
646
|
], HelixHeadlessColorPicker.prototype, "hueLabel", void 0);
|
|
631
647
|
__decorate([
|
|
648
|
+
words,
|
|
632
649
|
property({ attribute: 'lightness-label' })
|
|
633
650
|
], HelixHeadlessColorPicker.prototype, "lightnessLabel", void 0);
|
|
634
651
|
__decorate([
|
|
@@ -641,33 +658,44 @@ __decorate([
|
|
|
641
658
|
property({ attribute: 'no-value', type: Boolean })
|
|
642
659
|
], HelixHeadlessColorPicker.prototype, "noValue", void 0);
|
|
643
660
|
__decorate([
|
|
661
|
+
words,
|
|
644
662
|
property({ attribute: 'opacity-label' })
|
|
645
663
|
], HelixHeadlessColorPicker.prototype, "opacityLabel", void 0);
|
|
646
664
|
__decorate([
|
|
665
|
+
words,
|
|
647
666
|
property({ attribute: 'presets-label' })
|
|
648
667
|
], HelixHeadlessColorPicker.prototype, "presetsLabel", void 0);
|
|
649
668
|
__decorate([
|
|
650
669
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
651
670
|
], HelixHeadlessColorPicker.prototype, "readOnly", void 0);
|
|
652
671
|
__decorate([
|
|
672
|
+
words,
|
|
653
673
|
property({ attribute: 'red-label' })
|
|
654
674
|
], HelixHeadlessColorPicker.prototype, "redLabel", void 0);
|
|
655
675
|
__decorate([
|
|
656
676
|
property({ reflect: true, type: Boolean })
|
|
657
677
|
], HelixHeadlessColorPicker.prototype, "required", void 0);
|
|
658
678
|
__decorate([
|
|
679
|
+
words,
|
|
659
680
|
property({ attribute: 'saturation-label' })
|
|
660
681
|
], HelixHeadlessColorPicker.prototype, "saturationLabel", void 0);
|
|
682
|
+
__decorate([
|
|
683
|
+
words,
|
|
684
|
+
property({ attribute: 'square-text' })
|
|
685
|
+
], HelixHeadlessColorPicker.prototype, "squareText", void 0);
|
|
661
686
|
__decorate([
|
|
662
687
|
property()
|
|
663
688
|
], HelixHeadlessColorPicker.prototype, "swatches", void 0);
|
|
664
689
|
__decorate([
|
|
690
|
+
words,
|
|
665
691
|
property({ attribute: 'tools-label' })
|
|
666
692
|
], HelixHeadlessColorPicker.prototype, "toolsLabel", void 0);
|
|
667
693
|
__decorate([
|
|
694
|
+
words,
|
|
668
695
|
property({ attribute: 'value-label' })
|
|
669
696
|
], HelixHeadlessColorPicker.prototype, "valueLabel", void 0);
|
|
670
697
|
__decorate([
|
|
698
|
+
words,
|
|
671
699
|
property({ attribute: 'value-missing-message' })
|
|
672
700
|
], HelixHeadlessColorPicker.prototype, "valueMissingMessage", void 0);
|
|
673
701
|
__decorate([
|
|
@@ -15,3 +15,14 @@ export interface WheelBox {
|
|
|
15
15
|
* whatever the writing direction, since a circle has no line of text.
|
|
16
16
|
*/
|
|
17
17
|
export declare const hueAt: (x: number, y: number, box: WheelBox) => number;
|
|
18
|
+
/**
|
|
19
|
+
* The saturation and brightness at a point in the color square, 0 to 100:
|
|
20
|
+
* brightness falls downward, and saturation runs along the line, the way the
|
|
21
|
+
* two ramps under the square do, being native ranges. On a right-to-left page
|
|
22
|
+
* (`rtl`) it grows toward the left. A point outside the square is held to its
|
|
23
|
+
* edge.
|
|
24
|
+
*/
|
|
25
|
+
export declare const areaAt: (x: number, y: number, box: WheelBox, rtl: boolean) => {
|
|
26
|
+
brightness: number;
|
|
27
|
+
saturation: number;
|
|
28
|
+
};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { clamp } from '@fusion.dev/helix-core';
|
|
1
2
|
export const hueAt = (x, y, box) => {
|
|
2
3
|
const across = x - (box.left + box.width / 2);
|
|
3
4
|
const down = y - (box.top + box.height / 2);
|
|
4
5
|
const degrees = Math.round((Math.atan2(across, -down) * 180) / Math.PI);
|
|
5
6
|
return (degrees + 360) % 360;
|
|
6
7
|
};
|
|
8
|
+
export const areaAt = (x, y, box, rtl) => {
|
|
9
|
+
const fromLeft = clamp((x - box.left) / box.width, 0, 1);
|
|
10
|
+
const down = clamp((y - box.top) / box.height, 0, 1);
|
|
11
|
+
return {
|
|
12
|
+
brightness: Math.round((1 - down) * 100),
|
|
13
|
+
saturation: Math.round((rtl ? 1 - fromLeft : fromLeft) * 100),
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -17,13 +17,33 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
|
|
|
17
17
|
* reopened combobox starts from the whole list.
|
|
18
18
|
*
|
|
19
19
|
* Focus stays in the text field. The arrow keys move through the list with the
|
|
20
|
-
* listbox's public `navigate` method.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
20
|
+
* listbox's public `navigate` method. As typing narrows the list, a screen
|
|
21
|
+
* reader hears how many options are left, such as "3 results". Emptying the
|
|
22
|
+
* field and leaving it clears a single choice.
|
|
23
|
+
*
|
|
24
|
+
* **Keyboard.**
|
|
25
|
+
*
|
|
26
|
+
* | Key | What it does |
|
|
27
|
+
* |---|---|
|
|
28
|
+
* | Down, Up | On a closed field, opens the list on the chosen option, or the first or the last. In the open list, moves the highlight, round from the last option to the first. |
|
|
29
|
+
* | Page Down, Page Up | In the open list, moves the highlight by as many options as the list shows at once. |
|
|
30
|
+
* | Enter | Chooses the highlighted option. With nothing left in the list, creates what was typed with `creatable`, or takes it with `allows-custom-value`. On a closed field, submits the form. |
|
|
31
|
+
* | Escape | Closes the list and puts the chosen words back. On a closed field, a second Escape clears a single choice. |
|
|
32
|
+
* | Tab | Closes the list and moves on. |
|
|
33
|
+
* | Backspace | With `multiple`, on an empty field, removes the last tag. |
|
|
34
|
+
* | Space, Home, End, letters | Edit the text. |
|
|
35
|
+
*
|
|
36
|
+
* **ARIA.** The input is the `combobox`, named by the label, with
|
|
37
|
+
* `aria-expanded`, `aria-controls` naming the list, `aria-autocomplete`
|
|
38
|
+
* (`both` with `suggest`, `list` otherwise) and `aria-activedescendant` on
|
|
39
|
+
* the highlighted option. The list is the listbox `Listbox` describes.
|
|
40
|
+
*
|
|
41
|
+
* On Apple devices, where VoiceOver does not read the option the field points
|
|
42
|
+
* to, the field says it in a live region as the highlight moves, says how many
|
|
43
|
+
* options there are as the list opens, and says a choice once it is made, as
|
|
44
|
+
* React Aria's combobox does there.
|
|
45
|
+
*
|
|
46
|
+
* Set `autocomplete` to let a browser's autofill choose an option.
|
|
27
47
|
*
|
|
28
48
|
* With `multiple`, each chosen option is a tag in the field with its own remove
|
|
29
49
|
* control. The panel stays open and the filter clears after each choice, so the
|
|
@@ -83,6 +103,7 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
|
|
|
83
103
|
* @csspart listbox-loading - Shown while the options are loading.
|
|
84
104
|
* @csspart listbox-search - The region holding the field that narrows the list.
|
|
85
105
|
* @csspart listbox-search-field - The filter field inside that region.
|
|
106
|
+
* @csspart live - The region VoiceOver hears the highlight, the count and a choice from on Apple devices, drawn once there is one to say. Visually hidden in the styled tier.
|
|
86
107
|
* @csspart rest - The count of choices held beyond `max-tags`. A `<button>` with `expandable`, a `<span>` without it.
|
|
87
108
|
* @csspart surface - The floating panel.
|
|
88
109
|
* @csspart tag - One chosen option.
|
|
@@ -94,13 +115,27 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
|
|
|
94
115
|
* @csspart tag-start - The category before the label.
|
|
95
116
|
* @csspart tags - The row of chosen options, when `multiple` is set.
|
|
96
117
|
*
|
|
118
|
+
* @cssstate blank - While nothing is chosen.
|
|
97
119
|
* @cssstate error - While `load-error` is set.
|
|
98
120
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
121
|
+
* @cssstate loading - While `loading` is set.
|
|
99
122
|
* @cssstate no-results - What was typed hid every option of a list that has some.
|
|
100
123
|
* @cssstate open - While the list is open.
|
|
101
124
|
*/
|
|
102
125
|
export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
126
|
+
/**
|
|
127
|
+
* The key this family's words are registered under, its styled tag:
|
|
128
|
+
* `registerWords('de', { 'helix-combobox': { emptyText: 'Keine Treffer' } })`.
|
|
129
|
+
*/
|
|
130
|
+
static words: string;
|
|
103
131
|
protected readonly aria: AriaForwardController;
|
|
132
|
+
/** The region VoiceOver hears the highlight, the count and a choice from. */
|
|
133
|
+
private readonly status;
|
|
134
|
+
/**
|
|
135
|
+
* The option, or the create row, the region last said: `null` for none,
|
|
136
|
+
* and `undefined` until it has spoken since the list opened.
|
|
137
|
+
*/
|
|
138
|
+
private told;
|
|
104
139
|
/**
|
|
105
140
|
* Whether text that names no option is taken as the value, as React Aria's
|
|
106
141
|
* `allowsCustomValue`.
|
|
@@ -113,12 +148,19 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
113
148
|
*/
|
|
114
149
|
allowsCustomValue: boolean;
|
|
115
150
|
/**
|
|
116
|
-
* What the browser may autofill
|
|
151
|
+
* What the browser may autofill, as a platform token such as `country`.
|
|
117
152
|
*
|
|
118
153
|
* **Defaults to `off`, which is not the platform's default and is the
|
|
119
154
|
* point.** The field filters a list rather than collecting a value, so a
|
|
120
155
|
* browser offering to fill it with a saved address is competing for the same
|
|
121
156
|
* keystrokes as the listbox. A consumer who wants autofill can still ask.
|
|
157
|
+
*
|
|
158
|
+
* Set, a combobox whose answer is one of its options keeps a hidden native
|
|
159
|
+
* `<select>` with the same options for the browser to fill, as React Aria's
|
|
160
|
+
* combobox and Select do, and the option the browser picks, by its value or
|
|
161
|
+
* its words, becomes the value. The text field itself stays `off`, so the
|
|
162
|
+
* browser fills the answer and not the filter. With `allows-custom-value`
|
|
163
|
+
* the token goes on the text field, whose words are the answer.
|
|
122
164
|
*/
|
|
123
165
|
autocomplete: string;
|
|
124
166
|
/**
|
|
@@ -132,7 +174,10 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
132
174
|
*/
|
|
133
175
|
creatable: boolean;
|
|
134
176
|
/**
|
|
135
|
-
* The text of the create row
|
|
177
|
+
* The text of the create row. `{value}` is what was typed.
|
|
178
|
+
*
|
|
179
|
+
* A sentence without `{value}`, such as `Create`, is followed by what was
|
|
180
|
+
* typed in quotes, as before `{value}` existed.
|
|
136
181
|
*/
|
|
137
182
|
createLabel: string;
|
|
138
183
|
/**
|
|
@@ -155,10 +200,11 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
155
200
|
listLabel: string;
|
|
156
201
|
/**
|
|
157
202
|
* What the list says when its options could not be loaded, such as after a
|
|
158
|
-
* request to a server fails. Empty
|
|
159
|
-
*
|
|
203
|
+
* request to a server fails. Empty, null or no attribute is no error, so
|
|
204
|
+
* removing the attribute clears it. Passed to the list, which shows it
|
|
205
|
+
* under any options there are and tells screen readers.
|
|
160
206
|
*/
|
|
161
|
-
loadError: string;
|
|
207
|
+
loadError: string | null;
|
|
162
208
|
/**
|
|
163
209
|
* Whether the options are still loading.
|
|
164
210
|
*
|
|
@@ -170,6 +216,12 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
170
216
|
* Text the list shows while the options load.
|
|
171
217
|
*/
|
|
172
218
|
loadingText: string;
|
|
219
|
+
/**
|
|
220
|
+
* The locale the words, plural forms, and numbers are in, as a BCP 47 tag
|
|
221
|
+
* such as `pl`. Empty reads the nearest `lang`, then the browser's
|
|
222
|
+
* language.
|
|
223
|
+
*/
|
|
224
|
+
locale: string;
|
|
173
225
|
/**
|
|
174
226
|
* Whether more than one option can be chosen.
|
|
175
227
|
*
|
|
@@ -226,16 +278,25 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
226
278
|
*/
|
|
227
279
|
removeLabel: string;
|
|
228
280
|
/**
|
|
229
|
-
* What a screen reader hears when typing leaves one option
|
|
230
|
-
* the count.
|
|
281
|
+
* What a screen reader hears when typing leaves one option, where
|
|
282
|
+
* `results-label` should not say it. `{count}` is the count.
|
|
283
|
+
*
|
|
284
|
+
* @deprecated Write every form in `results-label`, as `{count, plural, one
|
|
285
|
+
* {# result} other {# results}}`. Removed in the next major version.
|
|
231
286
|
*/
|
|
232
|
-
resultLabel
|
|
287
|
+
resultLabel?: string;
|
|
233
288
|
/**
|
|
234
|
-
* What a screen reader hears when typing
|
|
235
|
-
* options
|
|
236
|
-
*
|
|
289
|
+
* What a screen reader hears when typing narrows the list. `{count}` is how
|
|
290
|
+
* many options are left, written in the locale, and each language writes
|
|
291
|
+
* the forms it has: `{count, plural, one {# wynik} few {# wyniki} many
|
|
292
|
+
* {# wyników} other {# wyniku}}`.
|
|
237
293
|
*/
|
|
238
294
|
resultsLabel: string;
|
|
295
|
+
/**
|
|
296
|
+
* What VoiceOver hears for a chosen option, as the highlight reaches it and
|
|
297
|
+
* once it is chosen, on Apple devices. `{name}` is the option's words.
|
|
298
|
+
*/
|
|
299
|
+
selectedLabel: string;
|
|
239
300
|
/**
|
|
240
301
|
* Whether the field completes the word as the user types.
|
|
241
302
|
*
|
|
@@ -245,6 +306,12 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
245
306
|
* should not have to ask.
|
|
246
307
|
*/
|
|
247
308
|
suggest: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* The message reported when the field is required and nothing is chosen.
|
|
311
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
312
|
+
* locale.
|
|
313
|
+
*/
|
|
314
|
+
valueMissingMessage: string;
|
|
248
315
|
/**
|
|
249
316
|
* What the reader has typed, which narrows the list and is not the value.
|
|
250
317
|
*
|
|
@@ -459,6 +526,25 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
459
526
|
* is missing.
|
|
460
527
|
*/
|
|
461
528
|
private linkActive;
|
|
529
|
+
/**
|
|
530
|
+
* Says the highlight, and the count as the list opens, where VoiceOver
|
|
531
|
+
* would not.
|
|
532
|
+
*
|
|
533
|
+
* **VoiceOver does not read the option `aria-activedescendant` points to**
|
|
534
|
+
* while focus is in a text field, so on Apple devices the arrows moved
|
|
535
|
+
* through the list in silence. React Aria says the option there, with
|
|
536
|
+
* "selected" where it is chosen, and how many there are as the list opens.
|
|
537
|
+
* Only when the highlight moves to another option, so an update that leaves
|
|
538
|
+
* it where it was says nothing.
|
|
539
|
+
*/
|
|
540
|
+
private tell;
|
|
541
|
+
/** How many options there are, said as the list opens, until an option is said with it. */
|
|
542
|
+
private counted;
|
|
543
|
+
/**
|
|
544
|
+
* How many options are left, in `results-label`, or in the deprecated
|
|
545
|
+
* `result-label` for one where a page still sets it.
|
|
546
|
+
*/
|
|
547
|
+
private countSaid;
|
|
462
548
|
/**
|
|
463
549
|
* Takes what the list announced and stops it there.
|
|
464
550
|
*
|
|
@@ -565,6 +651,8 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
565
651
|
*/
|
|
566
652
|
private renderCreate;
|
|
567
653
|
protected render(): TemplateResult;
|
|
654
|
+
/** Whether a browser's autofill fills the hidden select, rather than the text field. */
|
|
655
|
+
private get fills();
|
|
568
656
|
}
|
|
569
657
|
declare global {
|
|
570
658
|
interface HTMLElementTagNameMap {
|