Skip to content

Commit

Permalink
Change the size default and remove the component not necessary to dis…
Browse files Browse the repository at this point in the history
…play
  • Loading branch information
aralovelace committed Dec 5, 2024
1 parent 696346c commit b9c0742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/core/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import cn from "./utils/cn";

type ToggleProps = {
id: string;
size?: "default" | "small";
size?: "sm" | "lg";
label?: string;
className?: string;
} & React.ButtonHTMLAttributes<HTMLButtonElement>;

const Toggle: React.FC<ToggleProps> = ({
id,
size,
size = "lg",
label,
className,
...props
}) => {
const rootSize = size === "small" ? "w-[42px] h-[24px]" : "w-[56px] h-32";
const rootSize = size === "sm" ? "w-[42px] h-[24px]" : "w-[56px] h-32";
const thumbSize =
size === "small"
size === "sm"
? "w-[21px] h-[21px] translate-x-1 data-[state=checked]:translate-x-[20px]"
: "h-[28px] w-[28px] translate-x-2 data-[state=checked]:translate-x-[26px]";

Expand Down
5 changes: 0 additions & 5 deletions src/core/Toggle/Toggle.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,3 @@ Disabled.args = {
checked: false,
disabled: true,
};

export const Small = Template.bind({});
Small.args = {
size: "small",
};

0 comments on commit b9c0742

Please sign in to comment.