@1024pix/pix-ui 46.13.1 → 46.13.3

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/package.json +6 -6
  2. package/app/stories/form.mdx +0 -11
  3. package/app/stories/form.stories.js +0 -142
  4. package/app/stories/pix-background-header.mdx +0 -29
  5. package/app/stories/pix-background-header.stories.js +0 -33
  6. package/app/stories/pix-banner.mdx +0 -86
  7. package/app/stories/pix-banner.stories.js +0 -112
  8. package/app/stories/pix-block.mdx +0 -32
  9. package/app/stories/pix-block.stories.js +0 -22
  10. package/app/stories/pix-button-link.mdx +0 -39
  11. package/app/stories/pix-button-link.stories.js +0 -114
  12. package/app/stories/pix-button-upload.mdx +0 -26
  13. package/app/stories/pix-button-upload.stories.js +0 -81
  14. package/app/stories/pix-button.mdx +0 -79
  15. package/app/stories/pix-button.stories.js +0 -270
  16. package/app/stories/pix-checkbox-variant-tile.mdx +0 -49
  17. package/app/stories/pix-checkbox-variant-tile.stories.js +0 -102
  18. package/app/stories/pix-checkbox.mdx +0 -75
  19. package/app/stories/pix-checkbox.stories.js +0 -220
  20. package/app/stories/pix-collapsible.mdx +0 -37
  21. package/app/stories/pix-collapsible.stories.js +0 -104
  22. package/app/stories/pix-filter-banner.mdx +0 -26
  23. package/app/stories/pix-filter-banner.stories.js +0 -87
  24. package/app/stories/pix-filterable-and-searchable-select.mdx +0 -62
  25. package/app/stories/pix-filterable-and-searchable-select.stories.js +0 -202
  26. package/app/stories/pix-icon-button.mdx +0 -84
  27. package/app/stories/pix-icon-button.stories.js +0 -108
  28. package/app/stories/pix-icon.mdx +0 -20
  29. package/app/stories/pix-icon.stories.js +0 -51
  30. package/app/stories/pix-indicator-card.mdx +0 -41
  31. package/app/stories/pix-indicator-card.stories.js +0 -78
  32. package/app/stories/pix-input-code.mdx +0 -33
  33. package/app/stories/pix-input-code.stories.js +0 -75
  34. package/app/stories/pix-input-password.mdx +0 -76
  35. package/app/stories/pix-input-password.stories.js +0 -145
  36. package/app/stories/pix-input.mdx +0 -104
  37. package/app/stories/pix-input.stories.js +0 -175
  38. package/app/stories/pix-label.mdx +0 -47
  39. package/app/stories/pix-label.stories.js +0 -112
  40. package/app/stories/pix-message.mdx +0 -54
  41. package/app/stories/pix-message.stories.js +0 -61
  42. package/app/stories/pix-modal.mdx +0 -53
  43. package/app/stories/pix-modal.stories.js +0 -73
  44. package/app/stories/pix-multi-select.mdx +0 -55
  45. package/app/stories/pix-multi-select.stories.js +0 -290
  46. package/app/stories/pix-pagination.mdx +0 -56
  47. package/app/stories/pix-pagination.stories.js +0 -148
  48. package/app/stories/pix-progress-gauge.mdx +0 -40
  49. package/app/stories/pix-progress-gauge.stories.js +0 -117
  50. package/app/stories/pix-radio-button-variant-tile.mdx +0 -46
  51. package/app/stories/pix-radio-button-variant-tile.stories.js +0 -92
  52. package/app/stories/pix-radio-button.mdx +0 -59
  53. package/app/stories/pix-radio-button.stories.js +0 -165
  54. package/app/stories/pix-return-to.mdx +0 -34
  55. package/app/stories/pix-return-to.stories.js +0 -41
  56. package/app/stories/pix-search-input.mdx +0 -41
  57. package/app/stories/pix-search-input.stories.js +0 -117
  58. package/app/stories/pix-select.mdx +0 -80
  59. package/app/stories/pix-select.stories.js +0 -445
  60. package/app/stories/pix-selectable-tag.mdx +0 -37
  61. package/app/stories/pix-selectable-tag.stories.js +0 -69
  62. package/app/stories/pix-sidebar.mdx +0 -49
  63. package/app/stories/pix-sidebar.stories.js +0 -74
  64. package/app/stories/pix-stars.mdx +0 -22
  65. package/app/stories/pix-stars.stories.js +0 -45
  66. package/app/stories/pix-tag.mdx +0 -26
  67. package/app/stories/pix-tag.stories.js +0 -25
  68. package/app/stories/pix-textarea.mdx +0 -50
  69. package/app/stories/pix-textarea.stories.js +0 -146
  70. package/app/stories/pix-toggle.mdx +0 -28
  71. package/app/stories/pix-toggle.stories.js +0 -134
  72. package/app/stories/pix-tooltip.mdx +0 -183
  73. package/app/stories/pix-tooltip.stories.js +0 -215
  74. package/app/styles/app.scss +0 -0
  75. package/scripts/migrate-colors-scss-vars-to-css-vars.sh +0 -120
  76. package/scripts/migrate-spacing-scss-vars-to-css-vars.sh +0 -23
