@1024pix/pix-ui 34.1.0 → 34.2.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.
@@ -30,25 +30,25 @@ workflows:
30
30
  jobs:
31
31
  install:
32
32
  docker:
33
- - image: cimg/node:16.19.1-browsers
33
+ - image: cimg/node:16.20.0-browsers
34
34
  resource_class: medium+
35
+ working_directory: ~/pix-ui
35
36
  steps:
36
37
  - checkout
37
38
  - run: npm ci
38
- - save_cache:
39
- name: Save node modules
40
- key: node_modules
39
+ - persist_to_workspace:
40
+ root: ~/pix-ui
41
41
  paths:
42
- - node_modules
42
+ - .
43
+
43
44
  lint-and-test:
44
45
  docker:
45
- - image: cimg/node:16.19.1-browsers
46
+ - image: cimg/node:16.20.0-browsers
46
47
  resource_class: medium+
48
+ working_directory: ~/pix-ui
47
49
  steps:
48
- - checkout
49
- - restore_cache:
50
- name: Restore node modules
51
- key: node_modules
50
+ - attach_workspace:
51
+ at: ~/pix-ui
52
52
  - browser-tools/install-chrome
53
53
  - browser-tools/install-chromedriver
54
54
  - run: npm run lint:js
@@ -56,12 +56,12 @@ jobs:
56
56
  - run: npm run lint:scss
57
57
  - run: npm test
58
58
  - run: npx ember try:one embroider-safe
59
+
59
60
  chromatic-deployment:
60
61
  docker:
61
- - image: cimg/node:16.19.1-browsers
62
+ - image: cimg/node:16.20.0-browsers
63
+ working_directory: ~/pix-ui
62
64
  steps:
63
- - checkout
64
- - restore_cache:
65
- name: Restore node modules
66
- key: node_modules
65
+ - attach_workspace:
66
+ at: ~/pix-ui
67
67
  - run: npm run chromatic -- --auto-accept-changes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Pix-UI Changelog
2
2
 
3
+ ## v34.2.0 (26/05/2023)
4
+
5
+
6
+ ### :rocket: Amélioration
7
+ - [#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)
8
+
9
+ ### :building_construction: Tech
10
+ - [#401](https://github.com/1024pix/pix-ui/pull/401) [TECH] Suppression de l'utilitaire uniqueId (PIX-8003)
11
+
12
+ ### :coffee: Autre
13
+ - [#410](https://github.com/1024pix/pix-ui/pull/410) [BUMP] Update dependency stylelint to v15 (dossier racine)
14
+ - [#411](https://github.com/1024pix/pix-ui/pull/411) chore(deps): bump socket.io-parser from 4.2.1 to 4.2.3
15
+ - [#405](https://github.com/1024pix/pix-ui/pull/405) [BUMP] Update dependency @embroider/test-setup to v3 (dossier racine)
16
+ - [#398](https://github.com/1024pix/pix-ui/pull/398) [BUMP] Update Node.js to v16.20.0
17
+ - [#404](https://github.com/1024pix/pix-ui/pull/404) [BUMP] Update dependency @fortawesome/ember-fontawesome to v1 (dossier racine)
18
+
3
19
  ## v34.1.0 (05/05/2023)
4
20
 
5
21
 
@@ -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 uniqueId from '@1024pix/pix-ui/utils/unique-id';
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 uniqueId();
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 uniqueId from '@1024pix/pix-ui/utils/unique-id';
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 uniqueId();
26
+ return guidFor(this);
27
27
  }
28
28
  }
@@ -51,11 +51,13 @@
51
51
 
52
52
  &__error-container {
53
53
  padding-right: $pix-spacing-m;
54
+
54
55
  @include formElementInError();
55
56
  }
56
57
 
57
58
  &__success-container {
58
59
  padding-right: $pix-spacing-m;
60
+
59
61
  @include formElementInSuccess();
60
62
  }
61
63
 
@@ -55,11 +55,13 @@
55
55
 
56
56
  &__input--error {
57
57
  padding-right: $pix-spacing-l;
58
+
58
59
  @include formElementInError();
59
60
  }
60
61
 
61
62
  &__input--success {
62
63
  padding-right: $pix-spacing-l;
64
+
63
65
  @include formElementInSuccess();
64
66
  }
65
67
  }
@@ -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;
@@ -1,5 +1,4 @@
1
1
  .pix-tag {
2
-
3
2
  @extend %pix-body-s;
4
3
 
5
4
  display: inline-block;
@@ -66,7 +65,6 @@
66
65
  }
67
66
 
68
67
  &--compact {
69
-
70
68
  @extend %pix-body-xs;
71
69
 
72
70
  font-weight: $font-medium;
@@ -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: true },
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`, sinon le composant renvoie une erreur.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "34.1.0",
3
+ "version": "34.2.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,15 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@1024pix/ember-testing-library": "^0.6.0",
63
- "@1024pix/stylelint-config": "^1.0.1",
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/test-setup": "^2.1.1",
71
- "@fortawesome/ember-fontawesome": "^0.4.1",
70
+ "@embroider/test-setup": "^3.0.0",
71
+ "@fortawesome/ember-fontawesome": "^1.0.0",
72
72
  "@fortawesome/free-regular-svg-icons": "^6.2.1",
73
73
  "@fortawesome/free-solid-svg-icons": "^6.2.1",
74
74
  "@glimmer/component": "^1.1.2",
@@ -120,9 +120,8 @@
120
120
  "qunit": "^2.19.3",
121
121
  "qunit-dom": "^2.0.0",
122
122
  "sass": "^1.56.1",
123
- "stylelint": "^14.16.1",
124
- "stylelint-config-prettier": "^9.0.5",
125
- "stylelint-config-standard-scss": "^6.1.0",
123
+ "stylelint": "^15.0.0",
124
+ "stylelint-config-standard-scss": "^9.0.0",
126
125
  "webpack": "^5.75.0"
127
126
  },
128
127
  "overrides": {
@@ -1,5 +0,0 @@
1
- export default function uniqueId() {
2
- return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>
3
- ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)
4
- );
5
- }