@ebrains/react 0.2.0-alpha.0 → 0.4.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 (48) hide show
  1. package/{color-0ba8ed56.esm.js → color-bb472c37.esm.js} +2 -2
  2. package/color-primary-palette_6.entry.esm.js +106 -106
  3. package/correct-use-of-colors.entry.esm.js +57 -57
  4. package/{eds-alert_28.entry.esm.js → eds-accordion_33.entry.esm.js} +187 -45
  5. package/eds-card-project.entry.esm.js +1 -1
  6. package/eds-card-section.entry.esm.js +18 -8
  7. package/eds-card-tags.entry.esm.js +1 -1
  8. package/eds-card-tool.entry.esm.js +1 -1
  9. package/eds-card-wrapper.entry.esm.js +4 -4
  10. package/eds-code-block.entry.esm.js +55 -8
  11. package/eds-components-section.entry.esm.js +57 -24
  12. package/eds-docs-palettes.entry.esm.js +1 -1
  13. package/eds-docs-tokens.entry.esm.js +1 -1
  14. package/eds-login.entry.esm.js +4 -12
  15. package/eds-logo-variations.entry.esm.js +29 -0
  16. package/eds-matomo-notice.entry.esm.js +1 -1
  17. package/{eds-pagination.entry.esm.js → eds-pagination_2.entry.esm.js} +222 -7
  18. package/eds-progress-bar.entry.esm.js +36 -0
  19. package/eds-rating.entry.esm.js +7 -9
  20. package/eds-svg-repository.entry.esm.js +12 -3
  21. package/eds-tabs-content.entry.esm.js +5 -5
  22. package/eds-tabs.entry.esm.js +27 -8
  23. package/eds-timeline.entry.esm.js +131 -0
  24. package/eds-tooltip.entry.esm.js +13 -3
  25. package/eds-trl.entry.esm.js +68 -0
  26. package/incorrect-use-of-colors.entry.esm.js +11 -10
  27. package/index.esm.js +1 -1
  28. package/index.esm2.js +20 -37
  29. package/logo-space.entry.esm.js +4 -4
  30. package/logo-variations-horizontal_2.entry.esm.js +116 -0
  31. package/logo-wrong-usage.entry.esm.js +39 -39
  32. package/package.json +1 -1
  33. package/src/components.d.ts +1 -0
  34. package/token-list_3.entry.esm.js +5 -5
  35. package/token-ratios.entry.esm.js +3 -3
  36. package/token-spacing.entry.esm.js +26 -26
  37. package/token-typography.entry.esm.js +2 -2
  38. package/eds-accordion.entry.esm.js +0 -132
  39. package/eds-block-break.entry.esm.js +0 -22
  40. package/eds-breadcrumb.entry.esm.js +0 -169
  41. package/eds-footer.entry.esm.js +0 -110
  42. package/eds-frame.entry.esm.js +0 -117
  43. package/eds-fullscreen-menu.entry.esm.js +0 -143
  44. package/eds-modal.entry.esm.js +0 -114
  45. package/eds-social-networks.entry.esm.js +0 -74
  46. package/eds-table.entry.esm.js +0 -196
  47. package/logo-variations-horizontal.entry.esm.js +0 -50
  48. package/logo-variations-vertical.entry.esm.js +0 -53
@@ -1,7 +1,9 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './color-bb472c37.esm.js';
2
3
  import 'react';
3
4
  import 'react/jsx-runtime';
4
5
  import 'react-dom';
6
+ import './index-39c58238.esm.js';
5
7
 
6
8
  const edsPaginationCss = "ul,menu{list-style:none;margin:0;padding:0}.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)}.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)}.f-ui-02-light{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}.text-lightest{color:var(--grey-500)}.mb-28{margin-bottom:1.75rem}.w-full{width:100%}.w-20{width:1.25rem}.h-20{height:1.25rem}.h-28{height:1.75rem}.h-32{height:2rem}.h-36{height:2.25rem}.text-center{text-align:center}.flex{display:flex}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.mr-auto{margin-right:auto}.ml-auto{margin-left:auto}.\\!p-8{padding:0.5rem !important}.ml-4{margin-left:0.25rem}.mr-4{margin-right:0.25rem}.hidden{display:none}.gap-1{gap:0.0625rem}.py-4{padding-top:0.25rem;padding-bottom:0.25rem}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}@media (min-width: 900px){.lg\\:\\!pr-12{padding-right:0.75rem !important}.lg\\:flex{display:flex}}";
