@universal-material/web 3.0.0 → 3.0.2
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/README.md +28 -0
- package/button/button-base.d.ts +15 -9
- package/button/button-base.d.ts.map +1 -1
- package/button/button-base.js +46 -93
- package/button/button-base.js.map +1 -1
- package/button/button-base.styles.d.ts +2 -0
- package/button/button-base.styles.d.ts.map +1 -0
- package/button/button-base.styles.js +75 -0
- package/button/button-base.styles.js.map +1 -0
- package/button/button-set.d.ts +10 -2
- package/button/button-set.d.ts.map +1 -1
- package/button/button-set.js +27 -16
- package/button/button-set.js.map +1 -1
- package/button/button-set.styles.d.ts +2 -0
- package/button/button-set.styles.d.ts.map +1 -0
- package/button/button-set.styles.js +39 -0
- package/button/button-set.styles.js.map +1 -0
- package/button/button.d.ts +18 -4
- package/button/button.d.ts.map +1 -1
- package/button/button.js +29 -102
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts +2 -0
- package/button/button.styles.d.ts.map +1 -0
- package/button/button.styles.js +96 -0
- package/button/button.styles.js.map +1 -0
- package/button/fab.d.ts +14 -2
- package/button/fab.d.ts.map +1 -1
- package/button/fab.js +25 -106
- package/button/fab.js.map +1 -1
- package/button/fab.styles.d.ts +2 -0
- package/button/fab.styles.d.ts.map +1 -0
- package/button/fab.styles.js +89 -0
- package/button/fab.styles.js.map +1 -0
- package/button/icon-button.d.ts +3 -4
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +15 -89
- package/button/icon-button.js.map +1 -1
- package/button/icon-button.styles.d.ts +2 -0
- package/button/icon-button.styles.d.ts.map +1 -0
- package/button/icon-button.styles.js +70 -0
- package/button/icon-button.styles.js.map +1 -0
- package/card/card-content.d.ts +5 -3
- package/card/card-content.d.ts.map +1 -1
- package/card/card-content.js +33 -13
- package/card/card-content.js.map +1 -1
- package/card/card-content.styles.d.ts +2 -0
- package/card/card-content.styles.d.ts.map +1 -0
- package/card/card-content.styles.js +15 -0
- package/card/card-content.styles.js.map +1 -0
- package/card/card-media.d.ts +3 -3
- package/card/card-media.d.ts.map +1 -1
- package/card/card-media.js +9 -17
- package/card/card-media.js.map +1 -1
- package/card/card-media.styles.d.ts +2 -0
- package/card/card-media.styles.d.ts.map +1 -0
- package/card/card-media.styles.js +13 -0
- package/card/card-media.styles.js.map +1 -0
- package/card/card.d.ts +9 -6
- package/card/card.d.ts.map +1 -1
- package/card/card.js +22 -34
- package/card/card.js.map +1 -1
- package/card/card.styles.d.ts +2 -0
- package/card/card.styles.d.ts.map +1 -0
- package/card/card.styles.js +26 -0
- package/card/card.styles.js.map +1 -0
- package/checkbox/checkbox.d.ts +16 -0
- package/checkbox/checkbox.d.ts.map +1 -0
- package/checkbox/checkbox.js +75 -0
- package/checkbox/checkbox.js.map +1 -0
- package/container/container.d.ts +14 -0
- package/container/container.d.ts.map +1 -0
- package/container/container.js +23 -0
- package/container/container.js.map +1 -0
- package/container/container.styles.d.ts +2 -0
- package/container/container.styles.d.ts.map +1 -0
- package/container/container.styles.js +43 -0
- package/container/container.styles.js.map +1 -0
- package/custom-elements.json +3706 -0
- package/divider/divider.d.ts +5 -2
- package/divider/divider.d.ts.map +1 -1
- package/divider/divider.js +11 -19
- package/divider/divider.js.map +1 -1
- package/divider/divider.styles.d.ts +2 -0
- package/divider/divider.styles.d.ts.map +1 -0
- package/divider/divider.styles.js +15 -0
- package/divider/divider.styles.js.map +1 -0
- package/elevation/elevation.d.ts +4 -3
- package/elevation/elevation.d.ts.map +1 -1
- package/elevation/elevation.js +11 -37
- package/elevation/elevation.js.map +1 -1
- package/elevation/elevation.styles.d.ts +2 -0
- package/elevation/elevation.styles.d.ts.map +1 -0
- package/elevation/elevation.styles.js +28 -0
- package/elevation/elevation.styles.js.map +1 -0
- package/index.d.ts +24 -0
- package/index.d.ts.map +1 -0
- package/index.js +24 -0
- package/index.js.map +1 -0
- package/package.json +35 -26
- package/ripple/ripple.d.ts +11 -5
- package/ripple/ripple.d.ts.map +1 -1
- package/ripple/ripple.js +66 -120
- package/ripple/ripple.js.map +1 -1
- package/ripple/ripple.styles.d.ts +2 -0
- package/ripple/ripple.styles.d.ts.map +1 -0
- package/ripple/ripple.styles.js +74 -0
- package/ripple/ripple.styles.js.map +1 -0
- package/shared/base.styles.d.ts +2 -0
- package/shared/base.styles.d.ts.map +1 -0
- package/shared/base.styles.js +9 -0
- package/shared/base.styles.js.map +1 -0
- package/table/table-body.d.ts +11 -0
- package/table/table-body.d.ts.map +1 -0
- package/table/table-body.js +21 -0
- package/table/table-body.js.map +1 -0
- package/table/table-body.styles.d.ts +2 -0
- package/table/table-body.styles.d.ts.map +1 -0
- package/table/table-body.styles.js +11 -0
- package/table/table-body.styles.js.map +1 -0
- package/table/table-cell.d.ts +11 -0
- package/table/table-cell.d.ts.map +1 -0
- package/table/table-cell.js +21 -0
- package/table/table-cell.js.map +1 -0
- package/table/table-cell.styles.d.ts +2 -0
- package/table/table-cell.styles.d.ts.map +1 -0
- package/table/table-cell.styles.js +11 -0
- package/table/table-cell.styles.js.map +1 -0
- package/table/table-head.d.ts +11 -0
- package/table/table-head.d.ts.map +1 -0
- package/table/table-head.js +21 -0
- package/table/table-head.js.map +1 -0
- package/table/table-head.styles.d.ts +2 -0
- package/table/table-head.styles.d.ts.map +1 -0
- package/table/table-head.styles.js +11 -0
- package/table/table-head.styles.js.map +1 -0
- package/table/table-header-cell.d.ts +11 -0
- package/table/table-header-cell.d.ts.map +1 -0
- package/table/table-header-cell.js +21 -0
- package/table/table-header-cell.js.map +1 -0
- package/table/table-header-cell.styles.d.ts +2 -0
- package/table/table-header-cell.styles.d.ts.map +1 -0
- package/table/table-header-cell.styles.js +12 -0
- package/table/table-header-cell.styles.js.map +1 -0
- package/table/table-row.d.ts +11 -0
- package/table/table-row.d.ts.map +1 -0
- package/{card/button-set.js → table/table-row.js} +10 -15
- package/table/table-row.js.map +1 -0
- package/table/table-row.styles.d.ts +2 -0
- package/table/table-row.styles.d.ts.map +1 -0
- package/table/table-row.styles.js +7 -0
- package/table/table-row.styles.js.map +1 -0
- package/table/table.d.ts +16 -0
- package/table/table.d.ts.map +1 -0
- package/table/table.js +19 -0
- package/table/table.js.map +1 -0
- package/table/table.styles.d.ts +2 -0
- package/table/table.styles.d.ts.map +1 -0
- package/table/table.styles.js +16 -0
- package/table/table.styles.js.map +1 -0
- package/theme/color.d.ts +7 -0
- package/theme/color.d.ts.map +1 -0
- package/theme/color.js +2 -0
- package/theme/color.js.map +1 -0
- package/theme/css-var-builder.d.ts +9 -0
- package/theme/css-var-builder.d.ts.map +1 -0
- package/theme/css-var-builder.js +25 -0
- package/theme/css-var-builder.js.map +1 -0
- package/theme/index.d.ts +2 -0
- package/theme/index.d.ts.map +1 -0
- package/theme/index.js +2 -0
- package/theme/index.js.map +1 -0
- package/theme/neutral-colors.d.ts +4 -0
- package/theme/neutral-colors.d.ts.map +1 -0
- package/theme/neutral-colors.js +19 -0
- package/theme/neutral-colors.js.map +1 -0
- package/theme/rgb-color.d.ts +9 -0
- package/theme/rgb-color.d.ts.map +1 -0
- package/theme/rgb-color.js +13 -0
- package/theme/rgb-color.js.map +1 -0
- package/theme/theme-builder.d.ts +27 -0
- package/theme/theme-builder.d.ts.map +1 -0
- package/theme/theme-builder.js +146 -0
- package/theme/theme-builder.js.map +1 -0
- package/theme/theme-color.d.ts +6 -0
- package/theme/theme-color.d.ts.map +1 -0
- package/theme/theme-color.js +2 -0
- package/theme/theme-color.js.map +1 -0
- package/all.d.ts +0 -9
- package/all.d.ts.map +0 -1
- package/all.js +0 -9
- package/all.js.map +0 -1
- package/card/button-set.d.ts +0 -11
- package/card/button-set.d.ts.map +0 -1
- package/card/button-set.js.map +0 -1
- package/shared/area-hidden-element.d.ts +0 -5
- package/shared/area-hidden-element.d.ts.map +0 -1
- package/shared/area-hidden-element.js +0 -10
- package/shared/area-hidden-element.js.map +0 -1
package/button/button.js
CHANGED
|
@@ -4,22 +4,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
8
|
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
-
import '../ripple/ripple';
|
|
10
9
|
import { ButtonBase } from './button-base';
|
|
11
|
-
|
|
10
|
+
import { styles as buttonBaseStyles } from './button-base.styles';
|
|
11
|
+
import { styles } from './button.styles';
|
|
12
|
+
import '../ripple/ripple.js';
|
|
13
|
+
let UmButton = class UmButton extends ButtonBase {
|
|
12
14
|
constructor() {
|
|
13
15
|
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* The Button variant to render
|
|
18
|
+
*/
|
|
14
19
|
this.variant = 'filled';
|
|
15
20
|
this.trailingIcon = false;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the button has icon or not
|
|
23
|
+
*
|
|
24
|
+
* _Note:_ Readonly
|
|
25
|
+
*/
|
|
16
26
|
this.hasIcon = false;
|
|
17
27
|
}
|
|
18
28
|
renderContent() {
|
|
19
|
-
const icon = html
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const icon = html `
|
|
30
|
+
<slot
|
|
31
|
+
name="icon"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
@slotchange="${this.handleSlotChange}"></slot>`;
|
|
23
34
|
return html `
|
|
24
35
|
${this.trailingIcon ? nothing : icon}
|
|
25
36
|
<span><slot></slot></span>
|
|
@@ -30,108 +41,24 @@ let Button = class Button extends ButtonBase {
|
|
|
30
41
|
this.hasIcon = this.assignedIcons.length > 0;
|
|
31
42
|
}
|
|
32
43
|
};
|
|
33
|
-
|
|
34
|
-
ButtonBase.styles,
|
|
35
|
-
css `
|
|
36
|
-
|
|
37
|
-
:host {
|
|
38
|
-
--u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);
|
|
39
|
-
--u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);
|
|
40
|
-
--u-common-button-font-weight: var(--u-font-weight-medium, 500);
|
|
41
|
-
--_common-button-height: var(--u-common-button-height, 2.5rem);
|
|
42
|
-
--_common-button-padding: var(--u-common-button-padding, 24px);
|
|
43
|
-
--_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);
|
|
44
|
-
|
|
45
|
-
border-radius: var(--u-common-button-shape, 9999px);
|
|
46
|
-
font-family: var(--u-font-family-base, system-ui);
|
|
47
|
-
height: var(--u-common-button-height, 40px);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host([variant="filled"]) {
|
|
51
|
-
background-color: var(--u-filled-button-background-color, var(--_primary-color));
|
|
52
|
-
color: var(--u-filled-button-text-color, var(--u-on-primary-color, #fff));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
:host([variant="tonal"]) {
|
|
56
|
-
background-color: var(--u-tonal-button-background-color, var(--u-secondary-container-color, #e8def8));
|
|
57
|
-
color: var(--u-tonal-button-text-color, var(--u-on-secondary-container-color, #1d192b));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:host([variant="elevated"]) {
|
|
61
|
-
background-color: var(--u-elevated-button-background-color, var(--u-surface-container-low-color, #f7f2fa));
|
|
62
|
-
color: var(--u-tonal-button-text-color, var(--u-on-secondary-container-color, #1d192b));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@media (hover: hover) {
|
|
66
|
-
:host([variant="filled"]:hover:not(:focus-within):not(:active)),
|
|
67
|
-
:host([variant="tonal"]:hover:not(:focus-within):not(:active)) {
|
|
68
|
-
--u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:host([variant="outlined"]),
|
|
73
|
-
:host([variant="text"]),
|
|
74
|
-
:host([variant="elevated"]) {
|
|
75
|
-
color: var(--_primary-color);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:host([variant="outlined"]) {
|
|
79
|
-
border: 1px solid var(--u-outline-color, #79747e);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host([variant="elevated"]) {
|
|
83
|
-
--u-elevation-level: var(--u-elevated-button-elevation-level, 1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (hover: hover) {
|
|
87
|
-
:host([variant="elevated"]:hover) {
|
|
88
|
-
--u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.button {
|
|
93
|
-
font-size: var(--u-common-button-font-size);
|
|
94
|
-
font-weight: var(--u-common-button-font-weight);
|
|
95
|
-
padding-inline: var(--_common-button-padding);
|
|
96
|
-
box-sizing: border-box;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host([has-icon]) .button {
|
|
100
|
-
padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
:host([has-icon][trailing-icon]) .button {
|
|
104
|
-
padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
::slotted([slot=icon]) {
|
|
108
|
-
display: inline-block;
|
|
109
|
-
width: var(--u-common-button-icon-size, 1.125rem);
|
|
110
|
-
height: var(--u-common-button-icon-size, 1.125rem);
|
|
111
|
-
margin-inline-end: 8px;
|
|
112
|
-
font-size: var(--u-common-button-icon-size, 1.125rem);
|
|
113
|
-
line-height: var(--u-common-button-icon-size, 1.125rem);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:host([trailing-icon]) ::slotted([slot=icon]) {
|
|
117
|
-
margin-inline: 8px 0;
|
|
118
|
-
}
|
|
119
|
-
`
|
|
120
|
-
];
|
|
44
|
+
UmButton.styles = [buttonBaseStyles, styles];
|
|
121
45
|
__decorate([
|
|
122
46
|
property({ reflect: true })
|
|
123
|
-
],
|
|
47
|
+
], UmButton.prototype, "variant", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
property({ reflect: true })
|
|
50
|
+
], UmButton.prototype, "color", void 0);
|
|
124
51
|
__decorate([
|
|
125
52
|
property({ type: Boolean, attribute: 'trailing-icon', reflect: true })
|
|
126
|
-
],
|
|
53
|
+
], UmButton.prototype, "trailingIcon", void 0);
|
|
127
54
|
__decorate([
|
|
128
55
|
property({ type: Boolean, attribute: 'has-icon', reflect: true })
|
|
129
|
-
],
|
|
56
|
+
], UmButton.prototype, "hasIcon", void 0);
|
|
130
57
|
__decorate([
|
|
131
58
|
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
132
|
-
],
|
|
133
|
-
|
|
59
|
+
], UmButton.prototype, "assignedIcons", void 0);
|
|
60
|
+
UmButton = __decorate([
|
|
134
61
|
customElement('u-button')
|
|
135
|
-
],
|
|
136
|
-
export {
|
|
62
|
+
], UmButton);
|
|
63
|
+
export { UmButton };
|
|
137
64
|
//# sourceMappingURL=button.js.map
|
package/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,qBAAqB,CAAC;AAGtB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAIL;;WAEG;QACwB,YAAO,GAA0D,QAAQ,CAAC;QAS/B,iBAAY,GAAG,KAAK,CAAC;QAE3F;;;;WAIG;QAC8D,YAAO,GAAG,KAAK,CAAC;IAsBnF,CAAC;IAjBoB,aAAa;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAA;;;;uBAIE,IAAI,CAAC,gBAAgB,WAAW,CAAC;QAEpD,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;;QAElC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;KACrC,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,CAAC;;AA1Ce,eAAM,GAA4B,CAAC,gBAAgB,EAAE,MAAM,CAAC,AAAtD,CAAuD;AAKlD;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAA2E;AAO1E;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAmE;AAEvB;IAArE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAsB;AAO1B;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAiB;AAGhE;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;+CACN;AA1BpC,QAAQ;IADpB,aAAa,CAAC,UAAU,CAAC;GACb,QAAQ,CA6CpB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { ButtonBase } from './button-base';\nimport { styles as buttonBaseStyles } from './button-base.styles';\nimport { styles } from './button.styles';\nimport '../ripple/ripple.js';\n\n@customElement('u-button')\nexport class UmButton extends ButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];\n\n /**\n * The Button variant to render\n */\n @property({reflect: true}) variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text' = 'filled';\n\n /**\n * The Button color\n *\n * _Note:_ Filled buttons only\n */\n @property({reflect: true}) color: 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;\n\n @property({type: Boolean, attribute: 'trailing-icon', reflect: true}) trailingIcon = false;\n\n /**\n * Whether the button has icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon = false;\n\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly assignedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n const icon = html`\n <slot\n name=\"icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.handleSlotChange}\"></slot>`;\n\n return html`\n ${this.trailingIcon ? nothing : icon}\n <span><slot></slot></span>\n ${this.trailingIcon ? icon : nothing}\n `;\n }\n\n private handleSlotChange() {\n this.hasIcon = this.assignedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button': UmButton;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA6FlB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);
|
|
5
|
+
--u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);
|
|
6
|
+
--u-common-button-font-weight: var(--u-font-weight-medium, 500);
|
|
7
|
+
--_common-button-height: var(--u-common-button-height, 2.5rem);
|
|
8
|
+
--_common-button-padding: var(--u-common-button-padding, 24px);
|
|
9
|
+
--_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);
|
|
10
|
+
border-radius: var(--u-common-button-shape-corner, var(--u-shape-corner-full, 9999px));
|
|
11
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
12
|
+
height: var(--u-common-button-height, 40px);
|
|
13
|
+
font-size: var(--u-common-button-font-size);
|
|
14
|
+
font-weight: var(--u-common-button-font-weight);
|
|
15
|
+
padding-inline: var(--_common-button-padding);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([variant=filled]),
|
|
20
|
+
:host([variant=filled][color=primary]) {
|
|
21
|
+
background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));
|
|
22
|
+
color: var(--u-filled-button-primary-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([variant=filled][color=secondary]) {
|
|
26
|
+
background-color: var(--u-filled-button-secondary-container-color, var(--u-color-secondary, rgb(98, 91, 113)));
|
|
27
|
+
color: var(--u-filled-button-secondary-text-color, var(--u-color-on-secondary, rgb(255, 255, 255)));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([variant=filled][color=tertiary]) {
|
|
31
|
+
background-color: var(--u-filled-button-tertiary-container-color, var(--u-color-tertiary, rgb(125, 82, 96)));
|
|
32
|
+
color: var(--u-filled-button-tertiary-text-color, var(--u-color-on-tertiary, rgb(255, 255, 255)));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([variant=filled][color=error]) {
|
|
36
|
+
background-color: var(--u-filled-button-error-container-color, var(--u-color-error, rgb(179, 38, 30)));
|
|
37
|
+
color: var(--u-filled-button-error-text-color, var(--u-color-on-error, rgb(255, 255, 255)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([variant=tonal]) {
|
|
41
|
+
background-color: var(--u-tonal-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
42
|
+
color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([variant=elevated]) {
|
|
46
|
+
background-color: var(--u-elevated-button-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));
|
|
47
|
+
color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (hover: hover) {
|
|
51
|
+
:host([variant=filled]:hover:not(:focus-within):not(:active)),
|
|
52
|
+
:host([variant=tonal]:hover:not(:focus-within):not(:active)) {
|
|
53
|
+
--u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
:host([variant=outlined]),
|
|
57
|
+
:host([variant=text]),
|
|
58
|
+
:host([variant=elevated]) {
|
|
59
|
+
color: var(--_color-primary);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([variant=outlined]) {
|
|
63
|
+
border: 1px solid var(--u-color-outline-color, );
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([variant=elevated]) {
|
|
67
|
+
--u-elevation-level: var(--u-elevated-button-elevation-level, 1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (hover: hover) {
|
|
71
|
+
:host([variant=elevated]:hover) {
|
|
72
|
+
--u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
:host([has-icon]) {
|
|
76
|
+
padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([has-icon][trailing-icon]) {
|
|
80
|
+
padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
::slotted([slot=icon]) {
|
|
84
|
+
display: inline-block;
|
|
85
|
+
width: var(--u-common-button-icon-size, 1.125rem);
|
|
86
|
+
height: var(--u-common-button-icon-size, 1.125rem);
|
|
87
|
+
margin-inline-end: 8px;
|
|
88
|
+
font-size: var(--u-common-button-icon-size, 1.125rem);
|
|
89
|
+
line-height: var(--u-common-button-icon-size, 1.125rem);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([trailing-icon]) ::slotted([slot=icon]) {
|
|
93
|
+
margin-inline: 8px 0;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
//# sourceMappingURL=button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);\n --u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);\n --u-common-button-font-weight: var(--u-font-weight-medium, 500);\n --_common-button-height: var(--u-common-button-height, 2.5rem);\n --_common-button-padding: var(--u-common-button-padding, 24px);\n --_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);\n border-radius: var(--u-common-button-shape-corner, var(--u-shape-corner-full, 9999px));\n font-family: var(--u-font-family-base, system-ui);\n height: var(--u-common-button-height, 40px);\n font-size: var(--u-common-button-font-size);\n font-weight: var(--u-common-button-font-weight);\n padding-inline: var(--_common-button-padding);\n box-sizing: border-box;\n }\n\n :host([variant=filled]),\n :host([variant=filled][color=primary]) {\n background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));\n color: var(--u-filled-button-primary-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=secondary]) {\n background-color: var(--u-filled-button-secondary-container-color, var(--u-color-secondary, rgb(98, 91, 113)));\n color: var(--u-filled-button-secondary-text-color, var(--u-color-on-secondary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=tertiary]) {\n background-color: var(--u-filled-button-tertiary-container-color, var(--u-color-tertiary, rgb(125, 82, 96)));\n color: var(--u-filled-button-tertiary-text-color, var(--u-color-on-tertiary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=error]) {\n background-color: var(--u-filled-button-error-container-color, var(--u-color-error, rgb(179, 38, 30)));\n color: var(--u-filled-button-error-text-color, var(--u-color-on-error, rgb(255, 255, 255)));\n }\n\n :host([variant=tonal]) {\n background-color: var(--u-tonal-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host([variant=elevated]) {\n background-color: var(--u-elevated-button-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));\n color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n @media (hover: hover) {\n :host([variant=filled]:hover:not(:focus-within):not(:active)),\n :host([variant=tonal]:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);\n }\n }\n :host([variant=outlined]),\n :host([variant=text]),\n :host([variant=elevated]) {\n color: var(--_color-primary);\n }\n\n :host([variant=outlined]) {\n border: 1px solid var(--u-color-outline-color, );\n }\n\n :host([variant=elevated]) {\n --u-elevation-level: var(--u-elevated-button-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host([variant=elevated]:hover) {\n --u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);\n }\n }\n :host([has-icon]) {\n padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);\n }\n\n :host([has-icon][trailing-icon]) {\n padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);\n }\n\n ::slotted([slot=icon]) {\n display: inline-block;\n width: var(--u-common-button-icon-size, 1.125rem);\n height: var(--u-common-button-icon-size, 1.125rem);\n margin-inline-end: 8px;\n font-size: var(--u-common-button-icon-size, 1.125rem);\n line-height: var(--u-common-button-icon-size, 1.125rem);\n }\n\n :host([trailing-icon]) ::slotted([slot=icon]) {\n margin-inline: 8px 0;\n }\n`;\n"]}
|
package/button/fab.d.ts
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { CSSResult, HTMLTemplateResult } from 'lit';
|
|
2
2
|
import { ButtonBase } from './button-base';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class UmFabButton extends ButtonBase {
|
|
4
4
|
static styles: CSSResult | CSSResult[];
|
|
5
|
+
/**
|
|
6
|
+
* The FAB color variant to render.
|
|
7
|
+
*/
|
|
5
8
|
color: 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';
|
|
9
|
+
/**
|
|
10
|
+
* The size of the FAB.
|
|
11
|
+
*/
|
|
6
12
|
size: 'small' | 'medium' | 'large';
|
|
13
|
+
/**
|
|
14
|
+
* The text to display the FAB.
|
|
15
|
+
*/
|
|
7
16
|
label: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Lowers the FAB's elevation.
|
|
19
|
+
*/
|
|
8
20
|
lowered: boolean;
|
|
9
21
|
get extended(): boolean;
|
|
10
22
|
protected renderContent(): HTMLTemplateResult;
|
|
11
23
|
}
|
|
12
24
|
declare global {
|
|
13
25
|
interface HTMLElementTagNameMap {
|
|
14
|
-
'u-fab':
|
|
26
|
+
'u-fab': UmFabButton;
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
29
|
//# sourceMappingURL=fab.d.ts.map
|
package/button/fab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fab.d.ts","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fab.d.ts","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,qBACa,WAAY,SAAQ,UAAU;IAEzC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAA8B;IAE7E;;OAEG;IACwB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAa;IAE3G;;OAEG;IACwB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAEzE;;OAEG;IACwB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvD;;OAEG;IACuC,OAAO,UAAS;IAE1D,IACI,QAAQ,IAAI,OAAO,CAEtB;cAEkB,aAAa,IAAI,kBAAkB;CAQvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,OAAO,EAAE,WAAW,CAAC;KACtB;CACF"}
|
package/button/fab.js
CHANGED
|
@@ -4,15 +4,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
9
|
import { ButtonBase } from './button-base';
|
|
10
|
-
|
|
10
|
+
import { styles as buttonBaseStyles } from './button-base.styles';
|
|
11
|
+
import { styles } from './fab.styles';
|
|
12
|
+
let UmFabButton = class UmFabButton extends ButtonBase {
|
|
11
13
|
constructor() {
|
|
12
14
|
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* The FAB color variant to render.
|
|
17
|
+
*/
|
|
13
18
|
this.color = 'primary';
|
|
19
|
+
/**
|
|
20
|
+
* The size of the FAB.
|
|
21
|
+
*/
|
|
14
22
|
this.size = 'medium';
|
|
23
|
+
/**
|
|
24
|
+
* The text to display the FAB.
|
|
25
|
+
*/
|
|
15
26
|
this.label = null;
|
|
27
|
+
/**
|
|
28
|
+
* Lowers the FAB's elevation.
|
|
29
|
+
*/
|
|
16
30
|
this.lowered = false;
|
|
17
31
|
}
|
|
18
32
|
get extended() {
|
|
@@ -26,119 +40,24 @@ let FabButton = class FabButton extends ButtonBase {
|
|
|
26
40
|
`;
|
|
27
41
|
}
|
|
28
42
|
};
|
|
29
|
-
|
|
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
|
-
];
|
|
43
|
+
UmFabButton.styles = [buttonBaseStyles, styles];
|
|
125
44
|
__decorate([
|
|
126
45
|
property({ reflect: true })
|
|
127
|
-
],
|
|
46
|
+
], UmFabButton.prototype, "color", void 0);
|
|
128
47
|
__decorate([
|
|
129
48
|
property({ reflect: true })
|
|
130
|
-
],
|
|
49
|
+
], UmFabButton.prototype, "size", void 0);
|
|
131
50
|
__decorate([
|
|
132
51
|
property({ reflect: true })
|
|
133
|
-
],
|
|
52
|
+
], UmFabButton.prototype, "label", void 0);
|
|
134
53
|
__decorate([
|
|
135
54
|
property({ type: Boolean, reflect: true })
|
|
136
|
-
],
|
|
55
|
+
], UmFabButton.prototype, "lowered", void 0);
|
|
137
56
|
__decorate([
|
|
138
57
|
property({ type: Boolean, reflect: true })
|
|
139
|
-
],
|
|
140
|
-
|
|
58
|
+
], UmFabButton.prototype, "extended", null);
|
|
59
|
+
UmFabButton = __decorate([
|
|
141
60
|
customElement('u-fab')
|
|
142
|
-
],
|
|
143
|
-
export {
|
|
61
|
+
], UmFabButton);
|
|
62
|
+
export { UmFabButton };
|
|
144
63
|
//# sourceMappingURL=fab.js.map
|
package/button/fab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fab.js","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fab.js","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG/B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAIL;;WAEG;QACwB,UAAK,GAAiE,SAAS,CAAC;QAE3G;;WAEG;QACwB,SAAI,GAAiC,QAAQ,CAAC;QAEzE;;WAEG;QACwB,UAAK,GAAkB,IAAI,CAAC;QAEvD;;WAEG;QACuC,YAAO,GAAG,KAAK,CAAC;IAe5D,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;;AAlCe,kBAAM,GAA4B,CAAC,gBAAgB,EAAE,MAAM,CAAC,AAAtD,CAAuD;AAKlD;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAiF;AAKhF;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAA+C;AAK9C;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;0CAA6B;AAKb;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAiB;AAG1D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAGxC;AA3BU,WAAW;IADvB,aAAa,CAAC,OAAO,CAAC;GACV,WAAW,CAqCvB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { ButtonBase } from './button-base';\nimport { styles as buttonBaseStyles } from './button-base.styles';\nimport { styles } from './fab.styles';\n\n@customElement('u-fab')\nexport class UmFabButton extends ButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];\n \n /**\n * The FAB color variant to render.\n */\n @property({reflect: true}) color: 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded' = 'primary';\n\n /**\n * The size of the FAB.\n */\n @property({reflect: true}) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * The text to display the FAB.\n */\n @property({reflect: true}) label: string | null = null;\n\n /**\n * Lowers the FAB's elevation.\n */\n @property({type: Boolean, reflect: true}) lowered = false;\n\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': UmFabButton;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.styles.d.ts","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAsFlB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
aspect-ratio: 1;
|
|
5
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 3);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host([lowered]) {
|
|
9
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (hover: hover) {
|
|
13
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
14
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
15
|
+
}
|
|
16
|
+
:host(:hover:not(:focus-within):not(:active)[lowered]) {
|
|
17
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 2);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@media (hover: hover) {
|
|
21
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
22
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
:host([size=small]) {
|
|
26
|
+
width: var(--u-fab-button-small-size, 40px);
|
|
27
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-medium, 12px));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([size=large]) {
|
|
31
|
+
width: var(--u-fab-button-medium-size, 96px);
|
|
32
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-extra-large, 28px));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([extended]),
|
|
36
|
+
:host([size=medium]) {
|
|
37
|
+
width: var(--u-fab-button-medium-size, 56px);
|
|
38
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-large, 16px));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([size=large]) .icon {
|
|
42
|
+
font-size: var(--u-fab-button-icon-size, 2rem);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([extended]) .icon,
|
|
46
|
+
:host([size=small]) .icon,
|
|
47
|
+
:host([size=medium]) .icon {
|
|
48
|
+
font-size: var(--u-fab-button-icon-size, 1.5rem);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([extended]) {
|
|
52
|
+
width: auto;
|
|
53
|
+
height: var(--u-extended-fab-button-height, 56px);
|
|
54
|
+
aspect-ratio: auto;
|
|
55
|
+
min-width: var(--u-extended-fab-button-min-width, 80px);
|
|
56
|
+
padding-inline: var(--u-extended-fab-button-padding, 16px 24px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([extended]) .icon {
|
|
60
|
+
margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([color=primary]) {
|
|
64
|
+
background-color: var(--u-fab-button-primary-background-color, var(--u-color-primary-container, rgb(234, 221, 255)));
|
|
65
|
+
color: var(--u-fab-button-primary-text-color, var(--u-color-on-primary-container, rgb(33, 0, 93)));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([color=secondary]) {
|
|
69
|
+
background-color: var(--u-fab-button-secondary-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
70
|
+
color: var(--u-fab-button-secondary-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([color=tertiary]) {
|
|
74
|
+
background-color: var(--u-fab-button-tertiary-background-color, var(--u-color-tertiary-container, rgb(255, 216, 228)));
|
|
75
|
+
color: var(--u-fab-button-tertiary-text-color, var(--u-color-on-tertiary-container, rgb(49, 17, 29)));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([color=branded]),
|
|
79
|
+
:host([color=surface]) {
|
|
80
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-high, rgb(236, 230, 240)));
|
|
81
|
+
color: var(--u-fab-button-surface-text-color, var(--_color-primary));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([color=branded][lowered]),
|
|
85
|
+
:host([color=surface][lowered]) {
|
|
86
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
//# sourceMappingURL=fab.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.styles.js","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = 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 :host(:hover:not(:focus-within):not(:active)[lowered]) {\n --u-elevation-level: var(--u-fab-button-elevation-level, 2);\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([size=small]) {\n width: var(--u-fab-button-small-size, 40px);\n border-radius: var(--u-fab-button-medium-shape-corner, 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-corner, 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-corner, 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]) .icon,\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 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-color-primary-container, rgb(234, 221, 255)));\n color: var(--u-fab-button-primary-text-color, var(--u-color-on-primary-container, rgb(33, 0, 93)));\n }\n\n :host([color=secondary]) {\n background-color: var(--u-fab-button-secondary-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n color: var(--u-fab-button-secondary-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host([color=tertiary]) {\n background-color: var(--u-fab-button-tertiary-background-color, var(--u-color-tertiary-container, rgb(255, 216, 228)));\n color: var(--u-fab-button-tertiary-text-color, var(--u-color-on-tertiary-container, rgb(49, 17, 29)));\n }\n\n :host([color=branded]),\n :host([color=surface]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-high, rgb(236, 230, 240)));\n color: var(--u-fab-button-surface-text-color, var(--_color-primary));\n }\n\n :host([color=branded][lowered]),\n :host([color=surface][lowered]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));\n }\n`;\n"]}
|