@1024pix/pix-ui 44.3.7 → 45.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.
Files changed (51) hide show
  1. package/addon/components/pix-checkbox.hbs +2 -2
  2. package/addon/components/pix-filterable-and-searchable-select.hbs +5 -4
  3. package/addon/components/pix-input-base.js +44 -0
  4. package/addon/components/pix-input-password.hbs +46 -39
  5. package/addon/components/pix-input-password.js +12 -27
  6. package/addon/components/pix-input.hbs +25 -23
  7. package/addon/components/pix-input.js +10 -16
  8. package/addon/components/pix-label.js +2 -4
  9. package/addon/components/pix-multi-select.hbs +7 -6
  10. package/addon/components/pix-multi-select.js +0 -3
  11. package/addon/components/pix-pagination.hbs +3 -2
  12. package/addon/components/pix-radio-button.hbs +2 -2
  13. package/addon/components/pix-search-input.hbs +7 -6
  14. package/addon/components/pix-search-input.js +6 -19
  15. package/addon/components/pix-select.hbs +135 -129
  16. package/addon/components/pix-textarea.hbs +23 -19
  17. package/addon/components/pix-textarea.js +6 -0
  18. package/addon/components/pix-toggle.hbs +3 -3
  19. package/addon/components/pix-toggle.js +5 -0
  20. package/addon/styles/_pix-input-password.scss +19 -13
  21. package/addon/styles/_pix-input.scss +9 -2
  22. package/addon/styles/_pix-label.scss +0 -1
  23. package/addon/styles/_pix-multi-select.scss +9 -1
  24. package/addon/styles/_pix-search-input.scss +8 -1
  25. package/addon/styles/_pix-select.scss +9 -1
  26. package/addon/styles/_pix-toggle.scss +8 -1
  27. package/addon/styles/pix-design-tokens/_fonts.scss +10 -0
  28. package/addon/styles/pix-design-tokens/_typography.scss +6 -2
  29. package/app/stories/form.stories.js +31 -24
  30. package/app/stories/pix-checkbox.mdx +2 -2
  31. package/app/stories/pix-checkbox.stories.js +52 -33
  32. package/app/stories/pix-filter-banner.stories.js +9 -6
  33. package/app/stories/pix-filterable-and-searchable-select.mdx +9 -8
  34. package/app/stories/pix-filterable-and-searchable-select.stories.js +13 -11
  35. package/app/stories/pix-input-password.mdx +8 -5
  36. package/app/stories/pix-input-password.stories.js +50 -28
  37. package/app/stories/pix-input.mdx +14 -8
  38. package/app/stories/pix-input.stories.js +46 -21
  39. package/app/stories/pix-label.stories.js +3 -2
  40. package/app/stories/pix-multi-select.mdx +7 -5
  41. package/app/stories/pix-multi-select.stories.js +74 -36
  42. package/app/stories/pix-radio-button.mdx +3 -1
  43. package/app/stories/pix-radio-button.stories.js +47 -40
  44. package/app/stories/pix-search-input.mdx +6 -4
  45. package/app/stories/pix-search-input.stories.js +57 -22
  46. package/app/stories/pix-select.mdx +4 -3
  47. package/app/stories/pix-select.stories.js +64 -57
  48. package/app/stories/pix-textarea.mdx +6 -2
  49. package/app/stories/pix-textarea.stories.js +42 -20
  50. package/app/stories/pix-toggle.stories.js +12 -10
  51. package/package.json +1 -1
@@ -13,16 +13,6 @@ export default {
13
13
  description: "Valeur de l'input",
14
14
  type: { name: 'string', required: false },
15
15
  },
