@muibook/components 9.1.0 → 10.0.1

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.
Files changed (41) hide show
  1. package/README.md +3 -7
  2. package/dist/esm/components/mui-accordion/block/index.js +6 -6
  3. package/dist/esm/components/mui-alert/index.js +43 -40
  4. package/dist/esm/components/mui-badge/index.js +15 -7
  5. package/dist/esm/components/mui-button/index.js +41 -42
  6. package/dist/esm/components/mui-card/body/index.js +31 -31
  7. package/dist/esm/components/mui-card/card/index.js +6 -6
  8. package/dist/esm/components/mui-card/footer/index.js +10 -10
  9. package/dist/esm/components/mui-carousel/controller/index.js +75 -9
  10. package/dist/esm/components/mui-chip/index.js +40 -31
  11. package/dist/esm/components/mui-dropdown/index.js +45 -44
  12. package/dist/esm/components/mui-icons/ai/index.js +52 -0
  13. package/dist/esm/components/mui-icons/index.js +8 -0
  14. package/dist/esm/components/mui-icons/pin/index.js +53 -0
  15. package/dist/esm/components/mui-icons/pin-slash/index.js +53 -0
  16. package/dist/esm/components/mui-icons/rectangle/index.js +55 -0
  17. package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +58 -0
  18. package/dist/esm/components/mui-icons/rectangle-dashed/index.js +55 -0
  19. package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +55 -0
  20. package/dist/esm/components/mui-icons/rectangle-media-text/index.js +55 -0
  21. package/dist/esm/components/mui-link/index.js +44 -44
  22. package/dist/esm/components/mui-slat/slat/index.js +6 -6
  23. package/dist/esm/components/mui-switch/index.js +19 -19
  24. package/dist/esm/components/mui-table/cell/index.js +4 -4
  25. package/dist/esm/components/mui-tabs/item/index.js +9 -9
  26. package/dist/esm/components/mui-tabs/tab-bar/index.js +17 -16
  27. package/dist/esm/css/mui-brand.css +1 -1
  28. package/dist/esm/css/mui-tokens.css +4 -0
  29. package/dist/esm/custom-elements.json +839 -409
  30. package/dist/esm/index.js +12 -4
  31. package/dist/types/components/mui-icons/ai.d.ts +1 -0
  32. package/dist/types/components/mui-icons/index.d.ts +8 -0
  33. package/dist/types/components/mui-icons/pin-slash.d.ts +1 -0
  34. package/dist/types/components/mui-icons/pin.d.ts +1 -0
  35. package/dist/types/components/mui-icons/rectangle-bottom-panel.d.ts +1 -0
  36. package/dist/types/components/mui-icons/rectangle-dashed.d.ts +1 -0
  37. package/dist/types/components/mui-icons/rectangle-left-drawer.d.ts +1 -0
  38. package/dist/types/components/mui-icons/rectangle-media-text.d.ts +1 -0
  39. package/dist/types/components/mui-icons/rectangle.d.ts +1 -0
  40. package/dist/types/index.d.ts +8 -0
  41. package/package.json +29 -1
@@ -14,17 +14,17 @@ class c extends HTMLElement {
14
14
  box-sizing: border-box;
15
15
  }
16
16
 
17
- :host(.inner-space) {
17
+ :host([inner-space]) {
18
18
  padding: var(--space-400) var(--space-500);
19
19
  }
20
20
 
21
21
  @media (min-width: 768px) {
22
- :host(.inner-space) {
22
+ :host([inner-space]) {
23
23
  padding: var(--space-500) var(--space-600);
24
24
  }
25
25
  }
26
26
 
27
- :host(.hidden) {
27
+ :host([hidden]) {
28
28
  display: none;
29
29
  }
30
30
 
@@ -33,7 +33,7 @@ class c extends HTMLElement {
33
33
  border-bottom-left-radius: calc(var(--card-radius) - 1px);
34
34
  }
35
35
 
36
- :host(.has-button-group) {
36
+ :host([has-button-group]) {
37
37
  padding-top: 0;
38
38
  }
39
39
 
@@ -51,17 +51,17 @@ class c extends HTMLElement {
51
51
  return e.nodeType === Node.ELEMENT_NODE || e.nodeType === Node.TEXT_NODE && ((o = e.textContent) == null ? void 0 : o.trim()) !== "";
52
52
  });
53
53
  if (r.length === 0) {
54
- this.classList.add("hidden");
54
+ this.setAttribute("hidden", "");
55
55
  return;
56
56
  }
57
- let a = !1, i = !1;
57
+ let i = !1, a = !1;
58
58
  r.forEach((e) => {
59
- var o, d;
59
+ var o, n;
60
60
  if (e.nodeType === Node.ELEMENT_NODE) {
61
- const t = e, n = t.tagName.toLowerCase();
62
- (n === "mui-code" || (o = t.querySelector) != null && o.call(t, "mui-code")) && (a = !0), (n === "mui-button-group" || (d = t.querySelector) != null && d.call(t, "mui-button-group")) && (i = !0);
61
+ const t = e, d = t.tagName.toLowerCase();
62
+ (d === "mui-code" || (o = t.querySelector) != null && o.call(t, "mui-code")) && (i = !0), (d === "mui-button-group" || (n = t.querySelector) != null && n.call(t, "mui-button-group")) && (a = !0);
63
63
  }
64
- }), a || this.classList.add("inner-space"), i && this.classList.add("has-button-group");
64
+ }), i || this.setAttribute("inner-space", ""), a && this.setAttribute("has-button-group", "");
65
65
  });
