@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
|
@@ -2,6 +2,23 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { sendAnalytics } from "../../utils/analytics";
|
|
3
3
|
export class EdsGlobalSearch {
|
|
4
4
|
constructor() {
|
|
5
|
+
/** Clear the current query and results; keep focus in the input so the
|
|
6
|
+
* user can start typing again without an extra click. */
|
|
7
|
+
this.handleClear = () => {
|
|
8
|
+
if (this.debounceTimer) {
|
|
9
|
+
clearTimeout(this.debounceTimer);
|
|
10
|
+
}
|
|
11
|
+
this.query = '';
|
|
12
|
+
this.results = [];
|
|
13
|
+
this.hasSearched = false;
|
|
14
|
+
this.showDropdown = false;
|
|
15
|
+
this.selectedIndex = -1;
|
|
16
|
+
// Re-focus and reflect the empty value on the underlying DOM input.
|
|
17
|
+
if (this.inputRef) {
|
|
18
|
+
this.inputRef.value = '';
|
|
19
|
+
this.inputRef.focus();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
5
22
|
this.handleInput = (event) => {
|
|
6
23
|
var _a;
|
|
7
24
|
const target = event.target;
|
|
@@ -34,6 +51,7 @@ export class EdsGlobalSearch {
|
|
|
34
51
|
this.currentOrigin = '';
|
|
35
52
|
this.currentSource = '';
|
|
36
53
|
this.authToken = '';
|
|
54
|
+
this.variant = 'gray';
|
|
37
55
|
this.query = '';
|
|
38
56
|
this.results = [];
|
|
39
57
|
this.loading = false;
|
|
@@ -43,15 +61,26 @@ export class EdsGlobalSearch {
|
|
|
43
61
|
this.selectedIndex = -1;
|
|
44
62
|
}
|
|
45
63
|
componentDidLoad() {
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
// ⌘K / Ctrl+K focuses the search pill from anywhere on the page.
|
|
65
|
+
// Bound here (not via @Listen) so it works across shadow boundaries.
|
|
66
|
+
this.cmdKListener = (event) => {
|
|
67
|
+
var _a;
|
|
68
|
+
const isMac = navigator.platform.toUpperCase().includes('MAC');
|
|
69
|
+
const modifier = isMac ? event.metaKey : event.ctrlKey;
|
|
70
|
+
if (modifier && event.key.toLowerCase() === 'k') {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
document.addEventListener('keydown', this.cmdKListener);
|
|
50
76
|
}
|
|
51
77
|
disconnectedCallback() {
|
|
52
78
|
if (this.debounceTimer) {
|
|
53
79
|
clearTimeout(this.debounceTimer);
|
|
54
80
|
}
|
|
81
|
+
if (this.cmdKListener) {
|
|
82
|
+
document.removeEventListener('keydown', this.cmdKListener);
|
|
83
|
+
}
|
|
55
84
|
}
|
|
56
85
|
handleDocumentClick(event) {
|
|
57
86
|
const path = event.composedPath();
|
|
@@ -108,7 +137,9 @@ export class EdsGlobalSearch {
|
|
|
108
137
|
if (this.authToken) {
|
|
109
138
|
headers['Authorization'] = `Bearer ${this.authToken}`;
|
|
110
139
|
}
|
|
111
|
-
const response = await fetch(`${this.apiEndpoint}?q=${encodeURIComponent(query)}&limit=${this.limit}`, {
|
|
140
|
+
const response = await fetch(`${this.apiEndpoint}?q=${encodeURIComponent(query)}&limit=${this.limit}`, {
|
|
141
|
+
headers
|
|
142
|
+
});
|
|
112
143
|
if (!response.ok) {
|
|
113
144
|
throw new Error('Search failed');
|
|
114
145
|
}
|
|
@@ -198,10 +229,23 @@ export class EdsGlobalSearch {
|
|
|
198
229
|
return this.hasSearched && !this.loading && !this.hasResults && this.query.trim();
|
|
199
230
|
}
|
|
200
231
|
render() {
|
|
201
|
-
return (h("div", { key: '
|
|
232
|
+
return (h("div", { key: '677355c6a3318ec1197965eac1b2cd92d1068730', class: "search-wrapper" }, h("label", { key: 'f5cc85b9445df11e888428bb2a0b2b4114bdc3a9', class: `search-pill search-pill--${this.variant}`, htmlFor: "search-global" }, h("svg", { key: 'b95972f32833c302166af4d496d62aabbbca6b96', class: "search-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("circle", { key: '916f6f24dc45b800fd024196cad8a5a7704715e0', cx: "11", cy: "11", r: "7" }), h("line", { key: 'e73a37d14e3c5de75ff1d5e1ff3ac6dc17276884', x1: "20", y1: "20", x2: "16.5", y2: "16.5" })), h("input", { key: 'e9c88b7577dbc32d700f4ccfc657ac3400c406a7', id: "search-global", class: "search-input", type: "search", name: "search-box-global", placeholder: this.placeholder, value: this.query, autoComplete: "off", onInput: this.handleInput, ref: (el) => (this.inputRef = el) }), this.query && this.query.length > 0 ? (h("button", { type: "button", class: "search-clear", "aria-label": "Clear search", onMouseDown: (e) => e.preventDefault() /* keep focus in input */, onClick: () => this.handleClear() }, h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))) : (h("kbd", { class: "search-kbd", "aria-hidden": "true" }, "\u2318K"))), this.showDropdown && (h("div", { key: 'bac2451a0d8e8fe44f4ee8205aac072866c071cc', class: "search-dropdown", ref: (el) => (this.dropdownRef = el) }, this.loading && (h("div", { key: '2272670a68466fdcb7f7dbef9392c85524f26511', class: "flex text-center justify-center p-64" }, h("eds-spinner", { key: 'ea08bc71e4e251110d63c1f7f0c9ec3cf4f02d31', variant: "primary", size: "sm" }))), this.error && !this.loading && (h("div", { key: 'c54f235e8cf516715d83b830c13b7091ce10c8e5', class: "flex text-center justify-center p-16" }, h("span", { key: '5e0164e70620b1b70acbd665f72e02627758d447', class: "text-error f-body-02" }, this.error))), this.showEmpty && (h("div", { key: 'bc8c5dce2e1e9e0cdb46db53a94d4a06401f8c2f', class: "dropdown-state" }, h("eds-icon-wrapper", { key: 'ddb1815134abfd538530de6d805006f2e629f423', name: "search" }), h("div", { key: '0fe6b3742f59bf6a9745d0c3652caeed1c9fcd0c' }, h("p", { key: '26751d170e283e85eb0fa914c7cd681281b79606', class: "f-body-02" }, "No results found"), h("p", { key: '3c5117ba70272690647141c09105ad73142d2880', class: "f-ui-04 text-lightest" }, "Try different keywords")))), this.hasResults && !this.loading && (h("ul", { key: 'ec4e905215fa05a2d29e3cb02325b898cc8e7e75', class: "dropdown-results" }, this.results.map((result, index) => (h("li", { key: result.id, "data-index": index, class: {
|
|
202
233
|
'result-item': true,
|
|
203
234
|
'result-item--selected': index === this.selectedIndex
|
|
204
|
-
}, onClick: () => this.selectResult(result), onMouseEnter: () => (this.selectedIndex = index) }, h("div", { class: "result-header" }, h("span", { class: "result-title f-body-02" }, result.title)), h("div", { class: "result-meta" },
|
|
235
|
+
}, onClick: () => this.selectResult(result), onMouseEnter: () => (this.selectedIndex = index) }, h("div", { class: "result-header" }, h("span", { class: "result-title f-body-02" }, result.title)), h("div", { class: "result-meta" }, result.parent_software
|
|
236
|
+
? [
|
|
237
|
+
h("span", { class: "result-badge result-badge--parent" }, result.parent_software),
|
|
238
|
+
result.section && h("span", { class: "result-badge result-badge--lr" }, result.section)
|
|
239
|
+
]
|
|
240
|
+
: result.source === 'kg-services'
|
|
241
|
+
? [
|
|
242
|
+
h("span", { class: "result-badge" }, "EBRAINS KG"),
|
|
243
|
+
result.section && h("span", { class: "result-badge" }, result.section)
|
|
244
|
+
]
|
|
245
|
+
: [
|
|
246
|
+
h("span", { class: "result-badge" }, result.source),
|
|
247
|
+
result.section && h("span", { class: "result-badge" }, result.section)
|
|
248
|
+
], h("span", { class: "result-url" }, result.url)), result.snippet && h("p", { class: "result-snippet" }, this.stripHtml(result.snippet))))))), this.hasResults && !this.loading && (h("div", { key: '8ba2b0905762d08201d770ef4ad555b5817a93d5', class: "dropdown-footer" }, h("span", { key: '447177da436c4673c1530b63985069270eea9629', class: "footer-hint" }, h("kbd", { key: 'eca68fd4c32ff1b05130322d55c6b40353d0d7e9' }, "\u2191"), " ", h("kbd", { key: 'f0e8c800465276b7648e883f0de99389e144cbdf' }, "\u2193"), " navigate \u2022 ", h("kbd", { key: 'a40bfd64de00d1e9e7770ae13221b84e7270a93e' }, "\u21B5"), " select \u2022 ", h("kbd", { key: 'bbc53439fad27289cdd4705a7ddb61e8d3b578ee' }, "esc"), " close")))))));
|
|
205
249
|
}
|
|
206
250
|
static get is() { return "eds-global-search"; }
|
|
207
251
|
static get encapsulation() { return "shadow"; }
|
|
@@ -360,6 +404,24 @@ export class EdsGlobalSearch {
|
|
|
360
404
|
"attribute": "auth-token",
|
|
361
405
|
"reflect": false,
|
|
362
406
|
"defaultValue": "''"
|
|
407
|
+
},
|
|
408
|
+
"variant": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"mutable": false,
|
|
411
|
+
"complexType": {
|
|
412
|
+
"original": "'gray' | 'white' | 'black'",
|
|
413
|
+
"resolved": "\"black\" | \"gray\" | \"white\"",
|
|
414
|
+
"references": {}
|
|
415
|
+
},
|
|
416
|
+
"required": false,
|
|
417
|
+
"optional": false,
|
|
418
|
+
"docs": {
|
|
419
|
+
"tags": [],
|
|
420
|
+
"text": "Visual theme of the search pill.\n- \"gray\" (default): light grey surface (matches the EBRAINS header mockup)\n- \"white\": white surface with a 1px border (use when sitting on a coloured nav)\n- \"black\": brand-black surface with white text (use on dark backgrounds)"
|
|
421
|
+
},
|
|
422
|
+
"attribute": "variant",
|
|
423
|
+
"reflect": true,
|
|
424
|
+
"defaultValue": "'gray'"
|
|
363
425
|
}
|
|
364
426
|
};
|
|
365
427
|
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--plex-sans, 'IBM Plex Sans', system-ui, sans-serif);
|
|
4
|
+
color: var(--brand-black, #07140D);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Header */
|
|
8
|
+
.lr-header {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: 0.75rem;
|
|
14
|
+
margin-bottom: 1.5rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lr-heading {
|
|
18
|
+
font-family: var(--inter, 'Inter', sans-serif);
|
|
19
|
+
font-weight: 300;
|
|
20
|
+
font-size: 1.75rem;
|
|
21
|
+
line-height: 110%;
|
|
22
|
+
margin: 0;
|
|
23
|
+
color: var(--brand-black, #07140D);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.summary {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Filters */
|
|
32
|
+
.filters {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
35
|
+
gap: 0.75rem;
|
|
36
|
+
margin-bottom: 1.5rem;
|
|
37
|
+
align-items: flex-end;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.filter-search {
|
|
41
|
+
grid-column: span 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.filter-select {
|
|
45
|
+
grid-column: span 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Accordion list */
|
|
49
|
+
.accordion-list {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
gap: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Resources inside accordion */
|
|
56
|
+
.resources-content {
|
|
57
|
+
padding-top: 0.5rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.kg-link {
|
|
61
|
+
margin-bottom: 1rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Resources table */
|
|
65
|
+
.resources-table {
|
|
66
|
+
width: 100%;
|
|
67
|
+
border-collapse: collapse;
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.resources-table thead th {
|
|
72
|
+
text-align: left;
|
|
73
|
+
font-family: var(--plex-sans, 'IBM Plex Sans', system-ui, sans-serif);
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
font-size: 0.75rem;
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
letter-spacing: 0.04em;
|
|
78
|
+
color: var(--grey-dark, #7A7B7A);
|
|
79
|
+
padding: 0.5rem 0.75rem;
|
|
80
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.resource-row {
|
|
84
|
+
transition: background-color 0.2s ease;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.resource-row--clickable {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.resource-row--clickable:hover {
|
|
92
|
+
background-color: rgba(0, 255, 157, 0.04);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.resource-row td {
|
|
96
|
+
padding: 0.625rem 0.75rem;
|
|
97
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
|
|
98
|
+
vertical-align: top;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.resource-row:last-child td {
|
|
102
|
+
border-bottom: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.resource-name {
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
font-size: 1.0625rem;
|
|
108
|
+
color: var(--brand-black, #07140D);
|
|
109
|
+
transition: color 0.2s ease;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.resource-row--clickable:hover .resource-name {
|
|
113
|
+
color: var(--brand-green-dark, #00C87B);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.resource-desc {
|
|
117
|
+
margin: 0.25rem 0 0;
|
|
118
|
+
font-size: 0.9375rem;
|
|
119
|
+
color: var(--grey-dark, #7A7B7A);
|
|
120
|
+
line-height: 145%;
|
|
121
|
+
display: -webkit-box;
|
|
122
|
+
-webkit-line-clamp: 2;
|
|
123
|
+
-webkit-box-orient: vertical;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.col-name {
|
|
128
|
+
width: auto;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.col-type {
|
|
132
|
+
width: 160px;
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.col-level {
|
|
137
|
+
width: 110px;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* States */
|
|
142
|
+
/* eds-spinner renders an absolutely-positioned overlay (top/left/100%×100%)
|
|
143
|
+
that anchors to the nearest positioned ancestor. .loading must therefore
|
|
144
|
+
be `position: relative` and tall enough to host the spinner + message,
|
|
145
|
+
otherwise the overlay escapes upward and centres against the page. */
|
|
146
|
+
.loading {
|
|
147
|
+
position: relative;
|
|
148
|
+
min-height: 8rem;
|
|
149
|
+
padding: 1rem 1.25rem;
|
|
150
|
+
color: var(--grey-dark, #7A7B7A);
|
|
151
|
+
font-size: 0.9375rem;
|
|
152
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
153
|
+
border-radius: 0.25rem;
|
|
154
|
+
background-color: rgba(0, 0, 0, 0.02);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.no-results {
|
|
158
|
+
padding: 2rem;
|
|
159
|
+
text-align: center;
|
|
160
|
+
color: var(--grey-dark, #7A7B7A);
|
|
161
|
+
font-size: 0.875rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Responsive */
|
|
165
|
+
@media (max-width: 750px) {
|
|
166
|
+
.lr-header {
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: flex-start;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.filters {
|
|
172
|
+
grid-template-columns: 1fr;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.filter-search,
|
|
176
|
+
.filter-select {
|
|
177
|
+
grid-column: span 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.col-type,
|
|
181
|
+
.col-level {
|
|
182
|
+
width: auto;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.resources-table thead {
|
|
186
|
+
display: none;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.resource-row {
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-wrap: wrap;
|
|
192
|
+
gap: 0.375rem;
|
|
193
|
+
padding: 0.625rem 0;
|
|
194
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.resource-row td {
|
|
198
|
+
border: none;
|
|
199
|
+
padding: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.col-name {
|
|
203
|
+
width: 100%;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
let cachedData = null;
|
|
3
|
+
let cacheTimestamp = 0;
|
|
4
|
+
const CACHE_TTL = 10 * 60 * 1000;
|
|
5
|
+
export class EdsKgLearningResources {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.apiEndpoint = '/api/v1/kg/learning-resources/cached';
|
|
8
|
+
this.resolveNames = true;
|
|
9
|
+
this.size = 500;
|
|
10
|
+
this.heading = '';
|
|
11
|
+
this.variant = 'inverse';
|
|
12
|
+
this.loading = false;
|
|
13
|
+
this.error = '';
|
|
14
|
+
this.software = [];
|
|
15
|
+
this.meta = null;
|
|
16
|
+
this.filterType = '';
|
|
17
|
+
this.filterLevel = '';
|
|
18
|
+
this.searchQuery = '';
|
|
19
|
+
}
|
|
20
|
+
componentWillLoad() {
|
|
21
|
+
this.fetchData();
|
|
22
|
+
}
|
|
23
|
+
async fetchData() {
|
|
24
|
+
const now = Date.now();
|
|
25
|
+
if (cachedData && now - cacheTimestamp < CACHE_TTL) {
|
|
26
|
+
this.software = cachedData;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.loading = true;
|
|
30
|
+
this.error = '';
|
|
31
|
+
try {
|
|
32
|
+
const params = new URLSearchParams({
|
|
33
|
+
size: this.size.toString(),
|
|
34
|
+
resolve_names: this.resolveNames.toString()
|
|
35
|
+
});
|
|
36
|
+
const response = await fetch(`${this.apiEndpoint}?${params}`);
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
throw new Error(`Failed to fetch: ${response.statusText}`);
|
|
39
|
+
}
|
|
40
|
+
const data = await response.json();
|
|
41
|
+
this.software = data.data || [];
|
|
42
|
+
this.meta = data.meta || null;
|
|
43
|
+
cachedData = this.software;
|
|
44
|
+
cacheTimestamp = now;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
this.error = err instanceof Error ? err.message : 'Failed to load learning resources';
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
this.loading = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
getFilteredSoftware() {
|
|
54
|
+
let filtered = this.software;
|
|
55
|
+
if (this.filterType) {
|
|
56
|
+
filtered = filtered.filter((sw) => sw.learning_resources_types.includes(this.filterType));
|
|
57
|
+
}
|
|
58
|
+
if (this.filterLevel) {
|
|
59
|
+
filtered = filtered.filter((sw) => sw.learning_resources_levels.includes(this.filterLevel));
|
|
60
|
+
}
|
|
61
|
+
if (this.searchQuery) {
|
|
62
|
+
const q = this.searchQuery.toLowerCase();
|
|
63
|
+
filtered = filtered.filter((sw) => sw.name.toLowerCase().includes(q) ||
|
|
64
|
+
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)); }));
|
|
65
|
+
}
|
|
66
|
+
return filtered;
|
|
67
|
+
}
|
|
68
|
+
getFilteredResources(resources) {
|
|
69
|
+
let filtered = resources;
|
|
70
|
+
if (this.filterType) {
|
|
71
|
+
filtered = filtered.filter((lr) => lr.type === this.filterType);
|
|
72
|
+
}
|
|
73
|
+
if (this.filterLevel) {
|
|
74
|
+
filtered = filtered.filter((lr) => lr.educational_level === this.filterLevel);
|
|
75
|
+
}
|
|
76
|
+
return filtered;
|
|
77
|
+
}
|
|
78
|
+
/* TODO: Uncomment when filters are enabled
|
|
79
|
+
private getAllTypes(): string[] {
|
|
80
|
+
const types = new Set<string>();
|
|
81
|
+
this.software.forEach(sw =>
|
|
82
|
+
sw.learning_resources_types.forEach(t => types.add(t))
|
|
83
|
+
);
|
|
84
|
+
return Array.from(types).sort();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private getAllLevels(): string[] {
|
|
88
|
+
const levels = new Set<string>();
|
|
89
|
+
this.software.forEach(sw =>
|
|
90
|
+
sw.learning_resources_levels.forEach(l => levels.add(l))
|
|
91
|
+
);
|
|
92
|
+
return Array.from(levels).sort();
|
|
93
|
+
}
|
|
94
|
+
*/
|
|
95
|
+
getTagIntent(type) {
|
|
96
|
+
const map = {
|
|
97
|
+
'interactive tutorial': 'brand',
|
|
98
|
+
'video tutorial': 'primary',
|
|
99
|
+
'user documentation': 'dark',
|
|
100
|
+
'video presentation': 'inverse',
|
|
101
|
+
'slide deck': 'strong'
|
|
102
|
+
};
|
|
103
|
+
return map[type] || 'brand-dark';
|
|
104
|
+
}
|
|
105
|
+
getLevelTagIntent(level) {
|
|
106
|
+
const map = {
|
|
107
|
+
beginner: 'brand',
|
|
108
|
+
intermediate: 'dark',
|
|
109
|
+
advanced: 'strong'
|
|
110
|
+
};
|
|
111
|
+
return map[level] || 'brand-dark';
|
|
112
|
+
}
|
|
113
|
+
renderAccordionDescription(sw) {
|
|
114
|
+
const count = sw.learning_resources_count;
|
|
115
|
+
const types = sw.learning_resources_types.join(', ');
|
|
116
|
+
return `${count} resource${count !== 1 ? 's' : ''} — ${types}`;
|
|
117
|
+
}
|
|
118
|
+
renderResources(sw) {
|
|
119
|
+
const filtered = this.getFilteredResources(sw.learning_resources);
|
|
120
|
+
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: () => {
|
|
121
|
+
if (lr.iri) {
|
|
122
|
+
window.open(lr.iri, '_blank', 'noopener,noreferrer');
|
|
123
|
+
}
|
|
124
|
+
} }, 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.")));
|
|
125
|
+
}
|
|
126
|
+
render() {
|
|
127
|
+
// Always render the same outer scaffold (header + content area) so the
|
|
128
|
+
// heading sits in identical position across loading / error / loaded
|
|
129
|
+
// states and the spinner appears where the accordion list will render.
|
|
130
|
+
const filtered = !this.loading && !this.error ? this.getFilteredSoftware() : [];
|
|
131
|
+
// const allTypes = this.getAllTypes();
|
|
132
|
+
// const allLevels = this.getAllLevels();
|
|
133
|
+
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.")))));
|
|
134
|
+
}
|
|
135
|
+
static get is() { return "eds-kg-learning-resources"; }
|
|
136
|
+
static get encapsulation() { return "shadow"; }
|
|
137
|
+
static get originalStyleUrls() {
|
|
138
|
+
return {
|
|
139
|
+
"$": ["eds-kg-learning-resources.css"]
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static get styleUrls() {
|
|
143
|
+
return {
|
|
144
|
+
"$": ["eds-kg-learning-resources.css"]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
static get properties() {
|
|
148
|
+
return {
|
|
149
|
+
"apiEndpoint": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "string",
|
|
154
|
+
"resolved": "string",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": "API endpoint for fetching learning resources"
|
|
162
|
+
},
|
|
163
|
+
"attribute": "api-endpoint",
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"defaultValue": "'/api/v1/kg/learning-resources/cached'"
|
|
166
|
+
},
|
|
167
|
+
"resolveNames": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "boolean",
|
|
172
|
+
"resolved": "boolean",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Whether to resolve software names"
|
|
180
|
+
},
|
|
181
|
+
"attribute": "resolve-names",
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"defaultValue": "true"
|
|
184
|
+
},
|
|
185
|
+
"size": {
|
|
186
|
+
"type": "number",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "number",
|
|
190
|
+
"resolved": "number",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": "Max resources to fetch"
|
|
198
|
+
},
|
|
199
|
+
"attribute": "size",
|
|
200
|
+
"reflect": false,
|
|
201
|
+
"defaultValue": "500"
|
|
202
|
+
},
|
|
203
|
+
"heading": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "string",
|
|
208
|
+
"resolved": "string",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": false,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": "Component heading"
|
|
216
|
+
},
|
|
217
|
+
"attribute": "heading",
|
|
218
|
+
"reflect": false,
|
|
219
|
+
"defaultValue": "''"
|
|
220
|
+
},
|
|
221
|
+
"variant": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "'default' | 'inverse'",
|
|
226
|
+
"resolved": "\"default\" | \"inverse\"",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "Visual variant for accordions and cards"
|
|
234
|
+
},
|
|
235
|
+
"attribute": "variant",
|
|
236
|
+
"reflect": false,
|
|
237
|
+
"defaultValue": "'inverse'"
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
static get states() {
|
|
242
|
+
return {
|
|
243
|
+
"loading": {},
|
|
244
|
+
"error": {},
|
|
245
|
+
"software": {},
|
|
246
|
+
"meta": {},
|
|
247
|
+
"filterType": {},
|
|
248
|
+
"filterLevel": {},
|
|
249
|
+
"searchQuery": {}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
static get elementRef() { return "el"; }
|
|
253
|
+
}
|
|
@@ -33,7 +33,7 @@ export class EdsKgWebServicesSelect {
|
|
|
33
33
|
// Check cache first
|
|
34
34
|
const cachedEntry = webServicesCache.get(cacheKey);
|
|
35
35
|
const now = Date.now();
|
|
36
|
-
if (cachedEntry &&
|
|
36
|
+
if (cachedEntry && now - cachedEntry.timestamp < CACHE_DURATION) {
|
|
37
37
|
// Use cached data
|
|
38
38
|
this.webServices = cachedEntry.data;
|
|
39
39
|
}
|
|
@@ -52,7 +52,7 @@ export class EdsKgWebServicesSelect {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
// Format options for eds-input-field: "Localizoom (ebrains-localizoom)"
|
|
55
|
-
this.selectOptions = this.webServices.map(service => ({
|
|
55
|
+
this.selectOptions = this.webServices.map((service) => ({
|
|
56
56
|
label: `${service.name} (${service.short_name})`,
|
|
57
57
|
value: service.short_name
|
|
58
58
|
}));
|
package/dist/collection/shared-ui/eds-kg-web-services-select/eds-kg-web-services-select.stories.js
CHANGED
|
@@ -56,8 +56,7 @@ export default {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
const Template = (args) =>
|
|
60
|
-
return `
|
|
59
|
+
const Template = (args) => `
|
|
61
60
|
<eds-kg-web-services-select
|
|
62
61
|
${args.apiEndpoint ? `api-endpoint="${args.apiEndpoint}"` : ''}
|
|
63
62
|
${args.label ? `label="${args.label}"` : ''}
|
|
@@ -74,7 +73,6 @@ const Template = (args) => {
|
|
|
74
73
|
${args.errorMessage ? `error-message="${args.errorMessage}"` : ''}
|
|
75
74
|
></eds-kg-web-services-select>
|
|
76
75
|
`;
|
|
77
|
-
};
|
|
78
76
|
export const Default = Template.bind({});
|
|
79
77
|
Default.args = {
|
|
80
78
|
apiEndpoint: 'https://forms.ebrains.eu/api/v1/kg/web-services/cached',
|