@ebrains/components 0.5.0-alpha.0 → 0.6.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 (170) hide show
  1. package/dist/cjs/{analytics-223ea8e5.js → analytics-d8fb3fdd.js} +9 -0
  2. package/dist/cjs/components.cjs.js +1 -1
  3. package/dist/cjs/eds-accordion_13.cjs.entry.js +911 -0
  4. package/dist/cjs/eds-alert.cjs.entry.js +97 -0
  5. package/dist/cjs/eds-block-break.cjs.entry.js +21 -0
  6. package/dist/cjs/eds-breadcrumb.cjs.entry.js +149 -0
  7. package/dist/cjs/eds-card-project.cjs.entry.js +1 -1
  8. package/dist/cjs/eds-card-tool.cjs.entry.js +1 -1
  9. package/dist/cjs/eds-cookies-preference.cjs.entry.js +39 -0
  10. package/dist/cjs/eds-dropdown_2.cjs.entry.js +2 -2
  11. package/dist/cjs/eds-footer.cjs.entry.js +41 -0
  12. package/dist/cjs/eds-form.cjs.entry.js +1 -1
  13. package/dist/cjs/eds-fullscreen-menu.cjs.entry.js +100 -0
  14. package/dist/cjs/eds-header.cjs.entry.js +97 -0
  15. package/dist/cjs/eds-link.cjs.entry.js +214 -0
  16. package/dist/cjs/eds-login.cjs.entry.js +1 -1
  17. package/dist/cjs/eds-logo.cjs.entry.js +78 -0
  18. package/dist/cjs/eds-modal.cjs.entry.js +1 -1
  19. package/dist/cjs/eds-pagination_2.cjs.entry.js +1 -1
  20. package/dist/cjs/eds-rating.cjs.entry.js +58 -0
  21. package/dist/cjs/eds-social-networks.cjs.entry.js +66 -0
  22. package/dist/cjs/eds-steps.cjs.entry.js +65 -0
  23. package/dist/cjs/eds-switch.cjs.entry.js +38 -0
  24. package/dist/cjs/eds-tabs-content.cjs.entry.js +3 -3
  25. package/dist/cjs/eds-tabs.cjs.entry.js +2 -2
  26. package/dist/cjs/eds-tooltip.cjs.entry.js +1 -1
  27. package/dist/cjs/eds-user.cjs.entry.js +1 -1
  28. package/dist/cjs/index-f08e4f5c.js +52 -20
  29. package/dist/cjs/loader.cjs.js +1 -1
  30. package/dist/collection/collection-manifest.json +2 -1
  31. package/dist/collection/components/eds-accordion/eds-accordion.js +2 -2
  32. package/dist/collection/components/eds-button/eds-button.js +21 -16
  33. package/dist/collection/components/eds-link/eds-link.css +6793 -6676
  34. package/dist/collection/components/eds-matomo-notice/eds-matomo-notice.js +207 -0
  35. package/dist/collection/{shared-ui → components}/eds-matomo-notice/eds-matomo-notice.stories.js +1 -1
  36. package/dist/collection/components/eds-steps/eds-steps.css +60 -5
  37. package/dist/collection/components/eds-steps/eds-steps.js +5 -4
  38. package/dist/collection/components/eds-tag/eds-tag.js +4 -35
  39. package/dist/collection/components/eds-toast/eds-toast.css +91 -0
  40. package/dist/collection/components/eds-toast/eds-toast.js +18 -9
  41. package/dist/collection/shared-ui/eds-card-section/eds-card-section.css +236 -140
  42. package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +10 -10
  43. package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +2 -2
  44. package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.css +0 -0
  45. package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.js +87 -0
  46. package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.st.js +31 -0
  47. package/dist/collection/shared-ui/eds-footer/eds-footer.js +7 -53
  48. package/dist/collection/shared-ui/eds-header/eds-header.js +2 -2
  49. package/dist/collection/shared-ui/eds-login/eds-login.js +1 -1
  50. package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.js +1 -1
  51. package/dist/collection/shared-ui/eds-tabs/eds-tabs.js +1 -1
  52. package/dist/collection/shared-ui/eds-tabs-content/eds-tabs-content.js +2 -2
  53. package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.css +1 -1
  54. package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.js +2 -1
  55. package/dist/collection/shared-ui/eds-user/eds-user.js +1 -1
  56. package/dist/collection/shared-ui/eds-user-modal/eds-user-modal.js +1 -1
  57. package/dist/components/analytics.js +9 -1
  58. package/dist/components/components.css +520 -0
  59. package/dist/components/components.esm.js +1 -1
  60. package/dist/components/eds-accordion2.js +2 -2
  61. package/dist/components/eds-button2.js +11 -15
  62. package/dist/components/eds-card-section.js +4 -4
  63. package/dist/components/eds-cookies-preference.d.ts +11 -0
  64. package/dist/components/eds-cookies-preference.js +88 -0
  65. package/dist/components/eds-footer2.js +3 -13
  66. package/dist/components/eds-header.js +2 -2
  67. package/dist/components/eds-link2.js +1 -1
  68. package/dist/components/eds-login.js +1 -1
  69. package/dist/components/eds-matomo-notice.js +1 -140
  70. package/dist/components/eds-matomo-notice2.js +127 -0
  71. package/dist/components/eds-social-networks2.js +1 -1
  72. package/dist/components/eds-steps.js +7 -6
  73. package/dist/components/eds-tabs-content.js +2 -2
  74. package/dist/components/eds-tabs.js +1 -1
  75. package/dist/components/eds-tag2.js +1 -9
  76. package/dist/components/eds-toast-manager.js +4 -3
  77. package/dist/components/eds-toast2.js +13 -10
  78. package/dist/components/eds-user-modal2.js +1 -1
  79. package/dist/components/eds-user.js +1 -1
  80. package/dist/components/p-045681d7.entry.js +1 -0
  81. package/dist/components/p-0a3b2576.entry.js +1 -0
  82. package/dist/components/{p-92e16cc9.entry.js → p-10b81c47.entry.js} +1 -1
  83. package/dist/components/{p-89227919.js → p-13efafb9.js} +1 -1
  84. package/dist/components/{p-d69ef196.entry.js → p-1ae529f3.entry.js} +1 -1
  85. package/dist/components/p-21d42cf3.entry.js +1 -0
  86. package/dist/components/p-34a65e58.entry.js +1 -0
  87. package/dist/components/p-3a7aa1eb.entry.js +1 -0
  88. package/dist/components/p-42d3c324.entry.js +1 -0
  89. package/dist/components/{p-f08eac56.entry.js → p-4b3fbd6d.entry.js} +1 -1
  90. package/dist/components/p-4ea027ac.entry.js +1 -0
  91. package/dist/components/p-5097066f.entry.js +1 -0
  92. package/dist/components/p-5a2b8b6c.entry.js +1 -0
  93. package/dist/components/{p-72b42d77.entry.js → p-5ff31f14.entry.js} +1 -1
  94. package/dist/components/{p-030f67c1.entry.js → p-659ed449.entry.js} +1 -1
  95. package/dist/components/{p-75795b05.entry.js → p-7b3b26b0.entry.js} +1 -1
  96. package/dist/components/{p-0e0e1815.entry.js → p-88751c8b.entry.js} +1 -1
  97. package/dist/components/{p-8b583210.entry.js → p-9579f9c2.entry.js} +1 -1
  98. package/dist/components/p-b50c8d49.entry.js +1 -0
  99. package/dist/components/{p-59405ecf.entry.js → p-bd43d83c.entry.js} +1 -1
  100. package/dist/components/p-c683be2c.entry.js +1 -0
  101. package/dist/components/{p-209fa119.entry.js → p-d2a0b896.entry.js} +1 -1
  102. package/dist/components/p-d56d9dda.entry.js +1 -0
  103. package/dist/components/p-d5850ab3.entry.js +1 -0
  104. package/dist/components/p-e334f5bc.entry.js +1 -0
  105. package/dist/components/{p-def72462.entry.js → p-fad10768.entry.js} +1 -1
  106. package/dist/esm/{analytics-1cde8e4a.js → analytics-44b1416b.js} +9 -1
  107. package/dist/esm/components.js +1 -1
  108. package/dist/esm/eds-accordion_13.entry.js +895 -0
  109. package/dist/esm/eds-alert.entry.js +93 -0
  110. package/dist/esm/eds-block-break.entry.js +17 -0
  111. package/dist/esm/eds-breadcrumb.entry.js +145 -0
  112. package/dist/esm/eds-card-project.entry.js +1 -1
  113. package/dist/esm/eds-card-tool.entry.js +1 -1
  114. package/dist/esm/eds-cookies-preference.entry.js +35 -0
  115. package/dist/esm/eds-dropdown_2.entry.js +2 -2
  116. package/dist/esm/eds-footer.entry.js +37 -0
  117. package/dist/esm/eds-form.entry.js +1 -1
  118. package/dist/esm/eds-fullscreen-menu.entry.js +96 -0
  119. package/dist/esm/eds-header.entry.js +93 -0
  120. package/dist/esm/eds-link.entry.js +210 -0
  121. package/dist/esm/eds-login.entry.js +1 -1
  122. package/dist/esm/eds-logo.entry.js +74 -0
  123. package/dist/esm/eds-modal.entry.js +1 -1
  124. package/dist/esm/eds-pagination_2.entry.js +1 -1
  125. package/dist/esm/eds-rating.entry.js +54 -0
  126. package/dist/esm/eds-social-networks.entry.js +62 -0
  127. package/dist/esm/eds-steps.entry.js +61 -0
  128. package/dist/esm/eds-switch.entry.js +34 -0
  129. package/dist/esm/eds-tabs-content.entry.js +3 -3
  130. package/dist/esm/eds-tabs.entry.js +2 -2
  131. package/dist/esm/eds-tooltip.entry.js +1 -1
  132. package/dist/esm/eds-user.entry.js +1 -1
  133. package/dist/esm/index-e96badea.js +52 -20
  134. package/dist/esm/loader.js +1 -1
  135. package/dist/hydrate/index.js +148 -136
  136. package/dist/hydrate/index.mjs +148 -136
  137. package/dist/types/components/eds-button/eds-button.d.ts +3 -1
  138. package/dist/types/components/eds-matomo-notice/eds-matomo-notice.d.ts +53 -0
  139. package/dist/types/components/eds-steps/eds-steps.d.ts +0 -1
  140. package/dist/types/components/eds-tag/eds-tag.d.ts +1 -25
  141. package/dist/types/components/eds-toast/eds-toast.d.ts +4 -5
  142. package/dist/types/components.d.ts +101 -88
  143. package/dist/types/shared-ui/eds-card-section/eds-card-section.d.ts +5 -5
  144. package/dist/types/shared-ui/eds-card-section/eds-card-section.stories.d.ts +1 -1
  145. package/dist/types/shared-ui/eds-cookies-preference/eds-cookies-preference.d.ts +27 -0
  146. package/dist/types/shared-ui/eds-cookies-preference/eds-cookies-preference.st.d.ts +27 -0
  147. package/dist/types/shared-ui/eds-footer/eds-footer.d.ts +2 -15
  148. package/package.json +1 -1
  149. package/dist/cjs/eds-accordion.cjs.entry.js +0 -84
  150. package/dist/cjs/eds-alert_17.cjs.entry.js +0 -1392
  151. package/dist/cjs/eds-avatar_4.cjs.entry.js +0 -187
  152. package/dist/cjs/eds-card-generic.cjs.entry.js +0 -104
  153. package/dist/cjs/eds-card-section.cjs.entry.js +0 -55
  154. package/dist/cjs/eds-matomo-notice.cjs.entry.js +0 -109
  155. package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +0 -164
  156. package/dist/components/p-0bafc5ae.entry.js +0 -1
  157. package/dist/components/p-3babd772.entry.js +0 -1
  158. package/dist/components/p-505ddcda.entry.js +0 -1
  159. package/dist/components/p-8d19a05b.entry.js +0 -1
  160. package/dist/components/p-9826acae.entry.js +0 -1
  161. package/dist/components/p-eeeb0d83.entry.js +0 -1
  162. package/dist/esm/eds-accordion.entry.js +0 -80
  163. package/dist/esm/eds-alert_17.entry.js +0 -1372
  164. package/dist/esm/eds-avatar_4.entry.js +0 -180
  165. package/dist/esm/eds-card-generic.entry.js +0 -100
  166. package/dist/esm/eds-card-section.entry.js +0 -51
  167. package/dist/esm/eds-matomo-notice.entry.js +0 -105
  168. package/dist/types/shared-ui/eds-matomo-notice/eds-matomo-notice.d.ts +0 -77
  169. /package/dist/collection/{shared-ui → components}/eds-matomo-notice/eds-matomo-notice.css +0 -0
  170. /package/dist/types/{shared-ui → components}/eds-matomo-notice/eds-matomo-notice.stories.d.ts +0 -0
