@ebrains/react 0.5.0-alpha.0 → 0.7.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.
Files changed (89) hide show
  1. package/{analytics-1cde8e4a.esm.js → analytics-44b1416b.esm.js} +9 -1
  2. package/color-primary-palette_6.entry.esm.js +106 -106
  3. package/correct-use-of-colors.entry.esm.js +33 -33
  4. package/eds-accordion_22.entry.esm.js +269 -0
  5. package/eds-alert.entry.esm.js +104 -0
  6. package/eds-app-root.entry.esm.js +53 -0
  7. package/eds-avatar_4.entry.esm.js +2 -10
  8. package/eds-breadcrumb.entry.esm.js +171 -0
  9. package/eds-card-generic.entry.esm.js +7 -17
  10. package/eds-card-project.entry.esm.js +1 -1
  11. package/eds-card-section.entry.esm.js +8 -22
  12. package/eds-card-tool.entry.esm.js +1 -1
  13. package/eds-components-section.entry.esm.js +1 -1
  14. package/eds-cookies-preference.entry.esm.js +47 -0
  15. package/eds-docs-palettes.entry.esm.js +1 -1
  16. package/eds-docs-tokens.entry.esm.js +1 -1
  17. package/{eds-dropdown_2.entry.esm.js → eds-dropdown.entry.esm.js} +20 -99
  18. package/eds-feedback.entry.esm.js +82 -0
  19. package/eds-form.entry.esm.js +254 -254
  20. package/eds-frame.entry.esm.js +34 -33
  21. package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
  22. package/eds-icon-arrow-right.entry.esm.js +1 -1
  23. package/eds-icon-bluesky.entry.esm.js +1 -1
  24. package/eds-icon-chevron-down.entry.esm.js +1 -1
  25. package/eds-icon-chevron-left.entry.esm.js +1 -1
  26. package/eds-icon-chevron-right.entry.esm.js +1 -1
  27. package/eds-icon-chevron-up.entry.esm.js +1 -1
  28. package/eds-icon-close.entry.esm.js +1 -1
  29. package/eds-icon-copy.entry.esm.js +1 -1
  30. package/eds-icon-eu.entry.esm.js +1 -1
  31. package/eds-icon-facebook.entry.esm.js +1 -1
  32. package/eds-icon-gitlab.entry.esm.js +1 -1
  33. package/eds-icon-linkedin.entry.esm.js +1 -1
  34. package/eds-icon-loader.entry.esm.js +1 -1
  35. package/eds-icon-mastodon.entry.esm.js +1 -1
  36. package/eds-icon-menu.entry.esm.js +1 -1
  37. package/eds-icon-more.entry.esm.js +1 -1
  38. package/eds-icon-search.entry.esm.js +1 -1
  39. package/eds-icon-star.entry.esm.js +21 -0
  40. package/eds-icon-success.entry.esm.js +1 -1
  41. package/eds-icon-thumbs-down.entry.esm.js +21 -0
  42. package/eds-icon-thumbs-up.entry.esm.js +21 -0
  43. package/eds-icon-twitter.entry.esm.js +1 -1
  44. package/eds-icon-user.entry.esm.js +1 -1
  45. package/eds-icon-youtube.entry.esm.js +1 -1
  46. package/{keycloak-d502ec16.esm.js → eds-login_2.entry.esm.js} +172 -1
  47. package/eds-logo-variations.entry.esm.js +1 -1
  48. package/eds-modal.entry.esm.js +23 -10
  49. package/eds-progress-bar.entry.esm.js +2 -2
  50. package/eds-rating.entry.esm.js +79 -0
  51. package/eds-section-core_2.entry.esm.js +5 -5
  52. package/eds-spinner.entry.esm.js +67 -0
  53. package/eds-steps.entry.esm.js +89 -0
  54. package/eds-svg-repository.entry.esm.js +8 -2
  55. package/eds-switch.entry.esm.js +58 -0
  56. package/eds-tabs.entry.esm.js +15 -27
  57. package/eds-timeline.entry.esm.js +6 -23
  58. package/eds-toast-manager.entry.esm.js +62 -0
  59. package/eds-toast.entry.esm.js +92 -0
  60. package/eds-tooltip.entry.esm.js +4 -4
  61. package/eds-trl.entry.esm.js +2 -2
  62. package/eds-user.entry.esm.js +64 -87
  63. package/eds-vertical-stepper.entry.esm.js +5 -5
  64. package/formUtils-ac68474d.esm.js +247 -0
  65. package/incorrect-use-of-colors.entry.esm.js +7 -7
  66. package/index.esm.js +1 -1
  67. package/index.esm2.js +51 -27
  68. package/logo-space.entry.esm.js +4 -4
  69. package/logo-variations-horizontal_2.entry.esm.js +26 -26
  70. package/logo-wrong-usage.entry.esm.js +37 -37
  71. package/package.json +1 -1
  72. package/sharedUtils-a550989c.esm.js +17 -0
  73. package/src/components.d.ts +4 -1
  74. package/star-0da9b5e9.esm.js +5 -0
  75. package/thumbs-down-a18fd049.esm.js +5 -0
  76. package/thumbs-up-c19a71bc.esm.js +6 -0
  77. package/token-list_3.entry.esm.js +5 -5
  78. package/token-ratios.entry.esm.js +3 -3
  79. package/token-spacing.entry.esm.js +26 -26
  80. package/token-typography.entry.esm.js +2 -2
  81. package/eds-accordion.entry.esm.js +0 -126
  82. package/eds-alert_17.entry.esm.js +0 -187
  83. package/eds-input_7.entry.esm.js +0 -529
  84. package/eds-login.entry.esm.js +0 -97
  85. package/eds-matomo-notice.entry.esm.js +0 -128
  86. package/eds-navigator.entry.esm.js +0 -72
  87. package/eds-pagination_2.entry.esm.js +0 -472
  88. package/eds-tab.entry.esm.js +0 -41
  89. package/eds-tabs-content.entry.esm.js +0 -145
