@ebrains/react 0.9.3-beta → 1.0.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.
Files changed (51) hide show
  1. package/README.md +3 -3
  2. package/{analytics-44b1416b.esm.js → analytics-d99780e3.esm.js} +2 -2
  3. package/color-primary-palette_6.entry.esm.js +106 -106
  4. package/components-section.entry.esm.js +22 -16
  5. package/correct-use-of-colors.entry.esm.js +33 -33
  6. package/docs-palettes.entry.esm.js +1 -1
  7. package/docs-tokens.entry.esm.js +1 -1
  8. package/eds-accordion.entry.esm.js +2 -2
  9. package/eds-alert.entry.esm.js +1 -1
  10. package/eds-app-root.entry.esm.js +4 -4
  11. package/eds-avatar_34.entry.esm.js +3594 -0
  12. package/eds-card-project.entry.esm.js +130 -13
  13. package/eds-card-tool.entry.esm.js +5 -5
  14. package/eds-cookies-preference.entry.esm.js +2 -2
  15. package/eds-feedback.entry.esm.js +12 -7
  16. package/eds-frame.entry.esm.js +6 -6
  17. package/eds-matomo-notice.entry.esm.js +5 -8
  18. package/eds-pagination_2.entry.esm.js +10 -10
  19. package/eds-progress-bar.entry.esm.js +19 -8
  20. package/eds-rating.entry.esm.js +1 -1
  21. package/eds-section-core_2.entry.esm.js +5 -5
  22. package/eds-spinner.entry.esm.js +3 -3
  23. package/eds-splash-screen.entry.esm.js +87 -0
  24. package/eds-switch.entry.esm.js +21 -11
  25. package/eds-timeline.entry.esm.js +5 -5
  26. package/eds-toast-manager.entry.esm.js +33 -2
  27. package/eds-toast.entry.esm.js +4 -3
  28. package/eds-trl.entry.esm.js +2 -2
  29. package/incorrect-use-of-colors.entry.esm.js +11 -8
  30. package/index.esm.js +1 -1
  31. package/index.esm2.js +39 -314
  32. package/logo-space.entry.esm.js +9 -9
  33. package/logo-variations-horizontal_2.entry.esm.js +28 -28
  34. package/logo-variations-tabs.entry.esm.js +1 -1
  35. package/logo-wrong-usage.entry.esm.js +25 -25
  36. package/package.json +1 -1
  37. package/src/components.d.ts +2 -2
  38. package/src/generated/components.d.ts +1 -1
  39. package/svg-repository.entry.esm.js +2 -2
  40. package/token-list_3.entry.esm.js +5 -5
  41. package/token-ratios.entry.esm.js +3 -3
  42. package/token-typography.entry.esm.js +2 -2
  43. package/color-2554aad6.esm.js +0 -122
  44. package/eds-avatar_27.entry.esm.js +0 -332
  45. package/eds-card-desc_2.entry.esm.js +0 -86
  46. package/eds-card-generic.entry.esm.js +0 -114
  47. package/eds-card-wrapper.entry.esm.js +0 -39
  48. package/eds-login_2.entry.esm.js +0 -1828
  49. package/eds-tabs.entry.esm.js +0 -143
  50. package/eds-tooltip.entry.esm.js +0 -125
  51. package/toastManager-d9eee791.esm.js +0 -34