@@ -1,187 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f08e4f5c.js');
6
- const color = require('./color-c00146a8.js');
7
- const index$1 = require('./index-ab9fbefe.js');
8
-
9
- const edsAvatarCss = ".border-inside {\n position: relative;\n\n &::after {\n pointer-events: none;\n }\n\n &::after {\n position: absolute;\n }\n\n &::after {\n inset: 0rem;\n }\n\n &::after {\n z-index: 1;\n }\n\n &::after {\n border-radius: 8px;\n }\n\n &::after {\n border-width: 1px;\n }\n\n &::after {\n border-width: 2px;\n }\n\n &::after {\n border: 2px solid rgba(0, 0, 0, .1);\n }\n\n &::after {\n content: '';\n }\n}\n\n.border-inside-pill {\n &::after {\n border-radius: 100px;\n }\n\n &::after {\n content: '';\n }\n}\n\n.border-inside-inverse {\n &::after {\n border: 2px solid rgba(255, 255, 255, 0.3);\n }\n\n &::after {\n content: '';\n }\n}\n\n.aspect-1x1 {\n aspect-ratio: 1/1;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.overflow-hidden {\n overflow: hidden;\n}\n\n.px-4 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.rounded-pill {\n border-radius: 100px;\n}\n\n.rounded-sm {\n border-radius: 8px;\n}\n\n.rounded-xs {\n border-radius: 4px;\n}\n\n\n.bg-dark {\n background-color: var(--grey-300);\n}\n\n.bg-darker {\n background-color: var(--grey-400);\n}\n\n.bg-stronger {\n background-color: var(--grey-900);\n}\n\n.bg-strongest {\n background-color: var(--black);\n}\n\n.text-accent {\n color: var(--green-500);\n}\n\n.text-default {\n color: var(--black);\n}\n\n.\\!no-underline {\n text-decoration-line: none !important;\n}\n\n.f-ui-01 {\n font-family: var(--f-ui-01-fontFamily);\n font-weight: var(--f-ui-01-fontWeight);\n font-size: var(--f-ui-01-fontSize);\n line-height: var(--f-ui-01-lineHeight);\n letter-spacing: var(--f-ui-01-letterSpacing);\n}\n\n.w-32 {\n width: 2rem;\n}\n\n.w-44 {\n width: 2.75rem;\n}\n\n.w-\\[54px\\] {\n width: 54px;\n}";
10
- const EdsAvatarStyle0 = edsAvatarCss;
11
-
12
- const EdsAvatar = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.firstName = 'User';
16
- this.lastName = 'Avatar';
17
- this.picture = undefined;
18
- this.initials = undefined;
19
- this.color = undefined;
20
- this.rounded = false;
21
- this.initialsStrong = false;
22
- }
23
- /**
24
- * Computed initials based on the provided `initials` prop or derived from `firstName` and `lastName`.
25
- * @returns {string | undefined} Initials for display in the avatar.
26
- */
27
- get computedInitials() {
28
- if (this.initials) {
29
- return (this.initials.match(/.{1,3}/g) || [])[0] || '';
30
- }
31
- else if (this.firstName && this.lastName) {
32
- return `${this.firstName.charAt(0)}${this.lastName.charAt(0)}`.toUpperCase();
33
- }
34
- return undefined;
35
- }
36
- /**
37
- * Computes the CSS classes for the avatar container based on provided props like `rounded`, `color`, and `picture`.
38
- * @returns {string} List of CSS classes to apply to the avatar container.
39
- */
40
- get containerClasses() {
41
- return [
42
- 'border-inside',
43
- 'aspect-1x1',
44
- 'flex',
45
- 'items-center',
46
- 'justify-center',
47
- 'overflow-hidden',
48
- this.picture ? '' : 'px-4',
49
- this.rounded ? 'rounded-pill border-inside-pill w-32' : 'w-[54px] rounded-sm',
50
- this.color ? 'border-inside-inverse' : '',
51
- this.color === 'grey'
52
- ? 'bg-dark'
53
- : this.color && !this.picture
54
- ? color.gradientBGColorVariants({
55
- color: this.color,
56
- direction: 'top',
57
- pseudo: false
58
- })
59
- : !this.picture
60
- ? 'bg-strongest text-accent'
61
- : ''
62
- ].join(' ');
63
- }
64
- /**
65
- * Renders the avatar component. Displays either an image using `eds-img` or initials depending on whether `picture` or `computedInitials` is set.
66
- * @returns {JSX.Element} The rendered avatar component.
67
- */
68
- render() {
69
- return (index.h("div", { key: '47ee5ffd12c0f90c536dea77b3ffa9120d67f37f', class: this.containerClasses }, this.picture ? (index.h("eds-img", { src: this.picture, width: 54, height: 54, sizes: "120px", alt: `${this.firstName} ${this.lastName}`, lazyload: true, withBg: true })) : (index.h("abbr", { title: this.computedInitials || `${this.firstName} ${this.lastName}`, class: "!no-underline f-ui-01" }, this.computedInitials))));
70
- }
71
- };
72
- EdsAvatar.style = EdsAvatarStyle0;
73
-
74
- const edsCardDescCss = ".f-ui-02-light{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}.f-ui-03-light{font-family:var(--f-ui-03-light-fontFamily);font-weight:var(--f-ui-03-light-fontWeight);font-size:var(--f-ui-03-light-fontSize);line-height:var(--f-ui-03-light-lineHeight);letter-spacing:var(--f-ui-03-light-letterSpacing)}.text-light{color:var(--grey-700)}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}";
75
- const EdsCardDescStyle0 = edsCardDescCss;
76
-
77
- const EdsCardDesc = class {
78
- constructor(hostRef) {
79
- index.registerInstance(this, hostRef);
80
- this.description = undefined;
81
- this.descClass = 'f-ui-03-light';
82
- this.truncate = true;
83
- this.truncateLines = '3';
84
- }
85
- getTruncateClass() {
86
- return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
87
- }
88
- render() {
89
- return (index.h("p", { key: '71495cbd6ef4e7d66c4c22a37f8120624ecf57fb', class: `text-light ${this.descClass}` }, index.h("span", { key: '8708178f7b48cc1f31aac749f50fe92b72c39ab8', class: this.getTruncateClass() }, this.description)));
90
- }
91
- };
92
- EdsCardDesc.style = EdsCardDescStyle0;
93
-
94
- const edsCardTitleCss = "a{all:unset;display:inline;color:inherit;text-decoration:none;cursor:pointer}h1,h2,h3,h4,h5,h6{margin:0}.f-heading-01{font-family:var(--f-heading-01-fontFamily);font-weight:var(--f-heading-01-fontWeight);font-size:var(--f-heading-01-fontSize);line-height:var(--f-heading-01-lineHeight);letter-spacing:var(--f-heading-01-letterSpacing)}.f-heading-02{font-family:var(--f-heading-02-fontFamily);font-weight:var(--f-heading-02-fontWeight);font-size:var(--f-heading-02-fontSize);line-height:var(--f-heading-02-lineHeight);letter-spacing:var(--f-heading-02-letterSpacing)}.f-heading-03{font-family:var(--f-heading-03-fontFamily);font-weight:var(--f-heading-03-fontWeight);font-size:var(--f-heading-03-fontSize);line-height:var(--f-heading-03-lineHeight);letter-spacing:var(--f-heading-03-letterSpacing)}.f-heading-04{font-family:var(--f-heading-04-fontFamily);font-weight:var(--f-heading-04-fontWeight);font-size:var(--f-heading-04-fontSize);line-height:var(--f-heading-04-lineHeight);letter-spacing:var(--f-heading-04-letterSpacing)}.f-heading-05{font-family:var(--f-heading-05-fontFamily);font-weight:var(--f-heading-05-fontWeight);font-size:var(--f-heading-05-fontSize);line-height:var(--f-heading-05-lineHeight);letter-spacing:var(--f-heading-05-letterSpacing)}.f-heading-06{font-family:var(--f-heading-06-fontFamily);font-weight:var(--f-heading-06-fontWeight);font-size:var(--f-heading-06-fontSize);line-height:var(--f-heading-06-lineHeight);letter-spacing:var(--f-heading-06-letterSpacing)}.break-words{overflow-wrap:break-word}.after\\:absolute::after{position:absolute}.after\\:inset-0::after{inset:0rem}.after\\:z-10::after{z-index:10}.after\\:content-\\[\\'\\'\\]::after{--tw-content:'';content:var(--tw-content)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}";
95
- const EdsCardTitleStyle0 = edsCardTitleCss;
96
-
97
- const EdsCardTitle = class {
98
- constructor(hostRef) {
99
- index.registerInstance(this, hostRef);
100
- this.url = undefined;
101
- this.titleClass = undefined;
102
- this.headingLevel = 'h3';
103
- this.externalLink = false;
104
- this.cardTitle = undefined;
105
- this.hierarchy = true;
106
- }
107
- /**
108
- * Dynamically generate the title class based on the heading level.
109
- */
110
- getTitleClass() {
111
- const levelMap = this.hierarchy
112
- ? {
113
- h1: '05',
114
- h2: '05',
115
- h3: '05',
116
- h4: '05',
117
- h5: '05',
118
- h6: '06'
119
- }
120
- : {
121
- h1: '01',
122
- h2: '02',
123
- h3: '03',
124
- h4: '04',
125
- h5: '05',
126
- h6: '06'
127
- };
128
- return `f-heading-${levelMap[this.headingLevel]}`;
129
- }
130
- /*private getTag() {
131
- if (this.url) {
132
- return 'a';
133
- }
134
- return 'span';
135
- }*/
136
- render() {
137
- //const Tag = this.getTag();
138
- const Heading = this.headingLevel;
139
- return (index.h(Heading, { key: 'bb97dc6dd53adda14ef251b2ec32952791438986', class: this.getTitleClass() }, index.h("a", { key: '37b6ac0668257d27fb3f03a6225a2d48e1fd1f79', class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none", href: this.url, target: this.externalLink ? '_blank' : undefined, rel: this.externalLink ? 'noopener noreferrer' : undefined }, this.cardTitle)));
140
- }
141
- };
142
- EdsCardTitle.style = EdsCardTitleStyle0;
143
-
144
- const edsTagCss = ".f-ui-05{font-family:var(--f-ui-05-fontFamily);font-weight:var(--f-ui-05-fontWeight);font-size:var(--f-ui-05-fontSize);line-height:var(--f-ui-05-lineHeight);letter-spacing:var(--f-ui-05-letterSpacing)}.py-1{padding-top:0.0625rem;padding-bottom:0.0625rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.border-2{border-width:2px}.rounded-pill{border-radius:100px}.border-default{border:2px solid var(--black)}.text-inverse{color:var(--white)}.bg-strongest{background-color:var(--black)}.text-\\[\\#0034CB\\]{--tw-text-opacity:1;color:rgb(0 52 203 / var(--tw-text-opacity))}.border-\\[\\#0034CB\\]{--tw-border-opacity:1;border:2px solid rgb(0 52 203 / var(--tw-border-opacity))}.text-light{color:var(--grey-700)}.bg-strongest-soft{background-color:rgba(0, 0, 0, .05)}.border-transparent{border-color:var(--transparent)}.border-inverse{border-color:var(--white)}.bg-inverse{background-color:var(--white)}.text-lighter{color:var(--grey-600)}";
145
- const EdsTagStyle0 = edsTagCss;
146
-
147
- // Define the CVA for the tag styles
148
- const tagStyles = index$1.cva(['f-ui-05 py-1 px-4 border-2 rounded-pill'], // Base classes
149
- {
150
- variants: {
151
- intent: {
152
- default: 'border-default',
153
- strong: 'text-inverse bg-strongest border-default',
154
- accent: 'text-[#0034CB] border-[#0034CB]',
155
- weak: 'text-light bg-strongest-soft border-transparent',
156
- inverse: 'border-inverse text-inverse',
157
- 'inverse-strong': 'bg-inverse border-inverse text-lighter'
158
- }
159
- },
160
- defaultVariants: {
161
- intent: 'default'
162
- }
163
- });
164
- const EdsTag = class {
165
- constructor(hostRef) {
166
- index.registerInstance(this, hostRef);
167
- this.label = undefined;
168
- this.ariaLabel = '';
169
- this.intent = 'default';
170
- }
171
- /**
172
- * Render the component.
173
- * @returns The rendered HTML for the tag component with the applied styles and label.
174
- */
175
- render() {
176
- var _a;
177
- const classes = tagStyles({ intent: this.intent });
178
- const accessibleLabel = ((_a = this.ariaLabel) === null || _a === void 0 ? void 0 : _a.length) ? this.ariaLabel : this.label;
179
- return (index.h("span", { key: '6a517f42aeb641c95d96ecd6c3090a317a3195c6', class: classes, "aria-label": accessibleLabel }, this.label));
180
- }
181
- };
182
- EdsTag.style = EdsTagStyle0;
183
-
184
- exports.eds_avatar = EdsAvatar;
185
- exports.eds_card_desc = EdsCardDesc;
186
- exports.eds_card_title = EdsCardTitle;
187
- exports.eds_tag = EdsTag;
@@ -1,104 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f08e4f5c.js');
6
- const analytics = require('./analytics-223ea8e5.js');
7
-
8
- const edsCardGenericCss = ".h-auto{height:auto}.h-full{height:100%}.\\!min-h-20{min-height:1.25rem !important}.min-h-120{min-height:120px}.min-h-156{min-height:156px}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.effect-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.hover\\:shadow-hover:hover{--tw-shadow:0px 0px 16px rgba(0, 0, 0, 0.2);--tw-shadow-colored:0px 0px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.cursor-pointer{cursor:pointer}.border-soft{border-color:rgba(0, 0, 0, .15 )}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.effect-focus-within{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.effect-focus-within:focus-within{outline-style:solid}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grow{flex-grow:1}.flex-col{flex-direction:column}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-12{padding:0.75rem}.p-16{padding:1rem}.mt-6{margin-top:0.375rem}.mt-8{margin-top:0.5rem}.gap-y-4{row-gap:0.25rem}.order-first{order:-9999}.mb-10{margin-bottom:0.625rem}.mb-12{margin-bottom:0.75rem}";
9
- const EdsCardGenericStyle0 = edsCardGenericCss;
10
-
11
- const EdsCardGeneric = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.parentContext = null; // Accepts the entire event detail or null
15
- this.cardTitle = undefined;
16
- this.url = undefined;
17
- this.description = undefined;
18
- this.image = undefined;
19
- this.avatar = undefined;
20
- this.shortAbbreviation = undefined;
21
- this.headingLevel = 'h3';
22
- this.tags = [];
23
- this.tiny = false;
24
- this.bg = true;
25
- this.withHover = true;
26
- this.hierarchy = true;
27
- this.parsedImage = null;
28
- }
29
- componentWillLoad() {
30
- if (this.image) {
31
- try {
32
- if (typeof this.image === 'object') {
33
- // If image is already an object, assign it directly
34
- this.parsedImage = this.image;
35
- }
36
- else if (typeof this.image === 'string') {
37
- // If image is a string, try to parse it
38
- this.parsedImage = JSON.parse(this.image);
39
- }
40
- }
41
- catch (error) {
42
- // eslint-disable-next-line
43
- console.error('Error parsing image prop:', error);
44
- this.parsedImage = {}; // Assign a fallback empty object in case of an error
45
- }
46
- }
47
- }
48
- handleParentContext(event) {
49
- if (event.target !== this.el) {
50
- // Ignore the event if it's not targeted at this specific instance
51
- return;
52
- }
53
- //console.log(event.detail);
54
- this.parentContext = event.detail;
55
- event.stopPropagation();
56
- }
57
- /**
58
- * Parses the `tags` prop into an array of link objects.
59
- * Returns an empty array if parsing fails or if `tags` is not a valid JSON string or object.
60
- *
61
- * @returns {any[]} Array of parsed link objects
62
- */
63
- get parsedTags() {
64
- if (typeof this.tags === 'object') {
65
- return this.tags;
66
- }
67
- else if (typeof this.tags === 'string') {
68
- try {
69
- return JSON.parse(this.tags);
70
- }
71
- catch (e) {
72
- // eslint-disable-next-line
73
- console.error('Error parsing tags prop:', e);
74
- return [];
75
- }
76
- }
77
- return [];
78
- }
79
- articleClasses() {
80
- return [
81
- this.description ? (this.tiny ? 'min-h-120' : 'min-h-156') : 'h-auto',
82
- this.bg ? 'bg-inverse' : 'bg-default',
83
- this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '',
84
- 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'
85
- ].join(' ');
86
- }
87
- handleClick() {
88
- var _a;
89
- analytics.sendAnalytics({
90
- category: 'ui-component',
91
- parentContext: this.parentContext,
92
- tag: this.el.tagName.toLowerCase(),
93
- name: ((_a = this.cardTitle) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
94
- action: 'click'
95
- });
96
- }
97
- render() {
98
- return (index.h("article", { key: 'dcb7cea87bfb52f8886f7ee3dbc3484d615bc00c', class: this.articleClasses(), onClick: () => this.handleClick() }, index.h("eds-card-title", { key: '94dd6ff2679ce9ac4d25ec921cd1162b1584e4fd', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, hierarchy: this.hierarchy }), this.description && (index.h("eds-card-desc", { key: '433c4fe3a518153d89d48af54455286fa415a688', class: "mt-8", "truncate-lines": "3", description: this.description })), this.parsedImage ? (index.h("eds-img", Object.assign({ class: "mt-8" }, this.parsedImage))) : this.avatar || this.shortAbbreviation ? (index.h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, index.h("div", { key: '97b75afb4b8de1183d4b212054ff556ba3db8fcb', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index$1) => (index.h("eds-tag", { key: index$1, intent: tag.style, label: tag.label })))), ' '));
99
- }
100
- get el() { return index.getElement(this); }
101
- };
102
- EdsCardGeneric.style = EdsCardGenericStyle0;
103
-
104
- exports.eds_card_generic = EdsCardGeneric;
@@ -1,55 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f08e4f5c.js');
6
-
7
- const edsCardSectionCss = ".w-full{width:100%}.grid-layout{display:grid;grid-template-columns:repeat(var(--container-grid-columns, var(--grid-columns)), 1fr);grid-gap:var(--inner-gutter)}.grid-col-span-12{--container-grid-columns:12;grid-column:span 12 / span 12}.gap-y-4{row-gap:0.25rem}.gap-y-8{row-gap:0.5rem}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}@media (min-width: 750px){.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:gap-y-12{row-gap:0.75rem}.md\\:pt-28{padding-top:1.75rem}}@media (min-width: 750px){.md\\:grid-col-span-4{--container-grid-columns:4;grid-column:span 4 / span 4}.md\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.md\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:grid-col-span-5{--container-grid-columns:5;grid-column:span 5 / span 5}.lg\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.lg\\:grid-col-start-7{grid-column-start:7}.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-8-cols>*{--container-grid-columns:8}.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:order-last{order:9999}.lg\\:order-none{order:0}.lg\\:mt-0{margin-top:0rem}.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:w-\\[150px\\]{width:150px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[720px\\]{max-width:720px}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:gap-y-16{row-gap:1rem}.lg\\:px-28{padding-left:1.75rem;padding-right:1.75rem}.lg\\:\\!pl-12{padding-left:0.75rem !important}.lg\\:\\!pr-12{padding-right:0.75rem !important}}";
8
- const EdsCardSectionStyle0 = edsCardSectionCss;
9
-
10
- const EdsCardSection = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.cards = [];
14
- this.cols = 4;
15
- }
16
- /**
17
- * Parses the `cards` JSON string prop into an array of card objects.
18
- * If parsing fails, returns an empty array.
19
- *
20
- * @returns {any[]} An array of parsed card objects.
21
- */
22
- get parsedCards() {
23
- // If it's already an array, return it immediately.
24
- if (Array.isArray(this.cards)) {
25
- return this.cards;
26
- }
27
- if (typeof this.cards === 'object') {
28
- return this.cards;
29
- }
30
- else if (typeof this.cards === 'string') {
31
- try {
32
- return JSON.parse(this.cards);
33
- }
34
- catch (e) {
35
- // eslint-disable-next-line
36
- console.error('Error parsing cards prop:', e);
37
- return [];
38
- }
39
- }
40
- return [];
41
- }
42
- /**
43
- * Renders the card section as a grid layout.
44
- * Each parsed card object is mapped to an `<eds-card-generic>` component,
45
- * displaying card details such as title, description, avatar, etc.
46
- *
47
- * @returns {JSX.Element} The rendered section containing a list of cards.
48
- */
49
- render() {
50
- return (index.h("section", { key: '1f221e1ec7c3cdd0e3aed18f6f930c2c5456c64b', class: "w-full" }, index.h("ul", { key: '36f984994bb2dc247475c20422f7e6e7da7d058d', class: "grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16" }, this.parsedCards.map((card) => (index.h("li", { class: `grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col` }, index.h("eds-card-generic", { cardTitle: card.title, description: card.description, avatar: card.avatar, headingLevel: card.headingLevel, tags: card.tags, url: card.url, bg: card.bg, tiny: card.tiny, image: card.image, withHover: card.withHover })))))));
51
- }
52
- };
53
- EdsCardSection.style = EdsCardSectionStyle0;
54
-
55
- exports.eds_card_section = EdsCardSection;
@@ -1,109 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f08e4f5c.js');
6
- const toastManager = require('./toastManager-4e9535f3.js');
7
- const analytics = require('./analytics-223ea8e5.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
-
12
- const EdsMatomoNotice = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.title = 'Analytics Consent';
16
- this.description = 'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.';
17
- this.showNotice = true;
18
- }
19
- /**
20
- * Lifecycle method called before the component is rendered.
21
- * Checks for the presence of the "mtm_consent" cookie to determine
22
- * if the notice should be displayed.
23
- */
24
- componentWillLoad() {
25
- this.checkConsentCookie();
26
- }
27
- /**
28
- * Lifecycle method called after the component has been rendered.
29
- * Emits `parentContext` events for each `eds-button` in the shadow DOM.
30
- */
31
- componentDidLoad() {
32
- const btns = this.el.shadowRoot.querySelectorAll('eds-button');
33
- btns.forEach((b) => {
34
- this.emitContext(b);
35
- });
36
- }
37
- /**
38
- * Emits a custom `parentContext` event for a given button element.
39
- * This can be used to provide context information about the component.
40
- *
41
- * @param linkElement - The button element to which the event will be dispatched.
42
- */
43
- emitContext(linkElement) {
44
- const event = new CustomEvent('parentContext', {
45
- detail: {
46
- componentName: this.el.tagName.toLowerCase(),
47
- identifier: null
48
- }
49
- });
50
- linkElement.dispatchEvent(event);
51
- }
52
- /**
53
- * Checks if the Matomo "mtm_consent" cookie exists in the browser.
54
- * If the cookie is found, the notice is hidden.
55
- */
56
- checkConsentCookie() {
57
- const consentCookie = document.cookie.split('; ').find((row) => row.startsWith('mtm_consent='));
58
- //this.showNotice = !consentCookie;
59
- const sessionDeferred = sessionStorage.getItem('matomo-deferred');
60
- this.showNotice = !consentCookie && !sessionDeferred;
61
- }
62
- /**
63
- * Handles user consent for analytics tracking.
64
- * Calls the `matomoOptIn` utility and shows a success toast notification.
65
- */
66
- optInAnalytics() {
67
- analytics.matomoOptIn();
68
- toastManager.toast.show('You have opted in to analytics.', 'success');
69
- this.hideNotice();
70
- }
71
- /**
72
- * Handles user opt-out from analytics tracking.
73
- * Calls the `matomoOptOut` utility and shows a warning toast notification.
74
-
75
- private optOutAnalytics() {
76
- matomoOptOut();
77
- toast.show('You have opted out of analytics.', 'warning');
78
- this.hideNotice();
79
- }*/
80
- /**
81
- * Handles "Ask me later" action by storing a session storage entry
82
- * and hiding the notice for the rest of the session.
83
- */
84
- deferDecision() {
85
- sessionStorage.setItem('matomo-deferred', 'true');
86
- toastManager.toast.show('You can decide later.', 'warning');
87
- this.hideNotice();
88
- }
89
- /**
90
- * Hides the notice by updating the `showNotice` state.
91
- */
92
- hideNotice() {
93
- this.showNotice = false;
94
- }
95
- /**
96
- * Renders the Matomo consent notice with user options.
97
- * Includes an accordion for the description and two buttons for user consent.
98
- */
99
- render() {
100
- if (!this.showNotice) {
101
- return null;
102
- }
103
- return (index.h("div", { 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" }, index.h("eds-accordion", { title: this.title, description: this.description, switchBg: true, expanded: true }, index.h("div", { class: "flex items-center gap-4" }, index.h("eds-button", { intent: "primary", label: "Yes, I agree", "aria-label": "Opt-in for analytics", onClick: () => this.optInAnalytics() }), index.h("eds-button", { intent: "ghost", label: "Ask me later", "aria-label": "Defer analytics decision", onClick: () => this.deferDecision() })))));
104
- }
105
- get el() { return index.getElement(this); }
106
- };
107
- EdsMatomoNotice.style = EdsMatomoNoticeStyle0;
108
-
109
- exports.eds_matomo_notice = EdsMatomoNotice;
@@ -1,164 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { toast } from "../../utils/toastManager";
3
- import { matomoOptIn } from "../../utils/analytics";
4
- /**
5
- * A Stencil component for displaying a Matomo analytics consent notice.
6
- * Provides users with the option to opt in or opt out of anonymous analytics.
7
- */
8
- export class EdsMatomoNotice {
9
- constructor() {
10
- this.title = 'Analytics Consent';
11
- this.description = 'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.';
12
- this.showNotice = true;
13
- }
14
- /**
15
- * Lifecycle method called before the component is rendered.
16
- * Checks for the presence of the "mtm_consent" cookie to determine
17
- * if the notice should be displayed.
18
- */
19
- componentWillLoad() {
20
- this.checkConsentCookie();
21
- }
22
- /**
23
- * Lifecycle method called after the component has been rendered.
24
- * Emits `parentContext` events for each `eds-button` in the shadow DOM.
25
- */
26
- componentDidLoad() {
27
- const btns = this.el.shadowRoot.querySelectorAll('eds-button');
28
- btns.forEach((b) => {
29
- this.emitContext(b);
30
- });
31
- }
32
- /**
33
- * Emits a custom `parentContext` event for a given button element.
34
- * This can be used to provide context information about the component.
35
- *
36
- * @param linkElement - The button element to which the event will be dispatched.
37
- */
38
- emitContext(linkElement) {
39
- const event = new CustomEvent('parentContext', {
40
- detail: {
41
- componentName: this.el.tagName.toLowerCase(),
42
- identifier: null
43
- }
44
- });
45
- linkElement.dispatchEvent(event);
46
- }
47
- /**
48
- * Checks if the Matomo "mtm_consent" cookie exists in the browser.
49
- * If the cookie is found, the notice is hidden.
50
- */
51
- checkConsentCookie() {
52
- const consentCookie = document.cookie.split('; ').find((row) => row.startsWith('mtm_consent='));
53
- //this.showNotice = !consentCookie;
54
- const sessionDeferred = sessionStorage.getItem('matomo-deferred');
55
- this.showNotice = !consentCookie && !sessionDeferred;
56
- }
57
- /**
58
- * Handles user consent for analytics tracking.
59
- * Calls the `matomoOptIn` utility and shows a success toast notification.
60
- */
61
- optInAnalytics() {
62
- matomoOptIn();
63
- toast.show('You have opted in to analytics.', 'success');
64
- this.hideNotice();
65
- }
66
- /**
67
- * Handles user opt-out from analytics tracking.
68
- * Calls the `matomoOptOut` utility and shows a warning toast notification.
69
-
70
- private optOutAnalytics() {
71
- matomoOptOut();
72
- toast.show('You have opted out of analytics.', 'warning');
73
- this.hideNotice();
74
- }*/
75
- /**
76
- * Handles "Ask me later" action by storing a session storage entry
77
- * and hiding the notice for the rest of the session.
78
- */
79
- deferDecision() {
80
- sessionStorage.setItem('matomo-deferred', 'true');
81
- toast.show('You can decide later.', 'warning');
82
- this.hideNotice();
83
- }
84
- /**
85
- * Hides the notice by updating the `showNotice` state.
86
- */
87
- hideNotice() {
88
- this.showNotice = false;
89
- }
90
- /**
91
- * Renders the Matomo consent notice with user options.
92
- * Includes an accordion for the description and two buttons for user consent.
93
- */
94
- render() {
95
- if (!this.showNotice) {
96
- return null;
97
- }
98
- return (h("div", { 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" }, h("eds-accordion", { title: this.title, description: this.description, switchBg: true, expanded: true }, h("div", { class: "flex items-center gap-4" }, h("eds-button", { intent: "primary", label: "Yes, I agree", "aria-label": "Opt-in for analytics", onClick: () => this.optInAnalytics() }), h("eds-button", { intent: "ghost", label: "Ask me later", "aria-label": "Defer analytics decision", onClick: () => this.deferDecision() })))));
99
- }
100
- static get is() { return "eds-matomo-notice"; }
101
- static get encapsulation() { return "shadow"; }
102
- static get originalStyleUrls() {
103
- return {
104
- "$": ["eds-matomo-notice.css"]
105
- };
106
- }
107
- static get styleUrls() {
108
- return {
109
- "$": ["eds-matomo-notice.css"]
110
- };
111
- }
112
- static get properties() {
113
- return {
114
- "title": {
115
- "type": "string",
116
- "mutable": false,
117
- "complexType": {
118
- "original": "string",
119
- "resolved": "string",
120
- "references": {}
121
- },
122
- "required": false,
123
- "optional": false,
124
- "docs": {
125
- "tags": [{
126
- "name": "default",
127
- "text": "'Analytics Consent'"
128
- }],
129
- "text": "The title displayed in the notice."
130
- },
131
- "attribute": "title",
132
- "reflect": false,
133
- "defaultValue": "'Analytics Consent'"
134
- },
135
- "description": {
136
- "type": "string",
137
- "mutable": false,
138
- "complexType": {
139
- "original": "string",
140
- "resolved": "string",
141
- "references": {}
142
- },
143
- "required": false,
144
- "optional": false,
145
- "docs": {
146
- "tags": [{
147
- "name": "default",
148
- "text": "'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.'"
149
- }],
150
- "text": "The description displayed in the notice.\nExplains the purpose of collecting analytics data."
151
- },
152
- "attribute": "description",
153
- "reflect": false,
154
- "defaultValue": "'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.'"
155
- }
156
- };
157
- }
158
- static get states() {
159
- return {
160
- "showNotice": {}
161
- };
162
- }
163
- static get elementRef() { return "el"; }
164
- }
@@ -1 +0,0 @@
1
- import{r,h as n}from"./p-7a8b9de5.js";const i=class{constructor(n){r(this,n),this.cards=[],this.cols=4}get parsedCards(){if(Array.isArray(this.cards))return this.cards;if("object"==typeof this.cards)return this.cards;if("string"==typeof this.cards)try{return JSON.parse(this.cards)}catch(r){return console.error("Error parsing cards prop:",r),[]}return[]}render(){return n("section",{key:"1f221e1ec7c3cdd0e3aed18f6f930c2c5456c64b",class:"w-full"},n("ul",{key:"36f984994bb2dc247475c20422f7e6e7da7d058d",class:"grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16"},this.parsedCards.map((r=>n("li",{class:`grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col`},n("eds-card-generic",{cardTitle:r.title,description:r.description,avatar:r.avatar,headingLevel:r.headingLevel,tags:r.tags,url:r.url,bg:r.bg,tiny:r.tiny,image:r.image,withHover:r.withHover}))))))}};i.style=".w-full{width:100%}.grid-layout{display:grid;grid-template-columns:repeat(var(--container-grid-columns, var(--grid-columns)), 1fr);grid-gap:var(--inner-gutter)}.grid-col-span-12{--container-grid-columns:12;grid-column:span 12 / span 12}.gap-y-4{row-gap:0.25rem}.gap-y-8{row-gap:0.5rem}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}@media (min-width: 750px){.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:gap-y-12{row-gap:0.75rem}.md\\:pt-28{padding-top:1.75rem}}@media (min-width: 750px){.md\\:grid-col-span-4{--container-grid-columns:4;grid-column:span 4 / span 4}.md\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.md\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:grid-col-span-5{--container-grid-columns:5;grid-column:span 5 / span 5}.lg\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.lg\\:grid-col-start-7{grid-column-start:7}.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-8-cols>*{--container-grid-columns:8}.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:order-last{order:9999}.lg\\:order-none{order:0}.lg\\:mt-0{margin-top:0rem}.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:w-\\[150px\\]{width:150px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[720px\\]{max-width:720px}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:gap-y-16{row-gap:1rem}.lg\\:px-28{padding-left:1.75rem;padding-right:1.75rem}.lg\\:\\!pl-12{padding-left:0.75rem !important}.lg\\:\\!pr-12{padding-right:0.75rem !important}}";export{i as eds_card_section}