@atlaskit/quick-search 8.0.14 → 8.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/quick-search
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 8.0.15
14
+
15
+ ### Patch Changes
16
+
17
+ - [`be610dca836`](https://bitbucket.org/atlassian/atlassian-frontend/commits/be610dca836) - [ux] replace deprecated placeholder theme with tokens
18
+
3
19
  ## 8.0.14
4
20
 
5
21
  ### Patch Changes
@@ -87,6 +87,15 @@ var QuickSearch = /*#__PURE__*/function (_React$Component) {
87
87
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasSearchQueryEventFired", false);
88
88
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasKeyDownEventFired", false);
89
89
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lastKeyPressed", '');
90
+ /**
91
+ * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
92
+ * results were in a single, circular list.
93
+ *
94
+ * Process:
95
+ * 1. Finds the index of the selected result in the flatResults array,
96
+ * 2. Increments or decrements this index by the supplied adjustment amount,
97
+ * 3. Sets the new selectedResultId based on the modifed index
98
+ */
90
99
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "adjustSelectedResultIndex", function (adjustment) {
91
100
  var currentIndex = getResultIndexById(_this.flatResults, _this.state.selectedResultId);
92
101
  var newIndex = adjustIndex(_this.flatResults.length, currentIndex, adjustment);
@@ -101,33 +110,57 @@ var QuickSearch = /*#__PURE__*/function (_React$Component) {
101
110
  _this.props.onSelectedResultIdChanged(selectedResultId);
102
111
  }
103
112
  });
113
+ /** Select next result */
104
114
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectNext", function () {
105
115
  _this.adjustSelectedResultIndex(+1);
106
116
  });
117
+ /** Select previous result */
107
118
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectPrevious", function () {
108
119
  _this.adjustSelectedResultIndex(-1);
109
120
  });
121
+ /**
122
+ * Callback for register results in flatResults
123
+ */
110
124
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRegisterResult", function (result) {
111
125
  if (!getResultById(_this.flatResults, result.props.resultId)) {
112
126
  _this.flatResults.push(result);
113
127
  }
114
128
  });
129
+ /**
130
+ * Callback for unregister results in flatResults
131
+ * It will reconcile a list of results for keyboard navigation after every update.
132
+ * 1. Component starts with an empty list of results
133
+ * 2. componentDidMount / componentDidUpdate lifecycle methods in ResultBase will be invoked
134
+ * 3. All ResultBase components call registerResult() in order to register itself in quick search
135
+ * 4. All ResultBase components call unregisterResult() in order to unregister itself in quick search
136
+ */
115
137
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleUnregisterResult", function (result) {
116
138
  var resultIndex = getResultIndexById(_this.flatResults, result.props.resultId);
117
139
  if (resultIndex !== null && +resultIndex >= 0) {
118
140
  _this.flatResults.splice(resultIndex, 1);
119
141
  }
120
142
  });
143
+ /**
144
+ * Callback for mouseEnter events on individual results
145
+ * Move selection to hovered result
146
+ */
121
147
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResultMouseEnter", function (resultData) {
122
148
  _this.setState({
123
149
  selectedResultId: resultData && resultData.resultId
124
150
  });
125
151
  });
152
+ /**
153
+ * Callback for mouseLeave events on individual results
154
+ * Clear result selection
155
+ */
126
156
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleResultMouseLeave", function () {
127
157
  _this.setState({
128
158
  selectedResultId: null
129
159
  });
130
160
  });
161
+ /**
162
+ * Clear result selection when search input is blurred
163
+ */
131
164
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSearchBlur", function (event) {
132
165
  _this.props.onSearchBlur(event);
133
166
  _this.setState({
@@ -143,6 +176,13 @@ var QuickSearch = /*#__PURE__*/function (_React$Component) {
143
176
  onSearchInput(event);
144
177
  }
145
178
  });
