@atlaskit/form 11.0.2 → 11.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/field.compiled.css +1 -0
  3. package/dist/cjs/field.js +23 -14
  4. package/dist/cjs/fieldset.compiled.css +1 -0
  5. package/dist/cjs/fieldset.js +11 -14
  6. package/dist/cjs/form-footer.compiled.css +4 -0
  7. package/dist/cjs/form-footer.js +11 -18
  8. package/dist/cjs/form-header.compiled.css +2 -0
  9. package/dist/cjs/form-header.js +15 -21
  10. package/dist/cjs/form-section.compiled.css +2 -0
  11. package/dist/cjs/form-section.js +17 -21
  12. package/dist/cjs/label.compiled.css +6 -0
  13. package/dist/cjs/label.js +15 -24
  14. package/dist/cjs/messages.compiled.css +10 -0
  15. package/dist/cjs/messages.js +34 -50
  16. package/dist/cjs/range-field.js +15 -13
  17. package/dist/cjs/required-asterisk.compiled.css +3 -0
  18. package/dist/cjs/required-asterisk.js +13 -21
  19. package/dist/es2019/field.compiled.css +1 -0
  20. package/dist/es2019/field.js +18 -15
  21. package/dist/es2019/fieldset.compiled.css +1 -0
  22. package/dist/es2019/fieldset.js +8 -13
  23. package/dist/es2019/form-footer.compiled.css +4 -0
  24. package/dist/es2019/form-footer.js +8 -17
  25. package/dist/es2019/form-header.compiled.css +2 -0
  26. package/dist/es2019/form-header.js +12 -20
  27. package/dist/es2019/form-section.compiled.css +2 -0
  28. package/dist/es2019/form-section.js +14 -20
  29. package/dist/es2019/label.compiled.css +6 -0
  30. package/dist/es2019/label.js +11 -22
  31. package/dist/es2019/messages.compiled.css +10 -0
  32. package/dist/es2019/messages.js +27 -48
  33. package/dist/es2019/range-field.js +21 -24
  34. package/dist/es2019/required-asterisk.compiled.css +3 -0
  35. package/dist/es2019/required-asterisk.js +10 -20
  36. package/dist/esm/field.compiled.css +1 -0
  37. package/dist/esm/field.js +18 -15
  38. package/dist/esm/fieldset.compiled.css +1 -0
  39. package/dist/esm/fieldset.js +8 -13
  40. package/dist/esm/form-footer.compiled.css +4 -0
  41. package/dist/esm/form-footer.js +8 -17
  42. package/dist/esm/form-header.compiled.css +2 -0
  43. package/dist/esm/form-header.js +12 -20
  44. package/dist/esm/form-section.compiled.css +2 -0
  45. package/dist/esm/form-section.js +14 -20
  46. package/dist/esm/label.compiled.css +6 -0
  47. package/dist/esm/label.js +11 -22
  48. package/dist/esm/messages.compiled.css +10 -0
  49. package/dist/esm/messages.js +29 -48
  50. package/dist/esm/range-field.js +15 -13
  51. package/dist/esm/required-asterisk.compiled.css +3 -0
  52. package/dist/esm/required-asterisk.js +10 -20
  53. package/dist/types/checkbox-field.d.ts +1 -1
  54. package/dist/types/field.d.ts +1 -2
  55. package/dist/types/fieldset.d.ts +2 -3
  56. package/dist/types/form-footer.d.ts +3 -3
  57. package/dist/types/form-header.d.ts +2 -3
  58. package/dist/types/form-section.d.ts +2 -3
  59. package/dist/types/label.d.ts +0 -1
  60. package/dist/types/messages.d.ts +4 -14
  61. package/dist/types/required-asterisk.d.ts +2 -2
  62. package/dist/types-ts4.5/checkbox-field.d.ts +1 -1
  63. package/dist/types-ts4.5/field.d.ts +1 -2
  64. package/dist/types-ts4.5/fieldset.d.ts +2 -3
  65. package/dist/types-ts4.5/form-footer.d.ts +3 -3
  66. package/dist/types-ts4.5/form-header.d.ts +2 -3
  67. package/dist/types-ts4.5/form-section.d.ts +2 -3
  68. package/dist/types-ts4.5/label.d.ts +0 -1
  69. package/dist/types-ts4.5/messages.d.ts +4 -14
  70. package/dist/types-ts4.5/required-asterisk.d.ts +2 -2
  71. package/package.json +12 -7
  72. package/__perf__/default.tsx +0 -56
