@haiilo/catalyst 0.1.0 → 0.2.1
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 -1403
- package/dist/catalyst/catalyst.esm.js +1 -126
- package/dist/catalyst/index.esm.js +0 -1
- package/dist/catalyst/p-22fac0fb.js +1 -0
- package/dist/catalyst/p-2dc28db3.entry.js +11 -0
- package/dist/catalyst/{p-f3fad7a0.js → p-e08f13c7.js} +1 -1
- package/dist/cjs/{app-globals-8908fe44.js → app-globals-814f34aa.js} +5 -2
- package/dist/cjs/cat-alert_7.cjs.entry.js +3115 -0
- package/dist/cjs/{cat-icon-registry-da00f7d6.js → cat-icon-registry-909e38e7.js} +65 -1
- package/dist/cjs/catalyst.cjs.js +7 -114
- package/dist/cjs/loader.cjs.js +5 -20
- package/dist/collection/collection-manifest.json +6 -2
- 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 +43 -8
- package/dist/collection/components/cat-button/cat-button.js +28 -6
- package/dist/collection/components/cat-icon/cat-icon.css +2 -1
- 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/components/cat-alert.d.ts +11 -0
- package/dist/components/cat-alert.js +42 -0
- package/dist/components/cat-badge.d.ts +11 -0
- package/dist/components/cat-badge.js +66 -0
- package/dist/components/cat-button.js +14 -42
- package/dist/components/cat-icon2.js +4 -5
- package/dist/components/cat-menu.d.ts +11 -0
- package/dist/components/cat-menu.js +2377 -0
- package/dist/components/cat-skeleton.d.ts +11 -0
- package/dist/components/cat-skeleton.js +76 -0
- package/dist/components/cat-spinner2.js +3 -4
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +4 -575
- package/dist/esm/{app-globals-000601ea.js → app-globals-e1679c2d.js} +5 -2
- package/dist/esm/cat-alert_7.entry.js +3105 -0
- package/dist/esm/{cat-icon-registry-b66e3f57.js → cat-icon-registry-4d02ee6c.js} +65 -2
- package/dist/esm/catalyst.js +6 -113
- package/dist/esm/loader.js +4 -19
- package/dist/esm/polyfills/css-shim.js +1 -1
- 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 +32 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +28 -0
- package/dist/types/components.d.ts +153 -0
- package/package.json +12 -9
- package/dist/catalyst/app-globals-622e4f87.js +0 -704
- package/dist/catalyst/cat-button.entry.js +0 -629
- package/dist/catalyst/cat-icon-registry-59da2e37.js +0 -43
- package/dist/catalyst/cat-icon.entry.js +0 -27
- package/dist/catalyst/cat-spinner.entry.js +0 -21
- package/dist/catalyst/css-shim-20dbffa5.js +0 -4
- package/dist/catalyst/dom-c5ed0ba5.js +0 -73
- package/dist/catalyst/index-72a1bbba.js +0 -3031
- package/dist/catalyst/p-17a20657.js +0 -1
- package/dist/catalyst/p-582935bb.entry.js +0 -1
- package/dist/catalyst/shadow-css-8c625855.js +0 -388
- package/dist/cjs/app-globals-fe9ff8ba.js +0 -706
- package/dist/cjs/cat-button.cjs.entry.js +0 -633
- package/dist/cjs/cat-button_3.cjs.entry.js +0 -645
- package/dist/cjs/cat-icon-registry-850c538c.js +0 -45
- package/dist/cjs/cat-icon.cjs.entry.js +0 -31
- package/dist/cjs/cat-spinner.cjs.entry.js +0 -25
- package/dist/cjs/css-shim-3bfdba4f.js +0 -6
- package/dist/cjs/dom-8ac1ad03.js +0 -75
- package/dist/cjs/index-083488c8.js +0 -3065
- package/dist/cjs/shadow-css-41d9783d.js +0 -390
- package/dist/esm/app-globals-622e4f87.js +0 -704
- package/dist/esm/cat-button.entry.js +0 -629
- package/dist/esm/cat-button_3.entry.js +0 -639
- package/dist/esm/cat-icon-registry-59da2e37.js +0 -43
- package/dist/esm/cat-icon.entry.js +0 -27
- package/dist/esm/cat-spinner.entry.js +0 -21
- package/dist/esm/css-shim-20dbffa5.js +0 -4
- package/dist/esm/dom-c5ed0ba5.js +0 -73
- package/dist/esm/index-72a1bbba.js +0 -3031
- package/dist/esm/shadow-css-8c625855.js +0 -388
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CatSkeleton extends Components.CatSkeleton, HTMLElement {}
|
|
4
|
+
export const CatSkeleton: {
|
|
5
|
+
prototype: CatSkeleton;
|
|
6
|
+
new (): CatSkeleton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const catSkeletonCss = ":host{display:flex;flex-direction:column;position:relative;--background:#ebecf0;--highlight:#d7dbe0;--speed:2s}:host([variant=square]),:host([variant=circle]){display:inline-flex}:host([hidden]){display:none}:host([variant=head]){margin-bottom:0.5rem}:host([variant=body]){margin-bottom:1rem}.cat-skeleton{display:block;border-radius:0.25rem;background:var(--background)}.cat-skeleton-circle{border-radius:10rem}.cat-skeleton-xs.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 1.5rem)}.cat-skeleton-xs.cat-skeleton-square,.cat-skeleton-xs.cat-skeleton-circle{width:var(--width, 1.5rem);height:var(--height, 1.5rem)}.cat-skeleton-xs.cat-skeleton-head,.cat-skeleton-xs.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-xs.cat-skeleton-head{height:calc(0.9375rem - 4px);margin:calc((1.25rem - 0.9375rem + 4px) * 0.5) 0}.cat-skeleton-xs.cat-skeleton-body{height:calc(0.75rem - 4px);margin:calc((1rem - 0.75rem + 4px) * 0.5) 0}.cat-skeleton-s.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 2rem)}.cat-skeleton-s.cat-skeleton-square,.cat-skeleton-s.cat-skeleton-circle{width:var(--width, 2rem);height:var(--height, 2rem)}.cat-skeleton-s.cat-skeleton-head,.cat-skeleton-s.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-s.cat-skeleton-head{height:calc(1.125rem - 4px);margin:calc((1.5rem - 1.125rem + 4px) * 0.5) 0}.cat-skeleton-s.cat-skeleton-body{height:calc(0.875rem - 4px);margin:calc((1rem - 0.875rem + 4px) * 0.5) 0}.cat-skeleton-m.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 2.5rem)}.cat-skeleton-m.cat-skeleton-square,.cat-skeleton-m.cat-skeleton-circle{width:var(--width, 2.5rem);height:var(--height, 2.5rem)}.cat-skeleton-m.cat-skeleton-head,.cat-skeleton-m.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-m.cat-skeleton-head{height:calc(1.25rem - 4px);margin:calc((1.5rem - 1.25rem + 4px) * 0.5) 0}.cat-skeleton-m.cat-skeleton-body{height:calc(0.9375rem - 4px);margin:calc((1.25rem - 0.9375rem + 4px) * 0.5) 0}.cat-skeleton-l.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 3rem)}.cat-skeleton-l.cat-skeleton-square,.cat-skeleton-l.cat-skeleton-circle{width:var(--width, 3rem);height:var(--height, 3rem)}.cat-skeleton-l.cat-skeleton-head,.cat-skeleton-l.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-l.cat-skeleton-head{height:calc(1.5rem - 4px);margin:calc((1.75rem - 1.5rem + 4px) * 0.5) 0}.cat-skeleton-l.cat-skeleton-body{height:calc(1.125rem - 4px);margin:calc((1.5rem - 1.125rem + 4px) * 0.5) 0}.cat-skeleton-xl.cat-skeleton-rectangle{width:var(--width, 100%);height:var(--height, 3.5rem)}.cat-skeleton-xl.cat-skeleton-square,.cat-skeleton-xl.cat-skeleton-circle{width:var(--width, 3.5rem);height:var(--height, 3.5rem)}.cat-skeleton-xl.cat-skeleton-head,.cat-skeleton-xl.cat-skeleton-body{width:var(--width, var(--line-width, 100%))}.cat-skeleton-xl.cat-skeleton-head{height:calc(1.75rem - 4px);margin:calc((2rem - 1.75rem + 4px) * 0.5) 0}.cat-skeleton-xl.cat-skeleton-body{height:calc(1.25rem - 4px);margin:calc((1.5rem - 1.25rem + 4px) * 0.5) 0}.cat-skeleton-sheen{background:linear-gradient(90deg, var(--background) 33%, var(--highlight) 50%, var(--background) 66%) var(--background);background-size:300% 100%;animation:sheen var(--speed) ease-in-out infinite}.cat-skeleton-pulse{position:relative;overflow:hidden}.cat-skeleton-pulse::before{content:\"\";display:block;position:absolute;width:100%;height:100%;background-color:var(--highlight);animation:var(--speed) ease-in-out 0.5s infinite normal none running pulse;opacity:0}@keyframes sheen{0%{background-position:right}}@keyframes pulse{50%{opacity:1}}";
|
|
4
|
+
|
|
5
|
+
const CatSkeleton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
/**
|
|
11
|
+
* The animation style of the skeleton.
|
|
12
|
+
*/
|
|
13
|
+
this.effect = 'sheen';
|
|
14
|
+
/**
|
|
15
|
+
* The rendering style of the skeleton.
|
|
16
|
+
*/
|
|
17
|
+
this.variant = 'rectangle';
|
|
18
|
+
/**
|
|
19
|
+
* The size of the skeleton. If the variant is set to "head", the size values
|
|
20
|
+
* "xs" to "xl" translate to the head levels `h1` to `h5`.
|
|
21
|
+
*/
|
|
22
|
+
this.size = 'm';
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (h(Host, null, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
|
|
26
|
+
'cat-skeleton': true,
|
|
27
|
+
[`cat-skeleton-${this.effect}`]: Boolean(this.effect),
|
|
28
|
+
[`cat-skeleton-${this.variant}`]: Boolean(this.variant),
|
|
29
|
+
[`cat-skeleton-${this.size}`]: Boolean(this.size)
|
|
30
|
+
} })))));
|
|
31
|
+
}
|
|
32
|
+
get count() {
|
|
33
|
+
switch (this.variant) {
|
|
34
|
+
case 'head':
|
|
35
|
+
return Math.max(1, this.lines || 1);
|
|
36
|
+
case 'body':
|
|
37
|
+
return Math.max(1, this.lines || 3);
|
|
38
|
+
default:
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
get style() {
|
|
43
|
+
return this.variant === 'head' || this.variant === 'body'
|
|
44
|
+
? {
|
|
45
|
+
'--line-width': `${this.random(50, 100)}%`
|
|
46
|
+
}
|
|
47
|
+
: undefined;
|
|
48
|
+
}
|
|
49
|
+
random(min, max) {
|
|
50
|
+
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
51
|
+
}
|
|
52
|
+
static get style() { return catSkeletonCss; }
|
|
53
|
+
}, [1, "cat-skeleton", {
|
|
54
|
+
"effect": [1],
|
|
55
|
+
"variant": [1],
|
|
56
|
+
"size": [1],
|
|
57
|
+
"lines": [2]
|
|
58
|
+
}]);
|
|
59
|
+
function defineCustomElement$1() {
|
|
60
|
+
if (typeof customElements === "undefined") {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const components = ["cat-skeleton"];
|
|
64
|
+
components.forEach(tagName => { switch (tagName) {
|
|
65
|
+
case "cat-skeleton":
|
|
66
|
+
if (!customElements.get(tagName)) {
|
|
67
|
+
customElements.define(tagName, CatSkeleton$1);
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
} });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const CatSkeleton = CatSkeleton$1;
|
|
74
|
+
const defineCustomElement = defineCustomElement$1;
|
|
75
|
+
|
|
76
|
+
export { CatSkeleton, defineCustomElement };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HTMLElement, h
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const catSpinnerCss = ":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:none;stroke:currentColor;stroke-dasharray:135px;stroke-dashoffset:95px;stroke-linecap:round;stroke-width:5px;transform-origin:center center;animation:cat-spinner 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;width:1em;height:1em}.cat-spinner-xs svg{font-size:0.75rem}.cat-spinner-s svg{font-size:1rem}.cat-spinner-m svg{font-size:1.25rem}.cat-spinner-l svg{font-size:1.5rem}.cat-spinner-xl svg{font-size:1.75rem}@keyframes cat-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const CatSpinner = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
@@ -18,8 +18,7 @@ let CatSpinner = class extends HTMLElement {
|
|
|
18
18
|
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { cx: "24", cy: "24", r: "21.5" }))));
|
|
19
19
|
}
|
|
20
20
|
static get style() { return catSpinnerCss; }
|
|
21
|
-
}
|
|
22
|
-
CatSpinner = /*@__PURE__*/ proxyCustomElement(CatSpinner, [1, "cat-spinner", {
|
|
21
|
+
}, [1, "cat-spinner", {
|
|
23
22
|
"size": [1],
|
|
24
23
|
"a11yLabel": [1, "a11y-label"]
|
|
25
24
|
}]);
|
|
@@ -9,7 +9,7 @@ import type { Components, JSX } from "../types/components";
|
|
|
9
9
|
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
10
|
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
11
|
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
-
*
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
13
|
* will have to ensure the static assets are copied to its build directory.
|
|
14
14
|
*/
|
|
15
15
|
export declare const setAssetPath: (path: string) => void;
|