@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
@@ -3,6 +3,8 @@ import 'react';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react-dom';
5
5
 
6
+ const edsFrameCss = ".bg-inverse{background-color:var(--white)}.min-h-156{min-height:156px}.rounded{border-radius:0.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:16px}.rounded-md{border-radius:12px}.border-soft{border-color:rgba(0, 0, 0, .15 )}.border-softer{border-color:rgba(0, 0, 0, .1 )}.border-softest{border-color:rgba(0, 0, 0, .05 )}.effect-focus-within{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.effect-focus-within:focus-within{outline-style:solid}.relative{position:relative}.flex{display:flex}.grow{flex-grow:1}.flex-col{flex-direction:column}.border-2{border-width:2px}.w-full{width:100%}.h-full{height:100%}.effect-height{transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-property:height}.items-center{align-items:center}.justify-between{justify-content:space-between}.py-8{padding-top:0.5rem;padding-bottom:0.5rem}.px-12{padding-left:0.75rem;padding-right:0.75rem}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.ml-auto{margin-left:auto}.border-t-2{border-top-width:2px}.border{border:1px solid rgba(0, 0, 0, .1 )}.border-2{border:1px solid rgba(0, 0, 0, .1 )}.container{width:calc(var(--container-width, 100%) - (2 * var(--breakout-container-outer-gutter, var(--container-outer-gutter, var(--outer-gutter, 0)))));margin-right:auto;margin-left:auto}.container>*{--container-outer-gutter:0;--breakout-container-outer-gutter:0}.ml-8{margin-left:0.5rem}.mr-8{margin-right:0.5rem}.mt-16{margin-top:1rem}";
7
+ const EdsFrameStyle0 = edsFrameCss;
6
8
  const EdsFrame = class {
7
9
  constructor(hostRef) {
8
10
  registerInstance(this, hostRef);
@@ -12,13 +14,36 @@ const EdsFrame = class {
12
14
  this.storybookUrl = undefined;
13
15
  this.storyPath = undefined;
14
16
  this.intent = 'strong';
15
- this.tiny = false;
16
17
  this.size = 'auto';
17
- this.bg = true;
18
18
  this.iframeError = false;
19
19
  }
20
+ componentWillLoad() {
21
+ this.checkIframeAvailability();
22
+ }
23
+ componentDidLoad() {
24
+ // Emit context for each eds-link element after the component is fully loaded
25
+ const links = this.el.querySelectorAll('eds-link');
26
+ links.forEach(link => {
27
+ this.emitContext(link);
28
+ });
29
+ }
30
+ /**
31
+ * Emits a custom event called `parentContext` for a given link element.
32
+ * This event provides context information about the breadcrumb component.
33
+ *
34
+ * @param linkElement - The link element to which the event will be dispatched.
35
+ */
36
+ emitContext(linkElement) {
37
+ const event = new CustomEvent('parentContext', {
38
+ detail: {
39
+ componentName: this.el.tagName.toLowerCase(),
40
+ identifier: this.frameLabel
41
+ }
42
+ });
43
+ linkElement.dispatchEvent(event);
44
+ }
20
45
  articleClasses() {
21
- return [this.tiny ? 'min-h-120' : 'min-h-156', this.bg ? 'bg-inverse' : 'bg-default', 'rounded border-softer effect-focus-within relative flex grow flex-col border-2', 'w-full h-full'].join(' ');
46
+ return ['bg-inverse min-h-156 rounded border-softer effect-focus-within relative flex grow flex-col border-2', 'w-full h-full'].join(' ');
22
47
  }
23
48
  getFrameHeight() {
24
49
  switch (this.size) {
@@ -46,31 +71,6 @@ const EdsFrame = class {
46
71
  this.iframeError = true;
47
72
  }
48
73
  }
49
- componentWillLoad() {
50
- this.checkIframeAvailability();
51
- }
52
- componentDidLoad() {
53
- // Emit context for each eds-link element after the component is fully loaded
54
- const links = this.el.querySelectorAll('eds-link');
55
- links.forEach(link => {
56
- this.emitContext(link);
57
- });
58
- }
59
- /**
60
- * Emits a custom event called `parentContext` for a given link element.
61
- * This event provides context information about the breadcrumb component.
62
- *
63
- * @param linkElement - The link element to which the event will be dispatched.
64
- */
65
- emitContext(linkElement) {
66
- const event = new CustomEvent('parentContext', {
67
- detail: {
68
- componentName: this.el.tagName.toLowerCase(),
69
- identifier: this.frameLabel
70
- }
71
- });
72
- linkElement.dispatchEvent(event);
73
- }
74
74
  get storyLink() {
75
75
  return `${this.storybookUrl}/?path=/story/${this.storyPath}`;
76
76
  }
@@ -79,13 +79,13 @@ const EdsFrame = class {
79
79
  }
80
80
  render() {
81
81
  return h("div", {
82
- key: '20786dd40414d29f98d496e29720bd78b9d7cf8e',
82
+ key: 'e4b72fab30dcf1eeee6fdf3c63719599eafedb6d',
83
83
  class: this.articleClasses()
84
84
  }, h("div", {
85
- key: '208612330c9d2872c68aeb310e164c8a915a51ef',
85
+ key: 'f8643db32120c14dd18b3d44ae530a83e81e59e0',
86
86
  class: "effect-height flex items-center justify-between py-8 px-12"
87
87
  }, h("span", {
88
- key: 'ada2a40384ffaffadc8887580aa6184422008a68',
88
+ key: '7b40c644e142e6a6356e4d6a683b9c1c57104f5d',
89
89
  class: "f-ui-02"
90
90
  }, this.frameLabel), !this.iframeError ? h("eds-link", {
91
91
  label: this.urlLabel,
@@ -96,8 +96,8 @@ const EdsFrame = class {
96
96
  disabled: false,
97
97
  icon: "arrow-diagonal"
98
98
  }) : null), h("div", {
99
- key: '26a5ae1c81b60b05b6f4859ffa4dbd13bb2557f3',
100
- class: "border-softer border-t-2"
99
+ key: '8a1fe80134dadd38d113968ad0c825a6f9426921',
100
+ class: "border-softer"
101
101
  }, this.iframeError ? h("div", {
102
102
  class: "container ml-8 mr-8 mt-16"
103
103
  }, this.errorMessage) : h("iframe", {
@@ -113,5 +113,6 @@ const EdsFrame = class {
113
113
  return getElement(this);
114
114
  }
115
115
  };
116
+ EdsFrame.style = EdsFrameStyle0;
116
117
 
117
118
  export { EdsFrame as eds_frame };
@@ -11,7 +11,7 @@ const EdsIconArrowDiagonal = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'd85a4d425e0c255efe4763d4a13f13b6ff727c2c',
14
+ key: '61fba958a683480dfd28e503b65a7dceb6640f46',
15
15
  class: this.addClass,
16
16
  innerHTML: arrowDiagonal
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconArrowRight = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '4a2b33b86753acab8270a45c7b250603b128bc88',
14
+ key: '823be807e649d4ddbd41c0628e2fda249a8c6f74',
15
15
  class: this.class,
16
16
  innerHTML: arrowRight
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconBluesky = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '845a157678b9d059b2c9bd8a6265d3a62f33c31a',
14
+ key: 'a06ab2e79a1ec7603244ec09649ccc2c9ea1950c',
15
15
  class: this.class,
16
16
  innerHTML: bluesky
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronDown = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'fa8022d27b91e909d4cd5522c6d0406be698a412',
14
+ key: 'c723d7f1bbd596063ae7e66123b8038af5320a54',
15
15
  class: this.class,
16
16
  innerHTML: chevronDown
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronLeft = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'c723d7f1bbd596063ae7e66123b8038af5320a54',
14
+ key: '5547e9d98f781dc03e88a014f726b3a402e6425d',
15
15
  class: this.class,
16
16
  innerHTML: chevronLeft
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronRight = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'f770cd9151077e8708c76d2082613c65a20c420f',
14
+ key: '177f447969a48957c54d011bfb72693731ecc1cf',
15
15
  class: this.class,
16
16
  innerHTML: chevronRight
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronUp = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '40d18a840277f2aba5d314a36fca5c1f8fd99cc6',
14
+ key: '7b8f0aa2da992611e0c908ca0785abce6e1ae189',
15
15
  class: this.class,
16
16
  innerHTML: chevronUp
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconClose = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '947f6615e8ee155be98b379a9c771cc0d453becd',
14
+ key: '8e4dedef0fe684fdd6078db8005661e49207da55',
15
15
  class: this.class,
16
16
  innerHTML: close
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconCopy = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '1e23d4493d5a1d07bc794da20cc4e445a87d56b0',
14
+ key: 'ff014a9761d8380a9fd8c97d3dd483b8d6fc786c',
15
15
  class: this.class,
16
16
  innerHTML: copy
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconEu = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '14254e1b9d43562e6f3f943de22aa8dd4d89a044',
14
+ key: '3888f0338df2496c334d95dbcb52a0e39906362d',
15
15
  class: this.class,
16
16
  innerHTML: euSvg
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconFacebook = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '902598891dfe926f92ce5d30dc135896c6eccd43',
14
+ key: '62aec1f1d6b8e4844be83c94471b64a30c1212b9',
15
15
  class: this.class,
16
16
  innerHTML: facebook
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconGitlab = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '128f9265dfc1aee95586ba0a3fd20dd131678893',
14
+ key: '54ba107f89476040a8efb43b9e1239316c81a43f',
15
15
  class: this.class,
16
16
  innerHTML: gitlabBlack
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconLinkedin = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '0f9675a371ca7bb460882c04bf2bb0c103273a0d',
14
+ key: '72eb0709ccbfc7830ab146f936a2587407feb0bb',
15
15
  class: this.class,
16
16
  innerHTML: linkedin
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconLoader = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'f11c60068baa2d2398056b3d7f04129d9deb4517',
14
+ key: '484dd0712392f0ea05389a0fc0039580f69ca37c',
15
15
  class: this.class,
16
16
  innerHTML: loader
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMastodon = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '1f68e5d0b6f8455f40bf94f6095eceff00b7887e',
14
+ key: '5388b5cef5d643984157e0bed9263e83934dc7e3',
15
15
  class: this.class,
16
16
  innerHTML: mastodon
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMenu = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '0084602c8e870b70caa66479f71bed3bd0cce94e',
14
+ key: 'dd9df55fa03c1b27f2f931c7d07ccc69ee940ff4',
15
15
  class: this.class,
16
16
  innerHTML: menu
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMore = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'dd9df55fa03c1b27f2f931c7d07ccc69ee940ff4',
14
+ key: 'dc06f1a54b9542cb2c0165fb3bdff960ecd81cc0',
15
15
  class: this.class,
16
16
  innerHTML: more
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconSearch = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '42acc730afd956c2884b0789b3ea37ccf323630b',
14
+ key: 'fc5e231865da99977c418a32e0fe30e36075f295',
15
15
  class: this.class,
16
16
  innerHTML: search
17
17
  });
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { s as star } from './star-0da9b5e9.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconStar = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'cb31d12146ff577195650b502f51005092404a30',
15
+ class: this.class,
16
+ innerHTML: star
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconStar as eds_icon_star };
@@ -11,7 +11,7 @@ const EdsIconSuccess = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '8b5d4cfeedf6d7e9bea48d7ba892527d484c858d',
14
+ key: '845a157678b9d059b2c9bd8a6265d3a62f33c31a',
15
15
  class: this.class,
16
16
  innerHTML: success
17
17
  });
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { t as thumbsDown } from './thumbs-down-a18fd049.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconThumbsDown = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '62cee210c76ea8c63367ad8ab9a9322707c933fd',
15
+ class: this.class,
16
+ innerHTML: thumbsDown
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconThumbsDown as eds_icon_thumbs_down };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { t as thumbsUp } from './thumbs-up-c19a71bc.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconThumbsUp = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'f72d46f6685d3251254eaa0a2c2ce8aaca177a2e',
15
+ class: this.class,
16
+ innerHTML: thumbsUp
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconThumbsUp as eds_icon_thumbs_up };
@@ -11,7 +11,7 @@ const EdsIconTwitter = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'a06ab2e79a1ec7603244ec09649ccc2c9ea1950c',
14
+ key: 'cd91bfb2003e955cfb02b5efc28e13b54cc3b7e6',
15
15
  class: this.class,
16
16
  innerHTML: twitter
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconUser = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'cb31d12146ff577195650b502f51005092404a30',
14
+ key: '15fa7c4b7d2dea5740d0926bb1ff6490b23667f8',
15
15
  class: this.class,
16
16
  innerHTML: user
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconYoutube = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '4eba69bfec926b7a3490feee15b5947a8ab8a7b9',
14
+ key: '1a7ad8d7cbef70822ebda2f152d8b537df1eaf27',
15
15
  class: this.class,
16
16
  innerHTML: youtube
17
17
  });
