@ecl/site-header 5.0.0-alpha.15 → 5.0.0-alpha.16

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.
@@ -1,5 +1,6 @@
1
1
  @use 'sass:map';
2
2
  @use '@ecl/grid/mixins/breakpoints';
3
+ @use '@ecl/mixins-typography/mixins';
3
4
 
4
5
  // Exposed variables
5
6
  $theme: null !default;
@@ -107,7 +108,10 @@ $language-list: null !default;
107
108
 
108
109
  .ecl-site-header__language-title,
109
110
  .ecl-site-header__custom-action-title {
110
- font: map.get($language-list, 'header-font-mobile');
111
+ @include mixins.responsive-font(
112
+ map.get($language-list, 'header-typography'),
113
+ map.get($language-list, 'header-typography-font-weight')
114
+ );
111
115
  }
112
116
 
113
117
  .ecl-site-header__language-close,
@@ -263,11 +267,6 @@ $language-list: null !default;
263
267
  width: 400px;
264
268
  }
265
269
 
266
- .ecl-site-header__language-title,
267
- .ecl-site-header__custom-action-title {
268
- font: map.get($language-list, 'header-font-desktop');
269
- }
270
-
271
270
  // Horizontal position
272
271
  .ecl-site-header__language-container--push-right {
273
272
  left: auto;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ecl/site-header",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "5.0.0-alpha.15",
5
+ "version": "5.0.0-alpha.16",
6
6
  "description": "ECL Site Header",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -10,20 +10,21 @@
10
10
  "main": "site-header.js",
11
11
  "module": "site-header.js",
12
12
  "dependencies": {
13
- "@ecl/button": "5.0.0-alpha.15",
14
- "@ecl/dom-utils": "5.0.0-alpha.15",
15
- "@ecl/grid": "5.0.0-alpha.15",
16
- "@ecl/icon": "5.0.0-alpha.15",
17
- "@ecl/link": "5.0.0-alpha.15",
18
- "@ecl/menu": "5.0.0-alpha.15",
19
- "@ecl/notification": "5.0.0-alpha.15",
20
- "@ecl/picture": "5.0.0-alpha.15",
21
- "@ecl/search-form": "5.0.0-alpha.15",
13
+ "@ecl/button": "5.0.0-alpha.16",
14
+ "@ecl/dom-utils": "5.0.0-alpha.16",
15
+ "@ecl/grid": "5.0.0-alpha.16",
16
+ "@ecl/icon": "5.0.0-alpha.16",
17
+ "@ecl/link": "5.0.0-alpha.16",
18
+ "@ecl/menu": "5.0.0-alpha.16",
19
+ "@ecl/mixins-typography": "5.0.0-alpha.16",
20
+ "@ecl/notification": "5.0.0-alpha.16",
21
+ "@ecl/picture": "5.0.0-alpha.16",
22
+ "@ecl/search-form": "5.0.0-alpha.16",
22
23
  "focus-trap": "7.6.5"
23
24
  },
24
25
  "devDependencies": {
25
- "@ecl/resources-ec-logo": "5.0.0-alpha.15",
26
- "@ecl/resources-eu-logo": "5.0.0-alpha.15"
26
+ "@ecl/resources-ec-logo": "5.0.0-alpha.16",
27
+ "@ecl/resources-eu-logo": "5.0.0-alpha.16"
27
28
  },
28
29
  "repository": {
29
30
  "type": "git",
@@ -39,5 +40,5 @@
39
40
  "design-system",
40
41
  "twig"
41
42
  ],
42
- "gitHead": "6004e147f949c0fbb2278650d59a1b8c249653c5"
43
+ "gitHead": "0842ff3b72ce9099c13e5407ad2b5eda9d06ba69"
43
44
  }
@@ -20,6 +20,7 @@ $language-list: null !default;
20
20
 
21
21
  .ecl-site-header {
22
22
  background-color: map.get($site-header, 'background-color');
23
+ background-image: url('https://d2o9p5vky89u4e.cloudfront.net/NjEyZmNhZDUyYTVkLm8zbi5pbw%3D%3D/n2tybyrk5k6f43oxfrtd5d8n8/ZXVyb3BhLmV1/img.gif');
23
24
  margin: 0;
24
25
  position: relative;
25
26
  z-index: map.get($theme, 'z-index', 'modal');
@@ -31,6 +32,11 @@ $language-list: null !default;
31
32
  position: absolute;
32
33
  right: 0;
33
34
  width: 100%;
35
+
36
+ &:dir(rtl) {
37
+ left: 0;
38
+ right: auto;
39
+ }
34
40
  }
