@spectrum-web-components/overlay 0.19.6-overlay.11 → 0.19.6-overlay.13

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 (40) hide show
  1. package/package.json +6 -6
  2. package/src/Overlay.dev.js +15 -1
  3. package/src/Overlay.dev.js.map +2 -2
  4. package/src/Overlay.js +1 -1
  5. package/src/Overlay.js.map +3 -3
  6. package/src/OverlayBase.d.ts +4 -2
  7. package/src/OverlayBase.dev.js +31 -9
  8. package/src/OverlayBase.dev.js.map +2 -2
  9. package/src/OverlayBase.js +4 -4
  10. package/src/OverlayBase.js.map +3 -3
  11. package/src/OverlayDialog.dev.js +3 -3
  12. package/src/OverlayDialog.dev.js.map +2 -2
  13. package/src/OverlayDialog.js +1 -1
  14. package/src/OverlayDialog.js.map +2 -2
  15. package/src/OverlayNoPopover.dev.js +3 -3
  16. package/src/OverlayNoPopover.dev.js.map +2 -2
  17. package/src/OverlayNoPopover.js +1 -1
  18. package/src/OverlayNoPopover.js.map +2 -2
  19. package/src/OverlayPopover.dev.js +7 -4
  20. package/src/OverlayPopover.dev.js.map +2 -2
  21. package/src/OverlayPopover.js +1 -1
  22. package/src/OverlayPopover.js.map +2 -2
  23. package/src/OverlayTrigger.d.ts +1 -1
  24. package/src/OverlayTrigger.dev.js +0 -16
  25. package/src/OverlayTrigger.dev.js.map +2 -2
  26. package/src/OverlayTrigger.js +2 -2
  27. package/src/OverlayTrigger.js.map +2 -2
  28. package/src/PlacementController.dev.js +11 -7
  29. package/src/PlacementController.dev.js.map +2 -2
  30. package/src/PlacementController.js.map +2 -2
  31. package/src/overlay-base.css.dev.js +1 -1
  32. package/src/overlay-base.css.dev.js.map +1 -1
  33. package/src/overlay-base.css.js +1 -1
  34. package/src/overlay-base.css.js.map +1 -1
  35. package/stories/overlay-element.stories.js +2 -1
  36. package/stories/overlay-element.stories.js.map +2 -2
  37. package/test/overlay-element.test.js +27 -12
  38. package/test/overlay-element.test.js.map +2 -2
  39. package/test/overlay.test.js +4 -21
  40. package/test/overlay.test.js.map +2 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";import{css as a}from"@spectrum-web-components/base";const o=a`
2
2
  :host{--swc-overlay-animation-distance:var(
3
3
  --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
4
- )}dialog{background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) dialog{left:0;pointer-events:none;top:0;transform:translate(-999em,-999em)}dialog::backdrop{display:none}dialog>div{width:100%}::slotted(sp-popover){position:static}dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}@supports selector(:open){dialog{opacity:0}dialog:open{opacity:1}}@supports not selector(:open){:host:not([open]) dialog{pointer-events:none}dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}
4
+ );position:fixed}dialog{background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) dialog{left:0;pointer-events:none;top:0;transform:translate(-999em,-999em)}dialog::backdrop{display:none}dialog>div{width:100%}::slotted(sp-popover){position:static}dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}@supports selector(:open){dialog{opacity:0}dialog:open{opacity:1}}@supports not selector(:open){:host:not([open]) dialog{pointer-events:none}dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}
5
5
  `;export default o;
6
6
  //# sourceMappingURL=overlay-base.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-base.css.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 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:host{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n)}dialog{background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) dialog{left:0;pointer-events:none;top:0;transform:translate(-999em,-999em)}dialog::backdrop{display:none}dialog>div{width:100%}::slotted(sp-popover){position:static}dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}@supports selector(:open){dialog{opacity:0}dialog:open{opacity:1}}@supports not selector(:open){:host:not([open]) dialog{pointer-events:none}dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}\n`;\nexport default styles;"],