@@ -1,3 +1,9 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index.esm2.js';
2
+ import { t as toast } from './toastManager-d9eee791.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
1
7
  /*
2
8
  * Copyright 2016 Red Hat, Inc. and/or its affiliates
3
9
  * and other contributors as indicated by the @author tags.
@@ -1641,5 +1647,170 @@ async function checkServerAvailability(url) {
1641
1647
  return false;
1642
1648
  }
1643
1649
  }
1650
+ const EdsLogin = class {
1651
+ constructor(hostRef) {
1652
+ registerInstance(this, hostRef);
1653
+ this.keycloak = createEvent(this, "keycloak", 7);
1654
+ this.auth = createEvent(this, "auth", 7);
1655
+ /**
1656
+ * Handles user login by invoking the Keycloak `login` function.
1657
+ * Only triggers login if the user is not already authenticated.
1658
+ */
1659
+ this.handleLogin = async () => {
1660
+ if (!this.authenticated) {
1661
+ try {
1662
+ await login();
1663
+ } catch (error) {
1664
+ toast.show(error.message, 'error');
1665
+ }
1666
+ }
1667
+ };
1668
+ /**
1669
+ * Handles user logout by invoking the Keycloak `logout` function.
1670
+ * Resets the `authenticated` state to `false` after logout.
1671
+ */
1672
+ this.handleLogout = async () => {
1673
+ try {
1674
+ await logout();
1675
+ } catch (error) {
1676
+ toast.show(error.message, 'error');
1677
+ }
1678
+ this.authenticated = false;
1679
+ this.user = null;
1680
+ };
1681
+ this.keycloakUrl = undefined;
1682
+ this.keycloakRealm = undefined;
1683
+ this.keycloakClientId = undefined;
1684
+ this.authenticated = false;
1685
+ this.user = null;
1686
+ this.serverAvailable = false;
1687
+ }
1688
+ /**
1689
+ * Lifecycle method that runs when the component is about to load.
1690
+ * It initializes authentication by calling the `initAuth` method.
1691
+ */
1692
+ async componentWillLoad() {
1693
+ // Check if required props are provided (optional check)
1694
+ if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
1695
+ // eslint-disable-next-line
1696
+ console.error('Keycloak configuration props are missing.');
1697
+ return;
1698
+ }
1699
+ this.serverAvailable = await checkServerAvailability(`${this.keycloakUrl}/realms/${this.keycloakRealm}`);
1700
+ if (!this.serverAvailable) {
1701
+ toast.show('Keycloak server is unavailable.', 'error');
1702
+ return; // Do not proceed further
1703
+ }
1704
+ await this.initAuth();
1705
+ }
1706
+ /**
1707
+ * Initializes the Keycloak authentication by configuring Keycloak with the provided props.
1708
+ * Sets the `authenticated` state and `user` data if the user is authenticated.
1709
+ * Emits `authStatusChanged` event with the authentication status.
1710
+ */
1711
+ async initAuth() {
1712
+ try {
1713
+ const res = await initKeycloak({
1714
+ url: this.keycloakUrl,
1715
+ realm: this.keycloakRealm,
1716
+ clientId: this.keycloakClientId
1717
+ }, true);
1718
+ this.keycloak.emit({
1719
+ init: res
1720
+ });
1721
+ if (isAuthenticated()) {
1722
+ this.user = getUser();
1723
+ this.authenticated = true;
1724
+ this.auth.emit({
1725
+ authenticated: this.authenticated,
1726
+ user: this.user
1727
+ }); // Emit auth status change
1728
+ }
1729
+ } catch (error) {
1730
+ toast.show(error.message, 'error');
1731
+ }
1732
+ }
1733
+ render() {
1734
+ return h("div", {
1735
+ key: '074566b791eeb9ea4a0558b4ed83a96e4b673356',
1736
+ class: "block"
1737
+ }, !this.authenticated && h("eds-button", {
1738
+ key: '3a05ff97a90d73204eb77c5dad0d328294d72d3e',
1739
+ label: "Login",
1740
+ intent: "primary",
1741
+ "extra-class": "text-default",
1742
+ "aria-label": "Login",
1743
+ triggerClick: this.handleLogin.bind(this)
1744
+ }));
1745
+ }
1746
+ };
1747
+ const edsSplashScreenCss = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:200px;height:200px;margin-bottom:1rem}.content-container{position:relative;width:5rem;height:5rem;display:flex;align-items:center;justify-content:center}";
1748
+ const EdsSplashScreenStyle0 = edsSplashScreenCss;
1749
+ const EdsSplashScreen = class {
1750
+ constructor(hostRef) {
1751
+ registerInstance(this, hostRef);
1752
+ this.splash = createEvent(this, "splash", 7);
1753
+ this.inverse = false;
1754
+ this.initPromise = undefined;
1755
+ this.isVisible = true;
1756
+ }
1757
+ componentWillLoad() {
1758
+ // If an initialization promise is provided, wait for it.
1759
+ if (this.initPromise) {
1760
+ this.initPromise.then(() => {
1761
+ // eslint-disable-next-line
1762
+ console.log('Promises resolved');
1763
+ this.hideSplash();
1764
+ }).catch(error => {
1765
+ // eslint-disable-next-line
1766
+ console.error('Initialization error:', error);
1767
+ this.splash.emit({
1768
+ type: 'error',
1769
+ message: error.message || 'Unknown error'
1770
+ });
1771
+ //this.hideSplash();
1772
+ });
1773
+ }
1774
+ }
1775
+ handleHideSplash() {
1776
+ this.hideSplash();
1777
+ }
1778
+ hideSplash() {
1779
+ this.isVisible = false;
1780
+ this.splash.emit({
1781
+ type: 'hidden',
1782
+ message: 'Splash screen hidden successfully'
1783
+ });
1784
+ }
1785
+ render() {
1786
+ if (!this.isVisible) {
1787
+ return null;
1788
+ }
1789
+ return h(Host, null, h("div", {
1790
+ class: "splash-overlay",
1791
+ style: {
1792
+ background: this.inverse ? 'black' : 'var(--grey-200)'
1793
+ }
1794
+ }, h("div", {
1795
+ class: "logo-container"
1796
+ }, this.inverse ? h("eds-logo", {
1797
+ orientation: "vertical",
1798
+ type: "color-white"
1799
+ }) : h("eds-logo", {
1800
+ orientation: "vertical",
1801
+ type: "color"
1802
+ })), h("div", {
1803
+ class: "content-container"
1804
+ }, h("eds-spinner", {
1805
+ size: "1rem",
1806
+ thickness: "3px",
1807
+ "border-color": "var(--grey-400)",
1808
+ "bottom-color": "var(--grey-900)",
1809
+ background: "none",
1810
+ fullscreen: false
1811
+ }))));
1812
+ }
1813
+ };
1814
+ EdsSplashScreen.style = EdsSplashScreenStyle0;
1644
1815
 
1645
- export { logout as a, isAuthenticated as b, checkServerAvailability as c, getUser as g, initKeycloak as i, login as l };
1816
+ export { EdsLogin as eds_login, EdsSplashScreen as eds_splash_screen };
@@ -20,7 +20,7 @@ const EdsLogoVariations = class {
20
20
  }
21
21
  render() {
22
22
  return h("div", {
23
- key: '0494cbb3e7b4902e91a0c78c691bc3405b9f11cc',
23
+ key: '0b23fee608fcbe7059fce155bd65a0c0a4d16e07',
24
24
  class: "container"
25
25
  }, this.renderContent());
26
26
  }