-
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.
Feat(web-twig): Add property size to the Button #DS-318
- Loading branch information
Showing
13 changed files
with
29 additions
and
27 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
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
2 changes: 1 addition & 1 deletion
2
...snapshots__/ComponentsSnapshotTest__test with data set buttonDisabledDefault.twig__1.html
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,3 +1,3 @@ | ||
<html><body> | ||
<button class="Button Button--primary" type="button" disabled>Disabled button</button> | ||
<button class="Button Button--primary Button--medium" type="button" disabled>Disabled button</button> | ||
</body></html> |
2 changes: 1 addition & 1 deletion
2
...__/ComponentsSnapshotTest__test with data set buttonWithDisabledFalseDefault.twig__1.html
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,3 +1,3 @@ | ||
<html><body> | ||
<button class="Button Button--primary" type="button">Not Disabled button</button> | ||
<button class="Button Button--primary Button--medium" type="button">Not Disabled button</button> | ||
</body></html> |
4 changes: 2 additions & 2 deletions
4
...omponentsSnapshotTest__test with data set buttonWithDisabledFalsePropDefault.twig__1.html
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,4 +1,4 @@ | ||
<html><body> | ||
<button class="Button Button--primary" type="button">Not Disabled button with boolean false prop value</button> | ||
<button class="Button Button--primary" type="button">Not Disabled button with string false prop value</button> | ||
<button class="Button Button--primary Button--medium" type="button">Not Disabled button with boolean false prop value</button> | ||
<button class="Button Button--primary Button--medium" type="button">Not Disabled button with string false prop value</button> | ||
</body></html> |
2 changes: 1 addition & 1 deletion
2
...__snapshots__/ComponentsSnapshotTest__test with data set buttonWithMainProps.twig__1.html
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,3 +1,3 @@ | ||
<html><body> | ||
<button id="testId" data-main="main" aria-label="label" class="Button Button--primary" type="button">button</button> | ||
<button id="testId" data-main="main" aria-label="label" class="Button Button--primary Button--medium" type="button">button</button> | ||
</body></html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{% set className = 'lmc-Button' %} | ||
{% set _color = (props.color is defined) ? ' ' ~ className ~ '--' ~ props.color : ' ' ~ className ~ '--secondary' %} | ||
{% set _size = (props.size is defined) ? ' ' ~ className ~ '--' ~ props.size : ' ' ~ className ~ '--medium' %} | ||
{% set _block = (props.block is defined) ? ' ' ~ className ~ '--block' : '' %} | ||
{% set _type = (props.type is defined) ? props.type : 'button' %} | ||
{% set _disabled = (props.disabled is defined) ? ' disabled="true"' : '' %} | ||
{% set _ariaLabel = (props['ariaLabel'] is defined) ? ' aria-label="'~ props['ariaLabel'] ~'"' : '' -%} | ||
|
||
<button class="{{ className }}{{ _color }}{{ _block }}" type="{{ _type }}"{{ _disabled|raw }}{{ _ariaLabel|raw }}> | ||
<button class="{{ className }}{{ _color }}{{ _size }}{{ _block }}" type="{{ _type }}"{{ _disabled|raw }}{{ _ariaLabel|raw }}> | ||
{%- block content %}{% endblock %} | ||
</button> | ||
</button> |
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,4 +1 @@ | ||
{% set _sizeClass = props.size is defined ? _spiritClassPrefix ~ 'Button--' ~ props.size %} | ||
{% set props = props|merge({ 'class': _sizeClass }) %} | ||
|
||
{% extends "@spirit/button.twig" %} |