carbon-react 119.6.4 → 119.7.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/esm/__internal__/fieldset/fieldset.component.js +6 -2
- package/esm/components/checkbox/checkbox.component.js +6 -1
- package/esm/components/checkbox/checkbox.style.d.ts +1 -0
- package/esm/components/checkbox/checkbox.style.js +4 -1
- package/esm/components/radio-button/radio-button-group.component.d.ts +2 -0
- package/esm/components/radio-button/radio-button-group.component.js +56 -4
- package/esm/components/radio-button/radio-button-group.style.d.ts +1 -0
- package/esm/components/radio-button/radio-button-group.style.js +6 -0
- package/esm/components/radio-button/radio-button.component.js +28 -10
- package/esm/components/textbox/textbox.style.d.ts +1 -0
- package/esm/components/textbox/textbox.style.js +3 -2
- package/lib/__internal__/fieldset/fieldset.component.js +8 -2
- package/lib/components/checkbox/checkbox.component.js +6 -1
- package/lib/components/checkbox/checkbox.style.d.ts +1 -0
- package/lib/components/checkbox/checkbox.style.js +4 -1
- package/lib/components/radio-button/radio-button-group.component.d.ts +2 -0
- package/lib/components/radio-button/radio-button-group.component.js +58 -4
- package/lib/components/radio-button/radio-button-group.style.d.ts +1 -0
- package/lib/components/radio-button/radio-button-group.style.js +8 -1
- package/lib/components/radio-button/radio-button.component.js +27 -9
- package/lib/components/textbox/textbox.style.d.ts +1 -0
- package/lib/components/textbox/textbox.style.js +3 -2
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { StyledFieldset, StyledLegend, StyledLegendContent } from "./fieldset.style";
|
|
5
5
|
import ValidationIcon from "../validations/validation-icon.component";
|
|
6
|
+
import { NewValidationContext } from "../../components/carbon-provider/carbon-provider.component";
|
|
6
7
|
import { InputGroupBehaviour, InputGroupContext } from "../input-behaviour";
|
|
7
8
|
import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
|
|
8
9
|
const Fieldset = _ref => {
|
|
@@ -20,6 +21,9 @@ const Fieldset = _ref => {
|
|
|
20
21
|
blockGroupBehaviour,
|
|
21
22
|
...rest
|
|
22
23
|
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
validationRedesignOptIn
|
|
26
|
+
} = useContext(NewValidationContext);
|
|
23
27
|
const marginProps = useFormSpacing(rest);
|
|
24
28
|
return /*#__PURE__*/React.createElement(InputGroupBehaviour, {
|
|
25
29
|
blockGroupBehaviour: blockGroupBehaviour
|
|
@@ -39,7 +43,7 @@ const Fieldset = _ref => {
|
|
|
39
43
|
rightPadding: legendSpacing
|
|
40
44
|
}, /*#__PURE__*/React.createElement(StyledLegendContent, {
|
|
41
45
|
isRequired: isRequired
|
|
42
|
-
}, legend, /*#__PURE__*/React.createElement(ValidationIcon, {
|
|
46
|
+
}, legend, !validationRedesignOptIn && /*#__PURE__*/React.createElement(ValidationIcon, {
|
|
43
47
|
error: error,
|
|
44
48
|
warning: warning,
|
|
45
49
|
info: info,
|
|
@@ -9,6 +9,7 @@ import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
|
9
9
|
import { CheckboxGroupContext } from "./checkbox-group.component";
|
|
10
10
|
import Logger from "../../__internal__/utils/logger";
|
|
11
11
|
import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
|
|
12
|
+
import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
|
|
12
13
|
let deprecateInputRefWarnTriggered = false;
|
|
13
14
|
let deprecateUncontrolledWarnTriggered = false;
|
|
14
15
|
const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
@@ -47,6 +48,9 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
47
48
|
inputRef,
|
|
48
49
|
...rest
|
|
49
50
|
} = _ref;
|
|
51
|
+
const {
|
|
52
|
+
validationRedesignOptIn
|
|
53
|
+
} = useContext(NewValidationContext);
|
|
50
54
|
const largeScreen = useIsAboveBreakpoint(adaptiveSpacingBreakpoint);
|
|
51
55
|
const adaptiveSpacingSmallScreen = !!(adaptiveSpacingBreakpoint && !largeScreen);
|
|
52
56
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
@@ -110,7 +114,8 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
110
114
|
info: contextInfo || info,
|
|
111
115
|
fieldHelpInline: fieldHelpInline,
|
|
112
116
|
reverse: reverse,
|
|
113
|
-
size: size
|
|
117
|
+
size: size,
|
|
118
|
+
applyNewValidation: validationRedesignOptIn
|
|
114
119
|
}, marginProps), /*#__PURE__*/React.createElement(CheckableInput, inputProps, /*#__PURE__*/React.createElement(CheckboxSvg, null))));
|
|
115
120
|
});
|
|
116
121
|
Checkbox.propTypes = {
|
|
@@ -8,6 +8,7 @@ export interface StyledCheckboxProps extends ValidationProps, MarginProps {
|
|
|
8
8
|
labelSpacing?: 1 | 2;
|
|
9
9
|
reverse?: boolean;
|
|
10
10
|
adaptiveSpacingSmallScreen?: boolean;
|
|
11
|
+
applyNewValidation?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const StyledCheckbox: import("styled-components").StyledComponent<"div", any, StyledCheckboxProps, never>;
|
|
13
14
|
export default StyledCheckbox;
|
|
@@ -20,7 +20,8 @@ const StyledCheckbox = styled.div`
|
|
|
20
20
|
inputWidth,
|
|
21
21
|
reverse,
|
|
22
22
|
size,
|
|
23
|
-
adaptiveSpacingSmallScreen
|
|
23
|
+
adaptiveSpacingSmallScreen,
|
|
24
|
+
applyNewValidation
|
|
24
25
|
} = _ref;
|
|
25
26
|
return css`
|
|
26
27
|
${adaptiveSpacingSmallScreen && "margin-left: 0;"}
|
|
@@ -41,6 +42,8 @@ const StyledCheckbox = styled.div`
|
|
|
41
42
|
${info && `border: 1px solid var(--colorsSemanticInfo500);`}
|
|
42
43
|
${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
|
|
43
44
|
${error && `border: 2px solid var(--colorsSemanticNegative500);`}
|
|
45
|
+
|
|
46
|
+
${warning && applyNewValidation && `border: 1px solid var(--colorsUtilityMajor300);`}
|
|
44
47
|
`}
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -14,6 +14,8 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
|
|
|
14
14
|
labelSpacing?: 1 | 2;
|
|
15
15
|
/** The content for the RadioGroup Legend */
|
|
16
16
|
legend?: string;
|
|
17
|
+
/** The content for the hint text of the RadioGroup Legend */
|
|
18
|
+
legendHelp?: string;
|
|
17
19
|
/** Text alignment of legend when inline */
|
|
18
20
|
legendAlign?: "left" | "right";
|
|
19
21
|
/** When true, legend is placed in line with the radiobuttons */
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
import Fieldset from "../../__internal__/fieldset";
|
|
6
|
-
import RadioButtonGroupStyle from "./radio-button-group.style";
|
|
6
|
+
import RadioButtonGroupStyle, { StyledHintText } from "./radio-button-group.style";
|
|
7
7
|
import RadioButtonMapper from "../../__internal__/radio-button-mapper/radio-button-mapper.component";
|
|
8
8
|
import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint";
|
|
9
9
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
10
10
|
import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
11
11
|
import Logger from "../../__internal__/utils/logger";
|
|
12
|
+
import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
|
|
13
|
+
import ValidationMessage from "../../__internal__/validation-message/validation-message.component";
|
|
14
|
+
import Box from "../../components/box";
|
|
15
|
+
import { ErrorBorder } from "../../components/textbox/textbox.style";
|
|
12
16
|
let deprecateUncontrolledWarnTriggered = false;
|
|
13
17
|
export const RadioButtonGroup = props => {
|
|
14
18
|
const {
|
|
15
19
|
children,
|
|
16
20
|
name,
|
|
17
21
|
legend,
|
|
22
|
+
legendHelp,
|
|
18
23
|
error,
|
|
19
24
|
warning,
|
|
20
25
|
info,
|
|
@@ -32,6 +37,9 @@ export const RadioButtonGroup = props => {
|
|
|
32
37
|
required,
|
|
33
38
|
tooltipPosition
|
|
34
39
|
} = props;
|
|
40
|
+
const {
|
|
41
|
+
validationRedesignOptIn
|
|
42
|
+
} = useContext(NewValidationContext);
|
|
35
43
|
if (!deprecateUncontrolledWarnTriggered && !onChange) {
|
|
36
44
|
deprecateUncontrolledWarnTriggered = true;
|
|
37
45
|
Logger.deprecate("Uncontrolled behaviour in `Radio Button` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
@@ -47,7 +55,51 @@ export const RadioButtonGroup = props => {
|
|
|
47
55
|
if (adaptiveSpacingBreakpoint && !isAboveSpacingBreakpoint) {
|
|
48
56
|
marginLeft = undefined;
|
|
49
57
|
}
|
|
50
|
-
return /*#__PURE__*/React.createElement(
|
|
58
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, validationRedesignOptIn ? /*#__PURE__*/React.createElement(Fieldset, _extends({
|
|
59
|
+
legend: legend,
|
|
60
|
+
error: error,
|
|
61
|
+
warning: warning,
|
|
62
|
+
info: info,
|
|
63
|
+
inline: inlineLegend,
|
|
64
|
+
legendWidth: legendWidth,
|
|
65
|
+
legendAlign: legendAlign,
|
|
66
|
+
legendSpacing: legendSpacing,
|
|
67
|
+
isRequired: required
|
|
68
|
+
}, tagComponent("radiogroup", props), marginProps, {
|
|
69
|
+
ml: marginLeft,
|
|
70
|
+
blockGroupBehaviour: !(error || warning)
|
|
71
|
+
}), legendHelp && /*#__PURE__*/React.createElement(StyledHintText, null, legendHelp), /*#__PURE__*/React.createElement(Box, {
|
|
72
|
+
position: "relative"
|
|
73
|
+
}, /*#__PURE__*/React.createElement(ValidationMessage, {
|
|
74
|
+
error: error,
|
|
75
|
+
warning: warning
|
|
76
|
+
}), (error || warning) && /*#__PURE__*/React.createElement(ErrorBorder, {
|
|
77
|
+
inline: inline,
|
|
78
|
+
warning: !!(!error && warning)
|
|
79
|
+
}), /*#__PURE__*/React.createElement(RadioButtonGroupStyle, {
|
|
80
|
+
"data-component": "radio-button-group",
|
|
81
|
+
role: "radiogroup",
|
|
82
|
+
inline: inline,
|
|
83
|
+
legendInline: inlineLegend
|
|
84
|
+
}, /*#__PURE__*/React.createElement(RadioButtonMapper, {
|
|
85
|
+
name: name,
|
|
86
|
+
onBlur: onBlur,
|
|
87
|
+
onChange: onChange,
|
|
88
|
+
value: value
|
|
89
|
+
}, React.Children.map(children, child => {
|
|
90
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
91
|
+
return child;
|
|
92
|
+
}
|
|
93
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
94
|
+
inline,
|
|
95
|
+
labelSpacing,
|
|
96
|
+
error: !!error,
|
|
97
|
+
warning: !!warning,
|
|
98
|
+
info: !!info,
|
|
99
|
+
required,
|
|
100
|
+
...child.props
|
|
101
|
+
});
|
|
102
|
+
}))))) : /*#__PURE__*/React.createElement(TooltipProvider, {
|
|
51
103
|
tooltipPosition: tooltipPosition
|
|
52
104
|
}, /*#__PURE__*/React.createElement(Fieldset, _extends({
|
|
53
105
|
legend: legend,
|
|
@@ -85,7 +137,7 @@ export const RadioButtonGroup = props => {
|
|
|
85
137
|
required,
|
|
86
138
|
...child.props
|
|
87
139
|
});
|
|
88
|
-
})))));
|
|
140
|
+
}))))));
|
|
89
141
|
};
|
|
90
142
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
91
143
|
export default RadioButtonGroup;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
export const StyledHintText = styled.div`
|
|
3
|
+
margin-top: -4px;
|
|
4
|
+
margin-bottom: 8px;
|
|
5
|
+
color: var(--colorsUtilityYin055);
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
`;
|
|
2
8
|
const RadioButtonGroupStyle = styled.div`
|
|
3
9
|
${_ref => {
|
|
4
10
|
let {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React, { useCallback } from "react";
|
|
2
|
+
import React, { useCallback, useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import invariant from "invariant";
|
|
5
5
|
import RadioButtonStyle from "./radio-button.style";
|
|
@@ -8,6 +8,7 @@ import RadioButtonSvg from "./radio-button-svg.component";
|
|
|
8
8
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
9
9
|
import { TooltipProvider } from "../../__internal__/tooltip-provider";
|
|
10
10
|
import Logger from "../../__internal__/utils/logger";
|
|
11
|
+
import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
|
|
11
12
|
let deprecateInputRefWarnTriggered = false;
|
|
12
13
|
const RadioButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
13
14
|
let {
|
|
@@ -43,6 +44,9 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
43
44
|
inputRef,
|
|
44
45
|
...props
|
|
45
46
|
} = _ref;
|
|
47
|
+
const {
|
|
48
|
+
validationRedesignOptIn
|
|
49
|
+
} = useContext(NewValidationContext);
|
|
46
50
|
const marginProps = filterStyledSystemMarginProps(props);
|
|
47
51
|
const handleChange = useCallback(event => {
|
|
48
52
|
/* istanbul ignore else */
|
|
@@ -57,17 +61,24 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
57
61
|
deprecateInputRefWarnTriggered = true;
|
|
58
62
|
Logger.deprecate("The `inputRef` prop in `RadioButton` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
59
63
|
}
|
|
60
|
-
const
|
|
64
|
+
const validationProps = {
|
|
61
65
|
disabled,
|
|
62
|
-
fieldHelpInline,
|
|
63
66
|
inputWidth,
|
|
64
|
-
labelSpacing,
|
|
65
67
|
error,
|
|
66
68
|
warning,
|
|
67
69
|
info
|
|
68
70
|
};
|
|
71
|
+
const commonProps = {
|
|
72
|
+
...validationProps,
|
|
73
|
+
fieldHelpInline,
|
|
74
|
+
labelSpacing
|
|
75
|
+
};
|
|
69
76
|
const inputProps = {
|
|
70
|
-
...
|
|
77
|
+
...(validationRedesignOptIn ? {
|
|
78
|
+
...validationProps
|
|
79
|
+
} : {
|
|
80
|
+
...commonProps
|
|
81
|
+
}),
|
|
71
82
|
autoFocus,
|
|
72
83
|
checked,
|
|
73
84
|
fieldHelp,
|
|
@@ -94,17 +105,24 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
94
105
|
...props
|
|
95
106
|
};
|
|
96
107
|
!!props.children ? process.env.NODE_ENV !== "production" ? invariant(false, "This component is meant to be used as a self-closing tag. " + "You should probably use the label prop instead.") : invariant(false) : void 0;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
tooltipPosition: tooltipPosition
|
|
100
|
-
}, /*#__PURE__*/React.createElement(RadioButtonStyle, _extends({
|
|
108
|
+
const componentToRender = /*#__PURE__*/React.createElement(RadioButtonStyle, _extends({
|
|
109
|
+
applyNewValidation: validationRedesignOptIn,
|
|
101
110
|
"data-component": dataComponent,
|
|
102
111
|
"data-role": dataRole,
|
|
103
112
|
"data-element": dataElement,
|
|
104
113
|
inline: inline,
|
|
105
114
|
reverse: reverse,
|
|
106
115
|
size: size
|
|
107
|
-
},
|
|
116
|
+
}, validationRedesignOptIn ? {
|
|
117
|
+
...validationProps
|
|
118
|
+
} : {
|
|
119
|
+
...commonProps,
|
|
120
|
+
fieldHelp
|
|
121
|
+
}, marginProps), /*#__PURE__*/React.createElement(CheckableInput, inputProps, /*#__PURE__*/React.createElement(RadioButtonSvg, null)));
|
|
122
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, validationRedesignOptIn ? componentToRender : /*#__PURE__*/React.createElement(TooltipProvider, {
|
|
123
|
+
helpAriaLabel: helpAriaLabel,
|
|
124
|
+
tooltipPosition: tooltipPosition
|
|
125
|
+
}, componentToRender));
|
|
108
126
|
});
|
|
109
127
|
RadioButton.propTypes = {
|
|
110
128
|
"about": PropTypes.string,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const ErrorBorder: import("styled-components").StyledComponent<"span", any, {
|
|
2
2
|
warning: boolean;
|
|
3
|
+
inline?: boolean | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
declare const StyledInputHint: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
5
6
|
declare const StyledHintText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -2,7 +2,8 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
const ErrorBorder = styled.span`
|
|
3
3
|
${_ref => {
|
|
4
4
|
let {
|
|
5
|
-
warning
|
|
5
|
+
warning,
|
|
6
|
+
inline
|
|
6
7
|
} = _ref;
|
|
7
8
|
return css`
|
|
8
9
|
position: absolute;
|
|
@@ -10,7 +11,7 @@ const ErrorBorder = styled.span`
|
|
|
10
11
|
width: 2px;
|
|
11
12
|
background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
|
|
12
13
|
left: -12px;
|
|
13
|
-
bottom: 0px;
|
|
14
|
+
bottom: ${inline ? "10px" : "0px"};
|
|
14
15
|
top: 0px;
|
|
15
16
|
`;
|
|
16
17
|
}}
|
|
@@ -4,13 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _fieldset = require("./fieldset.style");
|
|
10
10
|
var _validationIcon = _interopRequireDefault(require("../validations/validation-icon.component"));
|
|
11
|
+
var _carbonProvider = require("../../components/carbon-provider/carbon-provider.component");
|
|
11
12
|
var _inputBehaviour = require("../input-behaviour");
|
|
12
13
|
var _useFormSpacing = _interopRequireDefault(require("../../hooks/__internal__/useFormSpacing"));
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
18
|
const Fieldset = _ref => {
|
|
16
19
|
let {
|
|
@@ -27,6 +30,9 @@ const Fieldset = _ref => {
|
|
|
27
30
|
blockGroupBehaviour,
|
|
28
31
|
...rest
|
|
29
32
|
} = _ref;
|
|
33
|
+
const {
|
|
34
|
+
validationRedesignOptIn
|
|
35
|
+
} = (0, _react.useContext)(_carbonProvider.NewValidationContext);
|
|
30
36
|
const marginProps = (0, _useFormSpacing.default)(rest);
|
|
31
37
|
return /*#__PURE__*/_react.default.createElement(_inputBehaviour.InputGroupBehaviour, {
|
|
32
38
|
blockGroupBehaviour: blockGroupBehaviour
|
|
@@ -46,7 +52,7 @@ const Fieldset = _ref => {
|
|
|
46
52
|
rightPadding: legendSpacing
|
|
47
53
|
}, /*#__PURE__*/_react.default.createElement(_fieldset.StyledLegendContent, {
|
|
48
54
|
isRequired: isRequired
|
|
49
|
-
}, legend, /*#__PURE__*/_react.default.createElement(_validationIcon.default, {
|
|
55
|
+
}, legend, !validationRedesignOptIn && /*#__PURE__*/_react.default.createElement(_validationIcon.default, {
|
|
50
56
|
error: error,
|
|
51
57
|
warning: warning,
|
|
52
58
|
info: info,
|
|
@@ -14,6 +14,7 @@ var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
|
14
14
|
var _checkboxGroup = require("./checkbox-group.component");
|
|
15
15
|
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
16
16
|
var _useFormSpacing = _interopRequireDefault(require("../../hooks/__internal__/useFormSpacing"));
|
|
17
|
+
var _carbonProvider = require("../carbon-provider/carbon-provider.component");
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -56,6 +57,9 @@ const Checkbox = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
56
57
|
inputRef,
|
|
57
58
|
...rest
|
|
58
59
|
} = _ref;
|
|
60
|
+
const {
|
|
61
|
+
validationRedesignOptIn
|
|
62
|
+
} = (0, _react.useContext)(_carbonProvider.NewValidationContext);
|
|
59
63
|
const largeScreen = (0, _useIsAboveBreakpoint.default)(adaptiveSpacingBreakpoint);
|
|
60
64
|
const adaptiveSpacingSmallScreen = !!(adaptiveSpacingBreakpoint && !largeScreen);
|
|
61
65
|
const checkboxGroupContext = (0, _react.useContext)(_checkboxGroup.CheckboxGroupContext);
|
|
@@ -119,7 +123,8 @@ const Checkbox = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
119
123
|
info: contextInfo || info,
|
|
120
124
|
fieldHelpInline: fieldHelpInline,
|
|
121
125
|
reverse: reverse,
|
|
122
|
-
size: size
|
|
126
|
+
size: size,
|
|
127
|
+
applyNewValidation: validationRedesignOptIn
|
|
123
128
|
}, marginProps), /*#__PURE__*/_react.default.createElement(_checkableInput.default, inputProps, /*#__PURE__*/_react.default.createElement(_checkboxSvg.default, null))));
|
|
124
129
|
});
|
|
125
130
|
exports.Checkbox = Checkbox;
|
|
@@ -8,6 +8,7 @@ export interface StyledCheckboxProps extends ValidationProps, MarginProps {
|
|
|
8
8
|
labelSpacing?: 1 | 2;
|
|
9
9
|
reverse?: boolean;
|
|
10
10
|
adaptiveSpacingSmallScreen?: boolean;
|
|
11
|
+
applyNewValidation?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const StyledCheckbox: import("styled-components").StyledComponent<"div", any, StyledCheckboxProps, never>;
|
|
13
14
|
export default StyledCheckbox;
|
|
@@ -29,7 +29,8 @@ const StyledCheckbox = _styledComponents.default.div`
|
|
|
29
29
|
inputWidth,
|
|
30
30
|
reverse,
|
|
31
31
|
size,
|
|
32
|
-
adaptiveSpacingSmallScreen
|
|
32
|
+
adaptiveSpacingSmallScreen,
|
|
33
|
+
applyNewValidation
|
|
33
34
|
} = _ref;
|
|
34
35
|
return (0, _styledComponents.css)`
|
|
35
36
|
${adaptiveSpacingSmallScreen && "margin-left: 0;"}
|
|
@@ -50,6 +51,8 @@ const StyledCheckbox = _styledComponents.default.div`
|
|
|
50
51
|
${info && `border: 1px solid var(--colorsSemanticInfo500);`}
|
|
51
52
|
${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
|
|
52
53
|
${error && `border: 2px solid var(--colorsSemanticNegative500);`}
|
|
54
|
+
|
|
55
|
+
${warning && applyNewValidation && `border: 1px solid var(--colorsUtilityMajor300);`}
|
|
53
56
|
`}
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -14,6 +14,8 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
|
|
|
14
14
|
labelSpacing?: 1 | 2;
|
|
15
15
|
/** The content for the RadioGroup Legend */
|
|
16
16
|
legend?: string;
|
|
17
|
+
/** The content for the hint text of the RadioGroup Legend */
|
|
18
|
+
legendHelp?: string;
|
|
17
19
|
/** Text alignment of legend when inline */
|
|
18
20
|
legendAlign?: "left" | "right";
|
|
19
21
|
/** When true, legend is placed in line with the radiobuttons */
|
|
@@ -4,17 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.RadioButtonGroup = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
10
10
|
var _fieldset = _interopRequireDefault(require("../../__internal__/fieldset"));
|
|
11
|
-
var _radioButtonGroup =
|
|
11
|
+
var _radioButtonGroup = _interopRequireWildcard(require("./radio-button-group.style"));
|
|
12
12
|
var _radioButtonMapper = _interopRequireDefault(require("../../__internal__/radio-button-mapper/radio-button-mapper.component"));
|
|
13
13
|
var _useIsAboveBreakpoint = _interopRequireDefault(require("../../hooks/__internal__/useIsAboveBreakpoint"));
|
|
14
14
|
var _utils = require("../../style/utils");
|
|
15
15
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
16
16
|
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
17
|
+
var _carbonProvider = require("../carbon-provider/carbon-provider.component");
|
|
18
|
+
var _validationMessage = _interopRequireDefault(require("../../__internal__/validation-message/validation-message.component"));
|
|
19
|
+
var _box = _interopRequireDefault(require("../../components/box"));
|
|
20
|
+
var _textbox = require("../../components/textbox/textbox.style");
|
|
17
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
24
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
25
|
let deprecateUncontrolledWarnTriggered = false;
|
|
20
26
|
const RadioButtonGroup = props => {
|
|
@@ -22,6 +28,7 @@ const RadioButtonGroup = props => {
|
|
|
22
28
|
children,
|
|
23
29
|
name,
|
|
24
30
|
legend,
|
|
31
|
+
legendHelp,
|
|
25
32
|
error,
|
|
26
33
|
warning,
|
|
27
34
|
info,
|
|
@@ -39,6 +46,9 @@ const RadioButtonGroup = props => {
|
|
|
39
46
|
required,
|
|
40
47
|
tooltipPosition
|
|
41
48
|
} = props;
|
|
49
|
+
const {
|
|
50
|
+
validationRedesignOptIn
|
|
51
|
+
} = (0, _react.useContext)(_carbonProvider.NewValidationContext);
|
|
42
52
|
if (!deprecateUncontrolledWarnTriggered && !onChange) {
|
|
43
53
|
deprecateUncontrolledWarnTriggered = true;
|
|
44
54
|
_logger.default.deprecate("Uncontrolled behaviour in `Radio Button` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
@@ -54,7 +64,51 @@ const RadioButtonGroup = props => {
|
|
|
54
64
|
if (adaptiveSpacingBreakpoint && !isAboveSpacingBreakpoint) {
|
|
55
65
|
marginLeft = undefined;
|
|
56
66
|
}
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, validationRedesignOptIn ? /*#__PURE__*/_react.default.createElement(_fieldset.default, _extends({
|
|
68
|
+
legend: legend,
|
|
69
|
+
error: error,
|
|
70
|
+
warning: warning,
|
|
71
|
+
info: info,
|
|
72
|
+
inline: inlineLegend,
|
|
73
|
+
legendWidth: legendWidth,
|
|
74
|
+
legendAlign: legendAlign,
|
|
75
|
+
legendSpacing: legendSpacing,
|
|
76
|
+
isRequired: required
|
|
77
|
+
}, (0, _tags.default)("radiogroup", props), marginProps, {
|
|
78
|
+
ml: marginLeft,
|
|
79
|
+
blockGroupBehaviour: !(error || warning)
|
|
80
|
+
}), legendHelp && /*#__PURE__*/_react.default.createElement(_radioButtonGroup.StyledHintText, null, legendHelp), /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
81
|
+
position: "relative"
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_validationMessage.default, {
|
|
83
|
+
error: error,
|
|
84
|
+
warning: warning
|
|
85
|
+
}), (error || warning) && /*#__PURE__*/_react.default.createElement(_textbox.ErrorBorder, {
|
|
86
|
+
inline: inline,
|
|
87
|
+
warning: !!(!error && warning)
|
|
88
|
+
}), /*#__PURE__*/_react.default.createElement(_radioButtonGroup.default, {
|
|
89
|
+
"data-component": "radio-button-group",
|
|
90
|
+
role: "radiogroup",
|
|
91
|
+
inline: inline,
|
|
92
|
+
legendInline: inlineLegend
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_radioButtonMapper.default, {
|
|
94
|
+
name: name,
|
|
95
|
+
onBlur: onBlur,
|
|
96
|
+
onChange: onChange,
|
|
97
|
+
value: value
|
|
98
|
+
}, _react.default.Children.map(children, child => {
|
|
99
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
100
|
+
return child;
|
|
101
|
+
}
|
|
102
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
103
|
+
inline,
|
|
104
|
+
labelSpacing,
|
|
105
|
+
error: !!error,
|
|
106
|
+
warning: !!warning,
|
|
107
|
+
info: !!info,
|
|
108
|
+
required,
|
|
109
|
+
...child.props
|
|
110
|
+
});
|
|
111
|
+
}))))) : /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
58
112
|
tooltipPosition: tooltipPosition
|
|
59
113
|
}, /*#__PURE__*/_react.default.createElement(_fieldset.default, _extends({
|
|
60
114
|
legend: legend,
|
|
@@ -92,7 +146,7 @@ const RadioButtonGroup = props => {
|
|
|
92
146
|
required,
|
|
93
147
|
...child.props
|
|
94
148
|
});
|
|
95
|
-
})))));
|
|
149
|
+
}))))));
|
|
96
150
|
};
|
|
97
151
|
exports.RadioButtonGroup = RadioButtonGroup;
|
|
98
152
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.StyledHintText = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
const StyledHintText = _styledComponents.default.div`
|
|
11
|
+
margin-top: -4px;
|
|
12
|
+
margin-bottom: 8px;
|
|
13
|
+
color: var(--colorsUtilityYin055);
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
`;
|
|
16
|
+
exports.StyledHintText = StyledHintText;
|
|
10
17
|
const RadioButtonGroupStyle = _styledComponents.default.div`
|
|
11
18
|
${_ref => {
|
|
12
19
|
let {
|
|
@@ -13,6 +13,7 @@ var _radioButtonSvg = _interopRequireDefault(require("./radio-button-svg.compone
|
|
|
13
13
|
var _utils = require("../../style/utils");
|
|
14
14
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
15
15
|
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
16
|
+
var _carbonProvider = require("../carbon-provider/carbon-provider.component");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -52,6 +53,9 @@ const RadioButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
52
53
|
inputRef,
|
|
53
54
|
...props
|
|
54
55
|
} = _ref;
|
|
56
|
+
const {
|
|
57
|
+
validationRedesignOptIn
|
|
58
|
+
} = (0, _react.useContext)(_carbonProvider.NewValidationContext);
|
|
55
59
|
const marginProps = (0, _utils.filterStyledSystemMarginProps)(props);
|
|
56
60
|
const handleChange = (0, _react.useCallback)(event => {
|
|
57
61
|
/* istanbul ignore else */
|
|
@@ -66,17 +70,24 @@ const RadioButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
66
70
|
deprecateInputRefWarnTriggered = true;
|
|
67
71
|
_logger.default.deprecate("The `inputRef` prop in `RadioButton` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
68
72
|
}
|
|
69
|
-
const
|
|
73
|
+
const validationProps = {
|
|
70
74
|
disabled,
|
|
71
|
-
fieldHelpInline,
|
|
72
75
|
inputWidth,
|
|
73
|
-
labelSpacing,
|
|
74
76
|
error,
|
|
75
77
|
warning,
|
|
76
78
|
info
|
|
77
79
|
};
|
|
80
|
+
const commonProps = {
|
|
81
|
+
...validationProps,
|
|
82
|
+
fieldHelpInline,
|
|
83
|
+
labelSpacing
|
|
84
|
+
};
|
|
78
85
|
const inputProps = {
|
|
79
|
-
...
|
|
86
|
+
...(validationRedesignOptIn ? {
|
|
87
|
+
...validationProps
|
|
88
|
+
} : {
|
|
89
|
+
...commonProps
|
|
90
|
+
}),
|
|
80
91
|
autoFocus,
|
|
81
92
|
checked,
|
|
82
93
|
fieldHelp,
|
|
@@ -103,17 +114,24 @@ const RadioButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
103
114
|
...props
|
|
104
115
|
};
|
|
105
116
|
!!props.children ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, "This component is meant to be used as a self-closing tag. " + "You should probably use the label prop instead.") : (0, _invariant.default)(false) : void 0;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
tooltipPosition: tooltipPosition
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(_radioButton.default, _extends({
|
|
117
|
+
const componentToRender = /*#__PURE__*/_react.default.createElement(_radioButton.default, _extends({
|
|
118
|
+
applyNewValidation: validationRedesignOptIn,
|
|
110
119
|
"data-component": dataComponent,
|
|
111
120
|
"data-role": dataRole,
|
|
112
121
|
"data-element": dataElement,
|
|
113
122
|
inline: inline,
|
|
114
123
|
reverse: reverse,
|
|
115
124
|
size: size
|
|
116
|
-
},
|
|
125
|
+
}, validationRedesignOptIn ? {
|
|
126
|
+
...validationProps
|
|
127
|
+
} : {
|
|
128
|
+
...commonProps,
|
|
129
|
+
fieldHelp
|
|
130
|
+
}, marginProps), /*#__PURE__*/_react.default.createElement(_checkableInput.default, inputProps, /*#__PURE__*/_react.default.createElement(_radioButtonSvg.default, null)));
|
|
131
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, validationRedesignOptIn ? componentToRender : /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
132
|
+
helpAriaLabel: helpAriaLabel,
|
|
133
|
+
tooltipPosition: tooltipPosition
|
|
134
|
+
}, componentToRender));
|
|
117
135
|
});
|
|
118
136
|
exports.RadioButton = RadioButton;
|
|
119
137
|
RadioButton.propTypes = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const ErrorBorder: import("styled-components").StyledComponent<"span", any, {
|
|
2
2
|
warning: boolean;
|
|
3
|
+
inline?: boolean | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
declare const StyledInputHint: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
5
6
|
declare const StyledHintText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -10,7 +10,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
10
10
|
const ErrorBorder = _styledComponents.default.span`
|
|
11
11
|
${_ref => {
|
|
12
12
|
let {
|
|
13
|
-
warning
|
|
13
|
+
warning,
|
|
14
|
+
inline
|
|
14
15
|
} = _ref;
|
|
15
16
|
return (0, _styledComponents.css)`
|
|
16
17
|
position: absolute;
|
|
@@ -18,7 +19,7 @@ const ErrorBorder = _styledComponents.default.span`
|
|
|
18
19
|
width: 2px;
|
|
19
20
|
background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
|
|
20
21
|
left: -12px;
|
|
21
|
-
bottom: 0px;
|
|
22
|
+
bottom: ${inline ? "10px" : "0px"};
|
|
22
23
|
top: 0px;
|
|
23
24
|
`;
|
|
24
25
|
}}
|