@muibook/components 1.6.0 → 3.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.
Files changed (94) hide show
  1. package/dist/esm/agent/keywords/index.js +104 -4
  2. package/dist/esm/agent/prompts/index.js +392 -37
  3. package/dist/esm/components/mui-accordion/block/index.js +2 -6
  4. package/dist/esm/components/mui-accordion/group/index.js +1 -1
  5. package/dist/esm/components/mui-accordion/inline/index.js +2 -6
  6. package/dist/esm/components/mui-addon/index.js +1 -1
  7. package/dist/esm/components/mui-alert/index.js +10 -5
  8. package/dist/esm/components/mui-badge/index.js +10 -7
  9. package/dist/esm/components/mui-body/index.js +4 -4
  10. package/dist/esm/components/mui-button/index.js +23 -25
  11. package/dist/esm/components/mui-button-group/index.js +1 -1
  12. package/dist/esm/components/mui-card/body/index.js +22 -18
  13. package/dist/esm/components/mui-card/card/index.js +1 -1
  14. package/dist/esm/components/mui-card/footer/index.js +1 -1
  15. package/dist/esm/components/mui-card/header/index.js +1 -1
  16. package/dist/esm/components/mui-carousel/controller/index.js +14 -11
  17. package/dist/esm/components/mui-carousel/panel/index.js +2 -2
  18. package/dist/esm/components/mui-code/index.js +20 -10
  19. package/dist/esm/components/mui-container/index.js +1 -1
  20. package/dist/esm/components/mui-field/index.js +10 -7
  21. package/dist/esm/components/mui-file-upload/index.js +5 -4
  22. package/dist/esm/components/mui-grid/index.js +1 -1
  23. package/dist/esm/components/mui-heading/index.js +1 -1
  24. package/dist/esm/components/mui-icons/accessibility/index.js +4 -4
  25. package/dist/esm/components/mui-icons/add/index.js +5 -5
  26. package/dist/esm/components/mui-icons/attention/index.js +5 -5
  27. package/dist/esm/components/mui-icons/check/index.js +6 -6
  28. package/dist/esm/components/mui-icons/close/index.js +2 -2
  29. package/dist/esm/components/mui-icons/down-arrow-circle/index.js +55 -0
  30. package/dist/esm/components/mui-icons/down-chevron/index.js +2 -2
  31. package/dist/esm/components/mui-icons/ellipsis/index.js +55 -0
  32. package/dist/esm/components/mui-icons/globe/index.js +5 -5
  33. package/dist/esm/components/mui-icons/grid/index.js +1 -1
  34. package/dist/esm/components/mui-icons/index.js +2 -0
  35. package/dist/esm/components/mui-icons/info/index.js +2 -2
  36. package/dist/esm/components/mui-icons/left-arrow/index.js +1 -1
  37. package/dist/esm/components/mui-icons/left-chevron/index.js +1 -1
  38. package/dist/esm/components/mui-icons/left-sidebar/index.js +6 -6
  39. package/dist/esm/components/mui-icons/menu/index.js +6 -6
  40. package/dist/esm/components/mui-icons/message/index.js +6 -6
  41. package/dist/esm/components/mui-icons/moon/index.js +2 -2
  42. package/dist/esm/components/mui-icons/notification/index.js +2 -2
  43. package/dist/esm/components/mui-icons/right-chevron/index.js +5 -5
  44. package/dist/esm/components/mui-icons/stop/index.js +2 -2
  45. package/dist/esm/components/mui-icons/subtract/index.js +7 -7
  46. package/dist/esm/components/mui-icons/sun/index.js +6 -6
  47. package/dist/esm/components/mui-icons/toggle/index.js +39 -30
  48. package/dist/esm/components/mui-icons/up-arrow/index.js +4 -4
  49. package/dist/esm/components/mui-icons/up-chevron/index.js +1 -1
  50. package/dist/esm/components/mui-icons/warning/index.js +2 -2
  51. package/dist/esm/components/mui-image/index.js +1 -1
  52. package/dist/esm/components/mui-input/index.js +21 -27
  53. package/dist/esm/components/mui-link/index.js +52 -57
  54. package/dist/esm/components/mui-list/item/index.js +5 -2
  55. package/dist/esm/components/mui-list/list/index.js +1 -1
  56. package/dist/esm/components/mui-message/index.js +14 -9
  57. package/dist/esm/components/mui-quote/index.js +1 -1
  58. package/dist/esm/components/mui-responsive/index.js +1 -1
  59. package/dist/esm/components/mui-rule/index.js +5 -5
  60. package/dist/esm/components/mui-select/index.js +28 -27
  61. package/dist/esm/components/mui-slat/accessory/index.js +29 -0
  62. package/dist/esm/components/mui-slat/index.js +2 -21
  63. package/dist/esm/components/mui-slat/slat/index.js +139 -0
  64. package/dist/esm/components/mui-smart-card/index.js +14 -15
  65. package/dist/esm/components/mui-stack/hstack/index.js +1 -1
  66. package/dist/esm/components/mui-stack/vstack/index.js +1 -1
  67. package/dist/esm/components/mui-switch/index.js +3 -9
  68. package/dist/esm/components/mui-table/cell/index.js +16 -14
  69. package/dist/esm/components/mui-table/row/index.js +1 -1
  70. package/dist/esm/components/mui-table/row-group/index.js +1 -1
  71. package/dist/esm/components/mui-table/table/index.js +1 -1
  72. package/dist/esm/components/mui-tabs/controller/index.js +1 -1
  73. package/dist/esm/components/mui-tabs/item/index.js +2 -2
  74. package/dist/esm/components/mui-tabs/panel/index.js +1 -1
  75. package/dist/esm/components/mui-tabs/tab-bar/index.js +1 -1
  76. package/dist/esm/css/mui-tokens.css +74 -38
  77. package/dist/esm/index.js +8 -5
  78. package/dist/types/components/mui-accordion/block/index.d.ts +1 -1
  79. package/dist/types/components/mui-accordion/inline/index.d.ts +1 -1
  80. package/dist/types/components/mui-alert/index.d.ts +5 -1
  81. package/dist/types/components/mui-field/index.d.ts +3 -1
  82. package/dist/types/components/mui-file-upload/index.d.ts +1 -1
  83. package/dist/types/components/mui-icons/down-arrow-circle.d.ts +1 -0
  84. package/dist/types/components/mui-icons/ellipsis.d.ts +1 -0
  85. package/dist/types/components/mui-icons/index.d.ts +2 -0
  86. package/dist/types/components/mui-message/index.d.ts +6 -1
  87. package/dist/types/components/mui-select/index.d.ts +1 -1
  88. package/dist/types/components/mui-slat/accessory/index.d.ts +1 -0
  89. package/dist/types/components/mui-slat/index.d.ts +2 -1
  90. package/dist/types/components/mui-slat/slat/index.d.ts +3 -0
  91. package/dist/types/components/mui-smart-card/index.d.ts +2 -1
  92. package/dist/types/index.d.ts +4 -1
  93. package/package.json +17 -1
  94. package/readme.md +25 -6
