{"version":3,"sources":["components/modal/modal-close-button.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASxE;;;;;GAKG;AACH,cACM,kBAAmB,SAAQ,uBAAsB;IACrD;;OAEG;IAEH,aAAa,SAAW;IAExB,gBAAgB;IAOhB,MAAM;IAgBN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,kBAAkB,CAAC","file":"modal-close-button.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 Close20 from '@carbon/icons/lib/close/20';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './modal.scss';\n\nconst { prefix } = settings;\n\n/**\n * Modal close button.\n * @element bx-modal-close-button\n * @csspart button The button.\n * @csspart close-icon The close icon.\n */\n@customElement(`${prefix}-modal-close-button`)\nclass BXModalCloseButton extends FocusMixin(LitElement) {\n  /**\n   * The assistive text for the button.\n   */\n  @property({ attribute: 'assistive-text' })\n  assistiveText = 'Close';\n\n  createRenderRoot() {\n    return this.attachShadow({\n      mode: 'open',\n      delegatesFocus: Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <= 537,\n    });\n  }\n\n  render() {\n    const { assistiveText } = this;\n    return html`\n      <button\n        part=\"button\"\n        aria-label=\"${ifNonNull(assistiveText)}\"\n        class=\"${prefix}--modal-close\"\n        title=\"${ifNonNull(assistiveText)}\">\n        ${Close20({\n          part: 'close-icon',\n          class: `${prefix}--modal-close__icon`,\n        })}\n      </button>\n    `;\n  }\n\n  static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXModalCloseButton;\n"]}