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.
Files changed (74) hide show
  1. package/custom-elements.json +3125 -968
  2. package/dist/components/kemet-accordion/kemet-accordion-panel.js +29 -31
  3. package/dist/components/kemet-accordion/kemet-accordion.js +12 -6
  4. package/dist/components/kemet-alert/kemet-alert.js +106 -0
  5. package/dist/components/kemet-alert/styles.js +104 -0
  6. package/dist/components/kemet-avatar/kemet-avatar.js +118 -0
  7. package/dist/components/kemet-avatar/kemet-avatars.js +41 -0
  8. package/dist/components/kemet-badge/kemet-badge.js +16 -12
  9. package/dist/components/kemet-button/kemet-button.js +42 -25
  10. package/dist/components/kemet-card/kemet-card.js +69 -0
  11. package/dist/components/kemet-card/styles.js +63 -0
  12. package/dist/components/kemet-carousel/kemet-carousel-current.js +13 -3
  13. package/dist/components/kemet-carousel/kemet-carousel-first.js +17 -9
  14. package/dist/components/kemet-carousel/kemet-carousel-last.js +17 -9
  15. package/dist/components/kemet-carousel/kemet-carousel-link.js +23 -17
  16. package/dist/components/kemet-carousel/kemet-carousel-next.js +17 -9
  17. package/dist/components/kemet-carousel/kemet-carousel-prev.js +17 -9
  18. package/dist/components/kemet-carousel/kemet-carousel-slide.js +14 -11
  19. package/dist/components/kemet-carousel/kemet-carousel-total.js +13 -3
  20. package/dist/components/kemet-carousel/kemet-carousel.js +63 -133
  21. package/dist/components/kemet-carousel/styles.js +66 -0
  22. package/dist/components/kemet-checkbox/kemet-checkbox.js +28 -35
  23. package/dist/components/kemet-combo/kemet-combo.js +43 -28
  24. package/dist/components/kemet-count/kemet-count.js +29 -40
  25. package/dist/components/kemet-draggable/kemet-draggable.js +21 -23
  26. package/dist/components/kemet-drawer/kemet-drawer.js +36 -35
  27. package/dist/components/kemet-drawer/{kemet-drawer.styles.js → styles.js} +0 -0
  28. package/dist/components/kemet-fab/kemet-fab.js +39 -138
  29. package/dist/components/kemet-fab/styles.js +95 -0
  30. package/dist/components/kemet-field/kemet-field.js +31 -40
  31. package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js +12 -5
  32. package/dist/components/kemet-flipcard/kemet-flipcard.js +24 -4
  33. package/dist/components/kemet-icon/kemet-icon.js +19 -15
  34. package/dist/components/kemet-input/kemet-input.js +81 -174
  35. package/dist/components/kemet-modal/kemet-modal-close.js +13 -8
  36. package/dist/components/kemet-modal/kemet-modal.js +26 -21
  37. package/dist/components/kemet-modal/{kemet-modal.styles.js → styles.js} +0 -0
  38. package/dist/components/kemet-password/kemet-password.js +40 -132
  39. package/dist/components/kemet-password/styles.js +80 -0
  40. package/dist/components/kemet-popover/kemet-popover-close.js +13 -7
  41. package/dist/components/kemet-popover/kemet-popover.js +42 -51
  42. package/dist/components/kemet-popover/{kemet-popover.effects.styles.js → styles.effects.js} +0 -0
  43. package/dist/components/kemet-popover/{kemet-popover.tooltip.styles.js → styles.tooltip.js} +0 -0
  44. package/dist/components/kemet-radio/kemet-radio.js +35 -43
  45. package/dist/components/kemet-radio/kemet-radios.js +25 -34
  46. package/dist/components/kemet-rotator/kemet-rotator.js +18 -18
  47. package/dist/components/kemet-scroll-link/kemet-scroll-link.js +15 -13
  48. package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js +19 -10
  49. package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js +25 -30
  50. package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js +16 -9
  51. package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js +27 -15
  52. package/dist/components/kemet-select/kemet-option.js +17 -12
  53. package/dist/components/kemet-select/kemet-select.js +62 -102
  54. package/dist/components/kemet-sortable/kemet-sortable-item.js +11 -5
  55. package/dist/components/kemet-sortable/kemet-sortable.js +16 -14
  56. package/dist/components/kemet-svgs/kemet-svg.js +17 -15
  57. package/dist/components/kemet-svgs/kemet-svgs.js +11 -3
  58. package/dist/components/kemet-tabs/kemet-tab-panel.js +14 -6
  59. package/dist/components/kemet-tabs/kemet-tab.js +22 -25
  60. package/dist/components/kemet-tabs/kemet-tabs.js +43 -41
  61. package/dist/components/kemet-tabs/{kemet-tabs.styles.js → styles.js} +0 -0
  62. package/dist/components/kemet-textarea/kemet-textarea.js +25 -54
  63. package/dist/components/kemet-toggle/kemet-toggle.js +39 -38
  64. package/dist/components/kemet-tracker/kemet-tracker-step.js +49 -160
  65. package/dist/components/kemet-tracker/kemet-tracker.js +12 -12
  66. package/dist/components/kemet-tracker/styles.js +111 -0
  67. package/dist/components/kemet-upload/kemet-upload-file.js +35 -44
  68. package/dist/components/kemet-upload/kemet-upload.js +53 -95
  69. package/dist/components/kemet-upload/{kemet-upload-file.loaders.styles.js → styles.js} +0 -0
  70. package/dist/kemet-components.cjs +2821 -2455
  71. package/dist/kemet-components.js +2822 -2444
  72. package/dist/kemet-components.min.js +912 -674
  73. package/dist/utilities/misc/events.js +5 -0
  74. package/package.json +13 -11
