@ebrains/react 2.4.1 → 3.1.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/components-section.entry.esm.js +1 -1
- package/correct-use-of-colors.entry.esm.js +33 -33
- package/docs-palettes.entry.esm.js +1 -1
- package/docs-tokens.entry.esm.js +1 -1
- package/eds-accordion_53.entry.esm.js +1966 -0
- package/eds-app-root.entry.esm.js +4 -4
- package/eds-cookies-preference.entry.esm.js +3 -3
- package/eds-feedback.entry.esm.js +5 -5
- package/eds-frame.entry.esm.js +7 -7
- package/eds-gauge.entry.esm.js +8 -9
- package/eds-gitlab-contributors.entry.esm.js +287 -0
- package/eds-icon-bluesky.entry.esm.js +1 -1
- package/eds-icon-eu.entry.esm.js +2 -2
- 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-mastodon.entry.esm.js +1 -1
- package/eds-icon-twitter.entry.esm.js +1 -1
- package/eds-icon-youtube.entry.esm.js +1 -1
- package/eds-input-search.entry.esm.js +96 -0
- package/eds-modal.entry.esm.js +88 -31
- package/eds-pie.entry.esm.js +38 -4
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-splash-screen.entry.esm.js +4 -12
- package/eds-timeline.entry.esm.js +8 -14
- package/eds-toast-manager.entry.esm.js +1 -1
- package/eds-trl-badge.entry.esm.js +186 -0
- package/eu-8ac3e99c.esm.js +7 -0
- package/incorrect-use-of-colors.entry.esm.js +8 -8
- package/index.esm.js +1 -1
- package/index.esm2.js +22 -142
- package/logo-space.entry.esm.js +138 -17
- package/logo-variations-horizontal_2.entry.esm.js +28 -54
- package/logo-variations-tabs.entry.esm.js +1 -1
- package/logo-wrong-usage.entry.esm.js +33 -33
- package/negative-84eec72e.esm.js +104 -0
- package/package.json +1 -1
- package/positive-cc986d7c.esm.js +65 -0
- package/src/components.d.ts +11 -2
- package/src/generated/components.d.ts +0 -1
- package/svg-repository.entry.esm.js +7 -254
- package/token-list_3.entry.esm.js +79 -51
- package/token-ratios.entry.esm.js +3 -3
- package/token-spacing.entry.esm.js +26 -26
- package/token-typography.entry.esm.js +88 -79
- package/arrow-diagonal-black-8f0494c3.esm.js +0 -3
- package/arrow-right-9322ba8a.esm.js +0 -5
- package/bin-37cad2f0.esm.js +0 -3
- package/bookmark-c200037c.esm.js +0 -16
- package/chevron-down-6144c823.esm.js +0 -12
- package/chevron-left-ca6c66e1.esm.js +0 -11
- package/chevron-right-b88ed2d4.esm.js +0 -5
- package/chevron-up-c66bd477.esm.js +0 -12
- package/clone-dab56639.esm.js +0 -3
- package/close-87fc0d63.esm.js +0 -5
- package/copy-03b72cb6.esm.js +0 -5
- package/download-47746956.esm.js +0 -18
- package/draft-dd5dada2.esm.js +0 -3
- package/edit-3893a517.esm.js +0 -3
- package/eds-accordion_37.entry.esm.js +0 -1201
- package/eds-card-desc_2.entry.esm.js +0 -85
- package/eds-card-generic.entry.esm.js +0 -116
- package/eds-card-project.entry.esm.js +0 -209
- package/eds-card-section.entry.esm.js +0 -56
- package/eds-card-tags.entry.esm.js +0 -27
- package/eds-card-tool.entry.esm.js +0 -105
- package/eds-footer.entry.esm.js +0 -145
- package/eds-fullscreen-menu.entry.esm.js +0 -143
- package/eds-icon-arrow-diagonal.entry.esm.js +0 -21
- package/eds-icon-arrow-right.entry.esm.js +0 -21
- package/eds-icon-bin.entry.esm.js +0 -21
- package/eds-icon-bookmark.entry.esm.js +0 -21
- package/eds-icon-chevron-down.entry.esm.js +0 -21
- package/eds-icon-chevron-left.entry.esm.js +0 -21
- package/eds-icon-chevron-right.entry.esm.js +0 -21
- package/eds-icon-chevron-up.entry.esm.js +0 -21
- package/eds-icon-clone.entry.esm.js +0 -21
- package/eds-icon-close.entry.esm.js +0 -21
- package/eds-icon-copy.entry.esm.js +0 -21
- package/eds-icon-download.entry.esm.js +0 -21
- package/eds-icon-draft.entry.esm.js +0 -21
- package/eds-icon-edit.entry.esm.js +0 -21
- package/eds-icon-external.entry.esm.js +0 -21
- package/eds-icon-loader.entry.esm.js +0 -21
- package/eds-icon-menu.entry.esm.js +0 -21
- package/eds-icon-minus.entry.esm.js +0 -21
- package/eds-icon-more.entry.esm.js +0 -21
- package/eds-icon-paper.entry.esm.js +0 -21
- package/eds-icon-plus.entry.esm.js +0 -21
- package/eds-icon-portal.entry.esm.js +0 -21
- package/eds-icon-private.entry.esm.js +0 -21
- package/eds-icon-public.entry.esm.js +0 -21
- package/eds-icon-search.entry.esm.js +0 -21
- package/eds-icon-star.entry.esm.js +0 -21
- package/eds-icon-start.entry.esm.js +0 -21
- package/eds-icon-success.entry.esm.js +0 -21
- package/eds-icon-thumbs-down.entry.esm.js +0 -21
- package/eds-icon-thumbs-up.entry.esm.js +0 -21
- package/eds-icon-tutorial.entry.esm.js +0 -21
- package/eds-icon-unknown.entry.esm.js +0 -21
- package/eds-icon-updown.entry.esm.js +0 -21
- package/eds-icon-user.entry.esm.js +0 -21
- package/eds-icon-view.entry.esm.js +0 -21
- package/eds-progress-bar.entry.esm.js +0 -52
- package/eds-social-networks.entry.esm.js +0 -73
- package/eds-trl.entry.esm.js +0 -68
- package/eu-9ddde93a.esm.js +0 -30
- package/index-39c58238.esm.js +0 -58
- package/loader-c9628637.esm.js +0 -30
- package/logo-color-7f1fd803.esm.js +0 -115
- package/logo-color-margins-ff8ce71b.esm.js +0 -118
- package/logo-white-no-bg-f382f86f.esm.js +0 -1021
- package/menu-340ea948.esm.js +0 -11
- package/minus-b30a7c71.esm.js +0 -11
- package/more-4449d549.esm.js +0 -13
- package/paper-8e74ea31.esm.js +0 -15
- package/plus-89c07be2.esm.js +0 -12
- package/portal-d6c8ce56.esm.js +0 -18
- package/private-1c25ff8e.esm.js +0 -25
- package/public-d4d8c585.esm.js +0 -16
- package/search-fbcd79c2.esm.js +0 -12
- package/star-0da9b5e9.esm.js +0 -5
- package/start-65126a4f.esm.js +0 -3
- package/success-443809da.esm.js +0 -18
- package/thumbs-down-a18fd049.esm.js +0 -5
- package/thumbs-up-c19a71bc.esm.js +0 -6
- package/tutotial-150ee1fd.esm.js +0 -27
- package/unknown-ed01a24c.esm.js +0 -22
- package/up-and-down-8b69ca97.esm.js +0 -12
- package/user-71ebdc15.esm.js +0 -16
- package/view-e900f2d4.esm.js +0 -3
package/eds-modal.entry.esm.js
CHANGED
|
@@ -4,20 +4,33 @@ import 'react';
|
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
6
6
|
|
|
7
|
-
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}.z-50{z-index:50}.z-9999991{z-index:9999991}.w-full{width:100%}.min-w-full{min-width:100%}.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-
|
|
7
|
+
const edsModalCss = ".modal-open{display:flex}.modal-closed{display:none}.modal-backdrop{}.backdrop-visible{opacity:0.9}.backdrop-hidden{opacity:0}.modal-content{}.modal-content-visible{opacity:1}.modal-content-hidden{opacity:0}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.flex-col{flex-direction:column}.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}.z-50{z-index:50}.z-9999991{z-index:9999991}.w-full{width:100%}.min-w-full{min-width:100%}.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}.py-24{padding-top:1.5rem;padding-bottom:1.5rem}.leading-normal{line-height:1.5}.bg-inverse{background-color:var(--white)}.bg-dark{background-color:var(--grey-light)}.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%}.left-20{left:1.25rem}.right-20{right:1.25rem}.top-1\\/2{top:50%}.top-0{top:0rem}.top-16{top:1rem}.left-0{left:0rem}.top-20{top:1.25rem}.bottom-0{bottom:0rem}.bottom-16{bottom:1rem}.bottom-20{bottom:1.25rem}.grow{flex-grow:1}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.overflow-y-auto{overflow-y:auto}.max-h-\\[90vh\\]{max-height:90vh}.-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-default{color:var(--black)}.text-inverse{color:var(--white)}.bg-dark{background-color:var(--grey-light)}.bg-strong{background-color:var(--grey-dark)}.bg-strongest{background-color:var(--brand-black)}.mr-8{margin-right:0.5rem}.pt-8{padding-top:0.5rem}.bg-opacity-90{opacity:0.9}.modal-title{line-height:1.5;padding-bottom:2px;display:inline-block}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;padding-bottom:2px;}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;padding-bottom:2px;}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;padding-bottom:2px;}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;padding-bottom:2px;}.modal-small{min-width:300px;max-width:500px}.modal-medium{min-width:300px;max-width:700px}.modal-large{min-width:300px;max-width:900px}@media (max-width: 749px){.modal-small,.modal-medium,.modal-large{min-width:calc(100% - 2rem);max-width:calc(100% - 2rem);margin:0 1rem}}@media (min-width: 750px){.md\\:bottom-20{bottom:1.25rem}.md\\:w-auto{width:auto}.md\\:min-w-\\[500px\\]{width:500px}.md\\:top-20{top:1.25rem}.md\\:top-1\\/2{top:50%}.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))}.md\\:gap-y-12{row-gap:0.75rem}}";
|
|
8
8
|
const EdsModalStyle0 = edsModalCss;
|
|
9
9
|
const EdsModal = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
registerInstance(this, hostRef);
|
|
12
|
+
this.previousActiveElement = null;
|
|
12
13
|
this.heading = '';
|
|
13
|
-
this.truncate =
|
|
14
|
+
this.truncate = undefined;
|
|
14
15
|
this.position = 'middle';
|
|
16
|
+
this.size = 'medium';
|
|
15
17
|
this.inverseHeader = false;
|
|
16
18
|
this.isOpen = false;
|
|
17
19
|
}
|
|
18
20
|
getTruncateClass() {
|
|
19
21
|
return this.truncate ? `line-clamp-${this.truncate}` : '';
|
|
20
22
|
}
|
|
23
|
+
getSizeClass() {
|
|
24
|
+
switch (this.size) {
|
|
25
|
+
case 'small':
|
|
26
|
+
return 'modal-small';
|
|
27
|
+
case 'large':
|
|
28
|
+
return 'modal-large';
|
|
29
|
+
case 'medium':
|
|
30
|
+
default:
|
|
31
|
+
return 'modal-medium';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
21
34
|
/**
|
|
22
35
|
* Returns the Tailwind CSS classes to position the modal based on the `position` prop.
|
|
23
36
|
*
|
|
@@ -28,12 +41,12 @@ const EdsModal = class {
|
|
|
28
41
|
switch (this.position) {
|
|
29
42
|
case 'top':
|
|
30
43
|
return [
|
|
31
|
-
// mobile:
|
|
32
|
-
'top-
|
|
44
|
+
// mobile: small gap from top, full-width
|
|
45
|
+
'top-16', 'left-0', 'w-full',
|
|
33
46
|
// desktop: half-width centred and offset down
|
|
34
47
|
'md:left-1/2', 'md:w-auto', 'md:-translate-x-1/2', 'md:top-20'].join(' ');
|
|
35
48
|
case 'bottom':
|
|
36
|
-
return ['bottom-
|
|
49
|
+
return ['bottom-16', 'left-0', 'w-full', 'md:left-1/2', 'md:w-auto', 'md:-translate-x-1/2', 'md:bottom-20'].join(' ');
|
|
37
50
|
/*case 'left':
|
|
38
51
|
…
|
|
39
52
|
case 'right':
|
|
@@ -42,17 +55,53 @@ const EdsModal = class {
|
|
|
42
55
|
default:
|
|
43
56
|
return [
|
|
44
57
|
// mobile: full-width, start from top with a little padding
|
|
45
|
-
'top-
|
|
58
|
+
'top-16', 'left-0', 'w-full',
|
|
46
59
|
// desktop: centred both axes
|
|
47
60
|
'md:left-1/2', 'md:top-1/2', 'md:w-auto', 'md:-translate-x-1/2', 'md:-translate-y-1/2'].join(' ');
|
|
48
61
|
}
|
|
49
62
|
}
|
|
63
|
+
trapFocus(event) {
|
|
64
|
+
var _a;
|
|
65
|
+
if (event.key !== 'Tab') return;
|
|
66
|
+
const focusableElements = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
67
|
+
if (!focusableElements || focusableElements.length === 0) return;
|
|
68
|
+
const firstElement = focusableElements[0];
|
|
69
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
70
|
+
if (event.shiftKey) {
|
|
71
|
+
if (document.activeElement === firstElement) {
|
|
72
|
+
lastElement.focus();
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
if (document.activeElement === lastElement) {
|
|
77
|
+
firstElement.focus();
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lockBodyScroll() {
|
|
83
|
+
document.body.style.overflow = 'hidden';
|
|
84
|
+
}
|
|
85
|
+
unlockBodyScroll() {
|
|
86
|
+
document.body.style.overflow = '';
|
|
87
|
+
}
|
|
50
88
|
/**
|
|
51
89
|
* Opens the modal.
|
|
52
90
|
*/
|
|
53
91
|
async open() {
|
|
54
92
|
var _a;
|
|
93
|
+
// Store currently focused element
|
|
94
|
+
this.previousActiveElement = document.activeElement;
|
|
55
95
|
this.isOpen = true;
|
|
96
|
+
this.lockBodyScroll();
|
|
97
|
+
// Focus first focusable element in modal after it renders
|
|
98
|
+
setTimeout(() => {
|
|
99
|
+
var _a;
|
|
100
|
+
const focusableElements = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
101
|
+
if (focusableElements && focusableElements.length > 0) {
|
|
102
|
+
focusableElements[0].focus();
|
|
103
|
+
}
|
|
104
|
+
}, 100);
|
|
56
105
|
sendAnalytics({
|
|
57
106
|
category: 'ui-component',
|
|
58
107
|
parentContext: null,
|
|
@@ -67,6 +116,14 @@ const EdsModal = class {
|
|
|
67
116
|
async close() {
|
|
68
117
|
var _a;
|
|
69
118
|
this.isOpen = false;
|
|
119
|
+
this.unlockBodyScroll();
|
|
120
|
+
// Return focus to previously focused element
|
|
121
|
+
if (this.previousActiveElement && typeof this.previousActiveElement.focus === 'function') {
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
var _a;
|
|
124
|
+
(_a = this.previousActiveElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
125
|
+
}, 100);
|
|
126
|
+
}
|
|
70
127
|
sendAnalytics({
|
|
71
128
|
category: 'ui-component',
|
|
72
129
|
parentContext: null,
|
|
@@ -79,7 +136,11 @@ const EdsModal = class {
|
|
|
79
136
|
* Toggles the modal open or closed.
|
|
80
137
|
*/
|
|
81
138
|
async toggle() {
|
|
82
|
-
this.isOpen
|
|
139
|
+
if (this.isOpen) {
|
|
140
|
+
await this.close();
|
|
141
|
+
} else {
|
|
142
|
+
await this.open();
|
|
143
|
+
}
|
|
83
144
|
}
|
|
84
145
|
/**
|
|
85
146
|
* Listens for global custom events to open the modal.
|
|
@@ -94,52 +155,48 @@ const EdsModal = class {
|
|
|
94
155
|
this.close();
|
|
95
156
|
}
|
|
96
157
|
/**
|
|
97
|
-
* Closes the modal when the Escape key is pressed.
|
|
158
|
+
* Closes the modal when the Escape key is pressed and handles focus trapping on Tab.
|
|
98
159
|
*/
|
|
99
160
|
handleKeyDown(event) {
|
|
100
|
-
if (this.isOpen
|
|
161
|
+
if (!this.isOpen) return;
|
|
162
|
+
if (event.key === 'Escape') {
|
|
101
163
|
this.close();
|
|
164
|
+
} else if (event.key === 'Tab') {
|
|
165
|
+
this.trapFocus(event);
|
|
102
166
|
}
|
|
103
167
|
}
|
|
104
168
|
render() {
|
|
105
169
|
// Generate a unique id for the title so we can reference it for aria-labelledby.
|
|
106
170
|
const titleId = `modal-title-${this.el.tagName.toLowerCase()}`;
|
|
171
|
+
// Don't render anything when modal is closed to prevent blocking clicks
|
|
172
|
+
if (!this.isOpen) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
107
175
|
return h("div", {
|
|
108
|
-
key: '6b7cbab7db29bb09415bb9538d69ac9a238a7776',
|
|
109
176
|
id: "eds-modal",
|
|
110
|
-
class:
|
|
177
|
+
class: "modal-open fixed inset-0 z-9999991 flex",
|
|
111
178
|
role: "dialog",
|
|
112
179
|
"aria-modal": "true",
|
|
113
180
|
"aria-labelledby": titleId
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
class: "fixed inset-0 bg-dark bg-opacity-90" // Add backdrop-blur utility class here
|
|
117
|
-
,
|
|
118
|
-
|
|
181
|
+
}, h("div", {
|
|
182
|
+
class: "modal-backdrop fixed inset-0 bg-dark backdrop-visible",
|
|
119
183
|
onClick: () => this.close()
|
|
120
184
|
}), h("div", {
|
|
121
|
-
|
|
122
|
-
class: `container absolute bg-inverse z-10 ${this.getModalPositionClasses()} grow justify-center`
|
|
185
|
+
class: `container absolute bg-inverse z-10 rounded-lg shadow-lg ${this.getModalPositionClasses()} ${this.getSizeClass()} grow justify-center max-h-[90vh] flex flex-col modal-content modal-content-visible`
|
|
123
186
|
}, h("div", {
|
|
124
|
-
|
|
125
|
-
class: `flex justify-between items-center border-b-2 border-softer px-20 py-20 ${this.inverseHeader ? 'bg-strongest text-inverse' : 'bg-dark text-default'}`
|
|
187
|
+
class: `flex justify-between items-center border-b-2 border-softer px-20 py-24 flex-shrink-0 ${this.inverseHeader ? 'bg-strongest text-inverse' : 'bg-dark text-default'}`
|
|
126
188
|
}, h("span", {
|
|
127
|
-
key: 'efefadd7e6630d9d9b498e68480a41b604c16c9f',
|
|
128
189
|
id: titleId,
|
|
129
|
-
class: `f-heading-04 ${this.getTruncateClass()}`
|
|
190
|
+
class: `f-heading-04 mr-8 modal-title ${this.getTruncateClass()}`
|
|
130
191
|
}, this.heading), h("eds-button", {
|
|
131
|
-
|
|
132
|
-
|
|
192
|
+
intent: this.inverseHeader ? 'ghostInverse' : 'secondary',
|
|
193
|
+
size: "large",
|
|
133
194
|
icon: "close",
|
|
134
195
|
"aria-label": "Close modal",
|
|
135
|
-
onClick: () => this.close()
|
|
136
|
-
"extra-class": "ml-8 text-default"
|
|
196
|
+
onClick: () => this.close()
|
|
137
197
|
})), h("div", {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}, h("slot", {
|
|
141
|
-
key: '1a59aaa764e4c4ed972de7a700ddf8f716e40e58'
|
|
142
|
-
}))));
|
|
198
|
+
class: "pt-8 px-20 py-20 overflow-y-auto flex-1"
|
|
199
|
+
}, h("slot", null))));
|
|
143
200
|
}
|
|
144
201
|
get el() {
|
|
145
202
|
return getElement(this);
|
package/eds-pie.entry.esm.js
CHANGED
|
@@ -54,7 +54,7 @@ const EdsPie = class {
|
|
|
54
54
|
const start = cumulative,
|
|
55
55
|
end = cumulative + angle;
|
|
56
56
|
cumulative = end;
|
|
57
|
-
const color = s.color || palette.shift() || '
|
|
57
|
+
const color = s.color || palette.shift() || '#8c8c8c';
|
|
58
58
|
return Object.assign(Object.assign({}, s), {
|
|
59
59
|
start,
|
|
60
60
|
end,
|
|
@@ -87,7 +87,7 @@ const EdsPie = class {
|
|
|
87
87
|
cx: radius,
|
|
88
88
|
cy: radius,
|
|
89
89
|
r: innerRadius,
|
|
90
|
-
fill: "
|
|
90
|
+
fill: "#FFFFFF"
|
|
91
91
|
}), processed.map(s => {
|
|
92
92
|
const midAngle = s.start + (s.end - s.start) / 2;
|
|
93
93
|
const {
|
|
@@ -123,8 +123,42 @@ const EdsPie = class {
|
|
|
123
123
|
};
|
|
124
124
|
EdsPie.MAX_SLICES = 9;
|
|
125
125
|
EdsPie.PALETTES = {
|
|
126
|
-
semantic: ['
|
|
127
|
-
|
|
126
|
+
semantic: ['#00e766',
|
|
127
|
+
// green-500
|
|
128
|
+
'#666666',
|
|
129
|
+
// grey-700
|
|
130
|
+
'#00c959',
|
|
131
|
+
// green-600
|
|
132
|
+
'#8c8c8c',
|
|
133
|
+
// grey-500
|
|
134
|
+
'#63fb92',
|
|
135
|
+
// green-400
|
|
136
|
+
'#d8d8d8',
|
|
137
|
+
// grey-400
|
|
138
|
+
'#9dffb4',
|
|
139
|
+
// green-300
|
|
140
|
+
'#e6e6e6',
|
|
141
|
+
// grey-300
|
|
142
|
+
'#d3ffdc' // green-200
|
|
143
|
+
],
|
|
144
|
+
mono: ['#666666',
|
|
145
|
+
// grey-700
|
|
146
|
+
'#8c8c8c',
|
|
147
|
+
// grey-500
|
|
148
|
+
'#e6e6e6',
|
|
149
|
+
// grey-300
|
|
150
|
+
'#f8f8f8',
|
|
151
|
+
// grey-100
|
|
152
|
+
'#4d4d4d',
|
|
153
|
+
// grey-800
|
|
154
|
+
'#6e6e6e',
|
|
155
|
+
// grey-600
|
|
156
|
+
'#d8d8d8',
|
|
157
|
+
// grey-400
|
|
158
|
+
'#f2f2f2',
|
|
159
|
+
// grey-200
|
|
160
|
+
'#242424' // grey-900
|
|
161
|
+
]
|
|
128
162
|
};
|
|
129
163
|
EdsPie.style = EdsPieStyle0;
|
|
130
164
|
|
|
@@ -15,13 +15,13 @@ const EdsSectionCore = class {
|
|
|
15
15
|
render() {
|
|
16
16
|
const TagType = this.tag; // Set dynamic tag type (div or section)
|
|
17
17
|
return h(TagType, {
|
|
18
|
-
key: '
|
|
18
|
+
key: '635230d1ec9a0dcc945990a6a58dc3508345d984'
|
|
19
19
|
}, h("eds-section-heading", {
|
|
20
|
-
key: '
|
|
20
|
+
key: '0b6b94df22af707cbd6964132f3a5190b4b7e83c',
|
|
21
21
|
headingLevel: this.headingLevel,
|
|
22
22
|
sectionTitle: this.sectionTitle
|
|
23
23
|
}), h("slot", {
|
|
24
|
-
key: '
|
|
24
|
+
key: '8834c29c25249fb5c384fb5d51866eadb93a97d6'
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -52,7 +52,7 @@ const EdsSectionHeading = class {
|
|
|
52
52
|
const TagType = this.tag; // Dynamically set tag type for the container
|
|
53
53
|
const HeadingTag = this.headingLevel; // Dynamically set heading level
|
|
54
54
|
return h(TagType, {
|
|
55
|
-
key: '
|
|
55
|
+
key: '7275284a1158ab982f1e53117b72738d0a001c97',
|
|
56
56
|
class: {
|
|
57
57
|
'ui-section-header flex flex-wrap items-center justify-between gap-x-12 gap-y-8': true,
|
|
58
58
|
container: this.withContainer,
|
|
@@ -60,7 +60,7 @@ const EdsSectionHeading = class {
|
|
|
60
60
|
'pt-28': !this.spacingLarge
|
|
61
61
|
}
|
|
62
62
|
}, h(HeadingTag, {
|
|
63
|
-
key: '
|
|
63
|
+
key: 'a3c68baa56a0337348405c88544225ed7c7ff0ed',
|
|
64
64
|
class: this.getHeadingClass()
|
|
65
65
|
}, this.sectionTitle));
|
|
66
66
|
}
|
|
@@ -3,7 +3,7 @@ import 'react';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react-dom';
|
|
5
5
|
|
|
6
|
-
const edsSplashScreenCss = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:
|
|
6
|
+
const edsSplashScreenCss = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:300px;height:60px;animation:loading-pulse 1.5s ease-in-out infinite}@keyframes loading-pulse{0%,100%{opacity:1}50%{opacity:0.6}}";
|
|
7
7
|
const EdsSplashScreenStyle0 = edsSplashScreenCss;
|
|
8
8
|
const EdsSplashScreen = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -55,22 +55,14 @@ const EdsSplashScreen = class {
|
|
|
55
55
|
return h(Host, null, h("div", {
|
|
56
56
|
class: "splash-overlay",
|
|
57
57
|
style: {
|
|
58
|
-
background: this.inverse ? 'black' : 'var(--grey-
|
|
58
|
+
background: this.inverse ? 'var(--brand-black)' : 'var(--grey-light)'
|
|
59
59
|
}
|
|
60
60
|
}, h("div", {
|
|
61
61
|
class: "logo-container"
|
|
62
62
|
}, this.inverse ? h("eds-logo", {
|
|
63
|
-
|
|
64
|
-
type: "color-white"
|
|
63
|
+
variant: "negative"
|
|
65
64
|
}) : h("eds-logo", {
|
|
66
|
-
|
|
67
|
-
type: "color"
|
|
68
|
-
})), h("div", {
|
|
69
|
-
class: "content-container"
|
|
70
|
-
}, h("eds-spinner", {
|
|
71
|
-
size: "xs",
|
|
72
|
-
background: "none",
|
|
73
|
-
fullscreen: false
|
|
65
|
+
variant: "positive"
|
|
74
66
|
}))));
|
|
75
67
|
}
|
|
76
68
|
static get watchers() {
|
|
@@ -46,29 +46,26 @@ const EdsTimeline = class {
|
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
48
|
return h("div", {
|
|
49
|
-
key: '
|
|
49
|
+
key: '78b199b18d361ae3223e4f1fe9a2043d61f4271b',
|
|
50
50
|
class: "max-w-sidebar mx-auto px-4 py-8"
|
|
51
51
|
}, h("div", {
|
|
52
|
-
key: '
|
|
52
|
+
key: 'afdfdf7dc573a7f273703a02e38e755a9815bdf7',
|
|
53
53
|
class: "relative"
|
|
54
54
|
}, h("div", {
|
|
55
|
-
key: '
|
|
55
|
+
key: '7affc96f356ee901ca263c7347ae60b84869f28b',
|
|
56
56
|
class: "absolute w-4 left-1/2 transform -translate-x-1/2 bg-strong h-full z-0"
|
|
57
57
|
}), h("div", {
|
|
58
|
-
key: '
|
|
58
|
+
key: '7ba006234bd1365890e75b7f59aa118265ba727c',
|
|
59
59
|
class: "space-y-16"
|
|
60
60
|
}, this.parsedEvents.map((event, index) => h("div", {
|
|
61
61
|
class: "relative flex"
|
|
62
62
|
}, h("div", {
|
|
63
63
|
class: `w-1/2 ${index % 2 === 0 ? 'pr-4' : ''}`
|
|
64
64
|
}, index % 2 === 0 && h("eds-card-generic", {
|
|
65
|
-
|
|
65
|
+
title: event.title,
|
|
66
66
|
url: "#",
|
|
67
67
|
description: event.description,
|
|
68
|
-
|
|
69
|
-
tiny: true,
|
|
70
|
-
bg: !event.completed,
|
|
71
|
-
"with-hover": "false",
|
|
68
|
+
intent: "secondary",
|
|
72
69
|
tags: JSON.stringify(event.completed ? [{
|
|
73
70
|
label: 'completed',
|
|
74
71
|
style: 'accent'
|
|
@@ -86,13 +83,10 @@ const EdsTimeline = class {
|
|
|
86
83
|
})), h("div", {
|
|
87
84
|
class: `w-1/2 ${index % 2 !== 0 ? 'pl-4' : ''}`
|
|
88
85
|
}, index % 2 !== 0 && h("eds-card-generic", {
|
|
89
|
-
|
|
86
|
+
title: event.title,
|
|
90
87
|
url: "#",
|
|
91
88
|
description: event.description,
|
|
92
|
-
|
|
93
|
-
tiny: true,
|
|
94
|
-
bg: !event.completed,
|
|
95
|
-
"with-hover": "false",
|
|
89
|
+
intent: "secondary",
|
|
96
90
|
tags: JSON.stringify(event.completed ? [{
|
|
97
91
|
label: 'completed',
|
|
98
92
|
style: 'accent'
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
/**
|
|
8
|
+
* Official EBRAINS sphere mark, extracted from
|
|
9
|
+
* packages/assets/EBRAINS_logo_25/new_ebrains_logo_rgb/250901_new_ebrains_logo_rgb_positive.svg
|
|
10
|
+
* (the gradient-filled wave segments only — wordmark dropped).
|
|
11
|
+
*
|
|
12
|
+
* Gradient ids carry a `__UID__` placeholder so each badge instance can
|
|
13
|
+
* namespace them (no <defs> collisions when several badges share a page).
|
|
14
|
+
* Gradient template inheritance uses SVG2 `href` (no xlink namespace needed).
|
|
15
|
+
* Use markDefs() inside the badge <defs> and markGroup() in the body.
|
|
16
|
+
*/
|
|
17
|
+
const MARK_DEFS = `<linearGradient id="__UID__Unbenannter_Verlauf_29" x1="-26.7" y1="64.8" x2="155" y2="-19.9" gradientUnits="userSpaceOnUse"> <stop offset="0" stop-color="#03a98f"/> <stop offset=".1" stop-color="#10a97b"/> <stop offset=".3" stop-color="#23aa5f"/> <stop offset="1" stop-color="#00ff9d"/> </linearGradient><linearGradient id="__UID__Unbenannter_Verlauf_291" x1="38.6" y1="205" x2="220.3" y2="120.2" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_292" x1="33" y1="193" x2="214.8" y2="108.3" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_293" x1="-3.5" y1="114.7" x2="178.3" y2="30" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_294" x1="4.5" y1="131.8" x2="186.2" y2="47.1" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_295" x1="28.6" y1="183.6" x2="210.4" y2="98.9" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_296" x1="3.8" y1="130.3" x2="185.5" y2="45.5" href="#__UID__Unbenannter_Verlauf_29"/><linearGradient id="__UID__Unbenannter_Verlauf_297" x1="18" y1="160.6" x2="199.7" y2="75.9" href="#__UID__Unbenannter_Verlauf_29"/>`;
|
|
18
|
+
const MARK_PATHS = `<path fill="url(#__UID__Unbenannter_Verlauf_29)" d="M67.3,19.9c11.2-2.3,22.5-1,32.1,1.5.8.2,1.2-.8.5-1.3-11.6-7.3-20.9-11.4-26.6-13.5l-18.3,4.9c-3.4.9-6.4,2.7-8.9,5.1l-29.6,29.6c-2.5,2.5-4.2,5.5-5.1,8.9l-.7,2.6c1.7-1.5,3.4-3.2,5.2-4.9,12.6-12,29.9-28.4,51.3-32.9Z"/><path fill="url(#__UID__Unbenannter_Verlauf_291)" d="M33.8,172.2l12.3,12.3c2.5,2.5,5.5,4.2,8.9,5.1l40.4,10.8c3.4.9,6.9.9,10.2,0l40.4-10.8c3.4-.9,6.4-2.7,8.9-5.1l2.8-2.8c-80-32.2-119-12.3-123.9-9.5Z"/><path fill="url(#__UID__Unbenannter_Verlauf_292)" d="M97.7,137.4c-25.1.2-51.1.4-78.8,19.8l10.5,10.5h.1c2-1.5,42.4-27.9,132.8,9.1h.2c0,.1,18.6-18.4,18.6-18.4-7.8-2.8-58.6-21-83.1-21h-.3Z"/><path fill="url(#__UID__Unbenannter_Verlauf_293)" d="M137.2,41h0c2.6,2.4,5.3,5,8,7.7,26.3,26.3,43.8,37.2,53.9,41.8l-9.5-35.5c-.9-3.4-2.7-6.4-5.1-8.9l-29.6-29.6c-2.5-2.5-5.5-4.2-8.9-5.1L105.7.7c-3.4-.9-6.9-.9-10.2,0l-12.1,3.2c12.4,5.6,31.5,16.5,53.7,37,0,0,.1.1.2.2Z"/><path fill="url(#__UID__Unbenannter_Verlauf_294)" d="M132.7,86.1c4.9,1.6,26.3,12,26.3,12,1.7.7,7.3,3.3,8.9,4.1.7.3,1.3-.6.8-1.1-1.5-1.4-5.8-5-10.9-8.6,0,0-21.8-15.4-27.2-18.5-7.8-4.3-47.4-26.7-81.3-10C25.8,75.6,8,89.7.6,96c-.8,3.2-.7,6.5.1,9.7l3.4,12.8c7.2-6.7,20.2-17.2,40.4-28.2,35.4-19.2,61.9-12.8,88.2-4.2Z"/><path fill="url(#__UID__Unbenannter_Verlauf_295)" d="M55.9,128c-3.1,1.7-17.5,10.3-17.5,10.3,0,0-4.9,3-.2,1.9,2-.5,7.8-3.1,9.7-3.6,0,0,19.1-7,49.8-5.4.1,0,.2,0,.4,0,27.6,0,84.2,21,86.6,21.9l1.1.5c1.8-2.2,3.2-4.7,3.9-7.5l2.7-10.2c-14.1-5.9-55.1-22.3-81-22.3s-55.3,14.3-55.5,14.4Z"/><path fill="url(#__UID__Unbenannter_Verlauf_296)" d="M131.7,44.5c-2-1.7-4.9-3.9-8.5-6.3-1.8-1.3-3.6-2.3-5.4-3.2-8.1-4.1-29.1-13.1-49.2-9-19.7,4.1-35.5,19.2-48.2,31.3-4.7,4.5-8.7,8.3-12.4,11.1l-4.6,17.2c9.4-7.4,24.4-18,43.2-27.2,36.9-18.1,79.2,5.4,87.3,10.3,12.1,7.3,47.9,34.4,64,46.8l2.6-9.8c.7-2.5.8-5,.5-7.5-10.4-3.8-29.7-14.5-60.2-45-3.1-3.1-6.1-5.9-9.1-8.6Z"/><path fill="url(#__UID__Unbenannter_Verlauf_297)" d="M47.5,95.8c-22.1,12-35.5,23.6-41.5,29.6l5.5,20.7c.3,1.2.8,2.4,1.4,3.5,9.5-9.3,38.6-26.3,39.8-27,1-.6,25.6-15.3,58.7-15.3s67.5,16,82.6,22.4l1.1-4.2c-9.9-6.7-37.4-24.5-64.4-33.5-24.9-8.3-50-14.3-83.2,3.8Z"/>`;
|
|
19
|
+
/** Gradient <defs> for the mark, namespaced with `uid`. */
|
|
20
|
+
function markDefs(uid) {
|
|
21
|
+
return MARK_DEFS.replace(/__UID__/g, uid);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The mark paths wrapped in a positioned, scaled group.
|
|
25
|
+
* The source artwork lives in a ~201×201 canvas; `size` is the rendered px.
|
|
26
|
+
*/
|
|
27
|
+
function markGroup(uid, x, y, size = 16) {
|
|
28
|
+
const s = (size / 201.1).toFixed(4);
|
|
29
|
+
const paths = MARK_PATHS.replace(/__UID__/g, uid);
|
|
30
|
+
return `<g transform="translate(${x},${y}) scale(${s})">${paths}</g>`;
|
|
31
|
+
}
|
|
32
|
+
const edsTrlBadgeCss = ":host{display:inline-block;line-height:0;}.link{display:inline-block;line-height:0;text-decoration:none;color:inherit}.link svg{display:block}";
|
|
33
|
+
const EdsTrlBadgeStyle0 = edsTrlBadgeCss;
|
|
34
|
+
let _uid = 0;
|
|
35
|
+
const EdsTrlBadge = class {
|
|
36
|
+
constructor(hostRef) {
|
|
37
|
+
registerInstance(this, hostRef);
|
|
38
|
+
/** Per-instance suffix so the mark's gradient ids never collide. */
|
|
39
|
+
this.uid = `trl${++_uid}-`;
|
|
40
|
+
this.level = undefined;
|
|
41
|
+
this.assessed = undefined;
|
|
42
|
+
this.methodology = undefined;
|
|
43
|
+
this.theme = 'dark';
|
|
44
|
+
this.variant = 'tone';
|
|
45
|
+
this.size = undefined;
|
|
46
|
+
this.label = 'EBRAINS TRL';
|
|
47
|
+
this.href = undefined;
|
|
48
|
+
}
|
|
49
|
+
esc(s) {
|
|
50
|
+
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
51
|
+
}
|
|
52
|
+
/** Maturity tier → value/pip colour (brand palette). */
|
|
53
|
+
levelColor() {
|
|
54
|
+
const n = Number(this.level);
|
|
55
|
+
if (n >= 7) return '#00FF9D';
|
|
56
|
+
if (n >= 4) return '#00C87B';
|
|
57
|
+
return '#7A7B7A';
|
|
58
|
+
}
|
|
59
|
+
/** Readable value text on a coloured segment (black on green, light on grey). */
|
|
60
|
+
valueText() {
|
|
61
|
+
return Number(this.level) >= 4 ? '#07140D' : '#ECECEC';
|
|
62
|
+
}
|
|
63
|
+
fullText() {
|
|
64
|
+
const parts = [`${this.label} ${this.level}`];
|
|
65
|
+
if (this.assessed) parts.push(`assessed ${this.assessed}`);
|
|
66
|
+
if (this.methodology) parts.push(`methodology ${this.methodology}`);
|
|
67
|
+
return parts.join(' · ');
|
|
68
|
+
}
|
|
69
|
+
/** Build the inner markup + intrinsic dimensions for the chosen variant. */
|
|
70
|
+
build() {
|
|
71
|
+
const CW = EdsTrlBadge.CW;
|
|
72
|
+
const uid = this.uid;
|
|
73
|
+
const clip = `${uid}clip`;
|
|
74
|
+
const valColor = this.levelColor();
|
|
75
|
+
const logoSpace = 28; // 8 margin + ~16 mark + 4 gap
|
|
76
|
+
const mono = `font-family="'IBM Plex Mono',monospace"`;
|
|
77
|
+
const lvl = this.esc(String(this.level));
|
|
78
|
+
if (this.variant === 'full') {
|
|
79
|
+
const tail = (this.assessed ? ` · assessed ${this.esc(this.assessed)}` : '') + (this.methodology ? ` · methodology ${this.esc(this.methodology)}` : '');
|
|
80
|
+
const w = Math.ceil(logoSpace + this.fullText().length * CW + 10);
|
|
81
|
+
const inner = `<defs><clipPath id="${clip}"><rect width="${w}" height="24" rx="6"/></clipPath>${markDefs(uid)}</defs>` + `<g clip-path="url(#${clip})"><rect width="${w}" height="24" fill="#07140D"/></g>${markGroup(uid, 8, 4, 16)}` + `<text x="30" y="15.5" ${mono} font-size="11" letter-spacing=".2">` + `<tspan fill="#ECECEC">${this.esc(this.label)} </tspan>` + `<tspan fill="${valColor}" font-weight="600">${lvl}</tspan>` + `<tspan fill="#7A7B7A">${this.esc(tail)}</tspan></text>`;
|
|
82
|
+
return {
|
|
83
|
+
w,
|
|
84
|
+
h: 24,
|
|
85
|
+
inner
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (this.variant === 'pill') {
|
|
89
|
+
const txt = `TRL ${this.level}`;
|
|
90
|
+
const w = Math.ceil(logoSpace + txt.length * CW + 14);
|
|
91
|
+
const tx = logoSpace + (w - logoSpace) / 2 - 4;
|
|
92
|
+
const inner = `<defs>${markDefs(uid)}</defs>` + `<rect width="${w}" height="24" rx="12" fill="#07140D"/>${markGroup(uid, 7, 4, 16)}` + `<text x="${tx}" y="16" ${mono} font-size="11" font-weight="500" letter-spacing=".5" text-anchor="middle">` + `<tspan fill="#ECECEC">TRL </tspan><tspan fill="${valColor}" font-weight="600">${lvl}</tspan></text>`;
|
|
93
|
+
return {
|
|
94
|
+
w,
|
|
95
|
+
h: 24,
|
|
96
|
+
inner
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (this.variant === 'outline') {
|
|
100
|
+
const dark = this.theme !== 'light';
|
|
101
|
+
const bg = dark ? '#0c1c14' : '#ffffff';
|
|
102
|
+
const stroke = dark ? '#34473d' : '#07140D';
|
|
103
|
+
const labelColor = dark ? '#ECECEC' : '#07140D';
|
|
104
|
+
const sep = dark ? '#5a6b62' : '#9aa39d';
|
|
105
|
+
const value = dark ? valColor : Number(this.level) >= 4 ? '#00966a' : '#7A7B7A';
|
|
106
|
+
const w = Math.ceil(logoSpace + (this.label + ' · ' + this.level).length * CW + 12);
|
|
107
|
+
const inner = `<defs>${markDefs(uid)}</defs>` + `<rect x=".5" y=".5" width="${w - 1}" height="23" rx="6" fill="${bg}" stroke="${stroke}"/>${markGroup(uid, 8, 4, 16)}` + `<text x="30" y="16" ${mono} font-size="11" letter-spacing=".3">` + `<tspan fill="${labelColor}">${this.esc(this.label)} </tspan>` + `<tspan fill="${sep}">· </tspan>` + `<tspan fill="${value}" font-weight="600">${lvl}</tspan></text>`;
|
|
108
|
+
return {
|
|
109
|
+
w,
|
|
110
|
+
h: 24,
|
|
111
|
+
inner
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (this.variant === 'scale') {
|
|
115
|
+
const dark = this.theme !== 'light';
|
|
116
|
+
const bg = dark ? '#07140D' : '#ECECEC';
|
|
117
|
+
const labelColor = dark ? '#ECECEC' : '#07140D';
|
|
118
|
+
const emptyPip = dark ? '#2f4339' : '#c4ccc7';
|
|
119
|
+
const sep = dark ? '#5a6b62' : '#9aa39d';
|
|
120
|
+
const n = Math.max(0, Math.min(9, Number(this.level) || 0));
|
|
121
|
+
const pipStart = Math.ceil(30 + this.label.length * CW + 12);
|
|
122
|
+
const pipStep = 9,
|
|
123
|
+
pipW = 6,
|
|
124
|
+
pipH = 8,
|
|
125
|
+
pipY = 9;
|
|
126
|
+
let pips = '';
|
|
127
|
+
for (let i = 0; i < 9; i++) {
|
|
128
|
+
const x = pipStart + i * pipStep;
|
|
129
|
+
pips += `<rect x="${x}" y="${pipY}" width="${pipW}" height="${pipH}" rx="1" fill="${i < n ? valColor : emptyPip}"/>`;
|
|
130
|
+
}
|
|
131
|
+
const valueX = pipStart + 9 * pipStep + 5;
|
|
132
|
+
const w = Math.ceil(valueX + `${this.level}/9`.length * CW + 8);
|
|
133
|
+
const inner = `<defs>${markDefs(uid)}</defs>` + `<rect width="${w}" height="26" rx="6" fill="${bg}"/>${markGroup(uid, 8, 5, 16)}` + `<text x="30" y="17" ${mono} font-size="11" letter-spacing=".3" fill="${labelColor}">${this.esc(this.label)}</text>` + `<g>${pips}</g>` + `<text x="${valueX}" y="17" ${mono} font-size="11" font-weight="500">` + `<tspan fill="${valColor}">${lvl}</tspan><tspan fill="${sep}">/9</tspan></text>`;
|
|
134
|
+
return {
|
|
135
|
+
w,
|
|
136
|
+
h: 26,
|
|
137
|
+
inner
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// tone (default) — dark or light theme
|
|
141
|
+
const dark = this.theme !== 'light';
|
|
142
|
+
const labelBg = dark ? '#07140D' : '#ECECEC';
|
|
143
|
+
const labelTextColor = dark ? '#ECECEC' : '#07140D';
|
|
144
|
+
const valTextColor = dark ? this.valueText() : '#07140D';
|
|
145
|
+
const labelSegW = Math.ceil(logoSpace + this.label.length * CW + 12);
|
|
146
|
+
const valSegW = Math.ceil(12 + String(this.level).length * CW + 12);
|
|
147
|
+
const w = labelSegW + valSegW;
|
|
148
|
+
const inner = `<defs><clipPath id="${clip}"><rect width="${w}" height="24" rx="6"/></clipPath>${markDefs(uid)}</defs>` + `<g clip-path="url(#${clip})"><rect width="${labelSegW}" height="24" fill="${labelBg}"/>` + `<rect x="${labelSegW}" width="${valSegW}" height="24" fill="${valColor}"/></g>${markGroup(uid, 8, 4, 16)}` + `<text x="${logoSpace + (labelSegW - logoSpace) / 2}" y="16" ${mono} font-size="11" letter-spacing=".4" fill="${labelTextColor}" text-anchor="middle">${this.esc(this.label)}</text>` + `<text x="${labelSegW + valSegW / 2}" y="16" ${mono} font-size="11" font-weight="600" fill="${valTextColor}" text-anchor="middle">${lvl}</text>`;
|
|
149
|
+
return {
|
|
150
|
+
w,
|
|
151
|
+
h: 24,
|
|
152
|
+
inner
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
buildSvg() {
|
|
156
|
+
const {
|
|
157
|
+
w,
|
|
158
|
+
h,
|
|
159
|
+
inner
|
|
160
|
+
} = this.build();
|
|
161
|
+
const aria = this.esc(this.fullText());
|
|
162
|
+
const k = this.size ? this.size / h : 1;
|
|
163
|
+
const outW = Math.round(w * k);
|
|
164
|
+
const outH = Math.round(h * k);
|
|
165
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${outW}" height="${outH}" ` + `viewBox="0 0 ${w} ${h}" role="img" aria-label="${aria}"><title>${aria}</title>${inner}</svg>`;
|
|
166
|
+
}
|
|
167
|
+
render() {
|
|
168
|
+
const svg = this.buildSvg();
|
|
169
|
+
return h(Host, {
|
|
170
|
+
key: 'eddfb49f35ff9771d76eef13a024b840b3a24cca'
|
|
171
|
+
}, this.href ? h("a", {
|
|
172
|
+
class: "link",
|
|
173
|
+
href: this.href,
|
|
174
|
+
"aria-label": this.fullText(),
|
|
175
|
+
innerHTML: svg
|
|
176
|
+
}) : h("span", {
|
|
177
|
+
class: "link",
|
|
178
|
+
innerHTML: svg
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
// IBM Plex Mono advance width at 11px (used to size segments to the text).
|
|
183
|
+
EdsTrlBadge.CW = 6.8;
|
|
184
|
+
EdsTrlBadge.style = EdsTrlBadgeStyle0;
|
|
185
|
+
|
|
186
|
+
export { EdsTrlBadge as eds_trl_badge };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const euSvg = `<svg width="63" height="50" viewBox="0 0 640 480" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 0h640v480H0V0z" fill="#039"/>
|
|
3
|
+
<path d="M325.032 93.15l17.513-.398-14.401 9.972 5.789 16.53L320 108.639l-13.933 10.615 5.789-16.531-14.399-9.97 17.51.396L320 76.374l5.032 16.775zm0 284.444l17.513-.398-14.401 9.972 5.789 16.53L320 393.083l-13.933 10.615 5.789-16.531-14.399-9.97 17.51.397L320 360.818l5.032 16.776zm-147.25-158.983l5.029 16.761 17.511-.397-14.4 9.969 5.79 16.533-13.933-10.616-13.932 10.616 5.788-16.531-14.401-9.971 17.511.397 5.028-16.761.004-.015.001.003.001-.003.003.015zm77.885-105.334l17.511-.397-14.401 9.971 5.79 16.531-13.932-10.614-13.933 10.615 5.788-16.531-14.4-9.971h.005l-.003-.001 17.51.397 5.033-16.775 5.032 16.775zm-52.729 52.729l17.511-.398h.002l-14.402 9.971 5.79 16.531-13.933-10.615-13.932 10.615 5.789-16.532-14.4-9.97 17.51.397 5.033-16.776 5.032 16.777zm-5.001 125.803l5.027 16.759 17.513-.397-14.401 9.971 5.79 16.531-.005-.005.003.006-13.932-10.615-13.933 10.615 5.788-16.532-14.398-9.97 17.51.396 5.029-16.759.004-.016v.003l.002-.003.003.016zm51.445 47.71l5.027 16.76 17.513-.397-14.401 9.97 5.791 16.532-.004-.004.002.004-13.933-10.615-13.933 10.615 5.788-16.532-14.398-9.97 17.51.397 5.029-16.76.004-.016v.003l.002-.003.003.016zm217.873-104.147l17.511-.397-14.401 9.969 5.79 16.533-13.934-10.616-13.931 10.616 5.789-16.533-14.399-9.969 17.509.397 5.034-16.776 5.032 16.776zm-63.958-95.997l-5.786-16.522 14.401-9.972-17.511.398-5.033-16.778-5.034 16.777-17.51-.398 14.4 9.972-5.789 16.53 13.932-10.614 13.934 10.614-.004-.007zm38.797 42.122l13.934 10.614-.004-.007-5.787-16.524 14.401-9.971-17.51.399-5.033-16.778-5.033 16.777-17.51-.398h-.001l14.399 9.972-5.787 16.529 13.931-10.613zm5.007 127.071l17.51-.397-14.4 9.971 5.79 16.531-13.933-10.614-13.932 10.615 5.788-16.531-14.401-9.971h.005l-.003-.001 17.51.397 5.033-16.775 5.033 16.775zm-51.446 47.711l17.511-.397-14.4 9.97 5.79 16.532-13.933-10.615-13.933 10.615 5.789-16.531-14.401-9.971h.002l17.51.397 5.033-16.776 5.032 16.776z" fill="#FC0"/>
|
|
4
|
+
</svg>
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
export { euSvg as e };
|