@1024pix/pix-ui 55.25.15 → 55.26.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.
@@ -2,6 +2,7 @@
2
2
  type="button"
3
3
  class="pix-icon-button pix-icon-button--{{this.size}}"
4
4
  {{on "click" this.triggerAction}}
5
+ aria-disabled="{{this.isDisabled}}"
5
6
  ...attributes
6
7
  >
7
8
  <span class="screen-reader-only">{{this.ariaLabel}}</span>
@@ -13,6 +13,18 @@ export default class PixIconButton extends Component {
13
13
  return this.args.color || 'light-grey';
14
14
  }
15
15
 
16
+ get isDisabled() {
17
+ warn(
18
+ 'PixIconButton: @isDisabled attribute should be a boolean.',
19
+ [true, false, undefined, null].includes(this.args.isDisabled),
20
+ {
21
+ id: 'pix-ui.icon-button.is-disabled.not-boolean',
22
+ },
23
+ );
24
+
25
+ return this.args.isDisabled ? 'true' : null;
26
+ }
27
+
16
28
  get ariaLabel() {
17
29
  warn(
18
30
  'PixIconButton: @label attribute should be a string.',
@@ -27,6 +39,8 @@ export default class PixIconButton extends Component {
27
39
 
28
40
  @action
29
41
  triggerAction(params) {
42
+ if (this.isDisabled) return;
43
+
30
44
  if (this.args.triggerAction) {
31
45
  this.args.triggerAction(params);
32
46
  }
@@ -23,27 +23,30 @@
23
23
  }
24
24
  }
25
25
 
26
+ &[aria-disabled='true'],
26
27
  &:disabled {
27
28
  cursor: not-allowed;
28
29
  opacity: 0.5;
29
30
  }
30
31
 
31
- &:hover:enabled {
32
- background-color: var(--pix-neutral-20);
33
- outline: 0;
34
- }
32
+ &:not([aria-disabled='true']) {
33
+ &:hover:enabled {
34
+ background-color: var(--pix-neutral-20);
35
+ outline: 0;
36
+ }
35
37
 
36
- &:focus:enabled {
37
- color: var(--pix-neutral-0);
38
- background-color: var(--pix-neutral-800);
39
- outline: 1px solid var(--pix-neutral-0);
40
- outline-offset: -3px;
41
- }
38
+ &:focus:enabled {
39
+ color: var(--pix-neutral-0);
40
+ background-color: var(--pix-neutral-800);
41
+ outline: 1px solid var(--pix-neutral-0);
42
+ outline-offset: -3px;
43
+ }
42
44
 
43
- &:active:enabled {
44
- color: var(--pix-neutral-800);
45
- background-color: var(--pix-neutral-100);
46
- outline: 0;
45
+ &:active:enabled {
46
+ color: var(--pix-neutral-800);
47
+ background-color: var(--pix-neutral-100);
48
+ outline: 0;
49
+ }
47
50
  }
48
51
 
49
52
  &--small {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "55.25.15",
3
+ "version": "55.26.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"