@ebrains/react 0.5.0-alpha.0 → 0.7.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.
Files changed (89) hide show
  1. package/{analytics-1cde8e4a.esm.js → analytics-44b1416b.esm.js} +9 -1
  2. package/color-primary-palette_6.entry.esm.js +106 -106
  3. package/correct-use-of-colors.entry.esm.js +33 -33
  4. package/eds-accordion_22.entry.esm.js +269 -0
  5. package/eds-alert.entry.esm.js +104 -0
  6. package/eds-app-root.entry.esm.js +53 -0
  7. package/eds-avatar_4.entry.esm.js +2 -10
  8. package/eds-breadcrumb.entry.esm.js +171 -0
  9. package/eds-card-generic.entry.esm.js +7 -17
  10. package/eds-card-project.entry.esm.js +1 -1
  11. package/eds-card-section.entry.esm.js +8 -22
  12. package/eds-card-tool.entry.esm.js +1 -1
  13. package/eds-components-section.entry.esm.js +1 -1
  14. package/eds-cookies-preference.entry.esm.js +47 -0
  15. package/eds-docs-palettes.entry.esm.js +1 -1
  16. package/eds-docs-tokens.entry.esm.js +1 -1
  17. package/{eds-dropdown_2.entry.esm.js → eds-dropdown.entry.esm.js} +20 -99
  18. package/eds-feedback.entry.esm.js +82 -0
  19. package/eds-form.entry.esm.js +254 -254
  20. package/eds-frame.entry.esm.js +34 -33
  21. package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
  22. package/eds-icon-arrow-right.entry.esm.js +1 -1
  23. package/eds-icon-bluesky.entry.esm.js +1 -1
  24. package/eds-icon-chevron-down.entry.esm.js +1 -1
  25. package/eds-icon-chevron-left.entry.esm.js +1 -1
  26. package/eds-icon-chevron-right.entry.esm.js +1 -1
  27. package/eds-icon-chevron-up.entry.esm.js +1 -1
  28. package/eds-icon-close.entry.esm.js +1 -1
  29. package/eds-icon-copy.entry.esm.js +1 -1
  30. package/eds-icon-eu.entry.esm.js +1 -1
  31. package/eds-icon-facebook.entry.esm.js +1 -1
  32. package/eds-icon-gitlab.entry.esm.js +1 -1
  33. package/eds-icon-linkedin.entry.esm.js +1 -1
  34. package/eds-icon-loader.entry.esm.js +1 -1
  35. package/eds-icon-mastodon.entry.esm.js +1 -1
  36. package/eds-icon-menu.entry.esm.js +1 -1
  37. package/eds-icon-more.entry.esm.js +1 -1
  38. package/eds-icon-search.entry.esm.js +1 -1
  39. package/eds-icon-star.entry.esm.js +21 -0
  40. package/eds-icon-success.entry.esm.js +1 -1
  41. package/eds-icon-thumbs-down.entry.esm.js +21 -0
  42. package/eds-icon-thumbs-up.entry.esm.js +21 -0
  43. package/eds-icon-twitter.entry.esm.js +1 -1
  44. package/eds-icon-user.entry.esm.js +1 -1
  45. package/eds-icon-youtube.entry.esm.js +1 -1
  46. package/{keycloak-d502ec16.esm.js → eds-login_2.entry.esm.js} +172 -1
  47. package/eds-logo-variations.entry.esm.js +1 -1
  48. package/eds-modal.entry.esm.js +23 -10
  49. package/eds-progress-bar.entry.esm.js +2 -2
  50. package/eds-rating.entry.esm.js +79 -0
  51. package/eds-section-core_2.entry.esm.js +5 -5
  52. package/eds-spinner.entry.esm.js +67 -0
  53. package/eds-steps.entry.esm.js +89 -0
  54. package/eds-svg-repository.entry.esm.js +8 -2
  55. package/eds-switch.entry.esm.js +58 -0
  56. package/eds-tabs.entry.esm.js +15 -27
  57. package/eds-timeline.entry.esm.js +6 -23
  58. package/eds-toast-manager.entry.esm.js +62 -0
  59. package/eds-toast.entry.esm.js +92 -0
  60. package/eds-tooltip.entry.esm.js +4 -4
  61. package/eds-trl.entry.esm.js +2 -2
  62. package/eds-user.entry.esm.js +64 -87
  63. package/eds-vertical-stepper.entry.esm.js +5 -5
  64. package/formUtils-ac68474d.esm.js +247 -0
  65. package/incorrect-use-of-colors.entry.esm.js +7 -7
  66. package/index.esm.js +1 -1
  67. package/index.esm2.js +51 -27
  68. package/logo-space.entry.esm.js +4 -4
  69. package/logo-variations-horizontal_2.entry.esm.js +26 -26
  70. package/logo-wrong-usage.entry.esm.js +37 -37
  71. package/package.json +1 -1
  72. package/sharedUtils-a550989c.esm.js +17 -0
  73. package/src/components.d.ts +4 -1
  74. package/star-0da9b5e9.esm.js +5 -0
  75. package/thumbs-down-a18fd049.esm.js +5 -0
  76. package/thumbs-up-c19a71bc.esm.js +6 -0
  77. package/token-list_3.entry.esm.js +5 -5
  78. package/token-ratios.entry.esm.js +3 -3
  79. package/token-spacing.entry.esm.js +26 -26
  80. package/token-typography.entry.esm.js +2 -2
  81. package/eds-accordion.entry.esm.js +0 -126
  82. package/eds-alert_17.entry.esm.js +0 -187
  83. package/eds-input_7.entry.esm.js +0 -529
  84. package/eds-login.entry.esm.js +0 -97
  85. package/eds-matomo-notice.entry.esm.js +0 -128
  86. package/eds-navigator.entry.esm.js +0 -72
  87. package/eds-pagination_2.entry.esm.js +0 -472
  88. package/eds-tab.entry.esm.js +0 -41
  89. package/eds-tabs-content.entry.esm.js +0 -145
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
- import { s as sendAnalytics } from './analytics-1cde8e4a.esm.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './analytics-44b1416b.esm.js';
3
3
  import 'react';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react-dom';
