@atlaskit/form 8.11.13 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/form-header.js +5 -14
- package/dist/cjs/form-section.js +5 -14
- package/dist/cjs/label.js +10 -31
- package/dist/cjs/messages.js +3 -12
- package/dist/es2019/form-header.js +5 -15
- package/dist/es2019/form-section.js +5 -15
- package/dist/es2019/label.js +10 -31
- package/dist/es2019/messages.js +3 -13
- package/dist/esm/form-header.js +5 -14
- package/dist/esm/form-section.js +5 -14
- package/dist/esm/label.js +11 -32
- package/dist/esm/messages.js +3 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/form
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#41791](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41791) [`ec7c2a38247`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ec7c2a38247) - Removed all remaining legacy theming logic from the Calendar, Form, InlineDialog, InlineEdit and InlineMessage components.
|
|
8
|
+
|
|
3
9
|
## 8.11.13
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/form-header.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.FormHeaderTitle = exports.FormHeaderDescription = exports.FormHeaderContent = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _components = require("@atlaskit/theme/components");
|
|
9
8
|
var _constants = require("@atlaskit/theme/constants");
|
|
10
9
|
var _typography = require("@atlaskit/theme/typography");
|
|
11
10
|
/** @jsx jsx */
|
|
@@ -13,15 +12,15 @@ var _typography = require("@atlaskit/theme/typography");
|
|
|
13
12
|
var fontFamily = (0, _constants.fontFamily)();
|
|
14
13
|
var formHeaderContentStyles = (0, _react.css)({
|
|
15
14
|
minWidth: '100%',
|
|
16
|
-
|
|
15
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
17
16
|
});
|
|
18
17
|
var formHeaderDescriptionStyles = (0, _react.css)({
|
|
19
|
-
|
|
18
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
20
19
|
});
|
|
21
20
|
var formHeaderTitleStyles = (0, _react.css)({
|
|
22
|
-
marginTop: 0,
|
|
23
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
24
21
|
lineHeight: "var(--ds-font-lineHeight-500, 32px)",
|
|
22
|
+
marginBlockStart: 0,
|
|
23
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
25
24
|
overflow: 'hidden',
|
|
26
25
|
textOverflow: 'ellipsis',
|
|
27
26
|
whiteSpace: 'nowrap'
|
|
@@ -30,12 +29,6 @@ var formHeaderWrapperStyles = (0, _react.css)({
|
|
|
30
29
|
fontFamily: "".concat(fontFamily)
|
|
31
30
|
});
|
|
32
31
|
|
|
33
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
34
|
-
var darkH700Styles = (0, _react.css)((0, _typography.h700)({
|
|
35
|
-
theme: {
|
|
36
|
-
mode: 'dark'
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
32
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
40
33
|
var lightH700Styles = (0, _react.css)((0, _typography.h700)({
|
|
41
34
|
theme: {
|
|
@@ -56,10 +49,8 @@ var FormHeaderDescription = exports.FormHeaderDescription = function FormHeaderD
|
|
|
56
49
|
};
|
|
57
50
|
var FormHeaderTitle = exports.FormHeaderTitle = function FormHeaderTitle(_ref3) {
|
|
58
51
|
var children = _ref3.children;
|
|
59
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
60
|
-
mode = _useGlobalTheme.mode;
|
|
61
52
|
return (0, _react.jsx)("h2", {
|
|
62
|
-
css: [
|
|
53
|
+
css: [lightH700Styles, formHeaderTitleStyles]
|
|
63
54
|
}, children);
|
|
64
55
|
};
|
|
65
56
|
var FormHeaderWrapper = function FormHeaderWrapper(_ref4) {
|
package/dist/cjs/form-section.js
CHANGED
|
@@ -5,23 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _components = require("@atlaskit/theme/components");
|
|
9
8
|
var _typography = require("@atlaskit/theme/typography");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
12
11
|
var formSectionDescriptionStyles = (0, _react.css)({
|
|
13
|
-
|
|
12
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
14
13
|
});
|
|
15
14
|
var formSectionTitleStyles = (0, _react.css)({
|
|
16
|
-
marginTop: 0,
|
|
17
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
18
15
|
lineHeight: "var(--ds-space-400, 32px)",
|
|
16
|
+
marginBlockStart: 0,
|
|
17
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
19
18
|
overflow: 'hidden',
|
|
20
19
|
textOverflow: 'ellipsis',
|
|
21
20
|
whiteSpace: 'nowrap'
|
|
22
21
|
});
|
|
23
22
|
var formSectionWrapperStyles = (0, _react.css)({
|
|
24
|
-
|
|
23
|
+
marginBlockStart: "var(--ds-space-300, 24px)"
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -30,12 +29,6 @@ var lightH600Styles = (0, _react.css)((0, _typography.h600)({
|
|
|
30
29
|
mode: 'light'
|
|
31
30
|
}
|
|
32
31
|
}));
|
|
33
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
34
|
-
var darkH600Styles = (0, _react.css)((0, _typography.h600)({
|
|
35
|
-
theme: {
|
|
36
|
-
mode: 'dark'
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
32
|
var FormSectionWrapper = function FormSectionWrapper(_ref) {
|
|
40
33
|
var children = _ref.children;
|
|
41
34
|
return (0, _react.jsx)("div", {
|
|
@@ -44,10 +37,8 @@ var FormSectionWrapper = function FormSectionWrapper(_ref) {
|
|
|
44
37
|
};
|
|
45
38
|
var FormSectionTitle = function FormSectionTitle(_ref2) {
|
|
46
39
|
var children = _ref2.children;
|
|
47
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
48
|
-
mode = _useGlobalTheme.mode;
|
|
49
40
|
return (0, _react.jsx)("h3", {
|
|
50
|
-
css: [formSectionTitleStyles,
|
|
41
|
+
css: [formSectionTitleStyles, lightH600Styles]
|
|
51
42
|
}, children);
|
|
52
43
|
};
|
|
53
44
|
var FormSectionDescription = function FormSectionDescription(_ref3) {
|
package/dist/cjs/label.js
CHANGED
|
@@ -6,40 +6,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
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
|
-
var _components = require("@atlaskit/theme/components");
|
|
10
9
|
var _constants = require("@atlaskit/theme/constants");
|
|
11
10
|
var _typography = require("@atlaskit/theme/typography");
|
|
12
11
|
/** @jsx jsx */
|
|
13
12
|
|
|
14
13
|
var fontFamily = (0, _constants.fontFamily)();
|
|
15
|
-
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
15
|
+
var fieldsetLabelStyles = (0, _react.css)([(0, _typography.h200)({
|
|
16
|
+
theme: {
|
|
17
|
+
mode: 'light'
|
|
18
|
+
}
|
|
19
|
+
}), {
|
|
16
20
|
display: 'inline-block',
|
|
17
21
|
marginTop: 0,
|
|
18
22
|
marginBottom: "var(--ds-space-050, 4px)",
|
|
23
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N200, ")"),
|
|
19
24
|
fontFamily: fontFamily
|
|
20
|
-
});
|
|
21
|
-
var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
|
|
22
|
-
return (0, _react.css)([(0, _typography.h200)({
|
|
23
|
-
theme: {
|
|
24
|
-
mode: mode
|
|
25
|
-
}
|
|
26
|
-
}), {
|
|
27
|
-
color: (0, _components.themed)({
|
|
28
|
-
dark: "var(--ds-text-subtle, ".concat(_colors.DN300, ")"),
|
|
29
|
-
light: "var(--ds-text-subtle, ".concat(_colors.N200, ")")
|
|
30
|
-
})({
|
|
31
|
-
theme: {
|
|
32
|
-
mode: mode
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
}]);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
39
|
-
var lightH200Styles = getFieldsetLabelDynamicStyles('light');
|
|
40
|
-
|
|
41
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
42
|
-
var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
|
|
25
|
+
}]);
|
|
43
26
|
|
|
44
27
|
/**
|
|
45
28
|
* __Label__
|
|
@@ -54,10 +37,8 @@ var Label = exports.Label = function Label(_ref) {
|
|
|
54
37
|
htmlFor = _ref.htmlFor,
|
|
55
38
|
id = _ref.id,
|
|
56
39
|
testId = _ref.testId;
|
|
57
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
58
|
-
mode = _useGlobalTheme.mode;
|
|
59
40
|
return (0, _react.jsx)("label", {
|
|
60
|
-
css:
|
|
41
|
+
css: fieldsetLabelStyles,
|
|
61
42
|
id: id,
|
|
62
43
|
htmlFor: htmlFor,
|
|
63
44
|
"data-testid": testId
|
|
@@ -71,10 +52,8 @@ var Label = exports.Label = function Label(_ref) {
|
|
|
71
52
|
*/
|
|
72
53
|
var Legend = exports.Legend = function Legend(_ref2) {
|
|
73
54
|
var children = _ref2.children;
|
|
74
|
-
var _useGlobalTheme2 = (0, _components.useGlobalTheme)(),
|
|
75
|
-
mode = _useGlobalTheme2.mode;
|
|
76
55
|
return (0, _react.jsx)("legend", {
|
|
77
|
-
css:
|
|
56
|
+
css: fieldsetLabelStyles
|
|
78
57
|
}, children);
|
|
79
58
|
};
|
|
80
59
|
var _default = exports.default = Label;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -9,7 +9,6 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
var _success = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
|
|
10
10
|
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _components = require("@atlaskit/theme/components");
|
|
13
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
14
13
|
var _typography = require("@atlaskit/theme/typography");
|
|
15
14
|
var _fieldIdContext = require("./field-id-context");
|
|
@@ -31,18 +30,12 @@ var lightH200Styles = (0, _react.css)((0, _typography.h200)({
|
|
|
31
30
|
mode: 'light'
|
|
32
31
|
}
|
|
33
32
|
}));
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
35
|
-
var darkH200Styles = (0, _react.css)((0, _typography.h200)({
|
|
36
|
-
theme: {
|
|
37
|
-
mode: 'dark'
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
40
33
|
var messageStyles = (0, _react.css)({
|
|
41
34
|
display: 'flex',
|
|
42
|
-
marginTop: "var(--ds-space-050, 4px)",
|
|
43
35
|
justifyContent: 'baseline',
|
|
44
36
|
fontFamily: "".concat(fontFamily),
|
|
45
|
-
fontWeight: 'normal'
|
|
37
|
+
fontWeight: 'normal',
|
|
38
|
+
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
46
39
|
});
|
|
47
40
|
var messageAppearanceStyles = {
|
|
48
41
|
default: (0, _react.css)({
|
|
@@ -80,8 +73,6 @@ var Message = function Message(_ref2) {
|
|
|
80
73
|
appearance = _ref2$appearance === void 0 ? 'default' : _ref2$appearance,
|
|
81
74
|
fieldId = _ref2.fieldId,
|
|
82
75
|
testId = _ref2.testId;
|
|
83
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
84
|
-
mode = _useGlobalTheme.mode;
|
|
85
76
|
var icon = messageIcons[appearance];
|
|
86
77
|
|
|
87
78
|
/**
|
|
@@ -94,7 +85,7 @@ var Message = function Message(_ref2) {
|
|
|
94
85
|
*/
|
|
95
86
|
var content = typeof children === 'string' ? children : (0, _react.jsx)("span", null, children);
|
|
96
87
|
return (0, _react.jsx)("div", {
|
|
97
|
-
css: [
|
|
88
|
+
css: [lightH200Styles, messageStyles, messageAppearanceStyles[appearance]],
|
|
98
89
|
"data-testid": testId,
|
|
99
90
|
id: fieldId,
|
|
100
91
|
"aria-live": "polite"
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
6
5
|
import { h700 } from '@atlaskit/theme/typography';
|
|
7
6
|
const fontFamily = getFontFamily();
|
|
8
7
|
const formHeaderContentStyles = css({
|
|
9
8
|
minWidth: '100%',
|
|
10
|
-
|
|
9
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
11
10
|
});
|
|
12
11
|
const formHeaderDescriptionStyles = css({
|
|
13
|
-
|
|
12
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
14
13
|
});
|
|
15
14
|
const formHeaderTitleStyles = css({
|
|
16
|
-
marginTop: 0,
|
|
17
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
18
15
|
lineHeight: "var(--ds-font-lineHeight-500, 32px)",
|
|
16
|
+
marginBlockStart: 0,
|
|
17
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
19
18
|
overflow: 'hidden',
|
|
20
19
|
textOverflow: 'ellipsis',
|
|
21
20
|
whiteSpace: 'nowrap'
|
|
@@ -24,12 +23,6 @@ const formHeaderWrapperStyles = css({
|
|
|
24
23
|
fontFamily: `${fontFamily}`
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
28
|
-
const darkH700Styles = css(h700({
|
|
29
|
-
theme: {
|
|
30
|
-
mode: 'dark'
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
34
27
|
const lightH700Styles = css(h700({
|
|
35
28
|
theme: {
|
|
@@ -53,11 +46,8 @@ const FormHeaderDescription = ({
|
|
|
53
46
|
const FormHeaderTitle = ({
|
|
54
47
|
children
|
|
55
48
|
}) => {
|
|
56
|
-
const {
|
|
57
|
-
mode
|
|
58
|
-
} = useGlobalTheme();
|
|
59
49
|
return jsx("h2", {
|
|
60
|
-
css: [
|
|
50
|
+
css: [lightH700Styles, formHeaderTitleStyles]
|
|
61
51
|
}, children);
|
|
62
52
|
};
|
|
63
53
|
const FormHeaderWrapper = ({
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
import { h600 } from '@atlaskit/theme/typography';
|
|
6
5
|
const formSectionDescriptionStyles = css({
|
|
7
|
-
|
|
6
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
8
7
|
});
|
|
9
8
|
const formSectionTitleStyles = css({
|
|
10
|
-
marginTop: 0,
|
|
11
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
12
9
|
lineHeight: "var(--ds-space-400, 32px)",
|
|
10
|
+
marginBlockStart: 0,
|
|
11
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
13
12
|
overflow: 'hidden',
|
|
14
13
|
textOverflow: 'ellipsis',
|
|
15
14
|
whiteSpace: 'nowrap'
|
|
16
15
|
});
|
|
17
16
|
const formSectionWrapperStyles = css({
|
|
18
|
-
|
|
17
|
+
marginBlockStart: "var(--ds-space-300, 24px)"
|
|
19
18
|
});
|
|
20
19
|
|
|
21
20
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -24,12 +23,6 @@ const lightH600Styles = css(h600({
|
|
|
24
23
|
mode: 'light'
|
|
25
24
|
}
|
|
26
25
|
}));
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
28
|
-
const darkH600Styles = css(h600({
|
|
29
|
-
theme: {
|
|
30
|
-
mode: 'dark'
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
26
|
const FormSectionWrapper = ({
|
|
34
27
|
children
|
|
35
28
|
}) => {
|
|
@@ -40,11 +33,8 @@ const FormSectionWrapper = ({
|
|
|
40
33
|
const FormSectionTitle = ({
|
|
41
34
|
children
|
|
42
35
|
}) => {
|
|
43
|
-
const {
|
|
44
|
-
mode
|
|
45
|
-
} = useGlobalTheme();
|
|
46
36
|
return jsx("h3", {
|
|
47
|
-
css: [formSectionTitleStyles,
|
|
37
|
+
css: [formSectionTitleStyles, lightH600Styles]
|
|
48
38
|
}, children);
|
|
49
39
|
};
|
|
50
40
|
const FormSectionDescription = ({
|
package/dist/es2019/label.js
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
4
|
+
import { N200 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
7
6
|
import { h200 } from '@atlaskit/theme/typography';
|
|
8
7
|
const fontFamily = getFontFamily();
|
|
9
|
-
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
9
|
+
const fieldsetLabelStyles = css([h200({
|
|
10
|
+
theme: {
|
|
11
|
+
mode: 'light'
|
|
12
|
+
}
|
|
13
|
+
}), {
|
|
10
14
|
display: 'inline-block',
|
|
11
15
|
marginTop: 0,
|
|
12
16
|
marginBottom: "var(--ds-space-050, 4px)",
|
|
17
|
+
color: `var(--ds-text-subtle, ${N200})`,
|
|
13
18
|
fontFamily: fontFamily
|
|
14
|
-
});
|
|
15
|
-
const getFieldsetLabelDynamicStyles = mode => css([h200({
|
|
16
|
-
theme: {
|
|
17
|
-
mode
|
|
18
|
-
}
|
|
19
|
-
}), {
|
|
20
|
-
color: themed({
|
|
21
|
-
dark: `var(--ds-text-subtle, ${DN300})`,
|
|
22
|
-
light: `var(--ds-text-subtle, ${N200})`
|
|
23
|
-
})({
|
|
24
|
-
theme: {
|
|
25
|
-
mode
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
19
|
}]);
|
|
29
20
|
|
|
30
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
31
|
-
const lightH200Styles = getFieldsetLabelDynamicStyles('light');
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
34
|
-
const darkH200Styles = getFieldsetLabelDynamicStyles('dark');
|
|
35
|
-
|
|
36
21
|
/**
|
|
37
22
|
* __Label__
|
|
38
23
|
*
|
|
@@ -47,11 +32,8 @@ export const Label = ({
|
|
|
47
32
|
id,
|
|
48
33
|
testId
|
|
49
34
|
}) => {
|
|
50
|
-
const {
|
|
51
|
-
mode
|
|
52
|
-
} = useGlobalTheme();
|
|
53
35
|
return jsx("label", {
|
|
54
|
-
css:
|
|
36
|
+
css: fieldsetLabelStyles,
|
|
55
37
|
id: id,
|
|
56
38
|
htmlFor: htmlFor,
|
|
57
39
|
"data-testid": testId
|
|
@@ -66,11 +48,8 @@ export const Label = ({
|
|
|
66
48
|
export const Legend = ({
|
|
67
49
|
children
|
|
68
50
|
}) => {
|
|
69
|
-
const {
|
|
70
|
-
mode
|
|
71
|
-
} = useGlobalTheme();
|
|
72
51
|
return jsx("legend", {
|
|
73
|
-
css:
|
|
52
|
+
css: fieldsetLabelStyles
|
|
74
53
|
}, children);
|
|
75
54
|
};
|
|
76
55
|
export default Label;
|
package/dist/es2019/messages.js
CHANGED
|
@@ -4,7 +4,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
5
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
6
6
|
import { N200 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
8
7
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
9
8
|
import { h200 } from '@atlaskit/theme/typography';
|
|
10
9
|
import { FieldId } from './field-id-context';
|
|
@@ -25,18 +24,12 @@ const lightH200Styles = css(h200({
|
|
|
25
24
|
mode: 'light'
|
|
26
25
|
}
|
|
27
26
|
}));
|
|
28
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
29
|
-
const darkH200Styles = css(h200({
|
|
30
|
-
theme: {
|
|
31
|
-
mode: 'dark'
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
27
|
const messageStyles = css({
|
|
35
28
|
display: 'flex',
|
|
36
|
-
marginTop: "var(--ds-space-050, 4px)",
|
|
37
29
|
justifyContent: 'baseline',
|
|
38
30
|
fontFamily: `${fontFamily}`,
|
|
39
|
-
fontWeight: 'normal'
|
|
31
|
+
fontWeight: 'normal',
|
|
32
|
+
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
40
33
|
});
|
|
41
34
|
const messageAppearanceStyles = {
|
|
42
35
|
default: css({
|
|
@@ -75,9 +68,6 @@ const Message = ({
|
|
|
75
68
|
fieldId,
|
|
76
69
|
testId
|
|
77
70
|
}) => {
|
|
78
|
-
const {
|
|
79
|
-
mode
|
|
80
|
-
} = useGlobalTheme();
|
|
81
71
|
const icon = messageIcons[appearance];
|
|
82
72
|
|
|
83
73
|
/**
|
|
@@ -90,7 +80,7 @@ const Message = ({
|
|
|
90
80
|
*/
|
|
91
81
|
const content = typeof children === 'string' ? children : jsx("span", null, children);
|
|
92
82
|
return jsx("div", {
|
|
93
|
-
css: [
|
|
83
|
+
css: [lightH200Styles, messageStyles, messageAppearanceStyles[appearance]],
|
|
94
84
|
"data-testid": testId,
|
|
95
85
|
id: fieldId,
|
|
96
86
|
"aria-live": "polite"
|
package/dist/esm/form-header.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
6
5
|
import { h700 } from '@atlaskit/theme/typography';
|
|
7
6
|
var fontFamily = getFontFamily();
|
|
8
7
|
var formHeaderContentStyles = css({
|
|
9
8
|
minWidth: '100%',
|
|
10
|
-
|
|
9
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
11
10
|
});
|
|
12
11
|
var formHeaderDescriptionStyles = css({
|
|
13
|
-
|
|
12
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
14
13
|
});
|
|
15
14
|
var formHeaderTitleStyles = css({
|
|
16
|
-
marginTop: 0,
|
|
17
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
18
15
|
lineHeight: "var(--ds-font-lineHeight-500, 32px)",
|
|
16
|
+
marginBlockStart: 0,
|
|
17
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
19
18
|
overflow: 'hidden',
|
|
20
19
|
textOverflow: 'ellipsis',
|
|
21
20
|
whiteSpace: 'nowrap'
|
|
@@ -24,12 +23,6 @@ var formHeaderWrapperStyles = css({
|
|
|
24
23
|
fontFamily: "".concat(fontFamily)
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
28
|
-
var darkH700Styles = css(h700({
|
|
29
|
-
theme: {
|
|
30
|
-
mode: 'dark'
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
34
27
|
var lightH700Styles = css(h700({
|
|
35
28
|
theme: {
|
|
@@ -50,10 +43,8 @@ var FormHeaderDescription = function FormHeaderDescription(_ref2) {
|
|
|
50
43
|
};
|
|
51
44
|
var FormHeaderTitle = function FormHeaderTitle(_ref3) {
|
|
52
45
|
var children = _ref3.children;
|
|
53
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
54
|
-
mode = _useGlobalTheme.mode;
|
|
55
46
|
return jsx("h2", {
|
|
56
|
-
css: [
|
|
47
|
+
css: [lightH700Styles, formHeaderTitleStyles]
|
|
57
48
|
}, children);
|
|
58
49
|
};
|
|
59
50
|
var FormHeaderWrapper = function FormHeaderWrapper(_ref4) {
|
package/dist/esm/form-section.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
import { h600 } from '@atlaskit/theme/typography';
|
|
6
5
|
var formSectionDescriptionStyles = css({
|
|
7
|
-
|
|
6
|
+
marginBlockStart: "var(--ds-space-100, 8px)"
|
|
8
7
|
});
|
|
9
8
|
var formSectionTitleStyles = css({
|
|
10
|
-
marginTop: 0,
|
|
11
|
-
marginRight: "var(--ds-space-400, 32px)",
|
|
12
9
|
lineHeight: "var(--ds-space-400, 32px)",
|
|
10
|
+
marginBlockStart: 0,
|
|
11
|
+
marginInlineEnd: "var(--ds-space-400, 32px)",
|
|
13
12
|
overflow: 'hidden',
|
|
14
13
|
textOverflow: 'ellipsis',
|
|
15
14
|
whiteSpace: 'nowrap'
|
|
16
15
|
});
|
|
17
16
|
var formSectionWrapperStyles = css({
|
|
18
|
-
|
|
17
|
+
marginBlockStart: "var(--ds-space-300, 24px)"
|
|
19
18
|
});
|
|
20
19
|
|
|
21
20
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -24,12 +23,6 @@ var lightH600Styles = css(h600({
|
|
|
24
23
|
mode: 'light'
|
|
25
24
|
}
|
|
26
25
|
}));
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
28
|
-
var darkH600Styles = css(h600({
|
|
29
|
-
theme: {
|
|
30
|
-
mode: 'dark'
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
26
|
var FormSectionWrapper = function FormSectionWrapper(_ref) {
|
|
34
27
|
var children = _ref.children;
|
|
35
28
|
return jsx("div", {
|
|
@@ -38,10 +31,8 @@ var FormSectionWrapper = function FormSectionWrapper(_ref) {
|
|
|
38
31
|
};
|
|
39
32
|
var FormSectionTitle = function FormSectionTitle(_ref2) {
|
|
40
33
|
var children = _ref2.children;
|
|
41
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
42
|
-
mode = _useGlobalTheme.mode;
|
|
43
34
|
return jsx("h3", {
|
|
44
|
-
css: [formSectionTitleStyles,
|
|
35
|
+
css: [formSectionTitleStyles, lightH600Styles]
|
|
45
36
|
}, children);
|
|
46
37
|
};
|
|
47
38
|
var FormSectionDescription = function FormSectionDescription(_ref3) {
|
package/dist/esm/label.js
CHANGED
|
@@ -1,39 +1,22 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
4
|
+
import { N200 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
7
6
|
import { h200 } from '@atlaskit/theme/typography';
|
|
8
7
|
var fontFamily = getFontFamily();
|
|
9
|
-
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
9
|
+
var fieldsetLabelStyles = css([h200({
|
|
10
|
+
theme: {
|
|
11
|
+
mode: 'light'
|
|
12
|
+
}
|
|
13
|
+
}), {
|
|
10
14
|
display: 'inline-block',
|
|
11
15
|
marginTop: 0,
|
|
12
16
|
marginBottom: "var(--ds-space-050, 4px)",
|
|
17
|
+
color: "var(--ds-text-subtle, ".concat(N200, ")"),
|
|
13
18
|
fontFamily: fontFamily
|
|
14
|
-
});
|
|
15
|
-
var getFieldsetLabelDynamicStyles = function getFieldsetLabelDynamicStyles(mode) {
|
|
16
|
-
return css([h200({
|
|
17
|
-
theme: {
|
|
18
|
-
mode: mode
|
|
19
|
-
}
|
|
20
|
-
}), {
|
|
21
|
-
color: themed({
|
|
22
|
-
dark: "var(--ds-text-subtle, ".concat(DN300, ")"),
|
|
23
|
-
light: "var(--ds-text-subtle, ".concat(N200, ")")
|
|
24
|
-
})({
|
|
25
|
-
theme: {
|
|
26
|
-
mode: mode
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
}]);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
33
|
-
var lightH200Styles = getFieldsetLabelDynamicStyles('light');
|
|
34
|
-
|
|
35
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
36
|
-
var darkH200Styles = getFieldsetLabelDynamicStyles('dark');
|
|
19
|
+
}]);
|
|
37
20
|
|
|
38
21
|
/**
|
|
39
22
|
* __Label__
|
|
@@ -48,10 +31,8 @@ export var Label = function Label(_ref) {
|
|
|
48
31
|
htmlFor = _ref.htmlFor,
|
|
49
32
|
id = _ref.id,
|
|
50
33
|
testId = _ref.testId;
|
|
51
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
52
|
-
mode = _useGlobalTheme.mode;
|
|
53
34
|
return jsx("label", {
|
|
54
|
-
css:
|
|
35
|
+
css: fieldsetLabelStyles,
|
|
55
36
|
id: id,
|
|
56
37
|
htmlFor: htmlFor,
|
|
57
38
|
"data-testid": testId
|
|
@@ -65,10 +46,8 @@ export var Label = function Label(_ref) {
|
|
|
65
46
|
*/
|
|
66
47
|
export var Legend = function Legend(_ref2) {
|
|
67
48
|
var children = _ref2.children;
|
|
68
|
-
var _useGlobalTheme2 = useGlobalTheme(),
|
|
69
|
-
mode = _useGlobalTheme2.mode;
|
|
70
49
|
return jsx("legend", {
|
|
71
|
-
css:
|
|
50
|
+
css: fieldsetLabelStyles
|
|
72
51
|
}, children);
|
|
73
52
|
};
|
|
74
53
|
export default Label;
|
package/dist/esm/messages.js
CHANGED
|
@@ -4,7 +4,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
5
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
6
6
|
import { N200 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
8
7
|
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
9
8
|
import { h200 } from '@atlaskit/theme/typography';
|
|
10
9
|
import { FieldId } from './field-id-context';
|
|
@@ -25,18 +24,12 @@ var lightH200Styles = css(h200({
|
|
|
25
24
|
mode: 'light'
|
|
26
25
|
}
|
|
27
26
|
}));
|
|
28
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
29
|
-
var darkH200Styles = css(h200({
|
|
30
|
-
theme: {
|
|
31
|
-
mode: 'dark'
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
27
|
var messageStyles = css({
|
|
35
28
|
display: 'flex',
|
|
36
|
-
marginTop: "var(--ds-space-050, 4px)",
|
|
37
29
|
justifyContent: 'baseline',
|
|
38
30
|
fontFamily: "".concat(fontFamily),
|
|
39
|
-
fontWeight: 'normal'
|
|
31
|
+
fontWeight: 'normal',
|
|
32
|
+
marginBlockStart: "var(--ds-space-050, 4px)"
|
|
40
33
|
});
|
|
41
34
|
var messageAppearanceStyles = {
|
|
42
35
|
default: css({
|
|
@@ -74,8 +67,6 @@ var Message = function Message(_ref2) {
|
|
|
74
67
|
appearance = _ref2$appearance === void 0 ? 'default' : _ref2$appearance,
|
|
75
68
|
fieldId = _ref2.fieldId,
|
|
76
69
|
testId = _ref2.testId;
|
|
77
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
78
|
-
mode = _useGlobalTheme.mode;
|
|
79
70
|
var icon = messageIcons[appearance];
|
|
80
71
|
|
|
81
72
|
/**
|
|
@@ -88,7 +79,7 @@ var Message = function Message(_ref2) {
|
|
|
88
79
|
*/
|
|
89
80
|
var content = typeof children === 'string' ? children : jsx("span", null, children);
|
|
90
81
|
return jsx("div", {
|
|
91
|
-
css: [
|
|
82
|
+
css: [lightH200Styles, messageStyles, messageAppearanceStyles[appearance]],
|
|
92
83
|
"data-testid": testId,
|
|
93
84
|
id: fieldId,
|
|
94
85
|
"aria-live": "polite"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
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": "^21.12.0",
|
|
31
31
|
"@atlaskit/theme": "^12.6.0",
|
|
32
|
-
"@atlaskit/tokens": "^1.
|
|
32
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"@emotion/react": "^11.7.1",
|
|
35
35
|
"final-form": "^4.20.1",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@af/accessibility-testing": "*",
|
|
46
46
|
"@af/visual-regression": "*",
|
|
47
|
-
"@atlaskit/button": "^16.
|
|
48
|
-
"@atlaskit/checkbox": "^
|
|
47
|
+
"@atlaskit/button": "^16.13.0",
|
|
48
|
+
"@atlaskit/checkbox": "^13.0.0",
|
|
49
49
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
50
50
|
"@atlaskit/range": "^7.1.0",
|
|
51
51
|
"@atlaskit/select": "^16.7.0",
|