@1024pix/pix-ui 46.13.0 → 46.13.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.
- 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,445 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Form/Select',
|
|
6
|
-
argTypes: {
|
|
7
|
-
options: {
|
|
8
|
-
name: 'options',
|
|
9
|
-
description:
|
|
10
|
-
'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value``, ``label`` et ``category``. Ce dernier étant optionnel.',
|
|
11
|
-
type: { name: 'array', required: true },
|
|
12
|
-
},
|
|
13
|
-
value: {
|
|
14
|
-
name: 'value',
|
|
15
|
-
description: 'Option sélectionnée',
|
|
16
|
-
options: ['1', '2', '3', '4', '5', '6'],
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
type: { name: 'string', required: false },
|
|
19
|
-
table: {
|
|
20
|
-
type: { summary: 'string' },
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
onChange: {
|
|
24
|
-
name: 'onChange',
|
|
25
|
-
description: 'Fonction à appeler quand une option est sélectionnée.',
|
|
26
|
-
type: { required: true },
|
|
27
|
-
control: { disable: true },
|
|
28
|
-
},
|
|
29
|
-
isSearchable: {
|
|
30
|
-
name: 'isSearchable',
|
|
31
|
-
description: 'Rend le champ cherchable',
|
|
32
|
-
control: { type: 'boolean' },
|
|
33
|
-
type: { name: 'boolean', required: false },
|
|
34
|
-
table: {
|
|
35
|
-
type: { summary: 'boolean' },
|
|
36
|
-
defaultValue: { summary: false },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
id: {
|
|
40
|
-
name: 'id',
|
|
41
|
-
description: 'id généré automatiquement, peut être définit manuellement si besoin',
|
|
42
|
-
type: { name: 'string', required: false },
|
|
43
|
-
table: {
|
|
44
|
-
type: { summary: 'string' },
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
placeholder: {
|
|
48
|
-
name: 'placeholder',
|
|
49
|
-
description: "Placeholder du menu déroulant. Il sert aussi de label pour l'option par défaut",
|
|
50
|
-
type: { name: 'string', required: true },
|
|
51
|
-
table: {
|
|
52
|
-
type: { summary: 'string' },
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
hideDefaultOption: {
|
|
56
|
-
name: 'hideDefaultOption',
|
|
57
|
-
description: "Cache l'option par défaut",
|
|
58
|
-
type: { name: 'boolean', required: false },
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: 'boolean' },
|
|
61
|
-
defaultValue: { summary: false },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
className: {
|
|
65
|
-
name: 'className',
|
|
66
|
-
description: 'Cette classe css permet de surcharger le css par défaut du composant.',
|
|
67
|
-
type: { name: 'string', required: false },
|
|
68
|
-
table: {
|
|
69
|
-
type: { summary: 'string' },
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
searchLabel: {
|
|
73
|
-
name: 'searchLabel',
|
|
74
|
-
description:
|
|
75
|
-
'Label de la recherche dans le menu déroulant. **⚠️ Le `searchLabel` est obligatoire que si le `isSearchable` à `true`. ⚠️**',
|
|
76
|
-
type: { name: 'string', required: false },
|
|
77
|
-
table: {
|
|
78
|
-
type: { summary: 'string' },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
searchPlaceholder: {
|
|
82
|
-
name: 'searchPlaceholder',
|
|
83
|
-
description:
|
|
84
|
-
'Placeholder de la recherche dans le menu déroulant. **⚠️ Le `searchPlaceholder` est obligatoire que si le `isSearchable` à `true`. ⚠️**',
|
|
85
|
-
type: { name: 'string', required: false },
|
|
86
|
-
table: {
|
|
87
|
-
type: { summary: 'string' },
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
emptySearchMessage: {
|
|
91
|
-
name: 'emptySearchMessage',
|
|
92
|
-
description:
|
|
93
|
-
"Message affiché si la recherche ne retourne pas d'options. **⚠️ Le `emptySearchMessage` est obligatoire que si le `isSearchable` à `true`. ⚠️**",
|
|
94
|
-
type: { name: 'string', required: false },
|
|
95
|
-
table: {
|
|
96
|
-
type: { summary: 'string' },
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
errorMessage: {
|
|
100
|
-
name: 'errorMessage',
|
|
101
|
-
description: 'Message affiché si une erreur survient',
|
|
102
|
-
type: { name: 'string', required: false },
|
|
103
|
-
table: {
|
|
104
|
-
type: { summary: 'string' },
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
isDisabled: {
|
|
108
|
-
name: 'isDisabled',
|
|
109
|
-
description: "Permet de désactiver l'affichage des options possible",
|
|
110
|
-
type: { name: 'boolean', required: false },
|
|
111
|
-
table: {
|
|
112
|
-
type: { summary: false },
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
placement: {
|
|
116
|
-
name: 'placement',
|
|
117
|
-
description:
|
|
118
|
-
"Permet de placer la dropdown du select par rapport à son bouton. Par défaut, cela s'adapte tout seul.",
|
|
119
|
-
type: { name: 'string', required: false },
|
|
120
|
-
options: [
|
|
121
|
-
'auto',
|
|
122
|
-
'auto-start',
|
|
123
|
-
'auto-end',
|
|
124
|
-
'top',
|
|
125
|
-
'top-start',
|
|
126
|
-
'top-end',
|
|
127
|
-
'bottom',
|
|
128
|
-
'bottom-start',
|
|
129
|
-
'bottom-end',
|
|
130
|
-
'right',
|
|
131
|
-
'right-start',
|
|
132
|
-
'right-end',
|
|
133
|
-
'left',
|
|
134
|
-
'left-start',
|
|
135
|
-
'left-end',
|
|
136
|
-
],
|
|
137
|
-
control: { type: 'select' },
|
|
138
|
-
table: {
|
|
139
|
-
type: { summary: 'string' },
|
|
140
|
-
defaultValue: { summary: 'bottom-start' },
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
icon: {
|
|
144
|
-
name: 'icon',
|
|
145
|
-
description:
|
|
146
|
-
"Permet l'affichage d'une icône FontAwesome avant le placeholder ou le label de l'option sélectionnée.",
|
|
147
|
-
type: { name: 'string', required: false },
|
|
148
|
-
table: {
|
|
149
|
-
type: { summary: 'string' },
|
|
150
|
-
defaultValue: { summary: null },
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
isComputeWidthDisabled: {
|
|
154
|
-
name: 'isComputeWidthDisabled',
|
|
155
|
-
description:
|
|
156
|
-
'Permet de ne pas calculer la width du select par rapport à la taille maximum de la dropdown',
|
|
157
|
-
type: { name: 'boolean', required: false },
|
|
158
|
-
table: {
|
|
159
|
-
type: { summary: false },
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
label: {
|
|
164
|
-
name: 'label',
|
|
165
|
-
description: 'Le label du champ',
|
|
166
|
-
type: { name: 'string', required: true },
|
|
167
|
-
table: {
|
|
168
|
-
type: { summary: 'string' },
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
subLabel: {
|
|
172
|
-
name: 'subLabel',
|
|
173
|
-
description: 'Un descriptif complétant le label',
|
|
174
|
-
type: { name: 'string', required: false },
|
|
175
|
-
},
|
|
176
|
-
requiredLabel: {
|
|
177
|
-
name: 'requiredLabel',
|
|
178
|
-
description: 'Label indiquant que le champ est requis.',
|
|
179
|
-
type: { name: 'string', required: false },
|
|
180
|
-
table: {
|
|
181
|
-
type: { summary: 'string' },
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
screenReaderOnly: {
|
|
185
|
-
name: 'screenReaderOnly',
|
|
186
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
187
|
-
control: { type: 'boolean' },
|
|
188
|
-
type: { name: 'boolean', required: false },
|
|
189
|
-
table: {
|
|
190
|
-
type: { summary: 'boolean' },
|
|
191
|
-
defaultValue: { summary: false },
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
size: {
|
|
195
|
-
name: 'size',
|
|
196
|
-
description: 'Correspond à la taille de la police du label.',
|
|
197
|
-
type: { name: 'string', required: false },
|
|
198
|
-
table: {
|
|
199
|
-
defaultValue: { summary: 'default' },
|
|
200
|
-
},
|
|
201
|
-
control: { type: 'select' },
|
|
202
|
-
options: ['small', 'large', 'default'],
|
|
203
|
-
},
|
|
204
|
-
inlineLabel: {
|
|
205
|
-
name: 'inlineLabel',
|
|
206
|
-
description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
|
|
207
|
-
type: { name: 'boolean', required: false },
|
|
208
|
-
table: {
|
|
209
|
-
defaultValue: { summary: false },
|
|
210
|
-
},
|
|
211
|
-
control: { type: 'boolean' },
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const Template = (args) => {
|
|
217
|
-
return {
|
|
218
|
-
template: hbs`{{#if this.id}}
|
|
219
|
-
<div>
|
|
220
|
-
<label for={{this.id}}>Un label en dehors du composant</label>
|
|
221
|
-
</div>
|
|
222
|
-
{{/if}}
|
|
223
|
-
<PixSelect
|
|
224
|
-
@id={{this.id}}
|
|
225
|
-
@className={{this.className}}
|
|
226
|
-
@options={{this.options}}
|
|
227
|
-
@isSearchable={{this.isSearchable}}
|
|
228
|
-
@placeholder={{this.placeholder}}
|
|
229
|
-
@hideDefaultOption={{this.hideDefaultOption}}
|
|
230
|
-
@searchLabel={{this.searchLabel}}
|
|
231
|
-
@value={{this.value}}
|
|
232
|
-
@searchPlaceholder={{this.searchPlaceholder}}
|
|
233
|
-
@emptySearchMessage={{this.emptySearchMessage}}
|
|
234
|
-
@errorMessage={{this.errorMessage}}
|
|
235
|
-
@isDisabled={{this.isDisabled}}
|
|
236
|
-
@placement={{this.placement}}
|
|
237
|
-
@icon={{this.icon}}
|
|
238
|
-
@size={{this.size}}
|
|
239
|
-
@subLabel={{this.subLabel}}
|
|
240
|
-
@inlineLabel={{this.inlineLabel}}
|
|
241
|
-
@requiredLabel={{this.requiredLabel}}
|
|
242
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
243
|
-
>
|
|
244
|
-
<:label>{{this.label}}</:label>
|
|
245
|
-
</PixSelect>`,
|
|
246
|
-
context: args,
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const TemplatePopover = (args) => {
|
|
251
|
-
return {
|
|
252
|
-
template: hbs`{{! template-lint-disable no-inline-styles }}
|
|
253
|
-
<div style='display:flex;height:330px'>
|
|
254
|
-
<div style='align-self:flex-end'>
|
|
255
|
-
{{#if this.id}}
|
|
256
|
-
<div>
|
|
257
|
-
<label for={{this.id}}>Un label en dehors du composant</label>
|
|
258
|
-
</div>
|
|
259
|
-
{{/if}}
|
|
260
|
-
<PixSelect
|
|
261
|
-
@id={{this.id}}
|
|
262
|
-
@className={{this.className}}
|
|
263
|
-
@options={{this.options}}
|
|
264
|
-
@isSearchable={{this.isSearchable}}
|
|
265
|
-
@onChange={{this.onChange}}
|
|
266
|
-
@placeholder={{this.placeholder}}
|
|
267
|
-
@hideDefaultOption={{this.hideDefaultOption}}
|
|
268
|
-
@subLabel={{this.subLabel}}
|
|
269
|
-
@searchLabel={{this.searchLabel}}
|
|
270
|
-
@value={{this.value}}
|
|
271
|
-
@searchPlaceholder={{this.searchPlaceholder}}
|
|
272
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
273
|
-
@emptySearchMessage={{this.emptySearchMessage}}
|
|
274
|
-
@requiredLabel={{this.requiredLabel}}
|
|
275
|
-
@errorMessage={{this.errorMessage}}
|
|
276
|
-
@isDisabled={{this.isDisabled}}
|
|
277
|
-
@placement={{this.placement}}
|
|
278
|
-
>
|
|
279
|
-
<:label>{{this.label}}</:label>
|
|
280
|
-
</PixSelect>
|
|
281
|
-
</div>
|
|
282
|
-
</div>`,
|
|
283
|
-
context: args,
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
export const WithId = Template.bind({});
|
|
288
|
-
WithId.args = {
|
|
289
|
-
id: 'custom',
|
|
290
|
-
options: [
|
|
291
|
-
{ value: '1', label: 'Figues' },
|
|
292
|
-
{ value: '3', label: 'Fraises' },
|
|
293
|
-
{ value: '2', label: 'Bananes' },
|
|
294
|
-
{ value: '4', label: 'Mangues' },
|
|
295
|
-
{ value: '5', label: 'Kaki' },
|
|
296
|
-
{
|
|
297
|
-
value: '6',
|
|
298
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
299
|
-
},
|
|
300
|
-
],
|
|
301
|
-
placeholder: 'Mon innerText',
|
|
302
|
-
isSearchable: false,
|
|
303
|
-
onChange: action('onChange'),
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
export const WithCustomClass = Template.bind({});
|
|
307
|
-
WithCustomClass.args = {
|
|
308
|
-
className: 'custom',
|
|
309
|
-
options: [
|
|
310
|
-
{ value: '1', label: 'Figues' },
|
|
311
|
-
{ value: '3', label: 'Fraises' },
|
|
312
|
-
{ value: '2', label: 'Bananes' },
|
|
313
|
-
{ value: '4', label: 'Mangues' },
|
|
314
|
-
{ value: '5', label: 'Kaki' },
|
|
315
|
-
{
|
|
316
|
-
value: '6',
|
|
317
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
label: 'Mon label',
|
|
321
|
-
placeholder: 'Mon innerText',
|
|
322
|
-
subLabel: 'Mon sous label',
|
|
323
|
-
isSearchable: false,
|
|
324
|
-
onChange: action('onChange'),
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
export const Default = Template.bind({});
|
|
328
|
-
Default.args = {
|
|
329
|
-
options: [
|
|
330
|
-
{ value: '1', label: 'Figues' },
|
|
331
|
-
{ value: '3', label: 'Fraises' },
|
|
332
|
-
{ value: '2', label: 'Bananes' },
|
|
333
|
-
{ value: '4', label: 'Mangues' },
|
|
334
|
-
{ value: '5', label: 'Kaki' },
|
|
335
|
-
{
|
|
336
|
-
value: '6',
|
|
337
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
338
|
-
},
|
|
339
|
-
],
|
|
340
|
-
label: 'Mon label',
|
|
341
|
-
placeholder: 'Mon innerText',
|
|
342
|
-
subLabel: 'Mon sous label',
|
|
343
|
-
isSearchable: false,
|
|
344
|
-
onChange: action('onChange'),
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
export const WithCategories = Template.bind({});
|
|
348
|
-
WithCategories.args = {
|
|
349
|
-
options: [
|
|
350
|
-
{ value: '1', label: 'Figues', category: 'Fruit Rouge' },
|
|
351
|
-
{ value: '3', label: 'Fraises', category: 'Fruit Rouge' },
|
|
352
|
-
{ value: '3', label: 'Noix', category: 'Autres' },
|
|
353
|
-
{ value: '4', label: 'Papayes', category: 'Autres' },
|
|
354
|
-
{
|
|
355
|
-
value: '6',
|
|
356
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
357
|
-
category: 'Autres',
|
|
358
|
-
},
|
|
359
|
-
],
|
|
360
|
-
label: 'Mon label',
|
|
361
|
-
placeholder: 'Mon innerText',
|
|
362
|
-
subLabel: 'Mon sous label',
|
|
363
|
-
isSearchable: false,
|
|
364
|
-
onChange: action('onChange'),
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
export const WithSearch = Template.bind({});
|
|
368
|
-
WithSearch.args = {
|
|
369
|
-
options: [
|
|
370
|
-
{ value: '1', label: 'Figues' },
|
|
371
|
-
{ value: '3', label: 'Fraises' },
|
|
372
|
-
{ value: '2', label: 'Bananes' },
|
|
373
|
-
{ value: '4', label: 'Mangues' },
|
|
374
|
-
{ value: '5', label: 'Kaki' },
|
|
375
|
-
{
|
|
376
|
-
value: '6',
|
|
377
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
label: 'Mon label',
|
|
381
|
-
placeholder: 'Mon innerText',
|
|
382
|
-
subLabel: 'Mon sous label',
|
|
383
|
-
searchLabel: 'Mon label',
|
|
384
|
-
searchPlaceholder: 'Mon innerText',
|
|
385
|
-
isSearchable: true,
|
|
386
|
-
emptySearchMessage: 'Aucune option',
|
|
387
|
-
onChange: action('onChange'),
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
export const WithCategoriesAndSearch = Template.bind({});
|
|
391
|
-
WithCategoriesAndSearch.args = {
|
|
392
|
-
options: [
|
|
393
|
-
{ value: '1', label: 'Figues', category: 'Fruit Rouge' },
|
|
394
|
-
{ value: '2', label: 'Fraises', category: 'Fruit Rouge' },
|
|
395
|
-
{ value: '3', label: 'Fèves de chocolat', category: 'Autres' },
|
|
396
|
-
{ value: '5', label: 'Dattes', category: 'Autres' },
|
|
397
|
-
{
|
|
398
|
-
value: '4',
|
|
399
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
400
|
-
category: 'Autres',
|
|
401
|
-
},
|
|
402
|
-
],
|
|
403
|
-
label: 'Mon label',
|
|
404
|
-
placeholder: 'Mon innerText',
|
|
405
|
-
subLabel: 'Mon sous label',
|
|
406
|
-
searchLabel: 'Mon label',
|
|
407
|
-
searchPlaceholder: 'Mon innerText',
|
|
408
|
-
isSearchable: true,
|
|
409
|
-
emptySearchMessage: 'Aucune option',
|
|
410
|
-
onChange: action('onChange'),
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
export const WithDropDownAtTheTop = TemplatePopover.bind({});
|
|
414
|
-
WithDropDownAtTheTop.args = {
|
|
415
|
-
options: [
|
|
416
|
-
{ value: '1', label: 'Figues' },
|
|
417
|
-
{ value: '3', label: 'Fraises' },
|
|
418
|
-
{ value: '2', label: 'Bananes' },
|
|
419
|
-
{ value: '4', label: 'Mangues' },
|
|
420
|
-
{ value: '5', label: 'Kaki' },
|
|
421
|
-
{
|
|
422
|
-
value: '6',
|
|
423
|
-
label: 'Asiminier trilobé oblong vert (à ne pas confondre avec la papaye)',
|
|
424
|
-
},
|
|
425
|
-
],
|
|
426
|
-
label: 'JambonFromage',
|
|
427
|
-
placeholder: 'Mon innerText',
|
|
428
|
-
subLabel: 'Mon sous label',
|
|
429
|
-
isSearchable: false,
|
|
430
|
-
onChange: action('onChange'),
|
|
431
|
-
placement: 'top',
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
export const WithIcon = Template.bind({});
|
|
435
|
-
WithIcon.args = {
|
|
436
|
-
icon: 'earth-europe',
|
|
437
|
-
isSearchable: false,
|
|
438
|
-
label: 'With icon',
|
|
439
|
-
onChange: action('onChange'),
|
|
440
|
-
options: [
|
|
441
|
-
{ value: 'en', label: 'English' },
|
|
442
|
-
{ value: 'fr', label: 'Français' },
|
|
443
|
-
],
|
|
444
|
-
value: 'fr',
|
|
445
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
import * as ComponentStories from './pix-selectable-tag.stories.js';
|
|
4
|
-
|
|
5
|
-
<Meta of={ComponentStories} />
|
|
6
|
-
|
|
7
|
-
# Pix Selectable Tag
|
|
8
|
-
|
|
9
|
-
Un tag permettant de sélectionner ou non la valeur.
|
|
10
|
-
|
|
11
|
-
## Default
|
|
12
|
-
|
|
13
|
-
<Story of={ComponentStories.selectableTagDefault} height={60} />
|
|
14
|
-
|
|
15
|
-
## Selected
|
|
16
|
-
|
|
17
|
-
<Story of={ComponentStories.selectableTagSelected} height={60} />
|
|
18
|
-
|
|
19
|
-
## Multiple tags
|
|
20
|
-
|
|
21
|
-
<Story of={ComponentStories.selectableTagMultiple} height={60} />
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```html
|
|
26
|
-
Par défaut :
|
|
27
|
-
<PixSelectableTag> @label={{label}} @id={{id}} @onChange={{onChange}} </PixSelectableTag>
|
|
28
|
-
|
|
29
|
-
Tag Sélectionné :
|
|
30
|
-
<PixSelectableTag>
|
|
31
|
-
@label={{label}} @id={{id}} @onChange={{onChange}} @checked={{true}}
|
|
32
|
-
</PixSelectableTag>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Arguments
|
|
36
|
-
|
|
37
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'basics/Tag/Selectable Tag',
|
|
5
|
-
argTypes: {
|
|
6
|
-
label: {
|
|
7
|
-
name: 'label',
|
|
8
|
-
description: 'Le label du tag sélectionnable',
|
|
9
|
-
type: { name: 'string', required: true },
|
|
10
|
-
table: {
|
|
11
|
-
type: { summary: 'string' },
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
id: {
|
|
15
|
-
name: 'id',
|
|
16
|
-
description: "L'id du tag sélectionnable",
|
|
17
|
-
type: { name: 'string', required: true },
|
|
18
|
-
table: {
|
|
19
|
-
type: { summary: 'string' },
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
onChange: {
|
|
23
|
-
name: 'onChange',
|
|
24
|
-
description: 'Fonction à appeler si le tag est sélectionné',
|
|
25
|
-
type: { required: true },
|
|
26
|
-
control: { disable: true },
|
|
27
|
-
},
|
|
28
|
-
checked: {
|
|
29
|
-
name: 'checked',
|
|
30
|
-
description: 'Indiquez si le tag doit être coché',
|
|
31
|
-
type: { name: 'boolean', required: true },
|
|
32
|
-
table: {
|
|
33
|
-
type: { summary: 'boolean' },
|
|
34
|
-
defaultValue: { summary: false },
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const selectableTagDefault = (args) => {
|
|
41
|
-
return {
|
|
42
|
-
template: hbs`<PixSelectableTag
|
|
43
|
-
@label='non sélectionné'
|
|
44
|
-
@id='123'
|
|
45
|
-
@onChange={{this.onChange}}
|
|
46
|
-
@checked={{false}}
|
|
47
|
-
/>`,
|
|
48
|
-
context: args,
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const selectableTagSelected = (args) => {
|
|
53
|
-
return {
|
|
54
|
-
template: hbs`<PixSelectableTag @label='Sélectionné' @id='456' @onChange={{this.onChange}} @checked={{true}} />`,
|
|
55
|
-
context: args,
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const selectableTagMultiple = (args) => {
|
|
60
|
-
return {
|
|
61
|
-
template: hbs`{{! template-lint-disable no-inline-styles }}
|
|
62
|
-
<div style='display:flex;justify-content:space-around;width:400px;height:100%;padding:10px'>
|
|
63
|
-
<PixSelectableTag @label='Lorem ipsum' @id='1' @onChange={{this.onChange}} @checked={{false}} />
|
|
64
|
-
<PixSelectableTag @label='Lorem ipsum' @id='2' @onChange={{this.onChange}} @checked={{false}} />
|
|
65
|
-
<PixSelectableTag @label='Lorem ipsum' @id='3' @onChange={{this.onChange}} @checked={{false}} />
|
|
66
|
-
</div>`,
|
|
67
|
-
context: args,
|
|
68
|
-
};
|
|
69
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
import * as ComponentStories from './pix-sidebar.stories.js';
|
|
4
|
-
|
|
5
|
-
<Meta of={ComponentStories} />
|
|
6
|
-
|
|
7
|
-
# PixSidebar
|
|
8
|
-
|
|
9
|
-
Une sidebar responsive et scrollable avec un overlay.
|
|
10
|
-
|
|
11
|
-
Ce composant possède deux `yield` :
|
|
12
|
-
|
|
13
|
-
- `:content` est destiné à accueillir le contenu principal de la fenêtre sidebar. Il peut accueillir tout type de
|
|
14
|
-
contenu HTML (simple texte, image, formulaire, etc.)
|
|
15
|
-
- `:footer` peut également accueillir tout type de contenu HTML, mais est destiné aux boutons permettant d'interagir
|
|
16
|
-
avec la sidebar, ce qui permettra de les positionner correctement dans tous les cas de figure.
|
|
17
|
-
|
|
18
|
-
<Story of={ComponentStories.Default} height={500} />
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```html
|
|
23
|
-
<PixSidebar
|
|
24
|
-
@showSidebar={{true}}
|
|
25
|
-
@title="Filtrer"
|
|
26
|
-
@onClose={{this.closeSidebar}}
|
|
27
|
-
>
|
|
28
|
-
<:content>
|
|
29
|
-
<p>
|
|
30
|
-
Une sidebar est, dans une interface graphique, une fenêtre qui prend le contrôle total du clavier et
|
|
31
|
-
de l'écran. Elle est en général associée à du paramétrage d'écran.
|
|
32
|
-
</p>
|
|
33
|
-
</:content>
|
|
34
|
-
<:footer>
|
|
35
|
-
<PixButton
|
|
36
|
-
@variant="secondary"
|
|
37
|
-
@isBorderVisible={{true}}
|
|
38
|
-
@triggerAction={{this.closeSidebar}}
|
|
39
|
-
>
|
|
40
|
-
Annuler
|
|
41
|
-
</PixButton>
|
|
42
|
-
<PixButton>Valider</PixButton>
|
|
43
|
-
</:footer>
|
|
44
|
-
</PixSidebar>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Arguments
|
|
48
|
-
|
|
49
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Basics/Sidebar',
|
|
5
|
-
argTypes: {
|
|
6
|
-
showSidebar: {
|
|
7
|
-
name: 'showSidebar',
|
|
8
|
-
description: 'Visibilité de la sidebar',
|
|
9
|
-
type: { name: 'boolean', required: false },
|
|
10
|
-
table: {
|
|
11
|
-
type: { summary: 'boolean' },
|
|
12
|
-
defaultValue: { summary: false },
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
title: {
|
|
16
|
-
name: 'title',
|
|
17
|
-
description: 'Titre de la sidebar',
|
|
18
|
-
type: { name: 'string', required: true },
|
|
19
|
-
},
|
|
20
|
-
onClose: {
|
|
21
|
-
name: 'onClose',
|
|
22
|
-
description: 'Fonction à exécuter à la fermeture de la sidebar',
|
|
23
|
-
type: { name: 'function', required: true },
|
|
24
|
-
table: {
|
|
25
|
-
type: { summary: 'function' },
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const Template = (args) => {
|
|
32
|
-
return {
|
|
33
|
-
template: hbs`<PixSidebar
|
|
34
|
-
@showSidebar={{this.showSidebar}}
|
|
35
|
-
@title={{this.title}}
|
|
36
|
-
@onClose={{fn (mut this.showSidebar) (not this.showSidebar)}}
|
|
37
|
-
>
|
|
38
|
-
<:content>
|
|
39
|
-
<p>
|
|
40
|
-
Une sidebar est, dans une interface graphique, une fenêtre qui prend le contrôle total du
|
|
41
|
-
clavier et de l'écran. Elle est en général associée à du paramétrage d'écran.
|
|
42
|
-
</p>
|
|
43
|
-
</:content>
|
|
44
|
-
<:footer>
|
|
45
|
-
{{! template-lint-disable no-inline-styles }}
|
|
46
|
-
<div style='display: flex; gap: 8px'>
|
|
47
|
-
<PixButton
|
|
48
|
-
@variant='secondary'
|
|
49
|
-
@isBorderVisible='true'
|
|
50
|
-
@triggerAction={{fn (mut this.showSidebar) (not this.showSidebar)}}
|
|
51
|
-
>Annuler</PixButton>
|
|
52
|
-
<PixButton
|
|
53
|
-
@triggerAction={{fn (mut this.showSidebar) (not this.showSidebar)}}
|
|
54
|
-
>Valider</PixButton>
|
|
55
|
-
</div>
|
|
56
|
-
</:footer>
|
|
57
|
-
</PixSidebar>
|
|
58
|
-
{{! template-lint-disable no-inline-styles }}
|
|
59
|
-
<div style='display:flex; justify-content:center; align-items:center; height:105vh;'>
|
|
60
|
-
<PixButton
|
|
61
|
-
@triggerAction={{fn (mut this.showSidebar) (not this.showSidebar)}}
|
|
62
|
-
style='height:45px'
|
|
63
|
-
>Ouvrir la sidebar</PixButton>
|
|
64
|
-
</div>`,
|
|
65
|
-
context: args,
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Default = Template.bind({});
|
|
70
|
-
Default.args = {
|
|
71
|
-
showSidebar: true,
|
|
72
|
-
title: 'Filtrer',
|
|
73
|
-
onClose: () => {},
|
|
74
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/addon-docs';
|
|
2
|
-
import * as ComponentStories from './pix-stars.stories.js';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Stars
|
|
7
|
-
|
|
8
|
-
Affiche une série d'étoiles en fonction des paramètres donnés.
|
|
9
|
-
Un texte alternatif peut être renseigné et différents styles sont pré-définis.
|
|
10
|
-
Pour ne pas afficher les étoiles vides, il suffit de ne pas donner le total d'étoiles.
|
|
11
|
-
|
|
12
|
-
<Story of={ComponentStories.stars} height={70} />
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```html
|
|
17
|
-
<PixStars @count="{{2}}" @total="{{5}}" @alt="message alternatif" @color="blue" />
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Arguments
|
|
21
|
-
|
|
22
|
-
<ArgTypes of={ComponentStories} />
|