@@ -9,6 +9,7 @@ const EdsDropdownStyle0 = edsDropdownCss;
9
9
  const EdsDropdown = class {
10
10
  constructor(hostRef) {
11
11
  registerInstance(this, hostRef);
12
+ this.dropdown = createEvent(this, "dropdown", 7);
12
13
  this.focusableItems = [];
13
14
  /**
14
15
  * Toggles the visibility of the dropdown and manages focus.
@@ -22,6 +23,9 @@ const EdsDropdown = class {
22
23
  } else {
23
24
  this.closeDropdown();
24
25
  }
26
+ this.dropdown.emit({
27
+ expanded: this.isOpen
28
+ });
25
29
  sendAnalytics({
26
30
  category: 'ui-component',
27
31
  parentContext: null,
@@ -48,6 +52,9 @@ const EdsDropdown = class {
48
52
  handleWindowClick(e) {
49
53
  if (!this.host.contains(e.target)) {
50
54
  this.closeDropdown();
55
+ this.dropdown.emit({
56
+ expanded: false
57
+ });
51
58
  }
52
59
  }
53
60
  /**
@@ -60,6 +67,9 @@ const EdsDropdown = class {
60
67
  switch (key) {
61
68
  case 'Tab':
62
69
  this.closeDropdown();
70
+ this.dropdown.emit({
71
+ expanded: false
72
+ });
63
73
  break;
64
74
  case 'ArrowUp':
65
75
  event.preventDefault();
@@ -80,6 +90,9 @@ const EdsDropdown = class {
80
90
  closeDropdown() {
81
91
  this.isOpen = false;
82
92
  this.focusIndex = -1;
93
+ this.dropdown.emit({
94
+ expanded: false
95
+ });
83
96
  }
84
97
  /**
85
98
  * Sets focus on the currently selected item in the dropdown.
@@ -102,11 +115,11 @@ const EdsDropdown = class {
102
115
  */
103
116
  render() {
104
117
  return h("div", {
105
- key: '84f4cea78ea1c40c7897a356fe03ac83922fccb8',
118
+ key: '3edd3453afbd52ee9e3c4d925baa46e07cfdbfc0',
106
119
  class: "z-focus relative",
107
120
  ref: el => this.dropdownContent = el
108
121
  }, h("eds-button", {
109
- key: '99dc51632dc82830054502a2d6d77d9fcefe9337',
122
+ key: '7c69acb6d6213af2cec8c1e00c68d83a5d23d676',
110
123
  label: this.label,
111
124
  "aria-label": this.ariaLabel,
112
125
  icon: this.icon,
@@ -115,7 +128,7 @@ const EdsDropdown = class {
115
128
  "aria-expanded": this.isOpen.toString(),
116
129
  "aria-haspopup": "menu"
117
130
  }), h("nav", {
118
- key: 'a63613a7ecf709fd1d22d77da4b2d286905fef3e',
131
+ key: '5048b1c3cb42418736d471c2331330afef49cbc5',
119
132
  role: "menu",
120
133
  class: {
121
134
  'shadow-small bg-inverse border-softest z-10 z-on-top absolute top-full mt-4 flex flex-col gap-y-4 border-2 p-8': true,
@@ -131,7 +144,7 @@ const EdsDropdown = class {
131
144
  "aria-label": "Dropdown",
132
145
  "aria-hidden": !this.isOpen
133
146
  }, h("slot", {
134
- key: 'dda70b865ed03dc7ad36a32934587bbcb0a16c1b'
147
+ key: '842f316e9a7910aa8b34823e883c54c1979668d1'
135
148
  })));
136
149
  }
137
150
  get host() {
@@ -139,97 +152,5 @@ const EdsDropdown = class {
139
152
  }
140
153
  };
141
154
  EdsDropdown.style = EdsDropdownStyle0;
142
- const EdsUserModal = class {
143
- constructor(hostRef) {
144
- registerInstance(this, hostRef);
145
- this.user = undefined;
146
- this.links = undefined;
147
- this.onLogout = undefined;
148
- this.parsedUser = {};
149
- this.parsedLinks = [];
150
- }
151
- parseUserProp(newValue) {
152
- this.parsedUser = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
153
- }
154
- parseLinksProp(newValue) {
155
- this.parsedLinks = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
156
- }
157
- componentWillLoad() {
158
- this.parseUserProp(this.user);
159
- this.parseLinksProp(this.links);
160
- }
161
- get initials() {
162
- var _a, _b, _c, _d, _e, _f, _g;
163
- const initials = `${((_b = (_a = this.parsedUser) === null || _a === void 0 ? void 0 : _a.firstname) === null || _b === void 0 ? void 0 : _b.charAt(0)) || ''}${((_d = (_c = this.parsedUser) === null || _c === void 0 ? void 0 : _c.lastname) === null || _d === void 0 ? void 0 : _d.charAt(0)) || ''}`.toUpperCase();
164
- return initials || ((_g = (_f = (_e = this.parsedUser) === null || _e === void 0 ? void 0 : _e.fullname) === null || _f === void 0 ? void 0 : _f.charAt(0)) === null || _g === void 0 ? void 0 : _g.toUpperCase()) || '';
165
- }
166
- get hasLogout() {
167
- return typeof this.onLogout === 'function';
168
- }
169
- render() {
170
- var _a, _b, _c, _d, _e;
171
- return h("div", {
172
- key: '4a80335b6a59b9653130ca75a6e42c04fce68f4f',
173
- class: "min-w-[280px] p-8"
174
- }, h("div", {
175
- key: '9c97f6be46216587692d4852174cecfaacb70593',
176
- class: "flex gap-x-16 pb-16 border-b-2 border-softer"
177
- }, h("eds-avatar", {
178
- key: 'c778f6bdfb21068ca7c2deff6e298f61af6dbc67',
179
- "first-name": (_a = this.parsedUser) === null || _a === void 0 ? void 0 : _a.firstname,
180
- "last-name": (_b = this.parsedUser) === null || _b === void 0 ? void 0 : _b.lastname,
181
- initials: this.initials,
182
- color: "grey",
183
- rounded: true,
184
- "initials-strong": true
185
- }), h("div", {
186
- key: '7f453546c9cc54597069abb3e4b50312fe7bf364',
187
- class: "max-w-full"
188
- }, ((_c = this.parsedUser) === null || _c === void 0 ? void 0 : _c.fullname) && h("p", {
189
- key: '34e080ef159535820c09378701de0e6f4fd96009',
190
- class: "f-ui-01 text-default w-full text-ellipsis"
191
- }, this.parsedUser.fullname), ((_d = this.parsedUser) === null || _d === void 0 ? void 0 : _d.username) && h("p", {
192
- key: '2f85764e7d015dc3f3b22ca8a07126f8f57216ef',
193
- class: "f-ui-03-light text-light mt-4"
194
- }, this.parsedUser.username), ((_e = this.parsedUser) === null || _e === void 0 ? void 0 : _e.email) && h("p", {
195
- key: '002dec51e979c29f2343f55e004449e4cee4075c',
196
- class: "f-ui-03-light text-light mt-4"
197
- }, this.parsedUser.email))), h("div", {
198
- key: '740b78c504257fb755ba7ba04dd25f023d37ed33',
199
- class: "text-default mt-16 flex w-full flex-col gap-y-8"
200
- }, h("div", {
201
- key: 'ac307937bdd3fc86cce502e5eeb3e922d931f418',
202
- class: "border-softer mb-10 border-b-2 pb-16"
203
- }, h("eds-link", {
204
- key: 'bdd0f1ef62ac78ffb1b40ed6873475df360cec66',
205
- label: "My EBRAINS",
206
- "aria-label": "My EBRAINS",
207
- url: "https://www.ebrains.eu/dashboard",
208
- intent: "primary",
209
- "extra-class": "w-full",
210
- external: true
211
- })), h("eds-link", {
212
- key: 1,
213
- label: "Account Settings",
214
- url: "https://iam.ebrains.eu/auth/realms/hbp/account/",
215
- intent: "secondary",
216
- icon: "arrow-diagonal",
217
- external: true,
218
- "extra-class": "w-full"
219
- }), this.hasLogout && h("eds-link", {
220
- key: 'd73016ad71f3b356b7fb7d0a2a84124eabb05da5',
221
- label: "Sign out",
222
- intent: "tertiary",
223
- "extra-class": "w-full justify-center",
224
- onClick: () => this.onLogout && this.onLogout()
225
- })));
226
- }
227
- static get watchers() {
228
- return {
229
- "user": ["parseUserProp"],
230
- "links": ["parseLinksProp"]
231
- };
232
- }
233
- };
234
155
 
235
- export { EdsDropdown as eds_dropdown, EdsUserModal as eds_user_modal };
156
+ export { EdsDropdown as eds_dropdown };
@@ -0,0 +1,82 @@
1
+ import { r as registerInstance, c as createEvent, 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 edsFeedbackCss = "h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.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-heading-02{font-family:var(--f-heading-02-fontFamily);font-weight:var(--f-heading-02-fontWeight);font-size:var(--f-heading-02-fontSize);line-height:var(--f-heading-02-lineHeight);letter-spacing:var(--f-heading-02-letterSpacing)}.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)}.f-heading-06{font-family:var(--f-heading-06-fontFamily);font-weight:var(--f-heading-06-fontWeight);font-size:var(--f-heading-06-fontSize);line-height:var(--f-heading-06-lineHeight);letter-spacing:var(--f-heading-06-letterSpacing)}.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-body-02{font-family:var(--f-body-02-fontFamily);font-weight:var(--f-body-02-fontWeight);font-size:var(--f-body-02-fontSize);line-height:var(--f-body-02-lineHeight);letter-spacing:var(--f-body-02-letterSpacing)}.f-ui-04{font-family:var(--f-ui-04-fontFamily);font-weight:var(--f-ui-04-fontWeight);font-size:var(--f-ui-04-fontSize);line-height:var(--f-ui-04-lineHeight);letter-spacing:var(--f-ui-04-letterSpacing)}.inline{display:inline}.grid{display:grid}.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}.my-4{margin-top:0.25rem;margin-bottom:0.25rem}.my-8{margin-top:0.5rem;margin-bottom:0.5rem}.my-16{margin-top:1rem;margin-bottom:1rem}.my-20{margin-top:1.25rem;margin-bottom:1.25rem}";
8
+ const EdsFeedbackStyle0 = edsFeedbackCss;
9
+ const EdsFeedback = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.rating = createEvent(this, "rating", 7);
13
+ this.type = 'star';
14
+ this.count = 5;
15
+ this.label = 'Rate your Experience!';
16
+ this.description = 'This is a description!';
17
+ this.textMapping = ['Very Poor', 'Poor', 'Average', 'Good', 'Excellent'];
18
+ this.selectedRating = 0;
19
+ }
20
+ /**
21
+ * Lifecycle method that runs when the component has fully loaded.
22
+ * It emits a custom event for each `eds-button` element contained within the breadcrumb.
23
+ */
24
+ componentDidLoad() {
25
+ const btns = this.el.shadowRoot.querySelectorAll('eds-button');
26
+ btns.forEach(btn => {
27
+ this.emitContext(btn);
28
+ });
29
+ }
30
+ /**
31
+ * Emits a custom event called `parentContext` for a given link element.
32
+ * This event provides context information about the breadcrumb component.
33
+ *
34
+ * @param btnElement - The link element to which the event will be dispatched.
35
+ */
36
+ emitContext(btnElement) {
37
+ const event = new CustomEvent('parentContext', {
38
+ detail: {
39
+ componentName: this.el.tagName.toLowerCase(),
40
+ identifier: this.selectedRating
41
+ }
42
+ });
43
+ btnElement.dispatchEvent(event);
44
+ }
45
+ /**
46
+ * Parses the `textMapping` prop into an array of strings.
47
+ */
48
+ get parsedMappings() {
49
+ return parseData(this.textMapping);
50
+ }
51
+ /**
52
+ * Listens for global custom events to open the modal.
53
+ */
54
+ ratingUpdated(e) {
55
+ this.selectedRating = e.detail;
56
+ }
57
+ render() {
58
+ return h("div", {
59
+ key: '125299e9780486a10213fc3c59b15e7a4fb62616',
60
+ class: "grid inline"
61
+ }, h("p", {
62
+ key: '6a02d78d34a590bc213cd5bf311ec8bed44f8959',
63
+ class: "f-heading-03 my-4"
64
+ }, this.label), h("p", {
65
+ key: '76146fbade2f864ba7b72429a85218ebf6a24ea7',
66
+ class: "f-body-02 text-light"
67
+ }, this.description), h("eds-rating", {
68
+ key: '38e0ec9219adaf85f674fab6be471112f06e42ff',
69
+ "rating-type": this.type,
70
+ "rating-count": this.count
71
+ }), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && h("span", {
72
+ key: 'beab34888d3db63ca2ee374a2d10d407bfc948cc',
73
+ class: "f-ui-04 text-lighter"
74
+ }, this.parsedMappings[this.selectedRating - 1]));
75
+ }
76
+ get el() {
77
+ return getElement(this);
78
+ }
79
+ };
80
+ EdsFeedback.style = EdsFeedbackStyle0;
81
+
82
+ export { EdsFeedback as eds_feedback };