@1024pix/pix-ui 45.5.1 → 45.5.2

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.
@@ -2,22 +2,24 @@
2
2
  <PixLabel
3
3
  @for={{this.id}}
4
4
  @requiredLabel={{@requiredLabel}}
5
+ @subLabel={{@subLabel}}
5
6
  @size={{@size}}
6
7
  @inlineLabel={{true}}
7
8
  @screenReaderOnly={{@screenReaderOnly}}
8
9
  @isDisabled={{this.isDisabled}}
9
10
  @wrappedElement={{true}}
10
11
  >
11
- <input
12
- type="checkbox"
13
- id={{this.id}}
14
- class={{this.inputClasses}}
15
- checked={{@checked}}
16
- aria-disabled={{this.isDisabled}}
17
- {{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
18
- ...attributes
19
- />
20
-
21
- {{yield to="label"}}
12
+ <:inputElement>
13
+ <input
14
+ type="checkbox"
15
+ id={{this.id}}
16
+ class={{this.inputClasses}}
17
+ checked={{@checked}}
18
+ aria-disabled={{this.isDisabled}}
19
+ {{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
20
+ ...attributes
21
+ />
22
+ </:inputElement>
23
+ <:default>{{yield to="label"}}</:default>
22
24
  </PixLabel>
23
25
  </div>
@@ -1,11 +1,17 @@
1
1
  <label for={{@for}} class={{this.className}} ...attributes>
2
- {{#if @requiredLabel}}
3
- <abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
2
+ {{#if (has-block "inputElement")}}
3
+ {{yield to="inputElement"}}
4
4
  {{/if}}
5
5
 
6
- {{yield}}
6
+ <span class={{if @screenReaderOnly "screen-reader-only"}}>
7
+ {{#if @requiredLabel}}
8
+ <abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
9
+ {{/if}}
7
10
 
8
- {{#if @subLabel}}
9
- <span class="pix-label__sub-label">{{@subLabel}}</span>
10
- {{/if}}
11
+ {{yield}}
12
+
13
+ {{#if @subLabel}}
14
+ <span class="pix-label__sub-label">{{@subLabel}}</span>
15
+ {{/if}}
16
+ </span>
11
17
  </label>
@@ -4,9 +4,9 @@ export default class PixLabel extends Component {
4
4
  get className() {
5
5
  const classes = ['pix-label'];
6
6
 
7
- if (this.args.screenReaderOnly) classes.push('screen-reader-only');
8
7
  if (this.args.wrappedElement) classes.push('pix-label--wrapped-element');
9
- if (this.args.inlineLabel) classes.push('pix-label--inline-label');
8
+ if (this.args.inlineLabel && !this.args.screenReaderOnly)
9
+ classes.push('pix-label--inline-label');
10
10
  if (this.args.isDisabled) classes.push('pix-label--disabled');
11
11
 
12
12
  const size = ['small', 'large'].includes(this.args.size) ? this.args.size : 'default';
@@ -2,21 +2,24 @@
2
2
  <PixLabel
3
3
  @for={{this.id}}
4
4
  @requiredLabel={{@requiredLabel}}
5
+ @subLabel={{@subLabel}}
5
6
  @size={{@size}}
6
7
  @screenReaderOnly={{@screenReaderOnly}}
7
8
  @isDisabled={{this.isDisabled}}
8
9
  @inlineLabel={{true}}
9
10
  @wrappedElement={{true}}
10
11
  >
11
- <input
12
- type="radio"
13
- id={{this.id}}
14
- class="pix-radio-button__input"
15
- value={{@value}}
16
- aria-disabled={{this.isDisabled}}
17
- {{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
18
- ...attributes
19
- />
20
- {{yield to="label"}}
12
+ <:inputElement>
13
+ <input
14
+ type="radio"
15
+ id={{this.id}}
16
+ class="pix-radio-button__input"
17
+ value={{@value}}
18
+ aria-disabled={{this.isDisabled}}
19
+ {{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
20
+ ...attributes
21
+ />
22
+ </:inputElement>
23
+ <:default>{{yield to="label"}}</:default>
21
24
  </PixLabel>
22
25
  </div>
@@ -97,6 +97,8 @@ const Template = (args) => {
97
97
  @isDisabled={{this.isDisabled}}
98
98
  disabled={{this.disabled}}
99
99
  @size={{this.size}}
100
+ @subLabel={{this.subLabel}}
101
+ @requiredLabel={{this.requiredLabel}}
100
102
  @inlineLabel={{this.inlineLabel}}
101
103
  @screenReaderOnly={{this.screenReaderOnly}}
102
104
  >
@@ -94,6 +94,7 @@ const Template = (args) => {
94
94
  @size={{this.size}}
95
95
  @screenReaderOnly={{this.screenReaderOnly}}
96
96
  @requiredLabel={{this.requiredLabel}}
97
+ @subLabel={{this.subLabel}}
97
98
  >
98
99
  <:label>{{this.label}}</:label>
99
100
  </PixRadioButton>`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "45.5.1",
3
+ "version": "45.5.2",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"