kemet-ui 0.2.0 → 1.0.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 +5546 -855
- package/dist/components/kemet-accordion-panel.js +178 -0
- package/dist/components/kemet-accordion.js +105 -72
- package/dist/components/kemet-badge.js +102 -0
- package/dist/components/kemet-button.js +230 -0
- package/dist/components/kemet-checkbox.js +298 -0
- package/dist/components/kemet-combo.js +207 -0
- package/dist/components/kemet-count.js +112 -0
- package/dist/components/kemet-draggable.js +19 -6
- package/dist/components/kemet-drawer.js +38 -15
- package/dist/components/kemet-drawer.styles.js +6 -0
- package/dist/components/kemet-field.js +233 -0
- package/dist/components/kemet-flipcard-trigger.js +4 -5
- package/dist/components/kemet-flipcard.js +26 -3
- package/dist/components/kemet-icon.js +19 -3
- package/dist/components/kemet-input.js +650 -0
- package/dist/components/kemet-modal-close.js +23 -4
- package/dist/components/kemet-modal.js +78 -13
- package/dist/components/kemet-modal.styles.js +14 -2
- package/dist/components/kemet-option.js +45 -0
- package/dist/components/kemet-popover-close.js +1 -1
- package/dist/components/kemet-popover.js +75 -12
- package/dist/components/kemet-radio.js +214 -0
- package/dist/components/kemet-radios.js +218 -0
- package/dist/components/kemet-rotator.js +23 -4
- package/dist/components/kemet-scroll-link.js +21 -2
- package/dist/components/kemet-scroll-nav.js +25 -2
- package/dist/components/kemet-scroll-snap-paginator.js +68 -26
- package/dist/components/kemet-scroll-snap-slide.js +23 -13
- package/dist/components/kemet-scroll-snap.js +31 -16
- package/dist/components/kemet-select.js +365 -0
- package/dist/components/kemet-svg.js +18 -2
- package/dist/components/kemet-svgs.js +7 -3
- package/dist/components/kemet-tab-panel.js +15 -1
- package/dist/components/kemet-tab.js +48 -1
- package/dist/components/kemet-tabs.js +289 -83
- package/dist/components/kemet-tabs.styles.js +200 -0
- package/dist/components/kemet-textarea.js +395 -0
- package/dist/components/kemet-toggle.js +225 -0
- package/dist/kemet-components.cjs +5128 -1200
- package/dist/kemet-components.js +5117 -1173
- package/dist/kemet-components.min.js +1536 -421
- package/dist/styles/kemet.components.css +12 -260
- package/dist/styles/kemet.components.css.map +1 -1
- package/dist/styles/kemet.core.css +2371 -503
- package/dist/styles/kemet.core.css.map +1 -1
- package/dist/styles/scss/components/_config.scss +0 -25
- package/dist/styles/scss/components/accordion.scss +4 -53
- package/dist/styles/scss/components/modal.scss +5 -9
- package/dist/styles/scss/components/scrollsnap.scss +0 -57
- package/dist/styles/scss/core/_config.scss +160 -3
- package/dist/styles/scss/core/_helpers.scss +109 -2
- package/dist/styles/scss/core/attributes.scss +16 -0
- package/dist/styles/scss/core/base.scss +38 -0
- package/dist/styles/scss/core/layout.scss +6 -5
- package/dist/styles/scss/kemet.components.scss +0 -2
- package/dist/styles/scss/kemet.core.scss +1 -2
- package/package.json +34 -56
- package/dist/components/kemet-carousel-link.js +0 -54
- package/dist/components/kemet-carousel-next.js +0 -46
- package/dist/components/kemet-carousel-prev.js +0 -46
- package/dist/components/kemet-carousel-slide.js +0 -83
- package/dist/components/kemet-carousel.js +0 -236
- package/dist/components/kemet-ratio.js +0 -61
- package/dist/styles/scss/components/flipcard.scss +0 -14
- package/dist/styles/scss/components/tabs.scss +0 -73
|
@@ -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);
|
|
@@ -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);
|