@spectrum-web-components/toast 0.11.0 → 0.11.2
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/package.json +3 -3
- package/sp-toast.dev.js +1 -0
- package/sp-toast.dev.js.map +1 -1
- package/sp-toast.js +1 -1
- package/sp-toast.js.map +2 -2
- package/src/Toast.dev.js +8 -5
- package/src/Toast.dev.js.map +1 -1
- package/src/Toast.js +5 -5
- package/src/Toast.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-toast.css.dev.js +1 -0
- package/src/spectrum-toast.css.dev.js.map +1 -1
- package/src/spectrum-toast.css.js +1 -1
- package/src/spectrum-toast.css.js.map +2 -2
- package/src/toast.css.dev.js +1 -0
- package/src/toast.css.dev.js.map +1 -1
- package/src/toast.css.js +1 -1
- package/src/toast.css.js.map +2 -2
- package/stories/toast.stories.js +61 -5
- package/stories/toast.stories.js.map +1 -1
- package/test/benchmark/test-basic.js +5 -1
- package/test/benchmark/test-basic.js.map +1 -1
- package/test/toast.test-vrt.js +4 -1
- package/test/toast.test-vrt.js.map +1 -1
- package/test/toast.test.js +216 -18
- package/test/toast.test.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/toast",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@spectrum-web-components/base": "^0.7.0",
|
|
61
|
-
"@spectrum-web-components/button": "^0.19.
|
|
61
|
+
"@spectrum-web-components/button": "^0.19.2",
|
|
62
62
|
"@spectrum-web-components/icon": "^0.12.0",
|
|
63
63
|
"@spectrum-web-components/icons-workflow": "^0.9.0",
|
|
64
64
|
"tslib": "^2.0.0"
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"./sp-*.js",
|
|
73
73
|
"./**/*.dev.js"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "60b2d3b7d9020d72f9ae930568670321a1918e6f"
|
|
76
76
|
}
|
package/sp-toast.dev.js
CHANGED
package/sp-toast.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-toast.ts"],
|
|
4
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 { Toast } from './src/Toast.dev.js'\n\ncustomElements.define('sp-toast', Toast);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-toast': Toast;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,aAAa;AAEtB,eAAe,OAAO,YAAY,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-toast.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Toast as e}from"./src/Toast.js";customElements.define("sp-toast",e);
|
|
1
|
+
"use strict";import{Toast as e}from"./src/Toast.js";customElements.define("sp-toast",e);
|
|
2
2
|
//# sourceMappingURL=sp-toast.js.map
|
package/sp-toast.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-toast.ts"],
|
|
4
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 { Toast } from './src/Toast.js';\n\ncustomElements.define('sp-toast', Toast);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-toast': Toast;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,SAAAA,MAAa,iBAEtB,eAAe,OAAO,WAAYA,CAAK",
|
|
6
|
+
"names": ["Toast"]
|
|
7
7
|
}
|
package/src/Toast.dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -127,11 +128,13 @@ export class Toast extends SpectrumElement {
|
|
|
127
128
|
this.countdownStart = 0;
|
|
128
129
|
}
|
|
129
130
|
shouldClose() {
|
|
130
|
-
const applyDefault = this.dispatchEvent(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
const applyDefault = this.dispatchEvent(
|
|
132
|
+
new CustomEvent("close", {
|
|
133
|
+
composed: true,
|
|
134
|
+
bubbles: true,
|
|
135
|
+
cancelable: true
|
|
136
|
+
})
|
|
137
|
+
);
|
|
135
138
|
if (applyDefault) {
|
|
136
139
|
this.close();
|
|
137
140
|
}
|
package/src/Toast.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Toast.ts"],
|
|
4
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 PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js';\n\nimport toastStyles from './toast.css.js';\n\nexport const toastVariants: ToastVariants[] = [\n 'negative',\n 'positive',\n 'info',\n 'error',\n 'warning',\n];\n\nexport type ToastVariants =\n | 'negative'\n | 'positive'\n | 'info'\n | 'error'\n | 'warning'\n | '';\n\n/**\n * @element sp-toast\n *\n * @slot - The toast content\n * @slot action - button element surfacing an action in the Toast\n *\n * @fires close - Announces that the Toast has been closed by the user or by its timeout.\n */\n\nexport class Toast extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [toastStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * When a timeout is provided it represents the number of milliseconds from when\n * the Toast was placed on the page before it will automatically dismiss itself.\n * Accessibility concerns require that a Toast is available for at least 6000ms\n * before being dismissed, so any timeout of less than 6000ms will be raised to\n * that baseline. It is suggested that messages longer than 120 words should\n * receive another 1000ms in their timeout for each additional 120 words in the\n * message. E.G. 240 words = 7000ms, 360 words = 8000ms, etc.\n *\n * @param {Number} timeout\n */\n @property({ type: Number })\n public set timeout(timeout: number | null) {\n const hasTimeout = typeof timeout !== null && (timeout as number) > 0;\n const newTimeout = hasTimeout\n ? Math.max(6000, timeout as number)\n : null;\n const oldValue = this.timeout;\n if (newTimeout && this.countdownStart) {\n this.countdownStart = performance.now();\n }\n this._timeout = newTimeout;\n this.requestUpdate('timeout', oldValue);\n }\n\n public get timeout(): number | null {\n return this._timeout;\n }\n\n public _timeout: number | null = null;\n\n /**\n * The variant applies specific styling when set to `negative`, `positive`, `info`, `error`, or `warning`.\n * `variant` attribute is removed when not matching one of the above.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: ToastVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n if (toastVariants.includes(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): ToastVariants {\n return this._variant;\n }\n\n private _variant: ToastVariants = '';\n\n private renderIcon(variant: string): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=\"Information\"\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n case 'error': // deprecated\n case 'warning': // deprecated\n return html`\n <sp-icon-alert label=\"Error\" class=\"type\"></sp-icon-alert>\n `;\n case 'positive':\n case 'success': // deprecated\n return html`\n <sp-icon-checkmark-circle\n label=\"Success\"\n class=\"type\"\n ></sp-icon-checkmark-circle>\n `;\n default:\n return html``;\n }\n }\n\n private countdownStart = 0;\n private nextCount = -1;\n\n private doCountdown = (time: number): void => {\n if (!this.countdownStart) {\n this.countdownStart = performance.now();\n }\n if (time - this.countdownStart > (this._timeout as number)) {\n this.shouldClose();\n this.countdownStart = 0;\n } else {\n this.countdown();\n }\n };\n\n private countdown = (): void => {\n cancelAnimationFrame(this.nextCount);\n this.nextCount = requestAnimationFrame(this.doCountdown);\n };\n\n private holdCountdown = (): void => {\n this.stopCountdown();\n this.addEventListener('focusout', this.resumeCountdown);\n };\n\n private resumeCountdown = (): void => {\n this.removeEventListener('focusout', this.holdCountdown);\n this.countdown();\n };\n\n private startCountdown(): void {\n this.countdown();\n this.addEventListener('focusin', this.holdCountdown);\n }\n\n private stopCountdown(): void {\n cancelAnimationFrame(this.nextCount);\n this.countdownStart = 0;\n }\n\n private shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderIcon(this.variant)}\n <div class=\"body\" role=\"alert\">\n <div class=\"content\">\n <slot></slot>\n </div>\n <slot name=\"action\"></slot>\n </div>\n <div class=\"buttons\">\n <sp-close-button\n @click=${this.shouldClose}\n label=\"Close\"\n variant=\"white\"\n ></sp-close-button>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('open')) {\n if (this.open) {\n if (this.timeout) {\n this.startCountdown();\n }\n } else {\n if (this.timeout) {\n this.stopCountdown();\n }\n }\n }\n if (changes.has('timeout')) {\n if (this.timeout !== null && this.open) {\n this.startCountdown();\n } else {\n this.stopCountdown();\n }\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO,iBAAiB;AAEjB,aAAM,gBAAiC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAmBO,aAAM,cAAc,gBAAgB;AAAA,EAApC;AAAA;AAMH,SAAO,OAAO;AA+Bd,SAAO,WAA0B;AA4BjC,SAAQ,WAA0B;AA8BlC,SAAQ,iBAAiB;AACzB,SAAQ,YAAY;AAEpB,SAAQ,cAAc,CAAC,SAAuB;AAC1C,UAAI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YAAY,QAAQ,KAAK,MAAM;AACpC,aAAK,eAAe;AAAA,MACxB,OAAO;AACH,aAAK,cAAc;AAAA,MACvB;AAAA,IACJ;AAAA,EACJ;AACJ;AA1LW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GALjC,MAMF;AAcI;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAnBjB,MAoBE;AA0BA;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA7CjB,MA8CE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Toast.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=(a,i,t,o)=>{for(var e=o>1?void 0:o?p(i,t):i,n=a.length-1,u;n>=0;n--)(u=a[n])&&(e=(o?u(i,t,e):u(e))||e);return o&&e&&c(i,t,e),e};import{html as s,SpectrumElement as d}from"@spectrum-web-components/base";import{property as l}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/button/sp-close-button.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-info.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js";import h from"./toast.css.js";export const toastVariants=["negative","positive","info","error","warning"];export class Toast extends d{constructor(){super(...arguments);this.open=!1;this._timeout=null;this._variant="";this.countdownStart=0;this.nextCount=-1;this.doCountdown=t=>{this.countdownStart||(this.countdownStart=performance.now()),t-this.countdownStart>this._timeout?(this.shouldClose(),this.countdownStart=0):this.countdown()};this.countdown=()=>{cancelAnimationFrame(this.nextCount),this.nextCount=requestAnimationFrame(this.doCountdown)};this.holdCountdown=()=>{this.stopCountdown(),this.addEventListener("focusout",this.resumeCountdown)};this.resumeCountdown=()=>{this.removeEventListener("focusout",this.holdCountdown),this.countdown()}}static get styles(){return[h]}set timeout(t){const e=typeof t!==null&&t>0?Math.max(6e3,t):null,n=this.timeout;e&&this.countdownStart&&(this.countdownStart=performance.now()),this._timeout=e,this.requestUpdate("timeout",n)}get timeout(){return this._timeout}set variant(t){if(t===this.variant)return;const o=this.variant;toastVariants.includes(t)?(this.setAttribute("variant",t),this._variant=t):(this.removeAttribute("variant"),this._variant=""),this.requestUpdate("variant",o)}get variant(){return this._variant}renderIcon(t){switch(t){case"info":return s`
|
|
2
2
|
<sp-icon-info
|
|
3
3
|
label="Information"
|
|
4
4
|
class="type"
|
|
5
5
|
></sp-icon-info>
|
|
6
|
-
`;case"negative":case"error":case"warning":return
|
|
6
|
+
`;case"negative":case"error":case"warning":return s`
|
|
7
7
|
<sp-icon-alert label="Error" class="type"></sp-icon-alert>
|
|
8
|
-
`;case"positive":case"success":return
|
|
8
|
+
`;case"positive":case"success":return s`
|
|
9
9
|
<sp-icon-checkmark-circle
|
|
10
10
|
label="Success"
|
|
11
11
|
class="type"
|
|
12
12
|
></sp-icon-checkmark-circle>
|
|
13
|
-
`;default:return
|
|
13
|
+
`;default:return s``}}startCountdown(){this.countdown(),this.addEventListener("focusin",this.holdCountdown)}stopCountdown(){cancelAnimationFrame(this.nextCount),this.countdownStart=0}shouldClose(){this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0,cancelable:!0}))&&this.close()}close(){this.open=!1}render(){return s`
|
|
14
14
|
${this.renderIcon(this.variant)}
|
|
15
15
|
<div class="body" role="alert">
|
|
16
16
|
<div class="content">
|
|
@@ -25,5 +25,5 @@ var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=(r,t,i,o
|
|
|
25
25
|
variant="white"
|
|
26
26
|
></sp-close-button>
|
|
27
27
|
</div>
|
|
28
|
-
`}updated(t){super.updated(t),t.has("open")&&(this.open?this.timeout&&this.startCountdown():this.timeout&&this.stopCountdown()),t.has("timeout")&&(this.timeout!==null&&this.open?this.startCountdown():this.stopCountdown())}}
|
|
28
|
+
`}updated(t){super.updated(t),t.has("open")&&(this.open?this.timeout&&this.startCountdown():this.timeout&&this.stopCountdown()),t.has("timeout")&&(this.timeout!==null&&this.open?this.startCountdown():this.stopCountdown())}}r([l({type:Boolean,reflect:!0})],Toast.prototype,"open",2),r([l({type:Number})],Toast.prototype,"timeout",1),r([l({type:String})],Toast.prototype,"variant",1);
|
|
29
29
|
//# sourceMappingURL=Toast.js.map
|
package/src/Toast.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Toast.ts"],
|
|
4
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 PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js';\n\nimport toastStyles from './toast.css.js';\n\nexport const toastVariants: ToastVariants[] = [\n 'negative',\n 'positive',\n 'info',\n 'error',\n 'warning',\n];\n\nexport type ToastVariants =\n | 'negative'\n | 'positive'\n | 'info'\n | 'error'\n | 'warning'\n | '';\n\n/**\n * @element sp-toast\n *\n * @slot - The toast content\n * @slot action - button element surfacing an action in the Toast\n *\n * @fires close - Announces that the Toast has been closed by the user or by its timeout.\n */\n\nexport class Toast extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [toastStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * When a timeout is provided it represents the number of milliseconds from when\n * the Toast was placed on the page before it will automatically dismiss itself.\n * Accessibility concerns require that a Toast is available for at least 6000ms\n * before being dismissed, so any timeout of less than 6000ms will be raised to\n * that baseline. It is suggested that messages longer than 120 words should\n * receive another 1000ms in their timeout for each additional 120 words in the\n * message. E.G. 240 words = 7000ms, 360 words = 8000ms, etc.\n *\n * @param {Number} timeout\n */\n @property({ type: Number })\n public set timeout(timeout: number | null) {\n const hasTimeout = typeof timeout !== null && (timeout as number) > 0;\n const newTimeout = hasTimeout\n ? Math.max(6000, timeout as number)\n : null;\n const oldValue = this.timeout;\n if (newTimeout && this.countdownStart) {\n this.countdownStart = performance.now();\n }\n this._timeout = newTimeout;\n this.requestUpdate('timeout', oldValue);\n }\n\n public get timeout(): number | null {\n return this._timeout;\n }\n\n public _timeout: number | null = null;\n\n /**\n * The variant applies specific styling when set to `negative`, `positive`, `info`, `error`, or `warning`.\n * `variant` attribute is removed when not matching one of the above.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: ToastVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n if (toastVariants.includes(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): ToastVariants {\n return this._variant;\n }\n\n private _variant: ToastVariants = '';\n\n private renderIcon(variant: string): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=\"Information\"\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n case 'error': // deprecated\n case 'warning': // deprecated\n return html`\n <sp-icon-alert label=\"Error\" class=\"type\"></sp-icon-alert>\n `;\n case 'positive':\n case 'success': // deprecated\n return html`\n <sp-icon-checkmark-circle\n label=\"Success\"\n class=\"type\"\n ></sp-icon-checkmark-circle>\n `;\n default:\n return html``;\n }\n }\n\n private countdownStart = 0;\n private nextCount = -1;\n\n private doCountdown = (time: number): void => {\n if (!this.countdownStart) {\n this.countdownStart = performance.now();\n }\n if (time - this.countdownStart > (this._timeout as number)) {\n this.shouldClose();\n this.countdownStart = 0;\n } else {\n this.countdown();\n }\n };\n\n private countdown = (): void => {\n cancelAnimationFrame(this.nextCount);\n this.nextCount = requestAnimationFrame(this.doCountdown);\n };\n\n private holdCountdown = (): void => {\n this.stopCountdown();\n this.addEventListener('focusout', this.resumeCountdown);\n };\n\n private resumeCountdown = (): void => {\n this.removeEventListener('focusout', this.holdCountdown);\n this.countdown();\n };\n\n private startCountdown(): void {\n this.countdown();\n this.addEventListener('focusin', this.holdCountdown);\n }\n\n private stopCountdown(): void {\n cancelAnimationFrame(this.nextCount);\n this.countdownStart = 0;\n }\n\n private shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderIcon(this.variant)}\n <div class=\"body\" role=\"alert\">\n <div class=\"content\">\n <slot></slot>\n </div>\n <slot name=\"action\"></slot>\n </div>\n <div class=\"buttons\">\n <sp-close-button\n @click=${this.shouldClose}\n label=\"Close\"\n variant=\"white\"\n ></sp-close-button>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('open')) {\n if (this.open) {\n if (this.timeout) {\n this.startCountdown();\n }\n } else {\n if (this.timeout) {\n this.stopCountdown();\n }\n }\n }\n if (changes.has('timeout')) {\n if (this.timeout !== null && this.open) {\n this.startCountdown();\n } else {\n this.stopCountdown();\n }\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA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BAQ,EAAA,CADVR,EAAS,CAAE,KAAM,MAAO,CAAC,GA7CjB,MA8CE",
|
|
6
|
+
"names": ["html", "SpectrumElement", "property", "toastStyles", "time", "timeout", "newTimeout", "oldValue", "variant", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/index.dev.js
CHANGED
package/src/index.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
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 './Toast.dev.js'\n"],
|
|
5
|
-
"mappings": "AAWA;",
|
|
5
|
+
"mappings": ";AAWA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./Toast.js";
|
|
1
|
+
"use strict";export*from"./Toast.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
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 './Toast.js';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "aAWA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-toast.css.ts"],
|
|
4
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-toast-icon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-toast-neutral-content-padding-top:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-content-padding-bottom:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-button-margin-right:var(\n--spectrum-global-dimension-size-130\n)}:host([dir=ltr]){padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]){padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]){padding-left:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]){padding-right:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host{-webkit-font-smoothing:antialiased;align-items:stretch;border-radius:var(\n--spectrum-toast-neutral-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;display:inline-flex;flex-direction:row;font-size:var(\n--spectrum-toast-neutral-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-neutral-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);padding-bottom:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n);padding-top:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .type{margin-right:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=rtl]) .type{margin-left:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=ltr]) .type{margin-left:0}:host([dir=rtl]) .type{margin-right:0}.type{flex-grow:0;flex-shrink:0;margin-bottom:var(--spectrum-toast-icon-padding-y);margin-top:var(--spectrum-toast-icon-padding-y)}:host([dir=ltr]) .content{padding-right:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]) .content{padding-left:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=ltr]) .content{padding-left:0}:host([dir=rtl]) .content{padding-right:0}:host([dir=ltr]) .content{text-align:left}:host([dir=rtl]) .content{text-align:right}.content{box-sizing:border-box;display:inline-block;flex:1 1 auto;font-size:var(\n--spectrum-toast-info-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-info-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);line-height:var(\n--spectrum-toast-info-text-line-height,var(--spectrum-alias-component-text-line-height)\n);padding-bottom:var(--spectrum-toast-content-padding-bottom);padding-top:var(\n--spectrum-toast-neutral-content-padding-top,var(--spectrum-global-dimension-size-65)\n)}.buttons{align-items:flex-start;display:flex;flex:0 0 auto}:host([dir=ltr]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=ltr]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=ltr]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=ltr]) .buttons slot[name=action]+::slotted([slot=action]){margin-left:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=rtl]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=rtl]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=rtl]) .buttons slot[name=action]+::slotted([slot=action]){margin-right:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}.body{align-self:center;flex:1 1 auto}:host([dir=ltr]) .body ::slotted([slot=action]){float:right}:host([dir=rtl]) .body ::slotted([slot=action]){float:left}:host([dir=ltr]) .body ::slotted([slot=action]){margin-right:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=rtl]) .body ::slotted([slot=action]){margin-left:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=ltr]) .body+.buttons{padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .body+.buttons{padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .body+.buttons{border-left-width:1px}:host([dir=rtl]) .body+.buttons{border-right-width:1px}:host([dir=ltr]) .body+.buttons{border-left-style:solid}:host([dir=rtl]) .body+.buttons{border-right-style:solid}:host{background-color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n);color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n)}.content{color:var(\n--spectrum-toast-neutral-text-color,var(--spectrum-global-color-static-white)\n)}.type{color:#fff}:host([dir=ltr]) .buttons{border-left-color:hsla(0,0%,100%,.2)}:host([dir=rtl]) .buttons{border-right-color:hsla(0,0%,100%,.2)}:host([variant=error]),:host([variant=negative]){background-color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n);color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton.focus-visible:not(:active),:host([variant=negative]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton:focus-visible:not(:active),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=info]){background-color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n);color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=positive]),:host([variant=success]){background-color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n);color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton.focus-visible:not(:active),:host([variant=success]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton:focus-visible:not(:active),:host([variant=success]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}@media (forced-colors:active){:host{border:1px solid transparent}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuFf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
2
|
:host{--spectrum-toast-icon-padding-y:var(
|
|
3
3
|
--spectrum-global-dimension-size-85
|
|
4
4
|
);--spectrum-toast-neutral-content-padding-top:var(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-toast.css.ts"],
|
|
4
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-toast-icon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-toast-neutral-content-padding-top:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-content-padding-bottom:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-button-margin-right:var(\n--spectrum-global-dimension-size-130\n)}:host([dir=ltr]){padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]){padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]){padding-left:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]){padding-right:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host{-webkit-font-smoothing:antialiased;align-items:stretch;border-radius:var(\n--spectrum-toast-neutral-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;display:inline-flex;flex-direction:row;font-size:var(\n--spectrum-toast-neutral-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-neutral-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);padding-bottom:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n);padding-top:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .type{margin-right:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=rtl]) .type{margin-left:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=ltr]) .type{margin-left:0}:host([dir=rtl]) .type{margin-right:0}.type{flex-grow:0;flex-shrink:0;margin-bottom:var(--spectrum-toast-icon-padding-y);margin-top:var(--spectrum-toast-icon-padding-y)}:host([dir=ltr]) .content{padding-right:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]) .content{padding-left:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=ltr]) .content{padding-left:0}:host([dir=rtl]) .content{padding-right:0}:host([dir=ltr]) .content{text-align:left}:host([dir=rtl]) .content{text-align:right}.content{box-sizing:border-box;display:inline-block;flex:1 1 auto;font-size:var(\n--spectrum-toast-info-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-info-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);line-height:var(\n--spectrum-toast-info-text-line-height,var(--spectrum-alias-component-text-line-height)\n);padding-bottom:var(--spectrum-toast-content-padding-bottom);padding-top:var(\n--spectrum-toast-neutral-content-padding-top,var(--spectrum-global-dimension-size-65)\n)}.buttons{align-items:flex-start;display:flex;flex:0 0 auto}:host([dir=ltr]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=ltr]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=ltr]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=ltr]) .buttons slot[name=action]+::slotted([slot=action]){margin-left:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=rtl]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=rtl]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=rtl]) .buttons slot[name=action]+::slotted([slot=action]){margin-right:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}.body{align-self:center;flex:1 1 auto}:host([dir=ltr]) .body ::slotted([slot=action]){float:right}:host([dir=rtl]) .body ::slotted([slot=action]){float:left}:host([dir=ltr]) .body ::slotted([slot=action]){margin-right:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=rtl]) .body ::slotted([slot=action]){margin-left:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=ltr]) .body+.buttons{padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .body+.buttons{padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .body+.buttons{border-left-width:1px}:host([dir=rtl]) .body+.buttons{border-right-width:1px}:host([dir=ltr]) .body+.buttons{border-left-style:solid}:host([dir=rtl]) .body+.buttons{border-right-style:solid}:host{background-color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n);color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n)}.content{color:var(\n--spectrum-toast-neutral-text-color,var(--spectrum-global-color-static-white)\n)}.type{color:#fff}:host([dir=ltr]) .buttons{border-left-color:hsla(0,0%,100%,.2)}:host([dir=rtl]) .buttons{border-right-color:hsla(0,0%,100%,.2)}:host([variant=error]),:host([variant=negative]){background-color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n);color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton.focus-visible:not(:active),:host([variant=negative]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton:focus-visible:not(:active),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=info]){background-color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n);color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=positive]),:host([variant=success]){background-color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n);color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton.focus-visible:not(:active),:host([variant=success]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton:focus-visible:not(:active),:host([variant=success]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}@media (forced-colors:active){:host{border:1px solid transparent}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuFf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/src/toast.css.dev.js
CHANGED
package/src/toast.css.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.css.ts"],
|
|
4
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-toast-icon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-toast-neutral-content-padding-top:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-content-padding-bottom:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-button-margin-right:var(\n--spectrum-global-dimension-size-130\n)}:host([dir=ltr]){padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]){padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]){padding-left:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]){padding-right:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host{-webkit-font-smoothing:antialiased;align-items:stretch;border-radius:var(\n--spectrum-toast-neutral-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;display:inline-flex;flex-direction:row;font-size:var(\n--spectrum-toast-neutral-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-neutral-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);padding-bottom:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n);padding-top:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .type{margin-right:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=rtl]) .type{margin-left:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=ltr]) .type{margin-left:0}:host([dir=rtl]) .type{margin-right:0}.type{flex-grow:0;flex-shrink:0;margin-bottom:var(--spectrum-toast-icon-padding-y);margin-top:var(--spectrum-toast-icon-padding-y)}:host([dir=ltr]) .content{padding-right:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]) .content{padding-left:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=ltr]) .content{padding-left:0}:host([dir=rtl]) .content{padding-right:0}:host([dir=ltr]) .content{text-align:left}:host([dir=rtl]) .content{text-align:right}.content{box-sizing:border-box;display:inline-block;flex:1 1 auto;font-size:var(\n--spectrum-toast-info-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-info-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);line-height:var(\n--spectrum-toast-info-text-line-height,var(--spectrum-alias-component-text-line-height)\n);padding-bottom:var(--spectrum-toast-content-padding-bottom);padding-top:var(\n--spectrum-toast-neutral-content-padding-top,var(--spectrum-global-dimension-size-65)\n)}.buttons{align-items:flex-start;display:flex;flex:0 0 auto}:host([dir=ltr]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=ltr]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=ltr]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=ltr]) .buttons slot[name=action]+::slotted([slot=action]){margin-left:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=rtl]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=rtl]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=rtl]) .buttons slot[name=action]+::slotted([slot=action]){margin-right:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}.body{align-self:center;flex:1 1 auto}:host([dir=ltr]) .body ::slotted([slot=action]){float:right}:host([dir=rtl]) .body ::slotted([slot=action]){float:left}:host([dir=ltr]) .body ::slotted([slot=action]){margin-right:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=rtl]) .body ::slotted([slot=action]){margin-left:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=ltr]) .body+.buttons{padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .body+.buttons{padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .body+.buttons{border-left-width:1px}:host([dir=rtl]) .body+.buttons{border-right-width:1px}:host([dir=ltr]) .body+.buttons{border-left-style:solid}:host([dir=rtl]) .body+.buttons{border-right-style:solid}:host{background-color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n);color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n)}.content{color:var(\n--spectrum-toast-neutral-text-color,var(--spectrum-global-color-static-white)\n)}.type{color:#fff}:host([dir=ltr]) .buttons{border-left-color:hsla(0,0%,100%,.2)}:host([dir=rtl]) .buttons{border-right-color:hsla(0,0%,100%,.2)}:host([variant=error]),:host([variant=negative]){background-color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n);color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton.focus-visible:not(:active),:host([variant=negative]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton:focus-visible:not(:active),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=info]){background-color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n);color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=positive]),:host([variant=success]){background-color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n);color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton.focus-visible:not(:active),:host([variant=success]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton:focus-visible:not(:active),:host([variant=success]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}@media (forced-colors:active){:host{border:1px solid transparent}}.content{line-height:1.5}:host(:not([open])){display:none}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuFf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/toast.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
2
|
:host{--spectrum-toast-icon-padding-y:var(
|
|
3
3
|
--spectrum-global-dimension-size-85
|
|
4
4
|
);--spectrum-toast-neutral-content-padding-top:var(
|
package/src/toast.css.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.css.ts"],
|
|
4
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-toast-icon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-toast-neutral-content-padding-top:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-content-padding-bottom:var(\n--spectrum-global-dimension-size-65\n);--spectrum-toast-button-margin-right:var(\n--spectrum-global-dimension-size-130\n)}:host([dir=ltr]){padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]){padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]){padding-left:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]){padding-right:var(\n--spectrum-toast-neutral-padding-left,var(--spectrum-global-dimension-size-200)\n)}:host{-webkit-font-smoothing:antialiased;align-items:stretch;border-radius:var(\n--spectrum-toast-neutral-border-radius,var(--spectrum-alias-border-radius-regular)\n);box-sizing:border-box;display:inline-flex;flex-direction:row;font-size:var(\n--spectrum-toast-neutral-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-neutral-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);padding-bottom:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n);padding-top:var(\n--spectrum-toast-neutral-padding-y,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .type{margin-right:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=rtl]) .type{margin-left:var(\n--spectrum-toast-neutral-icon-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([dir=ltr]) .type{margin-left:0}:host([dir=rtl]) .type{margin-right:0}.type{flex-grow:0;flex-shrink:0;margin-bottom:var(--spectrum-toast-icon-padding-y);margin-top:var(--spectrum-toast-icon-padding-y)}:host([dir=ltr]) .content{padding-right:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=rtl]) .content{padding-left:var(\n--spectrum-toast-neutral-content-padding-right,var(--spectrum-global-dimension-size-200)\n)}:host([dir=ltr]) .content{padding-left:0}:host([dir=rtl]) .content{padding-right:0}:host([dir=ltr]) .content{text-align:left}:host([dir=rtl]) .content{text-align:right}.content{box-sizing:border-box;display:inline-block;flex:1 1 auto;font-size:var(\n--spectrum-toast-info-text-size,var(--spectrum-global-dimension-font-size-100)\n);font-weight:var(\n--spectrum-toast-info-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);line-height:var(\n--spectrum-toast-info-text-line-height,var(--spectrum-alias-component-text-line-height)\n);padding-bottom:var(--spectrum-toast-content-padding-bottom);padding-top:var(\n--spectrum-toast-neutral-content-padding-top,var(--spectrum-global-dimension-size-65)\n)}.buttons{align-items:flex-start;display:flex;flex:0 0 auto}:host([dir=ltr]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=ltr]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=ltr]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=ltr]) .buttons slot[name=action]+::slotted([slot=action]){margin-left:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .buttons .spectrum-ClearButton+.spectrum-ClearButton,:host([dir=rtl]) .buttons .spectrum-ClearButton+::slotted([slot=action]),:host([dir=rtl]) .buttons slot[name=action]+.spectrum-ClearButton,:host([dir=rtl]) .buttons slot[name=action]+::slotted([slot=action]){margin-right:var(\n--spectrum-toast-neutral-button-gap-x,var(--spectrum-global-dimension-size-100)\n)}.body{align-self:center;flex:1 1 auto}:host([dir=ltr]) .body ::slotted([slot=action]){float:right}:host([dir=rtl]) .body ::slotted([slot=action]){float:left}:host([dir=ltr]) .body ::slotted([slot=action]){margin-right:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=rtl]) .body ::slotted([slot=action]){margin-left:var(\n--spectrum-toast-button-margin-right\n)}:host([dir=ltr]) .body+.buttons{padding-left:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=rtl]) .body+.buttons{padding-right:var(\n--spectrum-toast-neutral-padding-right,var(--spectrum-global-dimension-size-100)\n)}:host([dir=ltr]) .body+.buttons{border-left-width:1px}:host([dir=rtl]) .body+.buttons{border-right-width:1px}:host([dir=ltr]) .body+.buttons{border-left-style:solid}:host([dir=rtl]) .body+.buttons{border-right-style:solid}:host{background-color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n);color:var(\n--spectrum-toast-neutral-background-color,var(--spectrum-semantic-neutral-background-color-default)\n)}.content{color:var(\n--spectrum-toast-neutral-text-color,var(--spectrum-global-color-static-white)\n)}.type{color:#fff}:host([dir=ltr]) .buttons{border-left-color:hsla(0,0%,100%,.2)}:host([dir=rtl]) .buttons{border-right-color:hsla(0,0%,100%,.2)}:host([variant=error]),:host([variant=negative]){background-color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n);color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton.focus-visible:not(:active),:host([variant=negative]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=error]) .closeButton:focus-visible:not(:active),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-negative-background-color,var(--spectrum-semantic-negative-background-color)\n)}:host([variant=info]){background-color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n);color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-info-background-color,var(--spectrum-semantic-informative-background-color)\n)}:host([variant=positive]),:host([variant=success]){background-color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n);color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton.focus-visible:not(:active),:host([variant=success]) .closeButton.focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}:host([variant=positive]) .closeButton:focus-visible:not(:active),:host([variant=success]) .closeButton:focus-visible:not(:active){color:var(\n--spectrum-toast-positive-background-color,var(--spectrum-semantic-positive-background-color)\n)}@media (forced-colors:active){:host{border:1px solid transparent}}.content{line-height:1.5}:host(:not([open])){display:none}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuFf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/stories/toast.stories.js
CHANGED
|
@@ -1,10 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/toast/sp-toast.js";
|
|
4
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
5
|
+
const toast = ({
|
|
6
|
+
variant = "",
|
|
7
|
+
open = true,
|
|
8
|
+
content = ""
|
|
9
|
+
}) => html`
|
|
2
10
|
<sp-toast
|
|
3
|
-
variant=${
|
|
4
|
-
?open=${
|
|
11
|
+
variant=${variant}
|
|
12
|
+
?open=${open}
|
|
5
13
|
>
|
|
6
|
-
${
|
|
14
|
+
${content}
|
|
7
15
|
<sp-button slot="action" variant="overBackground" quiet>Undo</sp-button>
|
|
8
16
|
</sp-toast>
|
|
9
|
-
`;
|
|
17
|
+
`;
|
|
18
|
+
export default {
|
|
19
|
+
component: "sp-toast",
|
|
20
|
+
title: "Toast",
|
|
21
|
+
args: {
|
|
22
|
+
content: "This is a toast message.",
|
|
23
|
+
open: true
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
content: {
|
|
27
|
+
name: "content",
|
|
28
|
+
type: { name: "string", required: false },
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: "string" },
|
|
31
|
+
defaultValue: { summary: "" }
|
|
32
|
+
},
|
|
33
|
+
control: "text"
|
|
34
|
+
},
|
|
35
|
+
open: {
|
|
36
|
+
name: "open",
|
|
37
|
+
type: { name: "boolean", required: false },
|
|
38
|
+
description: "Whether the toast is open.",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "boolean" },
|
|
41
|
+
defaultValue: { summary: false }
|
|
42
|
+
},
|
|
43
|
+
control: {
|
|
44
|
+
type: "boolean"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export const Default = ({
|
|
50
|
+
variant,
|
|
51
|
+
open,
|
|
52
|
+
content
|
|
53
|
+
}) => {
|
|
54
|
+
return toast({ variant, open, content });
|
|
55
|
+
};
|
|
56
|
+
const variantDemo = ({
|
|
57
|
+
variant,
|
|
58
|
+
open,
|
|
59
|
+
content
|
|
60
|
+
}) => {
|
|
61
|
+
return toast({ variant, open, content });
|
|
62
|
+
};
|
|
63
|
+
export const Positive = (args) => variantDemo({ ...args, variant: "positive" });
|
|
64
|
+
export const Negative = (args) => variantDemo({ ...args, variant: "negative" });
|
|
65
|
+
export const Info = (args) => variantDemo({ ...args, variant: "info" });
|
|
10
66
|
//# sourceMappingURL=toast.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.stories.ts"],
|
|
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/toast/sp-toast.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nconst toast = ({\n variant = '',\n open = true,\n content = '',\n}): TemplateResult => html`\n <sp-toast\n variant=${variant as\n | ''\n | 'negative'\n | 'positive'\n | 'info'\n | 'error'\n | 'warning'}\n ?open=${open}\n >\n ${content}\n <sp-button slot=\"action\" variant=\"overBackground\" quiet>Undo</sp-button>\n </sp-toast>\n`;\n\nexport default {\n component: 'sp-toast',\n title: 'Toast',\n args: {\n content: 'This is a toast message.',\n open: true,\n },\n 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 open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the toast is open.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ninterface Properties {\n variant: '' | 'negative' | 'positive' | 'info' | 'error' | 'warning';\n open: boolean;\n content: string;\n onClose: (event: Event) => void;\n}\n\nexport const Default = ({\n variant,\n open,\n content,\n}: Properties): TemplateResult => {\n return toast({ variant, open, content });\n};\n\nconst variantDemo = ({\n variant,\n open,\n content,\n}: Properties): TemplateResult => {\n return toast({ variant, open, content });\n};\n\nexport const Positive = (args: Properties): TemplateResult =>\n variantDemo({ ...args, variant: 'positive' });\n\nexport const Negative = (args: Properties): TemplateResult =>\n variantDemo({ ...args, variant: 'negative' });\n\nexport const Info = (args: Properties): TemplateResult =>\n variantDemo({ ...args, variant: 'info' });\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
5
|
+
"mappings": ";AAWA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AAEP,MAAM,QAAQ,CAAC;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,UAAU;AACd,MAAsB;AAAA;AAAA,kBAEJ;AAAA,gBAOF;AAAA;AAAA,UAEN;AAAA;AAAA;AAAA;AAK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"lit";
|
|
4
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
+
measureFixtureCreation(html`
|
|
2
6
|
<sp-toast>Tip me!</sp-toast>
|
|
3
7
|
`);
|
|
4
8
|
//# sourceMappingURL=test-basic.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["test-basic.ts"],
|
|
4
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/toast/sp-toast.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-toast>Tip me!</sp-toast>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA,CAEtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/toast.test-vrt.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/toast.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ToastStories", stories);
|
|
2
5
|
//# sourceMappingURL=toast.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.test-vrt.ts"],
|
|
4
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/toast.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ToastStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,gBAAgB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/toast.test.js
CHANGED
|
@@ -1,42 +1,240 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/toast/sp-toast.js";
|
|
3
|
+
import { toastVariants } from "@spectrum-web-components/toast";
|
|
4
|
+
import {
|
|
5
|
+
elementUpdated,
|
|
6
|
+
expect,
|
|
7
|
+
fixture,
|
|
8
|
+
html,
|
|
9
|
+
nextFrame,
|
|
10
|
+
waitUntil
|
|
11
|
+
} from "@open-wc/testing";
|
|
12
|
+
import {
|
|
13
|
+
testForLitDevWarnings,
|
|
14
|
+
waitForPredicate
|
|
15
|
+
} from "../../../test/testing-helpers.js";
|
|
16
|
+
import { spy } from "sinon";
|
|
17
|
+
describe("Toast", () => {
|
|
18
|
+
testForLitDevWarnings(
|
|
19
|
+
async () => await fixture(
|
|
20
|
+
html`
|
|
2
21
|
<sp-toast open>Help text.</sp-toast>
|
|
3
|
-
`
|
|
22
|
+
`
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
it("loads", async () => {
|
|
26
|
+
const el = await fixture(
|
|
27
|
+
html`
|
|
4
28
|
<sp-toast open>Help text.</sp-toast>
|
|
5
|
-
`
|
|
6
|
-
|
|
7
|
-
|
|
29
|
+
`
|
|
30
|
+
);
|
|
31
|
+
await elementUpdated(el);
|
|
32
|
+
await expect(el).to.be.accessible();
|
|
33
|
+
});
|
|
34
|
+
toastVariants.map((variant) => {
|
|
35
|
+
it(`loads - [variant="${variant}"]`, async () => {
|
|
36
|
+
const el = await fixture(
|
|
37
|
+
html`
|
|
38
|
+
<sp-toast variant=${variant} open>
|
|
39
|
+
This toast is of the \`${variant}\` variant.
|
|
8
40
|
</sp-toast>
|
|
9
|
-
`
|
|
41
|
+
`
|
|
42
|
+
);
|
|
43
|
+
await elementUpdated(el);
|
|
44
|
+
await expect(el).to.be.accessible();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it("loads - timeout", async () => {
|
|
48
|
+
const el = await fixture(
|
|
49
|
+
html`
|
|
10
50
|
<sp-toast timeout="100">Help text.</sp-toast>
|
|
11
|
-
`
|
|
51
|
+
`
|
|
52
|
+
);
|
|
53
|
+
await elementUpdated(el);
|
|
54
|
+
expect(el.open).to.be.false;
|
|
55
|
+
el._timeout = 100;
|
|
56
|
+
el.open = true;
|
|
57
|
+
await elementUpdated(el);
|
|
58
|
+
await waitForPredicate(() => el.open === false);
|
|
59
|
+
expect(el.open).to.be.false;
|
|
60
|
+
});
|
|
61
|
+
it("`timeout` updates `countdownStart`", async () => {
|
|
62
|
+
const el = await fixture(
|
|
63
|
+
html`
|
|
12
64
|
<sp-toast timeout="100">Help text.</sp-toast>
|
|
13
|
-
`
|
|
65
|
+
`
|
|
66
|
+
);
|
|
67
|
+
await elementUpdated(el);
|
|
68
|
+
expect(el.open).to.be.false;
|
|
69
|
+
const testableEl = el;
|
|
70
|
+
testableEl._timeout = 100;
|
|
71
|
+
el.open = true;
|
|
72
|
+
await elementUpdated(el);
|
|
73
|
+
const firstStart = testableEl.countdownStart;
|
|
74
|
+
await nextFrame();
|
|
75
|
+
await nextFrame();
|
|
76
|
+
await nextFrame();
|
|
77
|
+
el.timeout = 400;
|
|
78
|
+
await elementUpdated(el);
|
|
79
|
+
const secondStart = testableEl.countdownStart;
|
|
80
|
+
expect(secondStart).to.not.equal(firstStart);
|
|
81
|
+
await nextFrame();
|
|
82
|
+
await nextFrame();
|
|
83
|
+
el.timeout = 0;
|
|
84
|
+
await elementUpdated(el);
|
|
85
|
+
const thirdStart = testableEl.countdownStart;
|
|
86
|
+
expect(thirdStart).to.equal(0);
|
|
87
|
+
});
|
|
88
|
+
it("stops timeout on `focusin`", async () => {
|
|
89
|
+
const el = await fixture(
|
|
90
|
+
html`
|
|
14
91
|
<sp-toast timeout="100">Help text.</sp-toast>
|
|
15
|
-
`
|
|
92
|
+
`
|
|
93
|
+
);
|
|
94
|
+
await elementUpdated(el);
|
|
95
|
+
const testableEl = el;
|
|
96
|
+
expect(el.open, "not open to start").to.be.false;
|
|
97
|
+
el.open = true;
|
|
98
|
+
await elementUpdated(el);
|
|
99
|
+
await nextFrame();
|
|
100
|
+
expect(testableEl.countdownStart, "initially not 0").to.not.equal(0);
|
|
101
|
+
testableEl._timeout = 100;
|
|
102
|
+
el.dispatchEvent(new FocusEvent("focusin"));
|
|
103
|
+
await elementUpdated(el);
|
|
104
|
+
expect(testableEl.countdownStart, "0 after focusin").to.equal(0);
|
|
105
|
+
el.dispatchEvent(new FocusEvent("focusout"));
|
|
106
|
+
await elementUpdated(el);
|
|
107
|
+
await nextFrame();
|
|
108
|
+
expect(testableEl.countdownStart, "not 0 after focusout").to.not.equal(
|
|
109
|
+
0
|
|
110
|
+
);
|
|
111
|
+
await waitUntil(() => el.open === false, "closes");
|
|
112
|
+
expect(el.open, "not open to end").to.be.false;
|
|
113
|
+
});
|
|
114
|
+
it("closes", async () => {
|
|
115
|
+
const el = await fixture(
|
|
116
|
+
html`
|
|
16
117
|
<sp-toast open>Help text.</sp-toast>
|
|
17
|
-
`
|
|
18
|
-
|
|
118
|
+
`
|
|
119
|
+
);
|
|
120
|
+
await elementUpdated(el);
|
|
121
|
+
expect(el.open).to.be.true;
|
|
122
|
+
const renderRoot = el.shadowRoot ? el.shadowRoot : el;
|
|
123
|
+
const closeButton = renderRoot.querySelector(
|
|
124
|
+
"sp-close-button"
|
|
125
|
+
);
|
|
126
|
+
closeButton.click();
|
|
127
|
+
await elementUpdated(el);
|
|
128
|
+
expect(el.open).to.be.false;
|
|
129
|
+
});
|
|
130
|
+
it("`close` can be prevented", async () => {
|
|
131
|
+
const handleClose = (event) => event.preventDefault();
|
|
132
|
+
const el = await fixture(
|
|
133
|
+
html`
|
|
134
|
+
<sp-toast open timeout="100" @close=${handleClose}>
|
|
19
135
|
Help text.
|
|
20
136
|
</sp-toast>
|
|
21
|
-
`
|
|
22
|
-
|
|
137
|
+
`
|
|
138
|
+
);
|
|
139
|
+
await elementUpdated(el);
|
|
140
|
+
expect(el.open).to.be.true;
|
|
141
|
+
const renderRoot = el.shadowRoot ? el.shadowRoot : el;
|
|
142
|
+
const closeButton = renderRoot.querySelector(
|
|
143
|
+
"sp-close-button"
|
|
144
|
+
);
|
|
145
|
+
closeButton.click();
|
|
146
|
+
await elementUpdated(el);
|
|
147
|
+
expect(el.open).to.be.true;
|
|
148
|
+
});
|
|
149
|
+
it("can be a controlled element", async () => {
|
|
150
|
+
const closeSpy = spy();
|
|
151
|
+
const handleClose = (event) => {
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
closeSpy();
|
|
154
|
+
};
|
|
155
|
+
const el = await fixture(
|
|
156
|
+
html`
|
|
157
|
+
<sp-toast open timeout="100" @close=${handleClose}>
|
|
23
158
|
Help text.
|
|
24
159
|
</sp-toast>
|
|
25
|
-
`
|
|
160
|
+
`
|
|
161
|
+
);
|
|
162
|
+
await elementUpdated(el);
|
|
163
|
+
expect(el.open).to.be.true;
|
|
164
|
+
expect(closeSpy.callCount).to.equal(0);
|
|
165
|
+
const renderRoot = el.shadowRoot ? el.shadowRoot : el;
|
|
166
|
+
const closeButton = renderRoot.querySelector(
|
|
167
|
+
"sp-close-button"
|
|
168
|
+
);
|
|
169
|
+
closeButton.click();
|
|
170
|
+
await elementUpdated(el);
|
|
171
|
+
expect(el.open).to.be.true;
|
|
172
|
+
expect(closeSpy.callCount).to.equal(1);
|
|
173
|
+
el.open = false;
|
|
174
|
+
await elementUpdated(el);
|
|
175
|
+
expect(el.open).to.be.false;
|
|
176
|
+
expect(closeSpy.callCount).to.equal(1);
|
|
177
|
+
});
|
|
178
|
+
it("validates variants", async () => {
|
|
179
|
+
const el = await fixture(
|
|
180
|
+
html`
|
|
26
181
|
<sp-toast variant="invalid" open>
|
|
27
182
|
This toast validates variants.
|
|
28
183
|
</sp-toast>
|
|
29
|
-
`
|
|
184
|
+
`
|
|
185
|
+
);
|
|
186
|
+
await elementUpdated(el);
|
|
187
|
+
expect(el.variant).to.equal("");
|
|
188
|
+
el.variant = toastVariants[0];
|
|
189
|
+
await elementUpdated(el);
|
|
190
|
+
expect(el.variant).to.equal(toastVariants[0]);
|
|
191
|
+
el.variant = toastVariants[0];
|
|
192
|
+
await elementUpdated(el);
|
|
193
|
+
expect(el.variant).to.equal(toastVariants[0]);
|
|
194
|
+
});
|
|
195
|
+
it("maintains [variant] when disconnected/connected", async () => {
|
|
196
|
+
const el = await fixture(
|
|
197
|
+
html`
|
|
30
198
|
<sp-toast variant="positive" open>
|
|
31
199
|
This toast maintains variants.
|
|
32
200
|
</sp-toast>
|
|
33
|
-
`
|
|
201
|
+
`
|
|
202
|
+
);
|
|
203
|
+
await elementUpdated(el);
|
|
204
|
+
expect(el.variant).to.equal("positive");
|
|
205
|
+
const parent = el.parentElement;
|
|
206
|
+
el.remove();
|
|
207
|
+
expect(el.variant).to.equal("positive");
|
|
208
|
+
parent.append(el);
|
|
209
|
+
expect(el.variant).to.equal("positive");
|
|
210
|
+
});
|
|
211
|
+
it("reopens", async () => {
|
|
212
|
+
const closeSpy = spy();
|
|
213
|
+
const el = await fixture(
|
|
214
|
+
html`
|
|
34
215
|
<sp-toast
|
|
35
216
|
variant="positive"
|
|
36
217
|
open
|
|
37
|
-
@close=${()=>{
|
|
218
|
+
@close=${() => {
|
|
219
|
+
closeSpy();
|
|
220
|
+
}}
|
|
38
221
|
>
|
|
39
222
|
This toast maintains variants.
|
|
40
223
|
</sp-toast>
|
|
41
|
-
`
|
|
224
|
+
`
|
|
225
|
+
);
|
|
226
|
+
await elementUpdated(el);
|
|
227
|
+
expect(el.open).to.be.true;
|
|
228
|
+
const closeButton = el.shadowRoot.querySelector(
|
|
229
|
+
"sp-close-button"
|
|
230
|
+
);
|
|
231
|
+
closeButton.click();
|
|
232
|
+
await elementUpdated(el);
|
|
233
|
+
expect(el.open).to.be.false;
|
|
234
|
+
el.open = true;
|
|
235
|
+
await elementUpdated(el);
|
|
236
|
+
expect(el.open).to.be.true;
|
|
237
|
+
expect(closeSpy.callCount).to.equal(1);
|
|
238
|
+
});
|
|
239
|
+
});
|
|
42
240
|
//# sourceMappingURL=toast.test.js.map
|
package/test/toast.test.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.test.ts"],
|
|
4
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/toast/sp-toast.js';\nimport { Toast, toastVariants } from '@spectrum-web-components/toast';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n waitUntil,\n} from '@open-wc/testing';\nimport { CloseButton } from '@spectrum-web-components/button';\nimport {\n testForLitDevWarnings,\n waitForPredicate,\n} from '../../../test/testing-helpers.js';\nimport { spy } from 'sinon';\n\ninterface TestableToast {\n _timeout: number;\n countdownStart: number;\n}\n\ndescribe('Toast', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Toast>(\n html`\n <sp-toast open>Help text.</sp-toast>\n `\n )\n );\n it('loads', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast open>Help text.</sp-toast>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n toastVariants.map((variant) => {\n it(`loads - [variant=\"${variant}\"]`, async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast variant=${variant} open>\n This toast is of the \\`${variant}\\` variant.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n });\n it('loads - timeout', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n (el as unknown as TestableToast)._timeout = 100;\n el.open = true;\n await elementUpdated(el);\n\n await waitForPredicate(() => el.open === false);\n expect(el.open).to.be.false;\n });\n it('`timeout` updates `countdownStart`', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n const testableEl = el as unknown as TestableToast;\n testableEl._timeout = 100;\n el.open = true;\n await elementUpdated(el);\n\n const firstStart = testableEl.countdownStart;\n\n await nextFrame();\n await nextFrame();\n await nextFrame();\n\n el.timeout = 400;\n\n await elementUpdated(el);\n const secondStart = testableEl.countdownStart;\n\n expect(secondStart).to.not.equal(firstStart);\n\n await nextFrame();\n await nextFrame();\n\n el.timeout = 0;\n\n await elementUpdated(el);\n const thirdStart = testableEl.countdownStart;\n\n expect(thirdStart).to.equal(0);\n });\n it('stops timeout on `focusin`', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `\n );\n\n await elementUpdated(el);\n\n const testableEl = el as unknown as TestableToast;\n expect(el.open, 'not open to start').to.be.false;\n\n el.open = true;\n await elementUpdated(el);\n await nextFrame();\n\n expect(testableEl.countdownStart, 'initially not 0').to.not.equal(0);\n\n testableEl._timeout = 100;\n\n el.dispatchEvent(new FocusEvent('focusin'));\n\n await elementUpdated(el);\n expect(testableEl.countdownStart, '0 after focusin').to.equal(0);\n el.dispatchEvent(new FocusEvent('focusout'));\n\n await elementUpdated(el);\n await nextFrame();\n expect(testableEl.countdownStart, 'not 0 after focusout').to.not.equal(\n 0\n );\n\n await waitUntil(() => el.open === false, 'closes');\n expect(el.open, 'not open to end').to.be.false;\n });\n it('closes', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast open>Help text.</sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('`close` can be prevented', async () => {\n const handleClose = (event: CustomEvent): void =>\n event.preventDefault();\n const el = await fixture<Toast>(\n html`\n <sp-toast open timeout=\"100\" @close=${handleClose}>\n Help text.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('can be a controlled element', async () => {\n const closeSpy = spy();\n const handleClose = (event: CustomEvent): void => {\n event.preventDefault();\n closeSpy();\n };\n const el = await fixture<Toast>(\n html`\n <sp-toast open timeout=\"100\" @close=${handleClose}>\n Help text.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(0);\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(1);\n\n el.open = false;\n await elementUpdated(el);\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it('validates variants', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast variant=\"invalid\" open>\n This toast validates variants.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.variant).to.equal('');\n\n el.variant = toastVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(toastVariants[0]);\n\n el.variant = toastVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(toastVariants[0]);\n });\n it('maintains [variant] when disconnected/connected', async () => {\n const el = await fixture<Toast>(\n html`\n <sp-toast variant=\"positive\" open>\n This toast maintains variants.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.variant).to.equal('positive');\n const parent = el.parentElement as HTMLElement;\n\n el.remove();\n\n expect(el.variant).to.equal('positive');\n\n parent.append(el);\n\n expect(el.variant).to.equal('positive');\n });\n it('reopens', async () => {\n const closeSpy = spy();\n const el = await fixture<Toast>(\n html`\n <sp-toast\n variant=\"positive\"\n open\n @close=${() => {\n closeSpy();\n }}\n >\n This toast maintains variants.\n </sp-toast>\n `\n );\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const closeButton = el.shadowRoot.querySelector(\n 'sp-close-button'\n ) as HTMLElement;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n el.open = true;\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(1);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAgB,qBAAqB;AACrC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,WAAW;AAOpB,SAAS,SAAS,MA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