7
9
  const EdsPaginationStyle0 = edsPaginationCss;
@@ -29,14 +31,17 @@ const EdsPagination = class {
29
31
  componentDidLoad() {
30
32
  // Emit context for each eds-link element after the component is fully loaded
31
33
  const links = this.hostEl.shadowRoot.querySelectorAll('eds-link');
32
- if (links.length > 0) {
34
+ links.forEach(lnk => {
35
+ this.emitContext(lnk);
36
+ });
37
+ /*if (links.length > 0) {
33
38
  // Emit context for the first link
34
39
  this.emitContext(links[0]);
35
- // Emit context for the last link, if it's different from the first
40
+ // Emit context for the last link, if it's different from the first
36
41
  if (links.length > 1) {
37
42
  this.emitContext(links[links.length - 1]);
38
43
  }
39
- }
44
+ }*/
40
45
  }
41
46
  /**
42
47
  * Emits a custom event called `parentContext` for a given link element.
@@ -167,12 +172,12 @@ const EdsPagination = class {
167
172
  }
168
173
  render() {
169
174
  return h("div", {
170
- key: '2385b59b0a8b2bbdc40bfc5032b846c0ec20065e'
175
+ key: '584e0918b070eac25a7c4bfceff59b000b60076c'
171
176
  }, this.total > 0 && this.mode === 'default' && h("p", {
172
- key: '6aea281a4df247874f354469bbabae039424ad9e',
177
+ key: 'c688bd8e1f1d15904fc274454093f03213f59e38',
173
178
  class: "f-ui-03 text-lightest mb-28 w-full text-center"
174
179
  }, h("span", {
175
- key: 'eeb5f0ea902505c3853a30d51026cef9d9785e48',
180
+ key: 'c2472919bad41f76e26d518da27509e545ed9db6',
176
181
  class: "sr-only"
177
182
  }, "Results:"), this.pageResults()), this.mode === 'navigator' || this.lastPage && this.lastPage > 1 ? h("nav", {
178
183
  "aria-label": "Pagination"
@@ -254,5 +259,215 @@ const EdsPagination = class {
254
259
  }
255
260
  };
256
261
  EdsPagination.style = EdsPaginationStyle0;
262
+ const edsTableCss = "table{text-indent:0;border-color:inherit;border-collapse:collapse;}.container{width:calc(var(--container-width, 100%) - (2 * var(--breakout-container-outer-gutter, var(--container-outer-gutter, var(--outer-gutter, 0)))));margin-right:auto;margin-left:auto}.container>*{--container-outer-gutter:0;--breakout-container-outer-gutter:0}.pt-32{padding-top:2rem}.pt-40{padding-top:2.5rem}.pt-48{padding-top:3rem}.pb-28{padding-bottom:1.75rem}.pb-60{padding-bottom:3.75rem}.mt-20{margin-top:1.25rem}.mt-28{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.overflow-x-auto{overflow-x:auto}.mt-6{margin-top:0.375rem}.p-0{padding:0rem}.m-0{margin:0rem}.border{border-width:1px}.border-softer{border:1px solid rgba(0, 0, 0, .1)}.even\\:bg-inverse-softer:nth-child(even){background-color:rgba(255, 255, 255, .15)}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-8{padding-top:0.5rem;padding-bottom:0.5rem}.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)}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.text-center{text-align:center}.break-words{overflow-wrap:anywhere}";
263
+ const EdsTableStyle0 = edsTableCss;
264
+ const EdsTable = class {
265
+ constructor(hostRef) {
266
+ registerInstance(this, hostRef);
267
+ this.data = null;
268
+ this.endpoint = null;
269
+ this.config = {};
270
+ this.rowsPerPage = 10;
271
+ this.paginationEnabled = true;
272
+ this.searchEnabled = false;
273
+ this.hostWidth = undefined;
274
+ this.columnSize = 'default';
275
+ this.tableData = [];
276
+ this.columns = [];
277
+ this.currentPage = 1;
278
+ this.parsedConfig = {};
279
+ this.totalRows = 0;
280
+ this.searchQuery = '';
281
+ }
282
+ handleDataChange() {
283
+ this.parseData();
284
+ }
285
+ handleConfigChange() {
286
+ this.parseConfig();
287
+ }
288
+ componentWillLoad() {
289
+ this.parseConfig();
290
+ this.data ? this.parseData() : this.endpoint && this.fetchData();
291
+ }
292
+ componentDidLoad() {
293
+ this.setupPaginationListener();
294
+ }
295
+ componentDidUpdate() {
296
+ this.setupPaginationListener();
297
+ }
298
+ parseData() {
299
+ try {
300
+ this.tableData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data || [];
301
+ this.totalRows = this.tableData.length;
302
+ this.updateColumns();
303
+ this.currentPage = 1;
304
+ } catch (error) {
305
+ // eslint-disable-next-line
306
+ console.error('Failed to parse data:', error);
307
+ this.tableData = [];
308
+ }
309
+ }
310
+ parseConfig() {
311
+ try {
312
+ this.parsedConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;
313
+ } catch (error) {
314
+ // eslint-disable-next-line
315
+ console.error('Failed to parse config:', error);
316
+ this.parsedConfig = {};
317
+ }
318
+ }
319
+ async fetchData() {
320
+ try {
321
+ const response = await fetch(this.endpoint);
322
+ const data = await response.json();
323
+ this.data = data;
324
+ } catch (error) {
325
+ // eslint-disable-next-line
326
+ console.error('Failed to fetch data:', error);
327
+ }
328
+ }
329
+ setupPaginationListener() {
330
+ if (!this.shouldEnablePagination()) {
331
+ return;
332
+ }
333
+ const paginationEl = this.hostEl.shadowRoot.querySelector('eds-pagination');
334
+ if (paginationEl && !paginationEl.hasAttribute('listener-attached')) {
335
+ paginationEl.addEventListener('pageChange', event => this.handlePageChange(event.detail));
336
+ paginationEl.setAttribute('listener-attached', 'true');
337
+ }
338
+ }
339
+ getFilteredRows() {
340
+ return this.tableData.filter(row => Object.values(row).some(value => value.toString().toLowerCase().includes(this.searchQuery.toLowerCase())));
341
+ }
342
+ getPaginatedRows() {
343
+ const filteredRows = this.getFilteredRows();
344
+ this.totalRows = filteredRows.length;
345
+ const start = (this.currentPage - 1) * this.rowsPerPage;
346
+ return filteredRows.slice(start, start + this.rowsPerPage);
347
+ }
348
+ handlePageChange(newPage) {
349
+ this.currentPage = newPage;
350
+ sendAnalytics({
351
+ category: 'ui-component',
352
+ parentContext: null,
353
+ tag: `${this.hostEl.tagName.toLowerCase()}/eds-pagination`,
354
+ name: `${newPage}` || '',
355
+ action: 'page'
356
+ });
357
+ }
358
+ handleSearch(event) {
359
+ this.searchQuery = event.target.value;
360
+ this.currentPage = 1;
361
+ /*sendAnalytics({
362
+ category: 'ui-component',
363
+ parentContext: null,
364
+ tag: `${this.hostEl.tagName.toLowerCase()}/eds-input-field/search`,
365
+ name: `${this.searchQuery}` || '',
366
+ action: 'page'
367
+ });*/
368
+ }
369
+ renderCell(value, column) {
370
+ var _a;
371
+ const format = (_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.format;
372
+ return format === 'uppercase' ? value === null || value === void 0 ? void 0 : value.toString().toUpperCase() : format === 'svg' ? h("div", {
373
+ innerHTML: value
374
+ }) : format === 'bold' ? h("strong", null, value) : format === 'code' ? h("code", null, value) : value;
375
+ }
376
+ shouldEnablePagination() {
377
+ return this.paginationEnabled && this.totalRows > this.rowsPerPage;
378
+ }
379
+ updateColumns() {
380
+ this.columns = this.tableData.length > 0 ? Object.keys(this.tableData[0]) : [];
381
+ }
382
+ getVisibleColumnsCount() {
383
+ return this.columns.filter(column => {
384
+ var _a;
385
+ return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden);
386
+ }).length;
387
+ }
388
+ divisionFactor() {
389
+ let divisionFactor = 1;
390
+ if (this.columnSize === 'medium') {
391
+ divisionFactor = 2;
392
+ } else if (this.columnSize === 'large') {
393
+ divisionFactor = 4;
394
+ }
395
+ return divisionFactor;
396
+ }
397
+ render() {
398
+ // Get the paginated rows and calculate the last page.
399
+ const paginatedRows = this.getPaginatedRows();
400
+ const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
401
+ // Determine the number of visible columns (i.e., those not hidden via config)
402
+ const visibleColumnsCount = this.getVisibleColumnsCount();
403
+ /// Calculate container width based on the optional prop or parent's measured width.
404
+ const containerWidth = this.hostWidth && this.hostWidth.trim() !== '' ? Number(this.hostWidth) : this.hostEl.parentElement instanceof HTMLElement ? this.hostEl.parentElement.getBoundingClientRect().width : this.hostEl.getRootNode().host instanceof HTMLElement ? this.hostEl.getRootNode().host.getBoundingClientRect().width : 400;
405
+ const columnWidth = visibleColumnsCount > 0 ? Math.floor(containerWidth / visibleColumnsCount * this.divisionFactor()) : 100;
406
+ return h("div", {
407
+ key: '69fd87330d2049eeb91751c781c7aa753fa89883'
408
+ }, this.searchEnabled && h("div", {
409
+ key: '2f9680dd17b852b140fe560f7979e1dd58236c5a'
410
+ }, h("eds-input-field", {
411
+ key: 1,
412
+ name: "search",
413
+ "aria-label": "Search",
414
+ type: "text",
415
+ placeholder: "Search...",
416
+ // @ts-ignore
417
+ onInput: event => this.handleSearch(event)
418
+ })), h("div", {
419
+ key: 'd67edb24308e526a3e860a90250d58cf8bfee9c8',
420
+ class: "mt-20"
421
+ }, h("table", {
422
+ key: '9a2ef219110e459ac670a0f9c2e62c600f6b5acd',
423
+ class: "block overflow-x-auto mt-6 p-0"
424
+ }, h("thead", {
425
+ key: '81bae222447e805d06642dda19903d5bf99f2b01'
426
+ }, h("tr", {
427
+ key: '582d7ea661823b81ccdf3adc9769fe53cf56f04c',
428
+ class: "m-0 p-0 border border-softer even:bg-inverse-softer"
429
+ }, this.columns.map(column => {
430
+ var _a;
431
+ return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("th", {
432
+ class: "m-0 py-8 border border-softer f-ui-02 break-words",
433
+ style: {
434
+ minWidth: `${columnWidth}px`
435
+ }
436
+ }, column);
437
+ }))), h("tbody", {
438
+ key: 'ce7f87e665c394c5e9f2201ef2658e888ea07948'
439
+ }, paginatedRows.map(row => h("tr", {
440
+ class: "m-0 p-0 border border-softer even:bg-inverse-softer"
441
+ }, this.columns.map(column => {
442
+ var _a;
443
+ return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && h("td", {
444
+ class: "text-center border border-softer m-0 py-8 f-ui-2 break-words",
445
+ style: {
446
+ minWidth: `${columnWidth}px`
447
+ }
448
+ }, this.renderCell(row[column], column));
449
+ })))))), this.shouldEnablePagination() && h("div", {
450
+ key: '0fe6aed0d03c3aa491cd1bb17cd3bdc1e35372a0',
451
+ class: "mt-20"
452
+ }, h("eds-pagination", {
453
+ key: '5192f3f4b2ee93d5864d1afed3341a122c826d97',
454
+ currentPage: this.currentPage,
455
+ lastPage: lastPage,
456
+ perPage: this.rowsPerPage,
457
+ total: this.totalRows,
458
+ mode: "default"
459
+ })));
460
+ }
461
+ get hostEl() {
462
+ return getElement(this);
463
+ }
464
+ static get watchers() {
465
+ return {
466
+ "data": ["handleDataChange", "parseData"],
467
+ "config": ["handleConfigChange"]
468
+ };
469
+ }
470
+ };
471
+ EdsTable.style = EdsTableStyle0;
257
472
 
