@hh.ru/magritte-ui-input 6.0.16 → 7.0.1

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.
package/BaseInput.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { BaseInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ declare const BaseInput: import("react").ForwardRefExoticComponent<(BaseInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "inputIcon" | "fixedPlaceholder" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
4
4
  export { BaseInput };
package/BaseInput.js CHANGED
@@ -7,16 +7,15 @@ import { Selection } from '@hh.ru/magritte-common-text-selection';
7
7
  import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
8
8
  import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
9
9
  import { Action } from '@hh.ru/magritte-ui-action';
10
- import { DeprecatedCounter } from '@hh.ru/magritte-ui-counter';
11
10
  import { FormHelper } from '@hh.ru/magritte-ui-form-helper';
12
11
  import { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
13
12
  import { useFocus } from './useFocus.js';
14
13
  import { useInputAriaProps } from './useInputAriaProps.js';
15
14
  import { Text } from '@hh.ru/magritte-ui-typography';
16
15
 
17
- var styles = {"input":"magritte-input___LVTID_6-0-16","label":"magritte-label___YlOQk_6-0-16","elevated":"magritte-elevated___kPcsM_6-0-16","focused":"magritte-focused___dxrHD_6-0-16","invalid":"magritte-invalid___L5MVa_6-0-16","disabled":"magritte-disabled___0NH6E_6-0-16","position-container":"magritte-position-container___kZnvZ_6-0-16","positionContainer":"magritte-position-container___kZnvZ_6-0-16","field":"magritte-field___9S8Tw_6-0-16","hint":"magritte-hint___EFGK0_6-0-16","additional-value":"magritte-additional-value___9Kyap_6-0-16","additionalValue":"magritte-additional-value___9Kyap_6-0-16","label_elevated":"magritte-label_elevated___PVcpC_6-0-16","labelElevated":"magritte-label_elevated___PVcpC_6-0-16","fixed-placeholder":"magritte-fixed-placeholder___PYJIH_6-0-16","fixedPlaceholder":"magritte-fixed-placeholder___PYJIH_6-0-16","icon":"magritte-icon___HEDsQ_6-0-16","focus-visible":"magritte-focus-visible___QvCO1_6-0-16","focusVisible":"magritte-focus-visible___QvCO1_6-0-16","right-container":"magritte-right-container___N0B0o_6-0-16","rightContainer":"magritte-right-container___N0B0o_6-0-16","with-icon":"magritte-with-icon___TPBe2_6-0-16","withIcon":"magritte-with-icon___TPBe2_6-0-16","large":"magritte-large___9frRh_6-0-16","autofill-helper":"magritte-autofill-helper___WFjOW_6-0-16","autofillHelper":"magritte-autofill-helper___WFjOW_6-0-16","content-container":"magritte-content-container___s-0kX_6-0-16","contentContainer":"magritte-content-container___s-0kX_6-0-16","rigging-container":"magritte-rigging-container___Up9Lb_6-0-16","riggingContainer":"magritte-rigging-container___Up9Lb_6-0-16","input__mask":"magritte-input__mask___CHda2_6-0-16","inputMask":"magritte-input__mask___CHda2_6-0-16","value-ghost":"magritte-value-ghost___IXNZj_6-0-16","valueGhost":"magritte-value-ghost___IXNZj_6-0-16","hint-container":"magritte-hint-container___rGsD8_6-0-16","hintContainer":"magritte-hint-container___rGsD8_6-0-16","with-right":"magritte-with-right___NUNiP_6-0-16","withRight":"magritte-with-right___NUNiP_6-0-16","counter":"magritte-counter___Bld3Q_6-0-16","value-container":"magritte-value-container___6ReT7_6-0-16","valueContainer":"magritte-value-container___6ReT7_6-0-16"};
16
+ var styles = {"input":"magritte-input___LVTID_7-0-1","label":"magritte-label___YlOQk_7-0-1","elevated":"magritte-elevated___kPcsM_7-0-1","focused":"magritte-focused___dxrHD_7-0-1","invalid":"magritte-invalid___L5MVa_7-0-1","disabled":"magritte-disabled___0NH6E_7-0-1","position-container":"magritte-position-container___kZnvZ_7-0-1","positionContainer":"magritte-position-container___kZnvZ_7-0-1","field":"magritte-field___9S8Tw_7-0-1","hint":"magritte-hint___EFGK0_7-0-1","additional-value":"magritte-additional-value___9Kyap_7-0-1","additionalValue":"magritte-additional-value___9Kyap_7-0-1","label_elevated":"magritte-label_elevated___PVcpC_7-0-1","labelElevated":"magritte-label_elevated___PVcpC_7-0-1","fixed-placeholder":"magritte-fixed-placeholder___PYJIH_7-0-1","fixedPlaceholder":"magritte-fixed-placeholder___PYJIH_7-0-1","icon":"magritte-icon___HEDsQ_7-0-1","focus-visible":"magritte-focus-visible___QvCO1_7-0-1","focusVisible":"magritte-focus-visible___QvCO1_7-0-1","right-container":"magritte-right-container___N0B0o_7-0-1","rightContainer":"magritte-right-container___N0B0o_7-0-1","with-icon":"magritte-with-icon___TPBe2_7-0-1","withIcon":"magritte-with-icon___TPBe2_7-0-1","large":"magritte-large___9frRh_7-0-1","autofill-helper":"magritte-autofill-helper___WFjOW_7-0-1","autofillHelper":"magritte-autofill-helper___WFjOW_7-0-1","content-container":"magritte-content-container___s-0kX_7-0-1","contentContainer":"magritte-content-container___s-0kX_7-0-1","rigging-container":"magritte-rigging-container___Up9Lb_7-0-1","riggingContainer":"magritte-rigging-container___Up9Lb_7-0-1","input__mask":"magritte-input__mask___CHda2_7-0-1","inputMask":"magritte-input__mask___CHda2_7-0-1","value-ghost":"magritte-value-ghost___IXNZj_7-0-1","valueGhost":"magritte-value-ghost___IXNZj_7-0-1","hint-container":"magritte-hint-container___rGsD8_7-0-1","hintContainer":"magritte-hint-container___rGsD8_7-0-1","with-right":"magritte-with-right___NUNiP_7-0-1","withRight":"magritte-with-right___NUNiP_7-0-1","counter":"magritte-counter___Bld3Q_7-0-1","value-container":"magritte-value-container___6ReT7_7-0-1","valueContainer":"magritte-value-container___6ReT7_7-0-1"};
18
17
 
19
- 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) => {
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, fixedPlaceholder, maxLength, hint, showHintAlways = false, ...restProps }, ref) => {
20
19
  const wrapperCurrentRef = useRef(null);
21
20
  const inputRef = useRef(null);
22
21
  const [isActionVisible, setActionVisible] = useState(false);
@@ -118,11 +117,11 @@ const BaseInputComponent = ({ onChange, onFocus, onBlur, value, placeholder, dis
118
117
  [styles.large]: size === 'large',
119
118
  [styles.elevated]: placeholderCanElevated,
120
119
  [styles.invalid]: !!invalid,
121
- [styles.withRight]: !!buttonIcon || showClearButton || counter,
120
+ [styles.withRight]: !!buttonIcon || showClearButton,
122
121
  [styles.withIcon]: !!inputIcon,
123
122
  }), onFocus: clearableOnFocus ? handleWrapperFocus : undefined, onBlur: clearableOnFocus ? handleWrapperBlur : undefined, onClick: onClickWrapper, "data-interactive": true, children: [jsxs("div", { className: styles.positionContainer, children: [jsxs("div", { className: styles.hintContainer, children: [jsx("div", { className: styles.autofillHelper }), 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, {
124
123
  [styles.labelElevated]: placeholderIsElevated,
125
- }), 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(DeprecatedCounter, { label: counter }) }))] }))] }), jsx(FormHelper, { description: description, errorMessage: errorMessage, descriptionId: ariaProps['aria-describedby'], disabled: isComponentDisabled, invalid: invalid })] }));
124
+ }), 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) && (jsx("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 })) }))] }), jsx(FormHelper, { description: description, errorMessage: errorMessage, descriptionId: ariaProps['aria-describedby'], disabled: isComponentDisabled, invalid: invalid })] }));
126
125
  };
127
126
  const BaseInput = forwardRef(BaseInputComponent);
128
127
  BaseInput.displayName = 'BaseInput';
package/BaseInput.js.map CHANGED
@@ -1 +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 MouseEventHandler,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { isEventFromInteractiveComponent } from '@hh.ru/magritte-common-mouse';\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 { Action } from '@hh.ru/magritte-ui-action';\nimport { DeprecatedCounter } from '@hh.ru/magritte-ui-counter';\nimport { FormHelper } from '@hh.ru/magritte-ui-form-helper';\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 onClickWrapper: MouseEventHandler = (e) => {\n if (!isEventFromInteractiveComponent(e)) {\n inputRef.current?.focus();\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 disable-autofix/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,\n [styles.withRight]: !!buttonIcon || showClearButton || counter,\n [styles.withIcon]: !!inputIcon,\n })}\n onFocus={clearableOnFocus ? handleWrapperFocus : undefined}\n onBlur={clearableOnFocus ? handleWrapperBlur : undefined}\n onClick={onClickWrapper}\n data-interactive={true}\n >\n <div className={styles.positionContainer}>\n <div className={styles.hintContainer}>\n <div className={styles.autofillHelper} />\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 <DeprecatedCounter label={counter} />\n </span>\n )}\n </div>\n )}\n </div>\n <FormHelper\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\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":";;;;;;;;;;;;;;;;;AA8BA,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,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,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,cAAc,EAChC,QAAA,EAAA,CAAA,CAAC,UAAU,IAAI,eAAe,MAC3BC,IAAC,MAAM,EAAA,EAAA,SAAA,EACM,aAAa,EACtB,IAAI,EAAC,WAAW,EAChB,WAAW,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,EAAE,EAC9C,OAAO,EAAE,eAAe,GAAG,iBAAiB,GAAI,aAA4B,EAC5E,IAAI,EACA,eAAe,GAAG,mBAAmB,GAAI,UAAyC,EAEtF,QAAQ,EAAE,mBAAmB,EAC7B,GAAG,EAAE,SAAS,GAChB,CACL,EACA,OAAO,KACJA,cAAM,SAAS,EAAE,MAAM,CAAC,OAAO,EAC3B,QAAA,EAAAA,GAAA,CAAC,iBAAiB,EAAC,EAAA,KAAK,EAAE,OAAO,EAAA,CAAI,GAClC,CACV,CAAA,EAAA,CACC,CACT,CACC,EAAA,CAAA,EACNA,IAAC,UAAU,EAAA,EACP,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,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;;;;"}
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 MouseEventHandler,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { isEventFromInteractiveComponent } from '@hh.ru/magritte-common-mouse';\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 { Action } from '@hh.ru/magritte-ui-action';\nimport { FormHelper } from '@hh.ru/magritte-ui-form-helper';\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 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 onClickWrapper: MouseEventHandler = (e) => {\n if (!isEventFromInteractiveComponent(e)) {\n inputRef.current?.focus();\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 disable-autofix/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,\n [styles.withRight]: !!buttonIcon || showClearButton,\n [styles.withIcon]: !!inputIcon,\n })}\n onFocus={clearableOnFocus ? handleWrapperFocus : undefined}\n onBlur={clearableOnFocus ? handleWrapperBlur : undefined}\n onClick={onClickWrapper}\n data-interactive={true}\n >\n <div className={styles.positionContainer}>\n <div className={styles.hintContainer}>\n <div className={styles.autofillHelper} />\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) && (\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 </div>\n )}\n </div>\n <FormHelper\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\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":";;;;;;;;;;;;;;;;AA6BA,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,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,cAAc,GAAG,KAAK,EACtB,GAA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G,EAAE,sBAAsB,EAAA,SAAA,EAAU,YAAY,EAAA,QAAA,EAC1EA,IAAC,IAAI,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,iBAAiB,EAAA,QAAA,EAC7CA,cAAM,GAAG,EAAE,OAAO,EAAA,QAAA,EAAG,IAAI,EAAQ,CAAA,EAAA,CAC9B,EACL,CAAA,CACT,IACC,EACL,CAAC,UAAU,IAAI,eAAe,MAC3BA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,cAAc,YAChC,CAAC,UAAU,IAAI,eAAe,MAC3BA,IAAC,MAAM,EAAA,EAAA,SAAA,EACM,aAAa,EACtB,IAAI,EAAC,WAAW,EAChB,WAAW,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,EAAE,EAC9C,OAAO,EAAE,eAAe,GAAG,iBAAiB,GAAI,aAA4B,EAC5E,IAAI,EACA,eAAe,GAAG,mBAAmB,GAAI,UAAyC,EAEtF,QAAQ,EAAE,mBAAmB,EAC7B,GAAG,EAAE,SAAS,EAChB,CAAA,CACL,GACC,CACT,CAAA,EAAA,CACC,EACNA,GAAA,CAAC,UAAU,EACP,EAAA,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,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;;;;"}
package/DateTimeInput.js CHANGED
@@ -10,12 +10,11 @@ import '@hh.ru/magritte-common-mouse';
10
10
  import '@hh.ru/magritte-common-text-selection';
