@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
package/compass.yml
CHANGED
|
@@ -5,18 +5,74 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ResultItemTextAfter = exports.ResultItemSubText = exports.ResultItemIcon = exports.ResultItemGroupTitle = exports.ResultItemGroupHeader = exports.ResultItemCaption = exports.ResultItemAfterWrapper = exports.ResultItemAfter = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
13
|
+
var ResultItemGroupHeader = exports.ResultItemGroupHeader = _styledComponents.default.div({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
marginLeft: "var(--ds-space-negative-150, -12px)",
|
|
16
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
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
|
+
var ResultItemGroupTitle = exports.ResultItemGroupTitle = _styledComponents.default.div({
|
|
21
|
+
fontSize: '11px',
|
|
22
|
+
lineHeight: '16px',
|
|
23
|
+
fontWeight: 600
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
27
|
+
var ResultItemAfter = exports.ResultItemAfter = _styledComponents.default.div(function (props) {
|
|
28
|
+
return {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
30
|
+
minWidth: props.shouldTakeSpace ? '24px' : 0
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
35
|
+
var ResultItemAfterWrapper = exports.ResultItemAfterWrapper = _styledComponents.default.div({
|
|
36
|
+
display: 'flex'
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
40
|
+
var ResultItemCaption = exports.ResultItemCaption = _styledComponents.default.span({
|
|
41
|
+
color: _colors.N200,
|
|
42
|
+
fontSize: '12px',
|
|
43
|
+
marginLeft: "var(--ds-space-100, 8px)"
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
47
|
+
var ResultItemSubText = exports.ResultItemSubText = _styledComponents.default.span({
|
|
48
|
+
fontSize: '12px',
|
|
49
|
+
color: _colors.N200
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
53
|
+
var ResultItemIcon = exports.ResultItemIcon = _styledComponents.default.div({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
transition: 'padding 200ms',
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
60
|
+
'> *': {
|
|
61
|
+
flex: '1 0 auto'
|
|
62
|
+
},
|
|
63
|
+
/* We need to ensure that any image passed in as a child (<img/>, <svg/>
|
|
64
|
+
etc.) receives the correct width, height and border radius. We don't
|
|
65
|
+
currently assume that the image passed in is the correct dimensions, or has
|
|
66
|
+
width / height 100% */
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
|
+
'> img': {
|
|
69
|
+
height: "var(--ds-space-300, 24px)",
|
|
70
|
+
width: "var(--ds-space-300, 24px)"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
75
|
+
var ResultItemTextAfter = exports.ResultItemTextAfter = _styledComponents.default.div({
|
|
76
|
+
position: 'relative',
|
|
77
|
+
zIndex: 1
|
|
78
|
+
});
|
|
@@ -12,16 +12,20 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
15
|
var _react = _interopRequireDefault(require("react"));
|
|
17
16
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
18
17
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
18
|
var _styled = require("./styled");
|
|
20
|
-
var _templateObject;
|
|
21
19
|
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); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
21
|
var controlKeys = exports.controlKeys = ['ArrowUp', 'ArrowDown', 'Enter', 'Tab', 'ArrowRight'];
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
24
|
+
var SpinnerParent = _styledComponents.default.div({
|
|
25
|
+
height: "var(--ds-space-250, 20px)",
|
|
26
|
+
marginLeft: "var(--ds-space-150, 12px)",
|
|
27
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
28
|
+
});
|
|
25
29
|
var Search = exports.default = /*#__PURE__*/function (_React$PureComponent) {
|
|
26
30
|
(0, _inherits2.default)(Search, _React$PureComponent);
|
|
27
31
|
var _super = _createSuper(Search);
|
|
@@ -9,19 +9,68 @@ exports.getPlaceholderStyle = exports.getPlaceholderColor = exports.SearchInputT
|
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _templateObject, _templateObject2
|
|
12
|
+
var _templateObject, _templateObject2; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
var inputRightPadding = "var(--ds-space-200, 16px)";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
|
+
var SearchBox = exports.SearchBox = _styledComponents.default.div({
|
|
19
|
+
position: 'sticky',
|
|
20
|
+
top: 0,
|
|
21
|
+
backgroundColor: _colors.N0,
|
|
22
|
+
color: _colors.N500,
|
|
23
|
+
display: 'flex',
|
|
24
|
+
height: '36px',
|
|
25
|
+
zIndex: 10 /* required to keep the search box on top of icons in results when sticky */
|
|
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
|
+
var SearchFieldBaseOuter = exports.SearchFieldBaseOuter = _styledComponents.default.div({
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flex: 1,
|
|
32
|
+
marginRight: 'auto',
|
|
33
|
+
paddingBottom: "var(--ds-space-025, 2px)",
|
|
34
|
+
borderBottom: "2px solid ".concat(_colors.B200)
|
|
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
|
+
var SearchFieldBaseInner = exports.SearchFieldBaseInner = _styledComponents.default.div({
|
|
39
|
+
position: 'relative',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
paddingRight: inputRightPadding /* pad search text from FieldBase's isLoading spinner */,
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexGrow: 1
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
47
|
+
var SearchInner = exports.SearchInner = _styledComponents.default.div({
|
|
48
|
+
paddingRight: "var(--ds-space-300, 24px)"
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
20
52
|
var getPlaceholderStyle = exports.getPlaceholderStyle = function getPlaceholderStyle(style) {
|
|
21
|
-
return (0, _styledComponents.css)(
|
|
53
|
+
return (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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);
|
|
22
54
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
55
|
+
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
57
|
+
var getPlaceholderColor = exports.getPlaceholderColor = (0, _styledComponents.css)({
|
|
58
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// 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
|
|
62
|
+
var SearchInput = exports.SearchInput = _styledComponents.default.input(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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"])), _colors.N500, getPlaceholderStyle(getPlaceholderColor));
|
|
63
|
+
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
65
|
+
var SearchInputTypeAhead = exports.SearchInputTypeAhead = (0, _styledComponents.default)(SearchInput)({
|
|
66
|
+
color: _colors.N50,
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
width: "calc(100% - ".concat(inputRightPadding, ")"),
|
|
69
|
+
zIndex: -1
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
73
|
+
var SearchInputControlsContainer = exports.SearchInputControlsContainer = _styledComponents.default.span({
|
|
74
|
+
paddingLeft: "var(--ds-space-300, 24px)"
|
|
75
|
+
});
|
|
27
76
|
SearchInputControlsContainer.displayName = 'SearchInputControlsContainer'; // required for testing
|
|
@@ -1,53 +1,68 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import styled from 'styled-components';
|
|
2
3
|
import { N200 } from '@atlaskit/theme/colors';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
font-size: 11px;
|
|
10
|
-
line-height: 16px;
|
|
11
|
-
font-weight: 600;
|
|
12
|
-
`;
|
|
13
|
-
export const ResultItemAfter = styled.div`
|
|
14
|
-
min-width: ${({
|
|
15
|
-
shouldTakeSpace
|
|
16
|
-
}) => shouldTakeSpace ? '24px' : 0};
|
|
17
|
-
`;
|
|
18
|
-
export const ResultItemAfterWrapper = styled.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
`;
|
|
21
|
-
export const ResultItemCaption = styled.span`
|
|
22
|
-
color: ${N200};
|
|
23
|
-
font-size: 12px;
|
|
24
|
-
margin-left: ${"var(--ds-space-100, 8px)"};
|
|
25
|
-
`;
|
|
26
|
-
export const ResultItemSubText = styled.span`
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
color: ${N200};
|
|
29
|
-
`;
|
|
30
|
-
export const ResultItemIcon = styled.div`
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
transition: padding 200ms;
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
|
+
export const ResultItemGroupHeader = styled.div({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
marginLeft: "var(--ds-space-negative-150, -12px)",
|
|
8
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
9
|
+
});
|
|
36
10
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
|
+
export const ResultItemGroupTitle = styled.div({
|
|
13
|
+
fontSize: '11px',
|
|
14
|
+
lineHeight: '16px',
|
|
15
|
+
fontWeight: 600
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
19
|
+
export const ResultItemAfter = styled.div(props => ({
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
21
|
+
minWidth: props.shouldTakeSpace ? '24px' : 0
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
25
|
+
export const ResultItemAfterWrapper = styled.div({
|
|
26
|
+
display: 'flex'
|
|
27
|
+
});
|
|
40
28
|
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
30
|
+
export const ResultItemCaption = styled.span({
|
|
31
|
+
color: N200,
|
|
32
|
+
fontSize: '12px',
|
|
33
|
+
marginLeft: "var(--ds-space-100, 8px)"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
37
|
+
export const ResultItemSubText = styled.span({
|
|
38
|
+
fontSize: '12px',
|
|
39
|
+
color: N200
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
43
|
+
export const ResultItemIcon = styled.div({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
flexShrink: 0,
|
|
48
|
+
transition: 'padding 200ms',
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
50
|
+
'> *': {
|
|
51
|
+
flex: '1 0 auto'
|
|
52
|
+
},
|
|
41
53
|
/* We need to ensure that any image passed in as a child (<img/>, <svg/>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
etc.) receives the correct width, height and border radius. We don't
|
|
55
|
+
currently assume that the image passed in is the correct dimensions, or has
|
|
56
|
+
width / height 100% */
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
58
|
+
'> img': {
|
|
59
|
+
height: "var(--ds-space-300, 24px)",
|
|
60
|
+
width: "var(--ds-space-300, 24px)"
|
|
48
61
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
65
|
+
export const ResultItemTextAfter = styled.div({
|
|
66
|
+
position: 'relative',
|
|
67
|
+
zIndex: 1
|
|
68
|
+
});
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import styled from 'styled-components';
|
|
5
6
|
import { SearchBox, SearchFieldBaseInner, SearchInner, SearchInput, SearchFieldBaseOuter, SearchInputControlsContainer, SearchInputTypeAhead } from './styled';
|
|
6
7
|
export const controlKeys = ['ArrowUp', 'ArrowDown', 'Enter', 'Tab', 'ArrowRight'];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
10
|
+
const SpinnerParent = styled.div({
|
|
11
|
+
height: "var(--ds-space-250, 20px)",
|
|
12
|
+
marginLeft: "var(--ds-space-150, 12px)",
|
|
13
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
14
|
+
});
|
|
12
15
|
export default class Search extends React.PureComponent {
|
|
13
16
|
constructor(...args) {
|
|
14
17
|
super(...args);
|
|
@@ -1,74 +1,93 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import styled, { css } from 'styled-components';
|
|
2
3
|
import { N0, N200, N500, B200, N50 } from '@atlaskit/theme/colors';
|
|
3
4
|
const inputRightPadding = "var(--ds-space-200, 16px)";
|
|
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
|
-
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
7
|
+
export const SearchBox = styled.div({
|
|
8
|
+
position: 'sticky',
|
|
9
|
+
top: 0,
|
|
10
|
+
backgroundColor: N0,
|
|
11
|
+
color: N500,
|
|
12
|
+
display: 'flex',
|
|
13
|
+
height: '36px',
|
|
14
|
+
zIndex: 10 /* required to keep the search box on top of icons in results when sticky */
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
|
+
export const SearchFieldBaseOuter = styled.div({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flex: 1,
|
|
21
|
+
marginRight: 'auto',
|
|
22
|
+
paddingBottom: "var(--ds-space-025, 2px)",
|
|
23
|
+
borderBottom: `2px solid ${B200}`
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
27
|
+
export const SearchFieldBaseInner = styled.div({
|
|
28
|
+
position: 'relative',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
paddingRight: inputRightPadding /* pad search text from FieldBase's isLoading spinner */,
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexGrow: 1
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
36
|
+
export const SearchInner = styled.div({
|
|
37
|
+
paddingRight: "var(--ds-space-300, 24px)"
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
30
41
|
export const getPlaceholderStyle = style => css`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`;
|
|
51
|
-
export const getPlaceholderColor = css`
|
|
52
|
-
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
42
|
+
&::-webkit-input-placeholder {
|
|
43
|
+
${style};
|
|
44
|
+
}
|
|
45
|
+
&::-moz-placeholder {
|
|
46
|
+
/* Mozilla Firefox 19+ */
|
|
47
|
+
${style} opacity: 1;
|
|
48
|
+
}
|
|
49
|
+
&::-ms-input-placeholder {
|
|
50
|
+
/* Microsoft Edge */
|
|
51
|
+
${style};
|
|
52
|
+
}
|
|
53
|
+
&:-moz-placeholder {
|
|
54
|
+
/* Mozilla Firefox 4 to 18 */
|
|
55
|
+
${style} opacity: 1;
|
|
56
|
+
}
|
|
57
|
+
&:-ms-input-placeholder {
|
|
58
|
+
/* Internet Explorer 10-11 */
|
|
59
|
+
${style};
|
|
60
|
+
}
|
|
53
61
|
`;
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
64
|
+
export const getPlaceholderColor = css({
|
|
65
|
+
color: `var(--ds-text-subtlest, ${N200})`
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// 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
|
|
54
69
|
export const SearchInput = styled.input`
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`;
|
|
65
|
-
export const SearchInputTypeAhead = styled(SearchInput)`
|
|
66
|
-
color: ${N50};
|
|
67
|
-
position: absolute;
|
|
68
|
-
width: calc(100% - ${inputRightPadding});
|
|
69
|
-
z-index: -1;
|
|
70
|
-
`;
|
|
71
|
-
export const SearchInputControlsContainer = styled.span`
|
|
72
|
-
padding-left: ${"var(--ds-space-300, 24px)"};
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
border: 0;
|
|
72
|
+
color: ${N500};
|
|
73
|
+
flex-grow: 1;
|
|
74
|
+
font-size: 1.4em;
|
|
75
|
+
outline: 0;
|
|
76
|
+
// Safari adds 2px margin-left
|
|
77
|
+
margin-left: 0;
|
|
78
|
+
${getPlaceholderStyle(getPlaceholderColor)};
|
|
73
79
|
`;
|
|
80
|
+
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
82
|
+
export const SearchInputTypeAhead = styled(SearchInput)({
|
|
83
|
+
color: N50,
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
width: `calc(100% - ${inputRightPadding})`,
|
|
86
|
+
zIndex: -1
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
90
|
+
export const SearchInputControlsContainer = styled.span({
|
|
91
|
+
paddingLeft: "var(--ds-space-300, 24px)"
|
|
92
|
+
});
|
|
74
93
|
SearchInputControlsContainer.displayName = 'SearchInputControlsContainer'; // required for testing
|
|
@@ -1,15 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import { N200 } from '@atlaskit/theme/colors';
|
|
5
|
-
|
|
6
|
-
export var
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export var
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
5
|
+
export var ResultItemGroupHeader = styled.div({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
marginLeft: "var(--ds-space-negative-150, -12px)",
|
|
8
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
|
+
export var ResultItemGroupTitle = styled.div({
|
|
13
|
+
fontSize: '11px',
|
|
14
|
+
lineHeight: '16px',
|
|
15
|
+
fontWeight: 600
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
19
|
+
export var ResultItemAfter = styled.div(function (props) {
|
|
20
|
+
return {
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
22
|
+
minWidth: props.shouldTakeSpace ? '24px' : 0
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
27
|
+
export var ResultItemAfterWrapper = styled.div({
|
|
28
|
+
display: 'flex'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
32
|
+
export var ResultItemCaption = styled.span({
|
|
33
|
+
color: N200,
|
|
34
|
+
fontSize: '12px',
|
|
35
|
+
marginLeft: "var(--ds-space-100, 8px)"
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
39
|
+
export var ResultItemSubText = styled.span({
|
|
40
|
+
fontSize: '12px',
|
|
41
|
+
color: N200
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
45
|
+
export var ResultItemIcon = styled.div({
|
|
46
|
+
display: 'flex',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
flexShrink: 0,
|
|
50
|
+
transition: 'padding 200ms',
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
52
|
+
'> *': {
|
|
53
|
+
flex: '1 0 auto'
|
|
54
|
+
},
|
|
55
|
+
/* We need to ensure that any image passed in as a child (<img/>, <svg/>
|
|
56
|
+
etc.) receives the correct width, height and border radius. We don't
|
|
57
|
+
currently assume that the image passed in is the correct dimensions, or has
|
|
58
|
+
width / height 100% */
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
60
|
+
'> img': {
|
|
61
|
+
height: "var(--ds-space-300, 24px)",
|
|
62
|
+
width: "var(--ds-space-300, 24px)"
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
67
|
+
export var ResultItemTextAfter = styled.div({
|
|
68
|
+
position: 'relative',
|
|
69
|
+
zIndex: 1
|
|
70
|
+
});
|
|
@@ -5,16 +5,21 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
|
-
var _templateObject;
|
|
10
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
10
|
import React from 'react';
|
|
13
11
|
import Spinner from '@atlaskit/spinner';
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
13
|
import styled from 'styled-components';
|
|
15
14
|
import { SearchBox, SearchFieldBaseInner, SearchInner, SearchInput, SearchFieldBaseOuter, SearchInputControlsContainer, SearchInputTypeAhead } from './styled';
|
|
16
15
|
export var controlKeys = ['ArrowUp', 'ArrowDown', 'Enter', 'Tab', 'ArrowRight'];
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
18
|
+
var SpinnerParent = styled.div({
|
|
19
|
+
height: "var(--ds-space-250, 20px)",
|
|
20
|
+
marginLeft: "var(--ds-space-150, 12px)",
|
|
21
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
22
|
+
});
|
|
18
23
|
var Search = /*#__PURE__*/function (_React$PureComponent) {
|
|
19
24
|
_inherits(Search, _React$PureComponent);
|
|
20
25
|
var _super = _createSuper(Search);
|