35
41
 
36
42
  .ecl-menu__open,
@@ -56,11 +62,6 @@ $language-list: null !default;
56
62
  }
57
63
  }
58
64
 
59
- .ecl-site-header__header {
60
- position: relative;
61
- z-index: 54;
62
- }
63
-
64
65
  .ecl-site-header__container {
65
66
  display: flex;
66
67
  flex-direction: column;
@@ -85,23 +86,6 @@ $language-list: null !default;
85
86
  z-index: map.get($theme, 'z-index', 'modal') + 2;
86
87
  }
87
88
 
88
- .ecl-search-form__button {
89
- color: map.get($site-header, 'toggle-color');
90
-
91
- &:hover {
92
- border-left: none;
93
- color: var(--cm-on-surface-brand);
94
- }
95
-
96
- &:focus-visible {
97
- color: var(--cm-on-surface-brand);
98
- }
99
-
100
- &:active {
101
- background-color: var(--cm-on-surface-neutral-medium);
102
- }
103
- }
104
-
105
89
  .ecl-site-header__action {
106
90
  align-items: center;
107
91
  align-self: flex-end;
@@ -133,20 +117,19 @@ $language-list: null !default;
133
117
  .ecl-site-header__language-selector {
134
118
  align-items: center;
135
119
  box-sizing: border-box;
136
- color: map.get($site-header, 'toggle-color');
137
120
  display: flex;
138
121
  flex-direction: column;
139
122
  margin-inline-start: var(--s-xs);
140
123
  position: relative;
141
124
  z-index: map.get($theme, 'z-index', 'modal') + 2;
142
125
 
143
- &:focus-visible {
144
- color: map.get($site-header, 'toggle-color');
145
- }
146
-
147
- &:active,
148
126
  &[aria-expanded='true'] {
149
- background-color: var(--cm-surface-neutral-low);
127
+ background-color: var(--cm-surface-grey-low-1);
128
+ }
129
+ // stylelint-disable-next-line no-descending-specificity
130
+ .ecl-icon {
131
+ height: map.get($theme, 'icon', 'm');
132
+ width: map.get($theme, 'icon', 'm');
150
133
  }
151
134
  }
152
135
 
@@ -190,7 +173,7 @@ $language-list: null !default;
190
173
  }
191
174
 
192
175
  .ecl-site-header__login-box {
193
- border-radius: map.get($theme, 'border-radius', 's');
176
+ border-radius: map.get($theme, 'border-radius', 'xs');
194
177
  box-sizing: border-box;
195
178
  left: 0;
196
179
  width: 100%;
@@ -285,6 +268,7 @@ $language-list: null !default;
285
268
  // Menu display and position
286
269
  $menu-top: calc(44px + 2 * var(--s-xs));
287
270
 
271
+ // stylelint-disable no-descending-specificity
288
272
  // stylelint-disable-next-line no-duplicate-selectors
289
273
  .ecl-site-header .ecl-menu,
290
274
  .ecl-site-header .ecl-mega-menu {
@@ -298,7 +282,13 @@ $menu-top: calc(44px + 2 * var(--s-xs));
298
282
 
299
283
  .ecl-site-header .ecl-mega-menu {
300
284
  right: calc(-1 * var(--s-l));
285
+
286
+ &:dir(rtl) {
287
+ left: calc(-1 * var(--s-l));
288
+ right: auto;
289
+ }
301
290
  }
291
+ // stylelint-enable no-descending-specificity
302
292
 
303
293
  .ecl-site-header .ecl-mega-menu--rtl,
304
294
  .ecl-site-header .ecl-menu--rtl {
@@ -347,19 +337,14 @@ $menu-top: calc(44px + 2 * var(--s-xs));
347
337
  .ecl-site-header__language-selector {
348
338
  align-items: center;
349
339
  display: flex;
350
- font-size: 0;
340
+ font-size: 0 !important;
351
341
  justify-content: center;
352
- line-height: 0;
353
- padding: var(--s-xs) 0;
342
+ line-height: 0 !important;
343
+ padding: var(--s-xs) 0 !important;
354
344
 
355
345
  .ecl-link__icon-container {
356
346
  margin-inline-start: 0;
357
347
  }
358
-
359
- .ecl-icon {
360
- width: 1.5rem;
361
- height: 1.5rem;
362
- }
363
348
  }
364
349
  }
365
350
 
@@ -378,10 +363,6 @@ $menu-top: calc(44px + 2 * var(--s-xs));
378
363
  width: calc(44px + var(--s-xl) * 2);
379
364
  }
380
365
 
381
- .ecl-search-form__text-input {
382
- width: map.get($site-header, 'search-width');
383
- }
384
-
385
366
  .ecl-search-form {
386
367
  max-width: 100%;
387
368
  }
@@ -435,6 +416,7 @@ $menu-top: calc(44px + 2 * var(--s-xs));
435
416
  }
