@1024pix/pix-ui 46.0.3 → 46.1.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.
@@ -1,6 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { guidFor } from '@ember/object/internals';
3
3
  import { action } from '@ember/object';
4
+ import { warn } from '@ember/debug';
4
5
 
5
6
  export default class PixCheckbox extends Component {
6
7
  constructor() {
@@ -22,7 +23,15 @@ export default class PixCheckbox extends Component {
22
23
  }
23
24
 
24
25
  get isDisabled() {
25
- return this.args.isDisabled || this.args.disabled;
26
+ warn(
27
+ 'PixCheckbox: @isDisabled attribute should be a boolean.',
28
+ [true, false, undefined, null].includes(this.args.isDisabled),
29
+ {
30
+ id: 'pix-ui.checkbox.is-disabled.not-boolean',
31
+ },
32
+ );
33
+
34
+ return this.args.isDisabled || this.args.disabled ? 'true' : null;
26
35
  }
27
36
 
28
37
  @action
@@ -1,6 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { guidFor } from '@ember/object/internals';
3
3
  import { action } from '@ember/object';
4
+ import { warn } from '@ember/debug';
4
5
 
5
6
  export default class PixRadioButton extends Component {
6
7
  text = 'pix-radio-button';
@@ -10,7 +11,15 @@ export default class PixRadioButton extends Component {
10
11
  }
11
12
 
12
13
  get isDisabled() {
13
- return this.args.isDisabled || this.args.disabled;
14
+ warn(
15
+ 'PixRadioButton: @isDisabled attribute should be a boolean.',
16
+ [true, false, undefined, null].includes(this.args.isDisabled),
17
+ {
18
+ id: 'pix-ui.radio-button.is-disabled.not-boolean',
19
+ },
20
+ );
21
+
22
+ return this.args.isDisabled || this.args.disabled ? 'true' : null;
14
23
  }
15
24
 
16
25
  @action
@@ -98,9 +98,9 @@
98
98
  }
99
99
 
100
100
  // Disabled state
101
- &[aria-disabled],
101
+ &[aria-disabled='true'],
102
102
  &:disabled,
103
- &--indeterminate[aria-disabled],
103
+ &--indeterminate[aria-disabled='true'],
104
104
  &--indeterminate:disabled {
105
105
  background: var(--pix-neutral-100);
106
106
  border-color: var(--pix-neutral-100);
@@ -73,7 +73,7 @@
73
73
  }
74
74
 
75
75
  // Disabled state
76
- &[aria-disabled],
76
+ &[aria-disabled='true'],
77
77
  &:disabled {
78
78
  background: var(--pix-neutral-20);
79
79
  border-color: var(--pix-neutral-100);
@@ -28,6 +28,8 @@ En ce sens, nous avons déjà prévu un espace vertical pour séparer 2 composan
28
28
 
29
29
  ### Checkbox désactivée
30
30
 
31
+ L'attribut `@isDisabled` permet de désactiver la checkbox en conservant la possibilité de naviguer avec le clavier ou le lecteur d'écran. Il est préféré à l'attribut natif `disabled` qui empêche ces usages.
32
+
31
33
  <Story of={ComponentStories.isDisabled} height={60} />
32
34
  <Story of={ComponentStories.checkedIsDisabled} height={60} />
33
35
  <Story of={ComponentStories.isIndeterminateIsDisabled} height={60} />
@@ -44,10 +46,10 @@ En ce sens, nous avons déjà prévu un espace vertical pour séparer 2 composan
44
46
 
45
47
  ```html
46
48
  <PixCheckbox
47
- @screenReaderOnly="{{false}}"
48
- @isIndeterminate="{{false}}"
49
+ @screenReaderOnly={{false}}
50
+ @isIndeterminate={{false}}
49
51
  @size="small"
50
- disabled
52
+ @isDisabled={{true}}
51
53
  >
52
54
  <:label>Recevoir la newsletter</:label>
53
55
  </PixCheckbox>
@@ -26,7 +26,7 @@ Pour les considérer comme un seul groupe d'inputs, **il est nécessaire qu'ils
26
26
 
27
27
  ## Disabled
28
28
 
29
- État inactif du bouton radio.
29
+ L'attribut `@isDisabled` permet de désactiver la radio en conservant la possibilité de naviguer avec le clavier ou le lecteur d'écran. Il est préféré à l'attribut natif `disabled` qui empêche ces usages.
30
30
 
31
31
  <Story of={ComponentStories.isDisabled} height={60} />
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "46.0.3",
3
+ "version": "46.1.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"