@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.
- package/index.js +10 -9
- 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
|
-
|
|
3650
|
-
React__namespace.createElement(Icon, { id:
|
|
3651
|
-
}
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
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);
|