@haiilo/catalyst 0.2.1 → 0.2.2

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 (66) hide show
  1. package/dist/catalyst/app-globals-f83c9e4a.js +722 -0
  2. package/dist/{components/cat-alert.js → catalyst/cat-alert.entry.js} +7 -27
  3. package/dist/{components/cat-badge.js → catalyst/cat-badge.entry.js} +7 -31
  4. package/dist/{components/cat-button.js → catalyst/cat-button.entry.js} +40 -59
  5. package/dist/{components/cat-icon-registry.js → catalyst/cat-icon-registry-59da2e37.js} +0 -0
  6. package/dist/{components/cat-icon2.js → catalyst/cat-icon.entry.js} +8 -27
  7. package/dist/{components/cat-menu.js → catalyst/cat-menu.entry.js} +636 -29
  8. package/dist/{components/cat-skeleton.js → catalyst/cat-skeleton.entry.js} +7 -30
  9. package/dist/{components/cat-spinner2.js → catalyst/cat-spinner.entry.js} +7 -25
  10. package/dist/catalyst/catalyst.css +1951 -1
  11. package/dist/catalyst/catalyst.esm.js +130 -1
  12. package/dist/catalyst/css-shim-e6dd2538.js +4 -0
  13. package/dist/catalyst/dom-7fc649b0.js +73 -0
  14. package/dist/catalyst/index-a0f41a84.js +3057 -0
  15. package/dist/catalyst/index.esm.js +1 -0
  16. package/dist/catalyst/shadow-css-4d56fa31.js +388 -0
  17. package/package.json +1 -1
  18. package/dist/catalyst/p-22fac0fb.js +0 -1
  19. package/dist/catalyst/p-2dc28db3.entry.js +0 -11
  20. package/dist/catalyst/p-e08f13c7.js +0 -1
  21. package/dist/cjs/app-globals-814f34aa.js +0 -135
  22. package/dist/cjs/cat-alert_7.cjs.entry.js +0 -3115
  23. package/dist/cjs/cat-icon-registry-909e38e7.js +0 -1385
  24. package/dist/cjs/catalyst.cjs.js +0 -21
  25. package/dist/cjs/index.cjs.js +0 -2
  26. package/dist/cjs/loader.cjs.js +0 -23
  27. package/dist/collection/collection-manifest.json +0 -19
  28. package/dist/collection/components/cat-alert/cat-alert.css +0 -57
  29. package/dist/collection/components/cat-alert/cat-alert.js +0 -49
  30. package/dist/collection/components/cat-badge/cat-badge.css +0 -154
  31. package/dist/collection/components/cat-badge/cat-badge.js +0 -141
  32. package/dist/collection/components/cat-button/cat-button.css +0 -319
  33. package/dist/collection/components/cat-button/cat-button.js +0 -590
  34. package/dist/collection/components/cat-icon/cat-icon-registry.js +0 -41
  35. package/dist/collection/components/cat-icon/cat-icon.css +0 -50
  36. package/dist/collection/components/cat-icon/cat-icon.js +0 -89
  37. package/dist/collection/components/cat-menu/cat-menu.css +0 -33
  38. package/dist/collection/components/cat-menu/cat-menu.js +0 -185
  39. package/dist/collection/components/cat-skeleton/cat-skeleton.css +0 -177
  40. package/dist/collection/components/cat-skeleton/cat-skeleton.js +0 -130
  41. package/dist/collection/components/cat-spinner/cat-spinner.css +0 -63
  42. package/dist/collection/components/cat-spinner/cat-spinner.js +0 -64
  43. package/dist/collection/index.cdn.js +0 -21
  44. package/dist/collection/index.js +0 -1
  45. package/dist/collection/init.js +0 -8
  46. package/dist/collection/utils/breakpoints.js +0 -11
  47. package/dist/collection/utils/media-matcher.js +0 -54
  48. package/dist/collection/utils/platform.js +0 -49
  49. package/dist/collection/utils/utils.js +0 -3
  50. package/dist/components/cat-icon.js +0 -6
  51. package/dist/components/cat-spinner.js +0 -6
  52. package/dist/components/index.js +0 -134
  53. package/dist/esm/app-globals-e1679c2d.js +0 -133
  54. package/dist/esm/cat-alert_7.entry.js +0 -3105
  55. package/dist/esm/cat-icon-registry-4d02ee6c.js +0 -1357
  56. package/dist/esm/catalyst.js +0 -19
  57. package/dist/esm/index.js +0 -1
  58. package/dist/esm/loader.js +0 -19
  59. package/dist/esm/polyfills/core-js.js +0 -11
  60. package/dist/esm/polyfills/css-shim.js +0 -1
  61. package/dist/esm/polyfills/dom.js +0 -79
  62. package/dist/esm/polyfills/es5-html-element.js +0 -1
  63. package/dist/esm/polyfills/index.js +0 -34
  64. package/dist/esm/polyfills/system.js +0 -6
  65. package/dist/index.cjs.js +0 -1
  66. package/dist/index.js +0 -1
