Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ha-card migration - step #2 #3187

Merged
merged 7 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions gallery/src/ha-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import "@polymer/app-layout/app-header-layout/app-header-layout";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-item/paper-item-body";
import "@polymer/paper-icon-button/paper-icon-button";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";

import "../../src/managers/notification-manager";
import "../../src/components/ha-card";

const DEMOS = require.context("./demos", true, /^(.*\.(ts$))[^.]*$/im);

Expand Down Expand Up @@ -38,13 +38,13 @@ class HaGallery extends PolymerElement {
align-items: start;
}

.pickers paper-card {
.pickers ha-card {
width: 400px;
display: block;
margin: 16px 8px;
}

.pickers paper-card:last-child {
.pickers ha-card:last-child {
margin-bottom: 16px;
}

Expand Down Expand Up @@ -79,7 +79,7 @@ class HaGallery extends PolymerElement {
<div id='demo'></div>
<template is='dom-if' if='[[!_demo]]'>
<div class='pickers'>
<paper-card heading="Lovelace card demos">
<ha-card header="Lovelace card demos">
<div class='card-content intro'>
<p>
Lovelace has many different cards. Each card allows the user to tell a different story about what is going on in their house. These cards are very customizable, as no household is the same.
Expand All @@ -101,9 +101,9 @@ class HaGallery extends PolymerElement {
</paper-item>
</a>
</template>
</paper-card>
</ha-card>

<paper-card heading="More Info demos">
<ha-card header="More Info demos">
<div class='card-content intro'>
<p>
More info screens show up when an entity is clicked.
Expand All @@ -117,9 +117,9 @@ class HaGallery extends PolymerElement {
</paper-item>
</a>
</template>
</paper-card>
</ha-card>

<paper-card heading="Util demos">
<ha-card header="Util demos">
<div class='card-content intro'>
<p>
Test pages for our utility functions.
Expand All @@ -133,7 +133,7 @@ class HaGallery extends PolymerElement {
</paper-item>
</a>
</template>
</paper-card>
</ha-card>
</div>
</template>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/panels/calendar/ha-panel-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import "@polymer/app-layout/app-header-layout/app-header-layout";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/paper-listbox/paper-listbox";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-checkbox/paper-checkbox";
import "@polymer/paper-item/paper-item";
import { html } from "@polymer/polymer/lib/utils/html-tag";
Expand All @@ -11,6 +10,7 @@ import moment from "moment";
import dates from "react-big-calendar/lib/utils/dates";

import "../../components/ha-menu-button";
import "../../components/ha-card";
import "../../resources/ha-style";
import "./ha-big-calendar";

Expand Down Expand Up @@ -74,7 +74,7 @@ class HaPanelCalendar extends LocalizeMixin(PolymerElement) {

<div class="flex content">
<div id="calendars" class="layout vertical wrap">
<paper-card heading="Calendars">
<ha-card header="Calendars">
<paper-listbox
id="calendar_list"
multi
Expand All @@ -92,7 +92,7 @@ class HaPanelCalendar extends LocalizeMixin(PolymerElement) {
</paper-item>
</template>
</paper-listbox>
</paper-card>
</ha-card>
</div>
<div class="flex layout horizontal wrap">
<ha-big-calendar
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zha/zha-binding.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "@material/mwc-button/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-listbox/paper-listbox";
Expand Down Expand Up @@ -55,7 +55,7 @@ export class ZHABindingControl extends LitElement {
</div>
<span slot="introduction">Bind and unbind devices.</span>

<paper-card class="content">
<ha-card class="content">
<div class="command-picker">
<paper-dropdown-menu label="Bindable Devices" class="flex">
<paper-listbox
Expand Down Expand Up @@ -102,7 +102,7 @@ export class ZHABindingControl extends LitElement {
`
: ""}
</div>
</paper-card>
</ha-card>
</ha-config-section>
`;
}
Expand Down Expand Up @@ -155,8 +155,7 @@ export class ZHABindingControl extends LitElement {
margin-top: 24px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zha/zha-cluster-attributes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-input/paper-input";
Expand Down Expand Up @@ -95,7 +95,7 @@ export class ZHAClusterAttributes extends LitElement {
</div>
<span slot="introduction">View and edit cluster attributes.</span>

<paper-card class="content">
<ha-card class="content">
<div class="attribute-picker">
<paper-dropdown-menu
label="Attributes of the selected cluster"
Expand Down Expand Up @@ -129,7 +129,7 @@ export class ZHAClusterAttributes extends LitElement {
${this._selectedAttributeIndex !== -1
? this._renderAttributeInteractions()
: ""}
</paper-card>
</ha-card>
</ha-config-section>
`;
}
Expand Down Expand Up @@ -280,8 +280,7 @@ export class ZHAClusterAttributes extends LitElement {
margin-top: 24px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zha/zha-cluster-commands.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-input/paper-input";
Expand Down Expand Up @@ -88,7 +88,7 @@ export class ZHAClusterCommands extends LitElement {
</div>
<span slot="introduction">View and issue cluster commands.</span>

<paper-card class="content">
<ha-card class="content">
<div class="command-picker">
<paper-dropdown-menu
label="Commands of the selected cluster"
Expand Down Expand Up @@ -149,7 +149,7 @@ export class ZHAClusterCommands extends LitElement {
</div>
`
: ""}
</paper-card>
</ha-card>
</ha-config-section>
`;
}
Expand Down Expand Up @@ -215,8 +215,7 @@ export class ZHAClusterCommands extends LitElement {
margin-top: 24px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/panels/config/zha/zha-clusters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
Expand Down
8 changes: 4 additions & 4 deletions src/panels/config/zha/zha-device-card.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/entity/state-badge";
import "../../../components/ha-card";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-item/paper-icon-item";
Expand Down Expand Up @@ -108,7 +108,7 @@ class ZHADeviceCard extends LitElement {

protected render(): TemplateResult | void {
return html`
<paper-card heading="${this.isJoinPage ? this.device!.name : ""}">
<ha-card header="${this.isJoinPage ? this.device!.name : ""}">
${
this.isJoinPage
? html`
Expand Down Expand Up @@ -256,7 +256,7 @@ class ZHADeviceCard extends LitElement {
: ""
}
</div>
</paper-card>
</ha-card>
`;
}

Expand Down Expand Up @@ -326,7 +326,7 @@ class ZHADeviceCard extends LitElement {
padding: 4px;
justify-content: left;
}
paper-card {
ha-card {
flex: 1 0 100%;
padding-bottom: 10px;
min-width: 425px;
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zha/zha-network.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-icon-button/paper-icon-button";

import {
Expand Down Expand Up @@ -50,7 +50,7 @@ export class ZHANetwork extends LitElement {
</div>
<span slot="introduction">Commands that affect entire network</span>

<paper-card class="content">
<ha-card class="content">
<div class="card-actions">
<mwc-button @click=${this._onAddDevicesClick}>
Add Devices
Expand All @@ -66,7 +66,7 @@ export class ZHANetwork extends LitElement {
`
: ""}
</div>
</paper-card>
</ha-card>
</ha-config-section>
`;
}
Expand All @@ -87,8 +87,7 @@ export class ZHANetwork extends LitElement {
margin-top: 24px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zha/zha-node.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
import "./zha-clusters";
import "./zha-device-card";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-item/paper-item";
Expand Down Expand Up @@ -70,7 +70,7 @@ export class ZHANode extends LitElement {
press at ~5 second intervals that keep devices awake while you
interact with them.
</span>
<paper-card class="content">
<ha-card class="content">
<div class="node-picker">
<paper-dropdown-menu
label="Devices"
Expand Down Expand Up @@ -116,7 +116,7 @@ export class ZHANode extends LitElement {
`
: ""}
${this._selectedDevice ? this._renderClusters() : ""}
</paper-card>
</ha-card>
</ha-config-section>
`;
}
Expand Down Expand Up @@ -183,8 +183,7 @@ export class ZHANode extends LitElement {
padding-bottom: 16px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down
9 changes: 4 additions & 5 deletions src/panels/config/zwave/ha-config-zwave.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-input/paper-input";
Expand All @@ -15,6 +14,7 @@ import "../../../components/ha-service-description";
import "../../../components/ha-paper-icon-button-arrow-prev";
import "../../../layouts/ha-app-layout";
import "../../../resources/ha-style";
import "../../../components/ha-card";

import "../ha-config-section";
import "../ha-form-style";
Expand Down Expand Up @@ -53,8 +53,7 @@ class HaConfigZwave extends LocalizeMixin(EventsMixin(PolymerElement)) {
padding-right: 24px;
}

paper-card {
display: block;
ha-card {
margin: 0 auto;
max-width: 600px;
}
Expand Down Expand Up @@ -116,7 +115,7 @@ class HaConfigZwave extends LocalizeMixin(EventsMixin(PolymerElement)) {
list of available commands.
</span>

<paper-card class="content">
<ha-card class="content">
<div class="device-picker">
<paper-dropdown-menu dynamic-align="" label="Nodes" class="flex">
<paper-listbox
Expand Down Expand Up @@ -309,7 +308,7 @@ class HaConfigZwave extends LocalizeMixin(EventsMixin(PolymerElement)) {
</div>
</template>
</template>
</paper-card>
</ha-card>

<template is="dom-if" if="[[computeIsNodeSelected(selectedNode)]]">
<!-- Value card -->
Expand Down