@ebrains/components 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/color-primary-palette_6.cjs.entry.js +14 -14
- package/dist/cjs/components-section.cjs.entry.js +1 -1
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/correct-use-of-colors.cjs.entry.js +1 -1
- package/dist/cjs/docs-palettes.cjs.entry.js +1 -1
- package/dist/cjs/docs-tokens.cjs.entry.js +1 -1
- package/dist/cjs/{eds-accordion_52.cjs.entry.js → eds-accordion_53.cjs.entry.js} +1095 -336
- package/dist/cjs/eds-app-root.cjs.entry.js +1 -1
- package/dist/cjs/eds-cookies-preference.cjs.entry.js +1 -1
- package/dist/cjs/eds-feedback.cjs.entry.js +1 -1
- package/dist/cjs/eds-frame.cjs.entry.js +1 -1
- package/dist/cjs/eds-gauge.cjs.entry.js +1 -1
- package/dist/cjs/eds-gitlab-contributors.cjs.entry.js +35 -32
- package/dist/cjs/eds-icon-bluesky.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-eu.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-facebook.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-gitlab.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-linkedin.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-mastodon.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-twitter.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-youtube.cjs.entry.js +1 -1
- package/dist/cjs/eds-input-search.cjs.entry.js +76 -0
- package/dist/cjs/eds-modal.cjs.entry.js +18 -9
- package/dist/cjs/eds-pie.cjs.entry.js +2 -2
- package/dist/cjs/eds-section-core_2.cjs.entry.js +3 -3
- package/dist/cjs/eds-timeline.cjs.entry.js +1 -1
- package/dist/cjs/eds-toast-manager.cjs.entry.js +1 -1
- package/dist/cjs/eds-trl-badge.cjs.entry.js +184 -0
- package/dist/cjs/incorrect-use-of-colors.cjs.entry.js +1 -1
- package/dist/cjs/index-50bc1aa4.js +10 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/logo-space.cjs.entry.js +58 -1
- package/dist/cjs/logo-variations-horizontal_2.cjs.entry.js +2 -2
- package/dist/cjs/logo-variations-tabs.cjs.entry.js +1 -1
- package/dist/cjs/logo-wrong-usage.cjs.entry.js +1 -1
- package/dist/cjs/svg-repository.cjs.entry.js +1 -1
- package/dist/cjs/token-list_3.cjs.entry.js +3 -3
- package/dist/cjs/token-ratios.cjs.entry.js +1 -1
- package/dist/cjs/token-spacing.cjs.entry.js +1 -1
- package/dist/cjs/token-typography.cjs.entry.js +8 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/eds-accordion/eds-accordion.css +3 -2
- package/dist/collection/components/eds-accordion/eds-accordion.js +2 -5
- package/dist/collection/components/eds-accordion/eds-accordion.stories.js +7 -19
- package/dist/collection/components/eds-alert/eds-alert.css +14 -0
- package/dist/collection/components/eds-alert/eds-alert.js +2 -1
- package/dist/collection/components/eds-alert/eds-alert.stories.js +19 -147
- package/dist/collection/components/eds-avatar/eds-avatar.js +1 -1
- package/dist/collection/components/eds-avatar/eds-avatar.stories.js +2 -2
- package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +1 -1
- package/dist/collection/components/eds-button/eds-button.css +15 -0
- package/dist/collection/components/eds-button/eds-button.js +17 -14
- package/dist/collection/components/eds-button/eds-button.stories.js +4 -1
- package/dist/collection/components/eds-cards/eds-card-app/eds-card-app.js +2 -5
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-cta/eds-card-cta.css +10 -1
- package/dist/collection/components/eds-cards/eds-card-cta/eds-card-cta.js +2 -5
- package/dist/collection/components/eds-cards/eds-card-cta/eds-card-cta.stories.js +4 -1
- package/dist/collection/components/eds-cards/eds-card-feature/eds-card-feature.js +2 -5
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +2 -4
- package/dist/collection/components/eds-cards/eds-card-hero/eds-card-hero.js +6 -7
- package/dist/collection/components/eds-cards/eds-card-stat/eds-card-stat.js +6 -7
- package/dist/collection/components/eds-charts/eds-gauge/eds-gauge.js +1 -1
- package/dist/collection/components/eds-charts/eds-pie/eds-pie.js +2 -2
- package/dist/collection/components/eds-code-block/eds-code-block.css +72 -106
- package/dist/collection/components/eds-code-block/eds-code-block.js +1 -1
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +30 -4
- package/dist/collection/components/eds-feedback/eds-feedback.js +1 -1
- package/dist/collection/components/eds-footer/eds-footer.css +143 -203
- package/dist/collection/components/eds-footer/eds-footer.js +176 -74
- package/dist/collection/components/eds-footer/eds-footer.stories.js +109 -17
- package/dist/collection/components/eds-form/eds-form.css +493 -1
- package/dist/collection/components/eds-form/eds-form.js +256 -14
- package/dist/collection/components/eds-form/eds-form.stories.js +110 -3
- package/dist/collection/components/eds-frame/eds-frame.js +1 -1
- package/dist/collection/components/eds-header/eds-header.js +1 -1
- package/dist/collection/components/eds-header/eds-header.stories.js +26 -12
- package/dist/collection/components/eds-icon-wrapper/eds-icon-wrapper.js +20 -1
- package/dist/collection/components/eds-icons/eds-icon-eu/eds-icon-eu.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-gitlab/eds-icon-gitlab.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-bluesky/eds-icon-bluesky.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-facebook/eds-icon-facebook.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-linkedin/eds-icon-linkedin.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-mastodon/eds-icon-mastodon.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-twitter/eds-icon-twitter.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-youtube/eds-icon-youtube.js +1 -1
- package/dist/collection/components/eds-img/eds-img.js +2 -2
- package/dist/collection/components/eds-img/eds-img.stories.js +29 -52
- package/dist/collection/components/eds-input-dropzone/eds-input-dropzone.js +7 -4
- package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +20 -2
- package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.css +39 -0
- package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +2 -1
- package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.css +17 -5
- package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-range/eds-input-range.js +15 -5
- package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.stories.js +30 -0
- package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +6 -2
- package/dist/collection/components/eds-input-field/eds-input-field.css +219 -0
- package/dist/collection/components/eds-input-field/eds-input-field.js +16 -5
- package/dist/collection/components/eds-input-field/eds-input-field.stories.js +105 -125
- package/dist/collection/components/eds-input-file/eds-input-file.js +5 -3
- package/dist/collection/components/eds-link/eds-link.js +4 -8
- package/dist/collection/components/eds-link/eds-link.stories.js +13 -8
- package/dist/collection/components/eds-logo/eds-logo.js +13 -66
- package/dist/collection/components/eds-logo/eds-logo.stories.js +36 -17
- package/dist/collection/components/eds-modal/eds-modal.js +18 -9
- package/dist/collection/components/eds-modal/eds-modal.stories.js +11 -8
- package/dist/collection/components/eds-nps/eds-nps.css +32 -0
- package/dist/collection/components/eds-nps/eds-nps.js +3 -3
- package/dist/collection/components/eds-pagination/eds-pagination.js +2 -2
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +1 -8
- package/dist/collection/components/eds-rating/eds-rating.css +9 -0
- package/dist/collection/components/eds-rating/eds-rating.js +2 -2
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +1 -1
- package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +2 -2
- package/dist/collection/components/eds-sidebar/eds-sidebar.js +2 -2
- package/dist/collection/components/eds-social-networks/eds-social-networks.js +1 -1
- package/dist/collection/components/eds-spinner/eds-spinner.js +1 -1
- package/dist/collection/components/eds-steps/eds-steps.css +56 -25
- package/dist/collection/components/eds-steps/eds-steps.js +27 -7
- package/dist/collection/components/eds-steps-v2/eds-steps-v2.css +93 -28
- package/dist/collection/components/eds-steps-v2/eds-steps-v2.js +57 -10
- package/dist/collection/components/eds-steps-v2/eds-steps-v2.stories.js +80 -17
- package/dist/collection/components/eds-switch/eds-switch.css +26 -3
- package/dist/collection/components/eds-switch/eds-switch.js +10 -7
- package/dist/collection/components/eds-switch/eds-switch.stories.js +20 -1
- package/dist/collection/components/eds-table/eds-table.css +21 -4
- package/dist/collection/components/eds-table/eds-table.js +16 -51
- package/dist/collection/components/eds-table/eds-table.stories.js +7 -115
- package/dist/collection/components/eds-tabs/eds-tabs.css +7 -1
- package/dist/collection/components/eds-tabs/eds-tabs.js +49 -18
- package/dist/collection/components/eds-tabs/eds-tabs.stories.js +2 -2
- package/dist/collection/components/eds-tag/eds-tag.js +1 -1
- package/dist/collection/components/eds-timeline/eds-timeline.js +1 -1
- package/dist/collection/components/eds-toast/eds-toast.css +146 -0
- package/dist/collection/components/eds-toast/eds-toast.js +106 -4
- package/dist/collection/components/eds-toast/eds-toast.stories.js +102 -5
- package/dist/collection/components/eds-toast-manager/eds-toast-manager.js +1 -1
- package/dist/collection/components/eds-tooltip/eds-tooltip.js +1 -1
- package/dist/collection/components/eds-tooltip/eds-tooltip.stories.js +7 -1
- package/dist/collection/components/eds-user/eds-user.js +2 -5
- package/dist/collection/components/eds-user/eds-user.stories.js +8 -11
- package/dist/collection/eds-docs-ui/colors/color-palette/primary.js +1 -1
- package/dist/collection/eds-docs-ui/colors/color-palette/secondary.js +1 -1
- package/dist/collection/eds-docs-ui/colors/color-palette/support.js +1 -1
- package/dist/collection/eds-docs-ui/colors/gradient-palette/primary.js +1 -1
- package/dist/collection/eds-docs-ui/colors/gradient-palette/secondary.js +7 -7
- package/dist/collection/eds-docs-ui/colors/gradient-palette/support.js +3 -3
- package/dist/collection/eds-docs-ui/colors/use-of-colors/correct-use-of-colors.js +1 -1
- package/dist/collection/eds-docs-ui/colors/use-of-colors/incorrect-use-of-colors.js +1 -1
- package/dist/collection/eds-docs-ui/components-section/components-section.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/docs-tokens/docs-tokens.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-list/token-list.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-radii/token-radii.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-ratios/token-ratios.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-shadows/token-shadows.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-spacing/token-spacing.js +1 -1
- package/dist/collection/eds-docs-ui/design-tokens/token-typography/token-typography.js +8 -2
- package/dist/collection/eds-docs-ui/docs-palettes/docs-palettes.js +1 -1
- package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.js +58 -1
- package/dist/collection/eds-docs-ui/logo/logo-variations/horizontal/logo-variations-horizontal.js +1 -1
- package/dist/collection/eds-docs-ui/logo/logo-variations/vertical/logo-variations-vertical.js +1 -1
- package/dist/collection/eds-docs-ui/logo/logo-variations-tabs/logo-variations.js +1 -1
- package/dist/collection/eds-docs-ui/logo/logo-wrong-usage/logo-wrong-usage.js +1 -1
- package/dist/collection/eds-docs-ui/svg-repository/svg-repository.js +1 -1
- package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.js +1 -1
- package/dist/collection/shared-ui/eds-gitlab-contributors/eds-gitlab-contributors.css +19 -0
- package/dist/collection/shared-ui/eds-gitlab-contributors/eds-gitlab-contributors.js +34 -31
- package/dist/collection/shared-ui/eds-global-search/eds-global-search.css +166 -0
- package/dist/collection/shared-ui/eds-global-search/eds-global-search.js +69 -7
- package/dist/collection/shared-ui/eds-kg-learning-resources/eds-kg-learning-resources.css +205 -0
- package/dist/collection/shared-ui/eds-kg-learning-resources/eds-kg-learning-resources.js +253 -0
- package/dist/collection/shared-ui/eds-kg-web-services-select/eds-kg-web-services-select.js +2 -2
- package/dist/collection/shared-ui/eds-kg-web-services-select/eds-kg-web-services-select.stories.js +1 -3
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.css +23 -102
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +7 -1
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.stories.js +1 -1
- package/dist/collection/shared-ui/eds-search-select/eds-search-select.css +213 -0
- package/dist/collection/shared-ui/eds-search-select/eds-search-select.js +706 -0
- package/dist/collection/shared-ui/eds-search-select/eds-search-select.stories.js +90 -0
- package/dist/collection/shared-ui/eds-trl-badge/ebrains-mark.js +26 -0
- package/dist/collection/shared-ui/eds-trl-badge/eds-trl-badge.css +22 -0
- package/dist/collection/shared-ui/eds-trl-badge/eds-trl-badge.js +324 -0
- package/dist/collection/shared-ui/eds-trl-badge/eds-trl-badge.stories.js +99 -0
- package/dist/collection/shared-ui/examples/eds-app-root/eds-app-root.js +1 -1
- package/dist/collection/utils/eds-form/formValidators.js +2 -1
- package/dist/collection/utils/eds-form/safeFormat.js +35 -0
- package/dist/components/components-section.js +1 -1
- package/dist/components/components.css +12 -11
- package/dist/components/components.esm.js +1 -1
- package/dist/components/correct-use-of-colors.js +1 -1
- package/dist/components/docs-palettes.js +1 -1
- package/dist/components/docs-tokens.js +1 -1
- package/dist/components/eds-accordion2.js +3 -6
- package/dist/components/eds-alert2.js +3 -2
- package/dist/components/eds-app-root.js +1 -1
- package/dist/components/eds-avatar2.js +1 -1
- package/dist/components/eds-block-break2.js +1 -1
- package/dist/components/eds-breadcrumb.js +1 -1
- package/dist/components/eds-button2.js +16 -13
- package/dist/components/eds-card-app.js +2 -5
- package/dist/components/eds-card-cta.js +3 -6
- package/dist/components/eds-card-desc2.js +1 -1
- package/dist/components/eds-card-feature.js +2 -5
- package/dist/components/eds-card-generic2.js +2 -4
- package/dist/components/eds-card-hero.js +6 -7
- package/dist/components/eds-card-stat.js +6 -7
- package/dist/components/eds-card-title2.js +1 -1
- package/dist/components/eds-code-block2.js +2 -2
- package/dist/components/eds-cookies-preference.js +1 -1
- package/dist/components/eds-dropdown2.js +30 -4
- package/dist/components/eds-feedback.js +1 -1
- package/dist/components/eds-footer2.js +118 -24
- package/dist/components/eds-form.js +146 -45
- package/dist/components/eds-frame.js +1 -1
- package/dist/components/eds-gauge.js +1 -1
- package/dist/components/eds-gitlab-contributors.js +35 -32
- package/dist/components/eds-global-search.js +55 -70
- package/dist/components/eds-header.js +1 -1
- package/dist/components/eds-icon-bluesky.js +1 -1
- package/dist/components/eds-icon-eu.js +1 -1
- package/dist/components/eds-icon-facebook.js +1 -1
- package/dist/components/eds-icon-gitlab.js +1 -1
- package/dist/components/eds-icon-linkedin.js +1 -1
- package/dist/components/eds-icon-mastodon.js +1 -1
- package/dist/components/eds-icon-twitter.js +1 -1
- package/dist/components/eds-icon-wrapper2.js +5 -2
- package/dist/components/eds-icon-youtube.js +1 -1
- package/dist/components/eds-img2.js +2 -2
- package/dist/components/eds-input-dropzone2.js +7 -4
- package/dist/components/eds-input-field2.js +31 -26
- package/dist/components/eds-input-file2.js +5 -3
- package/dist/components/eds-input-footer2.js +39 -3
- package/dist/components/eds-input-label2.js +2 -2
- package/dist/components/eds-input-range2.js +15 -5
- package/dist/components/eds-input-search.js +100 -1
- package/dist/components/eds-input-select2.js +6 -2
- package/dist/components/eds-input2.js +4 -2
- package/dist/components/eds-kg-learning-resources.d.ts +11 -0
- package/dist/components/eds-kg-learning-resources.js +217 -0
- package/dist/components/eds-kg-web-services-select2.js +18 -24
- package/dist/components/eds-link2.js +3 -7
- package/dist/components/eds-logo2.js +4 -22
- package/dist/components/eds-matomo-notice2.js +8 -2
- package/dist/components/eds-modal.js +18 -9
- package/dist/components/eds-nps2.js +4 -4
- package/dist/components/eds-pagination2.js +2 -2
- package/dist/components/eds-pie.js +2 -2
- package/dist/components/eds-progress-bar.js +1 -8
- package/dist/components/eds-rating2.js +3 -3
- package/dist/components/eds-search-select.d.ts +11 -0
- package/dist/components/eds-search-select.js +6 -0
- package/dist/components/eds-search-select2.js +382 -0
- package/dist/components/eds-section-core2.js +1 -1
- package/dist/components/eds-section-heading2.js +2 -2
- package/dist/components/eds-sidebar.js +2 -2
- package/dist/components/eds-social-networks2.js +1 -1
- package/dist/components/eds-spinner2.js +1 -1
- package/dist/components/eds-steps-v2.js +41 -11
- package/dist/components/eds-steps2.js +28 -8
- package/dist/components/eds-switch2.js +8 -5
- package/dist/components/eds-table2.js +30 -54
- package/dist/components/eds-tabs.js +50 -19
- package/dist/components/eds-tag2.js +1 -1
- package/dist/components/eds-timeline.js +1 -1
- package/dist/components/eds-toast-manager.js +1 -1
- package/dist/components/eds-toast2.js +39 -3
- package/dist/components/eds-tooltip2.js +1 -1
- package/dist/components/eds-trl-badge.d.ts +11 -0
- package/dist/components/eds-trl-badge.js +207 -0
- package/dist/components/eds-user.js +1 -4
- package/dist/components/incorrect-use-of-colors.js +1 -1
- package/dist/components/logo-space.js +76 -25
- package/dist/components/logo-variations-horizontal2.js +1 -1
- package/dist/components/logo-variations-tabs.js +1 -1
- package/dist/components/logo-variations-vertical2.js +1 -1
- package/dist/components/logo-wrong-usage.js +1 -1
- package/dist/components/p-05e96609.entry.js +1 -0
- package/dist/components/p-0d778d10.entry.js +1 -0
- package/dist/components/{p-d2576747.entry.js → p-114f6d54.entry.js} +1 -1
- package/dist/components/p-1534204d.entry.js +1 -0
- package/dist/components/p-337d4ee3.entry.js +9 -0
- package/dist/components/p-340bc935.entry.js +1 -0
- package/dist/components/{p-a6dc1f88.entry.js → p-37ef07d9.entry.js} +1 -1
- package/dist/components/p-39dbb964.entry.js +1 -0
- package/dist/components/{p-dfe93385.entry.js → p-3f66bc26.entry.js} +1 -1
- package/dist/components/p-43f9e64f.entry.js +1 -0
- package/dist/components/p-46cc6c1a.entry.js +1 -0
- package/dist/components/{p-773bd015.entry.js → p-4b8a7979.entry.js} +1 -1
- package/dist/components/p-6b94b2ec.entry.js +1 -0
- package/dist/components/p-6d965fef.entry.js +1 -0
- package/dist/components/{p-d16b5363.entry.js → p-6e370182.entry.js} +1 -1
- package/dist/components/{p-7b93a385.entry.js → p-6ffe581c.entry.js} +1 -1
- package/dist/components/p-726637b1.entry.js +1 -0
- package/dist/components/{p-a63e14bb.entry.js → p-86ccc09f.entry.js} +1 -1
- package/dist/components/{p-c2fc62f7.entry.js → p-8755a21b.entry.js} +1 -1
- package/dist/components/{p-0d7aee0b.entry.js → p-8ab461e2.entry.js} +1 -1
- package/dist/components/p-8cb162b8.entry.js +1 -0
- package/dist/components/p-8cdbc280.entry.js +1 -0
- package/dist/components/{p-940a2d42.entry.js → p-8e034c4e.entry.js} +1 -1
- package/dist/components/p-9f649fa3.entry.js +1 -0
- package/dist/components/{p-d1b3aa52.entry.js → p-a26dad9b.entry.js} +1 -1
- package/dist/components/p-a2d6a9ca.entry.js +1 -0
- package/dist/components/p-afabe1be.entry.js +1 -0
- package/dist/components/{p-c46675c8.entry.js → p-b1519098.entry.js} +1 -1
- package/dist/components/{p-04e9c2d7.entry.js → p-b1a10842.entry.js} +1 -1
- package/dist/components/{p-7aa4edef.entry.js → p-b4023b45.entry.js} +1 -1
- package/dist/components/p-c53b3563.entry.js +1 -0
- package/dist/components/p-c7d612d1.entry.js +1 -0
- package/dist/components/p-dc9aef22.entry.js +1 -0
- package/dist/components/{p-f364296f.entry.js → p-f66a7cf9.entry.js} +1 -1
- package/dist/components/p-f97f62f2.entry.js +1 -0
- package/dist/components/primary.js +1 -1
- package/dist/components/primary2.js +1 -1
- package/dist/components/secondary.js +1 -1
- package/dist/components/secondary2.js +7 -7
- package/dist/components/support.js +1 -1
- package/dist/components/support2.js +3 -3
- package/dist/components/svg-repository.js +19 -25
- package/dist/components/token-list2.js +1 -1
- package/dist/components/token-radii2.js +1 -1
- package/dist/components/token-ratios.js +1 -1
- package/dist/components/token-shadows2.js +1 -1
- package/dist/components/token-spacing.js +1 -1
- package/dist/components/token-typography.js +8 -2
- package/dist/esm/color-primary-palette_6.entry.js +14 -14
- package/dist/esm/components-section.entry.js +1 -1
- package/dist/esm/components.js +1 -1
- package/dist/esm/correct-use-of-colors.entry.js +1 -1
- package/dist/esm/docs-palettes.entry.js +1 -1
- package/dist/esm/docs-tokens.entry.js +1 -1
- package/dist/esm/{eds-accordion_52.entry.js → eds-accordion_53.entry.js} +1094 -336
- package/dist/esm/eds-app-root.entry.js +1 -1
- package/dist/esm/eds-cookies-preference.entry.js +1 -1
- package/dist/esm/eds-feedback.entry.js +1 -1
- package/dist/esm/eds-frame.entry.js +1 -1
- package/dist/esm/eds-gauge.entry.js +1 -1
- package/dist/esm/eds-gitlab-contributors.entry.js +35 -32
- package/dist/esm/eds-icon-bluesky.entry.js +1 -1
- package/dist/esm/eds-icon-eu.entry.js +1 -1
- package/dist/esm/eds-icon-facebook.entry.js +1 -1
- package/dist/esm/eds-icon-gitlab.entry.js +1 -1
- package/dist/esm/eds-icon-linkedin.entry.js +1 -1
- package/dist/esm/eds-icon-mastodon.entry.js +1 -1
- package/dist/esm/eds-icon-twitter.entry.js +1 -1
- package/dist/esm/eds-icon-youtube.entry.js +1 -1
- package/dist/{components/eds-input-search2.js → esm/eds-input-search.entry.js} +9 -39
- package/dist/esm/eds-modal.entry.js +18 -9
- package/dist/esm/eds-pie.entry.js +2 -2
- package/dist/esm/eds-section-core_2.entry.js +3 -3
- package/dist/esm/eds-timeline.entry.js +1 -1
- package/dist/esm/eds-toast-manager.entry.js +1 -1
- package/dist/esm/eds-trl-badge.entry.js +180 -0
- package/dist/esm/incorrect-use-of-colors.entry.js +1 -1
- package/dist/esm/index-870ab08f.js +10 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/logo-space.entry.js +58 -1
- package/dist/esm/logo-variations-horizontal_2.entry.js +2 -2
- package/dist/esm/logo-variations-tabs.entry.js +1 -1
- package/dist/esm/logo-wrong-usage.entry.js +1 -1
- package/dist/esm/svg-repository.entry.js +1 -1
- package/dist/esm/token-list_3.entry.js +3 -3
- package/dist/esm/token-ratios.entry.js +1 -1
- package/dist/esm/token-spacing.entry.js +1 -1
- package/dist/esm/token-typography.entry.js +8 -2
- package/dist/hydrate/index.js +1616 -397
- package/dist/hydrate/index.mjs +1616 -397
- package/dist/types/components/eds-accordion/eds-accordion.stories.d.ts +4 -8
- package/dist/types/components/eds-alert/eds-alert.stories.d.ts +7 -73
- package/dist/types/components/eds-button/eds-button.d.ts +1 -1
- package/dist/types/components/eds-dropdown/eds-dropdown.d.ts +1 -0
- package/dist/types/components/eds-footer/eds-footer.d.ts +84 -55
- package/dist/types/components/eds-footer/eds-footer.stories.d.ts +62 -1
- package/dist/types/components/eds-form/eds-form.d.ts +66 -0
- package/dist/types/components/eds-form/eds-form.stories.d.ts +63 -0
- package/dist/types/components/eds-header/eds-header.stories.d.ts +6 -6
- package/dist/types/components/eds-icon-wrapper/eds-icon-wrapper.d.ts +8 -0
- package/dist/types/components/eds-img/eds-img.stories.d.ts +6 -20
- package/dist/types/components/eds-input-elements/eds-input/eds-input.d.ts +7 -0
- package/dist/types/components/eds-input-elements/eds-input-search/eds-input-search.stories.d.ts +36 -0
- package/dist/types/components/eds-input-field/eds-input-field.stories.d.ts +97 -38
- package/dist/types/components/eds-link/eds-link.stories.d.ts +9 -6
- package/dist/types/components/eds-logo/eds-logo.d.ts +11 -28
- package/dist/types/components/eds-logo/eds-logo.stories.d.ts +22 -2
- package/dist/types/components/eds-steps/eds-steps.d.ts +7 -0
- package/dist/types/components/eds-steps-v2/eds-steps-v2.d.ts +14 -1
- package/dist/types/components/eds-steps-v2/eds-steps-v2.stories.d.ts +40 -9
- package/dist/types/components/eds-switch/eds-switch.d.ts +6 -2
- package/dist/types/components/eds-switch/eds-switch.stories.d.ts +8 -0
- package/dist/types/components/eds-table/eds-table.d.ts +8 -14
- package/dist/types/components/eds-table/eds-table.stories.d.ts +0 -107
- package/dist/types/components/eds-tabs/eds-tabs.d.ts +10 -0
- package/dist/types/components/eds-toast/eds-toast.d.ts +33 -1
- package/dist/types/components/eds-toast/eds-toast.stories.d.ts +49 -1
- package/dist/types/components/eds-user/eds-user.d.ts +0 -2
- package/dist/types/components/eds-user/eds-user.stories.d.ts +5 -9
- package/dist/types/components.d.ts +715 -144
- package/dist/types/shared-ui/eds-global-search/eds-global-search.d.ts +12 -0
- package/dist/types/shared-ui/eds-kg-learning-resources/eds-kg-learning-resources.d.ts +60 -0
- package/dist/types/shared-ui/eds-search-select/eds-search-select.d.ts +98 -0
- package/dist/types/shared-ui/eds-search-select/eds-search-select.stories.d.ts +81 -0
- package/dist/types/shared-ui/eds-trl-badge/ebrains-mark.d.ts +7 -0
- package/dist/types/shared-ui/eds-trl-badge/eds-trl-badge.d.ts +54 -0
- package/dist/types/shared-ui/eds-trl-badge/eds-trl-badge.stories.d.ts +112 -0
- package/dist/types/utils/eds-form/safeFormat.d.ts +21 -0
- package/package.json +1 -1
- package/dist/components/p-0fe10e6c.entry.js +0 -1
- package/dist/components/p-18e852e1.entry.js +0 -1
- package/dist/components/p-3ccd6948.entry.js +0 -1
- package/dist/components/p-3d3841d6.entry.js +0 -1
- package/dist/components/p-3f38df99.entry.js +0 -1
- package/dist/components/p-527e71d0.entry.js +0 -1
- package/dist/components/p-55047f7f.entry.js +0 -9
- package/dist/components/p-64c23098.entry.js +0 -1
- package/dist/components/p-74b9c9a8.entry.js +0 -1
- package/dist/components/p-878f65a6.entry.js +0 -1
- package/dist/components/p-92f6d9c0.entry.js +0 -1
- package/dist/components/p-9eedf771.entry.js +0 -1
- package/dist/components/p-b4355cec.entry.js +0 -1
- package/dist/components/p-d2f17fac.entry.js +0 -1
- package/dist/components/p-db5eea95.entry.js +0 -1
- package/dist/components/p-e205c269.entry.js +0 -1
- package/dist/components/p-f55dd314.entry.js +0 -1
- package/dist/components/p-f88b5f21.entry.js +0 -1
|
@@ -15,8 +15,9 @@ const EdsInputFile = /*@__PURE__*/ proxyCustomElement(class EdsInputFile extends
|
|
|
15
15
|
};
|
|
16
16
|
this.handleFileSelect = (event) => {
|
|
17
17
|
const input = event.target;
|
|
18
|
-
if (!input.files)
|
|
18
|
+
if (!input.files) {
|
|
19
19
|
return;
|
|
20
|
+
}
|
|
20
21
|
const newFiles = Array.from(input.files).map((file) => ({
|
|
21
22
|
file,
|
|
22
23
|
id: `${file.name}-${Date.now()}-${Math.random()}`
|
|
@@ -48,8 +49,9 @@ const EdsInputFile = /*@__PURE__*/ proxyCustomElement(class EdsInputFile extends
|
|
|
48
49
|
this.edsfile.emit({ files });
|
|
49
50
|
}
|
|
50
51
|
formatFileSize(bytes) {
|
|
51
|
-
if (bytes === 0)
|
|
52
|
+
if (bytes === 0) {
|
|
52
53
|
return '0 B';
|
|
54
|
+
}
|
|
53
55
|
const k = 1024;
|
|
54
56
|
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
55
57
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
@@ -68,7 +70,7 @@ const EdsInputFile = /*@__PURE__*/ proxyCustomElement(class EdsInputFile extends
|
|
|
68
70
|
}
|
|
69
71
|
render() {
|
|
70
72
|
const effectiveLabel = this.buttonLabel || (this.multiple ? 'Choose Files' : 'Choose File');
|
|
71
|
-
return (h("div", { key: '
|
|
73
|
+
return (h("div", { key: '810e30b054b1a6a43c9cc79e318ae487679de1d7', class: "eds-input-file-container" }, h("input", { key: '21a2162df7e6cc430b230407891bd1568bb4fe18', ref: (el) => (this.fileInputRef = el), type: "file", id: this.inputId || this.name, name: this.name, class: "eds-input-file-hidden", disabled: this.disabled, required: this.required, multiple: this.multiple, accept: this.accept, onChange: this.handleFileSelect }), h("button", { key: 'd297cf5c5e63c002558e878a140b931a68a25f54', type: "button", class: "eds-input-file-btn", onClick: this.handleButtonClick, disabled: this.disabled }, h("svg", { key: 'eb08b7516dce89647e28ca0c0ec1f70ade64b2cd', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { key: 'b0eefaf19325e60d5f974039644f8ab962bbfe92', d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { key: 'd0bfb65f3c6e3e9d019d23e94ceeb08ba3f6976e', points: "17 8 12 3 7 8" }), h("line", { key: '3e7b0172924b54c26b9100ea264e85be73beabe9', x1: "12", y1: "3", x2: "12", y2: "15" })), effectiveLabel), this.selectedFiles.length > 0 && (h("div", { key: '633d574a840479eb58ec596078960c88fbf4ce94', class: "eds-input-file-chips" }, this.selectedFiles.map((item) => (h("div", { key: item.id, class: "eds-input-file-chip" }, this.getFileIcon(item.file.name), h("span", { class: "eds-input-file-chip-name" }, item.file.name), h("span", { class: "eds-input-file-chip-size" }, this.formatFileSize(item.file.size)), h("button", { type: "button", class: "eds-input-file-chip-remove", onClick: () => this.handleRemoveFile(item.id), disabled: this.disabled, "aria-label": `Remove ${item.file.name}` }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))))));
|
|
72
74
|
}
|
|
73
75
|
get hostEl() { return this; }
|
|
74
76
|
static get style() { return EdsInputFileStyle0; }
|
|
@@ -2,7 +2,43 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
|
|
|
2
2
|
import { d as defineCustomElement$2 } from './eds-icon-wrapper2.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './eds-link2.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* safeInlineFormat — the single, audited text→HTML formatter used everywhere a
|
|
7
|
+
* form renders author-supplied text via innerHTML (form/step description, Text
|
|
8
|
+
* Blocks, and field messages).
|
|
9
|
+
*
|
|
10
|
+
* SECURITY: escape-first, then a tiny whitelisted inline subset. Because all of
|
|
11
|
+
* &, <, >, " are turned into entities BEFORE any markup is generated, author
|
|
12
|
+
* text can never inject a tag or attribute — the only HTML produced is the
|
|
13
|
+
* <strong>, <a> and <br> emitted here. Links are restricted to http/https/mailto
|
|
14
|
+
* (others fall back to plain text), URLs cannot contain whitespace or a quote,
|
|
15
|
+
* and external links get rel="noopener noreferrer".
|
|
16
|
+
*
|
|
17
|
+
* DO NOT reorder: escaping MUST happen before tag generation, or the guarantee
|
|
18
|
+
* breaks. Keep this in sync with the JS mirror in
|
|
19
|
+
* apps/live/forms-app/src/utils/descriptionFormat.ts.
|
|
20
|
+
*
|
|
21
|
+
* **bold** → <strong>bold</strong>
|
|
22
|
+
* [label](url) → <a href="url" …>label</a> (http/https/mailto only)
|
|
23
|
+
* newline → <br>
|
|
24
|
+
*/
|
|
25
|
+
function safeInlineFormat(text) {
|
|
26
|
+
if (!text) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
let s = String(text).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
30
|
+
// bold
|
|
31
|
+
s = s.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
|
32
|
+
// links — safe schemes only; otherwise drop to the plain label
|
|
33
|
+
s = s.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (_m, label, url) => /^(https?:|mailto:)/i.test(url)
|
|
34
|
+
? `<a href="${url}" target="_blank" rel="noopener noreferrer" class="eds-desc-link">${label}</a>`
|
|
35
|
+
: label);
|
|
36
|
+
// newlines → line breaks
|
|
37
|
+
s = s.replace(/\n/g, '<br>');
|
|
38
|
+
return s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const edsInputFooterCss = "p{margin:0}.eds-help{font-family:'IBM Plex Mono', ui-monospace, monospace;font-size:10.5px;line-height:1.45;letter-spacing:0.01em;color:#8a8c8a}.eds-desc-link{position:relative;display:inline-block;color:var(--brand-black);text-decoration:none}.eds-desc-link::after{content:'';position:absolute;bottom:-2px;left:0;width:0;height:2px;background-color:var(--brand-green);transition:width 0.3s ease}.eds-desc-link:hover::after{width:100%}.eds-desc-link:focus-visible::after{width:0}eds-link{--f-ui-02-fontSize:var(--f-ui-04-fontSize)}.text-error{color:var(--red-700)}.flex{display:flex}.items-center{align-items:center}.f-ui-04{font-family:var(--f-ui-04-fontFamily);font-weight:var(--f-ui-04-fontWeight);font-size:var(--f-ui-04-fontSize);line-height:var(--f-ui-04-lineHeight);letter-spacing:var(--f-ui-04-letterSpacing)}.ml-4{margin-left:0.25rem}.pt-4{padding-top:0.25rem}.mb-4{margin-bottom:0.25rem}.f-ui-05{font-family:var(--f-ui-05-fontFamily);font-weight:var(--f-ui-05-fontWeight);font-size:var(--f-ui-05-fontSize);line-height:var(--f-ui-05-lineHeight);letter-spacing:var(--f-ui-05-letterSpacing)}.text-lighter{color:var(--grey-600)}.effect-color{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.hover\\:text-lighter:hover{color:var(--grey-600)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}";
|
|
6
42
|
const EdsInputFooterStyle0 = edsInputFooterCss;
|
|
7
43
|
|
|
8
44
|
const EdsInputFooter = /*@__PURE__*/ proxyCustomElement(class EdsInputFooter extends HTMLElement {
|
|
@@ -17,7 +53,7 @@ const EdsInputFooter = /*@__PURE__*/ proxyCustomElement(class EdsInputFooter ext
|
|
|
17
53
|
this.link = undefined;
|
|
18
54
|
}
|
|
19
55
|
render() {
|
|
20
|
-
return (h("div", { key: '
|
|
56
|
+
return (h("div", { key: 'e3cf47ad941e608ec8f5daefd89d72e6d0af0f28' }, this.error && this.errorMessage && (h("div", { key: '0771ab5b0ba362a01df27c4b6ce0949ec51ec857', id: `error_${this.name}`, class: "text-error flex items-center" }, h("eds-icon-wrapper", { key: '43f86aa8632ea24b311e00a336b7d4b00b47ac80', name: "warning", size: 20 }), h("p", { key: '734a138c54dc0120fc6fdd320122c737b33b9d3b', class: "f-ui-04 ml-4 mb-4 pt-4", innerHTML: this.errorMessage }))), this.message && (h("p", { key: 'f8c6d5c1f48e10f9c556fc8d44189836b3b46dbf', id: `desc_${this.name}`, class: "eds-help text-lighter", innerHTML: safeInlineFormat(this.message) })), this.link && (h("eds-link", { key: 'fe7a52e14c6cf0791d36b781a92d7bbeca487ccc', label: this.link.label, url: this.link.url, intent: "underline", size: "small", external: true }))));
|
|
21
57
|
}
|
|
22
58
|
static get style() { return EdsInputFooterStyle0; }
|
|
23
59
|
}, [1, "eds-input-footer", {
|
|
@@ -51,4 +87,4 @@ function defineCustomElement() {
|
|
|
51
87
|
} });
|
|
52
88
|
}
|
|
53
89
|
|
|
54
|
-
export { EdsInputFooter as E, defineCustomElement as d };
|
|
90
|
+
export { EdsInputFooter as E, defineCustomElement as d, safeInlineFormat as s };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const edsInputLabelCss = ".input-label{font-family:var(--
|
|
3
|
+
const edsInputLabelCss = ".input-label{font-family:var(--plex-sans, 'IBM Plex Sans', system-ui, sans-serif);font-size:14.5px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--brand-black, #07140d)}.input-label b,.input-label strong{font-weight:var(--f-ui-02---bold-weight, bold)}.text-lighter{color:var(--grey-600)}.req-mark{color:var(--eds-field-accent, currentColor);margin-left:1px;font-weight:600}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}";
|
|
4
4
|
const EdsInputLabelStyle0 = edsInputLabelCss;
|
|
5
5
|
|
|
6
6
|
const EdsInputLabel = /*@__PURE__*/ proxyCustomElement(class EdsInputLabel extends HTMLElement {
|
|
@@ -14,7 +14,7 @@ const EdsInputLabel = /*@__PURE__*/ proxyCustomElement(class EdsInputLabel exten
|
|
|
14
14
|
this.disabled = false;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return (h("label", { key: '
|
|
17
|
+
return (h("label", { key: '46f04462b12694d932be79bb1d252cd001d29e58', htmlFor: this.name, class: `input-label ${this.disabled ? 'text-lighter' : ''}` }, this.label, this.required && (h("span", { key: 'c747f5a7896b395f5c1b54725a966d54c7e5dfcd' }, h("span", { key: '2a27cfce971df8eab6186028f6c8319f19504317', "aria-hidden": "true", class: "req-mark" }, "*"), h("span", { key: '5876e15a66aa95a62b934edec0d64f01f713d1a8', class: "sr-only" }, "required")))));
|
|
18
18
|
}
|
|
19
19
|
static get style() { return EdsInputLabelStyle0; }
|
|
20
20
|
}, [1, "eds-input-label", {
|
|
@@ -28,11 +28,13 @@ const EdsInputRange = /*@__PURE__*/ proxyCustomElement(class EdsInputRange exten
|
|
|
28
28
|
var _a;
|
|
29
29
|
this.sliderVal = (_a = this.value) !== null && _a !== void 0 ? _a : Math.round(this.min + (this.max - this.min) / 2);
|
|
30
30
|
}
|
|
31
|
-
// Keep the internal state in sync when the passed value changes.
|
|
31
|
+
// Keep the internal state in sync when the passed value changes. When the
|
|
32
|
+
// value is cleared (undefined/null — e.g. "Clear form"), fall back to the
|
|
33
|
+
// default midpoint so BOTH the thumb and the filled track reset together
|
|
34
|
+
// (the fill is derived from sliderVal, so it must be updated too).
|
|
32
35
|
onValueChange(newVal) {
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
}
|
|
36
|
+
this.sliderVal =
|
|
37
|
+
newVal !== undefined && newVal !== null ? newVal : Math.round(this.min + (this.max - this.min) / 2);
|
|
36
38
|
}
|
|
37
39
|
componentDidLoad() {
|
|
38
40
|
// Assign the native input element after the component loads
|
|
@@ -45,7 +47,15 @@ const EdsInputRange = /*@__PURE__*/ proxyCustomElement(class EdsInputRange exten
|
|
|
45
47
|
render() {
|
|
46
48
|
var _a;
|
|
47
49
|
const currentValue = (_a = this.sliderVal) !== null && _a !== void 0 ? _a : Math.round(this.min + (this.max - this.min) / 2);
|
|
48
|
-
|
|
50
|
+
// Paint the "filled" portion of the track up to the current value. Uses the
|
|
51
|
+
// brand accent when present (the var inherits from eds-form's brand body),
|
|
52
|
+
// else the default green — so non-brand forms look exactly as before.
|
|
53
|
+
const pct = this.max > this.min ? ((currentValue - this.min) / (this.max - this.min)) * 100 : 0;
|
|
54
|
+
const trackStyle = {
|
|
55
|
+
background: `linear-gradient(90deg, var(--eds-field-accent, var(--green-500)) ${pct}%, var(--grey-light, #ececec) ${pct}%)`
|
|
56
|
+
};
|
|
57
|
+
const mid = Math.round(this.min + (this.max - this.min) / 2);
|
|
58
|
+
return (h("div", { key: '742f329624bc2a8632640b6a93b6258d915f6deb', class: "eds-range" }, h("div", { key: '112ef4ef42761c85350f9624c10436fbd2600fce', class: "eds-range-top" }, h("span", { key: '2b2dbde929434f68c85a36380cbed1780707dfd8', id: `desc_${this.name}`, class: "eds-range-val" }, currentValue)), h("input", { key: 'd5bcbf157647324a1ddafab2001518707ae0de9b', id: this.inputId || this.name, name: this.name, style: trackStyle, min: this.min, max: this.max, step: this.step, value: currentValue, required: this.required, disabled: this.disabled, type: "range", class: "w-full input eds-range-input", tabindex: "0", role: "slider", "aria-describedby": `desc_${this.name}`, "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": currentValue, onInput: this.onInput, onChange: this.onChange }), h("div", { key: 'e72eed37dc3dc0bd596f9198f4d3f59ac11e1c40', class: "eds-range-scale", "aria-hidden": "true" }, h("span", { key: 'ba65117d4dc0c498878760ddf124d614c19af7b9' }, this.min), h("span", { key: '82e42ecec8f53634c005acc151f12a3c6f390ab3' }, mid), h("span", { key: 'b2272241e488952785c92b4a495b1ba744e13d19' }, this.max))));
|
|
49
59
|
}
|
|
50
60
|
get el() { return this; }
|
|
51
61
|
static get watchers() { return {
|
|
@@ -1,4 +1,103 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { s as sendAnalytics } from './analytics.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './eds-icon-wrapper2.js';
|
|
4
|
+
|
|
5
|
+
const EdsInputSearch$1 = /*@__PURE__*/ proxyCustomElement(class EdsInputSearch extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.search = createEvent(this, "search", 7);
|
|
10
|
+
/**
|
|
11
|
+
* Keydown event listener to detect Command+K (Mac) or Ctrl+K (Windows/Linux)
|
|
12
|
+
* and focus the input element when triggered.
|
|
13
|
+
*
|
|
14
|
+
* @param e - The keyboard event.
|
|
15
|
+
*/
|
|
16
|
+
this.keydownListener = (e) => {
|
|
17
|
+
// Check for Command+K (Mac) or Ctrl+K (Windows/Linux)
|
|
18
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
// Focus the input if it's available and not disabled
|
|
21
|
+
if (this.inputElement && !this.disabled) {
|
|
22
|
+
this.inputElement.focus();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/*onInput = (e: any) => {
|
|
27
|
+
// eslint-disable-next-line
|
|
28
|
+
console.log('on input:', e);
|
|
29
|
+
};*/
|
|
30
|
+
this.onChange = (e) => {
|
|
31
|
+
// eslint-disable-next-line
|
|
32
|
+
this.search.emit({
|
|
33
|
+
event: 'change',
|
|
34
|
+
value: e.target.value
|
|
35
|
+
});
|
|
36
|
+
sendAnalytics({
|
|
37
|
+
category: 'ui-component',
|
|
38
|
+
parentContext: null,
|
|
39
|
+
tag: this.el.tagName.toLowerCase(),
|
|
40
|
+
name: e.target.value || '',
|
|
41
|
+
action: 'search'
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
this.name = undefined;
|
|
45
|
+
this.inputId = 'search-main';
|
|
46
|
+
this.placeholder = 'Search...';
|
|
47
|
+
this.value = undefined;
|
|
48
|
+
this.disabled = false;
|
|
49
|
+
this.required = false;
|
|
50
|
+
this.decorate = undefined;
|
|
51
|
+
this.label = 'Search';
|
|
52
|
+
}
|
|
53
|
+
componentDidLoad() {
|
|
54
|
+
// Assign the native input element after the component loads
|
|
55
|
+
this.inputElement = this.el.querySelector('input');
|
|
56
|
+
document.addEventListener('keydown', this.keydownListener);
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
// Clean up the event listener when the component is removed
|
|
60
|
+
document.removeEventListener('keydown', this.keydownListener);
|
|
61
|
+
}
|
|
62
|
+
async getInputElement() {
|
|
63
|
+
// Return the native input element
|
|
64
|
+
return this.inputElement;
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return (h("div", { key: '900ca7578601ff528b717e5bc3e1fe6b43562fb6', class: "relative flex items-center" }, h("eds-icon-wrapper", { key: '722eecc1031f51f83100f9d35719a7ea837f680d', name: "search", class: "absolute top-1/2 left-[14px] -translate-y-1/2 text-lightest", "aria-hidden": "true" }), h("input", { key: '0445caabbf5e3077b708a2b8bdbe0fcee3133398', id: this.inputId || this.name, name: this.name, placeholder: this.placeholder, value: this.value || '', required: this.required, disabled: this.disabled, type: "search", "aria-label": this.placeholder, class: `input pl-36 ${this.decorate}`,
|
|
68
|
+
//onInput={this.onInput}
|
|
69
|
+
onChange: this.onChange })));
|
|
70
|
+
}
|
|
71
|
+
get el() { return this; }
|
|
72
|
+
}, [0, "eds-input-search", {
|
|
73
|
+
"name": [1],
|
|
74
|
+
"inputId": [1, "input-id"],
|
|
75
|
+
"placeholder": [1],
|
|
76
|
+
"value": [1],
|
|
77
|
+
"disabled": [4],
|
|
78
|
+
"required": [4],
|
|
79
|
+
"decorate": [1],
|
|
80
|
+
"label": [1],
|
|
81
|
+
"getInputElement": [64]
|
|
82
|
+
}]);
|
|
83
|
+
function defineCustomElement$1() {
|
|
84
|
+
if (typeof customElements === "undefined") {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const components = ["eds-input-search", "eds-icon-wrapper"];
|
|
88
|
+
components.forEach(tagName => { switch (tagName) {
|
|
89
|
+
case "eds-input-search":
|
|
90
|
+
if (!customElements.get(tagName)) {
|
|
91
|
+
customElements.define(tagName, EdsInputSearch$1);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
case "eds-icon-wrapper":
|
|
95
|
+
if (!customElements.get(tagName)) {
|
|
96
|
+
defineCustomElement$2();
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
} });
|
|
100
|
+
}
|
|
2
101
|
|
|
3
102
|
const EdsInputSearch = EdsInputSearch$1;
|
|
4
103
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -24,12 +24,16 @@ const EdsInputSelect = /*@__PURE__*/ proxyCustomElement(class EdsInputSelect ext
|
|
|
24
24
|
const selectId = this.inputId || this.name;
|
|
25
25
|
const placeholderText = this.placeholder || `Pick from the list`;
|
|
26
26
|
const describedBy = this.hasMessage || this.error ? `${this.name}-error` : undefined;
|
|
27
|
-
return (h("div", { key: '
|
|
27
|
+
return (h("div", { key: '303df3cd45f076ae5b29f301c9dc742e1664887a', class: "relative" }, h("select", { key: '7635ec7c53e7f07c7c71ab25e8475ed53a8d013e', id: selectId, name: this.name, class: {
|
|
28
28
|
input: true,
|
|
29
29
|
'input-error': this.error,
|
|
30
|
+
// No real value yet → the placeholder option is showing. Lets CSS
|
|
31
|
+
// render the select text in the light placeholder colour (grey-500),
|
|
32
|
+
// matching text inputs, instead of the dark default text colour.
|
|
33
|
+
'is-placeholder': !this.value && this.value !== 0,
|
|
30
34
|
'px-4': true,
|
|
31
35
|
'py-2': true
|
|
32
|
-
}, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, disabled: this.disabled, required: this.required, onChange: this.handleChange }, h("option", { key: '
|
|
36
|
+
}, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, disabled: this.disabled, required: this.required, onChange: this.handleChange }, h("option", { key: '793cd7db90936a9746810075246b5408710ce7ac', value: "", disabled: true, selected: !this.value || this.value === '' }, placeholderText), this.options.map((opt, index) => (h("option", { key: index, value: opt.value, selected: opt.value === this.value }, opt.label)))), h("span", { key: '41a1eb4a753c304148ee6cdc71049fa15cbd61f6', class: "bg-dark rounded-xs absolute top-1/2 right-[6px] flex h-28 w-28 -translate-y-1/2 items-center justify-center" }, h("eds-icon-wrapper", { key: '4ee4022f9d47fc26b27006f144fc598367f50169', class: "w-20 h-20", name: "chevron-right" }))));
|
|
33
37
|
}
|
|
34
38
|
}, [0, "eds-input-select", {
|
|
35
39
|
"inputId": [1, "input-id"],
|
|
@@ -29,6 +29,7 @@ const EdsInput = /*@__PURE__*/ proxyCustomElement(class EdsInput extends HTMLEle
|
|
|
29
29
|
this.min = undefined;
|
|
30
30
|
this.max = undefined;
|
|
31
31
|
this.step = undefined;
|
|
32
|
+
this.inputTabIndex = undefined;
|
|
32
33
|
this.innerVal = '';
|
|
33
34
|
this.maxLengthReached = false;
|
|
34
35
|
}
|
|
@@ -51,7 +52,7 @@ const EdsInput = /*@__PURE__*/ proxyCustomElement(class EdsInput extends HTMLEle
|
|
|
51
52
|
render() {
|
|
52
53
|
const withIcon = !!this.icon;
|
|
53
54
|
const describedBy = this.hasMessage || this.error ? `${this.name}-error` : '';
|
|
54
|
-
return (h("div", { key: '
|
|
55
|
+
return (h("div", { key: '6456b8536db4d219eb307603c986e0aca4867a66', class: "relative flex items-center" }, this.type === 'textarea' ? (h("textarea", { id: this.inputId || this.name, name: this.name, placeholder: this.placeholder, value: this.innerVal.toString(), required: this.required, disabled: this.disabled, class: `min-h-80 input input-textarea ${withIcon ? 'input-with-icon' : ''} ${this.error ? 'input-error' : ''} ${this.extraClass}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput })) : this.type === 'select' ? (h("select", { id: this.inputId || this.name, name: this.name, required: this.required, disabled: this.disabled, class: `input input-select ${this.error ? 'input-error' : ''} ${this.extraClass}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, onInput: this.handleInput, onChange: this.handleInput }, this.options.map((option) => (h("option", { value: option.value, selected: option.value === this.innerVal, key: option.value }, option.label))))) : (h("input", Object.assign({ id: this.inputId || this.name, name: this.name, placeholder: this.placeholder, value: this.innerVal.toString(), required: this.required, disabled: this.disabled, type: this.type, tabindex: this.inputTabIndex, checked: ['radio', 'checkbox'].includes(this.type) ? this.checked : undefined }, (this.type === 'number'
|
|
55
56
|
? {
|
|
56
57
|
min: this.min,
|
|
57
58
|
max: this.max,
|
|
@@ -62,7 +63,7 @@ const EdsInput = /*@__PURE__*/ proxyCustomElement(class EdsInput extends HTMLEle
|
|
|
62
63
|
input ${this.type === 'radio' ? 'input-radio' : this.type === 'checkbox' ? 'input-checkbox' : ''}
|
|
63
64
|
${withIcon && this.type !== 'radio' && this.type !== 'checkbox' ? 'input-icon pl-36' : ''}
|
|
64
65
|
${this.error ? 'input-error' : ''}
|
|
65
|
-
`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput }))), this.maxLength && this.type === 'textarea' && (h("span", { key: '
|
|
66
|
+
`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput }))), this.maxLength && this.type === 'textarea' && (h("span", { key: '216f52d80eefa2f89e388e020e597493015ae8d6', class: `input-counter f-ui-05 absolute bottom-8 right-8 ${this.maxLengthReached ? 'input-counter-error' : ''}` }, this.maxLength)), this.icon && (h("eds-icon-wrapper", { key: 'd3771580564237c9a8ded4e07f4293517bc885fd', class: `absolute top-1/2 left-[12px] -translate-y-1/2 ${this.disabled ? 'text-lightest' : 'text-lightest'}`, name: this.icon }))));
|
|
66
67
|
}
|
|
67
68
|
get el() { return this; }
|
|
68
69
|
static get watchers() { return {
|
|
@@ -86,6 +87,7 @@ const EdsInput = /*@__PURE__*/ proxyCustomElement(class EdsInput extends HTMLEle
|
|
|
86
87
|
"min": [2],
|
|
87
88
|
"max": [2],
|
|
88
89
|
"step": [2],
|
|
90
|
+
"inputTabIndex": [2, "input-tab-index"],
|
|
89
91
|
"innerVal": [32],
|
|
90
92
|
"maxLengthReached": [32]
|
|
91
93
|
}, undefined, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EdsKgLearningResources extends Components.EdsKgLearningResources, HTMLElement {}
|
|
4
|
+
export const EdsKgLearningResources: {
|
|
5
|
+
prototype: EdsKgLearningResources;
|
|
6
|
+
new (): EdsKgLearningResources;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$8 } from './eds-accordion2.js';
|
|
3
|
+
import { d as defineCustomElement$7 } from './eds-alert2.js';
|
|
4
|
+
import { d as defineCustomElement$6 } from './eds-button2.js';
|
|
5
|
+
import { d as defineCustomElement$5 } from './eds-icon-wrapper2.js';
|
|
6
|
+
import { d as defineCustomElement$4 } from './eds-link2.js';
|
|
7
|
+
import { d as defineCustomElement$3 } from './eds-spinner2.js';
|
|
8
|
+
import { d as defineCustomElement$2 } from './eds-tag2.js';
|
|
9
|
+
|
|
10
|
+
const edsKgLearningResourcesCss = ":host{display:block;font-family:var(--plex-sans, 'IBM Plex Sans', system-ui, sans-serif);color:var(--brand-black, #07140D)}.lr-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0.75rem;margin-bottom:1.5rem}.lr-heading{font-family:var(--inter, 'Inter', sans-serif);font-weight:300;font-size:1.75rem;line-height:110%;margin:0;color:var(--brand-black, #07140D)}.summary{display:flex;gap:0.5rem}.filters{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:0.75rem;margin-bottom:1.5rem;align-items:flex-end}.filter-search{grid-column:span 2}.filter-select{grid-column:span 1}.accordion-list{display:flex;flex-direction:column;gap:0.5rem}.resources-content{padding-top:0.5rem}.kg-link{margin-bottom:1rem}.resources-table{width:100%;border-collapse:collapse;font-size:0.875rem}.resources-table thead th{text-align:left;font-family:var(--plex-sans, 'IBM Plex Sans', system-ui, sans-serif);font-weight:500;font-size:0.75rem;text-transform:uppercase;letter-spacing:0.04em;color:var(--grey-dark, #7A7B7A);padding:0.5rem 0.75rem;border-bottom:1px solid rgba(0, 0, 0, 0.1)}.resource-row{transition:background-color 0.2s ease}.resource-row--clickable{cursor:pointer}.resource-row--clickable:hover{background-color:rgba(0, 255, 157, 0.04)}.resource-row td{padding:0.625rem 0.75rem;border-bottom:1px solid rgba(0, 0, 0, 0.04);vertical-align:top}.resource-row:last-child td{border-bottom:none}.resource-name{font-weight:500;font-size:1.0625rem;color:var(--brand-black, #07140D);transition:color 0.2s ease}.resource-row--clickable:hover .resource-name{color:var(--brand-green-dark, #00C87B)}.resource-desc{margin:0.25rem 0 0;font-size:0.9375rem;color:var(--grey-dark, #7A7B7A);line-height:145%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.col-name{width:auto}.col-type{width:160px;white-space:nowrap}.col-level{width:110px;white-space:nowrap}.loading{position:relative;min-height:8rem;padding:1rem 1.25rem;color:var(--grey-dark, #7A7B7A);font-size:0.9375rem;border:1px solid rgba(0, 0, 0, 0.08);border-radius:0.25rem;background-color:rgba(0, 0, 0, 0.02)}.no-results{padding:2rem;text-align:center;color:var(--grey-dark, #7A7B7A);font-size:0.875rem}@media (max-width: 750px){.lr-header{flex-direction:column;align-items:flex-start}.filters{grid-template-columns:1fr}.filter-search,.filter-select{grid-column:span 1}.col-type,.col-level{width:auto}.resources-table thead{display:none}.resource-row{display:flex;flex-wrap:wrap;gap:0.375rem;padding:0.625rem 0;border-bottom:1px solid rgba(0, 0, 0, 0.04)}.resource-row td{border:none;padding:0}.col-name{width:100%}}";
|
|
11
|
+
const EdsKgLearningResourcesStyle0 = edsKgLearningResourcesCss;
|
|
12
|
+
|
|
13
|
+
let cachedData = null;
|
|
14
|
+
let cacheTimestamp = 0;
|
|
15
|
+
const CACHE_TTL = 10 * 60 * 1000;
|
|
16
|
+
const EdsKgLearningResources$1 = /*@__PURE__*/ proxyCustomElement(class EdsKgLearningResources extends HTMLElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.__registerHost();
|
|
20
|
+
this.__attachShadow();
|
|
21
|
+
this.apiEndpoint = '/api/v1/kg/learning-resources/cached';
|
|
22
|
+
this.resolveNames = true;
|
|
23
|
+
this.size = 500;
|
|
24
|
+
this.heading = '';
|
|
25
|
+
this.variant = 'inverse';
|
|
26
|
+
this.loading = false;
|
|
27
|
+
this.error = '';
|
|
28
|
+
this.software = [];
|
|
29
|
+
this.meta = null;
|
|
30
|
+
this.filterType = '';
|
|
31
|
+
this.filterLevel = '';
|
|
32
|
+
this.searchQuery = '';
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.fetchData();
|
|
36
|
+
}
|
|
37
|
+
async fetchData() {
|
|
38
|
+
const now = Date.now();
|
|
39
|
+
if (cachedData && now - cacheTimestamp < CACHE_TTL) {
|
|
40
|
+
this.software = cachedData;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.loading = true;
|
|
44
|
+
this.error = '';
|
|
45
|
+
try {
|
|
46
|
+
const params = new URLSearchParams({
|
|
47
|
+
size: this.size.toString(),
|
|
48
|
+
resolve_names: this.resolveNames.toString()
|
|
49
|
+
});
|
|
50
|
+
const response = await fetch(`${this.apiEndpoint}?${params}`);
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
throw new Error(`Failed to fetch: ${response.statusText}`);
|
|
53
|
+
}
|
|
54
|
+
const data = await response.json();
|
|
55
|
+
this.software = data.data || [];
|
|
56
|
+
this.meta = data.meta || null;
|
|
57
|
+
cachedData = this.software;
|
|
58
|
+
cacheTimestamp = now;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.error = err instanceof Error ? err.message : 'Failed to load learning resources';
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
this.loading = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
getFilteredSoftware() {
|
|
68
|
+
let filtered = this.software;
|
|
69
|
+
if (this.filterType) {
|
|
70
|
+
filtered = filtered.filter((sw) => sw.learning_resources_types.includes(this.filterType));
|
|
71
|
+
}
|
|
72
|
+
if (this.filterLevel) {
|
|
73
|
+
filtered = filtered.filter((sw) => sw.learning_resources_levels.includes(this.filterLevel));
|
|
74
|
+
}
|
|
75
|
+
if (this.searchQuery) {
|
|
76
|
+
const q = this.searchQuery.toLowerCase();
|
|
77
|
+
filtered = filtered.filter((sw) => sw.name.toLowerCase().includes(q) ||
|
|
78
|
+
sw.learning_resources.some((lr) => { var _a, _b; return ((_a = lr.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(q)) || ((_b = lr.abstract) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(q)); }));
|
|
79
|
+
}
|
|
80
|
+
return filtered;
|
|
81
|
+
}
|
|
82
|
+
getFilteredResources(resources) {
|
|
83
|
+
let filtered = resources;
|
|
84
|
+
if (this.filterType) {
|
|
85
|
+
filtered = filtered.filter((lr) => lr.type === this.filterType);
|
|
86
|
+
}
|
|
87
|
+
if (this.filterLevel) {
|
|
88
|
+
filtered = filtered.filter((lr) => lr.educational_level === this.filterLevel);
|
|
89
|
+
}
|
|
90
|
+
return filtered;
|
|
91
|
+
}
|
|
92
|
+
/* TODO: Uncomment when filters are enabled
|
|
93
|
+
private getAllTypes(): string[] {
|
|
94
|
+
const types = new Set<string>();
|
|
95
|
+
this.software.forEach(sw =>
|
|
96
|
+
sw.learning_resources_types.forEach(t => types.add(t))
|
|
97
|
+
);
|
|
98
|
+
return Array.from(types).sort();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private getAllLevels(): string[] {
|
|
102
|
+
const levels = new Set<string>();
|
|
103
|
+
this.software.forEach(sw =>
|
|
104
|
+
sw.learning_resources_levels.forEach(l => levels.add(l))
|
|
105
|
+
);
|
|
106
|
+
return Array.from(levels).sort();
|
|
107
|
+
}
|
|
108
|
+
*/
|
|
109
|
+
getTagIntent(type) {
|
|
110
|
+
const map = {
|
|
111
|
+
'interactive tutorial': 'brand',
|
|
112
|
+
'video tutorial': 'primary',
|
|
113
|
+
'user documentation': 'dark',
|
|
114
|
+
'video presentation': 'inverse',
|
|
115
|
+
'slide deck': 'strong'
|
|
116
|
+
};
|
|
117
|
+
return map[type] || 'brand-dark';
|
|
118
|
+
}
|
|
119
|
+
getLevelTagIntent(level) {
|
|
120
|
+
const map = {
|
|
121
|
+
beginner: 'brand',
|
|
122
|
+
intermediate: 'dark',
|
|
123
|
+
advanced: 'strong'
|
|
124
|
+
};
|
|
125
|
+
return map[level] || 'brand-dark';
|
|
126
|
+
}
|
|
127
|
+
renderAccordionDescription(sw) {
|
|
128
|
+
const count = sw.learning_resources_count;
|
|
129
|
+
const types = sw.learning_resources_types.join(', ');
|
|
130
|
+
return `${count} resource${count !== 1 ? 's' : ''} — ${types}`;
|
|
131
|
+
}
|
|
132
|
+
renderResources(sw) {
|
|
133
|
+
const filtered = this.getFilteredResources(sw.learning_resources);
|
|
134
|
+
return (h("div", { class: "resources-content" }, sw.kg_search_url && (h("div", { class: "kg-link" }, h("eds-link", { url: sw.kg_search_url, label: "View in EBRAINS Knowledge Graph", intent: "cta", external: true }))), h("table", { class: "resources-table" }, h("thead", null, h("tr", null, h("th", { class: "col-name" }, "Name"), h("th", { class: "col-type" }, "Type"), h("th", { class: "col-level" }, "Level"))), h("tbody", null, filtered.map((lr) => (h("tr", { class: `resource-row ${lr.iri ? 'resource-row--clickable' : ''}`, onClick: () => {
|
|
135
|
+
if (lr.iri) {
|
|
136
|
+
window.open(lr.iri, '_blank', 'noopener,noreferrer');
|
|
137
|
+
}
|
|
138
|
+
} }, h("td", { class: "col-name" }, h("span", { class: "resource-name" }, lr.name || 'Untitled'), lr.abstract && h("p", { class: "resource-desc" }, lr.abstract)), h("td", { class: "col-type" }, lr.type && h("eds-tag", { label: lr.type, intent: this.getTagIntent(lr.type), size: "medium" })), h("td", { class: "col-level" }, lr.educational_level && (h("eds-tag", { label: lr.educational_level, intent: this.getLevelTagIntent(lr.educational_level), size: "medium" })))))))), filtered.length === 0 && h("p", { class: "no-results" }, "No resources match the current filters.")));
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
// Always render the same outer scaffold (header + content area) so the
|
|
142
|
+
// heading sits in identical position across loading / error / loaded
|
|
143
|
+
// states and the spinner appears where the accordion list will render.
|
|
144
|
+
const filtered = !this.loading && !this.error ? this.getFilteredSoftware() : [];
|
|
145
|
+
// const allTypes = this.getAllTypes();
|
|
146
|
+
// const allLevels = this.getAllLevels();
|
|
147
|
+
return (h("div", { key: 'aef669885e2bc85b30f70b3db12fbf4040a306a9', class: "lr-container" }, h("div", { key: '95413849959947a851e27a404aa21368aa895e96', class: "lr-header" }, h("h2", { key: '10353aae716a1408f3f49d70501684a633bf7b51', class: "lr-heading" }, this.heading)), this.loading && (h("div", { key: 'd3318b411c4e27551997a697aa165fe4afb8f3fa', class: "loading", role: "status", "aria-live": "polite" }, h("eds-spinner", { key: 'b242ace225a2b93d5d8e6e4fd3b78a23778d1995', size: "sm", variant: "primary", background: "transparent", message: "Loading learning resources..." }))), this.error && !this.loading && h("eds-alert", { key: 'c0a5cf3aa2830cb96f253f10a34babc4bdb9aedb', intent: "error", message: this.error }), !this.loading && !this.error && (h("div", { key: '83671b3aea2286fe508742ae81d8d0d4aae9863c', class: "accordion-list" }, filtered.map((sw) => (h("eds-accordion", { heading: sw.name, description: this.renderAccordionDescription(sw), variant: this.variant, icon: "book", switchBg: true, clampText: false }, this.renderResources(sw)))), filtered.length === 0 && h("p", { key: '2d344afbcaa2f18bddf2872fd1cf1eb0993ce632', class: "no-results" }, "No software matches the current filters.")))));
|
|
148
|
+
}
|
|
149
|
+
get el() { return this; }
|
|
150
|
+
static get style() { return EdsKgLearningResourcesStyle0; }
|
|
151
|
+
}, [1, "eds-kg-learning-resources", {
|
|
152
|
+
"apiEndpoint": [1, "api-endpoint"],
|
|
153
|
+
"resolveNames": [4, "resolve-names"],
|
|
154
|
+
"size": [2],
|
|
155
|
+
"heading": [1],
|
|
156
|
+
"variant": [1],
|
|
157
|
+
"loading": [32],
|
|
158
|
+
"error": [32],
|
|
159
|
+
"software": [32],
|
|
160
|
+
"meta": [32],
|
|
161
|
+
"filterType": [32],
|
|
162
|
+
"filterLevel": [32],
|
|
163
|
+
"searchQuery": [32]
|
|
164
|
+
}]);
|
|
165
|
+
function defineCustomElement$1() {
|
|
166
|
+
if (typeof customElements === "undefined") {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const components = ["eds-kg-learning-resources", "eds-accordion", "eds-alert", "eds-button", "eds-icon-wrapper", "eds-link", "eds-spinner", "eds-tag"];
|
|
170
|
+
components.forEach(tagName => { switch (tagName) {
|
|
171
|
+
case "eds-kg-learning-resources":
|
|
172
|
+
if (!customElements.get(tagName)) {
|
|
173
|
+
customElements.define(tagName, EdsKgLearningResources$1);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case "eds-accordion":
|
|
177
|
+
if (!customElements.get(tagName)) {
|
|
178
|
+
defineCustomElement$8();
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
case "eds-alert":
|
|
182
|
+
if (!customElements.get(tagName)) {
|
|
183
|
+
defineCustomElement$7();
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case "eds-button":
|
|
187
|
+
if (!customElements.get(tagName)) {
|
|
188
|
+
defineCustomElement$6();
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
case "eds-icon-wrapper":
|
|
192
|
+
if (!customElements.get(tagName)) {
|
|
193
|
+
defineCustomElement$5();
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
case "eds-link":
|
|
197
|
+
if (!customElements.get(tagName)) {
|
|
198
|
+
defineCustomElement$4();
|
|
199
|
+
}
|
|
200
|
+
break;
|
|
201
|
+
case "eds-spinner":
|
|
202
|
+
if (!customElements.get(tagName)) {
|
|
203
|
+
defineCustomElement$3();
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
case "eds-tag":
|
|
207
|
+
if (!customElements.get(tagName)) {
|
|
208
|
+
defineCustomElement$2();
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
} });
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const EdsKgLearningResources = EdsKgLearningResources$1;
|
|
215
|
+
const defineCustomElement = defineCustomElement$1;
|
|
216
|
+
|
|
217
|
+
export { EdsKgLearningResources, defineCustomElement };
|