179
+ /**
180
+ * Keyboard controls
181
+ * Up - Select previous result
182
+ * Down - Select next result
183
+ * Enter - Submit selected result
184
+ * Tab / ArrowRight - Accept autocomplete
185
+ */
146
186
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSearchKeyDown", function (event) {
147
187
  var firePrivateAnalyticsEvent = _this.props.firePrivateAnalyticsEvent;
148
188
  _this.props.onSearchKeyDown(event);
@@ -327,16 +367,6 @@ var QuickSearch = /*#__PURE__*/function (_React$Component) {
327
367
  }
328
368
  this.lastKeyPressed = '';
329
369
  }
330
-
331
- /**
332
- * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
333
- * results were in a single, circular list.
334
- *
335
- * Process:
336
- * 1. Finds the index of the selected result in the flatResults array,
337
- * 2. Increments or decrements this index by the supplied adjustment amount,
338
- * 3. Sets the new selectedResultId based on the modifed index
339
- */
340
370
  }, {
341
371
  key: "render",
342
372
  value: function render() {
@@ -21,6 +21,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
21
21
  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; }
22
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
+ // context is an optional prop but the component provides a defaultProp. However, TS still complains
25
+ // when you don't pass it. There doesn't seem to be a better way of declaring optional default props.
24
26
  var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
25
27
  (0, _inherits2.default)(ResultBase, _React$PureComponent);
26
28
  var _super = _createSuper(ResultBase);
@@ -25,7 +25,7 @@ var getPlaceholderStyle = function getPlaceholderStyle(style) {
25
25
  return (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n &::-webkit-input-placeholder {\n ", ";\n }\n &::-moz-placeholder {\n /* Mozilla Firefox 19+ */\n ", " opacity: 1;\n }\n &::-ms-input-placeholder {\n /* Microsoft Edge */\n ", ";\n }\n &:-moz-placeholder {\n /* Mozilla Firefox 4 to 18 */\n ", " opacity: 1;\n }\n &:-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n ", ";\n }\n"])), style, style, style, style, style);
26
26
  };
27
27
  exports.getPlaceholderStyle = getPlaceholderStyle;
28
- var getPlaceholderColor = (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.placeholderText);
28
+ var getPlaceholderColor = (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
29
29
  exports.getPlaceholderColor = getPlaceholderColor;
30
30
  var SearchInput = _styledComponents.default.input(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n background-color: transparent;\n border: 0;\n color: ", ";\n flex-grow: 1;\n font-size: 1.4em;\n outline: 0;\n // Safari adds 2px margin-left\n margin-left: 0;\n ", ";\n"])), _colors.N500, getPlaceholderStyle(getPlaceholderColor));
31
31
  exports.SearchInput = SearchInput;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/quick-search",
3
- "version": "8.0.14"
3
+ "version": "8.1.0"
4
4
  }
@@ -62,6 +62,15 @@ export class QuickSearch extends React.Component {
62
62
  _defineProperty(this, "hasSearchQueryEventFired", false);
63
63
  _defineProperty(this, "hasKeyDownEventFired", false);
64
64
  _defineProperty(this, "lastKeyPressed", '');
65
+ /**
66
+ * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
67
+ * results were in a single, circular list.
68
+ *
69
+ * Process:
70
+ * 1. Finds the index of the selected result in the flatResults array,
71
+ * 2. Increments or decrements this index by the supplied adjustment amount,
72
+ * 3. Sets the new selectedResultId based on the modifed index
73
+ */
65
74
  _defineProperty(this, "adjustSelectedResultIndex", adjustment => {
66
75
  const currentIndex = getResultIndexById(this.flatResults, this.state.selectedResultId);
67
76
  const newIndex = adjustIndex(this.flatResults.length, currentIndex, adjustment);
@@ -76,33 +85,57 @@ export class QuickSearch extends React.Component {
76
85
  this.props.onSelectedResultIdChanged(selectedResultId);
77
86
  }
78
87
  });
88
+ /** Select next result */
79
89
  _defineProperty(this, "selectNext", () => {
80
90
  this.adjustSelectedResultIndex(+1);
81
91
  });
92
+ /** Select previous result */
82
93
  _defineProperty(this, "selectPrevious", () => {
83
94
  this.adjustSelectedResultIndex(-1);
84
95
  });
96
+ /**
97
+ * Callback for register results in flatResults
98
+ */
85
99
  _defineProperty(this, "handleRegisterResult", result => {
86
100
  if (!getResultById(this.flatResults, result.props.resultId)) {
87
101
  this.flatResults.push(result);
88
102
  }
89
103
  });
104
+ /**
105
+ * Callback for unregister results in flatResults
106
+ * It will reconcile a list of results for keyboard navigation after every update.
107
+ * 1. Component starts with an empty list of results
108
+ * 2. componentDidMount / componentDidUpdate lifecycle methods in ResultBase will be invoked
109
+ * 3. All ResultBase components call registerResult() in order to register itself in quick search
110
+ * 4. All ResultBase components call unregisterResult() in order to unregister itself in quick search
111
+ */
90
112
  _defineProperty(this, "handleUnregisterResult", result => {
91
113
  const resultIndex = getResultIndexById(this.flatResults, result.props.resultId);
92
114
  if (resultIndex !== null && +resultIndex >= 0) {
93
115
  this.flatResults.splice(resultIndex, 1);
94
116
  }
95
117
  });
118
+ /**
119
+ * Callback for mouseEnter events on individual results
120
+ * Move selection to hovered result
121
+ */
96
122
  _defineProperty(this, "handleResultMouseEnter", resultData => {
97
123
  this.setState({
98
124
  selectedResultId: resultData && resultData.resultId
99
125
  });
100
126
  });
127
+ /**
128
+ * Callback for mouseLeave events on individual results
129
+ * Clear result selection
130
+ */
101
131
  _defineProperty(this, "handleResultMouseLeave", () => {
102
132
  this.setState({
103
133
  selectedResultId: null
104
134
  });
105
135
  });
136
+ /**
137
+ * Clear result selection when search input is blurred
138
+ */
106
139
  _defineProperty(this, "handleSearchBlur", event => {
107
140
  this.props.onSearchBlur(event);
108
141
  this.setState({
@@ -120,6 +153,13 @@ export class QuickSearch extends React.Component {
120
153
  onSearchInput(event);
121
154
  }
122
155
  });
156
+ /**
157
+ * Keyboard controls
158
+ * Up - Select previous result
159
+ * Down - Select next result
160
+ * Enter - Submit selected result
161
+ * Tab / ArrowRight - Accept autocomplete
162
+ */
123
163
  _defineProperty(this, "handleSearchKeyDown", event => {
124
164
  const {
125
165
  firePrivateAnalyticsEvent
@@ -313,17 +353,6 @@ export class QuickSearch extends React.Component {
313
353
  }
314
354
  this.lastKeyPressed = '';
315
355
  }
316
-
317
- /**
318
- * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
319
- * results were in a single, circular list.
320
- *
321
- * Process:
322
- * 1. Finds the index of the selected result in the flatResults array,
323
- * 2. Increments or decrements this index by the supplied adjustment amount,
324
- * 3. Sets the new selectedResultId based on the modifed index
325
- */
326
-
327
356
  render() {
328
357
  return /*#__PURE__*/React.createElement(AkSearch, {
329
358
  isLoading: this.props.isLoading,
@@ -4,6 +4,9 @@ import React from 'react';
4
4
  import { QS_ANALYTICS_EV_SUBMIT } from '../constants';
5
5
  import ResultItem from '../ResultItem/ResultItem';
6
6
  import { ResultContext, SelectedResultIdContext } from '../context';
7
+
8
+ // context is an optional prop but the component provides a defaultProp. However, TS still complains
9
+ // when you don't pass it. There doesn't seem to be a better way of declaring optional default props.
7
10
  export class ResultBase extends React.PureComponent {
8
11
  constructor(...args) {
9
12
  super(...args);
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { N0, N500, B200, placeholderText, N50 } from '@atlaskit/theme/colors';
2
+ import { N0, N200, N500, B200, N50 } from '@atlaskit/theme/colors';
3
3
  const inputRightPadding = "var(--ds-space-200, 16px)";
4
4
  export const SearchBox = styled.div`
5
5
  position: sticky;
@@ -49,7 +49,7 @@ export const getPlaceholderStyle = style => css`
49
49
  }
50
50
  `;
51
51
  export const getPlaceholderColor = css`
52
- color: ${placeholderText};
52
+ color: ${`var(--ds-text-subtlest, ${N200})`};
53
53
  `;
54
54
  export const SearchInput = styled.input`
55
55
  background-color: transparent;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/quick-search",
3
- "version": "8.0.14"
3
+ "version": "8.1.0"
4
4
  }
@@ -80,6 +80,15 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
80
80
  _defineProperty(_assertThisInitialized(_this), "hasSearchQueryEventFired", false);
81
81
  _defineProperty(_assertThisInitialized(_this), "hasKeyDownEventFired", false);
82
82
  _defineProperty(_assertThisInitialized(_this), "lastKeyPressed", '');
83
+ /**
84
+ * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
85
+ * results were in a single, circular list.
86
+ *
87
+ * Process:
88
+ * 1. Finds the index of the selected result in the flatResults array,
89
+ * 2. Increments or decrements this index by the supplied adjustment amount,
90
+ * 3. Sets the new selectedResultId based on the modifed index
91
+ */
83
92
  _defineProperty(_assertThisInitialized(_this), "adjustSelectedResultIndex", function (adjustment) {
84
93
  var currentIndex = getResultIndexById(_this.flatResults, _this.state.selectedResultId);
85
94
  var newIndex = adjustIndex(_this.flatResults.length, currentIndex, adjustment);
@@ -94,33 +103,57 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
94
103
  _this.props.onSelectedResultIdChanged(selectedResultId);
95
104
  }
96
105
  });
106
+ /** Select next result */
97
107
  _defineProperty(_assertThisInitialized(_this), "selectNext", function () {
98
108
  _this.adjustSelectedResultIndex(+1);
99
109
  });
110
+ /** Select previous result */
100
111
  _defineProperty(_assertThisInitialized(_this), "selectPrevious", function () {
101
112
  _this.adjustSelectedResultIndex(-1);
102
113
  });
114
+ /**
115
+ * Callback for register results in flatResults
116
+ */
103
117
  _defineProperty(_assertThisInitialized(_this), "handleRegisterResult", function (result) {
104
118
  if (!getResultById(_this.flatResults, result.props.resultId)) {
105
119
  _this.flatResults.push(result);
106
120
  }
107
121
  });
122
+ /**
123
+ * Callback for unregister results in flatResults
124
+ * It will reconcile a list of results for keyboard navigation after every update.
125
+ * 1. Component starts with an empty list of results
126
+ * 2. componentDidMount / componentDidUpdate lifecycle methods in ResultBase will be invoked
127
+ * 3. All ResultBase components call registerResult() in order to register itself in quick search
128
+ * 4. All ResultBase components call unregisterResult() in order to unregister itself in quick search
129
+ */
108
130
  _defineProperty(_assertThisInitialized(_this), "handleUnregisterResult", function (result) {
109
131
  var resultIndex = getResultIndexById(_this.flatResults, result.props.resultId);
110
132
  if (resultIndex !== null && +resultIndex >= 0) {
111
133
  _this.flatResults.splice(resultIndex, 1);
112
134
  }
113
135
  });
136
+ /**
137
+ * Callback for mouseEnter events on individual results
138
+ * Move selection to hovered result
139
+ */
114
140
  _defineProperty(_assertThisInitialized(_this), "handleResultMouseEnter", function (resultData) {
115
141
  _this.setState({
116
142
  selectedResultId: resultData && resultData.resultId
117
143
  });
118
144
  });
145
+ /**
146
+ * Callback for mouseLeave events on individual results
147
+ * Clear result selection
148
+ */
119
149
  _defineProperty(_assertThisInitialized(_this), "handleResultMouseLeave", function () {
120
150
  _this.setState({
121
151
  selectedResultId: null
122
152
  });
123
153
  });
154
+ /**
155
+ * Clear result selection when search input is blurred
156
+ */
124
157
  _defineProperty(_assertThisInitialized(_this), "handleSearchBlur", function (event) {
125
158
  _this.props.onSearchBlur(event);
126
159
  _this.setState({
@@ -136,6 +169,13 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
136
169
  onSearchInput(event);
137
170
  }
138
171
  });
172
+ /**
173
+ * Keyboard controls
174
+ * Up - Select previous result
175
+ * Down - Select next result
176
+ * Enter - Submit selected result
177
+ * Tab / ArrowRight - Accept autocomplete
178
+ */
139
179
  _defineProperty(_assertThisInitialized(_this), "handleSearchKeyDown", function (event) {
140
180
  var firePrivateAnalyticsEvent = _this.props.firePrivateAnalyticsEvent;
141
181
  _this.props.onSearchKeyDown(event);
@@ -320,16 +360,6 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
320
360
  }
321
361
  this.lastKeyPressed = '';
322
362
  }
323
-
324
- /**
325
- * Uses the virtual list, this.flatResults, to move the selection across grouped results as if
326
- * results were in a single, circular list.
327
- *
328
- * Process:
329
- * 1. Finds the index of the selected result in the flatResults array,
330
- * 2. Increments or decrements this index by the supplied adjustment amount,
331
- * 3. Sets the new selectedResultId based on the modifed index
332
- */
333
363
  }, {
334
364
  key: "render",
335
365
  value: function render() {
@@ -14,6 +14,9 @@ import React from 'react';
14
14
  import { QS_ANALYTICS_EV_SUBMIT } from '../constants';
15
15
  import ResultItem from '../ResultItem/ResultItem';
16
16
  import { ResultContext, SelectedResultIdContext } from '../context';
17
+
18
+ // context is an optional prop but the component provides a defaultProp. However, TS still complains
19
+ // when you don't pass it. There doesn't seem to be a better way of declaring optional default props.
17
20
  export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
18
21
  _inherits(ResultBase, _React$PureComponent);
19
22
  var _super = _createSuper(ResultBase);
@@ -1,7 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
3
3
  import styled, { css } from 'styled-components';
4
- import { N0, N500, B200, placeholderText, N50 } from '@atlaskit/theme/colors';
4
+ import { N0, N200, N500, B200, N50 } from '@atlaskit/theme/colors';
5
5
  var inputRightPadding = "var(--ds-space-200, 16px)";
6
6
  export var SearchBox = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: sticky;\n top: 0;\n background-color: ", ";\n color: ", ";\n display: flex;\n height: 36px;\n z-index: 10; /* required to keep the search box on top of icons in results when sticky */\n"])), N0, N500);
7
7
  export var SearchFieldBaseOuter = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n margin-right: auto;\n padding-bottom: 2px;\n border-bottom: 2px solid ", ";\n"])), B200);
@@ -10,7 +10,7 @@ export var SearchInner = styled.div(_templateObject4 || (_templateObject4 = _tag
10
10
  export var getPlaceholderStyle = function getPlaceholderStyle(style) {
11
11
  return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &::-webkit-input-placeholder {\n ", ";\n }\n &::-moz-placeholder {\n /* Mozilla Firefox 19+ */\n ", " opacity: 1;\n }\n &::-ms-input-placeholder {\n /* Microsoft Edge */\n ", ";\n }\n &:-moz-placeholder {\n /* Mozilla Firefox 4 to 18 */\n ", " opacity: 1;\n }\n &:-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n ", ";\n }\n"])), style, style, style, style, style);
12
12
  };
13
- export var getPlaceholderColor = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), placeholderText);
13
+ export var getPlaceholderColor = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"));
14
14
  export var SearchInput = styled.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 0;\n color: ", ";\n flex-grow: 1;\n font-size: 1.4em;\n outline: 0;\n // Safari adds 2px margin-left\n margin-left: 0;\n ", ";\n"])), N500, getPlaceholderStyle(getPlaceholderColor));
15
15
  export var SearchInputTypeAhead = styled(SearchInput)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n position: absolute;\n width: calc(100% - ", ");\n z-index: -1;\n"])), N50, inputRightPadding);
16
16
  export var SearchInputControlsContainer = styled.span(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n padding-left: ", ";\n"])), "var(--ds-space-300, 24px)");
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/quick-search",
3
- "version": "8.0.14"
3
+ "version": "8.1.0"
4
4
  }
@@ -4,7 +4,7 @@ export declare const SearchFieldBaseOuter: import("styled-components").StyledCom
4
4
  export declare const SearchFieldBaseInner: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
5
5
  export declare const SearchInner: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
6
6
  export declare const getPlaceholderStyle: (style: any) => import("styled-components").InterpolationValue[];
7
- export declare const getPlaceholderColor: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").ThemeProps | undefined, any>>[];
7
+ export declare const getPlaceholderColor: import("styled-components").InterpolationValue[];
8
8
  export declare const SearchInput: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, any, import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>>;
9
9
  export declare const SearchInputTypeAhead: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, any, import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>>;
10
10
  export declare const SearchInputControlsContainer: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, any, import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/quick-search",
3
- "version": "8.0.14",
3
+ "version": "8.1.0",
4
4
  "description": "A quick-search component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,12 +22,12 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@atlaskit/analytics": "^8.0.0",
26
- "@atlaskit/avatar": "^21.2.0",
27
- "@atlaskit/item": "^12.0.0",
28
- "@atlaskit/spinner": "^15.4.0",
29
- "@atlaskit/theme": "^12.3.0",
30
- "@atlaskit/tokens": "^1.2.6",
25
+ "@atlaskit/analytics": "^8.1.0",
26
+ "@atlaskit/avatar": "^21.3.0",
27
+ "@atlaskit/item": "^12.1.0",
28
+ "@atlaskit/spinner": "^15.5.0",
29
+ "@atlaskit/theme": "^12.5.0",
30
+ "@atlaskit/tokens": "^1.3.0",
31
31
  "@babel/runtime": "^7.0.0",
32
32
  "keycode": "^2.1.7"
33
33
  },
@@ -36,10 +36,10 @@
36
36
  "styled-components": "^3.2.6"
37
37
  },
38
38
  "devDependencies": {
39
- "@atlaskit/avatar": "^21.2.0",
39
+ "@atlaskit/avatar": "^21.3.0",
40
40
  "@atlaskit/docs": "*",
41
- "@atlaskit/drawer": "^7.4.0",
42
- "@atlaskit/icon": "^21.11.0",
41
+ "@atlaskit/drawer": "^7.5.0",
42
+ "@atlaskit/icon": "^21.12.0",
43
43
  "@atlaskit/navigation": "^37.0.0",
44
44
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
45
45
  "enzyme": "^3.10.0",
@@ -1,263 +0,0 @@
1
- ## API Report File for "@atlaskit/quick-search"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import { ComponentType } from 'react';
8
- import { default as React_2 } from 'react';
9
- import { ReactNode } from 'react';
10
-
11
- // @public (undocumented)
12
- export class AkNavigationItem extends React_2.PureComponent<Props_2> {
13
- // (undocumented)
14
- static defaultProps: Partial<Props_2>;
15
- // (undocumented)
16
- render(): JSX.Element;
17
- }
18
-
19
- // @public (undocumented)
20
- export class AkSearch extends React_2.PureComponent<Props_4> {
21
- // (undocumented)
22
- static defaultProps: Partial<Props_4>;
23
- // (undocumented)
24
- inputRef?: React_2.Ref<any>;
25
- // (undocumented)
26
- onInputKeyDown: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
27
- // (undocumented)
28
- render(): JSX.Element;
29
- // (undocumented)
30
- renderInputControls: () => JSX.Element | null;
31
- // (undocumented)
32
- setInputRef: (ref: React_2.Ref<any>) => void;
33
- }
34
-
35
- // @public (undocumented)
36
- type AnalyticsData = Object;
37
-
38
- // @public (undocumented)
39
- export type CancelableEvent = KeyboardEvent | MouseEvent | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>;
40
-
41
- // @public (undocumented)
42
- type CommonResultProps = {
43
- resultId: number | string;
44
- type?: string;
45
- avatarUrl?: string;
46
- avatar?: ReactNode;
47
- elemAfter?: ReactNode;
48
- selectedIcon?: ReactNode;
49
- href?: string;
50
- target?: string;
51
- isCompact?: boolean;
52
- onClick?: (resultData: ResultData) => void;
53
- analyticsData?: (() => AnalyticsData) | AnalyticsData;
54
- };
55
-
56
- // @public
57
- export class ContainerResult extends React_2.PureComponent<ContainerResultProps> {
58
- // (undocumented)
59
- getAvatar: () => {};
60
- // (undocumented)
61
- render(): JSX.Element;
62
- }
63
-
64
- // @public (undocumented)
65
- export type ContainerResultProps = CommonResultProps & {
66
- name: React_2.ReactNode;
67
- caption?: string;
68
- isPrivate?: boolean;
69
- subText?: React_2.ReactNode;
70
- };
71
-
72
- // @public (undocumented)
73
- const _default: React_2.ComponentClass<Props_3, any>;
74
- export { _default as AkQuickSearch }
75
- export { _default as QuickSearch }
76
-
77
- // @public (undocumented)
78
- type DefaultProps = {
79
- context: ResultContextType;
80
- };
81
-
82
- // @public
83
- export class ObjectResult extends React_2.PureComponent<ObjectResultProps> {
84
- // (undocumented)
85
- getAvatar: () => {};
86
- // (undocumented)
87
- getSubtext(): null | undefined | {};
88
- // (undocumented)
89
- render(): JSX.Element;
90
- }
91
-
92
- // @public (undocumented)
93
- export type ObjectResultProps = CommonResultProps & {
94
- name: React_2.ReactNode;
95
- caption?: string;
96
- containerName?: React_2.ReactNode;
97
- isPrivate?: boolean;
98
- objectKey?: React_2.ReactNode;
99
- };
100
-
101
- // @public (undocumented)
102
- export class PersonResult extends React_2.PureComponent<PersonResultProps> {
103
- // (undocumented)
104
- static defaultProps: Partial<PersonResultProps>;
105
- // (undocumented)
106
- getAvatar: () => {};
107
- // (undocumented)
108
- getMention: () => string | undefined;
109
- // (undocumented)
110
- render(): JSX.Element;
111
- }
112
-
113
- // @public (undocumented)
114
- export type PersonResultProps = CommonResultProps & {
115
- name: React_2.ReactNode;
116
- mentionName?: string;
117
- mentionPrefix?: string;
118
- presenceMessage?: React_2.ReactNode;
119
- presenceState?: 'busy' | 'offline' | 'online' | null;
120
- };
121
-
122
- // @public (undocumented)
123
- type Props = {
124
- title: React_2.ReactNode;
125
- children?: React_2.ReactNode;
126
- };
127
-
128
- // @public (undocumented)
129
- type Props_2 = {
130
- caption?: string;
131
- href?: string;
132
- target?: string;
133
- icon?: React_2.ReactNode;
134
- isCompact?: boolean;
135
- isSelected?: boolean;
136
- isMouseSelected?: boolean;
137
- onClick?(e: MouseEvent): void;
138
- onMouseEnter?: (e: MouseEvent) => void;
139
- onMouseLeave?: (e: MouseEvent) => void;
140
- subText?: React_2.ReactNode;
141
- text?: React_2.ReactNode;
142
- textAfter?: React_2.ReactNode;
143
- selectedIcon?: React_2.ReactNode;
144
- linkComponent?: React_2.ComponentType;
145
- };
146
-
147
- // @public (undocumented)
148
- type Props_3 = {
149
- children: React_2.ReactNode;
150
- isLoading?: boolean;
151
- onSearchBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
152
- onSearchInput?: (event: React_2.FormEvent<HTMLInputElement>, isAutocompleted?: boolean) => void;
153
- onSearchKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
154
- onSearchSubmit?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
155
- placeholder?: string;
156
- value?: string;
157
- selectedResultId?: SelectedResultId;
158
- onSelectedResultIdChanged?: (id: SelectedResultId) => void;
159
- firePrivateAnalyticsEvent?: (eventName: string, eventData: Object) => void;
160
- linkComponent?: React_2.ComponentType<any>;
161
- inputControls?: React_2.ReactNode;
162
- autocompleteText?: string;
163
- };
164
-
165
- // @public (undocumented)
166
- type Props_4 = {
167
- children?: React_2.ReactNode;
168
- inputControls?: React_2.ReactNode;
169
- isLoading?: boolean;
170
- onBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
171
- onInput?: (event: React_2.FormEvent<HTMLInputElement>) => void;
172
- onKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
173
- placeholder?: string;
174
- value?: string;
175
- autocompleteText?: string;
176
- };
177
-
178
- declare namespace quickSearchResultTypes {
179
- export {
180
- ContainerResult,
181
- ObjectResult,
182
- PersonResult,
183
- ResultBase
184
- }
185
- }
186
- export { quickSearchResultTypes }
187
-
188
- // @public (undocumented)
189
- export const ResultBase: (props: ResultBaseProps) => JSX.Element;
190
-
191
- // @public (undocumented)
192
- class ResultBase_2 extends React_2.PureComponent<DefaultProps & ResultBaseProps> {
193
- // (undocumented)
194
- componentDidMount(): void;
195
- // (undocumented)
196
- componentDidUpdate(): void;
197
- // (undocumented)
198
- componentWillUnmount(): void;
199
- // (undocumented)
200
- static defaultProps: Partial<ResultBaseProps>;
201
- // (undocumented)
202
- getAnalyticsData(): AnalyticsData;
203
- // (undocumented)
204
- handleClick: (e: MouseEvent) => void;
205
- // (undocumented)
206
- handleMouseEnter: (event: MouseEvent) => void;
207
- // (undocumented)
208
- handleMouseLeave: () => void;
209
- // (undocumented)
210
- registerResult(): void;
211
- // (undocumented)
212
- render(): JSX.Element;
213
- // (undocumented)
214
- state: {
215
- isMouseSelected: boolean;
216
- };
217
- }
218
-
219
- // @public (undocumented)
220
- export type ResultBaseProps = CommonResultProps & {
221
- type: string;
222
- text: React_2.ReactNode;
223
- subText?: React_2.ReactNode;
224
- caption?: string;
225
- icon?: React_2.ReactNode;
226
- context?: ResultContextType;
227
- };
228
-
229
- // @public (undocumented)
230
- type ResultContextType = {
231
- registerResult: (result: ResultBase_2) => void;
232
- unregisterResult: (result: ResultBase_2) => void;
233
- onMouseEnter: (resultData: ResultData) => void;
234
- onMouseLeave: () => void;
235
- sendAnalytics?: (eventName: string, eventData: Object) => void;
236
- getIndex: (resultId: ResultId) => null | number;
237
- linkComponent?: ComponentType;
238
- };
239
-
240
- // @public (undocumented)
241
- export type ResultData = {
242
- resultId: ResultId;
243
- type: string;
244
- event: CancelableEvent;
245
- };
246
-
247
- // @public (undocumented)
248
- type ResultId = number | string;
249
-
250
- // @public (undocumented)
251
- class ResultItemGroup extends React_2.Component<Props> {
252
- // (undocumented)
253
- render(): JSX.Element;
254
- }
255
- export { ResultItemGroup as AkNavigationItemGroup }
256
- export { ResultItemGroup }
257
-
258
- // @public (undocumented)
259
- type SelectedResultId = ResultId | null;
260
-
261
- // (No @packageDocumentation comment for this package)
262
-
263
- ```