66
66
  }
67
67
  }
@@ -1,13 +1,68 @@
1
- class r extends HTMLElement {
1
+ class a extends HTMLElement {
2
2
  constructor() {
3
- super(), this.shadow = this.attachShadow({ mode: "open" }), this.handleTabChange = this.handleTabChange.bind(this);
3
+ super(), this.currentIndex = 0, this.boundMouseEnter = () => this.pauseAutoRotate(), this.boundMouseLeave = () => this.resumeAutoRotate(), this.boundFocusIn = () => this.pauseAutoRotate(), this.boundFocusOut = () => this.resumeAutoRotate(), this.shadow = this.attachShadow({ mode: "open" }), this.handleTabChange = this.handleTabChange.bind(this);
4
+ }
5
+ static get observedAttributes() {
6
+ return ["auto-rotate", "rotate-interval"];
4
7
  }
5
8
  connectedCallback() {
6
9
  this.hasAttribute("direction") || this.setAttribute("direction", "horizontal"), this.render(), this.addEventListener("tab-change", this.handleTabChange);
7
10
  const t = this.querySelector("tab-bar");
8
11
  if (t) {
9
- const o = t.querySelector("tab-item[active]");
10
- o && this.updatePanels(o.id);
12
+ const e = t.querySelector("tab-item[active]");
13
+ if (e)
14
+ this.updatePanels(e.id);
15
+ else {
16
+ const o = t.querySelector("tab-item");
17
+ o && (o.setAttribute("active", ""), this.updatePanels(o.id));
18
+ }
19
+ }
20
+ if (this.addEventListener("mouseenter", this.boundMouseEnter), this.addEventListener("mouseleave", this.boundMouseLeave), this.addEventListener("focusin", this.boundFocusIn), this.addEventListener("focusout", this.boundFocusOut), this.hasAttribute("auto-rotate")) {
21
+ const e = new IntersectionObserver((o) => {
22
+ o[0].isIntersecting && (e.disconnect(), setTimeout(() => {
23
+ const s = this.shadow.querySelector(".carousel-track");
24
+ s && s.offsetWidth > 0 && this.startAutoRotate();
25
+ }, 300));
26
+ });
27
+ e.observe(this);
28
+ }
29
+ }
30
+ disconnectedCallback() {
31
+ this.stopAutoRotate(), this.removeEventListener("mouseenter", this.boundMouseEnter), this.removeEventListener("mouseleave", this.boundMouseLeave), this.removeEventListener("focusin", this.boundFocusIn), this.removeEventListener("focusout", this.boundFocusOut);
32
+ }
33
+ attributeChangedCallback(t, e, o) {
34
+ e !== o && (t === "auto-rotate" && (o !== null ? this.startAutoRotate() : this.stopAutoRotate()), t === "rotate-interval" && this.hasAttribute("auto-rotate") && (this.stopAutoRotate(), this.startAutoRotate()));
35
+ }
36
+ startAutoRotate() {
37
+ this.stopAutoRotate();
38
+ const t = parseInt(this.getAttribute("rotate-interval") || "10000");
39
+ console.log("🎠 Starting auto-rotate with interval:", t), this.autoRotateInterval = window.setInterval(() => {
40
+ this.rotateNext();
41
+ }, t);
42
+ }
43
+ stopAutoRotate() {
44
+ this.autoRotateInterval && (clearInterval(this.autoRotateInterval), this.autoRotateInterval = void 0);
45
+ }
46
+ pauseAutoRotate() {
47
+ this.stopAutoRotate();
48
+ }
49
+ resumeAutoRotate() {
50
+ this.hasAttribute("auto-rotate") && this.startAutoRotate();
51
+ }
52
+ rotateNext() {
53
+ const t = this.querySelectorAll("mui-carousel-panel");
54
+ if (console.log("🔄 rotateNext called, panels:", t.length, "currentIndex:", this.currentIndex), t.length === 0) return;
55
+ this.currentIndex = (this.currentIndex + 1) % t.length;
56
+ const o = t[this.currentIndex].getAttribute("item");
57
+ if (console.log("➡️ Rotating to index:", this.currentIndex, "itemId:", o), o) {
58
+ this.updatePanels(o);
59
+ const s = this.querySelector("tab-bar");
60
+ if (s) {
61
+ const r = s.querySelector(`tab-item#${o}`);
62
+ r && (s.querySelectorAll("tab-item").forEach((n) => {
63
+ n.removeAttribute("active");
64
+ }), r.setAttribute("active", ""));
65
+ }
11
66
  }
12
67
  }
13
68
  render() {
@@ -109,12 +164,23 @@ class r extends HTMLElement {
109
164
  `;
110
165
  }
111
166
  handleTabChange(t) {
112
- const o = t;
113
- this.updatePanels(o.detail.activeId);
167
+ const e = t;
168
+ this.updatePanels(e.detail.activeId);
114
169
  }
115
170
  updatePanels(t) {
116
- const o = this.querySelectorAll("mui-carousel-panel"), e = this.shadow.querySelector(".carousel-track"), s = Array.from(o).findIndex((a) => a.getAttribute("item") === t);
117
- s !== -1 && (e.style.transform = `translateX(-${s * 100}%)`);
171
+ const e = this.querySelectorAll("mui-carousel-panel"), o = this.shadow.querySelector(".carousel-track");
172
+ if (console.log("🎯 updatePanels called with:", t), !o) {
173
+ console.error("❌ Track element not found!");
174
+ return;
175
+ }
176
+ const s = Array.from(e).findIndex((n) => n.getAttribute("item") === t);
177
+ if (s === -1) {
178
+ console.warn("⚠️ Panel not found for:", t);
179
+ return;
180
+ }
181
+ this.currentIndex = s;
182
+ const r = `translateX(-${s * 100}%)`;
183
+ console.log("🎬 Setting transform to:", r), console.log("📏 Current transform:", o.style.transform), console.log("🎨 Current transition:", window.getComputedStyle(o).transition), o.style.transform = r, o.offsetHeight, console.log("✅ After setting transform:", o.style.transform);
118
184
  }
119
185
  }
120
- customElements.get("mui-carousel-controller") || customElements.define("mui-carousel-controller", r);
186
+ customElements.get("mui-carousel-controller") || customElements.define("mui-carousel-controller", a);
@@ -17,19 +17,19 @@ class d extends HTMLElement {
17
17
  requestAnimationFrame(() => {
18
18
  const t = this.shadowRoot;
19
19
  if (!t) return;
20
- const i = t.querySelector('slot[name="before"]'), e = t.querySelector('slot[name="after"]'), a = (o) => o ? o.assignedNodes({ flatten: !0 }).some((s) => {
21
- var c;
22
- return s.nodeType === Node.ELEMENT_NODE || s.nodeType === Node.TEXT_NODE && !!((c = s.textContent) != null && c.trim());
23
- }) : !1, r = a(i), n = a(e);
24
- this.classList.toggle("has-before", r), this.classList.toggle("has-after", n), this.forceAvatarSize(i), this.forceAvatarSize(e);
20
+ const i = t.querySelector('slot[name="before"]'), e = t.querySelector('slot[name="after"]'), a = (s) => s ? s.assignedNodes({ flatten: !0 }).some((r) => {
21
+ var n;
22
+ return r.nodeType === Node.ELEMENT_NODE || r.nodeType === Node.TEXT_NODE && !!((n = r.textContent) != null && n.trim());
23
+ }) : !1, o = a(i), c = a(e);
24
+ this.toggleAttribute("has-before", o), this.toggleAttribute("has-after", c), this.forceAvatarSize(i), this.forceAvatarSize(e);
25
25
  });
26
26
  }
27
27
  forceAvatarSize(t) {
28
28
  if (!t) return;
29
29
  t.assignedNodes({ flatten: !0 }).forEach((e) => {
30
30
  if (e.nodeType === Node.ELEMENT_NODE) {
31
- const a = e, r = a.tagName.toLowerCase();
32
- r === "mui-avatar" ? a.setAttribute("size", "x-small") : r.startsWith("mui-icon-") && a.setAttribute("size", "medium");
31
+ const a = e, o = a.tagName.toLowerCase();
32
+ o === "mui-avatar" ? a.setAttribute("size", "x-small") : o.startsWith("mui-icon-") && a.setAttribute("size", "medium");
33
33
  }
34
34
  });
35
35
  }
@@ -39,6 +39,11 @@ class d extends HTMLElement {
39
39
  /*css*/
40
40
  `
41
41
  :host {
42
+ display: inline-flex;
43
+ box-sizing: border-box;
44
+ }
45
+
46
+ .container {
42
47
  display: inline-grid;
43
48
  align-items: center;
44
49
  height: 4rem;
@@ -60,29 +65,29 @@ class d extends HTMLElement {
60
65
  /* Before & After Slot
61
66
  ========================================= */
62
67
 
63
- :host([variant="clickable"].has-after.has-before) {
68
+ :host([has-after][has-before]) .container {
64
69
  grid-template-columns: auto 1fr auto;
65
70
  padding-right: var(--space-200);
66
71
  padding-left: var(--space-200);
67
72
  }
68
73
 
69
- :host([variant="clickable"].has-after) {
74
+ :host([has-after]) .container {
70
75
  grid-template-columns: 1fr auto;
71
76
  padding-right: var(--space-200);
72
77
  }
73
78
 
74
- :host([variant="clickable"].has-before) {
79
+ :host([has-before]) .container {
75
80
  grid-template-columns: auto 1fr;
76
81
  padding-left: var(--space-200);
77
82
  }
78
83
 
79
84
  /* Usage: input */
80
- :host([usage="input"]) {
85
+ :host([usage="input"]) .container {
81
86
  border-radius: var(--input-radius);
82
87
  }
83
88
 
84
89
  /* Hover and focus (natural) */
85
- :host([variant="clickable"]:hover) {
90
+ :host([variant="clickable"]:hover) .container {
86
91
  background: var(--chip-background-hover);
87
92
  border-color: var(--chip-border-color-hover);
88
93
  box-shadow: inset 0 0 0 1px var(--chip-border-color-hover);
@@ -92,15 +97,15 @@ class d extends HTMLElement {
92
97
  outline: none;
93
98
  }
94
99
 
95
- :host([variant="clickable"]:focus-visible) {
100
+ :host([variant="clickable"]:focus-visible) .container {
96
101
  background: var(--chip-background-focus);
97
102
  border-color: var(--chip-border-color-focus);
98
103
  outline: var(--outline-thick);
99
104
  }
100
105
 
101
106
  /* Active: mouse down OR programmatic */
102
- :host([variant="clickable"]:active),
103
- :host([variant="clickable"][active]) {
107
+ :host([variant="clickable"]:active) .container,
108
+ :host([variant="clickable"][active]) .container {
104
109
  background: var(--chip-background-active);
105
110
  box-shadow: inset 0 0 0 1px var(--chip-border-color-active);
106
111
  border-color: var(--chip-border-color-active);
@@ -117,11 +122,11 @@ class d extends HTMLElement {
117
122
  fill: var(--chip-icon-fill);
118
123
  }
119
124
 
120
- :host(.has-before) ::slotted(.mui-icon) {
125
+ :host([has-before]) ::slotted(.mui-icon) {
121
126
  margin-right: -4px;
122
127
  }
123
128
 
124
- :host(.has-after) ::slotted(.mui-icon) {
129
+ :host([has-after]) ::slotted(.mui-icon) {
125
130
  margin-left: -4px;
126
131
  }
127
132
 
@@ -130,13 +135,13 @@ class d extends HTMLElement {
130
135
  /* DISMISS */
131
136
 
132
137
  /* Disable pointer and focus styles when dismiss attribute is present */
133
- :host([dismiss]) {
138
+ :host([dismiss]) .container {
134
139
  grid-template-columns: 1fr auto;
135
140
  padding-right: calc(var(--space-100) + 0.1rem);
136
141
  }
137
142
 
138
143
  /* Has Before */
139
- :host([dismiss].has-before) {
144
+ :host([dismiss][has-before]) .container {
140
145
  grid-template-columns: auto 1fr auto;
141
146
  padding-left: var(--space-200);
142
147
  }
@@ -157,13 +162,15 @@ class d extends HTMLElement {
157
162
  this.hasAttribute("dismiss") ? (this.shadowRoot.innerHTML = /*html*/
158
163
  `
159
164
  <style>${t}</style>
160
- <slot name="before"></slot>
161
- <mui-body size="small" weight="bold">
162
- <slot></slot>
163
- </mui-body>
164
- <mui-button part="dismiss-btn" variant="tertiary" aria-label="Remove chip">
165
- <mui-icon-close size="x-small"></mui-icon-close>
166
- </mui-button>
165
+ <span class="container">
166
+ <slot name="before"></slot>
167
+ <mui-body size="small" weight="bold">
168
+ <slot></slot>
169
+ </mui-body>
170
+ <mui-button part="dismiss-btn" variant="tertiary" aria-label="Remove chip">
171
+ <mui-icon-close size="x-small"></mui-icon-close>
172
+ </mui-button>
173
+ </span>
167
174
  `, (i = this.shadowRoot.querySelector('[part="dismiss-btn"]')) == null || i.addEventListener("click", (e) => {
168
175
  e.stopPropagation(), this.dispatchEvent(
169
176
  new CustomEvent("dismiss", {
@@ -175,11 +182,13 @@ class d extends HTMLElement {
175
182
  })) : (this.setAttribute("variant", "clickable"), this.shadowRoot.innerHTML = /*html*/
176
183
  `
177
184
  <style>${t}</style>
178
- <slot name="before"></slot>
179
- <mui-body size="small" weight="bold">
180
- <slot></slot>
181
- </mui-body>
182
- <slot name="after"></slot>
185
+ <span class="container">
186
+ <slot name="before"></slot>
187
+ <mui-body size="small" weight="bold">
188
+ <slot></slot>
189
+ </mui-body>
190
+ <slot name="after"></slot>
191
+ </span>
183
192
  `);
184
193
  }
185
194
  }
@@ -1,4 +1,4 @@
1
- const s = class s extends HTMLElement {
1
+ const n = class n extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this.button = null, this.menu = null, this.handleResize = () => {
4
4
  var t;
@@ -8,13 +8,13 @@ const s = class s extends HTMLElement {
8
8
  (t = this.menu) != null && t.classList.contains("show") && this.adjustPosition();
9
9
  }, this.handleFocusOut = (t) => {
10
10
  var e;
11
- this.persistent || this.contains(t.relatedTarget) || (this.closeWithAnimation(), (e = this.menu) == null || e.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
11
+ this.persistent || this.contains(t.relatedTarget) || (this.closeWithAnimation(), (e = this.menu) == null || e.setAttribute("inert", "true"), n.openDropdown === this && (n.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
12
12
  }, this.attachShadow({ mode: "open" });
13
13
  }
14
14
  handleKeyDown(t) {
15
15
  if (t.key === "Escape") {
16
16
  if (!this.menu) return;
17
- this.menu.classList.remove("show"), this.menu.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(
17
+ this.menu.classList.remove("show"), this.menu.setAttribute("inert", "true"), n.openDropdown === this && (n.openDropdown = null), this.dispatchEvent(
18
18
  new CustomEvent("dropdown-toggle", {
19
19
  detail: { open: !1 },
20
20
  bubbles: !0
@@ -28,34 +28,34 @@ const s = class s extends HTMLElement {
28
28
  get persistent() {
29
29
  return this.hasAttribute("persistent");
30
30
  }
31
- attributeChangedCallback(t, e, i) {
32
- t === "zindex" && this.menu && (this.menu.style.zIndex = i ?? "1"), t === "position" && this.menu && this.adjustPosition();
31
+ attributeChangedCallback(t, e, o) {
32
+ t === "zindex" && this.menu && (this.menu.style.zIndex = o ?? "1"), t === "position" && this.menu && this.adjustPosition();
33
33
  }
34
34
  connectedCallback() {
35
- var r, a, l, u, h;
35
+ var r, i, u, c, a;
36
36
  this.render(), this.menu = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".dropdown-menu");
37
37
  const t = this.getAttribute("zindex") || "1";
38
- this.menu && (this.menu.style.zIndex = t), this.menu && this.menu.setAttribute("inert", "true"), (a = this.menu) == null || a.addEventListener("focusout", this.handleFocusOut);
39
- const e = (l = this.shadowRoot) == null ? void 0 : l.querySelector('slot[name="action"]'), i = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) || [];
40
- this.button = i.find(
41
- (o) => o instanceof HTMLElement && o.tagName.toLowerCase() === "mui-button"
38
+ this.menu && (this.menu.style.zIndex = t), this.menu && this.menu.setAttribute("inert", "true"), (i = this.menu) == null || i.addEventListener("focusout", this.handleFocusOut);
39
+ const e = (u = this.shadowRoot) == null ? void 0 : u.querySelector('slot[name="action"]'), o = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) || [];
40
+ this.button = o.find(
41
+ (l) => l instanceof HTMLElement && l.tagName.toLowerCase() === "mui-button"
42
42
  );
43
- const n = (u = this.shadowRoot) == null ? void 0 : u.querySelector("slot:not([name])");
44
- if (n) {
45
- const o = () => {
46
- const c = n.assignedElements({ flatten: !0 });
47
- c.forEach((d) => {
48
- d.classList.remove("dropdown-slot", "dropdown-slot-first", "dropdown-slot-last");
49
- }), c.forEach((d, p) => {
50
- d.setAttribute("variant", "tertiary"), d.classList.add("dropdown-slot"), p === 0 && d.classList.add("dropdown-slot-first"), p === c.length - 1 && d.classList.add("dropdown-slot-last"), d._dropdownListenerAdded || (d.addEventListener("click", () => {
51
- var w, f;
52
- this.persistent || ((w = this.menu) == null || w.classList.remove("show"), (f = this.menu) == null || f.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
53
- }), d._dropdownListenerAdded = !0);
43
+ const d = (c = this.shadowRoot) == null ? void 0 : c.querySelector("slot:not([name])");
44
+ if (d) {
45
+ const l = () => {
46
+ const h = d.assignedElements({ flatten: !0 });
47
+ h.forEach((s) => {
48
+ s.removeAttribute("dropdown-slot"), s.removeAttribute("dropdown-slot-first"), s.removeAttribute("dropdown-slot-last");
49
+ }), h.forEach((s, w) => {
50
+ s.setAttribute("variant", "tertiary"), s.setAttribute("dropdown-slot", ""), w === 0 && s.setAttribute("dropdown-slot-first", ""), w === h.length - 1 && s.setAttribute("dropdown-slot-last", ""), s._dropdownListenerAdded || (s.addEventListener("click", () => {
51
+ var p, m;
52
+ this.persistent || ((p = this.menu) == null || p.classList.remove("show"), (m = this.menu) == null || m.setAttribute("inert", "true"), n.openDropdown === this && (n.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
53
+ }), s._dropdownListenerAdded = !0);
54
54
  });
55
55
  };
56
- n.addEventListener("slotchange", o), o();
56
+ d.addEventListener("slotchange", l), l();
57
57
  }
58
- this.toggleMenu = this.toggleMenu.bind(this), this.closeMenu = this.closeMenu.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), (h = this.button) == null || h.addEventListener("click", this.toggleMenu), document.addEventListener("click", this.closeMenu), document.addEventListener("keydown", this.handleKeyDown), window.addEventListener("resize", this.handleResize), window.addEventListener("scroll", this.handleScroll, !0);
58
+ this.toggleMenu = this.toggleMenu.bind(this), this.closeMenu = this.closeMenu.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), (a = this.button) == null || a.addEventListener("click", this.toggleMenu), document.addEventListener("click", this.closeMenu), document.addEventListener("keydown", this.handleKeyDown), window.addEventListener("resize", this.handleResize), window.addEventListener("scroll", this.handleScroll, !0);
59
59
  }
60
60
  disconnectedCallback() {
61
61
  var t, e;
@@ -68,41 +68,41 @@ const s = class s extends HTMLElement {
68
68
  }, 150);
69
69
  }
70
70
  toggleMenu(t) {
71
- var i;
71
+ var o;
72
72
  if (t.stopPropagation(), !this.menu) return;
73
73
  const e = this.menu.classList.contains("show");
74
- !e && s.openDropdown && s.openDropdown !== this && s.openDropdown.closeWithAnimation(), e ? (this.closeWithAnimation(), (i = this.menu) == null || i.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 }))) : (this.menu.style.display = "block", requestAnimationFrame(() => {
75
- var n, r;
76
- (n = this.menu) == null || n.classList.add("show"), (r = this.menu) == null || r.removeAttribute("inert"), this.adjustPosition();
77
- }), s.openDropdown = this, this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !0 }, bubbles: !0 })));
74
+ !e && n.openDropdown && n.openDropdown !== this && n.openDropdown.closeWithAnimation(), e ? (this.closeWithAnimation(), (o = this.menu) == null || o.setAttribute("inert", "true"), n.openDropdown === this && (n.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 }))) : (this.menu.style.display = "block", requestAnimationFrame(() => {
75
+ var d, r;
76
+ (d = this.menu) == null || d.classList.add("show"), (r = this.menu) == null || r.removeAttribute("inert"), this.adjustPosition();
77
+ }), n.openDropdown = this, this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !0 }, bubbles: !0 })));
78
78
  }
79
79
  closeMenu(t) {
80
- var i;
80
+ var o;
81
81
  const e = t.composedPath();
82
- this.menu && e.includes(this.menu) || this.button && e.includes(this.button) || (this.closeWithAnimation(), (i = this.menu) == null || i.setAttribute("inert", "true"), s.openDropdown === this && (s.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
82
+ this.menu && e.includes(this.menu) || this.button && e.includes(this.button) || (this.closeWithAnimation(), (o = this.menu) == null || o.setAttribute("inert", "true"), n.openDropdown === this && (n.openDropdown = null), this.dispatchEvent(new CustomEvent("dropdown-toggle", { detail: { open: !1 }, bubbles: !0 })));
83
83
  }
84
84
  adjustPosition() {
85
85
  if (!this.menu) return;
86
- const t = this.menu, e = 8, i = 8;
86
+ const t = this.menu, e = 8, o = getComputedStyle(this).getPropertyValue("--dropdown-offset").trim() || "0.8rem", d = parseFloat(getComputedStyle(document.documentElement).fontSize) || 10, r = o.endsWith("rem") ? parseFloat(o) * d : parseFloat(o) || 8;
87
87
  t.style.top = "", t.style.bottom = "", t.style.left = "", t.style.right = "", t.style.maxWidth = "";
88
- const n = this.getBoundingClientRect(), r = t.offsetWidth, a = t.offsetHeight, l = window.innerWidth, u = window.innerHeight;
89
- let h = n.height + i;
90
- u - n.bottom < a + i && n.top > u - n.bottom && (h = -(a + i));
91
- let o = 0;
88
+ const i = this.getBoundingClientRect(), u = t.offsetWidth, c = t.offsetHeight, a = window.innerWidth, l = window.innerHeight;
89
+ let h = i.height + r;
90
+ l - i.bottom < c + r && i.top > l - i.bottom && (h = -(c + r));
91
+ let s = 0;
92
92
  switch (this.getAttribute("position") || "left") {
93
93
  case "left":
94
- o = 0;
94
+ s = 0;
95
95
  break;
96
96
  case "center":
97
- o = (n.width - r) / 2;
97
+ s = (i.width - u) / 2;
98
98
  break;
99
99
  case "right":
100
100
  default:
101
- o = n.width - r;
101
+ s = i.width - u;
102
102
  break;
103
103
  }
104
- const d = e - n.left, p = l - e - (n.left + r);
105
- o = Math.max(d, Math.min(o, p)), r > l - e * 2 && (t.style.maxWidth = `${l - e * 2}px`), t.style.top = `${h}px`, t.style.left = `${o}px`;
104
+ const p = e - i.left, m = a - e - (i.left + u);
105
+ s = Math.max(p, Math.min(s, m)), u > a - e * 2 && (t.style.maxWidth = `${a - e * 2}px`), t.style.top = `${h}px`, t.style.left = `${s}px`;
106
106
  }
107
107
  render() {
108
108
  this.shadowRoot.innerHTML = /*html*/
@@ -119,9 +119,10 @@ const s = class s extends HTMLElement {
119
119
  transform: translateY(-0.25rem);
120
120
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
121
121
  /* End */
122
- min-width: 150px;
122
+ min-width: var(--dropdown-min-width, 15rem);
123
123
  position: absolute;
124
124
  z-index: 1;
125
+ box-sizing: border-box;
125
126
  border: var(--border-thin);
126
127
  /* Unique Styles */
127
128
  background: var(--dropdown-background);
@@ -167,6 +168,6 @@ const s = class s extends HTMLElement {
167
168
  `;
168
169
  }
169
170
  };
170
- s.openDropdown = null;
171
- let m = s;
172
- customElements.get("mui-dropdown") || customElements.define("mui-dropdown", m);
171
+ n.openDropdown = null;
172
+ let f = n;
173
+ customElements.get("mui-dropdown") || customElements.define("mui-dropdown", f);
@@ -0,0 +1,52 @@
1
+ class l 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(e, t, c) {
12
+ (e === "size" || e === "color") && t !== c && this.render();
13
+ }
14
+ render() {
15
+ const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), o = t && {
16
+ default: "var(--icon-color-default)",
17
+ inverted: "var(--icon-color-inverted)"
18
+ }[t] || t || "var(--icon-color-default)", i = {
19
+ "x-small": "1.6rem",
20
+ small: "2.1rem",
21
+ medium: "2.4rem",
22
+ large: "2.8rem"
23
+ }, s = i[e] ?? i.small;
24
+ this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ width: ${s};
29
+ height: ${s};
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ fill: ${o};
34
+ }
35
+ svg {
36
+ width: 100%;
37
+ display: block;
38
+ fill: inherit;
39
+ }
40
+ </style>
41
+
42
+ <svg
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ viewBox="0 0 36 36"
45
+ >
46
+ <path d="M29.61 14.63a.616.616 0 0 1-.613-.543c-.624-4.138-1.106-4.825-5.214-5.368a.636.636 0 0 1-.577-.64c0-.313.236-.578.577-.615 3.99-.53 4.531-1.194 5.214-5.368.047-.325.294-.567.612-.567.306 0 .553.23.6.567.589 4.138 1.154 4.813 5.226 5.368A.62.62 0 0 1 36 8.08a.644.644 0 0 1-.565.639c-3.966.663-4.52 1.17-5.226 5.368-.058.314-.294.543-.6.543m-23.32-.386c-1.07 0-1.823-.772-1.823-1.882v-1.508c0-2.87 1.6-4.5 4.401-4.5H21.9a2.47 2.47 0 0 0-.706 1.726c0 .844.4 1.58.977 2.014H9.363c-.824 0-1.248.386-1.248 1.29v.978c0 1.11-.753 1.882-1.824 1.882m5.379 9.16c-1 0-1.577-.58-1.577-1.557 0-.253.07-.615.223-1.11l2.095-6.345c.46-1.46 1.283-2.123 2.59-2.123 1.353 0 2.212.675 2.66 2.123l2.106 6.345c.153.495.212.857.212 1.11 0 .977-.577 1.556-1.565 1.556-.848 0-1.377-.482-1.59-1.496l-.294-.989h-2.977l-.294.99c-.224 1.013-.742 1.495-1.59 1.495m2.436-4.862h1.86l-.871-3.378h-.118zm-7.814 1.71c-1.2 0-2.19-1.014-2.19-2.244s.99-2.244 2.19-2.244 2.19 1.013 2.19 2.244c0 1.23-.99 2.243-2.19 2.243m2.577 9.626c-2.8 0-4.401-1.629-4.401-4.5V23.69c0-1.11.753-1.882 1.824-1.882s1.824.773 1.824 1.882v1.17c0 .905.424 1.291 1.248 1.291h17.163c.823 0 1.247-.386 1.247-1.29v-7.275c0-.49.147-.915.404-1.236 0 0 .22.5 1.42.5s1.42-.5 1.42-.5c.258.321.405.746.405 1.236v7.793c0 2.871-1.59 4.5-4.402 4.5H8.868"></path>
47
+ <path d="M22.009 13.867c0-.883.698-1.598 1.559-1.598s1.56.715 1.56 1.598l.01 7.938c0 .883-.698 1.598-1.56 1.598-.86 0-1.558-.715-1.558-1.598z"></path>
48
+ </svg>
49
+ `);
50
+ }
51
+ }
52
+ customElements.get("mui-icon-ai") || customElements.define("mui-icon-ai", l);
@@ -34,3 +34,11 @@ import "./music-microphone/index.js";
34
34
  import "./music-quarter-note/index.js";
35
35
  import "./play-rectangle/index.js";
36
36
  import "./list-and-film/index.js";
37
+ import "./ai/index.js";
38
+ import "./rectangle/index.js";
39
+ import "./rectangle-media-text/index.js";
40
+ import "./rectangle-dashed/index.js";
41
+ import "./rectangle-left-drawer/index.js";
42
+ import "./rectangle-bottom-panel/index.js";
43
+ import "./pin/index.js";
44
+ import "./pin-slash/index.js";
@@ -0,0 +1,53 @@
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(e, t, i) {
12
+ (e === "size" || e === "color") && t !== i && this.render();
13
+ }
14
+ render() {
15
+ const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
+ default: "var(--icon-color-default)",
17
+ inverted: "var(--icon-color-inverted)"
18
+ }[t] || t || "var(--icon-color-default)", o = {
19
+ "x-small": "1.6rem",
20
+ small: "2.1rem",
21
+ medium: "2.4rem",
22
+ large: "2.8rem"
23
+ }, s = o[e] ?? o.small;
24
+ this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ width: ${s};
29
+ height: ${s};
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ fill: ${l};
34
+ }
35
+ svg {
36
+ width: 100%;
37
+ display: block;
38
+ fill: inherit;
39
+ }
40
+ </style>
41
+
42
+ <svg
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ viewBox="0 0 36 36"
45
+ >
46
+ <path d="M9.321 22.308c0-2.378 1.847-4.642 4.84-5.8l.334-5.027c-1.669-.939-2.837-1.899-3.359-2.556-.323-.407-.5-.855-.5-1.272 0-.856.667-1.482 1.596-1.482h11.536c.929 0 1.596.626 1.596 1.482 0 .417-.177.865-.5 1.272-.522.657-1.69 1.617-3.36 2.556l.335 5.028c2.993 1.157 4.84 3.42 4.84 5.8 0 1.126-.772 1.887-1.93 1.887h-5.372v5.1c0 1.075-1.001 3.047-1.377 3.047-.375 0-1.377-1.972-1.377-3.046v-5.1h-5.372c-1.158 0-1.93-.762-1.93-1.889"></path>
47
+ </svg>
48
+
49
+
50
+ `);
51
+ }
52
+ }
53
+ customElements.get("mui-icon-pin") || customElements.define("mui-icon-pin", c);