@synerise/ds-search 2.0.11 → 2.1.1
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 +19 -0
- package/CLAUDE.md +3 -3
- package/dist/Elements/SearchInput/SearchInput.js +1 -2
- package/dist/Search.styles.d.ts +0 -1
- package/dist/Search.styles.js +21 -26
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [2.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@2.1.0...@synerise/ds-search@2.1.1) (2026-11-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-search
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@2.0.11...@synerise/ds-search@2.1.0) (2026-10-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.0.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search@2.0.10...@synerise/ds-search@2.0.11) (2026-10-28)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-search
|
package/CLAUDE.md
CHANGED
|
@@ -186,7 +186,7 @@ Internal button used by `SearchInput`. Exported for advanced composition.
|
|
|
186
186
|
| `onClick` | `() => void` | — | Click handler |
|
|
187
187
|
| `clickable` | `boolean` | — | Enables pointer events |
|
|
188
188
|
| `disabled` | `boolean` | — | Renders the button as disabled |
|
|
189
|
-
| `inputFocused` | `boolean` | — | Changes icon fill to
|
|
189
|
+
| `inputFocused` | `boolean` | — | Changes icon fill to `var(--ds-color-icon-brand-default)` when focused (and open) |
|
|
190
190
|
|
|
191
191
|
## Usage patterns
|
|
192
192
|
|
|
@@ -245,8 +245,8 @@ import { SearchInput } from '@synerise/ds-search';
|
|
|
245
245
|
- `Search.styles.tsx` contains all styled-components; no CSS Modules.
|
|
246
246
|
- `SearchWrapper` receives `$width` (px) and `inputOpen` to toggle `width: 32px` vs `$width`. Note it emits no width rule at all when `$width` is falsy, so without `width`/`searchWidth` the component never collapses.
|
|
247
247
|
- `SearchInputContent` transitions `width: 0 → 100%` over `ANIMATION_DURATION` (0.1s) using `direction: rtl` for right-to-left expansion animation.
|
|
248
|
-
- `SearchInner` applies
|
|
249
|
-
- `Filter` chip is capped at `MAX_FILTER_WIDTH = 120px` and uses `
|
|
248
|
+
- `SearchInner` applies the focus border (`var(--ds-form-field-border-focus)`) and focus background (`var(--ds-form-field-bg-focus)`) when `hasValue` or `alwaysHighlight`.
|
|
249
|
+
- `Filter` chip is capped at `MAX_FILTER_WIDTH = 120px` and uses `var(--ds-form-field-text-active)` color.
|
|
250
250
|
- `SearchDropdownWrapper` has `width: 0` by default; the child `.search-list-open` class makes it visible via `openDropdownAnimation` keyframe (fade in over 0.3s).
|
|
251
251
|
- Dropdown appears 40px below the input (`top: 40px` on `SearchDropdownContent`).
|
|
252
252
|
- `SCROLLBAR_HEIGHT_OFFSET = 28` is subtracted from `dropdownMaxHeight` before passing to `@synerise/ds-scrollbar`.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState, useLayoutEffect, useEffect } from "react";
|
|
3
|
-
import { theme } from "@synerise/ds-core";
|
|
4
3
|
import Icon, { Close3M } from "@synerise/ds-icon";
|
|
5
4
|
import Tooltip from "@synerise/ds-tooltip";
|
|
6
5
|
import { usePrevious, useOnClickOutside } from "@synerise/ds-utils";
|
|
@@ -132,7 +131,7 @@ const SearchInput = ({
|
|
|
132
131
|
/* @__PURE__ */ jsx(Tooltip, { ...searchTooltipProps, children: /* @__PURE__ */ jsx(SearchInner, { hasValue: !!value, alwaysHighlight, children: /* @__PURE__ */ jsx(SearchNativeInput, { placeholder, ref: inputRef, value, onChange: handleChangeValue, onFocus: () => setIsInputFocused(true), onBlur: () => setIsInputFocused(false), autoComplete: "off", autoFocus: true, disabled: disableInput, ...restInputProps, onKeyDown: handleInputKeyDown, className: ["ds-search-input", inputPropsClassName].filter(Boolean).join(" ") }) }) })
|
|
133
132
|
] }),
|
|
134
133
|
/* @__PURE__ */ jsx(SearchButton, { disabled, inputOpen: isInputOpen, hidden: !!value || !!filterLabel, inputFocused: isInputFocused, clickable: !disabled && !alwaysExpanded, onClick: handleSearchButtonClick }),
|
|
135
|
-
!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:
|
|
134
|
+
!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: "var(--ds-color-icon-danger-default)", size: 18 }) })
|
|
136
135
|
] });
|
|
137
136
|
};
|
|
138
137
|
export {
|
package/dist/Search.styles.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export declare const LeftSide: import('styled-components').StyledComponent<"span
|
|
|
9
9
|
}, never>;
|
|
10
10
|
export declare const Filter: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
11
11
|
export declare const Icon: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
12
|
-
export declare const Label: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
12
|
export declare const SearchButton: import('styled-components').StyledComponent<"div", any, {
|
|
14
13
|
isOpen: boolean;
|
|
15
14
|
clickable?: boolean;
|
package/dist/Search.styles.js
CHANGED
|
@@ -18,19 +18,15 @@ const LeftSide = /* @__PURE__ */ styled.span.withConfig({
|
|
|
18
18
|
const Filter = /* @__PURE__ */ styled.div.withConfig({
|
|
19
19
|
displayName: "Searchstyles__Filter",
|
|
20
20
|
componentId: "sc-1w8jj1b-3"
|
|
21
|
-
})(["display:flex;align-items:center;color:
|
|
21
|
+
})(["display:flex;align-items:center;color:var(--ds-form-field-text-active);font-weight:500;max-width:", "px;direction:ltr;position:relative;padding-right:2px;span{margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:none;}&::after{content:':';}.ds-icon{margin-left:4px;}svg{fill:var(--ds-color-icon-brand-default);}"], MAX_FILTER_WIDTH);
|
|
22
22
|
const Icon = /* @__PURE__ */ styled.div.withConfig({
|
|
23
23
|
displayName: "Searchstyles__Icon",
|
|
24
24
|
componentId: "sc-1w8jj1b-4"
|
|
25
25
|
})(["padding:0 4px 0 8px;"]);
|
|
26
|
-
const Label = /* @__PURE__ */ styled.div.withConfig({
|
|
27
|
-
displayName: "Searchstyles__Label",
|
|
28
|
-
componentId: "sc-1w8jj1b-5"
|
|
29
|
-
})(["font-size:13px;font-weight:500;color:", ";"], (props) => props.theme.palette["blue-600"]);
|
|
30
26
|
const SearchButton = /* @__PURE__ */ styled.div.withConfig({
|
|
31
27
|
displayName: "Searchstyles__SearchButton",
|
|
32
|
-
componentId: "sc-1w8jj1b-
|
|
33
|
-
})(["position:absolute;", ";z-index:1;top:0;right:0;transition:width 0.5s ease-in-out;svg{fill:", " !important;}.btn-search-open:hover{background:transparent !important;}&&{", " button{padding:4px;transition:padding-right 0.15s ease-in-out,background 0.2s ease-in-out;", "}}"], (props) => !props.clickable && `pointer-events:none !important;`, (props) => props.inputFocused && props.isOpen ?
|
|
28
|
+
componentId: "sc-1w8jj1b-5"
|
|
29
|
+
})(["position:absolute;", ";z-index:1;top:0;right:0;transition:width 0.5s ease-in-out;svg{fill:", " !important;}.btn-search-open:hover{background:transparent !important;}&&{", " button{padding:4px;transition:padding-right 0.15s ease-in-out,background 0.2s ease-in-out;", "}}"], (props) => !props.clickable && `pointer-events:none !important;`, (props) => props.inputFocused && props.isOpen ? "var(--ds-color-icon-brand-default)" : "var(--ds-form-icon-color-default)", (props) => !!props.isOpen && `
|
|
34
30
|
.btn-focus{
|
|
35
31
|
border-color: transparent;
|
|
36
32
|
box-shadow: none;
|
|
@@ -38,49 +34,48 @@ const SearchButton = /* @__PURE__ */ styled.div.withConfig({
|
|
|
38
34
|
`, (props) => !props.clickable && `pointer-events:none !important;`);
|
|
39
35
|
const SearchInner = /* @__PURE__ */ styled.div.withConfig({
|
|
40
36
|
displayName: "Searchstyles__SearchInner",
|
|
41
|
-
componentId: "sc-1w8jj1b-
|
|
42
|
-
})(["direction:ltr;margin-bottom:0;", " &:focus-within input,&:focus-within input:hover{box-shadow:inset 0 0 0 1px
|
|
37
|
+
componentId: "sc-1w8jj1b-6"
|
|
38
|
+
})(["direction:ltr;margin-bottom:0;", " &:focus-within input,&:focus-within input:hover{box-shadow:inset 0 0 0 1px var(--ds-form-field-border-focus) !important;border-color:var(--ds-form-field-border-focus);background-color:var(--ds-form-field-bg-focus);}input::placeholder{line-height:1.29;}"], (props) => (props.hasValue || props.alwaysHighlight) && `
|
|
43
39
|
input, input:hover{
|
|
44
|
-
box-shadow: inset 0 0 0 1px
|
|
45
|
-
border-color:
|
|
46
|
-
background-color:
|
|
40
|
+
box-shadow: inset 0 0 0 1px var(--ds-form-field-border-focus);
|
|
41
|
+
border-color: var(--ds-form-field-border-focus);
|
|
42
|
+
background-color: var(--ds-form-field-bg-focus);
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
`);
|
|
50
46
|
const SearchNativeInput = /* @__PURE__ */ styled.input.withConfig({
|
|
51
47
|
displayName: "Searchstyles__SearchNativeInput",
|
|
52
|
-
componentId: "sc-1w8jj1b-
|
|
53
|
-
})(["box-sizing:border-box;width:100%;height:32px;margin:0;padding:7px 12px;border:1px solid
|
|
48
|
+
componentId: "sc-1w8jj1b-7"
|
|
49
|
+
})(["box-sizing:border-box;width:100%;height:32px;margin:0;padding:7px 12px;border:1px solid var(--ds-form-field-border-default);border-radius:3px;background-color:var(--ds-form-field-bg-default);color:var(--ds-form-field-text-value);font-family:inherit;font-size:13px;line-height:1.54;font-feature-settings:'tnum';outline:none;transition:all 0.3s;&::placeholder{color:var(--ds-form-field-text-placeholder);}&:hover:not(:disabled){border-color:var(--ds-form-field-border-hover);}&:disabled{background-color:var(--ds-form-field-bg-disabled);color:var(--ds-form-field-text-disabled);cursor:not-allowed;}"]);
|
|
54
50
|
const SearchInputContent = /* @__PURE__ */ styled.div.withConfig({
|
|
55
51
|
displayName: "Searchstyles__SearchInputContent",
|
|
56
|
-
componentId: "sc-1w8jj1b-
|
|
57
|
-
})(["overflow:hidden;direction:rtl;transition:width ", "s ease-in-out;width:0;input{opacity:0;height:32px;transition:padding-left 0s ease-in-out !important;}&.is-open{width:100%;overflow:visible;input{color:
|
|
52
|
+
componentId: "sc-1w8jj1b-8"
|
|
53
|
+
})(["overflow:hidden;direction:rtl;transition:width ", "s ease-in-out;width:0;input{opacity:0;height:32px;transition:padding-left 0s ease-in-out !important;}&.is-open{width:100%;overflow:visible;input{color:var(--ds-form-field-text-value);padding-left:", ";padding-right:30px;opacity:1;}}"], ANIMATION_DURATION, (props) => props.filterLabel && props.offset ? `${Math.round(props.offset + LABEL_LEFT_OFFSET)}px` : "12px");
|
|
58
54
|
const ClearButton = /* @__PURE__ */ styled.div.withConfig({
|
|
59
55
|
displayName: "Searchstyles__ClearButton",
|
|
60
|
-
componentId: "sc-1w8jj1b-
|
|
56
|
+
componentId: "sc-1w8jj1b-9"
|
|
61
57
|
})(["position:absolute;z-index:1;top:0;right:0;height:100%;display:flex;align-items:center;justify-content:center;padding:0 10px 0 10px;"]);
|
|
62
58
|
const SearchDropdownContent = /* @__PURE__ */ styled.div.withConfig({
|
|
63
59
|
displayName: "Searchstyles__SearchDropdownContent",
|
|
64
|
-
componentId: "sc-1w8jj1b-
|
|
65
|
-
})(["position:absolute;top:40px;background:
|
|
60
|
+
componentId: "sc-1w8jj1b-10"
|
|
61
|
+
})(["position:absolute;top:40px;background:var(--ds-dropdown-bg);max-height:", ";direction:ltr;opacity:0;display:none;border-radius:3px;box-shadow:var(--ds-dropdown-shadow);box-sizing:border-box;transition:opacity 0.5s ease-in-out,width 0.5s ease-in-out;.ps__rail-y{.ps__thumb-y{transform:translateX(1px) !important;}}"], (props) => `${props.maxHeight}px`);
|
|
66
62
|
const MenuHeader = /* @__PURE__ */ styled.div.withConfig({
|
|
67
63
|
displayName: "Searchstyles__MenuHeader",
|
|
68
|
-
componentId: "sc-1w8jj1b-
|
|
69
|
-
})(["display:flex;align-items:center;font-size:10px;font-weight:500;text-transform:uppercase;color:
|
|
64
|
+
componentId: "sc-1w8jj1b-11"
|
|
65
|
+
})(["display:flex;align-items:center;font-size:10px;font-weight:500;text-transform:uppercase;color:var(--ds-divider-header-text-color);height:16px;margin:12px;line-height:1.6;letter-spacing:0.1px;"]);
|
|
70
66
|
const HeaderIconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
71
67
|
displayName: "Searchstyles__HeaderIconWrapper",
|
|
72
|
-
componentId: "sc-1w8jj1b-
|
|
73
|
-
})(["& > .ds-icon > svg{fill:
|
|
68
|
+
componentId: "sc-1w8jj1b-12"
|
|
69
|
+
})(["& > .ds-icon > svg{fill:var(--ds-form-label-icon-color);}"]);
|
|
74
70
|
const SearchDropdownWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
75
71
|
displayName: "Searchstyles__SearchDropdownWrapper",
|
|
76
|
-
componentId: "sc-1w8jj1b-
|
|
72
|
+
componentId: "sc-1w8jj1b-13"
|
|
77
73
|
})(["width:0;& > .search-list-open{width:", ";animation:", " 0.3s ease-in-out 0s 1;opacity:1;display:initial;padding:8px 0 8px 8px;z-index:10;}"], (props) => props.dropdownWidth ? `${props.dropdownWidth}px` : "100%", openDropdownAnimation);
|
|
78
74
|
export {
|
|
79
75
|
ClearButton,
|
|
80
76
|
Filter,
|
|
81
77
|
HeaderIconWrapper,
|
|
82
78
|
Icon,
|
|
83
|
-
Label,
|
|
84
79
|
LeftSide,
|
|
85
80
|
MenuHeader,
|
|
86
81
|
SearchButton,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-search",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Search UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
],
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@synerise/ds-button": "^2.1
|
|
46
|
-
"@synerise/ds-icon": "^2.
|
|
47
|
-
"@synerise/ds-list-item": "^2.
|
|
48
|
-
"@synerise/ds-scrollbar": "^2.
|
|
49
|
-
"@synerise/ds-tooltip": "^2.
|
|
50
|
-
"@synerise/ds-utils": "^2.
|
|
45
|
+
"@synerise/ds-button": "^2.2.1",
|
|
46
|
+
"@synerise/ds-icon": "^2.3.1",
|
|
47
|
+
"@synerise/ds-list-item": "^2.4.0",
|
|
48
|
+
"@synerise/ds-scrollbar": "^2.1.1",
|
|
49
|
+
"@synerise/ds-tooltip": "^2.1.1",
|
|
50
|
+
"@synerise/ds-utils": "^2.3.1",
|
|
51
51
|
"react-window": "^1.8.11"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": ">=16.9.0 <= 18.3.1",
|
|
59
59
|
"styled-components": "^5.3.3"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
|
|
62
62
|
}
|