@atlaskit/link-create 0.3.1 → 0.3.3
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/common/constants.js +4 -2
- package/dist/cjs/controllers/form-context/main.js +17 -5
- package/dist/cjs/ui/create-form/main.js +29 -17
- package/dist/cjs/ui/create-form/messages.js +20 -0
- package/dist/cjs/ui/create-form/textfield/main.js +4 -3
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/index.js +46 -44
- package/dist/cjs/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/cjs/ui/main.js +23 -5
- package/dist/cjs/ui/messages.js +15 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/constants.js +2 -1
- package/dist/es2019/controllers/form-context/main.js +11 -2
- package/dist/es2019/ui/create-form/main.js +32 -16
- package/dist/es2019/ui/create-form/messages.js +13 -0
- package/dist/es2019/ui/create-form/textfield/main.js +4 -3
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/index.js +46 -44
- package/dist/es2019/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/es2019/ui/main.js +20 -5
- package/dist/es2019/ui/messages.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/constants.js +2 -1
- package/dist/esm/controllers/form-context/main.js +17 -5
- package/dist/esm/ui/create-form/main.js +32 -20
- package/dist/esm/ui/create-form/messages.js +13 -0
- package/dist/esm/ui/create-form/textfield/main.js +4 -3
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/index.js +46 -44
- package/dist/esm/ui/error-boundary/error-boundary-ui/messages.js +1 -1
- package/dist/esm/ui/main.js +23 -5
- package/dist/esm/ui/messages.js +8 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/controllers/callback-context/main.d.ts +1 -1
- package/dist/types/controllers/form-context/main.d.ts +2 -0
- package/dist/types/ui/create-form/main.d.ts +3 -3
- package/dist/types/ui/create-form/messages.d.ts +12 -0
- package/dist/types/ui/create-form/textfield/main.d.ts +1 -1
- package/dist/types/ui/create-form/textfield/types.d.ts +2 -0
- package/dist/types/ui/messages.d.ts +7 -0
- package/package.json +6 -4
- package/report.api.md +15 -4
- package/tmp/api-report-tmp.d.ts +10 -5
- package/dist/cjs/ui/create-form/styled.js +0 -13
- package/dist/cjs/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -13
- package/dist/es2019/ui/create-form/styled.js +0 -7
- package/dist/es2019/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -7
- package/dist/esm/ui/create-form/styled.js +0 -5
- package/dist/esm/ui/error-boundary/error-boundary-ui/error-svg/styled.js +0 -5
- package/dist/types/ui/create-form/styled.d.ts +0 -1
- package/dist/types/ui/error-boundary/error-boundary-ui/error-svg/styled.d.ts +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
export interface CreateFormProps {
|
|
4
|
+
export interface CreateFormProps<FormData> {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
testId?: string;
|
|
7
7
|
onCancel?: () => void;
|
|
8
|
-
onSubmit: (data:
|
|
8
|
+
onSubmit: (data: FormData) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const CreateForm: (
|
|
10
|
+
export declare const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onCancel, onSubmit, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
@@ -6,4 +6,4 @@ import { TextFieldProps } from './types';
|
|
|
6
6
|
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
7
7
|
* of this text field are shown above the field.
|
|
8
8
|
*/
|
|
9
|
-
export declare function TextField({ label, name, validationHelpText, isRequired, testId, validators, }: TextFieldProps): jsx.JSX.Element;
|
|
9
|
+
export declare function TextField({ label, name, validationHelpText, isRequired, testId, validators, placeholder, }: TextFieldProps): jsx.JSX.Element;
|
|
@@ -4,6 +4,8 @@ export interface TextFieldProps {
|
|
|
4
4
|
name: string;
|
|
5
5
|
/** This should be properly internationalization-ed */
|
|
6
6
|
label: string;
|
|
7
|
+
/** This should be properly internationalization-ed */
|
|
8
|
+
placeholder?: string;
|
|
7
9
|
/**
|
|
8
10
|
* Optional text below the textfield explaining any requirements for a valid value.
|
|
9
11
|
* eg. "Must be 4 or more letters"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
30
30
|
"@atlaskit/button": "^16.6.0",
|
|
31
31
|
"@atlaskit/empty-state": "^7.4.0",
|
|
32
|
-
"@atlaskit/form": "^8.
|
|
32
|
+
"@atlaskit/form": "^8.10.0",
|
|
33
|
+
"@atlaskit/icon": "^21.11.0",
|
|
33
34
|
"@atlaskit/modal-dialog": "^12.4.4",
|
|
34
35
|
"@atlaskit/select": "^16.1.5",
|
|
35
36
|
"@atlaskit/textfield": "^5.3.5",
|
|
@@ -51,13 +52,14 @@
|
|
|
51
52
|
"@atlaskit/visual-regression": "*",
|
|
52
53
|
"@atlaskit/webdriver-runner": "*",
|
|
53
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
54
|
-
"@atlassian/link-create-confluence": "^
|
|
55
|
+
"@atlassian/link-create-confluence": "^4.0.0",
|
|
55
56
|
"@atlassian/link-create-presets": "^2.0.0",
|
|
56
57
|
"@atlassian/link-picker-plugins": "^18.1.0",
|
|
57
58
|
"@atlassian/recent-work-client": "^1.7.0",
|
|
58
|
-
"@atlassian/search-client": "^0.
|
|
59
|
+
"@atlassian/search-client": "^0.7.0",
|
|
59
60
|
"@testing-library/react": "^12.1.5",
|
|
60
61
|
"@testing-library/user-event": "^14.4.3",
|
|
62
|
+
"fetch-mock": "^8.0.0",
|
|
61
63
|
"react-dom": "^16.8.0",
|
|
62
64
|
"typescript": "4.5.5",
|
|
63
65
|
"wait-for-expect": "^1.2.0"
|
package/report.api.md
CHANGED
|
@@ -52,16 +52,21 @@ const ComposedLinkCreate: MemoExoticComponent<
|
|
|
52
52
|
export default ComposedLinkCreate;
|
|
53
53
|
|
|
54
54
|
// @public (undocumented)
|
|
55
|
-
export const CreateForm:
|
|
55
|
+
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({
|
|
56
|
+
children,
|
|
57
|
+
testId,
|
|
58
|
+
onCancel,
|
|
59
|
+
onSubmit,
|
|
60
|
+
}: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
56
61
|
|
|
57
62
|
// @public (undocumented)
|
|
58
|
-
export interface CreateFormProps {
|
|
63
|
+
export interface CreateFormProps<FormData> {
|
|
59
64
|
// (undocumented)
|
|
60
65
|
children: ReactNode;
|
|
61
66
|
// (undocumented)
|
|
62
67
|
onCancel?: () => void;
|
|
63
68
|
// (undocumented)
|
|
64
|
-
onSubmit: (data:
|
|
69
|
+
onSubmit: (data: FormData) => void;
|
|
65
70
|
// (undocumented)
|
|
66
71
|
testId?: string;
|
|
67
72
|
}
|
|
@@ -74,7 +79,11 @@ interface FormContextType {
|
|
|
74
79
|
// (undocumented)
|
|
75
80
|
assignValidator: (name: string, validators: Validator[]) => void;
|
|
76
81
|
// (undocumented)
|
|
82
|
+
formErrorMessage?: string;
|
|
83
|
+
// (undocumented)
|
|
77
84
|
getValidators: () => ValidatorMap;
|
|
85
|
+
// (undocumented)
|
|
86
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
// @public (undocumented)
|
|
@@ -95,7 +104,7 @@ interface LinkCreateCallbackProviderProps {
|
|
|
95
104
|
objectId: string;
|
|
96
105
|
objectType: string;
|
|
97
106
|
}) => void;
|
|
98
|
-
onFailure?: (
|
|
107
|
+
onFailure?: (errorMessage: string) => void;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
// @public (undocumented)
|
|
@@ -136,6 +145,7 @@ export function TextField({
|
|
|
136
145
|
isRequired,
|
|
137
146
|
testId,
|
|
138
147
|
validators,
|
|
148
|
+
placeholder,
|
|
139
149
|
}: TextFieldProps): jsx.JSX.Element;
|
|
140
150
|
|
|
141
151
|
// @public (undocumented)
|
|
@@ -143,6 +153,7 @@ interface TextFieldProps {
|
|
|
143
153
|
isRequired?: boolean;
|
|
144
154
|
label: string;
|
|
145
155
|
name: string;
|
|
156
|
+
placeholder?: string;
|
|
146
157
|
// (undocumented)
|
|
147
158
|
testId?: string;
|
|
148
159
|
validationHelpText?: string;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -31,16 +31,16 @@ const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateProps) => jsx.JS
|
|
|
31
31
|
export default ComposedLinkCreate;
|
|
32
32
|
|
|
33
33
|
// @public (undocumented)
|
|
34
|
-
export const CreateForm: (
|
|
34
|
+
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onCancel, onSubmit, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
35
35
|
|
|
36
36
|
// @public (undocumented)
|
|
37
|
-
export interface CreateFormProps {
|
|
37
|
+
export interface CreateFormProps<FormData> {
|
|
38
38
|
// (undocumented)
|
|
39
39
|
children: ReactNode;
|
|
40
40
|
// (undocumented)
|
|
41
41
|
onCancel?: () => void;
|
|
42
42
|
// (undocumented)
|
|
43
|
-
onSubmit: (data:
|
|
43
|
+
onSubmit: (data: FormData) => void;
|
|
44
44
|
// (undocumented)
|
|
45
45
|
testId?: string;
|
|
46
46
|
}
|
|
@@ -53,7 +53,11 @@ interface FormContextType {
|
|
|
53
53
|
// (undocumented)
|
|
54
54
|
assignValidator: (name: string, validators: Validator[]) => void;
|
|
55
55
|
// (undocumented)
|
|
56
|
+
formErrorMessage?: string;
|
|
57
|
+
// (undocumented)
|
|
56
58
|
getValidators: () => ValidatorMap;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
setFormErrorMessage: (errorMessage?: string) => void;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
// @public (undocumented)
|
|
@@ -74,7 +78,7 @@ interface LinkCreateCallbackProviderProps {
|
|
|
74
78
|
objectId: string;
|
|
75
79
|
objectType: string;
|
|
76
80
|
}) => void;
|
|
77
|
-
onFailure?: (
|
|
81
|
+
onFailure?: (errorMessage: string) => void;
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
// @public (undocumented)
|
|
@@ -108,13 +112,14 @@ interface Option_2 {
|
|
|
108
112
|
export { Option_2 as Option }
|
|
109
113
|
|
|
110
114
|
// @public
|
|
111
|
-
export function TextField({ label, name, validationHelpText, isRequired, testId, validators, }: TextFieldProps): jsx.JSX.Element;
|
|
115
|
+
export function TextField({ label, name, validationHelpText, isRequired, testId, validators, placeholder, }: TextFieldProps): jsx.JSX.Element;
|
|
112
116
|
|
|
113
117
|
// @public (undocumented)
|
|
114
118
|
interface TextFieldProps {
|
|
115
119
|
isRequired?: boolean;
|
|
116
120
|
label: string;
|
|
117
121
|
name: string;
|
|
122
|
+
placeholder?: string;
|
|
118
123
|
// (undocumented)
|
|
119
124
|
testId?: string;
|
|
120
125
|
validationHelpText?: string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.formStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
12
|
-
var formStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
13
|
-
exports.formStyles = formStyles;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.errorStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var WIDTH = 82;
|
|
12
|
-
var errorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
13
|
-
exports.errorStyles = errorStyles;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
var CREATE_FORM_MAX_WIDTH_IN_PX = '600';
|
|
5
|
-
export var formStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 auto;\n max-width: ", "px;\n padding: 0 0 ", " 0;\n"])), CREATE_FORM_MAX_WIDTH_IN_PX, "var(--ds-space-300, 24px)");
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
var WIDTH = 82;
|
|
5
|
-
export var errorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n margin: 0 auto ", ";\n display: block;\n"])), WIDTH, "var(--ds-space-300, 24px)");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const errorStyles: import("@emotion/react").SerializedStyles;
|