258
- export { EdsPagination as eds_pagination };
473
+ export { EdsPagination as eds_pagination, EdsTable as eds_table };
@@ -0,0 +1,36 @@
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 edsProgressBarCss = ".w-full{width:100%}.h-full{height:100%}.bg-default{background-color:var(--grey-200)}.rounded-lg{border-radius:16px}.h-24{height:1.5rem}.border{border-width:1px}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.overflow-hidden{overflow:hidden}.bg-accent{background-color:var(--green-500)}.bg-\\[\\#0034CB\\]{--tw-text-opacity:1;background-color:rgb(0 52 203 / var(--tw-text-opacity))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.duration-300{transition-duration:300ms}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.text-default{color:var(--black)}.text-inverse{color:var(--white)}.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)}";
7
+ const EdsProgressBarStyle0 = edsProgressBarCss;
8
+ const EdsProgressBar = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.value = 0;
12
+ }
13
+ /**
14
+ * Method to update the progress value externally.
15
+ * @param newValue The new progress value (0-100).
16
+ */
17
+ async updateValue(newValue) {
18
+ this.value = Math.min(100, Math.max(0, newValue)); // Clamp value between 0 and 100
19
+ }
20
+ render() {
21
+ const progressValue = this.value;
22
+ return h("div", {
23
+ key: '3131f56034a9fd72ca51e448bc2bcc6281669b25',
24
+ class: "outer w-full bg-default rounded-lg h-24 border border-softer overflow-hidden"
25
+ }, h("div", {
26
+ key: 'f1665a254f8dbe1ccb9e512e5f2e7c1e5ab88c07',
27
+ class: `inner h-full rounded-lg bg-accent transition-all duration-300 flex items-center justify-center text-default f-body-02`,
28
+ style: {
29
+ width: `${progressValue}%`
30
+ }
31
+ }, progressValue, "%"));
32
+ }
33
+ };
34
+ EdsProgressBar.style = EdsProgressBarStyle0;
35
+
36
+ export { EdsProgressBar as eds_progress_bar };
@@ -15,10 +15,8 @@ const EdsRating = class {
15
15
  this.selectedRating = 0;
16
16
  }