@@ -1,97 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
2
- import { l as login, a as logout, i as initKeycloak, b as isAuthenticated, g as getUser } from './keycloak-d502ec16.esm.js';
3
- import { t as toast } from './toastManager-d9eee791.esm.js';
4
- import 'react';
5
- import 'react/jsx-runtime';
6
- import 'react-dom';
7
-
8
- const EdsLogin = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.authStatusChanged = createEvent(this, "authStatusChanged", 7);
12
- /**
13
- * Handles user login by invoking the Keycloak `login` function.
14
- * Only triggers login if the user is not already authenticated.
15
- */
16
- this.handleLogin = async () => {
17
- if (!this.authenticated) {
18
- try {
19
- await login();
20
- toast.show('You are authenticated', 'success');
21
- } catch (error) {
22
- toast.show(error.message, 'error');
23
- }
24
- }
25
- };
26
- /**
27
- * Handles user logout by invoking the Keycloak `logout` function.
28
- * Resets the `authenticated` state to `false` after logout.
29
- */
30
- this.handleLogout = async () => {
31
- try {
32
- await logout();
33
- } catch (error) {
34
- toast.show(error.message, 'error');
35
- }
36
- this.authenticated = false;
37
- this.user = null;
38
- };
39
- this.keycloakUrl = undefined;
40
- this.keycloakRealm = undefined;
41
- this.keycloakClientId = undefined;
42
- this.authenticated = false;
43
- this.user = null;
44
- }
45
- /**
46
- * Lifecycle method that runs when the component is about to load.
47
- * It initializes authentication by calling the `initAuth` method.
48
- */
49
- async componentWillLoad() {
50
- // Check if required props are provided (optional check)
51
- if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
52
- // eslint-disable-next-line
53
- console.error('Keycloak configuration props are missing.');
54
- return;
55
- }
56
- await this.initAuth();
57
- }
58
- /**
59
- * Initializes the Keycloak authentication by configuring Keycloak with the provided props.
60
- * Sets the `authenticated` state and `user` data if the user is authenticated.
61
- * Emits `authStatusChanged` event with the authentication status.
62
- */
63
- async initAuth() {
64
- try {
65
- await initKeycloak({
66
- url: this.keycloakUrl,
67
- realm: this.keycloakRealm,
68
- clientId: this.keycloakClientId
69
- }, true);
70
- if (isAuthenticated()) {
71
- this.user = getUser();
72
- this.authenticated = true;
73
- this.authStatusChanged.emit({
74
- authenticated: this.authenticated,
75
- user: this.user
76
- }); // Emit auth status change
77
- }
78
- } catch (error) {
79
- toast.show(error.message, 'error');
80
- }
81
- }
82
- render() {
83
- return h("div", {
84
- key: 'cd30a135920ae77959330a43a8544bb9c231986e',
85
- class: "block"
86
- }, !this.authenticated && h("eds-button", {
87
- key: '98fa63c46b063a67c215ff9160c6dfbfee2265f7',
88
- label: "Login",
89
- intent: "primary",
90
- "extra-class": "text-default",
91
- "aria-label": "Login",
92
- triggerClick: this.handleLogin.bind(this)
93
- }));
94
- }
95
- };
96
-
97
- export { EdsLogin as eds_login };
@@ -1,128 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import { t as toast } from './toastManager-d9eee791.esm.js';
3
- import { m as matomoOptIn } from './analytics-1cde8e4a.esm.js';
4
- import 'react';
5
- import 'react/jsx-runtime';
6
- import 'react-dom';
7
-
8
- const edsMatomoNoticeCss = ".fixed{position:fixed}.absolute{position:absolute}.w-full{width:100%}.bottom-0{bottom:0rem}.bottom-4{bottom:0.25rem}.p-4{padding:0.25rem}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.z-10{z-index:10}.left-0{left:0rem}.left-1\\/2{left:50%}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.flex{display:flex}.gap-12{gap:0.75rem}.gap-20{gap:1.25rem}.gap-4{gap:0.25rem}@media (min-width: 750px){.md\\:left-1\\/2{left:50%}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:-translate-x-1\\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}";
9
- const EdsMatomoNoticeStyle0 = edsMatomoNoticeCss;
10
- const EdsMatomoNotice = class {
11
- constructor(hostRef) {
12
- registerInstance(this, hostRef);
13
- this.title = 'Analytics Consent';
14
- this.description = 'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.';
15
- this.showNotice = true;
16
- }
17
- /**
18
- * Lifecycle method called before the component is rendered.
19
- * Checks for the presence of the "mtm_consent" cookie to determine
20
- * if the notice should be displayed.
21
- */
22
- componentWillLoad() {
23
- this.checkConsentCookie();
24
- }
25
- /**
26
- * Lifecycle method called after the component has been rendered.
27
- * Emits `parentContext` events for each `eds-button` in the shadow DOM.
28
- */
29
- componentDidLoad() {
30
- const btns = this.el.shadowRoot.querySelectorAll('eds-button');
31
- btns.forEach(b => {
32
- this.emitContext(b);
33
- });
34
- }
35
- /**
36
- * Emits a custom `parentContext` event for a given button element.
37
- * This can be used to provide context information about the component.
38
- *
39
- * @param linkElement - The button element to which the event will be dispatched.
40
- */
41
- emitContext(linkElement) {
42
- const event = new CustomEvent('parentContext', {
43
- detail: {
44
- componentName: this.el.tagName.toLowerCase(),
45
- identifier: null
46
- }
47
- });
48
- linkElement.dispatchEvent(event);
49
- }
50
- /**
51
- * Checks if the Matomo "mtm_consent" cookie exists in the browser.
52
- * If the cookie is found, the notice is hidden.
53
- */
54
- checkConsentCookie() {
55
- const consentCookie = document.cookie.split('; ').find(row => row.startsWith('mtm_consent='));
56
- //this.showNotice = !consentCookie;
57
- const sessionDeferred = sessionStorage.getItem('matomo-deferred');
58
- this.showNotice = !consentCookie && !sessionDeferred;
59
- }
60
- /**
61
- * Handles user consent for analytics tracking.
62
- * Calls the `matomoOptIn` utility and shows a success toast notification.
63
- */
64
- optInAnalytics() {
65
- matomoOptIn();
66
- toast.show('You have opted in to analytics.', 'success');
67
- this.hideNotice();
68
- }
69
- /**
70
- * Handles user opt-out from analytics tracking.
71
- * Calls the `matomoOptOut` utility and shows a warning toast notification.
72
-
73
- private optOutAnalytics() {
74
- matomoOptOut();
75
- toast.show('You have opted out of analytics.', 'warning');
76
- this.hideNotice();
77
- }*/
78
- /**
79
- * Handles "Ask me later" action by storing a session storage entry
80
- * and hiding the notice for the rest of the session.
81
- */
82
- deferDecision() {
83
- sessionStorage.setItem('matomo-deferred', 'true');
84
- toast.show('You can decide later.', 'warning');
85
- this.hideNotice();
86
- }
87
- /**
88
- * Hides the notice by updating the `showNotice` state.
89
- */
90
- hideNotice() {
91
- this.showNotice = false;
92
- }
93
- /**
94
- * Renders the Matomo consent notice with user options.
95
- * Includes an accordion for the description and two buttons for user consent.
96
- */
97
- render() {
98
- if (!this.showNotice) {
99
- return null;
100
- }
101
- return h("div", {
102
- class: "fixed bottom-0 p-8 z-10 grow md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 justify-center"
103
- }, h("eds-accordion", {
104
- title: this.title,
105
- description: this.description,
106
- switchBg: true,
107
- expanded: true
108
- }, h("div", {
109
- class: "flex items-center gap-4"
110
- }, h("eds-button", {
111
- intent: "primary",
112
- label: "Yes, I agree",
113
- "aria-label": "Opt-in for analytics",
114
- onClick: () => this.optInAnalytics()
115
- }), h("eds-button", {
116
- intent: "ghost",
117
- label: "Ask me later",
118
- "aria-label": "Defer analytics decision",
119
- onClick: () => this.deferDecision()
120
- }))));
121
- }
122
- get el() {
123
- return getElement(this);
124
- }
125
- };
126
- EdsMatomoNotice.style = EdsMatomoNoticeStyle0;
127
-
128
- export { EdsMatomoNotice as eds_matomo_notice };
@@ -1,72 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import 'react';
3
- import 'react/jsx-runtime';
4
- import 'react-dom';
5
-
6
- const EdsNavigator = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.prevLabel = undefined;
10
- this.nextLabel = undefined;
11
- this.prevUrl = undefined;
12
- this.nextUrl = undefined;
13
- this.linkSize = 'small';
14
- this.linkIntent = 'tertiary';
15
- }
16
- componentDidLoad() {
17
- // Emit context for each eds-link element after the component is fully loaded
18
- const links = this.el.querySelectorAll('eds-link');
19
- links.forEach(link => {
20
- this.emitContext(link);
21
- });
22
- }
23
- /**
24
- * Emits a custom event 'parentContext' for a given link element with the component's context.
25
- * @param linkElement - The eds-link element to emit the event for.
26
- */
27
- emitContext(linkElement) {
28
- const event = new CustomEvent('parentContext', {
29
- detail: {
30
- componentName: this.el.tagName.toLowerCase(),
31
- identifier: null
32
- }
33
- });
34
- linkElement.dispatchEvent(event);
35
- }
36
- render() {
37
- return h("ul", {
38
- key: '712287e683436cc98c2d6ef195501add1929522e',
39
- class: "flex lg:flex grow items-center justify-center gap-x-8"
40
- }, this.prevLabel && h("eds-link", {
41
- key: '4fda36ce37897284d7062f88133f147831d96a6f',
42
- label: this.prevLabel,
43
- url: this.prevUrl || undefined,
44
- disabled: !this.prevUrl,
45
- "aria-label": this.prevLabel,
46
- size: this.linkSize,
47
- intent: this.linkIntent,
48
- class: "mr-auto !p-8 lg:!pr-12"
49
- }, h("eds-icon-wrapper", {
50
- key: '9bfa6bbbdc68641f65bec49f207d96f075b9a5b0',
51
- icon: "chevron-left"
52
- }), this.prevLabel), this.nextLabel && h("eds-link", {
53
- key: '6ee8ebee011a2c30a74645b072c7c37929d0a55f',
54
- label: this.nextLabel,
55
- url: this.nextUrl || undefined,
56
- disabled: !this.nextUrl,
57
- "aria-label": this.nextLabel,
58
- size: this.linkSize,
59
- intent: this.linkIntent,
60
- class: "ml-auto !p-8 lg:!pl-12"
61
- }, this.nextLabel, h("eds-icon-wrapper", {
62
- key: '44ebd4dcce0e367df7d9035bb445e49fde35e913',
63
- icon: "chevron-right",
64
- class: "w-20 h-20"
65
- })));
66
- }
67
- get el() {
68
- return getElement(this);
69
- }
70
- };
71
-
72
- export { EdsNavigator as eds_navigator };