@haiilo/catalyst 2.5.0 → 3.0.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 +2411 -2
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +1 -0
- package/dist/catalyst/p-52f9fea7.entry.js +2 -0
- package/dist/catalyst/{p-5bfc70e3.entry.js.map → p-52f9fea7.entry.js.map} +1 -1
- package/dist/catalyst/p-557c8009.entry.js +2 -0
- package/dist/catalyst/p-557c8009.entry.js.map +1 -0
- package/dist/catalyst/scss/_variables.tokens.scss +2 -2
- package/dist/catalyst/scss/core/_dialog.scss +66 -0
- package/dist/catalyst/scss/index.scss +1 -0
- package/dist/catalyst/scss/utils/_media.mixins.scss +1 -0
- package/dist/cjs/cat-alert_24.cjs.entry.js +7 -11
- package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
- package/dist/cjs/cat-modal.cjs.entry.js +1 -1
- package/dist/cjs/cat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cat-button/cat-button.js +23 -6
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +21 -9
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-modal/cat-modal.css +1 -1
- package/dist/collection/index.cdn.js +1 -0
- package/dist/collection/scss/_variables.tokens.scss +2 -2
- package/dist/collection/scss/core/_dialog.scss +66 -0
- package/dist/collection/scss/index.scss +1 -0
- package/dist/collection/scss/utils/_media.mixins.scss +1 -0
- package/dist/components/cat-button2.js +7 -6
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-icon2.js +2 -5
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-modal.js +1 -1
- package/dist/components/cat-modal.js.map +1 -1
- package/dist/esm/cat-alert_24.entry.js +7 -11
- package/dist/esm/cat-alert_24.entry.js.map +1 -1
- package/dist/esm/cat-modal.entry.js +1 -1
- package/dist/esm/cat-modal.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-button/cat-button.d.ts +5 -0
- package/dist/types/components/cat-icon/cat-icon.d.ts +5 -1
- package/dist/types/components.d.ts +17 -1
- package/package.json +2 -2
- package/dist/catalyst/p-2fdb52c9.entry.js +0 -2
- package/dist/catalyst/p-2fdb52c9.entry.js.map +0 -1
- package/dist/catalyst/p-5bfc70e3.entry.js +0 -2
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
@function cat-token-wrap($value, $alpha: 1) {
|
|
51
51
|
@if meta.type-of($value) == 'string' {
|
|
52
|
-
@if $alpha < 1 {
|
|
52
|
+
@if meta.type-of($alpha) != 'number' or $alpha < 1 {
|
|
53
53
|
@return rgba($value, $alpha);
|
|
54
54
|
} @else {
|
|
55
55
|
@return rgb($value);
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
@if string.index($key, 'color.') == 1 {
|
|
81
81
|
@if $wrap {
|
|
82
82
|
@return cat-token-wrap($value, $alpha);
|
|
83
|
-
} @else if $alpha < 1 {
|
|
83
|
+
} @else if meta.type-of($alpha) != 'number' or $alpha < 1 {
|
|
84
84
|
@return $value, $alpha;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use '../variables' as *;
|
|
2
|
+
@use '../mixins' as *;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Dialog makes assumptions about the DOM structure of the dialog content.
|
|
6
|
+
* The following selectors are used to style the dialog content based on its
|
|
7
|
+
* position in the DOM hierarchy.
|
|
8
|
+
*
|
|
9
|
+
* .cat-backdrop
|
|
10
|
+
* |- .cat-dialog
|
|
11
|
+
* |- .cat-dialog-header
|
|
12
|
+
* |- .cat-dialog-header-content
|
|
13
|
+
* |- .cat-dialog-content
|
|
14
|
+
* |- .cat-dialog-actions
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
$-dialog-padding: 1.5rem;
|
|
18
|
+
|
|
19
|
+
.cat-backdrop {
|
|
20
|
+
background-color: cat-token('color.ui.background.backdrop', cat-token('opacity.backdrop'));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cat-dialog {
|
|
24
|
+
background-color: cat-token('color.ui.background.body');
|
|
25
|
+
border-radius: cat-border-radius('l');
|
|
26
|
+
@include cat-elevation(7);
|
|
27
|
+
container: dialog / inline-size;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cat-dialog-header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 1rem;
|
|
34
|
+
padding: $-dialog-padding;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cat-dialog-header-content {
|
|
38
|
+
flex: 1 1 auto;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 0.5rem;
|
|
42
|
+
word-wrap: break-word;
|
|
43
|
+
word-break: break-word;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cat-dialog-content {
|
|
47
|
+
overflow: auto;
|
|
48
|
+
padding: 0 $-dialog-padding;
|
|
49
|
+
|
|
50
|
+
> *:last-child {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cat-dialog-actions {
|
|
56
|
+
display: flex;
|
|
57
|
+
padding: $-dialog-padding;
|
|
58
|
+
gap: 0.5rem;
|
|
59
|
+
flex-wrap: wrap;
|
|
60
|
+
|
|
61
|
+
@container dialog (max-width: 360px) {
|
|
62
|
+
cat-button {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -445,19 +445,19 @@ const CatButton = class {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
get isIconButton() {
|
|
448
|
-
return Boolean(this.icon) && this._iconOnly;
|
|
448
|
+
return (Boolean(this.icon) || Boolean(this.iconSrc)) && this._iconOnly;
|
|
449
449
|
}
|
|
450
450
|
get hasPrefixIcon() {
|
|
451
|
-
return Boolean(this.icon) && !this._iconOnly && !this.iconRight;
|
|
451
|
+
return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;
|
|
452
452
|
}
|
|
453
453
|
get hasSuffixIcon() {
|
|
454
|
-
return Boolean(this.icon) && !this._iconOnly && this.iconRight;
|
|
454
|
+
return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;
|
|
455
455
|
}
|
|
456
456
|
get content() {
|
|
457
457
|
return [
|
|
458
|
-
this.hasPrefixIcon ? index.h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null,
|
|
459
|
-
this.isIconButton ? (index.h("cat-icon", { icon: this.icon, size: this.iconSize })) : (index.h("span", { class: "cat-button-content", part: "content" }, index.h("slot", null))),
|
|
460
|
-
this.hasSuffixIcon ? index.h("cat-icon", { icon: this.icon, size: this.iconSize, part: "suffix" }) : null,
|
|
458
|
+
this.hasPrefixIcon ? (index.h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "prefix" })) : null,
|
|
459
|
+
this.isIconButton ? (index.h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize })) : (index.h("span", { class: "cat-button-content", part: "content" }, index.h("slot", null))),
|
|
460
|
+
this.hasSuffixIcon ? (index.h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "suffix" })) : null,
|
|
461
461
|
this.loading ? index.h("cat-spinner", { size: this.spinnerSize }) : null
|
|
462
462
|
];
|
|
463
463
|
}
|
|
@@ -1931,17 +1931,13 @@ const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user
|
|
|
1931
1931
|
const CatIcon = class {
|
|
1932
1932
|
constructor(hostRef) {
|
|
1933
1933
|
index.registerInstance(this, hostRef);
|
|
1934
|
-
/**
|
|
1935
|
-
* The name of the icon.
|
|
1936
|
-
*/
|
|
1937
|
-
this.icon = '';
|
|
1938
1934
|
/**
|
|
1939
1935
|
* The size of the icon.
|
|
1940
1936
|
*/
|
|
1941
1937
|
this.size = 'm';
|
|
1942
1938
|
}
|
|
1943
1939
|
render() {
|
|
1944
|
-
return (index.h("span", { innerHTML: catIconRegistry.catIconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
1940
|
+
return (index.h("span", { innerHTML: this.iconSrc || (this.icon ? catIconRegistry.catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
1945
1941
|
icon: true,
|
|
1946
1942
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
1947
1943
|
} }));
|