@1024pix/pix-ui 20.2.3 → 22.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 (66) hide show
  1. package/.storybook/main.js +3 -0
  2. package/CHANGELOG.md +32 -0
  3. package/README.md +2 -2
  4. package/addon/components/pix-dropdown.hbs +3 -4
  5. package/addon/components/pix-filterable-and-searchable-select.hbs +45 -0
  6. package/addon/components/pix-filterable-and-searchable-select.js +48 -0
  7. package/addon/components/pix-multi-select.hbs +19 -23
  8. package/addon/components/pix-multi-select.js +26 -44
  9. package/addon/components/pix-pagination.hbs +2 -1
  10. package/addon/components/pix-select.hbs +133 -44
  11. package/addon/components/pix-select.js +134 -31
  12. package/addon/components/pix-stars.hbs +1 -1
  13. package/addon/components/pix-toggle.hbs +24 -0
  14. package/addon/components/pix-toggle.js +23 -0
  15. package/addon/styles/_form.scss +16 -3
  16. package/addon/styles/_pix-filterable-and-searchable-select.scss +57 -0
  17. package/addon/styles/_pix-multi-select.scss +15 -14
  18. package/addon/styles/_pix-select.scss +152 -45
  19. package/addon/styles/_pix-toggle.scss +63 -0
  20. package/addon/styles/addon.scss +4 -0
  21. package/app/components/pix-filterable-and-searchable-select.js +1 -0
  22. package/app/components/pix-toggle.js +1 -0
  23. package/app/modifiers/on-arrow-down-up-action.js +3 -3
  24. package/app/modifiers/on-enter-action.js +2 -2
  25. package/app/modifiers/on-space-action.js +20 -0
  26. package/app/stories/form.stories.js +86 -80
  27. package/app/stories/pix-background-header.stories.js +17 -9
  28. package/app/stories/pix-banner.stories.js +9 -10
  29. package/app/stories/pix-block.stories.js +3 -5
  30. package/app/stories/pix-button-link.stories.js +23 -27
  31. package/app/stories/pix-button-upload.stories.js +10 -12
  32. package/app/stories/pix-button.stories.js +30 -31
  33. package/app/stories/pix-checkbox.stories.js +9 -10
  34. package/app/stories/pix-collapsible.stories.js +22 -37
  35. package/app/stories/pix-dropdown.stories.js +17 -19
  36. package/app/stories/pix-filter-banner.stories.js +11 -8
  37. package/app/stories/pix-filterable-and-searchable-select.stories.js +212 -0
  38. package/app/stories/pix-filterable-and-searchable-select.stories.mdx +71 -0
  39. package/app/stories/pix-icon-button.stories.js +10 -12
  40. package/app/stories/pix-input-code.stories.js +7 -9
  41. package/app/stories/pix-input-password.stories.js +9 -11
  42. package/app/stories/pix-input.stories.js +9 -11
  43. package/app/stories/pix-message.stories.js +7 -8
  44. package/app/stories/pix-modal.stories.js +27 -20
  45. package/app/stories/pix-multi-select.stories.js +105 -81
  46. package/app/stories/pix-multi-select.stories.mdx +14 -9
  47. package/app/stories/pix-pagination.stories.js +6 -8
  48. package/app/stories/pix-progress-gauge.stories.js +16 -20
  49. package/app/stories/pix-radio-button.stories.js +2 -14
  50. package/app/stories/pix-return-to.stories.js +4 -8
  51. package/app/stories/pix-select.stories.js +235 -74
  52. package/app/stories/pix-select.stories.mdx +46 -20
  53. package/app/stories/pix-selectable-tag.stories.js +7 -38
  54. package/app/stories/pix-sidebar.stories.js +26 -19
  55. package/app/stories/pix-stars.stories.js +1 -8
  56. package/app/stories/pix-tag.stories.js +6 -10
  57. package/app/stories/pix-textarea.stories.js +7 -9
  58. package/app/stories/pix-toggle.stories.js +120 -0
  59. package/app/stories/pix-toggle.stories.mdx +38 -0
  60. package/app/stories/pix-tooltip.stories.js +41 -49
  61. package/package.json +60 -50
  62. package/.github/workflows/auto-merge.yml +0 -23
  63. package/.github/workflows/deploy-storybook.yml +0 -22
  64. package/.github/workflows/npm-publish.yml +0 -23
  65. package/.github/workflows/on-dev-merge.yml +0 -33
  66. package/.prettierignore +0 -1
