@spectrum-web-components/popover 0.11.16 → 0.11.17

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.
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "kind": "javascript-module",
7
- "path": "sp-popover.ts",
7
+ "path": "sp-popover.js",
8
8
  "declarations": [],
9
9
  "exports": [
10
10
  {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "kind": "javascript-module",
22
- "path": "src/Popover.ts",
22
+ "path": "src/Popover.js",
23
23
  "declarations": [
24
24
  {
25
25
  "kind": "class",
@@ -158,7 +158,7 @@
158
158
  "name": "Popover",
159
159
  "declaration": {
160
160
  "name": "Popover",
161
- "module": "src/Popover.ts"
161
+ "module": "src/Popover.js"
162
162
  }
163
163
  }
164
164
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/popover",
3
- "version": "0.11.16",
3
+ "version": "0.11.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,24 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-popover": "./sp-popover.js",
27
- "./sp-popover.js": "./sp-popover.js"
28
+ "./src/Popover.js": {
29
+ "development": "./src/Popover.dev.js",
30
+ "default": "./src/Popover.js"
31
+ },
32
+ "./src/index.js": {
33
+ "development": "./src/index.dev.js",
34
+ "default": "./src/index.js"
35
+ },
36
+ "./src/popover.css.js": "./src/popover.css.js",
37
+ "./sp-popover.js": {
38
+ "development": "./sp-popover.dev.js",
39
+ "default": "./sp-popover.js"
40
+ }
28
41
  },
29
42
  "scripts": {
30
43
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -44,8 +57,8 @@
44
57
  "lit-html"
45
58
  ],
46
59
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.8",
48
- "@spectrum-web-components/overlay": "^0.16.5",
60
+ "@spectrum-web-components/base": "^0.6.0",
61
+ "@spectrum-web-components/overlay": "^0.17.0",
49
62
  "tslib": "^2.0.0"
50
63
  },
51
64
  "devDependencies": {
@@ -56,5 +69,5 @@
56
69
  "sideEffects": [
57
70
  "./sp-*.js"
58
71
  ],
59
- "gitHead": "3be62133721efba844cd7032566a2c49ed6d9875"
72
+ "gitHead": "50cac779bbb0d6735c2061f1eceb86b9daf9b22b"
60
73
  }
@@ -0,0 +1,3 @@
1
+ import { Popover } from "./src/Popover.dev.js";
2
+ customElements.define("sp-popover", Popover);
3
+ //# sourceMappingURL=sp-popover.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-popover.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 { Popover } from './src/Popover.dev.js'\n\ncustomElements.define('sp-popover', Popover);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-popover': Popover;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,cAAc,OAAO;",
6
+ "names": []
7
+ }
package/sp-popover.js CHANGED
@@ -1,14 +1,3 @@
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
- import { Popover } from './src/Popover.js';
13
- customElements.define('sp-popover', Popover);
14
- //# sourceMappingURL=sp-popover.js.map
1
+ import { Popover } from "./src/Popover.js";
2
+ customElements.define("sp-popover", Popover);
3
+ //# sourceMappingURL=sp-popover.js.map
package/sp-popover.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-popover.js","sourceRoot":"","sources":["sp-popover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,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*/\nimport { Popover } from './src/Popover.js';\n\ncustomElements.define('sp-popover', Popover);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-popover': Popover;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-popover.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 { Popover } from './src/Popover.js';\n\ncustomElements.define('sp-popover', Popover);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-popover': Popover;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,cAAc,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,84 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ nothing,
15
+ SpectrumElement
16
+ } from "@spectrum-web-components/base";
17
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
18
+ import popoverStyles from "./popover.css.js";
19
+ export class Popover extends SpectrumElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.dialog = false;
23
+ this.open = false;
24
+ this.placement = "none";
25
+ this.tip = false;
26
+ }
27
+ static get styles() {
28
+ return [popoverStyles];
29
+ }
30
+ renderTip() {
31
+ return html`
32
+ <div id="tip">
33
+ <svg
34
+ xmlns="http://www.w3.org/svg/2000"
35
+ class="tip"
36
+ viewBox="0 0 24 12"
37
+ >
38
+ <path
39
+ class="triangle"
40
+ d="M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0"
41
+ ></path>
42
+ </svg>
43
+ </div>
44
+ `;
45
+ }
46
+ connectedCallback() {
47
+ super.connectedCallback();
48
+ this.addEventListener("sp-overlay-query", this.onOverlayQuery);
49
+ }
50
+ disconnectedCallback() {
51
+ super.disconnectedCallback();
52
+ this.removeEventListener("sp-overlay-query", this.onOverlayQuery);
53
+ }
54
+ onOverlayQuery(event) {
55
+ if (!event.target)
56
+ return;
57
+ const target = event.target;
58
+ if (target !== this)
59
+ return;
60
+ const tipElement = this.shadowRoot.querySelector("#tip");
61
+ if (tipElement) {
62
+ event.detail.overlayContentTipElement = tipElement;
63
+ }
64
+ }
65
+ render() {
66
+ return html`
67
+ <slot></slot>
68
+ ${this.tip ? this.renderTip() : nothing}
69
+ `;
70
+ }
71
+ }
72
+ __decorateClass([
73
+ property({ type: Boolean, reflect: true })
74
+ ], Popover.prototype, "dialog", 2);
75
+ __decorateClass([
76
+ property({ type: Boolean, reflect: true })
77
+ ], Popover.prototype, "open", 2);
78
+ __decorateClass([
79
+ property({ reflect: true })
80
+ ], Popover.prototype, "placement", 2);
81
+ __decorateClass([
82
+ property({ type: Boolean, reflect: true })
83
+ ], Popover.prototype, "tip", 2);
84
+ //# sourceMappingURL=Popover.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Popover.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 {\n CSSResultArray,\n html,\n nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay/src/overlay-types.js';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAOA;AAKA;AAOO,aAAM,gBAAgB,gBAAgB;AAAA,EAAtC;AAAA;AAUI,kBAAS;AAMT,gBAAO;AAOP,qBAAuB;AAGvB,eAAM;AAAA;AAAA,aAzBc,SAAyB;AAChD,WAAO,CAAC,aAAa;AAAA,EACzB;AAAA,EAyBU,YAA4B;AAClC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX;AAAA,EAEgB,oBAA0B;AACtC,UAAM,kBAAkB;AACxB,SAAK,iBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,SAAK,oBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEO,eAAe,OAAqD;AAEvE,QAAI,CAAC,MAAM;AAAQ;AAEnB,UAAM,SAAS,MAAM;AAErB,QAAI,WAAW;AAAM;AAErB,UAAM,aAAa,KAAK,WAAW,cAAc,MAAM;AACvD,QAAI,YAAY;AACZ,YAAM,OAAO,2BAA2B;AAAA,IAC5C;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,cAED,KAAK,MAAM,KAAK,UAAU,IAAI;AAAA;AAAA,EAExC;AACJ;AAvEW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAVJ,QAUI;AAMA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAhBJ,QAgBI;AAOA;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAvBJ,QAuBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA1BJ,QA0BI;",
6
+ "names": []
7
+ }
package/src/Popover.js CHANGED
@@ -1,47 +1,34 @@
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
- import { __decorate } from "tslib";
13
- import { html, nothing, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import popoverStyles from './popover.css.js';
16
- /**
17
- * @element sp-popover
18
- *
19
- * @slot - content to display within the Popover
20
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ nothing,
15
+ SpectrumElement
16
+ } from "@spectrum-web-components/base";
17
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
18
+ import popoverStyles from "./popover.css.js";
21
19
  export class Popover extends SpectrumElement {
22
- constructor() {
23
- super(...arguments);
24
- /**
25
- * Whether the popover should manage the application
26
- * of padding to its content or not.
27
- */
28
- this.dialog = false;
29
- /**
30
- * Whether the popover is visible or not.
31
- */
32
- this.open = false;
33
- /**
34
- * @type {"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "none"}
35
- * @attr
36
- */
37
- this.placement = 'none';
38
- this.tip = false;
39
- }
40
- static get styles() {
41
- return [popoverStyles];
42
- }
43
- renderTip() {
44
- return html `
20
+ constructor() {
21
+ super(...arguments);
22
+ this.dialog = false;
23
+ this.open = false;
24
+ this.placement = "none";
25
+ this.tip = false;
26
+ }
27
+ static get styles() {
28
+ return [popoverStyles];
29
+ }
30
+ renderTip() {
31
+ return html`
45
32
  <div id="tip">
46
33
  <svg
47
34
  xmlns="http://www.w3.org/svg/2000"
@@ -55,45 +42,43 @@ export class Popover extends SpectrumElement {
55
42
  </svg>
56
43
  </div>
57
44
  `;
45
+ }
46
+ connectedCallback() {
47
+ super.connectedCallback();
48
+ this.addEventListener("sp-overlay-query", this.onOverlayQuery);
49
+ }
50
+ disconnectedCallback() {
51
+ super.disconnectedCallback();
52
+ this.removeEventListener("sp-overlay-query", this.onOverlayQuery);
53
+ }
54
+ onOverlayQuery(event) {
55
+ if (!event.target)
56
+ return;
57
+ const target = event.target;
58
+ if (target !== this)
59
+ return;
60
+ const tipElement = this.shadowRoot.querySelector("#tip");
61
+ if (tipElement) {
62
+ event.detail.overlayContentTipElement = tipElement;
58
63
  }
59
- connectedCallback() {
60
- super.connectedCallback();
61
- this.addEventListener('sp-overlay-query', this.onOverlayQuery);
62
- }
63
- disconnectedCallback() {
64
- super.disconnectedCallback();
65
- this.removeEventListener('sp-overlay-query', this.onOverlayQuery);
66
- }
67
- onOverlayQuery(event) {
68
- /* c8 ignore next */
69
- if (!event.target)
70
- return;
71
- const target = event.target;
72
- /* c8 ignore next */
73
- if (target !== this)
74
- return;
75
- const tipElement = this.shadowRoot.querySelector('#tip');
76
- if (tipElement) {
77
- event.detail.overlayContentTipElement = tipElement;
78
- }
79
- }
80
- render() {
81
- return html `
64
+ }
65
+ render() {
66
+ return html`
82
67
  <slot></slot>
83
68
  ${this.tip ? this.renderTip() : nothing}
84
69
  `;
85
- }
70
+ }
86
71
  }