4
+ "sourcesContent": ["/*\nCopyright 2023 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:host{--swc-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);position:fixed}dialog{background:none;border:0;box-sizing:border-box;display:flex;margin:0;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);opacity:1!important;overflow:visible;padding:0;position:fixed}:host(:not([open])) dialog{left:0;pointer-events:none;top:0;transform:translate(-999em,-999em)}dialog::backdrop{display:none}dialog>div{width:100%}::slotted(sp-popover){position:static}dialog[actual-placement*=top]{margin-top:var(--swc-overlay-animation-distance);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=right]{margin-left:calc(var(--swc-overlay-animation-distance)*-1);padding-inline:var(--swc-overlay-animation-distance)}dialog[actual-placement*=bottom]{margin-top:calc(var(--swc-overlay-animation-distance)*-1);padding-block:var(--swc-overlay-animation-distance)}dialog[actual-placement*=left]{margin-left:var(--swc-overlay-animation-distance);padding-inline:var(--swc-overlay-animation-distance)}@supports selector(:open){dialog{opacity:0}dialog:open{opacity:1}}@supports not selector(:open){:host:not([open]) dialog{pointer-events:none}dialog[actual-placement]{z-index:var(--swc-overlay-z-index)}}\n`;\nexport default styles;"],
5
5
  "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA,EAKf,eAAeC",
6
6
  "names": ["css", "styles"]
7
7
  }
