@spectrum-web-components/popover 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1 -1
- package/package.json +5 -5
- package/sp-popover.d.ts +0 -6
- package/sp-popover.js +0 -14
- package/sp-popover.js.map +0 -1
- package/src/Popover.d.ts +0 -30
- package/src/Popover.js +0 -99
- package/src/Popover.js.map +0 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -13
- package/src/index.js.map +0 -1
- package/src/popover.css.d.ts +0 -2
- package/src/popover.css.js +0 -51
- package/src/popover.css.js.map +0 -1
- package/src/spectrum-popover.css.d.ts +0 -2
- package/src/spectrum-popover.css.js +0 -51
- package/src/spectrum-popover.css.js.map +0 -1
- package/stories/popover.stories.js +0 -124
- package/stories/popover.stories.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
{
|
|
186
186
|
"kind": "variable",
|
|
187
187
|
"name": "styles",
|
|
188
|
-
"default": "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);-webkit-clip-path:inset(-30px -30px);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}:host([placement*=bottom]),:host([placement*=top]){max-height:calc(100% - var(--spectrum-overlay-animation-distance))}:host([placement*=left]),:host([placement*=right]){max-width:calc(100% - var(--spectrum-overlay-animation-distance))}::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;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`"
|
|
188
|
+
"default": "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);-webkit-clip-path:inset(-30px -30px);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;min-width:min-content}:host([placement*=bottom]),:host([placement*=top]){max-height:calc(100% - var(--spectrum-overlay-animation-distance))}:host([placement*=left]),:host([placement*=right]){max-width:calc(100% - var(--spectrum-overlay-animation-distance))}::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;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`"
|
|
189
189
|
}
|
|
190
190
|
],
|
|
191
191
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/popover",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"lit-html"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/overlay": "^0.
|
|
47
|
+
"@spectrum-web-components/base": "^0.5.3",
|
|
48
|
+
"@spectrum-web-components/overlay": "^0.15.0",
|
|
49
49
|
"tslib": "^2.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@spectrum-css/popover": "^5.0.
|
|
52
|
+
"@spectrum-css/popover": "^5.0.5"
|
|
53
53
|
},
|
|
54
54
|
"types": "./src/index.d.ts",
|
|
55
55
|
"customElements": "custom-elements.json",
|
|
56
56
|
"sideEffects": [
|
|
57
57
|
"./sp-*.js"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
|
|
60
60
|
}
|
package/sp-popover.d.ts
DELETED
package/sp-popover.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
package/sp-popover.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/src/Popover.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
-
import { OverlayDisplayQueryDetail, Placement } from '@spectrum-web-components/overlay';
|
|
3
|
-
/**
|
|
4
|
-
* @element sp-popover
|
|
5
|
-
*
|
|
6
|
-
* @slot - content to display within the Popover
|
|
7
|
-
*/
|
|
8
|
-
export declare class Popover extends SpectrumElement {
|
|
9
|
-
static get styles(): CSSResultArray;
|
|
10
|
-
/**
|
|
11
|
-
* Whether the popover should manage the application
|
|
12
|
-
* of padding to its content or not.
|
|
13
|
-
*/
|
|
14
|
-
dialog: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the popover is visible or not.
|
|
17
|
-
*/
|
|
18
|
-
open: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* @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"}
|
|
21
|
-
* @attr
|
|
22
|
-
*/
|
|
23
|
-
placement: Placement;
|
|
24
|
-
tip: boolean;
|
|
25
|
-
protected renderTip(): TemplateResult;
|
|
26
|
-
connectedCallback(): void;
|
|
27
|
-
disconnectedCallback(): void;
|
|
28
|
-
onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void;
|
|
29
|
-
protected render(): TemplateResult;
|
|
30
|
-
}
|
package/src/Popover.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
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
|
-
*/
|
|
21
|
-
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 `
|
|
45
|
-
<div id="tip">
|
|
46
|
-
<svg
|
|
47
|
-
xmlns="http://www.w3.org/svg/2000"
|
|
48
|
-
class="tip"
|
|
49
|
-
viewBox="0 0 24 12"
|
|
50
|
-
>
|
|
51
|
-
<path
|
|
52
|
-
class="triangle"
|
|
53
|
-
d="M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0"
|
|
54
|
-
></path>
|
|
55
|
-
</svg>
|
|
56
|
-
</div>
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
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 `
|
|
82
|
-
<slot></slot>
|
|
83
|
-
${this.tip ? this.renderTip() : nothing}
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
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
|
package/src/Popover.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;IAiDvB,CAAC;IA1EU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3B,CAAC;IAyBS,SAAS;QACf,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;IACN,CAAC;IAEM,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IAEM,oBAAoB;QACvB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,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;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;;cAEL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO;SAC1C,CAAC;IACN,CAAC;CACJ;AAjEG;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 {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay';\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 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 connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('sp-overlay-query', this.onOverlayQuery);\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('sp-overlay-query', this.onOverlayQuery);\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 render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"]}
|
package/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Popover.js';
|
package/src/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/src/popover.css.d.ts
DELETED
package/src/popover.css.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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 { css } from '@spectrum-web-components/base';
|
|
13
|
-
const styles = css `
|
|
14
|
-
:host{--spectrum-overlay-animation-distance:var(
|
|
15
|
-
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
16
|
-
);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(
|
|
17
|
-
--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
|
|
18
|
-
);border-style:solid;border-width:var(
|
|
19
|
-
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
20
|
-
);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
|
|
21
|
-
--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
|
|
22
|
-
);min-width:var(
|
|
23
|
-
--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
|
|
24
|
-
);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
|
|
25
|
-
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
26
|
-
)}:host([dialog]){min-width:var(
|
|
27
|
-
--spectrum-popover-dialog-min-width
|
|
28
|
-
);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
|
|
29
|
-
--spectrum-popover-target-offset
|
|
30
|
-
)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
|
|
31
|
-
--spectrum-popover-target-offset
|
|
32
|
-
)}: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(
|
|
33
|
-
--spectrum-popover-target-offset
|
|
34
|
-
)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
|
|
35
|
-
--spectrum-popover-target-offset
|
|
36
|
-
)}: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(
|
|
37
|
-
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
38
|
-
);border-color:var(
|
|
39
|
-
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
40
|
-
);-webkit-clip-path:inset(-30px -30px);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
|
|
41
|
-
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
42
|
-
));-webkit-filter:drop-shadow(0 1px 4px var(
|
|
43
|
-
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
44
|
-
));will-change:filter}#tip .triangle{fill:var(
|
|
45
|
-
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
46
|
-
);stroke:var(
|
|
47
|
-
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
48
|
-
)}:host{--sp-popover-tip-size:24px}:host([placement*=bottom]),:host([placement*=top]){max-height:calc(100% - var(--spectrum-overlay-animation-distance))}:host([placement*=left]),:host([placement*=right]){max-width:calc(100% - var(--spectrum-overlay-animation-distance))}::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;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
|
|
49
|
-
`;
|
|
50
|
-
export default styles;
|
|
51
|
-
//# sourceMappingURL=popover.css.js.map
|
package/src/popover.css.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 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 { 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);-webkit-clip-path:inset(-30px -30px);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}:host([placement*=bottom]),:host([placement*=top]){max-height:calc(100% - var(--spectrum-overlay-animation-distance))}:host([placement*=left]),:host([placement*=right]){max-width:calc(100% - var(--spectrum-overlay-animation-distance))}::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;-webkit-clip-path:inset(50%);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,51 +0,0 @@
|
|
|
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 { css } from '@spectrum-web-components/base';
|
|
13
|
-
const styles = css `
|
|
14
|
-
:host{--spectrum-overlay-animation-distance:var(
|
|
15
|
-
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
16
|
-
);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(
|
|
17
|
-
--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
|
|
18
|
-
);border-style:solid;border-width:var(
|
|
19
|
-
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
20
|
-
);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
|
|
21
|
-
--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
|
|
22
|
-
);min-width:var(
|
|
23
|
-
--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
|
|
24
|
-
);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
|
|
25
|
-
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
26
|
-
)}:host([dialog]){min-width:var(
|
|
27
|
-
--spectrum-popover-dialog-min-width
|
|
28
|
-
);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
|
|
29
|
-
--spectrum-popover-target-offset
|
|
30
|
-
)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
|
|
31
|
-
--spectrum-popover-target-offset
|
|
32
|
-
)}: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(
|
|
33
|
-
--spectrum-popover-target-offset
|
|
34
|
-
)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
|
|
35
|
-
--spectrum-popover-target-offset
|
|
36
|
-
)}: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(
|
|
37
|
-
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
38
|
-
);border-color:var(
|
|
39
|
-
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
40
|
-
);-webkit-clip-path:inset(-30px -30px);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
|
|
41
|
-
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
42
|
-
));-webkit-filter:drop-shadow(0 1px 4px var(
|
|
43
|
-
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
44
|
-
));will-change:filter}#tip .triangle{fill:var(
|
|
45
|
-
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
46
|
-
);stroke:var(
|
|
47
|
-
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
48
|
-
)}
|
|
49
|
-
`;
|
|
50
|
-
export default styles;
|
|
51
|
-
//# sourceMappingURL=spectrum-popover.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 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 { 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);-webkit-clip-path:inset(-30px -30px);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,124 +0,0 @@
|
|
|
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';
|
|
13
|
-
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
|
-
},
|
|
47
|
-
},
|
|
48
|
-
args: {
|
|
49
|
-
open: true,
|
|
50
|
-
placement: 'none',
|
|
51
|
-
tip: false,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const Default = ({ content }) => {
|
|
55
|
-
return html `
|
|
56
|
-
<div style="color: var(--spectrum-global-color-gray-800)">
|
|
57
|
-
<sp-popover variant="default" open style="max-width: 320px">
|
|
58
|
-
<div style="font-size: 14px; padding: 10px">${content}</div>
|
|
59
|
-
</sp-popover>
|
|
60
|
-
</div>
|
|
61
|
-
`;
|
|
62
|
-
};
|
|
63
|
-
Default.args = {
|
|
64
|
-
content: 'The quick brown fox jumps over the lazy dog',
|
|
65
|
-
};
|
|
66
|
-
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',
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const Template = ({ tip, placement, open }) => {
|
|
78
|
-
return html `
|
|
79
|
-
<div
|
|
80
|
-
style="color: var(--spectrum-global-color-gray-800); position: relative; display: contents"
|
|
81
|
-
>
|
|
82
|
-
<sp-popover
|
|
83
|
-
variant="dialog"
|
|
84
|
-
placement=${placement}
|
|
85
|
-
?open=${open}
|
|
86
|
-
style=" max-width: 320px"
|
|
87
|
-
.tip="${tip}"
|
|
88
|
-
>
|
|
89
|
-
<div
|
|
90
|
-
style="padding-bottom: 30px; font-size: 18px; font-weight: 700"
|
|
91
|
-
>
|
|
92
|
-
Popover Title
|
|
93
|
-
</div>
|
|
94
|
-
<div style="font-size: 14px">
|
|
95
|
-
Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly
|
|
96
|
-
caramels. Icing soufflé chupa chups donut cheesecake.
|
|
97
|
-
Jelly-o chocolate cake sweet roll cake danish candy biscuit
|
|
98
|
-
halvah
|
|
99
|
-
</div>
|
|
100
|
-
</sp-popover>
|
|
101
|
-
</div>
|
|
102
|
-
`;
|
|
103
|
-
};
|
|
104
|
-
export const dialogTop = (args) => Template(args);
|
|
105
|
-
dialogTop.args = {
|
|
106
|
-
tip: true,
|
|
107
|
-
placement: 'top',
|
|
108
|
-
};
|
|
109
|
-
export const dialogRight = (args) => Template(args);
|
|
110
|
-
dialogRight.args = {
|
|
111
|
-
tip: true,
|
|
112
|
-
placement: 'right',
|
|
113
|
-
};
|
|
114
|
-
export const dialogBottom = (args) => Template(args);
|
|
115
|
-
dialogBottom.args = {
|
|
116
|
-
tip: true,
|
|
117
|
-
placement: 'bottom',
|
|
118
|
-
};
|
|
119
|
-
export const dialogLeft = (args) => Template(args);
|
|
120
|
-
dialogLeft.args = {
|
|
121
|
-
tip: true,
|
|
122
|
-
placement: 'left',
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=popover.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|