@ebrains/react 0.0.1-alpha.0 → 0.3.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 (110) 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.entry.esm.js +102 -0
  16. package/eds-avatar_17.entry.esm.js +209 -0
  17. package/eds-card-desc_3.entry.esm.js +129 -0
  18. package/eds-card-generic.entry.esm.js +125 -0
  19. package/eds-card-project.entry.esm.js +92 -0
  20. package/eds-card-section.entry.esm.js +70 -0
  21. package/eds-card-tags.entry.esm.js +27 -0
  22. package/eds-card-tool.entry.esm.js +106 -0
  23. package/eds-card-wrapper.entry.esm.js +39 -0
  24. package/eds-code-block.entry.esm.js +2243 -0
  25. package/eds-components-section.entry.esm.js +146 -0
  26. package/eds-docs-palettes.entry.esm.js +29 -0
  27. package/eds-docs-tokens.entry.esm.js +45 -0
  28. package/eds-form.entry.esm.js +374 -0
  29. package/eds-frame.entry.esm.js +117 -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-input_7.entry.esm.js +518 -0
  53. package/eds-login.entry.esm.js +76 -0
  54. package/eds-logo-variations.entry.esm.js +29 -0
  55. package/eds-matomo-notice.entry.esm.js +129 -0
  56. package/eds-modal.entry.esm.js +114 -0
  57. package/eds-navigator.entry.esm.js +72 -0
  58. package/eds-pagination_2.entry.esm.js +456 -0
  59. package/eds-progress-bar.entry.esm.js +36 -0
  60. package/eds-rating.entry.esm.js +71 -0
  61. package/eds-section-core_2.entry.esm.js +69 -0
  62. package/eds-svg-repository.entry.esm.js +325 -0
  63. package/eds-tab.entry.esm.js +41 -0
  64. package/eds-tabs-content.entry.esm.js +145 -0
  65. package/eds-tabs.entry.esm.js +155 -0
  66. package/eds-timeline.entry.esm.js +130 -0
  67. package/eds-tooltip.entry.esm.js +116 -0
  68. package/eds-trl.entry.esm.js +69 -0
  69. package/eu-9ddde93a.esm.js +30 -0
  70. package/facebook-9cb5c17f.esm.js +14 -0
  71. package/incorrect-use-of-colors.entry.esm.js +71 -0
  72. package/index-39c58238.esm.js +58 -0
  73. package/index.esm.js +3 -2668
  74. package/index.esm2.js +4791 -0
  75. package/keycloak-13893af6.esm.js +1594 -0
  76. package/linkedin-e8650abb.esm.js +28 -0
  77. package/loader-c9628637.esm.js +30 -0
  78. package/logo-color-7f1fd803.esm.js +115 -0
  79. package/logo-color-margins-ff8ce71b.esm.js +118 -0
  80. package/logo-space.entry.esm.js +32 -0
  81. package/logo-variations-horizontal_2.entry.esm.js +116 -0
  82. package/logo-white-no-bg-f382f86f.esm.js +1021 -0
  83. package/logo-wrong-usage.entry.esm.js +137 -0
  84. package/mastodon-3703ec61.esm.js +14 -0
  85. package/menu-340ea948.esm.js +11 -0
  86. package/mono-53f70232.esm.js +11 -0
  87. package/more-4449d549.esm.js +13 -0
  88. package/package.json +1 -1
  89. package/search-fbcd79c2.esm.js +12 -0
  90. package/src/components.d.ts +40 -0
  91. package/src/index.d.ts +1 -1
  92. package/src/react-component-lib/attachProps.d.ts +16 -0
  93. package/src/react-component-lib/case.d.ts +2 -0
  94. package/src/react-component-lib/createComponent.d.ts +10 -0
  95. package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
  96. package/src/react-component-lib/dev.d.ts +2 -0
  97. package/src/react-component-lib/index.d.ts +2 -0
  98. package/src/react-component-lib/interfaces.d.ts +29 -0
  99. package/src/react-component-lib/utils/attachProps.d.ts +16 -0
  100. package/src/react-component-lib/utils/case.d.ts +2 -0
  101. package/src/react-component-lib/utils/index.d.ts +10 -0
  102. package/success-443809da.esm.js +18 -0
  103. package/toastManager-d9eee791.esm.js +34 -0
  104. package/token-list_3.entry.esm.js +385 -0
  105. package/token-ratios.entry.esm.js +49 -0
  106. package/token-spacing.entry.esm.js +93 -0
  107. package/token-typography.entry.esm.js +264 -0
  108. package/twitter-ac21b505.esm.js +14 -0
  109. package/user-71ebdc15.esm.js +16 -0
  110. package/youtube-efbfbdc4.esm.js +14 -0
