@1024pix/pix-ui 11.1.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 (196) hide show
  1. package/.buildpacks +2 -0
  2. package/.circleci/config.yml +22 -0
  3. package/.gitattributes +7 -0
  4. package/.github/workflows/auto-merge.yml +26 -0
  5. package/.github/workflows/deploy-storybook.yml +21 -0
  6. package/.github/workflows/npm-publish.yml +23 -0
  7. package/.github/workflows/on-dev-merge.yml +33 -0
  8. package/.nvmrc +1 -0
  9. package/.prettierignore +1 -0
  10. package/.prettierrc.json +12 -0
  11. package/.storybook/fonts.css +1 -0
  12. package/.storybook/main.js +10 -0
  13. package/.storybook/manager.js +6 -0
  14. package/.storybook/preview.js +37 -0
  15. package/.storybook/storybook-custom-theme.js +37 -0
  16. package/CHANGELOG.md +469 -0
  17. package/CNAME +1 -0
  18. package/LICENSE.md +9 -0
  19. package/README.md +58 -0
  20. package/addon/components/pix-background-header.hbs +7 -0
  21. package/addon/components/pix-background-header.js +5 -0
  22. package/addon/components/pix-banner.hbs +16 -0
  23. package/addon/components/pix-banner.js +43 -0
  24. package/addon/components/pix-block.hbs +5 -0
  25. package/addon/components/pix-block.js +11 -0
  26. package/addon/components/pix-button-base.js +27 -0
  27. package/addon/components/pix-button-link.hbs +16 -0
  28. package/addon/components/pix-button-link.js +10 -0
  29. package/addon/components/pix-button-upload.hbs +11 -0
  30. package/addon/components/pix-button-upload.js +20 -0
  31. package/addon/components/pix-button.hbs +43 -0
  32. package/addon/components/pix-button.js +54 -0
  33. package/addon/components/pix-collapsible.hbs +29 -0
  34. package/addon/components/pix-collapsible.js +27 -0
  35. package/addon/components/pix-filter-banner.hbs +28 -0
  36. package/addon/components/pix-filter-banner.js +13 -0
  37. package/addon/components/pix-icon-button.hbs +11 -0
  38. package/addon/components/pix-icon-button.js +33 -0
  39. package/addon/components/pix-input-code.hbs +24 -0
  40. package/addon/components/pix-input-code.js +133 -0
  41. package/addon/components/pix-input-password.hbs +43 -0
  42. package/addon/components/pix-input-password.js +34 -0
  43. package/addon/components/pix-input.hbs +30 -0
  44. package/addon/components/pix-input.js +26 -0
  45. package/addon/components/pix-message.hbs +8 -0
  46. package/addon/components/pix-message.js +30 -0
  47. package/addon/components/pix-multi-select.hbs +70 -0
  48. package/addon/components/pix-multi-select.js +162 -0
  49. package/addon/components/pix-progress-gauge.hbs +19 -0
  50. package/addon/components/pix-progress-gauge.js +29 -0
  51. package/addon/components/pix-radio-button.hbs +12 -0
  52. package/addon/components/pix-radio-button.js +5 -0
  53. package/addon/components/pix-return-to.hbs +15 -0
  54. package/addon/components/pix-return-to.js +20 -0
  55. package/addon/components/pix-select.hbs +55 -0
  56. package/addon/components/pix-select.js +58 -0
  57. package/addon/components/pix-selectable-tag.hbs +10 -0
  58. package/addon/components/pix-selectable-tag.js +13 -0
  59. package/addon/components/pix-stars.hbs +16 -0
  60. package/addon/components/pix-stars.js +27 -0
  61. package/addon/components/pix-tag.hbs +3 -0
  62. package/addon/components/pix-tag.js +11 -0
  63. package/addon/components/pix-textarea.hbs +21 -0
  64. package/addon/components/pix-textarea.js +17 -0
  65. package/addon/components/pix-tooltip-deprecated.hbs +18 -0
  66. package/addon/components/pix-tooltip-deprecated.js +26 -0
  67. package/addon/components/pix-tooltip.hbs +18 -0
  68. package/addon/components/pix-tooltip.js +17 -0
  69. package/addon/styles/_breakpoints.scss +17 -0
  70. package/addon/styles/_colors.scss +87 -0
  71. package/addon/styles/_fonts.scss +10 -0
  72. package/addon/styles/_form.scss +68 -0
  73. package/addon/styles/_pix-background-header.scss +20 -0
  74. package/addon/styles/_pix-banner.scss +67 -0
  75. package/addon/styles/_pix-block.scss +29 -0
  76. package/addon/styles/_pix-button-base.scss +137 -0
  77. package/addon/styles/_pix-button-link.scss +4 -0
  78. package/addon/styles/_pix-button-upload.scss +5 -0
  79. package/addon/styles/_pix-button.scss +40 -0
  80. package/addon/styles/_pix-collapsible.scss +82 -0
  81. package/addon/styles/_pix-filter-banner.scss +74 -0
  82. package/addon/styles/_pix-icon-button.scss +60 -0
  83. package/addon/styles/_pix-input-code.scss +71 -0
  84. package/addon/styles/_pix-input-password.scss +68 -0
  85. package/addon/styles/_pix-input.scss +93 -0
  86. package/addon/styles/_pix-message.scss +35 -0
  87. package/addon/styles/_pix-multi-select.scss +182 -0
  88. package/addon/styles/_pix-progress-gauge.scss +119 -0
  89. package/addon/styles/_pix-radio-button.scss +72 -0
  90. package/addon/styles/_pix-return-to.scss +64 -0
  91. package/addon/styles/_pix-select.scss +71 -0
  92. package/addon/styles/_pix-selectable-tag.scss +86 -0
  93. package/addon/styles/_pix-stars.scss +43 -0
  94. package/addon/styles/_pix-tag.scss +69 -0
  95. package/addon/styles/_pix-textarea.scss +39 -0
  96. package/addon/styles/_pix-tooltip.scss +196 -0
  97. package/addon/styles/_reset-css.scss +36 -0
  98. package/addon/styles/_spacing.scss +9 -0
  99. package/addon/styles/addon.scss +41 -0
  100. package/app/components/pix-background-header.js +1 -0
  101. package/app/components/pix-banner.js +1 -0
  102. package/app/components/pix-block.js +1 -0
  103. package/app/components/pix-button-link.js +1 -0
  104. package/app/components/pix-button-upload.js +1 -0
  105. package/app/components/pix-button.js +1 -0
  106. package/app/components/pix-collapsible.js +1 -0
  107. package/app/components/pix-filter-banner.js +1 -0
  108. package/app/components/pix-icon-button.js +1 -0
  109. package/app/components/pix-input-code.js +1 -0
  110. package/app/components/pix-input-password.js +1 -0
  111. package/app/components/pix-input.js +1 -0
  112. package/app/components/pix-message.js +1 -0
  113. package/app/components/pix-multi-select.js +1 -0
  114. package/app/components/pix-progress-gauge.js +1 -0
  115. package/app/components/pix-radio-button.js +1 -0
  116. package/app/components/pix-return-to.js +1 -0
  117. package/app/components/pix-select.js +1 -0
  118. package/app/components/pix-selectable-tag.js +1 -0
  119. package/app/components/pix-stars.js +1 -0
  120. package/app/components/pix-tag.js +1 -0
  121. package/app/components/pix-textarea.js +1 -0
  122. package/app/components/pix-tooltip-deprecated.js +1 -0
  123. package/app/components/pix-tooltip.js +1 -0
  124. package/app/stories/form.stories.js +91 -0
  125. package/app/stories/form.stories.mdx +16 -0
  126. package/app/stories/pix-background-header.stories.js +19 -0
  127. package/app/stories/pix-background-header.stories.mdx +36 -0
  128. package/app/stories/pix-banner.stories.js +89 -0
  129. package/app/stories/pix-banner.stories.mdx +107 -0
  130. package/app/stories/pix-block.stories.js +20 -0
  131. package/app/stories/pix-block.stories.mdx +44 -0
  132. package/app/stories/pix-button-link.stories.js +125 -0
  133. package/app/stories/pix-button-link.stories.mdx +57 -0
  134. package/app/stories/pix-button-upload.stories.js +85 -0
  135. package/app/stories/pix-button-upload.stories.mdx +39 -0
  136. package/app/stories/pix-button.stories.js +253 -0
  137. package/app/stories/pix-button.stories.mdx +99 -0
  138. package/app/stories/pix-collapsible.stories.js +56 -0
  139. package/app/stories/pix-collapsible.stories.mdx +39 -0
  140. package/app/stories/pix-filter-banner.stories.js +51 -0
  141. package/app/stories/pix-filter-banner.stories.mdx +33 -0
  142. package/app/stories/pix-icon-button.stories.js +95 -0
  143. package/app/stories/pix-icon-button.stories.mdx +90 -0
  144. package/app/stories/pix-input-code.stories.js +74 -0
  145. package/app/stories/pix-input-code.stories.mdx +46 -0
  146. package/app/stories/pix-input-password.stories.js +89 -0
  147. package/app/stories/pix-input-password.stories.mdx +69 -0
  148. package/app/stories/pix-input.stories.js +94 -0
  149. package/app/stories/pix-input.stories.mdx +57 -0
  150. package/app/stories/pix-message.stories.js +57 -0
  151. package/app/stories/pix-message.stories.mdx +71 -0
  152. package/app/stories/pix-multi-select.stories.js +199 -0
  153. package/app/stories/pix-multi-select.stories.mdx +55 -0
  154. package/app/stories/pix-progress-gauge.stories.js +78 -0
  155. package/app/stories/pix-progress-gauge.stories.mdx +43 -0
  156. package/app/stories/pix-radio-button.stories.js +71 -0
  157. package/app/stories/pix-radio-button.stories.mdx +49 -0
  158. package/app/stories/pix-return-to.stories.js +45 -0
  159. package/app/stories/pix-return-to.stories.mdx +41 -0
  160. package/app/stories/pix-select.stories.js +140 -0
  161. package/app/stories/pix-select.stories.mdx +57 -0
  162. package/app/stories/pix-selectable-tag.stories.js +91 -0
  163. package/app/stories/pix-selectable-tag.stories.mdx +55 -0
  164. package/app/stories/pix-stars.stories.js +43 -0
  165. package/app/stories/pix-stars.stories.mdx +35 -0
  166. package/app/stories/pix-tag.stories.js +56 -0
  167. package/app/stories/pix-tag.stories.mdx +46 -0
  168. package/app/stories/pix-textarea.stories.js +59 -0
  169. package/app/stories/pix-textarea.stories.mdx +36 -0
  170. package/app/stories/pix-tooltip-deprecated.stories.js +136 -0
  171. package/app/stories/pix-tooltip-deprecated.stories.mdx +143 -0
  172. package/app/stories/pix-tooltip.stories.js +157 -0
  173. package/app/stories/pix-tooltip.stories.mdx +183 -0
  174. package/app/styles/app.scss +0 -0
  175. package/config/environment.js +5 -0
  176. package/docs/architecture.stories.mdx +106 -0
  177. package/docs/assets/accessibility-storybook.png +0 -0
  178. package/docs/assets/screen-pix-storybook.png +0 -0
  179. package/docs/breaking-changes.stories.mdx +90 -0
  180. package/docs/changelog.stories.mdx +6 -0
  181. package/docs/create-component.stories.mdx +118 -0
  182. package/docs/design-system.stories.mdx +20 -0
  183. package/docs/good-practices-a11y.stories.mdx +48 -0
  184. package/docs/good-practices-design.stories.mdx +71 -0
  185. package/docs/good-practices-responsive.stories.mdx +51 -0
  186. package/docs/good-practices-style-css.stories.mdx +40 -0
  187. package/docs/good-practices-tests.stories.mdx +9 -0
  188. package/docs/make-a-release.stories.mdx +66 -0
  189. package/docs/pull_request_template.md +14 -0
  190. package/docs/storybook.stories.mdx +44 -0
  191. package/docs/use-component.stories.mdx +89 -0
  192. package/docs/use-install.stories.mdx +37 -0
  193. package/index.js +5 -0
  194. package/package.json +121 -0
  195. package/scalingo.json +17 -0
  196. package/servers.conf.erb +30 -0
