@tap-payments/os-micro-frontend-shared 0.0.76 → 0.0.77
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.
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { type StatusButtonProps } from '../StatusButton/type';
|
|
3
3
|
interface SearchButtonProps extends Omit<StatusButtonProps, 'variant'> {
|
|
4
4
|
onSearchChange?: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function SearchButton({ onSearchChange, ...props }: SearchButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function SearchButton({ onSearchChange, placeholder, ...props }: SearchButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
declare const _default: import("react").MemoExoticComponent<typeof SearchButton>;
|
|
8
9
|
export default _default;
|
|
@@ -17,7 +17,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { Icon, StyledInput, StyledSearchButton, Wrapper } from './styles';
|
|
18
18
|
import { grayCloseIcon, searchBlueIcon } from '../../constants/index.js';
|
|
19
19
|
function SearchButton(_a) {
|
|
20
|
-
var { onSearchChange } = _a, props = __rest(_a, ["onSearchChange"]);
|
|
20
|
+
var { onSearchChange, placeholder } = _a, props = __rest(_a, ["onSearchChange", "placeholder"]);
|
|
21
21
|
const [isInputShown, setIsInputShown] = useState(false);
|
|
22
22
|
const [value, setValue] = useState('');
|
|
23
23
|
const { t } = useTranslation();
|
|
@@ -52,6 +52,6 @@ function SearchButton(_a) {
|
|
|
52
52
|
width: 30,
|
|
53
53
|
border: `1px solid ${theme.palette.divider}`,
|
|
54
54
|
boxShadow: 'none',
|
|
55
|
-
}, placeholder: t('search') || '', onKeyDown: onKeyDown, onChange: onChange }), _jsx(Icon, { style: { right: 48 }, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, src: grayCloseIcon, alt: "close", onClick: onReset }), _jsx(Icon, { style: { right: 9 }, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, src: searchBlueIcon, alt: "search", onClick: onSubmit })] })) }), _jsx(StyledSearchButton, Object.assign({}, props, { variant: isInputShown ? 'active' : 'inActive', icon: "search", onClick: onSearchClick }))] }));
|
|
55
|
+
}, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : (t('search') || ''), onKeyDown: onKeyDown, onChange: onChange }), _jsx(Icon, { style: { right: 48 }, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, src: grayCloseIcon, alt: "close", onClick: onReset }), _jsx(Icon, { style: { right: 9 }, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, src: searchBlueIcon, alt: "search", onClick: onSubmit })] })) }), _jsx(StyledSearchButton, Object.assign({}, props, { variant: isInputShown ? 'active' : 'inActive', icon: "search", onClick: onSearchClick }))] }));
|
|
56
56
|
}
|
|
57
57
|
export default memo(SearchButton);
|
package/package.json
CHANGED