@ebrains/react 0.9.2-beta → 0.9.3-beta

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 (178) hide show
  1. package/analytics-44b1416b.esm.js +55 -0
  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/bookmark-c200037c.esm.js +16 -0
  6. package/chevron-down-6144c823.esm.js +12 -0
  7. package/chevron-left-ca6c66e1.esm.js +11 -0
  8. package/chevron-right-b88ed2d4.esm.js +5 -0
  9. package/chevron-up-c66bd477.esm.js +12 -0
  10. package/close-87fc0d63.esm.js +5 -0
  11. package/color-2554aad6.esm.js +122 -0
  12. package/color-primary-palette_6.entry.esm.js +778 -0
  13. package/components-section.entry.esm.js +165 -0
  14. package/copy-03b72cb6.esm.js +5 -0
  15. package/correct-use-of-colors.entry.esm.js +243 -0
  16. package/docs-palettes.entry.esm.js +29 -0
  17. package/docs-tokens.entry.esm.js +45 -0
  18. package/eds-accordion.entry.esm.js +132 -0
  19. package/eds-alert.entry.esm.js +112 -0
  20. package/eds-app-root.entry.esm.js +53 -0
  21. package/eds-avatar_27.entry.esm.js +332 -0
  22. package/eds-card-desc_2.entry.esm.js +86 -0
  23. package/eds-card-generic.entry.esm.js +114 -0
  24. package/eds-card-project.entry.esm.js +93 -0
  25. package/eds-card-section.entry.esm.js +56 -0
  26. package/eds-card-tags.entry.esm.js +27 -0
  27. package/eds-card-tool.entry.esm.js +105 -0
  28. package/eds-card-wrapper.entry.esm.js +39 -0
  29. package/eds-code-block.entry.esm.js +2290 -0
  30. package/eds-cookies-preference.entry.esm.js +47 -0
  31. package/eds-feedback.entry.esm.js +82 -0
  32. package/eds-frame.entry.esm.js +112 -0
  33. package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
  34. package/eds-icon-arrow-right.entry.esm.js +21 -0
  35. package/eds-icon-bluesky.entry.esm.js +21 -0
  36. package/eds-icon-bookmark.entry.esm.js +21 -0
  37. package/eds-icon-chevron-down.entry.esm.js +21 -0
  38. package/eds-icon-chevron-left.entry.esm.js +21 -0
  39. package/eds-icon-chevron-right.entry.esm.js +21 -0
  40. package/eds-icon-chevron-up.entry.esm.js +21 -0
  41. package/eds-icon-close.entry.esm.js +21 -0
  42. package/eds-icon-copy.entry.esm.js +21 -0
  43. package/eds-icon-eu.entry.esm.js +21 -0
  44. package/eds-icon-external.entry.esm.js +21 -0
  45. package/eds-icon-facebook.entry.esm.js +21 -0
  46. package/eds-icon-gitlab.entry.esm.js +21 -0
  47. package/eds-icon-linkedin.entry.esm.js +21 -0
  48. package/eds-icon-loader.entry.esm.js +21 -0
  49. package/eds-icon-mastodon.entry.esm.js +21 -0
  50. package/eds-icon-menu.entry.esm.js +21 -0
  51. package/eds-icon-minus.entry.esm.js +21 -0
  52. package/eds-icon-more.entry.esm.js +21 -0
  53. package/eds-icon-paper.entry.esm.js +21 -0
  54. package/eds-icon-plus.entry.esm.js +21 -0
  55. package/eds-icon-portal.entry.esm.js +21 -0
  56. package/eds-icon-private.entry.esm.js +21 -0
  57. package/eds-icon-public.entry.esm.js +21 -0
  58. package/eds-icon-search.entry.esm.js +21 -0
  59. package/eds-icon-star.entry.esm.js +21 -0
  60. package/eds-icon-success.entry.esm.js +21 -0
  61. package/eds-icon-thumbs-down.entry.esm.js +21 -0
  62. package/eds-icon-thumbs-up.entry.esm.js +21 -0
  63. package/eds-icon-tutorial.entry.esm.js +21 -0
  64. package/eds-icon-twitter.entry.esm.js +21 -0
  65. package/eds-icon-unknown.entry.esm.js +21 -0
  66. package/eds-icon-updown.entry.esm.js +21 -0
  67. package/eds-icon-user.entry.esm.js +21 -0
  68. package/eds-icon-youtube.entry.esm.js +21 -0
  69. package/eds-login_2.entry.esm.js +1828 -0
  70. package/eds-matomo-notice.entry.esm.js +162 -0
  71. package/eds-pagination_2.entry.esm.js +493 -0
  72. package/eds-progress-bar.entry.esm.js +41 -0
  73. package/eds-rating.entry.esm.js +79 -0
  74. package/eds-section-core_2.entry.esm.js +69 -0
  75. package/eds-spinner.entry.esm.js +67 -0
  76. package/eds-switch.entry.esm.js +58 -0
  77. package/eds-tabs.entry.esm.js +143 -0
  78. package/eds-timeline.entry.esm.js +117 -0
  79. package/eds-toast-manager.entry.esm.js +62 -0
  80. package/eds-toast.entry.esm.js +92 -0
  81. package/eds-tooltip.entry.esm.js +125 -0
  82. package/eds-trl.entry.esm.js +68 -0
  83. package/eu-9ddde93a.esm.js +30 -0
  84. package/facebook-9cb5c17f.esm.js +14 -0
  85. package/incorrect-use-of-colors.entry.esm.js +71 -0
  86. package/index-39c58238.esm.js +58 -0
  87. package/index.esm.d.ts +1 -0
  88. package/index.esm.js +4 -0
  89. package/index.esm2.js +4833 -0
  90. package/linkedin-e8650abb.esm.js +28 -0
  91. package/loader-c9628637.esm.js +30 -0
  92. package/logo-color-7f1fd803.esm.js +115 -0
  93. package/logo-color-margins-ff8ce71b.esm.js +118 -0
  94. package/logo-space.entry.esm.js +48 -0
  95. package/logo-variations-horizontal_2.entry.esm.js +123 -0
  96. package/logo-variations-tabs.entry.esm.js +29 -0
  97. package/logo-white-no-bg-f382f86f.esm.js +1021 -0
  98. package/logo-wrong-usage.entry.esm.js +101 -0
  99. package/mastodon-3703ec61.esm.js +14 -0
  100. package/menu-340ea948.esm.js +11 -0
  101. package/minus-b30a7c71.esm.js +11 -0
  102. package/mono-53f70232.esm.js +11 -0
  103. package/more-4449d549.esm.js +13 -0
  104. package/package.json +6 -2
  105. package/paper-8e74ea31.esm.js +15 -0
  106. package/plus-89c07be2.esm.js +12 -0
  107. package/portal-d6c8ce56.esm.js +18 -0
  108. package/private-1c25ff8e.esm.js +25 -0
  109. package/public-d4d8c585.esm.js +16 -0
  110. package/search-fbcd79c2.esm.js +12 -0
  111. package/sharedUtils-a550989c.esm.js +17 -0
  112. package/src/components.d.ts +40 -0
  113. package/src/generated/components.d.ts +38 -0
  114. package/src/generated/react-component-lib/attachProps.d.ts +16 -0
  115. package/src/generated/react-component-lib/case.d.ts +2 -0
  116. package/src/generated/react-component-lib/createComponent.d.ts +10 -0
  117. package/src/generated/react-component-lib/createOverlayComponent.d.ts +21 -0
  118. package/src/generated/react-component-lib/dev.d.ts +2 -0
  119. package/src/generated/react-component-lib/interfaces.d.ts +29 -0
  120. package/src/generated/react-component-lib/utils/attachProps.d.ts +16 -0
  121. package/src/generated/react-component-lib/utils/case.d.ts +2 -0
  122. package/src/generated/react-component-lib/utils/dev.d.ts +2 -0
  123. package/src/generated/react-component-lib/utils/index.d.ts +10 -0
  124. package/src/react-component-lib/attachProps.d.ts +16 -0
  125. package/src/react-component-lib/case.d.ts +2 -0
  126. package/src/react-component-lib/createComponent.d.ts +10 -0
  127. package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
  128. package/src/react-component-lib/dev.d.ts +2 -0
  129. package/src/react-component-lib/interfaces.d.ts +29 -0
  130. package/src/react-component-lib/utils/attachProps.d.ts +16 -0
  131. package/src/react-component-lib/utils/case.d.ts +2 -0
  132. package/src/react-component-lib/utils/index.d.ts +10 -0
  133. package/star-0da9b5e9.esm.js +5 -0
  134. package/success-443809da.esm.js +18 -0
  135. package/svg-repository.entry.esm.js +337 -0
  136. package/thumbs-down-a18fd049.esm.js +5 -0
  137. package/thumbs-up-c19a71bc.esm.js +6 -0
  138. package/toastManager-d9eee791.esm.js +34 -0
  139. package/token-list_3.entry.esm.js +385 -0
  140. package/token-ratios.entry.esm.js +49 -0
  141. package/token-typography.entry.esm.js +267 -0
  142. package/tutotial-150ee1fd.esm.js +27 -0
  143. package/twitter-ac21b505.esm.js +14 -0
  144. package/unknown-ed01a24c.esm.js +22 -0
  145. package/up-and-down-d747abee.esm.js +12 -0
  146. package/user-71ebdc15.esm.js +16 -0
  147. package/youtube-efbfbdc4.esm.js +14 -0
  148. package/.babelrc +0 -12
  149. package/project.json +0 -10
  150. package/rollup.config.js +0 -43
  151. package/src/components.ts +0 -49
  152. package/src/generated/components.ts +0 -47
  153. package/src/generated/react-component-lib/attachProps.ts +0 -125
  154. package/src/generated/react-component-lib/case.ts +0 -7
  155. package/src/generated/react-component-lib/createComponent.tsx +0 -106
  156. package/src/generated/react-component-lib/createOverlayComponent.tsx +0 -142
  157. package/src/generated/react-component-lib/dev.ts +0 -14
  158. package/src/generated/react-component-lib/index.tsx +0 -50
  159. package/src/generated/react-component-lib/interfaces.ts +0 -34
  160. package/src/generated/react-component-lib/utils/attachProps.ts +0 -125
  161. package/src/generated/react-component-lib/utils/case.ts +0 -7
  162. package/src/generated/react-component-lib/utils/dev.ts +0 -14
  163. package/src/generated/react-component-lib/utils/index.tsx +0 -50
  164. package/src/react-component-lib/attachProps.ts +0 -125
  165. package/src/react-component-lib/case.ts +0 -7
  166. package/src/react-component-lib/createComponent.tsx +0 -106
  167. package/src/react-component-lib/createOverlayComponent.tsx +0 -142
  168. package/src/react-component-lib/dev.ts +0 -14
  169. package/src/react-component-lib/index.tsx +0 -50
  170. package/src/react-component-lib/interfaces.ts +0 -34
  171. package/src/react-component-lib/utils/attachProps.ts +0 -125
  172. package/src/react-component-lib/utils/case.ts +0 -7
  173. package/src/react-component-lib/utils/index.tsx +0 -50
  174. package/tsconfig.json +0 -17
  175. package/tsconfig.lib.json +0 -23
  176. /package/src/generated/react-component-lib/{index.ts → index.d.ts} +0 -0
  177. /package/src/{index.ts → index.d.ts} +0 -0
  178. /package/src/react-component-lib/{index.ts → index.d.ts} +0 -0
