@hh.ru/magritte-ui-input 5.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/BaseInput.d.ts +4 -0
  2. package/BaseInput.js +125 -0
  3. package/BaseInput.js.map +1 -0
  4. package/DateTimeInput.d.ts +3 -0
  5. package/DateTimeInput.js +41 -0
  6. package/DateTimeInput.js.map +1 -0
  7. package/Input.d.ts +4 -0
  8. package/Input.js +23 -0
  9. package/Input.js.map +1 -0
  10. package/NumberInput.d.ts +3 -0
  11. package/NumberInput.js +29 -0
  12. package/NumberInput.js.map +1 -0
  13. package/PasswordInput.d.ts +3 -0
  14. package/PasswordInput.js +36 -0
  15. package/PasswordInput.js.map +1 -0
  16. package/SearchInput.d.ts +3 -0
  17. package/SearchInput.js +23 -0
  18. package/SearchInput.js.map +1 -0
  19. package/UncontrolledDateTimeInput.d.ts +3 -0
  20. package/UncontrolledDateTimeInput.js +30 -0
  21. package/UncontrolledDateTimeInput.js.map +1 -0
  22. package/UncontrolledInput.d.ts +3 -0
  23. package/UncontrolledInput.js +26 -0
  24. package/UncontrolledInput.js.map +1 -0
  25. package/UncontrolledNumberInput.d.ts +3 -0
  26. package/UncontrolledNumberInput.js +29 -0
  27. package/UncontrolledNumberInput.js.map +1 -0
  28. package/UncontrolledPasswordInput.d.ts +3 -0
  29. package/UncontrolledPasswordInput.js +27 -0
  30. package/UncontrolledPasswordInput.js.map +1 -0
  31. package/UncontrolledSearchInput.d.ts +3 -0
  32. package/UncontrolledSearchInput.js +26 -0
  33. package/UncontrolledSearchInput.js.map +1 -0
  34. package/index.css +445 -0
  35. package/index.d.ts +15 -0
  36. package/index.js +35 -0
  37. package/index.js.map +1 -0
  38. package/index.mock.d.ts +14 -0
  39. package/index.mock.js +38 -0
  40. package/index.mock.js.map +1 -0
  41. package/numberFormatter.d.ts +3 -0
  42. package/numberFormatter.js +52 -0
  43. package/numberFormatter.js.map +1 -0
  44. package/package.json +48 -0
  45. package/types.d.ts +160 -0
  46. package/types.js +3 -0
  47. package/types.js.map +1 -0
  48. package/useDateTimeMask.d.ts +3 -0
  49. package/useDateTimeMask.js +134 -0
  50. package/useDateTimeMask.js.map +1 -0
  51. package/useFocus.d.ts +7 -0
  52. package/useFocus.js +21 -0
  53. package/useFocus.js.map +1 -0
  54. package/useInputAriaProps.d.ts +14 -0
  55. package/useInputAriaProps.js +15 -0
  56. package/useInputAriaProps.js.map +1 -0
  57. package/useUncontrolledInput.d.ts +1 -0
  58. package/useUncontrolledInput.js +14 -0
  59. package/useUncontrolledInput.js.map +1 -0
