@1024pix/pix-ui 24.2.0 → 24.2.2

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 (76) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/addon/components/pix-tooltip.hbs +2 -2
  3. package/app/stories/form.stories.mdx +2 -4
  4. package/app/stories/pix-background-header.stories.mdx +3 -8
  5. package/app/stories/pix-banner.stories.js +9 -11
  6. package/app/stories/pix-banner.stories.mdx +9 -32
  7. package/app/stories/pix-block.stories.js +3 -2
  8. package/app/stories/pix-block.stories.mdx +1 -1
  9. package/app/stories/pix-button-link.stories.js +0 -2
  10. package/app/stories/pix-button-link.stories.mdx +7 -15
  11. package/app/stories/pix-button-upload.stories.js +2 -3
  12. package/app/stories/pix-button-upload.stories.mdx +4 -12
  13. package/app/stories/pix-button.stories.mdx +7 -9
  14. package/app/stories/pix-checkbox.stories.js +8 -10
  15. package/app/stories/pix-checkbox.stories.mdx +12 -13
  16. package/app/stories/pix-collapsible.stories.js +7 -3
  17. package/app/stories/pix-collapsible.stories.mdx +6 -12
  18. package/app/stories/pix-dropdown.stories.mdx +10 -14
  19. package/app/stories/pix-filter-banner.stories.js +1 -4
  20. package/app/stories/pix-filter-banner.stories.mdx +5 -9
  21. package/app/stories/pix-filterable-and-searchable-select.stories.js +0 -2
  22. package/app/stories/pix-filterable-and-searchable-select.stories.mdx +25 -25
  23. package/app/stories/pix-icon-button.stories.js +7 -5
  24. package/app/stories/pix-icon-button.stories.mdx +2 -6
  25. package/app/stories/pix-indicator-card.stories.js +2 -2
  26. package/app/stories/pix-indicator-card.stories.mdx +2 -1
  27. package/app/stories/pix-input-code.stories.mdx +7 -16
  28. package/app/stories/pix-input-password.stories.js +1 -8
  29. package/app/stories/pix-input-password.stories.mdx +12 -16
  30. package/app/stories/pix-input.stories.js +4 -10
  31. package/app/stories/pix-input.stories.mdx +14 -26
  32. package/app/stories/pix-message.stories.js +4 -3
  33. package/app/stories/pix-message.stories.mdx +4 -9
  34. package/app/stories/pix-modal.stories.js +0 -2
  35. package/app/stories/pix-modal.stories.mdx +2 -6
  36. package/app/stories/pix-multi-select.stories.mdx +24 -21
  37. package/app/stories/pix-pagination.stories.js +2 -1
  38. package/app/stories/pix-pagination.stories.mdx +19 -18
  39. package/app/stories/pix-progress-gauge.stories.js +2 -1
  40. package/app/stories/pix-progress-gauge.stories.mdx +6 -9
  41. package/app/stories/pix-radio-button.stories.js +0 -3
  42. package/app/stories/pix-radio-button.stories.mdx +7 -16
  43. package/app/stories/pix-return-to.stories.js +3 -3
  44. package/app/stories/pix-return-to.stories.mdx +4 -10
  45. package/app/stories/pix-search-input.stories.mdx +14 -22
  46. package/app/stories/pix-select.stories.mdx +26 -31
  47. package/app/stories/pix-selectable-tag.stories.mdx +10 -20
  48. package/app/stories/pix-sidebar.stories.js +0 -5
  49. package/app/stories/pix-sidebar.stories.mdx +2 -6
  50. package/app/stories/pix-stars.stories.js +12 -6
  51. package/app/stories/pix-stars.stories.mdx +3 -12
  52. package/app/stories/pix-tag.stories.js +21 -25
  53. package/app/stories/pix-tag.stories.mdx +5 -15
  54. package/app/stories/pix-textarea.stories.js +7 -12
  55. package/app/stories/pix-textarea.stories.mdx +8 -11
  56. package/app/stories/pix-toggle.stories.mdx +7 -11
  57. package/app/stories/pix-tooltip.stories.js +11 -14
  58. package/app/stories/pix-tooltip.stories.mdx +2 -7
  59. package/docs/architecture.stories.mdx +3 -3
  60. package/docs/breaking-changes.stories.mdx +16 -14
  61. package/docs/changelog.stories.mdx +1 -1
  62. package/docs/create-component.stories.mdx +31 -29
  63. package/docs/design-system.stories.mdx +2 -2
  64. package/docs/design-tokens.stories.mdx +6 -2
  65. package/docs/good-practices-a11y.stories.mdx +4 -9
  66. package/docs/good-practices-design.stories.mdx +11 -20
  67. package/docs/good-practices-responsive.stories.mdx +3 -3
  68. package/docs/good-practices-style-css.stories.mdx +10 -10
  69. package/docs/good-practices-tests.stories.mdx +2 -2
  70. package/docs/make-a-release.stories.mdx +16 -13
  71. package/docs/pix-design-tokens-dev.stories.mdx +1 -1
  72. package/docs/storybook.stories.mdx +4 -3
  73. package/docs/test-component-without-release.stories.mdx +1 -1
  74. package/docs/use-component.stories.mdx +7 -6
  75. package/docs/use-install.stories.mdx +6 -6
  76. package/package.json +1 -1
