@haiilo/catalyst 2.1.2 → 2.3.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.
@@ -2,7 +2,12 @@
2
2
  @use '../mixins' as *;
3
3
 
4
4
  :where(h1, h2, h3, h4, h5, h6),
5
- .cat-h1, .cat-h2, .cat-h3, .cat-h4, .cat-h5, .cat-h6 {
5
+ .cat-h1,
6
+ .cat-h2,
7
+ .cat-h3,
8
+ .cat-h4,
9
+ .cat-h5,
10
+ .cat-h6 {
6
11
  margin-top: 0;
7
12
  margin-bottom: $cat-head-margin-bottom;
8
13
  }
@@ -1,6 +1,5 @@
1
1
  // -- Reset
2
2
  @import 'sanitize.css/sanitize.css';
3
- @import 'sanitize.css/assets.css';
4
3
  @import 'sanitize.css/reduce-motion.css';
5
4
 
6
5
  // -- Vendor
@@ -14,6 +14,12 @@ function setAttributeDefault(host, attr, value) {
14
14
  function setPropertyDefault(host, prop) {
15
15
  setAttributeDefault(host, String(prop), host[prop]);
16
16
  }
17
+ function setAttribute(host, attr, value) {
18
+ host.hostElement.setAttribute(attr, String(value));
19
+ }
20
+ function setProperty(host, prop) {
21
+ setAttribute(host, String(prop), host[prop]);
22
+ }
17
23
 
18
24
  const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem);margin-bottom:1rem}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:rgba(var(--cat-primary-bg, 0, 129, 148), 0.1)}:host([color=primary]) cat-icon{color:rgb(var(--cat-primary-text, 0, 129, 148))}:host([color=secondary]){background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.1)}:host([color=secondary]) cat-icon{color:#697687}:host([color=success]){background-color:rgba(var(--cat-success-bg-, 0, 132, 88), 0.1)}:host([color=success]) cat-icon{color:#008458}:host([color=warning]){background-color:rgba(var(--cat-warning-bg, 255, 206, 128), 0.1)}:host([color=warning]) cat-icon{color:#ebb663}:host([color=danger]){background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.1)}:host([color=danger]) cat-icon{color:#d9340d}";
19
25
 
@@ -174,7 +180,21 @@ const CatBadge = class {
174
180
  render() {
175
181
  return index.h("slot", null);
176
182
  }
183
+ onColorChanged() {
184
+ setProperty(this, 'color');
185
+ }
186
+ onSizeChanged() {
187
+ setProperty(this, 'size');
188
+ }
189
+ onVariantChanged() {
190
+ setProperty(this, 'variant');
191
+ }
177
192
  get hostElement() { return index.getElement(this); }
193
+ static get watchers() { return {
194
+ "color": ["onColorChanged"],
195
+ "size": ["onSizeChanged"],
196
+ "variant": ["onVariantChanged"]
197
+ }; }
178
198
  };
179
199
  CatBadge.style = catBadgeCss;
180
200