@atlaskit/link-picker 3.9.3 → 3.9.5
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 +15 -0
- package/dist/cjs/ui/link-picker/index.js +2 -1
- package/dist/cjs/ui/link-picker/text-input/index.compiled.css +3 -0
- package/dist/cjs/ui/link-picker/text-input/index.js +18 -4
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/ui/link-picker/index.js +2 -1
- package/dist/es2019/ui/link-picker/text-input/index.compiled.css +3 -0
- package/dist/es2019/ui/link-picker/text-input/index.js +17 -4
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/ui/link-picker/index.js +2 -1
- package/dist/esm/ui/link-picker/text-input/index.compiled.css +3 -0
- package/dist/esm/ui/link-picker/text-input/index.js +19 -5
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/analytics/input-field-tracking.d.ts +4 -4
- package/dist/types/common/generic-error-svg/index.d.ts +0 -1
- package/dist/types/common/ui/empty-state/index.d.ts +0 -1
- package/dist/types/services/use-plugins/reducer.d.ts +0 -1
- package/dist/types/ui/error-boundary/error-boundary-fallback/index.d.ts +0 -1
- package/dist/types/ui/index.d.ts +0 -1
- package/dist/types/ui/lazy.d.ts +0 -1
- package/dist/types/ui/link-picker/form-footer/index.d.ts +0 -1
- package/dist/types/ui/link-picker/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/scrolling-tabs/index.d.ts +0 -1
- package/dist/types/ui/link-picker/search-results/search-results-container/index.d.ts +0 -1
- package/dist/types/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types/ui/loader-fallback/index.d.ts +0 -1
- package/dist/types-ts4.5/common/analytics/input-field-tracking.d.ts +4 -4
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +0 -1
- package/dist/types-ts4.5/common/ui/empty-state/index.d.ts +0 -1
- package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +0 -1
- package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/lazy.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +0 -1
- package/lazy/package.json +1 -1
- package/package.json +12 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 3.9.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.9.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`65822cbb7d2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65822cbb7d2df) -
|
|
14
|
+
[ux] NAVX-1368 Adding required field and corresponding aria-describedby label for link-picker
|
|
15
|
+
label
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.9.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -444,7 +444,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
444
444
|
onClear: handleUrlClear,
|
|
445
445
|
onKeyDown: handleKeyDown,
|
|
446
446
|
onChange: handleChangeUrl,
|
|
447
|
-
inputRef: inputRef
|
|
447
|
+
inputRef: inputRef,
|
|
448
|
+
isRequired: true
|
|
448
449
|
})), !hideDisplayText && /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement(DisplayTextInputField, {
|
|
449
450
|
autoComplete: "off",
|
|
450
451
|
name: "displayText",
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
5
5
|
._7yjtidpf >div{margin-top:0}
|
|
6
6
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
7
|
+
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
7
8
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
9
|
+
._ect41gqc{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
10
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
9
11
|
._onzypxbi+._onzypxbi{margin-top:var(--ds-space-200,1pc)}
|
|
10
12
|
._s7n4nkob{vertical-align:middle}
|
|
13
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
11
14
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
@@ -15,15 +15,17 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
var _useCallbackRef = require("use-callback-ref");
|
|
16
16
|
var _form = require("@atlaskit/form");
|
|
17
17
|
var _crossCircleSelectClear = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross-circle--select-clear"));
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
20
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
20
21
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
22
|
var _conditionalSpotlightTargetWrapper = require("./conditional-spotlight-target-wrapper");
|
|
22
23
|
var _utils = require("./utils");
|
|
23
|
-
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName", "inputRef"];
|
|
24
|
+
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName", "inputRef", "isRequired"];
|
|
24
25
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
25
26
|
var styles = {
|
|
26
|
-
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob"
|
|
27
|
+
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob",
|
|
28
|
+
requiredIndicatorStyles: "_syaz1tmw _ect41gqc _bozgv77o"
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
/**
|
|
@@ -32,6 +34,13 @@ var styles = {
|
|
|
32
34
|
*/
|
|
33
35
|
var baseFieldStyles = null;
|
|
34
36
|
var newFieldStyles = null;
|
|
37
|
+
var RequiredAsterisk = function RequiredAsterisk() {
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
39
|
+
as: "span",
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
xcss: styles.requiredIndicatorStyles
|
|
42
|
+
}, "*");
|
|
43
|
+
};
|
|
35
44
|
var testIds = exports.testIds = {
|
|
36
45
|
urlError: 'link-error',
|
|
37
46
|
clearUrlButton: 'clear-text'
|
|
@@ -48,6 +57,8 @@ var TextInput = exports.TextInput = function TextInput(_ref) {
|
|
|
48
57
|
error = _ref.error,
|
|
49
58
|
spotlightTargetName = _ref.spotlightTargetName,
|
|
50
59
|
inputRefProp = _ref.inputRef,
|
|
60
|
+
_ref$isRequired = _ref.isRequired,
|
|
61
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
51
62
|
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
52
63
|
var inputRef = (0, _react.useRef)(null);
|
|
53
64
|
var handleRef = (0, _react.useCallback)(function (input) {
|
|
@@ -100,7 +111,8 @@ var TextInput = exports.TextInput = function TextInput(_ref) {
|
|
|
100
111
|
className: (0, _runtime.ax)(["_7yjtidpf _onzypxbi", "_11c81vhk"])
|
|
101
112
|
}, /*#__PURE__*/_react.default.createElement(_form.Field, {
|
|
102
113
|
label: label,
|
|
103
|
-
name: name
|
|
114
|
+
name: name,
|
|
115
|
+
elementAfterLabel: isRequired && (0, _platformFeatureFlags.fg)('navx-1368-link-picker-a11y-mandatory-states') ? /*#__PURE__*/_react.default.createElement(RequiredAsterisk, null) : undefined
|
|
104
116
|
}, function (_ref2) {
|
|
105
117
|
var fieldProps = _ref2.fieldProps;
|
|
106
118
|
return /*#__PURE__*/_react.default.createElement(_conditionalSpotlightTargetWrapper.ConditionalSpotlightTargetWrapper, {
|
|
@@ -110,7 +122,9 @@ var TextInput = exports.TextInput = function TextInput(_ref) {
|
|
|
110
122
|
ref: textfieldRef,
|
|
111
123
|
elemAfterInput: clearText,
|
|
112
124
|
isInvalid: !!error
|
|
113
|
-
}
|
|
125
|
+
}, (0, _platformFeatureFlags.fg)('navx-1368-link-picker-a11y-mandatory-states') ? {
|
|
126
|
+
'aria-describedby': "".concat(restProps['aria-describedby'], " ").concat(fieldProps.id, "-error")
|
|
127
|
+
} : {})), error && /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
|
|
114
128
|
testId: testIds.urlError
|
|
115
129
|
}, error)));
|
|
116
130
|
}));
|
package/dist/cjs/ui/main.js
CHANGED
|
@@ -25,7 +25,7 @@ var testIds = exports.testIds = {
|
|
|
25
25
|
};
|
|
26
26
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
27
27
|
packageName: "@atlaskit/link-picker" || '',
|
|
28
|
-
packageVersion: "3.9.
|
|
28
|
+
packageVersion: "3.9.4" || '',
|
|
29
29
|
componentName: _constants.COMPONENT_NAME,
|
|
30
30
|
source: _constants.COMPONENT_NAME
|
|
31
31
|
};
|
|
@@ -399,7 +399,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
399
399
|
onClear: handleUrlClear,
|
|
400
400
|
onKeyDown: handleKeyDown,
|
|
401
401
|
onChange: handleChangeUrl,
|
|
402
|
-
inputRef: inputRef
|
|
402
|
+
inputRef: inputRef,
|
|
403
|
+
isRequired: true
|
|
403
404
|
})), !hideDisplayText && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DisplayTextInputField, {
|
|
404
405
|
autoComplete: "off",
|
|
405
406
|
name: "displayText",
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
5
5
|
._7yjtidpf >div{margin-top:0}
|
|
6
6
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
7
|
+
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
7
8
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
9
|
+
._ect41gqc{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
10
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
9
11
|
._onzypxbi+._onzypxbi{margin-top:var(--ds-space-200,1pc)}
|
|
10
12
|
._s7n4nkob{vertical-align:middle}
|
|
13
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
11
14
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
@@ -6,13 +6,15 @@ import React, { Fragment, useCallback, useMemo, useRef } from 'react';
|
|
|
6
6
|
import { useMergeRefs } from 'use-callback-ref';
|
|
7
7
|
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
8
8
|
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
9
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
11
|
import Textfield from '@atlaskit/textfield';
|
|
11
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
13
|
import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
|
|
13
14
|
import { isRedoEvent, isUndoEvent } from './utils';
|
|
14
15
|
const styles = {
|
|
15
|
-
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob"
|
|
16
|
+
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob",
|
|
17
|
+
requiredIndicatorStyles: "_syaz1tmw _ect41gqc _bozgv77o"
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -21,6 +23,13 @@ const styles = {
|
|
|
21
23
|
*/
|
|
22
24
|
const baseFieldStyles = null;
|
|
23
25
|
const newFieldStyles = null;
|
|
26
|
+
const RequiredAsterisk = () => {
|
|
27
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
as: "span",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
xcss: styles.requiredIndicatorStyles
|
|
31
|
+
}, "*");
|
|
32
|
+
};
|
|
24
33
|
export const testIds = {
|
|
25
34
|
urlError: 'link-error',
|
|
26
35
|
clearUrlButton: 'clear-text'
|
|
@@ -37,6 +46,7 @@ export const TextInput = ({
|
|
|
37
46
|
error,
|
|
38
47
|
spotlightTargetName,
|
|
39
48
|
inputRef: inputRefProp,
|
|
49
|
+
isRequired = false,
|
|
40
50
|
...restProps
|
|
41
51
|
}) => {
|
|
42
52
|
const inputRef = useRef(null);
|
|
@@ -88,7 +98,8 @@ export const TextInput = ({
|
|
|
88
98
|
className: ax(["_7yjtidpf _onzypxbi", "_11c81vhk"])
|
|
89
99
|
}, /*#__PURE__*/React.createElement(Field, {
|
|
90
100
|
label: label,
|
|
91
|
-
name: name
|
|
101
|
+
name: name,
|
|
102
|
+
elementAfterLabel: isRequired && fg('navx-1368-link-picker-a11y-mandatory-states') ? /*#__PURE__*/React.createElement(RequiredAsterisk, null) : undefined
|
|
92
103
|
}, ({
|
|
93
104
|
fieldProps
|
|
94
105
|
}) => {
|
|
@@ -99,7 +110,9 @@ export const TextInput = ({
|
|
|
99
110
|
ref: textfieldRef,
|
|
100
111
|
elemAfterInput: clearText,
|
|
101
112
|
isInvalid: !!error
|
|
102
|
-
}
|
|
113
|
+
}, fg('navx-1368-link-picker-a11y-mandatory-states') ? {
|
|
114
|
+
'aria-describedby': `${restProps['aria-describedby']} ${fieldProps.id}-error`
|
|
115
|
+
} : {})), error && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
103
116
|
testId: testIds.urlError
|
|
104
117
|
}, error)));
|
|
105
118
|
}));
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -435,7 +435,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
435
435
|
onClear: handleUrlClear,
|
|
436
436
|
onKeyDown: handleKeyDown,
|
|
437
437
|
onChange: handleChangeUrl,
|
|
438
|
-
inputRef: inputRef
|
|
438
|
+
inputRef: inputRef,
|
|
439
|
+
isRequired: true
|
|
439
440
|
})), !hideDisplayText && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DisplayTextInputField, {
|
|
440
441
|
autoComplete: "off",
|
|
441
442
|
name: "displayText",
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
5
5
|
._7yjtidpf >div{margin-top:0}
|
|
6
6
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
7
|
+
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
7
8
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
9
|
+
._ect41gqc{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
8
10
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
9
11
|
._onzypxbi+._onzypxbi{margin-top:var(--ds-space-200,1pc)}
|
|
10
12
|
._s7n4nkob{vertical-align:middle}
|
|
13
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
11
14
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName", "inputRef"];
|
|
4
|
+
var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName", "inputRef", "isRequired"];
|
|
5
5
|
import "./index.compiled.css";
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
import React, { Fragment, useCallback, useMemo, useRef } from 'react';
|
|
8
8
|
import { useMergeRefs } from 'use-callback-ref';
|
|
9
9
|
import { ErrorMessage, Field } from '@atlaskit/form';
|
|
10
10
|
import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
11
|
-
import {
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
12
13
|
import Textfield from '@atlaskit/textfield';
|
|
13
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
15
|
import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
|
|
15
16
|
import { isRedoEvent, isUndoEvent } from './utils';
|
|
16
17
|
var styles = {
|
|
17
|
-
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob"
|
|
18
|
+
clearTextButton: "_19itglyw _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _2hwx1b66 _bfhksm61 _s7n4nkob",
|
|
19
|
+
requiredIndicatorStyles: "_syaz1tmw _ect41gqc _bozgv77o"
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -23,6 +25,13 @@ var styles = {
|
|
|
23
25
|
*/
|
|
24
26
|
var baseFieldStyles = null;
|
|
25
27
|
var newFieldStyles = null;
|
|
28
|
+
var RequiredAsterisk = function RequiredAsterisk() {
|
|
29
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
as: "span",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
xcss: styles.requiredIndicatorStyles
|
|
33
|
+
}, "*");
|
|
34
|
+
};
|
|
26
35
|
export var testIds = {
|
|
27
36
|
urlError: 'link-error',
|
|
28
37
|
clearUrlButton: 'clear-text'
|
|
@@ -39,6 +48,8 @@ export var TextInput = function TextInput(_ref) {
|
|
|
39
48
|
error = _ref.error,
|
|
40
49
|
spotlightTargetName = _ref.spotlightTargetName,
|
|
41
50
|
inputRefProp = _ref.inputRef,
|
|
51
|
+
_ref$isRequired = _ref.isRequired,
|
|
52
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
42
53
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
43
54
|
var inputRef = useRef(null);
|
|
44
55
|
var handleRef = useCallback(function (input) {
|
|
@@ -91,7 +102,8 @@ export var TextInput = function TextInput(_ref) {
|
|
|
91
102
|
className: ax(["_7yjtidpf _onzypxbi", "_11c81vhk"])
|
|
92
103
|
}, /*#__PURE__*/React.createElement(Field, {
|
|
93
104
|
label: label,
|
|
94
|
-
name: name
|
|
105
|
+
name: name,
|
|
106
|
+
elementAfterLabel: isRequired && fg('navx-1368-link-picker-a11y-mandatory-states') ? /*#__PURE__*/React.createElement(RequiredAsterisk, null) : undefined
|
|
95
107
|
}, function (_ref2) {
|
|
96
108
|
var fieldProps = _ref2.fieldProps;
|
|
97
109
|
return /*#__PURE__*/React.createElement(ConditionalSpotlightTargetWrapper, {
|
|
@@ -101,7 +113,9 @@ export var TextInput = function TextInput(_ref) {
|
|
|
101
113
|
ref: textfieldRef,
|
|
102
114
|
elemAfterInput: clearText,
|
|
103
115
|
isInvalid: !!error
|
|
104
|
-
}
|
|
116
|
+
}, fg('navx-1368-link-picker-a11y-mandatory-states') ? {
|
|
117
|
+
'aria-describedby': "".concat(restProps['aria-describedby'], " ").concat(fieldProps.id, "-error")
|
|
118
|
+
} : {})), error && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
105
119
|
testId: testIds.urlError
|
|
106
120
|
}, error)));
|
|
107
121
|
}));
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -9,9 +9,9 @@ type InputFields = 'link' | 'displayText';
|
|
|
9
9
|
* @returns HOC Input field with tracking
|
|
10
10
|
*/
|
|
11
11
|
export declare const withInputFieldTracking: <P extends {
|
|
12
|
-
onBlur?: (
|
|
13
|
-
onChange?: (
|
|
14
|
-
onClear?: Function
|
|
15
|
-
onFocus?: (
|
|
12
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
13
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
onClear?: Function;
|
|
15
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
16
16
|
}, Field extends InputFields>(WrappedComponent: React.ComponentType<P>, field: Field, filterOnChangeEventAttrs?: <OnChangeAttributes extends Partial<LinkPickerAnalyticsContextType>>(event: React.ChangeEvent<HTMLInputElement>, attributes: OnChangeAttributes) => OnChangeAttributes) => React.ComponentType<P>;
|
|
17
17
|
export {};
|
package/dist/types/ui/index.d.ts
CHANGED
package/dist/types/ui/lazy.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ export declare const testIds: {
|
|
|
21
21
|
urlError: string;
|
|
22
22
|
clearUrlButton: string;
|
|
23
23
|
};
|
|
24
|
-
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, inputRef: inputRefProp, ...restProps }: TextInputProps) => JSX.Element;
|
|
24
|
+
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, inputRef: inputRefProp, isRequired, ...restProps }: TextInputProps) => JSX.Element;
|
|
@@ -9,9 +9,9 @@ type InputFields = 'link' | 'displayText';
|
|
|
9
9
|
* @returns HOC Input field with tracking
|
|
10
10
|
*/
|
|
11
11
|
export declare const withInputFieldTracking: <P extends {
|
|
12
|
-
onBlur?: (
|
|
13
|
-
onChange?: (
|
|
14
|
-
onClear?: Function
|
|
15
|
-
onFocus?: (
|
|
12
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
13
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
onClear?: Function;
|
|
15
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
16
16
|
}, Field extends InputFields>(WrappedComponent: React.ComponentType<P>, field: Field, filterOnChangeEventAttrs?: <OnChangeAttributes extends Partial<LinkPickerAnalyticsContextType>>(event: React.ChangeEvent<HTMLInputElement>, attributes: OnChangeAttributes) => OnChangeAttributes) => React.ComponentType<P>;
|
|
17
17
|
export {};
|
|
@@ -21,4 +21,4 @@ export declare const testIds: {
|
|
|
21
21
|
urlError: string;
|
|
22
22
|
clearUrlButton: string;
|
|
23
23
|
};
|
|
24
|
-
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, inputRef: inputRefProp, ...restProps }: TextInputProps) => JSX.Element;
|
|
24
|
+
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, inputRef: inputRefProp, isRequired, ...restProps }: TextInputProps) => JSX.Element;
|
package/lazy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.5",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,20 +39,17 @@
|
|
|
39
39
|
"platform-linking-link-picker-previewable-only": {
|
|
40
40
|
"type": "boolean"
|
|
41
41
|
},
|
|
42
|
-
"icon-object-migration": {
|
|
43
|
-
"type": "boolean"
|
|
44
|
-
},
|
|
45
42
|
"platform-visual-refresh-icons": {
|
|
46
43
|
"type": "boolean"
|
|
47
44
|
},
|
|
48
|
-
"platform_support_live_doc_icons_in_link_picker": {
|
|
49
|
-
"type": "boolean"
|
|
50
|
-
},
|
|
51
45
|
"dst-a11y__replace-anchor-with-link__linking-platfo": {
|
|
52
46
|
"type": "boolean"
|
|
53
47
|
},
|
|
54
48
|
"should-render-to-parent-should-be-true-linking-pla": {
|
|
55
49
|
"type": "boolean"
|
|
50
|
+
},
|
|
51
|
+
"navx-1368-link-picker-a11y-mandatory-states": {
|
|
52
|
+
"type": "boolean"
|
|
56
53
|
}
|
|
57
54
|
},
|
|
58
55
|
"scripts": {
|
|
@@ -60,21 +57,21 @@
|
|
|
60
57
|
},
|
|
61
58
|
"dependencies": {
|
|
62
59
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
63
|
-
"@atlaskit/atlassian-context": "^0.
|
|
64
|
-
"@atlaskit/button": "^23.
|
|
60
|
+
"@atlaskit/atlassian-context": "^0.5.0",
|
|
61
|
+
"@atlaskit/button": "^23.4.0",
|
|
65
62
|
"@atlaskit/css": "^0.12.0",
|
|
66
|
-
"@atlaskit/form": "^12.
|
|
63
|
+
"@atlaskit/form": "^12.1.0",
|
|
67
64
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
68
65
|
"@atlaskit/heading": "^5.2.0",
|
|
69
|
-
"@atlaskit/icon": "^27.
|
|
66
|
+
"@atlaskit/icon": "^27.12.0",
|
|
70
67
|
"@atlaskit/intl-messages-provider": "^2.0.0",
|
|
71
68
|
"@atlaskit/link": "^3.2.0",
|
|
72
|
-
"@atlaskit/link-provider": "^3.
|
|
73
|
-
"@atlaskit/linking-common": "^9.
|
|
69
|
+
"@atlaskit/link-provider": "^3.7.0",
|
|
70
|
+
"@atlaskit/linking-common": "^9.5.0",
|
|
74
71
|
"@atlaskit/onboarding": "^14.3.0",
|
|
75
72
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
76
73
|
"@atlaskit/primitives": "^14.11.0",
|
|
77
|
-
"@atlaskit/smart-card": "^40.
|
|
74
|
+
"@atlaskit/smart-card": "^40.10.0",
|
|
78
75
|
"@atlaskit/spinner": "^19.0.0",
|
|
79
76
|
"@atlaskit/tabs": "^18.1.0",
|
|
80
77
|
"@atlaskit/textfield": "^8.0.0",
|
|
@@ -116,8 +113,7 @@
|
|
|
116
113
|
"node-fetch": "^2.6.7",
|
|
117
114
|
"prettier": "^3.2.5",
|
|
118
115
|
"react-dom": "^18.2.0",
|
|
119
|
-
"sinon": "^2.2.0"
|
|
120
|
-
"typescript": "~5.4.2"
|
|
116
|
+
"sinon": "^2.2.0"
|
|
121
117
|
},
|
|
122
118
|
"techstack": {
|
|
123
119
|
"@atlassian/frontend": {
|