@ebrains/react 0.0.1-alpha.0 → 0.2.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 (108) hide show
  1. package/README.md +4 -48
  2. package/arrow-diagonal-black-8f0494c3.esm.js +3 -0
  3. package/arrow-right-9322ba8a.esm.js +5 -0
  4. package/bluesky-cc5edd2d.esm.js +14 -0
  5. package/chevron-down-6144c823.esm.js +12 -0
  6. package/chevron-left-ca6c66e1.esm.js +11 -0
  7. package/chevron-right-b88ed2d4.esm.js +5 -0
  8. package/chevron-up-c66bd477.esm.js +12 -0
  9. package/close-87fc0d63.esm.js +5 -0
  10. package/color-0ba8ed56.esm.js +423 -0
  11. package/color-primary-palette_6.entry.esm.js +756 -0
  12. package/copy-03b72cb6.esm.js +5 -0
  13. package/correct-use-of-colors.entry.esm.js +243 -0
  14. package/eds-accordion.entry.esm.js +132 -0
  15. package/eds-alert_28.entry.esm.js +227 -0
  16. package/eds-block-break.entry.esm.js +22 -0
  17. package/eds-breadcrumb.entry.esm.js +169 -0
  18. package/eds-card-project.entry.esm.js +92 -0
  19. package/eds-card-section.entry.esm.js +60 -0
  20. package/eds-card-tags.entry.esm.js +27 -0
  21. package/eds-card-tool.entry.esm.js +106 -0
  22. package/eds-card-wrapper.entry.esm.js +39 -0
  23. package/eds-code-block.entry.esm.js +2243 -0
  24. package/eds-components-section.entry.esm.js +113 -0
  25. package/eds-docs-palettes.entry.esm.js +29 -0
  26. package/eds-docs-tokens.entry.esm.js +45 -0
  27. package/eds-footer.entry.esm.js +110 -0
  28. package/eds-frame.entry.esm.js +117 -0
  29. package/eds-fullscreen-menu.entry.esm.js +143 -0
  30. package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
  31. package/eds-icon-arrow-right.entry.esm.js +21 -0
  32. package/eds-icon-bluesky.entry.esm.js +21 -0
  33. package/eds-icon-chevron-down.entry.esm.js +21 -0
  34. package/eds-icon-chevron-left.entry.esm.js +21 -0
  35. package/eds-icon-chevron-right.entry.esm.js +21 -0
  36. package/eds-icon-chevron-up.entry.esm.js +21 -0
  37. package/eds-icon-close.entry.esm.js +21 -0
  38. package/eds-icon-copy.entry.esm.js +21 -0
  39. package/eds-icon-eu.entry.esm.js +21 -0
  40. package/eds-icon-facebook.entry.esm.js +21 -0
  41. package/eds-icon-gitlab.entry.esm.js +21 -0
  42. package/eds-icon-linkedin.entry.esm.js +21 -0
  43. package/eds-icon-loader.entry.esm.js +21 -0
  44. package/eds-icon-mastodon.entry.esm.js +21 -0
  45. package/eds-icon-menu.entry.esm.js +21 -0
  46. package/eds-icon-more.entry.esm.js +21 -0
  47. package/eds-icon-search.entry.esm.js +21 -0
  48. package/eds-icon-success.entry.esm.js +21 -0
  49. package/eds-icon-twitter.entry.esm.js +21 -0
  50. package/eds-icon-user.entry.esm.js +21 -0
  51. package/eds-icon-youtube.entry.esm.js +21 -0
  52. package/eds-login.entry.esm.js +84 -0
  53. package/eds-matomo-notice.entry.esm.js +129 -0
  54. package/eds-modal.entry.esm.js +114 -0
  55. package/eds-navigator.entry.esm.js +72 -0
  56. package/eds-pagination.entry.esm.js +258 -0
  57. package/eds-rating.entry.esm.js +71 -0
  58. package/eds-section-core_2.entry.esm.js +69 -0
  59. package/eds-social-networks.entry.esm.js +74 -0
  60. package/eds-svg-repository.entry.esm.js +316 -0
  61. package/eds-tab.entry.esm.js +41 -0
  62. package/eds-table.entry.esm.js +196 -0
  63. package/eds-tabs-content.entry.esm.js +145 -0
  64. package/eds-tabs.entry.esm.js +136 -0
  65. package/eds-tooltip.entry.esm.js +116 -0
  66. package/eu-9ddde93a.esm.js +30 -0
  67. package/facebook-9cb5c17f.esm.js +14 -0
  68. package/incorrect-use-of-colors.entry.esm.js +70 -0
  69. package/index-39c58238.esm.js +58 -0
  70. package/index.esm.js +3 -2668
  71. package/index.esm2.js +4783 -0
  72. package/keycloak-13893af6.esm.js +1594 -0
  73. package/linkedin-e8650abb.esm.js +28 -0
  74. package/loader-c9628637.esm.js +30 -0
  75. package/logo-color-7f1fd803.esm.js +115 -0
  76. package/logo-color-margins-ff8ce71b.esm.js +118 -0
  77. package/logo-space.entry.esm.js +32 -0
  78. package/logo-variations-horizontal.entry.esm.js +50 -0
  79. package/logo-variations-vertical.entry.esm.js +53 -0
  80. package/logo-white-no-bg-f382f86f.esm.js +1021 -0
  81. package/logo-wrong-usage.entry.esm.js +137 -0
  82. package/mastodon-3703ec61.esm.js +14 -0
  83. package/menu-340ea948.esm.js +11 -0
  84. package/mono-53f70232.esm.js +11 -0
  85. package/more-4449d549.esm.js +13 -0
  86. package/package.json +1 -1
  87. package/search-fbcd79c2.esm.js +12 -0
  88. package/src/components.d.ts +38 -0
  89. package/src/index.d.ts +1 -1
  90. package/src/react-component-lib/attachProps.d.ts +16 -0
  91. package/src/react-component-lib/case.d.ts +2 -0
  92. package/src/react-component-lib/createComponent.d.ts +10 -0
  93. package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
  94. package/src/react-component-lib/dev.d.ts +2 -0
  95. package/src/react-component-lib/index.d.ts +2 -0
  96. package/src/react-component-lib/interfaces.d.ts +29 -0
  97. package/src/react-component-lib/utils/attachProps.d.ts +16 -0
  98. package/src/react-component-lib/utils/case.d.ts +2 -0
  99. package/src/react-component-lib/utils/index.d.ts +10 -0
  100. package/success-443809da.esm.js +18 -0
  101. package/toastManager-d9eee791.esm.js +34 -0
  102. package/token-list_3.entry.esm.js +385 -0
  103. package/token-ratios.entry.esm.js +49 -0
  104. package/token-spacing.entry.esm.js +93 -0
  105. package/token-typography.entry.esm.js +264 -0
  106. package/twitter-ac21b505.esm.js +14 -0
  107. package/user-71ebdc15.esm.js +16 -0
  108. package/youtube-efbfbdc4.esm.js +14 -0
