@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.
- package/package.json +6 -6
- package/app/stories/form.mdx +0 -11
- package/app/stories/form.stories.js +0 -142
- package/app/stories/pix-background-header.mdx +0 -29
- package/app/stories/pix-background-header.stories.js +0 -33
- package/app/stories/pix-banner.mdx +0 -86
- package/app/stories/pix-banner.stories.js +0 -112
- package/app/stories/pix-block.mdx +0 -32
- package/app/stories/pix-block.stories.js +0 -22
- package/app/stories/pix-button-link.mdx +0 -39
- package/app/stories/pix-button-link.stories.js +0 -114
- package/app/stories/pix-button-upload.mdx +0 -26
- package/app/stories/pix-button-upload.stories.js +0 -81
- package/app/stories/pix-button.mdx +0 -79
- package/app/stories/pix-button.stories.js +0 -270
- package/app/stories/pix-checkbox-variant-tile.mdx +0 -49
- package/app/stories/pix-checkbox-variant-tile.stories.js +0 -102
- package/app/stories/pix-checkbox.mdx +0 -75
- package/app/stories/pix-checkbox.stories.js +0 -220
- package/app/stories/pix-collapsible.mdx +0 -37
- package/app/stories/pix-collapsible.stories.js +0 -104
- package/app/stories/pix-filter-banner.mdx +0 -26
- package/app/stories/pix-filter-banner.stories.js +0 -87
- package/app/stories/pix-filterable-and-searchable-select.mdx +0 -62
- package/app/stories/pix-filterable-and-searchable-select.stories.js +0 -202
- package/app/stories/pix-icon-button.mdx +0 -84
- package/app/stories/pix-icon-button.stories.js +0 -108
- package/app/stories/pix-icon.mdx +0 -20
- package/app/stories/pix-icon.stories.js +0 -51
- package/app/stories/pix-indicator-card.mdx +0 -41
- package/app/stories/pix-indicator-card.stories.js +0 -78
- package/app/stories/pix-input-code.mdx +0 -33
- package/app/stories/pix-input-code.stories.js +0 -75
- package/app/stories/pix-input-password.mdx +0 -76
- package/app/stories/pix-input-password.stories.js +0 -145
- package/app/stories/pix-input.mdx +0 -104
- package/app/stories/pix-input.stories.js +0 -175
- package/app/stories/pix-label.mdx +0 -47
- package/app/stories/pix-label.stories.js +0 -112
- package/app/stories/pix-message.mdx +0 -54
- package/app/stories/pix-message.stories.js +0 -61
- package/app/stories/pix-modal.mdx +0 -53
- package/app/stories/pix-modal.stories.js +0 -73
- package/app/stories/pix-multi-select.mdx +0 -55
- package/app/stories/pix-multi-select.stories.js +0 -290
- package/app/stories/pix-pagination.mdx +0 -56
- package/app/stories/pix-pagination.stories.js +0 -148
- package/app/stories/pix-progress-gauge.mdx +0 -40
- package/app/stories/pix-progress-gauge.stories.js +0 -117
- package/app/stories/pix-radio-button-variant-tile.mdx +0 -46
- package/app/stories/pix-radio-button-variant-tile.stories.js +0 -92
- package/app/stories/pix-radio-button.mdx +0 -59
- package/app/stories/pix-radio-button.stories.js +0 -165
- package/app/stories/pix-return-to.mdx +0 -34
- package/app/stories/pix-return-to.stories.js +0 -41
- package/app/stories/pix-search-input.mdx +0 -41
- package/app/stories/pix-search-input.stories.js +0 -117
- package/app/stories/pix-select.mdx +0 -80
- package/app/stories/pix-select.stories.js +0 -445
- package/app/stories/pix-selectable-tag.mdx +0 -37
- package/app/stories/pix-selectable-tag.stories.js +0 -69
- package/app/stories/pix-sidebar.mdx +0 -49
- package/app/stories/pix-sidebar.stories.js +0 -74
- package/app/stories/pix-stars.mdx +0 -22
- package/app/stories/pix-stars.stories.js +0 -45
- package/app/stories/pix-tag.mdx +0 -26
- package/app/stories/pix-tag.stories.js +0 -25
- package/app/stories/pix-textarea.mdx +0 -50
- package/app/stories/pix-textarea.stories.js +0 -146
- package/app/stories/pix-toggle.mdx +0 -28
- package/app/stories/pix-toggle.stories.js +0 -134
- package/app/stories/pix-tooltip.mdx +0 -183
- package/app/stories/pix-tooltip.stories.js +0 -215
- package/app/styles/app.scss +0 -0
- package/scripts/migrate-colors-scss-vars-to-css-vars.sh +0 -120
- package/scripts/migrate-spacing-scss-vars-to-css-vars.sh +0 -23
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-input-password.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Input Password
|
|
7
|
-
|
|
8
|
-
Champ pour le mot de passe, avec un `PixIconButton` pour l'afficher ou le masquer.
|
|
9
|
-
|
|
10
|
-
> Pensez à renseigner l'`autocomplete` selon l'utilisation du composant.
|
|
11
|
-
|
|
12
|
-
## Accessibilité
|
|
13
|
-
|
|
14
|
-
Si vous utilisez le `PixInputPassword` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
|
|
15
|
-
|
|
16
|
-
```html
|
|
17
|
-
<PixInputPassword @screenReaderOnly={{true}} @id="{{id}}">
|
|
18
|
-
<:label>{{label}}</:label>
|
|
19
|
-
</PixInputPassword>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Default
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<Story of={ComponentStories.Default} height={100} />
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## With label and subLabel
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<Story of={ComponentStories.withLabelAndInformation} height={110} />
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Error state (with error message)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<Story of={ComponentStories.errorState} height={110} />
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Success state
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<Story of={ComponentStories.successState} height={100} />
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## With prefix
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<Story of={ComponentStories.withPrefix} height={100} />
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## With required label
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<Story of={ComponentStories.withRequiredLabel} height={100} />
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## Usage
|
|
59
|
-
|
|
60
|
-
```html
|
|
61
|
-
<PixInputPassword
|
|
62
|
-
@id="password"
|
|
63
|
-
@subLabel="8 caractères dont une majuscule..."
|
|
64
|
-
@value="pix123"
|
|
65
|
-
@errorMessage="Le mot de passe est erroné"
|
|
66
|
-
@validationStatus="default"
|
|
67
|
-
@prefix="C-"
|
|
68
|
-
@requiredLabel="Champ obligatoire"
|
|
69
|
-
>
|
|
70
|
-
<:label>Mot de passe</:label>
|
|
71
|
-
</PixInputPassword>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Arguments
|
|
75
|
-
|
|
76
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Form/Inputs/Password',
|
|
5
|
-
argTypes: {
|
|
6
|
-
id: {
|
|
7
|
-
name: 'id',
|
|
8
|
-
description: 'Identifiant du champ permettant de lui attacher un label',
|
|
9
|
-
type: { name: 'string', required: true },
|
|
10
|
-
},
|
|
11
|
-
value: {
|
|
12
|
-
name: 'value',
|
|
13
|
-
description: "Valeur de l'input",
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
},
|
|
16
|
-
validationStatus: {
|
|
17
|
-
name: 'validationStatus',
|
|
18
|
-
description:
|
|
19
|
-
"Définit l'état du champ, neutre par défaut, en succès ou erreur selon l'action de l'utilisateur",
|
|
20
|
-
type: { name: 'string', required: false },
|
|
21
|
-
options: ['default', 'success', 'error'],
|
|
22
|
-
control: { type: 'select' },
|
|
23
|
-
},
|
|
24
|
-
errorMessage: {
|
|
25
|
-
name: 'errorMessage',
|
|
26
|
-
description:
|
|
27
|
-
"Affiche le message d'erreur donné. Doit s'accompagner du paramètre validationStatus en 'error'",
|
|
28
|
-
type: { name: 'string', required: false },
|
|
29
|
-
},
|
|
30
|
-
prefix: {
|
|
31
|
-
name: 'prefix',
|
|
32
|
-
description: 'Affiche un préfixe avant la zone de saisie du champ',
|
|
33
|
-
type: { name: 'string', required: false },
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
label: {
|
|
37
|
-
name: 'label',
|
|
38
|
-
description: 'Le label du champ',
|
|
39
|
-
type: { name: 'string', required: true },
|
|
40
|
-
},
|
|
41
|
-
subLabel: {
|
|
42
|
-
name: 'subLabel',
|
|
43
|
-
description: 'Un descriptif complétant le label',
|
|
44
|
-
type: { name: 'string', required: false },
|
|
45
|
-
},
|
|
46
|
-
requiredLabel: {
|
|
47
|
-
name: 'requiredLabel',
|
|
48
|
-
description: 'Label indiquant que le champ est requis.',
|
|
49
|
-
type: { name: 'string', required: false },
|
|
50
|
-
table: {
|
|
51
|
-
type: { summary: 'string' },
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
screenReaderOnly: {
|
|
55
|
-
name: 'screenReaderOnly',
|
|
56
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
57
|
-
control: { type: 'boolean' },
|
|
58
|
-
type: { name: 'boolean', required: false },
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: 'boolean' },
|
|
61
|
-
defaultValue: { summary: false },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
size: {
|
|
65
|
-
name: 'size',
|
|
66
|
-
description: 'Correspond à la taille de la police du label.',
|
|
67
|
-
type: { name: 'string', required: false },
|
|
68
|
-
table: {
|
|
69
|
-
defaultValue: { summary: 'default' },
|
|
70
|
-
},
|
|
71
|
-
control: { type: 'select' },
|
|
72
|
-
options: ['small', 'large', 'default'],
|
|
73
|
-
},
|
|
74
|
-
inlineLabel: {
|
|
75
|
-
name: 'inlineLabel',
|
|
76
|
-
description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
|
|
77
|
-
type: { name: 'boolean', required: false },
|
|
78
|
-
table: {
|
|
79
|
-
defaultValue: { summary: false },
|
|
80
|
-
},
|
|
81
|
-
control: { type: 'boolean' },
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const Template = (args) => {
|
|
87
|
-
return {
|
|
88
|
-
template: hbs`<PixInputPassword
|
|
89
|
-
@id={{this.id}}
|
|
90
|
-
@errorMessage={{this.errorMessage}}
|
|
91
|
-
@prefix={{this.prefix}}
|
|
92
|
-
@validationStatus={{this.validationStatus}}
|
|
93
|
-
@size={{this.size}}
|
|
94
|
-
@subLabel={{this.subLabel}}
|
|
95
|
-
@inlineLabel={{this.inlineLabel}}
|
|
96
|
-
@requiredLabel={{this.requiredLabel}}
|
|
97
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
98
|
-
>
|
|
99
|
-
<:label>{{this.label}}</:label>
|
|
100
|
-
</PixInputPassword>`,
|
|
101
|
-
context: args,
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const Default = Template.bind({});
|
|
106
|
-
Default.args = {
|
|
107
|
-
id: 'first-name',
|
|
108
|
-
ariaLabel: 'Mot de passe',
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const withLabelAndInformation = Template.bind({});
|
|
112
|
-
withLabelAndInformation.args = {
|
|
113
|
-
id: 'password',
|
|
114
|
-
label: 'Mot de passe',
|
|
115
|
-
subLabel: 'Une brève information',
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const errorState = Template.bind({});
|
|
119
|
-
errorState.args = {
|
|
120
|
-
id: 'password',
|
|
121
|
-
label: 'Mot de passe',
|
|
122
|
-
errorMessage: "un message d'erreur",
|
|
123
|
-
validationStatus: 'error',
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const successState = Template.bind({});
|
|
127
|
-
successState.args = {
|
|
128
|
-
id: 'password',
|
|
129
|
-
label: 'Mot de passe',
|
|
130
|
-
validationStatus: 'success',
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const withPrefix = Template.bind({});
|
|
134
|
-
withPrefix.args = {
|
|
135
|
-
id: 'password',
|
|
136
|
-
label: 'Mot de passe',
|
|
137
|
-
prefix: 'C -',
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const withRequiredLabel = Template.bind({});
|
|
141
|
-
withRequiredLabel.args = {
|
|
142
|
-
id: 'password',
|
|
143
|
-
label: 'Mot de passe',
|
|
144
|
-
requiredLabel: 'Champ obligatoire',
|
|
145
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-input.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Input
|
|
7
|
-
|
|
8
|
-
Le PixInput permet de créer un champ de texte.
|
|
9
|
-
|
|
10
|
-
## Accessibilité
|
|
11
|
-
|
|
12
|
-
La propriété label est optionnelle pour le composant.
|
|
13
|
-
|
|
14
|
-
Mais au niveau de l'accessibilité, il est quand même nécessaire que le champ soit rattaché à un label.
|
|
15
|
-
|
|
16
|
-
Il y a alors plusieurs possibilités :
|
|
17
|
-
|
|
18
|
-
- Vous pouvez cacher le label visuellement mais le rendre disponible pour les lecteurs d'écran via la propriété `screenReaderOnly` à `true`.
|
|
19
|
-
- Les attributs `aria-label` et `aria-labelledby` sont utilisables.
|
|
20
|
-
- Un attribut `@for` pointant vers l'id de l'input peut être ajouté à un composant `<PixLabel />` extérieur.
|
|
21
|
-
|
|
22
|
-
## Tests
|
|
23
|
-
|
|
24
|
-
Pour acceder à l'élément via son label avec testing-library:
|
|
25
|
-
|
|
26
|
-
```html
|
|
27
|
-
<PixInput @id="firstName" />
|
|
28
|
-
<:label>Prénom</:label>
|
|
29
|
-
</PixInput>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
screen.getByLabelText('Prénom');
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Si le paramètre @subLabel est utilisé, il faudra concatener les valeurs de `label` et `@subLabel`
|
|
37
|
-
|
|
38
|
-
```html
|
|
39
|
-
<PixInput @id="firstName" @subLabel="exemple: Barry">
|
|
40
|
-
<:label>Prénom</:label>
|
|
41
|
-
</PixInput>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
screen.getByLabelText('Prénom exemple: Barry');
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Default
|
|
49
|
-
|
|
50
|
-
<Story of={ComponentStories.Default} height={100} />
|
|
51
|
-
|
|
52
|
-
## With label and subLabel
|
|
53
|
-
|
|
54
|
-
<Story of={ComponentStories.withLabel} height={110} />
|
|
55
|
-
|
|
56
|
-
## Error state (with error message)
|
|
57
|
-
|
|
58
|
-
<Story of={ComponentStories.errorState} height={110} />
|
|
59
|
-
|
|
60
|
-
## Success state
|
|
61
|
-
|
|
62
|
-
<Story of={ComponentStories.successState} height={100} />
|
|
63
|
-
|
|
64
|
-
## Disabled & readonly states
|
|
65
|
-
|
|
66
|
-
[📖 Lire la différence entre les 2 états.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly#attribute_interactions)
|
|
67
|
-
|
|
68
|
-
#### Disabled
|
|
69
|
-
|
|
70
|
-
Un input désactivé n'est pas focusable et n'est pas censé être envoyé à la soumission de formulaire.
|
|
71
|
-
|
|
72
|
-
<Story of={ComponentStories.disabledState} height={100} />
|
|
73
|
-
|
|
74
|
-
#### Readonly
|
|
75
|
-
|
|
76
|
-
En readonly, l'input n'est pas modifiable, mais il est toujours focusable et est soumis normalement.
|
|
77
|
-
|
|
78
|
-
<Story of={ComponentStories.readonlyState} height={100} />
|
|
79
|
-
|
|
80
|
-
## With required label
|
|
81
|
-
|
|
82
|
-
<Story of={ComponentStories.withRequiredLabel} height={100} />
|
|
83
|
-
|
|
84
|
-
## Without label
|
|
85
|
-
|
|
86
|
-
<Story of={ComponentStories.withoutLabel} height={100} />
|
|
87
|
-
|
|
88
|
-
## Usage
|
|
89
|
-
|
|
90
|
-
```html
|
|
91
|
-
<PixInput
|
|
92
|
-
@id="firstName"
|
|
93
|
-
@subLabel="Complément du label"
|
|
94
|
-
@errorMessage="Un message d`erreur"
|
|
95
|
-
@validationStatus="default"
|
|
96
|
-
@requiredLabel="Champ obligatoire"
|
|
97
|
-
>
|
|
98
|
-
<:label>Prénom</:label>
|
|
99
|
-
</PixInput>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Arguments
|
|
103
|
-
|
|
104
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Form/Inputs/Input',
|
|
5
|
-
argTypes: {
|
|
6
|
-
id: {
|
|
7
|
-
name: 'id',
|
|
8
|
-
description: 'Identifiant du champ permettant de lui attacher un label',
|
|
9
|
-
type: { name: 'string', required: true },
|
|
10
|
-
},
|
|
11
|
-
value: {
|
|
12
|
-
name: 'value',
|
|
13
|
-
description: "Valeur de l'input",
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
},
|
|
16
|
-
validationStatus: {
|
|
17
|
-
name: 'validationStatus',
|
|
18
|
-
description:
|
|
19
|
-
"Définit l'état du champ, neutre par défaut, en succès ou erreur selon l'action de l'utilisateur",
|
|
20
|
-
type: { name: 'string', required: false },
|
|
21
|
-
options: ['default', 'success', 'error'],
|
|
22
|
-
control: { type: 'select' },
|
|
23
|
-
},
|
|
24
|
-
errorMessage: {
|
|
25
|
-
name: 'errorMessage',
|
|
26
|
-
description:
|
|
27
|
-
"Affiche le message d'erreur donné. Doit s'accompagner du paramètre validationStatus en 'error'",
|
|
28
|
-
type: { name: 'string', required: false },
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
label: {
|
|
32
|
-
name: 'label',
|
|
33
|
-
description: 'Le label du champ',
|
|
34
|
-
type: { name: 'string', required: false },
|
|
35
|
-
table: {
|
|
36
|
-
type: { summary: 'string' },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
subLabel: {
|
|
40
|
-
name: 'subLabel',
|
|
41
|
-
description: 'Un descriptif complétant le label',
|
|
42
|
-
type: { name: 'string', required: false },
|
|
43
|
-
},
|
|
44
|
-
requiredLabel: {
|
|
45
|
-
name: 'requiredLabel',
|
|
46
|
-
description: 'Label indiquant que le champ est requis.',
|
|
47
|
-
type: { name: 'string', required: false },
|
|
48
|
-
table: {
|
|
49
|
-
type: { summary: 'string' },
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
screenReaderOnly: {
|
|
53
|
-
name: 'screenReaderOnly',
|
|
54
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
55
|
-
control: { type: 'boolean' },
|
|
56
|
-
type: { name: 'boolean', required: false },
|
|
57
|
-
table: {
|
|
58
|
-
type: { summary: 'boolean' },
|
|
59
|
-
defaultValue: { summary: false },
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
size: {
|
|
63
|
-
name: 'size',
|
|
64
|
-
description: 'Correspond à la taille de la police du label.',
|
|
65
|
-
type: { name: 'string', required: false },
|
|
66
|
-
table: {
|
|
67
|
-
defaultValue: { summary: 'default' },
|
|
68
|
-
},
|
|
69
|
-
control: { type: 'select' },
|
|
70
|
-
options: ['small', 'large', 'default'],
|
|
71
|
-
},
|
|
72
|
-
inlineLabel: {
|
|
73
|
-
name: 'inlineLabel',
|
|
74
|
-
description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
|
|
75
|
-
type: { name: 'boolean', required: false },
|
|
76
|
-
table: {
|
|
77
|
-
defaultValue: { summary: false },
|
|
78
|
-
},
|
|
79
|
-
control: { type: 'boolean' },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const Template = (args) => {
|
|
85
|
-
return {
|
|
86
|
-
template: hbs`<PixInput
|
|
87
|
-
@id={{this.id}}
|
|
88
|
-
@errorMessage={{this.errorMessage}}
|
|
89
|
-
placeholder='Jeanne, Pierre ...'
|
|
90
|
-
@validationStatus={{this.validationStatus}}
|
|
91
|
-
@size={{this.size}}
|
|
92
|
-
disabled={{this.disabled}}
|
|
93
|
-
readonly={{this.readonly}}
|
|
94
|
-
@subLabel={{this.subLabel}}
|
|
95
|
-
@inlineLabel={{this.inlineLabel}}
|
|
96
|
-
@requiredLabel={{this.requiredLabel}}
|
|
97
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
98
|
-
>
|
|
99
|
-
<:label>{{this.label}}</:label>
|
|
100
|
-
</PixInput>`,
|
|
101
|
-
context: args,
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const TemplateWithoutLabel = (args) => {
|
|
106
|
-
return {
|
|
107
|
-
template: hbs`<PixInput
|
|
108
|
-
@id={{this.id}}
|
|
109
|
-
@errorMessage={{this.errorMessage}}
|
|
110
|
-
placeholder='Jeanne, Pierre ...'
|
|
111
|
-
@validationStatus={{this.validationStatus}}
|
|
112
|
-
@size={{this.size}}
|
|
113
|
-
disabled={{this.disabled}}
|
|
114
|
-
readonly={{this.readonly}}
|
|
115
|
-
@subLabel={{this.subLabel}}
|
|
116
|
-
@inlineLabel={{this.inlineLabel}}
|
|
117
|
-
@requiredLabel={{this.requiredLabel}}
|
|
118
|
-
/>`,
|
|
119
|
-
context: args,
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const Default = Template.bind({});
|
|
124
|
-
Default.args = {
|
|
125
|
-
id: 'first-name',
|
|
126
|
-
label: 'Prénom',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const withLabel = Template.bind({});
|
|
130
|
-
withLabel.args = {
|
|
131
|
-
id: 'first-name',
|
|
132
|
-
label: 'Prénom',
|
|
133
|
-
subLabel: 'a small information',
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const errorState = Template.bind({});
|
|
137
|
-
errorState.args = {
|
|
138
|
-
id: 'first-name',
|
|
139
|
-
label: 'Prénom',
|
|
140
|
-
errorMessage: "un message d'erreur",
|
|
141
|
-
validationStatus: 'error',
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const successState = Template.bind({});
|
|
145
|
-
successState.args = {
|
|
146
|
-
id: 'first-name',
|
|
147
|
-
label: 'Prénom',
|
|
148
|
-
validationStatus: 'success',
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export const disabledState = Template.bind({});
|
|
152
|
-
disabledState.args = {
|
|
153
|
-
id: 'first-name',
|
|
154
|
-
label: 'Prénom',
|
|
155
|
-
disabled: true,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export const readonlyState = Template.bind({});
|
|
159
|
-
readonlyState.args = {
|
|
160
|
-
id: 'first-name',
|
|
161
|
-
label: 'Prénom',
|
|
162
|
-
readonly: true,
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export const withRequiredLabel = Template.bind({});
|
|
166
|
-
withRequiredLabel.args = {
|
|
167
|
-
id: 'first-name',
|
|
168
|
-
label: 'Prénom',
|
|
169
|
-
requiredLabel: 'Champ obligatoire',
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const withoutLabel = TemplateWithoutLabel.bind({});
|
|
173
|
-
withoutLabel.args = {
|
|
174
|
-
id: 'first-name',
|
|
175
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-label.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Label
|
|
7
|
-
|
|
8
|
-
Le `PixLabel` permet de créer label pour un input donnée.
|
|
9
|
-
Il existe une version `PixLabelWrapped` pour les `PixCheckox` / `PixRadioButton` qui permet d'inclure l'`input` à l'intérieur du son `label`
|
|
10
|
-
|
|
11
|
-
## Accessibilité
|
|
12
|
-
|
|
13
|
-
Cet élément ne s'utilise pas seul, il doit être accompagné d'un élément à identifier
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Default
|
|
17
|
-
|
|
18
|
-
<Story of={ComponentStories.Default} height={100} />
|
|
19
|
-
|
|
20
|
-
## With label and information
|
|
21
|
-
|
|
22
|
-
<Story of={ComponentStories.withSubLabel} height={110} />
|
|
23
|
-
|
|
24
|
-
## With required label
|
|
25
|
-
|
|
26
|
-
<Story of={ComponentStories.withRequiredLabel} height={100} />
|
|
27
|
-
|
|
28
|
-
## Screen reader context
|
|
29
|
-
|
|
30
|
-
<Story of={ComponentStories.screenReaderOnlyLabel} height={100} />
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<PixLabel
|
|
36
|
-
@id="firstName"
|
|
37
|
-
@subLabel="Complément du label"
|
|
38
|
-
@requiredLabel="Champ obligatoire"
|
|
39
|
-
@screenReaderOnly=true
|
|
40
|
-
@inlineLabel=true>
|
|
41
|
-
Prénom
|
|
42
|
-
</PixLabel>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Arguments
|
|
46
|
-
|
|
47
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Form/Label',
|
|
5
|
-
argTypes: {
|
|
6
|
-
for: {
|
|
7
|
-
name: 'for',
|
|
8
|
-
description: 'Identifiant du champ à rattacher au label',
|
|
9
|
-
type: { name: 'string', required: true },
|
|
10
|
-
},
|
|
11
|
-
label: {
|
|
12
|
-
name: 'label',
|
|
13
|
-
description: 'Le label du champ',
|
|
14
|
-
type: { name: 'string', required: true },
|
|
15
|
-
},
|
|
16
|
-
subLabel: {
|
|
17
|
-
name: 'subLabel',
|
|
18
|
-
description: 'Un descriptif complétant le label',
|
|
19
|
-
type: { name: 'string', required: false },
|
|
20
|
-
},
|
|
21
|
-
requiredLabel: {
|
|
22
|
-
name: 'requiredLabel',
|
|
23
|
-
description: 'Label indiquant que le champ est requis.',
|
|
24
|
-
type: { name: 'string', required: false },
|
|
25
|
-
table: {
|
|
26
|
-
type: { summary: 'string' },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
screenReaderOnly: {
|
|
30
|
-
name: 'screenReaderOnly',
|
|
31
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
32
|
-
control: { type: 'boolean' },
|
|
33
|
-
type: { name: 'boolean', required: false },
|
|
34
|
-
table: {
|
|
35
|
-
type: { summary: 'boolean' },
|
|
36
|
-
defaultValue: { summary: false },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
size: {
|
|
40
|
-
name: 'size',
|
|
41
|
-
description: 'Correspond à la taille de la police du label.',
|
|
42
|
-
type: { name: 'string', required: false },
|
|
43
|
-
table: {
|
|
44
|
-
defaultValue: { summary: 'default' },
|
|
45
|
-
},
|
|
46
|
-
control: { type: 'select' },
|
|
47
|
-
options: ['small', 'large', 'default'],
|
|
48
|
-
},
|
|
49
|
-
inlineLabel: {
|
|
50
|
-
name: 'inlineLabel',
|
|
51
|
-
description:
|
|
52
|
-
'Permet de ne pas afficher la marge pour les éléments de formulaire inline ( checkbox / radio )',
|
|
53
|
-
type: { name: 'boolean', required: false },
|
|
54
|
-
table: {
|
|
55
|
-
defaultValue: { summary: false },
|
|
56
|
-
},
|
|
57
|
-
control: { type: 'boolean' },
|
|
58
|
-
},
|
|
59
|
-
wrappedElement: {
|
|
60
|
-
name: 'wrappedElement',
|
|
61
|
-
description: "Permet de définir si le label englobe l'input associé",
|
|
62
|
-
type: { name: 'boolean', required: false },
|
|
63
|
-
table: {
|
|
64
|
-
defaultValue: { summary: false },
|
|
65
|
-
},
|
|
66
|
-
control: { type: 'boolean' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const Template = (args) => {
|
|
72
|
-
return {
|
|
73
|
-
template: hbs`<PixLabel
|
|
74
|
-
@id={{this.id}}
|
|
75
|
-
@subLabel={{this.subLabel}}
|
|
76
|
-
@size={{this.size}}
|
|
77
|
-
@requiredLabel={{this.requiredLabel}}
|
|
78
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
79
|
-
@inlineLabel={{this.inlineLabel}}
|
|
80
|
-
>
|
|
81
|
-
{{this.label}}
|
|
82
|
-
</PixLabel>`,
|
|
83
|
-
context: args,
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const Default = Template.bind({});
|
|
88
|
-
Default.args = {
|
|
89
|
-
id: 'first-name',
|
|
90
|
-
label: 'Prénom',
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const withSubLabel = Template.bind({});
|
|
94
|
-
withSubLabel.args = {
|
|
95
|
-
id: 'first-name',
|
|
96
|
-
label: 'Prénom',
|
|
97
|
-
subLabel: 'a small information',
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const withRequiredLabel = Template.bind({});
|
|
101
|
-
withRequiredLabel.args = {
|
|
102
|
-
id: 'first-name',
|
|
103
|
-
label: 'Prénom',
|
|
104
|
-
requiredLabel: 'Champ obligatoire',
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const screenReaderOnlyLabel = Template.bind({});
|
|
108
|
-
screenReaderOnlyLabel.args = {
|
|
109
|
-
id: 'first-name',
|
|
110
|
-
label: 'Prénom',
|
|
111
|
-
screenReaderOnlyLabel: true,
|
|
112
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-message.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Message
|
|
7
|
-
|
|
8
|
-
Un bandeau d'information avec une icône facultative.
|
|
9
|
-
|
|
10
|
-
## Default / Info
|
|
11
|
-
|
|
12
|
-
Le bandeau est de type informatif sans icône (par défaut).
|
|
13
|
-
|
|
14
|
-
<Story of={ComponentStories.Default} height={110} />
|
|
15
|
-
|
|
16
|
-
## With icon
|
|
17
|
-
|
|
18
|
-
Le bandeau avec une icône.
|
|
19
|
-
|
|
20
|
-
<Story of={ComponentStories.withIcon} height={110} />
|
|
21
|
-
|
|
22
|
-
## Warning
|
|
23
|
-
|
|
24
|
-
Le bandeau en cas d'alerte.
|
|
25
|
-
|
|
26
|
-
<Story of={ComponentStories.warning} height={110} />
|
|
27
|
-
|
|
28
|
-
## Success
|
|
29
|
-
|
|
30
|
-
Le bandeau en cas de validation.
|
|
31
|
-
|
|
32
|
-
<Story of={ComponentStories.success} height={110} />
|
|
33
|
-
|
|
34
|
-
## Error
|
|
35
|
-
|
|
36
|
-
Le bandeau en cas de d'erreur.
|
|
37
|
-
|
|
38
|
-
<Story of={ComponentStories.error} height={110} />
|
|
39
|
-
|
|
40
|
-
## Alert
|
|
41
|
-
|
|
42
|
-
⚠️ Ce type est déprécié, utilisez le type `error` à la place.
|
|
43
|
-
|
|
44
|
-
## Usage
|
|
45
|
-
|
|
46
|
-
Par défaut
|
|
47
|
-
|
|
48
|
-
```html
|
|
49
|
-
<PixMessage> Ceci est un message à caractère informatif. </PixMessage>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Arguments
|
|
53
|
-
|
|
54
|
-
<ArgTypes />
|