17
17
  /**
18
- * Parses the `links` prop into an array of link objects.
19
- * Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
20
- *
21
- * @returns {any[]} Array of parsed link objects
18
+ * Parses the `textMapping` prop into an array of strings.
19
+ * Returns an empty array if parsing fails.
22
20
  */
23
21
  get parsedMappings() {
24
22
  if (typeof this.textMapping === 'object') {
@@ -28,7 +26,7 @@ const EdsRating = class {
28
26
  return JSON.parse(this.textMapping);
29
27
  } catch (e) {
30
28
  // eslint-disable-next-line
31
- console.error('Error parsing links prop:', e);
29
+ console.error('Error parsing textMapping prop:', e);
32
30
  return [];
33
31
  }
34
32
  }
@@ -44,13 +42,13 @@ const EdsRating = class {
44
42
  }
45
43
  render() {
46
44
  return h("div", {
47
- key: '4ca6d5e0fb35d8ebce1acd5c1a7c6c857ba4f463',
45
+ key: 'c9147c2635f091d93f329d2b56a5fee8dce9126c',
48
46
  class: "relative w-full flex flex-col"
49
47
  }, h("span", {
50
- key: '784b77f84098b8d88cd3872004b0208a4437c51b',
48
+ key: '39a84bc3d9bcd4b729a35737c883eca7144d13ac',
51
49
  class: "f-body-01"
52
50
  }, this.label), h("div", {
53
- key: '6780db58d3c96046a99d383518cfe1db1e3f1c68',
51
+ key: '3cb84acf399cac0b23393c71df2f2b36aab4f43e',
54
52
  class: "stars"
55
53
  }, Array.from({
56
54
  length: this.stars
@@ -61,7 +59,7 @@ const EdsRating = class {
61
59
  },
62
60
  onClick: () => this.handleClick(index + 1)
63
61
  }, "\u2605"))), this.selectedRating > 0 && this.parsedMappings[this.selectedRating - 1] && h("span", {
64
- key: 'ce0eec3c29cf27bff86e3307a29a2c39c2167087',
62
+ key: '60605ec21b542825da0dad629fc1618d9cf63b25',
65
63
  class: "f-ui-04 text-lighter"
66
64
  }, this.parsedMappings[this.selectedRating - 1]));
67
65
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index.esm2.js';
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
2
  import { e as euSvg } from './eu-9ddde93a.esm.js';
3
3
  import { h as hLogoColor } from './logo-color-7f1fd803.esm.js';
4
4
  import { h as hLogoBlack, a as hLogoColorWhite, b as hLogoWhite, c as hLogoWhiteNoBg, v as vLogoColor, d as vLogoBlack, e as vLogoColorWhite, f as vLogoWhite, g as vLogoWhiteNoBg } from './logo-white-no-bg-f382f86f.esm.js';
@@ -291,6 +291,11 @@ const EdsSvgRepository = class {
291
291
  icon: svgContent // Pass SVG content as innerHTML
292
292
  }));
