/* Copyright 2026 Marimo. All rights reserved. */ import type { Checkbox as CheckboxPrimitive } from "radix-ui"; type CheckedState = CheckboxPrimitive.CheckedState; import { type JSX, useId } from "react"; import { z } from "zod"; import { Checkbox } from "../../components/ui/checkbox"; import type { IPlugin, IPluginProps } from "../types"; import { Labeled } from "./common/labeled"; type T = boolean; interface Data { label: string | null; disabled?: boolean; } export class CheckboxPlugin implements IPlugin { tagName = "marimo-checkbox"; validator = z.object({ initialValue: z.boolean(), label: z.string().nullable(), disabled: z.boolean().optional(), }); render(props: IPluginProps): JSX.Element { return ; } } const CheckboxComponent = ({ value, setValue, data, }: IPluginProps): JSX.Element => { const onClick = (newValue: CheckedState) => { // unsupported state if (newValue === "indeterminate") { return; } setValue(newValue); }; const id = useId(); return ( ); };