@1024pix/pix-ui 24.2.0 → 24.2.1

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 (75) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/app/stories/form.stories.mdx +2 -4
  3. package/app/stories/pix-background-header.stories.mdx +3 -8
  4. package/app/stories/pix-banner.stories.js +9 -11
  5. package/app/stories/pix-banner.stories.mdx +9 -32
  6. package/app/stories/pix-block.stories.js +3 -2
  7. package/app/stories/pix-block.stories.mdx +1 -1
  8. package/app/stories/pix-button-link.stories.js +0 -2
  9. package/app/stories/pix-button-link.stories.mdx +7 -15
  10. package/app/stories/pix-button-upload.stories.js +2 -3
  11. package/app/stories/pix-button-upload.stories.mdx +4 -12
  12. package/app/stories/pix-button.stories.mdx +7 -9
  13. package/app/stories/pix-checkbox.stories.js +8 -10
  14. package/app/stories/pix-checkbox.stories.mdx +12 -13
  15. package/app/stories/pix-collapsible.stories.js +7 -3
  16. package/app/stories/pix-collapsible.stories.mdx +6 -12
  17. package/app/stories/pix-dropdown.stories.mdx +10 -14
  18. package/app/stories/pix-filter-banner.stories.js +1 -4
  19. package/app/stories/pix-filter-banner.stories.mdx +5 -9
  20. package/app/stories/pix-filterable-and-searchable-select.stories.js +0 -2
  21. package/app/stories/pix-filterable-and-searchable-select.stories.mdx +25 -25
  22. package/app/stories/pix-icon-button.stories.js +7 -5
  23. package/app/stories/pix-icon-button.stories.mdx +2 -6
  24. package/app/stories/pix-indicator-card.stories.js +2 -2
  25. package/app/stories/pix-indicator-card.stories.mdx +2 -1
  26. package/app/stories/pix-input-code.stories.mdx +7 -16
  27. package/app/stories/pix-input-password.stories.js +1 -8
  28. package/app/stories/pix-input-password.stories.mdx +12 -16
  29. package/app/stories/pix-input.stories.js +4 -10
  30. package/app/stories/pix-input.stories.mdx +14 -26
  31. package/app/stories/pix-message.stories.js +4 -3
  32. package/app/stories/pix-message.stories.mdx +4 -9
  33. package/app/stories/pix-modal.stories.js +0 -2
  34. package/app/stories/pix-modal.stories.mdx +2 -6
  35. package/app/stories/pix-multi-select.stories.mdx +24 -21
  36. package/app/stories/pix-pagination.stories.js +2 -1
  37. package/app/stories/pix-pagination.stories.mdx +19 -18
  38. package/app/stories/pix-progress-gauge.stories.js +2 -1
  39. package/app/stories/pix-progress-gauge.stories.mdx +6 -9
  40. package/app/stories/pix-radio-button.stories.js +0 -3
  41. package/app/stories/pix-radio-button.stories.mdx +7 -16
  42. package/app/stories/pix-return-to.stories.js +3 -3
  43. package/app/stories/pix-return-to.stories.mdx +4 -10
  44. package/app/stories/pix-search-input.stories.mdx +14 -22
  45. package/app/stories/pix-select.stories.mdx +26 -31
  46. package/app/stories/pix-selectable-tag.stories.mdx +10 -20
  47. package/app/stories/pix-sidebar.stories.js +0 -5
  48. package/app/stories/pix-sidebar.stories.mdx +2 -6
  49. package/app/stories/pix-stars.stories.js +12 -6
  50. package/app/stories/pix-stars.stories.mdx +3 -12
  51. package/app/stories/pix-tag.stories.js +21 -25
  52. package/app/stories/pix-tag.stories.mdx +5 -15
  53. package/app/stories/pix-textarea.stories.js +7 -12
  54. package/app/stories/pix-textarea.stories.mdx +8 -11
  55. package/app/stories/pix-toggle.stories.mdx +7 -11
  56. package/app/stories/pix-tooltip.stories.js +11 -14
  57. package/app/stories/pix-tooltip.stories.mdx +2 -7
  58. package/docs/architecture.stories.mdx +3 -3
  59. package/docs/breaking-changes.stories.mdx +16 -14
  60. package/docs/changelog.stories.mdx +1 -1
  61. package/docs/create-component.stories.mdx +31 -29
  62. package/docs/design-system.stories.mdx +2 -2
  63. package/docs/design-tokens.stories.mdx +6 -2
  64. package/docs/good-practices-a11y.stories.mdx +4 -9
  65. package/docs/good-practices-design.stories.mdx +11 -20
  66. package/docs/good-practices-responsive.stories.mdx +3 -3
  67. package/docs/good-practices-style-css.stories.mdx +10 -10
  68. package/docs/good-practices-tests.stories.mdx +2 -2
  69. package/docs/make-a-release.stories.mdx +16 -13
  70. package/docs/pix-design-tokens-dev.stories.mdx +1 -1
  71. package/docs/storybook.stories.mdx +4 -3
  72. package/docs/test-component-without-release.stories.mdx +1 -1
  73. package/docs/use-component.stories.mdx +7 -6
  74. package/docs/use-install.stories.mdx +6 -6
  75. package/package.json +1 -1
