@universal-material/web 3.0.36 → 3.0.37
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.map +1 -1
- package/button/button-base.js.map +1 -1
- package/button/button-set.d.ts +3 -8
- package/button/button-set.d.ts.map +1 -1
- package/button/button-set.js +3 -13
- package/button/button-set.js.map +1 -1
- package/button/button.d.ts.map +1 -1
- package/button/button.js +2 -3
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts.map +1 -1
- package/button/button.styles.js +98 -0
- package/button/button.styles.js.map +1 -1
- package/button/fab.d.ts.map +1 -1
- package/button/fab.js +2 -3
- package/button/fab.js.map +1 -1
- package/button/fab.styles.d.ts.map +1 -1
- package/button/fab.styles.js +98 -0
- package/button/fab.styles.js.map +1 -1
- package/button/icon-button.d.ts +2 -3
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +6 -6
- package/button/icon-button.js.map +1 -1
- package/button/icon-button.styles.d.ts.map +1 -1
- package/button/icon-button.styles.js +98 -0
- package/button/icon-button.styles.js.map +1 -1
- package/checkbox/checkbox-list-item.d.ts +1 -1
- package/checkbox/checkbox.d.ts.map +1 -1
- package/checkbox/checkbox.js +1 -1
- package/checkbox/checkbox.js.map +1 -1
- package/chip/chip-set.d.ts +10 -0
- package/chip/chip-set.d.ts.map +1 -0
- package/chip/chip-set.js +17 -0
- package/chip/chip-set.js.map +1 -0
- package/{shared/button-wrapper.styles.d.ts → chip/chip-set.styles.d.ts} +1 -1
- package/chip/chip-set.styles.d.ts.map +1 -0
- package/chip/chip-set.styles.js +26 -0
- package/chip/chip-set.styles.js.map +1 -0
- package/chip/chip.d.ts +56 -0
- package/chip/chip.d.ts.map +1 -0
- package/chip/chip.js +158 -0
- package/chip/chip.js.map +1 -0
- package/chip/chip.styles.d.ts +2 -0
- package/chip/chip.styles.d.ts.map +1 -0
- package/chip/chip.styles.js +216 -0
- package/chip/chip.styles.js.map +1 -0
- package/custom-elements.json +4464 -3025
- package/field/field.d.ts.map +1 -1
- package/field/field.js +6 -2
- package/field/field.js.map +1 -1
- package/field/field.styles.d.ts.map +1 -1
- package/field/field.styles.js +32 -19
- package/field/field.styles.js.map +1 -1
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +8 -0
- package/index.js.map +1 -1
- package/menu/menu-item.d.ts.map +1 -1
- package/menu/menu-item.js +1 -3
- package/menu/menu-item.js.map +1 -1
- package/menu/menu-item.styles.d.ts.map +1 -1
- package/menu/menu-item.styles.js +85 -0
- package/menu/menu-item.styles.js.map +1 -1
- package/menu/menu.d.ts +1 -0
- package/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +12 -1
- package/menu/menu.js.map +1 -1
- package/navigation/drawer-item.d.ts.map +1 -1
- package/navigation/drawer-item.js +1 -3
- package/navigation/drawer-item.js.map +1 -1
- package/navigation/drawer-item.styles.d.ts.map +1 -1
- package/navigation/drawer-item.styles.js +85 -0
- package/navigation/drawer-item.styles.js.map +1 -1
- package/navigation/side-navigation.d.ts.map +1 -1
- package/navigation/side-navigation.js +1 -1
- package/navigation/side-navigation.js.map +1 -1
- package/package.json +1 -1
- package/radio/radio-list-item.d.ts +1 -1
- package/radio/radio.d.ts.map +1 -1
- package/radio/radio.js +1 -1
- package/radio/radio.js.map +1 -1
- package/shared/button-wrapper.d.ts +4 -4
- package/shared/button-wrapper.d.ts.map +1 -1
- package/shared/button-wrapper.js +29 -17
- package/shared/button-wrapper.js.map +1 -1
- package/shared/mixin-attribute-properties.d.ts +4 -0
- package/shared/mixin-attribute-properties.d.ts.map +1 -0
- package/shared/mixin-attribute-properties.js +27 -0
- package/shared/mixin-attribute-properties.js.map +1 -0
- package/shared/mixin.d.ts +3 -0
- package/shared/mixin.d.ts.map +1 -0
- package/shared/mixin.js +2 -0
- package/shared/mixin.js.map +1 -0
- package/shared/normalize-text.d.ts +2 -0
- package/shared/normalize-text.d.ts.map +1 -0
- package/shared/normalize-text.js +9 -0
- package/shared/normalize-text.js.map +1 -0
- package/shared/redispatch-event.d.ts +2 -0
- package/shared/redispatch-event.d.ts.map +1 -0
- package/shared/redispatch-event.js +14 -0
- package/shared/redispatch-event.js.map +1 -0
- package/shared/selection-control/selection-control-list-item.d.ts +2 -3
- package/shared/selection-control/selection-control-list-item.d.ts.map +1 -1
- package/shared/selection-control/selection-control-list-item.js.map +1 -1
- package/shared/sets/set-base.d.ts +9 -0
- package/shared/sets/set-base.d.ts.map +1 -0
- package/shared/sets/set-base.js +25 -0
- package/shared/sets/set-base.js.map +1 -0
- package/switch/switch-list-item.d.ts +1 -1
- package/switch/switch.d.ts.map +1 -1
- package/switch/switch.js +1 -1
- package/switch/switch.js.map +1 -1
- package/text-field/text-field.d.ts +14 -1
- package/text-field/text-field.d.ts.map +1 -1
- package/text-field/text-field.js +67 -7
- package/text-field/text-field.js.map +1 -1
- package/text-field/text-field.styles.d.ts.map +1 -1
- package/text-field/text-field.styles.js +19 -0
- package/text-field/text-field.styles.js.map +1 -1
- package/typeahead/highlight.d.ts +24 -0
- package/typeahead/highlight.d.ts.map +1 -0
- package/typeahead/highlight.js +95 -0
- package/typeahead/highlight.js.map +1 -0
- package/typeahead/highlight.styles.d.ts +2 -0
- package/typeahead/highlight.styles.d.ts.map +1 -0
- package/typeahead/highlight.styles.js +5 -0
- package/typeahead/highlight.styles.js.map +1 -0
- package/typeahead/typeahead.d.ts +37 -0
- package/typeahead/typeahead.d.ts.map +1 -0
- package/typeahead/typeahead.js +241 -0
- package/typeahead/typeahead.js.map +1 -0
- package/typeahead/typeahead.styles.d.ts +2 -0
- package/typeahead/typeahead.styles.d.ts.map +1 -0
- package/typeahead/typeahead.styles.js +7 -0
- package/typeahead/typeahead.styles.js.map +1 -0
- package/shared/button-wrapper.styles.d.ts.map +0 -1
- package/shared/button-wrapper.styles.js +0 -93
- package/shared/button-wrapper.styles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,8BAAsB,YAAa,SAAQ,eAAe;;IAExD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAE1B,IAAI,EAAE,MAAM,CAAY;IAET,KAAK,EAAE,MAAM,CAAM;IAE9C;;;OAGG;IACH,IACI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;cASkB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,8BAAsB,YAAa,SAAQ,eAAe;;IAExD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAE1B,IAAI,EAAE,MAAM,CAAY;IAET,KAAK,EAAE,MAAM,CAAM;IAE9C;;;OAGG;IACH,IACI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;cASkB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;CAoBjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,OAAgB,YAAa,SAAQ,eAAe;IAQxD;;;OAGG;IAEH,IAAI,IAAI;QACN,OAAO,uBAAA,IAAI,sCAAkB,CAAC,IAAI,CAAC;IACrC,CAAC;IAID;QACE,KAAK,EAAE,CAAC;QAhBE,SAAI,GAAW,QAAQ,CAAC;QAET,UAAK,GAAW,EAAE,CAAC;QAWrC,iDAAoC;QAI3C,uBAAA,IAAI,kCAAqB,IAAI,CAAC,eAAe,EAAE,MAAA,CAAC;IAClD,CAAC;IAEkB,WAAW,CAAC,CAAU;
|
|
1
|
+
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,OAAgB,YAAa,SAAQ,eAAe;IAQxD;;;OAGG;IAEH,IAAI,IAAI;QACN,OAAO,uBAAA,IAAI,sCAAkB,CAAC,IAAI,CAAC;IACrC,CAAC;IAID;QACE,KAAK,EAAE,CAAC;QAhBE,SAAI,GAAW,QAAQ,CAAC;QAET,UAAK,GAAW,EAAE,CAAC;QAWrC,iDAAoC;QAI3C,uBAAA,IAAI,kCAAqB,IAAI,CAAC,eAAe,EAAE,MAAA,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,uBAAA,IAAI,sCAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEhD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;;;AAxCe,2BAAc,GAAG,IAAI,AAAP,CAAQ;AAE1B;IAAX,QAAQ,EAAE;0CAAyB;AAET;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAoB;AAO9C;IADC,QAAQ,EAAE;wCAGV","sourcesContent":["import { property } from 'lit/decorators.js';\n\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\n\nexport abstract class UmButtonBase extends UmButtonWrapper {\n\n static readonly formAssociated = true;\n\n @property() type: string = 'submit';\n\n @property({reflect: true}) value: string = '';\n\n /**\n * The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)\n * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form\n */\n @property()\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 === 'submit') {\n this.form.requestSubmit();\n return;\n }\n\n this.form.reset();\n }\n\n}\n"]}
|
package/button/button-set.d.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
export declare class UmButtonSet extends LitElement {
|
|
1
|
+
import { UmSetBase } from '../shared/sets/set-base.js';
|
|
2
|
+
export declare class UmButtonSet extends UmSetBase {
|
|
4
3
|
static styles: import("lit").CSSResult;
|
|
5
|
-
/**
|
|
6
|
-
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
7
|
-
*/
|
|
8
|
-
alignment: UmButtonSetAlignment;
|
|
9
4
|
/**
|
|
10
5
|
* Whether to render the buttons stacked or not
|
|
11
6
|
*/
|
|
12
7
|
stack: boolean;
|
|
13
|
-
|
|
8
|
+
alignment: 'start' | 'center' | 'end';
|
|
14
9
|
}
|
|
15
10
|
declare global {
|
|
16
11
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,qBACa,WAAY,SAAQ,SAAS;IAExC,OAAgB,MAAM,0BAAU;IAEhC;;OAEG;IACuC,KAAK,UAAS;IAE/C,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAS;CACxD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
package/button/button-set.js
CHANGED
|
@@ -4,30 +4,20 @@ 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 { html, LitElement } from 'lit';
|
|
8
7
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
8
|
import { styles } from './button-set.styles.js';
|
|
10
|
-
|
|
9
|
+
import { UmSetBase } from '../shared/sets/set-base.js';
|
|
10
|
+
let UmButtonSet = class UmButtonSet extends UmSetBase {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
/**
|
|
14
|
-
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
15
|
-
*/
|
|
16
|
-
this.alignment = 'end';
|
|
17
13
|
/**
|
|
18
14
|
* Whether to render the buttons stacked or not
|
|
19
15
|
*/
|
|
20
16
|
this.stack = false;
|
|
21
|
-
|
|
22
|
-
render() {
|
|
23
|
-
return html `
|
|
24
|
-
<slot></slot>`;
|
|
17
|
+
this.alignment = 'end';
|
|
25
18
|
}
|
|
26
19
|
};
|
|
27
20
|
UmButtonSet.styles = styles;
|
|
28
|
-
__decorate([
|
|
29
|
-
property({ reflect: true })
|
|
30
|
-
], UmButtonSet.prototype, "alignment", void 0);
|
|
31
21
|
__decorate([
|
|
32
22
|
property({ type: Boolean, reflect: true })
|
|
33
23
|
], UmButtonSet.prototype, "stack", void 0);
|
package/button/button-set.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGhD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,SAAS;IAAnC;;QAIL;;WAEG;QACuC,UAAK,GAAG,KAAK,CAAC;QAE/C,cAAS,GAA+B,KAAK,CAAC;IACzD,CAAC;;AARiB,kBAAM,GAAG,MAAM,AAAT,CAAU;AAKU;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAe;AAP7C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAUvB","sourcesContent":["import { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './button-set.styles.js';\n\nimport { UmSetBase } from '../shared/sets/set-base.js';\n\n@customElement('u-button-set')\nexport class UmButtonSet extends UmSetBase {\n\n static override styles = styles;\n\n /**\n * Whether to render the buttons stacked or not\n */\n @property({type: Boolean, reflect: true}) stack = false;\n\n override alignment: 'start' | 'center' | 'end' = 'end';\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button-set': UmButtonSet;\n }\n}\n"]}
|
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,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAKnE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,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,YAAY;IAExC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAAY;IAE3D;;OAEG;IACwB,OAAO,EAAE,eAAe,CAAY;IAE/D;;;;OAIG;IACwB,KAAK,EAAE,aAAa,CAAC;IAEsB,YAAY,UAAS;IAE3F;;;;OAIG;IAC8D,OAAO,UAAS;IAGjF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;IAgBtD,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,QAAQ,CAAC;KACtB;CACF"}
|
package/button/button.js
CHANGED
|
@@ -6,9 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, nothing } from 'lit';
|
|
8
8
|
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
-
import { styles as buttonWrapperStyles } from '../shared/button-wrapper.styles.js';
|
|
10
|
-
import { UmButtonBase } from './button-base.js';
|
|
11
9
|
import { styles } from './button.styles.js';
|
|
10
|
+
import { UmButtonBase } from './button-base.js';
|
|
12
11
|
import '../ripple/ripple.js';
|
|
13
12
|
let UmButton = class UmButton extends UmButtonBase {
|
|
14
13
|
constructor() {
|
|
@@ -43,7 +42,7 @@ let UmButton = class UmButton extends UmButtonBase {
|
|
|
43
42
|
this.hasIcon = this.assignedIcons.length > 0;
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
UmButton.styles = [
|
|
45
|
+
UmButton.styles = [styles];
|
|
47
46
|
__decorate([
|
|
48
47
|
property({ reflect: true })
|
|
49
48
|
], UmButton.prototype, "variant", void 0);
|
package/button/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,MAAM,
|
|
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,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,qBAAqB,CAAC;AAMtB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,YAAY;IAAnC;;QAIL;;WAEG;QACwB,YAAO,GAAoB,QAAQ,CAAC;QASO,iBAAY,GAAG,KAAK,CAAC;QAE3F;;;;WAIG;QAC8D,YAAO,GAAG,KAAK,CAAC;IAwBnF,CAAC;IAnBoB,aAAa;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAA;;;;;yBAKI,IAAI,CAAC,gBAAgB;cAChC,CAAC;QAEX,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;;AA5Ce,eAAM,GAA4B,CAAC,MAAM,CAAC,AAApC,CAAqC;AAKhC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAqC;AAOpC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAsB;AAEsB;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,CA+CpB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { styles } from './button.styles.js';\n\nimport { UmButtonBase } from './button-base.js';\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 UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [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 * _Note:_ Filled buttons only\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 @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly assignedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n const icon = html`\n <span class=\"icon\">\n <slot\n name=\"icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.handleSlotChange}\"></slot>\n </span>`;\n\n return html`\n ${this.trailingIcon ? nothing : icon}\n <span id=\"text\"><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"]}
|
|
@@ -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,yBAwMlB,CAAC"}
|
package/button/button.styles.js
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
|
+
:host,
|
|
4
|
+
* {
|
|
5
|
+
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");
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
outline: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.focus-ring:focus-visible {
|
|
11
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
12
|
+
animation: u-focus-pulse 500ms ease;
|
|
13
|
+
animation-fill-mode: forwards;
|
|
14
|
+
outline-offset: 2px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes u-focus-pulse {
|
|
18
|
+
0% {
|
|
19
|
+
outline: 0 solid var(--_color-primary);
|
|
20
|
+
}
|
|
21
|
+
50% {
|
|
22
|
+
outline: 6px solid var(--_color-primary);
|
|
23
|
+
}
|
|
24
|
+
100% {
|
|
25
|
+
outline: 4px solid var(--_color-primary);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
:host {
|
|
29
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
30
|
+
-webkit-tap-highlight-color: transparent;
|
|
31
|
+
--u-elevation-level: 0;
|
|
32
|
+
position: relative;
|
|
33
|
+
display: inline-block;
|
|
34
|
+
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");
|
|
35
|
+
appearance: none !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([disabled]) {
|
|
39
|
+
--u-elevation-level: 0 !important;
|
|
40
|
+
background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;
|
|
41
|
+
color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([disabled]) .button {
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
* {
|
|
49
|
+
color: inherit;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
u-elevation {
|
|
53
|
+
z-index: -1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset-inline-start: 0;
|
|
60
|
+
inset-block-start: 0;
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
font-family: inherit;
|
|
64
|
+
border-radius: inherit;
|
|
65
|
+
color: inherit;
|
|
66
|
+
border: none;
|
|
67
|
+
margin: 0;
|
|
68
|
+
padding: 0;
|
|
69
|
+
text-align: center;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
background: transparent;
|
|
72
|
+
user-select: none;
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
outline: 0;
|
|
75
|
+
z-index: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.content {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
border-radius: inherit;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon {
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
width: 1em;
|
|
93
|
+
height: 1em;
|
|
94
|
+
line-height: 1em;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
::slotted([slot=icon]) {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
}
|
|
100
|
+
|
|
3
101
|
:host {
|
|
4
102
|
--u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);
|
|
5
103
|
--u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);
|
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n * {\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 box-sizing: border-box;\n outline: 0;\n }\n\n .focus-ring:focus-visible {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n animation: u-focus-pulse 500ms ease;\n animation-fill-mode: forwards;\n outline-offset: 2px;\n }\n\n @keyframes u-focus-pulse {\n 0% {\n outline: 0 solid var(--_color-primary);\n }\n 50% {\n outline: 6px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n --u-elevation-level: 0;\n position: relative;\n display: inline-block;\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 appearance: none !important;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n border-radius: inherit;\n width: 100%;\n height: 100%;\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 :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-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=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, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-outlined-button-disabled-border-opacity, 0.12))) !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 padding-inline-end: var(--_common-button-icon-margin);\n margin-inline-end: auto;\n }\n\n :host([trailing-icon]) .icon {\n padding-inline: var(--_common-button-icon-margin) 0;\n margin-inline: auto 0;\n }\n`;\n"]}
|
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,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;
|
|
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;AAKnE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,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,EAAE,SAAS,GAAG,SAAS,EAAE,CAAY;IAE3D;;OAEG;IACwB,KAAK,EAAE,UAAU,CAAa;IAEzD;;OAEG;IACwB,IAAI,EAAE,SAAS,CAAY;IAEtD;;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,KAAK,CAAC;KAChB;CACF"}
|
package/button/fab.js
CHANGED
|
@@ -6,9 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, nothing } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
-
import { styles as buttonWrapperStyles } from '../shared/button-wrapper.styles.js';
|
|
10
|
-
import { UmButtonBase } from './button-base.js';
|
|
11
9
|
import { styles } from './fab.styles.js';
|
|
10
|
+
import { UmButtonBase } from './button-base.js';
|
|
12
11
|
let UmFab = class UmFab extends UmButtonBase {
|
|
13
12
|
constructor() {
|
|
14
13
|
super(...arguments);
|
|
@@ -40,7 +39,7 @@ let UmFab = class UmFab extends UmButtonBase {
|
|
|
40
39
|
`;
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
|
-
UmFab.styles = [
|
|
42
|
+
UmFab.styles = [styles];
|
|
44
43
|
__decorate([
|
|
45
44
|
property({ reflect: true })
|
|
46
45
|
], UmFab.prototype, "color", void 0);
|
package/button/fab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,MAAM,
|
|
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,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMzC,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,YAAY;IAAhC;;QAIL;;WAEG;QACwB,UAAK,GAAe,SAAS,CAAC;QAEzD;;WAEG;QACwB,SAAI,GAAc,QAAQ,CAAC;QAEtD;;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,YAAM,GAA4B,CAAC,MAAM,CAAC,AAApC,CAAqC;AAKhC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;oCAA+B;AAK9B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;mCAA4B;AAK3B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;oCAA6B;AAKb;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;sCAAiB;AAG1D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qCAGxC;AA3BU,KAAK;IADjB,aAAa,CAAC,OAAO,CAAC;GACV,KAAK,CAqCjB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './fab.styles.js';\n\nimport { UmButtonBase } from './button-base.js';\n\nexport type UmFabColor = 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';\nexport type UmFabSize = 'small' | 'medium' | 'large';\n\n@customElement('u-fab')\nexport class UmFab extends UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [styles];\n \n /**\n * The FAB color variant to render.\n */\n @property({reflect: true}) color: UmFabColor = 'primary';\n\n /**\n * The size of the FAB.\n */\n @property({reflect: true}) size: UmFabSize = '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></slot></span>\n ${this.label ? labelTag : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-fab': UmFab;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fab.styles.d.ts","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"fab.styles.d.ts","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwLlB,CAAC"}
|
package/button/fab.styles.js
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
|
+
:host,
|
|
4
|
+
* {
|
|
5
|
+
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");
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
outline: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.focus-ring:focus-visible {
|
|
11
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
12
|
+
animation: u-focus-pulse 500ms ease;
|
|
13
|
+
animation-fill-mode: forwards;
|
|
14
|
+
outline-offset: 2px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes u-focus-pulse {
|
|
18
|
+
0% {
|
|
19
|
+
outline: 0 solid var(--_color-primary);
|
|
20
|
+
}
|
|
21
|
+
50% {
|
|
22
|
+
outline: 6px solid var(--_color-primary);
|
|
23
|
+
}
|
|
24
|
+
100% {
|
|
25
|
+
outline: 4px solid var(--_color-primary);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
:host {
|
|
29
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
30
|
+
-webkit-tap-highlight-color: transparent;
|
|
31
|
+
--u-elevation-level: 0;
|
|
32
|
+
position: relative;
|
|
33
|
+
display: inline-block;
|
|
34
|
+
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");
|
|
35
|
+
appearance: none !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([disabled]) {
|
|
39
|
+
--u-elevation-level: 0 !important;
|
|
40
|
+
background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;
|
|
41
|
+
color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([disabled]) .button {
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
* {
|
|
49
|
+
color: inherit;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
u-elevation {
|
|
53
|
+
z-index: -1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset-inline-start: 0;
|
|
60
|
+
inset-block-start: 0;
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
font-family: inherit;
|
|
64
|
+
border-radius: inherit;
|
|
65
|
+
color: inherit;
|
|
66
|
+
border: none;
|
|
67
|
+
margin: 0;
|
|
68
|
+
padding: 0;
|
|
69
|
+
text-align: center;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
background: transparent;
|
|
72
|
+
user-select: none;
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
outline: 0;
|
|
75
|
+
z-index: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.content {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
border-radius: inherit;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon {
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
width: 1em;
|
|
93
|
+
height: 1em;
|
|
94
|
+
line-height: 1em;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
::slotted([slot=icon]) {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
}
|
|
100
|
+
|
|
3
101
|
:host {
|
|
4
102
|
aspect-ratio: 1;
|
|
5
103
|
--u-elevation-level: var(--u-fab-button-elevation-level, 3);
|
package/button/fab.styles.js.map
CHANGED
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwLzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n * {\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 box-sizing: border-box;\n outline: 0;\n }\n\n .focus-ring:focus-visible {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n animation: u-focus-pulse 500ms ease;\n animation-fill-mode: forwards;\n outline-offset: 2px;\n }\n\n @keyframes u-focus-pulse {\n 0% {\n outline: 0 solid var(--_color-primary);\n }\n 50% {\n outline: 6px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n --u-elevation-level: 0;\n position: relative;\n display: inline-block;\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 appearance: none !important;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n border-radius: inherit;\n width: 100%;\n height: 100%;\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 :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"]}
|
package/button/icon-button.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CSSResult, HTMLTemplateResult
|
|
2
|
-
import '../ripple/ripple.js';
|
|
1
|
+
import { CSSResult, HTMLTemplateResult } from 'lit';
|
|
3
2
|
import { UmButtonBase } from './button-base.js';
|
|
4
3
|
export type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
5
4
|
export declare class UmIconButton extends UmButtonBase {
|
|
@@ -24,7 +23,7 @@ export declare class UmIconButton extends UmButtonBase {
|
|
|
24
23
|
private readonly selectedIcons;
|
|
25
24
|
protected renderContent(): HTMLTemplateResult;
|
|
26
25
|
protected handleClick(event: UIEvent): void;
|
|
27
|
-
getAriaLabel(): string | null
|
|
26
|
+
getAriaLabel(): string | null;
|
|
28
27
|
private handleSlotChange;
|
|
29
28
|
}
|
|
30
29
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAK1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/E,qBACa,YAAa,SAAQ,YAAY;IAE5C,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAAY;IAEhC,OAAO,EAAE,mBAAmB,CAAc;IAErE;;;OAGG;IACwB,MAAM,UAAS;IAEiC,gBAAgB,UAAS;IAEpG;;;;OAIG;IACuC,QAAQ,UAAS;IAE3D;;OAEG;IAC2C,iBAAiB,SAAM;IAGrE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;cAUnC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAW3C,YAAY,IAAI,MAAM,GAAG,IAAI;IAMtC,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
package/button/icon-button.js
CHANGED
|
@@ -6,10 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html } from 'lit';
|
|
8
8
|
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
-
import '../ripple/ripple.js';
|
|
10
|
-
import { styles as buttonWrapperStyles } from '../shared/button-wrapper.styles.js';
|
|
11
|
-
import { UmButtonBase } from './button-base.js';
|
|
12
9
|
import { styles } from './icon-button.styles.js';
|
|
10
|
+
import { UmButtonBase } from './button-base.js';
|
|
13
11
|
let UmIconButton = class UmIconButton extends UmButtonBase {
|
|
14
12
|
constructor() {
|
|
15
13
|
super(...arguments);
|
|
@@ -41,9 +39,11 @@ let UmIconButton = class UmIconButton extends UmButtonBase {
|
|
|
41
39
|
}
|
|
42
40
|
handleClick(event) {
|
|
43
41
|
super.handleClick(event);
|
|
44
|
-
if (this.toggle) {
|
|
45
|
-
|
|
42
|
+
if (!this.toggle) {
|
|
43
|
+
return;
|
|
46
44
|
}
|
|
45
|
+
this.selected = !this.selected;
|
|
46
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
47
47
|
}
|
|
48
48
|
getAriaLabel() {
|
|
49
49
|
return this.selected
|
|
@@ -54,7 +54,7 @@ let UmIconButton = class UmIconButton extends UmButtonBase {
|
|
|
54
54
|
this.hasSelectionIcon = this.selectedIcons.length > 0;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
UmIconButton.styles = [
|
|
57
|
+
UmIconButton.styles = [styles];
|
|
58
58
|
__decorate([
|
|
59
59
|
property({ reflect: true })
|
|
60
60
|
], UmIconButton.prototype, "variant", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKzC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,YAAY;IAAvC;;QAIsB,YAAO,GAAwB,UAAU,CAAC;QAErE;;;WAGG;QACwB,WAAM,GAAG,KAAK,CAAC;QAEiC,qBAAgB,GAAG,KAAK,CAAC;QAEpG;;;;WAIG;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE3D;;WAEG;QAC2C,sBAAiB,GAAG,EAAE,CAAC;IAmCvE,CAAC;IA9BoB,aAAa;QAE9B,OAAO,IAAI,CAAA;;;6CAG8B,IAAI,CAAC,gBAAgB;;KAE7D,CAAC;IACJ,CAAC;IAEkB,WAAW,CAAC,KAAc;QAC3C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAEQ,YAAY;QACnB,OAAO,IAAI,CAAC,QAAQ;YAClB,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,KAAK,CAAC,YAAY,EAAE;YAChD,CAAC,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IAC3B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACxD,CAAC;;AAxDe,mBAAM,GAA4B,CAAC,MAAM,CAAC,AAApC,CAAqC;AAEhC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;6CAA2C;AAM1C;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAgB;AAEiC;IAA1E,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;sDAA0B;AAO1D;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAkB;AAKb;IAA7C,QAAQ,CAAC,EAAC,SAAS,EAAE,qBAAqB,EAAC,CAAC;uDAAwB;AAGpD;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDACV;AA3BpC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA2DxB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { styles } from './icon-button.styles.js';\n\nimport { UmButtonBase } from './button-base.js';\n\nexport type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';\n\n@customElement('u-icon-button')\nexport class UmIconButton extends UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [styles];\n\n @property({reflect: true}) variant: UmIconButtonVariant = 'standard';\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({type: Boolean}) toggle = false;\n\n @property({type: Boolean, attribute: 'has-selection-icon', reflect: true}) hasSelectionIcon = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';\n\n @queryAssignedElements({slot: 'selected', flatten: true})\n private readonly selectedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n\n return html`\n <span class=\"icon\" aria-hidden=\"true\"><slot></slot></span>\n <span class=\"icon icon-selected\" aria-hidden=\"true\">\n <slot name=\"selected\" @slotchange=\"${this.handleSlotChange}\"></slot>\n </span>\n `;\n }\n\n protected override handleClick(event: UIEvent): void {\n super.handleClick(event);\n\n if (!this.toggle) {\n return;\n }\n\n this.selected = !this.selected;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n override getAriaLabel(): string | null {\n return this.selected\n ? this.ariaLabelSelected || super.getAriaLabel()\n : super.getAriaLabel();\n }\n\n private handleSlotChange() {\n this.hasSelectionIcon = this.selectedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-icon-button': UmIconButton;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.styles.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"icon-button.styles.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4KlB,CAAC"}
|