Add checkbox component

This commit is contained in:
jeffvli 2023-05-11 02:51:00 -07:00
parent 4eb90d20a2
commit 003fb26c60
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,32 @@
import { forwardRef } from 'react';
import { Checkbox as MantineCheckbox, CheckboxProps } from '@mantine/core';
import styled from 'styled-components';
const StyledCheckbox = styled(MantineCheckbox)`
& .mantine-Checkbox-input {
background-color: var(--input-bg);
&:checked {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
&:hover:not(:checked) {
background-color: var(--primary-color);
opacity: 0.5;
}
transition: none;
}
`;
export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
({ ...props }: CheckboxProps, ref) => {
return (
<StyledCheckbox
ref={ref}
{...props}
/>
);
},
);

View file

@ -32,3 +32,4 @@ export * from './query-builder';
export * from './rating';
export * from './hover-card';
export * from './option';
export * from './checkbox';