@spectrum-web-components/toast 1.3.0-beta.2 → 1.3.0-testing.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/toast",
3
- "version": "1.3.0-beta.2",
3
+ "version": "1.3.0-testing.0",
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.3.0-beta.2",
62
- "@spectrum-web-components/button": "^1.3.0-beta.2",
63
- "@spectrum-web-components/icon": "^1.3.0-beta.2",
64
- "@spectrum-web-components/icons-workflow": "^1.3.0-beta.2",
65
- "@spectrum-web-components/shared": "^1.3.0-beta.2"
61
+ "@spectrum-web-components/base": "^1.3.0-testing.0",
62
+ "@spectrum-web-components/button": "^1.3.0-testing.0",
63
+ "@spectrum-web-components/icon": "^1.3.0-testing.0",
64
+ "@spectrum-web-components/icons-workflow": "^1.3.0-testing.0",
65
+ "@spectrum-web-components/shared": "^1.3.0-testing.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@spectrum-css/toast": "11.0.0-s2-foundations.15"
@@ -72,6 +72,5 @@
72
72
  "sideEffects": [
73
73
  "./sp-*.js",
74
74
  "./**/*.dev.js"
75
- ],
76
- "gitHead": "98f10907cae715b337db287dc3e661c0c8385e9b"
75
+ ]
77
76
  }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,192 +0,0 @@