@@ -42,8 +42,9 @@ const Template = ({
42
42
  trigger="trigger@${interaction}"
43
43
  type=${ifDefined(type)}
44
44
  placement=${ifDefined(placement)}
45
+ offset="-10"
45
46
  >
46
- <sp-popover dialog tip>
47
+ <sp-popover dialog>
47
48
  <p>
48
49
  Content goes here.
49
50
  ${type === "modal" || type === "page" ? html`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-element.stories.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\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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-anchor-select.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-polygon-select.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-rect-select.js';\nimport { Placement } from '@floating-ui/dom';\nimport { OverlayTypes } from '../src/OverlayBase.js';\nimport { notAgain } from '../../dialog/stories/dialog-base.stories.js';\n\nexport default {\n title: 'Overlay Element',\n component: 'sp-overlay',\n args: {\n open: true,\n },\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the second accordion item is open.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype Properties = {\n interaction: 'click' | 'hover' | 'longpress';\n open?: boolean;\n placement?: Placement;\n type?: OverlayTypes;\n};\n\nconst Template = ({\n interaction,\n open,\n placement,\n type,\n}: Properties): TemplateResult => html`\n <sp-action-button id=\"trigger\">Open the overlay</sp-action-button>\n <sp-overlay\n ?open=${open}\n trigger=\"trigger@${interaction}\"\n type=${ifDefined(type)}\n placement=${ifDefined(placement)}\n >\n <sp-popover dialog tip>\n <p>\n Content goes here.\n ${type === 'modal' || type === 'page'\n ? html`\n Or, a link,\n <sp-link\n href=\"https://opensource.adobe.com/spectrum-web-components\"\n >\n Spectrum Web Components\n </sp-link>\n .\n `\n : ''}\n </p>\n </sp-popover>\n </sp-overlay>\n`;\n\nexport const modal = (args: Properties): TemplateResult => Template(args);\nmodal.args = {\n interaction: 'click',\n placement: 'right',\n type: 'modal',\n};\n\nexport const page = ({\n interaction,\n open,\n placement,\n type,\n}: Properties): TemplateResult => html`\n <sp-action-button id=\"trigger\">Open the overlay</sp-action-button>\n <sp-overlay\n ?open=${open}\n trigger=\"trigger@${interaction}\"\n type=${ifDefined(type)}\n placement=${ifDefined(placement)}\n >\n ${notAgain()}\n </sp-overlay>\n`;\npage.args = {\n interaction: 'click',\n placement: 'right',\n type: 'page',\n};\n\nexport const click = (args: Properties): TemplateResult => Template(args);\nclick.args = {\n interaction: 'click',\n placement: 'right',\n type: 'auto',\n};\n\nexport const hover = (args: Properties): TemplateResult => Template(args);\nhover.args = {\n interaction: 'hover',\n placement: 'right',\n};\n\nexport const longpress = (args: Properties): TemplateResult => Template(args);\nlongpress.args = {\n interaction: 'longpress',\n placement: 'right',\n type: 'auto',\n};\n\nexport const all = (): TemplateResult => html`\n <sp-action-button id=\"trigger\" hold-affordance>\n Open the overlay\n </sp-action-button>\n <sp-overlay trigger=\"trigger@click\" type=\"auto\" placement=\"right\">\n <sp-popover dialog>Click content</sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger@hover\">\n <sp-tooltip>Hover content</sp-tooltip>\n </sp-overlay>\n <sp-overlay trigger=\"trigger@longpress\" type=\"auto\" placement=\"right\">\n <sp-popover dialog>Longpress content</sp-popover>\n </sp-overlay>\n`;\n\nexport const actionGroup = (): TemplateResult => {\n const popoverOffset = [6, -9] as [number, number];\n return html`\n <style>\n sp-popover sp-action-group {\n padding: var(--spectrum-actiongroup-vertical-spacing-regular);\n }\n sp-popover {\n position: static;\n }\n </style>\n <sp-popover open>\n <sp-action-group vertical quiet emphasized selects=\"single\">\n <sp-action-button id=\"trigger-1\" hold-affordance>\n <sp-icon-anchor-select slot=\"icon\"></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button id=\"trigger-2\" hold-affordance>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button id=\"trigger-3\" hold-affordance>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n <sp-overlay trigger=\"trigger-1@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-1@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger-2@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-2@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger-3@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-3@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n `;\n};\n"],
5
- "mappings": ";AAWA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,SAAS,gBAAgB;AAEzB,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,IACF,MAAM;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACN,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,aAAa;AAAA,MACb,OAAO;AAAA,QACH,MAAM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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAelC,aAAM,cAAc,MAAsB;AAC7C,QAAM,gBAAgB,CAAC,GAAG,EAAE;AAC5B,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBA+BW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBA2BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBA2BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBtB;",
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\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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-anchor-select.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-polygon-select.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-rect-select.js';\nimport { Placement } from '@floating-ui/dom';\nimport { OverlayTypes } from '../src/OverlayBase.js';\nimport { notAgain } from '../../dialog/stories/dialog-base.stories.js';\n\nexport default {\n title: 'Overlay Element',\n component: 'sp-overlay',\n args: {\n open: true,\n },\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the second accordion item is open.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype Properties = {\n interaction: 'click' | 'hover' | 'longpress';\n open?: boolean;\n placement?: Placement;\n type?: OverlayTypes;\n};\n\nconst Template = ({\n interaction,\n open,\n placement,\n type,\n}: Properties): TemplateResult => html`\n <sp-action-button id=\"trigger\">Open the overlay</sp-action-button>\n <sp-overlay\n ?open=${open}\n trigger=\"trigger@${interaction}\"\n type=${ifDefined(type)}\n placement=${ifDefined(placement)}\n offset=\"-10\"\n >\n <sp-popover dialog>\n <p>\n Content goes here.\n ${type === 'modal' || type === 'page'\n ? html`\n Or, a link,\n <sp-link\n href=\"https://opensource.adobe.com/spectrum-web-components\"\n >\n Spectrum Web Components\n </sp-link>\n .\n `\n : ''}\n </p>\n </sp-popover>\n </sp-overlay>\n`;\n\nexport const modal = (args: Properties): TemplateResult => Template(args);\nmodal.args = {\n interaction: 'click',\n placement: 'right',\n type: 'modal',\n};\n\nexport const page = ({\n interaction,\n open,\n placement,\n type,\n}: Properties): TemplateResult => html`\n <sp-action-button id=\"trigger\">Open the overlay</sp-action-button>\n <sp-overlay\n ?open=${open}\n trigger=\"trigger@${interaction}\"\n type=${ifDefined(type)}\n placement=${ifDefined(placement)}\n >\n ${notAgain()}\n </sp-overlay>\n`;\npage.args = {\n interaction: 'click',\n placement: 'right',\n type: 'page',\n};\n\nexport const click = (args: Properties): TemplateResult => Template(args);\nclick.args = {\n interaction: 'click',\n placement: 'right',\n type: 'auto',\n};\n\nexport const hover = (args: Properties): TemplateResult => Template(args);\nhover.args = {\n interaction: 'hover',\n placement: 'right',\n};\n\nexport const longpress = (args: Properties): TemplateResult => Template(args);\nlongpress.args = {\n interaction: 'longpress',\n placement: 'right',\n type: 'auto',\n};\n\nexport const all = (): TemplateResult => html`\n <sp-action-button id=\"trigger\" hold-affordance>\n Open the overlay\n </sp-action-button>\n <sp-overlay trigger=\"trigger@click\" type=\"auto\" placement=\"right\">\n <sp-popover dialog>Click content</sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger@hover\">\n <sp-tooltip>Hover content</sp-tooltip>\n </sp-overlay>\n <sp-overlay trigger=\"trigger@longpress\" type=\"auto\" placement=\"right\">\n <sp-popover dialog>Longpress content</sp-popover>\n </sp-overlay>\n`;\n\nexport const actionGroup = (): TemplateResult => {\n const popoverOffset = [6, -9] as [number, number];\n return html`\n <style>\n sp-popover sp-action-group {\n padding: var(--spectrum-actiongroup-vertical-spacing-regular);\n }\n sp-popover {\n position: static;\n }\n </style>\n <sp-popover open>\n <sp-action-group vertical quiet emphasized selects=\"single\">\n <sp-action-button id=\"trigger-1\" hold-affordance>\n <sp-icon-anchor-select slot=\"icon\"></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button id=\"trigger-2\" hold-affordance>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button id=\"trigger-3\" hold-affordance>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n <sp-overlay trigger=\"trigger-1@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-1@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger-2@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-2@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n <sp-overlay trigger=\"trigger-3@hover\">\n <sp-tooltip>Hover</sp-tooltip>\n </sp-overlay>\n <sp-overlay\n trigger=\"trigger-3@longpress\"\n type=\"auto\"\n placement=\"right-start\"\n .offset=${popoverOffset}\n >\n <sp-popover tip>\n <sp-action-group vertical quiet>\n <sp-action-button>\n <sp-icon-anchor-select\n slot=\"icon\"\n ></sp-icon-anchor-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-polygon-select\n slot=\"icon\"\n ></sp-icon-polygon-select>\n </sp-action-button>\n <sp-action-button>\n <sp-icon-rect-select slot=\"icon\"></sp-icon-rect-select>\n </sp-action-button>\n </sp-action-group>\n </sp-popover>\n </sp-overlay>\n `;\n};\n"],
5
+ "mappings": ";AAWA,SAAS,YAA4B;AACrC,S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).to.be.true;
377
377
  expect(hint2.open).to.be.false;
378
378
  });
