aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
145 lines • 3.35 kB
TypeScript
import React from "react";
export interface RadioOption {
value: string | number;
label: string;
description?: string;
disabled?: boolean;
icon?: React.ReactNode;
}
export interface GlassRadioGroupProps {
/**
* Radio options
*/
options?: RadioOption[];
/**
* Selected value
*/
value?: string | number;
/**
* Default selected value
*/
defaultValue?: string | number;
/**
* Callback when value changes
*/
onValueChange?: (value: string | number) => void;
/**
* Group name (for form compatibility)
*/
name?: string;
/**
* Whether radio group is disabled
*/
disabled?: boolean;
/**
* Radio group orientation
*/
orientation?: "vertical" | "horizontal";
/**
* Size variant
*/
size?: "sm" | "md" | "lg";
/**
* Custom className
*/
className?: string;
/**
* Whether to show as card-style radios
*/
variant?: "default" | "card";
/**
* Custom render function for options
*/
renderOption?: (option: RadioOption, isSelected: boolean) => React.ReactNode;
/**
* Label for the radio group
*/
label?: string;
/**
* Description text for the radio group
*/
description?: string;
/**
* Error message
*/
error?: string;
/**
* Whether the radio group is required
*/
required?: boolean;
/**
* Respect user's motion preferences
*/
respectMotionPreference?: boolean;
/**
* ID of element that labels the radio group
*/
"aria-labelledby"?: string;
/**
* ID of element(s) that describe the radio group
*/
"aria-describedby"?: string;
/**
* Additional aria attributes
*/
"aria-label"?: string;
/**
* Test ID for testing
*/
"data-testid"?: string;
}
export interface GlassRadioGroupItemProps {
/**
* Radio option
*/
option: RadioOption;
/**
* Whether this item is selected
*/
isSelected: boolean;
/**
* Whether this item is disabled
*/
isDisabled: boolean;
/**
* Callback when item is selected
*/
onSelect: (value: string | number) => void;
/**
* Item size
*/
size?: "sm" | "md" | "lg";
/**
* Item variant
*/
variant?: "default" | "card";
/**
* Group name
*/
name?: string;
/**
* Custom className
*/
className?: string;
/**
* Respect motion preferences
*/
respectMotionPreference?: boolean;
}
/**
* GlassRadioGroup component
* A glassmorphism radio button group
*/
export declare const GlassRadioGroup: React.ForwardRefExoticComponent<GlassRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
export declare const GlassRadioGroupItem: React.ForwardRefExoticComponent<GlassRadioGroupItemProps & {
renderOption?: GlassRadioGroupProps["renderOption"];
} & React.RefAttributes<HTMLDivElement>>;
/**
* Hook for managing radio group state
*/
export declare const useRadioGroup: (initialValue?: string | number) => {
value: string | number;
setValue: React.Dispatch<React.SetStateAction<string | number>>;
onValueChange: React.Dispatch<React.SetStateAction<string | number>>;
};
//# sourceMappingURL=GlassRadioGroup.d.ts.map