@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,90 @@
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-icon-button.stories.js';
4
+
5
+ <Meta
6
+ title='Basics/Icon button'
7
+ component='PixIconButton'
8
+ decorators={[centered]}
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # Pix Icon Button
13
+
14
+ Le PixIconButton permet de créer un bouton contenant une icône font-awesome.
15
+
16
+ ## Default
17
+
18
+ Le bouton en version big et sans fond grisé.
19
+
20
+ <Canvas>
21
+ <Story name="Default" story={stories.Default} height={60} />
22
+ </Canvas>
23
+
24
+ ## Small
25
+
26
+ Le bouton en version small.
27
+
28
+ <Canvas>
29
+ <Story name="Small" story={stories.small} height={60} />
30
+ </Canvas>
31
+
32
+ ## With Background
33
+
34
+ Le bouton avec le fond grisé.
35
+
36
+ <Canvas>
37
+ <Story name="With Background" story={stories.withBackground} height={60} />
38
+ </Canvas>
39
+
40
+ ## Accessibilité / aria-label
41
+
42
+ L'attribut `aria-label` étant indispensable pour l'accessibilité de ce composant, la propriété `ariaLabel` a été ajouté.
43
+
44
+ ## Color
45
+
46
+ ⚠️ Cette propriété est **dépréciée**. L'icône du bouton ne peut avoir qu'une seule couleur.
47
+
48
+ ## Usage
49
+
50
+ Par défaut
51
+ ```html
52
+ <PixIconButton
53
+ @ariaLabel="L'action du bouton"
54
+ @icon="icon"
55
+ @triggerAction={{triggerAction}}
56
+ />
57
+ ```
58
+
59
+ Bouton de fermeture
60
+ ```html
61
+ <PixIconButton
62
+ @ariaLabel="L'action du bouton"
63
+ @icon="times"
64
+ @triggerAction={{triggerAction}}
65
+ @withBackground={{true}}
66
+ />
67
+ ```
68
+
69
+ Bouton d'action
70
+ ```html
71
+ <PixIconButton
72
+ @ariaLabel="L'action du bouton"
73
+ @icon="arrow-left"
74
+ @triggerAction={{triggerAction}}
75
+ @size="small"
76
+ @withBackground={{true}}
77
+ />
78
+ ```
79
+
80
+ État disabled
81
+ ```html
82
+ <PixIconButton
83
+ @ariaLabel="L'action du bouton"
84
+ @icon="times"
85
+ disabled={{true}}
86
+ aria-disabled={{true}}
87
+ />
88
+ ```
89
+
90
+ <ArgsTable story="Default" />
@@ -0,0 +1,74 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const Template = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixInputCode
7
+ @ariaLabel={{ariaLabel}}
8
+ @legend={{legend}}
9
+ @inputType={{inputType}}
10
+ @numInputs={{numInputs}}
11
+ @explanationOfUse={{explanationOfUse}}
12
+ />
13
+ `,
14
+ context: args,
15
+ };
16
+ };
17
+
18
+ export const Default = Template.bind({});
19
+ Default.args = {
20
+ ariaLabel: 'Champ',
21
+ legend: "Code de validation d'adresse e-mail",
22
+ };
23
+
24
+ export const argTypes = {
25
+ ariaLabel: {
26
+ name: 'ariaLabel',
27
+ description:
28
+ "L'aria-label de chaque champ. L'aria-label est automatiquement complété à la fin par ` <numero>`, où `<numero>` correspond à la position du champ dans le PixInputCode.",
29
+ type: { name: 'string', required: true },
30
+ },
31
+ legend: {
32
+ name: 'legend',
33
+ description:
34
+ "La description du composant. Ce champ n'est pas visible. Indiquer ce à quoi correspond votre PixInputCode.",
35
+ type: { name: 'string', required: true },
36
+ },
37
+ explanationOfUse: {
38
+ name: 'explanationOfUse',
39
+ description:
40
+ "Explication du fonctionnement des champs du PixInputCode. Ce champ n'est pas visible. Le texte par défaut est uniquement en Français. Veillez à donc le surchager avec vos traductions. Par ailleurs, le texte par défaut change selon le type du champ du PixInputCode",
41
+ type: { name: 'string', required: false },
42
+ table: {
43
+ type: { summary: 'string' },
44
+ defaultValue: {
45
+ summary:
46
+ 'Pour se déplacer de champ en champ vous pouvez utiliser la tabulation ou bien les flèches gauche et droite de votre clavier. Pour remplir un champ vous pouvez utiliser des chiffres de 1 à 9 ou bien les flèches haut et bas de votre clavier pour incrémenter de 1 la valeur du champ.',
47
+ },
48
+ },
49
+ },
50
+ inputType: {
51
+ name: 'inputType',
52
+ description: 'Le type de chaque champ : `number` ou `text`',
53
+ type: { name: 'string', required: false },
54
+ options: ['number', 'text'],
55
+ control: { type: 'select' },
56
+ table: {
57
+ defaultValue: { summary: 'number' },
58
+ },
59
+ },
60
+ numInputs: {
61
+ name: 'numInputs',
62
+ description: 'Le nombre de champ',
63
+ type: { name: 'number', required: false },
64
+ table: {
65
+ defaultValue: { summary: 6 },
66
+ },
67
+ },
68
+ onAllInputsFilled: {
69
+ name: 'onAllInputsFilled',
70
+ description: 'Fonction appelée (avec le code en paramètre) une fois tous les champs remplis',
71
+ type: { required: false },
72
+ control: { disable: true },
73
+ },
74
+ };
@@ -0,0 +1,46 @@
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-input-code.stories.js';
5
+
6
+ <Meta
7
+ title='Form/Inputs/Code'
8
+ component='PixInputCode'
9
+ decorators={[centered]}
10
+ argTypes={stories.argTypes}
11
+ />
12
+
13
+ # Pix Input Code
14
+
15
+ Le `PixInputCode` permet d'associer plusieurs champs pour entrer un code reçu.
16
+
17
+ Un aria-label est requis pour l'accessibilité.
18
+
19
+ Par défaut il y a 6 champs mais le nombre est modifiable avec `numInputs`.
20
+
21
+ Le composant peut être numérique ou alphanumérique précisé avec la propriété `inputType`, par défaut il est numérique.
22
+
23
+ > ⚠️ N'oubliez pas de renseigner vous même la variable `@explanationOfUse` afin de garantir la gestion de traduction sur le composant PixInputCode.
24
+
25
+ ## Default
26
+
27
+ <Canvas>
28
+ <Story name='Default' story={stories.Default} height={70}/>
29
+ </Canvas>
30
+
31
+ ## Usage
32
+
33
+ ```html
34
+ <PixInputCode
35
+ @ariaLabel="Champ"
36
+ @legend="Code correspondant au code de vérification envoyé par email"
37
+ @explanationOfUse="Détails d'utilisation du PixInputCode"
38
+ @numInputs={{6}}
39
+ @inputType="number"
40
+ @onAllInputsFilled={{(code) => {}}}
41
+ />
42
+ ```
43
+
44
+ ## Arguments
45
+
46
+ <ArgsTable story="Default"/>
@@ -0,0 +1,89 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const Template = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixInputPassword
7
+ @ariaLabel={{ariaLabel}}
8
+ @id={{id}}
9
+ @label={{label}}
10
+ @information={{information}}
11
+ @errorMessage={{errorMessage}}
12
+ @prefix={{prefix}}
13
+ />
14
+ `,
15
+ context: args,
16
+ };
17
+ };
18
+
19
+ export const Default = Template.bind({});
20
+ Default.args = {
21
+ id: 'firstName',
22
+ ariaLabel: 'Mot de passe',
23
+ };
24
+
25
+ export const withLabelAndInformation = Template.bind({});
26
+ withLabelAndInformation.args = {
27
+ id: 'password',
28
+ label: 'Mot de passe',
29
+ information: 'Une brève information',
30
+ };
31
+
32
+ export const withErrorMessage = Template.bind({});
33
+ withErrorMessage.args = {
34
+ id: 'password',
35
+ label: 'Mot de passe',
36
+ errorMessage: "Un message d'erreur.",
37
+ };
38
+
39
+ export const withPrefix = Template.bind({});
40
+ withPrefix.args = {
41
+ id: 'password',
42
+ label: 'Mot de passe',
43
+ prefix: 'C -',
44
+ };
45
+
46
+ export const argTypes = {
47
+ id: {
48
+ name: 'id',
49
+ description: 'Identifiant du champ permettant de lui attacher un label',
50
+ type: { name: 'string', required: true },
51
+ defaultValue: null,
52
+ },
53
+ value: {
54
+ name: 'value',
55
+ description: "Valeur de l'input",
56
+ type: { name: 'string', required: false },
57
+ defaultValue: null,
58
+ },
59
+ label: {
60
+ name: 'label',
61
+ description: "Label de l'input. Requis si ariaLabel n'est pas définit.",
62
+ type: { name: 'string', required: true },
63
+ defaultValue: null,
64
+ },
65
+ ariaLabel: {
66
+ name: 'ariaLabel',
67
+ description: "L'action du bouton, pour l'accessibilité. Requis si label n'est pas définit.",
68
+ type: { name: 'string', required: true },
69
+ defaultValue: null,
70
+ },
71
+ information: {
72
+ name: 'information',
73
+ description: 'Un descriptif complétant le label',
74
+ type: { name: 'string', required: false },
75
+ defaultValue: null,
76
+ },
77
+ errorMessage: {
78
+ name: 'errorMessage',
79
+ description: "Affiche le message d'erreur donné et encadre en rouge le champ",
80
+ type: { name: 'string', required: false },
81
+ defaultValue: null,
82
+ },
83
+ prefix: {
84
+ name: 'prefix',
85
+ description: 'Affiche un préfixe avant la zone de saisie du champ',
86
+ type: { name: 'string', required: false },
87
+ defaultValue: null,
88
+ },
89
+ };
@@ -0,0 +1,69 @@
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-input-password.stories.js';
5
+
6
+ <Meta
7
+ title='Form/Inputs/Password'
8
+ component='PixInputPassword'
9
+ decorators={[centered]}
10
+ argTypes={stories.argTypes}
11
+ />
12
+
13
+ # Pix Input Password
14
+
15
+ Champ pour le mot de passe, avec un `PixIconButton` pour l'afficher ou le masquer.
16
+
17
+ > Pensez à renseigner l'`autocomplete` selon l'utilisation du composant.
18
+
19
+ ## Accessibilité
20
+
21
+ Si vous utilisez le `PixInputPassword` sans label alors il faut renseigner le paramètre `ariaLabel`, sinon le composant renvoie une erreur.
22
+
23
+ > Si vous renseignez les paramètres label et ariaLabel ensemble, ariaLabel sera nullifié.
24
+
25
+ ```html
26
+ <PixInputPassword @ariaLabel='{{ariaLabel}}' @id='{{id}}' />
27
+ ```
28
+
29
+ ## Default
30
+
31
+ <Canvas>
32
+ <Story name='Default' story={stories.Default} height={100} />
33
+ </Canvas>
34
+
35
+ ## With label and information
36
+
37
+ <Canvas>
38
+ <Story story={stories.withLabelAndInformation} height={100} />
39
+ </Canvas>
40
+
41
+ ## With error message
42
+
43
+ <Canvas>
44
+ <Story story={stories.withErrorMessage} height={130} />
45
+ </Canvas>
46
+
47
+ ## With prefix
48
+
49
+ <Canvas>
50
+ <Story story={stories.withPrefix} height={100} />
51
+ </Canvas>
52
+
53
+ ## Usage
54
+
55
+ ```html
56
+ <PixInputPassword
57
+ @id='{{id}}'
58
+ @label='{{label}}'
59
+ @information='{{information}}'
60
+ @value='{{value}}'
61
+ @errorMessage='{{errorMessage}}'
62
+ @prefix='{{prefix}}'
63
+ @onChange='{{onChange}}'
64
+ />
65
+ ```
66
+
67
+ ## Arguments
68
+
69
+ <ArgsTable story='Default' />
@@ -0,0 +1,94 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ export const Template = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixInput
7
+ @id={{id}}
8
+ @label={{label}}
9
+ @information={{information}}
10
+ @errorMessage={{errorMessage}}
11
+ @icon={{icon}}
12
+ @isIconLeft={{isIconLeft}}
13
+ placeholder='Jeanne, Pierre ...' />
14
+ `,
15
+ context: args,
16
+ };
17
+ };
18
+
19
+ export const Default = Template.bind({});
20
+ Default.args = {
21
+ id: 'firstName',
22
+ };
23
+
24
+ export const withLabel = Template.bind({});
25
+ withLabel.args = {
26
+ id: 'firstName',
27
+ label: 'Prénom',
28
+ information: 'a small information',
29
+ };
30
+
31
+ export const withErrorMessage = Template.bind({});
32
+ withErrorMessage.args = {
33
+ id: 'firstName',
34
+ label: 'Prénom',
35
+ information: 'a small information',
36
+ errorMessage: "un message d'erreur",
37
+ };
38
+
39
+ export const withIcon = Template.bind({});
40
+ withIcon.args = {
41
+ id: 'firstName',
42
+ label: 'Prénom',
43
+ icon: 'eye',
44
+ };
45
+
46
+ export const argTypes = {
47
+ id: {
48
+ name: 'id',
49
+ description: 'Identifiant du champ permettant de lui attacher un label',
50
+ type: { name: 'string', required: true },
51
+ defaultValue: null,
52
+ },
53
+ value: {
54
+ name: 'value',
55
+ description: "Valeur de l'input",
56
+ type: { name: 'string', required: false },
57
+ defaultValue: null,
58
+ },
59
+ label: {
60
+ name: 'label',
61
+ description: "Le label de l'input",
62
+ type: { name: 'string', required: false },
63
+ defaultValue: null,
64
+ },
65
+ information: {
66
+ name: 'information',
67
+ description: 'Un descriptif complétant le label',
68
+ type: { name: 'string', required: false },
69
+ defaultValue: null,
70
+ },
71
+ errorMessage: {
72
+ name: 'errorMessage',
73
+ description: "Affiche le message d'erreur donné et encadre en rouge le champ",
74
+ type: { name: 'string', required: false },
75
+ defaultValue: null,
76
+ },
77
+ icon: {
78
+ name: 'icon',
79
+ description: "Affiche l'icône choisie à la fin de l'input",
80
+ type: { name: 'string', required: false },
81
+ defaultValue: null,
82
+ },
83
+ isIconLeft: {
84
+ name: 'isIconLeft',
85
+ description: "Permet d'afficher l'icône choisie sur la gauche",
86
+ type: { name: 'boolean', required: false },
87
+ control: { type: 'boolean' },
88
+ defaultValue: false,
89
+ table: {
90
+ type: { summary: 'boolean' },
91
+ defaultValue: { summary: 'false' },
92
+ },
93
+ },
94
+ };
@@ -0,0 +1,57 @@
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-input.stories.js';
5
+
6
+ <Meta
7
+ title='Form/Inputs/Input'
8
+ component='PixInput'
9
+ decorators={[centered]}
10
+ argTypes={stories.argTypes}
11
+ />
12
+
13
+ # Pix Input
14
+
15
+ Le PixInput permet de créer un champ de texte.
16
+
17
+
18
+ ## Default
19
+
20
+ <Canvas>
21
+ <Story name='Default' story={stories.Default} height={100} />
22
+ </Canvas>
23
+
24
+ ## With label and information
25
+
26
+ <Canvas>
27
+ <Story story={stories.withLabel} height={100} />
28
+ </Canvas>
29
+
30
+ ## With error message
31
+
32
+ <Canvas>
33
+ <Story story={stories.withErrorMessage} height={130} />
34
+ </Canvas>
35
+
36
+ ## With icon
37
+
38
+ <Canvas>
39
+ <Story story={stories.withIcon} height={130} />
40
+ </Canvas>
41
+
42
+ ## Usage
43
+
44
+ ```html
45
+ <PixInput
46
+ @id='firstName'
47
+ @label='Prénom'
48
+ @information='Complément du label'
49
+ @errorMessage="Un message d'erreur"
50
+ @icon="eye"
51
+ @isIconLeft={{false}}
52
+ @onChange={{onChange}} />
53
+ ```
54
+
55
+ ## Arguments
56
+
57
+ <ArgsTable story="Default" />
@@ -0,0 +1,57 @@
1
+ import { hbs } from 'ember-cli-htmlbars';
2
+
3
+ const Template = (args) => {
4
+ return {
5
+ template: hbs`
6
+ <PixMessage
7
+ @type={{type}}
8
+ @withIcon={{withIcon}}
9
+ >
10
+ Ceci est un message {{type}} avec un texte tellement long qu'il est nécessaire <br /> de l'afficher sur deux lignes.
11
+ </PixMessage>
12
+ `,
13
+ context: args,
14
+ };
15
+ };
16
+
17
+ export const Default = Template.bind({});
18
+
19
+ export const error = Template.bind({});
20
+ error.args = {
21
+ type: 'error',
22
+ withIcon: true,
23
+ };
24
+
25
+ export const warning = Template.bind({});
26
+ warning.args = {
27
+ type: 'warning',
28
+ withIcon: true,
29
+ };
30
+
31
+ export const success = Template.bind({});
32
+ success.args = {
33
+ type: 'success',
34
+ withIcon: true,
35
+ };
36
+
37
+ export const withIcon = Template.bind({});
38
+ withIcon.args = {
39
+ withIcon: true,
40
+ };
41
+
42
+ export const argTypes = {
43
+ type: {
44
+ name: 'type',
45
+ description: 'Type du message',
46
+ type: { name: 'string', required: false },
47
+ defaultValue: 'info',
48
+ control: { type: 'select', options: ['info', 'success', 'warning', 'alert', 'error'] },
49
+ },
50
+ withIcon: {
51
+ name: 'withIcon',
52
+ description: 'Icône du message',
53
+ type: { name: 'boolean', required: false },
54
+ defaultValue: false,
55
+ control: { type: 'boolean' },
56
+ },
57
+ };
@@ -0,0 +1,71 @@
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-message.stories.js';
4
+
5
+ <Meta
6
+ title='Notification/Message'
7
+ component='PixMessage'
8
+ decorators={[centered]}
9
+ argTypes={stories.argTypes}
10
+ />
11
+
12
+ # Pix Message
13
+
14
+ Un bandeau d'information avec une icône facultative.
15
+
16
+ ## Default / Info
17
+
18
+ Le bandeau est de type informatif sans icône (par défaut).
19
+
20
+ <Canvas>
21
+ <Story name="Default" story={stories.Default} height={110} />
22
+ </Canvas>
23
+
24
+ ## With icon
25
+
26
+ Le bandeau avec une icône.
27
+
28
+ <Canvas>
29
+ <Story name="With icon" story={stories.withIcon} height={110} />
30
+ </Canvas>
31
+
32
+ ## Warning
33
+
34
+ Le bandeau en cas d'alerte.
35
+
36
+ <Canvas>
37
+ <Story name="Warning" story={stories.warning} height={110} />
38
+ </Canvas>
39
+
40
+ ## Success
41
+
42
+ Le bandeau en cas de validation.
43
+
44
+ <Canvas>
45
+ <Story name="Success" story={stories.success} height={110} />
46
+ </Canvas>
47
+
48
+ ## Error
49
+
50
+ Le bandeau en cas de d'erreur.
51
+
52
+ <Canvas>
53
+ <Story name="Error" story={stories.error} height={110} />
54
+ </Canvas>
55
+
56
+ ## Alert
57
+
58
+ ⚠️ Ce type est déprécié, utilisez le type `error` à la place.
59
+
60
+ ## Usage
61
+
62
+ Par défaut
63
+ ```html
64
+ <PixMessage>
65
+ Ceci est un message à caractère informatif.
66
+ </PixMessage>
67
+ ```
68
+
69
+ ## Arguments
70
+
71
+ <ArgsTable story="Default" />