UNPKG

@carbon/react

Version:

React components for the Carbon Design System

54 lines (52 loc) 1.77 kB
/** * Copyright IBM Corp. 2016, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { usePrefix } from "../../internal/usePrefix.js"; import { FormContext } from "../FluidForm/FormContext.js"; import PasswordInput from "../TextInput/PasswordInput.js"; import classNames from "classnames"; import "react"; import PropTypes from "prop-types"; import { jsx } from "react/jsx-runtime"; //#region src/components/FluidTextInput/FluidPasswordInput.tsx /** * Copyright IBM Corp. 2016, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ const FluidPasswordInput = ({ className, ...other }) => { const classNames$1 = classNames(className, `${usePrefix()}--text-input--fluid`); return /* @__PURE__ */ jsx(FormContext.Provider, { value: { isFluid: true }, children: /* @__PURE__ */ jsx(PasswordInput, { className: classNames$1, ...other }) }); }; FluidPasswordInput.propTypes = { className: PropTypes.string, defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), disabled: PropTypes.bool, hidePasswordLabel: PropTypes.string, id: PropTypes.string.isRequired, invalid: PropTypes.bool, invalidText: PropTypes.node, isPassword: PropTypes.bool, labelText: PropTypes.node.isRequired, onChange: PropTypes.func, onClick: PropTypes.func, onTogglePasswordVisibility: PropTypes.func, placeholder: PropTypes.string, showPasswordLabel: PropTypes.string, value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), warn: PropTypes.bool, warnText: PropTypes.node, readOnly: PropTypes.bool }; //#endregion export { FluidPasswordInput as default };