@muibook/components 20.0.0 → 20.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.
Files changed (153) hide show
  1. package/AGENTS.md +67 -0
  2. package/DESIGN.md +358 -0
  3. package/README.md +52 -1
  4. package/dist/esm/agent/keywords/index.js +2 -204
  5. package/dist/esm/agent/prompts/index.js +6 -434
  6. package/dist/esm/components/mui-accordion/core/index.js +25 -17
  7. package/dist/esm/components/mui-avatar/index.js +99 -42
  8. package/dist/esm/components/mui-avatar-chip/index.js +158 -0
  9. package/dist/esm/components/mui-avatar-group/index.js +88 -0
  10. package/dist/esm/components/mui-badge/index.js +2 -2
  11. package/dist/esm/components/mui-body/index.js +20 -11
  12. package/dist/esm/components/mui-button/index.js +117 -65
  13. package/dist/esm/components/mui-calendar/index.js +199 -0
  14. package/dist/esm/components/mui-card/body/index.js +32 -17
  15. package/dist/esm/components/mui-card/footer/index.js +11 -9
  16. package/dist/esm/components/mui-carousel/controller/index.js +1 -1
  17. package/dist/esm/components/mui-checkbox/index.js +23 -18
  18. package/dist/esm/components/mui-chip/index.js +184 -68
  19. package/dist/esm/components/mui-chip-input/index.js +146 -137
  20. package/dist/esm/components/mui-chip-rail/index.js +154 -51
  21. package/dist/esm/components/mui-code/index.js +27 -8
  22. package/dist/esm/components/mui-container/index.js +68 -45
  23. package/dist/esm/components/mui-date-picker/index.js +169 -0
  24. package/dist/esm/components/mui-drawer/index.js +968 -100
  25. package/dist/esm/components/mui-dropdown/index.js +250 -63
  26. package/dist/esm/components/mui-field/index.js +1 -1
  27. package/dist/esm/components/mui-file-upload/index.js +13 -4
  28. package/dist/esm/components/mui-form-group/index.js +1 -2
  29. package/dist/esm/components/mui-form-message/index.js +4 -9
  30. package/dist/esm/components/mui-hint/index.js +178 -72
  31. package/dist/esm/components/mui-icons/copy/index.js +54 -0
  32. package/dist/esm/components/mui-icons/fullscreen/index.js +5 -0
  33. package/dist/esm/components/mui-icons/icon-helper/index.js +56 -0
  34. package/dist/esm/components/mui-icons/index.js +14 -1
  35. package/dist/esm/components/mui-icons/moon/index.js +3 -1
  36. package/dist/esm/components/mui-icons/{rectangle-bottom-panel → panel}/index.js +6 -6
  37. package/dist/esm/components/mui-icons/pause/index.js +5 -0
  38. package/dist/esm/components/mui-icons/picture-in-picture/index.js +5 -0
  39. package/dist/esm/components/mui-icons/play-fill/index.js +5 -0
  40. package/dist/esm/components/mui-icons/rectangle-right-drawer/index.js +56 -0
  41. package/dist/esm/components/mui-icons/reload/index.js +5 -0
  42. package/dist/esm/components/mui-icons/speaker-mute/index.js +5 -0
  43. package/dist/esm/components/mui-icons/speaker-one-wave/index.js +5 -0
  44. package/dist/esm/components/mui-icons/speaker-two-wave/index.js +5 -0
  45. package/dist/esm/components/mui-icons/spinner/index.js +7 -5
  46. package/dist/esm/components/mui-icons/stop-fill/index.js +5 -0
  47. package/dist/esm/components/mui-icons/sun/index.js +5 -5
  48. package/dist/esm/components/mui-icons/timer/index.js +54 -0
  49. package/dist/esm/components/mui-icons/toggle/index.js +16 -6
  50. package/dist/esm/components/mui-icons/vertical-ellipsis/index.js +5 -0
  51. package/dist/esm/components/mui-illustrations/trash/index.js +6 -5
  52. package/dist/esm/components/mui-input/index.js +87 -62
  53. package/dist/esm/components/mui-link/index.js +195 -83
  54. package/dist/esm/components/mui-media-player/index.js +1577 -83
  55. package/dist/esm/components/mui-model-viewer/index.js +258 -0
  56. package/dist/esm/components/mui-progress-ring/index.js +349 -0
  57. package/dist/esm/components/mui-prompt/index.js +99 -71
  58. package/dist/esm/components/mui-prompt-preview/index.js +11 -23
  59. package/dist/esm/components/mui-radio/index.js +38 -17
  60. package/dist/esm/components/mui-range-input/index.js +9 -4
  61. package/dist/esm/components/mui-responsive/index.js +60 -27
  62. package/dist/esm/components/mui-search-input/index.js +300 -0
  63. package/dist/esm/components/mui-select/index.js +231 -42
  64. package/dist/esm/components/mui-slat/slat/index.js +40 -12
  65. package/dist/esm/components/mui-spinner/index.js +11 -9
  66. package/dist/esm/components/mui-switch/index.js +23 -20
  67. package/dist/esm/components/mui-table/row/index.js +2 -6
  68. package/dist/esm/components/mui-table/table/index.js +157 -14
  69. package/dist/esm/components/mui-textarea/index.js +43 -26
  70. package/dist/esm/components/mui-time/index/index.js +336 -0
  71. package/dist/esm/components/mui-time-picker/index.js +126 -0
  72. package/dist/esm/components/mui-video-thumbnail/index.js +5 -5
  73. package/dist/esm/css/mui-brand.css +12 -8
  74. package/dist/esm/css/mui-tokens.css +417 -305
  75. package/dist/esm/css/readme.md +2 -2
  76. package/dist/esm/custom-elements.json +3678 -1553
  77. package/dist/esm/dynamic-attrs.json +263 -66
  78. package/dist/esm/index.js +30 -6
  79. package/dist/esm/knowledge/compositions/index.js +1560 -0
  80. package/dist/esm/knowledge/index.js +28 -0
  81. package/dist/esm/knowledge/keywords/index.js +306 -0
  82. package/dist/esm/knowledge/rules/index.js +199 -0
  83. package/dist/esm/tokens/js/index.js +143 -139
  84. package/dist/types/agent/keywords/index.d.ts +1 -1
  85. package/dist/types/components/mui-avatar-chip/api.d.ts +28 -0
  86. package/dist/types/components/mui-avatar-chip/index.d.ts +18 -0
  87. package/dist/types/components/mui-avatar-group/api.d.ts +28 -0
  88. package/dist/types/components/mui-avatar-group/doc.d.ts +2 -0
  89. package/dist/types/components/mui-avatar-group/index.d.ts +1 -0
  90. package/dist/types/components/mui-button/api.d.ts +2 -2
  91. package/dist/types/components/mui-calendar/api.d.ts +41 -0
  92. package/dist/types/components/mui-calendar/doc.d.ts +2 -0
  93. package/dist/types/components/mui-calendar/index.d.ts +3 -0
  94. package/dist/types/components/mui-checkbox/api.d.ts +4 -0
  95. package/dist/types/components/mui-chip-input/api.d.ts +4 -0
  96. package/dist/types/components/mui-chip-rail/index.d.ts +1 -0
  97. package/dist/types/components/mui-date-picker/api.d.ts +38 -0
  98. package/dist/types/components/mui-date-picker/doc.d.ts +2 -0
  99. package/dist/types/components/mui-date-picker/index.d.ts +6 -0
  100. package/dist/types/components/mui-drawer/api.d.ts +4 -0
  101. package/dist/types/components/mui-drawer/index.d.ts +2 -0
  102. package/dist/types/components/mui-file-upload/api.d.ts +4 -0
  103. package/dist/types/components/mui-icons/fullscreen.d.ts +1 -0
  104. package/dist/types/components/mui-icons/icon-helper.d.ts +1 -0
  105. package/dist/types/components/mui-icons/index.d.ts +14 -1
  106. package/dist/types/components/mui-icons/panel.d.ts +1 -0
  107. package/dist/types/components/mui-icons/pause.d.ts +1 -0
  108. package/dist/types/components/mui-icons/picture-in-picture.d.ts +1 -0
  109. package/dist/types/components/mui-icons/play-fill.d.ts +1 -0
  110. package/dist/types/components/mui-icons/rectangle-right-drawer.d.ts +1 -0
  111. package/dist/types/components/mui-icons/reload.d.ts +1 -0
  112. package/dist/types/components/mui-icons/speaker-mute.d.ts +1 -0
  113. package/dist/types/components/mui-icons/speaker-one-wave.d.ts +1 -0
  114. package/dist/types/components/mui-icons/speaker-two-wave.d.ts +1 -0
  115. package/dist/types/components/mui-icons/stop-fill.d.ts +1 -0
  116. package/dist/types/components/mui-icons/timer.d.ts +1 -0
  117. package/dist/types/components/mui-icons/vertical-ellipsis.d.ts +1 -0
  118. package/dist/types/components/mui-input/api.d.ts +12 -0
  119. package/dist/types/components/mui-media-player/api.d.ts +4 -0
  120. package/dist/types/components/mui-media-player/index.d.ts +13 -4
  121. package/dist/types/components/mui-model-viewer/api.d.ts +28 -0
  122. package/dist/types/components/mui-model-viewer/doc.d.ts +2 -0
  123. package/dist/types/components/mui-model-viewer/index.d.ts +17 -0
  124. package/dist/types/components/mui-progress-ring/api.d.ts +24 -0
  125. package/dist/types/components/mui-progress-ring/doc.d.ts +2 -0
  126. package/dist/types/components/mui-progress-ring/index.d.ts +1 -0
  127. package/dist/types/components/mui-radio/api.d.ts +12 -0
  128. package/dist/types/components/mui-range-input/api.d.ts +4 -0
  129. package/dist/types/components/mui-responsive/api.d.ts +10 -2
  130. package/dist/types/components/mui-search-input/api.d.ts +40 -0
  131. package/dist/types/components/mui-search-input/doc.d.ts +2 -0
  132. package/dist/types/components/mui-search-input/index.d.ts +3 -0
  133. package/dist/types/components/mui-select/api.d.ts +12 -0
  134. package/dist/types/components/mui-switch/api.d.ts +4 -0
  135. package/dist/types/components/mui-table/api.d.ts +15 -0
  136. package/dist/types/components/mui-textarea/api.d.ts +12 -0
  137. package/dist/types/components/mui-time/api.d.ts +41 -0
  138. package/dist/types/components/mui-time/doc.d.ts +2 -0
  139. package/dist/types/components/mui-time/index.d.ts +1 -0
  140. package/dist/types/components/mui-time-picker/api.d.ts +38 -0
  141. package/dist/types/components/mui-time-picker/doc.d.ts +2 -0
  142. package/dist/types/components/mui-time-picker/index.d.ts +4 -0
  143. package/dist/types/index.d.ts +24 -2
  144. package/dist/types/knowledge/compositions.d.ts +4644 -0
  145. package/dist/types/knowledge/index.d.ts +4657 -0
  146. package/dist/types/knowledge/keywords.d.ts +4 -0
  147. package/dist/types/knowledge/rules.d.ts +1 -0
  148. package/dist/types/tokens/js/index.d.ts +11 -7
  149. package/package.json +119 -12
  150. package/dist/esm/components/mui-form-hint/index.js +0 -1
  151. package/dist/types/components/mui-form-hint/index.d.ts +0 -1
  152. /package/dist/types/components/{mui-form-hint → mui-avatar-chip}/doc.d.ts +0 -0
  153. /package/dist/types/components/mui-icons/{rectangle-bottom-panel.d.ts → copy.d.ts} +0 -0
