@atlaskit/quick-search 8.1.10 → 8.1.11
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 +261 -114
- package/compass.yml +0 -1
- package/dist/cjs/components/ResultItem/styled.js +69 -13
- package/dist/cjs/components/Search/Search.js +8 -4
- package/dist/cjs/components/Search/styled.js +59 -10
- package/dist/es2019/components/ResultItem/styled.js +62 -47
- package/dist/es2019/components/Search/Search.js +8 -5
- package/dist/es2019/components/Search/styled.js +85 -66
- package/dist/esm/components/ResultItem/styled.js +68 -13
- package/dist/esm/components/Search/Search.js +8 -3
- package/dist/esm/components/Search/styled.js +60 -10
- package/dist/types/components/QuickSearch.d.ts +3 -3
- package/dist/types/components/Results/ContainerResult.d.ts +1 -1
- package/dist/types/components/Results/ObjectResult.d.ts +1 -1
- package/dist/types/components/Results/PersonResult.d.ts +1 -1
- package/dist/types/components/Results/ResultBase.d.ts +2 -2
- package/dist/types/components/Results/types.d.ts +1 -1
- package/dist/types/components/context.d.ts +3 -3
- package/dist/types/components/decorateWithAnalyticsData.d.ts +1 -1
- package/dist/types-ts4.5/components/QuickSearch.d.ts +3 -3
- package/dist/types-ts4.5/components/Results/ContainerResult.d.ts +1 -1
- package/dist/types-ts4.5/components/Results/ObjectResult.d.ts +1 -1
- package/dist/types-ts4.5/components/Results/PersonResult.d.ts +1 -1
- package/dist/types-ts4.5/components/Results/ResultBase.d.ts +2 -2
- package/dist/types-ts4.5/components/Results/types.d.ts +1 -1
- package/dist/types-ts4.5/components/context.d.ts +3 -3
- package/dist/types-ts4.5/components/decorateWithAnalyticsData.d.ts +1 -1
- package/docs/0-intro.tsx +8 -18
- package/package.json +55 -57
- package/report.api.md +152 -156
|
@@ -1,17 +1,67 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import styled, { css } from 'styled-components';
|
|
4
5
|
import { N0, N200, N500, B200, N50 } from '@atlaskit/theme/colors';
|
|
5
6
|
var inputRightPadding = "var(--ds-space-200, 16px)";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export var
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
9
|
+
export var SearchBox = styled.div({
|
|
10
|
+
position: 'sticky',
|
|
11
|
+
top: 0,
|
|
12
|
+
backgroundColor: N0,
|
|
13
|
+
color: N500,
|
|
14
|
+
display: 'flex',
|
|
15
|
+
height: '36px',
|
|
16
|
+
zIndex: 10 /* required to keep the search box on top of icons in results when sticky */
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
20
|
+
export var SearchFieldBaseOuter = styled.div({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flex: 1,
|
|
23
|
+
marginRight: 'auto',
|
|
24
|
+
paddingBottom: "var(--ds-space-025, 2px)",
|
|
25
|
+
borderBottom: "2px solid ".concat(B200)
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
29
|
+
export var SearchFieldBaseInner = styled.div({
|
|
30
|
+
position: 'relative',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
paddingRight: inputRightPadding /* pad search text from FieldBase's isLoading spinner */,
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexGrow: 1
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
38
|
+
export var SearchInner = styled.div({
|
|
39
|
+
paddingRight: "var(--ds-space-300, 24px)"
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
10
43
|
export var getPlaceholderStyle = function getPlaceholderStyle(style) {
|
|
11
|
-
return css(
|
|
44
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t&::-webkit-input-placeholder {\n\t\t", ";\n\t}\n\t&::-moz-placeholder {\n\t\t/* Mozilla Firefox 19+ */\n\t\t", " opacity: 1;\n\t}\n\t&::-ms-input-placeholder {\n\t\t/* Microsoft Edge */\n\t\t", ";\n\t}\n\t&:-moz-placeholder {\n\t\t/* Mozilla Firefox 4 to 18 */\n\t\t", " opacity: 1;\n\t}\n\t&:-ms-input-placeholder {\n\t\t/* Internet Explorer 10-11 */\n\t\t", ";\n\t}\n"])), style, style, style, style, style);
|
|
12
45
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export var
|
|
16
|
-
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
48
|
+
export var getPlaceholderColor = css({
|
|
49
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
53
|
+
export var SearchInput = styled.input(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tbackground-color: transparent;\n\tborder: 0;\n\tcolor: ", ";\n\tflex-grow: 1;\n\tfont-size: 1.4em;\n\toutline: 0;\n\t// Safari adds 2px margin-left\n\tmargin-left: 0;\n\t", ";\n"])), N500, getPlaceholderStyle(getPlaceholderColor));
|
|
54
|
+
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
56
|
+
export var SearchInputTypeAhead = styled(SearchInput)({
|
|
57
|
+
color: N50,
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
width: "calc(100% - ".concat(inputRightPadding, ")"),
|
|
60
|
+
zIndex: -1
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
64
|
+
export var SearchInputControlsContainer = styled.span({
|
|
65
|
+
paddingLeft: "var(--ds-space-300, 24px)"
|
|
66
|
+
});
|
|
17
67
|
SearchInputControlsContainer.displayName = 'SearchInputControlsContainer'; // required for testing
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ResultData, SelectedResultId } from './Results/types';
|
|
3
|
-
import { ResultContextType } from './context';
|
|
4
|
-
import { ResultBase } from './Results/ResultBase';
|
|
2
|
+
import { type ResultData, type SelectedResultId } from './Results/types';
|
|
3
|
+
import { type ResultContextType } from './context';
|
|
4
|
+
import { type ResultBase } from './Results/ResultBase';
|
|
5
5
|
export type Props = {
|
|
6
6
|
/** Search results in the form of ResultItemGroups containing Result components */
|
|
7
7
|
children: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnalyticsData, CommonResultProps } from './types';
|
|
3
|
-
import { ResultContextType } from '../context';
|
|
2
|
+
import { type AnalyticsData, type CommonResultProps } from './types';
|
|
3
|
+
import { type ResultContextType } from '../context';
|
|
4
4
|
export type Props = CommonResultProps & {
|
|
5
5
|
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
6
6
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
import { ResultData, ResultId, SelectedResultId } from './Results/types';
|
|
4
|
-
import { ResultBase } from './Results/ResultBase';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
import { type ResultData, type ResultId, type SelectedResultId } from './Results/types';
|
|
4
|
+
import { type ResultBase } from './Results/ResultBase';
|
|
5
5
|
export type ResultContextType = {
|
|
6
6
|
/** Register result as keyboard navigation target */
|
|
7
7
|
registerResult: (result: ResultBase) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ResultData, SelectedResultId } from './Results/types';
|
|
3
|
-
import { ResultContextType } from './context';
|
|
4
|
-
import { ResultBase } from './Results/ResultBase';
|
|
2
|
+
import { type ResultData, type SelectedResultId } from './Results/types';
|
|
3
|
+
import { type ResultContextType } from './context';
|
|
4
|
+
import { type ResultBase } from './Results/ResultBase';
|
|
5
5
|
export type Props = {
|
|
6
6
|
/** Search results in the form of ResultItemGroups containing Result components */
|
|
7
7
|
children: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
2
|
+
import { type CommonResultProps } from './types';
|
|
3
3
|
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnalyticsData, CommonResultProps } from './types';
|
|
3
|
-
import { ResultContextType } from '../context';
|
|
2
|
+
import { type AnalyticsData, type CommonResultProps } from './types';
|
|
3
|
+
import { type ResultContextType } from '../context';
|
|
4
4
|
export type Props = CommonResultProps & {
|
|
5
5
|
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
6
6
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
import { ResultData, ResultId, SelectedResultId } from './Results/types';
|
|
4
|
-
import { ResultBase } from './Results/ResultBase';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
import { type ResultData, type ResultId, type SelectedResultId } from './Results/types';
|
|
4
|
+
import { type ResultBase } from './Results/ResultBase';
|
|
5
5
|
export type ResultContextType = {
|
|
6
6
|
/** Register result as keyboard navigation target */
|
|
7
7
|
registerResult: (result: ResultBase) => void;
|
package/docs/0-intro.tsx
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
md,
|
|
4
|
-
Example,
|
|
5
|
-
Props,
|
|
6
|
-
code,
|
|
7
|
-
AtlassianInternalWarning,
|
|
8
|
-
} from '@atlaskit/docs';
|
|
2
|
+
import { md, Example, Props, code, AtlassianInternalWarning } from '@atlaskit/docs';
|
|
9
3
|
|
|
10
4
|
export default md`
|
|
11
5
|
${(<AtlassianInternalWarning />)}
|
|
@@ -37,17 +31,13 @@ export default md`
|
|
|
37
31
|
`}
|
|
38
32
|
|
|
39
33
|
${(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
<Example
|
|
35
|
+
Component={require('../examples/1-Object-Results').default}
|
|
36
|
+
title="Objects"
|
|
37
|
+
source={require('!!raw-loader!../examples/1-Object-Results')}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
46
40
|
|
|
47
|
-
${(
|
|
48
|
-
<Props
|
|
49
|
-
props={require('!!extract-react-types-loader!../src/components/QuickSearch')}
|
|
50
|
-
/>
|
|
51
|
-
)}
|
|
41
|
+
${(<Props props={require('!!extract-react-types-loader!../src/components/QuickSearch')} />)}
|
|
52
42
|
|
|
53
43
|
`;
|
package/package.json
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
2
|
+
"name": "@atlaskit/quick-search",
|
|
3
|
+
"version": "8.1.11",
|
|
4
|
+
"description": "A quick-search component",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"atlaskit:src": "src/index.ts",
|
|
24
|
+
"atlassian": {
|
|
25
|
+
"team": "Search Platform: Search Experience",
|
|
26
|
+
"releaseModel": "continuous",
|
|
27
|
+
"website": {
|
|
28
|
+
"name": "Quick Search"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@atlaskit/analytics": "^8.1.0",
|
|
33
|
+
"@atlaskit/avatar": "^21.14.0",
|
|
34
|
+
"@atlaskit/item": "^12.1.0",
|
|
35
|
+
"@atlaskit/spinner": "^16.3.0",
|
|
36
|
+
"@atlaskit/theme": "^13.0.0",
|
|
37
|
+
"@atlaskit/tokens": "^1.58.0",
|
|
38
|
+
"@babel/runtime": "^7.0.0",
|
|
39
|
+
"keycode": "^2.1.7"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": "^16.8.0",
|
|
43
|
+
"styled-components": "^3.2.6"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"enzyme": "^3.10.0",
|
|
47
|
+
"prop-types": "^15.5.10",
|
|
48
|
+
"react": "^16.8.0",
|
|
49
|
+
"sinon": "^2.2.0",
|
|
50
|
+
"typescript": "~5.4.2",
|
|
51
|
+
"uuid": "^3.1.0"
|
|
52
|
+
},
|
|
53
|
+
"af:exports": {
|
|
54
|
+
".": "./src/index.ts"
|
|
55
|
+
}
|
|
56
|
+
}
|