@itcenteratunihelsinki/huds-lib 0.8.89 → 0.8.90

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.
@@ -70,7 +70,7 @@ const LinkBox = /*@__PURE__*/ proxyCustomElement(class LinkBox extends H {
70
70
  };
71
71
  return [
72
72
  h("article", { key: 'd66398c2e146bdfb114a7df6e9ac9a46e0bb1181', class: classContainerAttributes }, h("div", { key: '034dbd08272bf8d14646c61f100c328643309730', class: classAttributes }, this.imageUrl &&
73
- (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: 'ec3a4c3c5468dd8cfa832b32c9b2e5de93dbbccb', class: classTitle }, this.textTitle), this.textDescription && (h("p", { key: '2287836632c27b812675f97c2a326c5c6688ffba', class: classDescription }, this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription)))), h("a", { key: 'e6a1f88304688d2393174f74a75d6074eec3df88', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'bb5b4dd980f55b67dea7c06baca3c56dd08c79d0', "aria-hidden": "true" }), h("span", { key: '9b43019cd8d8a60b54d751144958b76fc021d3fb' }, this.readMoreLabel), h("span", { key: 'ffddc98795e5810d3a05ba593f3063169774f892', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '21accddb6e934ac38507e8fe0b3f6f5990581531', icon: "hy-icon-arrow-to-right", size: 24 })))),
73
+ (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: '1aa734fe8717d0ba44efa495bb92c8a5a58e1430', class: classTitle, innerHTML: this.textTitle }), this.textDescription && (h("p", { key: '8f00cfb1b3cbb2036a1007e90321d3a12ac08308', class: classDescription, innerHTML: this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription })))), h("a", { key: 'eb1fab1765d75d53d01f50de210048c640873fe3', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'c36c8d6d55c68096592787b8482c1def9c394e9e', "aria-hidden": "true" }), h("span", { key: 'f90967f30756db358c74a448329014ffb78c54e3' }, this.readMoreLabel), h("span", { key: '527928255a66bbddd03ed84a2c22a2306c343b5e', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '840e7fbeebaa6633655d3227b9144cf959a6ae5f', icon: "hy-icon-arrow-to-right", size: 24 })))),
74
74
  ];
75
75
  }
76
76
  get el() { return this; }
@@ -73,7 +73,7 @@ const LinkBox = class {
73
73
  };