16
- label: {
17
- name: 'label',
18
- description: "Le label de l'input",
19
- type: { name: 'string', required: false },
20
- },
21
- information: {
22
- name: 'information',
23
- description: 'Un descriptif complétant le label',
24
- type: { name: 'string', required: false },
25
- },
26
16
  validationStatus: {
27
17
  name: 'validationStatus',
28
18
  description:
@@ -37,17 +27,40 @@ export default {
37
27
  "Affiche le message d'erreur donné. Doit s'accompagner du paramètre validationStatus en 'error'",
38
28
  type: { name: 'string', required: false },
39
29
  },
30
+
31
+ label: {
32
+ name: 'label',
33
+ description: 'Le label du champ',
34
+ type: { name: 'string', required: true },
35
+ table: {
36
+ type: { summary: 'string' },
37
+ },
38
+ },
39
+ subLabel: {
40
+ name: 'subLabel',
41
+ description: 'Un descriptif complétant le label',
42
+ type: { name: 'string', required: false },
43
+ },
40
44
  requiredLabel: {
41
45
  name: 'requiredLabel',
42
- description:
43
- 'Label indiquant que le champ est requis, le paramètre @label devient obligatoire avec ce paramètre.',
46
+ description: 'Label indiquant que le champ est requis.',
44
47
  type: { name: 'string', required: false },
45
48
  table: {
46
49
  type: { summary: 'string' },
47
50
  },
48
51
  },
49
- labelSize: {
50
- name: 'labelSize',
52
+ screenReaderOnly: {
53
+ name: 'screenReaderOnly',
54
+ description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
55
+ control: { type: 'boolean' },
56
+ type: { name: 'boolean', required: false },
57
+ table: {
58
+ type: { summary: 'boolean' },
59
+ defaultValue: { summary: false },
60
+ },
61
+ },
62
+ size: {
63
+ name: 'size',
51
64
  description: 'Correspond à la taille de la police du label.',
52
65
  type: { name: 'string', required: false },
53
66
  table: {
@@ -56,6 +69,15 @@ export default {
56
69
  control: { type: 'select' },
57
70
  options: ['small', 'large', 'default'],
58
71
  },
72
+ inlineLabel: {
73
+ name: 'inlineLabel',
74
+ description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
75
+ type: { name: 'boolean', required: false },
76
+ table: {
77
+ defaultValue: { summary: false },
78
+ },
79
+ control: { type: 'boolean' },
80
+ },
59
81
  },
60
82
  };
61
83
 
@@ -63,16 +85,19 @@ const Template = (args) => {
63
85
  return {
64
86
  template: hbs`<PixInput
65
87
  @id={{this.id}}
66
- @label={{this.label}}
67
- @information={{this.information}}
68
88
  @errorMessage={{this.errorMessage}}
69
89
  placeholder='Jeanne, Pierre ...'
70
- @requiredLabel={{this.requiredLabel}}
71
90
  @validationStatus={{this.validationStatus}}
72
- @labelSize={{this.labelSize}}
91
+ @size={{this.size}}
73
92
  disabled={{this.disabled}}
74
93
  readonly={{this.readonly}}
75
- />`,
94
+ @subLabel={{this.subLabel}}
95
+ @inlineLabel={{this.inlineLabel}}
96
+ @requiredLabel={{this.requiredLabel}}
97
+ @screenReaderOnly={{this.screenReaderOnly}}
98
+ >
99
+ <:label>{{this.label}}</:label>
100
+ </PixInput>`,
76
101
  context: args,
77
102
  };
78
103
  };
@@ -80,14 +105,14 @@ const Template = (args) => {
80
105
  export const Default = Template.bind({});
81
106
  Default.args = {
82
107
  id: 'first-name',
83
- ariaLabel: 'Prénom',
108
+ label: 'Prénom',
84
109
  };
85
110
 
86
111
  export const withLabel = Template.bind({});
87
112
  withLabel.args = {
88
113
  id: 'first-name',
89
114
  label: 'Prénom',
90
- information: 'a small information',
115
+ subLabel: 'a small information',
91
116
  };
92
117
 
93
118
  export const errorState = Template.bind({});
@@ -36,8 +36,8 @@ export default {
36
36
  defaultValue: { summary: false },
37
37
  },
38
38
  },
39
- labelSize: {
40
- name: 'labelSize',
39
+ size: {
40
+ name: 'size',
41
41
  description: 'Correspond à la taille de la police du label.',
42
42
  type: { name: 'string', required: false },
43
43
  table: {
@@ -64,6 +64,7 @@ const Template = (args) => {
64
64
  template: hbs`<PixLabel
65
65
  @id={{this.id}}
66
66
  @subLabel={{this.subLabel}}
67
+ @size={{this.size}}
67
68
  @requiredLabel={{this.requiredLabel}}
68
69
  @screenReaderOnly={{this.screenReaderOnly}}
69
70
  @inlineLabel={{this.inlineLabel}}
@@ -6,7 +6,11 @@ import * as ComponentStories from './pix-multi-select.stories';
6
6
  # Pix Multi Select
7
7
 
8
8
  Un select custom permettant une gestion de la multiselection. Permet de passer soit du texte brut soit des composants à sa liste. (PixStars etc...)
9
- L'ajout de `class` et d'autres attributs comme `aria-label` sont possibles.
9
+ L'ajout de `class` et d'autres attributs sont possibles.
10
+
11
+ ## Accessibilité
12
+
13
+ Si vous utilisez le `PixMultiSelect` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
10
14
 
11
15
  > ⚠️ La démonstration de PixMultiSelect NE fonctionne PAS comme prévu dans storybook (mais fonctionne très bien sur les app fronts). Pour plus d'informations, voir [https://github.com/1024pix/pix-ui/pull/76](https://github.com/1024pix/pix-ui/pull/76).
12
16
 
@@ -33,7 +37,6 @@ L'ajout de `class` et d'autres attributs comme `aria-label` sont possibles.
33
37
  ```html
34
38
  <PixMultiSelect
35
39
  @id="{{id}}"
36
- @label="{{label}}"
37
40
  @screenReaderOnly="{{screenReaderOnly}}"
38
41
  @placeholder="{{placeholder}}"
39
42
  @onChange="{{doSomething}}"
@@ -41,10 +44,9 @@ L'ajout de `class` et d'autres attributs comme `aria-label` sont possibles.
41
44
  @emptyMessage="{{emptyMessage}}"
42
45
  @className="{{className}}"
43
46
  @options="{{options}}"
44
- as
45
- |option|
46
47
  >
47
- {{option.label}}
48
+ <:label>{{label}}</:label>
49
+ <:default as |option|>{{option.label}}</:default>
48
50
  </PixMultiSelect>
49
51
  ```
50
52
 
@@ -16,10 +16,9 @@ export default {
16
16
  {{/if}}
17
17
  <PixMultiSelect
18
18
  @id={{this.id}}
19
- @label={{this.label}}
20
19
  @placeholder={{this.placeholder}}
21
20
  @screenReaderOnly={{this.screenReaderOnly}}
22
- @labelSize={{this.labelSize}}
21
+ @size={{this.size}}
23
22
  @onChange={{this.onChange}}
24
23
  @emptyMessage={{this.emptyMessage}}
25
24
  @className={{this.className}}
@@ -27,8 +26,10 @@ export default {
27
26
  @strictSearch={{this.strictSearch}}
28
27
  @values={{this.values}}
29
28
  @options={{this.options}}
30
- as |option|
31
- >{{option.label}}</PixMultiSelect>`,
29
+ >
30
+ <:label>{{this.label}}</:label>
31
+ <:default as |option|>{{option.label}}</:default>
32
+ </PixMultiSelect>`,
32
33
  context: args,
33
34
  }),
34
35
  argTypes: {
@@ -44,28 +45,6 @@ export default {
44
45
  'Rempli le contenu interne du composant, `placeholder` pour `isSearchable` `true`, sinon rawContent du `button`',
45
46
  type: { name: 'string', required: true },
46
47
  },
47
- label: {
48
- name: 'label',
49
- description:
50
- "Donne un label au champ qui sera celui vocalisé par le lecteur d'écran. **⚠️ Le`label` est obligatoire que si l'`id` n'est pas donné. ⚠️**",
51
- type: { name: 'string' },
52
- },
53
- labelSize: {
54
- name: 'labelSize',
55
- description: 'Correspond à la taille de la police du label.',
56
- type: { name: 'string', required: false },
57
- table: {
58
- defaultValue: { summary: 'default' },
59
- },
60
- control: { type: 'select' },
61
- options: ['small', 'large', 'default'],
62
- },
63
- screenReaderOnly: {
64
- name: 'screenReaderOnly',
65
- description: "Permet de cacher à l'écran le label tout en restant vocalisable",
66
- type: { name: 'boolean', required: false },
67
- table: { defaultValue: { summary: false } },
68
- },
69
48
  emptyMessage: {
70
49
  name: 'emptyMessage',
71
50
  description:
@@ -120,6 +99,57 @@ export default {
120
99
  defaultValue: { summary: null },
121
100
  },
122
101
  },
102
+
103
+ label: {
104
+ name: 'label',
105
+ description: 'Le label du champ',
106
+ type: { name: 'string', required: true },
107
+ table: {
108
+ type: { summary: 'string' },
109
+ },
110
+ },
111
+ subLabel: {
112
+ name: 'subLabel',
113
+ description: 'Un descriptif complétant le label',
114
+ type: { name: 'string', required: false },
115
+ },
116
+ requiredLabel: {
117
+ name: 'requiredLabel',
118
+ description: 'Label indiquant que le champ est requis.',
119
+ type: { name: 'string', required: false },
120
+ table: {
121
+ type: { summary: 'string' },
122
+ },
123
+ },
124
+ screenReaderOnly: {
125
+ name: 'screenReaderOnly',
126
+ description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
127
+ control: { type: 'boolean' },
128
+ type: { name: 'boolean', required: false },
129
+ table: {
130
+ type: { summary: 'boolean' },
131
+ defaultValue: { summary: false },
132
+ },
133
+ },
134
+ size: {
135
+ name: 'size',
136
+ description: 'Correspond à la taille de la police du label.',
137
+ type: { name: 'string', required: false },
138
+ table: {
139
+ defaultValue: { summary: 'default' },
140
+ },
141
+ control: { type: 'select' },
142
+ options: ['small', 'large', 'default'],
143
+ },
144
+ inlineLabel: {
145
+ name: 'inlineLabel',
146
+ description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
147
+ type: { name: 'boolean', required: false },
148
+ table: {
149
+ defaultValue: { summary: false },
150
+ },
151
+ control: { type: 'boolean' },
152
+ },
123
153
  },
124
154
  };
125
155
 
@@ -152,20 +182,24 @@ export const multiSelectWithChildComponent = (args) => {
152
182
  return {
153
183
  template: hbs`<h4><strong>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</strong></h4>
154
184
  <PixMultiSelect
155
- @label={{this.label}}
156
185
  @placeholder={{this.placeholder}}
157
- @screenReaderOnly={{this.screenReaderOnly}}
158
186
  @onChange={{this.onChange}}
159
187
  @emptyMessage={{this.emptyMessage}}
160
188
  @className={{this.className}}
161
189
  @options={{this.options}}
162
- as |option|
190
+ @size={{this.size}}
191
+ @subLabel={{this.subLabel}}
192
+ @inlineLabel={{this.inlineLabel}}
193
+ @screenReaderOnly={{this.screenReaderOnly}}
163
194
  >
164
- <PixStars
165
- @alt={{concat 'Étoiles ' option.value ' sur ' option.total}}
166
- @count={{option.value}}
167
- @total={{option.total}}
168
- />
195
+ <:label>{{this.label}}</:label>
196
+ <:default as |option|>
197
+ <PixStars
198
+ @alt={{concat 'Étoiles ' option.value ' sur ' option.total}}
199
+ @count={{option.value}}
200
+ @total={{option.total}}
201
+ />
202
+ </:default>
169
203
  </PixMultiSelect>`,
170
204
  context: args,
171
205
  };
@@ -212,8 +246,6 @@ export const multiSelectWithId = {
212
246
  const TemplateWithYield = (args) => ({
213
247
  template: hbs`<PixMultiSelect
214
248
  @id={{this.id}}
215
- @label={{this.label}}
216
- @screenReaderOnly={{this.screenReaderOnly}}
217
249
  @onChange={{this.onChange}}
218
250
  @emptyMessage={{this.emptyMessage}}
219
251
  @className={{this.className}}
@@ -221,7 +253,13 @@ const TemplateWithYield = (args) => ({
221
253
  @strictSearch={{this.strictSearch}}
222
254
  @values={{this.values}}
223
255
  @options={{this.options}}
256
+ @size={{this.size}}
257
+ @subLabel={{this.subLabel}}
258
+ @inlineLabel={{this.inlineLabel}}
259
+ @requiredLabel={{this.requiredLabel}}
260
+ @screenReaderOnly={{this.screenReaderOnly}}
224
261
  >
262
+ <:label>{{this.label}}</:label>
225
263
  <:placeholder>filtres (2)</:placeholder>
226
264
  <:default as |option|>{{option.label}}</:default>
227
265
  </PixMultiSelect>`,
@@ -37,7 +37,9 @@ Pour les considérer comme un seul groupe d'inputs, **il est nécessaire qu'ils
37
37
  ## Usage
38
38
 
39
39
  ```html
40
- <PixRadioButton name="input-name" @value="{{value}}"> Exemple de label </PixRadioButton>
40
+ <PixRadioButton name="input-name" @value="{{value}}">
41
+ <:label>Exemple de label</:label>
42
+ </PixRadioButton>
41
43
  ```
42
44
 
43
45
  ## Arguments
@@ -9,21 +9,6 @@ export default {
9
9
  'Identifiant du champ permettant de lui attacher un label. Généré automatiquement si non renseigné.',
10
10
  type: { name: 'string' },
11
11
  },
12
- label: {
13
- name: 'label',
14
- description: 'Le label du bouton radio',
15
- type: { name: 'string', required: true },
16
- },
17
- labelSize: {
18
- name: 'labelSize',
19
- description: 'Correspond à la taille de la police du label.',
20
- type: { name: 'string', required: false },
21
- table: {
22
- defaultValue: { summary: 'default' },
23
- },
24
- control: { type: 'select' },
25
- options: ['small', 'large', 'default'],
26
- },
27
12
  class: {
28
13
  name: 'class',
29
14
  description: "Permet d'ajouter une classe CSS au parent du composant.",
@@ -42,16 +27,48 @@ export default {
42
27
  defaultValue: { summary: 'false' },
43
28
  },
44
29
  },
30
+
31
+ label: {
32
+ name: 'label',
33
+ description: 'Le label du champ',
34
+ type: { name: 'string', required: true },
35
+ table: {
36
+ type: { summary: 'string' },
37
+ },
38
+ },
39
+ subLabel: {
40
+ name: 'subLabel',
41
+ description: 'Un descriptif complétant le label',
42
+ type: { name: 'string', required: false },
43
+ },
44
+ requiredLabel: {
45
+ name: 'requiredLabel',
46
+ description: 'Label indiquant que le champ est requis.',
47
+ type: { name: 'string', required: false },
48
+ table: {
49
+ type: { summary: 'string' },
50
+ },
51
+ },
45
52
  screenReaderOnly: {
46
53
  name: 'screenReaderOnly',
47
- description:
48
- "Permet de ne pas afficher le label à l'écran. Sert à garder un label qui sera lisible par les lecteurs d'écran.",
49
- type: { name: 'boolean', required: true },
54
+ description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
55
+ control: { type: 'boolean' },
56
+ type: { name: 'boolean', required: false },
50
57
  table: {
51
58
  type: { summary: 'boolean' },
52
59
  defaultValue: { summary: false },
53
60
  },
54
61
  },
62
+ size: {
63
+ name: 'size',
64
+ description: 'Correspond à la taille de la police du label.',
65
+ type: { name: 'string', required: false },
66
+ table: {
67
+ defaultValue: { summary: 'default' },
68
+ },
69
+ control: { type: 'select' },
70
+ options: ['small', 'large', 'default'],
71
+ },
55
72
  },
56
73
  };
57
74
 
@@ -64,9 +81,11 @@ const Template = (args) => {
64
81
  @class={{this.class}}
65
82
  disabled={{this.isDisabled}}
66
83
  @isDisabled={{this.isDisabled}}
67
- @labelSize={{this.labelSize}}
84
+ @size={{this.size}}
85
+ @screenReaderOnly={{this.screenReaderOnly}}
86
+ @requiredLabel={{this.requiredLabel}}
68
87
  >
69
- {{this.label}}
88
+ <:label>{{this.label}}</:label>
70
89
  </PixRadioButton>`,
71
90
  context: args,
72
91
  };
@@ -86,11 +105,8 @@ isDisabled.args = {
86
105
  /* Checked stories */
87
106
  const checked = (args) => {
88
107
  return {
89
- template: hbs`<PixRadioButton
90
- @value={{this.value}}
91
- disabled={{this.disabled}}
92
- checked
93
- >{{this.label}}</PixRadioButton>`,
108
+ template: hbs`<PixRadioButton @value={{this.value}} disabled={{this.disabled}} checked><:label
109
+ >{{this.label}}</:label></PixRadioButton>`,
94
110
  context: args,
95
111
  };
96
112
  };
@@ -107,21 +123,12 @@ defaultChecked.args = Default.args;
107
123
  /* Multiple components story */
108
124
  const multipleTemplate = (args) => {
109
125
  return {
110
- template: hbs`<PixRadioButton
111
- disabled={{this.isDisabled}}
112
- @isDisabled={{this.isDisabled}}
113
- name='radio'
114
- >{{this.label}}</PixRadioButton>
115
- <PixRadioButton
116
- disabled={{this.isDisabled}}
117
- @isDisabled={{this.isDisabled}}
118
- name='radio'
119
- >{{this.label}}</PixRadioButton>
120
- <PixRadioButton
121
- disabled={{this.isDisabled}}
122
- @isDisabled={{this.isDisabled}}
123
- name='radio'
124
- >{{this.label}}</PixRadioButton>`,
126
+ template: hbs`<PixRadioButton disabled={{this.isDisabled}} @isDisabled={{this.isDisabled}} name='radio'><:label
127
+ >{{this.label}}</:label></PixRadioButton>
128
+ <PixRadioButton disabled={{this.isDisabled}} @isDisabled={{this.isDisabled}} name='radio'><:label
129
+ >{{this.label}}</:label></PixRadioButton>
130
+ <PixRadioButton disabled={{this.isDisabled}} @isDisabled={{this.isDisabled}} name='radio'><:label
131
+ >{{this.label}}</:label></PixRadioButton>`,
125
132
  context: args,
126
133
  };
127
134
  };
@@ -17,7 +17,9 @@ Ce composant permet d'appeler la fonction triggerFiltering passée en paramètre
17
17
  Si vous utilisez le `PixSearchInput` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
18
18
 
19
19
  ```html
20
- <PixSearchInput @label="{{label}}" @screenReaderOnly={{true}} @id="{{id}}" />
20
+ <PixSearchInput @screenReaderOnly={{true}} @id="{{id}}">
21
+ <:label>{{label}}</:label>
22
+ </PixSearchInput>
21
23
  ```
22
24
 
23
25
  <Story of={ComponentStories.Default} height={80} />
@@ -27,11 +29,11 @@ Si vous utilisez le `PixSearchInput` sans vouloir afficher le label, il faudra r
27
29
  ```html
28
30
  <PixSearchInput
29
31
  @id="{{this.id}}"
30
- @label="{{this.label}}"
31
32
  @placeholder="{{this.placeholder}}"
32
33
  @debounceTimeInMs="{{this.debounceTimeInMs}}"
33
- @triggerFiltering="{{this.triggerFiltering}}"
34
- />
34
+ @triggerFiltering="{{this.triggerFiltering}}">
35
+ <:label>{{this.label}}</:label>
36
+ </PixSearchInput>
35
37
  ```
36
38
 
37
39
  ## Arguments
@@ -13,25 +13,6 @@ export default {
13
13
  type: { summary: 'string' },
14
14
  },
15
15
  },
16
- label: {
17
- name: 'label',
18
- description:
19
- "Label du champ. ** ⚠️ Le `label` est obligatoire si l'`ariaLabel` n'est pas donné. ⚠️ **",
20
- type: { name: 'string', required: false },
21
- table: {
22
- type: { summary: 'string' },
23
- },
24
- },
25
- labelSize: {
26
- name: 'labelSize',
27
- description: 'Correspond à la taille de la police du label.',
28
- type: { name: 'string', required: false },
29
- table: {
30
- defaultValue: { summary: 'default' },
31
- },
32
- control: { type: 'select' },
33
- options: ['small', 'large', 'default'],
34
- },
35
16
  placeholder: {
36
17
  name: 'placeholder',
37
18
  description: 'Placeholder du champ.',
@@ -55,6 +36,57 @@ export default {
55
36
  type: { required: true },
56
37
  control: { disable: true },
57
38
  },
39
+
40
+ label: {
41
+ name: 'label',
42
+ description: 'Le label du champ',
43
+ type: { name: 'string', required: true },
44
+ table: {
45
+ type: { summary: 'string' },
46
+ },
47
+ },
48
+ subLabel: {
49
+ name: 'subLabel',
50
+ description: 'Un descriptif complétant le label',
51
+ type: { name: 'string', required: false },
52
+ },
53
+ requiredLabel: {
54
+ name: 'requiredLabel',
55
+ description: 'Label indiquant que le champ est requis.',
56
+ type: { name: 'string', required: false },
57
+ table: {
58
+ type: { summary: 'string' },
59
+ },
60
+ },
61
+ screenReaderOnly: {
62
+ name: 'screenReaderOnly',
63
+ description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
64
+ control: { type: 'boolean' },
65
+ type: { name: 'boolean', required: false },
66
+ table: {
67
+ type: { summary: 'boolean' },
68
+ defaultValue: { summary: false },
69
+ },
70
+ },
71
+ size: {
72
+ name: 'size',
73
+ description: 'Correspond à la taille de la police du label.',
74
+ type: { name: 'string', required: false },
75
+ table: {
76
+ defaultValue: { summary: 'default' },
77
+ },
78
+ control: { type: 'select' },
79
+ options: ['small', 'large', 'default'],
80
+ },
81
+ inlineLabel: {
82
+ name: 'inlineLabel',
83
+ description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
84
+ type: { name: 'boolean', required: false },
85
+ table: {
86
+ defaultValue: { summary: false },
87
+ },
88
+ control: { type: 'boolean' },
89
+ },
58
90
  },
59
91
  };
60
92
 
@@ -62,12 +94,15 @@ export const Template = (args) => {
62
94
  return {
63
95
  template: hbs`<PixSearchInput
64
96
  @id={{this.id}}
65
- @label={{this.label}}
66
- @labelSize={{this.labelSize}}
67
97
  @placeholder={{this.placeholder}}
68
98
  @debounceTimeInMs={{this.debounceTimeInMs}}
69
99
  @triggerFiltering={{this.triggerFiltering}}
70
- />`,
100
+ @size={{this.size}}
101
+ @subLabel={{this.subLabel}}
102
+ @inlineLabel={{this.inlineLabel}}
103
+ @requiredLabel={{this.requiredLabel}}
104
+ @screenReaderOnly={{this.screenReaderOnly}}
105
+ ><:label>{{this.label}}</:label></PixSearchInput>`,
71
106
  context: args,
72
107
  };
73
108
  };
@@ -56,7 +56,6 @@ Ici nous avons forcé le placement de la dropdown en haut du select mais sachez
56
56
  ```html
57
57
  <PixSelect
58
58
  @className="{{className}}"
59
- @label="{{label}}"
60
59
  @subLabel="{{subLabel}}"
61
60
  @placeholder="{{placeholder}}"
62
61
  @options="{{options}}"
@@ -67,11 +66,13 @@ Ici nous avons forcé le placement de la dropdown en haut du select mais sachez
67
66
  @searchPlaceholder="{{searchPlaceholder}}"
68
67
  @emptySearchMessage="{{emptySearchMessage}}"
69
68
  @screenReaderOnly="{{screenReaderOnly}}"
70
- @requiredText="{{requiredText}}"
69
+ @requiredLabel="{{requiredLabel}}"
71
70
  @errorMessage="{{errorMessage}}"
72
71
  @placement="{{placement}}"
73
72
  @icon="{{icon}}"
74
- />
73
+ >
74
+ <:label>{{label}}</:label>
75
+ </PixSelect>
75
76
  ```
76
77
 
77
78
  ## Arguments