@1024pix/pix-ui 34.1.0 → 35.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 +42 -16
- package/CHANGELOG.md +28 -0
- package/addon/components/pix-input.js +0 -8
- package/addon/components/pix-modal.js +2 -2
- package/addon/components/pix-sidebar.js +2 -2
- package/addon/components/pix-textarea.hbs +3 -3
- package/addon/components/pix-textarea.js +10 -1
- package/addon/styles/_pix-input-password.scss +2 -0
- package/addon/styles/_pix-input.scss +2 -0
- package/addon/styles/_pix-selectable-tag.scss +1 -1
- package/addon/styles/_pix-tag.scss +0 -2
- package/app/stories/pix-input.stories.js +1 -1
- package/app/stories/pix-input.stories.mdx +1 -1
- package/docs/adr/0001-utiliser-les-balises-html-natives.md +1 -3
- package/package.json +8 -8
- package/addon/utils/unique-id.js +0 -5
package/.circleci/config.yml
CHANGED
|
@@ -19,6 +19,18 @@ workflows:
|
|
|
19
19
|
- gh-pages
|
|
20
20
|
requires:
|
|
21
21
|
- install
|
|
22
|
+
- try-scenarios:
|
|
23
|
+
matrix:
|
|
24
|
+
parameters:
|
|
25
|
+
try-scenario:
|
|
26
|
+
- embroider-safe
|
|
27
|
+
- embroider-optimized
|
|
28
|
+
filters:
|
|
29
|
+
branches:
|
|
30
|
+
ignore:
|
|
31
|
+
- gh-pages
|
|
32
|
+
requires:
|
|
33
|
+
- install
|
|
22
34
|
- chromatic-deployment:
|
|
23
35
|
filters:
|
|
24
36
|
branches:
|
|
@@ -30,38 +42,52 @@ workflows:
|
|
|
30
42
|
jobs:
|
|
31
43
|
install:
|
|
32
44
|
docker:
|
|
33
|
-
- image: cimg/node:16.
|
|
45
|
+
- image: cimg/node:16.20.0-browsers
|
|
34
46
|
resource_class: medium+
|
|
47
|
+
working_directory: ~/pix-ui
|
|
35
48
|
steps:
|
|
36
49
|
- checkout
|
|
37
50
|
- run: npm ci
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
key: node_modules
|
|
51
|
+
- persist_to_workspace:
|
|
52
|
+
root: ~/pix-ui
|
|
41
53
|
paths:
|
|
42
|
-
-
|
|
54
|
+
- .
|
|
55
|
+
|
|
43
56
|
lint-and-test:
|
|
44
57
|
docker:
|
|
45
|
-
- image: cimg/node:16.
|
|
58
|
+
- image: cimg/node:16.20.0-browsers
|
|
46
59
|
resource_class: medium+
|
|
60
|
+
working_directory: ~/pix-ui
|
|
47
61
|
steps:
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
name: Restore node modules
|
|
51
|
-
key: node_modules
|
|
62
|
+
- attach_workspace:
|
|
63
|
+
at: ~/pix-ui
|
|
52
64
|
- browser-tools/install-chrome
|
|
53
65
|
- browser-tools/install-chromedriver
|
|
54
66
|
- run: npm run lint:js
|
|
55
67
|
- run: npm run lint:hbs
|
|
56
68
|
- run: npm run lint:scss
|
|
57
69
|
- run: npm test
|
|
58
|
-
|
|
70
|
+
|
|
71
|
+
try-scenarios:
|
|
72
|
+
parameters:
|
|
73
|
+
try-scenario:
|
|
74
|
+
type: string
|
|
75
|
+
docker:
|
|
76
|
+
- image: cimg/node:16.20.0-browsers
|
|
77
|
+
resource_class: medium+
|
|
78
|
+
working_directory: ~/pix-ui
|
|
79
|
+
steps:
|
|
80
|
+
- attach_workspace:
|
|
81
|
+
at: ~/pix-ui
|
|
82
|
+
- browser-tools/install-chrome
|
|
83
|
+
- browser-tools/install-chromedriver
|
|
84
|
+
- run: npx ember try:one << parameters.try-scenario >>
|
|
85
|
+
|
|
59
86
|
chromatic-deployment:
|
|
60
87
|
docker:
|
|
61
|
-
- image: cimg/node:16.
|
|
88
|
+
- image: cimg/node:16.20.0-browsers
|
|
89
|
+
working_directory: ~/pix-ui
|
|
62
90
|
steps:
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
name: Restore node modules
|
|
66
|
-
key: node_modules
|
|
91
|
+
- attach_workspace:
|
|
92
|
+
at: ~/pix-ui
|
|
67
93
|
- run: npm run chromatic -- --auto-accept-changes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Pix-UI Changelog
|
|
2
2
|
|
|
3
|
+
## v35.0.0 (31/05/2023)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### :rocket: Amélioration
|
|
7
|
+
- [#415](https://github.com/1024pix/pix-ui/pull/415) [FEATURE] Utiliser les éléments HTML native pour le TextArea (PIX-8200)
|
|
8
|
+
|
|
9
|
+
### :building_construction: Tech
|
|
10
|
+
- [#409](https://github.com/1024pix/pix-ui/pull/409) [TECH] Fait tourner le scenario embroider-optimized sur la CI
|
|
11
|
+
|
|
12
|
+
### :coffee: Autre
|
|
13
|
+
- [#408](https://github.com/1024pix/pix-ui/pull/408) [BUMP] Update dependency fs-extra to v11 (dossier racine)
|
|
14
|
+
|
|
15
|
+
## v34.2.0 (26/05/2023)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :rocket: Amélioration
|
|
19
|
+
- [#406](https://github.com/1024pix/pix-ui/pull/406) [FEATURE] Enlever l'obligation d'avoir un label ou un ariaLabel pour le PixInput (PIX-8126)
|
|
20
|
+
|
|
21
|
+
### :building_construction: Tech
|
|
22
|
+
- [#401](https://github.com/1024pix/pix-ui/pull/401) [TECH] Suppression de l'utilitaire uniqueId (PIX-8003)
|
|
23
|
+
|
|
24
|
+
### :coffee: Autre
|
|
25
|
+
- [#410](https://github.com/1024pix/pix-ui/pull/410) [BUMP] Update dependency stylelint to v15 (dossier racine)
|
|
26
|
+
- [#411](https://github.com/1024pix/pix-ui/pull/411) chore(deps): bump socket.io-parser from 4.2.1 to 4.2.3
|
|
27
|
+
- [#405](https://github.com/1024pix/pix-ui/pull/405) [BUMP] Update dependency @embroider/test-setup to v3 (dossier racine)
|
|
28
|
+
- [#398](https://github.com/1024pix/pix-ui/pull/398) [BUMP] Update Node.js to v16.20.0
|
|
29
|
+
- [#404](https://github.com/1024pix/pix-ui/pull/404) [BUMP] Update dependency @fortawesome/ember-fontawesome to v1 (dossier racine)
|
|
30
|
+
|
|
3
31
|
## v34.1.0 (05/05/2023)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
|
|
3
|
-
const ERROR_MESSAGE = 'ERROR in PixInput component, you must provide @label or @ariaLabel params';
|
|
4
|
-
|
|
5
3
|
const INPUT_VALIDATION_STATUS_MAP = {
|
|
6
4
|
default: '',
|
|
7
5
|
error: 'pix-input__input--error',
|
|
@@ -17,16 +15,10 @@ export default class PixInput extends Component {
|
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
get label() {
|
|
20
|
-
if (!this.args.label && !this.args.ariaLabel) {
|
|
21
|
-
throw new Error(ERROR_MESSAGE);
|
|
22
|
-
}
|
|
23
18
|
return this.args.label;
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
get ariaLabel() {
|
|
27
|
-
if (!this.args.label && !this.args.ariaLabel) {
|
|
28
|
-
throw new Error(ERROR_MESSAGE);
|
|
29
|
-
}
|
|
30
22
|
return this.args.label ? null : this.args.ariaLabel;
|
|
31
23
|
}
|
|
32
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
-
import
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
4
|
|
|
5
5
|
export default class PixModal extends Component {
|
|
6
6
|
constructor(...args) {
|
|
@@ -23,6 +23,6 @@ export default class PixModal extends Component {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
get id() {
|
|
26
|
-
return
|
|
26
|
+
return guidFor(this);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
-
import
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
4
|
|
|
5
5
|
export default class PixSidebar extends Component {
|
|
6
6
|
constructor(...args) {
|
|
@@ -23,6 +23,6 @@ export default class PixSidebar extends Component {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
get id() {
|
|
26
|
-
return
|
|
26
|
+
return guidFor(this);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
</label>
|
|
11
11
|
{{/if}}
|
|
12
12
|
|
|
13
|
-
<
|
|
13
|
+
<textarea
|
|
14
14
|
id={{@id}}
|
|
15
|
-
@value={{@value}}
|
|
16
15
|
maxlength={{if @maxlength @maxlength}}
|
|
17
16
|
aria-required="{{if this.requiredLabel true false}}"
|
|
18
17
|
required={{if this.requiredLabel true false}}
|
|
19
18
|
class="{{if @errorMessage 'pix-textarea--error'}}"
|
|
19
|
+
{{on "keyup" this.updateValue}}
|
|
20
20
|
...attributes
|
|
21
|
-
|
|
21
|
+
>{{@value}}</textarea>
|
|
22
22
|
|
|
23
23
|
{{#if @maxlength}}
|
|
24
24
|
<p>{{this.textLengthIndicator}} / {{@maxlength}}</p>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
2
4
|
|
|
3
5
|
export default class PixTextarea extends Component {
|
|
6
|
+
@tracked value = this.args.value;
|
|
7
|
+
|
|
4
8
|
get textLengthIndicator() {
|
|
5
|
-
return this.
|
|
9
|
+
return this.value ? this.value.length : 0;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
get label() {
|
|
@@ -15,6 +19,11 @@ export default class PixTextarea extends Component {
|
|
|
15
19
|
return this.args.label || null;
|
|
16
20
|
}
|
|
17
21
|
|
|
22
|
+
@action
|
|
23
|
+
updateValue(event) {
|
|
24
|
+
this.value = event.target.value;
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
get requiredLabel() {
|
|
19
28
|
const idRequiredLabelDefined = this.args.requiredLabel?.trim();
|
|
20
29
|
const labelIsDefined = this.args.label?.trim();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
$checkmark-width: 0.625rem;
|
|
2
2
|
$checkmark-width-with-space: $checkmark-width + 0.438rem;
|
|
3
|
+
|
|
3
4
|
@mixin checkmarkColor($borderColor) {
|
|
4
5
|
input[type='checkbox']:checked + label::before {
|
|
5
6
|
position: absolute;
|
|
@@ -17,7 +18,6 @@ $checkmark-width-with-space: $checkmark-width + 0.438rem;
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
.pix-selectable-tag {
|
|
20
|
-
|
|
21
21
|
@extend %pix-body-s;
|
|
22
22
|
|
|
23
23
|
display: inline-block;
|
|
@@ -55,7 +55,7 @@ export const argTypes = {
|
|
|
55
55
|
ariaLabel: {
|
|
56
56
|
name: 'ariaLabel',
|
|
57
57
|
description: "L'action du champ, pour l'accessibilité. Requis si label n'est pas définit.",
|
|
58
|
-
type: { name: 'string', required:
|
|
58
|
+
type: { name: 'string', required: false },
|
|
59
59
|
},
|
|
60
60
|
id: {
|
|
61
61
|
name: 'id',
|
|
@@ -10,7 +10,7 @@ Le PixInput permet de créer un champ de texte.
|
|
|
10
10
|
|
|
11
11
|
## Accessibilité
|
|
12
12
|
|
|
13
|
-
Si vous utilisez le `PixInput` sans label alors il faut renseigner le paramètre `ariaLabel
|
|
13
|
+
Si vous utilisez le `PixInput` sans label alors il faut renseigner le paramètre `ariaLabel`. Il est possible d'ajouter un label en dehors du composant en précisant bien un attribut `for` correspondant à l'`@id` passé au PixInput.
|
|
14
14
|
|
|
15
15
|
> Si vous renseignez les paramètres label et ariaLabel ensemble, ariaLabel sera nullifié.
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 1.
|
|
1
|
+
# 1. Utiliser les balises HTML natives
|
|
2
2
|
|
|
3
3
|
Date : 2022-01-04
|
|
4
4
|
|
|
@@ -48,6 +48,4 @@ Nous privilégierons les éléments HTML natifs et éviterons autant que possibl
|
|
|
48
48
|
|
|
49
49
|
## Conséquences
|
|
50
50
|
|
|
51
|
-
Il faut mettre à jour le PixTextarea pour qu'il utilise une balise `<textarea>`.
|
|
52
|
-
|
|
53
51
|
⚠️ Pour ne pas casser le comportement existant. lors de la mise à jour des versions v11.0.0 / v11.1.0 de Pix-UI il faut mettre à jour tous les PixInput et PixInputPassword afin qu'il définissent un `onChange`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1024pix/pix-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.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"
|
|
@@ -60,15 +60,16 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@1024pix/ember-testing-library": "^0.6.0",
|
|
63
|
-
"@1024pix/stylelint-config": "^
|
|
63
|
+
"@1024pix/stylelint-config": "^3.0.0",
|
|
64
64
|
"@babel/eslint-parser": "^7.19.1",
|
|
65
65
|
"@babel/plugin-proposal-decorators": "^7.20.5",
|
|
66
66
|
"@ember/optional-features": "^2.0.0",
|
|
67
67
|
"@ember/render-modifiers": "^2.0.5",
|
|
68
68
|
"@ember/string": "^3.0.1",
|
|
69
69
|
"@ember/test-helpers": "^2.8.1",
|
|
70
|
-
"@embroider/
|
|
71
|
-
"@
|
|
70
|
+
"@embroider/macros": "^1.11.0",
|
|
71
|
+
"@embroider/test-setup": "^3.0.0",
|
|
72
|
+
"@fortawesome/ember-fontawesome": "^1.0.0",
|
|
72
73
|
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
|
73
74
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
74
75
|
"@glimmer/component": "^1.1.2",
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"eslint-plugin-node": "^11.1.0",
|
|
112
113
|
"eslint-plugin-prettier": "^4.2.1",
|
|
113
114
|
"eslint-plugin-qunit": "^7.3.3",
|
|
114
|
-
"fs-extra": "^
|
|
115
|
+
"fs-extra": "^11.0.0",
|
|
115
116
|
"html-webpack-plugin": "^5.5.0",
|
|
116
117
|
"loader.js": "^4.7.0",
|
|
117
118
|
"lodash": "^4.17.21",
|
|
@@ -120,9 +121,8 @@
|
|
|
120
121
|
"qunit": "^2.19.3",
|
|
121
122
|
"qunit-dom": "^2.0.0",
|
|
122
123
|
"sass": "^1.56.1",
|
|
123
|
-
"stylelint": "^
|
|
124
|
-
"stylelint-config-
|
|
125
|
-
"stylelint-config-standard-scss": "^6.1.0",
|
|
124
|
+
"stylelint": "^15.0.0",
|
|
125
|
+
"stylelint-config-standard-scss": "^9.0.0",
|
|
126
126
|
"webpack": "^5.75.0"
|
|
127
127
|
},
|
|
128
128
|
"overrides": {
|