@atlaskit/link-create 0.9.0 → 0.9.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 +6 -0
- package/dist/cjs/ui/create-form/form-footer/index.js +12 -0
- package/dist/cjs/ui/create-form/form-footer/main.js +48 -0
- package/dist/cjs/ui/create-form/main.js +8 -33
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/create-form/form-footer/index.js +1 -0
- package/dist/es2019/ui/create-form/form-footer/main.js +38 -0
- package/dist/es2019/ui/create-form/main.js +8 -30
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/create-form/form-footer/index.js +1 -0
- package/dist/esm/ui/create-form/form-footer/main.js +37 -0
- package/dist/esm/ui/create-form/main.js +8 -30
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/create-form/form-footer/index.d.ts +1 -0
- package/dist/types/ui/create-form/form-footer/main.d.ts +9 -0
- package/dist/types-ts4.5/ui/create-form/form-footer/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/create-form/form-footer/main.d.ts +9 -0
- package/package.json +8 -2
- package/tmp/api-report-tmp.d.ts +0 -136
- /package/dist/cjs/ui/create-form/{messages.js → form-footer/messages.js} +0 -0
- /package/dist/es2019/ui/create-form/{messages.js → form-footer/messages.js} +0 -0
- /package/dist/esm/ui/create-form/{messages.js → form-footer/messages.js} +0 -0
- /package/dist/types/ui/create-form/{messages.d.ts → form-footer/messages.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/create-form/{messages.d.ts → form-footer/messages.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-create
|
|
2
2
|
|
|
3
|
+
## 0.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`84b33e5a4b6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/84b33e5a4b6) - EDM-6544: minor internal refactors with no expected functional change
|
|
8
|
+
|
|
3
9
|
## 0.9.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CreateFormFooter", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _main.CreateFormFooter;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _main = require("./main");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.CreateFormFooter = CreateFormFooter;
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _button = _interopRequireWildcard(require("@atlaskit/button"));
|
|
12
|
+
var _loadingButton = _interopRequireDefault(require("@atlaskit/button/loading-button"));
|
|
13
|
+
var _form = require("@atlaskit/form");
|
|
14
|
+
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
15
|
+
var _messages = require("./messages");
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
|
|
20
|
+
var errorStyles = (0, _react.css)({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
marginRight: 'auto'
|
|
24
|
+
});
|
|
25
|
+
function CreateFormFooter(_ref) {
|
|
26
|
+
var formErrorMessage = _ref.formErrorMessage,
|
|
27
|
+
handleCancel = _ref.handleCancel,
|
|
28
|
+
submitting = _ref.submitting,
|
|
29
|
+
testId = _ref.testId;
|
|
30
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
31
|
+
return (0, _react.jsx)(_form.FormFooter, null, formErrorMessage && (0, _react.jsx)("div", {
|
|
32
|
+
css: errorStyles,
|
|
33
|
+
"data-testid": "".concat(testId, "-error")
|
|
34
|
+
}, (0, _react.jsx)(_error.default, {
|
|
35
|
+
label: formErrorMessage,
|
|
36
|
+
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
37
|
+
}), formErrorMessage), (0, _react.jsx)(_button.ButtonGroup, null, (0, _react.jsx)(_button.default, {
|
|
38
|
+
type: "button",
|
|
39
|
+
appearance: "subtle",
|
|
40
|
+
onClick: handleCancel,
|
|
41
|
+
testId: "".concat(testId, "-button-cancel")
|
|
42
|
+
}, intl.formatMessage(_messages.messages.close)), (0, _react.jsx)(_loadingButton.default, {
|
|
43
|
+
type: "submit",
|
|
44
|
+
appearance: "primary",
|
|
45
|
+
isLoading: submitting,
|
|
46
|
+
testId: "".concat(testId, "-button-submit")
|
|
47
|
+
}, intl.formatMessage(_messages.messages.create))));
|
|
48
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,21 +10,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
11
|
var _react = require("react");
|
|
13
12
|
var _react2 = require("@emotion/react");
|
|
14
|
-
var _reactIntlNext = require("react-intl-next");
|
|
15
13
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
|
-
var
|
|
17
|
-
var _loadingButton = _interopRequireDefault(require("@atlaskit/button/loading-button"));
|
|
18
|
-
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
19
|
-
var _form = _interopRequireWildcard(require("@atlaskit/form"));
|
|
20
|
-
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
14
|
+
var _form = _interopRequireDefault(require("@atlaskit/form"));
|
|
21
15
|
var _constants = require("../../common/constants");
|
|
22
16
|
var _analytics = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
23
17
|
var _formContext = require("../../controllers/form-context");
|
|
18
|
+
var _formFooter = require("./form-footer");
|
|
24
19
|
var _formLoader = require("./form-loader");
|
|
25
|
-
var _messages = require("./messages");
|
|
26
20
|
var _utils = require("./utils");
|
|
27
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
21
|
/** @jsx jsx */
|
|
30
22
|
|
|
31
23
|
var formStyles = (0, _react2.css)({
|
|
@@ -33,11 +25,6 @@ var formStyles = (0, _react2.css)({
|
|
|
33
25
|
padding: "0 0 ".concat("var(--ds-space-300, 24px)", " 0"),
|
|
34
26
|
margin: "var(--ds-space-0, 0px)".concat(" auto")
|
|
35
27
|
});
|
|
36
|
-
var errorStyles = (0, _react2.css)({
|
|
37
|
-
display: 'flex',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
marginRight: 'auto'
|
|
40
|
-
});
|
|
41
28
|
var TEST_ID = 'link-create-form';
|
|
42
29
|
exports.TEST_ID = TEST_ID;
|
|
43
30
|
var CreateForm = function CreateForm(_ref) {
|
|
@@ -48,7 +35,6 @@ var CreateForm = function CreateForm(_ref) {
|
|
|
48
35
|
onCancel = _ref.onCancel,
|
|
49
36
|
isLoading = _ref.isLoading,
|
|
50
37
|
hideFooter = _ref.hideFooter;
|
|
51
|
-
var intl = (0, _reactIntlNext.useIntl)();
|
|
52
38
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
53
39
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
54
40
|
var _useFormContext = (0, _formContext.useFormContext)(),
|
|
@@ -99,23 +85,12 @@ var CreateForm = function CreateForm(_ref) {
|
|
|
99
85
|
name: "link-create-form",
|
|
100
86
|
"data-testid": testId,
|
|
101
87
|
css: formStyles
|
|
102
|
-
}), (0, _react2.jsx)("div", null, children), !hideFooter && (0, _react2.jsx)(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}), formErrorMessage), (0, _react2.jsx)(_button.ButtonGroup, null, (0, _react2.jsx)(_standardButton.default, {
|
|
109
|
-
type: "button",
|
|
110
|
-
appearance: "subtle",
|
|
111
|
-
onClick: handleCancel,
|
|
112
|
-
testId: "".concat(testId, "-button-cancel")
|
|
113
|
-
}, intl.formatMessage(_messages.messages.close)), (0, _react2.jsx)(_loadingButton.default, {
|
|
114
|
-
type: "submit",
|
|
115
|
-
appearance: "primary",
|
|
116
|
-
isLoading: submitting,
|
|
117
|
-
testId: "".concat(testId, "-button-submit")
|
|
118
|
-
}, intl.formatMessage(_messages.messages.create)))));
|
|
88
|
+
}), (0, _react2.jsx)("div", null, children), !hideFooter && (0, _react2.jsx)(_formFooter.CreateFormFooter, {
|
|
89
|
+
formErrorMessage: formErrorMessage,
|
|
90
|
+
handleCancel: handleCancel,
|
|
91
|
+
submitting: submitting,
|
|
92
|
+
testId: testId
|
|
93
|
+
}));
|
|
119
94
|
});
|
|
120
95
|
};
|
|
121
96
|
exports.CreateForm = CreateForm;
|
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CreateFormFooter } from './main';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
5
|
+
import LoadingButton from '@atlaskit/button/loading-button';
|
|
6
|
+
import { FormFooter } from '@atlaskit/form';
|
|
7
|
+
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
|
+
import { messages } from './messages';
|
|
9
|
+
const errorStyles = css({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
marginRight: 'auto'
|
|
13
|
+
});
|
|
14
|
+
export function CreateFormFooter({
|
|
15
|
+
formErrorMessage,
|
|
16
|
+
handleCancel,
|
|
17
|
+
submitting,
|
|
18
|
+
testId
|
|
19
|
+
}) {
|
|
20
|
+
const intl = useIntl();
|
|
21
|
+
return jsx(FormFooter, null, formErrorMessage && jsx("div", {
|
|
22
|
+
css: errorStyles,
|
|
23
|
+
"data-testid": `${testId}-error`
|
|
24
|
+
}, jsx(ErrorIcon, {
|
|
25
|
+
label: formErrorMessage,
|
|
26
|
+
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
27
|
+
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
28
|
+
type: "button",
|
|
29
|
+
appearance: "subtle",
|
|
30
|
+
onClick: handleCancel,
|
|
31
|
+
testId: `${testId}-button-cancel`
|
|
32
|
+
}, intl.formatMessage(messages.close)), jsx(LoadingButton, {
|
|
33
|
+
type: "submit",
|
|
34
|
+
appearance: "primary",
|
|
35
|
+
isLoading: submitting,
|
|
36
|
+
testId: `${testId}-button-submit`
|
|
37
|
+
}, intl.formatMessage(messages.create))));
|
|
38
|
+
}
|
|
@@ -2,29 +2,19 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
|
-
import { useIntl } from 'react-intl-next';
|
|
6
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
-
import
|
|
8
|
-
import LoadingButton from '@atlaskit/button/loading-button';
|
|
9
|
-
import Button from '@atlaskit/button/standard-button';
|
|
10
|
-
import Form, { FormFooter } from '@atlaskit/form';
|
|
11
|
-
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
6
|
+
import Form from '@atlaskit/form';
|
|
12
7
|
import { ANALYTICS_CHANNEL, CREATE_FORM_MAX_WIDTH_IN_PX } from '../../common/constants';
|
|
13
8
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
14
9
|
import { useFormContext } from '../../controllers/form-context';
|
|
10
|
+
import { CreateFormFooter } from './form-footer';
|
|
15
11
|
import { CreateFormLoader } from './form-loader';
|
|
16
|
-
import { messages } from './messages';
|
|
17
12
|
import { validateFormData } from './utils';
|
|
18
13
|
const formStyles = css({
|
|
19
14
|
maxWidth: `${CREATE_FORM_MAX_WIDTH_IN_PX}px`,
|
|
20
15
|
padding: `0 0 ${"var(--ds-space-300, 24px)"} 0`,
|
|
21
16
|
margin: `${"var(--ds-space-0, 0px)"} auto`
|
|
22
17
|
});
|
|
23
|
-
const errorStyles = css({
|
|
24
|
-
display: 'flex',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
marginRight: 'auto'
|
|
27
|
-
});
|
|
28
18
|
export const TEST_ID = 'link-create-form';
|
|
29
19
|
export const CreateForm = ({
|
|
30
20
|
children,
|
|
@@ -34,7 +24,6 @@ export const CreateForm = ({
|
|
|
34
24
|
isLoading,
|
|
35
25
|
hideFooter
|
|
36
26
|
}) => {
|
|
37
|
-
const intl = useIntl();
|
|
38
27
|
const {
|
|
39
28
|
createAnalyticsEvent
|
|
40
29
|
} = useAnalyticsEvents();
|
|
@@ -70,21 +59,10 @@ export const CreateForm = ({
|
|
|
70
59
|
name: "link-create-form",
|
|
71
60
|
"data-testid": testId,
|
|
72
61
|
css: formStyles
|
|
73
|
-
}), jsx("div", null, children), !hideFooter && jsx(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
80
|
-
type: "button",
|
|
81
|
-
appearance: "subtle",
|
|
82
|
-
onClick: handleCancel,
|
|
83
|
-
testId: `${testId}-button-cancel`
|
|
84
|
-
}, intl.formatMessage(messages.close)), jsx(LoadingButton, {
|
|
85
|
-
type: "submit",
|
|
86
|
-
appearance: "primary",
|
|
87
|
-
isLoading: submitting,
|
|
88
|
-
testId: `${testId}-button-submit`
|
|
89
|
-
}, intl.formatMessage(messages.create))))));
|
|
62
|
+
}), jsx("div", null, children), !hideFooter && jsx(CreateFormFooter, {
|
|
63
|
+
formErrorMessage: formErrorMessage,
|
|
64
|
+
handleCancel: handleCancel,
|
|
65
|
+
submitting: submitting,
|
|
66
|
+
testId: testId
|
|
67
|
+
})));
|
|
90
68
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CreateFormFooter } from './main';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
5
|
+
import LoadingButton from '@atlaskit/button/loading-button';
|
|
6
|
+
import { FormFooter } from '@atlaskit/form';
|
|
7
|
+
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
|
+
import { messages } from './messages';
|
|
9
|
+
var errorStyles = css({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
marginRight: 'auto'
|
|
13
|
+
});
|
|
14
|
+
export function CreateFormFooter(_ref) {
|
|
15
|
+
var formErrorMessage = _ref.formErrorMessage,
|
|
16
|
+
handleCancel = _ref.handleCancel,
|
|
17
|
+
submitting = _ref.submitting,
|
|
18
|
+
testId = _ref.testId;
|
|
19
|
+
var intl = useIntl();
|
|
20
|
+
return jsx(FormFooter, null, formErrorMessage && jsx("div", {
|
|
21
|
+
css: errorStyles,
|
|
22
|
+
"data-testid": "".concat(testId, "-error")
|
|
23
|
+
}, jsx(ErrorIcon, {
|
|
24
|
+
label: formErrorMessage,
|
|
25
|
+
primaryColor: "var(--ds-icon-danger, #E34935)"
|
|
26
|
+
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
27
|
+
type: "button",
|
|
28
|
+
appearance: "subtle",
|
|
29
|
+
onClick: handleCancel,
|
|
30
|
+
testId: "".concat(testId, "-button-cancel")
|
|
31
|
+
}, intl.formatMessage(messages.close)), jsx(LoadingButton, {
|
|
32
|
+
type: "submit",
|
|
33
|
+
appearance: "primary",
|
|
34
|
+
isLoading: submitting,
|
|
35
|
+
testId: "".concat(testId, "-button-submit")
|
|
36
|
+
}, intl.formatMessage(messages.create))));
|
|
37
|
+
}
|
|
@@ -4,29 +4,19 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import { useIntl } from 'react-intl-next';
|
|
8
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
9
|
-
import
|
|
10
|
-
import LoadingButton from '@atlaskit/button/loading-button';
|
|
11
|
-
import Button from '@atlaskit/button/standard-button';
|
|
12
|
-
import Form, { FormFooter } from '@atlaskit/form';
|
|
13
|
-
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
|
+
import Form from '@atlaskit/form';
|
|
14
9
|
import { ANALYTICS_CHANNEL, CREATE_FORM_MAX_WIDTH_IN_PX } from '../../common/constants';
|
|
15
10
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
16
11
|
import { useFormContext } from '../../controllers/form-context';
|
|
12
|
+
import { CreateFormFooter } from './form-footer';
|
|
17
13
|
import { CreateFormLoader } from './form-loader';
|
|
18
|
-
import { messages } from './messages';
|
|
19
14
|
import { validateFormData } from './utils';
|
|
20
15
|
var formStyles = css({
|
|
21
16
|
maxWidth: "".concat(CREATE_FORM_MAX_WIDTH_IN_PX, "px"),
|
|
22
17
|
padding: "0 0 ".concat("var(--ds-space-300, 24px)", " 0"),
|
|
23
18
|
margin: "var(--ds-space-0, 0px)".concat(" auto")
|
|
24
19
|
});
|
|
25
|
-
var errorStyles = css({
|
|
26
|
-
display: 'flex',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
marginRight: 'auto'
|
|
29
|
-
});
|
|
30
20
|
export var TEST_ID = 'link-create-form';
|
|
31
21
|
export var CreateForm = function CreateForm(_ref) {
|
|
32
22
|
var children = _ref.children,
|
|
@@ -36,7 +26,6 @@ export var CreateForm = function CreateForm(_ref) {
|
|
|
36
26
|
onCancel = _ref.onCancel,
|
|
37
27
|
isLoading = _ref.isLoading,
|
|
38
28
|
hideFooter = _ref.hideFooter;
|
|
39
|
-
var intl = useIntl();
|
|
40
29
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
41
30
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
42
31
|
var _useFormContext = useFormContext(),
|
|
@@ -87,22 +76,11 @@ export var CreateForm = function CreateForm(_ref) {
|
|
|
87
76
|
name: "link-create-form",
|
|
88
77
|
"data-testid": testId,
|
|
89
78
|
css: formStyles
|
|
90
|
-
}), jsx("div", null, children), !hideFooter && jsx(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}), formErrorMessage), jsx(ButtonGroup, null, jsx(Button, {
|
|
97
|
-
type: "button",
|
|
98
|
-
appearance: "subtle",
|
|
99
|
-
onClick: handleCancel,
|
|
100
|
-
testId: "".concat(testId, "-button-cancel")
|
|
101
|
-
}, intl.formatMessage(messages.close)), jsx(LoadingButton, {
|
|
102
|
-
type: "submit",
|
|
103
|
-
appearance: "primary",
|
|
104
|
-
isLoading: submitting,
|
|
105
|
-
testId: "".concat(testId, "-button-submit")
|
|
106
|
-
}, intl.formatMessage(messages.create)))));
|
|
79
|
+
}), jsx("div", null, children), !hideFooter && jsx(CreateFormFooter, {
|
|
80
|
+
formErrorMessage: formErrorMessage,
|
|
81
|
+
handleCancel: handleCancel,
|
|
82
|
+
submitting: submitting,
|
|
83
|
+
testId: testId
|
|
84
|
+
}));
|
|
107
85
|
});
|
|
108
86
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CreateFormFooter } from './main';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
export interface CreateFormFooterProps {
|
|
4
|
+
formErrorMessage: string | undefined;
|
|
5
|
+
handleCancel: () => void;
|
|
6
|
+
submitting: boolean;
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CreateFormFooter({ formErrorMessage, handleCancel, submitting, testId, }: CreateFormFooterProps): jsx.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CreateFormFooter } from './main';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
export interface CreateFormFooterProps {
|
|
4
|
+
formErrorMessage: string | undefined;
|
|
5
|
+
handleCancel: () => void;
|
|
6
|
+
submitting: boolean;
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CreateFormFooter({ formErrorMessage, handleCancel, submitting, testId, }: CreateFormFooterProps): jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/select": "^16.5.0",
|
|
45
45
|
"@atlaskit/spinner": "^15.4.0",
|
|
46
46
|
"@atlaskit/textfield": "^5.6.0",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/tokens": "^1.13.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1"
|
|
50
50
|
},
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
+
"@af/visual-regression": "*",
|
|
56
57
|
"@atlaskit/link-test-helpers": "^4.1.0",
|
|
57
58
|
"@atlaskit/visual-regression": "*",
|
|
58
59
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
@@ -102,5 +103,10 @@
|
|
|
102
103
|
]
|
|
103
104
|
}
|
|
104
105
|
},
|
|
106
|
+
"techstackIgnore": {
|
|
107
|
+
"stricter": [
|
|
108
|
+
"@atlassian/tangerine/project-structure"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
105
111
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
106
112
|
}
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/link-create"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
|
|
10
|
-
import { jsx } from '@emotion/react';
|
|
11
|
-
import { MemoExoticComponent } from 'react';
|
|
12
|
-
import { ModalDialogProps } from '@atlaskit/modal-dialog';
|
|
13
|
-
import { OptionType } from '@atlaskit/select';
|
|
14
|
-
import { default as React_2 } from 'react';
|
|
15
|
-
import { ReactNode } from 'react';
|
|
16
|
-
import { SpinnerProps } from '@atlaskit/spinner';
|
|
17
|
-
import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
18
|
-
|
|
19
|
-
// @public
|
|
20
|
-
export function AsyncSelect<T = OptionType>({ label, name, validationHelpText, isRequired, testId, validators, defaultValue, ...rest }: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
21
|
-
|
|
22
|
-
// @public (undocumented)
|
|
23
|
-
type AsyncSelectProps<T = OptionType> = AsyncSelectProps_2<T> & {
|
|
24
|
-
name: string;
|
|
25
|
-
label: string;
|
|
26
|
-
validationHelpText?: string;
|
|
27
|
-
testId?: string;
|
|
28
|
-
isRequired?: boolean;
|
|
29
|
-
validators?: Validator[];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// @public (undocumented)
|
|
33
|
-
const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateWithModalProps) => jsx.JSX.Element>;
|
|
34
|
-
export default ComposedLinkCreate;
|
|
35
|
-
|
|
36
|
-
// @public (undocumented)
|
|
37
|
-
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
38
|
-
|
|
39
|
-
// @public (undocumented)
|
|
40
|
-
export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Element;
|
|
41
|
-
|
|
42
|
-
// @public (undocumented)
|
|
43
|
-
export interface CreateFormProps<FormData> {
|
|
44
|
-
// (undocumented)
|
|
45
|
-
children: ReactNode;
|
|
46
|
-
// (undocumented)
|
|
47
|
-
hideFooter?: boolean;
|
|
48
|
-
// (undocumented)
|
|
49
|
-
isLoading?: boolean;
|
|
50
|
-
// (undocumented)
|
|
51
|
-
onCancel?: () => void;
|
|
52
|
-
// (undocumented)
|
|
53
|
-
onSubmit: (data: FormData) => void;
|
|
54
|
-
// (undocumented)
|
|
55
|
-
testId?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// @public
|
|
59
|
-
export type CreatePayload = {
|
|
60
|
-
url: string;
|
|
61
|
-
objectId: string;
|
|
62
|
-
objectType: string;
|
|
63
|
-
data?: Record<string, unknown>;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// @public (undocumented)
|
|
67
|
-
interface Group {
|
|
68
|
-
icon: string;
|
|
69
|
-
key: string;
|
|
70
|
-
label: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// @public (undocumented)
|
|
74
|
-
export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderProps>;
|
|
75
|
-
|
|
76
|
-
// @public (undocumented)
|
|
77
|
-
interface LinkCreateCallbackProviderProps {
|
|
78
|
-
onCancel?: () => void;
|
|
79
|
-
onCreate?: (result: CreatePayload) => Promise<void> | void;
|
|
80
|
-
onFailure?: (errorMessage: string) => void;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// @public (undocumented)
|
|
84
|
-
export interface LinkCreatePlugin {
|
|
85
|
-
form: ReactNode;
|
|
86
|
-
group: Group;
|
|
87
|
-
icon: string;
|
|
88
|
-
key: string;
|
|
89
|
-
label: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// @public (undocumented)
|
|
93
|
-
export interface LinkCreateProps {
|
|
94
|
-
entityKey: string;
|
|
95
|
-
groupKey?: string;
|
|
96
|
-
onCancel?: () => void;
|
|
97
|
-
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
98
|
-
onFailure?: (error: unknown) => void;
|
|
99
|
-
// (undocumented)
|
|
100
|
-
plugins: LinkCreatePlugin[];
|
|
101
|
-
testId?: string;
|
|
102
|
-
triggeredFrom?: string;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// @public (undocumented)
|
|
106
|
-
export interface LinkCreateWithModalProps extends LinkCreateProps, Partial<Pick<ModalDialogProps, 'onCloseComplete' | 'onOpenComplete'>> {
|
|
107
|
-
active?: boolean;
|
|
108
|
-
modalTitle?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// @public
|
|
112
|
-
export function TextField({ label, name, testId, validationHelpText, validators, defaultValue, isRequired, ...restProps }: TextFieldProps): jsx.JSX.Element;
|
|
113
|
-
|
|
114
|
-
// @public (undocumented)
|
|
115
|
-
type TextFieldProps = Omit<TextFieldProps_2, 'name'> & {
|
|
116
|
-
name: string;
|
|
117
|
-
label?: string;
|
|
118
|
-
validationHelpText?: string;
|
|
119
|
-
validators?: Validator[];
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// @public (undocumented)
|
|
123
|
-
export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
|
|
124
|
-
|
|
125
|
-
// @public (undocumented)
|
|
126
|
-
export type Validator = {
|
|
127
|
-
isValid: (val: unknown) => boolean;
|
|
128
|
-
errorMessage: string;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// @public
|
|
132
|
-
export type ValidatorMap = Record<string, Validator[]>;
|
|
133
|
-
|
|
134
|
-
// (No @packageDocumentation comment for this package)
|
|
135
|
-
|
|
136
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|