293
293
  }
294
+ get hostWidth() {
295
+ // Instead of using window.innerWidth, use the parent element's width.
296
+ const containerWidth = this.hostEl.parentElement ? this.hostEl.parentElement.offsetWidth : 400;
297
+ return containerWidth;
298
+ }
294
299
  render() {
295
300
  const svgData = this.getSvgData();
296
301
  // Define table configuration
@@ -303,14 +308,18 @@ const EdsSvgRepository = class {
303
308
  }
304
309
  };
305
310
  return h("eds-table", {
306
- key: 'd5b4cdb69826e22d716bf9bf4ff7fb9ab1f65044',
311
+ key: 'a1d4a1db6f0886a43513fc34707cdd6140ab685d',
307
312
  data: JSON.stringify(svgData),
308
313
  config: JSON.stringify(tableConfig),
309
314
  "rows-per-page": 10,
310
315
  "search-enabled": true,
311
- "pagination-enabled": true
316
+ "pagination-enabled": true,
317
+ "host-width": this.hostWidth
312
318
  });
313
319
  }
320
+ get hostEl() {
321
+ return getElement(this);
322
+ }
314
323
  };
315
324
 
316
325
  export { EdsSvgRepository as eds_svg_repository };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
- import { s as sendAnalytics } from './color-0ba8ed56.esm.js';
2
+ import { s as sendAnalytics } from './color-bb472c37.esm.js';
3
3
  import { c as cva } from './index-39c58238.esm.js';
