UNPKG

24.4 kBJavaScriptView Raw
1'use client';
2
3import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
4var _InputGlobalStyles;
5import * as React from 'react';
6import PropTypes from 'prop-types';
7import clsx from 'clsx';
8import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
9import refType from '@mui/utils/refType';
10import composeClasses from '@mui/utils/composeClasses';
11import TextareaAutosize from "../TextareaAutosize/index.js";
12import isHostComponent from "../utils/isHostComponent.js";
13import formControlState from "../FormControl/formControlState.js";
14import FormControlContext from "../FormControl/FormControlContext.js";
15import useFormControl from "../FormControl/useFormControl.js";
16import { styled, globalCss } from "../zero-styled/index.js";
17import memoTheme from "../utils/memoTheme.js";
18import { useDefaultProps } from "../DefaultPropsProvider/index.js";
19import capitalize from "../utils/capitalize.js";
20import useForkRef from "../utils/useForkRef.js";
21import useEnhancedEffect from "../utils/useEnhancedEffect.js";
22import { isFilled } from "./utils.js";
23import inputBaseClasses, { getInputBaseUtilityClass } from "./inputBaseClasses.js";
24import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25export const rootOverridesResolver = (props, styles) => {
26 const {
27 ownerState
28 } = props;
29 return [styles.root, ownerState.formControl && styles.formControl, ownerState.startAdornment && styles.adornedStart, ownerState.endAdornment && styles.adornedEnd, ownerState.error && styles.error, ownerState.size === 'small' && styles.sizeSmall, ownerState.multiline && styles.multiline, ownerState.color && styles[`color${capitalize(ownerState.color)}`], ownerState.fullWidth && styles.fullWidth, ownerState.hiddenLabel && styles.hiddenLabel];
30};
31export const inputOverridesResolver = (props, styles) => {
32 const {
33 ownerState
34 } = props;
35 return [styles.input, ownerState.size === 'small' && styles.inputSizeSmall, ownerState.multiline && styles.inputMultiline, ownerState.type === 'search' && styles.inputTypeSearch, ownerState.startAdornment && styles.inputAdornedStart, ownerState.endAdornment && styles.inputAdornedEnd, ownerState.hiddenLabel && styles.inputHiddenLabel];
36};
37const useUtilityClasses = ownerState => {
38 const {
39 classes,
40 color,
41 disabled,
42 error,
43 endAdornment,
44 focused,
45 formControl,
46 fullWidth,
47 hiddenLabel,
48 multiline,
49 readOnly,
50 size,
51 startAdornment,
52 type
53 } = ownerState;
54 const slots = {
55 root: ['root', `color${capitalize(color)}`, disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', focused && 'focused', formControl && 'formControl', size && size !== 'medium' && `size${capitalize(size)}`, multiline && 'multiline', startAdornment && 'adornedStart', endAdornment && 'adornedEnd', hiddenLabel && 'hiddenLabel', readOnly && 'readOnly'],
56 input: ['input', disabled && 'disabled', type === 'search' && 'inputTypeSearch', multiline && 'inputMultiline', size === 'small' && 'inputSizeSmall', hiddenLabel && 'inputHiddenLabel', startAdornment && 'inputAdornedStart', endAdornment && 'inputAdornedEnd', readOnly && 'readOnly']
57 };
58 return composeClasses(slots, getInputBaseUtilityClass, classes);
59};
60export const InputBaseRoot = styled('div', {
61 name: 'MuiInputBase',
62 slot: 'Root',
63 overridesResolver: rootOverridesResolver
64})(memoTheme(({
65 theme
66}) => ({
67 ...theme.typography.body1,
68 color: (theme.vars || theme).palette.text.primary,
69 lineHeight: '1.4375em',
70 // 23px
71 boxSizing: 'border-box',
72 // Prevent padding issue with fullWidth.
73 position: 'relative',
74 cursor: 'text',
75 display: 'inline-flex',
76 alignItems: 'center',
77 [`&.${inputBaseClasses.disabled}`]: {
78 color: (theme.vars || theme).palette.text.disabled,
79 cursor: 'default'
80 },
81 variants: [{
82 props: ({
83 ownerState
84 }) => ownerState.multiline,
85 style: {
86 padding: '4px 0 5px'
87 }
88 }, {
89 props: ({
90 ownerState,
91 size
92 }) => ownerState.multiline && size === 'small',
93 style: {
94 paddingTop: 1
95 }
96 }, {
97 props: ({
98 ownerState
99 }) => ownerState.fullWidth,
100 style: {
101 width: '100%'
102 }
103 }]
104})));
105export const InputBaseInput = styled('input', {
106 name: 'MuiInputBase',
107 slot: 'Input',
108 overridesResolver: inputOverridesResolver
109})(memoTheme(({
110 theme
111}) => {
112 const light = theme.palette.mode === 'light';
113 const placeholder = {
114 color: 'currentColor',
115 ...(theme.vars ? {
116 opacity: theme.vars.opacity.inputPlaceholder
117 } : {
118 opacity: light ? 0.42 : 0.5
119 }),
120 transition: theme.transitions.create('opacity', {
121 duration: theme.transitions.duration.shorter
122 })
123 };
124 const placeholderHidden = {
125 opacity: '0 !important'
126 };
127 const placeholderVisible = theme.vars ? {
128 opacity: theme.vars.opacity.inputPlaceholder
129 } : {
130 opacity: light ? 0.42 : 0.5
131 };
132 return {
133 font: 'inherit',
134 letterSpacing: 'inherit',
135 color: 'currentColor',
136 padding: '4px 0 5px',
137 border: 0,
138 boxSizing: 'content-box',
139 background: 'none',
140 height: '1.4375em',
141 // Reset 23pxthe native input line-height
142 margin: 0,
143 // Reset for Safari
144 WebkitTapHighlightColor: 'transparent',
145 display: 'block',
146 // Make the flex item shrink with Firefox
147 minWidth: 0,
148 width: '100%',
149 '&::-webkit-input-placeholder': placeholder,
150 '&::-moz-placeholder': placeholder,
151 // Firefox 19+
152 '&::-ms-input-placeholder': placeholder,
153 // Edge
154 '&:focus': {
155 outline: 0
156 },
157 // Reset Firefox invalid required input style
158 '&:invalid': {
159 boxShadow: 'none'
160 },
161 '&::-webkit-search-decoration': {
162 // Remove the padding when type=search.
163 WebkitAppearance: 'none'
164 },
165 // Show and hide the placeholder logic
166 [`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]: {
167 '&::-webkit-input-placeholder': placeholderHidden,
168 '&::-moz-placeholder': placeholderHidden,
169 // Firefox 19+
170 '&::-ms-input-placeholder': placeholderHidden,
171 // Edge
172 '&:focus::-webkit-input-placeholder': placeholderVisible,
173 '&:focus::-moz-placeholder': placeholderVisible,
174 // Firefox 19+
175 '&:focus::-ms-input-placeholder': placeholderVisible // Edge
176 },
177 [`&.${inputBaseClasses.disabled}`]: {
178 opacity: 1,
179 // Reset iOS opacity
180 WebkitTextFillColor: (theme.vars || theme).palette.text.disabled // Fix opacity Safari bug
181 },
182 variants: [{
183 props: ({
184 ownerState
185 }) => !ownerState.disableInjectingGlobalStyles,
186 style: {
187 animationName: 'mui-auto-fill-cancel',
188 animationDuration: '10ms',
189 '&:-webkit-autofill': {
190 animationDuration: '5000s',
191 animationName: 'mui-auto-fill'
192 }
193 }
194 }, {
195 props: {
196 size: 'small'
197 },
198 style: {
199 paddingTop: 1
200 }
201 }, {
202 props: ({
203 ownerState
204 }) => ownerState.multiline,
205 style: {
206 height: 'auto',
207 resize: 'none',
208 padding: 0,
209 paddingTop: 0
210 }
211 }, {
212 props: {
213 type: 'search'
214 },
215 style: {
216 MozAppearance: 'textfield' // Improve type search style.
217 }
218 }]
219 };
220}));
221const InputGlobalStyles = globalCss({
222 '@keyframes mui-auto-fill': {
223 from: {
224 display: 'block'
225 }
226 },
227 '@keyframes mui-auto-fill-cancel': {
228 from: {
229 display: 'block'
230 }
231 }
232});
233
234/**
235 * `InputBase` contains as few styles as possible.
236 * It aims to be a simple building block for creating an input.
237 * It contains a load of style reset and some state logic.
238 */
239const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
240 const props = useDefaultProps({
241 props: inProps,
242 name: 'MuiInputBase'
243 });
244 const {
245 'aria-describedby': ariaDescribedby,
246 autoComplete,
247 autoFocus,
248 className,
249 color,
250 components = {},
251 componentsProps = {},
252 defaultValue,
253 disabled,
254 disableInjectingGlobalStyles,
255 endAdornment,
256 error,
257 fullWidth = false,
258 id,
259 inputComponent = 'input',
260 inputProps: inputPropsProp = {},
261 inputRef: inputRefProp,
262 margin,
263 maxRows,
264 minRows,
265 multiline = false,
266 name,
267 onBlur,
268 onChange,
269 onClick,
270 onFocus,
271 onKeyDown,
272 onKeyUp,
273 placeholder,
274 readOnly,
275 renderSuffix,
276 rows,
277 size,
278 slotProps = {},
279 slots = {},
280 startAdornment,
281 type = 'text',
282 value: valueProp,
283 ...other
284 } = props;
285 const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
286 const {
287 current: isControlled
288 } = React.useRef(value != null);
289 const inputRef = React.useRef();
290 const handleInputRefWarning = React.useCallback(instance => {
291 if (process.env.NODE_ENV !== 'production') {
292 if (instance && instance.nodeName !== 'INPUT' && !instance.focus) {
293 console.error(['MUI: You have provided a `inputComponent` to the input component', 'that does not correctly handle the `ref` prop.', 'Make sure the `ref` prop is called with a HTMLInputElement.'].join('\n'));
294 }
295 }
296 }, []);
297 const handleInputRef = useForkRef(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
298 const [focused, setFocused] = React.useState(false);
299 const muiFormControl = useFormControl();
300 if (process.env.NODE_ENV !== 'production') {
301 // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
302 // eslint-disable-next-line react-hooks/rules-of-hooks
303 React.useEffect(() => {
304 if (muiFormControl) {
305 return muiFormControl.registerEffect();
306 }
307 return undefined;
308 }, [muiFormControl]);
309 }
310 const fcs = formControlState({
311 props,
312 muiFormControl,
313 states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
314 });
315 fcs.focused = muiFormControl ? muiFormControl.focused : focused;
316
317 // The blur won't fire when the disabled state is set on a focused input.
318 // We need to book keep the focused state manually.
319 React.useEffect(() => {
320 if (!muiFormControl && disabled && focused) {
321 setFocused(false);
322 if (onBlur) {
323 onBlur();
324 }
325 }
326 }, [muiFormControl, disabled, focused, onBlur]);
327 const onFilled = muiFormControl && muiFormControl.onFilled;
328 const onEmpty = muiFormControl && muiFormControl.onEmpty;
329 const checkDirty = React.useCallback(obj => {
330 if (isFilled(obj)) {
331 if (onFilled) {
332 onFilled();
333 }
334 } else if (onEmpty) {
335 onEmpty();
336 }
337 }, [onFilled, onEmpty]);
338 useEnhancedEffect(() => {
339 if (isControlled) {
340 checkDirty({
341 value
342 });
343 }
344 }, [value, checkDirty, isControlled]);
345 const handleFocus = event => {
346 if (onFocus) {
347 onFocus(event);
348 }
349 if (inputPropsProp.onFocus) {
350 inputPropsProp.onFocus(event);
351 }
352 if (muiFormControl && muiFormControl.onFocus) {
353 muiFormControl.onFocus(event);
354 } else {
355 setFocused(true);
356 }
357 };
358 const handleBlur = event => {
359 if (onBlur) {
360 onBlur(event);
361 }
362 if (inputPropsProp.onBlur) {
363 inputPropsProp.onBlur(event);
364 }
365 if (muiFormControl && muiFormControl.onBlur) {
366 muiFormControl.onBlur(event);
367 } else {
368 setFocused(false);
369 }
370 };
371 const handleChange = (event, ...args) => {
372 if (!isControlled) {
373 const element = event.target || inputRef.current;
374 if (element == null) {
375 throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : _formatMuiErrorMessage(1));
376 }
377 checkDirty({
378 value: element.value
379 });
380 }
381 if (inputPropsProp.onChange) {
382 inputPropsProp.onChange(event, ...args);
383 }
384
385 // Perform in the willUpdate
386 if (onChange) {
387 onChange(event, ...args);
388 }
389 };
390
391 // Check the input state on mount, in case it was filled by the user
392 // or auto filled by the browser before the hydration (for SSR).
393 React.useEffect(() => {
394 checkDirty(inputRef.current);
395 // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
396 // eslint-disable-next-line react-hooks/exhaustive-deps
397 }, []);
398 const handleClick = event => {
399 if (inputRef.current && event.currentTarget === event.target) {
400 inputRef.current.focus();
401 }
402 if (onClick) {
403 onClick(event);
404 }
405 };
406 let InputComponent = inputComponent;
407 let inputProps = inputPropsProp;
408 if (multiline && InputComponent === 'input') {
409 if (rows) {
410 if (process.env.NODE_ENV !== 'production') {
411 if (minRows || maxRows) {
412 console.warn('MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set.');
413 }
414 }
415 inputProps = {
416 type: undefined,
417 minRows: rows,
418 maxRows: rows,
419 ...inputProps
420 };
421 } else {
422 inputProps = {
423 type: undefined,
424 maxRows,
425 minRows,
426 ...inputProps
427 };
428 }
429 InputComponent = TextareaAutosize;
430 }
431 const handleAutoFill = event => {
432 // Provide a fake value as Chrome might not let you access it for security reasons.
433 checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
434 value: 'x'
435 });
436 };
437 React.useEffect(() => {
438 if (muiFormControl) {
439 muiFormControl.setAdornedStart(Boolean(startAdornment));
440 }
441 }, [muiFormControl, startAdornment]);
442 const ownerState = {
443 ...props,
444 color: fcs.color || 'primary',
445 disabled: fcs.disabled,
446 endAdornment,
447 error: fcs.error,
448 focused: fcs.focused,
449 formControl: muiFormControl,
450 fullWidth,
451 hiddenLabel: fcs.hiddenLabel,
452 multiline,
453 size: fcs.size,
454 startAdornment,
455 type
456 };
457 const classes = useUtilityClasses(ownerState);
458 const Root = slots.root || components.Root || InputBaseRoot;
459 const rootProps = slotProps.root || componentsProps.root || {};
460 const Input = slots.input || components.Input || InputBaseInput;
461 inputProps = {
462 ...inputProps,
463 ...(slotProps.input ?? componentsProps.input)
464 };
465 return /*#__PURE__*/_jsxs(React.Fragment, {
466 children: [!disableInjectingGlobalStyles && typeof InputGlobalStyles === 'function' && (// For Emotion/Styled-components, InputGlobalStyles will be a function
467 // For Pigment CSS, this has no effect because the InputGlobalStyles will be null.
468 _InputGlobalStyles || (_InputGlobalStyles = /*#__PURE__*/_jsx(InputGlobalStyles, {}))), /*#__PURE__*/_jsxs(Root, {
469 ...rootProps,
470 ref: ref,
471 onClick: handleClick,
472 ...other,
473 ...(!isHostComponent(Root) && {
474 ownerState: {
475 ...ownerState,
476 ...rootProps.ownerState
477 }
478 }),
479 className: clsx(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
480 children: [startAdornment, /*#__PURE__*/_jsx(FormControlContext.Provider, {
481 value: null,
482 children: /*#__PURE__*/_jsx(Input, {
483 "aria-invalid": fcs.error,
484 "aria-describedby": ariaDescribedby,
485 autoComplete: autoComplete,
486 autoFocus: autoFocus,
487 defaultValue: defaultValue,
488 disabled: fcs.disabled,
489 id: id,
490 onAnimationStart: handleAutoFill,
491 name: name,
492 placeholder: placeholder,
493 readOnly: readOnly,
494 required: fcs.required,
495 rows: rows,
496 value: value,
497 onKeyDown: onKeyDown,
498 onKeyUp: onKeyUp,
499 type: type,
500 ...inputProps,
501 ...(!isHostComponent(Input) && {
502 as: InputComponent,
503 ownerState: {
504 ...ownerState,
505 ...inputProps.ownerState
506 }
507 }),
508 ref: handleInputRef,
509 className: clsx(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
510 onBlur: handleBlur,
511 onChange: handleChange,
512 onFocus: handleFocus
513 })
514 }), endAdornment, renderSuffix ? renderSuffix({
515 ...fcs,
516 startAdornment
517 }) : null]
518 })]
519 });
520});
521process.env.NODE_ENV !== "production" ? InputBase.propTypes /* remove-proptypes */ = {
522 // ┌────────────────────────────── Warning ──────────────────────────────┐
523 // │ These PropTypes are generated from the TypeScript type definitions. │
524 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
525 // └─────────────────────────────────────────────────────────────────────┘
526 /**
527 * @ignore
528 */
529 'aria-describedby': PropTypes.string,
530 /**
531 * This prop helps users to fill forms faster, especially on mobile devices.
532 * The name can be confusing, as it's more like an autofill.
533 * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
534 */
535 autoComplete: PropTypes.string,
536 /**
537 * If `true`, the `input` element is focused during the first mount.
538 */
539 autoFocus: PropTypes.bool,
540 /**
541 * Override or extend the styles applied to the component.
542 */
543 classes: PropTypes.object,
544 /**
545 * @ignore
546 */
547 className: PropTypes.string,
548 /**
549 * The color of the component.
550 * It supports both default and custom theme colors, which can be added as shown in the
551 * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
552 * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
553 */
554 color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
555 /**
556 * The components used for each slot inside.
557 *
558 * @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
559 *
560 * @default {}
561 */
562 components: PropTypes.shape({
563 Input: PropTypes.elementType,
564 Root: PropTypes.elementType
565 }),
566 /**
567 * The extra props for the slot components.
568 * You can override the existing props or add new ones.
569 *
570 * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
571 *
572 * @default {}
573 */
574 componentsProps: PropTypes.shape({
575 input: PropTypes.object,
576 root: PropTypes.object
577 }),
578 /**
579 * The default value. Use when the component is not controlled.
580 */
581 defaultValue: PropTypes.any,
582 /**
583 * If `true`, the component is disabled.
584 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
585 */
586 disabled: PropTypes.bool,
587 /**
588 * If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
589 * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
590 * @default false
591 */
592 disableInjectingGlobalStyles: PropTypes.bool,
593 /**
594 * End `InputAdornment` for this component.
595 */
596 endAdornment: PropTypes.node,
597 /**
598 * If `true`, the `input` will indicate an error.
599 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
600 */
601 error: PropTypes.bool,
602 /**
603 * If `true`, the `input` will take up the full width of its container.
604 * @default false
605 */
606 fullWidth: PropTypes.bool,
607 /**
608 * The id of the `input` element.
609 */
610 id: PropTypes.string,
611 /**
612 * The component used for the `input` element.
613 * Either a string to use a HTML element or a component.
614 * @default 'input'
615 */
616 inputComponent: elementTypeAcceptingRef,
617 /**
618 * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
619 * @default {}
620 */
621 inputProps: PropTypes.object,
622 /**
623 * Pass a ref to the `input` element.
624 */
625 inputRef: refType,
626 /**
627 * If `dense`, will adjust vertical spacing. This is normally obtained via context from
628 * FormControl.
629 * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
630 */
631 margin: PropTypes.oneOf(['dense', 'none']),
632 /**
633 * Maximum number of rows to display when multiline option is set to true.
634 */
635 maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
636 /**
637 * Minimum number of rows to display when multiline option is set to true.
638 */
639 minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
640 /**
641 * If `true`, a [TextareaAutosize](https://mui.com/material-ui/react-textarea-autosize/) element is rendered.
642 * @default false
643 */
644 multiline: PropTypes.bool,
645 /**
646 * Name attribute of the `input` element.
647 */
648 name: PropTypes.string,
649 /**
650 * Callback fired when the `input` is blurred.
651 *
652 * Notice that the first argument (event) might be undefined.
653 */
654 onBlur: PropTypes.func,
655 /**
656 * Callback fired when the value is changed.
657 *
658 * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
659 * You can pull out the new value by accessing `event.target.value` (string).
660 */
661 onChange: PropTypes.func,
662 /**
663 * @ignore
664 */
665 onClick: PropTypes.func,
666 /**
667 * @ignore
668 */
669 onFocus: PropTypes.func,
670 /**
671 * Callback fired when the `input` doesn't satisfy its constraints.
672 */
673 onInvalid: PropTypes.func,
674 /**
675 * @ignore
676 */
677 onKeyDown: PropTypes.func,
678 /**
679 * @ignore
680 */
681 onKeyUp: PropTypes.func,
682 /**
683 * The short hint displayed in the `input` before the user enters a value.
684 */
685 placeholder: PropTypes.string,
686 /**
687 * It prevents the user from changing the value of the field
688 * (not from interacting with the field).
689 */
690 readOnly: PropTypes.bool,
691 /**
692 * @ignore
693 */
694 renderSuffix: PropTypes.func,
695 /**
696 * If `true`, the `input` element is required.
697 * The prop defaults to the value (`false`) inherited from the parent FormControl component.
698 */
699 required: PropTypes.bool,
700 /**
701 * Number of rows to display when multiline option is set to true.
702 */
703 rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
704 /**
705 * The size of the component.
706 */
707 size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
708 /**
709 * The extra props for the slot components.
710 * You can override the existing props or add new ones.
711 *
712 * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
713 *
714 * @default {}
715 */
716 slotProps: PropTypes.shape({
717 input: PropTypes.object,
718 root: PropTypes.object
719 }),
720 /**
721 * The components used for each slot inside.
722 *
723 * This prop is an alias for the `components` prop, which will be deprecated in the future.
724 *
725 * @default {}
726 */
727 slots: PropTypes.shape({
728 input: PropTypes.elementType,
729 root: PropTypes.elementType
730 }),
731 /**
732 * Start `InputAdornment` for this component.
733 */
734 startAdornment: PropTypes.node,
735 /**
736 * The system prop that allows defining system overrides as well as additional CSS styles.
737 */
738 sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
739 /**
740 * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
741 * @default 'text'
742 */
743 type: PropTypes.string,
744 /**
745 * The value of the `input` element, required for a controlled component.
746 */
747 value: PropTypes.any
748} : void 0;
749export default InputBase;
\No newline at end of file