From 4eca5398fef14c0b40904d95c4332955f98ef95d Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Wed, 23 Nov 2022 23:07:15 -0500 Subject: [PATCH] fix(striker-ui): expose required in OutlinedInputWithLabel --- striker-ui/components/OutlinedInputWithLabel.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/striker-ui/components/OutlinedInputWithLabel.tsx b/striker-ui/components/OutlinedInputWithLabel.tsx index 05ca4c9d..9c47cb02 100644 --- a/striker-ui/components/OutlinedInputWithLabel.tsx +++ b/striker-ui/components/OutlinedInputWithLabel.tsx @@ -29,6 +29,7 @@ type OutlinedInputWithLabelOptionalProps = { onChange?: OutlinedInputProps['onChange']; onHelp?: MUIIconButtonProps['onClick']; onHelpAppend?: MUIIconButtonProps['onClick']; + required?: boolean; value?: OutlinedInputProps['value']; }; @@ -56,6 +57,7 @@ const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required< onChange: undefined, onHelp: undefined, onHelpAppend: undefined, + required: false, value: '', }; @@ -74,6 +76,7 @@ const OutlinedInputWithLabel: FC = ({ onChange, onHelp, onHelpAppend, + required = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.required, value = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.value, }) => { const { sx: formControlSx, ...restFormControlProps } = formControlProps; @@ -113,7 +116,11 @@ const OutlinedInputWithLabel: FC = ({ {...restFormControlProps} sx={{ width: formControlWidth, ...formControlSx }} > - + {label}