summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src/components')
-rw-r--r--packages/ui/src/components/keybind.css18
-rw-r--r--packages/ui/src/components/keybind.tsx20
2 files changed, 38 insertions, 0 deletions
diff --git a/packages/ui/src/components/keybind.css b/packages/ui/src/components/keybind.css
new file mode 100644
index 000000000..1a9e5dce4
--- /dev/null
+++ b/packages/ui/src/components/keybind.css
@@ -0,0 +1,18 @@
+[data-component="keybind"] {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ height: 20px;
+ padding: 0 8px;
+ border-radius: 2px;
+ background: var(--surface-base);
+ box-shadow: var(--shadow-xxs-border);
+
+ /* text-12-medium */
+ font-family: var(--font-family-sans);
+ font-size: 12px;
+ font-weight: var(--font-weight-medium);
+ line-height: 1;
+ color: var(--text-weak);
+}
diff --git a/packages/ui/src/components/keybind.tsx b/packages/ui/src/components/keybind.tsx
new file mode 100644
index 000000000..a0fa0483f
--- /dev/null
+++ b/packages/ui/src/components/keybind.tsx
@@ -0,0 +1,20 @@
+import type { ComponentProps, ParentProps } from "solid-js"
+
+export interface KeybindProps extends ParentProps {
+ class?: string
+ classList?: ComponentProps<"span">["classList"]
+}
+
+export function Keybind(props: KeybindProps) {
+ return (
+ <span
+ data-component="keybind"
+ classList={{
+ ...(props.classList ?? {}),
+ [props.class ?? ""]: !!props.class,
+ }}
+ >
+ {props.children}
+ </span>
+ )
+}