@1024pix/pix-ui 45.5.2 → 46.0.1

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.
@@ -1,19 +1,19 @@
1
1
  import Component from '@glimmer/component';
2
2
 
3
3
  export default class PixButtonBase extends Component {
4
- get backgroundColor() {
5
- return this.args.backgroundColor || 'primary';
4
+ get variant() {
5
+ return this.args.variant || 'primary';
6
6
  }
7
7
 
8
8
  get size() {
9
- return this.args.size || 'big';
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.backgroundColor}`,
16
+ `pix-button--${this.variant}`,
17
17
  ];
18
18
 
19
19
  this.args.isBorderVisible && classNames.push('pix-button--border');
@@ -36,7 +36,7 @@
36
36
  }
37
37
  }
38
38
 
39
- &--size-big {
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
- &--success {
70
- background-color: var(--pix-success-500);
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
- background-color: var(--pix-success-700);
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
- background-color: var(--pix-success-700);
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
- background-color: var(--pix-success-900);
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-neutral-900);
93
- background-color: var(--pix-secondary-500);
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-0);
98
- background-color: var(--pix-secondary-700);
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-neutral-0);
104
- background-color: var(--pix-secondary-700);
105
- outline: 1px solid var(--pix-neutral-0);
106
- outline-offset: -4px;
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-secondary-900);
116
+ background-color: var(--pix-primary-700);
112
117
  outline: none;
113
118
  }
114
119
  }
115
120
  }
116
121
 
117
- &--error {
118
- color: var(--pix-neutral-0);
119
- background-color: var(--pix-error-500);
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-error-700);
128
+ background-color: var(--pix-neutral-100);
124
129
  }
125
130
 
126
131
  &:focus,
127
132
  &:focus-visible {
128
- background-color: var(--pix-error-700);
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
- background-color: var(--pix-error-900);
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
- &--neutral {
141
- color: var(--pix-neutral-900);
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-neutral-100);
152
+ background-color: var(--pix-success-700);
147
153
  }
148
154
 
149
155
  &:focus,
150
156
  &:focus-visible {
151
- color: var(--pix-neutral-0);
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-neutral-900);
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
- &--transparent-light {
166
- color: var(--pix-primary-700);
167
- background-color: transparent;
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-neutral-700);
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-primary-900);
179
- background-color: var(--pix-primary-100);
180
- outline: 1px solid var(--pix-primary-700);
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-neutral-0);
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` (`backgroundColor`, `size`, `isBorderVisible`, `isDisabled`)
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
- backgroundColor: {
30
- name: 'backgroundColor',
29
+ variant: {
30
+ name: 'variant',
31
31
  description:
32
- 'color: `primary`, `secondary`, `success`, `error`, `neutral`, `transparent-light`, `transparent-dark`',
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: `big`,`small`',
52
- options: ['big', 'small'],
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: 'big' },
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 `backgroundColor` est `transparent-light` ou `transparent-dark`',
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
- @backgroundColor={{this.backgroundColor}}
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
- @backgroundColor={{this.backgroundColor}}
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` (`backgroundColor`, `size`, `isBorderVisible`)
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
- backgroundColor: {
19
- name: 'backgroundColor',
18
+ variant: {
19
+ name: 'variant',
20
20
  description:
21
- 'color: `primary`, `success`, `secondary`, `error`, `neutral`, `transparent-light`, `transparent-dark`',
21
+ 'color: `primary`, `primary-bis`, `secondary`,`tertiary`, `success`, `error`, `transparent-dark`',
22
22
  options: [
23
23
  'primary',
24
- 'success',
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: ['big', 'small'],
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: 'big' },
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 `backgroundColor` est `transparent-light` ou `transparent-dark`',
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
- @backgroundColor={{this.backgroundColor}}
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
- ## Borders
14
+ ## Variants
15
15
 
16
- Le bouton avec bordures et fond transparent
16
+ Le bouton avec toutes ses variations
17
17
 
18
- <Story of={ComponentStories.borders} height={150} />
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
- @backgroundColor="transparent-light"
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
- backgroundColor: {
34
- name: 'backgroundColor',
33
+ variant: {
34
+ name: 'variant',
35
35
  description:
36
- 'color: `primary`, `secondary`, `success`, `error`, `neutral`, `transparent-light`, `transparent-dark`',
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: `big`,`small`',
120
- options: ['big', 'small'],
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: 'big' },
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 `backgroundColor` est `transparent-light` ou `transparent-dark`',
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
- @backgroundColor={{this.backgroundColor}}
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
- @backgroundColor={{button.backgroundColor}}
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: 'big',
186
- backgroundColor: 'primary',
185
+ size: 'large',
186
+ variant: 'primary',
187
187
  label: 'Bouton',
188
188
  };
189
189
 
190
- export const borders = Template.bind({});
191
- borders.args = {
190
+ export const variants = Template.bind({});
191
+ variants.args = {
192
192
  ...Default.args,
193
- label: 'Bouton avec bordure sur fond clair',
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 avec background success',
216
- backgroundColor: 'success',
197
+ label: 'Bouton primary-bis',
198
+ variant: 'primary-bis',
199
+ loadingColor: 'grey',
217
200
  },
218
201
  {
219
202
  ...Default.args,
220
- label: 'Bouton avec background secondary',
221
- backgroundColor: 'secondary',
203
+ label: 'Bouton secondary',
204
+ variant: 'secondary',
222
205
  },
223
206
  {
224
207
  ...Default.args,
225
- label: 'Bouton avec background error',
226
- backgroundColor: 'error',
208
+ label: 'Bouton tertiary',
209
+ variant: 'tertiary',
227
210
  },
228
211
  {
229
212
  ...Default.args,
230
- label: 'Bouton avec background neutral',
231
- backgroundColor: 'neutral',
213
+ label: 'Bouton success',
214
+ variant: 'success',
232
215
  },
233
216
  {
234
217
  ...Default.args,
235
- label: 'Bouton avec bordure sur fond clair',
236
- backgroundColor: 'transparent-light',
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
- backgroundColor: 'transparent-dark',
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
- backgroundColor: 'yellow',
249
+ variant: 'primary-bis',
269
250
  loadingColor: 'grey',
270
251
  triggerAction: () => {
271
252
  return new Promise((resolve) => {
@@ -37,7 +37,7 @@ Ce composant possède deux `yield` :
37
37
  </:content>
38
38
  <:footer>
39
39
  <PixButton
40
- @backgroundColor="transparent-light"
40
+ @variant="secondary"
41
41
  @isBorderVisible={{true}}
42
42
  @triggerAction={{this.closeModal}}
43
43
  >
@@ -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
- @backgroundColor='transparent-light'
28
+ @variant='secondary'
29
29
  @isBorderVisible='true'
30
30
  @triggerAction={{fn (mut this.showModal) (not this.showModal)}}
31
31
  >Annuler</PixButton>
@@ -33,7 +33,7 @@ Ce composant possède deux `yield` :
33
33
  </:content>
34
34
  <:footer>
35
35
  <PixButton
36
- @backgroundColor="transparent-light"
36
+ @variant="secondary"
37
37
  @isBorderVisible={{true}}
38
38
  @triggerAction={{this.closeSidebar}}
39
39
  >
@@ -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
- @backgroundColor='transparent-light'
48
+ @variant='secondary'
49
49
  @isBorderVisible='true'
50
50
  @triggerAction={{fn (mut this.showSidebar) (not this.showSidebar)}}
51
51
  >Annuler</PixButton>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "45.5.2",
3
+ "version": "46.0.1",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -8,7 +8,7 @@
8
8
  "license": "MIT",
9
9
  "author": "GIP Pix",
10
10
  "engines": {
11
- "node": "^20.12.2"
11
+ "node": "^20.13.0"
12
12
  },
13
13
  "ember": {
14
14
  "edition": "octane"