@lmvz-ds/components 0.11.4
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/LICENSE.txt +3 -0
- package/assets/LMVZ_logo_175.svg +1 -0
- package/assets/card-placeholder.svg +4 -0
- package/assets/fonts/Router-Bold.woff +0 -0
- package/assets/fonts/Router-Book.woff +0 -0
- package/assets/fonts/Router-Medium.woff +0 -0
- package/assets/icons/Logo.svg +10 -0
- package/assets/icons/actions.svg +5 -0
- package/assets/icons/adduser.svg +3 -0
- package/assets/icons/alert.svg +3 -0
- package/assets/icons/apple.svg +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-left.svg +3 -0
- package/assets/icons/arrow-right.svg +3 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/book.svg +3 -0
- package/assets/icons/bookmark.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/chevron-up.svg +3 -0
- package/assets/icons/close-l.svg +3 -0
- package/assets/icons/close-sm.svg +3 -0
- package/assets/icons/cog.svg +4 -0
- package/assets/icons/computer.svg +3 -0
- package/assets/icons/dashboard.svg +6 -0
- package/assets/icons/delete.svg +3 -0
- package/assets/icons/download.svg +3 -0
- package/assets/icons/edit.svg +3 -0
- package/assets/icons/external.svg +3 -0
- package/assets/icons/facebook.svg +3 -0
- package/assets/icons/favorite.svg +3 -0
- package/assets/icons/filter.svg +3 -0
- package/assets/icons/group.svg +3 -0
- package/assets/icons/hide.svg +3 -0
- package/assets/icons/home.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/instagram.svg +3 -0
- package/assets/icons/letter.svg +3 -0
- package/assets/icons/linkedin.svg +5 -0
- package/assets/icons/logout.svg +3 -0
- package/assets/icons/map.svg +3 -0
- package/assets/icons/minus.svg +3 -0
- package/assets/icons/navigation.svg +3 -0
- package/assets/icons/plus.svg +3 -0
- package/assets/icons/qr-scan.svg +3 -0
- package/assets/icons/question.svg +10 -0
- package/assets/icons/reader.svg +3 -0
- package/assets/icons/reset.svg +3 -0
- package/assets/icons/school.svg +3 -0
- package/assets/icons/search.svg +3 -0
- package/assets/icons/send.svg +3 -0
- package/assets/icons/settings.svg +3 -0
- package/assets/icons/share.svg +10 -0
- package/assets/icons/shopping-cart.svg +3 -0
- package/assets/icons/show.svg +3 -0
- package/assets/icons/snapchat.svg +3 -0
- package/assets/icons/sort.svg +3 -0
- package/assets/icons/speech-bubble.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/student.svg +3 -0
- package/assets/icons/upload.svg +3 -0
- package/assets/icons/user.svg +3 -0
- package/assets/icons/warn-circle.svg +3 -0
- package/assets/icons/warn-triangle.svg +3 -0
- package/assets/icons/whatsapp.svg +4 -0
- package/assets/icons/world.svg +10 -0
- package/assets/icons/x.svg +3 -0
- package/assets/icons/youtube.svg +3 -0
- package/assets/zukunftslinie.svg +3 -0
- package/dist/cjs/Effect-BIlTHtLK.js +19172 -0
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +7 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/aria-validation-controller-B7unOPxT.js +2929 -0
- package/dist/cjs/axe-BNqwbBGU.js +32834 -0
- package/dist/cjs/component-CRc6eHcV.js +138 -0
- package/dist/cjs/element-activation-controller-DC_6T0Rt.js +31 -0
- package/dist/cjs/icons-DbL3LSmP.js +659 -0
- package/dist/cjs/index-9ZJx0550.js +2752 -0
- package/dist/cjs/index-CVw4GUo6.js +92 -0
- package/dist/cjs/index.cjs.js +96 -0
- package/dist/cjs/lmvz-action.cjs.entry.js +22 -0
- package/dist/cjs/lmvz-button.cjs.entry.js +72 -0
- package/dist/cjs/lmvz-card.cjs.entry.js +33 -0
- package/dist/cjs/lmvz-chip.cjs.entry.js +18 -0
- package/dist/cjs/lmvz-components.cjs.js +25 -0
- package/dist/cjs/lmvz-header.cjs.entry.js +134 -0
- package/dist/cjs/lmvz-icon.cjs.entry.js +76 -0
- package/dist/cjs/lmvz-input.cjs.entry.js +176 -0
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +32 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/collection/api/ds.constants.js +73 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/assets/LMVZ_logo_175.svg +1 -0
- package/dist/collection/assets/card-placeholder.svg +4 -0
- package/dist/collection/assets/fonts/Router-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Router-Book.woff +0 -0
- package/dist/collection/assets/fonts/Router-Medium.woff +0 -0
- package/dist/collection/assets/icons/Logo.svg +10 -0
- package/dist/collection/assets/icons/actions.svg +5 -0
- package/dist/collection/assets/icons/adduser.svg +3 -0
- package/dist/collection/assets/icons/alert.svg +3 -0
- package/dist/collection/assets/icons/apple.svg +3 -0
- package/dist/collection/assets/icons/arrow-down.svg +3 -0
- package/dist/collection/assets/icons/arrow-left.svg +3 -0
- package/dist/collection/assets/icons/arrow-right.svg +3 -0
- package/dist/collection/assets/icons/arrow-up.svg +3 -0
- package/dist/collection/assets/icons/book.svg +3 -0
- package/dist/collection/assets/icons/bookmark.svg +3 -0
- package/dist/collection/assets/icons/checkmark.svg +3 -0
- package/dist/collection/assets/icons/chevron-down.svg +3 -0
- package/dist/collection/assets/icons/chevron-left.svg +3 -0
- package/dist/collection/assets/icons/chevron-right.svg +3 -0
- package/dist/collection/assets/icons/chevron-up.svg +3 -0
- package/dist/collection/assets/icons/close-l.svg +3 -0
- package/dist/collection/assets/icons/close-sm.svg +3 -0
- package/dist/collection/assets/icons/cog.svg +4 -0
- package/dist/collection/assets/icons/computer.svg +3 -0
- package/dist/collection/assets/icons/dashboard.svg +6 -0
- package/dist/collection/assets/icons/delete.svg +3 -0
- package/dist/collection/assets/icons/download.svg +3 -0
- package/dist/collection/assets/icons/edit.svg +3 -0
- package/dist/collection/assets/icons/external.svg +3 -0
- package/dist/collection/assets/icons/facebook.svg +3 -0
- package/dist/collection/assets/icons/favorite.svg +3 -0
- package/dist/collection/assets/icons/filter.svg +3 -0
- package/dist/collection/assets/icons/group.svg +3 -0
- package/dist/collection/assets/icons/hide.svg +3 -0
- package/dist/collection/assets/icons/home.svg +3 -0
- package/dist/collection/assets/icons/info.svg +3 -0
- package/dist/collection/assets/icons/instagram.svg +3 -0
- package/dist/collection/assets/icons/letter.svg +3 -0
- package/dist/collection/assets/icons/linkedin.svg +5 -0
- package/dist/collection/assets/icons/logout.svg +3 -0
- package/dist/collection/assets/icons/map.svg +3 -0
- package/dist/collection/assets/icons/minus.svg +3 -0
- package/dist/collection/assets/icons/navigation.svg +3 -0
- package/dist/collection/assets/icons/plus.svg +3 -0
- package/dist/collection/assets/icons/qr-scan.svg +3 -0
- package/dist/collection/assets/icons/question.svg +10 -0
- package/dist/collection/assets/icons/reader.svg +3 -0
- package/dist/collection/assets/icons/reset.svg +3 -0
- package/dist/collection/assets/icons/school.svg +3 -0
- package/dist/collection/assets/icons/search.svg +3 -0
- package/dist/collection/assets/icons/send.svg +3 -0
- package/dist/collection/assets/icons/settings.svg +3 -0
- package/dist/collection/assets/icons/share.svg +10 -0
- package/dist/collection/assets/icons/shopping-cart.svg +3 -0
- package/dist/collection/assets/icons/show.svg +3 -0
- package/dist/collection/assets/icons/snapchat.svg +3 -0
- package/dist/collection/assets/icons/sort.svg +3 -0
- package/dist/collection/assets/icons/speech-bubble.svg +3 -0
- package/dist/collection/assets/icons/star.svg +3 -0
- package/dist/collection/assets/icons/student.svg +3 -0
- package/dist/collection/assets/icons/upload.svg +3 -0
- package/dist/collection/assets/icons/user.svg +3 -0
- package/dist/collection/assets/icons/warn-circle.svg +3 -0
- package/dist/collection/assets/icons/warn-triangle.svg +3 -0
- package/dist/collection/assets/icons/whatsapp.svg +4 -0
- package/dist/collection/assets/icons/world.svg +10 -0
- package/dist/collection/assets/icons/x.svg +3 -0
- package/dist/collection/assets/icons/youtube.svg +3 -0
- package/dist/collection/assets/zukunftslinie.svg +3 -0
- package/dist/collection/collection-manifest.json +21 -0
- package/dist/collection/components/lmvz-action/lmvz-action.css +3 -0
- package/dist/collection/components/lmvz-action/lmvz-action.js +45 -0
- package/dist/collection/components/lmvz-button/lmvz-button.css +199 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +245 -0
- package/dist/collection/components/lmvz-card/lmvz-card.css +283 -0
- package/dist/collection/components/lmvz-card/lmvz-card.js +137 -0
- package/dist/collection/components/lmvz-chip/lmvz-chip.css +3 -0
- package/dist/collection/components/lmvz-chip/lmvz-chip.js +42 -0
- package/dist/collection/components/lmvz-header/lmvz-header.css +49 -0
- package/dist/collection/components/lmvz-header/lmvz-header.js +138 -0
- package/dist/collection/components/lmvz-icon/icons.js +36 -0
- package/dist/collection/components/lmvz-icon/lmvz-icon.css +82 -0
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +191 -0
- package/dist/collection/components/lmvz-icon/public.js +1 -0
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +89 -0
- package/dist/collection/components/lmvz-input/lmvz-input.css +201 -0
- package/dist/collection/components/lmvz-input/lmvz-input.js +847 -0
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.css +89 -0
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +97 -0
- package/dist/collection/index.js +3 -0
- package/dist/collection/integration/header-integration.js +28 -0
- package/dist/collection/styles/buttons.css +1 -0
- package/dist/collection/styles/router-font.css +1 -0
- package/dist/collection/styles/tokens.css +1 -0
- package/dist/collection/styles/typography.css +1 -0
- package/dist/collection/themes/all.css +1 -0
- package/dist/collection/themes/dark.css +1 -0
- package/dist/collection/themes/light.css +1 -0
- package/dist/collection/utils/component.js +268 -0
- package/dist/collection/utils/effect.js +6 -0
- package/dist/collection/utils/element-activation-controller.js +27 -0
- package/dist/collection/utils/http.js +24 -0
- package/dist/collection/utils/http.test.js +46 -0
- package/dist/collection/utils/list-keyboard-controller.js +44 -0
- package/dist/collection/utils/public.js +1 -0
- package/dist/collection/utils/reactive-controller-host.js +39 -0
- package/dist/collection/utils/typing.js +1 -0
- package/dist/collection/utils/url.js +7 -0
- package/dist/collection/utils/validation/aria-validation-controller.js +124 -0
- package/dist/collection/utils/validation/svg.js +24 -0
- package/dist/components/index.d.ts +53 -0
- package/dist/components/index.js +1 -0
- package/dist/components/lmvz-action.d.ts +11 -0
- package/dist/components/lmvz-action.js +1 -0
- package/dist/components/lmvz-button.d.ts +11 -0
- package/dist/components/lmvz-button.js +1 -0
- package/dist/components/lmvz-card.d.ts +11 -0
- package/dist/components/lmvz-card.js +1 -0
- package/dist/components/lmvz-chip.d.ts +11 -0
- package/dist/components/lmvz-chip.js +1 -0
- package/dist/components/lmvz-header.d.ts +11 -0
- package/dist/components/lmvz-header.js +1 -0
- package/dist/components/lmvz-icon.d.ts +11 -0
- package/dist/components/lmvz-icon.js +1 -0
- package/dist/components/lmvz-input.d.ts +11 -0
- package/dist/components/lmvz-input.js +1 -0
- package/dist/components/lmvz-menuitem.d.ts +11 -0
- package/dist/components/lmvz-menuitem.js +1 -0
- package/dist/components/p-B3JVFwO1.js +1 -0
- package/dist/components/p-B85MJLTf.js +1 -0
- package/dist/components/p-BFwzIh71.js +1 -0
- package/dist/components/p-BaPwpeMs.js +1 -0
- package/dist/components/p-CN0JX9-m.js +1 -0
- package/dist/components/p-D1HbKFuh.js +12 -0
- package/dist/components/p-DDmjv-N_.js +1 -0
- package/dist/components/p-DMLRPGid.js +6 -0
- package/dist/esm/Effect-D9S7OTyY.js +18963 -0
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +5 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/aria-validation-controller-C7nQzCCq.js +2926 -0
- package/dist/esm/axe-cRQ9Ux1I.js +32832 -0
- package/dist/esm/component-B3JVFwO1.js +132 -0
- package/dist/esm/element-activation-controller-CN0JX9-m.js +29 -0
- package/dist/esm/icons-B71gAZmE.js +655 -0
- package/dist/esm/index-Bt32KzDW.js +90 -0
- package/dist/esm/index-smGPjoDX.js +2741 -0
- package/dist/esm/index.js +85 -0
- package/dist/esm/lmvz-action.entry.js +20 -0
- package/dist/esm/lmvz-button.entry.js +70 -0
- package/dist/esm/lmvz-card.entry.js +31 -0
- package/dist/esm/lmvz-chip.entry.js +16 -0
- package/dist/esm/lmvz-components.js +21 -0
- package/dist/esm/lmvz-header.entry.js +132 -0
- package/dist/esm/lmvz-icon.entry.js +74 -0
- package/dist/esm/lmvz-input.entry.js +174 -0
- package/dist/esm/lmvz-menuitem.entry.js +30 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lmvz-components/assets/LMVZ_logo_175.svg +1 -0
- package/dist/lmvz-components/assets/card-placeholder.svg +4 -0
- package/dist/lmvz-components/assets/fonts/Router-Bold.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Book.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Medium.woff +0 -0
- package/dist/lmvz-components/assets/icons/Logo.svg +10 -0
- package/dist/lmvz-components/assets/icons/actions.svg +5 -0
- package/dist/lmvz-components/assets/icons/adduser.svg +3 -0
- package/dist/lmvz-components/assets/icons/alert.svg +3 -0
- package/dist/lmvz-components/assets/icons/apple.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-down.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-left.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-right.svg +3 -0
- package/dist/lmvz-components/assets/icons/arrow-up.svg +3 -0
- package/dist/lmvz-components/assets/icons/book.svg +3 -0
- package/dist/lmvz-components/assets/icons/bookmark.svg +3 -0
- package/dist/lmvz-components/assets/icons/checkmark.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-down.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-left.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-right.svg +3 -0
- package/dist/lmvz-components/assets/icons/chevron-up.svg +3 -0
- package/dist/lmvz-components/assets/icons/close-l.svg +3 -0
- package/dist/lmvz-components/assets/icons/close-sm.svg +3 -0
- package/dist/lmvz-components/assets/icons/cog.svg +4 -0
- package/dist/lmvz-components/assets/icons/computer.svg +3 -0
- package/dist/lmvz-components/assets/icons/dashboard.svg +6 -0
- package/dist/lmvz-components/assets/icons/delete.svg +3 -0
- package/dist/lmvz-components/assets/icons/download.svg +3 -0
- package/dist/lmvz-components/assets/icons/edit.svg +3 -0
- package/dist/lmvz-components/assets/icons/external.svg +3 -0
- package/dist/lmvz-components/assets/icons/facebook.svg +3 -0
- package/dist/lmvz-components/assets/icons/favorite.svg +3 -0
- package/dist/lmvz-components/assets/icons/filter.svg +3 -0
- package/dist/lmvz-components/assets/icons/group.svg +3 -0
- package/dist/lmvz-components/assets/icons/hide.svg +3 -0
- package/dist/lmvz-components/assets/icons/home.svg +3 -0
- package/dist/lmvz-components/assets/icons/info.svg +3 -0
- package/dist/lmvz-components/assets/icons/instagram.svg +3 -0
- package/dist/lmvz-components/assets/icons/letter.svg +3 -0
- package/dist/lmvz-components/assets/icons/linkedin.svg +5 -0
- package/dist/lmvz-components/assets/icons/logout.svg +3 -0
- package/dist/lmvz-components/assets/icons/map.svg +3 -0
- package/dist/lmvz-components/assets/icons/minus.svg +3 -0
- package/dist/lmvz-components/assets/icons/navigation.svg +3 -0
- package/dist/lmvz-components/assets/icons/plus.svg +3 -0
- package/dist/lmvz-components/assets/icons/qr-scan.svg +3 -0
- package/dist/lmvz-components/assets/icons/question.svg +10 -0
- package/dist/lmvz-components/assets/icons/reader.svg +3 -0
- package/dist/lmvz-components/assets/icons/reset.svg +3 -0
- package/dist/lmvz-components/assets/icons/school.svg +3 -0
- package/dist/lmvz-components/assets/icons/search.svg +3 -0
- package/dist/lmvz-components/assets/icons/send.svg +3 -0
- package/dist/lmvz-components/assets/icons/settings.svg +3 -0
- package/dist/lmvz-components/assets/icons/share.svg +10 -0
- package/dist/lmvz-components/assets/icons/shopping-cart.svg +3 -0
- package/dist/lmvz-components/assets/icons/show.svg +3 -0
- package/dist/lmvz-components/assets/icons/snapchat.svg +3 -0
- package/dist/lmvz-components/assets/icons/sort.svg +3 -0
- package/dist/lmvz-components/assets/icons/speech-bubble.svg +3 -0
- package/dist/lmvz-components/assets/icons/star.svg +3 -0
- package/dist/lmvz-components/assets/icons/student.svg +3 -0
- package/dist/lmvz-components/assets/icons/upload.svg +3 -0
- package/dist/lmvz-components/assets/icons/user.svg +3 -0
- package/dist/lmvz-components/assets/icons/warn-circle.svg +3 -0
- package/dist/lmvz-components/assets/icons/warn-triangle.svg +3 -0
- package/dist/lmvz-components/assets/icons/whatsapp.svg +4 -0
- package/dist/lmvz-components/assets/icons/world.svg +10 -0
- package/dist/lmvz-components/assets/icons/x.svg +3 -0
- package/dist/lmvz-components/assets/icons/youtube.svg +3 -0
- package/dist/lmvz-components/assets/zukunftslinie.svg +3 -0
- package/dist/lmvz-components/index.esm.js +1 -0
- package/dist/lmvz-components/lmvz-components.esm.js +1 -0
- package/dist/lmvz-components/p-87b01940.entry.js +1 -0
- package/dist/lmvz-components/p-9faac8f3.entry.js +1 -0
- package/dist/lmvz-components/p-B3JVFwO1.js +1 -0
- package/dist/lmvz-components/p-B85MJLTf.js +1 -0
- package/dist/lmvz-components/p-CN0JX9-m.js +1 -0
- package/dist/lmvz-components/p-D1HbKFuh.js +12 -0
- package/dist/lmvz-components/p-D9S7OTyY.js +1 -0
- package/dist/lmvz-components/p-DMLRPGid.js +6 -0
- package/dist/lmvz-components/p-DQuL1Twl.js +1 -0
- package/dist/lmvz-components/p-DlIX18fw.js +1 -0
- package/dist/lmvz-components/p-DlrjrWsu.js +1 -0
- package/dist/lmvz-components/p-a4615e4b.entry.js +1 -0
- package/dist/lmvz-components/p-a8c88454.entry.js +1 -0
- package/dist/lmvz-components/p-d4b68381.entry.js +1 -0
- package/dist/lmvz-components/p-e63e239a.entry.js +1 -0
- package/dist/lmvz-components/p-f956a5e7.entry.js +1 -0
- package/dist/lmvz-components/p-fefd2fe4.entry.js +1 -0
- package/dist/lmvz-components/p-smGPjoDX.js +2 -0
- package/dist/lmvz-components/styles/buttons.css +1 -0
- package/dist/lmvz-components/styles/router-font.css +1 -0
- package/dist/lmvz-components/styles/tokens.css +1 -0
- package/dist/lmvz-components/styles/typography.css +1 -0
- package/dist/lmvz-components/themes/all.css +1 -0
- package/dist/lmvz-components/themes/dark.css +1 -0
- package/dist/lmvz-components/themes/light.css +1 -0
- package/dist/manifest.d.ts +480 -0
- package/dist/manifest.json +5184 -0
- package/dist/types/api/aria-types.d.ts +9 -0
- package/dist/types/api/ds.constants.d.ts +8 -0
- package/dist/types/api/ds.types.d.ts +39 -0
- package/dist/types/api/index.d.ts +3 -0
- package/dist/types/components/lmvz-action/lmvz-action.d.ts +6 -0
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +25 -0
- package/dist/types/components/lmvz-card/lmvz-card.d.ts +11 -0
- package/dist/types/components/lmvz-chip/lmvz-chip.d.ts +4 -0
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +23 -0
- package/dist/types/components/lmvz-icon/icons.d.ts +8 -0
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +20 -0
- package/dist/types/components/lmvz-icon/public.d.ts +1 -0
- package/dist/types/components/lmvz-icon/test/icons.unit.d.ts +1 -0
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +63 -0
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +12 -0
- package/dist/types/components.d.ts +773 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/component.d.ts +36 -0
- package/dist/types/utils/effect.d.ts +3 -0
- package/dist/types/utils/element-activation-controller.d.ts +19 -0
- package/dist/types/utils/http.d.ts +24 -0
- package/dist/types/utils/http.test.d.ts +1 -0
- package/dist/types/utils/list-keyboard-controller.d.ts +13 -0
- package/dist/types/utils/public.d.ts +1 -0
- package/dist/types/utils/reactive-controller-host.d.ts +26 -0
- package/dist/types/utils/typing.d.ts +3 -0
- package/dist/types/utils/url.d.ts +8 -0
- package/dist/types/utils/validation/aria-validation-controller.d.ts +31 -0
- package/dist/types/utils/validation/svg.d.ts +11 -0
- package/hydrate/index.d.ts +287 -0
- package/hydrate/index.js +78213 -0
- package/hydrate/index.mjs +78203 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +216 -0
- package/readme.md +193 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class LmvzChip {
|
|
3
|
+
text;
|
|
4
|
+
render() {
|
|
5
|
+
return h(Host, { key: 'b247f41d22bcf77998bf5a49669f1aa8d7fd3a63' }, this.text);
|
|
6
|
+
}
|
|
7
|
+
static get is() { return "lmvz-chip"; }
|
|
8
|
+
static get encapsulation() { return "shadow"; }
|
|
9
|
+
static get originalStyleUrls() {
|
|
10
|
+
return {
|
|
11
|
+
"$": ["lmvz-chip.css"]
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static get styleUrls() {
|
|
15
|
+
return {
|
|
16
|
+
"$": ["lmvz-chip.css"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get properties() {
|
|
20
|
+
return {
|
|
21
|
+
"text": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"mutable": false,
|
|
24
|
+
"complexType": {
|
|
25
|
+
"original": "string",
|
|
26
|
+
"resolved": "string",
|
|
27
|
+
"references": {}
|
|
28
|
+
},
|
|
29
|
+
"required": false,
|
|
30
|
+
"optional": false,
|
|
31
|
+
"docs": {
|
|
32
|
+
"tags": [],
|
|
33
|
+
"text": ""
|
|
34
|
+
},
|
|
35
|
+
"getter": false,
|
|
36
|
+
"setter": false,
|
|
37
|
+
"reflect": false,
|
|
38
|
+
"attribute": "text"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* @import url('../../styles/internal/define-layers.css'); */
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
/* TODO: why does it overflow on smaller screens? */
|
|
6
|
+
width: 100vw;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
align-items: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
|
|
11
|
+
background-color: var(--lmvz-semantic-color-surface-primary, #ffffff);
|
|
12
|
+
|
|
13
|
+
--lmvz-header-x-spacing-level-1: var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));
|
|
14
|
+
--lmvz-header-x-spacing-level-2: var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
15
|
+
|
|
16
|
+
padding: var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);
|
|
17
|
+
gap: var(--lmvz-header-x-spacing-level-1);
|
|
18
|
+
|
|
19
|
+
.brand {
|
|
20
|
+
/* min-width: var(--lmvz-dimension-48-96); */
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#fallback-logo-lmvz {
|
|
27
|
+
height: 34px;
|
|
28
|
+
width: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
nav {
|
|
32
|
+
flex-grow: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.primary-menubar {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
.secondary-menubar {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
align-items: center;
|
|
44
|
+
/* gap: var(--lmvz-component-buttongroup-wrapper-gap-x); */
|
|
45
|
+
margin-left: var(--lmvz-header-x-spacing-level-2);
|
|
46
|
+
padding-left: var(--lmvz-header-x-spacing-level-2);
|
|
47
|
+
border-left: 1px solid var(--lmvz-semantic-color-border-default, #e0e0e0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { ListKeyboardNavigationController } from "../../utils/list-keyboard-controller";
|
|
3
|
+
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
4
|
+
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
5
|
+
export class LmvzHeader extends ReactiveControllerHost {
|
|
6
|
+
el;
|
|
7
|
+
primarySlot;
|
|
8
|
+
secondarySlot;
|
|
9
|
+
secondaryNav;
|
|
10
|
+
keyboardNavigationController = new ListKeyboardNavigationController(this);
|
|
11
|
+
get primaryMenuitems() {
|
|
12
|
+
return this.primarySlot.assignedElements({ flatten: false });
|
|
13
|
+
}
|
|
14
|
+
get secondaryMenuitems() {
|
|
15
|
+
return this.secondarySlot.assignedElements({ flatten: true });
|
|
16
|
+
}
|
|
17
|
+
get role() {
|
|
18
|
+
return 'banner';
|
|
19
|
+
}
|
|
20
|
+
lmvzActiveNav;
|
|
21
|
+
get secondarySlotName() {
|
|
22
|
+
return `connect-nav-${this.lmvzActiveNav}`;
|
|
23
|
+
}
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.addController(new AriaValidationController(this, { reValidateOnPropChanges: true }));
|
|
27
|
+
this.addController(this.keyboardNavigationController);
|
|
28
|
+
}
|
|
29
|
+
handleActiveNavChange() {
|
|
30
|
+
this.updateElementsActive();
|
|
31
|
+
}
|
|
32
|
+
componentDidLoad() {
|
|
33
|
+
this.primarySlot.addEventListener('slotchange', this.handlePrimaryNavChange.bind(this));
|
|
34
|
+
this.handlePrimaryNavChange();
|
|
35
|
+
this.secondarySlot.addEventListener('slotchange', this.handleSecondaryNavChange.bind(this));
|
|
36
|
+
}
|
|
37
|
+
handlePrimaryNavChange() {
|
|
38
|
+
const items = this.primaryMenuitems;
|
|
39
|
+
if (!items.length) {
|
|
40
|
+
console.warn('Primary slot has no assigned elements. Please add navigation items to the primary slot.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
items.forEach(el => {
|
|
44
|
+
el.setAttribute('aria-haspopup', 'true');
|
|
45
|
+
el.setAttribute('aria-controls', `nav-secondary`);
|
|
46
|
+
});
|
|
47
|
+
this.updateElementsActive();
|
|
48
|
+
}
|
|
49
|
+
handleSecondaryNavChange() {
|
|
50
|
+
const items = this.secondaryMenuitems;
|
|
51
|
+
if (!items.length) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.keyboardNavigationController.updateElements([...this.primaryMenuitems, ...this.secondaryMenuitems]);
|
|
55
|
+
}
|
|
56
|
+
updateElementsActive() {
|
|
57
|
+
const items = this.primaryMenuitems;
|
|
58
|
+
let label;
|
|
59
|
+
items.forEach(el => {
|
|
60
|
+
const isActive = el.id === this.lmvzActiveNav;
|
|
61
|
+
if (isActive)
|
|
62
|
+
label = el.textContent || el.id;
|
|
63
|
+
el.setAttribute('aria-expanded', isActive ? 'true' : 'false');
|
|
64
|
+
});
|
|
65
|
+
this.secondaryNav.setAttribute('aria-label', `Untermenü für ${label}`);
|
|
66
|
+
}
|
|
67
|
+
delegateFocus() {
|
|
68
|
+
const firstFocusable = this.primaryMenuitems[0];
|
|
69
|
+
if (firstFocusable) {
|
|
70
|
+
firstFocusable.focus();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return (h(Host, { key: '58934683ff442801eb34f025ac809631f93a27e8', onFocus: this.delegateFocus.bind(this) }, h("div", { key: '35d3eadfabb70f83b313f946c8d31f9c223e8344', class: "brand" }, h("slot", { key: '5ce98314d980d63e1c87f508d96119aca2e702a9', name: "brand" }, h("lmvz-icon", { key: 'b24e61a9071d81948d506a8c545e012d3f0e5dd2', id: "fallback-logo-lmvz", icon: "Logo", size: "inherit", "aria-label": "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: '1d5cc9010ef90e6cebc8a7b054db595f35f9e040', "aria-label": "Hauptnavigation" }, h("div", { key: '488a1b1544242562b57d76169f1988d84c611de4', role: "menubar", class: "primary-menubar" }, h("slot", { key: '59c6dd1442290931ed9a55f7bacc65ea4bb9ff6d', name: "nav-primary", ref: el => (this.primarySlot = el) }), h("separator", { key: '2729f0e8b115614c50c4a16b6684a3bdb21856b8' }), h("div", { key: '6b5bed5951bad9173fefdc78039e71c4ccc120b2', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: el => (this.secondaryNav = el) }, h("slot", { key: '02f5a13e8851372c1698e3f786a8757a0a09c32f', name: this.secondarySlotName, ref: el => (this.secondarySlot = el) })))), h("div", { key: '53aafe8139bcea27d3039f64a48974cdb5aac5f9', class: "actions" }, h("slot", { key: 'f12ee19831073253e6ba8e251ba31ec403c21035', name: "actions" }))));
|
|
75
|
+
}
|
|
76
|
+
static get is() { return "lmvz-header"; }
|
|
77
|
+
static get encapsulation() { return "shadow"; }
|
|
78
|
+
static get originalStyleUrls() {
|
|
79
|
+
return {
|
|
80
|
+
"$": ["./lmvz-header.css"]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
static get styleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["lmvz-header.css"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get properties() {
|
|
89
|
+
return {
|
|
90
|
+
"role": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "string",
|
|
95
|
+
"resolved": "string",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": ""
|
|
103
|
+
},
|
|
104
|
+
"getter": true,
|
|
105
|
+
"setter": false,
|
|
106
|
+
"reflect": true,
|
|
107
|
+
"attribute": "role",
|
|
108
|
+
"defaultValue": "'banner'"
|
|
109
|
+
},
|
|
110
|
+
"lmvzActiveNav": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "string",
|
|
115
|
+
"resolved": "string",
|
|
116
|
+
"references": {}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": ""
|
|
123
|
+
},
|
|
124
|
+
"getter": false,
|
|
125
|
+
"setter": false,
|
|
126
|
+
"reflect": false,
|
|
127
|
+
"attribute": "lmvz-active-nav"
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
static get elementRef() { return "el"; }
|
|
132
|
+
static get watchers() {
|
|
133
|
+
return [{
|
|
134
|
+
"propName": "lmvzActiveNav",
|
|
135
|
+
"methodName": "handleActiveNavChange"
|
|
136
|
+
}];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Cache, Duration, Effect } from "effect";
|
|
2
|
+
import { httpClient, responseAsText } from "../../utils/http";
|
|
3
|
+
import { createAssetUrlWithBasePath } from "../../utils/url";
|
|
4
|
+
import { createValidSVGString, SVGString } from "../../utils/validation/svg";
|
|
5
|
+
export const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
6
|
+
const createIconCache = () => Cache.make({
|
|
7
|
+
capacity: 200,
|
|
8
|
+
timeToLive: Duration.infinity,
|
|
9
|
+
lookup: (key) => Effect.gen(function* () {
|
|
10
|
+
const name = key;
|
|
11
|
+
const assetPath = yield* createAssetUrlWithBasePath(`./icons/${name}.svg`);
|
|
12
|
+
const res = yield* httpClient(assetPath);
|
|
13
|
+
const responseString = yield* responseAsText(res);
|
|
14
|
+
return yield* createValidSVGString(responseString);
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
let cacheInstance = null;
|
|
18
|
+
export function fetchIconSvg(name) {
|
|
19
|
+
const key = name;
|
|
20
|
+
return Effect.gen(function* () {
|
|
21
|
+
if (!cacheInstance) {
|
|
22
|
+
cacheInstance = yield* createIconCache();
|
|
23
|
+
}
|
|
24
|
+
return yield* cacheInstance.get(key);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function clearIconCache() {
|
|
28
|
+
return Effect.gen(function* () {
|
|
29
|
+
if (cacheInstance) {
|
|
30
|
+
yield* cacheInstance.invalidateAll;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
Effect.logWarning('Attempted to clear icon cache before it was initialized');
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/**
|
|
3
|
+
* @prop --lmvz-icon-color: The icon's color. This is inferred from the context (e.g. button) but can be overridden if needed, or when the icon is used standalone.
|
|
4
|
+
*/
|
|
5
|
+
--lmvz-icon-color: var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));
|
|
6
|
+
|
|
7
|
+
display: inline-block;
|
|
8
|
+
|
|
9
|
+
/* prevent additional whitespace */
|
|
10
|
+
line-height: 0;
|
|
11
|
+
|
|
12
|
+
svg {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
svg > path {
|
|
17
|
+
stroke: var(--lmvz-icon-color);
|
|
18
|
+
fill: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([size='xs']) {
|
|
23
|
+
svg {
|
|
24
|
+
width: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
25
|
+
height: var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([size='sm']) {
|
|
30
|
+
svg {
|
|
31
|
+
width: var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));
|
|
32
|
+
height: var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([size='md']) {
|
|
37
|
+
svg {
|
|
38
|
+
width: var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
39
|
+
height: var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([size='lg']) {
|
|
44
|
+
svg {
|
|
45
|
+
width: var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));
|
|
46
|
+
height: var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([size='inherit']) {
|
|
51
|
+
svg {
|
|
52
|
+
width: inherit;
|
|
53
|
+
height: inherit;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([weight='light']) {
|
|
58
|
+
svg > path {
|
|
59
|
+
stroke-width: 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([weight='medium']) {
|
|
64
|
+
svg > path {
|
|
65
|
+
/* TODO: use semantic token */
|
|
66
|
+
stroke-width: 1.5;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([weight='bold']) {
|
|
71
|
+
svg > path {
|
|
72
|
+
/* TODO: use semantic token */
|
|
73
|
+
stroke-width: 2;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([weight='filled']) {
|
|
78
|
+
svg > path {
|
|
79
|
+
stroke-width: 2;
|
|
80
|
+
fill: var(--lmvz-icon-color);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Build, h, Host } from "@stencil/core";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
4
|
+
import { AriaValidationController } from "../../utils/validation/aria-validation-controller";
|
|
5
|
+
import { emptyDefaultSvg, fetchIconSvg } from "./icons";
|
|
6
|
+
export class LmvzIcon extends ReactiveControllerHost {
|
|
7
|
+
intersectionObserver;
|
|
8
|
+
el;
|
|
9
|
+
icon;
|
|
10
|
+
weight = 'medium';
|
|
11
|
+
size = 'md';
|
|
12
|
+
iconData;
|
|
13
|
+
visible = false;
|
|
14
|
+
ariaLabel;
|
|
15
|
+
get ariaHidden() {
|
|
16
|
+
return !this.ariaLabel;
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.addController(new AriaValidationController(this));
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
this.waitUntilVisible(() => {
|
|
24
|
+
this.visible = true;
|
|
25
|
+
this.loadIconPathData();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
if (this.intersectionObserver) {
|
|
30
|
+
this.intersectionObserver.disconnect();
|
|
31
|
+
this.intersectionObserver = null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async loadIconPathData() {
|
|
35
|
+
const { icon, visible } = this;
|
|
36
|
+
if (!Build.isBrowser || !icon || !visible) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.iconData = await Effect.runPromise(fetchIconSvg(this.icon).pipe(Effect.tapError(error => Effect.logError(`Error loading icon "${icon}":`, error.message, error.cause, error.stack)), Effect.catchAll(() => Effect.succeed(emptyDefaultSvg()))));
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return h(Host, { key: '50d0f96ec5085a47ca7783e5232dfb503fa32d29', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
43
|
+
}
|
|
44
|
+
waitUntilVisible(callback, rootMargin = 50) {
|
|
45
|
+
if (!Build.isBrowser || typeof window === 'undefined' || !window.IntersectionObserver) {
|
|
46
|
+
callback();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
50
|
+
entries.some(entry => {
|
|
51
|
+
if (entry.isIntersecting) {
|
|
52
|
+
this.intersectionObserver.disconnect();
|
|
53
|
+
this.intersectionObserver = null;
|
|
54
|
+
callback();
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
});
|
|
59
|
+
}, { rootMargin: `${rootMargin}px` });
|
|
60
|
+
this.intersectionObserver.observe(this.el);
|
|
61
|
+
}
|
|
62
|
+
static get is() { return "lmvz-icon"; }
|
|
63
|
+
static get encapsulation() { return "scoped"; }
|
|
64
|
+
static get originalStyleUrls() {
|
|
65
|
+
return {
|
|
66
|
+
"$": ["lmvz-icon.css"]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static get styleUrls() {
|
|
70
|
+
return {
|
|
71
|
+
"$": ["lmvz-icon.css"]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static get assetsDirs() { return ["../../assets/icons"]; }
|
|
75
|
+
static get properties() {
|
|
76
|
+
return {
|
|
77
|
+
"icon": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "Icon.IconName",
|
|
82
|
+
"resolved": "\"Logo\" | \"actions\" | \"adduser\" | \"alert\" | \"apple\" | \"arrow-down\" | \"arrow-left\" | \"arrow-right\" | \"arrow-up\" | \"book\" | \"bookmark\" | \"checkmark\" | \"chevron-down\" | \"chevron-left\" | \"chevron-right\" | \"chevron-up\" | \"close-l\" | \"close-sm\" | \"cog\" | \"computer\" | \"dashboard\" | \"delete\" | \"download\" | \"edit\" | \"external\" | \"facebook\" | \"favorite\" | \"filter\" | \"group\" | \"hide\" | \"home\" | \"info\" | \"instagram\" | \"letter\" | \"linkedin\" | \"logout\" | \"map\" | \"minus\" | \"navigation\" | \"plus\" | \"qr-scan\" | \"question\" | \"reader\" | \"reset\" | \"school\" | \"search\" | \"send\" | \"settings\" | \"share\" | \"shopping-cart\" | \"show\" | \"snapchat\" | \"sort\" | \"speech-bubble\" | \"star\" | \"student\" | \"upload\" | \"user\" | \"warn-circle\" | \"warn-triangle\" | \"whatsapp\" | \"world\" | \"x\" | \"youtube\"",
|
|
83
|
+
"references": {
|
|
84
|
+
"Icon": {
|
|
85
|
+
"location": "import",
|
|
86
|
+
"path": "../../api",
|
|
87
|
+
"id": "src/api/index.ts::Icon",
|
|
88
|
+
"referenceLocation": "Icon"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": true,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "The name of the icon to display (required)."
|
|
97
|
+
},
|
|
98
|
+
"getter": false,
|
|
99
|
+
"setter": false,
|
|
100
|
+
"reflect": true,
|
|
101
|
+
"attribute": "icon"
|
|
102
|
+
},
|
|
103
|
+
"weight": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "Icon.IconWeight",
|
|
108
|
+
"resolved": "\"bold\" | \"filled\" | \"medium\" | \"thin\"",
|
|
109
|
+
"references": {
|
|
110
|
+
"Icon": {
|
|
111
|
+
"location": "import",
|
|
112
|
+
"path": "../../api",
|
|
113
|
+
"id": "src/api/index.ts::Icon",
|
|
114
|
+
"referenceLocation": "Icon"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "The weight/style of the icon (optional, default is 'medium')."
|
|
123
|
+
},
|
|
124
|
+
"getter": false,
|
|
125
|
+
"setter": false,
|
|
126
|
+
"reflect": true,
|
|
127
|
+
"attribute": "weight",
|
|
128
|
+
"defaultValue": "'medium'"
|
|
129
|
+
},
|
|
130
|
+
"size": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "Icon.Size",
|
|
135
|
+
"resolved": "\"inherit\" | \"lg\" | \"md\" | \"sm\" | \"xs\"",
|
|
136
|
+
"references": {
|
|
137
|
+
"Icon": {
|
|
138
|
+
"location": "import",
|
|
139
|
+
"path": "../../api",
|
|
140
|
+
"id": "src/api/index.ts::Icon",
|
|
141
|
+
"referenceLocation": "Icon"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": true,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": "The size of the icon (optional, default is 'md')."
|
|
150
|
+
},
|
|
151
|
+
"getter": false,
|
|
152
|
+
"setter": false,
|
|
153
|
+
"reflect": true,
|
|
154
|
+
"attribute": "size",
|
|
155
|
+
"defaultValue": "'md'"
|
|
156
|
+
},
|
|
157
|
+
"ariaLabel": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": true,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": ""
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"reflect": true,
|
|
174
|
+
"attribute": "aria-label"
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
static get states() {
|
|
179
|
+
return {
|
|
180
|
+
"iconData": {},
|
|
181
|
+
"visible": {}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
static get elementRef() { return "el"; }
|
|
185
|
+
static get watchers() {
|
|
186
|
+
return [{
|
|
187
|
+
"propName": "icon",
|
|
188
|
+
"methodName": "loadIconPathData"
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { clearIconCache } from './icons';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { FetchError, ResponseTextError } from "../../../utils/http";
|
|
3
|
+
import { BrandValidationError, SVGString } from "../../../utils/validation/svg";
|
|
4
|
+
import { clearIconCache, emptyDefaultSvg, fetchIconSvg } from "../icons";
|
|
5
|
+
describe('icon utils:', () => {
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
global.DOMParser = class {
|
|
8
|
+
parseFromString(str, type) {
|
|
9
|
+
return {
|
|
10
|
+
documentElement: {
|
|
11
|
+
nodeName: str.includes('<svg') ? 'svg' : 'not-svg',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
jest.resetAllMocks();
|
|
19
|
+
global.fetch = jest.fn();
|
|
20
|
+
return Effect.runPromise(clearIconCache());
|
|
21
|
+
});
|
|
22
|
+
const validSvg = '<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg>';
|
|
23
|
+
const invalidSvg = '<div>not an svg</div>';
|
|
24
|
+
const iconName = 'actions';
|
|
25
|
+
function mockFetchSuccess(svg = validSvg) {
|
|
26
|
+
global.fetch.mockResolvedValueOnce({
|
|
27
|
+
text: () => Promise.resolve(svg),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function mockFetchFailure() {
|
|
31
|
+
global.fetch.mockRejectedValueOnce(new Error('fail'));
|
|
32
|
+
}
|
|
33
|
+
test('fetchIcon returns valid SVGString when fetch succeeds with valid SVG', async () => {
|
|
34
|
+
mockFetchSuccess(validSvg);
|
|
35
|
+
const result = await Effect.runPromise(fetchIconSvg(iconName));
|
|
36
|
+
expect(result).toContain('<svg');
|
|
37
|
+
expect(result).not.toBe(emptyDefaultSvg());
|
|
38
|
+
});
|
|
39
|
+
test('fetchIcon throws a specific FetchError when fetch fails', async () => {
|
|
40
|
+
mockFetchFailure();
|
|
41
|
+
const res = await Effect.runPromise(fetchIconSvg(iconName).pipe(Effect.flip));
|
|
42
|
+
expect(res).toBeInstanceOf(FetchError);
|
|
43
|
+
});
|
|
44
|
+
test('fetchIcon throws a specific InvalidSvgError when SVG is invalid', async () => {
|
|
45
|
+
mockFetchSuccess(invalidSvg);
|
|
46
|
+
const result = await Effect.runPromise(fetchIconSvg(iconName).pipe(Effect.flip));
|
|
47
|
+
expect(result).toBeInstanceOf(BrandValidationError);
|
|
48
|
+
expect(result.message).toContain('SVGString');
|
|
49
|
+
});
|
|
50
|
+
test('fetchIcon throws specific NotFoundError when icon is missing', async () => {
|
|
51
|
+
global.fetch.mockResolvedValueOnce({
|
|
52
|
+
text: () => Promise.reject(new Error('not found')),
|
|
53
|
+
});
|
|
54
|
+
const result = await Effect.runPromise(fetchIconSvg('missing').pipe(Effect.flip));
|
|
55
|
+
expect(result).toBeInstanceOf(ResponseTextError);
|
|
56
|
+
});
|
|
57
|
+
test('fetchIcon throws specific BrandValidationError for empty SVG string', async () => {
|
|
58
|
+
mockFetchSuccess('');
|
|
59
|
+
const result = await Effect.runPromise(fetchIconSvg(iconName).pipe(Effect.flip));
|
|
60
|
+
expect(result).toBeInstanceOf(BrandValidationError);
|
|
61
|
+
});
|
|
62
|
+
test('fetchIcon throws specific BrandValidationError for non-string SVG', async () => {
|
|
63
|
+
mockFetchSuccess(123);
|
|
64
|
+
const result = await Effect.runPromise(fetchIconSvg(iconName).pipe(Effect.flip));
|
|
65
|
+
expect(result).toBeInstanceOf(BrandValidationError);
|
|
66
|
+
});
|
|
67
|
+
test('SVGString branding enforces valid SVG', () => {
|
|
68
|
+
expect(() => SVGString(validSvg)).not.toThrow();
|
|
69
|
+
expect(() => SVGString(invalidSvg)).toThrow();
|
|
70
|
+
expect(() => SVGString('')).toThrow();
|
|
71
|
+
expect(() => SVGString(123)).toThrow();
|
|
72
|
+
});
|
|
73
|
+
test('emptyDefaultSvg is a valid branded SVGString', () => {
|
|
74
|
+
expect(() => SVGString(emptyDefaultSvg())).not.toThrow();
|
|
75
|
+
expect(emptyDefaultSvg()).toContain('<svg');
|
|
76
|
+
});
|
|
77
|
+
test('fetchIcon uses default weight if not provided', async () => {
|
|
78
|
+
mockFetchSuccess(validSvg);
|
|
79
|
+
const result = await Effect.runPromise(fetchIconSvg(iconName));
|
|
80
|
+
expect(result).toContain('<svg');
|
|
81
|
+
});
|
|
82
|
+
test('fetchIcon handles multiple calls and caches result', async () => {
|
|
83
|
+
mockFetchSuccess(validSvg);
|
|
84
|
+
const result1 = await Effect.runPromise(fetchIconSvg(iconName));
|
|
85
|
+
const result2 = await Effect.runPromise(fetchIconSvg(iconName));
|
|
86
|
+
expect(result1).toContain('<svg');
|
|
87
|
+
expect(result2).toBe(result1);
|
|
88
|
+
});
|
|
89
|
+
});
|