@1024pix/pix-ui 39.0.2 → 40.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/addon/common/add-dynamic-style-tag.js +8 -0
- package/addon/components/pix-filterable-and-searchable-select.hbs +11 -10
- package/addon/components/pix-filterable-and-searchable-select.js +30 -2
- package/addon/components/pix-multi-select.hbs +68 -64
- package/addon/components/pix-multi-select.js +9 -0
- package/addon/components/pix-select.hbs +6 -2
- package/addon/components/pix-select.js +13 -19
- package/addon/styles/_pix-filterable-and-searchable-select.scss +6 -1
- package/addon/styles/_pix-input.scss +11 -0
- package/addon/styles/_pix-multi-select.scss +2 -2
- package/addon/styles/_pix-select.scss +4 -2
- package/addon/styles/pix-design-tokens/_form.scss +1 -0
- package/app/stories/pix-input.mdx +15 -4
- package/app/stories/pix-input.stories.js +16 -0
- package/app/stories/pix-multi-select.stories.js +13 -2
- package/app/stories/pix-select.stories.js +9 -0
- package/package.json +21 -16
- package/.buildpacks +0 -2
- package/.circleci/config.yml +0 -84
- package/.gitattributes +0 -7
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -12
- package/.storybook/logo.svg +0 -1
- package/.storybook/main.js +0 -10
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.js +0 -39
- package/.storybook/storybook-custom-theme.js +0 -37
- package/.stylelintrc.json +0 -17
- package/CHANGELOG.md +0 -1367
- package/CNAME +0 -1
- package/config/environment.js +0 -5
- package/docs/adr/0001-utiliser-les-balises-html-natives.md +0 -51
- package/docs/architecture.mdx +0 -106
- package/docs/assets/accessibility-storybook.png +0 -0
- package/docs/assets/screen-pix-storybook.png +0 -0
- package/docs/breaking-changes.mdx +0 -102
- package/docs/changelog.mdx +0 -6
- package/docs/colors-palette.mdx +0 -237
- package/docs/create-component.mdx +0 -112
- package/docs/design-system.mdx +0 -20
- package/docs/design-tokens.mdx +0 -72
- package/docs/good-practices-a11y.mdx +0 -43
- package/docs/good-practices-design.mdx +0 -62
- package/docs/good-practices-responsive.mdx +0 -51
- package/docs/good-practices-style-css.mdx +0 -40
- package/docs/good-practices-tests.mdx +0 -9
- package/docs/make-a-release.mdx +0 -45
- package/docs/pix-design-tokens-dev.mdx +0 -39
- package/docs/pull_request_template.md +0 -14
- package/docs/shadow.mdx +0 -25
- package/docs/spacing.mdx +0 -19
- package/docs/storybook.mdx +0 -45
- package/docs/test-component-without-release.mdx +0 -19
- package/docs/typography.mdx +0 -163
- package/docs/use-component.mdx +0 -90
- package/docs/use-install.mdx +0 -37
- package/scalingo.json +0 -17
- package/servers.conf.erb +0 -30
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function createClass(name, rules) {
|
|
2
|
+
var style = document.createElement('style');
|
|
3
|
+
style.type = 'text/css';
|
|
4
|
+
document.getElementsByTagName('head')[0].appendChild(style);
|
|
5
|
+
|
|
6
|
+
if (!(style.sheet || {}).insertRule) (style.styleSheet || style.sheet).addRule(name, rules);
|
|
7
|
+
else style.sheet.insertRule(name + '{' + rules + '}', 0);
|
|
8
|
+
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
{{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{{@label}}
|
|
8
|
-
</label>
|
|
1
|
+
<div id={{this.mainId}} ...attributes>
|
|
2
|
+
<label class={{this.classLabel}} for={{this.pixSelectId}}>
|
|
3
|
+
{{#if @requiredText}}
|
|
4
|
+
<abbr class="mandatory-mark" title="{{@requiredText}}" aria-hidden="true">*</abbr>
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{@label}}
|
|
9
7
|
{{#if @subLabel}}
|
|
10
8
|
<span class="pix-select__sub-label">{{@subLabel}}</span>
|
|
11
9
|
{{/if}}
|
|
12
|
-
</
|
|
10
|
+
</label>
|
|
13
11
|
<div
|
|
14
12
|
class="pix-filterable-and-searchable-select{{if
|
|
15
13
|
@errorMessage
|
|
@@ -17,6 +15,7 @@
|
|
|
17
15
|
}}"
|
|
18
16
|
>
|
|
19
17
|
<PixMultiSelect
|
|
18
|
+
id={{this.pixMultiSelectId}}
|
|
20
19
|
@values={{this.selectedCategories}}
|
|
21
20
|
@label={{@categoriesLabel}}
|
|
22
21
|
@options={{this.categories}}
|
|
@@ -28,7 +27,8 @@
|
|
|
28
27
|
<:default as |option|>{{option.label}}</:default>
|
|
29
28
|
</PixMultiSelect>
|
|
30
29
|
<PixSelect
|
|
31
|
-
|
|
30
|
+
{{did-insert this.setSelectWidth}}
|
|
31
|
+
@id={{this.pixSelectId}}
|
|
32
32
|
@placeholder={{@placeholder}}
|
|
33
33
|
@value={{@value}}
|
|
34
34
|
@options={{this.selectableOptions}}
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
@screenReaderOnly={{true}}
|
|
39
39
|
@hideDefaultOption={{@hideDefaultOption}}
|
|
40
40
|
@className="pix-filterable-and-searchable-select__pix-select"
|
|
41
|
+
@isComputeWidthDisabled={{true}}
|
|
41
42
|
/>
|
|
42
43
|
</div>
|
|
43
44
|
{{#if @errorMessage}}
|
|
@@ -2,17 +2,27 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { guidFor } from '@ember/object/internals';
|
|
5
|
+
import { createClass } from '../common/add-dynamic-style-tag';
|
|
5
6
|
|
|
6
7
|
export default class PixFilterableAndSearchableSelect extends Component {
|
|
7
8
|
@tracked selectedCategories = [];
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
mainId = 'pix-pfass-' + guidFor(this);
|
|
10
|
+
pixSelectId = 'pix-pfass-select-' + guidFor(this);
|
|
11
|
+
pixMultiSelectId = 'pix-pfass-multi-select-' + guidFor(this);
|
|
10
12
|
|
|
11
13
|
@action
|
|
12
14
|
selectCategories(categories) {
|
|
13
15
|
this.selectedCategories = categories;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
get classLabel() {
|
|
19
|
+
const cssClass = ['pix-filterable-and-searchable-select__label'];
|
|
20
|
+
|
|
21
|
+
if (this.args.screenReaderOnly) cssClass.push('screen-reader-only');
|
|
22
|
+
|
|
23
|
+
return cssClass.join(' ');
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
get categories() {
|
|
17
27
|
const categoryNames = [];
|
|
18
28
|
this.args.options.forEach((option) => {
|
|
@@ -45,4 +55,22 @@ export default class PixFilterableAndSearchableSelect extends Component {
|
|
|
45
55
|
|
|
46
56
|
return selectableOptions;
|
|
47
57
|
}
|
|
58
|
+
|
|
59
|
+
@action
|
|
60
|
+
setSelectWidth(element) {
|
|
61
|
+
const baseFontRemRatio = Number(
|
|
62
|
+
getComputedStyle(document.querySelector('html')).fontSize.match(/\d+(\.\d+)?/)[0],
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const multiSelectWidth = document
|
|
66
|
+
.getElementById(this.pixMultiSelectId)
|
|
67
|
+
.getBoundingClientRect().width;
|
|
68
|
+
|
|
69
|
+
const selectWidth = Math.ceil(multiSelectWidth / baseFontRemRatio);
|
|
70
|
+
|
|
71
|
+
const className = `sizing-select-${this.pixSelectId}`;
|
|
72
|
+
createClass(`.${className}`, `width: calc(100% - ${selectWidth}rem);`);
|
|
73
|
+
|
|
74
|
+
element.className = element.className + ' ' + className;
|
|
75
|
+
}
|
|
48
76
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<div
|
|
2
2
|
class="pix-multi-select"
|
|
3
|
+
...attributes
|
|
3
4
|
{{on-click-outside this.hideDropDown}}
|
|
4
5
|
{{on-arrow-down-up-action this.listId this.showDropDown this.isExpanded}}
|
|
5
6
|
{{on-escape-action this.hideDropDown this.multiSelectId}}
|
|
@@ -11,75 +12,78 @@
|
|
|
11
12
|
class="pix-multi-select__label{{if @screenReaderOnly ' screen-reader-only'}}"
|
|
12
13
|
>{{@label}}</label>
|
|
13
14
|
{{/if}}
|
|
14
|
-
{{
|
|
15
|
-
<span class="pix-multi-select-header{{if @className this.className}}">
|
|
16
|
-
<FaIcon @icon="magnifying-glass" class="pix-multi-select-header__search-icon" />
|
|
15
|
+
<PopperJS @placement={{@placement}} as |reference popover|>
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
{{#if @isSearchable}}
|
|
18
|
+
<span {{reference}} class={{this.headerClassName}}>
|
|
19
|
+
<FaIcon @icon="magnifying-glass" class="pix-multi-select-header__search-icon" />
|
|
20
|
+
|
|
21
|
+
<input
|
|
22
|
+
class="pix-multi-select-header__search-input"
|
|
23
|
+
id={{this.multiSelectId}}
|
|
24
|
+
type="text"
|
|
25
|
+
name={{this.multiSelectId}}
|
|
26
|
+
placeholder={{this.placeholder}}
|
|
27
|
+
autocomplete="off"
|
|
28
|
+
{{on "input" this.updateSearch}}
|
|
29
|
+
{{on "click" this.toggleDropDown}}
|
|
30
|
+
aria-expanded={{this.isAriaExpanded}}
|
|
31
|
+
aria-controls={{this.listId}}
|
|
32
|
+
aria-haspopup="menu"
|
|
33
|
+
/>
|
|
34
|
+
</span>
|
|
35
|
+
{{else}}
|
|
36
|
+
<button
|
|
37
|
+
{{reference}}
|
|
20
38
|
id={{this.multiSelectId}}
|
|
21
|
-
type="
|
|
22
|
-
name={{this.multiSelectId}}
|
|
23
|
-
placeholder={{this.placeholder}}
|
|
24
|
-
autocomplete="off"
|
|
25
|
-
{{on "input" this.updateSearch}}
|
|
26
|
-
{{on "click" this.toggleDropDown}}
|
|
39
|
+
type="button"
|
|
27
40
|
aria-expanded={{this.isAriaExpanded}}
|
|
28
41
|
aria-controls={{this.listId}}
|
|
29
42
|
aria-haspopup="menu"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
class={{this.headerClassName}}
|
|
44
|
+
{{on "click" this.toggleDropDown}}
|
|
45
|
+
>
|
|
46
|
+
{{#if (has-block "placeholder")}}
|
|
47
|
+
{{yield to="placeholder"}}
|
|
48
|
+
{{else if @placeholder}}
|
|
49
|
+
{{this.placeholder}}
|
|
50
|
+
{{/if}}
|
|
51
|
+
<FaIcon
|
|
52
|
+
class="pix-multi-select-header__dropdown-icon
|
|
53
|
+
{{if this.isExpanded ' pix-multi-select-header__dropdown-icon--expand'}}"
|
|
54
|
+
@icon={{if this.isExpanded "chevron-up" "chevron-down"}}
|
|
55
|
+
/>
|
|
56
|
+
</button>
|
|
57
|
+
{{/if}}
|
|
58
|
+
|
|
59
|
+
<ul
|
|
60
|
+
{{popover}}
|
|
61
|
+
class="pix-multi-select-list {{unless this.isExpanded 'pix-multi-select-list--hidden'}}"
|
|
62
|
+
id={{this.listId}}
|
|
63
|
+
role="menu"
|
|
43
64
|
>
|
|
44
|
-
{{#if (
|
|
45
|
-
{{
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
{{#if (gt this.results.length 0)}}
|
|
66
|
+
{{#each this.results as |option|}}
|
|
67
|
+
<li class="pix-multi-select-list__item" role="menuitem">
|
|
68
|
+
<PixCheckbox
|
|
69
|
+
@id={{concat this.multiSelectId "-" option.value}}
|
|
70
|
+
@checked={{option.checked}}
|
|
71
|
+
@labelSize="small"
|
|
72
|
+
@class="pix-multi-select-list__item-label"
|
|
73
|
+
value={{option.value}}
|
|
74
|
+
{{on "change" this.onSelect}}
|
|
75
|
+
{{on-enter-action this.hideDropDown this.multiSelectId}}
|
|
76
|
+
tabindex={{if this.isExpanded "0" "-1"}}
|
|
77
|
+
>
|
|
78
|
+
{{yield option}}
|
|
79
|
+
</PixCheckbox>
|
|
80
|
+
</li>
|
|
81
|
+
{{/each}}
|
|
82
|
+
{{else}}
|
|
83
|
+
<li
|
|
84
|
+
class="pix-multi-select-list__item pix-multi-select-list__item--no-result"
|
|
85
|
+
>{{@emptyMessage}}</li>
|
|
48
86
|
{{/if}}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{{if this.isExpanded ' pix-multi-select-header__dropdown-icon--expand'}}"
|
|
52
|
-
@icon={{if this.isExpanded "chevron-up" "chevron-down"}}
|
|
53
|
-
/>
|
|
54
|
-
</button>
|
|
55
|
-
{{/if}}
|
|
56
|
-
|
|
57
|
-
<ul
|
|
58
|
-
class="pix-multi-select-list {{unless this.isExpanded 'pix-multi-select-list--hidden'}}"
|
|
59
|
-
id={{this.listId}}
|
|
60
|
-
role="menu"
|
|
61
|
-
>
|
|
62
|
-
{{#if (gt this.results.length 0)}}
|
|
63
|
-
{{#each this.results as |option|}}
|
|
64
|
-
<li class="pix-multi-select-list__item" role="menuitem">
|
|
65
|
-
<PixCheckbox
|
|
66
|
-
@id={{concat this.multiSelectId "-" option.value}}
|
|
67
|
-
@checked={{option.checked}}
|
|
68
|
-
@labelSize="small"
|
|
69
|
-
@class="pix-multi-select-list__item-label"
|
|
70
|
-
value={{option.value}}
|
|
71
|
-
{{on "change" this.onSelect}}
|
|
72
|
-
{{on-enter-action this.hideDropDown this.multiSelectId}}
|
|
73
|
-
tabindex={{if this.isExpanded "0" "-1"}}
|
|
74
|
-
>
|
|
75
|
-
{{yield option}}
|
|
76
|
-
</PixCheckbox>
|
|
77
|
-
</li>
|
|
78
|
-
{{/each}}
|
|
79
|
-
{{else}}
|
|
80
|
-
<li
|
|
81
|
-
class="pix-multi-select-list__item pix-multi-select-list__item--no-result"
|
|
82
|
-
>{{@emptyMessage}}</li>
|
|
83
|
-
{{/if}}
|
|
84
|
-
</ul>
|
|
87
|
+
</ul>
|
|
88
|
+
</PopperJS>
|
|
85
89
|
</div>
|
|
@@ -33,6 +33,15 @@ export default class PixMultiSelect extends Component {
|
|
|
33
33
|
this.options = [...(this.args.options || [])];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
get headerClassName() {
|
|
37
|
+
const classes = ['pix-multi-select-header'];
|
|
38
|
+
if (this.args.className) {
|
|
39
|
+
classes.push(this.args.className);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return classes.join(' ');
|
|
43
|
+
}
|
|
44
|
+
|
|
36
45
|
get multiSelectId() {
|
|
37
46
|
if (this.args.id) return this.args.id;
|
|
38
47
|
return 'select-' + guidFor(this);
|
|
@@ -115,7 +115,9 @@
|
|
|
115
115
|
>
|
|
116
116
|
{{option.label}}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
{{#if (eq option.value @value)}}
|
|
119
|
+
<FaIcon @icon="check" />
|
|
120
|
+
{{/if}}
|
|
119
121
|
</li>
|
|
120
122
|
{{/each}}
|
|
121
123
|
</ul>
|
|
@@ -136,7 +138,9 @@
|
|
|
136
138
|
>
|
|
137
139
|
{{option.label}}
|
|
138
140
|
|
|
139
|
-
|
|
141
|
+
{{#if (eq option.value @value)}}
|
|
142
|
+
<FaIcon @icon="check" />
|
|
143
|
+
{{/if}}
|
|
140
144
|
</li>
|
|
141
145
|
{{/each}}
|
|
142
146
|
{{/if}}
|
|
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { guidFor } from '@ember/object/internals';
|
|
5
|
+
import { createClass } from '../common/add-dynamic-style-tag';
|
|
5
6
|
|
|
6
7
|
export default class PixSelect extends Component {
|
|
7
8
|
@tracked isExpanded = false;
|
|
@@ -162,27 +163,20 @@ export default class PixSelect extends Component {
|
|
|
162
163
|
|
|
163
164
|
@action
|
|
164
165
|
setSelectWidth() {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const className = `sizing-select-${this.selectId}`;
|
|
173
|
-
this.createClass(`.${className}`, `width: ${selectWidth}rem;`);
|
|
166
|
+
if (!this.args.isComputeWidthDisabled) {
|
|
167
|
+
const baseFontRemRatio = Number(
|
|
168
|
+
getComputedStyle(document.querySelector('html')).fontSize.match(/\d+(\.\d+)?/)[0],
|
|
169
|
+
);
|
|
170
|
+
const checkIconWidth = 1.125 * baseFontRemRatio;
|
|
171
|
+
const listWidth = document.getElementById(this.listId).getBoundingClientRect().width;
|
|
172
|
+
const selectWidth = (listWidth + checkIconWidth) / baseFontRemRatio;
|
|
174
173
|
|
|
175
|
-
|
|
174
|
+
const className = `sizing-select-${this.selectId}`;
|
|
175
|
+
createClass(`.${className}`, `width: ${selectWidth}rem;`);
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
}
|
|
177
|
+
const element = document.getElementById(`container-${this.selectId}`);
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
style.type = 'text/css';
|
|
183
|
-
document.getElementsByTagName('head')[0].appendChild(style);
|
|
184
|
-
|
|
185
|
-
if (!(style.sheet || {}).insertRule) (style.styleSheet || style.sheet).addRule(name, rules);
|
|
186
|
-
else style.sheet.insertRule(name + '{' + rules + '}', 0);
|
|
179
|
+
element.className = element.className + ' ' + className;
|
|
180
|
+
}
|
|
187
181
|
}
|
|
188
182
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.pix-filterable-and-searchable-select {
|
|
2
2
|
display: flex;
|
|
3
|
-
width:
|
|
3
|
+
max-width: 100%;
|
|
4
4
|
border: 1px $pix-neutral-45 solid;
|
|
5
5
|
border-radius: 4px;
|
|
6
6
|
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
@include errorMessage();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.pix-select {
|
|
34
|
+
flex: 1 1 0%;
|
|
35
|
+
}
|
|
36
|
+
|
|
33
37
|
.pix-multi-select {
|
|
34
38
|
margin-right: 2px;
|
|
35
39
|
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
&__pix-select {
|
|
61
|
+
width: 100%;
|
|
57
62
|
border-radius: 0 4px 4px 0;
|
|
58
63
|
}
|
|
59
64
|
}
|
|
@@ -51,6 +51,17 @@
|
|
|
51
51
|
&::placeholder {
|
|
52
52
|
color: $pix-neutral-30;
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
&[aria-disabled],
|
|
56
|
+
&[disabled],
|
|
57
|
+
&[readonly] {
|
|
58
|
+
@include formElementDisabled();
|
|
59
|
+
@include hoverFormElementDisabled();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&[readonly] {
|
|
63
|
+
cursor: default;
|
|
64
|
+
}
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
&__input--error {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
&__dropdown {
|
|
14
14
|
position: absolute;
|
|
15
15
|
z-index: 200;
|
|
16
|
-
width:
|
|
16
|
+
width: 100%;
|
|
17
|
+
min-width: fit-content;
|
|
17
18
|
max-height: 12.5rem;
|
|
18
19
|
margin-top: $pix-spacing-xxs;
|
|
19
20
|
padding: 0;
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
.pix-select-button {
|
|
85
86
|
position: relative;
|
|
86
87
|
display: flex;
|
|
88
|
+
gap: $pix-spacing-s;
|
|
87
89
|
align-items: center;
|
|
88
90
|
justify-content: space-between;
|
|
89
91
|
width: 100%;
|
|
@@ -118,7 +120,6 @@
|
|
|
118
120
|
&__dropdown-icon {
|
|
119
121
|
@extend %pix-body-s;
|
|
120
122
|
|
|
121
|
-
margin-left: $pix-spacing-xs;
|
|
122
123
|
color: $pix-neutral-60;
|
|
123
124
|
pointer-events: none;
|
|
124
125
|
}
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
@extend %pix-body-s;
|
|
144
145
|
|
|
145
146
|
display: flex;
|
|
147
|
+
gap: $pix-spacing-m;
|
|
146
148
|
justify-content: space-between;
|
|
147
149
|
padding: $pix-spacing-xs $pix-spacing-m;
|
|
148
150
|
color: $pix-neutral-70;
|
|
@@ -37,27 +37,38 @@ screen.getByLabelText('Prénom exemple: Barry');
|
|
|
37
37
|
|
|
38
38
|
<Story of={ComponentStories.Default} height={100} />
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
## With label and information
|
|
42
41
|
|
|
43
42
|
<Story of={ComponentStories.withLabel} height={110} />
|
|
44
43
|
|
|
45
|
-
|
|
46
44
|
## Error state (with error message)
|
|
47
45
|
|
|
48
46
|
<Story of={ComponentStories.errorState} height={110} />
|
|
49
47
|
|
|
50
|
-
|
|
51
48
|
## Success state
|
|
52
49
|
|
|
53
50
|
<Story of={ComponentStories.successState} height={100} />
|
|
54
51
|
|
|
52
|
+
## Disabled & readonly states
|
|
53
|
+
|
|
54
|
+
[📖 Lire la différence entre les 2 états.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly#attribute_interactions)
|
|
55
|
+
|
|
56
|
+
#### Disabled
|
|
57
|
+
|
|
58
|
+
Un input désactivé n'est pas focusable et n'est pas censé être envoyé à la soumission de formulaire.
|
|
59
|
+
|
|
60
|
+
<Story of={ComponentStories.disabledState} height={100} />
|
|
61
|
+
|
|
62
|
+
#### Readonly
|
|
63
|
+
|
|
64
|
+
En readonly, l'input n'est pas modifiable, mais il est toujours focusable et est soumis normalement.
|
|
65
|
+
|
|
66
|
+
<Story of={ComponentStories.readonlyState} height={100} />
|
|
55
67
|
|
|
56
68
|
## With required label
|
|
57
69
|
|
|
58
70
|
<Story of={ComponentStories.withRequiredLabel} height={100} />
|
|
59
71
|
|
|
60
|
-
|
|
61
72
|
## Usage
|
|
62
73
|
|
|
63
74
|
```html
|
|
@@ -65,6 +65,8 @@ const Template = (args) => {
|
|
|
65
65
|
@requiredLabel={{this.requiredLabel}}
|
|
66
66
|
@ariaLabel={{this.ariaLabel}}
|
|
67
67
|
@validationStatus={{this.validationStatus}}
|
|
68
|
+
disabled={{this.disabled}}
|
|
69
|
+
readonly={{this.readonly}}
|
|
68
70
|
/>`,
|
|
69
71
|
context: args,
|
|
70
72
|
};
|
|
@@ -98,6 +100,20 @@ successState.args = {
|
|
|
98
100
|
validationStatus: 'success',
|
|
99
101
|
};
|
|
100
102
|
|
|
103
|
+
export const disabledState = Template.bind({});
|
|
104
|
+
disabledState.args = {
|
|
105
|
+
id: 'first-name',
|
|
106
|
+
label: 'Prénom',
|
|
107
|
+
disabled: true,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const readonlyState = Template.bind({});
|
|
111
|
+
readonlyState.args = {
|
|
112
|
+
id: 'first-name',
|
|
113
|
+
label: 'Prénom',
|
|
114
|
+
readonly: true,
|
|
115
|
+
};
|
|
116
|
+
|
|
101
117
|
export const withRequiredLabel = Template.bind({});
|
|
102
118
|
withRequiredLabel.args = {
|
|
103
119
|
id: 'first-name',
|
|
@@ -92,14 +92,25 @@ export default {
|
|
|
92
92
|
type: { name: 'boolean', required: false },
|
|
93
93
|
table: { defaultValue: { summary: false } },
|
|
94
94
|
},
|
|
95
|
-
|
|
96
|
-
name: '
|
|
95
|
+
headerClassName: {
|
|
96
|
+
name: 'headerClassName',
|
|
97
97
|
description: 'Cette classe css permet de surcharger le css par défaut du composant.',
|
|
98
98
|
type: { name: 'string', required: false },
|
|
99
99
|
table: {
|
|
100
100
|
type: { summary: 'string' },
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
|
+
placement: {
|
|
104
|
+
name: 'placement',
|
|
105
|
+
description:
|
|
106
|
+
"Permet de placer la dropdown du select par rapport à son bouton. Par défaut, cela s'adapte tout seul.",
|
|
107
|
+
type: { name: 'string', required: false },
|
|
108
|
+
options: ['bottom', 'top', 'left', 'right'],
|
|
109
|
+
table: {
|
|
110
|
+
type: { summary: 'string' },
|
|
111
|
+
defaultValue: { summary: null },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
103
114
|
},
|
|
104
115
|
};
|
|
105
116
|
|
|
@@ -169,6 +169,15 @@ export default {
|
|
|
169
169
|
defaultValue: { summary: null },
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
|
+
isComputeWidthDisabled: {
|
|
173
|
+
name: 'isComputeWidthDisabled',
|
|
174
|
+
description:
|
|
175
|
+
'Permet de ne pas calculer la width du select par rapport à la taille maximum de la dropdown',
|
|
176
|
+
type: { name: 'boolean', required: false },
|
|
177
|
+
table: {
|
|
178
|
+
type: { summary: false },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
172
181
|
},
|
|
173
182
|
};
|
|
174
183
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1024pix/pix-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "40.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"
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@formatjs/intl": "^2.5.1",
|
|
51
51
|
"ember-auto-import": "^2.5.0",
|
|
52
|
-
"ember-cli-babel": "^
|
|
52
|
+
"ember-cli-babel": "^8.0.0",
|
|
53
53
|
"ember-cli-htmlbars": "^6.1.1",
|
|
54
54
|
"ember-cli-sass": "^11.0.1",
|
|
55
55
|
"ember-click-outside": "^6.0.1",
|
|
56
56
|
"ember-popperjs": "^3.0.0",
|
|
57
|
-
"ember-truth-helpers": "^
|
|
57
|
+
"ember-truth-helpers": "^4.0.0",
|
|
58
58
|
"lodash.debounce": "^4.0.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@1024pix/ember-testing-library": "^0.
|
|
61
|
+
"@1024pix/ember-testing-library": "^0.8.0",
|
|
62
62
|
"@1024pix/eslint-config": "^1.0.3",
|
|
63
63
|
"@1024pix/storybook-ember": "^7.1.1",
|
|
64
64
|
"@1024pix/stylelint-config": "^4.0.1",
|
|
@@ -75,17 +75,17 @@
|
|
|
75
75
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
76
76
|
"@glimmer/component": "^1.1.2",
|
|
77
77
|
"@glimmer/tracking": "^1.1.2",
|
|
78
|
-
"@storybook/addon-a11y": "
|
|
79
|
-
"@storybook/addon-controls": "
|
|
80
|
-
"@storybook/addon-docs": "
|
|
81
|
-
"@storybook/addon-essentials": "
|
|
82
|
-
"@storybook/addon-mdx-gfm": "
|
|
83
|
-
"@storybook/addons": "
|
|
84
|
-
"@storybook/blocks": "
|
|
85
|
-
"@storybook/builder-webpack5": "
|
|
78
|
+
"@storybook/addon-a11y": "7.1.0",
|
|
79
|
+
"@storybook/addon-controls": "7.1.0",
|
|
80
|
+
"@storybook/addon-docs": "7.1.0",
|
|
81
|
+
"@storybook/addon-essentials": "7.1.0",
|
|
82
|
+
"@storybook/addon-mdx-gfm": "7.1.0",
|
|
83
|
+
"@storybook/addons": "7.1.0",
|
|
84
|
+
"@storybook/blocks": "7.1.0",
|
|
85
|
+
"@storybook/builder-webpack5": "7.1.0",
|
|
86
86
|
"@storybook/ember-cli-storybook": "^0.6.0",
|
|
87
87
|
"@storybook/storybook-deployer": "^2.8.16",
|
|
88
|
-
"@storybook/theming": "
|
|
88
|
+
"@storybook/theming": "7.1.0",
|
|
89
89
|
"@testing-library/dom": "^8.20.0",
|
|
90
90
|
"@testing-library/user-event": "^14.4.3",
|
|
91
91
|
"chromatic": "^6.17.3",
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
"ember-disable-prototype-extensions": "^1.1.3",
|
|
99
99
|
"ember-export-application-global": "^2.0.1",
|
|
100
100
|
"ember-load-initializers": "^2.1.2",
|
|
101
|
-
"ember-page-title": "^
|
|
101
|
+
"ember-page-title": "^8.0.0",
|
|
102
102
|
"ember-qunit": "^7.0.0",
|
|
103
|
-
"ember-resolver": "^
|
|
103
|
+
"ember-resolver": "^11.0.0",
|
|
104
104
|
"ember-sinon": "^5.0.0",
|
|
105
105
|
"ember-source": "^4.0.1",
|
|
106
106
|
"ember-source-channel-url": "^3.0.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"ember-template-lint-plugin-prettier": "^5.0.0",
|
|
109
109
|
"ember-try": "^3.0.0-beta",
|
|
110
110
|
"eslint": "^8.28.0",
|
|
111
|
-
"eslint-config-prettier": "^
|
|
111
|
+
"eslint-config-prettier": "^9.0.0",
|
|
112
112
|
"eslint-plugin-ember": "^11.2.0",
|
|
113
113
|
"eslint-plugin-node": "^11.1.0",
|
|
114
114
|
"eslint-plugin-prettier": "^5.0.0",
|
|
@@ -136,6 +136,11 @@
|
|
|
136
136
|
"ember-addon": {
|
|
137
137
|
"configPath": "tests/dummy/config"
|
|
138
138
|
},
|
|
139
|
+
"files": [
|
|
140
|
+
"addon/",
|
|
141
|
+
"app/",
|
|
142
|
+
"public/"
|
|
143
|
+
],
|
|
139
144
|
"storybook-deployer": {
|
|
140
145
|
"commitMessage": "Deploy Storybook [skip ci]"
|
|
141
146
|
}
|
package/.buildpacks
DELETED