@1024pix/pix-ui 66.0.0 → 67.0.1

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.
@@ -6,7 +6,6 @@ import { inject as service } from '@ember/service';
6
6
  import Component from '@glimmer/component';
7
7
  import { tracked } from '@glimmer/tracking';
8
8
 
9
- import { formatMessage } from '../translations';
10
9
  import PixButton from './pix-button';
11
10
  import PixIconButton from './pix-icon-button';
12
11
 
@@ -18,10 +17,24 @@ export default class PixNavigation extends Component {
18
17
  super(...args);
19
18
  this._navigationId = 'navigation-' + guidFor(this);
20
19
  warn(
21
- 'PixNavigation: @openLabel and @closeLabel are required',
22
- this.args.openLabel && this.args.closeLabel,
20
+ 'PixNavigation: @texts.openMenu and @texts.closeMenu are required',
21
+ this.args.texts?.openMenu && this.args.texts?.closeMenu,
23
22
  {
24
- id: 'pix-navigation.open-close-labels',
23
+ id: 'pix-navigation.open-close-menu.required',
24
+ },
25
+ );
26
+ warn(
27
+ 'PixNavigation: @texts.mainNavigation attribute is required for accessibility.',
28
+ this.args.texts?.mainNavigation,
29
+ {
30
+ id: 'pix-ui.stepper-component.texts.mainNavigation.required',
31
+ },
32
+ );
33
+ warn(
34
+ 'PixNavigation: @texts.expandNavigation and @texts.shrinkNavigation attributes are required for accessibility.',
35
+ this.args.texts?.expandNavigation && this.args.texts?.shrinkNavigation,
36
+ {
37
+ id: 'pix-ui.stepper-component.texts.shrink-expand-navigation.required',
25
38
  },
26
39
  );
27
40
  }
@@ -29,10 +42,6 @@ export default class PixNavigation extends Component {
29
42
  @tracked
30
43
  navigationMenuOpened = false;
31
44
 
32
- formatMessage(message, values) {
33
- return formatMessage(this.args.locale ?? 'fr', `pixNavigation.${message}`, values);
34
- }
35
-
36
45
  @action
37
46
  toggleNavigationMenu() {
38
47
  this.navigationMenuOpened = !this.navigationMenuOpened;
@@ -64,11 +73,13 @@ export default class PixNavigation extends Component {
64
73
  }
65
74
 
66
75
  get shrunkNavigationAriaLabel() {
67
- return this.formatMessage(
68
- this.shrinkNavigationService.isShrunk
69
- ? 'expandNavigationAriaLabel'
70
- : 'shrinkNavigationAriaLabel',
71
- );
76
+ return this.shrinkNavigationService.isShrunk
77
+ ? this.args.texts.expandNavigation
78
+ : this.args.texts.shrinkNavigation;
79
+ }
80
+
81
+ get menuLabel() {
82
+ return this.navigationMenuOpened ? this.args.texts.closeMenu : this.args.texts.openMenu;
72
83
  }
73
84
 
74
85
  get navigationId() {
@@ -104,11 +115,7 @@ export default class PixNavigation extends Component {
104
115
  @triggerAction={{this.toggleNavigationMenu}}
105
116
  >
106
117
  <span class="screen-reader-only">
107
- {{#if this.navigationMenuOpened}}
108
- {{@closeLabel}}
109
- {{else}}
110
- {{@openLabel}}
111
- {{/if}}
118
+ {{this.menuLabel}}
112
119
  </span>
113
120
  </PixButton>
114
121
  </div>
@@ -116,7 +123,7 @@ export default class PixNavigation extends Component {
116
123
  <nav
117
124
  class="pix-navigation__nav"
118
125
  {{on "click" this.closeNavigation}}
119
- aria-label={{@navigationAriaLabel}}
126
+ aria-label={{@texts.mainNavigation}}
120
127
  id={{this.navigationId}}
121
128
  >
122
129
  {{yield to="navElements"}}
@@ -2,8 +2,4 @@ export default {
2
2
  select: {
3
3
  search: 'Search',
4
4
  },
5
- pixNavigation: {
6
- shrinkNavigationAriaLabel: 'Reduce the width of the navigation menu',
7
- expandNavigationAriaLabel: 'Return to the initial width of the navigation menu',
8
- },
9
5
  };
@@ -2,8 +2,4 @@ export default {
2
2
  select: {
3
3
  search: 'Buscar',
4
4
  },
5
- pixNavigation: {
6
- shrinkNavigationAriaLabel: 'Reducir el ancho del menú de navegación',
7
- expandNavigationAriaLabel: 'Volver al ancho inicial del menú de navegación',
8
- },
9
5
  };
@@ -2,8 +2,4 @@ export default {
2
2
  select: {
3
3
  search: 'Rechercher',
4
4
  },
5
- pixNavigation: {
6
- shrinkNavigationAriaLabel: 'Réduire la largeur du menu de navigation',
7
- expandNavigationAriaLabel: 'Revenir à la largeur initiale du menu de navigation',
8
- },
9
5
  };
@@ -2,8 +2,4 @@ export default {
2
2
  select: {
3
3
  search: 'Zoeken',
4
4
  },
5
- pixNavigation: {
6
- shrinkNavigationAriaLabel: 'De breedte van het navigatiemenu verkleinen',
7
- expandNavigationAriaLabel: 'Terug naar de oorspronkelijke breedte van het navigatiemenu',
8
- },
9
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "66.0.0",
3
+ "version": "67.0.1",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"