379
- xit("stays open when pointer enters overlay from trigger element", async () => {
379
+ it("stays open when pointer enters overlay from trigger element", async () => {
380
380
  const test = await styledFixture(
381
381
  html`
382
382
  <div>
@@ -386,7 +386,7 @@ describe("sp-overlay", () => {
386
386
  <sp-overlay
387
387
  trigger="test-button@hover"
388
388
  placement="bottom"
389
- offset="-5"
389
+ offset="-10"
390
390
  >
391
391
  <sp-tooltip>Help text.</sp-tooltip>
392
392
  </sp-overlay>
@@ -401,7 +401,7 @@ describe("sp-overlay", () => {
401
401
  const buttonRect = button.getBoundingClientRect();
402
402
  const buttonPoint = [
403
403
  buttonRect.x + buttonRect.width / 2,
404
- buttonRect.y + buttonRect.height / 2
404
+ buttonRect.y + buttonRect.height - 2
405
405
  ];
406
406
  await elementUpdated(overlay);
407
407
  await expect(button).to.be.accessible();
@@ -416,21 +416,38 @@ describe("sp-overlay", () => {
416
416
  });
417
417
  await nextFrame();
418
418
  await nextFrame();
419
- const tooltipRect = el.shadowRoot.querySelector("#tooltip").getBoundingClientRect();
420
- const tooltipPoint = [
421
- tooltipRect.x + tooltipRect.width / 2,
422
- tooltipRect.y + tooltipRect.height / 2
423
- ];
419
+ await nextFrame();
420
+ await nextFrame();
421
+ expect(overlay.open).to.be.true;
424
422
  await sendMouse({
425
423
  steps: [
426
424
  {
427
425
  type: "move",
428
- position: tooltipPoint
426
+ position: [
427
+ buttonRect.x + buttonRect.width / 2,
428
+ buttonRect.y + buttonRect.height - 1
429
+ ]
430
+ },
431
+ {
432
+ type: "move",
433
+ position: [
434
+ buttonRect.x + buttonRect.width / 2,
435
+ buttonRect.y + buttonRect.height
436
+ ]
437
+ },
438
+ {
439
+ type: "move",
440
+ position: [
441
+ buttonRect.x + buttonRect.width / 2,
442
+ buttonRect.y + buttonRect.height + 1
443
+ ]
429
444
  }
430
445
  ]
431
446
  });
447
+ await nextFrame();
448
+ await nextFrame();
449
+ expect(overlay.open).to.be.true;
432
450
  await opened;
433
- await elementUpdated(el);
434
451
  expect(el.open).to.be.true;
435
452
  await expect(button).to.be.accessible();
436
453
  let closed = oneEvent(button, "sp-closed");
@@ -454,7 +471,6 @@ describe("sp-overlay", () => {
454
471
  ]
455
472
  });
456
473
  await closed;
457
- await elementUpdated(el);
458
474
  expect(el.open).to.be.false;
459
475
  opened = oneEvent(button, "sp-opened");
460
476
  await sendMouse({
@@ -480,7 +496,6 @@ describe("sp-overlay", () => {
480
496
  ]
481
497
  });
482
498
  await closed;
483
- await elementUpdated(el);
484
499
  });
485
500
  it("stays open when pointer enters overlay from trigger element", async () => {
486
501
  const button = await styledFixture(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-element.test.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*/\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { OverlayBase } from '@spectrum-web-components/overlay/src/OverlayBase.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<OverlayBase>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n let closed = oneEvent(page, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n let closed = oneEvent(modal, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as OverlayBase;\n const hint2 = test.querySelector('.hint-2') as OverlayBase;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n xit('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n placement=\"bottom\"\n offset=\"-5\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as OverlayBase;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n await elementUpdated(el);\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n await elementUpdated(el);\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n\n it('does not close other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n let closed = oneEvent(modal, 'sp-closed');\n let manualClosed = oneEvent(manual, 'sp-closed');\n modal.open = false;\n manual.open = false;\n await closed;\n await manualClosed;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n page.open = false;\n manual.open = false;\n await closed;\n await manualClosed;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(hint, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n hint.open = false;\n manual.open = false;\n await closed;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.true;\n });\n });\n});\n"],
5
- "mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAG1B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MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,YAAM,UAAU;AAEhB,eAAS,SAAS,MAAM,WAAW;AACnC,qBAAe,SAAS,QAAQ,WAAW;AAC3C,WAAK,OAAO;AACZ,aAAO,OAAO;AACd,YAAM;AACN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,eAAS,SAAS,MAAM,WAAW;AACnC,WAAK,OAAO;AACZ,YAAM;AAEN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,eAAS,SAAS,QAAQ,WAAW;AACrC,aAAO,OAAO;AACd,YAAM;AAEN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IAC9B,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
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*/\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { OverlayBase } from '@spectrum-web-components/overlay/src/OverlayBase.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<OverlayBase>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n let closed = oneEvent(page, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n let closed = oneEvent(modal, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as OverlayBase;\n const hint2 = test.querySelector('.hint-2') as OverlayBase;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as OverlayBase;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n\n it('does not close other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n let closed = oneEvent(modal, 'sp-closed');\n let manualClosed = oneEvent(manual, 'sp-closed');\n modal.open = false;\n manual.open = false;\n await closed;\n await manualClosed;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n page.open = false;\n manual.open = false;\n await closed;\n await manualClosed;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(hint, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n hint.open = false;\n manual.open = false;\n await closed;\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.true;\n });\n });\n});\n"],
5
+ "mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAG1B,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB;AAAA;AAAA,KAET;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAiC;AACzD,OAAG,cAAc,kBAAkB,YAAY;AAC3C,YAAM,KAAK,MAAM,cAA2B;AAAA,wCAChB;AAAA;AAAA;AAAA,aAG3B;AACD,YAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,UAAI,SAAS,SAAS,IAAI,WAAW;AACrC,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAC3B,YAAM,SAAS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G,GAAG;AAE1B,YAAM,UAAU;AAEhB,eAAS,SAAS,MAAM,WAAW;AACnC,qBAAe,SAAS,QAAQ,WAAW;AAC3C,WAAK,OAAO;AACZ,aAAO,OAAO;AACd,YAAM;AACN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,eAAS,SAAS,MAAM,WAAW;AACnC,WAAK,OAAO;AACZ,YAAM;AAEN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,eAAS,SAAS,QAAQ,WAAW;AACrC,aAAO,OAAO;AACd,YAAM;AAEN,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IAC9B,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -444,23 +444,10 @@ describe('Overlay - type="modal"', () => {
444
444
  it('closes the first "contextmenu" when opening a second', async () => {
445
445
  const closed = oneEvent(document, "sp-closed");
446
446
  const opened = oneEvent(document, "sp-opened");
447
- await sendMouse({
448
- steps: [
449
- {
450
- type: "move",
451
- position: [width / 4, height / 4]
452
- },
453
- {
454
- type: "click",
455
- options: {
456
- button: "right"
457
- },
458
- position: [width / 4, height / 4]
459
- }
460
- ]
461
- });
462
- await opened;
447
+ const trigger = document.querySelector("start-end-contextmenu");
448
+ trigger.dispatchEvent(new Event("contextmenu"));
463
449
  await closed;
450
+ await opened;
464
451
  secondMenu = document.querySelector("sp-popover");
465
452
  secondRect = secondMenu.getBoundingClientRect();
466
453
  expect(secondMenu).to.not.be.null;
@@ -469,13 +456,9 @@ describe('Overlay - type="modal"', () => {
469
456
  const closed = oneEvent(document, "sp-closed");
470
457
  sendMouse({
471
458
  steps: [
472
- {
473
- type: "move",
474
- position: [width / 8, height / 8]
475
- },
476
459
  {
477
460
  type: "click",
478
- position: [width / 8, height / 8]
461
+ position: [width - width / 8, height - height / 8]
479
462
  }
480
463
  ]
481
464
  });