cozy-search 0.1.0 → 0.3.0
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.
|
@@ -6,9 +6,10 @@ declare namespace AssistantDesktop {
|
|
|
6
6
|
namespace propTypes {
|
|
7
7
|
let componentsProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
8
8
|
SearchBarDesktop: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
|
-
elevation: PropTypes.Requireable<
|
|
9
|
+
elevation: PropTypes.Requireable<number>;
|
|
10
10
|
size: PropTypes.Requireable<string>;
|
|
11
11
|
hasHalfBorderRadius: PropTypes.Requireable<boolean>;
|
|
12
|
+
className: PropTypes.Requireable<string>;
|
|
12
13
|
}>>;
|
|
13
14
|
}>>;
|
|
14
15
|
}
|
|
@@ -34,9 +34,10 @@ var AssistantDesktop = function AssistantDesktop(_ref) {
|
|
|
34
34
|
AssistantDesktop.propTypes = {
|
|
35
35
|
componentsProps: _propTypes.default.shape({
|
|
36
36
|
SearchBarDesktop: _propTypes.default.shape({
|
|
37
|
-
elevation: _propTypes.default.
|
|
37
|
+
elevation: _propTypes.default.number,
|
|
38
38
|
size: _propTypes.default.string,
|
|
39
|
-
hasHalfBorderRadius: _propTypes.default.bool
|
|
39
|
+
hasHalfBorderRadius: _propTypes.default.bool,
|
|
40
|
+
className: _propTypes.default.string
|
|
40
41
|
})
|
|
41
42
|
})
|
|
42
43
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export default SearchBarDesktop;
|
|
2
|
-
declare function SearchBarDesktop({ value, onClear, onChange, elevation, size, hasHalfBorderRadius }: {
|
|
2
|
+
declare function SearchBarDesktop({ value, onClear, onChange, elevation, size, hasHalfBorderRadius, className }: {
|
|
3
3
|
value: any;
|
|
4
4
|
onClear: any;
|
|
5
5
|
onChange: any;
|
|
6
6
|
elevation: any;
|
|
7
7
|
size: any;
|
|
8
8
|
hasHalfBorderRadius: any;
|
|
9
|
+
className: any;
|
|
9
10
|
}): JSX.Element;
|
|
10
11
|
declare namespace SearchBarDesktop {
|
|
11
12
|
namespace defaultProps {
|
|
12
13
|
let size: string;
|
|
13
|
-
let elevation:
|
|
14
|
+
let elevation: number;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _reactRouterDom = require("react-router-dom");
|
|
@@ -15,8 +17,12 @@ var _ClickAwayListener = _interopRequireDefault(require("cozy-ui/transpiled/reac
|
|
|
15
17
|
|
|
16
18
|
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
17
19
|
|
|
20
|
+
var _Magnifier = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Magnifier"));
|
|
21
|
+
|
|
18
22
|
var _SearchBar = _interopRequireDefault(require("cozy-ui/transpiled/react/SearchBar"));
|
|
19
23
|
|
|
24
|
+
var _isTwakeTheme = require("cozy-ui/transpiled/react/helpers/isTwakeTheme");
|
|
25
|
+
|
|
20
26
|
var _I18n = require("cozy-ui/transpiled/react/providers/I18n");
|
|
21
27
|
|
|
22
28
|
var _SearchProvider = require("./SearchProvider");
|
|
@@ -44,7 +50,8 @@ var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
|
44
50
|
onChange = _ref.onChange,
|
|
45
51
|
elevation = _ref.elevation,
|
|
46
52
|
size = _ref.size,
|
|
47
|
-
hasHalfBorderRadius = _ref.hasHalfBorderRadius
|
|
53
|
+
hasHalfBorderRadius = _ref.hasHalfBorderRadius,
|
|
54
|
+
className = _ref.className;
|
|
48
55
|
|
|
49
56
|
var _useI18n = (0, _I18n.useI18n)(),
|
|
50
57
|
t = _useI18n.t;
|
|
@@ -129,17 +136,17 @@ var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
|
129
136
|
onClickAway: onClear
|
|
130
137
|
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_SearchBar.default, {
|
|
131
138
|
elevation: elevation,
|
|
132
|
-
className: searchValue && hasHalfBorderRadius ? styles['searchBarDesktop--result'] : '',
|
|
139
|
+
className: (0, _classnames.default)(className, searchValue && hasHalfBorderRadius ? styles['searchBarDesktop--result'] : ''),
|
|
133
140
|
ref: searchRef,
|
|
134
141
|
size: size,
|
|
135
142
|
icon: size === 'large' ? /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
136
143
|
className: "u-mh-1",
|
|
137
|
-
icon: _AssistantIcon.AssistantIcon,
|
|
138
|
-
size: 32
|
|
144
|
+
icon: (0, _isTwakeTheme.isTwakeTheme)() ? _Magnifier.default : _AssistantIcon.AssistantIcon,
|
|
145
|
+
size: (0, _isTwakeTheme.isTwakeTheme)() ? 24 : 32
|
|
139
146
|
}) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
140
147
|
className: "u-ml-1 u-mr-half",
|
|
141
|
-
icon: _AssistantIcon.AssistantIcon,
|
|
142
|
-
size: 24
|
|
148
|
+
icon: (0, _isTwakeTheme.isTwakeTheme)() ? _Magnifier.default : _AssistantIcon.AssistantIcon,
|
|
149
|
+
size: (0, _isTwakeTheme.isTwakeTheme)() ? 16 : 24
|
|
143
150
|
}),
|
|
144
151
|
placeholder: (0, _helpers.isAssistantEnabled)() ? t('assistant.search.placeholder') : undefined // fallback on SearchBar default
|
|
145
152
|
,
|
|
@@ -161,7 +168,7 @@ var SearchBarDesktop = function SearchBarDesktop(_ref) {
|
|
|
161
168
|
|
|
162
169
|
SearchBarDesktop.defaultProps = {
|
|
163
170
|
size: 'large',
|
|
164
|
-
elevation:
|
|
171
|
+
elevation: 0
|
|
165
172
|
};
|
|
166
173
|
var _default = SearchBarDesktop;
|
|
167
174
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-search",
|
|
3
3
|
"description": "UI components about search bar and IA assistant",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cozy Cloud",
|
|
7
7
|
"url": "https://github.com/cozy"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"cozy-minilog": "^3.10.0",
|
|
34
34
|
"cozy-pouch-link": "^54.0.0",
|
|
35
35
|
"cozy-realtime": "^5.6.4",
|
|
36
|
-
"cozy-ui": "^
|
|
36
|
+
"cozy-ui": "^122.0.0",
|
|
37
37
|
"cross-fetch": "^4.0.0",
|
|
38
38
|
"jest": "26.6.3",
|
|
39
39
|
"react": "16.12.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"cozy-minilog": ">=3.3.1",
|
|
66
66
|
"cozy-pouch-link": "54.0.0",
|
|
67
67
|
"cozy-realtime": ">=5.6.4",
|
|
68
|
-
"cozy-ui": ">=
|
|
68
|
+
"cozy-ui": ">=122.0.0",
|
|
69
69
|
"react": ">=16.12.0",
|
|
70
70
|
"react-dom": ">=16.12.0",
|
|
71
71
|
"react-router-dom": "^6.28.0"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"lint": "cd .. && yarn eslint --ext js,jsx,ts packages/cozy-search"
|
|
88
88
|
},
|
|
89
89
|
"types": "dist/index.d.ts",
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "a55e06271c52f164be6d3e53a18440cd1352a471"
|
|
91
91
|
}
|