diff --git a/apps/scandic-web/components/ContentType/DestinationPage/TopImages/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/TopImages/index.tsx
index 77d3468c5..e59a8c60a 100644
--- a/apps/scandic-web/components/ContentType/DestinationPage/TopImages/index.tsx
+++ b/apps/scandic-web/components/ContentType/DestinationPage/TopImages/index.tsx
@@ -4,9 +4,9 @@ import { useState } from "react"
import { useIntl } from "react-intl"
import Image from "@scandic-hotels/design-system/Image"
+import Lightbox from "@scandic-hotels/design-system/Lightbox"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
-import Lightbox from "@/components/Lightbox"
import { mapImageVaultImagesToGalleryImages } from "@/utils/imageGallery"
import styles from "./topImages.module.css"
diff --git a/apps/scandic-web/components/ContentType/HotelPage/PreviewImages/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/PreviewImages/index.tsx
index 2d00eca8c..d33ec998c 100644
--- a/apps/scandic-web/components/ContentType/HotelPage/PreviewImages/index.tsx
+++ b/apps/scandic-web/components/ContentType/HotelPage/PreviewImages/index.tsx
@@ -6,8 +6,8 @@ import { useIntl } from "react-intl"
import { Button } from "@scandic-hotels/design-system/Button"
import Image from "@scandic-hotels/design-system/Image"
+import Lightbox from "@scandic-hotels/design-system/Lightbox"
-import Lightbox from "@/components/Lightbox/"
import { mapApiImagesToGalleryImages } from "@/utils/imageGallery"
import styles from "./previewImages.module.css"
diff --git a/apps/scandic-web/components/ImageGallery/index.tsx b/apps/scandic-web/components/ImageGallery/index.tsx
index e48933936..658e91171 100644
--- a/apps/scandic-web/components/ImageGallery/index.tsx
+++ b/apps/scandic-web/components/ImageGallery/index.tsx
@@ -7,10 +7,9 @@ import { useIntl } from "react-intl"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Image from "@scandic-hotels/design-system/Image"
import ImageFallback from "@scandic-hotels/design-system/ImageFallback"
+import Lightbox from "@scandic-hotels/design-system/Lightbox"
import { Typography } from "@scandic-hotels/design-system/Typography"
-import Lightbox from "@/components/Lightbox"
-
import styles from "./imageGallery.module.css"
import type { ImageGalleryProps } from "@/types/components/imageGallery"
diff --git a/apps/scandic-web/types/components/lightbox/lightbox.ts b/apps/scandic-web/types/components/lightbox/lightbox.ts
deleted file mode 100644
index 4fecfa329..000000000
--- a/apps/scandic-web/types/components/lightbox/lightbox.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import type { GalleryImage } from "../imageGallery"
-
-export interface LightboxProps {
- images: GalleryImage[]
- dialogTitle: string /* Accessible title for dialog screen readers */
- onClose: () => void
- activeIndex?: number
- hideLabel?: boolean
-}
-
-export interface GalleryProps {
- images: GalleryImage[]
- onClose: () => void
- onSelectImage: (image: GalleryImage) => void
- onImageClick: () => void
- selectedImage: GalleryImage | null
- hideLabel?: boolean
-}
-
-export interface FullViewProps {
- image: GalleryImage
- onClose: () => void
- onNext: () => void
- onPrev: () => void
- currentIndex: number
- totalImages: number
- hideLabel?: boolean
-}
diff --git a/apps/scandic-web/components/Lightbox/FullView/fullView.module.css b/packages/design-system/lib/components/Lightbox/FullView/fullView.module.css
similarity index 100%
rename from apps/scandic-web/components/Lightbox/FullView/fullView.module.css
rename to packages/design-system/lib/components/Lightbox/FullView/fullView.module.css
diff --git a/apps/scandic-web/components/Lightbox/FullView/index.tsx b/packages/design-system/lib/components/Lightbox/FullView/index.tsx
similarity index 77%
rename from apps/scandic-web/components/Lightbox/FullView/index.tsx
rename to packages/design-system/lib/components/Lightbox/FullView/index.tsx
index d18485780..7b0b78744 100644
--- a/apps/scandic-web/components/Lightbox/FullView/index.tsx
+++ b/packages/design-system/lib/components/Lightbox/FullView/index.tsx
@@ -1,17 +1,27 @@
-"use client"
+'use client'
-import { AnimatePresence, motion } from "motion/react"
-import { useEffect, useState } from "react"
-import { useIntl } from "react-intl"
+import { AnimatePresence, motion } from 'motion/react'
+import { useEffect, useState } from 'react'
+import { useIntl } from 'react-intl'
-import { IconButton } from "@scandic-hotels/design-system/IconButton"
-import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
-import Image from "@scandic-hotels/design-system/Image"
-import { Typography } from "@scandic-hotels/design-system/Typography"
+import Image from '../../Image'
-import styles from "./fullView.module.css"
+import { IconButton } from '../../IconButton'
+import { MaterialIcon } from '../../Icons/MaterialIcon'
+import { Typography } from '../../Typography'
-import type { FullViewProps } from "@/types/components/lightbox/lightbox"
+import styles from './fullView.module.css'
+import { LightboxImage } from '../index'
+
+type FullViewProps = {
+ image: LightboxImage
+ onClose: () => void
+ onNext: () => void
+ onPrev: () => void
+ currentIndex: number
+ totalImages: number
+ hideLabel?: boolean
+}
export default function FullView({
image,
@@ -41,18 +51,18 @@ export default function FullView({
}
const handleKeyDown = (e: KeyboardEvent) => {
- if (e.key === "ArrowLeft") {
+ if (e.key === 'ArrowLeft') {
handlePrev()
- } else if (e.key === "ArrowRight") {
+ } else if (e.key === 'ArrowRight') {
handleNext()
}
}
useEffect(() => {
- window.addEventListener("keydown", handleKeyDown)
+ window.addEventListener('keydown', handleKeyDown)
return () => {
- window.removeEventListener("keydown", handleKeyDown)
+ window.removeEventListener('keydown', handleKeyDown)
}
})
@@ -76,7 +86,7 @@ export default function FullView({
className={styles.closeButton}
onPress={onClose}
aria-label={intl.formatMessage({
- defaultMessage: "Close",
+ defaultMessage: 'Close',
})}
>