@ebrains/components 0.3.0-alpha.0 → 0.4.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/dist/cjs/{color-3ffe3072.js → color-88793e49.js} +2 -2
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/eds-accordion_33.cjs.entry.js +2670 -0
- package/dist/cjs/eds-card-project.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-section.cjs.entry.js +3 -3
- package/dist/cjs/eds-card-tags.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-tool.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/eds-code-block.cjs.entry.js +48 -1
- package/dist/cjs/eds-matomo-notice.cjs.entry.js +1 -1
- package/dist/cjs/eds-pagination_2.cjs.entry.js +33 -15
- package/dist/cjs/eds-rating.cjs.entry.js +5 -7
- package/dist/cjs/eds-tabs-content.cjs.entry.js +1 -1
- package/dist/cjs/eds-tabs.cjs.entry.js +1 -1
- package/dist/cjs/eds-timeline.cjs.entry.js +3 -2
- package/dist/cjs/eds-tooltip.cjs.entry.js +11 -1
- package/dist/cjs/eds-trl.cjs.entry.js +7 -8
- package/dist/cjs/index-f08e4f5c.js +2 -34
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/eds-accordion/eds-accordion.js +11 -20
- package/dist/collection/components/eds-alert/eds-alert.js +5 -7
- package/dist/collection/components/eds-alert/eds-alert.stories.js +4 -4
- package/dist/collection/components/eds-avatar/eds-avatar.js +1 -1
- package/dist/collection/components/eds-avatar/eds-avatar.stories.js +24 -22
- package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +2 -1
- package/dist/collection/components/eds-button/eds-button.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +9 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-wrapper/eds-card-wrapper.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +14 -8
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.stories.js +1 -1
- package/dist/collection/components/eds-code-block/eds-code-block.js +57 -2
- package/dist/collection/components/eds-code-block/eds-code-block.stories.js +78 -0
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +11 -21
- package/dist/collection/components/eds-form/eds-form.js +41 -31
- package/dist/collection/components/eds-form/eds-form.stories.js +0 -3
- package/dist/collection/components/eds-frame/eds-frame.stories.js +19 -18
- package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +4 -1
- package/dist/collection/components/eds-link/eds-link.js +3 -4
- package/dist/collection/components/eds-modal/eds-modal.css +16 -0
- package/dist/collection/components/eds-modal/eds-modal.js +71 -29
- package/dist/collection/components/eds-modal/eds-modal.stories.js +34 -18
- package/dist/collection/components/eds-pagination/eds-pagination.js +13 -9
- package/dist/collection/components/eds-rating/eds-rating.js +8 -10
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.stories.js +12 -11
- package/dist/collection/components/eds-table/eds-table.js +20 -7
- package/dist/collection/components/eds-timeline/eds-timeline.js +3 -2
- package/dist/collection/components/eds-toast/eds-toast.js +21 -0
- package/dist/collection/components/eds-tooltip/eds-tooltip.js +10 -1
- package/dist/collection/components/eds-trl/eds-trl.js +7 -8
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +7 -6
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +8 -39
- package/dist/components/analytics.js +2 -2
- package/dist/components/components.css +12 -0
- package/dist/components/components.esm.js +1 -1
- package/dist/components/eds-accordion2.js +12 -20
- package/dist/components/eds-alert2.js +5 -7
- package/dist/components/eds-avatar2.js +1 -1
- package/dist/components/eds-block-break2.js +1 -1
- package/dist/components/eds-breadcrumb.js +2 -1
- package/dist/components/eds-button2.js +1 -1
- package/dist/components/eds-card-desc2.js +1 -1
- package/dist/components/eds-card-generic2.js +3 -3
- package/dist/components/eds-card-section.js +3 -3
- package/dist/components/eds-card-tags.js +1 -1
- package/dist/components/eds-card-title2.js +1 -1
- package/dist/components/eds-card-wrapper.js +1 -1
- package/dist/components/eds-code-block2.js +48 -1
- package/dist/components/eds-dropdown2.js +12 -21
- package/dist/components/eds-form.js +37 -12
- package/dist/components/eds-input-select2.js +1 -1
- package/dist/components/eds-link2.js +3 -4
- package/dist/components/eds-modal.js +56 -30
- package/dist/components/eds-pagination2.js +13 -9
- package/dist/components/eds-rating.js +6 -8
- package/dist/components/eds-table2.js +20 -6
- package/dist/components/eds-timeline.js +3 -2
- package/dist/components/eds-toast2.js +21 -0
- package/dist/components/eds-tooltip.js +11 -1
- package/dist/components/eds-trl.js +7 -8
- package/dist/components/p-2dda1ec4.entry.js +1 -0
- package/dist/components/{p-d9788b54.entry.js → p-35ec730b.entry.js} +1 -1
- package/dist/components/{p-e6bfbf51.entry.js → p-5398d652.entry.js} +2 -2
- package/dist/components/{p-e20ed2c7.entry.js → p-610db2b2.entry.js} +1 -1
- package/dist/components/p-832dc95a.entry.js +1 -0
- package/dist/components/p-855aa1a3.entry.js +1 -0
- package/dist/components/{p-52ac3456.entry.js → p-8ddc67a1.entry.js} +1 -1
- package/dist/components/p-ab32b3fc.entry.js +1 -0
- package/dist/components/p-b04eff31.entry.js +1 -0
- package/dist/components/p-b86a4985.js +1 -0
- package/dist/components/{p-2e8459ef.entry.js → p-ba6bafef.entry.js} +1 -1
- package/dist/components/{p-6fc62452.entry.js → p-c3b294a0.entry.js} +1 -1
- package/dist/components/p-c6038449.entry.js +1 -0
- package/dist/components/p-c72c8fb0.entry.js +1 -0
- package/dist/components/p-dd6daa96.entry.js +1 -0
- package/dist/components/{p-73bd0c97.entry.js → p-df94285c.entry.js} +1 -1
- package/dist/esm/{color-0ba8ed56.js → color-bb472c37.js} +2 -2
- package/dist/esm/components.js +1 -1
- package/dist/esm/eds-accordion_33.entry.js +2634 -0
- package/dist/esm/eds-card-project.entry.js +1 -1
- package/dist/esm/eds-card-section.entry.js +3 -3
- package/dist/esm/eds-card-tags.entry.js +1 -1
- package/dist/esm/eds-card-tool.entry.js +1 -1
- package/dist/esm/eds-card-wrapper.entry.js +1 -1
- package/dist/esm/eds-code-block.entry.js +49 -2
- package/dist/esm/eds-matomo-notice.entry.js +1 -1
- package/dist/esm/eds-pagination_2.entry.js +33 -15
- package/dist/esm/eds-rating.entry.js +5 -7
- package/dist/esm/eds-tabs-content.entry.js +1 -1
- package/dist/esm/eds-tabs.entry.js +1 -1
- package/dist/esm/eds-timeline.entry.js +3 -2
- package/dist/esm/eds-tooltip.entry.js +11 -1
- package/dist/esm/eds-trl.entry.js +7 -8
- package/dist/esm/index-e96badea.js +2 -34
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +560 -427
- package/dist/hydrate/index.mjs +560 -427
- package/dist/types/components/eds-accordion/eds-accordion.d.ts +5 -12
- package/dist/types/components/eds-avatar/eds-avatar.stories.d.ts +0 -18
- package/dist/types/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.d.ts +8 -0
- package/dist/types/components/eds-cards/eds-card-generic/eds-card-generic.d.ts +6 -2
- package/dist/types/components/eds-code-block/eds-code-block.d.ts +43 -3
- package/dist/types/components/eds-code-block/eds-code-block.stories.d.ts +54 -0
- package/dist/types/components/eds-dropdown/eds-dropdown.d.ts +0 -7
- package/dist/types/components/eds-form/eds-form.d.ts +3 -6
- package/dist/types/components/eds-form/eds-form.stories.d.ts +0 -5
- package/dist/types/components/eds-frame/eds-frame.stories.d.ts +0 -2
- package/dist/types/components/eds-input-elements/eds-input-select/eds-input-select.d.ts +3 -0
- package/dist/types/components/eds-link/eds-link.d.ts +1 -1
- package/dist/types/components/eds-modal/eds-modal.d.ts +18 -3
- package/dist/types/components/eds-modal/eds-modal.stories.d.ts +9 -0
- package/dist/types/components/eds-rating/eds-rating.d.ts +4 -6
- package/dist/types/components/eds-section/eds-section-core/eds-section-core.stories.d.ts +0 -1
- package/dist/types/components/eds-table/eds-table.d.ts +5 -5
- package/dist/types/components/eds-toast/eds-toast.d.ts +9 -0
- package/dist/types/components.d.ts +66 -84
- package/dist/types/shared-ui/eds-card-section/eds-card-section.d.ts +1 -6
- package/dist/types/shared-ui/eds-card-section/eds-card-section.stories.d.ts +42 -21
- package/package.json +1 -1
- package/dist/cjs/eds-accordion.cjs.entry.js +0 -93
- package/dist/cjs/eds-alert.cjs.entry.js +0 -96
- package/dist/cjs/eds-avatar_17.cjs.entry.js +0 -1454
- package/dist/cjs/eds-card-desc_3.cjs.entry.js +0 -117
- package/dist/cjs/eds-card-generic.cjs.entry.js +0 -105
- package/dist/cjs/eds-form.cjs.entry.js +0 -322
- package/dist/cjs/eds-frame.cjs.entry.js +0 -91
- package/dist/cjs/eds-input_7.cjs.entry.js +0 -316
- package/dist/cjs/eds-modal.cjs.entry.js +0 -86
- package/dist/components/p-02e2a62f.entry.js +0 -1
- package/dist/components/p-32f282a9.entry.js +0 -1
- package/dist/components/p-3617841d.entry.js +0 -1
- package/dist/components/p-373673ca.js +0 -1
- package/dist/components/p-3ff76976.entry.js +0 -1
- package/dist/components/p-42b4ecff.entry.js +0 -1
- package/dist/components/p-54c75346.entry.js +0 -1
- package/dist/components/p-5afb626c.entry.js +0 -1
- package/dist/components/p-5d7af761.entry.js +0 -1
- package/dist/components/p-7215789a.entry.js +0 -1
- package/dist/components/p-79887c2c.entry.js +0 -1
- package/dist/components/p-84957b6d.entry.js +0 -1
- package/dist/components/p-96c4deda.entry.js +0 -1
- package/dist/components/p-be6c80da.entry.js +0 -1
- package/dist/components/p-d1f6a722.entry.js +0 -1
- package/dist/components/p-d7a92efb.entry.js +0 -1
- package/dist/components/p-fd27e56c.entry.js +0 -1
- package/dist/esm/eds-accordion.entry.js +0 -89
- package/dist/esm/eds-alert.entry.js +0 -92
- package/dist/esm/eds-avatar_17.entry.js +0 -1434
- package/dist/esm/eds-card-desc_3.entry.js +0 -111
- package/dist/esm/eds-card-generic.entry.js +0 -101
- package/dist/esm/eds-form.entry.js +0 -318
- package/dist/esm/eds-frame.entry.js +0 -87
- package/dist/esm/eds-input_7.entry.js +0 -306
- package/dist/esm/eds-modal.entry.js +0 -82
|
@@ -44,6 +44,7 @@ const EdsBreadcrumb$1 = /*@__PURE__*/ proxyCustomElement(class EdsBreadcrumb ext
|
|
|
44
44
|
this.parsedItems = Array.isArray(parsed) ? parsed : [];
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
|
47
|
+
// eslint-disable-next-line
|
|
47
48
|
console.error('Error parsing breadcrumb items:', e);
|
|
48
49
|
this.parsedItems = [];
|
|
49
50
|
}
|
|
@@ -139,7 +140,7 @@ const EdsBreadcrumb$1 = /*@__PURE__*/ proxyCustomElement(class EdsBreadcrumb ext
|
|
|
139
140
|
*/
|
|
140
141
|
render() {
|
|
141
142
|
const itemsToRender = this.getTruncatedItems();
|
|
142
|
-
return (h("nav", { key: '
|
|
143
|
+
return (h("nav", { key: 'd66dd18fe856e4a8d82e47117d2de0288a9e3c56', "aria-label": "Breadcrumb" }, h("ol", { key: 'b3a218032b312cb5973c1ca59ab7bedcfc07d676', class: "flex items-center space-x-2" }, itemsToRender.map((item, index) => {
|
|
143
144
|
const isLast = index === itemsToRender.length - 1;
|
|
144
145
|
return (h("li", { class: "flex items-center" }, !item.isHidden ? (h("eds-link", { label: item.label, url: item.url, intent: this.intent, current: isLast, "aria-label": item.label, size: "small", "icon-small": "false" })) : (h("span", { class: "truncate px-2 ", "aria-hidden": "true" }, "...")), !isLast && !item.isHidden && (h("eds-icon-wrapper", { icon: "chevron-right", class: "w-20 h-20" }))));
|
|
145
146
|
}))));
|
|
@@ -222,7 +222,7 @@ const EdsButton = /*@__PURE__*/ proxyCustomElement(class EdsButton extends HTMLE
|
|
|
222
222
|
show: !this.loading
|
|
223
223
|
});
|
|
224
224
|
const ElementType = this.elementType;
|
|
225
|
-
return (h(ElementType, { key: '
|
|
225
|
+
return (h(ElementType, { key: 'e571ed0d3e2f4aa262259afea7d44d19b5685be7', "aria-label": this.label || this.ariaLabel || undefined, "aria-disabled": this.elementType === 'button' ? this.disabled : undefined, disabled: this.elementType === 'button' ? this.disabled : undefined, class: `${classes || ''} ${this.extraClass || ''}`, onClick: (event) => this.handleClick(event) }, this.label && h("span", { key: '8928bd512c6fb592ed8d2d25ad46213a5a7f4bf5', class: this.loading ? 'opacity-0' : '' }, this.label), this.loading && (h("span", { key: '8fdb5947ef65c60e5cc47f04d8fbe2f8485aa6bf', class: "absolute inset-0 flex items-center justify-center" }, h("span", { key: '5a6cf5d4f2debc279066cb49fa30da7b66f5532b', class: "loader", style: {
|
|
226
226
|
border: `3px solid ${this.intent === 'secondary' ? 'rgba(255, 255, 255, .3)' : 'rgba(0, 0, 0, .3)'}`,
|
|
227
227
|
borderBottomColor: this.intent === 'secondary' ? '#fff' : '#000'
|
|
228
228
|
} }))), this.icon ? h("eds-icon-wrapper", { class: iconClasses, icon: this.icon }) : null));
|
|
@@ -17,7 +17,7 @@ const EdsCardDesc = /*@__PURE__*/ proxyCustomElement(class EdsCardDesc extends H
|
|
|
17
17
|
return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h("p", { key: '
|
|
20
|
+
return (h("p", { key: 'ca38bcc0895d5a0c87fda782ef455e45c4b53263', class: `text-light ${this.descClass}` }, h("span", { key: '3108eec08a760b1db7ce1a7be05b68749f8f930b', class: this.getTruncateClass() }, this.description)));
|
|
21
21
|
}
|
|
22
22
|
static get style() { return EdsCardDescStyle0; }
|
|
23
23
|
}, [1, "eds-card-desc", {
|
|
@@ -23,7 +23,7 @@ const EdsCardGeneric = /*@__PURE__*/ proxyCustomElement(class EdsCardGeneric ext
|
|
|
23
23
|
this.avatar = undefined;
|
|
24
24
|
this.shortAbbreviation = undefined;
|
|
25
25
|
this.headingLevel = 'h3';
|
|
26
|
-
this.tags =
|
|
26
|
+
this.tags = [];
|
|
27
27
|
this.tiny = false;
|
|
28
28
|
this.bg = true;
|
|
29
29
|
this.withHover = true;
|
|
@@ -99,7 +99,7 @@ const EdsCardGeneric = /*@__PURE__*/ proxyCustomElement(class EdsCardGeneric ext
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
render() {
|
|
102
|
-
return (h("article", { key: '
|
|
102
|
+
return (h("article", { key: '5b498abfc65206fe89c9e54e673a81e1b6ed37d5', class: this.articleClasses(), onClick: () => this.handleClick() }, h("eds-card-title", { key: '61a0c6076957e39ab2a059c8587fc2e716e470bc', "heading-level": this.headingLevel, titleClass: this.image ? 'f-ui-01' : undefined, "card-title": this.cardTitle, url: this.url, hierarchy: this.hierarchy }), this.description && (h("eds-card-desc", { key: '6df3c08512acf60e22001867ab5691aa19f67961', class: "mt-8", "truncate-lines": "3", description: this.description })), this.parsedImage ? (h("eds-img", Object.assign({ class: "mt-8" }, this.parsedImage))) : this.avatar || this.shortAbbreviation ? (h("eds-avatar", { class: "order-first mb-12", picture: this.avatar, initials: this.shortAbbreviation })) : null, h("div", { key: '712193c8afac6744e2512d8b760daf2c850987b9', class: "flex flex-wrap gap-y-4" }, this.parsedTags.map((tag, index) => (h("eds-tag", { key: index, intent: tag.style, label: tag.label })))), ' '));
|
|
103
103
|
}
|
|
104
104
|
get el() { return this; }
|
|
105
105
|
static get style() { return EdsCardGenericStyle0; }
|
|
@@ -111,7 +111,7 @@ const EdsCardGeneric = /*@__PURE__*/ proxyCustomElement(class EdsCardGeneric ext
|
|
|
111
111
|
"avatar": [1],
|
|
112
112
|
"shortAbbreviation": [1, "short-abbreviation"],
|
|
113
113
|
"headingLevel": [1, "heading-level"],
|
|
114
|
-
"tags": [
|
|
114
|
+
"tags": [1],
|
|
115
115
|
"tiny": [4],
|
|
116
116
|
"bg": [4],
|
|
117
117
|
"withHover": [4, "with-hover"],
|
|
@@ -14,7 +14,7 @@ const EdsCardSection$1 = /*@__PURE__*/ proxyCustomElement(class EdsCardSection e
|
|
|
14
14
|
super();
|
|
15
15
|
this.__registerHost();
|
|
16
16
|
this.__attachShadow();
|
|
17
|
-
this.cards =
|
|
17
|
+
this.cards = [];
|
|
18
18
|
this.cols = 4;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -37,7 +37,7 @@ const EdsCardSection$1 = /*@__PURE__*/ proxyCustomElement(class EdsCardSection e
|
|
|
37
37
|
}
|
|
38
38
|
catch (e) {
|
|
39
39
|
// eslint-disable-next-line
|
|
40
|
-
console.error('Error parsing
|
|
40
|
+
console.error('Error parsing cards prop:', e);
|
|
41
41
|
return [];
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -51,7 +51,7 @@ const EdsCardSection$1 = /*@__PURE__*/ proxyCustomElement(class EdsCardSection e
|
|
|
51
51
|
* @returns {JSX.Element} The rendered section containing a list of cards.
|
|
52
52
|
*/
|
|
53
53
|
render() {
|
|
54
|
-
return (h("section", { key: '
|
|
54
|
+
return (h("section", { key: 'da139da167230819e494a6426c2431f209a2e557', class: "w-full" }, h("ul", { key: '3e8affe5c9aee91c4487480c72c437339265101a', class: "grid-layout gap-y-8 md:gap-y-12 lg:gap-y-16" }, this.parsedCards.map((card) => (h("li", { class: `grid-col-span-12 md:grid-col-span-${this.cols} flex flex-col` }, h("eds-card-generic", { cardTitle: card.title, description: card.description, avatar: card.avatar, headingLevel: card.headingLevel, tags: card.tags, url: card.url, bg: card.bg, tiny: card.tiny, image: card.image, withHover: card.withHover })))))));
|
|
55
55
|
}
|
|
56
56
|
static get style() { return EdsCardSectionStyle0; }
|
|
57
57
|
}, [1, "eds-card-section", {
|
|
@@ -13,7 +13,7 @@ const EdsCardTags$1 = /*@__PURE__*/ proxyCustomElement(class EdsCardTags extends
|
|
|
13
13
|
this.tags = [];
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h("div", { key: '
|
|
16
|
+
return (h("div", { key: '60a129de62d45736eba0884cc24c9738f3a0f55c', class: "flex flex-wrap gap-y-4" }, this.tags.map((tag, index) => (h("eds-tag", { key: index, intent: this.accent ? 'accent' : 'default', label: tag })))));
|
|
17
17
|
}
|
|
18
18
|
static get style() { return EdsCardTagsStyle0; }
|
|
19
19
|
}, [1, "eds-card-tags", {
|
|
@@ -47,7 +47,7 @@ const EdsCardTitle = /*@__PURE__*/ proxyCustomElement(class EdsCardTitle extends
|
|
|
47
47
|
render() {
|
|
48
48
|
//const Tag = this.getTag();
|
|
49
49
|
const Heading = this.headingLevel;
|
|
50
|
-
return (h(Heading, { key: '
|
|
50
|
+
return (h(Heading, { key: 'a654161b2c53e944eaefb21be7189a5e0acb06cf', class: this.getTitleClass() }, h("a", { key: '868fd911c1a8c366d726e886bfc7827487013e27', class: "break-words after:absolute after:inset-0 after:z-10 after:content-[''] focus:outline-none", href: this.url, target: this.externalLink ? '_blank' : undefined, rel: this.externalLink ? 'noopener noreferrer' : undefined }, this.cardTitle)));
|
|
51
51
|
}
|
|
52
52
|
static get style() { return EdsCardTitleStyle0; }
|
|
53
53
|
}, [1, "eds-card-title", {
|
|
@@ -21,7 +21,7 @@ const EdsCardWrapper$1 = /*@__PURE__*/ proxyCustomElement(class EdsCardWrapper e
|
|
|
21
21
|
this.withHover ? 'effect-shadow hover:shadow-hover cursor-pointer' : '',
|
|
22
22
|
'border-softer effect-focus-within relative flex grow flex-col rounded-lg border-2 p-16'
|
|
23
23
|
].join(' ');
|
|
24
|
-
return (h("article", { key: '
|
|
24
|
+
return (h("article", { key: '7c12b1d147f061e189b5dda5d517ec4eae0c3691', class: articleClasses }, h("slot", { key: 'f506bad73ed38ae36931f88f7d7c5f5d94705e4f' }), this.hasSlot('footer') && (h("div", { key: '783f480be269e4a2f61aa8d4396e757fe41bfcc6', class: "mt-auto" }, h("slot", { key: 'f07ddaa2d930518a5c8ac82efab3cb0dd6647bdd', name: "footer" })))));
|
|
25
25
|
}
|
|
26
26
|
get el() { return this; }
|
|
27
27
|
}, [4, "eds-card-wrapper", {
|
|
@@ -2418,12 +2418,58 @@ const EdsCodeBlock = /*@__PURE__*/ proxyCustomElement(class EdsCodeBlock extends
|
|
|
2418
2418
|
this.language = undefined;
|
|
2419
2419
|
this.copied = false;
|
|
2420
2420
|
}
|
|
2421
|
+
/**
|
|
2422
|
+
* Copies the current code content to the clipboard and sets a temporary copied state.
|
|
2423
|
+
*
|
|
2424
|
+
* @private
|
|
2425
|
+
* @returns {void}
|
|
2426
|
+
*/
|
|
2421
2427
|
copyToClipboard() {
|
|
2422
2428
|
navigator.clipboard.writeText(this.code).then(() => {
|
|
2423
2429
|
this.copied = true;
|
|
2430
|
+
/*const analyticsName = this.createHumanFriendlyAnalyticsName(this.code, this.language);
|
|
2431
|
+
sendAnalytics({
|
|
2432
|
+
category: 'ui-component',
|
|
2433
|
+
parentContext: null,
|
|
2434
|
+
tag: this.el.tagName.toLowerCase(),
|
|
2435
|
+
name: analyticsName || '',
|
|
2436
|
+
action: 'copy'
|
|
2437
|
+
});*/
|
|
2424
2438
|
setTimeout(() => (this.copied = false), 2000);
|
|
2425
2439
|
});
|
|
2426
2440
|
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Utility function that creates a human-friendly analytics name based on the code and language.
|
|
2443
|
+
* It uses:
|
|
2444
|
+
* - The language (in uppercase)
|
|
2445
|
+
* - The number of non-empty lines in the code
|
|
2446
|
+
* - The first non-empty line of code (truncated to 30 characters, if needed)
|
|
2447
|
+
*
|
|
2448
|
+
* returns A descriptive analytics name.
|
|
2449
|
+
*/
|
|
2450
|
+
/*private createHumanFriendlyAnalyticsName(code: string, language: string): string {
|
|
2451
|
+
// Count non-empty lines
|
|
2452
|
+
const lines = code.split('\n').filter(line => line.trim() !== '').length;
|
|
2453
|
+
|
|
2454
|
+
// Find the first non-empty line and trim it
|
|
2455
|
+
let firstNonEmptyLine = code.split('\n').find(line => line.trim() !== '');
|
|
2456
|
+
firstNonEmptyLine = firstNonEmptyLine ? firstNonEmptyLine.trim() : '';
|
|
2457
|
+
|
|
2458
|
+
// Truncate the snippet if it’s too long
|
|
2459
|
+
if (firstNonEmptyLine.length > 30) {
|
|
2460
|
+
firstNonEmptyLine = firstNonEmptyLine.substring(0, 30) + '...';
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
return `CodeBlock:${language.toLowerCase()}|${lines}-line(s)|${firstNonEmptyLine.toLowerCase()}`;
|
|
2464
|
+
}*/
|
|
2465
|
+
/**
|
|
2466
|
+
* Returns the syntax-highlighted HTML for the code.
|
|
2467
|
+
* If the provided language is supported by Prism, this method returns the highlighted code.
|
|
2468
|
+
* Otherwise, it logs a warning and returns the raw code.
|
|
2469
|
+
*
|
|
2470
|
+
* @private
|
|
2471
|
+
* @returns {string} The highlighted HTML string for the code block.
|
|
2472
|
+
*/
|
|
2427
2473
|
getHighlightedCode() {
|
|
2428
2474
|
if (this.language && Prism$1.languages[this.language]) {
|
|
2429
2475
|
return Prism$1.highlight(this.code, Prism$1.languages[this.language], this.language);
|
|
@@ -2433,8 +2479,9 @@ const EdsCodeBlock = /*@__PURE__*/ proxyCustomElement(class EdsCodeBlock extends
|
|
|
2433
2479
|
return this.code; // Fallback if language is not provided or unsupported
|
|
2434
2480
|
}
|
|
2435
2481
|
render() {
|
|
2436
|
-
return (h("div", { key: '
|
|
2482
|
+
return (h("div", { key: '00eba9265ee17605f699d1e5606013b68e900b29', class: "relative bg-stronger rounded-sm" }, h("div", { key: '1192584f04de5ff74e91c88597a3360b92053456', class: "text-inverse flex justify-between items-center p-8" }, this.language ? (h("span", { class: "f-ui-03" }, this.language.toUpperCase())) : (h("pre", { class: "bg-stronger pl-8", role: "region", "aria-label": "Code block without language" }, h("code", { innerHTML: this.getHighlightedCode() }))), h("span", { key: '3666b6529a16a8cc64f448527db4ddee08f977a3', "aria-hidden": "true", class: "w-20 h-20 mt-8" }, h("eds-icon-wrapper", { key: 'f222d95a2e548429f6c4de96a7646e3cef1f360f', icon: this.copied ? 'success' : 'copy', onClick: () => this.copyToClipboard() })), h("span", { key: '8c539deda773909c01a41eb04ee51380c0a9c4bb', class: "sr-only" }, "Copy Code")), this.language && (h("pre", { key: '99541dedb32c543da5e780ffee4460333fbb3724', class: `language-${this.language} bg-stronger pl-8 pb-8`, role: "region", "aria-label": `Code block in ${this.language}` }, h("code", { key: '4e6ae6fcfae3de8c1fe5ad9d22309e0c8bee0c2c', innerHTML: this.getHighlightedCode() })))));
|
|
2437
2483
|
}
|
|
2484
|
+
get el() { return this; }
|
|
2438
2485
|
static get style() { return EdsCodeBlockStyle0; }
|
|
2439
2486
|
}, [1, "eds-code-block", {
|
|
2440
2487
|
"code": [1],
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import './color.js';
|
|
3
|
+
import { s as sendAnalytics } from './analytics.js';
|
|
2
4
|
import { d as defineCustomElement$2 } from './eds-button2.js';
|
|
3
5
|
import { d as defineCustomElement$1 } from './eds-icon-wrapper2.js';
|
|
4
6
|
|
|
@@ -15,6 +17,7 @@ const EdsDropdown = /*@__PURE__*/ proxyCustomElement(class EdsDropdown extends H
|
|
|
15
17
|
* Toggles the visibility of the dropdown and manages focus.
|
|
16
18
|
*/
|
|
17
19
|
this.handleClick = () => {
|
|
20
|
+
var _a;
|
|
18
21
|
this.isOpen = !this.isOpen;
|
|
19
22
|
if (this.isOpen) {
|
|
20
23
|
this.focusIndex = 0;
|
|
@@ -23,6 +26,13 @@ const EdsDropdown = /*@__PURE__*/ proxyCustomElement(class EdsDropdown extends H
|
|
|
23
26
|
else {
|
|
24
27
|
this.closeDropdown();
|
|
25
28
|
}
|
|
29
|
+
sendAnalytics({
|
|
30
|
+
category: 'ui-component',
|
|
31
|
+
parentContext: null,
|
|
32
|
+
tag: this.host.tagName.toLowerCase(),
|
|
33
|
+
name: ((_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
34
|
+
action: this.isOpen ? 'expanded' : 'collapsed'
|
|
35
|
+
});
|
|
26
36
|
};
|
|
27
37
|
this.icon = 'chevron-down';
|
|
28
38
|
this.label = undefined;
|
|
@@ -89,39 +99,20 @@ const EdsDropdown = /*@__PURE__*/ proxyCustomElement(class EdsDropdown extends H
|
|
|
89
99
|
componentDidLoad() {
|
|
90
100
|
var _a;
|
|
91
101
|
this.focusableItems = Array.from(((_a = this.dropdownContent) === null || _a === void 0 ? void 0 : _a.querySelectorAll('a, button')) || []);
|
|
92
|
-
const btns = this.host.shadowRoot.querySelectorAll('eds-button');
|
|
93
|
-
btns.forEach((btn) => {
|
|
94
|
-
this.emitContext(btn);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Emits a custom event called `parentContext` for a given button element.
|
|
99
|
-
* Provides context information about the dropdown component.
|
|
100
|
-
*
|
|
101
|
-
* @param linkElement - The button element to which the event will be dispatched.
|
|
102
|
-
*/
|
|
103
|
-
emitContext(linkElement) {
|
|
104
|
-
const event = new CustomEvent('parentContext', {
|
|
105
|
-
detail: {
|
|
106
|
-
componentName: this.host.tagName.toLowerCase(),
|
|
107
|
-
identifier: null
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
linkElement.dispatchEvent(event);
|
|
111
102
|
}
|
|
112
103
|
/**
|
|
113
104
|
* Renders the dropdown component and displays its content when open.
|
|
114
105
|
* @returns {JSX.Element} The rendered dropdown component.
|
|
115
106
|
*/
|
|
116
107
|
render() {
|
|
117
|
-
return (h("div", { key: '
|
|
108
|
+
return (h("div", { key: '809cb733330db434f94f854ed4d1ee375f598297', class: "z-focus relative", ref: (el) => (this.dropdownContent = el) }, h("eds-button", { key: 'c80f2930b335708a2a01d06b565673597bd8d926', label: this.label, "aria-label": this.ariaLabel, icon: this.icon, intent: this.intent, onClick: this.handleClick, "aria-expanded": this.isOpen.toString(), "aria-haspopup": "menu" }), h("nav", { key: '7b3ccb2ab29474a4795d5491960e0713aefcd624', class: {
|
|
118
109
|
'shadow-small bg-inverse border-softest z-10 z-on-top absolute top-full mt-4 flex flex-col gap-y-4 border-2 p-8': true,
|
|
119
110
|
'left-4': this.dropdownPos === 'left' && this.dropdownOffset,
|
|
120
111
|
'left-0': this.dropdownPos === 'left' && !this.dropdownOffset,
|
|
121
112
|
'right-4': this.dropdownPos === 'right' && this.dropdownOffset,
|
|
122
113
|
'right-0': this.dropdownPos === 'right' && !this.dropdownOffset,
|
|
123
114
|
'rounded-lg': this.rounded
|
|
124
|
-
}, style: { display: this.isOpen ? 'block' : 'none' }, "aria-label": "Dropdown", "aria-hidden": !this.isOpen }, h("slot", { key: '
|
|
115
|
+
}, style: { display: this.isOpen ? 'block' : 'none' }, "aria-label": "Dropdown", "aria-hidden": !this.isOpen }, h("slot", { key: 'c514c5dca893708fd1660a61cfeb1607229bbff5' }))));
|
|
125
116
|
}
|
|
126
117
|
get host() { return this; }
|
|
127
118
|
static get style() { return EdsDropdownStyle0; }
|
|
@@ -129,7 +129,6 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
129
129
|
this.formSubmitting.emit(this.isSubmitting);
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
this.smallAlert = false;
|
|
133
132
|
this.setFormUrl = true;
|
|
134
133
|
this.submitBtn = true;
|
|
135
134
|
this.submitBtnLabel = 'Submit';
|
|
@@ -138,7 +137,7 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
138
137
|
this.submitBtnHintMessage = 'To participate, please sign in using your EBRAINS account. If you do not have an account yet, you can easily create one on the EBRAINS portal.';
|
|
139
138
|
this.endpoint = undefined;
|
|
140
139
|
this.name = 'form';
|
|
141
|
-
this.fields =
|
|
140
|
+
this.fields = [];
|
|
142
141
|
this.values = {};
|
|
143
142
|
this.coupleAuth = false;
|
|
144
143
|
this.formSubmitted = false;
|
|
@@ -148,6 +147,7 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
148
147
|
this.alertMessage = null;
|
|
149
148
|
this.isAuthenticated = false;
|
|
150
149
|
this.authUser = undefined;
|
|
150
|
+
this.parsedFields = [];
|
|
151
151
|
}
|
|
152
152
|
onAuthStatusChanged(event) {
|
|
153
153
|
var _a;
|
|
@@ -155,6 +155,7 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
155
155
|
this.authUser = event.detail.user;
|
|
156
156
|
}
|
|
157
157
|
componentDidLoad() {
|
|
158
|
+
this.parseFields(this.fields);
|
|
158
159
|
// Emit context for each eds-link element after the component is fully loaded
|
|
159
160
|
const links = this.el.querySelectorAll('eds-button');
|
|
160
161
|
links.forEach((link) => {
|
|
@@ -227,7 +228,7 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
227
228
|
validateForm() {
|
|
228
229
|
this.errors = {};
|
|
229
230
|
this.hasError = false;
|
|
230
|
-
this.
|
|
231
|
+
this.parsedFields.forEach((field) => {
|
|
231
232
|
if (field.type !== 'hidden') {
|
|
232
233
|
if ((field.type === 'checkbox' || field.type === 'radio') && !field.options) {
|
|
233
234
|
// Single checkbox validation
|
|
@@ -309,24 +310,45 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
309
310
|
});
|
|
310
311
|
return formData;
|
|
311
312
|
}
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
parseFields(newValue) {
|
|
314
|
+
try {
|
|
315
|
+
if (typeof newValue === 'string') {
|
|
316
|
+
this.parsedFields = JSON.parse(newValue);
|
|
317
|
+
}
|
|
318
|
+
else if (Array.isArray(newValue)) {
|
|
319
|
+
this.parsedFields = newValue;
|
|
320
|
+
}
|
|
321
|
+
else if (newValue && typeof newValue === 'object') {
|
|
322
|
+
// In case a single object is passed, wrap it in an array.
|
|
323
|
+
this.parsedFields = newValue;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
this.parsedFields = [];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
// eslint-disable-next-line
|
|
331
|
+
console.error('Error parsing fields prop:', error);
|
|
332
|
+
this.parsedFields = [];
|
|
333
|
+
}
|
|
314
334
|
}
|
|
315
335
|
render() {
|
|
316
|
-
const hiddenFields = this.
|
|
317
|
-
const otherFields = this.
|
|
318
|
-
return (h("form", { key: '
|
|
336
|
+
const hiddenFields = this.parsedFields.filter((field) => field.type === 'hidden');
|
|
337
|
+
const otherFields = this.parsedFields.filter((field) => field.type !== 'hidden');
|
|
338
|
+
return (h("form", { key: '0a106caa8aa9f056b55acf6fecfbc7090c4411d2', ref: (el) => (this.formEl = el), enctype: "multipart/form-data", autocomplete: "on", method: "post", onSubmit: this.handleSubmit }, h("div", { key: '3478d82640378d9a1c0c09394453e2118b1b3ca9' }, h("slot", { key: '9bc37f54c03b2b0f831da917b6ce6bab2ec11084' }), hiddenFields.map((field, index) => (h("eds-input", { key: index, type: "hidden", name: field.name, value: field.value }))), otherFields.map((field, index) => {
|
|
319
339
|
var _a, _b;
|
|
320
340
|
if (!this.isFieldVisible(field)) {
|
|
321
341
|
return null;
|
|
322
342
|
}
|
|
323
343
|
return (h("eds-input-field", { key: index, name: field.name, id: `${this.name}_${field.name}`, label: field.label, type: field.type, icon: field.icon || null, required: field.required, maxLength: field.maxlength, hint: field.hint, error: ((_a = this.errors[field.name]) === null || _a === void 0 ? void 0 : _a.length) > 0, errorMessage: (_b = this.errors[field.name]) === null || _b === void 0 ? void 0 : _b.join('<br />'), onInput: (e) => this.handleChange(e, field), class: index > 0 ? 'mt-20' : '', options: field.options }));
|
|
324
|
-
})), this.submitBtn && (h("div", { key: '
|
|
344
|
+
})), this.submitBtn && (h("div", { key: 'ca221e8c5c18cf4a107581736728f84cea7831d0', class: "mt-20" }, h("eds-button", { key: 'eef3cf052beb62703c1df74d142650194d60c501', intent: "primary", label: this.submitBtnLabel, disabled: this.isSubmitting || (this.coupleAuth && !this.isAuthenticated), loading: this.isSubmitting, onClick: (e) => this.handleSubmit(e) }), this.coupleAuth && !this.isAuthenticated ? (h("p", { class: "f-ui-05 text-lighter mt-8 ml-8" }, this.submitBtnHintMessage)) : null)), this.alertMessage && (this.formSubmitted || this.hasError) && (h("div", { key: '69861c8776b99e26a08585a5a8c893c85a2d9999', class: "mt-20" }, h("eds-alert", { key: 'b4d225d8efcbe6cde95789c367f0ecf94f217c9c', message: this.alertMessage, intent: this.hasError ? 'error' : 'success', direction: "horizontal" })))));
|
|
325
345
|
}
|
|
326
346
|
get el() { return this; }
|
|
347
|
+
static get watchers() { return {
|
|
348
|
+
"fields": ["parseFields"]
|
|
349
|
+
}; }
|
|
327
350
|
static get style() { return EdsFormStyle0; }
|
|
328
351
|
}, [4, "eds-form", {
|
|
329
|
-
"smallAlert": [4, "small-alert"],
|
|
330
352
|
"setFormUrl": [4, "set-form-url"],
|
|
331
353
|
"submitBtn": [4, "submit-btn"],
|
|
332
354
|
"submitBtnLabel": [1, "submit-btn-label"],
|
|
@@ -344,8 +366,11 @@ const EdsForm$1 = /*@__PURE__*/ proxyCustomElement(class EdsForm extends HTMLEle
|
|
|
344
366
|
"isSubmitting": [32],
|
|
345
367
|
"alertMessage": [32],
|
|
346
368
|
"isAuthenticated": [32],
|
|
347
|
-
"authUser": [32]
|
|
348
|
-
|
|
369
|
+
"authUser": [32],
|
|
370
|
+
"parsedFields": [32]
|
|
371
|
+
}, [[16, "authStatusChanged", "onAuthStatusChanged"]], {
|
|
372
|
+
"fields": ["parseFields"]
|
|
373
|
+
}]);
|
|
349
374
|
function defineCustomElement$1() {
|
|
350
375
|
if (typeof customElements === "undefined") {
|
|
351
376
|
return;
|
|
@@ -78,7 +78,7 @@ const EdsInputSelect = /*@__PURE__*/ proxyCustomElement(class EdsInputSelect ext
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h("div", { key: '
|
|
81
|
+
return (h("div", { key: 'd37107564a86281b3a3920a5eb128f47f6fd4ceb', class: "relative" }, h("select", { key: 'a69cd907ef6732ec42a99fd46bbf9a52ef03735a', id: this.inputId || this.name, name: this.name, class: `input invalid:text-lightest pr-32 ${this.error ? 'input-error' : ''}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.hasMessage || this.error ? `${this.name}-error` : '', disabled: this.disabled || this.loading, required: this.required, onChange: this.handleChange }, h("option", { key: '8b84a2b7edd7e989411908b16f35c46853889d8e', value: "", disabled: true, hidden: true }, this.loading ? 'Loading options...' : `Please select ${this.name}`), this.dynamicOptions.map((option, index) => (h("option", { key: index, value: option[this.dynamicValueKey] }, option[this.dynamicLabelKey])))), h("span", { key: 'dbccb6161aafc2dc31cc6dd5b3d8c812545eab9a', class: `bg-dark rounded-xs absolute top-1/2 right-[6px] flex h-28 w-28 -translate-y-1/2 items-center justify-center ${this.disabled || this.loading ? 'text-lightest bg-transparent' : ''}` }, h("eds-icon-wrapper", { key: 'b0fd24cb54185d8558dfabcb94d05b6257caacd1', class: "w-20 h-20", icon: "chevron-right" }))));
|
|
82
82
|
}
|
|
83
83
|
static get watchers() { return {
|
|
84
84
|
"options": ["loadOptions"]
|
|
@@ -147,12 +147,11 @@ const EdsLink = /*@__PURE__*/ proxyCustomElement(class EdsLink extends HTMLEleme
|
|
|
147
147
|
this.hideLabelOnSmallScreen = false;
|
|
148
148
|
this.extraClass = undefined;
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
handleParentContext(event) {
|
|
151
151
|
if (event.target !== this.el) {
|
|
152
152
|
// Ignore the event if it's not targeted at this specific instance
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
//console.log(event.detail);
|
|
156
155
|
this.parentContext = event.detail;
|
|
157
156
|
event.stopPropagation();
|
|
158
157
|
}
|
|
@@ -203,7 +202,7 @@ const EdsLink = /*@__PURE__*/ proxyCustomElement(class EdsLink extends HTMLEleme
|
|
|
203
202
|
const labelClasses = this.hideLabelOnSmallScreen
|
|
204
203
|
? 'hidden lg:flex' // Tailwind example: hidden on small screens, visible on larger
|
|
205
204
|
: '';
|
|
206
|
-
return (h(ComponentType, { key: '
|
|
205
|
+
return (h(ComponentType, { key: '58eb3c1c5c192c2855424864c9e3e9c7a5fe3378', class: `${classes || ''} ${this.extraClass || ''}`, href: !this.disabled ? this.url : undefined, target: this.external && !this.disabled ? '_blank' : undefined, rel: this.external && !this.disabled ? 'noopener noreferrer' : undefined, "aria-label": this.label || this.ariaLabel || undefined, "aria-disabled": this.disabled ? 'true' : null, download: this.download ? '' : undefined, onClick: (event) => this.handleClick(event) }, h("span", { key: 'd4033ba589552f60f8dc7559434a3c035d226de4', class: "z-1 relative inline-flex items-center justify-center" }, this.renderLeftIcon(), h("span", { key: 'ca520cc66febaf8c8ddfd2fd8ee8a13b71a3078d', class: labelClasses }, this.label), this.renderRightIcon())));
|
|
207
206
|
}
|
|
208
207
|
get el() { return this; }
|
|
209
208
|
static get style() { return EdsLinkStyle0; }
|
|
@@ -222,7 +221,7 @@ const EdsLink = /*@__PURE__*/ proxyCustomElement(class EdsLink extends HTMLEleme
|
|
|
222
221
|
"disabled": [4],
|
|
223
222
|
"hideLabelOnSmallScreen": [4, "hide-label-on-small-screen"],
|
|
224
223
|
"extraClass": [1, "extra-class"]
|
|
225
|
-
}, [[0, "parentContext", "
|
|
224
|
+
}, [[0, "parentContext", "handleParentContext"]]]);
|
|
226
225
|
function defineCustomElement() {
|
|
227
226
|
if (typeof customElements === "undefined") {
|
|
228
227
|
return;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import './color.js';
|
|
3
|
+
import { s as sendAnalytics } from './analytics.js';
|
|
2
4
|
import { d as defineCustomElement$3 } from './eds-button2.js';
|
|
3
5
|
import { d as defineCustomElement$2 } from './eds-icon-wrapper2.js';
|
|
4
6
|
|
|
5
|
-
const edsModalCss = ".block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.fixed{position:fixed}.inset-0{inset:0rem}.z-10{z-index:10}.z-50{z-index:50}.max-w-full{max-width:100%}.absolute{position:absolute}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-20{padding-top:1.25rem;padding-bottom:1.25rem}.bg-inverse{background-color:var(--white)}.bg-dark{background-color:var(--grey-300)}.rounded-lg{border-radius:16px}.shadow-lg{--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.grow{flex-grow:1}.-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))}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.border-b-2{border-bottom-width:2px}.border-softer{border-color:rgba(0, 0, 0, .1)}.pb-8{padding-bottom:0.5rem}.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)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.ml-8{margin-left:0.5rem}.pt-8{padding-top:0.5rem}.bg-opacity-90{opacity:0.9}.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}";
|
|
7
|
+
const edsModalCss = ".block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.fixed{position:fixed}.inset-0{inset:0rem}.z-10{z-index:10}.z-50{z-index:50}.max-w-full{max-width:100%}.absolute{position:absolute}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-20{padding-top:1.25rem;padding-bottom:1.25rem}.bg-inverse{background-color:var(--white)}.bg-dark{background-color:var(--grey-300)}.rounded-lg{border-radius:16px}.shadow-lg{--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.p-6{padding:0.375rem}.p-8{padding:0.5rem}.left-1\\/2{left:50%}.left-20{left:1.25rem}.right-20{right:1.25rem}.top-1\\/2{top:50%}.top-20{top:1.25rem}.bottom-20{bottom:1.25rem}.grow{flex-grow:1}.-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))}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.border-b-2{border-bottom-width:2px}.border-softer{border-color:rgba(0, 0, 0, .1)}.pb-8{padding-bottom:0.5rem}.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)}.text-light{color:var(--grey-700)}.text-lighter{color:var(--grey-600)}.text-lightest{color:var(--grey-500)}.ml-8{margin-left:0.5rem}.pt-8{padding-top:0.5rem}.bg-opacity-90{opacity:0.9}.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}";
|
|
6
8
|
const EdsModalStyle0 = edsModalCss;
|
|
7
9
|
|
|
8
10
|
const EdsModal$1 = /*@__PURE__*/ proxyCustomElement(class EdsModal extends HTMLElement {
|
|
@@ -14,33 +16,59 @@ const EdsModal$1 = /*@__PURE__*/ proxyCustomElement(class EdsModal extends HTMLE
|
|
|
14
16
|
this.title = '';
|
|
15
17
|
this.truncate = true;
|
|
16
18
|
this.truncateLines = '1';
|
|
19
|
+
this.position = 'middle';
|
|
17
20
|
}
|
|
18
21
|
getTruncateClass() {
|
|
19
22
|
return this.truncate && this.truncateLines ? `line-clamp-${this.truncateLines}` : '';
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the Tailwind CSS classes to position the modal based on the `position` prop.
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
* @returns {string} The concatenated CSS classes for modal positioning.
|
|
29
|
+
*/
|
|
30
|
+
getModalPositionClasses() {
|
|
31
|
+
switch (this.position) {
|
|
32
|
+
case 'top':
|
|
33
|
+
return 'left-1/2 top-20 -translate-x-1/2';
|
|
34
|
+
case 'bottom':
|
|
35
|
+
return 'left-1/2 bottom-20 -translate-x-1/2';
|
|
36
|
+
case 'left':
|
|
37
|
+
return 'left-20 top-1/2 -translate-y-1/2';
|
|
38
|
+
case 'right':
|
|
39
|
+
return 'right-20 top-1/2 -translate-y-1/2';
|
|
40
|
+
case 'middle':
|
|
41
|
+
default:
|
|
42
|
+
return 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
21
45
|
/**
|
|
22
46
|
* Opens the modal.
|
|
23
47
|
*/
|
|
24
48
|
async open() {
|
|
49
|
+
var _a;
|
|
25
50
|
this.isOpen = true;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
sendAnalytics({
|
|
52
|
+
category: 'ui-component',
|
|
53
|
+
parentContext: null,
|
|
54
|
+
tag: this.el.tagName.toLowerCase(),
|
|
55
|
+
name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
56
|
+
action: 'opened'
|
|
57
|
+
});
|
|
32
58
|
}
|
|
33
59
|
/**
|
|
34
60
|
* Closes the modal.
|
|
35
61
|
*/
|
|
36
62
|
async close() {
|
|
63
|
+
var _a;
|
|
37
64
|
this.isOpen = false;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
65
|
+
sendAnalytics({
|
|
66
|
+
category: 'ui-component',
|
|
67
|
+
parentContext: null,
|
|
68
|
+
tag: this.el.tagName.toLowerCase(),
|
|
69
|
+
name: ((_a = this.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '',
|
|
70
|
+
action: 'closed'
|
|
71
|
+
});
|
|
44
72
|
}
|
|
45
73
|
/**
|
|
46
74
|
* Toggles the modal open or closed.
|
|
@@ -54,30 +82,27 @@ const EdsModal$1 = /*@__PURE__*/ proxyCustomElement(class EdsModal extends HTMLE
|
|
|
54
82
|
*/
|
|
55
83
|
componentDidLoad() {
|
|
56
84
|
// Emit context for each eds-link element after the component is fully loaded
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
this.emitContext(btn);
|
|
60
|
-
});
|
|
85
|
+
//const btn = this.el.shadowRoot.querySelector('eds-button');
|
|
86
|
+
//this.emitContext(btn);
|
|
61
87
|
}
|
|
62
88
|
/**
|
|
63
89
|
* Emits a custom event called `parentContext` for a given button element.
|
|
64
90
|
* This event provides context information about the eds-modal component.
|
|
65
|
-
*
|
|
66
|
-
* @param btnElement - The link element to which the event will be dispatched.
|
|
67
91
|
*/
|
|
68
|
-
emitContext(btnElement) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
92
|
+
/*emitContext(btnElement: HTMLElement) {
|
|
93
|
+
const event = new CustomEvent<ParentContextDetail>('parentContext', {
|
|
94
|
+
detail: {
|
|
95
|
+
componentName: this.el.tagName.toLowerCase(),
|
|
96
|
+
identifier: null
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
btnElement.dispatchEvent(event);
|
|
101
|
+
}*/
|
|
77
102
|
render() {
|
|
78
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'eedcdc49c9f4a16ef4537ec02335757aa1143bd9', class: `${this.isOpen ? 'block' : 'hidden'} fixed inset-0 z-50 flex` }, this.isOpen && (h("div", { key: '2b24903b85895fd5eca389d6897aa85c892e762f', class: "fixed inset-0 bg-dark bg-opacity-90" // Add backdrop-blur utility class here
|
|
79
104
|
,
|
|
80
|
-
onClick: () => this.close() })), h("div", { key: '
|
|
105
|
+
onClick: () => this.close() })), h("div", { key: 'd135a2d9eff1764b6335b9b16be54d8fec7d4112', class: `max-w-full absolute px-20 py-20 bg-inverse rounded-lg shadow-lg z-10 ${this.getModalPositionClasses()} grow justify-center` }, h("div", { key: 'bc8ea6f95443f01d3e5b88953581e1f2eae4009c', class: "flex justify-between items-center border-b-2 border-softer pb-8" }, h("span", { key: '872b9a4bf44db478d38f18d3459a816c119f352d', class: `f-heading-04 text-lighter ${this.getTruncateClass()}` }, this.title), h("eds-button", { key: 'bdf27a3f564d295383985cb1f0ce7df7f13a97fb', intent: "tertiary", icon: "close", "aria-label": "Close modal", onClick: () => this.close(), "extra-class": "ml-8" })), h("div", { key: '600cc4d544d0a41d9d2be74aedbb0d2fe2028141', class: "pt-8" }, h("slot", { key: '8ce560804a6d960b4075e4b6d1607dda6530c08d' })))));
|
|
81
106
|
}
|
|
82
107
|
get el() { return this; }
|
|
83
108
|
static get style() { return EdsModalStyle0; }
|
|
@@ -85,6 +110,7 @@ const EdsModal$1 = /*@__PURE__*/ proxyCustomElement(class EdsModal extends HTMLE
|
|
|
85
110
|
"title": [1],
|
|
86
111
|
"truncate": [4],
|
|
87
112
|
"truncateLines": [1, "truncate-lines"],
|
|
113
|
+
"position": [1],
|
|
88
114
|
"isOpen": [32],
|
|
89
115
|
"open": [64],
|
|
90
116
|
"close": [64],
|