@itcenteratunihelsinki/huds-lib 0.6.8 → 0.7.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.
Files changed (28) hide show
  1. package/dist/cjs/huds-lib.cjs.js +1 -1
  2. package/dist/cjs/hy-accordion-container_83.cjs.entry.js +20 -3
  3. package/dist/cjs/hy-event-item.cjs.entry.js +40 -0
  4. package/dist/cjs/hy-events.cjs.entry.js +94 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +2 -0
  7. package/dist/collection/components/hy-event-item/hy-event-item.css +425 -0
  8. package/dist/collection/components/hy-event-item/hy-event-item.js +220 -0
  9. package/dist/collection/components/hy-events/hy-events.css +166 -0
  10. package/dist/collection/components/hy-events/hy-events.js +193 -0
  11. package/dist/collection/components/hy-video/hy-video.css +1 -0
  12. package/dist/collection/components/hy-video/hy-video.js +0 -1
  13. package/dist/collection/components/icon/icon.js +3 -0
  14. package/dist/collection/components/site-header/site-header.js +1 -1
  15. package/dist/esm/huds-lib.js +1 -1
  16. package/dist/esm/hy-accordion-container_83.entry.js +20 -3
  17. package/dist/esm/hy-event-item.entry.js +36 -0
  18. package/dist/esm/hy-events.entry.js +90 -0
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/huds-lib/huds-lib.esm.js +1 -1
  21. package/dist/huds-lib/p-46bf6c43.entry.js +1 -0
  22. package/dist/huds-lib/p-5b7b894e.entry.js +86 -0
  23. package/dist/huds-lib/p-9b7c1051.entry.js +1 -0
  24. package/dist/types/components/hy-event-item/hy-event-item.d.ts +15 -0
  25. package/dist/types/components/hy-events/hy-events.d.ts +13 -0
  26. package/dist/types/components.d.ts +54 -0
  27. package/package.json +1 -1
  28. package/dist/huds-lib/p-e39d3bcc.entry.js +0 -86
