@muibook/components 19.0.1 → 19.1.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,5 +1,5 @@
1
- import { getPartMap as h } from "../../utils/part-map/index.js";
2
- class u extends HTMLElement {
1
+ import { getPartMap as v } from "../../utils/part-map/index.js";
2
+ class h extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ["target", "href", "variant", "disabled", "weight", "size", "download", "usage"];
5
5
  }
@@ -9,26 +9,26 @@ class u extends HTMLElement {
9
9
  async connectedCallback() {
10
10
  this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("weight") || this.setAttribute("weight", "regular"), this.hasAttribute("variant") || this.setAttribute("variant", "default"), await this.waitForPartMap(), this.render(), requestAnimationFrame(() => this.updateSlotState());
11
11
  }
12
- attributeChangedCallback(t, o, e) {
12
+ attributeChangedCallback(t, e, o) {
13
13
  if (this.shadowRoot) {
14
14
  if (t === "href") {
15
15
  const a = this.shadowRoot.querySelector("a");
16
- a && a.setAttribute("href", e || "#");
16
+ a && a.setAttribute("href", o || "#");
17
17
  }
18
18
  if (t === "target") {
19
19
  const a = this.shadowRoot.querySelector("a");
20
- a && a.setAttribute("target", e || "_self");
20
+ a && a.setAttribute("target", o || "_self");
21
21
  }
22
22
  if (t === "disabled") {
23
23
  const a = this.shadowRoot.querySelector("a");
24
- a && (e !== null ? (a.setAttribute("aria-disabled", "true"), a.setAttribute("href", "javascript:void(0)")) : (a.setAttribute("aria-disabled", "false"), a.setAttribute("href", this.getAttribute("href") || "#")));
24
+ a && (o !== null ? (a.setAttribute("aria-disabled", "true"), a.setAttribute("href", "javascript:void(0)")) : (a.setAttribute("aria-disabled", "false"), a.setAttribute("href", this.getAttribute("href") || "#")));
25
25
  }
26
26
  if (t === "download") {
27
27
  const a = this.shadowRoot.querySelector("a");
28
28
  if (!a) return;
29
- e !== null ? a.setAttribute("download", e === "" ? "" : e) : a.removeAttribute("download");
29
+ o !== null ? a.setAttribute("download", o === "" ? "" : o) : a.removeAttribute("download");
30
30
  }
31
- t === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => {
31
+ t === "size" && e !== o && this.shadowRoot && requestAnimationFrame(() => {
32
32
  const a = this.shadowRoot;
33
33
  if (!a) return;
34
34
  const n = [
@@ -46,20 +46,20 @@ class u extends HTMLElement {
46
46
  }
47
47
  }
48
48
  updateSlotState() {
49
- const t = this.shadowRoot, o = t.querySelector("slot:not([name])"), e = t.querySelector('slot[name="before"]'), a = t.querySelector('slot[name="after"]'), n = (d) => !!d && d.assignedNodes({ flatten: !0 }).some(
49
+ const t = this.shadowRoot, e = t.querySelector("slot:not([name])"), o = t.querySelector('slot[name="before"]'), a = t.querySelector('slot[name="after"]'), n = (d) => !!d && d.assignedNodes({ flatten: !0 }).some(
50
50
  (l) => {
51
51
  var c;
52
52
  return l.nodeType === Node.ELEMENT_NODE || l.nodeType === Node.TEXT_NODE && !!((c = l.textContent) != null && c.trim());
53
53
  }
54
- ), s = n(e), i = n(a);
54
+ ), s = n(o), i = n(a);
55
55
  this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
56
- const r = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], v = r.length > 0 && r.every(
56
+ const r = (e == null ? void 0 : e.assignedNodes({ flatten: !0 })) ?? [], u = r.length > 0 && r.every(
57
57
  (d) => {
58
58
  var l;
59
59
  return d.nodeType === Node.ELEMENT_NODE ? d.classList.contains("mui-icon") || d.tagName.toLowerCase() === "svg" : !((l = d.textContent) != null && l.trim());
60
60
  }
61
61
  );
62
- this.toggleAttribute("icon-only", v), v ? this.updateIconSizes(r, !0) : [e, o, a].forEach((l) => {
62
+ this.toggleAttribute("icon-only", u), u ? this.updateIconSizes(r, !0) : [o, e, a].forEach((l) => {
63
63
  if (l) {
64
64
  const c = l.assignedNodes({ flatten: !0 });
65
65
  this.updateIconSizes(c, !1), this.updateAvatarSizes(c), this.updateBadgeSizes(c);
@@ -68,7 +68,7 @@ class u extends HTMLElement {
68
68
  }
69
69
  render() {
70
70
  if (!this.shadowRoot) return;
71
- const t = h("text", "spacing", "layout", "visual");
71
+ const t = v("text", "spacing", "layout", "visual");
72
72
  this.shadowRoot.innerHTML = /*html*/
73
73
  `
74
74
  <style>
@@ -496,7 +496,7 @@ class u extends HTMLElement {
496
496
  :host([slot="before"][usage="input"]) a,
497
497
  :host([slot="after"][usage="input"]) a {
498
498
  border: var(--border-thin);
499
- min-height: 4.4rem;
499
+ min-height: var(--input-slot-min-height);
500
500
  background: var(--input-background);
501
501
  color: var(--action-secondary-text-color);
502
502
  border-color: var(--form-default-border-color);
@@ -564,7 +564,11 @@ class u extends HTMLElement {
564
564
  :host([size="xx-small"][variant]:not([variant="default"])) a,
565
565
  :host([size="xx-small"][variant]:not([variant="default"])) a:hover,
566
566
  :host([size="xx-small"][variant]:not([variant="default"])) a:focus,
567
- :host([size="xx-small"][variant]:not([variant="default"])) a[aria-disabled="true"] {
567
+ :host([size="xx-small"][variant]:not([variant="default"])) a[aria-disabled="true"],
568
+ :host([size="xx-small"][usage="input"]) a,
569
+ :host([size="xx-small"][usage="input"]) a:hover,
570
+ :host([size="xx-small"][usage="input"]) a:focus,
571
+ :host([size="xx-small"][usage="input"]) a[aria-disabled="true"] {
568
572
  font-size: var(--font-size-15);
569
573
  line-height: var(--line-height-25);
570
574
  font-weight: var(--font-weight-semi-bold);
@@ -576,7 +580,11 @@ class u extends HTMLElement {
576
580
  :host([size="x-small"][variant]:not([variant="default"])) a,
577
581
  :host([size="x-small"][variant]:not([variant="default"])) a:hover,
578
582
  :host([size="x-small"][variant]:not([variant="default"])) a:focus,
579
- :host([size="x-small"][variant]:not([variant="default"])) a[aria-disabled="true"] {
583
+ :host([size="x-small"][variant]:not([variant="default"])) a[aria-disabled="true"],
584
+ :host([size="x-small"][usage="input"]) a,
585
+ :host([size="x-small"][usage="input"]) a:hover,
586
+ :host([size="x-small"][usage="input"]) a:focus,
587
+ :host([size="x-small"][usage="input"]) a[aria-disabled="true"] {
580
588
  font-size: var(--text-font-size-xs);
581
589
  line-height: var(--text-line-height-xs);
582
590
  font-weight: var(--font-weight-semi-bold);
@@ -585,27 +593,49 @@ class u extends HTMLElement {
585
593
  border-radius: var(--action-radius-x-small);
586
594
  }
587
595
 
588
- :host([size="small"][variant]:not([variant="default"])) a {
596
+ :host([size="small"][variant]:not([variant="default"])) a,
597
+ :host([size="small"][usage="input"]) a {
589
598
  font-size: var(--text-font-size-s);
590
599
  line-height: var(--text-line-height-s);
591
600
  padding: var(--action-padding-small);
592
601
  border-radius: var(--action-radius-small);
593
602
  }
594
603
 
595
- :host([size="medium"][variant]:not([variant="default"])) a {
604
+ :host([size="medium"][variant]:not([variant="default"])) a,
605
+ :host([size="medium"][usage="input"]) a {
596
606
  font-size: var(--text-font-size-m);
597
607
  line-height: var(--text-line-height-m);
598
608
  padding: var(--action-padding);
599
609
  border-radius: var(--action-radius-medium);
600
610
  }
601
611
 
602
- :host([size="large"][variant]:not([variant="default"])) a {
612
+ :host([size="large"][variant]:not([variant="default"])) a,
613
+ :host([size="large"][usage="input"]) a {
603
614
  font-size: var(--text-font-size-l);
604
615
  line-height: var(--text-line-height-l);
605
616
  padding: var(--action-padding-large);
606
617
  border-radius: var(--action-radius-large);
607
618
  }
608
619
 
620
+ /* Keep input-composed links flush against the input edge after size radius applies. */
621
+ :host([slot="before"][usage="input"]) a,
622
+ :host([slot="before"][usage="input"]) a:hover,
623
+ :host([slot="before"][usage="input"]) a:focus,
624
+ :host([slot="before"][usage="input"]) a:focus-visible,
625
+ :host([slot="before"][usage="input"]) a[aria-disabled="true"] {
626
+ border-top-right-radius: var(--radius-000);
627
+ border-bottom-right-radius: var(--radius-000);
628
+ }
629
+
630
+ :host([slot="after"][usage="input"]) a,
631
+ :host([slot="after"][usage="input"]) a:hover,
632
+ :host([slot="after"][usage="input"]) a:focus,
633
+ :host([slot="after"][usage="input"]) a:focus-visible,
634
+ :host([slot="after"][usage="input"]) a[aria-disabled="true"] {
635
+ border-top-left-radius: var(--radius-000);
636
+ border-bottom-left-radius: var(--radius-000);
637
+ }
638
+
609
639
  /* Icon-only size variants */
610
640
  :host([size="xx-small"][variant]:not([variant="default"])[icon-only]) a {
611
641
  height: calc(var(--action-icon-only-size-x-small) - var(--space-100));
@@ -748,7 +778,7 @@ class u extends HTMLElement {
748
778
  }
749
779
  // Update avatar sizes based on button size
750
780
  updateAvatarSizes(t) {
751
- const o = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
781
+ const e = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
752
782
  "xx-small": "x-small",
753
783
  "x-small": "x-small",
754
784
  small: "x-small",
@@ -760,7 +790,7 @@ class u extends HTMLElement {
760
790
  small: "x-small",
761
791
  medium: "small",
762
792
  large: "medium"
763
- })[o] || "small";
793
+ })[e] || "small";
764
794
  t.forEach((i) => {
765
795
  if (i.nodeType === Node.ELEMENT_NODE) {
766
796
  const r = i;
@@ -768,14 +798,14 @@ class u extends HTMLElement {
768
798
  }
769
799
  });
770
800
  }
771
- updateIconSizes(t, o) {
772
- const e = this.getAttribute("size") || "medium", n = {
801
+ updateIconSizes(t, e) {
802
+ const o = this.getAttribute("size") || "medium", n = {
773
803
  "xx-small": "xx-small",
774
804
  "x-small": "x-small",
775
805
  small: "x-small",
776
- medium: o ? "medium" : "small",
777
- large: o ? "large" : "medium"
778
- }[e] || "small";
806
+ medium: e ? "medium" : "small",
807
+ large: e ? "large" : "medium"
808
+ }[o] || "small";
779
809
  t.forEach((s) => {
780
810
  if (s.nodeType === Node.ELEMENT_NODE) {
781
811
  const i = s, r = i.tagName.toLowerCase();
@@ -784,13 +814,13 @@ class u extends HTMLElement {
784
814
  });
785
815
  }
786
816
  updateBadgeSizes(t) {
787
- const o = this.getAttribute("size") || "medium", a = {
817
+ const e = this.getAttribute("size") || "medium", a = {
788
818
  "xx-small": "x-small",
789
819
  "x-small": "x-small",
790
820
  small: "small",
791
821
  medium: "medium",
792
822
  large: "large"
793
- }[o] || "medium";
823
+ }[e] || "medium";
794
824
  t.forEach((n) => {
795
825
  if (n.nodeType === Node.ELEMENT_NODE) {
796
826
  const s = n;
@@ -800,12 +830,12 @@ class u extends HTMLElement {
800
830
  }
801
831
  waitForPartMap() {
802
832
  return new Promise((t) => {
803
- if (typeof h == "function") return t();
804
- const o = () => {
805
- typeof h == "function" ? t() : requestAnimationFrame(o);
833
+ if (typeof v == "function") return t();
834
+ const e = () => {
835
+ typeof v == "function" ? t() : requestAnimationFrame(e);
806
836
  };
807
- o();
837
+ e();
808
838
  });
809
839
  }
810
840
  }
811
- customElements.get("mui-link") || customElements.define("mui-link", u);
841
+ customElements.get("mui-link") || customElements.define("mui-link", h);
@@ -1,6 +1,6 @@
1
1
 
2
2
  /* ================================================================================================== */
3
- /* Don't edit directly • Generated on Tue, 24 Mar 2026 09:58:22 GMT • muibook.com */
3
+ /* Don't edit directly • Generated on Mon, 30 Mar 2026 07:14:52 GMT • muibook.com */
4
4
  /* ================================================================================================== */
5
5
 
6
6
  /* ================================================================================================== */
@@ -230,6 +230,7 @@ html[data-theme="light"] {
230
230
  --skeleton-radius: var(--radius-200);
231
231
  --skeleton-animation-speed: 2000ms;
232
232
  --skeleton-gap: var(--space-200);
233
+ --chip-input-background: var(--surface-elevated-alpha);
233
234
  --surface-recessed-alpha: var(--black-opacity-10);
234
235
  --surface-recessed-100: var(--grey-300);
235
236
  --surface-recessed-200: var(--grey-400);
@@ -571,6 +572,7 @@ html[data-theme="dark"] {
571
572
  --skeleton-radius: var(--radius-200);
572
573
  --skeleton-animation-speed: 2000ms;
573
574
  --skeleton-gap: var(--space-200);
575
+ --chip-input-background: var(--grey-900);
574
576
  --surface-elevated-300: var(--grey-1000);
575
577
  --surface-recessed-alpha: var(--black-opacity-30);
576
578
  --surface-recessed-100: var(--grey-1000);