@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.
Files changed (93) 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 +23 -17
  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 +11 -11
  9. package/eds-alert.entry.esm.js +3 -3
  10. package/eds-app-root.entry.esm.js +4 -4
  11. package/eds-avatar_28.entry.esm.js +3523 -0
  12. package/eds-breadcrumb.entry.esm.js +179 -0
  13. package/eds-card-desc_2.entry.esm.js +6 -7
  14. package/eds-card-generic.entry.esm.js +4 -4
  15. package/eds-card-project.entry.esm.js +130 -13
  16. package/eds-card-tags.entry.esm.js +1 -1
  17. package/eds-card-tool.entry.esm.js +5 -5
  18. package/eds-code-block.entry.esm.js +7 -7
  19. package/eds-cookies-preference.entry.esm.js +2 -2
  20. package/eds-feedback.entry.esm.js +12 -7
  21. package/eds-frame.entry.esm.js +6 -6
  22. package/eds-gauge.entry.esm.js +78 -0
  23. package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
  24. package/eds-icon-arrow-right.entry.esm.js +1 -1
  25. package/eds-icon-bluesky.entry.esm.js +1 -1
  26. package/eds-icon-bookmark.entry.esm.js +1 -1
  27. package/eds-icon-chevron-down.entry.esm.js +1 -1
  28. package/eds-icon-chevron-left.entry.esm.js +1 -1
  29. package/eds-icon-chevron-right.entry.esm.js +1 -1
  30. package/eds-icon-chevron-up.entry.esm.js +1 -1
  31. package/eds-icon-close.entry.esm.js +1 -1
  32. package/eds-icon-copy.entry.esm.js +1 -1
  33. package/eds-icon-eu.entry.esm.js +1 -1
  34. package/eds-icon-external.entry.esm.js +1 -1
  35. package/eds-icon-facebook.entry.esm.js +1 -1
  36. package/eds-icon-gitlab.entry.esm.js +1 -1
  37. package/eds-icon-linkedin.entry.esm.js +1 -1
  38. package/eds-icon-loader.entry.esm.js +1 -1
  39. package/eds-icon-mastodon.entry.esm.js +1 -1
  40. package/eds-icon-menu.entry.esm.js +1 -1
  41. package/eds-icon-minus.entry.esm.js +1 -1
  42. package/eds-icon-more.entry.esm.js +1 -1
  43. package/eds-icon-paper.entry.esm.js +1 -1
  44. package/eds-icon-plus.entry.esm.js +1 -1
  45. package/eds-icon-portal.entry.esm.js +1 -1
  46. package/eds-icon-private.entry.esm.js +1 -1
  47. package/eds-icon-public.entry.esm.js +1 -1
  48. package/eds-icon-search.entry.esm.js +1 -1
  49. package/eds-icon-star.entry.esm.js +1 -1
  50. package/eds-icon-success.entry.esm.js +1 -1
  51. package/eds-icon-thumbs-down.entry.esm.js +1 -1
  52. package/eds-icon-thumbs-up.entry.esm.js +1 -1
  53. package/eds-icon-tutorial.entry.esm.js +1 -1
  54. package/eds-icon-twitter.entry.esm.js +1 -1
  55. package/eds-icon-unknown.entry.esm.js +1 -1
  56. package/eds-icon-updown.entry.esm.js +1 -1
  57. package/eds-icon-user.entry.esm.js +1 -1
  58. package/eds-icon-youtube.entry.esm.js +1 -1
  59. package/eds-matomo-notice.entry.esm.js +5 -8
  60. package/eds-pie.entry.esm.js +131 -0
  61. package/eds-progress-bar.entry.esm.js +19 -8
  62. package/eds-rating.entry.esm.js +1 -1
  63. package/eds-section-core_2.entry.esm.js +5 -5
  64. package/eds-spinner.entry.esm.js +3 -3
  65. package/eds-splash-screen.entry.esm.js +87 -0
  66. package/eds-switch.entry.esm.js +21 -11
  67. package/eds-timeline.entry.esm.js +5 -5
  68. package/eds-toast-manager.entry.esm.js +33 -2
  69. package/eds-toast.entry.esm.js +4 -3
  70. package/eds-tooltip.entry.esm.js +12 -96
  71. package/eds-trl.entry.esm.js +2 -2
  72. package/incorrect-use-of-colors.entry.esm.js +11 -8
  73. package/index.esm.js +1 -1
  74. package/index.esm2.js +51 -308
  75. package/logo-space.entry.esm.js +9 -9
  76. package/logo-variations-horizontal_2.entry.esm.js +28 -28
  77. package/logo-variations-tabs.entry.esm.js +1 -1
  78. package/logo-wrong-usage.entry.esm.js +25 -25
  79. package/package.json +1 -1
  80. package/src/components.d.ts +2 -2
  81. package/src/generated/components.d.ts +1 -1
  82. package/svg-repository.entry.esm.js +2 -2
  83. package/token-list_3.entry.esm.js +5 -5
  84. package/token-ratios.entry.esm.js +3 -3
  85. package/token-spacing.entry.esm.js +93 -0
  86. package/token-typography.entry.esm.js +2 -2
  87. package/color-2554aad6.esm.js +0 -122
  88. package/eds-avatar_27.entry.esm.js +0 -332
  89. package/eds-card-wrapper.entry.esm.js +0 -39
  90. package/eds-login_2.entry.esm.js +0 -1828
  91. package/eds-pagination_2.entry.esm.js +0 -493
  92. package/eds-tabs.entry.esm.js +0 -143
  93. 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 };