@@ -1,12 +1,13 @@
1
1
  import "../mui-button/index.js";
2
+ import "../mui-chip/index.js";
2
3
  import "../mui-icons/left-chevron/index.js";
3
4
  import "../mui-icons/right-chevron/index.js";
4
- class n extends HTMLElement {
5
+ class u extends HTMLElement {
5
6
  constructor() {
6
- super(), this.scrollEl = null, this.slotEl = null, this.resizeObserver = null, this.mutationObserver = null, this.onScroll = () => this.syncEdges(), this.onSlotChange = () => this.syncSlottedItems(), this.onPreviousClick = () => this.scrollByPage(-1), this.onNextClick = () => this.scrollByPage(1), this.attachShadow({ mode: "open" });
7
+ super(), this.scrollEl = null, this.slotEl = null, this.resizeObserver = null, this.mutationObserver = null, this.onScroll = () => this.syncEdges(), this.onSlotChange = () => this.syncSlottedItems(), this.onFocusIn = (i) => this.scrollFocusedItemIntoView(i), this.onPreviousClick = () => this.scrollByPage(-1), this.onNextClick = () => this.scrollByPage(1), this.onSkipClick = () => this.skipRail(), this.onSkipKeyDown = (i) => this.handleSkipKeyDown(i), this.attachShadow({ mode: "open" });
7
8
  }
8
9
  static get observedAttributes() {
9
- return ["size", "bleed", "bleed-inline-size", "bleed-block-size", "aria-label"];
10
+ return ["size", "bleed", "bleed-inline-size", "bleed-block-size", "skip-label", "aria-label"];
10
11
  }
11
12
  connectedCallback() {
12
13
  this.hasAttribute("size") || this.setAttribute("size", "medium"), this.render(), this.syncBleed(), this.bindEvents(), this.syncSlottedItems();
@@ -14,21 +15,25 @@ class n extends HTMLElement {
14
15
  disconnectedCallback() {
15
16
  this.unbindEvents();
16
17
  }
17
- attributeChangedCallback(e, i, t) {
18
- if (i !== t && this.shadowRoot) {
19
- if (e === "size") {
18
+ attributeChangedCallback(i, e, t) {
19
+ if (e !== t && this.shadowRoot) {
20
+ if (i === "size") {
20
21
  this.syncActionSizes(), this.syncSlottedItems();
21
22
  return;
22
23
  }
23
- if (e === "bleed" || e === "bleed-inline-size" || e === "bleed-block-size") {
24
+ if (i === "bleed" || i === "bleed-inline-size" || i === "bleed-block-size") {
24
25
  this.syncBleed();
25
26
  return;
26
27
  }
27
- e === "aria-label" && this.scrollEl && this.scrollEl.setAttribute("aria-label", t || "Chip rail");
28
+ if (i === "skip-label") {
29
+ this.render(), this.syncBleed(), this.bindEvents(), this.syncSlottedItems();
30
+ return;
31
+ }
32
+ i === "aria-label" && this.scrollEl && this.scrollEl.setAttribute("aria-label", t || "Chip rail");
28
33
  }
29
34
  }
30
35
  render() {
31
- const e = this.normalizeSize(this.getAttribute("size")), i = this.getAttribute("aria-label") || "Chip rail", t = this.getIconSize(e);
36
+ const i = this.normalizeSize(this.getAttribute("size")), e = this.getAttribute("aria-label") || "Chip rail", t = this.getIconSize(i), l = this.getAttribute("skip-label") || "Skip";
32
37
  this.shadowRoot.innerHTML = /*html*/
33
38
  `
34
39
  <style>
@@ -42,29 +47,41 @@ class n extends HTMLElement {
42
47
  contain: inline-size;
43
48
  padding-block: var(--chip-rail-bleed-block-size);
44
49
  padding-inline: var(--chip-rail-bleed-inline-size);
45
- --chip-rail-background: var(--surface-elevated-100);
50
+ --chip-rail-background: var(--surface);
46
51
  --chip-rail-bleed-inline-size: 0px;
47
52
  --chip-rail-bleed-block-size: 0px;
48
53
  --chip-rail-gap: var(--space-200);
54
+ --chip-rail-shadow-padding-block: var(--stroke-size-200);
55
+ --chip-rail-action-size: var(--chip-height-medium, 4rem);
49
56
  --chip-rail-edge-size: calc(var(--action-icon-only-size-medium) + var(--space-700));
57
+ --chip-rail-focus-scroll-margin-inline: calc(
58
+ var(--chip-rail-edge-size) + var(--chip-rail-bleed-inline-size) + var(--chip-rail-gap)
59
+ );
50
60
  --chip-rail-edge-solid: 54%;
51
61
  }
52
62
 
53
63
  :host([size="x-small"]) {
64
+ --chip-rail-action-size: var(--chip-height-x-small);
54
65
  --chip-rail-gap: var(--space-100);
55
66
  --chip-rail-edge-size: calc(var(--action-icon-only-size-x-small) + var(--space-500));
56
67
  }
57
68
 
58
69
  :host([size="small"]) {
70
+ --chip-rail-action-size: var(--chip-height-small);
59
71
  --chip-rail-gap: var(--space-100);
60
72
  --chip-rail-edge-size: calc(var(--action-icon-only-size-small) + var(--space-600));
61
73
  }
62
74
 
63
75
  :host([size="large"]) {
76
+ --chip-rail-action-size: var(--chip-height-large);
64
77
  --chip-rail-gap: var(--space-300);
65
78
  --chip-rail-edge-size: calc(var(--action-icon-only-size-large) + var(--space-800));
66
79
  }
67
80
 
81
+ :host([card-slot]) {
82
+ --chip-rail-background: var(--surface-elevated-100);
83
+ }
84
+
68
85
  .rail {
69
86
  position: relative;
70
87
  width: 100%;
@@ -78,6 +95,7 @@ class n extends HTMLElement {
78
95
  max-width: 100%;
79
96
  overflow-x: auto;
80
97
  overflow-y: hidden;
98
+ padding-block: var(--chip-rail-shadow-padding-block);
81
99
  scrollbar-width: none;
82
100
  scroll-behavior: smooth;
83
101
  overscroll-behavior-inline: contain;
@@ -87,7 +105,7 @@ class n extends HTMLElement {
87
105
  display: none;
88
106
  }
89
107
 
90
- slot {
108
+ .items {
91
109
  display: flex;
92
110
  align-items: center;
93
111
  width: max-content;
@@ -95,15 +113,40 @@ class n extends HTMLElement {
95
113
  gap: var(--chip-rail-gap);
96
114
  }
97
115
 
116
+ .skip-chip,
98
117
  ::slotted(*) {
99
118
  flex: 0 0 auto;
119
+ scroll-margin-inline: var(--chip-rail-focus-scroll-margin-inline);
120
+ }
121
+
122
+ .skip-chip {
123
+ position: absolute;
124
+ width: 1px;
125
+ height: 1px;
126
+ overflow: hidden;
127
+ clip-path: inset(50%);
128
+ white-space: nowrap;
129
+ }
130
+
131
+ .skip-chip[hidden] {
132
+ display: none;
133
+ }
134
+
135
+ .skip-chip:focus,
136
+ .skip-chip:focus-visible {
137
+ position: static;
138
+ width: auto;
139
+ height: auto;
140
+ overflow: visible;
141
+ clip-path: none;
142
+ white-space: normal;
100
143
  }
101
144
 
102
145
  .edge {
103
146
  position: absolute;
104
147
  top: calc(-1 * var(--chip-rail-bleed-block-size));
105
148
  bottom: calc(-1 * var(--chip-rail-bleed-block-size));
106
- z-index: 2;
149
+ z-index: 1;
107
150
  display: flex;
108
151
  align-items: center;
109
152
  width: calc(var(--chip-rail-edge-size) + var(--chip-rail-bleed-inline-size));
@@ -118,6 +161,27 @@ class n extends HTMLElement {
118
161
 
119
162
  .edge mui-button {
120
163
  pointer-events: auto;
164
+ --action-size-x-small: var(--chip-rail-action-size);
165
+ --action-size-small: var(--chip-rail-action-size);
166
+ --action-size-medium: var(--chip-rail-action-size);
167
+ --action-size-large: var(--chip-rail-action-size);
168
+ --action-icon-only-size-x-small: var(--chip-rail-action-size);
169
+ --action-icon-only-size-small: var(--chip-rail-action-size);
170
+ --action-icon-only-size-medium: var(--chip-rail-action-size);
171
+ --action-icon-only-size-large: var(--chip-rail-action-size);
172
+ }
173
+
174
+ .edge mui-button::part(height) {
175
+ height: var(--chip-rail-action-size);
176
+ min-height: var(--chip-rail-action-size);
177
+ }
178
+
179
+ .edge mui-button::part(width) {
180
+ width: var(--chip-rail-action-size);
181
+ }
182
+
183
+ .edge mui-button::part(padding) {
184
+ padding: var(--space-000);
121
185
  }
122
186
 
123
187
  .edge-start {
@@ -150,27 +214,30 @@ class n extends HTMLElement {
150
214
  </style>
151
215
 
152
216
  <div class="rail">
153
- <div class="scroll" role="group" aria-label="${this.escapeAttribute(i)}">
154
- <slot></slot>
155
- </div>
156
- <div class="edge edge-start" hidden>
157
- <mui-button class="rail-action rail-action-start" variant="tertiary" size="${e}" icon-only aria-label="Previous items">
158
- <mui-icon-left-chevron class="mui-icon" size="${t}"></mui-icon-left-chevron>
159
- </mui-button>
217
+ <div class="scroll" role="group" aria-label="${this.escapeAttribute(e)}">
218
+ <div class="items">
219
+ <mui-chip class="skip-chip" variant="clickable" tabindex="-1" size="${i}" hidden aria-hidden="true">${this.escapeHtml(l)}</mui-chip>
220
+ <slot></slot>
221
+ </div>
160
222
  </div>
161
223
  <div class="edge edge-end" hidden>
162
- <mui-button class="rail-action rail-action-end" variant="tertiary" size="${e}" icon-only aria-label="Next items">
224
+ <mui-button class="rail-action rail-action-end" variant="tertiary" size="${i}" icon-only aria-label="Next items">
163
225
  <mui-icon-right-chevron class="mui-icon" size="${t}"></mui-icon-right-chevron>
164
226
  </mui-button>
165
227
  </div>
228
+ <div class="edge edge-start" hidden>
229
+ <mui-button class="rail-action rail-action-start" variant="tertiary" size="${i}" icon-only aria-label="Previous items">
230
+ <mui-icon-left-chevron class="mui-icon" size="${t}"></mui-icon-left-chevron>
231
+ </mui-button>
232
+ </div>
166
233
  </div>
167
234
  `, this.scrollEl = this.shadowRoot.querySelector(".scroll"), this.slotEl = this.shadowRoot.querySelector("slot");
168
235
  }
169
236
  bindEvents() {
170
- var t, s, l, r;
171
- this.unbindEvents(), (t = this.scrollEl) == null || t.addEventListener("scroll", this.onScroll, { passive: !0 }), (s = this.slotEl) == null || s.addEventListener("slotchange", this.onSlotChange);
172
- const e = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".rail-action-start"), i = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".rail-action-end");
173
- e == null || e.addEventListener("click", this.onPreviousClick), i == null || i.addEventListener("click", this.onNextClick), typeof ResizeObserver < "u" && this.scrollEl && (this.resizeObserver = new ResizeObserver(() => this.syncEdges()), this.resizeObserver.observe(this.scrollEl)), typeof MutationObserver < "u" && (this.mutationObserver = new MutationObserver(() => this.syncSlottedItems()), this.mutationObserver.observe(this, {
237
+ var l, o, s, r, a;
238
+ this.unbindEvents(), (l = this.scrollEl) == null || l.addEventListener("scroll", this.onScroll, { passive: !0 }), this.addEventListener("focusin", this.onFocusIn), (o = this.slotEl) == null || o.addEventListener("slotchange", this.onSlotChange);
239
+ const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".rail-action-start"), e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".rail-action-end"), t = (a = this.shadowRoot) == null ? void 0 : a.querySelector(".skip-chip");
240
+ i == null || i.addEventListener("click", this.onPreviousClick), e == null || e.addEventListener("click", this.onNextClick), t == null || t.addEventListener("click", this.onSkipClick), t == null || t.addEventListener("keydown", this.onSkipKeyDown), typeof ResizeObserver < "u" && this.scrollEl && (this.resizeObserver = new ResizeObserver(() => this.syncEdges()), this.resizeObserver.observe(this.scrollEl)), typeof MutationObserver < "u" && (this.mutationObserver = new MutationObserver(() => this.syncSlottedItems()), this.mutationObserver.observe(this, {
174
241
  childList: !0,
175
242
  subtree: !0,
176
243
  attributes: !0,
@@ -178,38 +245,71 @@ class n extends HTMLElement {
178
245
  })), requestAnimationFrame(() => this.syncEdges());
179
246
  }
180
247
  unbindEvents() {
181
- var e, i, t, s, l, r, a, o;
182
- (e = this.scrollEl) == null || e.removeEventListener("scroll", this.onScroll), (i = this.slotEl) == null || i.removeEventListener("slotchange", this.onSlotChange), (s = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".rail-action-start")) == null || s.removeEventListener("click", this.onPreviousClick), (r = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".rail-action-end")) == null || r.removeEventListener("click", this.onNextClick), (a = this.resizeObserver) == null || a.disconnect(), (o = this.mutationObserver) == null || o.disconnect(), this.resizeObserver = null, this.mutationObserver = null;
248
+ var i, e, t, l, o, s, r, a, n, c, h, d;
249
+ (i = this.scrollEl) == null || i.removeEventListener("scroll", this.onScroll), this.removeEventListener("focusin", this.onFocusIn), (e = this.slotEl) == null || e.removeEventListener("slotchange", this.onSlotChange), (l = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".rail-action-start")) == null || l.removeEventListener("click", this.onPreviousClick), (s = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".rail-action-end")) == null || s.removeEventListener("click", this.onNextClick), (a = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".skip-chip")) == null || a.removeEventListener("click", this.onSkipClick), (c = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".skip-chip")) == null || c.removeEventListener("keydown", this.onSkipKeyDown), (h = this.resizeObserver) == null || h.disconnect(), (d = this.mutationObserver) == null || d.disconnect(), this.resizeObserver = null, this.mutationObserver = null;
183
250
  }
184
251
  syncSlottedItems() {
185
252
  var t;
186
- const e = this.normalizeSize(this.getAttribute("size")), i = (t = this.slotEl) == null ? void 0 : t.assignedElements({ flatten: !0 });
187
- i == null || i.forEach((s) => {
188
- s.tagName.toLowerCase() === "mui-chip" && s.getAttribute("size") !== e && s.setAttribute("size", e);
253
+ const i = this.normalizeSize(this.getAttribute("size")), e = (t = this.slotEl) == null ? void 0 : t.assignedElements({ flatten: !0 });
254
+ e == null || e.forEach((l) => {
255
+ l.tagName.toLowerCase() === "mui-chip" && l.getAttribute("size") !== i && l.setAttribute("size", i);
189
256
  }), requestAnimationFrame(() => this.syncEdges());
190
257
  }
191
258
  syncActionSizes() {
192
- var t, s;
193
- const e = this.normalizeSize(this.getAttribute("size")), i = this.getIconSize(e);
194
- (t = this.shadowRoot) == null || t.querySelectorAll("mui-button.rail-action").forEach((l) => {
195
- l.setAttribute("size", e);
196
- }), (s = this.shadowRoot) == null || s.querySelectorAll(".rail-action .mui-icon").forEach((l) => {
197
- l.setAttribute("size", i);
198
- });
259
+ var t, l, o, s;
260
+ const i = this.normalizeSize(this.getAttribute("size")), e = this.getIconSize(i);
261
+ (t = this.shadowRoot) == null || t.querySelectorAll("mui-button.rail-action").forEach((r) => {
262
+ r.setAttribute("size", i);
263
+ }), (l = this.shadowRoot) == null || l.querySelectorAll(".rail-action .mui-icon").forEach((r) => {
264
+ r.setAttribute("size", e);
265
+ }), (s = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".skip-chip")) == null || s.setAttribute("size", i);
199
266
  }
200
267
  syncEdges() {
201
268
  var r, a;
202
269
  if (!this.scrollEl || !this.shadowRoot) return;
203
- const e = Math.max(0, this.scrollEl.scrollWidth - this.scrollEl.clientWidth), i = this.scrollEl.scrollLeft, t = e > 1, s = t && i > 1, l = t && i < e - 1;
204
- (r = this.shadowRoot.querySelector(".edge-start")) == null || r.toggleAttribute("hidden", !s), (a = this.shadowRoot.querySelector(".edge-end")) == null || a.toggleAttribute("hidden", !l);
270
+ const i = Math.max(0, this.scrollEl.scrollWidth - this.scrollEl.clientWidth), e = this.scrollEl.scrollLeft, t = i > 1, l = t && e > 1, o = t && e < i - 1, s = this.shadowRoot.querySelector(".skip-chip");
271
+ (r = this.shadowRoot.querySelector(".edge-start")) == null || r.toggleAttribute("hidden", !l), (a = this.shadowRoot.querySelector(".edge-end")) == null || a.toggleAttribute("hidden", !o), s == null || s.toggleAttribute("hidden", !t), s == null || s.setAttribute("aria-hidden", t ? "false" : "true"), s == null || s.setAttribute("tabindex", t ? "0" : "-1");
205
272
  }
206
273
  syncBleed() {
207
274
  this.style.setProperty("--chip-rail-bleed-inline-size", this.getBleedInlineValue()), this.style.setProperty("--chip-rail-bleed-block-size", this.getBleedBlockValue());
208
275
  }
209
- scrollByPage(e) {
276
+ scrollByPage(i) {
210
277
  if (!this.scrollEl) return;
211
- const i = Math.max(this.scrollEl.clientWidth * 0.72, 120);
212
- this.scrollEl.scrollBy({ left: i * e, behavior: "smooth" });
278
+ const e = Math.max(this.scrollEl.clientWidth * 0.72, 120);
279
+ this.scrollEl.scrollBy({ left: e * i, behavior: "smooth" });
280
+ }
281
+ skipRail() {
282
+ var s, r;
283
+ const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".rail-action-start"), e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(".rail-action-end"), t = i && !i.closest("[hidden]") ? i : e;
284
+ if (t) {
285
+ this.focusRailAction(t);
286
+ return;
287
+ }
288
+ const o = Array.from(
289
+ document.querySelectorAll(
290
+ 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
291
+ )
292
+ ).filter((a) => !a.hasAttribute("disabled") && !a.closest("[hidden]") && !a.closest("[inert]")).find(
293
+ (a) => !!(this.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING) && !this.contains(a)
294
+ );
295
+ o == null || o.focus();
296
+ }
297
+ handleSkipKeyDown(i) {
298
+ const e = i;
299
+ e.key !== "Enter" && e.key !== " " || (e.preventDefault(), this.skipRail());
300
+ }
301
+ focusRailAction(i) {
302
+ var t;
303
+ (((t = i.shadowRoot) == null ? void 0 : t.querySelector("button")) || i).focus();
304
+ }
305
+ scrollFocusedItemIntoView(i) {
306
+ var t;
307
+ const e = i.target;
308
+ e instanceof HTMLElement && ((t = this.shadowRoot) != null && t.contains(e) || this.contains(e) && e.scrollIntoView({
309
+ behavior: "smooth",
310
+ block: "nearest",
311
+ inline: "nearest"
312
+ }));
213
313
  }
214
314
  getBleedInlineValue() {
215
315
  return this.normalizeBleedValue(this.getAttribute("bleed-inline-size") || this.getAttribute("bleed"));
@@ -217,23 +317,26 @@ class n extends HTMLElement {
217
317
  getBleedBlockValue() {
218
318
  return this.normalizeBleedValue(this.getAttribute("bleed-block-size"));
219
319
  }
220
- normalizeBleedValue(e) {
221
- const i = (e || "0").trim(), t = /* @__PURE__ */ new Set(["000", "025", "050", "100", "200", "300", "400", "500", "600", "700", "800"]);
222
- return !i || i === "0" || i === "none" || i === "false" ? "0px" : t.has(i) ? `var(--space-${i})` : i;
320
+ normalizeBleedValue(i) {
321
+ const e = (i || "0").trim(), t = /* @__PURE__ */ new Set(["000", "025", "050", "100", "200", "300", "400", "500", "600", "700", "800"]);
322
+ return !e || e === "0" || e === "none" || e === "false" ? "0px" : t.has(e) ? `var(--space-${e})` : e;
223
323
  }
224
- normalizeSize(e) {
225
- return e && (/* @__PURE__ */ new Set(["x-small", "small", "medium", "large"])).has(e) ? e : "medium";
324
+ normalizeSize(i) {
325
+ return i && (/* @__PURE__ */ new Set(["x-small", "small", "medium", "large"])).has(i) ? i : "medium";
226
326
  }
227
- getIconSize(e) {
327
+ getIconSize(i) {
228
328
  return {
229
329
  "x-small": "x-small",
230
330
  small: "x-small",
231
331
  medium: "medium",
232
332
  large: "large"
233
- }[e] || "medium";
333
+ }[i] || "medium";
334
+ }
335
+ escapeAttribute(i) {
336
+ return i.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
234
337
  }
235
- escapeAttribute(e) {
236
- return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
338
+ escapeHtml(i) {
339
+ return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
237
340
  }
238
341
  }
239
- customElements.get("mui-chip-rail") || customElements.define("mui-chip-rail", n);
342
+ customElements.get("mui-chip-rail") || customElements.define("mui-chip-rail", u);
@@ -1,6 +1,6 @@
1
- class i extends HTMLElement {
1
+ class o extends HTMLElement {
2
2
  static get observedAttributes() {
3
- return ["size", "scrollable", "wrap"];
3
+ return ["size", "scrollable", "wrap", "inline"];
4
4
  }
5
5
  constructor() {
6
6
  super(), this.attachShadow({ mode: "open" });
@@ -13,11 +13,18 @@ class i extends HTMLElement {
13
13
  }
14
14
  render() {
15
15
  if (!this.shadowRoot) return;
16
- const t = this.hasAttribute("scrollable"), e = this.hasAttribute("wrap"), o = (
16
+ const t = this.hasAttribute("scrollable"), e = this.hasAttribute("wrap"), i = (
17
17
  /*css*/
18
18
  `
19
19
  :host {
20
20
  display: grid;
21
+ --code-background: var(--surface-elevated-100);
22
+ }
23
+ :host([inline]) {
24
+ display: inline;
25
+ }
26
+ :host([card-slot]) {
27
+ --code-background: var(--surface-elevated-200);
21
28
  }
22
29
  :host([size="x-small"]) code {
23
30
  font-size: var(--text-font-size-xs);
@@ -41,7 +48,6 @@ class i extends HTMLElement {
41
48
  font-family: monospace;
42
49
  color: var(--code-text-color, var(--text-color));
43
50
  background: var(--code-background);
44
- padding: var(--space-400) var(--space-500);
45
51
  box-sizing: border-box;
46
52
  width: 100%;
47
53
  overflow-x: ${e ? "hidden" : t ? "auto" : "visible"};
@@ -50,13 +56,26 @@ class i extends HTMLElement {
50
56
  word-break: ${e ? "break-word" : "normal"};
51
57
  }
52
58
 
59
+ :host(:not([inline])) code {
60
+ padding: var(--space-400) var(--space-500);
61
+ }
62
+
63
+ :host([inline]) code {
64
+ display: inline-block;
65
+ vertical-align: baseline;
66
+ padding: var(--space-050) var(--space-100);
67
+ width: auto;
68
+ overflow-x: visible;
69
+ white-space: ${e ? "pre-wrap" : "nowrap"};
70
+ }
71
+
53
72
  code:focus-visible {
54
73
  outline: ${t && !e ? "var(--outline-thick)" : "none"};
55
74
  outline-offset: ${t && !e ? "calc(-1 * var(--stroke-size-500))" : "none"};
56
75
  }
57
76
 
58
77
  @media (min-width: 600px) {
59
- code {
78
+ :host(:not([inline])) code {
60
79
  padding: var(--space-500) var(--space-600);
61
80
  }
62
81
  }
@@ -65,9 +84,9 @@ class i extends HTMLElement {
65
84
  );
66
85
  this.shadowRoot.innerHTML = /*html*/
67
86
  `
68
- <style>${o}</style>
87
+ <style>${i}</style>
69
88
  <code><slot></slot></code>
70
- `;
89
+ `;
71
90
  }
72
91
  }
73
- customElements.get("mui-code") || customElements.define("mui-code", i);
92
+ customElements.get("mui-code") || customElements.define("mui-code", o);
@@ -1,57 +1,80 @@
1
- class e extends HTMLElement {
1
+ class i extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["width"];
4
+ }
2
5
  constructor() {
3
6
  super(), this.attachShadow({ mode: "open" });
4
7
  }
5
8
  connectedCallback() {
6
- let t = (
7
- /*html*/
8
- `
9
- <style>
9
+ this.syncWidth(), this.render();
10
+ }
11
+ attributeChangedCallback() {
12
+ this.syncWidth();
13
+ }
14
+ getWidthValue() {
15
+ var e;
16
+ const t = (e = this.getAttribute("width")) == null ? void 0 : e.trim();
17
+ return t ? CSS.supports("max-width", t) ? t : /^\d+(\.\d+)?$/.test(t) ? `${Number(t) / 10}rem` : "" : "";
18
+ }
19
+ syncWidth() {
20
+ const t = this.getWidthValue();
21
+ if (t) {
22
+ this.style.setProperty("--container-max-width", t);
23
+ return;
24
+ }
25
+ this.style.removeProperty("--container-max-width");
26
+ }
27
+ render() {
28
+ this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
29
+ `
30
+ <style>
31
+ :host {
32
+ display: block;
33
+ width: 95%;
34
+ width: calc(100% - 4.8rem);
35
+ max-width: var(--container-max-width, 118rem);
36
+ padding-top: 2.4rem;
37
+ padding-bottom: 2.4rem;
38
+ min-width: 27.2rem;
39
+ margin: 0 2.4rem;
40
+ }
10
41
 
11
- :host {
12
- display: block;
13
- width: 95%;
14
- width: calc( 100% - 4.8rem );
15
- max-width: 118.0rem;
16
- padding-top: 2.4rem;
17
- padding-bottom: 2.4rem;
18
- min-width: 27.2rem;
19
- margin: 0 2.4rem; }
42
+ :host([center]) {
43
+ margin: 0 auto;
44
+ }
20
45
 
21
- /* Center
22
- ========================================= */
23
- :host([center]) {
24
- margin: 0 auto; }
25
- /* ===================================== */
46
+ :host([fluid]),
47
+ :host([size="fluid"]) {
48
+ --container-max-width: 100%;
49
+ }
26
50
 
27
- /* Fluid
28
- ========================================= */
29
- :host([fluid]) {
30
- max-width: 100%; }
31
- /* ===================================== */
51
+ :host([small]),
52
+ :host([size="small"]) {
53
+ --container-max-width: 54rem;
54
+ }
32
55
 
33
- /* Small
34
- ========================================= */
35
- :host([small]) {
36
- max-width: 54.0rem; }
37
- /* ===================================== */
56
+ :host([medium]),
57
+ :host([size="medium"]) {
58
+ --container-max-width: 70rem;
59
+ }
38
60
 
39
- /* Medium
40
- ========================================= */
41
- :host([medium]) {
42
- max-width: 70.0rem; }
43
- /* ===================================== */
61
+ :host([x-medium]),
62
+ :host([size="x-medium"]) {
63
+ --container-max-width: 96rem;
64
+ }
44
65
 
45
- /* Large
46
- ========================================= */
47
- :host([large]) {
48
- max-width: 118.0rem; }
49
- /* ===================================== */
50
- </style>
51
- <slot></slot>
52
- `
53
- );
54
- this.shadowRoot && (this.shadowRoot.innerHTML = t);
66
+ :host([large]),
67
+ :host([size="large"]) {
68
+ --container-max-width: 118rem;
69
+ }
70
+
71
+ :host([x-large]),
72
+ :host([size="x-large"]) {
73
+ --container-max-width: 148rem;
74
+ }
75
+ </style>
76
+ <slot></slot>
77
+ `);
55
78
  }
56
79
  }
57
- customElements.get("mui-container") || customElements.define("mui-container", e);
80
+ customElements.get("mui-container") || customElements.define("mui-container", i);