@spectrum-web-components/accordion 1.2.0-beta.11 → 1.2.0-beta.12

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/accordion",
3
- "version": "1.2.0-beta.11",
3
+ "version": "1.2.0-beta.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -68,11 +68,11 @@
68
68
  "lit-html"
69
69
  ],
70
70
  "dependencies": {
71
- "@spectrum-web-components/base": "^1.2.0-beta.11",
72
- "@spectrum-web-components/icon": "^1.2.0-beta.11",
73
- "@spectrum-web-components/icons-ui": "^1.2.0-beta.11",
74
- "@spectrum-web-components/reactive-controllers": "^1.2.0-beta.11",
75
- "@spectrum-web-components/shared": "^1.2.0-beta.11"
71
+ "@spectrum-web-components/base": "^1.2.0-beta.12",
72
+ "@spectrum-web-components/icon": "^1.2.0-beta.12",
73
+ "@spectrum-web-components/icons-ui": "^1.2.0-beta.12",
74
+ "@spectrum-web-components/reactive-controllers": "^1.2.0-beta.12",
75
+ "@spectrum-web-components/shared": "^1.2.0-beta.12"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@spectrum-css/accordion": "6.0.0-s2-foundations.16"
@@ -83,5 +83,5 @@
83
83
  "./sp-*.js",
84
84
  "./**/*.dev.js"
85
85
  ],
86
- "gitHead": "75f083178efc8593564132048c87594639405fa2"
86
+ "gitHead": "c14029936cd6224fb669993a9890b2ed0c3c9575"
87
87
  }
@@ -18,7 +18,6 @@ import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
18
18
  import { when } from "@spectrum-web-components/base/src/directives.js";
19
19
  import "@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";
20
20
  import chevronIconStyles from "@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";
21
- import chevronIconOverrides from "@spectrum-web-components/icon/src/icon-chevron-overrides.css.js";
22
21
  import styles from "./accordion-item.css.js";
