-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(button menu): wip - work on styles and interaction details
- Loading branch information
Showing
7 changed files
with
339 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
--- | ||
layout: layouts/example.njk | ||
title: Button menu (example) | ||
arguments: button-menu | ||
figma_link: https://www.figma.com/file/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?type=design&node-id=66-5816&mode=design | ||
--- | ||
|
||
{%- from "moj/components/button-menu/macro.njk" import mojButtonMenu -%} | ||
{%- from "govuk/components/button/macro.njk" import govukButton %} | ||
|
||
|
||
<h3>Single button</h3> | ||
{{ mojButtonMenu({ | ||
items: [{ | ||
text: "Primary action", | ||
href: "#" | ||
}] | ||
}) }} | ||
|
||
<h3>Default</h3> | ||
{{ mojButtonMenu({ | ||
items: [{ | ||
text: "Primary action", | ||
href: "#" | ||
}, { | ||
text: "Second action", | ||
href: "#" | ||
}, { | ||
text: "Third action", | ||
href: "#" | ||
}] | ||
}) }} | ||
|
||
<h3>Secondary button</h3> | ||
{{ mojButtonMenu({ | ||
button: { | ||
text: "Print options", | ||
classes: "govuk-button--secondary" | ||
}, | ||
items: [{ | ||
text: "Primary action", | ||
href: "#" | ||
}, { | ||
text: "Second action", | ||
href: "#" | ||
}, { | ||
text: "Third action", | ||
href: "#" | ||
}] | ||
}) }} | ||
|
||
<h3>Right aligned</h3> | ||
<div style="display: flex; flex-direction: row-reverse;"> | ||
{{ mojButtonMenu({ | ||
button: { | ||
text: "Print options", | ||
classes: "govuk-button--secondary" | ||
}, | ||
alignMenu: "right", | ||
items: [{ | ||
text: "Primary action", | ||
href: "#" | ||
}, { | ||
text: "Second action", | ||
href: "#" | ||
}, { | ||
text: "Third action", | ||
href: "#" | ||
}] | ||
}) }} | ||
</div> | ||
|
||
<h3>Inverse</h3> | ||
<div style="background-color: #1d70b8; padding: 30px 30px 20px 30px;"> | ||
{{ mojButtonMenu({ | ||
button: { | ||
text: "Print options", | ||
classes: "govuk-button--inverse" | ||
}, | ||
items: [{ | ||
text: "Primary action", | ||
href: "#" | ||
}, { | ||
text: "Second action", | ||
href: "#" | ||
}, { | ||
text: "Third action", | ||
href: "#" | ||
}] | ||
}) }} | ||
</div> | ||
|
||
|
||
<h3>Govuk button group</h3> | ||
<div class="govuk-button-group"> | ||
{{ govukButton({ | ||
text: "Primary action" | ||
})}} | ||
{{ govukButton({ | ||
text: "Another action", | ||
classes: "govuk-button--secondary" | ||
})}} | ||
{{ govukButton({ | ||
text: "Click me!", | ||
classes: "govuk-button--secondary" | ||
})}} | ||
</div> | ||
|
||
<h3>MoJ button group</h3> | ||
<div class="moj-button-group"> | ||
{{ govukButton({ | ||
text: "Primary action" | ||
})}} | ||
{{ govukButton({ | ||
text: "Another action", | ||
classes: "govuk-button--secondary" | ||
})}} | ||
{{ govukButton({ | ||
text: "Click me!", | ||
classes: "govuk-button--secondary" | ||
})}} | ||
</div> | ||
|
||
<h3>MoJ button group inline (with button menu)</h3> | ||
<div class="moj-button-group moj-button-group--inline"> | ||
{{ govukButton({ | ||
text: "Primary action" | ||
})}} | ||
{{ mojButtonMenu({ | ||
button: { | ||
text: "Print options", | ||
classes: "govuk-button--secondary" | ||
}, | ||
items: [{ | ||
text: "Action", | ||
href: "#" | ||
}, { | ||
text: "Second action", | ||
href: "#" | ||
}, { | ||
text: "Third action", | ||
href: "#" | ||
}] | ||
}) }} | ||
</div> |
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
Oops, something went wrong.