@redvars/peacock 4.7.0 → 4.8.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/dist/accordion-item.js +4 -4
- package/dist/app-bar.js +1 -1
- package/dist/app-shell.js +2 -2
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.d.ts +2 -0
- package/dist/assets/theme.js +49 -29
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/bottom-sheet.js +3 -3
- package/dist/breadcrumb-item.js +1 -1
- package/dist/button-group.js +79 -0
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +26 -25
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +3 -3
- package/dist/calendar-month-view.js +3 -3
- package/dist/calendar-timeline.js +3 -3
- package/dist/card.js +2 -1
- package/dist/card.js.map +1 -1
- package/dist/carousel.js +182 -7
- package/dist/carousel.js.map +1 -1
- package/dist/{cartesian-chart-C8qKDXo8.js → cartesian-chart-UW1CYKRS.js} +2 -2
- package/dist/{cartesian-chart-C8qKDXo8.js.map → cartesian-chart-UW1CYKRS.js.map} +1 -1
- package/dist/cb-group.js +1 -1
- package/dist/chart-area.js +2 -2
- package/dist/chart-bar.js +2 -2
- package/dist/{chart-base-BpQMZZsw.js → chart-base-D5ujPGcl.js} +3 -3
- package/dist/{chart-base-BpQMZZsw.js.map → chart-base-D5ujPGcl.js.map} +1 -1
- package/dist/chart-doughnut.js +1 -1
- package/dist/chart-line.js +2 -2
- package/dist/chart-pie.js +2 -2
- package/dist/checkbox.js +5 -5
- package/dist/chip.js +34 -8
- package/dist/chip.js.map +1 -1
- package/dist/circular-progress.js +46 -15
- package/dist/circular-progress.js.map +1 -1
- package/dist/code-highlighter.js +1 -1
- package/dist/color-picker.js +1 -1
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +5 -5
- package/dist/condition-builder.js +1 -1
- package/dist/{condition-group-base-NcvOY-Zv.js → condition-group-base-DS76sprm.js} +2 -2
- package/dist/{condition-group-base-NcvOY-Zv.js.map → condition-group-base-DS76sprm.js.map} +1 -1
- package/dist/confirm-dialog.js +2 -2
- package/dist/custom-elements-jsdocs.json +302 -10
- package/dist/custom-elements.json +1128 -16
- package/dist/dependency-map.js +2 -2
- package/dist/{diagram-hv7hCgzx.js → diagram-DFO-X7yq.js} +2 -2
- package/dist/{diagram-hv7hCgzx.js.map → diagram-DFO-X7yq.js.map} +1 -1
- package/dist/diagram.js +1 -1
- package/dist/discussion.js +3 -3
- package/dist/{document-editor-CZBlz3ai.js → document-editor-CSS-wACs.js} +7 -7
- package/dist/{document-editor-CZBlz3ai.js.map → document-editor-CSS-wACs.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/dropdown-button.js +1 -1
- package/dist/erd.js +4 -4
- package/dist/fab-menu-item.js +189 -0
- package/dist/fab-menu-item.js.map +1 -0
- package/dist/fab-menu.js +326 -0
- package/dist/fab-menu.js.map +1 -0
- package/dist/fab.js +28 -17
- package/dist/fab.js.map +1 -1
- package/dist/field.js +1 -1
- package/dist/file-upload.js +1 -1
- package/dist/flow.js +1 -1
- package/dist/hover-card.js +5 -3
- package/dist/hover-card.js.map +1 -1
- package/dist/html-editor.js +4 -4
- package/dist/icon-button.js +26 -25
- package/dist/icon-button.js.map +1 -1
- package/dist/{index-DK3fREuj.js → index-BBxpsqx8.js} +4 -4
- package/dist/{index-DK3fREuj.js.map → index-BBxpsqx8.js.map} +1 -1
- package/dist/{index-CTEt3LtO.js → index-CDtKB0In.js} +4 -4
- package/dist/{index-CTEt3LtO.js.map → index-CDtKB0In.js.map} +1 -1
- package/dist/{index-Bag4vtx-.js → index-Tb0ky27z.js} +3 -3
- package/dist/{index-Bag4vtx-.js.map → index-Tb0ky27z.js.map} +1 -1
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/dist/{indicator-navigation-item-BG0TrdDE.js → indicator-navigation-item-aZsm-RpR.js} +17 -5
- package/dist/{indicator-navigation-item-BG0TrdDE.js.map → indicator-navigation-item-aZsm-RpR.js.map} +1 -1
- package/dist/inline-edit.js +1 -1
- package/dist/json-viewer.js +1 -1
- package/dist/linear-progress.js +51 -4
- package/dist/linear-progress.js.map +1 -1
- package/dist/link-button.js +26 -25
- package/dist/link-button.js.map +1 -1
- package/dist/loader-full.js +8 -5
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +17 -5
- package/dist/loader.js.map +1 -1
- package/dist/loading-indicator.js +301 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/markdown-editor.js +4 -4
- package/dist/mention-input.js +1 -1
- package/dist/menu.js +8 -6
- package/dist/menu.js.map +1 -1
- package/dist/{modal-Dds0rXAG.js → modal-ClWCCbxD.js} +7 -5
- package/dist/{modal-Dds0rXAG.js.map → modal-ClWCCbxD.js.map} +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-bar-item.js +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-drawer-group.js +1 -1
- package/dist/navigation-drawer.js +1 -1
- package/dist/navigation-rail-item.js +1 -1
- package/dist/navigation-rail.js +1 -1
- package/dist/notification-center.js +1 -1
- package/dist/number-counter.js +1 -1
- package/dist/{overlay-controller-BOk-kfil.js → overlay-controller-iVaiUqos.js} +20 -10
- package/dist/{overlay-controller-BOk-kfil.js.map → overlay-controller-iVaiUqos.js.map} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover-content.js +4 -2
- package/dist/popover-content.js.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/{progress-base-BhJK__VP.js → progress-base-BeLu9-Tq.js} +13 -1
- package/dist/progress-base-BeLu9-Tq.js.map +1 -0
- package/dist/prompt-input.js +5 -5
- package/dist/radio.js +3 -3
- package/dist/resizable-panels.js +1 -1
- package/dist/{rich-text-input-base-SrsPvc-j.js → rich-text-input-base-BCmnkpuV.js} +2 -2
- package/dist/{rich-text-input-base-SrsPvc-j.js.map → rich-text-input-base-BCmnkpuV.js.map} +1 -1
- package/dist/scroll-area.js +1 -1
- package/dist/search.js +1 -1
- package/dist/segmented-button.js +7 -2
- package/dist/segmented-button.js.map +1 -1
- package/dist/select.js +1 -1
- package/dist/side-sheet.js +3 -3
- package/dist/site-header.js +3 -3
- package/dist/site-nav-menu.js +1 -1
- package/dist/{slash-controller-DwL0nkqv.js → slash-controller-BFhzSjiR.js} +2 -2
- package/dist/{slash-controller-DwL0nkqv.js.map → slash-controller-BFhzSjiR.js.map} +1 -1
- package/dist/slider.js +163 -68
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +1 -1
- package/dist/src/button/button-group/button-group.d.ts +12 -0
- package/dist/src/button/fab/fab.d.ts +1 -0
- package/dist/src/carousel/carousel.d.ts +22 -0
- package/dist/src/chip/chip/chip.d.ts +4 -0
- package/dist/src/fab-menu/fab-menu-item.d.ts +30 -0
- package/dist/src/fab-menu/fab-menu.d.ts +64 -0
- package/dist/src/fab-menu/index.d.ts +2 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/loading-indicator/index.d.ts +1 -0
- package/dist/src/loading-indicator/loading-indicator.d.ts +44 -0
- package/dist/src/loading-indicator/shapes.d.ts +29 -0
- package/dist/src/progress/circular-progress/circular-progress.d.ts +3 -1
- package/dist/src/progress/linear-progress/linear-progress.d.ts +2 -1
- package/dist/src/progress/progress-base.d.ts +7 -0
- package/dist/src/slider/slider.d.ts +23 -3
- package/dist/src/toolbar/toolbar.d.ts +20 -0
- package/dist/step.js +1 -1
- package/dist/switch.js +5 -2
- package/dist/switch.js.map +1 -1
- package/dist/tab-group.js +13 -2
- package/dist/tab-group.js.map +1 -1
- package/dist/tab-panel.js +26 -0
- package/dist/tab-panel.js.map +1 -1
- package/dist/tab.js +23 -5
- package/dist/tab.js.map +1 -1
- package/dist/table.js +4 -4
- package/dist/tag.js +2 -1
- package/dist/tag.js.map +1 -1
- package/dist/test/button-group-press.test.d.ts +1 -0
- package/dist/test/fab-menu.test.d.ts +1 -0
- package/dist/test/loading-indicator.test.d.ts +1 -0
- package/dist/toolbar.js +102 -0
- package/dist/toolbar.js.map +1 -1
- package/dist/tooltip.js +5 -2
- package/dist/tooltip.js.map +1 -1
- package/dist/tour.js +3 -3
- package/dist/tree-chart.js +3 -3
- package/dist/tree-item.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{video-DgtGGvrk.js → video-DSQ07o3h.js} +2 -2
- package/dist/{video-DgtGGvrk.js.map → video-DSQ07o3h.js.map} +1 -1
- package/dist/video.js +1 -1
- package/dist/workflow.js +5 -5
- package/package.json +1 -1
- package/scss/tokens.css +364 -0
- package/src/__internal/chart/chart-base.scss +4 -2
- package/src/__internal/controllers/overlay-controller.ts +19 -9
- package/src/__internal/rich-text/editor-chrome.scss +2 -1
- package/src/accordion/accordion-item.scss +10 -6
- package/src/app-bar/app-bar.scss +2 -1
- package/src/app-shell/app-shell.scss +2 -2
- package/src/bottom-sheet/bottom-sheet.scss +4 -2
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.scss +4 -2
- package/src/button/button/button-base.scss +14 -12
- package/src/button/button/button-layers.scss +27 -5
- package/src/button/button-group/button-group.scss +6 -0
- package/src/button/button-group/button-group.ts +105 -0
- package/src/button/fab/fab-sizes.scss +2 -0
- package/src/button/fab/fab.scss +32 -17
- package/src/button/fab/fab.ts +1 -0
- package/src/calendar/calendar-column-view.scss +3 -3
- package/src/calendar/calendar-month-view.scss +3 -3
- package/src/calendar-timeline/calendar-timeline.scss +6 -3
- package/src/card/card.scss +2 -1
- package/src/carousel/carousel.scss +71 -2
- package/src/carousel/carousel.ts +159 -7
- package/src/chart-pie/chart-pie.scss +4 -2
- package/src/checkbox/checkbox.scss +13 -7
- package/src/chip/chip/chip.scss +41 -8
- package/src/chip/chip/chip.ts +4 -0
- package/src/chip/tag/tag.scss +2 -1
- package/src/code-highlighter/code-highlighter.scss +2 -1
- package/src/color-picker/color-picker.scss +1 -1
- package/src/comment-composer/comment-composer.scss +2 -1
- package/src/components.manifest.json +21 -0
- package/src/condition-builder/condition-group-base.scss +1 -1
- package/src/dependency-map/dependency-map.scss +4 -2
- package/src/diagram/diagram.scss +2 -1
- package/src/document-editor/document-editor.scss +1 -1
- package/src/dropdown-button/dropdown-button.scss +2 -1
- package/src/erd/erd.scss +8 -4
- package/src/fab-menu/fab-menu-item.scss +99 -0
- package/src/fab-menu/fab-menu-item.ts +58 -0
- package/src/fab-menu/fab-menu.scss +119 -0
- package/src/fab-menu/fab-menu.ts +193 -0
- package/src/fab-menu/index.ts +2 -0
- package/src/field/field.scss +1 -1
- package/src/file-upload/file-upload.scss +2 -2
- package/src/hover-card/hover-card.scss +9 -2
- package/src/index.ts +3 -0
- package/src/inline-edit/inline-edit.scss +2 -2
- package/src/json-viewer/json-viewer.scss +2 -1
- package/src/loader.ts +12 -0
- package/src/loading-indicator/index.ts +1 -0
- package/src/loading-indicator/loading-indicator.scss +52 -0
- package/src/loading-indicator/loading-indicator.ts +164 -0
- package/src/loading-indicator/shapes.ts +104 -0
- package/src/menu/menu/menu.scss +10 -6
- package/src/modal/modal.scss +8 -4
- package/src/navigation-drawer/navigation-drawer-group.scss +2 -2
- package/src/navigation-drawer/navigation-drawer.scss +3 -2
- package/src/navigation-rail/navigation-rail-item.scss +27 -5
- package/src/number-counter/number-counter.scss +1 -1
- package/src/pagination/pagination.scss +2 -1
- package/src/popover/popover-content.scss +7 -2
- package/src/progress/circular-progress/circular-progress.scss +3 -2
- package/src/progress/circular-progress/circular-progress.ts +43 -12
- package/src/progress/linear-progress/linear-progress.scss +70 -2
- package/src/progress/linear-progress/linear-progress.ts +4 -1
- package/src/progress/progress-base.ts +11 -0
- package/src/prompt-input/prompt-input.scss +2 -1
- package/src/radio/radio.scss +8 -4
- package/src/resizable-panels/resizable-panels.scss +2 -1
- package/src/scroll-area/scroll-area.scss +2 -1
- package/src/search/search.scss +2 -1
- package/src/segmented-button/segmented-button.scss +8 -3
- package/src/select/select.scss +2 -1
- package/src/side-sheet/side-sheet.scss +4 -2
- package/src/site-header/site-header.scss +4 -4
- package/src/site-header/site-nav-menu.scss +2 -2
- package/src/slider/slider.scss +127 -64
- package/src/slider/slider.ts +74 -9
- package/src/snackbar/snackbar.scss +5 -2
- package/src/sparkline/sparkline.scss +6 -3
- package/src/split-button/split-button.scss +4 -2
- package/src/stepper/step.scss +2 -1
- package/src/switch/switch.scss +21 -2
- package/src/table/table.scss +8 -4
- package/src/tabs/tab-group.ts +12 -2
- package/src/tabs/tab-panel.scss +31 -0
- package/src/tabs/tab.scss +28 -17
- package/src/toolbar/toolbar-colors.scss +11 -0
- package/src/toolbar/toolbar.scss +28 -0
- package/src/toolbar/toolbar.ts +74 -1
- package/src/tooltip/tooltip.scss +9 -3
- package/src/tour/tour.scss +2 -2
- package/src/tree/tree-item.scss +2 -1
- package/src/tree-chart/tree-chart.scss +3 -3
- package/src/video/video.scss +2 -1
- package/src/workflow/workflow.scss +5 -5
- package/dist/progress-base-BhJK__VP.js.map +0 -1
package/dist/markdown-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RichTextInputBase } from './rich-text-input-base-
|
|
1
|
+
import { R as RichTextInputBase } from './rich-text-input-base-BCmnkpuV.js';
|
|
2
2
|
import { i } from './lit-element-CKa37m3w.js';
|
|
3
3
|
import './property-Dn3pvFDo.js';
|
|
4
4
|
import './state-Bz6ycyYM.js';
|
|
@@ -7,14 +7,14 @@ import './base-Cl6v8-BZ.js';
|
|
|
7
7
|
import './class-map-DN-g_e4M.js';
|
|
8
8
|
import './directive-ZPhl09Yt.js';
|
|
9
9
|
import './style-map-D1ZICebN.js';
|
|
10
|
-
import './slash-controller-
|
|
10
|
+
import './slash-controller-BFhzSjiR.js';
|
|
11
11
|
import './diff-CT416thw.js';
|
|
12
12
|
import './ai-controller-DR_Tg0sN.js';
|
|
13
13
|
import './locale-DEsJZCQG.js';
|
|
14
14
|
import './sparkle-DbxCXWsC.js';
|
|
15
15
|
import './stream-C16hbcio.js';
|
|
16
16
|
import './floating-controller-CABF4tBT.js';
|
|
17
|
-
import './overlay-controller-
|
|
17
|
+
import './overlay-controller-iVaiUqos.js';
|
|
18
18
|
import './mention--NNhafc7.js';
|
|
19
19
|
import './url-BFUh__RO.js';
|
|
20
20
|
import './input-base-u60DF-pm.js';
|
|
@@ -904,7 +904,7 @@ img.ProseMirror-separator {
|
|
|
904
904
|
gap: 2px;
|
|
905
905
|
opacity: 0;
|
|
906
906
|
pointer-events: none;
|
|
907
|
-
transition: opacity
|
|
907
|
+
transition: opacity var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing);
|
|
908
908
|
}
|
|
909
909
|
.block-handle.visible {
|
|
910
910
|
opacity: 1;
|
package/dist/mention-input.js
CHANGED
|
@@ -5,7 +5,7 @@ import { e } from './query-CHb9Ft_d.js';
|
|
|
5
5
|
import { e as e$1 } from './class-map-DN-g_e4M.js';
|
|
6
6
|
import { s as spread } from './spread-B5cgadZl.js';
|
|
7
7
|
import { F as FloatingController } from './floating-controller-CABF4tBT.js';
|
|
8
|
-
import { O as OverlayController } from './overlay-controller-
|
|
8
|
+
import { O as OverlayController } from './overlay-controller-iVaiUqos.js';
|
|
9
9
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
10
10
|
import { F as FieldBase } from './field-base-D9lh_aNl.js';
|
|
11
11
|
import { n as nativeValidity } from './input-base-u60DF-pm.js';
|
package/dist/menu.js
CHANGED
|
@@ -97,10 +97,12 @@ var css_248z = i`* {
|
|
|
97
97
|
max-width: min(var(--menu-max-width, 100vw), var(--floating-available-width, 100vw));
|
|
98
98
|
max-height: min(var(--menu-max-height, 20rem), var(--floating-available-height, 100vh));
|
|
99
99
|
transform-origin: top center;
|
|
100
|
-
--_menu-enter-duration: var(--duration
|
|
101
|
-
|
|
102
|
-
--_menu-
|
|
103
|
-
--_menu-
|
|
100
|
+
--_menu-enter-duration: var(--motion-spring-fast-effects-duration),
|
|
101
|
+
var(--motion-spring-default-spatial-duration);
|
|
102
|
+
--_menu-exit-duration: var(--motion-spring-fast-effects-duration);
|
|
103
|
+
--_menu-enter-easing: var(--motion-spring-fast-effects-easing),
|
|
104
|
+
var(--motion-spring-default-spatial-easing);
|
|
105
|
+
--_menu-exit-easing: var(--motion-spring-fast-effects-easing);
|
|
104
106
|
transition-property: opacity, transform;
|
|
105
107
|
transition-duration: var(--_menu-exit-duration);
|
|
106
108
|
transition-timing-function: var(--_menu-exit-easing);
|
|
@@ -108,7 +110,7 @@ var css_248z = i`* {
|
|
|
108
110
|
.menu.closed {
|
|
109
111
|
opacity: 0;
|
|
110
112
|
pointer-events: none;
|
|
111
|
-
transform: translateY(-4px) scale(0.
|
|
113
|
+
transform: translateY(-4px) scale(0.92);
|
|
112
114
|
}
|
|
113
115
|
.menu.open {
|
|
114
116
|
opacity: 1;
|
|
@@ -119,7 +121,7 @@ var css_248z = i`* {
|
|
|
119
121
|
@starting-style {
|
|
120
122
|
.menu.open {
|
|
121
123
|
opacity: 0;
|
|
122
|
-
transform: translateY(-4px) scale(0.
|
|
124
|
+
transform: translateY(-4px) scale(0.92);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
.menu.preview {
|
package/dist/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sources":["../../src/menu/menu/menu.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './menu.scss';\nimport { FloatingController } from '../../__internal/controllers/floating-controller.js';\nimport type { CloseReason } from '../../__internal/controllers/overlay-controller.js';\nimport {\n type OverlayPlacement,\n toPhysicalPlacement,\n} from '../../__internal/utils/placement.js';\nimport { MenuItem } from '../menu-item/menu-item.js';\n\nexport type MenuCloseReason =\n | { kind: 'click-selection' }\n | { kind: 'keydown'; key: string }\n | { kind: 'outside-click' }\n | { kind: 'programmatic' };\n\n/** `detail` of the menu's `close` event. */\nexport interface MenuCloseDetail {\n /** The shared overlay close reason (ADR-030001). */\n reason: CloseReason;\n /** The menu's own, more detailed reason. */\n cause: MenuCloseReason;\n}\n\n/** Maps a menu close reason onto the reason every overlay uses. */\nfunction toCloseReason(reason: MenuCloseReason): CloseReason {\n switch (reason.kind) {\n case 'click-selection':\n return 'action';\n case 'keydown':\n if (reason.key === 'Escape') return 'escape';\n // Tab moves focus out of the menu, like a press outside.\n return reason.key === 'Tab' ? 'light-dismiss' : 'action';\n case 'outside-click':\n return 'light-dismiss';\n default:\n return 'api';\n }\n}\n\n/** Which item receives focus when the menu opens or `focus()` is called. */\nexport type MenuFocusTarget = 'active' | 'first' | 'last';\n\n/** Time after the last typed character before the typeahead buffer resets. */\nconst TYPEAHEAD_RESET_MS = 500;\n\n/** Fallback for removing the menu from the top layer when no transitionend arrives. */\nconst EXIT_FALLBACK_MS = 300;\n\nconst POSITION_ATTRIBUTES = [\n 'data-position-first',\n 'data-position-last',\n 'data-position-after-divider',\n 'data-position-before-divider',\n] as const;\n\n/**\n * @label Menu\n * @tag wc-menu\n * @rawTag menu\n * @summary A list of actions or choices that opens next to a button or another element.\n * @overview\n * <p>A menu opens next to an anchor element, in the browser's top layer, so it shows above dialogs,\n * sticky headers and any parent with <code>overflow: hidden</code>. Items are <code>wc-menu-item</code>\n * elements; a <code>wc-divider</code> separates groups and a <code>wc-sub-menu</code> nests a menu.</p>\n * <p>Keyboard: when the menu opens, focus moves to the selected item or the first enabled one. Arrow\n * Up/Down move with wrap-around, Home/End jump to the ends, typing a letter jumps to the next item\n * starting with it, Enter/Space activate, Escape closes and returns focus to the trigger, Tab closes.</p>\n * <p>Choices: items with <code>type=\"checkbox\"</code> toggle <code>selected</code> and keep the menu\n * open; items with <code>type=\"radio\"</code> select themselves, clear the other radio items between\n * the same <code>wc-divider</code>s and close the menu. The new state is set before\n * <code>menu-item-activate</code> fires.</p>\n *\n * @cssprop --menu-container-color - Background of the standard menu surface.\n * @cssprop --menu-item-label-color - Text color of the items.\n * @cssprop --menu-item-icon-color - Color of leading and trailing icons.\n * @cssprop --menu-item-selected-container-color - Background of selected items.\n * @cssprop --menu-item-selected-label-color - Text and icon color of selected items.\n * @cssprop --menu-max-height - Maximum height before the menu scrolls. Defaults to `20rem`; the menu never grows past the viewport.\n * @cssprop --menu-min-width - Minimum width of the menu. Defaults to `112px`.\n * @cssprop --menu-width - Width of the menu. Defaults to `max-content`.\n *\n * @fires {CustomEvent} open - Dispatched after the menu opens. Bubbles and is composed: check `event.target` to tell a submenu's event from the menu's own.\n * @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api', cause: MenuCloseReason}>} close - Dispatched after the menu closes. `reason` is the shared overlay reason (an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` / `open = false` `api`); `cause` is the menu's detailed reason. Bubbles and is composed.\n * @fires {CustomEvent<{item: MenuItem}>} menu-item-activate - Dispatched when an item is activated.\n *\n * @example\n * ```html\n * <wc-menu preview>\n * <wc-menu-item>Item 1</wc-menu-item>\n * <wc-menu-item selected>Item 2</wc-menu-item>\n * </wc-menu>\n * ```\n * @tags navigation\n */\nexport class Menu extends LitElement {\n static styles = [styles];\n\n static Item = MenuItem;\n\n /** Whether the menu is currently visible. */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Visual variant.\n * `\"standard\"` is one elevated surface; dividers are hairlines.\n * `\"expressive\"` splits the menu into separate rounded segments at each `wc-divider`.\n */\n @property({ type: String, reflect: true })\n variant: 'standard' | 'expressive' = 'standard';\n\n /** ID of the anchor element the menu is positioned relative to. */\n @property({ type: String })\n anchor = '';\n\n /**\n * Renders the menu statically in the page flow, without positioning or the top layer. For the\n * documentation demos only; not part of the public API.\n * @internal\n */\n @property({ type: Boolean, reflect: true })\n preview = false;\n\n /** When true, the menu will not close when a click occurs outside it. */\n @property({ type: Boolean, attribute: 'stay-open-on-outside-click' })\n stayOpenOnOutsideClick = false;\n\n /** When true, opening the menu leaves focus where it is instead of moving it to an item. */\n @property({ type: Boolean, attribute: 'no-autofocus' })\n noAutofocus = false;\n\n /**\n * Set by `wc-sub-menu` on the menu it nests.\n * @internal\n */\n @property({ type: Boolean, attribute: 'is-submenu' })\n isSubmenu = false;\n\n /**\n * Where the menu opens relative to its anchor: `top`, `bottom`, `start` or `end`, optionally\n * followed by `-start` or `-end` (ADR-030001). `start` and `end` follow the writing direction.\n * Defaults to `\"bottom-start\"`.\n */\n @property({ type: String })\n placement: OverlayPlacement = 'bottom-start';\n\n /** Distance in pixels between the menu and its anchor element. */\n @property({ type: Number })\n offset = 4;\n\n /** Index of the currently focused/active item within the enabled items list. */\n @state()\n private activeIndex = -1;\n\n @query('.menu')\n private readonly menuListElement!: HTMLElement | null;\n\n /**\n * Direct reference to the anchor element; takes precedence over the `anchor` ID property. Set by\n * the components that own a menu (dropdown button, split button, select, sub-menu).\n * @internal\n */\n anchorElement: HTMLElement | null = null;\n\n /** Controller managing floating-UI positioning. */\n private readonly _floatingController = new FloatingController(this, {\n trigger: 'manual',\n closeOnClickOutside: false,\n strategy: 'fixed',\n fitViewport: true,\n viewportPadding: 8,\n onOpenChange: isOpen => {\n if (isOpen || !this.open) {\n return;\n }\n\n this.close({ kind: 'outside-click' });\n },\n });\n\n /** Element that had focus before the menu opened; restored on close. */\n private _lastFocusedElement: HTMLElement | null = null;\n\n /** Reason that triggered the most recent close, sent as `cause` in the `close` event detail. */\n private _closeReason: MenuCloseReason = { kind: 'programmatic' };\n\n /** Item to focus when the menu opens; set by `show()`. */\n private _openFocus: MenuFocusTarget = 'active';\n\n private _typeaheadBuffer = '';\n\n private _typeaheadTimer?: number;\n\n private _exitTimer?: number;\n\n /** Elements that carry `data-position-*` attributes from the last sync. */\n private _positionedElements: HTMLElement[] = [];\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menu');\n }\n\n this.addEventListener('keydown', this._onKeyDown);\n this.addEventListener('click', this._onClick);\n this._syncAnchorAria();\n }\n\n disconnectedCallback() {\n this.removeEventListener('keydown', this._onKeyDown);\n this.removeEventListener('click', this._onClick);\n window.clearTimeout(this._typeaheadTimer);\n window.clearTimeout(this._exitTimer);\n this._floatingController.close();\n super.disconnectedCallback();\n }\n\n /** The items this menu owns: slotted `wc-menu-item`s (and subclasses) and the items of slotted `wc-sub-menu`s. */\n get items(): MenuItem[] {\n const items: MenuItem[] = [];\n for (const element of this._slottedElements()) {\n const item = this._resolveItem(element);\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n }\n\n /** Opens the menu. `focusTarget` picks the item that receives focus. */\n show(focusTarget: MenuFocusTarget = 'active') {\n this._openFocus = focusTarget;\n if (this.open) {\n this.focus(focusTarget);\n return;\n }\n\n this._closeReason = { kind: 'programmatic' };\n this.open = true;\n }\n\n close(reason: MenuCloseReason = { kind: 'programmatic' }) {\n if (!this.open) {\n return;\n }\n\n this._closeReason = reason;\n this.open = false;\n }\n\n /** Opens the menu when it is closed and closes it when it is open. */\n toggle() {\n if (this.open) {\n this.close();\n } else {\n this.show();\n }\n }\n\n /** Focuses an item: the selected or last active one (`\"active\"`), the first or the last. */\n // eslint-disable-next-line no-undef\n override focus(target: MenuFocusTarget | FocusOptions = 'active') {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n let index: number;\n if (target === 'first') {\n index = 0;\n } else if (target === 'last') {\n index = enabledItems.length - 1;\n } else {\n const selectedIndex = enabledItems.findIndex(item => item.selected);\n if (selectedIndex >= 0) {\n index = selectedIndex;\n } else if (\n this.activeIndex >= 0 &&\n this.activeIndex < enabledItems.length\n ) {\n index = this.activeIndex;\n } else {\n index = 0;\n }\n }\n\n this.activeIndex = index;\n this._syncRovingTabIndex();\n enabledItems[index]?.focus();\n }\n\n private _slottedElements(): Element[] {\n const slot = this.shadowRoot?.querySelector('slot');\n return slot?.assignedElements({ flatten: true }) ?? [];\n }\n\n /** The item that represents a slotted element: the element itself or the item of a `wc-sub-menu`. */\n private _resolveItem(element: Element): MenuItem | null {\n if (element instanceof MenuItem) {\n return element;\n }\n\n const maybeItem = (element as { item?: unknown }).item;\n return maybeItem instanceof MenuItem ? maybeItem : null;\n }\n\n private _resolveAnchorElement() {\n if (this.anchorElement) {\n return this.anchorElement;\n }\n\n if (!this.anchor) {\n return null;\n }\n\n const root = this.getRootNode() as Document | ShadowRoot;\n if ('getElementById' in root) {\n return root.getElementById(this.anchor);\n }\n\n return document.getElementById(this.anchor);\n }\n\n private _syncAnchorAria() {\n // Only an anchor given by ID is in the same tree as the menu, so aria-controls can point at it.\n // Components that pass anchorElement manage their own trigger ARIA.\n if (this.anchorElement || !this.anchor) {\n return;\n }\n\n const anchorEl = this._resolveAnchorElement();\n if (!anchorEl) {\n return;\n }\n\n if (!this.id) {\n this.id = `wc-menu-${Math.random().toString(36).slice(2, 9)}`;\n }\n\n anchorEl.setAttribute('aria-haspopup', this.getAttribute('role') ?? 'menu');\n anchorEl.setAttribute('aria-controls', this.id);\n anchorEl.setAttribute('aria-expanded', String(this.open));\n }\n\n private _enabledItems() {\n return this.items.filter(item => !item.disabled && !item.hidden);\n }\n\n /** Re-reads the items after they change (for example when a select filters its options). */\n syncItems() {\n this._syncRovingTabIndex();\n this._syncLayout();\n }\n\n private _syncRovingTabIndex() {\n const ownedItems = this.items;\n const enabledItems = this._enabledItems();\n for (const item of ownedItems) {\n item.tabIndex = -1;\n }\n\n if (!enabledItems.length) {\n this.activeIndex = -1;\n return;\n }\n\n if (this.activeIndex < 0 || this.activeIndex >= enabledItems.length) {\n const selectedIndex = enabledItems.findIndex(item => item.selected);\n this.activeIndex = Math.max(selectedIndex, 0);\n }\n\n enabledItems[this.activeIndex].tabIndex = 0;\n }\n\n private _setActiveByOffset(offset: 1 | -1) {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n if (this.activeIndex < 0) {\n this.activeIndex = offset === 1 ? 0 : enabledItems.length - 1;\n } else {\n const count = enabledItems.length;\n this.activeIndex = (this.activeIndex + offset + count) % count;\n }\n\n this._syncRovingTabIndex();\n enabledItems[this.activeIndex]?.focus();\n }\n\n private _setBoundaryActive(index: number) {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n this.activeIndex = index;\n this._syncRovingTabIndex();\n enabledItems[this.activeIndex]?.focus();\n }\n\n private _getActiveItem() {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length || this.activeIndex < 0) {\n return null;\n }\n\n return enabledItems[this.activeIndex] ?? null;\n }\n\n private _isEventFromThisMenu(event: Event) {\n const path = event.composedPath();\n const sourceMenu = path.find(target => target instanceof Menu);\n\n return sourceMenu === this;\n }\n\n private _ownedItemFromEvent(event: Event) {\n if (!this._isEventFromThisMenu(event)) {\n return null;\n }\n\n const path = event.composedPath();\n const ownedItems = this.items;\n\n for (const target of path) {\n if (target instanceof MenuItem) {\n const ownedItem = ownedItems.find(item => item === target);\n if (ownedItem) {\n return ownedItem;\n }\n }\n }\n\n return null;\n }\n\n private _setActiveItem(item: MenuItem) {\n const enabledItems = this._enabledItems();\n const nextIndex = enabledItems.indexOf(item);\n if (nextIndex < 0) {\n return;\n }\n\n this.activeIndex = nextIndex;\n this._syncRovingTabIndex();\n }\n\n private _dispatchItemActivate(item: MenuItem) {\n this.dispatchEvent(\n new CustomEvent('menu-item-activate', {\n bubbles: true,\n composed: true,\n detail: { item },\n }),\n );\n }\n\n /** Moves focus to the next item whose label starts with the typed characters. */\n private _typeahead(key: string) {\n window.clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = window.setTimeout(() => {\n this._typeaheadBuffer = '';\n }, TYPEAHEAD_RESET_MS);\n\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n const repeated =\n this._typeaheadBuffer.length > 0 &&\n [...this._typeaheadBuffer].every(char => char === key.toLowerCase());\n this._typeaheadBuffer += key.toLowerCase();\n // Typing the same letter again cycles through the items that start with it.\n const prefix = repeated ? key.toLowerCase() : this._typeaheadBuffer;\n const start = Math.max(this.activeIndex, 0);\n const count = enabledItems.length;\n const firstOffset = prefix.length === 1 ? 1 : 0;\n\n for (let step = firstOffset; step < count + firstOffset; step += 1) {\n const index = (start + step) % count;\n if (enabledItems[index].typeaheadText.startsWith(prefix)) {\n this._setBoundaryActive(index);\n return;\n }\n }\n }\n\n private _onClick = (event: Event) => {\n if (!this.open) {\n return;\n }\n\n const item = this._ownedItemFromEvent(event);\n if (!item || item.disabled || item.softDisabled) {\n return;\n }\n\n this._setActiveItem(item);\n this._applyChoice(item);\n this._dispatchItemActivate(item);\n // A checkbox item stays open, like native menus, so several can be toggled in a row.\n if (item.keepOpen || item.type === 'checkbox') {\n return;\n }\n\n this.close({ kind: 'click-selection' });\n };\n\n /** Toggles a checkbox item, or selects a radio item and clears the others of its group. */\n private _applyChoice(item: MenuItem) {\n if (item.type === 'checkbox') {\n // eslint-disable-next-line no-param-reassign\n item.selected = !item.selected;\n } else if (item.type === 'radio') {\n for (const other of this._radioGroup(item)) {\n other.selected = other === item;\n }\n }\n }\n\n /** The radio items in the same group as `item`: those between the same `wc-divider`s. */\n private _radioGroup(item: MenuItem): MenuItem[] {\n let group: MenuItem[] = [];\n let found = false;\n for (const element of this._slottedElements()) {\n if (element.tagName.toLowerCase() === 'wc-divider') {\n if (found) break;\n group = [];\n } else {\n const candidate = this._resolveItem(element);\n if (candidate?.type === 'radio') {\n group.push(candidate);\n found ||= candidate === item;\n }\n }\n }\n\n return found ? group : [item];\n }\n\n private _onKeyDown = (event: KeyboardEvent) => {\n if (!this.open) {\n return;\n }\n\n if (!this._isEventFromThisMenu(event)) {\n return;\n }\n\n const eventItem = this._ownedItemFromEvent(event);\n if (eventItem) {\n this._setActiveItem(eventItem);\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this._setActiveByOffset(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this._setActiveByOffset(-1);\n break;\n case 'Home':\n event.preventDefault();\n this._setBoundaryActive(0);\n break;\n case 'End': {\n event.preventDefault();\n const last = Math.max(this._enabledItems().length - 1, 0);\n this._setBoundaryActive(last);\n break;\n }\n case 'Escape':\n event.preventDefault();\n this.close({ kind: 'keydown', key: 'Escape' });\n break;\n case 'Tab':\n this.close({ kind: 'keydown', key: 'Tab' });\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const activeItem = this._getActiveItem();\n if (!activeItem) {\n return;\n }\n\n // Click the item's own button or link, as a pointer does: the click reaches the item's\n // listeners before a link follows its href, so `preventDefault()` (a single-page app\n // routing the link itself) works for the keyboard as it does for the mouse.\n (activeItem.itemElement ?? activeItem).click();\n break;\n }\n default:\n if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n ) {\n this._typeahead(event.key);\n }\n break;\n }\n };\n\n private _onSlotChange = () => {\n this._syncRovingTabIndex();\n this._syncLayout();\n };\n\n /** Sets `has-icons` and, for the expressive variant, the segment position attributes. */\n private _syncLayout() {\n const elements = this._slottedElements();\n\n this.toggleAttribute(\n 'has-icons',\n this.items.some(item => item.hasStartContent),\n );\n\n for (const el of this._positionedElements) {\n for (const name of POSITION_ATTRIBUTES) {\n el.removeAttribute(name);\n }\n }\n this._positionedElements = [];\n\n if (this.variant !== 'expressive') {\n return;\n }\n\n const isDivider = (el: Element) =>\n el.tagName.toLowerCase() === 'wc-divider';\n const mark = (\n el: Element | undefined,\n name: (typeof POSITION_ATTRIBUTES)[number],\n ) => {\n if (!el) {\n return;\n }\n\n // Set the attribute on the item itself (not a wrapping wc-sub-menu) so it styles its own host.\n const target = this._resolveItem(el) ?? el;\n if (target instanceof HTMLElement) {\n target.setAttribute(name, '');\n this._positionedElements.push(target);\n }\n };\n\n const entries = elements.filter(el => !isDivider(el));\n mark(entries[0], 'data-position-first');\n mark(entries[entries.length - 1], 'data-position-last');\n\n elements.forEach((el, index) => {\n if (!isDivider(el)) {\n return;\n }\n\n const previous = elements\n .slice(0, index)\n .reverse()\n .find(candidate => !isDivider(candidate));\n const next = elements\n .slice(index + 1)\n .find(candidate => !isDivider(candidate));\n mark(previous, 'data-position-before-divider');\n mark(next, 'data-position-after-divider');\n });\n }\n\n /** Shows the menu surface in the top layer, or hides it there once the exit transition ends. */\n private _syncLayer() {\n const layer = this.menuListElement;\n if (\n !layer ||\n typeof layer.showPopover !== 'function' ||\n !layer.hasAttribute('popover')\n ) {\n return;\n }\n\n window.clearTimeout(this._exitTimer);\n const showing = layer.matches(':popover-open');\n\n if (this.open && this.isConnected) {\n if (!showing) {\n layer.showPopover();\n }\n return;\n }\n\n if (!showing) {\n return;\n }\n\n const controller = new AbortController();\n const hide = () => {\n window.clearTimeout(this._exitTimer);\n controller.abort();\n if (!this.open && layer.matches(':popover-open')) {\n layer.hidePopover();\n }\n };\n layer.addEventListener(\n 'transitionend',\n (event: TransitionEvent) => {\n if (event.target === layer && event.propertyName === 'opacity') {\n hide();\n }\n },\n { signal: controller.signal },\n );\n this._exitTimer = window.setTimeout(hide, EXIT_FALLBACK_MS);\n }\n\n private _applyPositioning() {\n if (!this.open || !this.menuListElement || this.preview) {\n return;\n }\n\n const anchorEl = this._resolveAnchorElement();\n if (!anchorEl) {\n return;\n }\n\n this._floatingController.setOptions({\n placement: toPhysicalPlacement(this.placement, this),\n offset: this.offset,\n strategy: 'fixed',\n closeOnClickOutside: !this.stayOpenOnOutsideClick,\n });\n this._floatingController.setElements(anchorEl, this.menuListElement);\n this._floatingController.open();\n }\n\n protected override updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('anchor') || changedProperties.has('open')) {\n this._syncAnchorAria();\n }\n\n if (changedProperties.has('variant')) {\n this._syncLayout();\n }\n\n if (changedProperties.has('open')) {\n this._syncLayer();\n // While open, the menu handles Escape itself: an overlay around it (popover, modal) must\n // let it close first (see the overlay controller).\n this.toggleAttribute('data-handles-escape', this.open);\n\n if (this.open) {\n this._lastFocusedElement = this._deepActiveElement();\n this._syncRovingTabIndex();\n this._syncLayout();\n this._applyPositioning();\n\n if (!this.noAutofocus && !this.preview) {\n this.focus(this._openFocus);\n }\n this._openFocus = 'active';\n\n this.dispatchEvent(\n new CustomEvent('open', { bubbles: true, composed: true }),\n );\n } else if (changedProperties.get('open') === true) {\n this._floatingController.close();\n\n const reason = this._closeReason;\n this.dispatchEvent(\n new CustomEvent<MenuCloseDetail>('close', {\n detail: { reason: toCloseReason(reason), cause: reason },\n bubbles: true,\n composed: true,\n }),\n );\n\n const shouldRestoreFocus =\n reason.kind !== 'outside-click' &&\n !(reason.kind === 'keydown' && reason.key === 'Tab');\n\n if (!this.isSubmenu && shouldRestoreFocus && this._focusIsInside()) {\n this._lastFocusedElement?.focus();\n }\n this._lastFocusedElement = null;\n }\n }\n\n if (\n (changedProperties.has('anchor') ||\n changedProperties.has('placement') ||\n changedProperties.has('offset')) &&\n !changedProperties.has('open') &&\n this.open\n ) {\n this._applyPositioning();\n }\n }\n\n /** The focused element, looking through open shadow roots. */\n private _deepActiveElement(): HTMLElement | null {\n let active: Element | null = document.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active instanceof HTMLElement ? active : null;\n }\n\n /** Whether focus is in this menu (or nowhere), so restoring it does not steal focus from elsewhere. */\n private _focusIsInside() {\n const active = document.activeElement;\n if (!active || active === document.body) {\n return true;\n }\n\n return (\n active === this ||\n this.contains(active) ||\n this.shadowRoot?.contains(active) === true\n );\n }\n\n render() {\n return html`\n <div\n class=\"${classMap({\n menu: true,\n open: !this.preview && this.open,\n closed: !this.preview && !this.open,\n preview: this.preview,\n })}\"\n popover=${this.preview ? nothing : 'manual'}\n part=\"surface\"\n >\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"menu-content\">\n <slot @slotchange=\"${this._onSlotChange}\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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mB,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGR,UAAA,CAAA;IADhBC,CAAK,CAAC,OAAO;AACwC,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"menu.js","sources":["../../src/menu/menu/menu.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './menu.scss';\nimport { FloatingController } from '../../__internal/controllers/floating-controller.js';\nimport type { CloseReason } from '../../__internal/controllers/overlay-controller.js';\nimport {\n type OverlayPlacement,\n toPhysicalPlacement,\n} from '../../__internal/utils/placement.js';\nimport { MenuItem } from '../menu-item/menu-item.js';\n\nexport type MenuCloseReason =\n | { kind: 'click-selection' }\n | { kind: 'keydown'; key: string }\n | { kind: 'outside-click' }\n | { kind: 'programmatic' };\n\n/** `detail` of the menu's `close` event. */\nexport interface MenuCloseDetail {\n /** The shared overlay close reason (ADR-030001). */\n reason: CloseReason;\n /** The menu's own, more detailed reason. */\n cause: MenuCloseReason;\n}\n\n/** Maps a menu close reason onto the reason every overlay uses. */\nfunction toCloseReason(reason: MenuCloseReason): CloseReason {\n switch (reason.kind) {\n case 'click-selection':\n return 'action';\n case 'keydown':\n if (reason.key === 'Escape') return 'escape';\n // Tab moves focus out of the menu, like a press outside.\n return reason.key === 'Tab' ? 'light-dismiss' : 'action';\n case 'outside-click':\n return 'light-dismiss';\n default:\n return 'api';\n }\n}\n\n/** Which item receives focus when the menu opens or `focus()` is called. */\nexport type MenuFocusTarget = 'active' | 'first' | 'last';\n\n/** Time after the last typed character before the typeahead buffer resets. */\nconst TYPEAHEAD_RESET_MS = 500;\n\n/** Fallback for removing the menu from the top layer when no transitionend arrives. */\nconst EXIT_FALLBACK_MS = 300;\n\nconst POSITION_ATTRIBUTES = [\n 'data-position-first',\n 'data-position-last',\n 'data-position-after-divider',\n 'data-position-before-divider',\n] as const;\n\n/**\n * @label Menu\n * @tag wc-menu\n * @rawTag menu\n * @summary A list of actions or choices that opens next to a button or another element.\n * @overview\n * <p>A menu opens next to an anchor element, in the browser's top layer, so it shows above dialogs,\n * sticky headers and any parent with <code>overflow: hidden</code>. Items are <code>wc-menu-item</code>\n * elements; a <code>wc-divider</code> separates groups and a <code>wc-sub-menu</code> nests a menu.</p>\n * <p>Keyboard: when the menu opens, focus moves to the selected item or the first enabled one. Arrow\n * Up/Down move with wrap-around, Home/End jump to the ends, typing a letter jumps to the next item\n * starting with it, Enter/Space activate, Escape closes and returns focus to the trigger, Tab closes.</p>\n * <p>Choices: items with <code>type=\"checkbox\"</code> toggle <code>selected</code> and keep the menu\n * open; items with <code>type=\"radio\"</code> select themselves, clear the other radio items between\n * the same <code>wc-divider</code>s and close the menu. The new state is set before\n * <code>menu-item-activate</code> fires.</p>\n *\n * @cssprop --menu-container-color - Background of the standard menu surface.\n * @cssprop --menu-item-label-color - Text color of the items.\n * @cssprop --menu-item-icon-color - Color of leading and trailing icons.\n * @cssprop --menu-item-selected-container-color - Background of selected items.\n * @cssprop --menu-item-selected-label-color - Text and icon color of selected items.\n * @cssprop --menu-max-height - Maximum height before the menu scrolls. Defaults to `20rem`; the menu never grows past the viewport.\n * @cssprop --menu-min-width - Minimum width of the menu. Defaults to `112px`.\n * @cssprop --menu-width - Width of the menu. Defaults to `max-content`.\n *\n * @fires {CustomEvent} open - Dispatched after the menu opens. Bubbles and is composed: check `event.target` to tell a submenu's event from the menu's own.\n * @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api', cause: MenuCloseReason}>} close - Dispatched after the menu closes. `reason` is the shared overlay reason (an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` / `open = false` `api`); `cause` is the menu's detailed reason. Bubbles and is composed.\n * @fires {CustomEvent<{item: MenuItem}>} menu-item-activate - Dispatched when an item is activated.\n *\n * @example\n * ```html\n * <wc-menu preview>\n * <wc-menu-item>Item 1</wc-menu-item>\n * <wc-menu-item selected>Item 2</wc-menu-item>\n * </wc-menu>\n * ```\n * @tags navigation\n */\nexport class Menu extends LitElement {\n static styles = [styles];\n\n static Item = MenuItem;\n\n /** Whether the menu is currently visible. */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Visual variant.\n * `\"standard\"` is one elevated surface; dividers are hairlines.\n * `\"expressive\"` splits the menu into separate rounded segments at each `wc-divider`.\n */\n @property({ type: String, reflect: true })\n variant: 'standard' | 'expressive' = 'standard';\n\n /** ID of the anchor element the menu is positioned relative to. */\n @property({ type: String })\n anchor = '';\n\n /**\n * Renders the menu statically in the page flow, without positioning or the top layer. For the\n * documentation demos only; not part of the public API.\n * @internal\n */\n @property({ type: Boolean, reflect: true })\n preview = false;\n\n /** When true, the menu will not close when a click occurs outside it. */\n @property({ type: Boolean, attribute: 'stay-open-on-outside-click' })\n stayOpenOnOutsideClick = false;\n\n /** When true, opening the menu leaves focus where it is instead of moving it to an item. */\n @property({ type: Boolean, attribute: 'no-autofocus' })\n noAutofocus = false;\n\n /**\n * Set by `wc-sub-menu` on the menu it nests.\n * @internal\n */\n @property({ type: Boolean, attribute: 'is-submenu' })\n isSubmenu = false;\n\n /**\n * Where the menu opens relative to its anchor: `top`, `bottom`, `start` or `end`, optionally\n * followed by `-start` or `-end` (ADR-030001). `start` and `end` follow the writing direction.\n * Defaults to `\"bottom-start\"`.\n */\n @property({ type: String })\n placement: OverlayPlacement = 'bottom-start';\n\n /** Distance in pixels between the menu and its anchor element. */\n @property({ type: Number })\n offset = 4;\n\n /** Index of the currently focused/active item within the enabled items list. */\n @state()\n private activeIndex = -1;\n\n @query('.menu')\n private readonly menuListElement!: HTMLElement | null;\n\n /**\n * Direct reference to the anchor element; takes precedence over the `anchor` ID property. Set by\n * the components that own a menu (dropdown button, split button, select, sub-menu).\n * @internal\n */\n anchorElement: HTMLElement | null = null;\n\n /** Controller managing floating-UI positioning. */\n private readonly _floatingController = new FloatingController(this, {\n trigger: 'manual',\n closeOnClickOutside: false,\n strategy: 'fixed',\n fitViewport: true,\n viewportPadding: 8,\n onOpenChange: isOpen => {\n if (isOpen || !this.open) {\n return;\n }\n\n this.close({ kind: 'outside-click' });\n },\n });\n\n /** Element that had focus before the menu opened; restored on close. */\n private _lastFocusedElement: HTMLElement | null = null;\n\n /** Reason that triggered the most recent close, sent as `cause` in the `close` event detail. */\n private _closeReason: MenuCloseReason = { kind: 'programmatic' };\n\n /** Item to focus when the menu opens; set by `show()`. */\n private _openFocus: MenuFocusTarget = 'active';\n\n private _typeaheadBuffer = '';\n\n private _typeaheadTimer?: number;\n\n private _exitTimer?: number;\n\n /** Elements that carry `data-position-*` attributes from the last sync. */\n private _positionedElements: HTMLElement[] = [];\n\n connectedCallback() {\n // eslint-disable-next-line wc/guard-super-call\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menu');\n }\n\n this.addEventListener('keydown', this._onKeyDown);\n this.addEventListener('click', this._onClick);\n this._syncAnchorAria();\n }\n\n disconnectedCallback() {\n this.removeEventListener('keydown', this._onKeyDown);\n this.removeEventListener('click', this._onClick);\n window.clearTimeout(this._typeaheadTimer);\n window.clearTimeout(this._exitTimer);\n this._floatingController.close();\n super.disconnectedCallback();\n }\n\n /** The items this menu owns: slotted `wc-menu-item`s (and subclasses) and the items of slotted `wc-sub-menu`s. */\n get items(): MenuItem[] {\n const items: MenuItem[] = [];\n for (const element of this._slottedElements()) {\n const item = this._resolveItem(element);\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n }\n\n /** Opens the menu. `focusTarget` picks the item that receives focus. */\n show(focusTarget: MenuFocusTarget = 'active') {\n this._openFocus = focusTarget;\n if (this.open) {\n this.focus(focusTarget);\n return;\n }\n\n this._closeReason = { kind: 'programmatic' };\n this.open = true;\n }\n\n close(reason: MenuCloseReason = { kind: 'programmatic' }) {\n if (!this.open) {\n return;\n }\n\n this._closeReason = reason;\n this.open = false;\n }\n\n /** Opens the menu when it is closed and closes it when it is open. */\n toggle() {\n if (this.open) {\n this.close();\n } else {\n this.show();\n }\n }\n\n /** Focuses an item: the selected or last active one (`\"active\"`), the first or the last. */\n // eslint-disable-next-line no-undef\n override focus(target: MenuFocusTarget | FocusOptions = 'active') {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n let index: number;\n if (target === 'first') {\n index = 0;\n } else if (target === 'last') {\n index = enabledItems.length - 1;\n } else {\n const selectedIndex = enabledItems.findIndex(item => item.selected);\n if (selectedIndex >= 0) {\n index = selectedIndex;\n } else if (\n this.activeIndex >= 0 &&\n this.activeIndex < enabledItems.length\n ) {\n index = this.activeIndex;\n } else {\n index = 0;\n }\n }\n\n this.activeIndex = index;\n this._syncRovingTabIndex();\n enabledItems[index]?.focus();\n }\n\n private _slottedElements(): Element[] {\n const slot = this.shadowRoot?.querySelector('slot');\n return slot?.assignedElements({ flatten: true }) ?? [];\n }\n\n /** The item that represents a slotted element: the element itself or the item of a `wc-sub-menu`. */\n private _resolveItem(element: Element): MenuItem | null {\n if (element instanceof MenuItem) {\n return element;\n }\n\n const maybeItem = (element as { item?: unknown }).item;\n return maybeItem instanceof MenuItem ? maybeItem : null;\n }\n\n private _resolveAnchorElement() {\n if (this.anchorElement) {\n return this.anchorElement;\n }\n\n if (!this.anchor) {\n return null;\n }\n\n const root = this.getRootNode() as Document | ShadowRoot;\n if ('getElementById' in root) {\n return root.getElementById(this.anchor);\n }\n\n return document.getElementById(this.anchor);\n }\n\n private _syncAnchorAria() {\n // Only an anchor given by ID is in the same tree as the menu, so aria-controls can point at it.\n // Components that pass anchorElement manage their own trigger ARIA.\n if (this.anchorElement || !this.anchor) {\n return;\n }\n\n const anchorEl = this._resolveAnchorElement();\n if (!anchorEl) {\n return;\n }\n\n if (!this.id) {\n this.id = `wc-menu-${Math.random().toString(36).slice(2, 9)}`;\n }\n\n anchorEl.setAttribute('aria-haspopup', this.getAttribute('role') ?? 'menu');\n anchorEl.setAttribute('aria-controls', this.id);\n anchorEl.setAttribute('aria-expanded', String(this.open));\n }\n\n private _enabledItems() {\n return this.items.filter(item => !item.disabled && !item.hidden);\n }\n\n /** Re-reads the items after they change (for example when a select filters its options). */\n syncItems() {\n this._syncRovingTabIndex();\n this._syncLayout();\n }\n\n private _syncRovingTabIndex() {\n const ownedItems = this.items;\n const enabledItems = this._enabledItems();\n for (const item of ownedItems) {\n item.tabIndex = -1;\n }\n\n if (!enabledItems.length) {\n this.activeIndex = -1;\n return;\n }\n\n if (this.activeIndex < 0 || this.activeIndex >= enabledItems.length) {\n const selectedIndex = enabledItems.findIndex(item => item.selected);\n this.activeIndex = Math.max(selectedIndex, 0);\n }\n\n enabledItems[this.activeIndex].tabIndex = 0;\n }\n\n private _setActiveByOffset(offset: 1 | -1) {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n if (this.activeIndex < 0) {\n this.activeIndex = offset === 1 ? 0 : enabledItems.length - 1;\n } else {\n const count = enabledItems.length;\n this.activeIndex = (this.activeIndex + offset + count) % count;\n }\n\n this._syncRovingTabIndex();\n enabledItems[this.activeIndex]?.focus();\n }\n\n private _setBoundaryActive(index: number) {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n this.activeIndex = index;\n this._syncRovingTabIndex();\n enabledItems[this.activeIndex]?.focus();\n }\n\n private _getActiveItem() {\n const enabledItems = this._enabledItems();\n if (!enabledItems.length || this.activeIndex < 0) {\n return null;\n }\n\n return enabledItems[this.activeIndex] ?? null;\n }\n\n private _isEventFromThisMenu(event: Event) {\n const path = event.composedPath();\n const sourceMenu = path.find(target => target instanceof Menu);\n\n return sourceMenu === this;\n }\n\n private _ownedItemFromEvent(event: Event) {\n if (!this._isEventFromThisMenu(event)) {\n return null;\n }\n\n const path = event.composedPath();\n const ownedItems = this.items;\n\n for (const target of path) {\n if (target instanceof MenuItem) {\n const ownedItem = ownedItems.find(item => item === target);\n if (ownedItem) {\n return ownedItem;\n }\n }\n }\n\n return null;\n }\n\n private _setActiveItem(item: MenuItem) {\n const enabledItems = this._enabledItems();\n const nextIndex = enabledItems.indexOf(item);\n if (nextIndex < 0) {\n return;\n }\n\n this.activeIndex = nextIndex;\n this._syncRovingTabIndex();\n }\n\n private _dispatchItemActivate(item: MenuItem) {\n this.dispatchEvent(\n new CustomEvent('menu-item-activate', {\n bubbles: true,\n composed: true,\n detail: { item },\n }),\n );\n }\n\n /** Moves focus to the next item whose label starts with the typed characters. */\n private _typeahead(key: string) {\n window.clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = window.setTimeout(() => {\n this._typeaheadBuffer = '';\n }, TYPEAHEAD_RESET_MS);\n\n const enabledItems = this._enabledItems();\n if (!enabledItems.length) {\n return;\n }\n\n const repeated =\n this._typeaheadBuffer.length > 0 &&\n [...this._typeaheadBuffer].every(char => char === key.toLowerCase());\n this._typeaheadBuffer += key.toLowerCase();\n // Typing the same letter again cycles through the items that start with it.\n const prefix = repeated ? key.toLowerCase() : this._typeaheadBuffer;\n const start = Math.max(this.activeIndex, 0);\n const count = enabledItems.length;\n const firstOffset = prefix.length === 1 ? 1 : 0;\n\n for (let step = firstOffset; step < count + firstOffset; step += 1) {\n const index = (start + step) % count;\n if (enabledItems[index].typeaheadText.startsWith(prefix)) {\n this._setBoundaryActive(index);\n return;\n }\n }\n }\n\n private _onClick = (event: Event) => {\n if (!this.open) {\n return;\n }\n\n const item = this._ownedItemFromEvent(event);\n if (!item || item.disabled || item.softDisabled) {\n return;\n }\n\n this._setActiveItem(item);\n this._applyChoice(item);\n this._dispatchItemActivate(item);\n // A checkbox item stays open, like native menus, so several can be toggled in a row.\n if (item.keepOpen || item.type === 'checkbox') {\n return;\n }\n\n this.close({ kind: 'click-selection' });\n };\n\n /** Toggles a checkbox item, or selects a radio item and clears the others of its group. */\n private _applyChoice(item: MenuItem) {\n if (item.type === 'checkbox') {\n // eslint-disable-next-line no-param-reassign\n item.selected = !item.selected;\n } else if (item.type === 'radio') {\n for (const other of this._radioGroup(item)) {\n other.selected = other === item;\n }\n }\n }\n\n /** The radio items in the same group as `item`: those between the same `wc-divider`s. */\n private _radioGroup(item: MenuItem): MenuItem[] {\n let group: MenuItem[] = [];\n let found = false;\n for (const element of this._slottedElements()) {\n if (element.tagName.toLowerCase() === 'wc-divider') {\n if (found) break;\n group = [];\n } else {\n const candidate = this._resolveItem(element);\n if (candidate?.type === 'radio') {\n group.push(candidate);\n found ||= candidate === item;\n }\n }\n }\n\n return found ? group : [item];\n }\n\n private _onKeyDown = (event: KeyboardEvent) => {\n if (!this.open) {\n return;\n }\n\n if (!this._isEventFromThisMenu(event)) {\n return;\n }\n\n const eventItem = this._ownedItemFromEvent(event);\n if (eventItem) {\n this._setActiveItem(eventItem);\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this._setActiveByOffset(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this._setActiveByOffset(-1);\n break;\n case 'Home':\n event.preventDefault();\n this._setBoundaryActive(0);\n break;\n case 'End': {\n event.preventDefault();\n const last = Math.max(this._enabledItems().length - 1, 0);\n this._setBoundaryActive(last);\n break;\n }\n case 'Escape':\n event.preventDefault();\n this.close({ kind: 'keydown', key: 'Escape' });\n break;\n case 'Tab':\n this.close({ kind: 'keydown', key: 'Tab' });\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const activeItem = this._getActiveItem();\n if (!activeItem) {\n return;\n }\n\n // Click the item's own button or link, as a pointer does: the click reaches the item's\n // listeners before a link follows its href, so `preventDefault()` (a single-page app\n // routing the link itself) works for the keyboard as it does for the mouse.\n (activeItem.itemElement ?? activeItem).click();\n break;\n }\n default:\n if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n ) {\n this._typeahead(event.key);\n }\n break;\n }\n };\n\n private _onSlotChange = () => {\n this._syncRovingTabIndex();\n this._syncLayout();\n };\n\n /** Sets `has-icons` and, for the expressive variant, the segment position attributes. */\n private _syncLayout() {\n const elements = this._slottedElements();\n\n this.toggleAttribute(\n 'has-icons',\n this.items.some(item => item.hasStartContent),\n );\n\n for (const el of this._positionedElements) {\n for (const name of POSITION_ATTRIBUTES) {\n el.removeAttribute(name);\n }\n }\n this._positionedElements = [];\n\n if (this.variant !== 'expressive') {\n return;\n }\n\n const isDivider = (el: Element) =>\n el.tagName.toLowerCase() === 'wc-divider';\n const mark = (\n el: Element | undefined,\n name: (typeof POSITION_ATTRIBUTES)[number],\n ) => {\n if (!el) {\n return;\n }\n\n // Set the attribute on the item itself (not a wrapping wc-sub-menu) so it styles its own host.\n const target = this._resolveItem(el) ?? el;\n if (target instanceof HTMLElement) {\n target.setAttribute(name, '');\n this._positionedElements.push(target);\n }\n };\n\n const entries = elements.filter(el => !isDivider(el));\n mark(entries[0], 'data-position-first');\n mark(entries[entries.length - 1], 'data-position-last');\n\n elements.forEach((el, index) => {\n if (!isDivider(el)) {\n return;\n }\n\n const previous = elements\n .slice(0, index)\n .reverse()\n .find(candidate => !isDivider(candidate));\n const next = elements\n .slice(index + 1)\n .find(candidate => !isDivider(candidate));\n mark(previous, 'data-position-before-divider');\n mark(next, 'data-position-after-divider');\n });\n }\n\n /** Shows the menu surface in the top layer, or hides it there once the exit transition ends. */\n private _syncLayer() {\n const layer = this.menuListElement;\n if (\n !layer ||\n typeof layer.showPopover !== 'function' ||\n !layer.hasAttribute('popover')\n ) {\n return;\n }\n\n window.clearTimeout(this._exitTimer);\n const showing = layer.matches(':popover-open');\n\n if (this.open && this.isConnected) {\n if (!showing) {\n layer.showPopover();\n }\n return;\n }\n\n if (!showing) {\n return;\n }\n\n const controller = new AbortController();\n const hide = () => {\n window.clearTimeout(this._exitTimer);\n controller.abort();\n if (!this.open && layer.matches(':popover-open')) {\n layer.hidePopover();\n }\n };\n layer.addEventListener(\n 'transitionend',\n (event: TransitionEvent) => {\n if (event.target === layer && event.propertyName === 'opacity') {\n hide();\n }\n },\n { signal: controller.signal },\n );\n this._exitTimer = window.setTimeout(hide, EXIT_FALLBACK_MS);\n }\n\n private _applyPositioning() {\n if (!this.open || !this.menuListElement || this.preview) {\n return;\n }\n\n const anchorEl = this._resolveAnchorElement();\n if (!anchorEl) {\n return;\n }\n\n this._floatingController.setOptions({\n placement: toPhysicalPlacement(this.placement, this),\n offset: this.offset,\n strategy: 'fixed',\n closeOnClickOutside: !this.stayOpenOnOutsideClick,\n });\n this._floatingController.setElements(anchorEl, this.menuListElement);\n this._floatingController.open();\n }\n\n protected override updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('anchor') || changedProperties.has('open')) {\n this._syncAnchorAria();\n }\n\n if (changedProperties.has('variant')) {\n this._syncLayout();\n }\n\n if (changedProperties.has('open')) {\n this._syncLayer();\n // While open, the menu handles Escape itself: an overlay around it (popover, modal) must\n // let it close first (see the overlay controller).\n this.toggleAttribute('data-handles-escape', this.open);\n\n if (this.open) {\n this._lastFocusedElement = this._deepActiveElement();\n this._syncRovingTabIndex();\n this._syncLayout();\n this._applyPositioning();\n\n if (!this.noAutofocus && !this.preview) {\n this.focus(this._openFocus);\n }\n this._openFocus = 'active';\n\n this.dispatchEvent(\n new CustomEvent('open', { bubbles: true, composed: true }),\n );\n } else if (changedProperties.get('open') === true) {\n this._floatingController.close();\n\n const reason = this._closeReason;\n this.dispatchEvent(\n new CustomEvent<MenuCloseDetail>('close', {\n detail: { reason: toCloseReason(reason), cause: reason },\n bubbles: true,\n composed: true,\n }),\n );\n\n const shouldRestoreFocus =\n reason.kind !== 'outside-click' &&\n !(reason.kind === 'keydown' && reason.key === 'Tab');\n\n if (!this.isSubmenu && shouldRestoreFocus && this._focusIsInside()) {\n this._lastFocusedElement?.focus();\n }\n this._lastFocusedElement = null;\n }\n }\n\n if (\n (changedProperties.has('anchor') ||\n changedProperties.has('placement') ||\n changedProperties.has('offset')) &&\n !changedProperties.has('open') &&\n this.open\n ) {\n this._applyPositioning();\n }\n }\n\n /** The focused element, looking through open shadow roots. */\n private _deepActiveElement(): HTMLElement | null {\n let active: Element | null = document.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active instanceof HTMLElement ? active : null;\n }\n\n /** Whether focus is in this menu (or nowhere), so restoring it does not steal focus from elsewhere. */\n private _focusIsInside() {\n const active = document.activeElement;\n if (!active || active === document.body) {\n return true;\n }\n\n return (\n active === this ||\n this.contains(active) ||\n this.shadowRoot?.contains(active) === true\n );\n }\n\n render() {\n return html`\n <div\n class=\"${classMap({\n menu: true,\n open: !this.preview && this.open,\n closed: !this.preview && !this.open,\n preview: this.preview,\n })}\"\n popover=${this.preview ? nothing : 'manual'}\n part=\"surface\"\n >\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"menu-content\">\n <slot @slotchange=\"${this._onSlotChange}\"></slot>\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA,SAAS,aAAa,CAAC,MAAuB,EAAA;AAC5C,IAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,QAAA,KAAK,iBAAiB;AACpB,YAAA,OAAO,QAAQ;AACjB,QAAA,KAAK,SAAS;AACZ,YAAA,IAAI,MAAM,CAAC,GAAG,KAAK,QAAQ;AAAE,gBAAA,OAAO,QAAQ;;AAE5C,YAAA,OAAO,MAAM,CAAC,GAAG,KAAK,KAAK,GAAG,eAAe,GAAG,QAAQ;AAC1D,QAAA,KAAK,eAAe;AAClB,YAAA,OAAO,eAAe;AACxB,QAAA;AACE,YAAA,OAAO,KAAK;;AAElB;AAKA;AACA,MAAM,kBAAkB,GAAG,GAAG;AAE9B;AACA,MAAM,gBAAg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C,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE;AAClC,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAOpB,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE;AAClC,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAQlB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACmB,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAI7C,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACf,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIH,UAAA,CAAA;AADP,IAAAC,CAAK;AACmB,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGR,UAAA,CAAA;IADhBC,CAAK,CAAC,OAAO;AACwC,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;;;;"}
|
|
@@ -44,8 +44,10 @@ var css_248z = i`@charset "UTF-8";
|
|
|
44
44
|
--modal-min-width: 280px;
|
|
45
45
|
--modal-max-width: 560px;
|
|
46
46
|
--modal-max-height: 90dvh;
|
|
47
|
-
--modal-transition-duration: var(--duration
|
|
48
|
-
--modal-transition-easing: var(--easing
|
|
47
|
+
--modal-transition-duration: var(--motion-spring-default-spatial-duration);
|
|
48
|
+
--modal-transition-easing: var(--motion-spring-default-spatial-easing);
|
|
49
|
+
--_modal-fade-duration: var(--motion-spring-default-effects-duration);
|
|
50
|
+
--_modal-fade-easing: var(--motion-spring-default-effects-easing);
|
|
49
51
|
--modal-heading-color: var(--color-on-surface);
|
|
50
52
|
--modal-subheading-color: var(--color-on-surface-variant);
|
|
51
53
|
--modal-content-color: var(--color-on-surface-variant);
|
|
@@ -82,7 +84,7 @@ var css_248z = i`@charset "UTF-8";
|
|
|
82
84
|
inset: 0;
|
|
83
85
|
opacity: 0;
|
|
84
86
|
position: absolute;
|
|
85
|
-
transition: opacity var(--
|
|
87
|
+
transition: opacity var(--_modal-fade-duration) var(--_modal-fade-easing);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
.scrim.visible {
|
|
@@ -124,7 +126,7 @@ var css_248z = i`@charset "UTF-8";
|
|
|
124
126
|
animation: modal-enter var(--modal-transition-duration) var(--modal-transition-easing) backwards;
|
|
125
127
|
}
|
|
126
128
|
.dialog:not(.open) {
|
|
127
|
-
animation: modal-exit var(--
|
|
129
|
+
animation: modal-exit var(--_modal-fade-duration) var(--_modal-fade-easing) forwards;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
/* Sizes */
|
|
@@ -267,4 +269,4 @@ var css_248z = i`@charset "UTF-8";
|
|
|
267
269
|
}`;
|
|
268
270
|
|
|
269
271
|
export { css_248z as c };
|
|
270
|
-
//# sourceMappingURL=modal-
|
|
272
|
+
//# sourceMappingURL=modal-ClWCCbxD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-
|
|
1
|
+
{"version":3,"file":"modal-ClWCCbxD.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/modal.js
CHANGED
|
@@ -4,8 +4,8 @@ import { e } from './query-CHb9Ft_d.js';
|
|
|
4
4
|
import { e as e$1 } from './class-map-DN-g_e4M.js';
|
|
5
5
|
import './toggle-surface-CkMdGtyR.js';
|
|
6
6
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
7
|
-
import { O as OverlayController } from './overlay-controller-
|
|
8
|
-
import { c as css_248z } from './modal-
|
|
7
|
+
import { O as OverlayController } from './overlay-controller-iVaiUqos.js';
|
|
8
|
+
import { c as css_248z } from './modal-ClWCCbxD.js';
|
|
9
9
|
import './base-Cl6v8-BZ.js';
|
|
10
10
|
import './directive-ZPhl09Yt.js';
|
|
11
11
|
import './define-element-DwIWgY_Y.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IndicatorNavigationItem } from './indicator-navigation-item-
|
|
1
|
+
import { I as IndicatorNavigationItem } from './indicator-navigation-item-aZsm-RpR.js';
|
|
2
2
|
import './property-Dn3pvFDo.js';
|
|
3
3
|
import './lit-element-CKa37m3w.js';
|
|
4
4
|
import './state-Bz6ycyYM.js';
|
package/dist/navigation-bar.js
CHANGED
|
@@ -12,7 +12,7 @@ import './class-map-DN-g_e4M.js';
|
|
|
12
12
|
import './directive-ZPhl09Yt.js';
|
|
13
13
|
import './dispatch-event-utils-DfgqVBK8.js';
|
|
14
14
|
import './throttle-C7ZAPqtu.js';
|
|
15
|
-
import './indicator-navigation-item-
|
|
15
|
+
import './indicator-navigation-item-aZsm-RpR.js';
|
|
16
16
|
import './observe-slot-change-DPxaZrZF.js';
|
|
17
17
|
|
|
18
18
|
var css_248z = i`* {
|
|
@@ -98,7 +98,7 @@ var css_248z = i`* {
|
|
|
98
98
|
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
99
99
|
}
|
|
100
100
|
.header .expand-icon {
|
|
101
|
-
transition: transform var(--duration
|
|
101
|
+
transition: transform var(--motion-spring-fast-spatial-duration) var(--motion-spring-fast-spatial-easing);
|
|
102
102
|
}
|
|
103
103
|
.header.expanded .expand-icon {
|
|
104
104
|
transform: rotate(180deg);
|
|
@@ -96,7 +96,7 @@ var css_248z = i`* {
|
|
|
96
96
|
overflow-y: auto;
|
|
97
97
|
}
|
|
98
98
|
.modal[open] {
|
|
99
|
-
animation: slide-in var(--duration
|
|
99
|
+
animation: slide-in var(--motion-spring-slow-effects-duration, 300ms) var(--motion-spring-slow-effects-easing, ease-out);
|
|
100
100
|
}
|
|
101
101
|
.modal::backdrop {
|
|
102
102
|
background: color-mix(in srgb, var(--color-scrim, black) 32%, transparent);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __decorate, n } from './property-Dn3pvFDo.js';
|
|
2
|
-
import { I as IndicatorNavigationItem } from './indicator-navigation-item-
|
|
2
|
+
import { I as IndicatorNavigationItem } from './indicator-navigation-item-aZsm-RpR.js';
|
|
3
3
|
import './lit-element-CKa37m3w.js';
|
|
4
4
|
import './state-Bz6ycyYM.js';
|
|
5
5
|
import './observe-slot-change-DPxaZrZF.js';
|
package/dist/navigation-rail.js
CHANGED
|
@@ -5,7 +5,7 @@ import { NavigationRailItem } from './navigation-rail-item.js';
|
|
|
5
5
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
6
6
|
import { s as selectNavigationItem } from './navigation-item-base-HiLyp0Jy.js';
|
|
7
7
|
import './directive-ZPhl09Yt.js';
|
|
8
|
-
import './indicator-navigation-item-
|
|
8
|
+
import './indicator-navigation-item-aZsm-RpR.js';
|
|
9
9
|
import './state-Bz6ycyYM.js';
|
|
10
10
|
import './observe-slot-change-DPxaZrZF.js';
|
|
11
11
|
import './query-CHb9Ft_d.js';
|
|
@@ -5,7 +5,7 @@ import { e } from './query-CHb9Ft_d.js';
|
|
|
5
5
|
import { e as e$1 } from './class-map-DN-g_e4M.js';
|
|
6
6
|
import { c } from './repeat-D6FogcKA.js';
|
|
7
7
|
import { F as FloatingController } from './floating-controller-CABF4tBT.js';
|
|
8
|
-
import { O as OverlayController } from './overlay-controller-
|
|
8
|
+
import { O as OverlayController } from './overlay-controller-iVaiUqos.js';
|
|
9
9
|
import { o as onTick, M as MINUTE, D as DAY, b as formatTime, W as WEEK } from './relative-time-BNxqvEbg.js';
|
|
10
10
|
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
11
11
|
import { t as toPhysicalPlacement } from './placement-C4GO0JP9.js';
|
package/dist/number-counter.js
CHANGED
|
@@ -58,7 +58,7 @@ var css_248z = i`* {
|
|
|
58
58
|
.digit-content {
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
61
|
-
transition: transform var(--duration
|
|
61
|
+
transition: transform var(--motion-spring-default-spatial-duration) var(--motion-spring-default-spatial-easing);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.each-digit, .digit-separator {
|
|
@@ -191,18 +191,29 @@ class OverlayController {
|
|
|
191
191
|
// After a press outside, focus belongs where the person pressed, not back on the opener.
|
|
192
192
|
const lightDismissed = this.requestedReason === 'light-dismiss';
|
|
193
193
|
this.requestedReason = null;
|
|
194
|
-
|
|
194
|
+
const returnTo = !lightDismissed &&
|
|
195
195
|
(this.options.restoreFocus?.() ?? true) &&
|
|
196
196
|
this.returnFocusTo?.isConnected &&
|
|
197
|
-
this.focusIsInside()
|
|
198
|
-
this.returnFocusTo
|
|
199
|
-
|
|
197
|
+
this.focusIsInside()
|
|
198
|
+
? this.returnFocusTo
|
|
199
|
+
: null;
|
|
200
200
|
this.returnFocusTo = null;
|
|
201
|
+
returnTo?.focus();
|
|
201
202
|
const surface = this.options.surface();
|
|
202
203
|
if (!surface)
|
|
203
204
|
return;
|
|
204
|
-
|
|
205
|
+
// A modal dialog keeps the page inert until it closes, so focus cannot return while it
|
|
206
|
+
// plays its exit animation: return it again once the dialog is gone.
|
|
207
|
+
const hide = () => {
|
|
205
208
|
this.hideSurface(surface);
|
|
209
|
+
if (returnTo?.isConnected &&
|
|
210
|
+
deepActiveElement() !== returnTo &&
|
|
211
|
+
this.focusIsInside()) {
|
|
212
|
+
returnTo.focus();
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
if (immediately) {
|
|
216
|
+
hide();
|
|
206
217
|
return;
|
|
207
218
|
}
|
|
208
219
|
// Leave the top layer once exit animations finish, unless the overlay reopened meanwhile.
|
|
@@ -211,15 +222,14 @@ class OverlayController {
|
|
|
211
222
|
.filter((element) => !!element)
|
|
212
223
|
.flatMap(element => element.getAnimations({ subtree: true }));
|
|
213
224
|
if (animations.length === 0) {
|
|
214
|
-
|
|
225
|
+
hide();
|
|
215
226
|
return;
|
|
216
227
|
}
|
|
217
228
|
Promise.all(animations.map(animation => animation.finished))
|
|
218
229
|
.catch(() => undefined)
|
|
219
230
|
.then(() => {
|
|
220
|
-
if (generation === this.exitGeneration && !this.shown)
|
|
221
|
-
|
|
222
|
-
}
|
|
231
|
+
if (generation === this.exitGeneration && !this.shown)
|
|
232
|
+
hide();
|
|
223
233
|
});
|
|
224
234
|
}
|
|
225
235
|
showSurface(surface) {
|
|
@@ -271,4 +281,4 @@ class OverlayController {
|
|
|
271
281
|
}
|
|
272
282
|
|
|
273
283
|
export { OverlayController as O };
|
|
274
|
-
//# sourceMappingURL=overlay-controller-
|
|
284
|
+
//# sourceMappingURL=overlay-controller-iVaiUqos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-controller-BOk-kfil.js","sources":["../../src/__internal/controllers/overlay-controller.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** Why an overlay closed. The same type for every overlay (ADR-030001). */\nexport type CloseReason =\n | 'escape'\n | 'light-dismiss'\n | 'action'\n | 'timeout'\n | 'api';\n\nexport interface OverlayOptions {\n /**\n * The element shown in the top layer: a `<dialog>` (opened with `showModal()` when `modal`,\n * `show()` otherwise) or an element with the `popover` attribute.\n */\n surface: () => HTMLElement | null | undefined;\n /** Modal: the rest of the page is inert, focus stays inside, and page scrolling stops. */\n modal?: boolean | (() => boolean);\n /** Whether Escape closes the overlay. Default true. */\n closeOnEscape?: () => boolean;\n /**\n * Whether a pointer press outside closes the overlay. For a modal `<dialog>` that means a\n * click on its backdrop; for other overlays, a press anywhere outside the host and `surface`.\n * Default false.\n */\n lightDismiss?: () => boolean;\n /** Elements outside the host that do not count as \"outside\", such as a popover's trigger. */\n insideElements?: () => (Element | null | undefined)[];\n /** Element to focus when the overlay opens; default the first `[autofocus]`, else none. */\n initialFocus?: () => HTMLElement | null | undefined;\n /** Whether to move focus into the overlay on open. Default true for modal overlays. */\n focusOnOpen?: () => boolean;\n /** Whether to give focus back to where it was when the overlay closes. Default true. */\n restoreFocus?: () => boolean;\n /** Elements whose animations to await before the surface leaves the top layer. */\n exitAnimationTargets?: () => (Element | null | undefined)[];\n /** Called when the user asks to close (Escape, light dismiss); the host sets `open = false`. */\n requestClose: (reason: CloseReason) => void;\n}\n\n// ── Shared state ─────────────────────────────────────────────────────────────\n\n/** Open overlays, oldest first; Escape goes to the last one. */\n// Only a type reference; the class is defined below.\n// eslint-disable-next-line no-use-before-define\nconst stack: OverlayController[] = [];\n\nlet scrollLocks = 0;\nlet savedOverflow = '';\n\nfunction lockScroll() {\n if (scrollLocks === 0) {\n savedOverflow = document.documentElement.style.overflow;\n document.documentElement.style.overflow = 'hidden';\n }\n scrollLocks += 1;\n}\n\nfunction unlockScroll() {\n scrollLocks = Math.max(0, scrollLocks - 1);\n if (scrollLocks === 0) {\n document.documentElement.style.overflow = savedOverflow;\n }\n}\n\n/** The focused element, looking into shadow roots. */\nfunction deepActiveElement(): HTMLElement | null {\n let active = document.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active instanceof HTMLElement ? active : null;\n}\n\nfunction handleDocumentKeydown(event: KeyboardEvent) {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n // A component that handles Escape itself while open (a menu, a select's list) marks itself with\n // `data-handles-escape`; let it close first instead of the overlay around it.\n const handledInside = event\n .composedPath()\n .some(\n node =>\n node instanceof Element && node.hasAttribute('data-handles-escape'),\n );\n if (handledInside) return;\n // The topmost overlay that Escape may close; overlays that ignore Escape (a standard side\n // sheet) don't block the ones below them.\n const top = [...stack].reverse().find(overlay => overlay.escapeAllowed);\n if (!top) return;\n event.preventDefault();\n event.stopPropagation();\n top.requestClose('escape');\n}\n\nfunction handleDocumentPointerdown(event: PointerEvent) {\n const top = stack[stack.length - 1];\n if (!top || top.isModal || !top.lightDismissAllowed) return;\n if (!top.containsEvent(event)) top.requestClose('light-dismiss');\n}\n\nfunction updateDocumentListeners() {\n if (stack.length > 0) {\n document.addEventListener('keydown', handleDocumentKeydown, true);\n document.addEventListener('pointerdown', handleDocumentPointerdown, true);\n } else {\n document.removeEventListener('keydown', handleDocumentKeydown, true);\n document.removeEventListener(\n 'pointerdown',\n handleDocumentPointerdown,\n true,\n );\n }\n}\n\n// ── Controller ───────────────────────────────────────────────────────────────\n\n/**\n * Shared behaviour for Peacock overlays (modal, side and bottom sheets, popover, tooltip,\n * snackbar): the top layer, so overlays stack in the order they open and never sit under an\n * open modal; a ref-counted page scroll lock for modal overlays; Escape and light dismiss that\n * close only the topmost overlay; initial focus and focus return.\n *\n * The host keeps `open` as the source of truth: it calls `sync(open)` from `updated()`, and the\n * controller calls `requestClose(reason)` when the user asks to close. The host then sets\n * `open = false` and fires its `close` event with that reason.\n *\n * @example\n * private readonly overlay = new OverlayController(this, {\n * surface: () => this.dialogElement,\n * modal: true,\n * lightDismiss: () => !this.noLightDismiss,\n * requestClose: reason => this.hide(reason),\n * });\n * protected updated(changed) { if (changed.has('open')) this.overlay.sync(this.open); }\n */\nexport class OverlayController implements ReactiveController {\n private readonly host: ReactiveControllerHost & HTMLElement;\n\n private readonly options: OverlayOptions;\n\n private shown = false;\n\n private locked = false;\n\n private returnFocusTo: HTMLElement | null = null;\n\n /** Why the user asked to close, until the overlay leaves; light dismiss keeps focus where it went. */\n private requestedReason: CloseReason | null = null;\n\n private exitGeneration = 0;\n\n /** Dialog `close()` calls made here whose native `close` event has not arrived yet. */\n private ownCloses = 0;\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options: OverlayOptions,\n ) {\n this.host = host;\n this.options = options;\n host.addController(this);\n }\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n hostDisconnected() {\n this.leave(true);\n }\n\n // ── Public ───────────────────────────────────────────────────────────────\n\n /** Whether the overlay is modal right now. */\n get isModal(): boolean {\n const { modal } = this.options;\n return typeof modal === 'function' ? modal() : !!modal;\n }\n\n /** Whether Escape may close it. */\n get escapeAllowed(): boolean {\n return this.options.closeOnEscape?.() ?? true;\n }\n\n /** Whether a press outside may close it. */\n get lightDismissAllowed(): boolean {\n return this.options.lightDismiss?.() ?? false;\n }\n\n /** Whether the overlay is the topmost open overlay. */\n get isTopmost(): boolean {\n return stack[stack.length - 1] === this;\n }\n\n /** Opens or closes the surface to match the host's `open`. Call it from `updated()`. */\n sync(open: boolean) {\n if (open && this.host.isConnected) this.enter();\n else this.leave(false);\n }\n\n /**\n * For a dialog surface's native `close` event: true when this controller closed the dialog,\n * false when the browser did (a form with `method=\"dialog\"`, for example). The event arrives a\n * task after `close()`, when the host may already be open again, so hosts check this before\n * treating the event as a close of their own.\n */\n takeOwnClose(): boolean {\n if (this.ownCloses === 0) return false;\n this.ownCloses -= 1;\n return true;\n }\n\n /** Asks the host to close; used for Escape and light dismiss. */\n requestClose(reason: CloseReason) {\n this.requestedReason = reason;\n this.options.requestClose(reason);\n }\n\n /** Whether a pointer event happened inside the host, its surface or an inside element. */\n containsEvent(event: Event): boolean {\n const path = event.composedPath();\n const inside = [\n this.host,\n this.options.surface(),\n ...(this.options.insideElements?.() ?? []),\n ];\n return inside.some(element => !!element && path.includes(element));\n }\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n private enter() {\n const surface = this.options.surface();\n if (!surface) return;\n this.exitGeneration += 1;\n\n if (!this.shown) {\n this.returnFocusTo = deepActiveElement();\n this.shown = true;\n stack.push(this);\n updateDocumentListeners();\n }\n\n this.showSurface(surface);\n\n if (this.isModal && !this.locked) {\n lockScroll();\n this.locked = true;\n }\n\n const focusOnOpen = this.options.focusOnOpen?.() ?? this.isModal;\n if (focusOnOpen) {\n const target =\n this.options.initialFocus?.() ??\n (this.host.querySelector('[autofocus]') as HTMLElement | null);\n target?.focus();\n }\n }\n\n private leave(immediately: boolean) {\n if (this.locked) {\n unlockScroll();\n this.locked = false;\n }\n if (!this.shown) return;\n this.shown = false;\n const index = stack.indexOf(this);\n if (index >= 0) stack.splice(index, 1);\n updateDocumentListeners();\n\n // After a press outside, focus belongs where the person pressed, not back on the opener.\n const lightDismissed = this.requestedReason === 'light-dismiss';\n this.requestedReason = null;\n if (\n !lightDismissed &&\n (this.options.restoreFocus?.() ?? true) &&\n this.returnFocusTo?.isConnected &&\n this.focusIsInside()\n ) {\n this.returnFocusTo.focus();\n }\n this.returnFocusTo = null;\n\n const surface = this.options.surface();\n if (!surface) return;\n if (immediately) {\n this.hideSurface(surface);\n return;\n }\n // Leave the top layer once exit animations finish, unless the overlay reopened meanwhile.\n const generation = this.exitGeneration;\n const animations = (this.options.exitAnimationTargets?.() ?? [surface])\n .filter((element): element is Element => !!element)\n .flatMap(element => element.getAnimations({ subtree: true }));\n if (animations.length === 0) {\n this.hideSurface(surface);\n return;\n }\n Promise.all(animations.map(animation => animation.finished))\n .catch(() => undefined)\n .then(() => {\n if (generation === this.exitGeneration && !this.shown) {\n this.hideSurface(surface);\n }\n });\n }\n\n private showSurface(surface: HTMLElement) {\n if (surface instanceof HTMLDialogElement) {\n if (surface.open) return;\n if (this.isModal) surface.showModal();\n else surface.show();\n return;\n }\n if (\n surface.hasAttribute('popover') &&\n typeof surface.showPopover === 'function' &&\n !surface.matches(':popover-open')\n ) {\n surface.showPopover();\n }\n }\n\n private hideSurface(surface: HTMLElement) {\n if (surface instanceof HTMLDialogElement) {\n if (surface.open) {\n this.ownCloses += 1;\n surface.close();\n }\n return;\n }\n if (\n surface.hasAttribute('popover') &&\n typeof surface.hidePopover === 'function' &&\n surface.matches(':popover-open')\n ) {\n surface.hidePopover();\n }\n }\n\n /** Whether focus is inside the host or its surface, so returning it will not steal focus. */\n private focusIsInside(): boolean {\n const active = deepActiveElement();\n if (!active) return true;\n if (active === document.body) return true;\n const surface = this.options.surface();\n let node: Node | null = active;\n while (node) {\n if (node === this.host || node === surface) return true;\n node = node.parentNode ?? (node instanceof ShadowRoot ? node.host : null);\n }\n return false;\n }\n}\n\n/** For tests: the number of open overlays and page scroll locks. */\nexport function overlayState() {\n return { open: stack.length, scrollLocks };\n}\n"],"names":[],"mappings":"AAwCA;AAEA;AACA;AACA;AACA,MAAM,KAAK,GAAwB,EAAE;AAErC,IAAI,WAAW,GAAG,CAAC;AACnB,IAAI,aAAa,GAAG,EAAE;AAEtB,SAAS,UAAU,GAAA;AACjB,IAAA,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,aAAa,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ;QACvD,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ;IACpD;IACA,WAAW,IAAI,CAAC;AAClB;AAEA,SAAS,YAAY,GAAA;IACnB,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;AAC1C,IAAA,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,aAAa;IACzD;AACF;AAEA;AACA,SAAS,iBAAiB,GAAA;AACxB,IAAA,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa;AACnC,IAAA,OAAO,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE;AACxC,QAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,aAAa;IAC1C;IACA,OAAO,MAAM,YAAY,WAAW,GAAG,MAAM,GAAG,IAAI;AACtD;AAEA,SAAS,qBAAqB,CAAC,KAAoB,EAAA;IACjD,IAAI,KAAK,CAAC,GAAG,K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IAAI,OAAO,YAAY,iBAAiB,EAAE;AACxC,YAAA,IAAI,OAAO,CAAC,IAAI,EAAE;AAChB,gBAAA,IAAI,CAAC,SAAS,IAAI,CAAC;gBACnB,OAAO,CAAC,KAAK,EAAE;YACjB;YACA;QACF;AACA,QAAA,IACE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;AAC/B,YAAA,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;AACzC,YAAA,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,EAChC;YACA,OAAO,CAAC,WAAW,EAAE;QACvB;IACF;;IAGQ,aAAa,GAAA;AACnB,QAAA,MAAM,MAAM,GAAG,iBAAiB,EAAE;AAClC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,IAAI;AACxB,QAAA,IAAI,MAAM,KAAK,QAAQ,CAAC,IAAI;AAAE,YAAA,OAAO,IAAI;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACtC,IAAI,IAAI,GAAgB,MAAM;QAC9B,OAAO,IAAI,EAAE;YACX,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,OAAO;AAAE,gBAAA,OAAO,IAAI;YACvD,IAAI,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,YAAY,UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3E;AACA,QAAA,OAAO,KAAK;IACd;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"overlay-controller-iVaiUqos.js","sources":["../../src/__internal/controllers/overlay-controller.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/** Why an overlay closed. The same type for every overlay (ADR-030001). */\nexport type CloseReason =\n | 'escape'\n | 'light-dismiss'\n | 'action'\n | 'timeout'\n | 'api';\n\nexport interface OverlayOptions {\n /**\n * The element shown in the top layer: a `<dialog>` (opened with `showModal()` when `modal`,\n * `show()` otherwise) or an element with the `popover` attribute.\n */\n surface: () => HTMLElement | null | undefined;\n /** Modal: the rest of the page is inert, focus stays inside, and page scrolling stops. */\n modal?: boolean | (() => boolean);\n /** Whether Escape closes the overlay. Default true. */\n closeOnEscape?: () => boolean;\n /**\n * Whether a pointer press outside closes the overlay. For a modal `<dialog>` that means a\n * click on its backdrop; for other overlays, a press anywhere outside the host and `surface`.\n * Default false.\n */\n lightDismiss?: () => boolean;\n /** Elements outside the host that do not count as \"outside\", such as a popover's trigger. */\n insideElements?: () => (Element | null | undefined)[];\n /** Element to focus when the overlay opens; default the first `[autofocus]`, else none. */\n initialFocus?: () => HTMLElement | null | undefined;\n /** Whether to move focus into the overlay on open. Default true for modal overlays. */\n focusOnOpen?: () => boolean;\n /** Whether to give focus back to where it was when the overlay closes. Default true. */\n restoreFocus?: () => boolean;\n /** Elements whose animations to await before the surface leaves the top layer. */\n exitAnimationTargets?: () => (Element | null | undefined)[];\n /** Called when the user asks to close (Escape, light dismiss); the host sets `open = false`. */\n requestClose: (reason: CloseReason) => void;\n}\n\n// ── Shared state ─────────────────────────────────────────────────────────────\n\n/** Open overlays, oldest first; Escape goes to the last one. */\n// Only a type reference; the class is defined below.\n// eslint-disable-next-line no-use-before-define\nconst stack: OverlayController[] = [];\n\nlet scrollLocks = 0;\nlet savedOverflow = '';\n\nfunction lockScroll() {\n if (scrollLocks === 0) {\n savedOverflow = document.documentElement.style.overflow;\n document.documentElement.style.overflow = 'hidden';\n }\n scrollLocks += 1;\n}\n\nfunction unlockScroll() {\n scrollLocks = Math.max(0, scrollLocks - 1);\n if (scrollLocks === 0) {\n document.documentElement.style.overflow = savedOverflow;\n }\n}\n\n/** The focused element, looking into shadow roots. */\nfunction deepActiveElement(): HTMLElement | null {\n let active = document.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active instanceof HTMLElement ? active : null;\n}\n\nfunction handleDocumentKeydown(event: KeyboardEvent) {\n if (event.key !== 'Escape' || event.defaultPrevented) return;\n // A component that handles Escape itself while open (a menu, a select's list) marks itself with\n // `data-handles-escape`; let it close first instead of the overlay around it.\n const handledInside = event\n .composedPath()\n .some(\n node =>\n node instanceof Element && node.hasAttribute('data-handles-escape'),\n );\n if (handledInside) return;\n // The topmost overlay that Escape may close; overlays that ignore Escape (a standard side\n // sheet) don't block the ones below them.\n const top = [...stack].reverse().find(overlay => overlay.escapeAllowed);\n if (!top) return;\n event.preventDefault();\n event.stopPropagation();\n top.requestClose('escape');\n}\n\nfunction handleDocumentPointerdown(event: PointerEvent) {\n const top = stack[stack.length - 1];\n if (!top || top.isModal || !top.lightDismissAllowed) return;\n if (!top.containsEvent(event)) top.requestClose('light-dismiss');\n}\n\nfunction updateDocumentListeners() {\n if (stack.length > 0) {\n document.addEventListener('keydown', handleDocumentKeydown, true);\n document.addEventListener('pointerdown', handleDocumentPointerdown, true);\n } else {\n document.removeEventListener('keydown', handleDocumentKeydown, true);\n document.removeEventListener(\n 'pointerdown',\n handleDocumentPointerdown,\n true,\n );\n }\n}\n\n// ── Controller ───────────────────────────────────────────────────────────────\n\n/**\n * Shared behaviour for Peacock overlays (modal, side and bottom sheets, popover, tooltip,\n * snackbar): the top layer, so overlays stack in the order they open and never sit under an\n * open modal; a ref-counted page scroll lock for modal overlays; Escape and light dismiss that\n * close only the topmost overlay; initial focus and focus return.\n *\n * The host keeps `open` as the source of truth: it calls `sync(open)` from `updated()`, and the\n * controller calls `requestClose(reason)` when the user asks to close. The host then sets\n * `open = false` and fires its `close` event with that reason.\n *\n * @example\n * private readonly overlay = new OverlayController(this, {\n * surface: () => this.dialogElement,\n * modal: true,\n * lightDismiss: () => !this.noLightDismiss,\n * requestClose: reason => this.hide(reason),\n * });\n * protected updated(changed) { if (changed.has('open')) this.overlay.sync(this.open); }\n */\nexport class OverlayController implements ReactiveController {\n private readonly host: ReactiveControllerHost & HTMLElement;\n\n private readonly options: OverlayOptions;\n\n private shown = false;\n\n private locked = false;\n\n private returnFocusTo: HTMLElement | null = null;\n\n /** Why the user asked to close, until the overlay leaves; light dismiss keeps focus where it went. */\n private requestedReason: CloseReason | null = null;\n\n private exitGeneration = 0;\n\n /** Dialog `close()` calls made here whose native `close` event has not arrived yet. */\n private ownCloses = 0;\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options: OverlayOptions,\n ) {\n this.host = host;\n this.options = options;\n host.addController(this);\n }\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n hostDisconnected() {\n this.leave(true);\n }\n\n // ── Public ───────────────────────────────────────────────────────────────\n\n /** Whether the overlay is modal right now. */\n get isModal(): boolean {\n const { modal } = this.options;\n return typeof modal === 'function' ? modal() : !!modal;\n }\n\n /** Whether Escape may close it. */\n get escapeAllowed(): boolean {\n return this.options.closeOnEscape?.() ?? true;\n }\n\n /** Whether a press outside may close it. */\n get lightDismissAllowed(): boolean {\n return this.options.lightDismiss?.() ?? false;\n }\n\n /** Whether the overlay is the topmost open overlay. */\n get isTopmost(): boolean {\n return stack[stack.length - 1] === this;\n }\n\n /** Opens or closes the surface to match the host's `open`. Call it from `updated()`. */\n sync(open: boolean) {\n if (open && this.host.isConnected) this.enter();\n else this.leave(false);\n }\n\n /**\n * For a dialog surface's native `close` event: true when this controller closed the dialog,\n * false when the browser did (a form with `method=\"dialog\"`, for example). The event arrives a\n * task after `close()`, when the host may already be open again, so hosts check this before\n * treating the event as a close of their own.\n */\n takeOwnClose(): boolean {\n if (this.ownCloses === 0) return false;\n this.ownCloses -= 1;\n return true;\n }\n\n /** Asks the host to close; used for Escape and light dismiss. */\n requestClose(reason: CloseReason) {\n this.requestedReason = reason;\n this.options.requestClose(reason);\n }\n\n /** Whether a pointer event happened inside the host, its surface or an inside element. */\n containsEvent(event: Event): boolean {\n const path = event.composedPath();\n const inside = [\n this.host,\n this.options.surface(),\n ...(this.options.insideElements?.() ?? []),\n ];\n return inside.some(element => !!element && path.includes(element));\n }\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n private enter() {\n const surface = this.options.surface();\n if (!surface) return;\n this.exitGeneration += 1;\n\n if (!this.shown) {\n this.returnFocusTo = deepActiveElement();\n this.shown = true;\n stack.push(this);\n updateDocumentListeners();\n }\n\n this.showSurface(surface);\n\n if (this.isModal && !this.locked) {\n lockScroll();\n this.locked = true;\n }\n\n const focusOnOpen = this.options.focusOnOpen?.() ?? this.isModal;\n if (focusOnOpen) {\n const target =\n this.options.initialFocus?.() ??\n (this.host.querySelector('[autofocus]') as HTMLElement | null);\n target?.focus();\n }\n }\n\n private leave(immediately: boolean) {\n if (this.locked) {\n unlockScroll();\n this.locked = false;\n }\n if (!this.shown) return;\n this.shown = false;\n const index = stack.indexOf(this);\n if (index >= 0) stack.splice(index, 1);\n updateDocumentListeners();\n\n // After a press outside, focus belongs where the person pressed, not back on the opener.\n const lightDismissed = this.requestedReason === 'light-dismiss';\n this.requestedReason = null;\n const returnTo =\n !lightDismissed &&\n (this.options.restoreFocus?.() ?? true) &&\n this.returnFocusTo?.isConnected &&\n this.focusIsInside()\n ? this.returnFocusTo\n : null;\n this.returnFocusTo = null;\n returnTo?.focus();\n\n const surface = this.options.surface();\n if (!surface) return;\n // A modal dialog keeps the page inert until it closes, so focus cannot return while it\n // plays its exit animation: return it again once the dialog is gone.\n const hide = () => {\n this.hideSurface(surface);\n if (\n returnTo?.isConnected &&\n deepActiveElement() !== returnTo &&\n this.focusIsInside()\n ) {\n returnTo.focus();\n }\n };\n if (immediately) {\n hide();\n return;\n }\n // Leave the top layer once exit animations finish, unless the overlay reopened meanwhile.\n const generation = this.exitGeneration;\n const animations = (this.options.exitAnimationTargets?.() ?? [surface])\n .filter((element): element is Element => !!element)\n .flatMap(element => element.getAnimations({ subtree: true }));\n if (animations.length === 0) {\n hide();\n return;\n }\n Promise.all(animations.map(animation => animation.finished))\n .catch(() => undefined)\n .then(() => {\n if (generation === this.exitGeneration && !this.shown) hide();\n });\n }\n\n private showSurface(surface: HTMLElement) {\n if (surface instanceof HTMLDialogElement) {\n if (surface.open) return;\n if (this.isModal) surface.showModal();\n else surface.show();\n return;\n }\n if (\n surface.hasAttribute('popover') &&\n typeof surface.showPopover === 'function' &&\n !surface.matches(':popover-open')\n ) {\n surface.showPopover();\n }\n }\n\n private hideSurface(surface: HTMLElement) {\n if (surface instanceof HTMLDialogElement) {\n if (surface.open) {\n this.ownCloses += 1;\n surface.close();\n }\n return;\n }\n if (\n surface.hasAttribute('popover') &&\n typeof surface.hidePopover === 'function' &&\n surface.matches(':popover-open')\n ) {\n surface.hidePopover();\n }\n }\n\n /** Whether focus is inside the host or its surface, so returning it will not steal focus. */\n private focusIsInside(): boolean {\n const active = deepActiveElement();\n if (!active) return true;\n if (active === document.body) return true;\n const surface = this.options.surface();\n let node: Node | null = active;\n while (node) {\n if (node === this.host || node === surface) return true;\n node = node.parentNode ?? (node instanceof ShadowRoot ? node.host : null);\n }\n return false;\n }\n}\n\n/** For tests: the number of open overlays and page scroll locks. */\nexport function overlayState() {\n return { open: stack.length, scrollLocks };\n}\n"],"names":[],"mappings":"AAwCA;AAEA;AACA;AACA;AACA,MAAM,KAAK,GAAwB,EAAE;AAErC,IAAI,WAAW,GAAG,CAAC;AACnB,IAAI,aAAa,GAAG,EAAE;AAEtB,SAAS,UAAU,GAAA;AACjB,IAAA,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,aAAa,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ;QACvD,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ;IACpD;IACA,WAAW,IAAI,CAAC;AAClB;AAEA,SAAS,YAAY,GAAA;IACnB,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;AAC1C,IAAA,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,aAAa;IACzD;AACF;AAEA;AACA,SAAS,iBAAiB,GAAA;AACxB,IAAA,IAAI,MAAM,GAAG,Q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AU,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3E;AACA,QAAA,OAAO,KAAK;IACd;AACD;;;;"}
|
package/dist/pagination.js
CHANGED
|
@@ -126,7 +126,7 @@ var css_248z = i`* {
|
|
|
126
126
|
color: var(--color-on-surface-variant);
|
|
127
127
|
font-variant-numeric: tabular-nums;
|
|
128
128
|
cursor: pointer;
|
|
129
|
-
transition: background-color var(--duration-
|
|
129
|
+
transition: background-color var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing);
|
|
130
130
|
}
|
|
131
131
|
.page-button:hover {
|
|
132
132
|
background: color-mix(in srgb, var(--color-on-surface) 8%, transparent);
|