mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 21:10:12 +02:00
Migrate to Mantine v8 and Design Changes (#961)
* mantine v8 migration * various design changes and improvements
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
.root {
|
||||
transition: width 0.3s ease-in-out;
|
||||
|
||||
&[data-disabled='true'] {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
color: var(--theme-colors-surface-foreground);
|
||||
background: var(--theme-colors-surface);
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.input:focus,
|
||||
.input:focus-visible {
|
||||
border-color: lighten(var(--theme-colors-border), 10%);
|
||||
}
|
||||
|
||||
.label {
|
||||
margin-bottom: var(--theme-spacing-sm);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Textarea as MantineTextarea, TextareaProps as MantineTextareaProps } from '@mantine/core';
|
||||
import { CSSProperties, forwardRef } from 'react';
|
||||
|
||||
import styles from './textarea.module.css';
|
||||
|
||||
export interface TextareaProps extends MantineTextareaProps {
|
||||
maxWidth?: CSSProperties['maxWidth'];
|
||||
width?: CSSProperties['width'];
|
||||
}
|
||||
|
||||
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
({ children, classNames, maxWidth, style, width, ...props }: TextareaProps, ref) => {
|
||||
return (
|
||||
<MantineTextarea
|
||||
classNames={{
|
||||
input: styles.input,
|
||||
label: styles.label,
|
||||
required: styles.required,
|
||||
root: styles.root,
|
||||
wrapper: styles.wrapper,
|
||||
...classNames,
|
||||
}}
|
||||
ref={ref}
|
||||
style={{ maxWidth, width, ...style }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</MantineTextarea>
|
||||
);
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user