Skip to content

Commit

Permalink
Merge pull request #699 from carloslancha/pr-697
Browse files Browse the repository at this point in the history
Regen snapshots
  • Loading branch information
jbalsas authored Mar 7, 2018
2 parents 1becf22 + 2ffd650 commit 958a3a8
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="modal-footer"><div class="modal-item-first"></div><div class="modal-item-last"></div></div>
<div class="modal-footer"><div class="modal-item-first"><div class="btn-group"></div></div><div class="modal-item-last"><div class="btn-group"></div></div></div>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="fade modal clay-modal-1 clay-modal-2"id="clay-modal"role="dialog" tabindex="-1"><div class="modal-dialog modal-sm modal-Clay Modal Status"><div class="modal-content"><div class="modal-header"><span class="modal-title-indicator"><svg aria-hidden="true" class="lexicon-icon lexicon-icon-info-circle"focusable="false"><title>info-circle</title><use xlink:href="spritemap.svg#info-circle" /></svg></span><div class="modal-title">Clay Modal Title</div><button class="btn close btn-unstyled"aria-label="times"type="null"><svg aria-hidden="true" class="lexicon-icon lexicon-icon-times"focusable="false"><title>times</title><use xlink:href="spritemap.svg#times" /></svg></button></div><div class="modal-body modal-body-iframe"><iframe src="http://www.clayui.com" title="http://www.clayui.com"></iframe></div><div class="modal-footer"><div class="modal-item-first"></div><div class="modal-item-last"></div></div></div></div></div>
<div class="fade modal clay-modal-1 clay-modal-2"id="clay-modal"role="dialog" tabindex="-1"><div class="modal-dialog modal-sm modal-Clay Modal Status"><div class="modal-content"><div class="modal-header"><span class="modal-title-indicator"><svg aria-hidden="true" class="lexicon-icon lexicon-icon-info-circle"focusable="false"><title>info-circle</title><use xlink:href="spritemap.svg#info-circle" /></svg></span><div class="modal-title">Clay Modal Title</div><button class="btn close btn-unstyled"aria-label="times"type="null"><svg aria-hidden="true" class="lexicon-icon lexicon-icon-times"focusable="false"><title>times</title><use xlink:href="spritemap.svg#times" /></svg></button></div><div class="modal-body modal-body-iframe"><iframe src="http://www.clayui.com" title="http://www.clayui.com"></iframe></div><div class="modal-footer"><div class="modal-item-first"><div class="btn-group"></div></div><div class="modal-item-last"><div class="btn-group"></div></div></div></div></div></div>
4 changes: 2 additions & 2 deletions packages/clay-modal/demos/a11y.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ <h4>Modal with buttons in footer</h4>
type: 'close'
},
{
alignment: 'left',
label: 'All',
position: 'left',
},
{
alignment: 'left',
label: 'All',
position: 'left',
style: 'secondary'
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-modal/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ <h4>Modal with buttons in footer</h4>
type: 'close'
},
{
alignment: 'left',
label: 'All',
position: 'left',
},
{
alignment: 'left',
label: 'All',
position: 'left',
style: 'secondary'
}
],
Expand Down
84 changes: 51 additions & 33 deletions packages/clay-modal/src/ClayModal.soy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
{@param? _isTransitioning: bool}
{@param? body: string|html}
{@param? elementClasses: string}
{@param? footerButtons: list<?>}
{@param? footerButtons: list<[
alignment: string,
label: string,
style: string,
type: string
]>}
{@param? id: string}
{@param? size: string}
{@param? spritemap: string}
Expand Down Expand Up @@ -152,45 +157,58 @@
{template .footer}
{@param? _handleClickCloseButtonFooter: any}
{@param? _handleClickFooterButton: any}
{@param? buttons: list<?>}
{@param? buttons: list<[
alignment: string,
label: string,
style: string,
type: string
]>}