@@ -11,7 +11,7 @@ const EdsIconArrowDiagonal = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '1c7405c12d1741c3dcfe117a04ea4ef5af200590',
14
+ key: 'd178d36fd0888a40da0873bfd8abe862770e06e9',
15
15
  class: this.class,
16
16
  innerHTML: arrowDiagonal
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconArrowRight = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '557b38fd6253b4a29c4cf2ec2b9f79355ceca358',
14
+ key: '4a2b33b86753acab8270a45c7b250603b128bc88',
15
15
  class: this.class,
16
16
  innerHTML: arrowRight
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconBluesky = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '4eba69bfec926b7a3490feee15b5947a8ab8a7b9',
14
+ key: '68917ac759cd684a6f3f3f67cb174d7291841070',
15
15
  class: this.class,
16
16
  innerHTML: bluesky
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconBookmark = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '5978393f7c5bdc6a1a23b85ded49503dacab3ff2',
14
+ key: '61dd6e752db1c28d082d80aba71267f4e971492d',
15
15
  class: this.class,
16
16
  innerHTML: bookmark
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronDown = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '6c98bd673a1562fda009e95e4e4562d1e7f0ccfd',
14
+ key: 'fa8022d27b91e909d4cd5522c6d0406be698a412',
15
15
  class: this.class,
16
16
  innerHTML: chevronDown
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronLeft = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '8a2d0acc90ce3515e059818d704d7ce427cdd56e',
14
+ key: 'c723d7f1bbd596063ae7e66123b8038af5320a54',
15
15
  class: this.class,
16
16
  innerHTML: chevronLeft
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronRight = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '8632a351612a4be6e47d4ff483717a2bda99a008',
14
+ key: 'f770cd9151077e8708c76d2082613c65a20c420f',
15
15
  class: this.class,
16
16
  innerHTML: chevronRight
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconChevronUp = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'cc552d780188b225d16fd18ec33a22b0fbbd9660',
14
+ key: '40d18a840277f2aba5d314a36fca5c1f8fd99cc6',
15
15
  class: this.class,
16
16
  innerHTML: chevronUp
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconClose = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '907eaa5d70add8ad62e9f071aacce359682969fe',
14
+ key: '8e4dedef0fe684fdd6078db8005661e49207da55',
15
15
  class: this.class,
16
16
  innerHTML: close
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconCopy = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'e31c2cd317654999670526469111fff23f66a6b4',
14
+ key: 'ff014a9761d8380a9fd8c97d3dd483b8d6fc786c',
15
15
  class: this.class,
16
16
  innerHTML: copy
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconEu = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '94c3dbf77824b2e51627b8e2a2de9b7cfb1f24e0',
14
+ key: '3888f0338df2496c334d95dbcb52a0e39906362d',
15
15
  class: this.class,
16
16
  innerHTML: euSvg
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconExternal = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '099d0118c7a4bfa2d8b5c21f45162080b31a2f7c',
14
+ key: '58d51f84a7b6326ef117a905f2c50d4fff6369c5',
15
15
  class: this.class,
16
16
  innerHTML: arrowDiagonal
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconFacebook = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '72eb0709ccbfc7830ab146f936a2587407feb0bb',
14
+ key: '3ea80799436c93b1c02ad177bd48910409aebf51',
15
15
  class: this.class,
16
16
  innerHTML: facebook
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconGitlab = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '280eb778fd7028ef60305eee614213f8a39a35f2',
14
+ key: 'a2f423ed9227463e27c0c698e6b4bba44cdc6263',
15
15
  class: this.class,
16
16
  innerHTML: gitlabBlack
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconLinkedin = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '5388b5cef5d643984157e0bed9263e83934dc7e3',
14
+ key: '88852ca054a7e637efc7fe5b01f343a9b1798e41',
15
15
  class: this.class,
16
16
  innerHTML: linkedin
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconLoader = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '808ce738f7812024a52b4875ae3d9070bc75c02d',
14
+ key: '283c8842f0f755074521fdcbae46969d87b86312',
15
15
  class: this.class,
16
16
  innerHTML: loader
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMastodon = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'b998a568e6f0f7811a4984817177c76842127298',
14
+ key: '5a5a90094c1f974dc7932654e97de04975e675bb',
15
15
  class: this.class,
