diff --git a/packages/design-system/src/components/Dropdown/Dropdown.tsx b/packages/design-system/src/components/Dropdown/Dropdown.tsx index 459933e6cfc..431cbbfe6a5 100644 --- a/packages/design-system/src/components/Dropdown/Dropdown.tsx +++ b/packages/design-system/src/components/Dropdown/Dropdown.tsx @@ -16,7 +16,7 @@ import DropdownDivider from './Primitive/DropdownDivider'; import DropdownLink from './Primitive/DropdownLink'; import DropdownShell from './Primitive/DropdownShell'; import DropdownTitle from './Primitive/DropdownTitle'; -import MenuButton from './Primitive/MenuButton'; +import { DropdownButton } from './Primitive/DropdownButton'; type DropdownButtonType = Omit & { label: string; @@ -104,7 +104,7 @@ export const Dropdown = ({ const { label, ...entryRest } = entry; const id = `${label}-${index}`; return ( - | KeyboardEvent) => { @@ -118,7 +118,7 @@ export const Dropdown = ({ data-test={`${menuItemTest}.${id}`} > {label} - + ); } diff --git a/packages/design-system/src/components/Dropdown/Primitive/MenuButton.tsx b/packages/design-system/src/components/Dropdown/Primitive/DropdownButton.tsx similarity index 77% rename from packages/design-system/src/components/Dropdown/Primitive/MenuButton.tsx rename to packages/design-system/src/components/Dropdown/Primitive/DropdownButton.tsx index e64ab8e692a..06edb336bd4 100644 --- a/packages/design-system/src/components/Dropdown/Primitive/MenuButton.tsx +++ b/packages/design-system/src/components/Dropdown/Primitive/DropdownButton.tsx @@ -9,12 +9,12 @@ import { getIconWithDeprecatedSupport } from '../../Icon/DeprecatedIconHelper'; import styles from './DropdownEntry.module.scss'; -export type MenuButtonType = ClickableProps & /*MenuItemProps &*/ { +export type DropdownButtonType = ClickableProps & /*MenuItemProps &*/ { icon?: DeprecatedIconNames | IconNameWithSize<'M'>; }; -const MenuButton = forwardRef( - ({ children, icon, ...props }: MenuButtonType, ref: Ref) => { +export const DropdownButton = forwardRef( + ({ children, icon, ...props }: DropdownButtonType, ref: Ref) => { return (
@@ -34,6 +34,4 @@ const MenuButton = forwardRef( }, ); -MenuButton.displayName = 'MenuButton'; - -export default MenuButton; +DropdownButton.displayName = 'DropdownButton'; diff --git a/packages/design-system/src/components/Dropdown/index.ts b/packages/design-system/src/components/Dropdown/index.ts index 2f29bad4e67..5bd11eca0bd 100644 --- a/packages/design-system/src/components/Dropdown/index.ts +++ b/packages/design-system/src/components/Dropdown/index.ts @@ -1 +1,2 @@ export * from './Dropdown'; +export * from './Primitive/DropdownButton'; diff --git a/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.js b/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.js index 31469c66253..90cd3c4a10b 100644 --- a/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.js +++ b/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.js @@ -143,5 +143,4 @@ BadgeMenuForm.propTypes = { t: PropTypes.func.isRequired, }; -// eslint-disable-next-line import/prefer-default-export export { BadgeMenuForm }; diff --git a/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.test.js b/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.test.js index ccfd7e2664c..fdd1ec717e8 100644 --- a/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.test.js +++ b/packages/faceted-search/src/components/Badges/BadgeMenu/BadgeMenuForm.component.test.js @@ -4,6 +4,8 @@ import userEvent from '@testing-library/user-event'; import { BadgeMenuForm } from './BadgeMenuForm.component'; import getDefaultT from '../../../translate'; +jest.unmock('@talend/design-system'); + const menuItems = [ { id: 'item-one', diff --git a/packages/faceted-search/src/components/BasicSearch/__snapshots__/BasicSearch.component.test.js.snap b/packages/faceted-search/src/components/BasicSearch/__snapshots__/BasicSearch.component.test.js.snap index 0d493728901..f0a6860e7e8 100644 --- a/packages/faceted-search/src/components/BasicSearch/__snapshots__/BasicSearch.component.test.js.snap +++ b/packages/faceted-search/src/components/BasicSearch/__snapshots__/BasicSearch.component.test.js.snap @@ -126,80 +126,34 @@ exports[`BasicSearch should render the default html output with no badges 1`] =
- + + + + +
{ const formatedFeature = feature.toLowerCase().replace(' ', '_');