@1024pix/pix-ui 46.0.2 → 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.
- package/addon/components/pix-checkbox.js +10 -1
- package/addon/components/pix-radio-button.js +10 -1
- package/addon/styles/_pix-checkbox.scss +2 -2
- package/addon/styles/_pix-radio-button.scss +1 -1
- package/app/stories/pix-checkbox.mdx +5 -3
- package/app/stories/pix-radio-button.mdx +1 -1
- package/package.json +2 -2
|
@@ -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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -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=
|
|
48
|
-
@isIndeterminate=
|
|
49
|
+
@screenReaderOnly={{false}}
|
|
50
|
+
@isIndeterminate={{false}}
|
|
49
51
|
@size="small"
|
|
50
|
-
|
|
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
|
-
|
|
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
|
+
"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"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"author": "GIP Pix",
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": "^20.13.
|
|
11
|
+
"node": "^20.13.1"
|
|
12
12
|
},
|
|
13
13
|
"ember": {
|
|
14
14
|
"edition": "octane"
|