@spectrum-web-components/overlay 0.16.3 → 0.16.6-devmode.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.
Files changed (96) hide show
  1. package/active-overlay.dev.js +3 -0
  2. package/active-overlay.dev.js.map +7 -0
  3. package/active-overlay.js +3 -14
  4. package/active-overlay.js.map +7 -1
  5. package/overlay-trigger.dev.js +3 -0
  6. package/overlay-trigger.dev.js.map +7 -0
  7. package/overlay-trigger.js +3 -14
  8. package/overlay-trigger.js.map +7 -1
  9. package/package.json +69 -15
  10. package/src/ActiveOverlay.d.ts +2 -2
  11. package/src/ActiveOverlay.dev.js +445 -0
  12. package/src/ActiveOverlay.dev.js.map +7 -0
  13. package/src/ActiveOverlay.js +404 -423
  14. package/src/ActiveOverlay.js.map +7 -1
  15. package/src/OverlayTrigger.dev.js +293 -0
  16. package/src/OverlayTrigger.dev.js.map +7 -0
  17. package/src/OverlayTrigger.js +245 -264
  18. package/src/OverlayTrigger.js.map +7 -1
  19. package/src/VirtualTrigger.dev.js +30 -0
  20. package/src/VirtualTrigger.dev.js.map +7 -0
  21. package/src/VirtualTrigger.js +28 -38
  22. package/src/VirtualTrigger.js.map +7 -1
  23. package/src/active-overlay.css.dev.js +12 -0
  24. package/src/active-overlay.css.dev.js.map +7 -0
  25. package/src/active-overlay.css.js +3 -14
  26. package/src/active-overlay.css.js.map +7 -1
  27. package/src/index.dev.js +7 -0
  28. package/src/index.dev.js.map +7 -0
  29. package/src/index.js +7 -18
  30. package/src/index.js.map +7 -1
  31. package/src/loader.dev.js +5 -0
  32. package/src/loader.dev.js.map +7 -0
  33. package/src/loader.js +3 -14
  34. package/src/loader.js.map +7 -1
  35. package/src/overlay-events.d.ts +11 -0
  36. package/src/overlay-events.dev.js +7 -0
  37. package/src/overlay-events.dev.js.map +7 -0
  38. package/src/overlay-events.js +7 -0
  39. package/src/overlay-events.js.map +7 -0
  40. package/src/overlay-stack.d.ts +2 -0
  41. package/src/overlay-stack.dev.js +436 -0
  42. package/src/overlay-stack.dev.js.map +7 -0
  43. package/src/overlay-stack.js +374 -419
  44. package/src/overlay-stack.js.map +7 -1
  45. package/src/overlay-timer.dev.js +71 -0
  46. package/src/overlay-timer.dev.js.map +7 -0
  47. package/src/overlay-timer.js +64 -82
  48. package/src/overlay-timer.js.map +7 -1
  49. package/src/overlay-trigger.css.dev.js +6 -0
  50. package/src/overlay-trigger.css.dev.js.map +7 -0
  51. package/src/overlay-trigger.css.js +3 -14
  52. package/src/overlay-trigger.css.js.map +7 -1
  53. package/src/overlay-types.dev.js +1 -0
  54. package/src/overlay-types.dev.js.map +7 -0
  55. package/src/overlay-types.js +1 -13
  56. package/src/overlay-types.js.map +7 -1
  57. package/src/overlay-utils.dev.js +28 -0
  58. package/src/overlay-utils.dev.js.map +7 -0
  59. package/src/overlay-utils.js +22 -33
  60. package/src/overlay-utils.js.map +7 -1
  61. package/src/overlay.dev.js +85 -0
  62. package/src/overlay.dev.js.map +7 -0
  63. package/src/overlay.js +83 -119
  64. package/src/overlay.js.map +7 -1
  65. package/stories/overlay-story-components.js +188 -184
  66. package/stories/overlay-story-components.js.map +7 -1
  67. package/stories/overlay.stories.js +238 -228
  68. package/stories/overlay.stories.js.map +7 -1
  69. package/sync/overlay-trigger.dev.js +7 -0
  70. package/sync/overlay-trigger.dev.js.map +7 -0
  71. package/sync/overlay-trigger.js +5 -16
  72. package/sync/overlay-trigger.js.map +7 -1
  73. package/test/benchmark/basic-test.js +7 -18
  74. package/test/benchmark/basic-test.js.map +7 -1
  75. package/test/overlay-lifecycle.test.js +107 -115
  76. package/test/overlay-lifecycle.test.js.map +7 -1
  77. package/test/overlay-timer.test.js +110 -122
  78. package/test/overlay-timer.test.js.map +7 -1
  79. package/test/overlay-trigger-click.test.js +43 -48
  80. package/test/overlay-trigger-click.test.js.map +7 -1
  81. package/test/overlay-trigger-extended.test.js +167 -182
  82. package/test/overlay-trigger-extended.test.js.map +7 -1
  83. package/test/overlay-trigger-hover-click.test.js +59 -73
  84. package/test/overlay-trigger-hover-click.test.js.map +7 -1
  85. package/test/overlay-trigger-hover.test.js +74 -77
  86. package/test/overlay-trigger-hover.test.js.map +7 -1
  87. package/test/overlay-trigger-longpress.test.js +166 -178
  88. package/test/overlay-trigger-longpress.test.js.map +7 -1
  89. package/test/overlay-trigger-sync.test.js +400 -422
  90. package/test/overlay-trigger-sync.test.js.map +7 -1
  91. package/test/overlay-trigger.test.js +400 -422
  92. package/test/overlay-trigger.test.js.map +7 -1
  93. package/test/overlay.test-vrt.js +4 -15
  94. package/test/overlay.test-vrt.js.map +7 -1
  95. package/test/overlay.test.js +458 -479
  96. package/test/overlay.test.js.map +7 -1
