@ebrains/react 0.6.0-alpha.0 → 0.8.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 (96) hide show
  1. package/color-primary-palette_6.entry.esm.js +106 -106
  2. package/correct-use-of-colors.entry.esm.js +33 -33
  3. package/eds-accordion_17.entry.esm.js +196 -0
  4. package/eds-alert.entry.esm.js +14 -6
  5. package/eds-app-root.entry.esm.js +53 -0
  6. package/eds-breadcrumb.entry.esm.js +8 -16
  7. package/eds-card-desc_3.entry.esm.js +125 -0
  8. package/eds-card-generic.entry.esm.js +114 -0
  9. package/eds-card-project.entry.esm.js +10 -10
  10. package/eds-card-section.entry.esm.js +56 -0
  11. package/eds-card-tags.entry.esm.js +1 -1
  12. package/eds-card-tool.entry.esm.js +4 -4
  13. package/eds-card-wrapper.entry.esm.js +4 -4
  14. package/eds-code-block.entry.esm.js +7 -7
  15. package/eds-components-section.entry.esm.js +27 -24
  16. package/eds-cookies-preference.entry.esm.js +2 -2
  17. package/eds-docs-palettes.entry.esm.js +1 -1
  18. package/eds-docs-tokens.entry.esm.js +1 -1
  19. package/eds-feedback.entry.esm.js +82 -0
  20. package/eds-form.entry.esm.js +339 -276
  21. package/eds-frame.entry.esm.js +34 -33
  22. package/eds-icon-arrow-diagonal.entry.esm.js +3 -3
  23. package/eds-icon-arrow-right.entry.esm.js +1 -1
  24. package/eds-icon-bluesky.entry.esm.js +1 -1
  25. package/eds-icon-chevron-down.entry.esm.js +1 -1
  26. package/eds-icon-chevron-left.entry.esm.js +1 -1
  27. package/eds-icon-chevron-right.entry.esm.js +1 -1
  28. package/eds-icon-chevron-up.entry.esm.js +1 -1
  29. package/eds-icon-close.entry.esm.js +1 -1
  30. package/eds-icon-copy.entry.esm.js +1 -1
  31. package/eds-icon-eu.entry.esm.js +1 -1
  32. package/eds-icon-facebook.entry.esm.js +1 -1
  33. package/eds-icon-gitlab.entry.esm.js +1 -1
  34. package/eds-icon-linkedin.entry.esm.js +1 -1
  35. package/eds-icon-loader.entry.esm.js +1 -1
  36. package/eds-icon-mastodon.entry.esm.js +1 -1
  37. package/eds-icon-menu.entry.esm.js +1 -1
  38. package/eds-icon-more.entry.esm.js +1 -1
  39. package/eds-icon-search.entry.esm.js +1 -1
  40. package/eds-icon-star.entry.esm.js +21 -0
  41. package/eds-icon-success.entry.esm.js +1 -1
  42. package/eds-icon-thumbs-down.entry.esm.js +21 -0
  43. package/eds-icon-thumbs-up.entry.esm.js +21 -0
  44. package/eds-icon-twitter.entry.esm.js +1 -1
  45. package/eds-icon-user.entry.esm.js +1 -1
  46. package/eds-icon-youtube.entry.esm.js +1 -1
  47. package/eds-input_7.entry.esm.js +77 -37
  48. package/{keycloak-d502ec16.esm.js → eds-login_2.entry.esm.js} +172 -1
  49. package/eds-logo-variations.entry.esm.js +1 -1
  50. package/eds-modal.entry.esm.js +22 -9
  51. package/eds-pagination_2.entry.esm.js +49 -28
  52. package/eds-progress-bar.entry.esm.js +2 -2
  53. package/eds-rating.entry.esm.js +37 -37
  54. package/eds-section-core_2.entry.esm.js +6 -6
  55. package/eds-spinner.entry.esm.js +67 -0
  56. package/eds-svg-repository.entry.esm.js +18 -7
  57. package/eds-switch.entry.esm.js +5 -5
  58. package/eds-tabs.entry.esm.js +14 -26
  59. package/eds-timeline.entry.esm.js +9 -23
  60. package/eds-toast-manager.entry.esm.js +62 -0
  61. package/eds-toast.entry.esm.js +92 -0
  62. package/eds-tooltip.entry.esm.js +3 -3
  63. package/eds-trl.entry.esm.js +3 -3
  64. package/incorrect-use-of-colors.entry.esm.js +7 -7
  65. package/index.esm.js +1 -1
  66. package/index.esm2.js +47 -55
  67. package/logo-space.entry.esm.js +4 -4
  68. package/logo-variations-horizontal_2.entry.esm.js +26 -26
  69. package/logo-wrong-usage.entry.esm.js +37 -37
  70. package/package.json +1 -1
  71. package/sharedUtils-a550989c.esm.js +17 -0
  72. package/src/components.d.ts +4 -3
  73. package/star-0da9b5e9.esm.js +5 -0
  74. package/thumbs-down-a18fd049.esm.js +5 -0
  75. package/thumbs-up-c19a71bc.esm.js +6 -0
  76. package/token-list_3.entry.esm.js +5 -5
  77. package/token-ratios.entry.esm.js +3 -3
  78. package/token-spacing.entry.esm.js +26 -26
  79. package/token-typography.entry.esm.js +2 -2
  80. package/README.md +0 -7
  81. package/eds-accordion_13.entry.esm.js +0 -1064
  82. package/eds-block-break.entry.esm.js +0 -22
  83. package/eds-dropdown_2.entry.esm.js +0 -235
  84. package/eds-footer.entry.esm.js +0 -102
  85. package/eds-fullscreen-menu.entry.esm.js +0 -143
  86. package/eds-header.entry.esm.js +0 -130
  87. package/eds-link.entry.esm.js +0 -204
  88. package/eds-login.entry.esm.js +0 -97
  89. package/eds-logo.entry.esm.js +0 -87
  90. package/eds-navigator.entry.esm.js +0 -72
  91. package/eds-social-networks.entry.esm.js +0 -74
  92. package/eds-steps.entry.esm.js +0 -98
  93. package/eds-tab.entry.esm.js +0 -41
  94. package/eds-tabs-content.entry.esm.js +0 -145
  95. package/eds-user.entry.esm.js +0 -118
  96. package/eds-vertical-stepper.entry.esm.js +0 -81