74
74
  return [
75
75
  index.h("article", { key: 'd66398c2e146bdfb114a7df6e9ac9a46e0bb1181', class: classContainerAttributes }, index.h("div", { key: '034dbd08272bf8d14646c61f100c328643309730', class: classAttributes }, this.imageUrl &&
76
- (this._sourceSet ? (index.h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, index.h("picture", null, this._sourceSet.map((item) => (index.h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), index.h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (index.h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, index.h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (index.h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, index.h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), index.h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, index.h("h3", { key: 'ec3a4c3c5468dd8cfa832b32c9b2e5de93dbbccb', class: classTitle }, this.textTitle), this.textDescription && (index.h("p", { key: '2287836632c27b812675f97c2a326c5c6688ffba', class: classDescription }, this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription)))), index.h("a", { key: 'e6a1f88304688d2393174f74a75d6074eec3df88', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, index.h("span", { key: 'bb5b4dd980f55b67dea7c06baca3c56dd08c79d0', "aria-hidden": "true" }), index.h("span", { key: '9b43019cd8d8a60b54d751144958b76fc021d3fb' }, this.readMoreLabel), index.h("span", { key: 'ffddc98795e5810d3a05ba593f3063169774f892', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, index.h("hy-icon", { key: '21accddb6e934ac38507e8fe0b3f6f5990581531', icon: "hy-icon-arrow-to-right", size: 24 })))),
76
+ (this._sourceSet ? (index.h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, index.h("picture", null, this._sourceSet.map((item) => (index.h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), index.h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (index.h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, index.h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (index.h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, index.h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), index.h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, index.h("h3", { key: '1aa734fe8717d0ba44efa495bb92c8a5a58e1430', class: classTitle, innerHTML: this.textTitle }), this.textDescription && (index.h("p", { key: '8f00cfb1b3cbb2036a1007e90321d3a12ac08308', class: classDescription, innerHTML: this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription })))), index.h("a", { key: 'eb1fab1765d75d53d01f50de210048c640873fe3', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, index.h("span", { key: 'c36c8d6d55c68096592787b8482c1def9c394e9e', "aria-hidden": "true" }), index.h("span", { key: 'f90967f30756db358c74a448329014ffb78c54e3' }, this.readMoreLabel), index.h("span", { key: '527928255a66bbddd03ed84a2c22a2306c343b5e', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, index.h("hy-icon", { key: '840e7fbeebaa6633655d3227b9144cf959a6ae5f', icon: "hy-icon-arrow-to-right", size: 24 })))),
77
77
  ];
78
78
  }
79
79
  get el() { return index.getElement(this); }
@@ -63,7 +63,7 @@ export class LinkBox {
63
63
  };
64
64
  return [
65
65
  h("article", { key: 'd66398c2e146bdfb114a7df6e9ac9a46e0bb1181', class: classContainerAttributes }, h("div", { key: '034dbd08272bf8d14646c61f100c328643309730', class: classAttributes }, this.imageUrl &&
66
- (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: 'ec3a4c3c5468dd8cfa832b32c9b2e5de93dbbccb', class: classTitle }, this.textTitle), this.textDescription && (h("p", { key: '2287836632c27b812675f97c2a326c5c6688ffba', class: classDescription }, this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription)))), h("a", { key: 'e6a1f88304688d2393174f74a75d6074eec3df88', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'bb5b4dd980f55b67dea7c06baca3c56dd08c79d0', "aria-hidden": "true" }), h("span", { key: '9b43019cd8d8a60b54d751144958b76fc021d3fb' }, this.readMoreLabel), h("span", { key: 'ffddc98795e5810d3a05ba593f3063169774f892', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '21accddb6e934ac38507e8fe0b3f6f5990581531', icon: "hy-icon-arrow-to-right", size: 24 })))),
66
+ (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: '1aa734fe8717d0ba44efa495bb92c8a5a58e1430', class: classTitle, innerHTML: this.textTitle }), this.textDescription && (h("p", { key: '8f00cfb1b3cbb2036a1007e90321d3a12ac08308', class: classDescription, innerHTML: this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription })))), h("a", { key: 'eb1fab1765d75d53d01f50de210048c640873fe3', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'c36c8d6d55c68096592787b8482c1def9c394e9e', "aria-hidden": "true" }), h("span", { key: 'f90967f30756db358c74a448329014ffb78c54e3' }, this.readMoreLabel), h("span", { key: '527928255a66bbddd03ed84a2c22a2306c343b5e', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '840e7fbeebaa6633655d3227b9144cf959a6ae5f', icon: "hy-icon-arrow-to-right", size: 24 })))),
67
67
  ];
68
68
  }
69
69
  static get is() { return "hy-link-box"; }
@@ -69,7 +69,7 @@ const LinkBox = class {
69
69
  };