{if $buttons}
<div class="modal-footer">
<div class="modal-item-first">
{foreach $button in $buttons}
{if $button.alignment == 'left'}
{call ClayButton.render}
{param events: ['click': $_handleClickFooterButton] /}
{param label: $button.label /}
{param style: $button.style ?: 'secondary' /}
{param type: not $button.type or $button.type == 'close' ? 'button' : $button.type /}
{/call}
{sp}
{/if}
{/foreach}
<div class="btn-group">
{foreach $button in $buttons}
{if $button.alignment == 'left'}
<div class="btn-group-item">
{call ClayButton.render}
{param events: ['click': $_handleClickFooterButton] /}
{param label: $button.label /}
{param style: $button.style ?: 'secondary' /}
{param type: not $button.type or $button.type == 'close' ? 'button' : $button.type /}
{/call}
</div>
{/if}
{/foreach}
</div>
</div>
<div class="modal-item-last">
{foreach $button in $buttons}
{if not $button.alignment or $button.alignment == 'right'}
{if $button.type == 'close'}
{call ClayButton.render}
{param elementClasses: 'close-modal' /}
{param events: ['click': $_handleClickCloseButtonFooter] /}
{param label: $button.label /}
{param style: 'secondary' /}
{param type: 'button' /}
{/call}
{else}
{call ClayButton.render}
{param events: ['click': $_handleClickFooterButton] /}
{param label: $button.label /}
{param style: $button.style ?: 'primary' /}
{param type: $button.type /}
{/call}
<div class="btn-group">
{foreach $button in $buttons}
{if not $button.alignment or $button.alignment == 'right'}
{if $button.type == 'close'}
<div class="btn-group-item">
{call ClayButton.render}
{param elementClasses: 'close-modal' /}
{param events: ['click': $_handleClickCloseButtonFooter] /}
{param label: $button.label /}
{param style: 'secondary' /}
{param type: 'button' /}
{/call}
</div>
{else}
<div class="btn-group-item">
{call ClayButton.render}
{param events: ['click': $_handleClickFooterButton] /}
{param label: $button.label /}
{param style: $button.style ?: 'primary' /}
{param type: $button.type /}
{/call}
</div>
{/if}
{/if}
{sp}
{/if}
{/foreach}
{/foreach}
</div>
</div>
</div>
{/if}
Expand Down
34 changes: 27 additions & 7 deletions packages/clay-modal/src/__tests__/__snapshots__/ClayModal.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,18 @@ exports[`ClayModal should render a modal with footer buttons 1`] = `
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-footer">
<div class="modal-item-first"></div>
<div class="modal-item-first">
<div class="btn-group"></div>
</div>
<div class="modal-item-last">
<button class="btn close-modal btn-secondary" type="button">Cancel</button>
<button class="btn btn-primary" type="button">Save</button>
<div class="btn-group">
<div class="btn-group-item">
<button class="btn close-modal btn-secondary" type="button">Cancel</button>
</div>
<div class="btn-group-item">
<button class="btn btn-primary" type="button">Save</button>
</div>
</div>
</div>
</div>
</div>
Expand All @@ -103,12 +111,24 @@ exports[`ClayModal should render a modal with footer buttons aligned to left and
<div class="modal-content">
<div class="modal-footer">
<div class="modal-item-first">
<button class="btn btn-secondary" type="button">My button 1</button>
<button class="btn btn-secondary" type="button">My button 2</button>
<div class="btn-group">
<div class="btn-group-item">
<button class="btn btn-secondary" type="button">My button 1</button>
</div>
<div class="btn-group-item">
<button class="btn btn-secondary" type="button">My button 2</button>
</div>
</div>
</div>
<div class="modal-item-last">
<button class="btn close-modal btn-secondary" type="button">Cancel</button>
<button class="btn btn-primary" type="button">Save</button>
<div class="btn-group">
<div class="btn-group-item">
<button class="btn close-modal btn-secondary" type="button">Cancel</button>
</div>
<div class="btn-group-item">
<button class="btn btn-primary" type="button">Save</button>
</div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 958a3a8

Please sign in to comment.