@@ -1,118 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
- import { l as login, a as logout, c as checkServerAvailability, 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 EdsUser = 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 = () => {
17
- if (!this.authenticated) {
18
- try {
19
- login();
20
- } catch (error) {
21
- toast.show(error.message, 'error');
22
- }
23
- }
24
- };
25
- /**
26
- * Handles user logout by invoking the Keycloak `logout` function.
27
- * Resets the `authenticated` state to `false` after logout.
28
- */
29
- this.handleLogout = async () => {
30
- try {
31
- await logout();
32
- } catch (error) {
33
- toast.show(error.message, 'error');
34
- }
35
- this.authenticated = false;
36
- this.user = null;
37
- };
38
- this.keycloakUrl = undefined;
39
- this.keycloakRealm = undefined;
40
- this.keycloakClientId = undefined;
41
- this.user = null;
42
- this.authenticated = false;
43
- this.username = '';
44
- this.serverAvailable = false;
45
- }
46
- /**
47
- * Lifecycle method that runs when the component is about to load.
48
- * It initializes authentication by calling the `initAuth` method.
49
- */
50
- async componentWillLoad() {
51
- // Check if required props are provided (optional check)
52
- if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
53
- // eslint-disable-next-line
54
- console.error('Keycloak configuration props are missing.');
55
- return;
56
- }
57
- this.serverAvailable = await checkServerAvailability(`${this.keycloakUrl}/realms/${this.keycloakRealm}`);
58
- if (!this.serverAvailable) {
59
- toast.show('Keycloak server is unavailable.', 'error');
60
- return; // Do not proceed further
61
- }
62
- await this.initAuth();
63
- }
64
- /**
65
- * Initializes the Keycloak authentication by configuring Keycloak with the provided props.
66
- * Sets the `authenticated` state and `user` data if the user is authenticated.
67
- * Emits `authStatusChanged` event with the authentication status.
68
- */
69
- async initAuth() {
70
- try {
71
- await initKeycloak({
72
- url: this.keycloakUrl,
73
- realm: this.keycloakRealm,
74
- clientId: this.keycloakClientId
75
- }, true);
76
- if (isAuthenticated()) {
77
- this.user = getUser();
78
- this.authenticated = true;
79
- this.authStatusChanged.emit({
80
- authenticated: this.authenticated,
81
- user: this.user
82
- }); // Emit auth status change
83
- }
84
- } catch (error) {
85
- toast.show(error.message, 'error');
86
- }
87
- }
88
- render() {
89
- var _a;
90
- return h("div", {
91
- key: '8fe0aaf06ed421d8ca6e512247b4d15b092c895f',
92
- class: "block"
93
- }, !this.authenticated ? h("eds-button", {
94
- label: "Login",
95
- intent: "primary",
96
- onClick: this.handleLogin,
97
- "extra-class": "text-default"
98
- }) : h("div", {
99
- class: "flex items-center"
100
- }, h("eds-dropdown", {
101
- label: `Welcome, ${(_a = this.user) === null || _a === void 0 ? void 0 : _a.username}`,
102
- intent: "tertiary",
103
- "aria-label": "User Menu",
104
- "dropdown-pos": "right",
105
- "dropdown-offset": "false",
106
- icon: "chevron-down",
107
- class: "text-default"
108
- }, h("eds-user-modal", {
109
- user: JSON.stringify(this.user),
110
- onLogout: this.handleLogout.bind(this)
111
- }))));
112
- }
113
- get hostEl() {
114
- return getElement(this);
115
- }
116
- };
117
-
118
- export { EdsUser as eds_user };
@@ -1,81 +0,0 @@
1
- import { r as registerInstance, h } from './index.esm2.js';
2
- import 'react';
3
- import 'react/jsx-runtime';
4
- import 'react-dom';
5
-
6
- const edsVerticalStepperCss = ":host{display:block}.stepper-container{margin:0 auto}.stepper{position:sticky;margin-left:16px;margin-bottom:12px;border-left:1px solid var(--soft-color, #ddd);padding-left:24px;counter-reset:step}.step{margin-bottom:24px}.step-label{counter-increment:step;font-size:1.25rem;font-weight:600;position:relative;margin-top:1em;margin-bottom:1em}.step-label::before{content:counter(step);position:absolute;left:-40px;top:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;font-size:1rem;border:1px solid #ccc;background:var(--grey-900);color:#fff;border-radius:50%}.optional{font-size:0.8rem;color:#888;margin-left:8px}.step-content{margin-top:8px}.step-buttons{margin-top:12px}.step-buttons button{margin-right:8px;padding:6px 12px;font-size:0.875rem}.completed{padding:16px;border:1px solid #ddd;margin-top:16px;text-align:center}";
7
- const EdsVerticalStepperStyle0 = edsVerticalStepperCss;
8
- const EdsVerticalStepper = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.handleNext = () => {
12
- if (this.activeStep < this.parsedSteps.length) {
13
- this.activeStep = this.activeStep + 1;
14
- }
15
- };
16
- this.handleBack = () => {
17
- if (this.activeStep > 0) {
18
- this.activeStep = this.activeStep - 1;
19
- }
20
- };
21
- this.handleReset = () => {
22
- this.activeStep = 0;
23
- };
24
- this.steps = '[]';
25
- this.activeStep = 0;
26
- }
27
- get parsedSteps() {
28
- try {
29
- return JSON.parse(this.steps);
30
- } catch (error) {
31
- //console.error('Invalid steps JSON', error);
32
- return [];
33
- }
34
- }
35
- render() {
36
- const steps = this.parsedSteps;
37
- return h("div", {
38
- key: '08fa2f85c49dbe217b2f9d068bee486e432f5315',
39
- class: "stepper-container"
40
- }, h("div", {
41
- key: '6f7e0a0ccaa2882794a6be0216201d1bf924e2b2',
42
- class: "stepper"
43
- }, steps.map((step, index) => h("div", {
44
- class: "step",
45
- key: index
46
- }, h("div", {
47
- class: "step-label"
48
- }, h("span", null, step.label), index === steps.length - 1 && h("span", {
49
- class: "f-ui-03 text-lightest ml-4"
50
- }, "(Last step)")), this.activeStep === index && h("div", {
51
- class: "step-content"
52
- }, h("p", null, step.description), h("div", {
53
- class: "step-buttons"
54
- }, h("eds-button", {
55
- label: index === steps.length - 1 ? 'Finish' : 'Continue',
56
- class: "next-btn",
57
- onClick: this.handleNext
58
- }), h("eds-button", {
59
- label: "Back",
60
- intent: "ghostInverse",
61
- onClick: this.handleBack,
62
- disabled: index === 0,
63
- "extra-class": index === 0 ? 'hidden' : 'ml-8 block'
64
- })))))), this.activeStep === steps.length && h("div", {
65
- key: '8a5ebfed582b25d828758e1762a063df6c745093',
66
- class: ""
67
- }, h("eds-alert", {
68
- key: 'a142fb50b8df533dd97f770aeaa453f2379ea7cb',
69
- intent: "success",
70
- message: "All steps completed - you're finished!"
71
- }), h("eds-button", {
72
- key: '5cfba059c9a152f179e7c31fa5d7a222c00defe2',
73
- label: "Start again",
74
- onClick: this.handleReset,
75
- "extra-class": "mt-4"
76
- })));
77
- }
78
- };
79
- EdsVerticalStepper.style = EdsVerticalStepperStyle0;
80
-
81
- export { EdsVerticalStepper as eds_vertical_stepper };