mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 20:40:15 +02:00
c1330d92b2
* mantine v8 migration * various design changes and improvements
30 lines
1001 B
TypeScript
30 lines
1001 B
TypeScript
import type { SegmentedControlProps as MantineSegmentedControlProps } from '@mantine/core';
|
|
|
|
import { SegmentedControl as MantineSegmentedControl } from '@mantine/core';
|
|
import { forwardRef } from 'react';
|
|
|
|
import styles from './segmented-control.module.css';
|
|
|
|
type SegmentedControlProps = MantineSegmentedControlProps;
|
|
|
|
export const SegmentedControl = forwardRef<HTMLDivElement, SegmentedControlProps>(
|
|
({ classNames, size = 'sm', ...props }: SegmentedControlProps, ref) => {
|
|
return (
|
|
<MantineSegmentedControl
|
|
classNames={{
|
|
control: styles.control,
|
|
indicator: styles.indicator,
|
|
label: styles.label,
|
|
root: styles.root,
|
|
...classNames,
|
|
}}
|
|
ref={ref}
|
|
size={size}
|
|
transitionDuration={250}
|
|
transitionTimingFunction="linear"
|
|
{...props}
|
|
/>
|
|
);
|
|
},
|
|
);
|