From 01f4ed60aac4bbba39be9274536e4a8eff1f3952 Mon Sep 17 00:00:00 2001 From: Brendan Dash Date: Thu, 30 Apr 2026 18:27:21 +0800 Subject: [PATCH 1/4] feat(shadcn-ui): migrate from new-york to radix-vega style --- apps/docs/app/global.css | 1 + apps/docs/components.json | 2 +- apps/docs/components/custom/preview.tsx | 2 +- apps/docs/package.json | 2 +- package.json | 2 +- packages/elements/src/model-selector.tsx | 12 +- packages/examples/src/chatbot.tsx | 9 +- packages/examples/src/demo-claude.tsx | 13 +- packages/examples/src/demo-grok.tsx | 13 +- packages/examples/src/model-selector.tsx | 13 +- packages/examples/src/prompt-input-cursor.tsx | 13 +- packages/examples/src/prompt-input.tsx | 14 +- packages/examples/src/queue-prompt-input.tsx | 14 +- packages/shadcn-ui/components.json | 2 +- .../shadcn-ui/components/ui/accordion.tsx | 29 +- .../shadcn-ui/components/ui/alert-dialog.tsx | 92 +++-- packages/shadcn-ui/components/ui/alert.tsx | 20 +- packages/shadcn-ui/components/ui/avatar.tsx | 69 +++- packages/shadcn-ui/components/ui/badge.tsx | 21 +- .../shadcn-ui/components/ui/breadcrumb.tsx | 35 +- .../shadcn-ui/components/ui/button-group.tsx | 14 +- packages/shadcn-ui/components/ui/button.tsx | 37 +- packages/shadcn-ui/components/ui/calendar.tsx | 78 +++-- packages/shadcn-ui/components/ui/card.tsx | 25 +- packages/shadcn-ui/components/ui/carousel.tsx | 15 +- packages/shadcn-ui/components/ui/chart.tsx | 82 +++-- packages/shadcn-ui/components/ui/checkbox.tsx | 9 +- packages/shadcn-ui/components/ui/combobox.tsx | 299 ++++++++++++++++ packages/shadcn-ui/components/ui/command.tsx | 65 ++-- .../shadcn-ui/components/ui/context-menu.tsx | 129 +++---- packages/shadcn-ui/components/ui/dialog.tsx | 52 ++- .../shadcn-ui/components/ui/direction.tsx | 22 ++ packages/shadcn-ui/components/ui/drawer.tsx | 14 +- .../shadcn-ui/components/ui/dropdown-menu.tsx | 58 ++-- packages/shadcn-ui/components/ui/empty.tsx | 18 +- packages/shadcn-ui/components/ui/field.tsx | 44 +-- .../shadcn-ui/components/ui/hover-card.tsx | 2 +- .../shadcn-ui/components/ui/input-group.tsx | 38 +-- .../shadcn-ui/components/ui/input-otp.tsx | 24 +- packages/shadcn-ui/components/ui/input.tsx | 4 +- packages/shadcn-ui/components/ui/item.tsx | 35 +- packages/shadcn-ui/components/ui/kbd.tsx | 4 +- packages/shadcn-ui/components/ui/menubar.tsx | 54 +-- .../shadcn-ui/components/ui/native-select.tsx | 61 ++++ .../components/ui/navigation-menu.tsx | 24 +- .../shadcn-ui/components/ui/pagination.tsx | 68 ++-- packages/shadcn-ui/components/ui/popover.tsx | 45 ++- packages/shadcn-ui/components/ui/progress.tsx | 4 +- .../shadcn-ui/components/ui/radio-group.tsx | 9 +- .../shadcn-ui/components/ui/resizable.tsx | 26 +- .../shadcn-ui/components/ui/scroll-area.tsx | 11 +- packages/shadcn-ui/components/ui/select.tsx | 51 +-- .../shadcn-ui/components/ui/separator.tsx | 2 +- packages/shadcn-ui/components/ui/sheet.tsx | 39 ++- packages/shadcn-ui/components/ui/sidebar.tsx | 124 +++---- packages/shadcn-ui/components/ui/skeleton.tsx | 2 +- packages/shadcn-ui/components/ui/slider.tsx | 12 +- packages/shadcn-ui/components/ui/sonner.tsx | 33 +- packages/shadcn-ui/components/ui/spinner.tsx | 10 +- packages/shadcn-ui/components/ui/switch.tsx | 12 +- packages/shadcn-ui/components/ui/table.tsx | 10 +- packages/shadcn-ui/components/ui/tabs.tsx | 42 ++- packages/shadcn-ui/components/ui/textarea.tsx | 2 +- .../shadcn-ui/components/ui/toggle-group.tsx | 20 +- packages/shadcn-ui/components/ui/toggle.tsx | 18 +- packages/shadcn-ui/components/ui/tooltip.tsx | 12 +- packages/shadcn-ui/package.json | 7 +- pnpm-lock.yaml | 322 ++++++++++++------ 68 files changed, 1622 insertions(+), 844 deletions(-) create mode 100644 packages/shadcn-ui/components/ui/combobox.tsx create mode 100644 packages/shadcn-ui/components/ui/direction.tsx create mode 100644 packages/shadcn-ui/components/ui/native-select.tsx diff --git a/apps/docs/app/global.css b/apps/docs/app/global.css index 9f7c3408..05b168be 100644 --- a/apps/docs/app/global.css +++ b/apps/docs/app/global.css @@ -1,4 +1,5 @@ @import "tailwindcss"; +@import "shadcn/tailwind.css"; @import "./styles/geistdocs.css"; @source "../**/*.{ts,tsx,mdx}"; diff --git a/apps/docs/components.json b/apps/docs/components.json index 3a642555..5bdc1188 100644 --- a/apps/docs/components.json +++ b/apps/docs/components.json @@ -1,6 +1,6 @@ { "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", + "style": "radix-vega", "rsc": true, "tsx": true, "tailwind": { diff --git a/apps/docs/components/custom/preview.tsx b/apps/docs/components/custom/preview.tsx index 6646b0c8..19c14b67 100644 --- a/apps/docs/components/custom/preview.tsx +++ b/apps/docs/components/custom/preview.tsx @@ -59,7 +59,7 @@ export const Preview = async ({ path, className }: ComponentPreviewProps) => { Code - +
diff --git a/apps/docs/package.json b/apps/docs/package.json index 866ade8d..8fad76a4 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -45,7 +45,6 @@ "remark": "^15.0.1", "remark-gfm": "^4.0.1", "remark-mdx": "^3.1.1", - "shadcn": "^3.8.2", "shiki": "3.22.0", "sonner": "^2.0.7", "streamdown": "^2.1.0", @@ -60,6 +59,7 @@ "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", "postcss": "^8.5.6", + "shadcn": "^3.8.2", "tailwindcss": "^4.1.17", "tw-animate-css": "^1.4.0", "typescript": "^5.9.3" diff --git a/package.json b/package.json index 27a32a6b..bbdd883e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "check": "ultracite check", "fix": "ultracite fix", "bump-deps": "npx npm-check-updates --deep -u -x recharts,react-resizable-panels && pnpm install", - "bump-ui": "npx shadcn@latest add --all --overwrite -c packages/shadcn-ui && npx shadcn@latest migrate radix -c packages/shadcn-ui", + "bump-ui": "npx shadcn@latest add --all --overwrite -c packages/shadcn-ui", "changeset": "changeset", "generate-skills": "pnpm --filter @repo/scripts generate-skills" }, diff --git a/packages/elements/src/model-selector.tsx b/packages/elements/src/model-selector.tsx index 25b717bc..a937e369 100644 --- a/packages/elements/src/model-selector.tsx +++ b/packages/elements/src/model-selector.tsx @@ -42,6 +42,7 @@ export const ModelSelectorContent = ({ }: ModelSelectorContentProps) => ( ( ); -export type ModelSelectorItemProps = ComponentProps; +export type ModelSelectorItemProps = ComponentProps & { + checked?: boolean; +}; -export const ModelSelectorItem = (props: ModelSelectorItemProps) => ( - +export const ModelSelectorItem = ({ + checked, + ...props +}: ModelSelectorItemProps) => ( + ); export type ModelSelectorShortcutProps = ComponentProps; diff --git a/packages/examples/src/chatbot.tsx b/packages/examples/src/chatbot.tsx index 82213a69..3780833a 100644 --- a/packages/examples/src/chatbot.tsx +++ b/packages/examples/src/chatbot.tsx @@ -65,7 +65,7 @@ import { import { SpeechInput } from "@repo/elements/speech-input"; import { Suggestion, Suggestions } from "@repo/elements/suggestion"; import type { ToolUIPart } from "ai"; -import { CheckIcon, GlobeIcon } from "lucide-react"; +import { GlobeIcon } from "lucide-react"; import { nanoid } from "nanoid"; import { useCallback, useMemo, useState } from "react"; import { toast } from "sonner"; @@ -416,7 +416,7 @@ const ModelItem = ({ }, [onSelect, m.id]); return ( - + {m.name} @@ -424,11 +424,6 @@ const ModelItem = ({ ))} - {isSelected ? ( - - ) : ( -
- )} ); }; diff --git a/packages/examples/src/demo-claude.tsx b/packages/examples/src/demo-claude.tsx index f0731a79..6068acf8 100644 --- a/packages/examples/src/demo-claude.tsx +++ b/packages/examples/src/demo-claude.tsx @@ -60,7 +60,6 @@ import type { ToolUIPart } from "ai"; import { ArrowUpIcon, CameraIcon, - CheckIcon, FileIcon, ImageIcon, PlusIcon, @@ -328,7 +327,12 @@ interface ModelItemProps { const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { const handleSelect = useCallback(() => onSelect(m.id), [onSelect, m.id]); return ( - + {m.name} @@ -336,11 +340,6 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === m.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/examples/src/demo-grok.tsx b/packages/examples/src/demo-grok.tsx index dcfa51ec..e2d12b15 100644 --- a/packages/examples/src/demo-grok.tsx +++ b/packages/examples/src/demo-grok.tsx @@ -59,7 +59,6 @@ import type { ToolUIPart } from "ai"; import { AudioWaveformIcon, CameraIcon, - CheckIcon, ChevronDownIcon, FileIcon, ImageIcon, @@ -323,7 +322,12 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { const handleSelect = useCallback(() => onSelect(m.id), [onSelect, m.id]); return ( - + {m.name} @@ -331,11 +335,6 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === m.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/examples/src/model-selector.tsx b/packages/examples/src/model-selector.tsx index 2e8ff02f..9f39e55b 100644 --- a/packages/examples/src/model-selector.tsx +++ b/packages/examples/src/model-selector.tsx @@ -14,7 +14,6 @@ import { ModelSelectorTrigger, } from "@repo/elements/model-selector"; import { Button } from "@repo/shadcn-ui/components/ui/button"; -import { CheckIcon } from "lucide-react"; import { memo, useCallback, useState } from "react"; const models = [ @@ -291,7 +290,12 @@ const ModelItem = memo(({ model, selectedModel, onSelect }: ModelItemProps) => { [onSelect, model.id] ); return ( - + {model.name} @@ -299,11 +303,6 @@ const ModelItem = memo(({ model, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === model.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/examples/src/prompt-input-cursor.tsx b/packages/examples/src/prompt-input-cursor.tsx index 663d08f9..dbc1dd20 100644 --- a/packages/examples/src/prompt-input-cursor.tsx +++ b/packages/examples/src/prompt-input-cursor.tsx @@ -53,7 +53,6 @@ import { Button } from "@repo/shadcn-ui/components/ui/button"; import type { SourceDocumentUIPart } from "ai"; import { AtSignIcon, - CheckIcon, FilesIcon, GlobeIcon, ImageIcon, @@ -152,7 +151,12 @@ interface ModelItemProps { const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { const handleSelect = useCallback(() => onSelect(m.id), [onSelect, m.id]); return ( - + {m.name} @@ -160,11 +164,6 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === m.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/examples/src/prompt-input.tsx b/packages/examples/src/prompt-input.tsx index d9411794..296ec0bd 100644 --- a/packages/examples/src/prompt-input.tsx +++ b/packages/examples/src/prompt-input.tsx @@ -36,7 +36,7 @@ import { PromptInputTools, usePromptInputAttachments, } from "@repo/elements/prompt-input"; -import { CheckIcon, GlobeIcon } from "lucide-react"; +import { GlobeIcon } from "lucide-react"; import { memo, useCallback, useState } from "react"; const models = [ @@ -115,7 +115,12 @@ interface ModelItemProps { const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { const handleSelect = useCallback(() => onSelect(m.id), [onSelect, m.id]); return ( - + {m.name} @@ -123,11 +128,6 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === m.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/examples/src/queue-prompt-input.tsx b/packages/examples/src/queue-prompt-input.tsx index dbf35358..a84aaedd 100644 --- a/packages/examples/src/queue-prompt-input.tsx +++ b/packages/examples/src/queue-prompt-input.tsx @@ -47,7 +47,7 @@ import { QueueSection, QueueSectionContent, } from "@repo/elements/queue"; -import { CheckIcon, GlobeIcon, Trash2 } from "lucide-react"; +import { GlobeIcon, Trash2 } from "lucide-react"; import { memo, useCallback, useRef, useState } from "react"; const models = [ @@ -162,7 +162,12 @@ interface ModelItemProps { const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { const handleSelect = useCallback(() => onSelect(m.id), [onSelect, m.id]); return ( - + {m.name} @@ -170,11 +175,6 @@ const ModelItem = memo(({ m, selectedModel, onSelect }: ModelItemProps) => { ))} - {selectedModel === m.id ? ( - - ) : ( -
- )} ); }); diff --git a/packages/shadcn-ui/components.json b/packages/shadcn-ui/components.json index 34a12ea8..5c1e60a8 100644 --- a/packages/shadcn-ui/components.json +++ b/packages/shadcn-ui/components.json @@ -1,6 +1,6 @@ { "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", + "style": "radix-vega", "rsc": true, "tsx": true, "tailwind": { diff --git a/packages/shadcn-ui/components/ui/accordion.tsx b/packages/shadcn-ui/components/ui/accordion.tsx index 76c2d301..3c363198 100644 --- a/packages/shadcn-ui/components/ui/accordion.tsx +++ b/packages/shadcn-ui/components/ui/accordion.tsx @@ -2,14 +2,21 @@ import * as React from "react" import { Accordion as AccordionPrimitive } from "radix-ui" -import { ChevronDownIcon } from "lucide-react" import { cn } from "@repo/shadcn-ui/lib/utils" +import { ChevronDownIcon, ChevronUpIcon } from "lucide-react" function Accordion({ + className, ...props }: React.ComponentProps) { - return + return ( + + ) } function AccordionItem({ @@ -19,7 +26,7 @@ function AccordionItem({ return ( ) @@ -35,13 +42,14 @@ function AccordionTrigger({ svg]:rotate-180", + "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", className )} {...props} > {children} - + + ) @@ -55,10 +63,17 @@ function AccordionContent({ return ( -
{children}
+
+ {children} +
) } diff --git a/packages/shadcn-ui/components/ui/alert-dialog.tsx b/packages/shadcn-ui/components/ui/alert-dialog.tsx index 6e5ec2d6..32214725 100644 --- a/packages/shadcn-ui/components/ui/alert-dialog.tsx +++ b/packages/shadcn-ui/components/ui/alert-dialog.tsx @@ -4,7 +4,7 @@ import * as React from "react" import { AlertDialog as AlertDialogPrimitive } from "radix-ui" import { cn } from "@repo/shadcn-ui/lib/utils" -import { buttonVariants } from "@repo/shadcn-ui/components/ui/button" +import { Button } from "@repo/shadcn-ui/components/ui/button" function AlertDialog({ ...props @@ -36,7 +36,7 @@ function AlertDialogOverlay({ ) { +}: React.ComponentProps & { + size?: "default" | "sm" +}) { return ( ) @@ -84,7 +91,23 @@ function AlertDialogFooter({
+ ) +} + +function AlertDialogMedia({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
) @@ -112,7 +138,10 @@ function AlertDialogDescription({ return ( ) @@ -120,38 +149,51 @@ function AlertDialogDescription({ function AlertDialogAction({ className, + variant = "default", + size = "default", ...props -}: React.ComponentProps) { +}: React.ComponentProps & + Pick, "variant" | "size">) { return ( - + ) } function AlertDialogCancel({ className, + variant = "outline", + size = "default", ...props -}: React.ComponentProps) { +}: React.ComponentProps & + Pick, "variant" | "size">) { return ( - + ) } export { AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, + AlertDialogAction, + AlertDialogCancel, AlertDialogContent, - AlertDialogHeader, + AlertDialogDescription, AlertDialogFooter, + AlertDialogHeader, + AlertDialogMedia, + AlertDialogOverlay, + AlertDialogPortal, AlertDialogTitle, - AlertDialogDescription, - AlertDialogAction, - AlertDialogCancel, + AlertDialogTrigger, } diff --git a/packages/shadcn-ui/components/ui/alert.tsx b/packages/shadcn-ui/components/ui/alert.tsx index cb11ebb3..3a1ed534 100644 --- a/packages/shadcn-ui/components/ui/alert.tsx +++ b/packages/shadcn-ui/components/ui/alert.tsx @@ -4,13 +4,13 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@repo/shadcn-ui/lib/utils" const alertVariants = cva( - "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", + "group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", { variants: { variant: { default: "bg-card text-card-foreground", destructive: - "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90", + "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current", }, }, defaultVariants: { @@ -39,7 +39,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", className )} {...props} @@ -55,7 +55,7 @@ function AlertDescription({
) { + return ( +
+ ) +} + +export { Alert, AlertTitle, AlertDescription, AlertAction } diff --git a/packages/shadcn-ui/components/ui/avatar.tsx b/packages/shadcn-ui/components/ui/avatar.tsx index 5b7126b4..7098d5fd 100644 --- a/packages/shadcn-ui/components/ui/avatar.tsx +++ b/packages/shadcn-ui/components/ui/avatar.tsx @@ -7,13 +7,17 @@ import { cn } from "@repo/shadcn-ui/lib/utils" function Avatar({ className, + size = "default", ...props -}: React.ComponentProps) { +}: React.ComponentProps & { + size?: "default" | "sm" | "lg" +}) { return ( ) @@ -42,7 +49,7 @@ function AvatarFallback({ ) { + return ( + svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...props} + /> + ) +} + +function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AvatarGroupCount({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", + className + )} + {...props} + /> + ) +} + +export { + Avatar, + AvatarImage, + AvatarFallback, + AvatarGroup, + AvatarGroupCount, + AvatarBadge, +} diff --git a/packages/shadcn-ui/components/ui/badge.tsx b/packages/shadcn-ui/components/ui/badge.tsx index b02f598b..72b2aed2 100644 --- a/packages/shadcn-ui/components/ui/badge.tsx +++ b/packages/shadcn-ui/components/ui/badge.tsx @@ -1,22 +1,24 @@ import * as React from "react" -import { Slot as SlotPrimitive } from "radix-ui" import { cva, type VariantProps } from "class-variance-authority" +import { Slot } from "radix-ui" import { cn } from "@repo/shadcn-ui/lib/utils" const badgeVariants = cva( - "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", + "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", { variants: { variant: { - default: - "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90", + default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80", secondary: - "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", + "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80", destructive: - "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", + "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20", outline: - "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", + "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground", + ghost: + "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50", + link: "text-primary underline-offset-4 hover:underline", }, }, defaultVariants: { @@ -27,16 +29,17 @@ const badgeVariants = cva( function Badge({ className, - variant, + variant = "default", asChild = false, ...props }: React.ComponentProps<"span"> & VariantProps & { asChild?: boolean }) { - const Comp = asChild ? SlotPrimitive.Slot : "span" + const Comp = asChild ? Slot.Root : "span" return ( diff --git a/packages/shadcn-ui/components/ui/breadcrumb.tsx b/packages/shadcn-ui/components/ui/breadcrumb.tsx index 7304d982..ddf34342 100644 --- a/packages/shadcn-ui/components/ui/breadcrumb.tsx +++ b/packages/shadcn-ui/components/ui/breadcrumb.tsx @@ -1,11 +1,18 @@ import * as React from "react" -import { Slot as SlotPrimitive } from "radix-ui" -import { ChevronRight, MoreHorizontal } from "lucide-react" +import { Slot } from "radix-ui" import { cn } from "@repo/shadcn-ui/lib/utils" +import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react" -function Breadcrumb({ ...props }: React.ComponentProps<"nav">) { - return