@1024pix/pix-ui 44.3.8 → 45.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.
Files changed (49) hide show
  1. package/addon/components/pix-checkbox.hbs +2 -2
  2. package/addon/components/pix-filterable-and-searchable-select.hbs +5 -4
  3. package/addon/components/pix-input-base.js +44 -0
  4. package/addon/components/pix-input-password.hbs +46 -39
  5. package/addon/components/pix-input-password.js +12 -27
  6. package/addon/components/pix-input.hbs +25 -23
  7. package/addon/components/pix-input.js +10 -16
  8. package/addon/components/pix-label.js +2 -4
  9. package/addon/components/pix-multi-select.hbs +7 -6
  10. package/addon/components/pix-multi-select.js +0 -3
  11. package/addon/components/pix-pagination.hbs +3 -2
  12. package/addon/components/pix-radio-button.hbs +2 -2
  13. package/addon/components/pix-search-input.hbs +7 -6
  14. package/addon/components/pix-search-input.js +6 -19
  15. package/addon/components/pix-select.hbs +135 -129
  16. package/addon/components/pix-textarea.hbs +23 -19
  17. package/addon/components/pix-textarea.js +6 -0
  18. package/addon/components/pix-toggle.hbs +3 -3
  19. package/addon/components/pix-toggle.js +5 -0
  20. package/addon/styles/_pix-input-password.scss +19 -13
  21. package/addon/styles/_pix-input.scss +9 -2
  22. package/addon/styles/_pix-label.scss +0 -1
  23. package/addon/styles/_pix-multi-select.scss +9 -1
  24. package/addon/styles/_pix-search-input.scss +8 -1
  25. package/addon/styles/_pix-select.scss +9 -1
  26. package/addon/styles/_pix-toggle.scss +8 -1
  27. package/app/stories/form.stories.js +31 -24
  28. package/app/stories/pix-checkbox.mdx +2 -2
  29. package/app/stories/pix-checkbox.stories.js +52 -33
  30. package/app/stories/pix-filter-banner.stories.js +9 -6
  31. package/app/stories/pix-filterable-and-searchable-select.mdx +9 -8
  32. package/app/stories/pix-filterable-and-searchable-select.stories.js +13 -11
  33. package/app/stories/pix-input-password.mdx +8 -5
  34. package/app/stories/pix-input-password.stories.js +50 -28
  35. package/app/stories/pix-input.mdx +14 -8
  36. package/app/stories/pix-input.stories.js +46 -21
  37. package/app/stories/pix-label.stories.js +3 -2
  38. package/app/stories/pix-multi-select.mdx +7 -5
  39. package/app/stories/pix-multi-select.stories.js +74 -36
  40. package/app/stories/pix-radio-button.mdx +3 -1
  41. package/app/stories/pix-radio-button.stories.js +47 -40
  42. package/app/stories/pix-search-input.mdx +6 -4
  43. package/app/stories/pix-search-input.stories.js +57 -22
  44. package/app/stories/pix-select.mdx +4 -3
  45. package/app/stories/pix-select.stories.js +64 -57
  46. package/app/stories/pix-textarea.mdx +6 -2
  47. package/app/stories/pix-textarea.stories.js +42 -20
  48. package/app/stories/pix-toggle.stories.js +12 -10
  49. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  <div
2
- class="pix-select"
2
+ class="pix-select {{if @inlineLabel ' pix-select--inline'}}"
3
3
  id="container-{{this.selectId}}"
4
4
  {{on-click-outside this.hideDropdown}}
5
5
  {{on-arrow-down-up-action this.listId this.showDropdown this.isExpanded}}
@@ -8,146 +8,152 @@
8
8
  {{on "keydown" this.lockTab}}
9
9
  ...attributes
10
10
  >
