@muibook/components 19.6.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.
- package/AGENTS.md +67 -0
- package/DESIGN.md +358 -0
- package/README.md +53 -2
- package/dist/esm/agent/keywords/index.js +2 -173
- package/dist/esm/agent/prompts/index.js +6 -432
- package/dist/esm/components/mui-accordion/core/index.js +25 -17
- package/dist/esm/components/mui-addon/index.js +14 -14
- package/dist/esm/components/mui-avatar/index.js +103 -43
- package/dist/esm/components/mui-avatar-chip/index.js +158 -0
- package/dist/esm/components/mui-avatar-group/index.js +88 -0
- package/dist/esm/components/mui-badge/index.js +37 -20
- package/dist/esm/components/mui-body/index.js +20 -11
- package/dist/esm/components/mui-button/index.js +265 -78
- package/dist/esm/components/mui-calendar/index.js +199 -0
- package/dist/esm/components/mui-card/body/index.js +33 -18
- package/dist/esm/components/mui-card/footer/index.js +11 -9
- package/dist/esm/components/mui-carousel/controller/index.js +1 -1
- package/dist/esm/components/mui-checkbox/index.js +23 -18
- package/dist/esm/components/mui-chip/index.js +219 -73
- package/dist/esm/components/mui-chip-input/index.js +146 -137
- package/dist/esm/components/mui-chip-rail/index.js +342 -0
- package/dist/esm/components/mui-code/index.js +26 -7
- package/dist/esm/components/mui-container/index.js +68 -45
- package/dist/esm/components/mui-date-picker/index.js +169 -0
- package/dist/esm/components/mui-drawer/index.js +968 -100
- package/dist/esm/components/mui-dropdown/index.js +255 -59
- package/dist/esm/components/mui-field/index.js +1 -1
- package/dist/esm/components/mui-file-upload/index.js +14 -4
- package/dist/esm/components/mui-form-group/index.js +1 -2
- package/dist/esm/components/mui-form-message/index.js +4 -9
- package/dist/esm/components/mui-heading/index.js +3 -2
- package/dist/esm/components/mui-hint/index.js +178 -72
- package/dist/esm/components/mui-icons/copy/index.js +54 -0
- package/dist/esm/components/mui-icons/fullscreen/index.js +5 -0
- package/dist/esm/components/mui-icons/icon-helper/index.js +56 -0
- package/dist/esm/components/mui-icons/index.js +14 -1
- package/dist/esm/components/mui-icons/moon/index.js +3 -1
- package/dist/esm/components/mui-icons/{rectangle-bottom-panel → panel}/index.js +6 -6
- package/dist/esm/components/mui-icons/pause/index.js +5 -0
- package/dist/esm/components/mui-icons/picture-in-picture/index.js +5 -0
- package/dist/esm/components/mui-icons/play-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/rectangle-right-drawer/index.js +56 -0
- package/dist/esm/components/mui-icons/reload/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-mute/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-one-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-two-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/spinner/index.js +7 -5
- package/dist/esm/components/mui-icons/stop-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/sun/index.js +5 -5
- package/dist/esm/components/mui-icons/timer/index.js +54 -0
- package/dist/esm/components/mui-icons/toggle/index.js +16 -6
- package/dist/esm/components/mui-icons/vertical-ellipsis/index.js +5 -0
- package/dist/esm/components/mui-illustrations/trash/index.js +6 -5
- package/dist/esm/components/mui-input/index.js +96 -67
- package/dist/esm/components/mui-link/index.js +352 -96
- package/dist/esm/components/mui-media-player/index.js +1577 -83
- package/dist/esm/components/mui-message/index.js +7 -6
- package/dist/esm/components/mui-model-viewer/index.js +258 -0
- package/dist/esm/components/mui-progress-ring/index.js +349 -0
- package/dist/esm/components/mui-prompt/index.js +143 -115
- package/dist/esm/components/mui-prompt-preview/index.js +11 -23
- package/dist/esm/components/mui-radio/index.js +38 -17
- package/dist/esm/components/mui-range-input/index.js +9 -4
- package/dist/esm/components/mui-responsive/index.js +60 -27
- package/dist/esm/components/mui-search-input/index.js +300 -0
- package/dist/esm/components/mui-select/index.js +235 -46
- package/dist/esm/components/mui-slat/slat/index.js +40 -12
- package/dist/esm/components/mui-spinner/index.js +11 -9
- package/dist/esm/components/mui-stack/hstack/index.js +10 -5
- package/dist/esm/components/mui-status/index.js +239 -0
- package/dist/esm/components/mui-stepper/step/index.js +46 -32
- package/dist/esm/components/mui-switch/index.js +37 -26
- package/dist/esm/components/mui-table/row/index.js +2 -6
- package/dist/esm/components/mui-table/table/index.js +157 -14
- package/dist/esm/components/mui-tabs/controller/index.js +17 -6
- package/dist/esm/components/mui-tabs/item/index.js +17 -5
- package/dist/esm/components/mui-tabs/tab-bar/index.js +93 -39
- package/dist/esm/components/mui-textarea/index.js +43 -26
- package/dist/esm/components/mui-time/index/index.js +336 -0
- package/dist/esm/components/mui-time-picker/index.js +126 -0
- package/dist/esm/components/mui-video-thumbnail/index.js +205 -0
- package/dist/esm/css/mui-brand.css +12 -8
- package/dist/esm/css/mui-tokens.css +646 -344
- package/dist/esm/css/readme.md +2 -2
- package/dist/esm/custom-elements.json +4506 -1707
- package/dist/esm/dynamic-attrs.json +271 -54
- package/dist/esm/index.js +33 -6
- package/dist/esm/knowledge/compositions/index.js +1560 -0
- package/dist/esm/knowledge/index.js +28 -0
- package/dist/esm/knowledge/keywords/index.js +306 -0
- package/dist/esm/knowledge/rules/index.js +199 -0
- package/dist/esm/tokens/js/index.js +143 -139
- package/dist/types/agent/keywords/index.d.ts +1 -1
- package/dist/types/components/mui-avatar-chip/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-chip/index.d.ts +18 -0
- package/dist/types/components/mui-avatar-group/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-group/doc.d.ts +2 -0
- package/dist/types/components/mui-avatar-group/index.d.ts +1 -0
- package/dist/types/components/mui-button/api.d.ts +6 -2
- package/dist/types/components/mui-calendar/api.d.ts +41 -0
- package/dist/types/components/mui-calendar/doc.d.ts +2 -0
- package/dist/types/components/mui-calendar/index.d.ts +3 -0
- package/dist/types/components/mui-checkbox/api.d.ts +4 -0
- package/dist/types/components/mui-chip/api.d.ts +4 -0
- package/dist/types/components/mui-chip-input/api.d.ts +4 -0
- package/dist/types/components/mui-chip-rail/api.d.ts +21 -0
- package/dist/types/components/mui-chip-rail/doc.d.ts +2 -0
- package/dist/types/components/mui-chip-rail/index.d.ts +4 -0
- package/dist/types/components/mui-date-picker/api.d.ts +38 -0
- package/dist/types/components/mui-date-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-date-picker/index.d.ts +6 -0
- package/dist/types/components/mui-drawer/api.d.ts +4 -0
- package/dist/types/components/mui-drawer/index.d.ts +2 -0
- package/dist/types/components/mui-file-upload/api.d.ts +4 -0
- package/dist/types/components/mui-icons/fullscreen.d.ts +1 -0
- package/dist/types/components/mui-icons/icon-helper.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +14 -1
- package/dist/types/components/mui-icons/panel.d.ts +1 -0
- package/dist/types/components/mui-icons/pause.d.ts +1 -0
- package/dist/types/components/mui-icons/picture-in-picture.d.ts +1 -0
- package/dist/types/components/mui-icons/play-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-right-drawer.d.ts +1 -0
- package/dist/types/components/mui-icons/reload.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-mute.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-one-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-two-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/stop-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/timer.d.ts +1 -0
- package/dist/types/components/mui-icons/vertical-ellipsis.d.ts +1 -0
- package/dist/types/components/mui-input/api.d.ts +12 -0
- package/dist/types/components/mui-link/api.d.ts +4 -0
- package/dist/types/components/mui-media-player/api.d.ts +4 -0
- package/dist/types/components/mui-media-player/index.d.ts +13 -4
- package/dist/types/components/mui-model-viewer/api.d.ts +28 -0
- package/dist/types/components/mui-model-viewer/doc.d.ts +2 -0
- package/dist/types/components/mui-model-viewer/index.d.ts +17 -0
- package/dist/types/components/mui-progress-ring/api.d.ts +24 -0
- package/dist/types/components/mui-progress-ring/doc.d.ts +2 -0
- package/dist/types/components/mui-progress-ring/index.d.ts +1 -0
- package/dist/types/components/mui-radio/api.d.ts +12 -0
- package/dist/types/components/mui-range-input/api.d.ts +4 -0
- package/dist/types/components/mui-responsive/api.d.ts +10 -2
- package/dist/types/components/mui-search-input/api.d.ts +40 -0
- package/dist/types/components/mui-search-input/doc.d.ts +2 -0
- package/dist/types/components/mui-search-input/index.d.ts +3 -0
- package/dist/types/components/mui-select/api.d.ts +12 -0
- package/dist/types/components/mui-status/api.d.ts +24 -0
- package/dist/types/components/mui-status/doc.d.ts +2 -0
- package/dist/types/components/mui-status/index.d.ts +1 -0
- package/dist/types/components/mui-switch/api.d.ts +4 -0
- package/dist/types/components/mui-table/api.d.ts +15 -0
- package/dist/types/components/mui-textarea/api.d.ts +12 -0
- package/dist/types/components/mui-time/api.d.ts +41 -0
- package/dist/types/components/mui-time/doc.d.ts +2 -0
- package/dist/types/components/mui-time/index.d.ts +1 -0
- package/dist/types/components/mui-time-picker/api.d.ts +38 -0
- package/dist/types/components/mui-time-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-time-picker/index.d.ts +4 -0
- package/dist/types/components/mui-video-thumbnail/api.d.ts +28 -0
- package/dist/types/components/mui-video-thumbnail/doc.d.ts +2 -0
- package/dist/types/components/mui-video-thumbnail/index.d.ts +1 -0
- package/dist/types/index.d.ts +27 -2
- package/dist/types/knowledge/compositions.d.ts +4644 -0
- package/dist/types/knowledge/index.d.ts +4657 -0
- package/dist/types/knowledge/keywords.d.ts +4 -0
- package/dist/types/knowledge/rules.d.ts +1 -0
- package/dist/types/tokens/js/index.d.ts +11 -7
- package/package.json +131 -12
- package/dist/esm/components/mui-form-hint/index.js +0 -1
- package/dist/types/components/mui-form-hint/index.d.ts +0 -1
- /package/dist/types/components/{mui-form-hint → mui-avatar-chip}/doc.d.ts +0 -0
- /package/dist/types/components/mui-icons/{rectangle-bottom-panel.d.ts → copy.d.ts} +0 -0
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import { getPartMap as
|
|
2
|
-
class
|
|
1
|
+
import { getPartMap as f } from "../../utils/part-map/index.js";
|
|
2
|
+
class g extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
|
-
return [
|
|
4
|
+
return [
|
|
5
|
+
"onclick",
|
|
6
|
+
"type",
|
|
7
|
+
"aria-label",
|
|
8
|
+
"disabled",
|
|
9
|
+
"pending",
|
|
10
|
+
"variant",
|
|
11
|
+
"stroke",
|
|
12
|
+
"stroke-ring-size",
|
|
13
|
+
"focus-ring",
|
|
14
|
+
"size",
|
|
15
|
+
"usage"
|
|
16
|
+
];
|
|
5
17
|
}
|
|
6
18
|
constructor() {
|
|
7
19
|
super(), this.attachShadow({ mode: "open" });
|
|
8
20
|
}
|
|
21
|
+
focus(t) {
|
|
22
|
+
var e;
|
|
23
|
+
const o = (e = this.shadowRoot) == null ? void 0 : e.querySelector("button");
|
|
24
|
+
o ? o.focus(t) : super.focus(t);
|
|
25
|
+
}
|
|
9
26
|
async connectedCallback() {
|
|
10
|
-
if (this.hasAttribute("size") || this.setAttribute("size", "medium"), await this.waitForPartMap(), !this.shadowRoot) return;
|
|
11
|
-
let
|
|
27
|
+
if (this.hasAttribute("size") || this.setAttribute("size", "medium"), this.syncRingSizeAttribute(), await this.waitForPartMap(), !this.shadowRoot) return;
|
|
28
|
+
let o = (
|
|
12
29
|
/*html*/
|
|
13
30
|
`
|
|
14
31
|
<style>
|
|
@@ -18,6 +35,9 @@ class h extends HTMLElement {
|
|
|
18
35
|
display: inline-block;
|
|
19
36
|
width: auto;
|
|
20
37
|
text-align: center;
|
|
38
|
+
--action-focus-outline: var(--stroke-size-400) var(--stroke-outset) var(--outline-color);
|
|
39
|
+
--action-focus-outline-inset-offset: var(--stroke-size-400);
|
|
40
|
+
--action-focus-outline-offset: calc(-1 * var(--action-focus-outline-inset-offset));
|
|
21
41
|
}
|
|
22
42
|
button {
|
|
23
43
|
vertical-align: baseline;
|
|
@@ -26,6 +46,7 @@ class h extends HTMLElement {
|
|
|
26
46
|
width: 100%;
|
|
27
47
|
border-radius: var(--action-radius-medium);
|
|
28
48
|
padding: var(--action-padding);
|
|
49
|
+
min-height: var(--action-size-medium);
|
|
29
50
|
text-decoration: none;
|
|
30
51
|
line-height: var(--action-line-height);
|
|
31
52
|
display: inherit;
|
|
@@ -64,10 +85,19 @@ class h extends HTMLElement {
|
|
|
64
85
|
cursor: not-allowed;
|
|
65
86
|
}
|
|
66
87
|
|
|
88
|
+
:host([pending]) {
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([pending]) button {
|
|
93
|
+
cursor: progress;
|
|
94
|
+
}
|
|
95
|
+
|
|
67
96
|
button, button:before, button:after {box-sizing: border-box;}
|
|
68
97
|
|
|
69
98
|
button:focus-visible {
|
|
70
|
-
outline: var(--outline
|
|
99
|
+
outline: var(--action-focus-outline);
|
|
100
|
+
outline-offset: var(--action-focus-outline-offset);
|
|
71
101
|
}
|
|
72
102
|
|
|
73
103
|
:host button ::slotted(.mui-icon) { fill: var(--action-primary-text-color); }
|
|
@@ -245,14 +275,83 @@ class h extends HTMLElement {
|
|
|
245
275
|
:host([variant="attention"]) button:focus-visible ::slotted(.mui-icon) { fill: var(--action-attention-text-color-focus); }
|
|
246
276
|
:host([variant="attention"]) button:disabled ::slotted(.mui-icon) { fill: var(--action-attention-text-color-disabled); }
|
|
247
277
|
|
|
278
|
+
:host,
|
|
279
|
+
:host([variant="primary"]) {
|
|
280
|
+
--action-ring-color: var(--action-primary-border-color);
|
|
281
|
+
--action-ring-color-hover: var(--action-primary-border-color-hover);
|
|
282
|
+
--action-ring-color-focus: var(--action-primary-border-color-focus);
|
|
283
|
+
--action-ring-color-disabled: var(--action-primary-border-color-disabled);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
:host([variant="secondary"]) {
|
|
287
|
+
--action-ring-color: var(--action-secondary-border-color);
|
|
288
|
+
--action-ring-color-hover: var(--action-secondary-border-color-hover);
|
|
289
|
+
--action-ring-color-focus: var(--action-secondary-border-color-focus);
|
|
290
|
+
--action-ring-color-disabled: var(--action-secondary-border-color-disabled);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:host([variant="tertiary"]) {
|
|
294
|
+
--action-ring-color: var(--action-tertiary-border-color);
|
|
295
|
+
--action-ring-color-hover: var(--action-tertiary-border-color-hover);
|
|
296
|
+
--action-ring-color-focus: var(--action-tertiary-border-color-focus);
|
|
297
|
+
--action-ring-color-disabled: var(--action-tertiary-border-color-disabled);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
:host([variant="overlay"]) {
|
|
301
|
+
--action-ring-size: var(--stroke-size-100);
|
|
302
|
+
--action-ring-color: var(--action-overlay-border-color);
|
|
303
|
+
--action-ring-color-hover: var(--action-overlay-border-color-hover);
|
|
304
|
+
--action-ring-color-focus: var(--action-overlay-border-color-focus);
|
|
305
|
+
--action-ring-color-disabled: var(--action-overlay-border-color-disabled);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
:host([variant="attention"]) {
|
|
309
|
+
--action-ring-color: var(--action-attention-border-color);
|
|
310
|
+
--action-ring-color-hover: var(--action-attention-border-color-hover);
|
|
311
|
+
--action-ring-color-focus: var(--action-attention-border-color-focus);
|
|
312
|
+
--action-ring-color-disabled: var(--action-attention-border-color-disabled);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
:host([stroke="ring"]:not([usage="input"])) button {
|
|
316
|
+
border: none;
|
|
317
|
+
box-shadow: var(
|
|
318
|
+
--action-ring-shadow,
|
|
319
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color)
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
:host([stroke="ring"]:not([usage="input"])) button:hover {
|
|
324
|
+
border: none;
|
|
325
|
+
box-shadow: var(
|
|
326
|
+
--action-ring-shadow-hover,
|
|
327
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-hover)
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
:host([stroke="ring"]:not([usage="input"])) button:focus-visible {
|
|
332
|
+
border: none;
|
|
333
|
+
box-shadow: var(
|
|
334
|
+
--action-ring-shadow-focus,
|
|
335
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-focus)
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
:host([stroke="ring"]:not([usage="input"])) button:disabled {
|
|
340
|
+
border: none;
|
|
341
|
+
box-shadow: var(
|
|
342
|
+
--action-ring-shadow-disabled,
|
|
343
|
+
inset 0 0 0 var(--action-ring-size, var(--stroke-size-100)) var(--action-ring-color-disabled)
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
|
|
248
347
|
/* Icon only
|
|
249
348
|
========================================= */
|
|
250
349
|
:host([icon-only]) button {
|
|
251
350
|
display: flex;
|
|
252
351
|
justify-content: center;
|
|
253
352
|
align-items: center;
|
|
254
|
-
height: var(--action-
|
|
255
|
-
width: var(--action-
|
|
353
|
+
height: var(--action-size-medium);
|
|
354
|
+
width: var(--action-size-medium);
|
|
256
355
|
padding: var(--action-icon-only-padding);
|
|
257
356
|
}
|
|
258
357
|
/* ===================================== */
|
|
@@ -475,9 +574,10 @@ class h extends HTMLElement {
|
|
|
475
574
|
:host([size="xx-small"]) button:hover,
|
|
476
575
|
:host([size="xx-small"]) button:focus,
|
|
477
576
|
:host([size="xx-small"]) button:disabled {
|
|
478
|
-
font-size: var(--font-size-
|
|
479
|
-
line-height: var(--line-height-
|
|
577
|
+
font-size: var(--text-font-size-xxs);
|
|
578
|
+
line-height: var(--text-line-height-xxs);
|
|
480
579
|
font-weight: var(--font-weight-semi-bold);
|
|
580
|
+
min-height: var(--action-size-xx-small);
|
|
481
581
|
padding: var(--space-025) var(--space-100);
|
|
482
582
|
border-width: var(--stroke-size-100);
|
|
483
583
|
border-radius: var(--action-radius-x-small);
|
|
@@ -490,6 +590,7 @@ class h extends HTMLElement {
|
|
|
490
590
|
font-size: var(--text-font-size-xs);
|
|
491
591
|
line-height: var(--text-line-height-xs);
|
|
492
592
|
font-weight: var(--font-weight-semi-bold);
|
|
593
|
+
min-height: var(--action-size-x-small);
|
|
493
594
|
padding: var(--action-padding-x-small);
|
|
494
595
|
border-width: var(--stroke-size-100);
|
|
495
596
|
border-radius: var(--action-radius-x-small);
|
|
@@ -498,6 +599,7 @@ class h extends HTMLElement {
|
|
|
498
599
|
:host([size="small"]) button {
|
|
499
600
|
font-size: var(--text-font-size-s);
|
|
500
601
|
line-height: var(--text-line-height-s);
|
|
602
|
+
min-height: var(--action-size-small);
|
|
501
603
|
padding: var(--action-padding-small);
|
|
502
604
|
border-radius: var(--action-radius-small);
|
|
503
605
|
}
|
|
@@ -505,12 +607,14 @@ class h extends HTMLElement {
|
|
|
505
607
|
:host([size="medium"]) button {
|
|
506
608
|
font-size: var(--text-font-size-m);
|
|
507
609
|
line-height: var(--text-line-height-m);
|
|
610
|
+
min-height: var(--action-size-medium);
|
|
508
611
|
border-radius: var(--action-radius-medium);
|
|
509
612
|
}
|
|
510
613
|
|
|
511
614
|
:host([size="large"]) button {
|
|
512
615
|
font-size: var(--text-font-size-l);
|
|
513
616
|
line-height: var(--text-line-height-l);
|
|
617
|
+
min-height: var(--action-size-large);
|
|
514
618
|
padding: var(--action-padding-large);
|
|
515
619
|
border-radius: var(--action-radius-large);
|
|
516
620
|
}
|
|
@@ -560,26 +664,26 @@ class h extends HTMLElement {
|
|
|
560
664
|
}
|
|
561
665
|
|
|
562
666
|
:host([size="xx-small"][icon-only]) button {
|
|
563
|
-
height:
|
|
564
|
-
width:
|
|
667
|
+
height: var(--action-size-xx-small);
|
|
668
|
+
width: var(--action-size-xx-small);
|
|
565
669
|
padding: var(--action-icon-only-padding);
|
|
566
670
|
}
|
|
567
671
|
|
|
568
672
|
:host([size="x-small"][icon-only]) button {
|
|
569
|
-
height: var(--action-
|
|
570
|
-
width: var(--action-
|
|
673
|
+
height: var(--action-size-x-small);
|
|
674
|
+
width: var(--action-size-x-small);
|
|
571
675
|
padding: var(--action-icon-only-padding);
|
|
572
676
|
}
|
|
573
677
|
|
|
574
678
|
:host([size="small"][icon-only]) button {
|
|
575
|
-
height: var(--action-
|
|
576
|
-
width: var(--action-
|
|
679
|
+
height: var(--action-size-small);
|
|
680
|
+
width: var(--action-size-small);
|
|
577
681
|
padding: var(--action-icon-only-padding);
|
|
578
682
|
}
|
|
579
683
|
|
|
580
684
|
:host([size="large"][icon-only]) button {
|
|
581
|
-
height: var(--action-
|
|
582
|
-
width: var(--action-
|
|
685
|
+
height: var(--action-size-large);
|
|
686
|
+
width: var(--action-size-large);
|
|
583
687
|
padding: var(--action-icon-only-padding);
|
|
584
688
|
}
|
|
585
689
|
|
|
@@ -676,8 +780,9 @@ class h extends HTMLElement {
|
|
|
676
780
|
min-width: 0;
|
|
677
781
|
min-height: 0;
|
|
678
782
|
padding: var(--space-000);
|
|
679
|
-
border: none;
|
|
783
|
+
border: var(--action-avatar-border, none);
|
|
680
784
|
background: transparent;
|
|
785
|
+
box-shadow: var(--action-avatar-shadow, none);
|
|
681
786
|
display: inline-flex;
|
|
682
787
|
align-items: center;
|
|
683
788
|
justify-content: center;
|
|
@@ -691,14 +796,76 @@ class h extends HTMLElement {
|
|
|
691
796
|
margin-left: var(--space-000);
|
|
692
797
|
}
|
|
693
798
|
|
|
799
|
+
:host([has-avatar-chip]) {
|
|
800
|
+
display: inline-flex;
|
|
801
|
+
width: auto;
|
|
802
|
+
text-align: left;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
:host([has-avatar-chip]) button {
|
|
806
|
+
display: inline-flex;
|
|
807
|
+
width: auto;
|
|
808
|
+
min-width: 0;
|
|
809
|
+
align-items: center;
|
|
810
|
+
justify-content: flex-start;
|
|
811
|
+
text-align: left;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
:host([has-avatar-chip][size="x-small"]) button {
|
|
815
|
+
padding-left: var(--space-100);
|
|
816
|
+
}
|
|
817
|
+
:host([has-avatar-chip][size="small"]) button {
|
|
818
|
+
padding-left: var(--space-200);
|
|
819
|
+
}
|
|
820
|
+
:host([has-avatar-chip][size="medium"]) button {
|
|
821
|
+
padding-left: var(--space-300);
|
|
822
|
+
}
|
|
823
|
+
:host([has-avatar-chip][size="large"]) button {
|
|
824
|
+
padding-left: var(--space-400);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
:host([has-video]) {
|
|
828
|
+
display: inline-block;
|
|
829
|
+
width: auto;
|
|
830
|
+
text-align: initial;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
:host([has-video]) button,
|
|
834
|
+
:host([has-video]) button:hover,
|
|
835
|
+
:host([has-video]) button:focus,
|
|
836
|
+
:host([has-video]) button:focus-visible,
|
|
837
|
+
:host([has-video]) button:disabled {
|
|
838
|
+
display: block;
|
|
839
|
+
width: 100%;
|
|
840
|
+
min-height: 0;
|
|
841
|
+
padding: var(--space-000);
|
|
842
|
+
border: none;
|
|
843
|
+
border-radius: var(--radius-000);
|
|
844
|
+
background: transparent;
|
|
845
|
+
color: inherit;
|
|
846
|
+
font-size: inherit;
|
|
847
|
+
font-weight: inherit;
|
|
848
|
+
line-height: inherit;
|
|
849
|
+
text-align: initial;
|
|
850
|
+
box-shadow: none;
|
|
851
|
+
outline-offset: var(--video-thumbnail-action-focus-outline-offset, var(--space-300));
|
|
852
|
+
-webkit-backdrop-filter: none;
|
|
853
|
+
backdrop-filter: none;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
:host([focus-ring="outset"]) button:focus-visible {
|
|
857
|
+
outline-offset: var(--action-focus-outline-outset-offset, var(--stroke-size-200));
|
|
858
|
+
}
|
|
859
|
+
|
|
694
860
|
|
|
695
861
|
</style>
|
|
696
862
|
|
|
697
863
|
<button
|
|
698
|
-
part="${
|
|
864
|
+
part="${f("text", "spacing", "layout", "visual")}"
|
|
699
865
|
onclick="${this.getAttribute("onclick")}"
|
|
700
866
|
type="${this.getAttribute("type") || "button"}"
|
|
701
867
|
aria-label="${this.getAttribute("aria-label") || ""}"
|
|
868
|
+
aria-busy="${this.hasAttribute("pending") ? "true" : "false"}"
|
|
702
869
|
${this.hasAttribute("disabled") ? "disabled" : ""}
|
|
703
870
|
>
|
|
704
871
|
<slot name="before"></slot>
|
|
@@ -708,104 +875,124 @@ class h extends HTMLElement {
|
|
|
708
875
|
|
|
709
876
|
`
|
|
710
877
|
);
|
|
711
|
-
this.shadowRoot.innerHTML =
|
|
878
|
+
this.shadowRoot.innerHTML = o;
|
|
879
|
+
const e = this.shadowRoot.querySelector("button");
|
|
880
|
+
e == null || e.addEventListener("click", (a) => {
|
|
881
|
+
this.hasAttribute("pending") && (a.preventDefault(), a.stopImmediatePropagation());
|
|
882
|
+
}), await customElements.whenDefined("mui-button"), [
|
|
712
883
|
this.shadowRoot.querySelector("slot:not([name])"),
|
|
713
884
|
this.shadowRoot.querySelector('slot[name="before"]'),
|
|
714
885
|
this.shadowRoot.querySelector('slot[name="after"]')
|
|
715
|
-
].forEach((
|
|
886
|
+
].forEach((a) => a == null ? void 0 : a.addEventListener("slotchange", () => this.syncButtonState())), requestAnimationFrame(() => this.syncButtonState());
|
|
716
887
|
}
|
|
717
|
-
attributeChangedCallback(
|
|
718
|
-
var
|
|
719
|
-
if (
|
|
720
|
-
const
|
|
721
|
-
|
|
888
|
+
attributeChangedCallback(t, o, e) {
|
|
889
|
+
var s, a;
|
|
890
|
+
if (t === "disabled") {
|
|
891
|
+
const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector("button");
|
|
892
|
+
i && (this.hasAttribute("disabled") ? i.setAttribute("disabled", "") : i.removeAttribute("disabled"));
|
|
722
893
|
}
|
|
723
|
-
|
|
894
|
+
if (t === "pending") {
|
|
895
|
+
const i = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button");
|
|
896
|
+
i && i.setAttribute("aria-busy", this.hasAttribute("pending") ? "true" : "false");
|
|
897
|
+
}
|
|
898
|
+
t === "size" && o !== e && this.shadowRoot && requestAnimationFrame(() => this.syncButtonState()), t === "stroke-ring-size" && o !== e && this.syncRingSizeAttribute();
|
|
899
|
+
}
|
|
900
|
+
syncRingSizeAttribute() {
|
|
901
|
+
var s;
|
|
902
|
+
const t = (s = this.getAttribute("stroke-ring-size")) == null ? void 0 : s.trim();
|
|
903
|
+
if (!t) {
|
|
904
|
+
this.style.removeProperty("--action-ring-size");
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
const o = t.startsWith("stroke-size-") ? t.replace("stroke-size-", "") : t, e = /^(100|200|300|400|500)$/.test(o);
|
|
908
|
+
this.style.setProperty("--action-ring-size", e ? `var(--stroke-size-${o})` : t);
|
|
724
909
|
}
|
|
725
910
|
syncButtonState() {
|
|
726
|
-
const
|
|
727
|
-
if (!
|
|
728
|
-
const
|
|
729
|
-
var
|
|
730
|
-
return
|
|
731
|
-
}) : !1,
|
|
732
|
-
this.toggleAttribute("has-before",
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
|
|
911
|
+
const t = this.shadowRoot;
|
|
912
|
+
if (!t) return;
|
|
913
|
+
const o = t.querySelector("slot:not([name])"), e = t.querySelector('slot[name="before"]'), s = t.querySelector('slot[name="after"]'), a = (r) => r ? r.assignedNodes({ flatten: !0 }).some((n) => {
|
|
914
|
+
var c;
|
|
915
|
+
return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!((c = n.textContent) != null && c.trim());
|
|
916
|
+
}) : !1, i = a(e), l = a(s);
|
|
917
|
+
this.toggleAttribute("has-before", i), this.toggleAttribute("has-after", l);
|
|
918
|
+
const d = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [], u = (o == null ? void 0 : o.assignedElements({ flatten: !0 })) ?? [], b = u.some((r) => r.tagName.toLowerCase() === "mui-video-thumbnail"), h = u.some((r) => r.tagName.toLowerCase() === "mui-avatar-chip");
|
|
919
|
+
this.toggleAttribute("has-video", b), this.toggleAttribute("has-avatar-chip", h);
|
|
920
|
+
const v = !b && !h && u.length === 1 && u[0].tagName.toLowerCase() === "mui-avatar" && d.every((r) => {
|
|
921
|
+
var n;
|
|
922
|
+
return r.nodeType === Node.TEXT_NODE ? !((n = r.textContent) != null && n.trim()) : r.nodeType === Node.ELEMENT_NODE ? r.tagName.toLowerCase() === "mui-avatar" : !1;
|
|
736
923
|
});
|
|
737
|
-
if (this.toggleAttribute("avatar-only",
|
|
738
|
-
var
|
|
739
|
-
if (
|
|
740
|
-
const
|
|
741
|
-
return
|
|
924
|
+
if (this.toggleAttribute("avatar-only", v), !v && !b && !h && d.every((r) => {
|
|
925
|
+
var n;
|
|
926
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
927
|
+
const c = r;
|
|
928
|
+
return c.tagName.toLowerCase() === "svg" || c.classList.contains("mui-icon");
|
|
742
929
|
}
|
|
743
|
-
return
|
|
930
|
+
return r.nodeType === Node.TEXT_NODE && !((n = r.textContent) != null && n.trim());
|
|
744
931
|
})) {
|
|
745
|
-
this.setAttribute("icon-only", ""), this.updateIconSizes(
|
|
932
|
+
this.setAttribute("icon-only", ""), this.updateIconSizes(d, !0);
|
|
746
933
|
return;
|
|
747
934
|
}
|
|
748
|
-
this.removeAttribute("icon-only"), [
|
|
749
|
-
if (!
|
|
750
|
-
const
|
|
751
|
-
this.updateIconSizes(
|
|
935
|
+
this.removeAttribute("icon-only"), [e, o, s].forEach((r) => {
|
|
936
|
+
if (!r) return;
|
|
937
|
+
const n = r.assignedNodes({ flatten: !0 });
|
|
938
|
+
this.updateIconSizes(n, !1), v || this.updateAvatarSizes(n), this.updateBadgeSizes(n);
|
|
752
939
|
});
|
|
753
940
|
}
|
|
754
941
|
// Update avatar sizes based on button size
|
|
755
|
-
updateAvatarSizes(
|
|
756
|
-
const
|
|
942
|
+
updateAvatarSizes(t) {
|
|
943
|
+
const o = this.getAttribute("size") || "medium", s = {
|
|
757
944
|
"xx-small": "xx-small",
|
|
758
945
|
"x-small": "xx-small",
|
|
759
946
|
small: "xx-small",
|
|
760
947
|
medium: "small",
|
|
761
948
|
large: "medium"
|
|
762
|
-
}[
|
|
763
|
-
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
|
|
949
|
+
}[o] || "small";
|
|
950
|
+
t.forEach((a) => {
|
|
951
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
952
|
+
const i = a;
|
|
953
|
+
i.tagName.toLowerCase() === "mui-avatar" && i.setAttribute("size", s);
|
|
767
954
|
}
|
|
768
955
|
});
|
|
769
956
|
}
|
|
770
|
-
updateIconSizes(
|
|
771
|
-
const
|
|
957
|
+
updateIconSizes(t, o) {
|
|
958
|
+
const e = this.getAttribute("size") || "medium", a = {
|
|
772
959
|
"xx-small": "xx-small",
|
|
773
960
|
"x-small": "x-small",
|
|
774
961
|
small: "x-small",
|
|
775
|
-
medium:
|
|
962
|
+
medium: o ? "medium" : "small",
|
|
776
963
|
// small for regular, medium for icon-only
|
|
777
|
-
large:
|
|
778
|
-
}[
|
|
779
|
-
|
|
780
|
-
if (
|
|
781
|
-
const l =
|
|
782
|
-
(l.tagName.toLowerCase() === "svg" || l.classList.contains("mui-icon") || l.tagName.toLowerCase() === "mui-icon") && !l.hasAttribute("size") && l.setAttribute("size",
|
|
964
|
+
large: o ? "large" : "medium"
|
|
965
|
+
}[e] || "small";
|
|
966
|
+
t.forEach((i) => {
|
|
967
|
+
if (i.nodeType === Node.ELEMENT_NODE) {
|
|
968
|
+
const l = i;
|
|
969
|
+
(l.tagName.toLowerCase() === "svg" || l.classList.contains("mui-icon") || l.tagName.toLowerCase() === "mui-icon") && !l.hasAttribute("size") && l.setAttribute("size", a);
|
|
783
970
|
}
|
|
784
971
|
});
|
|
785
972
|
}
|
|
786
|
-
updateBadgeSizes(
|
|
787
|
-
const
|
|
973
|
+
updateBadgeSizes(t) {
|
|
974
|
+
const o = this.getAttribute("size") || "medium", s = {
|
|
788
975
|
"xx-small": "x-small",
|
|
789
976
|
"x-small": "x-small",
|
|
790
977
|
small: "small",
|
|
791
978
|
medium: "medium",
|
|
792
979
|
large: "large"
|
|
793
|
-
}[
|
|
794
|
-
|
|
795
|
-
if (
|
|
796
|
-
const
|
|
797
|
-
|
|
980
|
+
}[o] || "medium";
|
|
981
|
+
t.forEach((a) => {
|
|
982
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
983
|
+
const i = a;
|
|
984
|
+
i.tagName.toLowerCase() === "mui-badge" && i.setAttribute("size", s);
|
|
798
985
|
}
|
|
799
986
|
});
|
|
800
987
|
}
|
|
801
988
|
waitForPartMap() {
|
|
802
|
-
return new Promise((
|
|
803
|
-
if (typeof
|
|
804
|
-
const
|
|
805
|
-
typeof
|
|
989
|
+
return new Promise((t) => {
|
|
990
|
+
if (typeof f == "function") return t();
|
|
991
|
+
const o = () => {
|
|
992
|
+
typeof f == "function" ? t() : requestAnimationFrame(o);
|
|
806
993
|
};
|
|
807
|
-
|
|
994
|
+
o();
|
|
808
995
|
});
|
|
809
996
|
}
|
|
810
997
|
}
|
|
811
|
-
customElements.get("mui-button") || customElements.define("mui-button",
|
|
998
|
+
customElements.get("mui-button") || customElements.define("mui-button", g);
|