Skip to content

Commit

Permalink
chore: merge mushroom 1.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ulic75 committed May 30, 2022
1 parent 2ca0ee0 commit d11b1e7
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 13 deletions.
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mushroom",
"filename": "mushroom.js",
"homeassistant": "2022.4",
"homeassistant": "2022.4.0",
"render_readme": true
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mushroom-cards",
"version": "1.8.5",
"version": "1.8.8",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 10 additions & 4 deletions src/cards/chips-card/chips-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ export class ChipsCard extends LitElement implements LovelaceCard {
const rtl = computeRTL(this._hass);

return html`
<div class="chip-container ${alignment}" ?rtl=${rtl}>
${this._config.chips.map((chip) => this.renderChip(chip))}
</div>
<ha-card>
<div class="chip-container ${alignment}" ?rtl=${rtl}>
${this._config.chips.map((chip) => this.renderChip(chip))}
</div>
</ha-card>
`;
}

Expand All @@ -100,8 +102,12 @@ export class ChipsCard extends LitElement implements LovelaceCard {
static get styles(): CSSResultGroup {
return [
MushroomBaseElement.styles,
cardStyle,
css`
ha-card {
background: none;
box-shadow: none;
border-radius: 0;
}
.chip-container {
display: flex;
flex-direction: row;
Expand Down
1 change: 1 addition & 0 deletions src/shared/button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class MushroomButtonGroup extends LitElement {
}
.container.fill > ::slotted(*) {
flex: 1;
width: 0;
}
`;
}
Expand Down
8 changes: 5 additions & 3 deletions src/shared/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { property, customElement } from "lit/decorators.js";

@customElement("mushroom-chip")
export class BadgeIcon extends LitElement {
export class Chip extends LitElement {
@property() public icon: string = "";

@property() public label: string = "";
Expand All @@ -13,7 +13,7 @@ export class BadgeIcon extends LitElement {

protected render(): TemplateResult {
return html`
<ha-card class="chip">
<ha-card>
${this.avatar ? html` <img class="avatar" src=${this.avatar} /> ` : null}
${!this.avatarOnly
? html`
Expand All @@ -32,7 +32,7 @@ export class BadgeIcon extends LitElement {
--icon-color: var(--primary-text-color);
--text-color: var(--primary-text-color);
}
.chip {
ha-card {
box-sizing: border-box;
height: var(--chip-height);
min-width: var(--chip-height);
Expand All @@ -42,6 +42,8 @@ export class BadgeIcon extends LitElement {
display: flex;
flex-direction: row;
align-items: center;
box-shadow: var(--chip-box-shadow);
background: var(--chip-background);
}
.avatar {
--avatar-size: calc(var(--chip-height) - 2 * var(--chip-avatar-padding));
Expand Down
2 changes: 2 additions & 0 deletions src/shared/state-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class StateItem extends LitElement {
.primary {
font-weight: var(--card-primary-font-weight);
font-size: var(--card-primary-font-size);
line-height: var(--card-primary-line-height);
color: var(--primary-text-color);
text-overflow: ellipsis;
overflow: hidden;
Expand All @@ -42,6 +43,7 @@ export class StateItem extends LitElement {
.secondary {
font-weight: var(--card-secondary-font-weight);
font-size: var(--card-secondary-font-size);
line-height: var(--card-secondary-line-height);
color: var(--secondary-text-color);
text-overflow: ellipsis;
overflow: hidden;
Expand Down
149 changes: 149 additions & 0 deletions src/translations/he.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"editor": {
"form": {
"color_picker": {
"values": {
"default": "צבע ברירת מחדל"
}
},
"info_picker": {
"values": {
"default": "מידע ברירת מחדל",
"name": "שם",
"state": "מצב",
"last-changed": "שונה לאחרונה",
"last-updated": "עודכן לאחרונה",
"none": "ריק"
}
},
"layout_picker": {
"values": {
"default": "סידור ברירת מחדל",
"vertical": "סידור מאונך",
"horizontal": "סידור מאוזן"
}
},
"alignment_picker": {
"values": {
"default": "יישור ברירת מחדל",
"start": "התחלה",
"end": "סוף",
"center": "אמצע",
"justify": "מוצדק"
}
}
},
"card": {
"generic": {
"hide_name": "הסתר שם?",
"hide_state": "החבא מצב?",
"hide_icon": "החבא אייקון?",
"icon_color": "צבע אייקון",
"layout": "סידור",
"fill_container": "מלא גבולות",
"primary_info": "מידע ראשי",
"secondary_info": "מידע מישני",
"content_info": "תוכן",
"use_entity_picture": "השתמש בתמונת ישות?",
"collapsible_controls": "הסתר שליטה כשאר מכובה?"
},
"light": {
"show_brightness_control": "שליטה בבהירות?",
"use_light_color": "השתמש בצבע האור",
"show_color_temp_control": "שליטה בגוון האור?",
"show_color_control": "שליטה בצבע האור?",
"incompatible_controls": "יתכן וחלק מהכפתורים לא יופיעו אם התאורה אינה תומכת בתכונה."
},
"fan": {
"icon_animation": "להנפיש אייקון כאשר דלוק?",
"show_percentage_control": "שליטה באחוז?",
"show_oscillate_control": "שליטה בהתנדנדות?"
},
"cover": {
"show_buttons_control": "כפתורי שליטה?",
"show_position_control": "שליטה במיקום?"
},
"alarm_control_panel": {
"show_keypad": "הצג מקלדת"
},
"template": {
"primary": "מידע ראשי",
"secondary": "מידע מישני",
"multiline_secondary": "מידע מישני רו קווי?",
"entity_extra": "משמש בתבניות ופעולות",
"content": "תוכן"
},
"title": {
"title": "כותרת",
"subtitle": "כתובית"
},
"chips": {
"alignment": "יישור"
},
"weather": {
"show_conditions": "הצג תנאים?",
"show_temperature": "הצג טמפרטורה?"
},
"update": {
"show_buttons_control": "הצג כפתורי שליטה?"
},
"vacuum": {
"commands": "פקודות"
},
"media-player": {
"use_media_info": "השתמש במידע מדיה",
"use_media_artwork": "השתמש באומנות מדיה",
"show_volume_level": "הצג שליטת ווליום",
"media_controls": "שליטה במדיה",
"media_controls_list": {
"on_off": "הדלק/כבה",
"shuffle": "ערבב",
"previous": "רצועה קודמת",
"play_pause_stop": "נגן/השהה/הפסק",
"next": "רצועה הבאה",
"repeat": "חזרה"
},
"volume_controls": "שליטה בווליום",
"volume_controls_list": {
"volume_buttons": "כפתורי ווליום",
"volume_set": "רמת ווליום",
"volume_mute": "השתק"
}
},
"lock": {
"lock": "נעל",
"unlock": "בטל נעילה",
"open": "פתח"
},
"humidifier": {
"show_target_humidity_control": "שליטה בלחות?"
}
},
"chip": {
"sub_element_editor": {
"title": "עורך שבב"
},
"conditional": {
"chip": "שבב"
},
"chip-picker": {
"chips": "שבבים",
"add": "הוסף שבב",
"edit": "ערוך",
"clear": "נקה",
"select": "בחר שבב",
"types": {
"action": "פעולה",
"alarm-control-panel": "אזעקה",
"back": "חזור",
"conditional": "מותנה",
"entity": "ישות",
"light": "אור",
"menu": "תפריט",
"template": "תבנית",
"weather": "מזג אוויר"
}
}
}
}
}
4 changes: 3 additions & 1 deletion src/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"primary_info": "Primaire informatie",
"secondary_info": "Secundaire informatie",
"content_info": "Inhoud",
"use_entity_picture": "Gebruik entiteit afbeelding"
"use_entity_picture": "Gebruik entiteit afbeelding",
"collapsible_controls": "Bedieningselementen verbergen wanneer uitgeschakeld"
},
"light": {
"show_brightness_control": "Bediening helderheid",
Expand Down Expand Up @@ -91,6 +92,7 @@
"media-player": {
"use_media_info": "Gebruik media informatie",
"use_media_artwork": "Gebruik media omslag",
"show_volume_level": "Toon volumeniveau",
"media_controls": "Mediabediening",
"media_controls_list": {
"on_off": "zet aan/uit",
Expand Down
16 changes: 15 additions & 1 deletion src/utils/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const themeVariables = css`
--card-secondary-font-size: var(--mush-card-secondary-font-size, 12px);
--card-primary-font-weight: var(--mush-card-primary-font-weight, bold);
--card-secondary-font-weight: var(--mush-card-secondary-font-weight, bolder);
--card-primary-line-height: var(--mush-card-primary-line-height, 1.5);
--card-secondary-line-height: var(--mush-card-secondary-line-height, 1.5);
/* Chips */
--chip-spacing: var(--mush-chip-spacing, 8px);
Expand All @@ -29,7 +31,19 @@ export const themeVariables = css`
--chip-icon-size: var(--mush-chip-icon-size, 0.5em);
--chip-avatar-padding: var(--mush-chip-avatar-padding, 0.1em);
--chip-avatar-border-radius: var(--mush-chip-avatar-border-radius, 50%);
--chip-box-shadow: var(
--mush-chip-box-shadow,
var(
--ha-card-box-shadow,
0px 2px 1px -1px rgba(0, 0, 0, 0.2),
0px 1px 1px 0px rgba(0, 0, 0, 0.14),
0px 1px 3px 0px rgba(0, 0, 0, 0.12)
)
);
--chip-background: var(
--mush-chip-background,
var(--ha-card-background, var(--card-background-color, white))
);
/* Controls */
--control-border-radius: var(--mush-control-border-radius, 12px);
--control-height: var(--mush-control-height, 42px);
Expand Down

0 comments on commit d11b1e7

Please sign in to comment.