diff --git a/packages/shared/components/combobox/sub-components/ComboButton.tsx b/packages/shared/components/combobox/sub-components/ComboButton.tsx index 18165de80a..0d184e479a 100644 --- a/packages/shared/components/combobox/sub-components/ComboButton.tsx +++ b/packages/shared/components/combobox/sub-components/ComboButton.tsx @@ -49,25 +49,29 @@ import type { ComboButtonProps } from "../Combobox.types"; const ComboButton = (props: ComboButtonProps) => { const { - noBorder, onClick, - isDisabled, + innerContainer, - innerContainerClassName = "innerContainer", + selectedOption, optionsLength = 0, - withOptions = true, - withAdvancedOptions = false, - isOpen, - scaled = false, - size, + comboIcon, fillIcon, - modernView = false, - tabIndex, - isLoading, + type, plusBadgeValue, + noBorder = false, + isDisabled = false, + withOptions = true, + withAdvancedOptions = false, + innerContainerClassName = "innerContainer", + isOpen = false, + size = ComboBoxSize.content, + scaled = false, + modernView = false, + tabIndex = -1, + isLoading = false, } = props; const defaultOption = selectedOption?.default; @@ -174,18 +178,4 @@ const ComboButton = (props: ComboButtonProps) => { ); }; -ComboButton.defaultProps = { - noBorder: false, - isDisabled: false, - withOptions: true, - withAdvancedOptions: false, - innerContainerClassName: "innerContainer", - isOpen: false, - size: ComboBoxSize.content, - scaled: false, - modernView: false, - tabIndex: -1, - isLoading: false, -}; - export { ComboButton }; diff --git a/packages/shared/components/drop-down-item/DropDownItem.tsx b/packages/shared/components/drop-down-item/DropDownItem.tsx index 75e208d6b5..0cfcaaa09f 100644 --- a/packages/shared/components/drop-down-item/DropDownItem.tsx +++ b/packages/shared/components/drop-down-item/DropDownItem.tsx @@ -46,34 +46,43 @@ import { DropDownItemProps } from "./DropDownItem.types"; const DropDownItem = (props: DropDownItemProps) => { const { - isSeparator, - isHeader, withHeaderArrow, headerArrowAction, icon, children, - disabled, - className, - fillIcon = true, - isSubMenu, - isActive, - withoutIcon, - noHover, + className, isSelected, isActiveDescendant, isBeta, additionalElement, setOpen, + + isSeparator = false, + isHeader = false, + + disabled = false, + noHover = false, + + fillIcon = true, + isSubMenu = false, + isActive = false, + withoutIcon = false, } = props; const { t } = useTranslation(["Common"]); const theme = useTheme(); - const { withToggle, checked, onClick, onClickSelectedItem, label, ...rest } = - props; + const { + withToggle, + checked, + onClick, + onClickSelectedItem, + label = "", + ...rest + } = props; const onClickAction = ( e: React.MouseEvent | React.ChangeEvent, @@ -183,20 +192,4 @@ const DropDownItem = (props: DropDownItemProps) => { ); }; -DropDownItem.defaultProps = { - isSeparator: false, - isHeader: false, - tabIndex: -1, - label: "", - disabled: false, - noHover: false, - textOverflow: false, - fillIcon: true, - isSubMenu: false, - isActive: false, - withoutIcon: false, - height: 32, - heightTablet: 36, -}; - export { DropDownItem }; diff --git a/packages/shared/components/drop-down/index.tsx b/packages/shared/components/drop-down/index.tsx index af56e0ba2a..ce8dcb6e6b 100644 --- a/packages/shared/components/drop-down/index.tsx +++ b/packages/shared/components/drop-down/index.tsx @@ -45,6 +45,12 @@ const DropDown = (props: DropDownProps) => { eventTypes, forceCloseClickOutside, withoutBackground, + + showDisabledItems = false, + isDefaultMode = true, + fixedDirection = false, + offsetLeft = 0, + enableKeyboardEvents = true, } = props; const toggleDropDown = () => { @@ -72,17 +78,17 @@ const DropDown = (props: DropDownProps) => { withoutBackground={withoutBackground} /> ) : null} - + ); }; -DropDown.defaultProps = { - withBackdrop: true, - showDisabledItems: false, - isDefaultMode: true, - fixedDirection: false, - offsetLeft: 0, - enableKeyboardEvents: true, -}; export { DropDown }; diff --git a/packages/shared/components/email-input/EmailInput.tsx b/packages/shared/components/email-input/EmailInput.tsx index 9460f1f43a..42d5e51fb9 100644 --- a/packages/shared/components/email-input/EmailInput.tsx +++ b/packages/shared/components/email-input/EmailInput.tsx @@ -39,19 +39,33 @@ const TextInputWrapper = ({ emailSettings, customValidate, ...props -}: EmailInputProps & TextInputProps & { isValidEmail?: boolean }) => ( - -); +}: EmailInputProps & TextInputProps & { isValidEmail?: boolean }) => { + return ; +}; const EmailInput = ({ - value, onValidateInput, customValidate, - emailSettings, + onBlur, onChange, - hasError, + isAutoFocussed, + autoComplete = "email", + className = "", + hasError = undefined, + id = "", + isDisabled = false, + isReadOnly = false, + maxLength = 255, + name = "", + placeholder = "", + scale = false, + size = InputSize.base, + title = "", + withBorder = true, + value = "", + emailSettings, ...rest }: EmailInputProps) => { const [inputValue, setInputValue] = React.useState(value); @@ -65,7 +79,7 @@ const EmailInput = ({ return customValidate(v); } - const emailObj = parseAddress(v, emailSettings); + const emailObj = parseAddress(v, emailSettings ?? new EmailSettings()); const isValid = emailObj.isValid(); const parsedErrors = emailObj.parseErrors; const errors = parsedErrors @@ -124,6 +138,18 @@ const EmailInput = ({ return ( { const { id, - className, + className = "icon-button", iconName, - size, + size = 12, color, dataTip, getContent, @@ -65,7 +65,7 @@ const HelpButton = (props: HelpButtonProps) => { id={currentId} className={classNames([className], "help-icon") || "help-icon"} isClickable - iconName={iconName || InfoReactSvgUrl} + iconName={iconName ?? InfoReactSvgUrl} size={size} color={color} data-for={currentId} @@ -102,11 +102,4 @@ const HelpButton = (props: HelpButtonProps) => { ); }; -HelpButton.defaultProps = { - iconName: InfoReactSvgUrl, - // place: "top", - className: "icon-button", - size: 12, -}; - export { HelpButton }; diff --git a/packages/shared/components/link/Link.tsx b/packages/shared/components/link/Link.tsx index 40c2fcd1d8..8415357851 100644 --- a/packages/shared/components/link/Link.tsx +++ b/packages/shared/components/link/Link.tsx @@ -35,16 +35,34 @@ export { LinkType, LinkTarget }; const Link = ({ isTextOverflow, children, - noHover, - enableUserSelect, + className = "", + fontSize = "13px", + href = undefined, + isBold = false, + isHovered = false, + isSemitransparent = false, + noHover = false, + rel = "noopener noreferrer", + tabIndex = -1, + type = LinkType.page, + enableUserSelect = false, ...rest }: LinkProps) => { return (