@@ -124,7 +124,8 @@ export const argTypes = {
124
124
  name: 'locale',
125
125
  description: "La langue de l'utilisateur",
126
126
  type: { name: 'string', required: false },
127
- control: { type: 'select', options: ['fr', 'en'] },
127
+ control: { type: 'select' },
128
+ options: ['fr', 'en'],
128
129
  table: {
129
130
  type: { summary: 'string' },
130
131
  defaultValue: { summary: 'fr' },
@@ -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-pagination.stories.js';
4
4
 
5
- <Meta
6
- title='Basics/Pagination'
7
- component='PixPagination'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Basics/Pagination" component="PixPagination" argTypes={stories.argTypes} />
10
6
 
11
7
  # PixPagination
12
8
 
@@ -15,47 +11,52 @@ PixPagination est un élément permettant de trigger le changement de page dans
15
11
  > ** ⚠️ Pour utiliser ce composant, il est recommandé d'ajouter cette config dans les routes où tu l'utiliseras.**
16
12
  >
17
13
  > ** Cela permettra de reload le `model` si les queryParams `pageNumber` & `pageSize` ont été modifiés.**
14
+ >
18
15
  > ```javascript
19
- > queryParams = { pageNumber: { refreshModel: true }, pageSize: { refreshModel: true }, };
20
- >```
16
+ > queryParams = { pageNumber: { refreshModel: true }, pageSize: { refreshModel: true } };
17
+ > ```
21
18
  >
22
- >** Installer la dépendance `@formatjs/intl` sur votre projet.**
19
+ > ** Installer la dépendance `@formatjs/intl` sur votre projet.**
23
20
 
24
21
  Le paramètre `pageOptions` n'est pas requis et possède une valeur par défaut.
25
22
 
26
23
  ** ⚠ Si vous voulez utiliser des options différentes, il ne faut pas oublier que l'API fait le premier call avec un pageSize
27
- à 10 par défaut.**
24
+ à 10 par défaut.**
28
25
 
29
26
  Sur mobile, le select qui permet de choisir le nombre d'élément à afficher sur la page est retiré.
30
27
 
31
28
  ## En français avec paramètres par défaut
29
+
32
30
  <Canvas>
33
- <Story name='French' story={stories.French} height={110}/>
31
+ <Story name="French" story={stories.French} height={110} />
34
32
  </Canvas>
35
33
 
36
34
  ## En anglais avec le paramètre `pageOptions` custom
35
+
37
36
  <Canvas>
38
- <Story name='English' story={stories.English} height={110} />
37
+ <Story name="English" story={stories.English} height={110} />
39
38
  </Canvas>
40
39
 
41
40
  ## Avec une seule page
41
+
42
42
  <Canvas>
43
- <Story name='OnePage' story={stories.OnePage} height={110} />
43
+ <Story name="OnePage" story={stories.OnePage} height={110} />
44
44
  </Canvas>
45
45
 
46
46
  ## Version condensée
47
+
47
48
  <Canvas>
48
- <Story name='Condensed' story={stories.Condensed} height={140} />
49
+ <Story name="Condensed" story={stories.Condensed} height={140} />
49
50
  </Canvas>
50
51
 
51
52
  ## Usage
52
53
 
53
54
  ```html
54
55
  <PixPagination
55
- @pagination={{pagination}}
56
- @locale = {{locale}}
57
- @pageOptions = {{pageOptions}}
58
- @isCondensed = {{isCondensed}}
56
+ @pagination="{{pagination}}"
57
+ @locale="{{locale}}"
58
+ @pageOptions="{{pageOptions}}"
59
+ @isCondensed="{{isCondensed}}"
59
60
  />
60
61
  ```
61
62
 
@@ -51,7 +51,8 @@ export const argTypes = {
51
51
  'Modifie la couleur de la barre de progression. Peut prendre les valeurs `yellow` ou `white`',
52
52
  type: { name: 'string', required: false },
53
53
  table: { defaultValue: { summary: 'yellow' } },
54
- control: { type: 'select', options: ['yellow', 'white'] },
54
+ control: { type: 'select' },
55
+ options: ['yellow', 'white'],
55
56
  },
56
57
  isArrowLeft: {
57
58
  name: 'isArrowLeft',
@@ -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-progress-gauge.stories.js';
3
3
 
4
- <Meta
5
- title='Others/Progress Gauge'
6
- component='PixProgressGauge'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Others/Progress Gauge" component="PixProgressGauge" argTypes={stories.argTypes} />
9
5
 
10
6
  # Progress Gauge
11
7
 
@@ -14,7 +10,7 @@ import * as stories from './pix-progress-gauge.stories.js';
14
10
  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
15
11
 
16
12
  <Canvas>
17
- <Story name='Default' story={stories.Default} height={60} />
13
+ <Story name="Default" story={stories.Default} height={60} />
18
14
  </Canvas>
19
15
 
20
16
  ## White
@@ -22,7 +18,7 @@ Permet d'afficher un barre de progression sur un barème de 100%. Des paramètre
22
18
  Démonstration d'une barre de progression blanche avec l'info bulle à gauche avec un sous titre
23
19
 
24
20
  <Canvas>
25
- <Story name='White' story={stories.whiteProgressGauge} height={100} />
21
+ <Story name="White" story={stories.whiteProgressGauge} height={100} />
26
22
  </Canvas>
27
23
 
28
24
  ## Usage
@@ -33,7 +29,8 @@ Démonstration d'une barre de progression blanche avec l'info bulle à gauche av
33
29
  @color="white"
34
30
  @tooltipText="50%"
35
31
  @isArrowLeft="true"
36
- @subTitle="Un sous titre" />
32
+ @subTitle="Un sous titre"
33
+ />
37
34
  ```
38
35
 
39
36
  ## Arguments
@@ -39,19 +39,16 @@ export const argTypes = {
39
39
  name: 'label',
40
40
  description: 'Le label du bouton radio',
41
41
  type: { name: 'string', required: true },
42
- defaultValue: null,
43
42
  },
44
43
  value: {
45
44
  name: 'value',
46
45
  description: "Valeur permettant d'identifier l'option sélectionnée",
47
46
  type: { name: 'string', required: false },
48
- defaultValue: null,
49
47
  },
50
48
  isDisabled: {
51
49
  name: 'isDisabled',
52
50
  description: 'Pour désactiver/activer le bouton radio',
53
51
  type: { name: 'boolean', required: false },
54
- defaultValue: false,
55
52
  table: {
56
53
  defaultValue: { summary: 'false' },
57
54
  },
@@ -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-radio-button.stories.js';
4
4
 
5
- <Meta
6
- title='Form/Radio Button'
7
- component='PixRadioButton'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Form/Radio Button" component="PixRadioButton" argTypes={stories.argTypes} />
10
6
 
11
7
  # Pix Radio Button
12
8
 
@@ -18,8 +14,8 @@ Il est préférable de ne pas sélectionner d’option par défaut pour que le c
18
14
  ## Default
19
15
 
20
16
  <Canvas isColumn>
21
- <Story name= "Default" story={stories.Default} height={60} />
22
- <Story name='Default checked' story={stories.defaultChecked} height={60} />
17
+ <Story name="Default" story={stories.Default} height={60} />
18
+ <Story name="Default checked" story={stories.defaultChecked} height={60} />
23
19
  </Canvas>
24
20
 
25
21
  ## IsDisabled
@@ -27,19 +23,14 @@ Il est préférable de ne pas sélectionner d’option par défaut pour que le c
27
23
  État inactif du bouton radio.
28
24
 
29
25
  <Canvas isColumn>
30
- <Story name='Disabled' story={stories.isDisabled} height={60} />
31
- <Story name='Disabled checked' story={stories.disabledChecked} height={60} />
26
+ <Story name="Disabled" story={stories.isDisabled} height={60} />
27
+ <Story name="Disabled checked" story={stories.disabledChecked} height={60} />
32
28
  </Canvas>
33
29
 
34
30
  ## Usage
35
31
 
36
32
  ```html
37
-
38
- <PixRadioButton
39
- @label={{label}}
40
- @value={{value}}
41
- @isDisabled={{isDisabled}}
42
- />
33
+ <PixRadioButton @label="{{label}}" @value="{{value}}" @isDisabled="{{isDisabled}}" />
43
34
  ```
44
35
 
45
36
  ## Arguments
@@ -24,7 +24,6 @@ export const argTypes = {
24
24
  name: 'route',
25
25
  description: 'Route de redirection',
26
26
  type: { name: 'string', required: true },
27
- defaultValue: null,
28
27
  },
29
28
  model: {
30
29
  name: 'model',
@@ -35,7 +34,8 @@ export const argTypes = {
35
34
  name: 'shade',
36
35
  description: 'Couleur du lien',
37
36
  type: { name: 'string', required: false },
38
- defaultValue: 'black',
39
- control: { type: 'select', options: ['white', 'black', 'blue'] },
37
+ table: { defaultValue: { summary: 'black' } },
38
+ control: { type: 'select' },
39
+ options: ['white', 'black', 'blue'],
40
40
  },
41
41
  };
@@ -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-return-to.stories.js';
3
3
 
4
- <Meta
5
- title='Basics/Return To'
6
- component='PixReturnTo'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Basics/Return To" component="PixReturnTo" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Return To
11
7
 
@@ -26,12 +22,10 @@ Le `ReturnTo` est un lien de retour vers uneOpixRe page précédente.
26
22
 
27
23
  ```html
28
24
  Liens avec texte
29
- <PixReturnTo @route='profile'>
30
- Un lien de retour
31
- </PixReturnTo>
25
+ <PixReturnTo @route="profile"> Un lien de retour </PixReturnTo>
32
26
 
33
27
  Liens sans texte
34
- <PixReturnTo @route='profile' />
28
+ <PixReturnTo @route="profile" />
35
29
  ```
36
30
 
37
31
  ## Arguments
@@ -1,51 +1,43 @@
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-search-input.stories.js';
4
4
 
5
- <Meta
6
- title='Others/SearchInput'
7
- component='PixSearchInput'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Others/SearchInput" component="PixSearchInput" argTypes={stories.argTypes} />
10
6
 
11
7
  # PixSearchInput
12
8
 
13
9
  Le PixSearchInput est un champ qui permet de filter des résultats. Un cas d'utilisation courant de ce genre de composant est un champ de filtre d'une colonne d'un tableau.
14
10
 
15
-
16
11
  A la différence d'un [PixSelect](?path=/docs/form-select--default#withsearch) searchable, la liste des résultats s'affiche en dehors du composant.
17
12
 
18
-
19
13
  Ce composant permet d'appeler la fonction triggerFiltering passée en paramètre selon un debounce (temps d'attente avant le prochain appel) fournis.
20
14
 
15
+ ⚠️ ⚠️ ⚠️ Pour utiliser ce composant des changements sont nécessaires dans l'application où est installé Pix UI :
21
16
 
17
+ 1- Rajoutez ceci dans le `ember-cli-build.js` de votre application (mon-pix/pix-orga/pix-certif/pix-admin) :
22
18
 
23
- ⚠️ ⚠️ ⚠️ Pour utiliser ce composant des changements sont nécessaires dans l'application où est installé Pix UI :
24
-
25
- 1- Rajoutez ceci dans le `ember-cli-build.js` de votre application (mon-pix/pix-orga/pix-certif/pix-admin) :
26
19
  ```js
27
- app.import('node_modules/lodash.debounce/index.js', {
28
- using: [{ transformation: 'cjs', as: 'lodash.debounce' }],
29
- });
20
+ app.import('node_modules/lodash.debounce/index.js', {
21
+ using: [{ transformation: 'cjs', as: 'lodash.debounce' }],
22
+ });
30
23
  ```
31
24
 
32
25
  2- Installez la dépendance "ember-cli-cjs-transform" : `npm install ember-cli-cjs-transform`
33
26
 
34
-
35
27
  <Canvas>
36
- <Story name='Default' story={stories.Default} height={80} />
28
+ <Story name="Default" story={stories.Default} height={80} />
37
29
  </Canvas>
38
30
 
39
31
  ## Usage
40
32
 
41
33
  ```html
42
34
  <PixSearchInput
43
- @id={{this.id}}
44
- @label={{this.label}}
45
- @ariaLabel={{this.ariaLabel}}
46
- @placeholder={{this.placeholder}}
47
- @debounceTimeInMs={{this.debounceTimeInMs}}
48
- @triggerFiltering={{this.triggerFiltering}}
35
+ @id="{{this.id}}"
36
+ @label="{{this.label}}"
37
+ @ariaLabel="{{this.ariaLabel}}"
38
+ @placeholder="{{this.placeholder}}"
39
+ @debounceTimeInMs="{{this.debounceTimeInMs}}"
40
+ @triggerFiltering="{{this.triggerFiltering}}"
49
41
  />
50
42
  ```
51
43
 
@@ -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-select.stories.js';
3
3
 
4
- <Meta
5
- title='Form/Select'
6
- component='PixSelect'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Form/Select" component="PixSelect" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Select
11
7
 
@@ -13,9 +9,9 @@ Affiche un menu déroulant avec la liste des options fournies.
13
9
 
14
10
  Les options sont représentées par un tableau d'objet contenant les propriétés value et label.
15
11
 
16
- > **⚠️** __Il est nécessaire d'avoir au moins un label ou un placeholder !__
12
+ > **⚠️** **Il est nécessaire d'avoir au moins un label ou un placeholder !**
17
13
 
18
- > **⚠️** __N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !__
14
+ > **⚠️** **N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !**
19
15
 
20
16
  > Pour aider l'utilisateur, rajoutez un placeholder cohérent !
21
17
 
@@ -24,59 +20,58 @@ Les options sont représentées par un tableau d'objet contenant les propriété
24
20
  ## Default
25
21
 
26
22
  <Canvas>
27
- <Story name='Default' story={stories.Default} height={200} />
23
+ <Story name="Default" story={stories.Default} height={200} />
28
24
  </Canvas>
29
25
 
30
26
  ## WithId
31
27
 
32
28
  <Canvas>
33
- <Story name='WithId' story={stories.WithId} height={200} />
29
+ <Story name="WithId" story={stories.WithId} height={200} />
34
30
  </Canvas>
35
31
 
36
32
  ## WithCustomClass
37
33
 
38
34
  <Canvas>
39
- <Story name='WithCustomClass' story={stories.WithCustomClass} height={200} />
35
+ <Story name="WithCustomClass" story={stories.WithCustomClass} height={200} />
40
36
  </Canvas>
41
37
 
42
38
  ## WithCategories
43
39
 
44
40
  <Canvas>
45
- <Story name='Select with categories' story={stories.WithCategories} height={200} />
41
+ <Story name="Select with categories" story={stories.WithCategories} height={200} />
46
42
  </Canvas>
47
43
 
48
44
  ## WithSearch
49
45
 
50
46
  <Canvas>
51
- <Story name='Select with search' story={stories.WithSearch} height={200} />
47
+ <Story name="Select with search" story={stories.WithSearch} height={200} />
52
48
  </Canvas>
53
49
 
54
-
55
50
  ## WithCategoriesAndSearch
56
51
 
57
52
  <Canvas>
58
- <Story name='WithCategoriesAndSearch' story={stories.WithCategoriesAndSearch} height={200} />
53
+ <Story name="WithCategoriesAndSearch" story={stories.WithCategoriesAndSearch} height={200} />
59
54
  </Canvas>
60
55
 
61
56
  ## Usage
62
57
 
63
58
  ```html
64
- <PixSelect
65
- @className={{className}}
66
- @label={{label}}
67
- @subLabel={{subLabel}}
68
- @placeholder={{placeholder}}
69
- @options={{options}}
70
- @onChange={{onChange}}
71
- @value={{value}}
72
- @isSearchable={{isSearchable}}
73
- @searchLabel={{searchLabel}}
74
- @searchPlaceholder={{searchPlaceholder}}
75
- @emptySearchMessage={{emptySearchMessage}}
76
- @screenReaderOnly={{screenReaderOnly}}
77
- @requiredText={{requiredText}}
78
- @errorMessage={{errorMessage}}
79
- />
59
+ <PixSelect
60
+ @className="{{className}}"
61
+ @label="{{label}}"
62
+ @subLabel="{{subLabel}}"
63
+ @placeholder="{{placeholder}}"
64
+ @options="{{options}}"
65
+ @onChange="{{onChange}}"
66
+ @value="{{value}}"
67
+ @isSearchable="{{isSearchable}}"
68
+ @searchLabel="{{searchLabel}}"
69
+ @searchPlaceholder="{{searchPlaceholder}}"
70
+ @emptySearchMessage="{{emptySearchMessage}}"
71
+ @screenReaderOnly="{{screenReaderOnly}}"
72
+ @requiredText="{{requiredText}}"
73
+ @errorMessage="{{errorMessage}}"
74
+ />
80
75
  ```
81
76
 
82
77
  ## Arguments
@@ -1,50 +1,40 @@
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-selectable-tag.stories.js';
4
4
 
5
- <Meta
6
- title='basics/Tag/Selectable Tag'
7
- component='PixSelectableTag'
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="basics/Tag/Selectable Tag" component="PixSelectableTag" argTypes={stories.argTypes} />
10
6
 
11
7
  # Pix Selectable Tag
12
8
 
13
9
  Un tag permettant de sélectionner ou non la valeur.
14
10
 
15
- ## Default
11
+ ## Default
16
12
 
17
13
  <Canvas>
18
- <Story name='Selectable Tag default' story={stories.selectableTagDefault} height={60} />
14
+ <Story name="Selectable Tag default" story={stories.selectableTagDefault} height={60} />
19
15
  </Canvas>
20
16
 
21
- ## Selected
17
+ ## Selected
22
18
 
23
19
  <Canvas>
24
- <Story name='Selectable Tag checked' story={stories.selectableTagSelected} height={60} />
20
+ <Story name="Selectable Tag checked" story={stories.selectableTagSelected} height={60} />
25
21
  </Canvas>
26
22
 
27
23
  ## Multiple tags
24
+
28
25
  <Canvas>
29
- <Story name='Selectable Tag multiple' story={stories.selectableTagMultiple} height={60} />
26
+ <Story name="Selectable Tag multiple" story={stories.selectableTagMultiple} height={60} />
30
27
  </Canvas>
31
28
 
32
29
  ## Usage
33
30
 
34
31
  ```html
35
32
  Par défaut :
36
- <PixSelectableTag>
37
- @label={{label}}
38
- @id={{id}}
39
- @onChange={{onChange}}
40
- </PixSelectableTag>
33
+ <PixSelectableTag> @label={{label}} @id={{id}} @onChange={{onChange}} </PixSelectableTag>
41
34
 
42
35
  Tag Sélectionné :
43
36
  <PixSelectableTag>
44
- @label={{label}}
45
- @id={{id}}
46
- @onChange={{onChange}}
47
- @checked={{true}}
37
+ @label={{label}} @id={{id}} @onChange={{onChange}} @checked={{true}}
48
38
  </PixSelectableTag>
49
39
  ```
50
40
 
@@ -44,7 +44,6 @@ export const argTypes = {
44
44
  name: 'showSidebar',
45
45
  description: 'Visibilité de la sidebar',
46
46
  type: { name: 'boolean', required: false },
47
- control: { type: 'boolean' },
48
47
  table: {
49
48
  type: { summary: 'boolean' },
50
49
  defaultValue: { summary: false },
@@ -54,10 +53,6 @@ export const argTypes = {
54
53
  name: 'title',
55
54
  description: 'Titre de la sidebar',
56
55
  type: { name: 'string', required: true },
57
- table: {
58
- type: { summary: 'string' },
59
- defaultValue: { summary: '' },
60
- },
61
56
  },
62
57
  onClose: {
63
58
  name: 'onClose',
@@ -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-sidebar.stories.js';
4
4
 
5
- <Meta
6
- title="Basics/Sidebar"
7
- component="PixSidebar"
8
- argTypes={stories.argTypes}
9
- />
5
+ <Meta title="Basics/Sidebar" component="PixSidebar" argTypes={stories.argTypes} />
10
6
 
11
7
  # PixSidebar
12
8
 
@@ -1,36 +1,42 @@
1
1
  import { hbs } from 'ember-cli-htmlbars';
2
2
 
3
- export const stars = (args) => {
3
+ const Template = (args) => {
4
4
  return {
5
5
  template: hbs`<PixStars @count={{this.count}} @total={{this.total}} @alt={{this.alt}} @color={{this.color}} />`,
6
6
  context: args,
7
7
  };
8
8
  };
9
9
 
10
+ export const stars = Template.bind({});
11
+ stars.args = {
12
+ count: 2,
13
+ total: 5,
14
+ alt: 'message alternatif',
15
+ color: 'blue',
16
+ };
17
+
10
18
  export const argTypes = {
11
19
  count: {
12
20
  name: 'count',
13
21
  description: 'Nombre total d’étoiles actives',
14
22
  type: { name: 'number', required: false },
15
- defaultValue: 2,
16
23
  },
17
24
  total: {
18
25
  name: 'total',
19
26
  description: 'Nombre total d’étoiles',
20
27
  type: { name: 'number', required: false },
21
- defaultValue: 5,
22
28
  },
23
29
  alt: {
24
30
  name: 'alt',
25
31
  description: 'Message alternatif pour les étoiles',
26
32
  type: { name: 'string', required: true },
27
- defaultValue: 'Message',
28
33
  },
29
34
  color: {
30
35
  name: 'color',
31
36
  description: 'Couleur des étoiles',
32
37
  type: { name: 'string', required: false },
33
- defaultValue: 'yellow',
34
- control: { type: 'select', options: ['yellow', 'blue', 'grey'] },
38
+ table: { defaultValue: { summary: 'yellow' } },
39
+ control: { type: 'select' },
40
+ options: ['yellow', 'blue', 'grey'],
35
41
  },
36
42
  };
@@ -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-stars.stories.js';
3
3
 
4
- <Meta
5
- title='Others/PixStars'
6
- component='PixStars'
7
- argTypes={stories.argTypes}
8
- />
4
+ <Meta title="Others/PixStars" component="PixStars" argTypes={stories.argTypes} />
9
5
 
10
6
  # Pix Stars
11
7
 
@@ -20,12 +16,7 @@ Pour ne pas afficher les étoiles vides, il suffit de ne pas donner le total d'
20
16
  ## Usage
21
17
 
22
18
  ```html
23
- <PixStars
24
- @count={{2}}
25
- @total={{5}}
26
- @alt="message alternatif"
27
- @color="blue"
28
- />
19
+ <PixStars @count="{{2}}" @total="{{5}}" @alt="message alternatif" @color="blue" />
29
20
  ```
30
21
 
31
22
  ## Arguments