@@ -0,0 +1,425 @@
1
+ :root {
2
+ --brand-main: #0e688b;
3
+ --brand-main-soft: #b1e7ff;
4
+ --brand-main-bright: #48c5f8;
5
+ --brand-main-light: #107eab;
6
+ --brand-main-active: #005379;
7
+ --brand-main-dark: #003146;
8
+ --brand-main-nearly-black: #000222;
9
+ --link-blue: #0479a4;
10
+ --link-disabled: #767676;
11
+ --grayscale-white: #fff;
12
+ --grayscale-slightly-gray: #fefefe;
13
+ --grayscale-light: #f8f8f8;
14
+ --grayscale-medium: #d2d2d2;
15
+ --grayscale-background-box: #f5f5f5;
16
+ --grayscale-tabs-border: #e6e6e6;
17
+ --grayscale-background-arrow: #dfdfdf;
18
+ --grayscale-medium-dark: #979797;
19
+ --grayscale-dark: #555555;
20
+ --grayscale-dark-text: #222222;
21
+ --grayscale-black: #000000;
22
+ --additional-red-light: #e5053a;
23
+ --additional-red-dark: #a31621;
24
+ --additional-purple-light: #420039;
25
+ --additional-yellow: #f9a21a;
26
+ --additional-skyblue: #48c5f8;
27
+ --additional-orange: #d14600;
28
+ --additional-green-light: #96ba3c;
29
+ --additional-green-dark: #006400;
30
+ --hover-gray: #eaeaea;
31
+ }
32
+
33
+ * {
34
+ -webkit-box-sizing: border-box;
35
+ box-sizing: border-box;
36
+ }
37
+
38
+ :root {
39
+ --gutter-mobile: 16px;
40
+ --gutter-narrow: 24px;
41
+ --gutter-medium: 24px;
42
+ --gutter-wide: 24px;
43
+ --gutter-extrawide: 32px;
44
+ }
45
+
46
+ /**
47
+ * Mixin for fluid type.
48
+ * Example usage: @include fluid-type(font-size, 320px, 1600px, 32px, 80px);
49
+ */
50
+
51
+ :root {
52
+ --breakpoint-extrawide: 75.0625rem;
53
+ --breakpoint-max-width: 75.0625rem;
54
+ --breakpoint-medium: 48rem;
55
+ --breakpoint-narrow: 30rem;
56
+ --breakpoint-wide: 60rem;
57
+ }
58
+
59
+ .hy-events__item {
60
+ display: -webkit-box;
61
+ display: -ms-flexbox;
62
+ display: flex;
63
+ border: 1px solid #d8d8d8;
64
+ padding: 13px 16px;
65
+ position: relative;
66
+ text-decoration: none;
67
+ -webkit-box-orient: vertical;
68
+ -webkit-box-direction: normal;
69
+ -ms-flex-direction: column;
70
+ flex-direction: column;
71
+ white-space: initial;
72
+ margin-bottom: 1rem;
73
+ }
74
+
75
+ @media (min-width: 48rem) {
76
+ .hy-events__item {
77
+ -webkit-box-orient: horizontal;
78
+ -webkit-box-direction: normal;
79
+ -ms-flex-direction: row;
80
+ flex-direction: row;
81
+ padding: 47px;
82
+ margin-bottom: 1.75rem;
83
+ }
84
+ }
85
+
86
+ .hy-events__item:not(.hy-events__item--grid) .hy-events__item--container {
87
+ display: -webkit-box;
88
+ display: -ms-flexbox;
89
+ display: flex;
90
+ }
91
+
92
+ .hy-events__item:hover .hy-events__item__title {
93
+ color: var(--brand-main);
94
+ text-decoration: underline;
95
+ }
96
+
97
+ .hy-events__item:hover .hy-events__item__date--short,
98
+ .hy-events__item:hover .hy-events__item__url-icon {
99
+ background-color: var(--brand-main-active);
100
+ }
101
+
102
+ .hy-events__item__title {
103
+ font-size: 1.125rem;
104
+ line-height: 24px;
105
+ color: var(--grayscale-black);
106
+ font-family: var(--main-font-family);
107
+ font-weight: 700;
108
+ letter-spacing: -0.36px;
109
+ margin-bottom: 16px;
110
+ }
111
+
112
+ @media (min-width: 48rem) {
113
+ .hy-events__item__title {
114
+ font-size: 1.375rem;
115
+ line-height: 28px;
116
+ font-weight: 700;
117
+ font-size: 22px;
118
+ line-height: 28px;
119
+ letter-spacing: -0.44px;
120
+ margin-bottom: 14px;
121
+ }
122
+ }
123
+
124
+ .hy-events__item__details {
125
+ font-family: var(--main-font-family);
126
+ font-style: normal;
127
+ font-weight: 400;
128
+ font-size: 17px;
129
+ line-height: 26px;
130
+ color: var(--grayscale-black);
131
+ }
132
+
133
+ .hy-events__item__meta {
134
+ display: -webkit-box;
135
+ display: -ms-flexbox;
136
+ display: flex;
137
+ -webkit-box-orient: vertical;
138
+ -webkit-box-direction: normal;
139
+ -ms-flex-direction: column;
140
+ flex-direction: column;
141
+ }
142
+
143
+ @media (min-width: 48rem) {
144
+ .hy-events__item__meta {
145
+ -webkit-box-orient: horizontal;
146
+ -webkit-box-direction: normal;
147
+ -ms-flex-direction: row;
148
+ flex-direction: row;
149
+ }
150
+ }
151
+
152
+ .hy-events__item__meta--item {
153
+ font-size: 0.9375rem;
154
+ line-height: 22px;
155
+ -webkit-box-align: center;
156
+ -ms-flex-align: center;
157
+ align-items: center;
158
+ display: -webkit-box;
159
+ display: -ms-flexbox;
160
+ display: flex;
161
+ -webkit-box-orient: horizontal;
162
+ -webkit-box-direction: normal;
163
+ -ms-flex-direction: row;
164
+ flex-direction: row;
165
+ margin-right: 0px;
166
+ margin-bottom: 9px;
167
+ font-family: var(--main-font-family);
168
+ font-weight: 400;
169
+ }
170
+
171
+ @media (min-width: 48rem) {
172
+ .hy-events__item__meta--item {
173
+ font-size: 1.0625rem;
174
+ line-height: 26px;
175
+ margin-right: 35px;
176
+ margin-bottom: 0;
177
+ font-weight: 400;
178
+ }
179
+ }
180
+
181
+ .hy-events__item__meta--item svg {
182
+ width: 20px;
183
+ height: 20px;
184
+ margin-right: 9px;
185
+ }
186
+
187
+ .hy-events__item__date--short {
188
+ font-size: 0.9375rem;
189
+ line-height: 18px;
190
+ display: -webkit-box;
191
+ display: -ms-flexbox;
192
+ display: flex;
193
+ color: var(--grayscale-white);
194
+ background: var(--brand-main-light);
195
+ font-family: var(--main-font-family);
196
+ font-style: normal;
197
+ font-weight: 700;
198
+ padding: 6px 8px;
199
+ width: -webkit-fit-content;
200
+ width: -moz-fit-content;
201
+ width: fit-content;
202
+ text-align: center;
203
+ letter-spacing: -0.28125px;
204
+ text-decoration: none;
205
+ margin-bottom: 20px;
206
+ margin-right: 0;
207
+ }
208
+
209
+ @media (min-width: 48rem) {
210
+ .hy-events__item__date--short {
211
+ font-size: 1.0625rem;
212
+ line-height: 20px;
213
+ letter-spacing: -0.31875px;
214
+ padding: 0;
215
+ height: 68px;
216
+ width: 68px;
217
+ -webkit-box-pack: center;
218
+ -ms-flex-pack: center;
219
+ justify-content: center;
220
+ -webkit-box-align: center;
221
+ -ms-flex-align: center;
222
+ align-items: center;
223
+ margin-right: 47px;
224
+ margin-bottom: 0;
225
+ }
226
+ }
227
+
228
+ .hy-events__item__url-icon {
229
+ display: none;
230
+ -webkit-box-align: center;
231
+ -ms-flex-align: center;
232
+ align-items: center;
233
+ -webkit-box-pack: center;
234
+ -ms-flex-pack: center;
235
+ justify-content: center;
236
+ position: absolute;
237
+ background: var(--brand-main-light);
238
+ color: var(--grayscale-white);
239
+ width: 32px;
240
+ height: 32px;
241
+ bottom: 16px;
242
+ right: -9px;
243
+ z-index: 1;
244
+ }
245
+
246
+ @media (min-width: 48rem) {
247
+ .hy-events__item__url-icon {
248
+ display: -webkit-box;
249
+ display: -ms-flexbox;
250
+ display: flex;
251
+ }
252
+ }
253
+
254
+ .hy-events__item__url-icon svg {
255
+ fill: currentColor;
256
+ }
257
+
258
+ .hy-events__item__read-more {
259
+ font-size: 0.9375rem;
260
+ line-height: 18px;
261
+ color: var(--brand-main-light);
262
+ font-weight: 700;
263
+ display: -webkit-box;
264
+ display: -ms-flexbox;
265
+ display: flex;
266
+ -webkit-box-align: center;
267
+ -ms-flex-align: center;
268
+ align-items: center;
269
+ letter-spacing: -0.28125px;
270
+ margin-top: 10px;
271
+ }
272
+
273
+ @media (min-width: 48rem) {
274
+ .hy-events__item__read-more {
275
+ display: none;
276
+ }
277
+ }
278
+
279
+ .hy-events__item--grid {
280
+ padding: 1rem;
281
+ -webkit-box-orient: vertical;
282
+ -webkit-box-direction: normal;
283
+ -ms-flex-direction: column;
284
+ flex-direction: column;
285
+ min-width: 280px;
286
+ max-width: 100%;
287
+ min-height: 225px;
288
+ position: relative;
289
+ margin-bottom: 0;
290
+ }
291
+
292
+ @media (min-width: 48rem) {
293
+ .hy-events__item--grid {
294
+ max-width: 280px;
295
+ padding: 1rem 1rem 0 1rem;
296
+ }
297
+ }
298
+
299
+ .hy-events__item--grid.is-long {
300
+ max-height: 100%;
301
+ }
302
+
303
+ @media (min-width: 48rem) {
304
+ .hy-events__item--grid.is-long {
305
+ max-height: 225px;
306
+ }
307
+ }
308
+
309
+ .hy-events__item--grid.is-long::after {
310
+ display: none;
311
+ content: "";
312
+ background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#ffffff));
313
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
314
+ position: absolute;
315
+ bottom: 0;
316
+ left: 0;
317
+ width: 100%;
318
+ height: 36px;
319
+ }
320
+
321
+ @media (min-width: 48rem) {
322
+ .hy-events__item--grid.is-long::after {
323
+ display: block;
324
+ }
325
+ }
326
+
327
+ .hy-events__item--grid.is-long .hy-events__item--container {
328
+ overflow: visible;
329
+ }
330
+
331
+ @media (min-width: 48rem) {
332
+ .hy-events__item--grid.is-long .hy-events__item--container {
333
+ overflow: hidden;
334
+ }
335
+ }
336
+
337
+ @media (min-width: 48rem) {
338
+ .hy-events__item--grid.is-long:hover, .hy-events__item--grid.is-long:focus {
339
+ border: 0;
340
+ }
341
+ }
342
+
343
+ .hy-events__item--grid.is-long:hover::after,
344
+ .hy-events__item--grid.is-long:hover .hy-events__item--toggle, .hy-events__item--grid.is-long:focus::after,
345
+ .hy-events__item--grid.is-long:focus .hy-events__item--toggle {
346
+ display: none;
347
+ }
348
+
349
+ .hy-events__item--grid.is-long:hover .hy-events__item--container, .hy-events__item--grid.is-long:focus .hy-events__item--container {
350
+ background-color: white;
351
+ position: relative;
352
+ border: 1px solid #d8d8d8;
353
+ padding: 16px 16px;
354
+ }
355
+
356
+ @media (min-width: 48rem) {
357
+ .hy-events__item--grid.is-long:hover .hy-events__item--container, .hy-events__item--grid.is-long:focus .hy-events__item--container {
358
+ position: absolute;
359
+ top: 0;
360
+ left: 0;
361
+ overflow: visible;
362
+ }
363
+ }
364
+
365
+ .hy-events__item--grid .hy-events__item__title {
366
+ font-size: 1.125rem;
367
+ line-height: 24px;
368
+ letter-spacing: -0.36px;
369
+ }
370
+
371
+ .hy-events__item--grid .hy-events__item--toggle {
372
+ display: none;
373
+ -webkit-box-align: center;
374
+ -ms-flex-align: center;
375
+ align-items: center;
376
+ -webkit-box-pack: center;
377
+ -ms-flex-pack: center;
378
+ justify-content: center;
379
+ background: #d7d7d7;
380
+ border-radius: 50%;
381
+ position: absolute;
382
+ top: 16px;
383
+ right: 16px;
384
+ width: 24px;
385
+ height: 24px;
386
+ }
387
+
388
+ @media (min-width: 48rem) {
389
+ .hy-events__item--grid .hy-events__item--toggle {
390
+ display: -webkit-box;
391
+ display: -ms-flexbox;
392
+ display: flex;
393
+ }
394
+ }
395
+
396
+ .hy-events__item--grid .hy-events__item__meta {
397
+ -webkit-box-orient: vertical;
398
+ -webkit-box-direction: normal;
399
+ -ms-flex-direction: column;
400
+ flex-direction: column;
401
+ gap: 9px;
402
+ }
403
+
404
+ .hy-events__item--grid .hy-events__item__meta--item {
405
+ font-size: 0.9375rem;
406
+ line-height: 22px;
407
+ }
408
+
409
+ .hy-events__item--grid .hy-events__item__date--short {
410
+ padding: 6px;
411
+ }
412
+
413
+ @media (min-width: 48rem) {
414
+ .hy-events__item--grid .hy-events__item__date--short {
415
+ font-size: 0.9375rem;
416
+ line-height: 18px;
417
+ width: -webkit-fit-content;
418
+ width: -moz-fit-content;
419
+ width: fit-content;
420
+ height: auto;
421
+ font-weight: 700;
422
+ letter-spacing: -0.28125px;
423
+ margin-bottom: 18px;
424
+ }
425
+ }
@@ -0,0 +1,220 @@
1
+ import { Component, Element, h, Prop, State } from '@stencil/core';
2
+ export class HyEventItem {
3
+ constructor() {
4
+ this.eventDescription = '';
5
+ this.dateShort = '';
6
+ this.dateLong = '';
7
+ this.location = '';
8
+ this.styleGrid = false;
9
+ this.readMoreLabel = 'Read more';
10
+ this.isLong = false;
11
+ }
12
+ componentDidLoad() {
13
+ const link = this.el;
14
+ if (this.styleGrid) {
15
+ if (link.clientHeight > 225) {
16
+ this.isLong = true;
17
+ }
18
+ }
19
+ }
20
+ render() {
21
+ const containerClasses = [
22
+ 'hy-events__item',
23
+ this.styleGrid ? 'hy-events__item--grid' : 'hy-events__item--list',
24
+ this.isLong ? 'is-long' : '',
25
+ ].join(' ');
26
+ return (h("a", { href: this.url, class: containerClasses },
27
+ h("div", { class: "hy-events__item--container" },
28
+ h("div", { class: "hy-events__item__top-container" },
29
+ h("span", { class: "hy-events__item__date--short" }, this.dateShort),
30
+ this.isLong && (h("span", { class: "hy-events__item--toggle" },
31
+ h("hy-icon", { icon: "hy-icon-caret-down", size: 10 })))),
32
+ h("div", { class: "hy-events__item__details" },
33
+ h("div", { class: "hy-events__item__title" }, this.eventTitle),
34
+ h("div", { class: "hy-events__item__meta" },
35
+ this.dateLong && (h("div", { class: "hy-events__item__meta--item hy-events__item__date--long" },
36
+ h("hy-icon", { icon: "hy-icon-events", size: 18 }),
37
+ this.dateLong)),
38
+ this.location && (h("div", { class: "hy-events__item__meta--item hy-events__item__location" },
39
+ h("hy-icon", { icon: "hy-icon-location", size: 18 }),
40
+ this.location)),
41
+ this.type && (h("div", { class: "hy-events__item__meta--item hy-events__item__type" },
42
+ h("hy-icon", { icon: "hy-icon-people", size: 18 }),
43
+ this.type)),
44
+ h("span", { class: "hy-events__item__read-more" }, this.readMoreLabel))),
45
+ h("span", { class: "hy-events__item__url-icon", "aria-hidden": "true" },
46
+ h("hy-icon", { icon: "hy-icon-arrow-right", size: 18 })))));
47
+ }
48
+ static get is() { return "hy-event-item"; }
49
+ static get originalStyleUrls() { return {
50
+ "$": ["hy-event-item.scss"]
51
+ }; }
52
+ static get styleUrls() { return {
53
+ "$": ["hy-event-item.css"]
54
+ }; }
55
+ static get properties() { return {
56
+ "eventTitle": {
57
+ "type": "string",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "string",
61
+ "resolved": "string",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": true,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "event-title",
71
+ "reflect": false
72
+ },
73
+ "eventDescription": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "string",
78
+ "resolved": "string",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": ""
86
+ },
87
+ "attribute": "event-description",
88
+ "reflect": false,
89
+ "defaultValue": "''"
90
+ },
91
+ "dateShort": {
92
+ "type": "string",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "string",
96
+ "resolved": "string",
97
+ "references": {}
98
+ },
99
+ "required": false,
100
+ "optional": false,
101
+ "docs": {
102
+ "tags": [],
103
+ "text": ""
104
+ },
105
+ "attribute": "date-short",
106
+ "reflect": false,
107
+ "defaultValue": "''"
108
+ },
109
+ "dateLong": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": ""
122
+ },
123
+ "attribute": "date-long",
124
+ "reflect": false,
125
+ "defaultValue": "''"
126
+ },
127
+ "location": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "attribute": "location",
142
+ "reflect": false,
143
+ "defaultValue": "''"
144
+ },
145
+ "type": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": ""
158
+ },
159
+ "attribute": "type",
160
+ "reflect": false
161
+ },
162
+ "url": {
163
+ "type": "string",
164
+ "mutable": false,
165
+ "complexType": {
166
+ "original": "string",
167
+ "resolved": "string",
168
+ "references": {}
169
+ },
170
+ "required": false,
171
+ "optional": false,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": ""
175
+ },
176
+ "attribute": "url",
177
+ "reflect": false
178
+ },
179
+ "styleGrid": {
180
+ "type": "boolean",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "boolean",
184
+ "resolved": "boolean",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": ""
192
+ },
193
+ "attribute": "style-grid",
194
+ "reflect": false,
195
+ "defaultValue": "false"
196
+ },
197
+ "readMoreLabel": {
198
+ "type": "string",
199
+ "mutable": false,
200
+ "complexType": {
201
+ "original": "string",
202
+ "resolved": "string",
203
+ "references": {}
204
+ },
205
+ "required": false,
206
+ "optional": false,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": ""
210
+ },
211
+ "attribute": "read-more-label",
212
+ "reflect": false,
213
+ "defaultValue": "'Read more'"
214
+ }
215
+ }; }
216
+ static get states() { return {
217
+ "isLong": {}
218
+ }; }
219
+ static get elementRef() { return "el"; }
220
+ }