@universal-material/web 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.d.ts +9 -0
- package/all.d.ts.map +1 -0
- package/all.js +9 -0
- package/all.js.map +1 -0
- package/button/button-base.d.ts +37 -0
- package/button/button-base.d.ts.map +1 -0
- package/button/button-base.js +199 -0
- package/button/button-base.js.map +1 -0
- package/button/button-set.d.ts +11 -0
- package/button/button-set.d.ts.map +1 -0
- package/button/button-set.js +27 -0
- package/button/button-set.js.map +1 -0
- package/button/button.d.ts +18 -0
- package/button/button.d.ts.map +1 -0
- package/button/button.js +137 -0
- package/button/button.js.map +1 -0
- package/button/fab.d.ts +17 -0
- package/button/fab.d.ts.map +1 -0
- package/button/fab.js +144 -0
- package/button/fab.js.map +1 -0
- package/button/icon-button.d.ts +35 -0
- package/button/icon-button.d.ts.map +1 -0
- package/button/icon-button.js +153 -0
- package/button/icon-button.js.map +1 -0
- package/card/button-set.d.ts +11 -0
- package/card/button-set.d.ts.map +1 -0
- package/card/button-set.js +26 -0
- package/card/button-set.js.map +1 -0
- package/card/card-content.d.ts +11 -0
- package/card/card-content.d.ts.map +1 -0
- package/card/card-content.js +24 -0
- package/card/card-content.js.map +1 -0
- package/card/card-media.d.ts +12 -0
- package/card/card-media.d.ts.map +1 -0
- package/card/card-media.js +37 -0
- package/card/card-media.js.map +1 -0
- package/card/card.d.ts +15 -0
- package/card/card.d.ts.map +1 -0
- package/card/card.js +52 -0
- package/card/card.js.map +1 -0
- package/divider/divider.d.ts +11 -0
- package/divider/divider.d.ts.map +1 -0
- package/divider/divider.js +35 -0
- package/divider/divider.js.map +1 -0
- package/elevation/elevation.d.ts +10 -0
- package/elevation/elevation.d.ts.map +1 -0
- package/elevation/elevation.js +47 -0
- package/elevation/elevation.js.map +1 -0
- package/package.json +82 -0
- package/ripple/ripple.d.ts +19 -0
- package/ripple/ripple.d.ts.map +1 -0
- package/ripple/ripple.js +173 -0
- package/ripple/ripple.js.map +1 -0
- package/shared/area-hidden-element.d.ts +5 -0
- package/shared/area-hidden-element.d.ts.map +1 -0
- package/shared/area-hidden-element.js +10 -0
- package/shared/area-hidden-element.js.map +1 -0
package/button/fab.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html, nothing } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { ButtonBase } from './button-base';
|
|
10
|
+
let FabButton = class FabButton extends ButtonBase {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.color = 'primary';
|
|
14
|
+
this.size = 'medium';
|
|
15
|
+
this.label = null;
|
|
16
|
+
this.lowered = false;
|
|
17
|
+
}
|
|
18
|
+
get extended() {
|
|
19
|
+
return !!this.label;
|
|
20
|
+
}
|
|
21
|
+
renderContent() {
|
|
22
|
+
const labelTag = html `<span>${this.label}</span>`;
|
|
23
|
+
return html `
|
|
24
|
+
<span class="icon" aria-hidden="true"><slot name="icon"></slot></span>
|
|
25
|
+
${this.label ? labelTag : nothing}
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
FabButton.styles = [
|
|
30
|
+
ButtonBase.styles,
|
|
31
|
+
css `
|
|
32
|
+
:host {
|
|
33
|
+
aspect-ratio: 1;
|
|
34
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 3);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([lowered]) {
|
|
38
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (hover: hover) {
|
|
42
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
43
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:hover:not(:focus-within):not(:active)[lowered]) {
|
|
47
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 2);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (hover: hover) {
|
|
52
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
53
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([size="small"]) {
|
|
58
|
+
width: var(--u-fab-button-small-size, 40px);
|
|
59
|
+
border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-medium, 12px));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([size="large"]) {
|
|
63
|
+
width: var(--u-fab-button-medium-size, 96px);
|
|
64
|
+
border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-extra-large, 28px));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([extended]),
|
|
68
|
+
:host([size="medium"]) {
|
|
69
|
+
width: var(--u-fab-button-medium-size, 56px);
|
|
70
|
+
border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-large, 16px));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([size="large"]) .icon {
|
|
74
|
+
font-size: var(--u-fab-button-icon-size, 2rem);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([extended]),
|
|
78
|
+
:host([size="small"]) .icon,
|
|
79
|
+
:host([size="medium"]) .icon {
|
|
80
|
+
font-size: var(--u-fab-button-icon-size, 1.5rem);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([extended]) {
|
|
84
|
+
width: auto;
|
|
85
|
+
height: var(--u-extended-fab-button-height, 56px);
|
|
86
|
+
aspect-ratio: auto;
|
|
87
|
+
min-width: var(--u-extended-fab-button-min-width, 80px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([extended]) .button {
|
|
91
|
+
padding-inline: var(--u-extended-fab-button-padding, 16px 24px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([extended]) .icon {
|
|
95
|
+
margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([color="primary"]) {
|
|
99
|
+
background-color: var(--u-fab-button-primary-background-color, var(--u-primary-container-color, #eaddff));
|
|
100
|
+
color: var(--u-fab-button-primary-text-color, var(--u-on-primary-container-color, #21005d));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([color="secondary"]) {
|
|
104
|
+
background-color: var(--u-fab-button-secondary-background-color, var(--u-secondary-container-color, #e8def8));
|
|
105
|
+
color: var(--u-fab-button-secondary-text-color, var(--u-on-secondary-container-color, #1d192b));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([color="tertiary"]) {
|
|
109
|
+
background-color: var(--u-fab-button-tertiary-background-color, var(--u-tertiary-container-color, #ffd8e4));
|
|
110
|
+
color: var(--u-fab-button-tertiary-text-color, var(--u-on-tertiary-container-color, #31111d));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([color="branded"]),
|
|
114
|
+
:host([color="surface"]) {
|
|
115
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-surface-container-high-color, #ece6f0));
|
|
116
|
+
color: var(--u-fab-button-surface-text-color, var(--_primary-color));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([color="branded"][lowered]),
|
|
120
|
+
:host([color="surface"][lowered]) {
|
|
121
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-surface-container-low-color, #ece6f0));
|
|
122
|
+
}
|
|
123
|
+
`
|
|
124
|
+
];
|
|
125
|
+
__decorate([
|
|
126
|
+
property({ reflect: true })
|
|
127
|
+
], FabButton.prototype, "color", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property({ reflect: true })
|
|
130
|
+
], FabButton.prototype, "size", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ reflect: true })
|
|
133
|
+
], FabButton.prototype, "label", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ type: Boolean, reflect: true })
|
|
136
|
+
], FabButton.prototype, "lowered", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: Boolean, reflect: true })
|
|
139
|
+
], FabButton.prototype, "extended", null);
|
|
140
|
+
FabButton = __decorate([
|
|
141
|
+
customElement('u-fab')
|
|
142
|
+
], FabButton);
|
|
143
|
+
export { FabButton };
|
|
144
|
+
//# sourceMappingURL=fab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.js","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,GAAG,EAAa,IAAI,EAAsB,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGlC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAmGsB,UAAK,GAAiE,SAAS,CAAC;QAChF,SAAI,GAAiC,QAAQ,CAAC;QAC9C,UAAK,GAAkB,IAAI,CAAC;QACb,YAAO,GAAG,KAAK,CAAC;IAc5D,CAAC;IAZC,IAAI,QAAQ;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEkB,aAAa;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAA,SAAS,IAAI,CAAC,KAAK,SAAS,CAAC;QAElD,OAAO,IAAI,CAAA;;QAEP,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;KAClC,CAAC;IACJ,CAAC;;AAjHe,gBAAM,GAA4B;IACrC,UAAU,CAAC,MAAM;IAC5B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4FF;CACF,AA/FqB,CA+FpB;AAEyB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;wCAAiF;AAChF;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAA+C;AAC9C;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;wCAA6B;AACb;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAiB;AAE1D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAGxC;AA1GU,SAAS;IADrB,aAAa,CAAC,OAAO,CAAC;GACV,SAAS,CAoHrB","sourcesContent":["import {css, CSSResult, html, HTMLTemplateResult, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport {ButtonBase} from './button-base';\n\n@customElement('u-fab')\nexport class FabButton extends ButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [\n <CSSResult>ButtonBase.styles,\n css`\n :host {\n aspect-ratio: 1;\n --u-elevation-level: var(--u-fab-button-elevation-level, 3);\n }\n\n :host([lowered]) {\n --u-elevation-level: var(--u-fab-button-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host(:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);\n }\n\n :host(:hover:not(:focus-within):not(:active)[lowered]) {\n --u-elevation-level: var(--u-fab-button-elevation-level, 2);\n }\n }\n\n @media (hover: hover) {\n :host(:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);\n }\n }\n\n :host([size=\"small\"]) {\n width: var(--u-fab-button-small-size, 40px);\n border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-medium, 12px));\n }\n \n :host([size=\"large\"]) {\n width: var(--u-fab-button-medium-size, 96px);\n border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-extra-large, 28px));\n }\n\n :host([extended]),\n :host([size=\"medium\"]) {\n width: var(--u-fab-button-medium-size, 56px);\n border-radius: var(--u-fab-button-medium-shape, var(--u-shape-corner-large, 16px));\n }\n\n :host([size=\"large\"]) .icon {\n font-size: var(--u-fab-button-icon-size, 2rem);\n }\n\n :host([extended]),\n :host([size=\"small\"]) .icon,\n :host([size=\"medium\"]) .icon {\n font-size: var(--u-fab-button-icon-size, 1.5rem);\n }\n\n :host([extended]) {\n width: auto;\n height: var(--u-extended-fab-button-height, 56px);\n aspect-ratio: auto;\n min-width: var(--u-extended-fab-button-min-width, 80px);\n }\n\n :host([extended]) .button {\n padding-inline: var(--u-extended-fab-button-padding, 16px 24px);\n }\n\n :host([extended]) .icon {\n margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);\n }\n\n :host([color=\"primary\"]) {\n background-color: var(--u-fab-button-primary-background-color, var(--u-primary-container-color, #eaddff));\n color: var(--u-fab-button-primary-text-color, var(--u-on-primary-container-color, #21005d)); \n }\n\n :host([color=\"secondary\"]) {\n background-color: var(--u-fab-button-secondary-background-color, var(--u-secondary-container-color, #e8def8));\n color: var(--u-fab-button-secondary-text-color, var(--u-on-secondary-container-color, #1d192b)); \n }\n\n :host([color=\"tertiary\"]) {\n background-color: var(--u-fab-button-tertiary-background-color, var(--u-tertiary-container-color, #ffd8e4));\n color: var(--u-fab-button-tertiary-text-color, var(--u-on-tertiary-container-color, #31111d));\n }\n\n :host([color=\"branded\"]),\n :host([color=\"surface\"]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-surface-container-high-color, #ece6f0));\n color: var(--u-fab-button-surface-text-color, var(--_primary-color));\n }\n\n :host([color=\"branded\"][lowered]),\n :host([color=\"surface\"][lowered]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-surface-container-low-color, #ece6f0));\n }\n `\n ];\n\n @property({reflect: true}) color: 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded' = 'primary';\n @property({reflect: true}) size: 'small' | 'medium' | 'large' = 'medium';\n @property({reflect: true}) label: string | null = null;\n @property({type: Boolean, reflect: true}) lowered = false;\n @property({type: Boolean, reflect: true})\n get extended(): boolean {\n return !!this.label;\n }\n\n protected override renderContent(): HTMLTemplateResult {\n const labelTag = html`<span>${this.label}</span>`;\n\n return html`\n <span class=\"icon\" aria-hidden=\"true\"><slot name=\"icon\"></slot></span>\n ${this.label ? labelTag : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-fab': FabButton;\n }\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSResult, HTMLTemplateResult, nothing } from 'lit';
|
|
2
|
+
import '../ripple/ripple';
|
|
3
|
+
import { ButtonBase } from './button-base';
|
|
4
|
+
export declare class IconButton extends ButtonBase {
|
|
5
|
+
static styles: CSSResult | CSSResult[];
|
|
6
|
+
variant: 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
7
|
+
/**
|
|
8
|
+
* When true, the button will toggle between selected and unselected
|
|
9
|
+
* states
|
|
10
|
+
*/
|
|
11
|
+
toggle: boolean;
|
|
12
|
+
hasSelectionIcon: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the selected state. When false, displays the default icon. When true,
|
|
15
|
+
* displays the selected icon, or the default icon If no `slot="selected"`
|
|
16
|
+
* icon is provided.
|
|
17
|
+
*/
|
|
18
|
+
selected: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The `aria-label` of the button when the button is toggleable and selected.
|
|
21
|
+
*/
|
|
22
|
+
ariaLabelSelected: string;
|
|
23
|
+
type: 'submit' | 'button' | 'reset';
|
|
24
|
+
private readonly selectedIcons;
|
|
25
|
+
protected renderContent(): HTMLTemplateResult;
|
|
26
|
+
protected handleClick(_: UIEvent): void;
|
|
27
|
+
getAriaLabel(): string | null | typeof nothing;
|
|
28
|
+
private handleSlotChange;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'u-icon-button': IconButton;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAQ,kBAAkB,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAGtE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,qBACa,UAAW,SAAQ,UAAU;IAExC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CA2E7C;IAEyB,OAAO,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAc;IAE9F;;;OAGG;IACwB,MAAM,UAAS;IAEiC,gBAAgB,UAAS;IAEpG;;;;OAIG;IACuC,QAAQ,UAAS;IAE3D;;OAEG;IAC2C,iBAAiB,SAAM;IAE5D,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAGxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;cAUnC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAMvC,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,OAAO,OAAO;IAMvD,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,UAAU,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html } from 'lit';
|
|
8
|
+
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import '../ripple/ripple';
|
|
10
|
+
import { ButtonBase } from './button-base';
|
|
11
|
+
let IconButton = class IconButton extends ButtonBase {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.variant = 'standard';
|
|
15
|
+
/**
|
|
16
|
+
* When true, the button will toggle between selected and unselected
|
|
17
|
+
* states
|
|
18
|
+
*/
|
|
19
|
+
this.toggle = false;
|
|
20
|
+
this.hasSelectionIcon = false;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the selected state. When false, displays the default icon. When true,
|
|
23
|
+
* displays the selected icon, or the default icon If no `slot="selected"`
|
|
24
|
+
* icon is provided.
|
|
25
|
+
*/
|
|
26
|
+
this.selected = false;
|
|
27
|
+
/**
|
|
28
|
+
* The `aria-label` of the button when the button is toggleable and selected.
|
|
29
|
+
*/
|
|
30
|
+
this.ariaLabelSelected = '';
|
|
31
|
+
this.type = 'button';
|
|
32
|
+
}
|
|
33
|
+
renderContent() {
|
|
34
|
+
return html `
|
|
35
|
+
<span class="icon" aria-hidden="true"><slot></slot></span>
|
|
36
|
+
<span class="icon icon-selected" aria-hidden="true">
|
|
37
|
+
<slot name="selected" @slotchange="${this.handleSlotChange}"></slot>
|
|
38
|
+
</span>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
handleClick(_) {
|
|
42
|
+
if (this.toggle) {
|
|
43
|
+
this.selected = !this.selected;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
getAriaLabel() {
|
|
47
|
+
return this.selected
|
|
48
|
+
? this.ariaLabelSelected || super.getAriaLabel()
|
|
49
|
+
: super.getAriaLabel();
|
|
50
|
+
}
|
|
51
|
+
handleSlotChange() {
|
|
52
|
+
this.hasSelectionIcon = this.selectedIcons.length > 0;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
IconButton.styles = [
|
|
56
|
+
ButtonBase.styles,
|
|
57
|
+
css `
|
|
58
|
+
|
|
59
|
+
:host {
|
|
60
|
+
--_surface-container-highest-color: var(--u-surface-container-highest-color, #e6e0e9);
|
|
61
|
+
|
|
62
|
+
width: var(--u-icon-button-size, 2.5rem);
|
|
63
|
+
height: var(--u-icon-button-size, 2.5rem);
|
|
64
|
+
border-radius: var(--u-icon-button-shape, 9999px);
|
|
65
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.icon {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
width: var(--u-icon-button-icon-size, 1.5rem);
|
|
72
|
+
height: var(--u-icon-button-icon-size, 1.5rem);
|
|
73
|
+
font-size: var(--u-icon-button-icon-size, 1.5rem);
|
|
74
|
+
line-height: var(--u-icon-button-icon-size, 1.5rem);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.icon.icon-selected {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([selected]) .icon:not(.icon-selected) {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([selected]) .icon.icon-selected {
|
|
86
|
+
display: inline-block;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([variant="filled"]) {
|
|
90
|
+
background-color: var(--u-filled-icon-button-unselected-background-color, var(--_surface-container-highest-color));
|
|
91
|
+
color: var(--u-filled-icon-button-unselected-text-color, var(--_primary-color));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([variant="tonal"]) {
|
|
95
|
+
background-color: var(--u-total-icon-button-unselected-background-color, var(--_surface-container-highest-color));
|
|
96
|
+
color: var(--u-tonal-icon-button-unselected-text-color, var(--u-on-surface-variant-color, #49454f));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([selected][variant="filled"]),
|
|
100
|
+
:host([variant="filled"]:not([has-selection-icon])) {
|
|
101
|
+
background-color: var(--u-filled-icon-button-background-color, var(--_primary-color));
|
|
102
|
+
color: var(--u-filled-icon-button-text-color, var(--u-on-primary-color, #fff));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([selected][variant="tonal"]),
|
|
106
|
+
:host([variant="tonal"]:not([has-selection-icon])) {
|
|
107
|
+
background-color: var(--u-tonal-icon-button-background-color, var(--u-secondary-container-color, #e8def8));
|
|
108
|
+
color: var(--u-tonal-icon-button-text-color, var(--u-on-secondary-container-color, #1d192b));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:host([variant="standard"]),
|
|
112
|
+
:host([variant="outlined"]) {
|
|
113
|
+
color: var(--u-on-surface-variant-color, #49454f);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([variant="outlined"]) {
|
|
117
|
+
border: 1px solid var(--u-outline-color, #79747e);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([selected][variant="outlined"]) {
|
|
121
|
+
border: none;
|
|
122
|
+
background-color: var(--u-outlined-icon-button-selected-background-color, var(--u-inverse-surface-color, #322f35));
|
|
123
|
+
color: var(--u-outlined-icon-button-selected-text-color, var(--u-inverse-on-surface-color, #f5eff7));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host([selected][variant="standard"]) {
|
|
127
|
+
color: var(--u-standard-icon-button-selected-text-color, var(--_primary-color));
|
|
128
|
+
}
|
|
129
|
+
`
|
|
130
|
+
];
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ reflect: true })
|
|
133
|
+
], IconButton.prototype, "variant", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ type: Boolean })
|
|
136
|
+
], IconButton.prototype, "toggle", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: Boolean, attribute: 'has-selection-icon', reflect: true })
|
|
139
|
+
], IconButton.prototype, "hasSelectionIcon", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
property({ type: Boolean, reflect: true })
|
|
142
|
+
], IconButton.prototype, "selected", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
property({ attribute: 'aria-label-selected' })
|
|
145
|
+
], IconButton.prototype, "ariaLabelSelected", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
queryAssignedElements({ slot: 'selected', flatten: true })
|
|
148
|
+
], IconButton.prototype, "selectedIcons", void 0);
|
|
149
|
+
IconButton = __decorate([
|
|
150
|
+
customElement('u-icon-button')
|
|
151
|
+
], IconButton);
|
|
152
|
+
export { IconButton };
|
|
153
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,GAAG,EAAa,IAAI,EAA8B,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAEjF,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGlC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QA+EsB,YAAO,GAAiD,UAAU,CAAC;QAE9F;;;WAGG;QACwB,WAAM,GAAG,KAAK,CAAC;QAEiC,qBAAgB,GAAG,KAAK,CAAC;QAEpG;;;;WAIG;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE3D;;WAEG;QAC2C,sBAAiB,GAAG,EAAE,CAAC;QAE5D,SAAI,GAAkC,QAAQ,CAAC;IA8B1D,CAAC;IAzBoB,aAAa;QAE9B,OAAO,IAAI,CAAA;;;6CAG8B,IAAI,CAAC,gBAAgB;;KAE7D,CAAC;IACJ,CAAC;IAEkB,WAAW,CAAC,CAAU;QACvC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACjC,CAAC;IACH,CAAC;IAEQ,YAAY;QACnB,OAAO,IAAI,CAAC,QAAQ;YAClB,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,KAAK,CAAC,YAAY,EAAE;YAChD,CAAC,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IAC3B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACxD,CAAC;;AAhIe,iBAAM,GAA4B;IACrC,UAAU,CAAC,MAAM;IAC5B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwEF;CACF,AA3EqB,CA2EpB;AAEyB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAoE;AAMnE;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAgB;AAEiC;IAA1E,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDAA0B;AAO1D;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AAKb;IAA7C,QAAQ,CAAC,EAAC,SAAS,EAAE,qBAAqB,EAAC,CAAC;qDAAwB;AAKpD;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACV;AAxGpC,UAAU;IADtB,aAAa,CAAC,eAAe,CAAC;GAClB,UAAU,CAmItB","sourcesContent":["import {css, CSSResult, html, HTMLTemplateResult, nothing} from 'lit';\nimport {customElement, property, queryAssignedElements} from 'lit/decorators.js';\n\nimport '../ripple/ripple';\nimport {ButtonBase} from './button-base';\n\n@customElement('u-icon-button')\nexport class IconButton extends ButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [\n <CSSResult>ButtonBase.styles,\n css`\n \n :host {\n --_surface-container-highest-color: var(--u-surface-container-highest-color, #e6e0e9);\n \n width: var(--u-icon-button-size, 2.5rem);\n height: var(--u-icon-button-size, 2.5rem);\n border-radius: var(--u-icon-button-shape, 9999px);\n font-family: var(--u-font-family-base, system-ui);\n \n }\n\n .icon {\n display: inline-block;\n width: var(--u-icon-button-icon-size, 1.5rem);\n height: var(--u-icon-button-icon-size, 1.5rem);\n font-size: var(--u-icon-button-icon-size, 1.5rem);\n line-height: var(--u-icon-button-icon-size, 1.5rem);\n }\n \n .icon.icon-selected {\n display: none;\n }\n \n :host([selected]) .icon:not(.icon-selected) {\n display: none;\n }\n \n :host([selected]) .icon.icon-selected {\n display: inline-block;\n }\n\n :host([variant=\"filled\"]) {\n background-color: var(--u-filled-icon-button-unselected-background-color, var(--_surface-container-highest-color));\n color: var(--u-filled-icon-button-unselected-text-color, var(--_primary-color));\n }\n\n :host([variant=\"tonal\"]) {\n background-color: var(--u-total-icon-button-unselected-background-color, var(--_surface-container-highest-color));\n color: var(--u-tonal-icon-button-unselected-text-color, var(--u-on-surface-variant-color, #49454f));\n }\n \n :host([selected][variant=\"filled\"]),\n :host([variant=\"filled\"]:not([has-selection-icon])) {\n background-color: var(--u-filled-icon-button-background-color, var(--_primary-color));\n color: var(--u-filled-icon-button-text-color, var(--u-on-primary-color, #fff));\n }\n \n :host([selected][variant=\"tonal\"]),\n :host([variant=\"tonal\"]:not([has-selection-icon])) {\n background-color: var(--u-tonal-icon-button-background-color, var(--u-secondary-container-color, #e8def8));\n color: var(--u-tonal-icon-button-text-color, var(--u-on-secondary-container-color, #1d192b));\n }\n\n :host([variant=\"standard\"]),\n :host([variant=\"outlined\"]) {\n color: var(--u-on-surface-variant-color, #49454f);\n }\n \n :host([variant=\"outlined\"]) {\n border: 1px solid var(--u-outline-color, #79747e);\n }\n\n :host([selected][variant=\"outlined\"]) {\n border: none;\n background-color: var(--u-outlined-icon-button-selected-background-color, var(--u-inverse-surface-color, #322f35));\n color: var(--u-outlined-icon-button-selected-text-color, var(--u-inverse-on-surface-color, #f5eff7));\n }\n\n :host([selected][variant=\"standard\"]) {\n color: var(--u-standard-icon-button-selected-text-color, var(--_primary-color));\n }\n `\n ];\n\n @property({reflect: true}) variant: 'standard' | 'filled' | 'tonal' | 'outlined' = 'standard';\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({type: Boolean}) toggle = false;\n\n @property({type: Boolean, attribute: 'has-selection-icon', reflect: true}) hasSelectionIcon = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';\n\n override type: 'submit' | 'button' | 'reset' = 'button';\n\n @queryAssignedElements({slot: 'selected', flatten: true})\n private readonly selectedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n\n return html`\n <span class=\"icon\" aria-hidden=\"true\"><slot></slot></span>\n <span class=\"icon icon-selected\" aria-hidden=\"true\">\n <slot name=\"selected\" @slotchange=\"${this.handleSlotChange}\"></slot>\n </span>\n `;\n }\n\n protected override handleClick(_: UIEvent): void {\n if (this.toggle) {\n this.selected = !this.selected;\n }\n }\n\n override getAriaLabel(): string | null | typeof nothing {\n return this.selected\n ? this.ariaLabelSelected || super.getAriaLabel()\n : super.getAriaLabel();\n }\n\n private handleSlotChange() {\n this.hasSelectionIcon = this.selectedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-icon-button': IconButton;\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export declare class ButtonSet extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
render(): HTMLTemplateResult;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'u-button-set': ButtonSet;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=button-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/card/button-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAY,MAAM,KAAK,CAAC;AAG9D,qBACa,SAAU,SAAQ,UAAU;IAEvC,OAAgB,MAAM,0BAOpB;IACO,MAAM,IAAI,kBAAkB;CAGtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,SAAS,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { customElement } from 'lit/decorators.js';
|
|
9
|
+
let ButtonSet = class ButtonSet extends LitElement {
|
|
10
|
+
render() {
|
|
11
|
+
return html `<slot></slot>`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
ButtonSet.styles = css `
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
ButtonSet = __decorate([
|
|
23
|
+
customElement('u-button-set')
|
|
24
|
+
], ButtonSet);
|
|
25
|
+
export { ButtonSet };
|
|
26
|
+
//# sourceMappingURL=button-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/card/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAqB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG3C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAU9B,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAVe,gBAAM,GAAG,GAAG,CAAA;;;;;;;GAO3B,AAPqB,CAOpB;AATS,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAarB","sourcesContent":["import {HTMLTemplateResult, LitElement, css, html} from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('u-button-set')\nexport class ButtonSet extends LitElement {\n\n static override styles = css`\n :host {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: wrap;\n }\n `;\n override render(): HTMLTemplateResult {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button-set': ButtonSet;\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export declare class CardContent extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
render(): HTMLTemplateResult;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'u-card-content': CardContent;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=card-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.d.ts","sourceRoot":"","sources":["../../src/card/card-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAY,MAAM,KAAK,CAAC;AAG9D,qBACa,WAAY,SAAQ,UAAU;IAEzC,OAAgB,MAAM,0BAKpB;IAEO,MAAM,IAAI,kBAAkB;CAGtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,WAAW,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { customElement } from 'lit/decorators.js';
|
|
9
|
+
let CardContent = class CardContent extends LitElement {
|
|
10
|
+
render() {
|
|
11
|
+
return html `<slot></slot>`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
CardContent.styles = css `
|
|
15
|
+
:host {
|
|
16
|
+
display: block;
|
|
17
|
+
padding: var(--u-card-padding, 16px);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
CardContent = __decorate([
|
|
21
|
+
customElement('u-card-content')
|
|
22
|
+
], CardContent);
|
|
23
|
+
export { CardContent };
|
|
24
|
+
//# sourceMappingURL=card-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.js","sourceRoot":"","sources":["../../src/card/card-content.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAqB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG3C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAShC,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AATe,kBAAM,GAAG,GAAG,CAAA;;;;;GAK3B,AALqB,CAKpB;AAPS,WAAW;IADvB,aAAa,CAAC,gBAAgB,CAAC;GACnB,WAAW,CAYvB","sourcesContent":["import {HTMLTemplateResult, LitElement, css, html} from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('u-card-content')\nexport class CardContent extends LitElement {\n\n static override styles = css`\n :host {\n display: block;\n padding: var(--u-card-padding, 16px);\n }\n `;\n\n override render(): HTMLTemplateResult {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-card-content': CardContent;\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export declare class CardMedia extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
wide: boolean;
|
|
5
|
+
render(): HTMLTemplateResult;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'u-card-media': CardMedia;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=card-media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.d.ts","sourceRoot":"","sources":["../../src/card/card-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAY,MAAM,KAAK,CAAC;AAG9D,qBACa,SAAU,SAAQ,UAAU;IAEvC,OAAgB,MAAM,0BAUpB;IAEwC,IAAI,UAAS;IAE9C,MAAM,IAAI,kBAAkB;CAItC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,SAAS,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
let CardMedia = class CardMedia extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.wide = false;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return html `
|
|
16
|
+
<slot></slot>`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
CardMedia.styles = css `
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
aspect-ratio: 1;
|
|
23
|
+
border-radius: var(--u-card-shape, var(--u-shape-corner-medium, 12px));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([wide]) {
|
|
27
|
+
aspect-ratio: 16/9;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Boolean, reflect: true })
|
|
32
|
+
], CardMedia.prototype, "wide", void 0);
|
|
33
|
+
CardMedia = __decorate([
|
|
34
|
+
customElement('u-card-media')
|
|
35
|
+
], CardMedia);
|
|
36
|
+
export { CardMedia };
|
|
37
|
+
//# sourceMappingURL=card-media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.js","sourceRoot":"","sources":["../../src/card/card-media.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAqB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAGnD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAcqC,SAAI,GAAG,KAAK,CAAC;IAMzD,CAAC;IAJU,MAAM;QACb,OAAO,IAAI,CAAA;oBACK,CAAC;IACnB,CAAC;;AAjBe,gBAAM,GAAG,GAAG,CAAA;;;;;;;;;;GAU3B,AAVqB,CAUpB;AAEwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAc;AAd5C,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAoBrB","sourcesContent":["import {HTMLTemplateResult, LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\n@customElement('u-card-media')\nexport class CardMedia extends LitElement {\n\n static override styles = css`\n :host {\n display: block;\n aspect-ratio: 1;\n border-radius: var(--u-card-shape, var(--u-shape-corner-medium, 12px));\n }\n\n :host([wide]) {\n aspect-ratio: 16/9;\n }\n `;\n\n @property({type: Boolean, reflect: true}) wide = false;\n\n override render(): HTMLTemplateResult {\n return html`\n <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-card-media': CardMedia;\n }\n}\n"]}
|
package/card/card.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
import './card-content';
|
|
3
|
+
import './card-media';
|
|
4
|
+
import '../elevation/elevation';
|
|
5
|
+
export declare class Card extends LitElement {
|
|
6
|
+
static styles: import("lit").CSSResult;
|
|
7
|
+
variant: 'filled' | 'elevated' | 'outlined';
|
|
8
|
+
render(): HTMLTemplateResult;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'u-card': Card;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/card/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAY,MAAM,KAAK,CAAC;AAG9D,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,wBAAwB,CAAC;AAEhC,qBACa,IAAK,SAAQ,UAAU;IAElC,OAAgB,MAAM,0BAuBpB;IAEyB,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAc;IAE3E,MAAM,IAAI,kBAAkB;CAGtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,IAAI,CAAC;KAChB;CACF"}
|
package/card/card.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import './card-content';
|
|
10
|
+
import './card-media';
|
|
11
|
+
import '../elevation/elevation';
|
|
12
|
+
let Card = class Card extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.variant = 'elevated';
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return html `<u-elevation></u-elevation><slot></slot>`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
Card.styles = css `
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
position: relative;
|
|
25
|
+
border-radius: var(--u-card-shape, var(--u-shape-corner-medium, 12px));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host(:not(:first-child)) {
|
|
29
|
+
margin-top: 8px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([variant=elevated]) {
|
|
33
|
+
background-color: var(--u-surface-container-low-color);
|
|
34
|
+
--u-elevation-level: var(--u-elevated-card-elevation-level, 1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([variant=filled]) {
|
|
38
|
+
background-color: var(--u-surface-container-highest-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([variant=outlined]) {
|
|
42
|
+
border: var(--u-outlined-card-outline-width, 1px) solid var(--u-outlined-card-outline-color, var(--u-outline-variant-color, #cac4d0));
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ reflect: true })
|
|
47
|
+
], Card.prototype, "variant", void 0);
|
|
48
|
+
Card = __decorate([
|
|
49
|
+
customElement('u-card')
|
|
50
|
+
], Card);
|
|
51
|
+
export { Card };
|
|
52
|
+
//# sourceMappingURL=card.js.map
|
package/card/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/card/card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAqB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,wBAAwB,CAAC;AAGzB,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,UAAU;IAA7B;;QA2BsB,YAAO,GAAuC,UAAU,CAAC;IAKtF,CAAC;IAHU,MAAM;QACb,OAAO,IAAI,CAAA,0CAA0C,CAAC;IACxD,CAAC;;AA7Be,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;GAuB3B,AAvBqB,CAuBpB;AAEyB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;qCAA0D;AA3BzE,IAAI;IADhB,aAAa,CAAC,QAAQ,CAAC;GACX,IAAI,CAgChB","sourcesContent":["import {HTMLTemplateResult, LitElement, css, html} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport './card-content';\nimport './card-media';\nimport '../elevation/elevation';\n\n@customElement('u-card')\nexport class Card extends LitElement {\n\n static override styles = css`\n :host {\n display: block;\n position: relative;\n border-radius: var(--u-card-shape, var(--u-shape-corner-medium, 12px));\n }\n\n :host(:not(:first-child)) {\n margin-top: 8px;\n }\n \n :host([variant=elevated]) {\n background-color: var(--u-surface-container-low-color);\n --u-elevation-level: var(--u-elevated-card-elevation-level, 1);\n }\n \n :host([variant=filled]) {\n background-color: var(--u-surface-container-highest-color);\n }\n \n :host([variant=outlined]) {\n border: var(--u-outlined-card-outline-width, 1px) solid var(--u-outlined-card-outline-color, var(--u-outline-variant-color, #cac4d0));\n }\n `;\n\n @property({reflect: true}) variant: 'filled' | 'elevated' | 'outlined' = 'elevated';\n\n override render(): HTMLTemplateResult {\n return html`<u-elevation></u-elevation><slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-card': Card;\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class Divider extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
noMargin: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'u-divider': Divider;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/divider/divider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,UAAU,EAAC,MAAM,KAAK,CAAC;AAGpC,qBACa,OAAQ,SAAQ,UAAU;IAErC,OAAgB,MAAM,0BAYpB;IAEgE,QAAQ,UAAS;CACpF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,OAAO,CAAC;KACtB;CACF"}
|