@synerise/ds-search 1.5.8 → 1.5.10

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 (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +47 -42
  3. package/dist/Elements/SearchButton/SearchButton.d.ts +2 -2
  4. package/dist/Elements/SearchButton/SearchButton.js +16 -28
  5. package/dist/Elements/SearchButton/SearchButton.types.js +1 -1
  6. package/dist/Elements/SearchHeader/SearchHeader.d.ts +2 -2
  7. package/dist/Elements/SearchHeader/SearchHeader.js +15 -15
  8. package/dist/Elements/SearchHeader/SearchHeader.types.js +1 -1
  9. package/dist/Elements/SearchInput/SearchInput.d.ts +2 -2
  10. package/dist/Elements/SearchInput/SearchInput.js +74 -117
  11. package/dist/Elements/SearchInput/SearchInput.types.d.ts +3 -3
  12. package/dist/Elements/SearchInput/SearchInput.types.js +1 -1
  13. package/dist/Elements/SearchItems/SearchItems.d.ts +2 -2
  14. package/dist/Elements/SearchItems/SearchItems.js +54 -58
  15. package/dist/Elements/SearchItems/SearchItems.types.d.ts +1 -1
  16. package/dist/Elements/SearchItems/SearchItems.types.js +1 -1
  17. package/dist/Elements/SearchRenderer/SearchRenderer.d.ts +1 -1
  18. package/dist/Elements/SearchRenderer/SearchRenderer.js +22 -33
  19. package/dist/Elements/SearchRenderer/SearchRenderer.types.d.ts +2 -2
  20. package/dist/Elements/SearchRenderer/SearchRenderer.types.js +1 -1
  21. package/dist/Elements/index.js +12 -4
  22. package/dist/Elements/utils/searchUtils.d.ts +1 -1
  23. package/dist/Elements/utils/searchUtils.js +16 -17
  24. package/dist/Search.d.ts +2 -3
  25. package/dist/Search.js +145 -230
  26. package/dist/Search.styles.d.ts +15 -15
  27. package/dist/Search.styles.js +59 -62
  28. package/dist/Search.types.d.ts +4 -4
  29. package/dist/Search.types.js +8 -7
  30. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  31. package/dist/const.js +16 -7
  32. package/dist/index.js +14 -2
  33. package/dist/modules.d.js +1 -1
  34. package/dist/modules.d.ts +0 -0
  35. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.5.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@1.5.9...@synerise/ds-search@1.5.10) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-search
9
+
10
+ ## [1.5.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@1.5.8...@synerise/ds-search@1.5.9) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-search
13
+
6
14
  ## [1.5.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@1.5.7...@synerise/ds-search@1.5.8) (2026-03-09)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-search
package/README.md CHANGED
@@ -8,14 +8,12 @@ Search UI Component
8
8
  ## Installation
9
9
 
10
10
  ```
11
- npm i @synerise/ds-search
12
- or
13
- yarn add @synerise/ds-search
11
+ pnpm add @synerise/ds-search
14
12
  ```
15
13
 
16
14
  ## Usage
17
15
 
18
- ```
16
+ ```tsx
19
17
  import Search from '@synerise/ds-search';
20
18
 
