|
1
|
import * as React from "react" |
|
2
|
|
|
3
|
import { clx } from "@/utils/clx" |
|
4
|
|
|
5
|
/** |
|
6
|
* This component is based on the `kbd` element and supports all of its props |
|
7
|
*/ |
|
8
|
const Kbd = React.forwardRef< |
|
9
|
HTMLElement, |
|
10
|
React.ComponentPropsWithoutRef<"kbd"> |
|
11
|
>(({ children, className, ...props }, ref) => { |
|
12
|
return ( |
|
13
|
<kbd |
|
14
|
{...props} |
|
15
|
ref={ref} |
|
16
|
className={clx( |
|
17
|
"bg-ui-tag-neutral-bg text-ui-tag-neutral-text border-ui-tag-neutral-border inline-flex h-5 w-fit min-w-[20px] items-center justify-center rounded-md border px-1", |
|
18
|
"txt-compact-xsmall-plus", |
|
19
|
className |
|
20
|
)} |
|
21
|
> |
|
22
|
{children} |
|
23
|
</kbd> |
|
24
|
) |
|
25
|
}) |
|
26
|
Kbd.displayName = "Kbd" |
|
27
|
|
|
28
|
export { Kbd } |