mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-12 00:49:14 +08:00
- Changed utility imports from '@cherrystudio/ui/utils' to '@cherrystudio/ui/lib/utils' across multiple components for better organization. - Introduced a new internal utility module for class name merging, ensuring consistent usage across the UI components. - Updated relevant components to reflect the new import paths, enhancing maintainability and clarity.
23 lines
837 B
TypeScript
23 lines
837 B
TypeScript
import { cn } from '@cherrystudio/ui/lib/utils'
|
|
|
|
function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
|
|
return (
|
|
<kbd
|
|
data-slot="kbd"
|
|
className={cn(
|
|
'bg-primary/10 text-primary pointer-events-none inline-flex w-fit min-w-5 items-center justify-center gap-1 rounded-3xs p-1 font-sans text-xs font-medium select-none',
|
|
"[&_svg:not([class*='size-'])]:size-3",
|
|
'[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10',
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
return <kbd data-slot="kbd-group" className={cn('inline-flex items-center gap-1', className)} {...props} />
|
|
}
|
|
|
|
export { Kbd, KbdGroup }
|