@ebrains/react 0.3.0-alpha.0 → 0.5.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/analytics-1cde8e4a.esm.js +47 -0
- package/color-2554aad6.esm.js +122 -0
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/correct-use-of-colors.entry.esm.js +33 -33
- package/eds-accordion.entry.esm.js +24 -30
- package/eds-alert_17.entry.esm.js +187 -0
- package/{eds-card-desc_3.entry.esm.js → eds-avatar_4.entry.esm.js} +71 -7
- package/eds-card-generic.entry.esm.js +6 -7
- package/eds-card-project.entry.esm.js +12 -11
- package/eds-card-section.entry.esm.js +4 -4
- package/eds-card-tags.entry.esm.js +1 -1
- package/eds-card-tool.entry.esm.js +5 -6
- package/eds-card-wrapper.entry.esm.js +4 -4
- package/eds-code-block.entry.esm.js +56 -9
- package/eds-components-section.entry.esm.js +14 -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 +235 -0
- package/eds-form.entry.esm.js +59 -23
- package/eds-frame.entry.esm.js +4 -4
- 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-success.entry.esm.js +1 -1
- 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/eds-input_7.entry.esm.js +39 -28
- package/eds-login.entry.esm.js +66 -45
- package/eds-logo-variations.entry.esm.js +1 -1
- package/eds-matomo-notice.entry.esm.js +1 -2
- package/eds-modal.entry.esm.js +57 -42
- package/eds-navigator.entry.esm.js +5 -5
- package/eds-pagination_2.entry.esm.js +35 -19
- package/eds-progress-bar.entry.esm.js +7 -2
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-svg-repository.entry.esm.js +1 -1
- package/eds-tab.entry.esm.js +1 -1
- package/eds-tabs-content.entry.esm.js +5 -5
- package/eds-tabs.entry.esm.js +4 -4
- package/eds-timeline.entry.esm.js +6 -5
- package/eds-tooltip.entry.esm.js +12 -3
- package/eds-trl.entry.esm.js +9 -10
- package/eds-user.entry.esm.js +118 -0
- package/eds-vertical-stepper.entry.esm.js +81 -0
- package/incorrect-use-of-colors.entry.esm.js +7 -7
- package/index.esm.js +1 -1
- package/index.esm2.js +18 -13
- package/{keycloak-13893af6.esm.js → keycloak-d502ec16.esm.js} +219 -168
- 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/src/components.d.ts +3 -1
- 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/color-0ba8ed56.esm.js +0 -423
- package/eds-alert.entry.esm.js +0 -102
- package/eds-avatar_17.entry.esm.js +0 -209
- package/eds-rating.entry.esm.js +0 -71
|
@@ -1,9 +1,69 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index.esm2.js';
|
|
2
|
+
import { g as gradientBGColorVariants } from './color-2554aad6.esm.js';
|
|
2
3
|
import { c as cva } from './index-39c58238.esm.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import 'react/jsx-runtime';
|
|
5
6
|
import 'react-dom';
|
|
6
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;
|
|
7
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}";
|
|
8
68
|
const EdsCardDescStyle0 = edsCardDescCss;
|
|
9
69
|
const EdsCardDesc = class {
|
|
@@ -19,10 +79,10 @@ const EdsCardDesc = class {
|
|
|
19
79
|
}
|
|
20
80
|
render() {
|
|
21
81
|
return h("p", {
|
|
22
|
-
key: '
|
|
82
|
+
key: '71495cbd6ef4e7d66c4c22a37f8120624ecf57fb',
|
|
23
83
|
class: `text-light ${this.descClass}`
|
|
24
84
|
}, h("span", {
|
|
25
|
-
key: '
|
|
85
|
+
key: '8708178f7b48cc1f31aac749f50fe92b72c39ab8',
|
|
26
86
|
class: this.getTruncateClass()
|
|
27
87
|
}, this.description));
|
|
28
88
|
}
|
|
@@ -71,10 +131,10 @@ const EdsCardTitle = class {
|
|
|
71
131
|
//const Tag = this.getTag();
|
|
72
132
|
const Heading = this.headingLevel;
|
|
73
133
|
return h(Heading, {
|
|
74
|
-
key: '
|
|
134
|
+
key: 'bb97dc6dd53adda14ef251b2ec32952791438986',
|
|
75
135
|
class: this.getTitleClass()
|
|
76
136
|
}, h("a", {
|
|
77
|
-
key: '
|
|
137
|
+
key: '37b6ac0668257d27fb3f03a6225a2d48e1fd1f79',
|
|
78
138
|
class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none",
|
|
79
139
|
href: this.url,
|
|
80
140
|
target: this.externalLink ? '_blank' : undefined,
|
|
@@ -108,6 +168,7 @@ const EdsTag = class {
|
|
|
108
168
|
constructor(hostRef) {
|
|
109
169
|
registerInstance(this, hostRef);
|
|
110
170
|
this.label = undefined;
|
|
171
|
+
this.ariaLabel = '';
|
|
111
172
|
this.intent = 'default';
|
|
112
173
|
}
|
|
113
174
|
/**
|
|
@@ -115,15 +176,18 @@ const EdsTag = class {
|
|
|
115
176
|
* @returns The rendered HTML for the tag component with the applied styles and label.
|
|
116
177
|
*/
|
|
117
178
|
render() {
|
|
179
|
+
var _a;
|
|
118
180
|
const classes = tagStyles({
|
|
119
181
|
intent: this.intent
|
|
120
182
|
});
|
|
183
|
+
const accessibleLabel = ((_a = this.ariaLabel) === null || _a === void 0 ? void 0 : _a.length) ? this.ariaLabel : this.label;
|
|
121
184
|
return h("span", {
|
|
122
|
-
key: '
|
|
123
|
-
class: classes
|
|
185
|
+
key: '6a517f42aeb641c95d96ecd6c3090a317a3195c6',
|
|
186
|
+
class: classes,
|
|
187
|
+
"aria-label": accessibleLabel
|
|
124
188
|
}, this.label);
|
|
125
189
|
}
|
|
126
190
|
};
|
|
127
191
|
EdsTag.style = EdsTagStyle0;
|
|
128
192
|
|
|
129
|
-
export { EdsCardDesc as eds_card_desc, EdsCardTitle as eds_card_title, EdsTag as eds_tag };
|
|
193
|
+
export { EdsAvatar as eds_avatar, EdsCardDesc as eds_card_desc, EdsCardTitle as eds_card_title, EdsTag as eds_tag };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { s as sendAnalytics } from './
|
|
2
|
+
import { s as sendAnalytics } from './analytics-1cde8e4a.esm.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
6
|
-
import './index-39c58238.esm.js';
|
|
7
6
|
|
|
8
7
|
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
8
|
const EdsCardGenericStyle0 = edsCardGenericCss;
|
|
@@ -18,7 +17,7 @@ const EdsCardGeneric = class {
|
|
|
18
17
|
this.avatar = undefined;
|
|
19
18
|
this.shortAbbreviation = undefined;
|
|
20
19
|
this.headingLevel = 'h3';
|
|
21
|
-
this.tags =
|
|
20
|
+
this.tags = [];
|
|
22
21
|
this.tiny = false;
|
|
23
22
|
this.bg = true;
|
|
24
23
|
this.withHover = true;
|
|
@@ -86,18 +85,18 @@ const EdsCardGeneric = class {
|
|
|
86
85
|
}
|
|
87
86
|
render() {
|
|
88
87
|
return h("article", {
|
|
89
|
-
key: '
|
|
88
|
+
key: 'dcb7cea87bfb52f8886f7ee3dbc3484d615bc00c',
|
|
90
89
|
class: this.articleClasses(),
|
|
91
90
|
onClick: () => this.handleClick()
|
|
92
91
|
}, h("eds-card-title", {
|
|
93
|
-
key: '
|
|
92
|
+
key: '94dd6ff2679ce9ac4d25ec921cd1162b1584e4fd',
|
|
94
93
|
"heading-level": this.headingLevel,
|
|
95
94
|
titleClass: this.image ? 'f-ui-01' : undefined,
|
|
96
95
|
"card-title": this.cardTitle,
|
|
97
96
|
url: this.url,
|
|
98
97
|
hierarchy: this.hierarchy
|
|
99
98
|
}), this.description && h("eds-card-desc", {
|
|
100
|
-
key: '
|
|
99
|
+
key: '433c4fe3a518153d89d48af54455286fa415a688',
|
|
101
100
|
class: "mt-8",
|
|
102
101
|
"truncate-lines": "3",
|
|
103
102
|
description: this.description
|
|
@@ -108,7 +107,7 @@ const EdsCardGeneric = class {
|
|
|
108
107
|
picture: this.avatar,
|
|
109
108
|
initials: this.shortAbbreviation
|
|
110
109
|
}) : null, h("div", {
|
|
111
|
-
key: '
|
|
110
|
+
key: '97b75afb4b8de1183d4b212054ff556ba3db8fcb',
|
|
112
111
|
class: "flex flex-wrap gap-y-4"
|
|
113
112
|
}, this.parsedTags.map((tag, index) => h("eds-tag", {
|
|
114
113
|
key: index,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { s as sendAnalytics
|
|
2
|
+
import { s as sendAnalytics } from './analytics-1cde8e4a.esm.js';
|
|
3
|
+
import { g as gradientBGColorVariants } from './color-2554aad6.esm.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import 'react/jsx-runtime';
|
|
5
6
|
import 'react-dom';
|
|
@@ -49,38 +50,38 @@ const EdsCardProject = class {
|
|
|
49
50
|
}) : 'bg-default', this.bgOnHover && this.color ? 'effect-background bg-default focus-within:bg-transparent hover:bg-transparent' : 'effect-background hover:bg-default', this.vertical ? 'flex-col gap-y-16' : 'flex-col gap-x-16 gap-y-12 lg:flex-row'].join(' ');
|
|
50
51
|
const imageClasses = this.vertical ? '' : 'max-w-120 @md:max-w-192 order-first w-full lg:order-last';
|
|
51
52
|
return h("article", {
|
|
52
|
-
key: '
|
|
53
|
+
key: '98c5dbd033ec05d08965559e00f32d9fe18698ef',
|
|
53
54
|
class: cardClasses,
|
|
54
55
|
onClick: event => this.handleClick(event)
|
|
55
56
|
}, h("div", {
|
|
56
|
-
key: '
|
|
57
|
+
key: 'e083c43e38c3c24fcd996a90267f7cd92d3651b3',
|
|
57
58
|
class: `flex grow flex-col ${this.vertical ? 'min-h-156' : ''}`
|
|
58
59
|
}, h("div", {
|
|
59
|
-
key: '
|
|
60
|
+
key: '37de1e46023b533fd8595a3077c4e68c11fb01af',
|
|
60
61
|
class: "lg:max-w-[720px]"
|
|
61
62
|
}, h("eds-card-title", {
|
|
62
|
-
key: '
|
|
63
|
+
key: 'ee31ae2804d2c17c82e8f4c0c3269ac8254331df',
|
|
63
64
|
"heading-level": this.headingLevel,
|
|
64
65
|
titleClass: this.image ? 'f-ui-01' : undefined,
|
|
65
66
|
"card-title": this.titleProject,
|
|
66
67
|
url: this.url
|
|
67
68
|
}), this.editorialTitle && h("span", {
|
|
68
|
-
key: '
|
|
69
|
+
key: 'c6f74ba9b5b522f713e25d3339f541efa68cdddd',
|
|
69
70
|
class: `block ${this.vertical ? 'f-ui-02' : 'mt-4 f-heading-06'}`
|
|
70
71
|
}, this.editorialTitle)), this.categoryTitle && h("div", {
|
|
71
|
-
key: '
|
|
72
|
+
key: 'ab18e55046777cf4a4f58ebd057641db9b9e0328',
|
|
72
73
|
class: "mt-auto flex items-center gap-x-12 pt-12"
|
|
73
74
|
}, ((_a = this.categoryTitle) === null || _a === void 0 ? void 0 : _a.length) && h("eds-tag", {
|
|
74
|
-
key: '
|
|
75
|
+
key: '3714ee86a74dce7f33a8f953fd726db349ba9271',
|
|
75
76
|
label: this.categoryTitle
|
|
76
77
|
}))), this.parsedImage && h("div", {
|
|
77
|
-
key: '
|
|
78
|
+
key: '2818d15f7ab671b7b2dfb34ec3085b390150f38d',
|
|
78
79
|
class: imageClasses
|
|
79
80
|
}, h("div", {
|
|
80
|
-
key: '
|
|
81
|
+
key: '5166feef3674631298f699449b956655f38f0db9',
|
|
81
82
|
class: "aspect-1x1 w-full"
|
|
82
83
|
}, h("eds-img", Object.assign({
|
|
83
|
-
key: '
|
|
84
|
+
key: '86555a43491da5b2aa3b287e539e603a2c2adaf3',
|
|
84
85
|
sizes: this.vertical ? this.parsedImage.sizes || '' : '192px'
|
|
85
86
|
}, this.parsedImage)))));
|
|
86
87
|
}
|
|
@@ -8,7 +8,7 @@ const EdsCardSectionStyle0 = edsCardSectionCss;
|
|
|
8
8
|
const EdsCardSection = class {
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
registerInstance(this, hostRef);
|
|
11
|
-
this.cards =
|
|
11
|
+
this.cards = [];
|
|
12
12
|
this.cols = 4;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -29,7 +29,7 @@ const EdsCardSection = class {
|
|
|
29
29
|
return JSON.parse(this.cards);
|
|
30
30
|
} catch (e) {
|
|
31
31
|
// eslint-disable-next-line
|
|
32
|
-
console.error('Error parsing
|
|
32
|
+
console.error('Error parsing cards prop:', e);
|
|
33
33
|
return [];
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -44,10 +44,10 @@ const EdsCardSection = class {
|
|
|
44
44
|
*/
|
|
45
45
|
render() {
|
|
46
46
|
return h("section", {
|
|
47
|
-
key: '
|
|
47
|
+
key: '1f221e1ec7c3cdd0e3aed18f6f930c2c5456c64b',
|
|
48
48
|
class: "w-full"
|
|
49
49
|
}, h("ul", {
|
|
50
|
-
key: '
|
|
50
|
+
key: '36f984994bb2dc247475c20422f7e6e7da7d058d',
|
|
51
51
|
class: "grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
52
52
|
}, this.parsedCards.map(card => h("li", {
|
|
53
53
|
class: `grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col`
|
|
@@ -13,7 +13,7 @@ const EdsCardTags = class {
|
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
15
|
return h("div", {
|
|
16
|
-
key: '
|
|
16
|
+
key: '272d53abb9be9086881cb2f8e99f7fb7aae1bb59',
|
|
17
17
|
class: "flex flex-wrap gap-y-4"
|
|
18
18
|
}, this.tags.map((tag, index) => h("eds-tag", {
|
|
19
19
|
key: index,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { s as sendAnalytics } from './
|
|
2
|
+
import { s as sendAnalytics } from './analytics-1cde8e4a.esm.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
6
|
-
import './index-39c58238.esm.js';
|
|
7
6
|
|
|
8
7
|
const edsCardToolCss = ".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
8
|
const EdsCardToolStyle0 = edsCardToolCss;
|
|
@@ -63,11 +62,11 @@ const EdsCardTool = class {
|
|
|
63
62
|
}
|
|
64
63
|
render() {
|
|
65
64
|
return h("article", {
|
|
66
|
-
key: '
|
|
65
|
+
key: 'da61b384e966b148cd1f77eec59671bc4d92e259',
|
|
67
66
|
class: `${this.el.tagName.toLowerCase()} ${this.articleClasses()}`,
|
|
68
67
|
onClick: () => this.handleClick()
|
|
69
68
|
}, h("eds-card-title", {
|
|
70
|
-
key: '
|
|
69
|
+
key: '00702d032bc25f52b2a2c98255ceb60a1d314f4d',
|
|
71
70
|
"heading-level": this.headingLevel,
|
|
72
71
|
titleClass: this.image ? 'f-ui-01' : undefined,
|
|
73
72
|
"card-title": this.cardTitle,
|
|
@@ -75,7 +74,7 @@ const EdsCardTool = class {
|
|
|
75
74
|
"external-link": this.external,
|
|
76
75
|
hierarchy: this.hierarchy
|
|
77
76
|
}), this.description && h("eds-card-desc", {
|
|
78
|
-
key: '
|
|
77
|
+
key: 'd2b135ed422fb64f142af71330dc666e2f0c2b1f',
|
|
79
78
|
class: "mt-8",
|
|
80
79
|
"truncate-lines": "3",
|
|
81
80
|
description: this.description
|
|
@@ -89,7 +88,7 @@ const EdsCardTool = class {
|
|
|
89
88
|
picture: this.avatar,
|
|
90
89
|
initials: this.shortAbbreviation
|
|
91
90
|
}) : null, h("div", {
|
|
92
|
-
key: '
|
|
91
|
+
key: '54111e90175754cb0c1f2eb339e86926914ca0e7',
|
|
93
92
|
class: "flex flex-wrap gap-y-4"
|
|
94
93
|
}, this.parsedTags.map((tag, index) => h("eds-tag", {
|
|
95
94
|
key: index,
|
|
@@ -19,15 +19,15 @@ const EdsCardWrapper = class {
|
|
|
19
19
|
render() {
|
|
20
20
|
const articleClasses = [this.tiny ? 'min-h-120' : 'min-h-156', this.withBg ? '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(' ');
|
|
21
21
|
return h("article", {
|
|
22
|
-
key: '
|
|
22
|
+
key: 'f21cc9703011026652765b399e2b87b1ef80d220',
|
|
23
23
|
class: articleClasses
|
|
24
24
|
}, h("slot", {
|
|
25
|
-
key: '
|
|
25
|
+
key: '9a37adad73d2d49edcc9ca9222d5b188202c5612'
|
|
26
26
|
}), this.hasSlot('footer') && h("div", {
|
|
27
|
-
key: '
|
|
27
|
+
key: '87addfc052ed4ae33736724fbd8fbc8aca873b4d',
|
|
28
28
|
class: "mt-auto"
|
|
29
29
|
}, h("slot", {
|
|
30
|
-
key: '
|
|
30
|
+
key: '2e48677f42ac2aa951bc1a82afa9291fea3ddd72',
|
|
31
31
|
name: "footer"
|
|
32
32
|
})));
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index.esm2.js';
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react-dom';
|
|
@@ -2187,26 +2187,70 @@ const EdsCodeBlock = class {
|
|
|
2187
2187
|
this.language = undefined;
|
|
2188
2188
|
this.copied = false;
|
|
2189
2189
|
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Copies the current code content to the clipboard and sets a temporary copied state.
|
|
2192
|
+
*
|
|
2193
|
+
* @private
|
|
2194
|
+
* @returns {void}
|
|
2195
|
+
*/
|
|
2190
2196
|
copyToClipboard() {
|
|
2191
2197
|
navigator.clipboard.writeText(this.code).then(() => {
|
|
2192
2198
|
this.copied = true;
|
|
2199
|
+
/*const analyticsName = this.createHumanFriendlyAnalyticsName(this.code, this.language);
|
|
2200
|
+
sendAnalytics({
|
|
2201
|
+
category: 'ui-component',
|
|
2202
|
+
parentContext: null,
|
|
2203
|
+
tag: this.el.tagName.toLowerCase(),
|
|
2204
|
+
name: analyticsName || '',
|
|
2205
|
+
action: 'copy'
|
|
2206
|
+
});*/
|
|
2193
2207
|
setTimeout(() => this.copied = false, 2000);
|
|
2194
2208
|
});
|
|
2195
2209
|
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Utility function that creates a human-friendly analytics name based on the code and language.
|
|
2212
|
+
* It uses:
|
|
2213
|
+
* - The language (in uppercase)
|
|
2214
|
+
* - The number of non-empty lines in the code
|
|
2215
|
+
* - The first non-empty line of code (truncated to 30 characters, if needed)
|
|
2216
|
+
*
|
|
2217
|
+
* returns A descriptive analytics name.
|
|
2218
|
+
*/
|
|
2219
|
+
/*private createHumanFriendlyAnalyticsName(code: string, language: string): string {
|
|
2220
|
+
// Count non-empty lines
|
|
2221
|
+
const lines = code.split('\n').filter(line => line.trim() !== '').length;
|
|
2222
|
+
|
|
2223
|
+
// Find the first non-empty line and trim it
|
|
2224
|
+
let firstNonEmptyLine = code.split('\n').find(line => line.trim() !== '');
|
|
2225
|
+
firstNonEmptyLine = firstNonEmptyLine ? firstNonEmptyLine.trim() : '';
|
|
2226
|
+
// Truncate the snippet if it’s too long
|
|
2227
|
+
if (firstNonEmptyLine.length > 30) {
|
|
2228
|
+
firstNonEmptyLine = firstNonEmptyLine.substring(0, 30) + '...';
|
|
2229
|
+
}
|
|
2230
|
+
return `CodeBlock:${language.toLowerCase()}|${lines}-line(s)|${firstNonEmptyLine.toLowerCase()}`;
|
|
2231
|
+
}*/
|
|
2232
|
+
/**
|
|
2233
|
+
* Returns the syntax-highlighted HTML for the code.
|
|
2234
|
+
* If the provided language is supported by Prism, this method returns the highlighted code.
|
|
2235
|
+
* Otherwise, it logs a warning and returns the raw code.
|
|
2236
|
+
*
|
|
2237
|
+
* @private
|
|
2238
|
+
* @returns {string} The highlighted HTML string for the code block.
|
|
2239
|
+
*/
|
|
2196
2240
|
getHighlightedCode() {
|
|
2197
2241
|
if (this.language && Prism$1.languages[this.language]) {
|
|
2198
2242
|
return Prism$1.highlight(this.code, Prism$1.languages[this.language], this.language);
|
|
2199
2243
|
}
|
|
2200
2244
|
// eslint-disable-next-line
|
|
2201
|
-
console.warn(`Unsupported or missing language: ${this.language}`);
|
|
2245
|
+
//console.warn(`Unsupported or missing language: ${this.language}`);
|
|
2202
2246
|
return this.code; // Fallback if language is not provided or unsupported
|
|
2203
2247
|
}
|
|
2204
2248
|
render() {
|
|
2205
2249
|
return h("div", {
|
|
2206
|
-
key: '
|
|
2250
|
+
key: 'cb379e82bcf71345945b0b88397650ecd4992770',
|
|
2207
2251
|
class: "relative bg-stronger rounded-sm"
|
|
2208
2252
|
}, h("div", {
|
|
2209
|
-
key: '
|
|
2253
|
+
key: '945046d4fd747cd64a83155b421a897e380cc612',
|
|
2210
2254
|
class: "text-inverse flex justify-between items-center p-8"
|
|
2211
2255
|
}, this.language ? h("span", {
|
|
2212
2256
|
class: "f-ui-03"
|
|
@@ -2217,26 +2261,29 @@ const EdsCodeBlock = class {
|
|
|
2217
2261
|
}, h("code", {
|
|
2218
2262
|
innerHTML: this.getHighlightedCode()
|
|
2219
2263
|
})), h("span", {
|
|
2220
|
-
key: '
|
|
2264
|
+
key: '3f6c7e996101f0bb83fb8c9e6991a205a0b268c8',
|
|
2221
2265
|
"aria-hidden": "true",
|
|
2222
2266
|
class: "w-20 h-20 mt-8"
|
|
2223
2267
|
}, h("eds-icon-wrapper", {
|
|
2224
|
-
key: '
|
|
2268
|
+
key: '8ad9beb61058f29e688f6777233c61f7fb3ccfe8',
|
|
2225
2269
|
icon: this.copied ? 'success' : 'copy',
|
|
2226
2270
|
onClick: () => this.copyToClipboard()
|
|
2227
2271
|
})), h("span", {
|
|
2228
|
-
key: '
|
|
2272
|
+
key: 'a4f9a07906e1c2d9febb7ae789a3eed76dc422e9',
|
|
2229
2273
|
class: "sr-only"
|
|
2230
2274
|
}, "Copy Code")), this.language && h("pre", {
|
|
2231
|
-
key: '
|
|
2275
|
+
key: 'e31339126dd3cc885511aaa2bdf6f06f3a113c74',
|
|
2232
2276
|
class: `language-${this.language} bg-stronger pl-8 pb-8`,
|
|
2233
2277
|
role: "region",
|
|
2234
2278
|
"aria-label": `Code block in ${this.language}`
|
|
2235
2279
|
}, h("code", {
|
|
2236
|
-
key: '
|
|
2280
|
+
key: '7efacd276f26a00f0f61793f6b8748259e1614b5',
|
|
2237
2281
|
innerHTML: this.getHighlightedCode()
|
|
2238
2282
|
})));
|
|
2239
2283
|
}
|
|
2284
|
+
get el() {
|
|
2285
|
+
return getElement(this);
|
|
2286
|
+
}
|
|
2240
2287
|
};
|
|
2241
2288
|
EdsCodeBlock.style = EdsCodeBlockStyle0;
|
|
2242
2289
|
|
|
@@ -45,6 +45,18 @@ const EdsDocsInstallation = () => h("div", null, h("p", null, "Before proceeding
|
|
|
45
45
|
code: "npm install @ebrains/react",
|
|
46
46
|
language: "html",
|
|
47
47
|
"copy-label": "Copy Code"
|
|
48
|
+
})), h("div", {
|
|
49
|
+
class: "my-8"
|
|
50
|
+
}, h("eds-code-block", {
|
|
51
|
+
code: "npm install @ebrains/vue",
|
|
52
|
+
language: "html",
|
|
53
|
+
"copy-label": "Copy Code"
|
|
54
|
+
})), h("div", {
|
|
55
|
+
class: "my-8"
|
|
56
|
+
}, h("eds-code-block", {
|
|
57
|
+
code: "npm install @ebrains/angular",
|
|
58
|
+
language: "html",
|
|
59
|
+
"copy-label": "Copy Code"
|
|
48
60
|
})));
|
|
49
61
|
const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p", null, "Learn how to use our components in a React Application.Simple install the package below and check out the examples"), h("div", {
|
|
50
62
|
class: "my-8"
|
|
@@ -56,7 +68,7 @@ const EdsDocsReact = () => h("div", null, h("h2", null, "React Wrappers"), h("p"
|
|
|
56
68
|
"section-title": "Example React App",
|
|
57
69
|
"heading-level": "h3"
|
|
58
70
|
}, h("eds-code-block", {
|
|
59
|
-
code: '\nimport {
|
|
71
|
+
code: '\nimport {\n EdsHeader,\n EdsFullscreenMenu,\n EdsUser\n} from "@ebrains/react";\n\ninterface User {\n firstname: string;\n lastname: string;\n // Add any other properties your user object might have\n}\n\ninterface AuthStatus {\n authenticated: boolean;\n user: User | null;\n}\n\nimport { useEffect, useState } from "react";\n\nexport function App() {\n const [authStatus, setAuthStatus] = useState<AuthStatus>({\n authenticated: false,\n user: null,\n });\n const [activeTabIndex, setActiveTabIndex] = useState<number>(0);\n\n // Use useEffect to render Stencil components dynamically after the component mounts\n useEffect(() => {\n const handleAuthStatusChange = (event: CustomEvent) => {\n console.log(event.detail);\n setAuthStatus(event.detail); // Set the entire object\n };\n\n document.addEventListener(\n "authStatusChanged",\n handleAuthStatusChange as EventListener,\n );\n\n return () => {\n document.removeEventListener(\n "authStatusChanged",\n handleAuthStatusChange as EventListener,\n );\n };\n }, []);\n\n return (\n <div>\n <EdsHeader\n homeUrl="/"\n menuEnabled={true}\n inverseHeader={false}\n links={[\n { label: "About", url: "#" },\n { label: "Focus Areas", url: "#" },\n { label: "News & Events", url: "#" },\n { label: "Contact", url: "#" }\n ]}\n >\n <div className="px-16">\n <EdsUser\n keycloak-url="http://localhost:8080"\n keycloak-realm="nigeor-realm"\n keycloak-client-id="stencil-app"\n ></EdsUser>\n </div>\n </EdsHeader>\n\n <EdsFullscreenMenu\n home-url="/"\n links={[\n { label: "About", url: "#" },\n { label: "Focus Areas", url: "#" },\n { label: "News & Events", url: "#" },\n { label: "Contact", url: "#" }\n ]}\n ></EdsFullscreenMenu>\n \n <div>\n User is{" "}\n {authStatus.authenticated ? "authenticated" : "not authenticated"}\n </div>\n {authStatus.user && <div>Welcome, {authStatus.user.firstname}</div>}\n\n <div id="main"></div>\n </div>\n );\n}\n\nexport default App;\n\n',
|
|
60
72
|
language: "javascript",
|
|
61
73
|
"copy-label": "Copy Code"
|
|
62
74
|
})));
|
|
@@ -137,7 +149,7 @@ const EdsComponentsSection = class {
|
|
|
137
149
|
}
|
|
138
150
|
render() {
|
|
139
151
|
return h("div", {
|
|
140
|
-
key: '
|
|
152
|
+
key: '7e582a0eeafc2687229454532b5a7f66f91c1856',
|
|
141
153
|
class: "container"
|
|
142
154
|
}, this.renderContent());
|
|
143
155
|
}
|