@universal-material/web 3.0.146 → 3.0.148
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/button/button-base.d.ts +2 -1
- package/button/button-base.d.ts.map +1 -1
- package/button/button-base.js.map +1 -1
- package/button/button-base.styles.d.ts.map +1 -1
- package/button/button-base.styles.js +5 -0
- package/button/button-base.styles.js.map +1 -1
- package/button/button.d.ts +12 -6
- package/button/button.d.ts.map +1 -1
- package/button/button.js +48 -14
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts.map +1 -1
- package/button/button.styles.js +154 -30
- package/button/button.styles.js.map +1 -1
- package/button/fab.d.ts +1 -1
- package/button/fab.d.ts.map +1 -1
- package/button/icon-button.d.ts +5 -23
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +13 -53
- package/button/icon-button.js.map +1 -1
- package/button/icon-button.styles.d.ts.map +1 -1
- package/button/icon-button.styles.js +72 -32
- package/button/icon-button.styles.js.map +1 -1
- package/button/toggle-button.d.ts +37 -0
- package/button/toggle-button.d.ts.map +1 -0
- package/button/toggle-button.js +66 -0
- package/button/toggle-button.js.map +1 -0
- package/button/toggle-button.styles.d.ts +2 -0
- package/button/toggle-button.styles.d.ts.map +1 -0
- package/button/toggle-button.styles.js +92 -0
- package/button/toggle-button.styles.js.map +1 -0
- package/card/card.styles.d.ts.map +1 -1
- package/card/card.styles.js +2 -0
- package/card/card.styles.js.map +1 -1
- package/chip/chip.js +2 -2
- package/chip/chip.js.map +1 -1
- package/custom-elements.json +7750 -6741
- package/package.json +1 -1
package/button/button-base.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { CSSResultGroup } from '@lit/reactive-element/css-tag';
|
|
1
2
|
import { UmButtonWrapper } from '../shared/button-wrapper.js';
|
|
2
3
|
export declare abstract class UmButtonBase extends UmButtonWrapper {
|
|
3
4
|
#private;
|
|
4
5
|
static readonly formAssociated = true;
|
|
5
|
-
static styles:
|
|
6
|
+
static styles: CSSResultGroup;
|
|
6
7
|
type: string;
|
|
7
8
|
value: string;
|
|
8
9
|
get form(): HTMLFormElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,8BAAsB,YAAa,SAAQ,eAAe;;IAExD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,OAAgB,MAAM,EAAE,cAAc,CAAoC;IAE9D,IAAI,SAAY;IAEC,KAAK,SAAM;IAExC,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;cASkB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;CA8BjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,OAAgB,YAAa,SAAQ,eAAe;aAExC,mBAAc,GAAG,IAAI,AAAP,CAAQ;aAEtB,WAAM,GAAmB,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnD,CAAoD;IAM1E,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrC,CAAC;IAEQ,iBAAiB,CAAmB;IAE7C;QACE,KAAK,EAAE,CAAC;QAXE,SAAI,GAAG,QAAQ,CAAC;QAEC,UAAK,GAAG,EAAE,CAAC;QAUtC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;IAEkB,WAAW,CAAC,CAAU;QAEvC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1C,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEhD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,gBAAgB,CACxB,QAAQ,EACR,WAAW,CAAC,EAAE;YACZ,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE;gBAC9C,YAAY,EAAE,IAAI;gBAClB,UAAU,EAAE,IAAI;gBAChB,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;aAChB,CAAC,CAAC;QACL,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAC9B,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IAC5B,CAAC;;AA5CW;IAAX,QAAQ,EAAE;0CAAiB;AAEC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAY","sourcesContent":["import { CSSResultGroup } from '@lit/reactive-element/css-tag';\n\nimport { property } from 'lit/decorators.js';\n\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\nimport { styles } from './button-base.styles.js';\n\nexport abstract class UmButtonBase extends UmButtonWrapper {\n\n static readonly formAssociated = true;\n\n static override styles: CSSResultGroup = [UmButtonWrapper.styles, styles];\n\n @property() type = 'submit';\n\n @property({ reflect: true }) value = '';\n\n get form(): HTMLFormElement | null {\n return this.#elementInternals.form;\n }\n\n readonly #elementInternals: ElementInternals;\n\n constructor() {\n super();\n this.#elementInternals = this.attachInternals();\n }\n\n protected override handleClick(_: UIEvent): void {\n\n if (this.type === 'button' || !!this.href) {\n return;\n }\n\n if (!this.form) {\n return;\n }\n\n this.#elementInternals.setFormValue(this.value);\n\n if (this.type === 'reset') {\n this.form.reset();\n return;\n }\n\n this.form.addEventListener(\n 'submit',\n submitEvent => {\n Object.defineProperty(submitEvent, 'submitter', {\n configurable: true,\n enumerable: true,\n get: () => this,\n });\n },\n { capture: true, once: true },\n );\n this.form.requestSubmit();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"button-base.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAkBlB,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_morph-duration: var(--u-button-morph-duration, 125ms);
|
|
5
|
+
transition: background-color var(--_morph-duration) linear, border-radius var(--_morph-duration) linear, color var(--_morph-duration) linear;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
.icon {
|
|
4
9
|
display: flex;
|
|
5
10
|
justify-content: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.styles.js","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"button-base.styles.js","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;CAkBzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_morph-duration: var(--u-button-morph-duration, 125ms);\n transition: background-color var(--_morph-duration) linear, border-radius var(--_morph-duration) linear, color var(--_morph-duration) linear;\n }\n\n .icon {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 1em;\n height: 1em;\n line-height: 1em;\n }\n\n ::slotted([slot=icon]) {\n display: inline-block;\n }\n`;\n"]}
|
package/button/button.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { PropertyValues } from '@lit/reactive-element';
|
|
2
|
+
import { CSSResultGroup } from '@lit/reactive-element/css-tag';
|
|
1
3
|
import { HTMLTemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
4
|
+
import { UmToggleButton } from './toggle-button.js';
|
|
3
5
|
import '../ripple/ripple.js';
|
|
4
6
|
export type UmButtonVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
5
7
|
export type UmButtonColor = 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;
|
|
6
|
-
export declare class UmButton extends
|
|
7
|
-
|
|
8
|
+
export declare class UmButton extends UmToggleButton {
|
|
9
|
+
#private;
|
|
10
|
+
static styles: CSSResultGroup;
|
|
8
11
|
/**
|
|
9
12
|
* The Button variant to render
|
|
10
13
|
*/
|
|
11
14
|
variant: UmButtonVariant;
|
|
12
15
|
/**
|
|
13
16
|
* The Button color
|
|
14
|
-
*
|
|
15
|
-
1
|
|
16
17
|
*/
|
|
17
18
|
color: UmButtonColor;
|
|
18
19
|
trailingIcon: boolean;
|
|
@@ -22,8 +23,13 @@ export declare class UmButton extends UmButtonBase {
|
|
|
22
23
|
* _Note:_ Readonly
|
|
23
24
|
*/
|
|
24
25
|
hasIcon: boolean;
|
|
26
|
+
hasSelectionLabel: boolean;
|
|
27
|
+
private readonly _textWrapper;
|
|
28
|
+
private readonly _text;
|
|
29
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
25
30
|
protected renderContent(): HTMLTemplateResult;
|
|
26
|
-
private
|
|
31
|
+
private handleIconSlotChange;
|
|
32
|
+
protected handleSelectedLabelSlotChange(e: Event): void;
|
|
27
33
|
}
|
|
28
34
|
declare global {
|
|
29
35
|
interface HTMLElementTagNameMap {
|
package/button/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAI/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AACpF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvF,qBACa,QAAS,SAAQ,cAAc;;IAC1C,OAAgB,MAAM,EAAE,cAAc,CAAmC;IAEzE;;OAEG;IAC0B,OAAO,EAAE,eAAe,CAAY;IAEjE;;OAEG;IAC0B,KAAK,EAAE,aAAa,CAAC;IAEsB,YAAY,UAAS;IAE7F;;;;OAIG;IACgE,OAAO,UAAS;IAEL,iBAAiB,UAAS;IAEvE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IAInD,YAAY,CAAC,iBAAiB,EAAE,cAAc;cAYpC,aAAa,IAAI,kBAAkB;IAwBtD,OAAO,CAAC,oBAAoB;IAI5B,SAAS,CAAC,6BAA6B,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;CAGxD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,QAAQ,CAAC;KACtB;CACF"}
|
package/button/button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { UmButtonBase } from './button-base.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
4
|
import { styles } from './button.styles.js';
|
|
5
|
+
import { UmToggleButton } from './toggle-button.js';
|
|
6
6
|
import '../ripple/ripple.js';
|
|
7
|
-
let UmButton = class UmButton extends
|
|
7
|
+
let UmButton = class UmButton extends UmToggleButton {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
/**
|
|
@@ -18,23 +18,48 @@ let UmButton = class UmButton extends UmButtonBase {
|
|
|
18
18
|
* _Note:_ Readonly
|
|
19
19
|
*/
|
|
20
20
|
this.hasIcon = false;
|
|
21
|
+
this.hasSelectionLabel = false;
|
|
22
|
+
}
|
|
23
|
+
static { this.styles = [UmToggleButton.styles, styles]; }
|
|
24
|
+
#textSizeObserver;
|
|
25
|
+
firstUpdated(changedProperties) {
|
|
26
|
+
super.firstUpdated(changedProperties);
|
|
27
|
+
this.#textSizeObserver = new ResizeObserver(() => this.#setTextWrapperWidth());
|
|
28
|
+
this.#textSizeObserver.observe(this._text);
|
|
29
|
+
this.#setTextWrapperWidth();
|
|
30
|
+
}
|
|
31
|
+
#setTextWrapperWidth() {
|
|
32
|
+
this._textWrapper.style.width = `${this._text.offsetWidth}px`;
|
|
21
33
|
}
|
|
22
|
-
static { this.styles = [UmButtonBase.styles, styles]; }
|
|
23
34
|
renderContent() {
|
|
24
|
-
const icon = html `
|
|
25
|
-
<span class="icon">
|
|
26
|
-
<slot name="icon" aria-hidden="true" @slotchange="${this.handleSlotChange}"></slot>
|
|
27
|
-
</span>
|
|
28
|
-
`;
|
|
29
35
|
return html `
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
<span class="icon-container" aria-hidden="true">
|
|
37
|
+
<span class="icon icon-default">
|
|
38
|
+
<slot name="icon" @slotchange="${this.handleIconSlotChange}"></slot>
|
|
39
|
+
</span>
|
|
40
|
+
<span class="icon icon-selected">
|
|
41
|
+
<slot name="icon-selected" @slotchange="${this.handleSelectedIconSlotChange}"></slot>
|
|
42
|
+
</span>
|
|
43
|
+
</span>
|
|
44
|
+
|
|
45
|
+
<span class="label-container">
|
|
46
|
+
<span id="label">
|
|
47
|
+
<span class="label label-default">
|
|
48
|
+
<slot></slot>
|
|
49
|
+
</span>
|
|
50
|
+
<span class="label label-selected">
|
|
51
|
+
<slot name="label-selected" @slotchange="${this.handleSelectedLabelSlotChange}"></slot>
|
|
52
|
+
</span>
|
|
53
|
+
</span>
|
|
54
|
+
</span>
|
|
33
55
|
`;
|
|
34
56
|
}
|
|
35
|
-
|
|
57
|
+
handleIconSlotChange(e) {
|
|
36
58
|
this.hasIcon = e.target.assignedElements({ flatten: true }).length > 0;
|
|
37
59
|
}
|
|
60
|
+
handleSelectedLabelSlotChange(e) {
|
|
61
|
+
this.hasSelectionLabel = e.target.assignedElements({ flatten: true }).length > 0;
|
|
62
|
+
}
|
|
38
63
|
};
|
|
39
64
|
__decorate([
|
|
40
65
|
property({ reflect: true })
|
|
@@ -48,6 +73,15 @@ __decorate([
|
|
|
48
73
|
__decorate([
|
|
49
74
|
property({ type: Boolean, attribute: 'has-icon', reflect: true })
|
|
50
75
|
], UmButton.prototype, "hasIcon", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: Boolean, attribute: 'has-selection-label', reflect: true })
|
|
78
|
+
], UmButton.prototype, "hasSelectionLabel", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
query('.label-container', true)
|
|
81
|
+
], UmButton.prototype, "_textWrapper", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
query('#label', true)
|
|
84
|
+
], UmButton.prototype, "_text", void 0);
|
|
51
85
|
UmButton = __decorate([
|
|
52
86
|
customElement('u-button')
|
|
53
87
|
], UmButton);
|
package/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,qBAAqB,CAAC;AAMtB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,cAAc;IAArC;;QAGL;;WAEG;QAC0B,YAAO,GAAoB,QAAQ,CAAC;QAOO,iBAAY,GAAG,KAAK,CAAC;QAE7F;;;;WAIG;QACgE,YAAO,GAAG,KAAK,CAAC;QAEL,sBAAiB,GAAG,KAAK,CAAC;IAkD1G,CAAC;aAvEiB,WAAM,GAAmB,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,AAAlD,CAAmD;IA0BzE,iBAAiB,CAAyB;IAEjC,YAAY,CAAC,iBAAiC;QACrD,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QAEtC,IAAI,CAAC,iBAAiB,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC/E,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC;IAChE,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI,CAAA;;;2CAG4B,IAAI,CAAC,oBAAoB;;;oDAGhB,IAAI,CAAC,4BAA4B;;;;;;;;;;uDAU9B,IAAI,CAAC,6BAA6B;;;;KAIpF,CAAC;IACJ,CAAC;IAEO,oBAAoB,CAAC,CAAQ;QACnC,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA0B,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9F,CAAC;IAES,6BAA6B,CAAC,CAAQ;QAC9C,IAAI,CAAC,iBAAiB,GAAI,CAAC,CAAC,MAA0B,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACxG,CAAC;;AAjE4B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAqC;AAKpC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAsB;AAEsB;IAAvE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAsB;AAO1B;IAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAiB;AAEL;IAA7E,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAA2B;AAEtD;IAAjD,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC;8CAA6C;AACrC;IAAvC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;uCAAsC;AAzBjD,QAAQ;IADpB,aAAa,CAAC,UAAU,CAAC;GACb,QAAQ,CAwEpB","sourcesContent":["import { PropertyValues } from '@lit/reactive-element';\nimport { CSSResultGroup } from '@lit/reactive-element/css-tag';\n\nimport { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\n\nimport { styles } from './button.styles.js';\nimport { UmToggleButton } from './toggle-button.js';\n\nimport '../ripple/ripple.js';\n\nexport type UmButtonVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';\nexport type UmButtonColor = 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;\n\n@customElement('u-button')\nexport class UmButton extends UmToggleButton {\n static override styles: CSSResultGroup = [UmToggleButton.styles, styles];\n\n /**\n * The Button variant to render\n */\n @property({ reflect: true }) variant: UmButtonVariant = 'filled';\n\n /**\n * The Button color\n */\n @property({ reflect: true }) color: UmButtonColor;\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 @property({ type: Boolean, attribute: 'has-selection-label', reflect: true }) hasSelectionLabel = false;\n\n @query('.label-container', true) private readonly _textWrapper!: HTMLElement;\n @query('#label', true) private readonly _text!: HTMLElement;\n\n #textSizeObserver!: ResizeObserver | null;\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n\n this.#textSizeObserver = new ResizeObserver(() => this.#setTextWrapperWidth());\n this.#textSizeObserver.observe(this._text);\n this.#setTextWrapperWidth();\n }\n\n #setTextWrapperWidth(): void {\n this._textWrapper.style.width = `${this._text.offsetWidth}px`;\n }\n\n protected override renderContent(): HTMLTemplateResult {\n return html`\n <span class=\"icon-container\" aria-hidden=\"true\">\n <span class=\"icon icon-default\">\n <slot name=\"icon\" @slotchange=\"${this.handleIconSlotChange}\"></slot>\n </span>\n <span class=\"icon icon-selected\">\n <slot name=\"icon-selected\" @slotchange=\"${this.handleSelectedIconSlotChange}\"></slot>\n </span>\n </span>\n\n <span class=\"label-container\">\n <span id=\"label\">\n <span class=\"label label-default\">\n <slot></slot>\n </span>\n <span class=\"label label-selected\">\n <slot name=\"label-selected\" @slotchange=\"${this.handleSelectedLabelSlotChange}\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n private handleIconSlotChange(e: Event) {\n this.hasIcon = (e.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n }\n\n protected handleSelectedLabelSlotChange(e: Event): void {\n this.hasSelectionLabel = (e.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button': UmButton;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAgOlB,CAAC"}
|
package/button/button.styles.js
CHANGED
|
@@ -2,51 +2,138 @@ import { css } from 'lit';
|
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host {
|
|
4
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,
|
|
5
|
+
--u-common-button-font-size: var(--u-label-large-font-size, .875rem);
|
|
6
6
|
--u-common-button-font-weight: var(--u-font-weight-medium, 500);
|
|
7
|
-
--_common-button-
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
|
|
7
|
+
--_common-button-padding: var(--u-common-button-padding, 16px);
|
|
8
|
+
--_extra-small-font-size: var(--u-common-button-extra-small-font-size, .875rem);
|
|
9
|
+
--_small-font-size: var(--u-common-button-small-font-size, .875rem);
|
|
10
|
+
--_medium-font-size: var(--u-common-button-medium-font-size, 1rem);
|
|
11
|
+
--_large-font-size: var(--u-common-button-large-font-size, 1.5rem);
|
|
12
|
+
--_extra-large-font-size: var(--u-common-button-extra-large-font-size, 2rem);
|
|
13
|
+
--_extra-small-font-weight: var(--u-common-button-extra-small-font-weight, var(--u-font-weight-medium, 500));
|
|
14
|
+
--_small-font-weight: var(--u-common-button-small-font-weight, var(--u-font-weight-medium, 500));
|
|
15
|
+
--_medium-font-weight: var(--u-common-button-medium-font-weight, var(--u-font-weight-medium, 500));
|
|
16
|
+
--_large-font-weight: var(--u-common-button-large-font-weight, var(--u-font-weight-regular, 400));
|
|
17
|
+
--_extra-large-font-weight: var(--u-common-button-extra-large-font-weight, var(--u-font-weight-regular, 400));
|
|
18
|
+
--_extra-small-size: var(--u-common-button-extra-small-height, 32px);
|
|
19
|
+
--_small-size: var(--u-common-button-small-height, 40px);
|
|
20
|
+
--_medium-size: var(--u-common-button-medium-height, 56px);
|
|
21
|
+
--_large-size: var(--u-common-button-large-height, 96px);
|
|
22
|
+
--_extra-large-size: var(--u-common-button-extra-large-height, 136px);
|
|
23
|
+
--_extra-small-icon-size: var(--u-icon-button-extra-small-icon-size, 1.25rem);
|
|
24
|
+
--_small-icon-size: var(--u-icon-button-small-icon-size, 1.25rem);
|
|
25
|
+
--_medium-icon-size: var(--u-icon-button-medium-icon-size, 1.5rem);
|
|
26
|
+
--_large-icon-size: var(--u-icon-button-large-icon-size, 2rem);
|
|
27
|
+
--_extra-large-icon-size: var(--u-icon-button-extra-large-icon-size, 2.5rem);
|
|
28
|
+
--_extra-small-icon-margin: var(--u-icon-button-extra-small-icon-margin, 8px);
|
|
29
|
+
--_small-icon-margin: var(--u-icon-button-small-icon-margin, 8px);
|
|
30
|
+
--_medium-icon-margin: var(--u-icon-button-medium-icon-margin, 8px);
|
|
31
|
+
--_large-icon-margin: var(--u-icon-button-large-icon-margin, 12px);
|
|
32
|
+
--_extra-large-icon-margin: var(--u-icon-button-extra-large-icon-margin, 16px);
|
|
33
|
+
--_extra-small-padding: var(--u-common-button-extra-small-padding, 12px);
|
|
34
|
+
--_small-padding: var(--u-common-button-small-padding, 16px);
|
|
35
|
+
--_medium-padding: var(--u-common-button-medium-padding, 24px);
|
|
36
|
+
--_large-padding: var(--u-common-button-large-padding, 48px);
|
|
37
|
+
--_extra-large-padding: var(--u-common-button-extra-large-padding, 64px);
|
|
38
|
+
--_extra-small-square-shape-corner: var(--u-common-button-extra-small-square-shape-corner, 12px);
|
|
39
|
+
--_small-square-shape-corner: var(--u-common-button-small-square-shape-corner, 12px);
|
|
40
|
+
--_medium-square-shape-corner: var(--u-common-button-medium-square-shape-corner, 16px);
|
|
41
|
+
--_large-square-shape-corner: var(--u-common-button-large-square-shape-corner, 28px);
|
|
42
|
+
--_extra-large-square-shape-corner: var(--u-common-button-extra-large-square-shape-corner, 28px);
|
|
43
|
+
--_extra-small-pressed-shape-corner: var(--u-common-button-extra-small-pressed-shape-corner, 8px);
|
|
44
|
+
--_small-pressed-shape-corner: var(--u-common-button-small-pressed-shape-corner, 8px);
|
|
45
|
+
--_medium-pressed-shape-corner: var(--u-common-button-medium-pressed-shape-corner, 12px);
|
|
46
|
+
--_large-pressed-shape-corner: var(--u-common-button-large-pressed-shape-corner, 16px);
|
|
47
|
+
--_extra-large-pressed-shape-corner: var(--u-common-button-extra-large-pressed-shape-corner, 16px);
|
|
48
|
+
--_font-size: var(--_small-font-size);
|
|
49
|
+
--_font-weight: var(--_small-font-weight);
|
|
50
|
+
--_padding: var(--_small-padding);
|
|
51
|
+
--_icon-margin: var(--_small-icon-margin);
|
|
52
|
+
--_round-shape-corner: var(--u-common-button-round-shape-corner, calc(var(--_size) / 2));
|
|
13
53
|
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
14
|
-
|
|
15
|
-
font-
|
|
16
|
-
|
|
17
|
-
padding-inline: var(--_common-button-padding);
|
|
54
|
+
font-size: var(--_font-size);
|
|
55
|
+
font-weight: var(--_font-weight);
|
|
56
|
+
padding-inline: var(--_padding);
|
|
18
57
|
box-sizing: border-box;
|
|
19
58
|
}
|
|
20
59
|
|
|
21
|
-
:host([
|
|
22
|
-
|
|
60
|
+
:host([size=extra-small]) {
|
|
61
|
+
--_font-size: var(--_extra-small-font-size);
|
|
62
|
+
--_font-weight: var(--_extra-small-font-weight);
|
|
63
|
+
--_padding: var(--_extra-small-padding);
|
|
64
|
+
--_icon-margin: var(--_extra-small-icon-margin);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([size=medium]) {
|
|
68
|
+
--_font-size: var(--_medium-font-size);
|
|
69
|
+
--_font-weight: var(--_medium-font-weight);
|
|
70
|
+
--_padding: var(--_medium-padding);
|
|
71
|
+
--_icon-margin: var(--_medium-icon-margin);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([size=large]) {
|
|
75
|
+
--_font-size: var(--_large-font-size);
|
|
76
|
+
--_font-weight: var(--_large-font-weight);
|
|
77
|
+
--_padding: var(--_large-padding);
|
|
78
|
+
--_icon-margin: var(--_large-icon-margin);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([size=extra-large]) {
|
|
82
|
+
--_font-size: var(--_extra-large-font-size);
|
|
83
|
+
--_font-weight: var(--_extra-large-font-weight);
|
|
84
|
+
--_padding: var(--_extra-large-padding);
|
|
85
|
+
--_icon-margin: var(--_extra-large-icon-margin);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([variant=filled][toggle]) {
|
|
89
|
+
background-color: var(--u-filled-button-primary-container-unselected-color, var(--u-color-surface-container, rgb(243, 237, 247)));
|
|
90
|
+
color: var(--u-filled-button-primary-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([variant=filled]:not([toggle])),
|
|
94
|
+
:host([variant=filled][selected]),
|
|
95
|
+
:host([variant=filled][color=primary]:not([toggle])),
|
|
96
|
+
:host([variant=filled][color=primary][selected]) {
|
|
23
97
|
background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));
|
|
24
98
|
color: var(--u-filled-button-primary-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));
|
|
25
99
|
}
|
|
26
100
|
|
|
27
|
-
:host([variant=filled][color=secondary])
|
|
101
|
+
:host([variant=filled][color=secondary]:not([toggle])),
|
|
102
|
+
:host([variant=filled][color=secondary][selected]) {
|
|
28
103
|
background-color: var(--u-filled-button-secondary-container-color, var(--u-color-secondary, rgb(98, 91, 113)));
|
|
29
104
|
color: var(--u-filled-button-secondary-text-color, var(--u-color-on-secondary, rgb(255, 255, 255)));
|
|
30
105
|
}
|
|
31
106
|
|
|
32
|
-
:host([variant=filled][color=tertiary])
|
|
107
|
+
:host([variant=filled][color=tertiary]:not([toggle])),
|
|
108
|
+
:host([variant=filled][color=tertiary][selected]) {
|
|
33
109
|
background-color: var(--u-filled-button-tertiary-container-color, var(--u-color-tertiary, rgb(125, 82, 96)));
|
|
34
110
|
color: var(--u-filled-button-tertiary-text-color, var(--u-color-on-tertiary, rgb(255, 255, 255)));
|
|
35
111
|
}
|
|
36
112
|
|
|
37
|
-
:host([variant=filled][color=error])
|
|
113
|
+
:host([variant=filled][color=error]:not([toggle])),
|
|
114
|
+
:host([variant=filled][color=error][selected]) {
|
|
38
115
|
background-color: var(--u-filled-button-error-container-color, var(--u-color-error, rgb(179, 38, 30)));
|
|
39
116
|
color: var(--u-filled-button-error-text-color, var(--u-color-on-error, rgb(255, 255, 255)));
|
|
40
117
|
}
|
|
41
118
|
|
|
42
119
|
:host([variant=tonal]) {
|
|
43
|
-
background-color: var(--u-tonal-button-
|
|
120
|
+
background-color: var(--u-tonal-button-container-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
44
121
|
color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
45
122
|
}
|
|
46
123
|
|
|
124
|
+
:host([variant=tonal][selected]) {
|
|
125
|
+
background-color: var(--u-tonal-button-container-selected-color, var(--u-color-secondary, rgb(98, 91, 113)));
|
|
126
|
+
color: var(--u-tonal-button-text-selected-color, var(--u-color-on-secondary, rgb(255, 255, 255)));
|
|
127
|
+
}
|
|
128
|
+
|
|
47
129
|
:host([variant=elevated]) {
|
|
48
|
-
background-color: var(--u-elevated-button-
|
|
49
|
-
color: var(--u-
|
|
130
|
+
background-color: var(--u-elevated-button-container-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));
|
|
131
|
+
color: var(--u-elevated-button-text-color, var(--u-color-primary, rgb(103, 80, 164)));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([variant=elevated][selected]) {
|
|
135
|
+
background-color: var(--u-elevated-button-container-selected-color, var(--u-color-primary, rgb(103, 80, 164)));
|
|
136
|
+
color: var(--u-elevated-button-text-selected-color, var(--u-color-on-primary, rgb(255, 255, 255)));
|
|
50
137
|
}
|
|
51
138
|
|
|
52
139
|
@media (hover: hover) {
|
|
@@ -64,6 +151,11 @@ export const styles = css `
|
|
|
64
151
|
border: 1px solid var(--u-outlined-button-outline-color, var(--u-color-outline, rgb(121, 116, 126)));
|
|
65
152
|
}
|
|
66
153
|
|
|
154
|
+
:host([variant=outlined][selected]) {
|
|
155
|
+
background-color: var(--u-outlined-button-container-selected-color, var(--u-color-inverse-surface, rgb(50, 47, 53)));
|
|
156
|
+
color: var(--u-outlined-button-text-selected-color, var(--u-color-on-inverse-surface, rgb(245, 239, 247)));
|
|
157
|
+
}
|
|
158
|
+
|
|
67
159
|
:host([variant=elevated]) {
|
|
68
160
|
--u-elevation-level: var(--u-elevated-button-elevation-level, 1);
|
|
69
161
|
color: var(--u-elevated-button-text-color, var(--_color-primary));
|
|
@@ -79,25 +171,57 @@ export const styles = css `
|
|
|
79
171
|
--u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);
|
|
80
172
|
}
|
|
81
173
|
}
|
|
82
|
-
:host([has-icon]) {
|
|
83
|
-
|
|
174
|
+
:host(:not([has-icon])) .icon-container {
|
|
175
|
+
display: none;
|
|
84
176
|
}
|
|
85
177
|
|
|
86
|
-
|
|
87
|
-
|
|
178
|
+
.content {
|
|
179
|
+
gap: var(--_icon-margin);
|
|
88
180
|
}
|
|
89
181
|
|
|
90
|
-
|
|
91
|
-
|
|
182
|
+
.icon {
|
|
183
|
+
font-size: var(--_icon-size);
|
|
92
184
|
}
|
|
93
185
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
186
|
+
:host([trailing-icon]) .content {
|
|
187
|
+
flex-direction: row-reverse;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
#label {
|
|
191
|
+
display: inline-block;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.label {
|
|
195
|
+
display: inline-block;
|
|
196
|
+
inset-inline-start: 0;
|
|
197
|
+
transition-duration: calc(var(--_morph-duration) * 0.7);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.label-container {
|
|
201
|
+
position: relative;
|
|
202
|
+
transition: width var(--_morph-duration) linear;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.label-default {
|
|
206
|
+
opacity: 1;
|
|
207
|
+
transition-delay: calc(var(--_morph-duration) / 2);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.label-selected {
|
|
211
|
+
position: absolute;
|
|
212
|
+
opacity: 0;
|
|
213
|
+
transition-delay: 0ms;
|
|
97
214
|
}
|
|
98
215
|
|
|
99
|
-
:host([
|
|
100
|
-
|
|
216
|
+
:host([selected][has-selection-label]) .label-default {
|
|
217
|
+
position: absolute;
|
|
218
|
+
opacity: 0;
|
|
219
|
+
transition-delay: 0ms;
|
|
220
|
+
}
|
|
221
|
+
:host([selected][has-selection-label]) .label-selected {
|
|
222
|
+
position: static;
|
|
223
|
+
opacity: 1;
|
|
224
|
+
transition-delay: calc(var(--_morph-duration) / 2);
|
|
101
225
|
}
|
|
102
226
|
`;
|
|
103
227
|
//# sourceMappingURL=button.styles.js.map
|
|
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoGzB,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-size: var(--u-common-button-icon-size, 1.125rem);\n --_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);\n --_common-button-icon-margin: var(--u-common-button-icon-margin, 8px);\n border-radius: var(--u-common-button-shape-corner, var(--u-shape-corner-full, 9999px));\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\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-bg-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-bg-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=text]) {\n color: var(--u-text-button-text-color, var(--_color-primary));\n }\n\n :host([variant=outlined]) {\n color: var(--u-outlined-button-text-color, var(--u-text-button-text-color, var(--_color-primary)));\n border: 1px solid var(--u-outlined-button-outline-color, var(--u-color-outline, rgb(121, 116, 126)));\n }\n\n :host([variant=elevated]) {\n --u-elevation-level: var(--u-elevated-button-elevation-level, 1);\n color: var(--u-elevated-button-text-color, var(--_color-primary));\n }\n\n :host([disabled][variant=outlined]) {\n background-color: transparent !important;\n border-color: var(--u-outlined-button-disabled-border-color, color-mix(in srgb, var(--u-color-on-surface, rgb(29, 27, 32)) var(--u-outlined-button-disabled-border-opacity, 12%), transparent)) !important;\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 :host(:not([has-icon])) .icon {\n display: none;\n }\n\n .icon {\n font-size: var(--_common-button-icon-size);\n margin-inline-end: var(--_common-button-icon-margin);\n }\n\n :host([trailing-icon]) .icon {\n margin-inline: var(--_common-button-icon-margin) 0;\n }\n`;\n"]}
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgOzB,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, .875rem);\n --u-common-button-font-weight: var(--u-font-weight-medium, 500);\n --_common-button-padding: var(--u-common-button-padding, 16px);\n --_extra-small-font-size: var(--u-common-button-extra-small-font-size, .875rem);\n --_small-font-size: var(--u-common-button-small-font-size, .875rem);\n --_medium-font-size: var(--u-common-button-medium-font-size, 1rem);\n --_large-font-size: var(--u-common-button-large-font-size, 1.5rem);\n --_extra-large-font-size: var(--u-common-button-extra-large-font-size, 2rem);\n --_extra-small-font-weight: var(--u-common-button-extra-small-font-weight, var(--u-font-weight-medium, 500));\n --_small-font-weight: var(--u-common-button-small-font-weight, var(--u-font-weight-medium, 500));\n --_medium-font-weight: var(--u-common-button-medium-font-weight, var(--u-font-weight-medium, 500));\n --_large-font-weight: var(--u-common-button-large-font-weight, var(--u-font-weight-regular, 400));\n --_extra-large-font-weight: var(--u-common-button-extra-large-font-weight, var(--u-font-weight-regular, 400));\n --_extra-small-size: var(--u-common-button-extra-small-height, 32px);\n --_small-size: var(--u-common-button-small-height, 40px);\n --_medium-size: var(--u-common-button-medium-height, 56px);\n --_large-size: var(--u-common-button-large-height, 96px);\n --_extra-large-size: var(--u-common-button-extra-large-height, 136px);\n --_extra-small-icon-size: var(--u-icon-button-extra-small-icon-size, 1.25rem);\n --_small-icon-size: var(--u-icon-button-small-icon-size, 1.25rem);\n --_medium-icon-size: var(--u-icon-button-medium-icon-size, 1.5rem);\n --_large-icon-size: var(--u-icon-button-large-icon-size, 2rem);\n --_extra-large-icon-size: var(--u-icon-button-extra-large-icon-size, 2.5rem);\n --_extra-small-icon-margin: var(--u-icon-button-extra-small-icon-margin, 8px);\n --_small-icon-margin: var(--u-icon-button-small-icon-margin, 8px);\n --_medium-icon-margin: var(--u-icon-button-medium-icon-margin, 8px);\n --_large-icon-margin: var(--u-icon-button-large-icon-margin, 12px);\n --_extra-large-icon-margin: var(--u-icon-button-extra-large-icon-margin, 16px);\n --_extra-small-padding: var(--u-common-button-extra-small-padding, 12px);\n --_small-padding: var(--u-common-button-small-padding, 16px);\n --_medium-padding: var(--u-common-button-medium-padding, 24px);\n --_large-padding: var(--u-common-button-large-padding, 48px);\n --_extra-large-padding: var(--u-common-button-extra-large-padding, 64px);\n --_extra-small-square-shape-corner: var(--u-common-button-extra-small-square-shape-corner, 12px);\n --_small-square-shape-corner: var(--u-common-button-small-square-shape-corner, 12px);\n --_medium-square-shape-corner: var(--u-common-button-medium-square-shape-corner, 16px);\n --_large-square-shape-corner: var(--u-common-button-large-square-shape-corner, 28px);\n --_extra-large-square-shape-corner: var(--u-common-button-extra-large-square-shape-corner, 28px);\n --_extra-small-pressed-shape-corner: var(--u-common-button-extra-small-pressed-shape-corner, 8px);\n --_small-pressed-shape-corner: var(--u-common-button-small-pressed-shape-corner, 8px);\n --_medium-pressed-shape-corner: var(--u-common-button-medium-pressed-shape-corner, 12px);\n --_large-pressed-shape-corner: var(--u-common-button-large-pressed-shape-corner, 16px);\n --_extra-large-pressed-shape-corner: var(--u-common-button-extra-large-pressed-shape-corner, 16px);\n --_font-size: var(--_small-font-size);\n --_font-weight: var(--_small-font-weight);\n --_padding: var(--_small-padding);\n --_icon-margin: var(--_small-icon-margin);\n --_round-shape-corner: var(--u-common-button-round-shape-corner, calc(var(--_size) / 2));\n font-family: var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-size: var(--_font-size);\n font-weight: var(--_font-weight);\n padding-inline: var(--_padding);\n box-sizing: border-box;\n }\n\n :host([size=extra-small]) {\n --_font-size: var(--_extra-small-font-size);\n --_font-weight: var(--_extra-small-font-weight);\n --_padding: var(--_extra-small-padding);\n --_icon-margin: var(--_extra-small-icon-margin);\n }\n\n :host([size=medium]) {\n --_font-size: var(--_medium-font-size);\n --_font-weight: var(--_medium-font-weight);\n --_padding: var(--_medium-padding);\n --_icon-margin: var(--_medium-icon-margin);\n }\n\n :host([size=large]) {\n --_font-size: var(--_large-font-size);\n --_font-weight: var(--_large-font-weight);\n --_padding: var(--_large-padding);\n --_icon-margin: var(--_large-icon-margin);\n }\n\n :host([size=extra-large]) {\n --_font-size: var(--_extra-large-font-size);\n --_font-weight: var(--_extra-large-font-weight);\n --_padding: var(--_extra-large-padding);\n --_icon-margin: var(--_extra-large-icon-margin);\n }\n\n :host([variant=filled][toggle]) {\n background-color: var(--u-filled-button-primary-container-unselected-color, var(--u-color-surface-container, rgb(243, 237, 247)));\n color: var(--u-filled-button-primary-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n :host([variant=filled]:not([toggle])),\n :host([variant=filled][selected]),\n :host([variant=filled][color=primary]:not([toggle])),\n :host([variant=filled][color=primary][selected]) {\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]:not([toggle])),\n :host([variant=filled][color=secondary][selected]) {\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]:not([toggle])),\n :host([variant=filled][color=tertiary][selected]) {\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]:not([toggle])),\n :host([variant=filled][color=error][selected]) {\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-container-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=tonal][selected]) {\n background-color: var(--u-tonal-button-container-selected-color, var(--u-color-secondary, rgb(98, 91, 113)));\n color: var(--u-tonal-button-text-selected-color, var(--u-color-on-secondary, rgb(255, 255, 255)));\n }\n\n :host([variant=elevated]) {\n background-color: var(--u-elevated-button-container-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));\n color: var(--u-elevated-button-text-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n\n :host([variant=elevated][selected]) {\n background-color: var(--u-elevated-button-container-selected-color, var(--u-color-primary, rgb(103, 80, 164)));\n color: var(--u-elevated-button-text-selected-color, var(--u-color-on-primary, rgb(255, 255, 255)));\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=text]) {\n color: var(--u-text-button-text-color, var(--_color-primary));\n }\n\n :host([variant=outlined]) {\n color: var(--u-outlined-button-text-color, var(--u-text-button-text-color, var(--_color-primary)));\n border: 1px solid var(--u-outlined-button-outline-color, var(--u-color-outline, rgb(121, 116, 126)));\n }\n\n :host([variant=outlined][selected]) {\n background-color: var(--u-outlined-button-container-selected-color, var(--u-color-inverse-surface, rgb(50, 47, 53)));\n color: var(--u-outlined-button-text-selected-color, var(--u-color-on-inverse-surface, rgb(245, 239, 247)));\n }\n\n :host([variant=elevated]) {\n --u-elevation-level: var(--u-elevated-button-elevation-level, 1);\n color: var(--u-elevated-button-text-color, var(--_color-primary));\n }\n\n :host([disabled][variant=outlined]) {\n background-color: transparent !important;\n border-color: var(--u-outlined-button-disabled-border-color, color-mix(in srgb, var(--u-color-on-surface, rgb(29, 27, 32)) var(--u-outlined-button-disabled-border-opacity, 12%), transparent)) !important;\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(:not([has-icon])) .icon-container {\n display: none;\n }\n\n .content {\n gap: var(--_icon-margin);\n }\n\n .icon {\n font-size: var(--_icon-size);\n }\n\n :host([trailing-icon]) .content {\n flex-direction: row-reverse;\n }\n\n #label {\n display: inline-block;\n }\n\n .label {\n display: inline-block;\n inset-inline-start: 0;\n transition-duration: calc(var(--_morph-duration) * 0.7);\n }\n\n .label-container {\n position: relative;\n transition: width var(--_morph-duration) linear;\n }\n\n .label-default {\n opacity: 1;\n transition-delay: calc(var(--_morph-duration) / 2);\n }\n\n .label-selected {\n position: absolute;\n opacity: 0;\n transition-delay: 0ms;\n }\n\n :host([selected][has-selection-label]) .label-default {\n position: absolute;\n opacity: 0;\n transition-delay: 0ms;\n }\n :host([selected][has-selection-label]) .label-selected {\n position: static;\n opacity: 1;\n transition-delay: calc(var(--_morph-duration) / 2);\n }\n`;\n"]}
|
package/button/fab.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { UmButtonBase } from './button-base.js';
|
|
|
3
3
|
export type UmFabColor = 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';
|
|
4
4
|
export type UmFabSize = 'small' | 'medium' | 'large';
|
|
5
5
|
export declare class UmFab extends UmButtonBase {
|
|
6
|
-
static styles:
|
|
6
|
+
static styles: import("lit").CSSResultGroup[];
|
|
7
7
|
/**
|
|
8
8
|
* The FAB color variant to render.
|
|
9
9
|
*/
|
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,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD,qBACa,KAAM,SAAQ,YAAY;IAErC,OAAgB,MAAM
|
|
1
|
+
{"version":3,"file":"fab.d.ts","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD,qBACa,KAAM,SAAQ,YAAY;IAErC,OAAgB,MAAM,iCAAiC;IAEvD;;OAEG;IAC0B,KAAK,EAAE,UAAU,CAAa;IAE3D;;OAEG;IAC0B,IAAI,EAAE,SAAS,CAAY;IAExD;;OAEG;IAC0B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzD;;OAEG;IACyC,OAAO,UAAS;IAE5D,IACI,QAAQ,IAAI,OAAO,CAEtB;cAEkB,aAAa,IAAI,kBAAkB;CAQvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,OAAO,EAAE,KAAK,CAAC;KAChB;CACF"}
|
package/button/icon-button.d.ts
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import { HTMLTemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { UmToggleButton } from './toggle-button.js';
|
|
3
3
|
export type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
4
|
-
export
|
|
5
|
-
|
|
4
|
+
export type UmIconButtonWidth = 'default' | 'narrow' | 'wide' | undefined;
|
|
5
|
+
export declare class UmIconButton extends UmToggleButton {
|
|
6
|
+
static styles: import("lit").CSSResultGroup[];
|
|
6
7
|
variant: UmIconButtonVariant;
|
|
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
|
-
private readonly selectedIcons;
|
|
8
|
+
width: UmIconButtonWidth;
|
|
24
9
|
protected renderContent(): HTMLTemplateResult;
|
|
25
|
-
protected handleClick(event: UIEvent): void;
|
|
26
|
-
getAriaLabel(): string | null;
|
|
27
|
-
private handleSlotChange;
|
|
28
10
|
}
|
|
29
11
|
declare global {
|
|
30
12
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAI/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1E,qBACa,YAAa,SAAQ,cAAc;IAE9C,OAAgB,MAAM,iCAAmC;IAE5B,OAAO,EAAE,mBAAmB,CAAc;IAC1C,KAAK,EAAE,iBAAiB,CAAC;cAEnC,aAAa,IAAI,kBAAkB;CAavD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|