UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

51 lines (50 loc) 2.27 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { type CommonProps, type HtmlAttributes } from '../_common/types'; type RadioProps = { /** Whether the radio is checked */ isChecked?: boolean; /** Selects the radio by default in uncontrolled mode */ isDefaultChecked?: boolean; /** Whether the radio is disabled */ isDisabled?: boolean; /** Whether the radio & label should take the full available width of its container */ isFluid?: boolean; /** Whether the label should be displayed before the radio */ hasLeadingLabel?: boolean; /** The callback function triggered when the radio value changes */ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void; /** The value of the radio */ value?: HtmlAttributes<'input'>['value']; /** The callback function triggered when the radio is clicked */ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void; } & ({ /** The aria label of the radio. Required if the label is not a string. */ ariaLabel: string; /** The label of the radio. If not a string, supply an aria label for screen reader support. */ label?: undefined; } | { ariaLabel?: string; label: React.ReactNode; }); export declare const Radio: ({ ariaLabel, isDisabled, isDefaultChecked, label, isFluid, isChecked, hasLeadingLabel, onChange, className, style, onClick, value, htmlAttributes, ref, ...restProps }: CommonProps<"input", RadioProps>) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=Radio.d.ts.map