@@ -1,90 +1,193 @@
1
1
  import { hbs } from 'ember-cli-htmlbars';
2
2
  import { action } from '@storybook/addon-actions';
3
3
 
4
- const Template = (args) => ({
5
- template: hbs`
6
- <PixSelect
7
- @id={{id}}
8
- @options={{options}}
9
- @onChange={{onChange}}
10
- @selectedOption={{selectedOption}}
11
- @emptyOptionLabel={{emptyOptionLabel}}
12
- @emptyOptionNotSelectable={{emptyOptionNotSelectable}}
13
- @isSearchable={{isSearchable}}
14
- @isValidationActive={{isValidationActive}}
15
- @label={{label}}
16
- />
4
+ export const Template = (args) => {
5
+ return {
6
+ template: hbs`
7
+ <style>
8
+ .custom {
9
+ border: 0;
10
+ }
11
+ .custom:hover {
12
+ border: 0;
13
+ }
14
+ </style>
15
+ {{#if this.id}}
16
+ <div>
17
+ <label for={{this.id}}>Un label en dehors du composant</label>
18
+ </div>
19
+ {{/if}}
20
+ <PixSelect
21
+ @id={{this.id}}
22
+ @className={{this.className}}
23
+ @options={{this.options}}
24
+ @isSearchable={{this.isSearchable}}
25
+ @onChange={{this.onChange}}
26
+ @label={{this.label}}
27
+ @placeholder={{this.placeholder}}
28
+ @hideDefaultOption={{this.hideDefaultOption}}
29
+ @subLabel={{this.subLabel}}
30
+ @searchLabel={{this.searchLabel}}
31
+ @value={{this.value}}
32
+ @searchPlaceholder={{this.searchPlaceholder}}
33
+ @screenReaderOnly={{this.screenReaderOnly}}
34
+ @emptySearchMessage={{this.emptySearchMessage}}
35
+ @requiredText={{this.requiredText}}
36
+ @errorMessage={{this.errorMessage}}
37
+ />
17
38
  `,
18
- context: args,
19
- });
39
+ context: args,
40
+ };
41
+ };
42
+
43
+ export const WithId = Template.bind({});
44
+ WithId.args = {
45
+ id: 'custom',
46
+ options: [
47
+ { value: '1', label: 'Figues' },
48
+ { value: '3', label: 'Fraises' },
49
+ { value: '2', label: 'Bananes' },
50
+ { value: '4', label: 'Mangues' },
51
+ { value: '5', label: 'Kaki' },
52
+ {
53
+ value: '6',
54
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
55
+ },
56
+ ],
57
+ placeholder: 'Mon innerText',
58
+ isSearchable: false,
59
+ onChange: action('onChange'),
60
+ };
61
+
62
+ export const WithCustomClass = Template.bind({});
63
+ WithCustomClass.args = {
64
+ className: 'custom',
65
+ options: [
66
+ { value: '1', label: 'Figues' },
67
+ { value: '3', label: 'Fraises' },
68
+ { value: '2', label: 'Bananes' },
69
+ { value: '4', label: 'Mangues' },
70
+ { value: '5', label: 'Kaki' },
71
+ {
72
+ value: '6',
73
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
74
+ },
75
+ ],
76
+ label: 'Mon label',
77
+ placeholder: 'Mon innerText',
78
+ subLabel: 'Mon sous label',
79
+ isSearchable: false,
80
+ onChange: action('onChange'),
81
+ };
20
82
 
21
83
  export const Default = Template.bind({});
22
84
  Default.args = {
23
85
  options: [
24
86
  { value: '1', label: 'Figues' },
87
+ { value: '3', label: 'Fraises' },
25
88
  { value: '2', label: 'Bananes' },
26
- { value: '3', label: 'Noix' },
27
- { value: '4', label: 'Papayes' },
28
- { value: '5', label: 'Fèves de chocolat' },
29
- { value: '6', label: 'Dattes' },
30
- { value: '7', label: 'Mangues' },
31
- { value: '8', label: 'Jujube' },
32
- { value: '9', label: 'Avocat' },
33
- { value: '10', label: 'Fraises' },
34
- { value: '11', label: 'Kaki' },
35
- { value: '12', label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)' },
89
+ { value: '4', label: 'Mangues' },
90
+ { value: '5', label: 'Kaki' },
91
+ {
92
+ value: '6',
93
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
94
+ },
95
+ ],
96
+ label: 'Mon label',
97
+ placeholder: 'Mon innerText',
98
+ subLabel: 'Mon sous label',
99
+ isSearchable: false,
100
+ onChange: action('onChange'),
101
+ };
102
+
103
+ export const WithCategories = Template.bind({});
104
+ WithCategories.args = {
105
+ options: [
106
+ { value: '1', label: 'Figues', category: 'Fruit Rouge' },
107
+ { value: '3', label: 'Fraises', category: 'Fruit Rouge' },
108
+ { value: '3', label: 'Noix', category: 'Autres' },
109
+ { value: '4', label: 'Papayes', category: 'Autres' },
110
+ {
111
+ value: '6',
112
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
113
+ category: 'Autres',
114
+ },
36
115
  ],
116
+ label: 'Mon label',
117
+ placeholder: 'Mon innerText',
118
+ subLabel: 'Mon sous label',
119
+ isSearchable: false,
37
120
  onChange: action('onChange'),
38
121
  };
39
122
 
40
- export const withLabel = Template.bind({});
41
- withLabel.args = {
42
- ...Default.args,
43
- id: 'pix-select-with-label',
44
- label: 'Ton fruit préféré: ',
123
+ export const WithSearch = Template.bind({});
124
+ WithSearch.args = {
125
+ options: [
126
+ { value: '1', label: 'Figues' },
127
+ { value: '3', label: 'Fraises' },
128
+ { value: '2', label: 'Bananes' },
129
+ { value: '4', label: 'Mangues' },
130
+ { value: '5', label: 'Kaki' },
131
+ {
132
+ value: '6',
133
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
134
+ },
135
+ ],
136
+ label: 'Mon label',
137
+ placeholder: 'Mon innerText',
138
+ subLabel: 'Mon sous label',
139
+ searchLabel: 'Mon label',
140
+ searchPlaceholder: 'Mon innerText',
141
+ isSearchable: true,
142
+ emptySearchMessage: 'Aucune option',
143
+ onChange: action('onChange'),
45
144
  };
46
145
 
47
- export const searchableSelect = Template.bind({});
48
- searchableSelect.args = {
49
- ...Default.args,
50
- emptyOptionNotSelectable: false,
146
+ export const WithCategoriesAndSearch = Template.bind({});
147
+ WithCategoriesAndSearch.args = {
148
+ options: [
149
+ { value: '1', label: 'Figues', category: 'Fruit Rouge' },
150
+ { value: '2', label: 'Fraises', category: 'Fruit Rouge' },
151
+ { value: '3', label: 'Fèves de chocolat', category: 'Autres' },
152
+ { value: '5', label: 'Dattes', category: 'Autres' },
153
+ {
154
+ value: '4',
155
+ label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
156
+ category: 'Autres',
157
+ },
158
+ ],
159
+ label: 'Mon label',
160
+ placeholder: 'Mon innerText',
161
+ subLabel: 'Mon sous label',
162
+ searchLabel: 'Mon label',
163
+ searchPlaceholder: 'Mon innerText',
51
164
  isSearchable: true,
52
- isValidationActive: true,
53
- placeholder: 'Fraises, Mangues...',
165
+ emptySearchMessage: 'Aucune option',
166
+ onChange: action('onChange'),
54
167
  };
55
168
 
56
169
  export const argTypes = {
57
170
  options: {
58
171
  name: 'options',
59
172
  description:
60
- 'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value`` et ``label``. ``value`` doit être de type ``String`` pour être que le champ puisse être cherchable',
61
- type: { name: 'object', required: true },
173
+ 'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value``, ``label`` et ``category``. Ce dernier étant optionnel.',
174
+ type: { name: 'array', required: true },
62
175
  },
63
- onChange: {
64
- name: 'onChange',
65
- description: 'Fonction à appeler si une option est sélectionnée',
66
- type: { required: true },
67
- control: { disable: true },
68
- },
69
- selectedOption: {
70
- name: 'selectedOption',
176
+ value: {
177
+ name: 'value',
71
178
  description: 'Option sélectionnée',
72
- options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
179
+ options: ['1', '2', '3', '4', '5', '6'],
73
180
  control: { type: 'select' },
74
181
  type: { name: 'string', required: false },
75
182
  table: {
76
183
  type: { summary: 'string' },
77
- defaultValue: { summary: null },
78
184
  },
79
185
  },
80
- emptyOptionLabel: {
81
- name: 'emptyOptionLabel',
82
- description: 'Texte à afficher si aucune option n‘est sélectionnée',
83
- type: { name: 'string', required: false },
84
- table: {
85
- type: { summary: 'string' },
86
- defaultValue: { summary: null },
87
- },
186
+ onChange: {
187
+ name: 'onChange',
188
+ description: 'Fonction à appeler quand une option est sélectionnée.',
189
+ type: { required: true },
190
+ control: { disable: true },
88
191
  },
89
192
  isSearchable: {
90
193
  name: 'isSearchable',
@@ -96,10 +199,9 @@ export const argTypes = {
96
199
  defaultValue: { summary: false },
97
200
  },
98
201
  },
99
- isValidationActive: {
100
- name: 'isValidationActive',
101
- description:
102
- "Rend la bordure du champ vert au focus si la valeur de recherche match une option (c'est à dire si l'utilisateur a selectionné une option valable",
202
+ screenReaderOnly: {
203
+ name: 'screenReaderOnly',
204
+ description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
103
205
  control: { type: 'boolean' },
104
206
  type: { name: 'boolean', required: false },
105
207
  table: {
@@ -107,34 +209,93 @@ export const argTypes = {
107
209
  defaultValue: { summary: false },
108
210
  },
109
211
  },
110
- emptyOptionNotSelectable: {
111
- name: 'emptyOptionNotSelectable',
112
- description: 'Rend le premier champ qui est vide non visible une fois sélectionné',
113
- control: { type: 'boolean' },
212
+ id: {
213
+ name: 'id',
214
+ description: 'Un identifiant unique placé sur le composant',
215
+ type: { name: 'string', required: false },
216
+ table: {
217
+ type: { summary: 'string' },
218
+ },
219
+ },
220
+ label: {
221
+ name: 'label',
222
+ description: 'Label du menu déroulant',
223
+ type: { name: 'string', required: false },
224
+ table: {
225
+ type: { summary: 'string' },
226
+ },
227
+ },
228
+ subLabel: {
229
+ name: 'subLabel',
230
+ description: 'Sous Label explicatif du menu déroulant',
231
+ type: { name: 'string', required: false },
232
+ table: {
233
+ type: { summary: 'string' },
234
+ },
235
+ },
236
+ placeholder: {
237
+ name: 'placeholder',
238
+ description: "Placeholder du menu déroulant. Il sert aussi de label pour l'option par défaut",
239
+ type: { name: 'string', required: true },
240
+ table: {
241
+ type: { summary: 'string' },
242
+ },
243
+ },
244
+ hideDefaultOption: {
245
+ name: 'hideDefaultOption',
246
+ description: "Cache l'option par défaut",
114
247
  type: { name: 'boolean', required: false },
115
248
  table: {
116
249
  type: { summary: 'boolean' },
117
250
  defaultValue: { summary: false },
118
251
  },
119
252
  },
120
- size: {
121
- name: 'size',
122
- description:
123
- '⚠️ **Propriété dépréciée** ⚠️ , désormais tous les éléments de formulaires feront 36px de hauteur.',
124
- options: ['big', 'small'],
253
+ className: {
254
+ name: 'className',
255
+ description: 'Cette classe css permet de surcharger le css par défaut du composant.',
125
256
  type: { name: 'string', required: false },
126
257
  table: {
127
258
  type: { summary: 'string' },
128
- defaultValue: { summary: 'small' },
129
259
  },
130
260
  },
131
- label: {
132
- name: 'label',
133
- description: 'Donne un label au champ, le paramètre @id devient obligatoire avec ce paramètre.',
261
+ searchLabel: {
262
+ name: 'searchLabel',
263
+ description: 'Label de la recherche dans le menu déroulant',
264
+ type: { name: 'string', required: true },
265
+ table: {
266
+ type: { summary: 'string' },
267
+ },
268
+ },
269
+ searchPlaceholder: {
270
+ name: 'searchPlaceholder',
271
+ description: 'Placeholder de la recherche dans le menu déroulant',
272
+ type: { name: 'string', required: true },
273
+ table: {
274
+ type: { summary: 'string' },
275
+ },
276
+ },
277
+ emptySearchMessage: {
278
+ name: 'emptySearchMessage',
279
+ description: "Message affiché si la recherche ne retourne pas d'options",
280
+ type: { name: 'string', required: true },
281
+ table: {
282
+ type: { summary: 'string' },
283
+ },
284
+ },
285
+ requiredText: {
286
+ name: 'requiredText',
287
+ description: "Affiche l'astérisque au label et ajoute sa signification",
288
+ type: { name: 'string', required: false },
289
+ table: {
290
+ type: { summary: 'string' },
291
+ },
292
+ },
293
+ errorMessage: {
294
+ name: 'errorMessage',
295
+ description: 'Message affiché si une erreur survient',
134
296
  type: { name: 'string', required: false },
135
297
  table: {
136
298
  type: { summary: 'string' },
137
- defaultValue: { summary: null },
138
299
  },
139
300
  },
140
301
  };
@@ -5,53 +5,79 @@ import * as stories from './pix-select.stories.js';
5
5
  <Meta
6
6
  title='Form/Select'
7
7
  component='PixSelect'
8
- decorators={[centered]}
9
8
  argTypes={stories.argTypes}
10
9
  />
11
10
 
12
11
  # Pix Select
13
12
 
14
- Affiche un champ Select avec la liste des options fournie.
13
+ Affiche un menu déroulant avec la liste des options fournies.
15
14
 
16
15
  Les options sont représentées par un tableau d'objet contenant les propriétés value et label.
17
16
 
18
- > **⚠️** __N'oubliez pas de rajouter un id et un label rattaché à l'input pour le rendre accessible !
19
- A défaut d'avoir un label, vous pouvez rajouter l'attribut `aria-label` à l'input.__
17
+ > **⚠️** __Il est nécessaire d'avoir au moins un label ou un placeholder !__
20
18
 
21
- > Pour aider l'utilisateur avec le PixSelect cherchable, rajoutez un placeholder cohérent !
19
+ > **⚠️** __N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !__
20
+
21
+ > Pour aider l'utilisateur, rajoutez un placeholder cohérent !
22
22
 
23
23
  ## Default
24
24
 
25
25
  <Canvas>
26
- <Story name="Select" story={stories.Default} height={100} />
26
+ <Story name='Default' story={stories.Default} height={200} />
27
+ </Canvas>
28
+
29
+ ## WithId
30
+
31
+ <Canvas>
32
+ <Story name='WithId' story={stories.WithId} height={200} />
27
33
  </Canvas>
28
34
 
29
- ## With label
35
+ ## WithCustomClass
30
36
 
31
37
  <Canvas>
32
- <Story story={stories.withLabel} height={100} />
38
+ <Story name='WithCustomClass' story={stories.WithCustomClass} height={200} />
33
39
  </Canvas>
34
40
 
35
- ## Searchable
41
+ ## WithCategories
36
42
 
37
43
  <Canvas>
38
- <Story name="SearchableSelect" story={stories.searchableSelect} height={110} />
44
+ <Story name='Select with categories' story={stories.WithCategories} height={200} />
45
+ </Canvas>
46
+
47
+ ## WithSearch
48
+
49
+ <Canvas>
50
+ <Story name='Select with search' story={stories.WithSearch} height={200} />
51
+ </Canvas>
52
+
53
+
54
+ ## WithCategoriesAndSearch
55
+
56
+ <Canvas>
57
+ <Story name='WithCategoriesAndSearch' story={stories.WithCategoriesAndSearch} height={200} />
39
58
  </Canvas>
40
59
 
41
60
  ## Usage
42
61
 
43
62
  ```html
44
- <PixSelect
45
- @options={{options}}
46
- @onChange={{onChange}}
47
- @selectedOption="1"
48
- @emptyOptionLabel="Empty option"
49
- @isSearchable={{false}}
50
- @isValidationActive={{false}}
51
- @emptyOptionNotSelectable={{false}}
52
- />
63
+ <PixSelect
64
+ @className={{className}}
65
+ @label={{label}}
66
+ @subLabel={{subLabel}}
67
+ @placeholder={{placeholder}}
68
+ @options={{options}}
69
+ @onChange={{onChange}}
70
+ @value={{value}}
71
+ @isSearchable={{isSearchable}}
72
+ @searchLabel={{searchLabel}}
73
+ @searchPlaceholder={{searchPlaceholder}}
74
+ @emptySearchMessage={{emptySearchMessage}}
75
+ @screenReaderOnly={{screenReaderOnly}}
76
+ @requiredText={{requiredText}}
77
+ @errorMessage={{errorMessage}}
78
+ />
53
79
  ```
54
80
 
55
81
  ## Arguments
56
82
 
57
- <ArgsTable story="Select" />
83
+ <ArgsTable story="Default" />
@@ -2,56 +2,25 @@ import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
3
  export const selectableTagDefault = (args) => {
4
4
  return {
5
- template: hbs`
6
- <PixSelectableTag
7
- @label="non sélectionné"
8
- @id="123"
9
- @onChange={{onChange}}
10
- @checked={{false}}
11
- />
12
- `,
5
+ template: hbs`<PixSelectableTag @label='non sélectionné' @id='123' @onChange={{onChange}} @checked={{false}} />`,
13
6
  context: args,
14
7
  };
15
8
  };
16
9
 
17
10
  export const selectableTagSelected = (args) => {
18
11
  return {
19
- template: hbs`
20
- <PixSelectableTag
21
- @label="Sélectionné"
22
- @id="456"
23
- @onChange={{onChange}}
24
- @checked={{true}}
25
- />
26
- `,
12
+ template: hbs`<PixSelectableTag @label='Sélectionné' @id='456' @onChange={{onChange}} @checked={{true}} />`,
27
13
  context: args,
28
14
  };
29
15
  };
30
16
 
31
17
  export const selectableTagMultiple = (args) => {
32
18
  return {
33
- template: hbs`
34
- <div style="display:flex;justify-content:space-around;width:400px;height:100%;padding:10px">
35
- <PixSelectableTag
36
- @label="Lorem ipsum"
37
- @id="1"
38
- @onChange={{onChange}}
39
- @checked={{false}}
40
- />
41
- <PixSelectableTag
42
- @label="Lorem ipsum"
43
- @id="2"
44
- @onChange={{onChange}}
45
- @checked={{false}}
46
- />
47
- <PixSelectableTag
48
- @label="Lorem ipsum"
49
- @id="3"
50
- @onChange={{onChange}}
51
- @checked={{false}}
52
- />
53
- </div>
54
- `,
19
+ template: hbs`<div style='display:flex;justify-content:space-around;width:400px;height:100%;padding:10px'>
20
+ <PixSelectableTag @label='Lorem ipsum' @id='1' @onChange={{onChange}} @checked={{false}} />
21
+ <PixSelectableTag @label='Lorem ipsum' @id='2' @onChange={{onChange}} @checked={{false}} />
22
+ <PixSelectableTag @label='Lorem ipsum' @id='3' @onChange={{onChange}} @checked={{false}} />
23
+ </div>`,
55
24
  context: args,
56
25
  };
57
26
  };
@@ -2,25 +2,32 @@ import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
3
  export const Template = (args) => {
4
4
  return {
5
- template: hbs`
6
- <PixSidebar @showSidebar={{showSidebar}} @title={{title}} @onClose={{fn (mut showSidebar) (not showSidebar)}}>
7
- <:content>
8
- <p>
9
- Une sidebar est, dans une interface graphique, une fenêtre qui prend le contrôle total du clavier et
10
- de l'écran. Elle est en général associée à du paramétrage d'écran.
11
- </p>
12
- </:content>
13
- <:footer>
14
- <div style="display: flex; gap: 8px">
15
- <PixButton @backgroundColor="transparent-light" @isBorderVisible="true" @triggerAction={{fn (mut showSidebar) (not showSidebar)}}>Annuler</PixButton>
16
- <PixButton @triggerAction={{fn (mut showSidebar) (not showSidebar)}}>Valider</PixButton>
17
- </div>
18
- </:footer>
19
- </PixSidebar>
20
- <div style="display:flex; justify-content:center; align-items:center; height:105vh;">
21
- <PixButton @triggerAction={{fn (mut showSidebar) (not showSidebar)}} style="height:45px">Ouvrir la sidebar</PixButton>
22
- </div>
23
- `,
5
+ template: hbs`<PixSidebar
6
+ @showSidebar={{showSidebar}}
7
+ @title={{title}}
8
+ @onClose={{fn (mut showSidebar) (not showSidebar)}}
9
+ >
10
+ <:content>
11
+ <p>
12
+ Une sidebar est, dans une interface graphique, une fenêtre qui prend le contrôle total du
13
+ clavier et de l'écran. Elle est en général associée à du paramétrage d'écran.
14
+ </p>
15
+ </:content>
16
+ <:footer>
17
+ <div style='display: flex; gap: 8px'>
18
+ <PixButton
19
+ @backgroundColor='transparent-light'
20
+ @isBorderVisible='true'
21
+ @triggerAction={{fn (mut showSidebar) (not showSidebar)}}
22
+ >Annuler</PixButton>
23
+ <PixButton @triggerAction={{fn (mut showSidebar) (not showSidebar)}}>Valider</PixButton>
24
+ </div>
25
+ </:footer>
26
+ </PixSidebar>
27
+ <div style='display:flex; justify-content:center; align-items:center; height:105vh;'>
28
+ <PixButton @triggerAction={{fn (mut showSidebar) (not showSidebar)}} style='height:45px'>Ouvrir la
29
+ sidebar</PixButton>
30
+ </div>`,
24
31
  context: args,
25
32
  };
26
33
  };
@@ -2,14 +2,7 @@ import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
3
  export const stars = (args) => {
4
4
  return {
5
- template: hbs`
6
- <PixStars
7
- @count={{count}}
8
- @total={{total}}
9
- @alt={{alt}}
10
- @color={{color}}
11
- />
12
- `,
5
+ template: hbs`<PixStars @count={{count}} @total={{total}} @alt={{alt}} @color={{color}} />`,
13
6
  context: args,
14
7
  };
15
8
  };
@@ -2,22 +2,18 @@ import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
3
  export const tag = (args) => {
4
4
  return {
5
- template: hbs`
6
- <PixTag @color={{color}} @compact={{compact}}>
7
- Contenu du tag
8
- </PixTag>
9
- `,
5
+ template: hbs`<PixTag @color={{color}} @compact={{compact}}>
6
+ Contenu du tag
7
+ </PixTag>`,
10
8
  context: args,
11
9
  };
12
10
  };
13
11
 
14
12
  export const compactTag = (args) => {
15
13
  return {
16
- template: hbs`
17
- <PixTag @color={{color}} @compact={{compact}}>
18
- Contenu du tag
19
- </PixTag>
20
- `,
14
+ template: hbs`<PixTag @color={{color}} @compact={{compact}}>
15
+ Contenu du tag
16
+ </PixTag>`,
21
17
  context: args,
22
18
  };
23
19
  };
@@ -2,15 +2,13 @@ import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
3
  export const textarea = (args) => {
4
4
  return {
5
- template: hbs`
6
- <PixTextarea
7
- @id={{id}}
8
- @value={{value}}
9
- @maxlength={{maxlength}}
10
- @label={{label}}
11
- @errorMessage={{errorMessage}}
12
- />
13
- `,
5
+ template: hbs`<PixTextarea
6
+ @id={{id}}
7
+ @value={{value}}
8
+ @maxlength={{maxlength}}
9
+ @label={{label}}
10
+ @errorMessage={{errorMessage}}
11
+ />`,
14
12
  context: args,
15
13
  };
16
14
  };