@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,114 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const edsModalCss = ".block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.fixed{position:fixed}.inset-0{inset:0rem}.z-10{z-index:10}.z-50{z-index:50}.max-w-full{max-width:100%}.absolute{position:absolute}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-20{padding-top:1.25rem;padding-bottom:1.25rem}.bg-inverse{background-color:var(--white)}.bg-dark{background-color:var(--grey-300)}.rounded-lg{border-radius:16px}.shadow-lg{--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.left-1\\/2{left:50%}.top-1\\/2{top: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}.border-b-2{border-bottom-width:2px}.border-softer{border-color:rgba(0, 0, 0, .1)}.pb-8{padding-bottom:0.5rem}.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)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.ml-8{margin-left:0.5rem}.pt-8{padding-top:0.5rem}.bg-opacity-90{opacity:0.9}.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}";
7
+ const EdsModalStyle0 = edsModalCss;
8
+ const EdsModal = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.isOpen = false;
12
+ this.title = '';
13
+ this.truncate = true;
14
+ this.truncateLines = '1';
15
+ }
16
+ getTruncateClass() {
17
+ return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
18
+ }
19
+ /**
20
+ * Opens the modal.
21
+ */
22
+ async open() {
23
+ this.isOpen = true;
24
+ /*sendAnalytics({
25
+ category: 'ui-component',
26
+ tag: this.el.tagName.toLowerCase(),
27
+ name: this.title,
28
+ action: 'show'
29
+ });*/
30
+ }
31
+ /**
32
+ * Closes the modal.
33
+ */
34
+ async close() {
35
+ this.isOpen = false;
36
+ /*sendAnalytics({
37
+ category: 'ui-component',
38
+ tag: this.el.tagName.toLowerCase(),
39
+ name: this.title,
40
+ action: 'hide'
41
+ });*/
42
+ }
43
+ /**
44
+ * Toggles the modal open or closed.
45
+ */
46
+ async toggle() {
47
+ this.isOpen = !this.isOpen;
48
+ }
49
+ /**
50
+ * Lifecycle method that runs when the component has fully loaded.
51
+ * It emits a custom event for each `eds-button` element contained within the breadcrumb.
52
+ */
53
+ componentDidLoad() {
54
+ // Emit context for each eds-link element after the component is fully loaded
55
+ const btns = this.el.shadowRoot.querySelectorAll('eds-button');
56
+ btns.forEach(btn => {
57
+ this.emitContext(btn);
58
+ });
59
+ }
60
+ /**
61
+ * Emits a custom event called `parentContext` for a given button element.
62
+ * This event provides context information about the eds-modal component.
63
+ *
64
+ * @param btnElement - The link element to which the event will be dispatched.
65
+ */
66
+ emitContext(btnElement) {
67
+ const event = new CustomEvent('parentContext', {
68
+ detail: {
69
+ componentName: this.el.tagName.toLowerCase(),
70
+ identifier: null
71
+ }
72
+ });
73
+ btnElement.dispatchEvent(event);
74
+ }
75
+ render() {
76
+ return h("div", {
77
+ key: '00816ecb900bd9b68b31fdf6e48bef0223f9e10a',
78
+ class: `${this.isOpen ? 'block' : 'hidden'} fixed inset-0 z-50 flex`
79
+ }, this.isOpen && h("div", {
80
+ key: '570fa8625f9ad4b1ea82633f11e2b289ab01b853',
81
+ class: "fixed inset-0 bg-dark bg-opacity-90" // Add backdrop-blur utility class here
82
+ ,
83
+
84
+ onClick: () => this.close()
85
+ }), h("div", {
86
+ key: 'ff658c763e3fbc98123f13483076399966b10515',
87
+ class: "max-w-full absolute px-20 py-20 bg-inverse rounded-lg shadow-lg z-10 left-1/2 top-1/2 grow -translate-x-1/2 -translate-y-1/2 justify-center "
88
+ }, h("div", {
89
+ key: 'd8b72acd90cc59ab1f82384aee4e311319f75aa9',
90
+ class: "flex justify-between items-center border-b-2 border-softer pb-8"
91
+ }, h("span", {
92
+ key: 'ee61fc505c5a3eb93541d3762d37f28a5a788bae',
93
+ class: `f-heading-04 text-lighter ${this.getTruncateClass()}`
94
+ }, this.title), h("eds-button", {
95
+ key: '3832772417d05a162eb5f2c4d0733f0ee845ed1c',
96
+ intent: "tertiary",
97
+ icon: "close",
98
+ "aria-label": "Close modal",
99
+ onClick: () => this.close(),
100
+ "extra-class": "ml-8"
101
+ })), h("div", {
102
+ key: 'f71b38be8284a37d0d198df0a9858c64202b3d91',
103
+ class: "pt-8"
104
+ }, h("slot", {
105
+ key: '1f80948334e5b4e9fc00a3bf01c6fc402d8220c3'
106
+ }))));
107
+ }
108
+ get el() {
109
+ return getElement(this);
110
+ }
111
+ };
112
+ EdsModal.style = EdsModalStyle0;
113
+
114
+ export { EdsModal as eds_modal };
@@ -0,0 +1,72 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const EdsNavigator = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.prevLabel = undefined;
10
+ this.nextLabel = undefined;
11
+ this.prevUrl = undefined;
12
+ this.nextUrl = undefined;
13
+ this.linkSize = 'small';
14
+ this.linkIntent = 'tertiary';
15
+ }
16
+ componentDidLoad() {
17
+ // Emit context for each eds-link element after the component is fully loaded
18
+ const links = this.el.querySelectorAll('eds-link');
19
+ links.forEach(link => {
20
+ this.emitContext(link);
21
+ });
22
+ }
23
+ /**
24
+ * Emits a custom event 'parentContext' for a given link element with the component's context.
25
+ * @param linkElement - The eds-link element to emit the event for.
26
+ */
27
+ emitContext(linkElement) {
28
+ const event = new CustomEvent('parentContext', {
29
+ detail: {
30
+ componentName: this.el.tagName.toLowerCase(),
31
+ identifier: null
32
+ }
33
+ });
34
+ linkElement.dispatchEvent(event);
35
+ }
36
+ render() {
37
+ return h("ul", {
38
+ key: '1ab60197bbc9ee86d77134138744dce39df2aaa7',
39
+ class: "flex lg:flex grow items-center justify-center gap-x-8"
40
+ }, this.prevLabel && h("eds-link", {
41
+ key: 'b29fd121d33c1e919d24a5d460d8d6864f1ff9db',
42
+ label: this.prevLabel,
43
+ url: this.prevUrl || undefined,
44
+ disabled: !this.prevUrl,
45
+ "aria-label": this.prevLabel,
46
+ size: this.linkSize,
47
+ intent: this.linkIntent,
48
+ class: "mr-auto !p-8 lg:!pr-12"
49
+ }, h("eds-icon-wrapper", {
50
+ key: '64620ccfaf2e006a6414bcd7e874a352b9d2d56b',
51
+ icon: "chevron-left"
52
+ }), this.prevLabel), this.nextLabel && h("eds-link", {
53
+ key: 'ae6425f0f01c8f5bcbdae27d9bea9dc3a5b09d3b',
54
+ label: this.nextLabel,
55
+ url: this.nextUrl || undefined,
56
+ disabled: !this.nextUrl,
57
+ "aria-label": this.nextLabel,
58
+ size: this.linkSize,
59
+ intent: this.linkIntent,
60
+ class: "ml-auto !p-8 lg:!pl-12"
61
+ }, this.nextLabel, h("eds-icon-wrapper", {
62
+ key: 'd286fc26f17ee6cf6828990e98df7865fbbfd352',
63
+ icon: "chevron-right",
64
+ class: "w-20 h-20"
65
+ })));
66
+ }
67
+ get el() {
68
+ return getElement(this);
69
+ }
70
+ };
71
+
72
+ export { EdsNavigator as eds_navigator };
@@ -0,0 +1,258 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const edsPaginationCss = "ul,menu{list-style:none;margin:0;padding:0}.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)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.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)}.text-lightest{color:var(--grey-500)}.mb-28{margin-bottom:1.75rem}.w-full{width:100%}.w-20{width:1.25rem}.h-20{height:1.25rem}.h-28{height:1.75rem}.h-32{height:2rem}.h-36{height:2.25rem}.text-center{text-align:center}.flex{display:flex}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.mr-auto{margin-right:auto}.ml-auto{margin-left:auto}.\\!p-8{padding:0.5rem !important}.ml-4{margin-left:0.25rem}.mr-4{margin-right:0.25rem}.hidden{display:none}.gap-1{gap:0.0625rem}.py-4{padding-top:0.25rem;padding-bottom:0.25rem}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}@media (min-width: 900px){.lg\\:\\!pr-12{padding-right:0.75rem !important}.lg\\:flex{display:flex}}";
7
+ const EdsPaginationStyle0 = edsPaginationCss;
8
+ const EdsPagination = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.currentPage = undefined;
12
+ this.lastPage = undefined;
13
+ this.perPage = 10;
14
+ this.total = 0;
15
+ this.url = '';
16
+ this.mode = 'default';
17
+ this.prevLabel = 'Prev';
18
+ this.nextLabel = 'Next';
19
+ this.prevUrl = '';
20
+ this.nextUrl = '';
21
+ this.links = [];
22
+ }
23
+ /** Lifecycle hook to generate pagination links on component load */
24
+ componentWillLoad() {
25
+ if (this.mode === 'default') {
26
+ this.generateLinks();
27
+ }
28
+ }
29
+ componentDidLoad() {
30
+ // Emit context for each eds-link element after the component is fully loaded
31
+ const links = this.hostEl.shadowRoot.querySelectorAll('eds-link');
32
+ if (links.length > 0) {
33
+ // Emit context for the first link
34
+ this.emitContext(links[0]);
35
+ // Emit context for the last link, if it's different from the first
36
+ if (links.length > 1) {
37
+ this.emitContext(links[links.length - 1]);
38
+ }
39
+ }
40
+ }
41
+ /**
42
+ * Emits a custom event called `parentContext` for a given link element.
43
+ * This event provides context information about the breadcrumb component.
44
+ *
45
+ * @param linkElement - The link element to which the event will be dispatched.
46
+ */
47
+ emitContext(linkElement) {
48
+ const event = new CustomEvent('parentContext', {
49
+ detail: {
50
+ componentName: this.hostEl.tagName.toLowerCase(),
51
+ identifier: null
52
+ }
53
+ });
54
+ linkElement.dispatchEvent(event);
55
+ }
56
+ onPageOrLastPageChange() {
57
+ if (this.mode === 'default') {
58
+ this.generateLinks();
59
+ }
60
+ }
61
+ /**
62
+ * Checks if the current page is the first page
63
+ * @returns {boolean} - true if current page is the first page
64
+ */
65
+ isFirstPage() {
66
+ return this.currentPage === 1;
67
+ }
68
+ /**
69
+ * Checks if the current page is the last page
70
+ * @returns {boolean} - true if current page is the last page
71
+ */
72
+ isLastPage() {
73
+ return this.currentPage === this.lastPage;
74
+ }
75
+ /**
76
+ * Generates a pagination link object
77
+ * @param {number} page - Page number for the link
78
+ * @returns {Link} - Link object with page details
79
+ */
80
+ generateLink(page) {
81
+ const urlHasQuery = this.url.includes('?');
82
+ return {
83
+ ariaLabel: `Page ${page}`,
84
+ url: `${this.url}${urlHasQuery ? '&' : '?'}page=${page}`,
85
+ label: page.toString(),
86
+ current: this.currentPage === page,
87
+ disabled: false
88
+ };
89
+ }
90
+ /** Generates pagination links based on the last page and current page */
91
+ generateLinks() {
92
+ if (this.lastPage && this.lastPage > 5) {
93
+ this.links = this.getPaginationGenerator(this.currentPage || 1, this.lastPage).map(page => typeof page === 'number' ? this.generateLink(page) : page);
94
+ } else if (this.lastPage) {
95
+ this.links = Array.from({
96
+ length: this.lastPage
97
+ }).map((_, i) => this.generateLink(i + 1));
98
+ }
99
+ }
100
+ /**
101
+ * Creates a pagination range based on delta, current, and total pages
102
+ * @param {number} current - Current page number
103
+ * @param {number} total - Total number of pages
104
+ * @param {number} delta - Range of pages to display around the current page
105
+ * @returns {(number | string)[]} - Range of page numbers or ellipses
106
+ */
107
+ getPaginationGenerator(current, total) {
108
+ const delta = 1; // Show one page before and one after the current page
109
+ const range = [];
110
+ if (total <= 5) {
111
+ // If total pages are 5 or less, show all pages
112
+ for (let i = 1; i <= total; i++) {
113
+ range.push(i);
114
+ }
115
+ } else {
116
+ // Always show the first page
117
+ range.push(1);
118
+ // Add ellipsis if there’s a gap between the first page and the current range start
119
+ if (current - delta > 2) {
120
+ range.push('...');
121
+ }
122
+ // Determine range for pages around the current page
123
+ for (let i = Math.max(2, current - delta); i <= Math.min(total - 1, current + delta); i++) {
124
+ range.push(i);
125
+ }
126
+ // Add ellipsis if there’s a gap between the current range end and the last page
127
+ if (current + delta < total - 1) {
128
+ range.push('...');
129
+ }
130
+ // Always show the last page
131
+ range.push(total);
132
+ }
133
+ return range;
134
+ }
135
+ /**
136
+ * Formats the current page results information for display
137
+ * @returns {string} - Formatted page result information
138
+ */
139
+ pageResults() {
140
+ if (this.total > 0) {
141
+ return this.total > this.perPage ? `${this.perPage * ((this.currentPage || 1) - 1) + 1} - ${this.perPage * (this.currentPage || 1) >= this.total ? this.total : this.perPage * (this.currentPage || 1)} of ${this.total}` : `${this.total}`;
142
+ }
143
+ return '';
144
+ }
145
+ /**
146
+ * Handles a page click event, updating the current page and dispatching an event
147
+ * @param {MouseEvent} event - Click event
148
+ * @param {number} newPage - New page number
149
+ */
150
+ handlePageClick(event, newPage) {
151
+ if (this.mode === 'navigator') {
152
+ return; // No page clicking logic for navigator mode
153
+ }
154
+ event.preventDefault(); // Prevent default link navigation
155
+ if (newPage !== this.currentPage) {
156
+ this.links = this.links.map(link => typeof link === 'object' ? Object.assign(Object.assign({}, link), {
157
+ current: parseInt(link.label) === newPage
158
+ }) : link);
159
+ const pageChangeEvent = new CustomEvent('pageChange', {
160
+ detail: newPage,
161
+ bubbles: true,
162
+ composed: true
163
+ });
164
+ this.hostEl.dispatchEvent(pageChangeEvent);
165
+ this.currentPage = newPage;
166
+ }
167
+ }
168
+ render() {
169
+ return h("div", {
170
+ key: '2385b59b0a8b2bbdc40bfc5032b846c0ec20065e'
171
+ }, this.total > 0 && this.mode === 'default' && h("p", {
172
+ key: '6aea281a4df247874f354469bbabae039424ad9e',
173
+ class: "f-ui-03 text-lightest mb-28 w-full text-center"
174
+ }, h("span", {
175
+ key: 'eeb5f0ea902505c3853a30d51026cef9d9785e48',
176
+ class: "sr-only"
177
+ }, "Results:"), this.pageResults()), this.mode === 'navigator' || this.lastPage && this.lastPage > 1 ? h("nav", {
178
+ "aria-label": "Pagination"
179
+ }, h("ul", {
180
+ class: "flex items-center justify-center gap-x-8"
181
+ }, h("li", {
182
+ class: "mr-auto"
183
+ }, h("eds-link", {
184
+ label: this.prevLabel,
185
+ url: this.mode === 'navigator' ? this.prevUrl || '#' // Use prevUrl if provided, otherwise disable with '#'
186
+ : this.isFirstPage() ? '#' : this.generateLink(this.currentPage - 1).url,
187
+ disabled: this.mode === 'navigator' ? !this.prevUrl // Disable if prevUrl is not provided
188
+ : this.isFirstPage(),
189
+ "aria-label": "Previous page",
190
+ icon: "chevron-left",
191
+ "icon-pos": "left",
192
+ size: "small",
193
+ "icon-small": "true",
194
+ intent: "strong",
195
+ "hide-label-on-small-screen": true,
196
+ class: "!p-8 lg:!pr-12",
197
+ onClick: event => {
198
+ if (this.mode === 'default') {
199
+ if (this.isFirstPage()) {
200
+ event.preventDefault(); // Prevent click if disabled
201
+ } else {
202
+ this.handlePageClick(event, (this.currentPage || 1) - 1);
203
+ }
204
+ }
205
+ }
206
+ })), this.mode === 'default' && this.links.map((link, index) => h("li", {
207
+ key: index,
208
+ class: "f-ui-02 flex h-36 items-center justify-center"
209
+ }, typeof link === 'string' ? h("span", {
210
+ class: "flex items-center justify-center"
211
+ }, link) : h("eds-link", {
212
+ url: link.url,
213
+ "aria-label": link.ariaLabel,
214
+ label: link.label,
215
+ current: link.current,
216
+ size: "small",
217
+ class: "!p-8",
218
+ intent: link.current ? 'secondary' : 'ghost',
219
+ onClick: event => this.handlePageClick(event, parseInt(link.label))
220
+ }))), h("li", {
221
+ class: "ml-auto"
222
+ }, h("eds-link", {
223
+ label: this.nextLabel,
224
+ url: this.mode === 'navigator' ? this.nextUrl || '#' // Use nextUrl if provided, otherwise disable with '#'
225
+ : this.isLastPage() ? '#' : this.generateLink(this.currentPage + 1).url,
226
+ disabled: this.mode === 'navigator' ? !this.nextUrl // Disable if nextUrl is not provided
227
+ : this.isLastPage(),
228
+ "aria-label": "Next page",
229
+ size: "small",
230
+ "icon-small": "true",
231
+ icon: "chevron-right",
232
+ intent: "strong",
233
+ "hide-label-on-small-screen": true,
234
+ class: "!p-8 lg:!pl-12 flex items-center gap-1 py-4 transition-colors",
235
+ onClick: event => {
236
+ if (this.mode === 'default') {
237
+ if (this.isLastPage()) {
238
+ event.preventDefault(); // Prevent click if disabled
239
+ } else {
240
+ this.handlePageClick(event, (this.currentPage || 1) + 1);
241
+ }
242
+ }
243
+ }
244
+ })))) : null);
245
+ }
246
+ get hostEl() {
247
+ return getElement(this);
248
+ }
249
+ static get watchers() {
250
+ return {
251
+ "currentPage": ["onPageOrLastPageChange"],
252
+ "lastPage": ["onPageOrLastPageChange"]
253
+ };
254
+ }
255
+ };
256
+ EdsPagination.style = EdsPaginationStyle0;
257
+
258
+ export { EdsPagination as eds_pagination };
@@ -0,0 +1,71 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const edsRatingCss = ":host{display:inline-block;font-size:2rem}.stars{display:flex;gap:0.25rem;cursor:pointer}.star{color:var(--star-empty-color, #ccc);transition:color 0.2s ease-in-out}.star.filled{color:var(--green-500);}.star:hover,.star.filled:hover{transform:scale(1.2)}.f-body-01{font-family:var(--f-body-01-fontFamily);font-weight:var(--f-body-01-fontWeight);font-size:var(--f-body-01-fontSize);line-height:var(--f-body-01-lineHeight);letter-spacing:var(--f-body-01-letterSpacing)}.f-body-02{font-family:var(--f-body-02-fontFamily);font-weight:var(--f-body-02-fontWeight);font-size:var(--f-body-02-fontSize);line-height:var(--f-body-02-lineHeight);letter-spacing:var(--f-body-02-letterSpacing)}.f-ui-04{font-family:var(--f-ui-04-fontFamily);font-weight:var(--f-ui-04-fontWeight);font-size:var(--f-ui-04-fontSize);line-height:var(--f-ui-04-lineHeight);letter-spacing:var(--f-ui-04-letterSpacing)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}";
7
+ const EdsRatingStyle0 = edsRatingCss;
8
+ const EdsRating = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.ratingChange = createEvent(this, "ratingChange", 7);
12
+ this.stars = 5;
13
+ this.label = 'Rate your experience';
14
+ this.textMapping = ['Very Poor', 'Poor', 'Average', 'Good', 'Excellent'];
15
+ this.selectedRating = 0;
16
+ }
17
+ /**
18
+ * Parses the `links` prop into an array of link objects.
19
+ * Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
20
+ *
21
+ * @returns {any[]} Array of parsed link objects
22
+ */
23
+ get parsedMappings() {
24
+ if (typeof this.textMapping === 'object') {
25
+ return this.textMapping;
26
+ } else if (typeof this.textMapping === 'string') {
27
+ try {
28
+ return JSON.parse(this.textMapping);
29
+ } catch (e) {
30
+ // eslint-disable-next-line
31
+ console.error('Error parsing links prop:', e);
32
+ return [];
33
+ }
34
+ }
35
+ return [];
36
+ }
37
+ /**
38
+ * Handles the click event on a star.
39
+ * @param rating - The selected rating value.
40
+ */
41
+ handleClick(rating) {
42
+ this.selectedRating = rating;
43
+ this.ratingChange.emit(rating);
44
+ }
45
+ render() {
46
+ return h("div", {
47
+ key: '4ca6d5e0fb35d8ebce1acd5c1a7c6c857ba4f463',
48
+ class: "relative w-full flex flex-col"
49
+ }, h("span", {
50
+ key: '784b77f84098b8d88cd3872004b0208a4437c51b',
51
+ class: "f-body-01"
52
+ }, this.label), h("div", {
53
+ key: '6780db58d3c96046a99d383518cfe1db1e3f1c68',
54
+ class: "stars"
55
+ }, Array.from({
56
+ length: this.stars
57
+ }, (_, index) => h("span", {
58
+ class: {
59
+ star: true,
60
+ filled: index < this.selectedRating
61
+ },
62
+ onClick: () => this.handleClick(index + 1)
63
+ }, "\u2605"))), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && h("span", {
64
+ key: 'ce0eec3c29cf27bff86e3307a29a2c39c2167087',
65
+ class: "f-ui-04 text-lighter"
66
+ }, this.parsedMappings[this.selectedRating - 1]));
67
+ }
68
+ };
69
+ EdsRating.style = EdsRatingStyle0;
70
+
71
+ export { EdsRating as eds_rating };
@@ -0,0 +1,69 @@
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 edsSectionCoreCss = "";
7
+ const EdsSectionCoreStyle0 = edsSectionCoreCss;
8
+ const EdsSectionCore = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.tag = 'section';
12
+ this.sectionTitle = '';
13
+ this.headingLevel = 'h2';
14
+ }
15
+ render() {
16
+ const TagType = this.tag; // Set dynamic tag type (div or section)
17
+ return h(TagType, {
18
+ key: '849c35d9cd587cf14b0d6bc6efd1310a85d447f2'
19
+ }, h("eds-section-heading", {
20
+ key: '7ed4486fcf6e7c653026869c9468be9471db1775',
21
+ headingLevel: this.headingLevel,
22
+ sectionTitle: this.sectionTitle
23
+ }), h("slot", {
24
+ key: '5d95ea6516ecaaab4e07a40b84cd20deb3d8d3b2'
25
+ }));
26
+ }
27
+ };
28
+ EdsSectionCore.style = EdsSectionCoreStyle0;
29
+ const EdsSectionHeading = class {
30
+ constructor(hostRef) {
31
+ registerInstance(this, hostRef);
32
+ this.sectionTitle = undefined;
33
+ this.withContainer = true;
34
+ this.headingLevel = 'h2';
35
+ this.tag = 'div';
36
+ this.spacingLarge = false;
37
+ }
38
+ getHeadingClass() {
39
+ // Map heading levels to their respective classes
40
+ const headingClasses = {
41
+ h1: 'f-heading-01',
42
+ h2: 'f-heading-02',
43
+ h3: 'f-heading-03',
44
+ h4: 'f-heading-04',
45
+ h5: 'f-heading-05',
46
+ h6: 'f-heading-06'
47
+ };
48
+ // Return the class based on the heading level
49
+ return headingClasses[this.headingLevel];
50
+ }
51
+ render() {
52
+ const TagType = this.tag; // Dynamically set tag type for the container
53
+ const HeadingTag = this.headingLevel; // Dynamically set heading level
54
+ return h(TagType, {
55
+ key: '2c6466c0a02bf8598153c18eafb37affc3dac395',
56
+ class: {
57
+ 'ui-section-header flex flex-wrap items-center justify-between gap-x-12 gap-y-8 pb-20': true,
58
+ container: this.withContainer,
59
+ 'pt-48': this.spacingLarge,
60
+ 'pt-28': !this.spacingLarge
61
+ }
62
+ }, h(HeadingTag, {
63
+ key: 'fc7f0f09e02e8c63697e46811c465792497126e0',
64
+ class: this.getHeadingClass()
65
+ }, this.sectionTitle));
66
+ }
67
+ };
68
+
69
+ export { EdsSectionCore as eds_section_core, EdsSectionHeading as eds_section_heading };
@@ -0,0 +1,74 @@
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 edsSocialNetworkCss = "blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.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{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)}.mt-12{margin-top:0.75rem}.mt-16{margin-top:1rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.gap-4{gap:0.25rem}.effect-color{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.effect-focus{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.hover\\:text-default:hover{color:var(--black)}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:8px}";
7
+ const EdsSocialNetworksStyle0 = edsSocialNetworkCss;
8
+ const EdsSocialNetwork = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ /**
12
+ * Array of social network objects, each containing label, URL, and icon.
13
+ * These are used to render the social network links.
14
+ *
15
+ * @private
16
+ * @type {SocialNetworks[]}
17
+ */
18
+ this.socialNetworks = [{
19
+ label: 'Twitter',
20
+ url: 'https://twitter.com/ebrains_eu',
21
+ icon: 'twitter'
22
+ }, {
23
+ label: 'Linkedin',
24
+ url: 'https://www.linkedin.com/company/ebrains-eu/about/',
25
+ icon: 'linkedin'
26
+ }, {
27
+ label: 'Facebook',
28
+ url: 'https://www.facebook.com/people/Ebrains_eu/100046659909324/',
29
+ icon: 'facebook'
30
+ }, {
31
+ label: 'Youtube',
32
+ url: 'https://www.youtube.com/channel/UC6E796cVVR5Xrs2A5jJmleQ',
33
+ icon: 'youtube'
34
+ }, {
35
+ label: 'Mastodon',
36
+ url: 'https://mastodon.social/@ebrains',
37
+ icon: 'mastodon'
38
+ }, {
39
+ label: 'Bluesky',
40
+ url: 'https://bsky.app/profile/ebrains.bsky.social',
41
+ icon: 'bluesky'
42
+ }];
43
+ this.title = 'Follow EBRAINS to keep up-to-date';
44
+ }
45
+ /**
46
+ * Renders the component's HTML structure with links to EBRAINS social profiles.
47
+ * Each social network link uses the `eds-link` component with specific classes and styles.
48
+ *
49
+ * @returns {JSX.Element} The rendered JSX for the component.
50
+ */
51
+ render() {
52
+ return h("div", {
53
+ key: '6169559327b728fd0f3a51a2b8a6439f80fba8fc'
54
+ }, h("p", {
55
+ key: 'df2e008500097af1b85660fe8b3fac122f5018a4',
56
+ class: "f-ui-02"
57
+ }, this.title), h("ul", {
58
+ key: 'df01a2802412c4db4e5442fdfc0b6ef3f15c4109',
59
+ class: "mt-12 flex gap-4"
60
+ }, this.socialNetworks.map((network, index) => h("li", {
61
+ key: index
62
+ }, h("eds-link", {
63
+ "extra-class": "effect-color effect-focus text-lighter hover:text-default flex items-center justify-center rounded-sm",
64
+ external: true,
65
+ "aria-label": network.label,
66
+ url: network.url,
67
+ icon: network.icon,
68
+ intent: "strong"
69
+ })))));
70
+ }
71
+ };
72
+ EdsSocialNetwork.style = EdsSocialNetworksStyle0;
73
+
74
+ export { EdsSocialNetwork as eds_social_networks };