16
16
  innerHTML: mastodon
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMenu = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'f9dcfa2e4c9cc938f3fd994ca3637c80f0495028',
14
+ key: 'dc06f1a54b9542cb2c0165fb3bdff960ecd81cc0',
15
15
  class: this.class,
16
16
  innerHTML: menu
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMinus = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '76fe78207051b486030fc1ef778d55ecfec2c3d2',
14
+ key: 'e76f56aaba4a67096e6314e61d53bc2512941552',
15
15
  class: this.class,
16
16
  innerHTML: minus
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconMore = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '546f5d7c76d57c07c34b6455cb1df4fea6c57302',
14
+ key: 'cb31d12146ff577195650b502f51005092404a30',
15
15
  class: this.class,
16
16
  innerHTML: more
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconPaper = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'e9baa8e9d467104fdeac600678b800787ef7d736',
14
+ key: 'abc728a23571f7cc24f6d9d1dc5c72c397983aa3',
15
15
  class: this.class,
16
16
  innerHTML: paper
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconPlus = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '7510fb2b948a83c216a375f2a84a16b10b38054e',
14
+ key: '35d8e069fbb1bdb01ae6f068c28edd19d299c7c3',
15
15
  class: this.class,
16
16
  innerHTML: plus
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconPortal = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'c9f384bf790dd2eef9b84e757403106209f05c04',
14
+ key: '9383784da3e52d22395288f8eba5b6f4ee826aa5',
15
15
  class: this.class,
16
16
  innerHTML: portal
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconPrivate = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'd03d51d5aee837edab83aa71cf82fd415a8c71c3',
14
+ key: '9466d1ce37e58f512579d63ec5049cc58e8b9836',
15
15
  class: this.class,
16
16
  innerHTML: privat
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconPublic = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '94970e6d7f414cde04a3dae305f3dda43f477e55',
14
+ key: 'e4815b72c160ae98d66dbfa877f82f1d2f7c50b3',
15
15
  class: this.class,
16
16
  innerHTML: pub
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconSearch = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '2c35a35b31a988ffa690816a8699d2aac43dd916',
14
+ key: '6a35ea0c0de4916a867f760eb058a3cbb1bc218e',
15
15
  class: this.class,
16
16
  innerHTML: search
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconStar = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'dc06f1a54b9542cb2c0165fb3bdff960ecd81cc0',
14
+ key: 'f7ebc68658fcf8c0df627871481cce90cd7800fb',
15
15
  class: this.class,
16
16
  innerHTML: star
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconSuccess = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '8b5d4cfeedf6d7e9bea48d7ba892527d484c858d',
14
+ key: 'd78b06493302958306d408d823f4a7703d9b9adc',
15
15
  class: this.class,
16
16
  innerHTML: success
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconThumbsDown = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'c60c3e5180cd900ce290448563fc476264ba1fe5',
14
+ key: '84e6d8cff80004a650c6d0fc6b9702cf1ca85ba2',
15
15
  class: this.class,
16
16
  innerHTML: thumbsDown
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconThumbsUp = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'eee2fdd0cdf1e9735e90f34c6bb090f3df67eb49',
14
+ key: '5f5198ad92684dc173d603499b485e7d0ca8811b',
15
15
  class: this.class,
16
16
  innerHTML: thumbsUp
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconTutorial = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '0e47e2af80487a28c96e8830dda102c23bff9e5c',
14
+ key: '8be08569144889cca6f801cdd31e4cc31fdc11e5',
15
15
  class: this.class,
16
16
  innerHTML: tutorial
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconTwitter = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '1a7ad8d7cbef70822ebda2f152d8b537df1eaf27',
14
+ key: 'c2ee643b5da517a53bd97ec6263161927ad229a7',
15
15
  class: this.class,
16
16
  innerHTML: twitter
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconUnknown = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'a9145c4e133746c314a1ee34d36a5f19f3686565',
14
+ key: '449cd62f697607ebb17bed06835ee9529d7e8999',
15
15
  class: this.class,
16
16
  innerHTML: unknown
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconUpdown = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: 'b97da1b406718c7611d1e17d7a9c6b4670600740',
14
+ key: '5b0e914205c9f3fb5e216e0ccb16e350a4449c02',
15
15
  class: this.class,
16
16
  innerHTML: upDonw
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconUser = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '4322703c9e449819dc30946118893d365fa20124',
14
+ key: '297e73664320032b2f78dd3c43aa0852545c0723',
15
15
  class: this.class,
16
16
  innerHTML: user
17
17
  });
@@ -11,7 +11,7 @@ const EdsIconYoutube = class {
11
11
  }
12
12
  render() {
13
13
  return h("span", {
14
- key: '2236f8f5ede15d7eef54f2fd4fe6ca81c996166f',
14
+ key: '0a6abd6b62e24c07b4338f0f1f6febbec876791f',
15
15
  class: this.class,
16
16
  innerHTML: youtube
17
17
  });
@@ -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-44b1416b.esm.js';
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 };