Skip to content
2 changes: 1 addition & 1 deletion interface/src/components/ChannelSettingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
DialogTitle,
DialogFooter,
} from "@spacedrive/primitives";
import {Switch} from "@spacedrive/primitives";
import {Toggle as Switch} from "@/ui/Toggle";
import {PlatformIcon} from "@/lib/platformIcons";
import {
isValidE164,
Expand Down
2 changes: 1 addition & 1 deletion interface/src/components/PromptInspectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
DialogHeader,
DialogTitle,
} from "@spacedrive/primitives";
import {Switch} from "@spacedrive/primitives";
import {Toggle as Switch} from "@/ui/Toggle";

interface PromptInspectModalProps {
open: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
SelectValue,
SelectContent,
SelectItem,
Switch,
} from "@spacedrive/primitives";
import {Toggle as Switch} from "@/ui/Toggle";
import {ModelSelect} from "@/components/ModelSelect";
import {TagInput} from "@/components/TagInput";
import {supportsAdaptiveThinking} from "./utils";
Expand Down
3 changes: 2 additions & 1 deletion interface/src/components/settings/ServerSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {useState, useEffect} from "react";
import {useMutation, useQueryClient} from "@tanstack/react-query";
import {api} from "@/api/client";
import {Button, Input, Switch} from "@spacedrive/primitives";
import {Button, Input} from "@spacedrive/primitives";
import {Toggle as Switch} from "@/ui/Toggle";
import type {GlobalSettingsSectionProps} from "./types";

export function ServerSection({settings, isLoading}: GlobalSettingsSectionProps) {
Expand Down
2 changes: 1 addition & 1 deletion interface/src/routes/AgentCron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
SelectContent,
SelectItem,
} from "@spacedrive/primitives";
import {Switch} from "@spacedrive/primitives";
import {Toggle as Switch} from "@/ui/Toggle";

// -- Helpers --

Expand Down
18 changes: 18 additions & 0 deletions interface/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,21 @@ body {
width: auto !important;
box-shadow: none !important;
}


/* Tailwind v4 workaround: state-variant class selectors (data-[state=checked]:* and aria-checked:*)
don't match at runtime in this build. Radix v1.x sets aria-checked on the root, so use it
directly via an attribute selector. The bg-app-dark-box class is on the Toggle root; the
bg-white shadow-sm combination is unique to the Toggle thumb. */
button[aria-checked="true"].bg-app-dark-box {
background-color: var(--color-accent) !important;
}
button[aria-checked="true"].w-7 > .bg-white.shadow-sm {
transform: translateX(12px) !important;
}
button[aria-checked="true"].w-9 > .bg-white.shadow-sm {
transform: translateX(16px) !important;
}
button[aria-checked="true"].w-11 > .bg-white.shadow-sm {
transform: translateX(20px) !important;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
8 changes: 4 additions & 4 deletions interface/src/ui/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const switchStyles = cva(
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full transition-colors",
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",
"disabled:cursor-not-allowed disabled:opacity-50",
"data-[state=checked]:bg-accent data-[state=unchecked]:bg-app-dark-box",
"aria-checked:bg-accent bg-app-dark-box",
],
{
variants: {
Expand All @@ -30,9 +30,9 @@ const thumbStyles = cva(
{
variants: {
size: {
sm: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0",
md: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
lg: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
sm: "h-3 w-3 aria-checked:translate-x-3 translate-x-0",
md: "h-4 w-4 aria-checked:translate-x-4 translate-x-0",
lg: "h-5 w-5 aria-checked:translate-x-5 translate-x-0",
},
},
defaultVariants: {
Expand Down
Loading