@@ -0,0 +1,145 @@
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';
3
+ import { c as cva } from './index-39c58238.esm.js';
4
+ import 'react';
5
+ import 'react/jsx-runtime';
6
+ import 'react-dom';
7
+
8
+ const EdsTabsContent = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.tabContentChange = createEvent(this, "tabContentChange", 7);
12
+ // cva configuration
13
+ this.tabCva = cva(['relative px-16 py-12', 'f-ui-03 whitespace-nowrap', 'effect-color', 'focus-visible:text-default hover:text-default', 'border-2', "after:content-[''] after:absolute after:inset-0 after:rounded-t-lg after:border-3 after:border-accent after:opacity-0", 'outline-none focus:outline-none focus-visible:outline-none focus-visible:after:opacity-100'], {
14
+ variants: {
15
+ position: {
16
+ left: 'rounded-tl-lg border-r-0 pr-28 -mr-16 after:right-16',
17
+ right: 'rounded-tr-lg border-l-0 pl-28 -ml-16 after:left-16',
18
+ center: '',
19
+ first: 'rounded-t-lg'
20
+ },
21
+ active: {
22
+ false: 'text-lighter bg-dark hover:bg-darker border-softest',
23
+ true: ['bg-default text-default z-99', 'rounded-t-lg', "before:content-[''] before:absolute before:-bottom-2 z-1 before:inset-x-0 before:h-3 before:bg-default", 'border-[#d2d2d2]']
24
+ }
25
+ }
26
+ });
27
+ this.navAriaLabel = 'Tabs';
28
+ this.tabs = undefined;
29
+ this.parsedTabs = [];
30
+ this.activeIndex = -1;
31
+ }
32
+ componentWillLoad() {
33
+ this.parseTabs();
34
+ this.setActiveIndex();
35
+ }
36
+ parseTabs() {
37
+ try {
38
+ this.parsedTabs = JSON.parse(this.tabs);
39
+ } catch (error) {
40
+ //console.error('Invalid JSON format for tabs:', error);
41
+ this.parsedTabs = [];
42
+ }
43
+ }
44
+ componentDidLoad() {
45
+ this.initializeTabContentVisibility();
46
+ this.el.addEventListener('tabContentChange', e => {
47
+ this.updateTabContentVisibility(e.detail.index);
48
+ });
49
+ this.scrollToActiveTab();
50
+ }
51
+ initializeTabContentVisibility() {
52
+ const allContent = this.el.querySelectorAll('.tab-content');
53
+ allContent.forEach((content, index) => {
54
+ content.setAttribute('style', `display: ${index === this.activeIndex ? 'block' : 'none'}`);
55
+ });
56
+ }
57
+ updateTabContentVisibility(index) {
58
+ const allContent = this.el.querySelectorAll('.tab-content');
59
+ allContent.forEach((content, contentIndex) => {
60
+ content.setAttribute('style', `display: ${contentIndex === index ? 'block' : 'none'}`);
61
+ });
62
+ }
63
+ setActiveIndex() {
64
+ this.activeIndex = this.parsedTabs.findIndex(tab => tab.active);
65
+ }
66
+ scrollToActiveTab() {
67
+ var _a;
68
+ const activeTab = (_a = this.tabContainer) === null || _a === void 0 ? void 0 : _a.querySelector('[data-tab-active]');
69
+ if (activeTab) {
70
+ setTimeout(() => {
71
+ activeTab.scrollIntoView({
72
+ inline: 'center',
73
+ block: 'nearest'
74
+ });
75
+ }, 316);
76
+ }
77
+ }
78
+ getTabOptions(active, index) {
79
+ const position = active ? 'center' : this.activeIndex === -1 && index === 0 ? 'first' : index < this.activeIndex ? 'left' : 'right';
80
+ return Object.assign({
81
+ class: this.tabCva({
82
+ active,
83
+ position
84
+ }),
85
+ style: {
86
+ zIndex: `${active ? this.parsedTabs.length + 99 : position === 'left' ? index : this.parsedTabs.length + 1 - index}`
87
+ }
88
+ }, active ? {
89
+ 'data-tab-active': 'true'
90
+ } : {});
91
+ }
92
+ handleTabClick(index, tabLabel) {
93
+ // Update the active index and set all tabs' active state accordingly
94
+ this.activeIndex = index;
95
+ this.parsedTabs = this.parsedTabs.map((tab, tabIndex) => Object.assign(Object.assign({}, tab), {
96
+ active: tabIndex === index
97
+ }));
98
+ this.tabContentChange.emit({
99
+ index: index,
100
+ name: tabLabel
101
+ });
102
+ sendAnalytics({
103
+ category: 'ui-component',
104
+ tag: this.el.tagName.toLowerCase(),
105
+ name: (tabLabel === null || tabLabel === void 0 ? void 0 : tabLabel.toLowerCase()) || '',
106
+ action: 'click'
107
+ });
108
+ }
109
+ render() {
110
+ return h("div", {
111
+ key: 'b1bfb55fbdee21a10fcc600d4c3ce2842684c519',
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
+ }, h("div", {
114
+ key: '1d1aeb094b6c350355abec1bf74928561a1c0f2d',
115
+ class: "scroller-x max-w-xxxl xxxl:px-0 relative z-[1] mx-auto px-16 pt-8 lg:px-28"
116
+ }, h("nav", {
117
+ key: '5d5b04ddf5ddb60c2a9b49d19f4efe026cc2557d',
118
+ ref: el => this.tabContainer = el,
119
+ class: "inline-flex",
120
+ "aria-label": this.navAriaLabel
121
+ }, this.parsedTabs.map((tab, index) => {
122
+ //const TabComponent = tab.active ? 'span' : 'a';
123
+ const tabProps = this.getTabOptions(tab.active, index);
124
+ return h("eds-tab", Object.assign({}, tabProps, {
125
+ label: tab.label,
126
+ url: tab.url,
127
+ active: index === this.activeIndex,
128
+ ariaLabel: tab.ariaLabel,
129
+ onClick: () => this.handleTabClick(index, tab.label)
130
+ }));
131
+ })), h("slot", {
132
+ key: '58e9281516d0a4485ba0779f9b79c0fa5e989166'
133
+ })));
134
+ }
135
+ get el() {
136
+ return getElement(this);
137
+ }
138
+ static get watchers() {
139
+ return {
140
+ "tabs": ["parseTabs"]
141
+ };
142
+ }
143
+ };
144
+
145
+ export { EdsTabsContent as eds_tabs_content };
@@ -0,0 +1,136 @@
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';
3
+ import { c as cva } from './index-39c58238.esm.js';
4
+ import 'react';
5
+ import 'react/jsx-runtime';
6
+ import 'react-dom';
7
+
8
+ const edsTabsCss = "";
9
+ const EdsTabsStyle0 = edsTabsCss;
10
+ const EdsTabs = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.tabChange = createEvent(this, "tabChange", 7);
14
+ // cva configuration
15
+ this.tabCva = cva(['relative px-16 py-12', 'f-ui-03 whitespace-nowrap', 'effect-color', 'focus-visible:text-default hover:text-default', 'border-2', "after:content-[''] after:absolute after:inset-0 after:rounded-t-lg after:border-3 after:border-accent after:opacity-0", 'outline-none focus:outline-none focus-visible:outline-none focus-visible:after:opacity-100'], {
16
+ variants: {
17
+ position: {
18
+ left: 'rounded-tl-lg border-r-0 pr-28 -mr-16 after:right-16',
19
+ right: 'rounded-tr-lg border-l-0 pl-28 -ml-16 after:left-16',
20
+ center: '',
21
+ first: 'rounded-t-lg'
22
+ },
23
+ active: {
24
+ false: 'text-lighter bg-dark hover:bg-darker border-softest',
25
+ true: ['bg-default text-default z-99', 'rounded-t-lg', "before:content-[''] before:absolute before:-bottom-2 z-1 before:inset-x-0 before:h-3 before:bg-default", 'border-[#d2d2d2]']
26
+ }
27
+ }
28
+ });
29
+ this.id = undefined;
30
+ this.navAriaLabel = 'Tabs';
31
+ this.tabs = undefined;
32
+ this.parsedTabs = [];
33
+ this.activeIndex = -1;
34
+ }
35
+ componentWillLoad() {
36
+ this.parseTabs();
37
+ this.setActiveIndex();
38
+ this.tabChange.emit({
39
+ tabId: this.id,
40
+ index: 0
41
+ });
42
+ }
43
+ parseTabs() {
44
+ try {
45
+ this.parsedTabs = JSON.parse(this.tabs);
46
+ } catch (error) {
47
+ //console.error('Invalid JSON format for tabs:', error);
48
+ this.parsedTabs = [];
49
+ }
50
+ }
51
+ componentDidLoad() {
52
+ this.scrollToActiveTab();
53
+ }
54
+ setActiveIndex() {
55
+ this.activeIndex = this.parsedTabs.findIndex(tab => tab.active);
56
+ }
57
+ scrollToActiveTab() {
58
+ var _a;
59
+ const activeTab = (_a = this.tabContainer) === null || _a === void 0 ? void 0 : _a.querySelector('[data-tab-active]');
60
+ if (activeTab) {
61
+ setTimeout(() => {
62
+ activeTab.scrollIntoView({
63
+ inline: 'center',
64
+ block: 'nearest'
65
+ });
66
+ }, 316);
67
+ }
68
+ }
69
+ getTabOptions(active, index) {
70
+ const position = active ? 'center' : this.activeIndex === -1 && index === 0 ? 'first' : index < this.activeIndex ? 'left' : 'right';
71
+ return Object.assign({
72
+ class: this.tabCva({
73
+ active,
74
+ position
75
+ }),
76
+ style: {
77
+ zIndex: `${active ? this.parsedTabs.length + 99 : position === 'left' ? index : this.parsedTabs.length + 1 - index}`
78
+ }
79
+ }, active ? {
80
+ 'data-tab-active': 'true'
81
+ } : {});
82
+ }
83
+ handleTabClick(index, tabLabel) {
84
+ // Update the active index and set all tabs' active state accordingly
85
+ this.activeIndex = index;
86
+ this.parsedTabs = this.parsedTabs.map((tab, tabIndex) => Object.assign(Object.assign({}, tab), {
87
+ active: tabIndex === index
88
+ }));
89
+ this.tabChange.emit({
90
+ tabId: this.id,
91
+ index: index,
92
+ name: tabLabel
93
+ });
94
+ sendAnalytics({
95
+ category: 'ui-component',
96
+ tag: this.el.tagName.toLowerCase(),
97
+ name: (tabLabel === null || tabLabel === void 0 ? void 0 : tabLabel.toLowerCase()) || '',
98
+ action: 'click'
99
+ });
100
+ }
101
+ render() {
102
+ return h("div", {
103
+ key: '25078703609dbdaa2025013d0e266b169c880c50',
104
+ id: `${this.id}`,
105
+ 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
+ }, h("div", {
107
+ key: '8aa1b4ab1f15692c912db3ee39486a59d634c6a5',
108
+ 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
+ }, h("nav", {
110
+ key: '33728823ca0f039e1037a691da90b295cbe3f3ac',
111
+ ref: el => this.tabContainer = el,
112
+ class: "inline-flex",
113
+ "aria-label": this.navAriaLabel
114
+ }, this.parsedTabs.map((tab, index) => {
115
+ //const TabComponent = tab.active ? 'span' : 'a';
116
+ const tabProps = this.getTabOptions(tab.active, index);
117
+ return h("eds-tab", Object.assign({}, tabProps, {
118
+ label: tab.label || tab.ariaLabel,
119
+ url: tab.url,
120
+ active: index === this.activeIndex,
121
+ onClick: () => this.handleTabClick(index, tab.label)
122
+ }));
123
+ }))));
124
+ }
125
+ get el() {
126
+ return getElement(this);
127
+ }
128
+ static get watchers() {
129
+ return {
130
+ "tabs": ["parseTabs"]
131
+ };
132
+ }
133
+ };
134
+ EdsTabs.style = EdsTabsStyle0;
135
+
136
+ export { EdsTabs as eds_tabs };
@@ -0,0 +1,116 @@
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 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
+ const EdsTooltipStyle0 = edsTooltipCss;
8
+ const EdsTooltip = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.content = undefined;
12
+ this.position = 'above';
13
+ this.isVisible = false;
14
+ this.isPositioned = false;
15
+ this.tooltipStyle = {
16
+ top: '0px',
17
+ left: '0px',
18
+ transform: ''
19
+ };
20
+ }
21
+ /**
22
+ * Show the tooltip and update its position.
23
+ */
24
+ async showTooltip() {
25
+ await this.updateTooltipPosition();
26
+ this.isPositioned = true;
27
+ this.isVisible = true;
28
+ }
29
+ /**
30
+ * Hide the tooltip.
31
+ */
32
+ hideTooltip() {
33
+ this.isVisible = false;
34
+ this.isPositioned = false; // Reset positioning when hiding
35
+ }
36
+ /**
37
+ * Hide the tooltip when the `Escape` key is pressed.
38
+ */
39
+ handleKeyPress(event) {
40
+ if (event.key === 'Escape') {
41
+ this.isVisible = false;
42
+ this.isPositioned = false; // Reset positioning when hiding
43
+ }
44
+ }
45
+ /**
46
+ * Update the tooltip's position dynamically based on the slotted element's dimensions and position.
47
+ */
48
+ updateTooltipPosition() {
49
+ var _a, _b;
50
+ const slotElement = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
51
+ if (!slotElement) {
52
+ return;
53
+ }
54
+ const assignedNodes = (slotElement === null || slotElement === void 0 ? void 0 : slotElement.assignedNodes({
55
+ flatten: true
56
+ })) || [];
57
+ const targetElement = assignedNodes.find(node => node instanceof HTMLElement);
58
+ if (targetElement) {
59
+ const targetRect = targetElement.getBoundingClientRect();
60
+ const tooltipElement = (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[role="tooltip"]');
61
+ if (tooltipElement) {
62
+ const tooltipWidth = tooltipElement.offsetWidth;
63
+ const tooltipHeight = tooltipElement.offsetHeight;
64
+ // Calculate position based on the preferred `position` prop
65
+ let top = 0;
66
+ let left = 0;
67
+ switch (this.position) {
68
+ case 'above':
69
+ top = window.scrollY - tooltipHeight - 8; // Above with offset
70
+ left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
71
+ break;
72
+ case 'below':
73
+ top = tooltipHeight - window.scrollY + 18; // Below with offset
74
+ left = targetRect.left + targetRect.width / 2 - tooltipWidth / 2; // Centered horizontally
75
+ break;
76
+ /*case 'left':
77
+ top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
78
+ left = targetRect.left - tooltipWidth - 8; // To the left with offset
79
+ break;
80
+ case 'right':
81
+ top = targetRect.top - window.scrollY + targetRect.height / 2 - tooltipHeight / 2; // Centered vertically
82
+ left = targetRect.right + 8; // To the right with offset
83
+ break;*/
84
+ }
85
+ this.tooltipStyle = {
86
+ top: `${top}px`,
87
+ left: `${left}px`,
88
+ transform: 'translateX(0)' // No additional horizontal adjustment needed
89
+ };
90
+ }
91
+ }
92
+ }
93
+ render() {
94
+ return h("div", {
95
+ key: '5edce5e2ca66ef992ad22604a5017e5ab02f846b',
96
+ class: "relative"
97
+ }, h("slot", {
98
+ key: '74c9ef5978e023a45eb9c25c18f95f1875c19b13'
99
+ }), this.isVisible && this.isPositioned && this.content && h("div", {
100
+ key: '4cc3ea40bd81308eb7685b5c1065e8bd30f99191',
101
+ class: "rounded-xs bg-strongest text-inverse f-ui-03-light pointer-events-none absolute z-10 whitespace-nowrap p-6",
102
+ role: "tooltip",
103
+ style: {
104
+ top: this.tooltipStyle.top,
105
+ left: this.tooltipStyle.left,
106
+ transform: this.tooltipStyle.transform
107
+ }
108
+ }, this.content));
109
+ }
110
+ get el() {
111
+ return getElement(this);
112
+ }
113
+ };
114
+ EdsTooltip.style = EdsTooltipStyle0;
115
+
116
+ export { EdsTooltip as eds_tooltip };
@@ -0,0 +1,30 @@
1
+ const euSvg = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="flag-icons-eu" viewBox="0 0 640 480">
2
+ <defs>
3
+ <g id="d">
4
+ <g id="b">
5
+ <path id="a" d="m0-1-.3 1 .5.1z"/>
6
+ <use xlink:href="#a" transform="scale(-1 1)"/>
7
+ </g>
8
+ <g id="c">
9
+ <use xlink:href="#b" transform="rotate(72)"/>
10
+ <use xlink:href="#b" transform="rotate(144)"/>
11
+ </g>
12
+ <use xlink:href="#c" transform="scale(-1 1)"/>
13
+ </g>
14
+ </defs>
15
+ <path fill="#039" d="M0 0h640v480H0z"/>
16
+ <g fill="#fc0" transform="translate(320 242.3) scale(23.7037)">
17
+ <use xlink:href="#d" width="100%" height="100%" y="-6"/>
18
+ <use xlink:href="#d" width="100%" height="100%" y="6"/>
19
+ <g id="e">
20
+ <use xlink:href="#d" width="100%" height="100%" x="-6"/>
21
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(-144 -2.3 -2.1)"/>
22
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(144 -2.1 -2.3)"/>
23
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(72 -4.7 -2)"/>
24
+ <use xlink:href="#d" width="100%" height="100%" transform="rotate(72 -5 .5)"/>
25
+ </g>
26
+ <use xlink:href="#e" width="100%" height="100%" transform="scale(-1 1)"/>
27
+ </g>
28
+ </svg>`;
29
+
30
+ export { euSvg as e };
@@ -0,0 +1,14 @@
1
+ const facebook = ` <svg
2
+ width="20"
3
+ height="20"
4
+ viewBox="0 0 20 20"
5
+ fill="none"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ >
8
+ <path
9
+ d="M10.9481 19.9556C16.0263 19.4781 20 15.2031 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 14.7129 3.26027 18.6643 7.64847 19.722V12.0931H6V9.36828H7.64847V7.73228C7.64847 5.50935 8.5793 4.1875 11.2239 4.1875H13.4256V6.91266H12.0494C11.0199 6.91266 10.9518 7.29347 10.9518 8.00415L10.9481 9.36797H13.4412L13.1494 12.0928H10.9481V19.9556Z"
10
+ fill="currentColor"
11
+ />
12
+ </svg>`;
13
+
14
+ export { facebook as f };
@@ -0,0 +1,70 @@
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 primary = [{
7
+ background: '#9CE142'
8
+ }, {
9
+ background: '#00C959'
10
+ }, {
11
+ background: '#00A595'
12
+ }];
13
+ const purple = [{
14
+ background: '#C461FF'
15
+ }, {
16
+ background: '#5D3DF9'
17
+ }];
18
+ const red = [{
19
+ background: '#FFA543'
20
+ }, {
21
+ background: '#FF4D68'
22
+ }];
23
+ const incorrect = [{
24
+ background: '#3FA9F5'
25
+ }, ...purple, ...red];
26
+ const IncorrectUseOfColors = class {
27
+ constructor(hostRef) {
28
+ registerInstance(this, hostRef);
29
+ }
30
+ render() {
31
+ return h("div", {
32
+ key: '024316623703e89a7d5d226a75c25c145be9b2c6',
33
+ class: "container"
34
+ }, h("p", {
35
+ key: 'c2ddb12f2d87bf1c5bb7f49bcf2b76d42ccfd310',
36
+ class: "f-body-01"
37
+ }, "Each of the four colour tones cannot be mixed in the same composition."), h("div", {
38
+ key: 'c5f1acb20614d5732836240dd65b23a8dd074447',
39
+ class: "flex"
40
+ }, h("div", {
41
+ key: 'cb2fb1c0355b744e53977c573383989be12fe1ad',
42
+ class: "w-full"
43
+ }, h("ul", {
44
+ key: '9ceb752231d8a7764221d45653c4ef73fad4573d',
45
+ class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
46
+ }, primary.map(color => h("li", {
47
+ class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
48
+ }, h("div", {
49
+ class: "w-full min-h-[150px] effect-height flex items-center justify-between p-16",
50
+ style: {
51
+ backgroundColor: color.background
52
+ }
53
+ }))))), h("div", {
54
+ key: '494eaadc1547f91e11d93655b91424f98de6a635',
55
+ class: "w-full"
56
+ }, h("ul", {
57
+ key: '51de6e25df144ab9014ca95ad645a437b6469441',
58
+ class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
59
+ }, incorrect.map(color => h("li", {
60
+ class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
61
+ }, h("div", {
62
+ class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
63
+ style: {
64
+ backgroundColor: color.background
65
+ }
66
+ })))))));
67
+ }
68
+ };
69
+
70
+ export { IncorrectUseOfColors as incorrect_use_of_colors };
@@ -0,0 +1,58 @@
1
+ function r(e) {
2
+ var t,
3
+ f,
4
+ n = "";
5
+ if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
6
+ return n;
7
+ }
8
+ function clsx() {
9
+ for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
10
+ return n;
11
+ }
12
+ const falsyToString = value => typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
13
+ const cx = clsx;
14
+ const cva = (base, config) => {
15
+ return props => {
16
+ var ref;
17
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
18
+ const {
19
+ variants,
20
+ defaultVariants
21
+ } = config;
22
+ const getVariantClassNames = Object.keys(variants).map(variant => {
23
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
24
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
25
+ if (variantProp === null) return null;
26
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
27
+ return variants[variant][variantKey];
28
+ });
29
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
30
+ let [key, value] = param;
31
+ if (value === undefined) {
32
+ return acc;
33
+ }
34
+ acc[key] = value;
35
+ return acc;
36
+ }, {});
37
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1) => {
38
+ let {
39
+ class: cvClass,
40
+ className: cvClassName,
41
+ ...compoundVariantOptions
42
+ } = param1;
43
+ return Object.entries(compoundVariantOptions).every(param => {
44
+ let [key, value] = param;
45
+ return Array.isArray(value) ? value.includes({
46
+ ...defaultVariants,
47
+ ...propsWithoutUndefined
48
+ }[key]) : {
49
+ ...defaultVariants,
50
+ ...propsWithoutUndefined
51
+ }[key] === value;
52
+ }) ? [...acc, cvClass, cvClassName] : acc;
53
+ }, []);
54
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
55
+ };
56
+ };
57
+
58
+ export { cva as c };