diff --git a/src/components/ha-clickable-list-item.ts b/src/components/ha-clickable-list-item.ts deleted file mode 100644 index d68c7d4b0c..0000000000 --- a/src/components/ha-clickable-list-item.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { CSSResultGroup } from "lit"; -import { css, html } from "lit"; -import { customElement, property, query } from "lit/decorators"; -import { HaListItem } from "./ha-list-item"; - -@customElement("ha-clickable-list-item") -export class HaClickableListItem extends HaListItem { - @property() public href?: string; - - @property({ attribute: "disable-href", type: Boolean }) - public disableHref = false; - - @property({ attribute: "open-new-tab", type: Boolean, reflect: true }) - public openNewTab = false; - - @query("a") private _anchor!: HTMLAnchorElement; - - public render() { - const r = super.render(); - const href = this.href || ""; - - return html`${this.disableHref - ? html`${r}` - : html`${r}`}`; - } - - firstUpdated() { - super.firstUpdated(); - this.addEventListener("keydown", (ev) => { - if (ev.key === "Enter" || ev.key === " ") { - this._anchor.click(); - } - }); - } - - static get styles(): CSSResultGroup { - return [ - super.styles, - css` - a { - width: 100%; - height: 100%; - display: flex; - align-items: center; - overflow: hidden; - } - .disabled { - pointer-events: none; - } - `, - ]; - } -} - -declare global { - interface HTMLElementTagNameMap { - "ha-clickable-list-item": HaClickableListItem; - } -} diff --git a/src/panels/config/hardware/ha-config-hardware.ts b/src/panels/config/hardware/ha-config-hardware.ts index ba0413dcfd..6f420aeebe 100644 --- a/src/panels/config/hardware/ha-config-hardware.ts +++ b/src/panels/config/hardware/ha-config-hardware.ts @@ -12,8 +12,7 @@ import "../../../components/buttons/ha-progress-button"; import "../../../components/chart/ha-chart-base"; import "../../../components/ha-alert"; import "../../../components/ha-card"; -import "../../../components/ha-list"; -import "../../../components/ha-clickable-list-item"; +import "../../../components/ha-md-list-item"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-next"; import "../../../components/ha-settings-row"; @@ -287,26 +286,24 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { ${documentationURL ? html` - - + ${this.hass.localize( + "ui.panel.config.hardware.documentation" + )} - ${this.hass.localize( - "ui.panel.config.hardware.documentation" - )} - ${this.hass.localize( - "ui.panel.config.hardware.documentation_description" - )} - - - + ${this.hass.localize( + "ui.panel.config.hardware.documentation_description" + )} + + ` : ""} ${boardConfigEntries.length || diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index b711a1f6f6..26acffcabd 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -13,11 +13,12 @@ import { LitElement, css, html, nothing } from "lit"; import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-card"; -import "../../../components/ha-clickable-list-item"; import "../../../components/ha-icon-next"; import "../../../components/ha-list"; import "../../../components/ha-list-item"; import "../../../components/ha-logo-svg"; +import "../../../components/ha-md-list"; +import "../../../components/ha-md-list-item"; import type { HassioHassOSInfo } from "../../../data/hassio/host"; import { fetchHassioHassOsInfo } from "../../../data/hassio/host"; import type { HassioInfo } from "../../../data/hassio/supervisor"; @@ -174,10 +175,10 @@ class HaConfigInfo extends LitElement { - - + +
@@ -186,18 +187,18 @@ class HaConfigInfo extends LitElement { ${this.hass.localize("ui.panel.config.info.shortcuts")} - + ${PAGES.map( (page) => html` -
@@ -208,14 +209,11 @@ class HaConfigInfo extends LitElement { `ui.panel.config.info.items.${page.name}` )} - - + + ` )} - + ${customUiList.length ? html`
@@ -354,16 +352,6 @@ class HaConfigInfo extends LitElement { padding: 4px 0; } - ha-list { - --mdc-list-side-padding: 16px; - --mdc-list-vertical-padding: 0; - } - - ha-clickable-list-item, - ha-list-item { - height: 64px; - } - .icon-background ha-svg-icon { height: 24px; width: 24px; diff --git a/src/panels/config/integrations/ha-integration-overflow-menu.ts b/src/panels/config/integrations/ha-integration-overflow-menu.ts index f4591db5b7..2b3413a684 100644 --- a/src/panels/config/integrations/ha-integration-overflow-menu.ts +++ b/src/panels/config/integrations/ha-integration-overflow-menu.ts @@ -1,10 +1,10 @@ import { mdiDotsVertical } from "@mdi/js"; import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; -import "../../../components/ha-button-menu"; -import "../../../components/ha-clickable-list-item"; import "../../../components/ha-icon-button"; import type { HomeAssistant } from "../../../types"; +import "../../../components/ha-md-list-item"; +import "../../../components/ha-md-button-menu"; @customElement("ha-integration-overflow-menu") export class HaIntegrationOverflowMenu extends LitElement { @@ -12,18 +12,18 @@ export class HaIntegrationOverflowMenu extends LitElement { protected render() { return html` - + - + ${this.hass.localize( "ui.panel.config.application_credentials.caption" )} - - + + `; } } diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index 033668a24e..d81f74925c 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -11,17 +11,20 @@ import { customElement, property, state } from "lit/decorators"; import { ifDefined } from "lit/directives/if-defined"; import memoize from "memoize-one"; import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; +import { storage } from "../../../../common/decorators/storage"; import { navigate } from "../../../../common/navigate"; import { stringCompare } from "../../../../common/string/compare"; +import type { LocalizeFunc } from "../../../../common/translations/localize"; import type { DataTableColumnContainer, RowClickedEvent, SortingChangedEvent, } from "../../../../components/data-table/ha-data-table"; -import "../../../../components/ha-clickable-list-item"; import "../../../../components/ha-fab"; import "../../../../components/ha-icon"; import "../../../../components/ha-icon-button"; +import "../../../../components/ha-md-button-menu"; +import "../../../../components/ha-md-list-item"; import "../../../../components/ha-svg-icon"; import "../../../../components/ha-tooltip"; import type { LovelacePanelConfig } from "../../../../data/lovelace"; @@ -44,13 +47,11 @@ import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog- import "../../../../layouts/hass-loading-screen"; import "../../../../layouts/hass-tabs-subpage-data-table"; import type { HomeAssistant, Route } from "../../../../types"; -import type { LocalizeFunc } from "../../../../common/translations/localize"; import { getLovelaceStrategy } from "../../../lovelace/strategies/get-strategy"; import { showNewDashboardDialog } from "../../dashboard/show-dialog-new-dashboard"; import { lovelaceTabs } from "../ha-config-lovelace"; import { showDashboardConfigureStrategyDialog } from "./show-dialog-lovelace-dashboard-configure-strategy"; import { showDashboardDetailDialog } from "./show-dialog-lovelace-dashboard-detail"; -import { storage } from "../../../../common/decorators/storage"; type DataTableItem = Pick< LovelaceDashboard, @@ -327,16 +328,16 @@ export class HaConfigLovelaceDashboards extends LitElement { has-fab clickable > - + - + ${this.hass.localize("ui.panel.config.lovelace.resources.caption")} - - + + + ${this._setups?.map((setup) => { const manifest = this._manifests && this._manifests[setup.domain]; const docLink = manifest @@ -50,13 +51,7 @@ class IntegrationsStartupTime extends LitElement { const setupSeconds = setup.seconds?.toFixed(2); return html` - + ${domainToName(this.hass.localize, setup.domain, manifest)} - ${setup.domain} -
+ ${setup.domain} +
${setupSeconds ? html`${setupSeconds} s` : ""}
- + `; })} - + `; } @@ -109,20 +104,14 @@ class IntegrationsStartupTime extends LitElement { } static styles = css` - ha-clickable-list-item { - --mdc-list-item-meta-size: 64px; - --mdc-typography-caption-font-size: 12px; - } img { display: block; max-height: 40px; max-width: 40px; border-radius: 0; } - div[slot="meta"] { - display: flex; - justify-content: center; - align-items: center; + div[slot="end"] { + font-size: 12px; } `; }