|
| 1 | +--- |
| 2 | +title: Drawer |
| 3 | +also: |
| 4 | + components/drawer/test.html: Testing - Drawer |
| 5 | + elements/hx-drawer: <hx-drawer> |
| 6 | +--- |
| 7 | +{% extends 'component.njk' %} |
| 8 | +{% import '_utils.njk' as utils %} |
| 9 | + |
| 10 | +{% block page_header %} |
| 11 | + <p> |
| 12 | + The {{page.title}} provides a temporary overlay dialog, anchored |
| 13 | + to the right side of the screen. |
| 14 | + </p> |
| 15 | +{% endblock %} |
| 16 | + |
| 17 | +{% block content %} |
| 18 | + <section> |
| 19 | + <header> |
| 20 | + <h2 id="basic-drawer">Basic Drawer</h2> |
| 21 | + </header> |
| 22 | + |
| 23 | + <div class="example" id="vue-drawerDemo"> |
| 24 | + <header> |
| 25 | + <form class="beta-hxForm"> |
| 26 | + <hx-text-control> |
| 27 | + <input |
| 28 | + id="txtTitle" |
| 29 | + type="text" |
| 30 | + v-model="title" |
| 31 | + /> |
| 32 | + <label for="txtTitle"> |
| 33 | + Title |
| 34 | + </label> |
| 35 | + </hx-text-control> |
| 36 | + |
| 37 | + <hx-select-control> |
| 38 | + <select id="selSize" v-model="size"> |
| 39 | + <option v-for="_size in sizes" :value="_size"> |
| 40 | + {% raw %}{{_size.label}}{% endraw %} |
| 41 | + </option> |
| 42 | + </select> |
| 43 | + <hx-select></hx-select> |
| 44 | + <label for="selSize"> |
| 45 | + Size |
| 46 | + </label> |
| 47 | + </hx-select-control> |
| 48 | + |
| 49 | + <fieldset> |
| 50 | + <label>Options</label> |
| 51 | + |
| 52 | + <hx-checkbox-control> |
| 53 | + <input |
| 54 | + id="chkHasPadding" |
| 55 | + type="checkbox" |
| 56 | + v-model="hasPadding" |
| 57 | + /> |
| 58 | + <label for="chkHasPadding"> |
| 59 | + <hx-checkbox></hx-checkbox> |
| 60 | + Padded Content |
| 61 | + </label> |
| 62 | + </hx-checkbox-control> |
| 63 | + |
| 64 | + <hx-checkbox-control> |
| 65 | + <input |
| 66 | + aria-describedby="helpLengthyBody" |
| 67 | + id="chkLengthyBody" |
| 68 | + type="checkbox" |
| 69 | + v-model="hasLengthyContent" |
| 70 | + /> |
| 71 | + <label for="chkLengthyBody"> |
| 72 | + <hx-checkbox></hx-checkbox> |
| 73 | + Lengthy Content |
| 74 | + </label> |
| 75 | + <p id="helpLengthyBody">(triggers scrolling)</p> |
| 76 | + </hx-checkbox-control> |
| 77 | + </fieldset> |
| 78 | + </form> |
| 79 | + </header> |
| 80 | + |
| 81 | + <div> |
| 82 | + <hx-disclosure |
| 83 | + aria-controls="demo-drawer" |
| 84 | + class="hxBtn" |
| 85 | + > |
| 86 | + Toggle Drawer |
| 87 | + </hx-disclosure> |
| 88 | + |
| 89 | + <hx-drawer |
| 90 | + :class="drawerClasses" |
| 91 | + id="demo-drawer" |
| 92 | + > |
| 93 | + <header> |
| 94 | + <h3 v-text="title"></h3> |
| 95 | + </header> |
| 96 | + |
| 97 | + <hx-div :class="bodyClasses"> |
| 98 | + <template v-if="hasLengthyContent"> |
| 99 | + {{ utils.lorem(10) }} |
| 100 | + </template> |
| 101 | + <template v-else> |
| 102 | + <p> |
| 103 | + Lorem ipsum dolor sit amet, consectetur adipiscing elit, |
| 104 | + sed do eiusmod tempor incididunt ut labore et dolore magna |
| 105 | + aliqua. Gravida rutrum quisque non tellus. Sagittis vitae |
| 106 | + et leo duis ut diam quam nulla. Diam vel quam elementum |
| 107 | + pulvinar etiam non. Pulvinar sapien et ligula ullamcorper |
| 108 | + malesuada proin libero nunc. Ultricies integer quis auctor |
| 109 | + elit sed vulputate mi sit amet. Egestas dui id ornare arcu |
| 110 | + odio ut. In iaculis nunc sed augue. |
| 111 | + </p> |
| 112 | + </template> |
| 113 | + </hx-div> |
| 114 | + |
| 115 | + <footer> |
| 116 | + <button class="hxBtn hxPrimary">Save Changes</button> |
| 117 | + <button class="hxBtn">Cancel</button> |
| 118 | + </footer> |
| 119 | + </hx-drawer> |
| 120 | + </div> |
| 121 | + |
| 122 | + <footer> |
| 123 | + <pre><code v-text="snippet"></code></pre> |
| 124 | + </footer> |
| 125 | + </div> |
| 126 | + </section> |
| 127 | +{% endblock %} |
0 commit comments