@muibook/components 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/agent/prompts/index.js +116 -662
- package/dist/esm/components/mui-button/index.js +299 -125
- package/dist/esm/components/mui-drawer/index.js +21 -7
- package/dist/esm/components/mui-icons/accessibility/index.js +3 -3
- package/dist/esm/components/mui-icons/add/index.js +3 -3
- package/dist/esm/components/mui-icons/attention/index.js +3 -3
- package/dist/esm/components/mui-icons/calendar/index.js +3 -3
- package/dist/esm/components/mui-icons/check/index.js +3 -3
- package/dist/esm/components/mui-icons/close/index.js +3 -3
- package/dist/esm/components/mui-icons/down-arrow-circle/index.js +3 -3
- package/dist/esm/components/mui-icons/down-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/ellipsis/index.js +3 -3
- package/dist/esm/components/mui-icons/gear/index.js +3 -3
- package/dist/esm/components/mui-icons/globe/index.js +3 -3
- package/dist/esm/components/mui-icons/grid/index.js +3 -3
- package/dist/esm/components/mui-icons/info/index.js +3 -3
- package/dist/esm/components/mui-icons/left-arrow/index.js +3 -3
- package/dist/esm/components/mui-icons/left-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/left-sidebar/index.js +3 -3
- package/dist/esm/components/mui-icons/menu/index.js +3 -3
- package/dist/esm/components/mui-icons/message/index.js +3 -3
- package/dist/esm/components/mui-icons/moon/index.js +3 -3
- package/dist/esm/components/mui-icons/notification/index.js +3 -3
- package/dist/esm/components/mui-icons/right-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/stop/index.js +3 -3
- package/dist/esm/components/mui-icons/subtract/index.js +3 -3
- package/dist/esm/components/mui-icons/sun/index.js +3 -3
- package/dist/esm/components/mui-icons/toggle/index.js +14 -14
- package/dist/esm/components/mui-icons/translate/index.js +3 -3
- package/dist/esm/components/mui-icons/up-arrow/index.js +3 -3
- package/dist/esm/components/mui-icons/up-chevron/index.js +3 -3
- package/dist/esm/components/mui-icons/warning/index.js +3 -3
- package/dist/esm/components/mui-input/index.js +51 -28
- package/dist/esm/components/mui-link/index.js +279 -40
- package/dist/esm/css/mui-reset.css +3 -3
- package/dist/esm/css/mui-tokens.css +31 -9
- package/dist/types/agent/prompts/index.d.ts +7 -2
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getPartMap as
|
|
1
|
+
import { getPartMap as u } from "../../utils/part-map/index.js";
|
|
2
2
|
class v extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
|
-
return ["onclick", "type", "aria-label", "disabled", "variant"];
|
|
4
|
+
return ["onclick", "type", "aria-label", "disabled", "variant", "size", "usage"];
|
|
5
5
|
}
|
|
6
6
|
constructor() {
|
|
7
7
|
super(), this.attachShadow({ mode: "open" });
|
|
8
8
|
}
|
|
9
9
|
async connectedCallback() {
|
|
10
|
-
if (await this.waitForPartMap(), !this.shadowRoot) return;
|
|
10
|
+
if (this.hasAttribute("size") || this.setAttribute("size", "medium"), await this.waitForPartMap(), !this.shadowRoot) return;
|
|
11
11
|
let a = (
|
|
12
12
|
/*html*/
|
|
13
13
|
`
|
|
@@ -41,7 +41,8 @@ class v extends HTMLElement {
|
|
|
41
41
|
text-align: inherit;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
/* Turned back on for focus-visible
|
|
45
|
+
========================================= */
|
|
45
46
|
button:focus-visible, button:active, button:hover { outline: var(--space-000); }
|
|
46
47
|
|
|
47
48
|
button:hover {
|
|
@@ -74,7 +75,6 @@ class v extends HTMLElement {
|
|
|
74
75
|
:host button:focus-visible ::slotted(.mui-icon) { fill: var(--action-primary-text-color-focus); }
|
|
75
76
|
:host button:disabled ::slotted(.mui-icon) { fill: var(--action-primary-text-color-disabled); }
|
|
76
77
|
|
|
77
|
-
|
|
78
78
|
/* Primary
|
|
79
79
|
========================================= */
|
|
80
80
|
:host([variant="primary"]) button {
|
|
@@ -211,8 +211,8 @@ class v extends HTMLElement {
|
|
|
211
211
|
display: flex;
|
|
212
212
|
justify-content: center;
|
|
213
213
|
align-items: center;
|
|
214
|
-
height:
|
|
215
|
-
width:
|
|
214
|
+
height: var(--action-icon-only-size);
|
|
215
|
+
width: var(--action-icon-only-size);
|
|
216
216
|
padding: var(--action-icon-only-padding);
|
|
217
217
|
}
|
|
218
218
|
/* ===================================== */
|
|
@@ -222,145 +222,280 @@ class v extends HTMLElement {
|
|
|
222
222
|
/* STYLE ADJUSTMENTS WHEN BUTTON IS SLOTTED WITHIN INPUT */
|
|
223
223
|
/* Related styles unique to this usage is found in the mui-input/index.js */
|
|
224
224
|
/* ========================================================================== */
|
|
225
|
+
:host([slot="before"][usage="input"]) button,
|
|
226
|
+
:host([slot="after"][usage="input"]) button {
|
|
227
|
+
border: var(--border-thin);
|
|
228
|
+
min-height: 4.4rem;
|
|
229
|
+
background: var(--input-background);
|
|
230
|
+
color: var(--action-secondary-text-color);
|
|
231
|
+
border-color: var(--form-default-border-color);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:host([slot="before"][usage="input"]) button:hover,
|
|
235
|
+
:host([slot="before"][usage="input"]) button:focus-visible,
|
|
236
|
+
:host([slot="after"][usage="input"]) button:hover,
|
|
237
|
+
:host([slot="after"][usage="input"]) button:focus-visible {
|
|
238
|
+
background: var(--input-background);
|
|
239
|
+
color: var(--action-secondary-text-color-hover);
|
|
240
|
+
border-color: var(--form-default-border-color-hover);
|
|
241
|
+
border-width: var(--stroke-size-100);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host([slot="after"][usage="input"]) button ::slotted(.mui-icon),
|
|
245
|
+
:host([slot="before"][usage="input"]) button ::slotted(.mui-icon) {
|
|
246
|
+
fill: var(--action-secondary-text-color);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:host([slot="after"][usage="input"]) button:hover ::slotted(.mui-icon),
|
|
250
|
+
:host([slot="before"][usage="input"]) button:hover ::slotted(.mui-icon) {
|
|
251
|
+
fill: var(--action-secondary-text-color-hover);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:host([slot="after"][usage="input"]) button:focus-visible ::slotted(.mui-icon),
|
|
255
|
+
:host([slot="before"][usage="input"]) button:focus-visible ::slotted(.mui-icon) {
|
|
256
|
+
fill: var(--action-secondary-text-color-focus);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
:host([slot="after"][usage="input"]) button:disabled ::slotted(.mui-icon),
|
|
260
|
+
:host([slot="before"][usage="input"]) button:disabled ::slotted(.mui-icon) {
|
|
261
|
+
fill: var(--action-secondary-text-color-disabled);
|
|
262
|
+
}
|
|
263
|
+
|
|
225
264
|
|
|
226
265
|
/* ========================================================================== */
|
|
227
266
|
/* BEFORE: When a BUTTON has slot="before" applied to host for INPUT usage */
|
|
228
267
|
/* ========================================================================== */
|
|
268
|
+
:host([slot="before"][usage="input"]) button {
|
|
269
|
+
border-right: none;
|
|
270
|
+
border-top-right-radius: var(--radius-000);
|
|
271
|
+
border-bottom-right-radius: var(--radius-000);
|
|
272
|
+
}
|
|
229
273
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
border-color: var(--form-default-border-color);
|
|
236
|
-
border-right: none;
|
|
237
|
-
border-top-right-radius: var(--radius-000);
|
|
238
|
-
border-bottom-right-radius: var(--radius-000);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
:host([slot="before"]) button:hover {
|
|
242
|
-
background: var(--action-secondary-background-hover);
|
|
243
|
-
color: var(--action-secondary-text-color-hover);
|
|
244
|
-
border-color: var(--form-default-border-color-hover);
|
|
245
|
-
}
|
|
274
|
+
:host([slot="before"][usage="input"]) button:hover,
|
|
275
|
+
:host([slot="before"][usage="input"]) button:focus-visible {
|
|
276
|
+
border-right: none;
|
|
277
|
+
box-shadow: var(--stroke-size-100) 0 0 0 var(--form-default-border-color-hover);
|
|
278
|
+
}
|
|
246
279
|
|
|
247
280
|
/* ========================================================================== */
|
|
248
281
|
/* AFTER: When a BUTTON has slot="after" applied to host for INPUT usage */
|
|
249
282
|
/* ========================================================================== */
|
|
283
|
+
:host([slot="after"][usage="input"]) button {
|
|
284
|
+
border-left: none;
|
|
285
|
+
border-top-left-radius: var(--radius-000);
|
|
286
|
+
border-bottom-left-radius: var(--radius-000);
|
|
287
|
+
}
|
|
250
288
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
border-color: var(--form-default-border-color);
|
|
257
|
-
border-left: none;
|
|
258
|
-
border-top-left-radius: var(--radius-000);
|
|
259
|
-
border-bottom-left-radius: var(--radius-000);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
:host([slot="after"]) button:hover,
|
|
263
|
-
:host([slot="after"]) button:focus-visible {
|
|
264
|
-
background: var(--action-secondary-background-hover);
|
|
265
|
-
color: var(--action-secondary-text-color-hover);
|
|
266
|
-
border-color: var(--form-default-border-color-hover);
|
|
267
|
-
}
|
|
289
|
+
:host([slot="after"][usage="input"]) button:hover,
|
|
290
|
+
:host([slot="after"][usage="input"]) button:focus-visible {
|
|
291
|
+
border-left: none;
|
|
292
|
+
box-shadow: calc(-1 * var(--stroke-size-100)) 0 0 0 var(--form-default-border-color-hover);
|
|
293
|
+
}
|
|
268
294
|
|
|
269
295
|
/* ========================================================================== */
|
|
270
296
|
|
|
271
297
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
298
|
+
:host(.alert-positive-slot) {
|
|
299
|
+
--alert-text: var(--feedback-positive-text);
|
|
300
|
+
--alert-icon: var(--feedback-positive-icon);
|
|
301
|
+
--alert-bg-hover: var(--feedback-positive-action-background);
|
|
302
|
+
}
|
|
277
303
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
304
|
+
:host(.alert-info-slot) {
|
|
305
|
+
--alert-text: var(--feedback-info-text);
|
|
306
|
+
--alert-icon: var(--feedback-info-icon);
|
|
307
|
+
--alert-bg-hover: var(--feedback-info-action-background);
|
|
308
|
+
}
|
|
283
309
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
310
|
+
:host(.alert-warning-slot) {
|
|
311
|
+
--alert-text: var(--feedback-warning-text);
|
|
312
|
+
--alert-icon: var(--feedback-warning-icon);
|
|
313
|
+
--alert-bg-hover: var(--feedback-warning-action-background);
|
|
314
|
+
}
|
|
289
315
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
316
|
+
:host(.alert-attention-slot) {
|
|
317
|
+
--alert-text: var(--feedback-attention-text);
|
|
318
|
+
--alert-icon: var(--feedback-attention-icon);
|
|
319
|
+
--alert-bg-hover: var(--feedback-attention-action-background);
|
|
320
|
+
}
|
|
295
321
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
322
|
+
:host(.alert-slot) button {
|
|
323
|
+
font-weight: var(--font-weight-semi-bold);
|
|
324
|
+
color: var(--alert-text);
|
|
325
|
+
}
|
|
300
326
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
327
|
+
:host(.alert-slot) button:hover,
|
|
328
|
+
:host(.alert-slot) button:focus-visible {
|
|
329
|
+
background: var(--alert-bg-hover);
|
|
330
|
+
color: var(--alert-text);
|
|
331
|
+
}
|
|
306
332
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
333
|
+
:host(.alert-slot) ::slotted(.mui-icon),
|
|
334
|
+
:host(.alert-slot):hover ::slotted(.mui-icon),
|
|
335
|
+
:host(.alert-slot):focus-visible ::slotted(.mui-icon) {
|
|
336
|
+
fill: var(--alert-icon);
|
|
337
|
+
}
|
|
312
338
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
339
|
+
/* Dropdown Slot */
|
|
340
|
+
:host(.dropdown-slot) button {
|
|
341
|
+
border-radius: var(--radius-000);
|
|
342
|
+
}
|
|
317
343
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
344
|
+
:host(.dropdown-slot) button:hover,
|
|
345
|
+
:host(.dropdown-slot) button:focus {
|
|
346
|
+
background: var(--dropdown-button-background-hover);
|
|
347
|
+
}
|
|
322
348
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
349
|
+
:host(.dropdown-slot-first) button {
|
|
350
|
+
border-top-left-radius: calc(var(--radius-100) / 2);
|
|
351
|
+
border-top-right-radius: calc(var(--radius-100) / 2);
|
|
352
|
+
}
|
|
327
353
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
354
|
+
:host(.dropdown-slot-last) button {
|
|
355
|
+
border-bottom-left-radius: calc(var(--radius-100) / 2);
|
|
356
|
+
border-bottom-right-radius: calc(var(--radius-100) / 2);
|
|
357
|
+
}
|
|
332
358
|
|
|
333
359
|
|
|
334
|
-
|
|
360
|
+
/* Before & After Icon
|
|
361
|
+
========================================= */
|
|
362
|
+
:host(.has-after) button,
|
|
363
|
+
:host(.has-before) button,
|
|
364
|
+
:host(.has-after.has-before) button {
|
|
365
|
+
display: grid;
|
|
366
|
+
align-items: center;
|
|
367
|
+
gap: var(--space-100);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
:host(.has-after.has-before) button {
|
|
371
|
+
grid-template-columns: auto 1fr auto;
|
|
372
|
+
padding-right: var(--action-after-slot-padding);
|
|
373
|
+
padding-left: var(--action-before-slot-padding);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
:host(.has-after) button {
|
|
377
|
+
grid-template-columns: 1fr auto;
|
|
378
|
+
padding-right: var(--action-after-slot-padding);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
:host(.has-before) button {
|
|
382
|
+
grid-template-columns: auto 1fr;
|
|
383
|
+
padding-left: var(--action-before-slot-padding);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
/* Size Variants
|
|
388
|
+
========================================= */
|
|
389
|
+
:host([size="x-small"]) button,
|
|
390
|
+
:host([size="x-small"]) button:hover,
|
|
391
|
+
:host([size="x-small"]) button:focus {
|
|
392
|
+
font-size: var(--text-font-size-xs);
|
|
393
|
+
line-height: var(--text-line-height-xs);
|
|
394
|
+
font-weight: var(--font-weight-semi-bold);
|
|
395
|
+
padding: var(--action-padding-x-small);
|
|
396
|
+
border-width: var(--stroke-size-100);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
:host([size="small"]) button {
|
|
400
|
+
font-size: var(--text-font-size-s);
|
|
401
|
+
line-height: var(--text-line-height-s);
|
|
402
|
+
padding: var(--action-padding-small);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
:host([size="medium"]) button {
|
|
406
|
+
font-size: var(--text-font-size-m);
|
|
407
|
+
line-height: var(--text-line-height-m);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
:host([size="large"]) button {
|
|
411
|
+
font-size: var(--text-font-size-l);
|
|
412
|
+
line-height: var(--text-line-height-l);
|
|
413
|
+
padding: var(--action-padding-large);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
:host([size="x-small"][icon-only]) button {
|
|
417
|
+
height: var(--action-icon-only-size-x-small);
|
|
418
|
+
width: var(--action-icon-only-size-x-small);
|
|
419
|
+
padding: var(--action-icon-only-padding);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
:host([size="small"][icon-only]) button {
|
|
423
|
+
height: var(--action-icon-only-size-small);
|
|
424
|
+
width: var(--action-icon-only-size-small);
|
|
425
|
+
padding: var(--action-icon-only-padding);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
:host([size="large"][icon-only]) button {
|
|
429
|
+
height: var(--action-icon-only-size-large);
|
|
430
|
+
width: var(--action-icon-only-size-large);
|
|
431
|
+
padding: var(--action-icon-only-padding);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
/* Before & After Icon
|
|
335
436
|
========================================= */
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
:
|
|
345
|
-
|
|
346
|
-
padding-right: var(--action-after-slot-padding);
|
|
347
|
-
padding-left: var(--action-before-slot-padding);
|
|
348
|
-
}
|
|
437
|
+
:host([size="x-small"].has-after) button,
|
|
438
|
+
:host([size="x-small"].has-before) button,
|
|
439
|
+
:host([size="x-small"].has-after.has-before) button {
|
|
440
|
+
gap: var(--space-025);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
:host([size="x-small"].has-after.has-before) button {
|
|
444
|
+
padding-right: var(--action-after-slot-padding-x-small);
|
|
445
|
+
padding-left: var(--action-before-slot-padding-x-small);
|
|
446
|
+
}
|
|
349
447
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
448
|
+
:host([size="x-small"].has-after) button {
|
|
449
|
+
padding-right: var(--action-after-slot-padding-x-small);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
:host([size="x-small"].has-before) button {
|
|
453
|
+
padding-left: var(--action-before-slot-padding-x-small);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
:host([size="small"].has-after) button,
|
|
457
|
+
:host([size="small"].has-before) button,
|
|
458
|
+
:host([size="small"].has-after.has-before) button {
|
|
459
|
+
gap: var(--space-050);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
:host([size="small"].has-after.has-before) button {
|
|
463
|
+
padding-right: var(--action-after-slot-padding-small);
|
|
464
|
+
padding-left: var(--action-before-slot-padding-small);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
:host([size="small"].has-after) button {
|
|
468
|
+
padding-right: var(--action-after-slot-padding-small);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
:host([size="small"].has-before) button {
|
|
472
|
+
padding-left: var(--action-before-slot-padding-small);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
:host([size="large"].has-after) button,
|
|
476
|
+
:host([size="large"].has-before) button,
|
|
477
|
+
:host([size="large"].has-after.has-before) button {
|
|
478
|
+
gap: var(--space-200);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
:host([size="large"].has-after.has-before) button {
|
|
482
|
+
padding-right: var(--action-after-slot-padding-large);
|
|
483
|
+
padding-left: var(--action-before-slot-padding-large);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
:host([size="large"].has-after) button {
|
|
487
|
+
padding-right: var(--action-after-slot-padding-large);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
:host([size="large"].has-before) button {
|
|
491
|
+
padding-left: var(--action-before-slot-padding-large);
|
|
492
|
+
}
|
|
354
493
|
|
|
355
|
-
:host(.has-before) button {
|
|
356
|
-
grid-template-columns: auto 1fr;
|
|
357
|
-
padding-left: var(--action-before-slot-padding);
|
|
358
|
-
}
|
|
359
494
|
|
|
360
495
|
</style>
|
|
361
496
|
|
|
362
497
|
<button
|
|
363
|
-
part="${
|
|
498
|
+
part="${u("text", "spacing", "layout", "visual")}"
|
|
364
499
|
onclick="${this.getAttribute("onclick")}"
|
|
365
500
|
type="${this.getAttribute("type") || "button"}"
|
|
366
501
|
aria-label="${this.getAttribute("aria-label") || ""}"
|
|
@@ -376,25 +511,64 @@ class v extends HTMLElement {
|
|
|
376
511
|
this.shadowRoot.innerHTML = a, await customElements.whenDefined("mui-button"), requestAnimationFrame(() => {
|
|
377
512
|
const e = this.shadowRoot;
|
|
378
513
|
if (!e) return;
|
|
379
|
-
const
|
|
514
|
+
const o = e.querySelector("slot:not([name])"), c = e.querySelector('slot[name="before"]'), s = e.querySelector('slot[name="after"]'), t = (i) => i ? i.assignedNodes({ flatten: !0 }).some((r) => {
|
|
515
|
+
var l;
|
|
516
|
+
return r.nodeType === Node.ELEMENT_NODE || r.nodeType === Node.TEXT_NODE && !!((l = r.textContent) != null && l.trim());
|
|
517
|
+
}) : !1, d = t(c), h = t(s);
|
|
518
|
+
this.classList.toggle("has-before", d), this.classList.toggle("has-after", h);
|
|
519
|
+
const b = (o == null ? void 0 : o.assignedNodes({ flatten: !0 })) ?? [];
|
|
520
|
+
b.every((i) => {
|
|
380
521
|
var r;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
522
|
+
if (i.nodeType === Node.ELEMENT_NODE) {
|
|
523
|
+
const l = i;
|
|
524
|
+
return l.tagName.toLowerCase() === "svg" || l.classList.contains("mui-icon");
|
|
525
|
+
}
|
|
526
|
+
return i.nodeType === Node.TEXT_NODE && !((r = i.textContent) != null && r.trim());
|
|
527
|
+
}) ? (this.setAttribute("icon-only", ""), this.updateIconSizes(b, !0)) : (this.removeAttribute("icon-only"), [c, o, s].forEach((r) => {
|
|
528
|
+
if (r) {
|
|
529
|
+
const l = r.assignedNodes({ flatten: !0 });
|
|
530
|
+
this.updateIconSizes(l, !1);
|
|
388
531
|
}
|
|
389
|
-
|
|
390
|
-
|
|
532
|
+
}));
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
attributeChangedCallback(n, a, e) {
|
|
536
|
+
n === "size" && a !== e && this.shadowRoot && requestAnimationFrame(() => {
|
|
537
|
+
const o = this.shadowRoot;
|
|
538
|
+
if (!o) return;
|
|
539
|
+
const c = [
|
|
540
|
+
o.querySelector("slot:not([name])"),
|
|
541
|
+
o.querySelector('slot[name="before"]'),
|
|
542
|
+
o.querySelector('slot[name="after"]')
|
|
543
|
+
], s = this.hasAttribute("icon-only");
|
|
544
|
+
c.forEach((t) => {
|
|
545
|
+
if (t) {
|
|
546
|
+
const d = t.assignedNodes({ flatten: !0 });
|
|
547
|
+
this.updateIconSizes(d, s);
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
updateIconSizes(n, a) {
|
|
553
|
+
const e = this.getAttribute("size") || "medium", c = {
|
|
554
|
+
"x-small": "x-small",
|
|
555
|
+
small: "x-small",
|
|
556
|
+
medium: a ? "medium" : "small",
|
|
557
|
+
// small for regular, medium for icon-only
|
|
558
|
+
large: a ? "large" : "medium"
|
|
559
|
+
}[e] || "small";
|
|
560
|
+
n.forEach((s) => {
|
|
561
|
+
if (s.nodeType === Node.ELEMENT_NODE) {
|
|
562
|
+
const t = s;
|
|
563
|
+
(t.tagName.toLowerCase() === "svg" || t.classList.contains("mui-icon") || t.tagName.toLowerCase() === "mui-icon") && !t.hasAttribute("size") && t.setAttribute("size", c);
|
|
564
|
+
}
|
|
391
565
|
});
|
|
392
566
|
}
|
|
393
567
|
waitForPartMap() {
|
|
394
568
|
return new Promise((n) => {
|
|
395
|
-
if (typeof
|
|
569
|
+
if (typeof u == "function") return n();
|
|
396
570
|
const a = () => {
|
|
397
|
-
typeof
|
|
571
|
+
typeof u == "function" ? n() : requestAnimationFrame(a);
|
|
398
572
|
};
|
|
399
573
|
a();
|
|
400
574
|
});
|
|
@@ -49,7 +49,7 @@ class p extends HTMLElement {
|
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
51
|
if (!this.shadowRoot) return;
|
|
52
|
-
const t = this.getAttribute("width") || "
|
|
52
|
+
const t = this.getAttribute("width") || "320px", e = this.getAttribute("variant") || "overlay", i = !!this.querySelector('[slot="before"]');
|
|
53
53
|
this._computedSide = this.getAttribute("side") || (i ? "right" : "left"), this.getAttribute("side") !== this._computedSide && this.setAttribute("side", this._computedSide);
|
|
54
54
|
const o = (
|
|
55
55
|
/*css*/
|
|
@@ -179,7 +179,7 @@ class p extends HTMLElement {
|
|
|
179
179
|
visibility: visible;
|
|
180
180
|
}
|
|
181
181
|
`
|
|
182
|
-
), r = this._computedSide === "left" ? "border-right: var(--border-thin);" : "border-left: var(--border-thin);",
|
|
182
|
+
), r = this._computedSide === "left" ? "border-right: var(--border-thin);" : "border-left: var(--border-thin);", l = (
|
|
183
183
|
/*css*/
|
|
184
184
|
`
|
|
185
185
|
.inner {
|
|
@@ -207,6 +207,11 @@ class p extends HTMLElement {
|
|
|
207
207
|
will-change: transform;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
:host([variant="push"]),
|
|
211
|
+
:host([variant="persistent"]) {
|
|
212
|
+
display: block;
|
|
213
|
+
width: 100%;
|
|
214
|
+
}
|
|
210
215
|
|
|
211
216
|
/* Push */
|
|
212
217
|
:host([variant="push"]) .shell {
|
|
@@ -230,6 +235,15 @@ class p extends HTMLElement {
|
|
|
230
235
|
/* Hidden & Persistent */
|
|
231
236
|
:host([open]) .outer,
|
|
232
237
|
:host([variant="persistent"]) .outer { ${r} }
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
/* Direct slotted element */
|
|
241
|
+
::slotted([slot="page"]) {
|
|
242
|
+
height: 100dvh;
|
|
243
|
+
overflow-y: auto;
|
|
244
|
+
-webkit-overflow-scrolling: touch;
|
|
245
|
+
}
|
|
246
|
+
|
|
233
247
|
`
|
|
234
248
|
), n = (
|
|
235
249
|
/*css*/
|
|
@@ -319,7 +333,7 @@ class p extends HTMLElement {
|
|
|
319
333
|
}
|
|
320
334
|
|
|
321
335
|
`
|
|
322
|
-
),
|
|
336
|
+
), d = this.getAttribute("side") || this._computedSide, h = e === "overlay" || e === "push";
|
|
323
337
|
let a = "";
|
|
324
338
|
const c = this.hasAttribute("drawer-space") ? "no-padding" : "";
|
|
325
339
|
e === "overlay" ? a = /*html*/
|
|
@@ -342,9 +356,9 @@ class p extends HTMLElement {
|
|
|
342
356
|
</div>
|
|
343
357
|
` : (e === "push" || e === "persistent") && (a = /*html*/
|
|
344
358
|
`
|
|
345
|
-
<style>${o}${
|
|
359
|
+
<style>${o}${l}${n}</style>
|
|
346
360
|
<div class="shell">
|
|
347
|
-
${
|
|
361
|
+
${d === "left" ? this.getDrawerTemplate(h) + '<slot name="page"></slot>' : '<slot name="page"></slot>' + this.getDrawerTemplate(h)}
|
|
348
362
|
</div>
|
|
349
363
|
`), this.shadowRoot.innerHTML = a;
|
|
350
364
|
}
|
|
@@ -368,14 +382,14 @@ class p extends HTMLElement {
|
|
|
368
382
|
e && e.classList.toggle("no-heading", !t);
|
|
369
383
|
}
|
|
370
384
|
attributeChangedCallback(t, e, i) {
|
|
371
|
-
t === "open" && this.syncOpenState(), t === "width" && this.innerEl && (this.innerEl.style.width = i || "
|
|
385
|
+
t === "open" && this.syncOpenState(), t === "width" && this.innerEl && (this.innerEl.style.width = i || "320px"), t === "side" && (this.render(), this.cacheEls(), this.attachEvents(), this.syncOpenState()), t === "variant" && (this.render(), this.cacheEls(), this.attachEvents(), this.syncOpenState());
|
|
372
386
|
}
|
|
373
387
|
syncOpenState() {
|
|
374
388
|
const t = this.hasAttribute("open"), e = this.getAttribute("variant") || "overlay", i = this.getAttribute("z-index"), o = i ? Number(i) : 10, s = i ? Number(i) + 1 : 11;
|
|
375
389
|
e === "overlay" && this.overlayEl && (this.overlayEl.style.visibility = t ? "visible" : "hidden", this.overlayEl.style.opacity = t ? "1" : "0", this.overlayEl.style.zIndex = o.toString(), this.innerEl.style.zIndex = s.toString(), this.inert = !t), e === "push" && this.outer && (this.updateLayout(e, t), this.outer.style.zIndex = s.toString(), this.outer.inert = !t), e === "persistent" && this.outer && (this.updateLayout(e, t), this.outer.inert = !1);
|
|
376
390
|
}
|
|
377
391
|
updateLayout(t, e) {
|
|
378
|
-
const i = this.getAttribute("width") || "
|
|
392
|
+
const i = this.getAttribute("width") || "320px", o = this.getAttribute("side") || this._computedSide, s = t === "push" ? this.pushLayout : t === "persistent" ? this.persistentLayout : null;
|
|
379
393
|
if (!s) return;
|
|
380
394
|
if (window.innerWidth <= this.getBreakpoint()) {
|
|
381
395
|
t === "push" ? s.style.removeProperty("grid-template-columns") : t === "persistent" && (s.style.display = "grid", s.style.removeProperty("grid-template-columns"));
|
|
@@ -17,9 +17,9 @@ class l extends HTMLElement {
|
|
|
17
17
|
inverted: "var(--icon-color-inverted)"
|
|
18
18
|
}[t] || t || "var(--icon-color-default)", s = {
|
|
19
19
|
"x-small": "1.6rem",
|
|
20
|
-
small: "2.
|
|
21
|
-
medium: "
|
|
22
|
-
large: "
|
|
20
|
+
small: "2.1rem",
|
|
21
|
+
medium: "2.4rem",
|
|
22
|
+
large: "2.8rem"
|
|
23
23
|
}, o = s[e] ?? s.small;
|
|
24
24
|
this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
25
25
|
`
|
|
@@ -17,9 +17,9 @@ class r extends HTMLElement {
|
|
|
17
17
|
inverted: "var(--icon-color-inverted)"
|
|
18
18
|
}[t] || t || "var(--icon-color-default)", o = {
|
|
19
19
|
"x-small": "1.6rem",
|
|
20
|
-
small: "2.
|
|
21
|
-
medium: "
|
|
22
|
-
large: "
|
|
20
|
+
small: "2.1rem",
|
|
21
|
+
medium: "2.4rem",
|
|
22
|
+
large: "2.8rem"
|
|
23
23
|
}, s = o[e] ?? o.small;
|
|
24
24
|
this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
25
25
|
`
|
|
@@ -17,9 +17,9 @@ class c extends HTMLElement {
|
|
|
17
17
|
inverted: "var(--icon-color-inverted)"
|
|
18
18
|
}[t] || t || "var(--icon-color-default)", o = {
|
|
19
19
|
"x-small": "1.6rem",
|
|
20
|
-
small: "2.
|
|
21
|
-
medium: "
|
|
22
|
-
large: "
|
|
20
|
+
small: "2.1rem",
|
|
21
|
+
medium: "2.4rem",
|
|
22
|
+
large: "2.8rem"
|
|
23
23
|
}, s = o[e] ?? o.small;
|
|
24
24
|
this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
25
25
|
`
|
|
@@ -17,9 +17,9 @@ class l extends HTMLElement {
|
|
|
17
17
|
inverted: "var(--icon-color-inverted)"
|
|
18
18
|
}[c] || c || "var(--icon-color-default)", i = {
|
|
19
19
|
"x-small": "1.6rem",
|
|
20
|
-
small: "2.
|
|
21
|
-
medium: "
|
|
22
|
-
large: "
|
|
20
|
+
small: "2.1rem",
|
|
21
|
+
medium: "2.4rem",
|
|
22
|
+
large: "2.8rem"
|
|
23
23
|
}, o = i[t] ?? i.small;
|
|
24
24
|
this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
25
25
|
`
|
|
@@ -17,9 +17,9 @@ class c extends HTMLElement {
|
|
|
17
17
|
inverted: "var(--icon-color-inverted)"
|
|
18
18
|
}[t] || t || "var(--icon-color-default)", o = {
|
|
19
19
|
"x-small": "1.6rem",
|
|
20
|
-
small: "2.
|
|
21
|
-
medium: "
|
|
22
|
-
large: "
|
|
20
|
+
small: "2.1rem",
|
|
21
|
+
medium: "2.4rem",
|
|
22
|
+
large: "2.8rem"
|
|
23
23
|
}, s = o[e] ?? o.small;
|
|
24
24
|
this.classList.add("mui-icon"), this.shadowRoot && (this.shadowRoot.innerHTML = /*html*/
|
|
25
25
|
`
|