87
- __decorate([
88
- property({ type: Boolean, reflect: true })
89
- ], Popover.prototype, "dialog", void 0);
90
- __decorate([
91
- property({ type: Boolean, reflect: true })
92
- ], Popover.prototype, "open", void 0);
93
- __decorate([
94
- property({ reflect: true })
95
- ], Popover.prototype, "placement", void 0);
96
- __decorate([
97
- property({ type: Boolean, reflect: true })
98
- ], Popover.prototype, "tip", void 0);
99
- //# sourceMappingURL=Popover.js.map
72
+ __decorateClass([
73
+ property({ type: Boolean, reflect: true })
74
+ ], Popover.prototype, "dialog", 2);
75
+ __decorateClass([
76
+ property({ type: Boolean, reflect: true })
77
+ ], Popover.prototype, "open", 2);
78
+ __decorateClass([
79
+ property({ reflect: true })
80
+ ], Popover.prototype, "placement", 2);
81
+ __decorateClass([
82
+ property({ type: Boolean, reflect: true })
83
+ ], Popover.prototype, "tip", 2);
84
+ //# sourceMappingURL=Popover.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["Popover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,OAAO,EACP,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAK3E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,OAAO,OAAQ,SAAQ,eAAe;IAA5C;;QAKI;;;WAGG;QAEI,WAAM,GAAG,KAAK,CAAC;QAEtB;;WAEG;QAEI,SAAI,GAAG,KAAK,CAAC;QAEpB;;;WAGG;QAEI,cAAS,GAAc,MAAM,CAAC;QAG9B,QAAG,GAAG,KAAK,CAAC;IAuDvB,CAAC;IAhFU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3B,CAAC;IAyBS,SAAS;QACf,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;IACN,CAAC;IAEe,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CACjB,kBAAkB,EAClB,IAAI,CAAC,cAA+B,CACvC,CAAC;IACN,CAAC;IAEe,oBAAoB;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CACpB,kBAAkB,EAClB,IAAI,CAAC,cAA+B,CACvC,CAAC;IACN,CAAC;IAEM,cAAc,CAAC,KAA6C;QAC/D,oBAAoB;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO;QAE1B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAc,CAAC;QACpC,oBAAoB;QACpB,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO;QAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAgB,CAAC;QACxE,IAAI,UAAU,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,wBAAwB,GAAG,UAAU,CAAC;SACtD;IACL,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;cAEL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO;SAC1C,CAAC;IACN,CAAC;CACJ;AAvEG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACrB;AAMtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACvB;AAOpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACS;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oCACxB","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 {\n CSSResultArray,\n html,\n nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay/src/overlay-types.js';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["Popover.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 {\n CSSResultArray,\n html,\n nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay/src/overlay-types.js';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAOA;AAKA;AAOO,aAAM,gBAAgB,gBAAgB;AAAA,EAAtC;AAAA;AAUI,kBAAS;AAMT,gBAAO;AAOP,qBAAuB;AAGvB,eAAM;AAAA;AAAA,aAzBc,SAAyB;AAChD,WAAO,CAAC,aAAa;AAAA,EACzB;AAAA,EAyBU,YAA4B;AAClC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX;AAAA,EAEgB,oBAA0B;AACtC,UAAM,kBAAkB;AACxB,SAAK,iBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,SAAK,oBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEO,eAAe,OAAqD;AAEvE,QAAI,CAAC,MAAM;AAAQ;AAEnB,UAAM,SAAS,MAAM;AAErB,QAAI,WAAW;AAAM;AAErB,UAAM,aAAa,KAAK,WAAW,cAAc,MAAM;AACvD,QAAI,YAAY;AACZ,YAAM,OAAO,2BAA2B;AAAA,IAC5C;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,cAED,KAAK,MAAM,KAAK,UAAU,IAAI;AAAA;AAAA,EAExC;AACJ;AAvEW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAVJ,QAUI;AAMA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAhBJ,QAgBI;AAOA;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAvBJ,QAuBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA1BJ,QA0BI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Popover.dev.js";
2
+ //# 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 './Popover.dev.js'\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,13 +1,2 @@
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 './Popover.js';
13
- //# sourceMappingURL=index.js.map
1
+ export * from "./Popover.js";
2
+ //# 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","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 './Popover.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 './Popover.js';\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{--spectrum-overlay-animation-distance:var(
4
+ --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
5
+ );opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
6
+ --spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
7
+ );border-style:solid;border-width:var(
8
+ --spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
9
+ );box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
10
+ --spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
11
+ );min-width:var(
12
+ --spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
13
+ );outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
14
+ --spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
15
+ )}:host([dialog]){min-width:var(
16
+ --spectrum-popover-dialog-min-width
17
+ );padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
18
+ --spectrum-popover-target-offset
19
+ )}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
20
+ --spectrum-popover-target-offset
21
+ )}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(
22
+ --spectrum-popover-target-offset
23
+ )}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
24
+ --spectrum-popover-target-offset
25
+ )}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(
26
+ --spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
27
+ );border-color:var(
28
+ --spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
29
+ );clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
30
+ --spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
31
+ ));-webkit-filter:drop-shadow(0 1px 4px var(
32
+ --spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
33
+ ));will-change:filter}#tip .triangle{fill:var(
34
+ --spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
35
+ );stroke:var(
36
+ --spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
37
+ )}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
38
+ `;
39
+ export default styles;
40
+ //# sourceMappingURL=popover.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["popover.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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,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
  :host{--spectrum-overlay-animation-distance:var(
15
4
  --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
16
5
  );opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
@@ -48,4 +37,4 @@ const styles = css `
48
37
  )}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
