changed some color, fixed tip tap editor
This commit is contained in:
@@ -177,7 +177,7 @@ function ToggleColumnsDropdown({
|
||||
id={`col-toggle-${col.id}`}
|
||||
checked={isVisible(col.id)}
|
||||
onChange={() => toggle(col.id)}
|
||||
className="w-4 h-4 rounded cursor-pointer accent-primary"
|
||||
className="w-4 h-4 rounded cursor-pointer accent-[#005f78] dark:accent-primary"
|
||||
/>
|
||||
<label
|
||||
htmlFor={`col-toggle-${col.id}`}
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
import { type LucideIcon, ChevronRight, Check, AlertTriangle } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import type { StepStatus } from './stepBar'
|
||||
import {
|
||||
type LucideIcon,
|
||||
ChevronRight,
|
||||
Check,
|
||||
AlertTriangle,
|
||||
} from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { StepStatus } from "./stepBar";
|
||||
|
||||
export interface StepCardItem {
|
||||
id: string
|
||||
title: string
|
||||
subtitle: string
|
||||
icon: LucideIcon
|
||||
status: StepStatus
|
||||
id: string;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
icon: LucideIcon;
|
||||
status: StepStatus;
|
||||
}
|
||||
|
||||
interface StepBarCardsProps {
|
||||
steps: StepCardItem[]
|
||||
onGoTo: (index: number) => void
|
||||
steps: StepCardItem[];
|
||||
onGoTo: (index: number) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card-style horizontal step bar (icon + title + subtitle, chevron separators).
|
||||
* Inspired by the reference mockup. Uses semantic tokens only.
|
||||
*/
|
||||
export function StepBarCards({ steps, onGoTo }: StepBarCardsProps) {
|
||||
return (
|
||||
<nav
|
||||
role="tablist"
|
||||
aria-label="Form adımları"
|
||||
className={cn(
|
||||
'flex items-center gap-2 overflow-x-auto',
|
||||
'[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]',
|
||||
"flex items-center gap-2 overflow-x-auto",
|
||||
"[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
|
||||
)}
|
||||
>
|
||||
{steps.map((step, i) => {
|
||||
const Icon = step.icon
|
||||
const isActive = step.status === 'active'
|
||||
const isDone = step.status === 'done'
|
||||
const isError = step.status === 'error'
|
||||
const isIdle = step.status === 'idle'
|
||||
const reachable = !isIdle || (i > 0 && steps[i - 1].status === 'done')
|
||||
const Icon = step.icon;
|
||||
const isActive = step.status === "active";
|
||||
const isDone = step.status === "done";
|
||||
const isError = step.status === "error";
|
||||
const isIdle = step.status === "idle";
|
||||
const reachable = !isIdle || (i > 0 && steps[i - 1].status === "done");
|
||||
|
||||
return (
|
||||
<div key={step.id} className="flex items-center gap-2 shrink-0">
|
||||
@@ -43,33 +44,36 @@ export function StepBarCards({ steps, onGoTo }: StepBarCardsProps) {
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={isActive}
|
||||
aria-current={isActive ? 'step' : undefined}
|
||||
aria-current={isActive ? "step" : undefined}
|
||||
disabled={!reachable}
|
||||
onClick={() => reachable && onGoTo(i)}
|
||||
className={cn(
|
||||
'group flex items-center gap-3 rounded-2xl px-3 py-2.5 transition-all duration-200',
|
||||
'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-40',
|
||||
reachable && !isActive && 'hover:bg-muted/40 cursor-pointer',
|
||||
isActive && 'bg-muted/60',
|
||||
"group flex items-center gap-3 rounded-lg px-3 py-2.5 transition-all duration-200",
|
||||
"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-40",
|
||||
reachable && !isActive && "hover:bg-muted/40 cursor-pointer",
|
||||
isActive && "bg-muted/60",
|
||||
)}
|
||||
>
|
||||
{/* Icon disc */}
|
||||
<span
|
||||
className={cn(
|
||||
'relative flex items-center justify-center rounded-full w-11 h-11 shrink-0 transition-all duration-300',
|
||||
"relative flex items-center justify-center rounded-full w-11 h-11 shrink-0 transition-all duration-300",
|
||||
isActive &&
|
||||
'bg-primary text-primary-foreground ring-4 ring-primary/15',
|
||||
"bg-[#005f78] text-white ring-4 ring-[#005f78]/15 dark:bg-primary dark:text-primary-foreground dark:ring-primary/15",
|
||||
isDone &&
|
||||
'bg-muted text-foreground',
|
||||
"bg-[#005f78]/10 text-[#005f78] dark:bg-muted dark:text-foreground",
|
||||
isError &&
|
||||
'bg-destructive/10 text-destructive ring-2 ring-destructive/30',
|
||||
isIdle && 'bg-muted text-muted-foreground',
|
||||
reachable && !isActive && 'group-hover:scale-105',
|
||||
"bg-destructive/10 text-destructive ring-2 ring-destructive/30",
|
||||
isIdle && "bg-muted text-muted-foreground",
|
||||
reachable && !isActive && "group-hover:scale-105",
|
||||
)}
|
||||
>
|
||||
{isDone ? (
|
||||
<Check className="w-5 h-5 animate-scale-in" strokeWidth={2.5} />
|
||||
<Check
|
||||
className="w-5 h-5 animate-scale-in"
|
||||
strokeWidth={2.5}
|
||||
/>
|
||||
) : isError ? (
|
||||
<AlertTriangle className="w-5 h-5 animate-scale-in" />
|
||||
) : (
|
||||
@@ -81,9 +85,11 @@ export function StepBarCards({ steps, onGoTo }: StepBarCardsProps) {
|
||||
<span className="flex flex-col items-start text-left leading-tight">
|
||||
<span
|
||||
className={cn(
|
||||
'text-sm font-semibold tracking-tight',
|
||||
isActive || isDone ? 'text-foreground' : 'text-foreground/90',
|
||||
isError && 'text-destructive',
|
||||
"text-sm font-semibold tracking-tight",
|
||||
isActive && "text-[#005f78] dark:text-foreground",
|
||||
isDone && "text-[#005f78] dark:text-foreground",
|
||||
!isActive && !isDone && !isError && "text-foreground/90",
|
||||
isError && "text-destructive",
|
||||
)}
|
||||
>
|
||||
{step.title}
|
||||
@@ -102,8 +108,8 @@ export function StepBarCards({ steps, onGoTo }: StepBarCardsProps) {
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ function Checkbox({
|
||||
<CheckboxPrimitive.Root
|
||||
data-slot="checkbox"
|
||||
className={cn(
|
||||
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
||||
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-[#005f78] data-checked:bg-[#005f78] data-checked:text-white dark:data-checked:border-primary dark:data-checked:bg-primary dark:data-checked:text-primary-foreground",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -21,11 +21,10 @@ function Checkbox({
|
||||
data-slot="checkbox-indicator"
|
||||
className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
|
||||
>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</CheckboxPrimitive.Indicator>
|
||||
</CheckboxPrimitive.Root>
|
||||
)
|
||||
}
|
||||
|
||||
export { Checkbox }
|
||||
export { Checkbox }
|
||||
Reference in New Issue
Block a user