@atlaskit/form 8.11.6 → 8.11.8

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,18 @@
1
1
  # @atlaskit/form
2
2
 
3
+ ## 8.11.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`421b74bf0f9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/421b74bf0f9) - Combines stylings of label and legend for simpler maintenance.
8
+ - [`215b4b5df50`](https://bitbucket.org/atlassian/atlassian-frontend/commits/215b4b5df50) - Removes redundant label from legend in fieldset.
9
+
10
+ ## 8.11.7
11
+
12
+ ### Patch Changes
13
+
14
+ - [`ddb4e858a79`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ddb4e858a79) - Removes usage of deprecated theme mixins in favor of static token / color usage.
15
+
3
16
  ## 8.11.6
4
17
 
5
18
  ### Patch Changes
@@ -1,13 +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
  Object.defineProperty(exports, "Label", {
8
7
  enumerable: true,
9
8
  get: function get() {
10
- return _label.default;
9
+ return _label.Label;
11
10
  }
12
11
  });
13
- var _label = _interopRequireDefault(require("../label"));
12
+ Object.defineProperty(exports, "Legend", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _label.Legend;
16
+ }
17
+ });
18
+ var _label = require("../label");
package/dist/cjs/field.js CHANGED
@@ -14,7 +14,7 @@ var _react2 = require("@emotion/react");
14
14
  var _reactUid = require("react-uid");
15
15
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
16
16
  var _form = require("./form");
17
- var _label = _interopRequireDefault(require("./label"));
17
+ var _label = require("./label");
18
18
  var _requiredAsterisk = _interopRequireDefault(require("./required-asterisk"));
