mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-03 02:04:31 +10:00
Replace the achromatic shadcn palette with the Desk & Paper tokens (warm neutrals, one moss accent, danger, warn and info), exposed to Tailwind under their spec names; the previous names resolve to the new tokens until every screen is rebuilt. Hard-coded palette classes become semantic tokens and stage colors follow the spec. Fonts move to Newsreader, Hanken Grotesk and JetBrains Mono. The theme gains a System option that follows the operating system live, applied before first paint, and Base UI now receives the locale's direction. Primitives follow the component spec: button variants primary, secondary, ghost, danger and link with a loading state, accent focus rings on inputs, SwitchRow, semantic badges, segmented and underline tabs, restyled menus, dialogs, sheets, tooltips and command bar, and a single bottom-center toast with an Undo action. New: IconButton, SegmentedControl, RadioGroup and NativeSelect.
94 lines
2.5 KiB
TypeScript
94 lines
2.5 KiB
TypeScript
import type { VariantProps } from "class-variance-authority";
|
|
import type * as React from "react";
|
|
import { cva } from "class-variance-authority";
|
|
import { cn } from "@reactive-resume/utils/style";
|
|
|
|
function Empty({ className, ...props }: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
data-slot="empty"
|
|
className={cn(
|
|
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-5 text-balance rounded-xl p-6 text-center",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
return (
|
|
<div data-slot="empty-header" className={cn("flex max-w-sm flex-col items-center gap-2", className)} {...props} />
|
|
);
|
|
}
|
|
|
|
const emptyMediaVariants = cva(
|
|
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default: "bg-transparent",
|
|
icon: "flex size-10 shrink-0 items-center justify-center rounded-full bg-sunken text-ink-2 [&_svg:not([class*='size-'])]:size-5",
|
|
success: "flex size-10 shrink-0 items-center justify-center rounded-full bg-accent-soft text-accent-text",
|
|
error: "flex size-10 shrink-0 items-center justify-center rounded-full bg-danger-soft text-danger-text",
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: "default",
|
|
},
|
|
},
|
|
);
|
|
|
|
function EmptyMedia({
|
|
className,
|
|
variant = "default",
|
|
...props
|
|
}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
|
|
return (
|
|
<div
|
|
data-slot="empty-icon"
|
|
data-variant={variant}
|
|
className={cn(emptyMediaVariants({ variant, className }))}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
data-slot="empty-title"
|
|
className={cn("font-display font-medium text-[22px] text-ink leading-7", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
return (
|
|
<div
|
|
data-slot="empty-description"
|
|
className={cn(
|
|
"max-w-[300px] text-ink-2 text-sm leading-5 [&>a]:text-accent-text [&>a]:underline [&>a]:underline-offset-4",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
data-slot="empty-content"
|
|
className={cn(
|
|
"flex w-full min-w-0 max-w-sm flex-wrap items-center justify-center gap-2 text-balance text-sm",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|