@itcenteratunihelsinki/huds-lib 0.7.1 → 0.7.2

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.
@@ -335,6 +335,7 @@ export namespace Components {
335
335
  interface HyEvents {
336
336
  "scrollLeftLabel": string;
337
337
  "scrollRightLabel": string;
338
+ "showMore": boolean;
338
339
  "styleGrid": boolean;
339
340
  "viewAllLabel": string;
340
341
  "viewAllUrl": string;
@@ -1908,6 +1909,7 @@ declare namespace LocalJSX {
1908
1909
  interface HyEvents {
1909
1910
  "scrollLeftLabel"?: string;
1910
1911
  "scrollRightLabel"?: string;
1912
+ "showMore"?: boolean;
1911
1913
  "styleGrid"?: boolean;
1912
1914
  "viewAllLabel"?: string;
1913
1915
  "viewAllUrl"?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcenteratunihelsinki/huds-lib",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Helsinki University Design System library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,h as i,g as t}from"./p-f8697bf9.js";let n=class{constructor(i){e(this,i),this.eventDescription="",this.dateShort="",this.dateLong="",this.location="",this.styleGrid=!1,this.readMoreLabel="Read more",this.isLong=!1}componentDidLoad(){this.styleGrid&&this.el.clientHeight>225&&(this.isLong=!0)}render(){const e=["hy-events__item",this.styleGrid?"hy-events__item--grid":"hy-events__item--list",this.isLong?"is-long":""].join(" ");return i("a",{href:this.url,class:e},i("div",{class:"hy-events__item--container"},i("div",{class:"hy-events__item__top-container"},i("span",{class:"hy-events__item__date--short"},this.dateShort),this.isLong&&i("span",{class:"hy-events__item--toggle"},i("hy-icon",{icon:"hy-icon-caret-down",size:10}))),i("div",{class:"hy-events__item__details"},i("div",{class:"hy-events__item__title"},this.eventTitle),i("div",{class:"hy-events__item__meta"},this.dateLong&&i("div",{class:"hy-events__item__meta--item hy-events__item__date--long"},i("hy-icon",{icon:"hy-icon-events",size:18}),this.dateLong),this.location&&i("div",{class:"hy-events__item__meta--item hy-events__item__location"},i("hy-icon",{icon:"hy-icon-location",size:18}),this.location),this.type&&i("div",{class:"hy-events__item__meta--item hy-events__item__type"},i("hy-icon",{icon:"hy-icon-people",size:18}),this.type),i("span",{class:"hy-events__item__read-more"},this.readMoreLabel))),i("span",{class:"hy-events__item__url-icon","aria-hidden":"true"},i("hy-icon",{icon:"hy-icon-arrow-right",size:18}))))}get el(){return t(this)}};n.style=':root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}.hy-events__item{display:-webkit-box;display:-ms-flexbox;display:flex;border:1px solid #d8d8d8;padding:13px 16px;position:relative;text-decoration:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;white-space:initial;margin-bottom:1rem}@media (min-width: 48rem){.hy-events__item{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;padding:47px;margin-bottom:1.75rem}}.hy-events__item:not(.hy-events__item--grid) .hy-events__item--container{display:-webkit-box;display:-ms-flexbox;display:flex}.hy-events__item:hover .hy-events__item__title{color:var(--brand-main);text-decoration:underline}.hy-events__item:hover .hy-events__item__date--short,.hy-events__item:hover .hy-events__item__url-icon{background-color:var(--brand-main-active)}.hy-events__item__title{font-size:1.125rem;line-height:24px;color:var(--grayscale-black);font-family:var(--main-font-family);font-weight:700;letter-spacing:-0.36px;margin-bottom:16px}@media (min-width: 48rem){.hy-events__item__title{font-size:1.375rem;line-height:28px;font-weight:700;font-size:22px;line-height:28px;letter-spacing:-0.44px;margin-bottom:14px}}.hy-events__item__details{font-family:var(--main-font-family);font-style:normal;font-weight:400;font-size:17px;line-height:26px;color:var(--grayscale-black)}.hy-events__item__meta{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}@media (min-width: 48rem){.hy-events__item__meta{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}.hy-events__item__meta--item{font-size:0.9375rem;line-height:22px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin-right:0px;margin-bottom:9px;font-family:var(--main-font-family);font-weight:400}@media (min-width: 48rem){.hy-events__item__meta--item{font-size:1.0625rem;line-height:26px;margin-right:35px;margin-bottom:0;font-weight:400}}.hy-events__item__meta--item svg{width:20px;height:20px;margin-right:9px}.hy-events__item__date--short{font-size:0.9375rem;line-height:18px;display:-webkit-box;display:-ms-flexbox;display:flex;color:var(--grayscale-white);background:var(--brand-main-light);font-family:var(--main-font-family);font-style:normal;font-weight:700;padding:6px 8px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;text-align:center;letter-spacing:-0.28125px;text-decoration:none;margin-bottom:20px;margin-right:0}@media (min-width: 48rem){.hy-events__item__date--short{font-size:1.0625rem;line-height:20px;letter-spacing:-0.31875px;padding:0;height:68px;width:68px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-right:47px;margin-bottom:0}}.hy-events__item__url-icon{display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;background:var(--brand-main-light);color:var(--grayscale-white);width:32px;height:32px;bottom:16px;right:-9px;z-index:1}@media (min-width: 48rem){.hy-events__item__url-icon{display:-webkit-box;display:-ms-flexbox;display:flex}}.hy-events__item__url-icon svg{fill:currentColor}.hy-events__item__read-more{font-size:0.9375rem;line-height:18px;color:var(--brand-main-light);font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;letter-spacing:-0.28125px;margin-top:10px}@media (min-width: 48rem){.hy-events__item__read-more{display:none}}.hy-events__item--grid{padding:1rem;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:280px;max-width:100%;min-height:225px;position:relative;margin-bottom:0}@media (min-width: 48rem){.hy-events__item--grid{max-width:280px;padding:1rem 1rem 0 1rem}}.hy-events__item--grid.is-long{max-height:100%}@media (min-width: 48rem){.hy-events__item--grid.is-long{max-height:225px}}.hy-events__item--grid.is-long::after{display:none;content:"";background:-webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#ffffff));background:linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);position:absolute;bottom:0;left:0;width:100%;height:36px}@media (min-width: 48rem){.hy-events__item--grid.is-long::after{display:block}}.hy-events__item--grid.is-long .hy-events__item--container{overflow:visible}@media (min-width: 48rem){.hy-events__item--grid.is-long .hy-events__item--container{overflow:hidden}}@media (min-width: 48rem){.hy-events__item--grid.is-long:hover,.hy-events__item--grid.is-long:focus{border:0}}.hy-events__item--grid.is-long:hover::after,.hy-events__item--grid.is-long:hover .hy-events__item--toggle,.hy-events__item--grid.is-long:focus::after,.hy-events__item--grid.is-long:focus .hy-events__item--toggle{display:none}.hy-events__item--grid.is-long:hover .hy-events__item--container,.hy-events__item--grid.is-long:focus .hy-events__item--container{background-color:white;position:relative;border:1px solid #d8d8d8;padding:16px 16px}@media (min-width: 48rem){.hy-events__item--grid.is-long:hover .hy-events__item--container,.hy-events__item--grid.is-long:focus .hy-events__item--container{position:absolute;top:0;left:0;overflow:visible}}.hy-events__item--grid .hy-events__item__title{font-size:1.125rem;line-height:24px;letter-spacing:-0.36px}.hy-events__item--grid .hy-events__item--toggle{display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background:#d7d7d7;border-radius:50%;position:absolute;top:16px;right:16px;width:24px;height:24px}@media (min-width: 48rem){.hy-events__item--grid .hy-events__item--toggle{display:-webkit-box;display:-ms-flexbox;display:flex}}.hy-events__item--grid .hy-events__item__meta{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:9px}.hy-events__item--grid .hy-events__item__meta--item{font-size:0.9375rem;line-height:22px}.hy-events__item--grid .hy-events__item__date--short{padding:6px}@media (min-width: 48rem){.hy-events__item--grid .hy-events__item__date--short{font-size:0.9375rem;line-height:18px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:auto;font-weight:700;letter-spacing:-0.28125px;margin-bottom:18px}}';export{n as hy_event_item}
@@ -1 +0,0 @@
1
- import{r as e,h as t,g as i}from"./p-f8697bf9.js";import{g as r}from"./p-d9dc337b.js";let n=null,o=null,s=class{constructor(t){e(this,t),this.styleGrid=!1,this.scrollLeftLabel="Scroll list to left",this.scrollRightLabel="Scroll list to right",this.scrollable=!0}componentDidLoad(){const e=this.el,t=document.querySelector(".hy-events"),i=e.querySelector(".hy-events__scroll-left"),r=e.querySelector(".hy-events__scroll-right");this.styleGrid&&(t.addEventListener("scroll",(()=>{n=setTimeout((()=>{window.clearTimeout(n)}),250)}),!1),i.addEventListener("click",(e=>{e.preventDefault(),i.classList.add("is-disabled"),t.scrollBy({top:0,left:-304,behavior:"smooth"}),o=window.setTimeout((()=>{window.clearTimeout(o),i.classList.remove("is-disabled")}),250)})),r.addEventListener("click",(e=>{e.preventDefault(),r.classList.add("is-disabled"),t.scrollBy({top:0,left:304,behavior:"smooth"}),o=window.setTimeout((()=>{window.clearTimeout(o),r.classList.remove("is-disabled")}),250)})))}watchUrlHandler(e,t){t!==e&&(this.viewAllUrl=e)}checkScrollHidden(e,t,i){const r=e.querySelector(".hy-events__content");0===e.scrollLeft?t.classList.add("is-hidden"):t.classList.remove("is-hidden"),e.scrollLeft+e.clientWidth>=r.scrollWidth-1?i.classList.add("is-hidden"):i.classList.remove("is-hidden")}render(){const e=["hy-events",this.styleGrid?"hy-events--grid":""].join(" ");return t("div",{class:"hy-events--wrapper"},t("div",{class:e},t("slot",null)),t("div",{class:"hy-events__footer"},this.scrollable&&this.styleGrid&&t("div",{class:"hy-events__scroll-buttons"},t("button",{type:"button",class:"hy-events__scroll-left","aria-label":this.scrollLeftLabel},t("hy-icon",{icon:"hy-icon-caret-left",size:16})),t("button",{type:"button",class:"hy-events__scroll-right","aria-label":this.scrollRightLabel},t("hy-icon",{icon:"hy-icon-caret-right",size:16}))),this.viewAllLabel&&this.viewAllUrl&&t("hy-cta-link",{"link-content":this.viewAllLabel,"sc-label":this.viewAllLabel,url:this.viewAllUrl,variant:r.linkList})))}get el(){return i(this)}static get watchers(){return{viewAllUrl:["watchUrlHandler"]}}};s.style=":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}.hy-events--wrapper .hy-events{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.hy-events--wrapper .hy-events--grid{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:1.5rem;overflow-x:hidden;white-space:nowrap;scrollbar-width:none}@media (min-width: 48rem){.hy-events--wrapper .hy-events--grid{padding-bottom:7rem}}.hy-events--wrapper .hy-events--grid .hy-events__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:24px;-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}@media (min-width: 48rem){.hy-events--wrapper .hy-events--grid .hy-events__content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}.hy-events--wrapper .hy-events__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:2rem}@media (min-width: 48rem){.hy-events--wrapper .hy-events__footer{margin-top:-4.5rem}}.hy-events--wrapper .hy-events__scroll-buttons{display:none;margin-top:2rem}@media (min-width: 48rem){.hy-events--wrapper .hy-events__scroll-buttons{display:-webkit-box;display:-ms-flexbox;display:flex}}.hy-events--wrapper .hy-events__scroll-buttons button{border:none;background:none;padding:0.5rem}.hy-events--wrapper .hy-events__scroll-buttons button:hover{cursor:pointer}.hy-events--wrapper .hy-events__scroll-buttons button:hover svg{scale:1.1}.hy-events--wrapper .hy-events__scroll-buttons button.is-hidden{display:none}.hy-events--wrapper .hy-events__scroll-buttons button.is-disabled{pointer-events:none}.hy-events--wrapper .hy-events__scroll-buttons button.is-disabled svg{fill:var(--link-disabled)}";export{s as hy_events}