@ebrains/react 1.4.0 → 2.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/bin-37cad2f0.esm.js +3 -0
- package/clone-dab56639.esm.js +3 -0
- 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/draft-dd5dada2.esm.js +3 -0
- package/edit-3893a517.esm.js +3 -0
- package/eds-accordion_33.entry.esm.js +1123 -0
- package/eds-app-root.entry.esm.js +4 -4
- package/eds-card-desc_2.entry.esm.js +4 -4
- package/eds-card-generic.entry.esm.js +4 -5
- package/eds-card-project.entry.esm.js +10 -11
- package/eds-card-tags.entry.esm.js +1 -1
- package/eds-card-tool.entry.esm.js +4 -4
- package/eds-cookies-preference.entry.esm.js +2 -2
- package/eds-feedback.entry.esm.js +5 -5
- package/eds-footer.entry.esm.js +135 -0
- package/eds-frame.entry.esm.js +4 -4
- package/eds-fullscreen-menu.entry.esm.js +124 -0
- package/eds-gauge.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-bin.entry.esm.js +21 -0
- 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-clone.entry.esm.js +21 -0
- package/eds-icon-close.entry.esm.js +1 -1
- package/eds-icon-copy.entry.esm.js +1 -1
- package/eds-icon-draft.entry.esm.js +21 -0
- package/eds-icon-edit.entry.esm.js +21 -0
- 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-start.entry.esm.js +21 -0
- 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-view.entry.esm.js +21 -0
- package/eds-icon-youtube.entry.esm.js +1 -1
- package/eds-modal.entry.esm.js +150 -0
- package/eds-progress-bar.entry.esm.js +4 -4
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-social-networks.entry.esm.js +74 -0
- package/eds-spinner.entry.esm.js +51 -14
- package/eds-splash-screen.entry.esm.js +1 -4
- package/eds-timeline.entry.esm.js +4 -4
- package/eds-toast-manager.entry.esm.js +1 -1
- package/eds-tooltip.entry.esm.js +12 -6
- package/eds-trl.entry.esm.js +2 -2
- package/incorrect-use-of-colors.entry.esm.js +8 -8
- package/index.esm.js +1 -1
- package/index.esm2.js +37 -26
- 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 +1 -0
- package/start-65126a4f.esm.js +3 -0
- package/svg-repository.entry.esm.js +15 -3
- 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/view-e900f2d4.esm.js +3 -0
- package/eds-accordion.entry.esm.js +0 -132
- package/eds-alert.entry.esm.js +0 -112
- package/eds-avatar_29.entry.esm.js +0 -3660
- package/eds-breadcrumb.entry.esm.js +0 -179
- package/eds-code-block.entry.esm.js +0 -2290
- package/eds-matomo-notice.entry.esm.js +0 -159
- package/eds-rating.entry.esm.js +0 -79
- package/eds-switch.entry.esm.js +0 -68
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index.esm2.js';
|
|
2
|
-
import { p as parseData } from './sharedUtils-a550989c.esm.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import 'react/jsx-runtime';
|
|
5
|
-
import 'react-dom';
|
|
6
|
-
|
|
7
|
-
const edsBreadcrumbCss = "blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}.hidden{display:none}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.125rem * var(--tw-space-x-reverse));margin-left:calc(0.125rem * calc(1 - var(--tw-space-x-reverse)))}.px-2{padding-left:0.125rem;padding-right:0.125rem}.w-20{width:1.25rem}.w-28{width:1.75rem}.w-32{width:2rem}.w-44{width:2.75rem}.h-20{height:1.25rem}.h-24{height:1.5rem}.h-28{height:1.75rem}.h-32{height:2rem}@media (min-width: 750px){.md\\:block{display:block}}";
|
|
8
|
-
const EdsBreadcrumbStyle0 = edsBreadcrumbCss;
|
|
9
|
-
const EdsBreadcrumb = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
registerInstance(this, hostRef);
|
|
12
|
-
/**
|
|
13
|
-
* Updates the maximum number of visible items and tracks if the screen is small.
|
|
14
|
-
*/
|
|
15
|
-
this.updateScreenSize = () => {
|
|
16
|
-
const width = window.innerWidth;
|
|
17
|
-
if (width < 769) {
|
|
18
|
-
this.maxVisibleItems = 3;
|
|
19
|
-
} else if (width <= 1024) {
|
|
20
|
-
this.maxVisibleItems = 3;
|
|
21
|
-
} else if (width <= 1280) {
|
|
22
|
-
this.maxVisibleItems = 3;
|
|
23
|
-
} else if (width <= 2200) {
|
|
24
|
-
this.maxVisibleItems = 4;
|
|
25
|
-
} else {
|
|
26
|
-
this.maxVisibleItems = 6;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
this.items = [];
|
|
30
|
-
this.intent = 'ghost';
|
|
31
|
-
this.parsedItems = [];
|
|
32
|
-
this.isSmallScreen = false;
|
|
33
|
-
this.maxVisibleItems = 6;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Watches for changes to the `items` prop and parses it.
|
|
37
|
-
*/
|
|
38
|
-
parseItems(newValue) {
|
|
39
|
-
this.parsedItems = parseData(newValue);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Lifecycle method that runs when the component is about to be loaded.
|
|
43
|
-
* It parses the initial `items` prop value.
|
|
44
|
-
*/
|
|
45
|
-
componentWillLoad() {
|
|
46
|
-
this.parseItems(this.items);
|
|
47
|
-
this.updateScreenSize();
|
|
48
|
-
window.addEventListener('resize', this.updateScreenSize);
|
|
49
|
-
}
|
|
50
|
-
disconnectedCallback() {
|
|
51
|
-
window.removeEventListener('resize', this.updateScreenSize);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Lifecycle method that runs when the component has fully loaded.
|
|
55
|
-
* It emits a custom event for each `eds-link` element contained within the breadcrumb.
|
|
56
|
-
*/
|
|
57
|
-
componentDidLoad() {
|
|
58
|
-
var _a;
|
|
59
|
-
const links = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('eds-link');
|
|
60
|
-
links === null || links === void 0 ? void 0 : links.forEach(link => {
|
|
61
|
-
this.emitContext(link);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Emits a custom event called `parentContext` for a given link element.
|
|
66
|
-
* This event provides context information about the breadcrumb component.
|
|
67
|
-
*
|
|
68
|
-
* @param linkElement - The link element to which the event will be dispatched.
|
|
69
|
-
*/
|
|
70
|
-
emitContext(linkElement) {
|
|
71
|
-
const event = new CustomEvent('parentContext', {
|
|
72
|
-
detail: {
|
|
73
|
-
componentName: this.el.tagName.toLowerCase(),
|
|
74
|
-
identifier: null
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
linkElement.dispatchEvent(event);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Returns breadcrumb items with potential truncation if there are too many.
|
|
81
|
-
* It inserts an ellipsis item where necessary.
|
|
82
|
-
*/
|
|
83
|
-
getTruncatedItems() {
|
|
84
|
-
const totalItems = this.parsedItems.length;
|
|
85
|
-
const ellipsis = {
|
|
86
|
-
label: '...',
|
|
87
|
-
url: '',
|
|
88
|
-
isHidden: true
|
|
89
|
-
};
|
|
90
|
-
if (totalItems > this.maxVisibleItems) {
|
|
91
|
-
const firstItem = this.parsedItems[0];
|
|
92
|
-
const lastItems = this.parsedItems.slice(-2);
|
|
93
|
-
if (this.maxVisibleItems === 3) {
|
|
94
|
-
return [firstItem, ellipsis, ...lastItems];
|
|
95
|
-
} else if (this.maxVisibleItems === 4) {
|
|
96
|
-
const middleItem = this.parsedItems[Math.floor(totalItems / 2)];
|
|
97
|
-
return [firstItem, middleItem, ellipsis, ...lastItems];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return this.parsedItems;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Helper to determine the display label and full label.
|
|
104
|
-
* If the label is longer than 15 characters and the item is not the current (last) item,
|
|
105
|
-
* we display a truncated version but use the full label for aria attributes.
|
|
106
|
-
*/
|
|
107
|
-
getLabels(item, isCurrent) {
|
|
108
|
-
if (!isCurrent && item.label.length > 15) {
|
|
109
|
-
return {
|
|
110
|
-
displayLabel: `${item.label.slice(0, 15)}...`,
|
|
111
|
-
fullLabel: item.label
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
displayLabel: item.label,
|
|
116
|
-
fullLabel: item.label
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Render method for the breadcrumb component.
|
|
121
|
-
* It creates a navigation element with an ordered list of breadcrumb links.
|
|
122
|
-
* The last link is marked as the current page.
|
|
123
|
-
*/
|
|
124
|
-
render() {
|
|
125
|
-
const itemsToRender = this.getTruncatedItems();
|
|
126
|
-
return h("nav", {
|
|
127
|
-
key: 'db769320b42e627fffd71676c1e0551646f1de70',
|
|
128
|
-
"aria-label": "Breadcrumb"
|
|
129
|
-
}, h("ol", {
|
|
130
|
-
key: '6cef8ed43cabcee73cb4ad4fb26f809d0690c0ec',
|
|
131
|
-
class: "flex items-center space-x-2"
|
|
132
|
-
}, itemsToRender.map((item, index) => {
|
|
133
|
-
const isLast = index === itemsToRender.length - 1;
|
|
134
|
-
return h("li", {
|
|
135
|
-
class: "flex items-center"
|
|
136
|
-
}, !item.isHidden ? (() => {
|
|
137
|
-
const {
|
|
138
|
-
fullLabel
|
|
139
|
-
} = this.getLabels(item, isLast);
|
|
140
|
-
const linkIntent = isLast ? this.intent === 'strong' ? 'weak' : this.intent === 'weak' ? 'strong' : this.intent : this.intent;
|
|
141
|
-
return h("eds-link", Object.assign({
|
|
142
|
-
label: fullLabel,
|
|
143
|
-
url: item.url,
|
|
144
|
-
intent: linkIntent,
|
|
145
|
-
disabled: isLast,
|
|
146
|
-
current: isLast,
|
|
147
|
-
"aria-label": fullLabel,
|
|
148
|
-
size: "small",
|
|
149
|
-
"icon-small": "false"
|
|
150
|
-
}, isLast ? {
|
|
151
|
-
'aria-current': 'page'
|
|
152
|
-
} : {}));
|
|
153
|
-
})() : h("eds-link", {
|
|
154
|
-
label: "...",
|
|
155
|
-
url: "#",
|
|
156
|
-
intent: "strong",
|
|
157
|
-
current: false,
|
|
158
|
-
"aria-label": "...",
|
|
159
|
-
size: "small",
|
|
160
|
-
"icon-small": "false",
|
|
161
|
-
icon: "chevron-right"
|
|
162
|
-
}), !isLast && !item.isHidden && h("eds-icon-wrapper", {
|
|
163
|
-
icon: "chevron-right",
|
|
164
|
-
class: "w-20 h-20"
|
|
165
|
-
}));
|
|
166
|
-
})));
|
|
167
|
-
}
|
|
168
|
-
get el() {
|
|
169
|
-
return getElement(this);
|
|
170
|
-
}
|
|
171
|
-
static get watchers() {
|
|
172
|
-
return {
|
|
173
|
-
"items": ["parseItems"]
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
EdsBreadcrumb.style = EdsBreadcrumbStyle0;
|
|
178
|
-
|
|
179
|
-
export { EdsBreadcrumb as eds_breadcrumb };
|