mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 21:50:35 +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,49 @@
|
||||
import type { TitleProps as MantineTitleProps } from '@mantine/core';
|
||||
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
||||
|
||||
import { createPolymorphicComponent, Title as MantineHeader } from '@mantine/core';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import styles from './text-title.module.css';
|
||||
|
||||
type MantineTextTitleDivProps = ComponentPropsWithoutRef<'div'> & MantineTitleProps;
|
||||
|
||||
interface TextTitleProps extends MantineTextTitleDivProps {
|
||||
children?: ReactNode;
|
||||
isLink?: boolean;
|
||||
isMuted?: boolean;
|
||||
isNoSelect?: boolean;
|
||||
overflow?: 'hidden' | 'visible';
|
||||
to?: string;
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
const _TextTitle = ({
|
||||
children,
|
||||
className,
|
||||
isLink,
|
||||
isMuted,
|
||||
isNoSelect,
|
||||
overflow,
|
||||
...rest
|
||||
}: TextTitleProps) => {
|
||||
return (
|
||||
<MantineHeader
|
||||
className={clsx(
|
||||
styles.root,
|
||||
{
|
||||
[styles.link]: isLink,
|
||||
[styles.muted]: isMuted,
|
||||
[styles.noSelect]: isNoSelect,
|
||||
[styles.overflowHidden]: overflow === 'hidden' && !rest.lineClamp,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</MantineHeader>
|
||||
);
|
||||
};
|
||||
|
||||
export const TextTitle = createPolymorphicComponent<'div', TextTitleProps>(_TextTitle);
|
||||
Reference in New Issue
Block a user