@atlaskit/inline-edit 12.3.3 → 12.3.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 +12 -0
- package/dist/cjs/inline-edit.js +1 -1
- package/dist/cjs/inline-editable-textfield.js +25 -12
- package/dist/cjs/internal/buttons.js +9 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/inline-edit.js +1 -1
- package/dist/es2019/inline-editable-textfield.js +13 -1
- package/dist/es2019/internal/buttons.js +9 -9
- package/dist/es2019/version.json +1 -1
- package/dist/esm/inline-edit.js +1 -1
- package/dist/esm/inline-editable-textfield.js +14 -1
- package/dist/esm/internal/buttons.js +9 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/inline-editable-textfield.d.ts +0 -1
- package/dist/types-ts4.5/inline-editable-textfield.d.ts +0 -1
- package/package.json +8 -8
- package/tmp/api-report-tmp.d.ts +62 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 12.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7257459df07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7257459df07) - Fixed a regression: onCancel in InlinedEditableTextfield now resets the editable input to the defaultValue
|
|
8
|
+
|
|
9
|
+
## 12.3.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
14
|
+
|
|
3
15
|
## 12.3.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -32,7 +32,7 @@ var buttonStyles = (0, _react2.css)({
|
|
|
32
32
|
var analyticsAttributes = {
|
|
33
33
|
componentName: 'inlineEdit',
|
|
34
34
|
packageName: "@atlaskit/inline-edit",
|
|
35
|
-
packageVersion: "12.3.
|
|
35
|
+
packageVersion: "12.3.5"
|
|
36
36
|
};
|
|
37
37
|
var noop = function noop() {};
|
|
38
38
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
11
12
|
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
12
13
|
var _inlineDialog = _interopRequireDefault(require("@atlaskit/inline-dialog"));
|
|
13
14
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
@@ -16,11 +17,11 @@ var _inlineEdit = _interopRequireDefault(require("./inline-edit"));
|
|
|
16
17
|
var _constants = require("./internal/constants");
|
|
17
18
|
var _excluded = ["errorMessage", "isInvalid"];
|
|
18
19
|
/** @jsx jsx */
|
|
19
|
-
var errorIconContainerStyles = (0,
|
|
20
|
+
var errorIconContainerStyles = (0, _react2.css)({
|
|
20
21
|
paddingRight: "var(--ds-space-075, 6px)",
|
|
21
22
|
lineHeight: '100%'
|
|
22
23
|
});
|
|
23
|
-
var readViewForTextFieldStyles = (0,
|
|
24
|
+
var readViewForTextFieldStyles = (0, _react2.css)({
|
|
24
25
|
display: 'flex',
|
|
25
26
|
maxWidth: '100%',
|
|
26
27
|
minHeight: "".concat(8 * 2.5 / _constants.fontSize, "em"),
|
|
@@ -29,31 +30,43 @@ var readViewForTextFieldStyles = (0, _react.css)({
|
|
|
29
30
|
lineHeight: 8 * 2.5 / _constants.fontSize,
|
|
30
31
|
wordBreak: 'break-word'
|
|
31
32
|
});
|
|
32
|
-
var compactStyles = (0,
|
|
33
|
+
var compactStyles = (0, _react2.css)({
|
|
33
34
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)")
|
|
34
35
|
});
|
|
36
|
+
var noop = function noop() {};
|
|
35
37
|
var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
36
38
|
var _props$isCompact = props.isCompact,
|
|
37
39
|
isCompact = _props$isCompact === void 0 ? false : _props$isCompact,
|
|
38
40
|
defaultValue = props.defaultValue,
|
|
39
41
|
placeholder = props.placeholder,
|
|
40
|
-
testId = props.testId
|
|
41
|
-
|
|
42
|
+
testId = props.testId,
|
|
43
|
+
_props$onCancel = props.onCancel,
|
|
44
|
+
providedOnCancel = _props$onCancel === void 0 ? noop : _props$onCancel;
|
|
45
|
+
var textFieldRef = (0, _react.useRef)();
|
|
46
|
+
var onCancel = (0, _react.useCallback)(function () {
|
|
47
|
+
if (textFieldRef.current) {
|
|
48
|
+
textFieldRef.current.value = defaultValue || '';
|
|
49
|
+
}
|
|
50
|
+
providedOnCancel();
|
|
51
|
+
}, [defaultValue, providedOnCancel]);
|
|
52
|
+
return (0, _react2.jsx)(_inlineEdit.default, (0, _extends2.default)({}, props, {
|
|
53
|
+
onCancel: onCancel,
|
|
42
54
|
defaultValue: defaultValue,
|
|
43
55
|
editView: function editView(_ref) {
|
|
44
56
|
var errorMessage = _ref.errorMessage,
|
|
45
57
|
isInvalid = _ref.isInvalid,
|
|
46
58
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
|
-
return (0,
|
|
59
|
+
return (0, _react2.jsx)(_inlineDialog.default, {
|
|
48
60
|
isOpen: isInvalid,
|
|
49
|
-
content: (0,
|
|
61
|
+
content: (0, _react2.jsx)("div", {
|
|
50
62
|
id: "error-message"
|
|
51
63
|
}, errorMessage),
|
|
52
64
|
placement: "right"
|
|
53
|
-
}, (0,
|
|
54
|
-
|
|
65
|
+
}, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, props, {
|
|
66
|
+
ref: textFieldRef,
|
|
67
|
+
elemAfterInput: isInvalid && (0, _react2.jsx)("div", {
|
|
55
68
|
css: errorIconContainerStyles
|
|
56
|
-
}, (0,
|
|
69
|
+
}, (0, _react2.jsx)(_error.default, {
|
|
57
70
|
label: "error",
|
|
58
71
|
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
59
72
|
})),
|
|
@@ -63,7 +76,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
63
76
|
})));
|
|
64
77
|
},
|
|
65
78
|
readView: function readView() {
|
|
66
|
-
return (0,
|
|
79
|
+
return (0, _react2.jsx)("div", {
|
|
67
80
|
css: [readViewForTextFieldStyles, isCompact && compactStyles],
|
|
68
81
|
"data-compact": isCompact,
|
|
69
82
|
"data-testid": testId && "read-view-".concat(testId)
|
|
@@ -17,24 +17,24 @@ var buttonsContainerStyles = (0, _react.css)({
|
|
|
17
17
|
display: 'flex',
|
|
18
18
|
marginTop: "var(--ds-space-075, 6px)",
|
|
19
19
|
position: 'absolute',
|
|
20
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
21
21
|
top: '100%',
|
|
22
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
23
23
|
right: 0,
|
|
24
24
|
flexShrink: 0
|
|
25
25
|
});
|
|
26
26
|
var buttonWrapperElevationDarkStyles = (0, _react.css)({
|
|
27
27
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A), ")"),
|
|
28
28
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
29
|
-
// eslint-disable-next-line @
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
30
30
|
'& > button': {
|
|
31
31
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.DN70, ")")
|
|
32
32
|
},
|
|
33
|
-
// eslint-disable-next-line @
|
|
33
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
34
34
|
'& > button:hover': {
|
|
35
35
|
backgroundColor: "var(--ds-surface-overlay-hovered, ".concat(_colors.DN60, ")")
|
|
36
36
|
},
|
|
37
|
-
// eslint-disable-next-line @
|
|
37
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
38
38
|
'& > button:active': {
|
|
39
39
|
backgroundColor: "var(--ds-surface-overlay-pressed, ".concat(_colors.B75, ")"),
|
|
40
40
|
color: "var(--ds-text, ".concat(_colors.B400, ")")
|
|
@@ -43,15 +43,15 @@ var buttonWrapperElevationDarkStyles = (0, _react.css)({
|
|
|
43
43
|
var buttonWrapperElevationLightStyles = (0, _react.css)({
|
|
44
44
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
|
|
45
45
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
46
|
-
// eslint-disable-next-line @
|
|
46
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
47
47
|
'& > button': {
|
|
48
48
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N20A, ")")
|
|
49
49
|
},
|
|
50
|
-
// eslint-disable-next-line @
|
|
50
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
51
51
|
'& > button:hover': {
|
|
52
52
|
backgroundColor: "var(--ds-surface-overlay-hovered, ".concat(_colors.N30A, ")")
|
|
53
53
|
},
|
|
54
|
-
// eslint-disable-next-line @
|
|
54
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
55
55
|
'& > button:active': {
|
|
56
56
|
backgroundColor: "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))",
|
|
57
57
|
color: "var(--ds-text, ".concat(_colors.B400, ")")
|
|
@@ -62,7 +62,7 @@ var buttonWrapperBaseStyles = (0, _react.css)({
|
|
|
62
62
|
width: "var(--ds-space-400, 32px)",
|
|
63
63
|
zIndex: 200,
|
|
64
64
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
65
|
-
borderRadius:
|
|
65
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
66
66
|
fontSize: _constants.fontSize,
|
|
67
67
|
'&:last-child': {
|
|
68
68
|
marginLeft: "var(--ds-space-050, 4px)"
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
+
import { useCallback, useRef } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
5
6
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
@@ -23,14 +24,24 @@ const readViewForTextFieldStyles = css({
|
|
|
23
24
|
const compactStyles = css({
|
|
24
25
|
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-075, 6px)"}`
|
|
25
26
|
});
|
|
27
|
+
const noop = () => {};
|
|
26
28
|
const InlineEditableTextfield = props => {
|
|
27
29
|
const {
|
|
28
30
|
isCompact = false,
|
|
29
31
|
defaultValue,
|
|
30
32
|
placeholder,
|
|
31
|
-
testId
|
|
33
|
+
testId,
|
|
34
|
+
onCancel: providedOnCancel = noop
|
|
32
35
|
} = props;
|
|
36
|
+
const textFieldRef = useRef();
|
|
37
|
+
const onCancel = useCallback(() => {
|
|
38
|
+
if (textFieldRef.current) {
|
|
39
|
+
textFieldRef.current.value = defaultValue || '';
|
|
40
|
+
}
|
|
41
|
+
providedOnCancel();
|
|
42
|
+
}, [defaultValue, providedOnCancel]);
|
|
33
43
|
return jsx(InlineEdit, _extends({}, props, {
|
|
44
|
+
onCancel: onCancel,
|
|
34
45
|
defaultValue: defaultValue,
|
|
35
46
|
editView: ({
|
|
36
47
|
errorMessage,
|
|
@@ -43,6 +54,7 @@ const InlineEditableTextfield = props => {
|
|
|
43
54
|
}, errorMessage),
|
|
44
55
|
placement: "right"
|
|
45
56
|
}, jsx(Textfield, _extends({}, props, {
|
|
57
|
+
ref: textFieldRef,
|
|
46
58
|
elemAfterInput: isInvalid && jsx("div", {
|
|
47
59
|
css: errorIconContainerStyles
|
|
48
60
|
}, jsx(ErrorIcon, {
|
|
@@ -10,24 +10,24 @@ const buttonsContainerStyles = css({
|
|
|
10
10
|
display: 'flex',
|
|
11
11
|
marginTop: "var(--ds-space-075, 6px)",
|
|
12
12
|
position: 'absolute',
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
14
14
|
top: '100%',
|
|
15
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
16
16
|
right: 0,
|
|
17
17
|
flexShrink: 0
|
|
18
18
|
});
|
|
19
19
|
const buttonWrapperElevationDarkStyles = css({
|
|
20
20
|
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${DN50A}, 0 0 1px ${DN60A}`})`,
|
|
21
21
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
22
|
-
// eslint-disable-next-line @
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
23
23
|
'& > button': {
|
|
24
24
|
backgroundColor: `var(--ds-surface-overlay, ${DN70})`
|
|
25
25
|
},
|
|
26
|
-
// eslint-disable-next-line @
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
27
27
|
'& > button:hover': {
|
|
28
28
|
backgroundColor: `var(--ds-surface-overlay-hovered, ${DN60})`
|
|
29
29
|
},
|
|
30
|
-
// eslint-disable-next-line @
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
31
31
|
'& > button:active': {
|
|
32
32
|
backgroundColor: `var(--ds-surface-overlay-pressed, ${B75})`,
|
|
33
33
|
color: `var(--ds-text, ${B400})`
|
|
@@ -36,15 +36,15 @@ const buttonWrapperElevationDarkStyles = css({
|
|
|
36
36
|
const buttonWrapperElevationLightStyles = css({
|
|
37
37
|
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
|
|
38
38
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
39
|
-
// eslint-disable-next-line @
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
40
40
|
'& > button': {
|
|
41
41
|
backgroundColor: `var(--ds-surface-overlay, ${N20A})`
|
|
42
42
|
},
|
|
43
|
-
// eslint-disable-next-line @
|
|
43
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
44
44
|
'& > button:hover': {
|
|
45
45
|
backgroundColor: `var(--ds-surface-overlay-hovered, ${N30A})`
|
|
46
46
|
},
|
|
47
|
-
// eslint-disable-next-line @
|
|
47
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
48
48
|
'& > button:active': {
|
|
49
49
|
backgroundColor: "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))",
|
|
50
50
|
color: `var(--ds-text, ${B400})`
|
|
@@ -55,7 +55,7 @@ const buttonWrapperBaseStyles = css({
|
|
|
55
55
|
width: "var(--ds-space-400, 32px)",
|
|
56
56
|
zIndex: 200,
|
|
57
57
|
backgroundColor: `var(--ds-surface-overlay, ${N0})`,
|
|
58
|
-
borderRadius:
|
|
58
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
59
59
|
fontSize: fontSize,
|
|
60
60
|
'&:last-child': {
|
|
61
61
|
marginLeft: "var(--ds-space-050, 4px)"
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/inline-edit.js
CHANGED
|
@@ -23,7 +23,7 @@ var buttonStyles = css({
|
|
|
23
23
|
var analyticsAttributes = {
|
|
24
24
|
componentName: 'inlineEdit',
|
|
25
25
|
packageName: "@atlaskit/inline-edit",
|
|
26
|
-
packageVersion: "12.3.
|
|
26
|
+
packageVersion: "12.3.5"
|
|
27
27
|
};
|
|
28
28
|
var noop = function noop() {};
|
|
29
29
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["errorMessage", "isInvalid"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
+
import { useCallback, useRef } from 'react';
|
|
5
6
|
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
7
8
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
@@ -25,13 +26,24 @@ var readViewForTextFieldStyles = css({
|
|
|
25
26
|
var compactStyles = css({
|
|
26
27
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)")
|
|
27
28
|
});
|
|
29
|
+
var noop = function noop() {};
|
|
28
30
|
var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
29
31
|
var _props$isCompact = props.isCompact,
|
|
30
32
|
isCompact = _props$isCompact === void 0 ? false : _props$isCompact,
|
|
31
33
|
defaultValue = props.defaultValue,
|
|
32
34
|
placeholder = props.placeholder,
|
|
33
|
-
testId = props.testId
|
|
35
|
+
testId = props.testId,
|
|
36
|
+
_props$onCancel = props.onCancel,
|
|
37
|
+
providedOnCancel = _props$onCancel === void 0 ? noop : _props$onCancel;
|
|
38
|
+
var textFieldRef = useRef();
|
|
39
|
+
var onCancel = useCallback(function () {
|
|
40
|
+
if (textFieldRef.current) {
|
|
41
|
+
textFieldRef.current.value = defaultValue || '';
|
|
42
|
+
}
|
|
43
|
+
providedOnCancel();
|
|
44
|
+
}, [defaultValue, providedOnCancel]);
|
|
34
45
|
return jsx(InlineEdit, _extends({}, props, {
|
|
46
|
+
onCancel: onCancel,
|
|
35
47
|
defaultValue: defaultValue,
|
|
36
48
|
editView: function editView(_ref) {
|
|
37
49
|
var errorMessage = _ref.errorMessage,
|
|
@@ -44,6 +56,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
44
56
|
}, errorMessage),
|
|
45
57
|
placement: "right"
|
|
46
58
|
}, jsx(Textfield, _extends({}, props, {
|
|
59
|
+
ref: textFieldRef,
|
|
47
60
|
elemAfterInput: isInvalid && jsx("div", {
|
|
48
61
|
css: errorIconContainerStyles
|
|
49
62
|
}, jsx(ErrorIcon, {
|
|
@@ -10,24 +10,24 @@ var buttonsContainerStyles = css({
|
|
|
10
10
|
display: 'flex',
|
|
11
11
|
marginTop: "var(--ds-space-075, 6px)",
|
|
12
12
|
position: 'absolute',
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
14
14
|
top: '100%',
|
|
15
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
16
16
|
right: 0,
|
|
17
17
|
flexShrink: 0
|
|
18
18
|
});
|
|
19
19
|
var buttonWrapperElevationDarkStyles = css({
|
|
20
20
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(DN50A, ", 0 0 1px ").concat(DN60A), ")"),
|
|
21
21
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
22
|
-
// eslint-disable-next-line @
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
23
23
|
'& > button': {
|
|
24
24
|
backgroundColor: "var(--ds-surface-overlay, ".concat(DN70, ")")
|
|
25
25
|
},
|
|
26
|
-
// eslint-disable-next-line @
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
27
27
|
'& > button:hover': {
|
|
28
28
|
backgroundColor: "var(--ds-surface-overlay-hovered, ".concat(DN60, ")")
|
|
29
29
|
},
|
|
30
|
-
// eslint-disable-next-line @
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
31
31
|
'& > button:active': {
|
|
32
32
|
backgroundColor: "var(--ds-surface-overlay-pressed, ".concat(B75, ")"),
|
|
33
33
|
color: "var(--ds-text, ".concat(B400, ")")
|
|
@@ -36,15 +36,15 @@ var buttonWrapperElevationDarkStyles = css({
|
|
|
36
36
|
var buttonWrapperElevationLightStyles = css({
|
|
37
37
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
|
|
38
38
|
// These buttons are floating, so they need an override to overlay interaction states
|
|
39
|
-
// eslint-disable-next-line @
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
40
40
|
'& > button': {
|
|
41
41
|
backgroundColor: "var(--ds-surface-overlay, ".concat(N20A, ")")
|
|
42
42
|
},
|
|
43
|
-
// eslint-disable-next-line @
|
|
43
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
44
44
|
'& > button:hover': {
|
|
45
45
|
backgroundColor: "var(--ds-surface-overlay-hovered, ".concat(N30A, ")")
|
|
46
46
|
},
|
|
47
|
-
// eslint-disable-next-line @
|
|
47
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
48
48
|
'& > button:active': {
|
|
49
49
|
backgroundColor: "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))",
|
|
50
50
|
color: "var(--ds-text, ".concat(B400, ")")
|
|
@@ -55,7 +55,7 @@ var buttonWrapperBaseStyles = css({
|
|
|
55
55
|
width: "var(--ds-space-400, 32px)",
|
|
56
56
|
zIndex: 200,
|
|
57
57
|
backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
58
|
-
borderRadius:
|
|
58
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
59
59
|
fontSize: fontSize,
|
|
60
60
|
'&:last-child': {
|
|
61
61
|
marginLeft: "var(--ds-space-050, 4px)"
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.5",
|
|
4
4
|
"description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"homepage": "https://atlassian.design/components/inline-edit/",
|
|
26
26
|
"atlassian": {
|
|
27
27
|
"team": "Design System Team",
|
|
28
|
-
"releaseModel": "
|
|
28
|
+
"releaseModel": "continuous",
|
|
29
29
|
"website": {
|
|
30
30
|
"name": "Inline edit",
|
|
31
31
|
"category": "Components"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/button": "^16.
|
|
36
|
+
"@atlaskit/button": "^16.8.0",
|
|
37
37
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
38
38
|
"@atlaskit/form": "^8.11.0",
|
|
39
39
|
"@atlaskit/icon": "^21.12.0",
|
|
40
40
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
41
|
-
"@atlaskit/textfield": "^5.
|
|
41
|
+
"@atlaskit/textfield": "^5.6.0",
|
|
42
42
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.13.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1"
|
|
46
46
|
},
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"react": "^16.8.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@atlaskit/datetime-picker": "^12.
|
|
51
|
+
"@atlaskit/datetime-picker": "^12.7.0",
|
|
52
52
|
"@atlaskit/docs": "*",
|
|
53
53
|
"@atlaskit/section-message": "^6.4.0",
|
|
54
|
-
"@atlaskit/select": "^16.
|
|
54
|
+
"@atlaskit/select": "^16.5.0",
|
|
55
55
|
"@atlaskit/ssr": "*",
|
|
56
56
|
"@atlaskit/tag": "^11.5.0",
|
|
57
57
|
"@atlaskit/tag-group": "^10.2.0",
|
|
58
|
-
"@atlaskit/textarea": "^4.
|
|
58
|
+
"@atlaskit/textarea": "^4.7.0",
|
|
59
59
|
"@atlaskit/visual-regression": "*",
|
|
60
60
|
"@atlaskit/webdriver-runner": "*",
|
|
61
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/inline-edit"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { FieldProps } from '@atlaskit/form';
|
|
8
|
+
import { jsx } from '@emotion/react';
|
|
9
|
+
import { default as React_2 } from 'react';
|
|
10
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
11
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
12
|
+
|
|
13
|
+
// @public (undocumented)
|
|
14
|
+
interface CommonProps extends WithAnalyticsEventsProps {
|
|
15
|
+
analyticsContext?: Record<string, any>;
|
|
16
|
+
cancelButtonLabel?: string;
|
|
17
|
+
confirmButtonLabel?: string;
|
|
18
|
+
defaultValue: any;
|
|
19
|
+
editButtonLabel?: string;
|
|
20
|
+
hideActionButtons?: boolean;
|
|
21
|
+
isRequired?: boolean;
|
|
22
|
+
keepEditViewOpenOnBlur?: boolean;
|
|
23
|
+
label?: string;
|
|
24
|
+
onCancel?: () => void;
|
|
25
|
+
readViewFitContainerWidth?: boolean;
|
|
26
|
+
startWithEditViewOpen?: boolean;
|
|
27
|
+
validate?: (value: any, formState: {}, fieldState: {}) => Promise<string | void> | string | void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// @public (undocumented)
|
|
31
|
+
interface ExtendedFieldProps<FieldValue> extends FieldProps<FieldValue> {
|
|
32
|
+
// (undocumented)
|
|
33
|
+
errorMessage?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
const InlineEdit: <FieldValue extends unknown = string>(props: InlineEditProps<FieldValue>) => jsx.JSX.Element;
|
|
38
|
+
export default InlineEdit;
|
|
39
|
+
|
|
40
|
+
// @public (undocumented)
|
|
41
|
+
export const InlineEditableTextfield: (props: InlineEditableTextfieldProps) => jsx.JSX.Element;
|
|
42
|
+
|
|
43
|
+
// @public (undocumented)
|
|
44
|
+
export interface InlineEditableTextfieldProps extends CommonProps {
|
|
45
|
+
isCompact?: boolean;
|
|
46
|
+
onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
47
|
+
placeholder: string;
|
|
48
|
+
testId?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
export interface InlineEditProps<FieldValue> extends CommonProps {
|
|
53
|
+
editView: (fieldProps: ExtendedFieldProps<FieldValue>, ref: React_2.RefObject<any>) => React_2.ReactNode;
|
|
54
|
+
isEditing?: boolean;
|
|
55
|
+
onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
|
|
56
|
+
onEdit?: () => void;
|
|
57
|
+
readView: () => React_2.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// (No @packageDocumentation comment for this package)
|
|
61
|
+
|
|
62
|
+
```
|