mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
1849b4d39f
* chore: migrate eslint to oxlint * chore: migrate prettier to oxfmt * chore: migrate typescript * chore: toThrow should have a expected value * chore: cast test value as Day * chore: small title fix * chore: mocks should be hoisted * chore: incorrect async useage * chore: test should be inside description * chore: test sohuld include an expeced * chore: oxfmt --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
32 lines
884 B
TypeScript
32 lines
884 B
TypeScript
import { TextareaHTMLAttributes, forwardRef } from 'react';
|
|
|
|
import { cx } from '../../../utils/styleUtils';
|
|
|
|
import style from './Textarea.module.scss';
|
|
|
|
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
variant?: 'subtle' | 'ghosted';
|
|
fluid?: boolean;
|
|
resize?: 'none' | 'both' | 'horizontal' | 'vertical';
|
|
}
|
|
|
|
const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function TextArea(
|
|
{ className, variant = 'subtle', fluid, rows = 5, resize = 'none', style: customStyle, ...textareaProps },
|
|
ref,
|
|
) {
|
|
return (
|
|
<textarea
|
|
ref={ref}
|
|
autoCorrect='off'
|
|
autoComplete='off'
|
|
spellCheck='false'
|
|
rows={rows}
|
|
style={{ ...customStyle, resize }}
|
|
className={cx([style.textarea, style[variant], fluid && style.fluid, className])}
|
|
{...textareaProps}
|
|
/>
|
|
);
|
|
});
|
|
|
|
export default Textarea;
|