@synerise/ds-search-bar 1.4.19 → 1.4.21

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/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.4.21](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@1.4.20...@synerise/ds-search-bar@1.4.21) (2026-04-01)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-search-bar
9
+
10
+ ## [1.4.20](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@1.4.19...@synerise/ds-search-bar@1.4.20) (2026-03-24)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-search-bar
13
+
6
14
  ## [1.4.19](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@1.4.18...@synerise/ds-search-bar@1.4.19) (2026-03-20)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-search-bar
@@ -1,8 +1,18 @@
1
- export var SEARCH_BAR_PADDING_LEFT = 16;
2
- export var SEARCH_BAR_PADDING_RIGHT = 12;
3
- export var ICON_LEFT_SIZE = 24;
4
- export var ICON_LEFT_MARGIN_RIGHT = 12;
5
- export var CLEAR_ICON_SIZE = 18;
6
- export var CLEAR_ICON_MARGIN_LEFT = 12;
7
- export var VALUE_PREFIX_WRAPPER_LEFT_VALUE = SEARCH_BAR_PADDING_LEFT + ICON_LEFT_SIZE + ICON_LEFT_MARGIN_RIGHT;
8
- export var VALUE_PREFIX_WRAPPER_RIGHT_MARGIN = 4;
1
+ const SEARCH_BAR_PADDING_LEFT = 16;
2
+ const SEARCH_BAR_PADDING_RIGHT = 12;
3
+ const ICON_LEFT_SIZE = 24;
4
+ const ICON_LEFT_MARGIN_RIGHT = 12;
5
+ const CLEAR_ICON_SIZE = 18;
6
+ const CLEAR_ICON_MARGIN_LEFT = 12;
7
+ const VALUE_PREFIX_WRAPPER_LEFT_VALUE = SEARCH_BAR_PADDING_LEFT + ICON_LEFT_SIZE + ICON_LEFT_MARGIN_RIGHT;
8
+ const VALUE_PREFIX_WRAPPER_RIGHT_MARGIN = 4;
9
+ export {
10
+ CLEAR_ICON_MARGIN_LEFT,
11
+ CLEAR_ICON_SIZE,
12
+ ICON_LEFT_MARGIN_RIGHT,
13
+ ICON_LEFT_SIZE,
14
+ SEARCH_BAR_PADDING_LEFT,
15
+ SEARCH_BAR_PADDING_RIGHT,
16
+ VALUE_PREFIX_WRAPPER_LEFT_VALUE,
17
+ VALUE_PREFIX_WRAPPER_RIGHT_MARGIN
18
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- declare const SearchBar: React.ForwardRefExoticComponent<Partial<Pick<import("@synerise/ds-input").InputProps, "handleInputRef">> & {
1
+ import { default as React } from 'react';
2
+ declare const SearchBar: React.ForwardRefExoticComponent<Partial<Pick<import('@synerise/ds-input').InputProps, "handleInputRef">> & {
3
3
  onSearchChange: (value: string) => void;
4
4
  onClearInput?: () => void;
5
5
  placeholder: React.ReactNode;
@@ -10,7 +10,7 @@ declare const SearchBar: React.ForwardRefExoticComponent<Partial<Pick<import("@s
10
10
  autofocusDelay?: number;
11
11
  disabled?: boolean;
12
12
  borderRadius?: boolean;
13
- clearTooltipProps?: Partial<import("@synerise/ds-tooltip").TooltipProps>;
13
+ clearTooltipProps?: Partial<import('@synerise/ds-tooltip').TooltipProps>;
14
14
  valuePrefix?: React.ReactNode;
15
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "iconLeft" | "disabled" | "value" | "placeholder" | "handleInputRef" | "onSearchChange" | "onClearInput" | "clearTooltip" | "autofocus" | "autofocusDelay" | "borderRadius" | "clearTooltipProps" | "valuePrefix"> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<HTMLDivElement>>;
15
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "iconLeft" | "disabled" | "value" | "placeholder" | "handleInputRef" | "borderRadius" | "onSearchChange" | "onClearInput" | "clearTooltip" | "autofocus" | "autofocusDelay" | "clearTooltipProps" | "valuePrefix"> & import('@synerise/ds-utils').DataAttributes & React.RefAttributes<HTMLDivElement>>;
16
16
  export default SearchBar;
package/dist/SearchBar.js CHANGED
@@ -1,62 +1,51 @@
1
- var _excluded = ["value", "className", "onSearchChange", "onClearInput", "placeholder", "iconLeft", "autofocus", "clearTooltip", "disabled", "borderRadius", "handleInputRef", "autofocusDelay", "clearTooltipProps", "valuePrefix"];
2
- 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); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import classnames from 'classnames';
5
- import React, { forwardRef, useEffect, useMemo, useState } from 'react';
6
- import { FormattedMessage } from 'react-intl';
7
- import { useTheme } from '@synerise/ds-core';
8
- import Icon, { Close3M } from '@synerise/ds-icon';
9
- import Tooltip from '@synerise/ds-tooltip';
10
- import { CLEAR_ICON_SIZE } from './SearchBar.constants';
11
- import * as S from './SearchBar.styles';
12
- import { ValuePrefix } from './ValuePrefix';
13
- var DEFAULT_PLACEHOLDER_STRING = 'Search';
14
- var SearchBar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
15
- var value = _ref.value,
16
- className = _ref.className,
17
- onSearchChange = _ref.onSearchChange,
18
- onClearInput = _ref.onClearInput,
19
- placeholder = _ref.placeholder,
20
- iconLeft = _ref.iconLeft,
21
- autofocus = _ref.autofocus,
22
- _ref$clearTooltip = _ref.clearTooltip,
23
- clearTooltip = _ref$clearTooltip === void 0 ? /*#__PURE__*/React.createElement(FormattedMessage, {
24
- id: "DS.SEARCH-BAR.CLEAR-TOOLTIP",
25
- defaultMessage: "Clear"
26
- }) : _ref$clearTooltip,
27
- disabled = _ref.disabled,
28
- borderRadius = _ref.borderRadius,
29
- handleInputRef = _ref.handleInputRef,
30
- autofocusDelay = _ref.autofocusDelay,
31
- clearTooltipProps = _ref.clearTooltipProps,
32
- valuePrefix = _ref.valuePrefix,
33
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
34
- var theme = useTheme();
35
- var _useState = useState(false),
36
- isFocused = _useState[0],
37
- setFocus = _useState[1];
38
- var _useState2 = useState(),
39
- input = _useState2[0],
40
- setInput = _useState2[1];
41
- var _useState3 = useState(0),
42
- valuePrefixWidth = _useState3[0],
43
- setValuePrefixWidth = _useState3[1];
44
- var handleRef = function handleRef(ref) {
45
- handleInputRef == null || handleInputRef(ref);
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef, useState, useEffect, useMemo } from "react";
4
+ import { FormattedMessage } from "react-intl";
5
+ import { useTheme } from "@synerise/ds-core";
6
+ import Icon, { Close3M } from "@synerise/ds-icon";
7
+ import Tooltip from "@synerise/ds-tooltip";
8
+ import { CLEAR_ICON_SIZE } from "./SearchBar.constants.js";
9
+ import { SearchBarWrapper, IconLeftWrapper, ClearInputWrapper, PlaceholderWrapper, SearchBar as SearchBar$1 } from "./SearchBar.styles.js";
10
+ import { ValuePrefix } from "./ValuePrefix.js";
11
+ const DEFAULT_PLACEHOLDER_STRING = "Search";
12
+ const SearchBar = forwardRef(({
13
+ value,
14
+ className,
15
+ onSearchChange,
16
+ onClearInput,
17
+ placeholder,
18
+ iconLeft,
19
+ autofocus,
20
+ clearTooltip = /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.SEARCH-BAR.CLEAR-TOOLTIP", defaultMessage: "Clear" }),
21
+ disabled,
22
+ borderRadius,
23
+ handleInputRef,
24
+ autofocusDelay,
25
+ clearTooltipProps,
26
+ valuePrefix,
27
+ ...htmlAttributes
28
+ }, forwardedRef) => {
29
+ const theme = useTheme();
30
+ const [isFocused, setFocus] = useState(false);
31
+ const [input, setInput] = useState();
32
+ const [valuePrefixWidth, setValuePrefixWidth] = useState(0);
33
+ const handleRef = (ref) => {
34
+ handleInputRef?.(ref);
46
35
  if (ref.current) {
47
36
  setInput(ref.current);
48
37
  }
49
38
  };
50
- useEffect(function () {
39
+ useEffect(() => {
51
40
  if (input) {
52
41
  if (autofocus) {
53
42
  if (autofocusDelay) {
54
- var timeout = setTimeout(function () {
43
+ const timeout = setTimeout(() => {
55
44
  input.focus({
56
45
  preventScroll: true
57
46
  });
58
47
  }, autofocusDelay);
59
- return function () {
48
+ return () => {
60
49
  clearTimeout(timeout);
61
50
  };
62
51
  }
@@ -65,54 +54,22 @@ var SearchBar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
65
54
  });
66
55
  }
67
56
  }
68
- return undefined;
57
+ return void 0;
69
58
  }, [autofocus, autofocusDelay, input]);
70
- var placeholderString = typeof placeholder === 'string' ? placeholder : DEFAULT_PLACEHOLDER_STRING;
71
- var finalClassName = useMemo(function () {
72
- return classnames(className, {
73
- 'is-focused': isFocused
74
- });
75
- }, [className, isFocused]);
76
- return /*#__PURE__*/React.createElement(S.SearchBarWrapper, _extends({
77
- iconLeft: iconLeft,
78
- isEmpty: !value,
79
- disabled: disabled,
80
- borderRadius: borderRadius,
81
- "data-testid": "input-wrapper",
82
- valuePrefixWidth: valuePrefixWidth
83
- }, htmlAttributes, {
84
- className: finalClassName,
85
- ref: forwardedRef
86
- }), iconLeft && /*#__PURE__*/React.createElement(S.IconLeftWrapper, null, iconLeft), onClearInput && (Boolean(valuePrefix) || Boolean(value)) && /*#__PURE__*/React.createElement(S.ClearInputWrapper, {
87
- onClick: onClearInput,
88
- "data-testid": "clear-btn"
89
- }, /*#__PURE__*/React.createElement(Icon, {
90
- component: /*#__PURE__*/React.createElement(Tooltip, _extends({
91
- title: clearTooltip
92
- }, clearTooltipProps), /*#__PURE__*/React.createElement(Close3M, null)),
93
- color: theme.palette['grey-500'],
94
- size: CLEAR_ICON_SIZE
95
- })), !!valuePrefix && /*#__PURE__*/React.createElement(ValuePrefix, {
96
- value: valuePrefix,
97
- setValuePrefixWidth: setValuePrefixWidth
98
- }), !value && /*#__PURE__*/React.createElement(S.PlaceholderWrapper, {
99
- valuePrefixWidth: valuePrefixWidth
100
- }, placeholder), /*#__PURE__*/React.createElement(S.SearchBar, {
101
- onChange: function onChange(event) {
59
+ const placeholderString = typeof placeholder === "string" ? placeholder : DEFAULT_PLACEHOLDER_STRING;
60
+ const finalClassName = useMemo(() => classnames(className, {
61
+ "is-focused": isFocused
62
+ }), [className, isFocused]);
63
+ return /* @__PURE__ */ jsxs(SearchBarWrapper, { iconLeft, isEmpty: !value, disabled, borderRadius, "data-testid": "input-wrapper", valuePrefixWidth, ...htmlAttributes, className: finalClassName, ref: forwardedRef, children: [
64
+ iconLeft && /* @__PURE__ */ jsx(IconLeftWrapper, { children: iconLeft }),
65
+ onClearInput && (Boolean(valuePrefix) || Boolean(value)) && /* @__PURE__ */ jsx(ClearInputWrapper, { onClick: onClearInput, "data-testid": "clear-btn", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Tooltip, { title: clearTooltip, ...clearTooltipProps, children: /* @__PURE__ */ jsx(Close3M, {}) }), color: theme.palette["grey-500"], size: CLEAR_ICON_SIZE }) }),
66
+ !!valuePrefix && /* @__PURE__ */ jsx(ValuePrefix, { value: valuePrefix, setValuePrefixWidth }),
67
+ !value && /* @__PURE__ */ jsx(PlaceholderWrapper, { valuePrefixWidth, children: placeholder }),
68
+ /* @__PURE__ */ jsx(SearchBar$1, { onChange: (event) => {
102
69
  onSearchChange(event.currentTarget.value);
103
- },
104
- onFocus: function onFocus() {
105
- return setFocus(true);
106
- },
107
- onBlur: function onBlur() {
108
- return setFocus(false);
109
- },
110
- value: value,
111
- resetMargin: true,
112
- placeholder: placeholderString,
113
- handleInputRef: handleRef,
114
- disabled: disabled,
115
- autoComplete: "off"
116
- }));
70
+ }, onFocus: () => setFocus(true), onBlur: () => setFocus(false), value, resetMargin: true, placeholder: placeholderString, handleInputRef: handleRef, disabled, autoComplete: "off" })
71
+ ] });
117
72
  });
118
- export default SearchBar;
73
+ export {
74
+ SearchBar as default
75
+ };
@@ -1,13 +1,13 @@
1
- import { type StyledInput } from '@synerise/ds-input';
2
- export declare const IconLeftWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const ValuePrefixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const ValuePrefixTitle: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => React.JSX.Element, any, {}, never>;
5
- export declare const ClearInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const PlaceholderWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ import { StyledInput } from '@synerise/ds-input';
2
+ export declare const IconLeftWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
3
+ export declare const ValuePrefixWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
4
+ export declare const ValuePrefixTitle: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
5
+ export declare const ClearInputWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
6
+ export declare const PlaceholderWrapper: import('styled-components').StyledComponent<"div", any, {
7
7
  valuePrefixWidth: number;
8
8
  }, never>;
9
9
  export declare const SearchBar: StyledInput;
10
- export declare const SearchBarWrapper: import("styled-components").StyledComponent<"div", any, {
10
+ export declare const SearchBarWrapper: import('styled-components').StyledComponent<"div", any, {
11
11
  iconLeft: React.ReactNode;
12
12
  isEmpty: boolean;
13
13
  disabled: boolean;
@@ -1,74 +1,55 @@
1
- import styled from 'styled-components';
2
- import { Input } from '@synerise/ds-input';
3
- import { Title } from '@synerise/ds-typography';
4
- import { CLEAR_ICON_MARGIN_LEFT, CLEAR_ICON_SIZE, ICON_LEFT_MARGIN_RIGHT, ICON_LEFT_SIZE, SEARCH_BAR_PADDING_LEFT, SEARCH_BAR_PADDING_RIGHT, VALUE_PREFIX_WRAPPER_LEFT_VALUE, VALUE_PREFIX_WRAPPER_RIGHT_MARGIN } from './SearchBar.constants';
5
- var getPaddingAndWidthForSearchBarAntInput = function getPaddingAndWidthForSearchBarAntInput(_ref) {
6
- var iconLeft = _ref.iconLeft,
7
- isEmpty = _ref.isEmpty,
8
- valuePrefixWidth = _ref.valuePrefixWidth;
9
- var leftPadding = SEARCH_BAR_PADDING_LEFT + (iconLeft ? ICON_LEFT_SIZE + ICON_LEFT_MARGIN_RIGHT : 0) + valuePrefixWidth + (valuePrefixWidth ? VALUE_PREFIX_WRAPPER_RIGHT_MARGIN : 0);
10
- var rightPadding = SEARCH_BAR_PADDING_RIGHT + (!isEmpty ? CLEAR_ICON_SIZE + CLEAR_ICON_MARGIN_LEFT : 0);
11
- return "\n padding: 0 " + rightPadding + "px 0 " + leftPadding + "px;\n width: calc(100% - " + (rightPadding + leftPadding) + "px);\n ";
1
+ import styled from "styled-components";
2
+ import { Input } from "@synerise/ds-input";
3
+ import { Title } from "@synerise/ds-typography";
4
+ import { SEARCH_BAR_PADDING_LEFT, SEARCH_BAR_PADDING_RIGHT, VALUE_PREFIX_WRAPPER_LEFT_VALUE, VALUE_PREFIX_WRAPPER_RIGHT_MARGIN, CLEAR_ICON_SIZE, CLEAR_ICON_MARGIN_LEFT, ICON_LEFT_SIZE, ICON_LEFT_MARGIN_RIGHT } from "./SearchBar.constants.js";
5
+ const getPaddingAndWidthForSearchBarAntInput = ({
6
+ iconLeft,
7
+ isEmpty,
8
+ valuePrefixWidth
9
+ }) => {
10
+ const leftPadding = SEARCH_BAR_PADDING_LEFT + (iconLeft ? ICON_LEFT_SIZE + ICON_LEFT_MARGIN_RIGHT : 0) + valuePrefixWidth + (valuePrefixWidth ? VALUE_PREFIX_WRAPPER_RIGHT_MARGIN : 0);
11
+ const rightPadding = SEARCH_BAR_PADDING_RIGHT + (!isEmpty ? CLEAR_ICON_SIZE + CLEAR_ICON_MARGIN_LEFT : 0);
12
+ return `
13
+ padding: 0 ${rightPadding}px 0 ${leftPadding}px;
14
+ width: calc(100% - ${rightPadding + leftPadding}px);
15
+ `;
12
16
  };
13
- export var IconLeftWrapper = styled.div.withConfig({
17
+ const IconLeftWrapper = /* @__PURE__ */ styled.div.withConfig({
14
18
  displayName: "SearchBarstyles__IconLeftWrapper",
15
19
  componentId: "sc-qhi5c4-0"
16
20
  })(["position:absolute;left:", "px;display:flex;align-items:center;height:100%;z-index:3;"], SEARCH_BAR_PADDING_LEFT);
17
- export var ValuePrefixWrapper = styled.div.withConfig({
21
+ const ValuePrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
18
22
  displayName: "SearchBarstyles__ValuePrefixWrapper",
19
23
  componentId: "sc-qhi5c4-1"
20
24
  })(["position:absolute;left:", "px;display:flex;align-items:center;height:100%;z-index:3;"], VALUE_PREFIX_WRAPPER_LEFT_VALUE);
21
- export var ValuePrefixTitle = styled(Title).withConfig({
25
+ const ValuePrefixTitle = /* @__PURE__ */ styled(Title).withConfig({
22
26
  displayName: "SearchBarstyles__ValuePrefixTitle",
23
27
  componentId: "sc-qhi5c4-2"
24
28
  })(["line-height:18px;"]);
25
- export var ClearInputWrapper = styled.div.withConfig({
29
+ const ClearInputWrapper = /* @__PURE__ */ styled.div.withConfig({
26
30
  displayName: "SearchBarstyles__ClearInputWrapper",
27
31
  componentId: "sc-qhi5c4-3"
28
32
  })(["right:", "px;position:absolute;display:flex;align-items:center;height:100%;z-index:3;cursor:pointer;"], SEARCH_BAR_PADDING_RIGHT);
29
- export var PlaceholderWrapper = styled.div.withConfig({
33
+ const PlaceholderWrapper = /* @__PURE__ */ styled.div.withConfig({
30
34
  displayName: "SearchBarstyles__PlaceholderWrapper",
31
35
  componentId: "sc-qhi5c4-4"
32
- })(["pointer-events:none;position:absolute;display:flex;white-space:nowrap;align-items:center;z-index:2;height:52px;left:", "px;color:", ";line-height:18px;"], function (_ref2) {
33
- var valuePrefixWidth = _ref2.valuePrefixWidth;
34
- return VALUE_PREFIX_WRAPPER_LEFT_VALUE + valuePrefixWidth + (valuePrefixWidth ? VALUE_PREFIX_WRAPPER_RIGHT_MARGIN : 0);
35
- }, function (props) {
36
- return props.theme.palette['grey-500'];
37
- });
38
- export var SearchBar = styled(Input).withConfig({
36
+ })(["pointer-events:none;position:absolute;display:flex;white-space:nowrap;align-items:center;z-index:2;height:52px;left:", "px;color:", ";line-height:18px;"], ({
37
+ valuePrefixWidth
38
+ }) => VALUE_PREFIX_WRAPPER_LEFT_VALUE + valuePrefixWidth + (valuePrefixWidth ? VALUE_PREFIX_WRAPPER_RIGHT_MARGIN : 0), (props) => props.theme.palette["grey-500"]);
39
+ const SearchBar = /* @__PURE__ */ styled(Input).withConfig({
39
40
  displayName: "SearchBarstyles__SearchBar",
40
41
  componentId: "sc-qhi5c4-5"
41
- })(["&&&{position:relative;height:52px;padding:0;input.ant-input{position:absolute;top:0;left:0;max-width:100%;height:52px;border:0;background:", ";box-sizing:content-box;&:focus{box-shadow:inset 0px -2px 0px 0px ", ";}::-webkit-input-placeholder{line-height:52px;color:transparent;}:-moz-placeholder{line-height:52px;color:transparent;}::-moz-placeholder{line-height:52px;color:transparent;}:-ms-input-placeholder{line-height:52px;color:transparent;}}}"], function (props) {
42
- return props.theme.palette['grey-050'];
43
- }, function (props) {
44
- return props.theme.palette['blue-600'];
45
- });
46
- // placeholder styling rules have to be separated
47
- // https://stackoverflow.com/questions/44971077/why-do-comma-separated-placeholder-rules-not-get-applied-in-css
48
-
49
- export var SearchBarWrapper = styled.div.withConfig({
42
+ })(["&&&{position:relative;height:52px;padding:0;input.ant-input{position:absolute;top:0;left:0;max-width:100%;height:52px;border:0;background:", ";box-sizing:content-box;&:focus{box-shadow:inset 0px -2px 0px 0px ", ";}::-webkit-input-placeholder{line-height:52px;color:transparent;}:-moz-placeholder{line-height:52px;color:transparent;}::-moz-placeholder{line-height:52px;color:transparent;}:-ms-input-placeholder{line-height:52px;color:transparent;}}}"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["blue-600"]);
43
+ const SearchBarWrapper = /* @__PURE__ */ styled.div.withConfig({
50
44
  displayName: "SearchBarstyles__SearchBarWrapper",
51
45
  componentId: "sc-qhi5c4-6"
52
- })(["position:relative;overflow:hidden;border-bottom:1px solid ", ";pointer-events:", ";user-select:", ";border-radius:", ";min-width:150px;&&&{svg{transition:all 0.3s ease-out;fill:", ";}input.ant-input{border-radius:0;line-height:18px;", "}&:hover{", "{svg{fill:", ";}}", "{svg{fill:", ";}}", "{color:", ";}}}&.is-focused{", "{svg{fill:", ";}}", "{svg{fill:", ";}}", "{color:", ";}}"], function (props) {
53
- return props.theme.palette['grey-100'];
54
- }, function (props) {
55
- return props.disabled ? 'none' : '';
56
- }, function (props) {
57
- return props.disabled ? 'none' : '';
58
- }, function (props) {
59
- return props.borderRadius ? '3px' : '';
60
- }, function (props) {
61
- return props.disabled ? props.theme.palette['grey-400'] : '';
62
- }, getPaddingAndWidthForSearchBarAntInput, IconLeftWrapper, function (props) {
63
- return props.theme.palette['blue-600'];
64
- }, ClearInputWrapper, function (props) {
65
- return props.theme.palette['red-600'];
66
- }, ValuePrefixTitle, function (props) {
67
- return props.theme.palette['blue-600'];
68
- }, IconLeftWrapper, function (props) {
69
- return props.theme.palette['blue-600'];
70
- }, ClearInputWrapper, function (props) {
71
- return props.theme.palette['red-600'];
72
- }, ValuePrefixTitle, function (props) {
73
- return props.theme.palette['blue-600'];
74
- });
46
+ })(["position:relative;overflow:hidden;border-bottom:1px solid ", ";pointer-events:", ";user-select:", ";border-radius:", ";min-width:150px;&&&{svg{transition:all 0.3s ease-out;fill:", ";}input.ant-input{border-radius:0;line-height:18px;", "}&:hover{", "{svg{fill:", ";}}", "{svg{fill:", ";}}", "{color:", ";}}}&.is-focused{", "{svg{fill:", ";}}", "{svg{fill:", ";}}", "{color:", ";}}"], (props) => props.theme.palette["grey-100"], (props) => props.disabled ? "none" : "", (props) => props.disabled ? "none" : "", (props) => props.borderRadius ? "3px" : "", (props) => props.disabled ? props.theme.palette["grey-400"] : "", getPaddingAndWidthForSearchBarAntInput, IconLeftWrapper, (props) => props.theme.palette["blue-600"], ClearInputWrapper, (props) => props.theme.palette["red-600"], ValuePrefixTitle, (props) => props.theme.palette["blue-600"], IconLeftWrapper, (props) => props.theme.palette["blue-600"], ClearInputWrapper, (props) => props.theme.palette["red-600"], ValuePrefixTitle, (props) => props.theme.palette["blue-600"]);
47
+ export {
48
+ ClearInputWrapper,
49
+ IconLeftWrapper,
50
+ PlaceholderWrapper,
51
+ SearchBar,
52
+ SearchBarWrapper,
53
+ ValuePrefixTitle,
54
+ ValuePrefixWrapper
55
+ };
@@ -1,8 +1,8 @@
1
- import type { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
2
- import { type StyledComponent } from 'styled-components';
3
- import type { InputProps } from '@synerise/ds-input';
4
- import type { TooltipProps } from '@synerise/ds-tooltip';
5
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
2
+ import { StyledComponent } from 'styled-components';
3
+ import { InputProps } from '@synerise/ds-input';
4
+ import { TooltipProps } from '@synerise/ds-tooltip';
5
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
6
6
  export type SearchBarProps = WithHTMLAttributes<HTMLDivElement, Partial<Pick<InputProps, 'handleInputRef'>> & {
7
7
  onSearchChange: (value: string) => void;
8
8
  onClearInput?: () => void;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React, { type Dispatch, type ReactNode, type SetStateAction } from 'react';
1
+ import { default as React, Dispatch, ReactNode, SetStateAction } from 'react';
2
2
  type ValuePrefixProps = {
3
3
  value: ReactNode;
4
4
  setValuePrefixWidth: Dispatch<SetStateAction<number>>;
@@ -1,24 +1,21 @@
1
- import React, { useCallback, useEffect, useRef } from 'react';
2
- import { useResizeObserver } from '@synerise/ds-utils';
3
- import * as S from './SearchBar.styles';
4
- export var ValuePrefix = function ValuePrefix(_ref) {
5
- var value = _ref.value,
6
- setValuePrefixWidth = _ref.setValuePrefixWidth;
7
- var valuePrefixRef = useRef(null);
8
- var handleValuePrefixWidth = useCallback(function (dimensions) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef, useCallback, useEffect } from "react";
3
+ import { useResizeObserver } from "@synerise/ds-utils";
4
+ import { ValuePrefixWrapper, ValuePrefixTitle } from "./SearchBar.styles.js";
5
+ const ValuePrefix = ({
6
+ value,
7
+ setValuePrefixWidth
8
+ }) => {
9
+ const valuePrefixRef = useRef(null);
10
+ const handleValuePrefixWidth = useCallback((dimensions) => {
9
11
  setValuePrefixWidth(dimensions.width);
10
12
  }, [setValuePrefixWidth]);
11
13
  useResizeObserver(valuePrefixRef, handleValuePrefixWidth);
12
- useEffect(function () {
13
- return function () {
14
- return setValuePrefixWidth(0);
15
- };
16
- // eslint-disable-next-line react-hooks/exhaustive-deps
14
+ useEffect(() => {
15
+ return () => setValuePrefixWidth(0);
17
16
  }, []);
18
- return /*#__PURE__*/React.createElement(S.ValuePrefixWrapper, {
19
- ref: valuePrefixRef
20
- }, /*#__PURE__*/React.createElement(S.ValuePrefixTitle, {
21
- level: 6,
22
- withoutMargin: true
23
- }, value));
24
- };
17
+ return /* @__PURE__ */ jsx(ValuePrefixWrapper, { ref: valuePrefixRef, children: /* @__PURE__ */ jsx(ValuePrefixTitle, { level: 6, withoutMargin: true, children: value }) });
18
+ };
19
+ export {
20
+ ValuePrefix
21
+ };
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './SearchBar';
1
+ import { default as default2 } from "./SearchBar.js";
2
+ export {
3
+ default2 as default
4
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-search-bar",
3
- "version": "1.4.19",
3
+ "version": "1.4.21",
4
4
  "description": "SearchBar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -16,10 +16,10 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
22
+ "build:watch": "vite build --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
@@ -35,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-icon": "^1.15.0",
39
- "@synerise/ds-input": "^1.6.9",
40
- "@synerise/ds-tooltip": "^1.4.9",
41
- "@synerise/ds-typography": "^1.1.12",
42
- "@synerise/ds-utils": "^1.7.0",
38
+ "@synerise/ds-icon": "^1.15.2",
39
+ "@synerise/ds-input": "^1.6.11",
40
+ "@synerise/ds-tooltip": "^1.4.11",
41
+ "@synerise/ds-typography": "^1.1.14",
42
+ "@synerise/ds-utils": "^1.7.1",
43
43
  "classnames": "^2.5.1"
44
44
  },
45
45
  "peerDependencies": {
@@ -48,5 +48,5 @@
48
48
  "react-intl": ">=3.12.0 <= 6.8",
49
49
  "styled-components": "^5.3.3"
50
50
  },
51
- "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
51
+ "gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
52
52
  }