import { RadioGroup as Kobalte } from "@kobalte/core/radio-group" import { Show, splitProps, type JSX } from "solid-js" import type { ComponentProps, ParentProps } from "solid-js" import "./radio-v2.css" export interface RadioGroupV2Props extends ParentProps> { label?: JSX.Element description?: JSX.Element hideLabel?: boolean } export function RadioGroupV2(props: RadioGroupV2Props) { const [local, others] = splitProps(props, ["class", "classList", "children", "label", "description", "hideLabel"]) return ( {(label) => ( {label()} )} {(description) => {description()}}
{local.children}
) } export interface RadioItemV2Props extends ComponentProps { label: JSX.Element description?: JSX.Element hideLabel?: boolean } export function RadioItemV2(props: RadioItemV2Props) { const [local, others] = splitProps(props, ["class", "classList", "label", "description", "hideLabel"]) return (
{local.label} {(description) => {description()}}
) }