1
- "use strict";
2
- import { html } from "@spectrum-web-components/base";
3
- import "@spectrum-web-components/toast/sp-toast.js";
4
- import "@spectrum-web-components/button/sp-button.js";
5
- import "@spectrum-web-components/overlay/sp-overlay.js";
6
- import "@spectrum-web-components/overlay/overlay-trigger.js";
7
- import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
8
- const toast = ({
9
- variant = "",
10
- open = true,
11
- content = "",
12
- timeout = 0,
13
- iconLabel = ""
14
- }) => html`
15
- <sp-toast
16
- variant=${variant}
17
- ?open=${open}
18
- timeout=${ifDefined(timeout)}
19
- .iconLabel=${iconLabel}
20
- >
21
- ${content}
22
- <sp-button
23
- slot="action"
24
- static-color="white"
25
- variant="secondary"
26
- treatment="outline"
27
- >
28
- Undo
29
- </sp-button>
30
- </sp-toast>
31
- `;
32
- export default {
33
- component: "sp-toast",
34
- title: "Toast",
35
- args: {
36
- content: "This is a toast message.",
37
- open: true
38
- },
39
- argTypes: {
40
- content: {
41
- name: "content",
42
- type: { name: "string", required: false },
43
- table: {
44
- type: { summary: "string" },
45
- defaultValue: { summary: "" }
46
- }
47
- },
48
- open: {
49
- name: "open",
50
- type: { name: "boolean", required: false },
51
- table: {
52
- type: { summary: "boolean" },
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: "" }
62
- },
63
- control: {
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: "" }
81
- }
82
- }
83
- }
84
- };
85
- export const Default = ({
86
- variant,
87
- open,
88
- content,
89
- timeout,
90
- iconLabel
91
- }) => {
92
- return toast({ variant, open, content, timeout, iconLabel });
93
- };
94
- const variantDemo = ({
95
- variant,
96
- open,
97
- content,
98
- timeout,
99
- iconLabel
100
- }) => {
101
- return toast({ variant, open, content, timeout, iconLabel });
102
- };
103
- export const Positive = (args) => variantDemo({ ...args, variant: "positive" });
104
- export const Negative = (args) => variantDemo({ ...args, variant: "negative" });
105
- export const Info = (args) => variantDemo({ ...args, variant: "info" });
106
- export const Wrapping = (args) => variantDemo({
107
- ...args,
108
- variant: "info",
109
- content: "A new version of Lightroom Classic is now available. Use the Update button below to start using the new version."
110
- });
111
- const overlayStyles = html`
112
- <style>
113
- html,
114
- body,
115
- #root,
116
- #root-inner,
117
- sp-story-decorator {
118
- height: 100%;
119
- margin: 0;
120
- }
121
-
122
- sp-story-decorator > div {
123
- display: contents;
124
- }
125
-
126
- sp-story-decorator::part(container) {
127
- display: flex;
128
- flex-direction: column;
129
- width: 100%;
130
- height: 100%;
131
- align-items: center;
132
- justify-content: center;
133
- }
134
-
135
- overlay-trigger {
136
- flex: none;
137
- margin: 24px 0;
138
- }
139
-
140
- .self-managed:nth-child(3) {
141
- margin-left: 50px;
142
- }
143
- </style>
144
- `;
145
- const overlaid = (openPlacement) => {
146
- return html`
147
- ${overlayStyles}
148
- ${[
149
- ["bottom", ""],
150
- ["left", "negative"],
151
- ["right", "positive"],
152
- ["top", "info"]
153
- ].map(([placement, variant]) => {
154
- return html`
155
- <overlay-trigger
156
- placement=${placement}
157
- open=${ifDefined(
158
- openPlacement === placement ? "click" : void 0
159
- )}
160
- >
161
- <sp-button label="${placement} test" slot="trigger">
162
- Click for ${variant ? variant : "toast"} on the
163
- ${placement}
164
- </sp-button>
165
- <sp-toast slot="click-content" variant=${variant}>
166
- ${placement}
167
- </sp-toast>
168
- </overlay-trigger>
169
- `;
170
- })}
171
- `;
172
- };
173
- export const overlaidTop = () => overlaid("top");
174
- export const overlaidRight = () => overlaid("right");
175
- export const overlaidBottom = () => overlaid("bottom");
176
- export const overlaidLeft = () => overlaid("left");
177
- export const overlay = (args) => {
178
- return html`
179
- <style>
180
- sp-toast {
181
- position: fixed;
182
- bottom: 1em;
183
- left: 1em;
184
- }
185
- </style>
186
- <sp-button id="overlay">Toggle Toast overlay</sp-button>
187
- <sp-overlay trigger="overlay@click" type="auto" open>
188
- ${variantDemo({ ...args, variant: "positive" })}
189
- </sp-overlay>
190
- `;
191
- };
192
- //# sourceMappingURL=toast.stories.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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 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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AAAA;AAAA,cAUG,YAAY,EAAE,GAAG,MAAM,SAAS,WAAW,CAAC,CAAC;AAAA;AAAA;AAG3D;",
6
- "names": []
7
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- import "@spectrum-web-components/toast/sp-toast.js";
3
- import { html } from "lit";
4
- import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
5
- measureFixtureCreation(html`
6
- <sp-toast>Tip me!</sp-toast>
7
- `);
8
- //# sourceMappingURL=test-basic.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["test-basic.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/toast/sp-toast.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-toast>Tip me!</sp-toast>\n`);\n"],
5
- "mappings": ";AAYA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA,CAEtB;",
6
- "names": []
7
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- import { html } from "@open-wc/testing";
3
- import "@spectrum-web-components/toast/sp-toast.js";
4
- import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
5
- testForMemoryLeaks(html`
6
- <sp-toast></sp-toast>
7
- `);
8
- //# sourceMappingURL=toast-memory.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["toast-memory.test.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html } from '@open-wc/testing';\nimport '@spectrum-web-components/toast/sp-toast.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(html`\n <sp-toast></sp-toast>\n`);\n"],
5
- "mappings": ";AAWA,SAAS,YAAY;AACrB,OAAO;AACP,SAAS,0BAA0B;AAEnC,mBAAmB;AAAA;AAAA,CAElB;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- import * as stories from "../stories/toast.stories.js";
3
- import { regressVisuals } from "../../../test/visual/test.js";
4
- regressVisuals("ToastStories", stories);
5
- //# sourceMappingURL=toast.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["toast.test-vrt.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/toast.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ToastStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,gBAAgB,OAA+B;",
6
- "names": []
7
- }
@@ -1,227 +0,0 @@
1
- "use strict";
2
- import "@spectrum-web-components/toast/sp-toast.js";
3
- import { toastVariants } from "@spectrum-web-components/toast";
4
- import {
5
- elementUpdated,
6
- expect,
7
- fixture,
8
- html,
9
- nextFrame,
10
- waitUntil
11
- } from "@open-wc/testing";
12
- import {
13
- testForLitDevWarnings,
14
- waitForPredicate
15
- } from "../../../test/testing-helpers.js";
16
- import { spy } from "sinon";
17
- describe("Toast", () => {
18
- testForLitDevWarnings(
19
- async () => await fixture(html`
20
- <sp-toast open>Help text.</sp-toast>
21
- `)
22
- );
23
- it("loads", async () => {
24
- const el = await fixture(html`
25
- <sp-toast open>Help text.</sp-toast>
26
- `);
27
- await elementUpdated(el);
28
- await expect(el).to.be.accessible();
29
- });
30
- toastVariants.map((variant) => {
31
- it(`loads - [variant="${variant}"]`, async () => {
32
- const el = await fixture(html`
33
- <sp-toast variant=${variant} open>
34
- This toast is of the \`${variant}\` variant.
35
- </sp-toast>
36
- `);
37
- await elementUpdated(el);
38
- await expect(el).to.be.accessible();
39
- });
40
- });
41
- it("loads - timeout", async () => {
42
- const el = await fixture(html`
43
- <sp-toast timeout="100">Help text.</sp-toast>
44
- `);
45
- await elementUpdated(el);
46
- expect(el.open).to.be.false;
47
- el._timeout = 100;
48
- el.open = true;
49
- await elementUpdated(el);
50
- await waitForPredicate(() => el.open === false);
51
- expect(el.open).to.be.false;
52
- });
53
- it("`timeout` updates `countdownStart`", async () => {
54
- const el = await fixture(html`
55
- <sp-toast timeout="100">Help text.</sp-toast>
56
- `);
57
- await elementUpdated(el);
58
- expect(el.open).to.be.false;
59
- const testableEl = el;
60
- testableEl._timeout = 100;
61
- el.open = true;
62
- await elementUpdated(el);
63
- const firstStart = testableEl.countdownStart;
64
- await nextFrame();
65
- await nextFrame();
66
- await nextFrame();
67
- el.timeout = 400;
68
- await elementUpdated(el);
69
- const secondStart = testableEl.countdownStart;
70
- expect(secondStart).to.not.equal(firstStart);
71
- await nextFrame();
72
- await nextFrame();
73
- el.timeout = 0;
74
- await elementUpdated(el);
75
- const thirdStart = testableEl.countdownStart;
76
- expect(thirdStart).to.equal(0);
77
- });
78
- it("stops timeout on `focusin`", async () => {
79
- const el = await fixture(html`
80
- <sp-toast timeout="100">Help text.</sp-toast>
81
- `);
82
- await elementUpdated(el);
83
- const testableEl = el;
84
- expect(el.open, "not open to start").to.be.false;
85
- el.open = true;
86
- await elementUpdated(el);
87
- await nextFrame();
88
- expect(testableEl.countdownStart, "initially not 0").to.not.equal(0);
89
- testableEl._timeout = 100;
90
- el.dispatchEvent(new FocusEvent("focusin"));
91
- await elementUpdated(el);
92
- expect(testableEl.countdownStart, "0 after focusin").to.equal(0);
93
- el.dispatchEvent(new FocusEvent("focusout"));
94
- await elementUpdated(el);
95
- await nextFrame();
96
- expect(testableEl.countdownStart, "not 0 after focusout").to.not.equal(
97
- 0
98
- );
99
- await waitUntil(() => el.open === false, "closes");
100
- expect(el.open, "not open to end").to.be.false;
101
- });
102
- it("closes", async () => {
103
- const el = await fixture(html`
104
- <sp-toast open>Help text.</sp-toast>
105
- `);
106
- await elementUpdated(el);
107
- expect(el.open).to.be.true;
108
- const renderRoot = el.shadowRoot ? el.shadowRoot : el;
109
- const closeButton = renderRoot.querySelector(
110
- "sp-close-button"
111
- );
112
- closeButton.click();
113
- await elementUpdated(el);
114
- expect(el.open).to.be.false;
115
- });
116
- it("`close` can be prevented", async () => {
117
- const handleClose = (event) => event.preventDefault();
118
- const el = await fixture(html`
119
- <sp-toast open timeout="100" @close=${handleClose}>
120
- Help text.
121
- </sp-toast>
122
- `);
123
- await elementUpdated(el);
124
- expect(el.open).to.be.true;
125
- const renderRoot = el.shadowRoot ? el.shadowRoot : el;
126
- const closeButton = renderRoot.querySelector(
127
- "sp-close-button"
128
- );
129
- closeButton.click();
130
- await elementUpdated(el);
131
- expect(el.open).to.be.true;
132
- });
133
- it("can be a controlled element", async () => {
134
- const closeSpy = spy();
135
- const handleClose = (event) => {
136
- event.preventDefault();
137
- closeSpy();
138
- };
139
- const el = await fixture(html`
140
- <sp-toast open timeout="100" @close=${handleClose}>
141
- Help text.
142
- </sp-toast>
143
- `);
144
- await elementUpdated(el);
145
- expect(el.open).to.be.true;
146
- expect(closeSpy.callCount).to.equal(0);
147
- const renderRoot = el.shadowRoot ? el.shadowRoot : el;
148
- const closeButton = renderRoot.querySelector(
149
- "sp-close-button"
150
- );
151
- closeButton.click();
152
- await elementUpdated(el);
153
- expect(el.open).to.be.true;
154
- expect(closeSpy.callCount).to.equal(1);
155
- el.open = false;
156
- await elementUpdated(el);
157
- expect(el.open).to.be.false;
158
- expect(closeSpy.callCount).to.equal(1);
159
- });
160
- it("validates variants", async () => {
161
- const el = await fixture(html`
162
- <sp-toast variant="invalid" open>
163
- This toast validates variants.
164
- </sp-toast>
165
- `);
166
- await elementUpdated(el);
167
- expect(el.variant).to.equal("");
168
- el.variant = toastVariants[0];
169
- await elementUpdated(el);
170
- expect(el.variant).to.equal(toastVariants[0]);
171
- el.variant = toastVariants[0];
172
- await elementUpdated(el);
173
- expect(el.variant).to.equal(toastVariants[0]);
174
- });
175
- it("maintains [variant] when disconnected/connected", async () => {
176
- const el = await fixture(html`
177
- <sp-toast variant="positive" open>
178
- This toast maintains variants.
179
- </sp-toast>
180
- `);
181
- await elementUpdated(el);
182
- expect(el.variant).to.equal("positive");
183
- const parent = el.parentElement;
184
- el.remove();
185
- expect(el.variant).to.equal("positive");
186
- parent.append(el);
187
- expect(el.variant).to.equal("positive");
188
- });
189
- it("reopens", async () => {
190
- const closeSpy = spy();
191
- const el = await fixture(html`
192
- <sp-toast
193
- variant="positive"
194
- open
195
- @close=${() => {
196
- closeSpy();
197
- }}
198
- >
199
- This toast maintains variants.
200
- </sp-toast>
201
- `);
202
- await elementUpdated(el);
203
- expect(el.open).to.be.true;
204
- const closeButton = el.shadowRoot.querySelector(
205
- "sp-close-button"
206
- );
207
- closeButton.click();
208
- await elementUpdated(el);
209
- expect(el.open).to.be.false;
210
- el.open = true;
211
- await elementUpdated(el);
212
- expect(el.open).to.be.true;
213
- expect(closeSpy.callCount).to.equal(1);
214
- });
215
- it('sp close button renders with static-color="white"', async () => {
216
- const el = await fixture(html`
217
- <sp-toast open>Help text.</sp-toast>
218
- `);
219
- const renderRoot = el.shadowRoot ? el.shadowRoot : el;
220
- const closeButton = renderRoot.querySelector(
221
- "sp-close-button"
222
- );
223
- expect(closeButton).to.exist;
224
- expect(closeButton.getAttribute("static-color")).to.equal("white");
225
- });
226
- });
227
- //# sourceMappingURL=toast.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["toast.test.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/toast/sp-toast.js';\nimport { Toast, toastVariants } from '@spectrum-web-components/toast';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n waitUntil,\n} from '@open-wc/testing';\nimport { CloseButton } from '@spectrum-web-components/button';\nimport {\n testForLitDevWarnings,\n waitForPredicate,\n} from '../../../test/testing-helpers.js';\nimport { spy } from 'sinon';\n\ninterface TestableToast {\n _timeout: number;\n countdownStart: number;\n}\n\ndescribe('Toast', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Toast>(html`\n <sp-toast open>Help text.</sp-toast>\n `)\n );\n it('loads', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast open>Help text.</sp-toast>\n `);\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n toastVariants.map((variant) => {\n it(`loads - [variant=\"${variant}\"]`, async () => {\n const el = await fixture<Toast>(html`\n <sp-toast variant=${variant} open>\n This toast is of the \\`${variant}\\` variant.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n });\n it('loads - timeout', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n (el as unknown as TestableToast)._timeout = 100;\n el.open = true;\n await elementUpdated(el);\n\n await waitForPredicate(() => el.open === false);\n expect(el.open).to.be.false;\n });\n it('`timeout` updates `countdownStart`', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n const testableEl = el as unknown as TestableToast;\n testableEl._timeout = 100;\n el.open = true;\n await elementUpdated(el);\n\n const firstStart = testableEl.countdownStart;\n\n await nextFrame();\n await nextFrame();\n await nextFrame();\n\n el.timeout = 400;\n\n await elementUpdated(el);\n const secondStart = testableEl.countdownStart;\n\n expect(secondStart).to.not.equal(firstStart);\n\n await nextFrame();\n await nextFrame();\n\n el.timeout = 0;\n\n await elementUpdated(el);\n const thirdStart = testableEl.countdownStart;\n\n expect(thirdStart).to.equal(0);\n });\n it('stops timeout on `focusin`', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast timeout=\"100\">Help text.</sp-toast>\n `);\n\n await elementUpdated(el);\n\n const testableEl = el as unknown as TestableToast;\n expect(el.open, 'not open to start').to.be.false;\n\n el.open = true;\n await elementUpdated(el);\n await nextFrame();\n\n expect(testableEl.countdownStart, 'initially not 0').to.not.equal(0);\n\n testableEl._timeout = 100;\n\n el.dispatchEvent(new FocusEvent('focusin'));\n\n await elementUpdated(el);\n expect(testableEl.countdownStart, '0 after focusin').to.equal(0);\n el.dispatchEvent(new FocusEvent('focusout'));\n\n await elementUpdated(el);\n await nextFrame();\n expect(testableEl.countdownStart, 'not 0 after focusout').to.not.equal(\n 0\n );\n\n await waitUntil(() => el.open === false, 'closes');\n expect(el.open, 'not open to end').to.be.false;\n });\n it('closes', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast open>Help text.</sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('`close` can be prevented', async () => {\n const handleClose = (event: CustomEvent): void =>\n event.preventDefault();\n const el = await fixture<Toast>(html`\n <sp-toast open timeout=\"100\" @close=${handleClose}>\n Help text.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('can be a controlled element', async () => {\n const closeSpy = spy();\n const handleClose = (event: CustomEvent): void => {\n event.preventDefault();\n closeSpy();\n };\n const el = await fixture<Toast>(html`\n <sp-toast open timeout=\"100\" @close=${handleClose}>\n Help text.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(0);\n\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(1);\n\n el.open = false;\n await elementUpdated(el);\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it('validates variants', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast variant=\"invalid\" open>\n This toast validates variants.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.variant).to.equal('');\n\n el.variant = toastVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(toastVariants[0]);\n\n el.variant = toastVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(toastVariants[0]);\n });\n it('maintains [variant] when disconnected/connected', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast variant=\"positive\" open>\n This toast maintains variants.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.variant).to.equal('positive');\n const parent = el.parentElement as HTMLElement;\n\n el.remove();\n\n expect(el.variant).to.equal('positive');\n\n parent.append(el);\n\n expect(el.variant).to.equal('positive');\n });\n it('reopens', async () => {\n const closeSpy = spy();\n const el = await fixture<Toast>(html`\n <sp-toast\n variant=\"positive\"\n open\n @close=${() => {\n closeSpy();\n }}\n >\n This toast maintains variants.\n </sp-toast>\n `);\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const closeButton = el.shadowRoot.querySelector(\n 'sp-close-button'\n ) as HTMLElement;\n closeButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n\n el.open = true;\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(closeSpy.callCount).to.equal(1);\n });\n it('sp close button renders with static-color=\"white\"', async () => {\n const el = await fixture<Toast>(html`\n <sp-toast open>Help text.</sp-toast>\n `);\n const renderRoot = el.shadowRoot ? el.shadowRoot : el;\n const closeButton = renderRoot.querySelector(\n 'sp-close-button'\n ) as CloseButton;\n\n expect(closeButton).to.exist;\n\n expect(closeButton.getAttribute('static-color')).to.equal('white');\n });\n});\n"],
5
- "mappings": ";AAYA,OAAO;AACP,SAAgB,qBAAqB;AACrC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,WAAW;AAOpB,SAAS,SAAS,MAAM;AACpB;AAAA,IACI,YACI,MAAM,QAAe;AAAA;AAAA,aAEpB;AAAA,EACT;AACA,KAAG,SAAS,YAAY;AACpB,UAAM,KAAK,MAAM,QAAe;AAAA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