mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 20:33:47 +00:00
feat: reusable input component
This commit is contained in:
committed by
Carlos Valente
parent
3f3cef7d6f
commit
97691eba05
@@ -0,0 +1,38 @@
|
||||
.input {
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: $gray-1200;
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
color: $gray-200;
|
||||
border-radius: $component-border-radius-md;
|
||||
border: 1px solid transparent;
|
||||
|
||||
padding-inline: 0.5em;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-color: $gray-1100;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
background-color: $gray-1000;
|
||||
border: 1px solid $blue-500;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: $gray-500;
|
||||
}
|
||||
}
|
||||
|
||||
.medium {
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.large {
|
||||
height: 2.5rem;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { InputHTMLAttributes } from 'react';
|
||||
|
||||
import { cx } from '../../../utils/styleUtils';
|
||||
|
||||
import style from './Input.module.scss';
|
||||
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
variant?: 'subtle';
|
||||
height?: 'medium' | 'large';
|
||||
}
|
||||
|
||||
export default function Input({ className, variant = 'subtle', height = 'medium', ...inputProps }: InputProps) {
|
||||
return <input type='text' className={cx([style.input, style[variant], style[height], className])} {...inputProps} />;
|
||||
}
|
||||
Reference in New Issue
Block a user