@@ -1,4 +1,28 @@
1
1
  import { html, css, LitElement } from 'lit';
2
+ import { emitEvent } from '../../utilities/misc/events.js';
3
+
4
+ /**
5
+ * @since 1.0.0
6
+ * @status stable
7
+ *
8
+ * @tagname kemet-scroll-snap-paginator
9
+ * @summary The scroll snap's pagination.
10
+ *
11
+ * @prop {array} slides - Information about each slide.
12
+ * @prop {string} icon - A string representing which icon to use for pagination. Supports icons used in kemet-icon.
13
+ * @prop {number} size - The size in pixels of the icons.
14
+ * @prop {boolean} center - Determines whether to center the pagination items.
15
+ * @prop {boolean} hideFocusedLinks - Will hide inactive pagination items if set to true.
16
+ * @prop {boolean} useNumberPages - If set to true, the pages in the pagination iterator will appear as a set of numbers.
17
+ * @prop {boolean} useLabelPages - If set to true, the pages in the pagination iterator will appear as the label set on the slide.
18
+ *
19
+ * @cssproperty --kemet-scroll-snap-paginator-padding - The padding on the container. Default: 1rem 0.
20
+ * @cssproperty --kemet-scroll-snap-paginator-gap - The space between pagination items. Default: 0.5rem.
21
+ * @cssproperty --kemet-scroll-snap-paginator-link-color - The color of a linkable pagination item. Default: var(--kemet-color-primary).
22
+ *
23
+ * @event kemet-scroll-snap-focus - Fires when a set of slides are focused on.
24
+ *
25
+ */
2
26
 
