@dropi/react-native-design-system 0.3.5 → 0.3.6

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.
@@ -3,4 +3,5 @@ export declare const Search: import("react").ForwardRefExoticComponent<TextInput
3
3
  filterText: string;
4
4
  setFilterText: (text: string) => void;
5
5
  placeholder?: string;
6
+ secondaryActionOnClear?: () => void;
6
7
  } & import("react").RefAttributes<TextInput>>;
@@ -14,6 +14,7 @@ const Search = exports.Search = /*#__PURE__*/(0, _react.forwardRef)(({
14
14
  filterText,
15
15
  setFilterText,
16
16
  placeholder,
17
+ secondaryActionOnClear,
17
18
  ...rest
18
19
  }, ref) => {
19
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
@@ -53,7 +54,12 @@ const Search = exports.Search = /*#__PURE__*/(0, _react.forwardRef)(({
53
54
  size: "large",
54
55
  variant: "secondary",
55
56
  preIcon: "close-small",
56
- onPress: () => setFilterText(''),
57
+ onPress: () => {
58
+ setFilterText('');
59
+ if (secondaryActionOnClear) {
60
+ secondaryActionOnClear();
61
+ }
62
+ },
57
63
  replaceColor: _constants.colors['Gray-600'].light
58
64
  })]
59
65
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dropi/react-native-design-system",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "A React Native package built from scratch",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",