Skip to content

Commit

Permalink
Revert "Revert "Change icons from divs to spans (#1857)""
Browse files Browse the repository at this point in the history
This reverts commit 67b32df to add back the changes in #1857 now that we have the accompanying HH Theme changes ready to release.
  • Loading branch information
nmanu1 committed Feb 20, 2024
1 parent 495eea4 commit f37d3ba
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions src/ui/sass/modules/_SearchBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,18 @@ $searchbar-button-text-color-active: var(--yxt-searchbar-button-text-color-base)

&-buttonImage .Icon svg, .Icon-image
{
display: block;
width: 2em;
height: 2em;
}

&-instructions {
display: none;
}

&-CustomLoadingImage {
display: block;
}
}

// If custom icons are supplied, the SVGs simply alternate opacity
Expand Down
4 changes: 2 additions & 2 deletions src/ui/templates/icons/builtInIcon.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="Icon Icon--{{iconName}} {{classNames}}" aria-hidden="true">
<span class="Icon Icon--{{iconName}} {{classNames}}" aria-hidden="true">
{{icon iconName complexContentsParams}}
</div>
</span>
4 changes: 2 additions & 2 deletions src/ui/templates/icons/icon.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="Icon Icon--{{name}} {{classNames}}" aria-hidden="true">
<span class="Icon Icon--{{name}} {{classNames}}" aria-hidden="true">
{{#if iconUrl}}
<img src="{{iconUrl}}" alt="" class="Icon-image">
{{else}}
{{icon iconName complexContentsParams}}
{{/if}}
</div>
</span>
4 changes: 2 additions & 2 deletions src/ui/templates/icons/iconPartial.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="Icon Icon--{{#if iconName}}{{iconName}}{{else}}custom{{/if}} {{classNames}}" aria-hidden="true">
<span class="Icon Icon--{{#if iconName}}{{iconName}}{{else}}custom{{/if}} {{classNames}}" aria-hidden="true">
{{#if iconUrl}}
<img src="{{iconUrl}}" alt="" class="Icon-image">
{{else}}
{{icon iconName complexContentsParams}}
{{/if}}
</div>
</span>
24 changes: 12 additions & 12 deletions src/ui/templates/icons/searchBarIcon.hbs
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{{#if showLoadingIndicator}}
{{#if customLoadingIconUrl}}
<div class="yxt-SearchBar-CustomLoadingImage js-yxt-SearchBar-LoadingIndicator js-yxt-SearchBar-Icon yxt-SearchBar-Icon--inactive">
<span class="yxt-SearchBar-CustomLoadingImage js-yxt-SearchBar-LoadingIndicator js-yxt-SearchBar-Icon yxt-SearchBar-Icon--inactive">
{{> icons/iconPartial iconUrl=customLoadingIconUrl}}
</div>
</span>
{{else}}
<div class="yxt-SearchBar-AnimatedIcon js-yxt-SearchBar-LoadingIndicator yxt-SearchBar-LoadingIndicator js-yxt-SearchBar-Icon
<span class="yxt-SearchBar-AnimatedIcon js-yxt-SearchBar-LoadingIndicator yxt-SearchBar-LoadingIndicator js-yxt-SearchBar-Icon
yxt-SearchBar-Icon--inactive Icon--lg">
<svg class= "yxt-SearchBar-LoadingIndicator-AnimatedIcon" viewBox="0 0 72 72">
<circle class="yxt-SearchBar-LoadingIndicator-Circle" cx="36" cy="36" r="33" stroke="black" stroke-width="3" fill="none"/>
</svg>
</div>
</span>
{{/if}}
{{/if}}

{{#if submitIcon}}
<div class="yxt-SearchBar-buttonImage js-yxt-SearchBar-buttonImage js-yxt-SearchBar-Icon">
<span class="yxt-SearchBar-buttonImage js-yxt-SearchBar-buttonImage js-yxt-SearchBar-Icon">
{{> icons/builtInIcon iconName=submitIcon}}
</div>
</span>
{{else if _config.customIconUrl}}
<div class="yxt-SearchBar-buttonImage js-yxt-SearchBar-buttonImage js-yxt-SearchBar-Icon">
<span class="yxt-SearchBar-buttonImage js-yxt-SearchBar-buttonImage js-yxt-SearchBar-Icon">
{{> icons/iconPartial iconUrl=_config.customIconUrl}}
</div>
</span>
{{else}}
<div class="yxt-SearchBar-AnimatedIcon js-yxt-AnimatedForward js-yxt-SearchBar-Icon
<span class="yxt-SearchBar-AnimatedIcon js-yxt-AnimatedForward js-yxt-SearchBar-Icon
{{#unless autoFocus}} yxt-SearchBar-Icon--inactive{{/unless}}">
{{> icons/builtInIcon
iconName='yext_animated_forward'
classNames='yxt-SearchBar-MagnifyingGlass--static Icon--lg'
complexContentsParams=forwardIconOpts.complexContentsParams
}}
</div>
<div class="yxt-SearchBar-AnimatedIcon js-yxt-AnimatedReverse js-yxt-SearchBar-Icon
</span>
<span class="yxt-SearchBar-AnimatedIcon js-yxt-AnimatedReverse js-yxt-SearchBar-Icon
{{#if autoFocus}} yxt-SearchBar-Icon--inactive{{/if}}">
{{> icons/builtInIcon
iconName='yext_animated_reverse'
classNames='yxt-SearchBar-Yext--static Icon--lg'
complexContentsParams=forwardIconOpts.complexContentsParams
}}
</div>
</span>
{{/if}}
2 changes: 1 addition & 1 deletion src/ui/templates/icons/voiceSearchIcon.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
{{/if}}
</div>
<span class="yxt-SearchBar-voiceSearchText sr-only"></span>
</div>
</div>

0 comments on commit f37d3ba

Please sign in to comment.