cozy-bar 35.4.13 → 36.0.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.
package/README.md CHANGED
@@ -74,6 +74,12 @@ Available slots:
74
74
  - `<BarSearch>` — Replaces the default search / AI assistant area
75
75
  - `<BarRight>` — Replaces the default help link, apps menu and user menu
76
76
 
77
+ To hide the home button and its divider on desktop (e.g. in the home app itself), use `noCozyHome`. On mobile, it shows the app title instead of the home button. In both cases, the app title links to the home app:
78
+
79
+ ```jsx
80
+ <BarComponent componentsProps={{ BarLeft: { noCozyHome: true } }} />
81
+ ```
82
+
77
83
  ## Search and AI assistant
78
84
 
79
85
  Search and AI assistant is now proposed by the cozy-bar. They are enabled by default so you need to:
@@ -105,6 +111,14 @@ To disable search:
105
111
  <BarComponent searchOptions={{ enabled: false }} />
106
112
  ```
107
113
 
114
+ To hide the AI assistant button in the search bar (e.g. when the assistant is already displayed):
115
+
116
+ ```jsx
117
+ <BarComponent
118
+ componentsProps={{ BarSearch: { disabledAssistantButton: true } }}
119
+ />
120
+ ```
121
+
108
122
  ## License
109
123
 
110
124
  Cozy Bar is distributed under the MIT license.
@@ -90,14 +90,13 @@ var Bar = function Bar(_ref) {
90
90
  }, barLeft || /*#__PURE__*/_react.default.createElement(_BarLeft.default, (0, _extends2.default)({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.BarLeft, {
91
91
  isPublic: isPublic,
92
92
  homeApp: homeApp,
93
- appSlug: appSlug,
94
93
  appIcon: appIcon,
95
94
  appTextIcon: appTextIcon
96
95
  })), barCenter, /*#__PURE__*/_react.default.createElement("div", {
97
96
  className: "u-flex-grow"
98
- }, barSearch || /*#__PURE__*/_react.default.createElement(_BarSearch.default, {
97
+ }, barSearch || /*#__PURE__*/_react.default.createElement(_BarSearch.default, (0, _extends2.default)({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.BarSearch, {
99
98
  isSearchEnabled: isSearchEnabled
100
- })), isSearchEnabled && isMobile ? /*#__PURE__*/_react.default.createElement(_SearchButton.default, null) : null, barRight, !isPublic && /*#__PURE__*/_react.default.createElement(_TwakeRight.default, {
99
+ }))), isSearchEnabled && isMobile ? /*#__PURE__*/_react.default.createElement(_SearchButton.default, null) : null, barRight, !isPublic && /*#__PURE__*/_react.default.createElement(_TwakeRight.default, {
101
100
  componentsProps: componentsProps,
102
101
  apps: apps,
103
102
  appSlug: appSlug,
@@ -119,6 +118,12 @@ Bar.propTypes = {
119
118
  Wrapper: _propTypes.default.shape({
120
119
  className: _propTypes.default.string
121
120
  }),
121
+ BarLeft: _propTypes.default.shape({
122
+ noCozyHome: _propTypes.default.bool
123
+ }),
124
+ BarSearch: _propTypes.default.shape({
125
+ disabledAssistantButton: _propTypes.default.bool
126
+ }),
122
127
  UserMenu: _propTypes.default.shape({
123
128
  showEmailDomainChip: _propTypes.default.bool
124
129
  })
@@ -26,7 +26,6 @@ var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
26
26
  var BarLeft = function BarLeft(_ref) {
27
27
  var isPublic = _ref.isPublic,
28
28
  homeApp = _ref.homeApp,
29
- appSlug = _ref.appSlug,
30
29
  appIcon = _ref.appIcon,
31
30
  appTextIcon = _ref.appTextIcon,
32
31
  noCozyHome = _ref.noCozyHome;
@@ -63,12 +62,11 @@ var BarLeft = function BarLeft(_ref) {
63
62
  });
64
63
  }
65
64
 
66
- var isHome = appSlug === 'home';
67
65
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
68
66
  container: true,
69
67
  alignItems: "center",
70
68
  className: "u-w-auto"
71
- }, !isHome && !noCozyHome && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
69
+ }, !noCozyHome && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
72
70
  homeHref: homeHref
73
71
  }), /*#__PURE__*/_react.default.createElement(_Divider.default, {
74
72
  orientation: "vertical",
@@ -7,14 +7,25 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+
10
14
  var _react = _interopRequireDefault(require("react"));
11
15
 
12
16
  var _cozySearch = require("cozy-search");
13
17
 
14
18
  var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
15
19
 
20
+ var _excluded = ["isSearchEnabled"];
21
+
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+
16
26
  var BarSearch = function BarSearch(_ref) {
17
- var isSearchEnabled = _ref.isSearchEnabled;
27
+ var isSearchEnabled = _ref.isSearchEnabled,
28
+ searchBarDesktopProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
18
29
 
19
30
  var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
20
31
  isMobile = _useBreakpoints.isMobile;
@@ -24,9 +35,9 @@ var BarSearch = function BarSearch(_ref) {
24
35
  className: "u-flex-grow u-mh-2"
25
36
  }, /*#__PURE__*/_react.default.createElement(_cozySearch.AssistantDesktop, {
26
37
  componentsProps: {
27
- SearchBarDesktop: {
38
+ SearchBarDesktop: _objectSpread({
28
39
  size: 'small'
29
- }
40
+ }, searchBarDesktopProps)
30
41
  }
31
42
  }));
32
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-bar",
3
- "version": "35.4.13",
3
+ "version": "36.0.0",
4
4
  "description": "cozy-bar.js library, a small lib provided by cozy-stack to inject the Cozy-bar component into each app",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy Cloud <contact@cozycloud.cc> (https://cozy.io/)",
@@ -75,5 +75,5 @@
75
75
  "react-router-dom": ">=6.14.2",
76
76
  "twake-i18n": ">=0.3.0"
77
77
  },
78
- "gitHead": "59aff51cc02c4315da7889122d476df36d4c90e2"
78
+ "gitHead": "cccec463c377c482baf37575aaaa62f60f8f559b"
79
79
  }