@atlaskit/form 9.0.1 → 9.0.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/form
2
2
 
3
+ ## 9.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
8
+
9
+ ## 9.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#58458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58458) [`536478cdcf0b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/536478cdcf0b) - Updated Form messages to have a small gap between the icon and message text.
14
+
3
15
  ## 9.0.1
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/label.js CHANGED
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.Legend = exports.Label = void 0;
7
- var _react = require("@emotion/react");
7
+ var _react = require("react");
8
+ var _react2 = require("@emotion/react");
8
9
  var _colors = require("@atlaskit/theme/colors");
9
10
  var _constants = require("@atlaskit/theme/constants");
10
11
  var _typography = require("@atlaskit/theme/typography");
@@ -12,7 +13,7 @@ var _typography = require("@atlaskit/theme/typography");
12
13
 
13
14
  var fontFamily = (0, _constants.fontFamily)();
14
15
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
15
- var fieldsetLabelStyles = (0, _react.css)([(0, _typography.h200)({
16
+ var fieldsetLabelStyles = (0, _react2.css)([(0, _typography.h200)({
16
17
  theme: {
17
18
  mode: 'light'
18
19
  }
@@ -37,12 +38,15 @@ var Label = exports.Label = function Label(_ref) {
37
38
  htmlFor = _ref.htmlFor,
38
39
  id = _ref.id,
39
40
  testId = _ref.testId;
40
- return (0, _react.jsx)("label", {
41
+ return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("span", {
42
+ hidden: true,
43
+ id: "label--".concat(id || htmlFor)
44
+ }, children), (0, _react2.jsx)("label", {
41
45
  css: fieldsetLabelStyles,
42
46
  id: id,
43
47
  htmlFor: htmlFor,
44
48
  "data-testid": testId
45
- }, children);
49
+ }, children));
46
50
  };
47
51
 
48
52
  /**
@@ -52,7 +56,7 @@ var Label = exports.Label = function Label(_ref) {
52
56
  */
53
57
  var Legend = exports.Legend = function Legend(_ref2) {
54
58
  var children = _ref2.children;
55
- return (0, _react.jsx)("legend", {
59
+ return (0, _react2.jsx)("legend", {
56
60
  css: fieldsetLabelStyles
57
61
  }, children);
58
62
  };
@@ -33,6 +33,7 @@ var lightH200Styles = (0, _react.css)((0, _typography.h200)({
33
33
  var messageStyles = (0, _react.css)({
34
34
  display: 'flex',
35
35
  justifyContent: 'baseline',
36
+ gap: "var(--ds-space-050, 4px)",
36
37
  fontFamily: "".concat(fontFamily),
37
38
  fontWeight: 'normal',
38
39
  marginBlockStart: "var(--ds-space-050, 4px)"
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
-
2
+ import { Fragment } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { N200 } from '@atlaskit/theme/colors';
5
5
  import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
@@ -32,12 +32,15 @@ export const Label = ({
32
32
  id,
33
33
  testId
34
34
  }) => {
35
- return jsx("label", {
35
+ return jsx(Fragment, null, jsx("span", {
36
+ hidden: true,
37
+ id: `label--${id || htmlFor}`
38
+ }, children), jsx("label", {
36
39
  css: fieldsetLabelStyles,
37
40
  id: id,
38
41
  htmlFor: htmlFor,
39
42
  "data-testid": testId
40
- }, children);
43
+ }, children));
41
44
  };
42
45
 
43
46
  /**
@@ -27,6 +27,7 @@ const lightH200Styles = css(h200({
27
27
  const messageStyles = css({
28
28
  display: 'flex',
29
29
  justifyContent: 'baseline',
30
+ gap: "var(--ds-space-050, 4px)",
30
31
  fontFamily: `${fontFamily}`,
31
32
  fontWeight: 'normal',
32
33
  marginBlockStart: "var(--ds-space-050, 4px)"
package/dist/esm/label.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
-
2
+ import { Fragment } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { N200 } from '@atlaskit/theme/colors';
5
5
  import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
@@ -31,12 +31,15 @@ export var Label = function Label(_ref) {
31
31
  htmlFor = _ref.htmlFor,
32
32
  id = _ref.id,
33
33
  testId = _ref.testId;
34
- return jsx("label", {
34
+ return jsx(Fragment, null, jsx("span", {
35
+ hidden: true,
36
+ id: "label--".concat(id || htmlFor)
37
+ }, children), jsx("label", {
35
38
  css: fieldsetLabelStyles,
36
39
  id: id,
37
40
  htmlFor: htmlFor,
38
41
  "data-testid": testId
39
- }, children);
42
+ }, children));
40
43
  };
41
44
 
42
45
  /**
@@ -27,6 +27,7 @@ var lightH200Styles = css(h200({
27
27
  var messageStyles = css({
28
28
  display: 'flex',
29
29
  justifyContent: 'baseline',
30
+ gap: "var(--ds-space-050, 4px)",
30
31
  fontFamily: "".concat(fontFamily),
31
32
  fontWeight: 'normal',
32
33
  marginBlockStart: "var(--ds-space-050, 4px)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "9.0.1",
3
+ "version": "9.0.3",
4
4
  "description": "A form allows users to input information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/icon": "^22.0.0",
31
31
  "@atlaskit/theme": "^12.6.0",
32
- "@atlaskit/tokens": "^1.28.0",
32
+ "@atlaskit/tokens": "^1.29.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@emotion/react": "^11.7.1",
35
35
  "final-form": "^4.20.1",
@@ -43,14 +43,15 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@af/accessibility-testing": "*",
46
+ "@af/integration-testing": "*",
46
47
  "@af/visual-regression": "*",
47
- "@atlaskit/button": "^16.16.0",
48
+ "@atlaskit/button": "^16.17.0",
48
49
  "@atlaskit/checkbox": "^13.0.0",
49
50
  "@atlaskit/ds-lib": "^2.2.0",
50
51
  "@atlaskit/range": "^7.1.0",
51
52
  "@atlaskit/select": "^17.0.0",
52
53
  "@atlaskit/ssr": "*",
53
- "@atlaskit/textfield": "^5.6.0",
54
+ "@atlaskit/textfield": "^6.0.0",
54
55
  "@atlaskit/visual-regression": "*",
55
56
  "@atlaskit/webdriver-runner": "*",
56
57
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -1,265 +0,0 @@
1
- ## API Report File for "@atlaskit/form"
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 { FC } from 'react';
8
- import { FormApi as FormApi_2 } from 'final-form';
9
- import { FormEvent } from 'react';
10
- import { FormState } from 'final-form';
11
- import { jsx } from '@emotion/react';
12
- import { default as React_2 } from 'react';
13
- import { ReactNode } from 'react';
14
-
15
- // @public (undocumented)
16
- type Align = 'end' | 'start';
17
-
18
- // @public
19
- export const CheckboxField: FC<CheckboxProps>;
20
-
21
- // @public (undocumented)
22
- export interface CheckboxFieldProps extends FieldProps<string | undefined> {
23
- // (undocumented)
24
- isChecked: boolean;
25
- }
26
-
27
- // @public (undocumented)
28
- interface CheckboxProps {
29
- children: (args: {
30
- fieldProps: CheckboxFieldProps;
31
- error?: string;
32
- valid: boolean;
33
- meta: Meta;
34
- }) => ReactNode;
35
- defaultIsChecked?: boolean;
36
- isDisabled?: boolean;
37
- isRequired?: boolean;
38
- label?: ReactNode;
39
- name: string;
40
- value?: string;
41
- }
42
-
43
- // @public
44
- export const ErrorMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
45
-
46
- // @public (undocumented)
47
- export function Field<FieldValue = string, Element extends SupportedElements = HTMLInputElement>(props: FieldComponentProps<FieldValue, Element>): jsx.JSX.Element;
48
-
49
- // @public (undocumented)
50
- interface FieldComponentProps<FieldValue, Element extends SupportedElements> {
51
- children: (args: {
52
- fieldProps: FieldProps<FieldValue, Element>;
53
- error?: string;
54
- valid: boolean;
55
- meta: Meta;
56
- }) => ReactNode;
57
- defaultValue?: ((currentDefaultValue?: FieldValue) => FieldValue) | FieldValue;
58
- elementAfterLabel?: ReactNode;
59
- id?: string;
60
- isDisabled?: boolean;
61
- isRequired?: boolean;
62
- label?: ReactNode;
63
- name: string;
64
- testId?: string;
65
- transform?: (event: FieldValue | FormEvent<Element>, current: FieldValue) => FieldValue;
66
- validate?: (value: FieldValue | undefined, formState: Object, fieldState: Meta) => Promise<string | void> | string | void;
67
- }
68
-
69
- // @public (undocumented)
70
- export interface FieldProps<FieldValue, Element extends SupportedElements = HTMLInputElement> {
71
- // (undocumented)
72
- 'aria-invalid': 'false' | 'true';
73
- // (undocumented)
74
- 'aria-labelledby': string;
75
- // (undocumented)
76
- id: string;
77
- // (undocumented)
78
- isDisabled: boolean;
79
- // (undocumented)
80
- isInvalid: boolean;
81
- // (undocumented)
82
- isRequired: boolean;
83
- // (undocumented)
84
- name: string;
85
- // (undocumented)
86
- onBlur: () => void;
87
- // (undocumented)
88
- onChange: (value: FieldValue | FormEvent<Element>) => void;
89
- // (undocumented)
90
- onFocus: () => void;
91
- // (undocumented)
92
- value: FieldValue;
93
- }
94
-
95
- // @public
96
- export const Fieldset: ({ children, legend }: FieldsetProps) => jsx.JSX.Element;
97
-
98
- // @public (undocumented)
99
- interface FieldsetProps {
100
- children: ReactNode;
101
- legend?: ReactNode;
102
- }
103
-
104
- // @public (undocumented)
105
- function Form<FormValues extends Record<string, any> = {}>(props: FormProps<FormValues>): JSX.Element;
106
- export default Form;
107
-
108
- // @public (undocumented)
109
- export type FormApi<FormData> = FormApi_2<FormData>;
110
-
111
- // @public (undocumented)
112
- interface FormChildrenProps {
113
- // (undocumented)
114
- onKeyDown: (event: React_2.KeyboardEvent<HTMLElement>) => void;
115
- // (undocumented)
116
- onSubmit: (event?: React_2.FormEvent<HTMLFormElement> | React_2.SyntheticEvent<HTMLElement>) => void;
117
- // (undocumented)
118
- ref: React_2.RefObject<HTMLFormElement>;
119
- }
120
-
121
- // @public
122
- export function FormFooter({ align, children, }: FormFooterProps): jsx.JSX.Element;
123
-
124
- // @public (undocumented)
125
- interface FormFooterProps {
126
- align?: Align;
127
- children?: ReactNode;
128
- }
129
-
130
- // @public
131
- export const FormHeader: ({ children, description, title }: FormHeaderProps) => jsx.JSX.Element;
132
-
133
- // @public (undocumented)
134
- interface FormHeaderProps {
135
- children?: ReactNode;
136
- description?: ReactNode;
137
- title?: ReactNode;
138
- }
139
-
140
- // @public (undocumented)
141
- export interface FormProps<FormValues> {
142
- children: (args: {
143
- formProps: FormChildrenProps;
144
- disabled: boolean;
145
- dirty: boolean;
146
- submitting: boolean;
147
- getState: () => FormState<FormValues>;
148
- getValues: () => FormValues;
149
- setFieldValue: (name: string, value: any) => void;
150
- reset: (initialValues?: FormValues) => void;
151
- }) => ReactNode;
152
- isDisabled?: boolean;
153
- onSubmit: OnSubmitHandler<FormValues>;
154
- }
155
-
156
- // @public
157
- export const FormSection: ({ children, description, title }: FormSectionProps) => jsx.JSX.Element;
158
-
159
- // @public (undocumented)
160
- interface FormSectionProps {
161
- children?: ReactNode;
162
- description?: ReactNode;
163
- title?: ReactNode;
164
- }
165
-
166
- // @public
167
- export const HelperMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
168
-
169
- // @public
170
- interface InternalMessageProps {
171
- appearance?: MessageAppearance;
172
- children: ReactNode;
173
- // (undocumented)
174
- fieldId?: string;
175
- testId?: string;
176
- }
177
-
178
- // @public
179
- export const Label: FC<LabelProps>;
180
-
181
- // @public (undocumented)
182
- export interface LabelProps {
183
- // (undocumented)
184
- children: ReactNode;
185
- // (undocumented)
186
- htmlFor: string;
187
- // (undocumented)
188
- id?: string;
189
- // (undocumented)
190
- testId?: string;
191
- }
192
-
193
- // @public
194
- export const Legend: FC<LegendProps>;
195
-
196
- // @public (undocumented)
197
- export interface LegendProps {
198
- // (undocumented)
199
- children: ReactNode;
200
- }
201
-
202
- // @public (undocumented)
203
- type MessageAppearance = 'default' | 'error' | 'valid';
204
-
205
- // @public
206
- type MessageProps = Pick<InternalMessageProps, 'children' | 'testId'>;
207
-
208
- // @public (undocumented)
209
- interface Meta {
210
- // (undocumented)
211
- dirty: boolean;
212
- // (undocumented)
213
- dirtySinceLastSubmit: boolean;
214
- // (undocumented)
215
- error?: string;
216
- // (undocumented)
217
- submitError?: boolean;
218
- // (undocumented)
219
- submitFailed: boolean;
220
- // (undocumented)
221
- submitting: boolean;
222
- // (undocumented)
223
- touched: boolean;
224
- // (undocumented)
225
- valid: boolean;
226
- // (undocumented)
227
- validating?: boolean;
228
- }
229
-
230
- // @public (undocumented)
231
- export type OnSubmitHandler<FormData> = (values: FormData, form: FormApi<FormData>, callback?: (errors?: Record<string, string>) => void) => Object | Promise<Object | void> | void;
232
-
233
- // @public
234
- export const RangeField: FC<RangeFieldProps>;
235
-
236
- // @public (undocumented)
237
- export interface RangeFieldProps {
238
- // (undocumented)
239
- children: (args: {
240
- fieldProps: RangeProps;
241
- error?: string;
242
- meta: Meta;
243
- }) => React_2.ReactNode;
244
- defaultValue: ((currentDefaultValue?: number) => number) | number;
245
- id?: string;
246
- isDisabled?: boolean;
247
- label?: ReactNode;
248
- name: string;
249
- }
250
-
251
- // @public (undocumented)
252
- type RangeProps = Omit<FieldProps<number>, 'isInvalid' | 'isRequired'>;
253
-
254
- // @public (undocumented)
255
- export function RequiredAsterisk(): jsx.JSX.Element;
256
-
257
- // @public (undocumented)
258
- type SupportedElements = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
259
-
260
- // @public
261
- export const ValidMessage: ({ children, testId }: MessageProps) => jsx.JSX.Element;
262
-
263
- // (No @packageDocumentation comment for this package)
264
-
265
- ```