Skip to content

Commit

Permalink
tech(pix-*-select): update icon
Browse files Browse the repository at this point in the history
  • Loading branch information
xav-car committed Sep 27, 2024
1 parent 451d14a commit 54aac03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions addon/components/pix-multi-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{{#if @isSearchable}}
<span {{reference}} class={{this.headerClassName}}>
<FaIcon @icon="magnifying-glass" class="pix-multi-select-header__search-icon" />
<PixIcon @name="search" class="pix-multi-select-header__search-icon" />

<input
class="pix-multi-select-header__search-input"
Expand Down Expand Up @@ -52,10 +52,10 @@
{{else if @placeholder}}
{{this.placeholder}}
{{/if}}
<FaIcon
<PixIcon
class="pix-multi-select-header__dropdown-icon
{{if this.isExpanded ' pix-multi-select-header__dropdown-icon--expand'}}"
@icon={{if this.isExpanded "chevron-up" "chevron-down"}}
@name={{if this.isExpanded "chevronTop" "chevronBottom"}}
/>
</button>
{{/if}}
Expand Down
12 changes: 6 additions & 6 deletions addon/components/pix-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
aria-disabled={{@isDisabled}}
>
{{#if @icon}}
<FaIcon @icon={{@icon}} />
<PixIcon @name={{@icon}} role="img" />
{{/if}}

<span class="pix-select-button__text">{{this.placeholder}}</span>

<FaIcon
<PixIcon
class="pix-select-button__dropdown-icon"
@icon={{if this.isExpanded "chevron-up" "chevron-down"}}
@name={{if this.isExpanded "chevronUp" "chevronDown"}}
/>
</button>
<div
Expand All @@ -50,7 +50,7 @@
>
{{#if @isSearchable}}
<div class="pix-select__search">
<FaIcon class="pix-select-search__icon" @icon="magnifying-glass" />
<PixIcon class="pix-select-search__icon" @name="search" />
<label class="screen-reader-only" for={{this.searchId}}>{{@searchLabel}}</label>
<input
class="pix-select-search__input"
Expand Down Expand Up @@ -116,7 +116,7 @@
{{option.label}}

{{#if (eq option.value @value)}}
<FaIcon @icon="check" role="presentation" />
<PixIcon @name="check" role="presentation" />
{{/if}}
</li>
{{/each}}
Expand All @@ -139,7 +139,7 @@
{{option.label}}

{{#if (eq option.value @value)}}
<FaIcon @icon="check" role="presentation" />
<PixIcon @name="check" role="presentation" />
{{/if}}
</li>
{{/each}}
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/components/pix-select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,13 @@ module('Integration | Component | PixSelect', function (hooks) {
module('when an icon name is provided', function () {
test('displays an icon', async function (assert) {
// given & when
await render(
hbs`<PixSelect @icon='earth-europe' @options={{this.options}}><:label
>{{this.label}}</:label></PixSelect>`,
const screen = await render(
hbs`<PixSelect @icon='globe' @options={{this.options}}><:label>{{this.label}}</:label></PixSelect>`,
);

const svg = screen.getAllByRole('img')[0].innerHTML;
// then
assert.dom('.fa-earth-europe').exists();
assert.true(svg.includes('#globe'));
});
});
});
Expand Down

0 comments on commit 54aac03

Please sign in to comment.