Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/IYY-297-coral-theme…
Browse files Browse the repository at this point in the history
…' into IYY-297-coral-theme
  • Loading branch information
joetower committed Dec 2, 2024
2 parents 7ba4443 + 7c5f171 commit dcec717
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 16 deletions.
9 changes: 9 additions & 0 deletions components/01-atoms/typography/headings/yds-heading.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
{% set heading__base_class = heading__base_class|default('heading') %}

<h{{ heading__level }} {{ bem(heading__base_class, heading__modifiers, heading__blockname) }}>
{% if heading__prefix__icon %}
<span {{ bem('prefix-icon', [], heading__base_class) }}>
{% include "@atoms/images/icons/_yds-icon.twig" with {
icon__name: heading__prefix__icon,
icon__modifiers: heading__prefix__icon__modifiers,
icon__blockname: heading__prefix__icon__blockname|default(heading__blockname),
} %}
</span>
{% endif %}
{% if heading__prefix %}
<span {{ bem('prefix', [], heading__prefix__base_class) }}>
{{ heading__prefix }}
Expand Down
11 changes: 11 additions & 0 deletions components/02-molecules/search-result/_yds-search-result.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@
@include tokens.h4-yale-new;

color: var(--color-gray-800);

&:has(.heading__prefix-icon) {
display: flex;
align-items: center;
gap: var(--size-spacing-3);
}
}

.search-result__icon {
width: var(--size-spacing-5);
height: var(--size-spacing-5);
}

.search-result__highlighted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default {
type: 'string',
defaultValue: searchResultData.search_result__content_type,
},
isCas: {
name: 'Is CAS',
type: 'boolean',
},
},
args: {
heading: searchResultData.search_result__title,
Expand All @@ -36,12 +40,20 @@ export default {
},
};

export const SearchResult = ({ heading, highlighted, teaser, contentType }) =>
export const SearchResult = ({
heading,
highlighted,
teaser,
contentType,
isCas,
}) =>
searchResultTwig({
search_result__teaser: teaser,
search_result__title: heading,
search_result__url: '#',
search_result__highlighted: highlighted,
breadcrumbs__items: breadcrumbData.items,
search_result__content_type: contentType,
search_result__prefix__icon: isCas ? 'lock-solid' : '',
is_cas: isCas,
});
35 changes: 20 additions & 15 deletions components/02-molecules/search-result/yds-search-result.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,34 @@
<div {{ bem('content-type', [], search_result__base_class) }}>
{{ search_result__content_type }}
</div>

{% include "@atoms/typography/headings/yds-heading.twig" with {
heading__level: '2',
heading__blockname: search_result__base_class,
heading: search_result__title,
heading__url: search_result__url,
heading__prefix__icon: search_result__prefix__icon,
} %}

{% include "@organisms/menu/breadcrumbs/yds-breadcrumbs.twig" with {
breadcrumbs__modifiers: search_result__base_class
} %}
{% if search_result__highlighted %}
{% include "@atoms/typography/text/yds-text.twig" with {
text__base_class: 'highlighted',
text__blockname: search_result__base_class,
text__content: search_result__highlighted,
} %}
{% endif %}
{% if search_result__teaser %}
{% include "@atoms/typography/text/yds-text.twig" with {
text__base_class: 'teaser',
text__blockname: search_result__base_class,
text__content: search_result__teaser,
{% if not is_cas %}
{% include "@organisms/menu/breadcrumbs/yds-breadcrumbs.twig" with {
breadcrumbs__modifiers: search_result__base_class
} %}

{% if search_result__highlighted %}
{% include "@atoms/typography/text/yds-text.twig" with {
text__base_class: 'highlighted',
text__blockname: search_result__base_class,
text__content: search_result__highlighted,
} %}
{% endif %}
{% if search_result__teaser %}
{% include "@atoms/typography/text/yds-text.twig" with {
text__base_class: 'teaser',
text__blockname: search_result__base_class,
text__content: search_result__teaser,
} %}
{% endif %}
{% endif %}
</div>
</div>
1 change: 1 addition & 0 deletions images/icons/lock-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dcec717

Please sign in to comment.