@@ -1,590 +0,0 @@
1
- import { Component, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';
2
- import log from 'loglevel';
3
- import { Breakpoints, isBreakpoint } from '../../utils/breakpoints';
4
- import { MediaMatcher } from '../../utils/media-matcher';
5
- /**
6
- * Buttons are used for interface actions.
7
- *
8
- * @part button - The native anchor or button element.
9
- * @part content - The textual content of the button.
10
- * @part prefix - The prefix icon.
11
- * @part suffix - The suffix icon.
12
- */
13
- export class CatButton {
14
- constructor() {
15
- this._iconOnly = true;
16
- /**
17
- * The rendering style of the button.
18
- */
19
- this.variant = 'outlined';
20
- /**
21
- * The color palette of the button.
22
- */
23
- this.color = 'secondary';
24
- /**
25
- * The size of the button.
26
- */
27
- this.size = 'm';
28
- /**
29
- * Specifies that the button should be disabled. A disabled button is unusable
30
- * and un-clickable. Corresponds with the native HTML disabled attribute.
31
- */
32
- this.disabled = false;
33
- /**
34
- * Displays the button in a loading state with a spinner. Just like a disabled
35
- * button, an inactive button is unusable and un-clickable. However, it
36
- * retains the current focus state.
37
- */
38
- this.loading = false;
39
- /**
40
- * Allows the button to submit a form.
41
- */
42
- this.submit = false;
43
- /**
44
- * Ellipse overflowing button content.
45
- */
46
- this.ellipsed = true;
47
- /**
48
- * Use round button edges.
49
- */
50
- this.round = false;
51
- /**
52
- * Hide the actual button content and only display the icon.
53
- */
54
- this.iconOnly = false;
55
- /**
56
- * Display the icon as a suffix.
57
- */
58
- this.iconSuffix = false;
59
- }
60
- onIconOnlyChanged(value) {
61
- var _a, _b;
62
- // teardown
63
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
64
- (_a = this.mediaQueryList) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.mediaQueryListener);
65
- this.mediaQueryList = undefined;
66
- this.mediaQueryListener = undefined;
67
- // setup
68
- if (isBreakpoint(value)) {
69
- (_b = this.mediaMatcher) !== null && _b !== void 0 ? _b : (this.mediaMatcher = new MediaMatcher());
70
- this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);
71
- this.mediaQueryListener = (event) => (this._iconOnly = event.matches);
72
- this.mediaQueryList.addEventListener('change', this.mediaQueryListener);
73
- this._iconOnly = this.mediaQueryList.matches;
74
- }
75
- else {
76
- this._iconOnly = value;
77
- }
78
- }
79
- componentWillLoad() {
80
- this.onIconOnlyChanged(this.iconOnly);
81
- }
82
- componentWillRender() {
83
- if (this.isIconButton && !this.a11yLabel) {
84
- log.warn('[A11y] Missing ARIA label on icon button', this);
85
- }
86
- }
87
- haltDisabledEvents(event) {
88
- if (this.disabled || this.loading) {
89
- event.preventDefault();
90
- event.stopImmediatePropagation();
91
- }
92
- }
93
- /**
94
- * Sets focus on the button. Use this method instead of `button.focus()`.
95
- *
96
- * @param options An optional object providing options to control aspects of
97
- * the focusing process.
98
- */
99
- async setFocus(options) {
100
- this.button.focus(options);
101
- }
102
- render() {
103
- var _a;
104
- if (this.url) {
105
- return (h("a", { ref: el => (this.button = el), href: this.disabled ? undefined : this.url, target: this.urlTarget, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
106
- 'cat-button': true,
107
- 'cat-button-icon': this.isIconButton,
108
- 'cat-button-round': this.round,
109
- 'cat-button-loading': this.loading,
110
- 'cat-button-disabled': this.disabled,
111
- 'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
112
- [`cat-button-${this.variant}`]: Boolean(this.variant),
113
- [`cat-button-${this.color}`]: Boolean(this.color),
114
- [`cat-button-${this.size}`]: Boolean(this.size)
115
- }, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
116
- }
117
- else {
118
- return (h("button", { ref: el => (this.button = el), type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
119
- 'cat-button': true,
120
- 'cat-button-icon': this.isIconButton,
121
- 'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
122
- 'cat-button-loading': this.loading,
123
- 'cat-button-disabled': this.disabled,
124
- 'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
125
- [`cat-button-${this.variant}`]: Boolean(this.variant),
126
- [`cat-button-${this.color}`]: Boolean(this.color),
127
- [`cat-button-${this.size}`]: Boolean(this.size)
128
- }, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
129
- }
130
- }
131
- get iconSize() {
132
- switch (this.size) {
133
- case 'xs':
134
- return 's';
135
- default:
136
- return 'l';
137
- }
138
- }
139
- get spinnerSize() {
140
- switch (this.size) {
141
- case 'xs':
142
- return 'xs';
143
- default:
144
- return 'm';
145
- }
146
- }
147
- get isIconButton() {
148
- return Boolean(this.icon) && this._iconOnly;
149
- }
150
- get hasPrefixIcon() {
151
- return Boolean(this.icon) && !this._iconOnly && !this.iconSuffix;
152
- }
153
- get hasSuffixIcon() {
154
- return Boolean(this.icon) && !this._iconOnly && this.iconSuffix;
155
- }
156
- get content() {
157
- return [
158
- this.hasPrefixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-prefix", part: "prefix" })) : null,
159
- this.isIconButton ? (h("cat-icon", { icon: this.icon, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" },
160
- h("slot", null))),
161
- this.hasSuffixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-suffix", part: "suffix" })) : null,
162
- this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
163
- ];
164
- }
165
- onClick(event) {
166
- this.catClick.emit(event);
167
- }
168
- onFocus(event) {
169
- this.catFocus.emit(event);
170
- }
171
- onBlur(event) {
172
- this.catBlur.emit(event);
173
- }
174
- static get is() { return "cat-button"; }
175
- static get encapsulation() { return "shadow"; }
176
- static get originalStyleUrls() { return {
177
- "$": ["cat-button.scss"]
178
- }; }
179
- static get styleUrls() { return {
180
- "$": ["cat-button.css"]
181
- }; }
182
- static get properties() { return {
183
- "variant": {
184
- "type": "string",
185
- "mutable": false,
186
- "complexType": {
187
- "original": "'filled' | 'outlined' | 'text'",
188
- "resolved": "\"filled\" | \"outlined\" | \"text\"",
189
- "references": {}
190
- },
191
- "required": false,
192
- "optional": false,
193
- "docs": {
194
- "tags": [],
195
- "text": "The rendering style of the button."
196
- },
197
- "attribute": "variant",
198
- "reflect": false,
199
- "defaultValue": "'outlined'"
200
- },
201
- "color": {
202
- "type": "string",
203
- "mutable": false,
204
- "complexType": {
205
- "original": "'primary' | 'secondary' | 'danger' | 'success' | 'warning'",
206
- "resolved": "\"danger\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
207
- "references": {}
208
- },
209
- "required": false,
210
- "optional": false,
211
- "docs": {
212
- "tags": [],
213
- "text": "The color palette of the button."
214
- },
215
- "attribute": "color",
216
- "reflect": false,
217
- "defaultValue": "'secondary'"
218
- },
219
- "size": {
220
- "type": "string",
221
- "mutable": false,
222
- "complexType": {
223
- "original": "'xs' | 's' | 'm' | 'l' | 'xl'",
224
- "resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
225
- "references": {}
226
- },
227
- "required": false,
228
- "optional": false,
229
- "docs": {
230
- "tags": [],
231
- "text": "The size of the button."
232
- },
233
- "attribute": "size",
234
- "reflect": false,
235
- "defaultValue": "'m'"
236
- },
237
- "name": {
238
- "type": "string",
239
- "mutable": false,
240
- "complexType": {
241
- "original": "string",
242
- "resolved": "string | undefined",
243
- "references": {}
244
- },
245
- "required": false,
246
- "optional": true,
247
- "docs": {
248
- "tags": [],
249
- "text": "The name of the button, which gets paired with the button's value when\nsubmitted as part of a form. Corresponds with the native HTML name\nattribute."
250
- },
251
- "attribute": "name",
252
- "reflect": false
253
- },
254
- "value": {
255
- "type": "string",
256
- "mutable": false,
257
- "complexType": {
258
- "original": "string",
259
- "resolved": "string | undefined",
260
- "references": {}
261
- },
262
- "required": false,
263
- "optional": true,
264
- "docs": {
265
- "tags": [],
266
- "text": "The value of the button, which gets paired with the button's name when\nsubmitted as part of a form. Corresponds with the native HTML value\nattribute."
267
- },
268
- "attribute": "value",
269
- "reflect": false
270
- },
271
- "disabled": {
272
- "type": "boolean",
273
- "mutable": false,
274
- "complexType": {
275
- "original": "boolean",
276
- "resolved": "boolean",
277
- "references": {}
278
- },
279
- "required": false,
280
- "optional": false,
281
- "docs": {
282
- "tags": [],
283
- "text": "Specifies that the button should be disabled. A disabled button is unusable\nand un-clickable. Corresponds with the native HTML disabled attribute."
284
- },
285
- "attribute": "disabled",
286
- "reflect": false,
287
- "defaultValue": "false"
288
- },
289
- "loading": {
290
- "type": "boolean",
291
- "mutable": false,
292
- "complexType": {
293
- "original": "boolean",
294
- "resolved": "boolean",
295
- "references": {}
296
- },
297
- "required": false,
298
- "optional": false,
299
- "docs": {
300
- "tags": [],
301
- "text": "Displays the button in a loading state with a spinner. Just like a disabled\nbutton, an inactive button is unusable and un-clickable. However, it\nretains the current focus state."
302
- },
303
- "attribute": "loading",
304
- "reflect": false,
305
- "defaultValue": "false"
306
- },
307
- "submit": {
308
- "type": "boolean",
309
- "mutable": false,
310
- "complexType": {
311
- "original": "boolean",
312
- "resolved": "boolean",
313
- "references": {}
314
- },
315
- "required": false,
316
- "optional": false,
317
- "docs": {
318
- "tags": [],
319
- "text": "Allows the button to submit a form."
320
- },
321
- "attribute": "submit",
322
- "reflect": false,
323
- "defaultValue": "false"
324
- },
325
- "ellipsed": {
326
- "type": "boolean",
327
- "mutable": false,
328
- "complexType": {
329
- "original": "boolean",
330
- "resolved": "boolean",
331
- "references": {}
332
- },
333
- "required": false,
334
- "optional": false,
335
- "docs": {
336
- "tags": [],
337
- "text": "Ellipse overflowing button content."
338
- },
339
- "attribute": "ellipsed",
340
- "reflect": false,
341
- "defaultValue": "true"
342
- },
343
- "round": {
344
- "type": "boolean",
345
- "mutable": false,
346
- "complexType": {
347
- "original": "boolean",
348
- "resolved": "boolean",
349
- "references": {}
350
- },
351
- "required": false,
352
- "optional": false,
353
- "docs": {
354
- "tags": [],
355
- "text": "Use round button edges."
356
- },
357
- "attribute": "round",
358
- "reflect": false,
359
- "defaultValue": "false"
360
- },
361
- "url": {
362
- "type": "string",
363
- "mutable": false,
364
- "complexType": {
365
- "original": "string",
366
- "resolved": "string | undefined",
367
- "references": {}
368
- },
369
- "required": false,
370
- "optional": true,
371
- "docs": {
372
- "tags": [],
373
- "text": "A destination to link to, rendered in the href attribute of a link."
374
- },
375
- "attribute": "url",
376
- "reflect": false
377
- },
378
- "urlTarget": {
379
- "type": "string",
380
- "mutable": false,
381
- "complexType": {
382
- "original": "'_blank' | '_self'",
383
- "resolved": "\"_blank\" | \"_self\" | undefined",
384
- "references": {}
385
- },
386
- "required": false,
387
- "optional": true,
388
- "docs": {
389
- "tags": [],
390
- "text": "Specifies where to open the linked document."
391
- },
392
- "attribute": "url-target",
393
- "reflect": false
394
- },
395
- "icon": {
396
- "type": "string",
397
- "mutable": false,
398
- "complexType": {
399
- "original": "string",
400
- "resolved": "string | undefined",
401
- "references": {}
402
- },
403
- "required": false,
404
- "optional": true,
405
- "docs": {
406
- "tags": [],
407
- "text": "The name of an icon to be displayed in the button."
408
- },
409
- "attribute": "icon",
410
- "reflect": false
411
- },
412
- "iconOnly": {
413
- "type": "any",
414
- "mutable": false,
415
- "complexType": {
416
- "original": "boolean | Breakpoint",
417
- "resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\" | boolean",
418
- "references": {
419
- "Breakpoint": {
420
- "location": "import",
421
- "path": "../../utils/breakpoints"
422
- }
423
- }
424
- },
425
- "required": false,
426
- "optional": false,
427
- "docs": {
428
- "tags": [],
429
- "text": "Hide the actual button content and only display the icon."
430
- },
431
- "attribute": "icon-only",
432
- "reflect": false,
433
- "defaultValue": "false"
434
- },
435
- "iconSuffix": {
436
- "type": "boolean",
437
- "mutable": false,
438
- "complexType": {
439
- "original": "boolean",
440
- "resolved": "boolean",
441
- "references": {}
442
- },
443
- "required": false,
444
- "optional": false,
445
- "docs": {
446
- "tags": [],
447
- "text": "Display the icon as a suffix."
448
- },
449
- "attribute": "icon-suffix",
450
- "reflect": false,
451
- "defaultValue": "false"
452
- },
453
- "buttonId": {
454
- "type": "string",
455
- "mutable": false,
456
- "complexType": {
457
- "original": "string",
458
- "resolved": "string | undefined",
459
- "references": {}
460
- },
461
- "required": false,
462
- "optional": true,
463
- "docs": {
464
- "tags": [],
465
- "text": "Adds a unique identifier for the button. Please note that with this\nparticular component this ID is added inside the web component. If you need\nan ID on the HTML element, use the regular `id` attribute instead."
466
- },
467
- "attribute": "button-id",
468
- "reflect": false
469
- },
470
- "a11yLabel": {
471
- "type": "string",
472
- "mutable": false,
473
- "complexType": {
474
- "original": "string",
475
- "resolved": "string | undefined",
476
- "references": {}
477
- },
478
- "required": false,
479
- "optional": true,
480
- "docs": {
481
- "tags": [],
482
- "text": "Adds accessible label for the button that is only shown for screen\nreaders. Typically, this label text replaces the visible text on the\nbutton for users who use assistive technology."
483
- },
484
- "attribute": "a11y-label",
485
- "reflect": false
486
- }
487
- }; }
488
- static get states() { return {
489
- "_iconOnly": {}
490
- }; }
491
- static get events() { return [{
492
- "method": "catClick",
493
- "name": "catClick",
494
- "bubbles": true,
495
- "cancelable": true,
496
- "composed": true,
497
- "docs": {
498
- "tags": [],
499
- "text": "Emitted when the button is clicked."
500
- },
501
- "complexType": {
502
- "original": "MouseEvent",
503
- "resolved": "MouseEvent",
504
- "references": {
505
- "MouseEvent": {
506
- "location": "global"
507
- }
508
- }
509
- }
510
- }, {
511
- "method": "catFocus",
512
- "name": "catFocus",
513
- "bubbles": true,
514
- "cancelable": true,
515
- "composed": true,
516
- "docs": {
517
- "tags": [],
518
- "text": "Emitted when the button received focus."
519
- },
520
- "complexType": {
521
- "original": "FocusEvent",
522
- "resolved": "FocusEvent",
523
- "references": {
524
- "FocusEvent": {
525
- "location": "global"
526
- }
527
- }
528
- }
529
- }, {
530
- "method": "catBlur",
531
- "name": "catBlur",
532
- "bubbles": true,
533
- "cancelable": true,
534
- "composed": true,
535
- "docs": {
536
- "tags": [],
537
- "text": "Emitted when the button loses focus."
538
- },
539
- "complexType": {
540
- "original": "FocusEvent",
541
- "resolved": "FocusEvent",
542
- "references": {
543
- "FocusEvent": {
544
- "location": "global"
545
- }
546
- }
547
- }
548
- }]; }
549
- static get methods() { return {
550
- "setFocus": {
551
- "complexType": {
552
- "signature": "(options?: FocusOptions | undefined) => Promise<void>",
553
- "parameters": [{
554
- "tags": [{
555
- "name": "param",
556
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
557
- }],
558
- "text": "An optional object providing options to control aspects of\nthe focusing process."
559
- }],
560
- "references": {
561
- "Promise": {
562
- "location": "global"
563
- },
564
- "FocusOptions": {
565
- "location": "global"
566
- }
567
- },
568
- "return": "Promise<void>"
569
- },
570
- "docs": {
571
- "text": "Sets focus on the button. Use this method instead of `button.focus()`.",
572
- "tags": [{
573
- "name": "param",
574
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
575
- }]
576
- }
577
- }
578
- }; }
579
- static get watchers() { return [{
580
- "propName": "iconOnly",
581
- "methodName": "onIconOnlyChanged"
582
- }]; }
583
- static get listeners() { return [{
584
- "name": "click",
585
- "method": "haltDisabledEvents",
586
- "target": undefined,
587
- "capture": false,
588
- "passive": false
589
- }]; }
590
- }
@@ -1,41 +0,0 @@
1
- export class CatIconRegistry {
2
- constructor() {
3
- this.icons = new Map();
4
- // hide constructor
5
- }
6
- static getInstance() {
7
- if (!CatIconRegistry.instance) {
8
- CatIconRegistry.instance = new CatIconRegistry();
9
- }
10
- return CatIconRegistry.instance;
11
- }
12
- getIcon(name, setName) {
13
- return this.icons.get(this.buildName(name, setName));
14
- }
15
- addIcon(name, data, setName) {
16
- this.icons.set(this.buildName(name, setName), data);
17
- window.dispatchEvent(this.buildEvent('cat-icon-added', { name, setName }));
18
- }
19
- addIcons(icons, setName) {
20
- Object.entries(icons).forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));
21
- window.dispatchEvent(this.buildEvent('cat-icons-added', { names: Object.keys(icons), setName }));
22
- }
23
- removeIcon(name, setName) {
24
- this.icons.delete(this.buildName(name, setName));
25
- window.dispatchEvent(this.buildEvent('cat-icon-removed', { name, setName }));
26
- }
27
- removeIcons(names, setName) {
28
- names.forEach(name => this.icons.delete(this.buildName(name, setName)));
29
- window.dispatchEvent(this.buildEvent('cat-icons-removed', { names, setName }));
30
- }
31
- buildName(name, setName) {
32
- return setName ? `${setName}:name` : name;
33
- }
34
- buildEvent(name, detail) {
35
- return new CustomEvent(name, {
36
- bubbles: true,
37
- composed: true,
38
- detail
39
- });
40
- }
41
- }
@@ -1,50 +0,0 @@
1
- /**
2
- * Auto-generated file. Do not edit directly.
3
- */
4
- /* stylelint-disable value-keyword-case */
5
- /* stylelint-enable value-keyword-case */
6
- :host {
7
- display: inline-flex;
8
- vertical-align: middle;
9
- /* stylelint-disable property-no-vendor-prefix */
10
- -webkit-user-select: none;
11
- -ms-user-select: none;
12
- user-select: none;
13
- /* stylelint-enable property-no-vendor-prefix */
14
- }
15
-
16
- :host([hidden]) {
17
- display: none;
18
- }
19
-
20
- span {
21
- display: inline-flex;
22
- }
23
-
24
- svg {
25
- fill: currentColor;
26
- stroke: none;
27
- transform-origin: center center;
28
- width: 1em;
29
- height: 1em;
30
- }
31
-
32
- .cat-icon-xs svg {
33
- font-size: 0.75rem;
34
- }
35
-
36
- .cat-icon-s svg {
37
- font-size: 1rem;
38
- }
39
-
40
- .cat-icon-m svg {
41
- font-size: 1.25rem;
42
- }
43
-
44
- .cat-icon-l svg {
45
- font-size: 1.5rem;
46
- }
47
-
48
- .cat-icon-xl svg {
49
- font-size: 1.75rem;
50
- }