3
27
  export default class KemetScrollSnapPaginator extends LitElement {
4
28
  static get styles() {
@@ -26,50 +50,28 @@ export default class KemetScrollSnapPaginator extends LitElement {
26
50
 
27
51
  static get properties() {
28
52
  return {
29
- /**
30
- * Information about each slide.
31
- */
32
53
  slides: {
33
54
  type: Array,
34
55
  },
35
- /**
36
- * A string representing which icon to use for pagination. Supports icons used in kemet-icon.
37
- */
38
56
  icon: {
39
57
  type: String,
40
58
  },
41
- /**
42
- * The size in pixels of the icons.
43
- */
44
59
  size: {
45
60
  type: Number,
46
61
  },
47
- /**
48
- * Determines whether to center the pagination items.
49
- */
50
62
  center: {
51
63
  type: Boolean,
52
64
  reflect: true,
53
65
  },
54
- /**
55
- * Will hide inactive pagination items if set to true.
56
- */
57
66
  hideFocusedLinks: {
58
67
  type: Boolean,
59
68
  attribute: 'hide-focused-links',
60
69
  },
61
- /**
62
- * If set to true, the pages in the pagination iterator will appear as a set of numbers.
63
- */
64
70
  useNumberPages: {
65
71
  type: Boolean,
66
72
  reflect: true,
67
73
  attribute: 'use-number-pages',
68
74
  },
69
- /**
70
- * If set to true, the pages in the pagination iterator will appear as the label set on
71
- * the slide.
72
- */
73
75
  useLabelPages: {
74
76
  type: Boolean,
75
77
  reflect: true,
@@ -149,14 +151,7 @@ export default class KemetScrollSnapPaginator extends LitElement {
149
151
  }
150
152
 
151
153
  slideLink(index) {
152
- /**
153
- * Fires when a set of slides are focused on.
154
- */
155
- this.dispatchEvent(new CustomEvent('kemet-scroll-snap-focus', {
156
- bubbles: true,
157
- composed: true,
158
- detail: index,
159
- }));
154
+ emitEvent(this, 'kemet-scroll-snap-focus', index);
160
155
  }
161
156
 
162
157
  handleKeyboardInput(event, id) {
@@ -1,5 +1,21 @@
1
1
  import { html, css, LitElement } from 'lit';
2
2
 
3
+ /**
4
+ * @since 1.0.0
5
+ * @status stable
6
+ *
7
+ * @tagname kemet-scroll-snap-slide
8
+ * @summary A slide in a scroll snap component.
9
+ *
10
+ * @prop {boolean} focused - Is true when the slide is fully visible in it's container.
11
+ * @prop {string} index - Identifies the slide.
12
+ * @prop {string} label - Labels the slide.
13
+ *
14
+ * @cssproperty --kemet-scroll-snap-slide-width - The width of the slide. Default: 100%.
15
+ * @cssproperty --kemet-scroll-snap-slide-align - The slide alignment. Default: center.
16
+ *
17
+ */
18
+
3
19
  export default class KemetScrollSnapSlide extends LitElement {
4
20
  static get styles() {
5
21
  return css`
@@ -14,23 +30,14 @@ export default class KemetScrollSnapSlide extends LitElement {
14
30
 
15
31
  static get properties() {
16
32
  return {
17
- /**
18
- * Is true when the slide is fully visible in it's container.
19
- */
20
33
  focused: {
21
34
  type: Boolean,
22
35
  reflect: true,
23
36
  },
24
- /**
25
- * Identifies the slide.
26
- */
27
37
  index: {
28
38
  type: String,
29
39
  reflect: true,
30
40
  },
31
- /**
32
- * Labels the slide.
33
- */
34
41
  label: {
35
42
  type: String,
36
43
  reflect: true,
@@ -1,4 +1,30 @@
1
1
  import { html, css, LitElement } from 'lit';
2
+ import { emitEvent } from '../../utilities/misc/events.js';
3
+
4
+ /**
5
+ * @since 1.0.0
6
+ * @status stable
7
+ *
8
+ * @tagname kemet-scroll-snap
9
+ * @summary A scroll-snap implementation for responsive sliders.
10
+ *
11
+ * @prop {string} axis - Determines the direction the component flows. Values include: (horizontal | vertical)
12
+ * @prop {string} pagination - Determines where to display the paginator. Values include: (top | right | bottom | left)
13
+ *
14
+ * @slot slides - Place your slides here.
15
+ * @slot pagination - Place the paginator component here if you want one.
16
+ *
17
+ * @csspart slides - The slides container.
18
+ * @csspart pagination - The pagination element.
19
+ *
20
+ * @cssproperty --kemet-scroll-snap-gap - Space between the slides. Default: 1.5rem.
21
+ * @cssproperty --kemet-scroll-snap-horizontal-max-width - The horizontal max width of the container. Default: 1024px.
22
+ * @cssproperty --kemet-scroll-snap-vertical-height - The vertical height of the container. Default: 100vh.
23
+ * @cssproperty --kemet-scroll-snap-slides-vertical-padding - Padding on the vertical axis. Default: 0 2rem.
24
+ *
25
+ * @event kemet-scroll-snap-make-slides - Fires when slide data has been created.
26
+ *
27
+ */
2
28
 
3
29
  export default class KemetScrollSnap extends LitElement {
4
30
  static get styles() {
@@ -58,16 +84,10 @@ export default class KemetScrollSnap extends LitElement {
58
84
 
59
85
  static get properties() {
60
86
  return {
61
- /**
62
- * Determines the direction the component flows. Values include: (horizontal|vertical)
63
- */
64
87
  axis: {
65
88
  type: String,
66
89
  reflect: true,
67
90
  },
68
- /**
69
- * Determines where to display the paginator. Values include: (top | right | bottom | left)
70
- */
71
91
  pagination: {
72
92
  type: String,
73
93
  reflect: true,
@@ -154,15 +174,7 @@ export default class KemetScrollSnap extends LitElement {
154
174
  });
155
175
 
156
176
  this.slides = slides;
157
-
158
- /**
159
- * Fires when slide data has been created.
160
- */
161
- this.dispatchEvent(new CustomEvent('kemet-scroll-snap-make-slides', {
162
- bubbles: true,
163
- composed: true,
164
- detail: this.slides,
165
- }));
177
+ emitEvent(this, 'kemet-scroll-snap-make-slides', this.slides);
166
178
  }
167
179
 
168
180
  focusSlide(index) {
@@ -1,29 +1,34 @@
1
1
  import { html, LitElement } from 'lit';
2
2
 
3
+ /**
4
+ * @since 1.0.0
5
+ * @status stable
6
+ *
7
+ * @tagname kemet-option
8
+ * @summary An option in a select.
9
+ *
10
+ * @prop {string} label - The label of the option
11
+ * @prop {string} value - The value of the options
12
+ * @prop {boolean} disabled - Determines whether to disable the option
13
+ * @prop {boolean} selected - Selects the option if true
14
+ *
15
+ * @event kemet-input-focused - Fires when the input receives and loses focus
16
+ * @event kemet-input-status - Fires when there's a change in status
17
+ *
18
+ */
19
+
3
20
  export default class KemetOption extends LitElement {
4
21
  static get properties() {
5
22
  return {
6
- /**
7
- * The label of the option
8
- */
9
23
  label: {
10
24
  type: String,
11
25
  },
12
- /**
13
- * The value of the options
14
- */
15
26
  value: {
16
27
  type: String,
17
28
  },
18
- /**
19
- * Determines whether to disable the option
20
- */
21
29
  disabled: {
22
30
  type: Boolean,
23
31
  },
24
- /**
25
- * Selects the option if true
26
- */
27
32
  selected: {
28
33
  type: Boolean,
29
34
  },
@@ -1,5 +1,47 @@
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-select
10
+ * @summary An enhanced select element.
11
+ *
12
+ * @prop {string} slug - A string the uniquely identifies the select
13
+ * @prop {string} name - The name of the select
14
+ * @prop {string} value - The value of the select
15
+ * @prop {array} options - The options the select contains
16
+ * @prop {string} status - The status of the select
17
+ * @prop {boolean} required - Determines whether or not the field is required
18
+ * @prop {boolean} disabled - Determines whether or not the field is disabled
19
+ * @prop {boolean} multiple - Support of multiple choice selections
20
+ * @prop {string} icon - The dropdown icon
21
+ * @prop {number} iconSize - The dropdown icon size
22
+ * @prop {boolean} filled - Displays a filled select
23
+ * @prop {boolean} rounded - Displays rounded corners
24
+ *
25
+ * @csspart select
26
+ *
27
+ * @cssproperty --kemet-select-padding - The padding on the textarea. Default: 1rem.
28
+ * @cssproperty --kemet-select-border - The border of the textarea. Default: 1px solid var(--kemet-color-primary).
29
+ * @cssproperty --kemet-select-border-color-error - The border of the error state. Default: 1px solid var(--kemet-color-error).
30
+ * @cssproperty --kemet-select-border-color-success - The border of the success state. Default: 1px solid var(--kemet-color-success).
31
+ * @cssproperty --kemet-select-border-color-warning - The border of the warning state. Default: 1px solid var(--kemet-color-warning).
32
+ * @cssproperty --kemet-select-border-radius-rounded - The border radius on rounded. Default: var(--kemet-border-radius).
33
+ * @cssproperty --kemet-select-border-filled - The border on filled. Default: none.
34
+ * @cssproperty --kemet-select-color-filled - The color on filled. Default: var(--kemet-color-white).
35
+ * @cssproperty --kemet-select-background-color-filled - The background-color on filled. Default: var(--kemet-color-primary).
36
+ * @cssproperty --kemet-select-background-color-error - The error state background color. Default: var(--kemet-color-error).
37
+ * @cssproperty --kemet-select-background-color-success - The success state background color. Default: var(--kemet-color-success).
38
+ * @cssproperty --kemet-select-background-color-warning - The warning state background color. Default: var(--kemet-color-warning).
39
+ * @cssproperty --kemet-select-icon-right - The space on the right of the icon. Default: 1rem.
40
+ *
41
+ * @event kemet-input-focused - Fires when the input receives and loses focus
42
+ * @event kemet-input-status - Fires when there's a change in status
43
+ *
44
+ */
3
45
 
4
46
  export default class KemetSelect extends LitElement {
5
47
  static get styles() {
@@ -75,80 +117,44 @@ export default class KemetSelect extends LitElement {
75
117
 
76
118
  static get properties() {
77
119
  return {
78
- /**
79
- * A string the uniquely identifies the select
80
- */
81
120
  slug: {
82
121
  type: String,
83
122
  },
84
- /**
85
- * The name of the select
86
- */
87
123
  name: {
88
124
  type: String,
89
125
  },
90
- /**
91
- * The value of the select
92
- */
93
126
  value: {
94
127
  type: String,
95
128
  },
96
- /**
97
- * The options the select contains
98
- */
99
129
  options: {
100
130
  type: Array,
101
131
  },
102
- /**
103
- * The status of the select
104
- */
105
132
  status: {
106
133
  type: String,
107
134
  reflect: true,
108
135
  },
109
- /**
110
- * Determines whether or not the field is required
111
- */
112
136
  required: {
113
137
  type: Boolean,
114
138
  reflect: true,
115
139
  },
116
- /**
117
- * Determines whether or not the field is disabled
118
- */
119
140
  disabled: {
120
141
  type: Boolean,
121
142
  reflect: true,
122
143
  },
123
- /**
124
- * Support of multiple choice selections
125
- */
126
144
  multiple: {
127
145
  type: Boolean,
128
146
  },
129
- /**
130
- * The dropdown icon
131
- */
132
147
  icon: {
133
148
  type: String,
134
149
  },
135
- /**
136
- * The dropdown icon size
137
- */
138
150
  iconSize: {
139
151
  type: Number,
140
152
  attribute: 'icon-size',
141
153
  },
142
- /**
143
- * Displays a filled select
144
- */
145
154
  filled: {
146
155
  type: Boolean,
147
156
  reflect: true,
148
157
  },
149
- /**
150
- * Displays rounded corners
151
- */
152
158
  rounded: {
153
159
  type: Boolean,
154
160
  reflect: true,
@@ -164,12 +170,10 @@ export default class KemetSelect extends LitElement {
164
170
  this.icon = 'chevron-down';
165
171
  this.iconSize = 16;
166
172
 
167
- /**
168
- * Used only for form reactive controller
169
- */
173
+ /** @internal */
170
174
  this.formSubmitController = new FormSubmitController(this);
171
175
 
172
- // elements
176
+ /** @internal */
173
177
  this.control = this.closest('kemet-field');
174
178
  }
175
179
 
@@ -178,7 +182,7 @@ export default class KemetSelect extends LitElement {
178
182
  this.select = this.shadowRoot.querySelector('select');
179
183
  this.selectedOption = this.querySelector('[selected]');
180
184
 
181
- this.value = this.selecltedOption ? this.selectedOption.value : '';
185
+ this.value = this.selectedOption ? this.selectedOption.value : '';
182
186
  }
183
187
 
184
188
  render() {
@@ -247,17 +251,7 @@ export default class KemetSelect extends LitElement {
247
251
  */
248
252
  handleFocus() {
249
253
  this.hasFocus = true;
250
-
251
- /**
252
- * Fires when the input receives and loses focus
253
- */
254
- this.dispatchEvent(
255
- new CustomEvent('kemet-input-focused', {
256
- bubbles: true,
257
- composed: true,
258
- detail: true,
259
- }),
260
- );
254
+ emitEvent(this, 'kemet-input-focused', true);
261
255
  }
262
256
 
263
257
  /**
@@ -266,17 +260,7 @@ export default class KemetSelect extends LitElement {
266
260
  */
267
261
  handleBlur() {
268
262
  this.hasFocus = false;
269
-
270
- /**
271
- * Fires when the input receives and loses focus
272
- */
273
- this.dispatchEvent(
274
- new CustomEvent('kemet-input-focused', {
275
- bubbles: true,
276
- composed: true,
277
- detail: false,
278
- }),
279
- );
263
+ emitEvent(this, 'kemet-input-focused', false);
280
264
 
281
265
  this.select.checkValidity();
282
266
 
@@ -285,17 +269,11 @@ export default class KemetSelect extends LitElement {
285
269
  this.status = 'error';
286
270
  this.control.status = 'error';
287
271
 
288
- this.dispatchEvent(
289
- new CustomEvent('kemet-input-status', {
290
- bubbles: true,
291
- composed: true,
292
- detail: {
293
- status: 'error',
294
- validity: this.select.validity,
295
- element: this,
296
- },
297
- }),
298
- );
272
+ emitEvent(this, 'kemet-input-status', {
273
+ status: 'error',
274
+ validity: this.select.validity,
275
+ element: this,
276
+ });
299
277
  }
300
278
  }
301
279
 
@@ -310,20 +288,11 @@ export default class KemetSelect extends LitElement {
310
288
  this.invalid = false;
311
289
  this.status = 'standard';
312
290
 
313
- /**
314
- * Fires when there's a change in status
315
- */
316
- this.dispatchEvent(
317
- new CustomEvent('kemet-input-status', {
318
- bubbles: true,
319
- composed: true,
320
- detail: {
321
- status: 'standard',
322
- validity: this.select.validity,
323
- element: this,
324
- },
325
- }),
326
- );
291
+ emitEvent(this, 'kemet-input-status', {
292
+ status: 'standard',
293
+ validity: this.select.validity,
294
+ element: this,
295
+ });
327
296
  }
328
297
  }
329
298
 
@@ -335,20 +304,11 @@ export default class KemetSelect extends LitElement {
335
304
  this.invalid = true;
336
305
  this.status = 'error';
337
306
 
338
- /**
339
- * Fires when there's a change in status
340
- */
341
- this.dispatchEvent(
342
- new CustomEvent('kemet-input-status', {
343
- bubbles: true,
344
- composed: true,
345
- detail: {
346
- status: 'error',
347
- validity: this.select.validity,
348
- element: this,
349
- },
350
- }),
351
- );
307
+ emitEvent(this, 'kemet-input-status', {
308
+ status: 'error',
309
+ validity: this.select.validity,
310
+ element: this,
311
+ });
352
312
  }
353
313
 
354
314
  /**
@@ -1,5 +1,15 @@
1
1
  import { html, css, LitElement } from 'lit';
2
2
 
3
+ /**
4
+ * @since 1.3.0
5
+ * @status stable
6
+ *
7
+ * @tagname kemet-sortable-item
8
+ * @summary An item in a sortable list.
9
+ *
10
+ * @prop {boolean} ghost - Automatically set to true when an item is dragged to a new spot.
11
+ */
12
+
3
13
  export default class KemetSortableItem extends LitElement {
4
14
  static get styles() {
5
15
  return [
@@ -21,11 +31,7 @@ export default class KemetSortableItem extends LitElement {
21
31
 
22
32
  static get properties() {
23
33
  return {
24
- /* Automatically set to true when an item is dragged to a new spot */
25
- ghost: {
26
- type: Boolean,
27
- reflect: true,
28
- },
34
+ ghost: { type: Boolean, reflect: true },
29
35
  };
30
36
  }
31
37
 
@@ -1,5 +1,6 @@
1
1
  import { html, css, LitElement } from 'lit';
2
2
  import { polyfill } from 'mobile-drag-drop';
3
+ import { emitEvent } from '../../utilities/misc/events.js';
3
4
 
4
5
  const getMouseOffset = (event) => {
5
6
  const targetRect = event.target.getBoundingClientRect();
@@ -16,6 +17,16 @@ const getElementVerticalCenter = (element) => {
16
17
  return (rect.bottom - rect.top) / 2;
17
18
  };
18
19
 
20
+ /**
21
+ * @since 1.3.0
22
+ * @status stable
23
+ *
24
+ * @tagname kemet-sortable
25
+ * @summary A list that can be sorted by drag and drop.
26
+ *
27
+ * @event kemet-sortable-drag-end - Fires when an item has been moved to a new spot.
28
+ */
29
+
19
30
  export default class KemetSortable extends LitElement {
20
31
  static get styles() {
21
32
  return [
@@ -72,20 +83,11 @@ export default class KemetSortable extends LitElement {
72
83
  event.preventDefault();
73
84
  this.sortableItem.ghost = false;
74
85
 
75
- /**
76
- * Fires when an item has been moved to a new spot
77
- */
78
- this.dispatchEvent(
79
- new CustomEvent('kemet-sortable-drag-end', {
80
- bubbles: true,
81
- composed: true,
82
- detail: {
83
- event,
84
- current: this.sortableItem,
85
- all: this.querySelectorAll('kemet-sortable-item'),
86
- },
87
- }),
88
- );
86
+ emitEvent(this, 'kemet-sortable-drag-end', {
87
+ event,
88
+ current: this.sortableItem,
89
+ all: this.querySelectorAll('kemet-sortable-item'),
90
+ });
89
91
  }
90
92
  }
91
93
 
@@ -1,5 +1,22 @@
1
1
  import { html, css, LitElement } from 'lit';
2
2
 
3
+ /**
4
+ * @since 1.0.0
5
+ * @status stable
6
+ *
7
+ * @tagname kemet-svg
8
+ * @summary A svg from a set of custom SVGs.
9
+ *
10
+ * @prop {string} set - Defines which set of svgs is referenced.
11
+ * @prop {string} svg - The name (id) of the svg to be displayed.
12
+ * @prop {number} size - Sets the width and height of a the svg to the given value in pixels.
13
+ * @prop {string} ratio - The value for the preserveAspectRatio attribute of the svg.
14
+ * @prop {string} viewBox - The value for the viewBox attribute of the svg.
15
+ *
16
+ * @csspart svg - The svg element.
17
+ *
18
+ */
19
+
3
20
  export default class KemetSVG extends LitElement {
4
21
  static get styles() {
5
22
  return css`
@@ -16,33 +33,18 @@ export default class KemetSVG extends LitElement {
16
33
 
17
34
  static get properties() {
18
35
  return {
19
- /**
20
- * Defines which set of svgs is referenced.
21
- */
22
36
  set: {
23
37
  type: String,
24
38
  },
25
- /**
26
- * The name (id) of the svg to be displayed.
27
- */
28
39
  svg: {
29
40
  type: String,
30
41
  },
31
- /**
32
- * Sets the width and height of a the svg to the given value in pixels.
33
- */
34
42
  size: {
35
43
  type: Number,
36
44
  },
37
- /**
38
- * The value for the preserveAspectRatio attribute of the svg.
39
- */
40
45
  ratio: {
41
46
  type: String,
42
47
  },
43
- /**
44
- * The value for the viewBox attribute of the svg.
45
- */
46
48
  viewBox: {
47
49
  type: String,
48
50
  },
@@ -1,5 +1,16 @@
1
1
  import { LitElement, html, css } from 'lit';
2
2
 
3
+ /**
4
+ * @since 1.0.0
5
+ * @status stable
6
+ *
7
+ * @tagname kemet-svgs
8
+ * @summary A set of SVG graphics that can be referenced any where in a page or app.
9
+ *
10
+ * @prop {string} set - Defines the name for the set of svgs.
11
+ *
12
+ */
13
+
3
14
  export default class KemetSVGs extends LitElement {
4
15
  static get styles() {
5
16
  return css`
@@ -11,9 +22,6 @@ export default class KemetSVGs extends LitElement {
11
22
 
12
23
  static get properties() {
13
24
  return {
14
- /**
15
- * Defines the name for the set of svgs.
16
- */
17
25
  set: {
18
26
  type: String,
19
27
  },