@muibook/components 9.0.0 → 10.0.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/keywords/index.js +2 -2
- package/dist/esm/agent/prompts/index.js +855 -3
- package/dist/esm/components/mui-accordion/block/index.js +6 -6
- package/dist/esm/components/mui-alert/index.js +43 -40
- package/dist/esm/components/mui-badge/index.js +15 -7
- package/dist/esm/components/mui-body/index.js +8 -0
- package/dist/esm/components/mui-button/index.js +86 -82
- package/dist/esm/components/mui-card/body/index.js +31 -31
- package/dist/esm/components/mui-card/card/index.js +6 -6
- package/dist/esm/components/mui-card/footer/index.js +10 -10
- package/dist/esm/components/mui-carousel/controller/index.js +75 -9
- package/dist/esm/components/mui-chip/index.js +40 -31
- package/dist/esm/components/mui-dropdown/index.js +45 -44
- package/dist/esm/components/mui-icons/ai/index.js +58 -0
- package/dist/esm/components/mui-icons/index.js +8 -0
- package/dist/esm/components/mui-icons/pin/index.js +53 -0
- package/dist/esm/components/mui-icons/pin-slash/index.js +53 -0
- package/dist/esm/components/mui-icons/rectangle/index.js +55 -0
- package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +58 -0
- package/dist/esm/components/mui-icons/rectangle-dashed/index.js +55 -0
- package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +55 -0
- package/dist/esm/components/mui-icons/rectangle-media-text/index.js +55 -0
- package/dist/esm/components/mui-input/index.js +20 -10
- package/dist/esm/components/mui-link/index.js +44 -44
- package/dist/esm/components/mui-select/index.js +9 -1
- package/dist/esm/components/mui-slat/slat/index.js +6 -6
- package/dist/esm/components/mui-smart-card/index.js +1 -0
- package/dist/esm/components/mui-switch/index.js +19 -19
- package/dist/esm/components/mui-table/cell/index.js +4 -4
- package/dist/esm/components/mui-tabs/item/index.js +9 -9
- package/dist/esm/components/mui-tabs/tab-bar/index.js +17 -16
- package/dist/esm/css/mui-brand.css +1 -1
- package/dist/esm/css/mui-tokens.css +6 -2
- package/dist/esm/custom-elements.json +986 -556
- package/dist/esm/index.js +12 -4
- package/dist/types/agent/prompts/index.d.ts +9 -0
- package/dist/types/components/mui-icons/ai.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +8 -0
- package/dist/types/components/mui-icons/pin-slash.d.ts +1 -0
- package/dist/types/components/mui-icons/pin.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-bottom-panel.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-dashed.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-left-drawer.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-media-text.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle.d.ts +1 -0
- package/dist/types/index.d.ts +8 -0
- package/package.json +29 -1
|
@@ -52,7 +52,7 @@ class u extends HTMLElement {
|
|
|
52
52
|
return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!((c = n.textContent) != null && c.trim());
|
|
53
53
|
}
|
|
54
54
|
), s = d(e), r = d(t);
|
|
55
|
-
this.
|
|
55
|
+
this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", r);
|
|
56
56
|
const i = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], v = i.length > 0 && i.every(
|
|
57
57
|
(l) => {
|
|
58
58
|
var n;
|
|
@@ -289,44 +289,44 @@ class u extends HTMLElement {
|
|
|
289
289
|
}
|
|
290
290
|
/* ===================================== */
|
|
291
291
|
|
|
292
|
-
:host(
|
|
292
|
+
:host([alert-positive-slot]) {
|
|
293
293
|
--alert-text: var(--feedback-positive-text);
|
|
294
294
|
--alert-icon: var(--feedback-positive-icon);
|
|
295
295
|
--alert-bg-hover: var(--feedback-positive-action-background);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
:host(
|
|
298
|
+
:host([alert-info-slot]) {
|
|
299
299
|
--alert-text: var(--feedback-info-text);
|
|
300
300
|
--alert-icon: var(--feedback-info-icon);
|
|
301
301
|
--alert-bg-hover: var(--feedback-info-action-background);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
:host(
|
|
304
|
+
:host([alert-warning-slot]) {
|
|
305
305
|
--alert-text: var(--feedback-warning-text);
|
|
306
306
|
--alert-icon: var(--feedback-warning-icon);
|
|
307
307
|
--alert-bg-hover: var(--feedback-warning-action-background);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
:host(
|
|
310
|
+
:host([alert-attention-slot]) {
|
|
311
311
|
--alert-text: var(--feedback-attention-text);
|
|
312
312
|
--alert-icon: var(--feedback-attention-icon);
|
|
313
313
|
--alert-bg-hover: var(--feedback-attention-action-background);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
:host(
|
|
316
|
+
:host([alert-slot]) a {
|
|
317
317
|
font-weight: var(--font-weight-semi-bold);
|
|
318
318
|
color: var(--alert-text);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
:host(
|
|
322
|
-
:host(
|
|
321
|
+
:host([alert-slot]) a:hover,
|
|
322
|
+
:host([alert-slot]) a:focus-visible {
|
|
323
323
|
background: var(--alert-bg-hover);
|
|
324
324
|
color: var(--alert-text);
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
:host(
|
|
328
|
-
:host(
|
|
329
|
-
:host(
|
|
327
|
+
:host([alert-slot]) ::slotted(.mui-icon),
|
|
328
|
+
:host([alert-slot]):hover ::slotted(.mui-icon),
|
|
329
|
+
:host([alert-slot]):focus-visible ::slotted(.mui-icon) {
|
|
330
330
|
fill: var(--alert-icon);
|
|
331
331
|
}
|
|
332
332
|
|
|
@@ -380,39 +380,39 @@ class u extends HTMLElement {
|
|
|
380
380
|
|
|
381
381
|
/* Before & After Icon
|
|
382
382
|
========================================= */
|
|
383
|
-
:host(
|
|
384
|
-
:host(
|
|
385
|
-
:host(
|
|
383
|
+
:host([has-after]) a,
|
|
384
|
+
:host([has-before]) a,
|
|
385
|
+
:host([has-after][has-before]) a {
|
|
386
386
|
display: grid;
|
|
387
387
|
align-items: center;
|
|
388
388
|
gap: var(--space-100);
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
:host(
|
|
391
|
+
:host([has-after][has-before]) a {
|
|
392
392
|
grid-template-columns: auto 1fr auto;
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
:host(
|
|
395
|
+
:host([has-after]) a {
|
|
396
396
|
grid-template-columns: 1fr auto;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
-
:host(
|
|
399
|
+
:host([has-before]) a {
|
|
400
400
|
grid-template-columns: auto 1fr;
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
:host(
|
|
404
|
-
:host(
|
|
403
|
+
:host([has-after][has-before][variant]:not([variant="default"])) a,
|
|
404
|
+
:host([has-after][has-before][usage="input"]) a {
|
|
405
405
|
padding-right: var(--action-after-slot-padding);
|
|
406
406
|
padding-left: var(--action-before-slot-padding);
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
:host(
|
|
410
|
-
:host(
|
|
409
|
+
:host([has-after][variant]:not([variant="default"])) a,
|
|
410
|
+
:host([has-after][usage="input"]) a {
|
|
411
411
|
padding-right: var(--action-after-slot-padding);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
:host(
|
|
415
|
-
:host(
|
|
414
|
+
:host([has-before][variant]:not([variant="default"])) a,
|
|
415
|
+
:host([has-before][usage="input"]) a {
|
|
416
416
|
padding-left: var(--action-before-slot-padding);
|
|
417
417
|
}
|
|
418
418
|
|
|
@@ -547,76 +547,76 @@ class u extends HTMLElement {
|
|
|
547
547
|
}
|
|
548
548
|
|
|
549
549
|
/* Before & After Icon padding adjustments for x-small */
|
|
550
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
551
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
552
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
550
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-after]) a,
|
|
551
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-before]) a,
|
|
552
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
553
553
|
gap: var(--space-025);
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
556
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
557
557
|
padding-right: var(--action-after-slot-padding-x-small);
|
|
558
558
|
padding-left: var(--action-before-slot-padding-x-small);
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
561
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-after]) a {
|
|
562
562
|
padding-right: var(--action-after-slot-padding-x-small);
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
:host([size="x-small"][variant]:not([variant="default"])
|
|
565
|
+
:host([size="x-small"][variant]:not([variant="default"])[has-before]) a {
|
|
566
566
|
padding-left: var(--action-before-slot-padding-x-small);
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
/* Before & After Icon padding adjustments for small */
|
|
570
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
571
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
572
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
570
|
+
:host([size="small"][variant]:not([variant="default"])[has-after]) a,
|
|
571
|
+
:host([size="small"][variant]:not([variant="default"])[has-before]) a,
|
|
572
|
+
:host([size="small"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
573
573
|
gap: var(--space-050);
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
576
|
+
:host([size="small"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
577
577
|
padding-right: var(--action-after-slot-padding-small);
|
|
578
578
|
padding-left: var(--action-before-slot-padding-small);
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
581
|
+
:host([size="small"][variant]:not([variant="default"])[has-after]) a {
|
|
582
582
|
padding-right: var(--action-after-slot-padding-small);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
-
:host([size="small"][variant]:not([variant="default"])
|
|
585
|
+
:host([size="small"][variant]:not([variant="default"])[has-before]) a {
|
|
586
586
|
padding-left: var(--action-before-slot-padding-small);
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
/* Before & After Icon padding adjustments for medium */
|
|
590
|
-
:host([size="medium"][variant]:not([variant="default"])
|
|
590
|
+
:host([size="medium"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
591
591
|
padding-right: var(--action-after-slot-padding);
|
|
592
592
|
padding-left: var(--action-before-slot-padding);
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
-
:host([size="medium"][variant]:not([variant="default"])
|
|
595
|
+
:host([size="medium"][variant]:not([variant="default"])[has-after]) a {
|
|
596
596
|
padding-right: var(--action-after-slot-padding);
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
:host([size="medium"][variant]:not([variant="default"])
|
|
599
|
+
:host([size="medium"][variant]:not([variant="default"])[has-before]) a {
|
|
600
600
|
padding-left: var(--action-before-slot-padding);
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
/* Before & After Icon padding adjustments for large */
|
|
604
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
605
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
606
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
604
|
+
:host([size="large"][variant]:not([variant="default"])[has-after]) a,
|
|
605
|
+
:host([size="large"][variant]:not([variant="default"])[has-before]) a,
|
|
606
|
+
:host([size="large"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
607
607
|
gap: var(--space-200);
|
|
608
608
|
}
|
|
609
609
|
|
|
610
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
610
|
+
:host([size="large"][variant]:not([variant="default"])[has-after][has-before]) a {
|
|
611
611
|
padding-right: var(--action-after-slot-padding-large);
|
|
612
612
|
padding-left: var(--action-before-slot-padding-large);
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
615
|
+
:host([size="large"][variant]:not([variant="default"])[has-after]) a {
|
|
616
616
|
padding-right: var(--action-after-slot-padding-large);
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
:host([size="large"][variant]:not([variant="default"])
|
|
619
|
+
:host([size="large"][variant]:not([variant="default"])[has-before]) a {
|
|
620
620
|
padding-left: var(--action-before-slot-padding-large);
|
|
621
621
|
}
|
|
622
622
|
|
|
@@ -16,7 +16,15 @@ class p extends HTMLElement {
|
|
|
16
16
|
attributeChangedCallback(e, r, t) {
|
|
17
17
|
if (!this.shadowRoot || r === t) return;
|
|
18
18
|
const o = this.shadowRoot.querySelector("select");
|
|
19
|
-
|
|
19
|
+
if (e === "value" && o) {
|
|
20
|
+
o.value = t || "";
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (e === "disabled" && o) {
|
|
24
|
+
t === null || t === "false" ? o.removeAttribute("disabled") : o.setAttribute("disabled", "");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
["options", "label", "hide-label", "variant"].includes(e) && (this.render(), this.setupListener());
|
|
20
28
|
}
|
|
21
29
|
cleanupListeners() {
|
|
22
30
|
var r;
|
|
@@ -103,16 +103,16 @@ class i extends HTMLElement {
|
|
|
103
103
|
text-align: right;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
:host(
|
|
106
|
+
:host([card-slot]) {
|
|
107
107
|
--slat-background: var(--slat-card-background);
|
|
108
108
|
--slat-background-hover: var(--slat-card-background-hover);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
:host(
|
|
111
|
+
:host([condensed-slot]) .action::part(border-radius) {
|
|
112
112
|
border-radius: 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
:host(
|
|
115
|
+
:host([condensed-slot]:last-of-type) .action::part(border-radius) {
|
|
116
116
|
border-bottom-left-radius: var(--card-radius);
|
|
117
117
|
border-bottom-right-radius: var(--card-radius);
|
|
118
118
|
}
|
|
@@ -125,11 +125,11 @@ class i extends HTMLElement {
|
|
|
125
125
|
--avatar-background-override: var(--slat-avatar-background-hover);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
:host(
|
|
128
|
+
:host([card-slot]) ::slotted(mui-avatar) {
|
|
129
129
|
--avatar-background-override: var(--slat-card-avatar-background);
|
|
130
130
|
}
|
|
131
|
-
:host(
|
|
132
|
-
:host(
|
|
131
|
+
:host([card-slot]) .action:hover ::slotted(mui-avatar),
|
|
132
|
+
:host([card-slot]) .action:focus ::slotted(mui-avatar) {
|
|
133
133
|
--avatar-background-override: var(--slat-card-avatar-background-hover);
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -11,25 +11,25 @@ class o extends HTMLElement {
|
|
|
11
11
|
static get observedAttributes() {
|
|
12
12
|
return ["label", "disabled", "checked"];
|
|
13
13
|
}
|
|
14
|
-
attributeChangedCallback(
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
this._checkbox && (this._checkbox.disabled =
|
|
14
|
+
attributeChangedCallback(i, e, t) {
|
|
15
|
+
if (i === "checked" && e !== t && (this._checked = t !== null, this._checkbox && (this._checkbox.checked = this._checked, this._updateIcons())), i === "disabled" && e !== t) {
|
|
16
|
+
const s = t !== null;
|
|
17
|
+
this._checkbox && (this._checkbox.disabled = s, this._checkbox.setAttribute("aria-disabled", s.toString())), this._updateDisabledState();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
get checked() {
|
|
21
21
|
return this._checked;
|
|
22
22
|
}
|
|
23
|
-
set checked(
|
|
24
|
-
const e = !!
|
|
23
|
+
set checked(i) {
|
|
24
|
+
const e = !!i;
|
|
25
25
|
this._checked !== e && (this._checked = e, e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checkbox && (this._checkbox.checked = this._checked, this._checkbox.setAttribute("aria-checked", this._checked.toString()), this._updateIcons()));
|
|
26
26
|
}
|
|
27
27
|
_cleanupListeners() {
|
|
28
28
|
this._checkbox && this._changeHandler && this._checkbox.removeEventListener("change", this._changeHandler);
|
|
29
29
|
}
|
|
30
30
|
_updateDisabledState() {
|
|
31
|
-
var e, t,
|
|
32
|
-
this.hasAttribute("disabled") ? (
|
|
31
|
+
var e, t, s, c;
|
|
32
|
+
this.hasAttribute("disabled") ? ((e = this._checkbox) == null || e.setAttribute("aria-disabled", "true"), (t = this._checkbox) == null || t.setAttribute("tabindex", "-1")) : ((s = this._checkbox) == null || s.removeAttribute("aria-disabled"), (c = this._checkbox) == null || c.removeAttribute("tabindex"));
|
|
33
33
|
}
|
|
34
34
|
_setupListener() {
|
|
35
35
|
this._checkbox && (this._cleanupListeners(), this._changeHandler = () => {
|
|
@@ -43,27 +43,27 @@ class o extends HTMLElement {
|
|
|
43
43
|
}, this._checkbox.addEventListener("change", this._changeHandler));
|
|
44
44
|
}
|
|
45
45
|
_enforceIconSize() {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
46
|
+
const i = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]'), t = (s) => {
|
|
47
|
+
if (!s) return;
|
|
48
48
|
const c = () => {
|
|
49
|
-
|
|
49
|
+
s.assignedElements().forEach((h) => {
|
|
50
50
|
h.tagName.toLowerCase().startsWith("mui-icon") && h.setAttribute("size", "x-small");
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
s.addEventListener("slotchange", c), setTimeout(c, 0);
|
|
54
54
|
};
|
|
55
|
-
t(
|
|
55
|
+
t(i), t(e);
|
|
56
56
|
}
|
|
57
57
|
_updateIcons() {
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const i = this.shadowRoot.querySelector('slot[name="on-icon"]'), e = this.shadowRoot.querySelector('slot[name="off-icon"]');
|
|
59
|
+
i && i.assignedElements().forEach((t) => {
|
|
60
60
|
t.style.display = this._checked ? "inline" : "none";
|
|
61
61
|
}), e && e.assignedElements().forEach((t) => {
|
|
62
62
|
t.style.display = this._checked ? "none" : "inline";
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
|
-
const
|
|
66
|
+
const i = this.getAttribute("label");
|
|
67
67
|
this.shadowRoot.innerHTML = /*html*/
|
|
68
68
|
`
|
|
69
69
|
<style>
|
|
@@ -125,11 +125,11 @@ class o extends HTMLElement {
|
|
|
125
125
|
fill: var(--switch-icon);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
:host(
|
|
128
|
+
:host([disabled]) {
|
|
129
129
|
cursor: not-allowed;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
:host(
|
|
132
|
+
:host([disabled]) .switch {
|
|
133
133
|
opacity: 0.4;
|
|
134
134
|
pointer-events: none;
|
|
135
135
|
}
|
|
@@ -140,7 +140,7 @@ class o extends HTMLElement {
|
|
|
140
140
|
type="checkbox"
|
|
141
141
|
role="switch"
|
|
142
142
|
aria-checked="${this._checked}"
|
|
143
|
-
${
|
|
143
|
+
${i ? `aria-label="${i}"` : ""}
|
|
144
144
|
>
|
|
145
145
|
<span class="track">
|
|
146
146
|
<span class="thumb">
|
|
@@ -30,10 +30,10 @@ class t extends HTMLElement {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/* Card Slot (Supports: Table Cell, Accordion Block) */
|
|
33
|
-
:host(
|
|
33
|
+
:host([card-slot]:first-of-type) {
|
|
34
34
|
padding-left: var(--space-500);
|
|
35
35
|
}
|
|
36
|
-
:host(
|
|
36
|
+
:host([card-slot]:last-of-type) {
|
|
37
37
|
padding-right: var(--space-500);
|
|
38
38
|
}
|
|
39
39
|
@media (min-width: 768px) {
|
|
@@ -43,10 +43,10 @@ class t extends HTMLElement {
|
|
|
43
43
|
:host(*:last-of-type) {
|
|
44
44
|
padding-right: var(--space-600);
|
|
45
45
|
}
|
|
46
|
-
:host(
|
|
46
|
+
:host([card-slot]:first-of-type) {
|
|
47
47
|
padding-left: var(--space-600);
|
|
48
48
|
}
|
|
49
|
-
:host(
|
|
49
|
+
:host([card-slot]:last-of-type) {
|
|
50
50
|
padding-right: var(--space-600);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class s extends HTMLElement {
|
|
2
2
|
updateIcon(t) {
|
|
3
3
|
if (this.shadowRoot && (this.iconEl && (this.shadowRoot.removeChild(this.iconEl), this.iconEl = void 0), t && t.trim() !== "" && customElements.get(t))) {
|
|
4
4
|
const e = document.createElement(t);
|
|
@@ -11,8 +11,8 @@ class o extends HTMLElement {
|
|
|
11
11
|
static get observedAttributes() {
|
|
12
12
|
return ["active", "icon"];
|
|
13
13
|
}
|
|
14
|
-
attributeChangedCallback(t, e,
|
|
15
|
-
t === "active" ? this.updateActiveState() : t === "icon" && this.updateIcon(
|
|
14
|
+
attributeChangedCallback(t, e, o) {
|
|
15
|
+
t === "active" ? this.updateActiveState() : t === "icon" && this.updateIcon(o);
|
|
16
16
|
}
|
|
17
17
|
connectedCallback() {
|
|
18
18
|
if (!this.shadowRoot) return;
|
|
@@ -40,11 +40,11 @@ class o extends HTMLElement {
|
|
|
40
40
|
border-radius: calc(var(--tab-radius) - 0.2rem);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
:host(
|
|
43
|
+
:host([active]) {
|
|
44
44
|
color: var(--tab-text-color-active);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
:host(
|
|
47
|
+
:host([active]:focus-visible) {
|
|
48
48
|
outline: var(--outline-thick);
|
|
49
49
|
outline-offset: -5px;
|
|
50
50
|
}
|
|
@@ -56,12 +56,12 @@ class o extends HTMLElement {
|
|
|
56
56
|
const i = document.createElement(t);
|
|
57
57
|
i.setAttribute("color", "var(--tab-icon)"), i.setAttribute("size", "small"), this.shadowRoot.appendChild(i), this.iconEl = i;
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
this.shadowRoot.appendChild(
|
|
59
|
+
const o = document.createElement("slot");
|
|
60
|
+
this.shadowRoot.appendChild(o), this.updateActiveState();
|
|
61
61
|
}
|
|
62
62
|
updateActiveState() {
|
|
63
63
|
const t = this.hasAttribute("active");
|
|
64
|
-
this.
|
|
64
|
+
this.setAttribute("role", "tab"), this.setAttribute("aria-selected", t ? "true" : "false"), this.setAttribute("tabindex", t ? "0" : "-1"), this.iconEl && this.iconEl.setAttribute("color", t ? "var(--tab-icon-active)" : "var(--tab-icon)");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
customElements.get("mui-tab-item") || customElements.define("mui-tab-item",
|
|
67
|
+
customElements.get("mui-tab-item") || customElements.define("mui-tab-item", s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class l extends HTMLElement {
|
|
2
2
|
constructor() {
|
|
3
3
|
super(), this._animationSpeed = 200, this.attachShadow({ mode: "open" }), this._handleResize = this._handleResize.bind(this), this._hasInitialized = !1, this._resizeTimeout = null, this._observedTab = null, this._activeTab = null, this._resizeObserver = new ResizeObserver(() => {
|
|
4
4
|
this._activeTab && this._updateHighlight(this._activeTab);
|
|
@@ -8,23 +8,23 @@ class c extends HTMLElement {
|
|
|
8
8
|
const i = this.getAttribute("speed") || "200";
|
|
9
9
|
this._animationSpeed = parseInt(i, 10);
|
|
10
10
|
const s = Array.from(this.children);
|
|
11
|
-
this.
|
|
12
|
-
const
|
|
13
|
-
this.setAttribute("aria-orientation",
|
|
14
|
-
const t = Array.from(this.children), r = t.findIndex((
|
|
11
|
+
this.setAttribute("role", "tablist");
|
|
12
|
+
const a = this.getAttribute("orientation") || "horizontal";
|
|
13
|
+
this.setAttribute("aria-orientation", a), this.addEventListener("keydown", (e) => {
|
|
14
|
+
const t = Array.from(this.children), r = t.findIndex((d) => d.hasAttribute("active")), n = this.getAttribute("aria-orientation") || "horizontal";
|
|
15
15
|
let o = r;
|
|
16
16
|
switch (e.key) {
|
|
17
17
|
case "ArrowRight":
|
|
18
|
-
|
|
18
|
+
n === "horizontal" && (o = (r + 1) % t.length, e.preventDefault());
|
|
19
19
|
break;
|
|
20
20
|
case "ArrowLeft":
|
|
21
|
-
|
|
21
|
+
n === "horizontal" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
|
|
22
22
|
break;
|
|
23
23
|
case "ArrowDown":
|
|
24
|
-
|
|
24
|
+
n === "vertical" && (o = (r + 1) % t.length, e.preventDefault());
|
|
25
25
|
break;
|
|
26
26
|
case "ArrowUp":
|
|
27
|
-
|
|
27
|
+
n === "vertical" && (o = (r - 1 + t.length) % t.length, e.preventDefault());
|
|
28
28
|
break;
|
|
29
29
|
case "Home":
|
|
30
30
|
o = 0, e.preventDefault();
|
|
@@ -35,8 +35,8 @@ class c extends HTMLElement {
|
|
|
35
35
|
default:
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const h = t[o];
|
|
39
|
+
h && (this.setActiveTab(h), h.focus());
|
|
40
40
|
}), s.forEach((e, t) => {
|
|
41
41
|
e.classList.remove("first", "middle", "last", "only"), s.length === 1 ? e.classList.add("only") : t === 0 ? e.classList.add("first") : t === s.length - 1 ? e.classList.add("last") : e.classList.add("middle");
|
|
42
42
|
}), s.forEach((e) => {
|
|
@@ -61,7 +61,7 @@ class c extends HTMLElement {
|
|
|
61
61
|
overflow: hidden;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
:host(
|
|
64
|
+
:host([full-width]) {
|
|
65
65
|
display: flex;
|
|
66
66
|
width: 100%;
|
|
67
67
|
}
|
|
@@ -78,7 +78,7 @@ class c extends HTMLElement {
|
|
|
78
78
|
box-sizing: border-box;
|
|
79
79
|
box-shadow: 0 0 4px 4px var(--tab-shadow-active);
|
|
80
80
|
will-change: transform, width;
|
|
81
|
-
transform: translateX(0);
|
|
81
|
+
transform: translateX(0) translateZ(0);
|
|
82
82
|
width: 0;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -87,6 +87,7 @@ class c extends HTMLElement {
|
|
|
87
87
|
z-index: 1;
|
|
88
88
|
flex: 1;
|
|
89
89
|
contain: content; /* Performance optimization */
|
|
90
|
+
transform: translateZ(0);
|
|
90
91
|
}
|
|
91
92
|
</style>
|
|
92
93
|
<div class="highlight"></div>
|
|
@@ -114,8 +115,8 @@ class c extends HTMLElement {
|
|
|
114
115
|
}, 100));
|
|
115
116
|
}
|
|
116
117
|
_updateHighlight(i) {
|
|
117
|
-
const s = this.shadowRoot.querySelector(".highlight"), a = i.getBoundingClientRect(),
|
|
118
|
-
s.style.transform = `translateX(${
|
|
118
|
+
const s = this.shadowRoot.querySelector(".highlight"), a = i.getBoundingClientRect(), e = this.getBoundingClientRect(), t = parseFloat(getComputedStyle(this).borderWidth) || 0, r = a.left - e.left - t;
|
|
119
|
+
s.style.transform = `translateX(${r}px) translateZ(0)`, s.style.width = `${a.width}px`;
|
|
119
120
|
}
|
|
120
121
|
setActiveTab(i) {
|
|
121
122
|
if (Array.from(this.children).forEach((a) => a.removeAttribute("active")), i.setAttribute("active", ""), this._activeTab = i, this._observedTab && this._observedTab !== i && this._resizeObserver.unobserve(this._observedTab), this._observedTab = i, this._resizeObserver.observe(i), this._hasInitialized)
|
|
@@ -133,4 +134,4 @@ class c extends HTMLElement {
|
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
customElements.get("mui-tab-bar") || customElements.define("mui-tab-bar",
|
|
137
|
+
customElements.get("mui-tab-bar") || customElements.define("mui-tab-bar", l);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* ================================================================================================== */
|
|
3
|
-
/* Don't edit directly • Generated on Wed,
|
|
3
|
+
/* Don't edit directly • Generated on Wed, 04 Feb 2026 04:53:47 GMT • muibook.com */
|
|
4
4
|
/* ================================================================================================== */
|
|
5
5
|
|
|
6
6
|
/* ================================================================================================== */
|
|
@@ -169,7 +169,7 @@ html[data-theme="light"] {
|
|
|
169
169
|
--text-color-success: var(--green-600);
|
|
170
170
|
--text-color-warning: var(--orange-600);
|
|
171
171
|
--text-color-error: var(--red-600);
|
|
172
|
-
--text-color-optional: var(--grey-
|
|
172
|
+
--text-color-optional: var(--grey-500);
|
|
173
173
|
/* Overlay */
|
|
174
174
|
--backdrop-overlay: var(--black-opacity-70);
|
|
175
175
|
/* ================================================================================================== */
|
|
@@ -426,7 +426,7 @@ html[data-theme="dark"] {
|
|
|
426
426
|
--text-color-success: var(--green-400);
|
|
427
427
|
--text-color-warning: var(--orange-400);
|
|
428
428
|
--text-color-error: var(--red-400);
|
|
429
|
-
--text-color-optional: var(--grey-
|
|
429
|
+
--text-color-optional: var(--grey-400);
|
|
430
430
|
/* Overlay */
|
|
431
431
|
--backdrop-overlay: var(--black-opacity-70);
|
|
432
432
|
/* ================================================================================================== */
|
|
@@ -555,6 +555,10 @@ html[data-theme="dark"] {
|
|
|
555
555
|
/* 4. SET THE FOUNDATION */
|
|
556
556
|
/* ==================================================================================================== */
|
|
557
557
|
:where(html) {
|
|
558
|
+
/* Dropdown */
|
|
559
|
+
--dropdown-offset: var(--space-200);
|
|
560
|
+
--dropdown-min-width: 15rem;
|
|
561
|
+
|
|
558
562
|
/* Feedback - Border (Alerts & Messages) */
|
|
559
563
|
--feedback-neutral-border: var(--stroke-size-200) var(--stroke-solid) var(--feedback-neutral-border-color);
|
|
560
564
|
--feedback-positive-border: var(--stroke-size-200) var(--stroke-solid) var(--feedback-positive-border-color);
|