feat: Upgrade toggle shad component and switch UI styles
- Improved the scaling effect for the toggle shad component. - Removed unused switch styles CSS file. - Updated the switch UI component to have improved color styles for checked and unchecked states.
This commit is contained in:
parent
361e981d0d
commit
17380fa2fb
3 changed files with 2 additions and 10 deletions
|
|
@ -37,7 +37,7 @@ export default function ToggleShadComponent({
|
||||||
style={{
|
style={{
|
||||||
transform: `scaleX(${scaleX}) scaleY(${scaleY})`,
|
transform: `scaleX(${scaleX}) scaleY(${scaleY})`,
|
||||||
}}
|
}}
|
||||||
className="data-[state=unchecked]:bg-slate-500"
|
className=""
|
||||||
checked={enabled}
|
checked={enabled}
|
||||||
onCheckedChange={(x: boolean) => {
|
onCheckedChange={(x: boolean) => {
|
||||||
setEnabled(x);
|
setEnabled(x);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
.SwitchRoot[data-state='checked'] {
|
|
||||||
background-color: blue !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.SwitchRoot[data-state='unchecked'] {
|
|
||||||
background-color: red !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -12,7 +12,7 @@ const Switch = React.forwardRef<
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
<SwitchPrimitives.Root
|
<SwitchPrimitives.Root
|
||||||
className={cn(
|
className={cn(
|
||||||
"SwitchRoot peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-ring",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue