"use client"; // Adapted from Adobe React Spectrum starters (Apache-2.0). // Modified: owned composition, local runtime, scoped CSS and customization. // See THIRD_PARTY_NOTICES.md. import { CheckboxGroup as PrimitiveCheckboxGroup, Checkbox as PrimitiveCheckbox, type CheckboxGroupProps as AriaProps, type CheckboxProps, Label, Text, FieldError, type ValidationResult, composeRenderProps, } from "./react-aria-runtime.js"; import type { ReactNode } from "react"; export interface AriaCheckboxGroupProps extends Omit { label: string; description?: string; errorMessage?: string | ((validation: ValidationResult) => string); children: ReactNode; } export function AriaCheckboxGroup({ label, description, errorMessage, children, className, ...props }: AriaCheckboxGroupProps) { return ( `ynr-aria-checkbox-group ynr-aria ${value ?? ""}`, )} >
{children}
{description && ( {description} )} {errorMessage}
); } export function AriaCheckboxGroupItem({ className, children, ...props }: CheckboxProps) { return ( `ynr-aria-check ${value ?? ""}`, )} > {composeRenderProps( children, (content, { isSelected, isIndeterminate }) => ( <> {content} ), )} ); }