@muibook/components 19.1.0 → 19.2.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.
@@ -1,6 +1,6 @@
1
1
  import "../mui-icons/close/index.js";
2
2
  import "../mui-button/index.js";
3
- class n extends HTMLElement {
3
+ class l extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["open", "width", "content-max-height"];
6
6
  }
@@ -8,7 +8,7 @@ class n extends HTMLElement {
8
8
  super(), this.attachShadow({ mode: "open" });
9
9
  }
10
10
  connectedCallback() {
11
- var a;
11
+ var a, n;
12
12
  if (!this.shadowRoot) return;
13
13
  const s = (
14
14
  /*css*/
@@ -71,6 +71,10 @@ class n extends HTMLElement {
71
71
  .actions[hidden] {
72
72
  display: none !important;
73
73
  }
74
+
75
+ .header[hidden] {
76
+ display: none !important;
77
+ }
74
78
  `
75
79
  );
76
80
  this.shadowRoot.innerHTML = /*html*/
@@ -88,12 +92,17 @@ class n extends HTMLElement {
88
92
  <slot name="actions"></slot>
89
93
  </div>
90
94
  </dialog>
91
- `, this.dialogEl = this.shadowRoot.querySelector("dialog"), this.footerEl = this.shadowRoot.querySelector(".actions"), this.actionsSlot = this.shadowRoot.querySelector('slot[name="actions"]');
95
+ `, this.dialogEl = this.shadowRoot.querySelector("dialog"), this.footerEl = this.shadowRoot.querySelector(".actions"), this.actionsSlot = this.shadowRoot.querySelector('slot[name="actions"]'), this.headerEl = this.shadowRoot.querySelector(".header"), this.titleSlot = this.shadowRoot.querySelector('slot[name="title"]');
92
96
  const e = this.shadowRoot.querySelector(".close");
93
97
  e == null || e.addEventListener("click", () => this.close()), this.dialogEl.addEventListener("click", (i) => {
94
98
  const o = this.dialogEl.getBoundingClientRect();
95
99
  i.clientX >= o.left && i.clientX <= o.right && i.clientY >= o.top && i.clientY <= o.bottom || this.close();
96
- }), (a = this.actionsSlot) == null || a.addEventListener("slotchange", () => this.updateFooterVisibility()), this.updateFooterVisibility(), this.syncOpenState();
100
+ }), (a = this.actionsSlot) == null || a.addEventListener("slotchange", () => this.updateFooterVisibility()), (n = this.titleSlot) == null || n.addEventListener("slotchange", () => this.updateHeaderVisibility()), this.updateHeaderVisibility(), this.updateFooterVisibility(), this.syncOpenState();
101
+ }
102
+ updateHeaderVisibility() {
103
+ if (!this.headerEl || !this.titleSlot) return;
104
+ const t = this.titleSlot.assignedElements().length > 0;
105
+ this.headerEl.hidden = !t, this.toggleAttribute("has-header", t);
97
106
  }
98
107
  updateFooterVisibility() {
99
108
  if (!this.footerEl || !this.actionsSlot) return;
@@ -113,4 +122,4 @@ class n extends HTMLElement {
113
122
  this.removeAttribute("open"), this.dispatchEvent(new CustomEvent("mui-dialog-close", { bubbles: !0, composed: !0 }));
114
123
  }
115
124
  }
116
- customElements.get("mui-dialog") || customElements.define("mui-dialog", n);
125
+ customElements.get("mui-dialog") || customElements.define("mui-dialog", l);
@@ -21,7 +21,7 @@ class n extends HTMLElement {
21
21
  margin-top: var(--space-300);
22
22
  }
23
23
  :host([size="x-small"][has-message]) .message-container { margin-top: var(--space-100); }
24
- :host([size="small"][has-message]) .message-container { margin-top: var(--space-100); }
24
+ :host([size="small"][has-message]) .message-container { margin-top: var(--space-200); }
25
25
  :host([size="medium"][has-message]) .message-container { margin-top: var(--space-300); }
26
26
  :host([size="large"][has-message]) .message-container { margin-top: var(--space-300); }
27
27
 
@@ -0,0 +1 @@
1
+ import "./trash/index.js";
@@ -0,0 +1,81 @@
1
+ class c extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["size", "color"];
4
+ }
5
+ constructor() {
6
+ super(), this.attachShadow({ mode: "open" });
7
+ }
8
+ connectedCallback() {
9
+ this.render();
10
+ }
11
+ attributeChangedCallback(l, t, a) {
12
+ (l === "size" || l === "color") && t !== a && this.render();
13
+ }
14
+ render() {
15
+ const l = this.getAttribute("size") || "medium", t = this.getAttribute("color"), a = {
16
+ default: "var(--illustration-main-color-default)",
17
+ inverted: "var(--illustration-main-color-inverted)"
18
+ }, o = t && a[t] || t || a.default, s = "color-mix(in srgb, var(--illustration-main-color) 35%, transparent)", e = "color-mix(in srgb, var(--illustration-main-color) 14%, transparent)", n = t === "inverted" ? "var(--illustration-shadow-color-inverted)" : "var(--illustration-shadow-color-default)", i = {
19
+ small: "var(--illustration-size-small)",
20
+ medium: "var(--illustration-size-medium)",
21
+ large: "var(--illustration-size-large)",
22
+ "x-large": "var(--illustration-size-x-large)"
23
+ }, r = i[l] ?? i.medium;
24
+ this.classList.add("mui-illustration"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ width: ${r};
29
+ height: ${r};
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ flex: none;
34
+ --illustration-main-color: ${o};
35
+ --illustration-detail-color: ${s};
36
+ --illustration-atmosphere-color: ${e};
37
+ --illustration-shadow-color: ${n};
38
+ }
39
+
40
+ svg {
41
+ width: 100%;
42
+ height: 100%;
43
+ display: block;
44
+ }
45
+ </style>
46
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
47
+ <ellipse cx="48" cy="93" fill="var(--illustration-shadow-color)" rx="25" ry="3"></ellipse>
48
+ <path
49
+ fill="var(--illustration-main-color)"
50
+ d="M39.947 69.904q.765 0 1.24-.448.474-.449.448-1.16l-.844-29.057q0-.738-.475-1.16-.474-.422-1.213-.422-.79 0-1.265.448-.45.422-.422 1.16l.79 29.03q.054.739.502 1.187.474.422 1.24.422m8.042 0q.791 0 1.266-.422.5-.448.5-1.186v-29.03q0-.74-.5-1.16-.475-.45-1.266-.449-.764 0-1.265.448-.475.422-.475 1.16v29.03q0 .739.474 1.187.501.422 1.266.422m8.069 0q.764 0 1.212-.422.476-.422.501-1.186l.791-29.03q.027-.74-.448-1.16-.448-.45-1.24-.449-.711 0-1.186.422-.474.422-.5 1.186l-.818 29.03q-.027.739.422 1.187.474.422 1.265.422M35.697 28.742l-.474-5.887q-.228-2.838 1.376-4.608 1.628-1.797 4.65-2.04l9.987-.803q3.022-.242 4.89 1.273 1.893 1.488 2.12 4.327l.474 5.887-4.179.336-.452-5.624q-.089-1.104-.88-1.728-.765-.627-1.947-.532l-9.41.757q-1.181.094-1.863.837-.654.741-.566 1.845l.453 5.624zm-11.764 3.062q-.788.063-1.439-.466a2 2 0 0 1-.692-1.373 1.88 1.88 0 0 1 .468-1.413q.556-.653 1.344-.716l46.967-3.776q.789-.065 1.413.468.626.531.69 1.346a2 2 0 0 1-.464 1.466 1.82 1.82 0 0 1-1.32.688zm11.98 46.116q-2.848 0-4.614-1.688-1.74-1.66-1.872-4.509l-1.872-38.917h40.869l-1.846 38.891q-.131 2.847-1.898 4.535t-4.588 1.688z"
51
+ ></path>
52
+ <path
53
+ fill="var(--illustration-detail-color)"
54
+ d="M84 59a1 1 0 1 0-1 1v1a2 2 0 1 1 0-4 2 2 0 0 1 0 4v-1a1 1 0 0 0 1-1"
55
+ ></path>
56
+ <circle cx="17" cy="50" r="1" fill="var(--illustration-atmosphere-color)"></circle>
57
+ <path
58
+ fill="var(--illustration-detail-color)"
59
+ d="M77 85a1 1 0 1 1-2 0 1 1 0 0 1 2 0M34.5 1.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0"
60
+ ></path>
61
+ <path
62
+ fill="var(--illustration-detail-color)"
63
+ d="M82 13c.207 0 .375.168.375.375v1.25h1.25a.375.375 0 0 1 0 .75h-1.25v1.25a.375.375 0 0 1-.75 0v-1.25h-1.25a.375.375 0 0 1 0-.75h1.25v-1.25c0-.207.168-.375.375-.375"
64
+ ></path>
65
+ <path
66
+ fill="var(--illustration-detail-color)"
67
+ d="M10.5 75.4c.155 0 .281.126.281.281v.938h.938a.281.281 0 0 1 0 .562h-.938v.938a.281.281 0 0 1-.562 0v-.938H9.28a.281.281 0 1 1 0-.562h.938v-.938c0-.155.126-.28.281-.28"
68
+ ></path>
69
+ <path
70
+ fill="var(--illustration-detail-color)"
71
+ d="M13.508 20.4c.362 0 .656.294.656.656v2.188h2.188a.656.656 0 0 1 0 1.312h-2.188v2.188a.656.656 0 0 1-1.312 0v-2.188h-2.188a.656.656 0 1 1 0-1.312h2.188v-2.188c0-.362.293-.656.656-.656"
72
+ ></path>
73
+ <path
74
+ fill="var(--illustration-atmosphere-color)"
75
+ d="M74.535 64.6c.156 0 .281.127.281.282v.937h.938a.281.281 0 0 1 0 .563h-.938v.937a.281.281 0 0 1-.562 0v-.937h-.938a.281.281 0 0 1 0-.563h.938v-.937c0-.156.126-.281.281-.281"
76
+ ></path>
77
+ </svg>
78
+ `);
79
+ }
80
+ }
81
+ customElements.get("mui-illustration-trash") || customElements.define("mui-illustration-trash", c);
@@ -91,7 +91,7 @@ class I extends HTMLElement {
91
91
  medium: "x-small",
92
92
  large: "small"
93
93
  }, v = {
94
- "x-small": "x-small",
94
+ "x-small": "xx-small",
95
95
  small: "x-small",
96
96
  medium: "small",
97
97
  large: "medium"
@@ -113,7 +113,7 @@ class I extends HTMLElement {
113
113
  medium: "x-small",
114
114
  large: "small"
115
115
  }, u = {
116
- "x-small": "x-small",
116
+ "x-small": "xx-small",
117
117
  small: "x-small",
118
118
  medium: "small",
119
119
  large: "medium"
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Mon, 30 Mar 2026 07:14:52 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Tue, 05 May 2026 05:23:52 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -256,6 +256,14 @@ html[data-theme="light"] {
256
256
  /* Icon */
257
257
  --icon-color-default: var(--black);
258
258
  --icon-color-inverted: var(--white);
259
+ --illustration-main-color-default: var(--icon-color-default);
260
+ --illustration-main-color-inverted: var(--icon-color-inverted);
261
+ --illustration-shadow-color-default: var(--black-opacity-20);
262
+ --illustration-shadow-color-inverted: var(--white-opacity-20);
263
+ --illustration-size-small: 8rem;
264
+ --illustration-size-medium: 9.6rem;
265
+ --illustration-size-large: 11.2rem;
266
+ --illustration-size-x-large: 12.8rem;
259
267
  /* Badge */
260
268
  --badge-text-color: var(--grey-100);
261
269
  --badge-background-neutral: var(--grey-600);
@@ -600,6 +608,14 @@ html[data-theme="dark"] {
600
608
  /* Icon */
601
609
  --icon-color-default: var(--white);
602
610
  --icon-color-inverted: var(--black);
611
+ --illustration-main-color-default: var(--icon-color-default);
612
+ --illustration-main-color-inverted: var(--icon-color-inverted);
613
+ --illustration-shadow-color-default: var(--black-opacity-30);
614
+ --illustration-shadow-color-inverted: var(--black-opacity-20);
615
+ --illustration-size-small: 8rem;
616
+ --illustration-size-medium: 9.6rem;
617
+ --illustration-size-large: 11.2rem;
618
+ --illustration-size-x-large: 12.8rem;
603
619
  /* Badge */
604
620
  --badge-text-color: var(--grey-900);
605
621
  --badge-background-neutral: var(--grey-400);