@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
|
@@ -268,6 +268,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
268
268
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
269
269
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
270
270
|
}
|
|
271
|
+
else if (memberName === 'style') {
|
|
272
|
+
// update style attribute, css properties and values
|
|
273
|
+
{
|
|
274
|
+
for (const prop in oldValue) {
|
|
275
|
+
if (!newValue || newValue[prop] == null) {
|
|
276
|
+
if (prop.includes('-')) {
|
|
277
|
+
elm.style.removeProperty(prop);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
elm.style[prop] = '';
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
for (const prop in newValue) {
|
|
286
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
287
|
+
if (prop.includes('-')) {
|
|
288
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
elm.style[prop] = newValue[prop];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
271
296
|
else if (memberName === 'ref') {
|
|
272
297
|
// minifier will clean this up
|
|
273
298
|
if (newValue) {
|
|
@@ -730,6 +755,7 @@ const postUpdateComponent = (hostRef) => {
|
|
|
730
755
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
731
756
|
const elm = hostRef.$hostElement$;
|
|
732
757
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
758
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
733
759
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
734
760
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
735
761
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -737,6 +763,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
737
763
|
// DOM WRITE!
|
|
738
764
|
addHydratedFlag(elm);
|
|
739
765
|
}
|
|
766
|
+
{
|
|
767
|
+
safeCall(instance, 'componentDidLoad');
|
|
768
|
+
}
|
|
740
769
|
endPostUpdate();
|
|
741
770
|
{
|
|
742
771
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -791,6 +820,29 @@ const then = (promise, thenFn) => {
|
|
|
791
820
|
};
|
|
792
821
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
793
822
|
;
|
|
823
|
+
/**
|
|
824
|
+
* Parse a new property value for a given property type.
|
|
825
|
+
*
|
|
826
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
827
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
828
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
829
|
+
* 2. the type stored from `propType`.
|
|
830
|
+
*
|
|
831
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
832
|
+
*
|
|
833
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
834
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
835
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
836
|
+
* ```tsx
|
|
837
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
838
|
+
* ```
|
|
839
|
+
*
|
|
840
|
+
* HTML prop values on the other hand, will always a string
|
|
841
|
+
*
|
|
842
|
+
* @param propValue the new value to coerce to some type
|
|
843
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
844
|
+
* @returns the parsed/coerced value
|
|
845
|
+
*/
|
|
794
846
|
const parsePropertyValue = (propValue, propType) => {
|
|
795
847
|
// ensure this value is of the correct prop type
|
|
796
848
|
if (propValue != null && !isComplexType(propValue)) {
|
|
@@ -799,6 +851,10 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
799
851
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
800
852
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
801
853
|
}
|
|
854
|
+
if (propType & 2 /* Number */) {
|
|
855
|
+
// force it to be a number
|
|
856
|
+
return parseFloat(propValue);
|
|
857
|
+
}
|
|
802
858
|
if (propType & 1 /* String */) {
|
|
803
859
|
// could have been passed as a number or boolean
|
|
804
860
|
// but we still want it as a string
|
|
@@ -820,7 +876,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
820
876
|
const flags = hostRef.$flags$;
|
|
821
877
|
const instance = hostRef.$lazyInstance$ ;
|
|
822
878
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
823
|
-
|
|
879
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
880
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
881
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
882
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
824
883
|
// gadzooks! the property's value has changed!!
|
|
825
884
|
// set our new value!
|
|
826
885
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
@@ -1081,12 +1140,16 @@ const connectedCallback = (elm) => {
|
|
|
1081
1140
|
const disconnectedCallback = (elm) => {
|
|
1082
1141
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1083
1142
|
const hostRef = getHostRef(elm);
|
|
1143
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1084
1144
|
{
|
|
1085
1145
|
if (hostRef.$rmListeners$) {
|
|
1086
1146
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1087
1147
|
hostRef.$rmListeners$ = undefined;
|
|
1088
1148
|
}
|
|
1089
1149
|
}
|
|
1150
|
+
{
|
|
1151
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1152
|
+
}
|
|
1090
1153
|
}
|
|
1091
1154
|
};
|
|
1092
1155
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -1314,6 +1377,7 @@ class CatIconRegistry {
|
|
|
1314
1377
|
}
|
|
1315
1378
|
|
|
1316
1379
|
exports.CatIconRegistry = CatIconRegistry;
|
|
1380
|
+
exports.Host = Host;
|
|
1317
1381
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1318
1382
|
exports.createEvent = createEvent;
|
|
1319
1383
|
exports.h = h;
|
package/dist/cjs/catalyst.cjs.js
CHANGED
|
@@ -1,128 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
5
|
-
require('./cat-icon-registry-850c538c.js');
|
|
3
|
+
const catIconRegistry = require('./cat-icon-registry-909e38e7.js');
|
|
4
|
+
const appGlobals = require('./app-globals-814f34aa.js');
|
|
6
5
|
|
|
7
6
|
/*
|
|
8
|
-
Stencil Client Patch Browser v2.
|
|
7
|
+
Stencil Client Patch Browser v2.15.0 | MIT Licensed | https://stenciljs.com
|
|
9
8
|
*/
|
|
10
|
-
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
|
11
9
|
const patchBrowser = () => {
|
|
12
|
-
// NOTE!! This fn cannot use async/await!
|
|
13
|
-
if (index.BUILD.isDev && !index.BUILD.isTesting) {
|
|
14
|
-
index.consoleDevInfo('Running in development mode.');
|
|
15
|
-
}
|
|
16
|
-
if (index.BUILD.cssVarShim) {
|
|
17
|
-
// shim css vars
|
|
18
|
-
index.plt.$cssShim$ = index.win.__cssshim;
|
|
19
|
-
}
|
|
20
|
-
if (index.BUILD.cloneNodeFix) {
|
|
21
|
-
// opted-in to polyfill cloneNode() for slot polyfilled components
|
|
22
|
-
patchCloneNodeFix(index.H.prototype);
|
|
23
|
-
}
|
|
24
|
-
if (index.BUILD.profile && !performance.mark) {
|
|
25
|
-
// not all browsers support performance.mark/measure (Safari 10)
|
|
26
|
-
performance.mark = performance.measure = () => {
|
|
27
|
-
/*noop*/
|
|
28
|
-
};
|
|
29
|
-
performance.getEntriesByName = () => [];
|
|
30
|
-
}
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
const scriptElm = index.BUILD.scriptDataOpts || index.BUILD.safari10 || index.BUILD.dynamicImportShim
|
|
33
|
-
? Array.from(index.doc.querySelectorAll('script')).find((s) => new RegExp(`\/${index.NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
|
34
|
-
s.getAttribute('data-stencil-namespace') === index.NAMESPACE)
|
|
35
|
-
: null;
|
|
36
10
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('catalyst.cjs.js', document.baseURI).href));
|
|
37
|
-
const opts =
|
|
38
|
-
if (
|
|
39
|
-
// Safari < v11 support: This IF is true if it's Safari below v11.
|
|
40
|
-
// This fn cannot use async/await since Safari didn't support it until v11,
|
|
41
|
-
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
|
|
42
|
-
// so both the ESM file and nomodule file would get downloaded. Only Safari
|
|
43
|
-
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added
|
|
44
|
-
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
|
|
45
|
-
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
|
|
46
|
-
return {
|
|
47
|
-
then() {
|
|
48
|
-
/* promise noop */
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (!index.BUILD.safari10 && importMeta !== '') {
|
|
11
|
+
const opts = {};
|
|
12
|
+
if (importMeta !== '') {
|
|
53
13
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
54
14
|
}
|
|
55
|
-
|
|
56
|
-
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, index.win.location.href)).href;
|
|
57
|
-
if (index.BUILD.dynamicImportShim) {
|
|
58
|
-
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
|
59
|
-
}
|
|
60
|
-
if (index.BUILD.dynamicImportShim && !index.win.customElements) {
|
|
61
|
-
// module support, but no custom elements support (Old Edge)
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-dom" */ './dom-8ac1ad03.js'); }).then(() => opts);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return index.promiseResolve(opts);
|
|
67
|
-
};
|
|
68
|
-
const patchDynamicImport = (base, orgScriptElm) => {
|
|
69
|
-
const importFunctionName = getDynamicImportFunction(index.NAMESPACE);
|
|
70
|
-
try {
|
|
71
|
-
// test if this browser supports dynamic imports
|
|
72
|
-
// There is a caching issue in V8, that breaks using import() in Function
|
|
73
|
-
// By generating a random string, we can workaround it
|
|
74
|
-
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
|
|
75
|
-
index.win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
// this shim is specifically for browsers that do support "esm" imports
|
|
79
|
-
// however, they do NOT support "dynamic" imports
|
|
80
|
-
// basically this code is for old Edge, v18 and below
|
|
81
|
-
const moduleMap = new Map();
|
|
82
|
-
index.win[importFunctionName] = (src) => {
|
|
83
|
-
const url = new URL(src, base).href;
|
|
84
|
-
let mod = moduleMap.get(url);
|
|
85
|
-
if (!mod) {
|
|
86
|
-
const script = index.doc.createElement('script');
|
|
87
|
-
script.type = 'module';
|
|
88
|
-
script.crossOrigin = orgScriptElm.crossOrigin;
|
|
89
|
-
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
|
|
90
|
-
type: 'application/javascript',
|
|
91
|
-
}));
|
|
92
|
-
mod = new Promise((resolve) => {
|
|
93
|
-
script.onload = () => {
|
|
94
|
-
resolve(index.win[importFunctionName].m);
|
|
95
|
-
script.remove();
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
moduleMap.set(url, mod);
|
|
99
|
-
index.doc.head.appendChild(script);
|
|
100
|
-
}
|
|
101
|
-
return mod;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
106
|
-
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
|
107
|
-
HTMLElementPrototype.cloneNode = function (deep) {
|
|
108
|
-
if (this.nodeName === 'TEMPLATE') {
|
|
109
|
-
return nativeCloneNodeFn.call(this, deep);
|
|
110
|
-
}
|
|
111
|
-
const clonedNode = nativeCloneNodeFn.call(this, false);
|
|
112
|
-
const srcChildNodes = this.childNodes;
|
|
113
|
-
if (deep) {
|
|
114
|
-
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
115
|
-
// Node.ATTRIBUTE_NODE === 2, and checking because IE11
|
|
116
|
-
if (srcChildNodes[i].nodeType !== 2) {
|
|
117
|
-
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return clonedNode;
|
|
122
|
-
};
|
|
15
|
+
return catIconRegistry.promiseResolve(opts);
|
|
123
16
|
};
|
|
124
17
|
|
|
125
18
|
patchBrowser().then(options => {
|
|
126
19
|
appGlobals.globalScripts();
|
|
127
|
-
return
|
|
20
|
+
return catIconRegistry.bootstrapLazy([["cat-alert_7.cjs",[[1,"cat-button",{"variant":[1],"color":[1],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"ellipsed":[4],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconSuffix":[4,"icon-suffix"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"_iconOnly":[32],"setFocus":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-alert",{"color":[1]}],[1,"cat-badge",{"variant":[1],"color":[1],"size":[1],"round":[4],"pulse":[4]}],[1,"cat-menu",{"placement":[1]},[[0,"catClick","clickHandler"]]],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}]]]], options);
|
|
128
21
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,36 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
7
|
-
require('./cat-icon-registry-850c538c.js');
|
|
5
|
+
const catIconRegistry = require('./cat-icon-registry-909e38e7.js');
|
|
6
|
+
const appGlobals = require('./app-globals-814f34aa.js');
|
|
8
7
|
|
|
9
8
|
/*
|
|
10
|
-
Stencil Client Patch Esm v2.
|
|
9
|
+
Stencil Client Patch Esm v2.15.0 | MIT Licensed | https://stenciljs.com
|
|
11
10
|
*/
|
|
12
11
|
const patchEsm = () => {
|
|
13
|
-
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
if (index.BUILD.cssVarShim && !(index.CSS && index.CSS.supports && index.CSS.supports('color', 'var(--c)'))) {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-3bfdba4f.js'); }).then(() => {
|
|
18
|
-
if ((index.plt.$cssShim$ = index.win.__cssshim)) {
|
|
19
|
-
return index.plt.$cssShim$.i();
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
// for better minification
|
|
23
|
-
return 0;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return index.promiseResolve();
|
|
12
|
+
return catIconRegistry.promiseResolve();
|
|
28
13
|
};
|
|
29
14
|
|
|
30
15
|
const defineCustomElements = (win, options) => {
|
|
31
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
32
17
|
return patchEsm().then(() => {
|
|
33
18
|
appGlobals.globalScripts();
|
|
34
|
-
return
|
|
19
|
+
return catIconRegistry.bootstrapLazy([["cat-alert_7.cjs",[[1,"cat-button",{"variant":[1],"color":[1],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"ellipsed":[4],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconSuffix":[4,"icon-suffix"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"_iconOnly":[32],"setFocus":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-alert",{"color":[1]}],[1,"cat-badge",{"variant":[1],"color":[1],"size":[1],"round":[4],"pulse":[4]}],[1,"cat-menu",{"placement":[1]},[[0,"catClick","clickHandler"]]],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}]]]], options);
|
|
35
20
|
});
|
|
36
21
|
};
|
|
37
22
|
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"./components/cat-alert/cat-alert.js",
|
|
4
|
+
"./components/cat-badge/cat-badge.js",
|
|
3
5
|
"./components/cat-button/cat-button.js",
|
|
4
6
|
"./components/cat-icon/cat-icon.js",
|
|
7
|
+
"./components/cat-menu/cat-menu.js",
|
|
8
|
+
"./components/cat-skeleton/cat-skeleton.js",
|
|
5
9
|
"./components/cat-spinner/cat-spinner.js"
|
|
6
10
|
],
|
|
7
11
|
"compiler": {
|
|
8
12
|
"name": "@stencil/core",
|
|
9
|
-
"version": "2.
|
|
10
|
-
"typescriptVersion": "4.
|
|
13
|
+
"version": "2.15.0",
|
|
14
|
+
"typescriptVersion": "4.5.4"
|
|
11
15
|
},
|
|
12
16
|
"collections": [],
|
|
13
17
|
"bundles": [],
|
|
@@ -0,0 +1,57 @@
|
|
|
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: block;
|
|
8
|
+
margin-bottom: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([hidden]) {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cat-alert {
|
|
16
|
+
font: inherit;
|
|
17
|
+
color: rgb(var(--text));
|
|
18
|
+
background-color: rgba(var(--bg), 0.1);
|
|
19
|
+
box-shadow: inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
20
|
+
border-radius: 0.25rem;
|
|
21
|
+
padding: 0.75rem 1rem;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
::slotted(:last-child) {
|
|
26
|
+
margin-bottom: 0 !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cat-alert-primary {
|
|
30
|
+
--bg: var(--cat-primary-bg, 32, 127, 138);
|
|
31
|
+
--text: var(--cat-primary-text, 32, 127, 138);
|
|
32
|
+
--border: var(--cat-primary-text, 32, 127, 138);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.cat-alert-secondary {
|
|
36
|
+
--bg: 105, 118, 135;
|
|
37
|
+
--text: 0, 0, 0;
|
|
38
|
+
--border: 105, 118, 135;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.cat-alert-success {
|
|
42
|
+
--bg: 0, 132, 88;
|
|
43
|
+
--text: 0, 132, 88;
|
|
44
|
+
--border: 0, 132, 88;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.cat-alert-warning {
|
|
48
|
+
--bg: 255, 206, 128;
|
|
49
|
+
--text: 159, 97, 0;
|
|
50
|
+
--border: 159, 97, 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cat-alert-danger {
|
|
54
|
+
--bg: 217, 52, 13;
|
|
55
|
+
--text: 217, 52, 13;
|
|
56
|
+
--border: 217, 52, 13;
|
|
57
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
+
/**
|
|
3
|
+
* Alerts are used to display important messages inline.
|
|
4
|
+
*
|
|
5
|
+
* @part alert - The content of the alert.
|
|
6
|
+
*/
|
|
7
|
+
export class CatAlert {
|
|
8
|
+
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* The color palette of the alert.
|
|
11
|
+
*/
|
|
12
|
+
this.color = 'primary';
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (h("div", { part: "alert", class: {
|
|
16
|
+
'cat-alert': true,
|
|
17
|
+
[`cat-alert-${this.color}`]: Boolean(this.color)
|
|
18
|
+
} },
|
|
19
|
+
h("slot", null)));
|
|
20
|
+
}
|
|
21
|
+
static get is() { return "cat-alert"; }
|
|
22
|
+
static get encapsulation() { return "shadow"; }
|
|
23
|
+
static get originalStyleUrls() { return {
|
|
24
|
+
"$": ["cat-alert.scss"]
|
|
25
|
+
}; }
|
|
26
|
+
static get styleUrls() { return {
|
|
27
|
+
"$": ["cat-alert.css"]
|
|
28
|
+
}; }
|
|
29
|
+
static get properties() { return {
|
|
30
|
+
"color": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "'primary' | 'secondary' | 'danger' | 'success' | 'warning'",
|
|
35
|
+
"resolved": "\"danger\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": "The color palette of the alert."
|
|
43
|
+
},
|
|
44
|
+
"attribute": "color",
|
|
45
|
+
"reflect": false,
|
|
46
|
+
"defaultValue": "'primary'"
|
|
47
|
+
}
|
|
48
|
+
}; }
|
|
49
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
max-width: 100%;
|
|
9
|
+
vertical-align: baseline;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host([hidden]) {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.cat-badge {
|
|
17
|
+
font: inherit;
|
|
18
|
+
flex: 1 1 auto;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
border-radius: 0.125rem;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
.cat-badge slot {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
/* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cat-badge-round {
|
|
39
|
+
border-radius: 10rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cat-badge-filled {
|
|
43
|
+
background-color: rgb(var(--bg));
|
|
44
|
+
color: rgb(var(--fill));
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
-webkit-font-smoothing: antialiased;
|
|
47
|
+
-moz-osx-font-smoothing: greyscale;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cat-badge-outlined {
|
|
51
|
+
background-color: white;
|
|
52
|
+
box-shadow: inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
53
|
+
color: rgb(var(--text));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.cat-badge-primary {
|
|
57
|
+
--bg: var(--cat-primary-bg, 32, 127, 138);
|
|
58
|
+
--fill: var(--cat-primary-fill, 255, 255, 255);
|
|
59
|
+
--text: var(--cat-primary-text, 32, 127, 138);
|
|
60
|
+
--border: var(--cat-primary-text, 32, 127, 138);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.cat-badge-secondary {
|
|
64
|
+
--bg: 105, 118, 135;
|
|
65
|
+
--fill: 255, 255, 255;
|
|
66
|
+
--text: 0, 0, 0;
|
|
67
|
+
--border: 105, 118, 135;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.cat-badge-success {
|
|
71
|
+
--bg: 0, 132, 88;
|
|
72
|
+
--fill: 255, 255, 255;
|
|
73
|
+
--text: 0, 132, 88;
|
|
74
|
+
--border: 0, 132, 88;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cat-badge-warning {
|
|
78
|
+
--bg: 255, 206, 128;
|
|
79
|
+
--fill: 0, 0, 0;
|
|
80
|
+
--text: 159, 97, 0;
|
|
81
|
+
--border: 159, 97, 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cat-badge-danger {
|
|
85
|
+
--bg: 217, 52, 13;
|
|
86
|
+
--fill: 255, 255, 255;
|
|
87
|
+
--text: 217, 52, 13;
|
|
88
|
+
--border: 217, 52, 13;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.cat-badge-xs {
|
|
92
|
+
height: 0.75rem;
|
|
93
|
+
min-width: 0.75rem;
|
|
94
|
+
font-size: 0.75rem;
|
|
95
|
+
padding: 0 0.1875rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cat-badge-s {
|
|
99
|
+
height: 1rem;
|
|
100
|
+
min-width: 1rem;
|
|
101
|
+
font-size: 0.75rem;
|
|
102
|
+
padding: 0 0.25rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.cat-badge-m {
|
|
106
|
+
height: 1.25rem;
|
|
107
|
+
min-width: 1.25rem;
|
|
108
|
+
font-size: 0.75rem;
|
|
109
|
+
padding: 0 0.3125rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.cat-badge-l {
|
|
113
|
+
height: 1.5rem;
|
|
114
|
+
min-width: 1.5rem;
|
|
115
|
+
font-size: 0.875rem;
|
|
116
|
+
padding: 0 0.375rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cat-badge-xl {
|
|
120
|
+
height: 1.75rem;
|
|
121
|
+
min-width: 1.75rem;
|
|
122
|
+
font-size: 0.9375rem;
|
|
123
|
+
padding: 0 0.4375rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.cat-badge-pulse.cat-badge-filled {
|
|
127
|
+
animation: 1.5s ease 0s infinite normal none running pulse;
|
|
128
|
+
}
|
|
129
|
+
.cat-badge-pulse.cat-badge-outlined {
|
|
130
|
+
animation: 1.5s ease 0s infinite normal none running pulse-outlined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@keyframes pulse {
|
|
134
|
+
0% {
|
|
135
|
+
box-shadow: 0 0 0 0 rgb(var(--bg));
|
|
136
|
+
}
|
|
137
|
+
70% {
|
|
138
|
+
box-shadow: transparent 0px 0px 0px 0.5rem;
|
|
139
|
+
}
|
|
140
|
+
100% {
|
|
141
|
+
box-shadow: transparent 0px 0px 0px 0px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
@keyframes pulse-outlined {
|
|
145
|
+
0% {
|
|
146
|
+
box-shadow: 0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
147
|
+
}
|
|
148
|
+
70% {
|
|
149
|
+
box-shadow: transparent 0px 0px 0px 0.5rem, inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
150
|
+
}
|
|
151
|
+
100% {
|
|
152
|
+
box-shadow: transparent 0px 0px 0px 0px, inset 0 0 0 1px rgba(var(--border), 0.2);
|
|
153
|
+
}
|
|
154
|
+
}
|