@ebrains/components 0.3.0-alpha.0 → 0.5.0-alpha.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/analytics-223ea8e5.js +51 -0
- package/dist/cjs/color-c00146a8.js +134 -0
- package/dist/cjs/color-primary-palette_6.cjs.entry.js +14 -14
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/correct-use-of-colors.cjs.entry.js +1 -1
- package/dist/cjs/eds-accordion.cjs.entry.js +11 -20
- package/dist/cjs/{eds-avatar_17.cjs.entry.js → eds-alert_17.cjs.entry.js} +310 -372
- package/dist/cjs/{eds-card-desc_3.cjs.entry.js → eds-avatar_4.cjs.entry.js} +73 -3
- package/dist/cjs/eds-card-generic.cjs.entry.js +4 -5
- package/dist/cjs/eds-card-project.cjs.entry.js +4 -3
- package/dist/cjs/eds-card-section.cjs.entry.js +3 -3
- package/dist/cjs/eds-card-tags.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-tool.cjs.entry.js +3 -4
- package/dist/cjs/eds-card-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/eds-code-block.cjs.entry.js +49 -2
- package/dist/cjs/eds-components-section.cjs.entry.js +7 -3
- package/dist/cjs/eds-docs-palettes.cjs.entry.js +1 -1
- package/dist/cjs/eds-docs-tokens.cjs.entry.js +1 -1
- package/dist/cjs/eds-dropdown_2.cjs.entry.js +158 -0
- package/dist/cjs/eds-form.cjs.entry.js +62 -23
- package/dist/cjs/eds-frame.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-arrow-diagonal.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-arrow-right.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-bluesky.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-down.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-left.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-right.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-up.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-close.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-copy.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-loader.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-mastodon.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-menu.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-more.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-search.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-success.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-twitter.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-user.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-youtube.cjs.entry.js +1 -1
- package/dist/cjs/eds-input_7.cjs.entry.js +18 -10
- package/dist/cjs/eds-login.cjs.entry.js +60 -41
- package/dist/cjs/eds-logo-variations.cjs.entry.js +1 -1
- package/dist/cjs/eds-matomo-notice.cjs.entry.js +2 -3
- package/dist/cjs/eds-modal.cjs.entry.js +49 -38
- package/dist/cjs/eds-navigator.cjs.entry.js +1 -1
- package/dist/cjs/eds-pagination_2.cjs.entry.js +34 -17
- package/dist/cjs/eds-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/eds-section-core_2.cjs.entry.js +3 -3
- package/dist/cjs/eds-svg-repository.cjs.entry.js +1 -1
- package/dist/cjs/eds-tab.cjs.entry.js +1 -1
- package/dist/cjs/eds-tabs-content.cjs.entry.js +4 -4
- package/dist/cjs/eds-tabs.cjs.entry.js +3 -3
- package/dist/cjs/eds-timeline.cjs.entry.js +3 -2
- package/dist/cjs/eds-tooltip.cjs.entry.js +10 -1
- package/dist/cjs/eds-trl.cjs.entry.js +7 -8
- package/dist/cjs/eds-user.cjs.entry.js +99 -0
- package/dist/cjs/eds-vertical-stepper.cjs.entry.js +45 -0
- package/dist/cjs/incorrect-use-of-colors.cjs.entry.js +1 -1
- package/dist/cjs/index-f08e4f5c.js +16 -12
- package/dist/cjs/{keycloak-5aaa21af.js → keycloak-93fc0315.js} +225 -170
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/logo-space.cjs.entry.js +1 -1
- package/dist/cjs/logo-variations-horizontal_2.cjs.entry.js +2 -2
- package/dist/cjs/logo-wrong-usage.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 +1 -1
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/eds-accordion/eds-accordion.js +11 -20
- package/dist/collection/components/eds-alert/eds-alert.js +9 -8
- package/dist/collection/components/eds-alert/eds-alert.stories.js +4 -4
- package/dist/collection/components/eds-avatar/eds-avatar.js +8 -6
- package/dist/collection/components/eds-avatar/eds-avatar.stories.js +24 -22
- package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +23 -28
- package/dist/collection/components/eds-button/eds-button.js +20 -25
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +9 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.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-composer/eds-card-wrapper/eds-card-wrapper.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +15 -9
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.stories.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-project/eds-card-project.js +3 -2
- package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.js +2 -2
- package/dist/collection/components/eds-code-block/eds-code-block.js +58 -3
- package/dist/collection/components/eds-code-block/eds-code-block.stories.js +78 -0
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +11 -21
- package/dist/collection/components/eds-form/eds-form.js +71 -45
- package/dist/collection/components/eds-form/eds-form.stories.js +0 -3
- package/dist/collection/components/eds-frame/eds-frame.js +1 -1
- package/dist/collection/components/eds-frame/eds-frame.stories.js +19 -18
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-down/eds-icon-chevron-down.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-left/eds-icon-chevron-left.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-right/eds-icon-chevron-right.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-up/eds-icon-chevron-up.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-arrow-diagonal/eds-icon-arrow-diagonal.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-arrow-right/eds-icon-arrow-right.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-close/eds-icon-close.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-copy/eds-icon-copy.js +1 -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/eds-icon-loader/eds-icon-loader.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-menu/eds-icon-menu.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-more/eds-icon-more.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-search/eds-icon-search.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-success/eds-icon-success.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-user/eds-icon-user.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 +13 -7
- package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +2 -2
- package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +1 -1
- 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 +2 -2
- 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-select/eds-input-select.js +14 -2
- package/dist/collection/components/eds-input-field/eds-input-field.js +2 -2
- package/dist/collection/components/eds-link/eds-link.js +8 -6
- package/dist/collection/components/eds-logo/eds-logo.js +21 -2
- package/dist/collection/components/eds-modal/eds-modal.css +16 -0
- package/dist/collection/components/eds-modal/eds-modal.js +75 -38
- package/dist/collection/components/eds-modal/eds-modal.stories.js +34 -18
- package/dist/collection/components/eds-navigator/eds-navigator.js +1 -1
- package/dist/collection/components/eds-pagination/eds-pagination.js +13 -9
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +1 -1
- package/dist/collection/components/eds-rating/eds-rating.css +48 -0
- package/dist/collection/components/eds-rating/eds-rating.js +14 -14
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +1 -1
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.stories.js +12 -11
- package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +2 -2
- package/dist/collection/components/eds-steps/eds-steps.css +71 -0
- package/dist/collection/components/eds-steps/eds-steps.js +132 -0
- package/dist/collection/components/eds-steps/eds-steps.stories.js +35 -0
- package/dist/collection/components/eds-steps/eds-vertical-stepper.css +78 -0
- package/dist/collection/components/eds-steps/eds-vertical-stepper.js +72 -0
- package/dist/collection/components/eds-switch/eds-switch.css +59 -0
- package/dist/collection/components/eds-switch/eds-switch.js +131 -0
- package/dist/collection/components/eds-switch/eds-switch.stories.js +38 -0
- package/dist/collection/components/eds-tab/eds-tab.js +1 -1
- package/dist/collection/components/eds-table/eds-table.js +21 -8
- package/dist/collection/components/eds-tag/eds-tag.js +22 -1
- package/dist/collection/components/eds-timeline/eds-timeline.js +3 -2
- package/dist/collection/components/eds-toast/eds-toast.js +22 -1
- package/dist/collection/components/eds-tooltip/eds-tooltip.js +10 -1
- package/dist/collection/components/eds-trl/eds-trl.js +7 -8
- 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/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 +1 -1
- package/dist/collection/eds-docs-ui/eds-components-section/eds-components-section.js +1 -1
- package/dist/collection/eds-docs-ui/eds-docs-palettes/eds-docs-palettes.js +1 -1
- package/dist/collection/eds-docs-ui/eds-docs-tokens/eds-docs-tokens.js +1 -1
- package/dist/collection/eds-docs-ui/eds-logo-variations/eds-logo-variations.js +1 -1
- package/dist/collection/eds-docs-ui/eds-svg-repository/eds-svg-repository.js +1 -1
- package/dist/collection/eds-docs-ui/functional/installation.js +1 -1
- package/dist/collection/eds-docs-ui/functional/react.js +1 -1
- package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.js +1 -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-wrong-usage/logo-wrong-usage.js +1 -1
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +14 -7
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +8 -39
- package/dist/collection/shared-ui/eds-footer/eds-footer.js +1 -1
- package/dist/collection/shared-ui/eds-header/eds-header.js +2 -75
- package/dist/collection/shared-ui/eds-login/eds-login.js +66 -58
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +1 -1
- package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.js +1 -1
- package/dist/collection/shared-ui/eds-tabs/eds-tabs.js +2 -2
- package/dist/collection/shared-ui/eds-tabs-content/eds-tabs-content.js +3 -3
- package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.js +1 -1
- package/dist/collection/shared-ui/eds-user/eds-user.js +27 -24
- package/dist/collection/shared-ui/eds-user-modal/eds-user-modal.js +1 -1
- package/dist/collection/utils/analytics.js +85 -0
- package/dist/collection/utils/color.js +129 -0
- package/dist/collection/utils/global.js +8 -0
- package/dist/collection/utils/keycloak.js +11 -5
- package/dist/components/analytics.js +6 -1
- package/dist/components/color.js +0 -164
- package/dist/components/components.css +63 -0
- package/dist/components/components.esm.js +1 -1
- package/dist/components/correct-use-of-colors.js +1 -1
- package/dist/components/eds-accordion2.js +11 -20
- package/dist/components/eds-alert2.js +9 -8
- package/dist/components/eds-avatar2.js +3 -3
- package/dist/components/eds-block-break2.js +1 -1
- package/dist/components/eds-breadcrumb.js +23 -28
- package/dist/components/eds-button2.js +16 -14
- package/dist/components/eds-card-desc2.js +1 -1
- package/dist/components/eds-card-generic2.js +3 -4
- package/dist/components/eds-card-project.js +2 -2
- package/dist/components/eds-card-section.js +3 -3
- package/dist/components/eds-card-tags.js +1 -1
- package/dist/components/eds-card-title2.js +1 -1
- package/dist/components/eds-card-tool.js +1 -2
- package/dist/components/eds-card-wrapper.js +1 -1
- package/dist/components/eds-code-block2.js +49 -2
- package/dist/components/eds-components-section.js +7 -3
- package/dist/components/eds-docs-palettes.js +1 -1
- package/dist/components/eds-docs-tokens.js +1 -1
- package/dist/components/eds-dropdown2.js +11 -21
- package/dist/components/eds-footer2.js +1 -1
- package/dist/components/eds-form.js +67 -26
- package/dist/components/eds-frame.js +1 -1
- package/dist/components/eds-header.js +10 -48
- package/dist/components/eds-icon-arrow-diagonal.js +1 -1
- package/dist/components/eds-icon-arrow-right.js +1 -1
- package/dist/components/eds-icon-bluesky.js +1 -1
- package/dist/components/eds-icon-chevron-down.js +1 -1
- package/dist/components/eds-icon-chevron-left.js +1 -1
- package/dist/components/eds-icon-chevron-right.js +1 -1
- package/dist/components/eds-icon-chevron-up.js +1 -1
- package/dist/components/eds-icon-close.js +1 -1
- package/dist/components/eds-icon-copy.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-loader.js +1 -1
- package/dist/components/eds-icon-mastodon.js +1 -1
- package/dist/components/eds-icon-menu.js +1 -1
- package/dist/components/eds-icon-more.js +1 -1
- package/dist/components/eds-icon-search.js +1 -1
- package/dist/components/eds-icon-success.js +1 -1
- package/dist/components/eds-icon-twitter.js +1 -1
- package/dist/components/eds-icon-user.js +1 -1
- package/dist/components/eds-icon-youtube.js +1 -1
- package/dist/components/eds-img2.js +9 -4
- package/dist/components/eds-input-field2.js +2 -2
- package/dist/components/eds-input-footer2.js +1 -1
- package/dist/components/eds-input-label2.js +1 -1
- package/dist/components/eds-input-range2.js +2 -2
- package/dist/components/eds-input-search2.js +1 -1
- package/dist/components/eds-input-select2.js +11 -2
- package/dist/components/eds-input2.js +2 -2
- package/dist/components/eds-link2.js +7 -6
- package/dist/components/eds-login.js +60 -41
- package/dist/components/eds-logo-variations.js +1 -1
- package/dist/components/eds-logo2.js +4 -3
- package/dist/components/eds-matomo-notice.js +0 -1
- package/dist/components/eds-modal.js +51 -39
- package/dist/components/eds-navigator.js +1 -1
- package/dist/components/eds-pagination2.js +13 -9
- package/dist/components/eds-progress-bar2.js +1 -1
- package/dist/components/eds-rating.js +25 -13
- package/dist/components/eds-section-core2.js +1 -1
- package/dist/components/eds-section-heading2.js +2 -2
- package/dist/components/eds-social-networks2.js +1 -1
- package/dist/components/eds-steps.d.ts +11 -0
- package/dist/components/eds-steps.js +106 -0
- package/dist/components/eds-svg-repository.js +1 -1
- package/dist/components/eds-switch.d.ts +11 -0
- package/dist/components/eds-switch.js +57 -0
- package/dist/components/eds-tab2.js +1 -1
- package/dist/components/eds-table2.js +21 -8
- package/dist/components/eds-tabs-content.js +2 -3
- package/dist/components/eds-tabs.js +1 -2
- package/dist/components/eds-tag2.js +5 -1
- package/dist/components/eds-timeline.js +3 -2
- package/dist/components/eds-toast-manager.js +1 -1
- package/dist/components/eds-toast2.js +22 -1
- package/dist/components/eds-tooltip.js +10 -1
- package/dist/components/eds-trl.js +7 -8
- package/dist/components/eds-user-modal2.js +1 -1
- package/dist/components/eds-user.js +157 -1
- package/dist/components/eds-vertical-stepper.d.ts +11 -0
- package/dist/components/eds-vertical-stepper.js +86 -0
- package/dist/components/incorrect-use-of-colors.js +1 -1
- package/dist/components/keycloak.js +225 -170
- package/dist/components/logo-space.js +1 -1
- package/dist/components/logo-variations-horizontal2.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-030f67c1.entry.js +1 -0
- package/dist/components/{p-32f282a9.entry.js → p-06299762.entry.js} +1 -1
- package/dist/components/p-0ab85eee.entry.js +1 -0
- package/dist/components/p-0bafc5ae.entry.js +1 -0
- package/dist/components/p-0e0e1815.entry.js +1 -0
- package/dist/components/p-0e7bdd2c.entry.js +1 -0
- package/dist/components/p-1ed3fdb7.entry.js +1 -0
- package/dist/components/p-209fa119.entry.js +1 -0
- package/dist/components/p-2831a9d5.entry.js +1 -0
- package/dist/components/p-2c00bd76.entry.js +1 -0
- package/dist/components/p-38d70586.entry.js +1 -0
- package/dist/components/p-3babd772.entry.js +1 -0
- package/dist/components/p-4a12a131.entry.js +1 -0
- package/dist/components/p-505ddcda.entry.js +1 -0
- package/dist/components/{p-52ac3456.entry.js → p-59405ecf.entry.js} +1 -1
- package/dist/components/p-5980a142.entry.js +1 -0
- package/dist/components/p-599c7b97.entry.js +1 -0
- package/dist/components/{p-22762818.entry.js → p-65703520.entry.js} +1 -1
- package/dist/components/p-6af40c33.entry.js +1 -0
- package/dist/components/p-6df9db15.entry.js +1 -0
- package/dist/components/p-72b42d77.entry.js +1 -0
- package/dist/components/p-75795b05.entry.js +1 -0
- package/dist/components/{p-435a14c1.entry.js → p-759b2640.entry.js} +1 -1
- package/dist/components/p-80a185ba.entry.js +1 -0
- package/dist/components/p-81942665.entry.js +1 -0
- package/dist/components/p-86fbc239.entry.js +1 -0
- package/dist/components/p-89227919.js +1 -0
- package/dist/components/{p-6fc62452.entry.js → p-89f600a3.entry.js} +1 -1
- package/dist/components/{p-2e8459ef.entry.js → p-8b583210.entry.js} +1 -1
- package/dist/components/p-8c4a0fc9.entry.js +1 -0
- package/dist/components/p-8d19a05b.entry.js +1 -0
- package/dist/components/p-8eab748d.js +1 -0
- package/dist/components/p-911d9b37.entry.js +1 -0
- package/dist/components/p-92e16cc9.entry.js +1 -0
- package/dist/components/p-96fe2267.entry.js +1 -0
- package/dist/components/p-9739def5.entry.js +1 -0
- package/dist/components/p-9826acae.entry.js +1 -0
- package/dist/components/{p-87830085.entry.js → p-9b441a1f.entry.js} +1 -1
- package/dist/components/p-a2621d66.entry.js +1 -0
- package/dist/components/p-a535838c.entry.js +1 -0
- package/dist/components/p-a5b7d72d.entry.js +1 -0
- package/dist/components/p-a5d00633.entry.js +1 -0
- package/dist/components/p-a63bd0c9.entry.js +1 -0
- package/dist/components/{p-762c8c83.entry.js → p-a846dbca.entry.js} +1 -1
- package/dist/components/p-a927a455.entry.js +1 -0
- package/dist/components/p-aec9b8e1.entry.js +1 -0
- package/dist/components/{p-e6bfbf51.entry.js → p-b1af5000.entry.js} +2 -2
- package/dist/components/{p-d571d530.entry.js → p-b1de9a6c.entry.js} +1 -1
- package/dist/components/{p-0910d733.entry.js → p-b3c1aef5.entry.js} +1 -1
- package/dist/components/p-b60ed774.entry.js +1 -0
- package/dist/components/p-b67aafe7.entry.js +1 -0
- package/dist/components/p-b79999d5.entry.js +1 -0
- package/dist/components/{p-02e2a62f.entry.js → p-b80457ed.entry.js} +1 -1
- package/dist/components/p-b860b4aa.entry.js +1 -0
- package/dist/components/p-c034c395.entry.js +1 -0
- package/dist/components/p-c5fa170d.entry.js +1 -0
- package/dist/components/p-d69ef196.entry.js +1 -0
- package/dist/components/p-de12396f.entry.js +1 -0
- package/dist/components/p-de2fbcfc.entry.js +1 -0
- package/dist/components/p-def72462.entry.js +1 -0
- package/dist/components/p-e2c250c5.entry.js +1 -0
- package/dist/components/p-eb0b93d5.js +1 -0
- package/dist/components/p-eeeb0d83.entry.js +1 -0
- package/dist/components/p-f08eac56.entry.js +1 -0
- package/dist/components/p-f1cd83da.entry.js +1 -0
- package/dist/components/{p-22e6d7d5.entry.js → p-f36f2aeb.entry.js} +1 -1
- package/dist/components/p-f5dafbc8.entry.js +1 -0
- package/dist/components/p-f7493f41.entry.js +1 -0
- package/dist/components/p-fce25541.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/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 +1 -1
- package/dist/esm/analytics-1cde8e4a.js +48 -0
- package/dist/esm/color-2554aad6.js +132 -0
- package/dist/esm/color-primary-palette_6.entry.js +14 -14
- package/dist/esm/components.js +1 -1
- package/dist/esm/correct-use-of-colors.entry.js +1 -1
- package/dist/esm/eds-accordion.entry.js +11 -20
- package/dist/esm/{eds-avatar_17.entry.js → eds-alert_17.entry.js} +304 -366
- package/dist/esm/{eds-card-desc_3.entry.js → eds-avatar_4.entry.js} +73 -4
- package/dist/esm/eds-card-generic.entry.js +3 -4
- package/dist/esm/eds-card-project.entry.js +3 -2
- package/dist/esm/eds-card-section.entry.js +3 -3
- package/dist/esm/eds-card-tags.entry.js +1 -1
- package/dist/esm/eds-card-tool.entry.js +2 -3
- package/dist/esm/eds-card-wrapper.entry.js +1 -1
- package/dist/esm/eds-code-block.entry.js +50 -3
- package/dist/esm/eds-components-section.entry.js +7 -3
- package/dist/esm/eds-docs-palettes.entry.js +1 -1
- package/dist/esm/eds-docs-tokens.entry.js +1 -1
- package/dist/esm/eds-dropdown_2.entry.js +153 -0
- package/dist/esm/eds-form.entry.js +62 -23
- package/dist/esm/eds-frame.entry.js +1 -1
- package/dist/esm/eds-icon-arrow-diagonal.entry.js +1 -1
- package/dist/esm/eds-icon-arrow-right.entry.js +1 -1
- package/dist/esm/eds-icon-bluesky.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-down.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-left.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-right.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-up.entry.js +1 -1
- package/dist/esm/eds-icon-close.entry.js +1 -1
- package/dist/esm/eds-icon-copy.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-loader.entry.js +1 -1
- package/dist/esm/eds-icon-mastodon.entry.js +1 -1
- package/dist/esm/eds-icon-menu.entry.js +1 -1
- package/dist/esm/eds-icon-more.entry.js +1 -1
- package/dist/esm/eds-icon-search.entry.js +1 -1
- package/dist/esm/eds-icon-success.entry.js +1 -1
- package/dist/esm/eds-icon-twitter.entry.js +1 -1
- package/dist/esm/eds-icon-user.entry.js +1 -1
- package/dist/esm/eds-icon-youtube.entry.js +1 -1
- package/dist/esm/eds-input_7.entry.js +18 -10
- package/dist/esm/eds-login.entry.js +60 -41
- package/dist/esm/eds-logo-variations.entry.js +1 -1
- package/dist/esm/eds-matomo-notice.entry.js +1 -2
- package/dist/esm/eds-modal.entry.js +49 -38
- package/dist/esm/eds-navigator.entry.js +1 -1
- package/dist/esm/eds-pagination_2.entry.js +34 -17
- package/dist/esm/eds-progress-bar.entry.js +1 -1
- package/dist/esm/eds-section-core_2.entry.js +3 -3
- package/dist/esm/eds-svg-repository.entry.js +1 -1
- package/dist/esm/eds-tab.entry.js +1 -1
- package/dist/esm/eds-tabs-content.entry.js +3 -3
- package/dist/esm/eds-tabs.entry.js +2 -2
- package/dist/esm/eds-timeline.entry.js +3 -2
- package/dist/esm/eds-tooltip.entry.js +10 -1
- package/dist/esm/eds-trl.entry.js +7 -8
- package/dist/esm/eds-user.entry.js +95 -0
- package/dist/esm/eds-vertical-stepper.entry.js +41 -0
- package/dist/esm/incorrect-use-of-colors.entry.js +1 -1
- package/dist/esm/index-e96badea.js +16 -12
- package/dist/esm/{keycloak-13893af6.js → keycloak-d502ec16.js} +225 -170
- package/dist/esm/loader.js +1 -1
- package/dist/esm/logo-space.entry.js +1 -1
- package/dist/esm/logo-variations-horizontal_2.entry.js +2 -2
- package/dist/esm/logo-wrong-usage.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 +1 -1
- package/dist/hydrate/index.js +992 -763
- package/dist/hydrate/index.mjs +992 -763
- package/dist/types/components/eds-accordion/eds-accordion.d.ts +5 -12
- package/dist/types/components/eds-alert/eds-alert.d.ts +1 -1
- package/dist/types/components/eds-avatar/eds-avatar.stories.d.ts +0 -18
- package/dist/types/components/eds-breadcrump/eds-breadcrump.d.ts +9 -8
- package/dist/types/components/eds-button/eds-button.d.ts +2 -3
- package/dist/types/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.d.ts +8 -0
- package/dist/types/components/eds-cards/eds-card-generic/eds-card-generic.d.ts +6 -2
- package/dist/types/components/eds-code-block/eds-code-block.d.ts +43 -3
- package/dist/types/components/eds-code-block/eds-code-block.stories.d.ts +54 -0
- package/dist/types/components/eds-dropdown/eds-dropdown.d.ts +0 -7
- package/dist/types/components/eds-form/eds-form.d.ts +3 -7
- package/dist/types/components/eds-form/eds-form.stories.d.ts +0 -5
- package/dist/types/components/eds-frame/eds-frame.stories.d.ts +0 -2
- package/dist/types/components/eds-img/eds-img.d.ts +3 -1
- package/dist/types/components/eds-input-elements/eds-input-select/eds-input-select.d.ts +9 -0
- package/dist/types/components/eds-link/eds-link.d.ts +1 -1
- package/dist/types/components/eds-logo/eds-logo.d.ts +1 -0
- package/dist/types/components/eds-modal/eds-modal.d.ts +20 -10
- package/dist/types/components/eds-modal/eds-modal.stories.d.ts +9 -0
- package/dist/types/components/eds-rating/eds-rating.d.ts +4 -7
- package/dist/types/components/eds-section/eds-section-core/eds-section-core.stories.d.ts +0 -1
- package/dist/types/components/eds-steps/eds-steps.d.ts +39 -0
- package/dist/types/components/eds-steps/eds-steps.stories.d.ts +34 -0
- package/dist/types/components/eds-steps/eds-vertical-stepper.d.ts +22 -0
- package/dist/types/components/eds-switch/eds-switch.d.ts +25 -0
- package/dist/types/components/eds-switch/eds-switch.stories.d.ts +32 -0
- package/dist/types/components/eds-table/eds-table.d.ts +5 -5
- package/dist/types/components/eds-tag/eds-tag.d.ts +5 -0
- package/dist/types/components/eds-toast/eds-toast.d.ts +9 -0
- package/dist/types/components.d.ts +227 -164
- package/dist/types/shared-ui/eds-card-section/eds-card-section.d.ts +28 -6
- package/dist/types/shared-ui/eds-card-section/eds-card-section.stories.d.ts +42 -21
- package/dist/types/shared-ui/eds-header/eds-header.d.ts +0 -20
- package/dist/types/shared-ui/eds-login/eds-login.d.ts +21 -18
- package/dist/types/shared-ui/eds-user/eds-user.d.ts +5 -5
- package/dist/types/utils/global.d.ts +1 -0
- package/dist/types/utils/keycloak.d.ts +2 -2
- package/package.json +1 -1
- package/dist/cjs/color-3ffe3072.js +0 -342
- package/dist/cjs/eds-alert.cjs.entry.js +0 -96
- package/dist/cjs/eds-rating.cjs.entry.js +0 -58
- package/dist/components/eds-user2.js +0 -156
- package/dist/components/p-005de86f.entry.js +0 -1
- package/dist/components/p-0c2e844e.entry.js +0 -1
- package/dist/components/p-145f13ad.entry.js +0 -1
- package/dist/components/p-16458a81.entry.js +0 -1
- package/dist/components/p-2851ff44.entry.js +0 -1
- package/dist/components/p-29648b47.entry.js +0 -1
- package/dist/components/p-297b2bc3.entry.js +0 -1
- package/dist/components/p-32cddd94.entry.js +0 -1
- package/dist/components/p-3617841d.entry.js +0 -1
- package/dist/components/p-373673ca.js +0 -1
- package/dist/components/p-388b4966.entry.js +0 -1
- package/dist/components/p-3ff76976.entry.js +0 -1
- package/dist/components/p-4037ad48.entry.js +0 -1
- package/dist/components/p-42b4ecff.entry.js +0 -1
- package/dist/components/p-490ba155.entry.js +0 -1
- package/dist/components/p-4932aab2.entry.js +0 -1
- package/dist/components/p-4a24c2ce.entry.js +0 -1
- package/dist/components/p-54c75346.entry.js +0 -1
- package/dist/components/p-57c964c5.entry.js +0 -1
- package/dist/components/p-5a43503a.entry.js +0 -1
- package/dist/components/p-5aad9d3f.entry.js +0 -1
- package/dist/components/p-5afb626c.entry.js +0 -1
- package/dist/components/p-5d7af761.entry.js +0 -1
- package/dist/components/p-5fc68438.entry.js +0 -1
- package/dist/components/p-6378fb3e.entry.js +0 -1
- package/dist/components/p-673dce11.entry.js +0 -1
- package/dist/components/p-7215789a.entry.js +0 -1
- package/dist/components/p-73bd0c97.entry.js +0 -1
- package/dist/components/p-7802e966.entry.js +0 -1
- package/dist/components/p-79887c2c.entry.js +0 -1
- package/dist/components/p-846fc91c.entry.js +0 -1
- package/dist/components/p-84957b6d.entry.js +0 -1
- package/dist/components/p-8c56e39a.entry.js +0 -1
- package/dist/components/p-96c4deda.entry.js +0 -1
- package/dist/components/p-a44a1abe.entry.js +0 -1
- package/dist/components/p-a4e9b68b.entry.js +0 -1
- package/dist/components/p-ac0112d5.entry.js +0 -1
- package/dist/components/p-acb16e1c.entry.js +0 -1
- package/dist/components/p-ae5dbd41.entry.js +0 -1
- package/dist/components/p-bdd86a3c.entry.js +0 -1
- package/dist/components/p-be6c80da.entry.js +0 -1
- package/dist/components/p-bf0f851d.entry.js +0 -1
- package/dist/components/p-c2d369bc.entry.js +0 -1
- package/dist/components/p-c9c417de.js +0 -1
- package/dist/components/p-d1670eec.entry.js +0 -1
- package/dist/components/p-d1f6a722.entry.js +0 -1
- package/dist/components/p-d53b7a75.entry.js +0 -1
- package/dist/components/p-d6d86366.entry.js +0 -1
- package/dist/components/p-d7a92efb.entry.js +0 -1
- package/dist/components/p-d9788b54.entry.js +0 -1
- package/dist/components/p-e20ed2c7.entry.js +0 -1
- package/dist/components/p-e74834bc.entry.js +0 -1
- package/dist/components/p-f7a6ce69.entry.js +0 -1
- package/dist/components/p-fd27e56c.entry.js +0 -1
- package/dist/esm/color-0ba8ed56.js +0 -338
- package/dist/esm/eds-alert.entry.js +0 -92
- package/dist/esm/eds-rating.entry.js +0 -54
- package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/index.d.ts +0 -3
- package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib/keycloak.d.ts +0 -30
- package/dist/types/Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib/render.d.ts +0 -8
- /package/dist/types/{Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib → utils}/analytics.d.ts +0 -0
- /package/dist/types/{Users/nigeor/Documents/Projects/EBRAINS/ebrains-ui-ecosystem/packages/components/.stencil/packages/utils/src/lib → utils}/color.d.ts +0 -0
|
@@ -1,72 +1,83 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
* `EdsLogin` is a login component that integrates Keycloak authentication,
|
|
5
|
-
* allowing users to log in and out and manage authentication states.
|
|
6
|
-
* This component is used to handle user login, logout, and authentication status display.
|
|
7
|
-
*
|
|
8
|
-
* This component is ideal for applications that require Keycloak-based authentication,
|
|
9
|
-
* providing a simple login/logout interface and managing user session states.
|
|
10
|
-
*/
|
|
2
|
+
import { login, logout, isAuthenticated, getUser, initKeycloak } from "../../utils/keycloak";
|
|
3
|
+
import { toast } from "../../utils/toastManager";
|
|
11
4
|
export class EdsLogin {
|
|
12
5
|
constructor() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Handles user login by invoking the Keycloak `login` function.
|
|
8
|
+
* Only triggers login if the user is not already authenticated.
|
|
9
|
+
*/
|
|
10
|
+
this.handleLogin = async () => {
|
|
11
|
+
if (!this.authenticated) {
|
|
12
|
+
try {
|
|
13
|
+
await login();
|
|
14
|
+
toast.show('You are authenticated', 'success');
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
toast.show(error.message, 'error');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Handles user logout by invoking the Keycloak `logout` function.
|
|
23
|
+
* Resets the `authenticated` state to `false` after logout.
|
|
24
|
+
*/
|
|
25
|
+
this.handleLogout = async () => {
|
|
26
|
+
try {
|
|
27
|
+
await logout();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
toast.show(error.message, 'error');
|
|
31
|
+
}
|
|
32
|
+
this.authenticated = false;
|
|
33
|
+
this.user = null;
|
|
17
34
|
};
|
|
18
|
-
this.keycloakUrl =
|
|
19
|
-
this.keycloakRealm =
|
|
20
|
-
this.keycloakClientId =
|
|
35
|
+
this.keycloakUrl = undefined;
|
|
36
|
+
this.keycloakRealm = undefined;
|
|
37
|
+
this.keycloakClientId = undefined;
|
|
21
38
|
this.authenticated = false;
|
|
22
39
|
this.user = null;
|
|
23
40
|
}
|
|
24
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Lifecycle method that runs when the component is about to load.
|
|
43
|
+
* It initializes authentication by calling the `initAuth` method.
|
|
44
|
+
*/
|
|
25
45
|
async componentWillLoad() {
|
|
26
|
-
|
|
46
|
+
// Check if required props are provided (optional check)
|
|
47
|
+
if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
|
|
48
|
+
// eslint-disable-next-line
|
|
49
|
+
console.error('Keycloak configuration props are missing.');
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await this.initAuth();
|
|
27
53
|
}
|
|
28
|
-
|
|
29
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Initializes the Keycloak authentication by configuring Keycloak with the provided props.
|
|
56
|
+
* Sets the `authenticated` state and `user` data if the user is authenticated.
|
|
57
|
+
* Emits `authStatusChanged` event with the authentication status.
|
|
58
|
+
*/
|
|
59
|
+
async initAuth() {
|
|
30
60
|
try {
|
|
31
|
-
|
|
61
|
+
await initKeycloak({
|
|
32
62
|
url: this.keycloakUrl,
|
|
33
63
|
realm: this.keycloakRealm,
|
|
34
64
|
clientId: this.keycloakClientId
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line
|
|
38
|
-
// Set authentication state and fetch user data if authenticated
|
|
39
|
-
this.authenticated = isAuthenticated();
|
|
40
|
-
if (this.authenticated) {
|
|
65
|
+
}, true);
|
|
66
|
+
if (isAuthenticated()) {
|
|
41
67
|
this.user = getUser();
|
|
68
|
+
this.authenticated = true;
|
|
69
|
+
this.authStatusChanged.emit({
|
|
70
|
+
authenticated: this.authenticated,
|
|
71
|
+
user: this.user
|
|
72
|
+
}); // Emit auth status change
|
|
42
73
|
}
|
|
43
|
-
this.authStatusChanged.emit({
|
|
44
|
-
authenticated: this.authenticated,
|
|
45
|
-
user: this.user
|
|
46
|
-
}); // Emit auth status change
|
|
47
74
|
}
|
|
48
75
|
catch (error) {
|
|
49
|
-
|
|
50
|
-
console.error('Keycloak initialization or login check failed:', error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Method to handle user login
|
|
54
|
-
async handleLogin() {
|
|
55
|
-
try {
|
|
56
|
-
if (!this.authenticated) {
|
|
57
|
-
login(); // Start the Keycloak login process
|
|
58
|
-
}
|
|
76
|
+
toast.show(error.message, 'error');
|
|
59
77
|
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
// eslint-disable-next-line
|
|
62
|
-
console.error('Login failed:', error);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
getBtnLabel() {
|
|
66
|
-
return this.authenticated ? 'Logout' : 'Login';
|
|
67
78
|
}
|
|
68
79
|
render() {
|
|
69
|
-
return (h("eds-button", { key: '
|
|
80
|
+
return (h("div", { key: 'cd30a135920ae77959330a43a8544bb9c231986e', class: "block" }, !this.authenticated && (h("eds-button", { key: '98fa63c46b063a67c215ff9160c6dfbfee2265f7', label: "Login", intent: "primary", "extra-class": "text-default", "aria-label": "Login", triggerClick: this.handleLogin.bind(this) }))));
|
|
70
81
|
}
|
|
71
82
|
static get is() { return "eds-login"; }
|
|
72
83
|
static get encapsulation() { return "shadow"; }
|
|
@@ -84,11 +95,10 @@ export class EdsLogin {
|
|
|
84
95
|
"optional": false,
|
|
85
96
|
"docs": {
|
|
86
97
|
"tags": [],
|
|
87
|
-
"text": "The URL of the Keycloak server.\nThis is the base URL where your Keycloak instance is hosted
|
|
98
|
+
"text": "The URL of the Keycloak server.\nThis is the base URL where your Keycloak instance is hosted."
|
|
88
99
|
},
|
|
89
100
|
"attribute": "keycloak-url",
|
|
90
|
-
"reflect": false
|
|
91
|
-
"defaultValue": "''"
|
|
101
|
+
"reflect": false
|
|
92
102
|
},
|
|
93
103
|
"keycloakRealm": {
|
|
94
104
|
"type": "string",
|
|
@@ -105,8 +115,7 @@ export class EdsLogin {
|
|
|
105
115
|
"text": "The Keycloak Realm.\nA realm in Keycloak is a space where you manage a set of users, roles,\ngroups, and credentials."
|
|
106
116
|
},
|
|
107
117
|
"attribute": "keycloak-realm",
|
|
108
|
-
"reflect": false
|
|
109
|
-
"defaultValue": "''"
|
|
118
|
+
"reflect": false
|
|
110
119
|
},
|
|
111
120
|
"keycloakClientId": {
|
|
112
121
|
"type": "string",
|
|
@@ -123,8 +132,7 @@ export class EdsLogin {
|
|
|
123
132
|
"text": "The Keycloak Client ID.\nThe client ID represents the client application that Keycloak protects.\nIt's configured in the Keycloak admin console and used to identify the app\nrequesting authentication.\nExample: `my-client-app`"
|
|
124
133
|
},
|
|
125
134
|
"attribute": "keycloak-client-id",
|
|
126
|
-
"reflect": false
|
|
127
|
-
"defaultValue": "''"
|
|
135
|
+
"reflect": false
|
|
128
136
|
}
|
|
129
137
|
};
|
|
130
138
|
}
|
|
@@ -143,10 +151,10 @@ export class EdsLogin {
|
|
|
143
151
|
"composed": true,
|
|
144
152
|
"docs": {
|
|
145
153
|
"tags": [],
|
|
146
|
-
"text": "Event emitted when the authentication status changes
|
|
154
|
+
"text": "Event emitted when the authentication status changes."
|
|
147
155
|
},
|
|
148
156
|
"complexType": {
|
|
149
|
-
"original": "{
|
|
157
|
+
"original": "{ authenticated: boolean; user: any }",
|
|
150
158
|
"resolved": "{ authenticated: boolean; user: any; }",
|
|
151
159
|
"references": {}
|
|
152
160
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { toast } from "../../utils/toastManager";
|
|
3
|
-
import { matomoOptIn } from "
|
|
3
|
+
import { matomoOptIn } from "../../utils/analytics";
|
|
4
4
|
/**
|
|
5
5
|
* A Stencil component for displaying a Matomo analytics consent notice.
|
|
6
6
|
* Provides users with the option to opt in or opt out of anonymous analytics.
|
|
@@ -53,7 +53,7 @@ export class EdsSocialNetworks {
|
|
|
53
53
|
* @returns {JSX.Element} The rendered JSX for the component.
|
|
54
54
|
*/
|
|
55
55
|
render() {
|
|
56
|
-
return (h("div", { key: '
|
|
56
|
+
return (h("div", { key: '615a7cb2c26060d2d4cde875291a081b7de12e19' }, h("p", { key: '9e19ad59fcc94508cb60cd4aafa87c3878fb2ebc', class: "f-ui-02" }, this.title), h("ul", { key: 'a4811d16447ab148a7c129f188405f3f7050df70', class: "mt-12 flex gap-4" }, this.socialNetworks.map((network, index) => (h("li", { key: index }, h("eds-link", { "extra-class": "effect-color effect-focus text-lighter hover:text-default flex items-center justify-center rounded-sm", external: true, "aria-label": network.label, url: network.url, icon: network.icon, intent: "strong" })))))));
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "eds-social-networks"; }
|
|
59
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sendAnalytics } from "
|
|
1
|
+
import { sendAnalytics } from "../../utils/analytics";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
/**
|
|
@@ -127,7 +127,7 @@ export class EdsTabs {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
render() {
|
|
130
|
-
return (h("div", { key: '
|
|
130
|
+
return (h("div", { key: 'f5c9e076fc1fb95b57e0148d85865ce62c14fbe7', id: `${this.id}`, class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']" }, h("div", { key: '7d382167fb62999e39b784ce8bfba24267c87a64', class: "scroller-x overflow-x-auto max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28" }, h("nav", { key: '99bbfabd817bada1984ddf87a274bf9304a1e6a0', ref: (el) => (this.tabContainer = el), class: "inline-flex", "aria-label": this.navAriaLabel }, this.parsedTabs.map((tab, index) => {
|
|
131
131
|
//const TabComponent = tab.active ? 'span' : 'a';
|
|
132
132
|
const tabProps = this.getTabOptions(tab.active, index);
|
|
133
133
|
return (h("eds-tab", Object.assign({}, tabProps, { label: tab.label || tab.ariaLabel, url: tab.url, active: index === this.activeIndex, onClick: () => this.handleTabClick(index, tab.label) })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sendAnalytics } from "
|
|
1
|
+
import { sendAnalytics } from "../../utils/analytics";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
/**
|
|
@@ -114,11 +114,11 @@ export class EdsTabsContent {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
return (h("div", { key: '
|
|
117
|
+
return (h("div", { key: 'aa94a55d3ae658797df6ae75724238a17a80a169', class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']" }, h("div", { key: '0e38c695467c272198a605efdb2705b14239756e', class: "scroller-x max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28" }, h("nav", { key: '525f56d02b41e236d3b713fb972b6803e3f908d5', ref: (el) => (this.tabContainer = el), class: "inline-flex", "aria-label": this.navAriaLabel }, this.parsedTabs.map((tab, index) => {
|
|
118
118
|
//const TabComponent = tab.active ? 'span' : 'a';
|
|
119
119
|
const tabProps = this.getTabOptions(tab.active, index);
|
|
120
120
|
return (h("eds-tab", Object.assign({}, tabProps, { label: tab.label, url: tab.url, active: index === this.activeIndex, ariaLabel: tab.ariaLabel, onClick: () => this.handleTabClick(index, tab.label) })));
|
|
121
|
-
})), h("slot", { key: '
|
|
121
|
+
})), h("slot", { key: 'e5da088cec99dd0e40560b70fbd9940ac5a7f56f' }))));
|
|
122
122
|
}
|
|
123
123
|
static get is() { return "eds-tabs-content"; }
|
|
124
124
|
static get properties() {
|
|
@@ -28,7 +28,7 @@ export class EdsToastManager {
|
|
|
28
28
|
this.toasts = this.toasts.filter((t) => t.id !== id);
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h("div", { key: '
|
|
31
|
+
return (h("div", { key: '22cb79fd617ca1701fba63d3d4bf04f73ce1ac77', class: "toast-container" }, this.toasts.map((t) => (h("div", { key: t.id }, h("eds-toast", { message: t.message, intent: t.intent, onClick: () => this.removeToast(t.id) }))))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "eds-toast-manager"; }
|
|
34
34
|
static get originalStyleUrls() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { isAuthenticated, getUser, login, logout, checkServerAvailability, initKeycloak } from "../../utils/keycloak";
|
|
3
|
+
import { toast } from "../../utils/toastManager";
|
|
3
4
|
/**
|
|
4
5
|
* `EdsUser` is a user authentication component for managing and displaying
|
|
5
6
|
* the user's authentication state using Keycloak. It provides login and logout
|
|
@@ -16,15 +17,25 @@ export class EdsUser {
|
|
|
16
17
|
*/
|
|
17
18
|
this.handleLogin = () => {
|
|
18
19
|
if (!this.authenticated) {
|
|
19
|
-
|
|
20
|
+
try {
|
|
21
|
+
login();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
toast.show(error.message, 'error');
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
};
|
|
22
28
|
/**
|
|
23
29
|
* Handles user logout by invoking the Keycloak `logout` function.
|
|
24
30
|
* Resets the `authenticated` state to `false` after logout.
|
|
25
31
|
*/
|
|
26
|
-
this.handleLogout = () => {
|
|
27
|
-
|
|
32
|
+
this.handleLogout = async () => {
|
|
33
|
+
try {
|
|
34
|
+
await logout();
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
toast.show(error.message, 'error');
|
|
38
|
+
}
|
|
28
39
|
this.authenticated = false;
|
|
29
40
|
this.user = null;
|
|
30
41
|
};
|
|
@@ -33,8 +44,8 @@ export class EdsUser {
|
|
|
33
44
|
this.keycloakClientId = undefined;
|
|
34
45
|
this.user = null;
|
|
35
46
|
this.authenticated = false;
|
|
36
|
-
this.serverAvailable = false;
|
|
37
47
|
this.username = '';
|
|
48
|
+
this.serverAvailable = false;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
51
|
* Lifecycle method that runs when the component is about to load.
|
|
@@ -49,7 +60,7 @@ export class EdsUser {
|
|
|
49
60
|
}
|
|
50
61
|
this.serverAvailable = await checkServerAvailability(`${this.keycloakUrl}/realms/${this.keycloakRealm}`);
|
|
51
62
|
if (!this.serverAvailable) {
|
|
52
|
-
|
|
63
|
+
toast.show('Keycloak server is unavailable.', 'error');
|
|
53
64
|
return; // Do not proceed further
|
|
54
65
|
}
|
|
55
66
|
await this.initAuth();
|
|
@@ -61,35 +72,27 @@ export class EdsUser {
|
|
|
61
72
|
*/
|
|
62
73
|
async initAuth() {
|
|
63
74
|
try {
|
|
64
|
-
|
|
75
|
+
await initKeycloak({
|
|
65
76
|
url: this.keycloakUrl,
|
|
66
77
|
realm: this.keycloakRealm,
|
|
67
78
|
clientId: this.keycloakClientId
|
|
68
|
-
};
|
|
69
|
-
await initKeycloak(keycloakConfig, true);
|
|
70
|
-
// Set authentication state and fetch user data if authenticated
|
|
71
|
-
//this.authenticated = isAuthenticated();
|
|
79
|
+
}, true);
|
|
72
80
|
if (isAuthenticated()) {
|
|
73
81
|
this.user = getUser();
|
|
74
82
|
this.authenticated = true;
|
|
83
|
+
this.authStatusChanged.emit({
|
|
84
|
+
authenticated: this.authenticated,
|
|
85
|
+
user: this.user
|
|
86
|
+
}); // Emit auth status change
|
|
75
87
|
}
|
|
76
|
-
this.authStatusChanged.emit({
|
|
77
|
-
authenticated: this.authenticated,
|
|
78
|
-
user: this.user
|
|
79
|
-
}); // Emit auth status change
|
|
80
88
|
}
|
|
81
89
|
catch (error) {
|
|
82
|
-
|
|
83
|
-
console.error('Keycloak initialization failed:', error);
|
|
90
|
+
toast.show(error.message, 'error');
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
render() {
|
|
87
94
|
var _a;
|
|
88
|
-
|
|
89
|
-
if (!this.serverAvailable) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return (h("div", { class: "block" }, !this.authenticated ? (h("eds-button", { label: "Login", intent: "primary", onClick: this.handleLogin, "extra-class": "text-default" })) : (h("div", { class: "flex items-center" }, h("eds-dropdown", { label: `Welcome, ${(_a = this.user) === null || _a === void 0 ? void 0 : _a.username}`, intent: "tertiary", "aria-label": "User Menu", "dropdown-pos": "right", "dropdown-offset": "false", icon: "chevron-down", class: "text-default" }, h("eds-user-modal", { user: JSON.stringify(this.user), onLogout: this.handleLogout.bind(this) }))))));
|
|
95
|
+
return (h("div", { key: '22ee744979511dd2f8a1e1a15bb99215eadd535b', class: "block" }, !this.authenticated ? (h("eds-button", { label: "Login", intent: "primary", onClick: this.handleLogin, "extra-class": "text-default" })) : (h("div", { class: "flex items-center" }, h("eds-dropdown", { label: `Welcome, ${(_a = this.user) === null || _a === void 0 ? void 0 : _a.username}`, intent: "tertiary", "aria-label": "User Menu", "dropdown-pos": "right", "dropdown-offset": "false", icon: "chevron-down", class: "text-default" }, h("eds-user-modal", { user: JSON.stringify(this.user), onLogout: this.handleLogout.bind(this) }))))));
|
|
93
96
|
}
|
|
94
97
|
static get is() { return "eds-user"; }
|
|
95
98
|
static get properties() {
|
|
@@ -151,8 +154,8 @@ export class EdsUser {
|
|
|
151
154
|
return {
|
|
152
155
|
"user": {},
|
|
153
156
|
"authenticated": {},
|
|
154
|
-
"
|
|
155
|
-
"
|
|
157
|
+
"username": {},
|
|
158
|
+
"serverAvailable": {}
|
|
156
159
|
};
|
|
157
160
|
}
|
|
158
161
|
static get events() {
|
|
@@ -30,7 +30,7 @@ export class EdsUserModal {
|
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
32
|
var _a, _b, _c, _d, _e;
|
|
33
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '4a80335b6a59b9653130ca75a6e42c04fce68f4f', class: "min-w-[280px] p-8" }, h("div", { key: '9c97f6be46216587692d4852174cecfaacb70593', class: "flex gap-x-16 pb-16 border-b-2 border-softer" }, h("eds-avatar", { key: 'c778f6bdfb21068ca7c2deff6e298f61af6dbc67', "first-name": (_a = this.parsedUser) === null || _a === void 0 ? void 0 : _a.firstname, "last-name": (_b = this.parsedUser) === null || _b === void 0 ? void 0 : _b.lastname, initials: this.initials, color: "grey", rounded: true, "initials-strong": true }), h("div", { key: '7f453546c9cc54597069abb3e4b50312fe7bf364', class: "max-w-full" }, ((_c = this.parsedUser) === null || _c === void 0 ? void 0 : _c.fullname) && (h("p", { key: '34e080ef159535820c09378701de0e6f4fd96009', class: "f-ui-01 text-default w-full text-ellipsis" }, this.parsedUser.fullname)), ((_d = this.parsedUser) === null || _d === void 0 ? void 0 : _d.username) && h("p", { key: '2f85764e7d015dc3f3b22ca8a07126f8f57216ef', class: "f-ui-03-light text-light mt-4" }, this.parsedUser.username), ((_e = this.parsedUser) === null || _e === void 0 ? void 0 : _e.email) && h("p", { key: '002dec51e979c29f2343f55e004449e4cee4075c', class: "f-ui-03-light text-light mt-4" }, this.parsedUser.email))), h("div", { key: '740b78c504257fb755ba7ba04dd25f023d37ed33', class: "text-default mt-16 flex w-full flex-col gap-y-8" }, h("div", { key: 'ac307937bdd3fc86cce502e5eeb3e922d931f418', class: "border-softer mb-10 border-b-2 pb-16" }, h("eds-link", { key: 'bdd0f1ef62ac78ffb1b40ed6873475df360cec66', label: "My EBRAINS", "aria-label": "My EBRAINS", url: "https://www.ebrains.eu/dashboard", intent: "primary", "extra-class": "w-full", external: true })), h("eds-link", { key: 1, label: "Account Settings", url: "https://iam.ebrains.eu/auth/realms/hbp/account/", intent: "secondary", icon: "arrow-diagonal", external: true, "extra-class": "w-full" }), this.hasLogout && (h("eds-link", { key: 'd73016ad71f3b356b7fb7d0a2a84124eabb05da5', label: "Sign out", intent: "tertiary", "extra-class": "w-full justify-center", onClick: () => this.onLogout && this.onLogout() })))));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "eds-user-modal"; }
|
|
36
36
|
static get properties() {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Helper function to check if Matomo is initialized
|
|
2
|
+
function isMatomoAvailable() {
|
|
3
|
+
return typeof window !== 'undefined' && typeof window._paq !== 'undefined';
|
|
4
|
+
}
|
|
5
|
+
// General function to push data to Matomo
|
|
6
|
+
function pushToMatomo(action, ...args) {
|
|
7
|
+
//console.log('Pushing Matomo')
|
|
8
|
+
if (isMatomoAvailable()) {
|
|
9
|
+
window._paq.push([action, ...args]);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
console.warn('Matomo is not available or not initialized.');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Function to send analytics data
|
|
17
|
+
export function sendAnalytics(eventData) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!isMatomoAvailable()) {
|
|
20
|
+
// eslint-disable-next-line
|
|
21
|
+
console.warn('Matomo is not available or not initialized.');
|
|
22
|
+
// eslint-disable-next-line
|
|
23
|
+
console.log(Object.assign({}, eventData));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Conditionally build the name field
|
|
27
|
+
const nameParts = [];
|
|
28
|
+
if ((_a = eventData.parentContext) === null || _a === void 0 ? void 0 : _a.componentName) {
|
|
29
|
+
nameParts.push(eventData.parentContext.componentName);
|
|
30
|
+
}
|
|
31
|
+
nameParts.push(eventData.tag || 'unknown-tag');
|
|
32
|
+
nameParts.push(eventData.name || 'unknown-name');
|
|
33
|
+
const name = nameParts.join('/');
|
|
34
|
+
//console.log('trackEvent', eventData.category, eventData.action, name)
|
|
35
|
+
pushToMatomo('trackEvent', eventData.category, eventData.action, name);
|
|
36
|
+
// eslint-disable-next-line
|
|
37
|
+
console.log(Object.assign({}, eventData));
|
|
38
|
+
}
|
|
39
|
+
// Function to opt-in the user
|
|
40
|
+
export function matomoOptIn() {
|
|
41
|
+
if (isMatomoAvailable()) {
|
|
42
|
+
window._paq.push(['rememberConsentGiven']);
|
|
43
|
+
// eslint-disable-next-line
|
|
44
|
+
console.log('User has opted in to tracking');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Function to opt-out the user
|
|
48
|
+
export function matomoOptOut() {
|
|
49
|
+
if (isMatomoAvailable()) {
|
|
50
|
+
window._paq.push(['forgetConsentGiven']);
|
|
51
|
+
// eslint-disable-next-line
|
|
52
|
+
console.log('User has opted out of tracking');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Check if consent was already given
|
|
56
|
+
export function isUserOptedIn() {
|
|
57
|
+
if (isMatomoAvailable()) {
|
|
58
|
+
return window._paq.push(['hasConsent']);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
// Check if the user has opted out
|
|
63
|
+
export function isUserOptedOut() {
|
|
64
|
+
if (isMatomoAvailable()) {
|
|
65
|
+
return window._paq.push(['hasRememberedConsent']);
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Emits a custom event called `parentContext` for a given link element.
|
|
71
|
+
* This event provides context information about the breadcrumb component.
|
|
72
|
+
*
|
|
73
|
+
* @param linkElement - The link element to which the event will be dispatched.
|
|
74
|
+
*/
|
|
75
|
+
export function emitContext(linkElement, componentName, identifier) {
|
|
76
|
+
const event = new CustomEvent('parentContext', {
|
|
77
|
+
detail: {
|
|
78
|
+
componentName: componentName.toLowerCase(),
|
|
79
|
+
identifier: identifier || null
|
|
80
|
+
},
|
|
81
|
+
bubbles: true, // Allow the event to propagate up the DOM
|
|
82
|
+
cancelable: true
|
|
83
|
+
});
|
|
84
|
+
linkElement.dispatchEvent(event);
|
|
85
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
export const GRADIANT_TOKENS = ['green', 'yellow', 'among-blue', 'purple'];
|
|
3
|
+
export const gradientBGColorVariants = cva([], {
|
|
4
|
+
variants: {
|
|
5
|
+
color: GRADIANT_TOKENS.reduce((acc, token) => (Object.assign(Object.assign({}, acc), { [token]: '' })), {}),
|
|
6
|
+
direction: {
|
|
7
|
+
top: '',
|
|
8
|
+
bottom: ''
|
|
9
|
+
},
|
|
10
|
+
pseudo: {
|
|
11
|
+
true: 'before:effect-opacity effect-bg-behind',
|
|
12
|
+
false: ''
|
|
13
|
+
},
|
|
14
|
+
hover: {
|
|
15
|
+
true: 'before:opacity-0 hover:before:opacity-100',
|
|
16
|
+
false: ''
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
compoundVariants: [
|
|
20
|
+
// region GREEN
|
|
21
|
+
{
|
|
22
|
+
color: 'green',
|
|
23
|
+
direction: 'top',
|
|
24
|
+
pseudo: true,
|
|
25
|
+
className: 'before:bg-gradient-01-top'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
color: 'green',
|
|
29
|
+
pseudo: true,
|
|
30
|
+
direction: 'bottom',
|
|
31
|
+
className: 'before:bg-gradient-01-bottom'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
color: 'green',
|
|
35
|
+
direction: 'top',
|
|
36
|
+
pseudo: false,
|
|
37
|
+
className: 'bg-gradient-01-top'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
color: 'green',
|
|
41
|
+
pseudo: false,
|
|
42
|
+
direction: 'bottom',
|
|
43
|
+
className: 'bg-gradient-01-bottom'
|
|
44
|
+
},
|
|
45
|
+
// endregion
|
|
46
|
+
// region YELLOW
|
|
47
|
+
{
|
|
48
|
+
color: 'yellow',
|
|
49
|
+
direction: 'top',
|
|
50
|
+
pseudo: true,
|
|
51
|
+
className: 'before:bg-gradient-02-top'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
color: 'yellow',
|
|
55
|
+
direction: 'bottom',
|
|
56
|
+
pseudo: true,
|
|
57
|
+
className: 'before:bg-gradient-02-bottom'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
color: 'yellow',
|
|
61
|
+
direction: 'top',
|
|
62
|
+
pseudo: false,
|
|
63
|
+
className: 'bg-gradient-02-top'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
color: 'yellow',
|
|
67
|
+
direction: 'bottom',
|
|
68
|
+
pseudo: false,
|
|
69
|
+
className: 'bg-gradient-02-bottom'
|
|
70
|
+
},
|
|
71
|
+
// endregion
|
|
72
|
+
// region PURPLE
|
|
73
|
+
{
|
|
74
|
+
color: 'purple',
|
|
75
|
+
direction: 'top',
|
|
76
|
+
pseudo: true,
|
|
77
|
+
class: 'before:bg-gradient-03-top'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
color: 'purple',
|
|
81
|
+
direction: 'bottom',
|
|
82
|
+
pseudo: true,
|
|
83
|
+
class: 'before:bg-gradient-03-bottom'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
color: 'purple',
|
|
87
|
+
direction: 'top',
|
|
88
|
+
pseudo: false,
|
|
89
|
+
class: 'bg-gradient-03-top'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
color: 'purple',
|
|
93
|
+
direction: 'bottom',
|
|
94
|
+
pseudo: false,
|
|
95
|
+
class: 'bg-gradient-03-bottom'
|
|
96
|
+
},
|
|
97
|
+
// endregion
|
|
98
|
+
// region AMONG-BLUE
|
|
99
|
+
{
|
|
100
|
+
color: 'among-blue',
|
|
101
|
+
direction: 'top',
|
|
102
|
+
pseudo: true,
|
|
103
|
+
class: 'before:bg-gradient-04-top'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
color: 'among-blue',
|
|
107
|
+
direction: 'bottom',
|
|
108
|
+
pseudo: true,
|
|
109
|
+
class: 'before:bg-gradient-04-bottom'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
color: 'among-blue',
|
|
113
|
+
direction: 'top',
|
|
114
|
+
pseudo: false,
|
|
115
|
+
class: 'bg-gradient-04-top'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
color: 'among-blue',
|
|
119
|
+
direction: 'bottom',
|
|
120
|
+
pseudo: false,
|
|
121
|
+
class: 'bg-gradient-04-bottom'
|
|
122
|
+
}
|
|
123
|
+
// endregion
|
|
124
|
+
],
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
direction: 'top',
|
|
127
|
+
pseudo: true
|
|
128
|
+
}
|
|
129
|
+
});
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import Keycloak from "keycloak-js/lib/keycloak";
|
|
2
2
|
let keycloak = null;
|
|
3
|
+
let keycloakInitPromise = null;
|
|
3
4
|
// Initialize Keycloak with an optional silent check
|
|
4
5
|
export function initKeycloak(config, silentCheck = true) {
|
|
6
|
+
// If already initializing or initialized, return the cached promise
|
|
7
|
+
if (keycloakInitPromise) {
|
|
8
|
+
// eslint-disable-next-line
|
|
9
|
+
console.log('Keycloak already initialized, returning from cache');
|
|
10
|
+
return keycloakInitPromise;
|
|
11
|
+
}
|
|
5
12
|
if (!keycloak) {
|
|
6
13
|
keycloak = new Keycloak({
|
|
7
14
|
url: config.url,
|
|
@@ -9,7 +16,7 @@ export function initKeycloak(config, silentCheck = true) {
|
|
|
9
16
|
clientId: config.clientId
|
|
10
17
|
});
|
|
11
18
|
}
|
|
12
|
-
|
|
19
|
+
keycloakInitPromise = keycloak
|
|
13
20
|
.init({
|
|
14
21
|
onLoad: silentCheck ? 'check-sso' : 'login-required',
|
|
15
22
|
checkLoginIframe: false
|
|
@@ -21,6 +28,7 @@ export function initKeycloak(config, silentCheck = true) {
|
|
|
21
28
|
console.error('Failed to initialize Keycloak:', error);
|
|
22
29
|
return false;
|
|
23
30
|
});
|
|
31
|
+
return keycloakInitPromise;
|
|
24
32
|
}
|
|
25
33
|
// Get the username of the authenticated user
|
|
26
34
|
export function getUsername() {
|
|
@@ -50,8 +58,7 @@ export function login() {
|
|
|
50
58
|
keycloak.login();
|
|
51
59
|
}
|
|
52
60
|
else {
|
|
53
|
-
|
|
54
|
-
console.error('Keycloak is not initialized.');
|
|
61
|
+
throw new Error('Keycloak is not initialized.');
|
|
55
62
|
}
|
|
56
63
|
}
|
|
57
64
|
// Log out the user
|
|
@@ -60,8 +67,7 @@ export function logout() {
|
|
|
60
67
|
keycloak.logout();
|
|
61
68
|
}
|
|
62
69
|
else {
|
|
63
|
-
|
|
64
|
-
console.error('Keycloak is not initialized.');
|
|
70
|
+
throw new Error('Keycloak is not initialized.');
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
// Check if the user is authenticated
|