@muibook/components 19.6.0 → 20.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/README.md +1 -1
- package/dist/esm/agent/keywords/index.js +32 -1
- package/dist/esm/agent/prompts/index.js +10 -8
- package/dist/esm/components/mui-addon/index.js +14 -14
- package/dist/esm/components/mui-avatar/index.js +4 -1
- package/dist/esm/components/mui-badge/index.js +35 -18
- package/dist/esm/components/mui-button/index.js +187 -52
- package/dist/esm/components/mui-card/body/index.js +1 -1
- package/dist/esm/components/mui-chip/index.js +56 -26
- package/dist/esm/components/mui-chip-rail/index.js +239 -0
- package/dist/esm/components/mui-code/index.js +5 -5
- package/dist/esm/components/mui-dropdown/index.js +55 -46
- package/dist/esm/components/mui-file-upload/index.js +1 -0
- package/dist/esm/components/mui-heading/index.js +3 -2
- package/dist/esm/components/mui-input/index.js +21 -17
- package/dist/esm/components/mui-link/index.js +199 -55
- package/dist/esm/components/mui-message/index.js +7 -6
- package/dist/esm/components/mui-prompt/index.js +102 -102
- package/dist/esm/components/mui-select/index.js +4 -4
- package/dist/esm/components/mui-stack/hstack/index.js +10 -5
- package/dist/esm/components/mui-status/index.js +239 -0
- package/dist/esm/components/mui-stepper/step/index.js +46 -32
- package/dist/esm/components/mui-switch/index.js +21 -13
- package/dist/esm/components/mui-tabs/controller/index.js +17 -6
- package/dist/esm/components/mui-tabs/item/index.js +17 -5
- package/dist/esm/components/mui-tabs/tab-bar/index.js +93 -39
- package/dist/esm/components/mui-video-thumbnail/index.js +205 -0
- package/dist/esm/css/mui-brand.css +1 -1
- package/dist/esm/css/mui-tokens.css +267 -77
- package/dist/esm/custom-elements.json +2212 -1538
- package/dist/esm/dynamic-attrs.json +26 -6
- package/dist/esm/index.js +7 -4
- package/dist/types/components/mui-button/api.d.ts +4 -0
- package/dist/types/components/mui-chip/api.d.ts +4 -0
- package/dist/types/components/mui-chip-rail/api.d.ts +21 -0
- package/dist/types/components/mui-chip-rail/doc.d.ts +2 -0
- package/dist/types/components/mui-chip-rail/index.d.ts +3 -0
- package/dist/types/components/mui-link/api.d.ts +4 -0
- package/dist/types/components/mui-status/api.d.ts +24 -0
- package/dist/types/components/mui-status/doc.d.ts +2 -0
- package/dist/types/components/mui-status/index.d.ts +1 -0
- package/dist/types/components/mui-video-thumbnail/api.d.ts +28 -0
- package/dist/types/components/mui-video-thumbnail/doc.d.ts +2 -0
- package/dist/types/components/mui-video-thumbnail/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +13 -1
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
import { getPartMap as v } from "../../utils/part-map/index.js";
|
|
2
|
-
class
|
|
2
|
+
class g extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
|
-
return [
|
|
4
|
+
return [
|
|
5
|
+
"target",
|
|
6
|
+
"href",
|
|
7
|
+
"variant",
|
|
8
|
+
"disabled",
|
|
9
|
+
"weight",
|
|
10
|
+
"stroke",
|
|
11
|
+
"stroke-ring-size",
|
|
12
|
+
"focus-ring",
|
|
13
|
+
"size",
|
|
14
|
+
"download",
|
|
15
|
+
"usage"
|
|
16
|
+
];
|
|
5
17
|
}
|
|
6
18
|
constructor() {
|
|
7
19
|
super(), this.attachShadow({ mode: "open" });
|
|
8
20
|
}
|
|
9
21
|
async connectedCallback() {
|
|
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());
|
|
22
|
+
this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("weight") || this.setAttribute("weight", "regular"), this.hasAttribute("variant") || this.setAttribute("variant", "default"), this.syncRingSizeAttribute(), await this.waitForPartMap(), this.render(), requestAnimationFrame(() => this.updateSlotState());
|
|
11
23
|
}
|
|
12
|
-
attributeChangedCallback(t,
|
|
24
|
+
attributeChangedCallback(t, o, r) {
|
|
13
25
|
if (this.shadowRoot) {
|
|
14
26
|
if (t === "href") {
|
|
15
27
|
const a = this.shadowRoot.querySelector("a");
|
|
16
|
-
a && a.setAttribute("href",
|
|
28
|
+
a && a.setAttribute("href", r || "#");
|
|
17
29
|
}
|
|
18
30
|
if (t === "target") {
|
|
19
31
|
const a = this.shadowRoot.querySelector("a");
|
|
20
|
-
a && a.setAttribute("target",
|
|
32
|
+
a && a.setAttribute("target", r || "_self");
|
|
21
33
|
}
|
|
22
34
|
if (t === "disabled") {
|
|
23
35
|
const a = this.shadowRoot.querySelector("a");
|
|
24
|
-
a && (
|
|
36
|
+
a && (r !== null ? (a.setAttribute("aria-disabled", "true"), a.setAttribute("href", "javascript:void(0)")) : (a.setAttribute("aria-disabled", "false"), a.setAttribute("href", this.getAttribute("href") || "#")));
|
|
25
37
|
}
|
|
26
38
|
if (t === "download") {
|
|
27
39
|
const a = this.shadowRoot.querySelector("a");
|
|
28
40
|
if (!a) return;
|
|
29
|
-
|
|
41
|
+
r !== null ? a.setAttribute("download", r === "" ? "" : r) : a.removeAttribute("download");
|
|
30
42
|
}
|
|
31
|
-
t === "size" &&
|
|
43
|
+
t === "size" && o !== r && this.shadowRoot && requestAnimationFrame(() => {
|
|
32
44
|
const a = this.shadowRoot;
|
|
33
45
|
if (!a) return;
|
|
34
46
|
const n = [
|
|
@@ -38,30 +50,42 @@ class h extends HTMLElement {
|
|
|
38
50
|
], s = this.hasAttribute("icon-only");
|
|
39
51
|
n.forEach((i) => {
|
|
40
52
|
if (i) {
|
|
41
|
-
const
|
|
42
|
-
this.updateIconSizes(
|
|
53
|
+
const e = i.assignedNodes({ flatten: !0 });
|
|
54
|
+
this.updateIconSizes(e, s), this.updateAvatarSizes(e), this.updateBadgeSizes(e);
|
|
43
55
|
}
|
|
44
56
|
});
|
|
45
|
-
});
|
|
57
|
+
}), t === "stroke-ring-size" && o !== r && this.syncRingSizeAttribute();
|
|
46
58
|
}
|
|
47
59
|
}
|
|
60
|
+
syncRingSizeAttribute() {
|
|
61
|
+
var a;
|
|
62
|
+
const t = (a = this.getAttribute("stroke-ring-size")) == null ? void 0 : a.trim();
|
|
63
|
+
if (!t) {
|
|
64
|
+
this.style.removeProperty("--action-ring-size");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const o = t.startsWith("stroke-size-") ? t.replace("stroke-size-", "") : t, r = /^(100|200|300|400|500)$/.test(o);
|
|
68
|
+
this.style.setProperty("--action-ring-size", r ? `var(--stroke-size-${o})` : t);
|
|
69
|
+
}
|
|
48
70
|
updateSlotState() {
|
|
49
|
-
const t = this.shadowRoot,
|
|
50
|
-
(
|
|
71
|
+
const t = this.shadowRoot, o = t.querySelector("slot:not([name])"), r = t.querySelector('slot[name="before"]'), a = t.querySelector('slot[name="after"]'), n = (l) => !!l && l.assignedNodes({ flatten: !0 }).some(
|
|
72
|
+
(d) => {
|
|
51
73
|
var c;
|
|
52
|
-
return
|
|
74
|
+
return d.nodeType === Node.ELEMENT_NODE || d.nodeType === Node.TEXT_NODE && !!((c = d.textContent) != null && c.trim());
|
|
53
75
|
}
|
|
54
|
-
), s = n(
|
|
76
|
+
), s = n(r), i = n(a);
|
|
55
77
|
this.toggleAttribute("has-before", s), this.toggleAttribute("has-after", i);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
78
|
+
const e = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], h = ((o == null ? void 0 : o.assignedElements({ flatten: !0 })) ?? []).some((l) => l.tagName.toLowerCase() === "mui-video-thumbnail");
|
|
79
|
+
this.toggleAttribute("has-video", h);
|
|
80
|
+
const f = !h && e.length > 0 && e.every(
|
|
81
|
+
(l) => {
|
|
82
|
+
var d;
|
|
83
|
+
return l.nodeType === Node.ELEMENT_NODE ? l.classList.contains("mui-icon") || l.tagName.toLowerCase() === "svg" : !((d = l.textContent) != null && d.trim());
|
|
60
84
|
}
|
|
61
85
|
);
|
|
62
|
-
this.toggleAttribute("icon-only",
|
|
63
|
-
if (
|
|
64
|
-
const c =
|
|
86
|
+
this.toggleAttribute("icon-only", f), f ? this.updateIconSizes(e, !0) : [r, o, a].forEach((d) => {
|
|
87
|
+
if (d) {
|
|
88
|
+
const c = d.assignedNodes({ flatten: !0 });
|
|
65
89
|
this.updateIconSizes(c, !1), this.updateAvatarSizes(c), this.updateBadgeSizes(c);
|
|
66
90
|
}
|
|
67
91
|
});
|
|
@@ -73,7 +97,14 @@ class h extends HTMLElement {
|
|
|
73
97
|
`
|
|
74
98
|
<style>
|
|
75
99
|
|
|
76
|
-
:host {
|
|
100
|
+
:host {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
width: auto;
|
|
103
|
+
text-align: initial;
|
|
104
|
+
--action-focus-outline: var(--stroke-size-400) var(--stroke-outset) var(--outline-color);
|
|
105
|
+
--action-focus-outline-inset-offset: var(--stroke-size-400);
|
|
106
|
+
--action-focus-outline-offset: calc(-1 * var(--action-focus-outline-inset-offset));
|
|
107
|
+
}
|
|
77
108
|
|
|
78
109
|
a {
|
|
79
110
|
color: var(--link-text-color-default);
|
|
@@ -86,6 +117,7 @@ class h extends HTMLElement {
|
|
|
86
117
|
text-decoration-color: color-mix(in srgb, var(--text-color) 50%, transparent);
|
|
87
118
|
width: inherit;
|
|
88
119
|
display: inherit;
|
|
120
|
+
border-radius: var(--link-focus-radius, var(--radius-200));
|
|
89
121
|
}
|
|
90
122
|
|
|
91
123
|
/* Turned back on for focus-visible */
|
|
@@ -94,7 +126,10 @@ class h extends HTMLElement {
|
|
|
94
126
|
a:focus { color: var(--link-text-color-default-focus); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-focus) 80%, transparent); }
|
|
95
127
|
a[aria-disabled="true"] { color: var(--link-text-color-default-disabled); text-decoration-color: color-mix(in srgb, var(--link-text-color-default-disabled) 80%, transparent); cursor: not-allowed; }
|
|
96
128
|
a, a:before, a:after {box-sizing: border-box;}
|
|
97
|
-
a:focus-visible {
|
|
129
|
+
a:focus-visible {
|
|
130
|
+
outline: var(--action-focus-outline);
|
|
131
|
+
outline-offset: var(--action-focus-outline-offset);
|
|
132
|
+
}
|
|
98
133
|
|
|
99
134
|
:host([size="xx-small"]) a {
|
|
100
135
|
font-size: var(--font-size-15);
|
|
@@ -142,11 +177,12 @@ class h extends HTMLElement {
|
|
|
142
177
|
:host([variant="overlay"]) a,
|
|
143
178
|
:host([variant="attention"]) a,
|
|
144
179
|
:host([usage="input"]) a {
|
|
145
|
-
display:
|
|
180
|
+
display: inline-flex;
|
|
146
181
|
text-align: inherit;
|
|
147
182
|
width: 100%;
|
|
148
183
|
text-decoration: none;
|
|
149
184
|
padding: var(--action-padding);
|
|
185
|
+
min-height: var(--action-size-medium);
|
|
150
186
|
border-radius: var(--action-radius);
|
|
151
187
|
font-size: var(--action-font-size);
|
|
152
188
|
font-weight: var(--action-font-weight);
|
|
@@ -324,14 +360,83 @@ class h extends HTMLElement {
|
|
|
324
360
|
:host([variant="attention"]) a:focus ::slotted(.mui-icon) { fill: var(--action-attention-text-color-focus); }
|
|
325
361
|
:host([variant="attention"]) a[aria-disabled="true"] ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
|
|
326
362
|
|
|
363
|
+
:host,
|
|
364
|
+
:host([variant="primary"]) {
|
|
365
|
+
--action-ring-color: var(--action-primary-border-color);
|
|
366
|
+
--action-ring-color-hover: var(--action-primary-border-color-hover);
|
|
367
|
+
--action-ring-color-focus: var(--action-primary-border-color-focus);
|
|
368
|
+
--action-ring-color-disabled: var(--action-primary-border-color-disabled);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
:host([variant="secondary"]) {
|
|
372
|
+
--action-ring-color: var(--action-secondary-border-color);
|
|
373
|
+
--action-ring-color-hover: var(--action-secondary-border-color-hover);
|
|
374
|
+
--action-ring-color-focus: var(--action-secondary-border-color-focus);
|
|
375
|
+
--action-ring-color-disabled: var(--action-secondary-border-color-disabled);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
:host([variant="tertiary"]) {
|
|
379
|
+
--action-ring-color: var(--action-tertiary-border-color);
|
|
380
|
+
--action-ring-color-hover: var(--action-tertiary-border-color-hover);
|
|
381
|
+
--action-ring-color-focus: var(--action-tertiary-border-color-focus);
|
|
382
|
+
--action-ring-color-disabled: var(--action-tertiary-border-color-disabled);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:host([variant="overlay"]) {
|
|
386
|
+
--action-ring-size: var(--stroke-size-100);
|
|
387
|
+
--action-ring-color: var(--action-overlay-border-color);
|
|
388
|
+
--action-ring-color-hover: var(--action-overlay-border-color-hover);
|
|
389
|
+
--action-ring-color-focus: var(--action-overlay-border-color-focus);
|
|
390
|
+
--action-ring-color-disabled: var(--action-overlay-border-color-disabled);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
:host([variant="attention"]) {
|
|
394
|
+
--action-ring-color: var(--action-attention-border-color);
|
|
395
|
+
--action-ring-color-hover: var(--action-attention-border-color-hover);
|
|
396
|
+
--action-ring-color-focus: var(--action-attention-border-color-focus);
|
|
397
|
+
--action-ring-color-disabled: var(--action-attention-border-color-disabled);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a {
|
|
401
|
+
border: none;
|
|
402
|
+
box-shadow: var(
|
|
403
|
+
--action-ring-shadow,
|
|
404
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color)
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
:host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a:hover {
|
|
409
|
+
border: none;
|
|
410
|
+
box-shadow: var(
|
|
411
|
+
--action-ring-shadow-hover,
|
|
412
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-hover)
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
:host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a:focus-visible {
|
|
417
|
+
border: none;
|
|
418
|
+
box-shadow: var(
|
|
419
|
+
--action-ring-shadow-focus,
|
|
420
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-focus)
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
:host([stroke="ring"][variant]:not([variant="default"]):not([usage="input"])) a[aria-disabled="true"] {
|
|
425
|
+
border: none;
|
|
426
|
+
box-shadow: var(
|
|
427
|
+
--action-ring-shadow-disabled,
|
|
428
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-disabled)
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
|
|
327
432
|
/* Icon only
|
|
328
433
|
========================================= */
|
|
329
434
|
:host([icon-only]) a {
|
|
330
435
|
display: flex;
|
|
331
436
|
justify-content: center;
|
|
332
437
|
align-items: center;
|
|
333
|
-
height:
|
|
334
|
-
width:
|
|
438
|
+
height: var(--action-size-medium);
|
|
439
|
+
width: var(--action-size-medium);
|
|
335
440
|
padding: var(--action-icon-only-padding);
|
|
336
441
|
}
|
|
337
442
|
/* ===================================== */
|
|
@@ -572,6 +677,7 @@ class h extends HTMLElement {
|
|
|
572
677
|
font-size: var(--font-size-15);
|
|
573
678
|
line-height: var(--line-height-25);
|
|
574
679
|
font-weight: var(--font-weight-semi-bold);
|
|
680
|
+
min-height: var(--action-size-xx-small);
|
|
575
681
|
padding: var(--space-025) var(--space-100);
|
|
576
682
|
border-width: var(--stroke-size-100);
|
|
577
683
|
border-radius: var(--action-radius-x-small);
|
|
@@ -588,6 +694,7 @@ class h extends HTMLElement {
|
|
|
588
694
|
font-size: var(--text-font-size-xs);
|
|
589
695
|
line-height: var(--text-line-height-xs);
|
|
590
696
|
font-weight: var(--font-weight-semi-bold);
|
|
697
|
+
min-height: var(--action-size-x-small);
|
|
591
698
|
padding: var(--action-padding-x-small);
|
|
592
699
|
border-width: var(--stroke-size-100);
|
|
593
700
|
border-radius: var(--action-radius-x-small);
|
|
@@ -597,6 +704,7 @@ class h extends HTMLElement {
|
|
|
597
704
|
:host([size="small"][usage="input"]) a {
|
|
598
705
|
font-size: var(--text-font-size-s);
|
|
599
706
|
line-height: var(--text-line-height-s);
|
|
707
|
+
min-height: var(--action-size-small);
|
|
600
708
|
padding: var(--action-padding-small);
|
|
601
709
|
border-radius: var(--action-radius-small);
|
|
602
710
|
}
|
|
@@ -605,6 +713,7 @@ class h extends HTMLElement {
|
|
|
605
713
|
:host([size="medium"][usage="input"]) a {
|
|
606
714
|
font-size: var(--text-font-size-m);
|
|
607
715
|
line-height: var(--text-line-height-m);
|
|
716
|
+
min-height: var(--action-size-medium);
|
|
608
717
|
padding: var(--action-padding);
|
|
609
718
|
border-radius: var(--action-radius-medium);
|
|
610
719
|
}
|
|
@@ -613,6 +722,7 @@ class h extends HTMLElement {
|
|
|
613
722
|
:host([size="large"][usage="input"]) a {
|
|
614
723
|
font-size: var(--text-font-size-l);
|
|
615
724
|
line-height: var(--text-line-height-l);
|
|
725
|
+
min-height: var(--action-size-large);
|
|
616
726
|
padding: var(--action-padding-large);
|
|
617
727
|
border-radius: var(--action-radius-large);
|
|
618
728
|
}
|
|
@@ -638,32 +748,32 @@ class h extends HTMLElement {
|
|
|
638
748
|
|
|
639
749
|
/* Icon-only size variants */
|
|
640
750
|
:host([size="xx-small"][variant]:not([variant="default"])[icon-only]) a {
|
|
641
|
-
height:
|
|
642
|
-
width:
|
|
751
|
+
height: var(--action-size-xx-small);
|
|
752
|
+
width: var(--action-size-xx-small);
|
|
643
753
|
padding: var(--action-icon-only-padding);
|
|
644
754
|
}
|
|
645
755
|
|
|
646
756
|
:host([size="x-small"][variant]:not([variant="default"])[icon-only]) a {
|
|
647
|
-
height: var(--action-
|
|
648
|
-
width: var(--action-
|
|
757
|
+
height: var(--action-size-x-small);
|
|
758
|
+
width: var(--action-size-x-small);
|
|
649
759
|
padding: var(--action-icon-only-padding);
|
|
650
760
|
}
|
|
651
761
|
|
|
652
762
|
:host([size="small"][variant]:not([variant="default"])[icon-only]) a {
|
|
653
|
-
height: var(--action-
|
|
654
|
-
width: var(--action-
|
|
763
|
+
height: var(--action-size-small);
|
|
764
|
+
width: var(--action-size-small);
|
|
655
765
|
padding: var(--action-icon-only-padding);
|
|
656
766
|
}
|
|
657
767
|
|
|
658
768
|
:host([size="medium"][variant]:not([variant="default"])[icon-only]) a {
|
|
659
|
-
height: var(--action-
|
|
660
|
-
width: var(--action-
|
|
769
|
+
height: var(--action-size-medium);
|
|
770
|
+
width: var(--action-size-medium);
|
|
661
771
|
padding: var(--action-icon-only-padding);
|
|
662
772
|
}
|
|
663
773
|
|
|
664
774
|
:host([size="large"][variant]:not([variant="default"])[icon-only]) a {
|
|
665
|
-
height: var(--action-
|
|
666
|
-
width: var(--action-
|
|
775
|
+
height: var(--action-size-large);
|
|
776
|
+
width: var(--action-size-large);
|
|
667
777
|
padding: var(--action-icon-only-padding);
|
|
668
778
|
}
|
|
669
779
|
|
|
@@ -760,6 +870,40 @@ class h extends HTMLElement {
|
|
|
760
870
|
padding-left: var(--action-before-slot-padding-large);
|
|
761
871
|
}
|
|
762
872
|
|
|
873
|
+
:host([has-video]) {
|
|
874
|
+
display: inline-block;
|
|
875
|
+
width: auto;
|
|
876
|
+
text-align: initial;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
:host([has-video]) a,
|
|
880
|
+
:host([has-video]) a:hover,
|
|
881
|
+
:host([has-video]) a:focus,
|
|
882
|
+
:host([has-video]) a:focus-visible,
|
|
883
|
+
:host([has-video]) a[aria-disabled="true"] {
|
|
884
|
+
display: block;
|
|
885
|
+
width: 100%;
|
|
886
|
+
min-height: 0;
|
|
887
|
+
padding: var(--space-000);
|
|
888
|
+
border: none;
|
|
889
|
+
border-radius: var(--radius-000);
|
|
890
|
+
background: transparent;
|
|
891
|
+
color: inherit;
|
|
892
|
+
font-size: inherit;
|
|
893
|
+
font-weight: inherit;
|
|
894
|
+
line-height: inherit;
|
|
895
|
+
text-align: initial;
|
|
896
|
+
text-decoration: none;
|
|
897
|
+
box-shadow: none;
|
|
898
|
+
outline-offset: var(--video-thumbnail-action-focus-outline-offset, var(--space-300));
|
|
899
|
+
-webkit-backdrop-filter: none;
|
|
900
|
+
backdrop-filter: none;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
:host([focus-ring="outset"]) a:focus-visible {
|
|
904
|
+
outline-offset: var(--action-focus-outline-outset-offset, var(--stroke-size-200));
|
|
905
|
+
}
|
|
906
|
+
|
|
763
907
|
|
|
764
908
|
</style>
|
|
765
909
|
|
|
@@ -778,7 +922,7 @@ class h extends HTMLElement {
|
|
|
778
922
|
}
|
|
779
923
|
// Update avatar sizes based on button size
|
|
780
924
|
updateAvatarSizes(t) {
|
|
781
|
-
const
|
|
925
|
+
const o = this.getAttribute("size") || "medium", s = ((this.getAttribute("variant") || "default") === "default" ? {
|
|
782
926
|
"xx-small": "xx-small",
|
|
783
927
|
"x-small": "xx-small",
|
|
784
928
|
small: "xx-small",
|
|
@@ -790,37 +934,37 @@ class h extends HTMLElement {
|
|
|
790
934
|
small: "xx-small",
|
|
791
935
|
medium: "small",
|
|
792
936
|
large: "medium"
|
|
793
|
-
})[
|
|
937
|
+
})[o] || "small";
|
|
794
938
|
t.forEach((i) => {
|
|
795
939
|
if (i.nodeType === Node.ELEMENT_NODE) {
|
|
796
|
-
const
|
|
797
|
-
|
|
940
|
+
const e = i;
|
|
941
|
+
e.tagName.toLowerCase() === "mui-avatar" && e.setAttribute("size", s);
|
|
798
942
|
}
|
|
799
943
|
});
|
|
800
944
|
}
|
|
801
|
-
updateIconSizes(t,
|
|
802
|
-
const
|
|
945
|
+
updateIconSizes(t, o) {
|
|
946
|
+
const r = this.getAttribute("size") || "medium", n = {
|
|
803
947
|
"xx-small": "xx-small",
|
|
804
948
|
"x-small": "x-small",
|
|
805
949
|
small: "x-small",
|
|
806
|
-
medium:
|
|
807
|
-
large:
|
|
808
|
-
}[
|
|
950
|
+
medium: o ? "medium" : "small",
|
|
951
|
+
large: o ? "large" : "medium"
|
|
952
|
+
}[r] || "small";
|
|
809
953
|
t.forEach((s) => {
|
|
810
954
|
if (s.nodeType === Node.ELEMENT_NODE) {
|
|
811
|
-
const i = s,
|
|
812
|
-
(
|
|
955
|
+
const i = s, e = i.tagName.toLowerCase();
|
|
956
|
+
(e === "svg" || i.classList.contains("mui-icon") || e === "mui-icon") && !i.hasAttribute("size") && i.setAttribute("size", n);
|
|
813
957
|
}
|
|
814
958
|
});
|
|
815
959
|
}
|
|
816
960
|
updateBadgeSizes(t) {
|
|
817
|
-
const
|
|
961
|
+
const o = this.getAttribute("size") || "medium", a = {
|
|
818
962
|
"xx-small": "x-small",
|
|
819
963
|
"x-small": "x-small",
|
|
820
964
|
small: "small",
|
|
821
965
|
medium: "medium",
|
|
822
966
|
large: "large"
|
|
823
|
-
}[
|
|
967
|
+
}[o] || "medium";
|
|
824
968
|
t.forEach((n) => {
|
|
825
969
|
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
826
970
|
const s = n;
|
|
@@ -831,11 +975,11 @@ class h extends HTMLElement {
|
|
|
831
975
|
waitForPartMap() {
|
|
832
976
|
return new Promise((t) => {
|
|
833
977
|
if (typeof v == "function") return t();
|
|
834
|
-
const
|
|
835
|
-
typeof v == "function" ? t() : requestAnimationFrame(
|
|
978
|
+
const o = () => {
|
|
979
|
+
typeof v == "function" ? t() : requestAnimationFrame(o);
|
|
836
980
|
};
|
|
837
|
-
|
|
981
|
+
o();
|
|
838
982
|
});
|
|
839
983
|
}
|
|
840
984
|
}
|
|
841
|
-
customElements.get("mui-link") || customElements.define("mui-link",
|
|
985
|
+
customElements.get("mui-link") || customElements.define("mui-link", g);
|
|
@@ -42,7 +42,7 @@ const f = ["neutral", "positive", "info", "warning", "attention"], h = {
|
|
|
42
42
|
warning: "mui-icon-warning",
|
|
43
43
|
attention: "mui-icon-attention"
|
|
44
44
|
};
|
|
45
|
-
class
|
|
45
|
+
class y extends HTMLElement {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(), this.contentSlotListener = null, this.attachShadow({ mode: "open" });
|
|
48
48
|
}
|
|
@@ -77,7 +77,7 @@ class C extends HTMLElement {
|
|
|
77
77
|
this.contentSlotListener = n, t.addEventListener("slotchange", this.contentSlotListener), requestAnimationFrame(n);
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
const e = this.getAttribute("variant") || "neutral", t = f.includes(e) ? e : "neutral", n = this.getMessageSize(), i = this.getAttribute("heading") || "Heading...", r = this.getAttribute("icon") || z[t], o = S[t], a = w[t], c = h[t], l = p[t], d = k[t], g = n === "large" ? "var(--message-gap-horizontal)" : n === "medium" ? "var(--space-200)" : "var(--space-100)", u = n === "large" ? "var(--message-gap-vertical)" : n === "medium" ? "var(--space-100)" : "var(--space-050)", v = n === "large" ? "var(--font-size-200)" : "var(--font-size-100)",
|
|
80
|
+
const e = this.getAttribute("variant") || "neutral", t = f.includes(e) ? e : "neutral", n = this.getMessageSize(), i = this.getAttribute("heading") || "Heading...", r = this.getAttribute("icon") || z[t], o = S[t], a = w[t], c = h[t], l = p[t], d = k[t], g = n === "large" ? "var(--message-gap-horizontal)" : n === "medium" ? "var(--space-200)" : "var(--space-100)", u = n === "large" ? "var(--message-gap-vertical)" : n === "medium" ? "var(--space-100)" : "var(--space-050)", v = n === "large" ? "var(--font-size-200)" : "var(--font-size-100)", m = n === "large" ? "medium" : "small", b = (
|
|
81
81
|
/*css*/
|
|
82
82
|
`
|
|
83
83
|
:host {
|
|
@@ -98,7 +98,8 @@ class C extends HTMLElement {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.heading {
|
|
101
|
-
font-
|
|
101
|
+
font-family: var(--heading-font-family);
|
|
102
|
+
font-weight: var(--heading-font-weight);
|
|
102
103
|
font-size: ${v};
|
|
103
104
|
${a}
|
|
104
105
|
}
|
|
@@ -106,12 +107,12 @@ class C extends HTMLElement {
|
|
|
106
107
|
);
|
|
107
108
|
this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
108
109
|
`
|
|
109
|
-
<style>${
|
|
110
|
+
<style>${b}</style>
|
|
110
111
|
|
|
111
112
|
<section aria-labelledby="message-heading" aria-live="${l}" role="${d}">
|
|
112
113
|
<mui-h-stack space="${g}">
|
|
113
114
|
<div class="icon">
|
|
114
|
-
<${r} size="${
|
|
115
|
+
<${r} size="${m}" color="var(${o})"></${r}>
|
|
115
116
|
</div>
|
|
116
117
|
<mui-v-stack space="${u}">
|
|
117
118
|
<div class="heading" id="message-heading">${i}</div>
|
|
@@ -122,4 +123,4 @@ class C extends HTMLElement {
|
|
|
122
123
|
`, this.setupContentSlot(n));
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
customElements.get("mui-message") || customElements.define("mui-message",
|
|
126
|
+
customElements.get("mui-message") || customElements.define("mui-message", y);
|