kemet-ui 0.2.0 → 1.1.0
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/custom-elements.json +6323 -831
- package/dist/components/kemet-accordion/kemet-accordion-panel.js +178 -0
- package/dist/components/kemet-accordion/kemet-accordion.js +139 -0
- package/dist/components/kemet-badge/kemet-badge.js +102 -0
- package/dist/components/kemet-button/kemet-button.js +230 -0
- package/dist/components/kemet-carousel/kemet-carousel-current.js +36 -0
- package/dist/components/kemet-carousel/kemet-carousel-first.js +47 -0
- package/dist/components/kemet-carousel/kemet-carousel-last.js +47 -0
- package/dist/components/{kemet-carousel-link.js → kemet-carousel/kemet-carousel-link.js} +7 -2
- package/dist/components/{kemet-carousel-next.js → kemet-carousel/kemet-carousel-next.js} +3 -2
- package/dist/components/{kemet-carousel-prev.js → kemet-carousel/kemet-carousel-prev.js} +2 -1
- package/dist/components/kemet-carousel/kemet-carousel-slide.js +51 -0
- package/dist/components/kemet-carousel/kemet-carousel-total.js +36 -0
- package/dist/components/kemet-carousel/kemet-carousel.js +492 -0
- package/dist/components/kemet-checkbox/kemet-checkbox.js +298 -0
- package/dist/components/kemet-combo/kemet-combo.js +207 -0
- package/dist/components/kemet-count/kemet-count.js +112 -0
- package/dist/components/{kemet-draggable.js → kemet-draggable/kemet-draggable.js} +19 -6
- package/dist/components/{kemet-drawer.js → kemet-drawer/kemet-drawer.js} +38 -15
- package/dist/components/{kemet-drawer.styles.js → kemet-drawer/kemet-drawer.styles.js} +6 -0
- package/dist/components/kemet-field/kemet-field.js +233 -0
- package/dist/components/{kemet-flipcard-trigger.js → kemet-flipcard/kemet-flipcard-trigger.js} +4 -5
- package/dist/components/{kemet-flipcard.js → kemet-flipcard/kemet-flipcard.js} +26 -3
- package/dist/components/{kemet-icon.js → kemet-icon/kemet-icon.js} +19 -3
- package/dist/components/kemet-input/kemet-input.js +650 -0
- package/dist/components/kemet-modal/kemet-modal-close.js +38 -0
- package/dist/components/kemet-modal/kemet-modal.js +140 -0
- package/dist/components/{kemet-modal.styles.js → kemet-modal/kemet-modal.styles.js} +14 -2
- package/dist/components/{kemet-popover-close.js → kemet-popover/kemet-popover-close.js} +1 -1
- package/dist/components/{kemet-popover.effects.styles.js → kemet-popover/kemet-popover.effects.styles.js} +0 -0
- package/dist/components/{kemet-popover.js → kemet-popover/kemet-popover.js} +75 -12
- package/dist/components/{kemet-popover.tooltip.styles.js → kemet-popover/kemet-popover.tooltip.styles.js} +0 -0
- package/dist/components/kemet-radio/kemet-radio.js +214 -0
- package/dist/components/kemet-radio/kemet-radios.js +218 -0
- package/dist/components/{kemet-rotator.js → kemet-rotator/kemet-rotator.js} +23 -4
- package/dist/components/{kemet-scroll-link.js → kemet-scroll-link/kemet-scroll-link.js} +21 -2
- package/dist/components/{kemet-scroll-nav.js → kemet-scroll-nav/kemet-scroll-nav.js} +25 -2
- package/dist/components/{kemet-scroll-snap-paginator.js → kemet-scroll-snap/kemet-scroll-snap-paginator.js} +68 -26
- package/dist/components/{kemet-scroll-snap-slide.js → kemet-scroll-snap/kemet-scroll-snap-slide.js} +23 -13
- package/dist/components/{kemet-scroll-snap.js → kemet-scroll-snap/kemet-scroll-snap.js} +31 -16
- package/dist/components/kemet-select/kemet-option.js +45 -0
- package/dist/components/kemet-select/kemet-select.js +365 -0
- package/dist/components/{kemet-svg.js → kemet-svgs/kemet-svg.js} +18 -2
- package/dist/components/{kemet-svgs.js → kemet-svgs/kemet-svgs.js} +7 -3
- package/dist/components/{kemet-tab-panel.js → kemet-tabs/kemet-tab-panel.js} +15 -1
- package/dist/components/{kemet-tab.js → kemet-tabs/kemet-tab.js} +48 -1
- package/dist/components/kemet-tabs/kemet-tabs.js +556 -0
- package/dist/components/kemet-tabs/kemet-tabs.styles.js +200 -0
- package/dist/components/kemet-textarea/kemet-textarea.js +395 -0
- package/dist/components/kemet-toggle/kemet-toggle.js +225 -0
- package/dist/kemet-components.cjs +7251 -2465
- package/dist/kemet-components.js +7237 -2440
- package/dist/kemet-components.min.js +1641 -355
- package/dist/styles/components/_config.scss +4 -0
- package/dist/styles/components/accordion.scss +9 -0
- package/dist/styles/{scss/components → components}/drawer.scss +2 -2
- package/dist/styles/components/modal.scss +8 -0
- package/dist/styles/components/scrollsnap.scss +11 -0
- package/dist/styles/core/_config.scss +354 -0
- package/dist/styles/{scss/core → core}/_helpers.scss +113 -2
- package/dist/styles/{scss/core → core}/attributes.scss +16 -0
- package/dist/styles/core/base.scss +38 -0
- package/dist/styles/{scss/core → core}/layout.scss +6 -5
- package/dist/styles/kemet.components.css +12 -339
- package/dist/styles/kemet.components.css.map +1 -1
- package/dist/styles/{scss/kemet.components.scss → kemet.components.scss} +0 -3
- package/dist/styles/kemet.core.css +2371 -503
- package/dist/styles/kemet.core.css.map +1 -1
- package/dist/styles/kemet.core.scss +3 -0
- package/dist/utilities/controllers/forms.js +121 -0
- package/package.json +37 -57
- package/dist/components/kemet-accordion.js +0 -106
- package/dist/components/kemet-carousel-slide.js +0 -83
- package/dist/components/kemet-carousel.js +0 -236
- package/dist/components/kemet-modal-close.js +0 -19
- package/dist/components/kemet-modal.js +0 -75
- package/dist/components/kemet-ratio.js +0 -61
- package/dist/components/kemet-tabs.js +0 -350
- package/dist/styles/scss/components/_config.scss +0 -29
- package/dist/styles/scss/components/accordion.scss +0 -58
- package/dist/styles/scss/components/carousel.scss +0 -64
- package/dist/styles/scss/components/flipcard.scss +0 -14
- package/dist/styles/scss/components/modal.scss +0 -12
- package/dist/styles/scss/components/scrollsnap.scss +0 -68
- package/dist/styles/scss/components/tabs.scss +0 -73
- package/dist/styles/scss/core/_config.scss +0 -197
- package/dist/styles/scss/kemet.core.scss +0 -4
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
import { LitElement, html } from 'lit';
|
|
2
2
|
import { stylesBase, stylesEffects } from './kemet-drawer.styles.js';
|
|
3
3
|
|
|
4
|
-
export class KemetDrawer extends LitElement {
|
|
4
|
+
export default class KemetDrawer extends LitElement {
|
|
5
5
|
static get styles() {
|
|
6
6
|
return [stylesBase, stylesEffects];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
static get properties() {
|
|
10
10
|
return {
|
|
11
|
+
/**
|
|
12
|
+
* Determines if the drawer is opened or not.
|
|
13
|
+
*/
|
|
11
14
|
opened: {
|
|
12
15
|
type: Boolean,
|
|
13
16
|
reflect: true,
|
|
14
17
|
},
|
|
18
|
+
/**
|
|
19
|
+
* The animation effect for opening and closing the drawer.
|
|
20
|
+
* Values include: (slide | reveal | push | scale)
|
|
21
|
+
*/
|
|
15
22
|
effect: {
|
|
16
23
|
type: String,
|
|
17
24
|
reflect: true,
|
|
18
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* Allows you to control which side the drawer opens from.
|
|
28
|
+
* Values include: (left | right | top | bottom)
|
|
29
|
+
*/
|
|
19
30
|
side: {
|
|
20
31
|
type: String,
|
|
21
32
|
reflect: true,
|
|
22
33
|
},
|
|
34
|
+
/**
|
|
35
|
+
* Adds a overlay over the content section of the Drawer when opened
|
|
36
|
+
*/
|
|
23
37
|
overlay: {
|
|
24
38
|
type: Boolean,
|
|
25
39
|
reflect: true,
|
|
@@ -30,7 +44,7 @@ export class KemetDrawer extends LitElement {
|
|
|
30
44
|
constructor() {
|
|
31
45
|
super();
|
|
32
46
|
|
|
33
|
-
//
|
|
47
|
+
// managed properties
|
|
34
48
|
this.opened = undefined;
|
|
35
49
|
this.effect = 'slide';
|
|
36
50
|
this.side = 'left';
|
|
@@ -47,11 +61,29 @@ export class KemetDrawer extends LitElement {
|
|
|
47
61
|
|
|
48
62
|
updated(prevProps) {
|
|
49
63
|
if (!prevProps.get('opened') && this.opened === true) {
|
|
50
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Fires when the drawer opens.
|
|
66
|
+
*/
|
|
67
|
+
this.dispatchEvent(
|
|
68
|
+
new CustomEvent('kemet-drawer-opened', {
|
|
69
|
+
bubbles: true,
|
|
70
|
+
composed: true,
|
|
71
|
+
detail: this,
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
51
74
|
}
|
|
52
75
|
|
|
53
76
|
if (prevProps.get('opened') && this.opened === false) {
|
|
54
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Fires when the drawer closes.
|
|
79
|
+
*/
|
|
80
|
+
this.dispatchEvent(
|
|
81
|
+
new CustomEvent('kemet-drawer-closed', {
|
|
82
|
+
bubbles: true,
|
|
83
|
+
composed: true,
|
|
84
|
+
detail: this,
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
55
87
|
}
|
|
56
88
|
}
|
|
57
89
|
|
|
@@ -71,16 +103,7 @@ export class KemetDrawer extends LitElement {
|
|
|
71
103
|
</section>
|
|
72
104
|
`;
|
|
73
105
|
}
|
|
74
|
-
|
|
75
|
-
makeEvent(type) {
|
|
76
|
-
this.dispatchEvent(
|
|
77
|
-
new CustomEvent(`kemet-drawer-${type}`, {
|
|
78
|
-
bubbles: true,
|
|
79
|
-
composed: true,
|
|
80
|
-
detail: this,
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
106
|
}
|
|
85
107
|
|
|
86
|
-
|
|
108
|
+
// eslint-disable-next-line no-unused-expressions
|
|
109
|
+
customElements.get('kemet-drawer') || customElements.define('kemet-drawer', KemetDrawer);
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { html, css, LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default class KemetField extends LitElement {
|
|
4
|
+
static get styles() {
|
|
5
|
+
return [
|
|
6
|
+
css`
|
|
7
|
+
*,
|
|
8
|
+
*::before,
|
|
9
|
+
*::after {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([disabled]) {
|
|
18
|
+
opacity: 0.5;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
label {
|
|
22
|
+
position: relative;
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
label span {
|
|
27
|
+
color: inherit;
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
gap: 0.5rem;
|
|
30
|
+
align-items: center;
|
|
31
|
+
margin-bottom: 0.8rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([status='error']) kemet-icon {
|
|
35
|
+
color: var(--kemet-color-error);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([status='success']) kemet-icon {
|
|
39
|
+
color: var(--kemet-color-success);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([status='warning']) kemet-icon {
|
|
43
|
+
color: var(--kemet-color-warning);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.message {
|
|
47
|
+
font-size: 0.9rem;
|
|
48
|
+
line-height: 1;
|
|
49
|
+
display: block;
|
|
50
|
+
margin-top: 0.8rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([status='error']) .message {
|
|
54
|
+
color: var(--kemet-color-error);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([status='success']) .message {
|
|
58
|
+
color: var(--kemet-color-success);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([status='warning']) .message {
|
|
62
|
+
color: var(--kemet-color-warning);
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static get properties() {
|
|
69
|
+
return {
|
|
70
|
+
/**
|
|
71
|
+
* Uniquely identifies the control. Use the same slug for slotted sub components.
|
|
72
|
+
*/
|
|
73
|
+
slug: {
|
|
74
|
+
type: String,
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* The label text
|
|
78
|
+
*/
|
|
79
|
+
label: {
|
|
80
|
+
type: String,
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* The validation message for error or success
|
|
84
|
+
*/
|
|
85
|
+
message: {
|
|
86
|
+
type: String,
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Determines if the containing input is focused
|
|
90
|
+
*/
|
|
91
|
+
focused: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
reflect: true,
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* The validation status of standard, error, or success
|
|
97
|
+
*/
|
|
98
|
+
status: {
|
|
99
|
+
type: String,
|
|
100
|
+
reflect: true,
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Is true when the containing input has a value
|
|
104
|
+
*/
|
|
105
|
+
filled: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
reflect: true,
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* The length of the containing input
|
|
111
|
+
*/
|
|
112
|
+
length: {
|
|
113
|
+
type: Number,
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* Determines the disabled state of the control
|
|
117
|
+
*/
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
reflect: true,
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* The icon while in an error or warning state
|
|
124
|
+
*/
|
|
125
|
+
errorIcon: {
|
|
126
|
+
type: String,
|
|
127
|
+
attribute: 'error-icon',
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* The icon while in an success state
|
|
131
|
+
*/
|
|
132
|
+
successIcon: {
|
|
133
|
+
type: String,
|
|
134
|
+
attribute: 'success-icon',
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
constructor() {
|
|
140
|
+
super();
|
|
141
|
+
|
|
142
|
+
// managed properties
|
|
143
|
+
this.status = 'standard';
|
|
144
|
+
this.errorIcon = 'exclamation-triangle-fill';
|
|
145
|
+
this.successIcon = 'check-lg';
|
|
146
|
+
|
|
147
|
+
// listeners
|
|
148
|
+
this.addEventListener('kemet-input-focused', event => this.handleFocused(event));
|
|
149
|
+
this.addEventListener('kemet-input-status', event => this.handleStatus(event));
|
|
150
|
+
this.addEventListener('kemet-input-input', event => this.handleInput(event));
|
|
151
|
+
this.addEventListener('kemet-count-status', event => this.handleStatus(event));
|
|
152
|
+
this.addEventListener('kemet-combo-selection', event => this.handleSelection(event));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
firstUpdated() {
|
|
156
|
+
this.slotInput = this.querySelector('[slot="input"]');
|
|
157
|
+
this.slotCombo = this.querySelector('[slot="combo"]');
|
|
158
|
+
|
|
159
|
+
if (this.slotInput.value) {
|
|
160
|
+
this.length = this.slotInput.value.length;
|
|
161
|
+
} else {
|
|
162
|
+
this.length = 0;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
render() {
|
|
167
|
+
return html`
|
|
168
|
+
<label for="${this.slug}" id="${this.slug}-label" part="label">
|
|
169
|
+
<span>${this.label}${this.makeStatusIcon()}</span>
|
|
170
|
+
<slot name="input"></slot>
|
|
171
|
+
</label>
|
|
172
|
+
${this.makeStatusMessage()}
|
|
173
|
+
<slot name="component"></slot>
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
makeStatusIcon() {
|
|
178
|
+
if (this.status === 'error' || this.status === 'warning') {
|
|
179
|
+
return html`<kemet-icon icon="${this.errorIcon}" size="16"></kemet-icon>`;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (this.status === 'success') {
|
|
183
|
+
return html`<kemet-icon icon="${this.successIcon}" size="16"></kemet-icon>`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
makeStatusMessage() {
|
|
190
|
+
if (this.status !== 'standard') {
|
|
191
|
+
return html`<span class="message" part="message">${this.message}</span>`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
handleFocused(event) {
|
|
198
|
+
this.focused = event.detail;
|
|
199
|
+
|
|
200
|
+
if (!this.focused && this.slotCombo && this.slotCombo.options.length < 1) {
|
|
201
|
+
this.slotCombo.show = false;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
handleStatus(event) {
|
|
206
|
+
this.status = event.detail.status;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
handleInput(event) {
|
|
210
|
+
/**
|
|
211
|
+
* Fires when input fires on the input slot
|
|
212
|
+
*/
|
|
213
|
+
this.dispatchEvent(
|
|
214
|
+
new CustomEvent('kemet-field-input', {
|
|
215
|
+
bubbles: false,
|
|
216
|
+
detail: event.detail.length,
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
if (event.detail === '') {
|
|
221
|
+
this.filled = false;
|
|
222
|
+
} else {
|
|
223
|
+
this.filled = true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
handleSelection(event) {
|
|
228
|
+
this.slotInput.setAttribute('aria-activedescendant', event.detail);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// eslint-disable-next-line no-unused-expressions
|
|
233
|
+
customElements.get('kemet-field') || customElements.define('kemet-field', KemetField);
|
package/dist/components/{kemet-flipcard-trigger.js → kemet-flipcard/kemet-flipcard-trigger.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css } from 'lit';
|
|
2
2
|
|
|
3
|
-
export class KemetFlipcardTrigger extends LitElement {
|
|
3
|
+
export default class KemetFlipcardTrigger extends LitElement {
|
|
4
4
|
static get styles() {
|
|
5
5
|
return [
|
|
6
6
|
css`
|
|
@@ -11,9 +11,7 @@ export class KemetFlipcardTrigger extends LitElement {
|
|
|
11
11
|
];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
super();
|
|
16
|
-
|
|
14
|
+
firstUpdated() {
|
|
17
15
|
this.keyCodes = {
|
|
18
16
|
ENTER: 13,
|
|
19
17
|
SPACE: 32,
|
|
@@ -43,4 +41,5 @@ export class KemetFlipcardTrigger extends LitElement {
|
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
// eslint-disable-next-line no-unused-expressions
|
|
45
|
+
customElements.get('kemet-flipcard-trigger') || customElements.define('kemet-flipcard-trigger', KemetFlipcardTrigger);
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
|
|
3
|
-
export class KemetFlipcard extends LitElement {
|
|
3
|
+
export default class KemetFlipcard extends LitElement {
|
|
4
4
|
static get styles() {
|
|
5
5
|
return css`
|
|
6
|
+
*,
|
|
7
|
+
::after,
|
|
8
|
+
::before {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
:host {
|
|
7
13
|
display: inline-block;
|
|
8
14
|
width: var(--kemet-flipcard-width, 100%);
|
|
9
|
-
height: var(--kemet-flipcard-height,
|
|
15
|
+
height: var(--kemet-flipcard-height, auto);
|
|
16
|
+
aspect-ratio: var(--kemet-flipcard-ratio, 16/9);
|
|
10
17
|
perspective: 1000px;
|
|
11
18
|
}
|
|
12
19
|
|
|
@@ -25,6 +32,14 @@ export class KemetFlipcard extends LitElement {
|
|
|
25
32
|
width: 100%;
|
|
26
33
|
height: 100%;
|
|
27
34
|
backface-visibility: hidden;
|
|
35
|
+
/* overflow: hidden; */
|
|
36
|
+
border-radius: var(--kemet-flipcard-border-radius, 0);
|
|
37
|
+
border: var(--kemet-flipcard-border, 2px solid var(--kemet-color-primary));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([rounded]) .front,
|
|
41
|
+
:host([rounded]) .back {
|
|
42
|
+
border-radius: var(--kemet-border-radius);
|
|
28
43
|
}
|
|
29
44
|
|
|
30
45
|
.front {
|
|
@@ -32,6 +47,10 @@ export class KemetFlipcard extends LitElement {
|
|
|
32
47
|
background-color: var(--kemet-flipcard-front-background-color, #fafafa);
|
|
33
48
|
}
|
|
34
49
|
|
|
50
|
+
:host([flipped]) .front {
|
|
51
|
+
z-index: -1;
|
|
52
|
+
}
|
|
53
|
+
|
|
35
54
|
.back {
|
|
36
55
|
color: var(--kemet-flipcard-back-color, #202020);
|
|
37
56
|
background-color: var(--kemet-flipcard-back-background-color, #fafafa)
|
|
@@ -62,6 +81,8 @@ export class KemetFlipcard extends LitElement {
|
|
|
62
81
|
display: inline-block;
|
|
63
82
|
margin: auto;
|
|
64
83
|
position: relative;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
65
86
|
}
|
|
66
87
|
`;
|
|
67
88
|
}
|
|
@@ -161,4 +182,6 @@ export class KemetFlipcard extends LitElement {
|
|
|
161
182
|
}, 0);
|
|
162
183
|
}
|
|
163
184
|
}
|
|
164
|
-
|
|
185
|
+
|
|
186
|
+
// eslint-disable-next-line no-unused-expressions
|
|
187
|
+
customElements.get('kemet-flipcard') || window.customElements.define('kemet-flipcard', KemetFlipcard);
|
|
@@ -3,15 +3,26 @@ import {
|
|
|
3
3
|
html, css, LitElement,
|
|
4
4
|
} from 'lit';
|
|
5
5
|
|
|
6
|
-
export class KemetIcon extends LitElement {
|
|
6
|
+
export default class KemetIcon extends LitElement {
|
|
7
7
|
static get properties() {
|
|
8
8
|
return {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the icon to reference.
|
|
11
|
+
*/
|
|
9
12
|
icon: {
|
|
10
13
|
type: String,
|
|
11
14
|
},
|
|
15
|
+
/**
|
|
16
|
+
* The sprite map from an open source project that an icon belongs too.
|
|
17
|
+
* Values include:
|
|
18
|
+
* (bootstrap | font-awesome-brand | font-awesome-regular | font-awesome-solid)
|
|
19
|
+
*/
|
|
12
20
|
set: {
|
|
13
21
|
type: String,
|
|
14
22
|
},
|
|
23
|
+
/**
|
|
24
|
+
* The width and height of the icon in pixels.
|
|
25
|
+
*/
|
|
15
26
|
size: {
|
|
16
27
|
type: Number,
|
|
17
28
|
},
|
|
@@ -22,7 +33,9 @@ export class KemetIcon extends LitElement {
|
|
|
22
33
|
return [
|
|
23
34
|
css`
|
|
24
35
|
:host {
|
|
25
|
-
display: inline-
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
26
39
|
}
|
|
27
40
|
`,
|
|
28
41
|
];
|
|
@@ -38,6 +51,8 @@ export class KemetIcon extends LitElement {
|
|
|
38
51
|
|
|
39
52
|
updated() {
|
|
40
53
|
this.getIcon();
|
|
54
|
+
this.style.width = `${this.size}px`;
|
|
55
|
+
this.style.height = `${this.size}px`;
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
render() {
|
|
@@ -106,4 +121,5 @@ export class KemetIcon extends LitElement {
|
|
|
106
121
|
}
|
|
107
122
|
}
|
|
108
123
|
|
|
109
|
-
|
|
124
|
+
// eslint-disable-next-line no-unused-expressions
|
|
125
|
+
customElements.get('kemet-icon') || customElements.define('kemet-icon', KemetIcon);
|