@@ -1,125 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import { s as sendAnalytics } from './analytics-44b1416b.esm.js';
3
- import 'react';
4
- import 'react/jsx-runtime';
5
- import 'react-dom';
6
-
7
- const edsTooltipCss = ".relative{position:relative}.absolute{position:absolute}.rounded-sm{border-radius:8px}.rounded-xs{border-radius:4px}.bg-stronger{background-color:var(--grey-900)}.bg-strongest{background-color:var(--black)}.text-inverse{color:var(--white)}.text-default{color:var(--black)}.f-ui-03{font-family:var(--f-ui-03-fontFamily);font-weight:var(--f-ui-03-fontWeight);font-size:var(--f-ui-03-fontSize);line-height:var(--f-ui-03-lineHeight);letter-spacing:var(--f-ui-03-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)}.pointer-events-none{pointer-events:none}.-top-8{top:-0.5rem}.left-1\\/2{left:50%}.z-10{z-index:10}.block{display:block}.-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))}.-translate-y-full{--tw-translate-y:-100%;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))}.whitespace-nowrap{white-space:nowrap}.py-2{padding-top:0.125rem;padding-bottom:0.125rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.p-4{padding:0.25rem}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.p-12{padding:0.75rem}.p-16{padding:1rem}.p-20{padding:1.25rem}";
8
- const EdsTooltipStyle0 = edsTooltipCss;
9
- const EdsTooltip = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- this.content = undefined;
13
- this.position = 'above';
14
- this.isVisible = false;
15
- this.isPositioned = false;
16
- this.tooltipStyle = {
17
- top: '0px',
18
- left: '0px',
19
- transform: ''
20
- };
21
- }
22
- /**
23
- * Show the tooltip and update its position.
24
- */
25
- async showTooltip() {
26
- var _a;
27
- await this.updateTooltipPosition();
28
- this.isPositioned = true;
29
- this.isVisible = true;
30
- sendAnalytics({
31
- category: 'ui-component',
32
- parentContext: null,
33
- tag: this.el.tagName.toLowerCase(),
34
- name: ((_a = this.content) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
35
- action: 'hover'
36
- });
37
- }
38
- /**
39
- * Hide the tooltip.
40
- */
41
- hideTooltip() {
42
- this.isVisible = false;
43
- this.isPositioned = false; // Reset positioning when hiding
44
- }
45
- /**
46
- * Hide the tooltip when the `Escape` key is pressed.
47
- */
48
- handleKeyPress(event) {
49
- if (event.key === 'Escape') {
50
- this.isVisible = false;
51
- this.isPositioned = false; // Reset positioning when hiding
52
- }
53
- }
54
- /**
55
- * Update the tooltip's position dynamically based on the slotted element's dimensions and position.
56
- */
57
- updateTooltipPosition() {
58
- var _a, _b;
59
- const slotElement = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
60
- if (!slotElement) {
61
- return;
62
- }
63
- const assignedNodes = (slotElement === null || slotElement === void 0 ? void 0 : slotElement.assignedNodes({
64
- flatten: true
65
- })) || [];
66
- const targetElement = assignedNodes.find(node => node instanceof HTMLElement);
67
- if (targetElement) {
68
- const targetRect = targetElement.getBoundingClientRect();
69
- const tooltipElement = (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[role="tooltip"]');
70
- if (tooltipElement) {
71
- const tooltipWidth = tooltipElement.offsetWidth;
72
- const tooltipHeight = tooltipElement.offsetHeight;
73
- // Calculate position based on the preferred `position` prop
74
- let top = 0;
75
- let left = 0;
76
- switch (this.position) {
77
- case 'above':
78
- top = window.scrollY - tooltipHeight - 8; // Above with offset
79
- left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
80
- break;
81
- case 'below':
82
- top = tooltipHeight - window.scrollY + 18; // Below with offset
83
- left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
84
- break;
85
- /*case 'left':
86
- top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
87
- left = targetRect.left - tooltipWidth - 8; // To the left with offset
88
- break;
89
- case 'right':
90
- top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
91
- left = targetRect.right + 8; // To the right with offset
92
- break;*/
93
- }
94
- this.tooltipStyle = {
95
- top: `${top}px`,
96
- left: `${left}px`,
97
- transform: 'translateX(0)' // No additional horizontal adjustment needed
98
- };
99
- }
100
- }
101
- }
102
- render() {
103
- return h("div", {
104
- key: '7bc92c002eaf263a2d10a2391f356f40e23d5998',
105
- class: "relative"
106
- }, h("slot", {
107
- key: 'cc8126196b03fd02bb17701aa4f55d4a406f685a'
108
- }), this.isVisible && this.isPositioned && this.content && h("div", {
109
- key: '00d854649ef43b958081bbb336319a537c181574',
110
- class: "rounded-xs bg-strongest text-inverse f-ui-03-light pointer-events-none absolute z-10 whitespace-nowrap p-6",
111
- role: "tooltip",
112
- style: {
113
- top: this.tooltipStyle.top,
114
- left: this.tooltipStyle.left,
115
- transform: this.tooltipStyle.transform
116
- }
117
- }, this.content));
118
- }
119
- get el() {
120
- return getElement(this);
121
- }
122
- };
123
- EdsTooltip.style = EdsTooltipStyle0;
124
-
125
- export { EdsTooltip as eds_tooltip };
@@ -1,34 +0,0 @@
1
- class ToastManager {
2
- constructor() {
3
- this.toastManagerElement = null;
4
- }
5
- /**
6
- * Initialize the ToastManager with a reference to the `eds-toast-manager` component.
7
- */
8
- init(toastManagerElement) {
9
- this.toastManagerElement = toastManagerElement;
10
- }
11
- /**
12
- * Display a toast.
13
- * @param message - The message to display.
14
- * @param intent - The type of the toast ('success', 'error', 'warning', 'default').
15
- */
16
- show(message, intent = 'default') {
17
- if (!this.toastManagerElement) {
18
- // eslint-disable-next-line
19
- console.error('ToastManager is not initialized. Ensure <eds-toast-manager> is rendered.');
20
- return;
21
- }
22
- const event = new CustomEvent('show-toast', {
23
- detail: {
24
- message,
25
- intent
26
- }
27
- });
28
- this.toastManagerElement.dispatchEvent(event);
29
- }
30
- }
31
- // Export a singleton instance
32
- const toast = new ToastManager();
33
-
34
- export { toast as t };