{"version":3,"sources":["components/accordion/accordion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,CAAC;AAI1B;;;GAGG;AACH,cACM,WAAY,SAAQ,UAAU;IAClC;;OAEG;IAEH,IAAI,iBAA0B;IAE9B,iBAAiB;IAOjB,OAAO,CAAC,iBAAiB,KAAA;IASzB,MAAM;IAIN,MAAM,KAAK,sBAAsB,WAEhC;IAED,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,WAAW,CAAC","file":"accordion.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2021\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport { ACCORDION_SIZE } from './defs';\nimport styles from './accordion.scss';\n\nexport { ACCORDION_SIZE };\n\nconst { prefix } = settings;\n\n/**\n * Accordion container.\n * @element bx-accordion\n */\n@customElement(`${prefix}-accordion`)\nclass BXAccordion extends LitElement {\n  /**\n   * Accordion size.\n   */\n  @property({ reflect: true })\n  size = ACCORDION_SIZE.REGULAR;\n\n  connectedCallback() {\n    if (!this.hasAttribute('role')) {\n      this.setAttribute('role', 'list');\n    }\n    super.connectedCallback();\n  }\n\n  updated(changedProperties) {\n    if (changedProperties.has('size')) {\n      // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n      forEach(this.querySelectorAll((this.constructor as typeof BXAccordion).selectorAccordionItems), elem => {\n        elem.setAttribute('size', this.size);\n      });\n    }\n  }\n\n  render() {\n    return html`<slot></slot>`;\n  }\n\n  static get selectorAccordionItems() {\n    return `${prefix}-accordion-item`;\n  }\n\n  static styles = styles;\n}\n\nexport default BXAccordion;\n"]}