@spectrum-web-components/toast 1.0.0 → 1.0.1-color-testing
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 +7 -7
- package/src/Toast.d.ts +28 -6
- package/src/Toast.dev.js +18 -6
- package/src/Toast.dev.js.map +2 -2
- package/src/Toast.js +17 -9
- package/src/Toast.js.map +3 -3
- package/src/toast.css.dev.js +1 -1
- package/src/toast.css.dev.js.map +1 -1
- package/src/toast.css.js +1 -1
- package/src/toast.css.js.map +1 -1
- package/stories/toast.stories.js +39 -9
- package/stories/toast.stories.js.map +2 -2
- package/custom-elements.json +0 -294
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/toast",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-color-testing",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"lit-html"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@spectrum-web-components/base": "^1.0.
|
|
62
|
-
"@spectrum-web-components/button": "^1.0.
|
|
63
|
-
"@spectrum-web-components/icon": "^1.0.
|
|
64
|
-
"@spectrum-web-components/icons-workflow": "^1.0.
|
|
65
|
-
"@spectrum-web-components/shared": "^1.0.
|
|
61
|
+
"@spectrum-web-components/base": "^1.0.1-color-testing",
|
|
62
|
+
"@spectrum-web-components/button": "^1.0.1-color-testing",
|
|
63
|
+
"@spectrum-web-components/icon": "^1.0.1-color-testing",
|
|
64
|
+
"@spectrum-web-components/icons-workflow": "^1.0.1-color-testing",
|
|
65
|
+
"@spectrum-web-components/shared": "^1.0.1-color-testing"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@spectrum-css/toast": "^11.0.0-s2-foundations.15"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"./sp-*.js",
|
|
74
74
|
"./**/*.dev.js"
|
|
75
75
|
],
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "17e14b4a9fa2c8b15df158ea7d77ce09bf50de82"
|
|
77
77
|
}
|
package/src/Toast.d.ts
CHANGED
|
@@ -16,23 +16,37 @@ declare const Toast_base: typeof SpectrumElement;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class Toast extends Toast_base {
|
|
18
18
|
static get styles(): CSSResultArray;
|
|
19
|
+
/**
|
|
20
|
+
* The `open` property indicates whether the toast is visible or hidden.
|
|
21
|
+
*
|
|
22
|
+
* @param {Boolean} open
|
|
23
|
+
*/
|
|
19
24
|
open: boolean;
|
|
20
25
|
/**
|
|
21
|
-
* When a timeout is provided it represents the number of milliseconds from when
|
|
26
|
+
* When a timeout is provided, it represents the number of milliseconds from when
|
|
22
27
|
* the Toast was placed on the page before it will automatically dismiss itself.
|
|
28
|
+
*
|
|
23
29
|
* Accessibility concerns require that a Toast is available for at least 6000ms
|
|
24
30
|
* before being dismissed, so any timeout of less than 6000ms will be raised to
|
|
25
|
-
* that baseline.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* that baseline.
|
|
32
|
+
*
|
|
33
|
+
* It is suggested that messages longer than 120 words should receive an additional
|
|
34
|
+
* 1000ms in their timeout for each additional 120 words in the message.
|
|
35
|
+
*
|
|
36
|
+
* For example, a message with 240 words should have a timeout of 7000ms,
|
|
37
|
+
* and a message with 360 words should have a timeout of 8000ms.
|
|
28
38
|
*
|
|
29
|
-
* @param {Number} timeout
|
|
39
|
+
* @param {Number | null} timeout
|
|
40
|
+
* @default null
|
|
30
41
|
*/
|
|
31
42
|
set timeout(timeout: number | null);
|
|
32
43
|
get timeout(): number | null;
|
|
33
|
-
_timeout
|
|
44
|
+
private _timeout;
|
|
34
45
|
/**
|
|
35
46
|
* The variant applies specific styling when set to `negative`, `positive`, `info`, `error`, or `warning`.
|
|
47
|
+
*
|
|
48
|
+
* The variants `error` and `warning` are deprecated and should be replaced with `negative`.
|
|
49
|
+
*
|
|
36
50
|
* `variant` attribute is removed when not matching one of the above.
|
|
37
51
|
*
|
|
38
52
|
* @param {String} variant
|
|
@@ -40,6 +54,14 @@ export declare class Toast extends Toast_base {
|
|
|
40
54
|
set variant(variant: ToastVariants);
|
|
41
55
|
get variant(): ToastVariants;
|
|
42
56
|
private _variant;
|
|
57
|
+
/**
|
|
58
|
+
* The `iconLabel` property is used to set the `label` attribute on the icon element. This is used to provide a text alternative for the icon to ensure accessibility.
|
|
59
|
+
*
|
|
60
|
+
* If the `iconLabel` property is not set, the icon will use the `variant` to dynamically set the `label`.
|
|
61
|
+
*
|
|
62
|
+
* @param {String} iconLabel
|
|
63
|
+
*/
|
|
64
|
+
iconLabel?: string;
|
|
43
65
|
private renderIcon;
|
|
44
66
|
private countdownStart;
|
|
45
67
|
private nextCount;
|
package/src/Toast.dev.js
CHANGED
|
@@ -92,26 +92,35 @@ export class Toast extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
92
92
|
get variant() {
|
|
93
93
|
return this._variant;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
//TODO(#4931): Address the deprecated variants or remove the flags
|
|
96
|
+
renderIcon(variant, iconLabel) {
|
|
96
97
|
switch (variant) {
|
|
97
98
|
case "info":
|
|
98
99
|
return html`
|
|
99
100
|
<sp-icon-info
|
|
100
|
-
label
|
|
101
|
+
label=${iconLabel || "Information"}
|
|
101
102
|
class="type"
|
|
102
103
|
></sp-icon-info>
|
|
103
104
|
`;
|
|
104
105
|
case "negative":
|
|
105
106
|
case "error":
|
|
107
|
+
return html`
|
|
108
|
+
<sp-icon-alert
|
|
109
|
+
label=${iconLabel || "Error"}
|
|
110
|
+
class="type"
|
|
111
|
+
></sp-icon-alert>
|
|
112
|
+
`;
|
|
106
113
|
case "warning":
|
|
107
114
|
return html`
|
|
108
|
-
<sp-icon-alert
|
|
115
|
+
<sp-icon-alert
|
|
116
|
+
label=${iconLabel || "Warning"}
|
|
117
|
+
class="type"
|
|
118
|
+
></sp-icon-alert>
|
|
109
119
|
`;
|
|
110
120
|
case "positive":
|
|
111
|
-
case "success":
|
|
112
121
|
return html`
|
|
113
122
|
<sp-icon-checkmark-circle
|
|
114
|
-
label
|
|
123
|
+
label=${iconLabel || "Success"}
|
|
115
124
|
class="type"
|
|
116
125
|
></sp-icon-checkmark-circle>
|
|
117
126
|
`;
|
|
@@ -144,7 +153,7 @@ export class Toast extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
144
153
|
}
|
|
145
154
|
render() {
|
|
146
155
|
return html`
|
|
147
|
-
${this.renderIcon(this.variant)}
|
|
156
|
+
${this.renderIcon(this.variant, this.iconLabel)}
|
|
148
157
|
<div class="body" role="alert">
|
|
149
158
|
<div class="content">
|
|
150
159
|
<slot></slot>
|
|
@@ -191,4 +200,7 @@ __decorateClass([
|
|
|
191
200
|
__decorateClass([
|
|
192
201
|
property({ type: String })
|
|
193
202
|
], Toast.prototype, "variant", 1);
|
|
203
|
+
__decorateClass([
|
|
204
|
+
property({ type: String, attribute: "icon-label" })
|
|
205
|
+
], Toast.prototype, "iconLabel", 2);
|
|
194
206
|
//# sourceMappingURL=Toast.dev.js.map
|
package/src/Toast.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Toast.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,iCAAiC;AAE1C,OAAO,iBAAiB;AAEjB,aAAM,gBAAiC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAmBO,aAAM,cAAc,0BAA0B,eAAe,EAAE;AAAA,EAA/D;AAAA;
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared/src/focus-visible.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 FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [toastStyles];\n }\n\n /**\n * The `open` property indicates whether the toast is visible or hidden.\n *\n * @param {Boolean} open\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 *\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.\n *\n * It is suggested that messages longer than 120 words should receive an additional\n * 1000ms in their timeout for each additional 120 words in the message.\n *\n * For example, a message with 240 words should have a timeout of 7000ms,\n * and a message with 360 words should have a timeout of 8000ms.\n *\n * @param {Number | null} timeout\n * @default null\n */\n //TODO(#4939): Align on the timeout minimum with design\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 private _timeout: number | null = null;\n\n /**\n * The variant applies specific styling when set to `negative`, `positive`, `info`, `error`, or `warning`.\n *\n * The variants `error` and `warning` are deprecated and should be replaced with `negative`.\n *\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\n // validate the variant is one of the allowed values else remove the attribute\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 /**\n * The `iconLabel` property is used to set the `label` attribute on the icon element. This is used to provide a text alternative for the icon to ensure accessibility.\n *\n * If the `iconLabel` property is not set, the icon will use the `variant` to dynamically set the `label`.\n *\n * @param {String} iconLabel\n */\n @property({ type: String, attribute: 'icon-label' })\n public iconLabel?: string;\n\n //TODO(#4931): Address the deprecated variants or remove the flags\n private renderIcon(\n variant: ToastVariants,\n iconLabel?: string\n ): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=${iconLabel || 'Information'}\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n case 'error': // deprecated\n return html`\n <sp-icon-alert\n label=${iconLabel || 'Error'}\n class=\"type\"\n ></sp-icon-alert>\n `;\n case 'warning': // deprecated\n return html`\n <sp-icon-alert\n label=${iconLabel || 'Warning'}\n class=\"type\"\n ></sp-icon-alert>\n `;\n case 'positive':\n return html`\n <sp-icon-checkmark-circle\n label=${iconLabel || '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, this.iconLabel)}\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 static-color=\"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": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Toast.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=(
|
|
1
|
+
"use strict";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=(u,n,t,e)=>{for(var o=e>1?void 0:e?p(n,t):n,s=u.length-1,l;s>=0;s--)(l=u[s])&&(o=(e?l(n,t,o):l(o))||o);return e&&o&&c(n,t,o),o};import{html as i,SpectrumElement as d}from"@spectrum-web-components/base";import{property as a}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{FocusVisiblePolyfillMixin as h}from"@spectrum-web-components/shared/src/focus-visible.js";import m from"./toast.css.js";export const toastVariants=["negative","positive","info","error","warning"];export class Toast extends h(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[m]}set timeout(t){const o=typeof t!==null&&t>0?Math.max(6e3,t):null,s=this.timeout;o&&this.countdownStart&&(this.countdownStart=performance.now()),this._timeout=o,this.requestUpdate("timeout",s)}get timeout(){return this._timeout}set variant(t){if(t===this.variant)return;const e=this.variant;toastVariants.includes(t)?(this.setAttribute("variant",t),this._variant=t):(this.removeAttribute("variant"),this._variant=""),this.requestUpdate("variant",e)}get variant(){return this._variant}renderIcon(t,e){switch(t){case"info":return i`
|
|
2
2
|
<sp-icon-info
|
|
3
|
-
label
|
|
3
|
+
label=${e||"Information"}
|
|
4
4
|
class="type"
|
|
5
5
|
></sp-icon-info>
|
|
6
|
-
`;case"negative":case"error":
|
|
7
|
-
<sp-icon-alert
|
|
8
|
-
|
|
6
|
+
`;case"negative":case"error":return i`
|
|
7
|
+
<sp-icon-alert
|
|
8
|
+
label=${e||"Error"}
|
|
9
|
+
class="type"
|
|
10
|
+
></sp-icon-alert>
|
|
11
|
+
`;case"warning":return i`
|
|
12
|
+
<sp-icon-alert
|
|
13
|
+
label=${e||"Warning"}
|
|
14
|
+
class="type"
|
|
15
|
+
></sp-icon-alert>
|
|
16
|
+
`;case"positive":return i`
|
|
9
17
|
<sp-icon-checkmark-circle
|
|
10
|
-
label
|
|
18
|
+
label=${e||"Success"}
|
|
11
19
|
class="type"
|
|
12
20
|
></sp-icon-checkmark-circle>
|
|
13
|
-
`;default:return
|
|
14
|
-
${this.renderIcon(this.variant)}
|
|
21
|
+
`;default:return i``}}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 i`
|
|
22
|
+
${this.renderIcon(this.variant,this.iconLabel)}
|
|
15
23
|
<div class="body" role="alert">
|
|
16
24
|
<div class="content">
|
|
17
25
|
<slot></slot>
|
|
@@ -25,5 +33,5 @@
|
|
|
25
33
|
static-color="white"
|
|
26
34
|
></sp-close-button>
|
|
27
35
|
</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())}}r([
|
|
36
|
+
`}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([a({type:Boolean,reflect:!0})],Toast.prototype,"open",2),r([a({type:Number})],Toast.prototype,"timeout",1),r([a({type:String})],Toast.prototype,"variant",1),r([a({type:String,attribute:"icon-label"})],Toast.prototype,"iconLabel",2);
|
|
29
37
|
//# sourceMappingURL=Toast.js.map
|
package/src/Toast.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Toast.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,MAAO,qDACP,MAAO,iEACP,MAAO,gEACP,MAAO,4EACP,OAAS,6BAAAC,MAAiC,uDAE1C,OAAOC,MAAiB,iBAEjB,aAAM,cAAiC,CAC1C,WACA,WACA,OACA,QACA,SACJ,EAmBO,aAAM,cAAcD,EAA0BF,CAAe,CAAE,CAA/D,
|
|
6
|
-
"names": ["html", "SpectrumElement", "property", "FocusVisiblePolyfillMixin", "toastStyles", "time", "timeout", "newTimeout", "oldValue", "variant", "changes", "__decorateClass"]
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared/src/focus-visible.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 FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [toastStyles];\n }\n\n /**\n * The `open` property indicates whether the toast is visible or hidden.\n *\n * @param {Boolean} open\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 *\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.\n *\n * It is suggested that messages longer than 120 words should receive an additional\n * 1000ms in their timeout for each additional 120 words in the message.\n *\n * For example, a message with 240 words should have a timeout of 7000ms,\n * and a message with 360 words should have a timeout of 8000ms.\n *\n * @param {Number | null} timeout\n * @default null\n */\n //TODO(#4939): Align on the timeout minimum with design\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 private _timeout: number | null = null;\n\n /**\n * The variant applies specific styling when set to `negative`, `positive`, `info`, `error`, or `warning`.\n *\n * The variants `error` and `warning` are deprecated and should be replaced with `negative`.\n *\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\n // validate the variant is one of the allowed values else remove the attribute\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 /**\n * The `iconLabel` property is used to set the `label` attribute on the icon element. This is used to provide a text alternative for the icon to ensure accessibility.\n *\n * If the `iconLabel` property is not set, the icon will use the `variant` to dynamically set the `label`.\n *\n * @param {String} iconLabel\n */\n @property({ type: String, attribute: 'icon-label' })\n public iconLabel?: string;\n\n //TODO(#4931): Address the deprecated variants or remove the flags\n private renderIcon(\n variant: ToastVariants,\n iconLabel?: string\n ): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=${iconLabel || 'Information'}\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n case 'error': // deprecated\n return html`\n <sp-icon-alert\n label=${iconLabel || 'Error'}\n class=\"type\"\n ></sp-icon-alert>\n `;\n case 'warning': // deprecated\n return html`\n <sp-icon-alert\n label=${iconLabel || 'Warning'}\n class=\"type\"\n ></sp-icon-alert>\n `;\n case 'positive':\n return html`\n <sp-icon-checkmark-circle\n label=${iconLabel || '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, this.iconLabel)}\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 static-color=\"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": "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",
|
|
6
|
+
"names": ["html", "SpectrumElement", "property", "FocusVisiblePolyfillMixin", "toastStyles", "time", "timeout", "newTimeout", "oldValue", "variant", "iconLabel", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/toast.css.dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
@media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}
|
|
4
|
+
@media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}:host([variant=error]),:host([variant=warning]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active),:host([variant=warning]),:host([variant=warning]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}
|
|
5
5
|
`;
|
|
6
6
|
export default styles;
|
|
7
7
|
//# sourceMappingURL=toast.css.dev.js.map
|
package/src/toast.css.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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 @media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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 @media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}:host([variant=error]),:host([variant=warning]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active),:host([variant=warning]),:host([variant=warning]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/toast.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
|
-
@media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}
|
|
2
|
+
@media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}:host([variant=error]),:host([variant=warning]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active),:host([variant=warning]),:host([variant=warning]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}
|
|
3
3
|
`;export default o;
|
|
4
4
|
//# sourceMappingURL=toast.css.js.map
|
package/src/toast.css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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 @media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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 @media (forced-colors:active){:host{--highcontrast-toast-border-color:ButtonText;border:var(--mod-toast-border-width,var(--spectrum-toast-border-width))solid var(--highcontrast-toast-border-color,transparent)}}:host{box-sizing:border-box;min-block-size:var(--mod-toast-block-size,var(--spectrum-toast-block-size));max-inline-size:var(--mod-toast-max-inline-size,var(--spectrum-toast-max-inline-size));border-radius:var(--mod-toast-corner-radius,var(--spectrum-toast-corner-radius));font-size:var(--mod-toast-font-size,var(--spectrum-toast-font-size));font-weight:var(--mod-toast-font-weight,var(--spectrum-toast-font-weight));-webkit-font-smoothing:antialiased;background-color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));color:var(--highcontrast-toast-background-color-default,var(--mod-toast-background-color-default,var(--spectrum-toast-background-color-default)));overflow-wrap:anywhere;flex-direction:row;align-items:stretch;padding-inline-start:var(--mod-toast-spacing-start-edge-to-text-and-icon,var(--spectrum-toast-spacing-start-edge-to-text-and-icon));display:inline-flex}:host([variant=negative]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=info]){background-color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=info]),:host([variant=info]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-informative-background-color-default,var(--mod-toast-informative-background-color-default,var(--spectrum-toast-informative-background-color-default)))}:host([variant=positive]){background-color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}:host([variant=positive]),:host([variant=positive]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-positive-background-color-default,var(--mod-toast-positive-background-color-default,var(--spectrum-toast-positive-background-color-default)))}.type{flex-grow:0;flex-shrink:0;margin-block-start:var(--mod-toast-spacing-top-edge-to-icon,var(--spectrum-toast-spacing-top-edge-to-icon));margin-inline-start:0;margin-inline-end:var(--mod-toast-spacing-icon-to-text,var(--spectrum-toast-spacing-icon-to-text))}.content,.type{color:var(--highcontrast-toast-text-and-icon-color,var(--mod-toast-text-and-icon-color,var(--spectrum-toast-text-and-icon-color)))}.content{box-sizing:border-box;line-height:var(--mod-toast-line-height,var(--spectrum-toast-line-height));text-align:start;flex:auto;padding-block-start:calc(var(--mod-toast-spacing-top-edge-to-text,var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start)));padding-block-end:calc(var(--mod-toast-spacing-bottom-edge-to-text,var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end)));padding-inline-start:0;padding-inline-end:var(--mod-toast-spacing-text-to-action-button-horizontal,var(--spectrum-toast-spacing-text-to-action-button-horizontal));display:inline-block}.content:lang(ja),.content:lang(ko),.content:lang(zh){line-height:var(--mod-toast-line-height-cjk,var(--spectrum-toast-line-height-cjk))}.buttons{border-inline-start-color:var(--mod-toast-divider-color,var(--spectrum-toast-divider-color));flex:none;align-items:flex-start;margin-block-start:var(--mod-toast-spacing-top-edge-to-divider,var(--spectrum-toast-spacing-top-edge-to-divider));margin-block-end:var(--mod-toast-spacing-bottom-edge-to-divider,var(--spectrum-toast-spacing-bottom-edge-to-divider));padding-inline-end:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button));display:flex}.buttons .spectrum-CloseButton{align-self:flex-start}.body{flex-wrap:wrap;flex:auto;align-self:center;align-items:center;padding-block-start:var(--mod-toast-spacing-block-start,var(--spectrum-toast-spacing-block-start));padding-block-end:var(--mod-toast-spacing-block-end,var(--spectrum-toast-spacing-block-end));display:flex}.body ::slotted([slot=action]){margin-inline-start:auto;margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body ::slotted([slot=action]:dir(rtl)),:host([dir=rtl]) .body ::slotted([slot=action]){margin-inline-end:var(--mod-toast-spacing-text-and-action-button-to-divider,var(--spectrum-toast-spacing-text-and-action-button-to-divider))}.body+.buttons{border-inline-start-style:solid;border-inline-start-width:1px;padding-inline-start:var(--mod-toast-spacing-close-button,var(--spectrum-toast-spacing-close-button))}:host{--spectrum-toast-background-color-default:var(--system-toast-background-color-default);--spectrum-toast-font-weight:var(--system-toast-font-weight);--spectrum-toast-font-size:var(--system-toast-font-size);--spectrum-toast-corner-radius:var(--system-toast-corner-radius);--spectrum-toast-block-size:var(--system-toast-block-size);--spectrum-toast-max-inline-size:var(--system-toast-max-inline-size);--spectrum-toast-border-width:var(--system-toast-border-width);--spectrum-toast-line-height:var(--system-toast-line-height);--spectrum-toast-line-height-cjk:var(--system-toast-line-height-cjk);--spectrum-toast-spacing-icon-to-text:var(--system-toast-spacing-icon-to-text);--spectrum-toast-spacing-start-edge-to-text-and-icon:var(--system-toast-spacing-start-edge-to-text-and-icon);--spectrum-toast-spacing-text-and-action-button-to-divider:var(--system-toast-spacing-text-and-action-button-to-divider);--spectrum-toast-spacing-top-edge-to-divider:var(--system-toast-spacing-top-edge-to-divider);--spectrum-toast-spacing-bottom-edge-to-divider:var(--system-toast-spacing-bottom-edge-to-divider);--spectrum-toast-spacing-top-edge-to-icon:var(--system-toast-spacing-top-edge-to-icon);--spectrum-toast-spacing-text-to-action-button-horizontal:var(--system-toast-spacing-text-to-action-button-horizontal);--spectrum-toast-spacing-close-button:var(--system-toast-spacing-close-button);--spectrum-toast-spacing-block-start:var(--system-toast-spacing-block-start);--spectrum-toast-spacing-block-end:var(--system-toast-spacing-block-end);--spectrum-toast-spacing-top-edge-to-text:var(--system-toast-spacing-top-edge-to-text);--spectrum-toast-spacing-bottom-edge-to-text:var(--system-toast-spacing-bottom-edge-to-text);--spectrum-toast-negative-background-color-default:var(--system-toast-negative-background-color-default);--spectrum-toast-positive-background-color-default:var(--system-toast-positive-background-color-default);--spectrum-toast-informative-background-color-default:var(--system-toast-informative-background-color-default);--spectrum-toast-text-and-icon-color:var(--system-toast-text-and-icon-color);--spectrum-toast-divider-color:var(--system-toast-divider-color)}:host{--spectrum-overlay-animation-distance:var(--spectrum-spacing-100);--spectrum-overlay-animation-duration:var(--spectrum-animation-duration-100);opacity:0;pointer-events:none;transition:transform var(--spectrum-overlay-animation-duration)ease-in-out,opacity var(--spectrum-overlay-animation-duration)ease-in-out,visibility 0s linear var(--spectrum-overlay-animation-duration);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;visibility:visible;transition-delay:0s}:host([variant=error]),:host([variant=warning]){background-color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}:host([variant=negative]),:host([variant=negative]) .closeButton:focus-visible:not(:active),:host([variant=warning]),:host([variant=warning]) .closeButton:focus-visible:not(:active){color:var(--highcontrast-toast-negative-background-color-default,var(--mod-toast-negative-background-color-default,var(--spectrum-toast-negative-background-color-default)))}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/stories/toast.stories.js
CHANGED
|
@@ -8,11 +8,15 @@ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
|
8
8
|
const toast = ({
|
|
9
9
|
variant = "",
|
|
10
10
|
open = true,
|
|
11
|
-
content = ""
|
|
11
|
+
content = "",
|
|
12
|
+
timeout = 0,
|
|
13
|
+
iconLabel = ""
|
|
12
14
|
}) => html`
|
|
13
15
|
<sp-toast
|
|
14
16
|
variant=${variant}
|
|
15
17
|
?open=${open}
|
|
18
|
+
timeout=${ifDefined(timeout)}
|
|
19
|
+
.iconLabel=${iconLabel}
|
|
16
20
|
>
|
|
17
21
|
${content}
|
|
18
22
|
<sp-button
|
|
@@ -39,19 +43,41 @@ export default {
|
|
|
39
43
|
table: {
|
|
40
44
|
type: { summary: "string" },
|
|
41
45
|
defaultValue: { summary: "" }
|
|
42
|
-
}
|
|
43
|
-
control: "text"
|
|
46
|
+
}
|
|
44
47
|
},
|
|
45
48
|
open: {
|
|
46
49
|
name: "open",
|
|
47
50
|
type: { name: "boolean", required: false },
|
|
48
|
-
description: "Whether the toast is open.",
|
|
49
51
|
table: {
|
|
50
52
|
type: { summary: "boolean" },
|
|
51
53
|
defaultValue: { summary: false }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
variant: {
|
|
57
|
+
name: "variant",
|
|
58
|
+
options: ["", "negative", "positive", "info", "error", "warning"],
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: "string" },
|
|
61
|
+
defaultValue: { summary: "" }
|
|
52
62
|
},
|
|
53
63
|
control: {
|
|
54
|
-
type: "
|
|
64
|
+
type: "select"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
timeout: {
|
|
68
|
+
name: "timeout",
|
|
69
|
+
type: { name: "number", required: false },
|
|
70
|
+
table: {
|
|
71
|
+
type: { summary: "number" },
|
|
72
|
+
defaultValue: { summary: null }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
iconLabel: {
|
|
76
|
+
name: "iconLabel",
|
|
77
|
+
type: { name: "string", required: false },
|
|
78
|
+
table: {
|
|
79
|
+
type: { summary: "string" },
|
|
80
|
+
defaultValue: { summary: "" }
|
|
55
81
|
}
|
|
56
82
|
}
|
|
57
83
|
}
|
|
@@ -59,16 +85,20 @@ export default {
|
|
|
59
85
|
export const Default = ({
|
|
60
86
|
variant,
|
|
61
87
|
open,
|
|
62
|
-
content
|
|
88
|
+
content,
|
|
89
|
+
timeout,
|
|
90
|
+
iconLabel
|
|
63
91
|
}) => {
|
|
64
|
-
return toast({ variant, open, content });
|
|
92
|
+
return toast({ variant, open, content, timeout, iconLabel });
|
|
65
93
|
};
|
|
66
94
|
const variantDemo = ({
|
|
67
95
|
variant,
|
|
68
96
|
open,
|
|
69
|
-
content
|
|
97
|
+
content,
|
|
98
|
+
timeout,
|
|
99
|
+
iconLabel
|
|
70
100
|
}) => {
|
|
71
|
-
return toast({ variant, open, content });
|
|
101
|
+
return toast({ variant, open, content, timeout, iconLabel });
|
|
72
102
|
};
|
|
73
103
|
export const Positive = (args) => variantDemo({ ...args, variant: "positive" });
|
|
74
104
|
export const Negative = (args) => variantDemo({ ...args, variant: "negative" });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["toast.stories.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\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';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\n\nimport { Placement } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.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\n slot=\"action\"\n static-color=\"white\"\n variant=\"secondary\"\n treatment=\"outline\"\n >\n Undo\n </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
|
|
5
|
-
"mappings": ";AAWA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,SAAS,iBAAiB;AAE1B,MAAM,QAAQ,CAAC;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,UAAU;
|
|
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';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\n\nimport { Placement } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nconst toast = ({\n variant = '',\n open = true,\n content = '',\n timeout = 0,\n iconLabel = '',\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 timeout=${ifDefined(timeout)}\n .iconLabel=${iconLabel}\n >\n ${content}\n <sp-button\n slot=\"action\"\n static-color=\"white\"\n variant=\"secondary\"\n treatment=\"outline\"\n >\n Undo\n </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 },\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n },\n variant: {\n name: 'variant',\n options: ['', 'negative', 'positive', 'info', 'error', 'warning'],\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: {\n type: 'select',\n },\n },\n timeout: {\n name: 'timeout',\n type: { name: 'number', required: false },\n table: {\n type: { summary: 'number' },\n defaultValue: { summary: null },\n },\n },\n iconLabel: {\n name: 'iconLabel',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n },\n },\n};\n\ninterface Properties {\n variant: '' | 'negative' | 'positive' | 'info' | 'error' | 'warning';\n open: boolean;\n content: string;\n timeout: number;\n iconLabel: string;\n onClose: (event: Event) => void;\n}\n\nexport const Default = ({\n variant,\n open,\n content,\n timeout,\n iconLabel,\n}: Properties): TemplateResult => {\n return toast({ variant, open, content, timeout, iconLabel });\n};\n\nconst variantDemo = ({\n variant,\n open,\n content,\n timeout,\n iconLabel,\n}: Properties): TemplateResult => {\n return toast({ variant, open, content, timeout, iconLabel });\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\nexport const Wrapping = (args: Properties): TemplateResult =>\n variantDemo({\n ...args,\n variant: 'info',\n content:\n 'A new version of Lightroom Classic is now available. Use the Update button below to start using the new version.',\n });\n\nconst overlayStyles = html`\n <style>\n html,\n body,\n #root,\n #root-inner,\n sp-story-decorator {\n height: 100%;\n margin: 0;\n }\n\n sp-story-decorator > div {\n display: contents;\n }\n\n sp-story-decorator::part(container) {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n }\n\n overlay-trigger {\n flex: none;\n margin: 24px 0;\n }\n\n .self-managed:nth-child(3) {\n margin-left: 50px;\n }\n </style>\n`;\n\nconst overlaid = (openPlacement: Placement): TemplateResult => {\n return html`\n ${overlayStyles}\n ${(\n [\n ['bottom', ''],\n ['left', 'negative'],\n ['right', 'positive'],\n ['top', 'info'],\n ] as [Placement, string][]\n ).map(([placement, variant]) => {\n return html`\n <overlay-trigger\n placement=${placement}\n open=${ifDefined(\n openPlacement === placement ? 'click' : undefined\n )}\n >\n <sp-button label=\"${placement} test\" slot=\"trigger\">\n Click for ${variant ? variant : 'toast'} on the\n ${placement}\n </sp-button>\n <sp-toast slot=\"click-content\" variant=${variant}>\n ${placement}\n </sp-toast>\n </overlay-trigger>\n `;\n })}\n `;\n};\n\nexport const overlaidTop = (): TemplateResult => overlaid('top');\nexport const overlaidRight = (): TemplateResult => overlaid('right');\nexport const overlaidBottom = (): TemplateResult => overlaid('bottom');\nexport const overlaidLeft = (): TemplateResult => overlaid('left');\n\nexport const overlay = (args: Properties): TemplateResult => {\n return html`\n <style>\n sp-toast {\n position: fixed;\n bottom: 1em;\n left: 1em;\n }\n </style>\n <sp-button id=\"overlay\">Toggle Toast overlay</sp-button>\n <sp-overlay trigger=\"overlay@click\" type=\"auto\" open>\n ${variantDemo({ ...args, variant: 'positive' })}\n </sp-overlay>\n `;\n};\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,SAAS,iBAAiB;AAE1B,MAAM,QAAQ,CAAC;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,MAAsB;AAAA;AAAA,kBAEJ,OAMK;AAAA,gBACP,IAAI;AAAA,kBACF,UAAU,OAAO,CAAC;AAAA,qBACf,SAAS;AAAA;AAAA,UAEpB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYjB,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,IACF,SAAS;AAAA,IACT,MAAM;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,GAAG;AAAA,MAChC;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,MACL,MAAM;AAAA,MACN,SAAS,CAAC,IAAI,YAAY,YAAY,QAAQ,SAAS,SAAS;AAAA,MAChE,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,GAAG;AAAA,MAChC;AAAA,MACA,SAAS;AAAA,QACL,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,MACL,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,KAAK;AAAA,MAClC;AAAA,IACJ;AAAA,IACA,WAAW;AAAA,MACP,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,GAAG;AAAA,MAChC;AAAA,IACJ;AAAA,EACJ;AACJ;AAWO,aAAM,UAAU,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,MAAkC;AAC9B,SAAO,MAAM,EAAE,SAAS,MAAM,SAAS,SAAS,UAAU,CAAC;AAC/D;AAEA,MAAM,cAAc,CAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,MAAkC;AAC9B,SAAO,MAAM,EAAE,SAAS,MAAM,SAAS,SAAS,UAAU,CAAC;AAC/D;AAEO,aAAM,WAAW,CAAC,SACrB,YAAY,EAAE,GAAG,MAAM,SAAS,WAAW,CAAC;AAEzC,aAAM,WAAW,CAAC,SACrB,YAAY,EAAE,GAAG,MAAM,SAAS,WAAW,CAAC;AAEzC,aAAM,OAAO,CAAC,SACjB,YAAY,EAAE,GAAG,MAAM,SAAS,OAAO,CAAC;AAErC,aAAM,WAAW,CAAC,SACrB,YAAY;AAAA,EACR,GAAG;AAAA,EACH,SAAS;AAAA,EACT,SACI;AACR,CAAC;AAEL,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCtB,MAAM,WAAW,CAAC,kBAA6C;AAC3D,SAAO;AAAA,UACD,aAAa;AAAA,UAEX;AAAA,IACI,CAAC,UAAU,EAAE;AAAA,IACb,CAAC,QAAQ,UAAU;AAAA,IACnB,CAAC,SAAS,UAAU;AAAA,IACpB,CAAC,OAAO,MAAM;AAAA,EAClB,EACF,IAAI,CAAC,CAAC,WAAW,OAAO,MAAM;AAC5B,WAAO;AAAA;AAAA,gCAEa,SAAS;AAAA,2BACd;AAAA,MACH,kBAAkB,YAAY,UAAU;AAAA,IAC5C,CAAC;AAAA;AAAA,wCAEmB,SAAS;AAAA,oCACb,UAAU,UAAU,OAAO;AAAA,0BACrC,SAAS;AAAA;AAAA,6DAE0B,OAAO;AAAA,0BAC1C,SAAS;AAAA;AAAA;AAAA;AAAA,EAI3B,CAAC,CAAC;AAAA;AAEV;AAEO,aAAM,cAAc,MAAsB,SAAS,KAAK;AACxD,aAAM,gBAAgB,MAAsB,SAAS,OAAO;AAC5D,aAAM,iBAAiB,MAAsB,SAAS,QAAQ;AAC9D,aAAM,eAAe,MAAsB,SAAS,MAAM;AAE1D,aAAM,UAAU,CAAC,SAAqC;AACzD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAUG,YAAY,EAAE,GAAG,MAAM,SAAS,WAAW,CAAC,CAAC;AAAA;AAAA;AAG3D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/custom-elements.json
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0.0",
|
|
3
|
-
"readme": "",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "sp-toast.js",
|
|
8
|
-
"declarations": [],
|
|
9
|
-
"exports": [
|
|
10
|
-
{
|
|
11
|
-
"kind": "custom-element-definition",
|
|
12
|
-
"name": "sp-toast",
|
|
13
|
-
"declaration": {
|
|
14
|
-
"name": "Toast",
|
|
15
|
-
"module": "/src/Toast.js"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"kind": "javascript-module",
|
|
22
|
-
"path": "src/Toast.js",
|
|
23
|
-
"declarations": [
|
|
24
|
-
{
|
|
25
|
-
"kind": "variable",
|
|
26
|
-
"name": "toastVariants",
|
|
27
|
-
"type": {
|
|
28
|
-
"text": "ToastVariants[]"
|
|
29
|
-
},
|
|
30
|
-
"default": "[\n 'negative',\n 'positive',\n 'info',\n 'error',\n 'warning',\n]"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"kind": "class",
|
|
34
|
-
"description": "",
|
|
35
|
-
"name": "Toast",
|
|
36
|
-
"slots": [
|
|
37
|
-
{
|
|
38
|
-
"description": "The toast content",
|
|
39
|
-
"name": ""
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"description": "button element surfacing an action in the Toast",
|
|
43
|
-
"name": "action"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"members": [
|
|
47
|
-
{
|
|
48
|
-
"kind": "field",
|
|
49
|
-
"name": "open",
|
|
50
|
-
"type": {
|
|
51
|
-
"text": "boolean"
|
|
52
|
-
},
|
|
53
|
-
"privacy": "public",
|
|
54
|
-
"default": "false",
|
|
55
|
-
"attribute": "open",
|
|
56
|
-
"reflects": true
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"kind": "field",
|
|
60
|
-
"name": "timeout",
|
|
61
|
-
"privacy": "public",
|
|
62
|
-
"description": "When a timeout is provided it represents the number of milliseconds from when\nthe Toast was placed on the page before it will automatically dismiss itself.\nAccessibility concerns require that a Toast is available for at least 6000ms\nbefore being dismissed, so any timeout of less than 6000ms will be raised to\nthat baseline. It is suggested that messages longer than 120 words should\nreceive another 1000ms in their timeout for each additional 120 words in the\nmessage. E.G. 240 words = 7000ms, 360 words = 8000ms, etc.",
|
|
63
|
-
"parameters": [
|
|
64
|
-
{
|
|
65
|
-
"name": "timeout",
|
|
66
|
-
"type": {
|
|
67
|
-
"text": "Number"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"type": {
|
|
72
|
-
"text": "number | null"
|
|
73
|
-
},
|
|
74
|
-
"attribute": "timeout"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"kind": "field",
|
|
78
|
-
"name": "_timeout",
|
|
79
|
-
"type": {
|
|
80
|
-
"text": "number | null"
|
|
81
|
-
},
|
|
82
|
-
"privacy": "public",
|
|
83
|
-
"default": "null"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"kind": "field",
|
|
87
|
-
"name": "variant",
|
|
88
|
-
"privacy": "public",
|
|
89
|
-
"description": "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.",
|
|
90
|
-
"parameters": [
|
|
91
|
-
{
|
|
92
|
-
"name": "variant",
|
|
93
|
-
"type": {
|
|
94
|
-
"text": "String"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
"type": {
|
|
99
|
-
"text": "ToastVariants"
|
|
100
|
-
},
|
|
101
|
-
"attribute": "variant"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"kind": "field",
|
|
105
|
-
"name": "_variant",
|
|
106
|
-
"type": {
|
|
107
|
-
"text": "ToastVariants"
|
|
108
|
-
},
|
|
109
|
-
"privacy": "private",
|
|
110
|
-
"default": "''"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"kind": "method",
|
|
114
|
-
"name": "renderIcon",
|
|
115
|
-
"privacy": "private",
|
|
116
|
-
"return": {
|
|
117
|
-
"type": {
|
|
118
|
-
"text": "TemplateResult"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"parameters": [
|
|
122
|
-
{
|
|
123
|
-
"name": "variant",
|
|
124
|
-
"type": {
|
|
125
|
-
"text": "string"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"kind": "field",
|
|
132
|
-
"name": "countdownStart",
|
|
133
|
-
"type": {
|
|
134
|
-
"text": "number"
|
|
135
|
-
},
|
|
136
|
-
"privacy": "private",
|
|
137
|
-
"default": "0"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"kind": "field",
|
|
141
|
-
"name": "nextCount",
|
|
142
|
-
"type": {
|
|
143
|
-
"text": "number"
|
|
144
|
-
},
|
|
145
|
-
"privacy": "private",
|
|
146
|
-
"default": "-1"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"kind": "field",
|
|
150
|
-
"name": "doCountdown",
|
|
151
|
-
"privacy": "private"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"kind": "field",
|
|
155
|
-
"name": "countdown",
|
|
156
|
-
"privacy": "private"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"kind": "field",
|
|
160
|
-
"name": "holdCountdown",
|
|
161
|
-
"privacy": "private"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"kind": "field",
|
|
165
|
-
"name": "resumeCountdown",
|
|
166
|
-
"privacy": "private"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"kind": "method",
|
|
170
|
-
"name": "startCountdown",
|
|
171
|
-
"privacy": "private",
|
|
172
|
-
"return": {
|
|
173
|
-
"type": {
|
|
174
|
-
"text": "void"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"kind": "method",
|
|
180
|
-
"name": "stopCountdown",
|
|
181
|
-
"privacy": "private",
|
|
182
|
-
"return": {
|
|
183
|
-
"type": {
|
|
184
|
-
"text": "void"
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"kind": "method",
|
|
190
|
-
"name": "shouldClose",
|
|
191
|
-
"privacy": "private",
|
|
192
|
-
"return": {
|
|
193
|
-
"type": {
|
|
194
|
-
"text": "void"
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"kind": "method",
|
|
200
|
-
"name": "close",
|
|
201
|
-
"privacy": "public",
|
|
202
|
-
"return": {
|
|
203
|
-
"type": {
|
|
204
|
-
"text": "void"
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
"events": [
|
|
210
|
-
{
|
|
211
|
-
"name": "close",
|
|
212
|
-
"type": {
|
|
213
|
-
"text": "CustomEvent"
|
|
214
|
-
},
|
|
215
|
-
"description": "Announces that the Toast has been closed by the user or by its timeout."
|
|
216
|
-
}
|
|
217
|
-
],
|
|
218
|
-
"attributes": [
|
|
219
|
-
{
|
|
220
|
-
"name": "open",
|
|
221
|
-
"type": {
|
|
222
|
-
"text": "boolean"
|
|
223
|
-
},
|
|
224
|
-
"default": "false",
|
|
225
|
-
"fieldName": "open"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"name": "timeout",
|
|
229
|
-
"description": "When a timeout is provided it represents the number of milliseconds from when\nthe Toast was placed on the page before it will automatically dismiss itself.\nAccessibility concerns require that a Toast is available for at least 6000ms\nbefore being dismissed, so any timeout of less than 6000ms will be raised to\nthat baseline. It is suggested that messages longer than 120 words should\nreceive another 1000ms in their timeout for each additional 120 words in the\nmessage. E.G. 240 words = 7000ms, 360 words = 8000ms, etc.",
|
|
230
|
-
"parameters": [
|
|
231
|
-
{
|
|
232
|
-
"name": "timeout",
|
|
233
|
-
"type": {
|
|
234
|
-
"text": "Number"
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
],
|
|
238
|
-
"type": {
|
|
239
|
-
"text": "number | null"
|
|
240
|
-
},
|
|
241
|
-
"fieldName": "timeout"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"name": "variant",
|
|
245
|
-
"description": "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.",
|
|
246
|
-
"parameters": [
|
|
247
|
-
{
|
|
248
|
-
"name": "variant",
|
|
249
|
-
"type": {
|
|
250
|
-
"text": "String"
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
"type": {
|
|
255
|
-
"text": "ToastVariants"
|
|
256
|
-
},
|
|
257
|
-
"fieldName": "variant"
|
|
258
|
-
}
|
|
259
|
-
],
|
|
260
|
-
"mixins": [
|
|
261
|
-
{
|
|
262
|
-
"name": "FocusVisiblePolyfillMixin",
|
|
263
|
-
"package": "@spectrum-web-components/shared/src/focus-visible.js"
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
"superclass": {
|
|
267
|
-
"name": "SpectrumElement",
|
|
268
|
-
"package": "@spectrum-web-components/base"
|
|
269
|
-
},
|
|
270
|
-
"tagName": "sp-toast",
|
|
271
|
-
"customElement": true
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
"exports": [
|
|
275
|
-
{
|
|
276
|
-
"kind": "js",
|
|
277
|
-
"name": "toastVariants",
|
|
278
|
-
"declaration": {
|
|
279
|
-
"name": "toastVariants",
|
|
280
|
-
"module": "src/Toast.js"
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"kind": "js",
|
|
285
|
-
"name": "Toast",
|
|
286
|
-
"declaration": {
|
|
287
|
-
"name": "Toast",
|
|
288
|
-
"module": "src/Toast.js"
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
]
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
}
|