import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { d as downSmall } from './index2.js';
import { d as defineCustomElement$2 } from './pds-icon2.js';

const baseCss = ":where(*:not(slot),*:not(slot)::before,*:not(slot)::after){-webkit-box-sizing:border-box;box-sizing:border-box}:where(*:not(slot)){margin:0}:where(img,picture,video,canvas,svg){display:block;max-width:100%}:where(input,button,textarea,select){font:inherit}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(a:not([href]):not([class])){color:currentColor;text-decoration:none}:where(a:not([href]):not([class]):hover){color:currentColor;text-decoration:none}:where(ul[role=list],ol[role=list]){list-style:none}:where(table){border-collapse:collapse;border-spacing:0}:where(*:not(slot)){font:var(--pine-typography-body-md-default);letter-spacing:var(--pine-letter-spacing-body-md)}:where(h1,h2,h3,h4,h5,h6){font-family:var(--pine-font-family-heading);color:var(--pine-color-grey-950)}:where(h1){font:var(--pine-typography-heading-h1);letter-spacing:var(--pine-letter-spacing-heading-h1)}:where(h2){font:var(--pine-typography-heading-h2);letter-spacing:var(--pine-letter-spacing-heading-h2)}:where(h3){font:var(--pine-typography-heading-h3);letter-spacing:var(--pine-letter-spacing-heading-h3)}:where(h4){font:var(--pine-typography-heading-h4);letter-spacing:var(--pine-letter-spacing-heading-h4)}:where(h5){font:var(--pine-typography-heading-h5);letter-spacing:var(--pine-letter-spacing-heading-h5)}:where(h6){font:var(--pine-typography-heading-h6);letter-spacing:var(--pine-letter-spacing-heading-h6)}:where(div,label,p,span){color:var(--pine-color-text-default)}:where(code,kbd,pre,samp){font-family:monospace}:where([role=button]){cursor:pointer}:where(:focus){outline:0}:where(:focus-visible){outline:var(--pine-border-width-thick) solid var(--pine-color-purple-500)}:where([hidden]){display:none !important}";
const PdsAccordionStyle0 = baseCss;

const pdsAccordionCss = ":host{display:block}details{--border-radius-default:var(--pine-border-radius-default);--box-shadow-focus:0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-purple-300);--color-background-default:var(--pine-color-white);--color-background-hover:var(--pine-color-grey-150);--color-text-default:var(--pine-color-text-interactive-default);--color-text-active:var(--pine-color-grey-950);--color-text-hover:var(--pine-color-grey-800);--font-weight-active:var(--pine-font-weight-semi-bold);--number-animation-transform-timing:200ms;--spacing-details-padding-inline:var(--pine-spacing-150);--spacing-details-padding-block-end:calc(var(--pine-spacing-200) + 2);--spacing-summary-padding-block:calc(var(--pine-spacing-150) / 2);--spacing-summary-padding-inline-start:var(--pine-spacing-100);--spacing-summary-padding-inline-end:var(--pine-spacing-050);--typography-default:var(--pine-typography-body-md-medium);border-radius:var(--border-radius-default)}details pds-icon{-webkit-transform:scaleY(1);transform:scaleY(1)}details[open]{background-color:var(--color-background-default)}details[open] summary{color:var(--color-text-active);font-weight:var(--font-weight-active)}details[open] summary pds-icon{-webkit-transform:scaleY(-1);transform:scaleY(-1)}summary{background-color:var(--color-background-default);border-radius:var(--border-radius-default);color:var(--color-text-default);font:var(--typography-default);padding-block:var(--spacing-summary-padding-block);-webkit-padding-end:var(--spacing-summary-padding-inline-end);padding-inline-end:var(--spacing-summary-padding-inline-end);-webkit-padding-start:var(--spacing-summary-padding-inline-start);padding-inline-start:var(--spacing-summary-padding-inline-start);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}summary::-webkit-details-marker{display:none}summary:hover{background:var(--color-background-hover);color:var(--color-text-hover);cursor:pointer}summary:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none;position:relative}summary pds-icon{-webkit-margin-start:auto;margin-inline-start:auto}.pds-accordion__body{-webkit-padding-after:var(--spacing-details-padding-block-end);padding-block-end:var(--spacing-details-padding-block-end);padding-inline:var(--spacing-details-padding-inline)}";
const PdsAccordionStyle1 = pdsAccordionCss;

const PdsAccordion$1 = /*@__PURE__*/ proxyCustomElement(class PdsAccordion extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.handleToggle = () => {
            this.isOpen = this.detailsEl.open;
        };
        this.getOpenAttribute = () => {
            if (this.isOpen !== false) {
                return { open: true };
            }
            return '';
        };
        this.componentId = undefined;
        this.isOpen = false;
    }
    handleOpenState(newValue) {
        this.isOpen = newValue;
    }
    componentDidLoad() {
        this.detailsEl.addEventListener('toggle', this.handleToggle);
    }
    render() {
        return (h(Host, { key: '9a8c2f915879f63d8a7255cf0f58b55f4b590eed', class: "pds-accordion", id: this.componentId }, h("details", Object.assign({ key: 'f5428c5e340c55750fb94d85dfd7cdbb853c32de' }, this.getOpenAttribute(), { ref: (el) => (this.detailsEl = el) }), h("summary", { key: '9255f9c850016e964d468ed35578c01159b7f234', part: "accordion-button" }, h("slot", { key: '2b1dba36c97ed9c46b1efe7aac44cae4203e7a50', name: "label" }, "Details"), h("pds-icon", { key: '9185cfd595c09a15c57fe1e1d89a2895c461aa46', icon: downSmall })), h("div", { key: '41d030c5ffc2cee2099f141e80695c1f4e6ddcb0', part: "accordion-body", class: "pds-accordion__body" }, h("slot", { key: 'b10afd83e6bec657dfa88cdf4a73f32f12d46935' })))));
    }
    static get watchers() { return {
        "isOpen": ["handleOpenState"]
    }; }
    static get style() { return PdsAccordionStyle0 + PdsAccordionStyle1; }
}, [1, "pds-accordion", {
        "componentId": [1, "component-id"],
        "isOpen": [1540, "open"]
    }, undefined, {
        "isOpen": ["handleOpenState"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["pds-accordion", "pds-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "pds-accordion":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, PdsAccordion$1);
            }
            break;
        case "pds-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const PdsAccordion = PdsAccordion$1;
const defineCustomElement = defineCustomElement$1;

export { PdsAccordion, defineCustomElement };

//# sourceMappingURL=pds-accordion.js.map