@muibook/components 19.0.0 → 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.
- package/dist/esm/agent/prompts/index.js +1 -1
- package/dist/esm/components/mui-accordion/block/index.js +50 -27
- package/dist/esm/components/mui-accordion/inline/index.js +42 -20
- package/dist/esm/components/mui-button/index.js +20 -1
- package/dist/esm/components/mui-button-group/index.js +21 -3
- package/dist/esm/components/mui-chip-input/index.js +2 -2
- package/dist/esm/components/mui-hint/index.js +2 -0
- package/dist/esm/components/mui-input/index.js +197 -75
- package/dist/esm/components/mui-link/index.js +63 -33
- package/dist/esm/components/mui-responsive/index.js +43 -24
- package/dist/esm/css/mui-brand.css +1 -1
- package/dist/esm/css/mui-tokens.css +2 -0
- package/dist/esm/custom-elements.json +1081 -933
- package/dist/esm/dynamic-attrs.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getPartMap as
|
|
2
|
-
class
|
|
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,
|
|
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",
|
|
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",
|
|
20
|
+
a && a.setAttribute("target", o || "_self");
|
|
21
21
|
}
|
|
22
22
|
if (t === "disabled") {
|
|
23
23
|
const a = this.shadowRoot.querySelector("a");
|
|
24
|
-
a && (
|
|
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
|
-
|
|
29
|
+
o !== null ? a.setAttribute("download", o === "" ? "" : o) : a.removeAttribute("download");
|
|
30
30
|
}
|
|
31
|
-
t === "size" &&
|
|
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,
|
|
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(
|
|
54
|
+
), s = n(o), i = n(a);
|
|
55
55
|
this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
|
|
56
|
-
const r = (
|
|
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",
|
|
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 =
|
|
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:
|
|
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
|
|
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
|
-
})[
|
|
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,
|
|
772
|
-
const
|
|
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:
|
|
777
|
-
large:
|
|
778
|
-
}[
|
|
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
|
|
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
|
-
}[
|
|
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
|
|
804
|
-
const
|
|
805
|
-
typeof
|
|
833
|
+
if (typeof v == "function") return t();
|
|
834
|
+
const e = () => {
|
|
835
|
+
typeof v == "function" ? t() : requestAnimationFrame(e);
|
|
806
836
|
};
|
|
807
|
-
|
|
837
|
+
e();
|
|
808
838
|
});
|
|
809
839
|
}
|
|
810
840
|
}
|
|
811
|
-
customElements.get("mui-link") || customElements.define("mui-link",
|
|
841
|
+
customElements.get("mui-link") || customElements.define("mui-link", h);
|
|
@@ -1,42 +1,61 @@
|
|
|
1
|
-
class
|
|
1
|
+
class a extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
|
-
super(), this.slotEl = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null;
|
|
4
|
-
const
|
|
3
|
+
super(), this.slotEl = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null, this.cleanup = null;
|
|
4
|
+
const t = this.attachShadow({ mode: "open" }), s = (
|
|
5
5
|
/*css*/
|
|
6
6
|
`
|
|
7
7
|
:host { display: block; }
|
|
8
8
|
`
|
|
9
9
|
);
|
|
10
|
-
|
|
10
|
+
t.innerHTML = `
|
|
11
11
|
<style>${s}</style>
|
|
12
12
|
<slot></slot>
|
|
13
|
-
`, this.slotEl =
|
|
13
|
+
`, this.slotEl = t.querySelector("slot");
|
|
14
14
|
}
|
|
15
15
|
static get observedAttributes() {
|
|
16
16
|
return ["breakpoint", "breakpoint-low", "breakpoint-high"];
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
this.setupResponsive();
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
this.teardownResponsive();
|
|
23
|
+
}
|
|
24
|
+
attributeChangedCallback(t, s, l) {
|
|
25
|
+
s !== l && a.observedAttributes.includes(t) && this.setupResponsive();
|
|
26
|
+
}
|
|
27
|
+
teardownResponsive() {
|
|
28
|
+
var t;
|
|
29
|
+
(t = this.cleanup) == null || t.call(this), this.cleanup = null, this.mqlLow = null, this.mqlHigh = null, this.mqlSingle = null;
|
|
30
|
+
}
|
|
31
|
+
setupResponsive() {
|
|
32
|
+
const t = this.getAttribute("breakpoint"), s = this.getAttribute("breakpoint-low"), l = this.getAttribute("breakpoint-high");
|
|
33
|
+
if (this.teardownResponsive(), !!this.slotEl)
|
|
21
34
|
if (s && l) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
35
|
+
const n = parseInt(s), i = parseInt(l);
|
|
36
|
+
if (Number.isNaN(n) || Number.isNaN(i)) return;
|
|
37
|
+
this.mqlLow = window.matchMedia(`(max-width: ${n}px)`), this.mqlHigh = window.matchMedia(`(min-width: ${i}px)`);
|
|
38
|
+
const e = () => {
|
|
39
|
+
const o = this.mqlLow.matches, h = this.mqlHigh.matches, r = o ? "showBelow" : h ? "showAbove" : "showMiddle";
|
|
40
|
+
this.slotEl.setAttribute("name", r);
|
|
41
|
+
};
|
|
42
|
+
e(), this.mqlLow.addEventListener("change", e), this.mqlHigh.addEventListener("change", e), this.cleanup = () => {
|
|
43
|
+
var o, h;
|
|
44
|
+
(o = this.mqlLow) == null || o.removeEventListener("change", e), (h = this.mqlHigh) == null || h.removeEventListener("change", e);
|
|
45
|
+
};
|
|
46
|
+
} else if (t) {
|
|
47
|
+
const n = parseInt(t);
|
|
48
|
+
if (Number.isNaN(n)) return;
|
|
49
|
+
this.mqlSingle = window.matchMedia(`(max-width: ${n}px)`);
|
|
50
|
+
const i = () => {
|
|
51
|
+
this.slotEl.setAttribute("name", this.mqlSingle.matches ? "showBelow" : "showAbove");
|
|
27
52
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.mqlSingle = window.matchMedia(`(max-width: ${o}px)`);
|
|
32
|
-
const i = (t) => {
|
|
33
|
-
this.slotEl.setAttribute("name", t ? "showBelow" : "showAbove");
|
|
53
|
+
i(), this.mqlSingle.addEventListener("change", i), this.cleanup = () => {
|
|
54
|
+
var e;
|
|
55
|
+
(e = this.mqlSingle) == null || e.removeEventListener("change", i);
|
|
34
56
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
57
|
+
} else
|
|
58
|
+
this.slotEl.removeAttribute("name");
|
|
40
59
|
}
|
|
41
60
|
}
|
|
42
|
-
customElements.get("mui-responsive") || customElements.define("mui-responsive",
|
|
61
|
+
customElements.get("mui-responsive") || customElements.define("mui-responsive", a);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* ================================================================================================== */
|
|
3
|
-
/* Don't edit directly • Generated on Mon,
|
|
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);
|