@ecl/gallery 5.0.0-alpha.2 → 5.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,6 +9,7 @@ npm install --save @ecl/gallery
9
9
  ### Parameters
10
10
 
11
11
  - **"grid"** (boolean) (default: false) Display gallery as a grid
12
+ - **"grid_template"** (int) (default: 0) Id of the template to be used. Grid display only
12
13
  - **"column"** (int) (default: 3) Number of columns. Grid display only
13
14
  - **"ratio"** (string) (default: '3-2') Image aspect ratio. Grid dipslay only
14
15
  - **"picture_zoom"** (bool) (default: false): Should the thumbnail pictures be animated?
@@ -35,7 +36,6 @@ npm install --save @ecl/gallery
35
36
  - "share_path" (optional) (string) (default: '')
36
37
  - **"visible_items"** (integer) (default: 8) Number of visible items in an expandable gallery
37
38
  - **"expandable"** (boolean) (default: true) collapsible/expandable gallery
38
- - **"icon_path"** (string) (default: '') Path to the icon sprite
39
39
  - **"sr_gallery_label"** (string) (default: ''): additional label for the gallery, providing instruction; for screen readers
40
40
  - **"sr_video_label"** (string) (default: ''): additional label for the video items; for screen readers
41
41
  - **"sr_video_player"** (string) (default: ''): additional label for the video player; for screen readers
@@ -95,7 +95,6 @@ npm install --save @ecl/gallery
95
95
  description: 'Living, working, travelling in the EU',
96
96
  meta: 'Copyright, Author, Licence for image 2',
97
97
  icon: {
98
- path: 'path/to/icons.svg',
99
98
  name: 'audio',
100
99
  },
101
100
  share_href: '/share#example-image2.jpg',
@@ -109,7 +108,6 @@ npm install --save @ecl/gallery
109
108
  aria_label: "View all link aria-label value"
110
109
  },
111
110
  icon: {
112
- path: "/icons.svg",
113
111
  name: "external",
114
112
  size: "s"
115
113
  }
@@ -119,7 +117,6 @@ npm install --save @ecl/gallery
119
117
  variant: 'ghost',
120
118
  label: 'Close',
121
119
  icon: {
122
- path: 'path/to/icons.svg',
123
120
  name: 'close',
124
121
  size: 's',
125
122
  },
@@ -128,7 +125,6 @@ npm install --save @ecl/gallery
128
125
  variant: 'ghost',
129
126
  label: 'Previous',
