@1024pix/pix-ui 17.2.0 → 17.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Pix-UI Changelog
2
2
 
3
+ ## v17.2.1 (31/08/2022)
4
+
5
+
6
+ ### :rocket: Amélioration
7
+ - [#247](https://github.com/1024pix/pix-ui/pull/247) [FEATURE] Amélioration couleurs `PixIconButton`
8
+
3
9
  ## v17.2.0 (24/08/2022)
4
10
 
5
11
 
@@ -32,9 +32,9 @@
32
32
  .pix-icon-button {
33
33
  background-color: $pix-primary-5;
34
34
  color: $pix-primary-70;
35
- &:hover,
36
- &:focus,
37
- &:active {
35
+ &:hover:enabled,
36
+ &:focus:enabled,
37
+ &:active:enabled {
38
38
  background-color: $pix-primary-10;
39
39
  color: $pix-primary-70;
40
40
  }
@@ -47,9 +47,9 @@
47
47
  .pix-icon-button {
48
48
  background-color: $pix-warning-5;
49
49
  color: $pix-warning-70;
50
- &:hover,
51
- &:focus,
52
- &:active {
50
+ &:hover:enabled,
51
+ &:focus:enabled,
52
+ &:active:enabled {
53
53
  background-color: $pix-warning-10;
54
54
  color: $pix-warning-70;
55
55
  }
@@ -62,9 +62,9 @@
62
62
  .pix-icon-button {
63
63
  background-color: $pix-error-5;
64
64
  color: $pix-error-70;
65
- &:hover,
66
- &:focus,
67
- &:active {
65
+ &:hover:enabled,
66
+ &:focus:enabled,
67
+ &:active:enabled {
68
68
  background-color: $pix-error-10;
69
69
  color: $pix-error-70;
70
70
  }
@@ -10,35 +10,36 @@
10
10
  align-items: center;
11
11
  justify-content: center;
12
12
  background-color: transparent;
13
+ color: $pix-neutral-60;
13
14
 
14
15
  &:disabled {
15
16
  opacity: 0.5;
16
- cursor: default;
17
+ cursor: not-allowed;
17
18
  }
18
19
 
19
- &:hover,
20
- &:focus {
21
- transition: background-color 0.2s ease;
22
- background-color: $pix-neutral-15;
23
- &:disabled {
24
- background-color: transparent;
25
- }
20
+ &:hover:enabled {
21
+ background-color: $pix-neutral-20;
22
+ box-shadow: none;
23
+ border: 0;
24
+ color: $pix-neutral-60;
26
25
  }
27
26
 
28
- &:active {
29
- transition: background-color 0.2s ease;
30
- background-color: $pix-neutral-20;
27
+ &:focus:enabled {
28
+ background-color: $pix-neutral-60;
29
+ box-shadow: 0 0 0 2px $pix-neutral-60;
30
+ border: 2px solid $pix-neutral-0;
31
+ color: $pix-neutral-0;
32
+ }
33
+
34
+ &:active:enabled {
35
+ background-color: $pix-neutral-22;
36
+ box-shadow: none;
37
+ border: 0;
38
+ color: $pix-neutral-60;
31
39
  }
32
40
 
33
41
  &--background {
34
42
  background-color: $pix-neutral-10;
35
- &:hover,
36
- &:focus,
37
- &:active {
38
- &:disabled {
39
- background-color: $pix-neutral-15;
40
- }
41
- }
42
43
  }
43
44
 
44
45
  &--small {
@@ -52,12 +53,4 @@
52
53
  height: 38px;
53
54
  font-size: 1.25rem;
54
55
  }
55
-
56
- &--dark-grey {
57
- color: $pix-neutral-60;
58
- }
59
-
60
- &--light-grey {
61
- color: $pix-neutral-60;
62
- }
63
56
  }
@@ -11,31 +11,42 @@ const Template = (args) => {
11
11
  @triggerAction={{triggerAction}}
12
12
  @withBackground={{withBackground}}
13
13
  @size={{size}}
14
+ disabled={{disabled}}
15
+ aria-disabled={{disabled}}
14
16
  />
15
17
  `,
16
18
  context: args,
17
19
  };
18
20
  };
19
21
 
22
+ const triggerAction = () => Promise.resolve();
23
+
20
24
  export const Default = Template.bind({});
21
25
  Default.args = {
22
26
  ariaLabel: 'Action du bouton',
23
27
  icon: 'xmark',
24
- triggerAction: () => {
25
- return new Promise().resolves();
26
- },
28
+ triggerAction,
27
29
  };
28
30
 
29
31
  export const small = Template.bind({});
30
32
  small.args = {
31
33
  ...Default.args,
32
34
  size: 'small',
35
+ triggerAction,
33
36
  };
34
37
 
35
38
  export const withBackground = Template.bind({});
36
39
  withBackground.args = {
37
40
  ...Default.args,
38
41
  withBackground: true,
42
+ triggerAction,
43
+ };
44
+
45
+ export const disabled = Template.bind({});
46
+ disabled.args = {
47
+ ...Default.args,
48
+ disabled: true,
49
+ triggerAction,
39
50
  };
40
51
 
41
52
  export const argTypes = {
@@ -3,8 +3,8 @@ import centered from '@storybook/addon-centered/ember';
3
3
  import * as stories from './pix-icon-button.stories.js';
4
4
 
5
5
  <Meta
6
- title='Basics/Icon button'
7
- component='PixIconButton'
6
+ title="Basics/Icon button"
7
+ component="PixIconButton"
8
8
  decorators={[centered]}
9
9
  argTypes={stories.argTypes}
10
10
  />
@@ -37,6 +37,14 @@ Le bouton avec le fond grisé.
37
37
  <Story name="With Background" story={stories.withBackground} height={60} />
38
38
  </Canvas>
39
39
 
40
+ ## Disabled
41
+
42
+ Exemple avec le bouton disabled
43
+
44
+ <Canvas>
45
+ <Story name="Disabled" story={stories.disabled} height={60} />
46
+ </Canvas>
47
+
40
48
  ## Accessibilité / aria-label
41
49
 
42
50
  L'attribut `aria-label` étant indispensable pour l'accessibilité de ce composant, la propriété `ariaLabel` a été ajouté.
@@ -48,42 +56,42 @@ L'attribut `aria-label` étant indispensable pour l'accessibilité de ce composa
48
56
  ## Usage
49
57
 
50
58
  Par défaut
59
+
51
60
  ```html
52
- <PixIconButton
53
- @ariaLabel="L'action du bouton"
54
- @icon="icon"
55
- @triggerAction={{triggerAction}}
56
- />
61
+ <PixIconButton @ariaLabel="L'action du bouton" @icon="icon" @triggerAction="{{triggerAction}}" />
57
62
  ```
58
63
 
59
64
  Bouton de fermeture
65
+
60
66
  ```html
61
67
  <PixIconButton
62
- @ariaLabel="L'action du bouton"
63
- @icon="times"
64
- @triggerAction={{triggerAction}}
65
- @withBackground={{true}}
68
+ @ariaLabel="L'action du bouton"
69
+ @icon="times"
70
+ @triggerAction="{{triggerAction}}"
71
+ @withBackground="{{true}}"
66
72
  />
67
73
  ```
68
74
 
69
75
  Bouton d'action
76
+
70
77
  ```html
71
78
  <PixIconButton
72
- @ariaLabel="L'action du bouton"
73
- @icon="arrow-left"
74
- @triggerAction={{triggerAction}}
75
- @size="small"
76
- @withBackground={{true}}
79
+ @ariaLabel="L'action du bouton"
80
+ @icon="arrow-left"
81
+ @triggerAction="{{triggerAction}}"
82
+ @size="small"
83
+ @withBackground="{{true}}"
77
84
  />
78
85
  ```
79
86
 
80
87
  État disabled
88
+
81
89
  ```html
82
90
  <PixIconButton
83
- @ariaLabel="L'action du bouton"
84
- @icon="xmark"
85
- disabled={{true}}
86
- aria-disabled={{true}}
91
+ @ariaLabel="L'action du bouton"
92
+ @icon="xmark"
93
+ disabled="{{true}}"
94
+ aria-disabled="{{true}}"
87
95
  />
88
96
  ```
89
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "17.2.0",
3
+ "version": "17.2.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"