@1024pix/pix-ui 63.0.0 → 65.0.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.
@@ -1,10 +1,21 @@
1
+ import { warn } from '@ember/debug';
1
2
  import Component from '@glimmer/component';
2
3
  import { eq } from 'ember-truth-helpers';
3
4
 
4
- import { formatMessage } from '../translations';
5
5
  import PixStep from './pix-step';
6
6
 
7
7
  export default class PixStepperComponent extends Component {
8
+ constructor(...args) {
9
+ super(...args);
10
+ warn(
11
+ 'PixStepper: @texts attribute is mandatory for accessibility.',
12
+ Boolean(this.args.texts?.ariaLabel),
13
+ {
14
+ id: 'pix-ui.stepper-component.texts.mandatory',
15
+ },
16
+ );
17
+ }
18
+
8
19
  get cssClass() {
9
20
  const classes = ['pix-stepper'];
10
21
 
@@ -19,15 +30,8 @@ export default class PixStepperComponent extends Component {
19
30
  return this.args.currentStep - 1;
20
31
  }
21
32
 
22
- get ariaLabel() {
23
- return formatMessage(this.args.locale ?? 'fr', 'stepper.ariaLabel', {
24
- current: this.args.currentStep,
25
- total: this.args.steps.length,
26
- });
27
- }
28
-
29
33
  <template>
30
- <ol class={{this.cssClass}} role="list" aria-label={{this.ariaLabel}} ...attributes>
34
+ <ol class={{this.cssClass}} role="list" ...attributes aria-label={{@texts.ariaLabel}}>
31
35
  {{#each @steps as |step index|}}
32
36
  <PixStep
33
37
  @index={{index}}
@@ -1,9 +1,22 @@
1
+ import { warn } from '@ember/debug';
1
2
  import Component from '@glimmer/component';
2
3
 
3
- import { formatMessage } from '../translations';
4
4
  import PixIconButton from './pix-icon-button';
5
5
 
6
6
  export default class PixTag extends Component {
7
+ constructor(...args) {
8
+ super(...args);
9
+ if (this.args.onRemove) {
10
+ warn(
11
+ 'PixTag: texts.removeButtonLabel is mandatory when onRemove is provided ',
12
+ Boolean(this.args.texts?.removeButtonLabel),
13
+ {
14
+ id: 'pix-ui.pix-tag.texts.mandatory',
15
+ },
16
+ );
17
+ }
18
+ }
19
+
7
20
  get classes() {
8
21
  const { color } = this.args;
9
22
  const classes = [];
@@ -11,16 +24,12 @@ export default class PixTag extends Component {
11
24
  return classes.join(' ');
12
25
  }
13
26
 
14
- get ariaLabel() {
15
- return formatMessage(this.args.locale || 'fr', 'tag.removeButton');
16
- }
17
-
18
27
  <template>
19
28
  <div class="pix-tag {{this.classes}}" ...attributes>
20
29
  {{yield}}
21
- {{#if @displayRemoveButton}}
30
+ {{#if @onRemove}}
22
31
  <PixIconButton
23
- @ariaLabel={{this.ariaLabel}}
32
+ @ariaLabel={{@texts.removeButtonLabel}}
24
33
  @iconName="close"
25
34
  @size="xsmall"
26
35
  @triggerAction={{@onRemove}}
@@ -8,12 +8,6 @@ export default {
8
8
  select: {
9
9
  search: 'Search',
10
10
  },
11
- tag: {
12
- removeButton: 'Remove',
13
- },
14
- stepper: {
15
- ariaLabel: 'Step {current, number} of {total, number}',
16
- },
17
11
  pixNavigation: {
18
12
  shrinkNavigationAriaLabel: 'Reduce the width of the navigation menu',
19
13
  expandNavigationAriaLabel: 'Return to the initial width of the navigation menu',
@@ -8,7 +8,4 @@ export default {
8
8
  select: {
9
9
  search: 'Buscar',
10
10
  },
11
- stepper: {
12
- ariaLabel: 'Paso {current, number} de {total, number}',
13
- },
14
11
  };
@@ -8,9 +8,6 @@ export default {
8
8
  select: {
9
9
  search: 'Buscar',
10
10
  },
11
- stepper: {
12
- ariaLabel: 'Paso {current, number} de {total, number}',
13
- },
14
11
  pixNavigation: {
15
12
  shrinkNavigationAriaLabel: 'Reducir el ancho del menú de navegación',
16
13
  expandNavigationAriaLabel: 'Volver al ancho inicial del menú de navegación',
@@ -9,14 +9,8 @@ export default {
9
9
  select: {
10
10
  search: 'Rechercher',
11
11
  },
12
- tag: {
13
- removeButton: 'Supprimer',
14
- },
15
12
  pixNavigation: {
16
13
  shrinkNavigationAriaLabel: 'Réduire la largeur du menu de navigation',
17
14
  expandNavigationAriaLabel: 'Revenir à la largeur initiale du menu de navigation',
18
15
  },
19
- stepper: {
20
- ariaLabel: 'Étape {current, number} sur {total, number}',
21
- },
22
16
  };
@@ -8,13 +8,6 @@ export default {
8
8
  select: {
9
9
  search: 'Zoeken',
10
10
  },
11
-
12
- tag: {
13
- removeButton: 'Verwijderen',
14
- },
15
- stepper: {
16
- ariaLabel: 'Stap {current, number} van {total, number}',
17
- },
18
11
  pixNavigation: {
19
12
  shrinkNavigationAriaLabel: 'De breedte van het navigatiemenu verkleinen',
20
13
  expandNavigationAriaLabel: 'Terug naar de oorspronkelijke breedte van het navigatiemenu',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "63.0.0",
3
+ "version": "65.0.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"