@ebrains/react 0.0.1-alpha.0 → 0.2.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 (108) hide show
  1. package/README.md +4 -48
  2. package/arrow-diagonal-black-8f0494c3.esm.js +3 -0
  3. package/arrow-right-9322ba8a.esm.js +5 -0
  4. package/bluesky-cc5edd2d.esm.js +14 -0
  5. package/chevron-down-6144c823.esm.js +12 -0
  6. package/chevron-left-ca6c66e1.esm.js +11 -0
  7. package/chevron-right-b88ed2d4.esm.js +5 -0
  8. package/chevron-up-c66bd477.esm.js +12 -0
  9. package/close-87fc0d63.esm.js +5 -0
  10. package/color-0ba8ed56.esm.js +423 -0
  11. package/color-primary-palette_6.entry.esm.js +756 -0
  12. package/copy-03b72cb6.esm.js +5 -0
  13. package/correct-use-of-colors.entry.esm.js +243 -0
  14. package/eds-accordion.entry.esm.js +132 -0
  15. package/eds-alert_28.entry.esm.js +227 -0
  16. package/eds-block-break.entry.esm.js +22 -0
  17. package/eds-breadcrumb.entry.esm.js +169 -0
  18. package/eds-card-project.entry.esm.js +92 -0
  19. package/eds-card-section.entry.esm.js +60 -0
  20. package/eds-card-tags.entry.esm.js +27 -0
  21. package/eds-card-tool.entry.esm.js +106 -0
  22. package/eds-card-wrapper.entry.esm.js +39 -0
  23. package/eds-code-block.entry.esm.js +2243 -0
  24. package/eds-components-section.entry.esm.js +113 -0
  25. package/eds-docs-palettes.entry.esm.js +29 -0
  26. package/eds-docs-tokens.entry.esm.js +45 -0
  27. package/eds-footer.entry.esm.js +110 -0
  28. package/eds-frame.entry.esm.js +117 -0
  29. package/eds-fullscreen-menu.entry.esm.js +143 -0
  30. package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
  31. package/eds-icon-arrow-right.entry.esm.js +21 -0
  32. package/eds-icon-bluesky.entry.esm.js +21 -0
  33. package/eds-icon-chevron-down.entry.esm.js +21 -0
  34. package/eds-icon-chevron-left.entry.esm.js +21 -0
  35. package/eds-icon-chevron-right.entry.esm.js +21 -0
  36. package/eds-icon-chevron-up.entry.esm.js +21 -0
  37. package/eds-icon-close.entry.esm.js +21 -0
  38. package/eds-icon-copy.entry.esm.js +21 -0
  39. package/eds-icon-eu.entry.esm.js +21 -0
  40. package/eds-icon-facebook.entry.esm.js +21 -0
  41. package/eds-icon-gitlab.entry.esm.js +21 -0
  42. package/eds-icon-linkedin.entry.esm.js +21 -0
  43. package/eds-icon-loader.entry.esm.js +21 -0
  44. package/eds-icon-mastodon.entry.esm.js +21 -0
  45. package/eds-icon-menu.entry.esm.js +21 -0
  46. package/eds-icon-more.entry.esm.js +21 -0
  47. package/eds-icon-search.entry.esm.js +21 -0
  48. package/eds-icon-success.entry.esm.js +21 -0
  49. package/eds-icon-twitter.entry.esm.js +21 -0
  50. package/eds-icon-user.entry.esm.js +21 -0
  51. package/eds-icon-youtube.entry.esm.js +21 -0
  52. package/eds-login.entry.esm.js +84 -0
  53. package/eds-matomo-notice.entry.esm.js +129 -0
  54. package/eds-modal.entry.esm.js +114 -0
  55. package/eds-navigator.entry.esm.js +72 -0
  56. package/eds-pagination.entry.esm.js +258 -0
  57. package/eds-rating.entry.esm.js +71 -0
  58. package/eds-section-core_2.entry.esm.js +69 -0
  59. package/eds-social-networks.entry.esm.js +74 -0
  60. package/eds-svg-repository.entry.esm.js +316 -0
  61. package/eds-tab.entry.esm.js +41 -0
  62. package/eds-table.entry.esm.js +196 -0
  63. package/eds-tabs-content.entry.esm.js +145 -0
  64. package/eds-tabs.entry.esm.js +136 -0
  65. package/eds-tooltip.entry.esm.js +116 -0
  66. package/eu-9ddde93a.esm.js +30 -0
  67. package/facebook-9cb5c17f.esm.js +14 -0
  68. package/incorrect-use-of-colors.entry.esm.js +70 -0
  69. package/index-39c58238.esm.js +58 -0
  70. package/index.esm.js +3 -2668
  71. package/index.esm2.js +4783 -0
  72. package/keycloak-13893af6.esm.js +1594 -0
  73. package/linkedin-e8650abb.esm.js +28 -0
  74. package/loader-c9628637.esm.js +30 -0
  75. package/logo-color-7f1fd803.esm.js +115 -0
  76. package/logo-color-margins-ff8ce71b.esm.js +118 -0
  77. package/logo-space.entry.esm.js +32 -0
  78. package/logo-variations-horizontal.entry.esm.js +50 -0
  79. package/logo-variations-vertical.entry.esm.js +53 -0
  80. package/logo-white-no-bg-f382f86f.esm.js +1021 -0
  81. package/logo-wrong-usage.entry.esm.js +137 -0
  82. package/mastodon-3703ec61.esm.js +14 -0
  83. package/menu-340ea948.esm.js +11 -0
  84. package/mono-53f70232.esm.js +11 -0
  85. package/more-4449d549.esm.js +13 -0
  86. package/package.json +1 -1
  87. package/search-fbcd79c2.esm.js +12 -0
  88. package/src/components.d.ts +38 -0
  89. package/src/index.d.ts +1 -1
  90. package/src/react-component-lib/attachProps.d.ts +16 -0
  91. package/src/react-component-lib/case.d.ts +2 -0
  92. package/src/react-component-lib/createComponent.d.ts +10 -0
  93. package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
  94. package/src/react-component-lib/dev.d.ts +2 -0
  95. package/src/react-component-lib/index.d.ts +2 -0
  96. package/src/react-component-lib/interfaces.d.ts +29 -0
  97. package/src/react-component-lib/utils/attachProps.d.ts +16 -0
  98. package/src/react-component-lib/utils/case.d.ts +2 -0
  99. package/src/react-component-lib/utils/index.d.ts +10 -0
  100. package/success-443809da.esm.js +18 -0
  101. package/toastManager-d9eee791.esm.js +34 -0
  102. package/token-list_3.entry.esm.js +385 -0
  103. package/token-ratios.entry.esm.js +49 -0
  104. package/token-spacing.entry.esm.js +93 -0
  105. package/token-typography.entry.esm.js +264 -0
  106. package/twitter-ac21b505.esm.js +14 -0
  107. package/user-71ebdc15.esm.js +16 -0
  108. package/youtube-efbfbdc4.esm.js +14 -0
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { c as chevronRight } from './chevron-right-b88ed2d4.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconChevronRight = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '998491aed74bd3edd1fb8545f85ab52cf2703b3f',
15
+ class: this.class,
16
+ innerHTML: chevronRight
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconChevronRight as eds_icon_chevron_right };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { c as chevronUp } from './chevron-up-c66bd477.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconChevronUp = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'd0723afa766fc6dac454ec84602bd50ba4e49950',
15
+ class: this.class,
16
+ innerHTML: chevronUp
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconChevronUp as eds_icon_chevron_up };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { c as close } from './close-87fc0d63.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconClose = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '365ad476b1be9c708e73598cad1dd42a908fa1cd',
15
+ class: this.class,
16
+ innerHTML: close
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconClose as eds_icon_close };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { c as copy } from './copy-03b72cb6.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconCopy = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '770c34b98ec0e0a7e16de4d7b5b41b4afec9911e',
15
+ class: this.class,
16
+ innerHTML: copy
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconCopy as eds_icon_copy };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { e as euSvg } from './eu-9ddde93a.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconEu = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'cc6e5f7d7333ff7ed4a6f716e0ee90806fa782f9',
15
+ class: this.class,
16
+ innerHTML: euSvg
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconEu as eds_icon_eu };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { f as facebook } from './facebook-9cb5c17f.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconFacebook = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'f859db4f8b6679e138e6d72d1d0f5e5bd1bcf997',
15
+ class: this.class,
16
+ innerHTML: facebook
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconFacebook as eds_icon_facebook };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { g as gitlabBlack } from './mono-53f70232.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconGitlab = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '5a91cfc15c4dec2b50ce57fb0f1d6cc8f57b03e8',
15
+ class: this.class,
16
+ innerHTML: gitlabBlack
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconGitlab as eds_icon_gitlab };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { l as linkedin } from './linkedin-e8650abb.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconLinkedin = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'b8e0661a74a92c72b6db109cb48db12da48dcf92',
15
+ class: this.class,
16
+ innerHTML: linkedin
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconLinkedin as eds_icon_linkedin };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { l as loader } from './loader-c9628637.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconLoader = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '260c4eeb69ff79d943571c1461346b9019ea513a',
15
+ class: this.class,
16
+ innerHTML: loader
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconLoader as eds_icon_loader };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { m as mastodon } from './mastodon-3703ec61.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconMastodon = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '902598891dfe926f92ce5d30dc135896c6eccd43',
15
+ class: this.class,
16
+ innerHTML: mastodon
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconMastodon as eds_icon_mastodon };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { m as menu } from './menu-340ea948.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconMenu = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '9d15be28017eb074a69846a2a639861de997130b',
15
+ class: this.class,
16
+ innerHTML: menu
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconMenu as eds_icon_menu };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { m as more } from './more-4449d549.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconMore = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '0f7d61104f8f2b0a83c5b60a6ce81c6ab91ecb9c',
15
+ class: this.class,
16
+ innerHTML: more
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconMore as eds_icon_more };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { s as search } from './search-fbcd79c2.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconSearch = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '6795d973d3a1fff27c2fd6181235d0284abaf3b7',
15
+ class: this.class,
16
+ innerHTML: search
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconSearch as eds_icon_search };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { s as success } from './success-443809da.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconSuccess = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: '15e428fd72496249adfe372847d5c683cd3412b1',
15
+ class: this.class,
16
+ innerHTML: success
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconSuccess as eds_icon_success };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { t as twitter } from './twitter-ac21b505.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconTwitter = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'cfa2d903e79d5a17fb7511e078c0d26bd6d3abd6',
15
+ class: this.class,
16
+ innerHTML: twitter
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconTwitter as eds_icon_twitter };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { u as user } from './user-71ebdc15.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconUser = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'dc06f1a54b9542cb2c0165fb3bdff960ecd81cc0',
15
+ class: this.class,
16
+ innerHTML: user
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconUser as eds_icon_user };
@@ -0,0 +1,21 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { y as youtube } from './youtube-efbfbdc4.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsIconYoutube = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.class = '';
11
+ }
12
+ render() {
13
+ return h("span", {
14
+ key: 'ecd12a21c5797f93f7d8abe67803b27862967b2f',
15
+ class: this.class,
16
+ innerHTML: youtube
17
+ });
18
+ }
19
+ };
20
+
21
+ export { EdsIconYoutube as eds_icon_youtube };
@@ -0,0 +1,84 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
2
+ import { a as logout, i as initKeycloak, b as isAuthenticated, g as getUser, l as login } from './keycloak-13893af6.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const EdsLogin = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.authStatusChanged = createEvent(this, "authStatusChanged", 7);
11
+ // Method to handle user logout
12
+ this.handleLogout = () => {
13
+ logout();
14
+ this.authenticated = false; // Reset authentication state after logout
15
+ };
16
+ this.keycloakUrl = '';
17
+ this.keycloakRealm = '';
18
+ this.keycloakClientId = '';
19
+ this.authenticated = false;
20
+ this.user = null;
21
+ }
22
+ // Lifecycle method to check authentication status before the component loads
23
+ async componentWillLoad() {
24
+ await this.checkAuthentication();
25
+ }
26
+ // Method to initialize Keycloak and check if the user is authenticated
27
+ async checkAuthentication() {
28
+ try {
29
+ const keycloakConfig = {
30
+ url: this.keycloakUrl,
31
+ realm: this.keycloakRealm,
32
+ clientId: this.keycloakClientId
33
+ };
34
+ await initKeycloak(keycloakConfig);
35
+ // eslint-disable-next-line
36
+ // Set authentication state and fetch user data if authenticated
37
+ this.authenticated = isAuthenticated();
38
+ if (this.authenticated) {
39
+ this.user = getUser();
40
+ }
41
+ this.authStatusChanged.emit({
42
+ authenticated: this.authenticated,
43
+ user: this.user
44
+ }); // Emit auth status change
45
+ } catch (error) {
46
+ // eslint-disable-next-line
47
+ console.error('Keycloak initialization or login check failed:', error);
48
+ }
49
+ }
50
+ // Method to handle user login
51
+ async handleLogin() {
52
+ try {
53
+ if (!this.authenticated) {
54
+ login(); // Start the Keycloak login process
55
+ }
56
+ } catch (error) {
57
+ // eslint-disable-next-line
58
+ console.error('Login failed:', error);
59
+ }
60
+ }
61
+ getBtnLabel() {
62
+ return this.authenticated ? 'Logout' : 'Login';
63
+ }
64
+ render() {
65
+ return h("div", {
66
+ key: '3e9fdf8fa303948f00da83a1c8c1efc35e2c3c1a'
67
+ }, h("eds-button", {
68
+ key: '452b1c6ba9dda0ae5570accedf5e61b8391aeadb',
69
+ label: this.getBtnLabel(),
70
+ intent: "primary",
71
+ loading: false,
72
+ disabled: false,
73
+ pill: false,
74
+ icon: "arrow-diagonal",
75
+ size: "small",
76
+ "icon-pos": "right",
77
+ "aria-label": this.getBtnLabel(),
78
+ "element-type": "button",
79
+ triggerClick: this.authenticated ? this.handleLogout : this.handleLogin.bind(this)
80
+ }));
81
+ }
82
+ };
83
+
84
+ export { EdsLogin as eds_login };
@@ -0,0 +1,129 @@
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 './color-0ba8ed56.esm.js';
4
+ import 'react';
5
+ import 'react/jsx-runtime';
6
+ import 'react-dom';
7
+ import './index-39c58238.esm.js';
8
+
9
+ 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))}}";
10
+ const EdsMatomoNoticeStyle0 = edsMatomoNoticeCss;
11
+ const EdsMatomoNotice = class {
12
+ constructor(hostRef) {
13
+ registerInstance(this, hostRef);
14
+ this.title = 'Analytics Consent';
15
+ this.description = 'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.';
16
+ this.showNotice = true;
17
+ }
18
+ /**
19
+ * Lifecycle method called before the component is rendered.
20
+ * Checks for the presence of the "mtm_consent" cookie to determine
21
+ * if the notice should be displayed.
22
+ */
23
+ componentWillLoad() {
24
+ this.checkConsentCookie();
25
+ }
26
+ /**
27
+ * Lifecycle method called after the component has been rendered.
28
+ * Emits `parentContext` events for each `eds-button` in the shadow DOM.
29
+ */
30
+ componentDidLoad() {
31
+ const btns = this.el.shadowRoot.querySelectorAll('eds-button');
32
+ btns.forEach(b => {
33
+ this.emitContext(b);
34
+ });
35
+ }
36
+ /**
37
+ * Emits a custom `parentContext` event for a given button element.
38
+ * This can be used to provide context information about the component.
39
+ *
40
+ * @param linkElement - The button element to which the event will be dispatched.
41
+ */
42
+ emitContext(linkElement) {
43
+ const event = new CustomEvent('parentContext', {
44
+ detail: {
45
+ componentName: this.el.tagName.toLowerCase(),
46
+ identifier: null
47
+ }
48
+ });
49
+ linkElement.dispatchEvent(event);
50
+ }
51
+ /**
52
+ * Checks if the Matomo "mtm_consent" cookie exists in the browser.
53
+ * If the cookie is found, the notice is hidden.
54
+ */
55
+ checkConsentCookie() {
56
+ const consentCookie = document.cookie.split('; ').find(row => row.startsWith('mtm_consent='));
57
+ //this.showNotice = !consentCookie;
58
+ const sessionDeferred = sessionStorage.getItem('matomo-deferred');
59
+ this.showNotice = !consentCookie && !sessionDeferred;
60
+ }
61
+ /**
62
+ * Handles user consent for analytics tracking.
63
+ * Calls the `matomoOptIn` utility and shows a success toast notification.
64
+ */
65
+ optInAnalytics() {
66
+ matomoOptIn();
67
+ toast.show('You have opted in to analytics.', 'success');
68
+ this.hideNotice();
69
+ }
70
+ /**
71
+ * Handles user opt-out from analytics tracking.
72
+ * Calls the `matomoOptOut` utility and shows a warning toast notification.
73
+
74
+ private optOutAnalytics() {
75
+ matomoOptOut();
76
+ toast.show('You have opted out of analytics.', 'warning');
77
+ this.hideNotice();
78
+ }*/
79
+ /**
80
+ * Handles "Ask me later" action by storing a session storage entry
81
+ * and hiding the notice for the rest of the session.
82
+ */
83
+ deferDecision() {
84
+ sessionStorage.setItem('matomo-deferred', 'true');
85
+ toast.show('You can decide later.', 'warning');
86
+ this.hideNotice();
87
+ }
88
+ /**
89
+ * Hides the notice by updating the `showNotice` state.
90
+ */
91
+ hideNotice() {
92
+ this.showNotice = false;
93
+ }
94
+ /**
95
+ * Renders the Matomo consent notice with user options.
96
+ * Includes an accordion for the description and two buttons for user consent.
97
+ */
98
+ render() {
99
+ if (!this.showNotice) {
100
+ return null;
101
+ }
102
+ return h("div", {
103
+ 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"
104
+ }, h("eds-accordion", {
105
+ title: this.title,
106
+ description: this.description,
107
+ switchBg: true,
108
+ expanded: true
109
+ }, h("div", {
110
+ class: "flex items-center gap-4"
111
+ }, h("eds-button", {
112
+ intent: "primary",
113
+ label: "Yes, I agree",
114
+ "aria-label": "Opt-in for analytics",
115
+ onClick: () => this.optInAnalytics()
116
+ }), h("eds-button", {
117
+ intent: "ghost",
118
+ label: "Ask me later",
119
+ "aria-label": "Defer analytics decision",
120
+ onClick: () => this.deferDecision()
121
+ }))));
122
+ }
123
+ get el() {
124
+ return getElement(this);
125
+ }
126
+ };
127
+ EdsMatomoNotice.style = EdsMatomoNoticeStyle0;
128
+
129
+ export { EdsMatomoNotice as eds_matomo_notice };