19
19
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /** @jsx jsx */
@@ -254,7 +254,7 @@ function Field(props) {
254
254
  return (0, _react2.jsx)("div", {
255
255
  css: fieldWrapperStyles,
256
256
  "data-testid": props.testId
257
- }, props.label && (0, _react2.jsx)(_label.default, {
257
+ }, props.label && (0, _react2.jsx)(_label.Label, {
258
258
  htmlFor: fieldId,
259
259
  id: "".concat(fieldId, "-label"),
260
260
  testId: props.testId && "".concat(props.testId, "--label")
@@ -5,55 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = require("@emotion/react");
8
- var _colors = require("@atlaskit/theme/colors");
9
- var _components = require("@atlaskit/theme/components");
10
- var _constants = require("@atlaskit/theme/constants");
11
- var _typography = require("@atlaskit/theme/typography");
8
+ var _label = require("./label");
12
9
  /** @jsx jsx */
13
10
 
14
- var fontFamily = (0, _constants.fontFamily)();
15
- var fieldsetLabelStyles = (0, _react.css)({
16
- display: 'inline-block',
17
- marginTop: 0,
18
- marginBottom: 0,
19
- fontFamily: "".concat(fontFamily)
20
- });
21
11
  var fieldSetStyles = (0, _react.css)({
22
12
  marginTop: "var(--ds-space-100, 8px)"
23
13
  });
24
14
 
25
- /**
26
- * TODO: Address duplication with packages/design-system/form/src/label.tsx
27
- * in https://product-fabric.atlassian.net/browse/DSP-7731
28
- */
29
- var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
30
- return (0, _react.css)([(0, _typography.h200)({
31
- theme: {
32
- mode: mode
33
- }
34
- }), {
35
- color: "var(--ds-text-subtle, ".concat((0, _colors.subtleHeading)({
36
- theme: {
37
- mode: mode
38
- }
39
- }), ")")
40
- }]);
41
- };
42
-
43
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
44
- var lightH200Styles = getFieldsetLabelDynamicStyles('light');
45
-
46
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
47
- var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
48
- var FieldsetLabel = function FieldsetLabel(_ref) {
49
- var children = _ref.children;
50
- var _useGlobalTheme = (0, _components.useGlobalTheme)(),
51
- mode = _useGlobalTheme.mode;
52
- return (0, _react.jsx)("label", {
53
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
54
- }, children);
55
- };
56
-
57
15
  /**
58
16
  * __Fieldset__
59
17
  *
@@ -64,12 +22,12 @@ var FieldsetLabel = function FieldsetLabel(_ref) {
64
22
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
65
23
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
66
24
  */
67
- var Fieldset = function Fieldset(_ref2) {
68
- var children = _ref2.children,
69
- legend = _ref2.legend;
25
+ var Fieldset = function Fieldset(_ref) {
26
+ var children = _ref.children,
27
+ legend = _ref.legend;
70
28
  return (0, _react.jsx)("fieldset", {
71
29
  css: fieldSetStyles
72
- }, legend && (0, _react.jsx)("legend", null, (0, _react.jsx)(FieldsetLabel, null, legend)), children);
30
+ }, legend && (0, _react.jsx)(_label.Legend, null, legend), children);
73
31
  };
74
32
  var _default = Fieldset;
75
33
  exports.default = _default;
@@ -30,13 +30,13 @@ var formHeaderWrapperStyles = (0, _react.css)({
30
30
  fontFamily: "".concat(fontFamily)
31
31
  });
32
32
 
33
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
34
34
  var darkH700Styles = (0, _react.css)((0, _typography.h700)({
35
35
  theme: {
36
36
  mode: 'dark'
37
37
  }
38
38
  }));
39
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
39
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
40
40
  var lightH700Styles = (0, _react.css)((0, _typography.h700)({
41
41
  theme: {
42
42
  mode: 'light'
@@ -24,13 +24,13 @@ var formSectionWrapperStyles = (0, _react.css)({
24
24
  marginTop: "var(--ds-space-300, 24px)"
25
25
  });
26
26
 
27
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
27
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
28
28
  var lightH600Styles = (0, _react.css)((0, _typography.h600)({
29
29
  theme: {
30
30
  mode: 'light'
31
31
  }
32
32
  }));
33
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
34
34
  var darkH600Styles = (0, _react.css)((0, _typography.h600)({
35
35
  theme: {
36
36
  mode: 'dark'
package/dist/cjs/index.js CHANGED
@@ -55,7 +55,13 @@ Object.defineProperty(exports, "HelperMessage", {
55
55
  Object.defineProperty(exports, "Label", {
56
56
  enumerable: true,
57
57
  get: function get() {
58
- return _label.default;
58
+ return _label.Label;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "Legend", {
62
+ enumerable: true,
63
+ get: function get() {
64
+ return _label.Legend;
59
65
  }
60
66
  });
61
67
  Object.defineProperty(exports, "RangeField", {
@@ -89,7 +95,7 @@ var _formSection = _interopRequireDefault(require("./form-section"));
89
95
  var _field = _interopRequireDefault(require("./field"));
90
96
  var _checkboxField = _interopRequireDefault(require("./checkbox-field"));
91
97
  var _rangeField = _interopRequireDefault(require("./range-field"));
92
- var _label = _interopRequireDefault(require("./label"));
98
+ var _label = require("./label");
93
99
  var _messages = require("./messages");
94
100
  var _fieldset = _interopRequireDefault(require("./fieldset"));
95
101
  var _requiredAsterisk = _interopRequireDefault(require("./required-asterisk"));
package/dist/cjs/label.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.Legend = exports.Label = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _colors = require("@atlaskit/theme/colors");
9
9
  var _components = require("@atlaskit/theme/components");
@@ -12,35 +12,33 @@ var _typography = require("@atlaskit/theme/typography");
12
12
  /** @jsx jsx */
13
13
 
14
14
  var fontFamily = (0, _constants.fontFamily)();
15
- var labelStyles = (0, _react.css)({
15
+ var fieldsetLabelStyles = (0, _react.css)({
16
16
  display: 'inline-block',
17
17
  marginTop: 0,
18
18
  marginBottom: "var(--ds-space-050, 4px)",
19
19
  fontFamily: fontFamily
20
20
  });
21
-
22
- /**
23
- * TODO: Address duplication with packages/design-system/form/src/fieldset.tsx
24
- * in https://product-fabric.atlassian.net/browse/DSP-7731
25
- */
26
21
  var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
27
22
  return (0, _react.css)([(0, _typography.h200)({
28
23
  theme: {
29
24
  mode: mode
30
25
  }
31
26
  }), {
32
- color: "var(--ds-text-subtle, ".concat((0, _colors.subtleHeading)({
27
+ color: (0, _components.themed)({
28
+ dark: "var(--ds-text-subtle, ".concat(_colors.DN300, ")"),
29
+ light: "var(--ds-text-subtle, ".concat(_colors.N200, ")")
30
+ })({
33
31
  theme: {
34
32
  mode: mode
35
33
  }
36
- }), ")")
34
+ })
37
35
  }]);
38
36
  };
39
37
 
40
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
38
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
41
39
  var lightH200Styles = getFieldsetLabelDynamicStyles('light');
42
40
 
43
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
41
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
44
42
  var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
45
43
 
46
44
  /**
@@ -59,11 +57,27 @@ var Label = function Label(_ref) {
59
57
  var _useGlobalTheme = (0, _components.useGlobalTheme)(),
60
58
  mode = _useGlobalTheme.mode;
61
59
  return (0, _react.jsx)("label", {
62
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, labelStyles],
60
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles],
63
61
  id: id,
64
62
  htmlFor: htmlFor,
65
63
  "data-testid": testId
66
64
  }, children);
67
65
  };
66
+
67
+ /**
68
+ * __Legend__
69
+ *
70
+ * A Legend represents a caption for a fieldset in a user interface.
71
+ */
72
+ exports.Label = Label;
73
+ var Legend = function Legend(_ref2) {
74
+ var children = _ref2.children;
75
+ var _useGlobalTheme2 = (0, _components.useGlobalTheme)(),
76
+ mode = _useGlobalTheme2.mode;
77
+ return (0, _react.jsx)("legend", {
78
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
79
+ }, children);
80
+ };
81
+ exports.Legend = Legend;
68
82
  var _default = Label;
69
83
  exports.default = _default;
@@ -25,13 +25,13 @@ var _field = require("./field");
25
25
 
26
26
  var fontFamily = (0, _constants.fontFamily)();
27
27
 
28
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
28
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
29
29
  var lightH200Styles = (0, _react.css)((0, _typography.h200)({
30
30
  theme: {
31
31
  mode: 'light'
32
32
  }
33
33
  }));
34
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
34
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
35
35
  var darkH200Styles = (0, _react.css)((0, _typography.h200)({
36
36
  theme: {
37
37
  mode: 'dark'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.6",
3
+ "version": "8.11.8",
4
4
  "sideEffects": false
5
5
  }
@@ -1 +1 @@
1
- export { default as Label } from '../label';
1
+ export { Label, Legend } from '../label';
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
4
4
  import { uid } from 'react-uid';
5
5
  import invariant from 'tiny-invariant';
6
6
  import { FormContext, IsDisabledContext } from './form';
7
- import Label from './label';
7
+ import { Label } from './label';
8
8
  import RequiredAsterisk from './required-asterisk';
9
9
  const fieldWrapperStyles = css({
10
10
  marginTop: "var(--ds-space-100, 8px)"
@@ -1,53 +1,11 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { subtleHeading } from '@atlaskit/theme/colors';
5
- import { useGlobalTheme } from '@atlaskit/theme/components';
6
- import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
7
- import { h200 } from '@atlaskit/theme/typography';
8
- const fontFamily = getFontFamily();
9
- const fieldsetLabelStyles = css({
10
- display: 'inline-block',
11
- marginTop: 0,
12
- marginBottom: 0,
13
- fontFamily: `${fontFamily}`
14
- });
4
+ import { Legend } from './label';
15
5
  const fieldSetStyles = css({
16
6
  marginTop: "var(--ds-space-100, 8px)"
17
7
  });
18
8
 
19
- /**
20
- * TODO: Address duplication with packages/design-system/form/src/label.tsx
21
- * in https://product-fabric.atlassian.net/browse/DSP-7731
22
- */
23
- const getFieldsetLabelDynamicStyles = mode => css([h200({
24
- theme: {
25
- mode
26
- }
27
- }), {
28
- color: `var(--ds-text-subtle, ${subtleHeading({
29
- theme: {
30
- mode
31
- }
32
- })})`
33
- }]);
34
-
35
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
36
- const lightH200Styles = getFieldsetLabelDynamicStyles('light');
37
-
38
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
39
- const darkH200Styles = getFieldsetLabelDynamicStyles('dark');
40
- const FieldsetLabel = ({
41
- children
42
- }) => {
43
- const {
44
- mode
45
- } = useGlobalTheme();
46
- return jsx("label", {
47
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
48
- }, children);
49
- };
50
-
51
9
  /**
52
10
  * __Fieldset__
53
11
  *
@@ -64,6 +22,6 @@ const Fieldset = ({
64
22
  }) => {
65
23
  return jsx("fieldset", {
66
24
  css: fieldSetStyles
67
- }, legend && jsx("legend", null, jsx(FieldsetLabel, null, legend)), children);
25
+ }, legend && jsx(Legend, null, legend), children);
68
26
  };
69
27
  export default Fieldset;
@@ -24,13 +24,13 @@ const formHeaderWrapperStyles = css({
24
24
  fontFamily: `${fontFamily}`
25
25
  });
26
26
 
27
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
27
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
28
28
  const darkH700Styles = css(h700({
29
29
  theme: {
30
30
  mode: 'dark'
31
31
  }
32
32
  }));
33
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
34
34
  const lightH700Styles = css(h700({
35
35
  theme: {
36
36
  mode: 'light'
@@ -18,13 +18,13 @@ const formSectionWrapperStyles = css({
18
18
  marginTop: "var(--ds-space-300, 24px)"
19
19
  });
20
20
 
21
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
21
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
22
22
  const lightH600Styles = css(h600({
23
23
  theme: {
24
24
  mode: 'light'
25
25
  }
26
26
  }));
27
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
27
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
28
28
  const darkH600Styles = css(h600({
29
29
  theme: {
30
30
  mode: 'dark'
@@ -5,7 +5,7 @@ export { default as FormSection } from './form-section';
5
5
  export { default as Field } from './field';
6
6
  export { default as CheckboxField } from './checkbox-field';
7
7
  export { default as RangeField } from './range-field';
8
- export { default as Label } from './label';
8
+ export { Label, Legend } from './label';
9
9
  export { HelperMessage, ErrorMessage, ValidMessage } from './messages';
10
10
  export { default as Fieldset } from './fieldset';
11
11
  export { default as RequiredAsterisk } from './required-asterisk';
@@ -1,38 +1,36 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { subtleHeading } from '@atlaskit/theme/colors';
5
- import { useGlobalTheme } from '@atlaskit/theme/components';
4
+ import { DN300, N200 } from '@atlaskit/theme/colors';
5
+ import { themed, useGlobalTheme } from '@atlaskit/theme/components';
6
6
  import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
7
7
  import { h200 } from '@atlaskit/theme/typography';
8
8
  const fontFamily = getFontFamily();
9
- const labelStyles = css({
9
+ const fieldsetLabelStyles = css({
10
10
  display: 'inline-block',
11
11
  marginTop: 0,
12
12
  marginBottom: "var(--ds-space-050, 4px)",
13
13
  fontFamily: fontFamily
14
14
  });
15
-
16
- /**
17
- * TODO: Address duplication with packages/design-system/form/src/fieldset.tsx
18
- * in https://product-fabric.atlassian.net/browse/DSP-7731
19
- */
20
15
  const getFieldsetLabelDynamicStyles = mode => css([h200({
21
16
  theme: {
22
17
  mode
23
18
  }
24
19
  }), {
25
- color: `var(--ds-text-subtle, ${subtleHeading({
20
+ color: themed({
21
+ dark: `var(--ds-text-subtle, ${DN300})`,
22
+ light: `var(--ds-text-subtle, ${N200})`
23
+ })({
26
24
  theme: {
27
25
  mode
28
26
  }
29
- })})`
27
+ })
30
28
  }]);
31
29
 
32
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
30
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
33
31
  const lightH200Styles = getFieldsetLabelDynamicStyles('light');
34
32
 
35
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
36
34
  const darkH200Styles = getFieldsetLabelDynamicStyles('dark');
37
35
 
38
36
  /**
@@ -43,7 +41,7 @@ const darkH200Styles = getFieldsetLabelDynamicStyles('dark');
43
41
  * It's recommended that a label has a `4px` spacing above its associated
44
42
  * control element.
45
43
  */
46
- const Label = ({
44
+ export const Label = ({
47
45
  children,
48
46
  htmlFor,
49
47
  id,
@@ -53,10 +51,26 @@ const Label = ({
53
51
  mode
54
52
  } = useGlobalTheme();
55
53
  return jsx("label", {
56
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, labelStyles],
54
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles],
57
55
  id: id,
58
56
  htmlFor: htmlFor,
59
57
  "data-testid": testId
60
58
  }, children);
61
59
  };
60
+
61
+ /**
62
+ * __Legend__
63
+ *
64
+ * A Legend represents a caption for a fieldset in a user interface.
65
+ */
66
+ export const Legend = ({
67
+ children
68
+ }) => {
69
+ const {
70
+ mode
71
+ } = useGlobalTheme();
72
+ return jsx("legend", {
73
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
74
+ }, children);
75
+ };
62
76
  export default Label;
@@ -19,13 +19,13 @@ import { FieldId } from './field';
19
19
 
20
20
  const fontFamily = getFontFamily();
21
21
 
22
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
22
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
23
23
  const lightH200Styles = css(h200({
24
24
  theme: {
25
25
  mode: 'light'
26
26
  }
27
27
  }));
28
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
28
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
29
29
  const darkH200Styles = css(h200({
30
30
  theme: {
31
31
  mode: 'dark'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.6",
3
+ "version": "8.11.8",
4
4
  "sideEffects": false
5
5
  }
@@ -1 +1 @@
1
- export { default as Label } from '../label';
1
+ export { Label, Legend } from '../label';
package/dist/esm/field.js CHANGED
@@ -9,7 +9,7 @@ import { css, jsx } from '@emotion/react';
9
9
  import { uid } from 'react-uid';
10
10
  import invariant from 'tiny-invariant';
11
11
  import { FormContext, IsDisabledContext } from './form';
12
- import Label from './label';
12
+ import { Label } from './label';
13
13
  import RequiredAsterisk from './required-asterisk';
14
14
  var fieldWrapperStyles = css({
15
15
  marginTop: "var(--ds-space-100, 8px)"
@@ -1,53 +1,11 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { subtleHeading } from '@atlaskit/theme/colors';
5
- import { useGlobalTheme } from '@atlaskit/theme/components';
6
- import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
7
- import { h200 } from '@atlaskit/theme/typography';
8
- var fontFamily = getFontFamily();
9
- var fieldsetLabelStyles = css({
10
- display: 'inline-block',
11
- marginTop: 0,
12
- marginBottom: 0,
13
- fontFamily: "".concat(fontFamily)
14
- });
4
+ import { Legend } from './label';
15
5
  var fieldSetStyles = css({
16
6
  marginTop: "var(--ds-space-100, 8px)"
17
7
  });
18
8
 
19
- /**
20
- * TODO: Address duplication with packages/design-system/form/src/label.tsx
21
- * in https://product-fabric.atlassian.net/browse/DSP-7731
22
- */
23
- var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
24
- return css([h200({
25
- theme: {
26
- mode: mode
27
- }
28
- }), {
29
- color: "var(--ds-text-subtle, ".concat(subtleHeading({
30
- theme: {
31
- mode: mode
32
- }
33
- }), ")")
34
- }]);
35
- };
36
-
37
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
38
- var lightH200Styles = getFieldsetLabelDynamicStyles('light');
39
-
40
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
41
- var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
42
- var FieldsetLabel = function FieldsetLabel(_ref) {
43
- var children = _ref.children;
44
- var _useGlobalTheme = useGlobalTheme(),
45
- mode = _useGlobalTheme.mode;
46
- return jsx("label", {
47
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
48
- }, children);
49
- };
50
-
51
9
  /**
52
10
  * __Fieldset__
53
11
  *
@@ -58,11 +16,11 @@ var FieldsetLabel = function FieldsetLabel(_ref) {
58
16
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
59
17
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields)
60
18
  */
61
- var Fieldset = function Fieldset(_ref2) {
62
- var children = _ref2.children,
63
- legend = _ref2.legend;
19
+ var Fieldset = function Fieldset(_ref) {
20
+ var children = _ref.children,
21
+ legend = _ref.legend;
64
22
  return jsx("fieldset", {
65
23
  css: fieldSetStyles
66
- }, legend && jsx("legend", null, jsx(FieldsetLabel, null, legend)), children);
24
+ }, legend && jsx(Legend, null, legend), children);
67
25
  };
68
26
  export default Fieldset;
@@ -24,13 +24,13 @@ var formHeaderWrapperStyles = css({
24
24
  fontFamily: "".concat(fontFamily)
25
25
  });
26
26
 
27
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
27
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
28
28
  var darkH700Styles = css(h700({
29
29
  theme: {
30
30
  mode: 'dark'
31
31
  }
32
32
  }));
33
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
34
34
  var lightH700Styles = css(h700({
35
35
  theme: {
36
36
  mode: 'light'
@@ -18,13 +18,13 @@ var formSectionWrapperStyles = css({
18
18
  marginTop: "var(--ds-space-300, 24px)"
19
19
  });
20
20
 
21
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
21
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
22
22
  var lightH600Styles = css(h600({
23
23
  theme: {
24
24
  mode: 'light'
25
25
  }
26
26
  }));
27
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
27
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
28
28
  var darkH600Styles = css(h600({
29
29
  theme: {
30
30
  mode: 'dark'
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ export { default as FormSection } from './form-section';
5
5
  export { default as Field } from './field';
6
6
  export { default as CheckboxField } from './checkbox-field';
7
7
  export { default as RangeField } from './range-field';
8
- export { default as Label } from './label';
8
+ export { Label, Legend } from './label';
9
9
  export { HelperMessage, ErrorMessage, ValidMessage } from './messages';
10
10
  export { default as Fieldset } from './fieldset';
11
11
  export { default as RequiredAsterisk } from './required-asterisk';
package/dist/esm/label.js CHANGED
@@ -1,40 +1,38 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
- import { subtleHeading } from '@atlaskit/theme/colors';
5
- import { useGlobalTheme } from '@atlaskit/theme/components';
4
+ import { DN300, N200 } from '@atlaskit/theme/colors';
5
+ import { themed, useGlobalTheme } from '@atlaskit/theme/components';
6
6
  import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
7
7
  import { h200 } from '@atlaskit/theme/typography';
8
8
  var fontFamily = getFontFamily();
9
- var labelStyles = css({
9
+ var fieldsetLabelStyles = css({
10
10
  display: 'inline-block',
11
11
  marginTop: 0,
12
12
  marginBottom: "var(--ds-space-050, 4px)",
13
13
  fontFamily: fontFamily
14
14
  });
15
-
16
- /**
17
- * TODO: Address duplication with packages/design-system/form/src/fieldset.tsx
18
- * in https://product-fabric.atlassian.net/browse/DSP-7731
19
- */
20
15
  var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
21
16
  return css([h200({
22
17
  theme: {
23
18
  mode: mode
24
19
  }
25
20
  }), {
26
- color: "var(--ds-text-subtle, ".concat(subtleHeading({
21
+ color: themed({
22
+ dark: "var(--ds-text-subtle, ".concat(DN300, ")"),
23
+ light: "var(--ds-text-subtle, ".concat(N200, ")")
24
+ })({
27
25
  theme: {
28
26
  mode: mode
29
27
  }
30
- }), ")")
28
+ })
31
29
  }]);
32
30
  };
33
31
 
34
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
32
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
35
33
  var lightH200Styles = getFieldsetLabelDynamicStyles('light');
36
34
 
37
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
35
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
38
36
  var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
39
37
 
40
38
  /**
@@ -45,7 +43,7 @@ var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
45
43
  * It's recommended that a label has a `4px` spacing above its associated
46
44
  * control element.
47
45
  */
48
- var Label = function Label(_ref) {
46
+ export var Label = function Label(_ref) {
49
47
  var children = _ref.children,
50
48
  htmlFor = _ref.htmlFor,
51
49
  id = _ref.id,
@@ -53,10 +51,24 @@ var Label = function Label(_ref) {
53
51
  var _useGlobalTheme = useGlobalTheme(),
54
52
  mode = _useGlobalTheme.mode;
55
53
  return jsx("label", {
56
- css: [mode === 'light' ? lightH200Styles : darkH200Styles, labelStyles],
54
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles],
57
55
  id: id,
58
56
  htmlFor: htmlFor,
59
57
  "data-testid": testId
60
58
  }, children);
61
59
  };
60
+
61
+ /**
62
+ * __Legend__
63
+ *
64
+ * A Legend represents a caption for a fieldset in a user interface.
65
+ */
66
+ export var Legend = function Legend(_ref2) {
67
+ var children = _ref2.children;
68
+ var _useGlobalTheme2 = useGlobalTheme(),
69
+ mode = _useGlobalTheme2.mode;
70
+ return jsx("legend", {
71
+ css: [mode === 'light' ? lightH200Styles : darkH200Styles, fieldsetLabelStyles]
72
+ }, children);
73
+ };
62
74
  export default Label;
@@ -19,13 +19,13 @@ import { FieldId } from './field';
19
19
 
20
20
  var fontFamily = getFontFamily();
21
21
 
22
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
22
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
23
23
  var lightH200Styles = css(h200({
24
24
  theme: {
25
25
  mode: 'light'
26
26
  }
27
27
  }));
28
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
28
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
29
29
  var darkH200Styles = css(h200({
30
30
  theme: {
31
31
  mode: 'dark'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.6",
3
+ "version": "8.11.8",
4
4
  "sideEffects": false
5
5
  }
@@ -1,2 +1,2 @@
1
- export { default as Label } from '../label';
2
- export type { LabelProps } from '../label';
1
+ export { Label, Legend } from '../label';
2
+ export type { LabelProps, LegendProps } from '../label';
@@ -9,8 +9,8 @@ export { default as CheckboxField } from './checkbox-field';
9
9
  export type { CheckboxFieldProps } from './checkbox-field';
10
10
  export { default as RangeField } from './range-field';
11
11
  export type { RangeFieldProps } from './range-field';
12
- export { default as Label } from './label';
13
- export type { LabelProps } from './label';
12
+ export { Label, Legend } from './label';
13
+ export type { LabelProps, LegendProps } from './label';
14
14
  export { HelperMessage, ErrorMessage, ValidMessage } from './messages';
15
15
  export { default as Fieldset } from './fieldset';
16
16
  export { default as RequiredAsterisk } from './required-asterisk';
@@ -6,6 +6,9 @@ export interface LabelProps {
6
6
  children: ReactNode;
7
7
  testId?: string;
8
8
  }
9
+ export interface LegendProps {
10
+ children: ReactNode;
11
+ }
9
12
  /**
10
13
  * __Label__
11
14
  *
@@ -14,5 +17,11 @@ export interface LabelProps {
14
17
  * It's recommended that a label has a `4px` spacing above its associated
15
18
  * control element.
16
19
  */
17
- declare const Label: FC<LabelProps>;
20
+ export declare const Label: FC<LabelProps>;
21
+ /**
22
+ * __Legend__
23
+ *
24
+ * A Legend represents a caption for a fieldset in a user interface.
25
+ */
26
+ export declare const Legend: FC<LegendProps>;
18
27
  export default Label;
@@ -1,2 +1,2 @@
1
- export { default as Label } from '../label';
2
- export type { LabelProps } from '../label';
1
+ export { Label, Legend } from '../label';
2
+ export type { LabelProps, LegendProps } from '../label';
@@ -9,8 +9,8 @@ export { default as CheckboxField } from './checkbox-field';
9
9
  export type { CheckboxFieldProps } from './checkbox-field';
10
10
  export { default as RangeField } from './range-field';
11
11
  export type { RangeFieldProps } from './range-field';
12
- export { default as Label } from './label';
13
- export type { LabelProps } from './label';
12
+ export { Label, Legend } from './label';
13
+ export type { LabelProps, LegendProps } from './label';
14
14
  export { HelperMessage, ErrorMessage, ValidMessage } from './messages';
15
15
  export { default as Fieldset } from './fieldset';
16
16
  export { default as RequiredAsterisk } from './required-asterisk';
@@ -6,6 +6,9 @@ export interface LabelProps {
6
6
  children: ReactNode;
7
7
  testId?: string;
8
8
  }
9
+ export interface LegendProps {
10
+ children: ReactNode;
11
+ }
9
12
  /**
10
13
  * __Label__
11
14
  *
@@ -14,5 +17,11 @@ export interface LabelProps {
14
17
  * It's recommended that a label has a `4px` spacing above its associated
15
18
  * control element.
16
19
  */
17
- declare const Label: FC<LabelProps>;
20
+ export declare const Label: FC<LabelProps>;
21
+ /**
22
+ * __Legend__
23
+ *
24
+ * A Legend represents a caption for a fieldset in a user interface.
25
+ */
26
+ export declare const Legend: FC<LegendProps>;
18
27
  export default Label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/form",
3
- "version": "8.11.6",
3
+ "version": "8.11.8",
4
4
  "description": "A form allows users to input information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "atlassian": {
40
40
  "team": "Design System Team",
41
- "releaseModel": "scheduled",
41
+ "releaseModel": "continuous",
42
42
  "website": {
43
43
  "name": "Form",
44
44
  "category": "Components"
@@ -62,14 +62,12 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@atlaskit/button": "^16.7.0",
65
- "@atlaskit/calendar": "^13.1.0",
66
65
  "@atlaskit/checkbox": "^12.6.0",
67
- "@atlaskit/datetime-picker": "^12.6.0",
66
+ "@atlaskit/datetime-picker": "^12.7.0",
68
67
  "@atlaskit/docs": "^9.1.0",
69
- "@atlaskit/dropdown-menu": "^11.9.0",
70
68
  "@atlaskit/ds-lib": "^2.2.0",
71
69
  "@atlaskit/lozenge": "^11.4.0",
72
- "@atlaskit/modal-dialog": "^12.5.0",
70
+ "@atlaskit/modal-dialog": "^12.6.0",
73
71
  "@atlaskit/radio": "^5.6.0",
74
72
  "@atlaskit/range": "^7.1.0",
75
73
  "@atlaskit/section-message": "^6.4.0",
@@ -77,8 +75,6 @@
77
75
  "@atlaskit/ssr": "*",
78
76
  "@atlaskit/textarea": "^4.7.0",
79
77
  "@atlaskit/textfield": "^5.5.0",
80
- "@atlaskit/toggle": "^12.6.0",
81
- "@atlaskit/tooltip": "^17.8.0",
82
78
  "@atlaskit/visual-regression": "*",
83
79
  "@atlaskit/webdriver-runner": "*",
84
80
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
package/report.api.md CHANGED
@@ -52,7 +52,10 @@ interface CheckboxProps {
52
52
  }
53
53
 
54
54
  // @public
55
- export const ErrorMessage: React_2.FC<MessageProps>;
55
+ export const ErrorMessage: ({
56
+ children,
57
+ testId,
58
+ }: MessageProps) => jsx.JSX.Element;
56
59
 
57
60
  // @public (undocumented)
58
61
  export function Field<
@@ -77,6 +80,7 @@ interface FieldComponentProps<FieldValue, Element extends SupportedElements> {
77
80
  isRequired?: boolean;
78
81
  label?: ReactNode;
79
82
  name: string;
83
+ testId?: string;
80
84
  transform?: (
81
85
  event: FieldValue | FormEvent<Element>,
82
86
  current: FieldValue,
@@ -162,7 +166,11 @@ interface FormFooterProps {
162
166
  }
163
167
 
164
168
  // @public
165
- export const FormHeader: React.FC<FormHeaderProps>;
169
+ export const FormHeader: ({
170
+ children,
171
+ description,
172
+ title,
173
+ }: FormHeaderProps) => jsx.JSX.Element;
166
174
 
167
175
  // @public (undocumented)
168
176
  interface FormHeaderProps {
@@ -188,7 +196,11 @@ export interface FormProps<FormValues> {
188
196
  }
189
197
 
190
198
  // @public
191
- export const FormSection: React_2.FC<FormSectionProps>;
199
+ export const FormSection: ({
200
+ children,
201
+ description,
202
+ title,
203
+ }: FormSectionProps) => jsx.JSX.Element;
192
204
 
193
205
  // @public (undocumented)
194
206
  interface FormSectionProps {
@@ -198,7 +210,10 @@ interface FormSectionProps {
198
210
  }
199
211
 
200
212
  // @public
201
- export const HelperMessage: React_2.FC<MessageProps>;
213
+ export const HelperMessage: ({
214
+ children,
215
+ testId,
216
+ }: MessageProps) => jsx.JSX.Element;
202
217
 
203
218
  // @public
204
219
  interface InternalMessageProps {
@@ -220,6 +235,17 @@ export interface LabelProps {
220
235
  htmlFor: string;
221
236
  // (undocumented)
222
237
  id?: string;
238
+ // (undocumented)
239
+ testId?: string;
240
+ }
241
+
242
+ // @public
243
+ export const Legend: FC<LegendProps>;
244
+
245
+ // @public (undocumented)
246
+ export interface LegendProps {
247
+ // (undocumented)
248
+ children: ReactNode;
223
249
  }
224
250
 
225
251
  // @public (undocumented)
@@ -288,7 +314,10 @@ type SupportedElements =
288
314
  | HTMLTextAreaElement;
289
315
 
290
316
  // @public
291
- export const ValidMessage: React_2.FC<MessageProps>;
317
+ export const ValidMessage: ({
318
+ children,
319
+ testId,
320
+ }: MessageProps) => jsx.JSX.Element;
292
321
 
293
322
  // (No @packageDocumentation comment for this package)
294
323
  ```
@@ -0,0 +1,265 @@
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
+ ```