11
11
  import '@hh.ru/magritte-common-use-disabled';
12
12
  import '@hh.ru/magritte-ui-action';
13
- import '@hh.ru/magritte-ui-counter';
14
13
  import '@hh.ru/magritte-ui-form-helper';
15
14
  import './useFocus.js';
16
15
  import './useInputAriaProps.js';
17
16
  import '@hh.ru/magritte-ui-typography';
18
- import './index.esm-B9YRf7M2.js';
17
+ import './index.esm-DNp-bcrK.js';
19
18
 
20
19
  const DateTimeInput = forwardRef(({ dateMask, timeMask, timeRounding, onButtonClick, hideMask, ...restProps }, ref) => {
21
20
  const maskedInputRef = useDateTimeMask(dateMask, timeMask, timeRounding);
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeInput.js","sources":["../src/DateTimeInput.tsx"],"sourcesContent":["import { InputHTMLAttributes, forwardRef, useMemo, FocusEventHandler } 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, hideMask, ...restProps }, ref) => {\n const maskedInputRef = useDateTimeMask(dateMask, timeMask, timeRounding);\n const inputRef = useMultipleRefs(maskedInputRef, ref);\n\n const onBlur: FocusEventHandler<HTMLInputElement> | undefined =\n dateMask === 'dd'\n ? (e) => {\n if (restProps.value.length === 1) {\n if (restProps.value === '0') {\n restProps.onChange('');\n } else {\n restProps.onChange(restProps.value.padStart(2, '0'));\n }\n }\n restProps.onBlur?.(e);\n }\n : restProps.onBlur;\n\n const maskedPlaceholder = useMemo(() => {\n if (hideMask) {\n return undefined;\n }\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, hideMask]);\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 onBlur={onBlur}\n />\n );\n});\n\nDateTimeInput.displayName = 'DateTimeInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAQa,MAAA,aAAa,GAAG,UAAU,CAGrC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;IACnF,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,MAAM,GACR,QAAQ,KAAK,IAAI;AACb,UAAE,CAAC,CAAC,KAAI;AACF,YAAA,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9B,gBAAA,IAAI,SAAS,CAAC,KAAK,KAAK,GAAG,EAAE;AACzB,oBAAA,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC1B,iBAAA;AAAM,qBAAA;AACH,oBAAA,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACxD,iBAAA;AACJ,aAAA;AACD,YAAA,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACzB;AACH,UAAE,SAAS,CAAC,MAAM,CAAC;AAE3B,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAK;AACnC,QAAA,IAAI,QAAQ,EAAE;AACV,YAAA,OAAO,SAAS,CAAC;AACpB,SAAA;QACD,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;KAC3B,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnC,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,EAClB,MAAM,EAAE,MAAM,EAAA,CAChB,EACJ;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
1
+ {"version":3,"file":"DateTimeInput.js","sources":["../src/DateTimeInput.tsx"],"sourcesContent":["import { InputHTMLAttributes, forwardRef, useMemo, FocusEventHandler } 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, hideMask, ...restProps }, ref) => {\n const maskedInputRef = useDateTimeMask(dateMask, timeMask, timeRounding);\n const inputRef = useMultipleRefs(maskedInputRef, ref);\n\n const onBlur: FocusEventHandler<HTMLInputElement> | undefined =\n dateMask === 'dd'\n ? (e) => {\n if (restProps.value.length === 1) {\n if (restProps.value === '0') {\n restProps.onChange('');\n } else {\n restProps.onChange(restProps.value.padStart(2, '0'));\n }\n }\n restProps.onBlur?.(e);\n }\n : restProps.onBlur;\n\n const maskedPlaceholder = useMemo(() => {\n if (hideMask) {\n return undefined;\n }\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, hideMask]);\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 onBlur={onBlur}\n />\n );\n});\n\nDateTimeInput.displayName = 'DateTimeInput';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;AAQa,MAAA,aAAa,GAAG,UAAU,CAGrC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAA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,CAAC,IAAI,CAAC,CAAC;KAC3B,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnC,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,EAClB,MAAM,EAAE,MAAM,EAAA,CAChB,EACJ;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
package/Input.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { ControlledInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ declare const Input: import("react").ForwardRefExoticComponent<(ControlledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
4
4
  export { Input };
package/Input.js CHANGED
@@ -8,7 +8,6 @@ import '@hh.ru/magritte-common-text-selection';
8
8
  import '@hh.ru/magritte-common-use-disabled';
9
9
  import '@hh.ru/magritte-common-use-multiple-refs';
10
10
  import '@hh.ru/magritte-ui-action';
11
- import '@hh.ru/magritte-ui-counter';
12
11
  import '@hh.ru/magritte-ui-form-helper';
13
12
  import '@hh.ru/magritte-ui-icon/icon';
14
13
  import './useFocus.js';
package/Input.js.map CHANGED
@@ -1 +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;;;;"}
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;;;;"}
package/NumberInput.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { ControlledNumberInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<(ControlledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "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 CHANGED
@@ -11,7 +11,6 @@ import '@hh.ru/magritte-common-text-selection';
11
11
  import '@hh.ru/magritte-common-use-disabled';
12
12
  import '@hh.ru/magritte-common-use-multiple-refs';
13
13
  import '@hh.ru/magritte-ui-action';
14
- import '@hh.ru/magritte-ui-counter';
15
14
  import '@hh.ru/magritte-ui-form-helper';
16
15
  import '@hh.ru/magritte-ui-icon/icon';
17
16
  import './useFocus.js';
@@ -1 +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;;;;"}
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;;;;"}
package/PasswordInput.js CHANGED
@@ -10,7 +10,6 @@ import 'classnames';
10
10
  import '@hh.ru/magritte-common-mouse';
11
11
  import '@hh.ru/magritte-common-use-disabled';
12
12
  import '@hh.ru/magritte-ui-action';
13
- import '@hh.ru/magritte-ui-counter';
14
13
  import '@hh.ru/magritte-ui-form-helper';
15
14
  import './useFocus.js';
16
15
  import './useInputAriaProps.js';
@@ -1 +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;;;;"}
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;;;;"}
package/SearchInput.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { ControlledSearchInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ export declare const SearchInput: import("react").ForwardRefExoticComponent<(ControlledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;
package/SearchInput.js CHANGED
@@ -9,7 +9,6 @@ import '@hh.ru/magritte-common-text-selection';
9
9
  import '@hh.ru/magritte-common-use-disabled';
10
10
  import '@hh.ru/magritte-common-use-multiple-refs';
11
11
  import '@hh.ru/magritte-ui-action';
12
- import '@hh.ru/magritte-ui-counter';
13
12
  import '@hh.ru/magritte-ui-form-helper';
14
13
  import './useFocus.js';
15
14
  import './useInputAriaProps.js';
@@ -1 +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;;;;"}
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;;;;"}
@@ -11,13 +11,12 @@ import '@hh.ru/magritte-common-mouse';
11
11
  import '@hh.ru/magritte-common-text-selection';
12
12
  import '@hh.ru/magritte-common-use-disabled';
13
13
  import '@hh.ru/magritte-ui-action';
14
- import '@hh.ru/magritte-ui-counter';
15
14
  import '@hh.ru/magritte-ui-form-helper';
16
15
  import './useFocus.js';
17
16
  import './useInputAriaProps.js';
18
17
  import '@hh.ru/magritte-ui-typography';
19
18
  import './useDateTimeMask.js';
20
- import './index.esm-B9YRf7M2.js';
19
+ import './index.esm-DNp-bcrK.js';
21
20
 
22
21
  const UncontrolledDateTimeInput = forwardRef(({ value, onChange, ...restProps }, ref) => {
23
22
  const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);
@@ -1 +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;;;;"}
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;;;;"}
@@ -1,3 +1,3 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { UncontrolledInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ export declare const UncontrolledInput: import("react").ForwardRefExoticComponent<(UncontrolledInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -10,7 +10,6 @@ import '@hh.ru/magritte-common-text-selection';
10
10
  import '@hh.ru/magritte-common-use-disabled';
11
11
  import '@hh.ru/magritte-common-use-multiple-refs';
12
12
  import '@hh.ru/magritte-ui-action';
13
- import '@hh.ru/magritte-ui-counter';
14
13
  import '@hh.ru/magritte-ui-form-helper';
15
14
  import '@hh.ru/magritte-ui-icon/icon';
16
15
  import './useFocus.js';
@@ -1 +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;;;;"}
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;;;;"}
@@ -1,3 +1,3 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { UncontrolledNumberInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ export declare const UncontrolledNumberInput: import("react").ForwardRefExoticComponent<(UncontrolledNumberInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "hint" | "showHintAlways" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "groupSeparator" | "decimalMark" | "groupSize" | "decimalLength" | "allowNegative">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -12,7 +12,6 @@ import '@hh.ru/magritte-common-text-selection';
12
12
  import '@hh.ru/magritte-common-use-disabled';
13
13
  import '@hh.ru/magritte-common-use-multiple-refs';
14
14
  import '@hh.ru/magritte-ui-action';
15
- import '@hh.ru/magritte-ui-counter';
16
15
  import '@hh.ru/magritte-ui-form-helper';
17
16
  import '@hh.ru/magritte-ui-icon/icon';
18
17
  import './useFocus.js';
@@ -1 +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;;;;"}
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;;;;"}
@@ -12,7 +12,6 @@ import 'classnames';
12
12
  import '@hh.ru/magritte-common-mouse';
13
13
  import '@hh.ru/magritte-common-use-disabled';
14
14
  import '@hh.ru/magritte-ui-action';
15
- import '@hh.ru/magritte-ui-counter';
16
15
  import '@hh.ru/magritte-ui-form-helper';
17
16
  import './useFocus.js';
18
17
  import './useInputAriaProps.js';
@@ -1 +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;;;;"}
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;;;;"}
@@ -1,3 +1,3 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { UncontrolledSearchInputProps } from '@hh.ru/magritte-ui-input/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>>;
3
+ export declare const UncontrolledSearchInput: import("react").ForwardRefExoticComponent<(UncontrolledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "elevatePlaceholder" | "clearable" | "clearableOnFocus" | "buttonIcon" | "onButtonClick" | "invalid" | "placeholder" | "postfix" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "formatter" | "buttonDataQa" | "buttonRef" | "wrapperRef" | "maxLength" | "onChange" | "value" | "type">) & import("react").RefAttributes<HTMLInputElement>>;
@@ -11,7 +11,6 @@ import '@hh.ru/magritte-common-text-selection';
11
11
  import '@hh.ru/magritte-common-use-disabled';
12
12
  import '@hh.ru/magritte-common-use-multiple-refs';
13
13
  import '@hh.ru/magritte-ui-action';
14
- import '@hh.ru/magritte-ui-counter';
15
14
  import '@hh.ru/magritte-ui-form-helper';
16
15
  import './useFocus.js';
17
16
  import './useInputAriaProps.js';
@@ -1 +1 @@
1
- {"version":3,"file":"UncontrolledSearchInput.js","sources":["../src/UncontrolledSearchInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { SearchInput } from '@hh.ru/magritte-ui-input/SearchInput';\nimport { UncontrolledSearchInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledSearchInput = forwardRef<\n HTMLInputElement,\n UncontrolledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledSearchInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <SearchInput {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledSearchInput.displayName = 'UncontrolledSearchInput';\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;;;;"}
1
+ {"version":3,"file":"UncontrolledSearchInput.js","sources":["../src/UncontrolledSearchInput.tsx"],"sourcesContent":["import { forwardRef, InputHTMLAttributes } from 'react';\n\nimport { SearchInput } from '@hh.ru/magritte-ui-input/SearchInput';\nimport { UncontrolledSearchInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useUncontrolledInput } from '@hh.ru/magritte-ui-input/useUncontrolledInput';\n\nexport const UncontrolledSearchInput = forwardRef<\n HTMLInputElement,\n UncontrolledSearchInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof UncontrolledSearchInputProps>\n>(({ value, onChange, ...restProps }, ref) => {\n const [currentValue, changeHandler] = useUncontrolledInput(value, onChange);\n return <SearchInput {...restProps} value={currentValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledSearchInput.displayName = 'UncontrolledSearchInput';\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;;;;"}