import {JSX, splitProps} from "solid-js"; import classNames from "./classnames"; import {useBootstrapPrefix} from "./ThemeProvider"; import Button, {ButtonProps} from "./Button"; export type ToggleButtonType = "checkbox" | "radio"; export interface ToggleButtonProps extends Omit { type?: ToggleButtonType; name?: string; checked?: boolean; disabled?: boolean; onChange?: JSX.EventHandlerUnion; value: string | string[] | number; inputRef?: (r: HTMLInputElement) => void; } const noop = () => undefined; const ToggleButton = (p: ToggleButtonProps) => { const [local, props] = splitProps(p, [ "bsPrefix", "name", "class", "checked", "type", "onChange", "value", "disabled", "id", "inputRef", ]); const bsPrefix = useBootstrapPrefix(local.bsPrefix, "btn-check"); return ( <>