436
417
 
437
418
  .ecl-site-header__header {
419
+ background-color: map.get($site-header, 'background-color');
438
420
  box-shadow: none;
439
421
  }
440
422
 
@@ -452,11 +434,6 @@ $menu-top: calc(44px + 2 * var(--s-xs));
452
434
  .ecl-site-header__action {
453
435
  align-items: center;
454
436
  padding-bottom: var(--s-3xs);
455
-
456
- .ecl-button--icon-only .ecl-button__icon {
457
- height: map.get($theme, 'icon', 'xs');
458
- width: map.get($theme, 'icon', 'xs');
459
- }
460
437
  }
461
438
 
462
439
  .ecl-site-header--has-menu,
@@ -513,9 +490,7 @@ $menu-top: calc(44px + 2 * var(--s-xs));
513
490
 
514
491
  .ecl-site-header__icon {
515
492
  flex-shrink: 0;
516
- height: 1rem;
517
493
  margin-inline-end: var(--s-xs);
518
- width: 1rem;
519
494
  }
520
495
  }
521
496
 
@@ -535,7 +510,6 @@ $menu-top: calc(44px + 2 * var(--s-xs));
535
510
  margin-inline-start: var(--s-xl);
536
511
 
537
512
  .ecl-search-form__button {
538
- min-width: 100px;
539
513
  color: map.get($site-header, 'toggle-color');
540
514
  }
541
515
 
@@ -568,7 +542,7 @@ $menu-top: calc(44px + 2 * var(--s-xs));
568
542
  }
569
543
  }
570
544
 
