Download wp-calypso/client/components/forms/form-tel-input/index.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 602 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-tel-input/index.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/forms/form-tel-input/index.jsx
-
curl -L -o index.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-tel-input/index.jsx
602 Bytes
| import clsx from 'clsx'; | |
| import PropTypes from 'prop-types'; | |
| import FormTextInput from 'calypso/components/forms/form-text-input'; | |
| export default function FormTelInput( { className, isError, isValid, ...props } ) { | |
| const classes = clsx( 'form-tel-input', className, { | |
| 'is-error': isError, | |
| 'is-valid': isValid, | |
| } ); | |
| return <FormTextInput pattern="[0-9\-() +]*" { ...props } type="tel" className={ classes } />; | |
| } | |
| FormTelInput.propTypes = { | |
| className: PropTypes.string, | |
| isError: PropTypes.bool, | |
| isValid: PropTypes.bool, | |
| }; | |
| FormTelInput.defaultProps = { | |
| isError: false, | |
| isValid: false, | |
| }; | |