21
19
  const parameters = [
@@ -116,6 +114,7 @@ return (
116
114
  | searchWidth | Width of the search input when expanded | number | - |
117
115
  | dropdownWidth | Width of the suggestions dropdown. Will match search input if undefined | number | - |
118
116
  | alwaysExpanded | Enable expanded input on Search component with dropdown | boolean / undefined | - |
117
+ | searchTooltipProps | Props forwarded to the Tooltip wrapping the search input | TooltipProps | - |
119
118
 
120
119
  ### DataSetProps
121
120
 
@@ -126,27 +125,29 @@ return (
126
125
  | rowHeight | Height of item in the list | number | - |
127
126
  | title | Title of the item list | string | - |
128
127
  | tooltip | Tooltip of the item list, displayed when hovering on the icon next to the title | string | - |
129
- | visibleRows | Number of rows visible in the list | string | - |
128
+ | visibleRows | Number of rows visible in the list | number | - |
130
129
 
131
130
  ## Search usage
132
131
 
133
- ```
134
- import { SearchInput } from '@synerise/ds-search/dist/Elements';
132
+ ```tsx
133
+ import { SearchInput } from '@synerise/ds-search';
135
134
 
136
- const [value, setValue] = React.useState<string>('');
137
- <SearchInput
138
- clearTooltip="Clear"
139
- placeholder="Search"
140
- onValueChange={value => {
141
- console.log(value);
142
- setValue(value);
143
- }}
144
- value={value}
145
- onClear={() => {
146
- console.log('Cleared!');
147
- }}
148
- closeOnClickOutside={true}
149
- />
135
+ const [value, setValue] = React.useState<string>('');
136
+ return (
137
+ <SearchInput
138
+ clearTooltip="Clear"
139
+ placeholder="Search"
140
+ onChange={value => {
141
+ console.log(value);
142
+ setValue(value);
143
+ }}
144
+ value={value}
145
+ onClear={() => {
146
+ console.log('Cleared!');
147
+ }}
148
+ closeOnClickOutside={true}
149
+ />
150
+ );
150
151
  ```
151
152
 
152
153
  ### SearchInput
@@ -155,40 +156,44 @@ import { SearchInput } from '@synerise/ds-search/dist/Elements';
155
156
  | ------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------- |
156
157
  | alwaysHighlight | When set, the input always has blue border when expanded | boolean | `false` |
157
158
  | alwaysExpanded | Boolean value to force expanded state of the input | boolean | `false` |
158
- | clearTooltip | Clear button tooltip text | string | - |
159
+ | clearTooltip | Clear button tooltip text | ReactNode | - |
159
160
  | closeOnClickOutside | Boolean value to prevent / force toggling the input when clicking outside | boolean | `false` |
160
- | filterLabel | Label displayed on the left-hand side of the input caret | object | - |
161
- | focusTrigger | Boolean value for triggering focus on the input | boolean | - |
161
+ | disabled | Disables the entire component including the search button | boolean | - |
162
+ | disableInput | Disables only the text input; search button remains active | boolean | - |
163
+ | filterLabel | Label displayed on the left-hand side of the input caret | `{ icon?: ReactNode; [key: string]: any }` or null | - |
164
+ | focusTrigger | Toggle this boolean to imperatively focus the input | boolean | - |
162
165
  | inputProps | Props object passed to the input element of the component | [InputProps](https://design.synerise.com/docs/components/input/#input-1) | - |
163
- | onValueChange | Callback when input changes | function | - |
166
+ | moveCursorToEnd | Moves caret to end of value when toggled | boolean | - |
167
+ | onChange | Callback when input changes | `(value: string) => void` | - |
164
168
  | onButtonClick | Callback executed when clicking search button | function | - |
165
169
  | onClear | Callback after clicking clear button | function | - |
166
170
  | onClick | Callback executed when clicking inside an input | function | - |
167
171
  | onKeyDown | Callback executed when pressing a keyboard key. | function | - |
168
172
  | onToggle | Callback executed when expanding / narrowing the input wrapper | function | - |
169
173
  | placeholder | Input placeholder | string | - |
170
- | toggleTrigger | Boolean value for triggering expanding / narrowing the input | boolean | - |
174
+ | searchTooltipProps | Props forwarded to the Tooltip wrapping the input | Partial<TooltipProps> | `{}` |
175
+ | toggleTrigger | Toggle this boolean to imperatively expand / collapse the input | boolean | - |
171
176
  | value | The input content value | string | - |
172
177
 
173
178
  ### SearchInput usage
174
179
 
175
- ```
176
- import { SearchInput } from '@synerise/ds-search/dist/Elements';
180
+ ```tsx
181
+ import { SearchInput } from '@synerise/ds-search';
177
182
 
178
183
  const [value, setValue] = React.useState<string>('');
179
184
  return (
180
- <SearchInput
181
- clearTooltip="Clear"
182
- placeholder="Search"
183
- onValueChange={value => {
184
- console.log(value);
185
- setValue(value);
186
- }}
187
- value={value}
188
- onClear={() => {
189
- console.log('Cleared!');
190
- }}
191
- closeOnClickOutside={true}
192
- />
193
- )
185
+ <SearchInput
186
+ clearTooltip="Clear"
187
+ placeholder="Search"
188
+ onChange={value => {
189
+ console.log(value);
190
+ setValue(value);
191
+ }}
192
+ value={value}
193
+ onClear={() => {
194
+ console.log('Cleared!');
195
+ }}
196
+ closeOnClickOutside={true}
197
+ />
198
+ );
194
199
  ```
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SearchButtonProps } from './SearchButton.types';
1
+ import { default as React } from 'react';
2
+ import { SearchButtonProps } from './SearchButton.types';
3
3
  declare const SearchButton: React.FC<SearchButtonProps>;
4
4
  export default SearchButton;
@@ -1,29 +1,17 @@
1
- import React from 'react';
2
- import Button from '@synerise/ds-button';
3
- import Icon, { SearchM } from '@synerise/ds-icon';
4
- import * as S from '../../Search.styles';
5
- var SearchButton = function SearchButton(_ref) {
6
- var inputOpen = _ref.inputOpen,
7
- hidden = _ref.hidden,
8
- onClick = _ref.onClick,
9
- inputFocused = _ref.inputFocused,
10
- clickable = _ref.clickable,
11
- disabled = _ref.disabled;
12
- return /*#__PURE__*/React.createElement(S.SearchButton, {
13
- isOpen: inputOpen,
14
- hidden: hidden,
15
- className: "SearchButton",
16
- inputFocused: inputFocused,
17
- clickable: !disabled && clickable,
18
- onClick: onClick
19
- }, /*#__PURE__*/React.createElement(Button, {
20
- mode: "single-icon",
21
- type: "ghost",
22
- disabled: disabled,
23
- className: inputOpen ? 'btn-search-open' : 'btn-search',
24
- "data-testid": "btn"
25
- }, /*#__PURE__*/React.createElement(Icon, {
26
- component: /*#__PURE__*/React.createElement(SearchM, null)
27
- })));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import Button from "@synerise/ds-button";
3
+ import Icon, { SearchM } from "@synerise/ds-icon";
4
+ import { SearchButton as SearchButton$1 } from "../../Search.styles.js";
5
+ const SearchButton = ({
6
+ inputOpen,
7
+ hidden,
8
+ onClick,
9
+ inputFocused,
10
+ clickable,
11
+ disabled
12
+ }) => {
13
+ return /* @__PURE__ */ jsx(SearchButton$1, { isOpen: inputOpen, hidden, className: "SearchButton", inputFocused, clickable: !disabled && clickable, onClick, children: /* @__PURE__ */ jsx(Button, { mode: "single-icon", type: "ghost", disabled, className: inputOpen ? "btn-search-open" : "btn-search", "data-testid": "btn", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(SearchM, {}) }) }) });
14
+ };
15
+ export {
16
+ SearchButton as default
28
17
  };
29
- export default SearchButton;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SearchHeaderProps } from './SearchHeader.types';
1
+ import { default as React } from 'react';
2
+ import { SearchHeaderProps } from './SearchHeader.types';
3
3
  declare const SearchHeader: React.FC<SearchHeaderProps>;
