@haiilo/catalyst 0.0.11 → 0.1.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/LICENSE +1 -1
- package/dist/catalyst/app-globals-622e4f87.js +704 -0
- package/dist/catalyst/cat-button.entry.js +12 -4
- package/dist/catalyst/cat-icon.entry.js +1 -1
- package/dist/catalyst/cat-spinner.entry.js +1 -1
- package/dist/catalyst/catalyst.esm.js +2 -2
- package/dist/catalyst/{index-6672be93.js → index-72a1bbba.js} +1 -1
- package/dist/catalyst/p-17a20657.js +1 -0
- package/dist/catalyst/p-582935bb.entry.js +1 -0
- package/dist/catalyst/p-f3fad7a0.js +1 -0
- package/dist/cjs/app-globals-8908fe44.js +132 -0
- package/dist/cjs/app-globals-fe9ff8ba.js +706 -0
- package/dist/cjs/cat-button.cjs.entry.js +633 -0
- package/dist/cjs/cat-button_3.cjs.entry.js +645 -0
- package/dist/cjs/cat-icon-registry-850c538c.js +45 -0
- package/dist/cjs/cat-icon-registry-da00f7d6.js +1321 -0
- package/dist/cjs/cat-icon.cjs.entry.js +31 -0
- package/dist/cjs/cat-spinner.cjs.entry.js +25 -0
- package/dist/cjs/catalyst.cjs.js +128 -0
- package/dist/cjs/css-shim-3bfdba4f.js +6 -0
- package/dist/cjs/dom-8ac1ad03.js +75 -0
- package/dist/cjs/index-083488c8.js +3065 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +38 -0
- package/dist/cjs/shadow-css-41d9783d.js +390 -0
- package/dist/collection/collection-manifest.json +15 -0
- package/dist/collection/components/cat-button/cat-button.css +284 -0
- package/dist/collection/components/cat-button/cat-button.js +568 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js +41 -0
- package/dist/collection/components/cat-icon/cat-icon.css +49 -0
- package/dist/collection/components/cat-icon/cat-icon.js +89 -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-button.js +680 -0
- package/dist/components/cat-icon-registry.js +43 -0
- package/dist/components/cat-icon.js +6 -0
- package/dist/components/cat-icon2.js +47 -0
- package/dist/components/cat-spinner.js +6 -0
- package/dist/components/cat-spinner2.js +40 -0
- package/dist/components/index.js +705 -0
- package/dist/esm/app-globals-000601ea.js +130 -0
- package/dist/esm/app-globals-622e4f87.js +704 -0
- package/dist/esm/cat-button.entry.js +629 -0
- package/dist/esm/cat-button_3.entry.js +639 -0
- package/dist/esm/cat-icon-registry-59da2e37.js +43 -0
- package/dist/esm/cat-icon-registry-b66e3f57.js +1294 -0
- package/dist/esm/cat-icon.entry.js +27 -0
- package/dist/esm/cat-spinner.entry.js +21 -0
- package/dist/esm/catalyst.js +126 -0
- package/dist/esm/css-shim-20dbffa5.js +4 -0
- package/dist/esm/dom-c5ed0ba5.js +73 -0
- package/dist/esm/index-72a1bbba.js +3031 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +34 -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/esm/shadow-css-8c625855.js +388 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/cat-button/cat-button.d.ts +1 -0
- package/package.json +3 -3
- package/dist/catalyst/app-globals-54573336.js +0 -716
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
+
import { CatIconRegistry } from './cat-icon-registry';
|
|
3
|
+
/**
|
|
4
|
+
* Icons are used to provide additional meaning or in places where text label
|
|
5
|
+
* doesn't fit.
|
|
6
|
+
*
|
|
7
|
+
* @part icon - The native span element wrapping the SVG icon.
|
|
8
|
+
*/
|
|
9
|
+
export class CatIcon {
|
|
10
|
+
constructor() {
|
|
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 is() { return "cat-icon"; }
|
|
27
|
+
static get encapsulation() { return "shadow"; }
|
|
28
|
+
static get originalStyleUrls() { return {
|
|
29
|
+
"$": ["cat-icon.scss"]
|
|
30
|
+
}; }
|
|
31
|
+
static get styleUrls() { return {
|
|
32
|
+
"$": ["cat-icon.css"]
|
|
33
|
+
}; }
|
|
34
|
+
static get properties() { return {
|
|
35
|
+
"icon": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"mutable": false,
|
|
38
|
+
"complexType": {
|
|
39
|
+
"original": "string",
|
|
40
|
+
"resolved": "string",
|
|
41
|
+
"references": {}
|
|
42
|
+
},
|
|
43
|
+
"required": false,
|
|
44
|
+
"optional": false,
|
|
45
|
+
"docs": {
|
|
46
|
+
"tags": [],
|
|
47
|
+
"text": "The name of the icon."
|
|
48
|
+
},
|
|
49
|
+
"attribute": "icon",
|
|
50
|
+
"reflect": false,
|
|
51
|
+
"defaultValue": "''"
|
|
52
|
+
},
|
|
53
|
+
"size": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "'xs' | 's' | 'm' | 'l' | 'xl' | 'inline'",
|
|
58
|
+
"resolved": "\"inline\" | \"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "The size of the icon."
|
|
66
|
+
},
|
|
67
|
+
"attribute": "size",
|
|
68
|
+
"reflect": false,
|
|
69
|
+
"defaultValue": "'m'"
|
|
70
|
+
},
|
|
71
|
+
"a11yLabel": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string | undefined",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Adds accessible label for the icon that is only shown for screen\nreaders. The `aria-hidden` attribute will be set if no label is present."
|
|
84
|
+
},
|
|
85
|
+
"attribute": "a11y-label",
|
|
86
|
+
"reflect": false
|
|
87
|
+
}
|
|
88
|
+
}; }
|
|
89
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
:host[hidden] {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
span {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
svg {
|
|
24
|
+
fill: none;
|
|
25
|
+
stroke: currentColor;
|
|
26
|
+
stroke-dasharray: 135px;
|
|
27
|
+
stroke-dashoffset: 95px;
|
|
28
|
+
stroke-linecap: round;
|
|
29
|
+
stroke-width: 5px;
|
|
30
|
+
transform-origin: center center;
|
|
31
|
+
animation: cat-spinner 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;
|
|
32
|
+
width: 1em;
|
|
33
|
+
height: 1em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cat-spinner-xs svg {
|
|
37
|
+
font-size: 0.75rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.cat-spinner-s svg {
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.cat-spinner-m svg {
|
|
45
|
+
font-size: 1.25rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.cat-spinner-l svg {
|
|
49
|
+
font-size: 1.5rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.cat-spinner-xl svg {
|
|
53
|
+
font-size: 1.75rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes cat-spinner {
|
|
57
|
+
from {
|
|
58
|
+
transform: rotate(0deg);
|
|
59
|
+
}
|
|
60
|
+
to {
|
|
61
|
+
transform: rotate(360deg);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -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
|
+
}
|