-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE(web-twig): Rename
inverted
variant of Toast
to `n…
…eutral` #DS-1446 Refactor ToastBarLink and ToastCloseButton.
- Loading branch information
Showing
9 changed files
with
53 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 13 additions & 15 deletions
28
packages/web-twig/src/Resources/components/Toast/ToastBarLink.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
{# API #} | ||
{%- set props = props | default([]) -%} | ||
{%- set _color = props.color | default('inverted') -%} | ||
{%- set _isUnderlined = props.isUnderlined ?? true -%} | ||
{%- set _children = block('content') -%} | ||
{%- set _color = props.color | default('primary') -%} | ||
{%- set _href = props.href -%} | ||
|
||
{# Class names #} | ||
{%- set _rootClassName = _spiritClassPrefix ~ 'ToastBar__link' -%} | ||
{%- set _rootUnderlinedClassName = _spiritClassPrefix ~ 'link-underlined' -%} | ||
|
||
{# Miscellaneous #} | ||
{%- set _styleProps = useStyleProps(props) -%} | ||
{%- set _classNames = [ _rootClassName, _rootUnderlinedClassName, _styleProps.className ] -%} | ||
{%- set _allowedAttributes = [ 'target', 'title' ] -%} | ||
{%- set _classNames = [ _rootClassName, _styleProps.className ] -%} | ||
|
||
{% embed "@spirit/link.twig" with { props: props | merge({ | ||
color: _color, | ||
isUnderlined: _isUnderlined, | ||
'data-spirit-populate-field': 'link', | ||
UNSAFE_className: _classNames | join(' '), | ||
UNSAFE_style: _styleProps.style, | ||
}) } %} | ||
{% block content %}{{ _children }}{% endblock %} | ||
{% endembed %} | ||
|
||
<a | ||
{{ mainProps(props, _allowedAttributes) }} | ||
href="{{ _href }}" | ||
{{ styleProp(_styleProps) }} | ||
{{ classProp(_classNames) }} | ||
data-spirit-populate-field="link" | ||
> | ||
{%- block content %}{% endblock %} | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/web-twig/src/Resources/components/Toast/stories/ToastColors.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters