From 7a3ee76206b46c5e6b3ee094162df52113ce34a0 Mon Sep 17 00:00:00 2001 From: Anton Gunnarsson Date: Fri, 1 Aug 2025 14:21:05 +0000 Subject: [PATCH] Merged in feat/sw-3145-move-iconchip-to-design-system (pull request #2588) feat(SW-3145): Move IconChip to design-system * Move IconChip to design-system Approved-by: Hrishikesh Vaipurkar --- apps/scandic-web/components/BookingCodeChip/index.tsx | 3 +-- .../MyStay/ReferenceCard/BookingCode/index.tsx | 3 +-- .../HotelReservation/MyStay/Rooms/MultiRoom/Room.tsx | 2 +- .../Rooms/SingleRoom/BookingInformation/BookingCode.tsx | 3 +-- .../components/SidePeeks/BookedRoomSidePeek/index.tsx | 2 +- .../lib/components}/IconChip/iconChip.module.css | 0 .../design-system/lib/components}/IconChip/index.tsx | 4 ++-- .../design-system/lib/components}/IconChip/variants.ts | 4 ++-- packages/design-system/package.json | 1 + 9 files changed, 10 insertions(+), 12 deletions(-) rename {apps/scandic-web/components/TempDesignSystem => packages/design-system/lib/components}/IconChip/iconChip.module.css (100%) rename {apps/scandic-web/components/TempDesignSystem => packages/design-system/lib/components}/IconChip/index.tsx (79%) rename {apps/scandic-web/components/TempDesignSystem => packages/design-system/lib/components}/IconChip/variants.ts (65%) diff --git a/apps/scandic-web/components/BookingCodeChip/index.tsx b/apps/scandic-web/components/BookingCodeChip/index.tsx index 85022e2da..5d9e538b1 100644 --- a/apps/scandic-web/components/BookingCodeChip/index.tsx +++ b/apps/scandic-web/components/BookingCodeChip/index.tsx @@ -1,13 +1,12 @@ import { Button as ButtonRAC } from "react-aria-components" import { useIntl } from "react-intl" +import IconChip from "@scandic-hotels/design-system/IconChip" import DiscountIcon from "@scandic-hotels/design-system/Icons/DiscountIcon" import FilledDiscountIcon from "@scandic-hotels/design-system/Icons/FilledDiscountIcon" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" -import IconChip from "../TempDesignSystem/IconChip" - import styles from "./bookingCodeChip.module.css" type BaseBookingCodeChipProps = { diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/BookingCode/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/BookingCode/index.tsx index 4230d4885..bdfbfdad6 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/BookingCode/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/BookingCode/index.tsx @@ -1,13 +1,12 @@ "use client" import { useIntl } from "react-intl" +import IconChip from "@scandic-hotels/design-system/IconChip" import DiscountIcon from "@scandic-hotels/design-system/Icons/DiscountIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import { useMyStayStore } from "@/stores/my-stay" -import IconChip from "@/components/TempDesignSystem/IconChip" - import styles from "./bookingCode.module.css" export default function BookingCode() { diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/MultiRoom/Room.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/MultiRoom/Room.tsx index 55a2418d8..f55edb920 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/MultiRoom/Room.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/MultiRoom/Room.tsx @@ -4,6 +4,7 @@ import { useIntl } from "react-intl" import { dt } from "@scandic-hotels/common/dt" import { Divider } from "@scandic-hotels/design-system/Divider" import { IconButton } from "@scandic-hotels/design-system/IconButton" +import IconChip from "@scandic-hotels/design-system/IconChip" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import { RateEnum } from "@scandic-hotels/trpc/enums/rate" @@ -15,7 +16,6 @@ import { changeOrCancelDateFormat } from "@/constants/dateFormats" import { IconForFeatureCode } from "@/components/HotelReservation/utils" import Image from "@/components/Image" import Modal from "@/components/Modal" -import IconChip from "@/components/TempDesignSystem/IconChip" import useRateTitles from "@/hooks/booking/useRateTitles" import useLang from "@/hooks/useLang" import { formatPrice } from "@/utils/numberFormatting" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/BookingInformation/BookingCode.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/BookingInformation/BookingCode.tsx index 747ccb723..d9df32383 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/BookingInformation/BookingCode.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/BookingInformation/BookingCode.tsx @@ -1,13 +1,12 @@ "use client" import { useIntl } from "react-intl" +import IconChip from "@scandic-hotels/design-system/IconChip" import DiscountIcon from "@scandic-hotels/design-system/Icons/DiscountIcon" import { Typography } from "@scandic-hotels/design-system/Typography" import { useMyStayStore } from "@/stores/my-stay" -import IconChip from "@/components/TempDesignSystem/IconChip" - export default function BookingCode() { const intl = useIntl() diff --git a/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/index.tsx b/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/index.tsx index 5d5ea9065..1c93cad32 100644 --- a/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/index.tsx +++ b/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/index.tsx @@ -1,6 +1,7 @@ import { useIntl } from "react-intl" import { dt } from "@scandic-hotels/common/dt" +import IconChip from "@scandic-hotels/design-system/IconChip" import DiscountIcon from "@scandic-hotels/design-system/Icons/DiscountIcon" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { Typography } from "@scandic-hotels/design-system/Typography" @@ -15,7 +16,6 @@ import { sumPackages } from "@/components/HotelReservation/utils" import ImageGallery from "@/components/ImageGallery" import Accordion from "@/components/TempDesignSystem/Accordion" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" -import IconChip from "@/components/TempDesignSystem/IconChip" import SidePeekSelfControlled from "@/components/TempDesignSystem/SidePeekSelfControlled" import useLang from "@/hooks/useLang" import { mapApiImagesToGalleryImages } from "@/utils/imageGallery" diff --git a/apps/scandic-web/components/TempDesignSystem/IconChip/iconChip.module.css b/packages/design-system/lib/components/IconChip/iconChip.module.css similarity index 100% rename from apps/scandic-web/components/TempDesignSystem/IconChip/iconChip.module.css rename to packages/design-system/lib/components/IconChip/iconChip.module.css diff --git a/apps/scandic-web/components/TempDesignSystem/IconChip/index.tsx b/packages/design-system/lib/components/IconChip/index.tsx similarity index 79% rename from apps/scandic-web/components/TempDesignSystem/IconChip/index.tsx rename to packages/design-system/lib/components/IconChip/index.tsx index 9d33d7db0..72d787584 100644 --- a/apps/scandic-web/components/TempDesignSystem/IconChip/index.tsx +++ b/packages/design-system/lib/components/IconChip/index.tsx @@ -1,7 +1,7 @@ -import { iconChipVariants } from "./variants" +import { iconChipVariants } from './variants' interface IconChipProps { - color: "blue" | "green" | "red" | null | undefined + color: 'blue' | 'green' | 'red' | null | undefined icon: React.ReactNode children: React.ReactNode className?: string diff --git a/apps/scandic-web/components/TempDesignSystem/IconChip/variants.ts b/packages/design-system/lib/components/IconChip/variants.ts similarity index 65% rename from apps/scandic-web/components/TempDesignSystem/IconChip/variants.ts rename to packages/design-system/lib/components/IconChip/variants.ts index f4ee78c25..9d527ffaa 100644 --- a/apps/scandic-web/components/TempDesignSystem/IconChip/variants.ts +++ b/packages/design-system/lib/components/IconChip/variants.ts @@ -1,6 +1,6 @@ -import { cva } from "class-variance-authority" +import { cva } from 'class-variance-authority' -import styles from "./iconChip.module.css" +import styles from './iconChip.module.css' export const iconChipVariants = cva(styles.chip, { variants: { diff --git a/packages/design-system/package.json b/packages/design-system/package.json index a8df2e1bb..75ffb4c39 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -20,6 +20,7 @@ "./Form/ErrorMessage": "./dist/components/Form/ErrorMessage/index.js", "./Form/Phone": "./dist/components/Form/Phone/index.js", "./Form/RadioCard": "./dist/components/Form/RadioCard/index.js", + "./IconChip": "./dist/components/IconChip/index.js", "./Input": "./dist/components/Input/index.js", "./Label": "./dist/components/Label/index.js", "./OldDSButton": "./dist/components/OldDSButton/index.js",