GHHG10/CodeServer / opencode /packages /ui /src /v2 /components /icon-button-v2.tsx
GHHG10's picture
download
raw
1.23 kB
import { Button as Kobalte } from "@kobalte/core/button"
import { type ComponentProps, splitProps } from "solid-js"
import { JSX } from "solid-js"
import "./icon-button-v2.css"
export interface IconButtonV2Props
extends ComponentProps<typeof Kobalte>,
Pick<ComponentProps<"button">, "class" | "classList"> {
// temporary
icon?: JSX.Element
// icon: IconProps["name"]
size?: "small" | "normal" | "large"
// iconSize?: IconProps["size"]
variant?: "neutral" | "contrast" | "ghost" | "ghost-muted"
state?: "rest" | "hover" | "pressed"
}
export function IconButtonV2(props: ComponentProps<"button"> & IconButtonV2Props) {
const [split, rest] = splitProps(props, ["variant", "size", "iconSize", "class", "classList", "state"])
return (
<Kobalte
{...rest}
data-component="icon-button-v2"
// data-icon={props.icon}
data-size={split.size || "normal"}
data-variant={split.variant || "neutral"}
data-state={split.state}
classList={{
...split.classList,
[split.class ?? ""]: !!split.class,
}}
>
{props.icon}
{/*<Icon name={props.icon} size={split.iconSize ?? (split.size === "large" ? "normal" : "small")} />*/}
</Kobalte>
)
}

Xet Storage Details

Size:
1.23 kB
·
Xet hash:
9cc7bff5d3e6b989920b60f9d0f62676914f97d49e73db35cb00b119ea8a0083

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.