hensei-web/components/common/Input/index.module.scss
Justin Edmund a3a205fb5d Update Input and InputTableField
* Added error and label to input, in a fieldset
* Updated prop labels in InputTableField
2023-06-30 22:22:54 -07:00

129 lines
2.3 KiB
SCSS

.full {
width: 100%;
}
.fieldset {
display: flex;
flex-direction: column;
gap: $unit-half;
&:last-child .error {
margin-bottom: 0;
}
.error {
color: $error;
font-size: $font-small;
padding: calc($unit / 2) ($unit * 2);
min-width: 100%;
margin-bottom: $unit;
width: 0;
}
.input {
-webkit-font-smoothing: antialiased;
background-color: var(--input-bg);
border: 2px solid transparent;
border-radius: $input-corner;
box-sizing: border-box;
color: var(--text-primary);
display: block;
font-family: system-ui, -apple-system, 'Helvetica Neue', Helvetica, Arial,
sans-serif;
font-size: $font-regular;
width: 100%;
&:not(.wrapper) {
padding: $unit * 1.5 $unit-2x;
}
&.accessory {
$offset: 2px;
align-items: center;
background: var(--input-bg);
border-radius: $input-corner;
border: $offset solid transparent;
box-sizing: border-box;
position: relative;
.counter {
color: var(--text-tertiary);
display: block;
font-weight: $bold;
line-height: 48px;
position: absolute;
right: $unit-2x;
top: 0;
}
input {
background: transparent;
border-radius: $input-corner;
border: none;
box-sizing: border-box;
color: var(--text-primary);
padding: ($unit * 1.75) $unit-2x;
width: 100%;
}
}
&[type='number']::-webkit-inner-spin-button {
-webkit-appearance: none;
}
&:focus {
border: 2px solid $blue;
outline: none;
}
&.bound {
background-color: var(--input-bound-bg);
&:hover {
background-color: var(--input-bound-bg-hover);
}
}
&.duration {
background: transparent;
border: none;
padding: 0;
width: initial;
height: 100%;
padding: calc($unit-2x - 2px) 0;
&:hover {
background: transparent;
}
&:focus,
&:focus-visible {
border: none;
}
}
&.number {
text-align: right;
width: $unit-8x;
}
&.alignRight {
text-align: right;
}
&.hidden {
display: none;
}
}
.counter {
display: none;
}
}
.input::placeholder,
.input > input::placeholder {
color: var(--text-secondary);
opacity: 1;
}