Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions components/base/toggle/toggle.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,22 @@ export const ToggleSlimBase = () => (
</div>
</div>
);

export const TogglesFullWidth = () => (
<div className="flex w-full max-w-lg flex-col gap-4">
<Toggle
label="Remember me"
hint="Save my login details for next time, so you can skip this step on this device until you sign out or clear your browser data."
size="sm"
className="w-full"
/>
<Toggle label="Remember me" hint="Save my login details for next time." size="sm" className="w-full" />
<Toggle
label="Remember me"
hint="Save my login details for next time, so you can skip this step on this device until you sign out or clear your browser data."
size="md"
className="w-full"
/>
<Toggle label="Remember me" hint="Save my login details for next time." size="md" className="w-full" />
</div>
);
3 changes: 3 additions & 0 deletions components/base/toggle/toggle.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ TogglesSlim.storyName = "Toggles slim";

export const ToggleSlimBase = () => <ToggleComponents.ToggleSlimBase />;
ToggleSlimBase.storyName = "Toggle slim base";

export const TogglesFullWidth = () => <ToggleComponents.TogglesFullWidth />;
TogglesFullWidth.storyName = "Toggles full width";
2 changes: 1 addition & 1 deletion components/base/toggle/toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ToggleBase = ({ className, isHovered, isDisabled, isFocusVisible, i
return (
<div
className={cx(
"cursor-pointer rounded-full bg-tertiary ring-[0.5px] ring-secondary outline-focus-ring transition duration-150 ease-linear ring-inset",
"shrink-0 cursor-pointer rounded-full bg-tertiary ring-[0.5px] ring-secondary outline-focus-ring transition duration-150 ease-linear ring-inset",
isSelected && "bg-brand-solid",
isSelected && isHovered && "bg-brand-solid_hover",
isDisabled && "cursor-not-allowed opacity-50",
Expand Down