@@ -1,29 +1,21 @@
1
+ /* required-asterisk.tsx generated by @compiled/babel-plugin v0.36.0 */
1
2
  "use strict";
2
3
 
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.default = RequiredAsterisk;
7
- var _react = require("@emotion/react");
8
- var _colors = require("@atlaskit/theme/colors");
9
- /**
10
- * @jsxRuntime classic
11
- * @jsx jsx
12
- */
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
-
15
- var requiredIndicatorStyles = (0, _react.css)({
16
- color: "var(--ds-text-danger, ".concat(_colors.R400, ")"),
17
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
18
- paddingInlineStart: "var(--ds-space-025, 2px)"
19
- });
9
+ require("./required-asterisk.compiled.css");
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _runtime = require("@compiled/react/runtime");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ var requiredIndicatorStyles = null;
20
15
  function RequiredAsterisk() {
21
- return (
22
- // eslint-disable-next-line @atlaskit/design-system/use-primitives-text
23
- (0, _react.jsx)("span", {
24
- css: requiredIndicatorStyles,
25
- "aria-hidden": "true",
26
- title: "required"
27
- }, "*")
28
- );
16
+ return /*#__PURE__*/React.createElement("span", {
17
+ "aria-hidden": "true",
18
+ title: "required",
19
+ className: (0, _runtime.ax)(["_syaz1ick _ect41sbm _bozgv77o"])
20
+ }, "*");
29
21
  }
@@ -0,0 +1 @@
1
+ ._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
@@ -1,26 +1,29 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* field.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./field.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useContext, useEffect, useMemo, useRef, useState } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
6
  import invariant from 'tiny-invariant';
10
7
  import { useId } from '@atlaskit/ds-lib/use-id';
11
8
  import { FieldId } from './field-id-context';
12
9
  import { FormContext, IsDisabledContext } from './form';
13
10
  import { Label } from './label';
14
11
  import RequiredAsterisk from './required-asterisk';
15
- const fieldWrapperStyles = css({
16
- marginBlockStart: "var(--ds-space-100, 8px)"
17
- });
12
+ const fieldWrapperStyles = null;
18
13
  function isEvent(event) {
19
14
  return Boolean(event && event.target);
20
15
  }
21
16
  function isFunction(x) {
22
17
  return typeof x === 'function';
23
18
  }