@@ -0,0 +1,129 @@
1
+ import { r as registerInstance, h } from './index.esm2.js';
2
+ import { c as cva } from './index-39c58238.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+
7
+ const edsCardDescCss = ".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)}.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)}.text-light{color:var(--grey-700)}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}";
8
+ const EdsCardDescStyle0 = edsCardDescCss;
9
+ const EdsCardDesc = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.description = undefined;
13
+ this.descClass = 'f-ui-03-light';
14
+ this.truncate = true;
15
+ this.truncateLines = '3';
16
+ }
17
+ getTruncateClass() {
18
+ return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
19
+ }
20
+ render() {
21
+ return h("p", {
22
+ key: '017c115ebff999c74cff1eaeb5c63f97e0f6554d',
23
+ class: `text-light ${this.descClass}`
24
+ }, h("span", {
25
+ key: 'f87b9b3d593e417ef351882f426d24c0b206ccab',
26
+ class: this.getTruncateClass()
27
+ }, this.description));
28
+ }
29
+ };
30
+ EdsCardDesc.style = EdsCardDescStyle0;
31
+ const edsCardTitleCss = "a{all:unset;display:inline;color:inherit;text-decoration:none;cursor:pointer}h1,h2,h3,h4,h5,h6{margin:0}.f-heading-01{font-family:var(--f-heading-01-fontFamily);font-weight:var(--f-heading-01-fontWeight);font-size:var(--f-heading-01-fontSize);line-height:var(--f-heading-01-lineHeight);letter-spacing:var(--f-heading-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)}.break-words{overflow-wrap:break-word}.after\\:absolute::after{position:absolute}.after\\:inset-0::after{inset:0rem}.after\\:z-10::after{z-index:10}.after\\:content-\\[\\'\\'\\]::after{--tw-content:'';content:var(--tw-content)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}";
32
+ const EdsCardTitleStyle0 = edsCardTitleCss;
33
+ const EdsCardTitle = class {
34
+ constructor(hostRef) {
35
+ registerInstance(this, hostRef);
36
+ this.url = undefined;
37
+ this.titleClass = undefined;
38
+ this.headingLevel = 'h3';
39
+ this.externalLink = false;
40
+ this.cardTitle = undefined;
41
+ this.hierarchy = true;
42
+ }
43
+ /**
44
+ * Dynamically generate the title class based on the heading level.
45
+ */
46
+ getTitleClass() {
47
+ const levelMap = this.hierarchy ? {
48
+ h1: '05',
49
+ h2: '05',
50
+ h3: '05',
51
+ h4: '05',
52
+ h5: '05',
53
+ h6: '06'
54
+ } : {
55
+ h1: '01',
56
+ h2: '02',
57
+ h3: '03',
58
+ h4: '04',
59
+ h5: '05',
60
+ h6: '06'
61
+ };
62
+ return `f-heading-${levelMap[this.headingLevel]}`;
63
+ }
64
+ /*private getTag() {
65
+ if (this.url) {
66
+ return 'a';
67
+ }
68
+ return 'span';
69
+ }*/
70
+ render() {
71
+ //const Tag = this.getTag();
72
+ const Heading = this.headingLevel;
73
+ return h(Heading, {
74
+ key: '8aee3bcb0e04508dd21a03ea0f695e040f37c767',
75
+ class: this.getTitleClass()
76
+ }, h("a", {
77
+ key: 'c5fa27fe86037ed6b039c156aecdf1acc9c7c8bc',
78
+ class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none",
79
+ href: this.url,
80
+ target: this.externalLink ? '_blank' : undefined,
81
+ rel: this.externalLink ? 'noopener noreferrer' : undefined
82
+ }, this.cardTitle));
83
+ }
84
+ };
85
+ EdsCardTitle.style = EdsCardTitleStyle0;
86
+ const edsTagCss = ".f-ui-05{font-family:var(--f-ui-05-fontFamily);font-weight:var(--f-ui-05-fontWeight);font-size:var(--f-ui-05-fontSize);line-height:var(--f-ui-05-lineHeight);letter-spacing:var(--f-ui-05-letterSpacing)}.py-1{padding-top:0.0625rem;padding-bottom:0.0625rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.border-2{border-width:2px}.rounded-pill{border-radius:100px}.border-default{border:2px solid var(--black)}.text-inverse{color:var(--white)}.bg-strongest{background-color:var(--black)}.text-\\[\\#0034CB\\]{--tw-text-opacity:1;color:rgb(0 52 203 / var(--tw-text-opacity))}.border-\\[\\#0034CB\\]{--tw-border-opacity:1;border:2px solid rgb(0 52 203 / var(--tw-border-opacity))}.text-light{color:var(--grey-700)}.bg-strongest-soft{background-color:rgba(0, 0, 0, .05)}.border-transparent{border-color:var(--transparent)}.border-inverse{border-color:var(--white)}.bg-inverse{background-color:var(--white)}.text-lighter{color:var(--grey-600)}";
87
+ const EdsTagStyle0 = edsTagCss;
88
+
89
+ // Define the CVA for the tag styles
90
+ const tagStyles = cva(['f-ui-05 py-1 px-4 border-2 rounded-pill'],
91
+ // Base classes
92
+ {
93
+ variants: {
94
+ intent: {
95
+ default: 'border-default',
96
+ strong: 'text-inverse bg-strongest border-default',
97
+ accent: 'text-[#0034CB] border-[#0034CB]',
98
+ weak: 'text-light bg-strongest-soft border-transparent',
99
+ inverse: 'border-inverse text-inverse',
100
+ 'inverse-strong': 'bg-inverse border-inverse text-lighter'
101
+ }
102
+ },
103
+ defaultVariants: {
104
+ intent: 'default'
105
+ }
106
+ });
107
+ const EdsTag = class {
108
+ constructor(hostRef) {
109
+ registerInstance(this, hostRef);
110
+ this.label = undefined;
111
+ this.intent = 'default';
112
+ }
113
+ /**
114
+ * Render the component.
115
+ * @returns The rendered HTML for the tag component with the applied styles and label.
116
+ */
117
+ render() {
118
+ const classes = tagStyles({
119
+ intent: this.intent
120
+ });
121
+ return h("span", {
122
+ key: '546bd7eb2c78760edc12cd7bb3ede5f6ab9099f3',
123
+ class: classes
124
+ }, this.label);
125
+ }
126
+ };
127
+ EdsTag.style = EdsTagStyle0;
128
+
129
+ export { EdsCardDesc as eds_card_desc, EdsCardTitle as eds_card_title, EdsTag as eds_tag };
@@ -0,0 +1,125 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './color-0ba8ed56.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+ import './index-39c58238.esm.js';
7
+
8
+ const edsCardGenericCss = ".h-auto{height:auto}.h-full{height:100%}.\\!min-h-20{min-height:1.25rem !important}.min-h-120{min-height:120px}.min-h-156{min-height:156px}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.effect-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.hover\\:shadow-hover:hover{--tw-shadow:0px 0px 16px rgba(0, 0, 0, 0.2);--tw-shadow-colored:0px 0px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.cursor-pointer{cursor:pointer}.border-soft{border-color:rgba(0, 0, 0, .15 )}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.effect-focus-within{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.effect-focus-within:focus-within{outline-style:solid}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grow{flex-grow:1}.flex-col{flex-direction:column}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-12{padding:0.75rem}.p-16{padding:1rem}.mt-6{margin-top:0.375rem}.mt-8{margin-top:0.5rem}.gap-y-4{row-gap:0.25rem}.order-first{order:-9999}.mb-10{margin-bottom:0.625rem}.mb-12{margin-bottom:0.75rem}";
9
+ const EdsCardGenericStyle0 = edsCardGenericCss;
10
+ const EdsCardGeneric = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.parentContext = null; // Accepts the entire event detail or null
14
+ this.cardTitle = undefined;
15
+ this.url = undefined;
16
+ this.description = undefined;
17
+ this.image = undefined;
18
+ this.avatar = undefined;
19
+ this.shortAbbreviation = undefined;
20
+ this.headingLevel = 'h3';
21
+ this.tags = '';
22
+ this.tiny = false;
23
+ this.bg = true;
24
+ this.withHover = true;
25
+ this.hierarchy = true;
26
+ this.parsedImage = null;
27
+ }
28
+ componentWillLoad() {
29
+ if (this.image) {
30
+ try {
31
+ if (typeof this.image === 'object') {
32
+ // If image is already an object, assign it directly
33
+ this.parsedImage = this.image;
34
+ } else if (typeof this.image === 'string') {
35
+ // If image is a string, try to parse it
36
+ this.parsedImage = JSON.parse(this.image);
37
+ }
38
+ } catch (error) {
39
+ // eslint-disable-next-line
40
+ console.error('Error parsing image prop:', error);
41
+ this.parsedImage = {}; // Assign a fallback empty object in case of an error
42
+ }
43
+ }
44
+ }
45
+ handleParentContext(event) {
46
+ if (event.target !== this.el) {
47
+ // Ignore the event if it's not targeted at this specific instance
48
+ return;
49
+ }
50
+ //console.log(event.detail);
51
+ this.parentContext = event.detail;
52
+ event.stopPropagation();
53
+ }
54
+ /**
55
+ * Parses the `tags` prop into an array of link objects.
56
+ * Returns an empty array if parsing fails or if `tags` is not a valid JSON string or object.
57
+ *
58
+ * @returns {any[]} Array of parsed link objects
59
+ */
60
+ get parsedTags() {
61
+ if (typeof this.tags === 'object') {
62
+ return this.tags;
63
+ } else if (typeof this.tags === 'string') {
64
+ try {
65
+ return JSON.parse(this.tags);
66
+ } catch (e) {
67
+ // eslint-disable-next-line
68
+ console.error('Error parsing tags prop:', e);
69
+ return [];
70
+ }
71
+ }
72
+ return [];
73
+ }
74
+ articleClasses() {
75
+ return [this.description ? this.tiny ? 'min-h-120' : 'min-h-156' : 'h-auto', this.bg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
76
+ }
77
+ handleClick() {
78
+ var _a;
79
+ sendAnalytics({
80
+ category: 'ui-component',
81
+ parentContext: this.parentContext,
82
+ tag: this.el.tagName.toLowerCase(),
83
+ name: ((_a = this.cardTitle) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
84
+ action: 'click'
85
+ });
86
+ }
87
+ render() {
88
+ return h("article", {
89
+ key: '17d1f00f232a4436756fa3846684bbae8c716036',
90
+ class: this.articleClasses(),
91
+ onClick: () => this.handleClick()
92
+ }, h("eds-card-title", {
93
+ key: 'd99ee1716c4e308a3ea446f0f7cedfaeac30f2ed',
94
+ "heading-level": this.headingLevel,
95
+ titleClass: this.image ? 'f-ui-01' : undefined,
96
+ "card-title": this.cardTitle,
97
+ url: this.url,
98
+ hierarchy: this.hierarchy
99
+ }), this.description && h("eds-card-desc", {
100
+ key: 'c5bdc76e68a8d660609630aa8184ec3a9508ab61',
101
+ class: "mt-8",
102
+ "truncate-lines": "3",
103
+ description: this.description
104
+ }), this.parsedImage ? h("eds-img", Object.assign({
105
+ class: "mt-8"
106
+ }, this.parsedImage)) : this.avatar || this.shortAbbreviation ? h("eds-avatar", {
107
+ class: "order-first mb-12",
108
+ picture: this.avatar,
109
+ initials: this.shortAbbreviation
110
+ }) : null, h("div", {
111
+ key: 'fa993e3c60d357eb0d9a63e612bdd2bf026e7a85',
112
+ class: "flex flex-wrap gap-y-4"
113
+ }, this.parsedTags.map((tag, index) => h("eds-tag", {
114
+ key: index,
115
+ intent: tag.style,
116
+ label: tag.label
117
+ }))), ' ');
118
+ }
119
+ get el() {
120
+ return getElement(this);
121
+ }
122
+ };
123
+ EdsCardGeneric.style = EdsCardGenericStyle0;
124
+
125
+ export { EdsCardGeneric as eds_card_generic };
@@ -0,0 +1,92 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics, g as gradientBGColorVariants } from './color-0ba8ed56.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+ import './index-39c58238.esm.js';
7
+
8
+ const EdsCardProject = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.image = undefined;
12
+ this.editorialTitle = undefined;
13
+ this.headingLevel = 'h3';
14
+ this.categoryTitle = undefined;
15
+ this.color = undefined;
16
+ this.bgOnHover = false;
17
+ this.vertical = false;
18
+ this.titleProject = undefined;
19
+ this.url = undefined;
20
+ this.parsedImage = null;
21
+ }
22
+ componentWillLoad() {
23
+ // Parse the image prop if it's provided
24
+ if (this.image) {
25
+ try {
26
+ this.parsedImage = JSON.parse(this.image);
27
+ //console.log(this.parsedImage);
28
+ } catch (error) {
29
+ //console.error('Error parsing image prop:', error);
30
+ }
31
+ }
32
+ }
33
+ handleClick(event) {
34
+ var _a;
35
+ event.preventDefault();
36
+ sendAnalytics({
37
+ category: 'ui-component',
38
+ tag: this.el.tagName.toLowerCase(),
39
+ name: ((_a = this.titleProject) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
40
+ action: 'click'
41
+ });
42
+ }
43
+ render() {
44
+ var _a;
45
+ const cardClasses = ['min-h-156 border-inside after:border-softest @container overflow-hidden border-0 after:rounded-lg', this.color ? gradientBGColorVariants({
46
+ color: this.color,
47
+ hover: this.bgOnHover,
48
+ class: 'before:border-2 before:rounded-lg before:border-softest'
49
+ }) : 'bg-default', this.bgOnHover && this.color ? 'effect-background bg-default focus-within:bg-transparent hover:bg-transparent' : 'effect-background hover:bg-default', this.vertical ? 'flex-col gap-y-16' : 'flex-col gap-x-16 gap-y-12 lg:flex-row'].join(' ');
50
+ const imageClasses = this.vertical ? '' : 'max-w-120 @md:max-w-192 order-first w-full lg:order-last';
51
+ return h("article", {
52
+ key: '6af49754300ded8748ac3f40175e262480054969',
53
+ class: cardClasses,
54
+ onClick: event => this.handleClick(event)
55
+ }, h("div", {
56
+ key: '91e8501312957c44d9dc075f2ec3a9e5a5d425cb',
57
+ class: `flex grow flex-col ${this.vertical ? 'min-h-156' : ''}`
58
+ }, h("div", {
59
+ key: '44e3cf2d67255bb5669b6c721741ed060ba599e7',
60
+ class: "lg:max-w-[720px]"
61
+ }, h("eds-card-title", {
62
+ key: '0cf1d124b975e4d7223bab58db0d5861d348ceb2',
63
+ "heading-level": this.headingLevel,
64
+ titleClass: this.image ? 'f-ui-01' : undefined,
65
+ "card-title": this.titleProject,
66
+ url: this.url
67
+ }), this.editorialTitle && h("span", {
68
+ key: '85e1158691ae876bc0f3c6d0c5557f394ae935cb',
69
+ class: `block ${this.vertical ? 'f-ui-02' : 'mt-4 f-heading-06'}`
70
+ }, this.editorialTitle)), this.categoryTitle && h("div", {
71
+ key: '9ffdc9f14709600b623c3a5f878b2700864ced79',
72
+ class: "mt-auto flex items-center gap-x-12 pt-12"
73
+ }, ((_a = this.categoryTitle) === null || _a === void 0 ? void 0 : _a.length) && h("eds-tag", {
74
+ key: 'ecc5e55430df355c13420add9969855d1d54c27f',
75
+ label: this.categoryTitle
76
+ }))), this.parsedImage && h("div", {
77
+ key: '97de7a06a13d9843cb18fe4eb19303f436e2ce16',
78
+ class: imageClasses
79
+ }, h("div", {
80
+ key: '532d3c8252316a68976b4587c3d5b63167c0c598',
81
+ class: "aspect-1x1 w-full"
82
+ }, h("eds-img", Object.assign({
83
+ key: '37ee3dbbc99ec8c9139b0a89f9c725768eac5f6d',
84
+ sizes: this.vertical ? this.parsedImage.sizes || '' : '192px'
85
+ }, this.parsedImage)))));
86
+ }
87
+ get el() {
88
+ return getElement(this);
89
+ }
90
+ };
91
+
92
+ export { EdsCardProject as eds_card_project };
@@ -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 edsCardSectionCss = ".w-full{width:100%}.grid-layout{display:grid;grid-template-columns:repeat(var(--container-grid-columns, var(--grid-columns)), 1fr);grid-gap:var(--inner-gutter)}.grid-col-span-12{--container-grid-columns:12;grid-column:span 12 / span 12}.gap-y-4{row-gap:0.25rem}.gap-y-8{row-gap:0.5rem}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}@media (min-width: 750px){.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:gap-y-12{row-gap:0.75rem}.md\\:pt-28{padding-top:1.75rem}}@media (min-width: 750px){.md\\:grid-col-span-4{--container-grid-columns:4;grid-column:span 4 / span 4}.md\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.md\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.md\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:grid-col-span-5{--container-grid-columns:5;grid-column:span 5 / span 5}.lg\\:grid-col-span-6{--container-grid-columns:6;grid-column:span 6 / span 6}.lg\\:grid-col-start-7{grid-column-start:7}.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-8-cols{width:calc(((8 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (8 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-8-cols>*{--container-grid-columns:8}.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * 100%) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.cols-container>.lg\\:w-10-cols{width:calc(((10 / var(--container-grid-columns, var(--grid-columns))) * (100% - var(--inner-gutter))) - (var(--inner-gutter) - (10 / var(--container-grid-columns, var(--grid-columns)) * var(--inner-gutter))))}.lg\\:w-10-cols>*{--container-grid-columns:10}}@media (min-width: 900px){.lg\\:order-last{order:9999}.lg\\:order-none{order:0}.lg\\:mt-0{margin-top:0rem}.lg\\:block{display:block}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:w-\\[150px\\]{width:150px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[720px\\]{max-width:720px}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:gap-y-16{row-gap:1rem}.lg\\:px-28{padding-left:1.75rem;padding-right:1.75rem}.lg\\:\\!pl-12{padding-left:0.75rem !important}.lg\\:\\!pr-12{padding-right:0.75rem !important}}";
7
+ const EdsCardSectionStyle0 = edsCardSectionCss;
8
+ const EdsCardSection = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.cards = undefined;
12
+ this.cols = 4;
13
+ }
14
+ /**
15
+ * Parses the `cards` JSON string prop into an array of card objects.
16
+ * If parsing fails, returns an empty array.
17
+ *
18
+ * @returns {any[]} An array of parsed card objects.
19
+ */
20
+ get parsedCards() {
21
+ // If it's already an array, return it immediately.
22
+ if (Array.isArray(this.cards)) {
23
+ return this.cards;
24
+ }
25
+ if (typeof this.cards === 'object') {
26
+ return this.cards;
27
+ } else if (typeof this.cards === 'string') {
28
+ try {
29
+ return JSON.parse(this.cards);
30
+ } catch (e) {
31
+ // eslint-disable-next-line
32
+ console.error('Error parsing links prop:', e);
33
+ return [];
34
+ }
35
+ }
36
+ return [];
37
+ }
38
+ /**
39
+ * Renders the card section as a grid layout.
40
+ * Each parsed card object is mapped to an `<eds-card-generic>` component,
41
+ * displaying card details such as title, description, avatar, etc.
42
+ *
43
+ * @returns {JSX.Element} The rendered section containing a list of cards.
44
+ */
45
+ render() {
46
+ return h("section", {
47
+ key: 'c02b0e71ae4658e2f568e9428a9c61455aeb8ccd',
48
+ class: "w-full"
49
+ }, h("ul", {
50
+ key: '7f5d952d5cc5044c2ec23ca6b6b627901c40ab81',
51
+ class: "grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16"
52
+ }, this.parsedCards.map(card => h("li", {
53
+ class: `grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col`
54
+ }, h("eds-card-generic", {
55
+ cardTitle: card.title,
56
+ description: card.description,
57
+ avatar: card.avatar,
58
+ headingLevel: card.headingLevel,
59
+ tags: card.tags,
60
+ url: card.url,
61
+ bg: card.bg,
62
+ tiny: card.tiny,
63
+ image: card.image,
64
+ withHover: card.withHover
65
+ })))));
66
+ }
67
+ };
68
+ EdsCardSection.style = EdsCardSectionStyle0;
69
+
70
+ export { EdsCardSection as eds_card_section };
@@ -0,0 +1,27 @@
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 edsCardTagsCss = ".flex{display:flex}.flex-wrap{flex-wrap:wrap}.gap-y-4{row-gap:0.25rem}";
7
+ const EdsCardTagsStyle0 = edsCardTagsCss;
8
+ const EdsCardTags = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.accent = false;
12
+ this.tags = [];
13
+ }
14
+ render() {
15
+ return h("div", {
16
+ key: 'b201dc6df5e809d828a055fb5f01fe798e228361',
17
+ class: "flex flex-wrap gap-y-4"
18
+ }, this.tags.map((tag, index) => h("eds-tag", {
19
+ key: index,
20
+ intent: this.accent ? 'accent' : 'default',
21
+ label: tag
22
+ })));
23
+ }
24
+ };
25
+ EdsCardTags.style = EdsCardTagsStyle0;
26
+
27
+ export { EdsCardTags as eds_card_tags };
@@ -0,0 +1,106 @@
1
+ import { r as registerInstance, h, g as getElement } from './index.esm2.js';
2
+ import { s as sendAnalytics } from './color-0ba8ed56.esm.js';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import 'react-dom';
6
+ import './index-39c58238.esm.js';
7
+
8
+ const edsCardToolCss = ".h-auto{height:auto}.h-full{height:100%}.\\!min-h-20{min-height:1.25rem !important}.min-h-120{min-height:120px}.min-h-156{min-height:156px}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.effect-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.hover\\:shadow-hover:hover{--tw-shadow:0px 0px 16px rgba(0, 0, 0, 0.2);--tw-shadow-colored:0px 0px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.cursor-pointer{cursor:pointer}.border-soft{border-color:rgba(0, 0, 0, .15 )}.border-softer{border:2px solid rgba(0, 0, 0, .1 )}.effect-focus-within{outline-width:3px;outline-offset:2px;outline-color:var(--green-500)}.effect-focus-within:focus-within{outline-style:solid}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grow{flex-grow:1}.flex-col{flex-direction:column}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-12{padding:0.75rem}.p-16{padding:1rem}.mt-6{margin-top:0.375rem}.mt-8{margin-top:0.5rem}.gap-y-4{row-gap:0.25rem}.order-first{order:-9999}.mb-10{margin-bottom:0.625rem}.mb-12{margin-bottom:0.75rem}";
9
+ const EdsCardToolStyle0 = edsCardToolCss;
10
+ const EdsCardTool = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.cardTitle = undefined;
14
+ this.url = undefined;
15
+ this.description = undefined;
16
+ this.image = undefined;
17
+ this.avatar = undefined;
18
+ this.shortAbbreviation = undefined;
19
+ this.headingLevel = 'h5';
20
+ this.tags = '';
21
+ this.tiny = false;
22
+ this.bg = true;
23
+ this.withHover = true;
24
+ this.external = false;
25
+ this.hierarchy = true;
26
+ }
27
+ /**
28
+ * Parses the `tags` prop into an array of link objects.
29
+ * Returns an empty array if parsing fails or if `tags` is not a valid JSON string or object.
30
+ *
31
+ * @returns {any[]} Array of parsed link objects
32
+ */
33
+ get parsedTags() {
34
+ if (typeof this.tags === 'object') {
35
+ return this.tags;
36
+ } else if (typeof this.tags === 'string') {
37
+ try {
38
+ return JSON.parse(this.tags);
39
+ } catch (e) {
40
+ // eslint-disable-next-line
41
+ console.error('Error parsing links prop:', e);
42
+ return [];
43
+ }
44
+ }
45
+ return [];
46
+ }
47
+ componentWillLoad() {}
48
+ parseTags() {
49
+ return this.tags.split(',');
50
+ }
51
+ articleClasses() {
52
+ return [this.tiny ? 'min-h-120' : 'min-h-156', this.bg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
53
+ }
54
+ handleClick() {
55
+ var _a;
56
+ //event.preventDefault();
57
+ sendAnalytics({
58
+ category: 'ui-component',
59
+ tag: this.el.tagName.toLowerCase(),
60
+ name: ((_a = this.cardTitle) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
61
+ action: 'click'
62
+ });
63
+ }
64
+ render() {
65
+ return h("article", {
66
+ key: 'b46c0464688e45ab29f5b58b6cd2e22ed28e1034',
67
+ class: `${this.el.tagName.toLowerCase()} ${this.articleClasses()}`,
68
+ onClick: () => this.handleClick()
69
+ }, h("eds-card-title", {
70
+ key: 'a4da791280db14754b445b1a52e33cc9a25f765e',
71
+ "heading-level": this.headingLevel,
72
+ titleClass: this.image ? 'f-ui-01' : undefined,
73
+ "card-title": this.cardTitle,
74
+ url: this.url,
75
+ "external-link": this.external,
76
+ hierarchy: this.hierarchy
77
+ }), this.description && h("eds-card-desc", {
78
+ key: '86f7c6c80b83f244ba7d07d820d5793e1dda2933',
79
+ class: "mt-8",
80
+ "truncate-lines": "3",
81
+ description: this.description
82
+ }), this.image ? h("eds-img", {
83
+ src: this.image,
84
+ alt: "Sample Image",
85
+ width: 200,
86
+ height: 150
87
+ }) : this.avatar || this.shortAbbreviation ? h("eds-avatar", {
88
+ class: "order-first mb-12",
89
+ picture: this.avatar,
90
+ initials: this.shortAbbreviation
91
+ }) : null, h("div", {
92
+ key: '46307b57160f908aa7066b2a636c4db38e0e7a8e',
93
+ class: "flex flex-wrap gap-y-4"
94
+ }, this.parsedTags.map((tag, index) => h("eds-tag", {
95
+ key: index,
96
+ intent: tag.style,
97
+ label: tag.label
98
+ }))));
99
+ }
100
+ get el() {
101
+ return getElement(this);
102
+ }
103
+ };
104
+ EdsCardTool.style = EdsCardToolStyle0;
105
+
106
+ export { EdsCardTool as eds_card_tool };
@@ -0,0 +1,39 @@
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 EdsCardWrapper = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.tiny = false;
10
+ this.withBg = true;
11
+ this.withHover = true;
12
+ }
13
+ hasSlot(name) {
14
+ if (name) {
15
+ return !!this.el.querySelector(`[slot="${name}"]`);
16
+ }
17
+ return !!this.el.querySelector(':not([slot])');
18
+ }
19
+ render() {
20
+ const articleClasses = [this.tiny ? 'min-h-120' : 'min-h-156', this.withBg ? 'bg-inverse' : 'bg-default', this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '', 'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'].join(' ');
21
+ return h("article", {
22
+ key: 'c52f6ad7873050c052b8c0e68b2c812d74f2ddf1',
23
+ class: articleClasses
24
+ }, h("slot", {
25
+ key: 'dac6f9fe339c8baa191ee2fd622332ddf25ec08d'
26
+ }), this.hasSlot('footer') && h("div", {
27
+ key: '301862515ba88f320d1af722bec6120bc3e7d723',
28
+ class: "mt-auto"
29
+ }, h("slot", {
30
+ key: '85d939150663a4586934413c9965aa92a9babeef',
31
+ name: "footer"
32
+ })));
33
+ }
34
+ get el() {
35
+ return getElement(this);
36
+ }
37
+ };
38
+
39
+ export { EdsCardWrapper as eds_card_wrapper };