@@ -0,0 +1,30 @@
1
+ import { Overlay } from "./overlay.dev.js";
2
+ export class VirtualTrigger {
3
+ constructor(x, y) {
4
+ this.x = 0;
5
+ this.y = 0;
6
+ this.x = x;
7
+ this.y = y;
8
+ }
9
+ updateBoundingClientRect(x, y) {
10
+ this.x = x;
11
+ this.y = y;
12
+ Overlay.update();
13
+ }
14
+ getBoundingClientRect() {
15
+ return {
16
+ width: 0,
17
+ height: 0,
18
+ top: this.y,
19
+ right: this.x,
20
+ y: this.y,
21
+ x: this.x,
22
+ bottom: this.y,
23
+ left: this.x,
24
+ toJSON() {
25
+ return;
26
+ }
27
+ };
28
+ }
29
+ }
30
+ //# sourceMappingURL=VirtualTrigger.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["VirtualTrigger.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Overlay } from './overlay.dev.js'\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
+ "mappings": "AAWA;AAEO,aAAM,eAAe;AAAA,EAIjB,YAAY,GAAW,GAAW;AAHjC,aAAI;AACJ,aAAI;AAGR,SAAK,IAAI;AACT,SAAK,IAAI;AAAA,EACb;AAAA,EAEO,yBAAyB,GAAW,GAAiB;AACxD,SAAK,IAAI;AACT,SAAK,IAAI;AACT,YAAQ,OAAO;AAAA,EACnB;AAAA,EAEO,wBAAiC;AACpC,WAAO;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,GAAG,KAAK;AAAA,MACR,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,SAAS;AACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
+ "names": []
7
+ }
@@ -1,40 +1,30 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- Unless required by applicable law or agreed to in writing, software distributed under
7
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
8
- OF ANY KIND, either express or implied. See the License for the specific language
9
- governing permissions and limitations under the License.
10
- */
11
- import { Overlay } from './overlay.js';
1
+ import { Overlay } from "./overlay.js";
12
2
  export class VirtualTrigger {
13
- constructor(x, y) {
14
- this.x = 0;
15
- this.y = 0;
16
- this.x = x;
17
- this.y = y;
18
- }
19
- updateBoundingClientRect(x, y) {
20
- this.x = x;
21
- this.y = y;
22
- Overlay.update();
23
- }
24
- getBoundingClientRect() {
25
- return {
26
- width: 0,
27
- height: 0,
28
- top: this.y,
29
- right: this.x,
30
- y: this.y,
31
- x: this.x,
32
- bottom: this.y,
33
- left: this.x,
34
- toJSON() {
35
- return;
36
- },
37
- };
38
- }
3
+ constructor(x, y) {
4
+ this.x = 0;
5
+ this.y = 0;
6
+ this.x = x;
7
+ this.y = y;
8
+ }
9
+ updateBoundingClientRect(x, y) {
10
+ this.x = x;
11
+ this.y = y;
12
+ Overlay.update();
13
+ }
14
+ getBoundingClientRect() {
15
+ return {
16
+ width: 0,
17
+ height: 0,
18
+ top: this.y,
19
+ right: this.x,
20
+ y: this.y,
21
+ x: this.x,
22
+ bottom: this.y,
23
+ left: this.x,
24
+ toJSON() {
25
+ return;
26
+ }
27
+ };
28
+ }
39
29
  }
