@1024pix/pix-ui 45.5.1 → 46.0.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/addon/components/pix-button-base.js +4 -4
- package/addon/components/pix-checkbox.hbs +13 -11
- package/addon/components/pix-label.hbs +12 -6
- package/addon/components/pix-label.js +2 -2
- package/addon/components/pix-radio-button.hbs +13 -10
- package/addon/styles/_pix-button-base.scss +42 -41
- package/app/stories/form.stories.js +1 -6
- package/app/stories/pix-button-link.mdx +1 -1
- package/app/stories/pix-button-link.stories.js +11 -11
- package/app/stories/pix-button-upload.mdx +1 -1
- package/app/stories/pix-button-upload.stories.js +10 -10
- package/app/stories/pix-button.mdx +4 -10
- package/app/stories/pix-button.stories.js +30 -49
- package/app/stories/pix-checkbox.stories.js +2 -0
- package/app/stories/pix-modal.mdx +1 -1
- package/app/stories/pix-modal.stories.js +1 -1
- package/app/stories/pix-radio-button.stories.js +1 -0
- package/app/stories/pix-sidebar.mdx +1 -1
- package/app/stories/pix-sidebar.stories.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
|
|
3
3
|
export default class PixButtonBase extends Component {
|
|
4
|
-
get
|
|
5
|
-
return this.args.
|
|
4
|
+
get variant() {
|
|
5
|
+
return this.args.variant || 'primary';
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
get size() {
|
|
9
|
-
return this.args.size || '
|
|
9
|
+
return this.args.size || 'large';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
get baseClassNames() {
|
|
13
13
|
const classNames = [
|
|
14
14
|
'pix-button',
|
|
15
15
|
`pix-button--size-${this.size}`,
|
|
16
|
-
`pix-button--${this.
|
|
16
|
+
`pix-button--${this.variant}`,
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
this.args.isBorderVisible && classNames.push('pix-button--border');
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
<PixLabel
|
|
3
3
|
@for={{this.id}}
|
|
4
4
|
@requiredLabel={{@requiredLabel}}
|
|
5
|
+
@subLabel={{@subLabel}}
|
|
5
6
|
@size={{@size}}
|
|
6
7
|
@inlineLabel={{true}}
|
|
7
8
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
8
9
|
@isDisabled={{this.isDisabled}}
|
|
9
10
|
@wrappedElement={{true}}
|
|
10
11
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
<:inputElement>
|
|
13
|
+
<input
|
|
14
|
+
type="checkbox"
|
|
15
|
+
id={{this.id}}
|
|
16
|
+
class={{this.inputClasses}}
|
|
17
|
+
checked={{@checked}}
|
|
18
|
+
aria-disabled={{this.isDisabled}}
|
|
19
|
+
{{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
|
|
20
|
+
...attributes
|
|
21
|
+
/>
|
|
22
|
+
</:inputElement>
|
|
23
|
+
<:default>{{yield to="label"}}</:default>
|
|
22
24
|
</PixLabel>
|
|
23
25
|
</div>
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<label for={{@for}} class={{this.className}} ...attributes>
|
|
2
|
-
{{#if
|
|
3
|
-
|
|
2
|
+
{{#if (has-block "inputElement")}}
|
|
3
|
+
{{yield to="inputElement"}}
|
|
4
4
|
{{/if}}
|
|
5
5
|
|
|
6
|
-
{{
|
|
6
|
+
<span class={{if @screenReaderOnly "screen-reader-only"}}>
|
|
7
|
+
{{#if @requiredLabel}}
|
|
8
|
+
<abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
|
|
9
|
+
{{/if}}
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
{{yield}}
|
|
12
|
+
|
|
13
|
+
{{#if @subLabel}}
|
|
14
|
+
<span class="pix-label__sub-label">{{@subLabel}}</span>
|
|
15
|
+
{{/if}}
|
|
16
|
+
</span>
|
|
11
17
|
</label>
|
|
@@ -4,9 +4,9 @@ export default class PixLabel extends Component {
|
|
|
4
4
|
get className() {
|
|
5
5
|
const classes = ['pix-label'];
|
|
6
6
|
|
|
7
|
-
if (this.args.screenReaderOnly) classes.push('screen-reader-only');
|
|
8
7
|
if (this.args.wrappedElement) classes.push('pix-label--wrapped-element');
|
|
9
|
-
if (this.args.inlineLabel
|
|
8
|
+
if (this.args.inlineLabel && !this.args.screenReaderOnly)
|
|
9
|
+
classes.push('pix-label--inline-label');
|
|
10
10
|
if (this.args.isDisabled) classes.push('pix-label--disabled');
|
|
11
11
|
|
|
12
12
|
const size = ['small', 'large'].includes(this.args.size) ? this.args.size : 'default';
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
<PixLabel
|
|
3
3
|
@for={{this.id}}
|
|
4
4
|
@requiredLabel={{@requiredLabel}}
|
|
5
|
+
@subLabel={{@subLabel}}
|
|
5
6
|
@size={{@size}}
|
|
6
7
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
7
8
|
@isDisabled={{this.isDisabled}}
|
|
8
9
|
@inlineLabel={{true}}
|
|
9
10
|
@wrappedElement={{true}}
|
|
10
11
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
<:inputElement>
|
|
13
|
+
<input
|
|
14
|
+
type="radio"
|
|
15
|
+
id={{this.id}}
|
|
16
|
+
class="pix-radio-button__input"
|
|
17
|
+
value={{@value}}
|
|
18
|
+
aria-disabled={{this.isDisabled}}
|
|
19
|
+
{{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
|
|
20
|
+
...attributes
|
|
21
|
+
/>
|
|
22
|
+
</:inputElement>
|
|
23
|
+
<:default>{{yield to="label"}}</:default>
|
|
21
24
|
</PixLabel>
|
|
22
25
|
</div>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
&--size-
|
|
39
|
+
&--size-large {
|
|
40
40
|
padding: var(--pix-spacing-3x) var(--pix-spacing-6x);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -66,129 +66,130 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
&--
|
|
70
|
-
|
|
69
|
+
&--primary-bis {
|
|
70
|
+
color: var(--pix-neutral-900);
|
|
71
|
+
background-color: var(--pix-secondary-500);
|
|
71
72
|
|
|
72
73
|
&:not([aria-disabled="true"]) {
|
|
73
74
|
&:hover {
|
|
74
|
-
|
|
75
|
+
color: var(--pix-neutral-0);
|
|
76
|
+
background-color: var(--pix-secondary-700);
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
&:focus,
|
|
78
80
|
&:focus-visible {
|
|
79
|
-
|
|
81
|
+
color: var(--pix-neutral-0);
|
|
82
|
+
background-color: var(--pix-secondary-700);
|
|
80
83
|
outline: 1px solid var(--pix-neutral-0);
|
|
81
84
|
outline-offset: -4px;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
&:active {
|
|
85
|
-
|
|
88
|
+
color: var(--pix-neutral-0);
|
|
89
|
+
background-color: var(--pix-secondary-900);
|
|
86
90
|
outline: none;
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
&--secondary {
|
|
92
|
-
color: var(--pix-
|
|
93
|
-
background-color:
|
|
96
|
+
color: var(--pix-primary-700);
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
border: 2px solid var(--pix-primary-700);
|
|
94
99
|
|
|
95
100
|
&:not([aria-disabled="true"]) {
|
|
96
101
|
&:hover {
|
|
97
|
-
color: var(--pix-neutral-
|
|
98
|
-
background-color: var(--pix-
|
|
102
|
+
color: var(--pix-neutral-700);
|
|
103
|
+
background-color: var(--pix-primary-100);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
&:focus,
|
|
102
107
|
&:focus-visible {
|
|
103
|
-
color: var(--pix-
|
|
104
|
-
background-color: var(--pix-
|
|
105
|
-
outline: 1px solid var(--pix-
|
|
106
|
-
outline-offset: -
|
|
108
|
+
color: var(--pix-primary-900);
|
|
109
|
+
background-color: var(--pix-primary-100);
|
|
110
|
+
outline: 1px solid var(--pix-primary-700);
|
|
111
|
+
outline-offset: -5px;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
&:active {
|
|
110
115
|
color: var(--pix-neutral-0);
|
|
111
|
-
background-color: var(--pix-
|
|
116
|
+
background-color: var(--pix-primary-700);
|
|
112
117
|
outline: none;
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
|
|
117
|
-
&--
|
|
118
|
-
color: var(--pix-neutral-
|
|
119
|
-
background-color: var(--pix-
|
|
122
|
+
&--tertiary {
|
|
123
|
+
color: var(--pix-neutral-900);
|
|
124
|
+
background-color: var(--pix-neutral-20);
|
|
120
125
|
|
|
121
126
|
&:not([aria-disabled="true"]) {
|
|
122
127
|
&:hover {
|
|
123
|
-
background-color: var(--pix-
|
|
128
|
+
background-color: var(--pix-neutral-100);
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
&:focus,
|
|
127
132
|
&:focus-visible {
|
|
128
|
-
|
|
133
|
+
color: var(--pix-neutral-0);
|
|
134
|
+
background-color: var(--pix-neutral-900);
|
|
129
135
|
outline: 1px solid var(--pix-neutral-0);
|
|
130
136
|
outline-offset: -4px;
|
|
131
137
|
}
|
|
132
138
|
|
|
133
139
|
&:active {
|
|
134
|
-
|
|
140
|
+
color: var(--pix-neutral-900);
|
|
141
|
+
background-color: var(--pix-neutral-100);
|
|
135
142
|
outline: none;
|
|
136
143
|
}
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
146
|
|
|
140
|
-
&--
|
|
141
|
-
color: var(--pix-
|
|
142
|
-
background-color: var(--pix-neutral-20);
|
|
147
|
+
&--success {
|
|
148
|
+
background-color: var(--pix-success-500);
|
|
143
149
|
|
|
144
150
|
&:not([aria-disabled="true"]) {
|
|
145
151
|
&:hover {
|
|
146
|
-
background-color: var(--pix-
|
|
152
|
+
background-color: var(--pix-success-700);
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
&:focus,
|
|
150
156
|
&:focus-visible {
|
|
151
|
-
color: var(--pix-
|
|
152
|
-
background-color: var(--pix-neutral-900);
|
|
157
|
+
background-color: var(--pix-success-700);
|
|
153
158
|
outline: 1px solid var(--pix-neutral-0);
|
|
154
159
|
outline-offset: -4px;
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
&:active {
|
|
158
|
-
color: var(--pix-
|
|
159
|
-
background-color: var(--pix-neutral-100);
|
|
163
|
+
background-color: var(--pix-success-900);
|
|
160
164
|
outline: none;
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
168
|
|
|
165
|
-
&--
|
|
166
|
-
color: var(--pix-
|
|
167
|
-
background-color:
|
|
168
|
-
border: 2px solid var(--pix-primary-700);
|
|
169
|
+
&--error {
|
|
170
|
+
color: var(--pix-neutral-0);
|
|
171
|
+
background-color: var(--pix-error-500);
|
|
169
172
|
|
|
170
173
|
&:not([aria-disabled="true"]) {
|
|
171
174
|
&:hover {
|
|
172
|
-
color: var(--pix-
|
|
173
|
-
background-color: var(--pix-primary-100);
|
|
175
|
+
background-color: var(--pix-error-700);
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
&:focus,
|
|
177
179
|
&:focus-visible {
|
|
178
|
-
color: var(--pix-
|
|
179
|
-
|
|
180
|
-
outline:
|
|
181
|
-
outline-offset: -5px;
|
|
180
|
+
background-color: var(--pix-error-700);
|
|
181
|
+
outline: 1px solid var(--pix-neutral-0);
|
|
182
|
+
outline-offset: -4px;
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
&:active {
|
|
185
|
-
color: var(--pix-
|
|
186
|
-
background-color: var(--pix-primary-700);
|
|
186
|
+
background-color: var(--pix-error-900);
|
|
187
187
|
outline: none;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
// DO NOT USE DEPRECATED
|
|
192
193
|
&--transparent-dark {
|
|
193
194
|
color: var(--pix-neutral-0);
|
|
194
195
|
background-color: transparent;
|
|
@@ -92,12 +92,7 @@ export const form = (args) => {
|
|
|
92
92
|
|
|
93
93
|
<ul class='pix-form__actions'>
|
|
94
94
|
<li>
|
|
95
|
-
<PixButtonLink
|
|
96
|
-
@route=''
|
|
97
|
-
@model=''
|
|
98
|
-
@backgroundColor='transparent-light'
|
|
99
|
-
@isBorderVisible={{true}}
|
|
100
|
-
>
|
|
95
|
+
<PixButtonLink @route='' @model='' @variant='secondary' @isBorderVisible={{true}}>
|
|
101
96
|
Annuler
|
|
102
97
|
</PixButtonLink>
|
|
103
98
|
</li>
|
|
@@ -8,7 +8,7 @@ import * as ComponentStories from './pix-button-link.stories';
|
|
|
8
8
|
|
|
9
9
|
Affiche un lien avec le style d'un bouton Pix. Il peut être de type HTML ou Route EmberJS.
|
|
10
10
|
|
|
11
|
-
Hérite des styles de base de `PixButton` (`
|
|
11
|
+
Hérite des styles de base de `PixButton` (`variant`, `size`, `isBorderVisible`, `isDisabled`)
|
|
12
12
|
|
|
13
13
|
## Lien HTML
|
|
14
14
|
|
|
@@ -26,17 +26,17 @@ export default {
|
|
|
26
26
|
"Paramètre facultatif du <LinkTo> Ember permettant d'ajouter des paires de clé/valeur dans les paramètres d'une URL",
|
|
27
27
|
type: { required: false },
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
name: '
|
|
29
|
+
variant: {
|
|
30
|
+
name: 'variant',
|
|
31
31
|
description:
|
|
32
|
-
'color: `primary`, `secondary`, `success`, `error`, `
|
|
32
|
+
'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
|
|
33
33
|
options: [
|
|
34
34
|
'primary',
|
|
35
|
+
'primary-bis',
|
|
35
36
|
'secondary',
|
|
37
|
+
'tertiary',
|
|
36
38
|
'success',
|
|
37
39
|
'error',
|
|
38
|
-
'neutral',
|
|
39
|
-
'transparent-light',
|
|
40
40
|
'transparent-dark',
|
|
41
41
|
],
|
|
42
42
|
type: { name: 'string', required: false },
|
|
@@ -48,19 +48,19 @@ export default {
|
|
|
48
48
|
},
|
|
49
49
|
size: {
|
|
50
50
|
name: 'size',
|
|
51
|
-
description: 'taille: `
|
|
52
|
-
options: ['
|
|
51
|
+
description: 'taille: `large`,`small`',
|
|
52
|
+
options: ['large', 'small'],
|
|
53
53
|
type: { name: 'string', required: false },
|
|
54
54
|
control: { type: 'select' },
|
|
55
55
|
table: {
|
|
56
56
|
type: { summary: 'string' },
|
|
57
|
-
defaultValue: { summary: '
|
|
57
|
+
defaultValue: { summary: 'large' },
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
isBorderVisible: {
|
|
61
61
|
name: 'isBorderVisible',
|
|
62
62
|
description:
|
|
63
|
-
'Paramètre utilisé seulement quand le `
|
|
63
|
+
'Paramètre utilisé seulement quand le `variant` est `secondary` ou `transparent-dark`',
|
|
64
64
|
type: { name: 'boolean', required: false },
|
|
65
65
|
control: { type: 'boolean' },
|
|
66
66
|
table: {
|
|
@@ -85,7 +85,7 @@ export const htmlLink = {
|
|
|
85
85
|
template: hbs`<PixButtonLink
|
|
86
86
|
@href='https://pix.fr'
|
|
87
87
|
target='NEW'
|
|
88
|
-
@
|
|
88
|
+
@variant={{this.variant}}
|
|
89
89
|
@size={{this.size}}
|
|
90
90
|
@isBorderVisible={{this.isBorderVisible}}
|
|
91
91
|
@isDisabled={{this.isDisabled}}
|
|
@@ -102,7 +102,7 @@ export const emberLink = (args) => {
|
|
|
102
102
|
@route=''
|
|
103
103
|
@model=''
|
|
104
104
|
@query={{this.query}}
|
|
105
|
-
@
|
|
105
|
+
@variant={{this.variant}}
|
|
106
106
|
@size={{this.size}}
|
|
107
107
|
@isBorderVisible={{this.isBorderVisible}}
|
|
108
108
|
@isDisabled={{this.isDisabled}}
|
|
@@ -7,7 +7,7 @@ import * as ComponentStories from './pix-button-upload.stories';
|
|
|
7
7
|
|
|
8
8
|
Affiche un bouton d'upload de fichiers.
|
|
9
9
|
|
|
10
|
-
Hérite des styles de base de `PixButton` (`
|
|
10
|
+
Hérite des styles de base de `PixButton` (`variant`, `size`, `isBorderVisible`)
|
|
11
11
|
|
|
12
12
|
Toutes les [propriétés HTML d'un input de type file](https://developer.mozilla.org/fr/docs/Web/HTML/Element/Input/file) sont supportées.
|
|
13
13
|
|
|
@@ -15,17 +15,17 @@ export default {
|
|
|
15
15
|
"fonction à exécuter au moment de l'upload du fichier, elle prend en entrée la liste des fichiers uploadés.",
|
|
16
16
|
type: { name: 'function', required: true },
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
name: '
|
|
18
|
+
variant: {
|
|
19
|
+
name: 'variant',
|
|
20
20
|
description:
|
|
21
|
-
'color: `primary`, `
|
|
21
|
+
'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
|
|
22
22
|
options: [
|
|
23
23
|
'primary',
|
|
24
|
-
'
|
|
24
|
+
'primary-bis',
|
|
25
25
|
'secondary',
|
|
26
|
+
'tertiary',
|
|
27
|
+
'success',
|
|
26
28
|
'error',
|
|
27
|
-
'neutral',
|
|
28
|
-
'transparent-light',
|
|
29
29
|
'transparent-dark',
|
|
30
30
|
],
|
|
31
31
|
type: { name: 'string', required: false },
|
|
@@ -38,18 +38,18 @@ export default {
|
|
|
38
38
|
size: {
|
|
39
39
|
name: 'size',
|
|
40
40
|
description: 'taille: `big`,`small`',
|
|
41
|
-
options: ['
|
|
41
|
+
options: ['large', 'small'],
|
|
42
42
|
type: { name: 'string', required: false },
|
|
43
43
|
control: { type: 'select' },
|
|
44
44
|
table: {
|
|
45
45
|
type: { summary: 'string' },
|
|
46
|
-
defaultValue: { summary: '
|
|
46
|
+
defaultValue: { summary: 'large' },
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
isBorderVisible: {
|
|
50
50
|
name: 'isBorderVisible',
|
|
51
51
|
description:
|
|
52
|
-
'Paramètre utilisé seulement quand le `
|
|
52
|
+
'Paramètre utilisé seulement quand le `variant` est `secondary` ou `transparent-dark`',
|
|
53
53
|
type: { name: 'boolean', required: false },
|
|
54
54
|
control: { type: 'boolean' },
|
|
55
55
|
table: {
|
|
@@ -65,7 +65,7 @@ export const buttonUpload = (args) => {
|
|
|
65
65
|
template: hbs`<PixButtonUpload
|
|
66
66
|
@id={{this.id}}
|
|
67
67
|
@onChange={{this.onChange}}
|
|
68
|
-
@
|
|
68
|
+
@variant={{this.variant}}
|
|
69
69
|
@size={{this.size}}
|
|
70
70
|
@isBorderVisible={{this.isBorderVisible}}
|
|
71
71
|
>
|
|
@@ -11,17 +11,11 @@ Le bouton par défaut qui empêche les clics multiples.
|
|
|
11
11
|
|
|
12
12
|
<Story of={ComponentStories.Default} />
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Variants
|
|
15
15
|
|
|
16
|
-
Le bouton avec
|
|
16
|
+
Le bouton avec toutes ses variations
|
|
17
17
|
|
|
18
|
-
<Story of={ComponentStories.
|
|
19
|
-
|
|
20
|
-
## Colors
|
|
21
|
-
|
|
22
|
-
Le bouton avec toutes ses variations de couleur
|
|
23
|
-
|
|
24
|
-
<Story of={ComponentStories.colors} height={500} />
|
|
18
|
+
<Story of={ComponentStories.variants} height={500} />
|
|
25
19
|
|
|
26
20
|
## Icons
|
|
27
21
|
|
|
@@ -71,7 +65,7 @@ Un petit bouton avec les bords arrondis en fond transparent avec une bordure
|
|
|
71
65
|
@triggerAction="{{action"
|
|
72
66
|
triggerAction}}
|
|
73
67
|
@loadingColor="white"
|
|
74
|
-
@
|
|
68
|
+
@variant="secondary"
|
|
75
69
|
@isDisabled="{{false}}"
|
|
76
70
|
@size="small"
|
|
77
71
|
@isBorderVisible="{{true}}"
|
|
@@ -30,17 +30,17 @@ export default {
|
|
|
30
30
|
defaultValue: { summary: 'white' },
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
name: '
|
|
33
|
+
variant: {
|
|
34
|
+
name: 'variant',
|
|
35
35
|
description:
|
|
36
|
-
'color: `primary`, `secondary`, `success`, `error`, `
|
|
36
|
+
'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
|
|
37
37
|
options: [
|
|
38
38
|
'primary',
|
|
39
|
+
'primary-bis',
|
|
39
40
|
'secondary',
|
|
41
|
+
'tertiary',
|
|
40
42
|
'success',
|
|
41
43
|
'error',
|
|
42
|
-
'neutral',
|
|
43
|
-
'transparent-light',
|
|
44
44
|
'transparent-dark',
|
|
45
45
|
],
|
|
46
46
|
type: { name: 'string', required: false },
|
|
@@ -116,19 +116,19 @@ export default {
|
|
|
116
116
|
},
|
|
117
117
|
size: {
|
|
118
118
|
name: 'size',
|
|
119
|
-
description: 'taille: `
|
|
120
|
-
options: ['
|
|
119
|
+
description: 'taille: `large`,`small`',
|
|
120
|
+
options: ['large', 'small'],
|
|
121
121
|
type: { name: 'string', required: false },
|
|
122
122
|
control: { type: 'select' },
|
|
123
123
|
table: {
|
|
124
124
|
type: { summary: 'string' },
|
|
125
|
-
defaultValue: { summary: '
|
|
125
|
+
defaultValue: { summary: 'large' },
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
isBorderVisible: {
|
|
129
129
|
name: 'isBorderVisible',
|
|
130
130
|
description:
|
|
131
|
-
'Paramètre utilisé seulement quand le `
|
|
131
|
+
'Paramètre utilisé seulement quand le `variant` est `secondary` ou `transparent-dark`',
|
|
132
132
|
type: { name: 'boolean', required: false },
|
|
133
133
|
control: { type: 'boolean' },
|
|
134
134
|
table: {
|
|
@@ -144,7 +144,7 @@ const Template = (args) => ({
|
|
|
144
144
|
<PixButton
|
|
145
145
|
@triggerAction={{this.triggerAction}}
|
|
146
146
|
@loadingColor={{this.loadingColor}}
|
|
147
|
-
@
|
|
147
|
+
@variant={{this.variant}}
|
|
148
148
|
@isDisabled={{this.isDisabled}}
|
|
149
149
|
@isLoading={{this.isLoading}}
|
|
150
150
|
@size={{this.size}}
|
|
@@ -162,7 +162,7 @@ const Template = (args) => ({
|
|
|
162
162
|
<PixButton
|
|
163
163
|
@triggerAction={{this.triggerAction}}
|
|
164
164
|
@loadingColor={{button.loadingColor}}
|
|
165
|
-
@
|
|
165
|
+
@variant={{button.variant}}
|
|
166
166
|
@isDisabled={{button.isDisabled}}
|
|
167
167
|
@isLoading={{button.isLoading}}
|
|
168
168
|
@size={{button.size}}
|
|
@@ -182,66 +182,47 @@ const Template = (args) => ({
|
|
|
182
182
|
export const Default = Template.bind({});
|
|
183
183
|
Default.args = {
|
|
184
184
|
loadingColor: 'white',
|
|
185
|
-
size: '
|
|
186
|
-
|
|
185
|
+
size: 'large',
|
|
186
|
+
variant: 'primary',
|
|
187
187
|
label: 'Bouton',
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
export const
|
|
191
|
-
|
|
190
|
+
export const variants = Template.bind({});
|
|
191
|
+
variants.args = {
|
|
192
192
|
...Default.args,
|
|
193
|
-
label: 'Bouton
|
|
194
|
-
backgroundColor: 'transparent-light',
|
|
195
|
-
loadingColor: 'grey',
|
|
196
|
-
isBorderVisible: true,
|
|
197
|
-
extraButtons: [
|
|
198
|
-
{
|
|
199
|
-
...Default.args,
|
|
200
|
-
label: 'Bouton avec bordure sur fond sombre',
|
|
201
|
-
style: 'background-color: #775555',
|
|
202
|
-
backgroundColor: 'transparent-dark',
|
|
203
|
-
isBorderVisible: true,
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
export const colors = Template.bind({});
|
|
209
|
-
colors.args = {
|
|
210
|
-
...Default.args,
|
|
211
|
-
label: 'Bouton avec background primary (default)',
|
|
193
|
+
label: 'Bouton primary (default)',
|
|
212
194
|
extraButtons: [
|
|
213
195
|
{
|
|
214
196
|
...Default.args,
|
|
215
|
-
label: 'Bouton
|
|
216
|
-
|
|
197
|
+
label: 'Bouton primary-bis',
|
|
198
|
+
variant: 'primary-bis',
|
|
199
|
+
loadingColor: 'grey',
|
|
217
200
|
},
|
|
218
201
|
{
|
|
219
202
|
...Default.args,
|
|
220
|
-
label: 'Bouton
|
|
221
|
-
|
|
203
|
+
label: 'Bouton secondary',
|
|
204
|
+
variant: 'secondary',
|
|
222
205
|
},
|
|
223
206
|
{
|
|
224
207
|
...Default.args,
|
|
225
|
-
label: 'Bouton
|
|
226
|
-
|
|
208
|
+
label: 'Bouton tertiary',
|
|
209
|
+
variant: 'tertiary',
|
|
227
210
|
},
|
|
228
211
|
{
|
|
229
212
|
...Default.args,
|
|
230
|
-
label: 'Bouton
|
|
231
|
-
|
|
213
|
+
label: 'Bouton success',
|
|
214
|
+
variant: 'success',
|
|
232
215
|
},
|
|
233
216
|
{
|
|
234
217
|
...Default.args,
|
|
235
|
-
label: 'Bouton
|
|
236
|
-
|
|
237
|
-
loadingColor: 'grey',
|
|
238
|
-
isBorderVisible: true,
|
|
218
|
+
label: 'Bouton error',
|
|
219
|
+
variant: 'error',
|
|
239
220
|
},
|
|
240
221
|
{
|
|
241
222
|
...Default.args,
|
|
242
|
-
label: 'Bouton avec bordure sur fond sombre',
|
|
223
|
+
label: 'Bouton avec bordure sur fond sombre (DEPRECATED)',
|
|
243
224
|
style: 'background-color: #775555',
|
|
244
|
-
|
|
225
|
+
variant: 'transparent-dark',
|
|
245
226
|
isBorderVisible: true,
|
|
246
227
|
},
|
|
247
228
|
],
|
|
@@ -265,7 +246,7 @@ export const loader = Template.bind({});
|
|
|
265
246
|
loader.args = {
|
|
266
247
|
...Default.args,
|
|
267
248
|
label: 'Bouton avec loader au clic',
|
|
268
|
-
|
|
249
|
+
variant: 'primary-bis',
|
|
269
250
|
loadingColor: 'grey',
|
|
270
251
|
triggerAction: () => {
|
|
271
252
|
return new Promise((resolve) => {
|
|
@@ -97,6 +97,8 @@ const Template = (args) => {
|
|
|
97
97
|
@isDisabled={{this.isDisabled}}
|
|
98
98
|
disabled={{this.disabled}}
|
|
99
99
|
@size={{this.size}}
|
|
100
|
+
@subLabel={{this.subLabel}}
|
|
101
|
+
@requiredLabel={{this.requiredLabel}}
|
|
100
102
|
@inlineLabel={{this.inlineLabel}}
|
|
101
103
|
@screenReaderOnly={{this.screenReaderOnly}}
|
|
102
104
|
>
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
style='display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 16px'
|
|
26
26
|
>
|
|
27
27
|
<PixButton
|
|
28
|
-
@
|
|
28
|
+
@variant='secondary'
|
|
29
29
|
@isBorderVisible='true'
|
|
30
30
|
@triggerAction={{fn (mut this.showModal) (not this.showModal)}}
|
|
31
31
|
>Annuler</PixButton>
|
|
@@ -45,7 +45,7 @@ const Template = (args) => {
|
|
|
45
45
|
{{! template-lint-disable no-inline-styles }}
|
|
46
46
|
<div style='display: flex; gap: 8px'>
|
|
47
47
|
<PixButton
|
|
48
|
-
@
|
|
48
|
+
@variant='secondary'
|
|
49
49
|
@isBorderVisible='true'
|
|
50
50
|
@triggerAction={{fn (mut this.showSidebar) (not this.showSidebar)}}
|
|
51
51
|
>Annuler</PixButton>
|