UNPKG

carbon-components

Version:

The Carbon Design System is IBM’s open-source design system for products and experiences.

283 lines (277 loc) • 18.9 kB
<!-- Copyright IBM Corp. 2016, 2018 This source code is licensed under the Apache-2.0 license found in the LICENSE file in the root directory of this source tree. --> <div class="bx--form-item"> <div class="bx--dropdown__wrapper "> <span id="example-71n8vbawmcp-label" class="bx--label">Dropdown label</span> <div data-dropdown data-value class="bx--dropdown bx--dropdown--up bx--dropdown--light "> <button class="bx--dropdown-text" aria-haspopup="true" aria-expanded="false" aria-controls="example-71n8vbawmcp-menu" aria-labelledby="example-71n8vbawmcp-label example-71n8vbawmcp-value" type="button"> <span class="bx--dropdown-text__inner" id="example-71n8vbawmcp-value"> Dropdown option </span> <span class="bx--dropdown__arrow-container"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__arrow" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg> </span> </button> <ul class="bx--dropdown-list" id="example-71n8vbawmcp-menu" role="menu" tabindex="-1" id="example-71n8vbawmcp-menu" aria-hidden="true" aria-labelledby="example-71n8vbawmcp-label"> <li data-option data-value="all" class="bx--dropdown-item" title="Option 1"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="true" id="example-71n8vbawmcp-item0">Option 1</a> </li> <li data-option data-value="cloudFoundry" class="bx--dropdown-item" title="Option 2"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item1">Option 2</a> </li> <li data-option data-value="staging" class="bx--dropdown-item" title="Option 3"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item2">Option 3</a> </li> <li data-option data-value="dea" class="bx--dropdown-item" title="Option 4"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item3">Option 4</a> </li> <li data-option data-value="router" class="bx--dropdown-item" title="Option 5"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item4">Option 5</a> </li> <li data-option data-value="loremipsum" class="bx--dropdown-item" title="An example option that is really long to show what should be done to handle long text"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item5">An example option that is really long to show what should be done to handle long text</a> </li> </ul> </div> <div class="bx--form__helper-text">Optional helper text.</div> </div> </div> <div class="bx--form-item"> <div class="bx--dropdown__wrapper "> <span id="example-qs1xe1k8fz-label" class="bx--label">Dropdown label</span> <div data-dropdown data-value class="bx--dropdown bx--dropdown--up bx--dropdown--light "> <button class="bx--dropdown-text" aria-haspopup="true" aria-expanded="false" aria-controls="example-qs1xe1k8fz-menu" aria-labelledby="example-qs1xe1k8fz-label example-qs1xe1k8fz-value" type="button"> <span class="bx--dropdown-text__inner" id="example-qs1xe1k8fz-value"> Dropdown option </span> <span class="bx--dropdown__arrow-container"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__arrow" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg> </span> </button> <ul class="bx--dropdown-list" role="menu" tabindex="-1" id="example-qs1xe1k8fz-menu" aria-hidden="true" aria-labelledby="example-qs1xe1k8fz-label"> <li data-option data-value="all" class="bx--dropdown-item" title="Option 1"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="true" id="example-qs1xe1k8fz-item0">Option 1</a> </li> <li data-option data-value="cloudFoundry" class="bx--dropdown-item" title="Option 2"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-qs1xe1k8fz-item1">Option 2</a> </li> <li data-option data-value="staging" class="bx--dropdown-item" title="Option 3"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-qs1xe1k8fz-item2">Option 3</a> </li> <li data-option data-value="dea" class="bx--dropdown-item" title="Option 4"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-qs1xe1k8fz-item3">Option 4</a> </li> <li data-option data-value="router" class="bx--dropdown-item" title="Option 5"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-qs1xe1k8fz-item4">Option 5</a> </li> <li data-option data-value="loremipsum" class="bx--dropdown-item" title="An example option that is really long to show what should be done to handle long text"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-qs1xe1k8fz-item5">An example option that is really long to show what should be done to handle long text</a> </li> </ul> </div> <div class="bx--form__helper-text">Optional helper text here; if message is more than one line text should wrap (~100 character count maximum)</div> </div> </div> <div class="bx--form-item"> <div class="bx--dropdown__wrapper "> <span id="example-clsu3mqkrjd-label" class="bx--label bx--label--disabled" aria-disabled="true">Dropdown label</span> <div data-dropdown data-value class="bx--dropdown bx--dropdown--up bx--dropdown--light bx--dropdown--disabled"> <button disabled class="bx--dropdown-text" aria-haspopup="true" aria-expanded="false" aria-controls="example-clsu3mqkrjd-menu" aria-labelledby="example-clsu3mqkrjd-label example-clsu3mqkrjd-value" type="button"> <span class="bx--dropdown-text__inner" id="example-clsu3mqkrjd-value"> Dropdown option </span> <span class="bx--dropdown__arrow-container"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__arrow" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg> </span> </button> <!-- Note: remove `tabindex` from disabled dropdown lists --> <ul class="bx--dropdown-list" id="example-clsu3mqkrjd-menu" role="menu" id="example-clsu3mqkrjd-menu" aria-hidden="true" aria-labelledby="example-clsu3mqkrjd-label"> <li data-option data-value="all" class="bx--dropdown-item" title="Option 1"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="true" id="example-clsu3mqkrjd-item0">Option 1</a> </li> <li data-option data-value="cloudFoundry" class="bx--dropdown-item" title="Option 2"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-clsu3mqkrjd-item1">Option 2</a> </li> <li data-option data-value="staging" class="bx--dropdown-item" title="Option 3"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-clsu3mqkrjd-item2">Option 3</a> </li> <li data-option data-value="dea" class="bx--dropdown-item" title="Option 4"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-clsu3mqkrjd-item3">Option 4</a> </li> <li data-option data-value="router" class="bx--dropdown-item" title="Option 5"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-clsu3mqkrjd-item4">Option 5</a> </li> <li data-option data-value="loremipsum" class="bx--dropdown-item" title="An example option that is really long to show what should be done to handle long text"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-clsu3mqkrjd-item5">An example option that is really long to show what should be done to handle long text</a> </li> </ul> </div> <div class="bx--form__helper-text bx--form__helper-text--disabled" aria-disabled="true"> Optional helper text here; if message is more than one line text should wrap (~100 character count maximum)</div> </div> </div> <div class="bx--form-item"> <div class="bx--dropdown__wrapper "> <span id="example-9dmh8sur3o5-label" class="bx--label">Dropdown label</span> <div data-dropdown data-value class="bx--dropdown bx--dropdown--invalid bx--dropdown--up bx--dropdown--light" data-invalid> <button class="bx--dropdown-text" aria-haspopup="true" aria-expanded="false" aria-controls="example-9dmh8sur3o5-menu" aria-labelledby="example-9dmh8sur3o5-label example-9dmh8sur3o5-value" type="button"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__invalid-icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"></path><path d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z" data-icon-path="inner-path" opacity="0"></path></svg> <span class="bx--dropdown-text__inner" id="example-9dmh8sur3o5-value"> Dropdown option </span> <span class="bx--dropdown__arrow-container"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__arrow" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg> </span> </button> <ul class="bx--dropdown-list" id="example-9dmh8sur3o5-menu" role="menu" tabindex="-1" id="example-9dmh8sur3o5-menu" aria-hidden="true" aria-labelledby="example-9dmh8sur3o5-label"> <li data-option data-value="all" class="bx--dropdown-item" title="Option 1"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="true" id="example-9dmh8sur3o5-item0">Option 1</a> </li> <li data-option data-value="cloudFoundry" class="bx--dropdown-item" title="Option 2"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-9dmh8sur3o5-item1">Option 2</a> </li> <li data-option data-value="staging" class="bx--dropdown-item" title="Option 3"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-9dmh8sur3o5-item2">Option 3</a> </li> <li data-option data-value="dea" class="bx--dropdown-item" title="Option 4"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-9dmh8sur3o5-item3">Option 4</a> </li> <li data-option data-value="router" class="bx--dropdown-item" title="Option 5"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-9dmh8sur3o5-item4">Option 5</a> </li> <li data-option data-value="loremipsum" class="bx--dropdown-item" title="An example option that is really long to show what should be done to handle long text"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-9dmh8sur3o5-item5">An example option that is really long to show what should be done to handle long text</a> </li> </ul> </div> <div class="bx--form-requirement"> This is a validation message </div> </div> </div> <div class="bx--form-item"> <div class="bx--dropdown__wrapper "> <span id="example-71n8vbawmcp-label" class="bx--label">Dropdown label</span> <div data-dropdown data-value class="bx--dropdown bx--dropdown--show-selected bx--dropdown--up bx--dropdown--light "> <button class="bx--dropdown-text" aria-haspopup="true" aria-expanded="false" aria-controls="example-71n8vbawmcp-menu" aria-labelledby="example-71n8vbawmcp-label example-71n8vbawmcp-value" type="button"> <span class="bx--dropdown-text__inner" id="example-71n8vbawmcp-value"> Dropdown option </span> <span class="bx--dropdown__arrow-container"> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--dropdown__arrow" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg> </span> </button> <ul class="bx--dropdown-list" id="example-71n8vbawmcp-menu" role="menu" tabindex="-1" id="example-71n8vbawmcp-menu" aria-hidden="true" aria-labelledby="example-71n8vbawmcp-label"> <li data-option data-value="all" class="bx--dropdown-item" title="Option 1"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="true" id="example-71n8vbawmcp-item0">Option 1</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> <li data-option data-value="cloudFoundry" class="bx--dropdown-item" title="Option 2"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item1">Option 2</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> <li data-option data-value="staging" class="bx--dropdown-item" title="Option 3"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item2">Option 3</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> <li data-option data-value="dea" class="bx--dropdown-item" title="Option 4"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item3">Option 4</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> <li data-option data-value="router" class="bx--dropdown-item" title="Option 5"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item4">Option 5</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> <li data-option data-value="loremipsum" class="bx--dropdown-item" title="An example option that is really long to show what should be done to handle long text"> <a class="bx--dropdown-link" href="javascript:void(0)" tabindex="-1" role="menuitemradio" aria-checked="false" id="example-71n8vbawmcp-item5">An example option that is really long to show what should be done to handle long text</a> <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-hidden="true" class="bx--list-box__menu-item__selected-icon" width="16" height="16" viewBox="0 0 32 32"><path d="M13 24L4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg> </li> </ul> </div> <div class="bx--form__helper-text">Optional helper text.</div> </div> </div>