Migration of toggle show password functionality to separate component.'

This commit is contained in:
Brandon Tripp 2021-04-05 11:53:40 -06:00
parent 453bd7ae35
commit 60a6ac3c5b
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
<template>
<span class="click-wrapper" @click="togglePassword">
<span class="icon-wrapper" :data-test="iconName">
<base-icon class="toggle-icon" :name="iconName" />
</span>
</span>
</template>
<script>
export default {
props: [
'iconName'
],
emits: ['toggle-password'],
methods: {
togglePassword(event) {
event.preventDefault()
this.$emit('show-password')
}
}
}
</script>
<style lang="scss">
.icon-wrapper {
margin-right: 2px;
}
.click-wrapper {
padding: 8px;
align-content: center;
color: $text-color-disabled;
cursor: pointer;
}
.click-wrapper:hover {
&:focus-within {
background-color: $background-color-base;
border: $input-border-size solid $border-color-active;
.toggle-icon {
color: $text-color-base;
}
}
}
</style>