@1024pix/pix-ui 41.2.0 → 42.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 (42) hide show
  1. package/addon/components/pix-button-base.js +1 -1
  2. package/addon/components/pix-button.hbs +31 -42
  3. package/addon/components/pix-input-code.hbs +0 -1
  4. package/addon/components/pix-input-password.hbs +1 -1
  5. package/addon/components/pix-input.hbs +2 -2
  6. package/addon/components/pix-search-input.hbs +0 -2
  7. package/addon/components/pix-select.hbs +4 -5
  8. package/addon/components/pix-select.js +1 -3
  9. package/addon/styles/_pix-button-base.scss +13 -13
  10. package/addon/styles/_pix-filterable-and-searchable-select.scss +8 -18
  11. package/addon/styles/_pix-input-code.scss +2 -4
  12. package/addon/styles/_pix-input-password.scss +8 -10
  13. package/addon/styles/_pix-input.scss +15 -32
  14. package/addon/styles/_pix-multi-select.scss +2 -6
  15. package/addon/styles/_pix-return-to.scss +1 -20
  16. package/addon/styles/_pix-search-input.scss +3 -3
  17. package/addon/styles/_pix-select.scss +5 -14
  18. package/addon/styles/_pix-textarea.scss +5 -7
  19. package/addon/styles/addon.scss +1 -0
  20. package/addon/styles/{pix-design-tokens → component-state}/_form.scss +52 -56
  21. package/addon/styles/component-state/index.scss +1 -0
  22. package/addon/styles/normalize-reset/_reset.scss +1 -1
  23. package/addon/styles/pix-design-tokens/index.scss +0 -1
  24. package/app/stories/form.stories.js +7 -5
  25. package/app/stories/pix-background-header.stories.js +2 -0
  26. package/app/stories/pix-button-link.stories.js +11 -3
  27. package/app/stories/pix-button.stories.js +10 -20
  28. package/app/stories/pix-checkbox.stories.js +6 -10
  29. package/app/stories/pix-filter-banner.stories.js +21 -3
  30. package/app/stories/pix-filterable-and-searchable-select.stories.js +15 -17
  31. package/app/stories/pix-indicator-card.stories.js +17 -17
  32. package/app/stories/pix-modal.stories.js +12 -2
  33. package/app/stories/pix-multi-select.stories.js +56 -61
  34. package/app/stories/pix-progress-gauge.stories.js +2 -1
  35. package/app/stories/pix-radio-button.stories.js +16 -16
  36. package/app/stories/pix-search-input.stories.js +8 -10
  37. package/app/stories/pix-select.stories.js +55 -58
  38. package/app/stories/pix-selectable-tag.stories.js +8 -2
  39. package/app/stories/pix-sidebar.stories.js +9 -3
  40. package/app/stories/pix-toggle.stories.js +13 -21
  41. package/app/stories/pix-tooltip.stories.js +2 -0
  42. package/package.json +7 -6
@@ -21,7 +21,7 @@ export default class PixButtonBase extends Component {
21
21
  `pix-button--${this.backgroundColor}`,
22
22
  ];
23
23
  this.args.isBorderVisible && classNames.push('pix-button--border');
24
- this.args.isDisabled && classNames.push('pix-button--disabled');
24
+
25
25
  return classNames;
26
26
  }
27
27
  }
