mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Updated design for integration icons (#22393)
* Show if a custom integration overwrites a core integration * use 1 icon and change tooltip and color * Updated design for integration icons * add color for `overwrites_built_in`
This commit is contained in:
parent
82ec308be0
commit
4d9e9aaead
@ -1,5 +1,5 @@
|
|||||||
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
||||||
import { mdiCloud, mdiFileCodeOutline, mdiPackageVariant } from "@mdi/js";
|
import { mdiFileCodeOutline, mdiPackageVariant, mdiWeb } from "@mdi/js";
|
||||||
import {
|
import {
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
LitElement,
|
LitElement,
|
||||||
@ -181,7 +181,7 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
: nothing}
|
: nothing}
|
||||||
${this.manifest && this.manifest.iot_class?.startsWith("cloud_")
|
${this.manifest && this.manifest.iot_class?.startsWith("cloud_")
|
||||||
? html`<div class="icon cloud">
|
? html`<div class="icon cloud">
|
||||||
<ha-svg-icon .path=${mdiCloud}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiWeb}></ha-svg-icon>
|
||||||
<simple-tooltip
|
<simple-tooltip
|
||||||
animation-delay="0"
|
animation-delay="0"
|
||||||
.position=${computeRTL(this.hass) ? "right" : "left"}
|
.position=${computeRTL(this.hass) ? "right" : "left"}
|
||||||
@ -354,28 +354,21 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
border-radius: 50%;
|
color: var(--label-badge-grey);
|
||||||
color: var(--text-primary-color);
|
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
margin-inline-start: 8px;
|
margin-inline-start: 8px;
|
||||||
margin-inline-end: initial;
|
margin-inline-end: initial;
|
||||||
}
|
}
|
||||||
.icon.cloud {
|
|
||||||
background: var(--info-color);
|
|
||||||
}
|
|
||||||
.icon.custom {
|
.icon.custom {
|
||||||
background: var(--warning-color);
|
color: var(--warning-color);
|
||||||
}
|
}
|
||||||
.icon.overwrites {
|
.icon.overwrites {
|
||||||
background: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
|
||||||
.icon.yaml {
|
|
||||||
background: var(--label-badge-grey);
|
|
||||||
}
|
}
|
||||||
.icon ha-svg-icon {
|
.icon ha-svg-icon {
|
||||||
width: 16px;
|
width: 24px;
|
||||||
height: 16px;
|
height: 24px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
simple-tooltip {
|
simple-tooltip {
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
ListItemBase,
|
ListItemBase,
|
||||||
} from "@material/mwc-list/mwc-list-item-base";
|
} from "@material/mwc-list/mwc-list-item-base";
|
||||||
import { styles } from "@material/mwc-list/mwc-list-item.css";
|
import { styles } from "@material/mwc-list/mwc-list-item.css";
|
||||||
import { mdiCloudOutline, mdiOpenInNew, mdiPackageVariant } from "@mdi/js";
|
import { mdiFileCodeOutline, mdiPackageVariant, mdiWeb } from "@mdi/js";
|
||||||
import { css, CSSResultGroup, html, nothing } from "lit";
|
import { css, CSSResultGroup, html, nothing } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
@ -72,7 +72,7 @@ export class HaIntegrationListItem extends ListItemBase {
|
|||||||
return html`<span class="mdc-deprecated-list-item__meta material-icons">
|
return html`<span class="mdc-deprecated-list-item__meta material-icons">
|
||||||
${this.integration.cloud
|
${this.integration.cloud
|
||||||
? html`<span
|
? html`<span
|
||||||
><ha-svg-icon .path=${mdiCloudOutline}></ha-svg-icon
|
><ha-svg-icon .path=${mdiWeb}></ha-svg-icon
|
||||||
><simple-tooltip animation-delay="0" position="left"
|
><simple-tooltip animation-delay="0" position="left"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
"ui.panel.config.integrations.config_entry.depends_on_cloud"
|
"ui.panel.config.integrations.config_entry.depends_on_cloud"
|
||||||
@ -82,6 +82,9 @@ export class HaIntegrationListItem extends ListItemBase {
|
|||||||
: ""}
|
: ""}
|
||||||
${!this.integration.is_built_in
|
${!this.integration.is_built_in
|
||||||
? html`<span
|
? html`<span
|
||||||
|
class=${this.integration.overwrites_built_in
|
||||||
|
? "overwrites"
|
||||||
|
: "custom"}
|
||||||
><ha-svg-icon .path=${mdiPackageVariant}></ha-svg-icon
|
><ha-svg-icon .path=${mdiPackageVariant}></ha-svg-icon
|
||||||
><simple-tooltip animation-delay="0" position="left"
|
><simple-tooltip animation-delay="0" position="left"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
@ -101,7 +104,7 @@ export class HaIntegrationListItem extends ListItemBase {
|
|||||||
"ui.panel.config.integrations.config_entry.yaml_only"
|
"ui.panel.config.integrations.config_entry.yaml_only"
|
||||||
)}</simple-tooltip
|
)}</simple-tooltip
|
||||||
><ha-svg-icon
|
><ha-svg-icon
|
||||||
.path=${mdiOpenInNew}
|
.path=${mdiFileCodeOutline}
|
||||||
class="open-in-new"
|
class="open-in-new"
|
||||||
></ha-svg-icon
|
></ha-svg-icon
|
||||||
></span>`
|
></span>`
|
||||||
@ -161,6 +164,12 @@ export class HaIntegrationListItem extends ListItemBase {
|
|||||||
--mdc-icon-size: 22px;
|
--mdc-icon-size: 22px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
|
.custom {
|
||||||
|
color: var(--warning-color);
|
||||||
|
}
|
||||||
|
.overwrites {
|
||||||
|
color: var(--error-color);
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -4405,8 +4405,8 @@
|
|||||||
},
|
},
|
||||||
"custom_integration": "Custom integration",
|
"custom_integration": "Custom integration",
|
||||||
"custom_overwrites_core": "Custom integration that replaces a core component",
|
"custom_overwrites_core": "Custom integration that replaces a core component",
|
||||||
"depends_on_cloud": "Depends on the cloud",
|
"depends_on_cloud": "Depends on Internet connection",
|
||||||
"yaml_only": "Needs manual configuration",
|
"yaml_only": "This integration cannot be setup from the UI",
|
||||||
"no_config_flow": "This integration was not set up from the UI",
|
"no_config_flow": "This integration was not set up from the UI",
|
||||||
"disabled_polling": "Automatic polling for updated data disabled",
|
"disabled_polling": "Automatic polling for updated data disabled",
|
||||||
"debug_logging_enabled": "Debug logging enabled",
|
"debug_logging_enabled": "Debug logging enabled",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user