4
4
  export default SearchHeader;
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import Icon, { InfoFillS } from '@synerise/ds-icon';
3
- import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
4
- import * as S from '../../Search.styles';
5
- var SearchHeader = function SearchHeader(_ref) {
6
- var headerText = _ref.headerText,
7
- tooltip = _ref.tooltip;
8
- return /*#__PURE__*/React.createElement(S.MenuHeader, null, headerText, tooltip && /*#__PURE__*/React.createElement(Tooltip, {
9
- type: "default",
10
- trigger: "hover",
11
- title: tooltip || headerText
12
- }, /*#__PURE__*/React.createElement(S.HeaderIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
13
- component: /*#__PURE__*/React.createElement(InfoFillS, null)
14
- }))));
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import Icon, { InfoFillS } from "@synerise/ds-icon";
3
+ import Tooltip from "@synerise/ds-tooltip/dist/Tooltip";
4
+ import { MenuHeader, HeaderIconWrapper } from "../../Search.styles.js";
5
+ const SearchHeader = ({
6
+ headerText,
7
+ tooltip
8
+ }) => {
9
+ return /* @__PURE__ */ jsxs(MenuHeader, { children: [
10
+ headerText,
11
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { type: "default", trigger: "hover", title: tooltip || headerText, children: /* @__PURE__ */ jsx(HeaderIconWrapper, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(InfoFillS, {}) }) }) })
12
+ ] });
13
+ };
14
+ export {
15
+ SearchHeader as default
15
16
  };
