@albi_scando/as-design-system-lib 1.9.3 → 1.9.5
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.
|
@@ -186,7 +186,7 @@ const j = {
|
|
|
186
186
|
t !== void 0 && document.body.classList.add(t);
|
|
187
187
|
}, bt = () => {
|
|
188
188
|
document.body.classList.remove(...Object.values(u));
|
|
189
|
-
}, vt = "base-button", d = "",
|
|
189
|
+
}, vt = "base-button", d = "", T = {
|
|
190
190
|
SHOW_MODAL: "show-modal",
|
|
191
191
|
CLOSE: "close"
|
|
192
192
|
}, gt = {
|
|
@@ -403,10 +403,10 @@ class s extends HTMLElement {
|
|
|
403
403
|
return;
|
|
404
404
|
const e = t;
|
|
405
405
|
switch (this.command) {
|
|
406
|
-
case
|
|
406
|
+
case T.SHOW_MODAL:
|
|
407
407
|
e.showModal?.();
|
|
408
408
|
break;
|
|
409
|
-
case
|
|
409
|
+
case T.CLOSE:
|
|
410
410
|
e.close?.();
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
@@ -526,7 +526,7 @@ class At extends s {
|
|
|
526
526
|
* Lifecycle hook invoked when the component is inserted into the DOM.
|
|
527
527
|
*/
|
|
528
528
|
connectedCallback() {
|
|
529
|
-
this.hasAttribute("command") || this.setAttribute("command",
|
|
529
|
+
this.hasAttribute("command") || this.setAttribute("command", T.CLOSE), this._render(), this._setCommandForAttribute(), this._addEventListeners();
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* Lifecycle hook invoked when the component is removed from the DOM.
|
|
@@ -566,15 +566,15 @@ const q = "undo-button", Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Obje
|
|
|
566
566
|
<button part="button" title="Close">
|
|
567
567
|
<span class="material-symbols-outlined">close</span>
|
|
568
568
|
</button>
|
|
569
|
-
`, wt = "*{box-sizing:border-box}:host{position:relative;display:inline-flex;vertical-align:middle}.tooltip{position:absolute;top:auto;bottom:calc(100% + .5rem);left:50%;right:auto;transform:translate(-50%);width:max-content;height:auto;padding:var(--spacing-1) var(--spacing-2);background-color:var(--color-bg-tertiary, #1e1e2e);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-xs);border-radius:var(--border-radius-md);box-shadow:var(--shadow-lg);white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--transition-fast),visibility var(--transition-fast);z-index:10000;margin:0}button[part=button]{background:var(--color-error);border:none;border-radius:var(--border-radius-md);padding:var(--spacing-2);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;aspect-ratio:1;transition:all var(--transition-base);box-shadow:var(--shadow-md);position:relative}button[part=button]:hover{filter:brightness(1.2)}:host(:hover) .tooltip{opacity:1;visibility:visible}",
|
|
570
|
-
|
|
569
|
+
`, wt = "*{box-sizing:border-box}:host{position:relative;display:inline-flex;vertical-align:middle}.tooltip{position:absolute;top:auto;bottom:calc(100% + .5rem);left:50%;right:auto;transform:translate(-50%);width:max-content;height:auto;padding:var(--spacing-1) var(--spacing-2);background-color:var(--color-bg-tertiary, #1e1e2e);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-xs);border-radius:var(--border-radius-md);box-shadow:var(--shadow-lg);white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--transition-fast),visibility var(--transition-fast);z-index:10000;margin:0}button[part=button]{background:var(--color-error);border:none;border-radius:var(--border-radius-md);padding:var(--spacing-2);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;aspect-ratio:1;transition:all var(--transition-base);box-shadow:var(--shadow-md);position:relative}button[part=button]:hover{filter:brightness(1.2)}:host(:hover) .tooltip{opacity:1;visibility:visible}", C = new CSSStyleSheet();
|
|
570
|
+
C.replaceSync(wt);
|
|
571
571
|
class St extends s {
|
|
572
572
|
/**
|
|
573
573
|
* @constructor
|
|
574
574
|
* @ignore
|
|
575
575
|
*/
|
|
576
576
|
constructor() {
|
|
577
|
-
super(), this.shadowRoot?.adoptedStyleSheets.push(
|
|
577
|
+
super(), this.shadowRoot?.adoptedStyleSheets.push(C);
|
|
578
578
|
}
|
|
579
579
|
/**
|
|
580
580
|
* Specifies which attributes should be observed for changes.
|
|
@@ -586,7 +586,7 @@ class St extends s {
|
|
|
586
586
|
* Lifecycle hook invoked when the component is inserted into the DOM.
|
|
587
587
|
*/
|
|
588
588
|
connectedCallback() {
|
|
589
|
-
this.hasAttribute("command") || this.setAttribute("command",
|
|
589
|
+
this.hasAttribute("command") || this.setAttribute("command", T.CLOSE), this._render(), this._setCommandForAttribute(), this._addEventListeners();
|
|
590
590
|
}
|
|
591
591
|
/**
|
|
592
592
|
* Lifecycle hook invoked when the component is removed from the DOM.
|
|
@@ -626,15 +626,15 @@ const xt = "close-button", He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Ob
|
|
|
626
626
|
<span class="material-symbols-outlined">check</span>
|
|
627
627
|
<span>Confirm</span>
|
|
628
628
|
</button>
|
|
629
|
-
`, kt = "*{box-sizing:border-box}:host{display:inline-flex;vertical-align:middle}button[part=button]{background:var(--color-success);font-weight:var(--font-weight-medium);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);border-radius:var(--border-radius-lg);border:none;box-shadow:var(--shadow-md);transition:all var(--transition-base);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--gap-sm)}button[part=button]:hover{filter:brightness(1.2)}",
|
|
630
|
-
|
|
629
|
+
`, kt = "*{box-sizing:border-box}:host{display:inline-flex;vertical-align:middle}button[part=button]{background:var(--color-success);font-weight:var(--font-weight-medium);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);border-radius:var(--border-radius-lg);border:none;box-shadow:var(--shadow-md);transition:all var(--transition-base);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:var(--gap-sm)}button[part=button]:hover{filter:brightness(1.2)}", W = new CSSStyleSheet();
|
|
630
|
+
W.replaceSync(kt);
|
|
631
631
|
class Lt extends s {
|
|
632
632
|
/**
|
|
633
633
|
* @constructor
|
|
634
634
|
* @ignore
|
|
635
635
|
*/
|
|
636
636
|
constructor() {
|
|
637
|
-
super(), this.shadowRoot?.adoptedStyleSheets.push(
|
|
637
|
+
super(), this.shadowRoot?.adoptedStyleSheets.push(W);
|
|
638
638
|
}
|
|
639
639
|
/**
|
|
640
640
|
* Specifies which attributes should be observed for changes.
|
|
@@ -646,7 +646,7 @@ class Lt extends s {
|
|
|
646
646
|
* Lifecycle hook invoked when the component is inserted into the DOM.
|
|
647
647
|
*/
|
|
648
648
|
connectedCallback() {
|
|
649
|
-
this.hasAttribute("command") || this.setAttribute("command",
|
|
649
|
+
this.hasAttribute("command") || this.setAttribute("command", T.CLOSE), this._render(), this._setCommandForAttribute(), this._addEventListeners();
|
|
650
650
|
}
|
|
651
651
|
/**
|
|
652
652
|
* Lifecycle hook invoked when the component is removed from the DOM.
|
|
@@ -678,7 +678,7 @@ class Lt extends s {
|
|
|
678
678
|
e !== null && (this.commandfor = e.id);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
const P = "confirm-button",
|
|
681
|
+
const P = "confirm-button", Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
682
682
|
__proto__: null,
|
|
683
683
|
ConfirmButtonComponent: Lt,
|
|
684
684
|
selector: P
|
|
@@ -739,7 +739,7 @@ class H extends s {
|
|
|
739
739
|
t !== null && (this.disabled ? t.removeAttribute(H._titleAttribute) : t.setAttribute(H._titleAttribute, "Previous"));
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
const Mt = "previous-button",
|
|
742
|
+
const Mt = "previous-button", Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
743
743
|
__proto__: null,
|
|
744
744
|
PreviousButtonComponent: H,
|
|
745
745
|
selector: Mt
|
|
@@ -748,7 +748,7 @@ const Mt = "previous-button", Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */
|
|
|
748
748
|
</button>
|
|
749
749
|
`, $t = "*{box-sizing:border-box}:host{display:inline-flex;vertical-align:middle}button[part=button]{border:none;background:transparent}button[part=button]:not(:disabled):hover{transform:scale(1.2)}", V = new CSSStyleSheet();
|
|
750
750
|
V.replaceSync($t);
|
|
751
|
-
class
|
|
751
|
+
class N extends s {
|
|
752
752
|
static _disabledAttribute = "disabled";
|
|
753
753
|
static _titleAttribute = "title";
|
|
754
754
|
/**
|
|
@@ -781,7 +781,7 @@ class T extends s {
|
|
|
781
781
|
* Updates the title visibility based on disabled state.
|
|
782
782
|
*/
|
|
783
783
|
attributeChangedCallback(t, e, i) {
|
|
784
|
-
super.attributeChangedCallback(t, e, i), t ===
|
|
784
|
+
super.attributeChangedCallback(t, e, i), t === N._disabledAttribute && this._updateTitle();
|
|
785
785
|
}
|
|
786
786
|
/**
|
|
787
787
|
* Renders the component's HTML structure.
|
|
@@ -797,18 +797,18 @@ class T extends s {
|
|
|
797
797
|
const t = this.shadowRoot?.querySelector(
|
|
798
798
|
"button"
|
|
799
799
|
);
|
|
800
|
-
t !== null && (this.disabled ? t.removeAttribute(
|
|
800
|
+
t !== null && (this.disabled ? t.removeAttribute(N._titleAttribute) : t.setAttribute(N._titleAttribute, "Next"));
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
const It = "next-button", je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
804
804
|
__proto__: null,
|
|
805
|
-
NextButtonComponent:
|
|
805
|
+
NextButtonComponent: N,
|
|
806
806
|
selector: It
|
|
807
807
|
}, Symbol.toStringTag, { value: "Module" })), Ht = `<dialog part="dialog">
|
|
808
808
|
<slot></slot>
|
|
809
809
|
</dialog>
|
|
810
|
-
`,
|
|
811
|
-
X.replaceSync(
|
|
810
|
+
`, Nt = "*{box-sizing:border-box}dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-1) solid var(--color-border-secondary);border-radius:var(--border-radius-xl);padding:var(--spacing-4);font-family:var(--font-family-base);line-height:var(--line-height-normal);font-size:var(--font-size-sm);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:slideIn var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog.closing{animation:slideOut var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog::backdrop{background:var(--window-backdrop);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:fadeIn var(--transition-base) ease-out forwards}dialog.closing::backdrop{animation:fadeOut var(--transition-base) ease-out forwards}@keyframes slideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes slideOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.95) translateY(-20px)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}", X = new CSSStyleSheet();
|
|
811
|
+
X.replaceSync(Nt);
|
|
812
812
|
class M extends HTMLElement {
|
|
813
813
|
/**
|
|
814
814
|
* @see HTMLDialogElement.closedBy
|
|
@@ -939,10 +939,10 @@ class M extends HTMLElement {
|
|
|
939
939
|
}, 300);
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const
|
|
942
|
+
const Tt = "base-dialog", Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
943
943
|
__proto__: null,
|
|
944
944
|
BaseDialogComponent: M,
|
|
945
|
-
selector:
|
|
945
|
+
selector: Tt
|
|
946
946
|
}, Symbol.toStringTag, { value: "Module" })), jt = `<dialog part="dialog">
|
|
947
947
|
<header part="header">
|
|
948
948
|
<h2></h2>
|
|
@@ -1232,8 +1232,8 @@ const Dt = "confirmation-dialog", Ut = {
|
|
|
1232
1232
|
|
|
1233
1233
|
<next-button class="nav-next" part="nav-next-button"></next-button>
|
|
1234
1234
|
</div>
|
|
1235
|
-
`,
|
|
1236
|
-
Q.replaceSync(
|
|
1235
|
+
`, Ct = "*{box-sizing:border-box}:host{display:block;width:100%}.bar-menu-container{display:flex;align-items:center;justify-content:space-between;height:100%;gap:var(--gap-sm);padding:var(--spacing-1);background:var(--color-bg-primary);border-radius:var(--border-radius-full);border:var(--border-width-2) solid var(--color-border-secondary);box-shadow:var(--shadow-sm);margin:0 auto}.bar-menu-container .nav-prev,.bar-menu-container .nav-next{flex-shrink:0;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease-in-out,visibility .2s ease-in-out}.bar-menu-container .nav-prev.visible,.bar-menu-container .nav-next.visible{opacity:1;visibility:visible;pointer-events:auto}.bar-menu-container .nav-prev::part(button),.bar-menu-container .nav-next::part(button){background-color:transparent;box-shadow:none}.bar-menu-container .buttons-wrapper{display:grid;grid-template-columns:repeat(var(--bar-menu-visible-count, 3),1fr);grid-auto-rows:max-content;align-items:center;justify-items:center;gap:var(--gap-sm);overflow:hidden;position:relative;width:auto}::slotted(*){display:none;flex-shrink:0;will-change:opacity,transform;contain:layout style paint;opacity:0;transform:scale(.8)}::slotted(.animating){transition:opacity .4s cubic-bezier(.34,1.56,.64,1),transform .4s cubic-bezier(.34,1.56,.64,1)}::slotted(.visible-button){display:inline-flex!important;pointer-events:auto;opacity:1;transform:scale(1)}", Q = new CSSStyleSheet();
|
|
1236
|
+
Q.replaceSync(Ct);
|
|
1237
1237
|
class y extends HTMLElement {
|
|
1238
1238
|
static _visibleCountAttribute = "visible-count";
|
|
1239
1239
|
static _cyclicalNavigationAttribute = "cyclical-navigation";
|
|
@@ -1444,10 +1444,10 @@ class y extends HTMLElement {
|
|
|
1444
1444
|
return this._currentIndex;
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
const
|
|
1447
|
+
const Wt = "bar-menu", De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1448
1448
|
__proto__: null,
|
|
1449
1449
|
BarMenuComponent: y,
|
|
1450
|
-
selector:
|
|
1450
|
+
selector: Wt
|
|
1451
1451
|
}, Symbol.toStringTag, { value: "Module" })), Yt = "ds-spinner", Vt = `<div part="spinner" class="spinner" role="status" aria-label="Loading">
|
|
1452
1452
|
<div class="spinner-ring"></div>
|
|
1453
1453
|
</div>
|
|
@@ -1724,7 +1724,7 @@ class w extends HTMLElement {
|
|
|
1724
1724
|
t != null && (t.textContent = this.label);
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
1727
|
-
const se = "loader-bars",
|
|
1727
|
+
const se = "loader-bars", Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1728
1728
|
__proto__: null,
|
|
1729
1729
|
LoaderBarsComponent: w,
|
|
1730
1730
|
selector: se
|
|
@@ -1770,7 +1770,7 @@ class R extends HTMLElement {
|
|
|
1770
1770
|
this.shadowRoot !== null && (this.shadowRoot.innerHTML = ae);
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
|
-
const
|
|
1773
|
+
const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1774
1774
|
__proto__: null,
|
|
1775
1775
|
BaseCardComponent: R,
|
|
1776
1776
|
selector: oe
|
|
@@ -1839,7 +1839,7 @@ const Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1839
1839
|
<span class="close-icon">✕</span>
|
|
1840
1840
|
</button>
|
|
1841
1841
|
</div>
|
|
1842
|
-
`, be = '@charset "UTF-8";*{box-sizing:border-box}:host{display:block}:host([hidden]){display:none}.alert{display:flex;align-items:center;gap:var(--gap-sm);padding:var(--spacing-3);border-radius:var(--border-radius-lg);border-left:4px solid var(--color-primary);background-color:var(--color-bg-secondary);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-sm);line-height:var(--line-height-normal);animation:alertIn var(--transition-fast) ease-out}:host([variant=success]) .alert{border-left-color:#22c55e;background-color:#1a3f1f;color:#d1fae5}:host([variant=warning]) .alert{border-left-color:#facc15;background-color:#3f3011;color:#e0c600}:host([variant=error]) .alert{border-left-color:#dc2626;background-color:color-mix(in srgb,#dc2626 10%,var(--color-bg-primary))}:host([variant=info]) .alert
|
|
1842
|
+
`, be = '@charset "UTF-8";*{box-sizing:border-box}:host{display:block}:host([hidden]){display:none}.alert{display:flex;align-items:center;gap:var(--gap-sm);padding:var(--spacing-3);border-radius:var(--border-radius-lg);border-left:4px solid var(--color-primary);background-color:var(--color-bg-secondary);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-sm);line-height:var(--line-height-normal);animation:alertIn var(--transition-fast) ease-out}:host([variant=success]) .alert{border-left-color:#22c55e;background-color:#1a3f1f;color:#d1fae5}:host([variant=warning]) .alert{border-left-color:#facc15;background-color:#3f3011;color:#e0c600}:host([variant=error]) .alert{border-left-color:#dc2626;background-color:color-mix(in srgb,#dc2626 10%,var(--color-bg-primary))}:host([variant=info]) .alert{border-left-color:var(--color-primary);background-color:color-mix(in srgb,var(--color-primary) 15%,var(--color-bg-primary));color:var(--color-text-primary)}.alert-icon{font-size:var(--font-size-lg);flex-shrink:0;display:flex;align-items:center;justify-content:center;min-width:1.25em;height:1.25em;font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",var(--font-family-base),sans-serif}:host([variant=success]) .alert-icon:before{content:"✓"}:host([variant=warning]) .alert-icon:before{content:"⚠"}:host([variant=error]) .alert-icon:before{content:"✕"}:host([variant=info]) .alert-icon:before{content:"ℹ"}.alert-content{flex:1;min-width:0;padding:0 var(--gap-sm);border-left:1px solid}::slotted([slot=title]){display:block;font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);margin-bottom:var(--spacing-1)}.alert-close{flex-shrink:0;background:transparent;border:none;cursor:pointer;padding:var(--spacing-1);border-radius:var(--border-radius-sm);color:var(--color-text-secondary);font-size:var(--font-size-md);line-height:1;display:flex;align-items:center;justify-content:center;transition:background var(--transition-fast),color var(--transition-fast)}.alert-close:hover{background:var(--color-hover-bg-secondary);color:var(--color-text-primary)}:host(:not([dismissible])) .alert-close{display:none}@keyframes alertIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}', ot = new CSSStyleSheet();
|
|
1843
1843
|
ot.replaceSync(be);
|
|
1844
1844
|
class A extends HTMLElement {
|
|
1845
1845
|
static _variantAttribute = "variant";
|
|
@@ -2404,16 +2404,16 @@ export {
|
|
|
2404
2404
|
Ye as Badge,
|
|
2405
2405
|
De as BarMenu,
|
|
2406
2406
|
$e as BaseButton,
|
|
2407
|
-
|
|
2407
|
+
We as BaseCard,
|
|
2408
2408
|
Fe as BaseDialog,
|
|
2409
2409
|
j as CUSTOM_MESSAGES,
|
|
2410
2410
|
He as CloseButton,
|
|
2411
|
-
|
|
2411
|
+
Ne as ConfirmButton,
|
|
2412
2412
|
qe as ConfirmationDialog,
|
|
2413
2413
|
Pe as HeaderBodyFooterDialog,
|
|
2414
|
-
|
|
2414
|
+
Ce as LoaderBars,
|
|
2415
2415
|
je as NextButton,
|
|
2416
|
-
|
|
2416
|
+
Te as PreviousButton,
|
|
2417
2417
|
Ke as ProgressBar,
|
|
2418
2418
|
Ge as Skeleton,
|
|
2419
2419
|
Ue as Spinner,
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
<span class="close-icon">✕</span>
|
|
134
134
|
</button>
|
|
135
135
|
</div>
|
|
136
|
-
`,Ee='@charset "UTF-8";*{box-sizing:border-box}:host{display:block}:host([hidden]){display:none}.alert{display:flex;align-items:center;gap:var(--gap-sm);padding:var(--spacing-3);border-radius:var(--border-radius-lg);border-left:4px solid var(--color-primary);background-color:var(--color-bg-secondary);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-sm);line-height:var(--line-height-normal);animation:alertIn var(--transition-fast) ease-out}:host([variant=success]) .alert{border-left-color:#22c55e;background-color:#1a3f1f;color:#d1fae5}:host([variant=warning]) .alert{border-left-color:#facc15;background-color:#3f3011;color:#e0c600}:host([variant=error]) .alert{border-left-color:#dc2626;background-color:color-mix(in srgb,#dc2626 10%,var(--color-bg-primary))}:host([variant=info]) .alert
|
|
136
|
+
`,Ee='@charset "UTF-8";*{box-sizing:border-box}:host{display:block}:host([hidden]){display:none}.alert{display:flex;align-items:center;gap:var(--gap-sm);padding:var(--spacing-3);border-radius:var(--border-radius-lg);border-left:4px solid var(--color-primary);background-color:var(--color-bg-secondary);color:var(--color-text-primary);font-family:var(--font-family-base);font-size:var(--font-size-sm);line-height:var(--line-height-normal);animation:alertIn var(--transition-fast) ease-out}:host([variant=success]) .alert{border-left-color:#22c55e;background-color:#1a3f1f;color:#d1fae5}:host([variant=warning]) .alert{border-left-color:#facc15;background-color:#3f3011;color:#e0c600}:host([variant=error]) .alert{border-left-color:#dc2626;background-color:color-mix(in srgb,#dc2626 10%,var(--color-bg-primary))}:host([variant=info]) .alert{border-left-color:var(--color-primary);background-color:color-mix(in srgb,var(--color-primary) 15%,var(--color-bg-primary));color:var(--color-text-primary)}.alert-icon{font-size:var(--font-size-lg);flex-shrink:0;display:flex;align-items:center;justify-content:center;min-width:1.25em;height:1.25em;font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",var(--font-family-base),sans-serif}:host([variant=success]) .alert-icon:before{content:"✓"}:host([variant=warning]) .alert-icon:before{content:"⚠"}:host([variant=error]) .alert-icon:before{content:"✕"}:host([variant=info]) .alert-icon:before{content:"ℹ"}.alert-content{flex:1;min-width:0;padding:0 var(--gap-sm);border-left:1px solid}::slotted([slot=title]){display:block;font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);margin-bottom:var(--spacing-1)}.alert-close{flex-shrink:0;background:transparent;border:none;cursor:pointer;padding:var(--spacing-1);border-radius:var(--border-radius-sm);color:var(--color-text-secondary);font-size:var(--font-size-md);line-height:1;display:flex;align-items:center;justify-content:center;transition:background var(--transition-fast),color var(--transition-fast)}.alert-close:hover{background:var(--color-hover-bg-secondary);color:var(--color-text-primary)}:host(:not([dismissible])) .alert-close{display:none}@keyframes alertIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}',lt=new CSSStyleSheet;lt.replaceSync(Ee);class _ extends HTMLElement{static _variantAttribute="variant";static _dismissibleAttribute="dismissible";constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(lt)}static get observedAttributes(){return[_._variantAttribute,_._dismissibleAttribute]}get variant(){return this.getAttribute(_._variantAttribute)??"info"}set variant(t){this.setAttribute(_._variantAttribute,t)}get dismissible(){return this.hasAttribute(_._dismissibleAttribute)}set dismissible(t){t?this.setAttribute(_._dismissibleAttribute,""):this.removeAttribute(_._dismissibleAttribute)}connectedCallback(){this._render(),this._addEventListeners()}disconnectedCallback(){this._removeEventListeners()}attributeChangedCallback(t,e,i){if(i!==e&&(t===_._variantAttribute&&this.setAttribute("variant",i||"info"),t===_._dismissibleAttribute)){const r=this.shadowRoot?.querySelector(".alert-close");r&&(r.style.display=this.dismissible?"":"none")}}_handleClose=()=>{this.dispatchEvent(new CustomEvent("ds-alert-dismiss",{bubbles:!0,composed:!0})),this.setAttribute("hidden","")};_addEventListeners(){this.shadowRoot?.querySelector(".alert-close")?.addEventListener("click",this._handleClose)}_removeEventListeners(){this.shadowRoot?.querySelector(".alert-close")?.removeEventListener("click",this._handleClose)}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=Se,this._addEventListeners())}}const ke=Object.freeze(Object.defineProperty({__proto__:null,AlertComponent:_,selector:we},Symbol.toStringTag,{value:"Module"})),xe="ds-tag",Le=`<span part="tag" class="tag">
|
|
137
137
|
<slot></slot>
|
|
138
138
|
<button
|
|
139
139
|
part="remove-button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AlertVariant = 'info' | 'success' | 'warning' | 'error'
|
|
1
|
+
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
2
2
|
export declare class AlertComponent extends HTMLElement {
|
|
3
3
|
private static readonly _variantAttribute;
|
|
4
4
|
private static readonly _dismissibleAttribute;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albi_scando/as-design-system-lib",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
4
4
|
"description": "A library of reusable, strongly typed Web Components built with TypeScript, designed for creating consistent and maintainable user interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|