@muibook/components 10.0.1 → 11.0.1

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 (150) hide show
  1. package/LICENSE +27 -11
  2. package/README.md +10 -4
  3. package/dist/esm/components/mui-accordion/block/index.js +9 -5
  4. package/dist/esm/components/mui-alert/index.js +88 -52
  5. package/dist/esm/components/mui-badge/index.js +61 -16
  6. package/dist/esm/components/mui-body/index.js +76 -10
  7. package/dist/esm/components/mui-button/index.js +152 -32
  8. package/dist/esm/components/mui-card/card/index.js +13 -8
  9. package/dist/esm/components/mui-checkbox/index.js +64 -30
  10. package/dist/esm/components/mui-chip/index.js +153 -33
  11. package/dist/esm/components/mui-chip-input/index.js +407 -0
  12. package/dist/esm/components/mui-code/index.js +11 -9
  13. package/dist/esm/components/mui-dialog/index.js +17 -8
  14. package/dist/esm/components/mui-dropdown/index.js +44 -44
  15. package/dist/esm/components/mui-field/index.js +56 -21
  16. package/dist/esm/components/mui-form-group/index.js +88 -0
  17. package/dist/esm/components/mui-form-hint/index.js +1 -0
  18. package/dist/esm/components/mui-form-message/index.js +72 -0
  19. package/dist/esm/components/mui-form-section/index.js +108 -0
  20. package/dist/esm/components/mui-form-section-footer/index.js +46 -0
  21. package/dist/esm/components/mui-hint/index.js +146 -0
  22. package/dist/esm/components/mui-icons/accessibility/index.js +5 -4
  23. package/dist/esm/components/mui-icons/add/index.js +1 -0
  24. package/dist/esm/components/mui-icons/ai/index.js +5 -4
  25. package/dist/esm/components/mui-icons/attention/index.js +1 -0
  26. package/dist/esm/components/mui-icons/calendar/index.js +5 -4
  27. package/dist/esm/components/mui-icons/check/index.js +6 -5
  28. package/dist/esm/components/mui-icons/checkmark/index.js +9 -8
  29. package/dist/esm/components/mui-icons/close/index.js +6 -5
  30. package/dist/esm/components/mui-icons/down-arrow-circle/index.js +9 -8
  31. package/dist/esm/components/mui-icons/down-chevron/index.js +8 -7
  32. package/dist/esm/components/mui-icons/ellipsis/index.js +1 -0
  33. package/dist/esm/components/mui-icons/exclamationmark/index.js +49 -0
  34. package/dist/esm/components/mui-icons/game-controller/index.js +8 -7
  35. package/dist/esm/components/mui-icons/gear/index.js +5 -4
  36. package/dist/esm/components/mui-icons/globe/index.js +8 -7
  37. package/dist/esm/components/mui-icons/grid/index.js +1 -0
  38. package/dist/esm/components/mui-icons/home/index.js +9 -8
  39. package/dist/esm/components/mui-icons/index.js +3 -0
  40. package/dist/esm/components/mui-icons/info/index.js +3 -2
  41. package/dist/esm/components/mui-icons/left-arrow/index.js +1 -0
  42. package/dist/esm/components/mui-icons/left-chevron/index.js +6 -5
  43. package/dist/esm/components/mui-icons/left-sidebar/index.js +6 -5
  44. package/dist/esm/components/mui-icons/list-and-film/index.js +1 -0
  45. package/dist/esm/components/mui-icons/menu/index.js +8 -7
  46. package/dist/esm/components/mui-icons/message/index.js +5 -4
  47. package/dist/esm/components/mui-icons/moon/index.js +3 -2
  48. package/dist/esm/components/mui-icons/movie-clapper/index.js +5 -4
  49. package/dist/esm/components/mui-icons/music-microphone/index.js +6 -5
  50. package/dist/esm/components/mui-icons/music-quarter-note/index.js +1 -0
  51. package/dist/esm/components/mui-icons/notification/index.js +5 -4
  52. package/dist/esm/components/mui-icons/pin/index.js +3 -2
  53. package/dist/esm/components/mui-icons/pin-slash/index.js +6 -5
  54. package/dist/esm/components/mui-icons/play-rectangle/index.js +9 -8
  55. package/dist/esm/components/mui-icons/play-stack/index.js +5 -4
  56. package/dist/esm/components/mui-icons/rectangle/index.js +6 -5
  57. package/dist/esm/components/mui-icons/rectangle-bottom-panel/index.js +1 -0
  58. package/dist/esm/components/mui-icons/rectangle-dashed/index.js +1 -0
  59. package/dist/esm/components/mui-icons/rectangle-left-drawer/index.js +1 -0
  60. package/dist/esm/components/mui-icons/rectangle-media-text/index.js +6 -5
  61. package/dist/esm/components/mui-icons/right-chevron/index.js +1 -0
  62. package/dist/esm/components/mui-icons/search/index.js +6 -5
  63. package/dist/esm/components/mui-icons/spinner/index.js +56 -0
  64. package/dist/esm/components/mui-icons/stop/index.js +3 -2
  65. package/dist/esm/components/mui-icons/subtract/index.js +1 -0
  66. package/dist/esm/components/mui-icons/sun/index.js +1 -0
  67. package/dist/esm/components/mui-icons/text-below-folder/index.js +55 -0
  68. package/dist/esm/components/mui-icons/toggle/index.js +8 -6
  69. package/dist/esm/components/mui-icons/translate/index.js +5 -4
  70. package/dist/esm/components/mui-icons/up-arrow/index.js +5 -4
  71. package/dist/esm/components/mui-icons/up-chevron/index.js +6 -5
  72. package/dist/esm/components/mui-icons/warning/index.js +7 -6
  73. package/dist/esm/components/mui-input/index.js +298 -47
  74. package/dist/esm/components/mui-link/index.js +187 -59
  75. package/dist/esm/components/mui-list/item/index.js +3 -0
  76. package/dist/esm/components/mui-markdown/index.js +149 -0
  77. package/dist/esm/components/mui-media-player/index.js +184 -0
  78. package/dist/esm/components/mui-message/index.js +50 -20
  79. package/dist/esm/components/mui-progress/index.js +15 -15
  80. package/dist/esm/components/mui-prompt/index.js +1461 -0
  81. package/dist/esm/components/mui-prompt-message/index.js +114 -0
  82. package/dist/esm/components/mui-prompt-preview/index.js +497 -0
  83. package/dist/esm/components/mui-prompt-toggle/index.js +48 -0
  84. package/dist/esm/components/mui-radio/index.js +155 -0
  85. package/dist/esm/components/mui-radio-group/index.js +104 -0
  86. package/dist/esm/components/mui-range-input/index.js +122 -0
  87. package/dist/esm/components/mui-rule/index.js +11 -3
  88. package/dist/esm/components/mui-select/index.js +89 -30
  89. package/dist/esm/components/mui-spinner/index.js +70 -0
  90. package/dist/esm/components/mui-stepper/step/index.js +255 -18
  91. package/dist/esm/components/mui-stepper/stepper/index.js +68 -72
  92. package/dist/esm/components/mui-table/row/index.js +16 -3
  93. package/dist/esm/components/mui-tabs/controller/index.js +21 -14
  94. package/dist/esm/components/mui-tabs/item/index.js +285 -29
  95. package/dist/esm/components/mui-tabs/panel/index.js +3 -0
  96. package/dist/esm/components/mui-tabs/tab-bar/index.js +85 -34
  97. package/dist/esm/components/mui-textarea/index.js +257 -0
  98. package/dist/esm/css/mui-base.css +27 -0
  99. package/dist/esm/css/mui-brand.css +3 -1
  100. package/dist/esm/css/mui-tokens.css +234 -7
  101. package/dist/esm/custom-elements.json +5202 -1791
  102. package/dist/esm/index.js +24 -4
  103. package/dist/esm/tokens/js/index.js +107 -105
  104. package/dist/types/components/mui-agent-bubble/doc.d.ts +2 -0
  105. package/dist/types/components/mui-agent-bubble/index.d.ts +1 -0
  106. package/dist/types/components/mui-agent-prompt/doc.d.ts +2 -0
  107. package/dist/types/components/mui-agent-prompt/index.d.ts +1 -0
  108. package/dist/types/components/mui-chip-input/doc.d.ts +2 -0
  109. package/dist/types/components/mui-chip-input/index.d.ts +3 -0
  110. package/dist/types/components/mui-form-group/doc.d.ts +2 -0
  111. package/dist/types/components/mui-form-group/index.d.ts +2 -0
  112. package/dist/types/components/mui-form-group-horizontal/index.d.ts +1 -0
  113. package/dist/types/components/mui-form-hint/doc.d.ts +2 -0
  114. package/dist/types/components/mui-form-hint/index.d.ts +1 -0
  115. package/dist/types/components/mui-form-message/index.d.ts +2 -0
  116. package/dist/types/components/mui-form-section/doc.d.ts +2 -0
  117. package/dist/types/components/mui-form-section/index.d.ts +1 -0
  118. package/dist/types/components/mui-form-section-footer/doc.d.ts +2 -0
  119. package/dist/types/components/mui-form-section-footer/index.d.ts +1 -0
  120. package/dist/types/components/mui-hint/doc.d.ts +2 -0
  121. package/dist/types/components/mui-hint/index.d.ts +1 -0
  122. package/dist/types/components/mui-icons/exclamationmark.d.ts +1 -0
  123. package/dist/types/components/mui-icons/index.d.ts +3 -0
  124. package/dist/types/components/mui-icons/spinner.d.ts +1 -0
  125. package/dist/types/components/mui-icons/text-below-folder.d.ts +1 -0
  126. package/dist/types/components/mui-markdown/doc.d.ts +2 -0
  127. package/dist/types/components/mui-markdown/index.d.ts +1 -0
  128. package/dist/types/components/mui-media-player/doc.d.ts +2 -0
  129. package/dist/types/components/mui-media-player/index.d.ts +8 -0
  130. package/dist/types/components/mui-prompt/doc.d.ts +2 -0
  131. package/dist/types/components/mui-prompt/index.d.ts +18 -0
  132. package/dist/types/components/mui-prompt-chip/index.d.ts +1 -0
  133. package/dist/types/components/mui-prompt-message/doc.d.ts +2 -0
  134. package/dist/types/components/mui-prompt-message/index.d.ts +1 -0
  135. package/dist/types/components/mui-prompt-preview/doc.d.ts +2 -0
  136. package/dist/types/components/mui-prompt-preview/index.d.ts +7 -0
  137. package/dist/types/components/mui-prompt-toggle/index.d.ts +1 -0
  138. package/dist/types/components/mui-radio/doc.d.ts +2 -0
  139. package/dist/types/components/mui-radio/index.d.ts +1 -0
  140. package/dist/types/components/mui-radio-group/index.d.ts +1 -0
  141. package/dist/types/components/mui-range-input/doc.d.ts +2 -0
  142. package/dist/types/components/mui-range-input/index.d.ts +1 -0
  143. package/dist/types/components/mui-spinner/doc.d.ts +2 -0
  144. package/dist/types/components/mui-spinner/index.d.ts +1 -0
  145. package/dist/types/components/mui-stepper/step/index.d.ts +4 -1
  146. package/dist/types/components/mui-textarea/doc.d.ts +2 -0
  147. package/dist/types/components/mui-textarea/index.d.ts +1 -0
  148. package/dist/types/index.d.ts +21 -0
  149. package/dist/types/tokens/js/index.d.ts +2 -0
  150. package/package.json +91 -1
