@1024pix/pix-ui 42.0.4 → 43.0.1

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.
Files changed (53) hide show
  1. package/addon/components/pix-checkbox.hbs +11 -7
  2. package/addon/components/pix-checkbox.js +0 -14
  3. package/addon/components/pix-filterable-and-searchable-select.hbs +8 -8
  4. package/addon/components/pix-filterable-and-searchable-select.js +0 -8
  5. package/addon/components/pix-input-password.hbs +9 -14
  6. package/addon/components/pix-input.hbs +9 -14
  7. package/addon/components/pix-input.js +0 -8
  8. package/addon/components/pix-label.hbs +11 -0
  9. package/addon/components/pix-label.js +19 -0
  10. package/addon/components/pix-multi-select.hbs +9 -6
  11. package/addon/components/pix-radio-button.hbs +10 -7
  12. package/addon/components/pix-search-input.hbs +9 -4
  13. package/addon/components/pix-select.hbs +10 -12
  14. package/addon/components/pix-select.js +0 -3
  15. package/addon/components/pix-selectable-tag.hbs +3 -3
  16. package/addon/components/pix-selectable-tag.js +1 -5
  17. package/addon/components/pix-textarea.hbs +11 -12
  18. package/addon/components/pix-textarea.js +1 -22
  19. package/addon/components/pix-toggle.hbs +10 -3
  20. package/addon/components/pix-toggle.js +5 -6
  21. package/addon/styles/_pix-checkbox.scss +1 -18
  22. package/addon/styles/_pix-filterable-and-searchable-select.scss +0 -8
  23. package/addon/styles/_pix-input-code.scss +0 -4
  24. package/addon/styles/_pix-input-password.scss +0 -2
  25. package/addon/styles/_pix-input.scss +1 -11
  26. package/addon/styles/_pix-label.scss +35 -0
  27. package/addon/styles/_pix-multi-select.scss +1 -6
  28. package/addon/styles/_pix-radio-button.scss +1 -9
  29. package/addon/styles/_pix-search-input.scss +18 -30
  30. package/addon/styles/_pix-select.scss +1 -10
  31. package/addon/styles/_pix-textarea.scss +0 -4
  32. package/addon/styles/_pix-toggle.scss +0 -22
  33. package/addon/styles/addon.scss +1 -0
  34. package/addon/styles/component-state/_form.scss +5 -19
  35. package/addon/styles/pix-design-tokens/_typography.scss +17 -17
  36. package/app/components/pix-label.js +1 -0
  37. package/app/stories/pix-checkbox.mdx +0 -6
  38. package/app/stories/pix-checkbox.stories.js +18 -15
  39. package/app/stories/pix-filterable-and-searchable-select.stories.js +11 -0
  40. package/app/stories/pix-input-password.mdx +2 -4
  41. package/app/stories/pix-input-password.stories.js +10 -5
  42. package/app/stories/pix-input.mdx +3 -5
  43. package/app/stories/pix-input.stories.js +11 -6
  44. package/app/stories/pix-label.mdx +46 -0
  45. package/app/stories/pix-label.stories.js +102 -0
  46. package/app/stories/pix-multi-select.stories.js +11 -0
  47. package/app/stories/pix-radio-button.stories.js +40 -6
  48. package/app/stories/pix-search-input.mdx +9 -2
  49. package/app/stories/pix-search-input.stories.js +7 -7
  50. package/app/stories/pix-select.stories.js +11 -0
  51. package/app/stories/pix-textarea.stories.js +17 -0
  52. package/app/stories/pix-toggle.stories.js +17 -0
  53. package/package.json +6 -6
@@ -14,6 +14,16 @@ export default {
14
14
  description: 'Le label du bouton radio',
15
15
  type: { name: 'string', required: true },
16
16
  },
