@spectrum-web-components/alert-dialog 0.0.0-20241209155954
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/README.md +203 -0
- package/package.json +79 -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 +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/src/spectrum-config.js +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
`sp-alert-dialog` displays important information that users need to acknowledge. When used directly the `sp-alert-dialog` element surfaces a `slot` based API for deep customization of the content to be included in the overlay.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@spectrum-web-components/alert-dialog)
|
|
8
|
+
[](https://bundlephobia.com/result?p=@spectrum-web-components/alert-dialog)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
yarn add @spectrum-web-components/alert-dialog
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Import the side effectful registration of `<sp-alert-dialog>` via:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
import '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
When looking to leverage the `AlertDialog` base class as a type and/or for extension purposes, do so via:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
import { AlertDialog } from '@spectrum-web-components/alert-dialog';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Variants
|
|
27
|
+
|
|
28
|
+
### Confirmation
|
|
29
|
+
|
|
30
|
+
This is the default variant for alert dialogs. Use a confirmation variant for asking a user to confirm a choice.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<sp-alert-dialog variant="confirmation">
|
|
34
|
+
<h2 slot="heading">Disclaimer</h2>
|
|
35
|
+
Smart filters are nondestructive and will preserve your original images.
|
|
36
|
+
<sp-button
|
|
37
|
+
slot="button"
|
|
38
|
+
id="cancelButton"
|
|
39
|
+
variant="secondary"
|
|
40
|
+
treatment="outline"
|
|
41
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
42
|
+
>
|
|
43
|
+
Cancel
|
|
44
|
+
</sp-button>
|
|
45
|
+
<sp-button
|
|
46
|
+
slot="button"
|
|
47
|
+
id="confirmButton"
|
|
48
|
+
variant="accent"
|
|
49
|
+
treatment="fill"
|
|
50
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
51
|
+
>
|
|
52
|
+
Enable
|
|
53
|
+
</sp-button>
|
|
54
|
+
</sp-alert-dialog>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Information
|
|
58
|
+
|
|
59
|
+
Information alert dialogs communicate important information that a user needs to acknowledge. Before using this kind of alert dialog, make sure it’s the appropriate communication channel for the message instead of a toast or a more lightweight messaging option.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<sp-alert-dialog variant="information">
|
|
63
|
+
<h2 slot="heading">Connect to wifi</h2>
|
|
64
|
+
Please connect to wifi to sync your projects or go to Settings to change
|
|
65
|
+
your preferences.
|
|
66
|
+
<sp-button
|
|
67
|
+
slot="button"
|
|
68
|
+
id="cancelButton"
|
|
69
|
+
variant="secondary"
|
|
70
|
+
treatment="outline"
|
|
71
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
72
|
+
>
|
|
73
|
+
Cancel
|
|
74
|
+
</sp-button>
|
|
75
|
+
<sp-button
|
|
76
|
+
slot="button"
|
|
77
|
+
id="confirmButton"
|
|
78
|
+
variant="primary"
|
|
79
|
+
treatment="outline"
|
|
80
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
81
|
+
>
|
|
82
|
+
Continue
|
|
83
|
+
</sp-button>
|
|
84
|
+
</sp-alert-dialog>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Warning
|
|
88
|
+
|
|
89
|
+
Warning alert dialogs communicate important information to users in relation to an issue that needs to be acknowledged, but does not block the user from moving forward.
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<sp-alert-dialog variant="warning">
|
|
93
|
+
<h2 slot="heading">Unverified format</h2>
|
|
94
|
+
This format has not been verified and may not be viewable for some users. Do
|
|
95
|
+
you want to continue publishing?
|
|
96
|
+
<sp-button
|
|
97
|
+
slot="button"
|
|
98
|
+
id="cancelButton"
|
|
99
|
+
variant="secondary"
|
|
100
|
+
treatment="outline"
|
|
101
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
102
|
+
>
|
|
103
|
+
Cancel
|
|
104
|
+
</sp-button>
|
|
105
|
+
<sp-button
|
|
106
|
+
slot="button"
|
|
107
|
+
id="confirmButton"
|
|
108
|
+
variant="primary"
|
|
109
|
+
treatment="outline"
|
|
110
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
111
|
+
>
|
|
112
|
+
Continue
|
|
113
|
+
</sp-button>
|
|
114
|
+
</sp-alert-dialog>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Error
|
|
118
|
+
|
|
119
|
+
Error alert dialogs communicate critical information about an issue that a user needs to acknowledge.
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<sp-alert-dialog variant="error">
|
|
123
|
+
<h2 slot="heading">Unable to share</h2>
|
|
124
|
+
An error occured while sharing your project. Please verify the email address
|
|
125
|
+
and try again.
|
|
126
|
+
<sp-button
|
|
127
|
+
slot="button"
|
|
128
|
+
id="confirmButton"
|
|
129
|
+
variant="primary"
|
|
130
|
+
treatment="outline"
|
|
131
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
132
|
+
>
|
|
133
|
+
Continue
|
|
134
|
+
</sp-button>
|
|
135
|
+
</sp-alert-dialog>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Destructive
|
|
139
|
+
|
|
140
|
+
Destructive alert dialogs are for when a user needs to confirm an action that will impact their data or experience in a potentially negative way, such as deleting files or contacts.
|
|
141
|
+
|
|
142
|
+
```html
|
|
143
|
+
<sp-alert-dialog variant="destructive">
|
|
144
|
+
<h2 slot="heading">Delete 3 documents?</h2>
|
|
145
|
+
Are you sure you want to delete the 3 selected documents?
|
|
146
|
+
<sp-button
|
|
147
|
+
slot="button"
|
|
148
|
+
id="cancelButton"
|
|
149
|
+
variant="secondary"
|
|
150
|
+
treatment="outline"
|
|
151
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
152
|
+
>
|
|
153
|
+
Cancel
|
|
154
|
+
</sp-button>
|
|
155
|
+
<sp-button
|
|
156
|
+
slot="button"
|
|
157
|
+
id="confirmButton"
|
|
158
|
+
variant="negative"
|
|
159
|
+
treatment="fill"
|
|
160
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
161
|
+
>
|
|
162
|
+
Delete
|
|
163
|
+
</sp-button>
|
|
164
|
+
</sp-alert-dialog>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Secondary Button
|
|
168
|
+
|
|
169
|
+
An alert dialog can have a total of 3 buttons if the secondary outline button label is defined.
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<sp-alert-dialog variant="secondary">
|
|
173
|
+
<h2 slot="heading">Rate this app</h2>
|
|
174
|
+
If you enjoy our app, would you mind taking a moment to rate it?
|
|
175
|
+
<sp-button
|
|
176
|
+
slot="button"
|
|
177
|
+
id="secondaryButton"
|
|
178
|
+
variant="secondary"
|
|
179
|
+
treatment="outline"
|
|
180
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
181
|
+
>
|
|
182
|
+
No, thanks
|
|
183
|
+
</sp-button>
|
|
184
|
+
<sp-button
|
|
185
|
+
slot="button"
|
|
186
|
+
id="cancelButton"
|
|
187
|
+
variant="secondary"
|
|
188
|
+
treatment="outline"
|
|
189
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
190
|
+
>
|
|
191
|
+
Remind me later
|
|
192
|
+
</sp-button>
|
|
193
|
+
<sp-button
|
|
194
|
+
slot="button"
|
|
195
|
+
id="confirmButton"
|
|
196
|
+
variant="primary"
|
|
197
|
+
treatment="outline"
|
|
198
|
+
onclick="this.dispatchEvent(new Event('close', { bubbles: true, composed: true }));"
|
|
199
|
+
>
|
|
200
|
+
Rate now
|
|
201
|
+
</sp-button>
|
|
202
|
+
</sp-alert-dialog>
|
|
203
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@spectrum-web-components/alert-dialog",
|
|
3
|
+
"version": "0.0.0-20241209155954",
|
|
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-overrides.css.js": "./src/alert-dialog-overrides.css.js",
|
|
33
|
+
"./src/alert-dialog.css.js": "./src/alert-dialog.css.js",
|
|
34
|
+
"./src/index.js": {
|
|
35
|
+
"development": "./src/index.dev.js",
|
|
36
|
+
"default": "./src/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./sp-alert-dialog.js": {
|
|
39
|
+
"development": "./sp-alert-dialog.dev.js",
|
|
40
|
+
"default": "./sp-alert-dialog.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"**/*.d.ts",
|
|
48
|
+
"**/*.js",
|
|
49
|
+
"**/*.js.map",
|
|
50
|
+
"custom-elements.json",
|
|
51
|
+
"!stories/",
|
|
52
|
+
"!test/"
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"spectrum css",
|
|
56
|
+
"web components",
|
|
57
|
+
"lit-element",
|
|
58
|
+
"lit-html"
|
|
59
|
+
],
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@lit-labs/observers": "^2.0.2",
|
|
62
|
+
"@spectrum-web-components/base": "0.0.0-20241209155954",
|
|
63
|
+
"@spectrum-web-components/button": "0.0.0-20241209155954",
|
|
64
|
+
"@spectrum-web-components/button-group": "0.0.0-20241209155954",
|
|
65
|
+
"@spectrum-web-components/divider": "0.0.0-20241209155954",
|
|
66
|
+
"@spectrum-web-components/icons-workflow": "0.0.0-20241209155954",
|
|
67
|
+
"@spectrum-web-components/shared": "0.0.0-20241209155954"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@spectrum-css/alertdialog": "^3.0.0-s2-foundations.15"
|
|
71
|
+
},
|
|
72
|
+
"types": "./src/index.d.ts",
|
|
73
|
+
"customElements": "custom-elements.json",
|
|
74
|
+
"sideEffects": [
|
|
75
|
+
"./sp-*.js",
|
|
76
|
+
"./**/*.dev.js",
|
|
77
|
+
"./**/*.dev.js"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :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,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// @ts-check
|
|
13
|
+
|
|
14
|
+
import { converterFor } from '../../../tasks/process-spectrum-utils.js';
|
|
15
|
+
|
|
16
|
+
const converter = converterFor('spectrum-AlertDialog');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @type { import('../../../tasks/spectrum-css-converter').SpectrumCSSConverter }
|
|
20
|
+
*/
|
|
21
|
+
const config = {
|
|
22
|
+
conversions: [
|
|
23
|
+
{
|
|
24
|
+
inPackage: '@spectrum-css/alertdialog',
|
|
25
|
+
outPackage: 'alert-dialog',
|
|
26
|
+
fileName: 'alert-dialog',
|
|
27
|
+
components: [
|
|
28
|
+
converter.classToHost(),
|
|
29
|
+
...converter.enumerateAttributes(
|
|
30
|
+
[
|
|
31
|
+
['spectrum-AlertDialog--error'],
|
|
32
|
+
['spectrum-AlertDialog--warning'],
|
|
33
|
+
],
|
|
34
|
+
'variant'
|
|
35
|
+
),
|
|
36
|
+
converter.classToClass('spectrum-AlertDialog-header', 'header'),
|
|
37
|
+
converter.classToSlotted(
|
|
38
|
+
'spectrum-AlertDialog-heading',
|
|
39
|
+
'heading'
|
|
40
|
+
),
|
|
41
|
+
converter.classToClass(
|
|
42
|
+
'spectrum-AlertDialog-content',
|
|
43
|
+
'content'
|
|
44
|
+
),
|
|
45
|
+
converter.classToClass('spectrum-AlertDialog-grid', 'grid'),
|
|
46
|
+
converter.classToClass('spectrum-Icon', 'icon'),
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default config;
|