diff --git a/gallery/src/demos/demo-ha-chip.ts b/gallery/src/demos/demo-ha-chip.ts index 5d3cf0ef82..750bf7fa99 100644 --- a/gallery/src/demos/demo-ha-chip.ts +++ b/gallery/src/demos/demo-ha-chip.ts @@ -1,6 +1,8 @@ +import "../../../src/components/ha-switch"; +import "../../../src/components/ha-formfield"; import { mdiClose, mdiHomeAssistant } from "@mdi/js"; import { css, html, LitElement, TemplateResult } from "lit"; -import { customElement } from "lit/decorators"; +import { customElement, state } from "lit/decorators"; import "../../../src/components/ha-card"; import "../../../src/components/ha-chip"; import "../../../src/components/ha-chip-set"; @@ -42,53 +44,66 @@ const chips: HaChipSetItem[] = [ @customElement("demo-ha-chip") export class DemoHaChip extends LitElement { + @state() standaloneIsDisabled = false; + + @state() standaloneIsOutlined = false; + protected render(): TemplateResult { return html` +
+ + + + + + +
Simple: - Demo chip -
-
- Simple (outline): - Demo chip + Demo chip
Label property: - -
-
- Label property (outline): - +
With leadingIcon: - Demo chip -
-
- With leadingIcon (outline): - Demo chip
With trailingIcon property: - Demo chip -
-
- With trailingIcon property (outline): - Demo chip
With trailingIcon slot: - + Demo chip
-
- With trailingIcon slot (outline): - - Demo chip - - -
- -
- Disabled: - - Demo chip - -
-
- Disabled (outline): - - Demo chip - -
@@ -136,6 +127,14 @@ export class DemoHaChip extends LitElement { `; } + private _toggleDisable() { + this.standaloneIsDisabled = !this.standaloneIsDisabled; + } + + private _toggleOutline() { + this.standaloneIsOutlined = !this.standaloneIsOutlined; + } + static get styles() { return css` ha-card { @@ -147,12 +146,12 @@ export class DemoHaChip extends LitElement { display: flex; justify-content: space-between; } - .trailings { - width: 16px; - height: 16px; - padding: 4px 2px 4px 4px; - margin-right: -8px; - --mdc-icon-size: 12px; + .filters { + margin: 16px; + } + ha-formfield { + margin: 12px 0; + display: block; } `; }