17
+ labelSize: {
18
+ name: 'labelSize',
19
+ description: 'Correspond à la taille de la police du label.',
20
+ type: { name: 'string', required: false },
21
+ table: {
22
+ defaultValue: { summary: 'default' },
23
+ },
24
+ control: { type: 'select' },
25
+ options: ['small', 'large', 'default'],
26
+ },
17
27
  class: {
18
28
  name: 'class',
19
29
  description: "Permet d'ajouter une classe CSS au parent du composant.",
@@ -24,14 +34,24 @@ export default {
24
34
  description: "Valeur permettant d'identifier l'option sélectionnée",
25
35
  type: { name: 'string', required: false },
26
36
  },
27
- disabled: {
28
- name: 'disabled',
37
+ isDisabled: {
38
+ name: 'isDisabled',
29
39
  description: 'Pour désactiver/activer le bouton radio',
30
40
  type: { name: 'boolean', required: false },
31
41
  table: {
32
42
  defaultValue: { summary: 'false' },
33
43
  },
34
44
  },
45
+ screenReaderOnly: {
46
+ name: 'screenReaderOnly',
47
+ description:
48
+ "Permet de ne pas afficher le label à l'écran. Sert à garder un label qui sera lisible par les lecteurs d'écran.",
49
+ type: { name: 'boolean', required: true },
50
+ table: {
51
+ type: { summary: 'boolean' },
52
+ defaultValue: { summary: false },
53
+ },
54
+ },
35
55
  },
36
56
  };
37
57
 