@@ -8,19 +8,19 @@ class r extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, o) {
12
- (e === "size" || e === "color") && t !== o && this.render();
11
+ attributeChangedCallback(e, t, i) {
12
+ (e === "size" || e === "color") && t !== i && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", i = {
18
+ }[t] || t || "var(--icon-color-default)", o = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, s = i[e] ?? i.small;
23
+ }, s = o[e] ?? o.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-add", r);
55
+ customElements.get("mui-icon-add") || customElements.define("mui-icon-add", r);
@@ -8,19 +8,19 @@ class c extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, o) {
12
- (e === "size" || e === "color") && t !== o && this.render();
11
+ attributeChangedCallback(e, t, i) {
12
+ (e === "size" || e === "color") && t !== i && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", i = {
18
+ }[t] || t || "var(--icon-color-default)", o = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, s = i[e] ?? i.small;
23
+ }, s = o[e] ?? o.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
@@ -52,4 +52,4 @@ class c extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-attention", c);
55
+ customElements.get("mui-icon-attention") || customElements.define("mui-icon-attention", c);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class c extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -8,19 +8,19 @@ class r extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, o) {
12
- (e === "size" || e === "color") && t !== o && this.render();
11
+ attributeChangedCallback(e, t, i) {
12
+ (e === "size" || e === "color") && t !== i && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", i = {
18
+ }[t] || t || "var(--icon-color-default)", o = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, s = i[e] ?? i.small;
23
+ }, s = o[e] ?? o.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-check", r);
55
+ customElements.get("mui-icon-check") || customElements.define("mui-icon-check", c);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class c extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-close", r);
55
+ customElements.get("mui-icon-close") || customElements.define("mui-icon-close", c);
@@ -0,0 +1,55 @@
1
+ class l extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["size", "color"];
4
+ }
5
+ constructor() {
6
+ super(), this.attachShadow({ mode: "open" });
7
+ }
8
+ connectedCallback() {
9
+ this.render();
10
+ }
11
+ attributeChangedCallback(e, t, o) {
12
+ (e === "size" || e === "color") && t !== o && this.render();
13
+ }
14
+ render() {
15
+ const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), r = t && {
16
+ default: "var(--icon-color-default)",
17
+ inverted: "var(--icon-color-inverted)"
18
+ }[t] || t || "var(--icon-color-default)", i = {
19
+ "x-small": "1.6rem",
20
+ small: "2.4rem",
21
+ medium: "3.6rem",
22
+ large: "4.8rem"
23
+ }, s = i[e] ?? i.small;
24
+ this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ width: ${s};
29
+ height: ${s};
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ fill: ${r};
34
+ }
35
+ svg {
36
+ width: 100%;
37
+ display: block;
38
+ fill: inherit;
39
+ }
40
+ </style>
41
+
42
+ <svg
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ viewBox="0 0 36 36"
45
+ >
46
+ <path
47
+ d="M17.992 35.5C8.65 35.5 1 27.85 1 18.508S8.65 1.5 17.992 1.5 35 9.166 35 18.508 27.334 35.5 17.992 35.5m0-4.932c6.686 0 12.06-5.39 12.06-12.06 0-6.686-5.39-12.06-12.06-12.06s-12.06 5.374-12.06 12.06c0 6.67 5.39 12.06 12.06 12.06m0-20.327c1.186 0 2.102.806 2.102 1.928v6.07l-.205 2.972.948-1.439 1.423-1.643c.3-.364.806-.585 1.312-.585 1.027 0 1.754.695 1.754 1.66 0 .553-.142.932-.553 1.375l-5.042 5.374c-.459.506-1.028.759-1.739.759-.695 0-1.249-.253-1.723-.76l-5.042-5.373c-.411-.443-.553-.822-.553-1.376 0-.964.71-1.66 1.754-1.66.522 0 1.012.222 1.312.585l1.438 1.692.933 1.39-.205-2.97v-6.07c0-1.123.916-1.929 2.086-1.929"
48
+ ></path>
49
+ </svg>
50
+
51
+
52
+ `);
53
+ }
54
+ }
55
+ customElements.get("mui-icon-down-arrow-circle") || customElements.define("mui-icon-down-arrow-circle", l);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class n extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-down-chevron", r);
55
+ customElements.get("mui-icon-down-chevron") || customElements.define("mui-icon-down-chevron", n);
@@ -0,0 +1,55 @@
1
+ class r extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["size", "color"];
4
+ }
5
+ constructor() {
6
+ super(), this.attachShadow({ mode: "open" });
7
+ }
8
+ connectedCallback() {
9
+ this.render();
10
+ }
11
+ attributeChangedCallback(e, t, s) {
12
+ (e === "size" || e === "color") && t !== s && this.render();
13
+ }
14
+ render() {
15
+ const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
+ default: "var(--icon-color-default)",
17
+ inverted: "var(--icon-color-inverted)"
18
+ }[t] || t || "var(--icon-color-default)", i = {
19
+ "x-small": "1.6rem",
20
+ small: "2.4rem",
21
+ medium: "3.6rem",
22
+ large: "4.8rem"
23
+ }, o = i[e] ?? i.small;
24
+ this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ width: ${o};
29
+ height: ${o};
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ fill: ${l};
34
+ }
35
+ svg {
36
+ width: 100%;
37
+ display: block;
38
+ fill: inherit;
39
+ }
40
+ </style>
41
+
42
+ <svg
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ viewBox="0 0 36 36"
45
+ >
46
+ <path
47
+ d="M6.916 21.5c-1.987 0-3.615-1.559-3.615-3.493S4.929 14.5 6.916 14.5c2.002 0 3.63 1.573 3.63 3.507S8.919 21.5 6.917 21.5m11.385 0c-2.002 0-3.616-1.559-3.616-3.493S16.3 14.5 18.301 14.5s3.63 1.573 3.63 3.507-1.628 3.493-3.63 3.493m11.384 0c-2.002 0-3.63-1.559-3.63-3.493s1.628-3.507 3.63-3.507c1.987 0 3.616 1.573 3.616 3.507S31.672 21.5 29.685 21.5"
48
+ ></path>
49
+ </svg>
50
+
51
+
52
+ `);
53
+ }
54
+ }
55
+ customElements.get("mui-icon-ellipsis") || customElements.define("mui-icon-ellipsis", r);
@@ -8,19 +8,19 @@ class a extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, c) {
12
- (e === "size" || e === "color") && t !== c && this.render();
11
+ attributeChangedCallback(e, t, o) {
12
+ (e === "size" || e === "color") && t !== o && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), s = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", o = {
18
+ }[t] || t || "var(--icon-color-default)", c = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, i = o[e] ?? o.small;
23
+ }, i = c[e] ?? c.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
@@ -52,4 +52,4 @@ class a extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-globe", a);
55
+ customElements.get("mui-icon-globe") || customElements.define("mui-icon-globe", a);
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-grid", r);
55
+ customElements.get("mui-icon-grid") || customElements.define("mui-icon-grid", r);
@@ -22,3 +22,5 @@ import "./toggle/index.js";
22
22
  import "./up-arrow/index.js";
