@1024pix/pix-ui 33.0.0 → 34.0.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/.circleci/config.yml +1 -1
- package/.storybook/main.js +3 -8
- package/CHANGELOG.md +20 -1
- package/addon/components/pix-checkbox.hbs +10 -11
- package/addon/components/pix-checkbox.js +4 -3
- package/addon/components/pix-radio-button.hbs +11 -5
- package/addon/components/pix-radio-button.js +5 -0
- package/addon/styles/_pix-checkbox.scss +2 -1
- package/addon/styles/_pix-radio-button.scss +3 -1
- package/addon/styles/_pix-selectable-tag.scss +7 -4
- package/addon/styles/_pix-tag.scss +9 -3
- package/app/stories/pix-checkbox.stories.js +7 -3
- package/app/stories/pix-checkbox.stories.mdx +0 -1
- package/app/stories/pix-radio-button.stories.js +29 -9
- package/app/stories/pix-radio-button.stories.mdx +2 -7
- package/package.json +3 -3
package/.circleci/config.yml
CHANGED
package/.storybook/main.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
addons: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
],
|
|
6
|
-
stories: [
|
|
7
|
-
'../docs/**/*.stories.@(mdx)',
|
|
8
|
-
'../app/**/*.stories.@(js|mdx)',
|
|
9
|
-
],
|
|
2
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
|
|
3
|
+
stories: ['../docs/**/*.stories.@(mdx)', '../app/**/*.stories.@(js|mdx)'],
|
|
4
|
+
staticDirs: ['../dist'],
|
|
10
5
|
core: {
|
|
11
6
|
builder: 'webpack5',
|
|
12
7
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
# Pix-UI Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## v34.0.0 (04/05/2023)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### :rocket: Amélioration
|
|
7
|
+
- [#393](https://github.com/1024pix/pix-ui/pull/393) [FEATURE] Uniformiser PixRadioButton et PixCheckbox (PIX-7900)
|
|
8
|
+
|
|
9
|
+
### :building_construction: Tech
|
|
10
|
+
- [#354](https://github.com/1024pix/pix-ui/pull/354) [TECH] Améliorer l'expérience de dev
|
|
11
|
+
- [#394](https://github.com/1024pix/pix-ui/pull/394) [TECH] Rendre Chromatic non bloquant lors du run de la CI (PIX-7932)
|
|
12
|
+
|
|
13
|
+
### :bug: Correction
|
|
14
|
+
- [#392](https://github.com/1024pix/pix-ui/pull/392) [BUGFIX] Éviter le rétrécissement des inputs checkbox et radio (PIX-7896).
|
|
15
|
+
|
|
16
|
+
## v33.1.0 (27/04/2023)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### :rocket: Amélioration
|
|
20
|
+
- [#391](https://github.com/1024pix/pix-ui/pull/391) [FEATURE] Améliorer la lisibilité des tags (PIX-7827)
|
|
21
|
+
|
|
22
|
+
## v33.0.0 (27/04/2023)
|
|
4
23
|
|
|
5
24
|
|
|
6
25
|
### :rocket: Amélioration
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div class="pix-checkbox {{@class}}">
|
|
2
2
|
<input
|
|
3
|
-
id={{@id}}
|
|
4
3
|
type="checkbox"
|
|
4
|
+
id={{this.id}}
|
|
5
5
|
class={{this.inputClasses}}
|
|
6
6
|
checked={{@checked}}
|
|
7
7
|
...attributes
|
|
8
8
|
/>
|
|
9
9
|
|
|
10
|
-
{{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
yield required to give a label for PixCheckbox
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</label>
|
|
10
|
+
<label class={{this.labelClasses}} for={{this.id}}>
|
|
11
|
+
{{#if (has-block)}}
|
|
12
|
+
{{yield}}
|
|
13
|
+
{{else}}
|
|
14
|
+
<span>yield required to give a label for PixCheckbox.</span>
|
|
15
|
+
{{/if}}
|
|
16
|
+
</label>
|
|
17
|
+
</div>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import { guidFor } from '@ember/object/internals';
|
|
2
3
|
|
|
3
4
|
export default class PixCheckbox extends Component {
|
|
4
5
|
constructor() {
|
|
5
6
|
super(...arguments);
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
9
|
+
get id() {
|
|
10
|
+
return this.args.id || guidFor(this);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
get inputClasses() {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div class="pix-radio-button {{@class}}">
|
|
2
2
|
<input
|
|
3
|
-
class="pix-radio-button__input"
|
|
4
3
|
type="radio"
|
|
4
|
+
id={{this.id}}
|
|
5
|
+
class="pix-radio-button__input"
|
|
5
6
|
value={{@value}}
|
|
6
|
-
disabled={{@isDisabled}}
|
|
7
7
|
...attributes
|
|
8
8
|
/>
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<label class="pix-radio-button__label" for={{this.id}}>
|
|
10
|
+
{{#if (has-block)}}
|
|
11
|
+
{{yield}}
|
|
12
|
+
{{else}}
|
|
13
|
+
<span>yield required to give a label for PixRadioButton.</span>
|
|
14
|
+
{{/if}}
|
|
15
|
+
</label>
|
|
16
|
+
</div>
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
align-items: center;
|
|
5
5
|
display: flex;
|
|
6
6
|
color: $pix-neutral-70;
|
|
7
|
-
cursor: pointer;
|
|
8
7
|
|
|
9
8
|
& + .pix-checkbox {
|
|
10
9
|
margin-top: $pix-spacing-s;
|
|
@@ -17,6 +16,7 @@
|
|
|
17
16
|
color: $pix-neutral-90;
|
|
18
17
|
font-size: 1rem;
|
|
19
18
|
line-height: 1.5;
|
|
19
|
+
cursor: pointer;
|
|
20
20
|
|
|
21
21
|
&--small {
|
|
22
22
|
font-size: 0.875rem;
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
position: relative;
|
|
33
33
|
width: 1rem;
|
|
34
34
|
height: 1rem;
|
|
35
|
+
flex-shrink: 0;
|
|
35
36
|
background-color: $pix-neutral-0;
|
|
36
37
|
border: 1.5px solid $pix-neutral-70;
|
|
37
38
|
border-radius: 2px;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.pix-radio-button {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
cursor: pointer;
|
|
5
4
|
|
|
6
5
|
& + .pix-radio-button {
|
|
7
6
|
margin-top: $pix-spacing-s;
|
|
@@ -12,16 +11,19 @@
|
|
|
12
11
|
color: $pix-neutral-90;
|
|
13
12
|
font-size: 1rem;
|
|
14
13
|
line-height: 1.5;
|
|
14
|
+
cursor: pointer;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&__input {
|
|
18
18
|
position: relative;
|
|
19
19
|
width: 1rem;
|
|
20
20
|
height: 1rem;
|
|
21
|
+
flex-shrink: 0;
|
|
21
22
|
background-color: $pix-neutral-0;
|
|
22
23
|
border: 1.5px solid $pix-neutral-70;
|
|
23
24
|
border-radius: 50%;
|
|
24
25
|
appearance: none;
|
|
26
|
+
cursor: pointer;
|
|
25
27
|
|
|
26
28
|
// Hover effect
|
|
27
29
|
&::before {
|
|
@@ -3,8 +3,8 @@ $checkmark-width-with-space: $checkmark-width + 0.438rem;
|
|
|
3
3
|
@mixin checkmarkColor($borderColor) {
|
|
4
4
|
input[type='checkbox']:checked + label::before {
|
|
5
5
|
position: absolute;
|
|
6
|
-
top:
|
|
7
|
-
left:
|
|
6
|
+
top: 10px;
|
|
7
|
+
left: 10px;
|
|
8
8
|
width: $checkmark-width;
|
|
9
9
|
height: 0.3125rem;
|
|
10
10
|
border: 2px solid;
|
|
@@ -17,17 +17,20 @@ $checkmark-width-with-space: $checkmark-width + 0.438rem;
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.pix-selectable-tag {
|
|
20
|
+
|
|
21
|
+
@extend %pix-body-s;
|
|
22
|
+
|
|
20
23
|
display: inline-block;
|
|
21
24
|
text-align: center;
|
|
22
25
|
position: relative;
|
|
23
26
|
padding: 3px calc(8px + #{$checkmark-width-with-space} / 2);
|
|
24
27
|
letter-spacing: 0.009rem;
|
|
25
|
-
border-radius: 0.
|
|
28
|
+
border-radius: 0.95rem;
|
|
26
29
|
border: $pix-neutral-30 solid 1px;
|
|
27
30
|
color: $pix-neutral-60;
|
|
28
31
|
background-color: $pix-neutral-0;
|
|
29
|
-
font-size: 0.8125rem;
|
|
30
32
|
cursor: pointer;
|
|
33
|
+
font-weight: $font-medium;
|
|
31
34
|
|
|
32
35
|
input {
|
|
33
36
|
position: absolute;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
.pix-tag {
|
|
2
|
+
|
|
3
|
+
@extend %pix-body-s;
|
|
4
|
+
|
|
2
5
|
display: inline-block;
|
|
3
6
|
text-align: center;
|
|
4
7
|
vertical-align: baseline;
|
|
5
8
|
white-space: nowrap;
|
|
6
9
|
padding: 4px 16px;
|
|
7
|
-
font-size: 0.8125rem;
|
|
8
10
|
border: 1px solid transparent;
|
|
9
|
-
border-radius: 0.
|
|
11
|
+
border-radius: 0.95rem;
|
|
10
12
|
color: $pix-neutral-0;
|
|
11
13
|
background-color: $pix-primary;
|
|
14
|
+
font-weight: $font-medium;
|
|
12
15
|
|
|
13
16
|
&--blue-light {
|
|
14
17
|
color: $pix-primary-80;
|
|
@@ -63,9 +66,12 @@
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
&--compact {
|
|
66
|
-
|
|
69
|
+
|
|
70
|
+
@extend %pix-body-xs;
|
|
71
|
+
|
|
67
72
|
font-weight: $font-medium;
|
|
68
73
|
text-transform: uppercase;
|
|
69
74
|
padding: 4px 13px;
|
|
75
|
+
line-height: inherit;
|
|
70
76
|
}
|
|
71
77
|
}
|
|
@@ -5,6 +5,7 @@ export const Template = (args) => {
|
|
|
5
5
|
template: hbs`
|
|
6
6
|
<PixCheckbox
|
|
7
7
|
@id={{this.id}}
|
|
8
|
+
@class={{this.class}}
|
|
8
9
|
@screenReaderOnly={{this.screenReaderOnly}}
|
|
9
10
|
@isIndeterminate={{this.isIndeterminate}}
|
|
10
11
|
@labelSize={{this.labelSize}}
|
|
@@ -75,6 +76,7 @@ export const MultipleTemplate = (args) => {
|
|
|
75
76
|
template: hbs`
|
|
76
77
|
<PixCheckbox
|
|
77
78
|
@id="one"
|
|
79
|
+
@class={{this.class}}
|
|
78
80
|
@screenReaderOnly={{this.screenReaderOnly}}
|
|
79
81
|
@isIndeterminate={{this.isIndeterminate}}
|
|
80
82
|
@labelSize={{this.labelSize}}
|
|
@@ -85,6 +87,7 @@ export const MultipleTemplate = (args) => {
|
|
|
85
87
|
</PixCheckbox>
|
|
86
88
|
<PixCheckbox
|
|
87
89
|
@id="two"
|
|
90
|
+
@class={{this.class}}
|
|
88
91
|
@screenReaderOnly={{this.screenReaderOnly}}
|
|
89
92
|
@isIndeterminate={{this.isIndeterminate}}
|
|
90
93
|
@labelSize={{this.labelSize}}
|
|
@@ -106,8 +109,9 @@ multiple.args = {
|
|
|
106
109
|
export const argTypes = {
|
|
107
110
|
id: {
|
|
108
111
|
name: 'id',
|
|
109
|
-
description:
|
|
110
|
-
|
|
112
|
+
description:
|
|
113
|
+
'Identifiant du champ permettant de lui attacher un label. Généré automatiquement si non renseigné.',
|
|
114
|
+
type: { name: 'string' },
|
|
111
115
|
},
|
|
112
116
|
label: {
|
|
113
117
|
name: 'label',
|
|
@@ -115,7 +119,7 @@ export const argTypes = {
|
|
|
115
119
|
},
|
|
116
120
|
class: {
|
|
117
121
|
name: 'class',
|
|
118
|
-
description: "Permet d'ajouter une classe
|
|
122
|
+
description: "Permet d'ajouter une classe au parent du composant.",
|
|
119
123
|
type: { name: 'string' },
|
|
120
124
|
},
|
|
121
125
|
screenReaderOnly: {
|
|
@@ -3,7 +3,15 @@ import { hbs } from 'ember-cli-htmlbars';
|
|
|
3
3
|
/* Default stories */
|
|
4
4
|
const Template = (args) => {
|
|
5
5
|
return {
|
|
6
|
-
template: hbs
|
|
6
|
+
template: hbs`
|
|
7
|
+
<PixRadioButton
|
|
8
|
+
@value={{this.value}}
|
|
9
|
+
@id={{this.id}}
|
|
10
|
+
@class={{this.class}}
|
|
11
|
+
disabled={{this.disabled}}
|
|
12
|
+
>
|
|
13
|
+
{{this.label}}
|
|
14
|
+
</PixRadioButton>`,
|
|
7
15
|
context: args,
|
|
8
16
|
};
|
|
9
17
|
};
|
|
@@ -16,13 +24,14 @@ Default.args = {
|
|
|
16
24
|
export const isDisabled = Template.bind({});
|
|
17
25
|
isDisabled.args = {
|
|
18
26
|
...Default.args,
|
|
19
|
-
|
|
27
|
+
disabled: true,
|
|
20
28
|
};
|
|
21
29
|
|
|
22
30
|
/* Checked stories */
|
|
23
31
|
const checked = (args) => {
|
|
24
32
|
return {
|
|
25
|
-
template: hbs
|
|
33
|
+
template: hbs`
|
|
34
|
+
<PixRadioButton @value={{this.value}} disabled={{this.disabled}} checked>{{this.label}}</PixRadioButton>`,
|
|
26
35
|
context: args,
|
|
27
36
|
};
|
|
28
37
|
};
|
|
@@ -30,7 +39,7 @@ const checked = (args) => {
|
|
|
30
39
|
export const disabledChecked = checked.bind({});
|
|
31
40
|
disabledChecked.args = {
|
|
32
41
|
...Default.args,
|
|
33
|
-
|
|
42
|
+
disabled: true,
|
|
34
43
|
};
|
|
35
44
|
|
|
36
45
|
export const defaultChecked = checked.bind({});
|
|
@@ -40,9 +49,9 @@ defaultChecked.args = Default.args;
|
|
|
40
49
|
const multipleTemplate = (args) => {
|
|
41
50
|
return {
|
|
42
51
|
template: hbs`
|
|
43
|
-
<PixRadioButton
|
|
44
|
-
<PixRadioButton
|
|
45
|
-
<PixRadioButton
|
|
52
|
+
<PixRadioButton disabled={{this.disabled}} name="radio">{{this.label}}</PixRadioButton>
|
|
53
|
+
<PixRadioButton disabled={{this.disabled}} name="radio">{{this.label}}</PixRadioButton>
|
|
54
|
+
<PixRadioButton disabled={{this.disabled}} name="radio">{{this.label}}</PixRadioButton>
|
|
46
55
|
`,
|
|
47
56
|
context: args,
|
|
48
57
|
};
|
|
@@ -54,18 +63,29 @@ multiple.args = {
|
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
export const argTypes = {
|
|
66
|
+
id: {
|
|
67
|
+
name: 'id',
|
|
68
|
+
description:
|
|
69
|
+
'Identifiant du champ permettant de lui attacher un label. Généré automatiquement si non renseigné.',
|
|
70
|
+
type: { name: 'string' },
|
|
71
|
+
},
|
|
57
72
|
label: {
|
|
58
73
|
name: 'label',
|
|
59
74
|
description: 'Le label du bouton radio',
|
|
60
75
|
type: { name: 'string', required: true },
|
|
61
76
|
},
|
|
77
|
+
class: {
|
|
78
|
+
name: 'class',
|
|
79
|
+
description: "Permet d'ajouter une classe CSS au parent du composant.",
|
|
80
|
+
type: { name: 'string' },
|
|
81
|
+
},
|
|
62
82
|
value: {
|
|
63
83
|
name: 'value',
|
|
64
84
|
description: "Valeur permettant d'identifier l'option sélectionnée",
|
|
65
85
|
type: { name: 'string', required: false },
|
|
66
86
|
},
|
|
67
|
-
|
|
68
|
-
name: '
|
|
87
|
+
disabled: {
|
|
88
|
+
name: 'disabled',
|
|
69
89
|
description: 'Pour désactiver/activer le bouton radio',
|
|
70
90
|
type: { name: 'boolean', required: false },
|
|
71
91
|
table: {
|
|
@@ -27,7 +27,7 @@ Pour les considérer comme un seul groupe d'inputs, **il est nécessaire qu'ils
|
|
|
27
27
|
<Story name="Multiple" story={stories.multiple} height={140} />
|
|
28
28
|
</Canvas>
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Disabled
|
|
31
31
|
|
|
32
32
|
État inactif du bouton radio.
|
|
33
33
|
|
|
@@ -39,12 +39,7 @@ Pour les considérer comme un seul groupe d'inputs, **il est nécessaire qu'ils
|
|
|
39
39
|
## Usage
|
|
40
40
|
|
|
41
41
|
```html
|
|
42
|
-
<PixRadioButton
|
|
43
|
-
name="input-name"
|
|
44
|
-
@label="{{label}}"
|
|
45
|
-
@value="{{value}}"
|
|
46
|
-
@isDisabled="{{isDisabled}}"
|
|
47
|
-
/>
|
|
42
|
+
<PixRadioButton name="input-name" @value="{{value}}"> Exemple de label </PixRadioButton>
|
|
48
43
|
```
|
|
49
44
|
|
|
50
45
|
## Arguments
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1024pix/pix-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "34.0.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"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build": "./scripts/build.sh",
|
|
27
27
|
"build-ember": "ember build --environment=production",
|
|
28
28
|
"serve-ember": "ember serve",
|
|
29
|
-
"build-storybook": "ember build && cp -v CNAME dist && build-storybook
|
|
30
|
-
"serve-storybook": "start-storybook --port 9001
|
|
29
|
+
"build-storybook": "ember build && cp -v CNAME dist && build-storybook",
|
|
30
|
+
"serve-storybook": "start-storybook --port 9001",
|
|
31
31
|
"clean": "rm -rf dist node_modules",
|
|
32
32
|
"deploy-storybook": "storybook-to-ghpages",
|
|
33
33
|
"lint": "npm-run-all --aggregate-output --parallel --continue-on-error 'lint:!(fix)'",
|