@spectrum-web-components/button 1.10.0 → 1.11.0-preview-b6b1becb.20251121200357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/button",
3
- "version": "1.10.0",
3
+ "version": "1.11.0-preview-b6b1becb.20251121200357",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -89,14 +89,14 @@
89
89
  "css"
90
90
  ],
91
91
  "dependencies": {
92
- "@spectrum-web-components/base": "1.10.0",
93
- "@spectrum-web-components/clear-button": "1.10.0",
94
- "@spectrum-web-components/close-button": "1.10.0",
95
- "@spectrum-web-components/icon": "1.10.0",
96
- "@spectrum-web-components/icons-ui": "1.10.0",
97
- "@spectrum-web-components/progress-circle": "1.10.0",
98
- "@spectrum-web-components/reactive-controllers": "1.10.0",
99
- "@spectrum-web-components/shared": "1.10.0"
92
+ "@spectrum-web-components/base": "1.11.0-preview-b6b1becb.20251121200357",
93
+ "@spectrum-web-components/clear-button": "1.11.0-preview-b6b1becb.20251121200357",
94
+ "@spectrum-web-components/close-button": "1.11.0-preview-b6b1becb.20251121200357",
95
+ "@spectrum-web-components/icon": "1.11.0-preview-b6b1becb.20251121200357",
96
+ "@spectrum-web-components/icons-ui": "1.11.0-preview-b6b1becb.20251121200357",
97
+ "@spectrum-web-components/progress-circle": "1.11.0-preview-b6b1becb.20251121200357",
98
+ "@spectrum-web-components/reactive-controllers": "1.11.0-preview-b6b1becb.20251121200357",
99
+ "@spectrum-web-components/shared": "1.11.0-preview-b6b1becb.20251121200357"
100
100
  },
101
101
  "types": "./src/index.d.ts",
102
102
  "customElements": "custom-elements.json",
