@haiilo/catalyst 0.1.1 → 0.2.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/dist/catalyst/catalyst.css +1 -1410
- package/dist/catalyst/catalyst.esm.js +1 -126
- package/dist/catalyst/index.esm.js +0 -1
- package/dist/catalyst/p-4c438c2d.entry.js +11 -0
- package/dist/catalyst/p-73ee291d.js +1 -0
- package/dist/catalyst/p-94273abf.js +1 -0
- package/dist/cjs/app-globals-a3b3cf88.js +135 -0
- package/dist/cjs/cat-alert_7.cjs.entry.js +3115 -0
- package/dist/cjs/cat-icon-registry-eeff9b7d.js +1359 -0
- package/dist/cjs/catalyst.cjs.js +21 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/cat-alert/cat-alert.css +57 -0
- package/dist/collection/components/cat-alert/cat-alert.js +49 -0
- package/dist/collection/components/cat-badge/cat-badge.css +154 -0
- package/dist/collection/components/cat-badge/cat-badge.js +141 -0
- package/dist/collection/components/cat-button/cat-button.css +319 -0
- package/dist/collection/components/cat-button/cat-button.js +590 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js +41 -0
- package/dist/collection/components/cat-icon/cat-icon.css +50 -0
- package/dist/collection/components/cat-icon/cat-icon.js +89 -0
- package/dist/collection/components/cat-menu/cat-menu.css +33 -0
- package/dist/collection/components/cat-menu/cat-menu.js +185 -0
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +177 -0
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +130 -0
- package/dist/collection/components/cat-spinner/cat-spinner.css +63 -0
- package/dist/collection/components/cat-spinner/cat-spinner.js +64 -0
- package/dist/collection/index.cdn.js +21 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/init.js +8 -0
- package/dist/collection/utils/breakpoints.js +11 -0
- package/dist/collection/utils/media-matcher.js +54 -0
- package/dist/collection/utils/platform.js +49 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/cat-alert.d.ts +11 -0
- package/dist/components/cat-alert.js +43 -0
- package/dist/components/cat-badge.d.ts +11 -0
- package/dist/components/cat-badge.js +67 -0
- package/dist/{catalyst/cat-button.entry.js → components/cat-button.js} +68 -44
- package/dist/{catalyst/cat-icon-registry-59da2e37.js → components/cat-icon-registry.js} +0 -0
- package/dist/components/cat-icon.js +6 -0
- package/dist/components/cat-icon2.js +47 -0
- package/dist/{catalyst/cat-menu.entry.js → components/cat-menu.js} +71 -650
- package/dist/components/cat-skeleton.d.ts +11 -0
- package/dist/components/cat-skeleton.js +77 -0
- package/dist/components/cat-spinner.js +6 -0
- package/dist/{catalyst/cat-spinner.entry.js → components/cat-spinner2.js} +25 -6
- package/dist/components/index.js +134 -0
- package/dist/esm/app-globals-fc0806a7.js +133 -0
- package/dist/esm/cat-alert_7.entry.js +3105 -0
- package/dist/esm/cat-icon-registry-d877de13.js +1331 -0
- package/dist/esm/catalyst.js +19 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/cat-alert/cat-alert.d.ts +12 -0
- package/dist/types/components/cat-badge/cat-badge.d.ts +28 -0
- package/dist/types/components/cat-button/cat-button.d.ts +5 -0
- package/dist/types/components/cat-menu/cat-menu.d.ts +13 -4
- package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +28 -0
- package/dist/types/components.d.ts +129 -0
- package/package.json +1 -1
- package/dist/catalyst/app-globals-f83c9e4a.js +0 -722
- package/dist/catalyst/cat-icon.entry.js +0 -27
- package/dist/catalyst/css-shim-20dbffa5.js +0 -4
- package/dist/catalyst/dom-c5ed0ba5.js +0 -73
- package/dist/catalyst/index-45406d3b.js +0 -3031
- package/dist/catalyst/shadow-css-8c625855.js +0 -388
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
+
/**
|
|
3
|
+
* Spinners are used to indicate users that their action is being processed.
|
|
4
|
+
*/
|
|
5
|
+
export class CatSpinner {
|
|
6
|
+
constructor() {
|
|
7
|
+
/**
|
|
8
|
+
* The size of the spinner.
|
|
9
|
+
*/
|
|
10
|
+
this.size = 'm';
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return (h("span", { "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
14
|
+
[`cat-spinner-${this.size}`]: this.size !== 'inline'
|
|
15
|
+
} },
|
|
16
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" },
|
|
17
|
+
h("circle", { cx: "24", cy: "24", r: "21.5" }))));
|
|
18
|
+
}
|
|
19
|
+
static get is() { return "cat-spinner"; }
|
|
20
|
+
static get encapsulation() { return "shadow"; }
|
|
21
|
+
static get originalStyleUrls() { return {
|
|
22
|
+
"$": ["cat-spinner.scss"]
|
|
23
|
+
}; }
|
|
24
|
+
static get styleUrls() { return {
|
|
25
|
+
"$": ["cat-spinner.css"]
|
|
26
|
+
}; }
|
|
27
|
+
static get properties() { return {
|
|
28
|
+
"size": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"mutable": false,
|
|
31
|
+
"complexType": {
|
|
32
|
+
"original": "'xs' | 's' | 'm' | 'l' | 'xl' | 'inline'",
|
|
33
|
+
"resolved": "\"inline\" | \"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
|
|
34
|
+
"references": {}
|
|
35
|
+
},
|
|
36
|
+
"required": false,
|
|
37
|
+
"optional": false,
|
|
38
|
+
"docs": {
|
|
39
|
+
"tags": [],
|
|
40
|
+
"text": "The size of the spinner."
|
|
41
|
+
},
|
|
42
|
+
"attribute": "size",
|
|
43
|
+
"reflect": false,
|
|
44
|
+
"defaultValue": "'m'"
|
|
45
|
+
},
|
|
46
|
+
"a11yLabel": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"mutable": false,
|
|
49
|
+
"complexType": {
|
|
50
|
+
"original": "string",
|
|
51
|
+
"resolved": "string | undefined",
|
|
52
|
+
"references": {}
|
|
53
|
+
},
|
|
54
|
+
"required": false,
|
|
55
|
+
"optional": true,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": "Adds accessible label for the spinner that is only shown for screen\nreaders. The `aria-hidden` attribute will be set if no label is present."
|
|
59
|
+
},
|
|
60
|
+
"attribute": "a11y-label",
|
|
61
|
+
"reflect": false
|
|
62
|
+
}
|
|
63
|
+
}; }
|
|
64
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(function (doc) {
|
|
2
|
+
var scriptElm = doc.scripts[doc.scripts.length - 1];
|
|
3
|
+
var warn = ['Discouraged script use, please remove: ' + scriptElm.outerHTML];
|
|
4
|
+
|
|
5
|
+
warn.push('To improve performance it is recommended to set the script in the head as follows:');
|
|
6
|
+
|
|
7
|
+
var parts = scriptElm.src.split('/');
|
|
8
|
+
parts.pop();
|
|
9
|
+
// add subfolder(s) here
|
|
10
|
+
// parts.push('...');
|
|
11
|
+
var url = parts.join('/');
|
|
12
|
+
|
|
13
|
+
scriptElm = doc.createElement('script');
|
|
14
|
+
scriptElm.setAttribute('type', 'module');
|
|
15
|
+
scriptElm.src = url + '/catalyst.esm.js';
|
|
16
|
+
warn.push(scriptElm.outerHTML);
|
|
17
|
+
scriptElm.setAttribute('data-stencil-namespace', 'catalyst');
|
|
18
|
+
doc.head.appendChild(scriptElm);
|
|
19
|
+
|
|
20
|
+
console.warn(warn.join('\n'));
|
|
21
|
+
})(document);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const _breakpoints = ['xs', 's', 'm', 'l', 'xl'];
|
|
2
|
+
export const Breakpoints = {
|
|
3
|
+
xs: '(max-width: 539.98px)',
|
|
4
|
+
s: '(max-width: 767.98px)',
|
|
5
|
+
m: '(max-width: 991.98px)',
|
|
6
|
+
l: '(max-width: 1199.98px)',
|
|
7
|
+
xl: '(max-width: 1399.98px)'
|
|
8
|
+
};
|
|
9
|
+
export function isBreakpoint(value) {
|
|
10
|
+
return typeof value === 'string' && _breakpoints.includes(value);
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import log from 'loglevel';
|
|
2
|
+
import { Platform } from './platform';
|
|
3
|
+
// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts
|
|
4
|
+
/** Global registry for all dynamically-created, injected media queries. */
|
|
5
|
+
const mediaQueriesForWebkitCompatibility = new Set();
|
|
6
|
+
/** Style tag that holds all of the dynamically-created media queries. */
|
|
7
|
+
let mediaQueryStyleNode;
|
|
8
|
+
/** A utility for calling matchMedia queries. */
|
|
9
|
+
export class MediaMatcher {
|
|
10
|
+
constructor() {
|
|
11
|
+
this._platform = new Platform();
|
|
12
|
+
this._matchMedia = window.matchMedia.bind(window);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Evaluates the given media query and returns the native MediaQueryList from which results
|
|
16
|
+
* can be retrieved.
|
|
17
|
+
* Confirms the layout engine will trigger for the selector query provided and returns the
|
|
18
|
+
* MediaQueryList for the query provided.
|
|
19
|
+
*/
|
|
20
|
+
matchMedia(query) {
|
|
21
|
+
if (this._platform.WEBKIT || this._platform.BLINK) {
|
|
22
|
+
createEmptyStyleRule(query);
|
|
23
|
+
}
|
|
24
|
+
return this._matchMedia(query);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Creates an empty stylesheet that is used to work around browser inconsistencies related to
|
|
29
|
+
* `matchMedia`. At the time of writing, it handles the following cases:
|
|
30
|
+
* 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`
|
|
31
|
+
* to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.
|
|
32
|
+
* 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules
|
|
33
|
+
* inside the `@media` match existing elements on the page. We work around it by having one rule
|
|
34
|
+
* targeting the `body`. See https://github.com/angular/components/issues/23546.
|
|
35
|
+
*/
|
|
36
|
+
function createEmptyStyleRule(query) {
|
|
37
|
+
if (mediaQueriesForWebkitCompatibility.has(query)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
if (!mediaQueryStyleNode) {
|
|
42
|
+
mediaQueryStyleNode = document.createElement('style');
|
|
43
|
+
mediaQueryStyleNode.setAttribute('type', 'text/css');
|
|
44
|
+
document.head.appendChild(mediaQueryStyleNode);
|
|
45
|
+
}
|
|
46
|
+
if (mediaQueryStyleNode.sheet) {
|
|
47
|
+
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
|
|
48
|
+
mediaQueriesForWebkitCompatibility.add(query);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
log.error(e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts
|
|
2
|
+
// Whether the current platform supports the V8 Break Iterator. The V8 check
|
|
3
|
+
// is necessary to detect all Blink based browsers.
|
|
4
|
+
let hasV8BreakIterator;
|
|
5
|
+
// We need a try/catch around the reference to `Intl`, because accessing it in some cases can
|
|
6
|
+
// cause IE to throw. These cases are tied to particular versions of Windows and can happen if
|
|
7
|
+
// the consumer is providing a polyfilled `Map`. See:
|
|
8
|
+
// https://github.com/Microsoft/ChakraCore/issues/3189
|
|
9
|
+
// https://github.com/angular/components/issues/15687
|
|
10
|
+
try {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;
|
|
13
|
+
}
|
|
14
|
+
catch (_a) {
|
|
15
|
+
hasV8BreakIterator = false;
|
|
16
|
+
}
|
|
17
|
+
export class Platform {
|
|
18
|
+
constructor() {
|
|
19
|
+
/** Whether the current browser is Microsoft Edge. */
|
|
20
|
+
this.EDGE = /(edge)/i.test(navigator.userAgent);
|
|
21
|
+
/** Whether the current rendering engine is Microsoft Trident. */
|
|
22
|
+
this.TRIDENT = /(msie|trident)/i.test(navigator.userAgent);
|
|
23
|
+
// EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
|
|
24
|
+
/** Whether the current rendering engine is Blink. */
|
|
25
|
+
this.BLINK =
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;
|
|
28
|
+
// Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
|
|
29
|
+
// ensure that Webkit runs standalone and is not used as another engine's base.
|
|
30
|
+
/** Whether the current rendering engine is WebKit. */
|
|
31
|
+
this.WEBKIT = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
|
|
32
|
+
/** Whether the current platform is Apple iOS. */
|
|
33
|
+
this.IOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
|
|
34
|
+
// It's difficult to detect the plain Gecko engine, because most of the browsers identify
|
|
35
|
+
// them self as Gecko-like browsers and modify the userAgent's according to that.
|
|
36
|
+
// Since we only cover one explicit Firefox case, we can simply check for Firefox
|
|
37
|
+
// instead of having an unstable check for Gecko.
|
|
38
|
+
/** Whether the current browser is Firefox. */
|
|
39
|
+
this.FIREFOX = /(firefox|minefield)/i.test(navigator.userAgent);
|
|
40
|
+
/** Whether the current platform is Android. */
|
|
41
|
+
// Trident on mobile adds the android platform to the userAgent to trick detections.
|
|
42
|
+
this.ANDROID = /android/i.test(navigator.userAgent) && !this.TRIDENT;
|
|
43
|
+
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
|
|
44
|
+
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
|
|
45
|
+
// Safari browser should also use Webkit as its layout engine.
|
|
46
|
+
/** Whether the current browser is Safari. */
|
|
47
|
+
this.SAFARI = /safari/i.test(navigator.userAgent) && this.WEBKIT;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CatAlert extends Components.CatAlert, HTMLElement {}
|
|
4
|
+
export const CatAlert: {
|
|
5
|
+
prototype: CatAlert;
|
|
6
|
+
new (): CatAlert;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const catAlertCss = ":host{display:block;margin-bottom:1rem}:host([hidden]){display:none}.cat-alert{font:inherit;color:rgb(var(--text));background-color:rgba(var(--bg), 0.1);box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);border-radius:0.25rem;padding:0.75rem 1rem;width:100%}::slotted(:last-child){margin-bottom:0 !important}.cat-alert-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.cat-alert-secondary{--bg:105, 118, 135;--text:0, 0, 0;--border:105, 118, 135}.cat-alert-success{--bg:0, 132, 88;--text:0, 132, 88;--border:0, 132, 88}.cat-alert-warning{--bg:255, 206, 128;--text:159, 97, 0;--border:159, 97, 0}.cat-alert-danger{--bg:217, 52, 13;--text:217, 52, 13;--border:217, 52, 13}";
|
|
4
|
+
|
|
5
|
+
let CatAlert$1 = class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
/**
|
|
11
|
+
* The color palette of the alert.
|
|
12
|
+
*/
|
|
13
|
+
this.color = 'primary';
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (h("div", { part: "alert", class: {
|
|
17
|
+
'cat-alert': true,
|
|
18
|
+
[`cat-alert-${this.color}`]: Boolean(this.color)
|
|
19
|
+
} }, h("slot", null)));
|
|
20
|
+
}
|
|
21
|
+
static get style() { return catAlertCss; }
|
|
22
|
+
};
|
|
23
|
+
CatAlert$1 = /*@__PURE__*/ proxyCustomElement(CatAlert$1, [1, "cat-alert", {
|
|
24
|
+
"color": [1]
|
|
25
|
+
}]);
|
|
26
|
+
function defineCustomElement$1() {
|
|
27
|
+
if (typeof customElements === "undefined") {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const components = ["cat-alert"];
|
|
31
|
+
components.forEach(tagName => { switch (tagName) {
|
|
32
|
+
case "cat-alert":
|
|
33
|
+
if (!customElements.get(tagName)) {
|
|
34
|
+
customElements.define(tagName, CatAlert$1);
|
|
35
|
+
}
|
|
36
|
+
break;
|
|
37
|
+
} });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const CatAlert = CatAlert$1;
|
|
41
|
+
const defineCustomElement = defineCustomElement$1;
|
|
42
|
+
|
|
43
|
+
export { CatAlert, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CatBadge extends Components.CatBadge, HTMLElement {}
|
|
4
|
+
export const CatBadge: {
|
|
5
|
+
prototype: CatBadge;
|
|
6
|
+
new (): CatBadge;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.cat-badge{font:inherit;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:0.125rem;text-decoration:none;width:100%;box-sizing:border-box;line-height:1;white-space:nowrap}.cat-badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-badge-round{border-radius:10rem}.cat-badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.cat-badge-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.cat-badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.cat-badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.cat-badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.cat-badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.cat-badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0 0.1875rem}.cat-badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}.cat-badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0 0.3125rem}.cat-badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0 0.375rem}.cat-badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:0 0.4375rem}.cat-badge-pulse.cat-badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.cat-badge-pulse.cat-badge-outlined{animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0px 0px 0px 0.5rem}100%{box-shadow:transparent 0px 0px 0px 0px}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--border), 0.2)}70%{box-shadow:transparent 0px 0px 0px 0.5rem, inset 0 0 0 1px rgba(var(--border), 0.2)}100%{box-shadow:transparent 0px 0px 0px 0px, inset 0 0 0 1px rgba(var(--border), 0.2)}}";
|
|
4
|
+
|
|
5
|
+
let CatBadge$1 = class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
/**
|
|
11
|
+
* The rendering style of the badge.
|
|
12
|
+
*/
|
|
13
|
+
this.variant = 'filled';
|
|
14
|
+
/**
|
|
15
|
+
* The color palette of the badge.
|
|
16
|
+
*/
|
|
17
|
+
this.color = 'primary';
|
|
18
|
+
/**
|
|
19
|
+
* The size of the badge.
|
|
20
|
+
*/
|
|
21
|
+
this.size = 'm';
|
|
22
|
+
/**
|
|
23
|
+
* Use round badge edges.
|
|
24
|
+
*/
|
|
25
|
+
this.round = false;
|
|
26
|
+
/**
|
|
27
|
+
* Draw attention to the badge with a subtle animation.
|
|
28
|
+
*/
|
|
29
|
+
this.pulse = false;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (h("span", { part: "badge", class: {
|
|
33
|
+
'cat-badge': true,
|
|
34
|
+
'cat-badge-round': this.round,
|
|
35
|
+
'cat-badge-pulse': this.pulse,
|
|
36
|
+
[`cat-badge-${this.variant}`]: Boolean(this.variant),
|
|
37
|
+
[`cat-badge-${this.color}`]: Boolean(this.color),
|
|
38
|
+
[`cat-badge-${this.size}`]: Boolean(this.size)
|
|
39
|
+
} }, h("slot", null)));
|
|
40
|
+
}
|
|
41
|
+
static get style() { return catBadgeCss; }
|
|
42
|
+
};
|
|
43
|
+
CatBadge$1 = /*@__PURE__*/ proxyCustomElement(CatBadge$1, [1, "cat-badge", {
|
|
44
|
+
"variant": [1],
|
|
45
|
+
"color": [1],
|
|
46
|
+
"size": [1],
|
|
47
|
+
"round": [4],
|
|
48
|
+
"pulse": [4]
|
|
49
|
+
}]);
|
|
50
|
+
function defineCustomElement$1() {
|
|
51
|
+
if (typeof customElements === "undefined") {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const components = ["cat-badge"];
|
|
55
|
+
components.forEach(tagName => { switch (tagName) {
|
|
56
|
+
case "cat-badge":
|
|
57
|
+
if (!customElements.get(tagName)) {
|
|
58
|
+
customElements.define(tagName, CatBadge$1);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
} });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const CatBadge = CatBadge$1;
|
|
65
|
+
const defineCustomElement = defineCustomElement$1;
|
|
66
|
+
|
|
67
|
+
export { CatBadge, defineCustomElement };
|
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLElement, createEvent, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './cat-icon2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
2
4
|
|
|
3
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
6
|
|
|
5
|
-
function getDefaultExportFromCjs (x) {
|
|
6
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
7
|
function createCommonjsModule(fn, basedir, module) {
|
|
10
8
|
return module = {
|
|
11
9
|
path: basedir,
|
|
12
10
|
exports: {},
|
|
13
11
|
require: function (path, base) {
|
|
14
|
-
return commonjsRequire(
|
|
12
|
+
return commonjsRequire();
|
|
15
13
|
}
|
|
16
14
|
}, fn(module, module.exports), module.exports;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
20
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
24
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function getAugmentedNamespace(n) {
|
|
28
|
-
if (n.__esModule) return n;
|
|
29
|
-
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
30
|
-
Object.keys(n).forEach(function (k) {
|
|
31
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
32
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return n[k];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
return a;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
17
|
function commonjsRequire () {
|
|
43
18
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
44
19
|
}
|
|
@@ -51,16 +26,12 @@ var loglevel = createCommonjsModule(function (module) {
|
|
|
51
26
|
* Licensed under the MIT license.
|
|
52
27
|
*/
|
|
53
28
|
(function (root, definition) {
|
|
54
|
-
|
|
55
|
-
if (typeof undefined === 'function' && undefined.amd) {
|
|
56
|
-
undefined(definition);
|
|
57
|
-
} else if ('object' === 'object' && module.exports) {
|
|
29
|
+
if (module.exports) {
|
|
58
30
|
module.exports = definition();
|
|
59
31
|
} else {
|
|
60
32
|
root.log = definition();
|
|
61
33
|
}
|
|
62
34
|
}(commonjsGlobal, function () {
|
|
63
|
-
"use strict";
|
|
64
35
|
|
|
65
36
|
// Slightly dubious tricks to cut down minimized file size
|
|
66
37
|
var noop = function() {};
|
|
@@ -458,22 +429,25 @@ function createEmptyStyleRule(query) {
|
|
|
458
429
|
}
|
|
459
430
|
}
|
|
460
431
|
|
|
461
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host[hidden]{display:none}.cat-button{font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid #0071ff;outline-offset:1px}.cat-button-content{flex:1 1 auto;text-align:center}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:underline}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host-context(nav) .cat-button-content{text-align:left}";
|
|
432
|
+
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid #0071ff;outline-offset:1px}.cat-button-content{flex:1 1 auto;text-align:center}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:underline}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1rem;padding-right:1rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1rem;padding-right:1rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1rem;padding-right:1rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1rem;padding-right:1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1rem;padding-right:1rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host-context(nav) .cat-button-content{text-align:left}";
|
|
462
433
|
|
|
463
|
-
let CatButton = class {
|
|
464
|
-
constructor(
|
|
465
|
-
|
|
434
|
+
let CatButton$1 = class extends HTMLElement {
|
|
435
|
+
constructor() {
|
|
436
|
+
super();
|
|
437
|
+
this.__registerHost();
|
|
438
|
+
this.__attachShadow();
|
|
439
|
+
this.catClick = createEvent(this, "catClick", 7);
|
|
466
440
|
this.catFocus = createEvent(this, "catFocus", 7);
|
|
467
441
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
468
442
|
this._iconOnly = true;
|
|
469
443
|
/**
|
|
470
444
|
* The rendering style of the button.
|
|
471
445
|
*/
|
|
472
|
-
this.variant = '
|
|
446
|
+
this.variant = 'outlined';
|
|
473
447
|
/**
|
|
474
448
|
* The color palette of the button.
|
|
475
449
|
*/
|
|
476
|
-
this.color = '
|
|
450
|
+
this.color = 'secondary';
|
|
477
451
|
/**
|
|
478
452
|
* The size of the button.
|
|
479
453
|
*/
|
|
@@ -565,7 +539,7 @@ let CatButton = class {
|
|
|
565
539
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
566
540
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
567
541
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
568
|
-
}, onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
542
|
+
}, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
569
543
|
}
|
|
570
544
|
else {
|
|
571
545
|
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: {
|
|
@@ -578,7 +552,7 @@ let CatButton = class {
|
|
|
578
552
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
579
553
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
580
554
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
581
|
-
}, onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
555
|
+
}, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
582
556
|
}
|
|
583
557
|
}
|
|
584
558
|
get iconSize() {
|
|
@@ -614,6 +588,9 @@ let CatButton = class {
|
|
|
614
588
|
this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
|
|
615
589
|
];
|
|
616
590
|
}
|
|
591
|
+
onClick(event) {
|
|
592
|
+
this.catClick.emit(event);
|
|
593
|
+
}
|
|
617
594
|
onFocus(event) {
|
|
618
595
|
this.catFocus.emit(event);
|
|
619
596
|
}
|
|
@@ -623,7 +600,54 @@ let CatButton = class {
|
|
|
623
600
|
static get watchers() { return {
|
|
624
601
|
"iconOnly": ["onIconOnlyChanged"]
|
|
625
602
|
}; }
|
|
603
|
+
static get style() { return catButtonCss; }
|
|
626
604
|
};
|
|
627
|
-
CatButton
|
|
605
|
+
CatButton$1 = /*@__PURE__*/ proxyCustomElement(CatButton$1, [1, "cat-button", {
|
|
606
|
+
"variant": [1],
|
|
607
|
+
"color": [1],
|
|
608
|
+
"size": [1],
|
|
609
|
+
"name": [1],
|
|
610
|
+
"value": [1],
|
|
611
|
+
"disabled": [4],
|
|
612
|
+
"loading": [4],
|
|
613
|
+
"submit": [4],
|
|
614
|
+
"ellipsed": [4],
|
|
615
|
+
"round": [4],
|
|
616
|
+
"url": [1],
|
|
617
|
+
"urlTarget": [1, "url-target"],
|
|
618
|
+
"icon": [1],
|
|
619
|
+
"iconOnly": [8, "icon-only"],
|
|
620
|
+
"iconSuffix": [4, "icon-suffix"],
|
|
621
|
+
"buttonId": [1, "button-id"],
|
|
622
|
+
"a11yLabel": [1, "a11y-label"],
|
|
623
|
+
"_iconOnly": [32],
|
|
624
|
+
"setFocus": [64]
|
|
625
|
+
}, [[0, "click", "haltDisabledEvents"]]]);
|
|
626
|
+
function defineCustomElement$1() {
|
|
627
|
+
if (typeof customElements === "undefined") {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const components = ["cat-button", "cat-icon", "cat-spinner"];
|
|
631
|
+
components.forEach(tagName => { switch (tagName) {
|
|
632
|
+
case "cat-button":
|
|
633
|
+
if (!customElements.get(tagName)) {
|
|
634
|
+
customElements.define(tagName, CatButton$1);
|
|
635
|
+
}
|
|
636
|
+
break;
|
|
637
|
+
case "cat-icon":
|
|
638
|
+
if (!customElements.get(tagName)) {
|
|
639
|
+
defineCustomElement$3();
|
|
640
|
+
}
|
|
641
|
+
break;
|
|
642
|
+
case "cat-spinner":
|
|
643
|
+
if (!customElements.get(tagName)) {
|
|
644
|
+
defineCustomElement$2();
|
|
645
|
+
}
|
|
646
|
+
break;
|
|
647
|
+
} });
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const CatButton = CatButton$1;
|
|
651
|
+
const defineCustomElement = defineCustomElement$1;
|
|
628
652
|
|
|
629
|
-
export { CatButton
|
|
653
|
+
export { CatButton, defineCustomElement };
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { C as CatIconRegistry } from './cat-icon-registry.js';
|
|
3
|
+
|
|
4
|
+
const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}span{display:inline-flex}svg{fill:currentColor;stroke:none;transform-origin:center center;width:1em;height:1em}.cat-icon-xs svg{font-size:0.75rem}.cat-icon-s svg{font-size:1rem}.cat-icon-m svg{font-size:1.25rem}.cat-icon-l svg{font-size:1.5rem}.cat-icon-xl svg{font-size:1.75rem}";
|
|
5
|
+
|
|
6
|
+
let CatIcon = class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.iconRegistry = CatIconRegistry.getInstance();
|
|
12
|
+
/**
|
|
13
|
+
* The name of the icon.
|
|
14
|
+
*/
|
|
15
|
+
this.icon = '';
|
|
16
|
+
/**
|
|
17
|
+
* The size of the icon.
|
|
18
|
+
*/
|
|
19
|
+
this.size = 'm';
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h("span", { innerHTML: this.iconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
23
|
+
[`cat-icon-${this.size}`]: this.size !== 'inline'
|
|
24
|
+
} }));
|
|
25
|
+
}
|
|
26
|
+
static get style() { return catIconCss; }
|
|
27
|
+
};
|
|
28
|
+
CatIcon = /*@__PURE__*/ proxyCustomElement(CatIcon, [1, "cat-icon", {
|
|
29
|
+
"icon": [1],
|
|
30
|
+
"size": [1],
|
|
31
|
+
"a11yLabel": [1, "a11y-label"]
|
|
32
|
+
}]);
|
|
33
|
+
function defineCustomElement() {
|
|
34
|
+
if (typeof customElements === "undefined") {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const components = ["cat-icon"];
|
|
38
|
+
components.forEach(tagName => { switch (tagName) {
|
|
39
|
+
case "cat-icon":
|
|
40
|
+
if (!customElements.get(tagName)) {
|
|
41
|
+
customElements.define(tagName, CatIcon);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
} });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { CatIcon as C, defineCustomElement as d };
|