@ebrains/react 0.6.0-alpha.0 → 0.7.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/color-primary-palette_6.entry.esm.js +106 -106
- package/correct-use-of-colors.entry.esm.js +33 -33
- package/eds-accordion_22.entry.esm.js +269 -0
- package/eds-app-root.entry.esm.js +53 -0
- package/eds-avatar_4.entry.esm.js +185 -0
- package/eds-breadcrumb.entry.esm.js +4 -15
- package/eds-card-generic.entry.esm.js +114 -0
- package/eds-card-section.entry.esm.js +56 -0
- package/eds-components-section.entry.esm.js +1 -1
- package/eds-cookies-preference.entry.esm.js +2 -2
- package/eds-docs-palettes.entry.esm.js +1 -1
- package/eds-docs-tokens.entry.esm.js +1 -1
- package/{eds-dropdown_2.entry.esm.js → eds-dropdown.entry.esm.js} +19 -98
- package/eds-feedback.entry.esm.js +82 -0
- package/eds-form.entry.esm.js +253 -253
- package/eds-frame.entry.esm.js +34 -33
- package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
- package/eds-icon-arrow-right.entry.esm.js +1 -1
- package/eds-icon-bluesky.entry.esm.js +1 -1
- package/eds-icon-chevron-down.entry.esm.js +1 -1
- package/eds-icon-chevron-left.entry.esm.js +1 -1
- package/eds-icon-chevron-right.entry.esm.js +1 -1
- package/eds-icon-chevron-up.entry.esm.js +1 -1
- package/eds-icon-close.entry.esm.js +1 -1
- package/eds-icon-copy.entry.esm.js +1 -1
- package/eds-icon-eu.entry.esm.js +1 -1
- package/eds-icon-facebook.entry.esm.js +1 -1
- package/eds-icon-gitlab.entry.esm.js +1 -1
- package/eds-icon-linkedin.entry.esm.js +1 -1
- package/eds-icon-loader.entry.esm.js +1 -1
- package/eds-icon-mastodon.entry.esm.js +1 -1
- package/eds-icon-menu.entry.esm.js +1 -1
- package/eds-icon-more.entry.esm.js +1 -1
- package/eds-icon-search.entry.esm.js +1 -1
- package/eds-icon-star.entry.esm.js +21 -0
- package/eds-icon-success.entry.esm.js +1 -1
- package/eds-icon-thumbs-down.entry.esm.js +21 -0
- package/eds-icon-thumbs-up.entry.esm.js +21 -0
- package/eds-icon-twitter.entry.esm.js +1 -1
- package/eds-icon-user.entry.esm.js +1 -1
- package/eds-icon-youtube.entry.esm.js +1 -1
- package/{keycloak-d502ec16.esm.js → eds-login_2.entry.esm.js} +172 -1
- package/eds-logo-variations.entry.esm.js +1 -1
- package/eds-modal.entry.esm.js +22 -9
- package/eds-progress-bar.entry.esm.js +2 -2
- package/eds-rating.entry.esm.js +37 -37
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-spinner.entry.esm.js +67 -0
- package/eds-steps.entry.esm.js +8 -17
- package/eds-svg-repository.entry.esm.js +8 -2
- package/eds-switch.entry.esm.js +5 -5
- package/eds-tabs.entry.esm.js +14 -26
- package/eds-timeline.entry.esm.js +6 -23
- package/eds-toast-manager.entry.esm.js +62 -0
- package/eds-toast.entry.esm.js +92 -0
- package/eds-tooltip.entry.esm.js +3 -3
- package/eds-trl.entry.esm.js +2 -2
- package/eds-user.entry.esm.js +64 -87
- package/eds-vertical-stepper.entry.esm.js +5 -5
- package/formUtils-ac68474d.esm.js +247 -0
- package/incorrect-use-of-colors.entry.esm.js +7 -7
- package/index.esm.js +1 -1
- package/index.esm2.js +46 -46
- package/logo-space.entry.esm.js +4 -4
- package/logo-variations-horizontal_2.entry.esm.js +26 -26
- package/logo-wrong-usage.entry.esm.js +37 -37
- package/package.json +1 -1
- package/sharedUtils-a550989c.esm.js +17 -0
- package/src/components.d.ts +4 -1
- package/star-0da9b5e9.esm.js +5 -0
- package/thumbs-down-a18fd049.esm.js +5 -0
- package/thumbs-up-c19a71bc.esm.js +6 -0
- package/token-list_3.entry.esm.js +5 -5
- package/token-ratios.entry.esm.js +3 -3
- package/token-spacing.entry.esm.js +26 -26
- package/token-typography.entry.esm.js +2 -2
- package/eds-accordion_13.entry.esm.js +0 -1064
- package/eds-block-break.entry.esm.js +0 -22
- package/eds-footer.entry.esm.js +0 -102
- package/eds-fullscreen-menu.entry.esm.js +0 -143
- package/eds-header.entry.esm.js +0 -130
- package/eds-input_7.entry.esm.js +0 -529
- package/eds-link.entry.esm.js +0 -204
- package/eds-login.entry.esm.js +0 -97
- package/eds-logo.entry.esm.js +0 -87
- package/eds-navigator.entry.esm.js +0 -72
- package/eds-pagination_2.entry.esm.js +0 -472
- package/eds-social-networks.entry.esm.js +0 -74
- package/eds-tab.entry.esm.js +0 -41
- package/eds-tabs-content.entry.esm.js +0 -145
|
@@ -0,0 +1,53 @@
|
|
|
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 EdsAppRoot = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.isAuthenticated = false;
|
|
10
|
+
}
|
|
11
|
+
componentWillLoad() {
|
|
12
|
+
// Create a promise for the initKeycloak event.
|
|
13
|
+
const initKeycloakPromise = new Promise(resolve => {
|
|
14
|
+
document.addEventListener('initKeycloak', event => {
|
|
15
|
+
//console.log('initKeycloak event received:', event.detail);
|
|
16
|
+
resolve(event.detail);
|
|
17
|
+
}, {
|
|
18
|
+
once: true
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
// Create a promise for the authStatusChanged event.
|
|
22
|
+
const authStatusPromise = new Promise(resolve => {
|
|
23
|
+
document.addEventListener('authStatusChanged', event => {
|
|
24
|
+
var _a;
|
|
25
|
+
this.isAuthenticated = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.authenticated;
|
|
26
|
+
//console.log('authStatusChanged event received:', event.detail);
|
|
27
|
+
resolve(event.detail);
|
|
28
|
+
}, {
|
|
29
|
+
once: true
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
// Combine both promises. The splash screen will hide only when both have resolved.
|
|
33
|
+
this.combinedInitPromise = Promise.all([initKeycloakPromise, authStatusPromise]);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return h("div", {
|
|
37
|
+
key: 'f7ff644cea84bfc78190afcfa33f1f6d6c6de29a'
|
|
38
|
+
}, h("eds-splash-screen", {
|
|
39
|
+
key: '5e04f163eafe8f0d55394b8f508386bac013907e',
|
|
40
|
+
inverse: true,
|
|
41
|
+
initPromise: this.combinedInitPromise
|
|
42
|
+
}), h("eds-login", {
|
|
43
|
+
key: '94c9dc0546e48fe8f9e6fc17fde9dcbf75fbe3bc',
|
|
44
|
+
"keycloak-url": "http://localhost:8080",
|
|
45
|
+
"keycloak-realm": "nigeor-realm",
|
|
46
|
+
"keycloak-client-id": "stencil-app"
|
|
47
|
+
}), h("main", {
|
|
48
|
+
key: '975cfb32924ecf0a4bb7d8f4788792eae500e166'
|
|
49
|
+
}, this.isAuthenticated ? h("h1", null, "Welcome, authenticated user!") : h("h1", null, "Please log in.")));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { EdsAppRoot as eds_app_root };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import { g as gradientBGColorVariants } from './color-2554aad6.esm.js';
|
|
3
|
+
import { c as cva } from './index-39c58238.esm.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
|
|
8
|
+
const edsAvatarCss = ".border-inside {\n position: relative;\n\n &::after {\n pointer-events: none;\n }\n\n &::after {\n position: absolute;\n }\n\n &::after {\n inset: 0rem;\n }\n\n &::after {\n z-index: 1;\n }\n\n &::after {\n border-radius: 8px;\n }\n\n &::after {\n border-width: 1px;\n }\n\n &::after {\n border-width: 2px;\n }\n\n &::after {\n border: 2px solid rgba(0, 0, 0, .1);\n }\n\n &::after {\n content: '';\n }\n}\n\n.border-inside-pill {\n &::after {\n border-radius: 100px;\n }\n\n &::after {\n content: '';\n }\n}\n\n.border-inside-inverse {\n &::after {\n border: 2px solid rgba(255, 255, 255, 0.3);\n }\n\n &::after {\n content: '';\n }\n}\n\n.aspect-1x1 {\n aspect-ratio: 1/1;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.overflow-hidden {\n overflow: hidden;\n}\n\n.px-4 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.rounded-pill {\n border-radius: 100px;\n}\n\n.rounded-sm {\n border-radius: 8px;\n}\n\n.rounded-xs {\n border-radius: 4px;\n}\n\n\n.bg-dark {\n background-color: var(--grey-300);\n}\n\n.bg-darker {\n background-color: var(--grey-400);\n}\n\n.bg-stronger {\n background-color: var(--grey-900);\n}\n\n.bg-strongest {\n background-color: var(--black);\n}\n\n.text-accent {\n color: var(--green-500);\n}\n\n.text-default {\n color: var(--black);\n}\n\n.\\!no-underline {\n text-decoration-line: none !important;\n}\n\n.f-ui-01 {\n font-family: var(--f-ui-01-fontFamily);\n font-weight: var(--f-ui-01-fontWeight);\n font-size: var(--f-ui-01-fontSize);\n line-height: var(--f-ui-01-lineHeight);\n letter-spacing: var(--f-ui-01-letterSpacing);\n}\n\n.w-32 {\n width: 2rem;\n}\n\n.w-44 {\n width: 2.75rem;\n}\n\n.w-\\[54px\\] {\n width: 54px;\n}";
|
|
9
|
+
const EdsAvatarStyle0 = edsAvatarCss;
|
|
10
|
+
const EdsAvatar = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.firstName = 'User';
|
|
14
|
+
this.lastName = 'Avatar';
|
|
15
|
+
this.picture = undefined;
|
|
16
|
+
this.initials = undefined;
|
|
17
|
+
this.color = undefined;
|
|
18
|
+
this.rounded = false;
|
|
19
|
+
this.initialsStrong = false;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Computed initials based on the provided `initials` prop or derived from `firstName` and `lastName`.
|
|
23
|
+
* @returns {string | undefined} Initials for display in the avatar.
|
|
24
|
+
*/
|
|
25
|
+
get computedInitials() {
|
|
26
|
+
if (this.initials) {
|
|
27
|
+
return (this.initials.match(/.{1,3}/g) || [])[0] || '';
|
|
28
|
+
} else if (this.firstName && this.lastName) {
|
|
29
|
+
return `${this.firstName.charAt(0)}${this.lastName.charAt(0)}`.toUpperCase();
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Computes the CSS classes for the avatar container based on provided props like `rounded`, `color`, and `picture`.
|
|
35
|
+
* @returns {string} List of CSS classes to apply to the avatar container.
|
|
36
|
+
*/
|
|
37
|
+
get containerClasses() {
|
|
38
|
+
return ['border-inside', 'aspect-1x1', 'flex', 'items-center', 'justify-center', 'overflow-hidden', this.picture ? '' : 'px-4', this.rounded ? 'rounded-pill border-inside-pill w-32' : 'w-[54px] rounded-sm', this.color ? 'border-inside-inverse' : '', this.color === 'grey' ? 'bg-dark' : this.color && !this.picture ? gradientBGColorVariants({
|
|
39
|
+
color: this.color,
|
|
40
|
+
direction: 'top',
|
|
41
|
+
pseudo: false
|
|
42
|
+
}) : !this.picture ? 'bg-strongest text-accent' : ''].join(' ');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders the avatar component. Displays either an image using `eds-img` or initials depending on whether `picture` or `computedInitials` is set.
|
|
46
|
+
* @returns {JSX.Element} The rendered avatar component.
|
|
47
|
+
*/
|
|
48
|
+
render() {
|
|
49
|
+
return h("div", {
|
|
50
|
+
key: '47ee5ffd12c0f90c536dea77b3ffa9120d67f37f',
|
|
51
|
+
class: this.containerClasses
|
|
52
|
+
}, this.picture ? h("eds-img", {
|
|
53
|
+
src: this.picture,
|
|
54
|
+
width: 54,
|
|
55
|
+
height: 54,
|
|
56
|
+
sizes: "120px",
|
|
57
|
+
alt: `${this.firstName} ${this.lastName}`,
|
|
58
|
+
lazyload: true,
|
|
59
|
+
withBg: true
|
|
60
|
+
}) : h("abbr", {
|
|
61
|
+
title: this.computedInitials || `${this.firstName} ${this.lastName}`,
|
|
62
|
+
class: "!no-underline f-ui-01"
|
|
63
|
+
}, this.computedInitials));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
EdsAvatar.style = EdsAvatarStyle0;
|
|
67
|
+
const edsCardDescCss = ".f-ui-02-light{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}.f-ui-03-light{font-family:var(--f-ui-03-light-fontFamily);font-weight:var(--f-ui-03-light-fontWeight);font-size:var(--f-ui-03-light-fontSize);line-height:var(--f-ui-03-light-lineHeight);letter-spacing:var(--f-ui-03-light-letterSpacing)}.text-light{color:var(--grey-700)}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}";
|
|
68
|
+
const EdsCardDescStyle0 = edsCardDescCss;
|
|
69
|
+
const EdsCardDesc = class {
|
|
70
|
+
constructor(hostRef) {
|
|
71
|
+
registerInstance(this, hostRef);
|
|
72
|
+
this.description = undefined;
|
|
73
|
+
this.descClass = 'f-ui-03-light';
|
|
74
|
+
this.truncate = true;
|
|
75
|
+
this.truncateLines = '3';
|
|
76
|
+
}
|
|
77
|
+
getTruncateClass() {
|
|
78
|
+
return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return h("p", {
|
|
82
|
+
key: '71495cbd6ef4e7d66c4c22a37f8120624ecf57fb',
|
|
83
|
+
class: `text-light ${this.descClass}`
|
|
84
|
+
}, h("span", {
|
|
85
|
+
key: '8708178f7b48cc1f31aac749f50fe92b72c39ab8',
|
|
86
|
+
class: this.getTruncateClass()
|
|
87
|
+
}, this.description));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
EdsCardDesc.style = EdsCardDescStyle0;
|
|
91
|
+
const edsCardTitleCss = "a{all:unset;display:inline;color:inherit;text-decoration:none;cursor:pointer}h1,h2,h3,h4,h5,h6{margin:0}.f-heading-01{font-family:var(--f-heading-01-fontFamily);font-weight:var(--f-heading-01-fontWeight);font-size:var(--f-heading-01-fontSize);line-height:var(--f-heading-01-lineHeight);letter-spacing:var(--f-heading-01-letterSpacing)}.f-heading-02{font-family:var(--f-heading-02-fontFamily);font-weight:var(--f-heading-02-fontWeight);font-size:var(--f-heading-02-fontSize);line-height:var(--f-heading-02-lineHeight);letter-spacing:var(--f-heading-02-letterSpacing)}.f-heading-03{font-family:var(--f-heading-03-fontFamily);font-weight:var(--f-heading-03-fontWeight);font-size:var(--f-heading-03-fontSize);line-height:var(--f-heading-03-lineHeight);letter-spacing:var(--f-heading-03-letterSpacing)}.f-heading-04{font-family:var(--f-heading-04-fontFamily);font-weight:var(--f-heading-04-fontWeight);font-size:var(--f-heading-04-fontSize);line-height:var(--f-heading-04-lineHeight);letter-spacing:var(--f-heading-04-letterSpacing)}.f-heading-05{font-family:var(--f-heading-05-fontFamily);font-weight:var(--f-heading-05-fontWeight);font-size:var(--f-heading-05-fontSize);line-height:var(--f-heading-05-lineHeight);letter-spacing:var(--f-heading-05-letterSpacing)}.f-heading-06{font-family:var(--f-heading-06-fontFamily);font-weight:var(--f-heading-06-fontWeight);font-size:var(--f-heading-06-fontSize);line-height:var(--f-heading-06-lineHeight);letter-spacing:var(--f-heading-06-letterSpacing)}.break-words{overflow-wrap:break-word}.after\\:absolute::after{position:absolute}.after\\:inset-0::after{inset:0rem}.after\\:z-10::after{z-index:10}.after\\:content-\\[\\'\\'\\]::after{--tw-content:'';content:var(--tw-content)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}";
|
|
92
|
+
const EdsCardTitleStyle0 = edsCardTitleCss;
|
|
93
|
+
const EdsCardTitle = class {
|
|
94
|
+
constructor(hostRef) {
|
|
95
|
+
registerInstance(this, hostRef);
|
|
96
|
+
this.url = undefined;
|
|
97
|
+
this.titleClass = undefined;
|
|
98
|
+
this.headingLevel = 'h3';
|
|
99
|
+
this.externalLink = false;
|
|
100
|
+
this.cardTitle = undefined;
|
|
101
|
+
this.hierarchy = true;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Dynamically generate the title class based on the heading level.
|
|
105
|
+
*/
|
|
106
|
+
getTitleClass() {
|
|
107
|
+
const levelMap = this.hierarchy ? {
|
|
108
|
+
h1: '05',
|
|
109
|
+
h2: '05',
|
|
110
|
+
h3: '05',
|
|
111
|
+
h4: '05',
|
|
112
|
+
h5: '05',
|
|
113
|
+
h6: '06'
|
|
114
|
+
} : {
|
|
115
|
+
h1: '01',
|
|
116
|
+
h2: '02',
|
|
117
|
+
h3: '03',
|
|
118
|
+
h4: '04',
|
|
119
|
+
h5: '05',
|
|
120
|
+
h6: '06'
|
|
121
|
+
};
|
|
122
|
+
return `f-heading-${levelMap[this.headingLevel]}`;
|
|
123
|
+
}
|
|
124
|
+
/*private getTag() {
|
|
125
|
+
if (this.url) {
|
|
126
|
+
return 'a';
|
|
127
|
+
}
|
|
128
|
+
return 'span';
|
|
129
|
+
}*/
|
|
130
|
+
render() {
|
|
131
|
+
//const Tag = this.getTag();
|
|
132
|
+
const Heading = this.headingLevel;
|
|
133
|
+
return h(Heading, {
|
|
134
|
+
key: 'bb97dc6dd53adda14ef251b2ec32952791438986',
|
|
135
|
+
class: this.getTitleClass()
|
|
136
|
+
}, h("a", {
|
|
137
|
+
key: '37b6ac0668257d27fb3f03a6225a2d48e1fd1f79',
|
|
138
|
+
class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none",
|
|
139
|
+
href: this.url,
|
|
140
|
+
target: this.externalLink ? '_blank' : undefined,
|
|
141
|
+
rel: this.externalLink ? 'noopener noreferrer' : undefined
|
|
142
|
+
}, this.cardTitle));
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
EdsCardTitle.style = EdsCardTitleStyle0;
|
|
146
|
+
const edsTagCss = ".f-ui-05{font-family:var(--f-ui-05-fontFamily);font-weight:var(--f-ui-05-fontWeight);font-size:var(--f-ui-05-fontSize);line-height:var(--f-ui-05-lineHeight);letter-spacing:var(--f-ui-05-letterSpacing)}.py-1{padding-top:0.0625rem;padding-bottom:0.0625rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.border-2{border-width:2px}.rounded-pill{border-radius:100px}.border-default{border:2px solid var(--black)}.text-inverse{color:var(--white)}.bg-strongest{background-color:var(--black)}.text-\\[\\#0034CB\\]{--tw-text-opacity:1;color:rgb(0 52 203 / var(--tw-text-opacity))}.border-\\[\\#0034CB\\]{--tw-border-opacity:1;border:2px solid rgb(0 52 203 / var(--tw-border-opacity))}.text-light{color:var(--grey-700)}.bg-strongest-soft{background-color:rgba(0, 0, 0, .05)}.border-transparent{border-color:var(--transparent)}.border-inverse{border-color:var(--white)}.bg-inverse{background-color:var(--white)}.text-lighter{color:var(--grey-600)}";
|
|
147
|
+
const EdsTagStyle0 = edsTagCss;
|
|
148
|
+
|
|
149
|
+
// Define the CVA for the tag styles
|
|
150
|
+
const tagStyles = cva(['f-ui-05 py-1 px-4 border-2 rounded-pill'],
|
|
151
|
+
// Base classes
|
|
152
|
+
{
|
|
153
|
+
variants: {
|
|
154
|
+
intent: {
|
|
155
|
+
default: 'border-default',
|
|
156
|
+
strong: 'text-inverse bg-strongest border-default',
|
|
157
|
+
accent: 'text-[#0034CB] border-[#0034CB]',
|
|
158
|
+
weak: 'text-light bg-strongest-soft border-transparent',
|
|
159
|
+
inverse: 'border-inverse text-inverse',
|
|
160
|
+
'inverse-strong': 'bg-inverse border-inverse text-lighter'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
defaultVariants: {
|
|
164
|
+
intent: 'default'
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const EdsTag = class {
|
|
168
|
+
constructor(hostRef) {
|
|
169
|
+
registerInstance(this, hostRef);
|
|
170
|
+
this.label = undefined;
|
|
171
|
+
this.intent = 'default';
|
|
172
|
+
}
|
|
173
|
+
render() {
|
|
174
|
+
const classes = tagStyles({
|
|
175
|
+
intent: this.intent
|
|
176
|
+
});
|
|
177
|
+
return h("span", {
|
|
178
|
+
key: '2f4b0011094538aaa0a7cc855eadc1b39c9dc028',
|
|
179
|
+
class: classes
|
|
180
|
+
}, this.label);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
EdsTag.style = EdsTagStyle0;
|
|
184
|
+
|
|
185
|
+
export { EdsAvatar as eds_avatar, EdsCardDesc as eds_card_desc, EdsCardTitle as eds_card_title, EdsTag as eds_tag };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import { p as parseData } from './sharedUtils-a550989c.esm.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'react/jsx-runtime';
|
|
4
5
|
import 'react-dom';
|
|
@@ -34,19 +35,7 @@ const EdsBreadcrumb = class {
|
|
|
34
35
|
* Watches for changes to the `items` prop and parses it.
|
|
35
36
|
*/
|
|
36
37
|
parseItems(newValue) {
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
const parsed = JSON.parse(newValue);
|
|
40
|
-
this.parsedItems = Array.isArray(parsed) ? parsed : [];
|
|
41
|
-
} catch (e) {
|
|
42
|
-
//console.error('Error parsing breadcrumb items:', e);
|
|
43
|
-
this.parsedItems = [];
|
|
44
|
-
}
|
|
45
|
-
} else if (Array.isArray(newValue)) {
|
|
46
|
-
this.parsedItems = newValue;
|
|
47
|
-
} else {
|
|
48
|
-
this.parsedItems = [];
|
|
49
|
-
}
|
|
38
|
+
this.parsedItems = parseData(newValue);
|
|
50
39
|
}
|
|
51
40
|
/**
|
|
52
41
|
* Lifecycle method that runs when the component is about to be loaded.
|
|
@@ -134,10 +123,10 @@ const EdsBreadcrumb = class {
|
|
|
134
123
|
render() {
|
|
135
124
|
const itemsToRender = this.getTruncatedItems();
|
|
136
125
|
return h("nav", {
|
|
137
|
-
key: '
|
|
126
|
+
key: '02537ec4208124f8a5ba564f7487f6fad552f7da',
|
|
138
127
|
"aria-label": "Breadcrumb"
|
|
139
128
|
}, h("ol", {
|
|
140
|
-
key: '
|
|
129
|
+
key: 'ac6e2ecd59a8ddef52e004d95fbb492f78a9b248',
|
|
141
130
|
class: "flex items-center space-x-2"
|
|
142
131
|
}, itemsToRender.map((item, index) => {
|
|
143
132
|
const isLast = index === itemsToRender.length - 1;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import { p as parseData } from './sharedUtils-a550989c.esm.js';
|
|
3
|
+
import { s as sendAnalytics } from './analytics-44b1416b.esm.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
|
|
8
|
+
const edsCardGenericCss = ".h-auto{height:auto}.h-full{height:100%}.\\!min-h-20{min-height:1.25rem !important}.min-h-120{min-height:120px}.min-h-156{min-height:156px}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.effect-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.hover\\:shadow-hover:hover{--tw-shadow:0px 0px 16px rgba(0, 0, 0, 0.2);--tw-shadow-colored:0px 0px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.cursor-pointer{cursor:pointer}.border-soft{border-color:rgba(0, 0, 0, .15 )}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.effect-focus-within{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.effect-focus-within:focus-within{outline-style:solid}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grow{flex-grow:1}.flex-col{flex-direction:column}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-12{padding:0.75rem}.p-16{padding:1rem}.mt-6{margin-top:0.375rem}.mt-8{margin-top:0.5rem}.gap-y-4{row-gap:0.25rem}.order-first{order:-9999}.mb-10{margin-bottom:0.625rem}.mb-12{margin-bottom:0.75rem}";
|
|
9
|
+
const EdsCardGenericStyle0 = edsCardGenericCss;
|
|
10
|
+
const EdsCardGeneric = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.parentContext = null; // Accepts the entire event detail or null
|
|
14
|
+
this.cardTitle = undefined;
|
|
15
|
+
this.url = undefined;
|
|
16
|
+
this.description = undefined;
|
|
17
|
+
this.image = undefined;
|
|
18
|
+
this.avatar = undefined;
|
|
19
|
+
this.shortAbbreviation = undefined;
|
|
20
|
+
this.headingLevel = 'h3';
|
|
21
|
+
this.tags = [];
|
|
22
|
+
this.tiny = false;
|
|
23
|
+
this.bg = true;
|
|
24
|
+
this.withHover = true;
|
|
25
|
+
this.hierarchy = true;
|
|
26
|
+
this.parsedImage = null;
|
|
27
|
+
}
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
if (this.image) {
|
|
30
|
+
try {
|
|
31
|
+
if (typeof this.image === 'object') {
|
|
32
|
+
// If image is already an object, assign it directly
|
|
33
|
+
this.parsedImage = this.image;
|
|
34
|
+
} else if (typeof this.image === 'string') {
|
|
35
|
+
// If image is a string, try to parse it
|
|
36
|
+
this.parsedImage = JSON.parse(this.image);
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
// eslint-disable-next-line
|
|
40
|
+
console.error('Error parsing image prop:', error);
|
|
41
|
+
this.parsedImage = {}; // Assign a fallback empty object in case of an error
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
handleParentContext(event) {
|
|
46
|
+
if (event.target !== this.el) {
|
|
47
|
+
// Ignore the event if it's not targeted at this specific instance
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
//console.log(event.detail);
|
|
51
|
+
this.parentContext = event.detail;
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parses the `tags` prop into an array of link objects.
|
|
56
|
+
* Returns an empty array if parsing fails or if `tags` is not a valid JSON string or object.
|
|
57
|
+
*
|
|
58
|
+
* @returns {any[]} Array of parsed link objects
|
|
59
|
+
*/
|
|
60
|
+
get parsedTags() {
|
|
61
|
+
return parseData(this.tags);
|
|
62
|
+
}
|
|
63
|
+
articleClasses() {
|
|
64
|
+
return [this.description ? this.tiny ? 'min-h-120' : 'min-h-156' : 'h-auto', this.bg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
|
|
65
|
+
}
|
|
66
|
+
handleClick() {
|
|
67
|
+
var _a;
|
|
68
|
+
sendAnalytics({
|
|
69
|
+
category: 'ui-component',
|
|
70
|
+
parentContext: this.parentContext,
|
|
71
|
+
tag: this.el.tagName.toLowerCase(),
|
|
72
|
+
name: ((_a = this.cardTitle) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
73
|
+
action: 'click'
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return h("article", {
|
|
78
|
+
key: '440a448c841370838c0c66610bd1266b46f66541',
|
|
79
|
+
class: this.articleClasses(),
|
|
80
|
+
onClick: () => this.handleClick()
|
|
81
|
+
}, h("eds-card-title", {
|
|
82
|
+
key: '292d93a9a993c6dcbfd276097a21d3984b1794c4',
|
|
83
|
+
"heading-level": this.headingLevel,
|
|
84
|
+
titleClass: this.image ? 'f-ui-01' : undefined,
|
|
85
|
+
"card-title": this.cardTitle,
|
|
86
|
+
url: this.url,
|
|
87
|
+
hierarchy: this.hierarchy
|
|
88
|
+
}), this.description && h("eds-card-desc", {
|
|
89
|
+
key: '4b304cc3c65a42b3b1bcbebd9968c45e79cdabf7',
|
|
90
|
+
class: "mt-8",
|
|
91
|
+
"truncate-lines": "3",
|
|
92
|
+
description: this.description
|
|
93
|
+
}), this.parsedImage ? h("eds-img", Object.assign({
|
|
94
|
+
class: "mt-8"
|
|
95
|
+
}, this.parsedImage)) : this.avatar || this.shortAbbreviation ? h("eds-avatar", {
|
|
96
|
+
class: "order-first mb-12",
|
|
97
|
+
picture: this.avatar,
|
|
98
|
+
initials: this.shortAbbreviation
|
|
99
|
+
}) : null, h("div", {
|
|
100
|
+
key: 'cb5c191f6c190fb6edb46446187dbf6b8c1b778b',
|
|
101
|
+
class: "flex flex-wrap gap-y-4"
|
|
102
|
+
}, this.parsedTags.map((tag, index) => h("eds-tag", {
|
|
103
|
+
key: index,
|
|
104
|
+
intent: tag.style,
|
|
105
|
+
label: tag.label
|
|
106
|
+
}))), ' ');
|
|
107
|
+
}
|
|
108
|
+
get el() {
|
|
109
|
+
return getElement(this);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
EdsCardGeneric.style = EdsCardGenericStyle0;
|
|
113
|
+
|
|
114
|
+
export { EdsCardGeneric as eds_card_generic };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import { p as parseData } from './sharedUtils-a550989c.esm.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'react-dom';
|
|
6
|
+
|
|
7
|
+
const edsCardSectionCss = "ol,ul,menu{list-style:none;margin:0;padding:0}.w-full{width:100%}.grid-layout{display:grid;grid-template-columns:repeat(var(--container-grid-columns, var(--grid-columns)), 1fr);grid-gap:var(--inner-gutter)}.grid-cols-4{grid-template-columns:repeat(4, minmax(0, 1fr))}.grid-cols-4[class*=\"grid-line-x\"][class*=\"grid-line-x\"]>*:nth-child(n)::before{border-bottom-width:1px}.grid-cols-4[class*=\"grid-line-xfull\"]>*:nth-child(n)::before{inset-inline-start:calc(var(--inner-gutter) / -2);inset-inline-end:calc(var(--inner-gutter) / -2)}.grid-cols-4[class*=\"grid-line-x\"]>*:nth-child(4n+1)::before{inset-inline-start:0}.grid-cols-4[class*=\"grid-line-x\"]>*:nth-child(4n+4)::before{inset-inline-end:0}.grid-cols-4[class*=\"grid-line-x\"]>*:nth-child(4n+1):nth-last-child(-n+4)::before{border-bottom-width:0}.grid-cols-4[class*=\"grid-line-x\"]>*:nth-child(4n+1):nth-last-child(-n+4)~*::before{border-bottom-width:0}.grid-cols-4[class*=\"grid-line-y\"][class*=\"grid-line-y\"]>*:nth-child(n)::after{border-inline-end-width:1px}.grid-cols-4[class*=\"grid-line-y\"][class*=\"grid-line-y\"]>*:nth-child(4n+4)::after{border-inline-end-width:0}.grid-cols-4[class*=\"grid-line-y\"][class*=\"grid-line-y\"]>*:nth-child(-n+4)::after{top:0}.grid-cols-4[class*=\"grid-line-y\"][class*=\"grid-line-y\"]>*:nth-child(4n+1):nth-last-child(-n+4)::after{bottom:0}.grid-cols-4[class*=\"grid-line-y\"][class*=\"grid-line-y\"]>*:nth-child(4n+1):nth-last-child(-n+4)~li::after{bottom:0}.grid-col-span-4{--container-grid-columns:4;grid-column:span 4 / span 4}.gap-y-4{row-gap:0.25rem}.gap-y-8{row-gap:0.5rem}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}@media (min-width: 750px){.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:gap-y-12{row-gap:0.75rem}.md\\:pt-28{padding-top:1.75rem}}@media (min-width: 750px){.md\\:grid-col-span-1{--container-grid-columns:1;grid-column:span 1 / span 1}.md\\:grid-col-span-2{--container-grid-columns:2;grid-column:span 2 / span 2}.md\\:grid-col-span-3{--container-grid-columns:3;grid-column:span 3 / span 3}.md\\:grid-col-span-4{--container-grid-columns:4;grid-column:span 4 / span 4}.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.md\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:grid-col-span-5{--container-grid-columns:5;grid-column:span 5 / span 5}.lg\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.lg\\:grid-col-start-7{grid-column-start:7}.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-8-cols>*{--container-grid-columns:8}.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:order-last{order:9999}.lg\\:order-none{order:0}.lg\\:mt-0{margin-top:0rem}.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:w-\\[150px\\]{width:150px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[720px\\]{max-width:720px}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:gap-y-16{row-gap:1rem}.lg\\:px-28{padding-left:1.75rem;padding-right:1.75rem}.lg\\:\\!pl-12{padding-left:0.75rem !important}.lg\\:\\!pr-12{padding-right:0.75rem !important}}";
|
|
8
|
+
const EdsCardSectionStyle0 = edsCardSectionCss;
|
|
9
|
+
const EdsCardSection = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.cards = [];
|
|
13
|
+
this.occupyCols = 1;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parses the `cards` JSON string prop into an array of card objects.
|
|
17
|
+
* If parsing fails, returns an empty array.
|
|
18
|
+
*
|
|
19
|
+
* @returns {any[]} An array of parsed card objects.
|
|
20
|
+
*/
|
|
21
|
+
get parsedCards() {
|
|
22
|
+
return parseData(this.cards);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders the card section as a grid layout.
|
|
26
|
+
* Each parsed card object is mapped to an `<eds-card-generic>` component,
|
|
27
|
+
* displaying card details such as title, description, avatar, etc.
|
|
28
|
+
*
|
|
29
|
+
* @returns {JSX.Element} The rendered section containing a list of cards.
|
|
30
|
+
*/
|
|
31
|
+
render() {
|
|
32
|
+
return h("section", {
|
|
33
|
+
key: 'eb64be830a5a1b752fadd0a8a76be9240b70cfe8',
|
|
34
|
+
class: "w-full"
|
|
35
|
+
}, h("ul", {
|
|
36
|
+
key: 'd4eb8d8492a67f7491535953e0e37172fc9e09ff',
|
|
37
|
+
class: "grid-layout grid-cols-4 gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
38
|
+
}, this.parsedCards.map(card => h("li", {
|
|
39
|
+
class: `grid-col-span-4 md:grid-col-span-${this.occupyCols} flex flex-col`
|
|
40
|
+
}, h("eds-card-generic", {
|
|
41
|
+
cardTitle: card.title,
|
|
42
|
+
description: card.description,
|
|
43
|
+
avatar: card.avatar,
|
|
44
|
+
headingLevel: card.headingLevel,
|
|
45
|
+
tags: card.tags,
|
|
46
|
+
url: card.url,
|
|
47
|
+
bg: card.bg,
|
|
48
|
+
tiny: card.tiny,
|
|
49
|
+
image: card.image,
|
|
50
|
+
withHover: card.withHover
|
|
51
|
+
})))));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
EdsCardSection.style = EdsCardSectionStyle0;
|
|
55
|
+
|
|
56
|
+
export { EdsCardSection as eds_card_section };
|
|
@@ -29,9 +29,9 @@ const EdsCookiesPreference = class {
|
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
31
|
return h("div", {
|
|
32
|
-
key: '
|
|
32
|
+
key: '48f67648644ae9c8e645791ad3cbba5491866dc5'
|
|
33
33
|
}, h("eds-link", {
|
|
34
|
-
key: '
|
|
34
|
+
key: '50154721f0f44e811ebe362e18bcf8cfb77b8f64',
|
|
35
35
|
size: "small",
|
|
36
36
|
intent: this.intent,
|
|
37
37
|
label: this.buttonText,
|