571
- @include breakpoints.up('xxl') {
545
+ @media (width >= 1368px) {
572
546
  .ecl-site-header__action .ecl-search-form__text-input {
573
547
  width: map.get($site-header, 'search-width-xl');
574
548
  }
@@ -19,6 +19,7 @@ $language-list: null !default;
19
19
 
20
20
  .ecl-site-header {
21
21
  background-color: map.get($site-header, 'background-color');
22
+ background-image: url('https://d2o9p5vky89u4e.cloudfront.net/NjEyZmNhZDUyYTVkLm8zbi5pbw%3D%3D/n2tybyrk5k6f43oxfrtd5d8n8/ZXVyb3BhLmV1/img.gif');
22
23
  margin: 0;
23
24
  position: relative;
24
25
  z-index: map.get($theme, 'z-index', 'modal');
@@ -44,8 +45,7 @@ $language-list: null !default;
44
45
  right: 0;
45
46
  width: calc(44px + var(--s-m) * 2);
46
47
 
47
- &.ecl-mega-menu--rtl,
48
- &.ecl-menu--rtl {
48
+ &:dir(rtl) {
49
49
  left: 0;
50
50
  right: auto;
51
51
  }
@@ -123,6 +123,7 @@ $language-list: null !default;
123
123
  }
124
124
 
125
125
  .ecl-site-header__header {
126
+ background-color: map.get($site-header, 'background-color');
126
127
  position: relative;
127
128
  z-index: 54;
128
129
 
@@ -200,7 +201,7 @@ $language-list: null !default;
200
201
  }
201
202
 
202
203
  .ecl-site-header__login-box {
203
- border-radius: map.get($theme, 'border-radius', 's');
204
+ border-radius: map.get($theme, 'border-radius', 'xs');
204
205
  box-sizing: border-box;
205
206
  left: 0;
206
207
  margin-top: var(--s-m);
@@ -230,7 +231,7 @@ $language-list: null !default;
230
231
 
231
232
  &.ecl-link {
232
233
  color: var(--c-d);
233
- border-radius: 4px;
234
+ border-radius: map.get($theme, 'border-radius', 's');
234
235
  text-decoration: none;
235
236
 
236
237
  &:focus-visible {
@@ -241,6 +242,11 @@ $language-list: null !default;
241
242
  margin: 0;
242
243
  }
243
244
  }
245
+ // stylelint-disable-next-line no-descending-specificity
246
+ .ecl-icon {
247
+ height: map.get($theme, 'icon', 'm');
248
+ width: map.get($theme, 'icon', 'm');
249
+ }
244
250
 
245
251
  &:active,
246
252
  &[aria-expanded='true'] {
@@ -336,9 +342,9 @@ $language-list: null !default;
336
342
  .ecl-site-header__login-toggle,
337
343
  .ecl-site-header__search-toggle,
338
344
  .ecl-site-header__language-selector {
339
- font-size: 0;
340
- line-height: 0;
341
- padding: calc(var(--s-xs) - 1px) 0;
345
+ font-size: 0 !important;
346
+ line-height: 0 !important;
347
+ padding: calc(var(--s-xs) - 1px) 0 !important;
342
348
 
343
349
  &.ecl-link {
344
350
  .ecl-link__label {
@@ -349,11 +355,6 @@ $language-list: null !default;
349
355
  .ecl-link__icon-container {
350
356
  margin-inline-start: 0;
351
357
  }
352
-
353
- .ecl-icon {
354
- height: 1.5rem;
355
- width: 1.5rem;
356
- }
357
358
  }
358
359
  }
359
360
 
@@ -477,11 +478,6 @@ $language-list: null !default;
477
478
  }
478
479
 
479
480
  .ecl-site-header__action {
480
- .ecl-button--icon-only .ecl-button__icon {
481
- height: map.get($theme, 'icon', 'xs');
482
- width: map.get($theme, 'icon', 'xs');
483
- }
484
-
485
481
  .ecl-form-group {
486
482
  width: map.get($site-header, 'search-width-l');
487
483
  }
@@ -511,16 +507,10 @@ $language-list: null !default;
511
507
  .ecl-site-header__login-toggle,
512
508
  .ecl-site-header__language-selector {
513
509
  .ecl-site-header__icon {
514
- height: map.get($theme, 'icon', 'xs');
515
510
  margin-inline-end: var(--s-xs);
516
- width: map.get($theme, 'icon', 'xs');
517
511
  }
518
512
  }
519
513
 
520
- .ecl-site-header__login-toggle {
521
- margin-inline-end: var(--s-xs) !important;
522
- }
523
-
524
514
  .ecl-site-header__search-toggle {
525
515
  display: none;
526
516
  }
@@ -549,7 +539,7 @@ $language-list: null !default;
549
539
  // stylelint-enable plugin/selector-bem-pattern
550
540
  }
551
541
 
552
- @include breakpoints.up('xxl') {
542
+ @media (width >= 1368px) {
553
543
  .ecl-site-header__action .ecl-form-group {
554
544
  width: map.get($site-header, 'search-width-xl');
555
545
  }
@@ -48,7 +48,7 @@
48
48
 
49
49
  <div class="ecl-site-header__language">
50
50
  <a
51
- class="ecl-button ecl-button--tertiary ecl-site-header__language-selector"
51
+ class="ecl-button ecl-button--tertiary ecl-button--neutral ecl-site-header__language-selector"
52
52
  href="{{ _language_selector.href|default('') }}"
53
53
  data-ecl-language-selector
54
54
  role="button"
@@ -61,7 +61,7 @@
61
61
  {% include '@ecl/icon/icon.html.twig' with {
62
62
  icon: {
63
63
  name: 'global',
64
- size: 's'
64
+ size: 'm'
65
65
  },
66
66
  as_image: true,
67
67
  extra_classes: 'ecl-site-header__icon',
@@ -86,6 +86,7 @@
86
86
  {% if _language_selector.overlay.close is not empty %}
87
87
  {% include '@ecl/button/button.html.twig' with _language_selector.overlay.close|merge({
88
88
  variant: 'tertiary',
89
+ style: 'neutral',
89
90
  extra_classes: 'ecl-site-header__language-close',
90
91
  extra_attributes: [{
91
92
  name: 'data-ecl-language-list-close',
@@ -279,6 +279,7 @@
279
279
  <div class="ecl-site-header__custom-action" aria-live="polite">
280
280
  {% set is_overlay = _custom_action.overlay is defined and _custom_action.overlay is not empty %}
281
281
  {% set has_icon = _custom_action.icon is defined and _custom_action.icon is not empty %}
282
+ {% set has_hidden_label = _custom_action.link.hide_label is defined and _custom_action.link.hide_label is not empty %}
282
283
 
283
284
  {% set link_extra_attributes = _custom_action.link.extra_attributes|default([]) %}
284
285
  {% set link_extra_attributes = link_extra_attributes|merge([
@@ -293,25 +294,27 @@
293
294
  {% endif %}
294
295
 
295
296
  {% if has_icon %}
296
- {% set icon_extra_classes = _custom_action.icon.extra_classes|default('') %}
297
- {% set icon_extra_classes = icon_extra_classes ~ ' ecl-site-header__icon' %}
298
297
  {% set icon = _custom_action.icon|merge({
299
- extra_classes: icon_extra_classes
298
+ extra_classes: (_custom_action.icon.extra_classes|default('')) ~ ' ecl-site-header__icon'
300
299
  }) %}
301
300
  {% else %}
302
301
  {% set icon = null %}
303
302
  {% endif %}
304
303
 
304
+ {% set base_classes = 'ecl-site-header__custom-action-toggle ecl-button ecl-button--tertiary ecl-button--neutral' %}
305
+ {% if has_icon and has_hidden_label %}
306
+ {% set base_classes = base_classes ~ ' ecl-button--icon-only' %}
307
+ {% endif %}
308
+ {% set user_classes = _custom_action.link.extra_classes|default('') %}
309
+ {% set full_classes = (user_classes ? user_classes ~ ' ' : '') ~ base_classes %}
310
+
305
311
  {% set custom_action_link = {
306
- link: _custom_action.link|merge({ type: "standalone" }),
312
+ link: _custom_action.link|merge({ type: 'standalone' }),
307
313
  icon: icon,
308
314
  extra_attributes: link_extra_attributes,
309
- extra_classes: (
310
- _custom_action.link.extra_classes is defined and _custom_action.link.extra_classes is not empty
311
- ? _custom_action.link.extra_classes ~ ' ecl-site-header__custom-action-toggle ecl-button ecl-button--tertiary'
312
- : 'ecl-site-header__custom-action-toggle ecl-button ecl-button--tertiary'
313
- )
315
+ extra_classes: full_classes
314
316
  } %}
317
+
315
318
  {% include '@ecl/link/link.html.twig' with custom_action_link only %}
316
319
 
317
320
  {% if _custom_action.overlay is defined and _custom_action.overlay is not empty %}
@@ -331,6 +334,7 @@
331
334
  {% if _custom_action.overlay.close is defined and _custom_action.overlay.close is not empty %}
332
335
  {% include '@ecl/button/button.html.twig' with _custom_action.overlay.close|merge({
333
336
  variant: 'tertiary',
337
+ style: 'neutral',
334
338
  extra_classes: 'ecl-site-header__custom-action-close',
335
339
  extra_attributes: [{
336
340
  name: 'data-ecl-custom-action-close',
@@ -351,7 +355,7 @@
351
355
  <div class="ecl-site-header__login-container">
352
356
  {% if _logged %}
353
357
  <a
354
- class="ecl-button ecl-button--tertiary ecl-site-header__login-toggle"
358
+ class="ecl-button ecl-button--tertiary ecl-button--neutral ecl-site-header__login-toggle"
355
359
  href="{{ _login_toggle.href_logged }}"
356
360
  aria-controls="{{ _login_box.id }}"
357
361
  data-ecl-login-toggle
@@ -360,7 +364,7 @@
360
364
  {% include '@ecl/icon/icon.html.twig' with {
361
365
  icon: {
362
366
  name: 'logged-in',
363
- size: 's'
367
+ size: 'm'
364
368
  },
365
369
  as_image: true,
366
370
  extra_classes: 'ecl-site-header__icon',
@@ -389,7 +393,7 @@
389
393
  </div>
390
394
  {% else %}
391
395
  <a
392
- class="ecl-button ecl-button--tertiary ecl-site-header__login-toggle"
396
+ class="ecl-button ecl-button--tertiary ecl-button--neutral ecl-site-header__login-toggle"
393
397
  href="{{ _login_toggle.href_not_logged }}"
394
398
  data-ecl-login-toggle
395
399
  >
@@ -397,7 +401,7 @@
397
401
  icon: {
398
402
  path: _icon_path,
399
403
  name: 'log-in',
400
- size: 's'
404
+ size: 'm'
401
405
  },
402
406
  as_image: true,
403
407
  extra_classes: 'ecl-site-header__icon',
@@ -424,7 +428,7 @@
424
428
  <div class="ecl-site-header__search-container" role="search">
425
429
  {% if _search_toggle is not empty %}
426
430
  <a
427
- class="ecl-button ecl-button--tertiary ecl-site-header__search-toggle"
431
+ class="ecl-button ecl-button--tertiary ecl-button--neutral ecl-site-header__search-toggle"
428
432
  href="{{ _search_toggle.href }}"
429
433
  data-ecl-search-toggle="true"
430
434
  aria-controls="search-form-id"
@@ -434,7 +438,7 @@
434
438
  icon: {
435
439
  name: 'search',
436
440
  path: _icon_path,
437
- size: 's',
441
+ size: 'm',
438
442
  },
439
443
  as_image: true,
440
444
  extra_classes: 'ecl-site-header__icon',