@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,17 +1,15 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
10
6
|
import { IconButton } from '@atlaskit/button/new';
|
|
11
7
|
import ChevronLeftIcon from '@atlaskit/icon/utility/migration/chevron-left';
|
|
12
8
|
import ChevronRightIcon from '@atlaskit/icon/utility/migration/chevron-right';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { N0, N30 } from '@atlaskit/theme/colors';
|
|
11
|
+
import { ScrollingTabListOld } from './old';
|
|
13
12
|
import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from './scrolling-tabs';
|
|
14
|
-
import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
|
|
15
13
|
function isTouchDevice() {
|
|
16
14
|
return 'ontouchstart' in window ||
|
|
17
15
|
// eslint-disable-next-line compat/compat
|
|
@@ -21,9 +19,13 @@ const initialConditionalButtonsState = {
|
|
|
21
19
|
back: false,
|
|
22
20
|
forward: false
|
|
23
21
|
};
|
|
22
|
+
const scrollingContainerStyles = null;
|
|
23
|
+
const containerStyles = null;
|
|
24
|
+
const backButtonStyles = null;
|
|
25
|
+
const nextButtonStyles = null;
|
|
24
26
|
|
|
25
27
|
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
26
|
-
export const
|
|
28
|
+
export const ScrollingTabListNew = props => {
|
|
27
29
|
const ref = useRef(null);
|
|
28
30
|
const [conditionalButtons, setConditionalButtons] = useState(initialConditionalButtonsState);
|
|
29
31
|
const ghost = useMemo(() => createGhost(), []);
|
|
@@ -95,34 +97,32 @@ export const ScrollingTabList = props => {
|
|
|
95
97
|
appearance: 'subtle',
|
|
96
98
|
spacing: 'compact'
|
|
97
99
|
};
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}))))
|
|
127
|
-
);
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
ref: ref,
|
|
102
|
+
"data-testid": "scrolling-tabs",
|
|
103
|
+
className: ax(["_kqswh2mm _18q9glyw _7hip261p _1fud261p _1dze261p"])
|
|
104
|
+
}, conditionalButtons.back && /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: ax(["_kqswstnw _154i1b66 _1pby18h8 _bfhkvuon _1ltvidpf", "back"])
|
|
106
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
107
|
+
"data-test-id": "back",
|
|
108
|
+
onClick: () => scrollBack(ref),
|
|
109
|
+
label: "back",
|
|
110
|
+
icon: ChevronLeftIcon
|
|
111
|
+
}, buttonProps))), /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: ax(["_1bh4vqrj _1reo1wug _1dm8q5uf _1fjgglyw _rfx3yh40 _pascidpf _eid3idpf _zr3eidpf _fntnidpf _1kt9b3bt _19woidpf _1cs8stnw _1mp41kw7 _qnecu2gc _oounu2gc _kfgtyh40 _1rushloo _1cicglyw"])
|
|
113
|
+
}, props.children), conditionalButtons.forward && /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: ax(["_kqswstnw _154i1b66 _1pby18h8 _bfhkvuon _1xi2idpf"])
|
|
115
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
116
|
+
"data-test-id": "forward",
|
|
117
|
+
onClick: () => scrollForward(ref)
|
|
118
|
+
}, buttonProps, {
|
|
119
|
+
label: "forward",
|
|
120
|
+
icon: ChevronRightIcon
|
|
121
|
+
}))));
|
|
122
|
+
};
|
|
123
|
+
export const ScrollingTabList = props => {
|
|
124
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
125
|
+
return /*#__PURE__*/React.createElement(ScrollingTabListNew, props);
|
|
126
|
+
}
|
|
127
|
+
return /*#__PURE__*/React.createElement(ScrollingTabListOld, props);
|
|
128
128
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
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 React, { useCallback, useMemo, useRef, useState } 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 { IconButton } from '@atlaskit/button/new';
|
|
13
|
+
import ChevronLeftIcon from '@atlaskit/icon/utility/migration/chevron-left';
|
|
14
|
+
import ChevronRightIcon from '@atlaskit/icon/utility/migration/chevron-right';
|
|
15
|
+
import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from '../scrolling-tabs';
|
|
16
|
+
import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
|
|
17
|
+
function isTouchDevice() {
|
|
18
|
+
return 'ontouchstart' in window ||
|
|
19
|
+
// eslint-disable-next-line compat/compat
|
|
20
|
+
navigator.maxTouchPoints > 0;
|
|
21
|
+
}
|
|
22
|
+
const initialConditionalButtonsState = {
|
|
23
|
+
back: false,
|
|
24
|
+
forward: false
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
28
|
+
export const ScrollingTabListOld = props => {
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const [conditionalButtons, setConditionalButtons] = useState(initialConditionalButtonsState);
|
|
31
|
+
const ghost = useMemo(() => createGhost(), []);
|
|
32
|
+
const onTabClick = useCallback(e => {
|
|
33
|
+
const target = e.currentTarget;
|
|
34
|
+
if (target) {
|
|
35
|
+
target.scrollIntoView({
|
|
36
|
+
behavior: 'smooth',
|
|
37
|
+
block: 'nearest',
|
|
38
|
+
inline: 'center'
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, []);
|
|
42
|
+
React.useLayoutEffect(() => {
|
|
43
|
+
const container = ref.current;
|
|
44
|
+
let scrollingContainer;
|
|
45
|
+
let tabs;
|
|
46
|
+
const handleConditionalButtonsChange = () => {
|
|
47
|
+
const buttons = calculateConditionalButtons(scrollingContainer, isTouchDevice());
|
|
48
|
+
setConditionalButtons(buttons);
|
|
49
|
+
};
|
|
50
|
+
const observerCallback = mutationList => {
|
|
51
|
+
const tablist = getTabList(ref);
|
|
52
|
+
for (const mutation of mutationList) {
|
|
53
|
+
if (mutation.type === 'childList') {
|
|
54
|
+
const addedNodes = Array.from(mutation.addedNodes);
|
|
55
|
+
const found = addedNodes.find(node => node.getAttribute('role') === 'tab');
|
|
56
|
+
if (found && tablist) {
|
|
57
|
+
ghost.remove();
|
|
58
|
+
const tabs = Array.from(tablist.children);
|
|
59
|
+
tabs.forEach(tab => {
|
|
60
|
+
tab.removeEventListener('click', onTabClick);
|
|
61
|
+
tab.addEventListener('click', onTabClick);
|
|
62
|
+
});
|
|
63
|
+
tablist.appendChild(ghost);
|
|
64
|
+
handleConditionalButtonsChange();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const observer = new MutationObserver(observerCallback);
|
|
70
|
+
if (container) {
|
|
71
|
+
const tablist = getTabList(ref);
|
|
72
|
+
scrollingContainer = tablist === null || tablist === void 0 ? void 0 : tablist.parentElement;
|
|
73
|
+
observer.observe(container, {
|
|
74
|
+
attributes: false,
|
|
75
|
+
childList: true,
|
|
76
|
+
subtree: true
|
|
77
|
+
});
|
|
78
|
+
if (scrollingContainer instanceof HTMLElement && tablist) {
|
|
79
|
+
tablist.appendChild(ghost);
|
|
80
|
+
tabs = Array.from(tablist.children);
|
|
81
|
+
tabs.forEach(tab => tab.addEventListener('click', onTabClick));
|
|
82
|
+
handleConditionalButtonsChange();
|
|
83
|
+
scrollingContainer.addEventListener('scroll', handleConditionalButtonsChange);
|
|
84
|
+
}
|
|
85
|
+
return () => {
|
|
86
|
+
if (scrollingContainer) {
|
|
87
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
88
|
+
scrollingContainer.removeEventListener('scroll', handleConditionalButtonsChange);
|
|
89
|
+
}
|
|
90
|
+
if (tabs.length) {
|
|
91
|
+
tabs.forEach(tab => tab.removeEventListener('click', onTabClick));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}, [onTabClick, ghost, ref]);
|
|
96
|
+
const buttonProps = {
|
|
97
|
+
appearance: 'subtle',
|
|
98
|
+
spacing: 'compact'
|
|
99
|
+
};
|
|
100
|
+
return (
|
|
101
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
102
|
+
jsx("div", {
|
|
103
|
+
css: containerStyles,
|
|
104
|
+
ref: ref,
|
|
105
|
+
"data-testid": "scrolling-tabs"
|
|
106
|
+
}, conditionalButtons.back &&
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
108
|
+
jsx("div", {
|
|
109
|
+
className: "back",
|
|
110
|
+
css: backButtonStyles
|
|
111
|
+
}, jsx(IconButton, _extends({
|
|
112
|
+
"data-test-id": "back",
|
|
113
|
+
onClick: () => scrollBack(ref),
|
|
114
|
+
label: "back",
|
|
115
|
+
icon: ChevronLeftIcon
|
|
116
|
+
}, buttonProps))), jsx("div", {
|
|
117
|
+
css: scrollingContainerStyles
|
|
118
|
+
}, props.children), conditionalButtons.forward &&
|
|
119
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
120
|
+
jsx("div", {
|
|
121
|
+
css: nextButtonStyles
|
|
122
|
+
}, jsx(IconButton, _extends({
|
|
123
|
+
"data-test-id": "forward",
|
|
124
|
+
onClick: () => scrollForward(ref)
|
|
125
|
+
}, buttonProps, {
|
|
126
|
+
label: "forward",
|
|
127
|
+
icon: ChevronRightIcon
|
|
128
|
+
}))))
|
|
129
|
+
);
|
|
130
|
+
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useLayoutEffect, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
7
|
import { MinHeightContainer } from '../../../../common/ui/min-height-container';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
justifyContent: 'flex-start',
|
|
14
|
-
width: '100%'
|
|
15
|
-
});
|
|
16
|
-
export const SearchResultsContainer = ({
|
|
8
|
+
import { SearchResultsContainerOld } from './old';
|
|
9
|
+
const flexColumn = null;
|
|
10
|
+
export const SearchResultsContainerNew = ({
|
|
17
11
|
hasTabs,
|
|
18
12
|
adaptiveHeight,
|
|
19
13
|
isLoadingResults,
|
|
@@ -29,9 +23,15 @@ export const SearchResultsContainer = ({
|
|
|
29
23
|
currentHeight.current = ref.current.getBoundingClientRect().height;
|
|
30
24
|
}
|
|
31
25
|
});
|
|
32
|
-
return
|
|
26
|
+
return /*#__PURE__*/React.createElement(MinHeightContainer, {
|
|
33
27
|
ref: ref,
|
|
34
28
|
minHeight: minheight,
|
|
35
|
-
|
|
29
|
+
className: ax(["_1e0c1txw _2lx21bp4 _1bah1y6m _1bsb1osq"])
|
|
36
30
|
}, children);
|
|
31
|
+
};
|
|
32
|
+
export const SearchResultsContainer = props => {
|
|
33
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
34
|
+
return /*#__PURE__*/React.createElement(SearchResultsContainerNew, props);
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/React.createElement(SearchResultsContainerOld, props);
|
|
37
37
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { MinHeightContainer } from '../../../../../common/ui/min-height-container';
|
|
10
|
+
const flexColumn = css({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
justifyContent: 'flex-start',
|
|
14
|
+
width: '100%'
|
|
15
|
+
});
|
|
16
|
+
export const SearchResultsContainerOld = ({
|
|
17
|
+
hasTabs,
|
|
18
|
+
adaptiveHeight,
|
|
19
|
+
isLoadingResults,
|
|
20
|
+
children
|
|
21
|
+
}) => {
|
|
22
|
+
const ref = useRef(null);
|
|
23
|
+
const currentHeight = useRef(null);
|
|
24
|
+
const fixedMinHeight = hasTabs ? '347px' : '302px';
|
|
25
|
+
const adaptiveMinHeight = isLoadingResults && !!currentHeight.current ? `${currentHeight.current}px` : 'auto';
|
|
26
|
+
const minheight = adaptiveHeight ? adaptiveMinHeight : fixedMinHeight;
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
if (ref.current && adaptiveHeight && !isLoadingResults) {
|
|
29
|
+
currentHeight.current = ref.current.getBoundingClientRect().height;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return jsx(MinHeightContainer, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
minHeight: minheight,
|
|
35
|
+
css: flexColumn
|
|
36
|
+
}, children);
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
._11c816g6{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._19itglyw{border:none}
|
|
3
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
4
|
+
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
5
|
+
._7yjtidpf >div{margin-top:0}
|
|
6
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
7
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
8
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
9
|
+
._onzypxbi+._onzypxbi{margin-top:var(--ds-space-200,1pc)}
|
|
10
|
+
._s7n4nkob{vertical-align:middle}
|
|
11
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
@@ -1,47 +1,33 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { Fragment, useCallback, useRef } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
7
|
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
11
8
|
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
12
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
13
11
|
import Textfield from '@atlaskit/textfield';
|
|
14
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
13
|
import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
|
|
14
|
+
import { TextInputOld } from './old';
|
|
16
15
|
import { isRedoEvent, isUndoEvent } from './utils';
|
|
16
|
+
const styles = {
|
|
17
|
+
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob"
|
|
18
|
+
};
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Overriding text input margin top which design system provides as a default spacer
|
|
20
22
|
* but it gets in the way of our layout
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
25
|
-
'> div': {
|
|
26
|
-
marginTop: 0
|
|
27
|
-
},
|
|
28
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
29
|
-
'& + &': {
|
|
30
|
-
marginTop: "var(--ds-space-200, 16px)"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
24
|
+
const baseFieldStyles = null;
|
|
25
|
+
const newFieldStyles = null;
|
|
33
26
|
export const testIds = {
|
|
34
27
|
urlError: 'link-error',
|
|
35
28
|
clearUrlButton: 'clear-text'
|
|
36
29
|
};
|
|
37
|
-
const
|
|
38
|
-
padding: 'space.0',
|
|
39
|
-
marginRight: 'space.050',
|
|
40
|
-
backgroundColor: 'color.background.neutral.subtle',
|
|
41
|
-
border: 'none',
|
|
42
|
-
verticalAlign: 'middle'
|
|
43
|
-
});
|
|
44
|
-
export const TextInput = ({
|
|
30
|
+
export const TextInputNew = ({
|
|
45
31
|
name,
|
|
46
32
|
label,
|
|
47
33
|
autoFocus,
|
|
@@ -85,35 +71,41 @@ export const TextInput = ({
|
|
|
85
71
|
onClear === null || onClear === void 0 ? void 0 : onClear(name);
|
|
86
72
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
87
73
|
}, [name, onClear]);
|
|
88
|
-
const clearText = restProps.value !== '' &&
|
|
74
|
+
const clearText = restProps.value !== '' && /*#__PURE__*/React.createElement(Tooltip, {
|
|
89
75
|
content: clearLabel
|
|
90
|
-
},
|
|
91
|
-
xcss:
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
77
|
+
xcss: styles.clearTextButton,
|
|
92
78
|
onClick: handleClear,
|
|
93
79
|
testId: testIds.clearUrlButton
|
|
94
|
-
},
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Selectclear, {
|
|
95
81
|
LEGACY_size: "medium",
|
|
96
82
|
label: clearLabel || '',
|
|
97
83
|
color: "var(--ds-icon-subtle, #626F86)",
|
|
98
84
|
spacing: "spacious"
|
|
99
85
|
})));
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
},
|
|
86
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: ax(["_7yjtidpf _onzypxbi", fg('platform-linking-visual-refresh-v1') && "_11c816g6"])
|
|
88
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
103
89
|
label: label,
|
|
104
90
|
name: name
|
|
105
91
|
}, ({
|
|
106
92
|
fieldProps
|
|
107
93
|
}) => {
|
|
108
|
-
return
|
|
94
|
+
return /*#__PURE__*/React.createElement(ConditionalSpotlightTargetWrapper, {
|
|
109
95
|
spotlightTargetName: spotlightTargetName
|
|
110
|
-
},
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Textfield, _extends({}, fieldProps, restProps, {
|
|
111
97
|
onKeyDown: handleKeydown,
|
|
112
98
|
ref: handleRef,
|
|
113
99
|
elemAfterInput: clearText,
|
|
114
100
|
isInvalid: !!error
|
|
115
|
-
})), error &&
|
|
101
|
+
})), error && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
116
102
|
testId: testIds.urlError
|
|
117
103
|
}, error)));
|
|
118
104
|
}));
|
|
105
|
+
};
|
|
106
|
+
export const TextInput = props => {
|
|
107
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
108
|
+
return /*#__PURE__*/React.createElement(TextInputNew, props);
|
|
109
|
+
}
|
|
110
|
+
return /*#__PURE__*/React.createElement(TextInputOld, props);
|
|
119
111
|
};
|
|
@@ -0,0 +1,121 @@
|
|
|
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 { Fragment, useCallback, useRef } from 'react';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
+
import { css, jsx } from '@emotion/react';
|
|
12
|
+
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
13
|
+
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
14
|
+
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
15
|
+
import Textfield from '@atlaskit/textfield';
|
|
16
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
17
|
+
import { ConditionalSpotlightTargetWrapper } from '../conditional-spotlight-target-wrapper';
|
|
18
|
+
import { isRedoEvent, isUndoEvent } from '../utils';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Overidding text input margin top which design system provides as a default spacer
|
|
22
|
+
* but it gets in the way of our layout
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
25
|
+
const fieldStyles = css({
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
+
'> div': {
|
|
28
|
+
marginTop: 0
|
|
29
|
+
},
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
31
|
+
'& + &': {
|
|
32
|
+
marginTop: "var(--ds-space-200, 16px)"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export const testIds = {
|
|
36
|
+
urlError: 'link-error',
|
|
37
|
+
clearUrlButton: 'clear-text'
|
|
38
|
+
};
|
|
39
|
+
const clearTextButtonStyles = xcss({
|
|
40
|
+
padding: 'space.0',
|
|
41
|
+
marginRight: 'space.050',
|
|
42
|
+
backgroundColor: 'color.background.neutral.subtle',
|
|
43
|
+
border: 'none',
|
|
44
|
+
verticalAlign: 'middle'
|
|
45
|
+
});
|
|
46
|
+
export const TextInputOld = ({
|
|
47
|
+
name,
|
|
48
|
+
label,
|
|
49
|
+
autoFocus,
|
|
50
|
+
onRedo,
|
|
51
|
+
onUndo,
|
|
52
|
+
onKeyDown,
|
|
53
|
+
onClear,
|
|
54
|
+
clearLabel,
|
|
55
|
+
error,
|
|
56
|
+
spotlightTargetName,
|
|
57
|
+
...restProps
|
|
58
|
+
}) => {
|
|
59
|
+
const inputRef = useRef(null);
|
|
60
|
+
const handleRef = useCallback(input => {
|
|
61
|
+
if (input) {
|
|
62
|
+
inputRef.current = input;
|
|
63
|
+
if (autoFocus) {
|
|
64
|
+
// Need this to prevent jumping when we render TextInput inside Portal @see ED-2992
|
|
65
|
+
input.focus({
|
|
66
|
+
preventScroll: true
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [autoFocus]);
|
|
71
|
+
const handleKeydown = useCallback(e => {
|
|
72
|
+
if (typeof onUndo === 'function' && isUndoEvent(e)) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
onUndo();
|
|
75
|
+
} else if (typeof onRedo === 'function' && isRedoEvent(e)) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
onRedo();
|
|
78
|
+
}
|
|
79
|
+
if (onKeyDown) {
|
|
80
|
+
onKeyDown(e);
|
|
81
|
+
}
|
|
82
|
+
}, [onUndo, onRedo, onKeyDown]);
|
|
83
|
+
const handleClear = useCallback(e => {
|
|
84
|
+
var _inputRef$current;
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
onClear === null || onClear === void 0 ? void 0 : onClear(name);
|
|
88
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
89
|
+
}, [name, onClear]);
|
|
90
|
+
const clearText = restProps.value !== '' && jsx(Tooltip, {
|
|
91
|
+
content: clearLabel
|
|
92
|
+
}, jsx(Pressable, {
|
|
93
|
+
xcss: clearTextButtonStyles,
|
|
94
|
+
onClick: handleClear,
|
|
95
|
+
testId: testIds.clearUrlButton
|
|
96
|
+
}, jsx(Selectclear, {
|
|
97
|
+
LEGACY_size: "medium",
|
|
98
|
+
label: clearLabel || '',
|
|
99
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
100
|
+
spacing: "spacious"
|
|
101
|
+
})));
|
|
102
|
+
return jsx("div", {
|
|
103
|
+
css: fieldStyles
|
|
104
|
+
}, jsx(Field, {
|
|
105
|
+
label: label,
|
|
106
|
+
name: name
|
|
107
|
+
}, ({
|
|
108
|
+
fieldProps
|
|
109
|
+
}) => {
|
|
110
|
+
return jsx(ConditionalSpotlightTargetWrapper, {
|
|
111
|
+
spotlightTargetName: spotlightTargetName
|
|
112
|
+
}, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
|
|
113
|
+
onKeyDown: handleKeydown,
|
|
114
|
+
ref: handleRef,
|
|
115
|
+
elemAfterInput: clearText,
|
|
116
|
+
isInvalid: !!error
|
|
117
|
+
})), error && jsx(ErrorMessage, {
|
|
118
|
+
testId: testIds.urlError
|
|
119
|
+
}, error)));
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._4cvr1h6o{align-items:center}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import Spinner from '@atlaskit/spinner';
|
|
8
7
|
import { MinHeightContainer } from '../../common/ui/min-height-container';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
8
|
+
import { LoaderFallbackOld } from './old';
|
|
9
|
+
const styles = null;
|
|
12
10
|
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
|
|
13
11
|
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
|
|
14
12
|
const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
|
|
@@ -46,15 +44,21 @@ const getEstimatedMinHeight = ({
|
|
|
46
44
|
* Loader / skeleton for the Link Picker. Takes LoaderFallbackProps (hideDisplayText, isLoadingPlugins, plugins)
|
|
47
45
|
* to determine the height to prevent jumps in height when loading
|
|
48
46
|
*/
|
|
49
|
-
export const
|
|
47
|
+
export const LoaderFallbackNew = props => {
|
|
50
48
|
const minHeight = getEstimatedMinHeight(props);
|
|
51
|
-
return
|
|
49
|
+
return /*#__PURE__*/React.createElement(MinHeightContainer, {
|
|
52
50
|
minHeight: minHeight,
|
|
53
51
|
"data-testid": "link-picker-root-loader-boundary-ui",
|
|
54
|
-
|
|
55
|
-
},
|
|
52
|
+
className: ax(["_4cvr1h6o"])
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
56
54
|
testId: "link-picker.component-loading-indicator",
|
|
57
55
|
interactionName: props.name || 'link-picker-loading',
|
|
58
56
|
size: "medium"
|
|
59
57
|
}));
|
|
58
|
+
};
|
|
59
|
+
export const LoaderFallback = props => {
|
|
60
|
+
if (fg('platform_bandicoots-link-picker-css')) {
|
|
61
|
+
return /*#__PURE__*/React.createElement(LoaderFallbackNew, props);
|
|
62
|
+
}
|
|
63
|
+
return /*#__PURE__*/React.createElement(LoaderFallbackOld, props);
|
|
60
64
|
};
|