summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/ui/icon-button.tsx
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-10-03 09:04:28 -0500
committerAdam <[email protected]>2025-10-03 09:04:28 -0500
commit3fa280d21878ae391674a21758199df3d2d8c3b5 (patch)
treef70c6ecafffeecc8e7a59dc9acef66c59a9ea54a /packages/app/src/ui/icon-button.tsx
parent1d58b5548287a3e32ffce3abdcf0f2db08fdb155 (diff)
downloadopencode-3fa280d21878ae391674a21758199df3d2d8c3b5.tar.gz
opencode-3fa280d21878ae391674a21758199df3d2d8c3b5.zip
chore: app -> desktop
Diffstat (limited to 'packages/app/src/ui/icon-button.tsx')
-rw-r--r--packages/app/src/ui/icon-button.tsx38
1 files changed, 0 insertions, 38 deletions
diff --git a/packages/app/src/ui/icon-button.tsx b/packages/app/src/ui/icon-button.tsx
deleted file mode 100644
index 7e9e3e6e2..000000000
--- a/packages/app/src/ui/icon-button.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Button as KobalteButton } from "@kobalte/core/button"
-import { splitProps } from "solid-js"
-import type { ComponentProps, JSX } from "solid-js"
-
-export interface IconButtonProps extends ComponentProps<typeof KobalteButton> {
- variant?: "primary" | "secondary" | "outline" | "ghost"
- size?: "xs" | "sm" | "md" | "lg"
- children: JSX.Element
-}
-
-export function IconButton(props: IconButtonProps) {
- const [local, others] = splitProps(props, ["variant", "size", "class", "classList"])
- return (
- <KobalteButton
- classList={{
- ...(local.classList || {}),
- "inline-flex items-center justify-center rounded-md font-medium cursor-pointer": true,
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2": true,
- "disabled:pointer-events-none disabled:opacity-50": true,
- "bg-primary text-background hover:bg-secondary focus-visible:ring-primary data-[disabled]:opacity-50":
- (local.variant || "primary") === "primary",
- "bg-background-panel text-text hover:bg-background-element focus-visible:ring-secondary data-[disabled]:opacity-50":
- local.variant === "secondary",
- "border border-border bg-transparent text-text hover:bg-background-panel": local.variant === "outline",
- "focus-visible:ring-border-active data-[disabled]:border-border-subtle data-[disabled]:text-text-muted":
- local.variant === "outline",
- "text-text hover:bg-background-panel focus-visible:ring-border-active data-[disabled]:text-text-muted":
- local.variant === "ghost",
- "h-5 w-5 text-xs": local.size === "xs",
- "h-8 w-8 text-sm": local.size === "sm",
- "h-10 w-10 text-sm": (local.size || "md") === "md",
- "h-12 w-12 text-base": local.size === "lg",
- [local.class ?? ""]: !!local.class,
- }}
- {...others}
- />
- )
-}