40
- //# sourceMappingURL=VirtualTrigger.js.map
30
+ //# sourceMappingURL=VirtualTrigger.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"VirtualTrigger.js","sourceRoot":"","sources":["VirtualTrigger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;EASE;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,cAAc;IAIvB,YAAmB,CAAS,EAAE,CAAS;QAH/B,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;QAGV,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEM,wBAAwB,CAAC,CAAS,EAAE,CAAS;QAChD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,OAAO,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;IAEM,qBAAqB;QACxB,OAAO;YACH,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,IAAI,CAAC,CAAC;YACX,KAAK,EAAE,IAAI,CAAC,CAAC;YACb,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,MAAM,EAAE,IAAI,CAAC,CAAC;YACd,IAAI,EAAE,IAAI,CAAC,CAAC;YACZ,MAAM;gBACF,OAAO;YACX,CAAC;SACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Overlay } from './overlay.js';\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["VirtualTrigger.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Overlay } from './overlay.js';\n\nexport class VirtualTrigger {\n private x = 0;\n private y = 0;\n\n public constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n public updateBoundingClientRect(x: number, y: number): void {\n this.x = x;\n this.y = y;\n Overlay.update();\n }\n\n public getBoundingClientRect(): DOMRect {\n return {\n width: 0,\n height: 0,\n top: this.y,\n right: this.x,\n y: this.y,\n x: this.x,\n bottom: this.y,\n left: this.x,\n toJSON() {\n return;\n },\n };\n }\n}\n"],
5
+ "mappings": "AAWA;AAEO,aAAM,eAAe;AAAA,EAIjB,YAAY,GAAW,GAAW;AAHjC,aAAI;AACJ,aAAI;AAGR,SAAK,IAAI;AACT,SAAK,IAAI;AAAA,EACb;AAAA,EAEO,yBAAyB,GAAW,GAAiB;AACxD,SAAK,IAAI;AACT,SAAK,IAAI;AACT,YAAQ,OAAO;AAAA,EACnB;AAAA,EAEO,wBAAiC;AACpC,WAAO;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,GAAG,KAAK;AAAA,MACR,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,SAAS;AACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ @keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:-9999em;pointer-events:none;position:absolute;top:-9999em;z-index:1000}:host(:focus){outline:none}:host([placement=none]){height:100vh;height:-webkit-fill-available;height:fill-available;left:0;max-height:var(--swc-visual-viewport-height);position:fixed;top:0}#contents,sp-theme{height:100%}#contents{--swc-overlay-animation-distance:var(
4
+ --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
5
+ );animation-duration:var(
6
+ --swc-test-duration,var(--spectrum-global-animation-duration-200,.16s)
7
+ );animation-timing-function:var(
8
+ --spectrum-global-animation-ease-out,ease-out
9
+ );box-sizing:border-box;display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex;padding-top:var(--swc-overlay-animation-distance)}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1));padding-right:var(--swc-overlay-animation-distance)}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1));padding-bottom:var(--swc-overlay-animation-distance)}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75));padding-left:var(--swc-overlay-animation-distance)}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}
10
+ `;
11
+ export default styles;
12
+ //# sourceMappingURL=active-overlay.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["active-overlay.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n@keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:-9999em;pointer-events:none;position:absolute;top:-9999em;z-index:1000}:host(:focus){outline:none}:host([placement=none]){height:100vh;height:-webkit-fill-available;height:fill-available;left:0;max-height:var(--swc-visual-viewport-height);position:fixed;top:0}#contents,sp-theme{height:100%}#contents{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);animation-duration:var(\n--swc-test-duration,var(--spectrum-global-animation-duration-200,.16s)\n);animation-timing-function:var(\n--spectrum-global-animation-ease-out,ease-out\n);box-sizing:border-box;display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex;padding-top:var(--swc-overlay-animation-distance)}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1));padding-right:var(--swc-overlay-animation-distance)}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1));padding-bottom:var(--swc-overlay-animation-distance)}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75));padding-left:var(--swc-overlay-animation-distance)}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
14
3
  @keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:-9999em;pointer-events:none;position:absolute;top:-9999em;z-index:1000}:host(:focus){outline:none}:host([placement=none]){height:100vh;height:-webkit-fill-available;height:fill-available;left:0;max-height:var(--swc-visual-viewport-height);position:fixed;top:0}#contents,sp-theme{height:100%}#contents{--swc-overlay-animation-distance:var(
15
4
  --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
16
5
  );animation-duration:var(
@@ -20,4 +9,4 @@ const styles = css `
20
9
  );box-sizing:border-box;display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex;padding-top:var(--swc-overlay-animation-distance)}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1));padding-right:var(--swc-overlay-animation-distance)}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1));padding-bottom:var(--swc-overlay-animation-distance)}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75));padding-left:var(--swc-overlay-animation-distance)}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}
