/**
 * Copyright IBM Corp. 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import "../../globals/settings.js";
import { carbonElement } from "../../globals/decorators/carbon-element.js";
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
import contained_list_default$1 from "./contained-list.scss.js";
import { LitElement, html } from "lit";
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
//#region src/components/contained-list/contained-list.ts
/**
* Copyright IBM Corp. 2022, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Contained list.
*
* @element cds-contained-list
* @slot - The list items (cds-contained-list-item elements)
* @slot action - The action slot for interactive elements in header
* @slot label - The label text
*/
let CDSContainedList = class CDSContainedList extends LitElement {
	constructor(..._args) {
		super(..._args);
		this.isInset = false;
		this.kind = "on-page";
		this.label = "";
	}
	render() {
		const { isInset, kind, label, size } = this;
		const classes = classMap({
			[`cds--contained-list`]: true,
			[`cds--contained-list--${kind}`]: true,
			[`cds--contained-list--inset-rulers`]: isInset,
			[`cds--layout--size-${size}`]: !!size
		});
		const hasLabelSlot = this.querySelector("[slot=\"label\"]") !== null;
		return html`
      <div class="${classes}">
        ${label || hasLabelSlot ? html`
              <div class="${"cds"}--contained-list__header">
                <div class="${"cds"}--contained-list__label">
                  ${hasLabelSlot ? html`<slot name="label"></slot>` : label}
                </div>
                <div class="${"cds"}--contained-list__action">
                  <slot name="action"></slot>
                </div>
              </div>
            ` : ""}
        <ul role="list">
          <slot></slot>
        </ul>
      </div>
    `;
	}
	static {
		this.styles = contained_list_default$1;
	}
};
__decorate([property({
	type: Boolean,
	reflect: true,
	attribute: "is-inset"
})], CDSContainedList.prototype, "isInset", void 0);
__decorate([property({ reflect: true })], CDSContainedList.prototype, "kind", void 0);
__decorate([property({ reflect: true })], CDSContainedList.prototype, "label", void 0);
__decorate([property({ reflect: true })], CDSContainedList.prototype, "size", void 0);
CDSContainedList = __decorate([carbonElement(`cds-contained-list`)], CDSContainedList);
var contained_list_default = CDSContainedList;
//#endregion
export { contained_list_default as default };

//# sourceMappingURL=contained-list.js.map