70
70
  return [
71
71
  h("article", { key: 'd66398c2e146bdfb114a7df6e9ac9a46e0bb1181', class: classContainerAttributes }, h("div", { key: '034dbd08272bf8d14646c61f100c328643309730', class: classAttributes }, this.imageUrl &&
72
- (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: 'ec3a4c3c5468dd8cfa832b32c9b2e5de93dbbccb', class: classTitle }, this.textTitle), this.textDescription && (h("p", { key: '2287836632c27b812675f97c2a326c5c6688ffba', class: classDescription }, this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription)))), h("a", { key: 'e6a1f88304688d2393174f74a75d6074eec3df88', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'bb5b4dd980f55b67dea7c06baca3c56dd08c79d0', "aria-hidden": "true" }), h("span", { key: '9b43019cd8d8a60b54d751144958b76fc021d3fb' }, this.readMoreLabel), h("span", { key: 'ffddc98795e5810d3a05ba593f3063169774f892', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '21accddb6e934ac38507e8fe0b3f6f5990581531', icon: "hy-icon-arrow-to-right", size: 24 })))),
72
+ (this._sourceSet ? (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("picture", null, this._sourceSet.map((item) => (h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : "" }))), h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))) : (h("figure", { class: "hy-link-box__image-container", style: aspectRatio }, h("img", { loading: this.disableLazy ? "eager" : "lazy", "aria-hidden": "true", src: this.imageUrl, alt: this.imageAlt })))), !this.imageUrl && this.showLogo && (h("div", { key: '9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2', "aria-hidden": "true", class: "hy-link-box__image-container is-image-missing" }, h("hy-icon", { key: '8077a642704366f4ecbf951ffc4c9d86edec47cc', class: { "hy-site-logo__icon": true }, icon: "hy-icon-hy-logo" }))), h("div", { key: '69dac608e446585af251ea70e12a6079a80de312', class: classTextContainer }, h("h3", { key: '1aa734fe8717d0ba44efa495bb92c8a5a58e1430', class: classTitle, innerHTML: this.textTitle }), this.textDescription && (h("p", { key: '8f00cfb1b3cbb2036a1007e90321d3a12ac08308', class: classDescription, innerHTML: this.textDescription.length >= 141 ? this.textDescription.slice(0, 140) + "..." : this.textDescription })))), h("a", { key: 'eb1fab1765d75d53d01f50de210048c640873fe3', "aria-label": this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, title: this.scLabel || `${this.readMoreLabel} - ${this.textTitle}`, href: this.url, target: target, class: `hy-cta-link hy-cta-link--default` }, h("span", { key: 'c36c8d6d55c68096592787b8482c1def9c394e9e', "aria-hidden": "true" }), h("span", { key: 'f90967f30756db358c74a448329014ffb78c54e3' }, this.readMoreLabel), h("span", { key: '527928255a66bbddd03ed84a2c22a2306c343b5e', class: `hy-cta-link__icon ${this.isExternal ? "hy-cta-link__icon--external" : ""}` }, h("hy-icon", { key: '840e7fbeebaa6633655d3227b9144cf959a6ae5f', icon: "hy-icon-arrow-to-right", size: 24 })))),
73
73
  ];
74
74
  }
75
75
  get el() { return getElement(this); }
