carbon-react 152.2.0 → 152.2.1
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/esm/__internal__/fieldset/fieldset.component.js +2 -2
- package/esm/__internal__/fieldset/fieldset.style.js +1 -0
- package/esm/__internal__/form-field/form-field.component.js +2 -2
- package/esm/__internal__/form-field/form-field.style.js +1 -0
- package/esm/components/checkbox/checkbox-group/checkbox-group.component.js +2 -7
- package/esm/components/checkbox/checkbox.component.js +2 -2
- package/esm/components/checkbox/checkbox.style.js +1 -0
- package/esm/components/date/date.component.js +2 -3
- package/esm/components/date/date.style.js +1 -0
- package/esm/components/date-range/date-range.style.js +1 -0
- package/esm/components/fieldset/fieldset.component.js +3 -6
- package/esm/components/fieldset/fieldset.style.js +5 -0
- package/esm/components/form/form.component.js +3 -6
- package/esm/components/form/form.style.d.ts +1 -1
- package/esm/components/form/form.style.js +20 -11
- package/esm/components/inline-inputs/inline-inputs.component.js +3 -6
- package/esm/components/inline-inputs/inline-inputs.style.js +1 -0
- package/esm/components/numeral-date/numeral-date.component.js +2 -1
- package/esm/components/search/search.component.js +3 -3
- package/esm/components/search/search.style.js +1 -0
- package/esm/components/select/filterable-select/filterable-select.component.js +2 -3
- package/esm/components/select/multi-select/multi-select.component.js +2 -3
- package/esm/components/select/select.style.js +1 -0
- package/esm/components/select/simple-select/simple-select.component.js +2 -3
- package/esm/components/switch/switch.component.js +2 -2
- package/esm/components/switch/switch.style.js +1 -0
- package/esm/components/text-editor/text-editor.style.js +1 -0
- package/esm/components/textarea/textarea.component.js +4 -3
- package/esm/components/textarea/textarea.style.js +1 -0
- package/esm/components/textbox/textbox.component.js +1 -1
- package/esm/components/time/time.component.js +6 -3
- package/lib/__internal__/fieldset/fieldset.component.js +2 -2
- package/lib/__internal__/fieldset/fieldset.style.js +1 -0
- package/lib/__internal__/form-field/form-field.component.js +2 -2
- package/lib/__internal__/form-field/form-field.style.js +1 -0
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.js +2 -7
- package/lib/components/checkbox/checkbox.component.js +2 -2
- package/lib/components/checkbox/checkbox.style.js +1 -0
- package/lib/components/date/date.component.js +1 -2
- package/lib/components/date/date.style.js +1 -0
- package/lib/components/date-range/date-range.style.js +1 -0
- package/lib/components/fieldset/fieldset.component.js +3 -6
- package/lib/components/fieldset/fieldset.style.js +5 -0
- package/lib/components/form/form.component.js +3 -6
- package/lib/components/form/form.style.d.ts +1 -1
- package/lib/components/form/form.style.js +20 -11
- package/lib/components/inline-inputs/inline-inputs.component.js +3 -6
- package/lib/components/inline-inputs/inline-inputs.style.js +1 -0
- package/lib/components/numeral-date/numeral-date.component.js +2 -1
- package/lib/components/search/search.component.js +3 -3
- package/lib/components/search/search.style.js +1 -0
- package/lib/components/select/filterable-select/filterable-select.component.js +1 -2
- package/lib/components/select/multi-select/multi-select.component.js +1 -2
- package/lib/components/select/select.style.js +1 -0
- package/lib/components/select/simple-select/simple-select.component.js +1 -2
- package/lib/components/switch/switch.component.js +2 -2
- package/lib/components/switch/switch.style.js +1 -0
- package/lib/components/text-editor/text-editor.style.js +1 -0
- package/lib/components/textarea/textarea.component.js +4 -3
- package/lib/components/textarea/textarea.style.js +1 -0
- package/lib/components/textbox/textbox.component.js +1 -1
- package/lib/components/time/time.component.js +6 -3
- package/package.json +1 -1
- package/esm/__internal__/form-spacing-provider/form-spacing-provider.component.d.ts +0 -7
- package/esm/__internal__/form-spacing-provider/form-spacing-provider.component.js +0 -11
- package/esm/__internal__/form-spacing-provider/form-spacing.context.d.ts +0 -5
- package/esm/__internal__/form-spacing-provider/form-spacing.context.js +0 -2
- package/esm/__internal__/form-spacing-provider/index.d.ts +0 -3
- package/esm/__internal__/form-spacing-provider/index.js +0 -2
- package/esm/hooks/__internal__/useFormSpacing/add-form-spacing/index.d.ts +0 -3
- package/esm/hooks/__internal__/useFormSpacing/add-form-spacing/index.js +0 -27
- package/esm/hooks/__internal__/useFormSpacing/index.d.ts +0 -3
- package/esm/hooks/__internal__/useFormSpacing/index.js +0 -11
- package/lib/__internal__/form-spacing-provider/form-spacing-provider.component.d.ts +0 -7
- package/lib/__internal__/form-spacing-provider/form-spacing-provider.component.js +0 -18
- package/lib/__internal__/form-spacing-provider/form-spacing.context.d.ts +0 -5
- package/lib/__internal__/form-spacing-provider/form-spacing.context.js +0 -9
- package/lib/__internal__/form-spacing-provider/index.d.ts +0 -3
- package/lib/__internal__/form-spacing-provider/index.js +0 -20
- package/lib/__internal__/form-spacing-provider/package.json +0 -6
- package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/index.d.ts +0 -3
- package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/index.js +0 -34
- package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/package.json +0 -6
- package/lib/hooks/__internal__/useFormSpacing/index.d.ts +0 -3
- package/lib/hooks/__internal__/useFormSpacing/index.js +0 -19
- package/lib/hooks/__internal__/useFormSpacing/package.json +0 -6
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default (marginProps, formMarginBottom) => {
|
|
2
|
-
if (!formMarginBottom) {
|
|
3
|
-
return marginProps;
|
|
4
|
-
}
|
|
5
|
-
const copiedProps = {
|
|
6
|
-
...marginProps
|
|
7
|
-
};
|
|
8
|
-
const {
|
|
9
|
-
mb,
|
|
10
|
-
marginBottom,
|
|
11
|
-
mt,
|
|
12
|
-
marginTop,
|
|
13
|
-
my,
|
|
14
|
-
marginY,
|
|
15
|
-
m,
|
|
16
|
-
margin
|
|
17
|
-
} = copiedProps;
|
|
18
|
-
const hasCustomMarginBottom = [mb, marginBottom, my, marginY, m, margin].some(prop => prop !== undefined);
|
|
19
|
-
const hasCustomMarginTop = [mt, marginTop, my, marginY, m, margin].some(prop => prop !== undefined);
|
|
20
|
-
if (!hasCustomMarginBottom) {
|
|
21
|
-
copiedProps.mb = formMarginBottom;
|
|
22
|
-
}
|
|
23
|
-
if (!hasCustomMarginTop) {
|
|
24
|
-
copiedProps.mt = 0;
|
|
25
|
-
}
|
|
26
|
-
return copiedProps;
|
|
27
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { filterStyledSystemMarginProps } from "../../../style/utils";
|
|
3
|
-
import { FormSpacingContext } from "../../../__internal__/form-spacing-provider";
|
|
4
|
-
import addFormSpacing from "./add-form-spacing";
|
|
5
|
-
export default props => {
|
|
6
|
-
const {
|
|
7
|
-
marginBottom
|
|
8
|
-
} = useContext(FormSpacingContext);
|
|
9
|
-
const marginProps = addFormSpacing(filterStyledSystemMarginProps(props), marginBottom);
|
|
10
|
-
return marginProps;
|
|
11
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormSpacingContextProps } from "./form-spacing.context";
|
|
3
|
-
interface FormSpacingProviderProps extends FormSpacingContextProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
declare const FormSpacingProvider: ({ marginBottom, children, }: FormSpacingProviderProps) => React.JSX.Element;
|
|
7
|
-
export default FormSpacingProvider;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _formSpacing = require("./form-spacing.context");
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const FormSpacingProvider = ({
|
|
11
|
-
marginBottom,
|
|
12
|
-
children
|
|
13
|
-
}) => /*#__PURE__*/_react.default.createElement(_formSpacing.FormSpacingContext.Provider, {
|
|
14
|
-
value: {
|
|
15
|
-
marginBottom
|
|
16
|
-
}
|
|
17
|
-
}, children);
|
|
18
|
-
var _default = exports.default = FormSpacingProvider;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FormSpacingContext = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
const FormSpacingContext = exports.FormSpacingContext = /*#__PURE__*/_react.default.createContext({});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "FormSpacingContext", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _formSpacing.FormSpacingContext;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "default", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _formSpacingProvider.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _formSpacing = require("./form-spacing.context");
|
|
19
|
-
var _formSpacingProvider = _interopRequireDefault(require("./form-spacing-provider.component"));
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = (marginProps, formMarginBottom) => {
|
|
8
|
-
if (!formMarginBottom) {
|
|
9
|
-
return marginProps;
|
|
10
|
-
}
|
|
11
|
-
const copiedProps = {
|
|
12
|
-
...marginProps
|
|
13
|
-
};
|
|
14
|
-
const {
|
|
15
|
-
mb,
|
|
16
|
-
marginBottom,
|
|
17
|
-
mt,
|
|
18
|
-
marginTop,
|
|
19
|
-
my,
|
|
20
|
-
marginY,
|
|
21
|
-
m,
|
|
22
|
-
margin
|
|
23
|
-
} = copiedProps;
|
|
24
|
-
const hasCustomMarginBottom = [mb, marginBottom, my, marginY, m, margin].some(prop => prop !== undefined);
|
|
25
|
-
const hasCustomMarginTop = [mt, marginTop, my, marginY, m, margin].some(prop => prop !== undefined);
|
|
26
|
-
if (!hasCustomMarginBottom) {
|
|
27
|
-
copiedProps.mb = formMarginBottom;
|
|
28
|
-
}
|
|
29
|
-
if (!hasCustomMarginTop) {
|
|
30
|
-
copiedProps.mt = 0;
|
|
31
|
-
}
|
|
32
|
-
return copiedProps;
|
|
33
|
-
};
|
|
34
|
-
exports.default = _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _utils = require("../../../style/utils");
|
|
9
|
-
var _formSpacingProvider = require("../../../__internal__/form-spacing-provider");
|
|
10
|
-
var _addFormSpacing = _interopRequireDefault(require("./add-form-spacing"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var _default = props => {
|
|
13
|
-
const {
|
|
14
|
-
marginBottom
|
|
15
|
-
} = (0, _react.useContext)(_formSpacingProvider.FormSpacingContext);
|
|
16
|
-
const marginProps = (0, _addFormSpacing.default)((0, _utils.filterStyledSystemMarginProps)(props), marginBottom);
|
|
17
|
-
return marginProps;
|
|
18
|
-
};
|
|
19
|
-
exports.default = _default;
|