@haiilo/catalyst 0.5.12 → 0.6.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 +7 -1
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/{p-e82b63e9.js → p-12486027.js} +2 -2
- package/dist/catalyst/{p-e82b63e9.js.map → p-12486027.js.map} +1 -1
- package/dist/catalyst/p-2ec5c87a.js +2 -0
- package/dist/catalyst/p-2ec5c87a.js.map +1 -0
- package/dist/catalyst/p-6a5f0d4a.entry.js +10 -0
- package/dist/catalyst/p-6a5f0d4a.entry.js.map +1 -0
- package/dist/catalyst/p-7c06183a.js +2 -0
- package/dist/catalyst/p-7c06183a.js.map +1 -0
- package/dist/catalyst/p-a8629c54.entry.js +2 -0
- package/dist/catalyst/p-a8629c54.entry.js.map +1 -0
- package/dist/catalyst/p-c7f3b231.js +10 -0
- package/dist/catalyst/p-c7f3b231.js.map +1 -0
- package/dist/cjs/{app-globals-2a30d681.js → app-globals-aa29ad72.js} +2 -2
- package/dist/cjs/{app-globals-2a30d681.js.map → app-globals-aa29ad72.js.map} +1 -1
- package/dist/cjs/{cat-alert_15.cjs.entry.js → cat-alert_16.cjs.entry.js} +161 -111
- package/dist/cjs/cat-alert_16.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-icon-registry-49b11b51.js +131 -0
- package/dist/cjs/cat-icon-registry-49b11b51.js.map +1 -0
- package/dist/cjs/cat-notification-156f4cf5.js +552 -0
- package/dist/cjs/cat-notification-156f4cf5.js.map +1 -0
- package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
- package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +4 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{cat-icon-registry-b3a95a6b.js → loglevel-c9b2d01f.js} +3 -126
- package/dist/cjs/loglevel-c9b2d01f.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/cat-avatar/cat-avatar.css +81 -0
- package/dist/collection/components/cat-avatar/cat-avatar.js +225 -0
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -0
- package/dist/collection/components/cat-badge/cat-badge.css +5 -5
- package/dist/collection/components/cat-button/cat-button.js +8 -8
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +106 -0
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +44 -44
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.css +3 -0
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.js +51 -0
- package/dist/collection/components/cat-toast-demo/cat-toast-demo.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/load-img.js +16 -0
- package/dist/collection/utils/load-img.js.map +1 -0
- package/dist/components/cat-avatar.d.ts +11 -0
- package/dist/components/cat-avatar.js +125 -0
- package/dist/components/cat-avatar.js.map +1 -0
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button2.js +5 -5
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-notification.js +550 -0
- package/dist/components/cat-notification.js.map +1 -0
- package/dist/components/cat-scrollable.js +23 -23
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/components/cat-toast-demo.d.ts +11 -0
- package/dist/components/cat-toast-demo.js +84 -0
- package/dist/components/cat-toast-demo.js.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +1 -1
- package/dist/esm/{app-globals-77cd8c8e.js → app-globals-cf55f7f5.js} +2 -2
- package/dist/esm/{app-globals-77cd8c8e.js.map → app-globals-cf55f7f5.js.map} +1 -1
- package/dist/esm/{cat-alert_15.entry.js → cat-alert_16.entry.js} +154 -105
- package/dist/esm/cat-alert_16.entry.js.map +1 -0
- package/dist/esm/cat-icon-registry-3ea75755.js +128 -0
- package/dist/esm/cat-icon-registry-3ea75755.js.map +1 -0
- package/dist/esm/cat-notification-cd98c266.js +550 -0
- package/dist/esm/cat-notification-cd98c266.js.map +1 -0
- package/dist/esm/cat-textarea.entry.js +87 -0
- package/dist/esm/cat-textarea.entry.js.map +1 -0
- package/dist/esm/catalyst.js +4 -3
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{cat-icon-registry-a7acd6f7.js → loglevel-39a9e3f9.js} +2 -125
- package/dist/esm/loglevel-39a9e3f9.js.map +1 -0
- package/dist/types/components/cat-avatar/cat-avatar.d.ts +46 -0
- package/dist/types/components/cat-button/cat-button.d.ts +2 -2
- package/dist/types/components/cat-notification/cat-notification.d.ts +51 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +12 -12
- package/dist/types/components/cat-toast-demo/cat-toast-demo.d.ts +9 -0
- package/dist/types/components.d.ts +134 -44
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/load-img.d.ts +8 -0
- package/package.json +5 -3
- package/dist/catalyst/p-9a3c2375.js +0 -2
- package/dist/catalyst/p-9a3c2375.js.map +0 -1
- package/dist/catalyst/p-a6b8ebe9.entry.js +0 -10
- package/dist/catalyst/p-a6b8ebe9.entry.js.map +0 -1
- package/dist/cjs/cat-alert_15.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-b3a95a6b.js.map +0 -1
- package/dist/esm/cat-alert_15.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-a7acd6f7.js.map +0 -1
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5d72f0e4.js');
|
|
6
|
-
const
|
|
6
|
+
const loglevel = require('./loglevel-c9b2d01f.js');
|
|
7
|
+
const catIconRegistry = require('./cat-icon-registry-49b11b51.js');
|
|
8
|
+
const catNotification = require('./cat-notification-156f4cf5.js');
|
|
7
9
|
|
|
8
10
|
const catAlertCss = ":host{display:block;margin-bottom:1rem}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host([hidden]){display:none}.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}::slotted(:last-child){margin-bottom:0 !important}.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)}.alert-secondary{--bg:105, 118, 135;--text:0, 0, 0;--border:105, 118, 135}.alert-success{--bg:0, 132, 88;--text:0, 132, 88;--border:0, 132, 88}.alert-warning{--bg:255, 206, 128;--text:159, 97, 0;--border:159, 97, 0}.alert-danger{--bg:217, 52, 13;--text:217, 52, 13;--border:217, 52, 13}";
|
|
9
11
|
|
|
@@ -33,7 +35,92 @@ const CatAlert = class {
|
|
|
33
35
|
};
|
|
34
36
|
CatAlert.style = catAlertCss;
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Loads an image and wraps the result in a promise.
|
|
40
|
+
*
|
|
41
|
+
* @param src the image URL
|
|
42
|
+
* @returns a promise
|
|
43
|
+
*/
|
|
44
|
+
const loadImg = (src) => {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const image = new Image();
|
|
47
|
+
image.addEventListener('load', resolve);
|
|
48
|
+
image.addEventListener('error', reject);
|
|
49
|
+
image.src = src;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const catAvatarCss = ":host{display:inline-block;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.avatar{display:flex;align-items:center;justify-content:center;border-radius:0.25rem;text-decoration:inherit;color:var(--cat-avatar-fill, white);background-color:var(--cat-avatar-bg, #697687);background-size:cover;background-position:center;white-space:nowrap;overflow:hidden}.avatar:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.avatar-round{border-radius:50%}.avatar-xs{width:var(--cat-avatar-size, 1.5rem);height:var(--cat-avatar-size, 1.5rem);line-height:var(--cat-avatar-size, 1.5rem);font-size:var(--cat-avatar-font-size, 0.75rem)}.avatar-s{width:var(--cat-avatar-size, 2rem);height:var(--cat-avatar-size, 2rem);line-height:var(--cat-avatar-size, 2rem);font-size:var(--cat-avatar-font-size, 0.875rem)}.avatar-m{width:var(--cat-avatar-size, 2.5rem);height:var(--cat-avatar-size, 2.5rem);line-height:var(--cat-avatar-size, 2.5rem);font-size:var(--cat-avatar-font-size, 0.9375rem)}.avatar-l{width:var(--cat-avatar-size, 3rem);height:var(--cat-avatar-size, 3rem);line-height:var(--cat-avatar-size, 3rem);font-size:var(--cat-avatar-font-size, 1.125rem)}.avatar-xl{width:var(--cat-avatar-size, 3.5rem);height:var(--cat-avatar-size, 3.5rem);line-height:var(--cat-avatar-size, 3.5rem);font-size:var(--cat-avatar-font-size, 1.25rem)}";
|
|
54
|
+
|
|
55
|
+
const CatAvatar = class {
|
|
56
|
+
constructor(hostRef) {
|
|
57
|
+
index.registerInstance(this, hostRef);
|
|
58
|
+
/**
|
|
59
|
+
* The size of the avatar.
|
|
60
|
+
*/
|
|
61
|
+
this.size = 'm';
|
|
62
|
+
/**
|
|
63
|
+
* Use round avatar edges.
|
|
64
|
+
*/
|
|
65
|
+
this.round = false;
|
|
66
|
+
/**
|
|
67
|
+
* The label of the avatar.
|
|
68
|
+
*/
|
|
69
|
+
this.label = '';
|
|
70
|
+
}
|
|
71
|
+
onSrcChanged(value) {
|
|
72
|
+
if (value) {
|
|
73
|
+
loadImg(value).then(() => (this.backgroundImage = `url(${value})`), () => (this.backgroundImage = undefined));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.backgroundImage = undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
componentWillLoad() {
|
|
80
|
+
this.onSrcChanged(this.src);
|
|
81
|
+
}
|
|
82
|
+
componentWillRender() {
|
|
83
|
+
if (!this.label) {
|
|
84
|
+
loglevel.loglevel.warn('[A11y] Missing ARIA label on avatar', this);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
if (this.url) {
|
|
89
|
+
return (index.h("a", { href: this.url, target: this.urlTarget, style: this.cssStyle, class: this.cssClass, "aria-label": this.label }, this.content));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return (index.h("span", { style: this.cssStyle, class: this.cssClass, "aria-label": this.label }, this.content));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
get content() {
|
|
96
|
+
return !this.backgroundImage
|
|
97
|
+
? [this.icon ? index.h("cat-icon", { icon: this.icon, size: this.size }) : this.getInitials()]
|
|
98
|
+
: [];
|
|
99
|
+
}
|
|
100
|
+
get cssStyle() {
|
|
101
|
+
return { 'background-image': this.backgroundImage };
|
|
102
|
+
}
|
|
103
|
+
get cssClass() {
|
|
104
|
+
return {
|
|
105
|
+
avatar: true,
|
|
106
|
+
'avatar-round': this.round,
|
|
107
|
+
[`avatar-${this.size}`]: Boolean(this.size)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
getInitials() {
|
|
111
|
+
var _a;
|
|
112
|
+
return ((_a = this.initials) !== null && _a !== void 0 ? _a : this.label
|
|
113
|
+
.split(' ')
|
|
114
|
+
.map(n => n[0])
|
|
115
|
+
.join(''));
|
|
116
|
+
}
|
|
117
|
+
static get watchers() { return {
|
|
118
|
+
"src": ["onSrcChanged"]
|
|
119
|
+
}; }
|
|
120
|
+
};
|
|
121
|
+
CatAvatar.style = catAvatarCss;
|
|
122
|
+
|
|
123
|
+
const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.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}.badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.badge-round{border-radius:10rem}.badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.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)}.badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0rem 0.25rem}.badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0.25rem 0.5rem}.badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0.5rem 0.75rem}.badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0.75rem 1rem}.badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:1rem 1.25rem}.badge-pulse.badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.badge-pulse.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 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@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 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--border), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--border), 0.2)}}";
|
|
37
124
|
|
|
38
125
|
const CatBadge = class {
|
|
39
126
|
constructor(hostRef) {
|
|
@@ -183,7 +270,7 @@ function createEmptyStyleRule(query) {
|
|
|
183
270
|
}
|
|
184
271
|
}
|
|
185
272
|
catch (e) {
|
|
186
|
-
|
|
273
|
+
loglevel.loglevel.error(e);
|
|
187
274
|
}
|
|
188
275
|
}
|
|
189
276
|
|
|
@@ -228,9 +315,9 @@ const CatButton = class {
|
|
|
228
315
|
*/
|
|
229
316
|
this.submit = false;
|
|
230
317
|
/**
|
|
231
|
-
*
|
|
318
|
+
* Disables ellipse overflowing button content.
|
|
232
319
|
*/
|
|
233
|
-
this.
|
|
320
|
+
this.noEllipsis = false;
|
|
234
321
|
/**
|
|
235
322
|
* Use round button edges.
|
|
236
323
|
*/
|
|
@@ -268,7 +355,7 @@ const CatButton = class {
|
|
|
268
355
|
}
|
|
269
356
|
componentWillRender() {
|
|
270
357
|
if (this.isIconButton && !this.a11yLabel) {
|
|
271
|
-
|
|
358
|
+
loglevel.loglevel.warn('[A11y] Missing ARIA label on icon button', this);
|
|
272
359
|
}
|
|
273
360
|
}
|
|
274
361
|
haltDisabledEvents(event) {
|
|
@@ -295,7 +382,7 @@ const CatButton = class {
|
|
|
295
382
|
'cat-button-round': this.round,
|
|
296
383
|
'cat-button-loading': this.loading,
|
|
297
384
|
'cat-button-disabled': this.disabled,
|
|
298
|
-
'cat-button-ellipsed': this.
|
|
385
|
+
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,
|
|
299
386
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
300
387
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
301
388
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
@@ -309,7 +396,7 @@ const CatButton = class {
|
|
|
309
396
|
'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
|
|
310
397
|
'cat-button-loading': this.loading,
|
|
311
398
|
'cat-button-disabled': this.disabled,
|
|
312
|
-
'cat-button-ellipsed': this.
|
|
399
|
+
'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,
|
|
313
400
|
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
314
401
|
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
315
402
|
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
@@ -378,14 +465,14 @@ CatCard.style = catCardCss;
|
|
|
378
465
|
|
|
379
466
|
const catCheckboxCss = ":host{display:flex;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid #d7dbe0;border-radius:0.125rem;transition:background-color 0.13s ease, border-color 0.13s ease}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:70%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-color:rgb(var(--cat-primary-bg, 32, 127, 138));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
380
467
|
|
|
381
|
-
let nextUniqueId$
|
|
468
|
+
let nextUniqueId$5 = 0;
|
|
382
469
|
const CatCheckbox = class {
|
|
383
470
|
constructor(hostRef) {
|
|
384
471
|
index.registerInstance(this, hostRef);
|
|
385
472
|
this.catChange = index.createEvent(this, "catChange", 7);
|
|
386
473
|
this.catFocus = index.createEvent(this, "catFocus", 7);
|
|
387
474
|
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
388
|
-
this.id = `cat-checkbox-${nextUniqueId$
|
|
475
|
+
this.id = `cat-checkbox-${nextUniqueId$5++}`;
|
|
389
476
|
/**
|
|
390
477
|
* Checked state of the checkbox
|
|
391
478
|
*/
|
|
@@ -418,7 +505,7 @@ const CatCheckbox = class {
|
|
|
418
505
|
}
|
|
419
506
|
componentWillRender() {
|
|
420
507
|
if (!this.label) {
|
|
421
|
-
|
|
508
|
+
loglevel.loglevel.error('[A11y] Missing ARIA label on checkbox', this);
|
|
422
509
|
}
|
|
423
510
|
}
|
|
424
511
|
/**
|
|
@@ -471,7 +558,7 @@ CatIcon.style = catIconCss;
|
|
|
471
558
|
|
|
472
559
|
const catInputCss = ":host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:0.25rem;box-shadow:0 0 0 1px #d7dbe0;transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px #d7dbe0}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid #d7dbe0;padding-right:0.75rem}.text-suffix{border-left:1px solid #d7dbe0;padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}.input-hint{font-size:0.875rem;line-height:1rem;margin:0}";
|
|
473
560
|
|
|
474
|
-
let nextUniqueId$
|
|
561
|
+
let nextUniqueId$4 = 0;
|
|
475
562
|
const CatInput = class {
|
|
476
563
|
constructor(hostRef) {
|
|
477
564
|
index.registerInstance(this, hostRef);
|
|
@@ -479,7 +566,7 @@ const CatInput = class {
|
|
|
479
566
|
this.catFocus = index.createEvent(this, "catFocus", 7);
|
|
480
567
|
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
481
568
|
this.i18n = catIconRegistry.CatI18nRegistry.getInstance();
|
|
482
|
-
this.id = `cat-input-${nextUniqueId$
|
|
569
|
+
this.id = `cat-input-${nextUniqueId$4++}`;
|
|
483
570
|
this.inputValue = '';
|
|
484
571
|
/**
|
|
485
572
|
* Whether the input should show a clear button.
|
|
@@ -530,7 +617,7 @@ const CatInput = class {
|
|
|
530
617
|
}
|
|
531
618
|
componentWillRender() {
|
|
532
619
|
if (!this.label) {
|
|
533
|
-
|
|
620
|
+
loglevel.loglevel.error('[A11y] Missing ARIA label on input', this);
|
|
534
621
|
}
|
|
535
622
|
}
|
|
536
623
|
/**
|
|
@@ -2808,13 +2895,13 @@ const firstTabbable = (container) => {
|
|
|
2808
2895
|
|
|
2809
2896
|
const catMenuCss = ":host{display:contents}:host([hidden]){display:none}.content{padding-top:0.5rem;padding-bottom:0.5rem;position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-width:8rem;max-width:16rem;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}";
|
|
2810
2897
|
|
|
2811
|
-
let nextUniqueId$
|
|
2898
|
+
let nextUniqueId$3 = 0;
|
|
2812
2899
|
const CatMenu = class {
|
|
2813
2900
|
constructor(hostRef) {
|
|
2814
2901
|
index.registerInstance(this, hostRef);
|
|
2815
2902
|
this.catOpen = index.createEvent(this, "catOpen", 7);
|
|
2816
2903
|
this.catClose = index.createEvent(this, "catClose", 7);
|
|
2817
|
-
this.id = nextUniqueId$
|
|
2904
|
+
this.id = nextUniqueId$3++;
|
|
2818
2905
|
/**
|
|
2819
2906
|
* The placement of the menu.
|
|
2820
2907
|
*/
|
|
@@ -2911,14 +2998,14 @@ CatMenu.style = catMenuCss;
|
|
|
2911
2998
|
|
|
2912
2999
|
const catRadioCss = ":host{display:flex;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;cursor:pointer}.radio{display:flex;position:relative}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 32, 127, 138));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid #d7dbe0;border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 32, 127, 138))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.is-disabled input{background-color:#f8f8fb}.is-disabled input:checked{border-color:#d7dbe0}.is-disabled .circle{background-color:#d7dbe0}";
|
|
2913
3000
|
|
|
2914
|
-
let nextUniqueId$
|
|
3001
|
+
let nextUniqueId$2 = 0;
|
|
2915
3002
|
const CatRadio = class {
|
|
2916
3003
|
constructor(hostRef) {
|
|
2917
3004
|
index.registerInstance(this, hostRef);
|
|
2918
3005
|
this.catChange = index.createEvent(this, "catChange", 7);
|
|
2919
3006
|
this.catFocus = index.createEvent(this, "catFocus", 7);
|
|
2920
3007
|
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
2921
|
-
this.id = `cat-radio-${++nextUniqueId$
|
|
3008
|
+
this.id = `cat-radio-${++nextUniqueId$2}`;
|
|
2922
3009
|
/**
|
|
2923
3010
|
* Whether this radio is checked.
|
|
2924
3011
|
*/
|
|
@@ -2942,7 +3029,7 @@ const CatRadio = class {
|
|
|
2942
3029
|
}
|
|
2943
3030
|
componentWillRender() {
|
|
2944
3031
|
if (!this.label) {
|
|
2945
|
-
|
|
3032
|
+
loglevel.loglevel.error('[A11y] Missing ARIA label on radio', this);
|
|
2946
3033
|
}
|
|
2947
3034
|
}
|
|
2948
3035
|
/**
|
|
@@ -4200,20 +4287,20 @@ const CatScrollable = class {
|
|
|
4200
4287
|
this.scrolledBottom = index.createEvent(this, "scrolledBottom", 7);
|
|
4201
4288
|
this.init = new Subject();
|
|
4202
4289
|
this.destroyed = new Subject();
|
|
4203
|
-
/** Flags to enable
|
|
4204
|
-
this.
|
|
4205
|
-
/** Flags to enable
|
|
4206
|
-
this.
|
|
4207
|
-
/** Flags to enable
|
|
4208
|
-
this.
|
|
4209
|
-
/** Flags to enable
|
|
4210
|
-
this.
|
|
4211
|
-
/** Flag to enable
|
|
4212
|
-
this.
|
|
4290
|
+
/** Flags to disable/enable scroll shadowX. */
|
|
4291
|
+
this.noShadowX = false;
|
|
4292
|
+
/** Flags to disable/enable scroll shadowY. */
|
|
4293
|
+
this.noShadowY = false;
|
|
4294
|
+
/** Flags to disable/enable overflowX. */
|
|
4295
|
+
this.noOverflowX = false;
|
|
4296
|
+
/** Flags to disable/enable overflowY. */
|
|
4297
|
+
this.noOverflowY = false;
|
|
4298
|
+
/** Flag to disable/enable overscroll behavior. */
|
|
4299
|
+
this.noOverscroll = false;
|
|
4213
4300
|
/**
|
|
4214
|
-
* Flag to fire an initial event after content initialization.
|
|
4301
|
+
* Flag to not fire an initial event after content initialization.
|
|
4215
4302
|
*/
|
|
4216
|
-
this.
|
|
4303
|
+
this.noScrolledInit = false;
|
|
4217
4304
|
/**
|
|
4218
4305
|
* Buffer to be used to calculate the scroll distance.
|
|
4219
4306
|
*/
|
|
@@ -4242,7 +4329,7 @@ const CatScrollable = class {
|
|
|
4242
4329
|
});
|
|
4243
4330
|
}
|
|
4244
4331
|
componentDidLoad() {
|
|
4245
|
-
if (this.
|
|
4332
|
+
if (!this.noScrolledInit) {
|
|
4246
4333
|
this.init.next();
|
|
4247
4334
|
}
|
|
4248
4335
|
}
|
|
@@ -4253,12 +4340,12 @@ const CatScrollable = class {
|
|
|
4253
4340
|
}
|
|
4254
4341
|
render() {
|
|
4255
4342
|
return [
|
|
4256
|
-
index.h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, this.
|
|
4343
|
+
index.h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && index.h("div", { class: "shadow-top" }), !this.noShadowX && index.h("div", { class: "shadow-left" }), !this.noShadowX && index.h("div", { class: "shadow-right" }), !this.noShadowY && index.h("div", { class: "shadow-bottom" })),
|
|
4257
4344
|
index.h("div", { ref: el => (this.scrollElement = el), class: {
|
|
4258
4345
|
'scrollable-content': true,
|
|
4259
|
-
'scroll-x': this.
|
|
4260
|
-
'scroll-y': this.
|
|
4261
|
-
'no-overscroll':
|
|
4346
|
+
'scroll-x': !this.noOverflowX,
|
|
4347
|
+
'scroll-y': !this.noOverflowY,
|
|
4348
|
+
'no-overscroll': this.noOverscroll
|
|
4262
4349
|
} }, index.h("slot", null))
|
|
4263
4350
|
];
|
|
4264
4351
|
}
|
|
@@ -4368,86 +4455,48 @@ const CatSpinner = class {
|
|
|
4368
4455
|
};
|
|
4369
4456
|
CatSpinner.style = catSpinnerCss;
|
|
4370
4457
|
|
|
4371
|
-
|
|
4458
|
+
const catToastDemoCss = ":host{display:block}";
|
|
4372
4459
|
|
|
4373
|
-
const
|
|
4374
|
-
|
|
4375
|
-
let nextUniqueId$2 = 0;
|
|
4376
|
-
const CatTextarea = class {
|
|
4460
|
+
const CatToastDemo = class {
|
|
4377
4461
|
constructor(hostRef) {
|
|
4378
4462
|
index.registerInstance(this, hostRef);
|
|
4379
|
-
this.catChange = index.createEvent(this, "catChange", 7);
|
|
4380
|
-
this.catFocus = index.createEvent(this, "catFocus", 7);
|
|
4381
|
-
this.catBlur = index.createEvent(this, "catBlur", 7);
|
|
4382
|
-
this.id = `cat-textarea-${nextUniqueId$2++}`;
|
|
4383
|
-
/**
|
|
4384
|
-
* Whether the textarea is disabled.
|
|
4385
|
-
*/
|
|
4386
|
-
this.disabled = false;
|
|
4387
|
-
/**
|
|
4388
|
-
* The label for the textarea.
|
|
4389
|
-
*/
|
|
4390
|
-
this.label = '';
|
|
4391
|
-
/**
|
|
4392
|
-
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
4393
|
-
*/
|
|
4394
|
-
this.labelHidden = false;
|
|
4395
|
-
/**
|
|
4396
|
-
* The name of the form control. Submitted with the form as part of a name/value pair.
|
|
4397
|
-
*/
|
|
4398
|
-
this.name = '';
|
|
4399
|
-
/**
|
|
4400
|
-
* The value is not editable.
|
|
4401
|
-
*/
|
|
4402
|
-
this.readonly = false;
|
|
4403
|
-
/**
|
|
4404
|
-
* A value is required or must be check for the form to be submittable.
|
|
4405
|
-
*/
|
|
4406
|
-
this.required = false;
|
|
4407
|
-
/**
|
|
4408
|
-
* Specifies the initial number of lines in the textarea.
|
|
4409
|
-
*/
|
|
4410
|
-
this.rows = 3;
|
|
4411
|
-
}
|
|
4412
|
-
componentWillRender() {
|
|
4413
|
-
if (!this.label) {
|
|
4414
|
-
catIconRegistry.loglevel.error('[A11y] Missing ARIA label on textarea', this);
|
|
4415
|
-
}
|
|
4416
|
-
}
|
|
4417
|
-
componentDidLoad() {
|
|
4418
|
-
d(this.textarea);
|
|
4419
4463
|
}
|
|
4420
|
-
/**
|
|
4421
|
-
* Sets focus on the textarea. Use this method instead of `textarea.focus()`.
|
|
4422
|
-
*
|
|
4423
|
-
* @param options An optional object providing options to control aspects of
|
|
4424
|
-
* the focusing process.
|
|
4425
|
-
*/
|
|
4426
|
-
async setFocus(options) {
|
|
4427
|
-
this.textarea.focus(options);
|
|
4428
|
-
}
|
|
4429
|
-
// /**
|
|
4430
|
-
// * Clear the input.
|
|
4431
|
-
// */
|
|
4432
|
-
// @Method()
|
|
4433
|
-
// async clear(): Promise<void> {
|
|
4434
|
-
// this.inputValue = '';
|
|
4435
|
-
// }
|
|
4436
4464
|
render() {
|
|
4437
|
-
return
|
|
4465
|
+
return index.h("cat-button", { onClick: this.onClick.bind(this) }, "Show Notifications");
|
|
4438
4466
|
}
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4467
|
+
onClick() {
|
|
4468
|
+
const infoOptions = {
|
|
4469
|
+
position: 'top-left'
|
|
4470
|
+
};
|
|
4471
|
+
const errorOptions = {
|
|
4472
|
+
position: 'top-center',
|
|
4473
|
+
type: 'error'
|
|
4474
|
+
};
|
|
4475
|
+
const errorOptions2 = {
|
|
4476
|
+
position: 'bottom-left',
|
|
4477
|
+
type: 'error'
|
|
4478
|
+
};
|
|
4479
|
+
const successOptions3 = {
|
|
4480
|
+
position: 'bottom-right',
|
|
4481
|
+
type: 'success'
|
|
4482
|
+
};
|
|
4483
|
+
const template = document.createElement('template');
|
|
4484
|
+
template.innerHTML = `<div style="padding: 7px 30px 7px 10px">Custom HTML Node Content</div>`;
|
|
4485
|
+
const successOptions4 = {
|
|
4486
|
+
position: 'bottom-right',
|
|
4487
|
+
type: 'success',
|
|
4488
|
+
content: template.content.firstChild
|
|
4489
|
+
};
|
|
4490
|
+
catNotification.NotificationsService.error('Default Click');
|
|
4491
|
+
catNotification.NotificationsService.error('Long default title, long default title, long default title, long default title');
|
|
4492
|
+
catNotification.NotificationsService.info('Info Click', 'Info message', infoOptions);
|
|
4493
|
+
catNotification.NotificationsService.success('', ' ', successOptions4);
|
|
4494
|
+
catNotification.NotificationsService.error('Error Title', ' ', errorOptions);
|
|
4495
|
+
catNotification.NotificationsService.error('Error 2 Title', 'Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message, Very long message,Very long message, Very long message, Very long message, Very long message, Very long message, ', errorOptions2);
|
|
4496
|
+
catNotification.NotificationsService.success('Success Title - very long title without message', ' ', successOptions3);
|
|
4448
4497
|
}
|
|
4449
4498
|
};
|
|
4450
|
-
|
|
4499
|
+
CatToastDemo.style = catToastDemoCss;
|
|
4451
4500
|
|
|
4452
4501
|
const catToggleCss = ":host{display:flex;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:#d7dbe0;transition:background-color 0.13s ease}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 32, 127, 138))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
4453
4502
|
|
|
@@ -4482,7 +4531,7 @@ const CatToggle = class {
|
|
|
4482
4531
|
}
|
|
4483
4532
|
componentWillRender() {
|
|
4484
4533
|
if (!this.label) {
|
|
4485
|
-
|
|
4534
|
+
loglevel.loglevel.error('[A11y] Missing ARIA label on toggle', this);
|
|
4486
4535
|
}
|
|
4487
4536
|
}
|
|
4488
4537
|
/**
|
|
@@ -4633,6 +4682,7 @@ CatTooltip.OFFSET = 4;
|
|
|
4633
4682
|
CatTooltip.style = catTooltipCss;
|
|
4634
4683
|
|
|
4635
4684
|
exports.cat_alert = CatAlert;
|
|
4685
|
+
exports.cat_avatar = CatAvatar;
|
|
4636
4686
|
exports.cat_badge = CatBadge;
|
|
4637
4687
|
exports.cat_button = CatButton;
|
|
4638
4688
|
exports.cat_card = CatCard;
|
|
@@ -4644,8 +4694,8 @@ exports.cat_radio = CatRadio;
|
|
|
4644
4694
|
exports.cat_scrollable = CatScrollable;
|
|
4645
4695
|
exports.cat_skeleton = CatSkeleton;
|
|
4646
4696
|
exports.cat_spinner = CatSpinner;
|
|
4647
|
-
exports.
|
|
4697
|
+
exports.cat_toast_demo = CatToastDemo;
|
|
4648
4698
|
exports.cat_toggle = CatToggle;
|
|
4649
4699
|
exports.cat_tooltip = CatTooltip;
|
|
4650
4700
|
|
|
4651
|
-
//# sourceMappingURL=cat-
|
|
4701
|
+
//# sourceMappingURL=cat-alert_16.cjs.entry.js.map
|