package/BaseInput.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { BaseInputProps } from './types';
3
+ declare const BaseInput: import("react").ForwardRefExoticComponent<(BaseInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "inputIcon" | "fixedPlaceholder" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
4
+ export { BaseInput };
package/BaseInput.js ADDED
@@ -0,0 +1,125 @@
1
+ import './index.css';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { forwardRef, useRef, useState, useId, useCallback, useEffect } from 'react';
4
+ import classnames from 'classnames';
5
+ import { Selection } from '@hh.ru/magritte-common-text-selection';
6
+ import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
7
+ import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
8
+ import { FieldHint } from '@hh.ru/magritte-internal-field-hint';
9
+ import { Action } from '@hh.ru/magritte-ui-action';
10
+ import { Counter } from '@hh.ru/magritte-ui-counter';
11
+ import { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
12
+ import { useFocus } from './useFocus.js';
13
+ import { useInputAriaProps } from './useInputAriaProps.js';
14
+ import { Text } from '@hh.ru/magritte-ui-typography';
15
+
16
+ var styles = {"input":"magritte-input___LVTID_5-0-12","label":"magritte-label___YlOQk_5-0-12","elevated":"magritte-elevated___kPcsM_5-0-12","focused":"magritte-focused___dxrHD_5-0-12","invalid":"magritte-invalid___L5MVa_5-0-12","disabled":"magritte-disabled___0NH6E_5-0-12","position-container":"magritte-position-container___kZnvZ_5-0-12","positionContainer":"magritte-position-container___kZnvZ_5-0-12","field":"magritte-field___9S8Tw_5-0-12","hint":"magritte-hint___EFGK0_5-0-12","additional-value":"magritte-additional-value___9Kyap_5-0-12","additionalValue":"magritte-additional-value___9Kyap_5-0-12","label_elevated":"magritte-label_elevated___PVcpC_5-0-12","labelElevated":"magritte-label_elevated___PVcpC_5-0-12","fixed-placeholder":"magritte-fixed-placeholder___PYJIH_5-0-12","fixedPlaceholder":"magritte-fixed-placeholder___PYJIH_5-0-12","icon":"magritte-icon___HEDsQ_5-0-12","focus-visible":"magritte-focus-visible___QvCO1_5-0-12","focusVisible":"magritte-focus-visible___QvCO1_5-0-12","right-container":"magritte-right-container___N0B0o_5-0-12","rightContainer":"magritte-right-container___N0B0o_5-0-12","with-icon":"magritte-with-icon___TPBe2_5-0-12","withIcon":"magritte-with-icon___TPBe2_5-0-12","large":"magritte-large___9frRh_5-0-12","rigging-container":"magritte-rigging-container___Up9Lb_5-0-12","riggingContainer":"magritte-rigging-container___Up9Lb_5-0-12","input__mask":"magritte-input__mask___CHda2_5-0-12","inputMask":"magritte-input__mask___CHda2_5-0-12","value-ghost":"magritte-value-ghost___IXNZj_5-0-12","valueGhost":"magritte-value-ghost___IXNZj_5-0-12","hint-container":"magritte-hint-container___rGsD8_5-0-12","hintContainer":"magritte-hint-container___rGsD8_5-0-12","with-right":"magritte-with-right___NUNiP_5-0-12","withRight":"magritte-with-right___NUNiP_5-0-12","content-container":"magritte-content-container___s-0kX_5-0-12","contentContainer":"magritte-content-container___s-0kX_5-0-12","counter":"magritte-counter___Bld3Q_5-0-12","value-container":"magritte-value-container___6ReT7_5-0-12","valueContainer":"magritte-value-container___6ReT7_5-0-12"};
17
+
18
+ const BaseInputComponent = ({ onChange, onFocus, onBlur, value, placeholder, disabled = false, postfix, size = 'medium', elevatePlaceholder = false, invalid = false, description, errorMessage, formatter, buttonIcon, clearable = false, clearableOnFocus, onButtonClick, buttonDataQa, buttonRef, inputIcon, wrapperRef, counter, fixedPlaceholder, maxLength, hint, showHintAlways = false, ...restProps }, ref) => {
19
+ const wrapperCurrentRef = useRef(null);
20
+ const inputRef = useRef(null);
21
+ const [isActionVisible, setActionVisible] = useState(false);
22
+ const inputRefCallback = useMultipleRefs(ref, inputRef);
23
+ const wrapperRefCallback = useMultipleRefs(wrapperRef, wrapperCurrentRef);
24
+ const descriptionId = useId();
25
+ const labelId = useId();
26
+ const hintRef = useRef(null);
27
+ const hintMaxWidthRef = useRef(null);
28
+ const change = useCallback((newValue) => {
29
+ if (inputRef.current && formatter) {
30
+ const caretPosition = Selection.getCaretPosition(inputRef.current);
31
+ const formatResult = formatter(value, newValue, caretPosition || 0);
32
+ requestAnimationFrame(() => {
33
+ if (inputRef.current) {
34
+ Selection.setCaretPosition(inputRef.current, formatResult.caretPosition);
35
+ }
36
+ });
37
+ onChange(formatResult.outputValue);
38
+ return;
39
+ }
40
+ onChange(newValue);
41
+ }, [formatter, onChange, value, inputRef]);
42
+ const clearClickHandler = useCallback((event) => {
43
+ onChange('');
44
+ inputRef.current && inputRef.current.focus();
45
+ onButtonClick?.(event);
46
+ }, [onChange, inputRef, onButtonClick]);
47
+ const forceDisabled = useDisabled();
48
+ const isComponentDisabled = forceDisabled || !!disabled;
49
+ const { changeHandler, focusHandler, blurHandler, isFocused } = useFocus(change, onFocus, onBlur);
50
+ const placeholderCanElevated = size === 'large' && !!elevatePlaceholder && !!placeholder;
51
+ const [isFocusVisible, setFocusVisible] = useState(false);
52
+ const currentValue = formatter?.('', value, 0).formattedValue || value;
53
+ const buttonQaLabel = buttonDataQa || `input-${clearable ? 'clearable-' : ''}button`;
54
+ const ariaProps = useInputAriaProps({
55
+ invalid,
56
+ hasDescription: !!description,
57
+ hasPlaceholder: !!placeholder,
58
+ descriptionId,
59
+ labelId,
60
+ });
61
+ const handleWrapperFocus = () => {
62
+ setActionVisible(true);
63
+ };
64
+ const handleWrapperBlur = () => {
65
+ requestAnimationFrame(() => {
66
+ if (!wrapperCurrentRef.current?.contains(document.activeElement)) {
67
+ setActionVisible(false);
68
+ }
69
+ });
70
+ };
71
+ const focusedOrFilled = isFocused || value !== '';
72
+ const placeholderIsElevated = focusedOrFilled && placeholderCanElevated;
73
+ const showPostfix = !!postfix && (placeholderIsElevated || value !== '');
74
+ const showFixedPlaceholder = focusedOrFilled && !!fixedPlaceholder;
75
+ const showLabel = placeholderCanElevated || (value === '' && !showFixedPlaceholder);
76
+ const InputIconComponent = inputIcon || null;
77
+ const showClearButton = value.length > 0 && (clearable || (!!clearableOnFocus && isActionVisible));
78
+ const showHint = !!hint && (showHintAlways || value.length > 0);
79
+ const hintWrapperRefCallback = useCallback((element) => {
80
+ if (element && hintRef.current) {
81
+ const text = hintRef.current.innerText;
82
+ if (text.length > 30) {
83
+ let maxWidth;
84
+ if (text !== hintMaxWidthRef.current?.text) {
85
+ const newText = text.slice(0, 30);
86
+ hintRef.current.innerText = newText;
87
+ maxWidth = hintRef.current.offsetWidth;
88
+ hintRef.current.innerText = text;
89
+ hintMaxWidthRef.current = {
90
+ width: maxWidth,
91
+ text,
92
+ };
93
+ }
94
+ else {
95
+ maxWidth = hintMaxWidthRef.current.width;
96
+ }
97
+ element.style.maxWidth = `${maxWidth}px`;
98
+ }
99
+ }
100
+ },
101
+ // eslint-disable-next-line react-hooks/exhaustive-deps
102
+ [hint]);
103
+ useEffect(() => {
104
+ if (inputRef.current) {
105
+ setFocusVisible(isFocused && inputRef.current.classList.contains('focus-visible'));
106
+ }
107
+ }, [isFocused]);
108
+ return (jsxs("div", { ref: wrapperRefCallback, className: classnames(styles.input, {
109
+ [styles.focused]: isFocused,
110
+ [styles.focusVisible]: isFocusVisible,
111
+ [styles.disabled]: isComponentDisabled,
112
+ [styles.large]: size === 'large',
113
+ [styles.elevated]: placeholderCanElevated,
114
+ [styles.invalid]: !!invalid && !isFocused,
115
+ [styles.withRight]: !!buttonIcon || showClearButton || counter,
116
+ [styles.withIcon]: !!inputIcon,
117
+ }), onFocus: clearableOnFocus ? handleWrapperFocus : undefined, onBlur: clearableOnFocus ? handleWrapperBlur : undefined, children: [jsxs("div", { className: styles.positionContainer, children: [jsxs("div", { className: styles.hintContainer, children: [jsxs("div", { className: styles.contentContainer, children: [!!InputIconComponent && (jsx("div", { className: styles.icon, children: jsx(InputIconComponent, {}) })), jsxs("div", { className: styles.valueContainer, children: [jsx("input", { ...restProps, ...ariaProps, maxLength: maxLength, disabled: isComponentDisabled, suppressHydrationWarning: true, className: styles.field, value: currentValue, onInput: changeHandler, onFocus: focusHandler, onBlur: blurHandler, ref: inputRefCallback }), jsx("div", { className: styles.additionalValue, children: jsxs(Text, { Element: "span", typography: "label-2-regular", children: [jsx("span", { className: styles.valueGhost, children: currentValue }), showFixedPlaceholder && (jsx("span", { className: styles.fixedPlaceholder, children: fixedPlaceholder.slice(value.length) })), showPostfix && (jsxs(Fragment, { children: ['\u00A0', postfix] }))] }) })] }), jsx("div", { className: styles.riggingContainer, children: showLabel && (jsx("label", { className: classnames(styles.label, {
118
+ [styles.labelElevated]: placeholderIsElevated,
119
+ }), id: ariaProps['aria-labelledby'], children: placeholder })) })] }), showHint && (jsx("div", { className: styles.hint, ref: hintWrapperRefCallback, "data-qa": "input-hint", children: jsx(Text, { Element: "span", typography: "label-3-regular", children: jsx("span", { ref: hintRef, children: hint }) }) }))] }), (buttonIcon || showClearButton || counter) && (jsxs("div", { className: styles.rightContainer, children: [(buttonIcon || showClearButton) && (jsx(Action, { "data-qa": buttonQaLabel, mode: "secondary", onMouseDown: (event) => event.preventDefault(), onClick: showClearButton ? clearClickHandler : onButtonClick, icon: showClearButton ? CrossOutlinedSize24 : buttonIcon, disabled: isComponentDisabled, ref: buttonRef })), counter && (jsx("span", { className: styles.counter, children: jsx(Counter, { label: counter }) }))] }))] }), jsx(FieldHint, { description: description, errorMessage: errorMessage, descriptionId: ariaProps['aria-describedby'], disabled: isComponentDisabled, focused: isFocused, invalid: invalid })] }));
120
+ };
121
+ const BaseInput = forwardRef(BaseInputComponent);
122
+ BaseInput.displayName = 'BaseInput';
123
+
124
+ export { BaseInput };
125
+ //# sourceMappingURL=BaseInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseInput.js","sources":["../src/BaseInput.tsx"],"sourcesContent":["import {\n InputHTMLAttributes,\n forwardRef,\n ForwardedRef,\n useCallback,\n useId,\n useRef,\n useState,\n useEffect,\n RefCallback,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { Selection } from '@hh.ru/magritte-common-text-selection';\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { FieldHint } from '@hh.ru/magritte-internal-field-hint';\nimport { Action } from '@hh.ru/magritte-ui-action';\nimport { Counter } from '@hh.ru/magritte-ui-counter';\nimport { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/src/iconTypes';\nimport { BaseInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useFocus } from '@hh.ru/magritte-ui-input/useFocus';\nimport { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './input.less';\n\nconst BaseInputComponent = (\n {\n onChange,\n onFocus,\n onBlur,\n value,\n placeholder,\n disabled = false,\n postfix,\n size = 'medium',\n elevatePlaceholder = false,\n invalid = false,\n description,\n errorMessage,\n formatter,\n buttonIcon,\n clearable = false,\n clearableOnFocus,\n onButtonClick,\n buttonDataQa,\n buttonRef,\n inputIcon,\n wrapperRef,\n counter,\n fixedPlaceholder,\n maxLength,\n hint,\n showHintAlways = false,\n ...restProps\n }: BaseInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof BaseInputProps>,\n ref: ForwardedRef<HTMLInputElement>\n) => {\n const wrapperCurrentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [isActionVisible, setActionVisible] = useState(false);\n const inputRefCallback = useMultipleRefs(ref, inputRef);\n const wrapperRefCallback = useMultipleRefs(wrapperRef, wrapperCurrentRef);\n const descriptionId = useId();\n const labelId = useId();\n const hintRef = useRef<HTMLDivElement>(null);\n const hintMaxWidthRef = useRef<{ width: number; text: string } | null>(null);\n const change = useCallback(\n (newValue: string) => {\n if (inputRef.current && formatter) {\n const caretPosition = Selection.getCaretPosition(inputRef.current);\n const formatResult = formatter(value, newValue, caretPosition || 0);\n requestAnimationFrame(() => {\n if (inputRef.current) {\n Selection.setCaretPosition(inputRef.current, formatResult.caretPosition);\n }\n });\n onChange(formatResult.outputValue);\n return;\n }\n onChange(newValue);\n },\n [formatter, onChange, value, inputRef]\n );\n\n const clearClickHandler = useCallback(\n (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n onChange('');\n inputRef.current && inputRef.current.focus();\n onButtonClick?.(event);\n },\n [onChange, inputRef, onButtonClick]\n );\n\n const forceDisabled = useDisabled();\n const isComponentDisabled = forceDisabled || !!disabled;\n\n const { changeHandler, focusHandler, blurHandler, isFocused } = useFocus(change, onFocus, onBlur);\n const placeholderCanElevated = size === 'large' && !!elevatePlaceholder && !!placeholder;\n const [isFocusVisible, setFocusVisible] = useState(false);\n const currentValue = formatter?.('', value, 0).formattedValue || value;\n const buttonQaLabel = buttonDataQa || `input-${clearable ? 'clearable-' : ''}button`;\n const ariaProps = useInputAriaProps({\n invalid,\n hasDescription: !!description,\n hasPlaceholder: !!placeholder,\n descriptionId,\n labelId,\n });\n\n const handleWrapperFocus = () => {\n setActionVisible(true);\n };\n\n const handleWrapperBlur = () => {\n requestAnimationFrame(() => {\n if (!wrapperCurrentRef.current?.contains(document.activeElement)) {\n setActionVisible(false);\n }\n });\n };\n\n const focusedOrFilled = isFocused || value !== '';\n const placeholderIsElevated = focusedOrFilled && placeholderCanElevated;\n const showPostfix = !!postfix && (placeholderIsElevated || value !== '');\n const showFixedPlaceholder = focusedOrFilled && !!fixedPlaceholder;\n const showLabel = placeholderCanElevated || (value === '' && !showFixedPlaceholder);\n\n const InputIconComponent = inputIcon || null;\n const showClearButton = value.length > 0 && (clearable || (!!clearableOnFocus && isActionVisible));\n const showHint = !!hint && (showHintAlways || value.length > 0);\n\n const hintWrapperRefCallback: RefCallback<HTMLDivElement> = useCallback(\n (element) => {\n if (element && hintRef.current) {\n const text = hintRef.current.innerText;\n if (text.length > 30) {\n let maxWidth;\n if (text !== hintMaxWidthRef.current?.text) {\n const newText = text.slice(0, 30);\n hintRef.current.innerText = newText;\n maxWidth = hintRef.current.offsetWidth;\n hintRef.current.innerText = text;\n hintMaxWidthRef.current = {\n width: maxWidth,\n text,\n };\n } else {\n maxWidth = hintMaxWidthRef.current.width;\n }\n\n element.style.maxWidth = `${maxWidth}px`;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [hint]\n );\n\n useEffect(() => {\n if (inputRef.current) {\n setFocusVisible(isFocused && inputRef.current.classList.contains('focus-visible'));\n }\n }, [isFocused]);\n\n return (\n <div\n ref={wrapperRefCallback}\n className={classnames(styles.input, {\n [styles.focused]: isFocused,\n [styles.focusVisible]: isFocusVisible,\n [styles.disabled]: isComponentDisabled,\n [styles.large]: size === 'large',\n [styles.elevated]: placeholderCanElevated,\n [styles.invalid]: !!invalid && !isFocused,\n [styles.withRight]: !!buttonIcon || showClearButton || counter,\n [styles.withIcon]: !!inputIcon,\n })}\n onFocus={clearableOnFocus ? handleWrapperFocus : undefined}\n onBlur={clearableOnFocus ? handleWrapperBlur : undefined}\n >\n <div className={styles.positionContainer}>\n <div className={styles.hintContainer}>\n <div className={styles.contentContainer}>\n {!!InputIconComponent && (\n <div className={styles.icon}>\n <InputIconComponent />\n </div>\n )}\n <div className={styles.valueContainer}>\n <input\n {...restProps}\n {...ariaProps}\n maxLength={maxLength}\n disabled={isComponentDisabled}\n suppressHydrationWarning\n className={styles.field}\n value={currentValue}\n onInput={changeHandler} // maskito требует onInput, (https://maskito.dev/frameworks/react) который работает аналогично onChange\n onFocus={focusHandler}\n onBlur={blurHandler}\n ref={inputRefCallback}\n />\n <div className={styles.additionalValue}>\n <Text Element=\"span\" typography=\"label-2-regular\">\n <span className={styles.valueGhost}>{currentValue}</span>\n {showFixedPlaceholder && (\n <span className={styles.fixedPlaceholder}>\n {fixedPlaceholder.slice(value.length)}\n </span>\n )}\n {showPostfix && (\n <>\n {'\\u00A0'}\n {postfix}\n </>\n )}\n </Text>\n </div>\n </div>\n <div className={styles.riggingContainer}>\n {showLabel && (\n <label\n className={classnames(styles.label, {\n [styles.labelElevated]: placeholderIsElevated,\n })}\n id={ariaProps['aria-labelledby']}\n >\n {placeholder}\n </label>\n )}\n </div>\n </div>\n {showHint && (\n <div className={styles.hint} ref={hintWrapperRefCallback} data-qa=\"input-hint\">\n <Text Element=\"span\" typography=\"label-3-regular\">\n <span ref={hintRef}>{hint}</span>\n </Text>\n </div>\n )}\n </div>\n {(buttonIcon || showClearButton || counter) && (\n <div className={styles.rightContainer}>\n {(buttonIcon || showClearButton) && (\n <Action\n data-qa={buttonQaLabel}\n mode=\"secondary\"\n onMouseDown={(event) => event.preventDefault()} // чтобы инпут не терял фокус\n onClick={showClearButton ? clearClickHandler : (onButtonClick as () => void)}\n icon={\n showClearButton ? CrossOutlinedSize24 : (buttonIcon as IconWrapperComponentSize24)\n }\n disabled={isComponentDisabled}\n ref={buttonRef}\n />\n )}\n {counter && (\n <span className={styles.counter}>\n <Counter label={counter} />\n </span>\n )}\n </div>\n )}\n </div>\n <FieldHint\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\n focused={isFocused}\n invalid={invalid}\n />\n </div>\n );\n};\n\nconst BaseInput = forwardRef(BaseInputComponent);\n\nBaseInput.displayName = 'BaseInput';\n\nexport { BaseInput };\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAM,kBAAkB,GAAG,CACvB,EACI,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,kBAAkB,GAAG,KAAK,EAC1B,OAAO,GAAG,KAAK,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,cAAc,GAAG,KAAK,EACtB,GAAG,SAAS,EACqE,EACrF,GAAmC,KACnC;AACA,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AACvD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,gBAAgB,GAAG,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAC1E,IAAA,MAAM,aAAa,GAAG,KAAK,EAAE,CAAC;AAC9B,IAAA,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;AACxB,IAAA,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC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,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,OAAO,EAClB,CAAA,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAkB,EAAE;AAEjD,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { ControlledDateTimeInputProps } from './types';
3
+ export declare const DateTimeInput: import("react").ForwardRefExoticComponent<(ControlledDateTimeInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "dateMask" | "timeMask" | "timeRounding">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,41 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, useMemo } from 'react';
4
+ import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
5
+ import { ClockOutlinedSize24, CalendarOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
6
+ import { BaseInput } from './BaseInput.js';
7
+ import { useDateTimeMask } from './useDateTimeMask.js';
8
+ import 'classnames';
9
+ import '@hh.ru/magritte-common-text-selection';
10
+ import '@hh.ru/magritte-common-use-disabled';
11
+ import '@hh.ru/magritte-internal-field-hint';
12
+ import '@hh.ru/magritte-ui-action';
13
+ import '@hh.ru/magritte-ui-counter';
14
+ import './useFocus.js';
15
+ import './useInputAriaProps.js';
16
+ import '@hh.ru/magritte-ui-typography';
17
+ import '@maskito/core';
18
+ import '@maskito/kit';
19
+ import '@maskito/react';
20
+
21
+ const DateTimeInput = forwardRef(({ dateMask, timeMask, timeRounding, onButtonClick, ...restProps }, ref) => {
22
+ const maskedInputRef = useDateTimeMask(dateMask, timeMask, timeRounding);
23
+ const inputRef = useMultipleRefs(maskedInputRef, ref);
24
+ const maskedPlaceholder = useMemo(() => {
25
+ const parts = [];
26
+ if (dateMask) {
27
+ parts.push(dateMask.replace(/d/g, 'Д').replace(/m/g, 'М').replace(/y/g, 'Г'));
28
+ }
29
+ if (timeMask) {
30
+ parts.push('00:00');
31
+ }
32
+ return parts.join(', ');
33
+ }, [dateMask, timeMask]);
34
+ const buttonIcon = timeMask && !dateMask ? ClockOutlinedSize24 : CalendarOutlinedSize24;
35
+ const buttonProps = onButtonClick ? { buttonIcon, onButtonClick } : {};
36
+ return (jsx(BaseInput, { type: "text", inputMode: "decimal", fixedPlaceholder: maskedPlaceholder, ...restProps, ...buttonProps, ref: inputRef, autoComplete: "off" }));
37
+ });
38
+ DateTimeInput.displayName = 'DateTimeInput';
39
+
40
+ export { DateTimeInput };
41
+ //# sourceMappingURL=DateTimeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimeInput.js","sources":["../src/DateTimeInput.tsx"],"sourcesContent":["import { InputHTMLAttributes, forwardRef, useMemo } from 'react';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { CalendarOutlinedSize24, ClockOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { BaseInput } from '@hh.ru/magritte-ui-input/BaseInput';\nimport { ControlledDateTimeInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useDateTimeMask } from '@hh.ru/magritte-ui-input/useDateTimeMask';\n\nexport const DateTimeInput = forwardRef<\n HTMLInputElement,\n ControlledDateTimeInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof ControlledDateTimeInputProps>\n>(({ dateMask, timeMask, timeRounding, onButtonClick, ...restProps }, ref) => {\n const maskedInputRef = useDateTimeMask(dateMask, timeMask, timeRounding);\n const inputRef = useMultipleRefs(maskedInputRef, ref);\n\n const maskedPlaceholder = useMemo(() => {\n const parts = [];\n\n if (dateMask) {\n parts.push(dateMask.replace(/d/g, 'Д').replace(/m/g, 'М').replace(/y/g, 'Г'));\n }\n if (timeMask) {\n parts.push('00:00');\n }\n\n return parts.join(', ');\n }, [dateMask, timeMask]);\n\n const buttonIcon = timeMask && !dateMask ? ClockOutlinedSize24 : CalendarOutlinedSize24;\n const buttonProps = onButtonClick ? { buttonIcon, onButtonClick } : {};\n\n return (\n <BaseInput\n type=\"text\"\n inputMode=\"decimal\"\n fixedPlaceholder={maskedPlaceholder}\n {...restProps}\n {...buttonProps}\n ref={inputRef}\n autoComplete=\"off\"\n />\n );\n});\n\nDateTimeInput.displayName = 'DateTimeInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;MAQa,aAAa,GAAG,UAAU,CAGrC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;IACzE,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,eAAe,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;AAEtD,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAK;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC;AAEjB,QAAA,IAAI,QAAQ,EAAE;YACV,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACjF,SAAA;AACD,QAAA,IAAI,QAAQ,EAAE;AACV,YAAA,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACvB,SAAA;AAED,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,KAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzB,IAAA,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,QAAQ,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AACxF,IAAA,MAAM,WAAW,GAAG,aAAa,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC;AAEvE,IAAA,QACIA,GAAA,CAAC,SAAS,EAAA,EACN,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,SAAS,EACnB,gBAAgB,EAAE,iBAAiB,EAAA,GAC/B,SAAS,EAAA,GACT,WAAW,EACf,GAAG,EAAE,QAAQ,EACb,YAAY,EAAC,KAAK,EAAA,CACpB,EACJ;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
package/Input.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { ControlledInputProps } from './types';
3
+ declare const Input: import("react").ForwardRefExoticComponent<(ControlledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
4
+ export { Input };
package/Input.js ADDED
@@ -0,0 +1,23 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { BaseInput } from './BaseInput.js';
5
+ import 'classnames';
6
+ import '@hh.ru/magritte-common-text-selection';
7
+ import '@hh.ru/magritte-common-use-disabled';
8
+ import '@hh.ru/magritte-common-use-multiple-refs';
9
+ import '@hh.ru/magritte-internal-field-hint';
10
+ import '@hh.ru/magritte-ui-action';
11
+ import '@hh.ru/magritte-ui-counter';
12
+ import '@hh.ru/magritte-ui-icon/icon';
13
+ import './useFocus.js';
14
+ import './useInputAriaProps.js';
15
+ import '@hh.ru/magritte-ui-typography';
16
+
17
+ // Здесь создаем новый компонент, а не переиспользуем BaseInput as <...>, чтобы обеспечить уникальность displayName
18
+ const InputComponent = (props, ref) => jsx(BaseInput, { ref: ref, ...props });
19
+ const Input = forwardRef(InputComponent);
20
+ Input.displayName = 'Input';
21
+
22
+ export { Input };
23
+ //# sourceMappingURL=Input.js.map
package/Input.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","sources":["../src/Input.tsx"],"sourcesContent":["import { InputHTMLAttributes, forwardRef, ForwardedRef } from 'react';\n\nimport { BaseInput } from '@hh.ru/magritte-ui-input/BaseInput';\nimport { ControlledInputProps } from '@hh.ru/magritte-ui-input/types';\n\n// Здесь создаем новый компонент, а не переиспользуем BaseInput as <...>, чтобы обеспечить уникальность displayName\nconst InputComponent = (\n props: ControlledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof ControlledInputProps>,\n ref: ForwardedRef<HTMLInputElement>\n) => <BaseInput ref={ref} {...props} />;\n\nconst Input = forwardRef(InputComponent);\n\nInput.displayName = 'Input';\n\nexport { Input };\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;AAKA;AACA,MAAM,cAAc,GAAG,CACnB,KAAqG,EACrG,GAAmC,KAClCA,GAAC,CAAA,SAAS,IAAC,GAAG,EAAE,GAAG,EAAM,GAAA,KAAK,GAAI,CAAC;AAExC,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,EAAE;AAEzC,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { ControlledNumberInputProps } from './types';
3
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<(ControlledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "groupSeparator" | "decimalMark" | "groupSize" | "decimalLength" | "allowNegative">) & import("react").RefAttributes<HTMLInputElement>>;
package/NumberInput.js ADDED
@@ -0,0 +1,29 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, useMemo } from 'react';
4
+ import { defaults } from '@hh.ru/magritte-common-number-formatter';
5
+ import { Input } from './Input.js';
6
+ import { numberFormatterFactory } from './numberFormatter.js';
7
+ import './BaseInput.js';
8
+ import 'classnames';
9
+ import '@hh.ru/magritte-common-text-selection';
10
+ import '@hh.ru/magritte-common-use-disabled';
11
+ import '@hh.ru/magritte-common-use-multiple-refs';
12
+ import '@hh.ru/magritte-internal-field-hint';
13
+ import '@hh.ru/magritte-ui-action';
14
+ import '@hh.ru/magritte-ui-counter';
15
+ import '@hh.ru/magritte-ui-icon/icon';
16
+ import './useFocus.js';
17
+ import './useInputAriaProps.js';
18
+ import '@hh.ru/magritte-ui-typography';
19
+
20
+ const NumberInput = forwardRef(({ groupSeparator = defaults.groupSeparator, decimalMark = defaults.decimalMark, groupSize = defaults.groupSize, decimalLength = defaults.decimalLength, allowNegative = defaults.allowNegative, ...restProps }, ref) => {
21
+ const numberFormatter = useMemo(() => {
22
+ return numberFormatterFactory({ groupSeparator, decimalMark, groupSize, decimalLength, allowNegative });
23
+ }, [groupSeparator, decimalMark, groupSize, decimalLength, allowNegative]);
24
+ return jsx(Input, { ...restProps, inputMode: "decimal", formatter: numberFormatter, ref: ref });
25
+ });
26
+ NumberInput.displayName = 'NumberInput';
27
+
28
+ export { NumberInput };
29
+ //# sourceMappingURL=NumberInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberInput.js","sources":["../src/NumberInput.tsx"],"sourcesContent":["import { forwardRef, useMemo, InputHTMLAttributes } from 'react';\n\nimport { defaults } from '@hh.ru/magritte-common-number-formatter';\nimport { Input } from '@hh.ru/magritte-ui-input/Input';\nimport { numberFormatterFactory } from '@hh.ru/magritte-ui-input/numberFormatter';\nimport { ControlledNumberInputProps } from '@hh.ru/magritte-ui-input/types';\n\nexport const NumberInput = forwardRef<\n HTMLInputElement,\n ControlledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof ControlledNumberInputProps>\n>(\n (\n {\n groupSeparator = defaults.groupSeparator,\n decimalMark = defaults.decimalMark,\n groupSize = defaults.groupSize,\n decimalLength = defaults.decimalLength,\n allowNegative = defaults.allowNegative,\n ...restProps\n },\n ref\n ) => {\n const numberFormatter = useMemo(() => {\n return numberFormatterFactory({ groupSeparator, decimalMark, groupSize, decimalLength, allowNegative });\n }, [groupSeparator, decimalMark, groupSize, decimalLength, allowNegative]);\n\n return <Input {...restProps} inputMode=\"decimal\" formatter={numberFormatter} ref={ref} />;\n }\n);\n\nNumberInput.displayName = 'NumberInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;MAOa,WAAW,GAAG,UAAU,CAIjC,CACI,EACI,cAAc,GAAG,QAAQ,CAAC,cAAc,EACxC,WAAW,GAAG,QAAQ,CAAC,WAAW,EAClC,SAAS,GAAG,QAAQ,CAAC,SAAS,EAC9B,aAAa,GAAG,QAAQ,CAAC,aAAa,EACtC,aAAa,GAAG,QAAQ,CAAC,aAAa,EACtC,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,eAAe,GAAG,OAAO,CAAC,MAAK;AACjC,QAAA,OAAO,sBAAsB,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;AAC5G,KAAC,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;AAE3E,IAAA,OAAOA,IAAC,KAAK,EAAA,EAAA,GAAK,SAAS,EAAE,SAAS,EAAC,SAAS,EAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC9F,CAAC,EACH;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { ControlledPasswordInputProps } from './types';
3
+ export declare const PasswordInput: import("react").ForwardRefExoticComponent<(ControlledPasswordInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,36 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, useState, useCallback, useRef } from 'react';
4
+ import { Selection } from '@hh.ru/magritte-common-text-selection';
5
+ import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
6
+ import { EyeCrossedOutlinedSize24, EyeOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
7
+ import { Input } from './Input.js';
8
+ import './BaseInput.js';
9
+ import 'classnames';
10
+ import '@hh.ru/magritte-common-use-disabled';
11
+ import '@hh.ru/magritte-internal-field-hint';
12
+ import '@hh.ru/magritte-ui-action';
13
+ import '@hh.ru/magritte-ui-counter';
14
+ import './useFocus.js';
15
+ import './useInputAriaProps.js';
16
+ import '@hh.ru/magritte-ui-typography';
17
+
18
+ const PasswordInput = forwardRef(({ onFocus, ...restProps }, ref) => {
19
+ const [typePassword, setTypePassword] = useState(true);
20
+ const clickHandler = useCallback(() => {
21
+ setTypePassword((typePassword) => !typePassword);
22
+ }, [setTypePassword]);
23
+ const inputRef = useRef(null);
24
+ const inputRefCallback = useMultipleRefs(ref, inputRef);
25
+ const focusHandler = useCallback((event) => {
26
+ if (inputRef.current) {
27
+ Selection.set(inputRef.current, 0, inputRef.current.value.length, 'forward');
28
+ }
29
+ onFocus && onFocus(event);
30
+ }, [onFocus, inputRef]);
31
+ return (jsx(Input, { ...restProps, buttonDataQa: "password-visibility-switch-button", onFocus: focusHandler, type: typePassword ? 'password' : 'text', buttonIcon: typePassword ? EyeCrossedOutlinedSize24 : EyeOutlinedSize24, onButtonClick: clickHandler, ref: inputRefCallback }));
32
+ });
33
+ PasswordInput.displayName = 'PasswordInput';
34
+
35
+ export { PasswordInput };
36
+ //# sourceMappingURL=PasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.js","sources":["../src/PasswordInput.tsx"],"sourcesContent":["import { forwardRef, useCallback, useState, InputHTMLAttributes, FocusEventHandler, useRef } from 'react';\n\nimport { Selection } from '@hh.ru/magritte-common-text-selection';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { EyeOutlinedSize24, EyeCrossedOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Input } from '@hh.ru/magritte-ui-input/Input';\nimport { ControlledPasswordInputProps } from '@hh.ru/magritte-ui-input/types';\n\nexport const PasswordInput = forwardRef<\n HTMLInputElement,\n ControlledPasswordInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof ControlledPasswordInputProps>\n>(({ onFocus, ...restProps }, ref) => {\n const [typePassword, setTypePassword] = useState(true);\n const clickHandler = useCallback(() => {\n setTypePassword((typePassword) => !typePassword);\n }, [setTypePassword]);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const inputRefCallback = useMultipleRefs(ref, inputRef);\n\n const focusHandler = useCallback<FocusEventHandler<HTMLInputElement>>(\n (event) => {\n if (inputRef.current) {\n Selection.set(inputRef.current, 0, inputRef.current.value.length, 'forward');\n }\n onFocus && onFocus(event);\n },\n [onFocus, inputRef]\n );\n\n return (\n <Input\n {...restProps}\n buttonDataQa=\"password-visibility-switch-button\"\n onFocus={focusHandler}\n type={typePassword ? 'password' : 'text'}\n buttonIcon={typePassword ? EyeCrossedOutlinedSize24 : EyeOutlinedSize24}\n onButtonClick={clickHandler}\n ref={inputRefCallback}\n />\n );\n});\n\nPasswordInput.displayName = 'PasswordInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;AAQa,MAAA,aAAa,GAAG,UAAU,CAGrC,CAAC,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;IACjC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;AACvD,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,MAAK;QAClC,eAAe,CAAC,CAAC,YAAY,KAAK,CAAC,YAAY,CAAC,CAAC;AACrD,KAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAEtB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAExD,IAAA,MAAM,YAAY,GAAG,WAAW,CAC5B,CAAC,KAAK,KAAI;QACN,IAAI,QAAQ,CAAC,OAAO,EAAE;AAClB,YAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAChF,SAAA;AACD,QAAA,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAC,EACD,CAAC,OAAO,EAAE,QAAQ,CAAC,CACtB,CAAC;IAEF,QACIA,IAAC,KAAK,EAAA,EAAA,GACE,SAAS,EACb,YAAY,EAAC,mCAAmC,EAChD,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,EACxC,UAAU,EAAE,YAAY,GAAG,wBAAwB,GAAG,iBAAiB,EACvE,aAAa,EAAE,YAAY,EAC3B,GAAG,EAAE,gBAAgB,EACvB,CAAA,EACJ;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { ControlledSearchInputProps } from './types';
3
+ export declare const SearchInput: import("react").ForwardRefExoticComponent<(ControlledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;
package/SearchInput.js ADDED
@@ -0,0 +1,23 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { MagnifierOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
5
+ import { BaseInput } from './BaseInput.js';
6
+ import 'classnames';
7
+ import '@hh.ru/magritte-common-text-selection';
8
+ import '@hh.ru/magritte-common-use-disabled';
9
+ import '@hh.ru/magritte-common-use-multiple-refs';
10
+ import '@hh.ru/magritte-internal-field-hint';
11
+ import '@hh.ru/magritte-ui-action';
12
+ import '@hh.ru/magritte-ui-counter';
13
+ import './useFocus.js';
14
+ import './useInputAriaProps.js';
15
+ import '@hh.ru/magritte-ui-typography';
16
+
17
+ const SearchInput = forwardRef((props, ref) => {
18
+ return jsx(BaseInput, { ...props, elevatePlaceholder: false, inputIcon: MagnifierOutlinedSize24, ref: ref });
19
+ });
20
+ SearchInput.displayName = 'SearchInput';
21
+
22
+ export { SearchInput };
23
+ //# sourceMappingURL=SearchInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchInput.js","sources":["../src/SearchInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { MagnifierOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { BaseInput } from '@hh.ru/magritte-ui-input/BaseInput';\nimport { ControlledSearchInputProps } from '@hh.ru/magritte-ui-input/types';\n\nexport const SearchInput = forwardRef<\n HTMLInputElement,\n ControlledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof ControlledSearchInputProps>\n>((props, ref) => {\n return <BaseInput {...props} elevatePlaceholder={false} inputIcon={MagnifierOutlinedSize24} ref={ref} />;\n});\n\nSearchInput.displayName = 'SearchInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;AAMa,MAAA,WAAW,GAAG,UAAU,CAGnC,CAAC,KAAK,EAAE,GAAG,KAAI;AACb,IAAA,OAAOA,IAAC,SAAS,EAAA,EAAA,GAAK,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7G,CAAC,EAAE;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { UncontrolledDateTimeInputProps } from './types';
3
+ export declare const UncontrolledDateTimeInput: import("react").ForwardRefExoticComponent<(UncontrolledDateTimeInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "dateMask" | "timeMask" | "timeRounding">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,30 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { DateTimeInput } from './DateTimeInput.js';
5
+ import { useUncontrolledInput } from './useUncontrolledInput.js';
6
+ import '@hh.ru/magritte-common-use-multiple-refs';
7
+ import '@hh.ru/magritte-ui-icon/icon';
8
+ import './BaseInput.js';
9
+ import 'classnames';
10
+ import '@hh.ru/magritte-common-text-selection';
11
+ import '@hh.ru/magritte-common-use-disabled';
12
+ import '@hh.ru/magritte-internal-field-hint';
13
+ import '@hh.ru/magritte-ui-action';
14
+ import '@hh.ru/magritte-ui-counter';
15
+ import './useFocus.js';
16
+ import './useInputAriaProps.js';
17
+ import '@hh.ru/magritte-ui-typography';
18
+ import './useDateTimeMask.js';
19
+ import '@maskito/core';
20
+ import '@maskito/kit';
21
+ import '@maskito/react';
22
+
23
+ const UncontrolledDateTimeInput = forwardRef(({ value, onChange, ...restProps }, ref) => {
24
+ const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);
25
+ return jsx(DateTimeInput, { ...restProps, value: currentValue, onChange: changeHandler, ref: ref });
26
+ });
27
+ UncontrolledDateTimeInput.displayName = 'UncontrolledDateTimeInput';
28
+
29
+ export { UncontrolledDateTimeInput };
30
+ //# sourceMappingURL=UncontrolledDateTimeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UncontrolledDateTimeInput.js","sources":["../src/UncontrolledDateTimeInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { DateTimeInput } from '@hh.ru/magritte-ui-input/DateTimeInput';\nimport { UncontrolledDateTimeInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledDateTimeInput = forwardRef<\n HTMLInputElement,\n UncontrolledDateTimeInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledDateTimeInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <DateTimeInput {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledDateTimeInput.displayName = 'UncontrolledDateTimeInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMa,MAAA,yBAAyB,GAAG,UAAU,CAGjD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;AACzC,IAAA,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5E,IAAA,OAAOA,IAAC,aAAa,EAAA,EAAA,GAAK,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACpG,CAAC,EAAE;AAEH,yBAAyB,CAAC,WAAW,GAAG,2BAA2B;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { UncontrolledInputProps } from './types';
3
+ export declare const UncontrolledInput: import("react").ForwardRefExoticComponent<(UncontrolledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,26 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { Input } from './Input.js';
5
+ import { useUncontrolledInput } from './useUncontrolledInput.js';
6
+ import './BaseInput.js';
7
+ import 'classnames';
8
+ import '@hh.ru/magritte-common-text-selection';
9
+ import '@hh.ru/magritte-common-use-disabled';
10
+ import '@hh.ru/magritte-common-use-multiple-refs';
11
+ import '@hh.ru/magritte-internal-field-hint';
12
+ import '@hh.ru/magritte-ui-action';
13
+ import '@hh.ru/magritte-ui-counter';
14
+ import '@hh.ru/magritte-ui-icon/icon';
15
+ import './useFocus.js';
16
+ import './useInputAriaProps.js';
17
+ import '@hh.ru/magritte-ui-typography';
18
+
19
+ const UncontrolledInput = forwardRef(({ value, onChange, ...restProps }, ref) => {
20
+ const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);
21
+ return jsx(Input, { ...restProps, value: currentValue, onChange: changeHandler, ref: ref });
22
+ });
23
+ UncontrolledInput.displayName = 'UncontrolledInput';
24
+
25
+ export { UncontrolledInput };
26
+ //# sourceMappingURL=UncontrolledInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UncontrolledInput.js","sources":["../src/UncontrolledInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { Input } from '@hh.ru/magritte-ui-input/Input';\nimport { UncontrolledInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledInput = forwardRef<\n HTMLInputElement,\n UncontrolledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <Input {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledInput.displayName = 'UncontrolledInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;AAMa,MAAA,iBAAiB,GAAG,UAAU,CAGzC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;AACzC,IAAA,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5E,IAAA,OAAOA,IAAC,KAAK,EAAA,EAAA,GAAK,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC5F,CAAC,EAAE;AAEH,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { UncontrolledNumberInputProps } from './types';
3
+ export declare const UncontrolledNumberInput: import("react").ForwardRefExoticComponent<(UncontrolledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "groupSeparator" | "decimalMark" | "groupSize" | "decimalLength" | "allowNegative">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,29 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { NumberInput } from './NumberInput.js';
5
+ import { useUncontrolledInput } from './useUncontrolledInput.js';
6
+ import '@hh.ru/magritte-common-number-formatter';
7
+ import './Input.js';
8
+ import './BaseInput.js';
9
+ import 'classnames';
10
+ import '@hh.ru/magritte-common-text-selection';
11
+ import '@hh.ru/magritte-common-use-disabled';
12
+ import '@hh.ru/magritte-common-use-multiple-refs';
13
+ import '@hh.ru/magritte-internal-field-hint';
14
+ import '@hh.ru/magritte-ui-action';
15
+ import '@hh.ru/magritte-ui-counter';
16
+ import '@hh.ru/magritte-ui-icon/icon';
17
+ import './useFocus.js';
18
+ import './useInputAriaProps.js';
19
+ import '@hh.ru/magritte-ui-typography';
20
+ import './numberFormatter.js';
21
+
22
+ const UncontrolledNumberInput = forwardRef(({ value, onChange, ...restProps }, ref) => {
23
+ const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);
24
+ return jsx(NumberInput, { ...restProps, value: currentValue, onChange: changeHandler, ref: ref });
25
+ });
26
+ UncontrolledNumberInput.displayName = 'UncontrolledNumberInput';
27
+
28
+ export { UncontrolledNumberInput };
29
+ //# sourceMappingURL=UncontrolledNumberInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UncontrolledNumberInput.js","sources":["../src/UncontrolledNumberInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { NumberInput } from '@hh.ru/magritte-ui-input/NumberInput';\nimport { UncontrolledNumberInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledNumberInput = forwardRef<\n HTMLInputElement,\n UncontrolledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledNumberInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <NumberInput {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledNumberInput.displayName = 'UncontrolledNumberInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;AAMa,MAAA,uBAAuB,GAAG,UAAU,CAG/C,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;AACzC,IAAA,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5E,IAAA,OAAOA,IAAC,WAAW,EAAA,EAAA,GAAK,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAClG,CAAC,EAAE;AAEH,uBAAuB,CAAC,WAAW,GAAG,yBAAyB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { UncontrolledPasswordInputProps } from './types';
3
+ export declare const UncontrolledPasswordInput: import("react").ForwardRefExoticComponent<(UncontrolledPasswordInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,27 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { PasswordInput } from './PasswordInput.js';
5
+ import { useUncontrolledInput } from './useUncontrolledInput.js';
6
+ import '@hh.ru/magritte-common-text-selection';
7
+ import '@hh.ru/magritte-common-use-multiple-refs';
8
+ import '@hh.ru/magritte-ui-icon/icon';
9
+ import './Input.js';
10
+ import './BaseInput.js';
11
+ import 'classnames';
12
+ import '@hh.ru/magritte-common-use-disabled';
13
+ import '@hh.ru/magritte-internal-field-hint';
14
+ import '@hh.ru/magritte-ui-action';
15
+ import '@hh.ru/magritte-ui-counter';
16
+ import './useFocus.js';
17
+ import './useInputAriaProps.js';
18
+ import '@hh.ru/magritte-ui-typography';
19
+
20
+ const UncontrolledPasswordInput = forwardRef(({ value, onChange, ...restProps }, ref) => {
21
+ const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);
22
+ return jsx(PasswordInput, { ...restProps, value: currentValue, onChange: changeHandler, ref: ref });
23
+ });
24
+ UncontrolledPasswordInput.displayName = 'UncontrolledPasswordInput';
25
+
26
+ export { UncontrolledPasswordInput };
27
+ //# sourceMappingURL=UncontrolledPasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UncontrolledPasswordInput.js","sources":["../src/UncontrolledPasswordInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { PasswordInput } from '@hh.ru/magritte-ui-input/PasswordInput';\nimport { UncontrolledPasswordInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledPasswordInput = forwardRef<\n HTMLInputElement,\n UncontrolledPasswordInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledPasswordInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <PasswordInput {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledPasswordInput.displayName = 'UncontrolledPasswordInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAMa,MAAA,yBAAyB,GAAG,UAAU,CAGjD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;AACzC,IAAA,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5E,IAAA,OAAOA,IAAC,aAAa,EAAA,EAAA,GAAK,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACpG,CAAC,EAAE;AAEH,yBAAyB,CAAC,WAAW,GAAG,2BAA2B;;;;"}
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { UncontrolledSearchInputProps } from './types';
3
+ export declare const UncontrolledSearchInput: import("react").ForwardRefExoticComponent<(UncontrolledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "counter" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;