19
+
20
+ // Must be exported to satisfy error TS4023 from Jira builds
21
+ // src/packages/servicedesk/virtual-agent/common/src/ui/base-text-field/index.tsx(10,14):
22
+ // error TS4023: Exported variable `BaseTextField` has or is using name
23
+ // `FieldComponentProps` from external module
24
+ // `/opt/atlassian/pipelines/agent/build/jira/tsDist/@atlaskit__form/app/src/field`
25
+ // but cannot be named.
26
+
24
27
  function usePreviousRef(current) {
25
28
  const ref = useRef(current);
26
29
 
@@ -233,14 +236,14 @@ export default function Field(props) {
233
236
  'aria-labelledby': `${fieldId}-label`,
234
237
  id: fieldId
235
238
  };
236
- return jsx("div", {
237
- css: fieldWrapperStyles,
238
- "data-testid": props.testId
239
- }, props.label && jsx(Label, {
239
+ return /*#__PURE__*/React.createElement("div", {
240
+ "data-testid": props.testId,
241
+ className: ax(["_1pfhu2gc"])
242
+ }, props.label && /*#__PURE__*/React.createElement(Label, {
240
243
  htmlFor: fieldId,
241
244
  id: `${fieldId}-label`,
242
245
  testId: props.testId && `${props.testId}--label`
243
- }, props.label, props.isRequired && jsx(RequiredAsterisk, null), props.elementAfterLabel), jsx(FieldId.Provider, {
246
+ }, props.label, props.isRequired && /*#__PURE__*/React.createElement(RequiredAsterisk, null), props.elementAfterLabel), /*#__PURE__*/React.createElement(FieldId.Provider, {
244
247
  value: fieldId
245
248
  }, props.children({
246
249
  fieldProps: extendedFieldProps,
@@ -0,0 +1 @@
1
+ ._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
@@ -1,14 +1,9 @@
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';
1
+ /* fieldset.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./fieldset.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import { Legend } from './label';
9
- const fieldSetStyles = css({
10
- marginBlockStart: "var(--ds-space-100, 8px)"
11
- });
6
+ const fieldSetStyles = null;
12
7
 
13
8
  /**
14
9
  * __Fieldset__
@@ -24,8 +19,8 @@ const Fieldset = ({
24
19
  children,
25
20
  legend
26
21
  }) => {
27
- return jsx("fieldset", {
28
- css: fieldSetStyles
29
- }, legend && jsx(Legend, null, legend), children);
22
+ return /*#__PURE__*/React.createElement("fieldset", {
23
+ className: ax(["_1pfhu2gc"])
24
+ }, legend && /*#__PURE__*/React.createElement(Legend, null, legend), children);
30
25
  };
31
26
  export default Fieldset;
@@ -0,0 +1,4 @@
1
+ ._1bah1y6m{justify-content:flex-start}
2
+ ._1bahesu3{justify-content:flex-end}
3
+ ._1e0c1txw{display:flex}
4
+ ._1pfh1ejb{margin-block-start:var(--ds-space-300,24px)}
@@ -1,18 +1,9 @@
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
- const formFooterWrapperStyles = css({
9
- display: 'flex',
10
- justifyContent: 'flex-end',
11
- marginBlockStart: "var(--ds-space-300, 24px)"
12
- });
13
- const justifyContentStyles = css({
14
- justifyContent: 'flex-start'
15
- });
1
+ /* form-footer.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./form-footer.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const formFooterWrapperStyles = null;
6
+ const justifyContentStyles = null;
16
7
 
17
8
  /**
18
9
  * __Form footer__
@@ -27,7 +18,7 @@ export default function FormFooter({
27
18
  align = 'end',
28
19
  children
29
20
  }) {
30
- return jsx("footer", {
31
- css: [formFooterWrapperStyles, align === 'start' && justifyContentStyles]
21
+ return /*#__PURE__*/React.createElement("footer", {
22
+ className: ax(["_1e0c1txw _1bahesu3 _1pfh1ejb", align === 'start' && "_1bah1y6m"])
32
23
  }, children);
33
24
  }
@@ -0,0 +1,2 @@
1
+ ._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
2
+ ._1ul91osq{min-width:100%}
@@ -1,19 +1,11 @@
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';
1
+ /* form-header.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ /* eslint-disable @atlaskit/design-system/use-primitives */
3
+ import "./form-header.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
8
6
  import Heading from '@atlaskit/heading';
9
- import { Box, xcss } from '@atlaskit/primitives';
10
- const formHeaderContentStyles = xcss({
11
- minWidth: '100%',
12
- marginBlockStart: 'space.100'
13
- });
14
- const formHeaderDescriptionStyles = xcss({
15
- marginBlockStart: 'space.100'
16
- });
7
+ const formHeaderContentStyles = null;
8
+ const formHeaderDescriptionStyles = null;
17
9
 
18
10
  /**
19
11
  * __Form header__.
@@ -30,12 +22,12 @@ const FormHeader = ({
30
22
  description,
31
23
  title
32
24
  }) => {
33
- return jsx(Box, null, title && jsx(Heading, {
25
+ return /*#__PURE__*/React.createElement("div", null, title && /*#__PURE__*/React.createElement(Heading, {
34
26
  size: "large"
35
- }, title), description && jsx(Box, {
36
- xcss: formHeaderDescriptionStyles
37
- }, description), children && jsx(Box, {
38
- xcss: formHeaderContentStyles
27
+ }, title), description && /*#__PURE__*/React.createElement("div", {
28
+ className: ax(["_1pfhu2gc"])
29
+ }, description), children && /*#__PURE__*/React.createElement("div", {
30
+ className: ax(["_1ul91osq _1pfhu2gc"])
39
31
  }, children));
40
32
  };
41
33
  export default FormHeader;
@@ -0,0 +1,2 @@
1
+ ._1pfh1ejb{margin-block-start:var(--ds-space-300,24px)}
2
+ ._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}
@@ -1,30 +1,24 @@
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';
1
+ /* form-section.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./form-section.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import Heading from '@atlaskit/heading';
9
- import { Box, xcss } from '@atlaskit/primitives';
10
- const formSectionDescriptionStyles = xcss({
11
- marginBlockStart: 'space.100'
12
- });
13
- const formSectionWrapperStyles = xcss({
14
- marginBlockStart: 'space.300'
15
- });
6
+ const formSectionDescriptionStyles = null;
7
+ const formSectionWrapperStyles = null;
16
8
  const FormSectionWrapper = ({
17
9
  children
18
10
  }) => {
19
- return jsx(Box, {
20
- xcss: formSectionWrapperStyles
11
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ className: ax(["_1pfh1ejb"])
21
14
  }, children);
22
15
  };
23
16
  const FormSectionDescription = ({
24
17
  children
25
18
  }) => {
26
- return jsx(Box, {
27
- xcss: formSectionDescriptionStyles
19
+ // eslint-disable-next-line @atlaskit/design-system/use-primitives
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: ax(["_1pfhu2gc"])
28
22
  }, children);
29
23
  };
30
24
 
@@ -43,8 +37,8 @@ const FormSection = ({
43
37
  description,
44
38
  title
45
39
  }) => {
46
- return jsx(FormSectionWrapper, null, title && jsx(Heading, {
40
+ return /*#__PURE__*/React.createElement(FormSectionWrapper, null, title && /*#__PURE__*/React.createElement(Heading, {
47
41
  size: "medium"
48
- }, title), description && jsx(FormSectionDescription, null, description), children);
42
+ }, title), description && /*#__PURE__*/React.createElement(FormSectionDescription, null, description), children);
49
43
  };
