@spectrum-web-components/alert-banner 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 ADDED
@@ -0,0 +1,99 @@
1
+ ## Description
2
+
3
+ The `<sp-alert-banner>` shows pressing and high-signal messages, such as system alerts. It is meant to be noticed and prompt users to take action.
4
+
5
+ ### Usage
6
+
7
+ [![See it on NPM!](https://img.shields.io/npm/v/@spectrum-web-components/alert-banner?style=for-the-badge)](https://www.npmjs.com/package/@spectrum-web-components/alert-banner)
8
+ [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/@spectrum-web-components/alert-banner?style=for-the-badge)](https://bundlephobia.com/result?p=@spectrum-web-components/alert-banner)
9
+
10
+ ```
11
+ yarn add @spectrum-web-components/alert-banner
12
+ ```
13
+
14
+ Import the side effectful registration of `<sp-alert-banner>` via:
15
+
16
+ ```
17
+ import '@spectrum-web-components/alert-banner/sp-alert-banner.js';
18
+ ```
19
+
20
+ When looking to leverage the `AlertBanner` base class as a type and/or for extension purposes, do so via:
21
+
22
+ ```
23
+ import { AlertBanner } from '@spectrum-web-components/alert-banner';
24
+ ```
25
+
26
+ ## Examples
27
+
28
+ The alert banner accepts text context in the default slot provided:
29
+
30
+ ```html
31
+ <sp-alert-banner open>
32
+ All documents in this folder have been archived
33
+ </sp-alert-banner>
34
+ ```
35
+
36
+ ### Dismissible
37
+
38
+ Use the `dismissible` attribute to include an icon-only close button used to dismiss the alert banner:
39
+
40
+ ```html
41
+ <sp-alert-banner open dismissible>
42
+ All documents in this folder have been archived
43
+ </sp-alert-banner>
44
+ ```
45
+
46
+ ### Actionable
47
+
48
+ Use the action slot for the contextual action that a user can take in response to the issue described:
49
+
50
+ ```html
51
+ <sp-alert-banner open dismissible>
52
+ Your trial has expired
53
+ <sp-button treatment="outline" static-color="white" slot="action">
54
+ Buy now
55
+ </sp-button>
56
+ </sp-alert-banner>
57
+ ```
58
+
59
+ ## Variants
60
+
61
+ ### Info
62
+
63
+ ```html
64
+ <sp-alert-banner open variant="info" dismissible>
65
+ Your trial will expire in 3 days
66
+ <sp-button treatment="outline" static-color="white" slot="action">
67
+ Buy now
68
+ </sp-button>
69
+ </sp-alert-banner>
70
+ ```
71
+
72
+ ### Negative
73
+
74
+ ```html
75
+ <sp-alert-banner open variant="negative" dismissible>
76
+ Connection interupted. Check your network to continue
77
+ </sp-alert-banner>
78
+ ```
79
+
80
+ ## Closing the alert banner
81
+
82
+ Alert banners should be used for system-level messages and they should be dismissed only as a result of a user action or if the internal state that triggered the alert has been resolved.
83
+
84
+ The alert can be dismissed by triggering the close button in case of a dismissible alert. It also exposes a public `close` method to allow consumers to close the alert programmatically.
85
+
86
+ The component dispatches a `close` event to announce that the alert banner has been closed. This can be prevented by using the `event.preventDefault()` API.
87
+
88
+ ## Accessibility
89
+
90
+ The `sp-alert-banner` element is rendered with a `role` of `alert`, to inform screen readers and notify users accordingly. When rendering an alert that is dismissable or has actions on a page, it should be placed in a container with a `role` of `region` and that region should be labelled for screen readers users to quickly navigate.
91
+
92
+ The alert banner supports keyboard interaction as follows:
93
+
94
+ - _Tab_ should place focus on the next interactive element, which can be either the actionable button or the close button.
95
+ - _Tab + Shift_ should place focus on the previous interactive element.
96
+ - _Space_ or _Enter_ should trigger the interaction if one of the buttons is focused, thus dismissing the alert in case of the close button or triggering the corresponding contextual action.
97
+ - _Esc_ will dismiss an alert banner if it’s a dismissible alert.
98
+
99
+ Once focus is on the alert banner, arrow keys can be used to navigate between the close button and the slotted action buttons.
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@spectrum-web-components/alert-banner",
3
+ "version": "0.0.0-20241209155954",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "Web component implementation of a Spectrum design AlertBanner",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/adobe/spectrum-web-components.git",
12
+ "directory": "packages/alert-banner"
13
+ },
14
+ "author": "",
15
+ "homepage": "https://adobe.github.io/spectrum-web-components/components/alert-banner",
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/AlertBanner.js": {
29
+ "development": "./src/AlertBanner.dev.js",
30
+ "default": "./src/AlertBanner.js"
31
+ },
32
+ "./src/alert-banner-overrides.css.js": "./src/alert-banner-overrides.css.js",
33
+ "./src/alert-banner.css.js": "./src/alert-banner.css.js",
34
+ "./src/index.js": {
35
+ "development": "./src/index.dev.js",
36
+ "default": "./src/index.js"
37
+ },
38
+ "./sp-alert-banner.js": {
39
+ "development": "./sp-alert-banner.dev.js",
40
+ "default": "./sp-alert-banner.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
+ "@spectrum-web-components/base": "0.0.0-20241209155954",
62
+ "@spectrum-web-components/button": "0.0.0-20241209155954",
63
+ "@spectrum-web-components/icons-workflow": "0.0.0-20241209155954"
64
+ },
65
+ "devDependencies": {
66
+ "@spectrum-css/alertbanner": "^3.0.0-s2-foundations.16"
67
+ },
68
+ "types": "./src/index.d.ts",
69
+ "customElements": "custom-elements.json",
70
+ "sideEffects": [
71
+ "./sp-*.js",
72
+ "./**/*.dev.js"
73
+ ]
74
+ }
@@ -0,0 +1,6 @@
1
+ import { AlertBanner } from './src/AlertBanner.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-alert-banner': AlertBanner;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { AlertBanner } from "./src/AlertBanner.dev.js";
3
+ import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
+ defineElement("sp-alert-banner", AlertBanner);
5
+ //# sourceMappingURL=sp-alert-banner.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-alert-banner.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 { AlertBanner } from './src/AlertBanner.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-alert-banner', AlertBanner);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-alert-banner': AlertBanner;\n }\n}\n"],
5
+ "mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{AlertBanner as e}from"./src/AlertBanner.js";import{defineElement as r}from"@spectrum-web-components/base/src/define-element.js";r("sp-alert-banner",e);
2
+ //# sourceMappingURL=sp-alert-banner.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-alert-banner.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 { AlertBanner } from './src/AlertBanner.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-alert-banner', AlertBanner);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-alert-banner': AlertBanner;\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
6
+ "names": ["AlertBanner", "defineElement"]
7
+ }
@@ -0,0 +1,46 @@
1
+ import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
+ import '@spectrum-web-components/button/sp-close-button.js';
3
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';
4
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';
5
+ declare const VALID_VARIANTS: string[];
6
+ export type AlertBannerVariants = (typeof VALID_VARIANTS)[number];
7
+ /**
8
+ * @element sp-alert-banner
9
+ *
10
+ * @slot - The alert banner text context
11
+ * @slot action - Slot for the button element that surfaces the contextual action a user can take
12
+ *
13
+ * @fires close - Announces the alert banner has been closed
14
+ */
15
+ export declare class AlertBanner extends SpectrumElement {
16
+ static get styles(): CSSResultArray;
17
+ /**
18
+ * Controls the display of the alert banner
19
+ *
20
+ * @param {Boolean} open
21
+ */
22
+ open: boolean;
23
+ /**
24
+ * Whether to include an icon-only close button to dismiss the alert banner
25
+ *
26
+ * @param {Boolean} dismissible
27
+ */
28
+ dismissible: boolean;
29
+ /**
30
+ * The variant applies specific styling when set to `negative` or `info`;
31
+ * `variant` attribute is removed when it's passed an invalid variant.
32
+ *
33
+ * @param {String} variant
34
+ */
35
+ set variant(variant: AlertBannerVariants);
36
+ get variant(): AlertBannerVariants;
37
+ private _variant;
38
+ protected isValidVariant(variant: string): boolean;
39
+ protected renderIcon(variant: string): TemplateResult;
40
+ private shouldClose;
41
+ close(): void;
42
+ private handleKeydown;
43
+ protected render(): TemplateResult;
44
+ protected updated(changes: PropertyValues): void;
45
+ }
46
+ export {};
@@ -0,0 +1,139 @@
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 { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import "@spectrum-web-components/button/sp-close-button.js";
18
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";
19
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-info.js";
20
+ import styles from "./alert-banner.css.js";
21
+ const VALID_VARIANTS = ["neutral", "info", "negative"];
22
+ export class AlertBanner extends SpectrumElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.open = false;
26
+ this.dismissible = false;
27
+ this._variant = "";
28
+ }
29
+ static get styles() {
30
+ return [styles];
31
+ }
32
+ set variant(variant) {
33
+ if (variant === this.variant) {
34
+ return;
35
+ }
36
+ const oldValue = this.variant;
37
+ if (this.isValidVariant(variant)) {
38
+ this.setAttribute("variant", variant);
39
+ this._variant = variant;
40
+ } else {
41
+ this.removeAttribute("variant");
42
+ this._variant = "";
43
+ if (true) {
44
+ window.__swc.warn(
45
+ this,
46
+ `<${this.localName}> element expects the "variant" attribute to be one of the following:`,
47
+ "https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants",
48
+ {
49
+ issues: [...VALID_VARIANTS]
50
+ }
51
+ );
52
+ }
53
+ }
54
+ this.requestUpdate("variant", oldValue);
55
+ }
56
+ get variant() {
57
+ return this._variant;
58
+ }
59
+ isValidVariant(variant) {
60
+ return VALID_VARIANTS.includes(variant);
61
+ }
62
+ renderIcon(variant) {
63
+ switch (variant) {
64
+ case "info":
65
+ return html`
66
+ <sp-icon-info
67
+ label="Information"
68
+ class="type"
69
+ ></sp-icon-info>
70
+ `;
71
+ case "negative":
72
+ return html`
73
+ <sp-icon-alert label="Error" class="type"></sp-icon-alert>
74
+ `;
75
+ default:
76
+ return html``;
77
+ }
78
+ }
79
+ shouldClose() {
80
+ const applyDefault = this.dispatchEvent(
81
+ new CustomEvent("close", {
82
+ composed: true,
83
+ bubbles: true,
84
+ cancelable: true
85
+ })
86
+ );
87
+ if (applyDefault) {
88
+ this.close();
89
+ }
90
+ }
91
+ close() {
92
+ this.open = false;
93
+ }
94
+ handleKeydown(event) {
95
+ if (event.code === "Escape" && this.dismissible) {
96
+ this.shouldClose();
97
+ }
98
+ }
99
+ render() {
100
+ return html`
101
+ <div class="body" role="alert">
102
+ <div class="content">
103
+ ${this.renderIcon(this.variant)}
104
+ <div class="text"><slot></slot></div>
105
+ </div>
106
+ <slot name="action"></slot>
107
+ </div>
108
+ <div class="end">
109
+ ${this.dismissible ? html`
110
+ <sp-close-button
111
+ @click=${this.shouldClose}
112
+ label="Close"
113
+ static-color="white"
114
+ ></sp-close-button>
115
+ ` : html``}
116
+ </div>
117
+ `;
118
+ }
119
+ updated(changes) {
120
+ super.updated(changes);
121
+ if (changes.has("open")) {
122
+ if (this.open) {
123
+ this.addEventListener("keydown", this.handleKeydown);
124
+ } else {
125
+ this.removeEventListener("keydown", this.handleKeydown);
126
+ }
127
+ }
128
+ }
129
+ }
130
+ __decorateClass([
131
+ property({ type: Boolean, reflect: true })
132
+ ], AlertBanner.prototype, "open", 2);
133
+ __decorateClass([
134
+ property({ type: Boolean, reflect: true })
135
+ ], AlertBanner.prototype, "dismissible", 2);
136
+ __decorateClass([
137
+ property({ type: String })
138
+ ], AlertBanner.prototype, "variant", 1);
139
+ //# sourceMappingURL=AlertBanner.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["AlertBanner.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 {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';\nimport styles from './alert-banner.css.js';\n\nconst VALID_VARIANTS = ['neutral', 'info', 'negative'];\nexport type AlertBannerVariants = (typeof VALID_VARIANTS)[number];\n\n/**\n * @element sp-alert-banner\n *\n * @slot - The alert banner text context\n * @slot action - Slot for the button element that surfaces the contextual action a user can take\n *\n * @fires close - Announces the alert banner has been closed\n */\nexport class AlertBanner extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * Controls the display of the alert banner\n *\n * @param {Boolean} open\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner\n *\n * @param {Boolean} dismissible\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants',\n {\n issues: [...VALID_VARIANTS],\n }\n );\n }\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariants {\n return this._variant;\n }\n\n private _variant: AlertBannerVariants = '';\n\n protected isValidVariant(variant: string): boolean {\n return VALID_VARIANTS.includes(variant);\n }\n\n protected renderIcon(variant: string): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=\"Information\"\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n return html`\n <sp-icon-alert label=\"Error\" class=\"type\"></sp-icon-alert>\n `;\n default:\n return html``;\n }\n }\n\n private shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"body\" role=\"alert\">\n <div class=\"content\">\n ${this.renderIcon(this.variant)}\n <div class=\"text\"><slot></slot></div>\n </div>\n <slot name=\"action\"></slot>\n </div>\n <div class=\"end\">\n ${this.dismissible\n ? html`\n <sp-close-button\n @click=${this.shouldClose}\n label=\"Close\"\n static-color=\"white\"\n ></sp-close-button>\n `\n : html``}\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,YAAY;AAEnB,MAAM,iBAAiB,CAAC,WAAW,QAAQ,UAAU;AAW9C,aAAM,oBAAoB,gBAAgB;AAAA,EAA1C;AAAA;AAWH,SAAO,OAAO;AAQd,SAAO,cAAc;AAwCrB,SAAQ,WAAgC;AAAA;AAAA,EA1DxC,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAyBA,IAAW,QAAQ,SAA8B;AAC7C,QAAI,YAAY,KAAK,SAAS;AAC1B;AAAA,IACJ;AACA,UAAM,WAAW,KAAK;AAEtB,QAAI,KAAK,eAAe,OAAO,GAAG;AAC9B,WAAK,aAAa,WAAW,OAAO;AACpC,WAAK,WAAW;AAAA,IACpB,OAAO;AACH,WAAK,gBAAgB,SAAS;AAC9B,WAAK,WAAW;AAEhB,UAAI,MAAoB;AACpB,eAAO,MAAM;AAAA,UACT;AAAA,UACA,IAAI,KAAK,SAAS;AAAA,UAClB;AAAA,UACA;AAAA,YACI,QAAQ,CAAC,GAAG,cAAc;AAAA,UAC9B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AACA,SAAK,cAAc,WAAW,QAAQ;AAAA,EAC1C;AAAA,EAEA,IAAW,UAA+B;AACtC,WAAO,KAAK;AAAA,EAChB;AAAA,EAIU,eAAe,SAA0B;AAC/C,WAAO,eAAe,SAAS,OAAO;AAAA,EAC1C;AAAA,EAEU,WAAW,SAAiC;AAClD,YAAQ,SAAS;AAAA,MACb,KAAK;AACD,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMX,KAAK;AACD,eAAO;AAAA;AAAA;AAAA,MAGX;AACI,eAAO;AAAA,IACf;AAAA,EACJ;AAAA,EAEQ,cAAoB;AACxB,UAAM,eAAe,KAAK;AAAA,MACtB,IAAI,YAAY,SAAS;AAAA,QACrB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,MAChB,CAAC;AAAA,IACL;AACA,QAAI,cAAc;AACd,WAAK,MAAM;AAAA,IACf;AAAA,EACJ;AAAA,EAEO,QAAc;AACjB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEQ,cAAc,OAA4B;AAC9C,QAAI,MAAM,SAAS,YAAY,KAAK,aAAa;AAC7C,WAAK,YAAY;AAAA,IACrB;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,sBAGO,KAAK,WAAW,KAAK,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMjC,KAAK,cACD;AAAA;AAAA,uCAEiB,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA,0BAKjC,MAAM;AAAA;AAAA;AAAA,EAGxB;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AAErB,QAAI,QAAQ,IAAI,MAAM,GAAG;AACrB,UAAI,KAAK,MAAM;AACX,aAAK,iBAAiB,WAAW,KAAK,aAAa;AAAA,MACvD,OAAO;AACH,aAAK,oBAAoB,WAAW,KAAK,aAAa;AAAA,MAC1D;AAAA,IACJ;AAAA,EACJ;AACJ;AAjIW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAVjC,YAWF;AAQA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAlBjC,YAmBF;AASI;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA3BjB,YA4BE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var o=(a,r,e,s)=>{for(var t=s>1?void 0:s?d(r,e):r,n=a.length-1,l;n>=0;n--)(l=a[n])&&(t=(s?l(r,e,t):l(t))||t);return s&&t&&c(r,e,t),t};import{html as i,SpectrumElement as u}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/button/sp-close-button.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-info.js";import h from"./alert-banner.css.js";const v=["neutral","info","negative"];export class AlertBanner extends u{constructor(){super(...arguments);this.open=!1;this.dismissible=!1;this._variant=""}static get styles(){return[h]}set variant(e){if(e===this.variant)return;const s=this.variant;this.isValidVariant(e)?(this.setAttribute("variant",e),this._variant=e):(this.removeAttribute("variant"),this._variant=""),this.requestUpdate("variant",s)}get variant(){return this._variant}isValidVariant(e){return v.includes(e)}renderIcon(e){switch(e){case"info":return i`
2
+ <sp-icon-info
3
+ label="Information"
4
+ class="type"
5
+ ></sp-icon-info>
6
+ `;case"negative":return i`
7
+ <sp-icon-alert label="Error" class="type"></sp-icon-alert>
8
+ `;default:return i``}}shouldClose(){this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0,cancelable:!0}))&&this.close()}close(){this.open=!1}handleKeydown(e){e.code==="Escape"&&this.dismissible&&this.shouldClose()}render(){return i`
9
+ <div class="body" role="alert">
10
+ <div class="content">
11
+ ${this.renderIcon(this.variant)}
12
+ <div class="text"><slot></slot></div>
13
+ </div>
14
+ <slot name="action"></slot>
15
+ </div>
16
+ <div class="end">
17
+ ${this.dismissible?i`
18
+ <sp-close-button
19
+ @click=${this.shouldClose}
20
+ label="Close"
21
+ static-color="white"
22
+ ></sp-close-button>
23
+ `:i``}
24
+ </div>
25
+ `}updated(e){super.updated(e),e.has("open")&&(this.open?this.addEventListener("keydown",this.handleKeydown):this.removeEventListener("keydown",this.handleKeydown))}}o([p({type:Boolean,reflect:!0})],AlertBanner.prototype,"open",2),o([p({type:Boolean,reflect:!0})],AlertBanner.prototype,"dismissible",2),o([p({type:String})],AlertBanner.prototype,"variant",1);
26
+ //# sourceMappingURL=AlertBanner.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["AlertBanner.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 {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';\nimport styles from './alert-banner.css.js';\n\nconst VALID_VARIANTS = ['neutral', 'info', 'negative'];\nexport type AlertBannerVariants = (typeof VALID_VARIANTS)[number];\n\n/**\n * @element sp-alert-banner\n *\n * @slot - The alert banner text context\n * @slot action - Slot for the button element that surfaces the contextual action a user can take\n *\n * @fires close - Announces the alert banner has been closed\n */\nexport class AlertBanner extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * Controls the display of the alert banner\n *\n * @param {Boolean} open\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner\n *\n * @param {Boolean} dismissible\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants',\n {\n issues: [...VALID_VARIANTS],\n }\n );\n }\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariants {\n return this._variant;\n }\n\n private _variant: AlertBannerVariants = '';\n\n protected isValidVariant(variant: string): boolean {\n return VALID_VARIANTS.includes(variant);\n }\n\n protected renderIcon(variant: string): TemplateResult {\n switch (variant) {\n case 'info':\n return html`\n <sp-icon-info\n label=\"Information\"\n class=\"type\"\n ></sp-icon-info>\n `;\n case 'negative':\n return html`\n <sp-icon-alert label=\"Error\" class=\"type\"></sp-icon-alert>\n `;\n default:\n return html``;\n }\n }\n\n private shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"body\" role=\"alert\">\n <div class=\"content\">\n ${this.renderIcon(this.variant)}\n <div class=\"text\"><slot></slot></div>\n </div>\n <slot name=\"action\"></slot>\n </div>\n <div class=\"end\">\n ${this.dismissible\n ? html`\n <sp-close-button\n @click=${this.shouldClose}\n label=\"Close\"\n static-color=\"white\"\n ></sp-close-button>\n `\n : html``}\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],
5
+ "mappings": "qNAWA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,MAAO,qDACP,MAAO,iEACP,MAAO,gEACP,OAAOC,MAAY,wBAEnB,MAAMC,EAAiB,CAAC,UAAW,OAAQ,UAAU,EAW9C,aAAM,oBAAoBH,CAAgB,CAA1C,kCAWH,KAAO,KAAO,GAQd,KAAO,YAAc,GAwCrB,KAAQ,SAAgC,GA1DxC,WAA2B,QAAyB,CAChD,MAAO,CAACE,CAAM,CAClB,CAyBA,IAAW,QAAQE,EAA8B,CAC7C,GAAIA,IAAY,KAAK,QACjB,OAEJ,MAAMC,EAAW,KAAK,QAElB,KAAK,eAAeD,CAAO,GAC3B,KAAK,aAAa,UAAWA,CAAO,EACpC,KAAK,SAAWA,IAEhB,KAAK,gBAAgB,SAAS,EAC9B,KAAK,SAAW,IAapB,KAAK,cAAc,UAAWC,CAAQ,CAC1C,CAEA,IAAW,SAA+B,CACtC,OAAO,KAAK,QAChB,CAIU,eAAeD,EAA0B,CAC/C,OAAOD,EAAe,SAASC,CAAO,CAC1C,CAEU,WAAWA,EAAiC,CAClD,OAAQA,EAAS,CACb,IAAK,OACD,OAAOL;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMX,IAAK,WACD,OAAOA;AAAA;AAAA,kBAGX,QACI,OAAOA,GACf,CACJ,CAEQ,aAAoB,CACH,KAAK,cACtB,IAAI,YAAY,QAAS,CACrB,SAAU,GACV,QAAS,GACT,WAAY,EAChB,CAAC,CACL,GAEI,KAAK,MAAM,CAEnB,CAEO,OAAc,CACjB,KAAK,KAAO,EAChB,CAEQ,cAAcO,EAA4B,CAC1CA,EAAM,OAAS,UAAY,KAAK,aAChC,KAAK,YAAY,CAEzB,CAEmB,QAAyB,CACxC,OAAOP;AAAA;AAAA;AAAA,sBAGO,KAAK,WAAW,KAAK,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMjC,KAAK,YACDA;AAAA;AAAA,uCAEiB,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA,wBAKjCA,GAAM;AAAA;AAAA,SAGxB,CAEmB,QAAQQ,EAA+B,CACtD,MAAM,QAAQA,CAAO,EAEjBA,EAAQ,IAAI,MAAM,IACd,KAAK,KACL,KAAK,iBAAiB,UAAW,KAAK,aAAa,EAEnD,KAAK,oBAAoB,UAAW,KAAK,aAAa,EAGlE,CACJ,CAjIWC,EAAA,CADNP,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAVjC,YAWF,oBAQAO,EAAA,CADNP,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAlBjC,YAmBF,2BASIO,EAAA,CADVP,EAAS,CAAE,KAAM,MAAO,CAAC,GA3BjB,YA4BE",
6
+ "names": ["html", "SpectrumElement", "property", "styles", "VALID_VARIANTS", "variant", "oldValue", "event", "changes", "__decorateClass"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}
5
+ `;
6
+ export default styles;
7
+ //# sourceMappingURL=alert-banner-overrides.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["alert-banner-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-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}\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 e}from"@spectrum-web-components/base";const t=e`
2
+ :host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}
3
+ `;export default t;
4
+ //# sourceMappingURL=alert-banner-overrides.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["alert-banner-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-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}\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,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host{--mod-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}:host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}
5
+ `;
6
+ export default styles;
7
+ //# sourceMappingURL=alert-banner.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["alert-banner.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-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}:host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}\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 e}from"@spectrum-web-components/base";const r=e`
2
+ :host{--mod-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}:host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}
3
+ `;export default r;
4
+ //# sourceMappingURL=alert-banner.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["alert-banner.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-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}:host{--spectrum-alert-banner-neutral-background:var(--system-alert-banner-neutral-background);--spectrum-alert-banner-min-height:var(--system-alert-banner-min-height);--spectrum-alert-banner-max-inline-size:var(--system-alert-banner-max-inline-size);--spectrum-alert-banner-size:var(--system-alert-banner-size);--spectrum-alert-banner-font-size:var(--system-alert-banner-font-size);--spectrum-alert-banner-icon-size:var(--system-alert-banner-icon-size);--spectrum-alert-banner-icon-to-text:var(--system-alert-banner-icon-to-text);--spectrum-alert-banner-start-edge:var(--system-alert-banner-start-edge);--spectrum-alert-banner-text-to-button-horizontal:var(--system-alert-banner-text-to-button-horizontal);--spectrum-alert-banner-text-to-divider:var(--system-alert-banner-text-to-divider);--spectrum-alert-banner-top-icon:var(--system-alert-banner-top-icon);--spectrum-alert-banner-top-text:var(--system-alert-banner-top-text);--spectrum-alert-banner-bottom-text:var(--system-alert-banner-bottom-text);--spectrum-alert-banner-informative-background:var(--system-alert-banner-informative-background);--spectrum-alert-banner-negative-background:var(--system-alert-banner-negative-background);--spectrum-alert-banner-font-color:var(--system-alert-banner-font-color)}\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 './AlertBanner.js';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export * from "./AlertBanner.dev.js";
3
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.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*/\nexport * from './AlertBanner.dev.js'\n"],
5
+ "mappings": ";AAWA,cAAc;",
6
+ "names": []
7
+ }
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"./AlertBanner.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.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*/\nexport * from './AlertBanner.js';\n"],
5
+ "mappings": "aAWA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host{--mod-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}
5
+ `;
6
+ export default styles;
7
+ //# sourceMappingURL=spectrum-alert-banner.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-alert-banner.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-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}\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 r}from"@spectrum-web-components/base";const e=r`
2
+ :host{--mod-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}
3
+ `;export default e;
4
+ //# sourceMappingURL=spectrum-alert-banner.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-alert-banner.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-divider-vertical-margin:var(--mod-alert-banner-edge-to-divider,var(--spectrum-alert-banner-edge-to-divider));--mod-divider-vertical-height:auto;--mod-divider-vertical-align:stretch;--mod-button-margin-block:var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button));--mod-button-margin-right:var(--mod-alert-banner-text-to-divider,var(--spectrum-alert-banner-text-to-divider));--mod-button-margin-left:auto;--mod-closebutton-margin-inline:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-margin-top:var(--mod-alert-banner-close-button-spacing,var(--spectrum-alert-banner-close-button-spacing));--mod-closebutton-align-self:flex-start;inline-size:var(--mod-alert-banner-size,var(--spectrum-alert-banner-size));max-inline-size:var(--mod-alert-banner-max-inline-size,var(--spectrum-alert-banner-max-inline-size));min-block-size:var(--mod-alert-banner-min-height,var(--spectrum-alert-banner-min-height));font-size:var(--mod-alert-banner-font-size,var(--spectrum-alert-banner-font-size));color:var(--mod-alert-banner-font-color,var(--spectrum-alert-banner-font-color));background-color:var(--mod-alert-banner-neutral-background,var(--mod-alert-banner-neutral-background,var(--spectrum-alert-banner-neutral-background)));border:0 solid #0000;border:var(--highcontrast-alert-banner-border-width,0)solid var(--highcontrast-alert-banner-border-color,transparent);justify-content:space-between;display:none}:host([open]){display:flex}:host([variant=info]){background-color:var(--mod-alert-banner-informative-background,var(--spectrum-alert-banner-informative-background))}:host([variant=negative]){background-color:var(--mod-alert-banner-negative-background,var(--spectrum-alert-banner-negative-background))}.body{inline-size:100%;gap:max(calc(var(--mod-alert-banner-text-to-button-vertical,var(--spectrum-alert-banner-text-to-button-vertical)) - var(--mod-alert-banner-edge-to-button,var(--spectrum-alert-banner-edge-to-button))),0px);flex-wrap:wrap;align-items:center;margin-inline-start:var(--mod-alert-banner-start-edge,var(--spectrum-alert-banner-start-edge));display:flex}.content{display:flex}.end{align-items:center;display:flex}.type{inline-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));block-size:var(--mod-alert-banner-icon-size,var(--spectrum-alert-banner-icon-size));flex-shrink:0;margin-block-start:var(--mod-alert-banner-top-icon,var(--spectrum-alert-banner-top-icon));margin-inline-end:var(--mod-alert-banner-icon-to-text,var(--spectrum-alert-banner-icon-to-text))}.text{margin-block-start:var(--mod-alert-banner-top-text,var(--spectrum-alert-banner-top-text));margin-block-end:var(--mod-alert-banner-bottom-text,var(--spectrum-alert-banner-bottom-text));margin-inline-end:var(--mod-alert-banner-text-to-button-horizontal,var(--spectrum-alert-banner-text-to-button-horizontal))}@media (forced-colors:active){:host{--highcontrast-alert-banner-border-color:CanvasText;--highcontrast-alert-banner-border-width:var(--spectrum-border-width-100)}}\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,49 @@
1
+ /*
2
+ Copyright 2024 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-AlertBanner');
17
+
18
+ /**
19
+ * @type { import('../../../tasks/spectrum-css-converter').SpectrumCSSConverter }
20
+ */
21
+ const config = {
22
+ conversions: [
23
+ {
24
+ inPackage: '@spectrum-css/alertbanner',
25
+ outPackage: 'alert-banner',
26
+ fileName: 'alert-banner',
27
+ systemOverrides: true,
28
+ components: [
29
+ converter.classToHost(),
30
+ converter.classToAttribute('is-open', 'open'),
31
+ ...converter.enumerateAttributes(
32
+ [
33
+ ['spectrum-AlertBanner--info'],
34
+ ['spectrum-AlertBanner--negative'],
35
+ ],
36
+ 'variant'
37
+ ),
38
+ converter.classToClass('spectrum-AlertBanner-body'),
39
+ converter.classToClass('spectrum-AlertBanner-content'),
40
+ converter.classToClass('spectrum-AlertBanner-text'),
41
+ converter.classToSlotted('spectrum-Button', 'action'),
42
+ converter.classToClass('spectrum-AlertBanner-end'),
43
+ converter.classToClass('spectrum-AlertBanner-icon', 'type'),
44
+ ],
45
+ },
46
+ ],
47
+ };
48
+
49
+ export default config;