@muibook/components 6.1.1 → 7.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 +116 -662
- package/dist/esm/components/mui-alert/index.js +1 -1
- package/dist/esm/components/mui-button/index.js +299 -125
- package/dist/esm/components/mui-drawer/index.js +21 -7
- package/dist/esm/components/mui-icons/accessibility/index.js +3 -3
- package/dist/esm/components/mui-icons/add/index.js +3 -3
- package/dist/esm/components/mui-icons/attention/index.js +3 -3
- package/dist/esm/components/mui-icons/calendar/index.js +3 -3
- package/dist/esm/components/mui-icons/check/index.js +3 -3
- package/dist/esm/components/mui-icons/close/index.js +3 -3
- package/dist/esm/components/mui-icons/down-arrow-circle/index.js +3 -3
- package/dist/esm/components/mui-icons/down-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/ellipsis/index.js +3 -3
- package/dist/esm/components/mui-icons/gear/index.js +3 -3
- package/dist/esm/components/mui-icons/globe/index.js +3 -3
- package/dist/esm/components/mui-icons/grid/index.js +3 -3
- package/dist/esm/components/mui-icons/info/index.js +3 -3
- package/dist/esm/components/mui-icons/left-arrow/index.js +3 -3
- package/dist/esm/components/mui-icons/left-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/left-sidebar/index.js +3 -3
- package/dist/esm/components/mui-icons/menu/index.js +3 -3
- package/dist/esm/components/mui-icons/message/index.js +3 -3
- package/dist/esm/components/mui-icons/moon/index.js +3 -3
- package/dist/esm/components/mui-icons/notification/index.js +3 -3
- package/dist/esm/components/mui-icons/right-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/stop/index.js +3 -3
- package/dist/esm/components/mui-icons/subtract/index.js +3 -3
- package/dist/esm/components/mui-icons/sun/index.js +3 -3
- package/dist/esm/components/mui-icons/toggle/index.js +14 -14
- package/dist/esm/components/mui-icons/translate/index.js +3 -3
- package/dist/esm/components/mui-icons/up-arrow/index.js +3 -3
- package/dist/esm/components/mui-icons/up-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/warning/index.js +3 -3
- package/dist/esm/components/mui-input/index.js +51 -28
- package/dist/esm/components/mui-link/index.js +279 -40
- package/dist/esm/components/mui-message/index.js +6 -6
- package/dist/esm/css/mui-tokens.css +31 -9
- package/dist/types/agent/prompts/index.d.ts +7 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getPartMap as
|
|
2
|
-
class
|
|
1
|
+
import { getPartMap as v } from "../../utils/part-map/index.js";
|
|
2
|
+
class f extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
|
-
return ["target", "href", "variant", "weight", "size", "download"];
|
|
4
|
+
return ["target", "href", "variant", "weight", "size", "download", "usage"];
|
|
5
5
|
}
|
|
6
6
|
constructor() {
|
|
7
7
|
super(), this.attachShadow({ mode: "open" });
|
|
@@ -9,42 +9,62 @@ 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(
|
|
12
|
+
attributeChangedCallback(a, o, e) {
|
|
13
13
|
if (this.shadowRoot) {
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
|
|
26
|
-
}
|
|
14
|
+
if (a === "href") {
|
|
15
|
+
const t = this.shadowRoot.querySelector("a");
|
|
16
|
+
t && t.setAttribute("href", e || "#");
|
|
17
|
+
}
|
|
18
|
+
if (a === "target") {
|
|
19
|
+
const t = this.shadowRoot.querySelector("a");
|
|
20
|
+
t && t.setAttribute("target", e || "_self");
|
|
21
|
+
}
|
|
22
|
+
if (a === "download") {
|
|
23
|
+
const t = this.shadowRoot.querySelector("a");
|
|
24
|
+
if (!t) return;
|
|
25
|
+
e !== null ? t.setAttribute("download", e === "" ? "" : e) : t.removeAttribute("download");
|
|
26
|
+
}
|
|
27
|
+
a === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => {
|
|
28
|
+
const t = this.shadowRoot;
|
|
29
|
+
if (!t) return;
|
|
30
|
+
const l = [
|
|
31
|
+
t.querySelector("slot:not([name])"),
|
|
32
|
+
t.querySelector('slot[name="before"]'),
|
|
33
|
+
t.querySelector('slot[name="after"]')
|
|
34
|
+
], d = this.hasAttribute("icon-only");
|
|
35
|
+
l.forEach((r) => {
|
|
36
|
+
if (r) {
|
|
37
|
+
const n = r.assignedNodes({ flatten: !0 });
|
|
38
|
+
this.updateIconSizes(n, d);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
27
42
|
}
|
|
28
43
|
}
|
|
29
44
|
updateSlotState() {
|
|
30
|
-
const
|
|
45
|
+
const a = this.shadowRoot, o = a.querySelector("slot:not([name])"), e = a.querySelector('slot[name="before"]'), t = a.querySelector('slot[name="after"]'), l = (s) => !!s && s.assignedNodes({ flatten: !0 }).some(
|
|
31
46
|
(i) => {
|
|
32
|
-
var
|
|
33
|
-
return i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && !!((
|
|
47
|
+
var c;
|
|
48
|
+
return i.nodeType === Node.ELEMENT_NODE || i.nodeType === Node.TEXT_NODE && !!((c = i.textContent) != null && c.trim());
|
|
34
49
|
}
|
|
35
|
-
), d =
|
|
36
|
-
this.classList.toggle("has-before", d), this.classList.toggle("has-after",
|
|
37
|
-
const
|
|
38
|
-
(
|
|
50
|
+
), d = l(e), r = l(t);
|
|
51
|
+
this.classList.toggle("has-before", d), this.classList.toggle("has-after", r);
|
|
52
|
+
const n = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], h = n.length > 0 && n.every(
|
|
53
|
+
(s) => {
|
|
39
54
|
var i;
|
|
40
|
-
return
|
|
55
|
+
return s.nodeType === Node.ELEMENT_NODE ? s.classList.contains("mui-icon") || s.tagName.toLowerCase() === "svg" : !((i = s.textContent) != null && i.trim());
|
|
41
56
|
}
|
|
42
57
|
);
|
|
43
|
-
this.toggleAttribute("icon-only",
|
|
58
|
+
this.toggleAttribute("icon-only", h), h ? this.updateIconSizes(n, !0) : [e, o, t].forEach((i) => {
|
|
59
|
+
if (i) {
|
|
60
|
+
const c = i.assignedNodes({ flatten: !0 });
|
|
61
|
+
this.updateIconSizes(c, !1);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
44
64
|
}
|
|
45
65
|
render() {
|
|
46
66
|
if (!this.shadowRoot) return;
|
|
47
|
-
const
|
|
67
|
+
const a = v("text", "spacing", "layout", "visual");
|
|
48
68
|
this.shadowRoot.innerHTML = /*html*/
|
|
49
69
|
`
|
|
50
70
|
<style>
|
|
@@ -103,12 +123,14 @@ class u extends HTMLElement {
|
|
|
103
123
|
:host([variant="primary"]),
|
|
104
124
|
:host([variant="secondary"]),
|
|
105
125
|
:host([variant="tertiary"]),
|
|
106
|
-
:host([variant="attention"])
|
|
126
|
+
:host([variant="attention"]),
|
|
127
|
+
:host([usage="input"]) { display: inline-block; text-align: center; }
|
|
107
128
|
|
|
108
129
|
:host([variant="primary"]) a,
|
|
109
130
|
:host([variant="secondary"]) a,
|
|
110
131
|
:host([variant="tertiary"]) a,
|
|
111
|
-
:host([variant="attention"]) a
|
|
132
|
+
:host([variant="attention"]) a,
|
|
133
|
+
:host([usage="input"]) a {
|
|
112
134
|
display: inherit;
|
|
113
135
|
text-align: inherit;
|
|
114
136
|
width: 100%;
|
|
@@ -313,7 +335,7 @@ class u extends HTMLElement {
|
|
|
313
335
|
align-items: center;
|
|
314
336
|
gap: var(--space-100);
|
|
315
337
|
}
|
|
316
|
-
|
|
338
|
+
|
|
317
339
|
:host(.has-after.has-before) a {
|
|
318
340
|
grid-template-columns: auto 1fr auto;
|
|
319
341
|
}
|
|
@@ -326,23 +348,226 @@ class u extends HTMLElement {
|
|
|
326
348
|
grid-template-columns: auto 1fr;
|
|
327
349
|
}
|
|
328
350
|
|
|
329
|
-
:host(.has-after.has-before[variant]) a
|
|
351
|
+
:host(.has-after.has-before[variant]:not([variant="default"])) a,
|
|
352
|
+
:host(.has-after.has-before[usage="input"]) a {
|
|
353
|
+
padding-right: var(--action-after-slot-padding);
|
|
354
|
+
padding-left: var(--action-before-slot-padding);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
:host(.has-after[variant]:not([variant="default"])) a,
|
|
358
|
+
:host(.has-after[usage="input"]) a {
|
|
359
|
+
padding-right: var(--action-after-slot-padding);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
:host(.has-before[variant]:not([variant="default"])) a,
|
|
363
|
+
:host(.has-before[usage="input"]) a {
|
|
364
|
+
padding-left: var(--action-before-slot-padding);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* ========================================================================== */
|
|
368
|
+
/* STYLE ADJUSTMENTS WHEN BUTTON IS SLOTTED WITHIN INPUT */
|
|
369
|
+
/* Related styles unique to this usage is found in the mui-input/index.js */
|
|
370
|
+
/* ========================================================================== */
|
|
371
|
+
:host([slot="before"][usage="input"]) a,
|
|
372
|
+
:host([slot="after"][usage="input"]) a {
|
|
373
|
+
border: var(--border-thin);
|
|
374
|
+
min-height: 4.4rem;
|
|
375
|
+
background: var(--input-background);
|
|
376
|
+
color: var(--action-secondary-text-color);
|
|
377
|
+
border-color: var(--form-default-border-color);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
:host([slot="before"][usage="input"]) a:hover,
|
|
381
|
+
:host([slot="before"][usage="input"]) a:focus-visible,
|
|
382
|
+
:host([slot="after"][usage="input"]) a:hover,
|
|
383
|
+
:host([slot="after"][usage="input"]) a:focus-visible {
|
|
384
|
+
background: var(--input-background);
|
|
385
|
+
color: var(--action-secondary-text-color-hover);
|
|
386
|
+
border-color: var(--form-default-border-color-hover);
|
|
387
|
+
border-width: var(--stroke-size-100);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
:host([slot="after"][usage="input"]) a ::slotted(.mui-icon),
|
|
391
|
+
:host([slot="before"][usage="input"]) a ::slotted(.mui-icon) {
|
|
392
|
+
fill: var(--action-secondary-text-color);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
:host([slot="after"][usage="input"]) a:hover ::slotted(.mui-icon),
|
|
396
|
+
:host([slot="before"][usage="input"]) a:hover ::slotted(.mui-icon) {
|
|
397
|
+
fill: var(--action-secondary-text-color-hover);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:host([slot="after"][usage="input"]) a:focus-visible ::slotted(.mui-icon),
|
|
401
|
+
:host([slot="before"][usage="input"]) a:focus-visible ::slotted(.mui-icon) {
|
|
402
|
+
fill: var(--action-secondary-text-color-focus);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/* ========================================================================== */
|
|
406
|
+
/* BEFORE: When a BUTTON has slot="before" applied to host for INPUT usage */
|
|
407
|
+
/* ========================================================================== */
|
|
408
|
+
:host([slot="before"][usage="input"]) a {
|
|
409
|
+
border-right: none;
|
|
410
|
+
border-top-right-radius: var(--radius-000);
|
|
411
|
+
border-bottom-right-radius: var(--radius-000);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
:host([slot="before"][usage="input"]) a:hover,
|
|
415
|
+
:host([slot="before"][usage="input"]) a:focus-visible {
|
|
416
|
+
border-right: none;
|
|
417
|
+
box-shadow: var(--stroke-size-100) 0 0 0 var(--form-default-border-color-hover);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* ========================================================================== */
|
|
421
|
+
/* AFTER: When a BUTTON has slot="after" applied to host for INPUT usage */
|
|
422
|
+
/* ========================================================================== */
|
|
423
|
+
:host([slot="after"][usage="input"]) a {
|
|
424
|
+
border-left: none;
|
|
425
|
+
border-top-left-radius: var(--radius-000);
|
|
426
|
+
border-bottom-left-radius: var(--radius-000);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
:host([slot="after"][usage="input"]) a:hover,
|
|
430
|
+
:host([slot="after"][usage="input"]) a:focus-visible {
|
|
431
|
+
border-left: none;
|
|
432
|
+
box-shadow: calc(-1 * var(--stroke-size-100)) 0 0 0 var(--form-default-border-color-hover);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/* ========================================================================== */
|
|
436
|
+
/* Size Variants with Before & After Icon padding adjustments */
|
|
437
|
+
/* ========================================================================== */
|
|
438
|
+
|
|
439
|
+
:host([size="x-small"][variant]:not([variant="default"])) a,
|
|
440
|
+
:host([size="x-small"][variant]:not([variant="default"])) a:hover,
|
|
441
|
+
:host([size="x-small"][variant]:not([variant="default"])) a:focus {
|
|
442
|
+
font-size: var(--text-font-size-xs);
|
|
443
|
+
line-height: var(--text-line-height-xs);
|
|
444
|
+
font-weight: var(--font-weight-semi-bold);
|
|
445
|
+
padding: var(--action-padding-x-small);
|
|
446
|
+
border-width: var(--stroke-size-100);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
:host([size="small"][variant]:not([variant="default"])) a {
|
|
450
|
+
font-size: var(--text-font-size-s);
|
|
451
|
+
line-height: var(--text-line-height-s);
|
|
452
|
+
padding: var(--action-padding-small);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
:host([size="medium"][variant]:not([variant="default"])) a {
|
|
456
|
+
font-size: var(--text-font-size-m);
|
|
457
|
+
line-height: var(--text-line-height-m);
|
|
458
|
+
padding: var(--action-padding);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
:host([size="large"][variant]:not([variant="default"])) a {
|
|
462
|
+
font-size: var(--text-font-size-l);
|
|
463
|
+
line-height: var(--text-line-height-l);
|
|
464
|
+
padding: var(--action-padding-large);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* Icon-only size variants */
|
|
468
|
+
:host([size="x-small"][variant]:not([variant="default"])[icon-only]) a {
|
|
469
|
+
height: var(--action-icon-only-size-x-small);
|
|
470
|
+
width: var(--action-icon-only-size-x-small);
|
|
471
|
+
padding: var(--action-icon-only-padding);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
:host([size="small"][variant]:not([variant="default"])[icon-only]) a {
|
|
475
|
+
height: var(--action-icon-only-size-small);
|
|
476
|
+
width: var(--action-icon-only-size-small);
|
|
477
|
+
padding: var(--action-icon-only-padding);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
:host([size="medium"][variant]:not([variant="default"])[icon-only]) a {
|
|
481
|
+
height: var(--action-icon-only-size);
|
|
482
|
+
width: var(--action-icon-only-size);
|
|
483
|
+
padding: var(--action-icon-only-padding);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
:host([size="large"][variant]:not([variant="default"])[icon-only]) a {
|
|
487
|
+
height: var(--action-icon-only-size-large);
|
|
488
|
+
width: var(--action-icon-only-size-large);
|
|
489
|
+
padding: var(--action-icon-only-padding);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/* Before & After Icon padding adjustments for x-small */
|
|
493
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-after) a,
|
|
494
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-before) a,
|
|
495
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
496
|
+
gap: var(--space-025);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
500
|
+
padding-right: var(--action-after-slot-padding-x-small);
|
|
501
|
+
padding-left: var(--action-before-slot-padding-x-small);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-after) a {
|
|
505
|
+
padding-right: var(--action-after-slot-padding-x-small);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
:host([size="x-small"][variant]:not([variant="default"]).has-before) a {
|
|
509
|
+
padding-left: var(--action-before-slot-padding-x-small);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* Before & After Icon padding adjustments for small */
|
|
513
|
+
:host([size="small"][variant]:not([variant="default"]).has-after) a,
|
|
514
|
+
:host([size="small"][variant]:not([variant="default"]).has-before) a,
|
|
515
|
+
:host([size="small"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
516
|
+
gap: var(--space-050);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
:host([size="small"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
520
|
+
padding-right: var(--action-after-slot-padding-small);
|
|
521
|
+
padding-left: var(--action-before-slot-padding-small);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
:host([size="small"][variant]:not([variant="default"]).has-after) a {
|
|
525
|
+
padding-right: var(--action-after-slot-padding-small);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
:host([size="small"][variant]:not([variant="default"]).has-before) a {
|
|
529
|
+
padding-left: var(--action-before-slot-padding-small);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* Before & After Icon padding adjustments for medium */
|
|
533
|
+
:host([size="medium"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
330
534
|
padding-right: var(--action-after-slot-padding);
|
|
331
535
|
padding-left: var(--action-before-slot-padding);
|
|
332
536
|
}
|
|
333
537
|
|
|
334
|
-
:host(.has-after
|
|
538
|
+
:host([size="medium"][variant]:not([variant="default"]).has-after) a {
|
|
335
539
|
padding-right: var(--action-after-slot-padding);
|
|
336
540
|
}
|
|
337
541
|
|
|
338
|
-
:host(.has-before
|
|
542
|
+
:host([size="medium"][variant]:not([variant="default"]).has-before) a {
|
|
339
543
|
padding-left: var(--action-before-slot-padding);
|
|
340
544
|
}
|
|
341
545
|
|
|
546
|
+
/* Before & After Icon padding adjustments for large */
|
|
547
|
+
:host([size="large"][variant]:not([variant="default"]).has-after) a,
|
|
548
|
+
:host([size="large"][variant]:not([variant="default"]).has-before) a,
|
|
549
|
+
:host([size="large"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
550
|
+
gap: var(--space-200);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
:host([size="large"][variant]:not([variant="default"]).has-after.has-before) a {
|
|
554
|
+
padding-right: var(--action-after-slot-padding-large);
|
|
555
|
+
padding-left: var(--action-before-slot-padding-large);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
:host([size="large"][variant]:not([variant="default"]).has-after) a {
|
|
559
|
+
padding-right: var(--action-after-slot-padding-large);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
:host([size="large"][variant]:not([variant="default"]).has-before) a {
|
|
563
|
+
padding-left: var(--action-before-slot-padding-large);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
|
|
342
567
|
</style>
|
|
343
568
|
|
|
344
569
|
<a
|
|
345
|
-
part="${
|
|
570
|
+
part="${a}"
|
|
346
571
|
target="${this.getAttribute("target") || "_self"}"
|
|
347
572
|
href="${this.getAttribute("href") || "#"}"
|
|
348
573
|
${this.hasAttribute("download") ? `download="${this.getAttribute("download") || ""}"` : ""}
|
|
@@ -353,14 +578,28 @@ class u extends HTMLElement {
|
|
|
353
578
|
</a>
|
|
354
579
|
`;
|
|
355
580
|
}
|
|
581
|
+
updateIconSizes(a, o) {
|
|
582
|
+
const e = this.getAttribute("size") || "medium", l = {
|
|
583
|
+
"x-small": "x-small",
|
|
584
|
+
small: "x-small",
|
|
585
|
+
medium: o ? "medium" : "small",
|
|
586
|
+
large: o ? "large" : "medium"
|
|
587
|
+
}[e] || "small";
|
|
588
|
+
a.forEach((d) => {
|
|
589
|
+
if (d.nodeType === Node.ELEMENT_NODE) {
|
|
590
|
+
const r = d, n = r.tagName.toLowerCase();
|
|
591
|
+
(n === "svg" || r.classList.contains("mui-icon") || n === "mui-icon") && !r.hasAttribute("size") && r.setAttribute("size", l);
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
356
595
|
waitForPartMap() {
|
|
357
|
-
return new Promise((
|
|
358
|
-
if (typeof
|
|
359
|
-
const
|
|
360
|
-
typeof
|
|
596
|
+
return new Promise((a) => {
|
|
597
|
+
if (typeof v == "function") return a();
|
|
598
|
+
const o = () => {
|
|
599
|
+
typeof v == "function" ? a() : requestAnimationFrame(o);
|
|
361
600
|
};
|
|
362
|
-
|
|
601
|
+
o();
|
|
363
602
|
});
|
|
364
603
|
}
|
|
365
604
|
}
|
|
366
|
-
customElements.get("mui-link") || customElements.define("mui-link",
|
|
605
|
+
customElements.get("mui-link") || customElements.define("mui-link", f);
|
|
@@ -35,19 +35,19 @@ const l = ["neutral", "positive", "info", "warning", "attention"], g = {
|
|
|
35
35
|
info: "color: var(--feedback-info-text);",
|
|
36
36
|
warning: "color: var(--feedback-warning-text);",
|
|
37
37
|
attention: "color: var(--feedback-attention-text);"
|
|
38
|
-
},
|
|
38
|
+
}, m = {
|
|
39
39
|
neutral: "mui-icon-message",
|
|
40
40
|
positive: "mui-icon-check",
|
|
41
41
|
info: "mui-icon-info",
|
|
42
42
|
warning: "mui-icon-warning",
|
|
43
43
|
attention: "mui-icon-attention"
|
|
44
44
|
};
|
|
45
|
-
class
|
|
45
|
+
class k extends HTMLElement {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(), this.attachShadow({ mode: "open" });
|
|
48
48
|
}
|
|
49
49
|
connectedCallback() {
|
|
50
|
-
const t = this.getAttribute("variant") || "neutral", e = l.includes(t) ? t : "neutral", a = this.getAttribute("heading") || "Heading...", o = this.getAttribute("icon") ||
|
|
50
|
+
const t = this.getAttribute("variant") || "neutral", e = l.includes(t) ? t : "neutral", a = this.getAttribute("heading") || "Heading...", o = this.getAttribute("icon") || m[e], i = v[e], n = f[e], r = g[e], s = b[e], c = u[e], d = (
|
|
51
51
|
/*css*/
|
|
52
52
|
`
|
|
53
53
|
:host {
|
|
@@ -70,7 +70,7 @@ class m extends HTMLElement {
|
|
|
70
70
|
.heading {
|
|
71
71
|
font-weight: var(--font-weight-bold);
|
|
72
72
|
font-size: var(--font-size-200);
|
|
73
|
-
${
|
|
73
|
+
${n}
|
|
74
74
|
}
|
|
75
75
|
`
|
|
76
76
|
);
|
|
@@ -81,7 +81,7 @@ class m extends HTMLElement {
|
|
|
81
81
|
<section aria-labelledby="message-heading" aria-live="${s}" role="${c}">
|
|
82
82
|
<mui-h-stack space="var(--message-gap-horizontal)">
|
|
83
83
|
<div class="icon">
|
|
84
|
-
<${o} color="var(${
|
|
84
|
+
<${o} size="medium" color="var(${i})"></${o}>
|
|
85
85
|
</div>
|
|
86
86
|
<mui-v-stack space="var(--message-gap-vertical)">
|
|
87
87
|
<div class="heading" id="message-heading">${a}</div>
|
|
@@ -92,4 +92,4 @@ class m extends HTMLElement {
|
|
|
92
92
|
`);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
customElements.get("mui-message") || customElements.define("mui-message",
|
|
95
|
+
customElements.get("mui-message") || customElements.define("mui-message", k);
|
|
@@ -384,7 +384,7 @@ html[data-theme="light"] {
|
|
|
384
384
|
--slat-accessory-background: var(--black-opacity-10);
|
|
385
385
|
|
|
386
386
|
/* Chip */
|
|
387
|
-
--chip-background: var(--
|
|
387
|
+
--chip-background: var(--input-background);
|
|
388
388
|
--chip-background-hover: var(--white);
|
|
389
389
|
--chip-background-focus: var(--white);
|
|
390
390
|
--chip-background-active: var(--white);
|
|
@@ -604,10 +604,10 @@ html[data-theme="dark"] {
|
|
|
604
604
|
--slat-accessory-background: var(--white-opacity-10);
|
|
605
605
|
|
|
606
606
|
/* Chip */
|
|
607
|
-
--chip-background: var(--
|
|
608
|
-
--chip-background-hover: var(--
|
|
609
|
-
--chip-background-focus: var(--
|
|
610
|
-
--chip-background-active: var(--
|
|
607
|
+
--chip-background: var(--input-background);
|
|
608
|
+
--chip-background-hover: var(--grey-800);
|
|
609
|
+
--chip-background-focus: var(--grey-800);
|
|
610
|
+
--chip-background-active: var(--grey-800);
|
|
611
611
|
--chip-border-color: var(--grey-700);
|
|
612
612
|
--chip-border-color-hover: var(--grey-700);
|
|
613
613
|
--chip-border-color-focus: var(--grey-700);
|
|
@@ -674,14 +674,36 @@ html[data-theme="dark"] {
|
|
|
674
674
|
--action-attention-border-focus: var(--stroke-size-200) var(--stroke-solid) var(--action-attention-border-color-focus);
|
|
675
675
|
--action-attention-border-disabled: var(--stroke-size-200) var(--stroke-solid)
|
|
676
676
|
var(--action-attention-border-color-disabled);
|
|
677
|
-
--action-padding: var(--space-200) calc(var(--space-300) + var(--space-100));
|
|
678
|
-
--action-before-slot-padding: var(--space-300);
|
|
679
|
-
--action-after-slot-padding: var(--space-300);
|
|
680
|
-
--action-icon-only-padding: var(--space-000);
|
|
681
677
|
--action-radius: var(--radius-100);
|
|
682
678
|
--action-font-size: var(--text-font-size);
|
|
683
679
|
--action-line-height: var(--text-line-height);
|
|
684
680
|
--action-font-weight: var(--font-weight-medium);
|
|
681
|
+
|
|
682
|
+
/* SIZE: XSMALL */
|
|
683
|
+
--action-padding-x-small: var(--space-050) var(--space-200);
|
|
684
|
+
--action-before-slot-padding-x-small: var(--space-100);
|
|
685
|
+
--action-after-slot-padding-x-small: var(--space-100);
|
|
686
|
+
--action-icon-only-size-x-small: 2.8rem;
|
|
687
|
+
|
|
688
|
+
/* SIZE: SMALL */
|
|
689
|
+
--action-padding-small: calc(var(--space-100) - (var(--stroke-size-100) / 2)) var(--space-300);
|
|
690
|
+
--action-before-slot-padding-small: var(--space-200);
|
|
691
|
+
--action-after-slot-padding-small: var(--space-200);
|
|
692
|
+
--action-icon-only-size-small: 3.6rem;
|
|
693
|
+
|
|
694
|
+
/* SIZE: MEDIUM: DEFAULT */
|
|
695
|
+
--action-padding: var(--space-200) calc(var(--space-300) + var(--space-100));
|
|
696
|
+
--action-before-slot-padding: var(--space-300);
|
|
697
|
+
--action-after-slot-padding: var(--space-300);
|
|
698
|
+
--action-icon-only-padding: var(--space-000);
|
|
699
|
+
--action-icon-only-size: 4.4rem;
|
|
700
|
+
|
|
701
|
+
/* SIZE: LARGE */
|
|
702
|
+
--action-padding-large: var(--space-300) var(--space-500);
|
|
703
|
+
--action-before-slot-padding-large: var(--space-400);
|
|
704
|
+
--action-after-slot-padding-large: var(--space-400);
|
|
705
|
+
--action-icon-only-size-large: 5.2rem;
|
|
706
|
+
|
|
685
707
|
/* Text */
|
|
686
708
|
--text-line-height-xs: var(--line-height-25);
|
|
687
709
|
--text-line-height-s: var(--line-height-50);
|