carbon-react 123.7.1 → 123.7.2
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.
|
@@ -156,12 +156,15 @@ const Switch = /*#__PURE__*/React.forwardRef(({
|
|
|
156
156
|
ref: ref || inputRef,
|
|
157
157
|
...rest
|
|
158
158
|
};
|
|
159
|
-
|
|
159
|
+
const applyValidation = error || warning;
|
|
160
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, validationRedesignOptIn ? /*#__PURE__*/React.createElement(StyledSwitch, switchStylePropsForNewValidation, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(Box, {
|
|
161
|
+
mb: labelHelp ? 0 : 1
|
|
162
|
+
}, label, labelHelp && /*#__PURE__*/React.createElement(StyledHintText, null, labelHelp)), /*#__PURE__*/React.createElement(Box, {
|
|
160
163
|
position: "relative"
|
|
161
164
|
}, /*#__PURE__*/React.createElement(ValidationMessage, {
|
|
162
165
|
error: error,
|
|
163
166
|
warning: warning
|
|
164
|
-
}),
|
|
167
|
+
}), applyValidation && /*#__PURE__*/React.createElement(ErrorBorder, {
|
|
165
168
|
warning: !!(!error && warning)
|
|
166
169
|
}), /*#__PURE__*/React.createElement(CheckableInput, inputPropsForNewValidation, /*#__PURE__*/React.createElement(SwitchSlider, switchSliderPropsForNewValidation))))) : /*#__PURE__*/React.createElement(TooltipProvider, {
|
|
167
170
|
helpAriaLabel: helpAriaLabel,
|
|
@@ -165,12 +165,15 @@ const Switch = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
165
165
|
ref: ref || inputRef,
|
|
166
166
|
...rest
|
|
167
167
|
};
|
|
168
|
-
|
|
168
|
+
const applyValidation = error || warning;
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, validationRedesignOptIn ? /*#__PURE__*/_react.default.createElement(_switch.default, switchStylePropsForNewValidation, /*#__PURE__*/_react.default.createElement(_label.default, null, /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
170
|
+
mb: labelHelp ? 0 : 1
|
|
171
|
+
}, label, labelHelp && /*#__PURE__*/_react.default.createElement(_switch.StyledHintText, null, labelHelp)), /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
169
172
|
position: "relative"
|
|
170
173
|
}, /*#__PURE__*/_react.default.createElement(_validationMessage.default, {
|
|
171
174
|
error: error,
|
|
172
175
|
warning: warning
|
|
173
|
-
}),
|
|
176
|
+
}), applyValidation && /*#__PURE__*/_react.default.createElement(_switch.ErrorBorder, {
|
|
174
177
|
warning: !!(!error && warning)
|
|
175
178
|
}), /*#__PURE__*/_react.default.createElement(_checkableInput.default, inputPropsForNewValidation, /*#__PURE__*/_react.default.createElement(_switchSlider.default, switchSliderPropsForNewValidation))))) : /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
176
179
|
helpAriaLabel: helpAriaLabel,
|