@atlaskit/form 11.0.0 → 11.0.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/field.js +14 -15
- package/dist/cjs/fieldset.js +14 -11
- package/dist/cjs/form-footer.js +18 -15
- package/dist/cjs/form-header.js +21 -16
- package/dist/cjs/form-section.js +21 -17
- package/dist/cjs/label.js +21 -15
- package/dist/cjs/messages.js +48 -34
- package/dist/cjs/range-field.js +13 -15
- package/dist/cjs/required-asterisk.js +21 -15
- package/dist/es2019/field.js +15 -10
- package/dist/es2019/fieldset.js +13 -8
- package/dist/es2019/form-footer.js +17 -12
- package/dist/es2019/form-header.js +20 -16
- package/dist/es2019/form-section.js +20 -17
- package/dist/es2019/label.js +20 -12
- package/dist/es2019/messages.js +47 -28
- package/dist/es2019/range-field.js +24 -21
- package/dist/es2019/required-asterisk.js +20 -12
- package/dist/esm/field.js +15 -10
- package/dist/esm/fieldset.js +13 -8
- package/dist/esm/form-footer.js +17 -12
- package/dist/esm/form-header.js +20 -16
- package/dist/esm/form-section.js +20 -17
- package/dist/esm/label.js +20 -12
- package/dist/esm/messages.js +47 -30
- package/dist/esm/range-field.js +13 -15
- package/dist/esm/required-asterisk.js +20 -12
- package/dist/types/field.d.ts +2 -1
- package/dist/types/fieldset.d.ts +2 -1
- package/dist/types/form-footer.d.ts +2 -1
- package/dist/types/form-header.d.ts +6 -1
- package/dist/types/form-section.d.ts +6 -1
- package/dist/types/messages.d.ts +5 -4
- package/dist/types/required-asterisk.d.ts +2 -2
- package/dist/types-ts4.5/field.d.ts +2 -1
- package/dist/types-ts4.5/fieldset.d.ts +2 -1
- package/dist/types-ts4.5/form-footer.d.ts +2 -1
- package/dist/types-ts4.5/form-header.d.ts +6 -1
- package/dist/types-ts4.5/form-section.d.ts +6 -1
- package/dist/types-ts4.5/messages.d.ts +5 -4
- package/dist/types-ts4.5/required-asterisk.d.ts +2 -2
- package/package.json +5 -6
- package/dist/cjs/field.compiled.css +0 -1
- package/dist/cjs/fieldset.compiled.css +0 -1
- package/dist/cjs/form-footer.compiled.css +0 -4
- package/dist/cjs/form-header.compiled.css +0 -2
- package/dist/cjs/form-section.compiled.css +0 -2
- package/dist/cjs/label.compiled.css +0 -6
- package/dist/cjs/messages.compiled.css +0 -10
- package/dist/cjs/required-asterisk.compiled.css +0 -3
- package/dist/es2019/field.compiled.css +0 -1
- package/dist/es2019/fieldset.compiled.css +0 -1
- package/dist/es2019/form-footer.compiled.css +0 -4
- package/dist/es2019/form-header.compiled.css +0 -2
- package/dist/es2019/form-section.compiled.css +0 -2
- package/dist/es2019/label.compiled.css +0 -6
- package/dist/es2019/messages.compiled.css +0 -10
- package/dist/es2019/required-asterisk.compiled.css +0 -3
- package/dist/esm/field.compiled.css +0 -1
- package/dist/esm/fieldset.compiled.css +0 -1
- package/dist/esm/form-footer.compiled.css +0 -4
- package/dist/esm/form-header.compiled.css +0 -2
- package/dist/esm/form-section.compiled.css +0 -2
- package/dist/esm/label.compiled.css +0 -6
- package/dist/esm/messages.compiled.css +0 -10
- package/dist/esm/required-asterisk.compiled.css +0 -3
package/dist/esm/form-section.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
5
8
|
import Heading from '@atlaskit/heading';
|
|
6
|
-
import { Box } from '@atlaskit/primitives
|
|
7
|
-
var formSectionDescriptionStyles = {
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
var formSectionWrapperStyles = {
|
|
11
|
-
|
|
12
|
-
};
|
|
9
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
10
|
+
var formSectionDescriptionStyles = xcss({
|
|
11
|
+
marginBlockStart: 'space.100'
|
|
12
|
+
});
|
|
13
|
+
var formSectionWrapperStyles = xcss({
|
|
14
|
+
marginBlockStart: 'space.300'
|
|
15
|
+
});
|
|
13
16
|
var FormSectionWrapper = function FormSectionWrapper(_ref) {
|
|
14
17
|
var children = _ref.children;
|
|
15
|
-
return
|
|
16
|
-
xcss: formSectionWrapperStyles
|
|
18
|
+
return jsx(Box, {
|
|
19
|
+
xcss: formSectionWrapperStyles
|
|
17
20
|
}, children);
|
|
18
21
|
};
|
|
19
22
|
var FormSectionDescription = function FormSectionDescription(_ref2) {
|
|
20
23
|
var children = _ref2.children;
|
|
21
|
-
return
|
|
22
|
-
xcss: formSectionDescriptionStyles
|
|
24
|
+
return jsx(Box, {
|
|
25
|
+
xcss: formSectionDescriptionStyles
|
|
23
26
|
}, children);
|
|
24
27
|
};
|
|
25
28
|
|
|
@@ -37,8 +40,8 @@ var FormSection = function FormSection(_ref3) {
|
|
|
37
40
|
var children = _ref3.children,
|
|
38
41
|
description = _ref3.description,
|
|
39
42
|
title = _ref3.title;
|
|
40
|
-
return
|
|
43
|
+
return jsx(FormSectionWrapper, null, title && jsx(Heading, {
|
|
41
44
|
size: "medium"
|
|
42
|
-
}, title), description &&
|
|
45
|
+
}, title), description && jsx(FormSectionDescription, null, description), children);
|
|
43
46
|
};
|
|
44
47
|
export default FormSection;
|
package/dist/esm/label.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
8
|
+
var fieldsetLabelStyles = css({
|
|
9
|
+
display: 'inline-block',
|
|
10
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
11
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
12
|
+
fontWeight: "var(--ds-font-weight-bold, 700)",
|
|
13
|
+
marginBlockEnd: "var(--ds-space-050, 4px)",
|
|
14
|
+
marginBlockStart: "var(--ds-space-0, 0px)"
|
|
15
|
+
});
|
|
8
16
|
|
|
9
17
|
/**
|
|
10
18
|
* __Label__
|
|
@@ -19,11 +27,11 @@ export var Label = function Label(_ref) {
|
|
|
19
27
|
htmlFor = _ref.htmlFor,
|
|
20
28
|
id = _ref.id,
|
|
21
29
|
testId = _ref.testId;
|
|
22
|
-
return
|
|
30
|
+
return jsx("label", {
|
|
31
|
+
css: fieldsetLabelStyles,
|
|
23
32
|
id: id,
|
|
24
33
|
htmlFor: htmlFor,
|
|
25
|
-
"data-testid": testId
|
|
26
|
-
className: ax([fieldsetLabelStyles.root])
|
|
34
|
+
"data-testid": testId
|
|
27
35
|
}, children);
|
|
28
36
|
};
|
|
29
37
|
|
|
@@ -34,8 +42,8 @@ export var Label = function Label(_ref) {
|
|
|
34
42
|
*/
|
|
35
43
|
export var Legend = function Legend(_ref2) {
|
|
36
44
|
var children = _ref2.children;
|
|
37
|
-
return
|
|
38
|
-
|
|
45
|
+
return jsx("legend", {
|
|
46
|
+
css: fieldsetLabelStyles
|
|
39
47
|
}, children);
|
|
40
48
|
};
|
|
41
49
|
export default Label;
|
package/dist/esm/messages.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
/* messages.tsx generated by @compiled/babel-plugin v0.33.0 */
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
|
|
6
7
|
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
7
11
|
import ErrorIcon from '@atlaskit/icon/utility/migration/error';
|
|
8
12
|
import SuccessIcon from '@atlaskit/icon/utility/migration/success--editor-success';
|
|
13
|
+
import { N200 } from '@atlaskit/theme/colors';
|
|
9
14
|
import { FieldId } from './field-id-context';
|
|
10
15
|
|
|
11
16
|
/**
|
|
@@ -16,31 +21,43 @@ import { FieldId } from './field-id-context';
|
|
|
16
21
|
* Public API of the various message components.
|
|
17
22
|
*/
|
|
18
23
|
|
|
19
|
-
var messageStyles = {
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
var messageStyles = css({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'baseline',
|
|
27
|
+
gap: "var(--ds-space-075, 6px)",
|
|
28
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
29
|
+
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
30
|
+
});
|
|
22
31
|
var messageAppearanceStyles = {
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
32
|
+
default: css({
|
|
33
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
34
|
+
}),
|
|
35
|
+
error: css({
|
|
36
|
+
color: "var(--ds-text-danger, #AE2A19)"
|
|
37
|
+
}),
|
|
38
|
+
valid: css({
|
|
39
|
+
color: "var(--ds-text-success, #216E4E)"
|
|
40
|
+
})
|
|
29
41
|
};
|
|
42
|
+
var iconWrapperStyles = css({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
height: '16px',
|
|
45
|
+
alignItems: 'center'
|
|
46
|
+
});
|
|
30
47
|
var IconWrapper = function IconWrapper(_ref) {
|
|
31
48
|
var children = _ref.children;
|
|
32
|
-
return
|
|
33
|
-
|
|
49
|
+
return jsx("span", {
|
|
50
|
+
css: iconWrapperStyles
|
|
34
51
|
}, children);
|
|
35
52
|
};
|
|
36
53
|
var messageIcons = {
|
|
37
|
-
error:
|
|
54
|
+
error: jsx(ErrorIcon, {
|
|
38
55
|
LEGACY_margin: "0 -2px 0 0",
|
|
39
56
|
color: "currentColor",
|
|
40
57
|
LEGACY_size: "small",
|
|
41
58
|
label: "error"
|
|
42
59
|
}),
|
|
43
|
-
valid:
|
|
60
|
+
valid: jsx(SuccessIcon, {
|
|
44
61
|
LEGACY_margin: "0 -2px 0 0",
|
|
45
62
|
color: "currentColor",
|
|
46
63
|
LEGACY_size: "small",
|
|
@@ -75,16 +92,16 @@ var Message = function Message(_ref2) {
|
|
|
75
92
|
* If the child is just a string, this is not required and we can use one
|
|
76
93
|
* less DOM element.
|
|
77
94
|
*/
|
|
78
|
-
var content = typeof children === 'string' ? children :
|
|
79
|
-
return
|
|
95
|
+
var content = typeof children === 'string' ? children : jsx("span", null, children);
|
|
96
|
+
return jsx("div", {
|
|
97
|
+
css: [messageStyles, messageAppearanceStyles[appearance]],
|
|
80
98
|
"data-testid": testId,
|
|
81
99
|
id: fieldId,
|
|
82
100
|
ref: messageRef
|
|
83
101
|
// For backwards compatability, if there is a wrapper, aria-live is not needed
|
|
84
102
|
,
|
|
85
|
-
"aria-live": !hasMessageWrapper ? 'polite' : undefined
|
|
86
|
-
|
|
87
|
-
}, icon && /*#__PURE__*/React.createElement(IconWrapper, null, icon), content);
|
|
103
|
+
"aria-live": !hasMessageWrapper ? 'polite' : undefined
|
|
104
|
+
}, icon && jsx(IconWrapper, null, icon), content);
|
|
88
105
|
};
|
|
89
106
|
|
|
90
107
|
/**
|
|
@@ -97,8 +114,8 @@ var Message = function Message(_ref2) {
|
|
|
97
114
|
export var HelperMessage = function HelperMessage(_ref3) {
|
|
98
115
|
var children = _ref3.children,
|
|
99
116
|
testId = _ref3.testId;
|
|
100
|
-
return
|
|
101
|
-
return
|
|
117
|
+
return jsx(FieldId.Consumer, null, function (fieldId) {
|
|
118
|
+
return jsx(Message, {
|
|
102
119
|
fieldId: fieldId ? "".concat(fieldId, "-helper") : undefined,
|
|
103
120
|
testId: testId
|
|
104
121
|
}, children);
|
|
@@ -115,8 +132,8 @@ export var HelperMessage = function HelperMessage(_ref3) {
|
|
|
115
132
|
export var ErrorMessage = function ErrorMessage(_ref4) {
|
|
116
133
|
var children = _ref4.children,
|
|
117
134
|
testId = _ref4.testId;
|
|
118
|
-
return
|
|
119
|
-
return
|
|
135
|
+
return jsx(FieldId.Consumer, null, function (fieldId) {
|
|
136
|
+
return jsx(Message, {
|
|
120
137
|
appearance: "error",
|
|
121
138
|
fieldId: fieldId ? "".concat(fieldId, "-error") : undefined,
|
|
122
139
|
testId: testId
|
|
@@ -134,8 +151,8 @@ export var ErrorMessage = function ErrorMessage(_ref4) {
|
|
|
134
151
|
export var ValidMessage = function ValidMessage(_ref5) {
|
|
135
152
|
var children = _ref5.children,
|
|
136
153
|
testId = _ref5.testId;
|
|
137
|
-
return
|
|
138
|
-
return
|
|
154
|
+
return jsx(FieldId.Consumer, null, function (fieldId) {
|
|
155
|
+
return jsx(Message, {
|
|
139
156
|
appearance: "valid",
|
|
140
157
|
fieldId: fieldId ? "".concat(fieldId, "-valid") : undefined,
|
|
141
158
|
testId: testId
|
|
@@ -167,9 +184,9 @@ export var MessageWrapper = function MessageWrapper(_ref6) {
|
|
|
167
184
|
var contextValue = {
|
|
168
185
|
isWrapper: true
|
|
169
186
|
};
|
|
170
|
-
return
|
|
187
|
+
return jsx(MessageWrapperContext.Provider, {
|
|
171
188
|
value: contextValue
|
|
172
|
-
},
|
|
189
|
+
}, jsx("div", {
|
|
173
190
|
"aria-live": "polite",
|
|
174
191
|
"data-testid": "message-wrapper"
|
|
175
192
|
}, children));
|
package/dist/esm/range-field.js
CHANGED
|
@@ -17,26 +17,24 @@ import Field from './field';
|
|
|
17
17
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
18
18
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
|
|
19
19
|
*/
|
|
20
|
-
var RangeField = function RangeField(
|
|
21
|
-
var children =
|
|
22
|
-
strippedProps = _objectWithoutProperties(
|
|
20
|
+
var RangeField = function RangeField(props) {
|
|
21
|
+
var children = props.children,
|
|
22
|
+
strippedProps = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
// isInvalid and isRequired are specifically invalid for range inputs
|
|
23
24
|
return (
|
|
24
25
|
/*#__PURE__*/
|
|
25
26
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
26
27
|
React.createElement(Field, _extends({}, strippedProps, {
|
|
27
28
|
transform: Number
|
|
28
|
-
}), function (
|
|
29
|
-
var
|
|
30
|
-
isInvalid =
|
|
31
|
-
isRequired =
|
|
32
|
-
fieldProps = _objectWithoutProperties(
|
|
33
|
-
rest = _objectWithoutProperties(
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fieldProps: fieldProps
|
|
38
|
-
}, rest))
|
|
39
|
-
);
|
|
29
|
+
}), function (_ref) {
|
|
30
|
+
var _ref$fieldProps = _ref.fieldProps,
|
|
31
|
+
isInvalid = _ref$fieldProps.isInvalid,
|
|
32
|
+
isRequired = _ref$fieldProps.isRequired,
|
|
33
|
+
fieldProps = _objectWithoutProperties(_ref$fieldProps, _excluded2),
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded3);
|
|
35
|
+
return children(_objectSpread({
|
|
36
|
+
fieldProps: fieldProps
|
|
37
|
+
}, rest));
|
|
40
38
|
})
|
|
41
39
|
);
|
|
42
40
|
};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
import { R400 } from '@atlaskit/theme/colors';
|
|
8
|
+
var requiredIndicatorStyles = css({
|
|
9
|
+
color: "var(--ds-text-danger, ".concat(R400, ")"),
|
|
10
|
+
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
11
|
+
paddingInlineStart: "var(--ds-space-025, 2px)"
|
|
12
|
+
});
|
|
8
13
|
export default function RequiredAsterisk() {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
return (
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
16
|
+
jsx("span", {
|
|
17
|
+
css: requiredIndicatorStyles,
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
title: "required"
|
|
20
|
+
}, "*")
|
|
21
|
+
);
|
|
14
22
|
}
|
package/dist/types/field.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type FormEvent, type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
type SupportedElements = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
7
8
|
export interface FieldProps<FieldValue, Element extends SupportedElements = HTMLInputElement> {
|
|
8
9
|
id: string;
|
|
@@ -80,5 +81,5 @@ export interface FieldComponentProps<FieldValue, Element extends SupportedElemen
|
|
|
80
81
|
*/
|
|
81
82
|
testId?: string;
|
|
82
83
|
}
|
|
83
|
-
export default function Field<FieldValue = string, Element extends SupportedElements = HTMLInputElement>(props: FieldComponentProps<FieldValue, Element>): JSX.Element;
|
|
84
|
+
export default function Field<FieldValue = string, Element extends SupportedElements = HTMLInputElement>(props: FieldComponentProps<FieldValue, Element>): jsx.JSX.Element;
|
|
84
85
|
export {};
|
package/dist/types/fieldset.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
export interface FieldsetProps {
|
|
7
8
|
/**
|
|
8
9
|
* Content to render in the fieldset.
|
|
@@ -23,5 +24,5 @@ export interface FieldsetProps {
|
|
|
23
24
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
|
|
24
25
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
|
|
25
26
|
*/
|
|
26
|
-
declare const Fieldset: ({ children, legend }: FieldsetProps) => JSX.Element;
|
|
27
|
+
declare const Fieldset: ({ children, legend }: FieldsetProps) => jsx.JSX.Element;
|
|
27
28
|
export default Fieldset;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
import { type Align } from './types';
|
|
7
8
|
export interface FormFooterProps {
|
|
8
9
|
/**
|
|
@@ -23,4 +24,4 @@ export interface FormFooterProps {
|
|
|
23
24
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
25
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
25
26
|
*/
|
|
26
|
-
export default function FormFooter({ align, children }: FormFooterProps): JSX.Element;
|
|
27
|
+
export default function FormFooter({ align, children }: FormFooterProps): jsx.JSX.Element;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
2
7
|
export interface FormHeaderProps {
|
|
3
8
|
/**
|
|
4
9
|
* Title of the form. This is a header.
|
|
@@ -23,5 +28,5 @@ export interface FormHeaderProps {
|
|
|
23
28
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
29
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout).
|
|
25
30
|
*/
|
|
26
|
-
declare const FormHeader: ({ children, description, title }: FormHeaderProps) => JSX.Element;
|
|
31
|
+
declare const FormHeader: ({ children, description, title }: FormHeaderProps) => jsx.JSX.Element;
|
|
27
32
|
export default FormHeader;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
2
7
|
export interface FormSectionProps {
|
|
3
8
|
/**
|
|
4
9
|
* Title of the form section.
|
|
@@ -23,5 +28,5 @@ export interface FormSectionProps {
|
|
|
23
28
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
29
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout).
|
|
25
30
|
*/
|
|
26
|
-
declare const FormSection: ({ children, description, title }: FormSectionProps) => JSX.Element;
|
|
31
|
+
declare const FormSection: ({ children, description, title }: FormSectionProps) => jsx.JSX.Element;
|
|
27
32
|
export default FormSection;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
type MessageAppearance = 'default' | 'error' | 'valid';
|
|
7
8
|
/**
|
|
8
9
|
* API for the internal `<Message />` component. This is not public API.
|
|
@@ -35,7 +36,7 @@ type MessageProps = Pick<InternalMessageProps, 'children' | 'testId'>;
|
|
|
35
36
|
* 'Password should be more than 4 characters'
|
|
36
37
|
*
|
|
37
38
|
*/
|
|
38
|
-
export declare const HelperMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
39
|
+
export declare const HelperMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
39
40
|
/**
|
|
40
41
|
* __Error message__
|
|
41
42
|
*
|
|
@@ -43,7 +44,7 @@ export declare const HelperMessage: ({ children, testId }: MessageProps) => JSX.
|
|
|
43
44
|
* 'Invalid username, needs to be more than 4 characters'.
|
|
44
45
|
*
|
|
45
46
|
*/
|
|
46
|
-
export declare const ErrorMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
47
|
+
export declare const ErrorMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
47
48
|
/**
|
|
48
49
|
* __Valid message__
|
|
49
50
|
*
|
|
@@ -51,7 +52,7 @@ export declare const ErrorMessage: ({ children, testId }: MessageProps) => JSX.E
|
|
|
51
52
|
* a helper message could be 'Nice one, this username is available'.
|
|
52
53
|
*
|
|
53
54
|
*/
|
|
54
|
-
export declare const ValidMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
55
|
+
export declare const ValidMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
55
56
|
/**
|
|
56
57
|
* __Message wrapper context__
|
|
57
58
|
*
|
|
@@ -70,5 +71,5 @@ export declare const MessageWrapperContext: import("react").Context<{
|
|
|
70
71
|
* may not render the message.
|
|
71
72
|
*
|
|
72
73
|
*/
|
|
73
|
-
export declare const MessageWrapper: ({ children }: MessageProps) => JSX.Element;
|
|
74
|
+
export declare const MessageWrapper: ({ children }: MessageProps) => jsx.JSX.Element;
|
|
74
75
|
export {};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type FormEvent, type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
type SupportedElements = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
7
8
|
export interface FieldProps<FieldValue, Element extends SupportedElements = HTMLInputElement> {
|
|
8
9
|
id: string;
|
|
@@ -80,5 +81,5 @@ export interface FieldComponentProps<FieldValue, Element extends SupportedElemen
|
|
|
80
81
|
*/
|
|
81
82
|
testId?: string;
|
|
82
83
|
}
|
|
83
|
-
export default function Field<FieldValue = string, Element extends SupportedElements = HTMLInputElement>(props: FieldComponentProps<FieldValue, Element>): JSX.Element;
|
|
84
|
+
export default function Field<FieldValue = string, Element extends SupportedElements = HTMLInputElement>(props: FieldComponentProps<FieldValue, Element>): jsx.JSX.Element;
|
|
84
85
|
export {};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
export interface FieldsetProps {
|
|
7
8
|
/**
|
|
8
9
|
* Content to render in the fieldset.
|
|
@@ -23,5 +24,5 @@ export interface FieldsetProps {
|
|
|
23
24
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
|
|
24
25
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
|
|
25
26
|
*/
|
|
26
|
-
declare const Fieldset: ({ children, legend }: FieldsetProps) => JSX.Element;
|
|
27
|
+
declare const Fieldset: ({ children, legend }: FieldsetProps) => jsx.JSX.Element;
|
|
27
28
|
export default Fieldset;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
import { type Align } from './types';
|
|
7
8
|
export interface FormFooterProps {
|
|
8
9
|
/**
|
|
@@ -23,4 +24,4 @@ export interface FormFooterProps {
|
|
|
23
24
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
25
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
25
26
|
*/
|
|
26
|
-
export default function FormFooter({ align, children }: FormFooterProps): JSX.Element;
|
|
27
|
+
export default function FormFooter({ align, children }: FormFooterProps): jsx.JSX.Element;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
2
7
|
export interface FormHeaderProps {
|
|
3
8
|
/**
|
|
4
9
|
* Title of the form. This is a header.
|
|
@@ -23,5 +28,5 @@ export interface FormHeaderProps {
|
|
|
23
28
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
29
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout).
|
|
25
30
|
*/
|
|
26
|
-
declare const FormHeader: ({ children, description, title }: FormHeaderProps) => JSX.Element;
|
|
31
|
+
declare const FormHeader: ({ children, description, title }: FormHeaderProps) => jsx.JSX.Element;
|
|
27
32
|
export default FormHeader;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
2
7
|
export interface FormSectionProps {
|
|
3
8
|
/**
|
|
4
9
|
* Title of the form section.
|
|
@@ -23,5 +28,5 @@ export interface FormSectionProps {
|
|
|
23
28
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
|
|
24
29
|
* - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout).
|
|
25
30
|
*/
|
|
26
|
-
declare const FormSection: ({ children, description, title }: FormSectionProps) => JSX.Element;
|
|
31
|
+
declare const FormSection: ({ children, description, title }: FormSectionProps) => jsx.JSX.Element;
|
|
27
32
|
export default FormSection;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
6
7
|
type MessageAppearance = 'default' | 'error' | 'valid';
|
|
7
8
|
/**
|
|
8
9
|
* API for the internal `<Message />` component. This is not public API.
|
|
@@ -35,7 +36,7 @@ type MessageProps = Pick<InternalMessageProps, 'children' | 'testId'>;
|
|
|
35
36
|
* 'Password should be more than 4 characters'
|
|
36
37
|
*
|
|
37
38
|
*/
|
|
38
|
-
export declare const HelperMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
39
|
+
export declare const HelperMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
39
40
|
/**
|
|
40
41
|
* __Error message__
|
|
41
42
|
*
|
|
@@ -43,7 +44,7 @@ export declare const HelperMessage: ({ children, testId }: MessageProps) => JSX.
|
|
|
43
44
|
* 'Invalid username, needs to be more than 4 characters'.
|
|
44
45
|
*
|
|
45
46
|
*/
|
|
46
|
-
export declare const ErrorMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
47
|
+
export declare const ErrorMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
47
48
|
/**
|
|
48
49
|
* __Valid message__
|
|
49
50
|
*
|
|
@@ -51,7 +52,7 @@ export declare const ErrorMessage: ({ children, testId }: MessageProps) => JSX.E
|
|
|
51
52
|
* a helper message could be 'Nice one, this username is available'.
|
|
52
53
|
*
|
|
53
54
|
*/
|
|
54
|
-
export declare const ValidMessage: ({ children, testId }: MessageProps) => JSX.Element;
|
|
55
|
+
export declare const ValidMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
|
|
55
56
|
/**
|
|
56
57
|
* __Message wrapper context__
|
|
57
58
|
*
|
|
@@ -70,5 +71,5 @@ export declare const MessageWrapperContext: import("react").Context<{
|
|
|
70
71
|
* may not render the message.
|
|
71
72
|
*
|
|
72
73
|
*/
|
|
73
|
-
export declare const MessageWrapper: ({ children }: MessageProps) => JSX.Element;
|
|
74
|
+
export declare const MessageWrapper: ({ children }: MessageProps) => jsx.JSX.Element;
|
|
74
75
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "A form allows users to input information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,15 +26,14 @@
|
|
|
26
26
|
"runReact18": true
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/css": "^0.7.0",
|
|
30
29
|
"@atlaskit/ds-lib": "^3.3.0",
|
|
31
30
|
"@atlaskit/heading": "^4.0.0",
|
|
32
|
-
"@atlaskit/icon": "^23.
|
|
31
|
+
"@atlaskit/icon": "^23.3.0",
|
|
33
32
|
"@atlaskit/primitives": "^13.3.0",
|
|
34
33
|
"@atlaskit/theme": "^14.0.0",
|
|
35
|
-
"@atlaskit/tokens": "^
|
|
34
|
+
"@atlaskit/tokens": "^3.0.0",
|
|
36
35
|
"@babel/runtime": "^7.0.0",
|
|
37
|
-
"@
|
|
36
|
+
"@emotion/react": "^11.7.1",
|
|
38
37
|
"final-form": "^4.20.3",
|
|
39
38
|
"final-form-focus": "^1.1.2",
|
|
40
39
|
"lodash": "^4.17.21",
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@atlaskit/banner": "^12.6.0",
|
|
51
50
|
"@atlaskit/button": "^20.3.0",
|
|
52
51
|
"@atlaskit/checkbox": "^15.2.0",
|
|
53
|
-
"@atlaskit/modal-dialog": "^12.
|
|
52
|
+
"@atlaskit/modal-dialog": "^12.19.0",
|
|
54
53
|
"@atlaskit/radio": "^7.0.0",
|
|
55
54
|
"@atlaskit/range": "^8.0.0",
|
|
56
55
|
"@atlaskit/select": "^18.9.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
|