@pushwoosh/dumb-components 1.1.36 → 1.1.37

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.
@@ -1,3 +1,5 @@
1
- import { type FC } from 'react';
2
- import { type EnhancedInputProps } from './types';
3
- export declare const EnhancedInput: FC<EnhancedInputProps>;
1
+ import React from 'react';
2
+ export declare const EnhancedInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & import("../native/Input").NativeInputProps & {
3
+ $icon?: React.ReactNode;
4
+ $onClear?: () => void;
5
+ } & React.RefAttributes<HTMLInputElement>>;
@@ -1,20 +1,21 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { CloseIcon } from '@pushwoosh/kit-icons';
3
3
  import { Wrapper } from './styles';
4
4
  import { NativeInput } from '../native';
5
- export const EnhancedInput = ({
5
+ export const EnhancedInput = forwardRef(({
6
6
  $icon,
7
7
  $onClear,
8
8
  ...props
9
- }) => {
9
+ }, ref) => {
10
10
  return React.createElement(Wrapper, {
11
11
  "$hasIcon": !!$icon,
12
12
  "$hasClear": !!$onClear,
13
13
  "$hasError": !!props.$isErrored
14
14
  }, $icon, React.createElement(NativeInput, {
15
- ...props
15
+ ...props,
16
+ ref: ref
16
17
  }), $onClear && React.createElement(CloseIcon, {
17
18
  size: "small",
18
19
  onClick: $onClear
19
20
  }));
20
- };
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.36",
3
+ "version": "1.1.37",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",