@mackin.com/styleguide 9.2.4 → 9.2.5

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.
Files changed (2) hide show
  1. package/index.js +10 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3640,20 +3640,21 @@ const SearchBox = React__namespace.forwardRef((props, ref) => {
3640
3640
  return props.onSubmit();
3641
3641
  });
3642
3642
  const theme = useThemeSafely();
3643
- let button;
3644
3643
  const buttonStyles = css.cx(css.css({
3645
3644
  color: `${theme.colors.font} !important;`,
3646
3645
  fontSize: '1rem'
3647
3646
  }), props.buttonClassName);
3647
+ let clearButton;
3648
3648
  if (props.onClear && !!props.value) {
3649
- button = (React__namespace.createElement(Button, { onClick: props.onClear, tabIndex: -1, disabled: waiting, className: buttonStyles, variant: "icon", small: true },
3650
- React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'clear', spin: waiting })));
3651
- }
3652
- else {
3653
- button = (React__namespace.createElement(Button, { tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: buttonStyles, variant: "icon", small: true },
3654
- React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
3655
- }
3656
- const input = (React__namespace.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, wrapperClassName: props.inputWrapperClassName, className: props.inputClassName, rightControl: button })));
3649
+ clearButton = (React__namespace.createElement(Button, { onClick: props.onClear, tabIndex: -1, disabled: waiting, className: buttonStyles, variant: "icon", small: true },
3650
+ React__namespace.createElement(Icon, { id: "clear" })));
3651
+ }
3652
+ const saveButton = (React__namespace.createElement(Button, { tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: buttonStyles, variant: "icon", small: true },
3653
+ React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
3654
+ const rightControls = clearButton ? React__namespace.createElement(React__namespace.Fragment, null,
3655
+ clearButton,
3656
+ saveButton) : saveButton;
3657
+ const input = (React__namespace.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, wrapperClassName: props.inputWrapperClassName, className: props.inputClassName, rightControl: rightControls })));
3657
3658
  const searchBoxWrapperStyles = css.cx(css.css({
3658
3659
  label: 'SearchBox'
3659
3660
  }), props.wrapperClassName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "9.2.4",
3
+ "version": "9.2.5",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",