@exmg/exm-radio 1.1.9 → 1.1.10-alpha.26
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/.rollup.cache/root/repo/packages/exm-radio/dist/exm-radio-item.d.ts +16 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/exm-radio-item.js +67 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/index.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/index.js +2 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/styles/exm-radio-item-css.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-radio/dist/styles/exm-radio-item-css.js +114 -0
- package/dist/exm-radio-item.js +10 -8
- package/dist/index.js +1 -1
- package/dist/styles/exm-radio-item-css.js +20 -3
- package/package.json +4 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
2
|
+
/**
|
|
3
|
+
* exm-radio-item
|
|
4
|
+
* Material 3 radio item
|
|
5
|
+
*/
|
|
6
|
+
export declare class ExmRadioItem extends Radio {
|
|
7
|
+
private readonly maskIdOverride;
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
radio: boolean;
|
|
10
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'exm-radio-item': ExmRadioItem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import { styles } from '@material/web/radio/internal/radio-styles.js';
|
|
7
|
+
import { style as radioStyle } from './styles/exm-radio-item-css.js';
|
|
8
|
+
let maskId = 0;
|
|
9
|
+
/**
|
|
10
|
+
* exm-radio-item
|
|
11
|
+
* Material 3 radio item
|
|
12
|
+
*/
|
|
13
|
+
let ExmRadioItem = class ExmRadioItem extends Radio {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
// Unique maskId is required because of a Safari bug that fail to persist
|
|
17
|
+
// reference to the mask. This should be removed once the bug is fixed.
|
|
18
|
+
this.maskIdOverride = `cutout${++maskId}`;
|
|
19
|
+
this.radio = false;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const classes = { checked: this.checked, disabled: this.disabled };
|
|
23
|
+
const showRadioMap = classMap({ 'show-radio': this.radio });
|
|
24
|
+
return html `
|
|
25
|
+
<div class="container ${classMap(classes)}" aria-hidden="true" tab-index="0">
|
|
26
|
+
<md-ripple .control=${this} ?disabled=${this.disabled}></md-ripple>
|
|
27
|
+
<md-focus-ring .control=${this}></md-focus-ring>
|
|
28
|
+
<div class="radio-container ${showRadioMap}">
|
|
29
|
+
<svg class="icon ${showRadioMap}" viewBox="0 0 20 20">
|
|
30
|
+
<mask id="${this.maskIdOverride}">
|
|
31
|
+
<rect width="100%" height="100%" fill="white" />
|
|
32
|
+
<circle cx="10" cy="10" r="8" fill="black" />
|
|
33
|
+
</mask>
|
|
34
|
+
<circle class="outer circle" cx="10" cy="10" r="10" mask="url(#${this.maskIdOverride})" />
|
|
35
|
+
<circle class="inner circle" cx="10" cy="10" r="5" />
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="content-container">
|
|
39
|
+
<div class="image-container">
|
|
40
|
+
<slot name="image"></slot>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="content">
|
|
43
|
+
<slot name="title"></slot>
|
|
44
|
+
<slot name="content"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<input
|
|
48
|
+
id="input"
|
|
49
|
+
type="radio"
|
|
50
|
+
tabindex="-1"
|
|
51
|
+
.checked=${this.checked}
|
|
52
|
+
.value=${this.value}
|
|
53
|
+
?disabled=${this.disabled}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
ExmRadioItem.styles = [styles, radioStyle];
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: Boolean })
|
|
62
|
+
], ExmRadioItem.prototype, "radio", void 0);
|
|
63
|
+
ExmRadioItem = __decorate([
|
|
64
|
+
customElement('exm-radio-item')
|
|
65
|
+
], ExmRadioItem);
|
|
66
|
+
export { ExmRadioItem };
|
|
67
|
+
//# sourceMappingURL=exm-radio-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExmRadioItem } from './exm-radio-item.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
background: rgba(0, 0, 0, 0);
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
position: relative;
|
|
10
|
+
--md-radio-disabled-icon-color: grey;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
15
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
16
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
17
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
border: 1px solid var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
20
|
+
display: flex;
|
|
21
|
+
position: relative;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 1rem 1px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.container.disabled {
|
|
28
|
+
border: 1px solid var(--md-radio-disabled-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
29
|
+
color: var(--md-radio-disabled-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.container.checked {
|
|
33
|
+
border: 2px solid var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4));
|
|
34
|
+
padding: calc(1rem - 1px) 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([left-align]) .container {
|
|
38
|
+
justify-content: flex-start;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([right-align]) .container {
|
|
42
|
+
justify-content: flex-end;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
md-ripple {
|
|
46
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
47
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
48
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
49
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
md-focus-ring {
|
|
55
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
56
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
57
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
58
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#input {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
svg {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
svg.show-radio {
|
|
72
|
+
display: block;
|
|
73
|
+
position: relative;
|
|
74
|
+
width: 20px;
|
|
75
|
+
height: 20px;
|
|
76
|
+
margin-left: 1rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
slot[name='title'] {
|
|
80
|
+
font-size: var(--exm-radio-title-font-size, 24px);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
slot[name='content'] {
|
|
84
|
+
font-size: var(--exm-radio-content-font-size, 16px);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
slot[name='image'] {
|
|
88
|
+
margin-right: 1rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.radio-container {
|
|
92
|
+
height: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.image-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.image-container > ::slotted(*) {
|
|
100
|
+
margin-right: 1rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.content-container {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
padding: 0 1rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.content {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
//# sourceMappingURL=exm-radio-item-css.js.map
|
package/dist/exm-radio-item.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { Radio } from '@material/web/radio/internal/radio.js';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
6
|
import { styles } from '@material/web/radio/internal/radio-styles.js';
|
|
7
|
-
import { style
|
|
7
|
+
import { style } from './styles/exm-radio-item-css.js';
|
|
8
|
+
|
|
8
9
|
let maskId = 0;
|
|
9
10
|
/**
|
|
10
11
|
* exm-radio-item
|
|
@@ -22,9 +23,9 @@ let ExmRadioItem = class ExmRadioItem extends Radio {
|
|
|
22
23
|
const classes = { checked: this.checked, disabled: this.disabled };
|
|
23
24
|
const showRadioMap = classMap({ 'show-radio': this.radio });
|
|
24
25
|
return html `
|
|
25
|
-
<div class="container ${classMap(classes)}" aria-hidden="true">
|
|
26
|
-
<md-ripple
|
|
27
|
-
<md-focus-ring
|
|
26
|
+
<div class="container ${classMap(classes)}" aria-hidden="true" tab-index="0">
|
|
27
|
+
<md-ripple .control=${this} ?disabled=${this.disabled}></md-ripple>
|
|
28
|
+
<md-focus-ring .control=${this}></md-focus-ring>
|
|
28
29
|
<div class="radio-container ${showRadioMap}">
|
|
29
30
|
<svg class="icon ${showRadioMap}" viewBox="0 0 20 20">
|
|
30
31
|
<mask id="${this.maskIdOverride}">
|
|
@@ -56,12 +57,13 @@ let ExmRadioItem = class ExmRadioItem extends Radio {
|
|
|
56
57
|
`;
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
ExmRadioItem.styles = [styles,
|
|
60
|
+
ExmRadioItem.styles = [styles, style];
|
|
60
61
|
__decorate([
|
|
61
62
|
property({ type: Boolean })
|
|
62
63
|
], ExmRadioItem.prototype, "radio", void 0);
|
|
63
64
|
ExmRadioItem = __decorate([
|
|
64
65
|
customElement('exm-radio-item')
|
|
65
66
|
], ExmRadioItem);
|
|
67
|
+
|
|
66
68
|
export { ExmRadioItem };
|
|
67
|
-
//# sourceMappingURL=exm-radio-item.js.map
|
|
69
|
+
//# sourceMappingURL=exm-radio-item.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ExmRadioItem } from './exm-radio-item.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const style = css `
|
|
3
4
|
:host {
|
|
4
5
|
display: block;
|
|
5
6
|
background: rgba(0, 0, 0, 0);
|
|
6
7
|
height: 100%;
|
|
7
8
|
width: 100%;
|
|
8
9
|
box-sizing: border-box;
|
|
10
|
+
position: relative;
|
|
9
11
|
--md-radio-disabled-icon-color: grey;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -42,7 +44,19 @@ export const style = css `
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
md-ripple {
|
|
45
|
-
border-radius:
|
|
47
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
48
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
49
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
50
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
md-focus-ring {
|
|
56
|
+
border-top-left-radius: var(--exm-radio-table-top-left-radius, var(--exm-surface-border-radius, 16px));
|
|
57
|
+
border-top-right-radius: var(--exm-radio-table-top-right-radius, var(--exm-surface-border-radius, 16px));
|
|
58
|
+
border-bottom-left-radius: var(--exm-radio-table-bottom-left-radius, var(--exm-surface-border-radius, 16px));
|
|
59
|
+
border-bottom-right-radius: var(--exm-radio-table-bottom-right-radius, var(--exm-surface-border-radius, 16px));
|
|
46
60
|
width: 100%;
|
|
47
61
|
height: 100%;
|
|
48
62
|
}
|
|
@@ -60,6 +74,7 @@ export const style = css `
|
|
|
60
74
|
position: relative;
|
|
61
75
|
width: 20px;
|
|
62
76
|
height: 20px;
|
|
77
|
+
margin-left: 1rem;
|
|
63
78
|
}
|
|
64
79
|
|
|
65
80
|
slot[name='title'] {
|
|
@@ -97,4 +112,6 @@ export const style = css `
|
|
|
97
112
|
flex-direction: column;
|
|
98
113
|
}
|
|
99
114
|
`;
|
|
100
|
-
|
|
115
|
+
|
|
116
|
+
export { style };
|
|
117
|
+
//# sourceMappingURL=exm-radio-item-css.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-radio",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10-alpha.26+dffd4ec",
|
|
4
4
|
"description": "Material style radio element",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Ex Machina"
|
|
@@ -32,14 +32,11 @@
|
|
|
32
32
|
"directory": "packages/exm-radio"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
|
-
"
|
|
35
|
+
"peerDependencies": {
|
|
36
36
|
"@material/web": "^2.2.0",
|
|
37
|
-
"lit": "3.
|
|
37
|
+
"lit": "3.2.1",
|
|
38
38
|
"tslib": "^2.6.2"
|
|
39
39
|
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@exmg/lit-cli": "^2.0.1"
|
|
42
|
-
},
|
|
43
40
|
"scripts": {
|
|
44
41
|
"build:styles": "exmg-lit-cli sass -f \"./**/*.scss\"",
|
|
45
42
|
"tsc": "tsc"
|
|
@@ -47,5 +44,5 @@
|
|
|
47
44
|
"publishConfig": {
|
|
48
45
|
"access": "public"
|
|
49
46
|
},
|
|
50
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "dffd4ecb68fdeb061f4e8ad585af221bfb0f8e8b"
|
|
51
48
|
}
|