@ebrains/react 0.4.0-alpha.0 → 0.5.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.
- package/analytics-1cde8e4a.esm.js +47 -0
- package/color-2554aad6.esm.js +122 -0
- package/color-primary-palette_6.entry.esm.js +106 -106
- package/correct-use-of-colors.entry.esm.js +33 -33
- package/eds-accordion.entry.esm.js +126 -0
- package/eds-alert_17.entry.esm.js +187 -0
- package/eds-avatar_4.entry.esm.js +193 -0
- package/eds-card-generic.entry.esm.js +124 -0
- package/eds-card-project.entry.esm.js +12 -11
- package/eds-card-section.entry.esm.js +2 -2
- package/eds-card-tags.entry.esm.js +1 -1
- package/eds-card-tool.entry.esm.js +5 -6
- package/eds-card-wrapper.entry.esm.js +4 -4
- package/eds-code-block.entry.esm.js +8 -8
- package/eds-components-section.entry.esm.js +14 -2
- package/eds-docs-palettes.entry.esm.js +1 -1
- package/eds-docs-tokens.entry.esm.js +1 -1
- package/eds-dropdown_2.entry.esm.js +235 -0
- package/eds-form.entry.esm.js +410 -0
- package/eds-frame.entry.esm.js +117 -0
- package/eds-icon-arrow-diagonal.entry.esm.js +1 -1
- package/eds-icon-arrow-right.entry.esm.js +1 -1
- package/eds-icon-bluesky.entry.esm.js +1 -1
- package/eds-icon-chevron-down.entry.esm.js +1 -1
- package/eds-icon-chevron-left.entry.esm.js +1 -1
- package/eds-icon-chevron-right.entry.esm.js +1 -1
- package/eds-icon-chevron-up.entry.esm.js +1 -1
- package/eds-icon-close.entry.esm.js +1 -1
- package/eds-icon-copy.entry.esm.js +1 -1
- package/eds-icon-eu.entry.esm.js +1 -1
- package/eds-icon-facebook.entry.esm.js +1 -1
- package/eds-icon-gitlab.entry.esm.js +1 -1
- package/eds-icon-linkedin.entry.esm.js +1 -1
- package/eds-icon-loader.entry.esm.js +1 -1
- package/eds-icon-mastodon.entry.esm.js +1 -1
- package/eds-icon-menu.entry.esm.js +1 -1
- package/eds-icon-more.entry.esm.js +1 -1
- package/eds-icon-search.entry.esm.js +1 -1
- package/eds-icon-success.entry.esm.js +1 -1
- package/eds-icon-twitter.entry.esm.js +1 -1
- package/eds-icon-user.entry.esm.js +1 -1
- package/eds-icon-youtube.entry.esm.js +1 -1
- package/eds-input_7.entry.esm.js +529 -0
- package/eds-login.entry.esm.js +66 -45
- package/eds-logo-variations.entry.esm.js +1 -1
- package/eds-matomo-notice.entry.esm.js +1 -2
- package/eds-modal.entry.esm.js +129 -0
- package/eds-navigator.entry.esm.js +5 -5
- package/eds-pagination_2.entry.esm.js +15 -16
- package/eds-progress-bar.entry.esm.js +7 -2
- package/eds-section-core_2.entry.esm.js +5 -5
- package/eds-svg-repository.entry.esm.js +1 -1
- package/eds-tab.entry.esm.js +1 -1
- package/eds-tabs-content.entry.esm.js +5 -5
- package/eds-tabs.entry.esm.js +4 -4
- package/eds-timeline.entry.esm.js +4 -4
- package/eds-tooltip.entry.esm.js +4 -5
- package/eds-trl.entry.esm.js +2 -2
- package/eds-user.entry.esm.js +118 -0
- package/eds-vertical-stepper.entry.esm.js +81 -0
- package/incorrect-use-of-colors.entry.esm.js +7 -7
- package/index.esm.js +1 -1
- package/index.esm2.js +37 -7
- package/{keycloak-13893af6.esm.js → keycloak-d502ec16.esm.js} +219 -168
- package/logo-space.entry.esm.js +4 -4
- package/logo-variations-horizontal_2.entry.esm.js +26 -26
- package/logo-wrong-usage.entry.esm.js +37 -37
- package/package.json +1 -1
- package/src/components.d.ts +3 -0
- package/token-list_3.entry.esm.js +5 -5
- package/token-ratios.entry.esm.js +3 -3
- package/token-spacing.entry.esm.js +26 -26
- package/token-typography.entry.esm.js +2 -2
- package/color-bb472c37.esm.js +0 -423
- package/eds-accordion_33.entry.esm.js +0 -369
- package/eds-rating.entry.esm.js +0 -69
|
@@ -42,13 +42,13 @@ const CorrectUseOfColors = class {
|
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
return h("div", {
|
|
45
|
-
key: '
|
|
45
|
+
key: '58274bc750821893f1ff6db6af0c92557e2037dc',
|
|
46
46
|
class: "container"
|
|
47
47
|
}, h("p", {
|
|
48
|
-
key: '
|
|
48
|
+
key: 'f16ae70777dc595edb9f8ef20df33721816a472a',
|
|
49
49
|
class: "f-body-01"
|
|
50
50
|
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
51
|
-
key: '
|
|
51
|
+
key: 'c98c49daddf43987002dd69ab1c00dffbae5e69a',
|
|
52
52
|
label: "primary",
|
|
53
53
|
size: "small",
|
|
54
54
|
intent: "blueish",
|
|
@@ -56,7 +56,7 @@ const CorrectUseOfColors = class {
|
|
|
56
56
|
url: "../color-palette/#primary-palette",
|
|
57
57
|
"extra-class": "inline-block ml-4"
|
|
58
58
|
}), "and", h("eds-link", {
|
|
59
|
-
key: '
|
|
59
|
+
key: 'e466f6f7e05f68896114551f59673c707d5fd30f',
|
|
60
60
|
label: "support",
|
|
61
61
|
size: "small",
|
|
62
62
|
intent: "blueish",
|
|
@@ -64,13 +64,13 @@ const CorrectUseOfColors = class {
|
|
|
64
64
|
url: "../color-palette/#support-palette",
|
|
65
65
|
"extra-class": "inline-block ml-4"
|
|
66
66
|
}), "color palettes."), h("div", {
|
|
67
|
-
key: '
|
|
67
|
+
key: '32dfc27beebbbab3949c7695293800a2ff552ceb',
|
|
68
68
|
class: "flex"
|
|
69
69
|
}, h("div", {
|
|
70
|
-
key: '
|
|
70
|
+
key: 'e01d74cf63c84f66d868e180589b45cbc59ebff7',
|
|
71
71
|
class: "w-full"
|
|
72
72
|
}, h("ul", {
|
|
73
|
-
key: '
|
|
73
|
+
key: '162e9c5ed57689a94c5c59e2664bba2adfcd60fc',
|
|
74
74
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
75
75
|
}, primary.map(color => h("li", {
|
|
76
76
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -80,10 +80,10 @@ const CorrectUseOfColors = class {
|
|
|
80
80
|
backgroundColor: color.background
|
|
81
81
|
}
|
|
82
82
|
}))))), h("div", {
|
|
83
|
-
key: '
|
|
83
|
+
key: 'bb71abb645789030487eccdd0abaf9b223c12ec8',
|
|
84
84
|
class: "w-full"
|
|
85
85
|
}, h("ul", {
|
|
86
|
-
key: '
|
|
86
|
+
key: 'f85702460f89881d6b8642decad848affdc7002f',
|
|
87
87
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
88
88
|
}, support.map(color => h("li", {
|
|
89
89
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -93,10 +93,10 @@ const CorrectUseOfColors = class {
|
|
|
93
93
|
backgroundColor: color.background
|
|
94
94
|
}
|
|
95
95
|
})))))), h("p", {
|
|
96
|
-
key: '
|
|
96
|
+
key: '7b5b8b9c0013a91c97f24c239bde32a727695707',
|
|
97
97
|
class: "f-body-01"
|
|
98
98
|
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
99
|
-
key: '
|
|
99
|
+
key: '81dc2c31eb283a2f64a1fd32329b35b1d04afc12',
|
|
100
100
|
label: "purple",
|
|
101
101
|
size: "small",
|
|
102
102
|
intent: "blueish",
|
|
@@ -104,7 +104,7 @@ const CorrectUseOfColors = class {
|
|
|
104
104
|
url: "../color-palette/#primary-palette",
|
|
105
105
|
"extra-class": "inline-block ml-4"
|
|
106
106
|
}), "and", h("eds-link", {
|
|
107
|
-
key: '
|
|
107
|
+
key: 'd90877918d973595a7b8bdacd6bb80f1f04cab5b',
|
|
108
108
|
label: "support",
|
|
109
109
|
size: "small",
|
|
110
110
|
intent: "blueish",
|
|
@@ -112,13 +112,13 @@ const CorrectUseOfColors = class {
|
|
|
112
112
|
url: "../color-palette/#support-palette",
|
|
113
113
|
"extra-class": "inline-block ml-4"
|
|
114
114
|
}), "color palettes."), h("div", {
|
|
115
|
-
key: '
|
|
115
|
+
key: '81cf06bb6932b2120b210e7d1ee9d556cedc949b',
|
|
116
116
|
class: "flex"
|
|
117
117
|
}, h("div", {
|
|
118
|
-
key: '
|
|
118
|
+
key: '2cc1571fe83620fcfa8f961af93b7b0e8e970eb2',
|
|
119
119
|
class: "w-full"
|
|
120
120
|
}, h("ul", {
|
|
121
|
-
key: '
|
|
121
|
+
key: 'b6b1f7f874dbd8784a0253187438c2eb6282a815',
|
|
122
122
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
123
123
|
}, purple.map(color => h("li", {
|
|
124
124
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -128,10 +128,10 @@ const CorrectUseOfColors = class {
|
|
|
128
128
|
backgroundColor: color.background
|
|
129
129
|
}
|
|
130
130
|
}))))), h("div", {
|
|
131
|
-
key: '
|
|
131
|
+
key: '49a874de125699d800aee6256bb5b3bf9a0bf907',
|
|
132
132
|
class: "w-full"
|
|
133
133
|
}, h("ul", {
|
|
134
|
-
key: '
|
|
134
|
+
key: '10d41b5ab948c87c8db43fbddefbe3453c5384a9',
|
|
135
135
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
136
136
|
}, support.map(color => h("li", {
|
|
137
137
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -141,10 +141,10 @@ const CorrectUseOfColors = class {
|
|
|
141
141
|
backgroundColor: color.background
|
|
142
142
|
}
|
|
143
143
|
})))))), h("p", {
|
|
144
|
-
key: '
|
|
144
|
+
key: 'bc7c40435b87cd31b5bbb2315b3f50fa88b5bafb',
|
|
145
145
|
class: "f-body-01"
|
|
146
146
|
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
147
|
-
key: '
|
|
147
|
+
key: 'd5a9f4c30d9108bd8c8207ee0130a15b9c7ff53f',
|
|
148
148
|
label: "blue",
|
|
149
149
|
size: "small",
|
|
150
150
|
intent: "blueish",
|
|
@@ -152,7 +152,7 @@ const CorrectUseOfColors = class {
|
|
|
152
152
|
url: "../color-palette/#primary-palette",
|
|
153
153
|
"extra-class": "inline-block ml-4"
|
|
154
154
|
}), "and", h("eds-link", {
|
|
155
|
-
key: '
|
|
155
|
+
key: '35c2440f2c606cd4e8e69b33850ca908f6f36a4a',
|
|
156
156
|
label: "support",
|
|
157
157
|
size: "small",
|
|
158
158
|
intent: "blueish",
|
|
@@ -160,13 +160,13 @@ const CorrectUseOfColors = class {
|
|
|
160
160
|
url: "../color-palette/#support-palette",
|
|
161
161
|
"extra-class": "inline-block ml-4"
|
|
162
162
|
}), "color palettes."), h("div", {
|
|
163
|
-
key: '
|
|
163
|
+
key: 'cf9dde65d107b20c67e0036e891ad37c1d685477',
|
|
164
164
|
class: "flex"
|
|
165
165
|
}, h("div", {
|
|
166
|
-
key: '
|
|
166
|
+
key: '807350f20ee902df273ce35c217bcaa134502d13',
|
|
167
167
|
class: "w-full"
|
|
168
168
|
}, h("ul", {
|
|
169
|
-
key: '
|
|
169
|
+
key: '8198d1e59cb9477978a0b78714e7884a75ce52c0',
|
|
170
170
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
171
171
|
}, blue.map(color => h("li", {
|
|
172
172
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -176,10 +176,10 @@ const CorrectUseOfColors = class {
|
|
|
176
176
|
backgroundColor: color.background
|
|
177
177
|
}
|
|
178
178
|
}))))), h("div", {
|
|
179
|
-
key: '
|
|
179
|
+
key: 'ed4f89cd3d5544a199d0a516e23ee877c16dad6a',
|
|
180
180
|
class: "w-full"
|
|
181
181
|
}, h("ul", {
|
|
182
|
-
key: '
|
|
182
|
+
key: '47f8617629f34252b2d533f5932dd14b9117f601',
|
|
183
183
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
184
184
|
}, support.map(color => h("li", {
|
|
185
185
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -189,10 +189,10 @@ const CorrectUseOfColors = class {
|
|
|
189
189
|
backgroundColor: color.background
|
|
190
190
|
}
|
|
191
191
|
})))))), h("p", {
|
|
192
|
-
key: '
|
|
192
|
+
key: '7b99385726cda59f07b66ff99e050588d5778421',
|
|
193
193
|
class: "f-body-01"
|
|
194
194
|
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
195
|
-
key: '
|
|
195
|
+
key: 'f3719f08484d40ceb9ece89474f473cf9e44ee53',
|
|
196
196
|
label: "redish",
|
|
197
197
|
size: "small",
|
|
198
198
|
intent: "blueish",
|
|
@@ -200,7 +200,7 @@ const CorrectUseOfColors = class {
|
|
|
200
200
|
url: "../color-palette/#primary-palette",
|
|
201
201
|
"extra-class": "inline-block ml-4"
|
|
202
202
|
}), "and", h("eds-link", {
|
|
203
|
-
key: '
|
|
203
|
+
key: 'f1ee0fbf78a5da5f6a7a0836f63cc3312f68a547',
|
|
204
204
|
label: "support",
|
|
205
205
|
size: "small",
|
|
206
206
|
intent: "blueish",
|
|
@@ -208,13 +208,13 @@ const CorrectUseOfColors = class {
|
|
|
208
208
|
url: "../color-palette/#support-palette",
|
|
209
209
|
"extra-class": "inline-block ml-4"
|
|
210
210
|
}), "color palettes."), h("div", {
|
|
211
|
-
key: '
|
|
211
|
+
key: '833dcd6ad96a0c36a127c5384d0858b879bf0b05',
|
|
212
212
|
class: "flex"
|
|
213
213
|
}, h("div", {
|
|
214
|
-
key: '
|
|
214
|
+
key: 'cf1297f1dfed3e70c184cdb3f4e116292ce1e57f',
|
|
215
215
|
class: "w-full"
|
|
216
216
|
}, h("ul", {
|
|
217
|
-
key: '
|
|
217
|
+
key: '9d8d9e0f78348cee56f6c91b3289a90f25c088e4',
|
|
218
218
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
219
219
|
}, red.map(color => h("li", {
|
|
220
220
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -224,10 +224,10 @@ const CorrectUseOfColors = class {
|
|
|
224
224
|
backgroundColor: color.background
|
|
225
225
|
}
|
|
226
226
|
}))))), h("div", {
|
|
227
|
-
key: '
|
|
227
|
+
key: '836dfd427a087ee512970bf52ee0612a24cfaa72',
|
|
228
228
|
class: "w-full"
|
|
229
229
|
}, h("ul", {
|
|
230
|
-
key: '
|
|
230
|
+
key: '08e2b7603c2c093b2bd8931d1993aca89801ad1d',
|
|
231
231
|
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
232
232
|
}, support.map(color => h("li", {
|
|
233
233
|
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import { s as sendAnalytics } from './analytics-1cde8e4a.esm.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'react-dom';
|
|
6
|
+
|
|
7
|
+
const edsAccordionCss = "blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}.min-h-36{min-height:2.25rem}.min-h-44{min-height:2.75rem}.min-h-56{min-height:3.5rem}.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}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.effect-color{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:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}.border-softer{border:2px solid rgba(0, 0, 0, .1)}.bg-default{background-color:var(--grey-200)}.bg-inverse{background-color:var(--white)}.relative{position:relative}.absolute{position:absolute}.inset-x-16{left:1rem;right:1rem}.top-16{top:1rem}.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}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-md{border-radius:12px}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.text-light{color:var(--grey-700)}.z-1{z-index:1}.z-10{z-index:10}.effect-height{transition-duration:300ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-property:height}.h-0{height:0rem}.h-auto{height:auto}.pt-20{padding-top:1.25rem}.overflow-hidden{overflow:hidden}.grid{display:grid}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:16px}.border-2{border-width:2px}.p-16{padding:1rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.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)}.text-left{text-align:left}.text-center{text-align:center}";
|
|
8
|
+
const EdsAccordionStyle0 = edsAccordionCss;
|
|
9
|
+
const EdsAccordion = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.accordionChange = createEvent(this, "accordionChange", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Handles the click event on the accordion header to toggle expansion.
|
|
15
|
+
* Toggles the `isExpanded` state and emits the `accordionChange` event.
|
|
16
|
+
*/
|
|
17
|
+
this.handleClick = () => {
|
|
18
|
+
var _a;
|
|
19
|
+
this.isExpanded = !this.isExpanded;
|
|
20
|
+
this.accordionChange.emit(this.isExpanded);
|
|
21
|
+
this.setPanelHeight();
|
|
22
|
+
sendAnalytics({
|
|
23
|
+
category: 'ui-component',
|
|
24
|
+
parentContext: null,
|
|
25
|
+
tag: this.el.tagName.toLowerCase(),
|
|
26
|
+
name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
27
|
+
action: this.isExpanded ? 'expanded' : 'collapsed'
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Calculates and sets the panel height based on the content height
|
|
32
|
+
* and adjusts based on the `shortContent` and `isExpanded` states.
|
|
33
|
+
*/
|
|
34
|
+
this.setPanelHeight = () => {
|
|
35
|
+
if (this.childContentRef) {
|
|
36
|
+
this.shortContent = this.wrapperRef.scrollWidth > 830 && !this.description ? this.childContentRef.scrollHeight <= 80 : this.childContentRef.scrollHeight <= 20;
|
|
37
|
+
this.panelHeight = this.isExpanded && !this.shortContent ? this.childContentRef.scrollHeight : 0;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
this.title = undefined;
|
|
41
|
+
this.description = undefined;
|
|
42
|
+
this.switchBg = true;
|
|
43
|
+
this.expanded = false;
|
|
44
|
+
this.clampText = true;
|
|
45
|
+
this.minHeightContent = false;
|
|
46
|
+
this.isExpanded = this.expanded;
|
|
47
|
+
this.panelHeight = 0;
|
|
48
|
+
this.shortContent = false;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Lifecycle method that sets up the initial panel height and adds a resize event listener
|
|
52
|
+
* to recalculate height on window resize.
|
|
53
|
+
*/
|
|
54
|
+
componentDidLoad() {
|
|
55
|
+
this.setPanelHeight();
|
|
56
|
+
window.addEventListener('resize', this.setPanelHeight);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Lifecycle method that cleans up the resize event listener when the component is removed.
|
|
60
|
+
*/
|
|
61
|
+
disconnectedCallback() {
|
|
62
|
+
window.removeEventListener('resize', this.setPanelHeight);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Renders the accordion structure, including header, content, description, and any slotted content.
|
|
66
|
+
* Adjusts styles based on `switchBg`, `tiny`, `clampText`, and other props.
|
|
67
|
+
*/
|
|
68
|
+
render() {
|
|
69
|
+
const minHeightContentClass = this.minHeightContent ? 'min-h-56' : '';
|
|
70
|
+
return h("div", {
|
|
71
|
+
key: '00bd9a34ceb469bef74c827bd1f48bf3d4b545b6',
|
|
72
|
+
ref: el => this.wrapperRef = el,
|
|
73
|
+
class: `container flex effect-color border-softer relative grid overflow-hidden rounded-lg border-2 p-16
|
|
74
|
+
${this.switchBg && this.isExpanded ? 'bg-inverse' : 'bg-default'}
|
|
75
|
+
${this.switchBg ? 'hover:bg-inverse' : ''}
|
|
76
|
+
${minHeightContentClass}`
|
|
77
|
+
}, h("h3", {
|
|
78
|
+
key: 'ab6a953797e0a8379a01a9a2f00a4988d4fc8357',
|
|
79
|
+
class: "mr-auto f-heading-06 text-left absolute inset-x-16 top-16 line-clamp-1"
|
|
80
|
+
}, this.title), h("div", {
|
|
81
|
+
key: 'cfd6f4ad2ec5e412cdf2348d188dfcf90770012d',
|
|
82
|
+
class: "ml-auto"
|
|
83
|
+
}, h("eds-button", {
|
|
84
|
+
key: 'beaee69d610727b397645fc0a507b234003fde5e',
|
|
85
|
+
id: "toggleAccordion",
|
|
86
|
+
intent: "tertiary",
|
|
87
|
+
"aria-expanded": this.isExpanded || this.shortContent,
|
|
88
|
+
"aria-label": "Toggle accordion",
|
|
89
|
+
"aria-controls": "accordionSection",
|
|
90
|
+
class: `effect-color flex w-full items-center justify-between rounded-md outline-none focus:outline-none`,
|
|
91
|
+
onClick: this.handleClick,
|
|
92
|
+
icon: "chevron-down"
|
|
93
|
+
})), h("div", {
|
|
94
|
+
key: '795f14c0930a0b0862a86451cc7b7e807cb79c37',
|
|
95
|
+
class: `w-full`
|
|
96
|
+
}, this.description ? h("span", {
|
|
97
|
+
class: `text-light ${!this.isExpanded && this.clampText ? 'line-clamp-1' : ''}`
|
|
98
|
+
}, this.description) : null, h("section", {
|
|
99
|
+
key: '28f6cba233cdee58743faaacc992bf7497c2ff2e',
|
|
100
|
+
id: "accordionSection",
|
|
101
|
+
role: "region",
|
|
102
|
+
"aria-labelledby": "accordionHeader",
|
|
103
|
+
"aria-hidden": !this.isExpanded,
|
|
104
|
+
class: `z-1 effect-height relative h-0 w-full ${!this.isExpanded && this.clampText ? 'overflow-hidden' : ''}`,
|
|
105
|
+
style: {
|
|
106
|
+
height: this.isExpanded ? 'auto' : '0'
|
|
107
|
+
}
|
|
108
|
+
}, h("div", {
|
|
109
|
+
key: '939e442c55babfd3f1750d20d9b95f664c3a67c8',
|
|
110
|
+
ref: el => this.childContentRef = el,
|
|
111
|
+
class: `accordion-content effect-color pt-20`,
|
|
112
|
+
"aria-hidden": !this.isExpanded
|
|
113
|
+
}, h("span", {
|
|
114
|
+
key: '648d16ed84cb3da227a10e6370004c6479789aed',
|
|
115
|
+
class: `${!this.isExpanded && this.clampText ? 'line-clamp-2' : ''}`
|
|
116
|
+
}, h("slot", {
|
|
117
|
+
key: '90ca94f15e408b4b05c0eac4bd20fa21766cbb19'
|
|
118
|
+
}))))));
|
|
119
|
+
}
|
|
120
|
+
get el() {
|
|
121
|
+
return getElement(this);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
EdsAccordion.style = EdsAccordionStyle0;
|
|
125
|
+
|
|
126
|
+
export { EdsAccordion as eds_accordion };
|