@@ -22,10 +22,16 @@ declare const ClearButton_base: typeof StyledButton & {
22
22
  /**
23
23
  * @element sp-clear-button
24
24
  *
25
- * @slot - text label of the Clear Button
25
+ * @attr {string} label - Required accessible label set as aria-label
26
26
  */
27
27
  export declare class ClearButton extends ClearButton_base {
28
28
  static get styles(): CSSResultArray;
29
+ /**
30
+ * An accessible label that describes the component.
31
+ * It will be applied to aria-label, but not visually rendered.
32
+ * This attribute is required for clear buttons.
33
+ */
34
+ label: string;
29
35
  quiet: boolean;
30
36
  /**
31
37
  * The visual variant to apply to this button.
@@ -40,5 +46,6 @@ export declare class ClearButton extends ClearButton_base {
40
46
  staticColor: 'white' | undefined;
41
47
  protected get buttonContent(): TemplateResult[];
42
48
  protected render(): TemplateResult;
49
+ connectedCallback(): void;
43
50
  }
44
51
  export {};
@@ -91,7 +91,30 @@ export class ClearButton extends SizedMixin(StyledButton, {
91
91
  <div class="fill">${super.render()}</div>
92
92
  `;
93
93
  }
94
+ connectedCallback() {
95
+ var _a;
96
+ super.connectedCallback();
97
+ if ((_a = this.textContent) == null ? void 0 : _a.trim()) {
98
+ window.__swc.warn(
99
+ this,
100
+ `The default slot for text content in <${this.localName}> has been deprecated and will be removed in a future release. The clear button is icon-only and does not render slot content. Use the "label" attribute instead to provide an accessible name.`,
101
+ "https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button",
102
+ { level: "deprecation" }
103
+ );
104
+ }
105
+ if (!this.label) {
106
+ window.__swc.warn(
107
+ this,
108
+ `The "label" attribute is required on <${this.localName}> to provide an accessible name for screen readers. Please add a label attribute, e.g., <${this.localName} label="Clear">.`,
109
+ "https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button",
110
+ { level: "high" }
111
+ );
112
+ }
113
+ }
94
114
  }
115
+ __decorateClass([
116
+ property()
117
+ ], ClearButton.prototype, "label", 2);
95
118
  __decorateClass([
96
119
  property({ type: Boolean, reflect: true })
97
120
  ], ClearButton.prototype, "quiet", 2);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ClearButton.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\n\n/**\n * @element sp-clear-button\n *\n * @slot - text label of the Clear Button\n */\nexport class ClearButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /**\n * The visual variant to apply to this button.\n * @deprecated Use `static-color='white'` instead.\n */\n @property({ reflect: true })\n public set variant(variant: 'overBackground' | undefined) {\n const oldValue = this._variant;\n const oldStaticColor = this.staticColor;\n if (variant !== 'overBackground') {\n this.removeAttribute('variant');\n this._variant = undefined;\n this.staticColor = undefined;\n return;\n }\n\n this.setAttribute('variant', variant);\n this._variant = variant;\n // Set staticColor to white to reflect the updated and expected attribute\n this.staticColor = 'white';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'The overBackground variant is deprecated. Please use `static-color=\"white\"` instead.',\n 'https://opensource.adobe.com/spectrum-web-components/components/clear-button/',\n { level: 'deprecation' }\n );\n }\n\n this.requestUpdate('variant', oldValue);\n this.requestUpdate('staticColor', oldStaticColor);\n }\n\n public get variant(): 'overBackground' | undefined {\n return this._variant;\n }\n\n private _variant: 'overBackground' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor: 'white' | undefined;\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,uBAAuB;AAE9B,MAAM,YAAkD;AAAA,EACpD,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAMd;AAOO,aAAM,oBAAoB,WAAW,cAAc;AAAA,EACtD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAQH,SAAO,QAAQ;AAAA;AAAA,EALf,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,cAAc,iBAAiB;AAAA,EAC5D;AAAA,EAUA,IAAW,QAAQ,SAAuC;AACtD,UAAM,WAAW,KAAK;AACtB,UAAM,iBAAiB,KAAK;AAC5B,QAAI,YAAY,kBAAkB;AAC9B,WAAK,gBAAgB,SAAS;AAC9B,WAAK,WAAW;AAChB,WAAK,cAAc;AACnB;AAAA,IACJ;AAEA,SAAK,aAAa,WAAW,OAAO;AACpC,SAAK,WAAW;AAEhB,SAAK,cAAc;AAEnB,QAAI,MAAoB;AACpB,aAAO,MAAM;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,EAAE,OAAO,cAAc;AAAA,MAC3B;AAAA,IACJ;AAEA,SAAK,cAAc,WAAW,QAAQ;AACtC,SAAK,cAAc,eAAe,cAAc;AAAA,EACpD;AAAA,EAEA,IAAW,UAAwC;AAC/C,WAAO,KAAK;AAAA,EAChB;AAAA,EAUA,IAAuB,gBAAkC;AACrD,WAAO,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;AAAA,EAClC;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,gCACiB,MAAM,OAAO,CAAC;AAAA;AAAA,EAE1C;AACJ;AAxDW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAPjC,YAQF;AAOI;AAAA,EADV,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAdlB,YAeE;AAsCJ;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GApD7C,YAqDF;",
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\n\n/**\n * @element sp-clear-button\n *\n * @attr {string} label - Required accessible label set as aria-label\n */\nexport class ClearButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * An accessible label that describes the component.\n * It will be applied to aria-label, but not visually rendered.\n * This attribute is required for clear buttons.\n */\n @property()\n public override label!: string;\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /**\n * The visual variant to apply to this button.\n * @deprecated Use `static-color='white'` instead.\n */\n @property({ reflect: true })\n public set variant(variant: 'overBackground' | undefined) {\n const oldValue = this._variant;\n const oldStaticColor = this.staticColor;\n if (variant !== 'overBackground') {\n this.removeAttribute('variant');\n this._variant = undefined;\n this.staticColor = undefined;\n return;\n }\n\n this.setAttribute('variant', variant);\n this._variant = variant;\n // Set staticColor to white to reflect the updated and expected attribute\n this.staticColor = 'white';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'The overBackground variant is deprecated. Please use `static-color=\"white\"` instead.',\n 'https://opensource.adobe.com/spectrum-web-components/components/clear-button/',\n { level: 'deprecation' }\n );\n }\n\n this.requestUpdate('variant', oldValue);\n this.requestUpdate('staticColor', oldStaticColor);\n }\n\n public get variant(): 'overBackground' | undefined {\n return this._variant;\n }\n\n private _variant: 'overBackground' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor: 'white' | undefined;\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n // Deprecation warning for default slot when content is provided\n if (window.__swc.DEBUG && this.textContent?.trim()) {\n window.__swc.warn(\n this,\n `The default slot for text content in <${this.localName}> has been deprecated and will be removed in a future release. The clear button is icon-only and does not render slot content. Use the \"label\" attribute instead to provide an accessible name.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button',\n { level: 'deprecation' }\n );\n }\n\n // Warning for missing label attribute\n if (window.__swc.DEBUG && !this.label) {\n window.__swc.warn(\n this,\n `The \"label\" attribute is required on <${this.localName}> to provide an accessible name for screen readers. Please add a label attribute, e.g., <${this.localName} label=\"Clear\">.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button',\n { level: 'high' }\n );\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,uBAAuB;AAE9B,MAAM,YAAkD;AAAA,EACpD,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAMd;AAOO,aAAM,oBAAoB,WAAW,cAAc;AAAA,EACtD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAgBH,SAAO,QAAQ;AAAA;AAAA,EAbf,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,cAAc,iBAAiB;AAAA,EAC5D;AAAA,EAkBA,IAAW,QAAQ,SAAuC;AACtD,UAAM,WAAW,KAAK;AACtB,UAAM,iBAAiB,KAAK;AAC5B,QAAI,YAAY,kBAAkB;AAC9B,WAAK,gBAAgB,SAAS;AAC9B,WAAK,WAAW;AAChB,WAAK,cAAc;AACnB;AAAA,IACJ;AAEA,SAAK,aAAa,WAAW,OAAO;AACpC,SAAK,WAAW;AAEhB,SAAK,cAAc;AAEnB,QAAI,MAAoB;AACpB,aAAO,MAAM;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,EAAE,OAAO,cAAc;AAAA,MAC3B;AAAA,IACJ;AAEA,SAAK,cAAc,WAAW,QAAQ;AACtC,SAAK,cAAc,eAAe,cAAc;AAAA,EACpD;AAAA,EAEA,IAAW,UAAwC;AAC/C,WAAO,KAAK;AAAA,EAChB;AAAA,EAUA,IAAuB,gBAAkC;AACrD,WAAO,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;AAAA,EAClC;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,gCACiB,MAAM,OAAO,CAAC;AAAA;AAAA,EAE1C;AAAA,EAEgB,oBAA0B;AApI9C;AAqIQ,UAAM,kBAAkB;AAGxB,SAA0B,UAAK,gBAAL,mBAAkB,QAAQ;AAChD,aAAO,MAAM;AAAA,QACT;AAAA,QACA,yCAAyC,KAAK,SAAS;AAAA,QACvD;AAAA,QACA,EAAE,OAAO,cAAc;AAAA,MAC3B;AAAA,IACJ;AAGA,QAA0B,CAAC,KAAK,OAAO;AACnC,aAAO,MAAM;AAAA,QACT;AAAA,QACA,yCAAyC,KAAK,SAAS,4FAA4F,KAAK,SAAS;AAAA,QACjK;AAAA,QACA,EAAE,OAAO,OAAO;AAAA,MACpB;AAAA,IACJ;AAAA,EACJ;AACJ;AAnFoB;AAAA,EADf,SAAS;AAAA,GAZD,YAaO;AAGT;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAfjC,YAgBF;AAOI;AAAA,EADV,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAtBlB,YAuBE;AAsCJ;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GA5D7C,YA6DF;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,24 @@
1
- "use strict";var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=(c,o,e,s)=>{for(var t=s>1?void 0:s?p(o,e):o,n=c.length-1,a;n>=0;n--)(a=c[n])&&(t=(s?a(o,e,t):a(t))||t);return s&&t&&u(o,e,t),t};import{html as r,SizedMixin as d}from"@spectrum-web-components/base";import{property as l}from"@spectrum-web-components/base/src/decorators.js";import{StyledButton as m}from"./StyledButton.js";import v from"@spectrum-web-components/clear-button/src/clear-button.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js";import f from"@spectrum-web-components/icon/src/spectrum-icon-cross.css.js";const h={s:()=>r`
1
+ "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var r=(c,s,t,o)=>{for(var e=o>1?void 0:o?u(s,t):s,a=c.length-1,l;a>=0;a--)(l=c[a])&&(e=(o?l(s,t,e):l(e))||e);return o&&e&&d(s,t,e),e};import{html as i,SizedMixin as p}from"@spectrum-web-components/base";import{property as n}from"@spectrum-web-components/base/src/decorators.js";import{StyledButton as m}from"./StyledButton.js";import b from"@spectrum-web-components/clear-button/src/clear-button.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js";import h from"@spectrum-web-components/icon/src/spectrum-icon-cross.css.js";const v={s:()=>i`
2
2
  <sp-icon-cross75
3
3
  slot="icon"
4
4
  class="icon spectrum-UIIcon-Cross75"
5
5
  ></sp-icon-cross75>
6
- `,m:()=>r`
6
+ `,m:()=>i`
7
7
  <sp-icon-cross100
8
8
  slot="icon"
9
9
  class="icon spectrum-UIIcon-Cross100"
10
10
  ></sp-icon-cross100>
11
- `,l:()=>r`
11
+ `,l:()=>i`
12
12
  <sp-icon-cross200
13
13
  slot="icon"
14
14
  class="icon spectrum-UIIcon-Cross200"
15
15
  ></sp-icon-cross200>
16
- `,xl:()=>r`
16
+ `,xl:()=>i`
17
17
  <sp-icon-cross300
18
18
  slot="icon"
19
19
  class="icon spectrum-UIIcon-Cross300"
20
20
  ></sp-icon-cross300>
21
- `};export class ClearButton extends d(m,{noDefaultSize:!0}){constructor(){super(...arguments);this.quiet=!1}static get styles(){return[...super.styles,v,f]}set variant(e){const s=this._variant,t=this.staticColor;if(e!=="overBackground"){this.removeAttribute("variant"),this._variant=void 0,this.staticColor=void 0;return}this.setAttribute("variant",e),this._variant=e,this.staticColor="white",this.requestUpdate("variant",s),this.requestUpdate("staticColor",t)}get variant(){return this._variant}get buttonContent(){return[h[this.size]()]}render(){return r`
21
+ `};export class ClearButton extends p(m,{noDefaultSize:!0}){constructor(){super(...arguments);this.quiet=!1}static get styles(){return[...super.styles,b,h]}set variant(t){const o=this._variant,e=this.staticColor;if(t!=="overBackground"){this.removeAttribute("variant"),this._variant=void 0,this.staticColor=void 0;return}this.setAttribute("variant",t),this._variant=t,this.staticColor="white",this.requestUpdate("variant",o),this.requestUpdate("staticColor",e)}get variant(){return this._variant}get buttonContent(){return[v[this.size]()]}render(){return i`
22
22
  <div class="fill">${super.render()}</div>
23
- `}}i([l({type:Boolean,reflect:!0})],ClearButton.prototype,"quiet",2),i([l({reflect:!0})],ClearButton.prototype,"variant",1),i([l({reflect:!0,attribute:"static-color"})],ClearButton.prototype,"staticColor",2);
23
+ `}connectedCallback(){super.connectedCallback()}}r([n()],ClearButton.prototype,"label",2),r([n({type:Boolean,reflect:!0})],ClearButton.prototype,"quiet",2),r([n({reflect:!0})],ClearButton.prototype,"variant",1),r([n({reflect:!0,attribute:"static-color"})],ClearButton.prototype,"staticColor",2);
24
24
  //# sourceMappingURL=ClearButton.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ClearButton.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\n\n/**\n * @element sp-clear-button\n *\n * @slot - text label of the Clear Button\n */\nexport class ClearButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /**\n * The visual variant to apply to this button.\n * @deprecated Use `static-color='white'` instead.\n */\n @property({ reflect: true })\n public set variant(variant: 'overBackground' | undefined) {\n const oldValue = this._variant;\n const oldStaticColor = this.staticColor;\n if (variant !== 'overBackground') {\n this.removeAttribute('variant');\n this._variant = undefined;\n this.staticColor = undefined;\n return;\n }\n\n this.setAttribute('variant', variant);\n this._variant = variant;\n // Set staticColor to white to reflect the updated and expected attribute\n this.staticColor = 'white';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'The overBackground variant is deprecated. Please use `static-color=\"white\"` instead.',\n 'https://opensource.adobe.com/spectrum-web-components/components/clear-button/',\n { level: 'deprecation' }\n );\n }\n\n this.requestUpdate('variant', oldValue);\n this.requestUpdate('staticColor', oldStaticColor);\n }\n\n public get variant(): 'overBackground' | undefined {\n return this._variant;\n }\n\n private _variant: 'overBackground' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor: 'white' | undefined;\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n}\n"],
5
- "mappings": "qNAYA,OAEI,QAAAA,EACA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,oBAC7B,OAAOC,MAAkB,gEACzB,MAAO,6DACP,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,OAAOC,MAAuB,+DAE9B,MAAMC,EAAkD,CACpD,EAAG,IAAMN;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMd,EAOO,aAAM,oBAAoBC,EAAWE,EAAc,CACtD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAQH,KAAO,MAAQ,GALf,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,EAAcC,CAAiB,CAC5D,CAUA,IAAW,QAAQE,EAAuC,CACtD,MAAMC,EAAW,KAAK,SAChBC,EAAiB,KAAK,YAC5B,GAAIF,IAAY,iBAAkB,CAC9B,KAAK,gBAAgB,SAAS,EAC9B,KAAK,SAAW,OAChB,KAAK,YAAc,OACnB,MACJ,CAEA,KAAK,aAAa,UAAWA,CAAO,EACpC,KAAK,SAAWA,EAEhB,KAAK,YAAc,QAWnB,KAAK,cAAc,UAAWC,CAAQ,EACtC,KAAK,cAAc,cAAeC,CAAc,CACpD,CAEA,IAAW,SAAwC,CAC/C,OAAO,KAAK,QAChB,CAUA,IAAuB,eAAkC,CACrD,MAAO,CAACH,EAAU,KAAK,IAAI,EAAE,CAAC,CAClC,CAEmB,QAAyB,CACxC,OAAON;AAAA,gCACiB,MAAM,OAAO,CAAC;AAAA,SAE1C,CACJ,CAxDWU,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPjC,YAQF,qBAOIQ,EAAA,CADVR,EAAS,CAAE,QAAS,EAAK,CAAC,GAdlB,YAeE,uBAsCJQ,EAAA,CADNR,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GApD7C,YAqDF",
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\n\n/**\n * @element sp-clear-button\n *\n * @attr {string} label - Required accessible label set as aria-label\n */\nexport class ClearButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * An accessible label that describes the component.\n * It will be applied to aria-label, but not visually rendered.\n * This attribute is required for clear buttons.\n */\n @property()\n public override label!: string;\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /**\n * The visual variant to apply to this button.\n * @deprecated Use `static-color='white'` instead.\n */\n @property({ reflect: true })\n public set variant(variant: 'overBackground' | undefined) {\n const oldValue = this._variant;\n const oldStaticColor = this.staticColor;\n if (variant !== 'overBackground') {\n this.removeAttribute('variant');\n this._variant = undefined;\n this.staticColor = undefined;\n return;\n }\n\n this.setAttribute('variant', variant);\n this._variant = variant;\n // Set staticColor to white to reflect the updated and expected attribute\n this.staticColor = 'white';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'The overBackground variant is deprecated. Please use `static-color=\"white\"` instead.',\n 'https://opensource.adobe.com/spectrum-web-components/components/clear-button/',\n { level: 'deprecation' }\n );\n }\n\n this.requestUpdate('variant', oldValue);\n this.requestUpdate('staticColor', oldStaticColor);\n }\n\n public get variant(): 'overBackground' | undefined {\n return this._variant;\n }\n\n private _variant: 'overBackground' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor: 'white' | undefined;\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n // Deprecation warning for default slot when content is provided\n if (window.__swc.DEBUG && this.textContent?.trim()) {\n window.__swc.warn(\n this,\n `The default slot for text content in <${this.localName}> has been deprecated and will be removed in a future release. The clear button is icon-only and does not render slot content. Use the \"label\" attribute instead to provide an accessible name.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button',\n { level: 'deprecation' }\n );\n }\n\n // Warning for missing label attribute\n if (window.__swc.DEBUG && !this.label) {\n window.__swc.warn(\n this,\n `The \"label\" attribute is required on <${this.localName}> to provide an accessible name for screen readers. Please add a label attribute, e.g., <${this.localName} label=\"Clear\">.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#clear-button',\n { level: 'high' }\n );\n }\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEI,QAAAA,EACA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,oBAC7B,OAAOC,MAAkB,gEACzB,MAAO,6DACP,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,OAAOC,MAAuB,+DAE9B,MAAMC,EAAkD,CACpD,EAAG,IAAMN;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMd,EAOO,aAAM,oBAAoBC,EAAWE,EAAc,CACtD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAgBH,KAAO,MAAQ,GAbf,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,EAAcC,CAAiB,CAC5D,CAkBA,IAAW,QAAQE,EAAuC,CACtD,MAAMC,EAAW,KAAK,SAChBC,EAAiB,KAAK,YAC5B,GAAIF,IAAY,iBAAkB,CAC9B,KAAK,gBAAgB,SAAS,EAC9B,KAAK,SAAW,OAChB,KAAK,YAAc,OACnB,MACJ,CAEA,KAAK,aAAa,UAAWA,CAAO,EACpC,KAAK,SAAWA,EAEhB,KAAK,YAAc,QAWnB,KAAK,cAAc,UAAWC,CAAQ,EACtC,KAAK,cAAc,cAAeC,CAAc,CACpD,CAEA,IAAW,SAAwC,CAC/C,OAAO,KAAK,QAChB,CAUA,IAAuB,eAAkC,CACrD,MAAO,CAACH,EAAU,KAAK,IAAI,EAAE,CAAC,CAClC,CAEmB,QAAyB,CACxC,OAAON;AAAA,gCACiB,MAAM,OAAO,CAAC;AAAA,SAE1C,CAEgB,mBAA0B,CACtC,MAAM,kBAAkB,CAqB5B,CACJ,CAnFoBU,EAAA,CADfR,EAAS,GAZD,YAaO,qBAGTQ,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAfjC,YAgBF,qBAOIQ,EAAA,CADVR,EAAS,CAAE,QAAS,EAAK,CAAC,GAtBlB,YAuBE,uBAsCJQ,EAAA,CADNR,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GA5D7C,YA6DF",
6
6
  "names": ["html", "SizedMixin", "property", "StyledButton", "buttonStyles", "crossMediumStyles", "crossIcon", "variant", "oldValue", "oldStaticColor", "__decorateClass"]
7
7
  }
@@ -58,7 +58,14 @@ export class CloseButton extends SizedMixin(StyledButton, {
58
58
  return [...super.styles, buttonStyles, crossMediumStyles];
59
59
  }
60
60
  get buttonContent() {
61
- return [crossIcon[this.size]()];
61
+ return [
62
+ crossIcon[this.size](),
63
+ html`
64
+ <span id="label" class="visually-hidden">
65
+ <slot @slotchange=${this.manageTextObservedSlot}></slot>
66
+ </span>
67
+ `
68
+ ];
62
69
  }
63
70
  }
64
71
  __decorateClass([
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["CloseButton.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from '@spectrum-web-components/close-button/src/close-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\nimport type { ButtonStaticColors } from './Button.dev.js'\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n m: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n l: () => html`\n <sp-icon-cross400\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross400\"\n ></sp-icon-cross400>\n `,\n xl: () => html`\n <sp-icon-cross500\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross500\"\n ></sp-icon-cross500>\n `,\n};\n\n/**\n * @element sp-close-button\n *\n * @slot - text label of the Close Button\n */\nexport class CloseButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public variant: ButtonStaticColors | '' = '';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'black' | 'white';\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,uBAAuB;AAG9B,MAAM,YAAkD;AAAA,EACpD,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAMd;AAOO,aAAM,oBAAoB,WAAW,cAAc;AAAA,EACtD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAWH,SAAO,UAAmC;AAAA;AAAA,EAR1C,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,cAAc,iBAAiB;AAAA,EAC5D;AAAA,EAWA,IAAuB,gBAAkC;AACrD,WAAO,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;AAAA,EAClC;AACJ;AARW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAVlB,YAWF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GAb7C,YAcF;",
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from '@spectrum-web-components/close-button/src/close-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\nimport type { ButtonStaticColors } from './Button.dev.js'\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n m: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n l: () => html`\n <sp-icon-cross400\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross400\"\n ></sp-icon-cross400>\n `,\n xl: () => html`\n <sp-icon-cross500\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross500\"\n ></sp-icon-cross500>\n `,\n};\n\n/**\n * @element sp-close-button\n *\n * @slot - text label of the Close Button\n */\nexport class CloseButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public variant: ButtonStaticColors | '' = '';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'black' | 'white';\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n crossIcon[this.size](),\n html`\n <span id=\"label\" class=\"visually-hidden\">\n <slot @slotchange=${this.manageTextObservedSlot}></slot>\n </span>\n `,\n ];\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,uBAAuB;AAG9B,MAAM,YAAkD;AAAA,EACpD,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAMd;AAOO,aAAM,oBAAoB,WAAW,cAAc;AAAA,EACtD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAWH,SAAO,UAAmC;AAAA;AAAA,EAR1C,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,cAAc,iBAAiB;AAAA,EAC5D;AAAA,EAWA,IAAuB,gBAAkC;AACrD,WAAO;AAAA,MACH,UAAU,KAAK,IAAI,EAAE;AAAA,MACrB;AAAA;AAAA,wCAE4B,KAAK,sBAAsB;AAAA;AAAA;AAAA,IAG3D;AAAA,EACJ;AACJ;AAfW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAVlB,YAWF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GAb7C,YAcF;",
6
6
  "names": []
7
7
  }
@@ -1,22 +1,26 @@
1
- "use strict";var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=(c,s,e,o)=>{for(var t=o>1?void 0:o?u(s,e):s,i=c.length-1,n;i>=0;i--)(n=c[i])&&(t=(o?n(s,e,t):n(t))||t);return o&&t&&m(s,e,t),t};import{html as r,SizedMixin as a}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import{StyledButton as S}from"./StyledButton.js";import f from"@spectrum-web-components/close-button/src/close-button.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js";import y from"@spectrum-web-components/icon/src/spectrum-icon-cross.css.js";const C={s:()=>r`
1
+ "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var n=(e,t,c,r)=>{for(var s=r>1?void 0:r?m(t,c):t,i=e.length-1,l;i>=0;i--)(l=e[i])&&(s=(r?l(t,c,s):l(s))||s);return r&&s&&a(t,c,s),s};import{html as o,SizedMixin as u}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import{StyledButton as d}from"./StyledButton.js";import S from"@spectrum-web-components/close-button/src/close-button.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js";import y from"@spectrum-web-components/icon/src/spectrum-icon-cross.css.js";const b={s:()=>o`
2
2
  <sp-icon-cross200
3
3
  slot="icon"
4
4
  class="icon spectrum-UIIcon-Cross200"
5
5
  ></sp-icon-cross200>
6
- `,m:()=>r`
6
+ `,m:()=>o`
7
7
  <sp-icon-cross300
8
8
  slot="icon"
9
9
  class="icon spectrum-UIIcon-Cross300"
10
10
  ></sp-icon-cross300>
11
- `,l:()=>r`
11
+ `,l:()=>o`
12
12
  <sp-icon-cross400
13
13
  slot="icon"
14
14
  class="icon spectrum-UIIcon-Cross400"
15
15
  ></sp-icon-cross400>
16
- `,xl:()=>r`
16
+ `,xl:()=>o`
17
17
  <sp-icon-cross500
18
18
  slot="icon"
19
19
  class="icon spectrum-UIIcon-Cross500"
20
20
  ></sp-icon-cross500>
21
- `};export class CloseButton extends a(S,{noDefaultSize:!0}){constructor(){super(...arguments);this.variant=""}static get styles(){return[...super.styles,f,y]}get buttonContent(){return[C[this.size]()]}}l([p({reflect:!0})],CloseButton.prototype,"variant",2),l([p({reflect:!0,attribute:"static-color"})],CloseButton.prototype,"staticColor",2);
21
+ `};export class CloseButton extends u(d,{noDefaultSize:!0}){constructor(){super(...arguments);this.variant=""}static get styles(){return[...super.styles,S,y]}get buttonContent(){return[b[this.size](),o`
22
+ <span id="label" class="visually-hidden">
23
+ <slot @slotchange=${this.manageTextObservedSlot}></slot>
24
+ </span>
25
+ `]}}n([p({reflect:!0})],CloseButton.prototype,"variant",2),n([p({reflect:!0,attribute:"static-color"})],CloseButton.prototype,"staticColor",2);
22
26
  //# sourceMappingURL=CloseButton.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["CloseButton.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from '@spectrum-web-components/close-button/src/close-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\nimport type { ButtonStaticColors } from './Button.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n m: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n l: () => html`\n <sp-icon-cross400\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross400\"\n ></sp-icon-cross400>\n `,\n xl: () => html`\n <sp-icon-cross500\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross500\"\n ></sp-icon-cross500>\n `,\n};\n\n/**\n * @element sp-close-button\n *\n * @slot - text label of the Close Button\n */\nexport class CloseButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public variant: ButtonStaticColors | '' = '';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'black' | 'white';\n\n protected override get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n}\n"],
5
- "mappings": "qNAYA,OAEI,QAAAA,EACA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,oBAC7B,OAAOC,MAAkB,gEACzB,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,OAAOC,MAAuB,+DAG9B,MAAMC,EAAkD,CACpD,EAAG,IAAMN;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMd,EAOO,aAAM,oBAAoBC,EAAWE,EAAc,CACtD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAWH,KAAO,QAAmC,GAR1C,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,EAAcC,CAAiB,CAC5D,CAWA,IAAuB,eAAkC,CACrD,MAAO,CAACC,EAAU,KAAK,IAAI,EAAE,CAAC,CAClC,CACJ,CARWC,EAAA,CADNL,EAAS,CAAE,QAAS,EAAK,CAAC,GAVlB,YAWF,uBAGAK,EAAA,CADNL,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GAb7C,YAcF",
4
+ "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from '@spectrum-web-components/close-button/src/close-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross400.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross500.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\nimport type { ButtonStaticColors } from './Button.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n m: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n l: () => html`\n <sp-icon-cross400\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross400\"\n ></sp-icon-cross400>\n `,\n xl: () => html`\n <sp-icon-cross500\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross500\"\n ></sp-icon-cross500>\n `,\n};\n\n/**\n * @element sp-close-button\n *\n * @slot - text label of the Close Button\n */\nexport class CloseButton extends SizedMixin(StyledButton, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public variant: ButtonStaticColors | '' = '';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'black' | 'white';\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n crossIcon[this.size](),\n html`\n <span id=\"label\" class=\"visually-hidden\">\n <slot @slotchange=${this.manageTextObservedSlot}></slot>\n </span>\n `,\n ];\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEI,QAAAA,EACA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,oBAC7B,OAAOC,MAAkB,gEACzB,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,MAAO,8DACP,OAAOC,MAAuB,+DAG9B,MAAMC,EAAkD,CACpD,EAAG,IAAMN;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA,KAMd,EAOO,aAAM,oBAAoBC,EAAWE,EAAc,CACtD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAWH,KAAO,QAAmC,GAR1C,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,EAAcC,CAAiB,CAC5D,CAWA,IAAuB,eAAkC,CACrD,MAAO,CACHC,EAAU,KAAK,IAAI,EAAE,EACrBN;AAAA;AAAA,wCAE4B,KAAK,sBAAsB;AAAA;AAAA,aAG3D,CACJ,CACJ,CAfWO,EAAA,CADNL,EAAS,CAAE,QAAS,EAAK,CAAC,GAVlB,YAWF,uBAGAK,EAAA,CADNL,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GAb7C,YAcF",
6
6
  "names": ["html", "SizedMixin", "property", "StyledButton", "buttonStyles", "crossMediumStyles", "crossIcon", "__decorateClass"]
7
7
  }