@fusion.dev/helix-headless 0.146.0 → 0.148.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 +9287 -1084
- package/dist/accordion/item/accordion-item.d.ts +43 -21
- package/dist/accordion/item/accordion-item.js +37 -11
- package/dist/accordion/root/accordion-root.d.ts +8 -2
- package/dist/accordion/root/accordion-root.js +6 -8
- package/dist/announcement/root/announcement-root.d.ts +66 -6
- package/dist/announcement/root/announcement-root.js +144 -13
- package/dist/area-chart/root/area-chart-root.d.ts +18 -1
- package/dist/area-chart/root/area-chart-root.js +14 -7
- package/dist/avatar/root/avatar-root.d.ts +31 -1
- package/dist/avatar/root/avatar-root.js +11 -1
- package/dist/badge/count.d.ts +14 -0
- package/dist/badge/count.js +20 -0
- package/dist/badge/root/badge-root.d.ts +57 -6
- package/dist/badge/root/badge-root.js +77 -8
- package/dist/bar-chart/root/bar-chart-root.js +11 -20
- package/dist/bar-chart/stack.d.ts +10 -0
- package/dist/bar-chart/stack.js +8 -0
- package/dist/blockquote/root/blockquote-root.d.ts +66 -8
- package/dist/blockquote/root/blockquote-root.js +85 -8
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +14 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +12 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.js +2 -2
- package/dist/button/root/button-root.d.ts +24 -38
- package/dist/button/root/button-root.js +6 -37
- package/dist/button/submitter.d.ts +27 -0
- package/dist/button/submitter.js +25 -0
- 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 +141 -3
- package/dist/button-group/root/button-group-root.js +142 -2
- package/dist/canvas/edge-pan.d.ts +61 -0
- package/dist/canvas/edge-pan.js +63 -0
- package/dist/canvas/node/canvas-node.d.ts +12 -2
- package/dist/canvas/node/canvas-node.js +6 -2
- 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 +107 -5
- package/dist/canvas/root/canvas-root.js +140 -36
- package/dist/canvas/snap.d.ts +42 -0
- package/dist/canvas/snap.js +32 -0
- package/dist/card/root/card-root.d.ts +12 -1
- package/dist/card/root/card-root.js +11 -4
- package/dist/carousel/root/carousel-root.d.ts +4 -3
- package/dist/carousel/root/carousel-root.js +2 -6
- package/dist/chat/root/chat-root.d.ts +28 -4
- package/dist/chat/root/chat-root.js +12 -7
- package/dist/checkbox/root/checkbox-root.js +5 -7
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +13 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +16 -7
- package/dist/checkbox-group/select-all.d.ts +9 -4
- package/dist/checkbox-group/select-all.js +1 -1
- package/dist/code-block/root/code-block-root.d.ts +41 -18
- package/dist/code-block/root/code-block-root.js +21 -6
- package/dist/color-input/root/color-input-root.d.ts +11 -0
- package/dist/color-input/root/color-input-root.js +12 -5
- package/dist/color-picker/channels.js +1 -2
- package/dist/color-picker/root/color-picker-root.d.ts +32 -24
- package/dist/color-picker/root/color-picker-root.js +99 -55
- package/dist/color-picker/wheel.d.ts +28 -0
- package/dist/color-picker/wheel.js +15 -0
- package/dist/combobox/root/combobox-root.d.ts +83 -11
- package/dist/combobox/root/combobox-root.js +81 -18
- package/dist/command/root/command-root.d.ts +7 -4
- package/dist/command/root/command-root.js +2 -19
- package/dist/copy-button/root/copy-button-root.d.ts +16 -1
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/keys.d.ts +0 -18
- package/dist/data-table/keys.js +1 -11
- package/dist/data-table/root/data-table-root.js +29 -50
- package/dist/date-input/root/date-input-root.d.ts +8 -1
- package/dist/date-input/root/date-input-root.js +8 -5
- package/dist/date-picker/root/date-picker-root.d.ts +14 -9
- package/dist/date-picker/root/date-picker-root.js +21 -16
- package/dist/description-list/item/description-list-item.d.ts +22 -4
- package/dist/description-list/item/description-list-item.js +14 -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.js +13 -6
- package/dist/donut-chart/slice-label.d.ts +35 -0
- package/dist/donut-chart/slice-label.js +11 -0
- package/dist/drawer/root/drawer-root.d.ts +4 -2
- package/dist/drawer/root/drawer-root.js +15 -3
- package/dist/drilldown/item/drilldown-item.d.ts +21 -1
- package/dist/drilldown/item/drilldown-item.js +38 -4
- package/dist/drilldown/root/drilldown-root.js +3 -2
- package/dist/element-events.generated.js +5 -1
- package/dist/empty/root/empty-root.d.ts +46 -2
- package/dist/empty/root/empty-root.js +50 -5
- package/dist/file-input/root/file-input-root.d.ts +34 -6
- package/dist/file-input/root/file-input-root.js +55 -21
- package/dist/file-input/status.d.ts +24 -0
- package/dist/file-input/status.js +11 -0
- package/dist/filter-input/chip/filter-chip.d.ts +23 -0
- package/dist/filter-input/chip/filter-chip.js +10 -2
- package/dist/filter-input/root/filter-input-root.d.ts +8 -0
- package/dist/filter-input/root/filter-input-root.js +17 -27
- package/dist/format-date/fields.d.ts +20 -0
- package/dist/format-date/fields.js +14 -0
- package/dist/format-date/options.d.ts +5 -5
- package/dist/format-date/options.js +10 -39
- package/dist/format-date/root/format-date-root.d.ts +53 -4
- package/dist/format-date/root/format-date-root.js +38 -50
- package/dist/graph/root/graph-root.d.ts +23 -5
- package/dist/graph/root/graph-root.js +17 -20
- package/dist/heatmap/root/buckets.d.ts +21 -0
- package/dist/heatmap/root/buckets.js +34 -0
- package/dist/heatmap/root/heatmap-root.d.ts +76 -3
- package/dist/heatmap/root/heatmap-root.js +105 -20
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.js +1 -1
- package/dist/icon/registry.d.ts +26 -1
- package/dist/icon/registry.js +12 -1
- package/dist/icon/root/icon-root.d.ts +13 -0
- package/dist/icon/root/icon-root.js +23 -2
- package/dist/icon/root/index.d.ts +1 -1
- package/dist/icon/root/index.js +1 -1
- package/dist/image/root/image-root.d.ts +20 -0
- package/dist/image/root/image-root.js +6 -1
- package/dist/input/root/input-root.d.ts +23 -2
- package/dist/input/root/input-root.js +12 -8
- package/dist/kbd/root/kbd-root.d.ts +20 -3
- package/dist/kbd/root/kbd-root.js +23 -50
- package/dist/legend/hidden-series.d.ts +10 -2
- package/dist/legend/hidden-series.js +5 -2
- package/dist/legend/root/legend-root.d.ts +25 -7
- package/dist/legend/root/legend-root.js +25 -26
- package/dist/lightbox/root/lightbox-root.d.ts +50 -5
- package/dist/lightbox/root/lightbox-root.js +76 -8
- package/dist/lightbox/zoom.d.ts +2 -0
- package/dist/lightbox/zoom.js +5 -3
- package/dist/line-chart/root/line-chart-root.d.ts +16 -0
- package/dist/line-chart/root/line-chart-root.js +10 -2
- package/dist/list/root/list-root.d.ts +10 -2
- package/dist/list/root/list-root.js +31 -24
- package/dist/list/selection.d.ts +17 -0
- package/dist/list/selection.js +16 -0
- package/dist/listbox/root/listbox-root.d.ts +125 -26
- package/dist/listbox/root/listbox-root.js +156 -166
- package/dist/map/marker/map-marker.d.ts +2 -1
- package/dist/map/root/map-root.d.ts +40 -2
- package/dist/map/root/map-root.js +64 -23
- package/dist/megamenu/hand-over.d.ts +75 -0
- package/dist/megamenu/hand-over.js +67 -0
- package/dist/megamenu/root/megamenu-root.d.ts +38 -14
- package/dist/megamenu/root/megamenu-root.js +29 -50
- package/dist/menu/item/menu-item.js +4 -4
- package/dist/menu/root/menu-root.d.ts +5 -2
- package/dist/meter/root/meter-root.d.ts +42 -0
- package/dist/meter/root/meter-root.js +33 -7
- package/dist/navigation/root/navigation-root.js +5 -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 +12 -1
- package/dist/notifications/notification/notification.js +3 -1
- package/dist/notifications/root/notifications-root.d.ts +48 -3
- package/dist/notifications/root/notifications-root.js +36 -6
- package/dist/number-input/grain.d.ts +28 -0
- package/dist/number-input/grain.js +14 -0
- package/dist/number-input/root/number-input-root.d.ts +17 -1
- package/dist/number-input/root/number-input-root.js +29 -18
- package/dist/object-inspector/root/object-inspector-root.d.ts +17 -6
- package/dist/object-inspector/root/object-inspector-root.js +31 -20
- package/dist/option/index.d.ts +1 -0
- package/dist/option/index.js +1 -0
- package/dist/option/separator/option-separator.d.ts +30 -0
- package/dist/option/separator/option-separator.js +21 -0
- package/dist/outline/root/outline-root.d.ts +12 -0
- package/dist/outline/root/outline-root.js +5 -19
- package/dist/pagination/size/pagination-size.d.ts +6 -0
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pin-input/code.d.ts +51 -1
- package/dist/pin-input/code.js +37 -0
- package/dist/pin-input/root/pin-input-root.d.ts +98 -121
- package/dist/pin-input/root/pin-input-root.js +151 -156
- package/dist/popover/hide-outside.js +2 -9
- package/dist/popover/root/popover-root.d.ts +7 -1
- package/dist/popover/root/popover-root.js +9 -1
- package/dist/progress/root/progress-root.d.ts +27 -0
- package/dist/progress/root/progress-root.js +25 -7
- package/dist/qr-code/export.d.ts +19 -0
- package/dist/qr-code/export.js +14 -0
- package/dist/qr-code/name.d.ts +11 -0
- package/dist/qr-code/name.js +7 -0
- package/dist/qr-code/root/qr-code-root.d.ts +31 -9
- package/dist/qr-code/root/qr-code-root.js +29 -17
- package/dist/radio/group/radio-group.d.ts +15 -0
- package/dist/radio/root/radio-root.js +2 -2
- package/dist/rating/root/rating-root.d.ts +22 -9
- package/dist/rating/root/rating-root.js +15 -39
- 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 +26 -0
- package/dist/scatter-chart/root/scatter-chart-root.js +21 -7
- package/dist/scroll-area/scrollbar.d.ts +0 -8
- package/dist/scroll-area/scrollbar.js +1 -1
- package/dist/select/align.d.ts +47 -0
- package/dist/select/align.js +7 -0
- package/dist/select/root/select-root.d.ts +115 -11
- package/dist/select/root/select-root.js +104 -20
- package/dist/slider/root/slider-root.d.ts +18 -1
- package/dist/slider/root/slider-root.js +22 -0
- package/dist/sparkline/readings.d.ts +30 -12
- package/dist/sparkline/readings.js +32 -15
- package/dist/sparkline/root/sparkline-root.d.ts +46 -3
- package/dist/sparkline/root/sparkline-root.js +60 -21
- 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 +27 -2
- package/dist/speed-dial/item/speed-dial-item.js +43 -5
- 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 +86 -1
- package/dist/speed-dial/root/speed-dial-root.js +123 -6
- package/dist/splitter/root/splitter-root.d.ts +9 -2
- package/dist/splitter/root/splitter-root.js +18 -3
- package/dist/steps/root/steps-root.d.ts +8 -1
- package/dist/steps/root/steps-root.js +6 -1
- package/dist/steps/step/step.d.ts +1 -0
- package/dist/steps/step/step.js +1 -1
- 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 +6 -0
- package/dist/table/column/table-column.js +5 -1
- package/dist/table/grid-controller.d.ts +117 -0
- package/dist/table/grid-controller.js +293 -0
- package/dist/table/root/table-root.d.ts +47 -3
- package/dist/table/root/table-root.js +93 -29
- package/dist/table/row/table-row.d.ts +36 -0
- package/dist/table/row/table-row.js +52 -2
- package/dist/tabs/root/tabs-root.d.ts +5 -3
- package/dist/tag/group/tag-group.d.ts +16 -4
- package/dist/tag/group/tag-group.js +23 -20
- package/dist/textarea/root/textarea-root.d.ts +14 -2
- package/dist/textarea/root/textarea-root.js +6 -7
- package/dist/time-input/root/time-input-root.d.ts +5 -1
- package/dist/time-input/root/time-input-root.js +10 -7
- package/dist/time-picker/root/time-picker-root.d.ts +12 -14
- package/dist/time-picker/root/time-picker-root.js +18 -23
- package/dist/toast/item/toast-item.d.ts +9 -6
- package/dist/toast/item/toast-item.js +1 -1
- package/dist/toast/root/toast-root.d.ts +40 -4
- package/dist/toast/root/toast-root.js +68 -16
- package/dist/toast/words.d.ts +12 -0
- package/dist/toast/words.js +25 -0
- package/dist/toggle/group/toggle-group.d.ts +29 -5
- package/dist/toggle/group/toggle-group.js +26 -43
- package/dist/toggle/root/toggle-root.js +2 -4
- package/dist/toolbar/root/toolbar-root.d.ts +52 -5
- package/dist/toolbar/root/toolbar-root.js +88 -13
- package/dist/tooltip/root/tooltip-root.d.ts +7 -1
- package/dist/tooltip/root/tooltip-root.js +10 -2
- package/dist/tour/root/tour-root.d.ts +15 -0
- package/dist/tour/root/tour-root.js +20 -1
- package/dist/tour/stop/tour-stop.d.ts +3 -0
- package/dist/tour/stop/tour-stop.js +3 -3
- package/dist/tree/root/tree-root.js +2 -2
- package/dist/trend/figure.d.ts +16 -0
- package/dist/trend/figure.js +8 -0
- package/dist/trend/root/trend-root.d.ts +41 -2
- package/dist/trend/root/trend-root.js +29 -3
- package/dist/video/root/extra-controls.d.ts +12 -0
- package/dist/video/root/extra-controls.js +6 -2
- package/dist/video/root/video-root.d.ts +16 -1
- package/dist/video/root/video-root.js +15 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +11 -1
- package/dist/video-playlist/root/video-playlist-root.js +3 -0
- package/dist/virtual-list/fill.d.ts +11 -0
- package/dist/virtual-list/fill.js +9 -0
- package/dist/virtual-list/keys.d.ts +16 -7
- package/dist/virtual-list/keys.js +17 -6
- package/dist/virtual-list/plan.d.ts +17 -1
- package/dist/virtual-list/plan.js +13 -2
- package/dist/virtual-list/root/virtual-list-root.d.ts +25 -3
- package/dist/virtual-list/root/virtual-list-root.js +53 -41
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +4934 -954
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +946 -253
- package/dist/color-picker/swatches.d.ts +0 -12
- package/dist/color-picker/swatches.js +0 -26
- package/dist/rating/steps.d.ts +0 -7
- package/dist/rating/steps.js +0 -9
- package/dist/tooltip/focus-target.d.ts +0 -6
- package/dist/tooltip/focus-target.js +0 -9
|
@@ -13,20 +13,22 @@ declare const HelixHeadlessAccordionItem_base: (new (...args: any[]) => import("
|
|
|
13
13
|
* accordion's, then 3.
|
|
14
14
|
*
|
|
15
15
|
* Content stays mounted when the item is closed, so it can animate and its text
|
|
16
|
-
* is present in server-rendered HTML.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `
|
|
16
|
+
* is present in server-rendered HTML.
|
|
17
|
+
*
|
|
18
|
+
* The browser's find in page searches a closed section, and a match opens it,
|
|
19
|
+
* with `helix-before-open` first, as React Aria's disclosure does. Closed
|
|
20
|
+
* content is `hidden="until-found"`, which hides it with no stylesheet loaded
|
|
21
|
+
* and keeps it out of the tab order and the accessibility tree. A section
|
|
22
|
+
* that closes keeps its content drawn until the content part's animations and
|
|
23
|
+
* transitions end, so a sheet that animates the section closed shows the
|
|
24
|
+
* content shrinking rather than an empty box. Set `hidden-until-found="false"`
|
|
25
|
+
* and a closed section is `hidden` and `inert` instead, and find in page skips
|
|
26
|
+
* it.
|
|
20
27
|
*
|
|
21
28
|
* While it is open, the content part carries the content's height as
|
|
22
29
|
* `--accordion-content-height`, as Radix's accordion does, for a stylesheet
|
|
23
30
|
* that animates the section open with keyframes of its own.
|
|
24
31
|
*
|
|
25
|
-
* Set `hidden-until-found` and the browser's find in page searches a closed
|
|
26
|
-
* section too: a match opens it, with `helix-before-open` first, as React
|
|
27
|
-
* Aria's disclosure does. The content is then `hidden="until-found"` while
|
|
28
|
-
* closed, and not `inert`, since an inert region is never searched.
|
|
29
|
-
*
|
|
30
32
|
* @since 0.1.0
|
|
31
33
|
* @status stable
|
|
32
34
|
* @aliases Collapsible, Expander, Disclosure
|
|
@@ -97,12 +99,11 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
|
|
|
97
99
|
* Whether find in page searches the section while it is closed, and opens it
|
|
98
100
|
* on a match.
|
|
99
101
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* accordion's own `hidden-until-found` turns it on for every section.
|
|
102
|
+
* Unset takes the accordion's `hidden-until-found`, which is on. Write
|
|
103
|
+
* `hidden-until-found="false"` to keep find in page out of this section: a
|
|
104
|
+
* closed section is then `hidden` and `inert`.
|
|
104
105
|
*/
|
|
105
|
-
hiddenUntilFound
|
|
106
|
+
hiddenUntilFound?: boolean;
|
|
106
107
|
/**
|
|
107
108
|
* A group name. Opening an item closes the other items with the same name,
|
|
108
109
|
* as `<details name>` does.
|
|
@@ -126,11 +127,32 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
|
|
|
126
127
|
name?: string;
|
|
127
128
|
/** Whether find in page searches this section while it is closed. */
|
|
128
129
|
private get findable();
|
|
130
|
+
/**
|
|
131
|
+
* Whether the section has closed and its content is still drawn, until the
|
|
132
|
+
* content part's animations end.
|
|
133
|
+
*
|
|
134
|
+
* `hidden="until-found"` hides through `content-visibility`, which an
|
|
135
|
+
* author's `display` does not override, so writing it the moment the section
|
|
136
|
+
* closes empties the box a sheet is still shrinking. `inert` holds the
|
|
137
|
+
* content meanwhile.
|
|
138
|
+
*/
|
|
139
|
+
private closing;
|
|
140
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
141
|
+
/**
|
|
142
|
+
* Hides the content of a section that closed, once whatever animates the
|
|
143
|
+
* content part has finished. Nothing running, as under reduced motion or
|
|
144
|
+
* with no stylesheet, hides it at once. `getAnimations` brings the styles up
|
|
145
|
+
* to date first, so a transition the close starts is among them.
|
|
146
|
+
*/
|
|
147
|
+
private finishClosing;
|
|
129
148
|
/**
|
|
130
149
|
* Opens the section find in page has matched in, before the match is shown.
|
|
131
150
|
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
151
|
+
* A refusal puts `hidden` back, so the trigger and the region still agree.
|
|
152
|
+
* The browser removes the attribute after this event's listeners have
|
|
153
|
+
* returned, and after the microtasks they queued, so writing it here or in a
|
|
154
|
+
* microtask is undone at once. A mutation observer hears the removal itself
|
|
155
|
+
* and runs before the next paint or key press.
|
|
134
156
|
*/
|
|
135
157
|
private readonly handleBeforeMatch;
|
|
136
158
|
/** Whether the item was open at the last update, and `undefined` before one. */
|
|
@@ -204,13 +226,13 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
|
|
|
204
226
|
* part outranks it and the transition runs exactly as before. Measured on
|
|
205
227
|
* both tiers.
|
|
206
228
|
*
|
|
207
|
-
* **`hidden="until-found"`
|
|
229
|
+
* **`hidden="until-found"` unless it is turned off.** It hides through
|
|
208
230
|
* `content-visibility` rather than `display`, which an author `display` does
|
|
209
|
-
* not override, so
|
|
210
|
-
*
|
|
211
|
-
* under a trigger that still reports collapsed.
|
|
231
|
+
* not override, so it is written only once the section's closing motion has
|
|
232
|
+
* ended (`closing`). `beforematch` sets `open`, so find in page never reveals
|
|
233
|
+
* text under a trigger that still reports collapsed.
|
|
212
234
|
*
|
|
213
|
-
* `inert`
|
|
235
|
+
* `inert` only where `until-found` is not. `hidden` answers the reader who
|
|
214
236
|
* can see and `inert` answers the one tabbing through, and wherever a sheet
|
|
215
237
|
* overrides `display`, `inert` is the only one of the two still in force.
|
|
216
238
|
* `content-visibility: hidden` keeps skipped content out of the tab order and
|
|
@@ -4,10 +4,10 @@ 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 { closestInstance, customElement, HelixElement, headingLevel, MixinControllerOpen, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { animationsFinished, closestInstance, customElement, HelixElement, headingLevel, MixinControllerOpen, onUnlessFalse, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretDown } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
|
-
import { property } from 'lit/decorators.js';
|
|
10
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
12
|
import { HelixHeadlessAccordion } from '../root/accordion-root.js';
|
|
13
13
|
const CONTENT_ID = 'content';
|
|
@@ -17,14 +17,20 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
|
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.disabled = false;
|
|
19
19
|
this.groupHeadingLevel = undefined;
|
|
20
|
-
this.groupHiddenUntilFound =
|
|
21
|
-
this.
|
|
20
|
+
this.groupHiddenUntilFound = true;
|
|
21
|
+
this.closing = false;
|
|
22
22
|
this.handleBeforeMatch = (event) => {
|
|
23
23
|
if (this.open || this.requestOpen(true)) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
;
|
|
27
|
-
|
|
26
|
+
const content = event.currentTarget;
|
|
27
|
+
const observer = new MutationObserver(() => {
|
|
28
|
+
observer.disconnect();
|
|
29
|
+
if (!this.open && !this.closing && !content.hasAttribute('hidden')) {
|
|
30
|
+
content.setAttribute('hidden', 'until-found');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
observer.observe(content, { attributeFilter: ['hidden'] });
|
|
28
34
|
};
|
|
29
35
|
this.wasOpen = undefined;
|
|
30
36
|
this.handleToggle = () => {
|
|
@@ -63,7 +69,20 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
|
|
|
63
69
|
>`;
|
|
64
70
|
}
|
|
65
71
|
get findable() {
|
|
66
|
-
return this.hiddenUntilFound
|
|
72
|
+
return this.hiddenUntilFound ?? this.groupHiddenUntilFound;
|
|
73
|
+
}
|
|
74
|
+
willUpdate(changed) {
|
|
75
|
+
super.willUpdate(changed);
|
|
76
|
+
if (changed.has('open')) {
|
|
77
|
+
this.closing = !this.open && changed.get('open') === true && this.findable;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
finishClosing() {
|
|
81
|
+
void animationsFinished(this.partNamed('content')).then(() => {
|
|
82
|
+
if (!this.open) {
|
|
83
|
+
this.closing = false;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
67
86
|
}
|
|
68
87
|
get accordion() {
|
|
69
88
|
return closestInstance(this, HelixHeadlessAccordion);
|
|
@@ -96,6 +115,9 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
|
|
|
96
115
|
if (this.wasOpen === false && this.open) {
|
|
97
116
|
this.closePeers();
|
|
98
117
|
}
|
|
118
|
+
if (changed.has('closing') && this.closing) {
|
|
119
|
+
this.finishClosing();
|
|
120
|
+
}
|
|
99
121
|
this.wasOpen = this.open;
|
|
100
122
|
this.measure();
|
|
101
123
|
}
|
|
@@ -104,7 +126,8 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
|
|
|
104
126
|
}
|
|
105
127
|
render() {
|
|
106
128
|
const open = this.open;
|
|
107
|
-
const
|
|
129
|
+
const shown = open || this.closing;
|
|
130
|
+
const landmark = shown || !this.findable;
|
|
108
131
|
const level = headingLevel(this.headingLevel ?? this.groupHeadingLevel);
|
|
109
132
|
return html `
|
|
110
133
|
<div part="container">
|
|
@@ -127,8 +150,8 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
|
|
|
127
150
|
id=${CONTENT_ID}
|
|
128
151
|
aria-labelledby=${landmark ? TRIGGER_ID : nothing}
|
|
129
152
|
part="content"
|
|
130
|
-
hidden=${
|
|
131
|
-
?inert=${!open && !this.findable}
|
|
153
|
+
hidden=${shown ? nothing : this.findable ? 'until-found' : ''}
|
|
154
|
+
?inert=${!open && (this.closing || !this.findable)}
|
|
132
155
|
role=${landmark ? 'region' : nothing}
|
|
133
156
|
@beforematch=${this.handleBeforeMatch}
|
|
134
157
|
>
|
|
@@ -156,11 +179,14 @@ __decorate([
|
|
|
156
179
|
property({ attribute: 'heading-level', type: Number })
|
|
157
180
|
], HelixHeadlessAccordionItem.prototype, "headingLevel", void 0);
|
|
158
181
|
__decorate([
|
|
159
|
-
property({ attribute: 'hidden-until-found',
|
|
182
|
+
property({ attribute: 'hidden-until-found', converter: onUnlessFalse })
|
|
160
183
|
], HelixHeadlessAccordionItem.prototype, "hiddenUntilFound", void 0);
|
|
161
184
|
__decorate([
|
|
162
185
|
property({ reflect: true })
|
|
163
186
|
], HelixHeadlessAccordionItem.prototype, "name", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
state()
|
|
189
|
+
], HelixHeadlessAccordionItem.prototype, "closing", void 0);
|
|
164
190
|
HelixHeadlessAccordionItem = __decorate([
|
|
165
191
|
customElement('helix-headless-accordion-item')
|
|
166
192
|
], HelixHeadlessAccordionItem);
|
|
@@ -27,6 +27,9 @@ import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
|
|
|
27
27
|
* in a screen reader's list of headings. An open section is a region named by
|
|
28
28
|
* its trigger. Set the level that fits the page's outline.
|
|
29
29
|
*
|
|
30
|
+
* Find in page searches the closed sections too, and opens the one it matches
|
|
31
|
+
* in. `hidden-until-found="false"` turns that off.
|
|
32
|
+
*
|
|
30
33
|
* @since 0.1.0
|
|
31
34
|
* @status stable
|
|
32
35
|
* @category layout
|
|
@@ -44,8 +47,11 @@ export declare class HelixHeadlessAccordion extends HelixElement {
|
|
|
44
47
|
headingLevel?: number;
|
|
45
48
|
/**
|
|
46
49
|
* Whether find in page searches every closed section, and opens the one it
|
|
47
|
-
* matches in.
|
|
48
|
-
*
|
|
50
|
+
* matches in.
|
|
51
|
+
*
|
|
52
|
+
* On by default, as in React Aria's disclosure. Write
|
|
53
|
+
* `hidden-until-found="false"` to turn it off for every section; an item's
|
|
54
|
+
* own `hidden-until-found` wins for that item.
|
|
49
55
|
*/
|
|
50
56
|
hiddenUntilFound: boolean;
|
|
51
57
|
/**
|
|
@@ -4,21 +4,19 @@ 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 { customElement, HelixElement, KeyboardNavigationController, whenHydrated, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, focusItemOf, HelixElement, KeyboardNavigationController, onUnlessFalse, whenHydrated, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
|
|
11
|
-
const navigable = (item) => ({
|
|
12
|
-
contains: (node) => node === item,
|
|
11
|
+
const navigable = (item) => focusItemOf(item, {
|
|
13
12
|
disabled: item.disabled,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
selected: false,
|
|
13
|
+
focus: () => item.focusTrigger(),
|
|
14
|
+
owns: (node) => node === item,
|
|
17
15
|
});
|
|
18
16
|
let HelixHeadlessAccordion = class HelixHeadlessAccordion extends HelixElement {
|
|
19
17
|
constructor() {
|
|
20
18
|
super(...arguments);
|
|
21
|
-
this.hiddenUntilFound =
|
|
19
|
+
this.hiddenUntilFound = true;
|
|
22
20
|
this.keys = new KeyboardNavigationController(this, {
|
|
23
21
|
items: () => this.items.map(navigable),
|
|
24
22
|
origin: 'focus',
|
|
@@ -71,7 +69,7 @@ __decorate([
|
|
|
71
69
|
property({ attribute: 'heading-level', type: Number })
|
|
72
70
|
], HelixHeadlessAccordion.prototype, "headingLevel", void 0);
|
|
73
71
|
__decorate([
|
|
74
|
-
property({ attribute: 'hidden-until-found',
|
|
72
|
+
property({ attribute: 'hidden-until-found', converter: onUnlessFalse })
|
|
75
73
|
], HelixHeadlessAccordion.prototype, "hiddenUntilFound", void 0);
|
|
76
74
|
__decorate([
|
|
77
75
|
property({ reflect: true })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArrivalController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
-
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@fusion.dev/helix-core").DismissibleElement) & typeof HelixElement;
|
|
4
4
|
/**
|
|
5
5
|
* @summary A message for the whole page, shown above its header, that can be dismissed.
|
|
@@ -29,10 +29,30 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
|
|
|
29
29
|
* announcement beside it, move focus yourself, for example to the page's main
|
|
30
30
|
* heading.
|
|
31
31
|
*
|
|
32
|
+
* **The announcement is a landmark region**, named by `label`, "Announcement"
|
|
33
|
+
* unless you set it, so a screen reader lists it among the page's regions.
|
|
34
|
+
* `hotkey`, F6 unless you set it, moves focus to the announcement's first
|
|
35
|
+
* control, an action or the dismiss button, and pressed there moves focus
|
|
36
|
+
* back to where it was, as React Aria's toast region does. An announcement
|
|
37
|
+
* with no control leaves the key to the browser. When an announcement that
|
|
38
|
+
* the key moved focus into is removed with focus still inside, focus goes
|
|
39
|
+
* back to where it was before the key.
|
|
40
|
+
*
|
|
41
|
+
* **Set `queued` to show several announcements one at a time.** A queued
|
|
42
|
+
* announcement waits while a queued announcement before it in the same parent
|
|
43
|
+
* is still there, and shows when that one is removed: its message is then
|
|
44
|
+
* read out, and its `duration` starts. While it waits it renders nothing,
|
|
45
|
+
* is no region, and carries `:state(waiting)`. A server cannot see the
|
|
46
|
+
* announcements beside it, so a served page shows every one until the script
|
|
47
|
+
* runs.
|
|
48
|
+
*
|
|
32
49
|
* Set `duration` to dismiss it after a time. The clock stops while the pointer
|
|
33
50
|
* or focus is on the announcement, and continues from what was left, so a
|
|
34
|
-
* reader partway through is not cut off.
|
|
35
|
-
*
|
|
51
|
+
* reader partway through is not cut off. It stops while the page is hidden too,
|
|
52
|
+
* in another tab or a minimized window, so the message is not spent where
|
|
53
|
+
* nobody can see it. While the clock is stopped the announcement carries
|
|
54
|
+
* `:state(paused)`. When the time runs out it sends `helix-dismiss`, as the
|
|
55
|
+
* button does.
|
|
36
56
|
*
|
|
37
57
|
* @since 0.1.0
|
|
38
58
|
* @status stable
|
|
@@ -42,15 +62,19 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
|
|
|
42
62
|
*
|
|
43
63
|
* @slot - The message.
|
|
44
64
|
* @slot actions - Actions for the message, usually a link or a button.
|
|
45
|
-
* @slot icon - Replaces the
|
|
65
|
+
* @slot dismiss-icon - Replaces the cross inside the dismiss button, as `Callout`'s slot of the same name does.
|
|
66
|
+
* @slot icon - Replaces the cross inside the dismiss button. Deprecated: use `dismiss-icon`, which is read first.
|
|
46
67
|
*
|
|
47
68
|
* @event {HelixDismissEvent} helix-dismiss - The dismiss button was pressed, or `duration` ran out. The announcement does not remove itself, so remove it in response. Cancelable.
|
|
48
69
|
*
|
|
49
70
|
* @csspart actions - The region after the message that holds the actions.
|
|
50
71
|
* @csspart content - The region that holds the message.
|
|
51
72
|
* @csspart dismiss - The button that dismisses the announcement.
|
|
52
|
-
* @csspart dismiss-mark - The
|
|
73
|
+
* @csspart dismiss-mark - The cross on the dismiss button, shown when the `dismiss-icon` and `icon` slots are empty.
|
|
53
74
|
* @csspart live - A copy of the message in a live region, read by screen readers when the announcement appears after the page has loaded, and emptied seven seconds later. Visually hidden in the styled tier.
|
|
75
|
+
*
|
|
76
|
+
* @cssstate paused - The clock `duration` started is stopped, while the pointer or focus is on the announcement or the page is hidden.
|
|
77
|
+
* @cssstate waiting - The announcement is `queued` behind another, and renders nothing until that one is removed.
|
|
54
78
|
*/
|
|
55
79
|
export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement_base {
|
|
56
80
|
/**
|
|
@@ -61,6 +85,28 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
|
|
|
61
85
|
* own. The clock stops while the pointer or focus is on the announcement.
|
|
62
86
|
*/
|
|
63
87
|
duration?: number;
|
|
88
|
+
/**
|
|
89
|
+
* The key that moves focus to the announcement's first control, and back
|
|
90
|
+
* to where it was, written as keys joined by `+`, such as `F6` or `Alt+A`.
|
|
91
|
+
*
|
|
92
|
+
* F6 by default, the key React Aria's regions answer to. Empty turns it
|
|
93
|
+
* off. With several announcements, the first one in the page takes focus.
|
|
94
|
+
*/
|
|
95
|
+
hotkey: string;
|
|
96
|
+
/**
|
|
97
|
+
* The name of the announcement's region, which screen readers list among
|
|
98
|
+
* the page's landmarks. Translate it with the rest of your interface.
|
|
99
|
+
*
|
|
100
|
+
* Empty leaves the announcement no region.
|
|
101
|
+
*/
|
|
102
|
+
label: string;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the announcement waits its turn behind the queued announcements
|
|
105
|
+
* before it in the same parent, showing when the last of them is removed.
|
|
106
|
+
*
|
|
107
|
+
* Off by default, so every announcement on a page shows at once.
|
|
108
|
+
*/
|
|
109
|
+
queued: boolean;
|
|
64
110
|
/**
|
|
65
111
|
* The band's color.
|
|
66
112
|
*
|
|
@@ -84,15 +130,29 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
|
|
|
84
130
|
* axes, which is the test the registry answers to.
|
|
85
131
|
*/
|
|
86
132
|
tone?: 'accent' | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning';
|
|
133
|
+
/** Whether a queued announcement before this one is still there. */
|
|
134
|
+
private waiting;
|
|
135
|
+
/** Watches the parent for the announcements before this one leaving. */
|
|
136
|
+
private queue;
|
|
137
|
+
/** Whether a queued announcement comes before this one in its parent. */
|
|
138
|
+
private behind;
|
|
87
139
|
protected readonly arrival: ArrivalController;
|
|
88
140
|
/** The time `duration` gives it, held while a reader is on it. */
|
|
89
141
|
private readonly countdown;
|
|
142
|
+
private readonly scope;
|
|
143
|
+
/** Where focus was when `hotkey` moved it in. */
|
|
144
|
+
private origin;
|
|
145
|
+
/** Whether focus is inside the announcement, kept as it moves. */
|
|
146
|
+
private focused;
|
|
147
|
+
private readonly handleHotkey;
|
|
148
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
90
149
|
private readonly handleHold;
|
|
91
150
|
private readonly handleRelease;
|
|
92
151
|
connectedCallback(): void;
|
|
93
152
|
disconnectedCallback(): void;
|
|
94
153
|
protected firstUpdated(changed: PropertyValues): void;
|
|
95
154
|
protected updated(changed: PropertyValues): void;
|
|
155
|
+
private watchQueue;
|
|
96
156
|
/**
|
|
97
157
|
* Says on the `actions` region whether anything is in it.
|
|
98
158
|
*
|
|
@@ -117,7 +177,7 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
|
|
|
117
177
|
* draws a tone mark. An announcement has no tone mark at all.
|
|
118
178
|
*/
|
|
119
179
|
protected renderDismissIcon(): TemplateResult;
|
|
120
|
-
protected render(): TemplateResult;
|
|
180
|
+
protected render(): TemplateResult | typeof nothing;
|
|
121
181
|
}
|
|
122
182
|
declare global {
|
|
123
183
|
interface HTMLElementTagNameMap {
|
|
@@ -4,36 +4,107 @@ 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
|
-
|
|
7
|
+
var HelixHeadlessAnnouncement_1;
|
|
8
|
+
import { ArrivalController, ariaChord, CountdownController, customElement, deepActiveElement, FocusScopeController, HelixElement, hostAria, MixinDismissible, markRegion, matchesChord, onApple, reportRuntime, slottedWords, } from '@fusion.dev/helix-core';
|
|
8
9
|
import { x } from '@fusion.dev/helix-icons';
|
|
9
10
|
import { html, nothing } from 'lit';
|
|
10
|
-
import { property } from 'lit/decorators.js';
|
|
11
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
12
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
|
-
let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDismissible(HelixElement) {
|
|
13
|
+
let HelixHeadlessAnnouncement = HelixHeadlessAnnouncement_1 = class HelixHeadlessAnnouncement extends MixinDismissible(HelixElement) {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
16
|
+
this.hotkey = 'F6';
|
|
17
|
+
this.label = 'Announcement';
|
|
18
|
+
this.queued = false;
|
|
19
|
+
this.waiting = false;
|
|
15
20
|
this.arrival = new ArrivalController(this, {
|
|
16
21
|
arriving: () => !this.serverRendered && document.readyState === 'complete',
|
|
17
|
-
text: () => slottedWords(this, ['']),
|
|
22
|
+
text: () => (this.waiting ? '' : slottedWords(this, [''])),
|
|
18
23
|
});
|
|
19
24
|
this.countdown = new CountdownController(this, {
|
|
20
25
|
done: () => {
|
|
21
26
|
this.dismiss();
|
|
22
27
|
},
|
|
28
|
+
holdWhileHidden: true,
|
|
29
|
+
paused: (paused) => {
|
|
30
|
+
this.toggleState('paused', paused);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
this.scope = new FocusScopeController(this, {
|
|
34
|
+
contents: () => [
|
|
35
|
+
...(this.renderRoot
|
|
36
|
+
?.querySelector('slot[name="actions"]')
|
|
37
|
+
?.assignedElements({ flatten: true }) ?? []),
|
|
38
|
+
...[...(this.renderRoot?.querySelectorAll('[part="dismiss"]') ?? [])],
|
|
39
|
+
],
|
|
40
|
+
surface: () => null,
|
|
23
41
|
});
|
|
24
|
-
this.
|
|
42
|
+
this.focused = false;
|
|
43
|
+
this.handleHotkey = (event) => {
|
|
44
|
+
if (event.defaultPrevented || !matchesChord(event, this.hotkey, onApple())) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (this.scope.holdsFocus) {
|
|
48
|
+
if (this.scope.leave()) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
}
|
|
51
|
+
this.origin = undefined;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const other = event
|
|
55
|
+
.composedPath()
|
|
56
|
+
.some((node) => node !== this && node instanceof HelixHeadlessAnnouncement_1);
|
|
57
|
+
if (other || this.scope.controls.length === 0) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
const active = deepActiveElement();
|
|
62
|
+
this.origin = active instanceof HTMLElement ? active : undefined;
|
|
63
|
+
this.scope.enter();
|
|
64
|
+
};
|
|
65
|
+
this.handleHold = (event) => {
|
|
66
|
+
this.focused ||= event.type === 'focusin';
|
|
25
67
|
this.countdown.hold();
|
|
26
68
|
};
|
|
27
|
-
this.handleRelease = () => {
|
|
69
|
+
this.handleRelease = (event) => {
|
|
70
|
+
if (event.type === 'focusout') {
|
|
71
|
+
queueMicrotask(() => {
|
|
72
|
+
this.focused = this.matches(':focus-within');
|
|
73
|
+
});
|
|
74
|
+
}
|
|
28
75
|
this.countdown.release();
|
|
29
76
|
};
|
|
30
77
|
}
|
|
78
|
+
behind() {
|
|
79
|
+
if (!this.queued || (this.shadowRoot !== null && !this.hasUpdated)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
for (let at = this.previousElementSibling; at; at = at.previousElementSibling) {
|
|
83
|
+
if (at instanceof HelixHeadlessAnnouncement_1 && at.queued) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
willUpdate(changed) {
|
|
90
|
+
super.willUpdate(changed);
|
|
91
|
+
hostAria(this.internals, {
|
|
92
|
+
label: this.label,
|
|
93
|
+
role: this.label.trim() && !this.waiting ? 'region' : '',
|
|
94
|
+
});
|
|
95
|
+
if ('ariaKeyShortcuts' in this.internals) {
|
|
96
|
+
this.internals.ariaKeyShortcuts = ariaChord(this.hotkey, onApple()) || null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
31
99
|
connectedCallback() {
|
|
100
|
+
this.waiting = this.behind();
|
|
32
101
|
super.connectedCallback();
|
|
102
|
+
this.watchQueue();
|
|
33
103
|
this.addEventListener('mouseenter', this.handleHold);
|
|
34
104
|
this.addEventListener('mouseleave', this.handleRelease);
|
|
35
105
|
this.addEventListener('focusin', this.handleHold);
|
|
36
106
|
this.addEventListener('focusout', this.handleRelease);
|
|
107
|
+
document.addEventListener('keydown', this.handleHotkey);
|
|
37
108
|
if (this.hasUpdated) {
|
|
38
109
|
this.countdown.resume();
|
|
39
110
|
}
|
|
@@ -44,26 +115,74 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
|
|
|
44
115
|
this.removeEventListener('mouseleave', this.handleRelease);
|
|
45
116
|
this.removeEventListener('focusin', this.handleHold);
|
|
46
117
|
this.removeEventListener('focusout', this.handleRelease);
|
|
118
|
+
document.removeEventListener('keydown', this.handleHotkey);
|
|
119
|
+
this.queue?.disconnect();
|
|
120
|
+
const origin = this.focused ? this.origin : undefined;
|
|
121
|
+
this.focused = false;
|
|
122
|
+
this.origin = undefined;
|
|
123
|
+
if (origin) {
|
|
124
|
+
requestAnimationFrame(() => {
|
|
125
|
+
const active = deepActiveElement();
|
|
126
|
+
if (origin.isConnected && (active === null || active === document.body)) {
|
|
127
|
+
origin.focus({ preventScroll: true });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
47
131
|
}
|
|
48
132
|
firstUpdated(changed) {
|
|
49
133
|
super.firstUpdated(changed);
|
|
50
|
-
this.
|
|
134
|
+
this.watchQueue();
|
|
135
|
+
if (!this.waiting) {
|
|
136
|
+
this.countdown.start(this.duration);
|
|
137
|
+
}
|
|
138
|
+
if (this.querySelector(':scope > [slot="icon"]')) {
|
|
139
|
+
reportRuntime({
|
|
140
|
+
kind: 'deprecated',
|
|
141
|
+
message: `<${this.localName}>'s \`icon\` slot is deprecated: slot the glyph as \`dismiss-icon\`, the name Callout uses.`,
|
|
142
|
+
tag: this.localName,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
51
145
|
}
|
|
52
146
|
updated(changed) {
|
|
53
147
|
super.updated(changed);
|
|
54
148
|
this.markEmpty();
|
|
149
|
+
if (changed.has('queued')) {
|
|
150
|
+
this.watchQueue();
|
|
151
|
+
}
|
|
152
|
+
this.toggleState('waiting', this.waiting);
|
|
153
|
+
if (changed.has('waiting') && this.waiting) {
|
|
154
|
+
this.arrival.say();
|
|
155
|
+
}
|
|
156
|
+
else if (changed.get('waiting') === true) {
|
|
157
|
+
this.countdown.start(this.duration);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
watchQueue() {
|
|
161
|
+
this.queue?.disconnect();
|
|
162
|
+
this.waiting = this.behind();
|
|
163
|
+
if (this.queued && this.parentElement && typeof MutationObserver !== 'undefined') {
|
|
164
|
+
this.queue ??= new MutationObserver(() => {
|
|
165
|
+
this.waiting = this.behind();
|
|
166
|
+
});
|
|
167
|
+
this.queue.observe(this.parentElement, { childList: true });
|
|
168
|
+
}
|
|
55
169
|
}
|
|
56
170
|
markEmpty() {
|
|
57
171
|
markRegion(this.renderRoot, 'actions', ['actions']);
|
|
58
172
|
}
|
|
59
173
|
renderDismissIcon() {
|
|
60
|
-
return html `<slot name="icon"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
174
|
+
return html `<slot name="dismiss-icon"
|
|
175
|
+
><slot name="icon">
|
|
176
|
+
<svg part="dismiss-mark" viewBox=${x.viewBox} fill="currentColor" aria-hidden="true">
|
|
177
|
+
${unsafeSVG(x.content)}
|
|
178
|
+
</svg>
|
|
179
|
+
</slot></slot
|
|
180
|
+
>`;
|
|
65
181
|
}
|
|
66
182
|
render() {
|
|
183
|
+
if (this.waiting) {
|
|
184
|
+
return nothing;
|
|
185
|
+
}
|
|
67
186
|
return html `<div aria-hidden=${this.arrival.said === '' ? nothing : 'true'} part="content"
|
|
68
187
|
><slot @slotchange=${() => this.arrival.say()}></slot
|
|
69
188
|
></div>
|
|
@@ -84,10 +203,22 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
|
|
|
84
203
|
__decorate([
|
|
85
204
|
property({ type: Number })
|
|
86
205
|
], HelixHeadlessAnnouncement.prototype, "duration", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property()
|
|
208
|
+
], HelixHeadlessAnnouncement.prototype, "hotkey", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property()
|
|
211
|
+
], HelixHeadlessAnnouncement.prototype, "label", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ reflect: true, type: Boolean })
|
|
214
|
+
], HelixHeadlessAnnouncement.prototype, "queued", void 0);
|
|
87
215
|
__decorate([
|
|
88
216
|
property({ reflect: true })
|
|
89
217
|
], HelixHeadlessAnnouncement.prototype, "tone", void 0);
|
|
90
|
-
|
|
218
|
+
__decorate([
|
|
219
|
+
state()
|
|
220
|
+
], HelixHeadlessAnnouncement.prototype, "waiting", void 0);
|
|
221
|
+
HelixHeadlessAnnouncement = HelixHeadlessAnnouncement_1 = __decorate([
|
|
91
222
|
customElement('helix-headless-announcement')
|
|
92
223
|
], HelixHeadlessAnnouncement);
|
|
93
224
|
export { HelixHeadlessAnnouncement };
|
|
@@ -5,7 +5,10 @@ import '../../tooltip/index.js';
|
|
|
5
5
|
export interface AreaStack {
|
|
6
6
|
/** The table's columns that hold numbers, by their place among its cells. */
|
|
7
7
|
columns: number[];
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Each column's top edge at each reading: its running sum, or its own
|
|
10
|
+
* reading under `overlap`.
|
|
11
|
+
*/
|
|
9
12
|
layers: number[][];
|
|
10
13
|
/** Each column's heading. */
|
|
11
14
|
names: string[];
|
|
@@ -44,6 +47,11 @@ declare const HelixHeadlessAreaChart_base: typeof HelixElement & (new (...args:
|
|
|
44
47
|
* bands show each part's share. Use it to see which part grew. The default
|
|
45
48
|
* shows whether the total grew.
|
|
46
49
|
*
|
|
50
|
+
* `overlap` draws every band from zero, one in front of another, so each
|
|
51
|
+
* part's own amount is its height: the first column is in front. Use it to
|
|
52
|
+
* compare the parts with each other; the scale then fits the largest part
|
|
53
|
+
* rather than the total.
|
|
54
|
+
*
|
|
47
55
|
* The drawing is hidden from screen readers. The text summary gives the latest
|
|
48
56
|
* reading's total and each part's share of it, and the table beside the chart
|
|
49
57
|
* has every number.
|
|
@@ -121,6 +129,15 @@ export declare class HelixHeadlessAreaChart extends HelixHeadlessAreaChart_base
|
|
|
121
129
|
* a rule nobody sees.
|
|
122
130
|
*/
|
|
123
131
|
gridlines?: 'both' | 'category' | 'value';
|
|
132
|
+
/**
|
|
133
|
+
* Draws every band from zero, in front of the next, so a band's height is
|
|
134
|
+
* its own part's amount and not its place in a stack.
|
|
135
|
+
*
|
|
136
|
+
* Absent stacks the parts, so the top edge is the total. Set, the first
|
|
137
|
+
* column is in front and the scale fits the largest part. Reflected, because
|
|
138
|
+
* the styled tier lets the bands behind show through the ones in front.
|
|
139
|
+
*/
|
|
140
|
+
overlap: boolean;
|
|
124
141
|
/**
|
|
125
142
|
* Draws each reading as a hundred percent, so each band shows its share of
|
|
126
143
|
* the total.
|