@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,199 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+ import { action } from '@storybook/addon-actions';
3
+
4
+ const DEFAULT_OPTIONS = [
5
+ { label: 'ANETH HERBE AROMATIQUE', value: '1' },
6
+ { label: 'ANIS VERT HERBE AROMATIQUE', value: '2' },
7
+ { label: 'BADIANE AROMATE', value: '3' },
8
+ { label: 'BAIES ROSES EPICES', value: '4' },
9
+ { label: 'BASILIC HERBE AROMATIQUE', value: '5' },
10
+ { label: 'BOURRACHE OFFICINALE HERBE AROMATIQUE', value: '6' },
11
+ { label: 'CANNELLE AROMATE', value: '7' },
12
+ { label: 'CAPRE CONDIMENT', value: '8' },
13
+ { label: 'CARDAMOME AROMATE', value: '9' },
14
+ { label: 'CARVI HERBE AROMATIQUE', value: '10' },
15
+ { label: 'CERFEUIL HERBE AROMATIQUE', value: '11' },
16
+ ];
17
+
18
+ export const multiSelectWithChildComponent = (args) => {
19
+ return {
20
+ template: hbs`
21
+ <h4>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</h4>
22
+ <PixMultiSelect
23
+ @title={{titleStars}}
24
+ @id={{id}}
25
+ @onSelect={{onSelect}}
26
+ @emptyMessage={{emptyMessage}}
27
+ @label={{label}}
28
+ @options={{options}} as |star|
29
+ >
30
+ <PixStars
31
+ @count={{star.value}}
32
+ @total={{star.total}}
33
+ />
34
+ </PixMultiSelect>
35
+ `,
36
+ context: args,
37
+ };
38
+ };
39
+
40
+ multiSelectWithChildComponent.args = {
41
+ titleStars: 'Sélectionner le niveau souhaité',
42
+ options: [
43
+ { value: '1', total: 3 },
44
+ { value: '2', total: 3 },
45
+ { value: '3', total: 3 },
46
+ ],
47
+ };
48
+
49
+ export const multiSelectSearchable = (args) => {
50
+ return {
51
+ template: hbs`
52
+ <h4>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</h4>
53
+ <PixMultiSelect
54
+ style="width:350px"
55
+ @id={{id}}
56
+ @title={{title}}
57
+ @placeholder={{placeholder}}
58
+ @isSearchable={{isSearchable}}
59
+ @showOptionsOnInput={{showOptionsOnInput}}
60
+ @strictSearch={{strictSearch}}
61
+ @onSelect={{doSomething}}
62
+ @emptyMessage={{emptyMessage}}
63
+ @size={{size}}
64
+ @selected={{selected}}
65
+ @options={{options}} as |option|
66
+ >
67
+ {{option.label}}
68
+ </PixMultiSelect>
69
+ `,
70
+ context: args,
71
+ };
72
+ };
73
+
74
+ export const multiSelectAsyncOptions = (args) => {
75
+ args.onLoadOptions = () => Promise.resolve(DEFAULT_OPTIONS);
76
+ return {
77
+ template: hbs`
78
+ <h4>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</h4>
79
+ <PixMultiSelect
80
+ style="width:350px"
81
+ @id={{id}}
82
+ @title={{title}}
83
+ @placeholder={{placeholder}}
84
+ @isSearchable={{isSearchable}}
85
+ @showOptionsOnInput={{showOptionsOnInput}}
86
+ @strictSearch={{strictSearch}}
87
+ @onSelect={{doSomething}}
88
+ @emptyMessage={{emptyMessage}}
89
+ @size={{size}}
90
+ @selected={{selected}}
91
+ @onLoadOptions={{onLoadOptions}} as |option|
92
+ >
93
+ {{option.label}}
94
+ </PixMultiSelect>
95
+ `,
96
+ context: args,
97
+ };
98
+ };
99
+
100
+ export const argTypes = {
101
+ id: {
102
+ name: 'id',
103
+ description: 'Permet l‘accessibilité du composant attribuant des ``for`` pour chaque entité',
104
+ type: { name: 'string', required: true },
105
+ defaultValue: 'aromate',
106
+ },
107
+ title: {
108
+ name: 'title',
109
+ description: 'Donne un titre à sa liste de choix multiple.',
110
+ type: { name: 'string', required: true },
111
+ defaultValue: 'Rechercher un condiment',
112
+ },
113
+ label: {
114
+ name: 'label',
115
+ description: 'Donne un label au champ, le paramètre @id devient obligatoire avec ce paramètre.',
116
+ type: { name: 'string', required: false },
117
+ table: {
118
+ type: { summary: 'string' },
119
+ defaultValue: { summary: null },
120
+ },
121
+ },
122
+ emptyMessage: {
123
+ name: 'emptyMessage',
124
+ description:
125
+ 'Un intitulé de choix indisponible (dans le cas ou certains filtres seraient excluant)',
126
+ type: { name: 'string', required: true },
127
+ defaultValue: 'pas de résultat',
128
+ },
129
+ loadingMessage: {
130
+ name: 'loadingMessage',
131
+ description:
132
+ "Message qui apparaît dans les options quand celles-ci sont en train d'être chargées via onLoadOptions",
133
+ type: { name: 'string', required: false },
134
+ defaultValue: 'Chargement...',
135
+ },
136
+ placeholder: {
137
+ name: 'placeholder',
138
+ description:
139
+ 'Donner une liste d‘exemple pour la recherche utilisateur dans le cas ``isSearchable`` à ``true``',
140
+ type: { name: 'string', required: true },
141
+ defaultValue: 'Curcuma, Thym, ...',
142
+ },
143
+ options: {
144
+ name: 'options',
145
+ description:
146
+ '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 conforme au traitement des input value.',
147
+ type: { name: 'array', required: true },
148
+ defaultValue: DEFAULT_OPTIONS,
149
+ },
150
+ onLoadOptions: {
151
+ name: 'onLoadOptions',
152
+ description:
153
+ 'Charge de manière asynchrone les options. Doit renvoyer une promesse avec la liste des options. 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 conforme au traitement des input value.',
154
+ type: { required: false },
155
+ },
156
+ onSelect: {
157
+ name: 'onSelect',
158
+ description: "Une fonction permettant d'effectuer une action à chaque sélection",
159
+ type: { required: true },
160
+ defaultValue: action('onSelect'),
161
+ },
162
+ selected: {
163
+ name: 'selected',
164
+ description: 'Une pré-sélection peut être donnée au composant',
165
+ type: { name: 'array', required: false },
166
+ defaultValue: ['1', '4'],
167
+ },
168
+ showOptionsOnInput: {
169
+ name: 'showOptionsOnInput',
170
+ description:
171
+ 'Afficher la liste au focus du champs de saisie lorsque ``isSearchable`` à ``true``',
172
+ type: { name: 'boolean', required: false },
173
+ defaultValue: true,
174
+ },
175
+ isSearchable: {
176
+ name: 'isSearchable',
177
+ description: 'Permet de rajouter une saisie utilisateur pour faciliter la recherche',
178
+ type: { name: 'boolean', required: false },
179
+ defaultValue: true,
180
+ },
181
+ strictSearch: {
182
+ name: 'strictSearch',
183
+ description:
184
+ 'Permet de rendre sensible à la casse et au diacritiques lorsque ``isSearchable`` à ``true``',
185
+ type: { name: 'boolean', required: false },
186
+ defaultValue: false,
187
+ },
188
+ size: {
189
+ name: 'size',
190
+ description:
191
+ '⚠️ **Propriété dépréciée** ⚠️ , désormais tous les éléments de formulaires feront 36px de hauteur.',
192
+ options: ['big', 'small'],
193
+ type: { name: 'string', required: false },
194
+ table: {
195
+ type: { summary: 'string' },
196
+ defaultValue: { summary: 'small' },
197
+ },
198
+ },
199
+ };
@@ -0,0 +1,55 @@
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-multi-select.stories.js';
4
+
5
+ <Meta
6
+ title='Form/Multi Select'
7
+ component='Multi Select'
8
+ argTypes={stories.argTypes}
9
+ />
10
+
11
+ # Pix Multi Select
12
+
13
+ Un select custom permettant une gestion de la multiselection. Permet de passer soit du texte brut soit des composants à sa liste. (PixStars etc...)
14
+ L'ajout de ``class`` et d'autres attributs comme ``aria-label`` sont possibles.
15
+
16
+ > ⚠️ 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.
17
+
18
+ ## With child component
19
+ <Canvas>
20
+ <Story name="With child component" story={stories.multiSelectWithChildComponent} height={310} />
21
+ </Canvas>
22
+
23
+ ## Searchable
24
+ <Canvas>
25
+ <Story name="Searchable" story={stories.multiSelectSearchable} height={330}/>
26
+ </Canvas>
27
+
28
+ ## With async options
29
+
30
+ Via la propriété `onLoadOptions`, le composant peut charger lui-même les options de manière asynchrone.
31
+ Le callback `onLoadOptions` est une promesse renvoyant la liste des options. (eg. `[{ label: 'A', value: '1' }]`).
32
+
33
+ Il est possible de donner un message via `loadingMessage` à afficher à la place des options pendant que celles-ci soient chargées.
34
+
35
+ <Canvas>
36
+ <Story name="With async options" story={stories.multiSelectAsyncOptions} height={330}/>
37
+ </Canvas>
38
+
39
+ ## Usage
40
+
41
+ ```html
42
+ <PixMultiSelect
43
+ @title={{title}}
44
+ @emptyMessage={{emptyMessage}}
45
+ @id={{id}}
46
+ @onSelect={{doSomething}}
47
+ @selected={{selected}}
48
+ @options={{options}} as |option|>
49
+ {{option.label}}
50
+ </PixMultiSelect>
51
+ ```
52
+
53
+ ## Arguments
54
+
55
+ <ArgsTable story="Searchable" />
@@ -0,0 +1,78 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const Default = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixProgressGauge
7
+ @value={{value}}
8
+ @color={{color}}
9
+ @isArrowLeft={{isArrowLeft}}
10
+ @subtitle={{subtitle}}
11
+ @tooltipText={{tooltipText}}
12
+ />
13
+ `,
14
+ context: args,
15
+ };
16
+ };
17
+ Default.args = {
18
+ tooltipText: '%',
19
+ };
20
+
21
+ export const whiteProgressGauge = (args) => {
22
+ return {
23
+ template: hbs`
24
+ <section style="width: 100%; padding: 35px 35px 5px;background-color: lightgray">
25
+ <PixProgressGauge
26
+ @value={{value}}
27
+ @color={{color}}
28
+ @isArrowLeft={{isArrowLeft}}
29
+ @subtitle={{subtitle}}
30
+ @tooltipText={{tooltipText}}
31
+ />
32
+ </section>
33
+ `,
34
+ context: args,
35
+ };
36
+ };
37
+ whiteProgressGauge.args = {
38
+ value: '50',
39
+ tooltipText: '50%',
40
+ color: 'white',
41
+ isArrowLeft: true,
42
+ subtitle: 'Avancement',
43
+ };
44
+
45
+ export const argTypes = {
46
+ value: {
47
+ name: 'value',
48
+ description: 'Valeur atteinte sur 100',
49
+ type: { name: 'number', required: false },
50
+ table: { defaultValue: { summary: null } },
51
+ },
52
+ color: {
53
+ name: 'color',
54
+ description:
55
+ 'Modifie la couleur de la barre de progression. Peut prendre les valeurs `yellow` ou `white`',
56
+ type: { name: 'string', required: false },
57
+ table: { defaultValue: { summary: 'yellow' } },
58
+ control: { type: 'select', options: ['yellow', 'white'] },
59
+ },
60
+ isArrowLeft: {
61
+ name: 'isArrowLeft',
62
+ description: "Modifie la position de l'info bulle sur la gauche",
63
+ type: { name: 'boolean', required: false },
64
+ table: { defaultValue: { summary: false } },
65
+ },
66
+ subtitle: {
67
+ name: 'subtitle',
68
+ description: 'Afficher un sous-titre sous la barre de progression',
69
+ type: { name: 'string', required: false },
70
+ table: { defaultValue: { summary: 'null' } },
71
+ },
72
+ tooltipText: {
73
+ name: 'tooltipText',
74
+ description: "Afficher un label dans l'info bulle au dessus de la barre de progression",
75
+ type: { name: 'string', required: false },
76
+ table: { defaultValue: { summary: 'null' } },
77
+ },
78
+ };
@@ -0,0 +1,43 @@
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-progress-gauge.stories.js';
4
+
5
+ <Meta
6
+ title='Others/Progress Gauge'
7
+ component='PixProgressGauge'
8
+ decorators={[centered]}
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # Progress Gauge
13
+
14
+ ## Default
15
+
16
+ Permet d'afficher un barre de progression sur un barème de 100%. Des paramètres existent pour changer la position de la tooltip ou la couleur du composant
17
+
18
+ <Canvas>
19
+ <Story name='Default' story={stories.Default} height={60} />
20
+ </Canvas>
21
+
22
+ ## White
23
+
24
+ Démonstration d'une barre de progression blanche avec l'info bulle à gauche avec un sous titre
25
+
26
+ <Canvas>
27
+ <Story name='White' story={stories.whiteProgressGauge} height={100} />
28
+ </Canvas>
29
+
30
+ ## Usage
31
+
32
+ ```html
33
+ <PixProgressGauge
34
+ @value="50"
35
+ @color="white"
36
+ @tooltipText="50%"
37
+ @isArrowLeft="true"
38
+ @subTitle="Un sous titre" />
39
+ ```
40
+
41
+ ## Arguments
42
+
43
+ <ArgsTable story="Default" />
@@ -0,0 +1,71 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ const Template = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixRadioButton
7
+ @label={{label}}
8
+ @value={{value}}
9
+ @isDisabled={{isDisabled}}
10
+ />
11
+ `,
12
+ context: args,
13
+ };
14
+ };
15
+
16
+ export const Default = Template.bind({});
17
+ Default.args = {
18
+ label: 'Poivron',
19
+ };
20
+
21
+ export const isDisabled = Template.bind({});
22
+ isDisabled.args = {
23
+ ...Default.args,
24
+ isDisabled: true,
25
+ };
26
+
27
+ const checked = (args) => {
28
+ return {
29
+ template: hbs`
30
+ <PixRadioButton
31
+ @label={{label}}
32
+ @isDisabled={{isDisabled}}
33
+ checked
34
+ />
35
+ `,
36
+ context: args,
37
+ };
38
+ };
39
+
40
+ export const disabledChecked = checked.bind({});
41
+ disabledChecked.args = {
42
+ ...Default.args,
43
+ isDisabled: true,
44
+ };
45
+
46
+ export const defaultChecked = checked.bind({});
47
+ defaultChecked.args = Default.args;
48
+
49
+ export const argTypes = {
50
+ label: {
51
+ name: 'label',
52
+ description: 'Le label du bouton radio',
53
+ type: { name: 'string', required: true },
54
+ defaultValue: null,
55
+ },
56
+ value: {
57
+ name: 'value',
58
+ description: "Valeur permettant d'identifier l'option sélectionnée",
59
+ type: { name: 'string', required: false },
60
+ defaultValue: null,
61
+ },
62
+ isDisabled: {
63
+ name: 'isDisabled',
64
+ description: 'Pour désactiver/activer le bouton radio',
65
+ type: { name: 'boolean', required: false },
66
+ defaultValue: false,
67
+ table: {
68
+ defaultValue: { summary: 'false' },
69
+ },
70
+ },
71
+ };
@@ -0,0 +1,49 @@
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-radio-button.stories.js';
5
+
6
+ <Meta
7
+ title='Form/Radio Button'
8
+ component='PixRadioButton'
9
+ decorators={[centered]}
10
+ argTypes={stories.argTypes}
11
+ />
12
+
13
+ # Pix Radio Button
14
+
15
+ Un bouton radio permettant de sélectionner une seule option dans une liste.
16
+
17
+ ⚠️ Le bouton radio ne peut pas être utilisé seul : il faut au minimum **2 options**.
18
+ Il est préférable de ne pas sélectionner d’option par défaut pour que le choix de l’utilisateur soit conscient (en particulier si le choix est obligatoire).
19
+
20
+ ## Default
21
+
22
+ <Canvas isColumn>
23
+ <Story name= "Default" story={stories.Default} height={60} />
24
+ <Story name='Default checked' story={stories.defaultChecked} height={60} />
25
+ </Canvas>
26
+
27
+ ## IsDisabled
28
+
29
+ État inactif du bouton radio.
30
+
31
+ <Canvas isColumn>
32
+ <Story name='Disabled' story={stories.isDisabled} height={60} />
33
+ <Story name='Disabled checked' story={stories.disabledChecked} height={60} />
34
+ </Canvas>
35
+
36
+ ## Usage
37
+
38
+ ```html
39
+
40
+ <PixRadioButton
41
+ @label={{label}}
42
+ @value={{value}}
43
+ @isDisabled={{isDisabled}}
44
+ />
45
+ ```
46
+
47
+ ## Arguments
48
+
49
+ <ArgsTable story="Default" />
@@ -0,0 +1,45 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const returnTo = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixReturnTo @route='profile' @shade={{shade}} />
7
+ `,
8
+ context: args,
9
+ };
10
+ };
11
+ returnTo.args = {
12
+ shade: 'blue',
13
+ };
14
+
15
+ export const returnToWithText = (args) => {
16
+ return {
17
+ template: hbs`
18
+ <PixReturnTo @route='profile' @shade={{shade}}>
19
+ Retour vers mon profil
20
+ </PixReturnTo>
21
+ `,
22
+ context: args,
23
+ };
24
+ };
25
+
26
+ export const argTypes = {
27
+ route: {
28
+ name: 'route',
29
+ description: 'Route de redirection',
30
+ type: { name: 'string', required: true },
31
+ defaultValue: null,
32
+ },
33
+ model: {
34
+ name: 'model',
35
+ description: 'Model Ember',
36
+ type: { required: false },
37
+ },
38
+ shade: {
39
+ name: 'shade',
40
+ description: 'Couleur du lien',
41
+ type: { name: 'string', required: false },
42
+ defaultValue: 'black',
43
+ control: { type: 'select', options: ['white', 'black', 'blue'] },
44
+ },
45
+ };
@@ -0,0 +1,41 @@
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-return-to.stories.js';
4
+
5
+ <Meta
6
+ title='Basics/Return To'
7
+ component='PixReturnTo'
8
+ decorators={[centered]}
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # Pix Return To
13
+
14
+ Le `ReturnTo` est un lien de retour vers uneOpixRe page précédente.
15
+
16
+ > Il est nécessaire de passer une @route au composant.
17
+
18
+ > Il est possible d'afficher uniquement l'icone flèche en omettant de mettre du contenu enfant dans la balise.
19
+
20
+ <Canvas isColumn>
21
+ Lien sans texte
22
+ <Story name="Return To" story={stories.returnTo} height={60} />
23
+ Lien avec texte
24
+ <Story name="Return To With Text" story={stories.returnToWithText} height={60} />
25
+ </Canvas>
26
+
27
+ ## Usage
28
+
29
+ ```html
30
+ Liens avec texte
31
+ <PixReturnTo @route='profile'>
32
+ Un lien de retour
33
+ </PixReturnTo>
34
+
35
+ Liens sans texte
36
+ <PixReturnTo @route='profile' />
37
+ ```
38
+
39
+ ## Arguments
40
+
41
+ <ArgsTable story="Return To With Text" />