4
4
  import 'react';
5
5
  import 'react/jsx-runtime';
@@ -108,13 +108,13 @@ const EdsTabsContent = class {
108
108
  }
109
109
  render() {
110
110
  return h("div", {
111
- key: 'b1bfb55fbdee21a10fcc600d4c3ce2842684c519',
111
+ key: '7bc954d9251bd15b5e3a49d5c74b83805f802b07',
112
112
  class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']"
113
113
  }, h("div", {
114
- key: '1d1aeb094b6c350355abec1bf74928561a1c0f2d',
114
+ key: '1bfda380604f1eae1cc5be147a5e3e6b537e0396',
115
115
  class: "scroller-x max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28"
116
116
  }, h("nav", {
117
- key: '5d5b04ddf5ddb60c2a9b49d19f4efe026cc2557d',
117
+ key: 'b2ed26b52fd629ec99b01c7dc8e612eae4f3886d',
118
118
  ref: el => this.tabContainer = el,
119
119
  class: "inline-flex",
120
120
  "aria-label": this.navAriaLabel
@@ -129,7 +129,7 @@ const EdsTabsContent = class {
129
129
  onClick: () => this.handleTabClick(index, tab.label)
130
130
  }));
131
131
  })), h("slot", {
132
- key: '58e9281516d0a4485ba0779f9b79c0fa5e989166'
132
+ key: '5072b877786a23358d540d6d242d5fbdb3c63d7f'
133
133
  })));
134
134
  }
135
135
  get el() {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
2
- import { s as sendAnalytics } from './color-0ba8ed56.esm.js';
2
+ import { s as sendAnalytics } from './color-bb472c37.esm.js';
3
3
  import { c as cva } from './index-39c58238.esm.js';
4
4
  import 'react';
5
5
  import 'react/jsx-runtime';
@@ -40,11 +40,30 @@ const EdsTabs = class {
40
40
  index: 0
41
41
  });
42
42
  }