49
38
  `;
50
39
  export default styles;
51
- //# sourceMappingURL=popover.css.js.map
40
+ //# sourceMappingURL=popover.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"popover.css.js","sourceRoot":"","sources":["popover.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCjB,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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["popover.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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{--spectrum-overlay-animation-distance:var(
4
+ --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
5
+ );opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
6
+ --spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
7
+ );border-style:solid;border-width:var(
8
+ --spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
9
+ );box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
10
+ --spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
11
+ );min-width:var(
12
+ --spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
13
+ );outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
14
+ --spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
15
+ )}:host([dialog]){min-width:var(
16
+ --spectrum-popover-dialog-min-width
17
+ );padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
18
+ --spectrum-popover-target-offset
19
+ )}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
20
+ --spectrum-popover-target-offset
21
+ )}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(
22
+ --spectrum-popover-target-offset
23
+ )}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
24
+ --spectrum-popover-target-offset
25
+ )}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(
26
+ --spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
27
+ );border-color:var(
28
+ --spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
29
+ );clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
30
+ --spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
31
+ ));-webkit-filter:drop-shadow(0 1px 4px var(
32
+ --spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
33
+ ));will-change:filter}#tip .triangle{fill:var(
34
+ --spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
35
+ );stroke:var(
36
+ --spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
37
+ )}
38
+ `;
39
+ export default styles;
40
+ //# sourceMappingURL=spectrum-popover.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-popover.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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,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
  :host{--spectrum-overlay-animation-distance:var(
15
4
  --spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
16
5
  );opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
@@ -48,4 +37,4 @@ const styles = css `
48
37
  )}
49
38
  `;
50
39
  export default styles;
51
- //# sourceMappingURL=spectrum-popover.css.js.map
40
+ //# sourceMappingURL=spectrum-popover.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"spectrum-popover.css.js","sourceRoot":"","sources":["spectrum-popover.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCjB,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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-popover.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:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,58 +1,48 @@
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 '../sp-popover.js';
12
- import { html } from '@spectrum-web-components/base';
1
+ import "@spectrum-web-components/popover/sp-popover.js";
2
+ import { html } from "@spectrum-web-components/base";
13
3
  export default {
14
- component: 'sp-popover',
15
- title: 'Popover',
16
- argTypes: {
17
- open: {
18
- name: 'open',
19
- type: { name: 'boolean', required: false },
20
- description: 'Whether the popover is open or not.',
21
- table: {
22
- type: { summary: 'boolean' },
23
- defaultValue: { summary: false },
24
- },
25
- control: 'boolean',
26
- },
27
- placement: {
28
- name: 'placement',
29
- type: { name: 'string', required: false },
30
- description: 'The placement of the popover content in relation to the tip',
31
- table: {
32
- type: { summary: 'string' },
33
- defaultValue: { summary: 'none' },
34
- },
35
- control: 'text',
36
- },
37
- tip: {
38
- name: 'tip',
39
- description: 'Whether the popover has a tip.',
40
- type: { name: 'boolean', required: false },
41
- table: {
42
- type: { summary: 'boolean' },
43
- defaultValue: { summary: false },
44
- },
45
- control: 'boolean',
46
- },
4
+ component: "sp-popover",
5
+ title: "Popover",
6
+ argTypes: {
7
+ open: {
8
+ name: "open",
9
+ type: { name: "boolean", required: false },
10
+ description: "Whether the popover is open or not.",
11
+ table: {
12
+ type: { summary: "boolean" },
13
+ defaultValue: { summary: false }
14
+ },
15
+ control: "boolean"
47
16
  },
48
- args: {
49
- open: true,
50
- placement: 'none',
51
- tip: false,
17
+ placement: {
18
+ name: "placement",
19
+ type: { name: "string", required: false },
20
+ description: "The placement of the popover content in relation to the tip",
21
+ table: {
22
+ type: { summary: "string" },
23
+ defaultValue: { summary: "none" }
24
+ },
25
+ control: "text"
52
26
  },
27
+ tip: {
28
+ name: "tip",
29
+ description: "Whether the popover has a tip.",
30
+ type: { name: "boolean", required: false },
31
+ table: {
32
+ type: { summary: "boolean" },
33
+ defaultValue: { summary: false }
34
+ },
35
+ control: "boolean"
36
+ }
37
+ },
38
+ args: {
39
+ open: true,
40
+ placement: "none",
41
+ tip: false
42
+ }
53
43
  };
54
44
  export const Default = ({ content }) => {
55
- return html `
45
+ return html`
56
46
  <div style="color: var(--spectrum-global-color-gray-800)">
57
47
  <sp-popover variant="default" open style="max-width: 320px">
58
48
  <div style="font-size: 14px; padding: 10px">${content}</div>
@@ -61,21 +51,21 @@ export const Default = ({ content }) => {
61
51
  `;
62
52
  };
63
53
  Default.args = {
64
- content: 'The quick brown fox jumps over the lazy dog',
54
+ content: "The quick brown fox jumps over the lazy dog"
65
55
  };
66
56
  Default.argTypes = {
67
- content: {
68
- name: 'content',
69
- type: { name: 'string', required: false },
70
- table: {
71
- type: { summary: 'string' },
72
- defaultValue: { summary: '' },
73
- },
74
- control: 'text',
57
+ content: {
58
+ name: "content",
59
+ type: { name: "string", required: false },
60
+ table: {
61
+ type: { summary: "string" },
62
+ defaultValue: { summary: "" }
75
63
  },
64
+ control: "text"
65
+ }
76
66
  };
77
67
  const Template = ({ tip, placement, open }) => {
78
- return html `
68
+ return html`
79
69
  <div
80
70
  style="color: var(--spectrum-global-color-gray-800); position: relative; display: contents"
81
71
  >
@@ -103,22 +93,22 @@ const Template = ({ tip, placement, open }) => {
103
93
  };
104
94
  export const dialogTop = (args) => Template(args);
105
95
  dialogTop.args = {
106
- tip: true,
107
- placement: 'top',
96
+ tip: true,
97
+ placement: "top"
108
98
  };
109
99
  export const dialogRight = (args) => Template(args);
110
100
  dialogRight.args = {
111
- tip: true,
112
- placement: 'right',
101
+ tip: true,
102
+ placement: "right"
113
103
  };
114
104
  export const dialogBottom = (args) => Template(args);
115
105
  dialogBottom.args = {
116
- tip: true,
117
- placement: 'bottom',
106
+ tip: true,
107
+ placement: "bottom"
118
108
  };
119
109
  export const dialogLeft = (args) => Template(args);
120
110
  dialogLeft.args = {
121
- tip: true,
122
- placement: 'left',
111
+ tip: true,
112
+ placement: "left"
123
113
  };
124
- //# sourceMappingURL=popover.stories.js.map
114
+ //# sourceMappingURL=popover.stories.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"popover.stories.js","sourceRoot":"","sources":["popover.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;EASE;AACF,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAGrE,eAAe;IACX,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EAAE,qCAAqC;YAClD,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE,SAAS;SACrB;QACD,SAAS,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACzC,WAAW,EACP,6DAA6D;YACjE,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;gBAC3B,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aACpC;YACD,OAAO,EAAE,MAAM;SAClB;QACD,GAAG,EAAE;YACD,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE,SAAS;SACrB;KACJ;IACD,IAAI,EAAE;QACF,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,MAAM;QACjB,GAAG,EAAE,KAAK;KACb;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAuB,EAAkB,EAAE;IACxE,OAAO,IAAI,CAAA;;;8DAG+C,OAAO;;;KAGhE,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,GAAG;IACX,OAAO,EAAE,6CAA6C;CACzD,CAAC;AACF,OAAO,CAAC,QAAQ,GAAG;IACf,OAAO,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;QACzC,KAAK,EAAE;YACH,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;YAC3B,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;SAChC;QACD,OAAO,EAAE,MAAM;KAClB;CACJ,CAAC;AAQF,MAAM,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAa,EAAkB,EAAE;IACrE,OAAO,IAAI,CAAA;;;;;;4BAMa,SAAS;wBACb,IAAI;;wBAEJ,GAAG;;;;;;;;;;;;;;;KAetB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAe,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7E,SAAS,CAAC,IAAI,GAAG;IACb,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,KAAK;CACnB,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAe,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/E,WAAW,CAAC,IAAI,GAAG;IACf,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,OAAO;CACrB,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAe,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChF,YAAY,CAAC,IAAI,GAAG;IAChB,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,QAAQ;CACtB,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAe,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9E,UAAU,CAAC,IAAI,GAAG;IACd,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,MAAM;CACpB,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\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 '../sp-popover.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Placement } from '@spectrum-web-components/overlay';\n\nexport default {\n component: 'sp-popover',\n title: 'Popover',\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the popover is open or not.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n placement: {\n name: 'placement',\n type: { name: 'string', required: false },\n description:\n 'The placement of the popover content in relation to the tip',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'none' },\n },\n control: 'text',\n },\n tip: {\n name: 'tip',\n description: 'Whether the popover has a tip.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n },\n args: {\n open: true,\n placement: 'none',\n tip: false,\n },\n};\n\nexport const Default = ({ content }: { content: string }): TemplateResult => {\n return html`\n <div style=\"color: var(--spectrum-global-color-gray-800)\">\n <sp-popover variant=\"default\" open style=\"max-width: 320px\">\n <div style=\"font-size: 14px; padding: 10px\">${content}</div>\n </sp-popover>\n </div>\n `;\n};\nDefault.args = {\n content: 'The quick brown fox jumps over the lazy dog',\n};\nDefault.argTypes = {\n content: {\n name: 'content',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n};\n\ninterface StoryArgs {\n tip?: boolean;\n placement: Placement;\n open?: boolean;\n}\n\nconst Template = ({ tip, placement, open }: StoryArgs): TemplateResult => {\n return html`\n <div\n style=\"color: var(--spectrum-global-color-gray-800); position: relative; display: contents\"\n >\n <sp-popover\n variant=\"dialog\"\n placement=${placement}\n ?open=${open}\n style=\" max-width: 320px\"\n .tip=\"${tip}\"\n >\n <div\n style=\"padding-bottom: 30px; font-size: 18px; font-weight: 700\"\n >\n Popover Title\n </div>\n <div style=\"font-size: 14px\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly\n caramels. Icing soufflé chupa chups donut cheesecake.\n Jelly-o chocolate cake sweet roll cake danish candy biscuit\n halvah\n </div>\n </sp-popover>\n </div>\n `;\n};\n\nexport const dialogTop = (args: StoryArgs): TemplateResult => Template(args);\ndialogTop.args = {\n tip: true,\n placement: 'top',\n};\nexport const dialogRight = (args: StoryArgs): TemplateResult => Template(args);\ndialogRight.args = {\n tip: true,\n placement: 'right',\n};\nexport const dialogBottom = (args: StoryArgs): TemplateResult => Template(args);\ndialogBottom.args = {\n tip: true,\n placement: 'bottom',\n};\nexport const dialogLeft = (args: StoryArgs): TemplateResult => Template(args);\ndialogLeft.args = {\n tip: true,\n placement: 'left',\n};\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["popover.stories.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*/\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Placement } from '@spectrum-web-components/overlay';\n\nexport default {\n component: 'sp-popover',\n title: 'Popover',\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the popover is open or not.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n placement: {\n name: 'placement',\n type: { name: 'string', required: false },\n description:\n 'The placement of the popover content in relation to the tip',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'none' },\n },\n control: 'text',\n },\n tip: {\n name: 'tip',\n description: 'Whether the popover has a tip.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n },\n args: {\n open: true,\n placement: 'none',\n tip: false,\n },\n};\n\nexport const Default = ({ content }: { content: string }): TemplateResult => {\n return html`\n <div style=\"color: var(--spectrum-global-color-gray-800)\">\n <sp-popover variant=\"default\" open style=\"max-width: 320px\">\n <div style=\"font-size: 14px; padding: 10px\">${content}</div>\n </sp-popover>\n </div>\n `;\n};\nDefault.args = {\n content: 'The quick brown fox jumps over the lazy dog',\n};\nDefault.argTypes = {\n content: {\n name: 'content',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n};\n\ninterface StoryArgs {\n tip?: boolean;\n placement: Placement;\n open?: boolean;\n}\n\nconst Template = ({ tip, placement, open }: StoryArgs): TemplateResult => {\n return html`\n <div\n style=\"color: var(--spectrum-global-color-gray-800); position: relative; display: contents\"\n >\n <sp-popover\n variant=\"dialog\"\n placement=${placement}\n ?open=${open}\n style=\" max-width: 320px\"\n .tip=\"${tip}\"\n >\n <div\n style=\"padding-bottom: 30px; font-size: 18px; font-weight: 700\"\n >\n Popover Title\n </div>\n <div style=\"font-size: 14px\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly\n caramels. Icing souffl\u00E9 chupa chups donut cheesecake.\n Jelly-o chocolate cake sweet roll cake danish candy biscuit\n halvah\n </div>\n </sp-popover>\n </div>\n `;\n};\n\nexport const dialogTop = (args: StoryArgs): TemplateResult => Template(args);\ndialogTop.args = {\n tip: true,\n placement: 'top',\n};\nexport const dialogRight = (args: StoryArgs): TemplateResult => Template(args);\ndialogRight.args = {\n tip: true,\n placement: 'right',\n};\nexport const dialogBottom = (args: StoryArgs): TemplateResult => Template(args);\ndialogBottom.args = {\n tip: true,\n placement: 'bottom',\n};\nexport const dialogLeft = (args: StoryArgs): TemplateResult => Template(args);\ndialogLeft.args = {\n tip: true,\n placement: 'left',\n};\n"],
5
+ "mappings": "AAUA;AACA;AAGA,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,IACN,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,aAAa;AAAA,MACb,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,IACA,WAAW;AAAA,MACP,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,aACI;AAAA,MACJ,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,OAAO;AAAA,MACpC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,IACA,KAAK;AAAA,MACD,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACF,MAAM;AAAA,IACN,WAAW;AAAA,IACX,KAAK;AAAA,EACT;AACJ;AAEO,aAAM,UAAU,CAAC,EAAE,cAAmD;AACzE,SAAO;AAAA;AAAA;AAAA,8DAGmD;AAAA;AAAA;AAAA;AAI9D;AACA,QAAQ,OAAO;AAAA,EACX,SAAS;AACb;AACA,QAAQ,WAAW;AAAA,EACf,SAAS;AAAA,IACL,MAAM;AAAA,IACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,IACxC,OAAO;AAAA,MACH,MAAM,EAAE,SAAS,SAAS;AAAA,MAC1B,cAAc,EAAE,SAAS,GAAG;AAAA,IAChC;AAAA,IACA,SAAS;AAAA,EACb;AACJ;AAQA,MAAM,WAAW,CAAC,EAAE,KAAK,WAAW,WAAsC;AACtE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMiB;AAAA,wBACJ;AAAA;AAAA,wBAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBxB;AAEO,aAAM,YAAY,CAAC,SAAoC,SAAS,IAAI;AAC3E,UAAU,OAAO;AAAA,EACb,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,cAAc,CAAC,SAAoC,SAAS,IAAI;AAC7E,YAAY,OAAO;AAAA,EACf,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,eAAe,CAAC,SAAoC,SAAS,IAAI;AAC9E,aAAa,OAAO;AAAA,EAChB,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,aAAa,CAAC,SAAoC,SAAS,IAAI;AAC5E,WAAW,OAAO;AAAA,EACd,KAAK;AAAA,EACL,WAAW;AACf;",
6
+ "names": []
7
+ }
@@ -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
- import '@spectrum-web-components/popover/sp-popover.js';
13
- import { html } from 'lit';
14
- import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
15
- measureFixtureCreation(html `
1
+ import "@spectrum-web-components/popover/sp-popover.js";
2
+ import { html } from "lit";
3
+ import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
4
+ measureFixtureCreation(html`
16
5
  <sp-popover variant="dialog" direction="top" open>
17
6
  <div id="title">Popover Title</div>
18
7
  <div id="content">
@@ -22,4 +11,4 @@ measureFixtureCreation(html `
22
11
  </div>
23
12
  </sp-popover>
24
13
  `);
25
- //# sourceMappingURL=test-basic.js.map
14
+ //# sourceMappingURL=test-basic.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"test-basic.js","sourceRoot":"","sources":["test-basic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,gDAAgD,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;;;;;;;;CAS1B,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 '@spectrum-web-components/popover/sp-popover.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-popover variant=\"dialog\" direction=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.\n Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake\n sweet roll cake danish candy biscuit halvah\n </div>\n </sp-popover>\n`);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["test-basic.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 '@spectrum-web-components/popover/sp-popover.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-popover variant=\"dialog\" direction=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.\n Icing souffl\u00E9 chupa chups donut cheesecake. Jelly-o chocolate cake\n sweet roll cake danish candy biscuit halvah\n </div>\n </sp-popover>\n`);\n"],
5
+ "mappings": "AAYA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAStB;",
6
+ "names": []
7
+ }
@@ -1,15 +1,4 @@
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
- import * as stories from '../stories/popover.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('PopoverStories', stories);
15
- //# sourceMappingURL=popover.test-vrt.js.map
1
+ import * as stories from "../stories/popover.stories.js";
2
+ import { regressVisuals } from "../../../test/visual/test.js";
3
+ regressVisuals("PopoverStories", stories);
4
+ //# sourceMappingURL=popover.test-vrt.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"popover.test-vrt.js","sourceRoot":"","sources":["popover.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,gBAAgB,EAAE,OAAO,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 * as stories from '../stories/popover.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('PopoverStories', stories);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["popover.test-vrt.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 * as stories from '../stories/popover.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('PopoverStories', stories);\n"],
5
+ "mappings": "AAYA;AACA;AAEA,eAAe,kBAAkB,OAAO;",
6
+ "names": []
7
+ }
@@ -1,20 +1,9 @@
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
- import '../sp-popover.js';
13
- import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
14
- describe('popover', () => {
15
- let popover;
16
- beforeEach(async () => {
17
- popover = await fixture(html `
1
+ import "@spectrum-web-components/popover/sp-popover.js";
2
+ import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
3
+ describe("popover", () => {
4
+ let popover;
5
+ beforeEach(async () => {
6
+ popover = await fixture(html`
18
7
  <sp-popover variant="dialog" placement="top" open>
19
8
  <div id="title">Popover Title</div>
20
9
  <div id="content">
@@ -25,25 +14,25 @@ describe('popover', () => {
25
14
  </div>
26
15
  </sp-popover>
27
16
  `);
28
- await elementUpdated(popover);
29
- });
30
- it('loads', async () => {
31
- expect(popover).to.not.equal(undefined);
32
- expect(popover.textContent).to.include('Popover Title');
33
- await expect(popover).to.be.accessible();
34
- });
35
- it('tip exists only when tip attribute is true', async () => {
36
- if (!popover.shadowRoot)
37
- throw new Error('No shadowRoot');
38
- expect(popover.getAttribute('tip')).to.equal(null);
39
- let tip = popover.shadowRoot.querySelector('tip');
40
- expect(tip).to.equal(null);
41
- popover.setAttribute('tip', 'true');
42
- tip = popover.shadowRoot.querySelector('tip');
43
- expect(tip).to.not.equal(undefined);
44
- });
45
- it('answers tip query', async () => {
46
- const el = await fixture(html `
17
+ await elementUpdated(popover);
18
+ });
19
+ it("loads", async () => {
20
+ expect(popover).to.not.equal(void 0);
21
+ expect(popover.textContent).to.include("Popover Title");
22
+ await expect(popover).to.be.accessible();
23
+ });
24
+ it("tip exists only when tip attribute is true", async () => {
25
+ if (!popover.shadowRoot)
26
+ throw new Error("No shadowRoot");
27
+ expect(popover.getAttribute("tip")).to.equal(null);
28
+ let tip = popover.shadowRoot.querySelector("tip");
29
+ expect(tip).to.equal(null);
30
+ popover.setAttribute("tip", "true");
31
+ tip = popover.shadowRoot.querySelector("tip");
32
+ expect(tip).to.not.equal(void 0);
33
+ });
34
+ it("answers tip query", async () => {
35
+ const el = await fixture(html`
47
36
  <sp-popover variant="dialog" placement="top" tip open>
48
37
  <div id="title">Popover Title</div>
49
38
  <div id="content">
@@ -54,19 +43,19 @@ describe('popover', () => {
54
43
  </div>
55
44
  </sp-popover>
56
45
  `);
57
- await elementUpdated(el);
58
- const overlayDetailQuery = {};
59
- const queryOverlayDetailEvent = new CustomEvent('sp-overlay-query', {
60
- bubbles: true,
61
- composed: true,
62
- detail: overlayDetailQuery,
63
- cancelable: true,
64
- });
65
- el.dispatchEvent(queryOverlayDetailEvent);
66
- expect(overlayDetailQuery.overlayContentTipElement).to.exist;
67
- if (overlayDetailQuery.overlayContentTipElement) {
68
- expect(overlayDetailQuery.overlayContentTipElement.id).to.equal('tip');
69
- }
46
+ await elementUpdated(el);
47
+ const overlayDetailQuery = {};
48
+ const queryOverlayDetailEvent = new CustomEvent("sp-overlay-query", {
49
+ bubbles: true,
50
+ composed: true,
51
+ detail: overlayDetailQuery,
52
+ cancelable: true
70
53
  });
54
+ el.dispatchEvent(queryOverlayDetailEvent);
55
+ expect(overlayDetailQuery.overlayContentTipElement).to.exist;
56
+ if (overlayDetailQuery.overlayContentTipElement) {
57
+ expect(overlayDetailQuery.overlayContentTipElement.id).to.equal("tip");
58
+ }
59
+ });
71
60
  });
72
- //# sourceMappingURL=popover.test.js.map
61
+ //# sourceMappingURL=popover.test.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"popover.test.js","sourceRoot":"","sources":["popover.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGzE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACrB,IAAI,OAAiB,CAAC;IAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,OAAO,GAAG,MAAM,OAAO,CACnB,IAAI,CAAA;;;;;;;;;;aAUH,CACJ,CAAC;QACF,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QACnB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAExD,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QACxD,IAAI,CAAC,OAAO,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEnD,IAAI,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAgB,CAAC;QACjE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE3B,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEpC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAgB,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;;;;;;;;;aAUH,CACJ,CAAC;QAEF,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,kBAAkB,GAA8B,EAAE,CAAC;QACzD,MAAM,uBAAuB,GACzB,IAAI,WAAW,CAA4B,kBAAkB,EAAE;YAC3D,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,kBAAkB;YAC1B,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QACP,EAAE,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;QAE1C,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC7D,IAAI,kBAAkB,CAAC,wBAAwB,EAAE;YAC7C,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAC3D,KAAK,CACR,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC,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*/\nimport '../sp-popover.js';\nimport { Popover } from '../';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport { OverlayDisplayQueryDetail } from '@spectrum-web-components/overlay';\n\ndescribe('popover', () => {\n let popover!: Popover;\n\n beforeEach(async () => {\n popover = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing soufflé chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n await elementUpdated(popover);\n });\n\n it('loads', async () => {\n expect(popover).to.not.equal(undefined);\n expect(popover.textContent).to.include('Popover Title');\n\n await expect(popover).to.be.accessible();\n });\n it('tip exists only when tip attribute is true', async () => {\n if (!popover.shadowRoot) throw new Error('No shadowRoot');\n expect(popover.getAttribute('tip')).to.equal(null);\n\n let tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.equal(null);\n\n popover.setAttribute('tip', 'true');\n\n tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.not.equal(undefined);\n });\n\n it('answers tip query', async () => {\n const el = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" tip open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing soufflé chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n\n await elementUpdated(el);\n\n const overlayDetailQuery: OverlayDisplayQueryDetail = {};\n const queryOverlayDetailEvent =\n new CustomEvent<OverlayDisplayQueryDetail>('sp-overlay-query', {\n bubbles: true,\n composed: true,\n detail: overlayDetailQuery,\n cancelable: true,\n });\n el.dispatchEvent(queryOverlayDetailEvent);\n\n expect(overlayDetailQuery.overlayContentTipElement).to.exist;\n if (overlayDetailQuery.overlayContentTipElement) {\n expect(overlayDetailQuery.overlayContentTipElement.id).to.equal(\n 'tip'\n );\n }\n });\n});\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["popover.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 '@spectrum-web-components/popover/sp-popover.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport { OverlayDisplayQueryDetail } from '@spectrum-web-components/overlay';\n\ndescribe('popover', () => {\n let popover!: Popover;\n\n beforeEach(async () => {\n popover = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing souffl\u00E9 chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n await elementUpdated(popover);\n });\n\n it('loads', async () => {\n expect(popover).to.not.equal(undefined);\n expect(popover.textContent).to.include('Popover Title');\n\n await expect(popover).to.be.accessible();\n });\n it('tip exists only when tip attribute is true', async () => {\n if (!popover.shadowRoot) throw new Error('No shadowRoot');\n expect(popover.getAttribute('tip')).to.equal(null);\n\n let tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.equal(null);\n\n popover.setAttribute('tip', 'true');\n\n tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.not.equal(undefined);\n });\n\n it('answers tip query', async () => {\n const el = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" tip open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing souffl\u00E9 chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n\n await elementUpdated(el);\n\n const overlayDetailQuery: OverlayDisplayQueryDetail = {};\n const queryOverlayDetailEvent =\n new CustomEvent<OverlayDisplayQueryDetail>('sp-overlay-query', {\n bubbles: true,\n composed: true,\n detail: overlayDetailQuery,\n cancelable: true,\n });\n el.dispatchEvent(queryOverlayDetailEvent);\n\n expect(overlayDetailQuery.overlayContentTipElement).to.exist;\n if (overlayDetailQuery.overlayContentTipElement) {\n expect(overlayDetailQuery.overlayContentTipElement.id).to.equal(\n 'tip'\n );\n }\n });\n});\n"],
5
+ "mappings": "AAWA;AAEA;AAGA,SAAS,WAAW,MAAM;AACtB,MAAI;AAEJ,aAAW,YAAY;AACnB,cAAU,MAAM,QACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWJ;AACA,UAAM,eAAe,OAAO;AAAA,EAChC,CAAC;AAED,KAAG,SAAS,YAAY;AACpB,WAAO,OAAO,EAAE,GAAG,IAAI,MAAM,MAAS;AACtC,WAAO,QAAQ,WAAW,EAAE,GAAG,QAAQ,eAAe;AAEtD,UAAM,OAAO,OAAO,EAAE,GAAG,GAAG,WAAW;AAAA,EAC3C,CAAC;AACD,KAAG,8CAA8C,YAAY;AACzD,QAAI,CAAC,QAAQ;AAAY,YAAM,IAAI,MAAM,eAAe;AACxD,WAAO,QAAQ,aAAa,KAAK,CAAC,EAAE,GAAG,MAAM,IAAI;AAEjD,QAAI,MAAM,QAAQ,WAAW,cAAc,KAAK;AAChD,WAAO,GAAG,EAAE,GAAG,MAAM,IAAI;AAEzB,YAAQ,aAAa,OAAO,MAAM;AAElC,UAAM,QAAQ,WAAW,cAAc,KAAK;AAC5C,WAAO,GAAG,EAAE,GAAG,IAAI,MAAM,MAAS;AAAA,EACtC,CAAC;AAED,KAAG,qBAAqB,YAAY;AAChC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWJ;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,qBAAgD,CAAC;AACvD,UAAM,0BACF,IAAI,YAAuC,oBAAoB;AAAA,MAC3D,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAY;AAAA,IAChB,CAAC;AACL,OAAG,cAAc,uBAAuB;AAExC,WAAO,mBAAmB,wBAAwB,EAAE,GAAG;AACvD,QAAI,mBAAmB,0BAA0B;AAC7C,aAAO,mBAAmB,yBAAyB,EAAE,EAAE,GAAG,MACtD,KACJ;AAAA,IACJ;AAAA,EACJ,CAAC;AACL,CAAC;",
6
+ "names": []
7
+ }