-
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.
- Loading branch information
1 parent
89b0e35
commit 6be75ce
Showing
4 changed files
with
135 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
ckanext/nswdesignsystem/templates/macros/nswdesignsystem/popover.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% macro popover(id, label=null, position="top", gap=10, style="dark-outline") %} | ||
{% with trigger = caller("trigger")|trim %} | ||
<button type="button" class="nsw-button nsw-button--{{ style }} js-popover" aria-controls="{{ id }}" | ||
data-popover-position="{{ position }}" data-popover-class="" data-popover-gap="{{ gap }}"> | ||
|
||
{% if trigger %} | ||
{{ trigger }} | ||
|
||
{% else %} | ||
<span class="material-icons nsw-material-icons" focusable="false" aria-hidden="true">info</span> | ||
<span>{{ label }}</span> | ||
|
||
{% endif %} | ||
</button> | ||
|
||
|
||
{% endwith %} | ||
|
||
<div id="{{ id }}" class="nsw-popover"> | ||
{{ caller("popover") }} | ||
</div> | ||
|
||
{% endmacro %} |
92 changes: 92 additions & 0 deletions
92
ckanext/nswdesignsystem/templates/nswdesignsystem/demo/popover.preview.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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{% from "macros/nswdesignsystem/popover.html" import popover with context %} | ||
|
||
<div class="nsw-list nsw-list--8"> | ||
|
||
{% call(part) popover("popover-top", "Open top", "top") %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-top-start", "Open top start", "top-start", style="danger") %} | ||
{% if part == "trigger" %} | ||
<span>Custom trigger</span> | ||
<span class="material-icons nsw-material-icons">star</span> | ||
{% elif part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-top-end", "Open top end", "top-end", style="dark") %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-left", "Open left", "left") %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-right", "Open right", "right") %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-bottom", "Open bottom", "bottom") %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
{% call(part) popover("popover-gap", "Open with gap", gap=100) %} | ||
{% if part == "popover" %} | ||
<div class="nsw-p-sm"> | ||
<h4>Family rebate</h4> | ||
<p>Helps families with dependants to pay their energy bills. Applications opening late July for the 2019-20 rebate.</p> | ||
<p><a class="js-link" href="https://digital.nsw.gov.au"> | ||
<span>Get started</span><span class="material-icons nsw-material-icons" title="(opens in new window)">open_in_new</span> | ||
</a></p> | ||
</div> | ||
{% endif %} | ||
{% endcall %} | ||
|
||
</div> |