diff --git a/packages/components/src/components/button-toggle/button-toggle.jsx b/packages/components/src/components/button-toggle/button-toggle.jsx index fbb358d281e6..136eae29b6e7 100644 --- a/packages/components/src/components/button-toggle/button-toggle.jsx +++ b/packages/components/src/components/button-toggle/button-toggle.jsx @@ -2,8 +2,8 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import HighlightWrapper from './button-highlight-wrapper.jsx'; -import Button from '../button/button.jsx'; import Counter from '../counter/counter'; +import Button from '../button/button'; const ButtonToggle = ({ buttons_arr, className, has_rounded_button, id, is_animated, name, onChange, value }) => { const changeValue = selected_value => { diff --git a/packages/components/src/components/button/button.jsx b/packages/components/src/components/button/button.tsx similarity index 69% rename from packages/components/src/components/button/button.jsx rename to packages/components/src/components/button/button.tsx index 669161fc2312..146d22e5702e 100644 --- a/packages/components/src/components/button/button.jsx +++ b/packages/components/src/components/button/button.tsx @@ -1,11 +1,39 @@ import classNames from 'classnames'; -import PropTypes from 'prop-types'; import React from 'react'; -import ButtonLoading from './button_loading.jsx'; +import ButtonLoading from './button_loading'; import Icon from '../icon'; import Text from '../text'; -const ButtonGroup = ({ children, className }) => ( +type TButtonProps = React.PropsWithChildren> & { + alternate: boolean; + blue: boolean; + classNameSpan: string; + green: boolean; + has_effect: boolean; + icon: React.ReactNode; + is_button_toggle: boolean; + is_circular: boolean; + is_circle: boolean; + is_disabled: boolean; + is_loading: boolean; + is_plus: boolean; + is_submit_success: boolean; + large: boolean; + medium: boolean; + primary: boolean; + primary_light: boolean; + renderText: (param: React.ReactNode) => React.ReactNode; + rounded: boolean; + secondary: boolean; + small: boolean; + tertiary: boolean; + text: string; + transparent: boolean; + type: 'button' | 'submit' | 'reset'; + wrapperClassName: string; +}; + +const ButtonGroup = ({ children, className }: React.PropsWithChildren) => (
{children}
); const Button = ({ @@ -28,7 +56,7 @@ const Button = ({ medium, onClick, rounded, - tabIndex, + tabIndex = 0, text, wrapperClassName, type, @@ -41,7 +69,7 @@ const Button = ({ tertiary, renderText, ...props -}) => { +}: Partial) => { const classes = classNames( 'dc-btn', { @@ -71,9 +99,9 @@ const Button = ({