@@ -1,81 +0,0 @@
1
- import { hbs } from 'ember-cli-htmlbars';
2
- import { action } from '@storybook/addon-actions';
3
-
4
- export default {
5
- title: 'Basics/ButtonUpload',
6
- argTypes: {
7
- id: {
8
- name: 'id',
9
- description: "identifiant du bouton d'upload",
10
- type: { name: 'string', required: true },
11
- },
12
- onChange: {
13
- name: 'onChange',
14
- description:
15
- "fonction à exécuter au moment de l'upload du fichier, elle prend en entrée la liste des fichiers uploadés.",
16
- type: { name: 'function', required: true },
17
- },
18
- variant: {
19
- name: 'variant',
20
- description:
21
- 'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
22
- options: [
23
- 'primary',
24
- 'primary-bis',
25
- 'secondary',
26
- 'tertiary',
27
- 'success',
28
- 'error',
29
- 'transparent-dark',
30
- ],
31
- type: { name: 'string', required: false },
32
- control: { type: 'select' },
33
- table: {
34
- type: { summary: 'string' },
35
- defaultValue: { summary: 'primary' },
36
- },
37
- },
38
- size: {
39
- name: 'size',
40
- description: 'taille: `big`,`small`',
41
- options: ['large', 'small'],
42
- type: { name: 'string', required: false },
43
- control: { type: 'select' },
44
- table: {
45
- type: { summary: 'string' },
46
- defaultValue: { summary: 'small' },
47
- },
48
- },
49
- isBorderVisible: {
50
- name: 'isBorderVisible',
51
- description:
52
- 'Paramètre utilisé seulement quand le `variant` est `secondary` ou `transparent-dark`',
53
- type: { name: 'boolean', required: false },
54
- control: { type: 'boolean' },
55
- table: {
56
- type: { summary: 'boolean' },
57
- defaultValue: { summary: 'false' },
58
- },
59
- },
60
- },
61
- };
62
-
63
- export const buttonUpload = (args) => {
64
- return {
65
- template: hbs`<PixButtonUpload
66
- @id={{this.id}}
67
- @onChange={{this.onChange}}
68
- @variant={{this.variant}}
69
- @size={{this.size}}
70
- @isBorderVisible={{this.isBorderVisible}}
71
- >
72
- Cliquer pour uploader un fichier
73
- </PixButtonUpload>`,
74
- context: args,
75
- };
76
- };
77
-
78
- buttonUpload.args = {
79
- id: 'file-upload',
80
- onChange: action('onChange'),
81
- };
@@ -1,79 +0,0 @@
1
- import { Meta, Story, ArgTypes } from '@storybook/blocks';
2
- import * as ComponentStories from './pix-button.stories';
3
-
4
- <Meta of={ComponentStories} />
5
-
6
- # Pix Button
7
-
8
- ## Default
9
-
10
- Le bouton par défaut qui empêche les clics multiples.
11
-
12
- <Story of={ComponentStories.Default} />
13
-
14
- ## Variants
15
-
16
- Le bouton avec toutes ses variations
17
-
18
- <Story of={ComponentStories.variants} height={500} />
19
-
20
- ## Icons
21
-
22
- Le bouton avec des icônes `font-awesome` à afficher avant (`@iconBefore`) ou après (`@iconAfter`) le label.
23
-
24
- > ℹ️ Accessibilité : dans le cas où les icônes ont une valeur d'information (ex:&nbsp;un bouton `⬅️ Précédent`), il est important d'apporter un aria-label au bouton (ex:&nbsp;"Retour à la page précédente").
25
-
26
- <Story of={ComponentStories.icons} height={75} />
27
-
28
- ## Disabled
29
-
30
- Le bouton désactivé
31
-
32
- <Story of={ComponentStories.disabled} height={75} />
33
-
34
-
35
- ## Link
36
-
37
- Fonctionnalité dépréciée dans `<PixButton />`.
38
-
39
- Utiliser le composant `<PixButtonLink />` à la place.
40
-
41
- ## Loader
42
-
43
- Le bouton avec loader.
44
- Le loader peut être affiché de deux façons :
45
-
46
- - En passant une promesse dans l'attribut `@triggerAction`
47
- - En passant directement l'attribut `@isLoading={{true}}`
48
-
49
- <Story of={ComponentStories.loader} height={150} />
50
-
51
-
52
- ## Size
53
-
54
- Le bouton en large (small étant la valeur par défaut)
55
-
56
- <Story of={ComponentStories.size} height={75} />
57
-
58
-
59
- ## Usage
60
-
61
- Un petit bouton avec les bords arrondis en fond transparent avec une bordure
62
-
63
- ```html
64
- <PixButton
65
- @triggerAction="{{action"
66
- triggerAction}}
67
- @loadingColor="white"
68
- @variant="secondary"
69
- @isDisabled="{{false}}"
70
- @size="small"
71
- @isBorderVisible="{{true}}"
72
- >
73
- Cliquez-moi
74
- </PixButton>
75
- ```
76
-
77
- ## Arguments
78
-
79
- <ArgTypes of={ComponentStories} />
@@ -1,270 +0,0 @@
1
- import { hbs } from 'ember-cli-htmlbars';
2
-
3
- export default {
4
- title: 'Basics/Button',
5
- argTypes: {
6
- type: {
7
- name: 'type',
8
- description: 'type du bouton',
9
- type: { required: false },
10
- control: { disable: true },
11
- table: {
12
- type: { summary: 'string' },
13
- defaultValue: { summary: 'button' },
14
- },
15
- },
16
- triggerAction: {
17
- name: 'triggerAction',
18
- description: 'fonction à appeler en cas de clic, optionnel si le bouton est de type submit',
19
- type: { required: true },
20
- control: { disable: true },
21
- },
22
- loadingColor: {
23
- name: 'loadingColor',
24
- description: 'couleur de chargement: `white`, `grey`',
25
- type: { name: 'string', required: false },
26
- options: ['white', 'grey'],
27
- control: { type: 'select' },
28
- table: {
29
- type: { summary: 'string' },
30
- defaultValue: { summary: 'white' },
31
- },
32
- },
33
- variant: {
34
- name: 'variant',
35
- description:
36
- 'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
37
- options: [
38
- 'primary',
39
- 'primary-bis',
40
- 'secondary',
41
- 'tertiary',
42
- 'success',
43
- 'error',
44
- 'transparent-dark',
45
- ],
46
- type: { name: 'string', required: false },
47
- control: { type: 'select' },
48
- table: {
49
- type: { summary: 'string' },
50
- defaultValue: { summary: 'primary' },
51
- },
52
- },
53
- iconBefore: {
54
- name: 'iconBefore',
55
- description: `Nom de l'icône font-awesome à afficher **avant** le label`,
56
- type: { name: 'string', required: false },
57
- control: { type: 'select' },
58
- options: ['magnifying-glass', 'plus', 'xmark'],
59
- table: {
60
- type: { summary: 'string' },
61
- defaultValue: { summary: null },
62
- },
63
- },
64
- iconAfter: {
65
- name: 'iconAfter',
66
- description: `Nom de l'icône font-awesome à afficher **après** le label`,
67
- type: { name: 'string', required: false },
68
- control: { type: 'select' },
69
- options: ['magnifying-glass', 'plus', 'xmark'],
70
- table: {
71
- type: { summary: 'string' },
72
- defaultValue: { summary: null },
73
- },
74
- },
75
- prefixIconBefore: {
76
- name: 'prefixIconBefore',
77
- description: `Permet d'ajouter un préfix à l'icone devant le label pour appliquer un style particulier`,
78
- type: { name: 'string', required: false },
79
- control: { type: 'select' },
80
- options: ['fas', 'far'],
81
- table: {
82
- type: { summary: 'string' },
83
- defaultValue: { summary: null },
84
- },
85
- },
86
- prefixIconAfter: {
87
- name: 'prefixIconAfter',
88
- description: `Permet d'ajouter un préfix à l'icone derrière le label pour appliquer un style particulier`,
89
- type: { name: 'string', required: false },
90
- control: { type: 'select' },
91
- options: ['fas', 'far'],
92
- table: {
93
- type: { summary: 'string' },
94
- defaultValue: { summary: null },
95
- },
96
- },
97
- isDisabled: {
98
- name: 'isDisabled',
99
- type: { name: 'boolean', required: false },
100
- control: { type: 'boolean' },
101
- table: {
102
- type: { summary: 'boolean' },
103
- defaultValue: { summary: 'false' },
104
- },
105
- },
106
- isLoading: {
107
- name: 'isLoading',
108
- description:
109
- 'Affiche un loader. Si `@triggerAction` retourne une promesse alors le loading est géré automatiquement.',
110
- type: { name: 'boolean', required: false },
111
- control: { type: 'boolean' },
112
- table: {
113
- type: { summary: 'boolean' },
114
- defaultValue: { summary: 'false' },
115
- },
116
- },
117
- size: {
118
- name: 'size',
119
- description: 'taille: `large`,`small`',
120
- options: ['large', 'small'],
121
- type: { name: 'string', required: false },
122
- control: { type: 'select' },
123
- table: {
124
- type: { summary: 'string' },
125
- defaultValue: { summary: 'small' },
126
- },
127
- },
128
- isBorderVisible: {
129
- name: 'isBorderVisible',
130
- description:
131
- 'Paramètre utilisé seulement quand le `variant` est `secondary` ou `transparent-dark`',
132
- type: { name: 'boolean', required: false },
133
- control: { type: 'boolean' },
134
- table: {
135
- type: { summary: 'boolean' },
136
- defaultValue: { summary: 'false' },
137
- },
138
- },
139
- },
140
- };
141
-
142
- const Template = (args) => ({
143
- template: hbs`<section style={{this.style}}>
144
- <PixButton
145
- @triggerAction={{this.triggerAction}}
146
- @loadingColor={{this.loadingColor}}
147
- @variant={{this.variant}}
148
- @isDisabled={{this.isDisabled}}
149
- @isLoading={{this.isLoading}}
150
- @size={{this.size}}
151
- @isBorderVisible={{this.isBorderVisible}}
152
- @iconBefore={{this.iconBefore}}
153
- @iconAfter={{this.iconAfter}}
154
- @prefixIconBefore={{this.prefixIconBefore}}
155
- @prefixIconAfter={{this.prefixIconAfter}}
156
- >
157
- {{this.label}}
158
- </PixButton>
159
- </section>
160
- {{#each this.extraButtons as |button|}}
161
- <section style={{button.style}}>
162
- <PixButton
163
- @triggerAction={{this.triggerAction}}
164
- @loadingColor={{button.loadingColor}}
165
- @variant={{button.variant}}
166
- @isDisabled={{button.isDisabled}}
167
- @isLoading={{button.isLoading}}
168
- @size={{button.size}}
169
- @isBorderVisible={{button.isBorderVisible}}
170
- @iconBefore={{button.iconBefore}}
171
- @iconAfter={{button.iconAfter}}
172
- @prefixIconBefore={{this.prefixIconBefore}}
173
- @prefixIconAfter={{this.prefixIconAfter}}
174
- >
175
- {{button.label}}
176
- </PixButton>
177
- </section>
178
- {{/each}}`,
179
- context: args,
180
- });
181
-
182
- export const Default = Template.bind({});
183
- Default.args = {
184
- loadingColor: 'white',
185
- variant: 'primary',
186
- label: 'Bouton',
187
- };
188
-
189
- export const variants = Template.bind({});
190
- variants.args = {
191
- ...Default.args,
192
- label: 'Bouton primary (default)',
193
- extraButtons: [
194
- {
195
- ...Default.args,
196
- label: 'Bouton primary-bis',
197
- variant: 'primary-bis',
198
- loadingColor: 'grey',
199
- },
200
- {
201
- ...Default.args,
202
- label: 'Bouton secondary',
203
- variant: 'secondary',
204
- },
205
- {
206
- ...Default.args,
207
- label: 'Bouton tertiary',
208
- variant: 'tertiary',
209
- },
210
- {
211
- ...Default.args,
212
- label: 'Bouton success',
213
- variant: 'success',
214
- },
215
- {
216
- ...Default.args,
217
- label: 'Bouton error',
218
- variant: 'error',
219
- },
220
- {
221
- ...Default.args,
222
- label: 'Bouton avec bordure sur fond sombre (DEPRECATED)',
223
- style: 'background-color: #775555',
224
- variant: 'transparent-dark',
225
- isBorderVisible: true,
226
- },
227
- ],
228
- };
229
-
230
- export const icons = Template.bind({});
231
- icons.args = {
232
- ...Default.args,
233
- iconBefore: 'magnifying-glass',
234
- iconAfter: 'plus',
235
- };
236
-
237
- export const disabled = Template.bind({});
238
- disabled.args = {
239
- ...Default.args,
240
- label: 'Bouton désactivé',
241
- isDisabled: true,
242
- };
243
-
244
- export const loader = Template.bind({});
245
- loader.args = {
246
- ...Default.args,
247
- label: 'Bouton avec loader au clic',
248
- variant: 'primary-bis',
249
- loadingColor: 'grey',
250
- triggerAction: () => {
251
- return new Promise((resolve) => {
252
- setTimeout(() => {
253
- resolve();
254
- }, 2000);
255
- });
256
- },
257
- extraButtons: [
258
- {
259
- ...Default.args,
260
- isLoading: true,
261
- },
262
- ],
263
- };
264
-
265
- export const size = Template.bind({});
266
- size.args = {
267
- ...Default.args,
268
- label: 'Bouton large',
269
- size: 'large',
270
- };
@@ -1,49 +0,0 @@
1
- import { Meta, Story, ArgTypes } from '@storybook/blocks';
2
- import * as ComponentStories from './pix-checkbox-variant-tile.stories';
3
-
4
- <Meta of={ComponentStories} />
5
-
6
- # PixCheckbox `@variant="title"`
7
-
8
- La PixCheckbox permet de créer des checkbox basiques ou des checkbox mixées (checkbox servant d'indicateur lors d'une sélection multiple).
9
- Un cursor `pointer` est défini sur la checkbox et son label par défaut.
10
-
11
- La checkbox et son label sont visuellement regroupés dans un ensemble intégralement cliquable.
12
-
13
- <Story of={ComponentStories.VariantTile} height={120} />
14
-
15
- ## États de la Checkbox
16
-
17
- ### Checkbox désactivée
18
-
19
- L'attribut `@isDisabled` permet de désactiver la checkbox en conservant la possibilité de naviguer avec le clavier ou le lecteur d'écran. Il est préféré à l'attribut natif `disabled` qui empêche ces usages.
20
- Un cursor `not-allowed` est défini sur la checkbox et son label lorsqu'elle est dans un état `disabled`.
21
-
22
- <Story of={ComponentStories.isDisabledVariantTile} height={120} />
23
- <Story of={ComponentStories.checkedIsDisabledVariantTile} height={120} />
24
- <Story of={ComponentStories.isIndeterminateIsDisabledVariantTile} height={120} />
25
-
26
- #### Succès/Erreur
27
-
28
- Cumulée à la désactivation, une propriété de statut permet de préciser une coloration particulière en cas de "succès" ou d'"erreur".
29
-
30
- <Story of={ComponentStories.isDisabledIsSuccessVariantTile} height={120} />
31
- <Story of={ComponentStories.isDisabledIsErrorVariantTile} height={120} />
32
-
33
- ## Usage
34
-
35
- ```html
36
- <PixCheckbox
37
- @screenReaderOnly={{false}}
38
- @isIndeterminate={{false}}
39
- @size="small"
40
- @isDisabled={{true}}
41
- @variant="tile"
42
- >
43
- <:label>Recevoir la newsletter</:label>
44
- </PixCheckbox>
45
- ```
46
-
47
- ## Arguments
48
-
49
- <ArgTypes of={ComponentStories} />
@@ -1,102 +0,0 @@
1
- import { hbs } from 'ember-cli-htmlbars';
2
- import pixCheckboxStories from './pix-checkbox.stories.js';
3
-
4
- export default {
5
- title: 'Form/Inputs/Checkbox/Variant Tile',
6
- argTypes: {
7
- variant: {
8
- name: 'variant',
9
- description: 'Utiliser une variante graphique du composant',
10
- options: ['tile'],
11
- control: { type: 'select' },
12
- type: { required: true },
13
- },
14
- state: {
15
- name: 'state',
16
- description: 'Si `isDisabled` permet de marquer la checkbox comme correcte ou incorrecte',
17
- options: ['neutral', 'success', 'error'],
18
- control: { type: 'select' },
19
- table: {
20
- type: { summary: 'string' },
21
- defaultValue: { summary: 'neutral' },
22
- },
23
- },
24
- ...pixCheckboxStories.argTypes,
25
- },
26
- };
27
-
28
- const VariantTileTemplate = (args) => {
29
- return {
30
- template: hbs`{{! template-lint-disable no-inline-styles }}
31
- <div
32
- style='border: 1px solid var(--pix-neutral-500); padding: var(--pix-spacing-4x); width: 500px'
33
- ><PixCheckbox
34
- @id={{this.id}}
35
- @isIndeterminate={{this.isIndeterminate}}
36
- @checked={{this.checked}}
37
- @isDisabled={{this.isDisabled}}
38
- @variant={{this.variant}}
39
- @state={{this.state}}
40
- >
41
- <:label>{{this.label}}</:label>
42
- </PixCheckbox></div>`,
43
- context: args,
44
- };
45
- };
46
-
47
- export const VariantTile = VariantTileTemplate.bind({});
48
- VariantTile.args = {
49
- id: 'proposal',
50
- label: 'Une réponse',
51
- variant: 'tile',
52
- };
53
-
54
- export const isDisabledVariantTile = VariantTileTemplate.bind({});
55
- isDisabledVariantTile.args = {
56
- id: 'accept-newsletter-2',
57
- label: 'Recevoir la newsletter',
58
- variant: 'tile',
59
- state: 'neutral',
60
- isDisabled: true,
61
- };
62
-
63
- export const checkedIsDisabledVariantTile = VariantTileTemplate.bind({});
64
- checkedIsDisabledVariantTile.args = {
65
- id: 'accept-newsletter-2',
66
- label: 'Recevoir la newsletter',
67
- variant: 'tile',
68
- state: 'neutral',
69
- isDisabled: true,
70
- checked: true,
71
- };
72
-
73
- export const isIndeterminateIsDisabledVariantTile = VariantTileTemplate.bind({});
74
- isIndeterminateIsDisabledVariantTile.args = {
75
- id: 'accept-newsletter-2',
76
- label: 'Recevoir la newsletter',
77
- variant: 'tile',
78
- state: 'neutral',
79
- isDisabled: true,
80
- checked: true,
81
- isIndeterminate: true,
82
- };
83
-
84
- export const isDisabledIsSuccessVariantTile = VariantTileTemplate.bind({});
85
- isDisabledIsSuccessVariantTile.args = {
86
- id: 'accept-newsletter-2',
87
- label: 'Recevoir la newsletter',
88
- variant: 'tile',
89
- isDisabled: true,
90
- checked: true,
91
- state: 'success',
92
- };
93
-
94
- export const isDisabledIsErrorVariantTile = VariantTileTemplate.bind({});
95
- isDisabledIsErrorVariantTile.args = {
96
- id: 'accept-newsletter-2',
97
- label: 'Recevoir la newsletter',
98
- variant: 'tile',
99
- isDisabled: true,
100
- checked: true,
101
- state: 'error',
102
- };
@@ -1,75 +0,0 @@
1
- import { Meta, Story, ArgTypes } from '@storybook/blocks';
2
- import * as ComponentStories from './pix-checkbox.stories';
3
- import * as VariantTileStories from './pix-checkbox-variant-tile.stories';
4
-
5
- <Meta of={ComponentStories} />
6
-
7
- # PixCheckbox
8
-
9
- La PixCheckbox permet de créer des checkbox basiques ou des checkbox mixées (checkbox servant d'indicateur lors d'une sélection multiple).
10
- Un cursor `pointer` est défini sur la checkbox et son label par défaut.
11
-
12
- <Story of={ComponentStories.Default} height={60} />
13
-
14
- <Story of={ComponentStories.DefaultChecked} height={60} />
15
-
16
- ### Liste de checkboxes
17
-
18
- Il n'est pas rare d'avoir plusieurs champs checkbox qui se suivent.<br/>
19
- En ce sens, nous avons déjà prévu un espace vertical pour séparer 2 composants qui se suivent.
20
-
21
- <Story of={ComponentStories.multiple} height={140} />
22
-
23
- ### Variations graphiques du composant
24
-
25
- La PixCheckbox prend toute la largeur à sa disposition par défaut.
26
-
27
- <Story of={ComponentStories.FullWidth} height={100} />
28
-
29
- Si le paramètre `variant` est précisé avec la valeur `tile`, la checkbox et son label sont visuellement regroupés dans un ensemble intégralement cliquable.
30
-
31
- <Story of={VariantTileStories.VariantTile} height={120} />
32
-
33
- Voir la [documentation de la variante `tile`](?path=/docs/form-inputs-checkbox-variant-tile--docs).
34
-
35
- ## États de la Checkbox
36
-
37
- <br />
38
-
39
- ### Checkbox interminée
40
-
41
- <Story of={ComponentStories.isIndeterminate} height={60} />
42
-
43
- ### Checkbox désactivée
44
-
45
- L'attribut `@isDisabled` permet de désactiver la checkbox en conservant la possibilité de naviguer avec le clavier ou le lecteur d'écran. Il est préféré à l'attribut natif `disabled` qui empêche ces usages.
46
- Un cursor `not-allowed` est défini sur la checkbox et son label lorsqu'elle est dans un état `disabled`.
47
-
48
- <Story of={ComponentStories.isDisabled} height={60} />
49
- <Story of={ComponentStories.checkedIsDisabled} height={60} />
50
- <Story of={ComponentStories.isIndeterminateIsDisabled} height={60} />
51
-
52
- ## Autres tailles de police du label
53
-
54
- <br />
55
-
56
- ### Small
57
-
58
- <Story of={ComponentStories.withSmallLabel} height={60} />
59
-
60
- ## Usage
61
-
62
- ```html
63
- <PixCheckbox
64
- @screenReaderOnly={{false}}
65
- @isIndeterminate={{false}}
66
- @size="small"
67
- @isDisabled={{true}}
68
- >
69
- <:label>Recevoir la newsletter</:label>
70
- </PixCheckbox>
71
- ```
72
-
73
- ## Arguments
74
-
75
- <ArgTypes of={ComponentStories} />