import { h, Fragment } from "@stencil/core";
export class DgaCardV2 {
    constructor() {
        this.type = 'default';
        this.showTitle = true;
        this.showDescription = true;
        this.showFeaturedIcon = true;
        this.image = '';
        this.disabled = false;
        this.effect = 'with-shadow';
        this.cardTitle = 'Card Title';
        this.description = 'Card content placeholder text goes here';
        this.featuredIcon = {
            name: 'checkmark-circle-02',
            variant: 'stroke',
            type: 'sharp',
            size: 24
        }; // Default icon
        this.showSecondaryAction = true;
        this.isSelected = false;
        this.secondaryActionLabel = 'Secondary Action';
        this.onCheckboxChange = () => { };
        this.onExpandAction = () => { };
        this.width = '360px';
        this.maxWidth = '100%';
        this.minWidth = 'fit-content';
        this.isFocused = false;
        this.expanded = false;
        this.onMouseEnterHandler = () => {
            this.isFocused = true;
        };
        this.onMouseLeaveHandler = () => {
            this.isFocused = false;
        };
        this.cardStyles = {
            width: this.width,
            maxWidth: this.maxWidth,
            minWidth: this.minWidth
        };
    }
    toggleExpand() {
        this.expanded = !this.expanded;
    }
    componentWillLoad() {
        this.el.childNodes.forEach(item => {
            const el = item;
            if (el.tagName === 'DGA-CARD-CONTENT' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'card-content');
            }
            if (el.tagName === 'DGA-CARD-ACTIONS' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'card-actions');
            }
            if (el.tagName === 'DGA-CARD-EXPANDABLE-CONTENT' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'card-expandable-content');
            }
        });
    }
    render() {
        return (h("div", Object.assign({ key: 'd9a014a7e9ca9a5cedb5e6fbe773ebe80d32c2de', class: `card ${this.disabled ? 'disabled' : ''} ${this.isFocused ? 'focused' : ''} card--${this.effect}`, onMouseEnter: this.onMouseEnterHandler, onMouseLeave: this.onMouseLeaveHandler }, (this.type === 'selectable' ? { onClick: this.onCheckboxChange } : {}), { style: this.cardStyles }), this.image && (h("div", { key: 'c9c12633dd704531e3c93be342e056e0e3cb0bd4', class: "card__image-container" }, h("img", { key: '5f6f1023f8ce3f4e071eacc25893905b048a75a4', src: this.image, alt: "Card" }))), this.showFeaturedIcon && h("div", { key: 'e11aee373284236b096efca2a5fbb2ad656bde76', class: "featured-icon featured-icon--light-brand featured-icon--circle featured-icon--lg" }, h("dga-icon-v2", Object.assign({ key: 'ccf5c76f704c4fb288b5d4c060b971a28e3d3659' }, this.featuredIcon))), this.type === 'selectable' && (h("div", { key: '898b6e0c25f1e1f9365ceae729ddc0e861187032', class: "card__checkbox-container" }, h("dga-checkbox", { key: '010fa7ebcb7c2dc625ada4cf110e53b03b37384d', checked: this.isSelected, color: "brand", onChange: this.onCheckboxChange }))), (this.showTitle || this.showDescription) && (h("div", { key: '12839eb7621221701d8187efb37bb374eac42e87', class: "card__content-text dga-flex-column" }, this.showTitle && h("h4", { key: '3db3050299aba6fa88366a1b6464ad30be784c2f', class: "text-lg-bold" }, this.cardTitle, " "), this.showDescription && h("p", { key: '023751997630eaee52627af4a3b7c5e120e570d2', class: "text-md-regular" }, this.description))), h("slot", { key: 'ef79ce42616f24a0ef4a80eeadcd249da2a18f26', name: 'card-content' }), this.type === 'default' && h("slot", { key: '93bbecf3f8f2677a1460391d0c2b98ffcdfec9c2', name: 'card-actions' }), this.type === 'expanded' && (h(Fragment, { key: '0f464c55e66dd24dd0d0186686af6bcd830d3943' }, h("div", { key: '701a095051ded46a7920999d9567c1947bedb781', class: "card__action card__action--expanded" }, h("dga-button", { key: 'c078d425b62e84eb7fdc7fb288827015c83308dd', iconOnly: true, onClick: () => this.toggleExpand(), size: "lg", variant: "subtle", iconType: this.expanded ? "arrow-up-01" : "arrow-down-01", iconProps: {
                variant: "stroke",
                type: "rounded"
            } })), h("div", { key: '7fcd8ff440ea3baf9afcffa8f20f906995ceba46', class: `collapse-content ${this.expanded ? 'expanded' : ''}` }, h("slot", { key: '0118b048869a123ec52e58711e4d10e9a3a608dd', name: "card-expandable-content" }))))));
    }
    static get is() { return "dga-card-v2"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-card.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-card.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'default' | 'expanded' | 'selectable'",
                    "resolved": "\"default\" | \"expanded\" | \"selectable\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'default'"
            },
            "showTitle": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "show-title",
                "reflect": false,
                "defaultValue": "true"
            },
            "showDescription": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "show-description",
                "reflect": false,
                "defaultValue": "true"
            },
            "showFeaturedIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "show-featured-icon",
                "reflect": false,
                "defaultValue": "true"
            },
            "image": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "image",
                "reflect": false,
                "defaultValue": "''"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "effect": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'with-shadow' | 'no-shadow' | 'stroke'",
                    "resolved": "\"no-shadow\" | \"stroke\" | \"with-shadow\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "effect",
                "reflect": false,
                "defaultValue": "'with-shadow'"
            },
            "cardTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "title",
                "reflect": false,
                "defaultValue": "'Card Title'"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "description",
                "reflect": false,
                "defaultValue": "'Card content placeholder text goes here'"
            },
            "featuredIcon": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "Icon",
                    "resolved": "Icon",
                    "references": {
                        "Icon": {
                            "location": "import",
                            "path": "../dga-featured-icon/dga-featured-icon",
                            "id": "src/components/dga-featured-icon/dga-featured-icon.tsx::Icon"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "{\n    name: 'checkmark-circle-02',\n    variant: 'stroke',\n    type: 'sharp',\n    size: 24\n  }"
            },
            "showSecondaryAction": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "show-secondary-action",
                "reflect": false,
                "defaultValue": "true"
            },
            "isSelected": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-selected",
                "reflect": true,
                "defaultValue": "false"
            },
            "secondaryActionLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "secondary-action-label",
                "reflect": false,
                "defaultValue": "'Secondary Action'"
            },
            "onCheckboxChange": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "() => {}"
            },
            "onExpandAction": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "() => {}"
            },
            "width": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "width",
                "reflect": false,
                "defaultValue": "'360px'"
            },
            "maxWidth": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "max-width",
                "reflect": false,
                "defaultValue": "'100%'"
            },
            "minWidth": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "min-width",
                "reflect": false,
                "defaultValue": "'fit-content'"
            }
        };
    }
    static get states() {
        return {
            "isFocused": {},
            "expanded": {}
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=dga-card-v2.js.map
