|
1
|
import React from "react" |
|
2
|
import clsx from "clsx" |
|
3
|
|
|
4
|
export type KbdProps = React.ComponentProps<"kbd"> & { |
|
5
|
variant?: "default" | "small" |
|
6
|
} |
|
7
|
|
|
8
|
export const Kbd = ({ |
|
9
|
children, |
|
10
|
className, |
|
11
|
variant = "default", |
|
12
|
...props |
|
13
|
}: KbdProps) => { |
|
14
|
return ( |
|
15
|
<kbd |
|
16
|
className={clsx( |
|
17
|
"rounded-docs_xs border-solid border border-medusa-border-base", |
|
18
|
"inline-flex items-center justify-center", |
|
19
|
"px-docs_0.25", |
|
20
|
"bg-medusa-bg-field", |
|
21
|
"text-medusa-fg-base", |
|
22
|
"font-base shadow-none", |
|
23
|
variant === "small" |
|
24
|
? "text-compact-x-small" |
|
25
|
: "text-compact-x-small-plus", |
|
26
|
className |
|
27
|
)} |
|
28
|
{...props} |
|
29
|
> |
|
30
|
{children} |
|
31
|
</kbd> |
|
32
|
) |
|
33
|
} |