@1024pix/pix-ui 63.0.0 → 64.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,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,9 +8,6 @@ export default {
8
8
  select: {
9
9
  search: 'Search',
10
10
  },
11
- tag: {
12
- removeButton: 'Remove',
13
- },
14
11
  stepper: {
15
12
  ariaLabel: 'Step {current, number} of {total, number}',
16
13
  },
@@ -9,9 +9,6 @@ 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',
@@ -8,10 +8,6 @@ export default {
8
8
  select: {
9
9
  search: 'Zoeken',
10
10
  },
11
-
12
- tag: {
13
- removeButton: 'Verwijderen',
14
- },
15
11
  stepper: {
16
12
  ariaLabel: 'Stap {current, number} van {total, number}',
17
13
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "63.0.0",
3
+ "version": "64.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"