Skip to content

Commit

Permalink
Merge pull request #876 from yext/feature/icon-partial
Browse files Browse the repository at this point in the history
  • Loading branch information
oshi97 authored Jul 7, 2021
2 parents 43c64e9 + ea24a5e commit 69c697e
Show file tree
Hide file tree
Showing 53 changed files with 547 additions and 309 deletions.
8 changes: 4 additions & 4 deletions cards/document-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'></div>
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
{{/if}}
<div class='HitchhikerCTA-iconLabel'>
Expand Down
19 changes: 11 additions & 8 deletions cards/event-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -95,10 +97,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
25 changes: 13 additions & 12 deletions cards/faq-accordion/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<h3 class="HitchhikerFaqAccordion-title">
{{{card.title}}}
</h3>
<div class="HitchhikerFaqAccordion-icon js-HitchhikerFaqAccordion-icon{{#if card.isExpanded}} HitchhikerFaqAccordion-icon--expanded{{/if}}"
data-component="IconComponent"
data-opts='{"iconName": "chevron"}'
data-prop="icon">
<div class="HitchhikerFaqAccordion-icon js-HitchhikerFaqAccordion-icon{{#if card.isExpanded}} HitchhikerFaqAccordion-icon--expanded{{/if}}">
{{> icons/builtInIcon iconName='chevron' }}
</div>
</button>
<div class="HitchhikerFaqAccordion-content js-HitchhikerFaqAccordion-content"
Expand Down Expand Up @@ -61,13 +59,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -83,10 +83,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
19 changes: 11 additions & 8 deletions cards/financial-professional-location/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand Down Expand Up @@ -172,10 +174,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{iconUrl}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
18 changes: 10 additions & 8 deletions cards/job-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -96,10 +98,10 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'></div>
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
{{/if}}
<div class='HitchhikerCTA-iconLabel'>
Expand Down
10 changes: 6 additions & 4 deletions cards/link-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand Down
19 changes: 11 additions & 8 deletions cards/location-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down Expand Up @@ -185,13 +186,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand Down
19 changes: 11 additions & 8 deletions cards/menuitem-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -116,10 +118,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
19 changes: 11 additions & 8 deletions cards/multilang-event-standard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -95,10 +97,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
25 changes: 13 additions & 12 deletions cards/multilang-faq-accordion/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<h3 class="HitchhikerFaqAccordion-title">
{{{card.title}}}
</h3>
<div class="HitchhikerFaqAccordion-icon js-HitchhikerFaqAccordion-icon{{#if card.isExpanded}} HitchhikerFaqAccordion-icon--expanded{{/if}}"
data-component="IconComponent"
data-opts='{"iconName": "chevron"}'
data-prop="icon">
<div class="HitchhikerFaqAccordion-icon js-HitchhikerFaqAccordion-icon{{#if card.isExpanded}} HitchhikerFaqAccordion-icon--expanded{{/if}}">
{{> icons/builtInIcon iconName='chevron' }}
</div>
</button>
<div class="HitchhikerFaqAccordion-content js-HitchhikerFaqAccordion-content"
Expand Down Expand Up @@ -61,13 +59,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand All @@ -83,10 +83,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{#if iconUrl}}{{#unless (isNonRelativeUrl iconUrl)}}{{@root.relativePath}}/{{/unless}}{{iconUrl}}{{/if}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
19 changes: 11 additions & 8 deletions cards/multilang-financial-professional-location/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@
{{#if showExcessDetailsToggle}}
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle">
{{card.showMoreDetails.showMoreText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseDown" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseDown' }}
</span>
</button>
<button class="HitchhikerCard-detailsToggle js-HitchhikerCard-detailsToggle js-hidden">
{{card.showMoreDetails.showLessText}}
<span data-component="IconComponent"
data-opts='{ "iconName": "chevron", "classNames": "Icon--sm Icon-collapseUp" }'></span>
<span>
{{> icons/builtInIcon iconName='chevron' classNames='Icon--sm Icon--collapseUp' }}
</span>
</button>
{{/if}}
</div>
Expand Down Expand Up @@ -172,10 +174,11 @@
{{#if ariaLabel}}aria-label="{{ariaLabel}}"{{/if}}>
{{#if (any iconName iconUrl)}}
<div class="HitchhikerCTA-iconWrapper">
<div class="HitchhikerCTA-icon" data-component="IconComponent" data-opts='{
"iconUrl": "{{iconUrl}}",
"iconName": "{{iconName}}"
}'>
<div class="HitchhikerCTA-icon">
{{> icons/iconPartial
iconName=iconName
iconUrl=(relativePathHandler url=iconUrl relativePath=@root.relativePath)
}}
</div>
</div>
{{/if}}
Expand Down
Loading

0 comments on commit 69c697e

Please sign in to comment.