@@ -0,0 +1,70 @@
1
+ import "../mui-icons/spinner/index.js";
2
+ class o extends HTMLElement {
3
+ static get observedAttributes() {
4
+ return ["size", "color", "duration", "label"];
5
+ }
6
+ constructor() {
7
+ super(), this.attachShadow({ mode: "open" });
8
+ }
9
+ connectedCallback() {
10
+ this.hasAttribute("size") || this.setAttribute("size", "medium"), this.hasAttribute("duration") || this.setAttribute("duration", "0.8s"), this.hasAttribute("color") || this.setAttribute("color", "default"), this.render();
11
+ }
12
+ attributeChangedCallback(t, e, i) {
13
+ e !== i && this.render();
14
+ }
15
+ render() {
16
+ if (!this.shadowRoot) return;
17
+ const t = this.getAttribute("size") || "medium", e = this.getAttribute("duration") || "0.8s", i = this.getAttribute("color") || "default", s = this.getAttribute("label") || "Loading", n = {
18
+ "xx-small": "1.3rem",
19
+ "x-small": "1.6rem",
20
+ small: "2.1rem",
21
+ medium: "2.4rem",
22
+ large: "2.8rem"
23
+ }, r = n[t] || n.medium;
24
+ this.shadowRoot.innerHTML = /*html*/
25
+ `
26
+ <style>
27
+ :host {
28
+ display: inline-flex;
29
+ width: ${r};
30
+ height: ${r};
31
+ align-items: center;
32
+ justify-content: center;
33
+ }
34
+ .spinner {
35
+ width: 100%;
36
+ height: 100%;
37
+ animation: spin ${e} linear infinite;
38
+ box-sizing: border-box;
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ }
43
+ .vh {
44
+ position: absolute;
45
+ width: 1px;
46
+ height: 1px;
47
+ margin: -1px;
48
+ padding: 0;
49
+ overflow: hidden;
50
+ clip: rect(0 0 0 0);
51
+ white-space: nowrap;
52
+ border: 0;
53
+ }
54
+ @keyframes spin {
55
+ to { transform: rotate(360deg); }
56
+ }
57
+ @media (prefers-reduced-motion: reduce) {
58
+ .spinner {
59
+ animation-duration: 1.6s;
60
+ }
61
+ }
62
+ </style>
63
+ <span class="vh">${s}</span>
64
+ <span class="spinner" role="status" aria-label="${s}">
65
+ <mui-icon-spinner size="${t}" color="${i}"></mui-icon-spinner>
66
+ </span>
67
+ `;
68
+ }
69
+ }
70
+ customElements.get("mui-spinner") || customElements.define("mui-spinner", o);
@@ -1,6 +1,10 @@
1
- class s extends HTMLElement {
1
+ import "../../mui-body/index.js";
2
+ import "../../mui-icons/checkmark/index.js";
3
+ import "../../mui-icons/exclamationmark/index.js";
4
+ import "../../mui-icons/notification/index.js";
5
+ class g extends HTMLElement {
2
6
  static get observedAttributes() {
3
- return ["state", "title", "direction"];
7
+ return ["state", "resolved-state", "title", "direction", "hide-icon", "size"];
4
8
  }
5
9
  constructor() {
6
10
  super(), this.attachShadow({ mode: "open" });
@@ -13,30 +17,39 @@ class s extends HTMLElement {
13
17
  }
14
18
  render() {
15
19
  if (!this.shadowRoot) return;
16
- const o = this.getAttribute("state") || "upcoming", t = this.getAttribute("direction") || "horizontal", n = this.getAttribute("title") || "", i = `
20
+ const o = this.getAttribute("resolved-state") || this.getAttribute("state") || "upcoming", r = this.getAttribute("direction") || "horizontal", a = this.getAttribute("size"), t = a === "x-small" || a === "small" ? a : "medium", c = this.getAttribute("title") || "", l = this.hasAttribute("hide-icon"), d = o === "active" || o === "error" || o === "pending", s = t === "x-small" ? "xx-small" : t === "small" ? "x-small" : "small", p = t === "medium" ? "small" : "x-small", v = {
21
+ success: `<mui-icon-checkmark class="dot-icon" size="${s}" color="var(--stepper-icon-color)"></mui-icon-checkmark>`,
22
+ completed: `<mui-icon-checkmark class="dot-icon" size="${s}" color="var(--stepper-icon-color)"></mui-icon-checkmark>`,
23
+ active: `<mui-icon-notification class="dot-icon" size="${s}" color="var(--stepper-icon-color)"></mui-icon-notification>`,
24
+ error: `<mui-icon-exclamationmark class="dot-icon" size="${s}" color="var(--stepper-icon-color)"></mui-icon-exclamationmark>`,
25
+ pending: `<mui-icon-exclamationmark class="dot-icon" size="${s}" color="var(--stepper-icon-color)"></mui-icon-exclamationmark>`,
26
+ disabled: ""
27
+ }, i = `
17
28
  <div class="content">
18
29
  <mui-body
19
- size="small"
20
- ${o === "active" ? "weight='bold'" : ""}
30
+ size="${p}"
31
+ ${d ? "weight='bold'" : ""}
21
32
  class="${o === "active" ? "active" : ""}"
22
33
  >
23
- ${n}
34
+ ${c}
24
35
  </mui-body>
25
36
  <slot name="secondary"></slot>
26
37
  </div>
27
- `, r = `
38
+ `, n = `
28
39
  <div class="dotwrapper">
29
- <div class="dot ${o}"></div>
30
- ${t === "horizontal" ? `<div class="line before ${t}"></div><div class="line after ${t}"></div>` : ""}
40
+ <div class="dot ${o}">
41
+ ${l ? "" : v[o] || ""}
42
+ </div>
43
+ ${r === "horizontal" ? `<div class="line before ${r}"></div><div class="line after ${r}"></div>` : ""}
31
44
  </div>
32
- `, a = t === "horizontal" ? i + r : r + i, e = " 1.8rem";
45
+ `, b = r === "horizontal" ? i + n : n + i, e = t === "x-small" ? "var(--stepper-dot-size-x-small)" : t === "small" ? "var(--stepper-dot-size-small)" : "var(--stepper-dot-size)";
33
46
  this.shadowRoot.innerHTML = /*html*/
34
47
  `
35
48
  <style>
36
49
  :host {
37
50
  display: flex;
38
- flex-direction: ${t === "horizontal" ? "column" : "row"};
39
- align-items: ${t === "horizontal" ? "center" : "flex-start"};
51
+ flex-direction: ${r === "horizontal" ? "column" : "row"};
52
+ align-items: ${r === "horizontal" ? "center" : "flex-start"};
40
53
  flex: 1;
41
54
  }
42
55
 
@@ -45,30 +58,147 @@ class s extends HTMLElement {
45
58
  display: flex;
46
59
  align-items: center;
47
60
  justify-content: center; /* keeps dot centered */
48
- width: ${t === "horizontal" ? "100%" : "auto"};
61
+ width: ${r === "horizontal" ? "100%" : "auto"};
49
62
  }
50
63
 
51
64
  /* .dot stays unchanged */
52
65
  .dot {
53
66
  width: ${e};
54
67
  height: ${e};
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
55
71
  border-radius: 50%;
56
72
  box-shadow: inset 0 0 0 var(--stroke-size-200) var(--stepper-border-color);
57
- background: var(--stepper-background-inactive);
73
+ background: var(--stepper-dot-background, var(--surface-elevated-200));
58
74
  z-index: 1;
59
75
  }
60
76
 
61
77
  .dot.completed {
62
78
  background: var(--stepper-background-active);
79
+ box-shadow: inset 0 0 0 var(--stroke-size-200) var(--stepper-background-active);
80
+ }
81
+ .dot.success {
82
+ background: var(--stepper-success-color);
83
+ box-shadow: inset 0 0 0 var(--stroke-size-200) var(--stepper-success-color);
63
84
  }
64
85
  .dot.active {
65
86
  background: var(--stepper-background-active);
66
87
  }
88
+ .dot.error {
89
+ background: var(--stepper-error-color);
90
+ box-shadow: inset 0 0 0 var(--stroke-size-200) var(--stepper-error-color);
91
+ }
92
+ .dot-icon {
93
+ display: block;
94
+ line-height: 1;
95
+ }
96
+ .dot.disabled {
97
+ opacity: 1;
98
+ box-shadow: inset 0 0 0 var(--stroke-size-200)
99
+ color-mix(in srgb, var(--stepper-disabled-color) 70%, transparent 30%);
100
+ }
101
+ .dot.pending {
102
+ position: relative;
103
+ overflow: visible;
104
+ background: var(--stepper-warning-color);
105
+ box-shadow: inset 0 0 0 var(--stroke-size-200) var(--stepper-warning-color);
106
+ }
107
+ .dot.pending::after {
108
+ content: "";
109
+ position: absolute;
110
+ inset: 0;
111
+ border-radius: 50%;
112
+ background: var(--stepper-warning-color);
113
+ filter: blur(var(--stroke-size-300));
114
+ opacity: 0.1;
115
+ transform: scale(1);
116
+ animation: pending-blur-pulse var(--speed-500) ease-in-out infinite;
117
+ pointer-events: none;
118
+ z-index: -1;
119
+ }
120
+ .dot.pending .dot-icon {
121
+ filter: drop-shadow(0 0 var(--stroke-size-200) color-mix(in srgb, var(--stepper-warning-color) 60%, transparent 40%));
122
+ }
123
+ .dot.error .dot-icon {
124
+ filter: drop-shadow(0 0 var(--stroke-size-200) color-mix(in srgb, var(--stepper-error-color) 60%, transparent 40%));
125
+ }
67
126
 
68
127
  .line {
69
128
  position: absolute;
70
129
  background: var(--stepper-color);
71
130
  }
131
+ :host([resolved-state="completed"]) .line.before,
132
+ :host([resolved-state="completed"]) .line.after,
133
+ :host([resolved-state="active"]) .line.before {
134
+ background: var(--stepper-background-active);
135
+ }
136
+ :host([resolved-state="error"]) .line.before,
137
+ :host([resolved-state="error"]) .line.after {
138
+ background: var(--stepper-error-color);
139
+ }
140
+ :host([resolved-state="success"]) .line.before,
141
+ :host([resolved-state="success"]) .line.after {
142
+ background: var(--stepper-success-color);
143
+ }
144
+ :host([resolved-state="pending"]) .line.before,
145
+ :host([resolved-state="pending"]) .line.after {
146
+ background: var(--stepper-warning-color);
147
+ }
148
+ :host([resolved-state="error"]) .line.before.horizontal {
149
+ background: linear-gradient(90deg, var(--stepper-background-active) 0%, var(--stepper-error-color) 70%, var(--stepper-error-color) 100%);
150
+ }
151
+ :host([resolved-state="success"]) .line.before.horizontal {
152
+ background: linear-gradient(90deg, var(--stepper-background-active) 0%, var(--stepper-success-color) 70%, var(--stepper-success-color) 100%);
153
+ }
154
+ :host([resolved-state="pending"]) .line.before.horizontal {
155
+ background: linear-gradient(
156
+ 90deg,
157
+ var(--stepper-background-active) 0%,
158
+ var(--stepper-warning-color) 70%,
159
+ var(--stepper-warning-color) 100%
160
+ );
161
+ }
162
+ :host([resolved-state="disabled"]) .line.before.horizontal {
163
+ background: linear-gradient(
164
+ 90deg,
165
+ var(--stepper-background-active) 0%,
166
+ var(--stepper-disabled-color) 70%,
167
+ var(--stepper-disabled-color) 100%
168
+ );
169
+ }
170
+ :host([resolved-state="error"]) .line.after.horizontal {
171
+ background: linear-gradient(
172
+ 90deg,
173
+ var(--stepper-error-color) 0%,
174
+ color-mix(in srgb, var(--stepper-error-color) 55%, var(--stepper-color) 45%) 40%,
175
+ var(--stepper-color) 100%
176
+ );
177
+ }
178
+ :host([resolved-state="success"]) .line.after.horizontal {
179
+ background: linear-gradient(
180
+ 90deg,
181
+ var(--stepper-success-color) 0%,
182
+ color-mix(in srgb, var(--stepper-success-color) 55%, var(--stepper-color) 45%) 40%,
183
+ var(--stepper-color) 100%
184
+ );
185
+ }
186
+ :host([resolved-state="pending"]) .line.after.horizontal {
187
+ background: linear-gradient(
188
+ 90deg,
189
+ var(--stepper-warning-color) 0%,
190
+ color-mix(in srgb, var(--stepper-warning-color) 55%, var(--stepper-color) 45%) 40%,
191
+ var(--stepper-color) 100%
192
+ );
193
+ }
194
+ :host([resolved-state="disabled"]) .line.after.horizontal {
195
+ background: linear-gradient(
196
+ 90deg,
197
+ var(--stepper-disabled-color) 0%,
198
+ color-mix(in srgb, var(--stepper-disabled-color) 55%, var(--stepper-color) 45%) 40%,
199
+ var(--stepper-color) 100%
200
+ );
201
+ }
72
202
 
73
203
  .line.before.horizontal {
74
204
  top: 50%;
@@ -103,6 +233,12 @@ class s extends HTMLElement {
103
233
  align-items: center;
104
234
  text-align: center;
105
235
  }
236
+ :host([size="small"][direction="horizontal"]) .content {
237
+ margin-bottom: var(--space-100);
238
+ }
239
+ :host([size="x-small"][direction="horizontal"]) .content {
240
+ margin-bottom: var(--space-050);
241
+ }
106
242
 
107
243
  :host([direction="vertical"]) .content {
108
244
  margin-left: calc( -1 * ((${e} / 2) + var(--stroke-size-100)));
@@ -124,6 +260,38 @@ class s extends HTMLElement {
124
260
  bottom: calc(-1 * var(--stroke-size-100));
125
261
 
126
262
  }
263
+ :host([direction="vertical"][resolved-state="error"]) .content:before {
264
+ background: linear-gradient(
265
+ 180deg,
266
+ var(--stepper-error-color) 0%,
267
+ color-mix(in srgb, var(--stepper-error-color) 60%, var(--stepper-border-color) 40%) 45%,
268
+ var(--stepper-border-color) 100%
269
+ );
270
+ }
271
+ :host([direction="vertical"][resolved-state="success"]) .content:before {
272
+ background: linear-gradient(
273
+ 180deg,
274
+ var(--stepper-success-color) 0%,
275
+ color-mix(in srgb, var(--stepper-success-color) 60%, var(--stepper-border-color) 40%) 45%,
276
+ var(--stepper-border-color) 100%
277
+ );
278
+ }
279
+ :host([direction="vertical"][resolved-state="pending"]) .content:before {
280
+ background: linear-gradient(
281
+ 180deg,
282
+ var(--stepper-warning-color) 0%,
283
+ color-mix(in srgb, var(--stepper-warning-color) 60%, var(--stepper-border-color) 40%) 45%,
284
+ var(--stepper-border-color) 100%
285
+ );
286
+ }
287
+ :host([direction="vertical"][resolved-state="disabled"]) .content:before {
288
+ background: linear-gradient(
289
+ 180deg,
290
+ var(--stepper-disabled-color) 0%,
291
+ color-mix(in srgb, var(--stepper-disabled-color) 60%, var(--stepper-border-color) 40%) 45%,
292
+ var(--stepper-border-color) 100%
293
+ );
294
+ }
127
295
 
128
296
  :host([direction="vertical"][position="last"]) .content:before {
129
297
  display: none;
@@ -135,8 +303,40 @@ class s extends HTMLElement {
135
303
 
136
304
 
137
305
  :host([direction="vertical"]) .dotwrapper {
138
- margin-top: var(--stroke-size-200);
139
- margin-bottom: var(--stroke-size-100);
306
+ width: ${e};
307
+ min-width: ${e};
308
+ flex: 0 0 ${e};
309
+ margin-top: var(--space-200);
310
+ margin-bottom: var(--space-200);
311
+ }
312
+ :host([direction="vertical"]) .dotwrapper::before {
313
+ content: "";
314
+ position: absolute;
315
+ top: calc(-1 * var(--space-200));
316
+ left: calc(50% - var(--stroke-size-100));
317
+ width: var(--stroke-size-200);
318
+ height: var(--space-200);
319
+ background: var(--stepper-border-color);
320
+ pointer-events: none;
321
+ }
322
+ :host([direction="vertical"][position="first"]) .dotwrapper::before {
323
+ display: none;
324
+ }
325
+ :host([direction="vertical"][resolved-state="error"]) .dotwrapper::before {
326
+ background: linear-gradient(
327
+ 180deg,
328
+ var(--stepper-border-color) 0%,
329
+ color-mix(in srgb, var(--stepper-error-color) 45%, var(--stepper-border-color) 55%) 45%,
330
+ var(--stepper-error-color) 100%
331
+ );
332
+ }
333
+ :host([direction="vertical"][resolved-state="pending"]) .dotwrapper::before {
334
+ background: linear-gradient(
335
+ 180deg,
336
+ var(--stepper-border-color) 0%,
337
+ color-mix(in srgb, var(--stepper-warning-color) 45%, var(--stepper-border-color) 55%) 45%,
338
+ var(--stepper-warning-color) 100%
339
+ );
140
340
  }
141
341
 
142
342
  .title[active] {
@@ -146,12 +346,49 @@ class s extends HTMLElement {
146
346
  mui-body.active::part(color) {
147
347
  color: var(--stepper-text-color-active);;
148
348
  }
349
+ :host([resolved-state="completed"]) mui-body::part(color),
350
+ :host([resolved-state="active"]) mui-body::part(color) {
351
+ color: var(--stepper-text-color-active);
352
+ }
353
+ :host([resolved-state="error"]) mui-body::part(color) {
354
+ color: var(--stepper-error-color);
355
+ }
356
+ :host([resolved-state="success"]) mui-body::part(color) {
357
+ color: var(--stepper-success-color);
358
+ }
359
+ :host([resolved-state="pending"]) mui-body::part(color) {
360
+ color: var(--stepper-warning-color);
361
+ }
362
+ :host([resolved-state="disabled"]) mui-body::part(color) {
363
+ color: var(--stepper-disabled-color);
364
+ }
365
+ :host([resolved-state="disabled"]) {
366
+ cursor: not-allowed;
367
+ }
368
+ :host([role="button"]) {
369
+ cursor: pointer;
370
+ }
371
+
372
+ @keyframes pending-blur-pulse {
373
+ 0% {
374
+ opacity: 0.08;
375
+ transform: scale(1);
376
+ }
377
+ 50% {
378
+ opacity: 0.45;
379
+ transform: scale(1.16);
380
+ }
381
+ 100% {
382
+ opacity: 0.08;
383
+ transform: scale(1);
384
+ }
385
+ }
149
386
 
150
387
  </style>
151
388
 
152
- ${a}
389
+ ${b}
153
390
 
154
391
  `;
155
392
  }
156
393
  }
157
- customElements.get("mui-step") || customElements.define("mui-step", s);
394
+ customElements.get("mui-step") || customElements.define("mui-step", g);
@@ -1,24 +1,75 @@
1
- class n extends HTMLElement {
2
- static get observedAttributes() {
3
- return ["direction", "active-step"];
4
- }
1
+ class u extends HTMLElement {
5
2
  constructor() {
6
- super(), this.attachShadow({ mode: "open" }), this.setAttribute("direction", this.getAttribute("direction") || "horizontal"), this.setAttribute("active-step", this.getAttribute("active-step") || "0");
3
+ super(), this.onKeyDown = (i) => {
4
+ const s = this.steps;
5
+ if (!s.length) return;
6
+ const e = i.key, n = this.activeStepIndex;
7
+ e === "ArrowRight" || e === "ArrowDown" ? (i.preventDefault(), this.setActiveStep(n + 1, "keyboard")) : e === "ArrowLeft" || e === "ArrowUp" ? (i.preventDefault(), this.setActiveStep(n - 1, "keyboard")) : e === "Home" ? (i.preventDefault(), this.setActiveStep(0, "keyboard")) : e === "End" && (i.preventDefault(), this.setActiveStep(s.length - 1, "keyboard"));
8
+ }, this.attachShadow({ mode: "open" }), this.setAttribute("direction", this.getAttribute("direction") || "horizontal"), this.setAttribute("active-step", this.getAttribute("active-step") || "1");
9
+ const t = this.getAttribute("size");
10
+ this.setAttribute("size", t === "x-small" || t === "small" ? t : "medium");
11
+ }
12
+ static get observedAttributes() {
13
+ return ["direction", "active-step", "linear", "interactive", "size"];
7
14
  }
8
15
  connectedCallback() {
9
- this.render();
16
+ this.addEventListener("keydown", this.onKeyDown), this.render();
17
+ }
18
+ disconnectedCallback() {
19
+ this.removeEventListener("keydown", this.onKeyDown);
10
20
  }
11
- attributeChangedCallback(t, e, i) {
12
- (t === "direction" || t === "active-step") && this.render();
21
+ attributeChangedCallback(t, i, s) {
22
+ (t === "direction" || t === "active-step" || t === "linear" || t === "interactive" || t === "size") && this.render();
13
23
  }
14
24
  get steps() {
15
- var e;
16
- const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
25
+ var i;
26
+ const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("slot");
17
27
  return (t == null ? void 0 : t.assignedElements()) || [];
18
28
  }
29
+ get activeStepIndex() {
30
+ const t = Number.parseInt(this.getAttribute("active-step") || "1", 10);
31
+ return Number.isFinite(t) ? Math.max(t - 1, 0) : 0;
32
+ }
33
+ emitStepChange(t, i, s) {
34
+ this.dispatchEvent(
35
+ new CustomEvent("step-change", {
36
+ detail: {
37
+ previousStep: t + 1,
38
+ activeStep: i + 1,
39
+ previousIndex: t,
40
+ activeIndex: i,
41
+ source: s
42
+ },
43
+ bubbles: !0,
44
+ composed: !0
45
+ })
46
+ );
47
+ }
48
+ setActiveStep(t, i) {
49
+ const s = this.steps;
50
+ if (!s.length) return;
51
+ const e = Math.min(Math.max(t, 0), s.length - 1), n = this.activeStepIndex;
52
+ n !== e && (this.setAttribute("active-step", String(e + 1)), this.emitStepChange(n, e, i));
53
+ }
54
+ resolveStepState(t, i, s) {
55
+ const e = t.getAttribute("state");
56
+ if (e && e !== "active" && e !== "upcoming") {
57
+ if (e === "disabled") return "disabled";
58
+ if (e === "error") return "error";
59
+ if (e === "success") return "success";
60
+ if (e === "pending") return "pending";
61
+ if (e === "completed") return "completed";
62
+ }
63
+ return i < s ? "completed" : i === s ? "active" : "upcoming";
64
+ }
65
+ canActivateStep(t, i, s) {
66
+ if (!this.hasAttribute("interactive")) return !1;
67
+ const e = s[t];
68
+ return e.hasAttribute("disabled") || e.getAttribute("state") === "disabled" ? !1 : !this.hasAttribute("linear") || t <= i ? !0 : t === i + 1;
69
+ }
19
70
  render() {
20
71
  if (!this.shadowRoot) return;
21
- const t = this.getAttribute("direction") || "horizontal", e = parseInt(this.getAttribute("active-step") || "0", 10);
72
+ const t = this.getAttribute("direction") === "vertical" ? "vertical" : "horizontal", i = this.getAttribute("size"), s = i === "x-small" || i === "small" ? i : "medium", e = this.steps, n = Math.min(Math.max(this.activeStepIndex, 0), Math.max(e.length - 1, 0));
22
73
  this.shadowRoot.innerHTML = /*html*/
23
74
  `
24
75
  <style>
@@ -26,70 +77,15 @@ class n extends HTMLElement {
26
77
  display: flex;
27
78
  flex-direction: ${t === "horizontal" ? "row" : "column"};
28
79
  ${t === "horizontal" ? "justify-content: space-between;" : ""}
80
+ width: 100%;
81
+ outline: none;
29
82
  }
30
-
31
- .step {
32
- display: flex;
33
- flex-direction: ${t === "horizontal" ? "column" : "row"};
34
- align-items: center;
35
- position: relative;
36
- }
37
-
38
- .dot {
39
- width: 1.25rem;
40
- height: 1.25rem;
41
- border-radius: 50%;
42
- border: 2px solid var(--color-border, #ccc);
43
- display: flex;
44
- align-items: center;
45
- justify-content: center;
46
- background: var(--color-bg, #fff);
47
- flex-shrink: 0;
48
- }
49
-
50
- .dot.completed {
51
- background: var(--color-success, #4caf50);
52
- border-color: var(--color-success, #4caf50);
53
- }
54
- .dot.active {
55
- border-color: var(--color-primary, #1976d2);
56
- }
57
-
58
- .title {
59
- margin-top: ${t === "horizontal" ? "var(--space-200)" : "0"};
60
- margin-left: ${t === "vertical" ? "var(--space-200)" : "0"};
61
- text-align: ${t === "horizontal" ? "center" : "left"};
62
- }
63
- .title mui-body[active] {
64
- font-weight: bold;
65
- }
66
-
67
- .connector {
68
- position: absolute;
69
- background: red;
70
- }
71
- .connector.horizontal {
72
- top: 0.625rem;
73
- left: 100%;
74
- width: var(--space-400);
75
- height: 2px;
76
- }
77
- .connector.vertical {
78
- left: 0.625rem;
79
- top: 100%;
80
- height: var(--space-400);
81
- width: 2px;
82
- }
83
-
84
83
  </style>
85
-
86
84
  <slot></slot>
87
- `;
88
- const i = e - 1, s = this.steps;
89
- s.forEach((r, o) => {
90
- const c = o < i ? "completed" : o === i ? "active" : "upcoming";
91
- r.setAttribute("state", c), r.setAttribute("direction", t), r.setAttribute("position", o === 0 ? "first" : o === s.length - 1 ? "last" : "middle");
85
+ `, e.forEach((r, o) => {
86
+ const a = this.resolveStepState(r, o, n), c = this.canActivateStep(o, n, e);
87
+ r.setAttribute("resolved-state", a), r.setAttribute("direction", t), r.setAttribute("size", s), r.setAttribute("position", o === 0 ? "first" : o === e.length - 1 ? "last" : "middle"), c ? (r.setAttribute("tabindex", o === n ? "0" : "-1"), r.setAttribute("role", "button"), r.setAttribute("aria-current", o === n ? "step" : "false"), r.onclick = () => this.setActiveStep(o, "click")) : (r.setAttribute("tabindex", "-1"), r.removeAttribute("role"), r.removeAttribute("aria-current"), r.onclick = null);
92
88
  });
93
89
  }
94
90
  }
95
- customElements.get("mui-stepper") || customElements.define("mui-stepper", n);
91
+ customElements.get("mui-stepper") || customElements.define("mui-stepper", u);
@@ -1,4 +1,4 @@
1
- class t extends HTMLElement {
1
+ class e extends HTMLElement {
2
2
  static get observedAttributes() {
3
3
  return ["columns"];
4
4
  }
@@ -6,7 +6,17 @@ class t extends HTMLElement {
6
6
  super(), this.attachShadow({ mode: "open" });
7
7
  }
8
8
  connectedCallback() {
9
- this.setAttribute("role", "row"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
9
+ this.setAttribute("role", "row"), this.syncContextAttributes(), this.render();
10
+ }
11
+ attributeChangedCallback() {
12
+ this.render();
13
+ }
14
+ syncContextAttributes() {
15
+ const t = !!this.closest("mui-card");
16
+ this.toggleAttribute("in-card", t);
17
+ }
18
+ render() {
19
+ this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
10
20
  `
11
21
  <style>
12
22
  :host {
@@ -19,9 +29,12 @@ class t extends HTMLElement {
19
29
  align-items: center;
20
30
  min-height: 4.4rem;
21
31
  }
32
+ :host([in-card]) {
33
+ border-top-color: color-mix(in srgb, var(--border-color) 50%, transparent);
34
+ }
22
35
  </style>
23
36
  <slot></slot>
24
37
  `);
25
38
  }
26
39
  }
27
- customElements.get("mui-row") || customElements.define("mui-row", t);
40
+ customElements.get("mui-row") || customElements.define("mui-row", e);
@@ -1,23 +1,30 @@
1
- class n extends HTMLElement {
1
+ class s extends HTMLElement {
2
2
  constructor() {
3
3
  super(), this.handleTabChange = this.handleTabChange.bind(this);
4
4
  }
5
5
  connectedCallback() {
6
- this.addEventListener("tab-change", this.handleTabChange);
7
- const e = this.querySelector("mui-tab-bar");
8
- if (e) {
9
- const t = e.querySelector("mui-tab-item[active]");
10
- t && this.updatePanels(t.id);
11
- }
6
+ this.addEventListener("tab-change", this.handleTabChange), requestAnimationFrame(() => this.initializePanels());
12
7
  }
13
- handleTabChange(e) {
14
- const t = e;
15
- this.updatePanels(t.detail.activeId);
8
+ disconnectedCallback() {
9
+ this.removeEventListener("tab-change", this.handleTabChange);
16
10
  }
17
- updatePanels(e) {
18
- this.querySelectorAll("mui-tab-panel").forEach((a) => {
19
- a.getAttribute("item") === e ? a.style.display = "" : a.style.display = "none";
11
+ initializePanels() {
12
+ const i = this.querySelector("mui-tab-bar"), e = i == null ? void 0 : i.querySelector("mui-tab-item[active]"), n = i == null ? void 0 : i.querySelector("mui-tab-item"), t = (e == null ? void 0 : e.id) || (n == null ? void 0 : n.id) || "";
13
+ this.updatePanels(t);
14
+ }
15
+ handleTabChange(i) {
16
+ var t;
17
+ const e = i, n = ((t = e == null ? void 0 : e.detail) == null ? void 0 : t.activeId) || "";
18
+ this.updatePanels(n);
19
+ }
20
+ updatePanels(i) {
21
+ const e = Array.from(this.querySelectorAll("mui-tab-panel"));
22
+ if (!e.length) return;
23
+ let n = e.find((t) => t.getAttribute("item") === i) || null;
24
+ n || (n = e[0]), e.forEach((t) => {
25
+ const a = t === n;
26
+ t.toggleAttribute("hidden", !a), t.setAttribute("aria-hidden", String(!a)), t.style.display = a ? "" : "none";
20
27
  });
21
28
  }
22
29
  }
23
- customElements.get("mui-tab-controller") || customElements.define("mui-tab-controller", n);
30
+ customElements.get("mui-tab-controller") || customElements.define("mui-tab-controller", s);