@spectrum-web-components/alert-dialog 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +203 -0
- package/custom-elements.json +226 -0
- package/package.json +78 -0
- 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 +30 -0
- package/src/AlertDialog.dev.js +203 -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.css.d.ts +2 -0
- package/src/alert-dialog.css.dev.js +79 -0
- package/src/alert-dialog.css.dev.js.map +7 -0
- package/src/alert-dialog.css.js +76 -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 +79 -0
- package/src/spectrum-alert-dialog.css.dev.js.map +7 -0
- package/src/spectrum-alert-dialog.css.js +76 -0
- package/src/spectrum-alert-dialog.css.js.map +7 -0
- package/src/spectrum-config.js +52 -0
- package/stories/alert-dialog.stories.js +169 -0
- package/stories/alert-dialog.stories.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
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@spectrum-web-components/alert-dialog",
|
|
3
|
+
"version": "0.39.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Web component implementation of a Spectrum design AlertDialog",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/adobe/spectrum-web-components.git",
|
|
12
|
+
"directory": "packages/alert-dialog"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"homepage": "https://adobe.github.io/spectrum-web-components/components/alert-dialog",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/adobe/spectrum-web-components/issues"
|
|
18
|
+
},
|
|
19
|
+
"main": "./src/index.js",
|
|
20
|
+
"module": "./src/index.js",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./src/AlertDialog.js": {
|
|
29
|
+
"development": "./src/AlertDialog.dev.js",
|
|
30
|
+
"default": "./src/AlertDialog.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/alert-dialog.css.js": "./src/alert-dialog.css.js",
|
|
33
|
+
"./src/index.js": {
|
|
34
|
+
"development": "./src/index.dev.js",
|
|
35
|
+
"default": "./src/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./sp-alert-dialog.js": {
|
|
38
|
+
"development": "./sp-alert-dialog.dev.js",
|
|
39
|
+
"default": "./sp-alert-dialog.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"**/*.d.ts",
|
|
47
|
+
"**/*.js",
|
|
48
|
+
"**/*.js.map",
|
|
49
|
+
"custom-elements.json",
|
|
50
|
+
"!stories/",
|
|
51
|
+
"!test/"
|
|
52
|
+
],
|
|
53
|
+
"keywords": [
|
|
54
|
+
"spectrum css",
|
|
55
|
+
"web components",
|
|
56
|
+
"lit-element",
|
|
57
|
+
"lit-html"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@spectrum-web-components/base": "^0.39.0",
|
|
61
|
+
"@spectrum-web-components/button": "^0.39.0",
|
|
62
|
+
"@spectrum-web-components/button-group": "^0.39.0",
|
|
63
|
+
"@spectrum-web-components/divider": "^0.39.0",
|
|
64
|
+
"@spectrum-web-components/icons-workflow": "^0.39.0",
|
|
65
|
+
"@spectrum-web-components/shared": "^0.39.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@spectrum-css/alertdialog": "^1.0.6"
|
|
69
|
+
},
|
|
70
|
+
"types": "./src/index.d.ts",
|
|
71
|
+
"customElements": "custom-elements.json",
|
|
72
|
+
"sideEffects": [
|
|
73
|
+
"./sp-*.js",
|
|
74
|
+
"./**/*.dev.js",
|
|
75
|
+
"./**/*.dev.js"
|
|
76
|
+
],
|
|
77
|
+
"gitHead": "2acc8390ef0ac6cc940958d4da705c9859155c0d"
|
|
78
|
+
}
|
|
@@ -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,30 @@
|
|
|
1
|
+
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
import '@spectrum-web-components/button/sp-button.js';
|
|
3
|
+
export declare 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
|
+
_variant: AlertDialogVariants;
|
|
10
|
+
set variant(variant: AlertDialogVariants);
|
|
11
|
+
get variant(): AlertDialogVariants;
|
|
12
|
+
protected renderIcon(): TemplateResult;
|
|
13
|
+
protected renderHeading(): TemplateResult;
|
|
14
|
+
protected renderContent(): TemplateResult;
|
|
15
|
+
static instanceCount: number;
|
|
16
|
+
private labelledbyId;
|
|
17
|
+
private conditionLabelledby?;
|
|
18
|
+
private conditionDescribedby?;
|
|
19
|
+
private onHeadingSlotchange;
|
|
20
|
+
shouldManageTabOrderForScrolling: () => void;
|
|
21
|
+
private describedbyId;
|
|
22
|
+
protected onContentSlotChange({ target, }: Event & {
|
|
23
|
+
target: HTMLSlotElement;
|
|
24
|
+
}): void;
|
|
25
|
+
protected renderButtons(): TemplateResult;
|
|
26
|
+
protected render(): TemplateResult;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,203 @@
|
|
|
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)
|
|
10
|
+
__defProp(target, key, result);
|
|
11
|
+
return result;
|
|
12
|
+
};
|
|
13
|
+
import {
|
|
14
|
+
html,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import {
|
|
18
|
+
property,
|
|
19
|
+
query
|
|
20
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
21
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
22
|
+
import alertStyles from "./alert-dialog.css.js";
|
|
23
|
+
import { FocusVisiblePolyfillMixin } from "@spectrum-web-components/shared";
|
|
24
|
+
import { conditionAttributeWithId } from "@spectrum-web-components/base/src/condition-attribute-with-id.js";
|
|
25
|
+
export const alertDialogVariants = [
|
|
26
|
+
"confirmation",
|
|
27
|
+
"information",
|
|
28
|
+
"warning",
|
|
29
|
+
"error",
|
|
30
|
+
"destructive",
|
|
31
|
+
"secondary"
|
|
32
|
+
];
|
|
33
|
+
let appliedIds = 0;
|
|
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 + `-${appliedIds++}`;
|
|
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._variant = "";
|
|
52
|
+
this.labelledbyId = `sp-dialog-label-${_AlertDialog.instanceCount++}`;
|
|
53
|
+
this.shouldManageTabOrderForScrolling = () => {
|
|
54
|
+
const { offsetHeight, scrollHeight } = this.contentElement;
|
|
55
|
+
if (offsetHeight < scrollHeight) {
|
|
56
|
+
this.contentElement.tabIndex = 0;
|
|
57
|
+
} else {
|
|
58
|
+
this.contentElement.removeAttribute("tabindex");
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
this.describedbyId = `sp-dialog-description-${_AlertDialog.instanceCount++}`;
|
|
62
|
+
}
|
|
63
|
+
static get styles() {
|
|
64
|
+
return [alertStyles];
|
|
65
|
+
}
|
|
66
|
+
set variant(variant) {
|
|
67
|
+
if (variant === this.variant) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const oldValue = this.variant;
|
|
71
|
+
if (alertDialogVariants.includes(variant)) {
|
|
72
|
+
this.setAttribute("variant", variant);
|
|
73
|
+
this._variant = variant;
|
|
74
|
+
} else {
|
|
75
|
+
this.removeAttribute("variant");
|
|
76
|
+
this._variant = "";
|
|
77
|
+
}
|
|
78
|
+
this.requestUpdate("variant", oldValue);
|
|
79
|
+
}
|
|
80
|
+
get variant() {
|
|
81
|
+
return this._variant;
|
|
82
|
+
}
|
|
83
|
+
renderIcon() {
|
|
84
|
+
switch (this.variant) {
|
|
85
|
+
case "warning":
|
|
86
|
+
case "error":
|
|
87
|
+
return html`
|
|
88
|
+
<sp-icon-alert class="icon"></sp-icon-alert>
|
|
89
|
+
`;
|
|
90
|
+
default:
|
|
91
|
+
return html``;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
renderHeading() {
|
|
95
|
+
return html`
|
|
96
|
+
<slot name="heading" @slotchange=${this.onHeadingSlotchange}></slot>
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
renderContent() {
|
|
100
|
+
return html`
|
|
101
|
+
<div class="content">
|
|
102
|
+
<slot @slotchange=${this.onContentSlotChange}></slot>
|
|
103
|
+
</div>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
onHeadingSlotchange({
|
|
107
|
+
target
|
|
108
|
+
}) {
|
|
109
|
+
if (this.conditionLabelledby) {
|
|
110
|
+
this.conditionLabelledby();
|
|
111
|
+
delete this.conditionLabelledby;
|
|
112
|
+
}
|
|
113
|
+
const ids = gatherAppliedIdsFromSlottedChildren(
|
|
114
|
+
target,
|
|
115
|
+
this.labelledbyId
|
|
116
|
+
);
|
|
117
|
+
if (ids.length) {
|
|
118
|
+
this.conditionLabelledby = conditionAttributeWithId(
|
|
119
|
+
this,
|
|
120
|
+
"aria-labelledby",
|
|
121
|
+
ids
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
onContentSlotChange({
|
|
126
|
+
target
|
|
127
|
+
}) {
|
|
128
|
+
requestAnimationFrame(() => {
|
|
129
|
+
this.shouldManageTabOrderForScrolling();
|
|
130
|
+
});
|
|
131
|
+
if (this.conditionDescribedby) {
|
|
132
|
+
this.conditionDescribedby();
|
|
133
|
+
delete this.conditionDescribedby;
|
|
134
|
+
}
|
|
135
|
+
const ids = gatherAppliedIdsFromSlottedChildren(
|
|
136
|
+
target,
|
|
137
|
+
this.describedbyId
|
|
138
|
+
);
|
|
139
|
+
if (ids.length && ids.length < 4) {
|
|
140
|
+
this.conditionDescribedby = conditionAttributeWithId(
|
|
141
|
+
this,
|
|
142
|
+
"aria-describedby",
|
|
143
|
+
ids
|
|
144
|
+
);
|
|
145
|
+
} else if (!ids.length) {
|
|
146
|
+
const idProvided = !!this.id;
|
|
147
|
+
if (!idProvided)
|
|
148
|
+
this.id = this.describedbyId;
|
|
149
|
+
const conditionDescribedby = conditionAttributeWithId(
|
|
150
|
+
this,
|
|
151
|
+
"aria-describedby",
|
|
152
|
+
this.id
|
|
153
|
+
);
|
|
154
|
+
this.conditionDescribedby = () => {
|
|
155
|
+
conditionDescribedby();
|
|
156
|
+
if (!idProvided) {
|
|
157
|
+
this.removeAttribute("id");
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
renderButtons() {
|
|
163
|
+
return html`
|
|
164
|
+
<sp-button-group class="button-group">
|
|
165
|
+
<slot name="button"></slot>
|
|
166
|
+
</sp-button-group>
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
render() {
|
|
170
|
+
return html`
|
|
171
|
+
<div class="grid">
|
|
172
|
+
<div class="header">
|
|
173
|
+
${this.renderHeading()} ${this.renderIcon()}
|
|
174
|
+
</div>
|
|
175
|
+
<sp-divider size="m" class="divider"></sp-divider>
|
|
176
|
+
${this.renderContent()} ${this.renderButtons()}
|
|
177
|
+
</div>
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
connectedCallback() {
|
|
181
|
+
super.connectedCallback();
|
|
182
|
+
window.addEventListener(
|
|
183
|
+
"resize",
|
|
184
|
+
this.shouldManageTabOrderForScrolling
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
disconnectedCallback() {
|
|
188
|
+
window.removeEventListener(
|
|
189
|
+
"resize",
|
|
190
|
+
this.shouldManageTabOrderForScrolling
|
|
191
|
+
);
|
|
192
|
+
super.disconnectedCallback();
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
_AlertDialog.instanceCount = 0;
|
|
196
|
+
__decorateClass([
|
|
197
|
+
query(".content")
|
|
198
|
+
], _AlertDialog.prototype, "contentElement", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property({ type: String, reflect: true })
|
|
201
|
+
], _AlertDialog.prototype, "variant", 1);
|
|
202
|
+
export let AlertDialog = _AlertDialog;
|
|
203
|
+
//# 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 alertStyles from './alert-dialog.css.js';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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\nlet appliedIds = 0;\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 + `-${appliedIds++}`;\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 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 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 // Content must be available _AND_ styles must be applied.\n this.shouldManageTabOrderForScrolling();\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 public override connectedCallback(): void {\n super.connectedCallback();\n window.addEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n }\n\n public override disconnectedCallback(): void {\n window.removeEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(d,r,t,e)=>{for(var i=e>1?void 0:e?u(r,t):r,n=d.length-1,a;n>=0;n--)(a=d[n])&&(i=(e?a(r,t,i):a(i))||i);return e&&i&&h(r,t,i),i};import{html as o,SpectrumElement as p}from"@spectrum-web-components/base";import{property as g,query as v}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/button/sp-button.js";import m from"./alert-dialog.css.js";import{FocusVisiblePolyfillMixin as y}from"@spectrum-web-components/shared";import{conditionAttributeWithId as c}from"@spectrum-web-components/base/src/condition-attribute-with-id.js";export const alertDialogVariants=["confirmation","information","warning","error","destructive","secondary"];let f=0;function b(d,r){const t=d.assignedElements(),e=[];return t.forEach(i=>{if(i.id)e.push(i.id);else{const n=r+`-${f++}`;i.id=n,e.push(n)}}),e}const s=class s extends y(p){constructor(){super(...arguments);this._variant="";this.labelledbyId=`sp-dialog-label-${s.instanceCount++}`;this.shouldManageTabOrderForScrolling=()=>{const{offsetHeight:t,scrollHeight:e}=this.contentElement;t<e?this.contentElement.tabIndex=0:this.contentElement.removeAttribute("tabindex")};this.describedbyId=`sp-dialog-description-${s.instanceCount++}`}static get styles(){return[m]}set variant(t){if(t===this.variant)return;const e=this.variant;alertDialogVariants.includes(t)?(this.setAttribute("variant",t),this._variant=t):(this.removeAttribute("variant"),this._variant=""),this.requestUpdate("variant",e)}get variant(){return this._variant}renderIcon(){switch(this.variant){case"warning":case"error":return o`
|
|
2
|
+
<sp-icon-alert class="icon"></sp-icon-alert>
|
|
3
|
+
`;default:return o``}}renderHeading(){return o`
|
|
4
|
+
<slot name="heading" @slotchange=${this.onHeadingSlotchange}></slot>
|
|
5
|
+
`}renderContent(){return o`
|
|
6
|
+
<div class="content">
|
|
7
|
+
<slot @slotchange=${this.onContentSlotChange}></slot>
|
|
8
|
+
</div>
|
|
9
|
+
`}onHeadingSlotchange({target:t}){this.conditionLabelledby&&(this.conditionLabelledby(),delete this.conditionLabelledby);const e=b(t,this.labelledbyId);e.length&&(this.conditionLabelledby=c(this,"aria-labelledby",e))}onContentSlotChange({target:t}){requestAnimationFrame(()=>{this.shouldManageTabOrderForScrolling()}),this.conditionDescribedby&&(this.conditionDescribedby(),delete this.conditionDescribedby);const e=b(t,this.describedbyId);if(e.length&&e.length<4)this.conditionDescribedby=c(this,"aria-describedby",e);else if(!e.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 o`
|
|
10
|
+
<sp-button-group class="button-group">
|
|
11
|
+
<slot name="button"></slot>
|
|
12
|
+
</sp-button-group>
|
|
13
|
+
`}render(){return o`
|
|
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
|
+
`}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.shouldManageTabOrderForScrolling)}disconnectedCallback(){window.removeEventListener("resize",this.shouldManageTabOrderForScrolling),super.disconnectedCallback()}};s.instanceCount=0,l([v(".content")],s.prototype,"contentElement",2),l([g({type:String,reflect:!0})],s.prototype,"variant",1);export let AlertDialog=s;
|
|
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 alertStyles from './alert-dialog.css.js';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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\nlet appliedIds = 0;\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 + `-${appliedIds++}`;\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 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 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 // Content must be available _AND_ styles must be applied.\n this.shouldManageTabOrderForScrolling();\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 public override connectedCallback(): void {\n super.connectedCallback();\n window.addEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n }\n\n public override disconnectedCallback(): void {\n window.removeEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["html", "SpectrumElement", "property", "query", "alertStyles", "FocusVisiblePolyfillMixin", "conditionAttributeWithId", "appliedIds", "gatherAppliedIdsFromSlottedChildren", "slot", "idBase", "assignedElements", "ids", "el", "id", "_AlertDialog", "offsetHeight", "scrollHeight", "variant", "oldValue", "target", "idProvided", "conditionDescribedby", "__decorateClass"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{--spectrum-alert-dialog-min-width:var(
|
|
5
|
+
--spectrum-alert-dialog-minimum-width
|
|
6
|
+
);--spectrum-alert-dialog-max-width:var(
|
|
7
|
+
--spectrum-alert-dialog-maximum-width
|
|
8
|
+
);--spectrum-alert-dialog-icon-size:var(--spectrum-workflow-icon-size-100);--spectrum-alert-dialog-warning-icon-color:var(
|
|
9
|
+
--spectrum-notice-visual-color
|
|
10
|
+
);--spectrum-alert-dialog-error-icon-color:var(
|
|
11
|
+
--spectrum-negative-visual-color
|
|
12
|
+
);--spectrum-alert-dialog-title-font-family:var(
|
|
13
|
+
--spectrum-sans-font-family-stack
|
|
14
|
+
);--spectrum-alert-dialog-title-font-weight:var(
|
|
15
|
+
--spectrum-heading-sans-serif-font-weight
|
|
16
|
+
);--spectrum-alert-dialog-title-font-style:var(
|
|
17
|
+
--spectrum-heading-sans-serif-font-style
|
|
18
|
+
);--spectrum-alert-dialog-title-font-size:var(
|
|
19
|
+
--spectrum-alert-dialog-title-size
|
|
20
|
+
);--spectrum-alert-dialog-title-line-height:var(
|
|
21
|
+
--spectrum-heading-line-height
|
|
22
|
+
);--spectrum-alert-dialog-title-color:var(--spectrum-heading-color);--spectrum-alert-dialog-body-font-family:var(
|
|
23
|
+
--spectrum-sans-font-family-stack
|
|
24
|
+
);--spectrum-alert-dialog-body-font-weight:var(
|
|
25
|
+
--spectrum-body-sans-serif-font-weight
|
|
26
|
+
);--spectrum-alert-dialog-body-font-style:var(
|
|
27
|
+
--spectrum-body-sans-serif-font-style
|
|
28
|
+
);--spectrum-alert-dialog-body-font-size:var(
|
|
29
|
+
--spectrum-alert-dialog-description-size
|
|
30
|
+
);--spectrum-alert-dialog-body-line-height:var(--spectrum-line-height-100);--spectrum-alert-dialog-body-color:var(--spectrum-body-color);--spectrum-alert-dialog-title-to-divider:var(--spectrum-spacing-200);--spectrum-alert-dialog-divider-to-description:var(--spectrum-spacing-300);--spectrum-alert-dialog-title-to-icon:var(--spectrum-spacing-300);--mod-buttongroup-justify-content:flex-end}:host{box-sizing:border-box;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;max-inline-size:var(
|
|
31
|
+
--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width)
|
|
32
|
+
);max-height:inherit;min-inline-size:var(
|
|
33
|
+
--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width)
|
|
34
|
+
);outline:none;padding:var(
|
|
35
|
+
--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding)
|
|
36
|
+
)}.icon{block-size:var(
|
|
37
|
+
--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)
|
|
38
|
+
);flex-shrink:0;inline-size:var(
|
|
39
|
+
--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)
|
|
40
|
+
);margin-left:var(
|
|
41
|
+
--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon)
|
|
42
|
+
)}:host([variant=warning]){--mod-icon-color:var(
|
|
43
|
+
--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color)
|
|
44
|
+
)}:host([variant=error]){--mod-icon-color:var(
|
|
45
|
+
--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color)
|
|
46
|
+
)}.grid{display:grid}.header{align-items:baseline;display:flex;justify-content:space-between}::slotted([slot=heading]){color:var(
|
|
47
|
+
--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color)
|
|
48
|
+
);font-family:var(
|
|
49
|
+
--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family)
|
|
50
|
+
);font-size:var(
|
|
51
|
+
--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size)
|
|
52
|
+
);font-style:var(
|
|
53
|
+
--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style)
|
|
54
|
+
);font-weight:var(
|
|
55
|
+
--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight)
|
|
56
|
+
);line-height:var(
|
|
57
|
+
--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height)
|
|
58
|
+
);margin:0;margin-block-end:var(
|
|
59
|
+
--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider)
|
|
60
|
+
)}.content{-webkit-overflow-scrolling:touch;color:var(
|
|
61
|
+
--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color)
|
|
62
|
+
);font-family:var(
|
|
63
|
+
--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family)
|
|
64
|
+
);font-size:var(
|
|
65
|
+
--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size)
|
|
66
|
+
);font-style:var(
|
|
67
|
+
--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style)
|
|
68
|
+
);font-weight:var(
|
|
69
|
+
--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight)
|
|
70
|
+
);line-height:var(
|
|
71
|
+
--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height)
|
|
72
|
+
);margin:0;margin-block-end:var(
|
|
73
|
+
--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons)
|
|
74
|
+
);margin-block-start:var(
|
|
75
|
+
--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description)
|
|
76
|
+
);overflow-y:auto}@media (forced-colors:active){:host{border:solid}}
|
|
77
|
+
`;
|
|
78
|
+
export default styles;
|
|
79
|
+
//# sourceMappingURL=alert-dialog.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-alert-dialog-min-width:var(\n--spectrum-alert-dialog-minimum-width\n);--spectrum-alert-dialog-max-width:var(\n--spectrum-alert-dialog-maximum-width\n);--spectrum-alert-dialog-icon-size:var(--spectrum-workflow-icon-size-100);--spectrum-alert-dialog-warning-icon-color:var(\n--spectrum-notice-visual-color\n);--spectrum-alert-dialog-error-icon-color:var(\n--spectrum-negative-visual-color\n);--spectrum-alert-dialog-title-font-family:var(\n--spectrum-sans-font-family-stack\n);--spectrum-alert-dialog-title-font-weight:var(\n--spectrum-heading-sans-serif-font-weight\n);--spectrum-alert-dialog-title-font-style:var(\n--spectrum-heading-sans-serif-font-style\n);--spectrum-alert-dialog-title-font-size:var(\n--spectrum-alert-dialog-title-size\n);--spectrum-alert-dialog-title-line-height:var(\n--spectrum-heading-line-height\n);--spectrum-alert-dialog-title-color:var(--spectrum-heading-color);--spectrum-alert-dialog-body-font-family:var(\n--spectrum-sans-font-family-stack\n);--spectrum-alert-dialog-body-font-weight:var(\n--spectrum-body-sans-serif-font-weight\n);--spectrum-alert-dialog-body-font-style:var(\n--spectrum-body-sans-serif-font-style\n);--spectrum-alert-dialog-body-font-size:var(\n--spectrum-alert-dialog-description-size\n);--spectrum-alert-dialog-body-line-height:var(--spectrum-line-height-100);--spectrum-alert-dialog-body-color:var(--spectrum-body-color);--spectrum-alert-dialog-title-to-divider:var(--spectrum-spacing-200);--spectrum-alert-dialog-divider-to-description:var(--spectrum-spacing-300);--spectrum-alert-dialog-title-to-icon:var(--spectrum-spacing-300);--mod-buttongroup-justify-content:flex-end}:host{box-sizing:border-box;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;max-inline-size:var(\n--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width)\n);max-height:inherit;min-inline-size:var(\n--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width)\n);outline:none;padding:var(\n--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding)\n)}.icon{block-size:var(\n--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)\n);flex-shrink:0;inline-size:var(\n--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)\n);margin-left:var(\n--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon)\n)}:host([variant=warning]){--mod-icon-color:var(\n--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color)\n)}:host([variant=error]){--mod-icon-color:var(\n--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color)\n)}.grid{display:grid}.header{align-items:baseline;display:flex;justify-content:space-between}::slotted([slot=heading]){color:var(\n--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color)\n);font-family:var(\n--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family)\n);font-size:var(\n--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size)\n);font-style:var(\n--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style)\n);font-weight:var(\n--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight)\n);line-height:var(\n--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height)\n);margin:0;margin-block-end:var(\n--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider)\n)}.content{-webkit-overflow-scrolling:touch;color:var(\n--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color)\n);font-family:var(\n--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family)\n);font-size:var(\n--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size)\n);font-style:var(\n--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style)\n);font-weight:var(\n--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight)\n);line-height:var(\n--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height)\n);margin:0;margin-block-end:var(\n--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons)\n);margin-block-start:var(\n--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description)\n);overflow-y:auto}@media (forced-colors:active){:host{border:solid}}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Ef,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const e=t`
|
|
2
|
+
:host{--spectrum-alert-dialog-min-width:var(
|
|
3
|
+
--spectrum-alert-dialog-minimum-width
|
|
4
|
+
);--spectrum-alert-dialog-max-width:var(
|
|
5
|
+
--spectrum-alert-dialog-maximum-width
|
|
6
|
+
);--spectrum-alert-dialog-icon-size:var(--spectrum-workflow-icon-size-100);--spectrum-alert-dialog-warning-icon-color:var(
|
|
7
|
+
--spectrum-notice-visual-color
|
|
8
|
+
);--spectrum-alert-dialog-error-icon-color:var(
|
|
9
|
+
--spectrum-negative-visual-color
|
|
10
|
+
);--spectrum-alert-dialog-title-font-family:var(
|
|
11
|
+
--spectrum-sans-font-family-stack
|
|
12
|
+
);--spectrum-alert-dialog-title-font-weight:var(
|
|
13
|
+
--spectrum-heading-sans-serif-font-weight
|
|
14
|
+
);--spectrum-alert-dialog-title-font-style:var(
|
|
15
|
+
--spectrum-heading-sans-serif-font-style
|
|
16
|
+
);--spectrum-alert-dialog-title-font-size:var(
|
|
17
|
+
--spectrum-alert-dialog-title-size
|
|
18
|
+
);--spectrum-alert-dialog-title-line-height:var(
|
|
19
|
+
--spectrum-heading-line-height
|
|
20
|
+
);--spectrum-alert-dialog-title-color:var(--spectrum-heading-color);--spectrum-alert-dialog-body-font-family:var(
|
|
21
|
+
--spectrum-sans-font-family-stack
|
|
22
|
+
);--spectrum-alert-dialog-body-font-weight:var(
|
|
23
|
+
--spectrum-body-sans-serif-font-weight
|
|
24
|
+
);--spectrum-alert-dialog-body-font-style:var(
|
|
25
|
+
--spectrum-body-sans-serif-font-style
|
|
26
|
+
);--spectrum-alert-dialog-body-font-size:var(
|
|
27
|
+
--spectrum-alert-dialog-description-size
|
|
28
|
+
);--spectrum-alert-dialog-body-line-height:var(--spectrum-line-height-100);--spectrum-alert-dialog-body-color:var(--spectrum-body-color);--spectrum-alert-dialog-title-to-divider:var(--spectrum-spacing-200);--spectrum-alert-dialog-divider-to-description:var(--spectrum-spacing-300);--spectrum-alert-dialog-title-to-icon:var(--spectrum-spacing-300);--mod-buttongroup-justify-content:flex-end}:host{box-sizing:border-box;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;max-inline-size:var(
|
|
29
|
+
--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width)
|
|
30
|
+
);max-height:inherit;min-inline-size:var(
|
|
31
|
+
--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width)
|
|
32
|
+
);outline:none;padding:var(
|
|
33
|
+
--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding)
|
|
34
|
+
)}.icon{block-size:var(
|
|
35
|
+
--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)
|
|
36
|
+
);flex-shrink:0;inline-size:var(
|
|
37
|
+
--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)
|
|
38
|
+
);margin-left:var(
|
|
39
|
+
--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon)
|
|
40
|
+
)}:host([variant=warning]){--mod-icon-color:var(
|
|
41
|
+
--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color)
|
|
42
|
+
)}:host([variant=error]){--mod-icon-color:var(
|
|
43
|
+
--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color)
|
|
44
|
+
)}.grid{display:grid}.header{align-items:baseline;display:flex;justify-content:space-between}::slotted([slot=heading]){color:var(
|
|
45
|
+
--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color)
|
|
46
|
+
);font-family:var(
|
|
47
|
+
--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family)
|
|
48
|
+
);font-size:var(
|
|
49
|
+
--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size)
|
|
50
|
+
);font-style:var(
|
|
51
|
+
--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style)
|
|
52
|
+
);font-weight:var(
|
|
53
|
+
--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight)
|
|
54
|
+
);line-height:var(
|
|
55
|
+
--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height)
|
|
56
|
+
);margin:0;margin-block-end:var(
|
|
57
|
+
--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider)
|
|
58
|
+
)}.content{-webkit-overflow-scrolling:touch;color:var(
|
|
59
|
+
--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color)
|
|
60
|
+
);font-family:var(
|
|
61
|
+
--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family)
|
|
62
|
+
);font-size:var(
|
|
63
|
+
--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size)
|
|
64
|
+
);font-style:var(
|
|
65
|
+
--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style)
|
|
66
|
+
);font-weight:var(
|
|
67
|
+
--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight)
|
|
68
|
+
);line-height:var(
|
|
69
|
+
--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height)
|
|
70
|
+
);margin:0;margin-block-end:var(
|
|
71
|
+
--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons)
|
|
72
|
+
);margin-block-start:var(
|
|
73
|
+
--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description)
|
|
74
|
+
);overflow-y:auto}@media (forced-colors:active){:host{border:solid}}
|
|
75
|
+
`;export default e;
|
|
76
|
+
//# sourceMappingURL=alert-dialog.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["alert-dialog.css.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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-alert-dialog-min-width:var(\n--spectrum-alert-dialog-minimum-width\n);--spectrum-alert-dialog-max-width:var(\n--spectrum-alert-dialog-maximum-width\n);--spectrum-alert-dialog-icon-size:var(--spectrum-workflow-icon-size-100);--spectrum-alert-dialog-warning-icon-color:var(\n--spectrum-notice-visual-color\n);--spectrum-alert-dialog-error-icon-color:var(\n--spectrum-negative-visual-color\n);--spectrum-alert-dialog-title-font-family:var(\n--spectrum-sans-font-family-stack\n);--spectrum-alert-dialog-title-font-weight:var(\n--spectrum-heading-sans-serif-font-weight\n);--spectrum-alert-dialog-title-font-style:var(\n--spectrum-heading-sans-serif-font-style\n);--spectrum-alert-dialog-title-font-size:var(\n--spectrum-alert-dialog-title-size\n);--spectrum-alert-dialog-title-line-height:var(\n--spectrum-heading-line-height\n);--spectrum-alert-dialog-title-color:var(--spectrum-heading-color);--spectrum-alert-dialog-body-font-family:var(\n--spectrum-sans-font-family-stack\n);--spectrum-alert-dialog-body-font-weight:var(\n--spectrum-body-sans-serif-font-weight\n);--spectrum-alert-dialog-body-font-style:var(\n--spectrum-body-sans-serif-font-style\n);--spectrum-alert-dialog-body-font-size:var(\n--spectrum-alert-dialog-description-size\n);--spectrum-alert-dialog-body-line-height:var(--spectrum-line-height-100);--spectrum-alert-dialog-body-color:var(--spectrum-body-color);--spectrum-alert-dialog-title-to-divider:var(--spectrum-spacing-200);--spectrum-alert-dialog-divider-to-description:var(--spectrum-spacing-300);--spectrum-alert-dialog-title-to-icon:var(--spectrum-spacing-300);--mod-buttongroup-justify-content:flex-end}:host{box-sizing:border-box;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;max-inline-size:var(\n--mod-alert-dialog-max-width,var(--spectrum-alert-dialog-max-width)\n);max-height:inherit;min-inline-size:var(\n--mod-alert-dialog-min-width,var(--spectrum-alert-dialog-min-width)\n);outline:none;padding:var(\n--mod-alert-dialog-padding,var(--spectrum-alert-dialog-padding)\n)}.icon{block-size:var(\n--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)\n);flex-shrink:0;inline-size:var(\n--mod-alert-dialog-icon-size,var(--spectrum-alert-dialog-icon-size)\n);margin-left:var(\n--mod-alert-dialog-title-to-icon,var(--spectrum-alert-dialog-title-to-icon)\n)}:host([variant=warning]){--mod-icon-color:var(\n--mod-alert-dialog-warning-icon-color,var(--spectrum-alert-dialog-warning-icon-color)\n)}:host([variant=error]){--mod-icon-color:var(\n--mod-alert-dialog-error-icon-color,var(--spectrum-alert-dialog-error-icon-color)\n)}.grid{display:grid}.header{align-items:baseline;display:flex;justify-content:space-between}::slotted([slot=heading]){color:var(\n--mod-alert-dialog-title-color,var(--spectrum-alert-dialog-title-color)\n);font-family:var(\n--mod-alert-dialog-title-font-family,var(--spectrum-alert-dialog-title-font-family)\n);font-size:var(\n--mod-alert-dialog-title-font-size,var(--spectrum-alert-dialog-title-font-size)\n);font-style:var(\n--mod-alert-dialog-title-font-style,var(--spectrum-alert-dialog-title-font-style)\n);font-weight:var(\n--mod-alert-dialog-title-font-weight,var(--spectrum-alert-dialog-title-font-weight)\n);line-height:var(\n--mod-alert-dialog-title-line-height,var(--spectrum-alert-dialog-title-line-height)\n);margin:0;margin-block-end:var(\n--mod-alert-dialog-title-to-divider,var(--spectrum-alert-dialog-title-to-divider)\n)}.content{-webkit-overflow-scrolling:touch;color:var(\n--mod-alert-dialog-body-color,var(--spectrum-alert-dialog-body-color)\n);font-family:var(\n--mod-alert-dialog-body-font-family,var(--spectrum-alert-dialog-body-font-family)\n);font-size:var(\n--mod-alert-dialog-body-font-size,var(--spectrum-alert-dialog-body-font-size)\n);font-style:var(\n--mod-alert-dialog-body-font-style,var(--spectrum-alert-dialog-body-font-style)\n);font-weight:var(\n--mod-alert-dialog-body-font-weight,var(--spectrum-alert-dialog-body-font-weight)\n);line-height:var(\n--mod-alert-dialog-body-line-height,var(--spectrum-alert-dialog-body-line-height)\n);margin:0;margin-block-end:var(\n--mod-alert-dialog-description-to-buttons,var(--spectrum-alert-dialog-description-to-buttons)\n);margin-block-start:var(\n--mod-alert-dialog-divider-to-description,var(--spectrum-alert-dialog-divider-to-description)\n);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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2Ef,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