diff --git a/packages/bpk-component-popover/index.d.ts b/packages/bpk-component-popover/index.d.ts deleted file mode 100644 index 0119b8d5fb..0000000000 --- a/packages/bpk-component-popover/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Backpack - Skyscanner's Design System - * - * Copyright 2016 Skyscanner Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import BpkPopover, { type Props } from './src/BpkPopover'; -import themeAttributes from './src/themeAttributes'; -export type BpkPopoverProps = Props; -export { themeAttributes, }; -export default BpkPopover; diff --git a/packages/bpk-component-popover/src/BpkPopover.d.ts b/packages/bpk-component-popover/src/BpkPopover.d.ts deleted file mode 100644 index 1ace549ab8..0000000000 --- a/packages/bpk-component-popover/src/BpkPopover.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Backpack - Skyscanner's Design System - * - * Copyright 2016 Skyscanner Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { SyntheticEvent, ReactNode, ReactElement } from 'react'; -import type { Placement } from '@floating-ui/react'; -declare const EVENT_SOURCES: { - CLOSE_BUTTON: string; - CLOSE_LINK: string; -}; -export type Props = { - children: ReactNode; - closeButtonText: string; - id: string; - label: string; - onClose: (event: SyntheticEvent, props: { - source: (typeof EVENT_SOURCES)[keyof typeof EVENT_SOURCES]; - }) => void; - className?: string | null; - closeButtonIcon?: boolean; - closeButtonProps?: Object; - isOpen?: boolean; - labelAsTitle?: boolean; - padded?: boolean; - placement?: Placement; - showArrow?: Boolean; - target: ReactElement; -}; -declare const BpkPopover: ({ children, className, closeButtonIcon, closeButtonProps, closeButtonText, id, isOpen, label, labelAsTitle, onClose, padded, placement, showArrow, target, ...rest }: Props) => JSX.Element; -export default BpkPopover; diff --git a/packages/bpk-component-popover/src/BpkPopover.tsx b/packages/bpk-component-popover/src/BpkPopover.tsx index 60bf5c5e42..269582feac 100644 --- a/packages/bpk-component-popover/src/BpkPopover.tsx +++ b/packages/bpk-component-popover/src/BpkPopover.tsx @@ -110,7 +110,7 @@ export type Props = CloseButtonProps & { closeButtonLabel?: string; actionText?: string; onAction?: () => void; - renderTarget?: () => HTMLElement | HTMLElement | null; + renderTarget?: () => HTMLElement | HTMLElement | undefined; }; const BpkPopover = ({ @@ -130,7 +130,7 @@ const BpkPopover = ({ onClose, padded = true, placement = 'bottom', - renderTarget = () => null, + renderTarget = () => undefined, showArrow = true, target, ...rest diff --git a/packages/bpk-component-popover/src/constants.d.ts b/packages/bpk-component-popover/src/constants.d.ts deleted file mode 100644 index 5d3368e709..0000000000 --- a/packages/bpk-component-popover/src/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Backpack - Skyscanner's Design System - * - * Copyright 2016 Skyscanner Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export declare const ARROW_ID = "js-bpk-popover-arrow"; -declare const _default: { - ARROW_ID: string; -}; -export default _default; diff --git a/packages/bpk-component-popover/src/themeAttributes.d.ts b/packages/bpk-component-popover/src/themeAttributes.d.ts deleted file mode 100644 index efbce39e8b..0000000000 --- a/packages/bpk-component-popover/src/themeAttributes.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Backpack - Skyscanner's Design System - * - * Copyright 2016 Skyscanner Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -declare const _default: any[]; -export default _default;