21
10
  `;
22
11
  export default styles;
23
- //# sourceMappingURL=active-overlay.css.js.map
12
+ //# sourceMappingURL=active-overlay.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"active-overlay.css.js","sourceRoot":"","sources":["active-overlay.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;CAQjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n@keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:-9999em;pointer-events:none;position:absolute;top:-9999em;z-index:1000}:host(:focus){outline:none}:host([placement=none]){height:100vh;height:-webkit-fill-available;height:fill-available;left:0;max-height:var(--swc-visual-viewport-height);position:fixed;top:0}#contents,sp-theme{height:100%}#contents{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);animation-duration:var(\n--swc-test-duration,var(--spectrum-global-animation-duration-200,.16s)\n);animation-timing-function:var(\n--spectrum-global-animation-ease-out,ease-out\n);box-sizing:border-box;display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex;padding-top:var(--swc-overlay-animation-distance)}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1));padding-right:var(--swc-overlay-animation-distance)}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1));padding-bottom:var(--swc-overlay-animation-distance)}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75));padding-left:var(--swc-overlay-animation-distance)}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["active-overlay.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n@keyframes sp-overlay-fade-in{0%{opacity:0;transform:var(--sp-overlay-from)}to{opacity:1;transform:translate(0)}}@keyframes sp-overlay-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:var(--sp-overlay-from)}}:host{display:inline-block;left:-9999em;pointer-events:none;position:absolute;top:-9999em;z-index:1000}:host(:focus){outline:none}:host([placement=none]){height:100vh;height:-webkit-fill-available;height:fill-available;left:0;max-height:var(--swc-visual-viewport-height);position:fixed;top:0}#contents,sp-theme{height:100%}#contents{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);animation-duration:var(\n--swc-test-duration,var(--spectrum-global-animation-duration-200,.16s)\n);animation-timing-function:var(\n--spectrum-global-animation-ease-out,ease-out\n);box-sizing:border-box;display:inline-block;opacity:1;pointer-events:none;visibility:visible}:host([actual-placement*=top]) #contents{--sp-overlay-from:translateY(var(--spectrum-global-dimension-size-75));align-items:flex-end;display:inline-flex;padding-top:var(--swc-overlay-animation-distance)}:host([actual-placement*=right]) #contents{--sp-overlay-from:translateX(calc(var(--spectrum-global-dimension-size-75)*-1));padding-right:var(--swc-overlay-animation-distance)}:host([actual-placement*=bottom]) #contents{--sp-overlay-from:translateY(calc(var(--spectrum-global-dimension-size-75)*-1));padding-bottom:var(--swc-overlay-animation-distance)}:host([actual-placement*=left]) #contents{--sp-overlay-from:translateX(var(--spectrum-global-dimension-size-75));padding-left:var(--swc-overlay-animation-distance)}:host([animating]) ::slotted(*){pointer-events:none}:host(:not([animating])) ::slotted(*){pointer-events:auto}#contents ::slotted(*){position:relative}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./overlay.dev.js";
2
+ export * from "./OverlayTrigger.dev.js";
3
+ export * from "./overlay-types.dev.js";
4
+ export * from "./ActiveOverlay.dev.js";
5
+ export * from "./loader.dev.js";
6
+ export * from "./VirtualTrigger.dev.js";
7
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './overlay.dev.js'\nexport * from './OverlayTrigger.dev.js'\nexport * from './overlay-types.dev.js'\nexport * from './ActiveOverlay.dev.js'\nexport * from './loader.dev.js'\nexport * from './VirtualTrigger.dev.js'\n"],
5
+ "mappings": "AAWA;AACA;AACA;AACA;AACA;AACA;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,18 +1,7 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- export * from './overlay.js';
13
- export * from './OverlayTrigger.js';
14
- export * from './overlay-types.js';
15
- export * from './ActiveOverlay.js';
16
- export * from './loader.js';
17
- export * from './VirtualTrigger.js';
18
- //# sourceMappingURL=index.js.map
1
+ export * from "./overlay.js";
2
+ export * from "./OverlayTrigger.js";
3
+ export * from "./overlay-types.js";
4
+ export * from "./ActiveOverlay.js";
5
+ export * from "./loader.js";
6
+ export * from "./VirtualTrigger.js";
7
+ //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './overlay.js';\nexport * from './OverlayTrigger.js';\nexport * from './overlay-types.js';\nexport * from './ActiveOverlay.js';\nexport * from './loader.js';\nexport * from './VirtualTrigger.js';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './overlay.js';\nexport * from './OverlayTrigger.js';\nexport * from './overlay-types.js';\nexport * from './ActiveOverlay.js';\nexport * from './loader.js';\nexport * from './VirtualTrigger.js';\n"],
5
+ "mappings": "AAWA;AACA;AACA;AACA;AACA;AACA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ export const openOverlay = async (target, interaction, content, options) => {
2
+ const { Overlay } = await import("@spectrum-web-components/overlay/src/overlay.js");
3
+ return Overlay.open(target, interaction, content, options);
4
+ };
5
+ //# sourceMappingURL=loader.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["loader.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types';\n\nexport const openOverlay = async (\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n): Promise<() => void> => {\n const { Overlay } = await import(\n '@spectrum-web-components/overlay/src/overlay.js'\n );\n return Overlay.open(target, interaction, content, options);\n};\n"],
5
+ "mappings": "AAcO,aAAM,cAAc,OACvB,QACA,aACA,SACA,YACsB;AACtB,QAAM,EAAE,YAAY,MAAM,OACtB;AAEJ,SAAO,QAAQ,KAAK,QAAQ,aAAa,SAAS,OAAO;AAC7D;",
6
+ "names": []
7
+ }
package/src/loader.js CHANGED
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
1
  export const openOverlay = async (target, interaction, content, options) => {
13
- const { Overlay } = await import('./overlay.js');
14
- return Overlay.open(target, interaction, content, options);
2
+ const { Overlay } = await import("@spectrum-web-components/overlay/src/overlay.js");
3
+ return Overlay.open(target, interaction, content, options);
15
4
  };
16
- //# sourceMappingURL=loader.js.map
5
+ //# sourceMappingURL=loader.js.map
package/src/loader.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAIF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC5B,MAAmB,EACnB,WAAgC,EAChC,OAAoB,EACpB,OAAuB,EACJ,EAAE;IACrB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types';\n\nexport const openOverlay = async (\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n): Promise<() => void> => {\n const { Overlay } = await import('./overlay.js');\n return Overlay.open(target, interaction, content, options);\n};\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["loader.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport type { OverlayOptions, TriggerInteractions } from './overlay-types';\n\nexport const openOverlay = async (\n target: HTMLElement,\n interaction: TriggerInteractions,\n content: HTMLElement,\n options: OverlayOptions\n): Promise<() => void> => {\n const { Overlay } = await import(\n '@spectrum-web-components/overlay/src/overlay.js'\n );\n return Overlay.open(target, interaction, content, options);\n};\n"],
5
+ "mappings": "AAcO,aAAM,cAAc,OACvB,QACA,aACA,SACA,YACsB;AACtB,QAAM,EAAE,YAAY,MAAM,OACtB;AAEJ,SAAO,QAAQ,KAAK,QAAQ,aAAa,SAAS,OAAO;AAC7D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ export declare class OverlayCloseEvent extends Event {
2
+ root?: HTMLElement;
3
+ constructor({ root }: {
4
+ root?: HTMLElement;
5
+ });
6
+ }
7
+ declare global {
8
+ interface GlobalEventHandlersEventMap {
9
+ 'sp-overlay-close': CustomEvent<OverlayCloseEvent>;
10
+ }
11
+ }
@@ -0,0 +1,7 @@
1
+ export class OverlayCloseEvent extends Event {
2
+ constructor({ root }) {
3
+ super("sp-overlay-close", { bubbles: true, composed: true });
4
+ this.root = root;
5
+ }
6
+ }
7
+ //# sourceMappingURL=overlay-events.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-events.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport class OverlayCloseEvent extends Event {\n root?: HTMLElement;\n constructor({ root }: { root?: HTMLElement }) {\n super('sp-overlay-close', { bubbles: true, composed: true });\n this.root = root;\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-overlay-close': CustomEvent<OverlayCloseEvent>;\n }\n}\n"],
5
+ "mappings": "AAYO,aAAM,0BAA0B,MAAM;AAAA,EAEzC,YAAY,EAAE,QAAgC;AAC1C,UAAM,oBAAoB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAC3D,SAAK,OAAO;AAAA,EAChB;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ export class OverlayCloseEvent extends Event {
2
+ constructor({ root }) {
3
+ super("sp-overlay-close", { bubbles: true, composed: true });
4
+ this.root = root;
5
+ }
6
+ }
7
+ //# sourceMappingURL=overlay-events.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-events.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport class OverlayCloseEvent extends Event {\n root?: HTMLElement;\n constructor({ root }: { root?: HTMLElement }) {\n super('sp-overlay-close', { bubbles: true, composed: true });\n this.root = root;\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-overlay-close': CustomEvent<OverlayCloseEvent>;\n }\n}\n"],
5
+ "mappings": "AAYO,aAAM,0BAA0B,MAAM;AAAA,EAEzC,YAAY,EAAE,QAAgC;AAC1C,UAAM,oBAAoB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAC3D,SAAK,OAAO;AAAA,EAChB;AACJ;",
6
+ "names": []
7
+ }
@@ -1,6 +1,7 @@
1
1
  import { ActiveOverlay } from './ActiveOverlay.js';
2
2
  import type { OverlayOpenDetail } from './overlay-types';
3
3
  import '../active-overlay.js';
4
+ import { OverlayCloseEvent } from './overlay-events.js';
4
5
  export declare class OverlayStack {
5
6
  overlays: ActiveOverlay[];
6
7
  private preventMouseRootClose;
@@ -22,6 +23,7 @@ export declare class OverlayStack {
22
23
  private get topOverlay();
23
24
  private findOverlayForContent;
24
25
  private addEventListeners;
26
+ handleOverlayClose: (event: OverlayCloseEvent) => void;
25
27
  private isClickOverlayActiveForTrigger;
26
28
  openOverlay(details: OverlayOpenDetail): Promise<boolean>;
27
29
  addOverlayEventListeners(activeOverlay: ActiveOverlay): void;