@@ -0,0 +1,62 @@
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 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsToastManagerCss = ".toast-container{position:fixed;top:1rem;left:50%;transform:translateX(-50%);z-index:99999;display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%;max-width:36rem;}.toast-wrapper{width:100%;padding:0 1rem;}.eds-toast{box-shadow:0px 4px 6px rgba(0, 0, 0, 0.1);border-radius:0.5rem;animation:fade-in 0.3s ease-out;}@keyframes fade-in{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}";
8
+ const EdsToastManagerStyle0 = edsToastManagerCss;
9
+ const EdsToastManager = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.toastId = 0;
13
+ this.toasts = [];
14
+ }
15
+ connectedCallback() {
16
+ // Initialize the ToastManager singleton with this element
17
+ toast.init(this.hostElement);
18
+ // Listen for custom events
19
+ this.hostElement.addEventListener('show-toast', event => {
20
+ const {
21
+ message,
22
+ intent
23
+ } = event.detail;
24
+ this.addToast(message, intent);
25
+ });
26
+ }
27
+ /**
28
+ * Adds a new toast.
29
+ */
30
+ addToast(message, intent) {
31
+ const id = this.toastId++;
32
+ this.toasts = [...this.toasts, {
33
+ id,
34
+ message,
35
+ intent
36
+ }];
37
+ }
38
+ /**
39
+ * Removes a toast by ID.
40
+ */
41
+ removeToast(id) {
42
+ this.toasts = this.toasts.filter(t => t.id !== id);
43
+ }
44
+ render() {
45
+ return h("div", {
46
+ key: 'cc2aa94e01507dc8c27e82dfa550af5da6eaba3e',
47
+ class: "toast-container"
48
+ }, this.toasts.map(t => h("div", {
49
+ key: t.id
50
+ }, h("eds-toast", {
51
+ message: t.message,
52
+ intent: t.intent,
53
+ onClick: () => this.removeToast(t.id)
54
+ }))));
55
+ }
56
+ get hostElement() {
57
+ return getElement(this);
58
+ }
59
+ };
60
+ EdsToastManager.style = EdsToastManagerStyle0;
61
+
62
+ export { EdsToastManager as eds_toast_manager };
@@ -0,0 +1,92 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { c as cva } from './index-39c58238.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsToastCss = ".relative{position:relative}.right-4{right:0.25rem}.bottom-4{bottom:0.25rem}.w-auto{width:auto}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:0.25rem}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.ml-8{margin-left:0.5rem}.p-12{padding:0.75rem}.rounded-lg{border-radius:16px}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),\n 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.bg-dark{background-color:var(--grey-300)}.bg-success{background-color:var(--green-200)}.bg-error{background-color:var(--red-200)}.bg-warning{background-color:var(--yellow-200)}.text-light{color:var(--grey-700)}.text-current{color:currentColor}.text-default{color:var(--black)}";
8
+ const EdsToastStyle0 = edsToastCss;
9
+ const toastStyles = cva(['relative right-4 bottom-4 w-auto p-12 rounded-lg shadow-md'], {
10
+ variants: {
11
+ intent: {
12
+ default: 'bg-dark text-light',
13
+ success: 'bg-success text-dark',
14
+ error: 'bg-error text-light',
15
+ warning: 'bg-warning text-dark'
16
+ }
17
+ },
18
+ defaultVariants: {
19
+ intent: 'default'
20
+ }
21
+ });
22
+ const EdsToast = class {
23
+ constructor(hostRef) {
24
+ registerInstance(this, hostRef);
25
+ /**
26
+ * Dismisses the toast.
27
+ */
28
+ this.dismissToast = () => {
29
+ this.visible = false;
30
+ };
31
+ this.message = undefined;
32
+ this.intent = 'default';
33
+ this.duration = 5000;
34
+ this.visible = true;
35
+ }
36
+ componentDidLoad() {
37
+ const btn = this.el.shadowRoot.querySelector('eds-button');
38
+ this.emitContext(btn);
39
+ }
40
+ /**
41
+ * Emits a custom event called `parentContext` for a given button element.
42
+ * This event provides context information about the toast component.
43
+ *
44
+ * @param btnElement - The link element to which the event will be dispatched.
45
+ */
46
+ emitContext(btnElement) {
47
+ const event = new CustomEvent('parentContext', {
48
+ detail: {
49
+ componentName: this.el.tagName.toLowerCase(),
50
+ identifier: null
51
+ }
52
+ });
53
+ btnElement.dispatchEvent(event);
54
+ }
55
+ connectedCallback() {
56
+ // Auto-dismiss the toast after the specified duration
57
+ this.dismissTimeout = setTimeout(this.dismissToast, this.duration);
58
+ }
59
+ disconnectedCallback() {
60
+ // Clear the timeout when the component is removed
61
+ clearTimeout(this.dismissTimeout);
62
+ }
63
+ render() {
64
+ if (!this.visible) {
65
+ return null;
66
+ }
67
+ const classes = toastStyles({
68
+ intent: this.intent
69
+ });
70
+ return h("div", {
71
+ class: classes,
72
+ role: "alert",
73
+ "aria-live": "assertive"
74
+ }, h("div", {
75
+ class: "flex items-center justify-between gap-4"
76
+ }, h("span", {
77
+ class: "f-ui-01"
78
+ }, this.message), h("eds-button", {
79
+ intent: "tertiary",
80
+ icon: "close",
81
+ "aria-label": "Close Toast",
82
+ onClick: () => this.dismissToast(),
83
+ "extra-class": "ml-8"
84
+ })));
85
+ }
86
+ get el() {
87
+ return getElement(this);
88
+ }
89
+ };
90
+ EdsToast.style = EdsToastStyle0;
91
+
92
+ export { EdsToast as eds_toast };
@@ -0,0 +1,125 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './analytics-44b1416b.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsTooltipCss = ".relative{position:relative}.absolute{position:absolute}.rounded-sm{border-radius:8px}.rounded-xs{border-radius:4px}.bg-stronger{background-color:var(--grey-900)}.bg-strongest{background-color:var(--black)}.text-inverse{color:var(--white)}.text-default{color:var(--black)}.f-ui-03{font-family:var(--f-ui-03-fontFamily);font-weight:var(--f-ui-03-fontWeight);font-size:var(--f-ui-03-fontSize);line-height:var(--f-ui-03-lineHeight);letter-spacing:var(--f-ui-03-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)}.pointer-events-none{pointer-events:none}.-top-8{top:-0.5rem}.left-1\\/2{left:50%}.z-10{z-index:10}.block{display:block}.-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))}.-translate-y-full{--tw-translate-y:-100%;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))}.whitespace-nowrap{white-space:nowrap}.py-2{padding-top:0.125rem;padding-bottom:0.125rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.p-4{padding:0.25rem}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.p-12{padding:0.75rem}.p-16{padding:1rem}.p-20{padding:1.25rem}";
8
+ const EdsTooltipStyle0 = edsTooltipCss;
9
+ const EdsTooltip = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.content = undefined;
13
+ this.position = 'above';
14
+ this.isVisible = false;
15
+ this.isPositioned = false;
16
+ this.tooltipStyle = {
17
+ top: '0px',
18
+ left: '0px',
19
+ transform: ''
20
+ };
21
+ }
22
+ /**
23
+ * Show the tooltip and update its position.
24
+ */
25
+ async showTooltip() {
26
+ var _a;
27
+ await this.updateTooltipPosition();
28
+ this.isPositioned = true;
29
+ this.isVisible = true;
30
+ sendAnalytics({
31
+ category: 'ui-component',
32
+ parentContext: null,
33
+ tag: this.el.tagName.toLowerCase(),
34
+ name: ((_a = this.content) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
35
+ action: 'hover'
36
+ });
37
+ }
38
+ /**
39
+ * Hide the tooltip.
40
+ */
41
+ hideTooltip() {
42
+ this.isVisible = false;
43
+ this.isPositioned = false; // Reset positioning when hiding
44
+ }
45
+ /**
46
+ * Hide the tooltip when the `Escape` key is pressed.
47
+ */
48
+ handleKeyPress(event) {
49
+ if (event.key === 'Escape') {
50
+ this.isVisible = false;
51
+ this.isPositioned = false; // Reset positioning when hiding
52
+ }
53
+ }
54
+ /**
55
+ * Update the tooltip's position dynamically based on the slotted element's dimensions and position.
56
+ */
57
+ updateTooltipPosition() {
58
+ var _a, _b;
59
+ const slotElement = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
60
+ if (!slotElement) {
61
+ return;
62
+ }
63
+ const assignedNodes = (slotElement === null || slotElement === void 0 ? void 0 : slotElement.assignedNodes({
64
+ flatten: true
65
+ })) || [];
66
+ const targetElement = assignedNodes.find(node => node instanceof HTMLElement);
67
+ if (targetElement) {
68
+ const targetRect = targetElement.getBoundingClientRect();
69
+ const tooltipElement = (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[role="tooltip"]');
70
+ if (tooltipElement) {
71
+ const tooltipWidth = tooltipElement.offsetWidth;
72
+ const tooltipHeight = tooltipElement.offsetHeight;
73
+ // Calculate position based on the preferred `position` prop
74
+ let top = 0;
75
+ let left = 0;
76
+ switch (this.position) {
77
+ case 'above':
78
+ top = window.scrollY - tooltipHeight - 8; // Above with offset
79
+ left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
80
+ break;
81
+ case 'below':
82
+ top = tooltipHeight - window.scrollY + 18; // Below with offset
83
+ left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
84
+ break;
85
+ /*case 'left':
86
+ top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
87
+ left = targetRect.left - tooltipWidth - 8; // To the left with offset
88
+ break;
89
+ case 'right':
90
+ top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
91
+ left = targetRect.right + 8; // To the right with offset
92
+ break;*/
93
+ }
94
+ this.tooltipStyle = {
95
+ top: `${top}px`,
96
+ left: `${left}px`,
97
+ transform: 'translateX(0)' // No additional horizontal adjustment needed
98
+ };
99
+ }
100
+ }
101
+ }
102
+ render() {
103
+ return h("div", {
104
+ key: '7bc92c002eaf263a2d10a2391f356f40e23d5998',
105
+ class: "relative"
106
+ }, h("slot", {
107
+ key: 'cc8126196b03fd02bb17701aa4f55d4a406f685a'
108
+ }), this.isVisible && this.isPositioned && this.content && h("div", {
109
+ key: '00d854649ef43b958081bbb336319a537c181574',
110
+ class: "rounded-xs bg-strongest text-inverse f-ui-03-light pointer-events-none absolute z-10 whitespace-nowrap p-6",
111
+ role: "tooltip",
112
+ style: {
113
+ top: this.tooltipStyle.top,
114
+ left: this.tooltipStyle.left,
115
+ transform: this.tooltipStyle.transform
116
+ }
117
+ }, this.content));
118
+ }
119
+ get el() {
120
+ return getElement(this);
121
+ }
122
+ };
123
+ EdsTooltip.style = EdsTooltipStyle0;
124
+
125
+ export { EdsTooltip as eds_tooltip };
@@ -0,0 +1,68 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const EdsTrl = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.applications = undefined;
10
+ }
11
+ getParsedApplications() {
12
+ let apps = [];
13
+ // If applications is a string, attempt to parse it as JSON.
14
+ if (typeof this.applications === 'string') {
15
+ try {
16
+ apps = JSON.parse(this.applications || '[]');
17
+ } catch (error) {
18
+ // eslint-disable-next-line
19
+ console.error('Invalid applications trl JSON', error);
20
+ apps = [];
21
+ }
22
+ }
23
+ // If applications is already an array, use it directly.
24
+ else if (Array.isArray(this.applications)) {
25
+ apps = this.applications;
26
+ }
27
+ return apps;
28
+ }
29
+ calculateProgress(currentTrl) {
30
+ const maxTrl = 9;
31
+ return Math.ceil(currentTrl / maxTrl * 100); // Calculate percentage and round up
32
+ }
33
+ render() {
34
+ const apps = this.getParsedApplications();
35
+ // Map applications into table-friendly data.
36
+ const tableData = apps.map(app => ({
37
+ Application: app.name,
38
+ 'Current TRL Stage': `TRL ${app.currentTrl}`,
39
+ Progress: h("div", {
40
+ class: "w-[200px]"
41
+ }, h("eds-progress-bar", {
42
+ value: this.calculateProgress(app.currentTrl)
43
+ }))
44
+ }));
45
+ const tableConfig = {
46
+ Application: {
47
+ format: 'code'
48
+ },
49
+ 'Current TRL Stage': {
50
+ format: 'text'
51
+ }
52
+ };
53
+ return h("div", {
54
+ key: '7f2775e107e053cf1e8091f97915e6bc372c3954',
55
+ class: "container mx-auto px-4 py-8"
56
+ }, h("eds-table", {
57
+ key: '9576b1c5dc72335ef0f7158fa4eaa44835acd8db',
58
+ "table-data": JSON.stringify(tableData),
59
+ config: JSON.stringify(tableConfig),
60
+ "rows-per-page": "2",
61
+ "pagination-enabled": "true",
62
+ "search-enabled": "true",
63
+ "column-size": "default"
64
+ }));
65
+ }
66
+ };
67
+
68
+ export { EdsTrl as eds_trl };
@@ -0,0 +1,30 @@
1
+ const euSvg = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="flag-icons-eu" viewBox="0 0 640 480">
2
+ <defs>
3
+ <g id="d">
4
+ <g id="b">
5
+ <path id="a" d="m0-1-.3 1 .5.1z"/>
6
+ <use xlink:href="#a" transform="scale(-1 1)"/>
7
+ </g>
8
+ <g id="c">
9
+ <use xlink:href="#b" transform="rotate(72)"/>
10
+ <use xlink:href="#b" transform="rotate(144)"/>
11
+ </g>
12
+ <use xlink:href="#c" transform="scale(-1 1)"/>
13
+ </g>
14
+ </defs>
15
+ <path fill="#039" d="M0 0h640v480H0z"/>
16
+ <g fill="#fc0" transform="translate(320 242.3) scale(23.7037)">
17
+ <use xlink:href="#d" width="100%" height="100%" y="-6"/>
18
+ <use xlink:href="#d" width="100%" height="100%" y="6"/>
19
+ <g id="e">
20
+ <use xlink:href="#d" width="100%" height="100%" x="-6"/>
21
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(-144 -2.3 -2.1)"/>
22
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(144 -2.1 -2.3)"/>
23
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(72 -4.7 -2)"/>
24
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(72 -5 .5)"/>
25
+ </g>
26
+ <use xlink:href="#e" width="100%" height="100%" transform="scale(-1 1)"/>
27
+ </g>
28
+ </svg>`;
29
+
30
+ export { euSvg as e };
@@ -0,0 +1,14 @@
1
+ const facebook = ` <svg
2
+ width="20"
3
+ height="20"
4
+ viewBox="0 0 20 20"
5
+ fill="none"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ >
8
+ <path
9
+ d="M10.9481 19.9556C16.0263 19.4781 20 15.2031 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 14.7129 3.26027 18.6643 7.64847 19.722V12.0931H6V9.36828H7.64847V7.73228C7.64847 5.50935 8.5793 4.1875 11.2239 4.1875H13.4256V6.91266H12.0494C11.0199 6.91266 10.9518 7.29347 10.9518 8.00415L10.9481 9.36797H13.4412L13.1494 12.0928H10.9481V19.9556Z"
10
+ fill="currentColor"
11
+ />
12
+ </svg>`;
13
+
14
+ export { facebook as f };
@@ -0,0 +1,71 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const primary = [{
7
+ background: '#9CE142'
8
+ }, {
9
+ background: '#00C959'
10
+ }, {
11
+ background: '#00A595'
12
+ }];
13
+ const purple = [{
14
+ background: '#C461FF'
15
+ }, {
16
+ background: '#5D3DF9'
17
+ }];
18
+ const red = [{
19
+ background: '#FFA543'
20
+ }, {
21
+ background: '#FF4D68'
22
+ }];
23
+ const incorrect = [{
24
+ background: '#3FA9F5'
25
+ }, ...purple, ...red];
26
+ const IncorrectUseOfColors = class {
27
+ constructor(hostRef) {
28
+ registerInstance(this, hostRef);
29
+ }
30
+ render() {
31
+ return h("div", {
32
+ key: '1cfc3c78012371498476886214e85fbf6e387626',
33
+ class: "container"
34
+ }, h("eds-alert", {
35
+ key: '33449eeae0bca270a82d32de75d5d7c54d8b8c6c',
36
+ message: "Note that, each of the four colour tones cannot be mixed in the same composition.",
37
+ intent: "error"
38
+ }), h("div", {
39
+ key: 'd436f34bf074c175c6308b822c820604a5e272bc',
40
+ class: "flex"
41
+ }, h("div", {
42
+ key: '5f839c0f214b774f13af1499fe3e5f8485f959c5',
43
+ class: "w-full"
44
+ }, h("ul", {
45
+ key: '5cbb81288c0e61431aed523d77f2c6d231c8ce7e',
46
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
47
+ }, primary.map(color => h("li", {
48
+ class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
49
+ }, h("div", {
50
+ class: "w-full min-h-[150px] effect-height flex items-center justify-between p-16",
51
+ style: {
52
+ backgroundColor: color.background
53
+ }
54
+ }))))), h("div", {
55
+ key: '3622c7c8376208843d3e59c6548e41d9ca8c2b21',
56
+ class: "w-full"
57
+ }, h("ul", {
58
+ key: 'd74e34f45e1d377be5f1087a345dee219b1fc5a3',
59
+ class: "not-prose gap-y-8 md:gap-y-12 lg:gap-y-16"
60
+ }, incorrect.map(color => h("li", {
61
+ class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
62
+ }, h("div", {
63
+ class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
64
+ style: {
65
+ backgroundColor: color.background
66
+ }
67
+ })))))));
68
+ }
69
+ };
70
+
71
+ export { IncorrectUseOfColors as incorrect_use_of_colors };
@@ -0,0 +1,58 @@
1
+ function r(e) {
2
+ var t,
3
+ f,
4
+ n = "";
5
+ if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
6
+ return n;
7
+ }
8
+ function clsx() {
9
+ for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
10
+ return n;
11
+ }
12
+ const falsyToString = value => typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
13
+ const cx = clsx;
14
+ const cva = (base, config) => {
15
+ return props => {
16
+ var ref;
17
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
18
+ const {
19
+ variants,
20
+ defaultVariants
21
+ } = config;
22
+ const getVariantClassNames = Object.keys(variants).map(variant => {
23
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
24
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
25
+ if (variantProp === null) return null;
26
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
27
+ return variants[variant][variantKey];
28
+ });
29
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
30
+ let [key, value] = param;
31
+ if (value === undefined) {
32
+ return acc;
33
+ }
34
+ acc[key] = value;
35
+ return acc;
36
+ }, {});
37
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1) => {
38
+ let {
39
+ class: cvClass,
40
+ className: cvClassName,
41
+ ...compoundVariantOptions
42
+ } = param1;
43
+ return Object.entries(compoundVariantOptions).every(param => {
44
+ let [key, value] = param;
45
+ return Array.isArray(value) ? value.includes({
46
+ ...defaultVariants,
47
+ ...propsWithoutUndefined
48
+ }[key]) : {
49
+ ...defaultVariants,
50
+ ...propsWithoutUndefined
51
+ }[key] === value;
52
+ }) ? [...acc, cvClass, cvClassName] : acc;
53
+ }, []);
54
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
55
+ };
56
+ };
57
+
58
+ export { cva as c };
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/index.esm.js ADDED
@@ -0,0 +1,4 @@
1
+ export { E as EdsAccordion, a as EdsAlert, b as EdsAvatar, d as EdsBlockBreak, e as EdsBreadcrumb, f as EdsButton, i as EdsCardGeneric, j as EdsCardSection, k as EdsCodeBlock, l as EdsDropdown, m as EdsFeedback, n as EdsFooter, o as EdsForm, p as EdsFullscreenMenu, q as EdsHeader, s as EdsIconWrapper, t as EdsImg, u as EdsInputField, v as EdsLink, w as EdsLogo, x as EdsMatomoNotice, y as EdsModal, z as EdsPagination, A as EdsProgressBar, B as EdsRating, C as EdsSectionCore, D as EdsSocialNetworks, F as EdsSpinner, G as EdsSplashScreen, I as EdsSteps, J as EdsStepsV2, K as EdsSwitch, L as EdsTable, M as EdsTabs, N as EdsTag, O as EdsTimeline, P as EdsToast, Q as EdsTooltip, R as EdsUser } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';