Skip to content

Commit

Permalink
refactor: atoms-button-compound data restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
StfBauer committed Nov 5, 2022
1 parent 74da246 commit 460ebd9
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 75 deletions.
9 changes: 0 additions & 9 deletions htwoo-core/src/_data/htwoo-cata.json

This file was deleted.

1 change: 1 addition & 0 deletions htwoo-core/src/_data/htwoo-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"button": {
"iconname": "icon-ninjacat",
"label": "Button",
"description":"Primary with description",
"aria-label": "Button"
},
"contextMenu": {
Expand Down
14 changes: 0 additions & 14 deletions htwoo-core/src/_data/media.json

This file was deleted.

6 changes: 4 additions & 2 deletions htwoo-core/src/_patterns/atoms/buttons/button-action.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{#button}}
<button class="hoo-buttonaction">
<span class="hoo-button-icon" aria-hidden="true"> {{> atoms-icon iconname=icon }} </span>
<span class="hoo-button-icon" aria-hidden="true"> {{> atoms-icon }} </span>
<span class="hoo-button-label"> {{label}} </span>
</button>
</button>
{{/button}}
4 changes: 0 additions & 4 deletions htwoo-core/src/_patterns/atoms/buttons/button-action.json

This file was deleted.

28 changes: 8 additions & 20 deletions htwoo-core/src/_patterns/atoms/buttons/button-cmd.hbs
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
{{# if ddItems }}
<div class="hoo-buttoncmd{{ modifier }}" aria-haspopup="true">
<button class="hoo-buttoncmd{{ modifier }}" aria-haspopup="true">
<div class="hoo-buttoncmd{{ modifier }}" {{#if contextMenu}} aria-haspopup="true" {{/if}}>
<button class="hoo-buttoncmd{{ modifier }}" {{#if contextMenu}}aria-haspopup="true"{{/if}}>
<span class="hoo-button-icon" aria-hidden="true"> {{> atoms-icon iconname=iconAction }} </span>
<span class="hoo-button-label"> {{label}} </span>
{{!-- When no drop down items are shown there is not need to show the dropdown --}}
{{#if contextMenu }}
<span class="hoo-button-icon hoo-buttonchevron"> {{> atoms-icon iconname=iconDown }} </span>
{{/if}}
</button>
{{!-- When no drop down items are shown there is not need to show the dropdown --}}
{{> atoms-menu-flyouts contextItems=ddItems }}
</div>
{{ else }}
{{!-- Variant when no command bar is present --}}
<div class="hoo-buttoncmd{{ modifier }}">
<button class="hoo-buttoncmd{{ modifier }}">
<span class="hoo-button-icon" aria-hidden="true"> {{> atoms-icon iconname=iconAction }} </span>
<span class="hoo-button-label"> {{label}} </span>
{{!-- When no drop down items are shown there is not need to show the dropdown
* No Chevron
--}}
</button>
{{!--
* No Flyout gets rendered either
--}}
</div>
{{/ if }}
{{#contextMenu}}
{{> atoms-menu-flyouts }}
{{/contextMenu}}
</div>
12 changes: 1 addition & 11 deletions htwoo-core/src/_patterns/atoms/buttons/button-cmd.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"iconAction": "icon-plus",
"iconDown": "icon-arrow-down",
"label": "New Item",
"ddItems": [
{
"label": "Email message",
"icon": "icon-ninjacat"
},
{
"label": "Calendar Event",
"icon": "icon-minus"
}
]
"label": "New Item"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<button class="{{ classname }}">
{{#button}}
<button class="hoo-buttoncomp-primary">
<span class="hoo-buttoncomp-label">{{ label }}</span>
<span class="hoo-buttoncomp-desc">{{ desc }}</span>
</button>
<span class="hoo-buttoncomp-desc">{{ description }}</span>
</button>
{{/button}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<button class="{{ classname }}">
{{#button}}
<button class="hoo-buttoncomp">
<span class="hoo-buttoncomp-label">{{ label }}</span>
<span class="hoo-buttoncomp-desc">{{ desc }}</div>
<span class="hoo-buttoncomp-desc">{{ description }}</div>
</button>
{{/button}}

This file was deleted.

0 comments on commit 460ebd9

Please sign in to comment.