@maggioli-design-system/magma 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +64 -22
- package/dist/cjs/mds-avatar.cjs.entry.js +27 -32
- package/dist/cjs/mds-badge.cjs.entry.js +3 -2
- package/dist/cjs/mds-benchmark-bar.cjs.entry.js +3 -2
- package/dist/cjs/mds-bibliography.cjs.entry.js +4 -3
- package/dist/cjs/mds-button_3.cjs.entry.js +36 -10
- package/dist/cjs/mds-dropdown.cjs.entry.js +4 -3
- package/dist/cjs/mds-entity.cjs.entry.js +1 -1
- package/dist/cjs/mds-file-preview.cjs.entry.js +17 -17
- package/dist/cjs/mds-header.cjs.entry.js +17 -8
- package/dist/cjs/mds-img.cjs.entry.js +3 -3
- package/dist/cjs/mds-input-date-range.cjs.entry.js +7 -5
- package/dist/cjs/mds-input-select.cjs.entry.js +10 -8
- package/dist/cjs/mds-input-upload.cjs.entry.js +10 -6
- package/dist/cjs/mds-input.cjs.entry.js +4 -4
- package/dist/cjs/mds-keyboard-key.cjs.entry.js +8 -5
- package/dist/cjs/mds-keyboard.cjs.entry.js +6 -3
- package/dist/cjs/mds-mention.cjs.entry.js +3 -2
- package/dist/cjs/mds-notification.cjs.entry.js +11 -8
- package/dist/cjs/mds-pref-language-item.cjs.entry.js +3 -2
- package/dist/cjs/mds-pref-theme-item.cjs.entry.js +3 -2
- package/dist/cjs/mds-push-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/mds-stepper-bar.cjs.entry.js +5 -3
- package/dist/cjs/mds-tab-bar-item.cjs.entry.js +3 -2
- package/dist/cjs/mds-table-header-cell.cjs.entry.js +2 -2
- package/dist/cjs/mds-text.cjs.entry.js +2 -1
- package/dist/cjs/mds-toast.cjs.entry.js +9 -3
- package/dist/cjs/mds-tooltip.cjs.entry.js +4 -4
- package/dist/collection/components/mds-avatar/mds-avatar.js +27 -32
- package/dist/collection/components/mds-badge/mds-badge.js +3 -2
- package/dist/collection/components/mds-benchmark-bar/mds-benchmark-bar.js +3 -2
- package/dist/collection/components/mds-bibliography/mds-bibliography.js +4 -3
- package/dist/collection/components/mds-button/mds-button.js +7 -6
- package/dist/collection/components/mds-dropdown/mds-dropdown.js +4 -3
- package/dist/collection/components/mds-file-preview/mds-file-preview.js +6 -7
- package/dist/collection/components/mds-header/mds-header.js +17 -8
- package/dist/collection/components/mds-icon/mds-icon.js +29 -4
- package/dist/collection/components/mds-icon/services/icons-set.service.js +47 -18
- package/dist/collection/components/mds-img/mds-img.js +3 -3
- package/dist/collection/components/mds-input/mds-input.js +4 -4
- package/dist/collection/components/mds-input-date-range/mds-input-date-range.js +7 -5
- package/dist/collection/components/mds-input-select/mds-input-select.js +10 -8
- package/dist/collection/components/mds-input-upload/mds-input-upload.js +10 -6
- package/dist/collection/components/mds-keyboard/mds-keyboard.js +6 -3
- package/dist/collection/components/mds-keyboard-key/mds-keyboard-key.js +8 -5
- package/dist/collection/components/mds-mention/mds-mention.js +3 -2
- package/dist/collection/components/mds-notification/mds-notification.js +11 -8
- package/dist/collection/components/mds-pref-language-item/mds-pref-language-item.js +3 -2
- package/dist/collection/components/mds-pref-theme-item/mds-pref-theme-item.js +3 -2
- package/dist/collection/components/mds-stepper-bar/mds-stepper-bar.js +5 -3
- package/dist/collection/components/mds-tab-bar-item/mds-tab-bar-item.js +3 -2
- package/dist/collection/components/mds-table-header-cell/mds-table-header-cell.js +2 -2
- package/dist/collection/components/mds-text/mds-text.js +2 -1
- package/dist/collection/components/mds-toast/mds-toast.js +9 -3
- package/dist/collection/components/mds-tooltip/mds-tooltip.js +4 -4
- package/dist/collection/dictionary/icon.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mds-accordion-item.js +1 -1
- package/dist/components/mds-accordion-timer-item.js +1 -1
- package/dist/components/mds-avatar-stack-item.js +1 -1
- package/dist/components/mds-avatar-stack.js +1 -1
- package/dist/components/mds-avatar.js +1 -1
- package/dist/components/mds-badge.js +1 -1
- package/dist/components/mds-banner.js +1 -1
- package/dist/components/mds-benchmark-bar.js +1 -1
- package/dist/components/mds-bibliography.js +1 -1
- package/dist/components/mds-breadcrumb-item.js +1 -1
- package/dist/components/mds-breadcrumb.js +1 -1
- package/dist/components/mds-button-dropdown.js +1 -1
- package/dist/components/mds-button.js +1 -1
- package/dist/components/mds-calendar-cell.js +1 -1
- package/dist/components/mds-calendar.js +1 -1
- package/dist/components/mds-chip.js +1 -1
- package/dist/components/mds-dropdown.js +1 -1
- package/dist/components/mds-entity.js +1 -1
- package/dist/components/mds-file-preview.js +1 -1
- package/dist/components/mds-file.js +3 -3
- package/dist/components/mds-filter-item.js +1 -1
- package/dist/components/mds-filter.js +1 -1
- package/dist/components/mds-header-bar.js +1 -1
- package/dist/components/mds-header.js +1 -1
- package/dist/components/mds-help.js +1 -1
- package/dist/components/mds-horizontal-scroll.js +1 -1
- package/dist/components/mds-icon.js +1 -1
- package/dist/components/mds-img.js +1 -1
- package/dist/components/mds-input-date-range-preselection.js +1 -1
- package/dist/components/mds-input-date-range.js +1 -1
- package/dist/components/mds-input-date.js +1 -1
- package/dist/components/mds-input-field.js +1 -1
- package/dist/components/mds-input-otp.js +1 -1
- package/dist/components/mds-input-range.js +1 -1
- package/dist/components/mds-input-select.js +1 -1
- package/dist/components/mds-input-switch.js +1 -1
- package/dist/components/mds-input-tip-item.js +1 -1
- package/dist/components/mds-input-upload.js +1 -1
- package/dist/components/mds-input.js +1 -1
- package/dist/components/mds-keyboard-key.js +1 -1
- package/dist/components/mds-keyboard.js +1 -1
- package/dist/components/mds-kpi-item.js +1 -1
- package/dist/components/mds-label.js +1 -1
- package/dist/components/mds-list-item.js +1 -1
- package/dist/components/mds-mention.js +1 -1
- package/dist/components/mds-modal.js +1 -1
- package/dist/components/mds-note.js +1 -1
- package/dist/components/mds-notification.js +1 -1
- package/dist/components/mds-paginator-item.js +1 -1
- package/dist/components/mds-paginator.js +1 -1
- package/dist/components/mds-policy-ai.js +1 -1
- package/dist/components/mds-pref-animation.js +1 -1
- package/dist/components/mds-pref-consumption.js +1 -1
- package/dist/components/mds-pref-contrast.js +1 -1
- package/dist/components/mds-pref-language-item.js +1 -1
- package/dist/components/mds-pref-language.js +1 -1
- package/dist/components/mds-pref-mode.js +1 -1
- package/dist/components/mds-pref-theme-item.js +1 -1
- package/dist/components/mds-pref-theme.js +1 -1
- package/dist/components/mds-pref.js +1 -1
- package/dist/components/mds-price-table-features-cell.js +1 -1
- package/dist/components/mds-price-table-features.js +1 -1
- package/dist/components/mds-price-table-list-item.js +1 -1
- package/dist/components/mds-progress.js +1 -1
- package/dist/components/mds-push-notification-item.js +1 -1
- package/dist/components/mds-push-notification.js +1 -1
- package/dist/components/mds-quote.js +1 -1
- package/dist/components/mds-radial-menu-item.js +1 -1
- package/dist/components/mds-radial-menu.js +1 -1
- package/dist/components/mds-radial-progress.js +1 -1
- package/dist/components/mds-status-bar.js +1 -1
- package/dist/components/mds-stepper-bar-item.js +1 -1
- package/dist/components/mds-stepper-bar.js +1 -1
- package/dist/components/mds-tab-bar-item.js +1 -1
- package/dist/components/mds-tab-item.js +1 -1
- package/dist/components/mds-table-header-cell.js +1 -1
- package/dist/components/mds-table-header.js +1 -1
- package/dist/components/mds-table-row.js +1 -1
- package/dist/components/mds-table.js +1 -1
- package/dist/components/mds-text.js +1 -1
- package/dist/components/mds-toast.js +1 -1
- package/dist/components/mds-tooltip.js +1 -1
- package/dist/components/mds-tree-item.js +1 -1
- package/dist/components/mds-url-view.js +1 -1
- package/dist/components/mds-usage.js +1 -1
- package/dist/components/{p-D3-GP4KF.js → p-6K9sFzLr.js} +1 -1
- package/dist/components/p-BBhbQT2f.js +1 -0
- package/dist/components/{p-B2A_hlV2.js → p-BFpRu7yD.js} +1 -1
- package/dist/components/p-BL63WAAq.js +8 -0
- package/dist/components/{p-Deh5Aia-.js → p-BShLEry5.js} +1 -1
- package/dist/components/{p-BJNK4p33.js → p-BYxxgEE_.js} +1 -1
- package/dist/components/p-BZFyAX-6.js +1 -0
- package/dist/components/p-BtMdmkID.js +1 -0
- package/dist/components/{p-Caksrfcd.js → p-ByaUOMp0.js} +1 -1
- package/dist/components/p-C1xZO_fq.js +1 -0
- package/dist/components/{p-cBZsPiMJ.js → p-C6Q4zFh6.js} +1 -1
- package/dist/components/{p-DLE5TNTp.js → p-CUQ7WIXh.js} +1 -1
- package/dist/components/p-Cd_8zD_I.js +1 -0
- package/dist/components/{p-DtxB7DYE.js → p-CnAeawmf.js} +1 -1
- package/dist/components/{p-Bt4xX5ww.js → p-DCrjf0F0.js} +1 -1
- package/dist/components/p-DlHJvYE7.js +1 -0
- package/dist/components/{p-BH3bWzRT.js → p-DlaJNPdd.js} +1 -1
- package/dist/components/{p-sqRs6oj4.js → p-DnrQaRnh.js} +1 -1
- package/dist/components/{p-CBLAz3_J.js → p-OPg_Naue.js} +1 -1
- package/dist/components/{p-C03KYHGv.js → p-RS4yyl41.js} +1 -1
- package/dist/components/{p--8aaJX-p.js → p-gv3eu44S.js} +1 -1
- package/dist/components/p-kff6xSdW.js +1 -0
- package/dist/components/p-pys1EQ60.js +1 -0
- package/dist/components/p-qketFgr0.js +1 -0
- package/dist/components/p-zml3K7nx.js +1 -0
- package/dist/documentation.json +4 -4
- package/dist/esm/index.js +64 -22
- package/dist/esm/mds-avatar.entry.js +27 -32
- package/dist/esm/mds-badge.entry.js +3 -2
- package/dist/esm/mds-benchmark-bar.entry.js +3 -2
- package/dist/esm/mds-bibliography.entry.js +4 -3
- package/dist/esm/mds-button_3.entry.js +36 -10
- package/dist/esm/mds-dropdown.entry.js +4 -3
- package/dist/esm/mds-entity.entry.js +1 -1
- package/dist/esm/mds-file-preview.entry.js +17 -17
- package/dist/esm/mds-header.entry.js +17 -8
- package/dist/esm/mds-img.entry.js +3 -3
- package/dist/esm/mds-input-date-range.entry.js +7 -5
- package/dist/esm/mds-input-select.entry.js +10 -8
- package/dist/esm/mds-input-upload.entry.js +10 -6
- package/dist/esm/mds-input.entry.js +4 -4
- package/dist/esm/mds-keyboard-key.entry.js +8 -5
- package/dist/esm/mds-keyboard.entry.js +6 -3
- package/dist/esm/mds-mention.entry.js +3 -2
- package/dist/esm/mds-notification.entry.js +11 -8
- package/dist/esm/mds-pref-language-item.entry.js +3 -2
- package/dist/esm/mds-pref-theme-item.entry.js +3 -2
- package/dist/esm/mds-push-notification-item.entry.js +1 -1
- package/dist/esm/mds-stepper-bar.entry.js +5 -3
- package/dist/esm/mds-tab-bar-item.entry.js +3 -2
- package/dist/esm/mds-table-header-cell.entry.js +2 -2
- package/dist/esm/mds-text.entry.js +2 -1
- package/dist/esm/mds-toast.entry.js +9 -3
- package/dist/esm/mds-tooltip.entry.js +4 -4
- package/dist/esm-es5/index.js +37 -26
- package/dist/esm-es5/mds-avatar.entry.js +4 -2
- package/dist/esm-es5/mds-badge.entry.js +2 -3
- package/dist/esm-es5/mds-benchmark-bar.entry.js +2 -3
- package/dist/esm-es5/mds-bibliography.entry.js +1 -1
- package/dist/esm-es5/mds-button_3.entry.js +14 -9
- package/dist/esm-es5/mds-dropdown.entry.js +2 -2
- package/dist/esm-es5/mds-entity.entry.js +1 -1
- package/dist/esm-es5/mds-file-preview.entry.js +7 -5
- package/dist/esm-es5/mds-header.entry.js +8 -6
- package/dist/esm-es5/mds-img.entry.js +1 -1
- package/dist/esm-es5/mds-input-date-range.entry.js +5 -3
- package/dist/esm-es5/mds-input-select.entry.js +8 -6
- package/dist/esm-es5/mds-input-upload.entry.js +3 -1
- package/dist/esm-es5/mds-input.entry.js +3 -3
- package/dist/esm-es5/mds-keyboard-key.entry.js +3 -1
- package/dist/esm-es5/mds-keyboard.entry.js +4 -2
- package/dist/esm-es5/mds-mention.entry.js +1 -1
- package/dist/esm-es5/mds-notification.entry.js +4 -2
- package/dist/esm-es5/mds-pref-language-item.entry.js +2 -2
- package/dist/esm-es5/mds-pref-theme-item.entry.js +2 -2
- package/dist/esm-es5/mds-push-notification-item.entry.js +1 -1
- package/dist/esm-es5/mds-stepper-bar.entry.js +4 -4
- package/dist/esm-es5/mds-tab-bar-item.entry.js +3 -4
- package/dist/esm-es5/mds-table-header-cell.entry.js +1 -1
- package/dist/esm-es5/mds-text.entry.js +1 -1
- package/dist/esm-es5/mds-toast.entry.js +4 -2
- package/dist/esm-es5/mds-tooltip.entry.js +2 -2
- package/dist/hydrate/index.js +270 -164
- package/dist/hydrate/index.mjs +270 -164
- package/dist/magma-components/index.esm.js +1 -1
- package/dist/magma-components/magma-components.esm.js +1 -1
- package/dist/magma-components/p-005172ba.entry.js +1 -0
- package/dist/magma-components/{p-9ca7932d.system.entry.js → p-05fa40aa.system.entry.js} +5 -3
- package/dist/magma-components/p-0827a5bd.entry.js +1 -0
- package/dist/magma-components/{p-1a8c5086.system.entry.js → p-15c77a98.system.entry.js} +2 -2
- package/dist/magma-components/p-18473d2f.entry.js +1 -0
- package/dist/magma-components/{p-f0a168f4.system.entry.js → p-18667ae7.system.entry.js} +3 -3
- package/dist/magma-components/p-19adde9d.entry.js +1 -0
- package/dist/magma-components/p-2217a7be.entry.js +1 -0
- package/dist/magma-components/{p-5a7ead55.system.entry.js → p-2386f0d6.system.entry.js} +2 -2
- package/dist/magma-components/p-2b56fc14.entry.js +1 -0
- package/dist/magma-components/p-3f747a63.system.entry.js +1 -0
- package/dist/magma-components/p-3ff30842.system.entry.js +16 -0
- package/dist/magma-components/{p-be692266.system.entry.js → p-49b120cb.system.entry.js} +2 -2
- package/dist/magma-components/{p-6cd7cfe3.entry.js → p-4af76eb3.entry.js} +1 -1
- package/dist/magma-components/p-4ba6cb3f.entry.js +1 -0
- package/dist/magma-components/p-4cadbd49.entry.js +1 -0
- package/dist/magma-components/p-518b55f3.entry.js +1 -0
- package/dist/magma-components/{p-960dc9b5.system.entry.js → p-5eec629c.system.entry.js} +4 -2
- package/dist/magma-components/{p-a8ec3080.system.entry.js → p-646034cb.system.entry.js} +1 -1
- package/dist/magma-components/{p-ce4e1a41.system.entry.js → p-677ab154.system.entry.js} +3 -1
- package/dist/magma-components/p-759133b3.entry.js +1 -0
- package/dist/magma-components/{p-cd5866c8.entry.js → p-7912f877.entry.js} +1 -1
- package/dist/magma-components/{p-3d8e63a2.system.entry.js → p-7d304fd4.system.entry.js} +3 -1
- package/dist/magma-components/{p-07fde74d.system.entry.js → p-7f6d708c.system.entry.js} +6 -4
- package/dist/magma-components/{p-6edc4f16.system.entry.js → p-88564e9b.system.entry.js} +1 -1
- package/dist/magma-components/{p-8c4fb7ec.system.entry.js → p-8b1abf81.system.entry.js} +10 -8
- package/dist/magma-components/p-8bbee38d.entry.js +1 -0
- package/dist/magma-components/{p-481008e9.system.entry.js → p-8bf680d6.system.entry.js} +5 -3
- package/dist/magma-components/{p-ce0ecc75.system.entry.js → p-8cb3a071.system.entry.js} +2 -2
- package/dist/magma-components/p-8f229eaf.entry.js +1 -0
- package/dist/magma-components/{p-3f7d3060.system.entry.js → p-94fa3396.system.entry.js} +14 -9
- package/dist/magma-components/{p-0ad3b4da.system.entry.js → p-9bbd4193.system.entry.js} +6 -6
- package/dist/magma-components/p-9caffe14.entry.js +1 -0
- package/dist/magma-components/p-9de1ac7f.entry.js +1 -0
- package/dist/magma-components/p-CnXBPjmc.system.js +1 -1
- package/dist/magma-components/{p-CBam2PI8.system.js → p-DVd2EM-q.system.js} +29 -18
- package/dist/magma-components/{p-f1462410.system.entry.js → p-a15da479.system.entry.js} +3 -4
- package/dist/magma-components/{p-e05d2df8.system.entry.js → p-ab997243.system.entry.js} +2 -2
- package/dist/magma-components/{p-efe8d359.entry.js → p-aea6081f.entry.js} +1 -1
- package/dist/magma-components/{p-1c0a7e24.system.entry.js → p-b0539d61.system.entry.js} +7 -5
- package/dist/magma-components/p-cc033985.system.entry.js +14 -0
- package/dist/magma-components/{p-a3fc2ea4.system.entry.js → p-cd84a264.system.entry.js} +7 -5
- package/dist/magma-components/p-d0457835.entry.js +1 -0
- package/dist/magma-components/p-d64311e2.entry.js +1 -0
- package/dist/magma-components/{p-54b995c2.system.entry.js → p-da4dc390.system.entry.js} +1 -1
- package/dist/magma-components/p-dda7a33b.entry.js +1 -0
- package/dist/magma-components/p-e375c8b1.entry.js +1 -0
- package/dist/magma-components/p-e3fce8ca.entry.js +1 -0
- package/dist/magma-components/{p-9626eaff.system.entry.js → p-e9a16f22.system.entry.js} +3 -3
- package/dist/magma-components/p-ea0091b6.entry.js +1 -0
- package/dist/magma-components/{p-a3279a73.system.entry.js → p-ec00defc.system.entry.js} +6 -4
- package/dist/magma-components/p-edfb0d7a.entry.js +1 -0
- package/dist/magma-components/{p-0715a2cb.system.entry.js → p-f9d9cf7c.system.entry.js} +2 -3
- package/dist/magma-components/p-fa163e86.entry.js +1 -0
- package/dist/magma-components/p-fe19080a.entry.js +8 -0
- package/dist/magma-components/p-ff49fb35.entry.js +1 -0
- package/dist/stats.json +383 -383
- package/dist/types/components/mds-avatar/mds-avatar.d.ts +2 -0
- package/dist/types/components/mds-header/mds-header.d.ts +1 -0
- package/dist/types/components/mds-icon/mds-icon.d.ts +5 -0
- package/dist/types/components/mds-icon/services/icons-set.service.d.ts +10 -9
- package/dist/types/components/mds-input-select/mds-input-select.d.ts +1 -0
- package/dist/types/components/mds-toast/mds-toast.d.ts +1 -0
- package/package.json +10 -10
- package/dist/components/p-B9DJLgwr.js +0 -1
- package/dist/components/p-BouRLCYL.js +0 -1
- package/dist/components/p-CVgKDZPF.js +0 -1
- package/dist/components/p-CatD1iUY.js +0 -1
- package/dist/components/p-CbufYCNj.js +0 -1
- package/dist/components/p-Cehcn85x.js +0 -1
- package/dist/components/p-ClKNADBg.js +0 -8
- package/dist/components/p-D8I1RblC.js +0 -1
- package/dist/components/p-DaI5QqNu.js +0 -1
- package/dist/components/p-Dj_oN194.js +0 -1
- package/dist/components/p-DmELzfvf.js +0 -1
- package/dist/magma-components/p-03be5c0c.entry.js +0 -1
- package/dist/magma-components/p-0af8d821.entry.js +0 -1
- package/dist/magma-components/p-1780b8ba.entry.js +0 -1
- package/dist/magma-components/p-1dcfb13e.entry.js +0 -1
- package/dist/magma-components/p-241dbf61.entry.js +0 -1
- package/dist/magma-components/p-27ea99ee.entry.js +0 -8
- package/dist/magma-components/p-4297da23.system.entry.js +0 -1
- package/dist/magma-components/p-454c4774.entry.js +0 -1
- package/dist/magma-components/p-59de81ac.entry.js +0 -1
- package/dist/magma-components/p-5e43274a.system.entry.js +0 -15
- package/dist/magma-components/p-66ce2dee.entry.js +0 -1
- package/dist/magma-components/p-69d1b815.entry.js +0 -1
- package/dist/magma-components/p-75fcf1a4.entry.js +0 -1
- package/dist/magma-components/p-78fef00a.entry.js +0 -1
- package/dist/magma-components/p-7fc29447.entry.js +0 -1
- package/dist/magma-components/p-8b7fa8d7.entry.js +0 -1
- package/dist/magma-components/p-9b2ee3fe.entry.js +0 -1
- package/dist/magma-components/p-a5ac5e0b.entry.js +0 -1
- package/dist/magma-components/p-a906a02f.system.entry.js +0 -16
- package/dist/magma-components/p-ac544ab1.entry.js +0 -1
- package/dist/magma-components/p-b23a6c83.entry.js +0 -1
- package/dist/magma-components/p-b9fecfd5.entry.js +0 -1
- package/dist/magma-components/p-c1fb2eb7.entry.js +0 -1
- package/dist/magma-components/p-c70d7159.entry.js +0 -1
- package/dist/magma-components/p-ddbdce09.entry.js +0 -1
- package/dist/magma-components/p-e3e893c4.entry.js +0 -1
- package/dist/magma-components/p-e4868ade.entry.js +0 -1
package/dist/documentation.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
2
|
+
"timestamp": "2026-10-05T09:28:12",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.44.2",
|
|
@@ -11579,9 +11579,9 @@
|
|
|
11579
11579
|
}
|
|
11580
11580
|
],
|
|
11581
11581
|
"usage": {
|
|
11582
|
-
"1. Description": "The `<mds-icon>` web component is the single glyph primitive of the Magma Design System: it inlines an SVG into the DOM so the artwork inherits color and sizing from CSS, and it is the building block that nearly every other component (button, chip, input, banner, list-item, etc.) composes to render its iconography. It replaces a raw `<img>`/`<svg>` tag and centralizes how icon artwork is resolved.\n\n#### Semantic Behavior\n\n- **Decorative by default**: The icon contributes no accessible name; meaning must come from the surrounding labelled control or text.\n- **Source resolution**: `name` is interpreted three ways - a base64 `data:` SVG string is decoded inline, a raw `<svg>`/`<?xml>` markup string is used verbatim, and anything else is treated as an icon filename slug fetched from the configured SVG directory.\n- **Async load**: When `name` is a slug the icon paints once the SVG arrives; a failed fetch renders empty rather than throwing.\n- **Path configuration**: The SVG directory is set programmatically via the shared `IconsSetService.setSvgPath()` singleton (imported from `@maggioli-design-system/magma/services`), with the `mdsIconSvgPath` `sessionStorage` key as an optional fallback and the `setSvgPath` instance / `setSvgPathStatic` static methods as alternatives; icons that mounted before the path was configured reload themselves once it is set.\n\n#### Properties & Visual Configurations\n\n- **`name`** is the only configurable input and is overloaded: pass an icon filename slug to pull artwork from the shared library, a base64-encoded SVG `data:` URI for inline/dynamic artwork, or a full raw SVG string when the markup is generated at runtime.\n\nThis component does not use the shared `variant` / `tone` / `size` ladders defined in [`projects/stencil/SPEC.md`](../../../../SPEC.md#tone-and-variant-system); color and dimensions are inherited from the host context via CSS (e.g. `currentColor` and font size), which is how parent components tint and scale their icons.\n",
|
|
11583
|
-
"2. Pattern": "Correct and idiomatic ways to use the `<mds-icon>` component, ordered from most common to most specialized. Patterns assume a working knowledge of the icon slug conventions documented in [`projects/stencil/SPEC.md`](../../../../SPEC.md) and the catalogue in [`docs/COMPONENTS.md`](../../../../../../docs/COMPONENTS.md).\n\n#### Icon Slug from the Shared Library\n\nThe canonical form. Pass a slug string as `name`; the component fetches the matching SVG from the configured assets directory. Slugs follow the convention of the active iconsauce plugin: `mi/<variant>/<name>` for Material Icons, `mdi/<name>` for Material Design Icons, and a semantic name for the internal `mgg-icons` set.\n\n```html\n<!-- Material Icons baseline variant -->\n<mds-icon name=\"mi/baseline/search\"></mds-icon>\n\n<!-- Material Design Icons -->\n<mds-icon name=\"mdi/alien\"></mds-icon>\n\n<!-- Internal mgg-icons semantic slug -->\n<mds-icon name=\"action-email-send\"></mds-icon>\n```\n\n#### Configuring the SVG Base Path via `IconsSetService` (recommended)\n\nImport the shared `IconsSetService` singleton from the package's `services` entry point and call `setSvgPath()`. It updates the shared, in-memory icon path - kept on `globalThis` so every bundled copy of the service (lazy chunks, `esm`/`esm-es5` variants, `dist/components`) agrees on it - and notifies all mounted icons to (re)load immediately. **No `sessionStorage` is involved**, which makes it the safest option when storage is blocked (incognito, sandboxed iframes, storage partitioning). Pass an absolute path (starting with `/`) or a full URL.\n\n```javascript\nimport { IconsSetService } from '@maggioli-design-system/magma/services';\n\nIconsSetService.setSvgPath('/assets/img/svg/');\n```\n\nIt can be called before or after the icons mount: instances mounted earlier re-fetch automatically once the path is set. Always use the exported `IconsSetService`; do not construct your own controller, which would keep a separate icon cache and listener list.\n\n#### Configuring the SVG Base Path via sessionStorage (optional)\n\nSet `mdsIconSvgPath` in `sessionStorage` before any `<mds-icon>` mounts; every icon instance falls back to this key when no path has been set programmatically. This one-liner is convenient but **may be blocked** by some browsers, privacy/incognito modes, storage partitioning, or sandboxed iframes - when that happens, use `IconsSetService.setSvgPath()` above instead.\n\n```javascript\nwindow.sessionStorage.setItem('mdsIconSvgPath', 'assets/img/svg/');\n```\n\n#### Forcing a Reload After Late Path Configuration\n\nIf icons are already in the DOM when the SVG path is set (for example, inside a lazy-loaded module), dispatch `mdsIconSvgPathUpdate` after configuring the path. Every mounted instance listens for this event and re-fetches.\n\n```javascript\nwindow.sessionStorage.setItem('mdsIconSvgPath', 'assets/img/svg/');\nwindow.dispatchEvent(new CustomEvent('mdsIconSvgPathUpdate'));\n```\n\n#### Configuring the SVG Base Path via the Instance Method\n\nAn alternative to `IconsSetService` when you already hold an `<mds-icon>` element: call its `setSvgPath` `@Method`. It delegates to the same singleton, so the effect is identical - prefer `IconsSetService` unless creating an element is more convenient (for example, in isolated testing environments).\n\n```javascript\nawait customElements.whenDefined('mds-icon');\nconst tmp = document.createElement('mds-icon');\ndocument.body.appendChild(tmp);\nif ('setSvgPath' in tmp) {\n tmp.setSvgPath('/assets/img/svg/');\n}\ndocument.body.removeChild(tmp);\n```\n\n#### Inline Raw SVG String\n\nPass a full SVG markup string as `name` when the artwork is generated or received at runtime and does not have a slug in the library. The component uses the string verbatim - no network request is made.\n\n```html\n<mds-icon\n name='<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2L2 22h20L12 2z\"/></svg>'\n></mds-icon>\n```\n\n#### Base64-encoded SVG Data URI\n\nPass a `data:image/svg+xml;base64,...` string when the icon is delivered from an API as a Base64 payload. The component decodes it inline - no external fetch occurs.\n\n```html\n<mds-icon name=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci...\"></mds-icon>\n```\n\n#### Sizing via CSS Width\n\n`<mds-icon>` is `display: inline-flex` with `aspect-ratio: 1` and a default width of `--spacing(600)`. Override size by setting a `width` on the host - height scales automatically via the aspect ratio. Use Magma spacing tokens to stay on-grid.\n\n```html\n<!-- Small icon using a Tailwind spacing utility -->\n<mds-icon name=\"mi/baseline/info\" class=\"w-800\"></mds-icon>\n\n<!-- Large icon -->\n<mds-icon name=\"mi/baseline/star\" class=\"w-1200\"></mds-icon>\n```\n\n#### Coloring via `fill` Utility or `currentColor`\n\nThe inlined SVG inherits `currentColor` from the host element, so setting `color` on a parent or a Tailwind `fill-*` utility on the host is enough to tint the artwork. Use Magma color tokens.\n\n```html\n<!-- Tint with a Magma label token -->\n<mds-icon name=\"mi/baseline/check-circle\" class=\"fill-label-green-06\"></mds-icon>\n\n<!-- Inherit the current text color from a parent -->\n<p class=\"text-status-success-05\">\n <mds-icon name=\"mi/baseline/check\"></mds-icon>\n Operazione completata\n</p>\n```\n\n#### Standalone Decorative Icon Inside a Labelled Control\n\n`<mds-icon>` renders with `aria-hidden=\"true\"` on its inner element; it carries no accessible name itself. When used standalone next to visible text, no extra ARIA is needed. When used as the only visual indicator inside an interactive control, the control must supply the accessible name.\n\n```html\n<!-- Decorative: the adjacent text provides the meaning -->\n<span class=\"flex items-center gap-200\">\n <mds-icon name=\"mi/baseline/email\"></mds-icon>\n Invia messaggio\n</span>\n```\n\n#### Styling via `::part(svg)`\n\nThe single documented shadow part is `svg` - the `<i>` wrapper around the inlined SVG. Use `::part(svg)` only for deep SVG styling not achievable through `fill` or `color`. Keep to documented parts; undocumented internals can change on minor releases.\n\n```css\nmds-icon::part(svg) {\n filter: drop-shadow(0 1px 2px rgb(var(--tone-kaolin-07)));\n}\n```\n",
|
|
11584
|
-
"3. Antipattern": "Common incorrect uses of `<mds-icon>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`docs/COMPONENTS.md`](../../../../../../docs/COMPONENTS.md#system-level-anti-patterns) - they apply here too but are not repeated.\n\n#### Do Not Use `<img>` or Inline `<svg>` Instead of `<mds-icon>`\n\nUsing a raw `<img src=\"...svg\">` or a hardcoded `<svg>` literal bypasses the iconsauce build pipeline (tree-shaking, caching, path management) and the shared theming surface. Use `<mds-icon name=\"...\">` with the slug so the icon is tree-shaken, cached, and inherits color from CSS.\n\n```html\n<!-- 🚫 INCORRECT -->\n<img src=\"/assets/img/svg/mi/baseline/add.svg\" alt=\"\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"...\"/></svg>\n\n<!-- ✅ CORRECT -->\n<mds-icon name=\"mi/baseline/add\"></mds-icon>\n```\n\n#### Do Not Slot `<mds-icon>` to Add an Icon to Another Component\n\n`<mds-icon>` has no slot and accepts no children. Other Magma components expose an `icon` prop that renders the SVG through the shared service with correct positioning. Slotting `<mds-icon>` into the default slot of another component is stripped or misaligned.\n\n```html\n<!-- 🚫 INCORRECT -->\n<mds-button>\n <mds-icon name=\"mi/baseline/add\"></mds-icon>\n Aggiungi\n</mds-button>\n\n<!-- ✅ CORRECT -->\n<mds-button label=\"Aggiungi\" icon=\"mi/baseline/add\" variant=\"secondary\" tone=\"weak\"></mds-button>\n```\n\n#### Do Not Configure the Path with a Bare Relative Value\n\n`setSvgPath` (on `IconsSetService`, the element, or the static method) treats an absolute path (starting with `/`) as relative to `window.location.origin`, and accepts full URLs. A bare relative value like `assets/svg/` is *accepted* but resolved against the **current page URL
|
|
11582
|
+
"1. Description": "The `<mds-icon>` web component is the single glyph primitive of the Magma Design System: it inlines an SVG into the DOM so the artwork inherits color and sizing from CSS, and it is the building block that nearly every other component (button, chip, input, banner, list-item, etc.) composes to render its iconography. It replaces a raw `<img>`/`<svg>` tag and centralizes how icon artwork is resolved.\n\n#### Semantic Behavior\n\n- **Decorative by default**: The icon contributes no accessible name; meaning must come from the surrounding labelled control or text.\n- **Source resolution**: `name` is interpreted three ways - a base64 `data:` SVG string is decoded inline, a raw `<svg>`/`<?xml>` markup string is used verbatim, and anything else is treated as an icon filename slug fetched from the configured SVG directory. Without a `name` (attribute missing or empty, property `undefined` or `null`) the icon renders nothing, sends no request and logs nothing; removing `name` clears the icon.\n- **Async load**: When `name` is a slug the icon paints once the SVG arrives; a failed fetch renders empty rather than throwing. Only the latest `name` and SVG path count: a request that finishes after a newer one is discarded.\n- **Path configuration**: The SVG directory is set programmatically via the shared `IconsSetService.setSvgPath()` singleton (imported from `@maggioli-design-system/magma/services`), with the `mdsIconSvgPath` `sessionStorage` key as an optional fallback and the `setSvgPath` instance / `setSvgPathStatic` static methods as alternatives; icons that mounted before the path was configured reload themselves once it is set. An icon removed from the page stops listening for path changes; once it is put back it picks up a path set in the meantime.\n\n#### Properties & Visual Configurations\n\n- **`name`** is the only configurable input and is overloaded: pass an icon filename slug to pull artwork from the shared library, a base64-encoded SVG `data:` URI for inline/dynamic artwork, or a full raw SVG string when the markup is generated at runtime.\n\nThis component does not use the shared `variant` / `tone` / `size` ladders defined in [`projects/stencil/SPEC.md`](../../../../SPEC.md#tone-and-variant-system); color and dimensions are inherited from the host context via CSS (e.g. `currentColor` and font size), which is how parent components tint and scale their icons.\n",
|
|
11583
|
+
"2. Pattern": "Correct and idiomatic ways to use the `<mds-icon>` component, ordered from most common to most specialized. Patterns assume a working knowledge of the icon slug conventions documented in [`projects/stencil/SPEC.md`](../../../../SPEC.md) and the catalogue in [`docs/COMPONENTS.md`](../../../../../../docs/COMPONENTS.md).\n\n#### Icon Slug from the Shared Library\n\nThe canonical form. Pass a slug string as `name`; the component fetches the matching SVG from the configured assets directory. Slugs follow the convention of the active iconsauce plugin: `mi/<variant>/<name>` for Material Icons, `mdi/<name>` for Material Design Icons, and a semantic name for the internal `mgg-icons` set.\n\n```html\n<!-- Material Icons baseline variant -->\n<mds-icon name=\"mi/baseline/search\"></mds-icon>\n\n<!-- Material Design Icons -->\n<mds-icon name=\"mdi/alien\"></mds-icon>\n\n<!-- Internal mgg-icons semantic slug -->\n<mds-icon name=\"action-email-send\"></mds-icon>\n```\n\n#### Configuring the SVG Base Path via `IconsSetService` (recommended)\n\nImport the shared `IconsSetService` singleton from the package's `services` entry point and call `setSvgPath()`. It updates the shared, in-memory icon path - kept on `globalThis` so every bundled copy of the service (lazy chunks, `esm`/`esm-es5` variants, `dist/components`) agrees on it - and notifies all mounted icons to (re)load immediately. **No `sessionStorage` is involved**, which makes it the safest option when storage is blocked (incognito, sandboxed iframes, storage partitioning). Pass an absolute path (starting with `/`) or a full URL. The icons are downloaded with `fetch`: under a Content Security Policy the origin of the path must be allowed by `connect-src` (or `default-src`), which `'self'` already does for a path on the page's own origin, while a CDN must be listed.\n\n```javascript\nimport { IconsSetService } from '@maggioli-design-system/magma/services';\n\nIconsSetService.setSvgPath('/assets/img/svg/');\n```\n\nIt can be called before or after the icons mount: instances mounted earlier re-fetch automatically once the path is set. Always use the exported `IconsSetService`; do not construct your own controller, which would keep a separate icon cache and listener list.\n\n#### Configuring the SVG Base Path via sessionStorage (optional)\n\nSet `mdsIconSvgPath` in `sessionStorage` before any `<mds-icon>` mounts; every icon instance falls back to this key when no path has been set programmatically. This one-liner is convenient but **may be blocked** by some browsers, privacy/incognito modes, storage partitioning, or sandboxed iframes - when that happens, use `IconsSetService.setSvgPath()` above instead.\n\n```javascript\nwindow.sessionStorage.setItem('mdsIconSvgPath', 'assets/img/svg/');\n```\n\n#### Forcing a Reload After Late Path Configuration\n\nIf icons are already in the DOM when the SVG path is set (for example, inside a lazy-loaded module), dispatch `mdsIconSvgPathUpdate` after configuring the path. Every mounted instance listens for this event and re-fetches.\n\n```javascript\nwindow.sessionStorage.setItem('mdsIconSvgPath', 'assets/img/svg/');\nwindow.dispatchEvent(new CustomEvent('mdsIconSvgPathUpdate'));\n```\n\n#### Configuring the SVG Base Path via the Instance Method\n\nAn alternative to `IconsSetService` when you already hold an `<mds-icon>` element: call its `setSvgPath` `@Method`. It delegates to the same singleton, so the effect is identical - prefer `IconsSetService` unless creating an element is more convenient (for example, in isolated testing environments).\n\n```javascript\nawait customElements.whenDefined('mds-icon');\nconst tmp = document.createElement('mds-icon');\ndocument.body.appendChild(tmp);\nif ('setSvgPath' in tmp) {\n tmp.setSvgPath('/assets/img/svg/');\n}\ndocument.body.removeChild(tmp);\n```\n\n#### Inline Raw SVG String\n\nPass a full SVG markup string as `name` when the artwork is generated or received at runtime and does not have a slug in the library. The component uses the string verbatim - no network request is made.\n\n```html\n<mds-icon\n name='<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2L2 22h20L12 2z\"/></svg>'\n></mds-icon>\n```\n\n#### Base64-encoded SVG Data URI\n\nPass a `data:image/svg+xml;base64,...` string when the icon is delivered from an API as a Base64 payload. The component decodes it inline - no external fetch occurs.\n\n```html\n<mds-icon name=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci...\"></mds-icon>\n```\n\n#### Sizing via CSS Width\n\n`<mds-icon>` is `display: inline-flex` with `aspect-ratio: 1` and a default width of `--spacing(600)`. Override size by setting a `width` on the host - height scales automatically via the aspect ratio. Use Magma spacing tokens to stay on-grid.\n\n```html\n<!-- Small icon using a Tailwind spacing utility -->\n<mds-icon name=\"mi/baseline/info\" class=\"w-800\"></mds-icon>\n\n<!-- Large icon -->\n<mds-icon name=\"mi/baseline/star\" class=\"w-1200\"></mds-icon>\n```\n\n#### Coloring via `fill` Utility or `currentColor`\n\nThe inlined SVG inherits `currentColor` from the host element, so setting `color` on a parent or a Tailwind `fill-*` utility on the host is enough to tint the artwork. Use Magma color tokens.\n\n```html\n<!-- Tint with a Magma label token -->\n<mds-icon name=\"mi/baseline/check-circle\" class=\"fill-label-green-06\"></mds-icon>\n\n<!-- Inherit the current text color from a parent -->\n<p class=\"text-status-success-05\">\n <mds-icon name=\"mi/baseline/check\"></mds-icon>\n Operazione completata\n</p>\n```\n\n#### Standalone Decorative Icon Inside a Labelled Control\n\n`<mds-icon>` renders with `aria-hidden=\"true\"` on its inner element; it carries no accessible name itself. When used standalone next to visible text, no extra ARIA is needed. When used as the only visual indicator inside an interactive control, the control must supply the accessible name.\n\n```html\n<!-- Decorative: the adjacent text provides the meaning -->\n<span class=\"flex items-center gap-200\">\n <mds-icon name=\"mi/baseline/email\"></mds-icon>\n Invia messaggio\n</span>\n```\n\n#### Styling via `::part(svg)`\n\nThe single documented shadow part is `svg` - the `<i>` wrapper around the inlined SVG. Use `::part(svg)` only for deep SVG styling not achievable through `fill` or `color`. Keep to documented parts; undocumented internals can change on minor releases.\n\n```css\nmds-icon::part(svg) {\n filter: drop-shadow(0 1px 2px rgb(var(--tone-kaolin-07)));\n}\n```\n",
|
|
11584
|
+
"3. Antipattern": "Common incorrect uses of `<mds-icon>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`docs/COMPONENTS.md`](../../../../../../docs/COMPONENTS.md#system-level-anti-patterns) - they apply here too but are not repeated.\n\n#### Do Not Use `<img>` or Inline `<svg>` Instead of `<mds-icon>`\n\nUsing a raw `<img src=\"...svg\">` or a hardcoded `<svg>` literal bypasses the iconsauce build pipeline (tree-shaking, caching, path management) and the shared theming surface. Use `<mds-icon name=\"...\">` with the slug so the icon is tree-shaken, cached, and inherits color from CSS.\n\n```html\n<!-- 🚫 INCORRECT -->\n<img src=\"/assets/img/svg/mi/baseline/add.svg\" alt=\"\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"...\"/></svg>\n\n<!-- ✅ CORRECT -->\n<mds-icon name=\"mi/baseline/add\"></mds-icon>\n```\n\n#### Do Not Slot `<mds-icon>` to Add an Icon to Another Component\n\n`<mds-icon>` has no slot and accepts no children. Other Magma components expose an `icon` prop that renders the SVG through the shared service with correct positioning. Slotting `<mds-icon>` into the default slot of another component is stripped or misaligned.\n\n```html\n<!-- 🚫 INCORRECT -->\n<mds-button>\n <mds-icon name=\"mi/baseline/add\"></mds-icon>\n Aggiungi\n</mds-button>\n\n<!-- ✅ CORRECT -->\n<mds-button label=\"Aggiungi\" icon=\"mi/baseline/add\" variant=\"secondary\" tone=\"weak\"></mds-button>\n```\n\n#### Do Not Configure the Path with a Bare Relative Value\n\n`setSvgPath` (on `IconsSetService`, the element, or the static method) treats an absolute path (starting with `/`) as relative to `window.location.origin`, and accepts full URLs. A bare relative value like `assets/svg/` is *accepted* but resolved against the **current page URL** (or the `<base href>`, when the page has one) on each request, so it silently breaks on nested routes (e.g. `/users/42/`). Always pass an absolute path or a full URL. Only an empty/whitespace value, or one that is not a URL (e.g. `http://`), throws (`Svg path not recognize …`).\n\n```javascript\n// 🚫 FRAGILE - resolved relative to the current page, breaks on nested routes\nIconsSetService.setSvgPath('assets/svg/');\n\n// ✅ CORRECT - absolute path (prefixed with the origin)\nIconsSetService.setSvgPath('/assets/svg/');\n\n// ✅ CORRECT - full URL (for example a CDN)\nIconsSetService.setSvgPath('https://cdn.example.com/svg/');\n```\n\n#### Do Not Rely on `<mds-icon>` for an Accessible Label\n\n`<mds-icon>` renders its inner element with `aria-hidden=\"true\"`. An icon used as the sole indicator inside an interactive control or next to no visible text provides no accessible name by itself. The surrounding control must carry the accessible name.\n\n```html\n<!-- 🚫 INCORRECT - button has no accessible name -->\n<button>\n <mds-icon name=\"mi/baseline/delete\"></mds-icon>\n</button>\n\n<!-- ✅ CORRECT - use mds-button with aria-label -->\n<mds-button\n icon=\"mi/baseline/delete\"\n aria-label=\"Elimina elemento\"\n variant=\"error\"\n tone=\"text\"\n></mds-button>\n```\n\n#### Do Not Pierce the Shadow DOM to Style the SVG\n\nThe only supported styling surface is `::part(svg)` and CSS custom properties (color, fill) set on the host. Using `>>>`, `/deep/`, or descendant selectors on `.icon` or internal class names couples code to the Shadow DOM structure and breaks on minor releases.\n\n```css\n/* 🚫 INCORRECT */\nmds-icon >>> .icon svg path {\n fill: red;\n}\nmds-icon .icon {\n transform: rotate(45deg);\n}\n\n/* ✅ CORRECT */\nmds-icon {\n color: rgb(var(--status-error-05));\n}\nmds-icon::part(svg) {\n transform: rotate(45deg);\n}\n```\n\n#### Do Not Add `.svg` Extension to a Slug\n\nThe slug passed to `name` must not include the `.svg` extension - the service appends it when building the fetch URL. Adding the extension causes a double-`.svg` path (`mi/baseline/close.svg.svg`) that returns a 404.\n\n```html\n<!-- 🚫 INCORRECT -->\n<mds-icon name=\"mi/baseline/close.svg\"></mds-icon>\n\n<!-- ✅ CORRECT -->\n<mds-icon name=\"mi/baseline/close\"></mds-icon>\n```\n\n#### Do Not Override Size with Fixed `width` and `height` HTML Attributes\n\n`<mds-icon>` is a custom element - HTML `width` and `height` attributes have no effect on it. Size is controlled by the CSS `width` property on the host (height follows from `aspect-ratio: 1`). Use a Tailwind width utility or a custom CSS rule.\n\n```html\n<!-- 🚫 INCORRECT - attributes are ignored -->\n<mds-icon name=\"mi/baseline/star\" width=\"32\" height=\"32\"></mds-icon>\n\n<!-- ✅ CORRECT - CSS width drives the size -->\n<mds-icon name=\"mi/baseline/star\" class=\"w-1200\"></mds-icon>\n```\n"
|
|
11585
11585
|
},
|
|
11586
11586
|
"props": [
|
|
11587
11587
|
{
|
package/dist/esm/index.js
CHANGED
|
@@ -9,10 +9,23 @@ function promisifyRequest(request) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
function createStore(dbName, storeName) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
let dbp;
|
|
13
|
+
const getDB = () => {
|
|
14
|
+
if (dbp)
|
|
15
|
+
return dbp;
|
|
16
|
+
const request = indexedDB.open(dbName);
|
|
17
|
+
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
18
|
+
dbp = promisifyRequest(request);
|
|
19
|
+
dbp.then((db) => {
|
|
20
|
+
// It seems like Safari sometimes likes to just close the connection.
|
|
21
|
+
// It's supposed to fire this event when that happens. Let's hope it does!
|
|
22
|
+
db.onclose = () => (dbp = undefined);
|
|
23
|
+
}, () => {
|
|
24
|
+
dbp = undefined;
|
|
25
|
+
});
|
|
26
|
+
return dbp;
|
|
27
|
+
};
|
|
28
|
+
return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
16
29
|
}
|
|
17
30
|
let defaultGetStoreFunc;
|
|
18
31
|
function defaultGetStore() {
|
|
@@ -96,7 +109,7 @@ class IconsSetController {
|
|
|
96
109
|
this._iconsSets = new Map();
|
|
97
110
|
this._svgPathUpdate = 'mdsIconSvgPathUpdate';
|
|
98
111
|
this.cacheExp = 60 * 60 * 1000 * 24;
|
|
99
|
-
this.listeners =
|
|
112
|
+
this.listeners = new Set();
|
|
100
113
|
this.memoryCache = {};
|
|
101
114
|
// Try to retrieve svg from cache
|
|
102
115
|
this.isCacheAvailable = async (url) => {
|
|
@@ -175,29 +188,46 @@ class IconsSetController {
|
|
|
175
188
|
return { set: this._iconsSets.get(iconName.split('/')[0]) };
|
|
176
189
|
}
|
|
177
190
|
/**
|
|
178
|
-
*
|
|
191
|
+
* Sets the directory of the svg files. Query and fragment are dropped: the icon name is
|
|
192
|
+
* appended to the path.
|
|
179
193
|
*
|
|
180
|
-
* input path: https://www.abc.com/svg/path
|
|
181
|
-
* svgPath =
|
|
194
|
+
* input path: https://www.abc.com/svg/path/
|
|
195
|
+
* svgPath = https://www.abc.com/svg/path/
|
|
182
196
|
*
|
|
183
|
-
* input path: localhost:9000/svg/path
|
|
184
|
-
* svgPath = localhost:9000/svg/path
|
|
197
|
+
* input path: localhost:9000/svg/path/
|
|
198
|
+
* svgPath = //localhost:9000/svg/path/ (with the protocol of the page)
|
|
185
199
|
*
|
|
186
|
-
* input path: /svg/path
|
|
187
|
-
* svgPath =
|
|
200
|
+
* input path: /svg/path/ or svg/path/
|
|
201
|
+
* svgPath = unchanged, resolved by `fetch` against the document base URL on each request
|
|
188
202
|
*
|
|
189
|
-
* input path:
|
|
203
|
+
* input path: empty or not a URL
|
|
190
204
|
* throw error
|
|
191
|
-
*
|
|
192
205
|
*/
|
|
193
206
|
setSvgPath(svgPath) {
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
207
|
+
const error = Error(`Svg path not recognize ${svgPath}, ensure is a absolute path starting with '/' or a url`);
|
|
208
|
+
if (typeof svgPath !== 'string' || svgPath.trim() === '') {
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
const value = svgPath.trim();
|
|
212
|
+
// a host with a port and no scheme (`localhost:9000/svg/`) would be read as the scheme `localhost:`
|
|
213
|
+
const path = /^[\w.-]+:\d+(\/|$)/.test(value) ? `//${value}` : value;
|
|
214
|
+
let url;
|
|
215
|
+
try {
|
|
216
|
+
// the placeholder base only validates a path, which is kept as it is
|
|
217
|
+
url = new URL(path, 'http://localhost/');
|
|
218
|
+
}
|
|
219
|
+
catch (_a) {
|
|
220
|
+
throw error;
|
|
198
221
|
}
|
|
199
222
|
if (typeof window !== 'undefined') {
|
|
200
|
-
|
|
223
|
+
if (/^[a-z][a-z\d+.-]*:/i.test(path)) {
|
|
224
|
+
url.search = '';
|
|
225
|
+
url.hash = '';
|
|
226
|
+
this._svgPath = url.href;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
this._svgPath = path.replace(/[?#].*$/, '');
|
|
230
|
+
}
|
|
201
231
|
window.dispatchEvent(new Event(this._svgPathUpdate));
|
|
202
232
|
}
|
|
203
233
|
}
|
|
@@ -205,7 +235,10 @@ class IconsSetController {
|
|
|
205
235
|
return this._svgPath;
|
|
206
236
|
}
|
|
207
237
|
registerListener(callback) {
|
|
208
|
-
this.listeners.
|
|
238
|
+
this.listeners.add(callback);
|
|
239
|
+
}
|
|
240
|
+
unregisterListener(callback) {
|
|
241
|
+
this.listeners.delete(callback);
|
|
209
242
|
}
|
|
210
243
|
setUpListener() {
|
|
211
244
|
if (typeof window !== 'undefined') {
|
|
@@ -225,6 +258,10 @@ class IconsSetController {
|
|
|
225
258
|
if (Build.isServer && !Build.isTesting) {
|
|
226
259
|
return '';
|
|
227
260
|
}
|
|
261
|
+
// an icon without the attribute passes an undefined (or null) name: there is nothing to load
|
|
262
|
+
if (!name) {
|
|
263
|
+
return '';
|
|
264
|
+
}
|
|
228
265
|
try {
|
|
229
266
|
if (!this._svgPath && typeof window === 'undefined') {
|
|
230
267
|
throw Error('Cant find svgPath, ensure you set it');
|
|
@@ -246,9 +283,14 @@ class IconsSetController {
|
|
|
246
283
|
}
|
|
247
284
|
}
|
|
248
285
|
const src = this._svgPath && !name.startsWith('http') ? this._svgPath.concat(name, '.svg') : name;
|
|
286
|
+
// Memory first: every instance of an icon already loaded skips the IndexedDB round-trip
|
|
287
|
+
if (this.memoryCache[src]) {
|
|
288
|
+
return this.memoryCache[src];
|
|
289
|
+
}
|
|
249
290
|
const lsCache = await this.isCacheAvailable(src);
|
|
250
|
-
if (
|
|
251
|
-
|
|
291
|
+
if (lsCache) {
|
|
292
|
+
this.memoryCache[src] = lsCache;
|
|
293
|
+
return lsCache;
|
|
252
294
|
}
|
|
253
295
|
const response = await fetch(src);
|
|
254
296
|
if (!response.ok) {
|
|
@@ -113,9 +113,25 @@ const MdsAvatar = class {
|
|
|
113
113
|
this.handleImgLoadSuccess = () => {
|
|
114
114
|
this.loaded = true;
|
|
115
115
|
};
|
|
116
|
+
// a removed attribute or a null bound by a framework counts as not set, like '' or 0
|
|
117
|
+
this.hasCount = () => {
|
|
118
|
+
var _a;
|
|
119
|
+
const count = (_a = this.count) !== null && _a !== void 0 ? _a : 0;
|
|
120
|
+
return count !== 0 && !Number.isNaN(count);
|
|
121
|
+
};
|
|
122
|
+
this.checkTexts = () => {
|
|
123
|
+
var _a;
|
|
124
|
+
const initials = (_a = this.initials) !== null && _a !== void 0 ? _a : '';
|
|
125
|
+
if (initials !== '')
|
|
126
|
+
this.checkText(initials);
|
|
127
|
+
if (this.hasCount())
|
|
128
|
+
this.checkText(String(this.count));
|
|
129
|
+
};
|
|
116
130
|
this.checkInitialsVariant = () => {
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
var _a;
|
|
132
|
+
const initials = (_a = this.initials) !== null && _a !== void 0 ? _a : '';
|
|
133
|
+
if (initials !== '') {
|
|
134
|
+
let cleanedInitials = initials
|
|
119
135
|
.toLowerCase()
|
|
120
136
|
.replace(/[^a-zA-Z0-9]+/g, '')
|
|
121
137
|
.substring(0, 2);
|
|
@@ -136,21 +152,13 @@ const MdsAvatar = class {
|
|
|
136
152
|
if (this.src !== undefined) {
|
|
137
153
|
this.loaded = false;
|
|
138
154
|
}
|
|
139
|
-
|
|
140
|
-
this.checkText(this.initials);
|
|
141
|
-
}
|
|
142
|
-
if (this.count !== undefined && this.count !== 0 && !Number.isNaN(this.count)) {
|
|
143
|
-
this.checkText(this.count.toString());
|
|
144
|
-
}
|
|
155
|
+
this.checkTexts();
|
|
145
156
|
}
|
|
146
157
|
componentDidRender() {
|
|
147
158
|
if (this.textChanged) {
|
|
148
159
|
// placed here becase @Watch('initials') is fired
|
|
149
160
|
// BEFORE the element .fit is attached on shDOM
|
|
150
|
-
|
|
151
|
-
this.checkText(this.initials);
|
|
152
|
-
if (this.count !== undefined && this.count !== 0 && !Number.isNaN(this.count))
|
|
153
|
-
this.checkText(this.count.toString());
|
|
161
|
+
this.checkTexts();
|
|
154
162
|
this.textChanged = false;
|
|
155
163
|
}
|
|
156
164
|
}
|
|
@@ -173,26 +181,13 @@ const MdsAvatar = class {
|
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
render() {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
'avatar--fallback', this.icon && 'avatar--icon', this.loaded ? 'avatar--loaded' : 'avatar--pending'), part: "wrapper" }, this.initials &&
|
|
184
|
-
(this.count === undefined || this.count === 0 || Number.isNaN(this.count)) &&
|
|
185
|
-
!this.fallback &&
|
|
186
|
-
(this.src === undefined || this.src === '') && (h("div", { key: '08dd0918a258022793f5331a9de7b2460a2e1404', class: "initials-text" }, h("span", { key: '69379497bb9096cea56b366c52ba5372adb5506d', class: "fit" }, this.initials.substring(0, 2)))), this.count && !this.fallback && (this.src === undefined || this.src === '') && (h("div", { key: '07c1e94db40562b8a2467605591236433fd6af39', class: "initials-text" }, h("span", { key: '36c2b72540c03d140f97d64304d46583419d23df', class: "fit" }, "+", this.count))), this.src &&
|
|
187
|
-
(this.count === undefined || this.count === 0 || Number.isNaN(this.count)) &&
|
|
188
|
-
!this.fallback &&
|
|
189
|
-
(this.icon === undefined || this.icon === '') && (h("mds-img", { key: '9d6a6d4a12a5142686aede6e9f9a974f592b674f', class: "image", loading: "lazy", onMdsImgLoadError: this.handleImgLoadError, onMdsImgLoadSuccess: this.handleImgLoadSuccess, part: "media", src: this.src })), this.icon &&
|
|
190
|
-
(this.initials === undefined || this.initials === '') &&
|
|
191
|
-
(this.count === undefined || this.count === 0 || Number.isNaN(this.count)) && (h("mds-icon", { key: 'b37eae32b77654190b14d8b046d2f9a51801ae2a', class: "icon", part: "icon", name: this.icon })), (this.fallback ||
|
|
192
|
-
((this.icon === undefined || this.icon === '') &&
|
|
193
|
-
(this.initials === undefined || this.initials === '') &&
|
|
194
|
-
(this.count === undefined || this.count === 0 || Number.isNaN(this.count)) &&
|
|
195
|
-
(this.src === undefined || this.src === ''))) && (h("i", { key: '18d842d4aea1f73adef926ff74a896a9d8a52bc6', class: "fallback-icon", innerHTML: miBaselinePerson })))));
|
|
184
|
+
var _a, _b, _c, _d;
|
|
185
|
+
const hasCount = this.hasCount();
|
|
186
|
+
const icon = (_a = this.icon) !== null && _a !== void 0 ? _a : '';
|
|
187
|
+
const hasIcon = icon !== '';
|
|
188
|
+
const hasInitials = ((_b = this.initials) !== null && _b !== void 0 ? _b : '') !== '';
|
|
189
|
+
const hasSrc = ((_c = this.src) !== null && _c !== void 0 ? _c : '') !== '';
|
|
190
|
+
return (h(Host, { key: '87e19218bbfe6e9c79f5edd7b4dd0350572b4f84', "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast }, h("div", { key: 'b8775a55b682778312539df8ba0d8107075873e1', class: clsx('avatar', hasInitials && !this.fallback && !hasSrc && 'avatar--initials', (this.fallback || (!hasIcon && !hasInitials && !hasSrc)) && 'avatar--fallback', hasIcon && 'avatar--icon', this.loaded ? 'avatar--loaded' : 'avatar--pending'), part: "wrapper" }, hasInitials && !hasCount && !this.fallback && !hasSrc && (h("div", { key: 'acea5faae52d0cfaaa8f03788a22c89c8f0095ad', class: "initials-text" }, h("span", { key: 'aedd03f85b197fc6ed24b4a0238804856145aa4c', class: "fit" }, (_d = this.initials) === null || _d === void 0 ? void 0 : _d.substring(0, 2)))), hasCount && !this.fallback && !hasSrc && (h("div", { key: 'dd8af02204937c6558ab63b26d5993aa34e4df37', class: "initials-text" }, h("span", { key: 'fdf6930557054172bea785b8c6be0decb743887a', class: "fit" }, "+", this.count))), hasSrc && !hasCount && !this.fallback && !hasIcon && (h("mds-img", { key: '4519cc0bd3e701abf9d7bdaf0189f2ca3bcd86ed', class: "image", loading: "lazy", onMdsImgLoadError: this.handleImgLoadError, onMdsImgLoadSuccess: this.handleImgLoadSuccess, part: "media", src: this.src })), hasIcon && !hasInitials && !hasCount && (h("mds-icon", { key: '5958962b68d5797dd46f1322b0e12717bf70c93e', class: "icon", part: "icon", name: icon })), (this.fallback || (!hasIcon && !hasInitials && !hasCount && !hasSrc)) && (h("i", { key: 'e6509636da3e20d93144dde5f3ecce6f1cfc5506', class: "fallback-icon", innerHTML: miBaselinePerson })))));
|
|
196
191
|
}
|
|
197
192
|
get element() { return getElement(this); }
|
|
198
193
|
static get watchers() { return {
|
|
@@ -20,8 +20,9 @@ const MdsBadge = class {
|
|
|
20
20
|
*/
|
|
21
21
|
this.typography = 'option';
|
|
22
22
|
this.onSlotChangeHandler = () => {
|
|
23
|
+
var _a;
|
|
23
24
|
/* this should be removed in the future once slotted text is no longer used, use the label property instead */
|
|
24
|
-
if (this.label !==
|
|
25
|
+
if (((_a = this.label) !== null && _a !== void 0 ? _a : '') !== '')
|
|
25
26
|
return;
|
|
26
27
|
this.label = readSlottedLabel(this.host);
|
|
27
28
|
};
|
|
@@ -30,7 +31,7 @@ const MdsBadge = class {
|
|
|
30
31
|
this.label = sanitizeLabel(newValue);
|
|
31
32
|
}
|
|
32
33
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '30205c3754c77ad904a3a01a695ec9daf058bd81', "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("mds-text", { key: '3a850df57ca87e8efbf505094f3d1e4e309deb42', tag: "span", typography: this.typography, variant: "info", text: this.label }, this.label || h("slot", { key: '99531173211bd788d288b9d20d36d5eb7b2dc95e', onSlotchange: this.onSlotChangeHandler }))));
|
|
34
35
|
}
|
|
35
36
|
get host() { return getElement(this); }
|
|
36
37
|
static get watchers() { return {
|
|
@@ -23,8 +23,9 @@ const MdsBenchmarkBar = class {
|
|
|
23
23
|
*/
|
|
24
24
|
this.size = 'md';
|
|
25
25
|
this.onSlotChangeHandler = () => {
|
|
26
|
+
var _a;
|
|
26
27
|
/* this should be removed in the future once slotted text is no longer used, use the label property instead */
|
|
27
|
-
if (this.label !==
|
|
28
|
+
if (((_a = this.label) !== null && _a !== void 0 ? _a : '') !== '')
|
|
28
29
|
return;
|
|
29
30
|
this.label = readSlottedLabel(this.host);
|
|
30
31
|
};
|
|
@@ -34,7 +35,7 @@ const MdsBenchmarkBar = class {
|
|
|
34
35
|
}
|
|
35
36
|
render() {
|
|
36
37
|
var _a;
|
|
37
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: 'e07ff600bed598dc0d97144ef596c2a2010efbbd' }, h("div", { key: 'd3493800ec6d4f20e36d38132f10a3b67f565006', class: "infos" }, h("mds-text", { key: '07423f38822e314059dcee2cda38abffbea3bb62', typography: this.typography, class: "label", id: "label", truncate: "word" }, this.label || h("slot", { key: 'e4aff25b3be0d2f87aefb2a88dd6050715c74d56', onSlotchange: this.onSlotChangeHandler })), h("mds-text", { key: '8b1ec4a01389199b881f46a69ccee96c8867446e', typography: this.typography, class: "value", truncate: "word" }, (_a = this.alias) !== null && _a !== void 0 ? _a : this.value)), h("mds-progress", { key: 'bc44dc2a31dd43599393df1129671da224f45f43', "aria-labelledby": "label", "aria-valuetext": this.alias, class: "progress", variant: this.variant, progress: this.value / 100, size: this.size, part: "progress-bar" })));
|
|
38
39
|
}
|
|
39
40
|
get host() { return getElement(this); }
|
|
40
41
|
static get watchers() { return {
|
|
@@ -85,7 +85,7 @@ const MdsBibliography = class {
|
|
|
85
85
|
return `${lastName}${lastName !== '' ? ',' : ''} ${formattedFirstName}`;
|
|
86
86
|
};
|
|
87
87
|
this.formatAuthors = (author) => {
|
|
88
|
-
var _a;
|
|
88
|
+
var _a, _b;
|
|
89
89
|
const authorName = author.replace(/"/g, "'");
|
|
90
90
|
const splitNames = new RegExp(/([A-Za-z ]{2,})/g);
|
|
91
91
|
const fullName = (_a = authorName.match(splitNames)) !== null && _a !== void 0 ? _a : authorName;
|
|
@@ -101,7 +101,7 @@ const MdsBibliography = class {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
const firstName = fullName[0].split(' ')[0].trim();
|
|
104
|
-
const lastName = fullName[0].split(' ')[1] !==
|
|
104
|
+
const lastName = ((_b = fullName[0].split(' ')[1]) !== null && _b !== void 0 ? _b : '').trim();
|
|
105
105
|
return {
|
|
106
106
|
apa: this.fullNameAPA(firstName, lastName),
|
|
107
107
|
firstName,
|
|
@@ -134,7 +134,8 @@ const MdsBibliography = class {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
|
-
|
|
137
|
+
var _a, _b, _c;
|
|
138
|
+
return (h(Host, { key: '4fe352d77a5ceea45f9b82d11fbb4ffe2d887aef' }, h("mds-text", { key: '30052872c829ff3b2c142cd54cb64eebcd558f76', typography: this.typography, variant: this.variant }, this.author && h("span", { key: '14d5043a19e193f34a4502029d7dc21fe2ae8083' }, this.showAuthors(this.normalizeAuthors(this.author))), this.format === 'mla' && (h("span", { key: '7b903d623a57baf664c7cd425e78d7a17fca8331' }, this.name && ' ', ((_a = this.name) !== null && _a !== void 0 ? _a : '') !== '' && this.url !== null ? (h("a", { class: "link", href: this.url, target: "_blank", rel: this.rel }, h("b", null, h("i", null, this.name, ".")))) : (h("b", null, h("i", null, this.name, "."))), this.location && (h("span", { key: '9c52f22dd20cafb9eb7df4835c2f5a99ca71a1a6' }, ' ', this.location, this.publisher !== undefined ? ':' : '.')), this.publisher && (h("span", { key: '3ff1124122ef8d52079fa7337ed51f116fa1f266' }, ' ', this.publisher, this.date !== undefined ? ',' : '.')), this.date && h("time", { key: 'ac4e6e1506bbca2633c95593d44df61622b6e040', dateTime: this.date }, " ", this.dateFormatMLA(this.date), "."))), this.format === 'apa' && (h("span", { key: '71558449f856a09fda8b02f2808c93b1dd72c532' }, this.date && h("time", { key: 'f952a6c0f8be0cbf83a8d04ff13e08b3221cbdc4', dateTime: this.date }, " (", this.dateFormatAPA(this.date), ")."), this.name && ' ', ((_b = this.name) !== null && _b !== void 0 ? _b : '') !== '' && this.url !== null ? (h("a", { class: "link", href: this.url, target: "_blank", rel: this.rel }, h("b", null, h("i", null, " ", this.name, ".")))) : (h("b", null, h("i", null, " ", this.name, "."))), this.location && (h("span", { key: 'ecead881a08e1f08ebe0c08f5016414238b0c0aa' }, ' ', this.location, this.publisher !== undefined ? ':' : '.')), this.publisher && h("span", { key: '7f5caaaecb02bdda257974de0439d0c15e4ebd71' }, " ", this.publisher, "."))), this.format === 'turabian' && (h("span", { key: 'e2869b0cbf35ddb64020edfb9aeab7a5bd94e56d' }, this.name && ' ', ((_c = this.name) !== null && _c !== void 0 ? _c : '') !== '' && this.url !== null ? (h("a", { class: "link", href: this.url, target: "_blank", rel: this.rel }, h("b", null, h("i", null, " ", this.name, ".")))) : (h("b", null, h("i", null, " ", this.name, "."))), this.location && (h("span", { key: '1de156ae83032c28eef77b059c52beed6f7bb8a8' }, ' ', this.location, this.publisher !== undefined ? ':' : ',')), this.publisher && (h("span", { key: 'c82b2387e90227b129d5078561c60492901fb9e3' }, ' ', this.publisher, this.date !== undefined ? ',' : '.')), this.date && h("time", { key: 'fe9da6c7294ee249a0d892cf882a387ba0196159', dateTime: this.date }, " ", this.dateFormatMLA(this.date), "."))))));
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
141
|
MdsBibliography.style = mdsBibliographyCss();
|
|
@@ -101,8 +101,9 @@ const MdsButton = class {
|
|
|
101
101
|
throw Error('Object window is not defined');
|
|
102
102
|
};
|
|
103
103
|
this.onSlotChangeHandler = () => {
|
|
104
|
+
var _a;
|
|
104
105
|
/* this should be removed in the future once slotted text is no longer used, use the label property instead */
|
|
105
|
-
if (this.label !==
|
|
106
|
+
if (((_a = this.label) !== null && _a !== void 0 ? _a : '') !== '')
|
|
106
107
|
return;
|
|
107
108
|
this.label = readSlottedLabel(this.host);
|
|
108
109
|
};
|
|
@@ -159,8 +160,9 @@ const MdsButton = class {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
componentWillLoad() {
|
|
163
|
+
var _a;
|
|
162
164
|
this.handleVariantChange(this.variant);
|
|
163
|
-
if (this.href !==
|
|
165
|
+
if (((_a = this.href) !== null && _a !== void 0 ? _a : '') !== '') {
|
|
164
166
|
this.host.addEventListener('click', (e) => {
|
|
165
167
|
var _a;
|
|
166
168
|
e.preventDefault();
|
|
@@ -183,6 +185,7 @@ const MdsButton = class {
|
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
componentDidLoad() {
|
|
188
|
+
var _a;
|
|
186
189
|
this.km.addElement(this.host);
|
|
187
190
|
if (!this.await) {
|
|
188
191
|
this.km.attachClickBehavior();
|
|
@@ -200,9 +203,7 @@ const MdsButton = class {
|
|
|
200
203
|
if (this.label === '') {
|
|
201
204
|
this.label = undefined;
|
|
202
205
|
}
|
|
203
|
-
if ((this.label ===
|
|
204
|
-
this.icon !== undefined &&
|
|
205
|
-
this.icon !== '') {
|
|
206
|
+
if (((_a = this.label) !== null && _a !== void 0 ? _a : '') === '' && this.icon != null && this.icon !== '') {
|
|
206
207
|
const iconTitle = unslugName(this.icon);
|
|
207
208
|
if (!this.host.hasAttribute('aria-label')) {
|
|
208
209
|
setAttributeIfEmpty(this.host, 'title', iconTitle);
|
|
@@ -231,7 +232,7 @@ const MdsButton = class {
|
|
|
231
232
|
render() {
|
|
232
233
|
var _a;
|
|
233
234
|
this.typography = ((_a = buttonSizeTypographyVariant[this.size]) !== null && _a !== void 0 ? _a : buttonSizeTypographyVariant.md);
|
|
234
|
-
return (h(Host, { key: '
|
|
235
|
+
return (h(Host, { key: '3d7db80d99477ad9e4ff34c97d0cb0e04160a041', onMouseDown: this.mouseDown, onMouseUp: this.mouseUp, onMouseOut: this.mouseUp, tabindex: "0", "pref-animation": preferenceStore.state.animation, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("div", { key: '133053ee2566972bbbaf1f47faa87c1f9c30b841', class: "await" }, h("mds-spinner", { key: 'ce67aa6522a2c646b1efebf51dcc51d3a987b5c9', class: "spinner", running: this.await })), this.icon && this.iconPosition === 'left' && (h("mds-icon", { key: '81d183d185387f2e6113869e14cb274a57f44f3b', "aria-hidden": "true", class: "icon", name: this.icon, part: "icon" })), h("mds-text", { key: '5ac26dd99519f30bcfe71fcbe0fdd4195055bea2', class: "text", part: "label", tag: "span", typography: this.typography, truncate: this.truncate, animation: this.animation, text: this.label }, this.label || h("slot", { key: 'a56c6946ed59d9b9fe481955027015d7f46bcab1', onSlotchange: this.onSlotChangeHandler })), h("slot", { key: '1f0a279dd9e57ba7510c879e72d1f815adb76b6b', name: "notification" }), this.icon && this.iconPosition === 'right' && (h("mds-icon", { key: 'eb2f6eff668e5195d5725360ba30cb99a6e7a054', "aria-hidden": "true", class: "icon", name: this.icon, part: "icon" }))));
|
|
235
236
|
}
|
|
236
237
|
static get formAssociated() { return true; }
|
|
237
238
|
get host() { return getElement(this); }
|
|
@@ -262,14 +263,31 @@ const mdsIconCss = () => `@layer reset,vendor,theme,base,components,utilities;:h
|
|
|
262
263
|
const MdsIcon = class {
|
|
263
264
|
constructor(hostRef) {
|
|
264
265
|
registerInstance(this, hostRef);
|
|
266
|
+
// Each update supersedes the ones still loading: only the latest one sets the svg
|
|
267
|
+
this.lastUpdate = 0;
|
|
268
|
+
this.wasDisconnected = false;
|
|
269
|
+
this.onSvgPathUpdate = () => {
|
|
270
|
+
this.updateIcon();
|
|
271
|
+
};
|
|
265
272
|
this.convertBase64ToSvg = () => {
|
|
266
273
|
const svgBase64 = this.name.replace(BASE64_SVG_ICON, '').replace(/=/i, '');
|
|
267
274
|
return atob(svgBase64);
|
|
268
275
|
};
|
|
269
276
|
}
|
|
277
|
+
connectedCallback() {
|
|
278
|
+
IconsSetService.registerListener(this.onSvgPathUpdate);
|
|
279
|
+
// the svg path may have changed while the icon was out of the page
|
|
280
|
+
if (this.wasDisconnected) {
|
|
281
|
+
this.wasDisconnected = false;
|
|
282
|
+
this.updateIcon();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
disconnectedCallback() {
|
|
286
|
+
IconsSetService.unregisterListener(this.onSvgPathUpdate);
|
|
287
|
+
this.wasDisconnected = true;
|
|
288
|
+
}
|
|
270
289
|
componentWillLoad() {
|
|
271
290
|
this.updateIcon();
|
|
272
|
-
IconsSetService.registerListener(() => this.updateIcon());
|
|
273
291
|
}
|
|
274
292
|
/**
|
|
275
293
|
* Set the path to the directory of svg files
|
|
@@ -280,8 +298,13 @@ const MdsIcon = class {
|
|
|
280
298
|
return Promise.resolve();
|
|
281
299
|
}
|
|
282
300
|
async updateIcon() {
|
|
283
|
-
|
|
301
|
+
var _a;
|
|
302
|
+
const update = ++this.lastUpdate;
|
|
303
|
+
// `name` is undefined (or null) at runtime when the attribute is missing or removed
|
|
304
|
+
if (((_a = this.name) !== null && _a !== void 0 ? _a : '') === '') {
|
|
305
|
+
this.svgHTML = '';
|
|
284
306
|
return Promise.resolve();
|
|
307
|
+
}
|
|
285
308
|
if (isIconFormatIsBase64(this.name)) {
|
|
286
309
|
this.svgHTML = this.convertBase64ToSvg();
|
|
287
310
|
return Promise.resolve();
|
|
@@ -290,10 +313,13 @@ const MdsIcon = class {
|
|
|
290
313
|
this.svgHTML = this.name;
|
|
291
314
|
return Promise.resolve();
|
|
292
315
|
}
|
|
293
|
-
|
|
316
|
+
const svgHTML = await IconsSetService.fetchSvg(this.name);
|
|
317
|
+
if (update === this.lastUpdate) {
|
|
318
|
+
this.svgHTML = svgHTML;
|
|
319
|
+
}
|
|
294
320
|
}
|
|
295
321
|
render() {
|
|
296
|
-
return (h(Host, { key: '
|
|
322
|
+
return (h(Host, { key: '9544b1ca2b153e95f6710e0bbed762048676fb48' }, this.svgHTML && h("i", { key: '745b56492d69be55e449b94633b09391972e3d79', "aria-hidden": "true", class: "icon", part: "svg", innerHTML: this.svgHTML })));
|
|
297
323
|
}
|
|
298
324
|
get hostElement() { return getElement(this); }
|
|
299
325
|
static get watchers() { return {
|
|
@@ -293,7 +293,8 @@ const MdsDropdown = class {
|
|
|
293
293
|
this.floatingController.updatePosition();
|
|
294
294
|
}
|
|
295
295
|
targetChanged() {
|
|
296
|
-
|
|
296
|
+
var _a;
|
|
297
|
+
if (((_a = this.target) !== null && _a !== void 0 ? _a : '') === '' || this.floatingController == null)
|
|
297
298
|
return;
|
|
298
299
|
const caller = this.floatingController.updateCaller(this.target);
|
|
299
300
|
if (!caller)
|
|
@@ -362,9 +363,9 @@ const MdsDropdown = class {
|
|
|
362
363
|
this.km.detachEscapeBehavior();
|
|
363
364
|
}
|
|
364
365
|
render() {
|
|
365
|
-
return (h(Host, { key: '
|
|
366
|
+
return (h(Host, { key: '42bb1259088a7cc15869cd0cbf007ce9f34331cb', style: {
|
|
366
367
|
zIndex: `${this.zIndex}`,
|
|
367
|
-
}, "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("div", { key: '
|
|
368
|
+
}, "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("div", { key: '6a2caa47a6dca50fe6ae209229daddcd7791473d', class: "arrow", innerHTML: arrowSvg }), h("slot", { key: '656a32363daa94dc4433cd5fb86d689d80502221' })));
|
|
368
369
|
}
|
|
369
370
|
get host() { return getElement(this); }
|
|
370
371
|
static get watchers() { return {
|
|
@@ -3,7 +3,7 @@ import { h as hasChildWithSlot } from './slot-C0o_l0td.js';
|
|
|
3
3
|
import { c as clsx } from './clsx-ChV9xqsO.js';
|
|
4
4
|
import { p as preferenceStore } from './preference-CKerJx2M.js';
|
|
5
5
|
|
|
6
|
-
const mdsEntityCss = () => `@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),:is(mds-avatar,mds-spinner):not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-entity-background:rgb(var(--magma-surface-raised,var(--magma-tint-raised,var(--surface-neutral-raised,248 248 248))));--mds-entity-color:rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5))));--mds-entity-detail-color:rgb(var(--magma-text-muted,var(--magma-tint-text-muted,var(--text-neutral-muted,73 73 73))));--mds-entity-icon-background:rgb(var(--label-blue-09,216 222 254));--mds-entity-icon-radius:var(--radius-md,12px);--mds-entity-icon-color:rgb(var(--label-blue-04,63 94 248));align-items:stretch;background-color:var(--mds-entity-background,rgb(var(--magma-surface-raised,var(--magma-tint-raised,var(--surface-neutral-raised,248 248 248)))));border-radius:var(--radius-lg,16px);-webkit-box-shadow:var(--shadow-outline-weak,0 0 0 1px #0000000d,0 1px 2px 0 #0000000d);box-shadow:var(--shadow-outline-weak,0 0 0 1px #0000000d,0 1px 2px 0 #0000000d);color:var(--mds-entity-color,rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5)))));display:flex;gap:calc(var(--spacing,.0025rem)*200);padding:calc(var(--spacing,.0025rem)*200)}.delete,.preview,.spinner{border-radius:var(--radius-md,12px);flex-shrink:0;width:calc(var(--spacing,.0025rem)*1100)}.preview{--mds-avatar-radius:var(--mds-entity-icon-radius,var(--radius-md,12px))}.preview:not([variant]){--mds-avatar-color:var(--mds-entity-icon-color,rgb(var(--label-blue-04,63 94 248)));--mds-avatar-background-color:var(--mds-entity-icon-background,rgb(var(--label-blue-09,216 222 254)))}.preview,.spinner{align-items:center;aspect-ratio:var(--aspect-square,1/1);display:inline-flex;justify-content:center}.spinner{background-color:#0000;display:none;fill:var(--mds-entity-icon-color,rgb(var(--label-blue-04,63 94 248)))}:host([await]:not([await=false])) .spinner{display:inline-flex}mds-spinner{height:calc(var(--spacing,.0025rem)*900);width:calc(var(--spacing,.0025rem)*900)}.infos{display:flex;flex-direction:column;flex-grow:1;gap:
|
|
6
|
+
const mdsEntityCss = () => `@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),:is(mds-avatar,mds-spinner):not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-entity-background:rgb(var(--magma-surface-raised,var(--magma-tint-raised,var(--surface-neutral-raised,248 248 248))));--mds-entity-color:rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5))));--mds-entity-detail-color:rgb(var(--magma-text-muted,var(--magma-tint-text-muted,var(--text-neutral-muted,73 73 73))));--mds-entity-icon-background:rgb(var(--label-blue-09,216 222 254));--mds-entity-icon-radius:var(--radius-md,12px);--mds-entity-icon-color:rgb(var(--label-blue-04,63 94 248));align-items:stretch;background-color:var(--mds-entity-background,rgb(var(--magma-surface-raised,var(--magma-tint-raised,var(--surface-neutral-raised,248 248 248)))));border-radius:var(--radius-lg,16px);-webkit-box-shadow:var(--shadow-outline-weak,0 0 0 1px #0000000d,0 1px 2px 0 #0000000d);box-shadow:var(--shadow-outline-weak,0 0 0 1px #0000000d,0 1px 2px 0 #0000000d);color:var(--mds-entity-color,rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5)))));display:flex;gap:calc(var(--spacing,.0025rem)*200);padding:calc(var(--spacing,.0025rem)*200)}.delete,.preview,.spinner{border-radius:var(--radius-md,12px);flex-shrink:0;width:calc(var(--spacing,.0025rem)*1100)}.preview{--mds-avatar-radius:var(--mds-entity-icon-radius,var(--radius-md,12px))}.preview:not([variant]){--mds-avatar-color:var(--mds-entity-icon-color,rgb(var(--label-blue-04,63 94 248)));--mds-avatar-background-color:var(--mds-entity-icon-background,rgb(var(--label-blue-09,216 222 254)))}.preview,.spinner{align-items:center;aspect-ratio:var(--aspect-square,1/1);display:inline-flex;justify-content:center}.spinner{background-color:#0000;display:none;fill:var(--mds-entity-icon-color,rgb(var(--label-blue-04,63 94 248)))}:host([await]:not([await=false])) .spinner{display:inline-flex}mds-spinner{height:calc(var(--spacing,.0025rem)*900);width:calc(var(--spacing,.0025rem)*900)}.infos{display:flex;flex-direction:column;flex-grow:1;gap:0;justify-content:center;min-width:0;white-space:nowrap}.details{align-items:baseline;color:var(--mds-entity-detail-color,rgb(var(--magma-text-muted,var(--magma-tint-text-muted,var(--text-neutral-muted,73 73 73)))));display:flex;gap:calc(var(--spacing,.0025rem)*100)}.details--hidden{display:none}.actions{align-items:center;display:flex;gap:calc(var(--spacing,.0025rem)*200)}.actions--hidden{display:none}::slotted([slot=action]){aspect-ratio:var(--aspect-square,1/1);height:auto;width:calc(var(--spacing,.0025rem)*1100)}::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.title{display:flex;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([pref-contrast=more]){--mds-entity-color:rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5))));--mds-entity-icon-background:rgb(var(--label-blue-08,200 210 253));--mds-entity-icon-color:rgb(var(--label-blue-03,11 51 246))}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){--mds-entity-color:rgb(var(--magma-text-default,var(--magma-tint-text-default,var(--text-neutral-default,5 5 5))));--mds-entity-icon-background:rgb(var(--label-blue-08,200 210 253));--mds-entity-icon-color:rgb(var(--label-blue-03,11 51 246))}}`;
|
|
7
7
|
|
|
8
8
|
const MdsEntity = class {
|
|
9
9
|
constructor(hostRef) {
|