50
44
  export default FormSection;
@@ -0,0 +1,6 @@
1
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._1e0c1o8l{display:inline-block}
3
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
4
+ ._6rth1b66{margin-block-end:var(--ds-space-050,4px)}
5
+ ._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
6
+ ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
@@ -1,18 +1,8 @@
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
- const 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
- });
1
+ /* label.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./label.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const fieldsetLabelStyles = null;
16
6
 
17
7
  /**
18
8
  * __Label__
@@ -27,11 +17,11 @@ export const Label = ({
27
17
  htmlFor,
28
18
  id,
29
19
  testId
30
- }) => jsx("label", {
31
- css: fieldsetLabelStyles,
20
+ }) => /*#__PURE__*/React.createElement("label", {
32
21
  id: id,
33
22
  htmlFor: htmlFor,
34
- "data-testid": testId
23
+ "data-testid": testId,
24
+ className: ax(["_11c8qk37 _1e0c1o8l _syaz1gjq _k48pmoej _6rth1b66 _1pfhze3t"])
35
25
  }, children);
36
26
 
37
27
  /**
@@ -42,8 +32,7 @@ export const Label = ({
42
32
  export const Legend = ({
43
33
  children
44
34
  }) => {
45
- return jsx("legend", {
46
- css: fieldsetLabelStyles
35
+ return /*#__PURE__*/React.createElement("legend", {
36
+ className: ax(["_11c8qk37 _1e0c1o8l _syaz1gjq _k48pmoej _6rth1b66 _1pfhze3t"])
47
37
  }, children);
