@ebrains/react 0.9.3-beta → 1.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/README.md +3 -3
- package/{analytics-44b1416b.esm.js → analytics-d99780e3.esm.js} +2 -2
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/components-section.entry.esm.js +23 -17
- 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.entry.esm.js +11 -11
- package/eds-alert.entry.esm.js +3 -3
- package/eds-app-root.entry.esm.js +4 -4
- package/eds-avatar_28.entry.esm.js +3523 -0
- package/eds-breadcrumb.entry.esm.js +179 -0
- package/eds-card-desc_2.entry.esm.js +6 -7
- package/eds-card-generic.entry.esm.js +4 -4
- package/eds-card-project.entry.esm.js +130 -13
- package/eds-card-tags.entry.esm.js +1 -1
- package/eds-card-tool.entry.esm.js +5 -5
- package/eds-code-block.entry.esm.js +7 -7
- package/eds-cookies-preference.entry.esm.js +2 -2
- package/eds-feedback.entry.esm.js +12 -7
- package/eds-frame.entry.esm.js +6 -6
- package/eds-gauge.entry.esm.js +78 -0
- 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-bookmark.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-external.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-minus.entry.esm.js +1 -1
- package/eds-icon-more.entry.esm.js +1 -1
- package/eds-icon-paper.entry.esm.js +1 -1
- package/eds-icon-plus.entry.esm.js +1 -1
- package/eds-icon-portal.entry.esm.js +1 -1
- package/eds-icon-private.entry.esm.js +1 -1
- package/eds-icon-public.entry.esm.js +1 -1
- package/eds-icon-search.entry.esm.js +1 -1
- package/eds-icon-star.entry.esm.js +1 -1
- package/eds-icon-success.entry.esm.js +1 -1
- package/eds-icon-thumbs-down.entry.esm.js +1 -1
- package/eds-icon-thumbs-up.entry.esm.js +1 -1
- package/eds-icon-tutorial.entry.esm.js +1 -1
- package/eds-icon-twitter.entry.esm.js +1 -1
- package/eds-icon-unknown.entry.esm.js +1 -1
- package/eds-icon-updown.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-matomo-notice.entry.esm.js +5 -8
- package/eds-pie.entry.esm.js +131 -0
- package/eds-progress-bar.entry.esm.js +19 -8
- package/eds-rating.entry.esm.js +1 -1
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-spinner.entry.esm.js +3 -3
- package/eds-splash-screen.entry.esm.js +87 -0
- package/eds-switch.entry.esm.js +21 -11
- package/eds-timeline.entry.esm.js +5 -5
- package/eds-toast-manager.entry.esm.js +33 -2
- package/eds-toast.entry.esm.js +4 -3
- package/eds-tooltip.entry.esm.js +12 -96
- package/eds-trl.entry.esm.js +2 -2
- package/incorrect-use-of-colors.entry.esm.js +11 -8
- package/index.esm.js +1 -1
- package/index.esm2.js +51 -308
- package/logo-space.entry.esm.js +9 -9
- package/logo-variations-horizontal_2.entry.esm.js +28 -28
- package/logo-variations-tabs.entry.esm.js +1 -1
- package/logo-wrong-usage.entry.esm.js +25 -25
- package/package.json +1 -1
- package/src/components.d.ts +2 -2
- package/src/generated/components.d.ts +1 -1
- package/svg-repository.entry.esm.js +2 -2
- package/token-list_3.entry.esm.js +5 -5
- package/token-ratios.entry.esm.js +3 -3
- package/token-spacing.entry.esm.js +93 -0
- package/token-typography.entry.esm.js +2 -2
- package/color-2554aad6.esm.js +0 -122
- package/eds-avatar_27.entry.esm.js +0 -332
- package/eds-card-wrapper.entry.esm.js +0 -39
- package/eds-login_2.entry.esm.js +0 -1828
- package/eds-pagination_2.entry.esm.js +0 -493
- package/eds-tabs.entry.esm.js +0 -143
- package/toastManager-d9eee791.esm.js +0 -34
|
@@ -0,0 +1,78 @@
|
|
|
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 edsGaugeCss = ".relative{position:relative}.absolute{position:absolute}.inline-block{display:inline-block}.rounded-full{border-radius:9999px}.overflow-hidden{overflow:hidden}.bg-inverse{background-color:var(--white)}.bg-current{background-color:currentColor}.bg-dark{background-color:var(--grey-300)}.bg-darker{background-color:var(--grey-400)}.bg-default{background-color:var(--grey-200)}.bg-strong{background-color:var(--grey-700)}.bg-strongest{background-color:var(--black)}.inset-0{inset:0rem}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.f-body-01{font-family:var(--f-body-01-fontFamily);font-weight:var(--f-body-01-fontWeight);font-size:var(--f-body-01-fontSize);line-height:var(--f-body-01-lineHeight);letter-spacing:var(--f-body-01-letterSpacing)}.text-default{color:var(--black)}";
|
|
7
|
+
const EdsGaugeStyle0 = edsGaugeCss;
|
|
8
|
+
const BACKGROUND_VARIANTS = {
|
|
9
|
+
default: '#f2f2f2',
|
|
10
|
+
dark: '#d8d8d8',
|
|
11
|
+
strong: '#666666',
|
|
12
|
+
black: '#000000'
|
|
13
|
+
};
|
|
14
|
+
const EdsGauge = class {
|
|
15
|
+
constructor(hostRef) {
|
|
16
|
+
registerInstance(this, hostRef);
|
|
17
|
+
this.size = 100;
|
|
18
|
+
this.valueMin = 0;
|
|
19
|
+
this.valueMax = 100;
|
|
20
|
+
this.value = 60;
|
|
21
|
+
this.thickness = 0.1;
|
|
22
|
+
this.variant = 'default';
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
// Clamp thickness to [0,1]
|
|
26
|
+
const thicknessClamped = Math.min(Math.max(this.thickness, 0.1), 0.2);
|
|
27
|
+
// Normalize value within [valueMin, valueMax]
|
|
28
|
+
const clamped = Math.min(Math.max(this.value, this.valueMin), this.valueMax);
|
|
29
|
+
const range = this.valueMax - this.valueMin || 1;
|
|
30
|
+
const ratio = (clamped - this.valueMin) / range;
|
|
31
|
+
// Use the smaller of width/height as diameter
|
|
32
|
+
const diameter = this.size;
|
|
33
|
+
const angle = ratio * 360;
|
|
34
|
+
const ringThickness = thicknessClamped * diameter;
|
|
35
|
+
const innerDiameter = diameter - ringThickness * 2;
|
|
36
|
+
const fontSize = diameter * 0.2;
|
|
37
|
+
// Determine background color for empty portion
|
|
38
|
+
const emptyColor = BACKGROUND_VARIANTS[this.variant] || BACKGROUND_VARIANTS.default;
|
|
39
|
+
const containerStyle = {
|
|
40
|
+
width: `${diameter}px`,
|
|
41
|
+
height: `${diameter}px`,
|
|
42
|
+
background: `conic-gradient(#00e766 0deg ${angle}deg, ${emptyColor} ${angle}deg 360deg)`
|
|
43
|
+
};
|
|
44
|
+
const maskStyle = {
|
|
45
|
+
width: `${innerDiameter}px`,
|
|
46
|
+
height: `${innerDiameter}px`,
|
|
47
|
+
top: `${ringThickness}px`,
|
|
48
|
+
left: `${ringThickness}px`
|
|
49
|
+
};
|
|
50
|
+
const textStyle = {
|
|
51
|
+
fontSize: `${fontSize}px`
|
|
52
|
+
};
|
|
53
|
+
return h("div", {
|
|
54
|
+
key: '2918e034b24749fd1fcad84f4a8614043c6a9ea2',
|
|
55
|
+
role: "progressbar",
|
|
56
|
+
"aria-valuemin": this.valueMin,
|
|
57
|
+
"aria-valuemax": this.valueMax,
|
|
58
|
+
"aria-valuenow": clamped,
|
|
59
|
+
"aria-label": `Gauge value: ${clamped} of ${this.valueMax}`,
|
|
60
|
+
class: "relative inline-block rounded-full overflow-hidden",
|
|
61
|
+
style: containerStyle
|
|
62
|
+
}, h("div", {
|
|
63
|
+
key: 'a24d393bfcdbd45019f7a560c4af0330c720af0c',
|
|
64
|
+
class: "absolute bg-inverse rounded-full",
|
|
65
|
+
style: maskStyle
|
|
66
|
+
}), h("div", {
|
|
67
|
+
key: '712fc9211b6e90afdf7063a4e6a6af74ec88dfdd',
|
|
68
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
69
|
+
}, h("span", {
|
|
70
|
+
key: '88d3ffc3fea9ff77247b4ecbb4af3a6ac39c1cb4',
|
|
71
|
+
class: "f-body-01 text-default",
|
|
72
|
+
style: textStyle
|
|
73
|
+
}, clamped)));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
EdsGauge.style = EdsGaugeStyle0;
|
|
77
|
+
|
|
78
|
+
export { EdsGauge as eds_gauge };
|
package/eds-icon-eu.entry.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { m as matomoOptIn, a as matomoOptOut } from './analytics-
|
|
2
|
+
import { m as matomoOptIn, a as matomoOptOut } from './analytics-d99780e3.esm.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react-dom';
|
|
@@ -92,14 +92,16 @@ const EdsMatomoNotice = class {
|
|
|
92
92
|
this.consent.emit('out');
|
|
93
93
|
}
|
|
94
94
|
noThanks() {
|
|
95
|
+
matomoOptOut();
|
|
95
96
|
localStorage.setItem(`${window.location.host}-matomo-consent-given`, 'out');
|
|
96
97
|
this.hideNotice();
|
|
98
|
+
this.consent.emit('out');
|
|
97
99
|
}
|
|
98
|
-
deferDecision() {
|
|
100
|
+
/*private deferDecision() {
|
|
99
101
|
sessionStorage.setItem(this.getStorageKey(), 'true');
|
|
100
102
|
this.hideNotice();
|
|
101
103
|
this.consent.emit('defer');
|
|
102
|
-
}
|
|
104
|
+
}*/
|
|
103
105
|
keepMeIn() {
|
|
104
106
|
this.hideNotice();
|
|
105
107
|
}
|
|
@@ -146,11 +148,6 @@ const EdsMatomoNotice = class {
|
|
|
146
148
|
label: "No, thanks",
|
|
147
149
|
"aria-label": "Opt-out from analytics",
|
|
148
150
|
onClick: () => this.noThanks()
|
|
149
|
-
}), h("eds-button", {
|
|
150
|
-
intent: "ghost",
|
|
151
|
-
label: "Ask me later",
|
|
152
|
-
"aria-label": "Defer analytics decision",
|
|
153
|
-
onClick: () => this.deferDecision()
|
|
154
151
|
}))));
|
|
155
152
|
}
|
|
156
153
|
get el() {
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
const edsPieCss = ".relative{position:relative}.absolute{position:absolute}.inline-block{display:inline-block}.rounded-full{border-radius:9999px}.overflow-hidden{overflow:hidden}.bg-inverse{background-color:var(--white)}.bg-current{background-color:currentColor}.bg-dark{background-color:var(--grey-300)}.bg-darker{background-color:var(--grey-400)}.bg-default{background-color:var(--grey-200)}.bg-strong{background-color:var(--grey-700)}.bg-strongest{background-color:var(--black)}.inset-0{inset:0rem}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.f-body-01{font-family:var(--f-body-01-fontFamily);font-weight:var(--f-body-01-fontWeight);font-size:var(--f-body-01-fontSize);line-height:var(--f-body-01-lineHeight);letter-spacing:var(--f-body-01-letterSpacing)}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.text-default{color:var(--black)}.w-8{width:0.5rem}.h-8{height:0.5rem}.mr-4{margin-right:0.25rem}:host{display:block}.wrapper{display:flex;align-items:center;justify-content:center;height:100%}.pie-chart{overflow:visible}.slice-label{font-size:var(--font-size-chart-label);font-weight:var(--font-weight-chart-label);fill:var(--color-text);pointer-events:none}.legend{list-style:none;margin:0;padding:0 0 0 1rem}.legend-item{display:flex;align-items:center;margin-bottom:0.5rem;outline:none}.legend-item:focus{outline:2px dashed var(--color-primary)}.legend-swatch{width:1rem;height:1rem;border-radius:50%;margin-right:0.5rem}.legend-label{font-size:var(--font-size-base);color:var(--color-text)}";
|
|
7
|
+
const EdsPieStyle0 = edsPieCss;
|
|
8
|
+
const EdsPie = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.size = 200;
|
|
12
|
+
this.slices = [];
|
|
13
|
+
this.thickness = 1;
|
|
14
|
+
this.display = 'value';
|
|
15
|
+
this.legend = true;
|
|
16
|
+
this.colorScheme = 'semantic';
|
|
17
|
+
}
|
|
18
|
+
parseSlices() {
|
|
19
|
+
if (typeof this.slices === 'string') {
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(this.slices);
|
|
22
|
+
} catch (_a) {
|
|
23
|
+
// eslint-disable-next-line
|
|
24
|
+
console.warn('eds-pie: invalid slices JSON');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return Array.isArray(this.slices) ? this.slices : [];
|
|
28
|
+
}
|
|
29
|
+
polarToCartesian(cx, cy, r, angle) {
|
|
30
|
+
const rad = (angle - 90) * (Math.PI / 180);
|
|
31
|
+
return {
|
|
32
|
+
x: cx + r * Math.cos(rad),
|
|
33
|
+
y: cy + r * Math.sin(rad)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
describeArc(x, y, r, startAngle, endAngle) {
|
|
37
|
+
const start = this.polarToCartesian(x, y, r, endAngle);
|
|
38
|
+
const end = this.polarToCartesian(x, y, r, startAngle);
|
|
39
|
+
const largeArcFlag = endAngle - startAngle <= 180 ? '0' : '1';
|
|
40
|
+
return [`M ${start.x} ${start.y}`, `A ${r} ${r} 0 ${largeArcFlag} 0 ${end.x} ${end.y}`, `L ${x} ${y}`, 'Z'].join(' ');
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
const raw = this.parseSlices();
|
|
44
|
+
if (raw.length > EdsPie.MAX_SLICES) {
|
|
45
|
+
// eslint-disable-next-line
|
|
46
|
+
console.warn(`eds-pie: too many slices (${raw.length}), results may overlap.`);
|
|
47
|
+
}
|
|
48
|
+
const total = raw.reduce((sum, s) => sum + s.value, 0) || 1;
|
|
49
|
+
const palette = [...EdsPie.PALETTES[this.colorScheme]];
|
|
50
|
+
const sorted = [...raw].sort((a, b) => b.value - a.value);
|
|
51
|
+
let cumulative = 0;
|
|
52
|
+
const processed = sorted.map(s => {
|
|
53
|
+
const angle = s.value / total * 360;
|
|
54
|
+
const start = cumulative,
|
|
55
|
+
end = cumulative + angle;
|
|
56
|
+
cumulative = end;
|
|
57
|
+
const color = s.color || palette.shift() || 'var(--color-chart-neutral-1)';
|
|
58
|
+
return Object.assign(Object.assign({}, s), {
|
|
59
|
+
start,
|
|
60
|
+
end,
|
|
61
|
+
color
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
const diameter = this.size;
|
|
65
|
+
const radius = diameter / 2;
|
|
66
|
+
// clamp into [0.5, 1]
|
|
67
|
+
const tClamped = Math.min(Math.max(this.thickness, 0.5), 1);
|
|
68
|
+
const innerRadius = radius * (1 - tClamped);
|
|
69
|
+
const outerRadius = radius;
|
|
70
|
+
// **replace** the previous labelRadius line with this:
|
|
71
|
+
const labelRadius = (radius + innerRadius) / 2;
|
|
72
|
+
// Build ARIA description
|
|
73
|
+
const ariaLabel = processed.map(s => `${s.label}: ${this.display === 'percent' ? `${Math.round(s.value / total * 100)}%` : s.value}`).join(', ');
|
|
74
|
+
return h(Host, null, h("div", {
|
|
75
|
+
class: "wrapper"
|
|
76
|
+
}, h("svg", {
|
|
77
|
+
width: diameter,
|
|
78
|
+
height: diameter,
|
|
79
|
+
role: "img",
|
|
80
|
+
"aria-label": `Pie chart: ${ariaLabel}`,
|
|
81
|
+
class: "pie-chart"
|
|
82
|
+
}, h("title", null, "Pie chart"), h("g", null, processed.map(s => h("path", {
|
|
83
|
+
key: s.id,
|
|
84
|
+
d: this.describeArc(radius, radius, outerRadius, s.start, s.end),
|
|
85
|
+
fill: s.color
|
|
86
|
+
})), innerRadius > 0 && h("circle", {
|
|
87
|
+
cx: radius,
|
|
88
|
+
cy: radius,
|
|
89
|
+
r: innerRadius,
|
|
90
|
+
fill: "var(--white)"
|
|
91
|
+
}), processed.map(s => {
|
|
92
|
+
const midAngle = s.start + (s.end - s.start) / 2;
|
|
93
|
+
const {
|
|
94
|
+
x,
|
|
95
|
+
y
|
|
96
|
+
} = this.polarToCartesian(radius, radius, labelRadius, midAngle);
|
|
97
|
+
const text = this.display === 'percent' ? `${Math.round(s.value / total * 100)}%` : String(s.value);
|
|
98
|
+
return h("text", {
|
|
99
|
+
key: s.id,
|
|
100
|
+
x: x,
|
|
101
|
+
y: y,
|
|
102
|
+
class: "f-ui-02",
|
|
103
|
+
"text-anchor": "middle",
|
|
104
|
+
"alignment-baseline": "middle"
|
|
105
|
+
}, text);
|
|
106
|
+
}))), this.legend && h("ul", {
|
|
107
|
+
class: "legend",
|
|
108
|
+
role: "list"
|
|
109
|
+
}, processed.map(s => h("li", {
|
|
110
|
+
key: s.id,
|
|
111
|
+
role: "listitem",
|
|
112
|
+
tabindex: "0",
|
|
113
|
+
class: "legend-item"
|
|
114
|
+
}, h("span", {
|
|
115
|
+
class: "legend-swatch",
|
|
116
|
+
style: {
|
|
117
|
+
backgroundColor: s.color
|
|
118
|
+
}
|
|
119
|
+
}), h("span", {
|
|
120
|
+
class: "legend-label"
|
|
121
|
+
}, s.label))))));
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
EdsPie.MAX_SLICES = 9;
|
|
125
|
+
EdsPie.PALETTES = {
|
|
126
|
+
semantic: ['var(--color-chart-accent)', 'var(--color-chart-strong)', 'var(--color-chart-accent-dark)', 'var(--color-chart-lighter)', 'var(--color-chart-accent-light)', 'var(--color-chart-lightest)', 'var(--color-chart-accent-lighter)', 'var(--color-chart-darker)', 'var(--color-chart-accent-lightest)'],
|
|
127
|
+
mono: ['var(--grey-700)', 'var(--grey-500)', 'var(--grey-300)', 'var(--grey-100)', 'var(--grey-800)', 'var(--grey-600)', 'var(--grey-400)', 'var(--grey-200)', 'var(--grey-900)']
|
|
128
|
+
};
|
|
129
|
+
EdsPie.style = EdsPieStyle0;
|
|
130
|
+
|
|
131
|
+
export { EdsPie as eds_pie };
|