@1024pix/pix-ui 55.33.0 → 55.34.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.
@@ -29,6 +29,19 @@ export default class PixInputBase extends Component {
29
29
  return this.args.validationStatus === 'error' ? this.prefix + '-error' : null;
30
30
  }
31
31
 
32
+ get rootClassNames() {
33
+ const classNames = ['pix-input'];
34
+ if (this.args.inlineLabel) {
35
+ classNames.push('pix-input--inline');
36
+ }
37
+
38
+ if (this.args.isFullWidth) {
39
+ classNames.push('pix-input--full-width');
40
+ }
41
+
42
+ return classNames.join(' ');
43
+ }
44
+
32
45
  get hasError() {
33
46
  return this.args.validationStatus === 'error';
34
47
  }
@@ -1,4 +1,4 @@
1
- <div class="pix-input {{if @inlineLabel ' pix-input--inline'}}">
1
+ <div class={{this.rootClassNames}}>
2
2
  {{#if (has-block "label")}}
3
3
  <PixLabel
4
4
  @for={{this.id}}
@@ -11,7 +11,7 @@
11
11
  {{yield to="label"}}
12
12
  </PixLabel>
13
13
  {{/if}}
14
- <div>
14
+ <div class="pix-input__field-container">
15
15
  <div class="pix-input__container">
16
16
  <input
17
17
  id={{this.id}}
@@ -1,5 +1,5 @@
1
1
  <div
2
- class="pix-select {{if @inlineLabel ' pix-select--inline'}}"
2
+ class={{this.rootClassNames}}
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}}
@@ -20,13 +20,13 @@
20
20
  </PixLabel>
21
21
  {{/if}}
22
22
 
23
- <div>
23
+ <div class="pix-select__button-container">
24
24
  <PopperJS @placement={{or @placement "bottom-start"}} as |reference popover|>
25
25
  <button
26
26
  {{reference}}
27
27
  type="button"
28
28
  id={{this.selectId}}
29
- class={{this.className}}
29
+ class={{this.buttonClassName}}
30
30
  {{on "click" this.toggleDropdown}}
31
31
  aria-expanded={{this.isAriaExpanded}}
32
32
  aria-controls={{this.listId}}
@@ -34,13 +34,26 @@ export default class PixSelect extends Component {
34
34
  return !this.searchValue && !this.args.hideDefaultOption;
35
35
  }
36
36
 
37
- get className() {
38
- const classes = ['pix-select-button'];
37
+ get buttonClassName() {
38
+ const buttonClasses = ['pix-select-button'];
39
39
  if (this.args.className) {
40
- classes.push(this.args.className);
40
+ buttonClasses.push(this.args.className);
41
41
  }
42
42
  if (this.args.errorMessage) {
43
- classes.push('pix-select-button--error');
43
+ buttonClasses.push('pix-select-button--error');
44
+ }
45
+
46
+ return buttonClasses.join(' ');
47
+ }
48
+
49
+ get rootClassNames() {
50
+ const classes = ['pix-select'];
51
+ if (this.args.inlineLabel) {
52
+ classes.push('pix-select--inline');
53
+ }
54
+
55
+ if (this.args.isFullWidth) {
56
+ classes.push('pix-select--full-width');
44
57
  }
45
58
 
46
59
  return classes.join(' ');
@@ -12,10 +12,18 @@
12
12
  align-items: center;
13
13
  }
14
14
 
15
+ &--full-width {
16
+ width: 100%;
17
+ }
18
+
15
19
  &__container {
16
20
  position: relative;
17
21
  }
18
22
 
23
+ &__field-container {
24
+ flex-grow: 1;
25
+ }
26
+
19
27
  svg {
20
28
  position: absolute;
21
29
  right: 12px;
@@ -1,4 +1,4 @@
1
- @use "pix-design-tokens/typography";
1
+ @use 'pix-design-tokens/typography';
2
2
 
3
3
  .pix-label {
4
4
  display: block;
@@ -22,6 +22,7 @@
22
22
  }
23
23
 
24
24
  &--inline-label {
25
+ flex-shrink: 0;
25
26
  font-weight: var(--pix-font-normal);
26
27
  }
27
28
 
@@ -16,6 +16,10 @@
16
16
  align-items: center;
17
17
  }
18
18
 
19
+ &--full-width {
20
+ width: 100%;
21
+ }
22
+
19
23
  &__dropdown {
20
24
  @extend %pix-shadow-xs;
21
25
 
@@ -78,6 +82,10 @@
78
82
  &__error-message {
79
83
  @extend %pix-input-error-message;
80
84
  }
85
+
86
+ &__button-container {
87
+ flex-grow: 1;
88
+ }
81
89
  }
82
90
 
83
91
  .pix-select-button {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "55.33.0",
3
+ "version": "55.34.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"