Skip to content

Commit

Permalink
chore: formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvatore Laisa authored and moebiusmania committed Apr 29, 2024
1 parent 2fdae2d commit 2898c57
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@ import type { CheckboxProps } from "react-aria-components";
import { Checkbox as CheckboxAria } from "react-aria-components";
import { checkbox, messageStyle, wrapper } from "./Checkbox.css";
import { Body } from "../Typography";
import {vars} from "../../utils/theme.css.ts";
import { vars } from "../../utils/theme.css.ts";

type Props = React.PropsWithChildren<{
checked?: boolean;
disabled?: boolean;
error?: boolean;
message?: string;
} & Omit<CheckboxProps,"isSelected"|"isDisabled"|"children"|"className">> ;
type Props = React.PropsWithChildren<
{
checked?: boolean;
disabled?: boolean;
error?: boolean;
message?: string;
} & Omit<
CheckboxProps,
"isSelected" | "isDisabled" | "children" | "className"
>
>;

export const Checkbox = ({
checked,
children,
disabled,
error,
message,
...props
...props
}: Props) => {
return (
<CheckboxAria
{...props}
{...props}
isDisabled={disabled}
isSelected={checked}
className={wrapper}
Expand All @@ -30,7 +35,8 @@ export const Checkbox = ({
data-id="check-icon"
className={checkbox({ checked, disabled, error })}
>
{checked && <svg
{checked && (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
Expand All @@ -39,15 +45,15 @@ export const Checkbox = ({
>
<path
d="M4.35982 7.39202L2.87769 8.73317L6.5114 12.7572L13.5542 5.70712L12.1414 4.29291L6.58447 9.85565L4.35982 7.39202Z"
fill= {vars.colors.root.neutral[0]}
fill={vars.colors.root.neutral[0]}
/>
</svg>
}
)}
</div>
<Body noMargin={true}>{children}</Body>
{error && (
<div className={messageStyle}>
<Body noMargin size="s" color={'root.red.600'}>
<Body noMargin size="s" color={"root.red.600"}>
{message || "error message"}
</Body>
</div>
Expand Down

0 comments on commit 2898c57

Please sign in to comment.