23
23
  import "./up-chevron/index.js";
24
24
  import "./warning/index.js";
25
+ import "./down-arrow-circle/index.js";
26
+ import "./ellipsis/index.js";
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class c extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-info", r);
55
+ customElements.get("mui-icon-info") || customElements.define("mui-icon-info", c);
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-left-arrow", r);
55
+ customElements.get("mui-icon-left-arrow") || customElements.define("mui-icon-left-arrow", r);
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-left-chevron", r);
55
+ customElements.get("mui-icon-left-chevron") || customElements.define("mui-icon-left-chevron", r);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class l extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -15,18 +15,18 @@ class r extends HTMLElement {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), c = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", o = {
18
+ }[t] || t || "var(--icon-color-default)", s = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, s = o[e] ?? o.small;
23
+ }, o = s[e] ?? s.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
27
27
  :host {
28
- width: ${s};
29
- height: ${s};
28
+ width: ${o};
29
+ height: ${o};
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-left-sidebar", r);
55
+ customElements.get("mui-icon-left-sidebar") || customElements.define("mui-icon-left-sidebar", l);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class n extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -15,18 +15,18 @@ class r extends HTMLElement {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), l = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", o = {
18
+ }[t] || t || "var(--icon-color-default)", i = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, i = o[e] ?? o.small;
23
+ }, o = i[e] ?? i.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
27
27
  :host {
28
- width: ${i};
29
- height: ${i};
28
+ width: ${o};
29
+ height: ${o};
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-menu", r);
55
+ customElements.get("mui-icon-menu") || customElements.define("mui-icon-menu", n);
@@ -12,7 +12,7 @@ class l extends HTMLElement {
12
12
  (t === "size" || t === "color") && e !== c && this.render();
13
13
  }
14
14
  render() {
15
- const t = this.getAttribute("size") || "small", e = this.getAttribute("color"), i = e && {
15
+ const t = this.getAttribute("size") || "small", e = this.getAttribute("color"), o = e && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
18
  }[e] || e || "var(--icon-color-default)", s = {
@@ -20,17 +20,17 @@ class l extends HTMLElement {
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, o = s[t] ?? s.small;
23
+ }, i = s[t] ?? s.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
27
27
  :host {
28
- width: ${o};
29
- height: ${o};
28
+ width: ${i};
29
+ height: ${i};
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
33
- fill: ${i};
33
+ fill: ${o};
34
34
  }
35
35
  svg {
36
36
  width: 100%;
@@ -52,4 +52,4 @@ class l extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-message", l);
55
+ customElements.get("mui-icon-message") || customElements.define("mui-icon-message", l);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class n extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-moon", r);
55
+ customElements.get("mui-icon-moon") || customElements.define("mui-icon-moon", n);
@@ -1,4 +1,4 @@
1
- class l extends HTMLElement {
1
+ class n extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class l extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-notification", l);
55
+ customElements.get("mui-icon-notification") || customElements.define("mui-icon-notification", n);
@@ -8,19 +8,19 @@ class l extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, o) {
12
- (e === "size" || e === "color") && t !== o && this.render();
11
+ attributeChangedCallback(e, t, i) {
12
+ (e === "size" || e === "color") && t !== i && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), r = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", i = {
18
+ }[t] || t || "var(--icon-color-default)", o = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, s = i[e] ?? i.small;
23
+ }, s = o[e] ?? o.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
@@ -52,4 +52,4 @@ class l extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-right-chevron", l);
55
+ customElements.get("mui-icon-right-chevron") || customElements.define("mui-icon-right-chevron", l);
@@ -1,4 +1,4 @@
1
- class r extends HTMLElement {
1
+ class c extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["size", "color"];
4
4
  }
@@ -52,4 +52,4 @@ class r extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-stop", r);
55
+ customElements.get("mui-icon-stop") || customElements.define("mui-icon-stop", c);
@@ -8,25 +8,25 @@ class l extends HTMLElement {
8
8
  connectedCallback() {
9
9
  this.render();
10
10
  }
11
- attributeChangedCallback(e, t, o) {
12
- (e === "size" || e === "color") && t !== o && this.render();
11
+ attributeChangedCallback(e, t, s) {
12
+ (e === "size" || e === "color") && t !== s && this.render();
13
13
  }
14
14
  render() {
15
15
  const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), r = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
- }[t] || t || "var(--icon-color-default)", s = {
18
+ }[t] || t || "var(--icon-color-default)", i = {
19
19
  "x-small": "1.6rem",
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, i = s[e] ?? s.small;
23
+ }, o = i[e] ?? i.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
27
27
  :host {
28
- width: ${i};
29
- height: ${i};
28
+ width: ${o};
29
+ height: ${o};
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
@@ -52,4 +52,4 @@ class l extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-subtract", l);
55
+ customElements.get("mui-icon-subtract") || customElements.define("mui-icon-subtract", l);
@@ -12,7 +12,7 @@ class l extends HTMLElement {
12
12
  (e === "size" || e === "color") && t !== c && this.render();
13
13
  }
14
14
  render() {
15
- const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), i = t && {
15
+ const e = this.getAttribute("size") || "small", t = this.getAttribute("color"), o = t && {
16
16
  default: "var(--icon-color-default)",
17
17
  inverted: "var(--icon-color-inverted)"
18
18
  }[t] || t || "var(--icon-color-default)", s = {
@@ -20,17 +20,17 @@ class l extends HTMLElement {
20
20
  small: "2.4rem",
21
21
  medium: "3.6rem",
22
22
  large: "4.8rem"
23
- }, o = s[e] ?? s.small;
23
+ }, i = s[e] ?? s.small;
24
24
  this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
25
25
  `
26
26
  <style>
27
27
  :host {
28
- width: ${o};
29
- height: ${o};
28
+ width: ${i};
29
+ height: ${i};
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
33
- fill: ${i};
33
+ fill: ${o};
34
34
  }
35
35
  svg {
36
36
  width: 100%;
@@ -52,4 +52,4 @@ class l extends HTMLElement {
52
52
  `);
53
53
  }
54
54
  }
55
- customElements.define("mui-icon-sun", l);
55
+ customElements.get("mui-icon-sun") || customElements.define("mui-icon-sun", l);
@@ -1,39 +1,55 @@
1
- class s extends HTMLElement {
1
+ class o extends HTMLElement {
2
2
  static get observedAttributes() {
3
- return ["variant"];
3
+ return ["toggle", "rotate"];
4
4
  }
5
5
  constructor() {
6
- super(), this.attachShadow({ mode: "open" }), this.addEventListener("click", () => {
7
- if (this.toggleAttribute("toggle"), !this.shadowRoot) return;
8
- const t = this.shadowRoot.querySelector("mui-button");
9
- t && (t.blur(), requestAnimationFrame(() => {
10
- t.focus({ preventScroll: !0 });
11
- }));
12
- }), this.addEventListener("keydown", (t) => {
13
- t.code === "Space" && (t.preventDefault(), this.click());
14
- });
6
+ super(), this.attachShadow({ mode: "open" });
15
7
  }
16
8
  connectedCallback() {
17
- this.hasAttribute("variant") || this.setAttribute("variant", "primary"), this.render();
9
+ this.classList.add("mui-icon"), this.shadowRoot.innerHTML || this.render(), this.applySmallSize();
10
+ const t = this.shadowRoot.querySelector('slot[name="start"]'), e = this.shadowRoot.querySelector('slot[name="end"]');
11
+ t.addEventListener("slotchange", () => this.applySmallSize()), e.addEventListener("slotchange", () => this.applySmallSize());
12
+ }
13
+ attributeChangedCallback() {
14
+ }
15
+ get toggle() {
16
+ return this.hasAttribute("toggle");
17
+ }
18
+ set toggle(t) {
19
+ this.toggleAttribute("toggle", !!t);
20
+ }
21
+ get rotate() {
22
+ return this.hasAttribute("rotate");
18
23
  }
19
- attributeChangedCallback(t, e, o) {
20
- t === "variant" && e !== o && this.render();
24
+ set rotate(t) {
25
+ this.toggleAttribute("rotate", !!t);
26
+ }
27
+ /* ------------------------------------------------------------------ */
28
+ /* PRIVATE: force size="small" on all assigned elements */
29
+ /* ------------------------------------------------------------------ */
30
+ applySmallSize() {
31
+ this.shadowRoot.querySelectorAll("slot").forEach((e) => {
32
+ e.assignedElements({ flatten: !0 }).forEach((s) => {
33
+ s.setAttribute("size", "small");
34
+ });
35
+ });
21
36
  }
22
37
  render() {
23
- const t = this.getAttribute("variant") || "primary";
24
- this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
38
+ this.shadowRoot.innerHTML = /*html*/
25
39
  `
26
40
  <style>
27
41
  :host {
28
42
  display: inline-flex;
43
+ position: relative;
44
+ height: 2.4rem;
45
+ width: 2.4rem;
29
46
  }
30
47
 
31
48
  ::slotted(*) {
32
49
  position: absolute;
33
- top: auto;
34
- left: auto;
35
50
  transform-origin: 50% 50%;
36
51
  transition: var(--speed-200) ease-in-out;
52
+ fill: currentColor;
37
53
  }
38
54
 
39
55
  ::slotted([slot="start"]) {
@@ -52,21 +68,14 @@ class s extends HTMLElement {
52
68
  transform: scale(1);
53
69
  }
54
70
 
55
- :host([rotate]) ::slotted([slot="end"]) {
56
- transform: scale(0) rotate(0deg);
57
- }
58
-
59
- :host([toggle][rotate]) ::slotted([slot="end"]) {
71
+ :host([rotate][toggle]) ::slotted([slot="end"]) {
60
72
  transform: scale(1) rotate(-360deg);
61
73
  }
62
-
63
74
  </style>
64
75
 
65
- <mui-button ${`variant="${t}"`}>
66
- <slot name="start"></slot>
67
- <slot name="end"></slot>
68
- </mui-button>
69
- `);
76
+ <slot name="start"></slot>
77
+ <slot name="end"></slot>
78
+ `;
70
79
  }
71
80
  }
72
- customElements.define("mui-icon-toggle", s);
81
+ customElements.get("mui-icon-toggle") || customElements.define("mui-icon-toggle", o);