UNPKG

aws-northstar

Version:
58 lines (54 loc) 2.56 kB
/** ******************************************************************************************************************* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. * ******************************************************************************************************************** */ import { FunctionComponent } from 'react'; import { SwitchProps } from '@material-ui/core/Switch'; /** * Toggle props */ export interface ToggleProps { /** Specifies whether the component is checked */ checked?: boolean; /** Specifies that the input should be disabled, preventing the user from modifying the value */ disabled?: boolean; /** * Id of the internal input. <br/> * Use in conjunction with <a href='/#/Components/FormField'>FormField</a> to relate a label element "for" attribute to this control for better web accessibility.<br/> * See example in FormField for more details.<br/> * It defaults to an automatically generated id if not provided. * */ controlId?: string; /** The name of the control used in HTML forms. */ name?: string; /** Adds aria-labelledby on the native input. */ ariaLabelledby?: string; /** Adds aria-describedby on the native input. */ ariaDescribedby?: string; /** Adds an aria-label to the native input. */ ariaLabel?: string; /** Label for the input. */ label: string; /** Extra description shown below the label. */ description?: string; /** Handler for the change event */ onChange?: (checked: boolean) => void; } /** * A toggle represents a switch that allows the user to turn things on or off. * */ declare const mapProps: ({ controlId, ...props }: ToggleProps) => SwitchProps; /** * A toggle represents a switch that allows the user to turn things on or off. * */ declare const Toggle: FunctionComponent<ToggleProps>; export default Toggle; export { mapProps };