48
- };
49
- export default Label;
38
+ };
@@ -0,0 +1,10 @@
1
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._zulp12x7{gap:var(--ds-space-075,6px)}
3
+ ._1bah1q9y{justify-content:baseline}
4
+ ._1e0c1txw{display:flex}
5
+ ._1pfh1b66{margin-block-start:var(--ds-space-050,4px)}
6
+ ._4cvr1h6o{align-items:center}
7
+ ._4t3i7vkz{height:1pc}
8
+ ._syaz1wmz{color:var(--ds-text-subtlest,#6b778c)}
9
+ ._syaze6sf{color:var(--ds-text-danger,#ae2a19)}
10
+ ._syazy73q{color:var(--ds-text-success,#216e4e)}
@@ -1,15 +1,10 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
1
+ /* messages.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./messages.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
6
5
  import { createContext, useContext, useEffect, useRef, useState } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { css, jsx } from '@emotion/react';
10
6
  import ErrorIcon from '@atlaskit/icon/utility/migration/error';
11
7
  import SuccessIcon from '@atlaskit/icon/utility/migration/success--editor-success';
12
- import { N200 } from '@atlaskit/theme/colors';
13
8
  import { FieldId } from './field-id-context';
14
9
 
15
10
  /**
@@ -20,44 +15,28 @@ import { FieldId } from './field-id-context';
20
15
  * Public API of the various message components.
21
16
  */
22
17
 
23
- const messageStyles = css({
24
- display: 'flex',
25
- justifyContent: 'baseline',
26
- gap: "var(--ds-space-075, 6px)",
27
- 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)",
28
- marginBlockStart: "var(--ds-space-050, 4px)"
29
- });
18
+ const messageStyles = null;
30
19
  const messageAppearanceStyles = {
31
- default: css({
32
- color: `var(--ds-text-subtlest, ${N200})`
33
- }),
34
- error: css({
35
- color: "var(--ds-text-danger, #AE2A19)"
36
- }),
37
- valid: css({
38
- color: "var(--ds-text-success, #216E4E)"
39
- })
20
+ default: "_syaz1wmz",
21
+ error: "_syaze6sf",
22
+ valid: "_syazy73q"
23
+ };
24
+ const iconWrapperStyles = {
25
+ root: "_1e0c1txw _4t3i7vkz _4cvr1h6o"
40
26
  };
41
- const iconWrapperStyles = css({
42
- display: 'flex',
43
- height: '16px',
44
- alignItems: 'center'
45
- });
46
27
  const IconWrapper = ({
47
28
  children
48
- }) => {
49
- return jsx("span", {
50
- css: iconWrapperStyles
51
- }, children);
52
- };
29
+ }) => /*#__PURE__*/React.createElement("span", {
30
+ className: ax([iconWrapperStyles.root])
31
+ }, children);
53
32
  const messageIcons = {
54
- error: jsx(ErrorIcon, {
33
+ error: /*#__PURE__*/React.createElement(ErrorIcon, {
55
34
  LEGACY_margin: "0 -2px 0 0",
56
35
  color: "currentColor",
57
36
  LEGACY_size: "small",
58
37
  label: "error"
59
38
  }),
60
- valid: jsx(SuccessIcon, {
39
+ valid: /*#__PURE__*/React.createElement(SuccessIcon, {
61
40
  LEGACY_margin: "0 -2px 0 0",
62
41
  color: "currentColor",
63
42
  LEGACY_size: "small",
@@ -90,16 +69,16 @@ const Message = ({
90
69
  * If the child is just a string, this is not required and we can use one
91
70
  * less DOM element.
92
71
  */
93
- const content = typeof children === 'string' ? children : jsx("span", null, children);
94
- return jsx("div", {
95
- css: [messageStyles, messageAppearanceStyles[appearance]],
72
+ const content = typeof children === 'string' ? children : /*#__PURE__*/React.createElement("span", null, children);
73
+ return /*#__PURE__*/React.createElement("div", {
96
74
  "data-testid": testId,
97
75
  id: fieldId,
98
76
  ref: messageRef
99
77
  // For backwards compatability, if there is a wrapper, aria-live is not needed
100
78
  ,
101
- "aria-live": !hasMessageWrapper ? 'polite' : undefined
102
- }, icon && jsx(IconWrapper, null, icon), content);
79
+ "aria-live": !hasMessageWrapper ? 'polite' : undefined,
80
+ className: ax(["_zulp12x7 _11c8qk37 _1e0c1txw _1bah1q9y _1pfh1b66", messageAppearanceStyles[appearance]])
81
+ }, icon && /*#__PURE__*/React.createElement(IconWrapper, null, icon), content);
103
82
  };
104
83
 
105
84
  /**
@@ -112,7 +91,7 @@ const Message = ({
112
91
  export const HelperMessage = ({
113
92
  children,
114
93
  testId
115
- }) => jsx(FieldId.Consumer, null, fieldId => jsx(Message, {
94
+ }) => /*#__PURE__*/React.createElement(FieldId.Consumer, null, fieldId => /*#__PURE__*/React.createElement(Message, {
116
95
  fieldId: fieldId ? `${fieldId}-helper` : undefined,
117
96
  testId: testId
118
97
  }, children));
@@ -127,7 +106,7 @@ export const HelperMessage = ({
127
106
  export const ErrorMessage = ({
128
107
  children,
129
108
  testId
130
- }) => jsx(FieldId.Consumer, null, fieldId => jsx(Message, {
109
+ }) => /*#__PURE__*/React.createElement(FieldId.Consumer, null, fieldId => /*#__PURE__*/React.createElement(Message, {
131
110
  appearance: "error",
132
111
  fieldId: fieldId ? `${fieldId}-error` : undefined,
133
112
  testId: testId
@@ -143,7 +122,7 @@ export const ErrorMessage = ({
143
122
  export const ValidMessage = ({
144
123
  children,
145
124
  testId
146
- }) => jsx(FieldId.Consumer, null, fieldId => jsx(Message, {
125
+ }) => /*#__PURE__*/React.createElement(FieldId.Consumer, null, fieldId => /*#__PURE__*/React.createElement(Message, {
147
126
  appearance: "valid",
148
127
  fieldId: fieldId ? `${fieldId}-valid` : undefined,
149
128
  testId: testId
@@ -155,7 +134,7 @@ export const ValidMessage = ({
155
134
  * A message wrapper context allows the children to check
156
135
  * if it is contained within the MessageWrapper.
157
136
  */
158
- export const MessageWrapperContext = /*#__PURE__*/createContext({
137
+ const MessageWrapperContext = /*#__PURE__*/createContext({
159
138
  isWrapper: false
160
139
  });
161
140
 
@@ -174,9 +153,9 @@ export const MessageWrapper = ({
174
153
  const contextValue = {
175
154
  isWrapper: true
176
155
  };
177
- return jsx(MessageWrapperContext.Provider, {
156
+ return /*#__PURE__*/React.createElement(MessageWrapperContext.Provider, {
178
157
  value: contextValue
179
- }, jsx("div", {
158
+ }, /*#__PURE__*/React.createElement("div", {
180
159
  "aria-live": "polite",
181
160
  "data-testid": "message-wrapper"
182
161
  }, children));
@@ -10,28 +10,25 @@ import Field from './field';
10
10
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
11
11
  * - [Usage](https://atlaskit.atlassian.com/packages/design-system/form/docs/fields#rangefield-reference)
12
12
  */
13
- const RangeField = props => {
14
- const {
15
- children,
16
- ...strippedProps
17
- } = props;
18
- // isInvalid and isRequired are specifically invalid for range inputs
19
- return (
20
- /*#__PURE__*/
21
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
22
- React.createElement(Field, _extends({}, strippedProps, {
23
- transform: Number
24
- }), ({
25
- fieldProps: {
26
- isInvalid,
27
- isRequired,
28
- ...fieldProps
29
- },
30
- ...rest
31
- }) => children({
32
- fieldProps,
33
- ...rest
34
- }))
35
- );
36
- };
13
+ const RangeField = ({
14
+ children,
15
+ ...strippedProps
16
+ }) =>
17
+ /*#__PURE__*/
18
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
19
+ React.createElement(Field, _extends({}, strippedProps, {
20
+ transform: Number
21
+ }), ({
22
+ fieldProps: {
23
+ isInvalid,
24
+ isRequired,
25
+ ...fieldProps
26
+ },
27
+ ...rest
28
+ }) =>
29
+ // isInvalid and isRequired are specifically invalid for range inputs
30
+ children({
31
+ fieldProps,
32
+ ...rest
33
+ }));
37
34
  export default RangeField;
@@ -0,0 +1,3 @@
1
+ ._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
2
+ ._ect41sbm{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._syaz1ick{color:var(--ds-text-danger,#de350b)}
@@ -1,22 +1,12 @@
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
- const requiredIndicatorStyles = css({
9
- color: `var(--ds-text-danger, ${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
- });
1
+ /* required-asterisk.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import "./required-asterisk.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const requiredIndicatorStyles = null;
13
6
  export default function RequiredAsterisk() {
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
- );
7
+ return /*#__PURE__*/React.createElement("span", {
8
+ "aria-hidden": "true",
9
+ title: "required",
10
+ className: ax(["_syaz1ick _ect41sbm _bozgv77o"])
11
+ }, "*");
22
12
  }
@@ -0,0 +1 @@
1
+ ._1pfhu2gc{margin-block-start:var(--ds-space-100,8px)}