23
22
  const chevronIcon = {
24
23
  s: () => html`
@@ -67,7 +66,7 @@ export class AccordionItem extends SizedMixin(Focusable, {
67
66
  };
68
67
  }
69
68
  static get styles() {
70
- return [styles, chevronIconStyles, chevronIconOverrides];
69
+ return [styles, chevronIconStyles];
71
70
  }
72
71
  get focusElement() {
73
72
  return this.shadowRoot.querySelector("#header");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["AccordionItem.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronIconStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport chevronIconOverrides from '@spectrum-web-components/icon/src/icon-chevron-overrides.css.js';\n\nimport styles from './accordion-item.css.js';\n\nconst chevronIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight75\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n m: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight100\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n l: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight200\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n xl: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight300\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n};\n\n/**\n * @element sp-accordion-item\n * @slot - The content of the item that is hidden when the item is not open\n * @fires sp-accordion-item-toggle - Announce that an accordion item has been toggled while allowing the event to be cancelled.\n */\nexport class AccordionItem extends SizedMixin(Focusable, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronIconStyles, chevronIconOverrides];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#header') as HTMLElement;\n }\n\n private onClick(): void {\n /* c8 ignore next 3 */\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n private toggle(): void {\n this.open = !this.open;\n const applyDefault = this.dispatchEvent(\n new CustomEvent('sp-accordion-item-toggle', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.open = !this.open;\n }\n }\n\n protected renderChevronIcon = (): TemplateResult => {\n return chevronIcon[this.size || 'm']();\n };\n\n protected override render(): TemplateResult {\n return html`\n <h3 id=\"heading\">\n ${when(this.size, this.renderChevronIcon)}\n <button\n id=\"header\"\n @click=${this.onClick}\n aria-expanded=${this.open}\n aria-controls=\"content\"\n ?disabled=${this.disabled}\n >\n ${this.label}\n </button>\n </h3>\n <div id=\"content\" role=\"region\" aria-labelledby=\"header\">\n <slot></slot>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('a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AAC,cAAc;AACf,WAAK,OAAO,CAAC,KAAK;AAAA,IACtB;AAAA,EACJ;AAAA,EAMmB,SAAyB;AACxC,WAAO;AAAA;AAAA,kBAEG,KAAK,KAAK,MAAM,KAAK,iBAAiB,CAAC;AAAA;AAAA;AAAA,6BAG5B,KAAK,OAAO;AAAA,oCACL,KAAK,IAAI;AAAA;AAAA,gCAEb,KAAK,QAAQ;AAAA;AAAA,sBAEvB,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5B;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UAAI,KAAK,UAAU;AACf,aAAK,aAAa,iBAAiB,MAAM;AAAA,MAC7C,OAAO;AACH,aAAK,gBAAgB,eAAe;AAAA,MACxC;AAAA,IACJ;AAAA,EACJ;AACJ;AApEW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAPjC,cAQF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAVhC,cAWF;AAGS;AAAA,EADf,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAbjC,cAcO;",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronIconStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\n\nimport styles from './accordion-item.css.js';\n\nconst chevronIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight75\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n m: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight100\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n l: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight200\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n xl: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight300\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n};\n\n/**\n * @element sp-accordion-item\n * @slot - The content of the item that is hidden when the item is not open\n * @fires sp-accordion-item-toggle - Announce that an accordion item has been toggled while allowing the event to be cancelled.\n */\nexport class AccordionItem extends SizedMixin(Focusable, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronIconStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#header') as HTMLElement;\n }\n\n private onClick(): void {\n /* c8 ignore next 3 */\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n private toggle(): void {\n this.open = !this.open;\n const applyDefault = this.dispatchEvent(\n new CustomEvent('sp-accordion-item-toggle', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.open = !this.open;\n }\n }\n\n protected renderChevronIcon = (): TemplateResult => {\n return chevronIcon[this.size || 'm']();\n };\n\n protected override render(): TemplateResult {\n return html`\n <h3 id=\"heading\">\n ${when(this.size, this.renderChevronIcon)}\n <button\n id=\"header\"\n @click=${this.onClick}\n aria-expanded=${this.open}\n aria-controls=\"content\"\n ?disabled=${this.disabled}\n >\n ${this.label}\n </button>\n </h3>\n <div id=\"content\" role=\"region\" aria-labelledby=\"header\">\n <slot></slot>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,OAAO;AACP,OAAO,uBAAuB;AAE9B,OAAO,YAAY;AAEnB,MAAM,cAAoD;AAAA,EACtD,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,GAAG,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQd;AAOO,aAAM,sBAAsB,WAAW,WAAW;AAAA,EACrD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAQH,SAAO,OAAO;AAGd,SAAO,QAAQ;AAGf,SAAgB,WAAW;AA4B3B,SAAU,oBAAoB,MAAsB;AAChD,aAAO,YAAY,KAAK,QAAQ,GAAG,EAAE;AAAA,IACzC;AAAA;AAAA,EAzCA,WAA2B,SAAyB;AAChD,WAAO,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1,4 @@
1
- "use strict";var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=(n,o,e,i)=>{for(var t=i>1?void 0:i?d(o,e):o,l=n.length-1,a;l>=0;l--)(a=n[l])&&(t=(i?a(o,e,t):a(t))||t);return i&&t&&p(o,e,t),t};import{html as r,SizedMixin as h}from"@spectrum-web-components/base";import{property as c}from"@spectrum-web-components/base/src/decorators.js";import{Focusable as u}from"@spectrum-web-components/shared/src/focusable.js";import{when as v}from"@spectrum-web-components/base/src/directives.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";import m from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import b from"@spectrum-web-components/icon/src/icon-chevron-overrides.css.js";import f from"./accordion-item.css.js";const g={s:()=>r`
1
+ "use strict";var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=(n,o,e,i)=>{for(var t=i>1?void 0:i?d(o,e):o,l=n.length-1,a;l>=0;l--)(a=n[l])&&(t=(i?a(o,e,t):a(t))||t);return i&&t&&p(o,e,t),t};import{html as r,SizedMixin as h}from"@spectrum-web-components/base";import{property as c}from"@spectrum-web-components/base/src/decorators.js";import{Focusable as u}from"@spectrum-web-components/shared/src/focusable.js";import{when as v}from"@spectrum-web-components/base/src/directives.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";import m from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import b from"./accordion-item.css.js";const f={s:()=>r`
2
2
  <span class="iconContainer">
3
3
  <sp-icon-chevron100
4
4
  class="indicator spectrum-UIIcon-ChevronRight75"
@@ -26,7 +26,7 @@
26
26
  slot="icon"
27
27
  ></sp-icon-chevron100>
28
28
  </span>
29
- `};export class AccordionItem extends h(u,{noDefaultSize:!0}){constructor(){super(...arguments);this.open=!1;this.label="";this.disabled=!1;this.renderChevronIcon=()=>g[this.size||"m"]()}static get styles(){return[f,m,b]}get focusElement(){return this.shadowRoot.querySelector("#header")}onClick(){this.disabled||this.toggle()}toggle(){this.open=!this.open,this.dispatchEvent(new CustomEvent("sp-accordion-item-toggle",{bubbles:!0,composed:!0,cancelable:!0}))||(this.open=!this.open)}render(){return r`
29
+ `};export class AccordionItem extends h(u,{noDefaultSize:!0}){constructor(){super(...arguments);this.open=!1;this.label="";this.disabled=!1;this.renderChevronIcon=()=>f[this.size||"m"]()}static get styles(){return[b,m]}get focusElement(){return this.shadowRoot.querySelector("#header")}onClick(){this.disabled||this.toggle()}toggle(){this.open=!this.open,this.dispatchEvent(new CustomEvent("sp-accordion-item-toggle",{bubbles:!0,composed:!0,cancelable:!0}))||(this.open=!this.open)}render(){return r`
30
30
  <h3 id="heading">
31
31
  ${v(this.size,this.renderChevronIcon)}
32
32
  <button
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["AccordionItem.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronIconStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport chevronIconOverrides from '@spectrum-web-components/icon/src/icon-chevron-overrides.css.js';\n\nimport styles from './accordion-item.css.js';\n\nconst chevronIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight75\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n m: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight100\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n l: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight200\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n xl: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight300\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n};\n\n/**\n * @element sp-accordion-item\n * @slot - The content of the item that is hidden when the item is not open\n * @fires sp-accordion-item-toggle - Announce that an accordion item has been toggled while allowing the event to be cancelled.\n */\nexport class AccordionItem extends SizedMixin(Focusable, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronIconStyles, chevronIconOverrides];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#header') as HTMLElement;\n }\n\n private onClick(): void {\n /* c8 ignore next 3 */\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n private toggle(): void {\n this.open = !this.open;\n const applyDefault = this.dispatchEvent(\n new CustomEvent('sp-accordion-item-toggle', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.open = !this.open;\n }\n }\n\n protected renderChevronIcon = (): TemplateResult => {\n return chevronIcon[this.size || 'm']();\n };\n\n protected override render(): TemplateResult {\n return html`\n <h3 id=\"heading\">\n ${when(this.size, this.renderChevronIcon)}\n <button\n id=\"header\"\n @click=${this.onClick}\n aria-expanded=${this.open}\n aria-controls=\"content\"\n ?disabled=${this.disabled}\n >\n ${this.label}\n </button>\n </h3>\n <div id=\"content\" role=\"region\" aria-labelledby=\"header\">\n <slot></slot>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],
5
- "mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,mDAC1B,OAAS,QAAAC,MAAY,kDACrB,MAAO,gEACP,OAAOC,MAAuB,iEAC9B,OAAOC,MAA0B,kEAEjC,OAAOC,MAAY,0BAEnB,MAAMC,EAAoD,CACtD,EAAG,IAAMR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQd,EAOO,aAAM,sBAAsBC,EAAWE,EAAW,CACrD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAQH,KAAO,KAAO,GAGd,KAAO,MAAQ,GAGf,KAAgB,SAAW,GA4B3B,KAAU,kBAAoB,IACnBK,EAAY,KAAK,MAAQ,GAAG,EAAE,EAxCzC,WAA2B,QAAyB,CAChD,MAAO,CAACD,EAAQF,EAAmBC,CAAoB,CAC3D,CAWA,IAAoB,cAA4B,CAC5C,OAAO,KAAK,WAAW,cAAc,SAAS,CAClD,CAEQ,SAAgB,CAEhB,KAAK,UAGT,KAAK,OAAO,CAChB,CAEQ,QAAe,CACnB,KAAK,KAAO,CAAC,KAAK,KACG,KAAK,cACtB,IAAI,YAAY,2BAA4B,CACxC,QAAS,GACT,SAAU,GACV,WAAY,EAChB,CAAC,CACL,IAEI,KAAK,KAAO,CAAC,KAAK,KAE1B,CAMmB,QAAyB,CACxC,OAAON;AAAA;AAAA,kBAEGI,EAAK,KAAK,KAAM,KAAK,iBAAiB,CAAC;AAAA;AAAA;AAAA,6BAG5B,KAAK,OAAO;AAAA,oCACL,KAAK,IAAI;AAAA;AAAA,gCAEb,KAAK,QAAQ;AAAA;AAAA,sBAEvB,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAO5B,CAEmB,QAAQK,EAA+B,CACtD,MAAM,QAAQA,CAAO,EACjBA,EAAQ,IAAI,UAAU,IAClB,KAAK,SACL,KAAK,aAAa,gBAAiB,MAAM,EAEzC,KAAK,gBAAgB,eAAe,EAGhD,CACJ,CApEWC,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPjC,cAQF,oBAGAQ,EAAA,CADNR,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAVhC,cAWF,qBAGSQ,EAAA,CADfR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAbjC,cAcO",
6
- "names": ["html", "SizedMixin", "property", "Focusable", "when", "chevronIconStyles", "chevronIconOverrides", "styles", "chevronIcon", "changes", "__decorateClass"]
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronIconStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\n\nimport styles from './accordion-item.css.js';\n\nconst chevronIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight75\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n m: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight100\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n l: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight200\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n xl: () => html`\n <span class=\"iconContainer\">\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight300\"\n slot=\"icon\"\n ></sp-icon-chevron100>\n </span>\n `,\n};\n\n/**\n * @element sp-accordion-item\n * @slot - The content of the item that is hidden when the item is not open\n * @fires sp-accordion-item-toggle - Announce that an accordion item has been toggled while allowing the event to be cancelled.\n */\nexport class AccordionItem extends SizedMixin(Focusable, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronIconStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#header') as HTMLElement;\n }\n\n private onClick(): void {\n /* c8 ignore next 3 */\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n private toggle(): void {\n this.open = !this.open;\n const applyDefault = this.dispatchEvent(\n new CustomEvent('sp-accordion-item-toggle', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.open = !this.open;\n }\n }\n\n protected renderChevronIcon = (): TemplateResult => {\n return chevronIcon[this.size || 'm']();\n };\n\n protected override render(): TemplateResult {\n return html`\n <h3 id=\"heading\">\n ${when(this.size, this.renderChevronIcon)}\n <button\n id=\"header\"\n @click=${this.onClick}\n aria-expanded=${this.open}\n aria-controls=\"content\"\n ?disabled=${this.disabled}\n >\n ${this.label}\n </button>\n </h3>\n <div id=\"content\" role=\"region\" aria-labelledby=\"header\">\n <slot></slot>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,mDAC1B,OAAS,QAAAC,MAAY,kDACrB,MAAO,gEACP,OAAOC,MAAuB,iEAE9B,OAAOC,MAAY,0BAEnB,MAAMC,EAAoD,CACtD,EAAG,IAAMP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,EAAG,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQT,GAAI,IAAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAQd,EAOO,aAAM,sBAAsBC,EAAWE,EAAW,CACrD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAQH,KAAO,KAAO,GAGd,KAAO,MAAQ,GAGf,KAAgB,SAAW,GA4B3B,KAAU,kBAAoB,IACnBI,EAAY,KAAK,MAAQ,GAAG,EAAE,EAxCzC,WAA2B,QAAyB,CAChD,MAAO,CAACD,EAAQD,CAAiB,CACrC,CAWA,IAAoB,cAA4B,CAC5C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