@carbon/react
Version:
React components for the Carbon Design System
98 lines (92 loc) • 3.1 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var PropTypes = require('prop-types');
require('react');
require('classnames');
require('../TextInput/ControlledPasswordInput.js');
require('../TextInput/PasswordInput.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
({
/**
* Specify an optional className to be applied to the outer FluidForm wrapper
*/
className: PropTypes__default["default"].string,
/**
* Optionally provide the default value of the `<input>`
*/
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
/**
* Specify whether the `<input>` should be disabled
*/
disabled: PropTypes__default["default"].bool,
/**
* "Hide password" tooltip text on password visibility toggle
*/
hidePasswordLabel: PropTypes__default["default"].string,
/**
* Specify a custom `id` for the `<input>`
*/
id: PropTypes__default["default"].string.isRequired,
/**
* Specify whether the control is currently invalid
*/
invalid: PropTypes__default["default"].bool,
/**
* Provide the text that is displayed when the control is in an invalid state
*/
invalidText: PropTypes__default["default"].node,
/**
* Specify whether the control is a password input
*/
isPassword: PropTypes__default["default"].bool,
/**
* Provide the text that will be read by a screen reader when visiting this
* control
*/
labelText: PropTypes__default["default"].node.isRequired,
/**
* Optionally provide an `onChange` handler that is called whenever `<input>`
* is updated
*/
onChange: PropTypes__default["default"].func,
/**
* Optionally provide an `onClick` handler that is called whenever the
* `<input>` is clicked
*/
onClick: PropTypes__default["default"].func,
/**
* Callback function that is called whenever the toggle password visibility
* button is clicked
*/
onTogglePasswordVisibility: PropTypes__default["default"].func,
/**
* Specify the placeholder attribute for the `<input>`
*/
placeholder: PropTypes__default["default"].string,
/**
* "Show password" tooltip text on password visibility toggle
*/
showPasswordLabel: PropTypes__default["default"].string,
/**
* Specify the value of the `<input>`
*/
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
/**
* Specify whether the control is currently in warning state
*/
warn: PropTypes__default["default"].bool,
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes__default["default"].node,
/**
* Whether or not the component is readonly
*/
readOnly: PropTypes__default["default"].bool
});