@@ -1,44 +1,33 @@
1
- {{#if @route}}
2
- <LinkTo
3
- @route={{@route}}
4
- @models={{if @model (array @model) this.defaultModel}}
5
- class={{this.className}}
6
- ...attributes
7
- >
1
+ <button
2
+ type={{this.type}}
3
+ class={{this.className}}
4
+ {{on "click" this.triggerAction}}
5
+ ...attributes
6
+ disabled={{this.isDisabled}}
7
+ aria-disabled="{{this.isDisabled}}"
8
+ >
9
+ {{#if this.isLoading}}
10
+ <div class="loader loader--{{this.loadingColor}}">
11
+ <div class="bounce1"></div>
12
+ <div class="bounce2"></div>
13
+ <div class="bounce3"></div>
14
+ </div>
15
+ <span class="loader__not-visible-text">{{yield}}</span>
16
+ {{else}}
17
+ {{#if @iconBefore}}
18
+ <FaIcon
19
+ class="pix-button__icon pix-button__icon--before"
20
+ @icon={{@iconBefore}}
21
+ @prefix={{@prefixIconBefore}}
22
+ />
23
+ {{/if}}
8
24
  {{yield}}
9
- </LinkTo>
10
- {{else}}
11
- <button
12
- type={{this.type}}
13
- class={{this.className}}
14
- {{on "click" this.triggerAction}}
15
- ...attributes
16
- disabled={{this.isDisabled}}
17
- aria-disabled="{{this.isDisabled}}"
18
- >
19
- {{#if this.isLoading}}
20
- <div class="loader loader--{{this.loadingColor}}">
21
- <div class="bounce1"></div>
22
- <div class="bounce2"></div>
23
- <div class="bounce3"></div>
24
- </div>
25
- <span class="loader__not-visible-text">{{yield}}</span>
26
- {{else}}
27
- {{#if @iconBefore}}
28
- <FaIcon
29
- class="pix-button__icon pix-button__icon--before"
30
- @icon={{@iconBefore}}
31
- @prefix={{@prefixIconBefore}}
32
- />
33
- {{/if}}
34
- {{yield}}
35
- {{#if @iconAfter}}
36
- <FaIcon
37
- class="pix-button__icon pix-button__icon--after"
38
- @icon={{@iconAfter}}
39
- @prefix={{@prefixIconAfter}}
40
- />
41
- {{/if}}
25
+ {{#if @iconAfter}}
26
+ <FaIcon
27
+ class="pix-button__icon pix-button__icon--after"
28
+ @icon={{@iconAfter}}
29
+ @prefix={{@prefixIconAfter}}
30
+ />
42
31
  {{/if}}
43
- </button>
44
- {{/if}}
32
+ {{/if}}
33
+ </button>
@@ -1,4 +1,3 @@
1
- {{! template-lint-disable no-down-event-binding }}
2
1
  <div class="pix-input-code">
3
2
  <fieldset aria-describedby="pix-input-code__details-of-use">
4
3
  <p id="pix-input-code__details-of-use">{{this.explanationOfUse}}</p>
@@ -8,7 +8,7 @@
8
8
  {{this.label}}
9
9
 
10
10
  {{#if @information}}
11
- <span class="pix-input__information">{{@information}}</span>
11
+ <span class="pix-input__sub-label">{{@information}}</span>
12
12
  {{/if}}
13
13
  </label>
14
14
  {{/if}}
@@ -8,7 +8,7 @@
8
8
  {{@label}}
9
9
 
10
10
  {{#if @information}}
11
- <span class="pix-input__information">{{@information}}</span>
11
+ <span class="pix-input__sub-label">{{@information}}</span>
12
12
  {{/if}}
13
13
  </label>
14
14
  {{/if}}
@@ -16,7 +16,7 @@
16
16
  <div class="pix-input__container">
17
17
  <input
18
18
  id={{this.id}}
19
- class="pix-input__input--default {{this.validationStatusClassName}}"
19
+ class="pix-input__input {{this.validationStatusClassName}}"
20
20
  value={{@value}}
21
21
  aria-label={{this.ariaLabel}}
22
22
  aria-required="{{if @requiredLabel true false}}"
@@ -5,11 +5,9 @@
5
5
 
6
6
  <div class="pix-search-input__input-container">
7
7
  <FaIcon @icon="magnifying-glass" />
8
- {{! template-lint-disable require-input-label }}
9
8
  <input
10
9
  id={{this.searchInputId}}
11
10
  class="pix-search-input__input"
12
- role="searchbox"
13
11
  name={{@inputName}}
14
12
  placeholder={{@placeholder}}
15
13
  aria-label={{this.ariaLabel}}
@@ -1,4 +1,3 @@
1
- {{! template-lint-disable no-down-event-binding require-context-role require-presentational-children }}
2
1
  <div
3
2
  class="pix-select"
4
3
  id="container-{{this.selectId}}"
@@ -89,8 +88,6 @@
89
88
  aria-labelledby={{if this.displayCategory (concat "cat-" this.selectId "-" index)}}
90
89
  >
91
90
  {{#if this.displayCategory}}
92
- {{! template-lint-disable no-invalid-role }}
93
- {{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
94
91
  <li
95
92
  class="pix-select-options-category__name"
96
93
  role="presentation"
@@ -101,6 +98,8 @@
101
98
  {{/if}}
102
99
 
103
100
  {{#each element.options as |option|}}
101
+ {{! template-lint-disable require-context-role }}
102
+ {{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
104
103
  <li
105
104
  class="pix-select-options-category__option{{if
106
105
  (eq option.value @value)
@@ -116,7 +115,7 @@
116
115
  {{option.label}}
117
116
 
118
117
  {{#if (eq option.value @value)}}
119
- <FaIcon @icon="check" />
118
+ <FaIcon @icon="check" role="presentation" />
120
119
  {{/if}}
121
120
  </li>
122
121
  {{/each}}
@@ -139,7 +138,7 @@
139
138
  {{option.label}}
140
139
 
141
140
  {{#if (eq option.value @value)}}
142
- <FaIcon @icon="check" />
141
+ <FaIcon @icon="check" role="presentation" />
143
142
  {{/if}}
144
143
  </li>
145
144
  {{/each}}
@@ -46,9 +46,7 @@ export default class PixSelect extends Component {
46
46
  if (this.args.errorMessage) {
47
47
  classes.push('pix-select-button--error');
48
48
  }
49
- if (this.args.isDisabled) {
50
- classes.push('pix-select-button--disabled');
51
- }
49
+
52
50
  return classes.join(' ');
53
51
  }
54
52
 
@@ -12,7 +12,12 @@
12
12
  outline: none;
13
13
  cursor: pointer;
14
14
 
15
- &:not(.pix-button--disabled) {
15
+ &[aria-disabled] {
16
+ cursor: not-allowed;
17
+ opacity: 0.5;
18
+ }
19
+
20
+ &:not([aria-disabled]) {
16
21
  &:hover {
17
22
  background-color: var(--pix-primary-700);
18
23
  }
@@ -50,15 +55,10 @@
50
55
  padding: var(--pix-spacing-2x) var(--pix-spacing-4x);
51
56
  }
52
57
 
53
- &--disabled {
54
- cursor: not-allowed;
55
- opacity: 0.5;
56
- }
57
-
58
58
  &--blue, &--primary {
59
59
  background-color: var(--pix-primary-500);
60
60
 
61
- &:not(.pix-button--disabled) {
61
+ &:not([aria-disabled]) {
62
62
  &:hover {
63
63
  background-color: var(--pix-primary-700);
64
64
  }
@@ -80,7 +80,7 @@
80
80
  &--green, &--success {
81
81
  background-color: var(--pix-success-500);
82
82
 
83
- &:not(.pix-button--disabled) {
83
+ &:not([aria-disabled]) {
84
84
  &:hover {
85
85
  background-color: var(--pix-success-700);
86
86
  }
@@ -103,7 +103,7 @@
103
103
  color: var(--pix-neutral-900);
104
104
  background-color: var(--pix-secondary-500);
105
105
 
106
- &:not(.pix-button--disabled) {
106
+ &:not([aria-disabled]) {
107
107
  &:hover {
108
108
  color: var(--pix-neutral-0);
109
109
  background-color: var(--pix-secondary-700);
@@ -129,7 +129,7 @@
129
129
  color: var(--pix-neutral-0);
130
130
  background-color: var(--pix-error-500);
131
131
 
132
- &:not(.pix-button--disabled) {
132
+ &:not([aria-disabled]) {
133
133
  &:hover {
134
134
  background-color: var(--pix-error-700);
135
135
  }
@@ -152,7 +152,7 @@
152
152
  color: var(--pix-neutral-900);
153
153
  background-color: var(--pix-neutral-20);
154
154
 
155
- &:not(.pix-button--disabled) {
155
+ &:not([aria-disabled]) {
156
156
  &:hover {
157
157
  background-color: var(--pix-neutral-100);
158
158
  }
@@ -188,7 +188,7 @@
188
188
  border: 2px solid var(--pix-primary-700);
189
189
  }
190
190
 
191
- &:not(.pix-button--disabled) {
191
+ &:not([aria-disabled]) {
192
192
  &:hover {
193
193
  color: var(--pix-neutral-0);
194
194
  background-color: var(--pix-primary-500);
@@ -218,7 +218,7 @@
218
218
  border: 1px solid var(--pix-neutral-0);
219
219
  }
220
220
 
221
- &:not(.pix-button--disabled) {
221
+ &:not([aria-disabled]) {
222
222
  &:hover {
223
223
  color: var(--pix-neutral-900);
224
224
  background-color: var(--pix-neutral-20);
@@ -1,33 +1,22 @@
1
1
  .pix-filterable-and-searchable-select {
2
2
  display: flex;
3
3
  max-width: 100%;
4
- border: 1px var(--pix-neutral-500) solid;
5
4
  border-radius: var(--pix-spacing-1x);
6
5
 
7
6
  &--error {
8
- @include formElementInError();
7
+ @extend %pix-form-error-state;
9
8
  }
10
9
 
11
10
  &__label {
12
- @include label();
11
+ @extend %pix-label;
13
12
  }
14
13
 
15
14
  &__sub-label {
16
- @include subLabel();
17
- }
18
-
19
- &__pix-multi-select,
20
- &__pix-select {
21
- border: none;
22
-
23
- &:hover {
24
- border: none;
25
- box-shadow: none;
26
- }
15
+ @extend %pix-sublabel;
27
16
  }
28
17
 
29
18
  &__error-message {
30
- @include errorMessage();
19
+ @extend %pix-input-error-message;
31
20
  }
32
21
 
33
22
  .pix-select {
@@ -35,8 +24,6 @@
35
24
  }
36
25
 
37
26
  .pix-multi-select {
38
- margin-right: 2px;
39
-
40
27
  [role="menu"] {
41
28
  width: fit-content;
42
29
  }
@@ -44,11 +31,13 @@
44
31
 
45
32
  &__pix-multi-select {
46
33
  position: relative;
34
+ border-right: none;
47
35
  border-radius: var(--pix-spacing-1x) 0 0 var(--pix-spacing-1x);
48
36
 
49
37
  &:after {
50
38
  position: absolute;
51
39
  right: -2px;
40
+ z-index: 1;
52
41
  width: 2px;
53
42
  height: 22px;
54
43
  background-color: var(--pix-neutral-100);
@@ -59,6 +48,7 @@
59
48
 
60
49
  &__pix-select {
61
50
  width: 100%;
62
- border-radius: 0 4px 4px 0;
51
+ border-left: none;
52
+ border-radius: 0 var(--pix-spacing-1x) var(--pix-spacing-1x) 0;
63
53
  }
64
54
  }
@@ -27,6 +27,8 @@
27
27
  }
28
28
 
29
29
  input.pix-input-code__input {
30
+ @extend %pix-form-element-state;
31
+
30
32
  display: inline-block;
31
33
  width: 38px;
32
34
  height: 44px;
@@ -38,10 +40,6 @@
38
40
  border: 1.4px solid var(--pix-neutral-500);
39
41
  border-radius: 4px;
40
42
 
41
- @include hoverFormElement();
42
- @include focusFormElement();
43
- @include activeFormElement();
44
-
45
43
  &:focus, &:active {
46
44
  &::placeholder {
47
45
  opacity: 0;
@@ -4,6 +4,8 @@
4
4
  flex-direction: column;
5
5
 
6
6
  &__container {
7
+ @extend %pix-form-element-state;
8
+
7
9
  position: relative;
8
10
  display: flex;
9
11
  align-items: center;
@@ -11,13 +13,9 @@
11
13
  border: 1px solid var(--pix-neutral-500);
12
14
  border-radius: var(--pix-spacing-1x);
13
15
 
14
- @include hoverFormElement();
15
- @include focusWithinFormElement();
16
- @include activeFormElement();
17
-
18
16
 
19
17
  input {
20
- @include input();
18
+ @extend %pix-input-default;
21
19
 
22
20
  flex-grow: 1;
23
21
  height: 34px;
@@ -49,15 +47,15 @@
49
47
  }
50
48
 
51
49
  &__error-container {
52
- padding-right: var(--pix-spacing-6x);
50
+ @extend %pix-form-error-state;
53
51
 
54
- @include formElementInError();
52
+ padding-right: var(--pix-spacing-6x);
55
53
  }
56
54
 
57
55
  &__success-container {
58
- padding-right: var(--pix-spacing-6x);
56
+ @extend %pix-form-success-state;
59
57
 
60
- @include formElementInSuccess();
58
+ padding-right: var(--pix-spacing-6x);
61
59
  }
62
60
 
63
61
  &__icon {
@@ -80,6 +78,6 @@
80
78
  }
81
79
 
82
80
  &__error-message {
83
- @include errorMessage();
81
+ @extend %pix-input-error-message;
84
82
  }
85
83
  }
@@ -4,13 +4,14 @@
4
4
  flex-direction: column;
5
5
 
6
6
  &__label {
7
- @include label();
7
+ @extend %pix-label;
8
8
  }
9
9
 
10
- &__information {
11
- @include subLabel();
10
+ &__sub-label {
11
+ @extend %pix-sublabel;
12
12
  }
13
13
 
14
+
14
15
  &__container {
15
16
  position: relative;
16
17
  }
@@ -36,46 +37,28 @@
36
37
  }
37
38
 
38
39
  &__error-message {
39
- @include errorMessage();
40
+ @extend %pix-input-error-message;
40
41
  }
41
42
 
42
- &__input--default {
43
+ &__input {
44
+ @extend %pix-form-element-state;
45
+ @extend %pix-input-default;
46
+
43
47
  width: 100%;
44
48
  height: 36px;
45
49
  border: 1px solid var(--pix-neutral-500);
46
50
 
47
- @include input();
48
- @include hoverFormElement();
49
- @include focusFormElement();
50
- @include activeFormElement();
51
-
52
- &::placeholder {
53
- color: var(--pix-neutral-500);
51
+ &--error {
52
+ @extend %pix-form-error-state;
54
53
  }
55
54
 
56
- &[aria-disabled],
57
- &[disabled],
58
- &[readonly] {
59
- @include formElementDisabled();
60
- @include hoverFormElementDisabled();
55
+ &--success {
56
+ @extend %pix-form-success-state;
61
57
  }
62
58
 
63
- &[readonly] {
64
- cursor: default;
59
+ &::placeholder {
60
+ color: var(--pix-neutral-500);
65
61
  }
66
- }
67
-
68
- &__input--error {
69
- padding-right: var(--pix-spacing-10x);
70
- border-width: 2px;
71
-
72
- @include formElementInError();
73
- }
74
-
75
- &__input--success {
76
- padding-right: var(--pix-spacing-10x);
77
- border-width: 2px;
78
62
 
79
- @include formElementInSuccess();
80
63
  }
81
64
  }
@@ -3,12 +3,13 @@
3
3
  display: inline-block;
4
4
 
5
5
  &__label {
6
- @include label();
6
+ @extend %pix-label;
7
7
  }
8
8
  }
9
9
 
10
10
  .pix-multi-select-header {
11
11
  @extend %pix-body-s;
12
+ @extend %pix-form-element-state;
12
13
 
13
14
  position: relative;
14
15
  display: flex;
@@ -20,13 +21,8 @@
20
21
  background-color: var(--pix-neutral-0);
21
22
  border: 1px var(--pix-neutral-500) solid;
22
23
  border-radius: var(--pix-spacing-1x);
23
- outline: none;
24
24
  cursor: pointer;
25
25
 
26
- @include hoverFormElement();
27
- @include focusWithinFormElement();
28
- @include activeFormElement();
29
-
30
26
  &--big {
31
27
  height: 44px;
32
28
  }
@@ -13,19 +13,6 @@
13
13
  font-size: 1rem;
14
14
  }
15
15
 
16
- &__icon::before {
17
- position: absolute;
18
- top: 0;
19
- left: 0;
20
- z-index: -1;
21
- width: 100%;
22
- height: 100%;
23
- border-radius: 50%;
24
- opacity: 0;
25
- transition: 0.3s ease opacity;
26
- content: '';
27
- }
28
-
29
16
  &:focus,
30
17
  &:hover,
31
18
  &:active {
@@ -33,10 +20,6 @@
33
20
  border-bottom-color: transparent;
34
21
  outline: 0;
35
22
  cursor: pointer;
36
-
37
- ::before {
38
- opacity: 1;
39
- }
40
23
  }
41
24
 
42
25
  @mixin coloriseLink($defaultColor, $arrowHoverColor, $arrowBgColor) {
@@ -47,10 +30,8 @@
47
30
  &:active {
48
31
  .pix-return-to__icon {
49
32
  color: $arrowHoverColor;
50
- }
51
-
52
- ::before {
53
33
  background-color: $arrowBgColor;
34
+ border-radius: 50%;
54
35
  outline: 1px solid var(--pix-neutral-0);
55
36
  outline-offset: -3px;
56
37
  }
@@ -26,9 +26,9 @@
26
26
  }
27
27
 
28
28
  .pix-search-input__input {
29
- @include input();
30
- @include hoverFormElement();
31
- @include focusFormElement();
29
+ @extend %pix-form-element-state;
30
+ @extend %pix-input-default;
31
+
32
32
 
33
33
  width: 100%;
34
34
  height: 36px;
@@ -3,11 +3,11 @@
3
3
  display: inline-block;
4
4
 
5
5
  &__label {
6
- @include label();
6
+ @extend %pix-label;
7
7
  }
8
8
 
9
9
  &__sub-label {
10
- @include subLabel();
10
+ @extend %pix-sublabel;
11
11
  }
12
12
 
13
13
  &__dropdown {
@@ -79,12 +79,13 @@
79
79
  }
80
80
 
81
81
  &__error-message {
82
- @include errorMessage();
82
+ @extend %pix-input-error-message;
83
83
  }
84
84
  }
85
85
 
86
86
  .pix-select-button {
87
87
  @extend %pix-body-s;
88
+ @extend %pix-form-element-state;
88
89
 
89
90
  position: relative;
90
91
  display: flex;
@@ -98,20 +99,10 @@
98
99
  background-color: var(--pix-neutral-0);
99
100
  border: 1px var(--pix-neutral-500) solid;
100
101
  border-radius: var(--pix-spacing-1x);
101
- outline: none;
102
102
  cursor: pointer;
103
103
 
104
- @include hoverFormElement();
105
- @include focusWithinFormElement();
106
- @include activeFormElement();
107
-
108
- &--disabled {
109
- @include formElementDisabled();
110
- @include hoverFormElementDisabled();
111
- }
112
-
113
104
  &--error {
114
- @include formElementInError();
105
+ @extend %pix-form-error-state;
115
106
  }
116
107
 
117
108
  &__text {
@@ -1,5 +1,7 @@
1
1
  .pix-textarea {
2
2
  textarea {
3
+ @extend %pix-form-element-state;
4
+
3
5
  width: 100%;
4
6
  padding: 10px var(--pix-spacing-4x);
5
7
  color: var(--pix-neutral-900);
@@ -9,12 +11,8 @@
9
11
  border-radius: var(--pix-spacing-1x);
10
12
  resize: vertical;
11
13
 
12
- @include hoverFormElement();
13
- @include focusFormElement();
14
- @include activeFormElement();
15
-
16
14
  &.pix-textarea--error {
17
- @include formElementInError();
15
+ @extend %pix-form-error-state;
18
16
  }
19
17
  }
20
18
 
@@ -28,10 +26,10 @@
28
26
  }
29
27
 
30
28
  &__label {
31
- @include label();
29
+ @extend %pix-label;
32
30
  }
33
31
 
34
32
  &__error-message {
35
- @include errorMessage();
33
+ @extend %pix-input-error-message;
36
34
  }
37
35
  }
@@ -35,3 +35,4 @@
35
35
 
36
36
  // at the end so it can override it's children scss
37
37
  @import 'pix-filterable-and-searchable-select';
38
+ @import 'component-state';