@spectrum-web-components/alert-dialog 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/sp-alert-dialog.d.ts +6 -0
- package/sp-alert-dialog.dev.js +5 -0
- package/sp-alert-dialog.dev.js.map +7 -0
- package/sp-alert-dialog.js +2 -0
- package/sp-alert-dialog.js.map +7 -0
- package/src/AlertDialog.d.ts +29 -0
- package/src/AlertDialog.dev.js +195 -0
- package/src/AlertDialog.dev.js.map +7 -0
- package/src/AlertDialog.js +22 -0
- package/src/AlertDialog.js.map +7 -0
- package/src/alert-dialog-overrides.css.d.ts +2 -0
- package/src/alert-dialog-overrides.css.dev.js +7 -0
- package/src/alert-dialog-overrides.css.dev.js.map +7 -0
- package/src/alert-dialog-overrides.css.js +4 -0
- package/src/alert-dialog-overrides.css.js.map +7 -0
- package/src/alert-dialog.css.d.ts +2 -0
- package/src/alert-dialog.css.dev.js +7 -0
- package/src/alert-dialog.css.dev.js.map +7 -0
- package/src/alert-dialog.css.js +4 -0
- package/src/alert-dialog.css.js.map +7 -0
- package/src/index.d.ts +1 -0
- package/src/index.dev.js +3 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -0
- package/src/index.js.map +7 -0
- package/src/spectrum-alert-dialog.css.d.ts +2 -0
- package/src/spectrum-alert-dialog.css.dev.js +7 -0
- package/src/spectrum-alert-dialog.css.dev.js.map +7 -0
- package/src/spectrum-alert-dialog.css.js +4 -0
- package/src/spectrum-alert-dialog.css.js.map +7 -0
- package/stories/alert-dialog.stories.js +169 -0
- package/stories/alert-dialog.stories.js.map +7 -0
- package/test/alert-dialog-memory.test.js +5 -0
- package/test/alert-dialog-memory.test.js.map +7 -0
- package/test/alert-dialog.test-vrt.js +5 -0
- package/test/alert-dialog.test-vrt.js.map +7 -0
- package/test/alert-dialog.test.js +73 -0
- package/test/alert-dialog.test.js.map +7 -0
- package/test/benchmark/basic-test.js +30 -0
- package/test/benchmark/basic-test.js.map +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/alert-dialog",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@lit-labs/observers": "^2.0.2",
|
|
62
|
-
"@spectrum-web-components/base": "^1.1.
|
|
63
|
-
"@spectrum-web-components/button": "^1.1.
|
|
64
|
-
"@spectrum-web-components/button-group": "^1.1.
|
|
65
|
-
"@spectrum-web-components/divider": "^1.1.
|
|
66
|
-
"@spectrum-web-components/icons-workflow": "^1.1.
|
|
67
|
-
"@spectrum-web-components/shared": "^1.1.
|
|
62
|
+
"@spectrum-web-components/base": "^1.1.2",
|
|
63
|
+
"@spectrum-web-components/button": "^1.1.2",
|
|
64
|
+
"@spectrum-web-components/button-group": "^1.1.2",
|
|
65
|
+
"@spectrum-web-components/divider": "^1.1.2",
|
|
66
|
+
"@spectrum-web-components/icons-workflow": "^1.1.2",
|
|
67
|
+
"@spectrum-web-components/shared": "^1.1.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@spectrum-css/alertdialog": "3.0.0-s2-foundations.15"
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"./**/*.dev.js",
|
|
77
77
|
"./**/*.dev.js"
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "9ee45f2dfd3ac1939072726d00195c6c05d9a562"
|
|
80
80
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-alert-dialog.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\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 { AlertDialog } from './src/AlertDialog.dev.js'\n\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\ndefineElement('sp-alert-dialog', AlertDialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-alert-dialog': AlertDialog;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,cAAc,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-alert-dialog.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\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 { AlertDialog } from './src/AlertDialog.js';\n\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\ndefineElement('sp-alert-dialog', AlertDialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-alert-dialog': AlertDialog;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAE5B,OAAS,iBAAAC,MAAqB,sDAC9BA,EAAc,kBAAmBD,CAAW",
|
|
6
|
+
"names": ["AlertDialog", "defineElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
import '@spectrum-web-components/button/sp-button.js';
|
|
3
|
+
export type AlertDialogVariants = 'confirmation' | 'information' | 'warning' | 'error' | 'destructive' | 'secondary' | '';
|
|
4
|
+
export declare const alertDialogVariants: AlertDialogVariants[];
|
|
5
|
+
declare const AlertDialog_base: typeof SpectrumElement;
|
|
6
|
+
export declare class AlertDialog extends AlertDialog_base {
|
|
7
|
+
static get styles(): CSSResultArray;
|
|
8
|
+
private contentElement;
|
|
9
|
+
private resizeController;
|
|
10
|
+
_variant: AlertDialogVariants;
|
|
11
|
+
set variant(variant: AlertDialogVariants);
|
|
12
|
+
get variant(): AlertDialogVariants;
|
|
13
|
+
protected renderIcon(): TemplateResult;
|
|
14
|
+
protected renderHeading(): TemplateResult;
|
|
15
|
+
protected renderContent(): TemplateResult;
|
|
16
|
+
static instanceCount: number;
|
|
17
|
+
private labelledbyId;
|
|
18
|
+
private conditionLabelledby?;
|
|
19
|
+
private conditionDescribedby?;
|
|
20
|
+
private onHeadingSlotchange;
|
|
21
|
+
shouldManageTabOrderForScrolling: () => void;
|
|
22
|
+
private describedbyId;
|
|
23
|
+
protected onContentSlotChange({ target, }: Event & {
|
|
24
|
+
target: HTMLSlotElement;
|
|
25
|
+
}): void;
|
|
26
|
+
protected renderButtons(): TemplateResult;
|
|
27
|
+
protected render(): TemplateResult;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SpectrumElement
|
|
15
|
+
} from "@spectrum-web-components/base";
|
|
16
|
+
import {
|
|
17
|
+
property,
|
|
18
|
+
query
|
|
19
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
20
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
21
|
+
import { FocusVisiblePolyfillMixin } from "@spectrum-web-components/shared/src/focus-visible.js";
|
|
22
|
+
import { randomID } from "@spectrum-web-components/shared/src/random-id.js";
|
|
23
|
+
import { conditionAttributeWithId } from "@spectrum-web-components/base/src/condition-attribute-with-id.js";
|
|
24
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
25
|
+
import alertStyles from "./alert-dialog.css.js";
|
|
26
|
+
export const alertDialogVariants = [
|
|
27
|
+
"confirmation",
|
|
28
|
+
"information",
|
|
29
|
+
"warning",
|
|
30
|
+
"error",
|
|
31
|
+
"destructive",
|
|
32
|
+
"secondary"
|
|
33
|
+
];
|
|
34
|
+
function gatherAppliedIdsFromSlottedChildren(slot, idBase) {
|
|
35
|
+
const assignedElements = slot.assignedElements();
|
|
36
|
+
const ids = [];
|
|
37
|
+
assignedElements.forEach((el) => {
|
|
38
|
+
if (el.id) {
|
|
39
|
+
ids.push(el.id);
|
|
40
|
+
} else {
|
|
41
|
+
const id = idBase + `-${randomID()}`;
|
|
42
|
+
el.id = id;
|
|
43
|
+
ids.push(id);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return ids;
|
|
47
|
+
}
|
|
48
|
+
const _AlertDialog = class _AlertDialog extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
this.resizeController = new ResizeController(this, {
|
|
52
|
+
callback: () => {
|
|
53
|
+
this.shouldManageTabOrderForScrolling();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this._variant = "";
|
|
57
|
+
this.labelledbyId = `sp-dialog-label-${_AlertDialog.instanceCount++}`;
|
|
58
|
+
this.shouldManageTabOrderForScrolling = () => {
|
|
59
|
+
if (!this.contentElement) return;
|
|
60
|
+
const { offsetHeight, scrollHeight } = this.contentElement;
|
|
61
|
+
if (offsetHeight < scrollHeight) {
|
|
62
|
+
this.contentElement.tabIndex = 0;
|
|
63
|
+
} else {
|
|
64
|
+
this.contentElement.removeAttribute("tabindex");
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
this.describedbyId = `sp-dialog-description-${_AlertDialog.instanceCount++}`;
|
|
68
|
+
}
|
|
69
|
+
static get styles() {
|
|
70
|
+
return [alertStyles];
|
|
71
|
+
}
|
|
72
|
+
set variant(variant) {
|
|
73
|
+
if (variant === this.variant) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const oldValue = this.variant;
|
|
77
|
+
if (alertDialogVariants.includes(variant)) {
|
|
78
|
+
this.setAttribute("variant", variant);
|
|
79
|
+
this._variant = variant;
|
|
80
|
+
} else {
|
|
81
|
+
this.removeAttribute("variant");
|
|
82
|
+
this._variant = "";
|
|
83
|
+
}
|
|
84
|
+
this.requestUpdate("variant", oldValue);
|
|
85
|
+
}
|
|
86
|
+
get variant() {
|
|
87
|
+
return this._variant;
|
|
88
|
+
}
|
|
89
|
+
renderIcon() {
|
|
90
|
+
switch (this.variant) {
|
|
91
|
+
case "warning":
|
|
92
|
+
case "error":
|
|
93
|
+
return html`
|
|
94
|
+
<sp-icon-alert class="icon"></sp-icon-alert>
|
|
95
|
+
`;
|
|
96
|
+
default:
|
|
97
|
+
return html``;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
renderHeading() {
|
|
101
|
+
return html`
|
|
102
|
+
<slot name="heading" @slotchange=${this.onHeadingSlotchange}></slot>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
renderContent() {
|
|
106
|
+
return html`
|
|
107
|
+
<div class="content">
|
|
108
|
+
<slot @slotchange=${this.onContentSlotChange}></slot>
|
|
109
|
+
</div>
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
onHeadingSlotchange({
|
|
113
|
+
target
|
|
114
|
+
}) {
|
|
115
|
+
if (this.conditionLabelledby) {
|
|
116
|
+
this.conditionLabelledby();
|
|
117
|
+
delete this.conditionLabelledby;
|
|
118
|
+
}
|
|
119
|
+
const ids = gatherAppliedIdsFromSlottedChildren(
|
|
120
|
+
target,
|
|
121
|
+
this.labelledbyId
|
|
122
|
+
);
|
|
123
|
+
if (ids.length) {
|
|
124
|
+
this.conditionLabelledby = conditionAttributeWithId(
|
|
125
|
+
this,
|
|
126
|
+
"aria-labelledby",
|
|
127
|
+
ids
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
onContentSlotChange({
|
|
132
|
+
target
|
|
133
|
+
}) {
|
|
134
|
+
requestAnimationFrame(() => {
|
|
135
|
+
this.resizeController.unobserve(this.contentElement);
|
|
136
|
+
this.resizeController.observe(this.contentElement);
|
|
137
|
+
});
|
|
138
|
+
if (this.conditionDescribedby) {
|
|
139
|
+
this.conditionDescribedby();
|
|
140
|
+
delete this.conditionDescribedby;
|
|
141
|
+
}
|
|
142
|
+
const ids = gatherAppliedIdsFromSlottedChildren(
|
|
143
|
+
target,
|
|
144
|
+
this.describedbyId
|
|
145
|
+
);
|
|
146
|
+
if (ids.length && ids.length < 4) {
|
|
147
|
+
this.conditionDescribedby = conditionAttributeWithId(
|
|
148
|
+
this,
|
|
149
|
+
"aria-describedby",
|
|
150
|
+
ids
|
|
151
|
+
);
|
|
152
|
+
} else if (!ids.length) {
|
|
153
|
+
const idProvided = !!this.id;
|
|
154
|
+
if (!idProvided) this.id = this.describedbyId;
|
|
155
|
+
const conditionDescribedby = conditionAttributeWithId(
|
|
156
|
+
this,
|
|
157
|
+
"aria-describedby",
|
|
158
|
+
this.id
|
|
159
|
+
);
|
|
160
|
+
this.conditionDescribedby = () => {
|
|
161
|
+
conditionDescribedby();
|
|
162
|
+
if (!idProvided) {
|
|
163
|
+
this.removeAttribute("id");
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
renderButtons() {
|
|
169
|
+
return html`
|
|
170
|
+
<sp-button-group class="button-group">
|
|
171
|
+
<slot name="button"></slot>
|
|
172
|
+
</sp-button-group>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
return html`
|
|
177
|
+
<div class="grid">
|
|
178
|
+
<div class="header">
|
|
179
|
+
${this.renderHeading()} ${this.renderIcon()}
|
|
180
|
+
</div>
|
|
181
|
+
<sp-divider size="m" class="divider"></sp-divider>
|
|
182
|
+
${this.renderContent()} ${this.renderButtons()}
|
|
183
|
+
</div>
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
_AlertDialog.instanceCount = 0;
|
|
188
|
+
__decorateClass([
|
|
189
|
+
query(".content")
|
|
190
|
+
], _AlertDialog.prototype, "contentElement", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
property({ type: String, reflect: true })
|
|
193
|
+
], _AlertDialog.prototype, "variant", 1);
|
|
194
|
+
export let AlertDialog = _AlertDialog;
|
|
195
|
+
//# sourceMappingURL=AlertDialog.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["AlertDialog.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\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 {\n CSSResultArray,\n html,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared/src/focus-visible.js';\nimport { randomID } from '@spectrum-web-components/shared/src/random-id.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.js';\nimport { ResizeController } from '@lit-labs/observers/resize-controller.js';\nimport alertStyles from './alert-dialog.css.js';\n\nexport type AlertDialogVariants =\n | 'confirmation'\n | 'information'\n | 'warning'\n | 'error'\n | 'destructive'\n | 'secondary'\n | '';\n\nexport const alertDialogVariants: AlertDialogVariants[] = [\n 'confirmation',\n 'information',\n 'warning',\n 'error',\n 'destructive',\n 'secondary',\n];\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${randomID()}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\nexport class AlertDialog extends FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [alertStyles];\n }\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n private resizeController = new ResizeController(this, {\n callback: () => {\n this.shouldManageTabOrderForScrolling();\n },\n });\n\n public _variant: AlertDialogVariants = '';\n\n @property({ type: String, reflect: true })\n public set variant(variant: AlertDialogVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n if (alertDialogVariants.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(): AlertDialogVariants {\n return this._variant;\n }\n\n protected renderIcon(): TemplateResult {\n switch (this.variant) {\n case 'warning':\n case 'error':\n return html`\n <sp-icon-alert class=\"icon\"></sp-icon-alert>\n `;\n\n default:\n return html``;\n }\n }\n\n protected renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\n `;\n }\n\n static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${AlertDialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n public shouldManageTabOrderForScrolling = (): void => {\n if (!this.contentElement) return;\n\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\n }\n };\n\n private describedbyId = `sp-dialog-description-${AlertDialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n requestAnimationFrame(() => {\n // Can happen more than once. Take this.contentElement out\n // of the observer before adding it again.\n this.resizeController.unobserve(this.contentElement);\n this.resizeController.observe(this.contentElement);\n });\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"button-group\">\n <slot name=\"button\"></slot>\n </sp-button-group>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"grid\">\n <div class=\"header\">\n ${this.renderHeading()} ${this.renderIcon()}\n </div>\n <sp-divider size=\"m\" class=\"divider\"></sp-divider>\n ${this.renderContent()} ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(a,r,e,t)=>{for(var i=t>1?void 0:t?u(r,e):r,n=a.length-1,d;n>=0;n--)(d=a[n])&&(i=(t?d(r,e,i):d(i))||i);return t&&i&&b(r,e,i),i};import{html as s,SpectrumElement as p}from"@spectrum-web-components/base";import{property as m,query as g}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/button/sp-button.js";import{FocusVisiblePolyfillMixin as v}from"@spectrum-web-components/shared/src/focus-visible.js";import{randomID as y}from"@spectrum-web-components/shared/src/random-id.js";import{conditionAttributeWithId as c}from"@spectrum-web-components/base/src/condition-attribute-with-id.js";import{ResizeController as f}from"@lit-labs/observers/resize-controller.js";import E from"./alert-dialog.css.js";export const alertDialogVariants=["confirmation","information","warning","error","destructive","secondary"];function h(a,r){const e=a.assignedElements(),t=[];return e.forEach(i=>{if(i.id)t.push(i.id);else{const n=r+`-${y()}`;i.id=n,t.push(n)}}),t}const o=class o extends v(p){constructor(){super(...arguments);this.resizeController=new f(this,{callback:()=>{this.shouldManageTabOrderForScrolling()}});this._variant="";this.labelledbyId=`sp-dialog-label-${o.instanceCount++}`;this.shouldManageTabOrderForScrolling=()=>{if(!this.contentElement)return;const{offsetHeight:e,scrollHeight:t}=this.contentElement;e<t?this.contentElement.tabIndex=0:this.contentElement.removeAttribute("tabindex")};this.describedbyId=`sp-dialog-description-${o.instanceCount++}`}static get styles(){return[E]}set variant(e){if(e===this.variant)return;const t=this.variant;alertDialogVariants.includes(e)?(this.setAttribute("variant",e),this._variant=e):(this.removeAttribute("variant"),this._variant=""),this.requestUpdate("variant",t)}get variant(){return this._variant}renderIcon(){switch(this.variant){case"warning":case"error":return s`
|
|
2
|
+
<sp-icon-alert class="icon"></sp-icon-alert>
|
|
3
|
+
`;default:return s``}}renderHeading(){return s`
|
|
4
|
+
<slot name="heading" @slotchange=${this.onHeadingSlotchange}></slot>
|
|
5
|
+
`}renderContent(){return s`
|
|
6
|
+
<div class="content">
|
|
7
|
+
<slot @slotchange=${this.onContentSlotChange}></slot>
|
|
8
|
+
</div>
|
|
9
|
+
`}onHeadingSlotchange({target:e}){this.conditionLabelledby&&(this.conditionLabelledby(),delete this.conditionLabelledby);const t=h(e,this.labelledbyId);t.length&&(this.conditionLabelledby=c(this,"aria-labelledby",t))}onContentSlotChange({target:e}){requestAnimationFrame(()=>{this.resizeController.unobserve(this.contentElement),this.resizeController.observe(this.contentElement)}),this.conditionDescribedby&&(this.conditionDescribedby(),delete this.conditionDescribedby);const t=h(e,this.describedbyId);if(t.length&&t.length<4)this.conditionDescribedby=c(this,"aria-describedby",t);else if(!t.length){const i=!!this.id;i||(this.id=this.describedbyId);const n=c(this,"aria-describedby",this.id);this.conditionDescribedby=()=>{n(),i||this.removeAttribute("id")}}}renderButtons(){return s`
|
|
10
|
+
<sp-button-group class="button-group">
|
|
11
|
+
<slot name="button"></slot>
|
|
12
|
+
</sp-button-group>
|
|
13
|
+
`}render(){return s`
|
|
14
|
+
<div class="grid">
|
|
15
|
+
<div class="header">
|
|
16
|
+
${this.renderHeading()} ${this.renderIcon()}
|
|
17
|
+
</div>
|
|
18
|
+
<sp-divider size="m" class="divider"></sp-divider>
|
|
19
|
+
${this.renderContent()} ${this.renderButtons()}
|
|
20
|
+
</div>
|
|
21
|
+
`}};o.instanceCount=0,l([g(".content")],o.prototype,"contentElement",2),l([m({type:String,reflect:!0})],o.prototype,"variant",1);export let AlertDialog=o;
|
|
22
|
+
//# sourceMappingURL=AlertDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["AlertDialog.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\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 {\n CSSResultArray,\n html,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared/src/focus-visible.js';\nimport { randomID } from '@spectrum-web-components/shared/src/random-id.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.js';\nimport { ResizeController } from '@lit-labs/observers/resize-controller.js';\nimport alertStyles from './alert-dialog.css.js';\n\nexport type AlertDialogVariants =\n | 'confirmation'\n | 'information'\n | 'warning'\n | 'error'\n | 'destructive'\n | 'secondary'\n | '';\n\nexport const alertDialogVariants: AlertDialogVariants[] = [\n 'confirmation',\n 'information',\n 'warning',\n 'error',\n 'destructive',\n 'secondary',\n];\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${randomID()}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\nexport class AlertDialog extends FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [alertStyles];\n }\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n private resizeController = new ResizeController(this, {\n callback: () => {\n this.shouldManageTabOrderForScrolling();\n },\n });\n\n public _variant: AlertDialogVariants = '';\n\n @property({ type: String, reflect: true })\n public set variant(variant: AlertDialogVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n if (alertDialogVariants.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(): AlertDialogVariants {\n return this._variant;\n }\n\n protected renderIcon(): TemplateResult {\n switch (this.variant) {\n case 'warning':\n case 'error':\n return html`\n <sp-icon-alert class=\"icon\"></sp-icon-alert>\n `;\n\n default:\n return html``;\n }\n }\n\n protected renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\n `;\n }\n\n static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${AlertDialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n public shouldManageTabOrderForScrolling = (): void => {\n if (!this.contentElement) return;\n\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\n }\n };\n\n private describedbyId = `sp-dialog-description-${AlertDialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n requestAnimationFrame(() => {\n // Can happen more than once. Take this.contentElement out\n // of the observer before adding it again.\n this.resizeController.unobserve(this.contentElement);\n this.resizeController.observe(this.contentElement);\n });\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"button-group\">\n <slot name=\"button\"></slot>\n </sp-button-group>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"grid\">\n <div class=\"header\">\n ${this.renderHeading()} ${this.renderIcon()}\n </div>\n <sp-divider size=\"m\" class=\"divider\"></sp-divider>\n ${this.renderContent()} ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["html", "SpectrumElement", "property", "query", "FocusVisiblePolyfillMixin", "randomID", "conditionAttributeWithId", "ResizeController", "alertStyles", "gatherAppliedIdsFromSlottedChildren", "slot", "idBase", "assignedElements", "ids", "el", "id", "_AlertDialog", "offsetHeight", "scrollHeight", "variant", "oldValue", "target", "idProvided", "conditionDescribedby", "__decorateClass"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=alert-dialog-overrides.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog-overrides.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const e=t`
|
|
2
|
+
:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}
|
|
3
|
+
`;export default e;
|
|
4
|
+
//# sourceMappingURL=alert-dialog-overrides.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog-overrides.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=alert-dialog.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const e=t`
|
|
2
|
+
:host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}
|
|
3
|
+
`;export default e;
|
|
4
|
+
//# sourceMappingURL=alert-dialog.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}:host{--spectrum-alert-dialog-min-width:var(--system-alert-dialog-min-width);--spectrum-alert-dialog-max-width:var(--system-alert-dialog-max-width);--spectrum-alert-dialog-icon-size:var(--system-alert-dialog-icon-size);--spectrum-alert-dialog-warning-icon-color:var(--system-alert-dialog-warning-icon-color);--spectrum-alert-dialog-error-icon-color:var(--system-alert-dialog-error-icon-color);--spectrum-alert-dialog-title-font-family:var(--system-alert-dialog-title-font-family);--spectrum-alert-dialog-title-font-weight:var(--system-alert-dialog-title-font-weight);--spectrum-alert-dialog-title-font-style:var(--system-alert-dialog-title-font-style);--spectrum-alert-dialog-title-font-size:var(--system-alert-dialog-title-font-size);--spectrum-alert-dialog-title-line-height:var(--system-alert-dialog-title-line-height);--spectrum-alert-dialog-title-color:var(--system-alert-dialog-title-color);--spectrum-alert-dialog-body-font-family:var(--system-alert-dialog-body-font-family);--spectrum-alert-dialog-body-font-weight:var(--system-alert-dialog-body-font-weight);--spectrum-alert-dialog-body-font-style:var(--system-alert-dialog-body-font-style);--spectrum-alert-dialog-body-font-size:var(--system-alert-dialog-body-font-size);--spectrum-alert-dialog-body-line-height:var(--system-alert-dialog-body-line-height);--spectrum-alert-dialog-body-color:var(--system-alert-dialog-body-color);--spectrum-alert-dialog-title-to-divider:var(--system-alert-dialog-title-to-divider);--spectrum-alert-dialog-divider-to-description:var(--system-alert-dialog-divider-to-description);--spectrum-alert-dialog-title-to-icon:var(--system-alert-dialog-title-to-icon)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertDialog.js';
|
package/src/index.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.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\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './AlertDialog.dev.js'\n"],
|
|
5
|
+
"mappings": ";AAWA,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.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\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './AlertDialog.js';\n"],
|
|
5
|
+
"mappings": "aAWA,WAAc",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=spectrum-alert-dialog.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-alert-dialog.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
|
+
:host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}
|
|
3
|
+
`;export default o;
|
|
4
|
+
//# sourceMappingURL=spectrum-alert-dialog.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-alert-dialog.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--mod-buttongroup-justify-content:flex-end;box-sizing:border-box;inline-size:fit-content;min-inline-size:var(--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width));max-inline-size:var(--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width));max-block-size:inherit;padding:var(--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding));outline:none;display:flex}.icon{inline-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));block-size:var(--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size));flex-shrink:0;margin-inline-start:var(--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon))}:host([variant=warning]){--mod-icon-color:var(--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color))}:host([variant=error]){--mod-icon-color:var(--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color))}.grid{display:grid}.header{justify-content:space-between;align-items:baseline;display:flex}::slotted([slot=heading]){font-family:var(--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family));font-weight:var(--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight));font-style:var(--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style));font-size:var(--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size));line-height:var(--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height));color:var(--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color));margin:0;margin-block-end:var(--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider))}.content{font-family:var(--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family));font-weight:var(--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight));font-style:var(--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style));font-size:var(--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size));line-height:var(--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height));color:var(--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color));-webkit-overflow-scrolling:touch;margin:0;margin-block-start:var(--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description));margin-block-end:var(--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons));overflow-y:auto}@media (forced-colors:active){:host{border:solid}}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
4
|
+
import "@spectrum-web-components/alert-dialog/sp-alert-dialog.js";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Alert Dialog",
|
|
7
|
+
component: "sp-alert-dialog"
|
|
8
|
+
};
|
|
9
|
+
export const confirmation = () => {
|
|
10
|
+
return html`
|
|
11
|
+
<sp-alert-dialog variant="confirmation">
|
|
12
|
+
<h2 slot="heading">Disclaimer</h2>
|
|
13
|
+
Smart filters are nondestructive and will preserve your original
|
|
14
|
+
images.
|
|
15
|
+
<sp-button
|
|
16
|
+
slot="button"
|
|
17
|
+
id="cancelButton"
|
|
18
|
+
variant="secondary"
|
|
19
|
+
treatment="outline"
|
|
20
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
21
|
+
>
|
|
22
|
+
Cancel
|
|
23
|
+
</sp-button>
|
|
24
|
+
<sp-button
|
|
25
|
+
slot="button"
|
|
26
|
+
id="confirmButton"
|
|
27
|
+
variant="accent"
|
|
28
|
+
treatment="fill"
|
|
29
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
30
|
+
>
|
|
31
|
+
Enable
|
|
32
|
+
</sp-button>
|
|
33
|
+
</sp-alert-dialog>
|
|
34
|
+
`;
|
|
35
|
+
};
|
|
36
|
+
export const information = () => {
|
|
37
|
+
return html`
|
|
38
|
+
<sp-alert-dialog variant="information">
|
|
39
|
+
<h2 slot="heading">Connect to wifi</h2>
|
|
40
|
+
Please connect to wifi to sync your projects or go to Settings to
|
|
41
|
+
change your preferences.
|
|
42
|
+
<sp-button
|
|
43
|
+
slot="button"
|
|
44
|
+
id="cancelButton"
|
|
45
|
+
variant="secondary"
|
|
46
|
+
treatment="outline"
|
|
47
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
48
|
+
>
|
|
49
|
+
Cancel
|
|
50
|
+
</sp-button>
|
|
51
|
+
<sp-button
|
|
52
|
+
slot="button"
|
|
53
|
+
id="confirmButton"
|
|
54
|
+
variant="primary"
|
|
55
|
+
treatment="outline"
|
|
56
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
57
|
+
>
|
|
58
|
+
Continue
|
|
59
|
+
</sp-button>
|
|
60
|
+
</sp-alert-dialog>
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
export const warning = () => {
|
|
64
|
+
return html`
|
|
65
|
+
<sp-alert-dialog variant="warning">
|
|
66
|
+
<h2 slot="heading">Unverified format</h2>
|
|
67
|
+
This format has not been verified and may not be viewable for some
|
|
68
|
+
users. Do you want to continue publishing?
|
|
69
|
+
<sp-button
|
|
70
|
+
slot="button"
|
|
71
|
+
id="cancelButton"
|
|
72
|
+
variant="secondary"
|
|
73
|
+
treatment="outline"
|
|
74
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
75
|
+
>
|
|
76
|
+
Cancel
|
|
77
|
+
</sp-button>
|
|
78
|
+
<sp-button
|
|
79
|
+
slot="button"
|
|
80
|
+
id="confirmButton"
|
|
81
|
+
variant="primary"
|
|
82
|
+
treatment="outline"
|
|
83
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
84
|
+
>
|
|
85
|
+
Continue
|
|
86
|
+
</sp-button>
|
|
87
|
+
</sp-alert-dialog>
|
|
88
|
+
`;
|
|
89
|
+
};
|
|
90
|
+
export const error = () => {
|
|
91
|
+
return html`
|
|
92
|
+
<sp-alert-dialog variant="error">
|
|
93
|
+
<h2 slot="heading">Unable to share</h2>
|
|
94
|
+
An error occured while sharing your project. Please verify the email
|
|
95
|
+
address and try again.
|
|
96
|
+
<sp-button
|
|
97
|
+
slot="button"
|
|
98
|
+
id="confirmButton"
|
|
99
|
+
variant="primary"
|
|
100
|
+
treatment="outline"
|
|
101
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
102
|
+
>
|
|
103
|
+
Continue
|
|
104
|
+
</sp-button>
|
|
105
|
+
</sp-alert-dialog>
|
|
106
|
+
`;
|
|
107
|
+
};
|
|
108
|
+
export const destructive = () => {
|
|
109
|
+
return html`
|
|
110
|
+
<sp-alert-dialog variant="destructive">
|
|
111
|
+
<h2 slot="heading">Delete 3 documents?</h2>
|
|
112
|
+
Are you sure you want to delete the 3 selected documents?
|
|
113
|
+
<sp-button
|
|
114
|
+
slot="button"
|
|
115
|
+
id="cancelButton"
|
|
116
|
+
variant="secondary"
|
|
117
|
+
treatment="outline"
|
|
118
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
119
|
+
>
|
|
120
|
+
Cancel
|
|
121
|
+
</sp-button>
|
|
122
|
+
<sp-button
|
|
123
|
+
slot="button"
|
|
124
|
+
id="confirmButton"
|
|
125
|
+
variant="negative"
|
|
126
|
+
treatment="fill"
|
|
127
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
128
|
+
>
|
|
129
|
+
Delete
|
|
130
|
+
</sp-button>
|
|
131
|
+
</sp-alert-dialog>
|
|
132
|
+
`;
|
|
133
|
+
};
|
|
134
|
+
export const secondary = () => {
|
|
135
|
+
return html`
|
|
136
|
+
<sp-alert-dialog variant="secondary">
|
|
137
|
+
<h2 slot="heading">Rate this app</h2>
|
|
138
|
+
If you enjoy our app, would you mind taking a moment to rate it?
|
|
139
|
+
<sp-button
|
|
140
|
+
slot="button"
|
|
141
|
+
id="secondaryButton"
|
|
142
|
+
variant="secondary"
|
|
143
|
+
treatment="outline"
|
|
144
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
145
|
+
>
|
|
146
|
+
No, thanks
|
|
147
|
+
</sp-button>
|
|
148
|
+
<sp-button
|
|
149
|
+
slot="button"
|
|
150
|
+
id="cancelButton"
|
|
151
|
+
variant="secondary"
|
|
152
|
+
treatment="outline"
|
|
153
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
154
|
+
>
|
|
155
|
+
Remind me later
|
|
156
|
+
</sp-button>
|
|
157
|
+
<sp-button
|
|
158
|
+
slot="button"
|
|
159
|
+
id="confirmButton"
|
|
160
|
+
variant="primary"
|
|
161
|
+
treatment="outline"
|
|
162
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
163
|
+
>
|
|
164
|
+
Rate now
|
|
165
|
+
</sp-button>
|
|
166
|
+
</sp-alert-dialog>
|
|
167
|
+
`;
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=alert-dialog.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.stories.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\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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';\n\nexport default {\n title: 'Alert Dialog',\n component: 'sp-alert-dialog',\n};\n\nexport const confirmation = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"confirmation\">\n <h2 slot=\"heading\">Disclaimer</h2>\n Smart filters are nondestructive and will preserve your original\n images.\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Cancel\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"accent\"\n treatment=\"fill\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Enable\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n\nexport const information = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"information\">\n <h2 slot=\"heading\">Connect to wifi</h2>\n Please connect to wifi to sync your projects or go to Settings to\n change your preferences.\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Cancel\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"primary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Continue\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n\nexport const warning = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"warning\">\n <h2 slot=\"heading\">Unverified format</h2>\n This format has not been verified and may not be viewable for some\n users. Do you want to continue publishing?\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Cancel\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"primary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Continue\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n\nexport const error = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"error\">\n <h2 slot=\"heading\">Unable to share</h2>\n An error occured while sharing your project. Please verify the email\n address and try again.\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"primary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Continue\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n\nexport const destructive = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"destructive\">\n <h2 slot=\"heading\">Delete 3 documents?</h2>\n Are you sure you want to delete the 3 selected documents?\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Cancel\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"negative\"\n treatment=\"fill\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Delete\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n\nexport const secondary = (): TemplateResult => {\n return html`\n <sp-alert-dialog variant=\"secondary\">\n <h2 slot=\"heading\">Rate this app</h2>\n If you enjoy our app, would you mind taking a moment to rate it?\n <sp-button\n slot=\"button\"\n id=\"secondaryButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n No, thanks\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Remind me later\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"primary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Rate now\n </sp-button>\n </sp-alert-dialog>\n `;\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AACrC,OAAO;AACP,OAAO;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,eAAe,MAAsB;AAC9C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBX;AAEO,aAAM,cAAc,MAAsB;AAC7C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBX;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBX;AAEO,aAAM,QAAQ,MAAsB;AACvC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBX;AAEO,aAAM,cAAc,MAAsB;AAC7C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBX;AAEO,aAAM,YAAY,MAAsB;AAC3C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog-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\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 { confirmation } from '../stories/alert-dialog.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(confirmation());\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAEnC,mBAAmB,aAAa,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.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/alert-dialog.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('AlertDialogStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sBAAsB,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/theme/sp-theme.js";
|
|
3
|
+
import "@spectrum-web-components/theme/src/themes.js";
|
|
4
|
+
import { elementUpdated, expect, fixture, nextFrame } from "@open-wc/testing";
|
|
5
|
+
import { html } from "@spectrum-web-components/base";
|
|
6
|
+
import "@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";
|
|
7
|
+
import "@spectrum-web-components/alert-dialog/sp-alert-dialog.js";
|
|
8
|
+
import {
|
|
9
|
+
alertDialogVariants
|
|
10
|
+
} from "@spectrum-web-components/alert-dialog";
|
|
11
|
+
import {
|
|
12
|
+
confirmation,
|
|
13
|
+
secondary,
|
|
14
|
+
warning
|
|
15
|
+
} from "../stories/alert-dialog.stories.js";
|
|
16
|
+
describe("AlertDialog", () => {
|
|
17
|
+
it("renders confirmation variant accessible", async () => {
|
|
18
|
+
const el = await fixture(confirmation());
|
|
19
|
+
await elementUpdated(el);
|
|
20
|
+
await expect(el).to.be.accessible();
|
|
21
|
+
});
|
|
22
|
+
it("warning variant renders with an alert icon", async () => {
|
|
23
|
+
const el = await fixture(warning());
|
|
24
|
+
await elementUpdated(el);
|
|
25
|
+
const alertIcon = el.shadowRoot.querySelector("sp-icon-alert");
|
|
26
|
+
expect(alertIcon).to.be.not.null;
|
|
27
|
+
});
|
|
28
|
+
it("secondary variant renders with `confirm`, `cancel` and `secondary` buttons", async () => {
|
|
29
|
+
const el = await fixture(secondary());
|
|
30
|
+
await elementUpdated(el);
|
|
31
|
+
const confirmButton = el.querySelector("#confirmButton");
|
|
32
|
+
const cancelButton = el.querySelector("#cancelButton");
|
|
33
|
+
const secondaryButton = el.querySelector("#secondaryButton");
|
|
34
|
+
expect(confirmButton).to.be.not.null;
|
|
35
|
+
expect(cancelButton).to.be.not.null;
|
|
36
|
+
expect(secondaryButton).to.be.not.null;
|
|
37
|
+
});
|
|
38
|
+
it("validates variants", async () => {
|
|
39
|
+
const el = await fixture(
|
|
40
|
+
html`
|
|
41
|
+
<sp-alert-dialog variant="invalid">
|
|
42
|
+
This Alert Dialog validates variants.
|
|
43
|
+
</sp-alert-dialog>
|
|
44
|
+
`
|
|
45
|
+
);
|
|
46
|
+
await elementUpdated(el);
|
|
47
|
+
expect(el.variant).to.equal("");
|
|
48
|
+
el.variant = alertDialogVariants[0];
|
|
49
|
+
await elementUpdated(el);
|
|
50
|
+
expect(el.variant).to.equal(alertDialogVariants[0]);
|
|
51
|
+
el.variant = alertDialogVariants[0];
|
|
52
|
+
await elementUpdated(el);
|
|
53
|
+
expect(el.variant).to.equal(alertDialogVariants[0]);
|
|
54
|
+
});
|
|
55
|
+
it("does not recycle applied content ids", async () => {
|
|
56
|
+
const el = await fixture(html`
|
|
57
|
+
<sp-alert-dialog>
|
|
58
|
+
<h2 slot="heading">Disclaimer</h2>
|
|
59
|
+
<p>Initial paragraph.</p>
|
|
60
|
+
</sp-alert-dialog>
|
|
61
|
+
`);
|
|
62
|
+
await elementUpdated(el);
|
|
63
|
+
await expect(el).to.be.accessible();
|
|
64
|
+
const paragraph = document.createElement("p");
|
|
65
|
+
paragraph.textContent = "Added paragraph.";
|
|
66
|
+
const target = el.querySelector("p");
|
|
67
|
+
target.insertAdjacentElement("beforebegin", paragraph);
|
|
68
|
+
await nextFrame();
|
|
69
|
+
await elementUpdated(el);
|
|
70
|
+
await expect(el).to.be.accessible();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=alert-dialog.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.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\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { elementUpdated, expect, fixture, nextFrame } from '@open-wc/testing';\nimport { html } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';\nimport {\n AlertDialog,\n alertDialogVariants,\n} from '@spectrum-web-components/alert-dialog';\nimport { Button } from '@spectrum-web-components/button/src/Button.js';\nimport {\n confirmation,\n secondary,\n warning,\n} from '../stories/alert-dialog.stories.js';\n\ndescribe('AlertDialog', () => {\n it('renders confirmation variant accessible', async () => {\n const el = await fixture<AlertDialog>(confirmation());\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('warning variant renders with an alert icon', async () => {\n const el = await fixture<AlertDialog>(warning());\n await elementUpdated(el);\n const alertIcon = el.shadowRoot.querySelector('sp-icon-alert');\n expect(alertIcon).to.be.not.null;\n });\n it('secondary variant renders with `confirm`, `cancel` and `secondary` buttons', async () => {\n const el = await fixture<AlertDialog>(secondary());\n await elementUpdated(el);\n const confirmButton = el.querySelector('#confirmButton') as Button;\n const cancelButton = el.querySelector('#cancelButton') as Button;\n const secondaryButton = el.querySelector('#secondaryButton') as Button;\n\n expect(confirmButton).to.be.not.null;\n expect(cancelButton).to.be.not.null;\n expect(secondaryButton).to.be.not.null;\n });\n it('validates variants', async () => {\n const el = await fixture<AlertDialog>(\n html`\n <sp-alert-dialog variant=\"invalid\">\n This Alert Dialog validates variants.\n </sp-alert-dialog>\n `\n );\n\n await elementUpdated(el);\n expect(el.variant).to.equal('');\n\n el.variant = alertDialogVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(alertDialogVariants[0]);\n\n el.variant = alertDialogVariants[0];\n\n await elementUpdated(el);\n expect(el.variant).to.equal(alertDialogVariants[0]);\n });\n it('does not recycle applied content ids', async () => {\n const el = await fixture<AlertDialog>(html`\n <sp-alert-dialog>\n <h2 slot=\"heading\">Disclaimer</h2>\n <p>Initial paragraph.</p>\n </sp-alert-dialog>\n `);\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n\n const paragraph = document.createElement('p');\n paragraph.textContent = 'Added paragraph.';\n\n const target = el.querySelector('p') as HTMLParagraphElement;\n target.insertAdjacentElement('beforebegin', paragraph);\n\n await nextFrame();\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,OAAO;AACP,SAAS,gBAAgB,QAAQ,SAAS,iBAAiB;AAC3D,SAAS,YAAY;AACrB,OAAO;AACP,OAAO;AACP;AAAA,EAEI;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,SAAS,eAAe,MAAM;AAC1B,KAAG,2CAA2C,YAAY;AACtD,UAAM,KAAK,MAAM,QAAqB,aAAa,CAAC;AACpD,UAAM,eAAe,EAAE;AACvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,8CAA8C,YAAY;AACzD,UAAM,KAAK,MAAM,QAAqB,QAAQ,CAAC;AAC/C,UAAM,eAAe,EAAE;AACvB,UAAM,YAAY,GAAG,WAAW,cAAc,eAAe;AAC7D,WAAO,SAAS,EAAE,GAAG,GAAG,IAAI;AAAA,EAChC,CAAC;AACD,KAAG,8EAA8E,YAAY;AACzF,UAAM,KAAK,MAAM,QAAqB,UAAU,CAAC;AACjD,UAAM,eAAe,EAAE;AACvB,UAAM,gBAAgB,GAAG,cAAc,gBAAgB;AACvD,UAAM,eAAe,GAAG,cAAc,eAAe;AACrD,UAAM,kBAAkB,GAAG,cAAc,kBAAkB;AAE3D,WAAO,aAAa,EAAE,GAAG,GAAG,IAAI;AAChC,WAAO,YAAY,EAAE,GAAG,GAAG,IAAI;AAC/B,WAAO,eAAe,EAAE,GAAG,GAAG,IAAI;AAAA,EACtC,CAAC;AACD,KAAG,sBAAsB,YAAY;AACjC,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ;AAEA,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE;AAE9B,OAAG,UAAU,oBAAoB,CAAC;AAElC,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,OAAO,EAAE,GAAG,MAAM,oBAAoB,CAAC,CAAC;AAElD,OAAG,UAAU,oBAAoB,CAAC;AAElC,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,OAAO,EAAE,GAAG,MAAM,oBAAoB,CAAC,CAAC;AAAA,EACtD,CAAC;AACD,KAAG,wCAAwC,YAAY;AACnD,UAAM,KAAK,MAAM,QAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,SAKrC;AACD,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAElC,UAAM,YAAY,SAAS,cAAc,GAAG;AAC5C,cAAU,cAAc;AAExB,UAAM,SAAS,GAAG,cAAc,GAAG;AACnC,WAAO,sBAAsB,eAAe,SAAS;AAErD,UAAM,UAAU;AAEhB,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
3
|
+
import "@spectrum-web-components/alert-dialog/sp-alert-dialog.js";
|
|
4
|
+
import { html } from "@spectrum-web-components/base";
|
|
5
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
6
|
+
measureFixtureCreation(html`
|
|
7
|
+
<sp-alert-dialog variant="confirmation">
|
|
8
|
+
<h2 slot="heading">Disclaimer</h2>
|
|
9
|
+
Smart filters are nondestructive and will preserve your original images.
|
|
10
|
+
<sp-button
|
|
11
|
+
slot="button"
|
|
12
|
+
id="cancelButton"
|
|
13
|
+
variant="secondary"
|
|
14
|
+
treatment="outline"
|
|
15
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
16
|
+
>
|
|
17
|
+
Cancel
|
|
18
|
+
</sp-button>
|
|
19
|
+
<sp-button
|
|
20
|
+
slot="button"
|
|
21
|
+
id="confirmButton"
|
|
22
|
+
variant="accent"
|
|
23
|
+
treatment="fill"
|
|
24
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
25
|
+
>
|
|
26
|
+
Enable
|
|
27
|
+
</sp-button>
|
|
28
|
+
</sp-alert-dialog>
|
|
29
|
+
`);
|
|
30
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["basic-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\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-alert-dialog variant=\"confirmation\">\n <h2 slot=\"heading\">Disclaimer</h2>\n Smart filters are nondestructive and will preserve your original images.\n <sp-button\n slot=\"button\"\n id=\"cancelButton\"\n variant=\"secondary\"\n treatment=\"outline\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Cancel\n </sp-button>\n <sp-button\n slot=\"button\"\n id=\"confirmButton\"\n variant=\"accent\"\n treatment=\"fill\"\n onclick=\"this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));\"\n >\n Enable\n </sp-button>\n </sp-alert-dialog>\n`);\n"],
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAuBtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|