kemet-ui 1.3.0 → 1.4.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 +3125 -968
- package/dist/components/kemet-accordion/kemet-accordion-panel.js +29 -31
- package/dist/components/kemet-accordion/kemet-accordion.js +12 -6
- package/dist/components/kemet-alert/kemet-alert.js +106 -0
- package/dist/components/kemet-alert/styles.js +104 -0
- package/dist/components/kemet-avatar/kemet-avatar.js +118 -0
- package/dist/components/kemet-avatar/kemet-avatars.js +41 -0
- package/dist/components/kemet-badge/kemet-badge.js +16 -12
- package/dist/components/kemet-button/kemet-button.js +42 -25
- package/dist/components/kemet-card/kemet-card.js +69 -0
- package/dist/components/kemet-card/styles.js +63 -0
- package/dist/components/kemet-carousel/kemet-carousel-current.js +13 -3
- package/dist/components/kemet-carousel/kemet-carousel-first.js +17 -9
- package/dist/components/kemet-carousel/kemet-carousel-last.js +17 -9
- package/dist/components/kemet-carousel/kemet-carousel-link.js +23 -17
- package/dist/components/kemet-carousel/kemet-carousel-next.js +17 -9
- package/dist/components/kemet-carousel/kemet-carousel-prev.js +17 -9
- package/dist/components/kemet-carousel/kemet-carousel-slide.js +14 -11
- package/dist/components/kemet-carousel/kemet-carousel-total.js +13 -3
- package/dist/components/kemet-carousel/kemet-carousel.js +63 -133
- package/dist/components/kemet-carousel/styles.js +66 -0
- package/dist/components/kemet-checkbox/kemet-checkbox.js +28 -35
- package/dist/components/kemet-combo/kemet-combo.js +43 -28
- package/dist/components/kemet-count/kemet-count.js +29 -40
- package/dist/components/kemet-draggable/kemet-draggable.js +21 -23
- package/dist/components/kemet-drawer/kemet-drawer.js +36 -35
- package/dist/components/kemet-drawer/{kemet-drawer.styles.js → styles.js} +0 -0
- package/dist/components/kemet-fab/kemet-fab.js +39 -138
- package/dist/components/kemet-fab/styles.js +95 -0
- package/dist/components/kemet-field/kemet-field.js +31 -40
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js +12 -5
- package/dist/components/kemet-flipcard/kemet-flipcard.js +24 -4
- package/dist/components/kemet-icon/kemet-icon.js +19 -15
- package/dist/components/kemet-input/kemet-input.js +81 -174
- package/dist/components/kemet-modal/kemet-modal-close.js +13 -8
- package/dist/components/kemet-modal/kemet-modal.js +26 -21
- package/dist/components/kemet-modal/{kemet-modal.styles.js → styles.js} +0 -0
- package/dist/components/kemet-password/kemet-password.js +40 -132
- package/dist/components/kemet-password/styles.js +80 -0
- package/dist/components/kemet-popover/kemet-popover-close.js +13 -7
- package/dist/components/kemet-popover/kemet-popover.js +42 -51
- package/dist/components/kemet-popover/{kemet-popover.effects.styles.js → styles.effects.js} +0 -0
- package/dist/components/kemet-popover/{kemet-popover.tooltip.styles.js → styles.tooltip.js} +0 -0
- package/dist/components/kemet-radio/kemet-radio.js +35 -43
- package/dist/components/kemet-radio/kemet-radios.js +25 -34
- package/dist/components/kemet-rotator/kemet-rotator.js +18 -18
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js +15 -13
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js +19 -10
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js +25 -30
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js +16 -9
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js +27 -15
- package/dist/components/kemet-select/kemet-option.js +17 -12
- package/dist/components/kemet-select/kemet-select.js +62 -102
- package/dist/components/kemet-sortable/kemet-sortable-item.js +11 -5
- package/dist/components/kemet-sortable/kemet-sortable.js +16 -14
- package/dist/components/kemet-svgs/kemet-svg.js +17 -15
- package/dist/components/kemet-svgs/kemet-svgs.js +11 -3
- package/dist/components/kemet-tabs/kemet-tab-panel.js +14 -6
- package/dist/components/kemet-tabs/kemet-tab.js +22 -25
- package/dist/components/kemet-tabs/kemet-tabs.js +43 -41
- package/dist/components/kemet-tabs/{kemet-tabs.styles.js → styles.js} +0 -0
- package/dist/components/kemet-textarea/kemet-textarea.js +25 -54
- package/dist/components/kemet-toggle/kemet-toggle.js +39 -38
- package/dist/components/kemet-tracker/kemet-tracker-step.js +49 -160
- package/dist/components/kemet-tracker/kemet-tracker.js +12 -12
- package/dist/components/kemet-tracker/styles.js +111 -0
- package/dist/components/kemet-upload/kemet-upload-file.js +35 -44
- package/dist/components/kemet-upload/kemet-upload.js +53 -95
- package/dist/components/kemet-upload/{kemet-upload-file.loaders.styles.js → styles.js} +0 -0
- package/dist/kemet-components.cjs +2821 -2455
- package/dist/kemet-components.js +2822 -2444
- package/dist/kemet-components.min.js +912 -674
- package/dist/utilities/misc/events.js +5 -0
- package/package.json +13 -11
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const stylesBase = css`
|
|
4
|
+
:host {
|
|
5
|
+
color: inherit;
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([show]) {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
p {
|
|
14
|
+
margin: 1.6rem 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.status {
|
|
18
|
+
display: grid;
|
|
19
|
+
align-items: center;
|
|
20
|
+
grid-template-columns: 1fr auto;
|
|
21
|
+
line-height: 1;
|
|
22
|
+
margin-top: 0.8rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.status > span {
|
|
26
|
+
text-transform: capitalize;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.status--weak,
|
|
30
|
+
.status--better {
|
|
31
|
+
color: var(--kemet-color-error);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.status--strong {
|
|
35
|
+
color: var(--kemet-color-success);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.indicator {
|
|
39
|
+
display: flex;
|
|
40
|
+
gap: 0.4rem;
|
|
41
|
+
margin: 0;
|
|
42
|
+
list-style: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.indicator li {
|
|
46
|
+
width: 1.6rem;
|
|
47
|
+
height: 0.2rem;
|
|
48
|
+
background-color: var(--fds-color--gray2);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.status--weak .indicator li:nth-child(1) {
|
|
52
|
+
background-color: var(--kemet-color-error);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.status--better .indicator li:nth-child(1),
|
|
56
|
+
.status--better .indicator li:nth-child(2) {
|
|
57
|
+
background-color: var(--kemet-color-error);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.status--strong .indicator li {
|
|
61
|
+
background-color: var(--kemet-color-success);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.rules {
|
|
65
|
+
color: var(--kemet-color-primary);
|
|
66
|
+
list-style: none;
|
|
67
|
+
font-size: 90%;
|
|
68
|
+
padding-left: 2rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.rules li {
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.rules kemet-icon {
|
|
76
|
+
color: var(--kemet-color-success);
|
|
77
|
+
position: absolute;
|
|
78
|
+
left: -2.4rem;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
|
+
import { emitEvent } from '../../utilities/misc/events.js';
|
|
2
3
|
|
|
3
4
|
const keyCodes = {
|
|
4
5
|
ENTER: 13,
|
|
@@ -6,6 +7,17 @@ const keyCodes = {
|
|
|
6
7
|
ESC: 27,
|
|
7
8
|
};
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
* @status stable
|
|
13
|
+
*
|
|
14
|
+
* @tagname kemet-popover-close
|
|
15
|
+
* @summary A close button for the popover
|
|
16
|
+
*
|
|
17
|
+
* @event kemet-popover-close-btn
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
9
21
|
export default class KemetPopoverClose extends LitElement {
|
|
10
22
|
static get styles() {
|
|
11
23
|
return [
|
|
@@ -30,13 +42,7 @@ export default class KemetPopoverClose extends LitElement {
|
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
close() {
|
|
33
|
-
this
|
|
34
|
-
new CustomEvent('kemet-popover-close-btn', {
|
|
35
|
-
bubbles: true,
|
|
36
|
-
composed: true,
|
|
37
|
-
detail: this,
|
|
38
|
-
}),
|
|
39
|
-
);
|
|
45
|
+
emitEvent(this, 'kemet-popover-close-btn', this);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
handleKeyboard(event) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
|
-
import { tooltip, customTooltip } from './
|
|
2
|
+
import { tooltip, customTooltip } from './styles.tooltip.js';
|
|
3
3
|
import {
|
|
4
4
|
fade,
|
|
5
5
|
scale,
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
flipVertical,
|
|
10
10
|
sign,
|
|
11
11
|
superScaled,
|
|
12
|
-
} from './
|
|
12
|
+
} from './styles.effects.js';
|
|
13
|
+
import { emitEvent } from '../../utilities/misc/events.js';
|
|
13
14
|
|
|
14
15
|
const keyCodes = {
|
|
15
16
|
ENTER: 13,
|
|
@@ -17,6 +18,43 @@ const keyCodes = {
|
|
|
17
18
|
ESC: 27,
|
|
18
19
|
};
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
* @status stable
|
|
24
|
+
*
|
|
25
|
+
* @tagname kemet-popover
|
|
26
|
+
* @summary Displays an element in position of a trigger. Also acts as a tooltip.
|
|
27
|
+
*
|
|
28
|
+
* @prop {boolean} opened - Determines whether or not the popover displays.
|
|
29
|
+
* @prop {string} effect - The opening and closing effect of the popover. Is optional. Values include: (fade | scale | slide | fall | flip horizontal | flip vertical | sign | super scaled)
|
|
30
|
+
* @prop {string} position - Determines the placement of the popover. Values include: (top | right | bottom | left)
|
|
31
|
+
* @prop {boolean} tooltip - Adds a built in tooltip to the popover.
|
|
32
|
+
* @prop {boolean} customTooltip - Adds a custom tooltip to the popover. Use the custom-tooltip slot to specify the custom tooltip.
|
|
33
|
+
* @prop {string} fireOn - Controls how the trigger should activate the popover. Values include: (click | hover)
|
|
34
|
+
* @prop {boolean} clickOutside - Allows the popover to be closed by clicking outside of its content.
|
|
35
|
+
* @prop {boolean} smart - Intelligently positions the popover.
|
|
36
|
+
*
|
|
37
|
+
* @slot trigger - Controls opening and closing the popover.
|
|
38
|
+
* @slot content - The contents of the popover.
|
|
39
|
+
* @slot custom-tooltip - Allows you to use an svg, image, custom css, etc for a custom tooltip.
|
|
40
|
+
*
|
|
41
|
+
* @csspart trigger - Contains the trigger for the popover.
|
|
42
|
+
* @csspart content - Contains the content for the popover.
|
|
43
|
+
* @csspart tooltip - Contains the tooltip for the popover.
|
|
44
|
+
* @csspart custom-tooltip - Contains the custom tooltip for the popover.
|
|
45
|
+
*
|
|
46
|
+
* @cssproperty --kemet-popover-width - The width of the popover contents. Default: 100%.
|
|
47
|
+
* @cssproperty --kemet-popover-height - The height of the popover contents. Default: auto.
|
|
48
|
+
* @cssproperty --kemet-popover-color - The text color of the popover's contents. Default: #fafafa.
|
|
49
|
+
* @cssproperty --kemet-popover-background-color - The background color of the popover's contents. Default: #202020.
|
|
50
|
+
* @cssproperty --kemet-popover-gap - The space between the trigger and content. Default: 0px.
|
|
51
|
+
* @cssproperty --kemet-popover-transition-speed - The speed of the opening and closing effect. Default: 0.3s.
|
|
52
|
+
*
|
|
53
|
+
* @event kemet-popover-opened - Fires when the popover opens.
|
|
54
|
+
* @event kemet-popover-closed - Fires when the popover closes.
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
|
|
20
58
|
export default class KemetPopover extends LitElement {
|
|
21
59
|
static get styles() {
|
|
22
60
|
return [
|
|
@@ -121,62 +159,33 @@ export default class KemetPopover extends LitElement {
|
|
|
121
159
|
|
|
122
160
|
static get properties() {
|
|
123
161
|
return {
|
|
124
|
-
/**
|
|
125
|
-
* Determines whether or not the popover displays.
|
|
126
|
-
*/
|
|
127
162
|
opened: {
|
|
128
163
|
type: Boolean,
|
|
129
164
|
reflect: true,
|
|
130
165
|
},
|
|
131
|
-
/**
|
|
132
|
-
* The opening and closing effect of the popover. Is optional.
|
|
133
|
-
* Values include:
|
|
134
|
-
* (fade | scale | slide | fall | flip horizontal | flip vertical | sign | super scaled)
|
|
135
|
-
*/
|
|
136
166
|
effect: {
|
|
137
167
|
string: String,
|
|
138
168
|
reflect: true,
|
|
139
169
|
},
|
|
140
|
-
/**
|
|
141
|
-
* Determines the placement of the popover.
|
|
142
|
-
* Values include: (top | right | bottom | left)
|
|
143
|
-
*/
|
|
144
170
|
position: {
|
|
145
171
|
type: String,
|
|
146
172
|
reflect: true,
|
|
147
173
|
},
|
|
148
|
-
/**
|
|
149
|
-
* Adds a built in tooltip to the popover.
|
|
150
|
-
*/
|
|
151
174
|
tooltip: {
|
|
152
175
|
type: Boolean,
|
|
153
176
|
},
|
|
154
|
-
/**
|
|
155
|
-
* Adds a custom tooltip to the popover.
|
|
156
|
-
* Use the custom-tooltip slot to specify the custom tooltip.
|
|
157
|
-
*/
|
|
158
177
|
customTooltip: {
|
|
159
178
|
type: Boolean,
|
|
160
179
|
attribute: 'custom-tooltip',
|
|
161
180
|
},
|
|
162
|
-
/**
|
|
163
|
-
* Controls how the trigger should activate the popover.
|
|
164
|
-
* Values include: (click | hover)
|
|
165
|
-
*/
|
|
166
181
|
fireOn: {
|
|
167
182
|
type: String,
|
|
168
183
|
attribute: 'fire-on',
|
|
169
184
|
},
|
|
170
|
-
/**
|
|
171
|
-
* Allows the popover to be closed by clicking outside of its content.
|
|
172
|
-
*/
|
|
173
185
|
clickOutside: {
|
|
174
186
|
type: Boolean,
|
|
175
187
|
attribute: 'click-outside',
|
|
176
188
|
},
|
|
177
|
-
/**
|
|
178
|
-
* Intelligently positions the popover.
|
|
179
|
-
*/
|
|
180
189
|
smart: {
|
|
181
190
|
type: Boolean,
|
|
182
191
|
},
|
|
@@ -221,29 +230,11 @@ export default class KemetPopover extends LitElement {
|
|
|
221
230
|
|
|
222
231
|
updated(prevProps) {
|
|
223
232
|
if (!prevProps.get('opened') && this.opened === true) {
|
|
224
|
-
|
|
225
|
-
* Fires when the popover opens.
|
|
226
|
-
*/
|
|
227
|
-
this.dispatchEvent(
|
|
228
|
-
new CustomEvent('kemet-popover-opened', {
|
|
229
|
-
bubbles: true,
|
|
230
|
-
composed: true,
|
|
231
|
-
detail: this,
|
|
232
|
-
}),
|
|
233
|
-
);
|
|
233
|
+
emitEvent(this, 'kemet-popover-opened', this);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
if (prevProps.get('opened') && this.opened === false) {
|
|
237
|
-
|
|
238
|
-
* Fires when the popover closes.
|
|
239
|
-
*/
|
|
240
|
-
this.dispatchEvent(
|
|
241
|
-
new CustomEvent('kemet-popover-closed', {
|
|
242
|
-
bubbles: true,
|
|
243
|
-
composed: true,
|
|
244
|
-
detail: this,
|
|
245
|
-
}),
|
|
246
|
-
);
|
|
237
|
+
emitEvent(this, 'kemet-popover-closed', this);
|
|
247
238
|
}
|
|
248
239
|
|
|
249
240
|
this.smartContent();
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
3
|
import { live } from 'lit/directives/live.js';
|
|
4
|
+
import { emitEvent } from '../../utilities/misc/events.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @status stable
|
|
9
|
+
*
|
|
10
|
+
* @tagname kemet-radio
|
|
11
|
+
* @summary An enhanced radio button.
|
|
12
|
+
*
|
|
13
|
+
* @prop {string} label - The text next to the radio button
|
|
14
|
+
* @prop {boolean} checked - Determines whether or not the button is checked
|
|
15
|
+
* @prop {string} name - The name of the field
|
|
16
|
+
* @prop {string} value - The value of the radio button
|
|
17
|
+
* @prop {boolean} disabled - Determines if the button should be disabled
|
|
18
|
+
* @prop {boolean} focused - Is true when the button is focused on
|
|
19
|
+
* @prop {boolean} filled - Displayed the button as a filled button
|
|
20
|
+
*
|
|
21
|
+
* @csspart label - The label that contains the radio button.
|
|
22
|
+
* @csspart button - The radio button.
|
|
23
|
+
* @csspart text - The text next to the radio button.
|
|
24
|
+
* @csspart dot - The circle that fills the radio button.
|
|
25
|
+
*
|
|
26
|
+
* @cssproperty --kemet-radio-size - The size of the radio button. Default: 18px.
|
|
27
|
+
* @cssproperty --kemet-radio-border - The outer border of the radio button. Default: 1px solid var(--kemet-color-primary).
|
|
28
|
+
* @cssproperty --kemet-radio-dot-color - The color of the radio button's dot. Default: var(--kemet-color-primary).
|
|
29
|
+
* @cssproperty --kemet-radio-dot-border-width - The border width of the radio button's dot. Default: 3px.
|
|
30
|
+
* @cssproperty --kemet-radio-dot-border-color - The border color of the radio button's dot. Default: var(--kemet-color-white).
|
|
31
|
+
* @cssproperty --kemet-radio-dot-color-filled - The filled color of the radio button. Default: var(--kemet-color-white).
|
|
32
|
+
*
|
|
33
|
+
* @event kemet-radio-focused - Fires when the checkbox loses or receives focus
|
|
34
|
+
* @event kemet-radio-focused - Fires when the checkbox loses or receives focus
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
4
37
|
|
|
5
38
|
export default class KemetRadio extends LitElement {
|
|
6
39
|
static get styles() {
|
|
@@ -70,48 +103,27 @@ export default class KemetRadio extends LitElement {
|
|
|
70
103
|
|
|
71
104
|
static get properties() {
|
|
72
105
|
return {
|
|
73
|
-
/**
|
|
74
|
-
* The text next to the radio button
|
|
75
|
-
*/
|
|
76
106
|
label: {
|
|
77
107
|
type: String,
|
|
78
108
|
},
|
|
79
|
-
/**
|
|
80
|
-
* Determines whether or not the button is checked
|
|
81
|
-
*/
|
|
82
109
|
checked: {
|
|
83
110
|
type: Boolean,
|
|
84
111
|
reflect: true,
|
|
85
112
|
},
|
|
86
|
-
/**
|
|
87
|
-
* The name of the field
|
|
88
|
-
*/
|
|
89
113
|
name: {
|
|
90
114
|
type: String,
|
|
91
115
|
},
|
|
92
|
-
/**
|
|
93
|
-
* The value of the radio button
|
|
94
|
-
*/
|
|
95
116
|
value: {
|
|
96
117
|
type: String,
|
|
97
118
|
},
|
|
98
|
-
/**
|
|
99
|
-
* Determines if the button should be disabled
|
|
100
|
-
*/
|
|
101
119
|
disabled: {
|
|
102
120
|
type: Boolean,
|
|
103
121
|
reflect: true,
|
|
104
122
|
},
|
|
105
|
-
/**
|
|
106
|
-
* Is true when the button is focused on
|
|
107
|
-
*/
|
|
108
123
|
focused: {
|
|
109
124
|
type: Boolean,
|
|
110
125
|
reflect: true,
|
|
111
126
|
},
|
|
112
|
-
/**
|
|
113
|
-
* Displayed the button as a filled button
|
|
114
|
-
*/
|
|
115
127
|
filled: {
|
|
116
128
|
type: Boolean,
|
|
117
129
|
reflect: true,
|
|
@@ -171,32 +183,12 @@ export default class KemetRadio extends LitElement {
|
|
|
171
183
|
|
|
172
184
|
handleBlur() {
|
|
173
185
|
this.focused = false;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Fires when the checkbox loses or receives focus
|
|
177
|
-
*/
|
|
178
|
-
this.dispatchEvent(
|
|
179
|
-
new CustomEvent('kemet-radio-focused', {
|
|
180
|
-
bubbles: true,
|
|
181
|
-
composed: true,
|
|
182
|
-
detail: false,
|
|
183
|
-
}),
|
|
184
|
-
);
|
|
186
|
+
emitEvent(this, 'kemet-radio-focused', false);
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
handleFocus() {
|
|
188
190
|
this.focused = true;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Fires when the checkbox loses or receives focus
|
|
192
|
-
*/
|
|
193
|
-
this.dispatchEvent(
|
|
194
|
-
new CustomEvent('kemet-radio-focused', {
|
|
195
|
-
bubbles: true,
|
|
196
|
-
composed: true,
|
|
197
|
-
detail: true,
|
|
198
|
-
}),
|
|
199
|
-
);
|
|
191
|
+
emitEvent(this, 'kemet-radio-focused', true);
|
|
200
192
|
}
|
|
201
193
|
|
|
202
194
|
makeDot() {
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
import { FormSubmitController } from '../../utilities/controllers/forms.js';
|
|
3
|
+
import { emitEvent } from '../../utilities/misc/events.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
* @status stable
|
|
8
|
+
*
|
|
9
|
+
* @tagname kemet-radios
|
|
10
|
+
* @summary A group of radio buttons.
|
|
11
|
+
*
|
|
12
|
+
* @prop {string} legend - The legend text for the fieldset
|
|
13
|
+
* @prop {string} axis - The direction of the button's layout
|
|
14
|
+
* @prop {string} value - The value of the selected radio button
|
|
15
|
+
* @prop {string} name - The name of the radio button set
|
|
16
|
+
* @prop {string} status - The status of the radio button set
|
|
17
|
+
* @prop {string} message - Validation message for the user
|
|
18
|
+
* @prop {boolean} required - Determines whether or not the radio button set is required
|
|
19
|
+
*
|
|
20
|
+
* @csspart fieldset - The fieldset element.
|
|
21
|
+
* @csspart legend - The legend element.
|
|
22
|
+
*
|
|
23
|
+
* @event kemet-radios-change - Fires when the state of the checkbox changes
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
3
26
|
|
|
4
27
|
export default class KemetRadios extends LitElement {
|
|
5
28
|
static get styles() {
|
|
@@ -49,47 +72,26 @@ export default class KemetRadios extends LitElement {
|
|
|
49
72
|
|
|
50
73
|
static get properties() {
|
|
51
74
|
return {
|
|
52
|
-
/**
|
|
53
|
-
* The legend text for the fieldset
|
|
54
|
-
*/
|
|
55
75
|
legend: {
|
|
56
76
|
type: String,
|
|
57
77
|
},
|
|
58
|
-
/**
|
|
59
|
-
* The direction of the button's layout
|
|
60
|
-
*/
|
|
61
78
|
axis: {
|
|
62
79
|
type: String,
|
|
63
80
|
reflect: true,
|
|
64
81
|
},
|
|
65
|
-
/**
|
|
66
|
-
* The value of the selected radio button
|
|
67
|
-
*/
|
|
68
82
|
value: {
|
|
69
83
|
type: String,
|
|
70
84
|
},
|
|
71
|
-
/**
|
|
72
|
-
* The name of the radio button set
|
|
73
|
-
*/
|
|
74
85
|
name: {
|
|
75
86
|
type: String,
|
|
76
87
|
},
|
|
77
|
-
/**
|
|
78
|
-
* The status of the radio button set
|
|
79
|
-
*/
|
|
80
88
|
status: {
|
|
81
89
|
type: String,
|
|
82
90
|
reflect: true,
|
|
83
91
|
},
|
|
84
|
-
/**
|
|
85
|
-
* Validation message for the user
|
|
86
|
-
*/
|
|
87
92
|
message: {
|
|
88
93
|
type: String,
|
|
89
94
|
},
|
|
90
|
-
/**
|
|
91
|
-
* Determines whether or not the radio button set is required
|
|
92
|
-
*/
|
|
93
95
|
required: {
|
|
94
96
|
type: Boolean,
|
|
95
97
|
},
|
|
@@ -105,9 +107,7 @@ export default class KemetRadios extends LitElement {
|
|
|
105
107
|
this.name = 'radios';
|
|
106
108
|
this.status = 'standard';
|
|
107
109
|
|
|
108
|
-
/**
|
|
109
|
-
* Used only for form reactive controller
|
|
110
|
-
*/
|
|
110
|
+
/** @internal */
|
|
111
111
|
this.formSubmitController = new FormSubmitController(this);
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -141,16 +141,7 @@ export default class KemetRadios extends LitElement {
|
|
|
141
141
|
this.value = target.value;
|
|
142
142
|
this.status = 'standard';
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
* Fires when the state of the checkbox changes
|
|
146
|
-
*/
|
|
147
|
-
this.dispatchEvent(
|
|
148
|
-
new CustomEvent('kemet-radios-change', {
|
|
149
|
-
bubbles: true,
|
|
150
|
-
composed: true,
|
|
151
|
-
detail: target,
|
|
152
|
-
}),
|
|
153
|
-
);
|
|
144
|
+
emitEvent(this, 'kemet-radios-change', target);
|
|
154
145
|
}
|
|
155
146
|
}
|
|
156
147
|
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @since 1.0.0
|
|
6
|
+
* @status stable
|
|
7
|
+
*
|
|
8
|
+
* @tagname kemet-rotator
|
|
9
|
+
* @summary A component that rotates through an array of text.
|
|
10
|
+
*
|
|
11
|
+
* @prop {number} activeSlide - The index number for the current slide.
|
|
12
|
+
* @prop {string} width - The width of the rotator block.
|
|
13
|
+
* @prop {string} height - The height of the rotator block.
|
|
14
|
+
* @prop {array} messages - Text in the rotator. Supports HTML.
|
|
15
|
+
* @prop {string} effect - The transition effect type.
|
|
16
|
+
* @prop {number} rotationSpeed - How fast, in seconds, each slide lasts. Stop the rotator with 0.
|
|
17
|
+
*
|
|
18
|
+
* @cssproperty --kemet-rotator-transition-speed - How long, in css time units, the transition effect lasts. Default: 500ms.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
4
22
|
export default class KemetRotator extends LitElement {
|
|
5
23
|
static get styles() {
|
|
6
24
|
return css`
|
|
@@ -77,40 +95,22 @@ export default class KemetRotator extends LitElement {
|
|
|
77
95
|
|
|
78
96
|
static get properties() {
|
|
79
97
|
return {
|
|
80
|
-
/**
|
|
81
|
-
* The index number for the current slide.
|
|
82
|
-
*/
|
|
83
98
|
activeSlide: {
|
|
84
99
|
type: Number,
|
|
85
100
|
},
|
|
86
|
-
/**
|
|
87
|
-
* The width of the rotator block.
|
|
88
|
-
*/
|
|
89
101
|
width: {
|
|
90
102
|
type: String,
|
|
91
103
|
},
|
|
92
|
-
/**
|
|
93
|
-
* The height of the rotator block.
|
|
94
|
-
*/
|
|
95
104
|
height: {
|
|
96
105
|
type: String,
|
|
97
106
|
},
|
|
98
|
-
/**
|
|
99
|
-
* Text in the rotator. Supports HTML.
|
|
100
|
-
*/
|
|
101
107
|
messages: {
|
|
102
108
|
type: Array,
|
|
103
109
|
},
|
|
104
|
-
/**
|
|
105
|
-
* The transition effect type.
|
|
106
|
-
*/
|
|
107
110
|
effect: {
|
|
108
111
|
type: String,
|
|
109
112
|
reflect: true,
|
|
110
113
|
},
|
|
111
|
-
/**
|
|
112
|
-
* How fast, in seconds, each slide lasts. Stop the rotator with 0.
|
|
113
|
-
*/
|
|
114
114
|
rotationSpeed: {
|
|
115
115
|
type: Number,
|
|
116
116
|
attribute: 'rotation-speed',
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { html, css, LitElement } from 'lit';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
* @status stable
|
|
6
|
+
*
|
|
7
|
+
* @tagname kemet-scroll-link
|
|
8
|
+
* @summary A component that adds a smooth scrolling link to an target..
|
|
9
|
+
*
|
|
10
|
+
* @prop {object} element - A DOM element that establishes the context of scrolling.
|
|
11
|
+
* @prop {object} target - A DOM element that represents the destination of the scroll link. If no target is specified it will default to the top of the page.
|
|
12
|
+
* @prop {number} xOffset - Allows the horizontal scrolling to stop short of the given value.
|
|
13
|
+
* @prop {number} yOffset - Allows the vertical scrolling to stop short of the given value.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
3
17
|
export default class KemetScrollLink extends LitElement {
|
|
4
18
|
static get styles() {
|
|
5
19
|
return css`
|
|
@@ -12,30 +26,17 @@ export default class KemetScrollLink extends LitElement {
|
|
|
12
26
|
|
|
13
27
|
static get properties() {
|
|
14
28
|
return {
|
|
15
|
-
/**
|
|
16
|
-
* A DOM element that establishes the context of scrolling.
|
|
17
|
-
*/
|
|
18
29
|
element: {
|
|
19
30
|
type: Object,
|
|
20
31
|
},
|
|
21
|
-
/**
|
|
22
|
-
* A DOM element that represents the destination of the scroll link.
|
|
23
|
-
* If no target is specified it will default to the top of the page.
|
|
24
|
-
*/
|
|
25
32
|
target: {
|
|
26
33
|
type: Object,
|
|
27
34
|
},
|
|
28
|
-
/**
|
|
29
|
-
* Allows the horizontal scrolling to stop short of the given value.
|
|
30
|
-
*/
|
|
31
35
|
xOffset: {
|
|
32
36
|
type: Number,
|
|
33
37
|
attribute: 'x-offset',
|
|
34
38
|
reflect: true,
|
|
35
39
|
},
|
|
36
|
-
/**
|
|
37
|
-
* Allows the vertical scrolling to stop short of the given value.
|
|
38
|
-
*/
|
|
39
40
|
yOffset: {
|
|
40
41
|
type: Number,
|
|
41
42
|
attribute: 'y-offset',
|
|
@@ -56,6 +57,7 @@ export default class KemetScrollLink extends LitElement {
|
|
|
56
57
|
|
|
57
58
|
firstUpdated() {
|
|
58
59
|
// standard properties
|
|
60
|
+
/** @internal */
|
|
59
61
|
this.keyCodes = {
|
|
60
62
|
ENTER: 13,
|
|
61
63
|
SPACE: 32,
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { LitElement, html, css } from 'lit';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
* @status stable
|
|
6
|
+
*
|
|
7
|
+
* @tagname kemet-scroll-nav
|
|
8
|
+
* @summary An element that transforms at a scroll point.
|
|
9
|
+
*
|
|
10
|
+
* @prop {string} effect - Determines where the transform point is activated. Values include: (sticky | resize)
|
|
11
|
+
* @prop {boolean} transform - Whether or not the nav has shifted into a new state.
|
|
12
|
+
* @prop {number} offset - Allows for an arbitrary adjustment of the transform point in pixels. Works with negative values.
|
|
13
|
+
*
|
|
14
|
+
* @cssproperty --kemet-scroll-nav-padding - The padding of the nav. Default: 1rem 2rem.
|
|
15
|
+
* @cssproperty --kemet-scroll-nav-background - The background color of the nav. Default: #fafafa.
|
|
16
|
+
* @cssproperty --kemet-scroll-nav-transition - The transition speed of the transformation. Default: 300ms.
|
|
17
|
+
* @cssproperty --kemet-scroll-nav-resize-height - The height of the pre-transformed nav. Default: 400px.
|
|
18
|
+
* @cssproperty --kemet-scroll-nav-resize-height-transformed - The height of the transformed nav. Default: 100px.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
3
22
|
export default class KemetScrollNav extends LitElement {
|
|
4
23
|
static get styles() {
|
|
5
24
|
return [
|
|
@@ -32,24 +51,14 @@ export default class KemetScrollNav extends LitElement {
|
|
|
32
51
|
|
|
33
52
|
static get properties() {
|
|
34
53
|
return {
|
|
35
|
-
/**
|
|
36
|
-
* Determines where the transform point is activated. Values include: (sticky | resize)
|
|
37
|
-
*/
|
|
38
54
|
effect: {
|
|
39
55
|
type: String,
|
|
40
56
|
reflect: true,
|
|
41
57
|
},
|
|
42
|
-
/**
|
|
43
|
-
* Whether or not the nav has shifted into a new state.
|
|
44
|
-
*/
|
|
45
58
|
transform: {
|
|
46
59
|
type: Boolean,
|
|
47
60
|
reflect: true,
|
|
48
61
|
},
|
|
49
|
-
/**
|
|
50
|
-
* Allows for an arbitrary adjustment of the transform point in pixels.
|
|
51
|
-
* Works with negative values.
|
|
52
|
-
*/
|
|
53
62
|
offset: {
|
|
54
63
|
type: Number,
|
|
55
64
|
},
|