@@ -1,11 +1,7 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-filter-banner.stories.js';
3
3
 
4
- <Meta
5
- title='Form/Filter banner'
6
- component='PixFilterBanner'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Form/Filter banner" component="PixFilterBanner" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Filter Banner
11
7
 
@@ -21,9 +17,9 @@ Une `FilterBanner` permet de wrapper les éléments de filtres (`Select`, `Multi
21
17
 
22
18
  ```html
23
19
  <PixFilterBanner aria-label="Filtres sur les campagnes">
24
- <PixSelect @options={{options}} @onChange={{onChange}} />
25
- <PixSelect @options={{options}} @onChange={{onChange}} />
26
- <PixSelect @options={{options}} @onChange={{onChange}} />
20
+ <PixSelect @options="{{options}}" @onChange="{{onChange}}" />
21
+ <PixSelect @options="{{options}}" @onChange="{{onChange}}" />
22
+ <PixSelect @options="{{options}}" @onChange="{{onChange}}" />
27
23
  </PixFilterBanner>
28
24
  ```
29
25
 
@@ -201,13 +201,11 @@ export const argTypes = {
201
201
  description:
202
202
  'Pour le filtre de categories, cela rempli le contenu interne du composant, `categoriesPlaceholder` pour `isSearchable` `true`, sinon rawContent du `button`',
203
203
  type: { name: 'string', required: true },
204
- defaultValue: 'Rechercher un condiment',
205
204
  },
206
205
  categoriesLabel: {
207
206
  name: 'categoriesLabel',
208
207
  description:
209
208
  "Pour le composant de filtre sur les catégories, cela donne un label au champ qui sera celui vocalisé par le lecteur d'écran",
210
209
  type: { name: 'string', required: true },
211
- defaultValue: 'Label du champ',
212
210
  },
213
211
  };
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-filterable-and-searchable-select.stories.js';
3
3
 
4
4
  <Meta
@@ -15,9 +15,9 @@ Il permet de sélectionner une option, de filter sur la liste des options en fon
15
15
 
16
16
  Les options sont représentées par un tableau d'objet contenant les propriétés value, label et category.
17
17
 
18
- > **⚠️** __Il est nécessaire d'avoir au moins un label ou un placeholder !__
18
+ > **⚠️** **Il est nécessaire d'avoir au moins un label ou un placeholder !**
19
19
 
20
- > **⚠️** __N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !__
20
+ > **⚠️** **N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !**
21
21
 
22
22
  > Pour aider l'utilisateur, rajoutez un placeholder cohérent !
23
23
 
@@ -42,28 +42,28 @@ Les options sont représentées par un tableau d'objet contenant les propriété
42
42
  ## Usage
43
43
 
44
44
  ```html
45
- <PixFilterableAndSearchableSelect
46
- @label={{label}}
47
- @sublabel={{sublabel}}
48
- @selectLabel={{selectLabel}}
49
- @placeholder={{placeholder}}
50
- @options={{options}}
51
- @value={{value}}
52
- @isSearchable={{isSearchable}}
53
- @hideDefaultOption={{hideDefaultOption}}
54
- @screenReaderOnly={{screenReaderOnly}}
55
- @searchLabel={{searchLabel}}
56
- @searchPlaceholder={{searchPlaceholder}}
57
- @emptySearchMessage={{emptySearchMessage}}
58
- @requiredText={{requiredText}}
59
- @errorMessage={{errorMessage}}
60
- @onChange={{onChange}}
61
- @categoriesLabel={{categoriesLabel}}
62
- @categoriesPlaceholder={{categoriesPlaceholder}}
63
- @categoriesEmptyMessage={{categoriesEmptyMessage}}
64
- @requiredText={{requiredText}}
65
- @errorMessage={{errorMessage}}
66
- />
45
+ <PixFilterableAndSearchableSelect
46
+ @label="{{label}}"
47
+ @sublabel="{{sublabel}}"
48
+ @selectLabel="{{selectLabel}}"
49
+ @placeholder="{{placeholder}}"
50
+ @options="{{options}}"
51
+ @value="{{value}}"
52
+ @isSearchable="{{isSearchable}}"
53
+ @hideDefaultOption="{{hideDefaultOption}}"
54
+ @screenReaderOnly="{{screenReaderOnly}}"
55
+ @searchLabel="{{searchLabel}}"
56
+ @searchPlaceholder="{{searchPlaceholder}}"
57
+ @emptySearchMessage="{{emptySearchMessage}}"
58
+ @requiredText="{{requiredText}}"
59
+ @errorMessage="{{errorMessage}}"
60
+ @onChange="{{onChange}}"
61
+ @categoriesLabel="{{categoriesLabel}}"
62
+ @categoriesPlaceholder="{{categoriesPlaceholder}}"
63
+ @categoriesEmptyMessage="{{categoriesEmptyMessage}}"
64
+ @requiredText="{{requiredText}}"
65
+ @errorMessage="{{errorMessage}}"
66
+ />
67
67
  ```
68
68
 
69
69
  ## Arguments
@@ -17,7 +17,7 @@ const Template = (args) => {
17
17
  };
18
18
  };
19
19
 
20
- const triggerAction = () => Promise.resolve();
20
+ const triggerAction = action('triggerAction');
21
21
 
22
22
  export const Default = Template.bind({});
23
23
  Default.args = {
@@ -63,13 +63,13 @@ export const argTypes = {
63
63
  name: 'iconPrefix',
64
64
  description: "Prefix de l'icône font-awesome",
65
65
  type: { name: 'string', required: false },
66
- control: { type: 'select', options: ['far', 'fas'] },
66
+ control: { type: 'select' },
67
+ options: ['far', 'fas'],
67
68
  },
68
69
  triggerAction: {
69
70
  name: 'triggerAction',
70
71
  description: 'Fonction à appeler au clic du bouton',
71
72
  type: { required: true },
72
- defaultValue: action('triggerAction'),
73
73
  },
74
74
  withBackground: {
75
75
  name: 'withBackground',
@@ -84,7 +84,8 @@ export const argTypes = {
84
84
  name: 'size',
85
85
  description: 'Size: `small`, `big`',
86
86
  type: { name: 'string', required: false },
87
- control: { type: 'select', options: ['big', 'small'] },
87
+ control: { type: 'select' },
88
+ options: ['big', 'small'],
88
89
  table: {
89
90
  type: { summary: 'string' },
90
91
  defaultValue: { summary: 'big' },
@@ -94,7 +95,8 @@ export const argTypes = {
94
95
  name: 'color',
95
96
  description: ' ⚠️ **Propriété dépréciée** ⚠️ Color: `light-grey`, `dark-grey`',
96
97
  type: { name: 'string', required: false },
97
- control: { type: 'select', options: ['light-grey', 'dark-grey'] },
98
+ control: { type: 'select' },
99
+ options: ['light-grey', 'dark-grey'],
98
100
  table: {
99
101
  type: { summary: 'string' },
100
102
  defaultValue: { summary: 'light-grey' },
@@ -1,11 +1,7 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-icon-button.stories.js';
3
3
 
4
- <Meta
5
- title="Basics/Icon button"
6
- component="PixIconButton"
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Basics/Icon button" component="PixIconButton" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Icon Button
11
7
 
@@ -56,8 +56,8 @@ export const argTypes = {
56
56
  iconPrefix: {
57
57
  name: 'IconPrefix',
58
58
  description:
59
- "Préfixe pour l'icone dans l'encart - permet d'utiliser une variation de l'icone font awesome différente de celle par défaut (fa).",
60
- defaultValue: null,
59
+ "Préfixe pour l'icone dans l'encart - permet d'utiliser une variation de l'icone font awesome différente de celle par défaut.",
60
+ table: { defaultValue: { summary: 'fas' } },
61
61
  },
62
62
  value: {
63
63
  name: 'Value',
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-indicator-card.stories.js';
3
3
 
4
4
  <Meta title="Others/Indicator Card" component="PixIndicatorCard" argTypes={stories.argTypes} />
@@ -18,6 +18,7 @@ Une carte est un bloc en 2 parties dont les bords sont arrondis et ayant une omb
18
18
  </Canvas>
19
19
 
20
20
  ## WithIconPrefix
21
+
21
22
  <Canvas>
22
23
  <Story name="WithIconPrefix" story={stories.withIconPrefix} height={200} />
23
24
  </Canvas>
@@ -1,12 +1,8 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
 
3
3
  import * as stories from './pix-input-code.stories.js';
4
4
 
5
- <Meta
6
- title='Form/Inputs/Code'
7
- component='PixInputCode'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Form/Inputs/Code" component="PixInputCode" argTypes={stories.argTypes} />
10
6
 
11
7
  # Pix Input Code
12
8
 
@@ -23,22 +19,17 @@ Le composant peut être numérique ou alphanumérique précisé avec la proprié
23
19
  ## Default
24
20
 
25
21
  <Canvas>
26
- <Story name='Default' story={stories.Default} height={70}/>
22
+ <Story name="Default" story={stories.Default} height={70} />
27
23
  </Canvas>
28
24
 
29
25
  ## Usage
30
26
 
31
27
  ```html
32
- <PixInputCode
33
- @ariaLabel="Champ"
34
- @legend="Code correspondant au code de vérification envoyé par email"
35
- @explanationOfUse="Détails d'utilisation du PixInputCode"
36
- @numInputs={{6}}
37
- @inputType="number"
38
- @onAllInputsFilled={{(code) => {}}}
39
- />
28
+ <PixInputCode @ariaLabel="Champ" @legend="Code correspondant au code de vérification envoyé par
29
+ email" @explanationOfUse="Détails d'utilisation du PixInputCode" @numInputs={{6}}
30
+ @inputType="number" @onAllInputsFilled={{(code) => {}}} />
40
31
  ```
41
32
 
42
33
  ## Arguments
43
34
 
44
- <ArgsTable story="Default"/>
35
+ <ArgsTable story="Default" />
@@ -17,7 +17,7 @@ export const Template = (args) => {
17
17
 
18
18
  export const Default = Template.bind({});
19
19
  Default.args = {
20
- id: 'firstName',
20
+ id: 'first-name',
21
21
  ariaLabel: 'Mot de passe',
22
22
  };
23
23
 
@@ -54,43 +54,36 @@ export const argTypes = {
54
54
  name: 'id',
55
55
  description: 'Identifiant du champ permettant de lui attacher un label',
56
56
  type: { name: 'string', required: true },
57
- defaultValue: null,
58
57
  },
59
58
  value: {
60
59
  name: 'value',
61
60
  description: "Valeur de l'input",
62
61
  type: { name: 'string', required: false },
63
- defaultValue: null,
64
62
  },
65
63
  label: {
66
64
  name: 'label',
67
65
  description: "Label de l'input. Requis si ariaLabel n'est pas définit.",
68
66
  type: { name: 'string', required: true },
69
- defaultValue: null,
70
67
  },
71
68
  ariaLabel: {
72
69
  name: 'ariaLabel',
73
70
  description: "L'action du champ, pour l'accessibilité. Requis si label n'est pas définit.",
74
71
  type: { name: 'string', required: true },
75
- defaultValue: null,
76
72
  },
77
73
  information: {
78
74
  name: 'information',
79
75
  description: 'Un descriptif complétant le label',
80
76
  type: { name: 'string', required: false },
81
- defaultValue: null,
82
77
  },
83
78
  errorMessage: {
84
79
  name: 'errorMessage',
85
80
  description: "Affiche le message d'erreur donné et encadre en rouge le champ",
86
81
  type: { name: 'string', required: false },
87
- defaultValue: null,
88
82
  },
89
83
  prefix: {
90
84
  name: 'prefix',
91
85
  description: 'Affiche un préfixe avant la zone de saisie du champ',
92
86
  type: { name: 'string', required: false },
93
- defaultValue: null,
94
87
  },
95
88
  requiredLabel: {
96
89
  name: 'requiredLabel',
@@ -1,12 +1,8 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
 
3
3
  import * as stories from './pix-input-password.stories.js';
4
4
 
5
- <Meta
6
- title='Form/Inputs/Password'
7
- component='PixInputPassword'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Form/Inputs/Password" component="PixInputPassword" argTypes={stories.argTypes} />
10
6
 
11
7
  # Pix Input Password
12
8
 
@@ -21,13 +17,13 @@ Si vous utilisez le `PixInputPassword` sans label alors il faut renseigner le pa
21
17
  > Si vous renseignez les paramètres label et ariaLabel ensemble, ariaLabel sera nullifié.
22
18
 
23
19
  ```html
24
- <PixInputPassword @ariaLabel='{{ariaLabel}}' @id='{{id}}' />
20
+ <PixInputPassword @ariaLabel="{{ariaLabel}}" @id="{{id}}" />
25
21
  ```
26
22
 
27
23
  ## Default
28
24
 
29
25
  <Canvas>
30
- <Story name='Default' story={stories.Default} height={100} />
26
+ <Story name="Default" story={stories.Default} height={100} />
31
27
  </Canvas>
32
28
 
33
29
  ## With label and information
@@ -58,16 +54,16 @@ Si vous utilisez le `PixInputPassword` sans label alors il faut renseigner le pa
58
54
 
59
55
  ```html
60
56
  <PixInputPassword
61
- @id='password'
62
- @label='Mot de passe'
63
- @information='8 caractères dont une majuscule...'
64
- @value='pix123'
65
- @errorMessage='Le mot de passe est erroné'
66
- @prefix='C-'
67
- @requiredLabel='Champ obligatoire'
57
+ @id="password"
58
+ @label="Mot de passe"
59
+ @information="8 caractères dont une majuscule..."
60
+ @value="pix123"
61
+ @errorMessage="Le mot de passe est erroné"
62
+ @prefix="C-"
63
+ @requiredLabel="Champ obligatoire"
68
64
  />
69
65
  ```
70
66
 
71
67
  ## Arguments
72
68
 
73
- <ArgsTable story='Default' />
69
+ <ArgsTable story="Default" />
@@ -17,20 +17,20 @@ export const Template = (args) => {
17
17
 
18
18
  export const Default = Template.bind({});
19
19
  Default.args = {
20
- id: 'firstName',
20
+ id: 'first-name',
21
21
  ariaLabel: 'Prénom',
22
22
  };
23
23
 
24
24
  export const withLabel = Template.bind({});
25
25
  withLabel.args = {
26
- id: 'firstName',
26
+ id: 'first-name',
27
27
  label: 'Prénom',
28
28
  information: 'a small information',
29
29
  };
30
30
 
31
31
  export const withErrorMessage = Template.bind({});
32
32
  withErrorMessage.args = {
33
- id: 'firstName',
33
+ id: 'first-name',
34
34
  label: 'Prénom',
35
35
  information: 'a small information',
36
36
  errorMessage: "un message d'erreur",
@@ -38,7 +38,7 @@ withErrorMessage.args = {
38
38
 
39
39
  export const withRequiredLabel = Template.bind({});
40
40
  withRequiredLabel.args = {
41
- id: 'firstName',
41
+ id: 'first-name',
42
42
  label: 'Prénom',
43
43
  requiredLabel: 'Champ obligatoire',
44
44
  };
@@ -48,37 +48,31 @@ export const argTypes = {
48
48
  name: 'ariaLabel',
49
49
  description: "L'action du champ, pour l'accessibilité. Requis si label n'est pas définit.",
50
50
  type: { name: 'string', required: true },
51
- defaultValue: null,
52
51
  },
53
52
  id: {
54
53
  name: 'id',
55
54
  description: 'Identifiant du champ permettant de lui attacher un label',
56
55
  type: { name: 'string', required: true },
57
- defaultValue: null,
58
56
  },
59
57
  value: {
60
58
  name: 'value',
61
59
  description: "Valeur de l'input",
62
60
  type: { name: 'string', required: false },
63
- defaultValue: null,
64
61
  },
65
62
  label: {
66
63
  name: 'label',
67
64
  description: "Le label de l'input",
68
65
  type: { name: 'string', required: false },
69
- defaultValue: null,
70
66
  },
71
67
  information: {
72
68
  name: 'information',
73
69
  description: 'Un descriptif complétant le label',
74
70
  type: { name: 'string', required: false },
75
- defaultValue: null,
76
71
  },
77
72
  errorMessage: {
78
73
  name: 'errorMessage',
79
74
  description: "Affiche le message d'erreur donné et encadre en rouge le champ",
80
75
  type: { name: 'string', required: false },
81
- defaultValue: null,
82
76
  },
83
77
  requiredLabel: {
84
78
  name: 'requiredLabel',
@@ -1,12 +1,8 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
 
3
3
  import * as stories from './pix-input.stories.js';
4
4
 
5
- <Meta
6
- title='Form/Inputs/Input'
7
- component='PixInput'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Form/Inputs/Input" component="PixInput" argTypes={stories.argTypes} />
10
6
 
11
7
  # Pix Input
12
8
 
@@ -21,35 +17,27 @@ Si vous utilisez le `PixInput` sans label alors il faut renseigner le paramètre
21
17
  Pour acceder à l'élément via son label/aria-label avec testing-library:
22
18
 
23
19
  ```html
24
- <PixInput
25
- @id='firstName'
26
- @label='Prénom'
27
- />
20
+ <PixInput @id="firstName" @label="Prénom" />
28
21
  ```
29
22
 
30
23
  ```javascript
31
- screen.getByLabelText('Prénom')
32
- ````
24
+ screen.getByLabelText('Prénom');
25
+ ```
33
26
 
34
27
  Si le paramètre @information est utilisé, il faudra concatener les valeurs de `@label`/`@ariaLabel` et `@information`
35
28
 
36
29
  ```html
37
- <PixInput
38
- @id='firstName'
39
- @label='Prénom'
40
- @information='exemple: Barry'
41
- />
30
+ <PixInput @id="firstName" @label="Prénom" @information="exemple: Barry" />
42
31
  ```
43
32
 
44
33
  ```javascript
45
- screen.getByLabelText('Prénom exemple: Barry')
46
- ````
47
-
34
+ screen.getByLabelText('Prénom exemple: Barry');
35
+ ```
48
36
 
49
37
  ## Default
50
38
 
51
39
  <Canvas>
52
- <Story name='Default' story={stories.Default} height={100} />
40
+ <Story name="Default" story={stories.Default} height={100} />
53
41
  </Canvas>
54
42
 
55
43
  ## With label and information
@@ -74,11 +62,11 @@ screen.getByLabelText('Prénom exemple: Barry')
74
62
 
75
63
  ```html
76
64
  <PixInput
77
- @id='firstName'
78
- @label='Prénom'
79
- @information='Complément du label'
80
- @errorMessage='Un message d`erreur'
81
- @requiredLabel='Champ obligatoire'
65
+ @id="firstName"
66
+ @label="Prénom"
67
+ @information="Complément du label"
68
+ @errorMessage="Un message d`erreur"
69
+ @requiredLabel="Champ obligatoire"
82
70
  />
83
71
  ```
84
72
 
@@ -43,14 +43,15 @@ export const argTypes = {
43
43
  name: 'type',
44
44
  description: 'Type du message',
45
45
  type: { name: 'string', required: false },
46
- defaultValue: 'info',
47
- control: { type: 'select', options: ['info', 'success', 'warning', 'alert', 'error'] },
46
+ table: { defaultValue: { summary: 'info' } },
47
+ control: { type: 'select' },
48
+ options: ['info', 'success', 'warning', 'alert', 'error'],
48
49
  },
49
50
  withIcon: {
50
51
  name: 'withIcon',
51
52
  description: 'Icône du message',
53
+ table: { defaultValue: { summary: false } },
52
54
  type: { name: 'boolean', required: false },
53
- defaultValue: false,
54
55
  control: { type: 'boolean' },
55
56
  },
56
57
  };
@@ -1,11 +1,7 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-message.stories.js';
3
3
 
4
- <Meta
5
- title='Notification/Message'
6
- component='PixMessage'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Notification/Message" component="PixMessage" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Message
11
7
 
@@ -58,10 +54,9 @@ Le bandeau en cas de d'erreur.
58
54
  ## Usage
59
55
 
60
56
  Par défaut
57
+
61
58
  ```html
62
- <PixMessage>
63
- Ceci est un message à caractère informatif.
64
- </PixMessage>
59
+ <PixMessage> Ceci est un message à caractère informatif. </PixMessage>
65
60
  ```
66
61
 
67
62
  ## Arguments
@@ -43,13 +43,11 @@ export const argTypes = {
43
43
  name: 'title',
44
44
  description: 'Titre de la modale',
45
45
  type: { name: 'string', required: true },
46
- defaultValue: null,
47
46
  },
48
47
  onCloseButtonClick: {
49
48
  name: 'onCloseButtonClick',
50
49
  description: 'Fonction à exécuter à la fermeture de la modale',
51
50
  type: { name: 'function', required: true },
52
- defaultValue: null,
53
51
  },
54
52
  showModal: {
55
53
  name: 'showModal',
@@ -1,12 +1,8 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
 
3
3
  import * as stories from './pix-modal.stories.js';
4
4
 
5
- <Meta
6
- title="Basics/Modal"
7
- component="PixModal"
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Basics/Modal" component="PixModal" argTypes={stories.argTypes} />
10
6
 
11
7
  # PixModal
12
8
 
@@ -1,58 +1,61 @@
1
- import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
1
+ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
2
2
  import * as stories from './pix-multi-select.stories.js';
3
3
 
4
- <Meta
5
- title='Form/Multi Select'
6
- component='Multi Select'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Form/Multi Select" component="Multi Select" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Multi Select
11
7
 
12
8
  Un select custom permettant une gestion de la multiselection. Permet de passer soit du texte brut soit des composants à sa liste. (PixStars etc...)
13
- L'ajout de ``class`` et d'autres attributs comme ``aria-label`` sont possibles.
9
+ L'ajout de `class` et d'autres attributs comme `aria-label` sont possibles.
14
10
 
15
11
  > ⚠️ 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.
16
12
 
17
13
  ## With child component
14
+
18
15
  <Canvas>
19
16
  <Story name="With child component" story={stories.multiSelectWithChildComponent} height={310} />
20
17
  </Canvas>
21
18
 
22
19
  ## Searchable
20
+
23
21
  <Canvas>
24
- <Story name="Searchable" story={stories.multiSelectSearchable} height={330}/>
22
+ <Story name="Searchable" story={stories.multiSelectSearchable} height={330} />
25
23
  </Canvas>
26
24
 
27
25
  ## withCustomClass
26
+
28
27
  <Canvas>
29
- <Story name="withCustomClass" story={stories.multiSelectWithCustomClass} height={330}/>
28
+ <Story name="withCustomClass" story={stories.multiSelectWithCustomClass} height={330} />
30
29
  </Canvas>
31
30
 
32
31
  ## withId
32
+
33
33
  <Canvas>
34
- <Story name="withId" story={stories.multiSelectWithId} height={330}/>
34
+ <Story name="withId" story={stories.multiSelectWithId} height={330} />
35
35
  </Canvas>
36
36
 
37
37
  ## withYield
38
+
38
39
  <Canvas>
39
- <Story name="withYield" story={stories.multiSelectWithYield} height={330}/>
40
+ <Story name="withYield" story={stories.multiSelectWithYield} height={330} />
40
41
  </Canvas>
41
42
 
42
43
  ## Usage
43
44
 
44
45
  ```html
45
46
  <PixMultiSelect
46
- @id={{id}}
47
- @label={{label}}
48
- @screenReaderOnly={{screenReaderOnly}}
49
- @placeholder={{placeholder}}
50
-
51
- @onChange={{doSomething}}
52
- @values={{values}}
53
- @emptyMessage={{emptyMessage}}
54
- @className={{className}}
55
- @options={{options}} as |option|>
47
+ @id="{{id}}"
48
+ @label="{{label}}"
49
+ @screenReaderOnly="{{screenReaderOnly}}"
50
+ @placeholder="{{placeholder}}"
51
+ @onChange="{{doSomething}}"
52
+ @values="{{values}}"
53
+ @emptyMessage="{{emptyMessage}}"
54
+ @className="{{className}}"
55
+ @options="{{options}}"
56
+ as
57
+ |option|
58
+ >
56
59
  {{option.label}}
57
60
  </PixMultiSelect>
58
61
  ```