@televet/kibble-ui 1.12.6 → 1.12.7

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/build/index.js CHANGED
@@ -3592,12 +3592,13 @@ function withFormControl(Component) {
3592
3592
  var _b = _a.errorText, errorText = _b === void 0 ? 'Field is invalid' : _b, helperText = _a.helperText, isDisabled = _a.isDisabled, _c = _a.isFieldInline, isFieldInline = _c === void 0 ? false : _c, isInvalid = _a.isInvalid, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, label = _a.label, labelStyle = _a.labelStyle, formControlStyle = _a.formControlStyle, _d = _a.helperTextAlignment, helperTextAlignment = _d === void 0 ? 'start' : _d, props = __rest(_a, ["errorText", "helperText", "isDisabled", "isFieldInline", "isInvalid", "isReadOnly", "isRequired", "label", "labelStyle", "formControlStyle", "helperTextAlignment"]);
3593
3593
  var _e = useTheme(), colors = _e.colors, fontSizes = _e.fontSizes;
3594
3594
  var alignment = isInvalid && helperText ? 'space-between' : helperTextAlignment;
3595
+ var shouldShowBottomContent = isInvalid || helperText;
3595
3596
  return (React__default["default"].createElement(react.FormControl, __assign({}, formControlStyle, { isInvalid: isInvalid, isRequired: isRequired, isReadOnly: isReadOnly, isDisabled: isDisabled }),
3596
3597
  label && (React__default["default"].createElement(react.FormLabel, __assign({ display: isFieldInline ? 'inline-block' : 'block', color: colors.text.light.default }, labelStyle), label)),
3597
3598
  React__default["default"].createElement(Component, __assign({}, props, { "$isFieldInline": isFieldInline, errorBorderColor: colors.border.light.error, focusBorderColor: colors.border.light.focus })),
3598
- React__default["default"].createElement(react.Flex, { mt: isInvalid || helperText ? 2 : 0, w: "100%", justifyContent: alignment, alignItems: "center" },
3599
+ shouldShowBottomContent && (React__default["default"].createElement(react.Flex, { mt: 2, w: "100%", justifyContent: alignment, alignItems: "center" },
3599
3600
  React__default["default"].createElement(react.FormErrorMessage, { m: 0, fontSize: fontSizes.xs, color: colors.text.light.error }, errorText),
3600
- helperText && (React__default["default"].createElement(react.FormHelperText, { m: 0, color: isInvalid ? colors.text.light.error : colors.text.light.subtle, fontSize: fontSizes.xs }, helperText)))));
3601
+ helperText && (React__default["default"].createElement(react.FormHelperText, { m: 0, color: isInvalid ? colors.text.light.error : colors.text.light.subtle, fontSize: fontSizes.xs }, helperText))))));
3601
3602
  }
3602
3603
  WithFormControl.displayName = "withFormControl(".concat(Component.displayName || Component.name);
3603
3604
  return WithFormControl;