130
127
  icon: {
131
- path: 'path/to/icons.svg',
132
128
  name: 'corner-arrow',
133
129
  transform: 'rotate-270',
134
130
  size: 'l',
@@ -139,7 +135,6 @@ npm install --save @ecl/gallery
139
135
  variant: 'ghost',
140
136
  label: 'Next',
141
137
  icon: {
142
- path: 'path/to/icons.svg',
143
138
  name: 'corner-arrow',
144
139
  transform: 'rotate-90',
145
140
  size: 'l',
@@ -150,7 +145,6 @@ npm install --save @ecl/gallery
150
145
  share: {
151
146
  label: 'Share',
152
147
  icon: {
153
- path: 'path/to/icons.svg',
154
148
  name: 'share',
155
149
  size: 'fluid',
156
150
  },
@@ -14,11 +14,10 @@
14
14
  - "embedded_video" (optional) (object) (default: {})
15
15
  - "sr_video_audio" (string) (default: ''): additional text to indicate if there is an audio description; for screen readers
16
16
  - "share_path" (optional) (string) (default: '')
17
- - "icon_path": (string) (default '')
18
17
  - "sr_video_label" (string) (default: ''): additional label for the video items; for screen readers
19
18
  - "sr_video_player" (string) (default: ''): additional label for the video player; for screen readers
20
19
  - "picture_zoom" (bool) (default: false): Should the thumbnail pictures be animated?
21
- - "extra_classes" (optional) (string) (default: '')
20
+ - "extra_classes" (string) (default: '')
22
21
  - "extra_attributes" (optional) (array) (default: [])
23
22
  - "name" (string) Attribute name, eg. 'data-test'
24
23
  - "value" (string) Attribute value, eg: 'data-test-1'
@@ -36,7 +35,6 @@
36
35
  {% set _item = item|default({}) %}
37
36
  {% set _picture = item.picture|default({}) %}
38
37
  {% set _thumbnail = item.thumbnail|default({}) %}
39
- {% set _icon_path = icon_path|default('') %}
40
38
  {% set _sr_video_label = sr_video_label|default('') %}
41
39
  {% set _sr_video_player = sr_video_player|default('') %}
42
40
  {% set _picture_zoom = picture_zoom|default(false) %}
@@ -118,19 +116,16 @@
118
116
  {% set _image_alt = _image_alt ~ ' - ' ~ _sr_video_label %}
119
117
  {% endif %}
120
118
 
121
- {% if _icon_path is not empty %}
122
- <div class="ecl-gallery__item-icon-wrapper">
123
- {%- include '@ecl/icon/icon.html.twig' with {
124
- icon: {
125
- name: 'play-filled',
126
- size: 'l',
127
- path: _icon_path,
128
- color: 'inverted',
129
- },
130
- extra_classes: 'ecl-gallery__item-icon',
131
- } only %}
132
- </div>
133
- {% endif %}
119
+ <div class="ecl-gallery__item-icon-wrapper">
120
+ {%- include '@ecl/icon/icon.html.twig' with {
121
+ icon: {
122
+ name: 'play-filled',
123
+ size: 'l',
124
+ color: 'inverted',
125
+ },
126
+ extra_classes: 'ecl-gallery__item-icon',
127
+ } only %}
128
+ </div>
134
129
  {% endif %}
135
130
 
136
131
  {% set _thumbnail_markup %}
@@ -8,10 +8,11 @@
8
8
  - "next" (object) (default: {}): object of type button
9
9
  - "counter_separator" (string) (default: '')
10
10
  - "full_screen_label" (string) (default: '')
11
+ - "download" (object) (default: {}): object of type link
11
12
  - "share" (object) (default: {}): object of type link
12
13
  - "sr_overlay_label" (string) (default: '') aria-label for the overlay
13
14
  - "item" (object) (default: {}): object of type gallery-item
14
- - "extra_classes" (optional) (string) (default: '')
15
+ - "extra_classes" (string) (default: '')
15
16
  - "extra_attributes" (optional) (array) (default: [])
16
17
  - "name" (string) Attribute name, eg. 'data-test'
17
18
  - "value" (string) Attribute value, eg: 'data-test-1'
@@ -23,7 +24,6 @@
23
24
  {% set _css_media_class = 'ecl-gallery__slider-media-container' %}
24
25
  {% set _extra_attributes = '' %}
25
26
  {% set _button_type = 'button' %}
26
- {% set _button_variant = 'ghost' %}
27
27
  {% set _overlay = overlay|default({}) %}
28
28
  {% set _item = item|default({}) %}
29
29
 
@@ -56,7 +56,8 @@
56
56
  <header class="ecl-gallery__close" data-ecl-gallery-overlay-header>
57
57
  {% include '@ecl/button/button.html.twig' with _overlay.close|merge({
58
58
  extra_classes: 'ecl-gallery__close-button',
59
- variant: _button_variant,
59
+ variant: 'tertiary',
60
+ style: 'inverted',
60
61
  type: 'submit',
61
62
  extra_attributes: [
62
63
  { name: 'data-ecl-gallery-close' },
@@ -130,7 +131,6 @@
130
131
  icon: {
131
132
  name: 'fullscreen',
132
133
  size: 'fluid',
133
- path: icon_path|default('')
134
134
  },
135
135
  extra_classes: 'ecl-gallery__download',
136
136
  extra_attributes: [
@@ -8,6 +8,7 @@
8
8
  // Exposed variables
9
9
  $theme: null !default;
10
10
  $gallery: null !default;
11
+ $gallery-print: null !default;
11
12
 
12
13
  .ecl-gallery {
13
14
  margin: 0;
@@ -77,9 +78,9 @@ $gallery: null !default;
77
78
 
78
79
  .ecl-gallery__description {
79
80
  align-items: center;
80
- background-color: rgba(0, 0, 0, 0.7);
81
- color: map.get($theme, 'color', 'white');
82
- font: map.get($theme, 'font-print', 's');
81
+ background-color: rgb(0, 0, 0, 0.7);
82
+ color: #fff;
83
+ font: map.get($gallery-print, 'description-font');
83
84
  padding: map.get($theme, 'spacing-print', '2xs')
84
85
  map.get($theme, 'spacing-print', 'xs');
85
86
  text-decoration: none;
@@ -163,7 +164,7 @@ $gallery: null !default;
163
164
  padding: map.get($theme, 'spacing-print', 'm');
164
165
 
165
166
  * {
166
- color: map.get($theme, 'color', 'white');
167
+ color: #fff;
167
168
  }
168
169
  }
169
170
 
package/gallery.html.twig CHANGED
@@ -22,6 +22,7 @@
22
22
  - "next" (object) (default: {}): object of type button
23
23
  - "counter_separator" (string) (default: '')
24
24
  - "full_screen_label" (string) (default: '')
25
+ - "download" (object) (default: {}): object of type link
25
26
  - "share" (object) (default: {}): object of type link
26
27
  - "sr_overlay_label" (string) (default: '') aria-label for the overlay
27
28
  - "footer" (object) (default: {}): object of type link
@@ -36,12 +37,11 @@
36
37
  - "embedded_video" (optional) (object) (default: {})
37
38
  - "sr_video_audio" (string) (default: ''): additional text to indicate if there is an audio description; for screen readers
38
39
  - "share_path" (optional) (string) (default: '')
39
- - "icon_path": (string) (default: '')
40
40
  - "sr_gallery_label" (string) (default: ''): additional label for the gallery, providing instruction; for screen readers
41
41
  - "sr_video_label" (string) (default: ''): additional label for the video items; for screen readers
42
42
  - "sr_video_player" (string) (default: ''): additional label for the video player; for screen readers
43
43
  - "selected_item_id" (int) (default: 0)
44
- - "extra_classes" (optional) (string) (default: '')
44
+ - "extra_classes" (string) (default: '')
45
45
  - "extra_attributes" (optional) (array) (default: [])
46
46
  - "name" (string) Attribute name, eg. 'data-test'
47
47
  - "value" (string) Attribute value, eg: 'data-test-1'
@@ -66,7 +66,6 @@
66
66
  {% set _visible_items = visible_items|default(8) %}
67
67
  {% set _disable_hover = disable_hover|default(false) %}
68
68
  {% set _disable_overlay = disable_overlay|default(false) %}
69
- {% set _icon_path = icon_path|default('') %}
70
69
  {% set _sr_gallery_label = sr_gallery_label|default('') %}
71
70
  {% set _sr_video_label = sr_video_label|default('') %}
72
71
  {% set _expandable = expandable ?? true %}
@@ -151,7 +150,6 @@
151
150
  {% include '@ecl/gallery/gallery-item.html.twig' with {
152
151
  id: "ecl-gallery-item-" ~ _id ~ '-' ~ _key,
153
152
  item: _item,
154
- icon_path: _icon_path,
155
153
  sr_video_label: _sr_video_label,
156
154
  sr_video_player: _sr_video_player,
157
155
  disable_overlay: _disable_overlay,
@@ -170,7 +168,7 @@
170
168
  {% include '@ecl/button/button.html.twig' with {
171
169
  label: _view_all_label,
172
170
  type: 'submit',
173
- variant: 'ghost',
171
+ variant: 'tertiary',
174
172
  extra_attributes: [
175
173
  { name: 'data-ecl-gallery-all' },
176
174
  { name: 'data-ecl-gallery-collapsed-label', value: _view_all_label },
@@ -209,7 +207,6 @@
209
207
  extra_attributes: _overlay_attrs,
210
208
  extra_classes: _overlay_class,
211
209
  item: _selected_item,
212
- icon_path: _icon_path,
213
210
  } only %}
214
211
  </section>
215
212
 
package/gallery.js CHANGED
@@ -721,7 +721,7 @@ export class Gallery {
721
721
  *
722
722
  * @param {Event} e
723
723
  */
724
- // eslint-disable-next-line class-methods-use-this
724
+
725
725
  preventClickOnItem(e) {
726
726
  e.preventDefault();
727
727
  e.stopPropagation();
package/gallery.scss CHANGED
@@ -12,7 +12,7 @@ $theme: null !default;
12
12
  $gallery: null !default;
13
13
 
14
14
  // Internal variables
15
- $_description-color: map.get($theme, 'color', 'white');
15
+ $_description-color: #fff;
16
16
  $_image-height: 192px;
17
17
  $_image-height-mobile: 260px;
18
18
  $_description-height-mobile: 132px;
@@ -51,8 +51,13 @@ $_description-height-desktop: 108px;
51
51
  }
52
52
 
53
53
  .ecl-gallery__item-icon-wrapper {
54
- background: var(--c-d);
55
- box-shadow: 0 0 15px 6px color-mix(in srgb, var(--c-d-80) 55%, transparent);
54
+ background: var(--cm-on-surface-dark, var(--c-d));
55
+ box-shadow: 0 0 15px 6px
56
+ color-mix(
57
+ in srgb,
58
+ var(--cm-on-surface-neutral-highest, var(--c-d-80)) 55%,
59
+ transparent
60
+ );
56
61
  display: inline-block;
57
62
  position: absolute;
58
63
  left: 50%;
@@ -82,7 +87,7 @@ $_description-height-desktop: 108px;
82
87
  outline: none;
83
88
 
84
89
  .ecl-gallery__image-container {
85
- outline: 2px solid var(--c-p);
90
+ outline: 2px solid var(--cm-border-primary, var(--c-p));
86
91
  outline-offset: 2px;
87
92
  }
88
93
  }
@@ -120,17 +125,13 @@ $_description-height-desktop: 108px;
120
125
  }
121
126
  }
122
127
 
123
- .ecl-gallery__image-icon {
124
- display: none;
125
- }
126
-
127
128
  .ecl-gallery__description {
128
129
  align-items: center;
129
130
  bottom: 0;
130
131
  background-color: map.get($gallery, 'description-background');
131
132
  color: $_description-color;
132
133
  display: none;
133
- font: var(--f-s);
134
+ font: map.get($gallery, 'description-font');
134
135
  left: 0;
135
136
  overflow: hidden;
136
137
  padding: var(--s-2xs) var(--s-xs);
@@ -161,7 +162,7 @@ $_description-height-desktop: 108px;
161
162
  color: map.get($gallery, 'gallery-info-color');
162
163
  display: flex;
163
164
  flex-direction: row;
164
- font: var(--f-s);
165
+ font: map.get($gallery, 'gallery-info-font');
165
166
  }
166
167
 
167
168
  .ecl-gallery__info-total {
@@ -177,7 +178,7 @@ $_description-height-desktop: 108px;
177
178
  display: flex;
178
179
  flex-direction: column;
179
180
  margin: 0 auto;
180
- max-width: 1140px;
181
+ max-width: map.get($theme, 'container', 'xxl');
181
182
  padding-top: var(--s-xs);
182
183
  }
183
184
 
@@ -193,7 +194,7 @@ $_description-height-desktop: 108px;
193
194
  }
194
195
 
195
196
  .ecl-gallery__footer-divider {
196
- background: var(--c-n-100);
197
+ background: var(--cm-border-neutral, (--c-n-100));
197
198
  border: none;
198
199
  height: 1px;
199
200
  width: 100%;
@@ -218,16 +219,6 @@ $_description-height-desktop: 108px;
218
219
  margin: 0 auto;
219
220
  }
220
221
 
221
- .ecl-gallery__image-icon {
222
- background-color: map.get($gallery, 'description-background');
223
- bottom: 0;
224
- display: block;
225
- fill: $_description-color;
226
- padding: var(--s-s);
227
- position: absolute;
228
- right: 0;
229
- }
230
-
231
222
  .ecl-gallery__footer {
232
223
  align-items: center;
233
224
  flex-direction: row;
@@ -319,13 +310,7 @@ $_description-height-desktop: 108px;
319
310
  }
320
311
 
321
312
  .ecl-gallery__close-button {
322
- color: map.get($theme, 'color', 'white');
323
313
  margin: var(--s-xs);
324
-
325
- &:focus-visible {
326
- border-color: map.get($theme, 'color', 'white');
327
- color: map.get($theme, 'color', 'white');
328
- }
329
314
  }
330
315
 
331
316
  .ecl-gallery__controls {
@@ -390,16 +375,16 @@ $_description-height-desktop: 108px;
390
375
 
391
376
  .ecl-gallery__slider-previous,
392
377
  .ecl-gallery__slider-next {
393
- background: map.get($theme, 'color', 'white');
378
+ background-color: #fff;
394
379
  flex-shrink: 0;
395
380
 
396
381
  &:hover {
397
- background-color: var(--c-p-20);
382
+ background-color: var(--cm-surface-neutral-lowest, var(--c-p-20));
398
383
  }
399
384
 
400
385
  &:focus-visible {
401
- background-color: map.get($theme, 'color', 'white');
402
- outline: 2px solid map.get($theme, 'color', 'white');
386
+ background-color: #fff;
387
+ outline: 2px solid #fff;
403
388
  outline-offset: 0;
404
389
  }
405
390
  }
@@ -410,6 +395,7 @@ $_description-height-desktop: 108px;
410
395
  display: flex;
411
396
  flex-direction: column;
412
397
  flex-shrink: 0;
398
+ font: var(--f-m);
413
399
  padding: var(--s-xl) var(--s-xs);
414
400
 
415
401
  .ecl-container {
@@ -420,10 +406,9 @@ $_description-height-desktop: 108px;
420
406
 
421
407
  .ecl-gallery__detail-counter {
422
408
  align-self: center;
423
- border-left: 1px solid map.get($theme, 'color', 'white');
424
- border-right: 1px solid map.get($theme, 'color', 'white');
409
+ border-left: 1px solid #fff;
410
+ border-right: 1px solid #fff;
425
411
  display: inline-flex;
426
- font: var(--f-m);
427
412
  margin: 0;
428
413
  padding: 0 var(--s-xs);
429
414
  white-space: pre-wrap;
@@ -455,18 +440,18 @@ $_description-height-desktop: 108px;
455
440
  }
456
441
 
457
442
  .ecl-gallery__detail-description {
458
- font: var(--f-m);
459
443
  height: $_description-height-mobile;
460
444
  margin-top: var(--s-s);
461
445
  overflow: auto;
462
446
 
463
447
  .ecl-gallery__title {
464
448
  display: block;
465
- font-weight: map.get($theme, 'font-weight', 'bold');
449
+ font-weight: map.get($gallery, 'overlay-title-font-weight');
466
450
  }
467
451
 
468
452
  .ecl-gallery__meta {
469
453
  display: block;
454
+ font: map.get($gallery, 'overlay-meta-font');
470
455
  margin-top: var(--s-s);
471
456
  }
472
457
  }
@@ -684,5 +669,5 @@ $_description-height-desktop: 108px;
684
669
  .ecl-gallery__video-title {
685
670
  @include screen-reader.sr-only;
686
671
 
687
- background-color: map.get($theme, 'color', 'white');
672
+ background-color: #fff;
688
673
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ecl/gallery",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "5.0.0-alpha.2",
5
+ "version": "5.0.0-alpha.20",
6
6
  "description": "ECL Gallery",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -11,13 +11,13 @@
11
11
  "module": "gallery.js",
12
12
  "style": "gallery.scss",
13
13
  "dependencies": {
14
- "@ecl/button": "5.0.0-alpha.2",
15
- "@ecl/dom-utils": "5.0.0-alpha.2",
16
- "@ecl/icon": "5.0.0-alpha.2",
17
- "@ecl/link": "5.0.0-alpha.2",
18
- "@ecl/picture": "5.0.0-alpha.2",
19
- "@ecl/video": "5.0.0-alpha.2",
20
- "focus-trap": "7.6.4"
14
+ "@ecl/button": "5.0.0-alpha.20",
15
+ "@ecl/dom-utils": "5.0.0-alpha.20",
16
+ "@ecl/icon": "5.0.0-alpha.20",
17
+ "@ecl/link": "5.0.0-alpha.20",
18
+ "@ecl/picture": "5.0.0-alpha.20",
19
+ "@ecl/video": "5.0.0-alpha.20",
20
+ "focus-trap": "7.6.5"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
@@ -33,5 +33,5 @@
33
33
  "design-system",
34
34
  "twig"
35
35
  ],
36
- "gitHead": "3c10f74e78b7c3891917c075fa3868eb7c4f3d7a"
36
+ "gitHead": "47aedb8e6c7b15ce6acc9cbd2284c4a52ba1014b"
37
37
  }