@ebrains/react 0.0.1-alpha.0 → 0.3.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.
- package/README.md +4 -48
- package/arrow-diagonal-black-8f0494c3.esm.js +3 -0
- package/arrow-right-9322ba8a.esm.js +5 -0
- package/bluesky-cc5edd2d.esm.js +14 -0
- package/chevron-down-6144c823.esm.js +12 -0
- package/chevron-left-ca6c66e1.esm.js +11 -0
- package/chevron-right-b88ed2d4.esm.js +5 -0
- package/chevron-up-c66bd477.esm.js +12 -0
- package/close-87fc0d63.esm.js +5 -0
- package/color-0ba8ed56.esm.js +423 -0
- package/color-primary-palette_6.entry.esm.js +756 -0
- package/copy-03b72cb6.esm.js +5 -0
- package/correct-use-of-colors.entry.esm.js +243 -0
- package/eds-accordion.entry.esm.js +132 -0
- package/eds-alert.entry.esm.js +102 -0
- package/eds-avatar_17.entry.esm.js +209 -0
- package/eds-card-desc_3.entry.esm.js +129 -0
- package/eds-card-generic.entry.esm.js +125 -0
- package/eds-card-project.entry.esm.js +92 -0
- package/eds-card-section.entry.esm.js +70 -0
- package/eds-card-tags.entry.esm.js +27 -0
- package/eds-card-tool.entry.esm.js +106 -0
- package/eds-card-wrapper.entry.esm.js +39 -0
- package/eds-code-block.entry.esm.js +2243 -0
- package/eds-components-section.entry.esm.js +146 -0
- package/eds-docs-palettes.entry.esm.js +29 -0
- package/eds-docs-tokens.entry.esm.js +45 -0
- package/eds-form.entry.esm.js +374 -0
- package/eds-frame.entry.esm.js +117 -0
- package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
- package/eds-icon-arrow-right.entry.esm.js +21 -0
- package/eds-icon-bluesky.entry.esm.js +21 -0
- package/eds-icon-chevron-down.entry.esm.js +21 -0
- package/eds-icon-chevron-left.entry.esm.js +21 -0
- package/eds-icon-chevron-right.entry.esm.js +21 -0
- package/eds-icon-chevron-up.entry.esm.js +21 -0
- package/eds-icon-close.entry.esm.js +21 -0
- package/eds-icon-copy.entry.esm.js +21 -0
- package/eds-icon-eu.entry.esm.js +21 -0
- package/eds-icon-facebook.entry.esm.js +21 -0
- package/eds-icon-gitlab.entry.esm.js +21 -0
- package/eds-icon-linkedin.entry.esm.js +21 -0
- package/eds-icon-loader.entry.esm.js +21 -0
- package/eds-icon-mastodon.entry.esm.js +21 -0
- package/eds-icon-menu.entry.esm.js +21 -0
- package/eds-icon-more.entry.esm.js +21 -0
- package/eds-icon-search.entry.esm.js +21 -0
- package/eds-icon-success.entry.esm.js +21 -0
- package/eds-icon-twitter.entry.esm.js +21 -0
- package/eds-icon-user.entry.esm.js +21 -0
- package/eds-icon-youtube.entry.esm.js +21 -0
- package/eds-input_7.entry.esm.js +518 -0
- package/eds-login.entry.esm.js +76 -0
- package/eds-logo-variations.entry.esm.js +29 -0
- package/eds-matomo-notice.entry.esm.js +129 -0
- package/eds-modal.entry.esm.js +114 -0
- package/eds-navigator.entry.esm.js +72 -0
- package/eds-pagination_2.entry.esm.js +456 -0
- package/eds-progress-bar.entry.esm.js +36 -0
- package/eds-rating.entry.esm.js +71 -0
- package/eds-section-core_2.entry.esm.js +69 -0
- package/eds-svg-repository.entry.esm.js +325 -0
- package/eds-tab.entry.esm.js +41 -0
- package/eds-tabs-content.entry.esm.js +145 -0
- package/eds-tabs.entry.esm.js +155 -0
- package/eds-timeline.entry.esm.js +130 -0
- package/eds-tooltip.entry.esm.js +116 -0
- package/eds-trl.entry.esm.js +69 -0
- package/eu-9ddde93a.esm.js +30 -0
- package/facebook-9cb5c17f.esm.js +14 -0
- package/incorrect-use-of-colors.entry.esm.js +71 -0
- package/index-39c58238.esm.js +58 -0
- package/index.esm.js +3 -2668
- package/index.esm2.js +4791 -0
- package/keycloak-13893af6.esm.js +1594 -0
- package/linkedin-e8650abb.esm.js +28 -0
- package/loader-c9628637.esm.js +30 -0
- package/logo-color-7f1fd803.esm.js +115 -0
- package/logo-color-margins-ff8ce71b.esm.js +118 -0
- package/logo-space.entry.esm.js +32 -0
- package/logo-variations-horizontal_2.entry.esm.js +116 -0
- package/logo-white-no-bg-f382f86f.esm.js +1021 -0
- package/logo-wrong-usage.entry.esm.js +137 -0
- package/mastodon-3703ec61.esm.js +14 -0
- package/menu-340ea948.esm.js +11 -0
- package/mono-53f70232.esm.js +11 -0
- package/more-4449d549.esm.js +13 -0
- package/package.json +1 -1
- package/search-fbcd79c2.esm.js +12 -0
- package/src/components.d.ts +40 -0
- package/src/index.d.ts +1 -1
- package/src/react-component-lib/attachProps.d.ts +16 -0
- package/src/react-component-lib/case.d.ts +2 -0
- package/src/react-component-lib/createComponent.d.ts +10 -0
- package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/src/react-component-lib/dev.d.ts +2 -0
- package/src/react-component-lib/index.d.ts +2 -0
- package/src/react-component-lib/interfaces.d.ts +29 -0
- package/src/react-component-lib/utils/attachProps.d.ts +16 -0
- package/src/react-component-lib/utils/case.d.ts +2 -0
- package/src/react-component-lib/utils/index.d.ts +10 -0
- package/success-443809da.esm.js +18 -0
- package/toastManager-d9eee791.esm.js +34 -0
- package/token-list_3.entry.esm.js +385 -0
- package/token-ratios.entry.esm.js +49 -0
- package/token-spacing.entry.esm.js +93 -0
- package/token-typography.entry.esm.js +264 -0
- package/twitter-ac21b505.esm.js +14 -0
- package/user-71ebdc15.esm.js +16 -0
- package/youtube-efbfbdc4.esm.js +14 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index.esm2.js';
|
|
2
|
+
import { a as logout, i as initKeycloak, b as isAuthenticated, g as getUser, l as login } from './keycloak-13893af6.esm.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'react-dom';
|
|
6
|
+
|
|
7
|
+
const EdsLogin = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.authStatusChanged = createEvent(this, "authStatusChanged", 7);
|
|
11
|
+
// Method to handle user logout
|
|
12
|
+
this.handleLogout = () => {
|
|
13
|
+
logout();
|
|
14
|
+
this.authenticated = false; // Reset authentication state after logout
|
|
15
|
+
};
|
|
16
|
+
this.keycloakUrl = '';
|
|
17
|
+
this.keycloakRealm = '';
|
|
18
|
+
this.keycloakClientId = '';
|
|
19
|
+
this.authenticated = false;
|
|
20
|
+
this.user = null;
|
|
21
|
+
}
|
|
22
|
+
// Lifecycle method to check authentication status before the component loads
|
|
23
|
+
async componentWillLoad() {
|
|
24
|
+
await this.checkAuthentication();
|
|
25
|
+
}
|
|
26
|
+
// Method to initialize Keycloak and check if the user is authenticated
|
|
27
|
+
async checkAuthentication() {
|
|
28
|
+
try {
|
|
29
|
+
const keycloakConfig = {
|
|
30
|
+
url: this.keycloakUrl,
|
|
31
|
+
realm: this.keycloakRealm,
|
|
32
|
+
clientId: this.keycloakClientId
|
|
33
|
+
};
|
|
34
|
+
await initKeycloak(keycloakConfig);
|
|
35
|
+
// eslint-disable-next-line
|
|
36
|
+
// Set authentication state and fetch user data if authenticated
|
|
37
|
+
this.authenticated = isAuthenticated();
|
|
38
|
+
if (this.authenticated) {
|
|
39
|
+
this.user = getUser();
|
|
40
|
+
}
|
|
41
|
+
this.authStatusChanged.emit({
|
|
42
|
+
authenticated: this.authenticated,
|
|
43
|
+
user: this.user
|
|
44
|
+
}); // Emit auth status change
|
|
45
|
+
} catch (error) {
|
|
46
|
+
// eslint-disable-next-line
|
|
47
|
+
console.error('Keycloak initialization or login check failed:', error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Method to handle user login
|
|
51
|
+
async handleLogin() {
|
|
52
|
+
try {
|
|
53
|
+
if (!this.authenticated) {
|
|
54
|
+
login(); // Start the Keycloak login process
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
// eslint-disable-next-line
|
|
58
|
+
console.error('Login failed:', error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
getBtnLabel() {
|
|
62
|
+
return this.authenticated ? 'Logout' : 'Login';
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return h("eds-button", {
|
|
66
|
+
key: '35f298ecf951d5b1087f988262ae7d312c5e2d38',
|
|
67
|
+
label: this.getBtnLabel(),
|
|
68
|
+
intent: "primary",
|
|
69
|
+
"extra-class": "text-default",
|
|
70
|
+
"aria-label": this.getBtnLabel(),
|
|
71
|
+
triggerClick: this.authenticated ? this.handleLogout : this.handleLogin.bind(this)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { EdsLogin as eds_login };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 EdsLogoVariations = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.tabIndex = undefined;
|
|
10
|
+
}
|
|
11
|
+
renderContent() {
|
|
12
|
+
switch (this.tabIndex) {
|
|
13
|
+
case 0:
|
|
14
|
+
return h("logo-variations-horizontal", null);
|
|
15
|
+
case 1:
|
|
16
|
+
return h("logo-variations-vertical", null);
|
|
17
|
+
default:
|
|
18
|
+
return h("p", null, "Content not available.");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return h("div", {
|
|
23
|
+
key: '9d6ce0e75030d6e636aab423181b0ce999f6f1b0',
|
|
24
|
+
class: "container"
|
|
25
|
+
}, this.renderContent());
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { EdsLogoVariations as eds_logo_variations };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import { t as toast } from './toastManager-d9eee791.esm.js';
|
|
3
|
+
import { m as matomoOptIn } from './color-0ba8ed56.esm.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import './index-39c58238.esm.js';
|
|
8
|
+
|
|
9
|
+
const edsMatomoNoticeCss = ".fixed{position:fixed}.absolute{position:absolute}.w-full{width:100%}.bottom-0{bottom:0rem}.bottom-4{bottom:0.25rem}.p-4{padding:0.25rem}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.z-10{z-index:10}.left-0{left:0rem}.left-1\\/2{left:50%}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.flex{display:flex}.gap-12{gap:0.75rem}.gap-20{gap:1.25rem}.gap-4{gap:0.25rem}@media (min-width: 750px){.md\\:left-1\\/2{left:50%}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:-translate-x-1\\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}";
|
|
10
|
+
const EdsMatomoNoticeStyle0 = edsMatomoNoticeCss;
|
|
11
|
+
const EdsMatomoNotice = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
registerInstance(this, hostRef);
|
|
14
|
+
this.title = 'Analytics Consent';
|
|
15
|
+
this.description = 'We use anonymous analytics to improve our services. No personal data is collected unless you give your consent.';
|
|
16
|
+
this.showNotice = true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Lifecycle method called before the component is rendered.
|
|
20
|
+
* Checks for the presence of the "mtm_consent" cookie to determine
|
|
21
|
+
* if the notice should be displayed.
|
|
22
|
+
*/
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.checkConsentCookie();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Lifecycle method called after the component has been rendered.
|
|
28
|
+
* Emits `parentContext` events for each `eds-button` in the shadow DOM.
|
|
29
|
+
*/
|
|
30
|
+
componentDidLoad() {
|
|
31
|
+
const btns = this.el.shadowRoot.querySelectorAll('eds-button');
|
|
32
|
+
btns.forEach(b => {
|
|
33
|
+
this.emitContext(b);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Emits a custom `parentContext` event for a given button element.
|
|
38
|
+
* This can be used to provide context information about the component.
|
|
39
|
+
*
|
|
40
|
+
* @param linkElement - The button element to which the event will be dispatched.
|
|
41
|
+
*/
|
|
42
|
+
emitContext(linkElement) {
|
|
43
|
+
const event = new CustomEvent('parentContext', {
|
|
44
|
+
detail: {
|
|
45
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
46
|
+
identifier: null
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
linkElement.dispatchEvent(event);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Checks if the Matomo "mtm_consent" cookie exists in the browser.
|
|
53
|
+
* If the cookie is found, the notice is hidden.
|
|
54
|
+
*/
|
|
55
|
+
checkConsentCookie() {
|
|
56
|
+
const consentCookie = document.cookie.split('; ').find(row => row.startsWith('mtm_consent='));
|
|
57
|
+
//this.showNotice = !consentCookie;
|
|
58
|
+
const sessionDeferred = sessionStorage.getItem('matomo-deferred');
|
|
59
|
+
this.showNotice = !consentCookie && !sessionDeferred;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Handles user consent for analytics tracking.
|
|
63
|
+
* Calls the `matomoOptIn` utility and shows a success toast notification.
|
|
64
|
+
*/
|
|
65
|
+
optInAnalytics() {
|
|
66
|
+
matomoOptIn();
|
|
67
|
+
toast.show('You have opted in to analytics.', 'success');
|
|
68
|
+
this.hideNotice();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Handles user opt-out from analytics tracking.
|
|
72
|
+
* Calls the `matomoOptOut` utility and shows a warning toast notification.
|
|
73
|
+
|
|
74
|
+
private optOutAnalytics() {
|
|
75
|
+
matomoOptOut();
|
|
76
|
+
toast.show('You have opted out of analytics.', 'warning');
|
|
77
|
+
this.hideNotice();
|
|
78
|
+
}*/
|
|
79
|
+
/**
|
|
80
|
+
* Handles "Ask me later" action by storing a session storage entry
|
|
81
|
+
* and hiding the notice for the rest of the session.
|
|
82
|
+
*/
|
|
83
|
+
deferDecision() {
|
|
84
|
+
sessionStorage.setItem('matomo-deferred', 'true');
|
|
85
|
+
toast.show('You can decide later.', 'warning');
|
|
86
|
+
this.hideNotice();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Hides the notice by updating the `showNotice` state.
|
|
90
|
+
*/
|
|
91
|
+
hideNotice() {
|
|
92
|
+
this.showNotice = false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Renders the Matomo consent notice with user options.
|
|
96
|
+
* Includes an accordion for the description and two buttons for user consent.
|
|
97
|
+
*/
|
|
98
|
+
render() {
|
|
99
|
+
if (!this.showNotice) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return h("div", {
|
|
103
|
+
class: "fixed bottom-0 p-8 z-10 grow md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 justify-center"
|
|
104
|
+
}, h("eds-accordion", {
|
|
105
|
+
title: this.title,
|
|
106
|
+
description: this.description,
|
|
107
|
+
switchBg: true,
|
|
108
|
+
expanded: true
|
|
109
|
+
}, h("div", {
|
|
110
|
+
class: "flex items-center gap-4"
|
|
111
|
+
}, h("eds-button", {
|
|
112
|
+
intent: "primary",
|
|
113
|
+
label: "Yes, I agree",
|
|
114
|
+
"aria-label": "Opt-in for analytics",
|
|
115
|
+
onClick: () => this.optInAnalytics()
|
|
116
|
+
}), h("eds-button", {
|
|
117
|
+
intent: "ghost",
|
|
118
|
+
label: "Ask me later",
|
|
119
|
+
"aria-label": "Defer analytics decision",
|
|
120
|
+
onClick: () => this.deferDecision()
|
|
121
|
+
}))));
|
|
122
|
+
}
|
|
123
|
+
get el() {
|
|
124
|
+
return getElement(this);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
EdsMatomoNotice.style = EdsMatomoNoticeStyle0;
|
|
128
|
+
|
|
129
|
+
export { EdsMatomoNotice as eds_matomo_notice };
|
|
@@ -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 };
|