Merged in fix/3697-prettier-configs (pull request #3396)

fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
This commit is contained in:
Rasmus Langvad
2026-01-07 12:45:50 +00:00
parent 932413412b
commit d0546926a9
500 changed files with 18367 additions and 18419 deletions

View File

@@ -1,16 +1,15 @@
import {
InfoWindow as GoogleMapsInfoWindow,
type InfoWindowProps as GoogleMapsInfoWindowProps,
} from '@vis.gl/react-google-maps'
} from "@vis.gl/react-google-maps"
import styles from './infoWindow.module.css'
import styles from "./infoWindow.module.css"
import type { MouseEventHandler } from 'react'
import type { MouseEventHandler } from "react"
interface InfoWindowProps
extends React.PropsWithChildren<
Omit<GoogleMapsInfoWindowProps, 'pixelOffset'>
> {
interface InfoWindowProps extends React.PropsWithChildren<
Omit<GoogleMapsInfoWindowProps, "pixelOffset">
> {
pixelOffsetY?: number
onMouseEnter?: MouseEventHandler<HTMLDivElement>
onMouseLeave?: MouseEventHandler<HTMLDivElement>

View File

@@ -21,7 +21,7 @@
justify-self: center;
&::after {
content: '';
content: "";
background-color: var(--Base-Surface-Primary-light-Normal);
clip-path: polygon(0 0, 50% 100%, 100% 0);
height: 12px;

View File

@@ -1,12 +1,12 @@
import { useIntl } from 'react-intl'
import { useIntl } from "react-intl"
import { formatPrice } from '@scandic-hotels/common/utils/numberFormatting'
import { MaterialIcon } from '../../../../Icons/MaterialIcon'
import { Typography } from '../../../../Typography'
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import { MaterialIcon } from "../../../../Icons/MaterialIcon"
import { Typography } from "../../../../Typography"
import HotelMarker from '../../../Markers/HotelMarker'
import HotelMarker from "../../../Markers/HotelMarker"
import styles from './hotelPin.module.css'
import styles from "./hotelPin.module.css"
interface HotelPinProps {
isActive: boolean
@@ -15,7 +15,7 @@ interface HotelPinProps {
hotelAdditionalPrice?: number
hotelAdditionalCurrency?: string
}
const NOT_AVAILABLE = '-'
const NOT_AVAILABLE = "-"
export function HotelPin({
isActive,
hotelPrice,
@@ -28,7 +28,7 @@ export function HotelPin({
return (
<div
className={`${styles.pin} ${isActive ? styles.active : ''}`}
className={`${styles.pin} ${isActive ? styles.active : ""}`}
data-hotelpin
>
<span className={styles.pinIcon}>
@@ -36,10 +36,10 @@ export function HotelPin({
<MaterialIcon
icon="calendar_clock"
size={16}
color={isActive ? 'Icon/Interactive/Default' : 'Icon/Inverted'}
color={isActive ? "Icon/Interactive/Default" : "Icon/Inverted"}
/>
) : (
<HotelMarker width={16} color={isActive ? 'burgundy' : 'white'} />
<HotelMarker width={16} color={isActive ? "burgundy" : "white"} />
)}
</span>
<Typography variant="Body/Paragraph/mdRegular">

View File

@@ -2,16 +2,16 @@ import {
AdvancedMarker,
AdvancedMarkerAnchorPoint,
InfoWindow,
} from '@vis.gl/react-google-maps'
import { useMediaQuery } from 'usehooks-ts'
} from "@vis.gl/react-google-maps"
import { useMediaQuery } from "usehooks-ts"
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
import { Lang } from '@scandic-hotels/common/constants/language'
import { useIntl } from 'react-intl'
import { StandaloneHotelCardDialog } from '../../../HotelCard/HotelDialogCard/StandaloneHotelCardDialog'
import type { HotelPin as HotelPinType } from '../../types'
import styles from './hotelListingMapContent.module.css'
import { HotelPin } from './HotelPin'
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { Lang } from "@scandic-hotels/common/constants/language"
import { useIntl } from "react-intl"
import { StandaloneHotelCardDialog } from "../../../HotelCard/HotelDialogCard/StandaloneHotelCardDialog"
import type { HotelPin as HotelPinType } from "../../types"
import styles from "./hotelListingMapContent.module.css"
import { HotelPin } from "./HotelPin"
export type HotelListingMapContentProps = {
hotelPins: HotelPinType[]
@@ -38,7 +38,7 @@ export function HotelListingMapContent({
pointsCurrency,
}: HotelListingMapContentProps) {
const intl = useIntl()
const isDesktop = useMediaQuery('(min-width: 900px)')
const isDesktop = useMediaQuery("(min-width: 900px)")
const toggleActiveHotelPin = (
args: { hotelName: string; hotelId: string } | null
@@ -66,8 +66,8 @@ export function HotelListingMapContent({
const pinCurrency = pin.redemptionPrice
? intl.formatMessage({
id: 'common.points',
defaultMessage: 'Points',
id: "common.points",
defaultMessage: "Points",
})
: pin.currency

View File

@@ -1,14 +1,14 @@
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
// import { expect, fn } from 'storybook/test'
import { Lang } from '@scandic-hotels/common/constants/language'
import { APIProvider } from '@vis.gl/react-google-maps'
import { useState } from 'react'
import { InteractiveMap } from '.'
import { hotelPins } from './storybookData'
import { Lang } from "@scandic-hotels/common/constants/language"
import { APIProvider } from "@vis.gl/react-google-maps"
import { useState } from "react"
import { InteractiveMap } from "."
import { hotelPins } from "./storybookData"
const meta: Meta<typeof InteractiveMap> = {
title: 'Patterns/Map/Interactive Map',
title: "Patterns/Map/Interactive Map",
component: InteractiveMap,
argTypes: {},
}
@@ -32,7 +32,7 @@ export const PrimaryDefault: Story = {
const mapId = import.meta.env.VITE_GOOGLE_DYNAMIC_MAP_ID
if (!mapKey || !mapId) {
throw new Error(
'VITE_GOOGLE_STATIC_MAP_KEY or VITE_GOOGLE_DYNAMIC_MAP_ID is not defined in your .env file. Please add it to run this story.'
"VITE_GOOGLE_STATIC_MAP_KEY or VITE_GOOGLE_DYNAMIC_MAP_ID is not defined in your .env file. Please add it to run this story."
)
}
@@ -44,8 +44,8 @@ export const PrimaryDefault: Story = {
<div
style={
{
'--hotel-map-height': '300px',
height: 'max(500px, 90vh)',
"--hotel-map-height": "300px",
height: "max(500px, 90vh)",
} as React.CSSProperties
}
>

View File

@@ -1,16 +1,16 @@
import {
AdvancedMarker,
AdvancedMarkerAnchorPoint,
} from '@vis.gl/react-google-maps'
import { useIntl } from 'react-intl'
} from "@vis.gl/react-google-maps"
import { useIntl } from "react-intl"
import { Typography } from '../../../Typography'
import { Typography } from "../../../Typography"
import { HotelMarkerByType } from '../../Markers/HotelMarkerByType'
import { PoiMarker } from '../../Markers/PoiMarker'
import { HotelMarkerByType } from "../../Markers/HotelMarkerByType"
import { PoiMarker } from "../../Markers/PoiMarker"
import styles from './poiMapMarkers.module.css'
import { MarkerInfo, PointOfInterest } from '../../types'
import styles from "./poiMapMarkers.module.css"
import { MarkerInfo, PointOfInterest } from "../../types"
export type PoiMapMarkersProps = {
activePoi?: string | null
@@ -50,15 +50,15 @@ export default function PoiMapMarkers({
zIndex={activePoi === poi.id ? 2 : 0}
onMouseEnter={() => onActivePoiChange?.(poi.id ?? null)}
onMouseLeave={() => onActivePoiChange?.(null)}
onClick={() => toggleActivePoi(poi.id ?? '')}
onClick={() => toggleActivePoi(poi.id ?? "")}
>
<span
className={`${styles.poi} ${activePoi === poi.id ? styles.active : ''}`}
className={`${styles.poi} ${activePoi === poi.id ? styles.active : ""}`}
>
<PoiMarker
group={poi.group}
categoryName={poi.categoryName}
size={activePoi === poi.id ? 'large' : 'small'}
size={activePoi === poi.id ? "large" : "small"}
/>
<span className={styles.poiLabel}>
<Typography variant="Body/Paragraph/mdRegular">
@@ -71,8 +71,8 @@ export default function PoiMapMarkers({
<span>
{intl.formatMessage(
{
id: 'common.distanceKm',
defaultMessage: '{distanceInKm} km',
id: "common.distanceKm",
defaultMessage: "{distanceInKm} km",
},
{
distanceInKm: poi.distance,

View File

@@ -1,23 +1,23 @@
'use client'
"use client"
import { Map, type MapProps, useMap } from '@vis.gl/react-google-maps'
import { useEffect, useState } from 'react'
import { useIntl } from 'react-intl'
import { Map, type MapProps, useMap } from "@vis.gl/react-google-maps"
import { useEffect, useState } from "react"
import { useIntl } from "react-intl"
import { IconButton } from '../../IconButton'
import { IconButton } from "../../IconButton"
import { HOTEL_PAGE, MAP_RESTRICTIONS } from '../mapConstants'
import { HOTEL_PAGE, MAP_RESTRICTIONS } from "../mapConstants"
import { useZoomControls } from '@scandic-hotels/common/hooks/map/useZoomControls'
import { useZoomControls } from "@scandic-hotels/common/hooks/map/useZoomControls"
import { HotelListingMapContent } from './HotelListingMapContent'
import PoiMapMarkers from './PoiMapMarkers'
import { HotelListingMapContent } from "./HotelListingMapContent"
import PoiMapMarkers from "./PoiMapMarkers"
import styles from './interactiveMap.module.css'
import styles from "./interactiveMap.module.css"
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
import { Lang } from '@scandic-hotels/common/constants/language'
import { HotelPin, MarkerInfo, PointOfInterest } from '../types'
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { Lang } from "@scandic-hotels/common/constants/language"
import { HotelPin, MarkerInfo, PointOfInterest } from "../types"
export type InteractiveMapProps = {
lang: Lang
@@ -94,7 +94,7 @@ export function InteractiveMap({
disableDefaultUI: true,
clickableIcons: false,
mapId,
gestureHandling: 'greedy',
gestureHandling: "greedy",
restriction: MAP_RESTRICTIONS,
}
@@ -145,8 +145,8 @@ export function InteractiveMap({
className={styles.zoomButton}
onClick={zoomOut}
aria-label={intl.formatMessage({
id: 'map.zoomOut',
defaultMessage: 'Zoom out',
id: "map.zoomOut",
defaultMessage: "Zoom out",
})}
isDisabled={isMinZoom}
iconName="remove"
@@ -157,8 +157,8 @@ export function InteractiveMap({
className={styles.zoomButton}
onClick={zoomIn}
aria-label={intl.formatMessage({
id: 'map.zoomIn',
defaultMessage: 'Zoom in',
id: "map.zoomIn",
defaultMessage: "Zoom in",
})}
isDisabled={isMaxZoom}
iconName="add"

View File

@@ -6,7 +6,7 @@
z-index: 0;
&::after {
content: '';
content: "";
position: absolute;
top: 0;
right: 0;

View File

@@ -1,5 +1,5 @@
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
import { HotelPin } from '../types'
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { HotelPin } from "../types"
export const hotelPins: HotelPin[] = [
{
@@ -7,65 +7,65 @@ export const hotelPins: HotelPin[] = [
lat: 59.331303,
lng: 18.065542,
},
name: 'Downtown Camper by Scandic',
name: "Downtown Camper by Scandic",
chequePrice: null,
publicPrice: 1100,
memberPrice: 1067,
redemptionPrice: null,
voucherPrice: null,
rateType: 'Regular',
currency: 'SEK',
rateType: "Regular",
currency: "SEK",
amenities: [
{
filter: 'Hotel facilities',
icon: 'Pool',
filter: "Hotel facilities",
icon: "Pool",
id: 1831,
name: 'Pool',
name: "Pool",
public: true,
sortOrder: 7000,
slug: 'pool',
slug: "pool",
},
{
filter: 'Hotel facilities',
icon: 'Restaurant',
filter: "Hotel facilities",
icon: "Restaurant",
id: 1383,
name: 'Restaurant',
name: "Restaurant",
public: true,
sortOrder: 6000,
slug: 'restaurant',
slug: "restaurant",
},
{
filter: 'None',
icon: 'KayaksForLoan',
filter: "None",
icon: "KayaksForLoan",
id: 162585,
name: 'Kayaks for loan',
name: "Kayaks for loan",
public: true,
sortOrder: 5000,
slug: 'kayaks-for-loan',
slug: "kayaks-for-loan",
},
{
filter: 'Hotel facilities',
icon: 'None',
filter: "Hotel facilities",
icon: "None",
id: 239348,
name: 'Rooftop bar',
name: "Rooftop bar",
public: false,
sortOrder: 4000,
slug: 'rooftop-bar',
slug: "rooftop-bar",
},
{
filter: 'None',
icon: 'BikesForLoan',
filter: "None",
icon: "BikesForLoan",
id: 5550,
name: 'Bikes for loan',
name: "Bikes for loan",
public: true,
sortOrder: 3000,
slug: 'bikes-for-loan',
slug: "bikes-for-loan",
},
],
ratings: {
tripAdvisor: 4.4,
},
operaId: '879',
operaId: "879",
facilityIds: [
1831, 1383, 162585, 239348, 5550, 162586, 5806, 1014, 1835, 1829, 1379,
1382, 162587, 1017, 1378, 1408, 1833, 971, 1834, 162584, 1381, 229144,
@@ -73,8 +73,8 @@ export const hotelPins: HotelPin[] = [
],
hasEnoughPoints: false,
image: {
alt: 'Bar of Downtown Camper by Scandic in Stockholm',
url: 'https://images-test.scandichotels.com/publishedmedia/p0ffjkfyfnx502knqlxo/Scandic_Downtown_Camper_spa_wellness_the_nest_swim.jpg',
alt: "Bar of Downtown Camper by Scandic in Stockholm",
url: "https://images-test.scandichotels.com/publishedmedia/p0ffjkfyfnx502knqlxo/Scandic_Downtown_Camper_spa_wellness_the_nest_swim.jpg",
},
},
{
@@ -82,73 +82,73 @@ export const hotelPins: HotelPin[] = [
lat: 59.33469,
lng: 18.061586,
},
name: 'Haymarket by Scandic',
name: "Haymarket by Scandic",
chequePrice: null,
publicPrice: null,
memberPrice: 9999,
redemptionPrice: null,
voucherPrice: null,
rateType: 'Regular',
currency: 'SEK',
rateType: "Regular",
currency: "SEK",
amenities: [
{
filter: 'Hotel facilities',
icon: 'Restaurant',
filter: "Hotel facilities",
icon: "Restaurant",
id: 1383,
name: 'Restaurant',
name: "Restaurant",
public: true,
sortOrder: 6000,
slug: 'restaurant',
slug: "restaurant",
},
{
filter: 'None',
icon: 'None',
filter: "None",
icon: "None",
id: 5806,
name: 'Meeting / conference facilities',
name: "Meeting / conference facilities",
public: true,
sortOrder: 1500,
slug: 'meeting-conference-facilities',
slug: "meeting-conference-facilities",
},
{
filter: 'Hotel facilities',
icon: 'Bar',
filter: "Hotel facilities",
icon: "Bar",
id: 1014,
name: 'Bar',
name: "Bar",
public: true,
sortOrder: 1401,
slug: 'bar',
slug: "bar",
},
{
filter: 'Hotel facilities',
icon: 'PetFriendlyRooms',
filter: "Hotel facilities",
icon: "PetFriendlyRooms",
id: 1835,
name: 'Pet-friendly rooms',
name: "Pet-friendly rooms",
public: true,
sortOrder: 1201,
slug: 'pet-friendly-rooms',
slug: "pet-friendly-rooms",
},
{
filter: 'Hotel facilities',
icon: 'Gym',
filter: "Hotel facilities",
icon: "Gym",
id: 1829,
name: 'Gym',
name: "Gym",
public: true,
sortOrder: 1101,
slug: 'gym',
slug: "gym",
},
],
ratings: {
tripAdvisor: 4.1,
},
operaId: '890',
operaId: "890",
facilityIds: [
1383, 5806, 1014, 1835, 1829, 1382, 162587, 1017, 1833, 971, 1834, 1381,
1406, 1913, 345180, 375885,
],
hasEnoughPoints: false,
image: {
alt: 'Bar',
url: 'https://images-test.scandichotels.com/publishedmedia/lr2b7r655xl0sjcbgxt9/haymarket-by-scandic-bar-pauls_-3-.jpg',
alt: "Bar",
url: "https://images-test.scandichotels.com/publishedmedia/lr2b7r655xl0sjcbgxt9/haymarket-by-scandic-bar-pauls_-3-.jpg",
},
},
{
@@ -156,7 +156,7 @@ export const hotelPins: HotelPin[] = [
lat: 59.337166,
lng: 18.072765,
},
name: 'Scandic Anglais',
name: "Scandic Anglais",
chequePrice: {
numberOfCheques: 1,
additionalPricePerStay: 500,
@@ -166,67 +166,67 @@ export const hotelPins: HotelPin[] = [
memberPrice: null,
redemptionPrice: null,
voucherPrice: null,
rateType: 'Regular',
currency: 'CC',
rateType: "Regular",
currency: "CC",
amenities: [
{
filter: 'Hotel facilities',
icon: 'Restaurant',
filter: "Hotel facilities",
icon: "Restaurant",
id: 1383,
name: 'Restaurant',
name: "Restaurant",
public: true,
sortOrder: 6000,
slug: 'restaurant',
slug: "restaurant",
},
{
filter: 'Hotel facilities',
icon: 'None',
filter: "Hotel facilities",
icon: "None",
id: 239348,
name: 'Rooftop bar',
name: "Rooftop bar",
public: false,
sortOrder: 4000,
slug: 'rooftop-bar',
slug: "rooftop-bar",
},
{
filter: 'None',
icon: 'BikesForLoan',
filter: "None",
icon: "BikesForLoan",
id: 5550,
name: 'Bikes for loan',
name: "Bikes for loan",
public: true,
sortOrder: 3000,
slug: 'bikes-for-loan',
slug: "bikes-for-loan",
},
{
filter: 'None',
icon: 'None',
filter: "None",
icon: "None",
id: 5806,
name: 'Meeting / conference facilities',
name: "Meeting / conference facilities",
public: true,
sortOrder: 1500,
slug: 'meeting-conference-facilities',
slug: "meeting-conference-facilities",
},
{
filter: 'Hotel facilities',
icon: 'Bar',
filter: "Hotel facilities",
icon: "Bar",
id: 1014,
name: 'Bar',
name: "Bar",
public: true,
sortOrder: 1401,
slug: 'bar',
slug: "bar",
},
],
ratings: {
tripAdvisor: 3.6,
},
operaId: '810',
operaId: "810",
facilityIds: [
1383, 239348, 5550, 5806, 1014, 1835, 1829, 1379, 2665, 1382, 162587,
1017, 1408, 1833, 971, 1834, 1405, 1406, 956, 1913,
],
hasEnoughPoints: false,
image: {
alt: 'lobby at scandic anglais in stockholm',
url: 'https://images-test.scandichotels.com/publishedmedia/wi0lzgxhbm4vmfguf7wm/scandic-anglais-lobby6.jpg',
alt: "lobby at scandic anglais in stockholm",
url: "https://images-test.scandichotels.com/publishedmedia/wi0lzgxhbm4vmfguf7wm/scandic-anglais-lobby6.jpg",
},
},
{
@@ -234,73 +234,73 @@ export const hotelPins: HotelPin[] = [
lat: 59.33099,
lng: 18.05926,
},
name: 'Scandic Continental',
name: "Scandic Continental",
chequePrice: null,
publicPrice: null,
memberPrice: null,
redemptionPrice: 65000,
voucherPrice: null,
rateType: 'Regular',
currency: 'Points',
rateType: "Regular",
currency: "Points",
amenities: [
{
filter: 'None',
icon: 'BikesForLoan',
filter: "None",
icon: "BikesForLoan",
id: 5550,
name: 'Bikes for loan',
name: "Bikes for loan",
public: true,
sortOrder: 3000,
slug: 'bikes-for-loan',
slug: "bikes-for-loan",
},
{
filter: 'None',
icon: 'None',
filter: "None",
icon: "None",
id: 5806,
name: 'Meeting / conference facilities',
name: "Meeting / conference facilities",
public: true,
sortOrder: 1500,
slug: 'meeting-conference-facilities',
slug: "meeting-conference-facilities",
},
{
filter: 'Hotel facilities',
icon: 'PetFriendlyRooms',
filter: "Hotel facilities",
icon: "PetFriendlyRooms",
id: 1835,
name: 'Pet-friendly rooms',
name: "Pet-friendly rooms",
public: true,
sortOrder: 1201,
slug: 'pet-friendly-rooms',
slug: "pet-friendly-rooms",
},
{
filter: 'Hotel facilities',
icon: 'Gym',
filter: "Hotel facilities",
icon: "Gym",
id: 1829,
name: 'Gym',
name: "Gym",
public: true,
sortOrder: 1101,
slug: 'gym',
slug: "gym",
},
{
filter: 'Hotel facilities',
icon: 'Sauna',
filter: "Hotel facilities",
icon: "Sauna",
id: 1379,
name: 'Sauna',
name: "Sauna",
public: true,
sortOrder: 1001,
slug: 'sauna',
slug: "sauna",
},
],
ratings: {
tripAdvisor: 4.2,
},
operaId: '811',
operaId: "811",
facilityIds: [
5550, 5806, 1835, 1829, 1379, 2665, 1606, 1382, 1017, 1378, 1408, 1833,
971, 1834, 162583, 1406, 1607, 1911, 1913, 229144,
],
hasEnoughPoints: false,
image: {
alt: 'Exterior',
url: 'https://images-test.scandichotels.com/publishedmedia/xnvuuzvogv7dzt3nmxit/Scandic_Continental_Exterior_Vasagatan_Day.jpg',
alt: "Exterior",
url: "https://images-test.scandichotels.com/publishedmedia/xnvuuzvogv7dzt3nmxit/Scandic_Continental_Exterior_Vasagatan_Day.jpg",
},
},
{
@@ -308,72 +308,72 @@ export const hotelPins: HotelPin[] = [
lat: 59.323063,
lng: 18.069921,
},
name: 'Scandic Gamla Stan',
name: "Scandic Gamla Stan",
chequePrice: null,
publicPrice: null,
memberPrice: null,
redemptionPrice: null,
voucherPrice: 1,
rateType: 'Regular',
currency: 'Voucher',
rateType: "Regular",
currency: "Voucher",
amenities: [
{
filter: 'Hotel facilities',
icon: 'PetFriendlyRooms',
filter: "Hotel facilities",
icon: "PetFriendlyRooms",
id: 1835,
name: 'Pet-friendly rooms',
name: "Pet-friendly rooms",
public: true,
sortOrder: 1201,
slug: 'pet-friendly-rooms',
slug: "pet-friendly-rooms",
},
{
filter: 'Hotel facilities',
icon: 'OutdoorTerrace',
filter: "Hotel facilities",
icon: "OutdoorTerrace",
id: 1382,
name: 'Outdoor terrace',
name: "Outdoor terrace",
public: true,
sortOrder: 550,
slug: 'outdoor-terrace',
slug: "outdoor-terrace",
},
{
filter: 'None',
icon: 'Shop',
filter: "None",
icon: "Shop",
id: 1408,
name: 'Scandic Shop 24 hrs',
name: "Scandic Shop 24 hrs",
public: true,
sortOrder: 301,
slug: 'scandic-shop-24-hrs',
slug: "scandic-shop-24-hrs",
},
{
filter: 'None',
icon: 'FreeWiFi',
filter: "None",
icon: "FreeWiFi",
id: 1833,
name: 'Free WiFi',
name: "Free WiFi",
public: true,
sortOrder: 250,
slug: 'free-wifi',
slug: "free-wifi",
},
{
filter: 'None',
icon: 'LaundryService',
filter: "None",
icon: "LaundryService",
id: 1834,
name: 'Laundry service',
name: "Laundry service",
public: true,
sortOrder: 199,
slug: 'laundry-service',
slug: "laundry-service",
},
],
ratings: {
tripAdvisor: 4.2,
},
operaId: '821',
operaId: "821",
facilityIds: [
1835, 1382, 1408, 1833, 1834, 1405, 345180, 332224, 375885, 238849,
],
hasEnoughPoints: false,
image: {
alt: 'Facade Entrance Scandic Gamla Stan Stockholm',
url: 'https://images-test.scandichotels.com/publishedmedia/9attpqkkfy6uwc6keyvg/Scandic-Gamla-Stan-Exterior-facade.jpg',
alt: "Facade Entrance Scandic Gamla Stan Stockholm",
url: "https://images-test.scandichotels.com/publishedmedia/9attpqkkfy6uwc6keyvg/Scandic-Gamla-Stan-Exterior-facade.jpg",
},
},
]

View File

@@ -1,11 +1,11 @@
import { hotelMarkerVariants } from './variants'
import { hotelMarkerVariants } from "./variants"
export default function HotelMarker({
className,
color,
...props
}: React.SVGAttributes<HTMLOrSVGElement> & {
color?: 'burgundy' | 'white'
color?: "burgundy" | "white"
}) {
const classNames = hotelMarkerVariants({ color, className })

View File

@@ -1,6 +1,6 @@
import { cva } from 'class-variance-authority'
import { cva } from "class-variance-authority"
import styles from './hotelMarker.module.css'
import styles from "./hotelMarker.module.css"
export const hotelMarkerVariants = cva(styles.icon, {
variants: {
@@ -10,6 +10,6 @@ export const hotelMarkerVariants = cva(styles.icon, {
},
},
defaultVariants: {
color: 'white',
color: "white",
},
})

View File

@@ -1,42 +1,42 @@
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
import { HotelMarkerByType } from './HotelMarkerByType'
import { SignatureHotelEnum } from '@scandic-hotels/common/constants/signatureHotels'
import { Typography } from '../../Typography'
import { HotelMarkerByType } from "./HotelMarkerByType"
import { SignatureHotelEnum } from "@scandic-hotels/common/constants/signatureHotels"
import { Typography } from "../../Typography"
const meta: Meta<typeof HotelMarkerByType> = {
title: 'Patterns/Map/Hotel Marker By Type',
title: "Patterns/Map/Hotel Marker By Type",
component: HotelMarkerByType,
argTypes: {
hotelType: {
control: 'select',
options: ['Regular', 'Signature', 'Scandic Go'],
description: 'Type of hotel',
control: "select",
options: ["Regular", "Signature", "Scandic Go"],
description: "Type of hotel",
table: {
type: { summary: "'Regular' | 'Signature' | 'Scandic Go'" },
// defaultValue: { summary: 'Regular' },
},
mapping: {
Signature: 'signature',
'Scandic Go': 'scandicgo',
Regular: 'regular',
Signature: "signature",
"Scandic Go": "scandicgo",
Regular: "regular",
},
},
hotelId: {
control: 'select',
control: "select",
description: 'ID of the hotel (e.g. "879" for Downtown Camper)',
options: ['Other', ...Object.keys(SignatureHotelEnum)],
options: ["Other", ...Object.keys(SignatureHotelEnum)],
mapping: {
Other: '',
Other: "",
...SignatureHotelEnum,
},
},
size: {
control: 'select',
control: "select",
table: {
type: { summary: "'large' | 'small'" },
},
options: ['large', 'small'],
options: ["large", "small"],
},
},
}
@@ -47,17 +47,17 @@ type Story = StoryObj<typeof HotelMarkerByType>
export const PrimaryDefault: Story = {
args: {
hotelId: 'Other',
hotelType: 'regular',
size: 'large',
hotelId: "Other",
hotelType: "regular",
size: "large",
},
}
export const ScandicGo: Story = {
args: {
hotelId: 'Other',
hotelType: 'scandicgo',
size: 'large',
hotelId: "Other",
hotelType: "scandicgo",
size: "large",
},
argTypes: {
hotelId: {
@@ -75,9 +75,9 @@ export const ScandicGo: Story = {
export const Signature: Story = {
args: {
hotelId: 'DowntownCamper',
hotelType: 'signature',
size: 'large',
hotelId: "DowntownCamper",
hotelType: "signature",
size: "large",
},
argTypes: {
hotelType: {
@@ -86,10 +86,10 @@ export const Signature: Story = {
},
},
hotelId: {
control: 'select',
options: ['Other', ...Object.keys(SignatureHotelEnum)],
control: "select",
options: ["Other", ...Object.keys(SignatureHotelEnum)],
mapping: {
Other: '',
Other: "",
...SignatureHotelEnum,
},
},
@@ -98,28 +98,28 @@ export const Signature: Story = {
const exampleMarkers = [
{
name: 'Default',
hotelId: 'Other',
hotelType: 'regular',
name: "Default",
hotelId: "Other",
hotelType: "regular",
},
{
name: 'Scandic Go',
hotelId: 'Other',
hotelType: 'scandicgo',
name: "Scandic Go",
hotelId: "Other",
hotelType: "scandicgo",
},
...Object.entries(SignatureHotelEnum).map(
([hotelName, hotelId]) =>
({
name: hotelName,
hotelId,
hotelType: 'signature',
hotelType: "signature",
}) as const
),
] as const
export const Examples: Story = {
args: {
size: 'large',
size: "large",
},
argTypes: {
hotelType: {
@@ -136,8 +136,8 @@ export const Examples: Story = {
render: (args) => (
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(180px, 1fr))',
display: "grid",
gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
gap: 16,
}}
>
@@ -145,14 +145,14 @@ export const Examples: Story = {
<div
key={ix}
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
gap: 12,
padding: 8,
borderRadius: 8,
background: 'var(--ds-color-surface-subtle, #F2ECE6)',
background: "var(--ds-color-surface-subtle, #F2ECE6)",
}}
>
<HotelMarkerByType {...args} {...exampleArgs} />

View File

@@ -1,32 +1,31 @@
import { DowntownCamperMarker } from './HotelMarker/SignatureHotel/DowntownCamper'
import { DowntownCamperSmallMarker } from './HotelMarker/SignatureHotel/DowntownCamperSmall'
import { GrandHotelMarker } from './HotelMarker/SignatureHotel/GrandHotel'
import { GrandHotelSmallMarker } from './HotelMarker/SignatureHotel/GrandHotelSmall'
import { HaymarketMarker } from './HotelMarker/SignatureHotel/Haymarket'
import { HaymarketSmallMarker } from './HotelMarker/SignatureHotel/HaymarketSmall'
import { HotelNorgeMarker } from './HotelMarker/SignatureHotel/HotelNorge'
import { HotelNorgeSmallMarker } from './HotelMarker/SignatureHotel/HotelNorgeSmall'
import { MarskiMarker } from './HotelMarker/SignatureHotel/Marski'
import { MarskiSmallMarker } from './HotelMarker/SignatureHotel/MarskiSmall'
import { ScandicMarker } from './HotelMarker/SignatureHotel/Scandic'
import { ScandicGoMarker } from './HotelMarker/SignatureHotel/ScandicGo'
import { ScandicGoSmallMarker } from './HotelMarker/SignatureHotel/ScandicGoSmall'
import { ScandicSmallMarker } from './HotelMarker/SignatureHotel/ScandicSmall'
import { TheDockMarker } from './HotelMarker/SignatureHotel/TheDock'
import { TheDockSmallMarker } from './HotelMarker/SignatureHotel/TheDockSmall'
import { DowntownCamperMarker } from "./HotelMarker/SignatureHotel/DowntownCamper"
import { DowntownCamperSmallMarker } from "./HotelMarker/SignatureHotel/DowntownCamperSmall"
import { GrandHotelMarker } from "./HotelMarker/SignatureHotel/GrandHotel"
import { GrandHotelSmallMarker } from "./HotelMarker/SignatureHotel/GrandHotelSmall"
import { HaymarketMarker } from "./HotelMarker/SignatureHotel/Haymarket"
import { HaymarketSmallMarker } from "./HotelMarker/SignatureHotel/HaymarketSmall"
import { HotelNorgeMarker } from "./HotelMarker/SignatureHotel/HotelNorge"
import { HotelNorgeSmallMarker } from "./HotelMarker/SignatureHotel/HotelNorgeSmall"
import { MarskiMarker } from "./HotelMarker/SignatureHotel/Marski"
import { MarskiSmallMarker } from "./HotelMarker/SignatureHotel/MarskiSmall"
import { ScandicMarker } from "./HotelMarker/SignatureHotel/Scandic"
import { ScandicGoMarker } from "./HotelMarker/SignatureHotel/ScandicGo"
import { ScandicGoSmallMarker } from "./HotelMarker/SignatureHotel/ScandicGoSmall"
import { ScandicSmallMarker } from "./HotelMarker/SignatureHotel/ScandicSmall"
import { TheDockMarker } from "./HotelMarker/SignatureHotel/TheDock"
import { TheDockSmallMarker } from "./HotelMarker/SignatureHotel/TheDockSmall"
import { SignatureHotelEnum } from '@scandic-hotels/common/constants/signatureHotels'
import { SignatureHotelEnum } from "@scandic-hotels/common/constants/signatureHotels"
import {
HotelTypes,
type HotelType,
} from '@scandic-hotels/common/constants/hotelType'
import { MarkerInfo } from '../types'
} from "@scandic-hotels/common/constants/hotelType"
import { MarkerInfo } from "../types"
export interface HotelMarkerByTypeProps
extends MarkerInfo,
React.SVGAttributes<HTMLOrSVGElement> {
size?: 'large' | 'small'
extends MarkerInfo, React.SVGAttributes<HTMLOrSVGElement> {
size?: "large" | "small"
}
type MarkerComponent = React.ComponentType<
React.SVGAttributes<HTMLOrSVGElement>
@@ -35,7 +34,7 @@ type MarkerComponent = React.ComponentType<
export function HotelMarkerByType({
hotelId,
hotelType,
size = 'large',
size = "large",
...props
}: HotelMarkerByTypeProps) {
const sigatureHotelEntry =
@@ -55,14 +54,14 @@ export function HotelMarkerByType({
return <Cmp {...props} />
}
const defaultMarkers: Record<'large' | 'small', MarkerComponent> = {
const defaultMarkers: Record<"large" | "small", MarkerComponent> = {
large: ScandicMarker,
small: ScandicSmallMarker,
}
const byHotelType: Record<
Exclude<HotelType, 'regular' | 'signature'>,
Record<'large' | 'small', MarkerComponent>
Exclude<HotelType, "regular" | "signature">,
Record<"large" | "small", MarkerComponent>
> = {
[HotelTypes.ScandicGo]: {
large: ScandicGoMarker,
@@ -72,7 +71,7 @@ const byHotelType: Record<
const bySignatureHotel: Record<
SignatureHotelEnum,
Record<'large' | 'small', MarkerComponent>
Record<"large" | "small", MarkerComponent>
> = {
[SignatureHotelEnum.Haymarket]: {
large: HaymarketMarker,

View File

@@ -1,12 +1,12 @@
import { IconByIconName } from '../../../Icons/IconByIconName'
import { IconByIconName } from "../../../Icons/IconByIconName"
import {
getIconByPoiGroupAndCategory,
type PointOfInterestGroup,
} from '../utils'
import { poiVariants } from './variants'
} from "../utils"
import { poiVariants } from "./variants"
import type { VariantProps } from 'class-variance-authority'
import type { VariantProps } from "class-variance-authority"
interface PoiMarkerProps extends VariantProps<typeof poiVariants> {
group: PointOfInterestGroup
@@ -18,8 +18,8 @@ export function PoiMarker({
group,
categoryName,
skipBackground,
size = 'small',
className = '',
size = "small",
className = "",
}: PoiMarkerProps) {
const iconName = getIconByPoiGroupAndCategory(group, categoryName)
const classNames = poiVariants({ group, skipBackground, size, className })
@@ -28,8 +28,8 @@ export function PoiMarker({
<span className={classNames}>
<IconByIconName
iconName={iconName}
color={skipBackground ? 'CurrentColor' : 'Icon/Inverted'}
size={size === 'small' ? 16 : size === 'large' ? 24 : 20}
color={skipBackground ? "CurrentColor" : "Icon/Inverted"}
size={size === "small" ? 16 : size === "large" ? 24 : 20}
/>
</span>
) : null

View File

@@ -1,21 +1,21 @@
import { cva } from 'class-variance-authority'
import { cva } from "class-variance-authority"
import type { PointOfInterestGroup } from '../utils'
import styles from './poiMarker.module.css'
import type { PointOfInterestGroup } from "../utils"
import styles from "./poiMarker.module.css"
export const poiVariants = cva(styles.poiMarker, {
variants: {
group: {
['Attractions']: styles.attractions,
['Business']: styles.business,
['Location']: styles.location,
['Parking']: styles.parking,
['Public transport']: styles.publicTransport,
['Shopping & Dining']: styles.shoppingDining,
["Attractions"]: styles.attractions,
["Business"]: styles.business,
["Location"]: styles.location,
["Parking"]: styles.parking,
["Public transport"]: styles.publicTransport,
["Shopping & Dining"]: styles.shoppingDining,
} satisfies Record<PointOfInterestGroup, string>,
skipBackground: {
true: styles.skipBackground,
false: '',
false: "",
},
size: {
small: styles.small,
@@ -25,6 +25,6 @@ export const poiVariants = cva(styles.poiMarker, {
},
defaultVariants: {
skipBackground: false,
size: 'small',
size: "small",
},
})

View File

@@ -1,29 +1,29 @@
import { IconName } from '../../Icons/iconName'
import { IconName } from "../../Icons/iconName"
export type PointOfInterestGroup =
| 'Public transport'
| 'Attractions'
| 'Business'
| 'Location'
| 'Parking'
| 'Shopping & Dining'
| "Public transport"
| "Attractions"
| "Business"
| "Location"
| "Parking"
| "Shopping & Dining"
export function getIconByPoiGroupAndCategory(
group: PointOfInterestGroup,
category?: string
) {
switch (group) {
case 'Public transport':
return category === 'Airport' ? IconName.Airplane : IconName.Train
case 'Attractions':
return category === 'Museum' ? IconName.Museum : IconName.Camera
case 'Business':
case "Public transport":
return category === "Airport" ? IconName.Airplane : IconName.Train
case "Attractions":
return category === "Museum" ? IconName.Museum : IconName.Camera
case "Business":
return IconName.Business
case 'Parking':
case "Parking":
return IconName.Parking
case 'Shopping & Dining':
return category === 'Restaurant' ? IconName.Restaurant : IconName.Shopping
case 'Location':
case "Shopping & Dining":
return category === "Restaurant" ? IconName.Restaurant : IconName.Shopping
case "Location":
default:
return IconName.Location
}

View File

@@ -1,6 +1,6 @@
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
import { FacilityEnum } from '@scandic-hotels/common/constants/facilities'
import { HotelType } from '@scandic-hotels/common/constants/hotelType'
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
import { FacilityEnum } from "@scandic-hotels/common/constants/facilities"
import { HotelType } from "@scandic-hotels/common/constants/hotelType"
export type HotelPin = {
bookingCode?: string | null
@@ -43,12 +43,12 @@ export type HotelPin = {
}
export const PointOfInterestGroups = {
PublicTransport: 'Public transport',
Attractions: 'Attractions',
Business: 'Business',
Location: 'Location',
Parking: 'Parking',
ShoppingAndDining: 'Shopping & Dining',
PublicTransport: "Public transport",
Attractions: "Attractions",
Business: "Business",
Location: "Location",
Parking: "Parking",
ShoppingAndDining: "Shopping & Dining",
} as const
export type PointOfInterestGroup =