@atlaskit/link-picker 1.48.3 → 1.49.1
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 +17 -0
- package/dist/cjs/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/cjs/common/generic-error-svg/index.js +34 -25
- package/dist/cjs/common/generic-error-svg/old/index.js +66 -0
- package/dist/cjs/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/cjs/common/ui/empty-state/index.js +26 -14
- package/dist/cjs/common/ui/empty-state/old/index.js +38 -0
- package/dist/cjs/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/cjs/common/ui/min-height-container/index.js +24 -14
- package/dist/cjs/common/ui/min-height-container/old/index.js +34 -0
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +24 -18
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/old/index.js +50 -0
- package/dist/cjs/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/cjs/ui/link-picker/form-footer/index.js +30 -35
- package/dist/cjs/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -8
- package/dist/cjs/ui/link-picker/form-footer/old/index.js +116 -0
- package/dist/cjs/ui/link-picker/index.compiled.css +10 -0
- package/dist/cjs/ui/link-picker/index.js +45 -59
- package/dist/cjs/ui/link-picker/old/index.js +435 -0
- package/dist/cjs/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/cjs/ui/link-picker/search-results/index.js +33 -32
- package/dist/cjs/ui/link-picker/search-results/link-search-error/index.js +5 -11
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +55 -43
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +36 -28
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +70 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +99 -76
- package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/old/index.js +145 -0
- package/dist/cjs/ui/link-picker/search-results/link-search-list/old/index.js +188 -0
- package/dist/cjs/ui/link-picker/search-results/old/index.js +105 -0
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +54 -42
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/old/index.js +163 -0
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +21 -19
- package/dist/cjs/ui/link-picker/search-results/search-results-container/old/index.js +43 -0
- package/dist/cjs/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/cjs/ui/link-picker/text-input/index.js +36 -39
- package/dist/cjs/ui/link-picker/text-input/old/index.js +125 -0
- package/dist/cjs/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/cjs/ui/loader-fallback/index.js +21 -15
- package/dist/cjs/ui/loader-fallback/old/index.js +67 -0
- package/dist/cjs/ui/main.compiled.css +1 -0
- package/dist/cjs/ui/main.js +25 -24
- package/dist/cjs/ui/old/main.js +75 -0
- package/dist/es2019/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/es2019/common/generic-error-svg/index.js +27 -23
- package/dist/es2019/common/generic-error-svg/old/index.js +58 -0
- package/dist/es2019/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/es2019/common/ui/empty-state/index.js +18 -9
- package/dist/es2019/common/ui/empty-state/old/index.js +32 -0
- package/dist/es2019/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/es2019/common/ui/min-height-container/index.js +21 -12
- package/dist/es2019/common/ui/min-height-container/old/index.js +25 -0
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +20 -16
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/old/index.js +41 -0
- package/dist/es2019/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/es2019/ui/link-picker/form-footer/index.js +27 -32
- package/dist/es2019/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -7
- package/dist/es2019/ui/link-picker/form-footer/old/index.js +104 -0
- package/dist/es2019/ui/link-picker/index.compiled.css +10 -0
- package/dist/es2019/ui/link-picker/index.js +38 -58
- package/dist/es2019/ui/link-picker/old/index.js +436 -0
- package/dist/es2019/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/es2019/ui/link-picker/search-results/index.js +29 -31
- package/dist/es2019/ui/link-picker/search-results/link-search-error/index.js +5 -10
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +48 -42
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +29 -26
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +63 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +77 -72
- package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/old/index.js +132 -0
- package/dist/es2019/ui/link-picker/search-results/link-search-list/old/index.js +178 -0
- package/dist/es2019/ui/link-picker/search-results/old/index.js +98 -0
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.js +39 -39
- package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/old/index.js +130 -0
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +16 -16
- package/dist/es2019/ui/link-picker/search-results/search-results-container/old/index.js +37 -0
- package/dist/es2019/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/es2019/ui/link-picker/text-input/index.js +30 -38
- package/dist/es2019/ui/link-picker/text-input/old/index.js +121 -0
- package/dist/es2019/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/es2019/ui/loader-fallback/index.js +17 -13
- package/dist/es2019/ui/loader-fallback/old/index.js +60 -0
- package/dist/es2019/ui/main.compiled.css +1 -0
- package/dist/es2019/ui/main.js +24 -22
- package/dist/es2019/ui/old/main.js +73 -0
- package/dist/esm/common/generic-error-svg/index.compiled.css +2 -0
- package/dist/esm/common/generic-error-svg/index.js +30 -23
- package/dist/esm/common/generic-error-svg/old/index.js +58 -0
- package/dist/esm/common/ui/empty-state/index.compiled.css +3 -0
- package/dist/esm/common/ui/empty-state/index.js +18 -9
- package/dist/esm/common/ui/empty-state/old/index.js +31 -0
- package/dist/esm/common/ui/min-height-container/index.compiled.css +4 -0
- package/dist/esm/common/ui/min-height-container/index.js +23 -14
- package/dist/esm/common/ui/min-height-container/old/index.js +25 -0
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.compiled.css +2 -0
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +20 -16
- package/dist/esm/ui/error-boundary/error-boundary-fallback/old/index.js +43 -0
- package/dist/esm/ui/link-picker/form-footer/index.compiled.css +3 -0
- package/dist/esm/ui/link-picker/form-footer/index.js +28 -34
- package/dist/esm/ui/link-picker/form-footer/link-picker-submit-button/index.js +2 -7
- package/dist/esm/ui/link-picker/form-footer/old/index.js +108 -0
- package/dist/esm/ui/link-picker/index.compiled.css +10 -0
- package/dist/esm/ui/link-picker/index.js +39 -59
- package/dist/esm/ui/link-picker/old/index.js +432 -0
- package/dist/esm/ui/link-picker/search-results/index.compiled.css +7 -0
- package/dist/esm/ui/link-picker/search-results/index.js +30 -32
- package/dist/esm/ui/link-picker/search-results/link-search-error/index.js +5 -10
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.compiled.css +24 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +49 -43
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.compiled.css +2 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +32 -26
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.js +63 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +34 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +94 -72
- package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/old/index.js +136 -0
- package/dist/esm/ui/link-picker/search-results/link-search-list/old/index.js +186 -0
- package/dist/esm/ui/link-picker/search-results/old/index.js +100 -0
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.compiled.css +29 -0
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +52 -43
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/old/index.js +158 -0
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.compiled.css +4 -0
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +16 -16
- package/dist/esm/ui/link-picker/search-results/search-results-container/old/index.js +36 -0
- package/dist/esm/ui/link-picker/text-input/index.compiled.css +11 -0
- package/dist/esm/ui/link-picker/text-input/index.js +30 -38
- package/dist/esm/ui/link-picker/text-input/old/index.js +121 -0
- package/dist/esm/ui/loader-fallback/index.compiled.css +1 -0
- package/dist/esm/ui/loader-fallback/index.js +17 -13
- package/dist/esm/ui/loader-fallback/old/index.js +59 -0
- package/dist/esm/ui/main.compiled.css +1 -0
- package/dist/esm/ui/main.js +24 -22
- package/dist/esm/ui/old/main.js +64 -0
- package/dist/types/common/generic-error-svg/index.d.ts +3 -6
- package/dist/types/common/generic-error-svg/old/index.d.ts +6 -0
- package/dist/types/common/types.d.ts +0 -1
- package/dist/types/common/ui/empty-state/index.d.ts +3 -2
- package/dist/types/common/ui/empty-state/old/index.d.ts +9 -0
- package/dist/types/common/ui/min-height-container/index.d.ts +3 -0
- package/dist/types/common/ui/min-height-container/old/index.d.ts +8 -0
- package/dist/types/ui/error-boundary/error-boundary-fallback/index.d.ts +3 -6
- package/dist/types/ui/error-boundary/error-boundary-fallback/old/index.d.ts +6 -0
- package/dist/types/ui/link-picker/form-footer/index.d.ts +2 -5
- package/dist/types/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +2 -6
- package/dist/types/ui/link-picker/form-footer/old/index.d.ts +42 -0
- package/dist/types/ui/link-picker/index.d.ts +2 -2
- package/dist/types/ui/link-picker/old/index.d.ts +25 -0
- package/dist/types/ui/link-picker/search-results/index.d.ts +2 -2
- package/dist/types/ui/link-picker/search-results/link-search-error/index.d.ts +2 -6
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +3 -6
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +6 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +3 -2
- package/dist/types/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +23 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/old/index.d.ts +52 -0
- package/dist/types/ui/link-picker/search-results/old/index.d.ts +45 -0
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/index.d.ts +4 -4
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +7 -0
- package/dist/types/ui/link-picker/search-results/search-results-container/index.d.ts +2 -2
- package/dist/types/ui/link-picker/search-results/search-results-container/old/index.d.ts +10 -0
- package/dist/types/ui/link-picker/text-input/index.d.ts +3 -2
- package/dist/types/ui/link-picker/text-input/old/index.d.ts +18 -0
- package/dist/types/ui/loader-fallback/index.d.ts +3 -6
- package/dist/types/ui/loader-fallback/old/index.d.ts +17 -0
- package/dist/types/ui/main.d.ts +2 -2
- package/dist/types/ui/old/main.d.ts +13 -0
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +3 -6
- package/dist/types-ts4.5/common/generic-error-svg/old/index.d.ts +6 -0
- package/dist/types-ts4.5/common/types.d.ts +0 -1
- package/dist/types-ts4.5/common/ui/empty-state/index.d.ts +3 -2
- package/dist/types-ts4.5/common/ui/empty-state/old/index.d.ts +9 -0
- package/dist/types-ts4.5/common/ui/min-height-container/index.d.ts +3 -0
- package/dist/types-ts4.5/common/ui/min-height-container/old/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/old/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +2 -5
- package/dist/types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +2 -6
- package/dist/types-ts4.5/ui/link-picker/form-footer/old/index.d.ts +42 -0
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/old/index.d.ts +25 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-error/index.d.ts +2 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/old/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/old/index.d.ts +23 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/old/index.d.ts +52 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/old/index.d.ts +45 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/index.d.ts +4 -4
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/old/index.d.ts +7 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/old/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/link-picker/text-input/old/index.d.ts +18 -0
- package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/loader-fallback/old/index.d.ts +17 -0
- package/dist/types-ts4.5/ui/main.d.ts +2 -2
- package/dist/types-ts4.5/ui/old/main.d.ts +13 -0
- package/lazy/package.json +3 -1
- package/package.json +14 -4
- package/dist/cjs/ui/link-picker/form-footer/feature-discovery/index.js +0 -69
- package/dist/cjs/ui/link-picker/form-footer/feature-discovery/styled.js +0 -25
- package/dist/es2019/ui/link-picker/form-footer/feature-discovery/index.js +0 -61
- package/dist/es2019/ui/link-picker/form-footer/feature-discovery/styled.js +0 -18
- package/dist/esm/ui/link-picker/form-footer/feature-discovery/index.js +0 -62
- package/dist/esm/ui/link-picker/form-footer/feature-discovery/styled.js +0 -18
- package/dist/types/ui/link-picker/form-footer/feature-discovery/index.d.ts +0 -15
- package/dist/types/ui/link-picker/form-footer/feature-discovery/styled.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/form-footer/feature-discovery/index.d.ts +0 -15
- package/dist/types-ts4.5/ui/link-picker/form-footer/feature-discovery/styled.d.ts +0 -1
- /package/dist/cjs/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/es2019/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/esm/common/ui/min-height-container/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/link-search-list/{styled.js → old/styled.js} +0 -0
- /package/dist/esm/ui/link-picker/search-results/scrolling-tabs/{styles.js → old/styles.js} +0 -0
- /package/dist/types/common/ui/min-height-container/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/link-search-list/list-item/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/link-search-list/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types/ui/link-picker/search-results/scrolling-tabs/{styles.d.ts → old/styles.d.ts} +0 -0
- /package/dist/types-ts4.5/common/ui/min-height-container/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/{styled.d.ts → old/styled.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/{styles.d.ts → old/styles.d.ts} +0 -0
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
6
|
import { forwardRef, Fragment } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
9
7
|
import { useIntl } from 'react-intl-next';
|
|
10
|
-
import {
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { B100, B400, B50, N20, N200, N300 } from '@atlaskit/theme/colors';
|
|
11
11
|
/* eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports */
|
|
12
12
|
import { transformTimeStamp } from '../../../transformTimeStamp';
|
|
13
|
-
import {
|
|
13
|
+
import { LinkSearchListItemOld } from './old';
|
|
14
14
|
export const testIds = {
|
|
15
15
|
searchResultItem: 'link-search-list-item',
|
|
16
16
|
searchResultIcon: 'link-search-list-item-icon'
|
|
17
17
|
};
|
|
18
18
|
const isSVG = icon => icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
19
19
|
const base64SVG = icon => `data:image/svg+xml;base64,${Buffer.from(icon).toString('base64')}`;
|
|
20
|
+
const itemIconStyles = null;
|
|
21
|
+
const listItemContextStyles = null;
|
|
22
|
+
const listItemContainerStyles = null;
|
|
23
|
+
const listItemContainerInnerStyles = null;
|
|
24
|
+
const itemNameStyles = null;
|
|
25
|
+
const imgStyles = null;
|
|
26
|
+
const listItemBaseStyles = null;
|
|
20
27
|
const ListItemIcon = props => {
|
|
21
28
|
const {
|
|
22
29
|
item,
|
|
@@ -32,46 +39,35 @@ const ListItemIcon = props => {
|
|
|
32
39
|
const alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
33
40
|
if (typeof icon !== 'string') {
|
|
34
41
|
const Glyph = icon;
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"data-testid": testIds.searchResultIcon
|
|
42
|
-
}))
|
|
43
|
-
);
|
|
42
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: ax(["_1ul9pxbi _19pk1b66 _2hwxutpp"])
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Glyph, {
|
|
45
|
+
alt: alt,
|
|
46
|
+
"data-testid": testIds.searchResultIcon
|
|
47
|
+
}));
|
|
44
48
|
}
|
|
45
|
-
return (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
54
|
-
,
|
|
55
|
-
css: imgStyles
|
|
56
|
-
}))
|
|
57
|
-
);
|
|
49
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
className: ax(["_1ul9pxbi _19pk1b66 _2hwxutpp"])
|
|
51
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
52
|
+
"data-testid": testIds.searchResultIcon,
|
|
53
|
+
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
54
|
+
alt: alt,
|
|
55
|
+
className: ax(["_p12fpxbi"])
|
|
56
|
+
}));
|
|
58
57
|
};
|
|
59
58
|
const ListItemSubtitle = ({
|
|
60
59
|
items: [firstItem, secondItem]
|
|
61
60
|
}) => {
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, secondItem)))
|
|
73
|
-
);
|
|
74
|
-
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
"data-testid": `${testIds.searchResultItem}-subtitle`,
|
|
63
|
+
className: ax(["_11c81vlj _syaz14xw _1e0c1txw"])
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: ax(["_1reo15vq _18m915vq _1bto1l2s"])
|
|
66
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: ax(["_syaz1wmz _o5721q9c"])
|
|
68
|
+
}, firstItem)), secondItem && /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: ax(["_syaz1wmz _o5721q9c"])
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, "\xA0 \u2022\xA0 "), /*#__PURE__*/React.createElement(Fragment, null, secondItem)));
|
|
75
71
|
};
|
|
76
72
|
const getDefaultSubtitleItems = (item, intl) => {
|
|
77
73
|
const container = item.container;
|
|
@@ -87,7 +83,10 @@ const getDefaultSubtitleItems = (item, intl) => {
|
|
|
87
83
|
}
|
|
88
84
|
return undefined;
|
|
89
85
|
};
|
|
90
|
-
|
|
86
|
+
const listItemActive = null;
|
|
87
|
+
const listItemSelected = null;
|
|
88
|
+
const listItemFocusStyles = null;
|
|
89
|
+
export const LinkSearchListItemNew = /*#__PURE__*/forwardRef(({
|
|
91
90
|
item,
|
|
92
91
|
selected,
|
|
93
92
|
id,
|
|
@@ -101,32 +100,38 @@ export const LinkSearchListItem = /*#__PURE__*/forwardRef(({
|
|
|
101
100
|
const intl = useIntl();
|
|
102
101
|
const handleSelect = () => onSelect(item.objectId);
|
|
103
102
|
const subtitleItems = item.subtitleItems || getDefaultSubtitleItems(item, intl);
|
|
104
|
-
return (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
103
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
role: role,
|
|
105
|
+
id: id,
|
|
106
|
+
"aria-selected": selected,
|
|
107
|
+
"data-testid": testIds.searchResultItem,
|
|
108
|
+
onKeyDown: onKeyDown,
|
|
109
|
+
onClick: handleSelect,
|
|
110
|
+
onFocus: onFocus,
|
|
111
|
+
tabIndex: tabIndex,
|
|
112
|
+
ref: ref,
|
|
113
|
+
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _ca0qu2gc _n3tdu2gc _19bvsy6a _u5f3fxbg _80omtlke", !selected && "_irr31dko _1dbz1l95", selected && "_bfhk29zg _16qs1l95", "_nt751r31 _49pcglyw _1hvw1o36 _1a3b18uv _4fprglyw _5goinqa1 _7ehi1tx3"])
|
|
114
|
+
}, /*#__PURE__*/React.createElement(ListItemIcon, {
|
|
115
|
+
item: item,
|
|
116
|
+
intl: intl
|
|
117
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: ax(["_1reo15vq _18m915vq _ae4v1h6o _1bsb1osq"])
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
120
|
+
maxLines: nameMaxLines
|
|
121
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
122
|
+
"data-testid": `${testIds.searchResultItem}-title`,
|
|
123
|
+
title: item.name
|
|
124
|
+
}, item.name)), subtitleItems && /*#__PURE__*/React.createElement(ListItemSubtitle, {
|
|
125
|
+
items: subtitleItems
|
|
126
|
+
})));
|
|
127
|
+
});
|
|
128
|
+
export const LinkSearchListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
129
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
130
|
+
return /*#__PURE__*/React.createElement(LinkSearchListItemNew, _extends({}, props, {
|
|
117
131
|
ref: ref
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, jsx(Text, {
|
|
124
|
-
maxLines: nameMaxLines
|
|
125
|
-
}, jsx("span", {
|
|
126
|
-
"data-testid": `${testIds.searchResultItem}-title`,
|
|
127
|
-
title: item.name
|
|
128
|
-
}, item.name)), subtitleItems && jsx(ListItemSubtitle, {
|
|
129
|
-
items: subtitleItems
|
|
130
|
-
})))
|
|
131
|
-
);
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
return /*#__PURE__*/React.createElement(LinkSearchListItemOld, _extends({}, props, {
|
|
135
|
+
ref: ref
|
|
136
|
+
}));
|
|
132
137
|
});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { forwardRef, Fragment } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx } from '@emotion/react';
|
|
9
|
+
import { useIntl } from 'react-intl-next';
|
|
10
|
+
import { Text } from '@atlaskit/primitives';
|
|
11
|
+
/* eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports */
|
|
12
|
+
import { transformTimeStamp } from '../../../../transformTimeStamp';
|
|
13
|
+
import { composeListItemStyles, imgStyles, itemIconStyles, itemNameStyles, listItemContainerInnerStyles, listItemContainerStyles, listItemContextStyles } from './styled';
|
|
14
|
+
export const testIds = {
|
|
15
|
+
searchResultItem: 'link-search-list-item',
|
|
16
|
+
searchResultIcon: 'link-search-list-item-icon'
|
|
17
|
+
};
|
|
18
|
+
const isSVG = icon => icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
19
|
+
const base64SVG = icon => `data:image/svg+xml;base64,${Buffer.from(icon).toString('base64')}`;
|
|
20
|
+
const ListItemIcon = props => {
|
|
21
|
+
const {
|
|
22
|
+
item,
|
|
23
|
+
intl
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
icon,
|
|
27
|
+
iconAlt
|
|
28
|
+
} = item;
|
|
29
|
+
if (!icon) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
33
|
+
if (typeof icon !== 'string') {
|
|
34
|
+
const Glyph = icon;
|
|
35
|
+
return (
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
37
|
+
jsx("span", {
|
|
38
|
+
css: itemIconStyles
|
|
39
|
+
}, jsx(Glyph, {
|
|
40
|
+
alt: alt,
|
|
41
|
+
"data-testid": testIds.searchResultIcon
|
|
42
|
+
}))
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return (
|
|
46
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
47
|
+
jsx("span", {
|
|
48
|
+
css: itemIconStyles
|
|
49
|
+
}, jsx("img", {
|
|
50
|
+
"data-testid": testIds.searchResultIcon,
|
|
51
|
+
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
52
|
+
alt: alt
|
|
53
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
54
|
+
,
|
|
55
|
+
css: imgStyles
|
|
56
|
+
}))
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
const ListItemSubtitle = ({
|
|
60
|
+
items: [firstItem, secondItem]
|
|
61
|
+
}) => {
|
|
62
|
+
return /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */(
|
|
63
|
+
jsx("div", {
|
|
64
|
+
"data-testid": `${testIds.searchResultItem}-subtitle`,
|
|
65
|
+
css: listItemContextStyles
|
|
66
|
+
}, jsx("div", {
|
|
67
|
+
css: listItemContainerStyles
|
|
68
|
+
}, jsx("span", {
|
|
69
|
+
css: listItemContainerInnerStyles
|
|
70
|
+
}, firstItem)), secondItem && jsx("div", {
|
|
71
|
+
css: listItemContainerInnerStyles
|
|
72
|
+
}, jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, secondItem)))
|
|
73
|
+
);
|
|
74
|
+
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */
|
|
75
|
+
};
|
|
76
|
+
const getDefaultSubtitleItems = (item, intl) => {
|
|
77
|
+
const container = item.container;
|
|
78
|
+
const date = transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
79
|
+
if (container) {
|
|
80
|
+
if (date) {
|
|
81
|
+
return [container, date];
|
|
82
|
+
}
|
|
83
|
+
return [container];
|
|
84
|
+
}
|
|
85
|
+
if (date) {
|
|
86
|
+
return [date];
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
};
|
|
90
|
+
export const LinkSearchListItemOld = /*#__PURE__*/forwardRef(({
|
|
91
|
+
item,
|
|
92
|
+
selected,
|
|
93
|
+
id,
|
|
94
|
+
role,
|
|
95
|
+
onSelect,
|
|
96
|
+
tabIndex,
|
|
97
|
+
onKeyDown,
|
|
98
|
+
onFocus,
|
|
99
|
+
nameMaxLines = 1
|
|
100
|
+
}, ref) => {
|
|
101
|
+
const intl = useIntl();
|
|
102
|
+
const handleSelect = () => onSelect(item.objectId);
|
|
103
|
+
const subtitleItems = item.subtitleItems || getDefaultSubtitleItems(item, intl);
|
|
104
|
+
return (
|
|
105
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
106
|
+
jsx("div", {
|
|
107
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
108
|
+
css: composeListItemStyles(selected),
|
|
109
|
+
role: role,
|
|
110
|
+
id: id,
|
|
111
|
+
"aria-selected": selected,
|
|
112
|
+
"data-testid": testIds.searchResultItem,
|
|
113
|
+
onKeyDown: onKeyDown,
|
|
114
|
+
onClick: handleSelect,
|
|
115
|
+
onFocus: onFocus,
|
|
116
|
+
tabIndex: tabIndex,
|
|
117
|
+
ref: ref
|
|
118
|
+
}, jsx(ListItemIcon, {
|
|
119
|
+
item: item,
|
|
120
|
+
intl: intl
|
|
121
|
+
}), jsx("div", {
|
|
122
|
+
css: itemNameStyles
|
|
123
|
+
}, jsx(Text, {
|
|
124
|
+
maxLines: nameMaxLines
|
|
125
|
+
}, jsx("span", {
|
|
126
|
+
"data-testid": `${testIds.searchResultItem}-title`,
|
|
127
|
+
title: item.name
|
|
128
|
+
}, item.name)), subtitleItems && jsx(ListItemSubtitle, {
|
|
129
|
+
items: subtitleItems
|
|
130
|
+
})))
|
|
131
|
+
);
|
|
132
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
8
|
+
import { forwardRef, Fragment, useCallback, useRef } from 'react';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
12
|
+
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
13
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
14
|
+
import Spinner from '@atlaskit/spinner';
|
|
15
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
16
|
+
import { MinHeightContainer } from '../../../../../common/ui/min-height-container';
|
|
17
|
+
import { handleNavKeyDown } from '../../../../../common/utils/handleNavKeyDown';
|
|
18
|
+
import { NoResults, testIds as noResultsTestIds } from '../link-search-no-results';
|
|
19
|
+
import { LinkSearchListItem, testIds as searchResultItemTestIds } from '../list-item';
|
|
20
|
+
import { useTrackResultsShown } from '../use-track-results-shown';
|
|
21
|
+
import { listContainerStyles, listStyles, listTitleStyles, spinnerContainerStyles } from './styled';
|
|
22
|
+
export const messages = defineMessages({
|
|
23
|
+
titleRecentlyViewed: {
|
|
24
|
+
id: 'fabric.linkPicker.listTitle.recentlyViewed',
|
|
25
|
+
defaultMessage: 'Recently Viewed',
|
|
26
|
+
description: 'Describes type of items shown in the list for screen-reader users'
|
|
27
|
+
},
|
|
28
|
+
titleResults: {
|
|
29
|
+
id: 'fabric.linkPicker.listTitle.results',
|
|
30
|
+
defaultMessage: 'Results',
|
|
31
|
+
description: 'Describes type of items shown in the list for screen-reader users'
|
|
32
|
+
},
|
|
33
|
+
searchLinkResults: {
|
|
34
|
+
id: 'fabric.linkPicker.hyperlink.searchLinkResults',
|
|
35
|
+
defaultMessage: '{count, plural, =0 {no results} one {# result} other {# results}} found',
|
|
36
|
+
description: 'Announce search results for screen-reader users.'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export const testIds = {
|
|
40
|
+
...noResultsTestIds,
|
|
41
|
+
...searchResultItemTestIds,
|
|
42
|
+
resultListTitle: 'link-picker-list-title',
|
|
43
|
+
searchResultList: 'link-search-list',
|
|
44
|
+
searchResultLoadingIndicator: 'link-picker.results-loading-indicator',
|
|
45
|
+
tabsLoadingIndicator: 'link-picker.tabs-loading-indicator'
|
|
46
|
+
};
|
|
47
|
+
const emptyStateNoResultsWrapper = xcss({
|
|
48
|
+
minHeight: 'space.200'
|
|
49
|
+
});
|
|
50
|
+
export const LinkSearchListOld = /*#__PURE__*/forwardRef(({
|
|
51
|
+
onChange,
|
|
52
|
+
onSelect,
|
|
53
|
+
onKeyDown,
|
|
54
|
+
items,
|
|
55
|
+
activeIndex,
|
|
56
|
+
selectedIndex,
|
|
57
|
+
isLoading,
|
|
58
|
+
ariaControls,
|
|
59
|
+
ariaLabelledBy,
|
|
60
|
+
ariaReadOnly,
|
|
61
|
+
role,
|
|
62
|
+
id,
|
|
63
|
+
hasSearchTerm,
|
|
64
|
+
activePlugin,
|
|
65
|
+
adaptiveHeight,
|
|
66
|
+
...restProps
|
|
67
|
+
}, ref) => {
|
|
68
|
+
var _activePlugin$uiOptio;
|
|
69
|
+
let itemsContent;
|
|
70
|
+
let loadingContent;
|
|
71
|
+
const linkListTitle = hasSearchTerm ? messages.titleResults : messages.titleRecentlyViewed;
|
|
72
|
+
useTrackResultsShown(isLoading, items, hasSearchTerm);
|
|
73
|
+
const itemRefs = useRef({});
|
|
74
|
+
const itemRefCallback = useCallback((el, id) => {
|
|
75
|
+
if (el === null) {
|
|
76
|
+
delete itemRefs.current[id];
|
|
77
|
+
} else {
|
|
78
|
+
itemRefs.current[id] = el;
|
|
79
|
+
}
|
|
80
|
+
}, []);
|
|
81
|
+
const getTabIndex = useCallback(index => {
|
|
82
|
+
if (selectedIndex > -1) {
|
|
83
|
+
return selectedIndex === index ? 0 : -1;
|
|
84
|
+
}
|
|
85
|
+
if (index === 0) {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
return -1;
|
|
89
|
+
}, [selectedIndex]);
|
|
90
|
+
const handleKeyDown = useCallback(event => {
|
|
91
|
+
let updatedIndex = activeIndex;
|
|
92
|
+
if (onKeyDown) {
|
|
93
|
+
onKeyDown(event);
|
|
94
|
+
}
|
|
95
|
+
if (!(items !== null && items !== void 0 && items.length)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
updatedIndex = handleNavKeyDown(event, items.length, activeIndex);
|
|
99
|
+
const item = items === null || items === void 0 ? void 0 : items[updatedIndex];
|
|
100
|
+
if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key) && item) {
|
|
101
|
+
if (itemRefs.current) {
|
|
102
|
+
var _itemRefs$current$ite;
|
|
103
|
+
(_itemRefs$current$ite = itemRefs.current[item.objectId]) === null || _itemRefs$current$ite === void 0 ? void 0 : _itemRefs$current$ite.focus();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, [activeIndex, items, onKeyDown]);
|
|
107
|
+
if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
|
|
108
|
+
if (!hasSearchTerm) {
|
|
109
|
+
var _activePlugin$emptySt;
|
|
110
|
+
const emptyState = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
|
|
111
|
+
if (emptyState) {
|
|
112
|
+
return jsx(Box, {
|
|
113
|
+
xcss: emptyStateNoResultsWrapper
|
|
114
|
+
}, emptyState);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return jsx(NoResults, null);
|
|
118
|
+
}
|
|
119
|
+
const listItemNameMaxLines = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
120
|
+
if (items && items.length > 0) {
|
|
121
|
+
itemsContent = jsx(Fragment, null, jsx("div", {
|
|
122
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
123
|
+
css: listTitleStyles,
|
|
124
|
+
id: testIds.resultListTitle,
|
|
125
|
+
"data-testid": testIds.resultListTitle
|
|
126
|
+
}, jsx(FormattedMessage, linkListTitle)), jsx(VisuallyHidden, {
|
|
127
|
+
id: "fabric.smartcard.linkpicker.suggested.results"
|
|
128
|
+
}, hasSearchTerm && jsx(FormattedMessage, _extends({}, messages.searchLinkResults, {
|
|
129
|
+
values: {
|
|
130
|
+
count: items.length
|
|
131
|
+
},
|
|
132
|
+
"aria-live": "polite",
|
|
133
|
+
"aria-atomic": "true"
|
|
134
|
+
}))), jsx("ul", {
|
|
135
|
+
id: id,
|
|
136
|
+
role: role
|
|
137
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
138
|
+
,
|
|
139
|
+
css: listStyles,
|
|
140
|
+
"aria-controls": "fabric.smartcard.linkpicker.suggested.results",
|
|
141
|
+
"aria-labelledby": testIds.resultListTitle,
|
|
142
|
+
"aria-readonly": ariaReadOnly,
|
|
143
|
+
"data-testid": testIds.searchResultList
|
|
144
|
+
}, items.map((item, index) => jsx(LinkSearchListItem, {
|
|
145
|
+
id: `${testIds.searchResultItem}-${index}`,
|
|
146
|
+
role: role && 'option',
|
|
147
|
+
item: item,
|
|
148
|
+
selected: selectedIndex === index,
|
|
149
|
+
active: activeIndex === index,
|
|
150
|
+
onFocus: () => onChange(item.objectId),
|
|
151
|
+
onKeyDown: handleKeyDown,
|
|
152
|
+
onSelect: onSelect,
|
|
153
|
+
key: item.objectId,
|
|
154
|
+
tabIndex: getTabIndex(index),
|
|
155
|
+
ref: el => itemRefCallback(el, item.objectId),
|
|
156
|
+
nameMaxLines: listItemNameMaxLines
|
|
157
|
+
}))));
|
|
158
|
+
}
|
|
159
|
+
if (isLoading) {
|
|
160
|
+
loadingContent = jsx(MinHeightContainer, {
|
|
161
|
+
minHeight: adaptiveHeight ? '80px' : '50px'
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
163
|
+
,
|
|
164
|
+
css: spinnerContainerStyles
|
|
165
|
+
}, jsx(Spinner, {
|
|
166
|
+
testId: testIds.searchResultLoadingIndicator,
|
|
167
|
+
interactionName: "link-picker-search-list-loading",
|
|
168
|
+
size: "medium"
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
return (
|
|
172
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
173
|
+
jsx("div", _extends({
|
|
174
|
+
ref: ref,
|
|
175
|
+
css: listContainerStyles
|
|
176
|
+
}, restProps), itemsContent, loadingContent)
|
|
177
|
+
);
|
|
178
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
7
|
+
import { Fragment } from 'react';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
11
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
12
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
13
|
+
import Tabs, { Tab, TabList } from '@atlaskit/tabs';
|
|
14
|
+
import { LinkSearchError, testIds as searchErrorTestIds } from '../link-search-error';
|
|
15
|
+
import { LinkSearchList, testIds as listTestIds } from '../link-search-list';
|
|
16
|
+
import { ScrollingTabList } from '../scrolling-tabs';
|
|
17
|
+
import { SearchResultsContainer } from '../search-results-container';
|
|
18
|
+
import { TrackTabViewed } from '../track-tab-viewed';
|
|
19
|
+
const tabsWrapperStyles = xcss({
|
|
20
|
+
marginTop: 'space.150'
|
|
21
|
+
});
|
|
22
|
+
const spinnerContainerStyles = css({
|
|
23
|
+
minHeight: '80px',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignSelf: 'center',
|
|
28
|
+
flexGrow: 1
|
|
29
|
+
});
|
|
30
|
+
export const testIds = {
|
|
31
|
+
...searchErrorTestIds,
|
|
32
|
+
...listTestIds,
|
|
33
|
+
tabsLoadingIndicator: 'link-picker.tabs-loading-indicator',
|
|
34
|
+
tabList: 'link-picker-tabs',
|
|
35
|
+
tabItem: 'link-picker-tab'
|
|
36
|
+
};
|
|
37
|
+
export const SearchResultsOld = ({
|
|
38
|
+
tabs,
|
|
39
|
+
activeTab,
|
|
40
|
+
activePlugin,
|
|
41
|
+
isLoadingPlugins,
|
|
42
|
+
isLoadingResults,
|
|
43
|
+
isSubmitting,
|
|
44
|
+
handleTabChange,
|
|
45
|
+
handleSearchListOnChange,
|
|
46
|
+
featureFlags,
|
|
47
|
+
linkSearchListId,
|
|
48
|
+
error,
|
|
49
|
+
queryState,
|
|
50
|
+
items,
|
|
51
|
+
activeIndex,
|
|
52
|
+
selectedIndex,
|
|
53
|
+
handleSelected,
|
|
54
|
+
handleKeyDown,
|
|
55
|
+
adaptiveHeight,
|
|
56
|
+
retry
|
|
57
|
+
}) => {
|
|
58
|
+
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
59
|
+
const isActivePlugin = !!activePlugin;
|
|
60
|
+
const tabList = jsx(TabList, null, tabs.map(tab => jsx(Tab, {
|
|
61
|
+
key: tab.tabTitle,
|
|
62
|
+
testId: testIds.tabItem
|
|
63
|
+
}, tab.tabTitle)));
|
|
64
|
+
return jsx(SearchResultsContainer, {
|
|
65
|
+
hasTabs: !!tabs.length || isLoadingPlugins,
|
|
66
|
+
adaptiveHeight: adaptiveHeight,
|
|
67
|
+
isLoadingResults: isLoadingResults
|
|
68
|
+
}, isLoadingPlugins && !!queryState && jsx("div", {
|
|
69
|
+
css: spinnerContainerStyles
|
|
70
|
+
}, jsx(Spinner, {
|
|
71
|
+
testId: testIds.tabsLoadingIndicator,
|
|
72
|
+
interactionName: "link-picker-tabs-loading",
|
|
73
|
+
size: "medium"
|
|
74
|
+
})), !isLoadingPlugins && isActivePlugin && !!queryState && jsx(Fragment, null, tabs.length > 0 && jsx(Box, {
|
|
75
|
+
xcss: tabsWrapperStyles
|
|
76
|
+
}, jsx(Tabs, {
|
|
77
|
+
id: testIds.tabList,
|
|
78
|
+
testId: testIds.tabList,
|
|
79
|
+
selected: activeTab,
|
|
80
|
+
onChange: handleTabChange
|
|
81
|
+
}, featureFlags !== null && featureFlags !== void 0 && featureFlags.scrollingTabs ? jsx(ScrollingTabList, null, tabList) : tabList), jsx(TrackTabViewed, {
|
|
82
|
+
activePlugin: activePlugin
|
|
83
|
+
})), !error && jsx(LinkSearchList, {
|
|
84
|
+
id: linkSearchListId,
|
|
85
|
+
role: "listbox",
|
|
86
|
+
ariaReadOnly: isSubmitting,
|
|
87
|
+
items: items,
|
|
88
|
+
isLoading: isLoadingResults,
|
|
89
|
+
selectedIndex: selectedIndex,
|
|
90
|
+
activeIndex: activeIndex,
|
|
91
|
+
onSelect: handleSelected,
|
|
92
|
+
onChange: handleSearchListOnChange,
|
|
93
|
+
onKeyDown: handleKeyDown,
|
|
94
|
+
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
95
|
+
activePlugin: activePlugin,
|
|
96
|
+
adaptiveHeight: adaptiveHeight
|
|
97
|
+
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null) : null));
|
|
98
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
._1bh4vqrj{scroll-padding:0 24px}
|
|
3
|
+
._rfx3yh40:before{border-radius:2px}._154i1b66{top:var(--ds-space-050,4px)}
|
|
4
|
+
._18q9glyw [role=tablist]:before{display:none}
|
|
5
|
+
._19woidpf:before{bottom:0}
|
|
6
|
+
._1cicglyw::-webkit-scrollbar{display:none}
|
|
7
|
+
._1cs8stnw:before{position:absolute}
|
|
8
|
+
._1dm8q5uf{scroll-behavior:smooth}
|
|
9
|
+
._1dze261p [role=tab]{text-overflow:unset!important}
|
|
10
|
+
._1fjgglyw{scrollbar-width:none}
|
|
11
|
+
._1fud261p [role=tab]{overflow-y:unset!important}
|
|
12
|
+
._1kt9b3bt:before{content:""}
|
|
13
|
+
._1ltvidpf{left:0}
|
|
14
|
+
._1mp41kw7:before{width:inherit}
|
|
15
|
+
._1pby18h8{z-index:999}
|
|
16
|
+
._1reo1wug{overflow-x:auto}
|
|
17
|
+
._1rushloo:before{background-color:var(--ds-border,#ebecf0)}
|
|
18
|
+
._1xi2idpf{right:0}
|
|
19
|
+
._7hip261p [role=tab]{overflow-x:unset!important}
|
|
20
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
21
|
+
._eid3idpf:before{margin-right:0}
|
|
22
|
+
._fntnidpf:before{margin-left:0}
|
|
23
|
+
._kfgtyh40:before{height:2px}
|
|
24
|
+
._kqswh2mm{position:relative}
|
|
25
|
+
._kqswstnw{position:absolute}
|
|
26
|
+
._oounu2gc:before{right:var(--ds-space-100,8px)}
|
|
27
|
+
._pascidpf:before{margin-top:0}
|
|
28
|
+
._qnecu2gc:before{left:var(--ds-space-100,8px)}
|
|
29
|
+
._zr3eidpf:before{margin-bottom:0}
|