16
- export default SearchHeader;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SearchInputProps } from './SearchInput.types';
1
+ import { default as React } from 'react';
2
+ import { SearchInputProps } from './SearchInput.types';
3
3
  declare const SearchInput: ({ alwaysExpanded, alwaysHighlight, clearTooltip, filterLabel, filterLookupKey, onKeyDown, onClick, onChange, onClear, onToggle, onButtonClick, moveCursorToEnd, placeholder, textLookupKey, value, closeOnClickOutside, disableInput, disabled, focusTrigger, toggleTrigger, inputProps, searchTooltipProps, }: SearchInputProps) => React.JSX.Element;
4
4
  export default SearchInput;
@@ -1,158 +1,115 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import Input from 'antd/lib/input';
3
- import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
4
- import { theme } from '@synerise/ds-core';
5
- import Icon, { Close3M } from '@synerise/ds-icon';
6
- import Tooltip from '@synerise/ds-tooltip';
7
- import { useOnClickOutside, usePrevious } from '@synerise/ds-utils';
8
- import * as S from '../../Search.styles';
9
- import SearchButton from '../SearchButton/SearchButton';
10
- var SearchInput = function SearchInput(_ref) {
11
- var alwaysExpanded = _ref.alwaysExpanded,
12
- alwaysHighlight = _ref.alwaysHighlight,
13
- clearTooltip = _ref.clearTooltip,
14
- filterLabel = _ref.filterLabel,
15
- filterLookupKey = _ref.filterLookupKey,
16
- onKeyDown = _ref.onKeyDown,
17
- onClick = _ref.onClick,
18
- onChange = _ref.onChange,
19
- onClear = _ref.onClear,
20
- onToggle = _ref.onToggle,
21
- onButtonClick = _ref.onButtonClick,
22
- moveCursorToEnd = _ref.moveCursorToEnd,
23
- placeholder = _ref.placeholder,
24
- textLookupKey = _ref.textLookupKey,
25
- value = _ref.value,
26
- closeOnClickOutside = _ref.closeOnClickOutside,
27
- disableInput = _ref.disableInput,
28
- disabled = _ref.disabled,
29
- focusTrigger = _ref.focusTrigger,
30
- toggleTrigger = _ref.toggleTrigger,
31
- _ref$inputProps = _ref.inputProps,
32
- inputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
33
- _ref$searchTooltipPro = _ref.searchTooltipProps,
34
- searchTooltipProps = _ref$searchTooltipPro === void 0 ? {} : _ref$searchTooltipPro;
35
- var inputRef = useRef(null);
36
- var wrapperRef = useRef(null);
37
- var _useState = useState(alwaysExpanded || !!value || !!filterLabel),
38
- isInputOpen = _useState[0],
39
- setIsInputOpen = _useState[1];
40
- var _useState2 = useState(0),
41
- inputOffset = _useState2[0],
42
- setInputOffset = _useState2[1];
43
- var _useState3 = useState(false),
44
- isResultChosen = _useState3[0],
45
- setIsResultChosen = _useState3[1];
46
- var _useState4 = useState(true),
47
- isInputFocused = _useState4[0],
48
- setIsInputFocused = _useState4[1];
49
- var renderInputOpened = isInputOpen || !!value || !!filterLabel;
50
- var prevFocusTrigger = usePrevious(focusTrigger);
51
- var prevToggleTrigger = usePrevious(toggleTrigger);
52
- useLayoutEffect(function () {
53
- if (prevFocusTrigger !== undefined && prevFocusTrigger !== focusTrigger) {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import Input from "antd/lib/input";
3
+ import { useRef, useState, useLayoutEffect, useEffect } from "react";
4
+ import { theme } from "@synerise/ds-core";
5
+ import Icon, { Close3M } from "@synerise/ds-icon";
6
+ import Tooltip from "@synerise/ds-tooltip";
7
+ import { usePrevious, useOnClickOutside } from "@synerise/ds-utils";
8
+ import { SearchInputWrapper, SearchInputContent, LeftSide, Filter, SearchInner, ClearButton } from "../../Search.styles.js";
9
+ import SearchButton from "../SearchButton/SearchButton.js";
10
+ const SearchInput = ({
11
+ alwaysExpanded,
12
+ alwaysHighlight,
13
+ clearTooltip,
14
+ filterLabel,
15
+ filterLookupKey,
16
+ onKeyDown,
17
+ onClick,
18
+ onChange,
19
+ onClear,
20
+ onToggle,
21
+ onButtonClick,
22
+ moveCursorToEnd,
23
+ placeholder,
24
+ textLookupKey,
25
+ value,
26
+ closeOnClickOutside,
27
+ disableInput,
28
+ disabled,
29
+ focusTrigger,
30
+ toggleTrigger,
31
+ inputProps = {},
32
+ searchTooltipProps = {}
33
+ }) => {
34
+ const inputRef = useRef(null);
35
+ const wrapperRef = useRef(null);
36
+ const [isInputOpen, setIsInputOpen] = useState(alwaysExpanded || !!value || !!filterLabel);
37
+ const [inputOffset, setInputOffset] = useState(0);
38
+ const [isResultChosen, setIsResultChosen] = useState(false);
39
+ const [isInputFocused, setIsInputFocused] = useState(true);
40
+ const renderInputOpened = isInputOpen || !!value || !!filterLabel;
41
+ const prevFocusTrigger = usePrevious(focusTrigger);
42
+ const prevToggleTrigger = usePrevious(toggleTrigger);
43
+ useLayoutEffect(() => {
44
+ if (prevFocusTrigger !== void 0 && prevFocusTrigger !== focusTrigger) {
54
45
  focusInput();
55
46
  }
56
- if (prevToggleTrigger !== undefined && prevToggleTrigger !== toggleTrigger) {
47
+ if (prevToggleTrigger !== void 0 && prevToggleTrigger !== toggleTrigger) {
57
48
  toggleOpen();
58
49
  }
59
50
  });
60
- useOnClickOutside(wrapperRef, function () {
51
+ useOnClickOutside(wrapperRef, () => {
61
52
  if (closeOnClickOutside && !alwaysExpanded) {
62
53
  setIsInputOpen(false);
63
54
  onToggle && onToggle(false);
64
55
  }
65
56
  });
66
- var focusInput = function focusInput() {
57
+ const focusInput = () => {
67
58
  inputRef.current && inputRef.current.focus();
68
59
  };
69
- var handleSearchInputContentClick = function handleSearchInputContentClick() {
60
+ const handleSearchInputContentClick = () => {
70
61
  onClick && onClick();
71
62
  focusInput();
72
63
  };
73
- var handleOffsetWithFilter = function handleOffsetWithFilter(ref) {
64
+ const handleOffsetWithFilter = (ref) => {
74
65
  ref && setInputOffset(ref.getBoundingClientRect().width);
75
66
  };
76
- var handleChangeValue = function handleChangeValue(_ref2) {
77
- var changedValue = _ref2.target.value;
67
+ const handleChangeValue = ({
68
+ target: {
69
+ value: changedValue
70
+ }
71
+ }) => {
78
72
  onChange(changedValue);
79
73
  setIsResultChosen(false);
80
74
  };
81
- var toggleOpen = function toggleOpen() {
82
- setIsInputOpen(function (open) {
75
+ const toggleOpen = () => {
76
+ setIsInputOpen((open) => {
83
77
  onToggle && onToggle(!open);
84
78
  return !open;
85
79
  });
86
80
  };
87
- var handleSearchButtonClick = function handleSearchButtonClick() {
81
+ const handleSearchButtonClick = () => {
88
82
  if (!alwaysExpanded) {
89
83
  toggleOpen();
90
84
  focusInput();
91
85
  onButtonClick && onButtonClick();
92
86
  }
93
87
  };
94
- var handleClearValue = function handleClearValue() {
88
+ const handleClearValue = () => {
95
89
  setInputOffset(0);
96
90
  setIsResultChosen(false);
97
91
  onClear();
98
92
  setIsInputOpen(true);
99
93
  focusInput();
100
94
  };
101
- useEffect(function () {
102
- var _inputRef$current;
103
- if (moveCursorToEnd && (_inputRef$current = inputRef.current) != null && _inputRef$current.input) {
95
+ useEffect(() => {
96
+ if (moveCursorToEnd && inputRef.current?.input) {
104
97
  inputRef.current.input.selectionStart = value.length || 0;
105
98
  inputRef.current.input.selectionEnd = value.length || 0;
106
99
  }
107
100
  }, [moveCursorToEnd, value.length]);
108
- return /*#__PURE__*/React.createElement(S.SearchInputWrapper, {
109
- ref: wrapperRef
110
- }, !disabled && /*#__PURE__*/React.createElement(S.SearchInputContent, {
111
- className: renderInputOpened ? 'is-open search-input-wrapper' : 'search-input-wrapper',
112
- offset: inputOffset,
113
- filterLabel: filterLabel,
114
- onClick: handleSearchInputContentClick
115
- }, /*#__PURE__*/React.createElement(S.LeftSide, {
116
- isOpen: isInputOpen
117
- }, filterLabel && /*#__PURE__*/React.createElement(S.Filter, {
118
- ref: handleOffsetWithFilter
119
- }, filterLabel.icon && !isResultChosen && /*#__PURE__*/React.createElement(Icon, {
120
- component: filterLabel.icon
121
- }), /*#__PURE__*/React.createElement("span", null, filterLabel[filterLookupKey || ''] || filterLabel[textLookupKey || '']))), /*#__PURE__*/React.createElement(Tooltip, searchTooltipProps, /*#__PURE__*/React.createElement(S.SearchInner, {
122
- hasValue: !!value,
123
- alwaysHighlight: alwaysHighlight
124
- }, /*#__PURE__*/React.createElement(Input, _extends({
125
- placeholder: placeholder,
126
- ref: inputRef,
127
- value: value,
128
- onChange: handleChangeValue,
129
- onKeyDown: onKeyDown,
130
- onFocus: function onFocus() {
131
- return setIsInputFocused(true);
132
- },
133
- onBlur: function onBlur() {
134
- return setIsInputFocused(false);
135
- },
136
- autoComplete: "off",
137
- autoFocus: true,
138
- disabled: disableInput
139
- }, inputProps))))), /*#__PURE__*/React.createElement(SearchButton, {
140
- disabled: disabled,
141
- inputOpen: isInputOpen,
142
- hidden: !!value || !!filterLabel,
143
- inputFocused: isInputFocused,
144
- clickable: !disabled && !alwaysExpanded,
145
- onClick: handleSearchButtonClick
146
- }), !disabled && /*#__PURE__*/React.createElement(S.ClearButton, {
147
- hidden: !value && !filterLabel
148
- }, /*#__PURE__*/React.createElement(Icon, {
149
- "data-testid": "clear",
150
- onClick: handleClearValue,
151
- component: /*#__PURE__*/React.createElement(Tooltip, {
152
- title: clearTooltip
153
- }, /*#__PURE__*/React.createElement(Close3M, null)),
154
- color: theme.palette['red-600'],
155
- size: 18
156
- })));
101
+ return /* @__PURE__ */ jsxs(SearchInputWrapper, { ref: wrapperRef, children: [
102
+ !disabled && /* @__PURE__ */ jsxs(SearchInputContent, { className: renderInputOpened ? "is-open search-input-wrapper" : "search-input-wrapper", offset: inputOffset, filterLabel, onClick: handleSearchInputContentClick, children: [
103
+ /* @__PURE__ */ jsx(LeftSide, { isOpen: isInputOpen, children: filterLabel && /* @__PURE__ */ jsxs(Filter, { ref: handleOffsetWithFilter, children: [
104
+ filterLabel.icon && !isResultChosen && /* @__PURE__ */ jsx(Icon, { component: filterLabel.icon }),
105
+ /* @__PURE__ */ jsx("span", { children: filterLabel[filterLookupKey || ""] || filterLabel[textLookupKey || ""] })
106
+ ] }) }),
107
+ /* @__PURE__ */ jsx(Tooltip, { ...searchTooltipProps, children: /* @__PURE__ */ jsx(SearchInner, { hasValue: !!value, alwaysHighlight, children: /* @__PURE__ */ jsx(Input, { placeholder, ref: inputRef, value, onChange: handleChangeValue, onKeyDown, onFocus: () => setIsInputFocused(true), onBlur: () => setIsInputFocused(false), autoComplete: "off", autoFocus: true, disabled: disableInput, ...inputProps }) }) })
108
+ ] }),
109
+ /* @__PURE__ */ jsx(SearchButton, { disabled, inputOpen: isInputOpen, hidden: !!value || !!filterLabel, inputFocused: isInputFocused, clickable: !disabled && !alwaysExpanded, onClick: handleSearchButtonClick }),
110
+ !disabled && /* @__PURE__ */ jsx(ClearButton, { hidden: !value && !filterLabel, children: /* @__PURE__ */ jsx(Icon, { "data-testid": "clear", onClick: handleClearValue, component: /* @__PURE__ */ jsx(Tooltip, { title: clearTooltip, children: /* @__PURE__ */ jsx(Close3M, {}) }), color: theme.palette["red-600"], size: 18 }) })
111
+ ] });
112
+ };
113
+ export {
114
+ SearchInput as default
157
115
  };
158
- export default SearchInput;
@@ -1,6 +1,6 @@
1
- import type { InputProps } from 'antd/lib/input';
2
- import type { KeyboardEvent, ReactNode } from 'react';
3
- import type { TooltipProps } from '@synerise/ds-tooltip';
1
+ import { InputProps } from 'antd/lib/input';
2
+ import { KeyboardEvent, ReactNode } from 'react';
3
+ import { TooltipProps } from '@synerise/ds-tooltip';
4
4
  export type SearchInputProps = {
5
5
  alwaysExpanded?: boolean;
6
6
  alwaysHighlight?: boolean;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,5 +1,5 @@
1
- import React, { type ReactElement, type ReactNode } from 'react';
2
- import { type SearchItemListProps } from './SearchItems.types';
1
+ import { default as React, ReactElement, ReactNode } from 'react';
2
+ import { SearchItemListProps } from './SearchItems.types';
3
3
  export declare function renderSearchList<V>(props: SearchItemListProps<V>, children?: ReactNode): ReactElement<SearchItemListProps<V>>;
4
4
  declare const SearchItems: ({ data, height, highlight, itemRender, listProps, onItemClick, rowHeight, visibleRows, width, renderInMenu, }: SearchItemListProps<any>) => React.JSX.Element;
5
5
  export default SearchItems;