@@ -1 +1 @@
1
- import{r as i,h as t,g as e,H as n}from"./index-2ffe17c9.js";import{l as a}from"./utils-1e7f5184.js";import{j as o}from"./globalScript-7f6ce018.js";const s=class{constructor(t){i(this,t),this.variant=a.default,this.imageUrl=null,this.imageAlt=null,this.disableLazy=!1,this.useSlot=!1,this.showLogo=!1,this.textTitle=void 0,this.textDescription=null,this.url=void 0,this.isExternal=!1,this.scLabel=void 0,this.readMoreLabel=void 0,this.headerstyle="common",this.sourceSet=void 0}srcSetWatcher(i){this._sourceSet="string"==typeof i?JSON.parse(i):i}componentWillLoad(){this.srcSetWatcher(this.sourceSet)}componentDidLoad(){let i=this.el.closest(".hy-main");i&&(i.classList.contains("with-sidebar")||(this.headerstyle="large"))}render(){const i=["hy-link-box-container"].join(" "),e=["hy-link-box",this.variant,`hy-link-box__${this.variant}`,this.headerstyle,`hy-link-box__${this.headerstyle}`,this.imageUrl?"hy-link-box--with-image":null].join(" "),n=["hy-link-box__text-container",this.imageUrl?"hy-link-box--with-image":null].join(" "),a=["hy-link-box__text-container__title",`hy-link-box__text-container__title__${this.variant}`,`hy-link-box__text-container__title__${this.headerstyle}`,this.imageUrl?"hy-link-box__text-container__title__image":"",this.imageUrl?"image":""].join(" "),o=["hy-link-box__text-container__description",`hy-link-box__text-container__description__${this.variant}`,`hy-link-box__text-container__description__${this.headerstyle}`].join(" "),s=this.isExternal?"_blank":"_self";return[t("article",{key:"d66398c2e146bdfb114a7df6e9ac9a46e0bb1181",class:i},t("div",{key:"034dbd08272bf8d14646c61f100c328643309730",class:e},this.imageUrl&&t("figure",{class:"hy-link-box__image-container",style:{"--aspectRatio":"62.5%"}},this._sourceSet?t("picture",null,this._sourceSet.map((i=>t("source",{srcSet:i.src,media:i.media,type:i.type,sizes:i.sizes?i.sizes:""}))),t("img",{loading:this.disableLazy?"eager":"lazy","aria-hidden":"true",src:this.imageUrl,alt:this.imageAlt})):t("img",{loading:this.disableLazy?"eager":"lazy","aria-hidden":"true",src:this.imageUrl,alt:this.imageAlt})),!this.imageUrl&&this.showLogo&&t("div",{key:"9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2","aria-hidden":"true",class:"hy-link-box__image-container is-image-missing"},t("hy-icon",{key:"8077a642704366f4ecbf951ffc4c9d86edec47cc",class:{"hy-site-logo__icon":!0},icon:"hy-icon-hy-logo"})),t("div",{key:"69dac608e446585af251ea70e12a6079a80de312",class:n},t("h3",{key:"ec3a4c3c5468dd8cfa832b32c9b2e5de93dbbccb",class:a},this.textTitle),this.textDescription&&t("p",{key:"2287836632c27b812675f97c2a326c5c6688ffba",class:o},this.textDescription.length>=141?this.textDescription.slice(0,140)+"...":this.textDescription))),t("a",{key:"e6a1f88304688d2393174f74a75d6074eec3df88","aria-label":this.scLabel||`${this.readMoreLabel} - ${this.textTitle}`,title:this.scLabel||`${this.readMoreLabel} - ${this.textTitle}`,href:this.url,target:s,class:"hy-cta-link hy-cta-link--default"},t("span",{key:"bb5b4dd980f55b67dea7c06baca3c56dd08c79d0","aria-hidden":"true"}),t("span",{key:"9b43019cd8d8a60b54d751144958b76fc021d3fb"},this.readMoreLabel),t("span",{key:"ffddc98795e5810d3a05ba593f3063169774f892",class:"hy-cta-link__icon "+(this.isExternal?"hy-cta-link__icon--external":"")},t("hy-icon",{key:"21accddb6e934ac38507e8fe0b3f6f5990581531",icon:"hy-icon-arrow-to-right",size:24}))))]}get el(){return e(this)}static get watchers(){return{sourceSet:["srcSetWatcher"]}}};s.style='*{-webkit-box-sizing:border-box;box-sizing:border-box}:host{height:100%}.hy-link-box-container{background:var(--grayscale-background-box);width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:100%;position:relative}.hy-link-box-container:focus-within{outline:auto}.hy-link-box-container:hover{cursor:pointer}.hy-link-box-container:hover .hy-link-box__text-container__title{color:var(--brand-main);text-decoration:underline}.hy-link-box-container:hover .hy-cta-link{text-decoration:underline}.hy-link-box-container:hover .hy-cta-link .hy-cta-link__icon{background-color:var(--brand-main)}.hy-link-box-container .hy-cta-link{font-weight:600;font-size:1rem;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--brand-main);display:inline-grid;font-family:var(--main-font-family);gap:16px;grid-auto-flow:column;letter-spacing:-0.5px;overflow:hidden;text-decoration:none;margin:0 -8px 24px 0;align-self:flex-end}.hy-link-box-container .hy-cta-link span[aria-hidden=true]{position:absolute;inset:0}.hy-link-box-container .hy-cta-link:focus{outline:none}.hy-link-box-container .hy-cta-link__icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--brand-main-light);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:40px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:40px}.hy-link-box-container .hy-cta-link__icon svg{fill:var(--grayscale-white)}.hy-link-box-container .hy-cta-link__icon--external svg{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.hy-link-box__image-container{margin:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:stretch;-ms-flex-pack:stretch;justify-content:stretch;min-height:10rem;position:relative}.hy-link-box__image-container:before{content:"";display:block;padding-top:62.5%;width:100%}.hy-link-box__image-container img{bottom:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;right:0;top:0;width:100%}.hy-link-box__image-container.is-image-missing svg{position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);left:50%;width:85px;height:auto;fill:#d2d2d2}.hy-link-box__text-container{padding:16px}.hy-link-box__text-container__title{font-size:1.3125rem;line-height:28px;font-weight:700;color:var(--brand-main-nearly-black);font-family:var(--main-font-family);letter-spacing:-0.42px;-ms-hyphens:auto;hyphens:auto;word-break:break-word;margin:0 0 16px;text-wrap:balance}@media screen and (min-width: 1024px){.hy-link-box__text-container__title{font-size:1.5625rem;line-height:32px;letter-spacing:-0.5px}}.hy-link-box__text-container__description{font-size:0.9375rem;line-height:22px;color:var(--grayscale-black);font-family:var(--main-font-family);-ms-hyphens:auto;hyphens:auto;margin:0;text-wrap:pretty}@media screen and (min-width: 1024px){.hy-link-box__text-container__description{font-size:1.0625rem;line-height:26px}}';const l=class{constructor(t){i(this,t),this.headerstyle="common",this.variant=a.default,this.readMoreLabel=void 0,this.dataItems=void 0}async componentWillLoad(){this._dataItems=await o(this.dataItems)}componentDidLoad(){let i=this.el.closest(".hy-main");i&&(i.classList.contains("with-sidebar")||(this.headerstyle="large"))}render(){const i=["hy-link-box-list",this.variant,`hy-link-box-list__${this.variant}`,`hy-link-box-list__${this.headerstyle}`].join(" "),e=[this.variant,`hy-link-box__${this.variant}`].join(" ");return t(n,{key:"e03e2f8c30348873286da0eee4d71593a04f0f41"},t("ul",{key:"8d01eac632b7b94df38f38dd029b329b14569ade",class:i},this._dataItems.map((i=>t("li",null,t("hy-link-box",{class:e,variant:this.variant,"source-set":i.imageSets,"image-url":i.imageUrl,"image-alt":i.imageAlt,"text-title":i.heading,"text-description":i.description,"show-logo":i.showLogo,url:i.boxUrl,"is-external":i.isExternal,"sc-label":i.ariaLabel,"read-more-label":this.readMoreLabel}))))),t("hy-box",{key:"2ed3ba6e604b1976c2d108584606a295c1a3fdbf",mb:"1.75, 1.75, 2, 2.5"}))}get el(){return e(this)}};l.style="*{-webkit-box-sizing:border-box;box-sizing:border-box}:host{display:block}.hy-link-box-list{padding:0;margin:0;list-style:none;display:grid;gap:32px 0}@media screen and (min-width: 768px){.hy-link-box-list{grid-template-columns:repeat(2, minmax(0, 1fr));gap:32px 24px}}@media screen and (min-width: 1024px){.hy-link-box-list{grid-template-columns:repeat(3, minmax(0, 1fr))}}@media screen and (min-width: 1920px){.hy-link-box-list{gap:32px}}";export{s as hy_link_box,l as hy_link_box_list}
1
+ import{r as i,h as t,g as e,H as n}from"./index-2ffe17c9.js";import{l as a}from"./utils-1e7f5184.js";import{j as o}from"./globalScript-7f6ce018.js";const s=class{constructor(t){i(this,t),this.variant=a.default,this.imageUrl=null,this.imageAlt=null,this.disableLazy=!1,this.useSlot=!1,this.showLogo=!1,this.textTitle=void 0,this.textDescription=null,this.url=void 0,this.isExternal=!1,this.scLabel=void 0,this.readMoreLabel=void 0,this.headerstyle="common",this.sourceSet=void 0}srcSetWatcher(i){this._sourceSet="string"==typeof i?JSON.parse(i):i}componentWillLoad(){this.srcSetWatcher(this.sourceSet)}componentDidLoad(){let i=this.el.closest(".hy-main");i&&(i.classList.contains("with-sidebar")||(this.headerstyle="large"))}render(){const i=["hy-link-box-container"].join(" "),e=["hy-link-box",this.variant,`hy-link-box__${this.variant}`,this.headerstyle,`hy-link-box__${this.headerstyle}`,this.imageUrl?"hy-link-box--with-image":null].join(" "),n=["hy-link-box__text-container",this.imageUrl?"hy-link-box--with-image":null].join(" "),a=["hy-link-box__text-container__title",`hy-link-box__text-container__title__${this.variant}`,`hy-link-box__text-container__title__${this.headerstyle}`,this.imageUrl?"hy-link-box__text-container__title__image":"",this.imageUrl?"image":""].join(" "),o=["hy-link-box__text-container__description",`hy-link-box__text-container__description__${this.variant}`,`hy-link-box__text-container__description__${this.headerstyle}`].join(" "),s=this.isExternal?"_blank":"_self";return[t("article",{key:"d66398c2e146bdfb114a7df6e9ac9a46e0bb1181",class:i},t("div",{key:"034dbd08272bf8d14646c61f100c328643309730",class:e},this.imageUrl&&t("figure",{class:"hy-link-box__image-container",style:{"--aspectRatio":"62.5%"}},this._sourceSet?t("picture",null,this._sourceSet.map((i=>t("source",{srcSet:i.src,media:i.media,type:i.type,sizes:i.sizes?i.sizes:""}))),t("img",{loading:this.disableLazy?"eager":"lazy","aria-hidden":"true",src:this.imageUrl,alt:this.imageAlt})):t("img",{loading:this.disableLazy?"eager":"lazy","aria-hidden":"true",src:this.imageUrl,alt:this.imageAlt})),!this.imageUrl&&this.showLogo&&t("div",{key:"9bb6d340f5c68d1351e79bc99e50b5a24dde1cc2","aria-hidden":"true",class:"hy-link-box__image-container is-image-missing"},t("hy-icon",{key:"8077a642704366f4ecbf951ffc4c9d86edec47cc",class:{"hy-site-logo__icon":!0},icon:"hy-icon-hy-logo"})),t("div",{key:"69dac608e446585af251ea70e12a6079a80de312",class:n},t("h3",{key:"1aa734fe8717d0ba44efa495bb92c8a5a58e1430",class:a,innerHTML:this.textTitle}),this.textDescription&&t("p",{key:"8f00cfb1b3cbb2036a1007e90321d3a12ac08308",class:o,innerHTML:this.textDescription.length>=141?this.textDescription.slice(0,140)+"...":this.textDescription}))),t("a",{key:"eb1fab1765d75d53d01f50de210048c640873fe3","aria-label":this.scLabel||`${this.readMoreLabel} - ${this.textTitle}`,title:this.scLabel||`${this.readMoreLabel} - ${this.textTitle}`,href:this.url,target:s,class:"hy-cta-link hy-cta-link--default"},t("span",{key:"c36c8d6d55c68096592787b8482c1def9c394e9e","aria-hidden":"true"}),t("span",{key:"f90967f30756db358c74a448329014ffb78c54e3"},this.readMoreLabel),t("span",{key:"527928255a66bbddd03ed84a2c22a2306c343b5e",class:"hy-cta-link__icon "+(this.isExternal?"hy-cta-link__icon--external":"")},t("hy-icon",{key:"840e7fbeebaa6633655d3227b9144cf959a6ae5f",icon:"hy-icon-arrow-to-right",size:24}))))]}get el(){return e(this)}static get watchers(){return{sourceSet:["srcSetWatcher"]}}};s.style='*{-webkit-box-sizing:border-box;box-sizing:border-box}:host{height:100%}.hy-link-box-container{background:var(--grayscale-background-box);width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:100%;position:relative}.hy-link-box-container:focus-within{outline:auto}.hy-link-box-container:hover{cursor:pointer}.hy-link-box-container:hover .hy-link-box__text-container__title{color:var(--brand-main);text-decoration:underline}.hy-link-box-container:hover .hy-cta-link{text-decoration:underline}.hy-link-box-container:hover .hy-cta-link .hy-cta-link__icon{background-color:var(--brand-main)}.hy-link-box-container .hy-cta-link{font-weight:600;font-size:1rem;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--brand-main);display:inline-grid;font-family:var(--main-font-family);gap:16px;grid-auto-flow:column;letter-spacing:-0.5px;overflow:hidden;text-decoration:none;margin:0 -8px 24px 0;align-self:flex-end}.hy-link-box-container .hy-cta-link span[aria-hidden=true]{position:absolute;inset:0}.hy-link-box-container .hy-cta-link:focus{outline:none}.hy-link-box-container .hy-cta-link__icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--brand-main-light);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:40px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:40px}.hy-link-box-container .hy-cta-link__icon svg{fill:var(--grayscale-white)}.hy-link-box-container .hy-cta-link__icon--external svg{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.hy-link-box__image-container{margin:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:stretch;-ms-flex-pack:stretch;justify-content:stretch;min-height:10rem;position:relative}.hy-link-box__image-container:before{content:"";display:block;padding-top:62.5%;width:100%}.hy-link-box__image-container img{bottom:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;right:0;top:0;width:100%}.hy-link-box__image-container.is-image-missing svg{position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);left:50%;width:85px;height:auto;fill:#d2d2d2}.hy-link-box__text-container{padding:16px}.hy-link-box__text-container__title{font-size:1.3125rem;line-height:28px;font-weight:700;color:var(--brand-main-nearly-black);font-family:var(--main-font-family);letter-spacing:-0.42px;-ms-hyphens:auto;hyphens:auto;word-break:break-word;margin:0 0 16px;text-wrap:balance}@media screen and (min-width: 1024px){.hy-link-box__text-container__title{font-size:1.5625rem;line-height:32px;letter-spacing:-0.5px}}.hy-link-box__text-container__description{font-size:0.9375rem;line-height:22px;color:var(--grayscale-black);font-family:var(--main-font-family);-ms-hyphens:auto;hyphens:auto;margin:0;text-wrap:pretty}@media screen and (min-width: 1024px){.hy-link-box__text-container__description{font-size:1.0625rem;line-height:26px}}';const l=class{constructor(t){i(this,t),this.headerstyle="common",this.variant=a.default,this.readMoreLabel=void 0,this.dataItems=void 0}async componentWillLoad(){this._dataItems=await o(this.dataItems)}componentDidLoad(){let i=this.el.closest(".hy-main");i&&(i.classList.contains("with-sidebar")||(this.headerstyle="large"))}render(){const i=["hy-link-box-list",this.variant,`hy-link-box-list__${this.variant}`,`hy-link-box-list__${this.headerstyle}`].join(" "),e=[this.variant,`hy-link-box__${this.variant}`].join(" ");return t(n,{key:"e03e2f8c30348873286da0eee4d71593a04f0f41"},t("ul",{key:"8d01eac632b7b94df38f38dd029b329b14569ade",class:i},this._dataItems.map((i=>t("li",null,t("hy-link-box",{class:e,variant:this.variant,"source-set":i.imageSets,"image-url":i.imageUrl,"image-alt":i.imageAlt,"text-title":i.heading,"text-description":i.description,"show-logo":i.showLogo,url:i.boxUrl,"is-external":i.isExternal,"sc-label":i.ariaLabel,"read-more-label":this.readMoreLabel}))))),t("hy-box",{key:"2ed3ba6e604b1976c2d108584606a295c1a3fdbf",mb:"1.75, 1.75, 2, 2.5"}))}get el(){return e(this)}};l.style="*{-webkit-box-sizing:border-box;box-sizing:border-box}:host{display:block}.hy-link-box-list{padding:0;margin:0;list-style:none;display:grid;gap:32px 0}@media screen and (min-width: 768px){.hy-link-box-list{grid-template-columns:repeat(2, minmax(0, 1fr));gap:32px 24px}}@media screen and (min-width: 1024px){.hy-link-box-list{grid-template-columns:repeat(3, minmax(0, 1fr))}}@media screen and (min-width: 1920px){.hy-link-box-list{gap:32px}}";export{s as hy_link_box,l as hy_link_box_list}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcenteratunihelsinki/huds-lib",
3
- "version": "0.8.89",
3
+ "version": "0.8.90",
4
4
  "description": "Helsinki University Design System library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -71,5 +71,5 @@
71
71
  "pre-commit": "pretty-quick --staged"
72
72
  }
73
73
  },
74
- "gitHead": "e51a77bff93970fef232de17b3bff4578d1c9367"
74
+ "gitHead": "e376083ded4e67aa758dfe32bfe3e35eecf97288"
75
75
  }