@@ -0,0 +1,39 @@
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
2
+ import centered from '@storybook/addon-centered/ember';
3
+
4
+ import * as stories from './pix-button-upload.stories.js';
5
+
6
+ <Meta
7
+ title='Basics/ButtonUpload'
8
+ component='PixButtonUpload'
9
+ decorators={[centered]}
10
+ argTypes={stories.argTypes}
11
+ />
12
+
13
+ # PixButtonUpload
14
+
15
+ Affiche un bouton d'upload de fichiers.
16
+
17
+ Hérite des styles de base de `PixButton` (`shape`, `backgroundColor`, `size`, `isBorderVisible`)
18
+
19
+ Toutes les [propriétés HTML d'un input de type file](https://developer.mozilla.org/fr/docs/Web/HTML/Element/Input/file) sont supportées.
20
+
21
+ <Canvas>
22
+ <Story name='PixButtonUpload' story={stories.buttonUpload} height={60} />
23
+ </Canvas>
24
+
25
+ ```html
26
+ <PixButtonUpload
27
+ @id="file-upload"
28
+ @onChange={{this.uploadFile}}
29
+ accept=".csv"
30
+ >
31
+ Libellé du bouton
32
+ </PixButtonUpload>
33
+ ```
34
+
35
+ Le callback `@onChange` prend en paramètre le tableau de fichiers uploadés.
36
+
37
+ ## Arguments
38
+
39
+ <ArgsTable story="PixButtonUpload" />
@@ -0,0 +1,253 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ const Template = (args) => ({
4
+ template: hbs`
5
+ <section style={{this.style}}>
6
+ <PixButton
7
+ @triggerAction={{action triggerAction}}
8
+ @loadingColor={{loadingColor}}
9
+ @shape={{shape}}
10
+ @backgroundColor={{backgroundColor}}
11
+ @isDisabled={{isDisabled}}
12
+ @isLoading={{isLoading}}
13
+ @size={{size}}
14
+ @isBorderVisible={{isBorderVisible}}
15
+ >
16
+ {{this.label}}
17
+ </PixButton>
18
+ </section>
19
+ {{#each extraButtons as |button|}}
20
+ <section style={{button.style}}>
21
+ <PixButton
22
+ @triggerAction={{action triggerAction}}
23
+ @loadingColor={{button.loadingColor}}
24
+ @shape={{button.shape}}
25
+ @backgroundColor={{button.backgroundColor}}
26
+ @isDisabled={{button.isDisabled}}
27
+ @isLoading={{button.isLoading}}
28
+ @size={{button.size}}
29
+ @isBorderVisible={{button.isBorderVisible}}
30
+ >
31
+ {{button.label}}
32
+ </PixButton>
33
+ </section>
34
+ {{/each}}`,
35
+ context: args,
36
+ });
37
+
38
+ export const Default = Template.bind({});
39
+ Default.args = {
40
+ loadingColor: 'white',
41
+ shape: 'squircle',
42
+ size: 'big',
43
+ backgroundColor: 'blue',
44
+ label: 'Bouton',
45
+ triggerAction: () => {
46
+ return new Promise((resolve) => {
47
+ setTimeout(() => {
48
+ resolve();
49
+ }, 2000);
50
+ });
51
+ },
52
+ };
53
+
54
+ export const borders = Template.bind({});
55
+ borders.args = {
56
+ ...Default.args,
57
+ label: 'Bouton avec bordure sur fond clair',
58
+ backgroundColor: 'transparent-light',
59
+ loadingColor: 'grey',
60
+ isBorderVisible: true,
61
+ extraButtons: [
62
+ {
63
+ ...Default.args,
64
+ label: 'Bouton avec bordure sur fond sombre',
65
+ style: 'background-color: #775555',
66
+ backgroundColor: 'transparent-dark',
67
+ isBorderVisible: true,
68
+ },
69
+ ],
70
+ };
71
+
72
+ export const colors = Template.bind({});
73
+ colors.args = {
74
+ ...Default.args,
75
+ label: 'Bouton avec background blue (default)',
76
+ extraButtons: [
77
+ {
78
+ ...Default.args,
79
+ label: 'Bouton avec background green',
80
+ backgroundColor: 'green',
81
+ },
82
+ {
83
+ ...Default.args,
84
+ label: 'Bouton avec background yellow',
85
+ backgroundColor: 'yellow',
86
+ },
87
+ {
88
+ ...Default.args,
89
+ label: 'Bouton avec background red',
90
+ backgroundColor: 'red',
91
+ },
92
+ {
93
+ ...Default.args,
94
+ label: 'Bouton avec background grey',
95
+ backgroundColor: 'grey',
96
+ },
97
+ {
98
+ ...Default.args,
99
+ label: 'Bouton avec bordure sur fond clair',
100
+ backgroundColor: 'transparent-light',
101
+ loadingColor: 'grey',
102
+ isBorderVisible: true,
103
+ },
104
+ {
105
+ ...Default.args,
106
+ label: 'Bouton avec bordure sur fond sombre',
107
+ style: 'background-color: #775555',
108
+ backgroundColor: 'transparent-dark',
109
+ isBorderVisible: true,
110
+ },
111
+ ],
112
+ };
113
+
114
+ export const disabled = Template.bind({});
115
+ disabled.args = {
116
+ ...Default.args,
117
+ label: 'Bouton désactivé',
118
+ isDisabled: true,
119
+ };
120
+
121
+ export const loader = Template.bind({});
122
+ loader.args = {
123
+ ...Default.args,
124
+ label: 'Bouton avec loader au clic',
125
+ backgroundColor: 'yellow',
126
+ loadingColor: 'grey',
127
+ extraButtons: [
128
+ {
129
+ ...Default.args,
130
+ triggerAction: () => {},
131
+ isLoading: true,
132
+ },
133
+ ],
134
+ };
135
+
136
+ export const shape = Template.bind({});
137
+ shape.args = {
138
+ ...Default.args,
139
+ label: 'Bouton rounded',
140
+ shape: 'rounded',
141
+ };
142
+
143
+ export const size = Template.bind({});
144
+ size.args = {
145
+ ...Default.args,
146
+ label: 'Bouton small',
147
+ size: 'small',
148
+ };
149
+
150
+ export const argsTypes = {
151
+ type: {
152
+ name: 'type',
153
+ description: 'type du bouton',
154
+ type: { required: false },
155
+ control: { disable: true },
156
+ table: {
157
+ type: { summary: 'string' },
158
+ defaultValue: { summary: 'button' },
159
+ },
160
+ },
161
+ triggerAction: {
162
+ name: 'triggerAction',
163
+ description: 'fonction à appeler en cas de clic, optionnel si le bouton est de type submit',
164
+ type: { required: true },
165
+ control: { disable: true },
166
+ },
167
+ loadingColor: {
168
+ name: 'loadingColor',
169
+ description: 'couleur de chargement: `white`, `grey`',
170
+ type: { name: 'string', required: false },
171
+ options: ['white', 'grey'],
172
+ control: { type: 'select' },
173
+ table: {
174
+ type: { summary: 'string' },
175
+ defaultValue: { summary: 'white' },
176
+ },
177
+ },
178
+ shape: {
179
+ name: 'shape',
180
+ description: 'forme: `rounded`,`squircle`',
181
+ type: { name: 'string', required: false },
182
+ options: ['rounded', 'squircle'],
183
+ control: { type: 'select' },
184
+ table: {
185
+ type: { summary: 'string' },
186
+ defaultValue: { summary: 'squircle' },
187
+ },
188
+ },
189
+ backgroundColor: {
190
+ name: 'backgroundColor',
191
+ description:
192
+ 'color: `blue`, `green`, `yellow`, `red`, `grey`, `transparent-light`, `transparent-dark`',
193
+ options: ['blue', 'green', 'yellow', 'red', 'grey', 'transparent-light', 'transparent-dark'],
194
+ type: { name: 'string', required: false },
195
+ control: { type: 'select' },
196
+ table: {
197
+ type: { summary: 'string' },
198
+ defaultValue: { summary: 'blue' },
199
+ },
200
+ },
201
+ isDisabled: {
202
+ name: 'isDisabled',
203
+ type: { name: 'boolean', required: false },
204
+ control: { type: 'boolean' },
205
+ table: {
206
+ type: { summary: 'boolean' },
207
+ defaultValue: { summary: 'false' },
208
+ },
209
+ },
210
+ isLoading: {
211
+ name: 'isLoading',
212
+ description:
213
+ 'Affiche un loader. Si `@triggerAction` retourne une promesse alors le loading est géré automatiquement.',
214
+ type: { name: 'boolean', required: false },
215
+ control: { type: 'boolean' },
216
+ table: {
217
+ type: { summary: 'boolean' },
218
+ defaultValue: { summary: 'false' },
219
+ },
220
+ },
221
+ size: {
222
+ name: 'size',
223
+ description: 'taille: `big`,`small`',
224
+ options: ['big', 'small'],
225
+ type: { name: 'string', required: false },
226
+ control: { type: 'select' },
227
+ table: {
228
+ type: { summary: 'string' },
229
+ defaultValue: { summary: 'big' },
230
+ },
231
+ },
232
+ isBorderVisible: {
233
+ name: 'isBorderVisible',
234
+ description:
235
+ 'Paramètre utilisé seulement quand le `backgroundColor` est `transparent-light` ou `transparent-dark`',
236
+ type: { name: 'boolean', required: false },
237
+ control: { type: 'boolean' },
238
+ table: {
239
+ type: { summary: 'boolean' },
240
+ defaultValue: { summary: 'false' },
241
+ },
242
+ },
243
+ route: {
244
+ name: 'route',
245
+ description: 'Déprécié et remplacé par le composant PixButtonLink',
246
+ type: { name: 'string', required: false },
247
+ },
248
+ model: {
249
+ name: 'model',
250
+ description: 'Déprécié et remplacé par le composant PixButtonLink',
251
+ type: { required: false },
252
+ },
253
+ };
@@ -0,0 +1,99 @@
1
+ import { Meta, Story, Canvas, ArgsTable, SourceContainer } from '@storybook/addon-docs/blocks';
2
+ import centered from '@storybook/addon-centered/ember';
3
+ import * as stories from './pix-button.stories.js';
4
+
5
+ <Meta
6
+ title='Basics/Button'
7
+ component='PixButton'
8
+ decorators={[centered]}
9
+ argTypes={stories.argsTypes}
10
+ />
11
+
12
+ # Pix Button
13
+
14
+ ## Default
15
+
16
+ Le bouton par défaut qui empêche les clics multiples.
17
+
18
+ <Canvas>
19
+ <Story name="Default" story={stories.Default} height={75} />
20
+ </Canvas>
21
+
22
+ ## Borders
23
+
24
+ Le bouton avec bordures et fond transparent
25
+
26
+ <Canvas isColumn>
27
+ <Story story={stories.borders} height={150} />
28
+ </Canvas>
29
+
30
+ ## Colors
31
+
32
+ Le bouton avec toutes ses variations de couleur
33
+
34
+ <Canvas isColumn>
35
+ <Story story={stories.colors} height={500} />
36
+ </Canvas>
37
+
38
+ ## Disabled
39
+
40
+ Le bouton désactivé
41
+
42
+ <Canvas>
43
+ <Story story={stories.disabled} height={75} />
44
+ </Canvas>
45
+
46
+ ## Link
47
+
48
+ Fonctionnalité dépréciée dans `<PixButton />`.
49
+
50
+ Utiliser le composant `<PixButtonLink />` à la place.
51
+
52
+ ## Loader
53
+
54
+ Le bouton avec loader.
55
+ Le loader peut être affiché de deux façons :
56
+ - En passant une promesse dans l'attribut `@triggerAction`
57
+ - En passant directement l'attribut `@isLoading={{true}}`
58
+
59
+ <Canvas>
60
+ <Story story={stories.loader} height={150} />
61
+ </Canvas>
62
+
63
+ ## Shape
64
+
65
+ Le bouton rounded
66
+
67
+ <Canvas>
68
+ <Story story={stories.shape} height={75} />
69
+ </Canvas>
70
+
71
+ ## Size
72
+
73
+ Le bouton en small
74
+
75
+ <Canvas>
76
+ <Story story={stories.size} height={75} />
77
+ </Canvas>
78
+
79
+ ## Usage
80
+
81
+ Un petit bouton avec les bords arrondis en fond transparent avec une bordure
82
+
83
+ ```html
84
+ <PixButton
85
+ @triggerAction={{action triggerAction}}
86
+ @loadingColor="white"
87
+ @shape="squircle"
88
+ @backgroundColor="transparent-light"
89
+ @isDisabled={{false}}
90
+ @size="small"
91
+ @isBorderVisible={{true}}
92
+ >
93
+ Cliquez-moi
94
+ </PixButton>
95
+ ```
96
+
97
+ ## Arguments
98
+
99
+ <ArgsTable story="Default" exclude={['buttons', 'model', 'label', 'style']} />
@@ -0,0 +1,56 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const collapsible = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixCollapsible
7
+ @title={{title}}
8
+ @titleIcon={{titleIcon}}>
9
+ <div>Contenu du PixCollapsible</div>
10
+ </PixCollapsible>
11
+ `,
12
+ context: args,
13
+ };
14
+ };
15
+
16
+ export const multipleCollapsible = (args) => {
17
+ return {
18
+ template: hbs`
19
+ <div>
20
+ <PixCollapsible
21
+ @title="Titre A"
22
+ @titleIcon={{titleIcon}}>
23
+ <div>Contenu A</div>
24
+ </PixCollapsible>
25
+
26
+ <PixCollapsible
27
+ @title="Titre B"
28
+ @titleIcon={{titleIcon}}>
29
+ <div>Contenu B</div>
30
+ </PixCollapsible>
31
+
32
+ <PixCollapsible
33
+ @title="Titre C"
34
+ @titleIcon={{titleIcon}}>
35
+ <div>Contenu C</div>
36
+ </PixCollapsible>
37
+ </div>
38
+ `,
39
+ context: args,
40
+ };
41
+ };
42
+
43
+ export const argTypes = {
44
+ title: {
45
+ name: 'title',
46
+ description: 'Intitulé du contenu du PixCollapsible',
47
+ type: { name: 'string', required: true },
48
+ defaultValue: 'Titre du contenu à dérouler en cliquant',
49
+ },
50
+ titleIcon: {
51
+ name: 'titleIcon',
52
+ description: "Ajoute l'icône donnée en paramètre avant le titre du PixCollapsible",
53
+ type: { name: 'string', required: false },
54
+ defaultValue: 'user',
55
+ },
56
+ };
@@ -0,0 +1,39 @@
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
2
+ import centered from '@storybook/addon-centered/ember';
3
+
4
+ import * as stories from './pix-collapsible.stories.js';
5
+
6
+ <Meta
7
+ title='Others/Collapsible'
8
+ component='PixCollapsible'
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # PixCollapsible
13
+
14
+ Un `PixCollapsible` est un élément comprenant un libellé et un contenu.
15
+ Par défaut le contenu est masqué et cliquer sur le libellé permet de montrer le contenu du `PixCollapsible`.
16
+
17
+ > Il est possible de cumuler les `PixCollapsible` de sorte à former un accordéon, il suffit de les mettre dans une même div parente.
18
+
19
+ <Canvas>
20
+ <Story name='PixCollapsible' story={stories.collapsible} height={150} />
21
+ </Canvas>
22
+
23
+ <Canvas>
24
+ <Story name='MultiplePixCollapsible' story={stories.multipleCollapsible} height={260} />
25
+ </Canvas>
26
+
27
+ ## Usage
28
+
29
+ ```html
30
+ <PixCollapsible
31
+ @title="Titre du contenu à dérouler en cliquant"
32
+ @iconTitle="user">
33
+ <p>Contenu du PixCollapsible</p>
34
+ </PixCollapsible>
35
+ ```
36
+
37
+ ## Arguments
38
+
39
+ <ArgsTable story="PixCollapsible" />
@@ -0,0 +1,51 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+ import { action } from '@storybook/addon-actions';
3
+
4
+ export const filterBanner = (args) => {
5
+ return {
6
+ template: hbs`
7
+ <PixFilterBanner @title={{title}} @details={{details}} @clearFiltersLabel={{clearFiltersLabel}} @onClearFilters={{onClearFilters}}>
8
+ <PixSelect @options={{this.options}} @onChange={{this.onChange}} />
9
+ <PixSelect @options={{this.options}} @onChange={{this.onChange}} />
10
+ </PixFilterBanner>
11
+ `,
12
+ context: args,
13
+ };
14
+ };
15
+ filterBanner.args = {
16
+ title: 'Filtres',
17
+ details: 'Des détails sur le filtre',
18
+ clearFiltersLabel: 'Effacer les filtres',
19
+ options: [
20
+ { value: '1', label: 'Tomate' },
21
+ { value: '2', label: 'Mozza' },
22
+ ],
23
+ onChange: action('select-onchange'),
24
+ };
25
+
26
+ export const argTypes = {
27
+ title: {
28
+ name: 'title',
29
+ description: 'Titre du filtre',
30
+ type: { name: 'string', required: false },
31
+ defaultValue: null,
32
+ },
33
+ details: {
34
+ name: 'details',
35
+ description: 'Détails du filtre',
36
+ type: { name: 'string', required: false },
37
+ defaultValue: null,
38
+ },
39
+ clearFiltersLabel: {
40
+ name: 'clearFiltersLabel',
41
+ description: 'libellé du bouton',
42
+ type: { name: 'string', required: false },
43
+ defaultValue: null,
44
+ },
45
+ onClearFilters: {
46
+ name: 'onClearFilters',
47
+ description: 'fonction à appeler pour déclencher l’action de suppression des filtres',
48
+ type: { required: false },
49
+ defaultValue: action('onClearFilters'),
50
+ },
51
+ };
@@ -0,0 +1,33 @@
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
2
+ import centered from '@storybook/addon-centered/ember';
3
+ import * as stories from './pix-filter-banner.stories.js';
4
+
5
+ <Meta
6
+ title='Form/Filter banner'
7
+ component='PixFilterBanner'
8
+ decorators={[centered]}
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # Pix Filter Banner
13
+
14
+ Une `FilterBanner` permet de wrapper les éléments de filtres (`Select`, `Multi-Select`, ...).
15
+
16
+ > Il est possible de surcharger le style d'une `<PixFilterBanner>` via l'attribut `class` ainsi que de passer n'importe quel attribut sur sa `div` wrapper (par exemple, un `aria-label`)
17
+
18
+ <Canvas>
19
+ <Story name="Filter banner" story={stories.filterBanner} height={80} />
20
+ </Canvas>
21
+
22
+ ## Usage
23
+
24
+ ```html
25
+ <PixFilterBanner aria-label="Filtres sur les campagnes">
26
+ <PixSelect @options={{options}} @onChange={{onChange}} />
27
+ <PixSelect @options={{options}} @onChange={{onChange}} />
28
+ </PixFilterBanner>
29
+ ```
30
+
31
+ ## Arguments
32
+
33
+ <ArgsTable story="Filter banner" />
@@ -0,0 +1,95 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+ import { action } from '@storybook/addon-actions';
3
+
4
+ const Template = (args) => {
5
+ return {
6
+ template: hbs`
7
+ <PixIconButton
8
+ @ariaLabel={{ariaLabel}}
9
+ @icon={{icon}}
10
+ @iconPrefix={{iconPrefix}}
11
+ @triggerAction={{triggerAction}}
12
+ @withBackground={{withBackground}}
13
+ @size={{size}}
14
+ />
15
+ `,
16
+ context: args,
17
+ };
18
+ };
19
+
20
+ export const Default = Template.bind({});
21
+ Default.args = {
22
+ ariaLabel: 'Action du bouton',
23
+ icon: 'times',
24
+ triggerAction: () => {
25
+ return new Promise().resolves();
26
+ },
27
+ };
28
+
29
+ export const small = Template.bind({});
30
+ small.args = {
31
+ ...Default.args,
32
+ size: 'small',
33
+ };
34
+
35
+ export const withBackground = Template.bind({});
36
+ withBackground.args = {
37
+ ...Default.args,
38
+ withBackground: true,
39
+ };
40
+
41
+ export const argTypes = {
42
+ ariaLabel: {
43
+ name: 'ariaLabel',
44
+ description: "l'action du bouton, pour l'accessibilité",
45
+ type: { name: 'string', required: true },
46
+ table: { defaultValue: { summary: 'times' } },
47
+ },
48
+ icon: {
49
+ name: 'icon',
50
+ description: 'Icône font-awesome',
51
+ type: { name: 'string', required: true },
52
+ table: { defaultValue: { summary: 'times' } },
53
+ },
54
+ iconPrefix: {
55
+ name: 'iconPrefix',
56
+ description: "Prefix de l'icône font-awesome",
57
+ type: { name: 'string', required: false },
58
+ control: { type: 'select', options: ['far', 'fas'] },
59
+ },
60
+ triggerAction: {
61
+ name: 'triggerAction',
62
+ description: 'Fonction à appeler au clic du bouton',
63
+ type: { required: true },
64
+ defaultValue: action('triggerAction'),
65
+ },
66
+ withBackground: {
67
+ name: 'withBackground',
68
+ description: 'Affichage du fond grisé',
69
+ type: { name: 'boolean', required: false },
70
+ table: {
71
+ type: { summary: 'boolean' },
72
+ defaultValue: { summary: 'false' },
73
+ },
74
+ },
75
+ size: {
76
+ name: 'size',
77
+ description: 'Size: `small`, `big`',
78
+ type: { name: 'string', required: false },
79
+ control: { type: 'select', options: ['big', 'small'] },
80
+ table: {
81
+ type: { summary: 'string' },
82
+ defaultValue: { summary: 'big' },
83
+ },
84
+ },
85
+ color: {
86
+ name: 'color',
87
+ description: ' ⚠️ **Propriété dépréciée** ⚠️ Color: `light-grey`, `dark-grey`',
88
+ type: { name: 'string', required: false },
89
+ control: { type: 'select', options: ['light-grey', 'dark-grey'] },
90
+ table: {
91
+ type: { summary: 'string' },
92
+ defaultValue: { summary: 'light-grey' },
93
+ },
94
+ },
95
+ };