@1024pix/pix-ui 38.0.0 → 38.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +31 -39
- package/.nvmrc +1 -1
- package/.storybook/main.js +7 -5
- package/.storybook/preview.js +35 -32
- package/CHANGELOG.md +20 -0
- package/app/stories/form.stories.js +4 -0
- package/app/stories/{pix-background-header.stories.mdx → pix-background-header.mdx} +6 -6
- package/app/stories/pix-background-header.stories.js +4 -0
- package/app/stories/{pix-banner.stories.mdx → pix-banner.mdx} +19 -30
- package/app/stories/pix-banner.stories.js +49 -46
- package/app/stories/{pix-block.stories.mdx → pix-block.mdx} +5 -7
- package/app/stories/pix-block.stories.js +14 -11
- package/app/stories/{pix-button-link.stories.mdx → pix-button-link.mdx} +6 -14
- package/app/stories/pix-button-link.stories.js +87 -87
- package/app/stories/{pix-button-upload.stories.mdx → pix-button-upload.mdx} +5 -8
- package/app/stories/pix-button-upload.stories.js +62 -59
- package/app/stories/{pix-button.stories.mdx → pix-button.mdx} +15 -28
- package/app/stories/pix-button.stories.js +152 -149
- package/app/stories/pix-checkbox.mdx +71 -0
- package/app/stories/pix-checkbox.stories.js +69 -66
- package/app/stories/pix-collapsible.mdx +31 -0
- package/app/stories/pix-collapsible.stories.js +16 -13
- package/app/stories/{pix-dropdown.stories.mdx → pix-dropdown.mdx} +9 -17
- package/app/stories/pix-dropdown.stories.js +114 -110
- package/app/stories/{pix-filter-banner.stories.mdx → pix-filter-banner.mdx} +5 -7
- package/app/stories/pix-filter-banner.stories.js +36 -33
- package/app/stories/{pix-filterable-and-searchable-select.stories.mdx → pix-filterable-and-searchable-select.mdx} +7 -17
- package/app/stories/pix-filterable-and-searchable-select.stories.js +136 -133
- package/app/stories/{pix-icon-button.stories.mdx → pix-icon-button.mdx} +8 -16
- package/app/stories/pix-icon-button.stories.js +60 -57
- package/app/stories/{pix-indicator-card.stories.mdx → pix-indicator-card.mdx} +6 -10
- package/app/stories/pix-indicator-card.stories.js +37 -34
- package/app/stories/{pix-input-code.stories.mdx → pix-input-code.mdx} +5 -7
- package/app/stories/pix-input-code.stories.js +55 -52
- package/app/stories/{pix-input-password.stories.mdx → pix-input-password.mdx} +22 -23
- package/app/stories/pix-input-password.stories.js +60 -57
- package/app/stories/{pix-input.stories.mdx → pix-input.mdx} +14 -20
- package/app/stories/pix-input.stories.js +55 -52
- package/app/stories/pix-message.mdx +54 -0
- package/app/stories/pix-message.stories.js +40 -36
- package/app/stories/{pix-modal.stories.mdx → pix-modal.mdx} +5 -7
- package/app/stories/pix-modal.stories.js +31 -30
- package/app/stories/{pix-multi-select.stories.mdx → pix-multi-select.mdx} +9 -21
- package/app/stories/pix-multi-select.stories.js +106 -99
- package/app/stories/{pix-pagination.stories.mdx → pix-pagination.mdx} +8 -16
- package/app/stories/pix-pagination.stories.js +114 -111
- package/app/stories/{pix-progress-gauge.stories.mdx → pix-progress-gauge.mdx} +6 -10
- package/app/stories/pix-progress-gauge.stories.js +43 -40
- package/app/stories/{pix-radio-button.stories.mdx → pix-radio-button.mdx} +13 -15
- package/app/stories/pix-radio-button.stories.js +35 -32
- package/app/stories/pix-return-to.mdx +34 -0
- package/app/stories/pix-return-to.stories.js +32 -32
- package/app/stories/{pix-search-input.stories.mdx → pix-search-input.mdx} +5 -7
- package/app/stories/pix-search-input.stories.js +56 -52
- package/app/stories/{pix-select.stories.mdx → pix-select.mdx} +12 -28
- package/app/stories/pix-select.stories.js +171 -168
- package/app/stories/pix-selectable-tag.mdx +37 -0
- package/app/stories/pix-selectable-tag.stories.js +37 -34
- package/app/stories/{pix-sidebar.stories.mdx → pix-sidebar.mdx} +5 -7
- package/app/stories/pix-sidebar.stories.js +28 -25
- package/app/stories/{pix-stars.stories.mdx → pix-stars.mdx} +5 -7
- package/app/stories/pix-stars.stories.js +29 -26
- package/app/stories/{pix-tag.stories.mdx → pix-tag.mdx} +9 -10
- package/app/stories/pix-tag.stories.js +39 -39
- package/app/stories/{pix-textarea.stories.mdx → pix-textarea.mdx} +6 -7
- package/app/stories/pix-textarea.stories.js +37 -39
- package/app/stories/pix-toggle.mdx +28 -0
- package/app/stories/pix-toggle.stories.js +52 -49
- package/app/stories/{pix-tooltip.stories.mdx → pix-tooltip.mdx} +14 -28
- package/app/stories/pix-tooltip.stories.js +57 -54
- package/docs/{architecture.stories.mdx → architecture.mdx} +1 -1
- package/docs/{breaking-changes.stories.mdx → breaking-changes.mdx} +1 -1
- package/docs/changelog.mdx +6 -0
- package/docs/{colors-palette.stories.mdx → colors-palette.mdx} +1 -3
- package/docs/{create-component.stories.mdx → create-component.mdx} +24 -30
- package/docs/{design-system.stories.mdx → design-system.mdx} +1 -1
- package/docs/{design-tokens.stories.mdx → design-tokens.mdx} +1 -1
- package/docs/{good-practices-a11y.stories.mdx → good-practices-a11y.mdx} +1 -1
- package/docs/{good-practices-design.stories.mdx → good-practices-design.mdx} +1 -1
- package/docs/{good-practices-responsive.stories.mdx → good-practices-responsive.mdx} +1 -1
- package/docs/{good-practices-style-css.stories.mdx → good-practices-style-css.mdx} +1 -1
- package/docs/{good-practices-tests.stories.mdx → good-practices-tests.mdx} +1 -1
- package/docs/{make-a-release.stories.mdx → make-a-release.mdx} +1 -1
- package/docs/{pix-design-tokens-dev.stories.mdx → pix-design-tokens-dev.mdx} +1 -1
- package/docs/{shadow.stories.mdx → shadow.mdx} +1 -1
- package/docs/{spacing.stories.mdx → spacing.mdx} +1 -1
- package/docs/{storybook.stories.mdx → storybook.mdx} +1 -1
- package/docs/{test-component-without-release.stories.mdx → test-component-without-release.mdx} +1 -1
- package/docs/{typography.stories.mdx → typography.mdx} +1 -3
- package/docs/{use-component.stories.mdx → use-component.mdx} +1 -1
- package/docs/{use-install.stories.mdx → use-install.mdx} +1 -1
- package/package.json +19 -21
- package/app/stories/pix-checkbox.stories.mdx +0 -73
- package/app/stories/pix-collapsible.stories.mdx +0 -36
- package/app/stories/pix-message.stories.mdx +0 -64
- package/app/stories/pix-return-to.stories.mdx +0 -33
- package/app/stories/pix-selectable-tag.stories.mdx +0 -43
- package/app/stories/pix-toggle.stories.mdx +0 -36
- package/docs/changelog.stories.mdx +0 -6
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { hbs } from 'ember-cli-htmlbars';
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/Multi Select',
|
|
6
|
+
render: (args) => ({
|
|
7
|
+
template: hbs`
|
|
6
8
|
<style>
|
|
7
9
|
.custom {
|
|
8
10
|
border : none;
|
|
@@ -28,8 +30,79 @@ const Template = (args) => ({
|
|
|
28
30
|
@options={{this.options}} as |option|
|
|
29
31
|
>{{option.label}}</PixMultiSelect>
|
|
30
32
|
`,
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
+
context: args,
|
|
34
|
+
}),
|
|
35
|
+
argTypes: {
|
|
36
|
+
id: {
|
|
37
|
+
name: 'id',
|
|
38
|
+
description:
|
|
39
|
+
"Permet l'accessibilité du composant attribuant des ``for`` pour chaque entité. **⚠️ L'`id` est obligatoire que si le `label` n'est pas donné. ⚠️**",
|
|
40
|
+
type: { name: 'string' },
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
name: 'placeholder',
|
|
44
|
+
description:
|
|
45
|
+
'Rempli le contenu interne du composant, `placeholder` pour `isSearchable` `true`, sinon rawContent du `button`',
|
|
46
|
+
type: { name: 'string', required: true },
|
|
47
|
+
},
|
|
48
|
+
label: {
|
|
49
|
+
name: 'label',
|
|
50
|
+
description:
|
|
51
|
+
"Donne un label au champ qui sera celui vocalisé par le lecteur d'écran. **⚠️ Le`label` est obligatoire que si l'`id` n'est pas donné. ⚠️**",
|
|
52
|
+
type: { name: 'string' },
|
|
53
|
+
},
|
|
54
|
+
screenReaderOnly: {
|
|
55
|
+
name: 'screenReaderOnly',
|
|
56
|
+
description: "Permet de cacher à l'écran le label tout en restant vocalisable",
|
|
57
|
+
type: { name: 'boolean', required: false },
|
|
58
|
+
table: { defaultValue: { summary: false } },
|
|
59
|
+
},
|
|
60
|
+
emptyMessage: {
|
|
61
|
+
name: 'emptyMessage',
|
|
62
|
+
description:
|
|
63
|
+
'Un intitulé de choix indisponible (dans le cas ou certains filtres seraient excluant)',
|
|
64
|
+
type: { name: 'string', required: true },
|
|
65
|
+
},
|
|
66
|
+
options: {
|
|
67
|
+
name: 'options',
|
|
68
|
+
description:
|
|
69
|
+
'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value`` et ``label``. ``value`` doit être de type ``String`` pour être conforme au traitement des input value.',
|
|
70
|
+
type: { name: 'array', required: false },
|
|
71
|
+
},
|
|
72
|
+
onChange: {
|
|
73
|
+
name: 'onChange',
|
|
74
|
+
description: "Une fonction permettant d'effectuer une action à chaque sélection",
|
|
75
|
+
type: { required: true },
|
|
76
|
+
},
|
|
77
|
+
values: {
|
|
78
|
+
name: 'values',
|
|
79
|
+
description: 'Une pré-sélection peut être donnée au composant',
|
|
80
|
+
type: { name: 'array', required: false },
|
|
81
|
+
},
|
|
82
|
+
isSearchable: {
|
|
83
|
+
name: 'isSearchable',
|
|
84
|
+
description: 'Permet de rajouter une saisie utilisateur pour faciliter la recherche',
|
|
85
|
+
type: { name: 'boolean', required: false },
|
|
86
|
+
table: { defaultValue: { summary: false } },
|
|
87
|
+
},
|
|
88
|
+
strictSearch: {
|
|
89
|
+
name: 'strictSearch',
|
|
90
|
+
description:
|
|
91
|
+
'Permet de rendre sensible à la casse et au diacritiques lorsque ``isSearchable`` à ``true``',
|
|
92
|
+
type: { name: 'boolean', required: false },
|
|
93
|
+
table: { defaultValue: { summary: false } },
|
|
94
|
+
},
|
|
95
|
+
className: {
|
|
96
|
+
name: 'className',
|
|
97
|
+
description: 'Cette classe css permet de surcharger le css par défaut du composant.',
|
|
98
|
+
type: { name: 'string', required: false },
|
|
99
|
+
table: {
|
|
100
|
+
type: { summary: 'string' },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
33
106
|
const DEFAULT_OPTIONS = [
|
|
34
107
|
{ label: 'ANETH HERBE AROMATIQUE', value: '1' },
|
|
35
108
|
{ label: 'ANIS VERT HERBE AROMATIQUE', value: '2' },
|
|
@@ -44,14 +117,15 @@ const DEFAULT_OPTIONS = [
|
|
|
44
117
|
{ label: 'CERFEUIL HERBE AROMATIQUE', value: '11' },
|
|
45
118
|
];
|
|
46
119
|
|
|
47
|
-
export const Default =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
120
|
+
export const Default = {
|
|
121
|
+
args: {
|
|
122
|
+
label: 'Label du champ',
|
|
123
|
+
options: DEFAULT_OPTIONS,
|
|
124
|
+
onChange: action('onChange'),
|
|
125
|
+
emptyMessage: 'pas de résultat',
|
|
126
|
+
values: ['1', '3'],
|
|
127
|
+
placeholder: 'placeholder',
|
|
128
|
+
},
|
|
55
129
|
};
|
|
56
130
|
|
|
57
131
|
export const multiSelectWithChildComponent = (args) => {
|
|
@@ -90,27 +164,30 @@ multiSelectWithChildComponent.args = {
|
|
|
90
164
|
],
|
|
91
165
|
};
|
|
92
166
|
|
|
93
|
-
export const multiSelectSearchable =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
167
|
+
export const multiSelectSearchable = {
|
|
168
|
+
args: {
|
|
169
|
+
...Default.args,
|
|
170
|
+
isSearchable: true,
|
|
171
|
+
strictSearch: true,
|
|
172
|
+
emptyMessage: 'Aucune option trouvée',
|
|
173
|
+
},
|
|
99
174
|
};
|
|
100
175
|
|
|
101
|
-
export const multiSelectWithCustomClass =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
176
|
+
export const multiSelectWithCustomClass = {
|
|
177
|
+
args: {
|
|
178
|
+
...Default.args,
|
|
179
|
+
className: 'custom',
|
|
180
|
+
isSearchable: false,
|
|
181
|
+
},
|
|
106
182
|
};
|
|
107
183
|
|
|
108
|
-
export const multiSelectWithId =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
184
|
+
export const multiSelectWithId = {
|
|
185
|
+
args: {
|
|
186
|
+
...Default.args,
|
|
187
|
+
label: undefined,
|
|
188
|
+
id: 'custom',
|
|
189
|
+
isSearchable: false,
|
|
190
|
+
},
|
|
114
191
|
};
|
|
115
192
|
|
|
116
193
|
const TemplateWithYield = (args) => ({
|
|
@@ -140,73 +217,3 @@ multiSelectWithYield.args = {
|
|
|
140
217
|
placeholder: undefined,
|
|
141
218
|
isSearchable: false,
|
|
142
219
|
};
|
|
143
|
-
|
|
144
|
-
export const argTypes = {
|
|
145
|
-
id: {
|
|
146
|
-
name: 'id',
|
|
147
|
-
description:
|
|
148
|
-
"Permet l'accessibilité du composant attribuant des ``for`` pour chaque entité. **⚠️ L'`id` est obligatoire que si le `label` n'est pas donné. ⚠️**",
|
|
149
|
-
type: { name: 'string' },
|
|
150
|
-
},
|
|
151
|
-
placeholder: {
|
|
152
|
-
name: 'placeholder',
|
|
153
|
-
description:
|
|
154
|
-
'Rempli le contenu interne du composant, `placeholder` pour `isSearchable` `true`, sinon rawContent du `button`',
|
|
155
|
-
type: { name: 'string', required: true },
|
|
156
|
-
},
|
|
157
|
-
label: {
|
|
158
|
-
name: 'label',
|
|
159
|
-
description:
|
|
160
|
-
"Donne un label au champ qui sera celui vocalisé par le lecteur d'écran. **⚠️ Le`label` est obligatoire que si l'`id` n'est pas donné. ⚠️**",
|
|
161
|
-
type: { name: 'string' },
|
|
162
|
-
},
|
|
163
|
-
screenReaderOnly: {
|
|
164
|
-
name: 'screenReaderOnly',
|
|
165
|
-
description: "Permet de cacher à l'écran le label tout en restant vocalisable",
|
|
166
|
-
type: { name: 'boolean', required: false },
|
|
167
|
-
table: { defaultValue: { summary: false } },
|
|
168
|
-
},
|
|
169
|
-
emptyMessage: {
|
|
170
|
-
name: 'emptyMessage',
|
|
171
|
-
description:
|
|
172
|
-
'Un intitulé de choix indisponible (dans le cas ou certains filtres seraient excluant)',
|
|
173
|
-
type: { name: 'string', required: true },
|
|
174
|
-
},
|
|
175
|
-
options: {
|
|
176
|
-
name: 'options',
|
|
177
|
-
description:
|
|
178
|
-
'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value`` et ``label``. ``value`` doit être de type ``String`` pour être conforme au traitement des input value.',
|
|
179
|
-
type: { name: 'array', required: false },
|
|
180
|
-
},
|
|
181
|
-
onChange: {
|
|
182
|
-
name: 'onChange',
|
|
183
|
-
description: "Une fonction permettant d'effectuer une action à chaque sélection",
|
|
184
|
-
type: { required: true },
|
|
185
|
-
},
|
|
186
|
-
values: {
|
|
187
|
-
name: 'values',
|
|
188
|
-
description: 'Une pré-sélection peut être donnée au composant',
|
|
189
|
-
type: { name: 'array', required: false },
|
|
190
|
-
},
|
|
191
|
-
isSearchable: {
|
|
192
|
-
name: 'isSearchable',
|
|
193
|
-
description: 'Permet de rajouter une saisie utilisateur pour faciliter la recherche',
|
|
194
|
-
type: { name: 'boolean', required: false },
|
|
195
|
-
table: { defaultValue: { summary: false } },
|
|
196
|
-
},
|
|
197
|
-
strictSearch: {
|
|
198
|
-
name: 'strictSearch',
|
|
199
|
-
description:
|
|
200
|
-
'Permet de rendre sensible à la casse et au diacritiques lorsque ``isSearchable`` à ``true``',
|
|
201
|
-
type: { name: 'boolean', required: false },
|
|
202
|
-
table: { defaultValue: { summary: false } },
|
|
203
|
-
},
|
|
204
|
-
className: {
|
|
205
|
-
name: 'className',
|
|
206
|
-
description: 'Cette classe css permet de surcharger le css par défaut du composant.',
|
|
207
|
-
type: { name: 'string', required: false },
|
|
208
|
-
table: {
|
|
209
|
-
type: { summary: 'string' },
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta, Story,
|
|
1
|
+
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as ComponentStories from './pix-pagination.stories';
|
|
4
4
|
|
|
5
|
-
<Meta
|
|
5
|
+
<Meta of={ComponentStories} />
|
|
6
6
|
|
|
7
7
|
# PixPagination
|
|
8
8
|
|
|
@@ -26,27 +26,19 @@ Sur mobile, le select qui permet de choisir le nombre d'élément à afficher su
|
|
|
26
26
|
|
|
27
27
|
## En français avec paramètres par défaut
|
|
28
28
|
|
|
29
|
-
<
|
|
30
|
-
<Story name="French" story={stories.French} height={110} />
|
|
31
|
-
</Canvas>
|
|
29
|
+
<Story of={ComponentStories.French} height={110} />
|
|
32
30
|
|
|
33
31
|
## En anglais avec le paramètre `pageOptions` custom
|
|
34
32
|
|
|
35
|
-
<
|
|
36
|
-
<Story name="English" story={stories.English} height={110} />
|
|
37
|
-
</Canvas>
|
|
33
|
+
<Story of={ComponentStories.English} height={110} />
|
|
38
34
|
|
|
39
35
|
## Avec une seule page
|
|
40
36
|
|
|
41
|
-
<
|
|
42
|
-
<Story name="OnePage" story={stories.OnePage} height={110} />
|
|
43
|
-
</Canvas>
|
|
37
|
+
<Story of={ComponentStories.OnePage} height={110} />
|
|
44
38
|
|
|
45
39
|
## Version condensée
|
|
46
40
|
|
|
47
|
-
<
|
|
48
|
-
<Story name="Condensed" story={stories.Condensed} height={140} />
|
|
49
|
-
</Canvas>
|
|
41
|
+
<Story of={ComponentStories.Condensed} height={110} />
|
|
50
42
|
|
|
51
43
|
## Usage
|
|
52
44
|
|
|
@@ -61,4 +53,4 @@ Sur mobile, le select qui permet de choisir le nombre d'élément à afficher su
|
|
|
61
53
|
|
|
62
54
|
## Arguments
|
|
63
55
|
|
|
64
|
-
<
|
|
56
|
+
<ArgTypes />
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { hbs } from 'ember-cli-htmlbars';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Basics/Pagination',
|
|
5
|
+
render: (args) => ({
|
|
5
6
|
template: hbs`<PixPagination
|
|
6
7
|
@pagination={{this.pagination}}
|
|
7
8
|
@locale={{this.locale}}
|
|
@@ -9,97 +10,21 @@ export const Template = (args) => {
|
|
|
9
10
|
@isCondensed={{this.isCondensed}}
|
|
10
11
|
/>`,
|
|
11
12
|
context: args,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
pageSize: 5,
|
|
20
|
-
rowCount: 12,
|
|
21
|
-
pageCount: 3,
|
|
22
|
-
},
|
|
23
|
-
locale: 'fr',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const English = Template.bind({});
|
|
27
|
-
English.args = {
|
|
28
|
-
pagination: {
|
|
29
|
-
page: 2,
|
|
30
|
-
pageSize: 10,
|
|
31
|
-
rowCount: 12,
|
|
32
|
-
pageCount: 2,
|
|
33
|
-
},
|
|
34
|
-
pageOptions: [
|
|
35
|
-
{ label: '10', value: 10 },
|
|
36
|
-
{ label: '20', value: 20 },
|
|
37
|
-
{ label: '50', value: 50 },
|
|
38
|
-
{ label: '100', value: 100 },
|
|
39
|
-
],
|
|
40
|
-
locale: 'en',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const OnePage = Template.bind({});
|
|
44
|
-
OnePage.args = {
|
|
45
|
-
pagination: {
|
|
46
|
-
page: 1,
|
|
47
|
-
pageSize: 10,
|
|
48
|
-
rowCount: 2,
|
|
49
|
-
pageCount: 1,
|
|
50
|
-
},
|
|
51
|
-
locale: 'fr',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Condensed = Template.bind({});
|
|
55
|
-
Condensed.args = {
|
|
56
|
-
pagination: {
|
|
57
|
-
page: 1,
|
|
58
|
-
pageSize: 10,
|
|
59
|
-
rowCount: 2,
|
|
60
|
-
pageCount: 1,
|
|
61
|
-
},
|
|
62
|
-
locale: 'fr',
|
|
63
|
-
isCondensed: true,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// select attribute data type from https://storybook.js.org/docs/react/essentials/controls
|
|
67
|
-
export const argTypes = {
|
|
68
|
-
pagination: {
|
|
69
|
-
name: 'pagination',
|
|
70
|
-
description:
|
|
71
|
-
"Un objet de pagination tel que l'on en trouve au retour de `knex-utils.fetchPage`",
|
|
72
|
-
type: { name: 'object', required: true },
|
|
73
|
-
},
|
|
74
|
-
pageOptions: {
|
|
75
|
-
name: 'pageOptions',
|
|
76
|
-
description: "Un tableau d'objet `options` pour configurer le select",
|
|
77
|
-
type: { name: 'array', required: false },
|
|
78
|
-
control: {
|
|
79
|
-
type: 'array',
|
|
80
|
-
value: [
|
|
81
|
-
{
|
|
82
|
-
label: '10',
|
|
83
|
-
value: 10,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
label: '25',
|
|
87
|
-
value: 25,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: '50',
|
|
91
|
-
value: 50,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: '100',
|
|
95
|
-
value: 100,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
13
|
+
}),
|
|
14
|
+
argTypes: {
|
|
15
|
+
pagination: {
|
|
16
|
+
name: 'pagination',
|
|
17
|
+
description:
|
|
18
|
+
"Un objet de pagination tel que l'on en trouve au retour de `knex-utils.fetchPage`",
|
|
19
|
+
type: { name: 'object', required: true },
|
|
98
20
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
21
|
+
pageOptions: {
|
|
22
|
+
name: 'pageOptions',
|
|
23
|
+
description: "Un tableau d'objet `options` pour configurer le select",
|
|
24
|
+
type: { name: 'array', required: false },
|
|
25
|
+
control: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
value: [
|
|
103
28
|
{
|
|
104
29
|
label: '10',
|
|
105
30
|
value: 10,
|
|
@@ -116,30 +41,108 @@ export const argTypes = {
|
|
|
116
41
|
label: '100',
|
|
117
42
|
value: 100,
|
|
118
43
|
},
|
|
119
|
-
]
|
|
44
|
+
],
|
|
120
45
|
},
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: 'array' },
|
|
48
|
+
defaultValue: {
|
|
49
|
+
summary: JSON.stringify([
|
|
50
|
+
{
|
|
51
|
+
label: '10',
|
|
52
|
+
value: 10,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '25',
|
|
56
|
+
value: 25,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: '50',
|
|
60
|
+
value: 50,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: '100',
|
|
64
|
+
value: 100,
|
|
65
|
+
},
|
|
66
|
+
]),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
locale: {
|
|
71
|
+
name: 'locale',
|
|
72
|
+
description: "La langue de l'utilisateur",
|
|
73
|
+
type: { name: 'string', required: false },
|
|
74
|
+
control: { type: 'select' },
|
|
75
|
+
options: ['fr', 'en'],
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: 'string' },
|
|
78
|
+
defaultValue: { summary: 'fr' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
isCondensed: {
|
|
82
|
+
name: 'isCondensed',
|
|
83
|
+
description:
|
|
84
|
+
"En desktop, retire le contrôle du nombre d'élèments par page pour simplifier l'usage",
|
|
85
|
+
type: { name: 'boolean', required: false },
|
|
86
|
+
control: { type: 'boolean' },
|
|
87
|
+
table: {
|
|
88
|
+
type: { summary: 'boolean' },
|
|
89
|
+
defaultValue: { summary: 'false' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const French = {
|
|
96
|
+
args: {
|
|
97
|
+
pagination: {
|
|
98
|
+
page: 1,
|
|
99
|
+
pageSize: 5,
|
|
100
|
+
rowCount: 12,
|
|
101
|
+
pageCount: 3,
|
|
121
102
|
},
|
|
103
|
+
locale: 'fr',
|
|
122
104
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const English = {
|
|
108
|
+
args: {
|
|
109
|
+
pagination: {
|
|
110
|
+
page: 2,
|
|
111
|
+
pageSize: 10,
|
|
112
|
+
rowCount: 12,
|
|
113
|
+
pageCount: 2,
|
|
132
114
|
},
|
|
115
|
+
pageOptions: [
|
|
116
|
+
{ label: '10', value: 10 },
|
|
117
|
+
{ label: '20', value: 20 },
|
|
118
|
+
{ label: '50', value: 50 },
|
|
119
|
+
{ label: '100', value: 100 },
|
|
120
|
+
],
|
|
121
|
+
locale: 'en',
|
|
133
122
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const OnePage = {
|
|
126
|
+
args: {
|
|
127
|
+
pagination: {
|
|
128
|
+
page: 1,
|
|
129
|
+
pageSize: 10,
|
|
130
|
+
rowCount: 2,
|
|
131
|
+
pageCount: 1,
|
|
132
|
+
},
|
|
133
|
+
locale: 'fr',
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const Condensed = {
|
|
138
|
+
args: {
|
|
139
|
+
pagination: {
|
|
140
|
+
page: 1,
|
|
141
|
+
pageSize: 10,
|
|
142
|
+
rowCount: 2,
|
|
143
|
+
pageCount: 1,
|
|
143
144
|
},
|
|
145
|
+
locale: 'fr',
|
|
146
|
+
isCondensed: true,
|
|
144
147
|
},
|
|
145
148
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Meta, Story,
|
|
2
|
-
import * as
|
|
1
|
+
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
+
import * as ComponentStories from './pix-progress-gauge.stories';
|
|
3
3
|
|
|
4
|
-
<Meta
|
|
4
|
+
<Meta of={ComponentStories} />
|
|
5
5
|
|
|
6
6
|
# PixProgressGauge
|
|
7
7
|
|
|
@@ -11,17 +11,13 @@ Permet d'afficher un barre de progression sur un barème de 100%. Des paramètre
|
|
|
11
11
|
|
|
12
12
|
> **⚠️** **Il est nécessaire d'avoir un `label` pour rendre le composant accessible !**
|
|
13
13
|
|
|
14
|
-
<
|
|
15
|
-
<Story name="Default" story={stories.Default} height={60} />
|
|
16
|
-
</Canvas>
|
|
14
|
+
<Story of={ComponentStories.Default} height={60} />
|
|
17
15
|
|
|
18
16
|
## Dark mode
|
|
19
17
|
|
|
20
18
|
Démonstration d'une barre de progression blanche en dark mode avec un sous titre.
|
|
21
19
|
|
|
22
|
-
<
|
|
23
|
-
<Story name="Dark" story={stories.darkModeProgressGauge} height={100} />
|
|
24
|
-
</Canvas>
|
|
20
|
+
<Story of={ComponentStories.darkModeProgressGauge} height={100} />
|
|
25
21
|
|
|
26
22
|
## Usage
|
|
27
23
|
|
|
@@ -37,4 +33,4 @@ Démonstration d'une barre de progression blanche en dark mode avec un sous titr
|
|
|
37
33
|
|
|
38
34
|
## Arguments
|
|
39
35
|
|
|
40
|
-
<
|
|
36
|
+
<ArgTypes />
|
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
import { hbs } from 'ember-cli-htmlbars';
|
|
2
2
|
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Others/Progress Gauge',
|
|
5
|
+
argTypes: {
|
|
6
|
+
value: {
|
|
7
|
+
name: 'value',
|
|
8
|
+
description: 'Valeur atteinte sur 100',
|
|
9
|
+
type: { name: 'number', required: true },
|
|
10
|
+
table: { defaultValue: { summary: null } },
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
name: 'label',
|
|
14
|
+
description:
|
|
15
|
+
"Afficher un label caché permettant d'expliciter le contexte de la jauge de progression",
|
|
16
|
+
type: { name: 'string', required: true },
|
|
17
|
+
table: { defaultValue: { summary: 'null' } },
|
|
18
|
+
},
|
|
19
|
+
themeMode: {
|
|
20
|
+
name: 'themeMode',
|
|
21
|
+
description:
|
|
22
|
+
"Permet d'indiquer si le thème de la barre de progression est en dark mode ou light mode. Modifie la couleur de fond de la barre de progression. Peut prendre les valeurs `light` ou `dark`",
|
|
23
|
+
type: { name: 'string', required: false },
|
|
24
|
+
table: { defaultValue: { summary: 'light' } },
|
|
25
|
+
control: { type: 'select' },
|
|
26
|
+
options: ['dark', 'light'],
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
name: 'color',
|
|
30
|
+
description:
|
|
31
|
+
"Modifie la couleur du contenu de la barre de progression. Peut prendre les valeurs `blue`, 'green' ou `purple`",
|
|
32
|
+
type: { name: 'string', required: false },
|
|
33
|
+
table: { defaultValue: { summary: 'blue' } },
|
|
34
|
+
control: { type: 'select' },
|
|
35
|
+
options: ['blue', 'green', 'purple'],
|
|
36
|
+
},
|
|
37
|
+
subtitle: {
|
|
38
|
+
name: 'subtitle',
|
|
39
|
+
description: 'Afficher un sous-titre sous la barre de progression',
|
|
40
|
+
type: { name: 'string', required: false },
|
|
41
|
+
table: { defaultValue: { summary: 'null' } },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
3
46
|
export const Default = (args) => {
|
|
4
47
|
return {
|
|
5
48
|
template: hbs`<PixProgressGauge
|
|
@@ -37,43 +80,3 @@ darkModeProgressGauge.args = {
|
|
|
37
80
|
themeMode: 'dark',
|
|
38
81
|
subtitle: 'Avancement',
|
|
39
82
|
};
|
|
40
|
-
|
|
41
|
-
export const argTypes = {
|
|
42
|
-
value: {
|
|
43
|
-
name: 'value',
|
|
44
|
-
description: 'Valeur atteinte sur 100',
|
|
45
|
-
type: { name: 'number', required: true },
|
|
46
|
-
table: { defaultValue: { summary: null } },
|
|
47
|
-
},
|
|
48
|
-
label: {
|
|
49
|
-
name: 'label',
|
|
50
|
-
description:
|
|
51
|
-
"Afficher un label caché permettant d'expliciter le contexte de la jauge de progression",
|
|
52
|
-
type: { name: 'string', required: true },
|
|
53
|
-
table: { defaultValue: { summary: 'null' } },
|
|
54
|
-
},
|
|
55
|
-
themeMode: {
|
|
56
|
-
name: 'themeMode',
|
|
57
|
-
description:
|
|
58
|
-
"Permet d'indiquer si le thème de la barre de progression est en dark mode ou light mode. Modifie la couleur de fond de la barre de progression. Peut prendre les valeurs `light` ou `dark`",
|
|
59
|
-
type: { name: 'string', required: false },
|
|
60
|
-
table: { defaultValue: { summary: 'light' } },
|
|
61
|
-
control: { type: 'select' },
|
|
62
|
-
options: ['dark', 'light'],
|
|
63
|
-
},
|
|
64
|
-
color: {
|
|
65
|
-
name: 'color',
|
|
66
|
-
description:
|
|
67
|
-
"Modifie la couleur du contenu de la barre de progression. Peut prendre les valeurs `blue`, 'green' ou `purple`",
|
|
68
|
-
type: { name: 'string', required: false },
|
|
69
|
-
table: { defaultValue: { summary: 'blue' } },
|
|
70
|
-
control: { type: 'select' },
|
|
71
|
-
options: ['blue', 'green', 'purple'],
|
|
72
|
-
},
|
|
73
|
-
subtitle: {
|
|
74
|
-
name: 'subtitle',
|
|
75
|
-
description: 'Afficher un sous-titre sous la barre de progression',
|
|
76
|
-
type: { name: 'string', required: false },
|
|
77
|
-
table: { defaultValue: { summary: 'null' } },
|
|
78
|
-
},
|
|
79
|
-
};
|