@universal-material/web 3.0.28 → 3.0.29
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/app-bar/top-app-bar.styles.js +1 -1
- package/app-bar/top-app-bar.styles.js.map +1 -1
- package/button/button.js +1 -1
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts.map +1 -1
- package/button/button.styles.js +10 -5
- package/button/button.styles.js.map +1 -1
- package/button/icon-button.styles.d.ts.map +1 -1
- package/button/icon-button.styles.js +10 -3
- package/button/icon-button.styles.js.map +1 -1
- package/card/card.styles.d.ts.map +1 -1
- package/card/card.styles.js +0 -4
- package/card/card.styles.js.map +1 -1
- package/checkbox/checkbox-list-item.d.ts +11 -0
- package/checkbox/checkbox-list-item.d.ts.map +1 -0
- package/checkbox/checkbox-list-item.js +16 -0
- package/checkbox/checkbox-list-item.js.map +1 -0
- package/checkbox/checkbox.d.ts +13 -8
- package/checkbox/checkbox.d.ts.map +1 -1
- package/checkbox/checkbox.js +51 -52
- package/checkbox/checkbox.js.map +1 -1
- package/{container/container.styles.d.ts → checkbox/checkbox.styles.d.ts} +1 -1
- package/checkbox/checkbox.styles.d.ts.map +1 -0
- package/checkbox/checkbox.styles.js +126 -0
- package/checkbox/checkbox.styles.js.map +1 -0
- package/config.d.ts +3 -0
- package/config.d.ts.map +1 -1
- package/config.js +3 -0
- package/config.js.map +1 -1
- package/css/universal-material.css +3343 -327
- package/css/universal-material.min.css +2 -2
- package/custom-elements.json +3988 -2145
- package/field/field.d.ts +57 -0
- package/field/field.d.ts.map +1 -0
- package/field/field.js +167 -0
- package/field/field.js.map +1 -0
- package/{divider/divider.styles.d.ts → field/field.styles.d.ts} +1 -1
- package/field/field.styles.d.ts.map +1 -0
- package/field/field.styles.js +289 -0
- package/field/field.styles.js.map +1 -0
- package/index.d.ts +35 -26
- package/index.d.ts.map +1 -1
- package/index.js +35 -26
- package/index.js.map +1 -1
- package/list/list-item.d.ts +13 -0
- package/list/list-item.d.ts.map +1 -0
- package/list/list-item.js +33 -0
- package/list/list-item.js.map +1 -0
- package/{container/grid-base.styles.d.ts → list/list-item.styles.d.ts} +1 -1
- package/list/list-item.styles.d.ts.map +1 -0
- package/list/list-item.styles.js +22 -0
- package/list/list-item.styles.js.map +1 -0
- package/list/list.d.ts +11 -0
- package/list/list.d.ts.map +1 -0
- package/{container/container.js → list/list.js} +9 -16
- package/list/list.js.map +1 -0
- package/{container/grid.styles.d.ts → list/list.styles.d.ts} +1 -1
- package/list/list.styles.d.ts.map +1 -0
- package/list/list.styles.js +7 -0
- package/list/list.styles.js.map +1 -0
- package/menu/menu-item.d.ts +2 -0
- package/menu/menu-item.d.ts.map +1 -1
- package/menu/menu-item.js +6 -1
- package/menu/menu-item.js.map +1 -1
- package/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +8 -4
- package/menu/menu.js.map +1 -1
- package/navigation/drawer-item.d.ts +1 -0
- package/navigation/drawer-item.d.ts.map +1 -1
- package/navigation/drawer-item.js +5 -1
- package/navigation/drawer-item.js.map +1 -1
- package/navigation/drawer-item.styles.d.ts.map +1 -1
- package/navigation/drawer-item.styles.js +3 -0
- package/navigation/drawer-item.styles.js.map +1 -1
- package/navigation/drawer.styles.js +1 -1
- package/navigation/drawer.styles.js.map +1 -1
- package/package.json +3 -3
- package/radio/radio-list-item.d.ts +11 -0
- package/radio/radio-list-item.d.ts.map +1 -0
- package/radio/radio-list-item.js +16 -0
- package/radio/radio-list-item.js.map +1 -0
- package/radio/radio.d.ts +24 -0
- package/radio/radio.d.ts.map +1 -0
- package/radio/radio.js +136 -0
- package/radio/radio.js.map +1 -0
- package/radio/radio.styles.d.ts +2 -0
- package/radio/radio.styles.d.ts.map +1 -0
- package/radio/radio.styles.js +97 -0
- package/radio/radio.styles.js.map +1 -0
- package/ripple/ripple.styles.js +1 -1
- package/ripple/ripple.styles.js.map +1 -1
- package/scss/_colors.scss +2 -0
- package/scss/_css-vars.scss +26 -12
- package/scss/_functions.scss +4 -0
- package/scss/_global.scss +23 -0
- package/scss/_layout.scss +5 -0
- package/scss/_reboot.scss +495 -0
- package/scss/_utilities.scss +3 -0
- package/scss/_variables.scss +32 -4
- package/scss/{text-bg → colors}/_text.scss +1 -22
- package/scss/layout/_container.scss +13 -0
- package/scss/layout/_grid.scss +6 -0
- package/scss/layout/_margin-and-gutters.scss +37 -0
- package/scss/mixins/_breakpoints.scss +51 -1
- package/scss/mixins/_text-bg.scss +4 -6
- package/scss/mixins/_typo.scss +18 -0
- package/scss/table/_table.scss +47 -0
- package/scss/universal-material.scss +11 -4
- package/scss/utilities/_divider.scss +13 -0
- package/scss/utilities/_spacing.scss +23 -0
- package/scss/utilities/_text.scss +21 -0
- package/shared/base.styles.js +5 -5
- package/shared/base.styles.js.map +1 -1
- package/shared/button-wrapper.d.ts +2 -1
- package/shared/button-wrapper.d.ts.map +1 -1
- package/shared/button-wrapper.js +8 -2
- package/shared/button-wrapper.js.map +1 -1
- package/shared/button-wrapper.styles.js +2 -2
- package/shared/button-wrapper.styles.js.map +1 -1
- package/shared/selection-control/selection-control-list-item.d.ts +5 -0
- package/shared/selection-control/selection-control-list-item.d.ts.map +1 -0
- package/shared/selection-control/selection-control-list-item.js +25 -0
- package/shared/selection-control/selection-control-list-item.js.map +1 -0
- package/shared/selection-control/selection-control.d.ts +25 -0
- package/shared/selection-control/selection-control.d.ts.map +1 -0
- package/shared/selection-control/selection-control.js +93 -0
- package/shared/selection-control/selection-control.js.map +1 -0
- package/shared/selection-control/selection-control.styles.d.ts +2 -0
- package/shared/selection-control/selection-control.styles.d.ts.map +1 -0
- package/shared/selection-control/selection-control.styles.js +67 -0
- package/shared/selection-control/selection-control.styles.js.map +1 -0
- package/snackbar/snackbar.d.ts +1 -1
- package/snackbar/snackbar.d.ts.map +1 -1
- package/snackbar/snackbar.js +1 -1
- package/snackbar/snackbar.js.map +1 -1
- package/switch/switch-list-item.d.ts +11 -0
- package/switch/switch-list-item.d.ts.map +1 -0
- package/switch/switch-list-item.js +16 -0
- package/switch/switch-list-item.js.map +1 -0
- package/switch/switch.d.ts +14 -0
- package/switch/switch.d.ts.map +1 -0
- package/switch/switch.js +33 -0
- package/switch/switch.js.map +1 -0
- package/switch/switch.styles.d.ts +2 -0
- package/switch/switch.styles.d.ts.map +1 -0
- package/switch/switch.styles.js +142 -0
- package/switch/switch.styles.js.map +1 -0
- package/text-field/text-field.d.ts +23 -0
- package/text-field/text-field.d.ts.map +1 -0
- package/text-field/text-field.js +91 -0
- package/text-field/text-field.js.map +1 -0
- package/text-field/text-field.styles.d.ts +2 -0
- package/text-field/text-field.styles.d.ts.map +1 -0
- package/text-field/text-field.styles.js +5 -0
- package/text-field/text-field.styles.js.map +1 -0
- package/theme/index.d.ts +1 -1
- package/theme/index.d.ts.map +1 -1
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
- package/theme/theme-builder.d.ts.map +1 -1
- package/theme/theme-builder.js +3 -1
- package/theme/theme-builder.js.map +1 -1
- package/container/container.d.ts +0 -12
- package/container/container.d.ts.map +0 -1
- package/container/container.js.map +0 -1
- package/container/container.styles.d.ts.map +0 -1
- package/container/container.styles.js +0 -12
- package/container/container.styles.js.map +0 -1
- package/container/grid-base.d.ts +0 -11
- package/container/grid-base.d.ts.map +0 -1
- package/container/grid-base.js +0 -33
- package/container/grid-base.js.map +0 -1
- package/container/grid-base.styles.d.ts.map +0 -1
- package/container/grid-base.styles.js +0 -114
- package/container/grid-base.styles.js.map +0 -1
- package/container/grid.d.ts +0 -32
- package/container/grid.d.ts.map +0 -1
- package/container/grid.js +0 -106
- package/container/grid.js.map +0 -1
- package/container/grid.styles.d.ts.map +0 -1
- package/container/grid.styles.js +0 -134
- package/container/grid.styles.js.map +0 -1
- package/divider/divider.d.ts +0 -14
- package/divider/divider.d.ts.map +0 -1
- package/divider/divider.js +0 -27
- package/divider/divider.js.map +0 -1
- package/divider/divider.styles.d.ts.map +0 -1
- package/divider/divider.styles.js +0 -15
- package/divider/divider.styles.js.map +0 -1
- package/scss/_common.scss +0 -12
- package/scss/data-table/_data-table.scss +0 -33
- package/scss/data-table/_variables.scss +0 -24
- /package/scss/{text-bg → colors}/_text-bg.scss +0 -0
package/radio/radio.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropertyValues } from '@lit/reactive-element';
|
|
2
|
+
import { HTMLTemplateResult } from 'lit';
|
|
3
|
+
import { UmSelectionControl } from '../shared/selection-control/selection-control.js';
|
|
4
|
+
export declare class UmRadio extends UmSelectionControl {
|
|
5
|
+
#private;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
hideStateLayer: boolean;
|
|
8
|
+
protected inputType: 'radio' | 'checkbox';
|
|
9
|
+
protected renderIndicator(): HTMLTemplateResult;
|
|
10
|
+
get checked(): boolean;
|
|
11
|
+
set checked(value: boolean);
|
|
12
|
+
constructor();
|
|
13
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
private ensureOnlyOneChecked;
|
|
17
|
+
private uncheckSiblings;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'u-radio': UmRadio;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAGtF,qBACa,OAAQ,SAAQ,kBAAkB;;IAC7C,OAAgB,MAAM,4BAGpB;IAEuE,cAAc,UAAS;IAEhG,UAAmB,SAAS,EAAE,OAAO,GAAG,UAAU,CAAW;cAE1C,eAAe,IAAI,kBAAkB;IAIxD,IAAa,OAAO,IAGQ,OAAO,CADlC;IACD,IAAa,OAAO,CAAC,KAAK,EAAE,OAAO,EAYlC;;IAeQ,YAAY,CAAC,iBAAiB,EAAE,cAAc;IAM9C,iBAAiB;IAKjB,oBAAoB;IAuD7B,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,eAAe;CAaxB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,OAAO,CAAC;KACpB;CACF"}
|
package/radio/radio.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _UmRadio_instances, _UmRadio_siblings_get, _UmRadio_handleKeyDown;
|
|
13
|
+
import { html } from 'lit';
|
|
14
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
15
|
+
import { styles as baseStyles } from '../shared/base.styles.js';
|
|
16
|
+
import { UmSelectionControl } from '../shared/selection-control/selection-control.js';
|
|
17
|
+
import { styles } from './radio.styles.js';
|
|
18
|
+
let UmRadio = class UmRadio extends UmSelectionControl {
|
|
19
|
+
renderIndicator() {
|
|
20
|
+
return html `<div class="indicator"></div>`;
|
|
21
|
+
}
|
|
22
|
+
get checked() {
|
|
23
|
+
return super.checked;
|
|
24
|
+
}
|
|
25
|
+
set checked(value) {
|
|
26
|
+
super.checked = value;
|
|
27
|
+
if (!value) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.uncheckSiblings();
|
|
31
|
+
if (this.input) {
|
|
32
|
+
this.input.tabIndex = 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
_UmRadio_instances.add(this);
|
|
38
|
+
this.hideStateLayer = false;
|
|
39
|
+
this.inputType = 'radio';
|
|
40
|
+
}
|
|
41
|
+
firstUpdated(changedProperties) {
|
|
42
|
+
super.firstUpdated(changedProperties);
|
|
43
|
+
this.ensureOnlyOneChecked();
|
|
44
|
+
}
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
super.connectedCallback();
|
|
47
|
+
this.addEventListener('keydown', __classPrivateFieldGet(this, _UmRadio_instances, "m", _UmRadio_handleKeyDown));
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
super.disconnectedCallback();
|
|
51
|
+
this.removeEventListener('keydown', __classPrivateFieldGet(this, _UmRadio_instances, "m", _UmRadio_handleKeyDown));
|
|
52
|
+
}
|
|
53
|
+
ensureOnlyOneChecked() {
|
|
54
|
+
if (!this.name) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const radios = [...document.querySelectorAll(`${this.tagName}[name="${this.name}"]`)];
|
|
58
|
+
const lastChecked = radios
|
|
59
|
+
.reverse()
|
|
60
|
+
.find(r => r.checked);
|
|
61
|
+
if (!lastChecked) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
lastChecked.checked = true;
|
|
65
|
+
}
|
|
66
|
+
uncheckSiblings() {
|
|
67
|
+
for (const radio of __classPrivateFieldGet(this, _UmRadio_instances, "a", _UmRadio_siblings_get)) {
|
|
68
|
+
if (radio === this) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (radio.input) {
|
|
72
|
+
radio.input.tabIndex = -1;
|
|
73
|
+
}
|
|
74
|
+
radio.checked = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
_UmRadio_instances = new WeakSet();
|
|
79
|
+
_UmRadio_siblings_get = function _UmRadio_siblings_get() {
|
|
80
|
+
if (!this.name) {
|
|
81
|
+
return [this];
|
|
82
|
+
}
|
|
83
|
+
return Array
|
|
84
|
+
.from(this.getRootNode().querySelectorAll(`${this.tagName}[name="${this.name}"]`));
|
|
85
|
+
};
|
|
86
|
+
_UmRadio_handleKeyDown = function _UmRadio_handleKeyDown(event) {
|
|
87
|
+
const isDown = event.key === 'ArrowDown';
|
|
88
|
+
const isUp = event.key === 'ArrowUp';
|
|
89
|
+
const isLeft = event.key === 'ArrowLeft';
|
|
90
|
+
const isRight = event.key === 'ArrowRight';
|
|
91
|
+
if (!isLeft && !isRight && !isDown && !isUp) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Don't try to select another sibling if there aren't any.
|
|
95
|
+
const siblings = __classPrivateFieldGet(this, _UmRadio_instances, "a", _UmRadio_siblings_get);
|
|
96
|
+
if (!siblings.length) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
const isRtl = getComputedStyle(this).direction === 'rtl';
|
|
101
|
+
const forwards = isRtl ? isLeft || isDown : isRight || isDown;
|
|
102
|
+
const factor = forwards ? 1 : -1;
|
|
103
|
+
const thisIndex = siblings.indexOf(this);
|
|
104
|
+
let nextIndex = thisIndex + factor;
|
|
105
|
+
while (nextIndex !== thisIndex) {
|
|
106
|
+
if (nextIndex >= siblings.length) {
|
|
107
|
+
// Return to start if moving past the last item.
|
|
108
|
+
nextIndex = 0;
|
|
109
|
+
}
|
|
110
|
+
else if (nextIndex < 0) {
|
|
111
|
+
// Go to end if moving before the first item.
|
|
112
|
+
nextIndex = siblings.length - 1;
|
|
113
|
+
}
|
|
114
|
+
const nextSibling = siblings[nextIndex];
|
|
115
|
+
if (nextSibling.disabled) {
|
|
116
|
+
nextIndex += factor;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
nextSibling.checked = true;
|
|
120
|
+
nextSibling.input.focus();
|
|
121
|
+
nextSibling.dispatchEvent(new Event('change', { bubbles: true }));
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
UmRadio.styles = [
|
|
126
|
+
baseStyles,
|
|
127
|
+
styles
|
|
128
|
+
];
|
|
129
|
+
__decorate([
|
|
130
|
+
property({ type: Boolean, attribute: 'hide-state-layer', reflect: true })
|
|
131
|
+
], UmRadio.prototype, "hideStateLayer", void 0);
|
|
132
|
+
UmRadio = __decorate([
|
|
133
|
+
customElement('u-radio')
|
|
134
|
+
], UmRadio);
|
|
135
|
+
export { UmRadio };
|
|
136
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGpC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,kBAAkB;IAU1B,eAAe;QAChC,OAAO,IA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AAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAwB;AANrF,OAAO;IADnB,aAAa,CAAC,SAAS,CAAC;GACZ,OAAO,CA4InB","sourcesContent":["import { PropertyValues } from '@lit/reactive-element';\nimport { html, HTMLTemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { UmSelectionControl } from '../shared/selection-control/selection-control.js';\nimport { styles } from './radio.styles.js';\n\n@customElement('u-radio')\nexport class UmRadio extends UmSelectionControl {\n static override styles = [\n baseStyles,\n styles\n ];\n\n @property({type: Boolean, attribute: 'hide-state-layer', reflect: true}) hideStateLayer = false;\n\n protected override inputType: 'radio' | 'checkbox' = 'radio';\n\n protected override renderIndicator(): HTMLTemplateResult {\n return html`<div class=\"indicator\"></div>`;\n }\n\n override get checked() {\n return super.checked;\n }\n override set checked(value: boolean) {\n super.checked = value;\n\n if (!value) {\n return;\n }\n\n this.uncheckSiblings();\n\n if (this.input) {\n this.input.tabIndex = 0\n }\n }\n\n get #siblings(): UmRadio[] {\n if (!this.name) {\n return [this];\n }\n\n return Array\n .from((<Element>this.getRootNode()).querySelectorAll<UmRadio>(`${this.tagName}[name=\"${this.name}\"]`));\n }\n\n constructor() {\n super();\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n\n this.ensureOnlyOneChecked();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('keydown', this.#handleKeyDown);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.#handleKeyDown);\n }\n\n #handleKeyDown(event: KeyboardEvent) {\n const isDown = event.key === 'ArrowDown';\n const isUp = event.key === 'ArrowUp';\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n\n if (!isLeft && !isRight && !isDown && !isUp) {\n return;\n }\n\n // Don't try to select another sibling if there aren't any.\n const siblings = this.#siblings;\n\n if (!siblings.length) {\n return;\n }\n\n event.preventDefault();\n\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const forwards = isRtl ? isLeft || isDown : isRight || isDown;\n const factor = forwards ? 1 : -1;\n\n const thisIndex = siblings.indexOf(this);\n let nextIndex = thisIndex + factor;\n\n while (nextIndex !== thisIndex) {\n if (nextIndex >= siblings.length) {\n // Return to start if moving past the last item.\n nextIndex = 0;\n } else if (nextIndex < 0) {\n // Go to end if moving before the first item.\n nextIndex = siblings.length - 1;\n }\n\n const nextSibling = siblings[nextIndex];\n\n if (nextSibling.disabled) {\n nextIndex += factor;\n\n continue;\n }\n\n nextSibling.checked = true;\n nextSibling.input.focus();\n nextSibling.dispatchEvent(new Event('change', {bubbles: true}));\n break;\n }\n }\n\n private ensureOnlyOneChecked() {\n if (!this.name) {\n return;\n }\n\n const radios = [...document.querySelectorAll<UmRadio>(`${this.tagName}[name=\"${this.name}\"]`)]\n const lastChecked = radios\n .reverse()\n .find(r => r.checked);\n\n if (!lastChecked) {\n return;\n }\n\n lastChecked.checked = true;\n }\n\n private uncheckSiblings() {\n for (const radio of this.#siblings) {\n if (radio === this) {\n continue;\n }\n\n if (radio.input) {\n radio.input.tabIndex = -1;\n }\n\n radio.checked = false;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-radio': UmRadio;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.styles.d.ts","sourceRoot":"","sources":["../../src/radio/radio.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA8FlB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_state-layer-padding: var(--u-radio-state-layer-padding, 4px);
|
|
5
|
+
--_input-size: calc(var(--_width) - var(--_state-layer-padding) * 2);
|
|
6
|
+
--_indicator-color: var(--u-radio-indicator-unselected-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
7
|
+
display: inline-block;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: var(--_width);
|
|
15
|
+
height: var(--_height);
|
|
16
|
+
padding: var(--_state-layer-padding);
|
|
17
|
+
border-radius: var(--u-shape-corner-full, 9999px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([hide-state-layer]) .container {
|
|
21
|
+
width: var(--_indicator-size);
|
|
22
|
+
height: var(--_indicator-size);
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
:host([hide-state-layer]) u-ripple {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
padding: 0;
|
|
34
|
+
margin: 0;
|
|
35
|
+
border-radius: inherit;
|
|
36
|
+
appearance: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
u-ripple {
|
|
40
|
+
padding: var(--_state-layer-padding);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.indicator-container {
|
|
44
|
+
position: absolute;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
inset: 0;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
input:checked ~ .indicator-container {
|
|
53
|
+
--_indicator-color: var(--u-radio-indicator-unselected-color, var(--u-color-primary, rgb(103, 80, 164)));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([disabled]) {
|
|
57
|
+
opacity: var(--u-radio-disabled-state-opacity, 0.38);
|
|
58
|
+
}
|
|
59
|
+
:host([disabled]) input,
|
|
60
|
+
:host([disabled]) .container {
|
|
61
|
+
cursor: default;
|
|
62
|
+
}
|
|
63
|
+
:host([disabled]) .indicator-container {
|
|
64
|
+
--_indicator-color: var(--u-radio-indicator-disabled-color, var(--u-color-on-surface, rgb(29, 27, 32)));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host {
|
|
68
|
+
--_indicator-size: var(--u-radio-indicator-size, 1.25rem);
|
|
69
|
+
--_width: var(--u-radio-size, 3rem);
|
|
70
|
+
--_height: var(--_width);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.indicator {
|
|
74
|
+
position: relative;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: var(--_indicator-size);
|
|
79
|
+
height: var(--_indicator-size);
|
|
80
|
+
border: var(--u-radio-indicator-border-width, 0.125rem) solid var(--_indicator-color);
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
}
|
|
83
|
+
.indicator::before {
|
|
84
|
+
content: "";
|
|
85
|
+
width: calc(var(--_indicator-size) / 2);
|
|
86
|
+
height: calc(var(--_indicator-size) / 2);
|
|
87
|
+
background: var(--_indicator-color);
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
transition: transform 250ms;
|
|
90
|
+
transform: scale3d(0, 0, 1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
input:checked ~ .indicator-container .indicator::before {
|
|
94
|
+
transform: scale3d(1, 1, 1);
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
//# sourceMappingURL=radio.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.styles.js","sourceRoot":"","sources":["../../src/radio/radio.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_state-layer-padding: var(--u-radio-state-layer-padding, 4px);\n --_input-size: calc(var(--_width) - var(--_state-layer-padding) * 2);\n --_indicator-color: var(--u-radio-indicator-unselected-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n display: inline-block;\n vertical-align: middle;\n }\n\n .container {\n cursor: pointer;\n position: relative;\n width: var(--_width);\n height: var(--_height);\n padding: var(--_state-layer-padding);\n border-radius: var(--u-shape-corner-full, 9999px);\n }\n\n :host([hide-state-layer]) .container {\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n padding: 0;\n }\n :host([hide-state-layer]) u-ripple {\n display: none;\n }\n\n input {\n cursor: pointer;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n border-radius: inherit;\n appearance: none;\n }\n\n u-ripple {\n padding: var(--_state-layer-padding);\n }\n\n .indicator-container {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n inset: 0;\n pointer-events: none;\n }\n\n input:checked ~ .indicator-container {\n --_indicator-color: var(--u-radio-indicator-unselected-color, var(--u-color-primary, rgb(103, 80, 164)));\n }\n\n :host([disabled]) {\n opacity: var(--u-radio-disabled-state-opacity, 0.38);\n }\n :host([disabled]) input,\n :host([disabled]) .container {\n cursor: default;\n }\n :host([disabled]) .indicator-container {\n --_indicator-color: var(--u-radio-indicator-disabled-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n }\n\n :host {\n --_indicator-size: var(--u-radio-indicator-size, 1.25rem);\n --_width: var(--u-radio-size, 3rem);\n --_height: var(--_width);\n }\n\n .indicator {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--_indicator-size);\n height: var(--_indicator-size);\n border: var(--u-radio-indicator-border-width, 0.125rem) solid var(--_indicator-color);\n border-radius: 50%;\n }\n .indicator::before {\n content: \"\";\n width: calc(var(--_indicator-size) / 2);\n height: calc(var(--_indicator-size) / 2);\n background: var(--_indicator-color);\n border-radius: 50%;\n transition: transform 250ms;\n transform: scale3d(0, 0, 1);\n }\n\n input:checked ~ .indicator-container .indicator::before {\n transform: scale3d(1, 1, 1);\n }\n`;\n"]}
|
package/ripple/ripple.styles.js
CHANGED
|
@@ -4,7 +4,7 @@ export const styles = css `
|
|
|
4
4
|
.ripple-container::before {
|
|
5
5
|
--_ripple-hover-color: var(--u-ripple-hover-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));
|
|
6
6
|
--_ripple-pressed-color: var(--u-ripple-pressed-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));
|
|
7
|
-
--_ripple-hover-opacity: var(--u-ripple-pressed-opacity, .08);
|
|
7
|
+
--_ripple-hover-opacity: var(--u-ripple-pressed-opacity, var(--u-state-hover-opacity, 0.08));
|
|
8
8
|
--_ripple-pressed-opacity: var(--u-ripple-pressed-opacity, .2);
|
|
9
9
|
display: block;
|
|
10
10
|
inset: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ripple.styles.js","sourceRoot":"","sources":["../../src/ripple/ripple.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n .ripple-container::before {\n --_ripple-hover-color: var(--u-ripple-hover-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));\n --_ripple-pressed-color: var(--u-ripple-pressed-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));\n --_ripple-hover-opacity: var(--u-ripple-pressed-opacity, .08);\n --_ripple-pressed-opacity: var(--u-ripple-pressed-opacity, .2);\n display: block;\n inset: 0;\n isolation: isolate;\n }\n\n .ripple-container {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n border-radius: inherit;\n }\n\n .ripple-container::before {\n content: \"\";\n background: var(--_ripple-hover-color);\n opacity: 0;\n transition: opacity 200ms;\n }\n\n @media (hover: hover) {\n :host(:not([disabled]):hover) .ripple-container::before {\n content: \"\";\n background: var(--_ripple-hover-color);\n opacity: var(--_ripple-hover-opacity);\n }\n }\n :host,\n .ripple-container::before,\n .ripple {\n position: absolute;\n border-radius: inherit;\n }\n\n .ripple {\n top: 50%;\n left: 50%;\n background: var(--_ripple-pressed-color);\n border-radius: 50%;\n box-shadow: 0 0 64px 64px var(--_ripple-pressed-color);\n opacity: var(--_ripple-pressed-opacity);\n transform: scale3d(0, 0, 1);\n pointer-events: none;\n will-change: transform;\n }\n .ripple.show {\n transition: transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) cubic-bezier(0.19, 1, 0.22, 1), opacity calc(750ms / var(--u-ripple-speed, 1));\n transform: scale3d(1, 1, 1);\n }\n .ripple.show-forced {\n transition: transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) cubic-bezier(0.19, 1, 0.22, 1), opacity calc(200ms / var(--u-ripple-speed, 1)) 300ms;\n transform: scale3d(2, 2, 1);\n opacity: 0;\n }\n .ripple.dismiss {\n opacity: 0;\n transform: scale3d(2, 2, 1);\n }\n\n ::slotted(*) {\n position: absolute !important;\n inset: 0;\n border-radius: inherit;\n }\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"ripple.styles.js","sourceRoot":"","sources":["../../src/ripple/ripple.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host,\n .ripple-container::before {\n --_ripple-hover-color: var(--u-ripple-hover-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));\n --_ripple-pressed-color: var(--u-ripple-pressed-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));\n --_ripple-hover-opacity: var(--u-ripple-pressed-opacity, var(--u-state-hover-opacity, 0.08));\n --_ripple-pressed-opacity: var(--u-ripple-pressed-opacity, .2);\n display: block;\n inset: 0;\n isolation: isolate;\n }\n\n .ripple-container {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n border-radius: inherit;\n }\n\n .ripple-container::before {\n content: \"\";\n background: var(--_ripple-hover-color);\n opacity: 0;\n transition: opacity 200ms;\n }\n\n @media (hover: hover) {\n :host(:not([disabled]):hover) .ripple-container::before {\n content: \"\";\n background: var(--_ripple-hover-color);\n opacity: var(--_ripple-hover-opacity);\n }\n }\n :host,\n .ripple-container::before,\n .ripple {\n position: absolute;\n border-radius: inherit;\n }\n\n .ripple {\n top: 50%;\n left: 50%;\n background: var(--_ripple-pressed-color);\n border-radius: 50%;\n box-shadow: 0 0 64px 64px var(--_ripple-pressed-color);\n opacity: var(--_ripple-pressed-opacity);\n transform: scale3d(0, 0, 1);\n pointer-events: none;\n will-change: transform;\n }\n .ripple.show {\n transition: transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) cubic-bezier(0.19, 1, 0.22, 1), opacity calc(750ms / var(--u-ripple-speed, 1));\n transform: scale3d(1, 1, 1);\n }\n .ripple.show-forced {\n transition: transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) cubic-bezier(0.19, 1, 0.22, 1), opacity calc(200ms / var(--u-ripple-speed, 1)) 300ms;\n transform: scale3d(2, 2, 1);\n opacity: 0;\n }\n .ripple.dismiss {\n opacity: 0;\n transform: scale3d(2, 2, 1);\n }\n\n ::slotted(*) {\n position: absolute !important;\n inset: 0;\n border-radius: inherit;\n }\n`;\n"]}
|
package/scss/_css-vars.scss
CHANGED
|
@@ -6,23 +6,29 @@
|
|
|
6
6
|
|
|
7
7
|
:root {
|
|
8
8
|
--u-state-layer-color: currentColor;
|
|
9
|
-
--u-
|
|
10
|
-
--u-
|
|
11
|
-
--u-
|
|
12
|
-
--u-
|
|
13
|
-
|
|
14
|
-
--u-disabled-state-label-opacity: .57;
|
|
15
|
-
--u-disabled-state-opacity: .38;
|
|
9
|
+
--u-state-layer-hover-opacity: .08;
|
|
10
|
+
--u-state-layer-focus-opacity: .12;
|
|
11
|
+
--u-state-layer-pressed-opacity: .12;
|
|
12
|
+
--u-state-layer-dragged-opacity: .16;
|
|
13
|
+
|
|
16
14
|
--u-high-emphasis-opacity: 1;
|
|
17
15
|
--u-low-emphasis-opacity: .75;
|
|
18
16
|
--u-lower-emphasis-opacity: .5;
|
|
19
|
-
--u-color-background: #{functions.get-color-var(surface)};
|
|
20
|
-
--u-color-on-background: #{functions.get-color-var(on-surface)};
|
|
21
|
-
--u-color-background-rgb: #{functions.get-color-rgb-var(surface)};
|
|
22
|
-
--u-color-on-background-rgb: #{functions.get-color-rgb-var(on-surface)};
|
|
23
17
|
|
|
24
|
-
--u-
|
|
18
|
+
--u-color-body: #{functions.get-color-var(surface)};
|
|
19
|
+
--u-color-on-body: #{functions.get-color-var(on-surface)};
|
|
20
|
+
--u-color-body-rgb: #{functions.get-color-rgb-var(surface)};
|
|
21
|
+
--u-color-on-body-rgb: #{functions.get-color-rgb-var(on-surface)};
|
|
22
|
+
|
|
23
|
+
--u-font-family: #{variables.$font-family};
|
|
24
|
+
--u-font-monospace: #{variables.$font-mono};
|
|
25
|
+
--u-current-text-color: var(--u-color-on-body);
|
|
26
|
+
--u-current-text-color-rgb: var(--u-color-on-body-rgb);
|
|
25
27
|
--u-text-opacity: var(--u-high-emphasis-opacity);
|
|
28
|
+
--u-layout-margin: var(--u-layout-margin-default);
|
|
29
|
+
--u-layout-gutter: var(--u-layout-gutter-default);
|
|
30
|
+
--u-layout-margin-default: var(--u-spacing-medium);
|
|
31
|
+
--u-layout-gutter-default: var(--u-spacing-medium);
|
|
26
32
|
|
|
27
33
|
@each $name, $value in variables.$font-weights {
|
|
28
34
|
--u-font-weight-#{$name}: #{$value};
|
|
@@ -36,3 +42,11 @@
|
|
|
36
42
|
--u-shape-corner-#{$name}: #{$value};
|
|
37
43
|
}
|
|
38
44
|
}
|
|
45
|
+
|
|
46
|
+
@include mixins.media-breakpoint-up(sm) {
|
|
47
|
+
|
|
48
|
+
:root {
|
|
49
|
+
--u-layout-margin-default: var(--u-spacing-large);
|
|
50
|
+
--u-layout-gutter-default: var(--u-spacing-large);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/scss/_functions.scss
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
@return var(--u-spacing-#{$name}, map.get(variables.$spacings, $name));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
@function get-state-layer-opacity-var($name) {
|
|
24
|
+
@return var(--u-state-#{$name}-opacity, map.get(variables.$state-layer-opacity, $name));
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
@function hexToRgbString($hexColor) {
|
|
24
28
|
@return "#{red($hexColor)},#{green($hexColor)},#{blue($hexColor)}";
|
|
25
29
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@use "functions";
|
|
2
|
+
|
|
3
|
+
@mixin global-styles() {
|
|
4
|
+
body {
|
|
5
|
+
--u-current-text-color-rgb: var(--u-color-on-body-rgb);
|
|
6
|
+
background-color: var(--u-color-body);
|
|
7
|
+
color: rgba(var(--u-current-text-color-rgb), var(--u-text-opacity));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
a {
|
|
11
|
+
--u-current-text-color: var(--u-color-primary);
|
|
12
|
+
--u-current-text-color-rgb: var(--u-color-primary-rgb);
|
|
13
|
+
color: rgba(var(--u-current-text-color-rgb), var(--u-text-opacity));
|
|
14
|
+
border-radius: #{functions.get-spacing-var(extra-small)};
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
|
|
17
|
+
@media (hover: hover) {
|
|
18
|
+
&:hover {
|
|
19
|
+
text-decoration: underline;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|