UNPKG

@carbon/ibm-products-web-components

Version:
62 lines (60 loc) 2.29 kB
/** * Copyright IBM Corp. 2020, 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 { __decorate } from "../../_virtual/_@oxc-project_runtime@0.127.0/helpers/decorate.js"; import checklist_default from "./checklist.scss.js"; import "./checklist.types.js"; import { classMap } from "lit/directives/class-map.js"; import { LitElement, html } from "lit"; import { property } from "lit/decorators.js"; import { carbonElement } from "@carbon/web-components/es/globals/decorators/carbon-element.js"; import CheckmarkOutline16 from "@carbon/icons/es/checkmark--outline/16"; import CircleDash16 from "@carbon/icons/es/circle-dash/16"; import Incomplete16 from "@carbon/icons/es/incomplete/16"; import Warning16 from "@carbon/icons/es/warning/16"; import '@carbon/web-components/es-custom/components/icon/index.js'; //#region src/components/checklist/checklist-icon.ts /** * @license * * Copyright IBM Corp. 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. */ const blockClass = `c4p--checklist__icon`; /** * @element c4p-checklist-icon * Represents checklist item status with different icons (unchecked, checked, indeterminate, error). */ let CDSChecklistIcon = class CDSChecklistIcon extends LitElement { constructor(..._args) { super(..._args); this.kind = "unchecked"; } render() { const icon = this.kind === "checked" ? CheckmarkOutline16 : this.kind === "indeterminate" ? Incomplete16 : this.kind === "error" ? Warning16 : CircleDash16; return html` <span class="${classMap({ [`${blockClass}`]: true, [`${blockClass}--${this.kind}`]: true })}"> <cds-custom-icon .icon=${icon} size="16" ariaLabel=${this.kind}></cds-custom-icon> </span>`; } static { this.styles = checklist_default; } }; __decorate([property({ type: String, attribute: "kind" })], CDSChecklistIcon.prototype, "kind", void 0); CDSChecklistIcon = __decorate([carbonElement(`c4p-checklist-icon`)], CDSChecklistIcon); var checklist_icon_default = CDSChecklistIcon; //#endregion export { checklist_icon_default as default }; //# sourceMappingURL=checklist-icon.js.map