diff --git a/package.json b/package.json index 2d5e4348..9a9e1430 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@user-interviews/ui-design-system", - "version": "3.1.1", + "version": "3.1.2", "dependencies": { "@tiptap/core": "^2.3.1", "@tiptap/extension-bold": "^2.3.1", diff --git a/src/Avatar/Avatar.tsx b/src/Avatar/Avatar.tsx index 562dad34..5e6c7863 100644 --- a/src/Avatar/Avatar.tsx +++ b/src/Avatar/Avatar.tsx @@ -16,7 +16,16 @@ type AvatarProps = { url?: string; }; -function Avatar(props: AvatarProps) { +function Avatar({ + ariaHidden, + colorId, + image, + initials, + large, + name = '', + showAlert, + url, +}: AvatarProps) { const [imageLoadFailed, setImageLoadFailed] = useState(false); function onImageLoadError() { @@ -24,10 +33,10 @@ function Avatar(props: AvatarProps) { } function wrapIfUrlPresent(content) { - if (props.url) { + if (url) { return ( @@ -38,36 +47,36 @@ function Avatar(props: AvatarProps) { return content; } - const displayImage = props.image && !imageLoadFailed; + const displayImage = image && !imageLoadFailed; const content = displayImage ? ( {props.name} ) : ( - {props.initials} + {initials} ); return (
{wrapIfUrlPresent(content)}
- {props.showAlert && ( + {showAlert && (
)}
diff --git a/src/Container/Col.tsx b/src/Container/Col.tsx index 0d381587..2c5af803 100644 --- a/src/Container/Col.tsx +++ b/src/Container/Col.tsx @@ -63,7 +63,7 @@ export const Col = ({ xl, xs, xxl, - bsPrefix, + bsPrefix = 'col', ...props }: ColProps) => ( ( ( { diff --git a/src/Dropdown/Dropdown.tsx b/src/Dropdown/Dropdown.tsx index d529bb24..5a381299 100644 --- a/src/Dropdown/Dropdown.tsx +++ b/src/Dropdown/Dropdown.tsx @@ -65,19 +65,19 @@ type DropdownProps = { } & RBDropdownProps; const Dropdown = ({ - align, + align = 'start', as, - autoClose, + autoClose = true, + bsPrefix = 'dropdown', children, className, drop, flip, focusFirstItemOnShow, - navbar, + navbar = false, onSelect, onToggle, show, - bsPrefix, ...props }: DropdownProps) => ( ( ((props, ref) => { id, leadingIcon, name, - placeholder, + placeholder = '', trailingIcon, - trailingIconLabel, + trailingIconLabel = '', trailingIconOnClick, trailingIconOnClickSubmit, trailingText, - type, + type = 'text', value, onChange, ...rest diff --git a/src/InputLabel/InputLabel.tsx b/src/InputLabel/InputLabel.tsx index 4557f858..2e7cd2e1 100644 --- a/src/InputLabel/InputLabel.tsx +++ b/src/InputLabel/InputLabel.tsx @@ -17,11 +17,11 @@ export type InputLabelProps = { } & LabelProps; const InputLabel = ({ - className, - labelHtmlFor, + className = '', + labelHtmlFor = '', text, required, - labelHelperText, + labelHelperText = '', tooltipText, ...props }: InputLabelProps) => { diff --git a/src/InputLegend/InputLegend.tsx b/src/InputLegend/InputLegend.tsx index 65dfb494..30830643 100644 --- a/src/InputLegend/InputLegend.tsx +++ b/src/InputLegend/InputLegend.tsx @@ -13,17 +13,16 @@ type LegendProps = React.DetailedHTMLProps< export type InputLegendProps = { className?: string; labelHelperText?: React.ReactNode; - labelHtmlFor?: string; required?: boolean; text: string; tooltipText?: React.ReactNode; } & LegendProps; const InputLegend = ({ - className, + className = '', text, required, - labelHelperText, + labelHelperText = '', tooltipText, ...props }: InputLegendProps) => { diff --git a/src/LoadingOverlay/LoadingOverlay.tsx b/src/LoadingOverlay/LoadingOverlay.tsx index b1c9f7fd..f92f3736 100644 --- a/src/LoadingOverlay/LoadingOverlay.tsx +++ b/src/LoadingOverlay/LoadingOverlay.tsx @@ -17,13 +17,13 @@ type LoadingOverlayProps = { }; const LoadingOverlay = ({ - contentCenterOverflow, - contentTop, + contentCenterOverflow = false, + contentTop = false, dataTestid = 'LoadingOverlay', header, text, textClassName, - visible, + visible = true, }: LoadingOverlayProps) => { // Only set style if this is not visible to let CSS handle how to display this const classes = classNames( diff --git a/src/Main/Main.tsx b/src/Main/Main.tsx index 494d79f0..5bc65515 100644 --- a/src/Main/Main.tsx +++ b/src/Main/Main.tsx @@ -24,7 +24,7 @@ const Main = ({ as = 'main', className, children, - fluid, + fluid = true, id, ...props }: MainProps) => ( diff --git a/src/Modal/Modal.tsx b/src/Modal/Modal.tsx index 3e5c20bd..7d482214 100644 --- a/src/Modal/Modal.tsx +++ b/src/Modal/Modal.tsx @@ -16,7 +16,7 @@ const Modal = ({ className, ...props }: ModalProps) => { - let componentClassName = ''; + let componentClassName = className; if (size === MODAL_SIZES.MEDIUM) { componentClassName = classNames(className, 'ReactModal--medium'); diff --git a/src/Modal/ModalFooter.tsx b/src/Modal/ModalFooter.tsx index eaa3c7c1..487bcc63 100644 --- a/src/Modal/ModalFooter.tsx +++ b/src/Modal/ModalFooter.tsx @@ -15,6 +15,14 @@ export default class ModalFooter extends Component { handleCloseClick = () => this.props.onRequestClose && this.props.onRequestClose(); + // eslint-disable-next-line react/static-property-placement + static defaultProps: { + children: undefined; + closingIsDisabled: boolean; + dismissButtonText: string; + onRequestClose: undefined; + }; + render() { return (
diff --git a/src/MoneyInput/MoneyInput.tsx b/src/MoneyInput/MoneyInput.tsx index 1172ee79..a7a32e96 100644 --- a/src/MoneyInput/MoneyInput.tsx +++ b/src/MoneyInput/MoneyInput.tsx @@ -46,10 +46,23 @@ export type MoneyInputProps = CurrencyInputProps & { }; const MoneyInput = ({ + allowDecimals = true, + allowNegativeValue = true, + disabled = false, className, + intlConfig = { locale: 'en-US', currency: 'USD' }, + prefix = '$ ', ...props }: MoneyInputProps) => ( - + ); export default MoneyInput; diff --git a/src/RadioButton/RadioButton.tsx b/src/RadioButton/RadioButton.tsx index 683510b9..83c7f211 100644 --- a/src/RadioButton/RadioButton.tsx +++ b/src/RadioButton/RadioButton.tsx @@ -17,9 +17,9 @@ type RadioButtonProps = { const RadioButton = React.forwardRef(({ checked, className, - disabled, + disabled = false, id, - name, + name = '', value, onChange, ...rest