@fusion.dev/helix-headless 0.0.0-dev → 0.0.2
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 +4513 -4483
- package/dist/accordion/item/accordion-item.d.ts +13 -15
- package/dist/accordion/item/accordion-item.js +15 -17
- package/dist/announcement/root/announcement-root.d.ts +7 -25
- package/dist/announcement/root/announcement-root.js +7 -20
- package/dist/app-header/root/app-header-root.d.ts +10 -17
- package/dist/app-header/root/app-header-root.js +9 -18
- package/dist/avatar/group/avatar-group.d.ts +10 -19
- package/dist/avatar/group/avatar-group.js +12 -17
- package/dist/avatar/root/avatar-root.d.ts +8 -8
- package/dist/avatar/root/avatar-root.js +19 -20
- package/dist/badge/root/badge-root.d.ts +6 -6
- package/dist/badge/root/badge-root.js +13 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
- package/dist/bar-chart/root/bar-chart-root.js +42 -57
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
- package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
- package/dist/button/root/button-root.d.ts +84 -94
- package/dist/button/root/button-root.js +82 -92
- package/dist/callout/root/callout-root.d.ts +4 -5
- package/dist/carousel/root/carousel-root.d.ts +59 -71
- package/dist/carousel/root/carousel-root.js +73 -101
- package/dist/chat/composer/chat-composer.d.ts +29 -33
- package/dist/chat/composer/chat-composer.js +40 -44
- package/dist/chat/message/chat-message.d.ts +25 -25
- package/dist/chat/message/chat-message.js +26 -26
- package/dist/chat/root/chat-root.d.ts +28 -41
- package/dist/chat/root/chat-root.js +27 -40
- package/dist/checkbox/root/checkbox-root.d.ts +10 -12
- package/dist/checkbox/root/checkbox-root.js +29 -35
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
- package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
- package/dist/code-block/root/code-block-root.d.ts +3 -4
- package/dist/code-block/root/code-block-root.js +8 -12
- package/dist/color-input/root/color-input-root.d.ts +36 -37
- package/dist/color-input/root/color-input-root.js +29 -34
- package/dist/color-picker/color.d.ts +7 -8
- package/dist/color-picker/color.js +7 -8
- package/dist/color-picker/root/color-picker-root.d.ts +55 -57
- package/dist/color-picker/root/color-picker-root.js +60 -64
- package/dist/combobox/root/combobox-root.d.ts +53 -58
- package/dist/combobox/root/combobox-root.js +85 -94
- package/dist/command/root/command-root.d.ts +8 -8
- package/dist/command/root/command-root.js +29 -33
- package/dist/copy-button/root/copy-button-root.d.ts +21 -24
- package/dist/copy-button/root/copy-button-root.js +25 -35
- package/dist/data-table/root/data-table-root.d.ts +77 -76
- package/dist/data-table/root/data-table-root.js +95 -84
- package/dist/data-table/root/order.d.ts +2 -2
- package/dist/data-table/root/order.js +1 -3
- package/dist/date-input/root/date-input-root.d.ts +88 -93
- package/dist/date-input/root/date-input-root.js +147 -158
- package/dist/date-picker/root/date-picker-root.d.ts +75 -83
- package/dist/date-picker/root/date-picker-root.js +120 -143
- package/dist/dialog/root/dialog-root.d.ts +41 -24
- package/dist/dialog/root/dialog-root.js +47 -24
- package/dist/divider/root/divider-root.d.ts +5 -6
- package/dist/divider/root/divider-root.js +4 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
- package/dist/donut-chart/root/donut-chart-root.js +37 -51
- package/dist/drawer/root/drawer-root.d.ts +24 -29
- package/dist/drawer/root/drawer-root.js +15 -22
- package/dist/drilldown/item/drilldown-item.d.ts +14 -14
- package/dist/drilldown/item/drilldown-item.js +24 -26
- package/dist/drilldown/root/drilldown-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.js +6 -7
- package/dist/element-events.generated.js +1 -1
- package/dist/file-input/root/file-input-root.d.ts +20 -24
- package/dist/file-input/root/file-input-root.js +42 -57
- package/dist/format-date/root/format-date-root.js +1 -1
- package/dist/heatmap/root/buckets.d.ts +8 -8
- package/dist/heatmap/root/buckets.js +8 -8
- package/dist/heatmap/root/heatmap-root.d.ts +57 -63
- package/dist/heatmap/root/heatmap-root.js +72 -83
- package/dist/icon/root/icon-root.d.ts +4 -4
- package/dist/icon/root/icon-root.js +9 -9
- package/dist/icon-button/root/icon-button-root.d.ts +4 -6
- package/dist/icon-button/root/icon-button-root.js +4 -6
- package/dist/image/root/image-root.d.ts +49 -59
- package/dist/image/root/image-root.js +55 -65
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/root/input-root.d.ts +61 -85
- package/dist/input/root/input-root.js +79 -106
- package/dist/kbd/root/kbd-root.d.ts +8 -7
- package/dist/kbd/root/kbd-root.js +71 -11
- package/dist/legend/root/legend-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +4 -5
- package/dist/line-chart/root/line-chart-root.d.ts +26 -30
- package/dist/line-chart/root/line-chart-root.js +10 -10
- package/dist/list/item/list-item.d.ts +14 -18
- package/dist/list/item/list-item.js +18 -22
- package/dist/list/root/list-root.d.ts +4 -4
- package/dist/list/root/list-root.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +31 -58
- package/dist/listbox/root/listbox-root.js +66 -109
- package/dist/megamenu/root/megamenu-root.d.ts +34 -35
- package/dist/megamenu/root/megamenu-root.js +53 -58
- package/dist/menu/item/menu-item.d.ts +39 -53
- package/dist/menu/item/menu-item.js +50 -64
- package/dist/menu/root/menu-root.d.ts +30 -40
- package/dist/menu/root/menu-root.js +49 -82
- package/dist/meter/root/meter-root.d.ts +49 -53
- package/dist/meter/root/meter-root.js +22 -27
- package/dist/navigation/root/navigation-root.js +11 -19
- package/dist/notifications/notification/notification.d.ts +16 -22
- package/dist/notifications/notification/notification.js +21 -27
- package/dist/notifications/root/notifications-root.d.ts +31 -39
- package/dist/notifications/root/notifications-root.js +41 -52
- package/dist/number-input/root/number-input-root.d.ts +31 -33
- package/dist/number-input/root/number-input-root.js +37 -39
- package/dist/option/root/option-root.d.ts +73 -74
- package/dist/option/root/option-root.js +62 -64
- package/dist/outline/root/outline-root.d.ts +38 -44
- package/dist/outline/root/outline-root.js +66 -82
- package/dist/pagination/root/pagination-root.d.ts +87 -92
- package/dist/pagination/root/pagination-root.js +116 -123
- package/dist/pagination/size/pagination-size.d.ts +31 -50
- package/dist/pagination/size/pagination-size.js +35 -55
- package/dist/pagination/summary/pagination-summary.d.ts +12 -12
- package/dist/pagination/summary/pagination-summary.js +18 -18
- package/dist/pin-input/root/pin-input-root.d.ts +53 -70
- package/dist/pin-input/root/pin-input-root.js +74 -94
- package/dist/popover/root/popover-root.d.ts +15 -20
- package/dist/popover/root/popover-root.js +19 -36
- package/dist/progress/root/progress-root.d.ts +12 -14
- package/dist/progress/root/progress-root.js +22 -25
- package/dist/qr-code/root/qr-code-root.d.ts +11 -11
- package/dist/qr-code/root/qr-code-root.js +12 -14
- package/dist/radio/group/radio-group.js +19 -26
- package/dist/radio/root/radio-root.d.ts +12 -13
- package/dist/radio/root/radio-root.js +12 -13
- package/dist/rating/root/rating-root.d.ts +25 -30
- package/dist/rating/root/rating-root.js +43 -50
- package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
- package/dist/scroll-area/root/scroll-area-root.js +39 -33
- package/dist/select/root/select-root.d.ts +7 -12
- package/dist/select/root/select-root.js +40 -55
- package/dist/slider/root/slider-root.d.ts +53 -60
- package/dist/slider/root/slider-root.js +74 -85
- package/dist/sparkline/root/sparkline-root.d.ts +43 -47
- package/dist/sparkline/root/sparkline-root.js +23 -32
- package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
- package/dist/speed-dial/item/speed-dial-item.js +9 -9
- package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
- package/dist/speed-dial/root/speed-dial-root.js +32 -40
- package/dist/splitter/root/splitter-root.d.ts +98 -111
- package/dist/splitter/root/splitter-root.js +96 -123
- package/dist/stat/root/stat-root.d.ts +2 -7
- package/dist/stat/root/stat-root.js +0 -5
- package/dist/steps/step/step.d.ts +19 -24
- package/dist/steps/step/step.js +27 -32
- package/dist/switch/root/switch-root.js +2 -2
- package/dist/table/column/table-column.d.ts +54 -60
- package/dist/table/column/table-column.js +95 -68
- package/dist/table/root/table-root.d.ts +5 -6
- package/dist/table/root/table-root.js +7 -10
- package/dist/tabs/panel/tab-panel.d.ts +21 -25
- package/dist/tabs/panel/tab-panel.js +25 -29
- package/dist/tabs/root/tabs-root.d.ts +25 -34
- package/dist/tabs/root/tabs-root.js +22 -28
- package/dist/tabs/tab/tab.d.ts +12 -12
- package/dist/tabs/tab/tab.js +19 -20
- package/dist/textarea/root/textarea-root.d.ts +36 -36
- package/dist/textarea/root/textarea-root.js +43 -47
- package/dist/time-input/root/time-input-root.d.ts +58 -68
- package/dist/time-input/root/time-input-root.js +62 -77
- package/dist/time-picker/root/time-picker-root.d.ts +73 -79
- package/dist/time-picker/root/time-picker-root.js +72 -84
- package/dist/timeline/item/timeline-item.d.ts +8 -11
- package/dist/timeline/item/timeline-item.js +8 -11
- package/dist/timeline/root/timeline-root.d.ts +5 -7
- package/dist/timeline/root/timeline-root.js +5 -7
- package/dist/toast/item/toast-item.d.ts +9 -27
- package/dist/toast/item/toast-item.js +19 -41
- package/dist/toast/root/toast-root.d.ts +10 -14
- package/dist/toast/root/toast-root.js +4 -5
- package/dist/toggle/group/toggle-group.d.ts +6 -15
- package/dist/toggle/group/toggle-group.js +21 -36
- package/dist/toggle/root/toggle-root.d.ts +26 -27
- package/dist/toggle/root/toggle-root.js +30 -31
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/toolbar/root/toolbar-root.js +10 -14
- package/dist/tooltip/root/tooltip-root.d.ts +52 -59
- package/dist/tooltip/root/tooltip-root.js +98 -93
- package/dist/tour/root/tour-root.d.ts +19 -23
- package/dist/tour/root/tour-root.js +31 -41
- package/dist/tour/stop/tour-stop.d.ts +14 -15
- package/dist/tour/stop/tour-stop.js +31 -34
- package/dist/tree/item/tree-item.d.ts +30 -35
- package/dist/tree/item/tree-item.js +43 -55
- package/dist/tree/root/tree-root.d.ts +7 -10
- package/dist/tree/root/tree-root.js +33 -42
- package/dist/trend/root/trend-root.d.ts +3 -5
- package/dist/trend/root/trend-root.js +5 -9
- package/dist/video/root/video-root.d.ts +100 -124
- package/dist/video/root/video-root.js +142 -176
- package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
- package/dist/video-playlist/item/video-playlist-item.js +24 -24
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
- package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
- package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
- package/dist/video-playlist/root/video-playlist-root.js +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
- package/dist/virtual-list/root/virtual-list-root.js +11 -16
- package/jsx.d.ts +9797 -12561
- package/package.json +6 -6
- package/vue.d.ts +2684 -3228
|
@@ -38,10 +38,10 @@ import { parseColor, toCss } from '../../color-picker/color.js';
|
|
|
38
38
|
* the value itself, for the reason Date Input gives about its dates: half-typed
|
|
39
39
|
* input does not survive a round trip through a formatter.
|
|
40
40
|
*
|
|
41
|
-
* The
|
|
42
|
-
* it
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* The custom property below is written by this component and never set by a
|
|
42
|
+
* consumer: it carries a value this element resolved and CSS cannot, which is
|
|
43
|
+
* what lets a stylesheet on this tier paint the swatch without parsing anything
|
|
44
|
+
* itself.
|
|
45
45
|
*
|
|
46
46
|
* @since 0.1.0
|
|
47
47
|
* @status experimental
|
|
@@ -112,19 +112,19 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
112
112
|
this.aria = new AriaForwardController(this, {
|
|
113
113
|
target: () => this.renderRoot?.querySelector('[part="control"]') ?? null,
|
|
114
114
|
});
|
|
115
|
+
/**
|
|
116
|
+
* Whether the color carries an alpha channel.
|
|
117
|
+
*/
|
|
118
|
+
this.alpha = false;
|
|
115
119
|
/**
|
|
116
120
|
* What the browser may autofill in the text field, as a platform token.
|
|
117
121
|
*
|
|
118
122
|
* **Defaults to `off`, which is not the platform's default and is the
|
|
119
|
-
* point.** The field
|
|
120
|
-
*
|
|
121
|
-
*
|
|
123
|
+
* point.** The field holds a color, so a browser offering to fill it with a
|
|
124
|
+
* saved address is competing for the same keystrokes as the picker. A
|
|
125
|
+
* consumer who wants autofill can still ask.
|
|
122
126
|
*/
|
|
123
127
|
this.autocomplete = 'off';
|
|
124
|
-
/**
|
|
125
|
-
* Whether the color carries an alpha channel.
|
|
126
|
-
*/
|
|
127
|
-
this.alpha = false;
|
|
128
128
|
/**
|
|
129
129
|
* Whether the reader may change the format from the panel.
|
|
130
130
|
*/
|
|
@@ -148,15 +148,12 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
148
148
|
*
|
|
149
149
|
* A control is not always one element: the button that opens this panel is
|
|
150
150
|
* part of it, and a press on it is not a press outside. Scoped to the
|
|
151
|
-
* surface alone, `pointerdown` on the trigger
|
|
152
|
-
* trigger's own `toggleOpen`
|
|
153
|
-
*
|
|
154
|
-
* across all five popover-bearing components: Menu, Popover and Tooltip
|
|
155
|
-
* already named their invoker; this one and its three siblings did not, and
|
|
156
|
-
* all four stayed open on a second press where Menu closed.
|
|
151
|
+
* surface alone, `pointerdown` on the trigger closes the panel and the
|
|
152
|
+
* trigger's own `toggleOpen` reopens it on the `click` that follows, so the
|
|
153
|
+
* panel can never be closed by the button that opened it.
|
|
157
154
|
*
|
|
158
|
-
* `DismissController` documents this exact failure and takes a list for
|
|
159
|
-
*
|
|
155
|
+
* `DismissController` documents this exact failure and takes a list for
|
|
156
|
+
* it. */
|
|
160
157
|
boundary: () => [
|
|
161
158
|
this.renderRoot?.querySelector('[part="surface"]'),
|
|
162
159
|
this.renderRoot?.querySelector('[part="trigger"]'),
|
|
@@ -296,10 +293,8 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
296
293
|
`value` is an accessor over `valueState ?? defaultValue`, so a consumer
|
|
297
294
|
moving `default-value` on an untouched control moves what the form
|
|
298
295
|
submits without ever putting `value` in the changed map, and the reported
|
|
299
|
-
entry
|
|
300
|
-
the behavior the mixin's own notes take as the reference.
|
|
301
|
-
twenty controls here already reported unconditionally; this is one of the
|
|
302
|
-
five that did not. */
|
|
296
|
+
entry goes stale. Native `<input>` updates in exactly that case, which is
|
|
297
|
+
the behavior the mixin's own notes take as the reference. */
|
|
303
298
|
this.sync();
|
|
304
299
|
if (changed.has('value') && parseColor(this.value)) {
|
|
305
300
|
this.settled = this.value;
|
|
@@ -330,9 +325,9 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
330
325
|
* editable field for the same value, which is two places to type with no
|
|
331
326
|
* answer to which one is authoritative or which has the caret.
|
|
332
327
|
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
328
|
+
* Not the other way round, this element dropping its own field and letting the
|
|
329
|
+
* panel's be the only one: the value could then not be read at a glance or
|
|
330
|
+
* pasted without opening a panel.
|
|
336
331
|
*/
|
|
337
332
|
/**
|
|
338
333
|
* The picker the field opens, behind a seam the styled tier can move.
|
|
@@ -379,8 +374,8 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
379
374
|
<!-- The same pair Input carries, in the same places: leading content
|
|
380
375
|
before the text, trailing content after it and before the trigger.
|
|
381
376
|
A label wanting to sit inside the field rather than over it goes
|
|
382
|
-
here, which is what the toggle group's own label-placement does
|
|
383
|
-
|
|
377
|
+
here, which is what the toggle group's own label-placement does.
|
|
378
|
+
Backticks stay out of this
|
|
384
379
|
comment: it is inside a tagged template, so one would end the
|
|
385
380
|
literal and the error lands on a line further down. -->
|
|
386
381
|
<slot name="start"></slot>
|
|
@@ -426,15 +421,12 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControl
|
|
|
426
421
|
${this.renderHint()}${this.renderFeedback()}`;
|
|
427
422
|
}
|
|
428
423
|
};
|
|
429
|
-
__decorate([
|
|
430
|
-
property()
|
|
431
|
-
], HelixHeadlessColorInput.prototype, "autocomplete", void 0);
|
|
432
|
-
__decorate([
|
|
433
|
-
property({ reflect: true })
|
|
434
|
-
], HelixHeadlessColorInput.prototype, "variant", void 0);
|
|
435
424
|
__decorate([
|
|
436
425
|
property({ reflect: true, type: Boolean })
|
|
437
426
|
], HelixHeadlessColorInput.prototype, "alpha", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
property()
|
|
429
|
+
], HelixHeadlessColorInput.prototype, "autocomplete", void 0);
|
|
438
430
|
__decorate([
|
|
439
431
|
property({ reflect: true })
|
|
440
432
|
], HelixHeadlessColorInput.prototype, "format", void 0);
|
|
@@ -450,6 +442,9 @@ __decorate([
|
|
|
450
442
|
__decorate([
|
|
451
443
|
property({ attribute: 'trigger-label' })
|
|
452
444
|
], HelixHeadlessColorInput.prototype, "triggerLabel", void 0);
|
|
445
|
+
__decorate([
|
|
446
|
+
property({ reflect: true })
|
|
447
|
+
], HelixHeadlessColorInput.prototype, "variant", void 0);
|
|
453
448
|
HelixHeadlessColorInput = __decorate([
|
|
454
449
|
customElement('helix-headless-color-input')
|
|
455
450
|
], HelixHeadlessColorInput);
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* set to, so a value stays in the shape the consumer asked for however it was
|
|
15
15
|
* entered.
|
|
16
16
|
*
|
|
17
|
-
* **What is written is the comma form.** Both are valid and the
|
|
18
|
-
*
|
|
19
|
-
* reader recognizes, what most code around them holds, and what pastes into
|
|
17
|
+
* **What is written is the comma form.** Both are valid, and the commas are what
|
|
18
|
+
* a reader recognizes, what most code around them holds, and what pastes into
|
|
20
19
|
* anything without a second thought. A syntax a value is handed *out* in is not
|
|
21
20
|
* the place to be early. `rgba` and `hsla` come with them, since a comma form
|
|
22
21
|
* with a fourth argument is spelled that way.
|
|
@@ -42,11 +41,11 @@ export declare const toRgb: (color: Color) => {
|
|
|
42
41
|
/**
|
|
43
42
|
* Splits a comma-separated list of colors, ignoring the commas inside them.
|
|
44
43
|
*
|
|
45
|
-
* A plain `split(',')`
|
|
46
|
-
* `#ef4444, rgb(249 115 22), rgba(34,197,94,.5)`
|
|
47
|
-
* four of them not colors, and the row quietly
|
|
48
|
-
*
|
|
49
|
-
* list look like it
|
|
44
|
+
* A plain `split(',')` cannot hold the legacy syntaxes:
|
|
45
|
+
* `#ef4444, rgb(249 115 22), rgba(34,197,94,.5)` comes apart into six fragments,
|
|
46
|
+
* four of them not colors, and the row quietly renders three swatches instead of
|
|
47
|
+
* four. The modern space-separated forms survive it, which is what makes such a
|
|
48
|
+
* list look like it works.
|
|
50
49
|
*
|
|
51
50
|
* Depth rather than a regular expression, because the thing that matters is
|
|
52
51
|
* whether a comma is inside a function call and that is exactly what a counter
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* set to, so a value stays in the shape the consumer asked for however it was
|
|
15
15
|
* entered.
|
|
16
16
|
*
|
|
17
|
-
* **What is written is the comma form.** Both are valid and the
|
|
18
|
-
*
|
|
19
|
-
* reader recognizes, what most code around them holds, and what pastes into
|
|
17
|
+
* **What is written is the comma form.** Both are valid, and the commas are what
|
|
18
|
+
* a reader recognizes, what most code around them holds, and what pastes into
|
|
20
19
|
* anything without a second thought. A syntax a value is handed *out* in is not
|
|
21
20
|
* the place to be early. `rgba` and `hsla` come with them, since a comma form
|
|
22
21
|
* with a fourth argument is spelled that way.
|
|
@@ -108,11 +107,11 @@ const toHsl = (color) => {
|
|
|
108
107
|
/**
|
|
109
108
|
* Splits a comma-separated list of colors, ignoring the commas inside them.
|
|
110
109
|
*
|
|
111
|
-
* A plain `split(',')`
|
|
112
|
-
* `#ef4444, rgb(249 115 22), rgba(34,197,94,.5)`
|
|
113
|
-
* four of them not colors, and the row quietly
|
|
114
|
-
*
|
|
115
|
-
* list look like it
|
|
110
|
+
* A plain `split(',')` cannot hold the legacy syntaxes:
|
|
111
|
+
* `#ef4444, rgb(249 115 22), rgba(34,197,94,.5)` comes apart into six fragments,
|
|
112
|
+
* four of them not colors, and the row quietly renders three swatches instead of
|
|
113
|
+
* four. The modern space-separated forms survive it, which is what makes such a
|
|
114
|
+
* list look like it works.
|
|
116
115
|
*
|
|
117
116
|
* Depth rather than a regular expression, because the thing that matters is
|
|
118
117
|
* whether a comma is inside a function call and that is exactly what a counter
|
|
@@ -79,7 +79,6 @@ declare const HelixHeadlessColorPicker_base: (new (...args: any[]) => import("@f
|
|
|
79
79
|
* @csspart grid-brightness - The range input for its vertical axis.
|
|
80
80
|
* @csspart grid-handle - The mark showing where in the square the color sits.
|
|
81
81
|
* @csspart grid-saturation - The range input for the square's horizontal axis.
|
|
82
|
-
* @csspart icon - A glyph this component draws.
|
|
83
82
|
* @csspart sample - The chip of the current color, which copies it when pressed.
|
|
84
83
|
* @csspart swatch - One preset.
|
|
85
84
|
* @csspart swatches - The row of presets.
|
|
@@ -91,40 +90,47 @@ declare const HelixHeadlessColorPicker_base: (new (...args: any[]) => import("@f
|
|
|
91
90
|
* @cssproperty --color-picker-swatch - A color to paint: the current one on the sample, a preset's on each preset.
|
|
92
91
|
*/
|
|
93
92
|
export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_base {
|
|
93
|
+
/**
|
|
94
|
+
* Whether the color carries an alpha channel.
|
|
95
|
+
*
|
|
96
|
+
* Off by default, because it widens every value written, and a consumer who
|
|
97
|
+
* did not ask for transparency should not have to strip a byte off each one.
|
|
98
|
+
*/
|
|
99
|
+
alpha: boolean;
|
|
94
100
|
/**
|
|
95
101
|
* What the browser may autofill in the text field, as a platform token.
|
|
96
102
|
*
|
|
97
103
|
* **Defaults to `off`, which is not the platform's default and is the
|
|
98
|
-
* point.** The field
|
|
99
|
-
*
|
|
100
|
-
*
|
|
104
|
+
* point.** The field holds a color, so a browser offering to fill it with a
|
|
105
|
+
* saved address is competing for the same keystrokes as the square and the
|
|
106
|
+
* ramps. A consumer who wants autofill can still ask.
|
|
101
107
|
*/
|
|
102
108
|
autocomplete: string;
|
|
109
|
+
/**
|
|
110
|
+
* The syntax the value is written in: `hex`, `rgb` or `hsl`.
|
|
111
|
+
*
|
|
112
|
+
* Only what is written. Everything is read whatever this says, so a picker on
|
|
113
|
+
* `hex` still takes an `rgb()` handed to it and stores the hex for it.
|
|
114
|
+
*/
|
|
115
|
+
format?: ColorFormat;
|
|
103
116
|
/**
|
|
104
117
|
* Whether the current selection fails validation.
|
|
105
118
|
*
|
|
106
|
-
* A flag rather than a message,
|
|
107
|
-
*
|
|
108
|
-
* the
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* mark on the answer itself.
|
|
119
|
+
* A flag rather than a message, the split Date Picker also draws. A flat
|
|
120
|
+
* picker has no room of its own for a sentence: the field that wraps one owns
|
|
121
|
+
* the label, the hint and the feedback, and a second message inside the panel
|
|
122
|
+
* would be the same error said twice. What is left for the picker is the one
|
|
123
|
+
* thing the field cannot draw from outside, the mark on the answer itself.
|
|
112
124
|
*/
|
|
113
125
|
invalid: boolean;
|
|
114
126
|
/**
|
|
115
|
-
* Whether the
|
|
116
|
-
*
|
|
117
|
-
* Off by default, because it widens every value written, and a consumer who
|
|
118
|
-
* did not ask for transparency should not have to strip a byte off each one.
|
|
127
|
+
* Whether the eyedropper is offered where the browser has one.
|
|
119
128
|
*/
|
|
120
|
-
|
|
129
|
+
noEyedropper: boolean;
|
|
121
130
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* Only what is written. Everything is read whatever this says, so a picker on
|
|
125
|
-
* `hex` still takes an `rgb()` handed to it and stores the hex for it.
|
|
131
|
+
* Whether the reader may change the format.
|
|
126
132
|
*/
|
|
127
|
-
|
|
133
|
+
noFormat: boolean;
|
|
128
134
|
/**
|
|
129
135
|
* Whether to leave the value out, for a picker whose value is stated elsewhere.
|
|
130
136
|
*
|
|
@@ -135,20 +141,11 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
135
141
|
*
|
|
136
142
|
* Color Input sets this, because its field is that input. Two editable fields
|
|
137
143
|
* for one value is the outcome worth avoiding: two places to type, and no
|
|
138
|
-
* answer to which one is authoritative or which has the caret.
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* without opening a panel.
|
|
144
|
+
* answer to which one is authoritative or which has the caret. Do not close it
|
|
145
|
+
* the other way round, with Color Input dropping its own field: the value
|
|
146
|
+
* would then be unreadable and unpasteable without opening a panel.
|
|
142
147
|
*/
|
|
143
148
|
noValue: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Whether the reader may change the format.
|
|
146
|
-
*/
|
|
147
|
-
noFormat: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Whether the eyedropper is offered where the browser has one.
|
|
150
|
-
*/
|
|
151
|
-
noEyedropper: boolean;
|
|
152
149
|
/**
|
|
153
150
|
* Colors offered under the picker, as a comma-separated list.
|
|
154
151
|
*/
|
|
@@ -210,12 +207,11 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
210
207
|
*
|
|
211
208
|
* A reader who has just built a color wants it in a stylesheet, and the
|
|
212
209
|
* alternative is selecting text out of a field that may not be on screen. The
|
|
213
|
-
* chip is the obvious target: it is the color, at the size of a control
|
|
214
|
-
* it had no job at all before this.
|
|
210
|
+
* chip is the obvious target: it is the color, at the size of a control.
|
|
215
211
|
*
|
|
216
|
-
* The controller rather than
|
|
217
|
-
*
|
|
218
|
-
*
|
|
212
|
+
* The controller rather than four lines here, because Copy Button shares
|
|
213
|
+
* everything about this that is easy to get wrong: the write, the
|
|
214
|
+
* confirmation, the timer that ends it, the event, and a failure that is
|
|
219
215
|
* correctly silent.
|
|
220
216
|
*/
|
|
221
217
|
private readonly copier;
|
|
@@ -247,18 +243,21 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
247
243
|
protected updated(changed: import('lit').PropertyValues): void;
|
|
248
244
|
/** Puts the keyboard on the square, which is the control a reader wants. */
|
|
249
245
|
focus(options?: FocusOptions): void;
|
|
250
|
-
/**
|
|
246
|
+
/**
|
|
247
|
+
* One of the ramps under the square.
|
|
248
|
+
*
|
|
249
|
+
* `protected` rather than `private`, the method being the seam a tier above
|
|
250
|
+
* renders its own ramp through.
|
|
251
|
+
*/
|
|
251
252
|
protected renderChannel(channel: 'alpha' | 'hue', label: string, max: number, value: number): TemplateResult;
|
|
252
253
|
/**
|
|
253
254
|
* One axis of the area, taken the way `takeChannel` takes a rail.
|
|
254
255
|
*
|
|
255
|
-
* **Named rather than inline because of the first line.**
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* has stopped its own since it was written, which is what made the omission
|
|
261
|
-
* hard to see. Found by sweeping every family that renders a native control.
|
|
256
|
+
* **Named rather than inline because of the first line.** The `<input
|
|
257
|
+
* type="range">` behind each axis sends its own composed `input`, which
|
|
258
|
+
* reaches a consumer listening on this element beside this element's own
|
|
259
|
+
* unless it is stopped: a consumer dragging the area receives the range's
|
|
260
|
+
* event and not this component's.
|
|
262
261
|
*/
|
|
263
262
|
private takeArea;
|
|
264
263
|
/**
|
|
@@ -267,15 +266,15 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
267
266
|
* **Both native events, because a slider sends both and at different
|
|
268
267
|
* moments.** It is one of the controls a reader edits continuously, so it
|
|
269
268
|
* announces `input` all the way through a drag and `change` when the drag
|
|
270
|
-
* ends. Listening only for the commit
|
|
271
|
-
*
|
|
269
|
+
* ends. Listening only for the commit leaves the picker deaf while a handle
|
|
270
|
+
* moves, and the hue and alpha handles do not move at all.
|
|
272
271
|
*
|
|
273
|
-
* **Read off the target rather than out of a detail
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
272
|
+
* **Read off the target rather than out of a detail.** Do not bind
|
|
273
|
+
* `helix-input` and `helix-change` and take the proposed value out of the
|
|
274
|
+
* event: those are requests, announcing what the slider is *about* to do,
|
|
275
|
+
* before anything has moved and while a listener may still refuse it. The
|
|
276
|
+
* native pair fires after the slider applied, so the value is on the element
|
|
277
|
+
* and cannot disagree with it.
|
|
279
278
|
*
|
|
280
279
|
* Idempotent, so taking both costs nothing: the same value applied twice is
|
|
281
280
|
* the same color.
|
|
@@ -287,10 +286,9 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
|
|
|
287
286
|
*
|
|
288
287
|
* A method rather than a fragment inline, so a tier above can render its own,
|
|
289
288
|
* wrap this one, pass it a property the base does not know about, or leave it
|
|
290
|
-
* out, without reimplementing the whole template
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
* from the same template.
|
|
289
|
+
* out, without reimplementing the whole template. The tag is interpolated
|
|
290
|
+
* rather than written, so `tier` resolves it and one template serves both
|
|
291
|
+
* tiers.
|
|
294
292
|
*/
|
|
295
293
|
protected renderTools(): TemplateResult;
|
|
296
294
|
protected render(): TemplateResult;
|
|
@@ -103,7 +103,6 @@ const START = { alpha: 100, brightness: 100, hue: 0, saturation: 100 };
|
|
|
103
103
|
* @csspart grid-brightness - The range input for its vertical axis.
|
|
104
104
|
* @csspart grid-handle - The mark showing where in the square the color sits.
|
|
105
105
|
* @csspart grid-saturation - The range input for the square's horizontal axis.
|
|
106
|
-
* @csspart icon - A glyph this component draws.
|
|
107
106
|
* @csspart sample - The chip of the current color, which copies it when pressed.
|
|
108
107
|
* @csspart swatch - One preset.
|
|
109
108
|
* @csspart swatches - The row of presets.
|
|
@@ -117,33 +116,40 @@ const START = { alpha: 100, brightness: 100, hue: 0, saturation: 100 };
|
|
|
117
116
|
let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinControllerValue(HelixFormElement) {
|
|
118
117
|
constructor() {
|
|
119
118
|
super(...arguments);
|
|
119
|
+
/**
|
|
120
|
+
* Whether the color carries an alpha channel.
|
|
121
|
+
*
|
|
122
|
+
* Off by default, because it widens every value written, and a consumer who
|
|
123
|
+
* did not ask for transparency should not have to strip a byte off each one.
|
|
124
|
+
*/
|
|
125
|
+
this.alpha = false;
|
|
120
126
|
/**
|
|
121
127
|
* What the browser may autofill in the text field, as a platform token.
|
|
122
128
|
*
|
|
123
129
|
* **Defaults to `off`, which is not the platform's default and is the
|
|
124
|
-
* point.** The field
|
|
125
|
-
*
|
|
126
|
-
*
|
|
130
|
+
* point.** The field holds a color, so a browser offering to fill it with a
|
|
131
|
+
* saved address is competing for the same keystrokes as the square and the
|
|
132
|
+
* ramps. A consumer who wants autofill can still ask.
|
|
127
133
|
*/
|
|
128
134
|
this.autocomplete = 'off';
|
|
129
135
|
/**
|
|
130
136
|
* Whether the current selection fails validation.
|
|
131
137
|
*
|
|
132
|
-
* A flag rather than a message,
|
|
133
|
-
*
|
|
134
|
-
* the
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* mark on the answer itself.
|
|
138
|
+
* A flag rather than a message, the split Date Picker also draws. A flat
|
|
139
|
+
* picker has no room of its own for a sentence: the field that wraps one owns
|
|
140
|
+
* the label, the hint and the feedback, and a second message inside the panel
|
|
141
|
+
* would be the same error said twice. What is left for the picker is the one
|
|
142
|
+
* thing the field cannot draw from outside, the mark on the answer itself.
|
|
138
143
|
*/
|
|
139
144
|
this.invalid = false;
|
|
140
145
|
/**
|
|
141
|
-
* Whether the
|
|
142
|
-
*
|
|
143
|
-
* Off by default, because it widens every value written, and a consumer who
|
|
144
|
-
* did not ask for transparency should not have to strip a byte off each one.
|
|
146
|
+
* Whether the eyedropper is offered where the browser has one.
|
|
145
147
|
*/
|
|
146
|
-
this.
|
|
148
|
+
this.noEyedropper = false;
|
|
149
|
+
/**
|
|
150
|
+
* Whether the reader may change the format.
|
|
151
|
+
*/
|
|
152
|
+
this.noFormat = false;
|
|
147
153
|
/**
|
|
148
154
|
* Whether to leave the value out, for a picker whose value is stated elsewhere.
|
|
149
155
|
*
|
|
@@ -154,20 +160,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
154
160
|
*
|
|
155
161
|
* Color Input sets this, because its field is that input. Two editable fields
|
|
156
162
|
* for one value is the outcome worth avoiding: two places to type, and no
|
|
157
|
-
* answer to which one is authoritative or which has the caret.
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* without opening a panel.
|
|
163
|
+
* answer to which one is authoritative or which has the caret. Do not close it
|
|
164
|
+
* the other way round, with Color Input dropping its own field: the value
|
|
165
|
+
* would then be unreadable and unpasteable without opening a panel.
|
|
161
166
|
*/
|
|
162
167
|
this.noValue = false;
|
|
163
|
-
/**
|
|
164
|
-
* Whether the reader may change the format.
|
|
165
|
-
*/
|
|
166
|
-
this.noFormat = false;
|
|
167
|
-
/**
|
|
168
|
-
* Whether the eyedropper is offered where the browser has one.
|
|
169
|
-
*/
|
|
170
|
-
this.noEyedropper = false;
|
|
171
168
|
/**
|
|
172
169
|
* Colors offered under the picker, as a comma-separated list.
|
|
173
170
|
*/
|
|
@@ -223,12 +220,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
223
220
|
*
|
|
224
221
|
* A reader who has just built a color wants it in a stylesheet, and the
|
|
225
222
|
* alternative is selecting text out of a field that may not be on screen. The
|
|
226
|
-
* chip is the obvious target: it is the color, at the size of a control
|
|
227
|
-
* it had no job at all before this.
|
|
223
|
+
* chip is the obvious target: it is the color, at the size of a control.
|
|
228
224
|
*
|
|
229
|
-
* The controller rather than
|
|
230
|
-
*
|
|
231
|
-
*
|
|
225
|
+
* The controller rather than four lines here, because Copy Button shares
|
|
226
|
+
* everything about this that is easy to get wrong: the write, the
|
|
227
|
+
* confirmation, the timer that ends it, the event, and a failure that is
|
|
232
228
|
* correctly silent.
|
|
233
229
|
*/
|
|
234
230
|
this.copier = new CopyController(this);
|
|
@@ -351,9 +347,12 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
351
347
|
focus(options) {
|
|
352
348
|
this.renderRoot?.querySelector('[part="grid-saturation"]')?.focus(options);
|
|
353
349
|
}
|
|
354
|
-
/**
|
|
355
|
-
|
|
356
|
-
|
|
350
|
+
/**
|
|
351
|
+
* One of the ramps under the square.
|
|
352
|
+
*
|
|
353
|
+
* `protected` rather than `private`, the method being the seam a tier above
|
|
354
|
+
* renders its own ramp through.
|
|
355
|
+
*/
|
|
357
356
|
renderChannel(channel, label, max, value) {
|
|
358
357
|
return html `<${this.tag('slider')}
|
|
359
358
|
part="channel"
|
|
@@ -373,13 +372,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
373
372
|
/**
|
|
374
373
|
* One axis of the area, taken the way `takeChannel` takes a rail.
|
|
375
374
|
*
|
|
376
|
-
* **Named rather than inline because of the first line.**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
* has stopped its own since it was written, which is what made the omission
|
|
382
|
-
* hard to see. Found by sweeping every family that renders a native control.
|
|
375
|
+
* **Named rather than inline because of the first line.** The `<input
|
|
376
|
+
* type="range">` behind each axis sends its own composed `input`, which
|
|
377
|
+
* reaches a consumer listening on this element beside this element's own
|
|
378
|
+
* unless it is stopped: a consumer dragging the area receives the range's
|
|
379
|
+
* event and not this component's.
|
|
383
380
|
*/
|
|
384
381
|
takeArea(axis, event) {
|
|
385
382
|
event.stopPropagation();
|
|
@@ -392,15 +389,15 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
392
389
|
* **Both native events, because a slider sends both and at different
|
|
393
390
|
* moments.** It is one of the controls a reader edits continuously, so it
|
|
394
391
|
* announces `input` all the way through a drag and `change` when the drag
|
|
395
|
-
* ends. Listening only for the commit
|
|
396
|
-
*
|
|
392
|
+
* ends. Listening only for the commit leaves the picker deaf while a handle
|
|
393
|
+
* moves, and the hue and alpha handles do not move at all.
|
|
397
394
|
*
|
|
398
|
-
* **Read off the target rather than out of a detail
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
395
|
+
* **Read off the target rather than out of a detail.** Do not bind
|
|
396
|
+
* `helix-input` and `helix-change` and take the proposed value out of the
|
|
397
|
+
* event: those are requests, announcing what the slider is *about* to do,
|
|
398
|
+
* before anything has moved and while a listener may still refuse it. The
|
|
399
|
+
* native pair fires after the slider applied, so the value is on the element
|
|
400
|
+
* and cannot disagree with it.
|
|
404
401
|
*
|
|
405
402
|
* Idempotent, so taking both costs nothing: the same value applied twice is
|
|
406
403
|
* the same color.
|
|
@@ -423,10 +420,9 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
423
420
|
*
|
|
424
421
|
* A method rather than a fragment inline, so a tier above can render its own,
|
|
425
422
|
* wrap this one, pass it a property the base does not know about, or leave it
|
|
426
|
-
* out, without reimplementing the whole template
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
* from the same template.
|
|
423
|
+
* out, without reimplementing the whole template. The tag is interpolated
|
|
424
|
+
* rather than written, so `tier` resolves it and one template serves both
|
|
425
|
+
* tiers.
|
|
430
426
|
*/
|
|
431
427
|
renderTools() {
|
|
432
428
|
return html `<${this.tag('button-group')} part="actions" label="Color tools">
|
|
@@ -540,27 +536,27 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinContr
|
|
|
540
536
|
</div>`;
|
|
541
537
|
}
|
|
542
538
|
};
|
|
543
|
-
__decorate([
|
|
544
|
-
property()
|
|
545
|
-
], HelixHeadlessColorPicker.prototype, "autocomplete", void 0);
|
|
546
|
-
__decorate([
|
|
547
|
-
property({ reflect: true, type: Boolean })
|
|
548
|
-
], HelixHeadlessColorPicker.prototype, "invalid", void 0);
|
|
549
539
|
__decorate([
|
|
550
540
|
property({ reflect: true, type: Boolean })
|
|
551
541
|
], HelixHeadlessColorPicker.prototype, "alpha", void 0);
|
|
542
|
+
__decorate([
|
|
543
|
+
property()
|
|
544
|
+
], HelixHeadlessColorPicker.prototype, "autocomplete", void 0);
|
|
552
545
|
__decorate([
|
|
553
546
|
property({ reflect: true })
|
|
554
547
|
], HelixHeadlessColorPicker.prototype, "format", void 0);
|
|
555
548
|
__decorate([
|
|
556
|
-
property({
|
|
557
|
-
], HelixHeadlessColorPicker.prototype, "
|
|
549
|
+
property({ reflect: true, type: Boolean })
|
|
550
|
+
], HelixHeadlessColorPicker.prototype, "invalid", void 0);
|
|
551
|
+
__decorate([
|
|
552
|
+
property({ attribute: 'no-eyedropper', type: Boolean })
|
|
553
|
+
], HelixHeadlessColorPicker.prototype, "noEyedropper", void 0);
|
|
558
554
|
__decorate([
|
|
559
555
|
property({ attribute: 'no-format', type: Boolean })
|
|
560
556
|
], HelixHeadlessColorPicker.prototype, "noFormat", void 0);
|
|
561
557
|
__decorate([
|
|
562
|
-
property({ attribute: 'no-
|
|
563
|
-
], HelixHeadlessColorPicker.prototype, "
|
|
558
|
+
property({ attribute: 'no-value', type: Boolean })
|
|
559
|
+
], HelixHeadlessColorPicker.prototype, "noValue", void 0);
|
|
564
560
|
__decorate([
|
|
565
561
|
property()
|
|
566
562
|
], HelixHeadlessColorPicker.prototype, "swatches", void 0);
|