mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 04:36:36 +00:00
Migrate to webawesome
This commit is contained in:
parent
6eb8261525
commit
ebe791d21a
@ -86,7 +86,7 @@ class HcCast extends LitElement {
|
||||
? html`
|
||||
<p class="center-item">
|
||||
<ha-button @click=${this._handleLaunch}>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiCast}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiCast}></ha-svg-icon>
|
||||
Start Casting
|
||||
</ha-button>
|
||||
</p>
|
||||
@ -130,7 +130,7 @@ class HcCast extends LitElement {
|
||||
? html`
|
||||
<ha-button appearance="plain" @click=${this._handleLaunch}>
|
||||
<ha-svg-icon
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
.path=${mdiCastConnected}
|
||||
></ha-svg-icon>
|
||||
Manage
|
||||
|
@ -39,60 +39,28 @@ title: Button
|
||||
|
||||
### API
|
||||
|
||||
This component is based on the shoelace button component.
|
||||
Check the [shoelace documentation](https://shoelace.style/components/button) for more details.
|
||||
This component is based on the webawesome button component.
|
||||
Check the [webawesome documentation](https://webawesome.com/docs/components/button/) for more details.
|
||||
|
||||
**Slots**
|
||||
|
||||
- default slot: Label of the button
|
||||
` - no default
|
||||
- `prefix`: The prefix container (usually for icons).
|
||||
- `start`: The prefix container (usually for icons).
|
||||
` - no default
|
||||
- `suffix`: The suffix container (usually for icons).
|
||||
- `end`: The suffix container (usually for icons).
|
||||
` - no default
|
||||
|
||||
**Properties/Attributes**
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ----------- | ------------------------------------------------ | --------- | ---------------------------------------------------- |
|
||||
| appearance | "accent"/"filled"/"plain" | "accent" | Sets the button appearance. |
|
||||
| variants | "primary"/"danger"/"neutral"/"warning"/"success" | "primary" | Sets the button color variant. "primary" is default. |
|
||||
| size | "small"/"medium" | "medium" | Sets the button size. |
|
||||
| hideContent | Boolean | false | Hides the button content (for overlays) |
|
||||
| Name | Type | Default | Description |
|
||||
| ----------- | ---------------------------------------------- | -------- | -------------------------------------------------- |
|
||||
| appearance | "accent"/"filled"/"plain" | "accent" | Sets the button appearance. |
|
||||
| variants | "brand"/"danger"/"neutral"/"warning"/"success" | "brand" | Sets the button color variant. "brand" is default. |
|
||||
| size | "small"/"medium" | "medium" | Sets the button size. |
|
||||
| hideContent | Boolean | false | Hides the button content (for overlays) |
|
||||
|
||||
**CSS Custom Properties**
|
||||
|
||||
- `--ha-button-font-family` - Font family for the button text.
|
||||
- `--ha-button-font-weight` - buttons font weight.
|
||||
- `--ha-button-font-size` - Font weight for the button text.
|
||||
- `--ha-button-height` - Height of the button.
|
||||
- `--ha-button-padding-inline-start` - padding for the button text on the left side.
|
||||
- `--ha-button-padding-inline-end` - padding for the button text on the right side.
|
||||
- `--ha-button-border-radius` - Border radius for the button.
|
||||
- `--ha-button-border-width` - Border width for the button.
|
||||
- `--ha-button-theme-color` - Main color for the button.
|
||||
- `--ha-button-theme-dark-color` - Dark variant of the main color.
|
||||
- `--ha-button-theme-darker-color` - Dark variant of the main color.
|
||||
- `--ha-button-theme-light-color` - Light variant of the main color.
|
||||
- `--ha-button-text-color` - Text color for the button.
|
||||
- `--ha-button-focus-ring-color` - Focus ring color for the button.
|
||||
- `--ha-button-primary-color` - Main color for the primary variant.
|
||||
- `--ha-button-primary-light-color` - Light color for the primary variant.
|
||||
- `--ha-button-primary-dark-color` - Dark color for the primary variant.
|
||||
- `--ha-button-primary-darker-color` - Darker color for the primary variant.
|
||||
- `--ha-button-error-color` - Main color for the error variant.
|
||||
- `--ha-button-error-light-color` - Light color for the error variant.
|
||||
- `--ha-button-error-dark-color` - Dark color for the error variant.
|
||||
- `--ha-button-error-darker-color` - Darker color for the error variant.
|
||||
- `--ha-button-neutral-color` - Main color for the neutral variant.
|
||||
- `--ha-button-neutral-light-color` - Light color for the neutral variant.
|
||||
- `--ha-button-neutral-dark-color` - Dark color for the neutral variant.
|
||||
- `--ha-button-neutral-darker-color` - Darker color for the neutral variant.
|
||||
- `--ha-button-warning-color` - Main color for the warning variant.
|
||||
- `--ha-button-warning-light-color` - Light color for the warning variant.
|
||||
- `--ha-button-warning-dark-color` - Dark color for the warning variant.
|
||||
- `--ha-button-warning-darker-color` - Darker color for the warning variant.
|
||||
- `--ha-button-success-color` - Main color for the success variant.
|
||||
- `--ha-button-success-light-color` - Light color for the success variant.
|
||||
- `--ha-button-success-dark-color` - Dark color for the success variant.
|
||||
- `--ha-button-success-darker-color` - Darker color for the success variant.
|
||||
- `--ha-button-radius` - Border radius of the button. Defaults to `var(--wa-border-radius-pill)`.
|
||||
|
@ -10,7 +10,7 @@ import "../../../../src/components/ha-svg-icon";
|
||||
import { mdiHomeAssistant } from "../../../../src/resources/home-assistant-logo-svg";
|
||||
|
||||
const appearances = ["accent", "filled", "plain"];
|
||||
const variants = ["primary", "danger", "neutral", "warning", "success"];
|
||||
const variants = ["brand", "danger", "neutral", "warning", "success"];
|
||||
|
||||
@customElement("demo-components-ha-button")
|
||||
export class DemoHaButton extends LitElement {
|
||||
@ -32,7 +32,41 @@ export class DemoHaButton extends LitElement {
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiHomeAssistant}
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
<ha-svg-icon
|
||||
.path=${mdiHome}
|
||||
slot="end"
|
||||
></ha-svg-icon>
|
||||
</ha-button>
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
${appearances.map(
|
||||
(appearance) => html`
|
||||
<ha-button
|
||||
.appearance=${appearance}
|
||||
.variant=${variant}
|
||||
size="small"
|
||||
>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
</ha-button>
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
${appearances.map(
|
||||
(appearance) => html`
|
||||
<ha-button
|
||||
.appearance=${appearance}
|
||||
.variant=${variant}
|
||||
loading
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiHomeAssistant}
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
<ha-svg-icon
|
||||
@ -43,15 +77,19 @@ export class DemoHaButton extends LitElement {
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
${variants.map(
|
||||
(variant) => html`
|
||||
<div>
|
||||
${appearances.map(
|
||||
(appearance) => html`
|
||||
<ha-button
|
||||
.appearance=${appearance}
|
||||
.variant=${variant}
|
||||
size="small"
|
||||
.appearance=${appearance}
|
||||
disabled
|
||||
>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
${titleCase(`${appearance}`)}
|
||||
</ha-button>
|
||||
`
|
||||
)}
|
||||
@ -60,25 +98,12 @@ export class DemoHaButton extends LitElement {
|
||||
${appearances.map(
|
||||
(appearance) => html`
|
||||
<ha-button
|
||||
.appearance=${appearance}
|
||||
.variant=${variant}
|
||||
disabled
|
||||
>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
</ha-button>
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
${appearances.map(
|
||||
(appearance) => html`
|
||||
<ha-button
|
||||
.appearance=${appearance}
|
||||
.variant=${variant}
|
||||
size="small"
|
||||
disabled
|
||||
>
|
||||
${titleCase(`${variant} ${appearance}`)}
|
||||
${titleCase(`${appearance}`)}
|
||||
</ha-button>
|
||||
`
|
||||
)}
|
||||
|
@ -95,7 +95,7 @@ class HassioRegistriesDialog extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.supervisor.localize("dialog.registries.add_registry")}
|
||||
</ha-button>
|
||||
</div>
|
||||
@ -136,7 +136,7 @@ class HassioRegistriesDialog extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.supervisor.localize(
|
||||
"dialog.registries.add_new_registry"
|
||||
)}
|
||||
|
@ -165,7 +165,7 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this._dialogParams!.supervisor.localize(
|
||||
"dialog.repositories.add"
|
||||
)}
|
||||
|
@ -26,6 +26,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@awesome.me/webawesome": "3.0.0-beta.3",
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@braintree/sanitize-url": "7.1.1",
|
||||
"@codemirror/autocomplete": "6.18.6",
|
||||
|
@ -23,12 +23,8 @@ export class HaProgressButton extends LitElement {
|
||||
|
||||
@property() appearance: Appearance = "accent";
|
||||
|
||||
@property() variant:
|
||||
| "primary"
|
||||
| "danger"
|
||||
| "neutral"
|
||||
| "warning"
|
||||
| "success" = "primary";
|
||||
@property() variant: "brand" | "danger" | "neutral" | "warning" | "success" =
|
||||
"brand";
|
||||
|
||||
@state() private _result?: "success" | "error";
|
||||
|
||||
@ -53,7 +49,7 @@ export class HaProgressButton extends LitElement {
|
||||
.hideContent=${this._result !== undefined}
|
||||
>
|
||||
${this._hasInitialIcon
|
||||
? html`<slot name="icon" slot="prefix"></slot>`
|
||||
? html`<slot name="icon" slot="start"></slot>`
|
||||
: nothing}
|
||||
<slot
|
||||
>${this._result
|
||||
|
@ -1,9 +1,8 @@
|
||||
import Button from "@shoelace-style/shoelace/dist/components/button/button.component";
|
||||
import styles from "@shoelace-style/shoelace/dist/components/button/button.styles";
|
||||
import { css } from "lit";
|
||||
import Button from "@awesome.me/webawesome/dist/components/button/button";
|
||||
import { css, type CSSResultGroup } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
|
||||
export type Appearance = "accent" | "filled" | "plain";
|
||||
export type Appearance = "accent" | "filled" | "outlined" | "plain";
|
||||
|
||||
/**
|
||||
* Home Assistant button component
|
||||
@ -12,227 +11,145 @@ export type Appearance = "accent" | "filled" | "plain";
|
||||
* @extends {Button}
|
||||
*
|
||||
* @summary
|
||||
* A stylable button component supporting Home Assistant theming, variants, and appearances.
|
||||
* A stylable button component supporting Home Assistant theming, variants, and appearances based on webawesome button.
|
||||
*
|
||||
* @slot - Label of the button
|
||||
* @slot prefix - The prefix container (usually for icons).
|
||||
* @slot suffix - The suffix container (usually for icons).
|
||||
* @slot start - The prefix container (usually for icons).
|
||||
* @slot end - The suffix container (usually for icons).
|
||||
*
|
||||
* @csspart base - The component's base wrapper.
|
||||
* @csspart prefix - The container that wraps the prefix.
|
||||
* @csspart start - The container that wraps the prefix.
|
||||
* @csspart label - The button's label.
|
||||
* @csspart suffix - The container that wraps the suffix.
|
||||
* @csspart end - The container that wraps the suffix.
|
||||
* @csspart caret - The button's caret icon, an `<sl-icon>` element.
|
||||
* @csspart spinner - The spinner that shows when the button is in the loading state.
|
||||
*
|
||||
* @cssprop --ha-button-font-family - Font family for the button text.
|
||||
* @cssprop --ha-button-font-weight - buttons font weight.
|
||||
* @cssprop --ha-button-font-size - Font weight for the button text.
|
||||
* @cssprop --ha-button-height - Height of the button.
|
||||
* @cssprop --ha-button-padding-inline-start - padding for the button text on the left side.
|
||||
* @cssprop --ha-button-padding-inline-end - padding for the button text on the right side.
|
||||
* @cssprop --ha-button-border-radius - Border radius for the button.
|
||||
* @cssprop --ha-button-border-width - Border width for the button.
|
||||
* @cssprop --ha-button-theme-color - Main color for the button.
|
||||
* @cssprop --ha-button-theme-dark-color - Dark variant of the main color.
|
||||
* @cssprop --ha-button-theme-darker-color - Dark variant of the main color.
|
||||
* @cssprop --ha-button-theme-light-color - Light variant of the main color.
|
||||
* @cssprop --ha-button-text-color - Text color for the button.
|
||||
* @cssprop --ha-button-focus-ring-color - Focus ring color for the button.
|
||||
* @cssprop --ha-button-primary-color - Main color for the primary variant.
|
||||
* @cssprop --ha-button-primary-light-color - Light color for the primary variant.
|
||||
* @cssprop --ha-button-primary-dark-color - Dark color for the primary variant.
|
||||
* @cssprop --ha-button-primary-darker-color - Darker color for the primary variant.
|
||||
* @cssprop --ha-button-error-color - Main color for the error variant.
|
||||
* @cssprop --ha-button-error-light-color - Light color for the error variant.
|
||||
* @cssprop --ha-button-error-dark-color - Dark color for the error variant.
|
||||
* @cssprop --ha-button-error-darker-color - Darker color for the error variant.
|
||||
* @cssprop --ha-button-neutral-color - Main color for the neutral variant.
|
||||
* @cssprop --ha-button-neutral-light-color - Light color for the neutral variant.
|
||||
* @cssprop --ha-button-neutral-dark-color - Dark color for the neutral variant.
|
||||
* @cssprop --ha-button-neutral-darker-color - Darker color for the neutral variant.
|
||||
* @cssprop --ha-button-warning-color - Main color for the warning variant.
|
||||
* @cssprop --ha-button-warning-light-color - Light color for the warning variant.
|
||||
* @cssprop --ha-button-warning-dark-color - Dark color for the warning variant.
|
||||
* @cssprop --ha-button-warning-darker-color - Darker color for the warning variant.
|
||||
* @cssprop --ha-button-success-color - Main color for the success variant.
|
||||
* @cssprop --ha-button-success-light-color - Light color for the success variant.
|
||||
* @cssprop --ha-button-success-dark-color - Dark color for the success variant.
|
||||
* @cssprop --ha-button-success-darker-color - Darker color for the success variant.
|
||||
* @cssprop --ha-button-height - The height of the button.
|
||||
* @cssprop --ha-button-radius - The border radius of the button. defaults to `var(--wa-border-radius-pill)`.
|
||||
*
|
||||
* @attr {("small"|"medium")} size - Sets the button size.
|
||||
* @attr {("primary"|"danger"|"neutral"|"warning"|"success")} variant - Sets the button color variant. "primary" is default.
|
||||
* @attr {("brand"|"neutral"|"danger"|"warning"|"success")} variant - Sets the button color variant. "primary" is default.
|
||||
* @attr {("accent"|"filled"|"plain")} appearance - Sets the button appearance.
|
||||
* @attr {boolean} hideContent - Hides the button content (for overlays).
|
||||
*/
|
||||
@customElement("ha-button")
|
||||
export class HaButton extends Button {
|
||||
@property({ reflect: true }) appearance?: Appearance;
|
||||
variant: "brand" | "neutral" | "success" | "warning" | "danger" = "brand";
|
||||
|
||||
@property({ type: Boolean, attribute: "hide-content", reflect: true })
|
||||
hideContent = false;
|
||||
|
||||
static override styles = [
|
||||
styles,
|
||||
css`
|
||||
:host {
|
||||
--sl-input-font-family: var(
|
||||
--ha-button-font-family,
|
||||
var(--ha-font-family-body)
|
||||
);
|
||||
--sl-font-weight-semibold: var(
|
||||
--ha-button-font-weight,
|
||||
var(--ha-font-weight-medium)
|
||||
);
|
||||
--sl-transition-x-fast: 0.4s;
|
||||
--sl-focus-ring: solid 4px var(--ha-button-focus-ring-color, #625b71);
|
||||
--sl-focus-ring-offset: 1px;
|
||||
--sl-button-font-size-small: var(
|
||||
--ha-button-font-size,
|
||||
var(--ha-font-size-m)
|
||||
);
|
||||
--sl-button-font-size-medium: var(
|
||||
--ha-button-font-size,
|
||||
var(--ha-font-size-m)
|
||||
);
|
||||
static get styles(): CSSResultGroup {
|
||||
return [
|
||||
Button.styles,
|
||||
css`
|
||||
.button {
|
||||
/* set theme vars */
|
||||
--wa-form-control-padding-inline: 16px;
|
||||
--wa-font-weight-action: var(--ha-font-weight-medium);
|
||||
--wa-border-radius-pill: 9999px;
|
||||
--wa-form-control-border-radius: var(
|
||||
--ha-button-radius,
|
||||
var(--wa-border-radius-pill)
|
||||
);
|
||||
|
||||
--sl-spacing-medium: 16px;
|
||||
--sl-spacing-small: 12px;
|
||||
--sl-spacing-x-small: 8px;
|
||||
--wa-form-control-height: var(
|
||||
--ha-button-height,
|
||||
var(--button-height, 40px)
|
||||
);
|
||||
}
|
||||
|
||||
--ha-button-theme-color: var(--ha-button-primary-color);
|
||||
--ha-button-theme-light-color: var(--ha-button-primary-light-color);
|
||||
--ha-button-theme-dark-color: var(--ha-button-primary-dark-color);
|
||||
--ha-button-theme-darker-color: var(--ha-button-primary-darker-color);
|
||||
:host([size="small"]) .button {
|
||||
--wa-form-control-height: var(
|
||||
--ha-button-height,
|
||||
var(--button-height, 32px)
|
||||
);
|
||||
}
|
||||
|
||||
line-height: 1;
|
||||
--sl-input-border-width: var(--ha-button-border-width, 0);
|
||||
}
|
||||
:host([variant="brand"]) {
|
||||
--color-fill-normal-active: var(--color-fill-primary-normal-active);
|
||||
--color-fill-normal-hover: var(--color-fill-primary-normal-hover);
|
||||
--color-fill-loud-active: var(--color-fill-primary-loud-active);
|
||||
--color-fill-loud-hover: var(--color-fill-primary-loud-hover);
|
||||
}
|
||||
|
||||
:host([variant="danger"]) {
|
||||
--ha-button-theme-color: var(--ha-button-error-color);
|
||||
--ha-button-theme-light-color: var(--ha-button-error-light-color);
|
||||
--ha-button-theme-dark-color: var(--ha-button-error-dark-color);
|
||||
--ha-button-theme-darker-color: var(--ha-button-error-darker-color);
|
||||
}
|
||||
:host([variant="neutral"]) {
|
||||
--color-fill-normal-active: var(--color-fill-neutral-normal-active);
|
||||
--color-fill-normal-hover: var(--color-fill-neutral-normal-hover);
|
||||
--color-fill-loud-active: var(--color-fill-neutral-loud-active);
|
||||
--color-fill-loud-hover: var(--color-fill-neutral-loud-hover);
|
||||
}
|
||||
|
||||
:host([variant="neutral"]) {
|
||||
--ha-button-theme-color: var(--ha-button-neutral-color);
|
||||
--ha-button-theme-light-color: var(--ha-button-neutral-light-color);
|
||||
--ha-button-theme-dark-color: var(--ha-button-neutral-dark-color);
|
||||
--ha-button-theme-darker-color: var(--ha-button-neutral-darker-color);
|
||||
}
|
||||
:host([variant="success"]) {
|
||||
--color-fill-normal-active: var(--color-fill-success-normal-active);
|
||||
--color-fill-normal-hover: var(--color-fill-success-normal-hover);
|
||||
--color-fill-loud-active: var(--color-fill-success-loud-active);
|
||||
--color-fill-loud-hover: var(--color-fill-success-loud-hover);
|
||||
}
|
||||
|
||||
:host([variant="warning"]) {
|
||||
--ha-button-theme-color: var(--ha-button-warning-color);
|
||||
--ha-button-theme-light-color: var(--ha-button-warning-light-color);
|
||||
--ha-button-theme-dark-color: var(--ha-button-warning-dark-color);
|
||||
--ha-button-theme-darker-color: var(--ha-button-warning-darker-color);
|
||||
}
|
||||
:host([variant="warning"]) {
|
||||
--color-fill-normal-active: var(--color-fill-warning-normal-active);
|
||||
--color-fill-normal-hover: var(--color-fill-warning-normal-hover);
|
||||
--color-fill-loud-active: var(--color-fill-warning-loud-active);
|
||||
--color-fill-loud-hover: var(--color-fill-warning-loud-hover);
|
||||
}
|
||||
|
||||
:host([variant="success"]) {
|
||||
--ha-button-theme-color: var(--ha-button-success-color);
|
||||
--ha-button-theme-light-color: var(--ha-button-success-light-color);
|
||||
--ha-button-theme-dark-color: var(--ha-button-success-dark-color);
|
||||
--ha-button-theme-darker-color: var(--ha-button-success-darker-color);
|
||||
}
|
||||
:host([variant="danger"]) {
|
||||
--color-fill-normal-active: var(--color-fill-danger-normal-active);
|
||||
--color-fill-normal-hover: var(--color-fill-danger-normal-hover);
|
||||
--color-fill-loud-active: var(--color-fill-danger-loud-active);
|
||||
--color-fill-loud-hover: var(--color-fill-danger-loud-hover);
|
||||
}
|
||||
|
||||
.button {
|
||||
height: var(--ha-button-height, var(--button-height, 40px));
|
||||
align-items: center;
|
||||
border-radius: var(--ha-button-border-radius, 48px);
|
||||
}
|
||||
.button.button--small {
|
||||
border-radius: var(--ha-button-border-radius, 32px);
|
||||
height: var(--ha-button-height, var(--button-height, 32px));
|
||||
}
|
||||
:host([appearance~="plain"]) .button {
|
||||
color: var(--wa-color-on-normal);
|
||||
}
|
||||
:host([appearance~="plain"]) .button.disabled {
|
||||
background-color: var(--transparent-none);
|
||||
color: var(--color-on-disabled-quiet);
|
||||
}
|
||||
|
||||
.button,
|
||||
.button--standard.button--default,
|
||||
.button--standard.button--primary,
|
||||
.button--standard.button--neutral,
|
||||
.button--standard.button--danger,
|
||||
.button--standard.button--warning,
|
||||
.button--standard.button--success,
|
||||
:host([appearance="filled"]) .button:hover:not(.button--disabled) {
|
||||
background-color: var(--ha-button-theme-color);
|
||||
color: var(--ha-button-text-color, var(--text-primary-color));
|
||||
}
|
||||
.button:hover:not(.button--disabled),
|
||||
.button--standard.button--default:hover:not(.button--disabled),
|
||||
.button--standard.button--primary:hover:not(.button--disabled),
|
||||
.button--standard.button--neutral:hover:not(.button--disabled),
|
||||
.button--standard.button--warning:hover:not(.button--disabled),
|
||||
.button--standard.button--success:hover:not(.button--disabled),
|
||||
.button--standard.button--danger:hover:not(.button--disabled),
|
||||
:host([appearance="filled"]) .button:active:not(.button--disabled) {
|
||||
background-color: var(--ha-button-theme-dark-color);
|
||||
color: var(--ha-button-text-color, var(--text-primary-color));
|
||||
}
|
||||
:host([appearance~="outlined"]) .button.disabled {
|
||||
background-color: var(--transparent-none);
|
||||
color: var(--color-on-disabled-quiet);
|
||||
}
|
||||
|
||||
.button--standard.button--default:active:not(.button--disabled),
|
||||
.button--standard.button--primary:active:not(.button--disabled),
|
||||
.button--standard.button--neutral:active:not(.button--disabled),
|
||||
.button--standard.button--danger:active:not(.button--disabled),
|
||||
.button--standard.button--warning:active:not(.button--disabled),
|
||||
.button--standard.button--success:active:not(.button--disabled),
|
||||
.button:active:not(.button--disabled) {
|
||||
background-color: var(--ha-button-theme-darker-color);
|
||||
color: var(--ha-button-text-color, var(--text-primary-color));
|
||||
}
|
||||
@media (hover: hover) {
|
||||
:host([appearance~="filled"])
|
||||
.button:not(.disabled):not(.loading):hover {
|
||||
background-color: var(--color-fill-normal-hover);
|
||||
}
|
||||
:host([appearance~="accent"])
|
||||
.button:not(.disabled):not(.loading):hover {
|
||||
background-color: var(--color-fill-loud-hover);
|
||||
}
|
||||
}
|
||||
:host([appearance~="filled"])
|
||||
.button:not(.disabled):not(.loading):active {
|
||||
background-color: var(--color-fill-normal-active);
|
||||
}
|
||||
:host([appearance~="filled"]) .button.disabled {
|
||||
background-color: var(--color-fill-disabled-normal-resting);
|
||||
color: var(--color-on-disabled-normal);
|
||||
}
|
||||
|
||||
:host([appearance="filled"]) .button,
|
||||
:host([appearance="plain"]) .button:hover:not(.button--disabled) {
|
||||
background-color: var(--ha-button-theme-light-color);
|
||||
color: var(--ha-button-theme-color);
|
||||
}
|
||||
:host([appearance="plain"]) .button {
|
||||
background-color: transparent;
|
||||
color: var(--ha-button-theme-color);
|
||||
}
|
||||
:host([appearance="plain"]) .button:active:not(.button--disabled) {
|
||||
background-color: var(--ha-button-theme-color);
|
||||
color: var(--ha-button-text-color, var(--text-primary-color));
|
||||
}
|
||||
|
||||
.button.button--medium .button__label {
|
||||
padding-inline-start: var(--ha-button-padding-inline-start, 16px);
|
||||
padding-inline-end: var(--ha-button-padding-inline-start, 16px);
|
||||
}
|
||||
|
||||
.button.button--small .button__label {
|
||||
padding-inline-start: var(--ha-button-padding-inline-start, 12px);
|
||||
padding-inline-end: var(--ha-button-padding-inline-start, 12px);
|
||||
}
|
||||
|
||||
/* spacing */
|
||||
.button--has-prefix.button--medium .button__label {
|
||||
padding-inline-start: var(--ha-button-padding-inline-start, 8px);
|
||||
}
|
||||
.button--has-prefix.button--small .button__label {
|
||||
padding-inline-start: var(--ha-button-padding-inline-start, 4px);
|
||||
}
|
||||
.button--has-suffix.button--medium .button__label,
|
||||
.button--caret.button--medium .button__label {
|
||||
padding-inline-end: var(--ha-button-padding-inline-end, 8px);
|
||||
}
|
||||
.button--has-suffix.button--small .button__label,
|
||||
.button--caret.button--small .button__label {
|
||||
padding-inline-end: var(--ha-button-padding-inline-end, 4px);
|
||||
}
|
||||
|
||||
/*
|
||||
* hide content for overlays
|
||||
*/
|
||||
|
||||
:host([hide-content]) .button .button__prefix,
|
||||
:host([hide-content]) .button .button__label,
|
||||
:host([hide-content]) .button .button__suffix,
|
||||
:host([hide-content]) .button .button__caret {
|
||||
visibility: hidden;
|
||||
}
|
||||
`,
|
||||
];
|
||||
:host([appearance~="accent"]) .button {
|
||||
background-color: var(
|
||||
--wa-color-fill-loud,
|
||||
var(--wa-color-neutral-fill-loud)
|
||||
);
|
||||
}
|
||||
:host([appearance~="accent"])
|
||||
.button:not(.disabled):not(.loading):active {
|
||||
background-color: var(--color-fill-loud-active);
|
||||
}
|
||||
:host([appearance~="accent"]) .button.disabled {
|
||||
background-color: var(--color-fill-disabled-loud-resting);
|
||||
color: var(--color-on-disabled-loud);
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
@ -49,7 +49,7 @@ export class HaCopyTextfield extends LitElement {
|
||||
: nothing}
|
||||
</div>
|
||||
<ha-button @click=${this._copy} appearance="filled">
|
||||
<ha-svg-icon slot="prefix" .path=${mdiContentCopy}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiContentCopy}></ha-svg-icon>
|
||||
${this.label || this.hass.localize("ui.common.copy")}
|
||||
</ha-button>
|
||||
</div>
|
||||
|
@ -118,13 +118,13 @@ export class HaFileUpload extends LitElement {
|
||||
@dragleave=${this._handleDragEnd}
|
||||
@dragend=${this._handleDragEnd}
|
||||
>${!this.value
|
||||
? html` <ha-button
|
||||
? html`<ha-button
|
||||
size="small"
|
||||
appearance="filled"
|
||||
@click=${this._openFilePicker}
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
.path=${this.icon || mdiFileUpload}
|
||||
></ha-svg-icon>
|
||||
${this.label || localize("ui.components.file-upload.label")}
|
||||
|
@ -122,7 +122,7 @@ export class HaFormOptionalActions extends LitElement implements HaFormElement {
|
||||
@closed=${stopPropagation}
|
||||
>
|
||||
<ha-button slot="trigger" appearance="filled" size="small">
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.localize?.("ui.components.form-optional-actions.add") ||
|
||||
"Add interaction"}
|
||||
</ha-button>
|
||||
|
@ -127,7 +127,7 @@ class DialogMediaManage extends LitElement {
|
||||
)}
|
||||
@click=${this._handleDelete}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiDelete} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiDelete} slot="start"></ha-svg-icon>
|
||||
</ha-button>
|
||||
|
||||
${this._deleting
|
||||
|
@ -39,7 +39,7 @@ class MediaManageButton extends LitElement {
|
||||
}
|
||||
return html`
|
||||
<ha-button appearance="plain" size="small" @click=${this._manage}>
|
||||
<ha-svg-icon .path=${mdiFolderEdit} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiFolderEdit} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.components.media-browser.file_management.manage"
|
||||
)}
|
||||
|
@ -451,7 +451,7 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||
.path=${this.action === "play"
|
||||
? mdiPlay
|
||||
: mdiPlus}
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
`ui.components.media-browser.${this.action}`
|
||||
|
@ -40,7 +40,7 @@ class MediaUploadButton extends LitElement {
|
||||
@click=${this._startUpload}
|
||||
.loading=${this._uploading > 0}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiUpload} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiUpload} slot="start"></ha-svg-icon>
|
||||
${this._uploading > 0
|
||||
? this.hass.localize(
|
||||
"ui.components.media-browser.file_management.uploading",
|
||||
|
@ -117,7 +117,7 @@ class DialogBox extends LitElement {
|
||||
@click=${this._confirm}
|
||||
?dialogInitialFocus=${!this._params.prompt &&
|
||||
!this._params.destructive}
|
||||
variant=${this._params.destructive ? "danger" : "primary"}
|
||||
variant=${this._params.destructive ? "danger" : "brand"}
|
||||
>
|
||||
${this._params.confirmText
|
||||
? this._params.confirmText
|
||||
|
@ -78,7 +78,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiPlayBoxMultiple}
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
${this.hass.localize("ui.card.media_player.browse_media")}
|
||||
</ha-button>
|
||||
@ -94,7 +94,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiSpeakerMultiple}
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
${groupMembers && groupMembers > 1
|
||||
? html`<span class="badge">
|
||||
|
@ -103,7 +103,7 @@ export class CloudStepIntro extends LitElement {
|
||||
rel="noreferrer noopener"
|
||||
appearance="plain"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiOpenInNew} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiOpenInNew} slot="start"></ha-svg-icon>
|
||||
nabucasa.com
|
||||
</ha-button>
|
||||
<ha-button @click=${this._signUp}
|
||||
|
@ -272,10 +272,7 @@ class HaConfigAreaPage extends LitElement {
|
||||
.entry=${area}
|
||||
@click=${this._showSettings}
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiImagePlus}
|
||||
slot="prefix"
|
||||
></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiImagePlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize("ui.panel.config.areas.add_picture")}
|
||||
</ha-button>`}
|
||||
<ha-card
|
||||
|
@ -113,7 +113,7 @@ export default class HaAutomationAction extends LitElement {
|
||||
@click=${this._addActionDialog}
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.actions.add"
|
||||
)}
|
||||
@ -124,7 +124,7 @@ export default class HaAutomationAction extends LitElement {
|
||||
@click=${this._addActionBuildingBlockDialog}
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.actions.add_building_block"
|
||||
)}
|
||||
|
@ -162,7 +162,7 @@ export default class HaAutomationCondition extends LitElement {
|
||||
@click=${this._addConditionDialog}
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.conditions.add"
|
||||
)}
|
||||
@ -173,7 +173,7 @@ export default class HaAutomationCondition extends LitElement {
|
||||
@click=${this._addConditionBuildingBlockDialog}
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.conditions.add_building_block"
|
||||
)}
|
||||
|
@ -117,7 +117,7 @@ export default class HaAutomationTrigger extends LitElement {
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.automation.editor.triggers.add"
|
||||
)}
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
</ha-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -42,7 +42,7 @@ class HaBackupConfigEncryptionKey extends LitElement {
|
||||
@click=${this._download}
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiDownload} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiDownload} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.backup.encryption_key.download_emergency_kit_action"
|
||||
)}
|
||||
|
@ -295,7 +295,7 @@ class HaConfigBackupSettings extends LitElement {
|
||||
rel="noreferrer"
|
||||
appearance="plain"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiOpenInNew}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiOpenInNew}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.backup.settings.locations.more_locations"
|
||||
)}
|
||||
|
@ -122,10 +122,7 @@ export class DialogTryTts extends LitElement {
|
||||
@click=${this._playExample}
|
||||
.disabled=${this._loadingExample}
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="prefix"
|
||||
.path=${mdiPlayCircleOutline}
|
||||
></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlayCircleOutline}></ha-svg-icon>
|
||||
${this.hass.localize("ui.panel.config.cloud.account.tts.dialog.play")}
|
||||
</ha-button>
|
||||
<ha-button
|
||||
@ -134,7 +131,7 @@ export class DialogTryTts extends LitElement {
|
||||
.disabled=${target === "browser"}
|
||||
@click=${this._createAutomation}
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiRobot}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiRobot}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.cloud.account.tts.dialog.create_automation"
|
||||
)}
|
||||
|
@ -781,7 +781,7 @@ export class HaConfigDevicePage extends LitElement {
|
||||
<ha-svg-icon
|
||||
class=${ifDefined(firstDeviceAction!.classes)}
|
||||
.path=${firstDeviceAction!.icon}
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
></ha-svg-icon>
|
||||
`
|
||||
: nothing}
|
||||
|
@ -138,7 +138,7 @@ export class EnergyBatterySettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.energy.battery.add_battery_system"
|
||||
)}</ha-button
|
||||
|
@ -122,7 +122,7 @@ export class EnergyDeviceSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon
|
||||
>${this.hass.localize(
|
||||
"ui.panel.config.energy.device_consumption.add_device"
|
||||
)}</ha-button
|
||||
|
@ -125,7 +125,7 @@ export class EnergyGasSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon
|
||||
>${this.hass.localize(
|
||||
"ui.panel.config.energy.gas.add_gas_source"
|
||||
)}</ha-button
|
||||
|
@ -167,7 +167,7 @@ export class EnergyGridSettings extends LitElement {
|
||||
size="small"
|
||||
@click=${this._addFromSource}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.energy.grid.add_consumption"
|
||||
)}</ha-button
|
||||
@ -219,7 +219,7 @@ export class EnergyGridSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon
|
||||
>${this.hass.localize(
|
||||
"ui.panel.config.energy.grid.add_return"
|
||||
)}</ha-button
|
||||
@ -274,7 +274,7 @@ export class EnergyGridSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.energy.grid.add_co2_signal"
|
||||
)}
|
||||
|
@ -137,7 +137,7 @@ export class EnergySolarSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.energy.solar.add_solar_production"
|
||||
)}
|
||||
|
@ -126,7 +126,7 @@ export class EnergyWaterSettings extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon
|
||||
>${this.hass.localize(
|
||||
"ui.panel.config.energy.water.add_water_source"
|
||||
)}</ha-button
|
||||
|
@ -185,7 +185,7 @@ export class DialogEnergySolarSettings
|
||||
size="small"
|
||||
@click=${this._addForecast}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.energy.solar.dialog.add_forecast"
|
||||
)}
|
||||
|
@ -51,7 +51,7 @@ export class HaConfigFlowCard extends LitElement {
|
||||
: ""}
|
||||
<ha-button
|
||||
@click=${this._continueFlow}
|
||||
variant=${attention ? "danger" : "primary"}
|
||||
variant=${attention ? "danger" : "brand"}
|
||||
appearance="filled"
|
||||
>
|
||||
${this.hass.localize(
|
||||
|
@ -550,7 +550,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
.flowType=${flowType}
|
||||
.disabled=${!normalEntries.length}
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
`component.${this.domain}.config_subentries.${flowType}.initiate_flow.user`
|
||||
)}</ha-button
|
||||
|
@ -610,7 +610,7 @@ class HaConfigIntegrationsDashboard extends KeyboardShortcutMixin(
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.integrations.add_integration"
|
||||
)}
|
||||
@ -643,7 +643,7 @@ class HaConfigIntegrationsDashboard extends KeyboardShortcutMixin(
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
.path=${mdiPlus}
|
||||
></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
|
@ -207,29 +207,27 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<a
|
||||
<ha-button
|
||||
appearance="plain"
|
||||
href=${`/config/devices/dashboard?historyBack=1&config_entry=${this.configEntryId}`}
|
||||
>
|
||||
<ha-button>
|
||||
${this.hass.localize("ui.panel.config.devices.caption")}
|
||||
</ha-button>
|
||||
</a>
|
||||
<a
|
||||
${this.hass.localize("ui.panel.config.devices.caption")}
|
||||
</ha-button>
|
||||
<ha-button
|
||||
appearance="plain"
|
||||
href=${`/config/entities/dashboard?historyBack=1&config_entry=${this.configEntryId}`}
|
||||
>
|
||||
<ha-button>
|
||||
${this.hass.localize("ui.panel.config.entities.caption")}
|
||||
</ha-button>
|
||||
</a>
|
||||
${this.hass.localize("ui.panel.config.entities.caption")}
|
||||
</ha-button>
|
||||
${this._provisioningEntries?.length
|
||||
? html`<a
|
||||
? html`<ha-button
|
||||
appearance="plain"
|
||||
href=${`provisioned?config_entry=${this.configEntryId}`}
|
||||
><ha-button>
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.dashboard.provisioned_devices"
|
||||
)}
|
||||
</ha-button></a
|
||||
>`
|
||||
</ha-button>`
|
||||
: nothing}
|
||||
</div>
|
||||
</ha-card>
|
||||
@ -410,6 +408,7 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<ha-button
|
||||
appearance="plain"
|
||||
@click=${this._removeNodeClicked}
|
||||
.disabled=${this._status !== "connected" ||
|
||||
(this._network?.controller.inclusion_state !==
|
||||
@ -422,6 +421,7 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
)}
|
||||
</ha-button>
|
||||
<ha-button
|
||||
appearance="plain"
|
||||
@click=${this._rebuildNetworkRoutesClicked}
|
||||
.disabled=${this._status === "disconnected"}
|
||||
>
|
||||
@ -490,15 +490,16 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
"ui.panel.config.zwave_js.dashboard.nvm_backup.restoring"
|
||||
)}
|
||||
${this._restoreProgress}%`
|
||||
: html`<ha-button @click=${this._downloadBackup}>
|
||||
: html`<ha-button appearance="plain" @click=${this._downloadBackup}>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.dashboard.nvm_backup.download_backup"
|
||||
)}
|
||||
</ha-button>
|
||||
<div class="upload-button">
|
||||
<ha-button
|
||||
appearance="plain"
|
||||
@click=${this._restoreButtonClick}
|
||||
class="warning"
|
||||
variant="danger"
|
||||
>
|
||||
<span class="button-content">
|
||||
${this.hass.localize(
|
||||
@ -515,8 +516,9 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
/>
|
||||
</div>
|
||||
<ha-button
|
||||
variant="danger"
|
||||
@click=${this._openConfigFlow}
|
||||
class="warning migrate-button"
|
||||
class="migrate-button"
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.dashboard.nvm_backup.migrate"
|
||||
@ -963,8 +965,8 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
||||
}
|
||||
|
||||
.upload-button {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.upload-button ha-button {
|
||||
|
@ -176,7 +176,7 @@ class ConfigUrlForm extends SubscribeMixin(LitElement) {
|
||||
.url=${externalUrl}
|
||||
@click=${this._copyURL}
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiContentCopy}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiContentCopy}></ha-svg-icon>
|
||||
${this.hass.localize("ui.panel.config.common.copy_link")}
|
||||
</ha-button>
|
||||
</div>
|
||||
|
@ -455,7 +455,7 @@ export class HassioNetwork extends LitElement {
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.network.supervisor.add_address"
|
||||
)}
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
</ha-button>
|
||||
`
|
||||
: nothing}
|
||||
@ -513,7 +513,7 @@ export class HassioNetwork extends LitElement {
|
||||
"ui.panel.config.network.supervisor.add_dns_server"
|
||||
)}
|
||||
<ha-svg-icon
|
||||
slot="prefix"
|
||||
slot="start"
|
||||
.path=${this._dnsMenuOpen ? mdiMenuDown : mdiPlus}
|
||||
></ha-svg-icon>
|
||||
</ha-button>
|
||||
|
@ -122,7 +122,7 @@ export class HaConfigPerson extends LitElement {
|
||||
appearance="filled"
|
||||
size="small"
|
||||
>
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
${hass.localize(
|
||||
"ui.panel.config.person.create_person"
|
||||
)}</ha-button
|
||||
|
@ -51,7 +51,7 @@ export default class HaScriptFields extends LitElement {
|
||||
@click=${this._addField}
|
||||
.disabled=${this.disabled}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="prefix"></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiPlus} slot="start"></ha-svg-icon>
|
||||
${this.hass.localize("ui.panel.config.script.editor.field.add_field")}
|
||||
</ha-button>
|
||||
`;
|
||||
|
@ -215,7 +215,7 @@ export class AssistPref extends LitElement {
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.voice_assistants.assistants.pipeline.add_assistant"
|
||||
)}
|
||||
<ha-svg-icon slot="prefix" .path=${mdiPlus}></ha-svg-icon>
|
||||
<ha-svg-icon slot="start" .path=${mdiPlus}></ha-svg-icon>
|
||||
</ha-button>
|
||||
<ha-settings-row>
|
||||
<span slot="heading">
|
||||
|
@ -265,7 +265,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard {
|
||||
@click=${this._handleActionClick}
|
||||
appearance="filled"
|
||||
size="small"
|
||||
variant=${stateAction === "disarm" ? "danger" : "primary"}
|
||||
variant=${stateAction === "disarm" ? "danger" : "brand"}
|
||||
>
|
||||
${this._actionDisplay(stateAction)}
|
||||
</ha-button>
|
||||
|
@ -296,32 +296,6 @@ export const colorStyles = css`
|
||||
);
|
||||
--chip-background-color: rgba(var(--rgb-primary-text-color), 0.15);
|
||||
|
||||
/* ha-button */
|
||||
--ha-button-primary-color: var(--primary-color);
|
||||
--ha-button-primary-light-color: var(--light-primary-color);
|
||||
--ha-button-primary-dark-color: var(--dark-primary-color);
|
||||
--ha-button-primary-darker-color: var(--darker-primary-color);
|
||||
|
||||
--ha-button-error-color: #b30532;
|
||||
--ha-button-error-light-color: #ffdedc;
|
||||
--ha-button-error-dark-color: #6e021f;
|
||||
--ha-button-error-darker-color: #530016;
|
||||
|
||||
--ha-button-warning-color: var(--warning-color);
|
||||
--ha-button-warning-light-color: #fae3b9c1;
|
||||
--ha-button-warning-dark-color: #ce8600;
|
||||
--ha-button-warning-darker-color: #a36a00;
|
||||
|
||||
--ha-button-success-color: var(--success-color);
|
||||
--ha-button-success-light-color: #add1ae;
|
||||
--ha-button-success-dark-color: #317534;
|
||||
--ha-button-success-darker-color: #225524;
|
||||
|
||||
--ha-button-neutral-color: #545868;
|
||||
--ha-button-neutral-light-color: #d2d5e0;
|
||||
--ha-button-neutral-dark-color: #3c3f4b;
|
||||
--ha-button-neutral-darker-color: #262830;
|
||||
|
||||
/* Vaadin */
|
||||
--material-body-text-color: var(--primary-text-color);
|
||||
--material-background-color: var(--card-background-color);
|
||||
|
@ -17,7 +17,7 @@ export const coreColorStyles = css`
|
||||
--color-primary-60: #37c8fd;
|
||||
--color-primary-70: #7bd4fb;
|
||||
--color-primary-80: #b9e6fc;
|
||||
--color-primary-90: #b9e6fc;
|
||||
--color-primary-90: #dff3fc;
|
||||
--color-primary-95: #eff9fe;
|
||||
|
||||
/* neutral */
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
darkSemanticColorStyles,
|
||||
semanticColorStyles,
|
||||
} from "./semantic.globals";
|
||||
import { waColorStyles } from "./wa.globals";
|
||||
|
||||
export const darkColorVariables = {
|
||||
...extractVars(darkColorStyles),
|
||||
@ -17,10 +18,12 @@ export const darkColorVariables = {
|
||||
export const colorDerivedVariables = {
|
||||
...extractDerivedVars(colorStyles),
|
||||
...extractDerivedVars(semanticColorStyles),
|
||||
...extractDerivedVars(waColorStyles),
|
||||
};
|
||||
|
||||
export const colorStylesCollection = [
|
||||
coreColorStyles.toString(),
|
||||
semanticColorStyles.toString(),
|
||||
colorStyles.toString(),
|
||||
waColorStyles.toString(),
|
||||
];
|
||||
|
@ -318,7 +318,7 @@ export const darkSemanticColorStyles = css`
|
||||
|
||||
/* on primary */
|
||||
--color-on-primary-quiet: var(--color-primary-70);
|
||||
--color-on-primary-normal: var(--color-primary-80);
|
||||
--color-on-primary-normal: var(--color-primary-60);
|
||||
|
||||
/* on neutral */
|
||||
--color-on-neutral-quiet: var(--color-neutral-70);
|
||||
|
55
src/resources/theme/color/wa.globals.ts
Normal file
55
src/resources/theme/color/wa.globals.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import { css } from "lit";
|
||||
|
||||
export const waColorStyles = css`
|
||||
html {
|
||||
--wa-color-brand-fill-loud: var(--color-fill-primary-loud-resting);
|
||||
--wa-color-brand-fill-normal: var(--color-fill-primary-normal-resting);
|
||||
--wa-color-brand-fill-quiet: var(--color-fill-primary-quiet-resting);
|
||||
--wa-color-brand-border-loud: var(--color-border-loud);
|
||||
--wa-color-brand-border-normal: var(--color-primary-50);
|
||||
--wa-color-brand-border-quiet: var(--color-border-quiet);
|
||||
--wa-color-brand-on-loud: var(--color-on-primary-loud);
|
||||
--wa-color-brand-on-normal: var(--color-on-primary-normal);
|
||||
--wa-color-brand-on-quiet: var(--color-on-primary-quiet);
|
||||
|
||||
--wa-color-neutral-fill-loud: var(--color-fill-neutral-loud-resting);
|
||||
--wa-color-neutral-fill-normal: var(--color-fill-neutral-normal-resting);
|
||||
--wa-color-neutral-fill-quiet: var(--color-fill-neutral-quiet-resting);
|
||||
--wa-color-neutral-border-loud: var(--color-border-neutral-loud);
|
||||
--wa-color-neutral-border-normal: var(--color-border-neutral-normal);
|
||||
--wa-color-neutral-border-quiet: var(--color-border-neutral-quiet);
|
||||
--wa-color-neutral-on-loud: var(--color-on-neutral-loud);
|
||||
--wa-color-neutral-on-normal: var(--color-on-neutral-normal);
|
||||
--wa-color-neutral-on-quiet: var(--color-on-neutral-quiet);
|
||||
|
||||
--wa-color-success-fill-loud: var(--color-fill-success-loud-resting);
|
||||
--wa-color-success-fill-normal: var(--color-fill-success-normal-resting);
|
||||
--wa-color-success-fill-quiet: var(--color-fill-success-quiet-resting);
|
||||
--wa-color-success-border-loud: var(--color-border-success-loud);
|
||||
--wa-color-success-border-normal: var(--color-border-success-normal);
|
||||
--wa-color-success-border-quiet: var(--color-border-success-quiet);
|
||||
--wa-color-success-on-loud: var(--color-on-success-loud);
|
||||
--wa-color-success-on-normal: var(--color-on-success-normal);
|
||||
--wa-color-success-on-quiet: var(--color-on-success-quiet);
|
||||
|
||||
--wa-color-warning-fill-loud: var(--color-fill-warning-loud-resting);
|
||||
--wa-color-warning-fill-normal: var(--color-fill-warning-normal-resting);
|
||||
--wa-color-warning-fill-quiet: var(--color-fill-warning-quiet-resting);
|
||||
--wa-color-warning-border-loud: var(--color-border-warning-loud);
|
||||
--wa-color-warning-border-normal: var(--color-border-warning-normal);
|
||||
--wa-color-warning-border-quiet: var(--color-border-warning-quiet);
|
||||
--wa-color-warning-on-loud: var(--color-on-warning-loud);
|
||||
--wa-color-warning-on-normal: var(--color-on-warning-normal);
|
||||
--wa-color-warning-on-quiet: var(--color-on-warning-quiet);
|
||||
|
||||
--wa-color-danger-fill-loud: var(--color-fill-danger-loud-resting);
|
||||
--wa-color-danger-fill-normal: var(--color-fill-danger-normal-resting);
|
||||
--wa-color-danger-fill-quiet: var(--color-fill-danger-quiet-resting);
|
||||
--wa-color-danger-border-loud: var(--color-border-danger-loud);
|
||||
--wa-color-danger-border-normal: var(--color-border-danger-normal);
|
||||
--wa-color-danger-border-quiet: var(--color-border-danger-quiet);
|
||||
--wa-color-danger-on-loud: var(--color-on-danger-loud);
|
||||
--wa-color-danger-on-normal: var(--color-on-danger-normal);
|
||||
--wa-color-danger-on-quiet: var(--color-on-danger-quiet);
|
||||
}
|
||||
`;
|
36
yarn.lock
36
yarn.lock
@ -41,6 +41,23 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@awesome.me/webawesome@npm:3.0.0-beta.3":
|
||||
version: 3.0.0-beta.3
|
||||
resolution: "@awesome.me/webawesome@npm:3.0.0-beta.3"
|
||||
dependencies:
|
||||
"@ctrl/tinycolor": "npm:^4.1.0"
|
||||
"@floating-ui/dom": "npm:^1.6.13"
|
||||
"@shoelace-style/animations": "npm:^1.2.0"
|
||||
"@shoelace-style/localize": "npm:^3.2.1"
|
||||
composed-offset-position: "npm:^0.0.6"
|
||||
lit: "npm:^3.2.1"
|
||||
nanoid: "npm:^5.1.5"
|
||||
qr-creator: "npm:^1.0.0"
|
||||
style-observer: "npm:^0.0.7"
|
||||
checksum: 10/d01adab1e415f015c255e99e5ab7962eac3299bfafe3d6feb7dca0e44452b5e64f05d5c8b212ac1c513c8a0e2a9bdbe8dd68ec8b9ec1c216acf6a689dcc6cfc1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/code-frame@npm:7.26.2":
|
||||
version: 7.26.2
|
||||
resolution: "@babel/code-frame@npm:7.26.2"
|
||||
@ -1651,7 +1668,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@floating-ui/dom@npm:^1.6.12":
|
||||
"@floating-ui/dom@npm:^1.6.12, @floating-ui/dom@npm:^1.6.13":
|
||||
version: 1.7.2
|
||||
resolution: "@floating-ui/dom@npm:1.7.2"
|
||||
dependencies:
|
||||
@ -9323,6 +9340,7 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "home-assistant-frontend@workspace:."
|
||||
dependencies:
|
||||
"@awesome.me/webawesome": "npm:3.0.0-beta.3"
|
||||
"@babel/core": "npm:7.28.0"
|
||||
"@babel/helper-define-polyfill-provider": "npm:0.6.5"
|
||||
"@babel/plugin-transform-runtime": "npm:7.28.0"
|
||||
@ -11516,6 +11534,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"nanoid@npm:^5.1.5":
|
||||
version: 5.1.5
|
||||
resolution: "nanoid@npm:5.1.5"
|
||||
bin:
|
||||
nanoid: bin/nanoid.js
|
||||
checksum: 10/6de2d006b51c983be385ef7ee285f7f2a57bd96f8c0ca881c4111461644bd81fafc2544f8e07cb834ca0f3e0f3f676c1fe78052183f008b0809efe6e273119f5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"natural-compare@npm:^1.4.0":
|
||||
version: 1.4.0
|
||||
resolution: "natural-compare@npm:1.4.0"
|
||||
@ -13979,6 +14006,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"style-observer@npm:^0.0.7":
|
||||
version: 0.0.7
|
||||
resolution: "style-observer@npm:0.0.7"
|
||||
checksum: 10/bb57f98bae4463c1e1b57234f8ffe72ec0de27fb08b032c1919910129c210aacd1ddd615432b9453d491e10d3b719cf6c2a68a97165ca55d6fc9b86c0fca37fb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"superstruct@npm:2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "superstruct@npm:2.0.2"
|
||||
|
Loading…
x
Reference in New Issue
Block a user