@1024pix/pix-ui 45.2.0 → 45.3.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.
@@ -9,8 +9,17 @@ Le PixInput permet de créer un champ de texte.
9
9
 
10
10
  ## Accessibilité
11
11
 
12
- Si vous utilisez le `PixInput` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
13
- Il est possible d'ajouter un label en dehors du composant en précisant bien un attribut `for` correspondant à l'`@id` passé au PixInput.
12
+ La propriété label est optionnelle pour le composant.
13
+
14
+ Mais au niveau de l'accessibilité, il est quand même nécessaire que le champ soit rattaché à un label.
15
+
16
+ Il y a alors plusieurs possibilités :
17
+
18
+ - Vous pouvez cacher le label visuellement mais le rendre disponible pour les lecteurs d'écran via la propriété `screenReaderOnly` à `true`.
19
+ - Les attributs `aria-label` et `aria-labelledby` sont utilisables.
20
+ - Un attribut `@for` pointant vers l'id de l'input peut être ajouté à un composant `<PixLabel />` extérieur.
21
+
22
+ ## Tests
14
23
 
15
24
  Pour acceder à l'élément via son label avec testing-library:
16
25
 
@@ -31,7 +31,7 @@ export default {
31
31
  label: {
32
32
  name: 'label',
33
33
  description: 'Le label du champ',
34
- type: { name: 'string', required: true },
34
+ type: { name: 'string', required: false },
35
35
  table: {
36
36
  type: { summary: 'string' },
37
37
  },
@@ -9,13 +9,19 @@ Un textarea permettant d'avoir un champ de saisie libre.
9
9
 
10
10
  Optionellement, il peut afficher le nombre de caractères tapés ainsi que le nombre de caractères maximum.
11
11
 
12
+ <Story of={ComponentStories.textarea} height={150} />
13
+
12
14
  ## Accessibilité
13
15
 
14
- Si vous utilisez le `PixTextarea` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
16
+ La propriété label est optionnelle pour le composant.
17
+
18
+ Mais au niveau de l'accessibilité, il est quand même nécessaire que le champ soit rattaché à un label.
15
19
 
16
- <Story of={ComponentStories.textarea} height={100} />
20
+ Il y a alors plusieurs possibilités :
17
21
 
18
- ## Without Label
22
+ - Vous pouvez cacher le label visuellement mais le rendre disponible pour les lecteurs d'écran via la propriété `screenReaderOnly` à `true`.
23
+ - Les attributs `aria-label` et `aria-labelledby` sont utilisables.
24
+ - Un attribut `@for` pointant vers l'id du textarea peut être ajouté à un composant `<PixLabel />` extérieur.
19
25
 
20
26
  <Story of={ComponentStories.textareaWithoutLabel} height={100} />
21
27
 
@@ -11,7 +11,7 @@ export default {
11
11
  value: {
12
12
  name: 'value',
13
13
  description: 'Valeur du champ',
14
- type: { name: 'string', required: true },
14
+ type: { name: 'string', required: false },
15
15
  },
16
16
  maxlength: {
17
17
  name: 'maxlength',
@@ -23,11 +23,10 @@ export default {
23
23
  description: 'Affiche une erreur en dessous du champ.',
24
24
  type: { name: 'string', required: false },
25
25
  },
26
-
27
26
  label: {
28
27
  name: 'label',
29
28
  description: 'Donne un label au champ.',
30
- type: { name: 'string', required: true },
29
+ type: { name: 'string', required: false },
31
30
  },
32
31
  subLabel: {
33
32
  name: 'subLabel',
@@ -109,11 +108,13 @@ const TemplateWithoutlabel = (args) => {
109
108
  export const textarea = Template.bind({});
110
109
  textarea.args = {
111
110
  id: 'textarea',
111
+ label: 'Label du textarea',
112
+ subLabel: 'Sous-label',
112
113
  value: 'Contenu du textarea',
113
114
  };
114
115
 
115
116
  export const textareaWithoutLabel = TemplateWithoutlabel.bind({});
116
- textarea.args = {
117
+ textareaWithoutLabel.args = {
117
118
  id: 'textarea-without-label',
118
- value: 'Contenu du textarea',
119
+ value: 'Contenu du textarea sans label affiché',
119
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "45.2.0",
3
+ "version": "45.3.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"
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@1024pix/ember-testing-library": "^1.1.0",
62
- "@1024pix/eslint-config": "^1.2.5",
62
+ "@1024pix/eslint-config": "^1.2.10",
63
63
  "@1024pix/stylelint-config": "^5.1.10",
64
64
  "@babel/eslint-parser": "^7.19.1",
65
65
  "@babel/plugin-proposal-decorators": "^7.20.5",