@atlaskit/form 8.11.4 → 8.11.6

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/form
2
2
 
3
+ ## 8.11.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e7ea6832ad2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7ea6832ad2) - Bans the use of React.FC/React.FunctionComponent type in ADS components as part of the React 18 migration work. The change is internal only and should not introduce any changes for the component consumers.
8
+
9
+ ## 8.11.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`b1bdec7cce2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b1bdec7cce2) - Internal change to enforce token usage for spacing properties. There is no expected visual or behaviour change.
14
+
3
15
  ## 8.11.4
4
16
 
5
17
  ### Patch Changes
@@ -1,20 +1,18 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _react2 = require("@emotion/react");
7
+ var _react = require("@emotion/react");
10
8
  var _components = require("@atlaskit/theme/components");
11
9
  var _typography = require("@atlaskit/theme/typography");
12
10
  /** @jsx jsx */
13
11
 
14
- var formSectionDescriptionStyles = (0, _react2.css)({
12
+ var formSectionDescriptionStyles = (0, _react.css)({
15
13
  marginTop: "var(--ds-space-100, 8px)"
16
14
  });
17
- var formSectionTitleStyles = (0, _react2.css)({
15
+ var formSectionTitleStyles = (0, _react.css)({
18
16
  marginTop: 0,
19
17
  marginRight: "var(--ds-space-400, 32px)",
20
18
  lineHeight: "var(--ds-space-400, 32px)",
@@ -22,25 +20,25 @@ var formSectionTitleStyles = (0, _react2.css)({
22
20
  textOverflow: 'ellipsis',
23
21
  whiteSpace: 'nowrap'
24
22
  });
25
- var formSectionWrapperStyles = (0, _react2.css)({
23
+ var formSectionWrapperStyles = (0, _react.css)({
26
24
  marginTop: "var(--ds-space-300, 24px)"
27
25
  });
28
26
 
29
27
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
30
- var lightH600Styles = (0, _react2.css)((0, _typography.h600)({
28
+ var lightH600Styles = (0, _react.css)((0, _typography.h600)({
31
29
  theme: {
32
30
  mode: 'light'
33
31
  }
34
32
  }));
35
33
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
36
- var darkH600Styles = (0, _react2.css)((0, _typography.h600)({
34
+ var darkH600Styles = (0, _react.css)((0, _typography.h600)({
37
35
  theme: {
38
36
  mode: 'dark'
39
37
  }
40
38
  }));
41
39
  var FormSectionWrapper = function FormSectionWrapper(_ref) {
42
40
  var children = _ref.children;
43
- return (0, _react2.jsx)("div", {
41
+ return (0, _react.jsx)("div", {
44
42
  css: formSectionWrapperStyles
45
43
  }, children);
46
44
  };
@@ -48,13 +46,13 @@ var FormSectionTitle = function FormSectionTitle(_ref2) {
48
46
  var children = _ref2.children;
49
47
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
50
48
  mode = _useGlobalTheme.mode;
51
- return (0, _react2.jsx)("h3", {
49
+ return (0, _react.jsx)("h3", {
52
50
  css: [formSectionTitleStyles, mode === 'light' ? lightH600Styles : darkH600Styles]
53
51
  }, children);
54
52
  };
55
53
  var FormSectionDescription = function FormSectionDescription(_ref3) {
56
54
  var children = _ref3.children;
57
- return (0, _react2.jsx)("div", {
55
+ return (0, _react.jsx)("div", {
58
56
  css: formSectionDescriptionStyles
59
57
  }, children);
60
58
  };
@@ -73,7 +71,7 @@ var FormSection = function FormSection(_ref4) {
73
71
  var children = _ref4.children,
74
72
  description = _ref4.description,
75
73
  title = _ref4.title;
76
- return (0, _react2.jsx)(FormSectionWrapper, null, title && (0, _react2.jsx)(FormSectionTitle, null, title), description && (0, _react2.jsx)(FormSectionDescription, null, description), children);
74
+ return (0, _react.jsx)(FormSectionWrapper, null, title && (0, _react.jsx)(FormSectionTitle, null, title), description && (0, _react.jsx)(FormSectionDescription, null, description), children);
77
75
  };
78
76
  var _default = FormSection;
79
77
  exports.default = _default;
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ValidMessage = exports.HelperMessage = exports.ErrorMessage = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _react2 = require("@emotion/react");
8
+ var _react = require("@emotion/react");
10
9
  var _success = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
11
10
  var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
12
11
  var _colors = require("@atlaskit/theme/colors");
@@ -27,18 +26,18 @@ var _field = require("./field");
27
26
  var fontFamily = (0, _constants.fontFamily)();
28
27
 
29
28
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
30
- var lightH200Styles = (0, _react2.css)((0, _typography.h200)({
29
+ var lightH200Styles = (0, _react.css)((0, _typography.h200)({
31
30
  theme: {
32
31
  mode: 'light'
33
32
  }
34
33
  }));
35
34
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
36
- var darkH200Styles = (0, _react2.css)((0, _typography.h200)({
35
+ var darkH200Styles = (0, _react.css)((0, _typography.h200)({
37
36
  theme: {
38
37
  mode: 'dark'
39
38
  }
40
39
  }));
41
- var messageStyles = (0, _react2.css)({
40
+ var messageStyles = (0, _react.css)({
42
41
  display: 'flex',
43
42
  marginTop: "var(--ds-space-050, 4px)",
44
43
  justifyContent: 'baseline',
@@ -46,31 +45,31 @@ var messageStyles = (0, _react2.css)({
46
45
  fontWeight: 'normal'
47
46
  });
48
47
  var messageAppearanceStyles = {
49
- default: (0, _react2.css)({
48
+ default: (0, _react.css)({
50
49
  color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
51
50
  }),
52
- error: (0, _react2.css)({
51
+ error: (0, _react.css)({
53
52
  color: "var(--ds-text-danger, #AE2A19)"
54
53
  }),
55
- valid: (0, _react2.css)({
54
+ valid: (0, _react.css)({
56
55
  color: "var(--ds-text-success, #216E4E)"
57
56
  })
58
57
  };
59
- var iconWrapperStyles = (0, _react2.css)({
58
+ var iconWrapperStyles = (0, _react.css)({
60
59
  display: 'flex'
61
60
  });
62
61
  var IconWrapper = function IconWrapper(_ref) {
63
62
  var children = _ref.children;
64
- return (0, _react2.jsx)("span", {
63
+ return (0, _react.jsx)("span", {
65
64
  css: iconWrapperStyles
66
65
  }, children);
67
66
  };
68
67
  var messageIcons = {
69
- error: (0, _react2.jsx)(_error.default, {
68
+ error: (0, _react.jsx)(_error.default, {
70
69
  size: "small",
71
70
  label: "error"
72
71
  }),
73
- valid: (0, _react2.jsx)(_success.default, {
72
+ valid: (0, _react.jsx)(_success.default, {
74
73
  size: "small",
75
74
  label: "success"
76
75
  })
@@ -93,13 +92,13 @@ var Message = function Message(_ref2) {
93
92
  * If the child is just a string, this is not required and we can use one
94
93
  * less DOM element.
95
94
  */
96
- var content = typeof children === 'string' ? children : (0, _react2.jsx)("span", null, children);
97
- return (0, _react2.jsx)("div", {
95
+ var content = typeof children === 'string' ? children : (0, _react.jsx)("span", null, children);
96
+ return (0, _react.jsx)("div", {
98
97
  css: [mode === 'light' ? lightH200Styles : darkH200Styles, messageStyles, messageAppearanceStyles[appearance]],
99
98
  "data-testid": testId,
100
99
  id: fieldId,
101
100
  role: "alert"
102
- }, icon && (0, _react2.jsx)(IconWrapper, null, icon), content);
101
+ }, icon && (0, _react.jsx)(IconWrapper, null, icon), content);
103
102
  };
104
103
 
105
104
  /**
@@ -112,8 +111,8 @@ var Message = function Message(_ref2) {
112
111
  var HelperMessage = function HelperMessage(_ref3) {
113
112
  var children = _ref3.children,
114
113
  testId = _ref3.testId;
115
- return (0, _react2.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
116
- return (0, _react2.jsx)(Message, {
114
+ return (0, _react.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
115
+ return (0, _react.jsx)(Message, {
117
116
  fieldId: fieldId ? "".concat(fieldId, "-helper") : undefined,
118
117
  testId: testId
119
118
  }, children);
@@ -131,8 +130,8 @@ exports.HelperMessage = HelperMessage;
131
130
  var ErrorMessage = function ErrorMessage(_ref4) {
132
131
  var children = _ref4.children,
133
132
  testId = _ref4.testId;
134
- return (0, _react2.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
135
- return (0, _react2.jsx)(Message, {
133
+ return (0, _react.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
134
+ return (0, _react.jsx)(Message, {
136
135
  appearance: "error",
137
136
  fieldId: fieldId ? "".concat(fieldId, "-error") : undefined,
138
137
  testId: testId
@@ -151,8 +150,8 @@ exports.ErrorMessage = ErrorMessage;
151
150
  var ValidMessage = function ValidMessage(_ref5) {
152
151
  var children = _ref5.children,
153
152
  testId = _ref5.testId;
154
- return (0, _react2.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
155
- return (0, _react2.jsx)(Message, {
153
+ return (0, _react.jsx)(_field.FieldId.Consumer, null, function (fieldId) {
154
+ return (0, _react.jsx)(Message, {
156
155
  appearance: "valid",
157
156
  fieldId: fieldId ? "".concat(fieldId, "-valid") : undefined,
158
157
  testId: testId
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.4",
3
+ "version": "8.11.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
2
+
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { h600 } from '@atlaskit/theme/typography';
@@ -1,6 +1,5 @@
1
1
  /** @jsx jsx */
2
2
 
3
- import React from 'react';
4
3
  import { css, jsx } from '@emotion/react';
5
4
  import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
6
5
  import ErrorIcon from '@atlaskit/icon/glyph/error';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.4",
3
+ "version": "8.11.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
2
+
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { h600 } from '@atlaskit/theme/typography';
@@ -1,6 +1,5 @@
1
1
  /** @jsx jsx */
2
2
 
3
- import React from 'react';
4
3
  import { css, jsx } from '@emotion/react';
5
4
  import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
6
5
  import ErrorIcon from '@atlaskit/icon/glyph/error';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.4",
3
+ "version": "8.11.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export interface FormHeaderProps {
4
5
  /**
5
6
  * Title of the form. This is a header.
@@ -14,15 +15,15 @@ export interface FormHeaderProps {
14
15
  */
15
16
  children?: ReactNode;
16
17
  }
17
- declare const FormHeaderContent: React.FC<{
18
+ declare const FormHeaderContent: ({ children }: {
18
19
  children: ReactNode;
19
- }>;
20
- declare const FormHeaderDescription: React.FC<{
20
+ }) => jsx.JSX.Element;
21
+ declare const FormHeaderDescription: ({ children }: {
21
22
  children: ReactNode;
22
- }>;
23
- declare const FormHeaderTitle: React.FC<{
23
+ }) => jsx.JSX.Element;
24
+ declare const FormHeaderTitle: ({ children }: {
24
25
  children: ReactNode;
25
- }>;
26
+ }) => jsx.JSX.Element;
26
27
  /**
27
28
  * __Form header__
28
29
  *
@@ -33,6 +34,6 @@ declare const FormHeaderTitle: React.FC<{
33
34
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
34
35
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
35
36
  */
36
- declare const FormHeader: React.FC<FormHeaderProps>;
37
+ declare const FormHeader: ({ children, description, title }: FormHeaderProps) => jsx.JSX.Element;
37
38
  export default FormHeader;
38
39
  export { FormHeaderContent, FormHeaderDescription, FormHeaderTitle };
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
- import React, { ReactNode } from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export interface FormSectionProps {
4
5
  /**
5
6
  * Title of the form section.
@@ -24,5 +25,5 @@ export interface FormSectionProps {
24
25
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
25
26
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
26
27
  */
27
- declare const FormSection: React.FC<FormSectionProps>;
28
+ declare const FormSection: ({ children, description, title }: FormSectionProps) => jsx.JSX.Element;
28
29
  export default FormSection;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
- import React, { ReactNode } from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  type MessageAppearance = 'default' | 'error' | 'valid';
4
5
  /**
5
6
  * API for the internal `<Message />` component. This is not public API.
@@ -32,7 +33,7 @@ type MessageProps = Pick<InternalMessageProps, 'children' | 'testId'>;
32
33
  * 'Password should be more than 4 characters'
33
34
  *
34
35
  */
35
- export declare const HelperMessage: React.FC<MessageProps>;
36
+ export declare const HelperMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
36
37
  /**
37
38
  * __Error message__
38
39
  *
@@ -40,7 +41,7 @@ export declare const HelperMessage: React.FC<MessageProps>;
40
41
  * 'Invalid username, needs to be more than 4 characters'.
41
42
  *
42
43
  */
43
- export declare const ErrorMessage: React.FC<MessageProps>;
44
+ export declare const ErrorMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
44
45
  /**
45
46
  * __Valid message__
46
47
  *
@@ -48,5 +49,5 @@ export declare const ErrorMessage: React.FC<MessageProps>;
48
49
  * a helper message could be 'Nice one, this username is available'.
49
50
  *
50
51
  */
51
- export declare const ValidMessage: React.FC<MessageProps>;
52
+ export declare const ValidMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
52
53
  export {};
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export interface FormHeaderProps {
4
5
  /**
5
6
  * Title of the form. This is a header.
@@ -14,15 +15,15 @@ export interface FormHeaderProps {
14
15
  */
15
16
  children?: ReactNode;
16
17
  }
17
- declare const FormHeaderContent: React.FC<{
18
+ declare const FormHeaderContent: ({ children }: {
18
19
  children: ReactNode;
19
- }>;
20
- declare const FormHeaderDescription: React.FC<{
20
+ }) => jsx.JSX.Element;
21
+ declare const FormHeaderDescription: ({ children }: {
21
22
  children: ReactNode;
22
- }>;
23
- declare const FormHeaderTitle: React.FC<{
23
+ }) => jsx.JSX.Element;
24
+ declare const FormHeaderTitle: ({ children }: {
24
25
  children: ReactNode;
25
- }>;
26
+ }) => jsx.JSX.Element;
26
27
  /**
27
28
  * __Form header__
28
29
  *
@@ -33,6 +34,6 @@ declare const FormHeaderTitle: React.FC<{
33
34
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
34
35
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
35
36
  */
36
- declare const FormHeader: React.FC<FormHeaderProps>;
37
+ declare const FormHeader: ({ children, description, title }: FormHeaderProps) => jsx.JSX.Element;
37
38
  export default FormHeader;
38
39
  export { FormHeaderContent, FormHeaderDescription, FormHeaderTitle };
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
- import React, { ReactNode } from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  export interface FormSectionProps {
4
5
  /**
5
6
  * Title of the form section.
@@ -24,5 +25,5 @@ export interface FormSectionProps {
24
25
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
25
26
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/layout)
26
27
  */
27
- declare const FormSection: React.FC<FormSectionProps>;
28
+ declare const FormSection: ({ children, description, title }: FormSectionProps) => jsx.JSX.Element;
28
29
  export default FormSection;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
- import React, { ReactNode } from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  type MessageAppearance = 'default' | 'error' | 'valid';
4
5
  /**
5
6
  * API for the internal `<Message />` component. This is not public API.
@@ -32,7 +33,7 @@ type MessageProps = Pick<InternalMessageProps, 'children' | 'testId'>;
32
33
  * 'Password should be more than 4 characters'
33
34
  *
34
35
  */
35
- export declare const HelperMessage: React.FC<MessageProps>;
36
+ export declare const HelperMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
36
37
  /**
37
38
  * __Error message__
38
39
  *
@@ -40,7 +41,7 @@ export declare const HelperMessage: React.FC<MessageProps>;
40
41
  * 'Invalid username, needs to be more than 4 characters'.
41
42
  *
42
43
  */
43
- export declare const ErrorMessage: React.FC<MessageProps>;
44
+ export declare const ErrorMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
44
45
  /**
45
46
  * __Valid message__
46
47
  *
@@ -48,5 +49,5 @@ export declare const ErrorMessage: React.FC<MessageProps>;
48
49
  * a helper message could be 'Nice one, this username is available'.
49
50
  *
50
51
  */
51
- export declare const ValidMessage: React.FC<MessageProps>;
52
+ export declare const ValidMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
52
53
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.4",
3
+ "version": "8.11.6",
4
4
  "description": "A form allows users to input information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@atlaskit/icon": "^21.12.0",
50
50
  "@atlaskit/theme": "^12.5.0",
51
- "@atlaskit/tokens": "^1.4.0",
51
+ "@atlaskit/tokens": "^1.5.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",
54
54
  "final-form": "^4.20.1",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/button": "^16.7.0",
65
65
  "@atlaskit/calendar": "^13.1.0",
66
66
  "@atlaskit/checkbox": "^12.6.0",
67
- "@atlaskit/datetime-picker": "^12.5.0",
67
+ "@atlaskit/datetime-picker": "^12.6.0",
68
68
  "@atlaskit/docs": "^9.1.0",
69
69
  "@atlaskit/dropdown-menu": "^11.9.0",
70
70
  "@atlaskit/ds-lib": "^2.2.0",
@@ -73,10 +73,10 @@
73
73
  "@atlaskit/radio": "^5.6.0",
74
74
  "@atlaskit/range": "^7.1.0",
75
75
  "@atlaskit/section-message": "^6.4.0",
76
- "@atlaskit/select": "^16.2.0",
76
+ "@atlaskit/select": "^16.5.0",
77
77
  "@atlaskit/ssr": "*",
78
- "@atlaskit/textarea": "^4.6.0",
79
- "@atlaskit/textfield": "^5.4.0",
78
+ "@atlaskit/textarea": "^4.7.0",
79
+ "@atlaskit/textfield": "^5.5.0",
80
80
  "@atlaskit/toggle": "^12.6.0",
81
81
  "@atlaskit/tooltip": "^17.8.0",
82
82
  "@atlaskit/visual-regression": "*",
@@ -106,7 +106,8 @@
106
106
  "dom-events": "use-bind-event-listener",
107
107
  "analytics": "analytics-next",
108
108
  "design-tokens": [
109
- "color"
109
+ "color",
110
+ "spacing"
110
111
  ],
111
112
  "theming": [
112
113
  "react-context"