11
- {{#if @label}}
11
+ {{#if (has-block "label")}}
12
12
  <PixLabel
13
13
  @for={{this.selectId}}
14
- @requiredLabel={{@requiredText}}
14
+ @requiredLabel={{@requiredLabel}}
15
15
  @subLabel={{@subLabel}}
16
- @labelSize={{@labelSize}}
16
+ @size={{@size}}
17
17
  @screenReaderOnly={{@screenReaderOnly}}
18
+ @inlineLabel={{@inlineLabel}}
18
19
  >
19
- {{@label}}
20
+ {{yield to="label"}}
20
21
  </PixLabel>
21
22
  {{/if}}
22
23
 
23
- <PopperJS @placement={{@placement}} as |reference popover|>
24
- <button
25
- {{reference}}
26
- type="button"
27
- id={{this.selectId}}
28
- class={{this.className}}
29
- {{on "click" this.toggleDropdown}}
30
- aria-expanded={{this.isAriaExpanded}}
31
- aria-controls={{this.listId}}
32
- aria-disabled={{@isDisabled}}
33
- >
34
- {{#if @icon}}
35
- <FaIcon @icon={{@icon}} />
36
- {{/if}}
24
+ <div>
25
+ <PopperJS @placement={{@placement}} as |reference popover|>
26
+ <button
27
+ {{reference}}
28
+ type="button"
29
+ id={{this.selectId}}
30
+ class={{this.className}}
31
+ {{on "click" this.toggleDropdown}}
32
+ aria-expanded={{this.isAriaExpanded}}
33
+ aria-controls={{this.listId}}
34
+ aria-disabled={{@isDisabled}}
35
+ >
36
+ {{#if @icon}}
37
+ <FaIcon @icon={{@icon}} />
38
+ {{/if}}
37
39
 
38
- <span class="pix-select-button__text">{{this.placeholder}}</span>
40
+ <span class="pix-select-button__text">{{this.placeholder}}</span>
39
41
 
40
- <FaIcon
41
- class="pix-select-button__dropdown-icon"
42
- @icon={{if this.isExpanded "chevron-up" "chevron-down"}}
43
- />
44
- </button>
45
- <div
46
- {{popover}}
47
- class="pix-select__dropdown{{unless this.isExpanded ' pix-select__dropdown--closed'}}"
48
- id={{this.dropDownId}}
49
- {{on "transitionend" this.focus}}
50
- >
51
- {{#if @isSearchable}}
52
- <div class="pix-select__search">
53
- <FaIcon class="pix-select-search__icon" @icon="magnifying-glass" />
54
- <label class="screen-reader-only" for={{this.searchId}}>{{@searchLabel}}</label>
55
- <input
56
- class="pix-select-search__input"
57
- id={{this.searchId}}
58
- autocomplete="off"
59
- tabindex={{if this.isExpanded "0" "-1"}}
60
- placeholder={{@searchPlaceholder}}
61
- {{on "input" this.setSearchValue}}
62
- />
63
- </div>
64
- {{/if}}
65
- <ul role="listbox" id={{this.listId}} class="pix-select__options">
66
- <li
67
- class="pix-select-options-category__option{{unless
68
- @value
69
- ' pix-select-options-category__option--selected'
70
- }}{{unless this.displayDefaultOption ' pix-select-options-category__option--hidden'}}"
71
- role="option"
72
- tabindex={{if this.isDefaultOptionHidden "-1" "0"}}
73
- aria-selected={{if @value "false" "true"}}
74
- {{on "click" (fn this.onChange this.defaultOption)}}
75
- {{on-enter-action (fn this.onChange this.defaultOption)}}
76
- {{on-space-action (fn this.onChange this.defaultOption)}}
77
- >
78
- {{@placeholder}}
79
- </li>
80
- {{#if this.results}}
81
- {{#if this.displayCategory}}
82
- {{#each this.results as |element index|}}
83
- <ul
84
- class="pix-select-options__category"
85
- role="group"
86
- aria-labelledby={{if this.displayCategory (concat "cat-" this.selectId "-" index)}}
87
- >
88
- {{#if this.displayCategory}}
89
- <li
90
- class="pix-select-options-category__name"
91
- role="presentation"
92
- id={{concat "cat-" this.selectId "-" index}}
93
- >
94
- {{element.category}}
95
- </li>
96
- {{/if}}
42
+ <FaIcon
43
+ class="pix-select-button__dropdown-icon"
44
+ @icon={{if this.isExpanded "chevron-up" "chevron-down"}}
45
+ />
46
+ </button>
47
+ <div
48
+ {{popover}}
49
+ class="pix-select__dropdown{{unless this.isExpanded ' pix-select__dropdown--closed'}}"
50
+ id={{this.dropDownId}}
51
+ {{on "transitionend" this.focus}}
52
+ >
53
+ {{#if @isSearchable}}
54
+ <div class="pix-select__search">
55
+ <FaIcon class="pix-select-search__icon" @icon="magnifying-glass" />
56
+ <label class="screen-reader-only" for={{this.searchId}}>{{@searchLabel}}</label>
57
+ <input
58
+ class="pix-select-search__input"
59
+ id={{this.searchId}}
60
+ autocomplete="off"
61
+ tabindex={{if this.isExpanded "0" "-1"}}
62
+ placeholder={{@searchPlaceholder}}
63
+ {{on "input" this.setSearchValue}}
64
+ />
65
+ </div>
66
+ {{/if}}
67
+ <ul role="listbox" id={{this.listId}} class="pix-select__options">
68
+ <li
69
+ class="pix-select-options-category__option{{unless
70
+ @value
71
+ ' pix-select-options-category__option--selected'
72
+ }}{{unless this.displayDefaultOption ' pix-select-options-category__option--hidden'}}"
73
+ role="option"
74
+ tabindex={{if this.isDefaultOptionHidden "-1" "0"}}
75
+ aria-selected={{if @value "false" "true"}}
76
+ {{on "click" (fn this.onChange this.defaultOption)}}
77
+ {{on-enter-action (fn this.onChange this.defaultOption)}}
78
+ {{on-space-action (fn this.onChange this.defaultOption)}}
79
+ >
80
+ {{@placeholder}}
81
+ </li>
82
+ {{#if this.results}}
83
+ {{#if this.displayCategory}}
84
+ {{#each this.results as |element index|}}
85
+ <ul
86
+ class="pix-select-options__category"
87
+ role="group"
88
+ aria-labelledby={{if
89
+ this.displayCategory
90
+ (concat "cat-" this.selectId "-" index)
91
+ }}
92
+ >
93
+ {{#if this.displayCategory}}
94
+ <li
95
+ class="pix-select-options-category__name"
96
+ role="presentation"
97
+ id={{concat "cat-" this.selectId "-" index}}
98
+ >
99
+ {{element.category}}
100
+ </li>
101
+ {{/if}}
97
102
 
98
- {{#each element.options as |option|}}
99
- {{! template-lint-disable require-context-role }}
100
- {{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
101
- <li
102
- class="pix-select-options-category__option{{if
103
- (eq option.value @value)
104
- ' pix-select-options-category__option--selected'
105
- }}"
106
- role="option"
107
- tabindex={{if this.isExpanded "0" "-1"}}
108
- aria-selected={{if (eq option.value @value) "true" "false"}}
109
- {{on "click" (fn this.onChange option)}}
110
- {{on-enter-action (fn this.onChange option)}}
111
- {{on-space-action (fn this.onChange option)}}
112
- >
113
- {{option.label}}
103
+ {{#each element.options as |option|}}
104
+ {{! template-lint-disable require-context-role }}
105
+ {{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
106
+ <li
107
+ class="pix-select-options-category__option{{if
108
+ (eq option.value @value)
109
+ ' pix-select-options-category__option--selected'
110
+ }}"
111
+ role="option"
112
+ tabindex={{if this.isExpanded "0" "-1"}}
113
+ aria-selected={{if (eq option.value @value) "true" "false"}}
114
+ {{on "click" (fn this.onChange option)}}
115
+ {{on-enter-action (fn this.onChange option)}}
116
+ {{on-space-action (fn this.onChange option)}}
117
+ >
118
+ {{option.label}}
114
119
 
115
- {{#if (eq option.value @value)}}
116
- <FaIcon @icon="check" role="presentation" />
117
- {{/if}}
118
- </li>
119
- {{/each}}
120
- </ul>
121
- {{/each}}
122
- {{else}}
123
- {{#each this.results as |option|}}
124
- <li
125
- class="pix-select-options-category__option{{if
126
- (eq option.value @value)
127
- ' pix-select-options-category__option--selected'
128
- }}"
129
- role="option"
130
- tabindex={{if this.isExpanded "0" "-1"}}
131
- aria-selected={{if (eq option.value @value) "true" "false"}}
132
- {{on "click" (fn this.onChange option)}}
133
- {{on-enter-action (fn this.onChange option)}}
134
- {{on-space-action (fn this.onChange this.defaultOption)}}
135
- >
136
- {{option.label}}
120
+ {{#if (eq option.value @value)}}
121
+ <FaIcon @icon="check" role="presentation" />
122
+ {{/if}}
123
+ </li>
124
+ {{/each}}
125
+ </ul>
126
+ {{/each}}
127
+ {{else}}
128
+ {{#each this.results as |option|}}
129
+ <li
130
+ class="pix-select-options-category__option{{if
131
+ (eq option.value @value)
132
+ ' pix-select-options-category__option--selected'
133
+ }}"
134
+ role="option"
135
+ tabindex={{if this.isExpanded "0" "-1"}}
136
+ aria-selected={{if (eq option.value @value) "true" "false"}}
137
+ {{on "click" (fn this.onChange option)}}
138
+ {{on-enter-action (fn this.onChange option)}}
139
+ {{on-space-action (fn this.onChange this.defaultOption)}}
140
+ >
141
+ {{option.label}}
137
142
 
138
- {{#if (eq option.value @value)}}
139
- <FaIcon @icon="check" role="presentation" />
140
- {{/if}}
141
- </li>
142
- {{/each}}
143
+ {{#if (eq option.value @value)}}
144
+ <FaIcon @icon="check" role="presentation" />
145
+ {{/if}}
146
+ </li>
147
+ {{/each}}
148
+ {{/if}}
149
+ {{else}}
150
+ <li class="pix-select__empty-search-message">{{@emptySearchMessage}}</li>
143
151
  {{/if}}
144
- {{else}}
145
- <li class="pix-select__empty-search-message">{{@emptySearchMessage}}</li>
146
- {{/if}}
147
- </ul>
148
- </div>
149
- </PopperJS>
150
- {{#if @errorMessage}}
151
- <p class="pix-select__error-message">{{@errorMessage}}</p>
152
- {{/if}}
152
+ </ul>
153
+ </div>
154
+ </PopperJS>
155
+ {{#if @errorMessage}}
156
+ <p class="pix-select__error-message">{{@errorMessage}}</p>
157
+ {{/if}}
158
+ </div>
153
159
  </div>
@@ -1,29 +1,33 @@
1
- <div class="pix-textarea">
1
+ <div class="pix-textarea {{if @inlineLabel ' pix-textarea--inline'}}">
2
2
  <PixLabel
3
- @for={{@id}}
3
+ @for={{this.id}}
4
4
  @requiredLabel={{@requiredLabel}}
5
5
  @subLabel={{@subLabel}}
6
- @labelSize={{@labelSize}}
6
+ @size={{@size}}
7
7
  @screenReaderOnly={{@screenReaderOnly}}
8
+ @inlineLabel={{@inlineLabel}}
8
9
  >
9
- {{@label}}
10
+ {{yield to="label"}}
10
11
  </PixLabel>
11
12
 
12
- <textarea
13
- id={{@id}}
14
- maxlength={{if @maxlength @maxlength}}
15
- aria-required="{{if @requiredLabel true false}}"
16
- required={{if @requiredLabel true false}}
17
- class="{{if @errorMessage 'pix-textarea--error'}}"
18
- {{on "keyup" this.updateValue}}
19
- ...attributes
20
- >{{@value}}</textarea>
13
+ <div>
14
+ <textarea
15
+ id={{this.id}}
16
+ maxlength={{if @maxlength @maxlength}}
17
+ aria-required="{{if @requiredLabel true false}}"
18
+ required={{if @requiredLabel true false}}
19
+ class="{{if @errorMessage 'pix-textarea--error'}}"
20
+ {{on "keyup" this.updateValue}}
21
+ ...attributes
22
+ >{{@value}}</textarea>
21
23
 
22
- {{#if @maxlength}}
23
- <p>{{this.textLengthIndicator}} / {{@maxlength}}</p>
24
- {{/if}}
24
+ {{#if @maxlength}}
25
+ <p>{{this.textLengthIndicator}} / {{@maxlength}}</p>
26
+ {{/if}}
27
+
28
+ {{#if @errorMessage}}
29
+ <label for={{this.id}} class="pix-textarea__error-message">{{@errorMessage}}</label>
30
+ {{/if}}
31
+ </div>
25
32
 
26
- {{#if @errorMessage}}
27
- <label for={{this.id}} class="pix-textarea__error-message">{{@errorMessage}}</label>
28
- {{/if}}
29
33
  </div>
@@ -1,11 +1,17 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { tracked } from '@glimmer/tracking';
4
+ import { guidFor } from '@ember/object/internals';
4
5
 
5
6
  export default class PixTextarea extends Component {
6
7
  // eslint-disable-next-line ember/no-tracked-properties-from-args
7
8
  @tracked value = this.args.value;
8
9
 
10
+ get id() {
11
+ if (this.args.id) return this.args.id;
12
+ return 'textarea-' + guidFor(this);
13
+ }
14
+
9
15
  get textLengthIndicator() {
10
16
  return this.value ? this.value.length : 0;
11
17
  }
@@ -3,9 +3,9 @@
3
3
  @for={{this.id}}
4
4
  @screenReaderOnly={{@screenReaderOnly}}
5
5
  @subLabel={{@subLabel}}
6
- @labelSize={{@labelSize}}
7
- @inlineLabel={{@inline}}
8
- >{{@label}}</PixLabel>
6
+ @size={{@size}}
7
+ @inlineLabel={{@inlineLabel}}
8
+ >{{yield to="label"}}</PixLabel>
9
9
  <button
10
10
  class="pix-toggle__button"
11
11
  id={{this.id}}
@@ -8,6 +8,11 @@ export default class PixToggle extends Component {
8
8
  if (this.args.toggled) {
9
9
  classes.push('pix-toggle--pressed');
10
10
  }
11
+
12
+ if (this.args.inlineLabel) {
13
+ classes.push('pix-toggle--inline');
14
+ }
15
+
11
16
  return classes.join(' ');
12
17
  }
13
18
 
@@ -1,7 +1,14 @@
1
1
  .pix-input-password {
2
2
  position: relative;
3
- display: flex;
3
+ display: inline-flex;
4
4
  flex-direction: column;
5
+ gap: var(--pix-spacing-1x);
6
+
7
+ &--inline {
8
+ flex-direction: row;
9
+ gap: var(--pix-spacing-2x);
10
+ align-items: center;
11
+ }
5
12
 
6
13
  &__container {
7
14
  @extend %pix-form-element-state;
@@ -12,6 +19,17 @@
12
19
  border: 1px solid var(--pix-neutral-500);
13
20
  border-radius: var(--pix-spacing-1x);
14
21
 
22
+ &--error {
23
+ @extend %pix-form-error-state;
24
+
25
+ padding-right: var(--pix-spacing-6x);
26
+ }
27
+
28
+ &--success {
29
+ @extend %pix-form-success-state;
30
+
31
+ padding-right: var(--pix-spacing-6x);
32
+ }
15
33
 
16
34
  input {
17
35
  @extend %pix-input-default;
@@ -44,18 +62,6 @@
44
62
  }
45
63
  }
46
64
 
47
- &__error-container {
48
- @extend %pix-form-error-state;
49
-
50
- padding-right: var(--pix-spacing-6x);
51
- }
52
-
53
- &__success-container {
54
- @extend %pix-form-success-state;
55
-
56
- padding-right: var(--pix-spacing-6x);
57
- }
58
-
59
65
  &__icon {
60
66
  position: absolute;
61
67
  right: 12px;
@@ -1,7 +1,14 @@
1
1
  .pix-input {
2
2
  position: relative;
3
- display: flex;
3
+ display: inline-flex;
4
4
  flex-direction: column;
5
+ gap: var(--pix-spacing-1x);
6
+
7
+ &--inline {
8
+ flex-direction: row;
9
+ gap: var(--pix-spacing-2x);
10
+ align-items: center;
11
+ }
5
12
 
6
13
  &__container {
7
14
  position: relative;
@@ -10,7 +17,7 @@
10
17
  svg {
11
18
  position: absolute;
12
19
  right: 12px;
13
- bottom: 11px;
20
+ bottom: calc(50% - 7px); // height/2 + padding
14
21
  width: 10px;
15
22
  height: 10px;
16
23
  padding: 2px;
@@ -1,6 +1,5 @@
1
1
  .pix-label {
2
2
  display: block;
3
- margin-bottom: var(--pix-spacing-1x);
4
3
  color: var(--pix-neutral-900);
5
4
  font-weight: var(--pix-font-medium);
6
5
 
@@ -1,6 +1,14 @@
1
1
  .pix-multi-select {
2
2
  position: relative;
3
- display: inline-block;
3
+ display: inline-flex;
4
+ flex-direction: column;
5
+ gap: var(--pix-spacing-1x);
6
+
7
+ &--inline {
8
+ flex-direction: row;
9
+ gap: var(--pix-spacing-2x);
10
+ align-items: center;
11
+ }
4
12
  }
5
13
 
6
14
  .pix-multi-select-header {
@@ -1,7 +1,14 @@
1
1
  .pix-search-input {
2
2
  position: relative;
3
- display: flex;
3
+ display: inline-flex;
4
4
  flex-direction: column;
5
+ gap: var(--pix-spacing-1x);
6
+
7
+ &--inline {
8
+ flex-direction: row;
9
+ gap: var(--pix-spacing-2x);
10
+ align-items: center;
11
+ }
5
12
 
6
13
  &__input-container {
7
14
  position: relative;
@@ -1,6 +1,14 @@
1
1
  .pix-select {
2
2
  position: relative;
3
- display: inline-block;
3
+ display: inline-flex;
4
+ flex-direction: column;
5
+ gap: var(--pix-spacing-1x);
6
+
7
+ &--inline {
8
+ flex-direction: row;
9
+ gap: var(--pix-spacing-2x);
10
+ align-items: center;
11
+ }
4
12
 
5
13
  &__dropdown {
6
14
  @extend %pix-shadow-sm;
@@ -1,6 +1,13 @@
1
1
  .pix-toggle {
2
- display: flex;
2
+ display: inline-flex;
3
3
  flex-direction: column;
4
+ gap: var(--pix-spacing-1x);
5
+
6
+ &--inline {
7
+ flex-direction: row;
8
+ gap: var(--pix-spacing-2x);
9
+ align-items: center;
10
+ }
4
11
 
5
12
  &__button {
6
13
  width: fit-content;
@@ -10,75 +10,82 @@ export const form = (args) => {
10
10
  template: hbs`<form>
11
11
  <PixInput
12
12
  @id='firstName'
13
- @label='Prénom'
14
13
  @errorMessage={{this.genericErrorMessage}}
15
14
  @requiredLabel='champ obligatoire'
16
15
  @validationStatus={{this.validationStatus}}
17
- />
16
+ >
17
+ <:label>Prénom</:label>
18
+ </PixInput>
18
19
  <br />
19
- <PixInputPassword
20
- @id='password'
21
- @label='Mot de passe'
22
- @errorMessage={{this.genericErrorMessage}}
23
- />
20
+ <PixInputPassword @id='password' @errorMessage={{this.genericErrorMessage}}>
21
+ <:label>Mot de passe</:label>
22
+ </PixInputPassword>
24
23
  <br />
25
24
 
26
25
  <PixMultiSelect
27
- @innerText='Votre notation en étoiles...'
28
26
  @id='form__pix-multi-select'
29
- @label='A quel point aimez-vous Pix UI ?'
30
27
  @onSelect={{this.onSelect}}
31
28
  @selected={{this.selected}}
32
29
  @options={{this.options}}
33
- as |star|
34
30
  >
35
- <PixStars @count={{star.value}} @total={{star.total}} />
31
+ <:label>A quel point aimez-vous Pix UI ?</:label>
32
+ <:placeholder>Votre notation en étoiles...</:placeholder>
33
+ <:default as |star|>
34
+ <PixStars @count={{star.value}} @total={{star.total}} />
35
+ </:default>
36
36
  </PixMultiSelect>
37
37
  <br /><br />
38
38
 
39
39
  <PixMultiSelect
40
- @innerText='Mes condiments'
41
40
  @id='form__pix-multi-select-searchable'
42
- @label='Choississez vos condiments'
43
41
  @onSelect={{this.onSelect}}
44
42
  @selected={{this.selected}}
45
43
  @isSearchable={{true}}
46
44
  @options={{this.optionsSearch}}
47
- as |condiment|
48
45
  >
49
- {{condiment.label}}
46
+ <:label>Choississez vos condiments</:label>
47
+ <:placeholder>Mes condiments</:placeholder>
48
+ <:default as |condiment|>
49
+ {{condiment.label}}
50
+ </:default>
50
51
  </PixMultiSelect>
51
52
  <br /><br />
52
53
  {{! template-lint-disable no-inline-styles }}
53
54
 
54
55
  <PixSelect
55
56
  @id='form__searchable-pix-select'
56
- @label='Votre fruit préféré est : '
57
57
  @options={{this.selectOptions}}
58
58
  @isSearchable={{true}}
59
59
  @isValidationActive={{true}}
60
60
  placeholder='Fraises, Mangues...'
61
61
  style='width:100%'
62
- />
62
+ >
63
+ <:label>Votre fruit préféré est :</:label>
64
+ </PixSelect>
63
65
  <br />
64
66
 
65
67
  <PixTextarea
66
68
  @id='form__pix-textarea'
67
- @value=''
68
69
  @maxlength={{200}}
69
- @label='Un commentaire ?'
70
70
  @requiredLabel='Champ obligatoire'
71
71
  @errorMessage={{this.genericErrorMessage}}
72
- />
72
+ >
73
+ <:label>Un commentaire ?</:label>
74
+ </PixTextarea>
73
75
  <br />
74
76
 
75
77
  <label class='pix-form__label'> Votre légume préféré est : </label>
76
- <PixRadioButton @label='Chou' @value='chou' name='légume' />
77
- <PixRadioButton @label='Carotte' @value='carotte' name='légume' />
78
+ <PixRadioButton @value='chou' name='légume'>
79
+ <:label>Chou</:label>
80
+ </PixRadioButton>
81
+ <PixRadioButton @value='carotte' name='légume'>
82
+ <:label>Carotte</:label>
83
+ </PixRadioButton>
84
+
78
85
  <br />
79
86
 
80
- <PixCheckbox @id='spam-pub' @labelSize='small'>
81
- Acceptez-vous de vous faire spammer de PUB ?
87
+ <PixCheckbox @id='spam-pub' @size='small'>
88
+ <:label>Acceptez-vous de vous faire spammer de PUB ?</:label>
82
89
  </PixCheckbox>
83
90
 
84
91
  <br /><br />
@@ -53,10 +53,10 @@ En ce sens, nous avons déjà prévu un espace vertical pour séparer 2 composan
53
53
  <PixCheckbox
54
54
  @screenReaderOnly="{{false}}"
55
55
  @isIndeterminate="{{false}}"
56
- @labelSize="small"
56
+ @size="small"
57
57
  disabled
58
58
  >
59
- Recevoir la newsletter
59
+ <:label>Recevoir la newsletter</:label>
60
60
  </PixCheckbox>
61
61
  ```
62
62