carbon-components
Version:
Carbon Components is a component library for IBM Cloud
140 lines (133 loc) • 9.23 kB
HTML
<!--
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 data-text-input
class="bx--form-item bx--text-input-wrapper bx--password-input-wrapper">
<label for="text-input-3" class="bx--label">Text Input label</label>
<input id="text-input-3" type="password"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
data-toggle-password-visibility>
<button
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
aria-label="Show password">
<svg class="bx--icon--visibility-off" hidden="true" width="16" height="16" viewBox="0 0 16 16">
<path
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z">
</path>
</svg>
<svg class="bx--icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
<path d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z">
</path>
<path
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z">
</path>
</svg>
</button>
</div>
<div data-text-input
class="bx--form-item bx--text-input-wrapper bx--password-input-wrapper">
<label for="text-input-4" class="bx--label">Text Input label</label>
<input data-invalid id="text-input-4" type="password"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
data-toggle-password-visibility>
<button
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
aria-label="Show password">
<svg class="icon--visibility-off" hidden="true" width="16" height="16" viewBox="0 0 16 16">
<path
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z">
</path>
</svg>
<svg class="icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
<path d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z">
</path>
<path
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z">
</path>
</svg>
</button>
<div class="bx--form-requirement">
Validation message here
</div>
</div>
<div data-text-input
class="bx--form-item bx--text-input-wrapper bx--password-input-wrapper">
<label for="text-input-5" class="bx--label">Text Input label</label>
<div class="bx--form__helper-text">
Optional helper text goes here
</div>
<input id="text-input-5" type="password"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
data-toggle-password-visibility>
<button
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
aria-label="Show password">
<svg class="icon--visibility-off" hidden="true" width="16" height="16" viewBox="0 0 16 16">
<path
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z">
</path>
</svg>
<svg class="icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
<path d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z">
</path>
<path
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z">
</path>
</svg>
</button>
</div>
<div data-text-input
class="bx--form-item bx--text-input-wrapper bx--password-input-wrapper"
style="width: 320px">
<label for="text-input-6" class="bx--label">Text Input label</label>
<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>
<input id="text-input-6" type="password"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
data-toggle-password-visibility>
<button
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
aria-label="Show password">
<svg class="icon--visibility-off" hidden="true" width="16" height="16" viewBox="0 0 16 16">
<path
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z">
</path>
</svg>
<svg class="icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
<path d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z">
</path>
<path
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z">
</path>
</svg>
</button>
</div>
<div data-text-input
class="bx--form-item bx--text-input-wrapper bx--password-input-wrapper">
<label for="text-input-7" class="bx--label bx--label--disabled">Text Input label</label>
<div class="bx--form__helper-text bx--form__helper-text--disabled">
Optional helper text goes here
</div>
<input id="text-input-7" type="password"
class="bx--text-input bx--text-input--light" placeholder="Placeholder text"
data-toggle-password-visibility disabled>
<button
class="bx--text-input--password__visibility bx--tooltip__trigger bx--tooltip--icon__bottom"
aria-label="Show password">
<svg class="icon--visibility-off" hidden="true" width="16" height="16" viewBox="0 0 16 16">
<path
d="M11.846 3.45L15.293.007 16 .714l-3.284 3.281c1.261.902 2.377 2.212 3.347 3.93C14.02 11.642 11.333 13.5 8 13.5c-1.392 0-2.667-.324-3.822-.973L.703 16l-.706-.708 3.323-3.32C2.071 11.042.976 9.694.035 7.924 2.012 4.308 4.667 2.5 8 2.5c1.395 0 2.677.317 3.846.95zm-6.928 8.338c.944.477 1.97.712 3.082.712 2.795 0 5.076-1.483 6.907-4.568-.866-1.417-1.833-2.486-2.91-3.219l-1.55 1.55a3 3 0 0 1-4.185 4.182l-1.344 1.343zm-.882-.533l1.518-1.517A3 3 0 0 1 9.74 5.556l1.364-1.363A7.02 7.02 0 0 0 8 3.5c-2.798 0-5.047 1.439-6.819 4.432.842 1.465 1.792 2.568 2.855 3.323zm2.948-1.532a2 2 0 0 0 2.74-2.738l-2.74 2.738zm-.707-.707l2.74-2.738a2 2 0 0 0-2.74 2.738z">
</path>
</svg>
<svg class="icon--visibility-on" width="16" height="16" viewBox="0 0 16 11">
<path d="M8 7.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 1c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3z">
</path>
<path
d="M8 10c2.8 0 5.1-1.5 6.9-4.6C13.1 2.5 10.8 1 8 1 5.2 1 3 2.4 1.2 5.4 2.9 8.6 5.2 10 8 10zM8 0c3.3 0 6 1.8 8.1 5.4C14 9.2 11.3 11 8 11S2 9.2 0 5.5C2 1.9 4.6 0 8 0z">
</path>
</svg>
</button>
</div>