43
+ /**
44
+ * Parses the `links` prop into an array of link objects.
45
+ * Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
46
+ *
47
+ * @returns {any[]} Array of parsed link objects
48
+ */
49
+ /**
50
+ * Parses the `links` prop into an array of link objects.
51
+ * Returns an empty array if parsing fails or if `links` is not a valid JSON string or object.
52
+ *
53
+ * @returns {any[]} Array of parsed link objects
54
+ */
43
55
  parseTabs() {
44
- try {
45
- this.parsedTabs = JSON.parse(this.tabs);
46
- } catch (error) {
47
- //console.error('Invalid JSON format for tabs:', error);
56
+ if (Array.isArray(this.tabs)) {
57
+ this.parsedTabs = this.tabs;
58
+ } else if (typeof this.tabs === 'string') {
59
+ try {
60
+ this.parsedTabs = JSON.parse(this.tabs);
61
+ } catch (e) {
62
+ //console.error('Error parsing tabs prop:', e);
63
+ this.parsedTabs = [];
64
+ }
65
+ } else {
66
+ // If the type is not an array or string, assume an empty array.
48
67
  this.parsedTabs = [];
49
68
  }
50
69
  }
@@ -100,14 +119,14 @@ const EdsTabs = class {
100
119
  }
101
120
  render() {
102
121
  return h("div", {
103
- key: '25078703609dbdaa2025013d0e266b169c880c50',
122
+ key: '540bb667084b36ae2151ec39ef6b54a9ac6a4c4a',
104
123
  id: `${this.id}`,
105
124
  class: "after:border-softest before:bg-gradient-y relative overflow-x-hidden before:absolute before:inset-x-0 before:bottom-0 before:h-12 before:opacity-5 before:content-[''] after:absolute after:inset-x-0 after:bottom-0 after:border-b-2 after:content-['']"
106
125
  }, h("div", {
107
- key: '8aa1b4ab1f15692c912db3ee39486a59d634c6a5',
126
+ key: 'f0266d39c943b82725ded757cce0b35fb85fa874',
108
127
  class: "scroller-x overflow-x-auto max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28"
109
128
  }, h("nav", {
110
- key: '33728823ca0f039e1037a691da90b295cbe3f3ac',
129
+ key: 'fcedf94e6f6c14635291d9c8e6d672efc8055433',
111
130
  ref: el => this.tabContainer = el,
112
131
  class: "inline-flex",
113
132
  "aria-label": this.navAriaLabel
@@ -0,0 +1,131 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import 'react';
3
+ import 'react/jsx-runtime';
4
+ import 'react-dom';
5
+
6
+ const EdsTimeline = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.events = undefined;
10
+ this.selectedEvent = null;
11
+ this.parsedEvents = [];
12
+ }
13
+ parseEvents(newValue) {
14
+ let parsed;
15
+ // If events is a string, try to parse it
16
+ if (typeof newValue === 'string') {
17
+ try {
18
+ parsed = JSON.parse(newValue);
19
+ } catch (e) {
20
+ // eslint-disable-next-line
21
+ console.error('Error parsing timeline events JSON', e);
22
+ parsed = [];
23
+ }
24
+ }
25
+ // If events is already an array, use it directly
26
+ else if (Array.isArray(newValue)) {
27
+ parsed = newValue;
28
+ }
29
+ // Otherwise, default to an empty array
30
+ else {
31
+ parsed = [];
32
+ }
33
+ // Map over the parsed events to ensure boolean conversion for "completed"
34
+ this.parsedEvents = Array.isArray(parsed) ? parsed.map(event => Object.assign(Object.assign({}, event), {
35
+ completed: event.completed === 'true' || event.completed === true
36
+ })) : [];
37
+ }
38
+ componentWillLoad() {
39
+ this.parseEvents(this.events);
40
+ }
41
+ componentDidLoad() {
42
+ const cards = this.el.querySelectorAll('eds-card-generic');
43
+ cards.forEach(card => {
44
+ this.emitContext(card);
45
+ });
46
+ }
47
+ emitContext(cardElement) {
48
+ const event = new CustomEvent('parentContext', {
49
+ detail: {
50
+ componentName: this.el.tagName.toLowerCase(),
51
+ identifier: null
52
+ }
53
+ });
54
+ cardElement.dispatchEvent(event);
55
+ }
56
+ handleEventClick(event) {
57
+ this.selectedEvent = event;
58
+ if (this.modalRef && typeof this.modalRef.open === 'function') {
59
+ this.modalRef.open();
60
+ }
61
+ }
62
+ render() {
63
+ return h("div", {
64
+ key: '6016cb89d3fe3250482b42d8a0bf500fe18cee5d',
65
+ class: "max-w-sidebar mx-auto px-4 py-8"
66
+ }, h("div", {
67
+ key: '994cc7af75950a0f09d108804efff796602aeb93',
68
+ class: "relative"
69
+ }, h("div", {
70
+ key: '77b15ae60feb380ea20c6466b49d0efd5d8f5180',
71
+ class: "absolute w-4 left-1/2 transform -translate-x-1/2 bg-strong h-full z-0"
72
+ }), h("div", {
73
+ key: '60bb384ce4eedd7bfc3b15a7a637e2b89318d619',
74
+ class: "space-y-16"
75
+ }, this.parsedEvents.map((event, index) => h("div", {
76
+ class: "relative flex"
77
+ }, h("div", {
78
+ class: `w-1/2 ${index % 2 === 0 ? 'pr-4' : ''}`
79
+ }, index % 2 === 0 && h("eds-card-generic", {
80
+ cardTitle: event.title,
81
+ url: "#",
82
+ description: event.description,
83
+ "heading-level": "h2",
84
+ tiny: true,
85
+ bg: !event.completed,
86
+ "with-hover": "false",
87
+ tags: JSON.stringify(event.completed ? [{
88
+ label: 'completed',
89
+ style: 'accent'
90
+ }] : [{
91
+ label: 'pending',
92
+ style: 'default'
93
+ }]),
94
+ onClick: () => this.handleEventClick(event)
95
+ })), h("div", {
96
+ class: "flex items-center justify-center relative"
97
+ }, event.completed ? h("div", {
98
+ class: "w-32 h-32 bg-accent rounded-full shadow flex items-center justify-center"
99
+ }) : h("div", {
100
+ class: "w-32 h-32 bg-strong rounded-full shadow flex items-center justify-center"
101
+ })), h("div", {
102
+ class: `w-1/2 ${index % 2 !== 0 ? 'pl-4' : ''}`
103
+ }, index % 2 !== 0 && h("eds-card-generic", {
104
+ cardTitle: event.title,
105
+ url: "#",
106
+ description: event.description,
107
+ "heading-level": "h2",
108
+ tiny: true,
109
+ bg: !event.completed,
110
+ "with-hover": "false",
111
+ tags: JSON.stringify(event.completed ? [{
112
+ label: 'completed',
113
+ style: 'accent'
114
+ }] : [{
115
+ label: 'pending',
116
+ style: 'default'
117
+ }]),
118
+ onClick: () => this.handleEventClick(event)
119
+ })))))));
120
+ }
121
+ get el() {
122
+ return getElement(this);
123
+ }
124
+ static get watchers() {
125
+ return {
126
+ "events": ["parseEvents"]
127
+ };
128
+ }
129
+ };
130
+
131
+ export { EdsTimeline as eds_timeline };
@@ -1,7 +1,9 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './color-bb472c37.esm.js';
2
3
  import 'react';
3
4
  import 'react/jsx-runtime';
4
5
  import 'react-dom';
6
+ import './index-39c58238.esm.js';
5
7
 
6
8
  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}";
7
9
  const EdsTooltipStyle0 = edsTooltipCss;
@@ -22,9 +24,17 @@ const EdsTooltip = class {
22
24
  * Show the tooltip and update its position.
23
25
  */
24
26
  async showTooltip() {
27
+ var _a;
25
28
  await this.updateTooltipPosition();
26
29
  this.isPositioned = true;
27
30
  this.isVisible = true;
31
+ sendAnalytics({
32
+ category: 'ui-component',
33
+ parentContext: null,
34
+ tag: this.el.tagName.toLowerCase(),
35
+ name: ((_a = this.content) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
36
+ action: 'hover'
37
+ });
28
38
  }
29
39
  /**
30
40
  * Hide the tooltip.
@@ -92,12 +102,12 @@ const EdsTooltip = class {
92
102
  }
93
103
  render() {
94
104
  return h("div", {
95
- key: '5edce5e2ca66ef992ad22604a5017e5ab02f846b',
105
+ key: '673ab0ee31378410f9c83bb5fd37b27d00a7b018',
96
106
  class: "relative"
97
107
  }, h("slot", {
98
- key: '74c9ef5978e023a45eb9c25c18f95f1875c19b13'
108
+ key: '0c0138dfdf9aafecc1e0e925c84d4b0ca957f82d'
99
109
  }), this.isVisible && this.isPositioned && this.content && h("div", {
100
- key: '4cc3ea40bd81308eb7685b5c1065e8bd30f99191',
110
+ key: '798d01cf631f2e5b3af9d9bb11a847041a6ee2ba',
101
111
  class: "rounded-xs bg-strongest text-inverse f-ui-03-light pointer-events-none absolute z-10 whitespace-nowrap p-6",
102
112
  role: "tooltip",
103
113
  style: {