@@ -42,7 +62,9 @@ const Template = (args) => {
42
62
  @value={{this.value}}
43
63
  @id={{this.id}}
44
64
  @class={{this.class}}
45
- disabled={{this.disabled}}
65
+ disabled={{this.isDisabled}}
66
+ @isDisabled={{this.isDisabled}}
67
+ @labelSize={{this.labelSize}}
46
68
  >
47
69
  {{this.label}}
48
70
  </PixRadioButton>`,
@@ -85,9 +107,21 @@ defaultChecked.args = Default.args;
85
107
  /* Multiple components story */
86
108
  const multipleTemplate = (args) => {
87
109
  return {
88
- template: hbs`<PixRadioButton disabled={{this.disabled}} name='radio'>{{this.label}}</PixRadioButton>
89
- <PixRadioButton disabled={{this.disabled}} name='radio'>{{this.label}}</PixRadioButton>
90
- <PixRadioButton disabled={{this.disabled}} name='radio'>{{this.label}}</PixRadioButton>`,
110
+ template: hbs`<PixRadioButton
111
+ disabled={{this.isDisabled}}
112
+ @isDisabled={{this.isDisabled}}
113
+ name='radio'
114
+ >{{this.label}}</PixRadioButton>
115
+ <PixRadioButton
116
+ disabled={{this.isDisabled}}
117
+ @isDisabled={{this.isDisabled}}
118
+ name='radio'
119
+ >{{this.label}}</PixRadioButton>
120
+ <PixRadioButton
121
+ disabled={{this.isDisabled}}
122
+ @isDisabled={{this.isDisabled}}
123
+ name='radio'
124
+ >{{this.label}}</PixRadioButton>`,
91
125
  context: args,
92
126
  };
93
127
  };
@@ -6,12 +6,20 @@ import * as ComponentStories from './pix-search-input.stories.js';
6
6
 
7
7
  # PixSearchInput
8
8
 
9
- Le PixSearchInput est un champ qui permet de filter des résultats. Un cas d'utilisation courant de ce genre de composant est un champ de filtre d'une colonne d'un tableau.
9
+ Le `PixSearchInput` est un champ qui permet de filter des résultats. Un cas d'utilisation courant de ce genre de composant est un champ de filtre d'une colonne d'un tableau.
10
10
 
11
11
  A la différence d'un [PixSelect](?path=/docs/form-select--default#withsearch) searchable, la liste des résultats s'affiche en dehors du composant.
12
12
 
13
13
  Ce composant permet d'appeler la fonction triggerFiltering passée en paramètre selon un debounce (temps d'attente avant le prochain appel) fournis.
14
14
 
15
+ ## Accessibilité
16
+
17
+ Si vous utilisez le `PixSearchInput` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
18
+
19
+ ```html
20
+ <PixSearchInput @label="{{label}}" @screenReaderOnly={{true}} @id="{{id}}" />
21
+ ```
22
+
15
23
  <Story of={ComponentStories.Default} height={80} />
16
24
 
17
25
  ## Usage
@@ -20,7 +28,6 @@ Ce composant permet d'appeler la fonction triggerFiltering passée en paramètre
20
28
  <PixSearchInput
21
29
  @id="{{this.id}}"
22
30
  @label="{{this.label}}"
23
- @ariaLabel="{{this.ariaLabel}}"
24
31
  @placeholder="{{this.placeholder}}"
25
32
  @debounceTimeInMs="{{this.debounceTimeInMs}}"
26
33
  @triggerFiltering="{{this.triggerFiltering}}"
@@ -22,14 +22,15 @@ export default {
22
22
  type: { summary: 'string' },
23
23
  },
24
24
  },
25
- ariaLabel: {
26
- name: 'ariaLabel',
27
- description:
28
- "Label du champ. ** ⚠️ L'`ariaLabel` est obligatoire si le `label` n'est pas donné. ⚠️ **",
25
+ labelSize: {
26
+ name: 'labelSize',
27
+ description: 'Correspond à la taille de la police du label.',
29
28
  type: { name: 'string', required: false },
30
29
  table: {
31
- type: { summary: 'string' },
30
+ defaultValue: { summary: 'default' },
32
31
  },
32
+ control: { type: 'select' },
33
+ options: ['small', 'large', 'default'],
33
34
  },
34
35
  placeholder: {
35
36
  name: 'placeholder',
@@ -62,7 +63,7 @@ export const Template = (args) => {
62
63
  template: hbs`<PixSearchInput
63
64
  @id={{this.id}}
64
65
  @label={{this.label}}
65
- @ariaLabel={{this.ariaLabel}}
66
+ @labelSize={{this.labelSize}}
66
67
  @placeholder={{this.placeholder}}
67
68
  @debounceTimeInMs={{this.debounceTimeInMs}}
68
69
  @triggerFiltering={{this.triggerFiltering}}
@@ -75,7 +76,6 @@ export const Default = Template.bind({});
75
76
  Default.args = {
76
77
  id: null,
77
78
  label: 'Filtrer un fruit',
78
- ariaLabel: null,
79
79
  placeholder: 'un placeholder',
80
80
  debounceTimeInMs: 500,
81
81
  triggerFiltering: action('triggerFiltering'),
@@ -46,6 +46,16 @@ export default {
46
46
  defaultValue: { summary: false },
47
47
  },
48
48
  },
49
+ labelSize: {
50
+ name: 'labelSize',
51
+ description: 'Correspond à la taille de la police du label.',
52
+ type: { name: 'string', required: false },
53
+ table: {
54
+ defaultValue: { summary: 'default' },
55
+ },
56
+ control: { type: 'select' },
57
+ options: ['small', 'large', 'default'],
58
+ },
49
59
  id: {
50
60
  name: 'id',
51
61
  description:
@@ -193,6 +203,7 @@ export const Template = (args) => {
193
203
  @className={{this.className}}
194
204
  @options={{this.options}}
195
205
  @isSearchable={{this.isSearchable}}
206
+ @labelSize={{this.labelSize}}
196
207
  @onChange={{this.onChange}}
197
208
  @label={{this.label}}
198
209
  @placeholder={{this.placeholder}}
@@ -23,6 +23,21 @@ export default {
23
23
  description: 'Donne un label au champ.',
24
24
  type: { name: 'string', required: false },
25
25
  },
26
+ subLabel: {
27
+ name: 'subLabel',
28
+ description: 'Donne un sous label au champ.',
29
+ type: { name: 'string', required: false },
30
+ },
31
+ labelSize: {
32
+ name: 'labelSize',
33
+ description: 'Correspond à la taille de la police du label.',
34
+ type: { name: 'string', required: false },
35
+ table: {
36
+ defaultValue: { summary: 'default' },
37
+ },
38
+ control: { type: 'select' },
39
+ options: ['small', 'large', 'default'],
40
+ },
26
41
  requiredLabel: {
27
42
  name: 'requiredLabel',
28
43
  description:
@@ -44,6 +59,8 @@ const Template = (args) => {
44
59
  @value={{this.value}}
45
60
  @maxlength={{this.maxlength}}
46
61
  @label={{this.label}}
62
+ @labelSize={{this.labelSize}}
63
+ @subLabel={{this.subLabel}}
47
64
  @requiredLabel={{this.requiredLabel}}
48
65
  @errorMessage={{this.errorMessage}}
49
66
  />`,
@@ -9,6 +9,21 @@ export default {
9
9
  description: 'Le label du PixToggle',
10
10
  type: { name: 'string', required: true },
11
11
  },
12
+ subLabel: {
13
+ name: 'subLabel',
14
+ description: 'Le sous label du PixToggle',
15
+ type: { name: 'string', required: true },
16
+ },
17
+ labelSize: {
18
+ name: 'labelSize',
19
+ description: 'Correspond à la taille de la police du label.',
20
+ type: { name: 'string', required: false },
21
+ table: {
22
+ defaultValue: { summary: 'default' },
23
+ },
24
+ control: { type: 'select' },
25
+ options: ['small', 'large', 'default'],
26
+ },
12
27
  onLabel: {
13
28
  name: 'onLabel',
14
29
  description: "Le label de l'état actif du PixToggle",
@@ -57,6 +72,8 @@ export const Template = (args) => {
57
72
  return {
58
73
  template: hbs`<PixToggle
59
74
  @label={{this.label}}
75
+ @labelSize={{this.labelSize}}
76
+ @subLabel={{this.subLabel}}
60
77
  @onLabel={{this.onLabel}}
61
78
  @offLabel={{this.offLabel}}
62
79
  @toggled={{this.toggled}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "42.0.4",
3
+ "version": "43.0.1",
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.10.0"
11
+ "node": "^20.11.0"
12
12
  },
13
13
  "ember": {
14
14
  "edition": "octane"
@@ -74,7 +74,7 @@
74
74
  "@fortawesome/free-regular-svg-icons": "^6.2.1",
75
75
  "@fortawesome/free-solid-svg-icons": "^6.2.1",
76
76
  "@glimmer/component": "^1.1.2",
77
- "@glimmer/syntax": "^0.87.0",
77
+ "@glimmer/syntax": "^0.88.0",
78
78
  "@glimmer/tracking": "^1.1.2",
79
79
  "@storybook/addon-a11y": "7.1.0",
80
80
  "@storybook/addon-controls": "7.1.0",
@@ -109,7 +109,7 @@
109
109
  "ember-try": "^3.0.0-beta",
110
110
  "eslint": "^8.28.0",
111
111
  "eslint-config-prettier": "^9.0.0",
112
- "eslint-plugin-ember": "^11.2.0",
112
+ "eslint-plugin-ember": "^12.0.0",
113
113
  "eslint-plugin-node": "^11.1.0",
114
114
  "eslint-plugin-prettier": "^5.0.0",
115
115
  "eslint-plugin-qunit": "^8.0.0",
@@ -117,7 +117,7 @@
117
117
  "html-webpack-plugin": "^5.5.0",
118
118
  "loader.js": "^4.7.0",
119
119
  "lodash": "^4.17.21",
120
- "npm-run-all": "^4.1.5",
120
+ "npm-run-all2": "^6.0.0",
121
121
  "prettier": "^3.0.0",
122
122
  "qunit": "^2.19.3",
123
123
  "qunit-dom": "^3.0.0",
@@ -125,7 +125,7 @@
125
125
  "storybook": "^7.1.0",
126
126
  "stylelint": "^16.0.2",
127
127
  "stylelint-config-rational-order": "^0.1.2",
128
- "stylelint-config-standard-scss": "^12.0.0",
128
+ "stylelint-config-standard-scss": "^13.0.0",
129
129
  "webpack": "^5.75.0"
130
130
  },
131
131
  "bugs": {