@televet/kibble-ui 1.12.1 → 1.12.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.
@@ -147,4 +147,13 @@ export declare const formControlArgTypes: {
147
147
  };
148
148
  };
149
149
  };
150
+ formControlStyle: {
151
+ type: string;
152
+ description: string;
153
+ table: {
154
+ type: {
155
+ summary: string;
156
+ };
157
+ };
158
+ };
150
159
  };
@@ -10,6 +10,7 @@ export interface WithFormControlProps {
10
10
  isRequired?: boolean;
11
11
  label?: string;
12
12
  labelStyle?: Dict;
13
+ formControlStyle?: Dict;
13
14
  helperTextAlignment?: 'start' | 'end';
14
15
  }
15
16
  export declare function withFormControl<P extends object>(Component: React.ComponentType<P>): React.FC<P & WithFormControlProps>;
package/build/index.js CHANGED
@@ -3589,10 +3589,10 @@ var ButtonSizeConfig = {
3589
3589
 
3590
3590
  function withFormControl(Component) {
3591
3591
  function WithFormControl(_a) {
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, _d = _a.helperTextAlignment, helperTextAlignment = _d === void 0 ? 'start' : _d, props = __rest(_a, ["errorText", "helperText", "isDisabled", "isFieldInline", "isInvalid", "isReadOnly", "isRequired", "label", "labelStyle", "helperTextAlignment"]);
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
- return (React__default["default"].createElement(react.FormControl, { isInvalid: isInvalid, isRequired: isRequired, isReadOnly: isReadOnly, isDisabled: isDisabled },
3595
+ return (React__default["default"].createElement(react.FormControl, __assign({}, formControlStyle, { isInvalid: isInvalid, isRequired: isRequired, isReadOnly: isReadOnly, isDisabled: isDisabled }),
3596
3596
  label && (React__default["default"].createElement(react.FormLabel, __assign({ display: isFieldInline ? 'inline-block' : 'block', color: colors.text.light.default }, labelStyle), label)),
3597
3597
  React__default["default"].createElement(Component, __assign({}, props, { "$isFieldInline": isFieldInline, errorBorderColor: colors.border.light.error, focusBorderColor: colors.border.light.focus })),
3598
3598
  React__default["default"].createElement(react.Flex, { mt: 2, w: "100%", justifyContent: alignment, alignItems: "center" },
@@ -3833,7 +3833,7 @@ var TextInput = withFormControl(function (props) {
3833
3833
  // the disabled styles coming from the FormControlConfig weren't getting applied to the TextInput, so they're added inline instead
3834
3834
  var leftElement = props.leftElement, rightElement = props.rightElement, inputRef = props.inputRef, domProps = __rest(props, ["leftElement", "rightElement", "inputRef"]);
3835
3835
  return (React__default["default"].createElement(react.InputGroup, null,
3836
- leftElement ? React__default["default"].createElement(react.InputLeftElement, { children: leftElement }) : null,
3836
+ leftElement ? React__default["default"].createElement(react.InputLeftElement, { children: leftElement, h: "100%" }) : null,
3837
3837
  React__default["default"].createElement(react.Input, __assign({ background: colors.background.light, _disabled: {
3838
3838
  background: colors.border.light.default,
3839
3839
  opacity: 0.4,
@@ -3843,7 +3843,7 @@ var TextInput = withFormControl(function (props) {
3843
3843
  opacity: 1,
3844
3844
  },
3845
3845
  }, ref: inputRef }, domProps)),
3846
- rightElement ? React__default["default"].createElement(react.InputRightElement, { children: rightElement }) : null));
3846
+ rightElement ? React__default["default"].createElement(react.InputRightElement, { children: rightElement, h: "100%" }) : null));
3847
3847
  });
3848
3848
  var WrappedTextInput = React.forwardRef(function (props, ref) { return (React__default["default"].createElement(TextInput, __assign({ inputRef: ref }, props))); });
3849
3849
  WrappedTextInput.displayName = 'TextInput';