@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.
- package/README.md +4 -48
- package/arrow-diagonal-black-8f0494c3.esm.js +3 -0
- package/arrow-right-9322ba8a.esm.js +5 -0
- package/bluesky-cc5edd2d.esm.js +14 -0
- package/chevron-down-6144c823.esm.js +12 -0
- package/chevron-left-ca6c66e1.esm.js +11 -0
- package/chevron-right-b88ed2d4.esm.js +5 -0
- package/chevron-up-c66bd477.esm.js +12 -0
- package/close-87fc0d63.esm.js +5 -0
- package/color-0ba8ed56.esm.js +423 -0
- package/color-primary-palette_6.entry.esm.js +756 -0
- package/copy-03b72cb6.esm.js +5 -0
- package/correct-use-of-colors.entry.esm.js +243 -0
- package/eds-accordion.entry.esm.js +132 -0
- package/eds-alert_28.entry.esm.js +227 -0
- package/eds-block-break.entry.esm.js +22 -0
- package/eds-breadcrumb.entry.esm.js +169 -0
- package/eds-card-project.entry.esm.js +92 -0
- package/eds-card-section.entry.esm.js +60 -0
- package/eds-card-tags.entry.esm.js +27 -0
- package/eds-card-tool.entry.esm.js +106 -0
- package/eds-card-wrapper.entry.esm.js +39 -0
- package/eds-code-block.entry.esm.js +2243 -0
- package/eds-components-section.entry.esm.js +113 -0
- package/eds-docs-palettes.entry.esm.js +29 -0
- package/eds-docs-tokens.entry.esm.js +45 -0
- package/eds-footer.entry.esm.js +110 -0
- package/eds-frame.entry.esm.js +117 -0
- package/eds-fullscreen-menu.entry.esm.js +143 -0
- package/eds-icon-arrow-diagonal.entry.esm.js +21 -0
- package/eds-icon-arrow-right.entry.esm.js +21 -0
- package/eds-icon-bluesky.entry.esm.js +21 -0
- package/eds-icon-chevron-down.entry.esm.js +21 -0
- package/eds-icon-chevron-left.entry.esm.js +21 -0
- package/eds-icon-chevron-right.entry.esm.js +21 -0
- package/eds-icon-chevron-up.entry.esm.js +21 -0
- package/eds-icon-close.entry.esm.js +21 -0
- package/eds-icon-copy.entry.esm.js +21 -0
- package/eds-icon-eu.entry.esm.js +21 -0
- package/eds-icon-facebook.entry.esm.js +21 -0
- package/eds-icon-gitlab.entry.esm.js +21 -0
- package/eds-icon-linkedin.entry.esm.js +21 -0
- package/eds-icon-loader.entry.esm.js +21 -0
- package/eds-icon-mastodon.entry.esm.js +21 -0
- package/eds-icon-menu.entry.esm.js +21 -0
- package/eds-icon-more.entry.esm.js +21 -0
- package/eds-icon-search.entry.esm.js +21 -0
- package/eds-icon-success.entry.esm.js +21 -0
- package/eds-icon-twitter.entry.esm.js +21 -0
- package/eds-icon-user.entry.esm.js +21 -0
- package/eds-icon-youtube.entry.esm.js +21 -0
- package/eds-login.entry.esm.js +84 -0
- package/eds-matomo-notice.entry.esm.js +129 -0
- package/eds-modal.entry.esm.js +114 -0
- package/eds-navigator.entry.esm.js +72 -0
- package/eds-pagination.entry.esm.js +258 -0
- package/eds-rating.entry.esm.js +71 -0
- package/eds-section-core_2.entry.esm.js +69 -0
- package/eds-social-networks.entry.esm.js +74 -0
- package/eds-svg-repository.entry.esm.js +316 -0
- package/eds-tab.entry.esm.js +41 -0
- package/eds-table.entry.esm.js +196 -0
- package/eds-tabs-content.entry.esm.js +145 -0
- package/eds-tabs.entry.esm.js +136 -0
- package/eds-tooltip.entry.esm.js +116 -0
- package/eu-9ddde93a.esm.js +30 -0
- package/facebook-9cb5c17f.esm.js +14 -0
- package/incorrect-use-of-colors.entry.esm.js +70 -0
- package/index-39c58238.esm.js +58 -0
- package/index.esm.js +3 -2668
- package/index.esm2.js +4783 -0
- package/keycloak-13893af6.esm.js +1594 -0
- package/linkedin-e8650abb.esm.js +28 -0
- package/loader-c9628637.esm.js +30 -0
- package/logo-color-7f1fd803.esm.js +115 -0
- package/logo-color-margins-ff8ce71b.esm.js +118 -0
- package/logo-space.entry.esm.js +32 -0
- package/logo-variations-horizontal.entry.esm.js +50 -0
- package/logo-variations-vertical.entry.esm.js +53 -0
- package/logo-white-no-bg-f382f86f.esm.js +1021 -0
- package/logo-wrong-usage.entry.esm.js +137 -0
- package/mastodon-3703ec61.esm.js +14 -0
- package/menu-340ea948.esm.js +11 -0
- package/mono-53f70232.esm.js +11 -0
- package/more-4449d549.esm.js +13 -0
- package/package.json +1 -1
- package/search-fbcd79c2.esm.js +12 -0
- package/src/components.d.ts +38 -0
- package/src/index.d.ts +1 -1
- package/src/react-component-lib/attachProps.d.ts +16 -0
- package/src/react-component-lib/case.d.ts +2 -0
- package/src/react-component-lib/createComponent.d.ts +10 -0
- package/src/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/src/react-component-lib/dev.d.ts +2 -0
- package/src/react-component-lib/index.d.ts +2 -0
- package/src/react-component-lib/interfaces.d.ts +29 -0
- package/src/react-component-lib/utils/attachProps.d.ts +16 -0
- package/src/react-component-lib/utils/case.d.ts +2 -0
- package/src/react-component-lib/utils/index.d.ts +10 -0
- package/success-443809da.esm.js +18 -0
- package/toastManager-d9eee791.esm.js +34 -0
- package/token-list_3.entry.esm.js +385 -0
- package/token-ratios.entry.esm.js +49 -0
- package/token-spacing.entry.esm.js +93 -0
- package/token-typography.entry.esm.js +264 -0
- package/twitter-ac21b505.esm.js +14 -0
- package/user-71ebdc15.esm.js +16 -0
- package/youtube-efbfbdc4.esm.js +14 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const copy = `<svg width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
2
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
|
|
3
|
+
</svg>`;
|
|
4
|
+
|
|
5
|
+
export { copy as c };
|
|
@@ -0,0 +1,243 @@
|
|
|
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 support = [{
|
|
14
|
+
background: '#141414'
|
|
15
|
+
}, {
|
|
16
|
+
background: '#383838'
|
|
17
|
+
}, {
|
|
18
|
+
background: '#CCCCCC'
|
|
19
|
+
}, {
|
|
20
|
+
background: '#E6E6E6'
|
|
21
|
+
}, {
|
|
22
|
+
background: '#FFFFFF'
|
|
23
|
+
}];
|
|
24
|
+
const blue = [{
|
|
25
|
+
background: '#3FA9F5'
|
|
26
|
+
}, {
|
|
27
|
+
background: '#0644F4'
|
|
28
|
+
}];
|
|
29
|
+
const purple = [{
|
|
30
|
+
background: '#C461FF'
|
|
31
|
+
}, {
|
|
32
|
+
background: '#5D3DF9'
|
|
33
|
+
}];
|
|
34
|
+
const red = [{
|
|
35
|
+
background: '#FFA543'
|
|
36
|
+
}, {
|
|
37
|
+
background: '#FF4D68'
|
|
38
|
+
}];
|
|
39
|
+
const CorrectUseOfColors = class {
|
|
40
|
+
constructor(hostRef) {
|
|
41
|
+
registerInstance(this, hostRef);
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return h("div", {
|
|
45
|
+
key: 'c200227a9e2f169d0aa287867fbb8e37950ba1fc',
|
|
46
|
+
class: "container"
|
|
47
|
+
}, h("p", {
|
|
48
|
+
key: '8fb2fee0b58ee6ad9386bd7ab9b7defe77bf0ea8',
|
|
49
|
+
class: "f-body-01"
|
|
50
|
+
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
51
|
+
key: '779695d669a2dcea9dfa02ad98afbbbb40fd1c60',
|
|
52
|
+
label: "primary",
|
|
53
|
+
size: "small",
|
|
54
|
+
intent: "ghost",
|
|
55
|
+
icon: "arrow-right",
|
|
56
|
+
url: "../color-palette/#primary-palette",
|
|
57
|
+
"extra-class": "inline-block"
|
|
58
|
+
}), "and", h("eds-link", {
|
|
59
|
+
key: '9adae0aedf1121fcae938fea0a190a4c6d919615',
|
|
60
|
+
label: "support",
|
|
61
|
+
size: "small",
|
|
62
|
+
intent: "ghost",
|
|
63
|
+
icon: "arrow-right",
|
|
64
|
+
url: "../color-palette/#support-palette",
|
|
65
|
+
"extra-class": "inline-block"
|
|
66
|
+
}), "color palettes."), h("div", {
|
|
67
|
+
key: 'ba6f9af827fc2d961d3bbe6e525f322a1cd1915a',
|
|
68
|
+
class: "flex"
|
|
69
|
+
}, h("div", {
|
|
70
|
+
key: 'c7c0375674e317e44501061074498a4d61061815',
|
|
71
|
+
class: "w-full"
|
|
72
|
+
}, h("ul", {
|
|
73
|
+
key: '3b47359203802b385a3ebfb3112d358860bb3aef',
|
|
74
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
75
|
+
}, primary.map(color => h("li", {
|
|
76
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
77
|
+
}, h("div", {
|
|
78
|
+
class: "w-full min-h-[150px] effect-height flex items-center justify-between p-16",
|
|
79
|
+
style: {
|
|
80
|
+
backgroundColor: color.background
|
|
81
|
+
}
|
|
82
|
+
}))))), h("div", {
|
|
83
|
+
key: '4762b034c77712345d8dccbad21d670e0e4b00b8',
|
|
84
|
+
class: "w-full"
|
|
85
|
+
}, h("ul", {
|
|
86
|
+
key: '4378c6902da37592f8a793e106a43ddee1ef93c4',
|
|
87
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
88
|
+
}, support.map(color => h("li", {
|
|
89
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
90
|
+
}, h("div", {
|
|
91
|
+
class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
|
|
92
|
+
style: {
|
|
93
|
+
backgroundColor: color.background
|
|
94
|
+
}
|
|
95
|
+
})))))), h("p", {
|
|
96
|
+
key: 'fbc81d54d8b403928b8ed06313b3c8cc43ed94ea',
|
|
97
|
+
class: "f-body-01"
|
|
98
|
+
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
99
|
+
key: '3cebed0ccba94099b7c7434009317ac5f2bd0b4c',
|
|
100
|
+
label: "purple",
|
|
101
|
+
size: "small",
|
|
102
|
+
intent: "ghost",
|
|
103
|
+
icon: "arrow-right",
|
|
104
|
+
url: "../color-palette/#primary-palette",
|
|
105
|
+
"extra-class": "inline-block"
|
|
106
|
+
}), "and", h("eds-link", {
|
|
107
|
+
key: '022ecd8aee653634c17289be36406a57c50870e2',
|
|
108
|
+
label: "support",
|
|
109
|
+
size: "small",
|
|
110
|
+
intent: "ghost",
|
|
111
|
+
icon: "arrow-right",
|
|
112
|
+
url: "../color-palette/#support-palette",
|
|
113
|
+
"extra-class": "inline-block"
|
|
114
|
+
}), "color palettes."), h("div", {
|
|
115
|
+
key: '199e32e4956d061d8900905ff5bb5f5de3e241aa',
|
|
116
|
+
class: "flex"
|
|
117
|
+
}, h("div", {
|
|
118
|
+
key: 'ff328c18717b9e8e59a556f1158d20c1ee81e7d8',
|
|
119
|
+
class: "w-full"
|
|
120
|
+
}, h("ul", {
|
|
121
|
+
key: 'e01f03ac9c1926e545cb7eed8bda7bbac85ec1df',
|
|
122
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
123
|
+
}, purple.map(color => h("li", {
|
|
124
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
125
|
+
}, h("div", {
|
|
126
|
+
class: "w-full min-h-[225px] effect-height flex items-center justify-between p-16",
|
|
127
|
+
style: {
|
|
128
|
+
backgroundColor: color.background
|
|
129
|
+
}
|
|
130
|
+
}))))), h("div", {
|
|
131
|
+
key: '9c916943b14e9c30dc4c378cd1f17e01898c07ba',
|
|
132
|
+
class: "w-full"
|
|
133
|
+
}, h("ul", {
|
|
134
|
+
key: 'f4ed3a0dbf49acf1f9377b88974a95aad039786e',
|
|
135
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
136
|
+
}, support.map(color => h("li", {
|
|
137
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
138
|
+
}, h("div", {
|
|
139
|
+
class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
|
|
140
|
+
style: {
|
|
141
|
+
backgroundColor: color.background
|
|
142
|
+
}
|
|
143
|
+
})))))), h("p", {
|
|
144
|
+
key: '4639f1444d9623cba363eeb5c2d8d31c878df248',
|
|
145
|
+
class: "f-body-01"
|
|
146
|
+
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
147
|
+
key: '06f173575af08f66a54cbecda06d8c8571831e14',
|
|
148
|
+
label: "blue",
|
|
149
|
+
size: "small",
|
|
150
|
+
intent: "ghost",
|
|
151
|
+
icon: "arrow-right",
|
|
152
|
+
url: "../color-palette/#primary-palette",
|
|
153
|
+
"extra-class": "inline-block"
|
|
154
|
+
}), "and", h("eds-link", {
|
|
155
|
+
key: '27190261ee2836060d3a82ff8b1e99cf2a3a4418',
|
|
156
|
+
label: "support",
|
|
157
|
+
size: "small",
|
|
158
|
+
intent: "ghost",
|
|
159
|
+
icon: "arrow-right",
|
|
160
|
+
url: "../color-palette/#support-palette",
|
|
161
|
+
"extra-class": "inline-block"
|
|
162
|
+
}), "color palettes."), h("div", {
|
|
163
|
+
key: '56b46450301b6ff4971d3d0a8db82e4490926a7d',
|
|
164
|
+
class: "flex"
|
|
165
|
+
}, h("div", {
|
|
166
|
+
key: '149dfb6f4888042bc3bc0155e13f0546619d0407',
|
|
167
|
+
class: "w-full"
|
|
168
|
+
}, h("ul", {
|
|
169
|
+
key: '170c840e01c036180d14b4ad3ff05a91d0d2a294',
|
|
170
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
171
|
+
}, blue.map(color => h("li", {
|
|
172
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
173
|
+
}, h("div", {
|
|
174
|
+
class: "w-full min-h-[225px] effect-height flex items-center justify-between p-16",
|
|
175
|
+
style: {
|
|
176
|
+
backgroundColor: color.background
|
|
177
|
+
}
|
|
178
|
+
}))))), h("div", {
|
|
179
|
+
key: '7bf3c17e287839feb7de1f9efb025468b6be01d5',
|
|
180
|
+
class: "w-full"
|
|
181
|
+
}, h("ul", {
|
|
182
|
+
key: '0933b22c83b1146fd3df7872168c46696612ee6f',
|
|
183
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
184
|
+
}, support.map(color => h("li", {
|
|
185
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
186
|
+
}, h("div", {
|
|
187
|
+
class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
|
|
188
|
+
style: {
|
|
189
|
+
backgroundColor: color.background
|
|
190
|
+
}
|
|
191
|
+
})))))), h("p", {
|
|
192
|
+
key: '13d3cc503cec5ff8368bb067669fd40c39474ad9',
|
|
193
|
+
class: "f-body-01"
|
|
194
|
+
}, "This guide demonstrates the correct usage of the", h("eds-link", {
|
|
195
|
+
key: '3d56221761895007dca7959d41dc9c2de7d5bee9',
|
|
196
|
+
label: "redish",
|
|
197
|
+
size: "small",
|
|
198
|
+
intent: "ghost",
|
|
199
|
+
icon: "arrow-right",
|
|
200
|
+
url: "../color-palette/#primary-palette",
|
|
201
|
+
"extra-class": "inline-block"
|
|
202
|
+
}), "and", h("eds-link", {
|
|
203
|
+
key: '816bfadc9f98d2f2ac59bc14df8d4160d89116b3',
|
|
204
|
+
label: "support",
|
|
205
|
+
size: "small",
|
|
206
|
+
intent: "ghost",
|
|
207
|
+
icon: "arrow-right",
|
|
208
|
+
url: "../color-palette/#support-palette",
|
|
209
|
+
"extra-class": "inline-block"
|
|
210
|
+
}), "color palettes."), h("div", {
|
|
211
|
+
key: 'b6eab4a5bb07fd34b59c0e9460ad4aab06e424f6',
|
|
212
|
+
class: "flex"
|
|
213
|
+
}, h("div", {
|
|
214
|
+
key: 'd2779763b7a8ac3b9d718cb2c98dcfeb6b81e311',
|
|
215
|
+
class: "w-full"
|
|
216
|
+
}, h("ul", {
|
|
217
|
+
key: '269881df5e4209d3670ceae03c37182d5d17fe7f',
|
|
218
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
219
|
+
}, red.map(color => h("li", {
|
|
220
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
221
|
+
}, h("div", {
|
|
222
|
+
class: "w-full min-h-[225px] effect-height flex items-center justify-between p-16",
|
|
223
|
+
style: {
|
|
224
|
+
backgroundColor: color.background
|
|
225
|
+
}
|
|
226
|
+
}))))), h("div", {
|
|
227
|
+
key: 'e014acde3e2676f4db049bd1df3f49fb68953470',
|
|
228
|
+
class: "w-full"
|
|
229
|
+
}, h("ul", {
|
|
230
|
+
key: '6881842a8f199741784d1a1382353ff271869ee0',
|
|
231
|
+
class: "gap-y-8 md:gap-y-12 lg:gap-y-16"
|
|
232
|
+
}, support.map(color => h("li", {
|
|
233
|
+
class: "grid-col-span-12 md:grid-col-span-6 flex flex-col"
|
|
234
|
+
}, h("div", {
|
|
235
|
+
class: "w-full min-h-[90px] effect-height flex items-center justify-between p-16",
|
|
236
|
+
style: {
|
|
237
|
+
backgroundColor: color.background
|
|
238
|
+
}
|
|
239
|
+
})))))));
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export { CorrectUseOfColors as correct_use_of_colors };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index.esm2.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react-dom';
|
|
5
|
+
|
|
6
|
+
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}";
|
|
7
|
+
const EdsAccordionStyle0 = edsAccordionCss;
|
|
8
|
+
const EdsAccordion = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.accordionChange = createEvent(this, "accordionChange", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Handles the click event on the accordion header to toggle expansion.
|
|
14
|
+
* Toggles the `isExpanded` state and emits the `accordionChange` event.
|
|
15
|
+
*/
|
|
16
|
+
this.handleClick = () => {
|
|
17
|
+
this.isExpanded = !this.isExpanded;
|
|
18
|
+
this.accordionChange.emit(this.isExpanded);
|
|
19
|
+
this.setPanelHeight();
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Calculates and sets the panel height based on the content height
|
|
23
|
+
* and adjusts based on the `shortContent` and `isExpanded` states.
|
|
24
|
+
*/
|
|
25
|
+
this.setPanelHeight = () => {
|
|
26
|
+
if (this.childContentRef) {
|
|
27
|
+
this.shortContent = this.wrapperRef.scrollWidth > 830 && !this.description ? this.childContentRef.scrollHeight <= 80 : this.childContentRef.scrollHeight <= 20;
|
|
28
|
+
this.panelHeight = this.isExpanded && !this.shortContent ? this.childContentRef.scrollHeight : 0;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.title = undefined;
|
|
32
|
+
this.description = undefined;
|
|
33
|
+
this.switchBg = true;
|
|
34
|
+
this.expanded = false;
|
|
35
|
+
this.clampText = true;
|
|
36
|
+
this.minHeightContent = false;
|
|
37
|
+
this.isExpanded = this.expanded;
|
|
38
|
+
this.panelHeight = 0;
|
|
39
|
+
this.shortContent = false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Lifecycle method that sets up the initial panel height and adds a resize event listener
|
|
43
|
+
* to recalculate height on window resize.
|
|
44
|
+
*/
|
|
45
|
+
componentDidLoad() {
|
|
46
|
+
this.setPanelHeight();
|
|
47
|
+
// Emit context for each eds-link element after the component is fully loaded
|
|
48
|
+
const btn = this.el.shadowRoot.querySelector('eds-button');
|
|
49
|
+
this.emitContext(btn);
|
|
50
|
+
window.addEventListener('resize', this.setPanelHeight);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Emits a custom event called `parentContext` for a given link element.
|
|
54
|
+
* This event provides context information about the breadcrumb component.
|
|
55
|
+
*
|
|
56
|
+
* @param linkElement - The link element to which the event will be dispatched.
|
|
57
|
+
*/
|
|
58
|
+
emitContext(linkElement) {
|
|
59
|
+
const event = new CustomEvent('parentContext', {
|
|
60
|
+
detail: {
|
|
61
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
62
|
+
identifier: null
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
linkElement.dispatchEvent(event);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Lifecycle method that cleans up the resize event listener when the component is removed.
|
|
69
|
+
*/
|
|
70
|
+
disconnectedCallback() {
|
|
71
|
+
window.removeEventListener('resize', this.setPanelHeight);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Renders the accordion structure, including header, content, description, and any slotted content.
|
|
75
|
+
* Adjusts styles based on `switchBg`, `tiny`, `clampText`, and other props.
|
|
76
|
+
*/
|
|
77
|
+
render() {
|
|
78
|
+
const minHeightContentClass = this.minHeightContent ? 'min-h-56' : '';
|
|
79
|
+
return h("div", {
|
|
80
|
+
key: '1f8ea188c4b39f6d1a8d10cdbf43d3df88d1281f',
|
|
81
|
+
ref: el => this.wrapperRef = el,
|
|
82
|
+
class: `container flex effect-color border-softer relative grid overflow-hidden rounded-lg border-2 p-16
|
|
83
|
+
${this.switchBg && this.isExpanded ? 'bg-inverse' : 'bg-default'}
|
|
84
|
+
${this.switchBg ? 'hover:bg-inverse' : ''}
|
|
85
|
+
${minHeightContentClass}`
|
|
86
|
+
}, h("h3", {
|
|
87
|
+
key: '4490bdc1a18b99850e8db8ae1c38fcb37912ec0d',
|
|
88
|
+
class: "mr-auto f-heading-06 text-left absolute inset-x-16 top-16 line-clamp-1"
|
|
89
|
+
}, this.title), h("div", {
|
|
90
|
+
key: '82df433a9cc6805a735300fd1bb52f41c639c992',
|
|
91
|
+
class: "ml-auto"
|
|
92
|
+
}, h("eds-button", {
|
|
93
|
+
key: '9965d5eecfa02fbea08c23c44d325417767f6495',
|
|
94
|
+
id: "accordionId",
|
|
95
|
+
intent: "tertiary",
|
|
96
|
+
"aria-expanded": this.isExpanded || this.shortContent,
|
|
97
|
+
"aria-controls": "accordionId",
|
|
98
|
+
class: `effect-color flex w-full items-center justify-between rounded-md outline-none focus:outline-none`,
|
|
99
|
+
onClick: this.handleClick,
|
|
100
|
+
icon: "chevron-down"
|
|
101
|
+
})), h("div", {
|
|
102
|
+
key: '7ab8d2d07d55fa05c5e5647d1d00d1165f0d40ce',
|
|
103
|
+
class: `w-full`
|
|
104
|
+
}, this.description ? h("span", {
|
|
105
|
+
class: `text-light ${!this.isExpanded && this.clampText ? 'line-clamp-1' : ''}`
|
|
106
|
+
}, this.description) : null, h("section", {
|
|
107
|
+
key: 'cb122dd5433d7012cba6f3769f79e92a155c45d7',
|
|
108
|
+
id: "sectionId",
|
|
109
|
+
"aria-hidden": !this.isExpanded,
|
|
110
|
+
class: `z-1 effect-height relative h-0 w-full ${!this.isExpanded && this.clampText ? 'overflow-hidden' : ''}`,
|
|
111
|
+
style: {
|
|
112
|
+
height: this.isExpanded ? 'auto' : '0'
|
|
113
|
+
}
|
|
114
|
+
}, h("div", {
|
|
115
|
+
key: '0c2e1d9b38f21f0cb7f50aa3923edcc448418e3f',
|
|
116
|
+
ref: el => this.childContentRef = el,
|
|
117
|
+
class: `accordion-content effect-color pt-20`,
|
|
118
|
+
"aria-hidden": !this.isExpanded
|
|
119
|
+
}, h("span", {
|
|
120
|
+
key: 'd119c88d54e8d5e83d4cc3d4d16d1cd53d689bc7',
|
|
121
|
+
class: `${!this.isExpanded && this.clampText ? 'line-clamp-2' : ''}`
|
|
122
|
+
}, h("slot", {
|
|
123
|
+
key: 'b2a6917ec65bc808389a2d1c77cd1183f00cbaa1'
|
|
124
|
+
}))))));
|
|
125
|
+
}
|
|
126
|
+
get el() {
|
|
127
|
+
return getElement(this);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
EdsAccordion.style = EdsAccordionStyle0;
|
|
131
|
+
|
|
132
|
+
export { EdsAccordion as eds_accordion };
|