cozy-search 2.2.9 → 2.2.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.
@@ -126,7 +126,13 @@ var AssistantSelection = function AssistantSelection(_ref) {
126
126
  label: isMobile ? /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
127
127
  icon: _twakeIcons.Dropdown,
128
128
  size: 16
129
- }) : selectedAssistant.name
129
+ }) : /*#__PURE__*/_react.default.createElement("span", {
130
+ className: "u-flex u-flex-items-center"
131
+ }, selectedAssistant.name, !disabled && /*#__PURE__*/_react.default.createElement(_twakeIcons.Icon, {
132
+ icon: _twakeIcons.Dropdown,
133
+ size: 16,
134
+ className: "u-ml-half u-flex-shrink-0"
135
+ }))
130
136
  }, disabled ? {
131
137
  className: styles['chip'],
132
138
  'aria-disabled': true
@@ -30,7 +30,20 @@ var WebSearchChip = function WebSearchChip(_ref) {
30
30
  t = _useI18n.t;
31
31
 
32
32
  var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
33
- isMobile = _useBreakpoints.isMobile;
33
+ isMobile = _useBreakpoints.isMobile; // Pointer activation leaves the DOM focus on the chip, and the `:focus`
34
+ // background is darker than the plain ghost one: the toggled chip then looks
35
+ // different from the sibling source chips (which are not clickable) until
36
+ // something else takes the focus. Drop it for pointer activation only
37
+ // (`detail > 0`), so keyboard users keep their focus ring.
38
+
39
+
40
+ var handleClick = function handleClick(event) {
41
+ if (event.detail > 0) {
42
+ event.currentTarget.blur();
43
+ }
44
+
45
+ onToggleWebsearch(event);
46
+ };
34
47
 
35
48
  return /*#__PURE__*/_react.default.createElement(_Chips.default, {
36
49
  "aria-pressed": websearchEnabled,
@@ -54,7 +67,7 @@ var WebSearchChip = function WebSearchChip(_ref) {
54
67
  label: 'u-pl-0 u-fz-tiny'
55
68
  },
56
69
  className: "u-mr-half",
57
- onClick: onToggleWebsearch
70
+ onClick: handleClick
58
71
  });
59
72
  };
60
73
 
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.OPENRAG_MODEL = exports.FETCH_CONVERSATIONS_LIMIT = exports.DEFAULT_ASSISTANT = void 0;
7
7
  var DEFAULT_ASSISTANT = {
8
8
  _id: 'default_ai_assistant',
9
- name: 'AI Assistant'
9
+ name: 'AI Agent'
10
10
  };
11
11
  exports.DEFAULT_ASSISTANT = DEFAULT_ASSISTANT;
12
12
  var FETCH_CONVERSATIONS_LIMIT = 50;
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": "2.2.9",
4
+ "version": "2.2.10",
5
5
  "author": {
6
6
  "name": "Cozy Cloud",
7
7
  "url": "https://github.com/cozy"
@@ -96,5 +96,5 @@
96
96
  "lint": "cd .. && yarn eslint --ext js,jsx,ts packages/cozy-search"
97
97
  },
98
98
  "types": "dist/index.d.ts",
99
- "gitHead": "f173ec5ce78ad2bf5f9abd174f8cef980a8ebfc7"
99
+ "gitHead": "dc270b68e549972aafc7a97452ee175af82fabd7"
100
100
  }